@linktr.ee/messaging-react 3.0.0 → 3.1.0-rc-1780514752
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Card-Cqld0-Ws.js → Card-0TLA8XHU.js} +3 -3
- package/dist/{Card-Cqld0-Ws.js.map → Card-0TLA8XHU.js.map} +1 -1
- package/dist/{Card-B7ePjYQ6.cjs → Card-B-D_LbnV.cjs} +2 -2
- package/dist/{Card-B7ePjYQ6.cjs.map → Card-B-D_LbnV.cjs.map} +1 -1
- package/dist/{Card-C46z9zz4.js → Card-BaaerKBC.js} +2 -2
- package/dist/{Card-C46z9zz4.js.map → Card-BaaerKBC.js.map} +1 -1
- package/dist/{Card-Cq0x0bbb.cjs → Card-Bfxdewx_.cjs} +2 -2
- package/dist/{Card-Cq0x0bbb.cjs.map → Card-Bfxdewx_.cjs.map} +1 -1
- package/dist/{Card-C-ZIQW_q.js → Card-DZVa2CeI.js} +2 -2
- package/dist/{Card-C-ZIQW_q.js.map → Card-DZVa2CeI.js.map} +1 -1
- package/dist/{Card-Drz28Q-Y.cjs → Card-DbdWDBMe.cjs} +2 -2
- package/dist/{Card-Drz28Q-Y.cjs.map → Card-DbdWDBMe.cjs.map} +1 -1
- package/dist/{LockedThumbnail-D5NHhET2.js → LockedThumbnail-B4gDHeh7.js} +2 -2
- package/dist/{LockedThumbnail-D5NHhET2.js.map → LockedThumbnail-B4gDHeh7.js.map} +1 -1
- package/dist/{LockedThumbnail--h4GTH41.cjs → LockedThumbnail-DkwFwgpU.cjs} +2 -2
- package/dist/{LockedThumbnail--h4GTH41.cjs.map → LockedThumbnail-DkwFwgpU.cjs.map} +1 -1
- package/dist/{index-BUT2yBvJ.js → index-BmCc1-F3.js} +1147 -1118
- package/dist/index-BmCc1-F3.js.map +1 -0
- package/dist/index-Cg-bxSZn.cjs +2 -0
- package/dist/index-Cg-bxSZn.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +30 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/ChannelInfoDialog/ChannelInfoDialog.test.tsx +43 -1
- package/src/components/ChannelInfoDialog/index.tsx +55 -37
- package/src/components/ChannelView.stories.tsx +25 -0
- package/src/components/ChannelView.test.tsx +84 -5
- package/src/components/ChannelView.tsx +30 -2
- package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +42 -0
- package/src/components/CustomMessageInput/index.tsx +38 -12
- package/src/types.ts +35 -0
- package/dist/index-BUT2yBvJ.js.map +0 -1
- package/dist/index-DqNobxVj.cjs +0 -2
- package/dist/index-DqNobxVj.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import O, { createContext as Ge, useContext as He, useCallback as H, useState as z, useRef as K, useEffect as J, useMemo as te, Suspense as Ye } from "react";
|
|
3
3
|
import { StreamChatService as En } from "@linktr.ee/messaging-core";
|
|
4
|
-
import { Chat as In, DateSeparator as Sn, useChannelStateContext as
|
|
5
|
-
import { StarIcon as
|
|
6
|
-
import
|
|
4
|
+
import { Chat as In, DateSeparator as Sn, useChannelStateContext as de, useChatContext as qe, areMessageUIPropsEqual as Tn, useMessageReminder as An, useComponentContext as Ut, Attachment as Mn, EditMessageModal as Dn, MessageBlocked as Rn, MessageBouncePrompt as Ln, MessageDeleted as Pn, MessageIsThreadReplyInChannelButtonIndicator as zn, MessageRepliesCountButton as On, ReminderNotification as Fn, StreamedMessageText as $n, messageHasAttachments as Bn, messageHasReactions as jn, isDateSeparatorMessage as Vn, isMessageBlocked as Un, isMessageBounced as Gn, MessageBounceModal as Hn, MessageText as Mt, Poll as Yn, MessageErrorIcon as qn, useMessageContext as be, useMessageComposer as Wn, useStateStore as Xn, MessageInput as Kn, useMessageInputContext as Jn, useMessageComposerHasSendableData as Zn, AttachmentPreviewList as Qn, QuotedMessagePreview as es, TextareaComposer as ts, MessageTimestamp as Me, AIStates as De, useTypingContext as ns, useAIState as ss, Channel as as, WithComponents as rs, Window as is, MessageList as os, ChannelList as ls } from "stream-chat-react";
|
|
5
|
+
import { StarIcon as Fe, XIcon as pe, SpinnerGapIcon as Re, SignOutIcon as cs, ProhibitInsetIcon as Dt, FlagIcon as Gt, FileIcon as Ht, ImageIcon as ds, SpeakerHighIcon as us, VideoCameraIcon as Yt, FileMdIcon as ms, FileTextIcon as hs, FileZipIcon as fs, FilePptIcon as gs, FileCsvIcon as bs, FileXlsIcon as ps, FileDocIcon as vs, FilePdfIcon as xs, CircleNotchIcon as fe, PlayIcon as $e, PauseIcon as ws, LinkIcon as Ns, DownloadSimpleIcon as ge, GiftIcon as _s, ThumbsUpIcon as ys, ThumbsDownIcon as Cs, TrashSimpleIcon as ks, ArrowUpIcon as Es, SparkleIcon as Be, ProhibitIcon as Is, ArrowLeftIcon as Rt, CaretRightIcon as je, DotsThreeIcon as Lt, PencilSimpleIcon as Ss, CaretLeftIcon as Ts } from "@phosphor-icons/react";
|
|
6
|
+
import y from "classnames";
|
|
7
7
|
import { MessageActions as As, DefaultDropdownActionButton as qt } from "stream-chat-react/experimental";
|
|
8
8
|
import { LinkPreviewsManager as Pt } from "stream-chat";
|
|
9
|
-
const Wt =
|
|
9
|
+
const Wt = Ge({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const Wt = Ve({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), We = () => He(Wt), vi = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,187 +24,187 @@ const Wt = Ve({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
(
|
|
29
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
const o = H(
|
|
28
|
+
(I, ...C) => {
|
|
29
|
+
i && console.log(`🔥 [MessagingProvider] ${I}`, ...C);
|
|
30
30
|
},
|
|
31
31
|
[i]
|
|
32
32
|
);
|
|
33
|
-
|
|
33
|
+
o("🔄 RENDER START", {
|
|
34
34
|
userId: t == null ? void 0 : t.id,
|
|
35
35
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
36
36
|
serviceConfig: !!s,
|
|
37
37
|
capabilities: Object.keys(r)
|
|
38
38
|
});
|
|
39
|
-
const [
|
|
39
|
+
const [l, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, b] = z(!1), [N, v] = z(null), x = K(!1), w = K({
|
|
40
40
|
userId: t == null ? void 0 : t.id,
|
|
41
41
|
apiKey: a,
|
|
42
42
|
serviceConfig: s,
|
|
43
43
|
capabilities: r
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
renderCount:
|
|
44
|
+
}), M = K(0);
|
|
45
|
+
M.current++, o("📊 RENDER INFO", {
|
|
46
|
+
renderCount: M.current,
|
|
47
47
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
48
48
|
propChanges: {
|
|
49
|
-
userChanged:
|
|
50
|
-
apiKeyChanged:
|
|
51
|
-
serviceConfigChanged:
|
|
52
|
-
capabilitiesChanged:
|
|
49
|
+
userChanged: w.current.userId !== (t == null ? void 0 : t.id),
|
|
50
|
+
apiKeyChanged: w.current.apiKey !== a,
|
|
51
|
+
serviceConfigChanged: w.current.serviceConfig !== s,
|
|
52
|
+
capabilitiesChanged: w.current.capabilities !== r
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), w.current = {
|
|
55
55
|
userId: t == null ? void 0 : t.id,
|
|
56
56
|
apiKey: a,
|
|
57
57
|
serviceConfig: s,
|
|
58
58
|
capabilities: r
|
|
59
|
-
},
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
renderCount:
|
|
59
|
+
}, J(() => {
|
|
60
|
+
const I = M.current;
|
|
61
|
+
if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
62
|
+
renderCount: I,
|
|
63
63
|
apiKey: !!a,
|
|
64
64
|
serviceConfig: !!s,
|
|
65
65
|
dependencies: {
|
|
66
66
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
67
67
|
serviceConfigRef: s,
|
|
68
|
-
serviceConfigStable:
|
|
69
|
-
apiKeyStable:
|
|
68
|
+
serviceConfigStable: w.current.serviceConfig === s,
|
|
69
|
+
apiKeyStable: w.current.apiKey === a
|
|
70
70
|
}
|
|
71
71
|
}), !a || !s) {
|
|
72
|
-
|
|
73
|
-
renderCount:
|
|
72
|
+
o("⚠️ SERVICE INIT SKIPPED", {
|
|
73
|
+
renderCount: I,
|
|
74
74
|
reason: "Missing apiKey or serviceConfig"
|
|
75
75
|
});
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
renderCount:
|
|
78
|
+
o("🚀 CREATING NEW SERVICE", {
|
|
79
|
+
renderCount: I,
|
|
80
80
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
81
|
-
serviceConfigChanged:
|
|
81
|
+
serviceConfigChanged: w.current.serviceConfig !== s
|
|
82
82
|
});
|
|
83
|
-
const
|
|
83
|
+
const C = new En({
|
|
84
84
|
...s,
|
|
85
85
|
apiKey: a,
|
|
86
86
|
debug: i
|
|
87
87
|
});
|
|
88
|
-
return d(
|
|
89
|
-
renderCount:
|
|
90
|
-
serviceInstance: !!
|
|
88
|
+
return d(C), o("✅ SERVICE SET", {
|
|
89
|
+
renderCount: I,
|
|
90
|
+
serviceInstance: !!C
|
|
91
91
|
}), () => {
|
|
92
|
-
|
|
93
|
-
renderCount:
|
|
92
|
+
o("🧹 SERVICE CLEANUP", {
|
|
93
|
+
renderCount: I,
|
|
94
94
|
reason: "Effect cleanup"
|
|
95
|
-
}),
|
|
95
|
+
}), C.disconnectUser().catch(console.error);
|
|
96
96
|
};
|
|
97
|
-
}, [a, s, i,
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
if (
|
|
102
|
-
hasService: !!
|
|
97
|
+
}, [a, s, i, o]);
|
|
98
|
+
const A = K(null);
|
|
99
|
+
J(() => {
|
|
100
|
+
var C, k;
|
|
101
|
+
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
|
+
hasService: !!l,
|
|
103
103
|
hasUser: !!t,
|
|
104
104
|
userId: t == null ? void 0 : t.id,
|
|
105
|
-
isConnecting:
|
|
105
|
+
isConnecting: x.current,
|
|
106
106
|
isConnected: u,
|
|
107
|
-
dependencies: { service: !!
|
|
108
|
-
}), !
|
|
109
|
-
|
|
107
|
+
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
108
|
+
}), !l || !t) {
|
|
109
|
+
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
if (
|
|
113
|
-
|
|
112
|
+
if (x.current) {
|
|
113
|
+
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (((
|
|
117
|
-
|
|
116
|
+
if (((C = A.current) == null ? void 0 : C.serviceId) === l && ((k = A.current) == null ? void 0 : k.userId) === t.id) {
|
|
117
|
+
o(
|
|
118
118
|
"⚠️ USER CONNECTION SKIPPED",
|
|
119
119
|
"Already connected this user with this service"
|
|
120
120
|
);
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
(async () => {
|
|
124
|
-
|
|
124
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), x.current = !0, b(!0), v(null);
|
|
125
125
|
try {
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
127
|
+
const E = await l.connectUser(t);
|
|
128
|
+
g(E), f(!0), A.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
clientId:
|
|
130
|
+
clientId: E.userID
|
|
131
131
|
});
|
|
132
|
-
} catch (
|
|
133
|
-
const
|
|
134
|
-
v(
|
|
132
|
+
} catch (E) {
|
|
133
|
+
const D = E instanceof Error ? E.message : "Connection failed";
|
|
134
|
+
v(D), o("❌ USER CONNECTION ERROR", {
|
|
135
135
|
userId: t.id,
|
|
136
|
-
error:
|
|
136
|
+
error: D
|
|
137
137
|
});
|
|
138
138
|
} finally {
|
|
139
|
-
b(!1),
|
|
139
|
+
b(!1), x.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
140
140
|
userId: t.id,
|
|
141
141
|
isConnected: u
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
})();
|
|
145
|
-
}, [
|
|
146
|
-
hasService: !!
|
|
145
|
+
}, [l, t, o, u]), J(() => (o("🔌 CLEANUP EFFECT REGISTERED", {
|
|
146
|
+
hasService: !!l,
|
|
147
147
|
isConnected: u
|
|
148
148
|
}), () => {
|
|
149
|
-
|
|
149
|
+
l && u ? (o(
|
|
150
150
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
151
151
|
"Cleaning up connection on unmount"
|
|
152
|
-
),
|
|
153
|
-
hasService: !!
|
|
152
|
+
), A.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
|
|
153
|
+
hasService: !!l,
|
|
154
154
|
isConnected: u
|
|
155
155
|
});
|
|
156
|
-
}), [
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
hasService: !!
|
|
156
|
+
}), [l, u, o]);
|
|
157
|
+
const S = H(async () => {
|
|
158
|
+
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
159
|
+
hasService: !!l,
|
|
160
160
|
hasUser: !!t
|
|
161
|
-
}), !
|
|
162
|
-
|
|
161
|
+
}), !l || !t) {
|
|
162
|
+
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
|
|
166
166
|
try {
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
} catch (
|
|
171
|
-
const
|
|
172
|
-
v(
|
|
167
|
+
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
168
|
+
const I = await l.connectUser(t);
|
|
169
|
+
g(I), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
170
|
+
} catch (I) {
|
|
171
|
+
const C = I instanceof Error ? I.message : "Refresh failed";
|
|
172
|
+
v(C), o("❌ CONNECTION REFRESH ERROR", {
|
|
173
173
|
userId: t.id,
|
|
174
|
-
error:
|
|
174
|
+
error: C
|
|
175
175
|
});
|
|
176
176
|
} finally {
|
|
177
|
-
b(!1),
|
|
177
|
+
b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
178
178
|
}
|
|
179
|
-
}, [
|
|
180
|
-
hasService: !!
|
|
179
|
+
}, [l, t, o]), L = O.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
180
|
+
hasService: !!l,
|
|
181
181
|
hasClient: !!m,
|
|
182
182
|
isConnected: u,
|
|
183
183
|
isLoading: c,
|
|
184
|
-
hasError: !!
|
|
184
|
+
hasError: !!N,
|
|
185
185
|
capabilitiesKeys: Object.keys(r)
|
|
186
186
|
}), {
|
|
187
|
-
service:
|
|
187
|
+
service: l,
|
|
188
188
|
client: m,
|
|
189
189
|
isConnected: u,
|
|
190
190
|
isLoading: c,
|
|
191
|
-
error:
|
|
191
|
+
error: N,
|
|
192
192
|
capabilities: r,
|
|
193
|
-
refreshConnection:
|
|
193
|
+
refreshConnection: S,
|
|
194
194
|
debug: i
|
|
195
195
|
}), [
|
|
196
|
-
|
|
196
|
+
l,
|
|
197
197
|
m,
|
|
198
198
|
u,
|
|
199
199
|
c,
|
|
200
|
-
|
|
200
|
+
N,
|
|
201
201
|
r,
|
|
202
|
-
|
|
202
|
+
S,
|
|
203
203
|
i,
|
|
204
|
-
|
|
204
|
+
o
|
|
205
205
|
]);
|
|
206
|
-
return
|
|
207
|
-
renderCount:
|
|
206
|
+
return o("🔄 RENDER END", {
|
|
207
|
+
renderCount: M.current,
|
|
208
208
|
willRenderChat: !!(m && u),
|
|
209
209
|
contextValueReady: !!L
|
|
210
210
|
}), /* @__PURE__ */ n(Wt.Provider, { value: L, children: m && u ? /* @__PURE__ */ n(
|
|
@@ -217,22 +217,22 @@ const Wt = Ve({
|
|
|
217
217
|
children: e
|
|
218
218
|
}
|
|
219
219
|
) : e });
|
|
220
|
-
}, Ms = () =>
|
|
220
|
+
}, Ms = () => We(), Xt = (e) => {
|
|
221
221
|
var a, r;
|
|
222
222
|
const [t, s] = z(
|
|
223
223
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
224
224
|
);
|
|
225
|
-
return
|
|
226
|
-
var
|
|
225
|
+
return J(() => {
|
|
226
|
+
var o;
|
|
227
227
|
if (!e) {
|
|
228
228
|
s(!1);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
s(!!((
|
|
232
|
-
const i = (
|
|
231
|
+
s(!!((o = e.state.membership) != null && o.pinned_at));
|
|
232
|
+
const i = (l) => {
|
|
233
233
|
var d;
|
|
234
234
|
s(
|
|
235
|
-
|
|
235
|
+
l != null && l.member ? !!l.member.pinned_at : !!((d = e.state.membership) != null && d.pinned_at)
|
|
236
236
|
);
|
|
237
237
|
};
|
|
238
238
|
return e.on("member.updated", i), () => {
|
|
@@ -247,7 +247,7 @@ function zt(e, t) {
|
|
|
247
247
|
const s = e == null ? void 0 : e.trim();
|
|
248
248
|
return !s || t && s === t ? !1 : !Rs(s);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Se(e) {
|
|
251
251
|
return zt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : zt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
252
252
|
}
|
|
253
253
|
const Ot = [
|
|
@@ -290,19 +290,19 @@ function Ps(e) {
|
|
|
290
290
|
const s = Ls(e) % Ot.length;
|
|
291
291
|
return Ot[s];
|
|
292
292
|
}
|
|
293
|
-
const
|
|
293
|
+
const ne = ({
|
|
294
294
|
id: e,
|
|
295
295
|
image: t,
|
|
296
296
|
size: s = 40,
|
|
297
297
|
className: a,
|
|
298
298
|
starred: r = !1,
|
|
299
299
|
shape: i = "squircle",
|
|
300
|
-
dmAgentEnabled:
|
|
300
|
+
dmAgentEnabled: o = !1
|
|
301
301
|
}) => {
|
|
302
|
-
const
|
|
302
|
+
const l = Ps(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : {
|
|
303
303
|
borderRadius: "33%",
|
|
304
304
|
cornerShape: "superellipse(1.3)"
|
|
305
|
-
},
|
|
305
|
+
}, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
306
306
|
"img",
|
|
307
307
|
{
|
|
308
308
|
src: t,
|
|
@@ -313,17 +313,17 @@ const Z = ({
|
|
|
313
313
|
"div",
|
|
314
314
|
{
|
|
315
315
|
"aria-hidden": "true",
|
|
316
|
-
className:
|
|
316
|
+
className: y(
|
|
317
317
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
318
318
|
m
|
|
319
319
|
),
|
|
320
|
-
children:
|
|
320
|
+
children: l
|
|
321
321
|
}
|
|
322
322
|
) });
|
|
323
323
|
return /* @__PURE__ */ h(
|
|
324
324
|
"div",
|
|
325
325
|
{
|
|
326
|
-
className:
|
|
326
|
+
className: y(
|
|
327
327
|
"relative flex-shrink-0 !bg-transparent",
|
|
328
328
|
a
|
|
329
329
|
),
|
|
@@ -338,33 +338,33 @@ const Z = ({
|
|
|
338
338
|
{
|
|
339
339
|
"aria-hidden": "true",
|
|
340
340
|
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)]",
|
|
341
|
-
children: /* @__PURE__ */ n(
|
|
341
|
+
children: /* @__PURE__ */ n(Fe, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
344
|
/* @__PURE__ */ n(
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
"data-testid": "avatar-ring",
|
|
348
|
-
className:
|
|
348
|
+
className: y(
|
|
349
349
|
"h-full w-full",
|
|
350
350
|
"bg-transparent"
|
|
351
351
|
),
|
|
352
352
|
style: {
|
|
353
353
|
...u,
|
|
354
|
-
...
|
|
355
|
-
borderWidth: `${
|
|
354
|
+
...o && {
|
|
355
|
+
borderWidth: `${g}px`,
|
|
356
356
|
borderStyle: "solid",
|
|
357
357
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
358
358
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
359
359
|
}
|
|
360
360
|
},
|
|
361
|
-
children:
|
|
361
|
+
children: f
|
|
362
362
|
}
|
|
363
363
|
)
|
|
364
364
|
]
|
|
365
365
|
}
|
|
366
366
|
);
|
|
367
|
-
},
|
|
367
|
+
}, ye = ({
|
|
368
368
|
variant: e = "default",
|
|
369
369
|
className: t,
|
|
370
370
|
children: s,
|
|
@@ -373,7 +373,7 @@ const Z = ({
|
|
|
373
373
|
"button",
|
|
374
374
|
{
|
|
375
375
|
type: "button",
|
|
376
|
-
className:
|
|
376
|
+
className: y(
|
|
377
377
|
"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",
|
|
378
378
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
379
379
|
t
|
|
@@ -387,7 +387,7 @@ function zs({ label: e, className: t, children: s, ...a }) {
|
|
|
387
387
|
"button",
|
|
388
388
|
{
|
|
389
389
|
type: "button",
|
|
390
|
-
className:
|
|
390
|
+
className: y(
|
|
391
391
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
392
392
|
{
|
|
393
393
|
"cursor-not-allowed opacity-50": a.disabled,
|
|
@@ -404,7 +404,7 @@ function zs({ label: e, className: t, children: s, ...a }) {
|
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
406
|
function Os({ onClick: e }) {
|
|
407
|
-
return /* @__PURE__ */ n(zs, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(
|
|
407
|
+
return /* @__PURE__ */ n(zs, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
408
408
|
}
|
|
409
409
|
const Fs = ({
|
|
410
410
|
dialogRef: e,
|
|
@@ -413,83 +413,85 @@ const Fs = ({
|
|
|
413
413
|
participantDisplayName: a,
|
|
414
414
|
channel: r,
|
|
415
415
|
followerStatusLabel: i,
|
|
416
|
-
onLeaveConversation:
|
|
417
|
-
onBlockParticipant:
|
|
416
|
+
onLeaveConversation: o,
|
|
417
|
+
onBlockParticipant: l,
|
|
418
418
|
showDeleteConversation: d = !0,
|
|
419
|
-
|
|
419
|
+
showBlockParticipant: m = !0,
|
|
420
|
+
showReportParticipant: g = !0,
|
|
421
|
+
onDeleteConversationClick: u,
|
|
420
422
|
onBlockParticipantClick: f,
|
|
421
|
-
onReportParticipantClick:
|
|
422
|
-
customProfileContent:
|
|
423
|
-
customChannelActions:
|
|
423
|
+
onReportParticipantClick: c,
|
|
424
|
+
customProfileContent: b,
|
|
425
|
+
customChannelActions: N
|
|
424
426
|
}) => {
|
|
425
|
-
var
|
|
426
|
-
const { service:
|
|
427
|
-
var
|
|
428
|
-
if (!(!
|
|
427
|
+
var B, Y, W, $;
|
|
428
|
+
const { service: v, debug: x } = We(), [w, M] = z(!1), [A, S] = z(!1), [L, I] = z(!1), C = H(async () => {
|
|
429
|
+
var p;
|
|
430
|
+
if (!(!m || !v || !((p = s == null ? void 0 : s.user) != null && p.id)))
|
|
429
431
|
try {
|
|
430
|
-
const
|
|
431
|
-
(
|
|
432
|
-
var
|
|
433
|
-
return
|
|
432
|
+
const R = (await v.getBlockedUsers()).some(
|
|
433
|
+
(T) => {
|
|
434
|
+
var j;
|
|
435
|
+
return T.blocked_user_id === ((j = s == null ? void 0 : s.user) == null ? void 0 : j.id);
|
|
434
436
|
}
|
|
435
437
|
);
|
|
436
|
-
|
|
437
|
-
} catch (
|
|
438
|
+
M(R);
|
|
439
|
+
} catch (_) {
|
|
438
440
|
console.error(
|
|
439
441
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
440
|
-
|
|
442
|
+
_
|
|
441
443
|
);
|
|
442
444
|
}
|
|
443
|
-
}, [
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}, [
|
|
447
|
-
const
|
|
448
|
-
var
|
|
449
|
-
if (!
|
|
450
|
-
|
|
445
|
+
}, [v, (B = s == null ? void 0 : s.user) == null ? void 0 : B.id, m]);
|
|
446
|
+
J(() => {
|
|
447
|
+
C();
|
|
448
|
+
}, [C]);
|
|
449
|
+
const k = async () => {
|
|
450
|
+
var p;
|
|
451
|
+
if (!A) {
|
|
452
|
+
u == null || u(), x && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
|
|
451
453
|
try {
|
|
452
|
-
const
|
|
453
|
-
await r.hide(
|
|
454
|
-
} catch (
|
|
455
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
454
|
+
const _ = ((p = r._client) == null ? void 0 : p.userID) ?? null;
|
|
455
|
+
await r.hide(_, !1), o && await o(r), t();
|
|
456
|
+
} catch (_) {
|
|
457
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", _);
|
|
456
458
|
} finally {
|
|
457
|
-
|
|
459
|
+
S(!1);
|
|
458
460
|
}
|
|
459
461
|
}
|
|
460
|
-
},
|
|
461
|
-
var
|
|
462
|
-
if (!(
|
|
463
|
-
f == null || f(),
|
|
462
|
+
}, E = async () => {
|
|
463
|
+
var p, _, R;
|
|
464
|
+
if (!(L || !v)) {
|
|
465
|
+
f == null || f(), x && console.log("[ChannelInfoDialog] Block member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), I(!0);
|
|
464
466
|
try {
|
|
465
|
-
await
|
|
466
|
-
} catch (
|
|
467
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
467
|
+
await v.blockUser((_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), l && await l((R = s == null ? void 0 : s.user) == null ? void 0 : R.id), t();
|
|
468
|
+
} catch (T) {
|
|
469
|
+
console.error("[ChannelInfoDialog] Failed to block member", T);
|
|
468
470
|
} finally {
|
|
469
|
-
|
|
471
|
+
I(!1);
|
|
470
472
|
}
|
|
471
473
|
}
|
|
472
|
-
},
|
|
473
|
-
var
|
|
474
|
-
if (!(
|
|
475
|
-
f == null || f(),
|
|
474
|
+
}, D = async () => {
|
|
475
|
+
var p, _, R;
|
|
476
|
+
if (!(L || !v)) {
|
|
477
|
+
f == null || f(), x && console.log("[ChannelInfoDialog] Unblock member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), I(!0);
|
|
476
478
|
try {
|
|
477
|
-
await
|
|
478
|
-
} catch (
|
|
479
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
479
|
+
await v.unBlockUser((_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), l && await l((R = s == null ? void 0 : s.user) == null ? void 0 : R.id), t();
|
|
480
|
+
} catch (T) {
|
|
481
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", T);
|
|
480
482
|
} finally {
|
|
481
|
-
|
|
483
|
+
I(!1);
|
|
482
484
|
}
|
|
483
485
|
}
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
+
}, V = () => {
|
|
487
|
+
c == null || c(), t(), window.open(
|
|
486
488
|
"https://linktr.ee/s/about/trust-center/report",
|
|
487
489
|
"_blank",
|
|
488
490
|
"noopener,noreferrer"
|
|
489
491
|
);
|
|
490
492
|
};
|
|
491
493
|
if (!s) return null;
|
|
492
|
-
const
|
|
494
|
+
const F = a ?? Se(s.user), X = (Y = s.user) == null ? void 0 : Y.image, U = (W = s.user) == null ? void 0 : W.username, G = U ? `linktr.ee/${U}` : void 0, P = (($ = s.user) == null ? void 0 : $.id) || "unknown";
|
|
493
495
|
return (
|
|
494
496
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
495
497
|
/* @__PURE__ */ n(
|
|
@@ -498,8 +500,8 @@ const Fs = ({
|
|
|
498
500
|
ref: e,
|
|
499
501
|
className: "mes-dialog group",
|
|
500
502
|
onClose: t,
|
|
501
|
-
onClick: (
|
|
502
|
-
|
|
503
|
+
onClick: (p) => {
|
|
504
|
+
p.target === e.current && t();
|
|
503
505
|
},
|
|
504
506
|
children: /* @__PURE__ */ h("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
505
507
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
@@ -515,19 +517,19 @@ const Fs = ({
|
|
|
515
517
|
children: [
|
|
516
518
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-3 w-full", children: [
|
|
517
519
|
/* @__PURE__ */ n(
|
|
518
|
-
|
|
520
|
+
ne,
|
|
519
521
|
{
|
|
520
|
-
id:
|
|
521
|
-
name:
|
|
522
|
-
image:
|
|
522
|
+
id: P,
|
|
523
|
+
name: F,
|
|
524
|
+
image: X,
|
|
523
525
|
size: 88,
|
|
524
526
|
shape: "circle"
|
|
525
527
|
}
|
|
526
528
|
),
|
|
527
529
|
/* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
528
|
-
/* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
529
|
-
|
|
530
|
-
i && !
|
|
530
|
+
/* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children: F }),
|
|
531
|
+
G && /* @__PURE__ */ n("p", { className: "truncate text-sm text-[#00000055]", children: G }),
|
|
532
|
+
i && !b && /* @__PURE__ */ n(
|
|
531
533
|
"span",
|
|
532
534
|
{
|
|
533
535
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -543,81 +545,81 @@ const Fs = ({
|
|
|
543
545
|
)
|
|
544
546
|
] })
|
|
545
547
|
] }),
|
|
546
|
-
|
|
548
|
+
b && /* @__PURE__ */ n("div", { className: "w-full", children: b })
|
|
547
549
|
]
|
|
548
550
|
}
|
|
549
551
|
),
|
|
550
552
|
/* @__PURE__ */ h("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
551
553
|
d && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
552
|
-
|
|
554
|
+
ye,
|
|
553
555
|
{
|
|
554
|
-
onClick:
|
|
555
|
-
disabled:
|
|
556
|
-
"aria-busy":
|
|
556
|
+
onClick: k,
|
|
557
|
+
disabled: A,
|
|
558
|
+
"aria-busy": A,
|
|
557
559
|
children: [
|
|
558
|
-
|
|
560
|
+
A ? /* @__PURE__ */ n(Re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(cs, { className: "h-5 w-5" }),
|
|
559
561
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
560
562
|
]
|
|
561
563
|
}
|
|
562
564
|
) }),
|
|
563
|
-
/* @__PURE__ */ n("li", { children:
|
|
564
|
-
|
|
565
|
+
m && /* @__PURE__ */ n("li", { children: w ? /* @__PURE__ */ h(
|
|
566
|
+
ye,
|
|
565
567
|
{
|
|
566
|
-
onClick:
|
|
567
|
-
disabled:
|
|
568
|
-
"aria-busy":
|
|
568
|
+
onClick: D,
|
|
569
|
+
disabled: L,
|
|
570
|
+
"aria-busy": L,
|
|
569
571
|
children: [
|
|
570
|
-
|
|
572
|
+
L ? /* @__PURE__ */ n(Re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
|
|
571
573
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
572
574
|
]
|
|
573
575
|
}
|
|
574
576
|
) : /* @__PURE__ */ h(
|
|
575
|
-
|
|
577
|
+
ye,
|
|
576
578
|
{
|
|
577
|
-
onClick:
|
|
578
|
-
disabled:
|
|
579
|
-
"aria-busy":
|
|
579
|
+
onClick: E,
|
|
580
|
+
disabled: L,
|
|
581
|
+
"aria-busy": L,
|
|
580
582
|
children: [
|
|
581
|
-
|
|
583
|
+
L ? /* @__PURE__ */ n(Re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
|
|
582
584
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
583
585
|
]
|
|
584
586
|
}
|
|
585
587
|
) }),
|
|
586
|
-
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
588
|
+
g && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ye, { variant: "danger", onClick: V, children: [
|
|
587
589
|
/* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
588
590
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
589
591
|
] }) }),
|
|
590
|
-
|
|
592
|
+
N
|
|
591
593
|
] })
|
|
592
594
|
] })
|
|
593
595
|
] })
|
|
594
596
|
}
|
|
595
597
|
)
|
|
596
598
|
);
|
|
597
|
-
}, $s = (e) => /* @__PURE__ */ n(Sn, { ...e, position: "center" }),
|
|
599
|
+
}, $s = (e) => /* @__PURE__ */ n(Sn, { ...e, position: "center" }), Ve = "vote_up", Ue = "vote_down";
|
|
598
600
|
function Bs(e) {
|
|
599
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
601
|
+
return e != null && e.length ? e.some((t) => t.type === Ue) ? "down" : e.some((t) => t.type === Ve) ? "up" : null : null;
|
|
600
602
|
}
|
|
601
603
|
function js(e) {
|
|
602
|
-
const { channel: t } =
|
|
604
|
+
const { channel: t } = de(), { client: s } = qe("useMessageVote"), a = te(
|
|
603
605
|
() => Bs(e.own_reactions),
|
|
604
606
|
[e.own_reactions]
|
|
605
|
-
), r =
|
|
607
|
+
), r = H(async () => {
|
|
606
608
|
if (s != null && s.userID)
|
|
607
609
|
try {
|
|
608
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
610
|
+
a === "up" ? await t.deleteReaction(e.id, Ve) : await t.sendReaction(
|
|
609
611
|
e.id,
|
|
610
|
-
{ type:
|
|
612
|
+
{ type: Ve },
|
|
611
613
|
{ enforce_unique: !0, skip_push: !0 }
|
|
612
614
|
);
|
|
613
615
|
} catch {
|
|
614
616
|
}
|
|
615
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
617
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = H(async () => {
|
|
616
618
|
if (s != null && s.userID)
|
|
617
619
|
try {
|
|
618
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
620
|
+
a === "down" ? await t.deleteReaction(e.id, Ue) : await t.sendReaction(
|
|
619
621
|
e.id,
|
|
620
|
-
{ type:
|
|
622
|
+
{ type: Ue },
|
|
621
623
|
{ enforce_unique: !0, skip_push: !0 }
|
|
622
624
|
);
|
|
623
625
|
} catch {
|
|
@@ -636,13 +638,13 @@ function Kt({
|
|
|
636
638
|
const s = e == null ? void 0 : e.text, a = Vs(t);
|
|
637
639
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
638
640
|
}
|
|
639
|
-
const Us =
|
|
641
|
+
const Us = O.lazy(() => import("./Card-DZVa2CeI.js")), Gs = O.lazy(() => import("./Card-BaaerKBC.js")), Hs = O.lazy(() => import("./Card-0TLA8XHU.js")), Xe = () => /* @__PURE__ */ n(
|
|
640
642
|
"div",
|
|
641
643
|
{
|
|
642
644
|
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)]",
|
|
643
645
|
"aria-hidden": !0
|
|
644
646
|
}
|
|
645
|
-
), Ys = (e) => /* @__PURE__ */ n(
|
|
647
|
+
), Ys = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Us, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Gs, { ...e }) }), Zt = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Hs, { ...e }) }), qs = Jt, Ws = Zt, Ft = { Composer: Ys, Sent: Jt, Received: Zt, Creator: qs, Visitor: Ws }, Xs = [
|
|
646
648
|
[/pdf/, "pdf"],
|
|
647
649
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
648
650
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -652,7 +654,7 @@ const Us = $.lazy(() => import("./Card-C-ZIQW_q.js")), Gs = $.lazy(() => import(
|
|
|
652
654
|
[/plain|rtf/, "text"],
|
|
653
655
|
[/markdown/, "markdown"]
|
|
654
656
|
];
|
|
655
|
-
function
|
|
657
|
+
function se(e) {
|
|
656
658
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
657
659
|
}
|
|
658
660
|
function Qt(e) {
|
|
@@ -678,11 +680,11 @@ const Ks = {
|
|
|
678
680
|
generic: Ht
|
|
679
681
|
};
|
|
680
682
|
function Zs(e) {
|
|
681
|
-
const t =
|
|
683
|
+
const t = se(e);
|
|
682
684
|
return t !== "document" ? Ks[t] : Js[Qt(e)];
|
|
683
685
|
}
|
|
684
|
-
function
|
|
685
|
-
return
|
|
686
|
+
function ce(e, t) {
|
|
687
|
+
return O.createElement(Zs(e), t);
|
|
686
688
|
}
|
|
687
689
|
const Qs = (e) => {
|
|
688
690
|
var t, s;
|
|
@@ -694,71 +696,71 @@ const Qs = (e) => {
|
|
|
694
696
|
autoPlay: a = !1,
|
|
695
697
|
playing: r,
|
|
696
698
|
loop: i = !1,
|
|
697
|
-
controls:
|
|
698
|
-
showProgress:
|
|
699
|
+
controls: o = !0,
|
|
700
|
+
showProgress: l = !1,
|
|
699
701
|
muted: d = !1,
|
|
700
702
|
onContainerClick: m
|
|
701
703
|
}) => {
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
}, []),
|
|
705
|
-
const
|
|
706
|
-
if (!
|
|
707
|
-
const
|
|
704
|
+
const g = se(t), u = K(null), f = K(null), c = K(null), b = K(r), [N, v] = z(a), [x, w] = z(0), [M, A] = z(!1), [S, L] = z(!1), [I, C] = z(!1), [k, E] = z(!1), [D, V] = z(!0), [F, X] = z(null), U = H(() => {
|
|
705
|
+
C(!1), v(!0);
|
|
706
|
+
}, []), G = H((p) => {
|
|
707
|
+
const _ = f.current;
|
|
708
|
+
if (!_) return 0;
|
|
709
|
+
const R = _.getBoundingClientRect();
|
|
708
710
|
return Math.max(
|
|
709
711
|
0,
|
|
710
|
-
Math.min(1, (Qs(p) -
|
|
712
|
+
Math.min(1, (Qs(p) - R.left) / R.width)
|
|
711
713
|
);
|
|
712
|
-
}, []),
|
|
713
|
-
const
|
|
714
|
-
|
|
715
|
-
}, []),
|
|
716
|
-
p.stopPropagation(),
|
|
717
|
-
const
|
|
718
|
-
|
|
714
|
+
}, []), P = H((p) => {
|
|
715
|
+
const _ = u.current;
|
|
716
|
+
_ && _.duration && (_.currentTime = p * _.duration);
|
|
717
|
+
}, []), B = (p) => {
|
|
718
|
+
p.stopPropagation(), A(!0);
|
|
719
|
+
const _ = G(p);
|
|
720
|
+
w(_), P(_);
|
|
719
721
|
};
|
|
720
|
-
|
|
722
|
+
J(() => {
|
|
721
723
|
r !== void 0 && r !== b.current && (b.current = r, v(r));
|
|
722
|
-
}, [r]),
|
|
723
|
-
if (!
|
|
724
|
+
}, [r]), J(() => {
|
|
725
|
+
if (!N) {
|
|
724
726
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
725
727
|
return;
|
|
726
728
|
}
|
|
727
729
|
const p = () => {
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
+
const _ = u.current;
|
|
731
|
+
_ && _.duration && !M && w(_.currentTime / _.duration), c.current = requestAnimationFrame(p);
|
|
730
732
|
};
|
|
731
733
|
return c.current = requestAnimationFrame(p), () => {
|
|
732
734
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
733
735
|
};
|
|
734
|
-
}, [
|
|
736
|
+
}, [N, M]), J(() => {
|
|
735
737
|
const p = u.current;
|
|
736
|
-
p && (
|
|
737
|
-
v(!1),
|
|
738
|
+
p && (N ? p.play().catch((_) => {
|
|
739
|
+
v(!1), C(!0);
|
|
738
740
|
}) : p.pause());
|
|
739
|
-
}, [
|
|
740
|
-
if (!
|
|
741
|
-
const p = (
|
|
742
|
-
|
|
741
|
+
}, [N]), J(() => {
|
|
742
|
+
if (!M) return;
|
|
743
|
+
const p = (R) => w(G(R)), _ = (R) => {
|
|
744
|
+
A(!1), P(G(R));
|
|
743
745
|
};
|
|
744
|
-
return window.addEventListener("mousemove", p), window.addEventListener("mouseup",
|
|
745
|
-
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup",
|
|
746
|
+
return window.addEventListener("mousemove", p), window.addEventListener("mouseup", _), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", _), () => {
|
|
747
|
+
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", _), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", _);
|
|
746
748
|
};
|
|
747
|
-
}, [
|
|
748
|
-
const
|
|
749
|
+
}, [M, G, P]);
|
|
750
|
+
const Y = F ? { aspectRatio: String(F) } : void 0, W = F ? "" : " aspect-video", $ = Math.round(x * 100);
|
|
749
751
|
return /* @__PURE__ */ h(
|
|
750
752
|
"div",
|
|
751
753
|
{
|
|
752
754
|
role: "button",
|
|
753
755
|
tabIndex: 0,
|
|
754
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
755
|
-
style:
|
|
756
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${W}`,
|
|
757
|
+
style: Y,
|
|
756
758
|
onClick: (p) => {
|
|
757
759
|
if (m) {
|
|
758
760
|
m(p);
|
|
759
761
|
return;
|
|
760
762
|
}
|
|
761
|
-
|
|
763
|
+
I || o && v((_) => !_);
|
|
762
764
|
},
|
|
763
765
|
onKeyDown: (p) => {
|
|
764
766
|
if (!(p.key !== "Enter" && p.key !== " ")) {
|
|
@@ -766,11 +768,11 @@ const Qs = (e) => {
|
|
|
766
768
|
m(p);
|
|
767
769
|
return;
|
|
768
770
|
}
|
|
769
|
-
|
|
771
|
+
I || o && v((_) => !_);
|
|
770
772
|
}
|
|
771
773
|
},
|
|
772
774
|
children: [
|
|
773
|
-
s && (
|
|
775
|
+
s && (g === "audio" || D) && /* @__PURE__ */ n(
|
|
774
776
|
"img",
|
|
775
777
|
{
|
|
776
778
|
src: s,
|
|
@@ -778,11 +780,11 @@ const Qs = (e) => {
|
|
|
778
780
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
779
781
|
}
|
|
780
782
|
),
|
|
781
|
-
!s && (
|
|
783
|
+
!s && (g === "audio" || D) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
|
|
782
784
|
className: "size-12 text-black/20",
|
|
783
785
|
weight: "regular"
|
|
784
786
|
}) }),
|
|
785
|
-
/* @__PURE__ */ n("div", { className: "absolute inset-0", children:
|
|
787
|
+
/* @__PURE__ */ n("div", { className: "absolute inset-0", children: g === "audio" ? /* @__PURE__ */ n(
|
|
786
788
|
"audio",
|
|
787
789
|
{
|
|
788
790
|
ref: u,
|
|
@@ -790,14 +792,14 @@ const Qs = (e) => {
|
|
|
790
792
|
loop: i,
|
|
791
793
|
muted: d,
|
|
792
794
|
style: { width: "100%", height: "100%" },
|
|
793
|
-
onLoadStart: () =>
|
|
795
|
+
onLoadStart: () => E(!0),
|
|
794
796
|
onCanPlay: () => {
|
|
795
|
-
|
|
797
|
+
E(!1), V(!1);
|
|
796
798
|
},
|
|
797
|
-
onWaiting: () =>
|
|
798
|
-
onPlay: () =>
|
|
799
|
+
onWaiting: () => E(!0),
|
|
800
|
+
onPlay: () => C(!1),
|
|
799
801
|
onEnded: () => {
|
|
800
|
-
i || (v(!1),
|
|
802
|
+
i || (v(!1), w(0));
|
|
801
803
|
},
|
|
802
804
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
803
805
|
}
|
|
@@ -810,30 +812,30 @@ const Qs = (e) => {
|
|
|
810
812
|
muted: d,
|
|
811
813
|
playsInline: !0,
|
|
812
814
|
style: { width: "100%", height: "100%" },
|
|
813
|
-
onLoadStart: () =>
|
|
815
|
+
onLoadStart: () => E(!0),
|
|
814
816
|
onCanPlay: () => {
|
|
815
|
-
|
|
817
|
+
E(!1), V(!1);
|
|
816
818
|
},
|
|
817
|
-
onWaiting: () =>
|
|
818
|
-
onPlay: () =>
|
|
819
|
+
onWaiting: () => E(!0),
|
|
820
|
+
onPlay: () => C(!1),
|
|
819
821
|
onLoadedMetadata: () => {
|
|
820
822
|
const p = u.current;
|
|
821
|
-
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight &&
|
|
823
|
+
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && X(p.videoWidth / p.videoHeight);
|
|
822
824
|
},
|
|
823
825
|
onEnded: () => {
|
|
824
|
-
i || (v(!1),
|
|
826
|
+
i || (v(!1), w(0));
|
|
825
827
|
},
|
|
826
828
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
827
829
|
}
|
|
828
830
|
) }),
|
|
829
|
-
|
|
830
|
-
|
|
831
|
+
k && !I && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
832
|
+
fe,
|
|
831
833
|
{
|
|
832
834
|
className: "size-8 animate-spin text-white/80",
|
|
833
835
|
weight: "bold"
|
|
834
836
|
}
|
|
835
837
|
) }),
|
|
836
|
-
|
|
838
|
+
I && !o && /* @__PURE__ */ n(
|
|
837
839
|
"div",
|
|
838
840
|
{
|
|
839
841
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -841,51 +843,51 @@ const Qs = (e) => {
|
|
|
841
843
|
tabIndex: 0,
|
|
842
844
|
"aria-label": "Play preview",
|
|
843
845
|
onClick: (p) => {
|
|
844
|
-
p.stopPropagation(),
|
|
846
|
+
p.stopPropagation(), U();
|
|
845
847
|
},
|
|
846
848
|
onKeyDown: (p) => {
|
|
847
|
-
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(),
|
|
849
|
+
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), U());
|
|
848
850
|
},
|
|
849
|
-
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(
|
|
851
|
+
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n($e, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
850
852
|
}
|
|
851
853
|
),
|
|
852
|
-
|
|
854
|
+
l && !o && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
|
|
853
855
|
"div",
|
|
854
856
|
{
|
|
855
857
|
role: "slider",
|
|
856
858
|
"aria-label": "Playback position",
|
|
857
|
-
"aria-valuenow":
|
|
859
|
+
"aria-valuenow": $,
|
|
858
860
|
"aria-valuemin": 0,
|
|
859
861
|
"aria-valuemax": 100,
|
|
860
862
|
tabIndex: 0,
|
|
861
|
-
ref:
|
|
863
|
+
ref: f,
|
|
862
864
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
863
|
-
onMouseDown:
|
|
864
|
-
onTouchStart:
|
|
865
|
+
onMouseDown: B,
|
|
866
|
+
onTouchStart: B,
|
|
865
867
|
onClick: (p) => p.stopPropagation(),
|
|
866
868
|
onKeyDown: (p) => {
|
|
867
|
-
p.key === "ArrowRight" &&
|
|
869
|
+
p.key === "ArrowRight" && P(Math.min(1, x + 0.05)), p.key === "ArrowLeft" && P(Math.max(0, x - 0.05));
|
|
868
870
|
},
|
|
869
871
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
870
872
|
"div",
|
|
871
873
|
{
|
|
872
874
|
className: "h-full rounded-full bg-white",
|
|
873
|
-
style: { width: `${
|
|
875
|
+
style: { width: `${$}%` }
|
|
874
876
|
}
|
|
875
877
|
) })
|
|
876
878
|
}
|
|
877
879
|
) }),
|
|
878
|
-
|
|
880
|
+
o && /* @__PURE__ */ h("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
879
881
|
/* @__PURE__ */ n(
|
|
880
882
|
"button",
|
|
881
883
|
{
|
|
882
884
|
type: "button",
|
|
883
885
|
onClick: (p) => {
|
|
884
|
-
p.stopPropagation(), v((
|
|
886
|
+
p.stopPropagation(), v((_) => !_);
|
|
885
887
|
},
|
|
886
888
|
className: "shrink-0 text-white",
|
|
887
|
-
"aria-label":
|
|
888
|
-
children:
|
|
889
|
+
"aria-label": N ? "Pause" : "Play",
|
|
890
|
+
children: N ? /* @__PURE__ */ n(ws, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n($e, { className: "size-5 translate-x-px", weight: "fill" })
|
|
889
891
|
}
|
|
890
892
|
),
|
|
891
893
|
/* @__PURE__ */ h(
|
|
@@ -893,30 +895,30 @@ const Qs = (e) => {
|
|
|
893
895
|
{
|
|
894
896
|
role: "slider",
|
|
895
897
|
"aria-label": "Playback position",
|
|
896
|
-
"aria-valuenow":
|
|
898
|
+
"aria-valuenow": $,
|
|
897
899
|
"aria-valuemin": 0,
|
|
898
900
|
"aria-valuemax": 100,
|
|
899
901
|
tabIndex: 0,
|
|
900
|
-
ref:
|
|
902
|
+
ref: f,
|
|
901
903
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
902
|
-
onMouseDown:
|
|
903
|
-
onTouchStart:
|
|
904
|
+
onMouseDown: B,
|
|
905
|
+
onTouchStart: B,
|
|
904
906
|
onClick: (p) => p.stopPropagation(),
|
|
905
907
|
onMouseEnter: () => L(!0),
|
|
906
908
|
onMouseLeave: () => L(!1),
|
|
907
909
|
onKeyDown: (p) => {
|
|
908
|
-
p.key === "ArrowRight" &&
|
|
910
|
+
p.key === "ArrowRight" && P(Math.min(1, x + 0.05)), p.key === "ArrowLeft" && P(Math.max(0, x - 0.05));
|
|
909
911
|
},
|
|
910
912
|
children: [
|
|
911
913
|
/* @__PURE__ */ n(
|
|
912
914
|
"div",
|
|
913
915
|
{
|
|
914
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
916
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${S || M ? "h-1.5" : "h-1"}`,
|
|
915
917
|
children: /* @__PURE__ */ n(
|
|
916
918
|
"div",
|
|
917
919
|
{
|
|
918
920
|
className: "h-full rounded-full bg-white",
|
|
919
|
-
style: { width: `${
|
|
921
|
+
style: { width: `${$}%` }
|
|
920
922
|
}
|
|
921
923
|
)
|
|
922
924
|
}
|
|
@@ -924,8 +926,8 @@ const Qs = (e) => {
|
|
|
924
926
|
/* @__PURE__ */ n(
|
|
925
927
|
"div",
|
|
926
928
|
{
|
|
927
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
928
|
-
style: { left: `${
|
|
929
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${S || M ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
930
|
+
style: { left: `${$}%` }
|
|
929
931
|
}
|
|
930
932
|
)
|
|
931
933
|
]
|
|
@@ -942,10 +944,10 @@ const Qs = (e) => {
|
|
|
942
944
|
title: a,
|
|
943
945
|
variant: r,
|
|
944
946
|
mediaPlayerProps: i,
|
|
945
|
-
containedImage:
|
|
947
|
+
containedImage: o = !1
|
|
946
948
|
}) => {
|
|
947
|
-
const
|
|
948
|
-
return t && (
|
|
949
|
+
const l = se(e), [d, m] = z(!1);
|
|
950
|
+
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
949
951
|
ea,
|
|
950
952
|
{
|
|
951
953
|
source: t,
|
|
@@ -954,7 +956,7 @@ const Qs = (e) => {
|
|
|
954
956
|
controls: !0,
|
|
955
957
|
...i
|
|
956
958
|
}
|
|
957
|
-
) : t &&
|
|
959
|
+
) : t && l === "image" ? o ? /* @__PURE__ */ n("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ n(
|
|
958
960
|
"img",
|
|
959
961
|
{
|
|
960
962
|
src: t,
|
|
@@ -971,7 +973,7 @@ const Qs = (e) => {
|
|
|
971
973
|
className: "block w-full",
|
|
972
974
|
draggable: !1
|
|
973
975
|
}
|
|
974
|
-
) : t &&
|
|
976
|
+
) : t && l === "document" ? s ? o ? /* @__PURE__ */ n("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ n(
|
|
975
977
|
"img",
|
|
976
978
|
{
|
|
977
979
|
src: s,
|
|
@@ -992,7 +994,7 @@ const Qs = (e) => {
|
|
|
992
994
|
"div",
|
|
993
995
|
{
|
|
994
996
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
|
-
children:
|
|
997
|
+
children: ce(e, {
|
|
996
998
|
className: $t(r),
|
|
997
999
|
weight: "regular"
|
|
998
1000
|
})
|
|
@@ -1009,7 +1011,7 @@ const Qs = (e) => {
|
|
|
1009
1011
|
"div",
|
|
1010
1012
|
{
|
|
1011
1013
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1012
|
-
children:
|
|
1014
|
+
children: ce(e, {
|
|
1013
1015
|
className: $t(r),
|
|
1014
1016
|
weight: "regular"
|
|
1015
1017
|
})
|
|
@@ -1022,22 +1024,22 @@ const Qs = (e) => {
|
|
|
1022
1024
|
placeholderTitle: a = "Attachment title",
|
|
1023
1025
|
mimeType: r,
|
|
1024
1026
|
detail: i,
|
|
1025
|
-
statusBadge:
|
|
1026
|
-
action:
|
|
1027
|
+
statusBadge: o,
|
|
1028
|
+
action: l,
|
|
1027
1029
|
topLeft: d,
|
|
1028
1030
|
topRight: m,
|
|
1029
|
-
rootRef:
|
|
1031
|
+
rootRef: g,
|
|
1030
1032
|
"data-testid": u
|
|
1031
1033
|
}) => {
|
|
1032
|
-
const
|
|
1034
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
|
|
1033
1035
|
return /* @__PURE__ */ h(
|
|
1034
1036
|
"div",
|
|
1035
1037
|
{
|
|
1036
|
-
ref:
|
|
1038
|
+
ref: g,
|
|
1037
1039
|
"data-testid": u,
|
|
1038
|
-
className:
|
|
1040
|
+
className: y(
|
|
1039
1041
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
1040
|
-
|
|
1042
|
+
f ? "bg-[#121110]" : "bg-white"
|
|
1041
1043
|
),
|
|
1042
1044
|
children: [
|
|
1043
1045
|
d ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: d }) : null,
|
|
@@ -1047,35 +1049,35 @@ const Qs = (e) => {
|
|
|
1047
1049
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1048
1050
|
"p",
|
|
1049
1051
|
{
|
|
1050
|
-
className:
|
|
1051
|
-
"text-black": !
|
|
1052
|
-
"text-white/30":
|
|
1053
|
-
"text-white":
|
|
1052
|
+
className: y("mb-0.5 truncate text-base font-medium", {
|
|
1053
|
+
"text-black": !f,
|
|
1054
|
+
"text-white/30": f && b,
|
|
1055
|
+
"text-white": f && !b
|
|
1054
1056
|
}),
|
|
1055
1057
|
children: c
|
|
1056
1058
|
}
|
|
1057
1059
|
),
|
|
1058
1060
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1059
|
-
|
|
1060
|
-
className:
|
|
1061
|
+
ce(r, {
|
|
1062
|
+
className: y(
|
|
1061
1063
|
"size-5 shrink-0",
|
|
1062
|
-
|
|
1064
|
+
f ? "text-white/55" : "text-black/55"
|
|
1063
1065
|
),
|
|
1064
1066
|
weight: "regular"
|
|
1065
1067
|
}),
|
|
1066
1068
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1067
1069
|
"span",
|
|
1068
1070
|
{
|
|
1069
|
-
className:
|
|
1071
|
+
className: y(
|
|
1070
1072
|
"text-xs font-medium",
|
|
1071
|
-
|
|
1073
|
+
f ? "text-white/55" : "text-black/55"
|
|
1072
1074
|
),
|
|
1073
1075
|
children: i
|
|
1074
1076
|
}
|
|
1075
1077
|
),
|
|
1076
|
-
|
|
1078
|
+
o
|
|
1077
1079
|
] }),
|
|
1078
|
-
|
|
1080
|
+
l
|
|
1079
1081
|
] })
|
|
1080
1082
|
]
|
|
1081
1083
|
}
|
|
@@ -1084,7 +1086,7 @@ const Qs = (e) => {
|
|
|
1084
1086
|
function nn(e) {
|
|
1085
1087
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1086
1088
|
}
|
|
1087
|
-
function
|
|
1089
|
+
function Ke(e) {
|
|
1088
1090
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1089
1091
|
}
|
|
1090
1092
|
function na(e) {
|
|
@@ -1102,8 +1104,8 @@ function ra(e) {
|
|
|
1102
1104
|
function ia(e) {
|
|
1103
1105
|
return e ? "text-white/20" : "text-black/20";
|
|
1104
1106
|
}
|
|
1105
|
-
const
|
|
1106
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link:
|
|
1107
|
+
const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
1108
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(O.Fragment, { children: [
|
|
1107
1109
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1108
1110
|
"img",
|
|
1109
1111
|
{
|
|
@@ -1129,7 +1131,7 @@ const Xe = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1129
1131
|
function sn(e) {
|
|
1130
1132
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1131
1133
|
}
|
|
1132
|
-
function
|
|
1134
|
+
function Ze(e) {
|
|
1133
1135
|
var t;
|
|
1134
1136
|
return (t = e.attachments) == null ? void 0 : t.find(sn);
|
|
1135
1137
|
}
|
|
@@ -1142,8 +1144,8 @@ async function oa(e, t) {
|
|
|
1142
1144
|
}
|
|
1143
1145
|
const a = await fetch(e, { mode: "cors" });
|
|
1144
1146
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
1145
|
-
const r = await a.blob(), i = URL.createObjectURL(r),
|
|
1146
|
-
|
|
1147
|
+
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1148
|
+
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1147
1149
|
}
|
|
1148
1150
|
const la = ({
|
|
1149
1151
|
url: e,
|
|
@@ -1156,41 +1158,41 @@ const la = ({
|
|
|
1156
1158
|
type: "button",
|
|
1157
1159
|
onClick: (i) => {
|
|
1158
1160
|
i.stopPropagation();
|
|
1159
|
-
const
|
|
1161
|
+
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1160
1162
|
a(!0), oa(e, t).then(() => {
|
|
1161
|
-
|
|
1163
|
+
o == null || o.close();
|
|
1162
1164
|
}).catch(() => {
|
|
1163
|
-
|
|
1165
|
+
o && (o.location.href = e);
|
|
1164
1166
|
}).finally(() => a(!1));
|
|
1165
1167
|
},
|
|
1166
1168
|
disabled: s,
|
|
1167
1169
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1168
|
-
children: s ? /* @__PURE__ */ n(
|
|
1169
|
-
/* @__PURE__ */ n(
|
|
1170
|
+
children: s ? /* @__PURE__ */ n(fe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(O.Fragment, { children: [
|
|
1171
|
+
/* @__PURE__ */ n(ge, { className: "size-4 text-white", weight: "bold" }),
|
|
1170
1172
|
"Download"
|
|
1171
1173
|
] })
|
|
1172
1174
|
}
|
|
1173
1175
|
);
|
|
1174
1176
|
};
|
|
1175
|
-
function
|
|
1176
|
-
var u,
|
|
1177
|
+
function Qe(e) {
|
|
1178
|
+
var u, f, c, b;
|
|
1177
1179
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1178
|
-
(
|
|
1179
|
-
), s = (
|
|
1180
|
-
(
|
|
1180
|
+
(N) => N.type === "video" && N.asset_url
|
|
1181
|
+
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1182
|
+
(N) => N.type === "image" && N.image_url
|
|
1181
1183
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1182
|
-
(
|
|
1184
|
+
(N) => N.type === "audio" && N.asset_url
|
|
1183
1185
|
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1184
|
-
(
|
|
1185
|
-
), i = t ?? s ?? a ?? r,
|
|
1186
|
-
if (!
|
|
1187
|
-
const
|
|
1186
|
+
(N) => N.type === "file" && N.asset_url
|
|
1187
|
+
), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1188
|
+
if (!o) return null;
|
|
1189
|
+
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
1188
1190
|
return {
|
|
1189
|
-
resolvedUrl:
|
|
1190
|
-
resolvedType:
|
|
1191
|
+
resolvedUrl: o,
|
|
1192
|
+
resolvedType: l,
|
|
1191
1193
|
title: d,
|
|
1192
1194
|
fileSize: m,
|
|
1193
|
-
thumbnailUrl:
|
|
1195
|
+
thumbnailUrl: g
|
|
1194
1196
|
};
|
|
1195
1197
|
}
|
|
1196
1198
|
const an = ({
|
|
@@ -1228,14 +1230,14 @@ const an = ({
|
|
|
1228
1230
|
fileSize: a,
|
|
1229
1231
|
thumbnailUrl: r
|
|
1230
1232
|
}) => {
|
|
1231
|
-
const i =
|
|
1233
|
+
const i = se(t), o = a !== void 0 ? nn(a) : void 0;
|
|
1232
1234
|
return /* @__PURE__ */ n(
|
|
1233
1235
|
tn,
|
|
1234
1236
|
{
|
|
1235
1237
|
variant: "light",
|
|
1236
1238
|
title: s,
|
|
1237
1239
|
mimeType: t,
|
|
1238
|
-
detail:
|
|
1240
|
+
detail: o,
|
|
1239
1241
|
thumbnail: /* @__PURE__ */ n(
|
|
1240
1242
|
en,
|
|
1241
1243
|
{
|
|
@@ -1254,10 +1256,10 @@ const an = ({
|
|
|
1254
1256
|
message: e,
|
|
1255
1257
|
isMyMessage: t = !1
|
|
1256
1258
|
}) => {
|
|
1257
|
-
const s =
|
|
1259
|
+
const s = Ze(e), a = Qe(e);
|
|
1258
1260
|
return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
|
|
1259
1261
|
!t && e.user && /* @__PURE__ */ n(
|
|
1260
|
-
|
|
1262
|
+
ne,
|
|
1261
1263
|
{
|
|
1262
1264
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1263
1265
|
id: e.user.id,
|
|
@@ -1275,7 +1277,7 @@ const an = ({
|
|
|
1275
1277
|
{
|
|
1276
1278
|
className: "str-chat__message-bubble",
|
|
1277
1279
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1278
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1280
|
+
children: s ? /* @__PURE__ */ n("div", { className: Ke(t), children: /* @__PURE__ */ n(Je, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(an, { ...a }) : /* @__PURE__ */ n(rn, { ...a })
|
|
1279
1281
|
}
|
|
1280
1282
|
) })
|
|
1281
1283
|
}
|
|
@@ -1284,18 +1286,18 @@ const an = ({
|
|
|
1284
1286
|
}, da = ({
|
|
1285
1287
|
message: e
|
|
1286
1288
|
}) => {
|
|
1287
|
-
const t =
|
|
1289
|
+
const t = Ze(e);
|
|
1288
1290
|
if (t)
|
|
1289
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1290
|
-
const s =
|
|
1291
|
+
return /* @__PURE__ */ n("div", { className: Ke(!0), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !0 }) });
|
|
1292
|
+
const s = Qe(e);
|
|
1291
1293
|
return s ? /* @__PURE__ */ n(an, { ...s }) : null;
|
|
1292
1294
|
}, ua = ({
|
|
1293
1295
|
message: e
|
|
1294
1296
|
}) => {
|
|
1295
|
-
const t =
|
|
1297
|
+
const t = Ze(e);
|
|
1296
1298
|
if (t)
|
|
1297
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1298
|
-
const s =
|
|
1299
|
+
return /* @__PURE__ */ n("div", { className: Ke(!1), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !1 }) });
|
|
1300
|
+
const s = Qe(e);
|
|
1299
1301
|
return s ? /* @__PURE__ */ n(rn, { ...s }) : null;
|
|
1300
1302
|
}, xi = Object.assign(ca, {
|
|
1301
1303
|
Creator: da,
|
|
@@ -1304,9 +1306,9 @@ const an = ({
|
|
|
1304
1306
|
isUnlocking: () => !1
|
|
1305
1307
|
}, ha = {
|
|
1306
1308
|
LockedAttachment: ma
|
|
1307
|
-
}, on =
|
|
1309
|
+
}, on = Ge({}), wi = on.Provider;
|
|
1308
1310
|
function fa(e) {
|
|
1309
|
-
return
|
|
1311
|
+
return He(on)[e] ?? ha[e];
|
|
1310
1312
|
}
|
|
1311
1313
|
const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1312
1314
|
"svg",
|
|
@@ -1331,7 +1333,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1331
1333
|
}, pa = (e) => {
|
|
1332
1334
|
var t;
|
|
1333
1335
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1334
|
-
},
|
|
1336
|
+
}, Ce = (e) => {
|
|
1335
1337
|
var t;
|
|
1336
1338
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1337
1339
|
}, va = (e) => {
|
|
@@ -1340,35 +1342,35 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1340
1342
|
}, ln = (e) => ba(e) || pa(e), xa = (e) => {
|
|
1341
1343
|
var t;
|
|
1342
1344
|
return ln(e) && !((t = e.text) != null && t.trim());
|
|
1343
|
-
},
|
|
1345
|
+
}, Le = ({
|
|
1344
1346
|
message: e,
|
|
1345
1347
|
standalone: t = !1,
|
|
1346
1348
|
isMyMessage: s = !1,
|
|
1347
1349
|
hasAttachment: a = !1
|
|
1348
1350
|
}) => {
|
|
1349
1351
|
var u;
|
|
1350
|
-
const r = ln(e), i =
|
|
1352
|
+
const r = ln(e), i = Ce(e);
|
|
1351
1353
|
if (!r && !i)
|
|
1352
1354
|
return null;
|
|
1353
1355
|
if (r) {
|
|
1354
|
-
const
|
|
1355
|
-
if (!
|
|
1356
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${
|
|
1356
|
+
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1357
|
+
if (!f) return null;
|
|
1358
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1357
1359
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1358
1360
|
/* @__PURE__ */ n(_s, { size: t ? 14 : 12 }),
|
|
1359
1361
|
/* @__PURE__ */ n("span", { children: b })
|
|
1360
1362
|
] });
|
|
1361
1363
|
}
|
|
1362
|
-
const
|
|
1364
|
+
const o = s && a, l = o ? "Sent with AI" : "Sent with DM Agent", d = [
|
|
1363
1365
|
"message-chatbot-indicator",
|
|
1364
1366
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1365
|
-
|
|
1366
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children:
|
|
1367
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !
|
|
1367
|
+
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1368
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(ga, { size: o ? 12 : 15 }) });
|
|
1369
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(re, { children: [
|
|
1368
1370
|
m,
|
|
1369
|
-
|
|
1370
|
-
] }) : /* @__PURE__ */ h(
|
|
1371
|
-
|
|
1371
|
+
g
|
|
1372
|
+
] }) : /* @__PURE__ */ h(re, { children: [
|
|
1373
|
+
g,
|
|
1372
1374
|
m
|
|
1373
1375
|
] }) });
|
|
1374
1376
|
}, wa = ({
|
|
@@ -1380,7 +1382,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1380
1382
|
"button",
|
|
1381
1383
|
{
|
|
1382
1384
|
type: "button",
|
|
1383
|
-
className:
|
|
1385
|
+
className: y("message-vote-button focus-ring", {
|
|
1384
1386
|
"message-vote-button--selected": e === "up"
|
|
1385
1387
|
}),
|
|
1386
1388
|
onClick: t,
|
|
@@ -1394,7 +1396,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1394
1396
|
"button",
|
|
1395
1397
|
{
|
|
1396
1398
|
type: "button",
|
|
1397
|
-
className:
|
|
1399
|
+
className: y("message-vote-button focus-ring", {
|
|
1398
1400
|
"message-vote-button--selected": e === "down"
|
|
1399
1401
|
}),
|
|
1400
1402
|
onClick: s,
|
|
@@ -1412,81 +1414,81 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1412
1414
|
editing: a,
|
|
1413
1415
|
endOfGroup: r,
|
|
1414
1416
|
firstOfGroup: i,
|
|
1415
|
-
groupedByUser:
|
|
1416
|
-
handleAction:
|
|
1417
|
+
groupedByUser: o,
|
|
1418
|
+
handleAction: l,
|
|
1417
1419
|
handleOpenThread: d,
|
|
1418
1420
|
handleRetry: m,
|
|
1419
|
-
highlighted:
|
|
1421
|
+
highlighted: g,
|
|
1420
1422
|
isMessageAIGenerated: u,
|
|
1421
|
-
isMyMessage:
|
|
1423
|
+
isMyMessage: f,
|
|
1422
1424
|
message: c,
|
|
1423
1425
|
renderText: b,
|
|
1424
|
-
threadList:
|
|
1426
|
+
threadList: N,
|
|
1425
1427
|
viewerLanguage: v
|
|
1426
|
-
} = e, { client:
|
|
1427
|
-
Attachment:
|
|
1428
|
-
EditMessageModal:
|
|
1429
|
-
MessageActions:
|
|
1430
|
-
MessageBlocked:
|
|
1431
|
-
MessageBouncePrompt:
|
|
1432
|
-
MessageDeleted:
|
|
1433
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1434
|
-
MessageRepliesCountButton:
|
|
1435
|
-
ReminderNotification:
|
|
1428
|
+
} = e, { client: x } = qe("CustomMessage"), { channel: w } = de("CustomMessage"), { isUnlocking: M, onUnlockClick: A, onFetchSource: S, onDownloadClick: L } = fa("LockedAttachment"), [I, C] = z(!1), k = An(c.id), { selected: E, voteUp: D, voteDown: V } = js(c), {
|
|
1429
|
+
Attachment: F = Mn,
|
|
1430
|
+
EditMessageModal: X = Dn,
|
|
1431
|
+
MessageActions: U,
|
|
1432
|
+
MessageBlocked: G = Rn,
|
|
1433
|
+
MessageBouncePrompt: P = Ln,
|
|
1434
|
+
MessageDeleted: B = Pn,
|
|
1435
|
+
MessageIsThreadReplyInChannelButtonIndicator: Y = zn,
|
|
1436
|
+
MessageRepliesCountButton: W = On,
|
|
1437
|
+
ReminderNotification: $ = Fn,
|
|
1436
1438
|
StreamedMessageText: p = $n,
|
|
1437
|
-
PinIndicator:
|
|
1438
|
-
} = Ut("CustomMessage"),
|
|
1439
|
+
PinIndicator: _
|
|
1440
|
+
} = Ut("CustomMessage"), R = Bn(c), T = jn(c), j = te(
|
|
1439
1441
|
() => u == null ? void 0 : u(c),
|
|
1440
1442
|
[u, c]
|
|
1441
|
-
),
|
|
1442
|
-
const
|
|
1443
|
-
if (!
|
|
1444
|
-
const Tt =
|
|
1445
|
-
return Tt.length ===
|
|
1446
|
-
}, [c]),
|
|
1447
|
-
const
|
|
1448
|
-
return
|
|
1443
|
+
), q = te(() => {
|
|
1444
|
+
const me = c.attachments ?? [], _e = c.shared_location ? [c.shared_location, ...me] : me;
|
|
1445
|
+
if (!Ce(c)) return _e;
|
|
1446
|
+
const Tt = _e.filter((At) => !("type" in At) || !sn(At));
|
|
1447
|
+
return Tt.length === _e.length ? _e : Tt;
|
|
1448
|
+
}, [c]), Z = te(() => {
|
|
1449
|
+
const me = Kt({ message: c, viewerLanguage: v });
|
|
1450
|
+
return me === c.text ? c : { ...c, text: me };
|
|
1449
1451
|
}, [c, v]);
|
|
1450
1452
|
if (Vn(c))
|
|
1451
1453
|
return null;
|
|
1452
1454
|
if (c.deleted_at || c.type === "deleted")
|
|
1453
|
-
return /* @__PURE__ */ n(
|
|
1455
|
+
return /* @__PURE__ */ n(B, { message: c });
|
|
1454
1456
|
if (Un(c))
|
|
1455
|
-
return /* @__PURE__ */ n(
|
|
1456
|
-
const
|
|
1457
|
-
let
|
|
1458
|
-
ct ?
|
|
1459
|
-
const
|
|
1457
|
+
return /* @__PURE__ */ n(G, {});
|
|
1458
|
+
const ae = !N && !!c.reply_count, ee = !N && c.show_in_channel && c.parent_id, ct = c.status === "failed" && ((gt = c.error) == null ? void 0 : gt.status) !== 403, dt = Gn(c);
|
|
1459
|
+
let ie;
|
|
1460
|
+
ct ? ie = () => m(c) : dt && (ie = () => C(!0));
|
|
1461
|
+
const ue = f(), kn = y(
|
|
1460
1462
|
"str-chat__message str-chat__message-simple",
|
|
1461
1463
|
`str-chat__message--${c.type}`,
|
|
1462
1464
|
`str-chat__message--${c.status}`,
|
|
1463
|
-
|
|
1465
|
+
ue ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1464
1466
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1465
1467
|
{
|
|
1466
|
-
"str-chat__message--has-attachment":
|
|
1467
|
-
"str-chat__message--highlighted":
|
|
1468
|
+
"str-chat__message--has-attachment": R,
|
|
1469
|
+
"str-chat__message--highlighted": g,
|
|
1468
1470
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1469
|
-
"str-chat__message--with-reactions":
|
|
1471
|
+
"str-chat__message--with-reactions": T,
|
|
1470
1472
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((bt = c == null ? void 0 : c.error) == null ? void 0 : bt.status) !== 403,
|
|
1471
|
-
"str-chat__message-with-thread-link":
|
|
1473
|
+
"str-chat__message-with-thread-link": ae || ee,
|
|
1472
1474
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1473
1475
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1474
|
-
"str-chat__virtual-message__wrapper--group":
|
|
1476
|
+
"str-chat__virtual-message__wrapper--group": o
|
|
1475
1477
|
}
|
|
1476
|
-
), ut = c.poll_id &&
|
|
1477
|
-
return /* @__PURE__ */ h(
|
|
1478
|
+
), ut = c.poll_id && x.polls.fromState(c.poll_id), mt = xa(c), oe = Ce(c), ht = va(c), Ae = !!(q != null && q.length && !c.quoted_message), ft = oe && ue && Ae;
|
|
1479
|
+
return /* @__PURE__ */ h(re, { children: [
|
|
1478
1480
|
a && /* @__PURE__ */ n(
|
|
1479
|
-
|
|
1481
|
+
X,
|
|
1480
1482
|
{
|
|
1481
1483
|
additionalMessageInputProps: t
|
|
1482
1484
|
}
|
|
1483
1485
|
),
|
|
1484
|
-
|
|
1486
|
+
I && /* @__PURE__ */ n(
|
|
1485
1487
|
Hn,
|
|
1486
1488
|
{
|
|
1487
|
-
MessageBouncePrompt:
|
|
1488
|
-
onClose: () =>
|
|
1489
|
-
open:
|
|
1489
|
+
MessageBouncePrompt: P,
|
|
1490
|
+
onClose: () => C(!1),
|
|
1491
|
+
open: I
|
|
1490
1492
|
}
|
|
1491
1493
|
),
|
|
1492
1494
|
/* @__PURE__ */ h(
|
|
@@ -1495,31 +1497,31 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1495
1497
|
className: kn,
|
|
1496
1498
|
"data-message-id": c.id,
|
|
1497
1499
|
children: [
|
|
1498
|
-
|
|
1499
|
-
!!
|
|
1500
|
+
_ && /* @__PURE__ */ n(_, {}),
|
|
1501
|
+
!!k && /* @__PURE__ */ n($, { reminder: k }),
|
|
1500
1502
|
c.user && /* @__PURE__ */ n(
|
|
1501
|
-
|
|
1503
|
+
ne,
|
|
1502
1504
|
{
|
|
1503
1505
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1504
1506
|
id: c.user.id,
|
|
1505
1507
|
image: c.user.image,
|
|
1506
1508
|
name: c.user.name || c.user.id,
|
|
1507
|
-
size:
|
|
1509
|
+
size: oe ? 24 : 28,
|
|
1508
1510
|
shape: "circle",
|
|
1509
|
-
dmAgentEnabled:
|
|
1511
|
+
dmAgentEnabled: oe
|
|
1510
1512
|
}
|
|
1511
1513
|
),
|
|
1512
1514
|
/* @__PURE__ */ n(
|
|
1513
1515
|
"div",
|
|
1514
1516
|
{
|
|
1515
|
-
className:
|
|
1517
|
+
className: y("str-chat__message-inner", {
|
|
1516
1518
|
"str-chat__simple-message--error-failed": ct || dt
|
|
1517
1519
|
}),
|
|
1518
1520
|
"data-testid": "message-inner",
|
|
1519
|
-
onClick:
|
|
1520
|
-
onKeyDown:
|
|
1521
|
-
role:
|
|
1522
|
-
tabIndex:
|
|
1521
|
+
onClick: ie,
|
|
1522
|
+
onKeyDown: ie,
|
|
1523
|
+
role: ie ? "button" : void 0,
|
|
1524
|
+
tabIndex: ie ? 0 : void 0,
|
|
1523
1525
|
style: {
|
|
1524
1526
|
// Force margins to 0 to prevent hover layout shift
|
|
1525
1527
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
@@ -1527,8 +1529,8 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1527
1529
|
marginInlineStart: 0
|
|
1528
1530
|
},
|
|
1529
1531
|
children: ht ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
+
ue ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1533
|
+
U && /* @__PURE__ */ n(U, {}),
|
|
1532
1534
|
/* @__PURE__ */ n(
|
|
1533
1535
|
Ft.Sent,
|
|
1534
1536
|
{
|
|
@@ -1538,8 +1540,8 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1538
1540
|
amountText: (wt = c.metadata) == null ? void 0 : wt.amount_text,
|
|
1539
1541
|
detail: (Nt = c.metadata) == null ? void 0 : Nt.attachment_detail,
|
|
1540
1542
|
paymentStatus: (_t = c.metadata) == null ? void 0 : _t.payment_status,
|
|
1541
|
-
onPreviewClick: () =>
|
|
1542
|
-
onFetchSource: async () => await (
|
|
1543
|
+
onPreviewClick: () => A == null ? void 0 : A(c, w),
|
|
1544
|
+
onFetchSource: async () => await (S == null ? void 0 : S(c, w))
|
|
1543
1545
|
}
|
|
1544
1546
|
)
|
|
1545
1547
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1552,51 +1554,51 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1552
1554
|
amountText: (Et = c.metadata) == null ? void 0 : Et.amount_text,
|
|
1553
1555
|
detail: (It = c.metadata) == null ? void 0 : It.attachment_detail,
|
|
1554
1556
|
paymentStatus: (St = c.metadata) == null ? void 0 : St.payment_status,
|
|
1555
|
-
isUnlocking:
|
|
1556
|
-
onUnlockClick: () =>
|
|
1557
|
-
onFetchSource: async () => await (
|
|
1558
|
-
onDownloadClick: () => L == null ? void 0 : L(c,
|
|
1557
|
+
isUnlocking: M(c.id),
|
|
1558
|
+
onUnlockClick: () => A == null ? void 0 : A(c, w),
|
|
1559
|
+
onFetchSource: async () => await (S == null ? void 0 : S(c, w)),
|
|
1560
|
+
onDownloadClick: () => L == null ? void 0 : L(c, w)
|
|
1559
1561
|
}
|
|
1560
1562
|
),
|
|
1561
|
-
|
|
1563
|
+
U && /* @__PURE__ */ n(U, {})
|
|
1562
1564
|
] }),
|
|
1563
1565
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1564
1566
|
Mt,
|
|
1565
1567
|
{
|
|
1566
|
-
message:
|
|
1568
|
+
message: Z,
|
|
1567
1569
|
renderText: b
|
|
1568
1570
|
}
|
|
1569
1571
|
) })
|
|
1570
1572
|
] }) : mt ? (
|
|
1571
1573
|
/* Tip-only messages render as a standalone bubble */
|
|
1572
|
-
/* @__PURE__ */ n(
|
|
1574
|
+
/* @__PURE__ */ n(Le, { message: c, standalone: !0 })
|
|
1573
1575
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
+
oe && !ft && /* @__PURE__ */ n(
|
|
1577
|
+
Le,
|
|
1576
1578
|
{
|
|
1577
1579
|
message: c,
|
|
1578
|
-
hasAttachment:
|
|
1579
|
-
isMyMessage:
|
|
1580
|
+
hasAttachment: Ae,
|
|
1581
|
+
isMyMessage: ue
|
|
1580
1582
|
}
|
|
1581
1583
|
),
|
|
1582
1584
|
ut && /* @__PURE__ */ n(Yn, { poll: ut }),
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
+
q != null && q.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1586
|
+
F,
|
|
1585
1587
|
{
|
|
1586
|
-
actionHandler:
|
|
1587
|
-
attachments:
|
|
1588
|
+
actionHandler: l,
|
|
1589
|
+
attachments: q
|
|
1588
1590
|
}
|
|
1589
1591
|
) : null,
|
|
1590
|
-
|
|
1592
|
+
j ? /* @__PURE__ */ n(
|
|
1591
1593
|
p,
|
|
1592
1594
|
{
|
|
1593
|
-
message:
|
|
1595
|
+
message: Z,
|
|
1594
1596
|
renderText: b
|
|
1595
1597
|
}
|
|
1596
1598
|
) : /* @__PURE__ */ n(
|
|
1597
1599
|
Mt,
|
|
1598
1600
|
{
|
|
1599
|
-
message:
|
|
1601
|
+
message: Z,
|
|
1600
1602
|
renderText: b
|
|
1601
1603
|
}
|
|
1602
1604
|
),
|
|
@@ -1605,45 +1607,45 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1605
1607
|
}
|
|
1606
1608
|
),
|
|
1607
1609
|
!ht && !mt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1608
|
-
(!
|
|
1609
|
-
|
|
1610
|
+
(!oe || ft) && /* @__PURE__ */ n(
|
|
1611
|
+
Le,
|
|
1610
1612
|
{
|
|
1611
1613
|
message: c,
|
|
1612
|
-
hasAttachment:
|
|
1613
|
-
isMyMessage:
|
|
1614
|
+
hasAttachment: Ae,
|
|
1615
|
+
isMyMessage: ue
|
|
1614
1616
|
}
|
|
1615
1617
|
),
|
|
1616
|
-
s &&
|
|
1618
|
+
s && oe && /* @__PURE__ */ n(
|
|
1617
1619
|
wa,
|
|
1618
1620
|
{
|
|
1619
|
-
selected:
|
|
1620
|
-
onVoteUp:
|
|
1621
|
-
onVoteDown:
|
|
1621
|
+
selected: E,
|
|
1622
|
+
onVoteUp: D,
|
|
1623
|
+
onVoteDown: V
|
|
1622
1624
|
}
|
|
1623
1625
|
)
|
|
1624
1626
|
] }),
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
+
ae && /* @__PURE__ */ n(
|
|
1628
|
+
W,
|
|
1627
1629
|
{
|
|
1628
1630
|
onClick: d,
|
|
1629
1631
|
reply_count: c.reply_count
|
|
1630
1632
|
}
|
|
1631
1633
|
),
|
|
1632
|
-
|
|
1634
|
+
ee && /* @__PURE__ */ n(Y, {})
|
|
1633
1635
|
]
|
|
1634
1636
|
},
|
|
1635
1637
|
c.id
|
|
1636
1638
|
)
|
|
1637
1639
|
] });
|
|
1638
|
-
}, _a =
|
|
1640
|
+
}, _a = O.memo(
|
|
1639
1641
|
Na,
|
|
1640
1642
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Tn(e, t)
|
|
1641
1643
|
), ya = (e) => {
|
|
1642
|
-
const t =
|
|
1644
|
+
const t = be("CustomMessage");
|
|
1643
1645
|
return /* @__PURE__ */ n(_a, { ...t, ...e });
|
|
1644
1646
|
}, Ca = () => {
|
|
1645
1647
|
var s;
|
|
1646
|
-
const { handleDelete: e, message: t } =
|
|
1648
|
+
const { handleDelete: e, message: t } = be("CustomMessageActions");
|
|
1647
1649
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1648
1650
|
qt,
|
|
1649
1651
|
{
|
|
@@ -1655,7 +1657,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1655
1657
|
}
|
|
1656
1658
|
);
|
|
1657
1659
|
}, ka = () => {
|
|
1658
|
-
const { handleFlag: e } =
|
|
1660
|
+
const { handleFlag: e } = be("CustomMessageActions");
|
|
1659
1661
|
return /* @__PURE__ */ n(
|
|
1660
1662
|
qt,
|
|
1661
1663
|
{
|
|
@@ -1668,7 +1670,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1668
1670
|
);
|
|
1669
1671
|
}, Ea = () => {
|
|
1670
1672
|
var t;
|
|
1671
|
-
const { message: e } =
|
|
1673
|
+
const { message: e } = be("CustomMessageActions");
|
|
1672
1674
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1673
1675
|
As,
|
|
1674
1676
|
{
|
|
@@ -1707,12 +1709,12 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1707
1709
|
"button",
|
|
1708
1710
|
{
|
|
1709
1711
|
type: "button",
|
|
1710
|
-
onClick: (
|
|
1711
|
-
|
|
1712
|
+
onClick: (o) => {
|
|
1713
|
+
o.preventDefault(), t(s);
|
|
1712
1714
|
},
|
|
1713
1715
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1714
1716
|
"aria-label": "Close link preview",
|
|
1715
|
-
children: /* @__PURE__ */ n(
|
|
1717
|
+
children: /* @__PURE__ */ n(pe, { className: "size-4 text-black/90" })
|
|
1716
1718
|
}
|
|
1717
1719
|
),
|
|
1718
1720
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1747,36 +1749,37 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1747
1749
|
onClick: e,
|
|
1748
1750
|
children: /* @__PURE__ */ n(Es, { weight: "bold", className: "size-4" })
|
|
1749
1751
|
}
|
|
1750
|
-
), Ma = (
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1752
|
+
), Ma = ({
|
|
1753
|
+
disabled: e = !1
|
|
1754
|
+
}) => {
|
|
1755
|
+
const { handleSubmit: t } = Jn(), s = Zn(), a = e || !s, {
|
|
1756
|
+
SendButton: r = Aa,
|
|
1757
|
+
AttachmentPreviewList: i = Qn
|
|
1755
1758
|
} = Ut("CustomMessageInput");
|
|
1756
1759
|
return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1757
1760
|
/* @__PURE__ */ n(es, {}),
|
|
1758
1761
|
/* @__PURE__ */ n(Ta, {}),
|
|
1759
|
-
/* @__PURE__ */ n(
|
|
1762
|
+
/* @__PURE__ */ n(i, {}),
|
|
1760
1763
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1761
1764
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1762
1765
|
ts,
|
|
1763
1766
|
{
|
|
1764
|
-
"aria-disabled":
|
|
1767
|
+
"aria-disabled": e || void 0,
|
|
1765
1768
|
className: "w-full resize-none outline-none leading-6",
|
|
1766
|
-
autoFocus: !
|
|
1769
|
+
autoFocus: !e,
|
|
1767
1770
|
maxRows: 4,
|
|
1768
|
-
readOnly:
|
|
1769
|
-
tabIndex:
|
|
1771
|
+
readOnly: e,
|
|
1772
|
+
tabIndex: e ? -1 : void 0
|
|
1770
1773
|
}
|
|
1771
1774
|
) }),
|
|
1772
1775
|
/* @__PURE__ */ n(
|
|
1773
|
-
|
|
1776
|
+
r,
|
|
1774
1777
|
{
|
|
1775
1778
|
sendMessage: t,
|
|
1776
1779
|
"aria-label": "Send",
|
|
1777
1780
|
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1778
1781
|
"data-testid": "send-button",
|
|
1779
|
-
disabled:
|
|
1782
|
+
disabled: a,
|
|
1780
1783
|
type: "button"
|
|
1781
1784
|
}
|
|
1782
1785
|
)
|
|
@@ -1784,23 +1787,29 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1784
1787
|
] });
|
|
1785
1788
|
}, Da = ({
|
|
1786
1789
|
renderActions: e,
|
|
1787
|
-
renderFooter: t
|
|
1790
|
+
renderFooter: t,
|
|
1791
|
+
disabled: s = !1,
|
|
1792
|
+
disabledReason: a
|
|
1788
1793
|
}) => {
|
|
1789
|
-
var
|
|
1790
|
-
const { channel:
|
|
1794
|
+
var d;
|
|
1795
|
+
const { channel: r } = de(), o = ((d = r == null ? void 0 : r.data) == null ? void 0 : d.frozen) === !0 || s, l = H(
|
|
1796
|
+
() => /* @__PURE__ */ n(Ma, { disabled: o }),
|
|
1797
|
+
[o]
|
|
1798
|
+
);
|
|
1791
1799
|
return /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
1792
1800
|
/* @__PURE__ */ h(
|
|
1793
1801
|
"div",
|
|
1794
1802
|
{
|
|
1795
|
-
inert:
|
|
1796
|
-
"aria-disabled":
|
|
1803
|
+
inert: o ? "" : void 0,
|
|
1804
|
+
"aria-disabled": o || void 0,
|
|
1797
1805
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1798
1806
|
children: [
|
|
1799
1807
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1800
|
-
/* @__PURE__ */ n(Kn, { Input:
|
|
1808
|
+
/* @__PURE__ */ n(Kn, { Input: l })
|
|
1801
1809
|
]
|
|
1802
1810
|
}
|
|
1803
1811
|
),
|
|
1812
|
+
o && a ? /* @__PURE__ */ n("p", { className: "message-input-disabled-reason px-2 text-center text-sm text-black/55", children: a }) : null,
|
|
1804
1813
|
t == null ? void 0 : t()
|
|
1805
1814
|
] });
|
|
1806
1815
|
}, Ra = [
|
|
@@ -1813,7 +1822,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1813
1822
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1814
1823
|
], za = {
|
|
1815
1824
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1816
|
-
},
|
|
1825
|
+
}, Pe = "age safety guidelines.", Oa = "https://linktr.ee/s/about/contact", Bt = (e) => Ra.includes(e), Fa = (e) => Pa.includes(e), $a = (e) => {
|
|
1817
1826
|
var a;
|
|
1818
1827
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1819
1828
|
if (Bt(t))
|
|
@@ -1833,11 +1842,11 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1833
1842
|
type: s
|
|
1834
1843
|
};
|
|
1835
1844
|
}, Ba = (e) => {
|
|
1836
|
-
const t = e.indexOf(
|
|
1845
|
+
const t = e.indexOf(Pe);
|
|
1837
1846
|
if (t === -1)
|
|
1838
1847
|
return e;
|
|
1839
|
-
const s = t +
|
|
1840
|
-
return /* @__PURE__ */ h(
|
|
1848
|
+
const s = t + Pe.length;
|
|
1849
|
+
return /* @__PURE__ */ h(re, { children: [
|
|
1841
1850
|
e.slice(0, t),
|
|
1842
1851
|
/* @__PURE__ */ n(
|
|
1843
1852
|
"a",
|
|
@@ -1846,7 +1855,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1846
1855
|
target: "_blank",
|
|
1847
1856
|
rel: "noopener noreferrer",
|
|
1848
1857
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1849
|
-
children:
|
|
1858
|
+
children: Pe
|
|
1850
1859
|
}
|
|
1851
1860
|
),
|
|
1852
1861
|
e.slice(s)
|
|
@@ -1867,7 +1876,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1867
1876
|
"data-dm-agent-system-type": s.type,
|
|
1868
1877
|
children: [
|
|
1869
1878
|
/* @__PURE__ */ n(
|
|
1870
|
-
|
|
1879
|
+
Be,
|
|
1871
1880
|
{
|
|
1872
1881
|
size: 16,
|
|
1873
1882
|
weight: "regular",
|
|
@@ -1879,7 +1888,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1879
1888
|
]
|
|
1880
1889
|
}
|
|
1881
1890
|
),
|
|
1882
|
-
!t && /* @__PURE__ */ n(
|
|
1891
|
+
!t && /* @__PURE__ */ n(Me, { message: e.message })
|
|
1883
1892
|
] });
|
|
1884
1893
|
}
|
|
1885
1894
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
@@ -1906,7 +1915,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1906
1915
|
]
|
|
1907
1916
|
}
|
|
1908
1917
|
),
|
|
1909
|
-
!t && /* @__PURE__ */ n(
|
|
1918
|
+
!t && /* @__PURE__ */ n(Me, { message: e.message })
|
|
1910
1919
|
] });
|
|
1911
1920
|
}
|
|
1912
1921
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1915,9 +1924,9 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1915
1924
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
1916
1925
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
1917
1926
|
] }),
|
|
1918
|
-
!t && /* @__PURE__ */ n(
|
|
1927
|
+
!t && /* @__PURE__ */ n(Me, { message: e.message })
|
|
1919
1928
|
] });
|
|
1920
|
-
}, cn =
|
|
1929
|
+
}, cn = Ge(!1), ze = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1921
1930
|
"animateTransform",
|
|
1922
1931
|
{
|
|
1923
1932
|
attributeName: "transform",
|
|
@@ -1928,13 +1937,13 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1928
1937
|
repeatCount: "indefinite"
|
|
1929
1938
|
}
|
|
1930
1939
|
) }), Va = /* @__PURE__ */ new Set([
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1940
|
+
De.Thinking,
|
|
1941
|
+
De.Generating,
|
|
1942
|
+
De.ExternalSources
|
|
1934
1943
|
]), Ua = ({ threadList: e }) => {
|
|
1935
|
-
var b,
|
|
1936
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
1937
|
-
if (!e &&
|
|
1944
|
+
var b, N;
|
|
1945
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = qe(), { typing: i = {} } = ns(), { aiState: o } = ss(t), l = He(cn);
|
|
1946
|
+
if (!e && l && Va.has(o)) {
|
|
1938
1947
|
const v = Ga(t, (b = r.user) == null ? void 0 : b.id);
|
|
1939
1948
|
return /* @__PURE__ */ n(
|
|
1940
1949
|
jt,
|
|
@@ -1949,25 +1958,25 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1949
1958
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1950
1959
|
return null;
|
|
1951
1960
|
const m = e ? [] : Object.values(i).filter(
|
|
1952
|
-
({ parent_id: v, user:
|
|
1953
|
-
var
|
|
1954
|
-
return (
|
|
1961
|
+
({ parent_id: v, user: x }) => {
|
|
1962
|
+
var w;
|
|
1963
|
+
return (x == null ? void 0 : x.id) !== ((w = r.user) == null ? void 0 : w.id) && !v;
|
|
1955
1964
|
}
|
|
1956
|
-
),
|
|
1957
|
-
({ parent_id: v, user:
|
|
1958
|
-
var
|
|
1959
|
-
return (
|
|
1965
|
+
), g = e ? Object.values(i).filter(
|
|
1966
|
+
({ parent_id: v, user: x }) => {
|
|
1967
|
+
var w;
|
|
1968
|
+
return (x == null ? void 0 : x.id) !== ((w = r.user) == null ? void 0 : w.id) && v === (a == null ? void 0 : a.id);
|
|
1960
1969
|
}
|
|
1961
|
-
) : [], u = e ?
|
|
1970
|
+
) : [], u = e ? g : m;
|
|
1962
1971
|
if (!u.length)
|
|
1963
1972
|
return null;
|
|
1964
|
-
const
|
|
1973
|
+
const f = (N = u[0]) == null ? void 0 : N.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1965
1974
|
return /* @__PURE__ */ n(
|
|
1966
1975
|
jt,
|
|
1967
1976
|
{
|
|
1968
|
-
avatarId: (
|
|
1969
|
-
avatarName: (
|
|
1970
|
-
avatarImage: (
|
|
1977
|
+
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1978
|
+
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
1979
|
+
avatarImage: (f == null ? void 0 : f.image) ?? (c == null ? void 0 : c.image),
|
|
1971
1980
|
testId: "typing-indicator"
|
|
1972
1981
|
}
|
|
1973
1982
|
);
|
|
@@ -1984,7 +1993,7 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1984
1993
|
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
1985
1994
|
children: [
|
|
1986
1995
|
/* @__PURE__ */ n("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1987
|
-
|
|
1996
|
+
ne,
|
|
1988
1997
|
{
|
|
1989
1998
|
id: e,
|
|
1990
1999
|
name: t,
|
|
@@ -2003,9 +2012,9 @@ const ga = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2003
2012
|
height: "8",
|
|
2004
2013
|
overflow: "visible",
|
|
2005
2014
|
children: [
|
|
2006
|
-
/* @__PURE__ */ n(
|
|
2007
|
-
/* @__PURE__ */ n(
|
|
2008
|
-
/* @__PURE__ */ n(
|
|
2015
|
+
/* @__PURE__ */ n(ze, { cx: "4", index: 0 }),
|
|
2016
|
+
/* @__PURE__ */ n(ze, { cx: "16", index: 1 }),
|
|
2017
|
+
/* @__PURE__ */ n(ze, { cx: "28", index: 2 })
|
|
2009
2018
|
]
|
|
2010
2019
|
}
|
|
2011
2020
|
) })
|
|
@@ -2024,7 +2033,7 @@ function Ga(e, t) {
|
|
|
2024
2033
|
const Ha = () => null, Ya = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2025
2034
|
"div",
|
|
2026
2035
|
{
|
|
2027
|
-
className:
|
|
2036
|
+
className: y("flex items-center justify-center h-full", e),
|
|
2028
2037
|
children: [
|
|
2029
2038
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2030
2039
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2064,12 +2073,12 @@ const Ha = () => null, Ya = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2064
2073
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2065
2074
|
]
|
|
2066
2075
|
}
|
|
2067
|
-
),
|
|
2076
|
+
), ke = O.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2068
2077
|
/* @__PURE__ */ n(Ya, { className: "w-6 h-6" }),
|
|
2069
2078
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2070
2079
|
] }) }));
|
|
2071
|
-
|
|
2072
|
-
const
|
|
2080
|
+
ke.displayName = "LoadingState";
|
|
2081
|
+
const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Vt = "Replies instantly with AI assistant", qa = ({
|
|
2073
2082
|
onBack: e,
|
|
2074
2083
|
showBackButton: t,
|
|
2075
2084
|
onShowInfo: s,
|
|
@@ -2077,23 +2086,23 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2077
2086
|
showStarButton: r = !1,
|
|
2078
2087
|
dmAgentEnabled: i = !1
|
|
2079
2088
|
}) => {
|
|
2080
|
-
var
|
|
2081
|
-
const { channel:
|
|
2082
|
-
var
|
|
2083
|
-
const
|
|
2084
|
-
return
|
|
2085
|
-
(
|
|
2089
|
+
var f, c, b, N, v;
|
|
2090
|
+
const { channel: o } = de(), l = O.useMemo(() => {
|
|
2091
|
+
var M, A;
|
|
2092
|
+
const x = (M = o._client) == null ? void 0 : M.userID;
|
|
2093
|
+
return x ? Object.values(((A = o.state) == null ? void 0 : A.members) || {}).find(
|
|
2094
|
+
(S) => {
|
|
2086
2095
|
var L;
|
|
2087
|
-
return ((L =
|
|
2096
|
+
return ((L = S.user) == null ? void 0 : L.id) && S.user.id !== x;
|
|
2088
2097
|
}
|
|
2089
2098
|
) : void 0;
|
|
2090
|
-
}, [(
|
|
2099
|
+
}, [(f = o._client) == null ? void 0 : f.userID, (c = o.state) == null ? void 0 : c.members]), d = Se(l == null ? void 0 : l.user), m = (b = l == null ? void 0 : l.user) == null ? void 0 : b.image, g = Xt(o), u = async () => {
|
|
2091
2100
|
try {
|
|
2092
|
-
|
|
2093
|
-
} catch (
|
|
2101
|
+
g ? await o.unpin() : await o.pin();
|
|
2102
|
+
} catch (x) {
|
|
2094
2103
|
console.error(
|
|
2095
2104
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2096
|
-
|
|
2105
|
+
x
|
|
2097
2106
|
);
|
|
2098
2107
|
}
|
|
2099
2108
|
};
|
|
@@ -2102,8 +2111,8 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2102
2111
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2103
2112
|
"button",
|
|
2104
2113
|
{
|
|
2105
|
-
className:
|
|
2106
|
-
|
|
2114
|
+
className: y(
|
|
2115
|
+
le,
|
|
2107
2116
|
"messaging-channel-view-back-button-mobile"
|
|
2108
2117
|
),
|
|
2109
2118
|
onClick: e || (() => {
|
|
@@ -2115,12 +2124,12 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2115
2124
|
) }),
|
|
2116
2125
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2117
2126
|
/* @__PURE__ */ n(
|
|
2118
|
-
|
|
2127
|
+
ne,
|
|
2119
2128
|
{
|
|
2120
|
-
id: ((
|
|
2129
|
+
id: ((N = l == null ? void 0 : l.user) == null ? void 0 : N.id) || o.id || "unknown",
|
|
2121
2130
|
name: d,
|
|
2122
2131
|
image: m,
|
|
2123
|
-
starred: r &&
|
|
2132
|
+
starred: r && g,
|
|
2124
2133
|
dmAgentEnabled: i,
|
|
2125
2134
|
size: 40
|
|
2126
2135
|
}
|
|
@@ -2134,12 +2143,12 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2134
2143
|
"aria-label": `View info for ${d}`,
|
|
2135
2144
|
children: [
|
|
2136
2145
|
d,
|
|
2137
|
-
/* @__PURE__ */ n(
|
|
2146
|
+
/* @__PURE__ */ n(je, { className: "size-3 shrink-0" })
|
|
2138
2147
|
]
|
|
2139
2148
|
}
|
|
2140
2149
|
),
|
|
2141
2150
|
i && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2142
|
-
/* @__PURE__ */ n(
|
|
2151
|
+
/* @__PURE__ */ n(Be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2143
2152
|
/* @__PURE__ */ n("span", { children: Vt })
|
|
2144
2153
|
] })
|
|
2145
2154
|
] }),
|
|
@@ -2147,18 +2156,18 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2147
2156
|
r && /* @__PURE__ */ n(
|
|
2148
2157
|
"button",
|
|
2149
2158
|
{
|
|
2150
|
-
className:
|
|
2159
|
+
className: le,
|
|
2151
2160
|
onClick: u,
|
|
2152
2161
|
type: "button",
|
|
2153
|
-
"aria-label":
|
|
2162
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
2154
2163
|
children: /* @__PURE__ */ n(
|
|
2155
|
-
|
|
2164
|
+
Fe,
|
|
2156
2165
|
{
|
|
2157
|
-
className:
|
|
2158
|
-
"text-yellow-600":
|
|
2159
|
-
"text-black/90": !
|
|
2166
|
+
className: y("size-5", {
|
|
2167
|
+
"text-yellow-600": g,
|
|
2168
|
+
"text-black/90": !g
|
|
2160
2169
|
}),
|
|
2161
|
-
weight:
|
|
2170
|
+
weight: g ? "duotone" : "regular"
|
|
2162
2171
|
}
|
|
2163
2172
|
)
|
|
2164
2173
|
}
|
|
@@ -2166,7 +2175,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2166
2175
|
/* @__PURE__ */ n(
|
|
2167
2176
|
"button",
|
|
2168
2177
|
{
|
|
2169
|
-
className:
|
|
2178
|
+
className: le,
|
|
2170
2179
|
onClick: s,
|
|
2171
2180
|
type: "button",
|
|
2172
2181
|
"aria-label": "Show info",
|
|
@@ -2180,8 +2189,8 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2180
2189
|
t && e && /* @__PURE__ */ n(
|
|
2181
2190
|
"button",
|
|
2182
2191
|
{
|
|
2183
|
-
className:
|
|
2184
|
-
|
|
2192
|
+
className: y(
|
|
2193
|
+
le,
|
|
2185
2194
|
"messaging-channel-view-back-button-desktop"
|
|
2186
2195
|
),
|
|
2187
2196
|
type: "button",
|
|
@@ -2191,12 +2200,12 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2191
2200
|
}
|
|
2192
2201
|
),
|
|
2193
2202
|
/* @__PURE__ */ n(
|
|
2194
|
-
|
|
2203
|
+
ne,
|
|
2195
2204
|
{
|
|
2196
|
-
id: ((v =
|
|
2205
|
+
id: ((v = l == null ? void 0 : l.user) == null ? void 0 : v.id) || o.id || "unknown",
|
|
2197
2206
|
name: d,
|
|
2198
2207
|
image: m,
|
|
2199
|
-
starred: r &&
|
|
2208
|
+
starred: r && g,
|
|
2200
2209
|
dmAgentEnabled: i,
|
|
2201
2210
|
size: 40
|
|
2202
2211
|
}
|
|
@@ -2211,12 +2220,12 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2211
2220
|
"aria-label": `View info for ${d}`,
|
|
2212
2221
|
children: [
|
|
2213
2222
|
/* @__PURE__ */ n("span", { className: "truncate", children: d }),
|
|
2214
|
-
/* @__PURE__ */ n(
|
|
2223
|
+
/* @__PURE__ */ n(je, { className: "size-4 shrink-0" })
|
|
2215
2224
|
]
|
|
2216
2225
|
}
|
|
2217
2226
|
) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: d }),
|
|
2218
2227
|
i && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2219
|
-
/* @__PURE__ */ n(
|
|
2228
|
+
/* @__PURE__ */ n(Be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2220
2229
|
/* @__PURE__ */ n("span", { className: "truncate", children: Vt })
|
|
2221
2230
|
] })
|
|
2222
2231
|
] })
|
|
@@ -2225,18 +2234,18 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2225
2234
|
r && /* @__PURE__ */ n(
|
|
2226
2235
|
"button",
|
|
2227
2236
|
{
|
|
2228
|
-
className:
|
|
2237
|
+
className: le,
|
|
2229
2238
|
onClick: u,
|
|
2230
2239
|
type: "button",
|
|
2231
|
-
"aria-label":
|
|
2240
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
2232
2241
|
children: /* @__PURE__ */ n(
|
|
2233
|
-
|
|
2242
|
+
Fe,
|
|
2234
2243
|
{
|
|
2235
|
-
className:
|
|
2236
|
-
"text-yellow-600":
|
|
2237
|
-
"text-black/90": !
|
|
2244
|
+
className: y("size-5", {
|
|
2245
|
+
"text-yellow-600": g,
|
|
2246
|
+
"text-black/90": !g
|
|
2238
2247
|
}),
|
|
2239
|
-
weight:
|
|
2248
|
+
weight: g ? "duotone" : "regular"
|
|
2240
2249
|
}
|
|
2241
2250
|
)
|
|
2242
2251
|
}
|
|
@@ -2244,7 +2253,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2244
2253
|
a && s && /* @__PURE__ */ n(
|
|
2245
2254
|
"button",
|
|
2246
2255
|
{
|
|
2247
|
-
className:
|
|
2256
|
+
className: le,
|
|
2248
2257
|
onClick: s,
|
|
2249
2258
|
type: "button",
|
|
2250
2259
|
"aria-label": "Show info",
|
|
@@ -2261,69 +2270,75 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2261
2270
|
renderMessageInputFooter: a,
|
|
2262
2271
|
renderConversationFooter: r,
|
|
2263
2272
|
onLeaveConversation: i,
|
|
2264
|
-
onBlockParticipant:
|
|
2265
|
-
showDeleteConversation:
|
|
2273
|
+
onBlockParticipant: o,
|
|
2274
|
+
showDeleteConversation: l = !0,
|
|
2266
2275
|
onDeleteConversationClick: d,
|
|
2267
2276
|
onBlockParticipantClick: m,
|
|
2268
|
-
onReportParticipantClick:
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
+
onReportParticipantClick: g,
|
|
2278
|
+
showBlockParticipant: u = !0,
|
|
2279
|
+
showReportParticipant: f = !0,
|
|
2280
|
+
showFollowerStatus: c = !0,
|
|
2281
|
+
composerDisabled: b = !1,
|
|
2282
|
+
composerDisabledReason: N,
|
|
2283
|
+
showStarButton: v = !1,
|
|
2284
|
+
chatbotVotingEnabled: x = !1,
|
|
2285
|
+
renderChannelBanner: w,
|
|
2286
|
+
customProfileContent: M,
|
|
2287
|
+
customChannelActions: A,
|
|
2288
|
+
renderMessage: S,
|
|
2289
|
+
dmAgentEnabled: L = !1,
|
|
2290
|
+
viewerLanguage: I
|
|
2277
2291
|
}) => {
|
|
2278
|
-
var
|
|
2279
|
-
const { channel:
|
|
2280
|
-
var
|
|
2281
|
-
const
|
|
2282
|
-
return
|
|
2283
|
-
(
|
|
2284
|
-
var
|
|
2285
|
-
return ((
|
|
2292
|
+
var Y, W, $, p, _, R;
|
|
2293
|
+
const { channel: C } = de(), k = K(null), E = O.useMemo(() => {
|
|
2294
|
+
var q, Z;
|
|
2295
|
+
const T = (q = C._client) == null ? void 0 : q.userID;
|
|
2296
|
+
return T ? Object.values(((Z = C.state) == null ? void 0 : Z.members) || {}).find(
|
|
2297
|
+
(ae) => {
|
|
2298
|
+
var ee;
|
|
2299
|
+
return ((ee = ae.user) == null ? void 0 : ee.id) && ae.user.id !== T;
|
|
2286
2300
|
}
|
|
2287
2301
|
) : void 0;
|
|
2288
|
-
}, [(
|
|
2289
|
-
var
|
|
2290
|
-
const
|
|
2291
|
-
return
|
|
2292
|
-
var
|
|
2293
|
-
return ((
|
|
2302
|
+
}, [(Y = C._client) == null ? void 0 : Y.userID, (W = C.state) == null ? void 0 : W.members]), D = O.useMemo(() => {
|
|
2303
|
+
var q, Z;
|
|
2304
|
+
const T = (q = C._client) == null ? void 0 : q.userID;
|
|
2305
|
+
return T ? Object.values(((Z = C.state) == null ? void 0 : Z.members) || {}).find((ae) => {
|
|
2306
|
+
var ee;
|
|
2307
|
+
return ((ee = ae.user) == null ? void 0 : ee.id) === T;
|
|
2294
2308
|
}) : void 0;
|
|
2295
|
-
}, [(
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2309
|
+
}, [($ = C._client) == null ? void 0 : $.userID, (p = C.state) == null ? void 0 : p.members]), V = ((_ = D == null ? void 0 : D.user) == null ? void 0 : _.is_account) ?? (D == null ? void 0 : D.is_account), F = ((R = E == null ? void 0 : E.user) == null ? void 0 : R.is_account) ?? (E == null ? void 0 : E.is_account), X = L && V === !1 && F === !0, U = O.useMemo(() => {
|
|
2310
|
+
if (!c) return;
|
|
2311
|
+
const T = C.data ?? {};
|
|
2312
|
+
if (T.followerStatus)
|
|
2313
|
+
return String(T.followerStatus);
|
|
2314
|
+
if (T.isFollower !== void 0)
|
|
2315
|
+
return T.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2316
|
+
}, [C.data, c]), G = H(() => {
|
|
2317
|
+
var T;
|
|
2318
|
+
(T = k.current) == null || T.showModal();
|
|
2319
|
+
}, []), P = H(() => {
|
|
2320
|
+
var T;
|
|
2321
|
+
(T = k.current) == null || T.close();
|
|
2322
|
+
}, []), B = H(
|
|
2323
|
+
(T) => {
|
|
2324
|
+
const { message: j } = be("ChannelView"), q = /* @__PURE__ */ n(
|
|
2310
2325
|
ya,
|
|
2311
2326
|
{
|
|
2312
|
-
...
|
|
2313
|
-
chatbotVotingEnabled:
|
|
2314
|
-
viewerLanguage:
|
|
2327
|
+
...T,
|
|
2328
|
+
chatbotVotingEnabled: x,
|
|
2329
|
+
viewerLanguage: I
|
|
2315
2330
|
}
|
|
2316
2331
|
);
|
|
2317
|
-
return !
|
|
2332
|
+
return !S || !j ? q : S(q, j);
|
|
2318
2333
|
},
|
|
2319
|
-
[
|
|
2334
|
+
[x, S, I]
|
|
2320
2335
|
);
|
|
2321
|
-
return /* @__PURE__ */ h(
|
|
2336
|
+
return /* @__PURE__ */ h(re, { children: [
|
|
2322
2337
|
/* @__PURE__ */ n(
|
|
2323
2338
|
rs,
|
|
2324
2339
|
{
|
|
2325
2340
|
overrides: {
|
|
2326
|
-
Message:
|
|
2341
|
+
Message: B,
|
|
2327
2342
|
MessageActions: Ea
|
|
2328
2343
|
},
|
|
2329
2344
|
children: /* @__PURE__ */ h(is, { children: [
|
|
@@ -2332,13 +2347,13 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2332
2347
|
{
|
|
2333
2348
|
onBack: e,
|
|
2334
2349
|
showBackButton: t,
|
|
2335
|
-
onShowInfo:
|
|
2350
|
+
onShowInfo: G,
|
|
2336
2351
|
canShowInfo: !!E,
|
|
2337
|
-
showStarButton:
|
|
2338
|
-
dmAgentEnabled:
|
|
2352
|
+
showStarButton: v,
|
|
2353
|
+
dmAgentEnabled: X
|
|
2339
2354
|
}
|
|
2340
2355
|
) }, "lt-channel-header"),
|
|
2341
|
-
|
|
2356
|
+
w ? /* @__PURE__ */ n(O.Fragment, { children: w() }, "lt-channel-banner") : null,
|
|
2342
2357
|
/* @__PURE__ */ n(
|
|
2343
2358
|
"div",
|
|
2344
2359
|
{
|
|
@@ -2353,12 +2368,14 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2353
2368
|
},
|
|
2354
2369
|
"lt-channel-message-list"
|
|
2355
2370
|
),
|
|
2356
|
-
r ? /* @__PURE__ */ n(
|
|
2371
|
+
r ? /* @__PURE__ */ n(O.Fragment, { children: r(C) }, "lt-channel-conversation-footer") : null,
|
|
2357
2372
|
/* @__PURE__ */ n(
|
|
2358
2373
|
Da,
|
|
2359
2374
|
{
|
|
2360
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2361
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2375
|
+
renderActions: () => s == null ? void 0 : s(C),
|
|
2376
|
+
renderFooter: () => a == null ? void 0 : a(C),
|
|
2377
|
+
disabled: b,
|
|
2378
|
+
disabledReason: N
|
|
2362
2379
|
},
|
|
2363
2380
|
"lt-channel-message-input"
|
|
2364
2381
|
)
|
|
@@ -2368,24 +2385,26 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2368
2385
|
/* @__PURE__ */ n(
|
|
2369
2386
|
Fs,
|
|
2370
2387
|
{
|
|
2371
|
-
dialogRef:
|
|
2372
|
-
onClose:
|
|
2388
|
+
dialogRef: k,
|
|
2389
|
+
onClose: P,
|
|
2373
2390
|
participant: E,
|
|
2374
|
-
participantDisplayName:
|
|
2375
|
-
channel:
|
|
2376
|
-
followerStatusLabel:
|
|
2391
|
+
participantDisplayName: Se(E == null ? void 0 : E.user),
|
|
2392
|
+
channel: C,
|
|
2393
|
+
followerStatusLabel: U,
|
|
2377
2394
|
onLeaveConversation: i,
|
|
2378
|
-
onBlockParticipant:
|
|
2379
|
-
showDeleteConversation:
|
|
2395
|
+
onBlockParticipant: o,
|
|
2396
|
+
showDeleteConversation: l,
|
|
2397
|
+
showBlockParticipant: u,
|
|
2398
|
+
showReportParticipant: f,
|
|
2380
2399
|
onDeleteConversationClick: d,
|
|
2381
2400
|
onBlockParticipantClick: m,
|
|
2382
|
-
onReportParticipantClick:
|
|
2383
|
-
customProfileContent:
|
|
2384
|
-
customChannelActions:
|
|
2401
|
+
onReportParticipantClick: g,
|
|
2402
|
+
customProfileContent: M,
|
|
2403
|
+
customChannelActions: A
|
|
2385
2404
|
}
|
|
2386
2405
|
)
|
|
2387
2406
|
] });
|
|
2388
|
-
}, dn =
|
|
2407
|
+
}, dn = O.memo(
|
|
2389
2408
|
({
|
|
2390
2409
|
channel: e,
|
|
2391
2410
|
onBack: t,
|
|
@@ -2393,79 +2412,84 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2393
2412
|
renderMessageInputActions: a,
|
|
2394
2413
|
renderMessageInputFooter: r,
|
|
2395
2414
|
renderConversationFooter: i,
|
|
2396
|
-
onLeaveConversation:
|
|
2397
|
-
onBlockParticipant:
|
|
2415
|
+
onLeaveConversation: o,
|
|
2416
|
+
onBlockParticipant: l,
|
|
2398
2417
|
className: d,
|
|
2399
2418
|
CustomChannelEmptyState: m = Ha,
|
|
2400
|
-
showDeleteConversation:
|
|
2419
|
+
showDeleteConversation: g = !0,
|
|
2401
2420
|
onDeleteConversationClick: u,
|
|
2402
|
-
onBlockParticipantClick:
|
|
2421
|
+
onBlockParticipantClick: f,
|
|
2403
2422
|
onReportParticipantClick: c,
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2423
|
+
showBlockParticipant: b = !0,
|
|
2424
|
+
showReportParticipant: N = !0,
|
|
2425
|
+
showFollowerStatus: v = !0,
|
|
2426
|
+
composerDisabled: x = !1,
|
|
2427
|
+
composerDisabledReason: w,
|
|
2428
|
+
dmAgentEnabled: M,
|
|
2429
|
+
messageMetadata: A,
|
|
2430
|
+
onMessageSent: S,
|
|
2431
|
+
showStarButton: L = !1,
|
|
2432
|
+
chatbotVotingEnabled: I = !1,
|
|
2433
|
+
renderChannelBanner: C,
|
|
2434
|
+
customProfileContent: k,
|
|
2411
2435
|
customChannelActions: E,
|
|
2412
|
-
renderMessage:
|
|
2413
|
-
onMessageLinkClick:
|
|
2414
|
-
sendButton:
|
|
2415
|
-
attachmentPreviewList:
|
|
2416
|
-
viewerLanguage:
|
|
2436
|
+
renderMessage: D,
|
|
2437
|
+
onMessageLinkClick: V,
|
|
2438
|
+
sendButton: F,
|
|
2439
|
+
attachmentPreviewList: X,
|
|
2440
|
+
viewerLanguage: U
|
|
2417
2441
|
}) => {
|
|
2418
|
-
const
|
|
2419
|
-
async (
|
|
2420
|
-
var
|
|
2421
|
-
const
|
|
2422
|
-
...
|
|
2423
|
-
...
|
|
2424
|
-
...
|
|
2442
|
+
const G = H(
|
|
2443
|
+
async (B, Y, W) => {
|
|
2444
|
+
var j;
|
|
2445
|
+
const $ = ((j = e.data) == null ? void 0 : j.chatbot_paused) === !0, p = M && !$, _ = {
|
|
2446
|
+
...Y,
|
|
2447
|
+
...p && { silent: !0 },
|
|
2448
|
+
...A && {
|
|
2425
2449
|
metadata: {
|
|
2426
|
-
...
|
|
2427
|
-
...
|
|
2450
|
+
...Y.metadata ?? {},
|
|
2451
|
+
...A
|
|
2428
2452
|
}
|
|
2429
2453
|
}
|
|
2430
|
-
},
|
|
2431
|
-
...
|
|
2432
|
-
...
|
|
2433
|
-
},
|
|
2434
|
-
return
|
|
2454
|
+
}, R = {
|
|
2455
|
+
...W,
|
|
2456
|
+
...p && { skip_push: !0 }
|
|
2457
|
+
}, T = await e.sendMessage(_, R);
|
|
2458
|
+
return S == null || S(T), T;
|
|
2435
2459
|
},
|
|
2436
|
-
[e,
|
|
2437
|
-
),
|
|
2438
|
-
return
|
|
2439
|
-
if (!
|
|
2440
|
-
const
|
|
2441
|
-
if (!
|
|
2442
|
-
const
|
|
2443
|
-
const
|
|
2444
|
-
if (!
|
|
2445
|
-
const
|
|
2446
|
-
|
|
2460
|
+
[e, M, A, S]
|
|
2461
|
+
), P = K(null);
|
|
2462
|
+
return J(() => {
|
|
2463
|
+
if (!V) return;
|
|
2464
|
+
const B = P.current;
|
|
2465
|
+
if (!B) return;
|
|
2466
|
+
const Y = (W) => {
|
|
2467
|
+
const $ = W.target, p = $ == null ? void 0 : $.closest("a[href]"), _ = p == null ? void 0 : p.getAttribute("href");
|
|
2468
|
+
if (!_) return;
|
|
2469
|
+
const R = p == null ? void 0 : p.closest("[data-message-id]"), T = R == null ? void 0 : R.getAttribute("data-message-id"), j = T ? e.state.messages.find((q) => q.id === T) : void 0;
|
|
2470
|
+
V(_, j);
|
|
2447
2471
|
};
|
|
2448
|
-
return
|
|
2449
|
-
}, [
|
|
2472
|
+
return B.addEventListener("click", Y), () => B.removeEventListener("click", Y);
|
|
2473
|
+
}, [V, e]), /* @__PURE__ */ n(
|
|
2450
2474
|
"div",
|
|
2451
2475
|
{
|
|
2452
|
-
ref:
|
|
2453
|
-
className:
|
|
2476
|
+
ref: P,
|
|
2477
|
+
className: y(
|
|
2454
2478
|
"messaging-channel-view h-full flex flex-col",
|
|
2455
2479
|
d
|
|
2456
2480
|
),
|
|
2457
|
-
children: /* @__PURE__ */ n(cn.Provider, { value:
|
|
2481
|
+
children: /* @__PURE__ */ n(cn.Provider, { value: M ?? !1, children: /* @__PURE__ */ n(
|
|
2458
2482
|
as,
|
|
2459
2483
|
{
|
|
2460
2484
|
channel: e,
|
|
2461
2485
|
MessageSystem: ja,
|
|
2462
2486
|
EmptyStateIndicator: m,
|
|
2463
|
-
LoadingIndicator:
|
|
2487
|
+
LoadingIndicator: ke,
|
|
2464
2488
|
DateSeparator: $s,
|
|
2465
2489
|
TypingIndicator: Ua,
|
|
2466
|
-
doSendMessageRequest:
|
|
2467
|
-
...
|
|
2468
|
-
...
|
|
2490
|
+
doSendMessageRequest: G,
|
|
2491
|
+
...F ? { SendButton: F } : {},
|
|
2492
|
+
...X ? { AttachmentPreviewList: X } : {},
|
|
2469
2493
|
children: /* @__PURE__ */ n(
|
|
2470
2494
|
Wa,
|
|
2471
2495
|
{
|
|
@@ -2474,21 +2498,26 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2474
2498
|
renderMessageInputActions: a,
|
|
2475
2499
|
renderMessageInputFooter: r,
|
|
2476
2500
|
renderConversationFooter: i,
|
|
2477
|
-
onLeaveConversation:
|
|
2478
|
-
onBlockParticipant:
|
|
2501
|
+
onLeaveConversation: o,
|
|
2502
|
+
onBlockParticipant: l,
|
|
2479
2503
|
CustomChannelEmptyState: m,
|
|
2480
|
-
showDeleteConversation:
|
|
2504
|
+
showDeleteConversation: g,
|
|
2481
2505
|
onDeleteConversationClick: u,
|
|
2482
|
-
onBlockParticipantClick:
|
|
2506
|
+
onBlockParticipantClick: f,
|
|
2483
2507
|
onReportParticipantClick: c,
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2508
|
+
showBlockParticipant: b,
|
|
2509
|
+
showReportParticipant: N,
|
|
2510
|
+
showFollowerStatus: v,
|
|
2511
|
+
composerDisabled: x,
|
|
2512
|
+
composerDisabledReason: w,
|
|
2513
|
+
showStarButton: L,
|
|
2514
|
+
dmAgentEnabled: M,
|
|
2515
|
+
chatbotVotingEnabled: I,
|
|
2516
|
+
renderChannelBanner: C,
|
|
2517
|
+
customProfileContent: k,
|
|
2489
2518
|
customChannelActions: E,
|
|
2490
|
-
renderMessage:
|
|
2491
|
-
viewerLanguage:
|
|
2519
|
+
renderMessage: D,
|
|
2520
|
+
viewerLanguage: U
|
|
2492
2521
|
}
|
|
2493
2522
|
)
|
|
2494
2523
|
}
|
|
@@ -2498,7 +2527,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2498
2527
|
}
|
|
2499
2528
|
);
|
|
2500
2529
|
dn.displayName = "ChannelView";
|
|
2501
|
-
const
|
|
2530
|
+
const he = O.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
|
|
2502
2531
|
/* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2503
2532
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2504
2533
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2512,7 +2541,7 @@ const de = $.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2512
2541
|
}
|
|
2513
2542
|
)
|
|
2514
2543
|
] }) }));
|
|
2515
|
-
|
|
2544
|
+
he.displayName = "ErrorState";
|
|
2516
2545
|
const Ni = ({
|
|
2517
2546
|
capabilities: e = {},
|
|
2518
2547
|
renderMessageInputActions: t,
|
|
@@ -2520,123 +2549,123 @@ const Ni = ({
|
|
|
2520
2549
|
onChannelSelect: a,
|
|
2521
2550
|
onExitConversation: r,
|
|
2522
2551
|
initialParticipantFilter: i,
|
|
2523
|
-
initialParticipantData:
|
|
2524
|
-
CustomChannelEmptyState:
|
|
2552
|
+
initialParticipantData: o,
|
|
2553
|
+
CustomChannelEmptyState: l,
|
|
2525
2554
|
onBlockParticipantClick: d,
|
|
2526
2555
|
onReportParticipantClick: m,
|
|
2527
|
-
dmAgentEnabled:
|
|
2556
|
+
dmAgentEnabled: g,
|
|
2528
2557
|
onMessageSent: u,
|
|
2529
|
-
chatbotVotingEnabled:
|
|
2558
|
+
chatbotVotingEnabled: f = !1,
|
|
2530
2559
|
viewerLanguage: c,
|
|
2531
2560
|
renderChannelBanner: b,
|
|
2532
|
-
customChannelActions:
|
|
2561
|
+
customChannelActions: N,
|
|
2533
2562
|
renderMessage: v,
|
|
2534
|
-
onMessageLinkClick:
|
|
2563
|
+
onMessageLinkClick: x
|
|
2535
2564
|
}) => {
|
|
2536
2565
|
const {
|
|
2537
|
-
client:
|
|
2538
|
-
isConnected:
|
|
2539
|
-
isLoading:
|
|
2540
|
-
error:
|
|
2566
|
+
client: w,
|
|
2567
|
+
isConnected: M,
|
|
2568
|
+
isLoading: A,
|
|
2569
|
+
error: S,
|
|
2541
2570
|
refreshConnection: L,
|
|
2542
|
-
service:
|
|
2543
|
-
debug:
|
|
2544
|
-
} = Ms(), [
|
|
2545
|
-
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2548
|
-
if (!
|
|
2571
|
+
service: I,
|
|
2572
|
+
debug: C
|
|
2573
|
+
} = Ms(), [k, E] = z(null), [D, V] = z(null), [F, X] = z(!1), { showDeleteConversation: U = !0 } = e, G = K(o);
|
|
2574
|
+
G.current = o;
|
|
2575
|
+
const P = K(a);
|
|
2576
|
+
P.current = a, J(() => {
|
|
2577
|
+
if (!w || !M) return;
|
|
2549
2578
|
(async () => {
|
|
2550
|
-
var p,
|
|
2551
|
-
const
|
|
2552
|
-
if (
|
|
2579
|
+
var p, _;
|
|
2580
|
+
const $ = w.userID;
|
|
2581
|
+
if ($)
|
|
2553
2582
|
try {
|
|
2554
|
-
|
|
2583
|
+
C && console.log(
|
|
2555
2584
|
"[MessagingShell] Loading initial conversation with:",
|
|
2556
2585
|
i
|
|
2557
2586
|
);
|
|
2558
|
-
const
|
|
2587
|
+
const R = await w.queryChannels(
|
|
2559
2588
|
{
|
|
2560
2589
|
type: "messaging",
|
|
2561
|
-
members: { $eq: [
|
|
2590
|
+
members: { $eq: [$, i] }
|
|
2562
2591
|
},
|
|
2563
2592
|
{},
|
|
2564
2593
|
{ limit: 1 }
|
|
2565
2594
|
);
|
|
2566
|
-
if (
|
|
2567
|
-
|
|
2595
|
+
if (R.length > 0) {
|
|
2596
|
+
E(R[0]), V(null), (p = P.current) == null || p.call(P, R[0]), C && console.log(
|
|
2568
2597
|
"[MessagingShell] Initial conversation loaded:",
|
|
2569
|
-
|
|
2598
|
+
R[0].id
|
|
2570
2599
|
);
|
|
2571
2600
|
return;
|
|
2572
2601
|
}
|
|
2573
|
-
const
|
|
2574
|
-
if (!
|
|
2575
|
-
|
|
2602
|
+
const T = G.current;
|
|
2603
|
+
if (!T || !I) {
|
|
2604
|
+
V("No conversation found with this account"), C && console.log(
|
|
2576
2605
|
"[MessagingShell] No conversation found for:",
|
|
2577
2606
|
i
|
|
2578
2607
|
);
|
|
2579
2608
|
return;
|
|
2580
2609
|
}
|
|
2581
2610
|
try {
|
|
2582
|
-
const
|
|
2583
|
-
id:
|
|
2584
|
-
name:
|
|
2585
|
-
phone:
|
|
2611
|
+
const j = await I.startChannelWithParticipant({
|
|
2612
|
+
id: T.id,
|
|
2613
|
+
name: T.name,
|
|
2614
|
+
phone: T.phone
|
|
2586
2615
|
});
|
|
2587
|
-
|
|
2616
|
+
E(j), V(null), (_ = P.current) == null || _.call(P, j), C && console.log(
|
|
2588
2617
|
"[MessagingShell] Channel created and loaded:",
|
|
2589
|
-
|
|
2618
|
+
j.id
|
|
2590
2619
|
);
|
|
2591
|
-
} catch (
|
|
2620
|
+
} catch (j) {
|
|
2592
2621
|
console.error(
|
|
2593
2622
|
"[MessagingShell] Failed to create conversation:",
|
|
2594
|
-
|
|
2595
|
-
),
|
|
2623
|
+
j
|
|
2624
|
+
), V("Failed to create conversation");
|
|
2596
2625
|
}
|
|
2597
|
-
} catch (
|
|
2626
|
+
} catch (R) {
|
|
2598
2627
|
console.error(
|
|
2599
2628
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2600
|
-
|
|
2601
|
-
),
|
|
2629
|
+
R
|
|
2630
|
+
), V("Failed to load conversation");
|
|
2602
2631
|
}
|
|
2603
2632
|
})();
|
|
2604
|
-
}, [i,
|
|
2605
|
-
const
|
|
2606
|
-
|
|
2607
|
-
const
|
|
2608
|
-
var
|
|
2609
|
-
|
|
2633
|
+
}, [i, w, M, I, C]);
|
|
2634
|
+
const B = K(r);
|
|
2635
|
+
B.current = r;
|
|
2636
|
+
const Y = H(() => {
|
|
2637
|
+
var W;
|
|
2638
|
+
E(null), X(!0), (W = B.current) == null || W.call(B);
|
|
2610
2639
|
}, []);
|
|
2611
|
-
return
|
|
2612
|
-
|
|
2640
|
+
return A ? /* @__PURE__ */ n(ke, {}) : S ? /* @__PURE__ */ n(he, { message: S, onBack: L }) : !M || !w ? /* @__PURE__ */ n(
|
|
2641
|
+
he,
|
|
2613
2642
|
{
|
|
2614
2643
|
message: "Not connected to messaging service",
|
|
2615
2644
|
onBack: L
|
|
2616
2645
|
}
|
|
2617
|
-
) :
|
|
2646
|
+
) : D ? /* @__PURE__ */ n(he, { message: D }) : F && !k ? /* @__PURE__ */ n(he, { message: "Conversation ended" }) : k ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2618
2647
|
dn,
|
|
2619
2648
|
{
|
|
2620
|
-
channel:
|
|
2649
|
+
channel: k,
|
|
2621
2650
|
renderMessageInputActions: t,
|
|
2622
2651
|
renderConversationFooter: s,
|
|
2623
2652
|
renderChannelBanner: b,
|
|
2624
|
-
onLeaveConversation:
|
|
2625
|
-
onBlockParticipant:
|
|
2626
|
-
CustomChannelEmptyState:
|
|
2627
|
-
showDeleteConversation:
|
|
2653
|
+
onLeaveConversation: Y,
|
|
2654
|
+
onBlockParticipant: Y,
|
|
2655
|
+
CustomChannelEmptyState: l,
|
|
2656
|
+
showDeleteConversation: U,
|
|
2628
2657
|
onBlockParticipantClick: d,
|
|
2629
2658
|
onReportParticipantClick: m,
|
|
2630
|
-
dmAgentEnabled:
|
|
2659
|
+
dmAgentEnabled: g,
|
|
2631
2660
|
onMessageSent: u,
|
|
2632
|
-
chatbotVotingEnabled:
|
|
2661
|
+
chatbotVotingEnabled: f,
|
|
2633
2662
|
viewerLanguage: c,
|
|
2634
|
-
customChannelActions:
|
|
2663
|
+
customChannelActions: N,
|
|
2635
2664
|
renderMessage: v,
|
|
2636
|
-
onMessageLinkClick:
|
|
2665
|
+
onMessageLinkClick: x
|
|
2637
2666
|
},
|
|
2638
|
-
|
|
2639
|
-
) }) }) : /* @__PURE__ */ n(
|
|
2667
|
+
k.id
|
|
2668
|
+
) }) }) : /* @__PURE__ */ n(ke, {});
|
|
2640
2669
|
};
|
|
2641
2670
|
function Xa(e) {
|
|
2642
2671
|
const t = e.state.pending_messages;
|
|
@@ -2644,14 +2673,14 @@ function Xa(e) {
|
|
|
2644
2673
|
for (const s of t)
|
|
2645
2674
|
e.state.addMessageSorted(s.message);
|
|
2646
2675
|
}
|
|
2647
|
-
const un =
|
|
2676
|
+
const un = O.createContext({
|
|
2648
2677
|
selectedChannel: void 0,
|
|
2649
2678
|
onChannelSelect: () => {
|
|
2650
2679
|
},
|
|
2651
2680
|
debug: !1,
|
|
2652
2681
|
renderMessagePreview: void 0,
|
|
2653
2682
|
viewerLanguage: void 0
|
|
2654
|
-
}), Ka = un.Provider, Ja = () =>
|
|
2683
|
+
}), Ka = un.Provider, Ja = () => O.useContext(un), Za = (e, t) => {
|
|
2655
2684
|
const s = new Date(
|
|
2656
2685
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2657
2686
|
), r = new Date(
|
|
@@ -2672,51 +2701,51 @@ const un = $.createContext({
|
|
|
2672
2701
|
day: "numeric",
|
|
2673
2702
|
year: "2-digit"
|
|
2674
2703
|
});
|
|
2675
|
-
}, mn =
|
|
2704
|
+
}, mn = O.memo(
|
|
2676
2705
|
({ channel: e, unread: t }) => {
|
|
2677
|
-
var L,
|
|
2706
|
+
var L, I, C;
|
|
2678
2707
|
const {
|
|
2679
2708
|
selectedChannel: s,
|
|
2680
2709
|
onChannelSelect: a,
|
|
2681
2710
|
debug: r,
|
|
2682
2711
|
renderMessagePreview: i,
|
|
2683
|
-
viewerLanguage:
|
|
2684
|
-
} = Ja(),
|
|
2712
|
+
viewerLanguage: o
|
|
2713
|
+
} = Ja(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2685
2714
|
e && a(e);
|
|
2686
|
-
}, m = (
|
|
2687
|
-
const
|
|
2688
|
-
!
|
|
2715
|
+
}, m = (k) => {
|
|
2716
|
+
const E = k.key === "Enter" || k.key === " ", D = k.repeat;
|
|
2717
|
+
!E || D || (k.preventDefault(), d());
|
|
2689
2718
|
}, u = Object.values(((L = e == null ? void 0 : e.state) == null ? void 0 : L.members) || {}).find(
|
|
2690
|
-
(
|
|
2691
|
-
var
|
|
2692
|
-
return ((
|
|
2719
|
+
(k) => {
|
|
2720
|
+
var E, D;
|
|
2721
|
+
return ((E = k.user) == null ? void 0 : E.id) && k.user.id !== ((D = e == null ? void 0 : e._client) == null ? void 0 : D.userID);
|
|
2693
2722
|
}
|
|
2694
|
-
),
|
|
2695
|
-
var
|
|
2696
|
-
const
|
|
2697
|
-
if (
|
|
2698
|
-
for (let
|
|
2699
|
-
if (
|
|
2723
|
+
), f = Se(u == null ? void 0 : u.user), c = (I = u == null ? void 0 : u.user) == null ? void 0 : I.image, b = (() => {
|
|
2724
|
+
var E;
|
|
2725
|
+
const k = (E = e == null ? void 0 : e.state) == null ? void 0 : E.messages;
|
|
2726
|
+
if (k != null && k.length) {
|
|
2727
|
+
for (let D = k.length - 1; D >= 0; D--)
|
|
2728
|
+
if (k[D].type !== "system") return k[D];
|
|
2700
2729
|
}
|
|
2701
2730
|
})(), v = (() => {
|
|
2702
|
-
var
|
|
2703
|
-
const
|
|
2731
|
+
var X, U, G, P;
|
|
2732
|
+
const k = Kt({
|
|
2704
2733
|
message: b,
|
|
2705
|
-
viewerLanguage:
|
|
2734
|
+
viewerLanguage: o
|
|
2706
2735
|
});
|
|
2707
|
-
if (((
|
|
2708
|
-
if (((
|
|
2709
|
-
if (((
|
|
2710
|
-
if (
|
|
2711
|
-
const
|
|
2712
|
-
return
|
|
2713
|
-
})(),
|
|
2736
|
+
if (((X = b == null ? void 0 : b.metadata) == null ? void 0 : X.custom_type) === "MESSAGE_TIP") return k ? `💵 ${k}` : "💵 Sent a tip";
|
|
2737
|
+
if (((U = b == null ? void 0 : b.metadata) == null ? void 0 : U.custom_type) === "MESSAGE_PAID") return k ? `💰 ${k}` : "💰 Sent a message";
|
|
2738
|
+
if (((G = b == null ? void 0 : b.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_ATTACHMENT") return k ? `📎 ${k}` : "📎 Sent an attachment";
|
|
2739
|
+
if (k) return k;
|
|
2740
|
+
const F = (P = b == null ? void 0 : b.attachments) == null ? void 0 : P[0];
|
|
2741
|
+
return F ? F.og_scrape_url ? F.og_scrape_url : F.type === "image" ? "📷 Sent an image" : F.type === "video" ? "🎥 Sent a video" : F.type === "audio" ? "🎵 Sent audio" : F.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2742
|
+
})(), x = b != null && b.created_at ? Qa(new Date(b.created_at)) : "", w = b ? Ce(b) : !1, M = i ? i(b, v) : `${w ? "✨ " : ""}${v}`, A = Xt(e), S = t ?? 0;
|
|
2714
2743
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2715
2744
|
channelId: e == null ? void 0 : e.id,
|
|
2716
|
-
isSelected:
|
|
2717
|
-
participantName:
|
|
2718
|
-
unreadCount:
|
|
2719
|
-
hasTimestamp: !!
|
|
2745
|
+
isSelected: l,
|
|
2746
|
+
participantName: f,
|
|
2747
|
+
unreadCount: S,
|
|
2748
|
+
hasTimestamp: !!x
|
|
2720
2749
|
}), /* @__PURE__ */ n(
|
|
2721
2750
|
"div",
|
|
2722
2751
|
{
|
|
@@ -2724,22 +2753,22 @@ const un = $.createContext({
|
|
|
2724
2753
|
tabIndex: 0,
|
|
2725
2754
|
onClick: d,
|
|
2726
2755
|
onKeyDown: m,
|
|
2727
|
-
className:
|
|
2756
|
+
className: y(
|
|
2728
2757
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
2729
2758
|
{
|
|
2730
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
2731
|
-
"hover:bg-sand": !
|
|
2759
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": l,
|
|
2760
|
+
"hover:bg-sand": !l
|
|
2732
2761
|
}
|
|
2733
2762
|
),
|
|
2734
2763
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-3", children: [
|
|
2735
2764
|
/* @__PURE__ */ n(
|
|
2736
|
-
|
|
2765
|
+
ne,
|
|
2737
2766
|
{
|
|
2738
|
-
id: ((
|
|
2739
|
-
name:
|
|
2767
|
+
id: ((C = u == null ? void 0 : u.user) == null ? void 0 : C.id) || e.id || "unknown",
|
|
2768
|
+
name: f,
|
|
2740
2769
|
image: c,
|
|
2741
2770
|
size: 44,
|
|
2742
|
-
starred:
|
|
2771
|
+
starred: A,
|
|
2743
2772
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
2744
2773
|
}
|
|
2745
2774
|
),
|
|
@@ -2748,21 +2777,21 @@ const un = $.createContext({
|
|
|
2748
2777
|
/* @__PURE__ */ h(
|
|
2749
2778
|
"h3",
|
|
2750
2779
|
{
|
|
2751
|
-
className:
|
|
2780
|
+
className: y(
|
|
2752
2781
|
"text-sm font-medium truncate",
|
|
2753
|
-
|
|
2782
|
+
l ? "text-primary" : "text-charcoal"
|
|
2754
2783
|
),
|
|
2755
2784
|
children: [
|
|
2756
|
-
|
|
2757
|
-
|
|
2785
|
+
A && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2786
|
+
f
|
|
2758
2787
|
]
|
|
2759
2788
|
}
|
|
2760
2789
|
),
|
|
2761
|
-
|
|
2790
|
+
x && /* @__PURE__ */ n("span", { className: "text-xs text-stone flex-shrink-0", children: x })
|
|
2762
2791
|
] }),
|
|
2763
2792
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2764
|
-
/* @__PURE__ */ n("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
2765
|
-
|
|
2793
|
+
/* @__PURE__ */ n("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: M }),
|
|
2794
|
+
S > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: S > 99 ? "99+" : S })
|
|
2766
2795
|
] })
|
|
2767
2796
|
] })
|
|
2768
2797
|
] })
|
|
@@ -2771,7 +2800,7 @@ const un = $.createContext({
|
|
|
2771
2800
|
}
|
|
2772
2801
|
);
|
|
2773
2802
|
mn.displayName = "CustomChannelPreview";
|
|
2774
|
-
const er = { last_message_at: -1 }, tr =
|
|
2803
|
+
const er = { last_message_at: -1 }, tr = O.memo(
|
|
2775
2804
|
({
|
|
2776
2805
|
onChannelSelect: e,
|
|
2777
2806
|
selectedChannel: t,
|
|
@@ -2779,27 +2808,27 @@ const er = { last_message_at: -1 }, tr = $.memo(
|
|
|
2779
2808
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2780
2809
|
channelRenderFilterFn: r,
|
|
2781
2810
|
sort: i = er,
|
|
2782
|
-
className:
|
|
2783
|
-
customEmptyStateIndicator:
|
|
2811
|
+
className: o,
|
|
2812
|
+
customEmptyStateIndicator: l,
|
|
2784
2813
|
renderMessagePreview: d,
|
|
2785
2814
|
viewerLanguage: m
|
|
2786
2815
|
}) => {
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2789
|
-
const { debug: u = !1 } =
|
|
2816
|
+
const g = O.useRef(0);
|
|
2817
|
+
g.current++;
|
|
2818
|
+
const { debug: u = !1 } = We(), f = O.useCallback(
|
|
2790
2819
|
(b) => {
|
|
2791
|
-
for (const
|
|
2792
|
-
Xa(
|
|
2820
|
+
for (const N of b)
|
|
2821
|
+
Xa(N);
|
|
2793
2822
|
return r ? r(b) : b;
|
|
2794
2823
|
},
|
|
2795
2824
|
[r]
|
|
2796
2825
|
);
|
|
2797
2826
|
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
2798
|
-
renderCount:
|
|
2827
|
+
renderCount: g.current,
|
|
2799
2828
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2800
2829
|
filters: s
|
|
2801
2830
|
});
|
|
2802
|
-
const c =
|
|
2831
|
+
const c = O.useMemo(
|
|
2803
2832
|
() => ({
|
|
2804
2833
|
selectedChannel: t,
|
|
2805
2834
|
onChannelSelect: e,
|
|
@@ -2818,9 +2847,9 @@ const er = { last_message_at: -1 }, tr = $.memo(
|
|
|
2818
2847
|
return /* @__PURE__ */ n(
|
|
2819
2848
|
"div",
|
|
2820
2849
|
{
|
|
2821
|
-
className:
|
|
2850
|
+
className: y(
|
|
2822
2851
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2823
|
-
|
|
2852
|
+
o
|
|
2824
2853
|
),
|
|
2825
2854
|
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Ka, { value: c, children: /* @__PURE__ */ n(
|
|
2826
2855
|
ls,
|
|
@@ -2829,9 +2858,9 @@ const er = { last_message_at: -1 }, tr = $.memo(
|
|
|
2829
2858
|
sort: i,
|
|
2830
2859
|
options: { limit: 30 },
|
|
2831
2860
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2832
|
-
channelRenderFilterFn:
|
|
2861
|
+
channelRenderFilterFn: f,
|
|
2833
2862
|
Preview: mn,
|
|
2834
|
-
EmptyStateIndicator:
|
|
2863
|
+
EmptyStateIndicator: l
|
|
2835
2864
|
},
|
|
2836
2865
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
2837
2866
|
) }) })
|
|
@@ -2841,7 +2870,7 @@ const er = { last_message_at: -1 }, tr = $.memo(
|
|
|
2841
2870
|
);
|
|
2842
2871
|
tr.displayName = "ChannelList";
|
|
2843
2872
|
const nr = /^([a-z][a-z0-9+.-]*):/i, sr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2844
|
-
function
|
|
2873
|
+
function et(e) {
|
|
2845
2874
|
if (typeof e != "string") return;
|
|
2846
2875
|
const t = e.trim();
|
|
2847
2876
|
if (t === "") return;
|
|
@@ -2856,10 +2885,10 @@ const ar = {
|
|
|
2856
2885
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2857
2886
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2858
2887
|
}, rr = ({ variant: e, cta: t }) => {
|
|
2859
|
-
const s =
|
|
2888
|
+
const s = y(
|
|
2860
2889
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2861
2890
|
ar[e]
|
|
2862
|
-
), a =
|
|
2891
|
+
), a = et(t.href);
|
|
2863
2892
|
return a ? /* @__PURE__ */ n(
|
|
2864
2893
|
"a",
|
|
2865
2894
|
{
|
|
@@ -2891,22 +2920,22 @@ const ar = {
|
|
|
2891
2920
|
}, or = "text-white/30", lr = {
|
|
2892
2921
|
dark: "text-white/55",
|
|
2893
2922
|
light: "text-black/55"
|
|
2894
|
-
},
|
|
2923
|
+
}, tt = ({
|
|
2895
2924
|
variant: e,
|
|
2896
2925
|
title: t,
|
|
2897
2926
|
placeholderTitle: s,
|
|
2898
2927
|
description: a,
|
|
2899
2928
|
url: r,
|
|
2900
2929
|
appIcon: i,
|
|
2901
|
-
cta:
|
|
2902
|
-
trailingAction:
|
|
2930
|
+
cta: o,
|
|
2931
|
+
trailingAction: l
|
|
2903
2932
|
}) => {
|
|
2904
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "",
|
|
2905
|
-
if (!
|
|
2906
|
-
const v =
|
|
2933
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = o != null;
|
|
2934
|
+
if (!g && !u && !c && !b) return null;
|
|
2935
|
+
const v = y(
|
|
2907
2936
|
"truncate text-base font-medium leading-6",
|
|
2908
2937
|
d && !t ? or : ir[e]
|
|
2909
|
-
),
|
|
2938
|
+
), x = y(
|
|
2910
2939
|
"truncate text-xs leading-4",
|
|
2911
2940
|
lr[e]
|
|
2912
2941
|
);
|
|
@@ -2914,44 +2943,44 @@ const ar = {
|
|
|
2914
2943
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
2915
2944
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2916
2945
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2917
|
-
|
|
2946
|
+
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2918
2947
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2919
|
-
/* @__PURE__ */ n("p", { className:
|
|
2948
|
+
/* @__PURE__ */ n("p", { className: y("min-w-0", v), children: m })
|
|
2920
2949
|
] }),
|
|
2921
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2950
|
+
u && /* @__PURE__ */ n("p", { className: x, children: a })
|
|
2922
2951
|
] }),
|
|
2923
|
-
!b && c && /* @__PURE__ */ n("p", { className:
|
|
2952
|
+
!b && c && /* @__PURE__ */ n("p", { className: x, children: f })
|
|
2924
2953
|
] }),
|
|
2925
|
-
|
|
2954
|
+
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2926
2955
|
] }),
|
|
2927
|
-
|
|
2956
|
+
o && /* @__PURE__ */ n(rr, { variant: e, cta: o })
|
|
2928
2957
|
] });
|
|
2929
|
-
}, cr =
|
|
2958
|
+
}, cr = y(
|
|
2930
2959
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2931
2960
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2932
2961
|
// the messaging design system's "small border around link attachments"
|
|
2933
2962
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2934
2963
|
"border border-black/[0.08]",
|
|
2935
2964
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2936
|
-
),
|
|
2965
|
+
), Ee = ({
|
|
2937
2966
|
variant: e,
|
|
2938
2967
|
children: t,
|
|
2939
2968
|
href: s,
|
|
2940
2969
|
onClick: a,
|
|
2941
2970
|
ariaLabel: r,
|
|
2942
2971
|
rootRef: i,
|
|
2943
|
-
topRight:
|
|
2944
|
-
bgClassName:
|
|
2972
|
+
topRight: o,
|
|
2973
|
+
bgClassName: l,
|
|
2945
2974
|
"data-testid": d
|
|
2946
2975
|
}) => {
|
|
2947
|
-
const m = s != null || a != null,
|
|
2976
|
+
const m = s != null || a != null, g = y(
|
|
2948
2977
|
cr,
|
|
2949
|
-
|
|
2978
|
+
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2950
2979
|
// `focus-ring` is a design-system utility from the component-library
|
|
2951
2980
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
2952
2981
|
// with offset, so keyboard users can see the focused card.
|
|
2953
2982
|
m ? "cursor-pointer no-underline focus-ring" : null
|
|
2954
|
-
), u =
|
|
2983
|
+
), u = o ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: o }) : null;
|
|
2955
2984
|
return s ? /* @__PURE__ */ h(
|
|
2956
2985
|
"a",
|
|
2957
2986
|
{
|
|
@@ -2961,7 +2990,7 @@ const ar = {
|
|
|
2961
2990
|
rel: "noopener noreferrer",
|
|
2962
2991
|
onClick: a,
|
|
2963
2992
|
"data-testid": d,
|
|
2964
|
-
className:
|
|
2993
|
+
className: g,
|
|
2965
2994
|
children: [
|
|
2966
2995
|
t,
|
|
2967
2996
|
u
|
|
@@ -2975,7 +3004,7 @@ const ar = {
|
|
|
2975
3004
|
onClick: a,
|
|
2976
3005
|
"aria-label": r,
|
|
2977
3006
|
"data-testid": d,
|
|
2978
|
-
className:
|
|
3007
|
+
className: y(g, "text-left"),
|
|
2979
3008
|
children: [
|
|
2980
3009
|
t,
|
|
2981
3010
|
u
|
|
@@ -2986,7 +3015,7 @@ const ar = {
|
|
|
2986
3015
|
{
|
|
2987
3016
|
ref: i,
|
|
2988
3017
|
"data-testid": d,
|
|
2989
|
-
className:
|
|
3018
|
+
className: g,
|
|
2990
3019
|
children: [
|
|
2991
3020
|
t,
|
|
2992
3021
|
u
|
|
@@ -2999,21 +3028,21 @@ const ar = {
|
|
|
2999
3028
|
}, ur = {
|
|
3000
3029
|
dark: "size-16 text-white/25",
|
|
3001
3030
|
light: "size-16 text-black/25"
|
|
3002
|
-
},
|
|
3031
|
+
}, Te = (e, t) => !!t && !!e && se(e) === "audio", hn = (e, t) => {
|
|
3003
3032
|
if (!t || !e) return !1;
|
|
3004
|
-
const s =
|
|
3033
|
+
const s = se(e);
|
|
3005
3034
|
return s === "video" || s === "audio";
|
|
3006
|
-
},
|
|
3035
|
+
}, nt = "bg-[#F2F3F4]", Ie = ({
|
|
3007
3036
|
variant: e,
|
|
3008
3037
|
thumbnailUrl: t,
|
|
3009
3038
|
sourceUrl: s,
|
|
3010
3039
|
title: a,
|
|
3011
3040
|
mimeType: r = "image/*",
|
|
3012
3041
|
topLeft: i,
|
|
3013
|
-
topRight:
|
|
3042
|
+
topRight: o
|
|
3014
3043
|
}) => {
|
|
3015
|
-
const
|
|
3016
|
-
return
|
|
3044
|
+
const l = se(r), d = !!s && l === "video";
|
|
3045
|
+
return Te(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3017
3046
|
"audio",
|
|
3018
3047
|
{
|
|
3019
3048
|
src: s,
|
|
@@ -3025,7 +3054,7 @@ const ar = {
|
|
|
3025
3054
|
) }) : /* @__PURE__ */ h(
|
|
3026
3055
|
"div",
|
|
3027
3056
|
{
|
|
3028
|
-
className:
|
|
3057
|
+
className: y(
|
|
3029
3058
|
"relative h-[180px] w-full overflow-hidden",
|
|
3030
3059
|
d && "bg-black"
|
|
3031
3060
|
),
|
|
@@ -3052,18 +3081,18 @@ const ar = {
|
|
|
3052
3081
|
) : /* @__PURE__ */ n(
|
|
3053
3082
|
"div",
|
|
3054
3083
|
{
|
|
3055
|
-
className:
|
|
3084
|
+
className: y(
|
|
3056
3085
|
"flex h-full w-full items-center justify-center",
|
|
3057
3086
|
dr[e]
|
|
3058
3087
|
),
|
|
3059
|
-
children:
|
|
3088
|
+
children: ce(r, {
|
|
3060
3089
|
className: ur[e],
|
|
3061
3090
|
weight: "regular"
|
|
3062
3091
|
})
|
|
3063
3092
|
}
|
|
3064
3093
|
),
|
|
3065
3094
|
i ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute left-3 top-3 z-10", children: i }) : null,
|
|
3066
|
-
|
|
3095
|
+
o ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: o }) : null
|
|
3067
3096
|
]
|
|
3068
3097
|
}
|
|
3069
3098
|
);
|
|
@@ -3074,23 +3103,23 @@ const ar = {
|
|
|
3074
3103
|
url: a,
|
|
3075
3104
|
mimeType: r,
|
|
3076
3105
|
thumbnailUrl: i,
|
|
3077
|
-
sourceUrl:
|
|
3078
|
-
layout:
|
|
3106
|
+
sourceUrl: o,
|
|
3107
|
+
layout: l = "featured",
|
|
3079
3108
|
appIcon: d,
|
|
3080
3109
|
cta: m,
|
|
3081
|
-
onDismiss:
|
|
3110
|
+
onDismiss: g,
|
|
3082
3111
|
onEditClick: u
|
|
3083
3112
|
}) => {
|
|
3084
|
-
const
|
|
3113
|
+
const f = l === "classic", c = Te(r, o), b = g ? /* @__PURE__ */ n(
|
|
3085
3114
|
"button",
|
|
3086
3115
|
{
|
|
3087
3116
|
type: "button",
|
|
3088
|
-
onClick:
|
|
3117
|
+
onClick: g,
|
|
3089
3118
|
"aria-label": "Dismiss attachment",
|
|
3090
3119
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3091
|
-
children: /* @__PURE__ */ n(
|
|
3120
|
+
children: /* @__PURE__ */ n(pe, { className: "size-3", weight: "bold" })
|
|
3092
3121
|
}
|
|
3093
|
-
) : void 0,
|
|
3122
|
+
) : void 0, N = u ? /* @__PURE__ */ n(
|
|
3094
3123
|
"button",
|
|
3095
3124
|
{
|
|
3096
3125
|
type: "button",
|
|
@@ -3100,36 +3129,36 @@ const ar = {
|
|
|
3100
3129
|
children: /* @__PURE__ */ n(Ss, { className: "size-5", weight: "regular" })
|
|
3101
3130
|
}
|
|
3102
3131
|
) : void 0;
|
|
3103
|
-
return c ? /* @__PURE__ */ n(
|
|
3132
|
+
return c ? /* @__PURE__ */ n(Ee, { variant: "dark", bgClassName: nt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3104
3133
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3105
|
-
|
|
3134
|
+
Ie,
|
|
3106
3135
|
{
|
|
3107
3136
|
variant: "dark",
|
|
3108
|
-
sourceUrl:
|
|
3137
|
+
sourceUrl: o,
|
|
3109
3138
|
title: e,
|
|
3110
3139
|
mimeType: r
|
|
3111
3140
|
}
|
|
3112
3141
|
) }),
|
|
3113
3142
|
b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
|
|
3114
3143
|
] }) }) : /* @__PURE__ */ h(
|
|
3115
|
-
|
|
3144
|
+
Ee,
|
|
3116
3145
|
{
|
|
3117
3146
|
variant: "dark",
|
|
3118
|
-
topRight:
|
|
3147
|
+
topRight: f ? b : void 0,
|
|
3119
3148
|
children: [
|
|
3120
|
-
!
|
|
3121
|
-
|
|
3149
|
+
!f && /* @__PURE__ */ n(
|
|
3150
|
+
Ie,
|
|
3122
3151
|
{
|
|
3123
3152
|
variant: "dark",
|
|
3124
3153
|
thumbnailUrl: i,
|
|
3125
|
-
sourceUrl:
|
|
3154
|
+
sourceUrl: o,
|
|
3126
3155
|
title: e,
|
|
3127
3156
|
mimeType: r,
|
|
3128
3157
|
topRight: b
|
|
3129
3158
|
}
|
|
3130
3159
|
),
|
|
3131
3160
|
/* @__PURE__ */ n(
|
|
3132
|
-
|
|
3161
|
+
tt,
|
|
3133
3162
|
{
|
|
3134
3163
|
variant: "dark",
|
|
3135
3164
|
title: e,
|
|
@@ -3138,7 +3167,7 @@ const ar = {
|
|
|
3138
3167
|
url: a,
|
|
3139
3168
|
appIcon: d,
|
|
3140
3169
|
cta: m,
|
|
3141
|
-
trailingAction:
|
|
3170
|
+
trailingAction: N
|
|
3142
3171
|
}
|
|
3143
3172
|
)
|
|
3144
3173
|
]
|
|
@@ -3151,12 +3180,12 @@ const ar = {
|
|
|
3151
3180
|
mimeType: a,
|
|
3152
3181
|
thumbnailUrl: r,
|
|
3153
3182
|
sourceUrl: i,
|
|
3154
|
-
layout:
|
|
3155
|
-
appIcon:
|
|
3183
|
+
layout: o = "featured",
|
|
3184
|
+
appIcon: l,
|
|
3156
3185
|
cta: d,
|
|
3157
3186
|
onClick: m
|
|
3158
3187
|
}) => {
|
|
3159
|
-
const
|
|
3188
|
+
const g = hn(a, i), u = et(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Te(a, i) ? nt : void 0, N = d && m ? {
|
|
3160
3189
|
...d,
|
|
3161
3190
|
onClick: () => {
|
|
3162
3191
|
var v;
|
|
@@ -3164,17 +3193,17 @@ const ar = {
|
|
|
3164
3193
|
}
|
|
3165
3194
|
} : d;
|
|
3166
3195
|
return /* @__PURE__ */ h(
|
|
3167
|
-
|
|
3196
|
+
Ee,
|
|
3168
3197
|
{
|
|
3169
3198
|
variant: "light",
|
|
3170
|
-
href:
|
|
3199
|
+
href: f,
|
|
3171
3200
|
onClick: c,
|
|
3172
3201
|
ariaLabel: e ?? "Open attachment preview",
|
|
3173
3202
|
bgClassName: b,
|
|
3174
3203
|
"data-testid": "link-attachment",
|
|
3175
3204
|
children: [
|
|
3176
|
-
|
|
3177
|
-
|
|
3205
|
+
o === "featured" && /* @__PURE__ */ n(
|
|
3206
|
+
Ie,
|
|
3178
3207
|
{
|
|
3179
3208
|
variant: "light",
|
|
3180
3209
|
thumbnailUrl: r,
|
|
@@ -3184,14 +3213,14 @@ const ar = {
|
|
|
3184
3213
|
}
|
|
3185
3214
|
),
|
|
3186
3215
|
/* @__PURE__ */ n(
|
|
3187
|
-
|
|
3216
|
+
tt,
|
|
3188
3217
|
{
|
|
3189
3218
|
variant: "light",
|
|
3190
3219
|
title: e,
|
|
3191
3220
|
description: t,
|
|
3192
3221
|
url: s,
|
|
3193
|
-
appIcon:
|
|
3194
|
-
cta:
|
|
3222
|
+
appIcon: l,
|
|
3223
|
+
cta: N
|
|
3195
3224
|
}
|
|
3196
3225
|
)
|
|
3197
3226
|
]
|
|
@@ -3204,33 +3233,33 @@ const ar = {
|
|
|
3204
3233
|
url: a,
|
|
3205
3234
|
mimeType: r,
|
|
3206
3235
|
thumbnailUrl: i,
|
|
3207
|
-
sourceUrl:
|
|
3208
|
-
layout:
|
|
3236
|
+
sourceUrl: o,
|
|
3237
|
+
layout: l = "featured",
|
|
3209
3238
|
appIcon: d,
|
|
3210
3239
|
cta: m,
|
|
3211
|
-
onClick:
|
|
3240
|
+
onClick: g
|
|
3212
3241
|
}) => {
|
|
3213
|
-
const u = hn(r,
|
|
3242
|
+
const u = hn(r, o), f = et(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
|
|
3214
3243
|
return /* @__PURE__ */ h(
|
|
3215
|
-
|
|
3244
|
+
Ee,
|
|
3216
3245
|
{
|
|
3217
3246
|
variant: "dark",
|
|
3218
3247
|
href: c,
|
|
3219
3248
|
onClick: b,
|
|
3220
|
-
bgClassName:
|
|
3249
|
+
bgClassName: Te(r, o) ? nt : void 0,
|
|
3221
3250
|
children: [
|
|
3222
|
-
|
|
3223
|
-
|
|
3251
|
+
l === "featured" && /* @__PURE__ */ n(
|
|
3252
|
+
Ie,
|
|
3224
3253
|
{
|
|
3225
3254
|
variant: "dark",
|
|
3226
3255
|
thumbnailUrl: i,
|
|
3227
|
-
sourceUrl:
|
|
3256
|
+
sourceUrl: o,
|
|
3228
3257
|
title: e,
|
|
3229
3258
|
mimeType: r
|
|
3230
3259
|
}
|
|
3231
3260
|
),
|
|
3232
3261
|
/* @__PURE__ */ n(
|
|
3233
|
-
|
|
3262
|
+
tt,
|
|
3234
3263
|
{
|
|
3235
3264
|
variant: "dark",
|
|
3236
3265
|
title: e,
|
|
@@ -3270,22 +3299,22 @@ const ar = {
|
|
|
3270
3299
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3271
3300
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3272
3301
|
}
|
|
3273
|
-
},
|
|
3302
|
+
}, ve = ({
|
|
3274
3303
|
variant: e,
|
|
3275
3304
|
text: t,
|
|
3276
3305
|
bordered: s = !0,
|
|
3277
3306
|
groupPosition: a = "single",
|
|
3278
3307
|
className: r,
|
|
3279
3308
|
children: i,
|
|
3280
|
-
"data-testid":
|
|
3309
|
+
"data-testid": o
|
|
3281
3310
|
}) => {
|
|
3282
|
-
const
|
|
3311
|
+
const l = t != null && t !== "", d = xr[vr(e)][a];
|
|
3283
3312
|
return /* @__PURE__ */ h(
|
|
3284
3313
|
"div",
|
|
3285
3314
|
{
|
|
3286
|
-
"data-testid":
|
|
3315
|
+
"data-testid": o,
|
|
3287
3316
|
"data-group-position": a,
|
|
3288
|
-
className:
|
|
3317
|
+
className: y(
|
|
3289
3318
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3290
3319
|
// and keeps the document / image / audio bubbles visually
|
|
3291
3320
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3302,10 +3331,10 @@ const ar = {
|
|
|
3302
3331
|
),
|
|
3303
3332
|
children: [
|
|
3304
3333
|
i,
|
|
3305
|
-
|
|
3334
|
+
l ? /* @__PURE__ */ n(
|
|
3306
3335
|
"p",
|
|
3307
3336
|
{
|
|
3308
|
-
className:
|
|
3337
|
+
className: y(
|
|
3309
3338
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3310
3339
|
// the same font family + size as `.str-chat__message-text`
|
|
3311
3340
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3322,7 +3351,7 @@ const ar = {
|
|
|
3322
3351
|
]
|
|
3323
3352
|
}
|
|
3324
3353
|
);
|
|
3325
|
-
},
|
|
3354
|
+
}, xe = ({
|
|
3326
3355
|
onClick: e,
|
|
3327
3356
|
variant: t = "overlay",
|
|
3328
3357
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3334,13 +3363,13 @@ const ar = {
|
|
|
3334
3363
|
a.stopPropagation(), e();
|
|
3335
3364
|
},
|
|
3336
3365
|
"aria-label": s,
|
|
3337
|
-
className:
|
|
3366
|
+
className: y(
|
|
3338
3367
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3339
3368
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3340
3369
|
),
|
|
3341
|
-
children: /* @__PURE__ */ n(
|
|
3370
|
+
children: /* @__PURE__ */ n(pe, { className: "size-3", weight: "bold" })
|
|
3342
3371
|
}
|
|
3343
|
-
),
|
|
3372
|
+
), we = (e) => e === "received" ? "light" : "dark", yi = ({
|
|
3344
3373
|
firstOfGroup: e,
|
|
3345
3374
|
endOfGroup: t,
|
|
3346
3375
|
groupedByUser: s
|
|
@@ -3361,44 +3390,44 @@ const ar = {
|
|
|
3361
3390
|
}
|
|
3362
3391
|
),
|
|
3363
3392
|
s ?? null
|
|
3364
|
-
] }),
|
|
3393
|
+
] }), st = ({
|
|
3365
3394
|
state: e,
|
|
3366
3395
|
src: t,
|
|
3367
3396
|
mimeType: s,
|
|
3368
3397
|
filename: a,
|
|
3369
3398
|
items: r,
|
|
3370
3399
|
text: i,
|
|
3371
|
-
groupPosition:
|
|
3372
|
-
preload:
|
|
3400
|
+
groupPosition: o,
|
|
3401
|
+
preload: l,
|
|
3373
3402
|
onDismiss: d
|
|
3374
3403
|
}) => {
|
|
3375
|
-
const m =
|
|
3404
|
+
const m = we(e), g = e === "composer" && !!d, u = wr({ src: t, mimeType: s, filename: a, items: r });
|
|
3376
3405
|
if (u.length === 0)
|
|
3377
3406
|
return null;
|
|
3378
|
-
const
|
|
3407
|
+
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
3379
3408
|
return /* @__PURE__ */ n(
|
|
3380
|
-
|
|
3409
|
+
ve,
|
|
3381
3410
|
{
|
|
3382
3411
|
variant: m,
|
|
3383
3412
|
text: i,
|
|
3384
|
-
groupPosition:
|
|
3413
|
+
groupPosition: o,
|
|
3385
3414
|
"data-testid": "audio-attachment",
|
|
3386
3415
|
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
|
|
3387
3416
|
Nr,
|
|
3388
3417
|
{
|
|
3389
3418
|
item: c,
|
|
3390
|
-
preload:
|
|
3419
|
+
preload: f,
|
|
3391
3420
|
trailingAction: (
|
|
3392
3421
|
// Composer only supports a single attachment, so the
|
|
3393
3422
|
// dismiss control sits on the only player.
|
|
3394
|
-
|
|
3423
|
+
g && b === 0 ? /* @__PURE__ */ n(xe, { onClick: d, variant: "inline" }) : void 0
|
|
3395
3424
|
)
|
|
3396
3425
|
},
|
|
3397
3426
|
`${c.src}-${b}`
|
|
3398
3427
|
)) })
|
|
3399
3428
|
}
|
|
3400
3429
|
);
|
|
3401
|
-
}, _r = (e) => /* @__PURE__ */ n(
|
|
3430
|
+
}, _r = (e) => /* @__PURE__ */ n(st, { ...e, state: "composer" }), yr = (e) => /* @__PURE__ */ n(st, { ...e, state: "sent" }), Cr = (e) => /* @__PURE__ */ n(st, { ...e, state: "received" }), kr = {
|
|
3402
3431
|
Composer: _r,
|
|
3403
3432
|
Sent: yr,
|
|
3404
3433
|
Received: Cr
|
|
@@ -3425,7 +3454,7 @@ function Sr(e, t) {
|
|
|
3425
3454
|
}
|
|
3426
3455
|
}
|
|
3427
3456
|
if (!e) return;
|
|
3428
|
-
if (
|
|
3457
|
+
if (se(e) === "document") {
|
|
3429
3458
|
const r = Qt(e), i = Ir[r];
|
|
3430
3459
|
if (i) return i;
|
|
3431
3460
|
if (e === "application/octet-stream") return;
|
|
@@ -3438,7 +3467,7 @@ function Tr(e, t, s) {
|
|
|
3438
3467
|
const a = Sr(e, t), r = typeof s == "number" && s > 0 ? Er(s) : void 0;
|
|
3439
3468
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3440
3469
|
}
|
|
3441
|
-
function
|
|
3470
|
+
function Q(e) {
|
|
3442
3471
|
try {
|
|
3443
3472
|
const s = new URL(e).pathname.split("/").pop();
|
|
3444
3473
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -3462,19 +3491,19 @@ const Ar = {
|
|
|
3462
3491
|
mimeType: a = "application/octet-stream",
|
|
3463
3492
|
fileSize: r,
|
|
3464
3493
|
onActivate: i,
|
|
3465
|
-
activateLabel:
|
|
3466
|
-
trailingAction:
|
|
3494
|
+
activateLabel: o,
|
|
3495
|
+
trailingAction: l
|
|
3467
3496
|
}) => {
|
|
3468
|
-
const d = s ?? t ?? "File", m = Tr(a, t, r),
|
|
3497
|
+
const d = s ?? t ?? "File", m = Tr(a, t, r), g = /* @__PURE__ */ n(
|
|
3469
3498
|
"div",
|
|
3470
3499
|
{
|
|
3471
|
-
className:
|
|
3500
|
+
className: y(
|
|
3472
3501
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3473
3502
|
Mr[e]
|
|
3474
3503
|
),
|
|
3475
3504
|
"aria-hidden": !0,
|
|
3476
|
-
children:
|
|
3477
|
-
className:
|
|
3505
|
+
children: ce(a, {
|
|
3506
|
+
className: y("size-6", Dr[e]),
|
|
3478
3507
|
weight: "regular"
|
|
3479
3508
|
})
|
|
3480
3509
|
}
|
|
@@ -3483,44 +3512,44 @@ const Ar = {
|
|
|
3483
3512
|
m ? /* @__PURE__ */ n(
|
|
3484
3513
|
"p",
|
|
3485
3514
|
{
|
|
3486
|
-
className:
|
|
3515
|
+
className: y(
|
|
3487
3516
|
"truncate text-xs leading-4",
|
|
3488
3517
|
Ar[e]
|
|
3489
3518
|
),
|
|
3490
3519
|
children: m
|
|
3491
3520
|
}
|
|
3492
3521
|
) : null
|
|
3493
|
-
] }),
|
|
3522
|
+
] }), f = i ? /* @__PURE__ */ h(
|
|
3494
3523
|
"button",
|
|
3495
3524
|
{
|
|
3496
3525
|
type: "button",
|
|
3497
3526
|
onClick: i,
|
|
3498
|
-
"aria-label":
|
|
3499
|
-
className:
|
|
3527
|
+
"aria-label": o,
|
|
3528
|
+
className: y(
|
|
3500
3529
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3501
3530
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3502
3531
|
),
|
|
3503
3532
|
children: [
|
|
3504
|
-
|
|
3533
|
+
g,
|
|
3505
3534
|
u
|
|
3506
3535
|
]
|
|
3507
3536
|
}
|
|
3508
|
-
) : /* @__PURE__ */ h(
|
|
3509
|
-
|
|
3537
|
+
) : /* @__PURE__ */ h(re, { children: [
|
|
3538
|
+
g,
|
|
3510
3539
|
u
|
|
3511
3540
|
] });
|
|
3512
3541
|
return /* @__PURE__ */ h("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
3513
|
-
|
|
3514
|
-
|
|
3542
|
+
f,
|
|
3543
|
+
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
3515
3544
|
] });
|
|
3516
3545
|
};
|
|
3517
3546
|
async function gn(e, t) {
|
|
3518
|
-
const s = t ??
|
|
3547
|
+
const s = t ?? Q(e);
|
|
3519
3548
|
try {
|
|
3520
3549
|
const a = await fetch(e, { mode: "cors" });
|
|
3521
3550
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
3522
|
-
const r = await a.blob(), i = URL.createObjectURL(r),
|
|
3523
|
-
|
|
3551
|
+
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
3552
|
+
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
3524
3553
|
} catch {
|
|
3525
3554
|
if (!window.open(e, "_blank", "noopener,noreferrer")) {
|
|
3526
3555
|
const r = document.createElement("a");
|
|
@@ -3542,7 +3571,7 @@ const Rr = ({
|
|
|
3542
3571
|
onActivate: a,
|
|
3543
3572
|
trailingAction: r
|
|
3544
3573
|
}) => {
|
|
3545
|
-
const i = t.filename ??
|
|
3574
|
+
const i = t.filename ?? Q(t.src);
|
|
3546
3575
|
return /* @__PURE__ */ n(
|
|
3547
3576
|
fn,
|
|
3548
3577
|
{
|
|
@@ -3556,76 +3585,76 @@ const Rr = ({
|
|
|
3556
3585
|
trailingAction: r
|
|
3557
3586
|
}
|
|
3558
3587
|
);
|
|
3559
|
-
},
|
|
3588
|
+
}, at = ({
|
|
3560
3589
|
state: e,
|
|
3561
3590
|
src: t,
|
|
3562
3591
|
filename: s,
|
|
3563
3592
|
fileSize: a,
|
|
3564
3593
|
mimeType: r,
|
|
3565
3594
|
title: i,
|
|
3566
|
-
items:
|
|
3567
|
-
text:
|
|
3595
|
+
items: o,
|
|
3596
|
+
text: l,
|
|
3568
3597
|
groupPosition: d,
|
|
3569
3598
|
onClick: m,
|
|
3570
|
-
onDismiss:
|
|
3599
|
+
onDismiss: g
|
|
3571
3600
|
}) => {
|
|
3572
|
-
const u =
|
|
3601
|
+
const u = we(e), f = e === "composer" && !!g, c = Rr({
|
|
3573
3602
|
src: t,
|
|
3574
3603
|
filename: s,
|
|
3575
3604
|
fileSize: a,
|
|
3576
3605
|
mimeType: r,
|
|
3577
3606
|
title: i,
|
|
3578
|
-
items:
|
|
3607
|
+
items: o
|
|
3579
3608
|
}), b = (v) => {
|
|
3580
3609
|
if ((m == null ? void 0 : m(v)) === !1) return;
|
|
3581
|
-
const
|
|
3582
|
-
if (!
|
|
3583
|
-
const
|
|
3584
|
-
gn(
|
|
3610
|
+
const x = c[v];
|
|
3611
|
+
if (!x) return;
|
|
3612
|
+
const w = x.filename ?? Q(x.src);
|
|
3613
|
+
gn(x.src, w);
|
|
3585
3614
|
};
|
|
3586
3615
|
if (c.length === 0)
|
|
3587
3616
|
return null;
|
|
3588
|
-
const
|
|
3617
|
+
const N = /* @__PURE__ */ n(
|
|
3589
3618
|
"span",
|
|
3590
3619
|
{
|
|
3591
|
-
className:
|
|
3620
|
+
className: y(
|
|
3592
3621
|
"flex size-8 items-center justify-center rounded-full",
|
|
3593
3622
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3594
3623
|
),
|
|
3595
3624
|
"aria-hidden": !0,
|
|
3596
|
-
children: /* @__PURE__ */ n(
|
|
3625
|
+
children: /* @__PURE__ */ n(ge, { className: "size-5", weight: "bold" })
|
|
3597
3626
|
}
|
|
3598
3627
|
);
|
|
3599
3628
|
return /* @__PURE__ */ n(
|
|
3600
|
-
|
|
3629
|
+
ve,
|
|
3601
3630
|
{
|
|
3602
3631
|
variant: u,
|
|
3603
|
-
text:
|
|
3632
|
+
text: l,
|
|
3604
3633
|
groupPosition: d,
|
|
3605
3634
|
"data-testid": "file-attachment",
|
|
3606
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v,
|
|
3635
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, x) => /* @__PURE__ */ n(
|
|
3607
3636
|
Lr,
|
|
3608
3637
|
{
|
|
3609
3638
|
variant: u,
|
|
3610
3639
|
item: v,
|
|
3611
|
-
index:
|
|
3640
|
+
index: x,
|
|
3612
3641
|
onActivate: b,
|
|
3613
|
-
trailingAction:
|
|
3642
|
+
trailingAction: f && x === 0 ? /* @__PURE__ */ n(xe, { onClick: g, variant: "inline" }) : N
|
|
3614
3643
|
},
|
|
3615
|
-
`${v.src}-${
|
|
3644
|
+
`${v.src}-${x}`
|
|
3616
3645
|
)) })
|
|
3617
3646
|
}
|
|
3618
3647
|
);
|
|
3619
|
-
}, Pr = (e) => /* @__PURE__ */ n(
|
|
3648
|
+
}, Pr = (e) => /* @__PURE__ */ n(at, { ...e, state: "composer" }), zr = (e) => /* @__PURE__ */ n(at, { ...e, state: "sent" }), Or = (e) => /* @__PURE__ */ n(at, { ...e, state: "received" }), Fr = {
|
|
3620
3649
|
Composer: Pr,
|
|
3621
3650
|
Sent: zr,
|
|
3622
3651
|
Received: Or
|
|
3623
|
-
},
|
|
3652
|
+
}, rt = ({
|
|
3624
3653
|
onPrev: e,
|
|
3625
3654
|
onNext: t,
|
|
3626
3655
|
prevLabel: s = "Previous",
|
|
3627
3656
|
nextLabel: a = "Next"
|
|
3628
|
-
}) => /* @__PURE__ */ h(
|
|
3657
|
+
}) => /* @__PURE__ */ h(re, { children: [
|
|
3629
3658
|
/* @__PURE__ */ n(
|
|
3630
3659
|
"button",
|
|
3631
3660
|
{
|
|
@@ -3643,7 +3672,7 @@ const Rr = ({
|
|
|
3643
3672
|
onClick: t,
|
|
3644
3673
|
"aria-label": a,
|
|
3645
3674
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3646
|
-
children: /* @__PURE__ */ n(
|
|
3675
|
+
children: /* @__PURE__ */ n(je, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3647
3676
|
}
|
|
3648
3677
|
)
|
|
3649
3678
|
] }), bn = ({
|
|
@@ -3653,17 +3682,17 @@ const Rr = ({
|
|
|
3653
3682
|
label: a = "Download",
|
|
3654
3683
|
iconOnly: r,
|
|
3655
3684
|
tone: i = "dark",
|
|
3656
|
-
onTriggered:
|
|
3685
|
+
onTriggered: o
|
|
3657
3686
|
}) => {
|
|
3658
|
-
const [
|
|
3687
|
+
const [l, d] = z(!1), m = H(
|
|
3659
3688
|
(c) => {
|
|
3660
|
-
c.stopPropagation(), !
|
|
3689
|
+
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3661
3690
|
}).finally(() => {
|
|
3662
|
-
d(!1),
|
|
3691
|
+
d(!1), o == null || o();
|
|
3663
3692
|
}));
|
|
3664
3693
|
},
|
|
3665
|
-
[
|
|
3666
|
-
),
|
|
3694
|
+
[l, e, t, o]
|
|
3695
|
+
), g = r ?? s !== "pill", f = { className: y(
|
|
3667
3696
|
s === "pill" ? "size-4" : "size-5",
|
|
3668
3697
|
"shrink-0"
|
|
3669
3698
|
), weight: "bold" };
|
|
@@ -3672,24 +3701,24 @@ const Rr = ({
|
|
|
3672
3701
|
{
|
|
3673
3702
|
type: "button",
|
|
3674
3703
|
onClick: m,
|
|
3675
|
-
disabled:
|
|
3704
|
+
disabled: l,
|
|
3676
3705
|
"aria-label": a,
|
|
3677
|
-
className:
|
|
3706
|
+
className: y(
|
|
3678
3707
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3679
3708
|
{
|
|
3680
3709
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
3681
3710
|
light: "text-black/70 hover:bg-black/[0.08] hover:text-black"
|
|
3682
3711
|
}[i]
|
|
3683
3712
|
),
|
|
3684
|
-
children:
|
|
3685
|
-
|
|
3713
|
+
children: l ? /* @__PURE__ */ n(
|
|
3714
|
+
fe,
|
|
3686
3715
|
{
|
|
3687
3716
|
className: "size-4 animate-spin",
|
|
3688
3717
|
weight: "bold",
|
|
3689
3718
|
"aria-hidden": !0
|
|
3690
3719
|
}
|
|
3691
3720
|
) : /* @__PURE__ */ n(
|
|
3692
|
-
|
|
3721
|
+
ge,
|
|
3693
3722
|
{
|
|
3694
3723
|
className: "size-5 shrink-0",
|
|
3695
3724
|
weight: "bold",
|
|
@@ -3702,73 +3731,73 @@ const Rr = ({
|
|
|
3702
3731
|
{
|
|
3703
3732
|
type: "button",
|
|
3704
3733
|
onClick: m,
|
|
3705
|
-
disabled:
|
|
3734
|
+
disabled: l,
|
|
3706
3735
|
"aria-label": a,
|
|
3707
3736
|
className: "mes-media-viewer__action",
|
|
3708
|
-
children:
|
|
3737
|
+
children: l ? /* @__PURE__ */ n(fe, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(ge, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3709
3738
|
}
|
|
3710
3739
|
) : /* @__PURE__ */ h(
|
|
3711
3740
|
"button",
|
|
3712
3741
|
{
|
|
3713
3742
|
type: "button",
|
|
3714
3743
|
onClick: m,
|
|
3715
|
-
disabled:
|
|
3716
|
-
"aria-label":
|
|
3717
|
-
className:
|
|
3744
|
+
disabled: l,
|
|
3745
|
+
"aria-label": g ? a : void 0,
|
|
3746
|
+
className: y(
|
|
3718
3747
|
"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",
|
|
3719
3748
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3720
3749
|
),
|
|
3721
3750
|
children: [
|
|
3722
|
-
|
|
3723
|
-
|
|
3751
|
+
l ? /* @__PURE__ */ n(
|
|
3752
|
+
fe,
|
|
3724
3753
|
{
|
|
3725
3754
|
className: "size-4 animate-spin",
|
|
3726
3755
|
weight: "bold",
|
|
3727
3756
|
"aria-hidden": !0
|
|
3728
3757
|
}
|
|
3729
|
-
) : /* @__PURE__ */ n(
|
|
3730
|
-
|
|
3758
|
+
) : /* @__PURE__ */ n(ge, { ...f, "aria-hidden": !0 }),
|
|
3759
|
+
g ? null : a
|
|
3731
3760
|
]
|
|
3732
3761
|
}
|
|
3733
3762
|
);
|
|
3734
|
-
},
|
|
3763
|
+
}, Oe = (e, t, s) => Math.min(Math.max(e, t), s), it = ({
|
|
3735
3764
|
length: e,
|
|
3736
3765
|
initialIndex: t,
|
|
3737
3766
|
open: s
|
|
3738
3767
|
}) => {
|
|
3739
|
-
const a =
|
|
3740
|
-
|
|
3741
|
-
s && i(
|
|
3742
|
-
}, [s, t, e]),
|
|
3743
|
-
i((d) =>
|
|
3768
|
+
const a = Oe(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
|
|
3769
|
+
J(() => {
|
|
3770
|
+
s && i(Oe(t, 0, Math.max(e - 1, 0)));
|
|
3771
|
+
}, [s, t, e]), J(() => {
|
|
3772
|
+
i((d) => Oe(d, 0, Math.max(e - 1, 0)));
|
|
3744
3773
|
}, [e]);
|
|
3745
|
-
const
|
|
3774
|
+
const o = H(() => {
|
|
3746
3775
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3747
|
-
}, [e]),
|
|
3776
|
+
}, [e]), l = H(() => {
|
|
3748
3777
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3749
3778
|
}, [e]);
|
|
3750
|
-
return
|
|
3779
|
+
return J(() => {
|
|
3751
3780
|
if (!s || e <= 1) return;
|
|
3752
3781
|
const d = (m) => {
|
|
3753
3782
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
3754
|
-
const
|
|
3755
|
-
|
|
3783
|
+
const g = document.activeElement;
|
|
3784
|
+
g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
|
|
3756
3785
|
};
|
|
3757
3786
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3758
|
-
}, [s, e,
|
|
3759
|
-
},
|
|
3787
|
+
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
3788
|
+
}, ot = ({
|
|
3760
3789
|
open: e,
|
|
3761
3790
|
onClose: t,
|
|
3762
3791
|
ariaLabel: s,
|
|
3763
3792
|
counter: a,
|
|
3764
3793
|
actions: r,
|
|
3765
3794
|
children: i,
|
|
3766
|
-
"data-testid":
|
|
3795
|
+
"data-testid": o
|
|
3767
3796
|
}) => {
|
|
3768
|
-
const
|
|
3769
|
-
return
|
|
3770
|
-
var
|
|
3771
|
-
const u =
|
|
3797
|
+
const l = K(null), d = K(null);
|
|
3798
|
+
return J(() => {
|
|
3799
|
+
var f;
|
|
3800
|
+
const u = l.current;
|
|
3772
3801
|
if (u) {
|
|
3773
3802
|
if (e) {
|
|
3774
3803
|
if (!u.open)
|
|
@@ -3781,7 +3810,7 @@ const Rr = ({
|
|
|
3781
3810
|
else
|
|
3782
3811
|
u.setAttribute("open", "");
|
|
3783
3812
|
const c = typeof document < "u" ? document.activeElement : null;
|
|
3784
|
-
return (
|
|
3813
|
+
return (f = d.current) == null || f.focus(), () => {
|
|
3785
3814
|
if (u.open)
|
|
3786
3815
|
if (typeof u.close == "function")
|
|
3787
3816
|
try {
|
|
@@ -3814,15 +3843,15 @@ const Rr = ({
|
|
|
3814
3843
|
/* @__PURE__ */ h(
|
|
3815
3844
|
"dialog",
|
|
3816
3845
|
{
|
|
3817
|
-
ref:
|
|
3846
|
+
ref: l,
|
|
3818
3847
|
className: "mes-media-viewer",
|
|
3819
3848
|
"aria-label": s ?? "Attachment viewer",
|
|
3820
|
-
"data-testid":
|
|
3849
|
+
"data-testid": o,
|
|
3821
3850
|
onClose: () => {
|
|
3822
3851
|
t();
|
|
3823
3852
|
},
|
|
3824
3853
|
onClick: (u) => {
|
|
3825
|
-
u.target ===
|
|
3854
|
+
u.target === l.current && t();
|
|
3826
3855
|
},
|
|
3827
3856
|
children: [
|
|
3828
3857
|
/* @__PURE__ */ h("div", { className: "mes-media-viewer__chrome", children: [
|
|
@@ -3837,7 +3866,7 @@ const Rr = ({
|
|
|
3837
3866
|
onClick: t,
|
|
3838
3867
|
"aria-label": "Close viewer",
|
|
3839
3868
|
className: "mes-media-viewer__action",
|
|
3840
|
-
children: /* @__PURE__ */ n(
|
|
3869
|
+
children: /* @__PURE__ */ n(pe, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3841
3870
|
}
|
|
3842
3871
|
)
|
|
3843
3872
|
] })
|
|
@@ -3852,16 +3881,16 @@ const Rr = ({
|
|
|
3852
3881
|
initialIndex: s = 0,
|
|
3853
3882
|
onClose: a
|
|
3854
3883
|
}) => {
|
|
3855
|
-
const { index: r, prev: i, next:
|
|
3884
|
+
const { index: r, prev: i, next: o } = it({
|
|
3856
3885
|
length: t.length,
|
|
3857
3886
|
initialIndex: s,
|
|
3858
3887
|
open: e
|
|
3859
|
-
}),
|
|
3860
|
-
() => (
|
|
3861
|
-
[
|
|
3888
|
+
}), l = t[r], d = te(
|
|
3889
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "image"),
|
|
3890
|
+
[l]
|
|
3862
3891
|
);
|
|
3863
|
-
return
|
|
3864
|
-
|
|
3892
|
+
return l ? /* @__PURE__ */ h(
|
|
3893
|
+
ot,
|
|
3865
3894
|
{
|
|
3866
3895
|
open: e,
|
|
3867
3896
|
onClose: a,
|
|
@@ -3870,7 +3899,7 @@ const Rr = ({
|
|
|
3870
3899
|
actions: /* @__PURE__ */ n(
|
|
3871
3900
|
bn,
|
|
3872
3901
|
{
|
|
3873
|
-
url:
|
|
3902
|
+
url: l.src,
|
|
3874
3903
|
filename: d,
|
|
3875
3904
|
variant: "viewer",
|
|
3876
3905
|
label: `Download ${d}`
|
|
@@ -3881,20 +3910,20 @@ const Rr = ({
|
|
|
3881
3910
|
/* @__PURE__ */ n(
|
|
3882
3911
|
"img",
|
|
3883
3912
|
{
|
|
3884
|
-
src:
|
|
3885
|
-
alt:
|
|
3913
|
+
src: l.src,
|
|
3914
|
+
alt: l.alt ?? d,
|
|
3886
3915
|
draggable: !1,
|
|
3887
3916
|
loading: "eager",
|
|
3888
3917
|
decoding: "async",
|
|
3889
3918
|
className: "mes-media-viewer__image"
|
|
3890
3919
|
},
|
|
3891
|
-
`${r}:${
|
|
3920
|
+
`${r}:${l.src}`
|
|
3892
3921
|
),
|
|
3893
3922
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3894
|
-
|
|
3923
|
+
rt,
|
|
3895
3924
|
{
|
|
3896
3925
|
onPrev: i,
|
|
3897
|
-
onNext:
|
|
3926
|
+
onNext: o,
|
|
3898
3927
|
prevLabel: "Previous image",
|
|
3899
3928
|
nextLabel: "Next image"
|
|
3900
3929
|
}
|
|
@@ -3910,76 +3939,76 @@ const Rr = ({
|
|
|
3910
3939
|
}) => {
|
|
3911
3940
|
const r = e.length;
|
|
3912
3941
|
if (r === 0) return null;
|
|
3913
|
-
const i = e.slice(0, Math.min(r, s)),
|
|
3914
|
-
const u =
|
|
3942
|
+
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
|
|
3943
|
+
const u = y($r, "h-full w-full");
|
|
3915
3944
|
return t ? /* @__PURE__ */ h(
|
|
3916
3945
|
"button",
|
|
3917
3946
|
{
|
|
3918
3947
|
type: "button",
|
|
3919
3948
|
onClick: () => t(m),
|
|
3920
3949
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
3921
|
-
className:
|
|
3950
|
+
className: y(u, "cursor-zoom-in"),
|
|
3922
3951
|
children: [
|
|
3923
3952
|
d.content,
|
|
3924
|
-
|
|
3953
|
+
g
|
|
3925
3954
|
]
|
|
3926
3955
|
},
|
|
3927
3956
|
m
|
|
3928
3957
|
) : /* @__PURE__ */ h("div", { className: u, children: [
|
|
3929
3958
|
d.content,
|
|
3930
|
-
|
|
3959
|
+
g
|
|
3931
3960
|
] }, m);
|
|
3932
3961
|
};
|
|
3933
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
3962
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
3934
3963
|
"div",
|
|
3935
3964
|
{
|
|
3936
|
-
className:
|
|
3965
|
+
className: y(
|
|
3937
3966
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
3938
3967
|
a
|
|
3939
3968
|
),
|
|
3940
|
-
children: i.map((d, m) =>
|
|
3969
|
+
children: i.map((d, m) => l(d, m))
|
|
3941
3970
|
}
|
|
3942
3971
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
3943
3972
|
"div",
|
|
3944
3973
|
{
|
|
3945
|
-
className:
|
|
3974
|
+
className: y(
|
|
3946
3975
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3947
3976
|
a
|
|
3948
3977
|
),
|
|
3949
3978
|
children: [
|
|
3950
|
-
/* @__PURE__ */ n("div", { className: "row-span-2", children:
|
|
3951
|
-
|
|
3952
|
-
|
|
3979
|
+
/* @__PURE__ */ n("div", { className: "row-span-2", children: l(i[0], 0) }),
|
|
3980
|
+
l(i[1], 1),
|
|
3981
|
+
l(i[2], 2)
|
|
3953
3982
|
]
|
|
3954
3983
|
}
|
|
3955
3984
|
) : /* @__PURE__ */ n(
|
|
3956
3985
|
"div",
|
|
3957
3986
|
{
|
|
3958
|
-
className:
|
|
3987
|
+
className: y(
|
|
3959
3988
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3960
3989
|
a
|
|
3961
3990
|
),
|
|
3962
3991
|
children: i.map((d, m) => {
|
|
3963
|
-
const
|
|
3964
|
-
return
|
|
3992
|
+
const g = o > 0 && m === i.length - 1;
|
|
3993
|
+
return l(
|
|
3965
3994
|
d,
|
|
3966
3995
|
m,
|
|
3967
|
-
|
|
3996
|
+
g ? /* @__PURE__ */ h("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
3968
3997
|
"+",
|
|
3969
|
-
|
|
3998
|
+
o
|
|
3970
3999
|
] }) : null
|
|
3971
4000
|
);
|
|
3972
4001
|
})
|
|
3973
4002
|
}
|
|
3974
4003
|
);
|
|
3975
|
-
},
|
|
3976
|
-
const [t, s] = z(!1), [a, r] = z(0), i =
|
|
3977
|
-
(
|
|
3978
|
-
(e == null ? void 0 : e(
|
|
4004
|
+
}, Ne = (e) => {
|
|
4005
|
+
const [t, s] = z(!1), [a, r] = z(0), i = H(
|
|
4006
|
+
(l) => {
|
|
4007
|
+
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3979
4008
|
},
|
|
3980
4009
|
[e]
|
|
3981
|
-
),
|
|
3982
|
-
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer:
|
|
4010
|
+
), o = H(() => s(!1), []);
|
|
4011
|
+
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
3983
4012
|
}, Br = (e, t, s, a) => ({
|
|
3984
4013
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
3985
4014
|
content: /* @__PURE__ */ n(
|
|
@@ -4004,7 +4033,7 @@ const Rr = ({
|
|
|
4004
4033
|
alt: s.alt,
|
|
4005
4034
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4006
4035
|
})), Vr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4007
|
-
const { viewerOpen:
|
|
4036
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Ne(
|
|
4008
4037
|
r
|
|
4009
4038
|
);
|
|
4010
4039
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4028,13 +4057,13 @@ const Rr = ({
|
|
|
4028
4057
|
)
|
|
4029
4058
|
}
|
|
4030
4059
|
),
|
|
4031
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4060
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: i }) }) : null,
|
|
4032
4061
|
/* @__PURE__ */ n(
|
|
4033
4062
|
pn,
|
|
4034
4063
|
{
|
|
4035
|
-
open:
|
|
4064
|
+
open: o,
|
|
4036
4065
|
items: xn([{ src: e, alt: t }], s),
|
|
4037
|
-
initialIndex:
|
|
4066
|
+
initialIndex: l,
|
|
4038
4067
|
onClose: m
|
|
4039
4068
|
}
|
|
4040
4069
|
)
|
|
@@ -4046,33 +4075,33 @@ const Rr = ({
|
|
|
4046
4075
|
filename: a,
|
|
4047
4076
|
items: r,
|
|
4048
4077
|
text: i,
|
|
4049
|
-
groupPosition:
|
|
4050
|
-
loading:
|
|
4078
|
+
groupPosition: o,
|
|
4079
|
+
loading: l = "lazy",
|
|
4051
4080
|
onClick: d
|
|
4052
4081
|
}) => {
|
|
4053
|
-
const m = jr({ src: t, alt: s, items: r }),
|
|
4082
|
+
const m = jr({ src: t, alt: s, items: r }), g = we(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = Ne(
|
|
4054
4083
|
d
|
|
4055
4084
|
);
|
|
4056
4085
|
if (m.length === 0)
|
|
4057
4086
|
return null;
|
|
4058
|
-
const
|
|
4059
|
-
(v,
|
|
4087
|
+
const N = m.map(
|
|
4088
|
+
(v, x) => Br(v, x, m.length, l)
|
|
4060
4089
|
);
|
|
4061
4090
|
return /* @__PURE__ */ h(
|
|
4062
|
-
|
|
4091
|
+
ve,
|
|
4063
4092
|
{
|
|
4064
|
-
variant:
|
|
4093
|
+
variant: g,
|
|
4065
4094
|
text: i,
|
|
4066
|
-
groupPosition:
|
|
4095
|
+
groupPosition: o,
|
|
4067
4096
|
"data-testid": "image-attachment",
|
|
4068
4097
|
children: [
|
|
4069
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles:
|
|
4098
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: N, onTileActivate: c }) }),
|
|
4070
4099
|
/* @__PURE__ */ n(
|
|
4071
4100
|
pn,
|
|
4072
4101
|
{
|
|
4073
4102
|
open: u,
|
|
4074
4103
|
items: xn(m, a),
|
|
4075
|
-
initialIndex:
|
|
4104
|
+
initialIndex: f,
|
|
4076
4105
|
onClose: b
|
|
4077
4106
|
}
|
|
4078
4107
|
)
|
|
@@ -4089,19 +4118,19 @@ const Rr = ({
|
|
|
4089
4118
|
initialIndex: s = 0,
|
|
4090
4119
|
onClose: a
|
|
4091
4120
|
}) => {
|
|
4092
|
-
const { index: r, prev: i, next:
|
|
4121
|
+
const { index: r, prev: i, next: o } = it({
|
|
4093
4122
|
length: t.length,
|
|
4094
4123
|
initialIndex: s,
|
|
4095
4124
|
open: e
|
|
4096
|
-
}),
|
|
4097
|
-
() => (
|
|
4098
|
-
[
|
|
4099
|
-
), m =
|
|
4100
|
-
() =>
|
|
4101
|
-
[
|
|
4125
|
+
}), l = t[r], d = te(
|
|
4126
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "document"),
|
|
4127
|
+
[l]
|
|
4128
|
+
), m = te(
|
|
4129
|
+
() => l ? Wr(l.src) : void 0,
|
|
4130
|
+
[l]
|
|
4102
4131
|
);
|
|
4103
|
-
return !
|
|
4104
|
-
|
|
4132
|
+
return !l || !m ? null : /* @__PURE__ */ h(
|
|
4133
|
+
ot,
|
|
4105
4134
|
{
|
|
4106
4135
|
open: e,
|
|
4107
4136
|
onClose: a,
|
|
@@ -4117,13 +4146,13 @@ const Rr = ({
|
|
|
4117
4146
|
className: "mes-media-viewer__iframe",
|
|
4118
4147
|
sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
|
|
4119
4148
|
},
|
|
4120
|
-
`${r}:${
|
|
4149
|
+
`${r}:${l.src}`
|
|
4121
4150
|
),
|
|
4122
4151
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4123
|
-
|
|
4152
|
+
rt,
|
|
4124
4153
|
{
|
|
4125
4154
|
onPrev: i,
|
|
4126
|
-
onNext:
|
|
4155
|
+
onNext: o,
|
|
4127
4156
|
prevLabel: "Previous document",
|
|
4128
4157
|
nextLabel: "Next document"
|
|
4129
4158
|
}
|
|
@@ -4147,7 +4176,7 @@ const Rr = ({
|
|
|
4147
4176
|
onActivate: a,
|
|
4148
4177
|
trailingAction: r
|
|
4149
4178
|
}) => {
|
|
4150
|
-
const i = t.filename ??
|
|
4179
|
+
const i = t.filename ?? Q(t.src);
|
|
4151
4180
|
return /* @__PURE__ */ n(
|
|
4152
4181
|
fn,
|
|
4153
4182
|
{
|
|
@@ -4161,71 +4190,71 @@ const Rr = ({
|
|
|
4161
4190
|
trailingAction: r
|
|
4162
4191
|
}
|
|
4163
4192
|
);
|
|
4164
|
-
},
|
|
4193
|
+
}, lt = ({
|
|
4165
4194
|
state: e,
|
|
4166
4195
|
src: t,
|
|
4167
4196
|
filename: s,
|
|
4168
4197
|
fileSize: a,
|
|
4169
4198
|
title: r,
|
|
4170
4199
|
items: i,
|
|
4171
|
-
text:
|
|
4172
|
-
groupPosition:
|
|
4200
|
+
text: o,
|
|
4201
|
+
groupPosition: l,
|
|
4173
4202
|
onClick: d,
|
|
4174
4203
|
onDismiss: m
|
|
4175
4204
|
}) => {
|
|
4176
|
-
const
|
|
4205
|
+
const g = we(e), u = Xr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ne(
|
|
4177
4206
|
d
|
|
4178
4207
|
), v = e === "composer" && !!m;
|
|
4179
4208
|
if (u.length === 0)
|
|
4180
4209
|
return null;
|
|
4181
|
-
const
|
|
4182
|
-
src:
|
|
4183
|
-
filename:
|
|
4210
|
+
const x = u.map((w) => ({
|
|
4211
|
+
src: w.src,
|
|
4212
|
+
filename: w.filename ?? Q(w.src)
|
|
4184
4213
|
}));
|
|
4185
4214
|
return /* @__PURE__ */ h(
|
|
4186
|
-
|
|
4215
|
+
ve,
|
|
4187
4216
|
{
|
|
4188
|
-
variant:
|
|
4189
|
-
text:
|
|
4190
|
-
groupPosition:
|
|
4217
|
+
variant: g,
|
|
4218
|
+
text: o,
|
|
4219
|
+
groupPosition: l,
|
|
4191
4220
|
"data-testid": "pdf-attachment",
|
|
4192
4221
|
children: [
|
|
4193
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4194
|
-
const
|
|
4222
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((w, M) => {
|
|
4223
|
+
const A = w.filename ?? Q(w.src), S = v && M === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4195
4224
|
bn,
|
|
4196
4225
|
{
|
|
4197
|
-
url:
|
|
4198
|
-
filename:
|
|
4226
|
+
url: w.src,
|
|
4227
|
+
filename: A,
|
|
4199
4228
|
variant: "inline",
|
|
4200
|
-
label: `Download ${
|
|
4201
|
-
tone:
|
|
4229
|
+
label: `Download ${A}`,
|
|
4230
|
+
tone: g
|
|
4202
4231
|
}
|
|
4203
4232
|
);
|
|
4204
4233
|
return /* @__PURE__ */ n(
|
|
4205
4234
|
Kr,
|
|
4206
4235
|
{
|
|
4207
|
-
variant:
|
|
4208
|
-
item:
|
|
4209
|
-
index:
|
|
4236
|
+
variant: g,
|
|
4237
|
+
item: w,
|
|
4238
|
+
index: M,
|
|
4210
4239
|
onActivate: b,
|
|
4211
|
-
trailingAction:
|
|
4240
|
+
trailingAction: S
|
|
4212
4241
|
},
|
|
4213
|
-
`${
|
|
4242
|
+
`${w.src}-${M}`
|
|
4214
4243
|
);
|
|
4215
4244
|
}) }),
|
|
4216
4245
|
/* @__PURE__ */ n(
|
|
4217
4246
|
qr,
|
|
4218
4247
|
{
|
|
4219
|
-
open:
|
|
4220
|
-
items:
|
|
4248
|
+
open: f,
|
|
4249
|
+
items: x,
|
|
4221
4250
|
initialIndex: c,
|
|
4222
|
-
onClose:
|
|
4251
|
+
onClose: N
|
|
4223
4252
|
}
|
|
4224
4253
|
)
|
|
4225
4254
|
]
|
|
4226
4255
|
}
|
|
4227
4256
|
);
|
|
4228
|
-
}, Jr = (e) => /* @__PURE__ */ n(
|
|
4257
|
+
}, Jr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Zr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), Qr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), ei = {
|
|
4229
4258
|
Composer: Jr,
|
|
4230
4259
|
Sent: Zr,
|
|
4231
4260
|
Received: Qr
|
|
@@ -4235,16 +4264,16 @@ const Rr = ({
|
|
|
4235
4264
|
initialIndex: s = 0,
|
|
4236
4265
|
onClose: a
|
|
4237
4266
|
}) => {
|
|
4238
|
-
const { index: r, prev: i, next:
|
|
4267
|
+
const { index: r, prev: i, next: o } = it({
|
|
4239
4268
|
length: t.length,
|
|
4240
4269
|
initialIndex: s,
|
|
4241
4270
|
open: e
|
|
4242
|
-
}),
|
|
4243
|
-
() => (
|
|
4244
|
-
[
|
|
4271
|
+
}), l = t[r], d = te(
|
|
4272
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "video"),
|
|
4273
|
+
[l]
|
|
4245
4274
|
);
|
|
4246
|
-
return
|
|
4247
|
-
|
|
4275
|
+
return l ? /* @__PURE__ */ h(
|
|
4276
|
+
ot,
|
|
4248
4277
|
{
|
|
4249
4278
|
open: e,
|
|
4250
4279
|
onClose: a,
|
|
@@ -4255,23 +4284,23 @@ const Rr = ({
|
|
|
4255
4284
|
/* @__PURE__ */ n(
|
|
4256
4285
|
"video",
|
|
4257
4286
|
{
|
|
4258
|
-
src:
|
|
4259
|
-
poster:
|
|
4287
|
+
src: l.src,
|
|
4288
|
+
poster: l.poster,
|
|
4260
4289
|
controls: !0,
|
|
4261
4290
|
autoPlay: !0,
|
|
4262
4291
|
muted: !0,
|
|
4263
4292
|
playsInline: !0,
|
|
4264
|
-
preload:
|
|
4293
|
+
preload: l.preload ?? "metadata",
|
|
4265
4294
|
className: "mes-media-viewer__video",
|
|
4266
|
-
children:
|
|
4295
|
+
children: l.mimeType ? /* @__PURE__ */ n("source", { src: l.src, type: l.mimeType }) : null
|
|
4267
4296
|
},
|
|
4268
|
-
`${r}:${
|
|
4297
|
+
`${r}:${l.src}`
|
|
4269
4298
|
),
|
|
4270
4299
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4271
|
-
|
|
4300
|
+
rt,
|
|
4272
4301
|
{
|
|
4273
4302
|
onPrev: i,
|
|
4274
|
-
onNext:
|
|
4303
|
+
onNext: o,
|
|
4275
4304
|
prevLabel: "Previous video",
|
|
4276
4305
|
nextLabel: "Next video"
|
|
4277
4306
|
}
|
|
@@ -4279,7 +4308,7 @@ const Rr = ({
|
|
|
4279
4308
|
]
|
|
4280
4309
|
}
|
|
4281
4310
|
) : null;
|
|
4282
|
-
}, ti = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(
|
|
4311
|
+
}, ti = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n($e, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), _n = ({
|
|
4283
4312
|
item: e,
|
|
4284
4313
|
index: t
|
|
4285
4314
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4317,8 +4346,8 @@ const Rr = ({
|
|
|
4317
4346
|
mimeType: s.mimeType,
|
|
4318
4347
|
preload: s.preload,
|
|
4319
4348
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4320
|
-
})), ai = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss:
|
|
4321
|
-
const { viewerOpen:
|
|
4349
|
+
})), ai = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4350
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = Ne(
|
|
4322
4351
|
i
|
|
4323
4352
|
);
|
|
4324
4353
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4332,17 +4361,17 @@ const Rr = ({
|
|
|
4332
4361
|
children: /* @__PURE__ */ n(_n, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4333
4362
|
}
|
|
4334
4363
|
),
|
|
4335
|
-
|
|
4364
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: o }) }) : null,
|
|
4336
4365
|
/* @__PURE__ */ n(
|
|
4337
4366
|
Nn,
|
|
4338
4367
|
{
|
|
4339
|
-
open:
|
|
4368
|
+
open: l,
|
|
4340
4369
|
items: yn(
|
|
4341
4370
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4342
4371
|
a
|
|
4343
4372
|
),
|
|
4344
4373
|
initialIndex: d,
|
|
4345
|
-
onClose:
|
|
4374
|
+
onClose: g
|
|
4346
4375
|
}
|
|
4347
4376
|
)
|
|
4348
4377
|
] });
|
|
@@ -4353,25 +4382,25 @@ const Rr = ({
|
|
|
4353
4382
|
mimeType: a,
|
|
4354
4383
|
filename: r,
|
|
4355
4384
|
items: i,
|
|
4356
|
-
text:
|
|
4357
|
-
groupPosition:
|
|
4385
|
+
text: o,
|
|
4386
|
+
groupPosition: l,
|
|
4358
4387
|
preload: d,
|
|
4359
4388
|
onClick: m
|
|
4360
4389
|
}) => {
|
|
4361
|
-
const
|
|
4390
|
+
const g = si({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ne(
|
|
4362
4391
|
m
|
|
4363
4392
|
);
|
|
4364
|
-
if (
|
|
4393
|
+
if (g.length === 0)
|
|
4365
4394
|
return null;
|
|
4366
|
-
const v =
|
|
4367
|
-
(
|
|
4395
|
+
const v = g.map(
|
|
4396
|
+
(x, w) => ni(x, w, g.length)
|
|
4368
4397
|
);
|
|
4369
4398
|
return /* @__PURE__ */ h(
|
|
4370
|
-
|
|
4399
|
+
ve,
|
|
4371
4400
|
{
|
|
4372
4401
|
variant: u,
|
|
4373
|
-
text:
|
|
4374
|
-
groupPosition:
|
|
4402
|
+
text: o,
|
|
4403
|
+
groupPosition: l,
|
|
4375
4404
|
"data-testid": "video-attachment",
|
|
4376
4405
|
children: [
|
|
4377
4406
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
@@ -4385,10 +4414,10 @@ const Rr = ({
|
|
|
4385
4414
|
/* @__PURE__ */ n(
|
|
4386
4415
|
Nn,
|
|
4387
4416
|
{
|
|
4388
|
-
open:
|
|
4389
|
-
items: yn(
|
|
4417
|
+
open: f,
|
|
4418
|
+
items: yn(g, r),
|
|
4390
4419
|
initialIndex: c,
|
|
4391
|
-
onClose:
|
|
4420
|
+
onClose: N
|
|
4392
4421
|
}
|
|
4393
4422
|
)
|
|
4394
4423
|
]
|
|
@@ -4416,7 +4445,7 @@ const Rr = ({
|
|
|
4416
4445
|
onClick: t,
|
|
4417
4446
|
disabled: s,
|
|
4418
4447
|
style: { backgroundColor: "#E6E5E3" },
|
|
4419
|
-
className:
|
|
4448
|
+
className: y(
|
|
4420
4449
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4421
4450
|
{
|
|
4422
4451
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4433,15 +4462,15 @@ const Rr = ({
|
|
|
4433
4462
|
headerText: a,
|
|
4434
4463
|
className: r,
|
|
4435
4464
|
avatarImage: i,
|
|
4436
|
-
avatarName:
|
|
4465
|
+
avatarName: o
|
|
4437
4466
|
}) => {
|
|
4438
|
-
const
|
|
4439
|
-
return
|
|
4440
|
-
(i ||
|
|
4441
|
-
|
|
4467
|
+
const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4468
|
+
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4469
|
+
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4470
|
+
ne,
|
|
4442
4471
|
{
|
|
4443
|
-
id:
|
|
4444
|
-
name:
|
|
4472
|
+
id: o || "account",
|
|
4473
|
+
name: o || "Account",
|
|
4445
4474
|
image: i,
|
|
4446
4475
|
size: 24,
|
|
4447
4476
|
shape: "circle"
|
|
@@ -4454,7 +4483,7 @@ const Rr = ({
|
|
|
4454
4483
|
style: { backgroundColor: "#F1F0EE" },
|
|
4455
4484
|
children: [
|
|
4456
4485
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4457
|
-
|
|
4486
|
+
l.map((d) => /* @__PURE__ */ n(
|
|
4458
4487
|
ci,
|
|
4459
4488
|
{
|
|
4460
4489
|
question: d.question,
|
|
@@ -4476,13 +4505,13 @@ export {
|
|
|
4476
4505
|
ki as F,
|
|
4477
4506
|
_i as L,
|
|
4478
4507
|
xi as M,
|
|
4479
|
-
|
|
4480
|
-
|
|
4508
|
+
ye as a,
|
|
4509
|
+
ne as b,
|
|
4481
4510
|
tr as c,
|
|
4482
4511
|
dn as d,
|
|
4483
4512
|
wi as e,
|
|
4484
4513
|
ci as f,
|
|
4485
|
-
|
|
4514
|
+
se as g,
|
|
4486
4515
|
Ft as h,
|
|
4487
4516
|
Ci as i,
|
|
4488
4517
|
wa as j,
|
|
@@ -4493,14 +4522,14 @@ export {
|
|
|
4493
4522
|
Qa as o,
|
|
4494
4523
|
Sr as p,
|
|
4495
4524
|
Kt as q,
|
|
4496
|
-
|
|
4525
|
+
ce as r,
|
|
4497
4526
|
sn as s,
|
|
4498
4527
|
Rs as t,
|
|
4499
4528
|
yi as u,
|
|
4500
4529
|
Vs as v,
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4530
|
+
Ze as w,
|
|
4531
|
+
Qe as x,
|
|
4532
|
+
Se as y,
|
|
4504
4533
|
fa as z
|
|
4505
4534
|
};
|
|
4506
|
-
//# sourceMappingURL=index-
|
|
4535
|
+
//# sourceMappingURL=index-BmCc1-F3.js.map
|