@mobilon-dev/chotto 0.3.103 → 0.3.105
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/chotto.css +1 -1
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +164 -160
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +106 -102
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +121 -116
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +116 -111
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +153 -149
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +131 -126
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +189 -161
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/Feed.vue2.js +174 -170
- package/dist/components/3_compounds/Feed/composables/useFeedReply.js +10 -10
- package/dist/functions/isSmsChannel.js +19 -0
- package/dist/hooks/messages/canStartEditLastSent.js +16 -0
- package/dist/hooks/messages/useMessageHoverActions.js +13 -0
- package/dist/index.js +112 -103
- package/dist/types/components/3_compounds/ChatInput/ChatInput.vue.d.ts +13 -0
- package/dist/types/components/3_compounds/Feed/composables/useFeedReply.d.ts +2 -1
- package/dist/types/functions/index.d.ts +1 -0
- package/dist/types/functions/isSmsChannel.d.ts +8 -0
- package/dist/types/hooks/messages/canStartEditLastSent.d.ts +22 -0
- package/dist/types/hooks/messages/index.d.ts +2 -0
- package/dist/types/hooks/messages/useMessageHoverActions.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AudioMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-eef95919"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as tt, ref as y, computed as m, inject as st, watch as G, createElementBlock as r, openBlock as l, unref as i, normalizeStyle as Y, normalizeClass as w, createCommentVNode as d, createElementVNode as o, createVNode as b, withCtx as Z, createTextVNode as at, toDisplayString as p, Fragment as q, createBlock as T, withDirectives as z, vShow as ce, vModelText as nt, Transition as ve, Teleport as ot, nextTick as it } from "vue";
|
|
2
|
+
import ut from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
|
+
import lt from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
|
+
import rt from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
5
|
+
import mt from "../BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
6
|
+
import dt from "../MessageReactions/MessageReactions.vue.js";
|
|
7
7
|
import ge from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useMessageActions as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
8
|
+
import ct from "../MessageSmsInvite/MessageSmsInvite.vue.js";
|
|
9
|
+
import vt from "../DeletedMessageContent/DeletedMessageContent.vue.js";
|
|
10
|
+
import gt from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
11
|
+
import { useMessageActions as ft } from "../../../hooks/messages/useMessageActions.js";
|
|
12
|
+
import { useMessageHoverActions as yt } from "../../../hooks/messages/useMessageHoverActions.js";
|
|
13
|
+
import { useMessageMenuActions as pt } from "../../../hooks/messages/useMessageMenuActions.js";
|
|
14
|
+
import { useMessageLinks as ht } from "../../../hooks/messages/useMessageLinks.js";
|
|
15
|
+
import { useChannelAccentColor as bt } from "../../../hooks/messages/useChannelAccentColor.js";
|
|
16
|
+
import { useSubtextTooltip as Ct } from "../../../hooks/messages/useSubtextTooltip.js";
|
|
17
|
+
import { useStartReply as wt } from "../../../hooks/messages/useStartReply.js";
|
|
17
18
|
import "../../../hooks/useMessageDraft.js";
|
|
18
19
|
import "../../../hooks/useSearchModel.js";
|
|
19
20
|
import "../../../hooks/useTheme.js";
|
|
@@ -23,35 +24,35 @@ import "../../../hooks/useEmojiNative.js";
|
|
|
23
24
|
import "../../../locale/useLocale.js";
|
|
24
25
|
/* empty css */
|
|
25
26
|
import { buildReplyPayload as fe } from "../../../hooks/messages/buildReplyPayload.js";
|
|
26
|
-
import { getStatus as
|
|
27
|
-
import { getMessageClass as
|
|
28
|
-
import { createReactionHandlers as
|
|
27
|
+
import { getStatus as xt, getStatusTitle as Mt } from "../../../functions/getStatusMessage.js";
|
|
28
|
+
import { getMessageClass as kt } from "../../../functions/getMessageClass.js";
|
|
29
|
+
import { createReactionHandlers as Rt } from "../../../functions/createReactionHandlers.js";
|
|
29
30
|
import "../../../functions/parseMarkdown.js";
|
|
30
|
-
const
|
|
31
|
+
const Tt = ["messageId"], St = ["src"], Nt = {
|
|
31
32
|
key: 1,
|
|
32
33
|
class: "audio-message__subtext"
|
|
33
|
-
},
|
|
34
|
+
}, _t = { class: "audio-message__footer" }, It = { class: "audio-message__info-container" }, At = {
|
|
34
35
|
key: 0,
|
|
35
36
|
class: "audio-message__time"
|
|
36
|
-
},
|
|
37
|
+
}, Et = { class: "audio-message__audio-container" }, Ot = ["src"], Ft = { class: "audio-message__progress-wrapper" }, Lt = ["max"], Dt = { class: "audio-message__speed-btn-container" }, Pt = { class: "audio-message__player-controls" }, Ut = { class: "audio-message__current-time" }, $t = { class: "audio-message__duration" }, Vt = {
|
|
37
38
|
key: 1,
|
|
38
39
|
class: "audio-message__text-container"
|
|
39
|
-
},
|
|
40
|
+
}, Bt = ["innerHTML"], Ht = { class: "audio-message__footer" }, jt = { class: "audio-message__info-container" }, Gt = {
|
|
40
41
|
key: 0,
|
|
41
42
|
class: "audio-message__actions"
|
|
42
|
-
},
|
|
43
|
+
}, Yt = { class: "audio-message__time" }, Zt = {
|
|
43
44
|
key: 0,
|
|
44
45
|
class: "audio-message__expand-panel"
|
|
45
|
-
},
|
|
46
|
+
}, qt = { class: "audio-message__expand-inner" }, zt = {
|
|
46
47
|
key: 0,
|
|
47
48
|
class: "audio-message__expand-placeholder"
|
|
48
|
-
},
|
|
49
|
+
}, Wt = ["innerHTML"], Jt = {
|
|
49
50
|
key: 1,
|
|
50
51
|
class: "audio-message__expand-plain"
|
|
51
|
-
},
|
|
52
|
+
}, Kt = {
|
|
52
53
|
key: 0,
|
|
53
54
|
class: "audio-message__expand-placeholder"
|
|
54
|
-
},
|
|
55
|
+
}, Qt = ["innerHTML"], Xt = { class: "audio-message__expand-close-wrap" }, es = "RECOGNITION_READY", ts = "SUMMARY_READY", Os = /* @__PURE__ */ tt({
|
|
55
56
|
__name: "AudioMessage",
|
|
56
57
|
props: {
|
|
57
58
|
message: {
|
|
@@ -96,7 +97,7 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
96
97
|
},
|
|
97
98
|
emits: ["action", "reply", "sms-invite"],
|
|
98
99
|
setup(s, { emit: ye }) {
|
|
99
|
-
const
|
|
100
|
+
const u = s, L = y([
|
|
100
101
|
{
|
|
101
102
|
text: "1.0x",
|
|
102
103
|
speed: 1
|
|
@@ -115,11 +116,15 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
115
116
|
}
|
|
116
117
|
]), D = y(0), P = m(() => L.value[D.value] ?? L.value[0]), pe = () => {
|
|
117
118
|
D.value = (D.value + 1) % L.value.length, a.value && (a.value.playbackRate = P.value.speed);
|
|
118
|
-
}, k = ye, { menuActions: S } =
|
|
119
|
+
}, k = ye, { menuActions: S } = pt(() => u.message), { hoverActionsEnabled: W, reactionsActive: he } = yt(
|
|
120
|
+
() => u.channel,
|
|
121
|
+
() => u.reactionsEnabled,
|
|
122
|
+
() => u.message
|
|
123
|
+
), be = st("chatAppId"), { startReply: Ce } = wt(be || ""), a = y(null), x = y(void 0), c = y(!1), h = y(0), g = y(0), C = y(!1), U = m(() => {
|
|
119
124
|
var t, n;
|
|
120
|
-
const e =
|
|
125
|
+
const e = u.message;
|
|
121
126
|
return e.url || (typeof ((t = e.meta) == null ? void 0 : t.url) == "string" ? e.meta.url : void 0) || ((n = e.data) == null ? void 0 : n.url);
|
|
122
|
-
}),
|
|
127
|
+
}), $ = (e) => {
|
|
123
128
|
if (e == null) return;
|
|
124
129
|
if (typeof e == "number")
|
|
125
130
|
return !Number.isFinite(e) || e < 0 ? void 0 : Math.floor(e);
|
|
@@ -136,45 +141,45 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
136
141
|
}
|
|
137
142
|
const M = t.match(/^(\d+):([0-5]\d)$/);
|
|
138
143
|
if (M) return Number(M[1]) * 60 + Number(M[2]);
|
|
139
|
-
},
|
|
140
|
-
c.value = !1, g.value = 0, h.value =
|
|
144
|
+
}, J = () => {
|
|
145
|
+
c.value = !1, g.value = 0, h.value = $(u.message.duration) ?? 0, C.value = !1;
|
|
141
146
|
};
|
|
142
|
-
|
|
147
|
+
J(), G(
|
|
143
148
|
() => U.value,
|
|
144
149
|
(e, t) => {
|
|
145
|
-
e !== t && (
|
|
150
|
+
e !== t && (J(), x.value = void 0, a.value && (a.value.pause(), a.value.currentTime = 0, a.value.removeAttribute("src"), a.value.load()));
|
|
146
151
|
}
|
|
147
152
|
), G(
|
|
148
|
-
() =>
|
|
153
|
+
() => u.message.duration,
|
|
149
154
|
() => {
|
|
150
|
-
x.value === void 0 && (h.value =
|
|
155
|
+
x.value === void 0 && (h.value = $(u.message.duration) ?? 0);
|
|
151
156
|
}
|
|
152
157
|
);
|
|
153
158
|
const {
|
|
154
|
-
isOpenMenu:
|
|
155
|
-
buttonMenuVisible:
|
|
156
|
-
menuAnchorRef:
|
|
157
|
-
menuRef:
|
|
158
|
-
menuStyle:
|
|
159
|
-
menuTheme:
|
|
160
|
-
showMenu:
|
|
161
|
-
hideMenu:
|
|
162
|
-
openMenu:
|
|
159
|
+
isOpenMenu: we,
|
|
160
|
+
buttonMenuVisible: xe,
|
|
161
|
+
menuAnchorRef: Me,
|
|
162
|
+
menuRef: ke,
|
|
163
|
+
menuStyle: Re,
|
|
164
|
+
menuTheme: Te,
|
|
165
|
+
showMenu: Se,
|
|
166
|
+
hideMenu: V,
|
|
167
|
+
openMenu: Ne,
|
|
163
168
|
toggleMenu: K,
|
|
164
|
-
onMenuMouseEnter:
|
|
165
|
-
onMenuMouseLeave:
|
|
166
|
-
clickAction:
|
|
169
|
+
onMenuMouseEnter: _e,
|
|
170
|
+
onMenuMouseLeave: Ie,
|
|
171
|
+
clickAction: Ae,
|
|
167
172
|
viewsAction: Q,
|
|
168
|
-
handleClickReplied:
|
|
169
|
-
} =
|
|
170
|
-
onReply: () =>
|
|
173
|
+
handleClickReplied: Ee
|
|
174
|
+
} = ft(u.message, k, {
|
|
175
|
+
onReply: () => Ce(fe(u.message, "message.audio"))
|
|
171
176
|
}), f = y(null), N = y({ text: !1, summary: !1 }), _ = m(() => {
|
|
172
177
|
var n;
|
|
173
|
-
const e =
|
|
178
|
+
const e = u.message, t = e.transcript ?? ((n = e.meta) == null ? void 0 : n.transcript);
|
|
174
179
|
return !t || typeof t != "object" ? null : t;
|
|
175
180
|
}), I = m(() => {
|
|
176
181
|
var n;
|
|
177
|
-
const e =
|
|
182
|
+
const e = u.message, t = e.summary ?? ((n = e.meta) == null ? void 0 : n.summary);
|
|
178
183
|
return !t || typeof t != "object" ? null : t;
|
|
179
184
|
}), X = m(() => {
|
|
180
185
|
var t;
|
|
@@ -182,21 +187,21 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
182
187
|
return typeof e != "string" ? "" : e.trim();
|
|
183
188
|
}), ee = m(() => {
|
|
184
189
|
var e;
|
|
185
|
-
return ((e = _.value) == null ? void 0 : e.status) ===
|
|
190
|
+
return ((e = _.value) == null ? void 0 : e.status) === es && X.value.length > 0;
|
|
186
191
|
}), te = m(() => {
|
|
187
192
|
var t;
|
|
188
193
|
const e = (t = I.value) == null ? void 0 : t.html;
|
|
189
194
|
return typeof e != "string" ? "" : e.trim();
|
|
190
195
|
}), se = m(() => {
|
|
191
196
|
var e;
|
|
192
|
-
return ((e = I.value) == null ? void 0 : e.status) ===
|
|
193
|
-
}),
|
|
197
|
+
return ((e = I.value) == null ? void 0 : e.status) === ts && te.value.length > 0;
|
|
198
|
+
}), A = m(() => {
|
|
194
199
|
var e;
|
|
195
200
|
return !!((e = _.value) != null && e.status);
|
|
196
|
-
}),
|
|
201
|
+
}), E = m(() => {
|
|
197
202
|
var e;
|
|
198
203
|
return !!((e = I.value) != null && e.status);
|
|
199
|
-
}),
|
|
204
|
+
}), Oe = m(() => f.value === "text" ? A.value : f.value === "summary" ? E.value : !1), Fe = m(() => {
|
|
200
205
|
var e;
|
|
201
206
|
switch ((e = _.value) == null ? void 0 : e.status) {
|
|
202
207
|
case "RECOGNITION_PLANNED":
|
|
@@ -208,7 +213,7 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
208
213
|
default:
|
|
209
214
|
return "Текст сообщения недоступен";
|
|
210
215
|
}
|
|
211
|
-
}),
|
|
216
|
+
}), Le = m(() => {
|
|
212
217
|
var e;
|
|
213
218
|
switch ((e = I.value) == null ? void 0 : e.status) {
|
|
214
219
|
case "SUMMARY_PLANNED":
|
|
@@ -220,7 +225,7 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
220
225
|
default:
|
|
221
226
|
return "Резюме недоступно";
|
|
222
227
|
}
|
|
223
|
-
}),
|
|
228
|
+
}), De = async () => {
|
|
224
229
|
var t, n, M;
|
|
225
230
|
const e = U.value;
|
|
226
231
|
if (e)
|
|
@@ -232,7 +237,7 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
232
237
|
});
|
|
233
238
|
if (!v.ok)
|
|
234
239
|
throw new Error(`HTTP error! status: ${v.status}`);
|
|
235
|
-
const H = v.headers.get("content-type") || "", j = await v.blob(), O = ((n = (t = e.split(".").pop()) == null ? void 0 : t.split("?")[0]) == null ? void 0 : n.toLowerCase()) || "",
|
|
240
|
+
const H = v.headers.get("content-type") || "", j = await v.blob(), O = ((n = (t = e.split(".").pop()) == null ? void 0 : t.split("?")[0]) == null ? void 0 : n.toLowerCase()) || "", Xe = {
|
|
236
241
|
"audio/mpeg": "mp3",
|
|
237
242
|
"audio/mp3": "mp3",
|
|
238
243
|
"audio/wav": "wav",
|
|
@@ -244,15 +249,15 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
244
249
|
"audio/m4a": "m4a",
|
|
245
250
|
"audio/x-m4a": "m4a",
|
|
246
251
|
"application/octet-stream": O || "mp3"
|
|
247
|
-
}, re = O && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes(O) ? O :
|
|
248
|
-
R.href = de, R.download =
|
|
252
|
+
}, re = O && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes(O) ? O : Xe[H] || "mp3", me = e.split("/"), F = decodeURIComponent(((M = me[me.length - 1]) == null ? void 0 : M.split("?")[0]) || ""), et = F ? F.includes(".") ? F : `${F}.${re}` : `audio-${u.message.messageId}.${re}`, de = window.URL.createObjectURL(j), R = document.createElement("a");
|
|
253
|
+
R.href = de, R.download = et, document.body.appendChild(R), R.click(), document.body.removeChild(R), window.URL.revokeObjectURL(de);
|
|
249
254
|
} catch (v) {
|
|
250
255
|
console.error("Ошибка при скачивании аудио:", v), e && window.open(e, "_blank");
|
|
251
256
|
}
|
|
252
|
-
},
|
|
253
|
-
e.action === "download" ? (
|
|
254
|
-
}, { linkedHtml:
|
|
255
|
-
m(() =>
|
|
257
|
+
}, Pe = (e) => {
|
|
258
|
+
e.action === "download" ? (De(), V()) : Ae(e);
|
|
259
|
+
}, { linkedHtml: Ue, inNewWindow: ae } = ht(() => u.message.text), ne = m(() => xt(u.message.status)), oe = m(() => Mt(u.message.status, u.message.statusMsg)), { bubbleStyle: $e } = bt(
|
|
260
|
+
m(() => u.message),
|
|
256
261
|
{ cssVariable: "--chotto-audiomessage-right-background-color", position: "right" }
|
|
257
262
|
), ie = async () => {
|
|
258
263
|
const e = U.value;
|
|
@@ -261,14 +266,14 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
261
266
|
a.value.pause(), c.value = !1;
|
|
262
267
|
else
|
|
263
268
|
try {
|
|
264
|
-
x.value || (x.value = e, await
|
|
269
|
+
x.value || (x.value = e, await it(), a.value.load()), await a.value.play(), c.value = !0;
|
|
265
270
|
} catch (t) {
|
|
266
271
|
console.error("Не удалось воспроизвести аудио", t), c.value = !1;
|
|
267
272
|
}
|
|
268
273
|
}, ue = (e) => {
|
|
269
274
|
const t = Math.floor(e / 60), n = Math.floor(e % 60);
|
|
270
275
|
return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
|
|
271
|
-
},
|
|
276
|
+
}, Ve = m(() => ue(g.value));
|
|
272
277
|
G(
|
|
273
278
|
() => g.value,
|
|
274
279
|
() => {
|
|
@@ -277,7 +282,7 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
277
282
|
);
|
|
278
283
|
const le = () => {
|
|
279
284
|
a.value && C.value && a.value.duration != 1 / 0 && !Number.isNaN(a.value.duration) && (a.value.currentTime = g.value), C.value = !1;
|
|
280
|
-
},
|
|
285
|
+
}, Be = m(() => ue(h.value)), He = () => {
|
|
281
286
|
if (!a.value) return;
|
|
282
287
|
const e = a.value;
|
|
283
288
|
if (g.value = e.currentTime || 0, e.duration === 1 / 0 || Number.isNaN(e.duration)) {
|
|
@@ -289,75 +294,74 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
289
294
|
} else
|
|
290
295
|
h.value = e.duration || 0;
|
|
291
296
|
e.playbackRate = P.value.speed;
|
|
292
|
-
},
|
|
297
|
+
}, je = () => {
|
|
293
298
|
a.value && (C.value || (g.value = a.value.currentTime), a.value.ended && c.value && (c.value = !1));
|
|
294
|
-
},
|
|
299
|
+
}, Ge = () => {
|
|
295
300
|
c.value = !1;
|
|
296
|
-
},
|
|
297
|
-
console.error("Не удалось загрузить аудио"), c.value = !1, x.value = void 0, a.value && (a.value.pause(), a.value.currentTime = 0, a.value.removeAttribute("src"), a.value.load()), h.value =
|
|
301
|
+
}, Ye = () => {
|
|
302
|
+
console.error("Не удалось загрузить аудио"), c.value = !1, x.value = void 0, a.value && (a.value.pause(), a.value.currentTime = 0, a.value.removeAttribute("src"), a.value.load()), h.value = $(u.message.duration) ?? 0;
|
|
298
303
|
};
|
|
299
304
|
function B(e) {
|
|
300
|
-
return
|
|
305
|
+
return kt(e.position, "audio-message");
|
|
301
306
|
}
|
|
302
|
-
const { onToggleReaction:
|
|
303
|
-
function
|
|
304
|
-
k("sms-invite",
|
|
307
|
+
const { onToggleReaction: Ze, onAddReaction: qe, onRemoveReaction: ze } = Rt(k), We = Ct(() => u.message, () => u.subtextTooltipData);
|
|
308
|
+
function Je() {
|
|
309
|
+
k("sms-invite", u.message);
|
|
305
310
|
}
|
|
306
|
-
const
|
|
307
|
-
if (!E.value) return;
|
|
308
|
-
const e = f.value === "text" ? null : "text";
|
|
309
|
-
f.value = e, e === "text" && !ee.value && !N.value.text && (N.value.text = !0, k("action", { action: "fetchTranscript", messageId: l.message.messageId }));
|
|
310
|
-
}, Je = () => {
|
|
311
|
+
const Ke = () => {
|
|
311
312
|
if (!A.value) return;
|
|
313
|
+
const e = f.value === "text" ? null : "text";
|
|
314
|
+
f.value = e, e === "text" && !ee.value && !N.value.text && (N.value.text = !0, k("action", { action: "fetchTranscript", messageId: u.message.messageId }));
|
|
315
|
+
}, Qe = () => {
|
|
316
|
+
if (!E.value) return;
|
|
312
317
|
const e = f.value === "summary" ? null : "summary";
|
|
313
|
-
f.value = e, e === "summary" && !se.value && !N.value.summary && (N.value.summary = !0, k("action", { action: "fetchSummary", messageId:
|
|
318
|
+
f.value = e, e === "summary" && !se.value && !N.value.summary && (N.value.summary = !0, k("action", { action: "fetchSummary", messageId: u.message.messageId }));
|
|
314
319
|
};
|
|
315
|
-
return (e, t) => (
|
|
320
|
+
return (e, t) => (l(), r("div", {
|
|
316
321
|
ref_key: "menuAnchorRef",
|
|
317
|
-
ref:
|
|
322
|
+
ref: Me,
|
|
318
323
|
class: w(["audio-message", [
|
|
319
324
|
B(s.message),
|
|
320
325
|
s.applyStyle(s.message)
|
|
321
326
|
]]),
|
|
322
327
|
messageId: s.message.messageId,
|
|
323
|
-
style: Y(i(
|
|
328
|
+
style: Y(i($e)),
|
|
324
329
|
onMouseleave: t[8] || (t[8] = //@ts-ignore
|
|
325
|
-
(...n) => i(
|
|
330
|
+
(...n) => i(V) && i(V)(...n))
|
|
326
331
|
}, [
|
|
327
|
-
s.message.avatar && s.isFirstInSeries ? (
|
|
332
|
+
s.message.avatar && s.isFirstInSeries ? (l(), r("img", {
|
|
328
333
|
key: 0,
|
|
329
334
|
class: "audio-message__avatar",
|
|
330
335
|
src: s.message.avatar,
|
|
331
336
|
height: "32",
|
|
332
337
|
width: "32",
|
|
333
338
|
style: Y({ gridRow: s.message.subText ? "2" : "1" })
|
|
334
|
-
}, null, 12,
|
|
335
|
-
s.message.subText && s.isFirstInSeries ? (
|
|
336
|
-
b(
|
|
337
|
-
text: i(
|
|
339
|
+
}, null, 12, St)) : d("", !0),
|
|
340
|
+
s.message.subText && s.isFirstInSeries ? (l(), r("p", Nt, [
|
|
341
|
+
b(gt, {
|
|
342
|
+
text: i(We),
|
|
338
343
|
position: s.message.position === "left" ? "right" : "left",
|
|
339
344
|
offset: 8
|
|
340
345
|
}, {
|
|
341
346
|
default: Z(() => [
|
|
342
|
-
|
|
347
|
+
at(p(s.message.subText), 1)
|
|
343
348
|
]),
|
|
344
349
|
_: 1
|
|
345
350
|
}, 8, ["text", "position"])
|
|
346
351
|
])) : d("", !0),
|
|
347
352
|
o("div", {
|
|
348
353
|
class: w(["audio-message__content", { "is-first": s.isFirstInSeries, "with-avatar-indent": !s.isFirstInSeries && s.message.avatar }]),
|
|
349
|
-
onMouseenter: t[7] || (t[7] =
|
|
350
|
-
(...n) => i(J) && i(J)(...n))
|
|
354
|
+
onMouseenter: t[7] || (t[7] = (n) => i(W) && i(Se)())
|
|
351
355
|
}, [
|
|
352
356
|
t[13] || (t[13] = o("div", {
|
|
353
357
|
class: "audio-message__bottom-shadow",
|
|
354
358
|
"aria-hidden": "true"
|
|
355
359
|
}, null, -1)),
|
|
356
|
-
s.message.deleted ? (
|
|
357
|
-
b(
|
|
358
|
-
o("div",
|
|
359
|
-
o("div",
|
|
360
|
-
s.message.time ? (
|
|
360
|
+
s.message.deleted ? (l(), r(q, { key: 0 }, [
|
|
361
|
+
b(vt),
|
|
362
|
+
o("div", _t, [
|
|
363
|
+
o("div", It, [
|
|
364
|
+
s.message.time ? (l(), r("span", At, p(s.message.time), 1)) : d("", !0),
|
|
361
365
|
b(ge, {
|
|
362
366
|
"base-class": "audio-message",
|
|
363
367
|
"message-class": B(s.message),
|
|
@@ -367,25 +371,25 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
367
371
|
}, null, 8, ["message-class", "message-status", "status-class", "status-title"])
|
|
368
372
|
])
|
|
369
373
|
])
|
|
370
|
-
], 64)) : (
|
|
371
|
-
s.message.reply ? (
|
|
374
|
+
], 64)) : (l(), r(q, { key: 1 }, [
|
|
375
|
+
s.message.reply ? (l(), T(mt, {
|
|
372
376
|
key: 0,
|
|
373
377
|
style: { "grid-column": "1/3" },
|
|
374
378
|
message: s.message.reply,
|
|
375
379
|
class: w(s.message.position),
|
|
376
|
-
onReply: i(
|
|
380
|
+
onReply: i(Ee)
|
|
377
381
|
}, null, 8, ["message", "class", "onReply"])) : d("", !0),
|
|
378
|
-
o("div",
|
|
382
|
+
o("div", Et, [
|
|
379
383
|
o("audio", {
|
|
380
384
|
ref_key: "player",
|
|
381
385
|
ref: a,
|
|
382
386
|
src: x.value,
|
|
383
387
|
type: "audio/webm",
|
|
384
|
-
onLoadedmetadata:
|
|
385
|
-
onTimeupdate:
|
|
386
|
-
onEnded:
|
|
387
|
-
onError:
|
|
388
|
-
}, null, 40,
|
|
388
|
+
onLoadedmetadata: He,
|
|
389
|
+
onTimeupdate: je,
|
|
390
|
+
onEnded: Ge,
|
|
391
|
+
onError: Ye
|
|
392
|
+
}, null, 40, Ot),
|
|
389
393
|
z(o("button", {
|
|
390
394
|
class: "audio-message__play",
|
|
391
395
|
onClick: ie
|
|
@@ -428,7 +432,7 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
428
432
|
])], 512), [
|
|
429
433
|
[ce, c.value]
|
|
430
434
|
]),
|
|
431
|
-
o("div",
|
|
435
|
+
o("div", Ft, [
|
|
432
436
|
z(o("input", {
|
|
433
437
|
"onUpdate:modelValue": t[0] || (t[0] = (n) => g.value = n),
|
|
434
438
|
class: "audio-message__progress-bar-container",
|
|
@@ -440,10 +444,10 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
440
444
|
onMouseup: le,
|
|
441
445
|
onTouchstartPassive: t[2] || (t[2] = (n) => C.value = !0),
|
|
442
446
|
onTouchendPassive: le
|
|
443
|
-
}, null, 40,
|
|
444
|
-
[
|
|
447
|
+
}, null, 40, Lt), [
|
|
448
|
+
[nt, g.value]
|
|
445
449
|
]),
|
|
446
|
-
o("div",
|
|
450
|
+
o("div", Dt, [
|
|
447
451
|
o("button", {
|
|
448
452
|
type: "button",
|
|
449
453
|
class: "audio-message__speed-btn",
|
|
@@ -451,65 +455,65 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
451
455
|
}, p(P.value.text), 1)
|
|
452
456
|
])
|
|
453
457
|
]),
|
|
454
|
-
o("div",
|
|
455
|
-
o("p",
|
|
456
|
-
o("p",
|
|
458
|
+
o("div", Pt, [
|
|
459
|
+
o("p", Ut, p(Ve.value), 1),
|
|
460
|
+
o("p", $t, p(Be.value), 1)
|
|
457
461
|
])
|
|
458
462
|
]),
|
|
459
|
-
s.message.text ? (
|
|
463
|
+
s.message.text ? (l(), r("div", Vt, [
|
|
460
464
|
o("p", {
|
|
461
465
|
onClick: t[3] || (t[3] = //@ts-ignore
|
|
462
466
|
(...n) => i(ae) && i(ae)(...n)),
|
|
463
|
-
innerHTML: i(
|
|
464
|
-
}, null, 8,
|
|
467
|
+
innerHTML: i(Ue)
|
|
468
|
+
}, null, 8, Bt)
|
|
465
469
|
])) : d("", !0),
|
|
466
|
-
s.message.linkPreview ? (
|
|
470
|
+
s.message.linkPreview ? (l(), T(lt, {
|
|
467
471
|
key: 2,
|
|
468
472
|
class: w(["audio-message__link-preview", s.message.position]),
|
|
469
473
|
"link-preview": s.message.linkPreview
|
|
470
474
|
}, null, 8, ["class", "link-preview"])) : d("", !0),
|
|
471
|
-
s.message.embed ? (
|
|
475
|
+
s.message.embed ? (l(), T(rt, {
|
|
472
476
|
key: 3,
|
|
473
477
|
class: w(s.message.position),
|
|
474
478
|
embed: s.message.embed
|
|
475
479
|
}, null, 8, ["class", "embed"])) : d("", !0),
|
|
476
|
-
o("div",
|
|
477
|
-
b(
|
|
480
|
+
o("div", Ht, [
|
|
481
|
+
b(dt, {
|
|
478
482
|
reactions: s.message.reactions,
|
|
479
483
|
"message-id": s.message.messageId,
|
|
480
484
|
reply: i(fe)(s.message, "message.audio"),
|
|
481
|
-
enabled:
|
|
485
|
+
enabled: i(he),
|
|
482
486
|
mode: s.reactionsMode,
|
|
483
487
|
"current-user-id": s.currentUserId,
|
|
484
488
|
"reaction-user-names": s.reactionUserNames,
|
|
485
489
|
"menu-enabled": i(S).length > 0,
|
|
486
|
-
onToggleReaction: i(
|
|
487
|
-
onAddReaction: i(
|
|
488
|
-
onRemoveReaction: i(
|
|
489
|
-
onMenu: i(
|
|
490
|
+
onToggleReaction: i(Ze),
|
|
491
|
+
onAddReaction: i(qe),
|
|
492
|
+
onRemoveReaction: i(ze),
|
|
493
|
+
onMenu: i(Ne)
|
|
490
494
|
}, null, 8, ["reactions", "message-id", "reply", "enabled", "mode", "current-user-id", "reaction-user-names", "menu-enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction", "onMenu"]),
|
|
491
|
-
o("div",
|
|
492
|
-
|
|
493
|
-
|
|
495
|
+
o("div", jt, [
|
|
496
|
+
A.value || E.value ? (l(), r("div", Gt, [
|
|
497
|
+
A.value ? (l(), r("button", {
|
|
494
498
|
key: 0,
|
|
495
499
|
class: w([
|
|
496
500
|
"audio-message__action-button",
|
|
497
501
|
{ "audio-message__action-button--active": f.value === "text" }
|
|
498
502
|
]),
|
|
499
503
|
type: "button",
|
|
500
|
-
onClick:
|
|
504
|
+
onClick: Ke
|
|
501
505
|
}, " Текст ", 2)) : d("", !0),
|
|
502
|
-
|
|
506
|
+
E.value ? (l(), r("button", {
|
|
503
507
|
key: 1,
|
|
504
508
|
class: w([
|
|
505
509
|
"audio-message__action-button",
|
|
506
510
|
{ "audio-message__action-button--active": f.value === "summary" }
|
|
507
511
|
]),
|
|
508
512
|
type: "button",
|
|
509
|
-
onClick:
|
|
513
|
+
onClick: Qe
|
|
510
514
|
}, " Резюме ", 2)) : d("", !0)
|
|
511
515
|
])) : d("", !0),
|
|
512
|
-
s.message.views ? (
|
|
516
|
+
s.message.views ? (l(), r("div", {
|
|
513
517
|
key: 1,
|
|
514
518
|
class: "audio-message__views",
|
|
515
519
|
onClick: t[4] || (t[4] = //@ts-ignore
|
|
@@ -518,7 +522,7 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
518
522
|
t[11] || (t[11] = o("span", { class: "pi pi-eye" }, null, -1)),
|
|
519
523
|
o("p", null, p(s.message.views), 1)
|
|
520
524
|
])) : d("", !0),
|
|
521
|
-
o("span",
|
|
525
|
+
o("span", Yt, p(s.message.time), 1),
|
|
522
526
|
b(ge, {
|
|
523
527
|
"base-class": "audio-message",
|
|
524
528
|
"message-class": B(s.message),
|
|
@@ -530,22 +534,22 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
530
534
|
]),
|
|
531
535
|
b(ve, { name: "audio-message-expand" }, {
|
|
532
536
|
default: Z(() => [
|
|
533
|
-
|
|
534
|
-
o("div",
|
|
535
|
-
f.value === "text" ? (
|
|
536
|
-
ee.value ? (
|
|
537
|
+
Oe.value ? (l(), r("div", Zt, [
|
|
538
|
+
o("div", qt, [
|
|
539
|
+
f.value === "text" ? (l(), r(q, { key: 0 }, [
|
|
540
|
+
ee.value ? (l(), r("p", {
|
|
537
541
|
key: 1,
|
|
538
542
|
class: "audio-message__expand-plain",
|
|
539
543
|
innerHTML: X.value
|
|
540
|
-
}, null, 8,
|
|
541
|
-
], 64)) : (
|
|
542
|
-
se.value ? (
|
|
544
|
+
}, null, 8, Wt)) : (l(), r("p", zt, p(Fe.value), 1))
|
|
545
|
+
], 64)) : (l(), r("p", Jt, [
|
|
546
|
+
se.value ? (l(), r("span", {
|
|
543
547
|
key: 1,
|
|
544
548
|
innerHTML: te.value
|
|
545
|
-
}, null, 8,
|
|
549
|
+
}, null, 8, Qt)) : (l(), r("span", Kt, p(Le.value), 1))
|
|
546
550
|
]))
|
|
547
551
|
]),
|
|
548
|
-
o("div",
|
|
552
|
+
o("div", Xt, [
|
|
549
553
|
o("button", {
|
|
550
554
|
type: "button",
|
|
551
555
|
class: "audio-message__expand-close",
|
|
@@ -556,13 +560,13 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
556
560
|
]),
|
|
557
561
|
_: 1
|
|
558
562
|
}),
|
|
559
|
-
b(
|
|
563
|
+
b(ct, {
|
|
560
564
|
status: s.message.status,
|
|
561
565
|
"has-messenger-account": s.message.hasMessengerAccount,
|
|
562
566
|
channel: s.channel,
|
|
563
|
-
onSmsInvite:
|
|
567
|
+
onSmsInvite: Je
|
|
564
568
|
}, null, 8, ["status", "has-messenger-account", "channel"]),
|
|
565
|
-
i(
|
|
569
|
+
i(xe) && i(S).length && !s.reactionsEnabled && i(W) ? (l(), r("button", {
|
|
566
570
|
key: 4,
|
|
567
571
|
class: "audio-message__menu-button",
|
|
568
572
|
onClick: t[6] || (t[6] = //@ts-ignore
|
|
@@ -581,20 +585,20 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
581
585
|
})
|
|
582
586
|
], -1)
|
|
583
587
|
])])) : d("", !0),
|
|
584
|
-
(
|
|
588
|
+
(l(), T(ot, { to: "body" }, [
|
|
585
589
|
b(ve, null, {
|
|
586
590
|
default: Z(() => [
|
|
587
|
-
i(
|
|
591
|
+
i(we) && i(S).length ? (l(), T(ut, {
|
|
588
592
|
key: 0,
|
|
589
593
|
ref_key: "menuRef",
|
|
590
|
-
ref:
|
|
594
|
+
ref: ke,
|
|
591
595
|
class: "audio-message__context-menu message-actions-menu",
|
|
592
|
-
style: Y(i(
|
|
593
|
-
"data-theme": i(
|
|
596
|
+
style: Y(i(Re)),
|
|
597
|
+
"data-theme": i(Te),
|
|
594
598
|
actions: i(S),
|
|
595
|
-
onClick:
|
|
596
|
-
onMouseenter: i(
|
|
597
|
-
onMouseleave: i(
|
|
599
|
+
onClick: Pe,
|
|
600
|
+
onMouseenter: i(_e),
|
|
601
|
+
onMouseleave: i(Ie)
|
|
598
602
|
}, null, 8, ["style", "data-theme", "actions", "onMouseenter", "onMouseleave"])) : d("", !0)
|
|
599
603
|
]),
|
|
600
604
|
_: 1
|
|
@@ -602,9 +606,9 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
602
606
|
]))
|
|
603
607
|
], 64))
|
|
604
608
|
], 34)
|
|
605
|
-
], 46,
|
|
609
|
+
], 46, Tt));
|
|
606
610
|
}
|
|
607
611
|
});
|
|
608
612
|
export {
|
|
609
|
-
|
|
613
|
+
Os as default
|
|
610
614
|
};
|