@bcc-code/vue-bcc-chat-ui 7.1.7 → 7.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/vue-bcc-chat-ui.js +1170 -1134
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as
|
|
2
|
-
import { BccAvatar as
|
|
3
|
-
import { CometChat as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as te, withModifiers as L } from "vue";
|
|
2
|
+
import { BccAvatar as R, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as V, BccMessage as ae, BccProgressSpinner as H, BccTag as oe } from "@bcc-code/component-library-vue";
|
|
3
|
+
import { CometChat as U } from "@cometchat/chat-sdk-javascript";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
|
-
var
|
|
5
|
+
var se = Object.defineProperty, ce = (e, t) => {
|
|
6
6
|
let n = {};
|
|
7
|
-
for (var r in e)
|
|
7
|
+
for (var r in e) se(n, r, {
|
|
8
8
|
get: e[r],
|
|
9
9
|
enumerable: !0
|
|
10
10
|
});
|
|
11
|
-
return t ||
|
|
12
|
-
},
|
|
11
|
+
return t || se(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
12
|
+
}, le = {
|
|
13
13
|
prod: {
|
|
14
14
|
region: "eu",
|
|
15
15
|
appId: "2520339d45a9d557",
|
|
@@ -20,62 +20,62 @@ var ce = Object.defineProperty, le = (e, t) => {
|
|
|
20
20
|
appId: "24847302853e129f",
|
|
21
21
|
chatApiBaseUrl: "https://chat.api.sandbox.bcc.no"
|
|
22
22
|
}
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
|
|
23
|
+
}, ue = null;
|
|
24
|
+
function de(e) {
|
|
25
|
+
ue = e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
if (!
|
|
29
|
-
return ue
|
|
27
|
+
function W() {
|
|
28
|
+
if (!ue) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
|
|
29
|
+
return le[ue];
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/chat/accessToken.ts
|
|
33
|
-
var
|
|
34
|
-
function
|
|
35
|
-
return `${
|
|
33
|
+
var fe = ":loginAccessToken", pe = ":token", me = void 0;
|
|
34
|
+
function he(e) {
|
|
35
|
+
return `${W().appId}${e}`;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function ge() {
|
|
38
|
+
return me === void 0 && (me = localStorage.getItem(he(fe))), me;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
let t =
|
|
40
|
+
function _e(e) {
|
|
41
|
+
me = e;
|
|
42
|
+
let t = he(fe);
|
|
43
43
|
if (e) {
|
|
44
44
|
localStorage.setItem(t, e);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
localStorage.removeItem(t);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let e =
|
|
49
|
+
function ve() {
|
|
50
|
+
let e = he(pe), t = localStorage.getItem(e);
|
|
51
51
|
return t ? JSON.parse(t) : null;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
53
|
+
function ye() {
|
|
54
|
+
return ve();
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
localStorage.setItem(
|
|
56
|
+
function be(e) {
|
|
57
|
+
localStorage.setItem(he(pe), JSON.stringify(e));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
localStorage.removeItem(
|
|
59
|
+
function xe() {
|
|
60
|
+
localStorage.removeItem(he(pe));
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/chat/avatar.ts
|
|
64
|
-
function
|
|
65
|
-
let t =
|
|
64
|
+
function Se(e) {
|
|
65
|
+
let t = we(e);
|
|
66
66
|
if (!t) return;
|
|
67
67
|
let n = t.trim();
|
|
68
68
|
if (n) {
|
|
69
69
|
try {
|
|
70
|
-
if (
|
|
70
|
+
if (Te(new URL(n))) return `${W().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
|
|
71
71
|
} catch {}
|
|
72
72
|
return n;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
75
|
+
function Ce(e) {
|
|
76
|
+
return Se(e) ?? e;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function we(e) {
|
|
79
79
|
if (typeof e == "string") return e;
|
|
80
80
|
if (!e || typeof e != "object") return;
|
|
81
81
|
let t = e, n = [
|
|
@@ -93,36 +93,36 @@ function Te(e) {
|
|
|
93
93
|
t.avatar,
|
|
94
94
|
t.image
|
|
95
95
|
].find((e) => e && typeof e == "object");
|
|
96
|
-
if (r) return
|
|
96
|
+
if (r) return we(r);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
let { appId: t, region: n } =
|
|
98
|
+
function Te(e) {
|
|
99
|
+
let { appId: t, region: n } = W(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
|
|
100
100
|
return e.hostname.toLowerCase() === r.toLowerCase() && e.pathname.startsWith(i);
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/chat/cacheScope.ts
|
|
104
|
-
var
|
|
105
|
-
function
|
|
106
|
-
return `${
|
|
104
|
+
var Ee = ":chatCacheScope", De = ":chatCacheOwner", G, Oe;
|
|
105
|
+
function ke(e) {
|
|
106
|
+
return `${W().appId}${e}`;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Ae() {
|
|
109
109
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
111
|
+
function je() {
|
|
112
|
+
return G === void 0 && (G = localStorage.getItem(ke(Ee))), G;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
114
|
+
function Me() {
|
|
115
|
+
return Oe === void 0 && (Oe = localStorage.getItem(ke(De))), Oe;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
let t =
|
|
117
|
+
function Ne(e) {
|
|
118
|
+
let t = je(), n = Me();
|
|
119
119
|
if (t && n === e) return t;
|
|
120
|
-
let r =
|
|
121
|
-
return
|
|
120
|
+
let r = Ae();
|
|
121
|
+
return G = r, Oe = e, localStorage.setItem(ke(Ee), r), localStorage.setItem(ke(De), e), r;
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/chat/localization.ts
|
|
125
|
-
var
|
|
125
|
+
var Pe = {
|
|
126
126
|
en: {
|
|
127
127
|
addOption: "Add option",
|
|
128
128
|
addToMessage: "Add to message",
|
|
@@ -361,134 +361,134 @@ var Fe = {
|
|
|
361
361
|
you: "Du",
|
|
362
362
|
youSentAMessage: "Du sendte en melding"
|
|
363
363
|
}
|
|
364
|
-
},
|
|
365
|
-
function
|
|
364
|
+
}, Fe = w("en");
|
|
365
|
+
function Ie(e) {
|
|
366
366
|
return e === "nb" || e === "no" ? "nb" : "en";
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
return
|
|
368
|
+
function K(e) {
|
|
369
|
+
return Ie(e) === "nb" ? "nb-NO" : "en-US";
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function Le() {
|
|
372
372
|
return "h23";
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
|
|
374
|
+
function Re(e) {
|
|
375
|
+
Fe.value = e;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
let r =
|
|
377
|
+
function ze(e, t, n) {
|
|
378
|
+
let r = Pe[Ie(n ?? Fe.value)][e] ?? Pe.en[e];
|
|
379
379
|
return typeof r == "function" ? r(t ?? {}) : r;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
let t = n(() => A(e) ??
|
|
381
|
+
function q(e) {
|
|
382
|
+
let t = n(() => A(e) ?? Fe.value);
|
|
383
383
|
return {
|
|
384
|
-
locale: n(() =>
|
|
385
|
-
t: (e, n) =>
|
|
384
|
+
locale: n(() => K(t.value)),
|
|
385
|
+
t: (e, n) => ze(e, n, t.value)
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/chat/mentions.ts
|
|
390
|
-
var
|
|
391
|
-
function
|
|
390
|
+
var Be = /<@uid:([^>]+)>/g, Ve = /<@uid:([^&]+)>/g, He = "mention:", Ue = "", We = "data-mention-uid", Ge = "composer-mention", Ke = "message-mention";
|
|
391
|
+
function qe(e) {
|
|
392
392
|
return {
|
|
393
393
|
uid: e.uid,
|
|
394
394
|
displayName: e.displayName,
|
|
395
395
|
avatar: e.avatar
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function Je(e) {
|
|
399
399
|
let t = {};
|
|
400
400
|
for (let n of e) t[n.uid] = n.displayName;
|
|
401
401
|
return t;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Ye(e, t, n = 8) {
|
|
404
404
|
let r = t.trim().toLowerCase(), i = e.filter((e) => e.displayName.trim().length > 0);
|
|
405
405
|
return r ? i.filter((e) => {
|
|
406
406
|
let t = e.displayName.toLowerCase(), n = e.uid.toLowerCase();
|
|
407
407
|
return t.includes(r) || n.includes(r);
|
|
408
408
|
}).slice(0, n) : i.slice(0, n);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function Xe(e) {
|
|
411
411
|
return `<@uid:${e}>`;
|
|
412
412
|
}
|
|
413
|
+
function Ze(e) {
|
|
414
|
+
return e.replace(Ve, (e, t) => Xe(t));
|
|
415
|
+
}
|
|
413
416
|
function Qe(e) {
|
|
414
|
-
return
|
|
417
|
+
return Be.lastIndex = 0, Ve.lastIndex = 0, Be.test(e) || Ve.test(e);
|
|
415
418
|
}
|
|
416
419
|
function $e(e) {
|
|
417
|
-
return Ve.lastIndex = 0, He.lastIndex = 0, Ve.test(e) || He.test(e);
|
|
418
|
-
}
|
|
419
|
-
function et(e) {
|
|
420
420
|
let t = [];
|
|
421
421
|
return {
|
|
422
|
-
shielded:
|
|
422
|
+
shielded: Ze(e).replace(Be, (e) => `${He}${t.push(e) - 1}${Ue}`),
|
|
423
423
|
tokens: t
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
let n = RegExp(`${
|
|
426
|
+
function et(e, t) {
|
|
427
|
+
let n = RegExp(`${He.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${Ue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
|
|
428
428
|
return e.replace(n, (e, n) => t[Number(n)] ?? "");
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
return e.replace(
|
|
430
|
+
function tt(e, t, n = Ke) {
|
|
431
|
+
return e.replace(Be, (e, r) => {
|
|
432
432
|
let i = t(r).trim() || r;
|
|
433
|
-
return `<span class="${n}" ${
|
|
433
|
+
return `<span class="${n}" ${We}="${dt(r)}">@${ft(i)}</span>`;
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function nt(e, t = {}) {
|
|
437
|
+
return tt(e, (e) => t[e] ?? e, Ge);
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
439
|
+
function rt(e, t = {}) {
|
|
440
|
+
return tt(e, (e) => t[e] ?? e, Ke);
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function it(e) {
|
|
443
443
|
if (!e) return "";
|
|
444
444
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
|
|
445
445
|
if (!n) return e;
|
|
446
|
-
for (let e of [...n.querySelectorAll(`span[${
|
|
447
|
-
let n = e.getAttribute(
|
|
448
|
-
n && e.replaceWith(t.createTextNode(
|
|
446
|
+
for (let e of [...n.querySelectorAll(`span[${We}]`)]) {
|
|
447
|
+
let n = e.getAttribute(We);
|
|
448
|
+
n && e.replaceWith(t.createTextNode(Xe(n)));
|
|
449
449
|
}
|
|
450
|
-
return
|
|
450
|
+
return at(n.innerHTML);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function at(e) {
|
|
453
453
|
return e.replace(/<@uid:([^&]+)>/g, "<@uid:$1>");
|
|
454
454
|
}
|
|
455
|
-
var
|
|
456
|
-
function
|
|
455
|
+
var ot = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
|
|
456
|
+
function st(e, t, n = "member") {
|
|
457
457
|
return t[e]?.trim() || n;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
let t =
|
|
461
|
-
for (let
|
|
462
|
-
let
|
|
463
|
-
|
|
459
|
+
function ct(e) {
|
|
460
|
+
let t = {};
|
|
461
|
+
for (let n of e?.getMentionedUsers?.() ?? []) {
|
|
462
|
+
let e = n.getUid?.(), r = n.getName?.()?.trim();
|
|
463
|
+
e && r && (t[e] = r);
|
|
464
464
|
}
|
|
465
|
-
return
|
|
465
|
+
return t;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function lt(...e) {
|
|
468
468
|
let t = {};
|
|
469
469
|
for (let n of e) Object.assign(t, n);
|
|
470
470
|
return t;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
return
|
|
472
|
+
function ut(e, t = {}) {
|
|
473
|
+
return Ze(e).replace(Be, (e, n) => `@${st(n, t)}`).replace(ot, (e, n) => `@${st(n, t)}`);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function dt(e) {
|
|
476
476
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function ft(e) {
|
|
479
479
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
480
480
|
}
|
|
481
481
|
//#endregion
|
|
482
482
|
//#region node_modules/dompurify/dist/purify.es.mjs
|
|
483
|
-
function
|
|
483
|
+
function pt(e, t) {
|
|
484
484
|
(t == null || t > e.length) && (t = e.length);
|
|
485
485
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
486
486
|
return r;
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function mt(e) {
|
|
489
489
|
if (Array.isArray(e)) return e;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function ht(e, t) {
|
|
492
492
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
493
493
|
if (n != null) {
|
|
494
494
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -506,99 +506,99 @@ function gt(e, t) {
|
|
|
506
506
|
return s;
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function gt() {
|
|
510
510
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
return
|
|
512
|
+
function _t(e, t) {
|
|
513
|
+
return mt(e) || ht(e, t) || vt(e, t) || gt();
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function vt(e, t) {
|
|
516
516
|
if (e) {
|
|
517
|
-
if (typeof e == "string") return
|
|
517
|
+
if (typeof e == "string") return pt(e, t);
|
|
518
518
|
var n = {}.toString.call(e).slice(8, -1);
|
|
519
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
519
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? pt(e, t) : void 0;
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
var
|
|
523
|
-
|
|
522
|
+
var yt = Object.entries, bt = Object.setPrototypeOf, xt = Object.isFrozen, St = Object.getPrototypeOf, Ct = Object.getOwnPropertyDescriptor, wt = Object.freeze, Tt = Object.seal, Et = Object.create, Dt = typeof Reflect < "u" && Reflect, Ot = Dt.apply, kt = Dt.construct;
|
|
523
|
+
wt ||= function(e) {
|
|
524
524
|
return e;
|
|
525
|
-
},
|
|
525
|
+
}, Tt ||= function(e) {
|
|
526
526
|
return e;
|
|
527
|
-
},
|
|
527
|
+
}, Ot ||= function(e, t) {
|
|
528
528
|
var n = [...arguments].slice(2);
|
|
529
529
|
return e.apply(t, n);
|
|
530
|
-
},
|
|
530
|
+
}, kt ||= function(e) {
|
|
531
531
|
return new e(...[...arguments].slice(1));
|
|
532
532
|
};
|
|
533
|
-
var
|
|
534
|
-
function
|
|
533
|
+
var At = Jt(Array.prototype.forEach), jt = Jt(Array.prototype.lastIndexOf), Mt = Jt(Array.prototype.pop), Nt = Jt(Array.prototype.push), Pt = Jt(Array.prototype.splice), J = Array.isArray, Ft = Jt(String.prototype.toLowerCase), It = Jt(String.prototype.toString), Lt = Jt(String.prototype.match), Rt = Jt(String.prototype.replace), zt = Jt(String.prototype.indexOf), Bt = Jt(String.prototype.trim), Vt = Jt(Number.prototype.toString), Ht = Jt(Boolean.prototype.toString), Ut = typeof BigInt > "u" ? null : Jt(BigInt.prototype.toString), Wt = typeof Symbol > "u" ? null : Jt(Symbol.prototype.toString), Y = Jt(Object.prototype.hasOwnProperty), Gt = Jt(Object.prototype.toString), Kt = Jt(RegExp.prototype.test), qt = Yt(TypeError);
|
|
534
|
+
function Jt(e) {
|
|
535
535
|
return function(t) {
|
|
536
536
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
537
537
|
var n = [...arguments].slice(1);
|
|
538
|
-
return
|
|
538
|
+
return Ot(e, t, n);
|
|
539
539
|
};
|
|
540
540
|
}
|
|
541
541
|
function Yt(e) {
|
|
542
542
|
return function() {
|
|
543
|
-
return
|
|
543
|
+
return kt(e, [...arguments]);
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
function X(e, t) {
|
|
547
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
548
|
-
if (
|
|
547
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ft;
|
|
548
|
+
if (bt && bt(e, null), !J(t)) return e;
|
|
549
549
|
let r = t.length;
|
|
550
550
|
for (; r--;) {
|
|
551
551
|
let i = t[r];
|
|
552
552
|
if (typeof i == "string") {
|
|
553
553
|
let e = n(i);
|
|
554
|
-
e !== i && (
|
|
554
|
+
e !== i && (xt(t) || (t[r] = e), i = e);
|
|
555
555
|
}
|
|
556
556
|
e[i] = !0;
|
|
557
557
|
}
|
|
558
558
|
return e;
|
|
559
559
|
}
|
|
560
560
|
function Xt(e) {
|
|
561
|
-
for (let t = 0; t < e.length; t++)
|
|
561
|
+
for (let t = 0; t < e.length; t++) Y(e, t) || (e[t] = null);
|
|
562
562
|
return e;
|
|
563
563
|
}
|
|
564
564
|
function Zt(e) {
|
|
565
|
-
let t =
|
|
566
|
-
for (let r of
|
|
567
|
-
var n =
|
|
565
|
+
let t = Et(null);
|
|
566
|
+
for (let r of yt(e)) {
|
|
567
|
+
var n = _t(r, 2);
|
|
568
568
|
let i = n[0], a = n[1];
|
|
569
|
-
|
|
569
|
+
Y(e, i) && (J(a) ? t[i] = Xt(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = Zt(a) : t[i] = a);
|
|
570
570
|
}
|
|
571
571
|
return t;
|
|
572
572
|
}
|
|
573
573
|
function Qt(e) {
|
|
574
574
|
switch (typeof e) {
|
|
575
575
|
case "string": return e;
|
|
576
|
-
case "number": return
|
|
577
|
-
case "boolean": return
|
|
578
|
-
case "bigint": return
|
|
579
|
-
case "symbol": return
|
|
580
|
-
case "undefined": return
|
|
576
|
+
case "number": return Vt(e);
|
|
577
|
+
case "boolean": return Ht(e);
|
|
578
|
+
case "bigint": return Ut ? Ut(e) : "0";
|
|
579
|
+
case "symbol": return Wt ? Wt(e) : "Symbol()";
|
|
580
|
+
case "undefined": return Gt(e);
|
|
581
581
|
case "function":
|
|
582
582
|
case "object": {
|
|
583
|
-
if (e === null) return
|
|
583
|
+
if (e === null) return Gt(e);
|
|
584
584
|
let t = e, n = $t(t, "toString");
|
|
585
585
|
if (typeof n == "function") {
|
|
586
586
|
let e = n(t);
|
|
587
|
-
return typeof e == "string" ? e :
|
|
587
|
+
return typeof e == "string" ? e : Gt(e);
|
|
588
588
|
}
|
|
589
|
-
return
|
|
589
|
+
return Gt(e);
|
|
590
590
|
}
|
|
591
|
-
default: return
|
|
591
|
+
default: return Gt(e);
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
function $t(e, t) {
|
|
595
595
|
for (; e !== null;) {
|
|
596
|
-
let n =
|
|
596
|
+
let n = Ct(e, t);
|
|
597
597
|
if (n) {
|
|
598
|
-
if (n.get) return
|
|
599
|
-
if (typeof n.value == "function") return
|
|
598
|
+
if (n.get) return Jt(n.get);
|
|
599
|
+
if (typeof n.value == "function") return Jt(n.value);
|
|
600
600
|
}
|
|
601
|
-
e =
|
|
601
|
+
e = St(e);
|
|
602
602
|
}
|
|
603
603
|
function n() {
|
|
604
604
|
return null;
|
|
@@ -607,12 +607,12 @@ function $t(e, t) {
|
|
|
607
607
|
}
|
|
608
608
|
function en(e) {
|
|
609
609
|
try {
|
|
610
|
-
return
|
|
610
|
+
return Kt(e, ""), !0;
|
|
611
611
|
} catch {
|
|
612
612
|
return !1;
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
var tn =
|
|
615
|
+
var tn = wt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), nn = wt(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), rn = wt([
|
|
616
616
|
"feBlend",
|
|
617
617
|
"feColorMatrix",
|
|
618
618
|
"feComponentTransfer",
|
|
@@ -638,7 +638,7 @@ var tn = Tt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
638
638
|
"feSpotLight",
|
|
639
639
|
"feTile",
|
|
640
640
|
"feTurbulence"
|
|
641
|
-
]), an =
|
|
641
|
+
]), an = wt([
|
|
642
642
|
"animate",
|
|
643
643
|
"color-profile",
|
|
644
644
|
"cursor",
|
|
@@ -661,7 +661,7 @@ var tn = Tt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
661
661
|
"solidcolor",
|
|
662
662
|
"unknown",
|
|
663
663
|
"use"
|
|
664
|
-
]), on =
|
|
664
|
+
]), on = wt(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), sn = wt([
|
|
665
665
|
"maction",
|
|
666
666
|
"maligngroup",
|
|
667
667
|
"malignmark",
|
|
@@ -677,13 +677,13 @@ var tn = Tt(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
677
677
|
"annotation-xml",
|
|
678
678
|
"mprescripts",
|
|
679
679
|
"none"
|
|
680
|
-
]), cn =
|
|
680
|
+
]), cn = wt(["#text"]), ln = wt(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), un = wt(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), dn = wt(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), fn = wt([
|
|
681
681
|
"xlink:href",
|
|
682
682
|
"xml:id",
|
|
683
683
|
"xlink:title",
|
|
684
684
|
"xml:space",
|
|
685
685
|
"xmlns:xlink"
|
|
686
|
-
]), pn =
|
|
686
|
+
]), pn = Tt(/{{[\w\W]*|^[\w\W]*}}/g), mn = Tt(/<%[\w\W]*|^[\w\W]*%>/g), hn = Tt(/\${[\w\W]*/g), gn = Tt(/^data-[\-\w.\u00B7-\uFFFF]+$/), _n = Tt(/^aria-[\-\w]+$/), vn = Tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yn = Tt(/^(?:\w+script|data):/i), bn = Tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), xn = Tt(/^html$/i), Sn = Tt(/^[a-z][.\w]*(-[.\w]+)+$/i), Cn = {
|
|
687
687
|
element: 1,
|
|
688
688
|
text: 3,
|
|
689
689
|
progressingInstruction: 7,
|
|
@@ -730,19 +730,19 @@ function Dn() {
|
|
|
730
730
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
731
731
|
}
|
|
732
732
|
let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = En();
|
|
733
|
-
t.isSupported = typeof
|
|
734
|
-
let A = pn, j = mn,
|
|
733
|
+
t.isSupported = typeof yt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
|
|
734
|
+
let A = pn, j = mn, M = hn, ee = gn, N = _n, P = yn, F = bn, I = Sn, te = vn, L = null, R = X({}, [
|
|
735
735
|
...tn,
|
|
736
736
|
...nn,
|
|
737
737
|
...rn,
|
|
738
738
|
...on,
|
|
739
739
|
...cn
|
|
740
|
-
]),
|
|
740
|
+
]), z = null, ne = X({}, [
|
|
741
741
|
...ln,
|
|
742
742
|
...un,
|
|
743
743
|
...dn,
|
|
744
744
|
...fn
|
|
745
|
-
]),
|
|
745
|
+
]), B = Object.seal(Et(null, {
|
|
746
746
|
tagNameCheck: {
|
|
747
747
|
writable: !0,
|
|
748
748
|
configurable: !1,
|
|
@@ -761,7 +761,7 @@ function Dn() {
|
|
|
761
761
|
enumerable: !0,
|
|
762
762
|
value: !1
|
|
763
763
|
}
|
|
764
|
-
})),
|
|
764
|
+
})), re = null, ie = null, V = Object.seal(Et(null, {
|
|
765
765
|
tagCheck: {
|
|
766
766
|
writable: !0,
|
|
767
767
|
configurable: !1,
|
|
@@ -774,7 +774,7 @@ function Dn() {
|
|
|
774
774
|
enumerable: !0,
|
|
775
775
|
value: null
|
|
776
776
|
}
|
|
777
|
-
})),
|
|
777
|
+
})), ae = !0, H = !0, oe = !1, U = !0, se = !1, ce = !0, le = !1, ue = !1, de = !1, W = !1, fe = !1, pe = !1, me = !0, he = !1, ge = "user-content-", _e = !0, ve = !1, ye = {}, be = null, xe = X({}, [
|
|
778
778
|
"annotation-xml",
|
|
779
779
|
"audio",
|
|
780
780
|
"colgroup",
|
|
@@ -800,14 +800,14 @@ function Dn() {
|
|
|
800
800
|
"title",
|
|
801
801
|
"video",
|
|
802
802
|
"xmp"
|
|
803
|
-
]),
|
|
803
|
+
]), Se = null, Ce = X({}, [
|
|
804
804
|
"audio",
|
|
805
805
|
"video",
|
|
806
806
|
"img",
|
|
807
807
|
"source",
|
|
808
808
|
"image",
|
|
809
809
|
"track"
|
|
810
|
-
]),
|
|
810
|
+
]), we = null, Te = X({}, [
|
|
811
811
|
"alt",
|
|
812
812
|
"class",
|
|
813
813
|
"for",
|
|
@@ -822,125 +822,125 @@ function Dn() {
|
|
|
822
822
|
"value",
|
|
823
823
|
"style",
|
|
824
824
|
"xmlns"
|
|
825
|
-
]),
|
|
825
|
+
]), Ee = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xhtml", Oe = G, ke = !1, Ae = null, je = X({}, [
|
|
826
|
+
Ee,
|
|
826
827
|
De,
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
], Lt), Ne = X({}, [
|
|
828
|
+
G
|
|
829
|
+
], It), Me = X({}, [
|
|
830
830
|
"mi",
|
|
831
831
|
"mo",
|
|
832
832
|
"mn",
|
|
833
833
|
"ms",
|
|
834
834
|
"mtext"
|
|
835
|
-
]),
|
|
835
|
+
]), Ne = X({}, ["annotation-xml"]), Pe = X({}, [
|
|
836
836
|
"title",
|
|
837
837
|
"style",
|
|
838
838
|
"font",
|
|
839
839
|
"a",
|
|
840
840
|
"script"
|
|
841
|
-
]),
|
|
841
|
+
]), Fe = null, Ie = ["application/xhtml+xml", "text/html"], K = null, Le = null, Re = n.createElement("form"), ze = function(e) {
|
|
842
842
|
return e instanceof RegExp || e instanceof Function;
|
|
843
|
-
},
|
|
843
|
+
}, q = function() {
|
|
844
844
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
845
|
-
if (
|
|
846
|
-
(!e || typeof e != "object") && (e = {}), e = Zt(e),
|
|
845
|
+
if (Le && Le === e) return;
|
|
846
|
+
(!e || typeof e != "object") && (e = {}), e = Zt(e), Fe = Ie.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, K = Fe === "application/xhtml+xml" ? It : Ft, L = Y(e, "ALLOWED_TAGS") && J(e.ALLOWED_TAGS) ? X({}, e.ALLOWED_TAGS, K) : R, z = Y(e, "ALLOWED_ATTR") && J(e.ALLOWED_ATTR) ? X({}, e.ALLOWED_ATTR, K) : ne, Ae = Y(e, "ALLOWED_NAMESPACES") && J(e.ALLOWED_NAMESPACES) ? X({}, e.ALLOWED_NAMESPACES, It) : je, we = Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) ? X(Zt(Te), e.ADD_URI_SAFE_ATTR, K) : Te, Se = Y(e, "ADD_DATA_URI_TAGS") && J(e.ADD_DATA_URI_TAGS) ? X(Zt(Ce), e.ADD_DATA_URI_TAGS, K) : Ce, be = Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) ? X({}, e.FORBID_CONTENTS, K) : xe, re = Y(e, "FORBID_TAGS") && J(e.FORBID_TAGS) ? X({}, e.FORBID_TAGS, K) : Zt({}), ie = Y(e, "FORBID_ATTR") && J(e.FORBID_ATTR) ? X({}, e.FORBID_ATTR, K) : Zt({}), ye = Y(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Zt(e.USE_PROFILES) : e.USE_PROFILES : !1, ae = e.ALLOW_ARIA_ATTR !== !1, H = e.ALLOW_DATA_ATTR !== !1, oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, U = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, se = e.SAFE_FOR_TEMPLATES || !1, ce = e.SAFE_FOR_XML !== !1, le = e.WHOLE_DOCUMENT || !1, W = e.RETURN_DOM || !1, fe = e.RETURN_DOM_FRAGMENT || !1, pe = e.RETURN_TRUSTED_TYPE || !1, de = e.FORCE_BODY || !1, me = e.SANITIZE_DOM !== !1, he = e.SANITIZE_NAMED_PROPS || !1, _e = e.KEEP_CONTENT !== !1, ve = e.IN_PLACE || !1, te = en(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vn, Oe = typeof e.NAMESPACE == "string" ? e.NAMESPACE : G, Me = Y(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Zt(e.MATHML_TEXT_INTEGRATION_POINTS) : X({}, [
|
|
847
847
|
"mi",
|
|
848
848
|
"mo",
|
|
849
849
|
"mn",
|
|
850
850
|
"ms",
|
|
851
851
|
"mtext"
|
|
852
|
-
]),
|
|
853
|
-
let t =
|
|
854
|
-
if (
|
|
852
|
+
]), Ne = Y(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Zt(e.HTML_INTEGRATION_POINTS) : X({}, ["annotation-xml"]);
|
|
853
|
+
let t = Y(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Zt(e.CUSTOM_ELEMENT_HANDLING) : Et(null);
|
|
854
|
+
if (B = Et(null), Y(t, "tagNameCheck") && ze(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), Y(t, "attributeNameCheck") && ze(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), Y(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), se && (H = !1), fe && (W = !0), ye && (L = X({}, cn), z = Et(null), ye.html === !0 && (X(L, tn), X(z, ln)), ye.svg === !0 && (X(L, nn), X(z, un), X(z, fn)), ye.svgFilters === !0 && (X(L, rn), X(z, un), X(z, fn)), ye.mathMl === !0 && (X(L, on), X(z, dn), X(z, fn))), V.tagCheck = null, V.attributeCheck = null, Y(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? V.tagCheck = e.ADD_TAGS : J(e.ADD_TAGS) && (L === R && (L = Zt(L)), X(L, e.ADD_TAGS, K))), Y(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? V.attributeCheck = e.ADD_ATTR : J(e.ADD_ATTR) && (z === ne && (z = Zt(z)), X(z, e.ADD_ATTR, K))), Y(e, "ADD_URI_SAFE_ATTR") && J(e.ADD_URI_SAFE_ATTR) && X(we, e.ADD_URI_SAFE_ATTR, K), Y(e, "FORBID_CONTENTS") && J(e.FORBID_CONTENTS) && (be === xe && (be = Zt(be)), X(be, e.FORBID_CONTENTS, K)), Y(e, "ADD_FORBID_CONTENTS") && J(e.ADD_FORBID_CONTENTS) && (be === xe && (be = Zt(be)), X(be, e.ADD_FORBID_CONTENTS, K)), _e && (L["#text"] = !0), le && X(L, [
|
|
855
855
|
"html",
|
|
856
856
|
"head",
|
|
857
857
|
"body"
|
|
858
|
-
]),
|
|
859
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
860
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
858
|
+
]), L.table && (X(L, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
859
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw qt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
860
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw qt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
861
861
|
x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
|
|
862
862
|
} else x === void 0 && (x = Tn(m, i)), x !== null && typeof S == "string" && (S = x.createHTML(""));
|
|
863
|
-
|
|
864
|
-
},
|
|
863
|
+
wt && wt(e), Le = e;
|
|
864
|
+
}, Be = X({}, [
|
|
865
865
|
...nn,
|
|
866
866
|
...rn,
|
|
867
867
|
...an
|
|
868
|
-
]),
|
|
868
|
+
]), Ve = X({}, [...on, ...sn]), He = function(e) {
|
|
869
869
|
let t = b(e);
|
|
870
870
|
(!t || !t.tagName) && (t = {
|
|
871
|
-
namespaceURI:
|
|
871
|
+
namespaceURI: Oe,
|
|
872
872
|
tagName: "template"
|
|
873
873
|
});
|
|
874
|
-
let n =
|
|
875
|
-
return
|
|
876
|
-
},
|
|
877
|
-
|
|
874
|
+
let n = Ft(e.tagName), r = Ft(t.tagName);
|
|
875
|
+
return Ae[e.namespaceURI] ? e.namespaceURI === De ? t.namespaceURI === G ? n === "svg" : t.namespaceURI === Ee ? n === "svg" && (r === "annotation-xml" || Me[r]) : !!Be[n] : e.namespaceURI === Ee ? t.namespaceURI === G ? n === "math" : t.namespaceURI === De ? n === "math" && Ne[r] : !!Ve[n] : e.namespaceURI === G ? t.namespaceURI === De && !Ne[r] || t.namespaceURI === Ee && !Me[r] ? !1 : !Ve[n] && (Pe[n] || !Be[n]) : !!(Fe === "application/xhtml+xml" && Ae[e.namespaceURI]) : !1;
|
|
876
|
+
}, Ue = function(e) {
|
|
877
|
+
Nt(t.removed, { element: e });
|
|
878
878
|
try {
|
|
879
879
|
b(e).removeChild(e);
|
|
880
880
|
} catch {
|
|
881
881
|
_(e);
|
|
882
882
|
}
|
|
883
|
-
},
|
|
883
|
+
}, We = function(e, n) {
|
|
884
884
|
try {
|
|
885
|
-
|
|
885
|
+
Nt(t.removed, {
|
|
886
886
|
attribute: n.getAttributeNode(e),
|
|
887
887
|
from: n
|
|
888
888
|
});
|
|
889
889
|
} catch {
|
|
890
|
-
|
|
890
|
+
Nt(t.removed, {
|
|
891
891
|
attribute: null,
|
|
892
892
|
from: n
|
|
893
893
|
});
|
|
894
894
|
}
|
|
895
|
-
if (n.removeAttribute(e), e === "is") if (
|
|
896
|
-
|
|
895
|
+
if (n.removeAttribute(e), e === "is") if (W || fe) try {
|
|
896
|
+
Ue(n);
|
|
897
897
|
} catch {}
|
|
898
898
|
else try {
|
|
899
899
|
n.setAttribute(e, "");
|
|
900
900
|
} catch {}
|
|
901
|
-
},
|
|
901
|
+
}, Ge = function(e) {
|
|
902
902
|
let t = null, r = null;
|
|
903
|
-
if (
|
|
903
|
+
if (de) e = "<remove></remove>" + e;
|
|
904
904
|
else {
|
|
905
|
-
let t =
|
|
905
|
+
let t = Lt(e, /^[\r\n\t ]+/);
|
|
906
906
|
r = t && t[0];
|
|
907
907
|
}
|
|
908
|
-
|
|
908
|
+
Fe === "application/xhtml+xml" && Oe === G && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
909
909
|
let i = x ? x.createHTML(e) : e;
|
|
910
|
-
if (
|
|
911
|
-
t = new p().parseFromString(i,
|
|
910
|
+
if (Oe === G) try {
|
|
911
|
+
t = new p().parseFromString(i, Fe);
|
|
912
912
|
} catch {}
|
|
913
913
|
if (!t || !t.documentElement) {
|
|
914
|
-
t = w.createDocument(
|
|
914
|
+
t = w.createDocument(Oe, "template", null);
|
|
915
915
|
try {
|
|
916
|
-
t.documentElement.innerHTML =
|
|
916
|
+
t.documentElement.innerHTML = ke ? S : i;
|
|
917
917
|
} catch {}
|
|
918
918
|
}
|
|
919
919
|
let a = t.body || t.documentElement;
|
|
920
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
921
|
-
},
|
|
920
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Oe === G ? D.call(t, le ? "html" : "body")[0] : le ? t.documentElement : a;
|
|
921
|
+
}, Ke = function(e) {
|
|
922
922
|
return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
923
|
-
},
|
|
923
|
+
}, qe = function(e) {
|
|
924
924
|
return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
925
|
-
},
|
|
925
|
+
}, Je = function(e) {
|
|
926
926
|
return typeof s == "function" && e instanceof s;
|
|
927
927
|
};
|
|
928
|
-
function
|
|
929
|
-
|
|
930
|
-
e.call(t, n, r,
|
|
928
|
+
function Ye(e, n, r) {
|
|
929
|
+
At(e, (e) => {
|
|
930
|
+
e.call(t, n, r, Le);
|
|
931
931
|
});
|
|
932
932
|
}
|
|
933
|
-
let
|
|
933
|
+
let Xe = function(e) {
|
|
934
934
|
let n = null;
|
|
935
|
-
if (
|
|
936
|
-
let r =
|
|
937
|
-
if (
|
|
935
|
+
if (Ye(k.beforeSanitizeElements, e, null), qe(e)) return Ue(e), !0;
|
|
936
|
+
let r = K(e.nodeName);
|
|
937
|
+
if (Ye(k.uponSanitizeElement, e, {
|
|
938
938
|
tagName: r,
|
|
939
|
-
allowedTags:
|
|
940
|
-
}),
|
|
941
|
-
if (
|
|
942
|
-
if (!
|
|
943
|
-
if (
|
|
939
|
+
allowedTags: L
|
|
940
|
+
}), ce && e.hasChildNodes() && !Je(e.firstElementChild) && Kt(/<[/\w!]/g, e.innerHTML) && Kt(/<[/\w!]/g, e.textContent) || ce && e.namespaceURI === G && r === "style" && Je(e.firstElementChild) || e.nodeType === Cn.progressingInstruction || ce && e.nodeType === Cn.comment && Kt(/<[/\w]/g, e.data)) return Ue(e), !0;
|
|
941
|
+
if (re[r] || !(V.tagCheck instanceof Function && V.tagCheck(r)) && !L[r]) {
|
|
942
|
+
if (!re[r] && $e(r) && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
|
|
943
|
+
if (_e && !be[r]) {
|
|
944
944
|
let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
|
|
945
945
|
if (n && t) {
|
|
946
946
|
let r = n.length;
|
|
@@ -950,25 +950,25 @@ function Dn() {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
return
|
|
953
|
+
return Ue(e), !0;
|
|
954
954
|
}
|
|
955
|
-
return e instanceof c && !
|
|
955
|
+
return e instanceof c && !He(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Kt(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ue(e), !0) : (se && e.nodeType === Cn.text && (n = e.textContent, At([
|
|
956
956
|
A,
|
|
957
957
|
j,
|
|
958
|
-
|
|
958
|
+
M
|
|
959
959
|
], (e) => {
|
|
960
|
-
n =
|
|
961
|
-
}), e.textContent !== n && (
|
|
962
|
-
},
|
|
963
|
-
if (
|
|
964
|
-
let i =
|
|
965
|
-
if (!(
|
|
966
|
-
if (!i ||
|
|
967
|
-
if (!(
|
|
968
|
-
} else if (!
|
|
960
|
+
n = Rt(n, e, " ");
|
|
961
|
+
}), e.textContent !== n && (Nt(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ye(k.afterSanitizeElements, e, null), !1);
|
|
962
|
+
}, Ze = function(e, t, r) {
|
|
963
|
+
if (ie[t] || me && (t === "id" || t === "name") && (r in n || r in Re)) return !1;
|
|
964
|
+
let i = z[t] || V.attributeCheck instanceof Function && V.attributeCheck(t, e);
|
|
965
|
+
if (!(H && !ie[t] && Kt(ee, t)) && !(ae && Kt(N, t))) {
|
|
966
|
+
if (!i || ie[t]) {
|
|
967
|
+
if (!($e(e) && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && Kt(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Kt(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
|
|
968
|
+
} else if (!we[t] && !Kt(te, Rt(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && zt(r, "data:") === 0 && Se[e]) && !(oe && !Kt(P, Rt(r, F, ""))) && r) return !1;
|
|
969
969
|
}
|
|
970
970
|
return !0;
|
|
971
|
-
},
|
|
971
|
+
}, Qe = X({}, [
|
|
972
972
|
"annotation-xml",
|
|
973
973
|
"color-profile",
|
|
974
974
|
"font-face",
|
|
@@ -977,48 +977,48 @@ function Dn() {
|
|
|
977
977
|
"font-face-src",
|
|
978
978
|
"font-face-uri",
|
|
979
979
|
"missing-glyph"
|
|
980
|
-
]),
|
|
981
|
-
return
|
|
982
|
-
},
|
|
983
|
-
|
|
980
|
+
]), $e = function(e) {
|
|
981
|
+
return !Qe[Ft(e)] && Kt(I, e);
|
|
982
|
+
}, et = function(e) {
|
|
983
|
+
Ye(k.beforeSanitizeAttributes, e, null);
|
|
984
984
|
let n = e.attributes;
|
|
985
|
-
if (!n ||
|
|
985
|
+
if (!n || qe(e)) return;
|
|
986
986
|
let r = {
|
|
987
987
|
attrName: "",
|
|
988
988
|
attrValue: "",
|
|
989
989
|
keepAttr: !0,
|
|
990
|
-
allowedAttributes:
|
|
990
|
+
allowedAttributes: z,
|
|
991
991
|
forceKeepAttr: void 0
|
|
992
992
|
}, i = n.length;
|
|
993
993
|
for (; i--;) {
|
|
994
|
-
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l =
|
|
995
|
-
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0,
|
|
996
|
-
|
|
994
|
+
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = K(o), u = c, d = o === "value" ? u : Bt(u);
|
|
995
|
+
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ye(k.uponSanitizeAttribute, e, r), d = r.attrValue, he && (l === "id" || l === "name") && zt(d, ge) !== 0 && (We(o, e), d = ge + d), ce && Kt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
996
|
+
We(o, e);
|
|
997
997
|
continue;
|
|
998
998
|
}
|
|
999
|
-
if (l === "attributename" &&
|
|
1000
|
-
|
|
999
|
+
if (l === "attributename" && Lt(d, "href")) {
|
|
1000
|
+
We(o, e);
|
|
1001
1001
|
continue;
|
|
1002
1002
|
}
|
|
1003
1003
|
if (r.forceKeepAttr) continue;
|
|
1004
1004
|
if (!r.keepAttr) {
|
|
1005
|
-
|
|
1005
|
+
We(o, e);
|
|
1006
1006
|
continue;
|
|
1007
1007
|
}
|
|
1008
|
-
if (!
|
|
1009
|
-
|
|
1008
|
+
if (!U && Kt(/\/>/i, d)) {
|
|
1009
|
+
We(o, e);
|
|
1010
1010
|
continue;
|
|
1011
1011
|
}
|
|
1012
|
-
|
|
1012
|
+
se && At([
|
|
1013
1013
|
A,
|
|
1014
1014
|
j,
|
|
1015
|
-
|
|
1015
|
+
M
|
|
1016
1016
|
], (e) => {
|
|
1017
|
-
d =
|
|
1017
|
+
d = Rt(d, e, " ");
|
|
1018
1018
|
});
|
|
1019
|
-
let f =
|
|
1020
|
-
if (!
|
|
1021
|
-
|
|
1019
|
+
let f = K(e.nodeName);
|
|
1020
|
+
if (!Ze(f, l, d)) {
|
|
1021
|
+
We(o, e);
|
|
1022
1022
|
continue;
|
|
1023
1023
|
}
|
|
1024
1024
|
if (x && typeof m == "object" && typeof m.getAttributeType == "function" && !s) switch (m.getAttributeType(f, l)) {
|
|
@@ -1030,87 +1030,87 @@ function Dn() {
|
|
|
1030
1030
|
break;
|
|
1031
1031
|
}
|
|
1032
1032
|
if (d !== u) try {
|
|
1033
|
-
s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d),
|
|
1033
|
+
s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), qe(e) ? Ue(e) : Mt(t.removed);
|
|
1034
1034
|
} catch {
|
|
1035
|
-
|
|
1035
|
+
We(o, e);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
|
|
1038
|
+
Ye(k.afterSanitizeAttributes, e, null);
|
|
1039
|
+
}, tt = function(e) {
|
|
1040
|
+
let t = null, n = Ke(e);
|
|
1041
|
+
for (Ye(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Ye(k.uponSanitizeShadowNode, t, null), Xe(t), et(t), t.content instanceof a && tt(t.content);
|
|
1042
|
+
Ye(k.afterSanitizeShadowDOM, e, null);
|
|
1039
1043
|
}, nt = function(e) {
|
|
1040
|
-
let t = null, n = qe(e);
|
|
1041
|
-
for (Xe(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Xe(k.uponSanitizeShadowNode, t, null), Ze(t), tt(t), t.content instanceof a && nt(t.content);
|
|
1042
|
-
Xe(k.afterSanitizeShadowDOM, e, null);
|
|
1043
|
-
}, rt = function(e) {
|
|
1044
1044
|
if (e.nodeType === Cn.element && e.shadowRoot instanceof a) {
|
|
1045
1045
|
let t = e.shadowRoot;
|
|
1046
|
-
|
|
1046
|
+
nt(t), tt(t);
|
|
1047
1047
|
}
|
|
1048
1048
|
let t = e.childNodes;
|
|
1049
1049
|
if (!t) return;
|
|
1050
1050
|
let n = [];
|
|
1051
|
-
|
|
1052
|
-
|
|
1051
|
+
At(t, (e) => {
|
|
1052
|
+
Nt(n, e);
|
|
1053
1053
|
});
|
|
1054
|
-
for (let e of n)
|
|
1054
|
+
for (let e of n) nt(e);
|
|
1055
1055
|
};
|
|
1056
1056
|
return t.sanitize = function(e) {
|
|
1057
1057
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
1058
|
-
if (
|
|
1058
|
+
if (ke = !e, ke && (e = "<!-->"), typeof e != "string" && !Je(e) && (e = Qt(e), typeof e != "string")) throw qt("dirty is not a string, aborting");
|
|
1059
1059
|
if (!t.isSupported) return e;
|
|
1060
|
-
if (
|
|
1060
|
+
if (ue || q(n), t.removed = [], typeof e == "string" && (ve = !1), ve) {
|
|
1061
1061
|
let t = e.nodeName;
|
|
1062
1062
|
if (typeof t == "string") {
|
|
1063
|
-
let e =
|
|
1064
|
-
if (!
|
|
1063
|
+
let e = K(t);
|
|
1064
|
+
if (!L[e] || re[e]) throw qt("root node is forbidden and cannot be sanitized in-place");
|
|
1065
1065
|
}
|
|
1066
|
-
|
|
1067
|
-
} else if (e instanceof s) i =
|
|
1066
|
+
nt(e);
|
|
1067
|
+
} else if (e instanceof s) i = Ge("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Cn.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), nt(o);
|
|
1068
1068
|
else {
|
|
1069
|
-
if (!
|
|
1070
|
-
if (i =
|
|
1071
|
-
}
|
|
1072
|
-
i &&
|
|
1073
|
-
let u =
|
|
1074
|
-
for (; c = u.nextNode();)
|
|
1075
|
-
if (
|
|
1076
|
-
if (
|
|
1077
|
-
if (
|
|
1069
|
+
if (!W && !se && !le && e.indexOf("<") === -1) return x && pe ? x.createHTML(e) : e;
|
|
1070
|
+
if (i = Ge(e), !i) return W ? null : pe ? S : "";
|
|
1071
|
+
}
|
|
1072
|
+
i && de && Ue(i.firstChild);
|
|
1073
|
+
let u = Ke(ve ? e : i);
|
|
1074
|
+
for (; c = u.nextNode();) Xe(c), et(c), c.content instanceof a && tt(c.content);
|
|
1075
|
+
if (ve) return e;
|
|
1076
|
+
if (W) {
|
|
1077
|
+
if (se) {
|
|
1078
1078
|
i.normalize();
|
|
1079
1079
|
let e = i.innerHTML;
|
|
1080
|
-
|
|
1080
|
+
At([
|
|
1081
1081
|
A,
|
|
1082
1082
|
j,
|
|
1083
|
-
|
|
1083
|
+
M
|
|
1084
1084
|
], (t) => {
|
|
1085
|
-
e =
|
|
1085
|
+
e = Rt(e, t, " ");
|
|
1086
1086
|
}), i.innerHTML = e;
|
|
1087
1087
|
}
|
|
1088
|
-
if (
|
|
1088
|
+
if (fe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
1089
1089
|
else l = i;
|
|
1090
|
-
return (
|
|
1090
|
+
return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
|
|
1091
1091
|
}
|
|
1092
|
-
let d =
|
|
1093
|
-
return
|
|
1092
|
+
let d = le ? i.outerHTML : i.innerHTML;
|
|
1093
|
+
return le && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Kt(xn, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), se && At([
|
|
1094
1094
|
A,
|
|
1095
1095
|
j,
|
|
1096
|
-
|
|
1096
|
+
M
|
|
1097
1097
|
], (e) => {
|
|
1098
|
-
d =
|
|
1099
|
-
}), x &&
|
|
1098
|
+
d = Rt(d, e, " ");
|
|
1099
|
+
}), x && pe ? x.createHTML(d) : d;
|
|
1100
1100
|
}, t.setConfig = function() {
|
|
1101
|
-
|
|
1101
|
+
q(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), ue = !0;
|
|
1102
1102
|
}, t.clearConfig = function() {
|
|
1103
|
-
|
|
1103
|
+
Le = null, ue = !1;
|
|
1104
1104
|
}, t.isValidAttribute = function(e, t, n) {
|
|
1105
|
-
return
|
|
1105
|
+
return Le || q({}), Ze(K(e), K(t), n);
|
|
1106
1106
|
}, t.addHook = function(e, t) {
|
|
1107
|
-
typeof t == "function" &&
|
|
1107
|
+
typeof t == "function" && Nt(k[e], t);
|
|
1108
1108
|
}, t.removeHook = function(e, t) {
|
|
1109
1109
|
if (t !== void 0) {
|
|
1110
|
-
let n =
|
|
1111
|
-
return n === -1 ? void 0 :
|
|
1110
|
+
let n = jt(k[e], t);
|
|
1111
|
+
return n === -1 ? void 0 : Pt(k[e], n, 1)[0];
|
|
1112
1112
|
}
|
|
1113
|
-
return
|
|
1113
|
+
return Mt(k[e]);
|
|
1114
1114
|
}, t.removeHooks = function(e) {
|
|
1115
1115
|
k[e] = [];
|
|
1116
1116
|
}, t.removeAllHooks = function() {
|
|
@@ -1316,12 +1316,12 @@ In.prototype.parse = function(e, t) {
|
|
|
1316
1316
|
};
|
|
1317
1317
|
//#endregion
|
|
1318
1318
|
//#region node_modules/mdurl/index.mjs
|
|
1319
|
-
var Jn = /* @__PURE__ */
|
|
1319
|
+
var Jn = /* @__PURE__ */ ce({
|
|
1320
1320
|
decode: () => jn,
|
|
1321
1321
|
encode: () => Pn,
|
|
1322
1322
|
format: () => Fn,
|
|
1323
1323
|
parse: () => qn
|
|
1324
|
-
}), Yn = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Xn = /[\0-\x1F\x7F-\x9F]/, Zn = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, Qn = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, $n = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, er = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, tr = /* @__PURE__ */
|
|
1324
|
+
}), Yn = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Xn = /[\0-\x1F\x7F-\x9F]/, Zn = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, Qn = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, $n = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, er = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, tr = /* @__PURE__ */ ce({
|
|
1325
1325
|
Any: () => Yn,
|
|
1326
1326
|
Cc: () => Xn,
|
|
1327
1327
|
Cf: () => Zn,
|
|
@@ -1516,7 +1516,7 @@ function br(e, t = hr.Legacy) {
|
|
|
1516
1516
|
}
|
|
1517
1517
|
//#endregion
|
|
1518
1518
|
//#region node_modules/markdown-it/lib/common/utils.mjs
|
|
1519
|
-
var xr = /* @__PURE__ */
|
|
1519
|
+
var xr = /* @__PURE__ */ ce({
|
|
1520
1520
|
arrayReplaceAt: () => Dr,
|
|
1521
1521
|
assign: () => Er,
|
|
1522
1522
|
escapeHtml: () => Br,
|
|
@@ -1751,7 +1751,7 @@ function Xr(e, t, n, r) {
|
|
|
1751
1751
|
}
|
|
1752
1752
|
//#endregion
|
|
1753
1753
|
//#region node_modules/markdown-it/lib/helpers/index.mjs
|
|
1754
|
-
var Zr = /* @__PURE__ */
|
|
1754
|
+
var Zr = /* @__PURE__ */ ce({
|
|
1755
1755
|
parseLinkDestination: () => Yr,
|
|
1756
1756
|
parseLinkLabel: () => Jr,
|
|
1757
1757
|
parseLinkTitle: () => Xr
|
|
@@ -3732,7 +3732,7 @@ var Io = new Fo({
|
|
|
3732
3732
|
"href",
|
|
3733
3733
|
"target",
|
|
3734
3734
|
"rel",
|
|
3735
|
-
|
|
3735
|
+
We,
|
|
3736
3736
|
"class"
|
|
3737
3737
|
], zo = [
|
|
3738
3738
|
"br",
|
|
@@ -3746,8 +3746,8 @@ var Io = new Fo({
|
|
|
3746
3746
|
], Bo = /<(?:\/)?(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Vo = /<\/(?:div|p|li|h[1-6]|blockquote|pre)>/gi, Ho = /<(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Uo = / /gi, Wo = /https?:\/\/[^\s<>()]+[^\s<>().,!?;:]/i, Go = /(^|[\s([{"'`])((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/[^\s<]*)?)/gi, Ko = /[),.!?;:]+$/;
|
|
3747
3747
|
function qo(e) {
|
|
3748
3748
|
if (!e) return "";
|
|
3749
|
-
let { shielded: t, tokens: n } =
|
|
3750
|
-
return
|
|
3749
|
+
let { shielded: t, tokens: n } = $e(e), r = t.replace(/\r\n?/g, "\n").replace(Ho, "").replace(Vo, "<br>").replace(Uo, " ");
|
|
3750
|
+
return et(On.sanitize(r, {
|
|
3751
3751
|
ALLOWED_TAGS: zo,
|
|
3752
3752
|
ALLOWED_ATTR: Ro,
|
|
3753
3753
|
ALLOW_DATA_ATTR: !1
|
|
@@ -3755,12 +3755,12 @@ function qo(e) {
|
|
|
3755
3755
|
}
|
|
3756
3756
|
function Jo(e, t) {
|
|
3757
3757
|
if (!e) return "";
|
|
3758
|
-
let n =
|
|
3758
|
+
let n = ut(Ze(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(Bo, (e) => e.startsWith("</") ? "\n" : "");
|
|
3759
3759
|
return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").replace(/\n{3,}/g, "\n\n").trim();
|
|
3760
3760
|
}
|
|
3761
3761
|
function Yo(e, t) {
|
|
3762
3762
|
if (!e) return "";
|
|
3763
|
-
let n =
|
|
3763
|
+
let n = Ze(e), r = qo(Qe(n) ? rt(n, t?.mentionNameByUid ?? {}) : n);
|
|
3764
3764
|
if (!r) return "";
|
|
3765
3765
|
let i = Io.render(ts(r));
|
|
3766
3766
|
return On.sanitize(i, {
|
|
@@ -3785,7 +3785,7 @@ function $o(e) {
|
|
|
3785
3785
|
return e.replace(/\n{2,}/g, (e) => "\n" + "<br>".repeat(e.length - 1));
|
|
3786
3786
|
}
|
|
3787
3787
|
function es(e, t) {
|
|
3788
|
-
return e.replace(
|
|
3788
|
+
return e.replace(Be, (e, n) => `<span class="${Ke}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
|
|
3789
3789
|
}
|
|
3790
3790
|
function ts(e) {
|
|
3791
3791
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
|
|
@@ -3835,23 +3835,23 @@ function is(e) {
|
|
|
3835
3835
|
function as(e, t) {
|
|
3836
3836
|
if (!e) return t;
|
|
3837
3837
|
switch (e.kind) {
|
|
3838
|
-
case "image": return
|
|
3839
|
-
case "video": return
|
|
3840
|
-
case "audio": return
|
|
3838
|
+
case "image": return ze("photo");
|
|
3839
|
+
case "video": return ze("video");
|
|
3840
|
+
case "audio": return ze("audio");
|
|
3841
3841
|
case "file": return e.name || t;
|
|
3842
3842
|
default: return t;
|
|
3843
3843
|
}
|
|
3844
3844
|
}
|
|
3845
|
-
function os(e, t =
|
|
3845
|
+
function os(e, t = ze("attachment")) {
|
|
3846
3846
|
return as(e[0], t);
|
|
3847
3847
|
}
|
|
3848
3848
|
function ss(e, t) {
|
|
3849
|
-
let n =
|
|
3850
|
-
return n ?
|
|
3849
|
+
let n = Ze(e ?? "");
|
|
3850
|
+
return n ? Qe(n) && t ? qo(nt(n, t)) : qo(n) : "";
|
|
3851
3851
|
}
|
|
3852
3852
|
function cs(e) {
|
|
3853
3853
|
let t = qo(e);
|
|
3854
|
-
return t ?
|
|
3854
|
+
return t ? it(t) : "";
|
|
3855
3855
|
}
|
|
3856
3856
|
function ls(e) {
|
|
3857
3857
|
return Jo(e).length > 0;
|
|
@@ -3859,26 +3859,26 @@ function ls(e) {
|
|
|
3859
3859
|
function us(e, t) {
|
|
3860
3860
|
return Jo(e, t);
|
|
3861
3861
|
}
|
|
3862
|
-
function ds(e, t =
|
|
3862
|
+
function ds(e, t = ze("message"), n) {
|
|
3863
3863
|
if (e.kind === "poll" && e.poll) return e.poll.question;
|
|
3864
3864
|
let r = us(e.text, n);
|
|
3865
3865
|
return e.attachments.length > 0 ? r || os(e.attachments, t) : r || t;
|
|
3866
3866
|
}
|
|
3867
3867
|
function fs(e, t = {}) {
|
|
3868
|
-
return
|
|
3868
|
+
return ut(e, t);
|
|
3869
3869
|
}
|
|
3870
3870
|
function ps(e) {
|
|
3871
|
-
return e.source?.getText?.() ||
|
|
3871
|
+
return e.source?.getText?.() || Ze(e.text);
|
|
3872
3872
|
}
|
|
3873
3873
|
function ms(e, t = !1, n = !0) {
|
|
3874
3874
|
if (!e) return "";
|
|
3875
3875
|
if (e.getDeletedAt?.() != null) return "(Message removed)";
|
|
3876
|
-
if (e instanceof
|
|
3877
|
-
if (e instanceof
|
|
3876
|
+
if (e instanceof U.TextMessage) return e.getText?.() ?? "";
|
|
3877
|
+
if (e instanceof U.MediaMessage) {
|
|
3878
3878
|
let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
|
|
3879
3879
|
return a === "image" ? `${t ? "🖼️ " : ""}${i || "Photo"}` : a === "video" ? `${t ? "🎥 " : ""}${i || r || "Video"}` : a === "audio" ? `${t ? "🎤 " : ""}${r || "Audio message"}` : a === "file" ? `${t ? "📄 " : ""}${i || r || "File"}` : `${t ? "🖼️ " : ""}${i || r || "Media message"}`;
|
|
3880
3880
|
}
|
|
3881
|
-
if (e instanceof
|
|
3881
|
+
if (e instanceof U.Action) {
|
|
3882
3882
|
let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
|
|
3883
3883
|
return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
|
|
3884
3884
|
}
|
|
@@ -3908,9 +3908,9 @@ function _s(e) {
|
|
|
3908
3908
|
return gs(e).join("\n").trim();
|
|
3909
3909
|
}
|
|
3910
3910
|
function vs(e) {
|
|
3911
|
-
if (e.kind === "poll" && e.poll) return
|
|
3912
|
-
let t =
|
|
3913
|
-
return ds(e, e.attachments.length > 0 ?
|
|
3911
|
+
if (e.kind === "poll" && e.poll) return ze("pollPrefix", { question: e.poll.question });
|
|
3912
|
+
let t = ct(e.source);
|
|
3913
|
+
return ds(e, e.attachments.length > 0 ? ze("sentAnAttachment") : ze("youSentAMessage"), t);
|
|
3914
3914
|
}
|
|
3915
3915
|
//#endregion
|
|
3916
3916
|
//#region src/chat/offlineStore.ts
|
|
@@ -4158,148 +4158,148 @@ function Es(e) {
|
|
|
4158
4158
|
//#region src/chat/client.ts
|
|
4159
4159
|
var Ds = null, Os = null;
|
|
4160
4160
|
function ks({ environment: e }) {
|
|
4161
|
-
|
|
4161
|
+
de(e);
|
|
4162
4162
|
let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(null), _ = w(null), v = w([]), y = w([]), b = w([]), x = w([]), S = w(!1), C = w(!1), T = w(null), E = w(null), D = w(null), O = w(null), k = w([]), A = w({}), j = n(() => k.value.length);
|
|
4163
|
-
function
|
|
4163
|
+
function M(e) {
|
|
4164
4164
|
if (!e.length) return;
|
|
4165
4165
|
let t = { ...A.value };
|
|
4166
4166
|
for (let n of e) n.uid && n.displayName.trim() && (t[n.uid] = n.displayName);
|
|
4167
4167
|
A.value = t;
|
|
4168
4168
|
}
|
|
4169
|
-
function
|
|
4170
|
-
|
|
4169
|
+
function ee(e) {
|
|
4170
|
+
M(Object.entries(ct(e)).map(([e, t]) => ({
|
|
4171
4171
|
uid: e,
|
|
4172
4172
|
displayName: t
|
|
4173
4173
|
})));
|
|
4174
4174
|
}
|
|
4175
|
-
function
|
|
4176
|
-
return
|
|
4175
|
+
function N(e, t) {
|
|
4176
|
+
return ee(e), Ns(e, t);
|
|
4177
4177
|
}
|
|
4178
|
-
let
|
|
4179
|
-
async function
|
|
4180
|
-
await As(e), !t.value && (
|
|
4178
|
+
let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, te = !1, L = !1, R = null, z = null, ne = null, B = null, re = 0, ie = 0, V = !1, ae = !1, H = null, oe = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set(), ce = null, le = null, ue = 0;
|
|
4179
|
+
async function fe() {
|
|
4180
|
+
await As(e), !t.value && (ye(), ut(), t.value = !0, await lt(), _.value && (Ne(_.value.uid), he(), Oe(), !m.value && !ae && De()));
|
|
4181
4181
|
}
|
|
4182
|
-
async function
|
|
4182
|
+
async function pe(e) {
|
|
4183
4183
|
g.value = null, r.value = !0;
|
|
4184
4184
|
try {
|
|
4185
|
-
await
|
|
4186
|
-
let t =
|
|
4187
|
-
await
|
|
4185
|
+
await fe();
|
|
4186
|
+
let t = ge();
|
|
4187
|
+
await U.getLoggedinUser() && t !== e && await U.logout(), _e(e);
|
|
4188
4188
|
let n = await js(e);
|
|
4189
|
-
_.value = Is(await
|
|
4189
|
+
_.value = Is(await U.login(n)), Ne(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, he(), Oe(), ae || await De(), await Pe(), Ut();
|
|
4190
4190
|
} catch (e) {
|
|
4191
|
-
throw
|
|
4191
|
+
throw bt(), g.value = Q(e, "Unable to sign in to chat."), e;
|
|
4192
4192
|
} finally {
|
|
4193
4193
|
r.value = !1;
|
|
4194
4194
|
}
|
|
4195
4195
|
}
|
|
4196
|
-
async function
|
|
4196
|
+
async function me() {
|
|
4197
4197
|
g.value = null;
|
|
4198
4198
|
try {
|
|
4199
|
-
|
|
4199
|
+
_e(null), xe(), await U.getLoggedinUser() && await U.logout();
|
|
4200
4200
|
} finally {
|
|
4201
|
-
|
|
4201
|
+
bt();
|
|
4202
4202
|
}
|
|
4203
4203
|
}
|
|
4204
|
-
function
|
|
4205
|
-
let e =
|
|
4204
|
+
function he() {
|
|
4205
|
+
let e = je();
|
|
4206
4206
|
if (!e) {
|
|
4207
|
-
|
|
4207
|
+
H = null, k.value = [];
|
|
4208
4208
|
return;
|
|
4209
4209
|
}
|
|
4210
|
-
let t = `bcc-chat:${
|
|
4211
|
-
|
|
4210
|
+
let t = `bcc-chat:${W().appId}:${e}`;
|
|
4211
|
+
ve(t), H = new bs(t), k.value = H.getQueue();
|
|
4212
4212
|
}
|
|
4213
|
-
function
|
|
4213
|
+
function ve(e) {
|
|
4214
4214
|
if (typeof window > "u") return;
|
|
4215
|
-
let t = `bcc-chat:${
|
|
4215
|
+
let t = `bcc-chat:${W().appId}:`, n = [];
|
|
4216
4216
|
for (let r = 0; r < window.localStorage.length; r += 1) {
|
|
4217
4217
|
let i = window.localStorage.key(r);
|
|
4218
4218
|
i && i.startsWith(t) && i !== e && n.push(i);
|
|
4219
4219
|
}
|
|
4220
4220
|
n.forEach((e) => window.localStorage.removeItem(e));
|
|
4221
4221
|
}
|
|
4222
|
+
function ye() {
|
|
4223
|
+
L || typeof window > "u" || (window.addEventListener("online", be), window.addEventListener("offline", Se), L = !0);
|
|
4224
|
+
}
|
|
4222
4225
|
function be() {
|
|
4223
|
-
|
|
4226
|
+
m.value = !1, V = !0, ae || Ee(!0);
|
|
4224
4227
|
}
|
|
4225
|
-
function
|
|
4226
|
-
m.value = !
|
|
4228
|
+
function Se() {
|
|
4229
|
+
m.value = !0, p.value = !1, Ce();
|
|
4227
4230
|
}
|
|
4228
4231
|
function Ce() {
|
|
4229
|
-
|
|
4232
|
+
R !== null && (clearTimeout(R), R = null);
|
|
4230
4233
|
}
|
|
4231
4234
|
function we() {
|
|
4232
|
-
|
|
4235
|
+
re = Date.now() + 1500;
|
|
4233
4236
|
}
|
|
4234
4237
|
function Te() {
|
|
4235
|
-
|
|
4238
|
+
return Date.now() < re;
|
|
4236
4239
|
}
|
|
4237
|
-
function Ee() {
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ae, 4));
|
|
4243
|
-
L = setTimeout(() => {
|
|
4244
|
-
L = null, Oe();
|
|
4240
|
+
function Ee(e = !1) {
|
|
4241
|
+
if (R !== null || z || m.value || !h.value || ae) return;
|
|
4242
|
+
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ie, 4));
|
|
4243
|
+
R = setTimeout(() => {
|
|
4244
|
+
R = null, De();
|
|
4245
4245
|
}, t);
|
|
4246
4246
|
}
|
|
4247
|
-
async function
|
|
4248
|
-
if (!(m.value || !h.value ||
|
|
4249
|
-
|
|
4247
|
+
async function De() {
|
|
4248
|
+
if (!(m.value || !h.value || ae)) return z || (z = (async () => {
|
|
4249
|
+
Ce();
|
|
4250
4250
|
try {
|
|
4251
|
-
let e = await
|
|
4251
|
+
let e = await U.getLoggedinUser();
|
|
4252
4252
|
if (!e) {
|
|
4253
|
-
let t =
|
|
4253
|
+
let t = ge();
|
|
4254
4254
|
if (!t) return;
|
|
4255
4255
|
let n = await js(t);
|
|
4256
|
-
e = await
|
|
4256
|
+
e = await U.login(n);
|
|
4257
4257
|
}
|
|
4258
|
-
_.value = Is(e), h.value = !0,
|
|
4259
|
-
let t =
|
|
4260
|
-
typeof t == "function" && (await t.call(
|
|
4258
|
+
_.value = Is(e), h.value = !0, he();
|
|
4259
|
+
let t = U.connect;
|
|
4260
|
+
typeof t == "function" && (await t.call(U), p.value = !0), ie = 0, V && await G();
|
|
4261
4261
|
} catch (e) {
|
|
4262
|
-
p.value = !1,
|
|
4262
|
+
p.value = !1, ie += 1, J(e) || (g.value = Q(e, "Unable to reconnect to chat.")), Ee();
|
|
4263
4263
|
} finally {
|
|
4264
|
-
|
|
4264
|
+
z = null;
|
|
4265
4265
|
}
|
|
4266
|
-
})(),
|
|
4266
|
+
})(), z);
|
|
4267
4267
|
}
|
|
4268
|
-
async function
|
|
4269
|
-
return
|
|
4270
|
-
|
|
4268
|
+
async function G() {
|
|
4269
|
+
return ne || m.value || !h.value || ae || (ne = (async () => {
|
|
4270
|
+
V = !1, g.value = null;
|
|
4271
4271
|
try {
|
|
4272
|
-
await
|
|
4272
|
+
await Pe(), Ut();
|
|
4273
4273
|
} finally {
|
|
4274
|
-
|
|
4274
|
+
ne = null;
|
|
4275
4275
|
}
|
|
4276
|
-
})()),
|
|
4276
|
+
})()), ne;
|
|
4277
4277
|
}
|
|
4278
|
-
function
|
|
4279
|
-
if (!
|
|
4280
|
-
let e =
|
|
4281
|
-
e.length !== 0 && (v.value = Vs(e), !T.value && v.value.length > 0 &&
|
|
4278
|
+
function Oe() {
|
|
4279
|
+
if (!H || v.value.length > 0) return;
|
|
4280
|
+
let e = H.getConversations();
|
|
4281
|
+
e.length !== 0 && (v.value = Vs(e), !T.value && v.value.length > 0 && ke(T.value));
|
|
4282
4282
|
}
|
|
4283
|
-
function
|
|
4284
|
-
if (!
|
|
4285
|
-
let t =
|
|
4283
|
+
function ke(e) {
|
|
4284
|
+
if (!H || !e) return y.value = [], !1;
|
|
4285
|
+
let t = H.getMessages(e).sort(Hs);
|
|
4286
4286
|
return y.value = t, t.length > 0;
|
|
4287
4287
|
}
|
|
4288
|
-
async function
|
|
4289
|
-
|
|
4288
|
+
async function Ae() {
|
|
4289
|
+
ae = !1, V = !0, await De();
|
|
4290
4290
|
}
|
|
4291
|
-
async function
|
|
4292
|
-
|
|
4293
|
-
let e =
|
|
4294
|
-
typeof e == "function" && await e.call(
|
|
4291
|
+
async function Me() {
|
|
4292
|
+
ae = !0, V = !1, Ce();
|
|
4293
|
+
let e = U.disconnect;
|
|
4294
|
+
typeof e == "function" && await e.call(U), p.value = !1;
|
|
4295
4295
|
}
|
|
4296
|
-
async function
|
|
4297
|
-
if (await
|
|
4298
|
-
v.value = Vs(
|
|
4296
|
+
async function Pe() {
|
|
4297
|
+
if (await fe(), i.value = !0, g.value = null, m.value && H) {
|
|
4298
|
+
v.value = Vs(H.getConversations()), P.value && await nt(), i.value = !1;
|
|
4299
4299
|
return;
|
|
4300
4300
|
}
|
|
4301
4301
|
try {
|
|
4302
|
-
let e = new
|
|
4302
|
+
let e = new U.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(U.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
|
|
4303
4303
|
do
|
|
4304
4304
|
n = await e.fetchNext(), t.push(...n.map((e) => Ms(e, _.value?.uid)));
|
|
4305
4305
|
while (n.length === 50);
|
|
@@ -4308,9 +4308,9 @@ function ks({ environment: e }) {
|
|
|
4308
4308
|
let t = r.get(e.id);
|
|
4309
4309
|
t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt));
|
|
4310
4310
|
}
|
|
4311
|
-
v.value = Vs(await
|
|
4311
|
+
v.value = Vs(await ft(t)), H?.setConversations(v.value), P.value && await nt();
|
|
4312
4312
|
} catch (e) {
|
|
4313
|
-
let t =
|
|
4313
|
+
let t = H?.getConversations() ?? [];
|
|
4314
4314
|
if (t.length > 0) {
|
|
4315
4315
|
v.value = Vs(t);
|
|
4316
4316
|
return;
|
|
@@ -4320,39 +4320,39 @@ function ks({ environment: e }) {
|
|
|
4320
4320
|
i.value = !1;
|
|
4321
4321
|
}
|
|
4322
4322
|
}
|
|
4323
|
-
async function
|
|
4324
|
-
T.value = e, E.value = null, b.value = [],
|
|
4323
|
+
async function Fe(e) {
|
|
4324
|
+
T.value = e, E.value = null, b.value = [], le = null, C.value = !1, D.value = null, O.value = null, ke(e), await nt();
|
|
4325
4325
|
}
|
|
4326
|
-
function
|
|
4326
|
+
function Ie(e) {
|
|
4327
4327
|
e && (O.value = null), D.value = e;
|
|
4328
4328
|
}
|
|
4329
|
-
function
|
|
4329
|
+
function K(e) {
|
|
4330
4330
|
e && (D.value = null), O.value = e;
|
|
4331
4331
|
}
|
|
4332
|
-
async function
|
|
4333
|
-
E.value = e,
|
|
4332
|
+
async function Le(e) {
|
|
4333
|
+
E.value = e, le = null, C.value = !1, D.value = null, O.value = null, await it(e.id);
|
|
4334
4334
|
}
|
|
4335
|
-
function
|
|
4336
|
-
E.value = null, b.value = [],
|
|
4335
|
+
function Re() {
|
|
4336
|
+
E.value = null, b.value = [], le = null, C.value = !1, D.value = null, O.value = null;
|
|
4337
4337
|
}
|
|
4338
|
-
async function
|
|
4338
|
+
async function q(e, t) {
|
|
4339
4339
|
if (u.value) return;
|
|
4340
|
-
let n =
|
|
4340
|
+
let n = P.value;
|
|
4341
4341
|
if (!n) return;
|
|
4342
4342
|
let r = cs(e);
|
|
4343
4343
|
if (!ls(r)) return;
|
|
4344
4344
|
if (O.value) {
|
|
4345
|
-
await
|
|
4345
|
+
await Be(O.value, r);
|
|
4346
4346
|
return;
|
|
4347
4347
|
}
|
|
4348
|
-
let i = E.value?.id, a = crypto.randomUUID(), o = Js(
|
|
4348
|
+
let i = E.value?.id, a = crypto.randomUUID(), o = Js(Nt(D.value, t), a);
|
|
4349
4349
|
u.value = !0, g.value = null;
|
|
4350
4350
|
try {
|
|
4351
4351
|
if (m.value) {
|
|
4352
|
-
|
|
4352
|
+
Ft(n, r, o, i, a), D.value = null;
|
|
4353
4353
|
return;
|
|
4354
4354
|
}
|
|
4355
|
-
|
|
4355
|
+
Bt(Mt({
|
|
4356
4356
|
conversation: n,
|
|
4357
4357
|
kind: "text",
|
|
4358
4358
|
text: r,
|
|
@@ -4361,31 +4361,31 @@ function ks({ environment: e }) {
|
|
|
4361
4361
|
muid: a,
|
|
4362
4362
|
deliveryState: "sending"
|
|
4363
4363
|
}));
|
|
4364
|
-
let e = new
|
|
4364
|
+
let e = new U.TextMessage(n.targetId, r, Xs(n));
|
|
4365
4365
|
e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
|
|
4366
|
-
let t = await
|
|
4367
|
-
|
|
4366
|
+
let t = await U.sendMessage(e);
|
|
4367
|
+
St(N(t, _.value?.uid)), mt(t), await _t(t), D.value = null;
|
|
4368
4368
|
} catch (e) {
|
|
4369
|
-
if (
|
|
4370
|
-
|
|
4369
|
+
if (J(e)) {
|
|
4370
|
+
Vt("queued", a), Ft(n, r, o, E.value?.id, a), D.value = null;
|
|
4371
4371
|
return;
|
|
4372
4372
|
}
|
|
4373
|
-
throw
|
|
4373
|
+
throw Vt("failed", a), g.value = Q(e, "Unable to send the message."), e;
|
|
4374
4374
|
} finally {
|
|
4375
4375
|
u.value = !1;
|
|
4376
4376
|
}
|
|
4377
4377
|
}
|
|
4378
|
-
async function
|
|
4379
|
-
let n =
|
|
4378
|
+
async function Be(e, t) {
|
|
4379
|
+
let n = P.value;
|
|
4380
4380
|
if (!n || m.value) return;
|
|
4381
4381
|
let r = cs(t);
|
|
4382
4382
|
if (ls(r)) {
|
|
4383
4383
|
u.value = !0, g.value = null;
|
|
4384
4384
|
try {
|
|
4385
4385
|
let t;
|
|
4386
|
-
e.kind === "text" ? t = new
|
|
4387
|
-
let i = await
|
|
4388
|
-
|
|
4386
|
+
e.kind === "text" ? t = new U.TextMessage(n.targetId, r, Xs(n)) : (t = new U.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Xs(n)), t.setCaption(r)), t.setId(Number(e.id));
|
|
4387
|
+
let i = await U.editMessage(t);
|
|
4388
|
+
St(N(i, _.value?.uid)), mt(i), O.value = null;
|
|
4389
4389
|
} catch (e) {
|
|
4390
4390
|
throw g.value = Q(e, "Unable to edit the message."), e;
|
|
4391
4391
|
} finally {
|
|
@@ -4393,18 +4393,18 @@ function ks({ environment: e }) {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
}
|
|
4395
4395
|
}
|
|
4396
|
-
async function
|
|
4396
|
+
async function Ve(e, t) {
|
|
4397
4397
|
if (u.value) return;
|
|
4398
|
-
let n =
|
|
4398
|
+
let n = P.value;
|
|
4399
4399
|
if (!n) return;
|
|
4400
|
-
let r = E.value?.id, i = crypto.randomUUID(), a = Js(
|
|
4400
|
+
let r = E.value?.id, i = crypto.randomUUID(), a = Js(Nt(D.value, t), i), o = ec(e.file);
|
|
4401
4401
|
u.value = !0, g.value = null;
|
|
4402
4402
|
try {
|
|
4403
4403
|
if (m.value) {
|
|
4404
|
-
await
|
|
4404
|
+
await Rt(n, e, a, r, i), D.value = null;
|
|
4405
4405
|
return;
|
|
4406
4406
|
}
|
|
4407
|
-
|
|
4407
|
+
Bt(Mt({
|
|
4408
4408
|
conversation: n,
|
|
4409
4409
|
kind: o,
|
|
4410
4410
|
text: e.caption?.trim() ?? "",
|
|
@@ -4419,37 +4419,37 @@ function ks({ environment: e }) {
|
|
|
4419
4419
|
muid: i,
|
|
4420
4420
|
deliveryState: "sending"
|
|
4421
4421
|
}));
|
|
4422
|
-
let t = new
|
|
4422
|
+
let t = new U.MediaMessage(n.targetId, e.file, o, Xs(n));
|
|
4423
4423
|
t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
|
|
4424
|
-
let s = await
|
|
4425
|
-
|
|
4424
|
+
let s = await U.sendMediaMessage(t);
|
|
4425
|
+
St(N(s, _.value?.uid)), mt(s), await _t(s), D.value = null;
|
|
4426
4426
|
} catch (t) {
|
|
4427
|
-
if (
|
|
4428
|
-
|
|
4427
|
+
if (J(t)) {
|
|
4428
|
+
Vt("queued", i), await Rt(n, e, a, r, i), D.value = null;
|
|
4429
4429
|
return;
|
|
4430
4430
|
}
|
|
4431
|
-
throw
|
|
4431
|
+
throw Vt("failed", i), g.value = Q(t, "Unable to send the attachment."), t;
|
|
4432
4432
|
} finally {
|
|
4433
4433
|
u.value = !1;
|
|
4434
4434
|
}
|
|
4435
4435
|
}
|
|
4436
|
-
async function
|
|
4436
|
+
async function He(e, t) {
|
|
4437
4437
|
if (u.value) return;
|
|
4438
|
-
let n =
|
|
4438
|
+
let n = P.value;
|
|
4439
4439
|
if (!n) return;
|
|
4440
4440
|
let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
|
|
4441
4441
|
if (!r || i.length < 2) return;
|
|
4442
|
-
let a = E.value?.id, o = crypto.randomUUID(), s = Js(
|
|
4442
|
+
let a = E.value?.id, o = crypto.randomUUID(), s = Js(Nt(D.value, t), o);
|
|
4443
4443
|
u.value = !0, g.value = null;
|
|
4444
4444
|
try {
|
|
4445
4445
|
if (m.value) {
|
|
4446
|
-
|
|
4446
|
+
It(n, {
|
|
4447
4447
|
question: r,
|
|
4448
4448
|
options: i
|
|
4449
4449
|
}, s, a, o), D.value = null;
|
|
4450
4450
|
return;
|
|
4451
4451
|
}
|
|
4452
|
-
|
|
4452
|
+
Bt(Mt({
|
|
4453
4453
|
conversation: n,
|
|
4454
4454
|
kind: "poll",
|
|
4455
4455
|
text: `Poll: ${r}`,
|
|
@@ -4466,41 +4466,41 @@ function ks({ environment: e }) {
|
|
|
4466
4466
|
question: r,
|
|
4467
4467
|
options: i,
|
|
4468
4468
|
receiver: n.targetId,
|
|
4469
|
-
receiverType: n.type === "group" ?
|
|
4469
|
+
receiverType: n.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER
|
|
4470
4470
|
};
|
|
4471
4471
|
a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
|
|
4472
|
-
let t = await
|
|
4473
|
-
c ? (
|
|
4472
|
+
let t = await U.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
|
|
4473
|
+
c ? (Ht(o), St(N(c, _.value?.uid)), mt(c), await _t(c)) : (Ht(o), await xt()), D.value = null;
|
|
4474
4474
|
} catch (e) {
|
|
4475
|
-
if (
|
|
4476
|
-
|
|
4475
|
+
if (J(e)) {
|
|
4476
|
+
Vt("queued", o), It(n, {
|
|
4477
4477
|
question: r,
|
|
4478
4478
|
options: i
|
|
4479
4479
|
}, s, a, o), D.value = null;
|
|
4480
4480
|
return;
|
|
4481
4481
|
}
|
|
4482
|
-
throw
|
|
4482
|
+
throw Vt("failed", o), g.value = Q(e, "Unable to send the poll."), e;
|
|
4483
4483
|
} finally {
|
|
4484
4484
|
u.value = !1;
|
|
4485
4485
|
}
|
|
4486
4486
|
}
|
|
4487
|
-
async function
|
|
4487
|
+
async function Ue(e, t) {
|
|
4488
4488
|
let n = e.poll?.id ?? e.id, r = _.value?.uid;
|
|
4489
4489
|
if (!n || !t || m.value) return;
|
|
4490
|
-
let i =
|
|
4490
|
+
let i = wt(e.id, e.parentMessageId) ?? e;
|
|
4491
4491
|
if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
|
|
4492
|
-
g.value = null, r &&
|
|
4492
|
+
g.value = null, r && St(We(i, t, r));
|
|
4493
4493
|
try {
|
|
4494
|
-
await
|
|
4494
|
+
await U.callExtension("polls", "POST", "v2/vote", {
|
|
4495
4495
|
id: n,
|
|
4496
4496
|
vote: t
|
|
4497
4497
|
});
|
|
4498
4498
|
} catch (e) {
|
|
4499
|
-
throw
|
|
4499
|
+
throw St(i), g.value = Q(e, "Unable to cast the vote."), e;
|
|
4500
4500
|
}
|
|
4501
4501
|
}
|
|
4502
4502
|
}
|
|
4503
|
-
function
|
|
4503
|
+
function We(e, t, n) {
|
|
4504
4504
|
if (!e.poll) return e;
|
|
4505
4505
|
let r = e.poll, i = r.allowsMultipleAnswers, a = r.options.filter((e) => e.voters.includes(n)).map((e) => e.id), o = !i && a.length > 0, s = r.options.map((e) => o && e.voters.includes(n) && e.id !== t ? {
|
|
4506
4506
|
...e,
|
|
@@ -4520,80 +4520,80 @@ function ks({ environment: e }) {
|
|
|
4520
4520
|
}
|
|
4521
4521
|
};
|
|
4522
4522
|
}
|
|
4523
|
-
async function
|
|
4523
|
+
async function Ge(e, t) {
|
|
4524
4524
|
g.value = null;
|
|
4525
|
-
let n =
|
|
4526
|
-
|
|
4525
|
+
let n = wt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
|
|
4526
|
+
St(Tt(n, t));
|
|
4527
4527
|
try {
|
|
4528
|
-
|
|
4528
|
+
St(N(r ? await U.removeReaction(Number(e.id), t) : await U.addReaction(Number(e.id), t), _.value?.uid));
|
|
4529
4529
|
} catch (e) {
|
|
4530
|
-
throw
|
|
4530
|
+
throw St(n), g.value = Q(e, "Unable to update the reaction."), e;
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
|
-
async function
|
|
4533
|
+
async function Ke(e) {
|
|
4534
4534
|
if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
|
|
4535
|
-
|
|
4535
|
+
Ot(e);
|
|
4536
4536
|
return;
|
|
4537
4537
|
}
|
|
4538
4538
|
if (!m.value) try {
|
|
4539
|
-
let t =
|
|
4540
|
-
|
|
4539
|
+
let t = N(await U.deleteMessage(String(e.id)), _.value?.uid);
|
|
4540
|
+
Ot(t), kt(t);
|
|
4541
4541
|
} catch (e) {
|
|
4542
4542
|
throw g.value = Q(e, "Unable to delete the message."), e;
|
|
4543
4543
|
}
|
|
4544
4544
|
}
|
|
4545
|
-
async function
|
|
4545
|
+
async function qe(e) {
|
|
4546
4546
|
let t = e.source?.getText?.() ?? e.text;
|
|
4547
4547
|
if (ls(t)) {
|
|
4548
4548
|
g.value = null;
|
|
4549
4549
|
try {
|
|
4550
|
-
let n = (await
|
|
4550
|
+
let n = (await U.callExtension("message-translation", "POST", "v2/translate", {
|
|
4551
4551
|
msgId: Number(e.id),
|
|
4552
4552
|
text: t,
|
|
4553
4553
|
languages: typeof navigator < "u" ? navigator.languages : ["en"]
|
|
4554
4554
|
})).translations?.[0]?.message_translated?.trim();
|
|
4555
4555
|
if (!n) return;
|
|
4556
|
-
|
|
4556
|
+
Ct({
|
|
4557
4557
|
...e,
|
|
4558
4558
|
translatedText: n,
|
|
4559
4559
|
metadata: {
|
|
4560
4560
|
...e.metadata ?? {},
|
|
4561
4561
|
translated_message: n
|
|
4562
4562
|
}
|
|
4563
|
-
}),
|
|
4563
|
+
}), Dt();
|
|
4564
4564
|
} catch (e) {
|
|
4565
4565
|
throw g.value = Q(e, "Unable to translate the message."), e;
|
|
4566
4566
|
}
|
|
4567
4567
|
}
|
|
4568
4568
|
}
|
|
4569
|
-
async function
|
|
4570
|
-
let t = e ??
|
|
4569
|
+
async function Je(e) {
|
|
4570
|
+
let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++ue;
|
|
4571
4571
|
if (!t || !n) {
|
|
4572
|
-
r ===
|
|
4572
|
+
r === ue && (x.value = []);
|
|
4573
4573
|
return;
|
|
4574
4574
|
}
|
|
4575
4575
|
l.value = !0, g.value = null;
|
|
4576
4576
|
try {
|
|
4577
|
-
let e = new
|
|
4577
|
+
let e = new U.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
|
|
4578
4578
|
do
|
|
4579
|
-
a = await e.fetchPrevious(), i.push(...a.map((e) =>
|
|
4579
|
+
a = await e.fetchPrevious(), i.push(...a.map((e) => N(e, _.value?.uid)));
|
|
4580
4580
|
while (a.length === 50);
|
|
4581
4581
|
let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
|
|
4582
|
-
if (r !==
|
|
4582
|
+
if (r !== ue) return;
|
|
4583
4583
|
x.value = o;
|
|
4584
4584
|
} catch (e) {
|
|
4585
|
-
if (r !==
|
|
4586
|
-
throw g.value = Q(e,
|
|
4585
|
+
if (r !== ue) return;
|
|
4586
|
+
throw g.value = Q(e, ze("loadScheduledMessagesError")), e;
|
|
4587
4587
|
} finally {
|
|
4588
|
-
r ===
|
|
4588
|
+
r === ue && (l.value = !1);
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
|
-
async function
|
|
4592
|
-
let n =
|
|
4591
|
+
async function Ye(e, t) {
|
|
4592
|
+
let n = P.value;
|
|
4593
4593
|
if (n) {
|
|
4594
4594
|
d.value = !0, g.value = null;
|
|
4595
4595
|
try {
|
|
4596
|
-
e.file ? await $s(n, e, t) : await Qs(n, e, t), await
|
|
4596
|
+
e.file ? await $s(n, e, t) : await Qs(n, e, t), await Je(n.targetId);
|
|
4597
4597
|
} catch (e) {
|
|
4598
4598
|
throw g.value = Q(e, "Unable to schedule the message."), e;
|
|
4599
4599
|
} finally {
|
|
@@ -4601,16 +4601,16 @@ function ks({ environment: e }) {
|
|
|
4601
4601
|
}
|
|
4602
4602
|
}
|
|
4603
4603
|
}
|
|
4604
|
-
async function
|
|
4605
|
-
if (g.value = null, !e.scheduled
|
|
4604
|
+
async function Xe(e) {
|
|
4605
|
+
if (g.value = null, !e.scheduled) return;
|
|
4606
4606
|
let t = e.scheduled.originalChatUid;
|
|
4607
4607
|
try {
|
|
4608
|
-
await
|
|
4608
|
+
await U.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Je(t);
|
|
4609
4609
|
} catch (e) {
|
|
4610
4610
|
throw g.value = Q(e, "Unable to remove the scheduled message."), e;
|
|
4611
4611
|
}
|
|
4612
4612
|
}
|
|
4613
|
-
async function
|
|
4613
|
+
async function Ze(e, t) {
|
|
4614
4614
|
g.value = null;
|
|
4615
4615
|
let n = _.value?.uid;
|
|
4616
4616
|
if (!n || !e.scheduled?.muid || e.kind === "poll") return;
|
|
@@ -4620,22 +4620,22 @@ function ks({ environment: e }) {
|
|
|
4620
4620
|
!i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
|
|
4621
4621
|
try {
|
|
4622
4622
|
let t;
|
|
4623
|
-
if (e.kind === "text") t = new
|
|
4623
|
+
if (e.kind === "text") t = new U.TextMessage(n, r, U.RECEIVER_TYPE.GROUP);
|
|
4624
4624
|
else {
|
|
4625
4625
|
let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
|
|
4626
|
-
t = new
|
|
4626
|
+
t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption(r);
|
|
4627
4627
|
}
|
|
4628
|
-
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await
|
|
4628
|
+
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await U.editMessage(t), await Je(e.scheduled.originalChatUid);
|
|
4629
4629
|
} catch (e) {
|
|
4630
4630
|
throw g.value = Q(e, "Unable to edit the scheduled message."), e;
|
|
4631
4631
|
} finally {
|
|
4632
4632
|
d.value = !1;
|
|
4633
4633
|
}
|
|
4634
4634
|
}
|
|
4635
|
-
async function
|
|
4635
|
+
async function Qe(e) {
|
|
4636
4636
|
d.value = !0, g.value = null;
|
|
4637
4637
|
try {
|
|
4638
|
-
let t = Zs(), n = await fetch(`${
|
|
4638
|
+
let t = Zs(), n = await fetch(`${W().chatApiBaseUrl}/chats/rescheduleMessage`, {
|
|
4639
4639
|
method: "POST",
|
|
4640
4640
|
headers: {
|
|
4641
4641
|
"Content-Type": "application/json",
|
|
@@ -4649,50 +4649,50 @@ function ks({ environment: e }) {
|
|
|
4649
4649
|
})
|
|
4650
4650
|
});
|
|
4651
4651
|
if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
|
|
4652
|
-
await
|
|
4652
|
+
await Je(e.originalChatUid);
|
|
4653
4653
|
} catch (e) {
|
|
4654
4654
|
throw g.value = Q(e, "Unable to reschedule the message."), e;
|
|
4655
4655
|
} finally {
|
|
4656
4656
|
d.value = !1;
|
|
4657
4657
|
}
|
|
4658
4658
|
}
|
|
4659
|
-
function
|
|
4660
|
-
let t = new
|
|
4659
|
+
function $e(e) {
|
|
4660
|
+
let t = new U.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
|
|
4661
4661
|
return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
|
|
4662
4662
|
}
|
|
4663
|
-
function
|
|
4664
|
-
return new
|
|
4663
|
+
function et(e) {
|
|
4664
|
+
return new U.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
|
|
4665
4665
|
}
|
|
4666
|
-
async function
|
|
4667
|
-
let t =
|
|
4666
|
+
async function tt(e) {
|
|
4667
|
+
let t = P.value;
|
|
4668
4668
|
if (!t) return y.value = [], S.value = !1, !1;
|
|
4669
|
-
if ((e?.reset ||
|
|
4669
|
+
if ((e?.reset || ce?.conversationId !== t.id) && (ce = {
|
|
4670
4670
|
conversationId: t.id,
|
|
4671
|
-
request:
|
|
4672
|
-
}, S.value = !0), !
|
|
4673
|
-
let n = await
|
|
4674
|
-
y.value = e?.reset ? Ws(y.value.filter((e) => e.conversationId === t.id && Gs(e)), r) : Ws(y.value, r), S.value = n.length === 50,
|
|
4671
|
+
request: $e(t)
|
|
4672
|
+
}, S.value = !0), !ce) return !1;
|
|
4673
|
+
let n = await ce.request.fetchPrevious(), r = n.map((e) => N(e, _.value?.uid)).filter(Ks).sort(Hs);
|
|
4674
|
+
y.value = e?.reset ? Ws(y.value.filter((e) => e.conversationId === t.id && Gs(e)), r) : Ws(y.value, r), S.value = n.length === 50, H?.setMessages(t.id, y.value);
|
|
4675
4675
|
let i = n[n.length - 1];
|
|
4676
|
-
return i && (await
|
|
4676
|
+
return i && (await vt(i), await _t(i)), n.length > 0;
|
|
4677
4677
|
}
|
|
4678
|
-
async function
|
|
4679
|
-
let e =
|
|
4678
|
+
async function nt() {
|
|
4679
|
+
let e = P.value;
|
|
4680
4680
|
if (!e) {
|
|
4681
|
-
y.value = [], S.value = !1,
|
|
4681
|
+
y.value = [], S.value = !1, ce = null;
|
|
4682
4682
|
return;
|
|
4683
4683
|
}
|
|
4684
|
-
let t =
|
|
4685
|
-
if (a.value = !0, m.value &&
|
|
4686
|
-
S.value = !1,
|
|
4684
|
+
let t = ke(e.id);
|
|
4685
|
+
if (a.value = !0, m.value && H) {
|
|
4686
|
+
S.value = !1, ce = null, a.value = !1;
|
|
4687
4687
|
return;
|
|
4688
4688
|
}
|
|
4689
4689
|
try {
|
|
4690
|
-
await
|
|
4690
|
+
await tt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
|
|
4691
4691
|
...t,
|
|
4692
4692
|
unreadCount: 0
|
|
4693
|
-
} : t),
|
|
4693
|
+
} : t), H?.setConversations(v.value);
|
|
4694
4694
|
} catch (n) {
|
|
4695
|
-
let r =
|
|
4695
|
+
let r = H?.getMessages(e.id) ?? [];
|
|
4696
4696
|
if (r.length > 0) {
|
|
4697
4697
|
t || (y.value = r.sort(Hs));
|
|
4698
4698
|
return;
|
|
@@ -4702,27 +4702,27 @@ function ks({ environment: e }) {
|
|
|
4702
4702
|
a.value = !1;
|
|
4703
4703
|
}
|
|
4704
4704
|
}
|
|
4705
|
-
async function
|
|
4705
|
+
async function rt(e) {
|
|
4706
4706
|
let t = E.value?.id;
|
|
4707
4707
|
if (!t) return b.value = [], C.value = !1, !1;
|
|
4708
|
-
if ((e?.reset ||
|
|
4708
|
+
if ((e?.reset || le?.parentMessageId !== t) && (le = {
|
|
4709
4709
|
parentMessageId: t,
|
|
4710
|
-
request:
|
|
4711
|
-
}, C.value = !0), !
|
|
4712
|
-
let n = await
|
|
4713
|
-
b.value = e?.reset ? Ws(b.value.filter((e) => e.parentMessageId === t && Gs(e)), r) : Ws(b.value, r), C.value = n.length === 50,
|
|
4710
|
+
request: et(t)
|
|
4711
|
+
}, C.value = !0), !le) return !1;
|
|
4712
|
+
let n = await le.request.fetchPrevious(), r = n.map((e) => N(e, _.value?.uid)).filter(Ks).sort(Hs);
|
|
4713
|
+
b.value = e?.reset ? Ws(b.value.filter((e) => e.parentMessageId === t && Gs(e)), r) : Ws(b.value, r), C.value = n.length === 50, H?.setThreadMessages(t, b.value);
|
|
4714
4714
|
let i = n[n.length - 1];
|
|
4715
|
-
return i && (await
|
|
4715
|
+
return i && (await vt(i), await _t(i)), n.length > 0;
|
|
4716
4716
|
}
|
|
4717
|
-
async function
|
|
4718
|
-
if (o.value = !0, m.value &&
|
|
4719
|
-
b.value =
|
|
4717
|
+
async function it(e) {
|
|
4718
|
+
if (o.value = !0, m.value && H) {
|
|
4719
|
+
b.value = H.getThreadMessages(e).sort(Hs), C.value = !1, le = null, o.value = !1;
|
|
4720
4720
|
return;
|
|
4721
4721
|
}
|
|
4722
4722
|
try {
|
|
4723
|
-
await
|
|
4723
|
+
await rt({ reset: !0 });
|
|
4724
4724
|
} catch (t) {
|
|
4725
|
-
let n =
|
|
4725
|
+
let n = H?.getThreadMessages(e) ?? [];
|
|
4726
4726
|
if (n.length > 0) {
|
|
4727
4727
|
b.value = n.sort(Hs);
|
|
4728
4728
|
return;
|
|
@@ -4732,29 +4732,29 @@ function ks({ environment: e }) {
|
|
|
4732
4732
|
o.value = !1;
|
|
4733
4733
|
}
|
|
4734
4734
|
}
|
|
4735
|
-
async function
|
|
4735
|
+
async function at() {
|
|
4736
4736
|
if (a.value || s.value || !S.value) return !1;
|
|
4737
4737
|
s.value = !0, g.value = null;
|
|
4738
4738
|
try {
|
|
4739
|
-
return await
|
|
4739
|
+
return await tt();
|
|
4740
4740
|
} catch (e) {
|
|
4741
4741
|
throw g.value = Q(e, "Unable to load messages."), e;
|
|
4742
4742
|
} finally {
|
|
4743
4743
|
s.value = !1;
|
|
4744
4744
|
}
|
|
4745
4745
|
}
|
|
4746
|
-
async function
|
|
4746
|
+
async function ot() {
|
|
4747
4747
|
if (o.value || c.value || !C.value) return !1;
|
|
4748
4748
|
c.value = !0, g.value = null;
|
|
4749
4749
|
try {
|
|
4750
|
-
return await
|
|
4750
|
+
return await rt();
|
|
4751
4751
|
} catch (e) {
|
|
4752
4752
|
throw g.value = Q(e, "Unable to load thread."), e;
|
|
4753
4753
|
} finally {
|
|
4754
4754
|
c.value = !1;
|
|
4755
4755
|
}
|
|
4756
4756
|
}
|
|
4757
|
-
async function
|
|
4757
|
+
async function st(e) {
|
|
4758
4758
|
let t = e.trim();
|
|
4759
4759
|
if (!t) return !1;
|
|
4760
4760
|
let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
|
|
@@ -4762,101 +4762,101 @@ function ks({ environment: e }) {
|
|
|
4762
4762
|
let r = 0;
|
|
4763
4763
|
for (; C.value && E.value && r < 100;) {
|
|
4764
4764
|
r += 1;
|
|
4765
|
-
let e = await
|
|
4765
|
+
let e = await ot();
|
|
4766
4766
|
if (n()) return !0;
|
|
4767
4767
|
if (!e) break;
|
|
4768
4768
|
}
|
|
4769
|
-
for (; S.value &&
|
|
4769
|
+
for (; S.value && P.value && r < 100;) {
|
|
4770
4770
|
r += 1;
|
|
4771
|
-
let e = await
|
|
4771
|
+
let e = await at();
|
|
4772
4772
|
if (n()) return !0;
|
|
4773
4773
|
if (!e) break;
|
|
4774
4774
|
}
|
|
4775
4775
|
return n();
|
|
4776
4776
|
}
|
|
4777
|
-
async function
|
|
4778
|
-
let e = await
|
|
4777
|
+
async function lt() {
|
|
4778
|
+
let e = await U.getLoggedinUser();
|
|
4779
4779
|
_.value = e ? Is(e) : null, h.value = !!e;
|
|
4780
4780
|
}
|
|
4781
|
-
function
|
|
4782
|
-
|
|
4781
|
+
function ut() {
|
|
4782
|
+
te ||= (U.addConnectionListener(F, new U.ConnectionListener({
|
|
4783
4783
|
onConnected: () => {
|
|
4784
|
-
if (p.value = !0,
|
|
4785
|
-
|
|
4784
|
+
if (p.value = !0, ie = 0, Ce(), V) {
|
|
4785
|
+
G();
|
|
4786
4786
|
return;
|
|
4787
4787
|
}
|
|
4788
|
-
|
|
4788
|
+
Ut();
|
|
4789
4789
|
},
|
|
4790
4790
|
onDisconnected: () => {
|
|
4791
|
-
p.value = !1, !m.value && h.value && !
|
|
4791
|
+
p.value = !1, !m.value && h.value && !ae && (V = !0, Ee(!0));
|
|
4792
4792
|
}
|
|
4793
|
-
})),
|
|
4793
|
+
})), U.addMessageListener(I, new U.MessageListener({
|
|
4794
4794
|
onTextMessageReceived: (e) => {
|
|
4795
|
-
|
|
4795
|
+
dt(e);
|
|
4796
4796
|
},
|
|
4797
4797
|
onMediaMessageReceived: (e) => {
|
|
4798
|
-
|
|
4798
|
+
dt(e);
|
|
4799
4799
|
},
|
|
4800
4800
|
onCustomMessageReceived: (e) => {
|
|
4801
|
-
|
|
4801
|
+
dt(e);
|
|
4802
4802
|
},
|
|
4803
4803
|
onMessagesDelivered: () => {
|
|
4804
|
-
|
|
4804
|
+
Te() || xt({ includeThread: !1 });
|
|
4805
4805
|
},
|
|
4806
4806
|
onMessagesRead: () => {
|
|
4807
|
-
|
|
4807
|
+
Te() || xt({ includeThread: !1 });
|
|
4808
4808
|
},
|
|
4809
4809
|
onMessageEdited: (e) => {
|
|
4810
|
-
let t =
|
|
4811
|
-
Ks(t) && (
|
|
4810
|
+
let t = N(e, _.value?.uid);
|
|
4811
|
+
Ks(t) && (ht(t), mt(e));
|
|
4812
4812
|
},
|
|
4813
4813
|
onMessageDeleted: (e) => {
|
|
4814
|
-
let t =
|
|
4815
|
-
t.parentMessageId ?
|
|
4814
|
+
let t = N(e, _.value?.uid);
|
|
4815
|
+
t.parentMessageId ? Ot(t) : (Ot(t), kt(t)), Dt();
|
|
4816
4816
|
},
|
|
4817
4817
|
onMessageReactionAdded: () => {
|
|
4818
|
-
|
|
4818
|
+
xt();
|
|
4819
4819
|
},
|
|
4820
4820
|
onMessageReactionRemoved: () => {
|
|
4821
|
-
|
|
4821
|
+
xt();
|
|
4822
4822
|
},
|
|
4823
4823
|
onMessagesDeliveredToAll: () => {
|
|
4824
|
-
|
|
4824
|
+
Te() || xt({ includeThread: !1 });
|
|
4825
4825
|
},
|
|
4826
4826
|
onMessagesReadByAll: () => {
|
|
4827
|
-
|
|
4827
|
+
Te() || xt({ includeThread: !1 });
|
|
4828
4828
|
}
|
|
4829
4829
|
})), !0);
|
|
4830
4830
|
}
|
|
4831
|
-
async function
|
|
4832
|
-
let t =
|
|
4831
|
+
async function dt(e) {
|
|
4832
|
+
let t = N(e, _.value?.uid);
|
|
4833
4833
|
if (Ks(t)) {
|
|
4834
|
-
if (
|
|
4835
|
-
|
|
4834
|
+
if (mt(e), await vt(e), t.parentMessageId) {
|
|
4835
|
+
gt(t), Et(t.parentMessageId), Dt();
|
|
4836
4836
|
return;
|
|
4837
4837
|
}
|
|
4838
|
-
t.conversationId === T.value && (
|
|
4838
|
+
t.conversationId === T.value && (ht(t), Dt(), await _t(e));
|
|
4839
4839
|
}
|
|
4840
4840
|
}
|
|
4841
|
-
async function
|
|
4841
|
+
async function ft(e) {
|
|
4842
4842
|
return await Promise.all(e.map(async (e) => {
|
|
4843
|
-
let t = await
|
|
4843
|
+
let t = await pt(e.targetId);
|
|
4844
4844
|
return {
|
|
4845
4845
|
...e,
|
|
4846
4846
|
muteSettings: t ? new Date(t) : null
|
|
4847
4847
|
};
|
|
4848
4848
|
}));
|
|
4849
4849
|
}
|
|
4850
|
-
async function
|
|
4851
|
-
let t =
|
|
4850
|
+
async function pt(e) {
|
|
4851
|
+
let t = H?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
|
|
4852
4852
|
if (t && (m.value || !n)) return t.mutedUntil;
|
|
4853
4853
|
if (m.value || !h.value) return t?.mutedUntil ?? null;
|
|
4854
4854
|
try {
|
|
4855
|
-
let n = (await
|
|
4855
|
+
let n = (await U.getLoggedinUser())?.getUid?.();
|
|
4856
4856
|
if (!n || e === n) return t?.mutedUntil ?? null;
|
|
4857
|
-
let r =
|
|
4857
|
+
let r = ge();
|
|
4858
4858
|
if (!r) return t?.mutedUntil ?? null;
|
|
4859
|
-
let i = await fetch(`${
|
|
4859
|
+
let i = await fetch(`${W().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
|
|
4860
4860
|
method: "GET",
|
|
4861
4861
|
headers: {
|
|
4862
4862
|
"Content-Type": "application/json",
|
|
@@ -4865,7 +4865,7 @@ function ks({ environment: e }) {
|
|
|
4865
4865
|
});
|
|
4866
4866
|
if (!i.ok) return t?.mutedUntil ?? null;
|
|
4867
4867
|
let a = await i.json();
|
|
4868
|
-
return
|
|
4868
|
+
return H?.storeParticipantSettings({
|
|
4869
4869
|
chatUid: e,
|
|
4870
4870
|
mutedUntil: a.mutedUntil ?? null,
|
|
4871
4871
|
lastUpdated: Date.now()
|
|
@@ -4874,12 +4874,12 @@ function ks({ environment: e }) {
|
|
|
4874
4874
|
return t?.mutedUntil ?? null;
|
|
4875
4875
|
}
|
|
4876
4876
|
}
|
|
4877
|
-
function
|
|
4878
|
-
let t =
|
|
4877
|
+
function mt(e) {
|
|
4878
|
+
let t = N(e, _.value?.uid);
|
|
4879
4879
|
if (!Ks(t) || t.isDeleted) return;
|
|
4880
4880
|
let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
|
|
4881
4881
|
if (!r) {
|
|
4882
|
-
|
|
4882
|
+
Pe();
|
|
4883
4883
|
return;
|
|
4884
4884
|
}
|
|
4885
4885
|
let i = {
|
|
@@ -4888,56 +4888,56 @@ function ks({ environment: e }) {
|
|
|
4888
4888
|
lastMessageAt: /* @__PURE__ */ new Date((e.getSentAt?.() ?? 0) * 1e3),
|
|
4889
4889
|
unreadCount: n === T.value ? 0 : r.unreadCount + 1
|
|
4890
4890
|
};
|
|
4891
|
-
v.value = Vs(v.value.map((e) => e.id === n ? i : e)),
|
|
4891
|
+
v.value = Vs(v.value.map((e) => e.id === n ? i : e)), H?.setConversations(v.value);
|
|
4892
4892
|
}
|
|
4893
|
-
function
|
|
4894
|
-
y.value = Us(y.value, e), T.value &&
|
|
4893
|
+
function ht(e) {
|
|
4894
|
+
y.value = Us(y.value, e), T.value && H?.setMessages(T.value, y.value);
|
|
4895
4895
|
}
|
|
4896
|
-
function
|
|
4897
|
-
e.parentMessageId === E.value?.id && (b.value = Us(b.value, e), e.parentMessageId &&
|
|
4896
|
+
function gt(e) {
|
|
4897
|
+
e.parentMessageId === E.value?.id && (b.value = Us(b.value, e), e.parentMessageId && H?.setThreadMessages(e.parentMessageId, b.value));
|
|
4898
4898
|
}
|
|
4899
|
-
async function
|
|
4899
|
+
async function _t(e) {
|
|
4900
4900
|
if (m.value) return;
|
|
4901
4901
|
let t = e.getSender?.()?.getUid?.();
|
|
4902
|
-
!t || t === _.value?.uid || e.getReadByMeAt?.() || (
|
|
4902
|
+
!t || t === _.value?.uid || e.getReadByMeAt?.() || (we(), await U.markAsRead(e));
|
|
4903
4903
|
}
|
|
4904
|
-
async function
|
|
4904
|
+
async function vt(e) {
|
|
4905
4905
|
if (m.value) return;
|
|
4906
4906
|
let t = e.getSender?.()?.getUid?.();
|
|
4907
|
-
!t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (
|
|
4907
|
+
!t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (we(), await U.markAsDelivered(e));
|
|
4908
4908
|
}
|
|
4909
|
-
async function
|
|
4910
|
-
return m.value ? [] : Ps(await
|
|
4909
|
+
async function yt(e) {
|
|
4910
|
+
return m.value ? [] : Ps(await U.getMessageReceipts(String(e.id)));
|
|
4911
4911
|
}
|
|
4912
|
-
function
|
|
4913
|
-
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1,
|
|
4912
|
+
function bt() {
|
|
4913
|
+
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, Ce(), ie = 0, V = !1, ae = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, ce = null, le = null, se.clear();
|
|
4914
4914
|
}
|
|
4915
|
-
async function
|
|
4916
|
-
if (
|
|
4915
|
+
async function xt(e) {
|
|
4916
|
+
if (B) return B;
|
|
4917
4917
|
let t = e?.includeThread ?? !0;
|
|
4918
|
-
|
|
4919
|
-
|
|
4918
|
+
B = (async () => {
|
|
4919
|
+
P.value && await nt(), t && E.value && await it(E.value.id);
|
|
4920
4920
|
})();
|
|
4921
4921
|
try {
|
|
4922
|
-
await
|
|
4922
|
+
await B;
|
|
4923
4923
|
} finally {
|
|
4924
|
-
|
|
4924
|
+
B = null;
|
|
4925
4925
|
}
|
|
4926
4926
|
}
|
|
4927
|
-
function
|
|
4928
|
-
|
|
4927
|
+
function St(e) {
|
|
4928
|
+
Ct(e), e.parentMessageId && Et(e.parentMessageId, e.replyCount), Dt();
|
|
4929
4929
|
}
|
|
4930
|
-
function
|
|
4930
|
+
function Ct(e) {
|
|
4931
4931
|
if (e.parentMessageId) {
|
|
4932
4932
|
E.value?.id === e.parentMessageId && (b.value = Us(b.value, e));
|
|
4933
4933
|
return;
|
|
4934
4934
|
}
|
|
4935
4935
|
y.value = Us(y.value, e), E.value?.id === e.id && (E.value = e);
|
|
4936
4936
|
}
|
|
4937
|
-
function
|
|
4937
|
+
function wt(e, t) {
|
|
4938
4938
|
return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
|
|
4939
4939
|
}
|
|
4940
|
-
function
|
|
4940
|
+
function Tt(e, t) {
|
|
4941
4941
|
let n = e.reactions.find((e) => e.emoji === t);
|
|
4942
4942
|
return n ? n.reactedByMe && n.count === 1 ? {
|
|
4943
4943
|
...e,
|
|
@@ -4958,7 +4958,7 @@ function ks({ environment: e }) {
|
|
|
4958
4958
|
}]
|
|
4959
4959
|
};
|
|
4960
4960
|
}
|
|
4961
|
-
function
|
|
4961
|
+
function Et(e, t) {
|
|
4962
4962
|
let n = y.value.find((t) => t.id === e);
|
|
4963
4963
|
if (!n) return;
|
|
4964
4964
|
let r = {
|
|
@@ -4967,18 +4967,18 @@ function ks({ environment: e }) {
|
|
|
4967
4967
|
};
|
|
4968
4968
|
y.value = Us(y.value, r), E.value?.id === e && (E.value = r);
|
|
4969
4969
|
}
|
|
4970
|
-
function
|
|
4971
|
-
T.value &&
|
|
4970
|
+
function Dt() {
|
|
4971
|
+
T.value && H?.setMessages(T.value, y.value), E.value && H?.setThreadMessages(E.value.id, b.value);
|
|
4972
4972
|
}
|
|
4973
|
-
function
|
|
4974
|
-
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id),
|
|
4973
|
+
function Ot(e) {
|
|
4974
|
+
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), H?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && H?.setMessages(T.value, y.value)), e.muid) {
|
|
4975
4975
|
k.value = k.value.filter((t) => t.muid !== e.muid);
|
|
4976
|
-
let t =
|
|
4977
|
-
for (let e of t)
|
|
4976
|
+
let t = H?.getQueue().filter((t) => t.muid === e.muid) ?? [];
|
|
4977
|
+
for (let e of t) H?.dequeue(e.id), oe.delete(e.id), e.kind === "attachment" && H?.deleteQueuedAttachment(e.id);
|
|
4978
4978
|
}
|
|
4979
|
-
e.parentMessageId ||
|
|
4979
|
+
e.parentMessageId || At(e.conversationId);
|
|
4980
4980
|
}
|
|
4981
|
-
function
|
|
4981
|
+
function kt(e) {
|
|
4982
4982
|
if (e.parentMessageId) return;
|
|
4983
4983
|
let t = e.conversationId, n = v.value.find((e) => e.id === t);
|
|
4984
4984
|
if (!n) return;
|
|
@@ -5000,26 +5000,26 @@ function ks({ environment: e }) {
|
|
|
5000
5000
|
...e,
|
|
5001
5001
|
subtitle: "No messages yet",
|
|
5002
5002
|
lastMessageAt: void 0
|
|
5003
|
-
} : e : e)),
|
|
5003
|
+
} : e : e)), H?.setConversations(v.value);
|
|
5004
5004
|
}
|
|
5005
|
-
function
|
|
5005
|
+
function At(e, t) {
|
|
5006
5006
|
let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
|
|
5007
5007
|
v.value = Vs(v.value.map((t) => t.id === e ? {
|
|
5008
5008
|
...t,
|
|
5009
5009
|
subtitle: r ? Ys(r) : "No messages yet",
|
|
5010
5010
|
lastMessageAt: r?.sentAt
|
|
5011
|
-
} : t)),
|
|
5011
|
+
} : t)), H?.setConversations(v.value);
|
|
5012
5012
|
}
|
|
5013
|
-
function
|
|
5013
|
+
function jt(e) {
|
|
5014
5014
|
v.value = Vs(v.value.map((t) => t.id === e.conversationId ? {
|
|
5015
5015
|
...t,
|
|
5016
5016
|
subtitle: Ys(e),
|
|
5017
5017
|
lastMessageAt: e.sentAt,
|
|
5018
5018
|
unreadCount: 0
|
|
5019
|
-
} : t)),
|
|
5019
|
+
} : t)), H?.setConversations(v.value);
|
|
5020
5020
|
}
|
|
5021
|
-
function
|
|
5022
|
-
let t = /* @__PURE__ */ new Date(), n =
|
|
5021
|
+
function Mt(e) {
|
|
5022
|
+
let t = /* @__PURE__ */ new Date(), n = Pt(e.metadata);
|
|
5023
5023
|
return {
|
|
5024
5024
|
id: `local-${e.muid}`,
|
|
5025
5025
|
muid: e.muid,
|
|
@@ -5058,11 +5058,11 @@ function ks({ environment: e }) {
|
|
|
5058
5058
|
source: null
|
|
5059
5059
|
};
|
|
5060
5060
|
}
|
|
5061
|
-
function
|
|
5061
|
+
function Nt(e, t) {
|
|
5062
5062
|
let n = {};
|
|
5063
5063
|
return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = hs(e), n) : n;
|
|
5064
5064
|
}
|
|
5065
|
-
function
|
|
5065
|
+
function Pt(e) {
|
|
5066
5066
|
let t = e.replyPreview;
|
|
5067
5067
|
if (!t || typeof t != "object") return;
|
|
5068
5068
|
let n = t;
|
|
@@ -5073,13 +5073,13 @@ function ks({ environment: e }) {
|
|
|
5073
5073
|
kind: n.kind ?? "text"
|
|
5074
5074
|
};
|
|
5075
5075
|
}
|
|
5076
|
-
function
|
|
5076
|
+
function J(e) {
|
|
5077
5077
|
if (typeof navigator < "u" && !navigator.onLine) return !0;
|
|
5078
5078
|
let t = Q(e, "").toLowerCase();
|
|
5079
5079
|
return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
|
|
5080
5080
|
}
|
|
5081
|
-
function
|
|
5082
|
-
let a =
|
|
5081
|
+
function Ft(e, t, n, r, i) {
|
|
5082
|
+
let a = Mt({
|
|
5083
5083
|
conversation: e,
|
|
5084
5084
|
kind: "text",
|
|
5085
5085
|
text: t,
|
|
@@ -5088,7 +5088,7 @@ function ks({ environment: e }) {
|
|
|
5088
5088
|
muid: i,
|
|
5089
5089
|
deliveryState: "queued"
|
|
5090
5090
|
});
|
|
5091
|
-
|
|
5091
|
+
zt(a, {
|
|
5092
5092
|
id: a.id,
|
|
5093
5093
|
muid: i,
|
|
5094
5094
|
conversationId: e.id,
|
|
@@ -5101,9 +5101,9 @@ function ks({ environment: e }) {
|
|
|
5101
5101
|
createdAt: a.sentAt.toISOString()
|
|
5102
5102
|
});
|
|
5103
5103
|
}
|
|
5104
|
-
function
|
|
5105
|
-
if (
|
|
5106
|
-
let a =
|
|
5104
|
+
function It(e, t, n, r, i) {
|
|
5105
|
+
if (Lt(e, t, r)) return;
|
|
5106
|
+
let a = Mt({
|
|
5107
5107
|
conversation: e,
|
|
5108
5108
|
kind: "poll",
|
|
5109
5109
|
text: `Poll: ${t.question}`,
|
|
@@ -5113,7 +5113,7 @@ function ks({ environment: e }) {
|
|
|
5113
5113
|
muid: i,
|
|
5114
5114
|
deliveryState: "queued"
|
|
5115
5115
|
});
|
|
5116
|
-
|
|
5116
|
+
zt(a, {
|
|
5117
5117
|
id: a.id,
|
|
5118
5118
|
muid: i,
|
|
5119
5119
|
conversationId: e.id,
|
|
@@ -5126,7 +5126,7 @@ function ks({ environment: e }) {
|
|
|
5126
5126
|
createdAt: a.sentAt.toISOString()
|
|
5127
5127
|
});
|
|
5128
5128
|
}
|
|
5129
|
-
function
|
|
5129
|
+
function Lt(e, t, n) {
|
|
5130
5130
|
let r = Date.now(), i = (e) => e.trim().toLowerCase(), a = (e) => e.map((e) => i(e)).filter(Boolean).join("\0"), o = i(t.question), s = a(t.options);
|
|
5131
5131
|
return k.value.some((t) => {
|
|
5132
5132
|
if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
|
|
@@ -5134,8 +5134,8 @@ function ks({ environment: e }) {
|
|
|
5134
5134
|
return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
|
|
5135
5135
|
});
|
|
5136
5136
|
}
|
|
5137
|
-
async function
|
|
5138
|
-
let a = ec(t.file), o =
|
|
5137
|
+
async function Rt(e, t, n, r, i) {
|
|
5138
|
+
let a = ec(t.file), o = Mt({
|
|
5139
5139
|
conversation: e,
|
|
5140
5140
|
kind: a,
|
|
5141
5141
|
text: t.caption?.trim() ?? "",
|
|
@@ -5167,19 +5167,19 @@ function ks({ environment: e }) {
|
|
|
5167
5167
|
parentMessageId: r,
|
|
5168
5168
|
createdAt: o.sentAt.toISOString()
|
|
5169
5169
|
};
|
|
5170
|
-
|
|
5170
|
+
oe.set(s.id, t.file);
|
|
5171
5171
|
try {
|
|
5172
|
-
await
|
|
5172
|
+
await H?.storeQueuedAttachment(s.id, t.file);
|
|
5173
5173
|
} catch {}
|
|
5174
|
-
|
|
5174
|
+
zt(o, s);
|
|
5175
5175
|
}
|
|
5176
|
-
function
|
|
5177
|
-
k.value = [...k.value, t],
|
|
5176
|
+
function zt(e, t) {
|
|
5177
|
+
k.value = [...k.value, t], H?.enqueue(t), Bt(e);
|
|
5178
5178
|
}
|
|
5179
|
-
function
|
|
5180
|
-
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Us(b.value, e)),
|
|
5179
|
+
function Bt(e) {
|
|
5180
|
+
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Us(b.value, e)), Et(e.parentMessageId)) : y.value = Us(y.value, e), jt(e), Dt();
|
|
5181
5181
|
}
|
|
5182
|
-
function
|
|
5182
|
+
function Vt(e, t) {
|
|
5183
5183
|
let n = (n) => n.map((n) => {
|
|
5184
5184
|
let r = qs(n);
|
|
5185
5185
|
return n.muid !== t && r !== t ? n : {
|
|
@@ -5187,40 +5187,40 @@ function ks({ environment: e }) {
|
|
|
5187
5187
|
deliveryState: e
|
|
5188
5188
|
};
|
|
5189
5189
|
});
|
|
5190
|
-
y.value = n(y.value), b.value = n(b.value),
|
|
5190
|
+
y.value = n(y.value), b.value = n(b.value), Dt();
|
|
5191
5191
|
}
|
|
5192
|
-
function
|
|
5192
|
+
function Ht(e) {
|
|
5193
5193
|
if (!e) return;
|
|
5194
5194
|
let t = [...y.value, ...b.value].filter((t) => {
|
|
5195
5195
|
if (!t.id.startsWith("local-")) return !1;
|
|
5196
5196
|
let n = qs(t);
|
|
5197
5197
|
return t.muid === e || n === e;
|
|
5198
5198
|
});
|
|
5199
|
-
for (let e of t)
|
|
5199
|
+
for (let e of t) Ot(e);
|
|
5200
5200
|
}
|
|
5201
|
-
async function
|
|
5201
|
+
async function Ut() {
|
|
5202
5202
|
if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
|
|
5203
5203
|
f.value = !0;
|
|
5204
5204
|
try {
|
|
5205
|
-
let e = [...k.value].filter((e) => !
|
|
5206
|
-
for (let t of e) if (!
|
|
5207
|
-
|
|
5205
|
+
let e = [...k.value].filter((e) => !se.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
|
|
5206
|
+
for (let t of e) if (!se.has(t.id)) {
|
|
5207
|
+
se.add(t.id);
|
|
5208
5208
|
try {
|
|
5209
|
-
let e = await
|
|
5210
|
-
k.value = k.value.filter((e) => e.id !== t.id),
|
|
5209
|
+
let e = await Wt(t);
|
|
5210
|
+
k.value = k.value.filter((e) => e.id !== t.id), H?.dequeue(t.id), oe.delete(t.id), t.kind === "attachment" && await H?.deleteQueuedAttachment(t.id), Ht(t.muid), e ? St(N(e, _.value?.uid)) : await xt();
|
|
5211
5211
|
} finally {
|
|
5212
|
-
|
|
5212
|
+
se.delete(t.id);
|
|
5213
5213
|
}
|
|
5214
5214
|
}
|
|
5215
5215
|
} catch (e) {
|
|
5216
|
-
|
|
5216
|
+
J(e) || (g.value = Q(e, "Unable to sync queued messages."));
|
|
5217
5217
|
} finally {
|
|
5218
5218
|
f.value = !1;
|
|
5219
5219
|
}
|
|
5220
5220
|
}
|
|
5221
5221
|
}
|
|
5222
|
-
async function
|
|
5223
|
-
let t = e.receiverType === "group" ?
|
|
5222
|
+
async function Wt(e) {
|
|
5223
|
+
let t = e.receiverType === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
|
|
5224
5224
|
if (e.kind === "poll" && e.poll) {
|
|
5225
5225
|
let n = {
|
|
5226
5226
|
question: e.poll.question,
|
|
@@ -5229,17 +5229,17 @@ function ks({ environment: e }) {
|
|
|
5229
5229
|
receiverType: t
|
|
5230
5230
|
};
|
|
5231
5231
|
e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
|
|
5232
|
-
let r = await
|
|
5232
|
+
let r = await U.callExtension("polls", "POST", "v2/create", n);
|
|
5233
5233
|
return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
|
|
5234
5234
|
}
|
|
5235
5235
|
if (e.kind === "attachment" && e.attachment) {
|
|
5236
|
-
let n =
|
|
5236
|
+
let n = oe.get(e.id) ?? await H?.getQueuedAttachment(e.id) ?? null;
|
|
5237
5237
|
if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
|
|
5238
|
-
let r = new
|
|
5239
|
-
return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption),
|
|
5238
|
+
let r = new U.MediaMessage(e.targetId, n, e.attachment.kind, t);
|
|
5239
|
+
return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), U.sendMediaMessage(r);
|
|
5240
5240
|
}
|
|
5241
|
-
let n = new
|
|
5242
|
-
return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)),
|
|
5241
|
+
let n = new U.TextMessage(e.targetId, e.text ?? "", t);
|
|
5242
|
+
return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), U.sendMessage(n);
|
|
5243
5243
|
}
|
|
5244
5244
|
return {
|
|
5245
5245
|
initialized: t,
|
|
@@ -5266,72 +5266,72 @@ function ks({ environment: e }) {
|
|
|
5266
5266
|
hasOlderThreadMessages: C,
|
|
5267
5267
|
pendingQueueCount: j,
|
|
5268
5268
|
activeConversationId: T,
|
|
5269
|
-
activeConversation:
|
|
5269
|
+
activeConversation: P,
|
|
5270
5270
|
activeThreadParentMessage: E,
|
|
5271
5271
|
replyToMessage: D,
|
|
5272
5272
|
editingMessage: O,
|
|
5273
|
-
init:
|
|
5274
|
-
connectRealtime:
|
|
5275
|
-
disconnectRealtime:
|
|
5276
|
-
login:
|
|
5277
|
-
logout:
|
|
5278
|
-
fetchConversations:
|
|
5279
|
-
selectConversation:
|
|
5280
|
-
sendTextMessage:
|
|
5281
|
-
sendAttachmentMessage:
|
|
5282
|
-
sendPollMessage:
|
|
5283
|
-
fetchScheduledMessages:
|
|
5284
|
-
loadOlderMessages:
|
|
5285
|
-
loadOlderThreadMessages:
|
|
5286
|
-
ensureMessageLoaded:
|
|
5287
|
-
scheduleMessage:
|
|
5288
|
-
rescheduleMessage:
|
|
5289
|
-
removeScheduledMessage:
|
|
5290
|
-
editScheduledMessage:
|
|
5291
|
-
setReplyToMessage:
|
|
5292
|
-
setEditingMessage:
|
|
5293
|
-
openThread:
|
|
5294
|
-
closeThread:
|
|
5295
|
-
fetchMessageReceipts:
|
|
5296
|
-
deleteMessage:
|
|
5297
|
-
votePoll:
|
|
5298
|
-
toggleReaction:
|
|
5299
|
-
translateMessage:
|
|
5273
|
+
init: fe,
|
|
5274
|
+
connectRealtime: Ae,
|
|
5275
|
+
disconnectRealtime: Me,
|
|
5276
|
+
login: pe,
|
|
5277
|
+
logout: me,
|
|
5278
|
+
fetchConversations: Pe,
|
|
5279
|
+
selectConversation: Fe,
|
|
5280
|
+
sendTextMessage: q,
|
|
5281
|
+
sendAttachmentMessage: Ve,
|
|
5282
|
+
sendPollMessage: He,
|
|
5283
|
+
fetchScheduledMessages: Je,
|
|
5284
|
+
loadOlderMessages: at,
|
|
5285
|
+
loadOlderThreadMessages: ot,
|
|
5286
|
+
ensureMessageLoaded: st,
|
|
5287
|
+
scheduleMessage: Ye,
|
|
5288
|
+
rescheduleMessage: Qe,
|
|
5289
|
+
removeScheduledMessage: Xe,
|
|
5290
|
+
editScheduledMessage: Ze,
|
|
5291
|
+
setReplyToMessage: Ie,
|
|
5292
|
+
setEditingMessage: K,
|
|
5293
|
+
openThread: Le,
|
|
5294
|
+
closeThread: Re,
|
|
5295
|
+
fetchMessageReceipts: yt,
|
|
5296
|
+
deleteMessage: Ke,
|
|
5297
|
+
votePoll: Ue,
|
|
5298
|
+
toggleReaction: Ge,
|
|
5299
|
+
translateMessage: qe,
|
|
5300
5300
|
mentionDisplayNamesByUid: A,
|
|
5301
|
-
rememberMentionDisplayNames:
|
|
5301
|
+
rememberMentionDisplayNames: M
|
|
5302
5302
|
};
|
|
5303
5303
|
}
|
|
5304
5304
|
async function As(e) {
|
|
5305
|
-
return
|
|
5306
|
-
let t =
|
|
5307
|
-
await
|
|
5305
|
+
return de(e), Ds === e && Os || (Os = (async () => {
|
|
5306
|
+
let t = W(), n = new U.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(U.StorageMode.SESSION).build();
|
|
5307
|
+
await U.init(t.appId, n), Ds = e;
|
|
5308
5308
|
})()), Os;
|
|
5309
5309
|
}
|
|
5310
5310
|
async function js(e) {
|
|
5311
5311
|
let t = JSON.parse(atob(e.split(".")[1]));
|
|
5312
5312
|
if (!t.sub) throw Error("Cannot read JWT subject from access token.");
|
|
5313
|
-
let n =
|
|
5313
|
+
let n = ve();
|
|
5314
5314
|
if (n && n.sub === t.sub && n.token) return n.token;
|
|
5315
|
-
let r = await fetch(`${
|
|
5315
|
+
let r = await fetch(`${W().chatApiBaseUrl}/chats/token`, {
|
|
5316
5316
|
method: "POST",
|
|
5317
5317
|
headers: new Headers([["Authorization", `Bearer ${e}`]])
|
|
5318
5318
|
});
|
|
5319
|
-
if (r.status === 401) throw
|
|
5319
|
+
if (r.status === 401) throw _e(null), xe(), Error("Unauthorized while fetching CometChat token.");
|
|
5320
5320
|
if (!r.ok) throw Error(`Token exchange failed with status ${r.status}.`);
|
|
5321
5321
|
let i = await r.json();
|
|
5322
|
-
return
|
|
5322
|
+
return be({
|
|
5323
5323
|
sub: t.sub,
|
|
5324
5324
|
token: i.token
|
|
5325
5325
|
}), i.token;
|
|
5326
5326
|
}
|
|
5327
5327
|
function Ms(e, t) {
|
|
5328
|
-
let n = e.getConversationWith(), r = e.getConversationType() ===
|
|
5328
|
+
let n = e.getConversationWith(), r = e.getConversationType() === U.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
|
|
5329
5329
|
if (c && e.getConversationId() === c) return {
|
|
5330
5330
|
id: e.getConversationId(),
|
|
5331
5331
|
targetId: o,
|
|
5332
5332
|
type: r,
|
|
5333
|
-
title:
|
|
5334
|
-
subtitle:
|
|
5333
|
+
title: ze("scheduledMessages"),
|
|
5334
|
+
subtitle: ze("hiddenHelperConversation"),
|
|
5335
5335
|
unreadCount: 0,
|
|
5336
5336
|
tags: [],
|
|
5337
5337
|
source: e
|
|
@@ -5343,7 +5343,7 @@ function Ms(e, t) {
|
|
|
5343
5343
|
type: r,
|
|
5344
5344
|
title: n.getName() ?? o,
|
|
5345
5345
|
subtitle: l && Ks(l) && !l.isDeleted ? Ys(l) : "No messages yet",
|
|
5346
|
-
avatar: i ?
|
|
5346
|
+
avatar: i ? Se(i.getAvatar()) : void 0,
|
|
5347
5347
|
unreadCount: Number.isFinite(u) ? u : 0,
|
|
5348
5348
|
lastMessageAt: s && !l?.isDeleted ? /* @__PURE__ */ new Date((s.getSentAt?.() ?? 0) * 1e3) : void 0,
|
|
5349
5349
|
tags: (e.getTags() ?? []).map((e) => String(e)),
|
|
@@ -5402,7 +5402,7 @@ function Is(e) {
|
|
|
5402
5402
|
return {
|
|
5403
5403
|
uid: e.getUid(),
|
|
5404
5404
|
name: e.getName?.() ?? e.getUid(),
|
|
5405
|
-
avatar:
|
|
5405
|
+
avatar: Se(e.getAvatar?.()),
|
|
5406
5406
|
status: e.getStatus?.() ?? void 0
|
|
5407
5407
|
};
|
|
5408
5408
|
}
|
|
@@ -5422,22 +5422,22 @@ function zs(e, t) {
|
|
|
5422
5422
|
let n = e.getType?.(), r = e.getCategory?.(), i = xc(e);
|
|
5423
5423
|
if (String(r).toLowerCase() === "action") return uc(e);
|
|
5424
5424
|
if (i) return `Poll: ${i.question}`;
|
|
5425
|
-
if (n ===
|
|
5426
|
-
let t = us(e.getText
|
|
5425
|
+
if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5426
|
+
let t = us(e.getText());
|
|
5427
5427
|
if (t) return t;
|
|
5428
5428
|
}
|
|
5429
5429
|
if (String(r).toLowerCase() === "message" && mc(n)) {
|
|
5430
5430
|
let t = gc(e, pc(e))[0];
|
|
5431
5431
|
return e.getCaption?.()?.trim?.() || os(t ? [t] : [], "Sent an attachment");
|
|
5432
5432
|
}
|
|
5433
|
-
return e.getSender?.()?.getUid?.() === t ?
|
|
5433
|
+
return e.getSender?.()?.getUid?.() === t ? ze("youSentAMessage") : ze("unsupportedMessageType");
|
|
5434
5434
|
}
|
|
5435
5435
|
function Bs(e, t) {
|
|
5436
5436
|
if (e.getDeletedAt?.()) return "Message removed";
|
|
5437
5437
|
let n = e.getType?.(), r = e.getCategory?.(), i = xc(e);
|
|
5438
5438
|
if (String(r).toLowerCase() === "action") return uc(e);
|
|
5439
5439
|
if (i) return `Poll: ${i.question}`;
|
|
5440
|
-
if (n ===
|
|
5440
|
+
if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5441
5441
|
let t = ss(e.getText?.());
|
|
5442
5442
|
if (ls(t)) return t;
|
|
5443
5443
|
}
|
|
@@ -5447,10 +5447,10 @@ function Bs(e, t) {
|
|
|
5447
5447
|
let n = gc(e, pc(e))[0];
|
|
5448
5448
|
return os(n ? [n] : [], "Sent an attachment");
|
|
5449
5449
|
}
|
|
5450
|
-
return e.getSender?.()?.getUid?.() === t ?
|
|
5450
|
+
return e.getSender?.()?.getUid?.() === t ? ze("youSentAMessage") : ze("unsupportedMessageType");
|
|
5451
5451
|
}
|
|
5452
5452
|
function Vs(e) {
|
|
5453
|
-
return [...e].filter((e) => e.title !==
|
|
5453
|
+
return [...e].filter((e) => e.title !== ze("scheduledMessages")).sort((e, t) => {
|
|
5454
5454
|
let n = e.lastMessageAt?.getTime() ?? 0;
|
|
5455
5455
|
return (t.lastMessageAt?.getTime() ?? 0) - n;
|
|
5456
5456
|
});
|
|
@@ -5489,17 +5489,17 @@ function Q(e, t) {
|
|
|
5489
5489
|
return e instanceof Error && e.message ? e.message : t;
|
|
5490
5490
|
}
|
|
5491
5491
|
function Xs(e) {
|
|
5492
|
-
return e.type === "group" ?
|
|
5492
|
+
return e.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
|
|
5493
5493
|
}
|
|
5494
5494
|
function Zs() {
|
|
5495
|
-
let e =
|
|
5495
|
+
let e = ge();
|
|
5496
5496
|
if (!e) throw Error("Missing access token.");
|
|
5497
5497
|
return e;
|
|
5498
5498
|
}
|
|
5499
5499
|
async function Qs(e, t, n) {
|
|
5500
5500
|
let r = t.text?.trim();
|
|
5501
5501
|
if (!r) return;
|
|
5502
|
-
let i = Zs(), a = await fetch(`${
|
|
5502
|
+
let i = Zs(), a = await fetch(`${W().chatApiBaseUrl}/chats/scheduledMessages`, {
|
|
5503
5503
|
method: "POST",
|
|
5504
5504
|
headers: {
|
|
5505
5505
|
"Content-Type": "application/json",
|
|
@@ -5519,9 +5519,9 @@ async function Qs(e, t, n) {
|
|
|
5519
5519
|
}
|
|
5520
5520
|
async function $s(e, t, n) {
|
|
5521
5521
|
if (!t.file) return;
|
|
5522
|
-
let r = Zs(), i =
|
|
5522
|
+
let r = Zs(), i = ve()?.token;
|
|
5523
5523
|
if (!i) throw Error("Missing CometChat auth token.");
|
|
5524
|
-
let a = tc(t.file), o = t.caption?.trim() ?? "", s = nc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${
|
|
5524
|
+
let a = tc(t.file), o = t.caption?.trim() ?? "", s = nc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${W().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
|
|
5525
5525
|
method: "POST",
|
|
5526
5526
|
headers: {
|
|
5527
5527
|
Accept: "multipart/form-data",
|
|
@@ -5542,7 +5542,7 @@ function tc(e) {
|
|
|
5542
5542
|
return t;
|
|
5543
5543
|
}
|
|
5544
5544
|
function nc(e, t, n, r, i, a) {
|
|
5545
|
-
let o = new
|
|
5545
|
+
let o = new U.MediaMessage(e.targetId, t, n, Xs(e));
|
|
5546
5546
|
return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
|
|
5547
5547
|
scheduleDate: i,
|
|
5548
5548
|
file: t,
|
|
@@ -5575,11 +5575,11 @@ function ac(e, t) {
|
|
|
5575
5575
|
return typeof n == "string" && n.trim() ? n.trim() : e?.getName?.() ?? "System";
|
|
5576
5576
|
}
|
|
5577
5577
|
function oc(e, t) {
|
|
5578
|
-
return
|
|
5578
|
+
return Se(cc(t)) || (sc(e, "sender") ?? void 0);
|
|
5579
5579
|
}
|
|
5580
5580
|
function sc(e, t) {
|
|
5581
5581
|
let n = Dc(e)?.entities?.[t]?.entity;
|
|
5582
|
-
return
|
|
5582
|
+
return Se(cc(n));
|
|
5583
5583
|
}
|
|
5584
5584
|
function cc(e) {
|
|
5585
5585
|
if (!e || typeof e != "object") return e;
|
|
@@ -5649,18 +5649,18 @@ function hc(e) {
|
|
|
5649
5649
|
return String(t).startsWith("image/") ? "image" : String(t).startsWith("video/") ? "video" : String(t).startsWith("audio/") ? "audio" : "file";
|
|
5650
5650
|
}
|
|
5651
5651
|
function gc(e, t) {
|
|
5652
|
-
let n = e.getAttachment?.(), r = e
|
|
5653
|
-
if (!n && !r) return [];
|
|
5654
|
-
let
|
|
5652
|
+
let n = e.getAttachment?.(), r = Dc(e), i = r?.attachments?.[0] ?? null;
|
|
5653
|
+
if (!n && !i && !r?.url) return [];
|
|
5654
|
+
let a = t === "image" || t === "video" || t === "audio" || t === "file" ? t : hc(e), o = _c(e, n, i);
|
|
5655
5655
|
return [{
|
|
5656
|
-
kind:
|
|
5657
|
-
name: n?.getName?.() ??
|
|
5658
|
-
url: n?.getUrl?.() ?? n?.getFileUrl?.() ??
|
|
5659
|
-
mimeType: n?.getMimeType?.() ??
|
|
5660
|
-
extension: n?.getExtension?.() ??
|
|
5661
|
-
size: n?.getSize?.() ??
|
|
5662
|
-
width:
|
|
5663
|
-
height:
|
|
5656
|
+
kind: a,
|
|
5657
|
+
name: n?.getName?.() ?? i?.name ?? i?.fileName ?? "Attachment",
|
|
5658
|
+
url: n?.getUrl?.() ?? n?.getFileUrl?.() ?? i?.url ?? i?.fileUrl ?? (typeof r?.url == "string" ? r.url : void 0) ?? void 0,
|
|
5659
|
+
mimeType: n?.getMimeType?.() ?? i?.mimeType ?? void 0,
|
|
5660
|
+
extension: n?.getExtension?.() ?? i?.extension ?? void 0,
|
|
5661
|
+
size: n?.getSize?.() ?? i?.size ?? void 0,
|
|
5662
|
+
width: o?.width,
|
|
5663
|
+
height: o?.height
|
|
5664
5664
|
}];
|
|
5665
5665
|
}
|
|
5666
5666
|
function _c(e, t, n) {
|
|
@@ -5827,9 +5827,9 @@ function Ac(e, t) {
|
|
|
5827
5827
|
let n = t?.value?.getMetadata?.() ?? {};
|
|
5828
5828
|
if (!e?.getSender?.() || n.isChannel) return "";
|
|
5829
5829
|
let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
|
|
5830
|
-
e instanceof
|
|
5830
|
+
e instanceof U.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
|
|
5831
5831
|
let a = i.systemDisplayName;
|
|
5832
|
-
return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof
|
|
5832
|
+
return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof U.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
|
|
5833
5833
|
}
|
|
5834
5834
|
function jc(e, t = 25, n) {
|
|
5835
5835
|
let r = e.trim();
|
|
@@ -5852,7 +5852,7 @@ function jc(e, t = 25, n) {
|
|
|
5852
5852
|
};
|
|
5853
5853
|
}
|
|
5854
5854
|
async function Mc(e) {
|
|
5855
|
-
let t = new
|
|
5855
|
+
let t = new U.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
|
|
5856
5856
|
try {
|
|
5857
5857
|
for (; n;) {
|
|
5858
5858
|
let e = await t.fetchNext();
|
|
@@ -5871,7 +5871,7 @@ async function Mc(e) {
|
|
|
5871
5871
|
}
|
|
5872
5872
|
async function Nc(e) {
|
|
5873
5873
|
await Uc("failed to get muted setting. User not logged in");
|
|
5874
|
-
let t = await Wc(`${
|
|
5874
|
+
let t = await Wc(`${W().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
|
|
5875
5875
|
return Bc()?.storeParticipantSettings({
|
|
5876
5876
|
chatUid: e,
|
|
5877
5877
|
mutedUntil: t.mutedUntil,
|
|
@@ -5880,7 +5880,7 @@ async function Nc(e) {
|
|
|
5880
5880
|
}
|
|
5881
5881
|
async function Pc(e, t) {
|
|
5882
5882
|
await Uc("failed to mute chat. User not logged in");
|
|
5883
|
-
let n = await Wc(`${
|
|
5883
|
+
let n = await Wc(`${W().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, {
|
|
5884
5884
|
method: "PATCH",
|
|
5885
5885
|
body: JSON.stringify({ mutedUntil: t })
|
|
5886
5886
|
});
|
|
@@ -5891,10 +5891,10 @@ async function Pc(e, t) {
|
|
|
5891
5891
|
}), n.mutedUntil;
|
|
5892
5892
|
}
|
|
5893
5893
|
async function Fc() {
|
|
5894
|
-
return await Uc("failed to get muted all setting. User not logged in"), Wc(`${
|
|
5894
|
+
return await Uc("failed to get muted all setting. User not logged in"), Wc(`${W().chatApiBaseUrl}/person/settings`, { method: "GET" });
|
|
5895
5895
|
}
|
|
5896
5896
|
async function Ic(e) {
|
|
5897
|
-
return await Uc("failed to update person settings. User not logged in"), Wc(`${
|
|
5897
|
+
return await Uc("failed to update person settings. User not logged in"), Wc(`${W().chatApiBaseUrl}/person/settings`, {
|
|
5898
5898
|
method: "PATCH",
|
|
5899
5899
|
body: JSON.stringify(e)
|
|
5900
5900
|
});
|
|
@@ -5919,19 +5919,19 @@ function Bc() {
|
|
|
5919
5919
|
return e ? new bs(e) : null;
|
|
5920
5920
|
}
|
|
5921
5921
|
function Vc() {
|
|
5922
|
-
let e =
|
|
5923
|
-
return e ? `bcc-chat:${
|
|
5922
|
+
let e = je();
|
|
5923
|
+
return e ? `bcc-chat:${W().appId}:${e}` : null;
|
|
5924
5924
|
}
|
|
5925
5925
|
function Hc() {
|
|
5926
|
-
return
|
|
5926
|
+
return U.__bccCompatLoggedInUser ?? null;
|
|
5927
5927
|
}
|
|
5928
5928
|
async function Uc(e) {
|
|
5929
|
-
let t = await
|
|
5930
|
-
if (
|
|
5929
|
+
let t = await U.getLoggedinUser();
|
|
5930
|
+
if (U.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
|
|
5931
5931
|
return t;
|
|
5932
5932
|
}
|
|
5933
5933
|
async function Wc(e, t) {
|
|
5934
|
-
let n =
|
|
5934
|
+
let n = ge();
|
|
5935
5935
|
if (!n) throw Error("Missing access token.");
|
|
5936
5936
|
let r = await fetch(e, {
|
|
5937
5937
|
...t,
|
|
@@ -5995,15 +5995,17 @@ function ol(e) {
|
|
|
5995
5995
|
if ($.value && !e && !Zc.value) return $.value;
|
|
5996
5996
|
let t = e ?? Zc.value;
|
|
5997
5997
|
if (!t) throw Error("Environment has not been set yet. Call app.use(chat, { environment: ... }) first.");
|
|
5998
|
-
return (!$.value || Zc.value !== t) && (Zc.value = t,
|
|
5998
|
+
return (!$.value || Zc.value !== t) && (Zc.value = t, de(t), $.value = ks({ environment: t })), $.value;
|
|
5999
5999
|
}
|
|
6000
6000
|
function sl(e) {
|
|
6001
6001
|
let t = e.source?.getLastMessage?.();
|
|
6002
6002
|
if (t) return {
|
|
6003
6003
|
text: e.subtitle,
|
|
6004
6004
|
type: t.getType?.() ?? "text",
|
|
6005
|
+
senderUid: t.getSender?.()?.getUid?.() ?? "",
|
|
6005
6006
|
senderName: t.getSender?.()?.getName?.() ?? "System",
|
|
6006
6007
|
sentAt: /* @__PURE__ */ new Date((t.getSentAt?.() ?? 0) * 1e3),
|
|
6008
|
+
readAt: t.getReadAt?.() ? /* @__PURE__ */ new Date(t.getReadAt() * 1e3) : void 0,
|
|
6007
6009
|
messageReceipts: void 0
|
|
6008
6010
|
};
|
|
6009
6011
|
}
|
|
@@ -6025,17 +6027,17 @@ var cl = n(() => $.value?.connected.value ?? !1), ll = n(() => Xc.value && !cl.v
|
|
|
6025
6027
|
muteSettings: e.muteSettings ?? null
|
|
6026
6028
|
})));
|
|
6027
6029
|
async function pl(e, t) {
|
|
6028
|
-
tl.value = t.loggerCallback,
|
|
6030
|
+
tl.value = t.loggerCallback, Re(t.language ?? "en"), al(t.themeMode);
|
|
6029
6031
|
let n = e.config.globalProperties.$primevue;
|
|
6030
|
-
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat",
|
|
6032
|
+
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", ph), e.component("BccChatMessageList", ph), e.provide("theme", { theme: qc });
|
|
6031
6033
|
let r = ol(t.environment);
|
|
6032
6034
|
il(Yc.INFO, "Initializing chat", {
|
|
6033
6035
|
environment: t.environment,
|
|
6034
|
-
language:
|
|
6036
|
+
language: Fe.value,
|
|
6035
6037
|
themeMode: t.themeMode
|
|
6036
|
-
}), await r.init(), Xc.value = !0, rl?.(), p(t.accessToken) ? rl =
|
|
6038
|
+
}), await r.init(), Xc.value = !0, rl?.(), p(t.accessToken) ? rl = F(t.accessToken, async (e) => {
|
|
6037
6039
|
e ? await ml(e) : await hl();
|
|
6038
|
-
}, { immediate: !0 }) : t.accessToken && await ml(t.accessToken), il(Yc.INFO, "Chat initialized", { environment:
|
|
6040
|
+
}, { immediate: !0 }) : t.accessToken && await ml(t.accessToken), il(Yc.INFO, "Chat initialized", { environment: W().appId });
|
|
6039
6041
|
}
|
|
6040
6042
|
async function ml(e) {
|
|
6041
6043
|
if (!e) return hl();
|
|
@@ -6063,7 +6065,7 @@ function yl(e) {
|
|
|
6063
6065
|
$c.value = e;
|
|
6064
6066
|
}
|
|
6065
6067
|
function bl(e) {
|
|
6066
|
-
|
|
6068
|
+
Re(e);
|
|
6067
6069
|
}
|
|
6068
6070
|
function xl(e) {
|
|
6069
6071
|
al(e);
|
|
@@ -6077,7 +6079,7 @@ function Cl(e) {
|
|
|
6077
6079
|
async function wl(e) {
|
|
6078
6080
|
if (!ul.value) return null;
|
|
6079
6081
|
try {
|
|
6080
|
-
return await
|
|
6082
|
+
return await U.getGroup(e);
|
|
6081
6083
|
} catch (e) {
|
|
6082
6084
|
return e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND" ? void 0 : null;
|
|
6083
6085
|
}
|
|
@@ -6092,7 +6094,7 @@ async function El(e) {
|
|
|
6092
6094
|
}
|
|
6093
6095
|
async function Dl(e) {
|
|
6094
6096
|
try {
|
|
6095
|
-
return ul.value && (await
|
|
6097
|
+
return ul.value && (await U.getOnlineGroupMemberCount([e]))[e] || 0;
|
|
6096
6098
|
} catch {
|
|
6097
6099
|
return 0;
|
|
6098
6100
|
}
|
|
@@ -6123,7 +6125,7 @@ var jl = {
|
|
|
6123
6125
|
login: ml,
|
|
6124
6126
|
logout: hl,
|
|
6125
6127
|
setCurrentEnvironment: Cl,
|
|
6126
|
-
getCurrentEnvironment:
|
|
6128
|
+
getCurrentEnvironment: W,
|
|
6127
6129
|
setThemeMode: xl,
|
|
6128
6130
|
setLanguage: bl,
|
|
6129
6131
|
getGroup: wl,
|
|
@@ -6134,7 +6136,7 @@ var jl = {
|
|
|
6134
6136
|
searchChat: (e, t = 25) => jc(e, t, $.value?.currentUser.value?.uid),
|
|
6135
6137
|
getSenderDisplayName: Ac,
|
|
6136
6138
|
getMessageTextPreview: ms,
|
|
6137
|
-
proxyImage:
|
|
6139
|
+
proxyImage: Ce,
|
|
6138
6140
|
getMutedUntil: kl,
|
|
6139
6141
|
muteChat: Ol,
|
|
6140
6142
|
getMyChatSettings: Fc,
|
|
@@ -6142,7 +6144,7 @@ var jl = {
|
|
|
6142
6144
|
setMuteAll: Lc,
|
|
6143
6145
|
toggleMuteAll: Rc,
|
|
6144
6146
|
toMarkdownHtml: Xo,
|
|
6145
|
-
retrieveCcToken:
|
|
6147
|
+
retrieveCcToken: ye,
|
|
6146
6148
|
getChatMessages: $c,
|
|
6147
6149
|
scrollToMessageId: el,
|
|
6148
6150
|
scrollToMessage: Al,
|
|
@@ -6151,7 +6153,7 @@ var jl = {
|
|
|
6151
6153
|
onlineStatus: dl.onlineStatus,
|
|
6152
6154
|
theme: qc,
|
|
6153
6155
|
themeMode: Qc,
|
|
6154
|
-
language:
|
|
6156
|
+
language: Fe
|
|
6155
6157
|
};
|
|
6156
6158
|
//#endregion
|
|
6157
6159
|
//#region src/chat/conversationState.ts
|
|
@@ -6202,7 +6204,7 @@ function Ul(e) {
|
|
|
6202
6204
|
uid: t.targetId,
|
|
6203
6205
|
displayName: t.title,
|
|
6204
6206
|
avatar: t.avatar
|
|
6205
|
-
}] : a.filter((e) => e.uid !== n).map(
|
|
6207
|
+
}] : a.filter((e) => e.uid !== n).map(qe) : [];
|
|
6206
6208
|
});
|
|
6207
6209
|
return {
|
|
6208
6210
|
client: t,
|
|
@@ -6216,7 +6218,7 @@ function Ul(e) {
|
|
|
6216
6218
|
isChannel: u,
|
|
6217
6219
|
sendOptions: d,
|
|
6218
6220
|
mentionCandidates: f,
|
|
6219
|
-
mentionNameByUid: n(() =>
|
|
6221
|
+
mentionNameByUid: n(() => lt(Je(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
|
|
6220
6222
|
};
|
|
6221
6223
|
}
|
|
6222
6224
|
var Wl = Symbol("conversationCtx");
|
|
@@ -6601,10 +6603,10 @@ function pu(e) {
|
|
|
6601
6603
|
return;
|
|
6602
6604
|
}
|
|
6603
6605
|
try {
|
|
6604
|
-
t.value = (await new
|
|
6606
|
+
t.value = (await new U.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
|
|
6605
6607
|
uid: e.getUid(),
|
|
6606
6608
|
displayName: e.getName(),
|
|
6607
|
-
avatar:
|
|
6609
|
+
avatar: Se(e.getAvatar?.()) ?? "",
|
|
6608
6610
|
role: e.getScope()
|
|
6609
6611
|
})), e.onMembersChanged(t.value);
|
|
6610
6612
|
} catch {
|
|
@@ -6617,8 +6619,8 @@ function pu(e) {
|
|
|
6617
6619
|
let c = {
|
|
6618
6620
|
uid: r.getUid(),
|
|
6619
6621
|
displayName: r.getName(),
|
|
6620
|
-
avatar:
|
|
6621
|
-
role: a ?? r.getScope?.() ??
|
|
6622
|
+
avatar: Se(r.getAvatar?.()) ?? "",
|
|
6623
|
+
role: a ?? r.getScope?.() ?? U.GROUP_MEMBER_SCOPE.PARTICIPANT
|
|
6622
6624
|
};
|
|
6623
6625
|
i === "add" ? t.value.some((e) => e.uid === c.uid) || (t.value = [...t.value, c]) : i === "remove" ? t.value = t.value.filter((e) => e.uid !== c.uid) : t.value = t.value.map((e) => e.uid === c.uid ? {
|
|
6624
6626
|
...e,
|
|
@@ -6626,7 +6628,7 @@ function pu(e) {
|
|
|
6626
6628
|
} : e), e.onMembersChanged(t.value);
|
|
6627
6629
|
}
|
|
6628
6630
|
return b(() => {
|
|
6629
|
-
|
|
6631
|
+
U.addGroupListener(n, new U.GroupListener({
|
|
6630
6632
|
onGroupMemberScopeChanged: (e, t, n, r, a) => {
|
|
6631
6633
|
i(a, t, "update", n);
|
|
6632
6634
|
},
|
|
@@ -6650,7 +6652,7 @@ function pu(e) {
|
|
|
6650
6652
|
}
|
|
6651
6653
|
}));
|
|
6652
6654
|
}), x(() => {
|
|
6653
|
-
|
|
6655
|
+
U.removeGroupListener(n);
|
|
6654
6656
|
}), {
|
|
6655
6657
|
groupMembers: t,
|
|
6656
6658
|
fetchGroupMembers: r
|
|
@@ -7012,7 +7014,7 @@ function Xu(e) {
|
|
|
7012
7014
|
triggerChar: "@",
|
|
7013
7015
|
enabled: e.enabled,
|
|
7014
7016
|
maxSuggestions: e.maxSuggestions ?? 8,
|
|
7015
|
-
getCandidates: (t) =>
|
|
7017
|
+
getCandidates: (t) => Ye(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
|
|
7016
7018
|
id: e.uid,
|
|
7017
7019
|
label: e.displayName,
|
|
7018
7020
|
avatar: e.avatar
|
|
@@ -7177,14 +7179,14 @@ function nd(e, t, r, i) {
|
|
|
7177
7179
|
getTriggers: () => u.value,
|
|
7178
7180
|
onChange: () => E()
|
|
7179
7181
|
});
|
|
7180
|
-
|
|
7182
|
+
F(() => i.getMentionCandidates?.(), () => {
|
|
7181
7183
|
S();
|
|
7182
7184
|
}, { deep: !0 });
|
|
7183
7185
|
function C(e) {
|
|
7184
7186
|
let t = qo(e);
|
|
7185
|
-
return t.includes("<@uid:") ? qo(
|
|
7187
|
+
return t.includes("<@uid:") ? qo(nt(t, i.getMentionNameByUid?.() ?? {})) : t;
|
|
7186
7188
|
}
|
|
7187
|
-
|
|
7189
|
+
F(() => i.getModelValue(), (e) => {
|
|
7188
7190
|
let n = t.value, r = C(e);
|
|
7189
7191
|
if (r !== l.value) {
|
|
7190
7192
|
if (!n) {
|
|
@@ -7222,7 +7224,7 @@ function nd(e, t, r, i) {
|
|
|
7222
7224
|
function j() {
|
|
7223
7225
|
_(), E();
|
|
7224
7226
|
}
|
|
7225
|
-
function
|
|
7227
|
+
function M(e) {
|
|
7226
7228
|
if (!v(e)) {
|
|
7227
7229
|
if ((e.ctrlKey || e.metaKey) && !e.shiftKey) {
|
|
7228
7230
|
let t = e.key.toLowerCase();
|
|
@@ -7246,7 +7248,7 @@ function nd(e, t, r, i) {
|
|
|
7246
7248
|
e.key === "Escape" && (O(), g());
|
|
7247
7249
|
}
|
|
7248
7250
|
}
|
|
7249
|
-
function
|
|
7251
|
+
function ee(e) {
|
|
7250
7252
|
e.preventDefault();
|
|
7251
7253
|
let t = e.clipboardData?.getData("text/html") ?? "", n = e.clipboardData?.getData("text/plain") ?? "";
|
|
7252
7254
|
if (document.execCommand("styleWithCSS", !1, "false"), t) {
|
|
@@ -7258,7 +7260,7 @@ function nd(e, t, r, i) {
|
|
|
7258
7260
|
}
|
|
7259
7261
|
n && (document.execCommand("insertText", !1, n), E());
|
|
7260
7262
|
}
|
|
7261
|
-
function
|
|
7263
|
+
function N(e) {
|
|
7262
7264
|
if (!k()) {
|
|
7263
7265
|
O();
|
|
7264
7266
|
return;
|
|
@@ -7268,45 +7270,45 @@ function nd(e, t, r, i) {
|
|
|
7268
7270
|
y: e.clientY
|
|
7269
7271
|
}, s.value = !0;
|
|
7270
7272
|
}
|
|
7271
|
-
function
|
|
7273
|
+
function P(t) {
|
|
7272
7274
|
let n = t.target;
|
|
7273
7275
|
n && (a.value?.contains(n) || r.value?.$el.contains(n) || e.value?.contains(n)) || (O(), g());
|
|
7274
7276
|
}
|
|
7275
|
-
function
|
|
7277
|
+
function I(e) {
|
|
7276
7278
|
x(e), D();
|
|
7277
7279
|
}
|
|
7278
|
-
function
|
|
7280
|
+
function te() {
|
|
7279
7281
|
k() || O();
|
|
7280
7282
|
}
|
|
7281
|
-
function
|
|
7283
|
+
function L() {
|
|
7282
7284
|
o.value += 1, O(), g(), l.value = "", i.updateModelValue("");
|
|
7283
7285
|
}
|
|
7284
7286
|
return b(() => {
|
|
7285
|
-
document.addEventListener("pointerdown",
|
|
7287
|
+
document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", te), h(() => {
|
|
7286
7288
|
if (t.value) {
|
|
7287
7289
|
let e = C(i.getModelValue());
|
|
7288
7290
|
t.value.innerHTML = e, T(t.value), e ? delete t.value.dataset.empty : t.value.dataset.empty = "true", l.value = e;
|
|
7289
7291
|
}
|
|
7290
7292
|
});
|
|
7291
7293
|
}), y(() => {
|
|
7292
|
-
document.removeEventListener("pointerdown",
|
|
7294
|
+
document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", te);
|
|
7293
7295
|
}), {
|
|
7294
7296
|
applyFormat: A,
|
|
7295
7297
|
editorKey: o,
|
|
7296
7298
|
focusEditor: D,
|
|
7297
7299
|
formatMenuPosition: c,
|
|
7298
|
-
handleContextMenu:
|
|
7300
|
+
handleContextMenu: N,
|
|
7299
7301
|
handleInput: j,
|
|
7300
|
-
handleKeydown:
|
|
7301
|
-
handlePaste:
|
|
7302
|
+
handleKeydown: M,
|
|
7303
|
+
handlePaste: ee,
|
|
7302
7304
|
hideFormatMenu: O,
|
|
7303
|
-
resetEditor:
|
|
7305
|
+
resetEditor: L,
|
|
7304
7306
|
showFormatMenu: s,
|
|
7305
7307
|
triggerCandidates: d,
|
|
7306
7308
|
triggerMenuPosition: f,
|
|
7307
7309
|
highlightedTriggerIndex: p,
|
|
7308
7310
|
showTriggerMenu: m,
|
|
7309
|
-
selectTriggerCandidate:
|
|
7311
|
+
selectTriggerCandidate: I
|
|
7310
7312
|
};
|
|
7311
7313
|
}
|
|
7312
7314
|
//#endregion
|
|
@@ -7315,7 +7317,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7315
7317
|
__name: "ComposerActionsPopover",
|
|
7316
7318
|
emits: ["pickFile", "openPoll"],
|
|
7317
7319
|
setup(t, { expose: n, emit: i }) {
|
|
7318
|
-
let s = i, c = w(!1), l = w(null), { t: u } =
|
|
7320
|
+
let s = i, c = w(!1), l = w(null), { t: u } = q(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
|
|
7319
7321
|
{
|
|
7320
7322
|
kind: "image",
|
|
7321
7323
|
label: "attachImage",
|
|
@@ -7365,7 +7367,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7365
7367
|
}), n({
|
|
7366
7368
|
toggle: p,
|
|
7367
7369
|
hide: m
|
|
7368
|
-
}), (t, n) =>
|
|
7370
|
+
}), (t, n) => te((S(), a("div", {
|
|
7369
7371
|
ref_key: "menuRef",
|
|
7370
7372
|
ref: l,
|
|
7371
7373
|
class: "composer-actions-menu",
|
|
@@ -7381,7 +7383,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7381
7383
|
class: "composer-actions-menu__item",
|
|
7382
7384
|
"data-testid": "composer-create-poll",
|
|
7383
7385
|
onClick: g
|
|
7384
|
-
}, [o("span", ad, [(S(), r(D(j(_u)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[
|
|
7386
|
+
}, [o("span", ad, [(S(), r(D(j(_u)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
|
|
7385
7387
|
}
|
|
7386
7388
|
}), sd = (e, t) => {
|
|
7387
7389
|
let n = e.__vccOpts || e;
|
|
@@ -7396,12 +7398,12 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7396
7398
|
},
|
|
7397
7399
|
emits: ["cancel"],
|
|
7398
7400
|
setup(e, { emit: t }) {
|
|
7399
|
-
let r = e, i = t, { t: s } =
|
|
7401
|
+
let r = e, i = t, { t: s } = q(), c = Kl(), u = n(() => ds(r.message, s("message"), c.mentionNameByUid.value));
|
|
7400
7402
|
return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", ld, [
|
|
7401
7403
|
o("p", ud, k(e.variant === "editing" ? j(s)("editingInContext", { context: e.contextLabel }) : j(s)("replyingInContext", { context: e.contextLabel })), 1),
|
|
7402
7404
|
o("p", dd, k(e.message.senderName), 1),
|
|
7403
7405
|
o("p", fd, k(u.value), 1)
|
|
7404
|
-
]), l(j(
|
|
7406
|
+
]), l(j(z), {
|
|
7405
7407
|
icon: j(bu),
|
|
7406
7408
|
text: "",
|
|
7407
7409
|
rounded: "",
|
|
@@ -7409,7 +7411,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7409
7411
|
onClick: n[0] ||= (e) => i("cancel")
|
|
7410
7412
|
}, null, 8, ["icon"])], 2));
|
|
7411
7413
|
}
|
|
7412
|
-
}), [["__scopeId", "data-v-
|
|
7414
|
+
}), [["__scopeId", "data-v-f496c16b"]]), md = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7413
7415
|
__name: "ComposerFormatMenu",
|
|
7414
7416
|
props: {
|
|
7415
7417
|
visible: { type: Boolean },
|
|
@@ -7417,7 +7419,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7417
7419
|
},
|
|
7418
7420
|
emits: ["format"],
|
|
7419
7421
|
setup(e, { emit: t }) {
|
|
7420
|
-
let n = t, { t: r } =
|
|
7422
|
+
let n = t, { t: r } = q();
|
|
7421
7423
|
return (t, s) => e.visible ? (S(), a("div", {
|
|
7422
7424
|
key: 0,
|
|
7423
7425
|
class: "format-menu",
|
|
@@ -7429,19 +7431,19 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7429
7431
|
o("button", {
|
|
7430
7432
|
type: "button",
|
|
7431
7433
|
class: "format-menu__item",
|
|
7432
|
-
onMousedown: s[0] ||=
|
|
7434
|
+
onMousedown: s[0] ||= L(() => {}, ["prevent"]),
|
|
7433
7435
|
onClick: s[1] ||= (e) => n("format", "bold")
|
|
7434
7436
|
}, [s[6] ||= o("span", { class: "format-menu__icon font-bold" }, "B", -1), o("span", null, k(j(r)("bold")), 1)], 32),
|
|
7435
7437
|
o("button", {
|
|
7436
7438
|
type: "button",
|
|
7437
7439
|
class: "format-menu__item",
|
|
7438
|
-
onMousedown: s[2] ||=
|
|
7440
|
+
onMousedown: s[2] ||= L(() => {}, ["prevent"]),
|
|
7439
7441
|
onClick: s[3] ||= (e) => n("format", "italic")
|
|
7440
7442
|
}, [s[7] ||= o("span", { class: "format-menu__icon italic" }, "I", -1), o("span", null, k(j(r)("italic")), 1)], 32),
|
|
7441
7443
|
o("button", {
|
|
7442
7444
|
type: "button",
|
|
7443
7445
|
class: "format-menu__item",
|
|
7444
|
-
onMousedown: s[4] ||=
|
|
7446
|
+
onMousedown: s[4] ||= L(() => {}, ["prevent"]),
|
|
7445
7447
|
onClick: s[5] ||= (e) => n("format", "underline")
|
|
7446
7448
|
}, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
|
|
7447
7449
|
], 4)) : i("", !0);
|
|
@@ -7454,7 +7456,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7454
7456
|
},
|
|
7455
7457
|
emits: ["update:visible", "send"],
|
|
7456
7458
|
setup(t, { expose: i, emit: s }) {
|
|
7457
|
-
let c = t, u = s, { t: d } =
|
|
7459
|
+
let c = t, u = s, { t: d } = q(), f = w(""), p = w(["", ""]), m = n(() => {
|
|
7458
7460
|
let e = f.value.trim(), t = p.value.map((e) => e.trim()).filter(Boolean);
|
|
7459
7461
|
return !!e && t.length >= 2;
|
|
7460
7462
|
});
|
|
@@ -7476,7 +7478,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7476
7478
|
function y() {
|
|
7477
7479
|
u("update:visible", !1), _();
|
|
7478
7480
|
}
|
|
7479
|
-
return i({ reset: _ }), (n, i) => (S(), r(j(
|
|
7481
|
+
return i({ reset: _ }), (n, i) => (S(), r(j(ne), {
|
|
7480
7482
|
visible: t.visible,
|
|
7481
7483
|
modal: "",
|
|
7482
7484
|
header: j(d)("createPollTitle"),
|
|
@@ -7484,11 +7486,11 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7484
7486
|
draggable: !1,
|
|
7485
7487
|
"onUpdate:visible": y
|
|
7486
7488
|
}, {
|
|
7487
|
-
footer:
|
|
7489
|
+
footer: I(() => [l(j(z), {
|
|
7488
7490
|
label: j(d)("cancel"),
|
|
7489
7491
|
severity: "secondary",
|
|
7490
7492
|
onClick: y
|
|
7491
|
-
}, null, 8, ["label"]), l(j(
|
|
7493
|
+
}, null, 8, ["label"]), l(j(z), {
|
|
7492
7494
|
label: j(d)("sendPoll"),
|
|
7493
7495
|
icon: j(Vu),
|
|
7494
7496
|
disabled: c.disabled || !m.value,
|
|
@@ -7498,7 +7500,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7498
7500
|
"icon",
|
|
7499
7501
|
"disabled"
|
|
7500
7502
|
])]),
|
|
7501
|
-
default:
|
|
7503
|
+
default: I(() => [o("div", hd, [o("div", gd, [o("label", _d, k(j(d)("question")), 1), l(j(ie), {
|
|
7502
7504
|
modelValue: f.value,
|
|
7503
7505
|
"onUpdate:modelValue": i[0] ||= (e) => f.value = e,
|
|
7504
7506
|
fluid: "",
|
|
@@ -7508,7 +7510,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7508
7510
|
(S(!0), a(e, null, T(p.value, (e, t) => (S(), a("div", {
|
|
7509
7511
|
key: t,
|
|
7510
7512
|
class: "center"
|
|
7511
|
-
}, [l(j(
|
|
7513
|
+
}, [l(j(ie), {
|
|
7512
7514
|
"model-value": e,
|
|
7513
7515
|
class: "poll-dialog-input w-full",
|
|
7514
7516
|
placeholder: j(d)("option", { index: t + 1 }),
|
|
@@ -7517,7 +7519,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7517
7519
|
"model-value",
|
|
7518
7520
|
"placeholder",
|
|
7519
7521
|
"onUpdate:modelValue"
|
|
7520
|
-
]), l(j(
|
|
7522
|
+
]), l(j(z), {
|
|
7521
7523
|
icon: j(bu),
|
|
7522
7524
|
text: "",
|
|
7523
7525
|
rounded: "",
|
|
@@ -7529,7 +7531,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7529
7531
|
"disabled",
|
|
7530
7532
|
"onClick"
|
|
7531
7533
|
])]))), 128)),
|
|
7532
|
-
l(j(
|
|
7534
|
+
l(j(z), {
|
|
7533
7535
|
label: j(d)("addOption"),
|
|
7534
7536
|
icon: j(hu),
|
|
7535
7537
|
text: "",
|
|
@@ -7549,7 +7551,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7549
7551
|
},
|
|
7550
7552
|
emits: ["update:visible", "schedule"],
|
|
7551
7553
|
setup(e, { expose: t, emit: i }) {
|
|
7552
|
-
let a = e, s = i, { t: c } =
|
|
7554
|
+
let a = e, s = i, { t: c } = q(), u = w(p()), d = w(m());
|
|
7553
7555
|
function f() {
|
|
7554
7556
|
return new Date(Date.now() + 3600 * 1e3);
|
|
7555
7557
|
}
|
|
@@ -7575,7 +7577,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7575
7577
|
function b() {
|
|
7576
7578
|
s("update:visible", !1), v();
|
|
7577
7579
|
}
|
|
7578
|
-
return t({ reset: v }), (t, n) => (S(), r(j(
|
|
7580
|
+
return t({ reset: v }), (t, n) => (S(), r(j(ne), {
|
|
7579
7581
|
visible: e.visible,
|
|
7580
7582
|
modal: "",
|
|
7581
7583
|
header: j(c)("scheduleMessage"),
|
|
@@ -7583,11 +7585,11 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7583
7585
|
draggable: !1,
|
|
7584
7586
|
"onUpdate:visible": b
|
|
7585
7587
|
}, {
|
|
7586
|
-
footer:
|
|
7588
|
+
footer: I(() => [l(j(z), {
|
|
7587
7589
|
label: j(c)("cancel"),
|
|
7588
7590
|
severity: "secondary",
|
|
7589
7591
|
onClick: b
|
|
7590
|
-
}, null, 8, ["label"]), l(j(
|
|
7592
|
+
}, null, 8, ["label"]), l(j(z), {
|
|
7591
7593
|
label: j(c)("schedule"),
|
|
7592
7594
|
icon: j(vu),
|
|
7593
7595
|
disabled: a.disabled || !g.value,
|
|
@@ -7597,12 +7599,12 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7597
7599
|
"icon",
|
|
7598
7600
|
"disabled"
|
|
7599
7601
|
])]),
|
|
7600
|
-
default:
|
|
7602
|
+
default: I(() => [o("div", xd, [o("div", Sd, [o("label", Cd, k(j(c)("sendAt")), 1), o("div", wd, [l(j(re), {
|
|
7601
7603
|
modelValue: u.value,
|
|
7602
7604
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
7603
7605
|
class: "w-full flex-1",
|
|
7604
7606
|
type: "date"
|
|
7605
|
-
}, null, 8, ["modelValue"]), l(j(
|
|
7607
|
+
}, null, 8, ["modelValue"]), l(j(re), {
|
|
7606
7608
|
modelValue: d.value,
|
|
7607
7609
|
"onUpdate:modelValue": n[1] ||= (e) => d.value = e,
|
|
7608
7610
|
type: "time",
|
|
@@ -7638,7 +7640,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7638
7640
|
}),
|
|
7639
7641
|
emits: /* @__PURE__ */ m(["select"], ["update:highlightedIndex"]),
|
|
7640
7642
|
setup(t, { emit: n }) {
|
|
7641
|
-
let s =
|
|
7643
|
+
let s = M(t, "highlightedIndex"), c = n;
|
|
7642
7644
|
return (n, l) => t.visible && t.candidates.length ? (S(), a("div", {
|
|
7643
7645
|
key: 0,
|
|
7644
7646
|
class: g(["trigger-menu", t.position.placement === "below" ? "trigger-menu--below" : "trigger-menu--above"]),
|
|
@@ -7647,7 +7649,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7647
7649
|
top: `${t.position.y}px`
|
|
7648
7650
|
}),
|
|
7649
7651
|
role: "listbox",
|
|
7650
|
-
onMousedown: l[0] ||=
|
|
7652
|
+
onMousedown: l[0] ||= L(() => {}, ["stop"])
|
|
7651
7653
|
}, [(S(!0), a(e, null, T(t.candidates, (e, t) => (S(), a("button", {
|
|
7652
7654
|
key: e.id,
|
|
7653
7655
|
type: "button",
|
|
@@ -7655,8 +7657,8 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7655
7657
|
role: "option",
|
|
7656
7658
|
"aria-selected": t === s.value,
|
|
7657
7659
|
onMouseover: (e) => s.value = t,
|
|
7658
|
-
onMousedown:
|
|
7659
|
-
}, [e.avatar ? (S(), r(j(
|
|
7660
|
+
onMousedown: L((t) => c("select", e), ["stop", "prevent"])
|
|
7661
|
+
}, [e.avatar ? (S(), r(j(R), {
|
|
7660
7662
|
key: 0,
|
|
7661
7663
|
src: e.avatar,
|
|
7662
7664
|
name: e.label,
|
|
@@ -7714,62 +7716,62 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7714
7716
|
video: "video/*",
|
|
7715
7717
|
audio: "audio/*",
|
|
7716
7718
|
file: "*/*"
|
|
7717
|
-
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } =
|
|
7719
|
+
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = q(), T = null, E = w(null), O = w(null), A = w(null), { applyFormat: M, editorKey: ee, formatMenuPosition: N, focusEditor: P, handleContextMenu: te, handleInput: R, handleKeydown: ne, handlePaste: B, hideFormatMenu: re, resetEditor: ie, showFormatMenu: V, triggerCandidates: ae, triggerMenuPosition: H, highlightedTriggerIndex: U, showTriggerMenu: se, selectTriggerCandidate: ce } = nd(E, O, A, {
|
|
7718
7720
|
getModelValue: () => u.modelValue,
|
|
7719
7721
|
updateModelValue: (e) => d("update:modelValue", e),
|
|
7720
|
-
submit: () =>
|
|
7722
|
+
submit: () => Se(),
|
|
7721
7723
|
getMentionCandidates: () => u.mentionCandidates ?? [],
|
|
7722
7724
|
getMentionNameByUid: () => u.mentionNameByUid ?? {},
|
|
7723
7725
|
mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
|
|
7724
|
-
}),
|
|
7726
|
+
}), le = n(() => c[v.value]), ue = n(() => {
|
|
7725
7727
|
if (!_.value) return null;
|
|
7726
7728
|
let e = _.value.type;
|
|
7727
7729
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
7728
|
-
}),
|
|
7729
|
-
switch (
|
|
7730
|
+
}), de = n(() => {
|
|
7731
|
+
switch (ue.value) {
|
|
7730
7732
|
case "image": return C("image");
|
|
7731
7733
|
case "video": return C("video");
|
|
7732
7734
|
case "audio": return C("audio");
|
|
7733
7735
|
case "file": return C("file");
|
|
7734
7736
|
default: return C("attachment");
|
|
7735
7737
|
}
|
|
7736
|
-
}),
|
|
7737
|
-
|
|
7738
|
-
|
|
7738
|
+
}), W = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), fe = n(() => ls(u.modelValue) || !!_.value), pe = n(() => fe.value && ue.value !== "file"), me = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : us(u.modelValue) || C("currentDraftWillBeScheduled"));
|
|
7739
|
+
F(() => u.resetSignal, () => {
|
|
7740
|
+
ie(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
|
|
7739
7741
|
});
|
|
7740
|
-
async function
|
|
7741
|
-
await h(),
|
|
7742
|
+
async function he() {
|
|
7743
|
+
await h(), P();
|
|
7742
7744
|
}
|
|
7743
|
-
function
|
|
7745
|
+
function ge() {
|
|
7744
7746
|
m.value?.hide();
|
|
7745
7747
|
}
|
|
7746
7748
|
t({
|
|
7747
|
-
focusEditor:
|
|
7748
|
-
hideComposerActions:
|
|
7749
|
+
focusEditor: he,
|
|
7750
|
+
hideComposerActions: ge
|
|
7749
7751
|
});
|
|
7750
|
-
async function
|
|
7752
|
+
async function _e(e = "file") {
|
|
7751
7753
|
v.value = e, await h(), f.value?.click();
|
|
7752
7754
|
}
|
|
7753
|
-
function
|
|
7754
|
-
_.value = e.target.files?.[0] ?? null,
|
|
7755
|
+
function ve(e) {
|
|
7756
|
+
_.value = e.target.files?.[0] ?? null, ge();
|
|
7755
7757
|
}
|
|
7756
|
-
function
|
|
7758
|
+
function ye(e) {
|
|
7757
7759
|
if (u.disabled) return;
|
|
7758
7760
|
let t = Yu(e);
|
|
7759
7761
|
if (t) {
|
|
7760
|
-
e.preventDefault(), _.value = t,
|
|
7762
|
+
e.preventDefault(), _.value = t, ge();
|
|
7761
7763
|
return;
|
|
7762
7764
|
}
|
|
7763
|
-
|
|
7765
|
+
B(e);
|
|
7764
7766
|
}
|
|
7765
|
-
function
|
|
7767
|
+
function be() {
|
|
7766
7768
|
_.value = null, f.value && (f.value.value = "");
|
|
7767
7769
|
}
|
|
7768
|
-
function
|
|
7770
|
+
function xe(e) {
|
|
7769
7771
|
m.value?.toggle(e);
|
|
7770
7772
|
}
|
|
7771
|
-
function
|
|
7772
|
-
if (!(u.disabled || !
|
|
7773
|
+
function Se() {
|
|
7774
|
+
if (!(u.disabled || !fe.value)) {
|
|
7773
7775
|
if (_.value) {
|
|
7774
7776
|
d("sendAttachment", {
|
|
7775
7777
|
file: _.value,
|
|
@@ -7780,10 +7782,10 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7780
7782
|
d("sendText");
|
|
7781
7783
|
}
|
|
7782
7784
|
}
|
|
7783
|
-
function
|
|
7785
|
+
function Ce(e) {
|
|
7784
7786
|
d("sendPoll", e);
|
|
7785
7787
|
}
|
|
7786
|
-
function
|
|
7788
|
+
function we(e) {
|
|
7787
7789
|
d("scheduleMessage", {
|
|
7788
7790
|
...e,
|
|
7789
7791
|
text: _.value ? void 0 : cs(u.modelValue),
|
|
@@ -7791,39 +7793,39 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7791
7793
|
caption: _.value ? cs(u.modelValue) : void 0
|
|
7792
7794
|
});
|
|
7793
7795
|
}
|
|
7794
|
-
function
|
|
7796
|
+
function Te() {
|
|
7795
7797
|
d("openScheduled");
|
|
7796
7798
|
}
|
|
7797
|
-
function
|
|
7799
|
+
function Ee() {
|
|
7798
7800
|
T !== null && (clearTimeout(T), T = null);
|
|
7799
7801
|
}
|
|
7800
|
-
function
|
|
7801
|
-
u.disabled || !
|
|
7802
|
+
function De(e) {
|
|
7803
|
+
u.disabled || !pe.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, Ee(), T = setTimeout(() => {
|
|
7802
7804
|
T = null, x.value = !0, b.value = !0;
|
|
7803
7805
|
}, Wd));
|
|
7804
7806
|
}
|
|
7805
|
-
function
|
|
7806
|
-
|
|
7807
|
+
function G() {
|
|
7808
|
+
Ee();
|
|
7807
7809
|
}
|
|
7808
|
-
function
|
|
7809
|
-
if (!(u.disabled || !
|
|
7810
|
+
function Oe() {
|
|
7811
|
+
if (!(u.disabled || !fe.value)) {
|
|
7810
7812
|
if (x.value) {
|
|
7811
7813
|
x.value = !1;
|
|
7812
7814
|
return;
|
|
7813
7815
|
}
|
|
7814
|
-
|
|
7816
|
+
Se();
|
|
7815
7817
|
}
|
|
7816
7818
|
}
|
|
7817
|
-
return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5",
|
|
7819
|
+
return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", W.value]) }, [
|
|
7818
7820
|
o("input", {
|
|
7819
7821
|
ref_key: "fileInputRef",
|
|
7820
7822
|
ref: f,
|
|
7821
7823
|
type: "file",
|
|
7822
7824
|
class: "hidden",
|
|
7823
|
-
accept:
|
|
7825
|
+
accept: le.value,
|
|
7824
7826
|
disabled: e.disabled,
|
|
7825
|
-
onChange:
|
|
7826
|
-
onCancel:
|
|
7827
|
+
onChange: ve,
|
|
7828
|
+
onCancel: ge
|
|
7827
7829
|
}, null, 40, Nd),
|
|
7828
7830
|
e.editingMessage ? (S(), r(pd, {
|
|
7829
7831
|
key: 0,
|
|
@@ -7840,12 +7842,12 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7840
7842
|
"data-testid": "composer-reply-context",
|
|
7841
7843
|
onCancel: n[1] ||= (e) => d("cancelReply")
|
|
7842
7844
|
}, null, 8, ["message", "context-label"])) : i("", !0),
|
|
7843
|
-
_.value ? (S(), a("div", Pd, [o("div", Fd, [o("p", Id, k(_.value.name), 1), o("p", Ld, k(_.value.type ||
|
|
7845
|
+
_.value ? (S(), a("div", Pd, [o("div", Fd, [o("p", Id, k(_.value.name), 1), o("p", Ld, k(_.value.type || de.value), 1)]), l(j(z), {
|
|
7844
7846
|
icon: j(bu),
|
|
7845
7847
|
text: "",
|
|
7846
7848
|
rounded: "",
|
|
7847
7849
|
severity: "secondary",
|
|
7848
|
-
onClick:
|
|
7850
|
+
onClick: be
|
|
7849
7851
|
}, null, 8, ["icon"])])) : i("", !0),
|
|
7850
7852
|
o("div", {
|
|
7851
7853
|
ref_key: "composerShellRef",
|
|
@@ -7855,10 +7857,10 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7855
7857
|
l(cd, {
|
|
7856
7858
|
ref_key: "composerActionsRef",
|
|
7857
7859
|
ref: m,
|
|
7858
|
-
onPickFile:
|
|
7860
|
+
onPickFile: _e,
|
|
7859
7861
|
onOpenPoll: n[2] ||= (e) => y.value = !0
|
|
7860
7862
|
}, null, 512),
|
|
7861
|
-
l(j(
|
|
7863
|
+
l(j(z), {
|
|
7862
7864
|
text: "",
|
|
7863
7865
|
rounded: "",
|
|
7864
7866
|
severity: "secondary",
|
|
@@ -7866,9 +7868,9 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7866
7868
|
disabled: e.disabled || !!e.editingMessage,
|
|
7867
7869
|
"aria-label": j(C)("addToMessage"),
|
|
7868
7870
|
"data-testid": "composer-actions-button",
|
|
7869
|
-
onClick:
|
|
7871
|
+
onClick: xe
|
|
7870
7872
|
}, {
|
|
7871
|
-
default:
|
|
7873
|
+
default: I(() => [o("span", Rd, [(S(), r(D(j(hu)), { class: "size-7" }))])]),
|
|
7872
7874
|
_: 1
|
|
7873
7875
|
}, 8, [
|
|
7874
7876
|
"class",
|
|
@@ -7876,7 +7878,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7876
7878
|
"aria-label"
|
|
7877
7879
|
]),
|
|
7878
7880
|
(S(), a("div", {
|
|
7879
|
-
key: j(
|
|
7881
|
+
key: j(ee),
|
|
7880
7882
|
ref_key: "composerEditorRef",
|
|
7881
7883
|
ref: O,
|
|
7882
7884
|
contenteditable: "true",
|
|
@@ -7884,15 +7886,15 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7884
7886
|
"aria-multiline": "true",
|
|
7885
7887
|
"data-placeholder": j(C)("writeMessage"),
|
|
7886
7888
|
class: g(["composer-editor", e.disabled ? "pointer-events-none opacity-60" : ""]),
|
|
7887
|
-
onFocus: n[3] ||= (...e) => j(
|
|
7888
|
-
onInput: n[4] ||= (...e) => j(
|
|
7889
|
-
onKeyup: n[5] ||= (...e) => j(
|
|
7890
|
-
onKeydown: n[6] ||= (...e) => j(
|
|
7891
|
-
onPaste:
|
|
7892
|
-
onContextmenu: n[7] ||= (...e) => j(
|
|
7889
|
+
onFocus: n[3] ||= (...e) => j(re) && j(re)(...e),
|
|
7890
|
+
onInput: n[4] ||= (...e) => j(R) && j(R)(...e),
|
|
7891
|
+
onKeyup: n[5] ||= (...e) => j(R) && j(R)(...e),
|
|
7892
|
+
onKeydown: n[6] ||= (...e) => j(ne) && j(ne)(...e),
|
|
7893
|
+
onPaste: ye,
|
|
7894
|
+
onContextmenu: n[7] ||= (...e) => j(te) && j(te)(...e)
|
|
7893
7895
|
}, null, 42, zd)),
|
|
7894
7896
|
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Bd, [
|
|
7895
|
-
e.editingMessage ? (S(), r(j(
|
|
7897
|
+
e.editingMessage ? (S(), r(j(oe), {
|
|
7896
7898
|
key: 0,
|
|
7897
7899
|
text: j(C)("editing"),
|
|
7898
7900
|
context: "info",
|
|
@@ -7900,7 +7902,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7900
7902
|
size: "sm",
|
|
7901
7903
|
class: "composer-meta-tag"
|
|
7902
7904
|
}, null, 8, ["text"])) : i("", !0),
|
|
7903
|
-
e.contextLabel ? (S(), r(j(
|
|
7905
|
+
e.contextLabel ? (S(), r(j(oe), {
|
|
7904
7906
|
key: 1,
|
|
7905
7907
|
text: e.contextLabel,
|
|
7906
7908
|
context: "contrast",
|
|
@@ -7910,39 +7912,39 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7910
7912
|
}, null, 8, ["text"])) : i("", !0),
|
|
7911
7913
|
e.offlineMode ? (S(), a("p", Vd, k(e.pendingQueueCount ? j(C)("offlineQueued", { count: e.pendingQueueCount }) : j(C)("offline")), 1)) : i("", !0)
|
|
7912
7914
|
])) : i("", !0),
|
|
7913
|
-
e.showScheduledButton ? (S(), r(j(
|
|
7915
|
+
e.showScheduledButton ? (S(), r(j(z), {
|
|
7914
7916
|
key: 1,
|
|
7915
7917
|
rounded: "",
|
|
7916
7918
|
text: "",
|
|
7917
7919
|
class: g(["composer-schedule-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
7918
7920
|
disabled: e.disabled,
|
|
7919
7921
|
"aria-label": j(C)("scheduledMessages"),
|
|
7920
|
-
onClick:
|
|
7922
|
+
onClick: Te
|
|
7921
7923
|
}, {
|
|
7922
|
-
default:
|
|
7924
|
+
default: I(() => [o("span", Hd, [(S(), r(D(j(Du)), { class: "size-7" }))])]),
|
|
7923
7925
|
_: 1
|
|
7924
7926
|
}, 8, [
|
|
7925
7927
|
"class",
|
|
7926
7928
|
"disabled",
|
|
7927
7929
|
"aria-label"
|
|
7928
7930
|
])) : i("", !0),
|
|
7929
|
-
l(j(
|
|
7931
|
+
l(j(z), {
|
|
7930
7932
|
rounded: "",
|
|
7931
7933
|
severity: "primary",
|
|
7932
7934
|
text: "",
|
|
7933
7935
|
class: g(["composer-send-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
7934
|
-
disabled: e.disabled || !
|
|
7936
|
+
disabled: e.disabled || !fe.value,
|
|
7935
7937
|
"aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
|
|
7936
|
-
onMousedown:
|
|
7937
|
-
onMouseup:
|
|
7938
|
-
onMouseleave:
|
|
7939
|
-
onTouchstart:
|
|
7940
|
-
onTouchend:
|
|
7941
|
-
onTouchcancel:
|
|
7942
|
-
onContextmenu: n[8] ||=
|
|
7943
|
-
onClick:
|
|
7938
|
+
onMousedown: De,
|
|
7939
|
+
onMouseup: G,
|
|
7940
|
+
onMouseleave: G,
|
|
7941
|
+
onTouchstart: De,
|
|
7942
|
+
onTouchend: G,
|
|
7943
|
+
onTouchcancel: G,
|
|
7944
|
+
onContextmenu: n[8] ||= L(() => {}, ["prevent"]),
|
|
7945
|
+
onClick: Oe
|
|
7944
7946
|
}, {
|
|
7945
|
-
default:
|
|
7947
|
+
default: I(() => [o("span", Ud, [e.editingMessage ? (S(), r(D(j(yu)), {
|
|
7946
7948
|
key: 0,
|
|
7947
7949
|
class: "size-7"
|
|
7948
7950
|
})) : (S(), r(D(j(Vu)), {
|
|
@@ -7957,19 +7959,19 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7957
7959
|
])
|
|
7958
7960
|
], 2),
|
|
7959
7961
|
l(md, {
|
|
7960
|
-
visible: j(
|
|
7961
|
-
position: j(
|
|
7962
|
-
onFormat: n[9] ||= (e) => j(
|
|
7962
|
+
visible: j(V),
|
|
7963
|
+
position: j(N),
|
|
7964
|
+
onFormat: n[9] ||= (e) => j(M)(e)
|
|
7963
7965
|
}, null, 8, ["visible", "position"]),
|
|
7964
7966
|
l(Md, {
|
|
7965
7967
|
ref_key: "triggerMenuRef",
|
|
7966
7968
|
ref: A,
|
|
7967
|
-
"highlighted-index": j(
|
|
7968
|
-
"onUpdate:highlightedIndex": n[10] ||= (e) => p(
|
|
7969
|
-
visible: j(
|
|
7970
|
-
position: j(
|
|
7971
|
-
candidates: j(
|
|
7972
|
-
onSelect: n[11] ||= (e) => j(
|
|
7969
|
+
"highlighted-index": j(U),
|
|
7970
|
+
"onUpdate:highlightedIndex": n[10] ||= (e) => p(U) ? U.value = e : null,
|
|
7971
|
+
visible: j(se),
|
|
7972
|
+
position: j(H),
|
|
7973
|
+
candidates: j(ae),
|
|
7974
|
+
onSelect: n[11] ||= (e) => j(ce)(e)
|
|
7973
7975
|
}, null, 8, [
|
|
7974
7976
|
"highlighted-index",
|
|
7975
7977
|
"visible",
|
|
@@ -7980,15 +7982,15 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
7980
7982
|
visible: y.value,
|
|
7981
7983
|
"onUpdate:visible": n[12] ||= (e) => y.value = e,
|
|
7982
7984
|
disabled: e.disabled,
|
|
7983
|
-
onSend:
|
|
7985
|
+
onSend: Ce
|
|
7984
7986
|
}, null, 8, ["visible", "disabled"]),
|
|
7985
7987
|
l(Ed, {
|
|
7986
7988
|
visible: b.value,
|
|
7987
7989
|
"onUpdate:visible": n[13] ||= (e) => b.value = e,
|
|
7988
7990
|
disabled: e.disabled,
|
|
7989
|
-
"can-schedule":
|
|
7990
|
-
"content-preview":
|
|
7991
|
-
onSchedule:
|
|
7991
|
+
"can-schedule": pe.value,
|
|
7992
|
+
"content-preview": me.value,
|
|
7993
|
+
onSchedule: we
|
|
7992
7994
|
}, null, 8, [
|
|
7993
7995
|
"visible",
|
|
7994
7996
|
"disabled",
|
|
@@ -8004,7 +8006,7 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
8004
8006
|
__name: "ConversationComposer",
|
|
8005
8007
|
props: { target: {} },
|
|
8006
8008
|
setup(e, { expose: t }) {
|
|
8007
|
-
let o = e, { t: s } =
|
|
8009
|
+
let o = e, { t: s } = q(), c = Kl(), l = Xl(), u = tu(), d = ou(), f = du(), p = n(() => o.target === "thread"), m = n({
|
|
8008
8010
|
get: () => p.value ? u.threadDraft.value : u.draft.value,
|
|
8009
8011
|
set: (e) => {
|
|
8010
8012
|
p.value ? u.threadDraft.value = e : u.draft.value = e;
|
|
@@ -8043,17 +8045,17 @@ var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon"
|
|
|
8043
8045
|
function A() {
|
|
8044
8046
|
f.emit("composer:cancelEdit");
|
|
8045
8047
|
}
|
|
8046
|
-
let
|
|
8048
|
+
let M = w(null);
|
|
8047
8049
|
fu(f, "ui:closeComposerActions", () => {
|
|
8048
|
-
|
|
8050
|
+
M.value?.hideComposerActions();
|
|
8049
8051
|
});
|
|
8050
|
-
async function
|
|
8051
|
-
await
|
|
8052
|
+
async function ee() {
|
|
8053
|
+
await M.value?.focusEditor();
|
|
8052
8054
|
}
|
|
8053
|
-
return t({ focusEditor:
|
|
8055
|
+
return t({ focusEditor: ee }), (e, t) => y.value ? (S(), r(Gd, {
|
|
8054
8056
|
key: 0,
|
|
8055
8057
|
ref_key: "composerRef",
|
|
8056
|
-
ref:
|
|
8058
|
+
ref: M,
|
|
8057
8059
|
"model-value": m.value,
|
|
8058
8060
|
disabled: v.value,
|
|
8059
8061
|
"reset-signal": h.value,
|
|
@@ -8338,7 +8340,7 @@ function tf(e) {
|
|
|
8338
8340
|
let s = o < r, c = Math.max(0, a.scrollHeight - o - a.clientHeight);
|
|
8339
8341
|
s && c > Xd ? n = !1 : c <= Zd && (n = !0), r = o, a.scrollTop <= Qd && !e.isLoading() && !e.isLoadingOlder() && e.canLoadOlder() && e.onLoadOlder();
|
|
8340
8342
|
}
|
|
8341
|
-
return
|
|
8343
|
+
return F(() => {
|
|
8342
8344
|
let t = e.getMessages();
|
|
8343
8345
|
return {
|
|
8344
8346
|
conversationId: e.getConversation()?.id ?? null,
|
|
@@ -8479,7 +8481,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8479
8481
|
function s() {
|
|
8480
8482
|
n("close");
|
|
8481
8483
|
}
|
|
8482
|
-
return (t, n) => (S(), r(j(
|
|
8484
|
+
return (t, n) => (S(), r(j(ne), {
|
|
8483
8485
|
class: "w-5/6 max-w-lg",
|
|
8484
8486
|
visible: e.open,
|
|
8485
8487
|
modal: "",
|
|
@@ -8489,7 +8491,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8489
8491
|
closable: !0,
|
|
8490
8492
|
"onUpdate:visible": s
|
|
8491
8493
|
}, {
|
|
8492
|
-
default:
|
|
8494
|
+
default: I(() => [o("div", of, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", sf, [E(t.$slots, "footer")])) : i("", !0)]),
|
|
8493
8495
|
_: 3
|
|
8494
8496
|
}, 8, ["visible", "header"]));
|
|
8495
8497
|
}
|
|
@@ -8516,15 +8518,15 @@ var of = { class: "w-full" }, sf = {
|
|
|
8516
8518
|
props: { attachment: {} },
|
|
8517
8519
|
emits: ["close"],
|
|
8518
8520
|
setup(t, { emit: s }) {
|
|
8519
|
-
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } =
|
|
8521
|
+
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = q(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = af({
|
|
8520
8522
|
viewportRef: u,
|
|
8521
8523
|
imageRef: d,
|
|
8522
8524
|
isImage: () => p.value
|
|
8523
8525
|
});
|
|
8524
|
-
|
|
8526
|
+
F(() => c.attachment?.url, () => {
|
|
8525
8527
|
T();
|
|
8526
8528
|
});
|
|
8527
|
-
function
|
|
8529
|
+
function P() {
|
|
8528
8530
|
l("close");
|
|
8529
8531
|
}
|
|
8530
8532
|
return (n, s) => (S(), r(cf, {
|
|
@@ -8533,9 +8535,9 @@ var of = { class: "w-full" }, sf = {
|
|
|
8533
8535
|
subtitle: t.attachment?.kind || "",
|
|
8534
8536
|
"close-label": j(_)("close"),
|
|
8535
8537
|
"close-aria-label": j(_)("closeMediaViewer"),
|
|
8536
|
-
onClose:
|
|
8538
|
+
onClose: P
|
|
8537
8539
|
}, {
|
|
8538
|
-
actions:
|
|
8540
|
+
actions: I(() => [t.attachment?.url ? (S(), a("a", {
|
|
8539
8541
|
key: 0,
|
|
8540
8542
|
href: t.attachment.url,
|
|
8541
8543
|
target: "_blank",
|
|
@@ -8545,8 +8547,8 @@ var of = { class: "w-full" }, sf = {
|
|
|
8545
8547
|
class: "size-4",
|
|
8546
8548
|
"aria-hidden": "true"
|
|
8547
8549
|
})), o("span", null, k(j(_)("openInNewTab")), 1)], 8, lf)) : i("", !0)]),
|
|
8548
|
-
footer:
|
|
8549
|
-
default:
|
|
8550
|
+
footer: I(() => [t.attachment ? (S(), a("div", vf, [o("div", yf, [o("p", bf, k(t.attachment.name), 1), o("p", xf, k(t.attachment.kind), 1)])])) : i("", !0)]),
|
|
8551
|
+
default: I(() => [o("div", uf, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
|
|
8550
8552
|
key: 0,
|
|
8551
8553
|
ref_key: "viewportRef",
|
|
8552
8554
|
ref: u,
|
|
@@ -8554,10 +8556,10 @@ var of = { class: "w-full" }, sf = {
|
|
|
8554
8556
|
onPointerdown: s[0] ||= (...e) => j(E) && j(E)(...e),
|
|
8555
8557
|
onPointermove: s[1] ||= (...e) => j(O) && j(O)(...e),
|
|
8556
8558
|
onPointerup: s[2] ||= (...e) => j(A) && j(A)(...e),
|
|
8557
|
-
onPointercancel: s[3] ||= (...e) => j(
|
|
8559
|
+
onPointercancel: s[3] ||= (...e) => j(M) && j(M)(...e),
|
|
8558
8560
|
onPointerleave: s[4] ||= (...e) => j(A) && j(A)(...e),
|
|
8559
|
-
onWheel: s[5] ||= (...e) => j(
|
|
8560
|
-
onDblclick: s[6] ||= (...e) => j(
|
|
8561
|
+
onWheel: s[5] ||= (...e) => j(ee) && j(ee)(...e),
|
|
8562
|
+
onDblclick: s[6] ||= (...e) => j(N) && j(N)(...e)
|
|
8561
8563
|
}, [o("img", {
|
|
8562
8564
|
ref_key: "imageRef",
|
|
8563
8565
|
ref: d,
|
|
@@ -8589,7 +8591,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8589
8591
|
__name: "MessageDateSeparator",
|
|
8590
8592
|
props: { date: {} },
|
|
8591
8593
|
setup(e) {
|
|
8592
|
-
let t = e, { locale: r, t: i } =
|
|
8594
|
+
let t = e, { locale: r, t: i } = q(), s = n(() => {
|
|
8593
8595
|
let e = /* @__PURE__ */ new Date(), n = t.date, a = new Date(e.getFullYear(), e.getMonth(), e.getDate()), o = new Date(a);
|
|
8594
8596
|
o.setDate(o.getDate() - 1);
|
|
8595
8597
|
let s = new Date(a);
|
|
@@ -8623,7 +8625,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8623
8625
|
isOwn: { type: Boolean }
|
|
8624
8626
|
},
|
|
8625
8627
|
setup(e) {
|
|
8626
|
-
let t = e, r = w(null), s = w(!1), { t: c } =
|
|
8628
|
+
let t = e, r = w(null), s = w(!1), { t: c } = q(), l = n(() => {
|
|
8627
8629
|
try {
|
|
8628
8630
|
return new URL(t.url).hostname.replace(/^www\./, "");
|
|
8629
8631
|
} catch {
|
|
@@ -8637,7 +8639,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8637
8639
|
return t.url;
|
|
8638
8640
|
}
|
|
8639
8641
|
});
|
|
8640
|
-
|
|
8642
|
+
F(() => t.url, async (e) => {
|
|
8641
8643
|
if (r.value = null, s.value = !1, !(!e || typeof window > "u")) {
|
|
8642
8644
|
if (p(e)) {
|
|
8643
8645
|
r.value = {
|
|
@@ -8736,7 +8738,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8736
8738
|
props: { message: {} },
|
|
8737
8739
|
emits: ["openMedia"],
|
|
8738
8740
|
setup(t, { emit: n }) {
|
|
8739
|
-
let s = n, { t: l } =
|
|
8741
|
+
let s = n, { t: l } = q();
|
|
8740
8742
|
function u(e) {
|
|
8741
8743
|
return !e || Number.isNaN(e) ? "" : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
8742
8744
|
}
|
|
@@ -8791,7 +8793,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8791
8793
|
function h(e) {
|
|
8792
8794
|
return { aspectRatio: String(m(e)) };
|
|
8793
8795
|
}
|
|
8794
|
-
return (n, d) => (S(), a("div", Vf, [(S(!0), a(e, null, T(t.message.attachments, (n) => (S(), a(e, { key: `${t.message.id}-${n.name}` }, [n.kind === "image" && n.url ? (S(), r(j(
|
|
8796
|
+
return (n, d) => (S(), a("div", Vf, [(S(!0), a(e, null, T(t.message.attachments, (n) => (S(), a(e, { key: `${t.message.id}-${n.name}` }, [n.kind === "image" && n.url ? (S(), r(j(B), {
|
|
8795
8797
|
key: 0,
|
|
8796
8798
|
preview: "",
|
|
8797
8799
|
src: n.url,
|
|
@@ -8842,11 +8844,11 @@ var of = { class: "w-full" }, sf = {
|
|
|
8842
8844
|
__name: "MessageDeliveryStatus",
|
|
8843
8845
|
props: { message: {} },
|
|
8844
8846
|
setup(e) {
|
|
8845
|
-
let t = e, { locale: s, t: c } =
|
|
8847
|
+
let t = e, { locale: s, t: c } = q();
|
|
8846
8848
|
function l(e) {
|
|
8847
8849
|
return new Intl.DateTimeFormat(s.value, {
|
|
8848
8850
|
timeStyle: "short",
|
|
8849
|
-
hourCycle:
|
|
8851
|
+
hourCycle: Le()
|
|
8850
8852
|
}).format(e);
|
|
8851
8853
|
}
|
|
8852
8854
|
let u = n(() => {
|
|
@@ -8905,7 +8907,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8905
8907
|
__name: "MessageItemHeader",
|
|
8906
8908
|
props: { message: {} },
|
|
8907
8909
|
setup(e) {
|
|
8908
|
-
let t = e, { locale: n, t: s } =
|
|
8910
|
+
let t = e, { locale: n, t: s } = q();
|
|
8909
8911
|
function c(e) {
|
|
8910
8912
|
return e ? new Intl.DateTimeFormat(n.value, {
|
|
8911
8913
|
month: "short",
|
|
@@ -8917,7 +8919,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8917
8919
|
function l() {
|
|
8918
8920
|
return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
|
|
8919
8921
|
}
|
|
8920
|
-
return (t, n) => (S(), a("div", cp, [o("span", lp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(
|
|
8922
|
+
return (t, n) => (S(), a("div", cp, [o("span", lp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(oe), {
|
|
8921
8923
|
key: 0,
|
|
8922
8924
|
text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
|
|
8923
8925
|
context: "warn",
|
|
@@ -8956,7 +8958,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8956
8958
|
},
|
|
8957
8959
|
emits: ["toggleReaction", "openThread"],
|
|
8958
8960
|
setup(e, { emit: t }) {
|
|
8959
|
-
let s = e, c = t, { t: u } =
|
|
8961
|
+
let s = e, c = t, { t: u } = q(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
|
|
8960
8962
|
return (t, n) => (S(), a("div", pp, [l(fp, {
|
|
8961
8963
|
message: e.message,
|
|
8962
8964
|
disabled: e.canReact === !1,
|
|
@@ -8968,7 +8970,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8968
8970
|
class: "message-reactions__thread-button text-subtle hover:text-default inline-flex items-center gap-1 rounded-full px-1 py-0 font-medium transition",
|
|
8969
8971
|
"aria-label": d.value,
|
|
8970
8972
|
title: d.value,
|
|
8971
|
-
onClick: n[1] ||=
|
|
8973
|
+
onClick: n[1] ||= L((e) => c("openThread"), ["stop"])
|
|
8972
8974
|
}, [(S(), r(D(j(zu)), {
|
|
8973
8975
|
class: "size-4",
|
|
8974
8976
|
"aria-hidden": "true"
|
|
@@ -8977,7 +8979,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8977
8979
|
}), _p = {
|
|
8978
8980
|
key: 0,
|
|
8979
8981
|
class: ""
|
|
8980
|
-
}, vp = { class: "
|
|
8982
|
+
}, vp = { class: "heading-sm text-default" }, yp = { class: "body-sm text-subtle" }, bp = { class: "space-y-2 py-3" }, xp = ["disabled", "onClick"], Sp = { class: "body-md flex items-center justify-between gap-3 px-3 py-1.5" }, Cp = { class: "body-sm text-subtle shrink-0" }, wp = { class: "bg-alpha-default h-1.5" }, Tp = /* @__PURE__ */ u({
|
|
8981
8983
|
__name: "MessagePollContent",
|
|
8982
8984
|
props: {
|
|
8983
8985
|
message: {},
|
|
@@ -8986,7 +8988,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
8986
8988
|
},
|
|
8987
8989
|
emits: ["vote"],
|
|
8988
8990
|
setup(t, { emit: n }) {
|
|
8989
|
-
let r = t, s = n, { t: c } =
|
|
8991
|
+
let r = t, s = n, { t: c } = q();
|
|
8990
8992
|
function l(e) {
|
|
8991
8993
|
let t = r.currentUserId;
|
|
8992
8994
|
return !t || !r.message.poll ? !1 : r.message.poll.options.some((n) => n.id === e && n.voters.includes(t));
|
|
@@ -9101,7 +9103,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
9101
9103
|
key: 0,
|
|
9102
9104
|
text: t.message.text,
|
|
9103
9105
|
class: g(f.value)
|
|
9104
|
-
}, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(
|
|
9106
|
+
}, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(R), {
|
|
9105
9107
|
key: 0,
|
|
9106
9108
|
image: t.message.senderAvatar,
|
|
9107
9109
|
label: t.message.senderAvatar ? void 0 : t.message.senderName.slice(0, 1).toUpperCase(),
|
|
@@ -9173,7 +9175,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
9173
9175
|
emits: ["react"],
|
|
9174
9176
|
setup(t, { emit: s }) {
|
|
9175
9177
|
let c = t, l = s, u = w(!1);
|
|
9176
|
-
|
|
9178
|
+
F(() => c.message.id, () => {
|
|
9177
9179
|
u.value = !1;
|
|
9178
9180
|
});
|
|
9179
9181
|
let d = n(() => Fp);
|
|
@@ -9272,7 +9274,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
9272
9274
|
message: e.message,
|
|
9273
9275
|
"can-react": e.canReact,
|
|
9274
9276
|
onReact: o[0] ||= (e) => s("react", e)
|
|
9275
|
-
}, null, 8, ["message", "can-react"]), l(j(
|
|
9277
|
+
}, null, 8, ["message", "can-react"]), l(j(V), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
|
|
9276
9278
|
}
|
|
9277
9279
|
}), [["__scopeId", "data-v-54f6bf5c"]]), Up = { class: "chat-header border-default bg-elevation-surface-default sticky top-0 z-10 flex items-center justify-between gap-3 border-b px-4 py-3 max-md:px-4 max-md:pb-3 sm:px-5 sm:py-3.5" }, Wp = {
|
|
9278
9280
|
key: 0,
|
|
@@ -9287,13 +9289,13 @@ var of = { class: "w-full" }, sf = {
|
|
|
9287
9289
|
parentMessage: {}
|
|
9288
9290
|
},
|
|
9289
9291
|
setup(t) {
|
|
9290
|
-
let { t: n } =
|
|
9291
|
-
return (s, c) => (S(), a("header", Up, [t.conversation ? (S(), a("div", Wp, [l(j(
|
|
9292
|
+
let { t: n } = q();
|
|
9293
|
+
return (s, c) => (S(), a("header", Up, [t.conversation ? (S(), a("div", Wp, [l(j(R), {
|
|
9292
9294
|
image: t.conversation.avatar,
|
|
9293
9295
|
label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
|
|
9294
9296
|
shape: "circle",
|
|
9295
9297
|
class: "chat-header__avatar shrink-0"
|
|
9296
|
-
}, null, 8, ["image", "label"]), o("div", Gp, [o("p", Kp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", qp, [t.parentMessage ? (S(), a("span", Jp, k(t.parentMessage.senderName), 1)) : (S(), a("span", Yp, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Xp, [t.conversation?.tags?.length ? (S(), a("div", Zp, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(
|
|
9298
|
+
}, null, 8, ["image", "label"]), o("div", Gp, [o("p", Kp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", qp, [t.parentMessage ? (S(), a("span", Jp, k(t.parentMessage.senderName), 1)) : (S(), a("span", Yp, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Xp, [t.conversation?.tags?.length ? (S(), a("div", Zp, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(oe), {
|
|
9297
9299
|
key: e,
|
|
9298
9300
|
text: e,
|
|
9299
9301
|
context: "secondary",
|
|
@@ -9320,13 +9322,13 @@ var of = { class: "w-full" }, sf = {
|
|
|
9320
9322
|
},
|
|
9321
9323
|
emits: ["anchorclick"],
|
|
9322
9324
|
setup(t) {
|
|
9323
|
-
let s = t, { t: c } =
|
|
9325
|
+
let s = t, { t: c } = q(), u = Kl(), d = Xl(), f = du(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
|
|
9324
9326
|
let e = u.conversation.value;
|
|
9325
9327
|
return e ? _.value ? c("thread") : e.title : "";
|
|
9326
9328
|
}), O = n(() => {
|
|
9327
9329
|
let e = u.conversation.value;
|
|
9328
9330
|
return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
|
|
9329
|
-
}), A = n(() => u.conversation.value?.memberCount ?? 0),
|
|
9331
|
+
}), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Vl(u.conversation.value)), te = ee("threadRef"), { handleThreadScroll: L } = tf({
|
|
9330
9332
|
getConversation: () => u.conversation.value,
|
|
9331
9333
|
getParentMessage: () => _.value,
|
|
9332
9334
|
getMessages: () => m.value,
|
|
@@ -9334,14 +9336,14 @@ var of = { class: "w-full" }, sf = {
|
|
|
9334
9336
|
isLoadingOlder: () => x.value,
|
|
9335
9337
|
canLoadOlder: () => b.value,
|
|
9336
9338
|
onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
|
|
9337
|
-
threadRef:
|
|
9338
|
-
}),
|
|
9339
|
+
threadRef: te
|
|
9340
|
+
}), R = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: V, getActionItems: ae } = Yd({
|
|
9339
9341
|
canUseMessageActions: () => u.canUseMessageActions.value,
|
|
9340
9342
|
canReact: () => u.canReact.value,
|
|
9341
9343
|
canReply: () => u.canReply.value,
|
|
9342
9344
|
canOpenThread: () => v.value,
|
|
9343
9345
|
isInThread: () => p.value,
|
|
9344
|
-
actionMenuRef:
|
|
9346
|
+
actionMenuRef: R,
|
|
9345
9347
|
t: c,
|
|
9346
9348
|
emit: {
|
|
9347
9349
|
reply: (e) => f.emit("message:reply", e),
|
|
@@ -9357,21 +9359,21 @@ var of = { class: "w-full" }, sf = {
|
|
|
9357
9359
|
},
|
|
9358
9360
|
onMenuOpen: () => f.emit("ui:closeComposerActions")
|
|
9359
9361
|
});
|
|
9360
|
-
function
|
|
9362
|
+
function H(e) {
|
|
9361
9363
|
return !!e.url && [
|
|
9362
9364
|
"image",
|
|
9363
9365
|
"video",
|
|
9364
9366
|
"audio"
|
|
9365
9367
|
].includes(e.kind);
|
|
9366
9368
|
}
|
|
9367
|
-
function
|
|
9368
|
-
|
|
9369
|
+
function oe(e) {
|
|
9370
|
+
H(e) && (M.value = e);
|
|
9369
9371
|
}
|
|
9370
|
-
function
|
|
9371
|
-
|
|
9372
|
+
function U() {
|
|
9373
|
+
M.value = null;
|
|
9372
9374
|
}
|
|
9373
|
-
async function
|
|
9374
|
-
|
|
9375
|
+
async function se(e, t) {
|
|
9376
|
+
N.value = `${e.id}:${t}`;
|
|
9375
9377
|
try {
|
|
9376
9378
|
f.emit("message:votePoll", {
|
|
9377
9379
|
message: e,
|
|
@@ -9379,22 +9381,22 @@ var of = { class: "w-full" }, sf = {
|
|
|
9379
9381
|
});
|
|
9380
9382
|
} finally {
|
|
9381
9383
|
window.setTimeout(() => {
|
|
9382
|
-
|
|
9384
|
+
N.value === `${e.id}:${t}` && (N.value = null);
|
|
9383
9385
|
}, 300);
|
|
9384
9386
|
}
|
|
9385
9387
|
}
|
|
9386
|
-
function
|
|
9388
|
+
function ce(e) {
|
|
9387
9389
|
v.value && f.emit("message:openThread", e);
|
|
9388
9390
|
}
|
|
9389
|
-
function
|
|
9391
|
+
function le(e, t) {
|
|
9390
9392
|
return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
|
|
9391
9393
|
}
|
|
9392
|
-
function
|
|
9394
|
+
function ue(e) {
|
|
9393
9395
|
let t = m.value;
|
|
9394
|
-
return e === 0 ? !0 :
|
|
9396
|
+
return e === 0 ? !0 : le(t[e].sentAt, t[e - 1].sentAt);
|
|
9395
9397
|
}
|
|
9396
9398
|
return (t, n) => (S(), a(e, null, [
|
|
9397
|
-
o("section", { class: g(["message-list-root", [t.$attrs.class,
|
|
9399
|
+
o("section", { class: g(["message-list-root", [t.$attrs.class, F.value ? "message-list--embedded-thread" : P.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
|
|
9398
9400
|
key: 0,
|
|
9399
9401
|
conversation: j(u).conversation.value,
|
|
9400
9402
|
parentMessage: _.value,
|
|
@@ -9407,15 +9409,15 @@ var of = { class: "w-full" }, sf = {
|
|
|
9407
9409
|
"parent-message": _.value
|
|
9408
9410
|
}, null, 8, ["conversation", "parent-message"])], !0) : i("", !0), j(u).conversation.value ? (S(), a("div", {
|
|
9409
9411
|
key: 2,
|
|
9410
|
-
class: g(["message-list__body",
|
|
9412
|
+
class: g(["message-list__body", F.value || P.value ? "bg-elevation-surface-overlay" : ""])
|
|
9411
9413
|
}, [o("div", {
|
|
9412
9414
|
ref_key: "threadRef",
|
|
9413
|
-
ref:
|
|
9414
|
-
class: g(["message-list__scroll min-h-0 flex-1",
|
|
9415
|
-
onScroll: n[2] ||= (...e) => j(
|
|
9415
|
+
ref: te,
|
|
9416
|
+
class: g(["message-list__scroll min-h-0 flex-1", F.value ? "p-0" : P.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
|
|
9417
|
+
onScroll: n[2] ||= (...e) => j(L) && j(L)(...e)
|
|
9416
9418
|
}, [o("div", em, [
|
|
9417
9419
|
_.value ? (S(), a("div", tm, [o("p", nm, k(_.value.senderName), 1), o("p", rm, k(j(ds)(_.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
|
|
9418
|
-
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [
|
|
9420
|
+
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(Tf, {
|
|
9419
9421
|
key: 0,
|
|
9420
9422
|
date: o.sentAt
|
|
9421
9423
|
}, null, 8, ["date"])) : i("", !0), l(Np, {
|
|
@@ -9423,16 +9425,16 @@ var of = { class: "w-full" }, sf = {
|
|
|
9423
9425
|
"current-user-id": j(u).currentUserId.value,
|
|
9424
9426
|
"can-react": j(u).canReact.value,
|
|
9425
9427
|
"can-open-thread": !_.value && v.value,
|
|
9426
|
-
"can-show-sender-avatar":
|
|
9427
|
-
"pending-option-key":
|
|
9428
|
+
"can-show-sender-avatar": I.value,
|
|
9429
|
+
"pending-option-key": N.value,
|
|
9428
9430
|
"action-message-class": s.actionMessageClass,
|
|
9429
9431
|
"action-message-row-class": s.actionMessageRowClass,
|
|
9430
|
-
onContextmenu: (e) => j(
|
|
9431
|
-
onTap: (e) => j(
|
|
9432
|
-
onOpenMedia:
|
|
9433
|
-
onVotePoll: (e) =>
|
|
9434
|
-
onToggleReaction: (e) => j(
|
|
9435
|
-
onOpenThread: (e) =>
|
|
9432
|
+
onContextmenu: (e) => j(ne)(o, e),
|
|
9433
|
+
onTap: (e) => j(B)(o, e),
|
|
9434
|
+
onOpenMedia: oe,
|
|
9435
|
+
onVotePoll: (e) => se(o, e),
|
|
9436
|
+
onToggleReaction: (e) => j(V)(o, e),
|
|
9437
|
+
onOpenThread: (e) => ce(o),
|
|
9436
9438
|
onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
|
|
9437
9439
|
onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
|
|
9438
9440
|
}, null, 8, [
|
|
@@ -9451,19 +9453,19 @@ var of = { class: "w-full" }, sf = {
|
|
|
9451
9453
|
"onOpenThread"
|
|
9452
9454
|
])], 64))), 128)),
|
|
9453
9455
|
m.value.length === 0 && C.value && !h.value ? (S(), a("div", im, k(j(c)("noMessagesYetInThisGroup")), 1)) : i("", !0)
|
|
9454
|
-
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col",
|
|
9456
|
+
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", P.value ? F.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", $p, k(j(c)("selectConversationToStart")), 1))], 2),
|
|
9455
9457
|
l(Sf, {
|
|
9456
|
-
attachment:
|
|
9457
|
-
onClose:
|
|
9458
|
+
attachment: M.value,
|
|
9459
|
+
onClose: U
|
|
9458
9460
|
}, null, 8, ["attachment"]),
|
|
9459
9461
|
l(Hp, {
|
|
9460
9462
|
ref_key: "actionMenuRef",
|
|
9461
|
-
ref:
|
|
9462
|
-
message: j(
|
|
9463
|
+
ref: R,
|
|
9464
|
+
message: j(z),
|
|
9463
9465
|
"can-react": j(u).canReact.value,
|
|
9464
|
-
"action-items": j(
|
|
9465
|
-
onHide: j(
|
|
9466
|
-
onReact: n[3] ||= (e) => j(
|
|
9466
|
+
"action-items": j(z) ? j(ae)(j(z)) : [],
|
|
9467
|
+
onHide: j(re),
|
|
9468
|
+
onReact: n[3] ||= (e) => j(ie)(j(z), e)
|
|
9467
9469
|
}, null, 8, [
|
|
9468
9470
|
"message",
|
|
9469
9471
|
"can-react",
|
|
@@ -9472,7 +9474,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
9472
9474
|
])
|
|
9473
9475
|
], 64));
|
|
9474
9476
|
}
|
|
9475
|
-
}), [["__scopeId", "data-v-bea26e53"]]), om = { class: "receipt-section" }, sm = { class: "receipt-section__header" }, cm = { class: "
|
|
9477
|
+
}), [["__scopeId", "data-v-bea26e53"]]), om = { class: "receipt-section" }, sm = { class: "receipt-section__header" }, cm = { class: "heading-sm text-default" }, lm = { class: "body-sm text-subtlest" }, um = {
|
|
9476
9478
|
key: 0,
|
|
9477
9479
|
class: "space-y-2"
|
|
9478
9480
|
}, dm = { class: "flex min-w-0 items-center gap-3" }, fm = { class: "min-w-0" }, pm = { class: "heading-sm text-default truncate" }, mm = { class: "body-sm text-subtle truncate" }, hm = { class: "body-sm text-subtle shrink-0" }, gm = {
|
|
@@ -9490,14 +9492,14 @@ var of = { class: "w-full" }, sf = {
|
|
|
9490
9492
|
return (n, r) => (S(), a("section", om, [o("div", sm, [o("p", cm, k(t.title), 1), o("span", lm, k(t.receipts.length), 1)]), t.receipts.length ? (S(), a("div", um, [(S(!0), a(e, null, T(t.receipts, (e) => (S(), a("div", {
|
|
9491
9493
|
key: `${e.kind}-${e.user.uid}`,
|
|
9492
9494
|
class: "receipt-section__row"
|
|
9493
|
-
}, [o("div", dm, [l(j(
|
|
9495
|
+
}, [o("div", dm, [l(j(R), {
|
|
9494
9496
|
image: e.user.avatar,
|
|
9495
9497
|
label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
|
|
9496
9498
|
shape: "circle",
|
|
9497
9499
|
class: "shrink-0"
|
|
9498
9500
|
}, null, 8, ["image", "label"]), o("div", fm, [o("p", pm, k(e.user.name), 1), o("p", mm, k(e.user.uid), 1)])]), o("p", hm, k(t.formatDateTime(e.timestamp)), 1)]))), 128))])) : (S(), a("div", gm, k(t.emptyLabel), 1))]));
|
|
9499
9501
|
}
|
|
9500
|
-
}), [["__scopeId", "data-v-
|
|
9502
|
+
}), [["__scopeId", "data-v-2b2f0a3e"]]), vm = {
|
|
9501
9503
|
key: 0,
|
|
9502
9504
|
class: "message-info-dialog-content space-y-5 overflow-y-auto"
|
|
9503
9505
|
}, ym = { class: "message-info-summary px-4 py-4 sm:px-6 sm:py-5" }, bm = { class: "body-md text-default wrap-break-word whitespace-pre-wrap" }, xm = { class: "mt-4 grid gap-3 sm:grid-cols-3" }, Sm = { class: "message-info-metric px-3 py-3" }, Cm = { class: "body-sm text-subtlest font-semibold uppercase" }, wm = { class: "heading-sm text-default mt-1" }, Tm = { class: "message-info-metric px-3 py-3" }, Em = { class: "flex items-center gap-2" }, Dm = { class: "body-sm text-subtlest font-semibold uppercase" }, Om = { class: "heading-sm text-default mt-1" }, km = { class: "message-info-metric px-3 py-3" }, Am = { class: "flex items-center gap-2" }, jm = { class: "body-sm text-subtlest font-semibold uppercase" }, Mm = { class: "heading-sm text-default mt-1" }, Nm = {
|
|
@@ -9520,12 +9522,12 @@ var of = { class: "w-full" }, sf = {
|
|
|
9520
9522
|
},
|
|
9521
9523
|
emits: ["close"],
|
|
9522
9524
|
setup(e, { emit: t }) {
|
|
9523
|
-
let s = e, c = t, { locale: u, t: d } =
|
|
9525
|
+
let s = e, c = t, { locale: u, t: d } = q(), f = Kl(), p = n(() => s.receipts.filter((e) => e.kind === "delivered")), m = n(() => s.receipts.filter((e) => e.kind === "read")), h = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
|
|
9524
9526
|
function g(e) {
|
|
9525
9527
|
return e ? new Intl.DateTimeFormat(u.value, {
|
|
9526
9528
|
dateStyle: "medium",
|
|
9527
9529
|
timeStyle: "short",
|
|
9528
|
-
hourCycle:
|
|
9530
|
+
hourCycle: Le()
|
|
9529
9531
|
}).format(e) : d("notYet");
|
|
9530
9532
|
}
|
|
9531
9533
|
function _(e, t) {
|
|
@@ -9538,21 +9540,21 @@ var of = { class: "w-full" }, sf = {
|
|
|
9538
9540
|
"close-label": j(d)("close"),
|
|
9539
9541
|
onClose: n[0] ||= (e) => c("close")
|
|
9540
9542
|
}, {
|
|
9541
|
-
default:
|
|
9543
|
+
default: I(() => [e.message ? (S(), a("div", vm, [o("div", ym, [o("p", bm, k(j(ds)(e.message, j(d)("message"), j(f).mentionNameByUid.value)), 1), o("div", xm, [
|
|
9542
9544
|
o("div", Sm, [o("p", Cm, k(j(d)("sent")), 1), o("p", wm, k(g(e.message.sentAt)), 1)]),
|
|
9543
|
-
o("div", Tm, [o("div", Em, [o("p", Dm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(
|
|
9545
|
+
o("div", Tm, [o("div", Em, [o("p", Dm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(oe), {
|
|
9544
9546
|
key: 0,
|
|
9545
9547
|
text: String(h.value.length),
|
|
9546
9548
|
context: "secondary",
|
|
9547
9549
|
rounded: ""
|
|
9548
9550
|
}, null, 8, ["text"])) : i("", !0)]), o("p", Om, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
|
|
9549
|
-
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(
|
|
9551
|
+
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(oe), {
|
|
9550
9552
|
key: 0,
|
|
9551
9553
|
text: String(m.value.length),
|
|
9552
9554
|
context: "success",
|
|
9553
9555
|
rounded: ""
|
|
9554
9556
|
}, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.readAt, m.value.length)), 1)])
|
|
9555
|
-
])]), e.loading ? (S(), a("div", Nm, [l(j(
|
|
9557
|
+
])]), e.loading ? (S(), a("div", Nm, [l(j(H), {
|
|
9556
9558
|
style: {
|
|
9557
9559
|
width: "2.5rem",
|
|
9558
9560
|
height: "2.5rem"
|
|
@@ -9594,19 +9596,25 @@ var of = { class: "w-full" }, sf = {
|
|
|
9594
9596
|
}, Bm = {
|
|
9595
9597
|
key: 2,
|
|
9596
9598
|
class: "space-y-3"
|
|
9597
|
-
}, Vm = { class: "flex flex-wrap items-start justify-between gap-3" }, Hm = { class: "
|
|
9599
|
+
}, Vm = { class: "flex flex-wrap items-start justify-between gap-3" }, Hm = { class: "w-full space-y-2" }, Um = { class: "center between gap-2" }, Wm = { class: "" }, Gm = { class: "space-y-1" }, Km = { class: "heading-sm text-default" }, qm = {
|
|
9598
9600
|
key: 0,
|
|
9599
9601
|
class: "body-md text-default"
|
|
9600
|
-
},
|
|
9602
|
+
}, Jm = {
|
|
9601
9603
|
key: 1,
|
|
9602
9604
|
class: "body-md text-default wrap-break-word whitespace-pre-wrap"
|
|
9603
|
-
},
|
|
9605
|
+
}, Ym = {
|
|
9606
|
+
key: 0,
|
|
9607
|
+
class: "max-w-sm"
|
|
9608
|
+
}, Xm = { class: "flex flex-wrap items-center gap-1" }, Zm = {
|
|
9604
9609
|
key: 0,
|
|
9605
9610
|
class: "bg-elevation-surface-sunken-default mt-4 flex flex-col gap-3 rounded-xl p-3 sm:flex-row sm:items-center"
|
|
9606
|
-
},
|
|
9611
|
+
}, Qm = { class: "grid w-full grid-cols-1 gap-2 sm:grid-cols-[1fr_8rem]" }, $m = { class: "flex items-center gap-2" }, eh = {
|
|
9607
9612
|
key: 1,
|
|
9608
9613
|
class: "bg-elevation-surface-sunken-default mt-4 flex flex-col gap-3 rounded-xl p-3"
|
|
9609
|
-
},
|
|
9614
|
+
}, th = {
|
|
9615
|
+
key: 0,
|
|
9616
|
+
class: "relative max-w-sm"
|
|
9617
|
+
}, nh = { class: "absolute top-2 right-2" }, rh = ["placeholder"], ih = { class: "flex items-center justify-end gap-2" }, ah = /* @__PURE__ */ u({
|
|
9610
9618
|
__name: "ScheduledMessagesDialog",
|
|
9611
9619
|
props: {
|
|
9612
9620
|
open: { type: Boolean },
|
|
@@ -9621,165 +9629,193 @@ var of = { class: "w-full" }, sf = {
|
|
|
9621
9629
|
"editText"
|
|
9622
9630
|
],
|
|
9623
9631
|
setup(t, { emit: s }) {
|
|
9624
|
-
let c = t, u = s, d = w(null), f = w(null), p = w(
|
|
9625
|
-
|
|
9626
|
-
e || (d.value = null, f.value = null, p.value =
|
|
9632
|
+
let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = q(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
|
|
9633
|
+
F(() => c.open, (e) => {
|
|
9634
|
+
e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
|
|
9627
9635
|
});
|
|
9628
|
-
function
|
|
9629
|
-
return e ? new Intl.DateTimeFormat(
|
|
9636
|
+
function x(e) {
|
|
9637
|
+
return e ? new Intl.DateTimeFormat(_.value, {
|
|
9630
9638
|
dateStyle: "medium",
|
|
9631
9639
|
timeStyle: "short",
|
|
9632
|
-
hourCycle:
|
|
9633
|
-
}).format(e) :
|
|
9640
|
+
hourCycle: Le()
|
|
9641
|
+
}).format(e) : v("unscheduled");
|
|
9634
9642
|
}
|
|
9635
|
-
function
|
|
9643
|
+
function C(e) {
|
|
9636
9644
|
let t = e ?? new Date(Date.now() + 3600 * 1e3);
|
|
9637
9645
|
return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
|
|
9638
9646
|
}
|
|
9639
|
-
function
|
|
9647
|
+
function E(e) {
|
|
9640
9648
|
let t = e ?? new Date(Date.now() + 3600 * 1e3);
|
|
9641
9649
|
return `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
9642
9650
|
}
|
|
9643
|
-
function E(e) {
|
|
9644
|
-
return _(e === "image" ? "image" : e === "video" ? "video" : e === "audio" ? "audio" : e === "file" ? "file" : "attachment");
|
|
9645
|
-
}
|
|
9646
9651
|
function D(e) {
|
|
9647
|
-
|
|
9652
|
+
return v(e === "image" ? "image" : e === "video" ? "video" : e === "audio" ? "audio" : e === "file" ? "file" : "attachment");
|
|
9648
9653
|
}
|
|
9649
9654
|
function O(e) {
|
|
9650
|
-
d.value = e.id, f.value = "
|
|
9655
|
+
d.value = e.id, f.value = "reschedule", m.value = C(e.scheduled?.scheduleDate), h.value = E(e.scheduled?.scheduleDate), g.value = "";
|
|
9651
9656
|
}
|
|
9652
|
-
function A() {
|
|
9653
|
-
d.value =
|
|
9657
|
+
function A(e) {
|
|
9658
|
+
d.value = e.id, f.value = "text", p.value = !1, g.value = ds(e, ""), m.value = "", h.value = "";
|
|
9659
|
+
}
|
|
9660
|
+
function M() {
|
|
9661
|
+
d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "";
|
|
9654
9662
|
}
|
|
9655
9663
|
function ee(e) {
|
|
9656
|
-
|
|
9657
|
-
|
|
9664
|
+
return {
|
|
9665
|
+
...e,
|
|
9666
|
+
text: ""
|
|
9667
|
+
};
|
|
9668
|
+
}
|
|
9669
|
+
function P() {
|
|
9670
|
+
p.value = !0;
|
|
9671
|
+
}
|
|
9672
|
+
function L(e) {
|
|
9673
|
+
return e.attachments.length ? !(d.value === e.id && p.value) : !1;
|
|
9674
|
+
}
|
|
9675
|
+
function R(e) {
|
|
9676
|
+
if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !m.value || !b.value) return;
|
|
9677
|
+
let [t, n, r] = m.value.split("-").map(Number), [i, a] = h.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
|
|
9658
9678
|
u("reschedule", {
|
|
9659
9679
|
messageId: e.scheduled.messageId,
|
|
9660
9680
|
muid: e.scheduled.muid,
|
|
9661
9681
|
originalChatUid: e.scheduled.originalChatUid,
|
|
9662
9682
|
scheduleDate: o.toISOString()
|
|
9663
|
-
}),
|
|
9683
|
+
}), M();
|
|
9664
9684
|
}
|
|
9665
|
-
function
|
|
9666
|
-
|
|
9685
|
+
function ne(e) {
|
|
9686
|
+
if (p.value && e.attachments.length > 0) {
|
|
9687
|
+
B(e);
|
|
9688
|
+
return;
|
|
9689
|
+
}
|
|
9690
|
+
let t = g.value.trim();
|
|
9667
9691
|
e.kind === "text" && !t || (u("editText", {
|
|
9668
9692
|
message: e,
|
|
9669
|
-
nextText:
|
|
9670
|
-
}),
|
|
9693
|
+
nextText: g.value
|
|
9694
|
+
}), M());
|
|
9671
9695
|
}
|
|
9672
|
-
function
|
|
9673
|
-
d.value === e.id &&
|
|
9696
|
+
function B(e) {
|
|
9697
|
+
d.value === e.id && M(), u("remove", e);
|
|
9674
9698
|
}
|
|
9675
9699
|
return (n, s) => (S(), r(cf, {
|
|
9676
9700
|
open: t.open,
|
|
9677
|
-
title: j(
|
|
9678
|
-
subtitle: t.conversationTitle ? j(
|
|
9679
|
-
"close-label": j(
|
|
9701
|
+
title: j(v)("scheduledMessages"),
|
|
9702
|
+
subtitle: t.conversationTitle ? j(v)("queuedForConversation", { title: t.conversationTitle }) : j(v)("queuedOutgoingMessagesForThisChat"),
|
|
9703
|
+
"close-label": j(v)("close"),
|
|
9680
9704
|
onClose: s[3] ||= (e) => u("close")
|
|
9681
9705
|
}, {
|
|
9682
|
-
default:
|
|
9706
|
+
default: I(() => [o("div", Lm, [t.loading ? (S(), a("div", Rm, [l(j(H), {
|
|
9683
9707
|
style: {
|
|
9684
9708
|
width: "2.75rem",
|
|
9685
9709
|
height: "2.75rem"
|
|
9686
9710
|
},
|
|
9687
9711
|
"stroke-width": "6"
|
|
9688
|
-
})])) :
|
|
9712
|
+
})])) : y.value.length === 0 ? (S(), a("div", zm, k(j(v)("noScheduledMessagesForConversation")), 1)) : (S(), a("div", Bm, [(S(!0), a(e, null, T(y.value, (e) => (S(), a("article", {
|
|
9689
9713
|
key: e.id,
|
|
9690
9714
|
class: "border-default rounded-lg border px-4 py-3"
|
|
9691
|
-
}, [o("div", Vm, [o("div", Hm, [
|
|
9692
|
-
|
|
9693
|
-
text: j(_)("poll"),
|
|
9694
|
-
context: "info",
|
|
9695
|
-
rounded: ""
|
|
9696
|
-
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(se), {
|
|
9697
|
-
key: 1,
|
|
9698
|
-
text: E(e.attachments[0].kind),
|
|
9699
|
-
context: "secondary",
|
|
9700
|
-
rounded: ""
|
|
9701
|
-
}, null, 8, ["text"])) : i("", !0)]), o("div", Wm, [o("p", Gm, k(b(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Km, k(e.poll.question), 1)) : (S(), a("p", qm, k(j(ds)(e, j(_)("attachment"))), 1))])]), o("div", Jm, [
|
|
9702
|
-
e.kind === "poll" ? i("", !0) : (S(), r(j(R), {
|
|
9715
|
+
}, [o("div", Vm, [o("div", Hm, [
|
|
9716
|
+
o("div", Um, [o("div", Wm, [e.kind === "poll" ? (S(), r(j(oe), {
|
|
9703
9717
|
key: 0,
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
onClick: (t) => O(e)
|
|
9709
|
-
}, null, 8, [
|
|
9710
|
-
"label",
|
|
9711
|
-
"icon",
|
|
9712
|
-
"onClick"
|
|
9713
|
-
])),
|
|
9714
|
-
e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(R), {
|
|
9718
|
+
text: j(v)("poll"),
|
|
9719
|
+
context: "info",
|
|
9720
|
+
rounded: ""
|
|
9721
|
+
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(oe), {
|
|
9715
9722
|
key: 1,
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
"
|
|
9723
|
-
"
|
|
9724
|
-
|
|
9725
|
-
])) : i("", !0),
|
|
9726
|
-
l(j(R), {
|
|
9727
|
-
label: j(_)("remove"),
|
|
9723
|
+
text: D(e.attachments[0].kind),
|
|
9724
|
+
context: "info",
|
|
9725
|
+
rounded: ""
|
|
9726
|
+
}, null, 8, ["text"])) : (S(), r(j(oe), {
|
|
9727
|
+
key: 2,
|
|
9728
|
+
text: j(v)("message"),
|
|
9729
|
+
context: "info",
|
|
9730
|
+
rounded: ""
|
|
9731
|
+
}, null, 8, ["text"]))]), l(j(z), {
|
|
9728
9732
|
icon: j(Cu),
|
|
9729
9733
|
text: "",
|
|
9730
9734
|
size: "small",
|
|
9731
|
-
onClick: (t) =>
|
|
9732
|
-
}, null, 8, [
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9735
|
+
onClick: (t) => B(e)
|
|
9736
|
+
}, null, 8, ["icon", "onClick"])]),
|
|
9737
|
+
o("div", Gm, [o("p", Km, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", qm, k(e.poll.question), 1)) : (S(), a("p", Jm, k(j(ds)(e, j(v)("attachment"))), 1))]),
|
|
9738
|
+
L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", Ym, [l(ip, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
|
|
9739
|
+
]), o("div", Xm, [e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
|
|
9740
|
+
key: 0,
|
|
9741
|
+
label: j(v)("edit"),
|
|
9742
|
+
icon: j(Eu),
|
|
9743
|
+
severity: "secondary",
|
|
9744
|
+
size: "small",
|
|
9745
|
+
onClick: (t) => A(e)
|
|
9746
|
+
}, null, 8, [
|
|
9747
|
+
"label",
|
|
9748
|
+
"icon",
|
|
9749
|
+
"onClick"
|
|
9750
|
+
])), e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
|
|
9751
|
+
key: 1,
|
|
9752
|
+
label: j(v)("reschedule"),
|
|
9753
|
+
icon: j(vu),
|
|
9754
|
+
severity: "secondary",
|
|
9755
|
+
size: "small",
|
|
9756
|
+
onClick: (t) => O(e)
|
|
9757
|
+
}, null, 8, [
|
|
9758
|
+
"label",
|
|
9759
|
+
"icon",
|
|
9760
|
+
"onClick"
|
|
9761
|
+
])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", Zm, [o("div", Qm, [te(o("input", {
|
|
9762
|
+
"onUpdate:modelValue": s[0] ||= (e) => m.value = e,
|
|
9739
9763
|
type: "date",
|
|
9740
9764
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9741
|
-
}, null, 512), [[
|
|
9742
|
-
"onUpdate:modelValue": s[1] ||= (e) =>
|
|
9765
|
+
}, null, 512), [[N, m.value]]), te(o("input", {
|
|
9766
|
+
"onUpdate:modelValue": s[1] ||= (e) => h.value = e,
|
|
9743
9767
|
type: "time",
|
|
9744
9768
|
inputmode: "numeric",
|
|
9745
9769
|
placeholder: "HH:mm",
|
|
9746
9770
|
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
9747
9771
|
"aria-label": "Time (24-hour)",
|
|
9748
9772
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9749
|
-
}, null, 512), [[
|
|
9750
|
-
label: j(
|
|
9773
|
+
}, null, 512), [[N, h.value]])]), o("div", $m, [l(j(z), {
|
|
9774
|
+
label: j(v)("save"),
|
|
9751
9775
|
size: "small",
|
|
9752
|
-
disabled: !
|
|
9753
|
-
onClick: (t) =>
|
|
9776
|
+
disabled: !m.value || !b.value,
|
|
9777
|
+
onClick: (t) => R(e)
|
|
9754
9778
|
}, null, 8, [
|
|
9755
9779
|
"label",
|
|
9756
9780
|
"disabled",
|
|
9757
9781
|
"onClick"
|
|
9758
|
-
]), l(j(
|
|
9759
|
-
label: j(
|
|
9782
|
+
]), l(j(z), {
|
|
9783
|
+
label: j(v)("cancel"),
|
|
9760
9784
|
size: "small",
|
|
9761
9785
|
text: "",
|
|
9762
|
-
onClick:
|
|
9763
|
-
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div",
|
|
9764
|
-
"
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
"
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9786
|
+
onClick: M
|
|
9787
|
+
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", eh, [
|
|
9788
|
+
L(e) ? (S(), a("div", th, [l(ip, { message: ee(e) }, null, 8, ["message"]), o("div", nh, [l(j(z), {
|
|
9789
|
+
icon: j(bu),
|
|
9790
|
+
"aria-label": j(v)("remove"),
|
|
9791
|
+
text: "",
|
|
9792
|
+
rounded: "",
|
|
9793
|
+
severity: "secondary",
|
|
9794
|
+
size: "small",
|
|
9795
|
+
onClick: P
|
|
9796
|
+
}, null, 8, ["icon", "aria-label"])])])) : i("", !0),
|
|
9797
|
+
te(o("textarea", {
|
|
9798
|
+
"onUpdate:modelValue": s[2] ||= (e) => g.value = e,
|
|
9799
|
+
rows: "3",
|
|
9800
|
+
class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
|
|
9801
|
+
placeholder: j(v)("writeMessage")
|
|
9802
|
+
}, null, 8, rh), [[N, g.value]]),
|
|
9803
|
+
o("div", ih, [l(j(z), {
|
|
9804
|
+
label: j(v)("cancel"),
|
|
9805
|
+
size: "small",
|
|
9806
|
+
text: "",
|
|
9807
|
+
onClick: M
|
|
9808
|
+
}, null, 8, ["label"]), l(j(z), {
|
|
9809
|
+
label: j(v)("save"),
|
|
9810
|
+
size: "small",
|
|
9811
|
+
disabled: !p.value && e.kind === "text" && !g.value.trim(),
|
|
9812
|
+
onClick: (t) => ne(e)
|
|
9813
|
+
}, null, 8, [
|
|
9814
|
+
"label",
|
|
9815
|
+
"disabled",
|
|
9816
|
+
"onClick"
|
|
9817
|
+
])])
|
|
9818
|
+
])) : i("", !0)]))), 128))]))])]),
|
|
9783
9819
|
_: 1
|
|
9784
9820
|
}, 8, [
|
|
9785
9821
|
"open",
|
|
@@ -9788,10 +9824,10 @@ var of = { class: "w-full" }, sf = {
|
|
|
9788
9824
|
"close-label"
|
|
9789
9825
|
]));
|
|
9790
9826
|
}
|
|
9791
|
-
}),
|
|
9827
|
+
}), oh = {
|
|
9792
9828
|
key: 0,
|
|
9793
9829
|
class: "chat-status-overlay"
|
|
9794
|
-
},
|
|
9830
|
+
}, sh = { class: "chat-status-overlay__card" }, ch = { key: 0 }, lh = { key: 1 }, uh = { key: 2 }, dh = { key: 3 }, fh = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9795
9831
|
__name: "ChatStatusOverlay",
|
|
9796
9832
|
props: {
|
|
9797
9833
|
visible: { type: Boolean },
|
|
@@ -9804,9 +9840,9 @@ var of = { class: "w-full" }, sf = {
|
|
|
9804
9840
|
messages: {}
|
|
9805
9841
|
},
|
|
9806
9842
|
setup(e) {
|
|
9807
|
-
return (t, n) => e.visible ? (S(), a("div",
|
|
9843
|
+
return (t, n) => e.visible ? (S(), a("div", oh, [o("div", sh, [e.offlineMode ? (S(), a("span", ch, k(e.messages.waitingForNetwork), 1)) : e.connected ? e.loading ? (S(), a("span", uh, k(e.messages.loading), 1)) : e.notFound ? (S(), a("span", dh, k(e.messages.notFound), 1)) : e.isEmpty && e.showEmptySlot ? E(t.$slots, "no-messages", { key: 4 }, () => [o("span", null, k(e.messages.noMessages), 1)], !0) : i("", !0) : (S(), a("span", lh, k(e.messages.connecting), 1))])])) : i("", !0);
|
|
9808
9844
|
}
|
|
9809
|
-
}), [["__scopeId", "data-v-20316f96"]]),
|
|
9845
|
+
}), [["__scopeId", "data-v-20316f96"]]), ph = /* @__PURE__ */ u({
|
|
9810
9846
|
__name: "BccChat",
|
|
9811
9847
|
props: {
|
|
9812
9848
|
client: { default: null },
|
|
@@ -9866,17 +9902,17 @@ var of = { class: "w-full" }, sf = {
|
|
|
9866
9902
|
});
|
|
9867
9903
|
return n;
|
|
9868
9904
|
}
|
|
9869
|
-
let p = t, m = u, { t: h } =
|
|
9905
|
+
let p = t, m = u, { t: h } = q(() => p.language), v = w(null), x = w(!1), C = w(!1), T = n(() => p.client ?? $.value ?? null), D = n(() => !!p.chatUid), O = n(() => {
|
|
9870
9906
|
if (p.conversation !== void 0) return p.conversation;
|
|
9871
9907
|
let e = T.value;
|
|
9872
9908
|
return e ? p.chatUid ? e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null : e.activeConversation.value : null;
|
|
9873
|
-
}), { groupMembers: A, fetchGroupMembers:
|
|
9909
|
+
}), { groupMembers: A, fetchGroupMembers: M } = pu({
|
|
9874
9910
|
getConversationTargetId: () => O.value?.targetId,
|
|
9875
9911
|
isChannel: () => Nl(O.value),
|
|
9876
9912
|
onMembersChanged: (e) => {
|
|
9877
9913
|
m("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
|
|
9878
9914
|
}
|
|
9879
|
-
}),
|
|
9915
|
+
}), N = Ul({
|
|
9880
9916
|
chatClient: T,
|
|
9881
9917
|
selectedConversation: O,
|
|
9882
9918
|
getPropIsReadOnly: () => p.isReadOnly,
|
|
@@ -9888,8 +9924,8 @@ var of = { class: "w-full" }, sf = {
|
|
|
9888
9924
|
currentUserId: T.value?.currentUser.value?.uid
|
|
9889
9925
|
})
|
|
9890
9926
|
});
|
|
9891
|
-
Gl(
|
|
9892
|
-
let
|
|
9927
|
+
Gl(N);
|
|
9928
|
+
let P = ql({
|
|
9893
9929
|
chatClient: T,
|
|
9894
9930
|
selectedConversation: O,
|
|
9895
9931
|
usesPublicContract: D,
|
|
@@ -9901,61 +9937,61 @@ var of = { class: "w-full" }, sf = {
|
|
|
9901
9937
|
getPropShowDefaultEmptyState: () => p.showDefaultEmptyState,
|
|
9902
9938
|
getHideDeletedMessages: () => p.hideDeletedMessages
|
|
9903
9939
|
});
|
|
9904
|
-
Yl(
|
|
9905
|
-
let
|
|
9940
|
+
Yl(P);
|
|
9941
|
+
let te = n(() => P.messages.value.length > 0), L = n(() => p.showHeader ?? p.showMessageHeader), R = ru({
|
|
9906
9942
|
chatClient: T,
|
|
9907
9943
|
selectedConversation: O,
|
|
9908
9944
|
getInitialScheduledMessagesOpen: () => !!p.initialScheduledMessagesOpen,
|
|
9909
9945
|
fetchErrorFallback: h("loadMessageReceiptsError")
|
|
9910
9946
|
});
|
|
9911
|
-
au(
|
|
9912
|
-
let
|
|
9947
|
+
au(R);
|
|
9948
|
+
let z = ee("mainComposerRef"), ne = ee("threadComposerRef"), B = Ql({
|
|
9913
9949
|
chatClient: T,
|
|
9914
|
-
sendOptions:
|
|
9915
|
-
mentionNameByUid:
|
|
9916
|
-
afterSchedule: () =>
|
|
9917
|
-
mainComposerRef:
|
|
9918
|
-
threadComposerRef:
|
|
9950
|
+
sendOptions: N.sendOptions,
|
|
9951
|
+
mentionNameByUid: N.mentionNameByUid,
|
|
9952
|
+
afterSchedule: () => R.openScheduledMessages(),
|
|
9953
|
+
mainComposerRef: z,
|
|
9954
|
+
threadComposerRef: ne
|
|
9919
9955
|
});
|
|
9920
|
-
eu(
|
|
9921
|
-
let
|
|
9922
|
-
uu(
|
|
9923
|
-
conversation:
|
|
9924
|
-
composer:
|
|
9925
|
-
dialogs:
|
|
9926
|
-
bus:
|
|
9956
|
+
eu(B);
|
|
9957
|
+
let re = lu();
|
|
9958
|
+
uu(re), su({
|
|
9959
|
+
conversation: N,
|
|
9960
|
+
composer: B,
|
|
9961
|
+
dialogs: R,
|
|
9962
|
+
bus: re
|
|
9927
9963
|
});
|
|
9928
|
-
let { scrollToRequestedMessage:
|
|
9964
|
+
let { scrollToRequestedMessage: ie } = mu({
|
|
9929
9965
|
chatRootRef: v,
|
|
9930
9966
|
getClient: () => T.value
|
|
9931
9967
|
});
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
}, { immediate: !0 }),
|
|
9935
|
-
!e || O.value?.type !== "group" || await
|
|
9936
|
-
}, { immediate: !0 }),
|
|
9937
|
-
|
|
9938
|
-
}),
|
|
9968
|
+
F(() => O.value?.targetId ?? null, () => {
|
|
9969
|
+
R.refreshScheduledMessages();
|
|
9970
|
+
}, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
|
|
9971
|
+
!e || O.value?.type !== "group" || await M(e);
|
|
9972
|
+
}, { immediate: !0 }), F(() => O.value?.id, () => {
|
|
9973
|
+
B.resetMainComposer(), B.resetThreadComposer(), R.showScheduledMessages.value = !1, R.closeMessageInfo();
|
|
9974
|
+
}), F(() => p.chatMessageGetter, (e) => {
|
|
9939
9975
|
jl.setGetChatMessagesCallback(e);
|
|
9940
|
-
}, { immediate: !0 }),
|
|
9941
|
-
e &&
|
|
9942
|
-
}, { immediate: !0 }), P
|
|
9976
|
+
}, { immediate: !0 }), F(() => p.language, (e) => {
|
|
9977
|
+
e && Re(e);
|
|
9978
|
+
}, { immediate: !0 }), F(P.isChatEmpty, (e) => {
|
|
9943
9979
|
e && m("chatEmpty");
|
|
9944
|
-
}),
|
|
9980
|
+
}), F([
|
|
9945
9981
|
() => p.chatUid,
|
|
9946
9982
|
() => p.client ? p.client.initialized.value : jl.initialized.value,
|
|
9947
9983
|
() => p.client ? p.client.loggedIn.value : jl.loggedIn.value,
|
|
9948
9984
|
() => T.value?.conversations.value.length ?? 0
|
|
9949
9985
|
], async ([e, t, n]) => {
|
|
9950
|
-
!D.value || !e || !t || !n || !T.value || await
|
|
9951
|
-
}, { immediate: !0 }),
|
|
9952
|
-
() =>
|
|
9953
|
-
() =>
|
|
9986
|
+
!D.value || !e || !t || !n || !T.value || await V();
|
|
9987
|
+
}, { immediate: !0 }), F([
|
|
9988
|
+
() => P.messages.value.length,
|
|
9989
|
+
() => P.threadMessages.value.length,
|
|
9954
9990
|
() => jl.scrollToMessageId.value
|
|
9955
9991
|
], async () => {
|
|
9956
|
-
await
|
|
9992
|
+
await ie();
|
|
9957
9993
|
});
|
|
9958
|
-
async function
|
|
9994
|
+
async function V() {
|
|
9959
9995
|
let e = T.value;
|
|
9960
9996
|
if (e) {
|
|
9961
9997
|
C.value = !0, x.value = !1;
|
|
@@ -9966,39 +10002,39 @@ var of = { class: "w-full" }, sf = {
|
|
|
9966
10002
|
x.value = !0, m("chatMembersFetched", []);
|
|
9967
10003
|
return;
|
|
9968
10004
|
}
|
|
9969
|
-
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await
|
|
10005
|
+
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
|
|
9970
10006
|
} finally {
|
|
9971
10007
|
C.value = !1;
|
|
9972
10008
|
}
|
|
9973
10009
|
}
|
|
9974
10010
|
}
|
|
9975
|
-
function
|
|
10011
|
+
function H(e, t) {
|
|
9976
10012
|
m("linkClicked", e, t);
|
|
9977
10013
|
}
|
|
9978
|
-
let
|
|
10014
|
+
let oe = w(!1);
|
|
9979
10015
|
b(() => {
|
|
9980
10016
|
setTimeout(() => {
|
|
9981
|
-
|
|
10017
|
+
oe.value = !0;
|
|
9982
10018
|
}, 200);
|
|
9983
10019
|
}), y(() => {
|
|
9984
10020
|
let e = T.value;
|
|
9985
10021
|
e && e.activeConversation.value === O.value && e.selectConversation(null);
|
|
9986
10022
|
});
|
|
9987
|
-
async function
|
|
9988
|
-
return await new Promise((e) => setTimeout(e, 100)),
|
|
10023
|
+
async function U(e) {
|
|
10024
|
+
return await new Promise((e) => setTimeout(e, 100)), oe.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), U(e));
|
|
9989
10025
|
}
|
|
9990
|
-
return o({ scrollToMessage:
|
|
10026
|
+
return o({ scrollToMessage: U }), (n, o) => (S(), a("div", {
|
|
9991
10027
|
ref_key: "chatRootRef",
|
|
9992
10028
|
ref: v,
|
|
9993
10029
|
class: "bcc-chat-message-list-wrapper relative h-full min-h-104"
|
|
9994
10030
|
}, [
|
|
9995
|
-
D.value && T.value?.error.value ? (S(), r(j(
|
|
10031
|
+
D.value && T.value?.error.value ? (S(), r(j(ae), {
|
|
9996
10032
|
key: 0,
|
|
9997
10033
|
severity: "error",
|
|
9998
10034
|
closable: !1,
|
|
9999
10035
|
class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
|
|
10000
10036
|
}, {
|
|
10001
|
-
default:
|
|
10037
|
+
default: I(() => [c(k(T.value.error.value), 1)]),
|
|
10002
10038
|
_: 1
|
|
10003
10039
|
})) : i("", !0),
|
|
10004
10040
|
T.value ? (S(), a(e, { key: 1 }, [
|
|
@@ -10006,20 +10042,20 @@ var of = { class: "w-full" }, sf = {
|
|
|
10006
10042
|
target: "main",
|
|
10007
10043
|
class: g(["h-full", t.containerClass]),
|
|
10008
10044
|
"hide-group-actions": t.hideGroupActions,
|
|
10009
|
-
"show-header":
|
|
10045
|
+
"show-header": L.value,
|
|
10010
10046
|
"action-message-class": t.actionMessageClass,
|
|
10011
10047
|
"action-message-row-class": t.actionMessageRowClass,
|
|
10012
|
-
onAnchorclick:
|
|
10048
|
+
onAnchorclick: H
|
|
10013
10049
|
}, s({
|
|
10014
|
-
composer:
|
|
10050
|
+
composer: I(() => [l(qd, {
|
|
10015
10051
|
ref_key: "mainComposerRef",
|
|
10016
|
-
ref:
|
|
10052
|
+
ref: z,
|
|
10017
10053
|
target: "main"
|
|
10018
10054
|
}, null, 512)]),
|
|
10019
10055
|
_: 2
|
|
10020
10056
|
}, [n.$slots["message-header"] ? {
|
|
10021
10057
|
name: "header",
|
|
10022
|
-
fn:
|
|
10058
|
+
fn: I((e) => [E(n.$slots, "message-header", _(d(e)))]),
|
|
10023
10059
|
key: "0"
|
|
10024
10060
|
} : void 0]), 1032, [
|
|
10025
10061
|
"hide-group-actions",
|
|
@@ -10029,22 +10065,22 @@ var of = { class: "w-full" }, sf = {
|
|
|
10029
10065
|
"action-message-row-class"
|
|
10030
10066
|
]),
|
|
10031
10067
|
l(cf, {
|
|
10032
|
-
open: !!j(
|
|
10033
|
-
title: j(h)("threadWithCount", { count: j(
|
|
10068
|
+
open: !!j(P).activeThreadParentMessage.value,
|
|
10069
|
+
title: j(h)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
|
|
10034
10070
|
subtitle: O.value?.title ?? "",
|
|
10035
10071
|
"close-label": j(h)("close"),
|
|
10036
10072
|
"close-aria-label": j(h)("closeThread"),
|
|
10037
|
-
onClose: o[0] ||= (e) => j(
|
|
10073
|
+
onClose: o[0] ||= (e) => j(re).emit("ui:closeThread")
|
|
10038
10074
|
}, {
|
|
10039
|
-
default:
|
|
10075
|
+
default: I(() => [l(am, {
|
|
10040
10076
|
target: "thread",
|
|
10041
10077
|
class: "min-h-0 flex-1",
|
|
10042
10078
|
"action-message-class": t.actionMessageClass,
|
|
10043
10079
|
"action-message-row-class": t.actionMessageRowClass
|
|
10044
10080
|
}, {
|
|
10045
|
-
composer:
|
|
10081
|
+
composer: I(() => [l(qd, {
|
|
10046
10082
|
ref_key: "threadComposerRef",
|
|
10047
|
-
ref:
|
|
10083
|
+
ref: ne,
|
|
10048
10084
|
target: "thread"
|
|
10049
10085
|
}, null, 512)]),
|
|
10050
10086
|
_: 1
|
|
@@ -10057,15 +10093,15 @@ var of = { class: "w-full" }, sf = {
|
|
|
10057
10093
|
"close-label",
|
|
10058
10094
|
"close-aria-label"
|
|
10059
10095
|
]),
|
|
10060
|
-
l(
|
|
10061
|
-
open: j(
|
|
10062
|
-
loading: j(
|
|
10063
|
-
messages: j(
|
|
10096
|
+
l(ah, {
|
|
10097
|
+
open: j(R).showScheduledMessages.value,
|
|
10098
|
+
loading: j(R).loadingScheduledMessages.value,
|
|
10099
|
+
messages: j(R).scheduledMessages.value,
|
|
10064
10100
|
"conversation-title": O.value?.title,
|
|
10065
|
-
onClose: o[1] ||= (e) => j(
|
|
10066
|
-
onReschedule: o[2] ||= (e) => j(
|
|
10067
|
-
onRemove: o[3] ||= (e) => j(
|
|
10068
|
-
onEditText: o[4] ||= (e) => j(
|
|
10101
|
+
onClose: o[1] ||= (e) => j(R).showScheduledMessages.value = !1,
|
|
10102
|
+
onReschedule: o[2] ||= (e) => j(re).emit("ui:reschedule", e),
|
|
10103
|
+
onRemove: o[3] ||= (e) => j(re).emit("ui:removeScheduled", e),
|
|
10104
|
+
onEditText: o[4] ||= (e) => j(re).emit("ui:editScheduledText", e)
|
|
10069
10105
|
}, null, 8, [
|
|
10070
10106
|
"open",
|
|
10071
10107
|
"loading",
|
|
@@ -10073,12 +10109,12 @@ var of = { class: "w-full" }, sf = {
|
|
|
10073
10109
|
"conversation-title"
|
|
10074
10110
|
]),
|
|
10075
10111
|
l(Im, {
|
|
10076
|
-
open: !!j(
|
|
10077
|
-
message: j(
|
|
10078
|
-
receipts: j(
|
|
10079
|
-
loading: j(
|
|
10080
|
-
error: j(
|
|
10081
|
-
onClose: o[5] ||= (e) => j(
|
|
10112
|
+
open: !!j(R).infoMessage.value,
|
|
10113
|
+
message: j(R).infoMessage.value,
|
|
10114
|
+
receipts: j(R).infoMessageReceipts.value,
|
|
10115
|
+
loading: j(R).loadingMessageReceipts.value,
|
|
10116
|
+
error: j(R).messageReceiptsError.value,
|
|
10117
|
+
onClose: o[5] ||= (e) => j(R).closeMessageInfo()
|
|
10082
10118
|
}, null, 8, [
|
|
10083
10119
|
"open",
|
|
10084
10120
|
"message",
|
|
@@ -10087,13 +10123,13 @@ var of = { class: "w-full" }, sf = {
|
|
|
10087
10123
|
"error"
|
|
10088
10124
|
])
|
|
10089
10125
|
], 64)) : i("", !0),
|
|
10090
|
-
l(
|
|
10091
|
-
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !
|
|
10126
|
+
l(fh, {
|
|
10127
|
+
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !te.value || x.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
|
|
10092
10128
|
"offline-mode": !!(T.value?.offlineMode.value && !O.value),
|
|
10093
10129
|
connected: !!(T.value?.connected.value || O.value),
|
|
10094
10130
|
loading: C.value,
|
|
10095
10131
|
"not-found": x.value,
|
|
10096
|
-
"is-empty": j(
|
|
10132
|
+
"is-empty": j(P).isChatEmpty.value,
|
|
10097
10133
|
"show-empty-slot": t.displayNoMessagesText,
|
|
10098
10134
|
messages: {
|
|
10099
10135
|
waitingForNetwork: j(h)("waitingForNetwork"),
|
|
@@ -10103,7 +10139,7 @@ var of = { class: "w-full" }, sf = {
|
|
|
10103
10139
|
noMessages: j(h)("noMessagesHaveBeenSentYet")
|
|
10104
10140
|
}
|
|
10105
10141
|
}, {
|
|
10106
|
-
"no-messages":
|
|
10142
|
+
"no-messages": I(() => [E(n.$slots, "no-messages")]),
|
|
10107
10143
|
_: 3
|
|
10108
10144
|
}, 8, [
|
|
10109
10145
|
"visible",
|
|
@@ -10119,6 +10155,6 @@ var of = { class: "w-full" }, sf = {
|
|
|
10119
10155
|
}
|
|
10120
10156
|
});
|
|
10121
10157
|
//#endregion
|
|
10122
|
-
export {
|
|
10158
|
+
export { ph as BccChat, ph as BccChatMessageList, Yc as LogSeverity, jl as chat, jl as default, ks as createChatClient };
|
|
10123
10159
|
|
|
10124
10160
|
//# sourceMappingURL=vue-bcc-chat-ui.js.map
|