@gnai/message-content-renderer 0.0.3 → 0.0.5
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.
|
@@ -290,15 +290,15 @@ function B0(u, e) {
|
|
|
290
290
|
};
|
|
291
291
|
let o = t.body;
|
|
292
292
|
[t, n].forEach((v) => {
|
|
293
|
-
const k = [], F = v.hFlip,
|
|
294
|
-
let
|
|
295
|
-
F ?
|
|
293
|
+
const k = [], F = v.hFlip, E = v.vFlip;
|
|
294
|
+
let y = v.rotate;
|
|
295
|
+
F ? E ? y += 2 : (k.push(
|
|
296
296
|
"translate(" + (r.width + r.left).toString() + " " + (0 - r.top).toString() + ")"
|
|
297
|
-
), k.push("scale(-1 1)"), r.top = r.left = 0) :
|
|
297
|
+
), k.push("scale(-1 1)"), r.top = r.left = 0) : E && (k.push(
|
|
298
298
|
"translate(" + (0 - r.left).toString() + " " + (r.height + r.top).toString() + ")"
|
|
299
299
|
), k.push("scale(1 -1)"), r.top = r.left = 0);
|
|
300
300
|
let p;
|
|
301
|
-
switch (
|
|
301
|
+
switch (y < 0 && (y -= Math.floor(y / 4) * 4), y = y % 4, y) {
|
|
302
302
|
case 1:
|
|
303
303
|
p = r.height / 2 + r.top, k.unshift(
|
|
304
304
|
"rotate(90 " + p.toString() + " " + p.toString() + ")"
|
|
@@ -315,7 +315,7 @@ function B0(u, e) {
|
|
|
315
315
|
);
|
|
316
316
|
break;
|
|
317
317
|
}
|
|
318
|
-
|
|
318
|
+
y % 2 === 1 && (r.left !== r.top && (p = r.left, r.left = r.top, r.top = p), r.width !== r.height && (p = r.width, r.width = r.height, r.height = p)), k.length && (o = L0(
|
|
319
319
|
o,
|
|
320
320
|
'<g transform="' + k.join(" ") + '">',
|
|
321
321
|
"</g>"
|
|
@@ -614,8 +614,8 @@ function en(u, e, t, n) {
|
|
|
614
614
|
if (u.random) {
|
|
615
615
|
let h = u.resources.slice(0);
|
|
616
616
|
for (c = []; h.length > 1; ) {
|
|
617
|
-
const
|
|
618
|
-
c.push(h[
|
|
617
|
+
const x = Math.floor(Math.random() * h.length);
|
|
618
|
+
c.push(h[x]), h = h.slice(0, x).concat(h.slice(x + 1));
|
|
619
619
|
}
|
|
620
620
|
c = c.concat(h);
|
|
621
621
|
} else
|
|
@@ -631,8 +631,8 @@ function en(u, e, t, n) {
|
|
|
631
631
|
h.status === "pending" && (h.status = "aborted");
|
|
632
632
|
}), m = [];
|
|
633
633
|
}
|
|
634
|
-
function k(h,
|
|
635
|
-
|
|
634
|
+
function k(h, x) {
|
|
635
|
+
x && (b = []), typeof h == "function" && b.push(h);
|
|
636
636
|
}
|
|
637
637
|
function F() {
|
|
638
638
|
return {
|
|
@@ -645,45 +645,45 @@ function en(u, e, t, n) {
|
|
|
645
645
|
abort: v
|
|
646
646
|
};
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function E() {
|
|
649
649
|
a = "failed", b.forEach((h) => {
|
|
650
650
|
h(void 0, l);
|
|
651
651
|
});
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function y() {
|
|
654
654
|
m.forEach((h) => {
|
|
655
655
|
h.status === "pending" && (h.status = "aborted");
|
|
656
656
|
}), m = [];
|
|
657
657
|
}
|
|
658
|
-
function p(h,
|
|
659
|
-
const
|
|
660
|
-
switch (m = m.filter((
|
|
658
|
+
function p(h, x, D) {
|
|
659
|
+
const T = x !== "success";
|
|
660
|
+
switch (m = m.filter((I) => I !== h), a) {
|
|
661
661
|
case "pending":
|
|
662
662
|
break;
|
|
663
663
|
case "failed":
|
|
664
|
-
if (
|
|
664
|
+
if (T || !u.dataAfterTimeout)
|
|
665
665
|
return;
|
|
666
666
|
break;
|
|
667
667
|
default:
|
|
668
668
|
return;
|
|
669
669
|
}
|
|
670
|
-
if (
|
|
671
|
-
l =
|
|
670
|
+
if (x === "abort") {
|
|
671
|
+
l = D, E();
|
|
672
672
|
return;
|
|
673
673
|
}
|
|
674
|
-
if (
|
|
675
|
-
l =
|
|
674
|
+
if (T) {
|
|
675
|
+
l = D, m.length || (c.length ? g() : E());
|
|
676
676
|
return;
|
|
677
677
|
}
|
|
678
|
-
if (d(),
|
|
679
|
-
const
|
|
680
|
-
|
|
678
|
+
if (d(), y(), !u.random) {
|
|
679
|
+
const I = u.resources.indexOf(h.resource);
|
|
680
|
+
I !== -1 && I !== u.index && (u.index = I);
|
|
681
681
|
}
|
|
682
|
-
a = "completed", b.forEach((
|
|
683
|
-
|
|
682
|
+
a = "completed", b.forEach((I) => {
|
|
683
|
+
I(D);
|
|
684
684
|
});
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function g() {
|
|
687
687
|
if (a !== "pending")
|
|
688
688
|
return;
|
|
689
689
|
d();
|
|
@@ -691,23 +691,23 @@ function en(u, e, t, n) {
|
|
|
691
691
|
if (h === void 0) {
|
|
692
692
|
if (m.length) {
|
|
693
693
|
f = setTimeout(() => {
|
|
694
|
-
d(), a === "pending" && (
|
|
694
|
+
d(), a === "pending" && (y(), E());
|
|
695
695
|
}, u.timeout);
|
|
696
696
|
return;
|
|
697
697
|
}
|
|
698
|
-
|
|
698
|
+
E();
|
|
699
699
|
return;
|
|
700
700
|
}
|
|
701
|
-
const
|
|
701
|
+
const x = {
|
|
702
702
|
status: "pending",
|
|
703
703
|
resource: h,
|
|
704
|
-
callback: (
|
|
705
|
-
p(
|
|
704
|
+
callback: (D, T) => {
|
|
705
|
+
p(x, D, T);
|
|
706
706
|
}
|
|
707
707
|
};
|
|
708
|
-
m.push(
|
|
708
|
+
m.push(x), s++, f = setTimeout(g, u.rotate), t(h, e, x.callback);
|
|
709
709
|
}
|
|
710
|
-
return setTimeout(
|
|
710
|
+
return setTimeout(g), F;
|
|
711
711
|
}
|
|
712
712
|
function Ot(u) {
|
|
713
713
|
const e = {
|
|
@@ -1336,12 +1336,12 @@ $u.prototype.parse = function(u, e) {
|
|
|
1336
1336
|
for (let v = 0, k = d.length; v < k; v++) {
|
|
1337
1337
|
const F = d[v];
|
|
1338
1338
|
if (F && !F.match(et)) {
|
|
1339
|
-
let
|
|
1340
|
-
for (let
|
|
1341
|
-
F.charCodeAt(
|
|
1342
|
-
if (!
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1339
|
+
let E = "";
|
|
1340
|
+
for (let y = 0, p = F.length; y < p; y++)
|
|
1341
|
+
F.charCodeAt(y) > 127 ? E += "x" : E += F[y];
|
|
1342
|
+
if (!E.match(et)) {
|
|
1343
|
+
const y = d.slice(0, v), p = d.slice(v + 1), g = F.match(Sn);
|
|
1344
|
+
g && (y.push(g[1]), p.unshift(g[2])), p.length && (o = p.join(".") + o), this.hostname = y.join(".");
|
|
1345
1345
|
break;
|
|
1346
1346
|
}
|
|
1347
1347
|
}
|
|
@@ -2243,13 +2243,13 @@ function gr(u) {
|
|
|
2243
2243
|
s[b].schema ? s[b].schema === "mailto:" && !/^mailto:/i.test(k) ? k = u.md.normalizeLinkText("mailto:" + k).replace(/^mailto:/, "") : k = u.md.normalizeLinkText(k) : k = u.md.normalizeLinkText("http://" + k).replace(/^http:\/\//, "");
|
|
2244
2244
|
const F = s[b].index;
|
|
2245
2245
|
if (F > m) {
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2246
|
+
const g = new u.Token("text", "", 0);
|
|
2247
|
+
g.content = a.slice(m, F), g.level = f, l.push(g);
|
|
2248
2248
|
}
|
|
2249
|
-
const
|
|
2250
|
-
|
|
2251
|
-
const
|
|
2252
|
-
|
|
2249
|
+
const E = new u.Token("link_open", "a", 1);
|
|
2250
|
+
E.attrs = [["href", v]], E.level = f++, E.markup = "linkify", E.info = "auto", l.push(E);
|
|
2251
|
+
const y = new u.Token("text", "", 0);
|
|
2252
|
+
y.content = k, y.level = f, l.push(y);
|
|
2253
2253
|
const p = new u.Token("link_close", "a", -1);
|
|
2254
2254
|
p.level = --f, p.markup = "linkify", p.info = "auto", l.push(p), m = s[b].lastIndex;
|
|
2255
2255
|
}
|
|
@@ -2331,8 +2331,8 @@ function Ar(u, e) {
|
|
|
2331
2331
|
v = u[t].content.charCodeAt(0);
|
|
2332
2332
|
break;
|
|
2333
2333
|
}
|
|
2334
|
-
const k = Iu(d) || Tu(String.fromCharCode(d)), F = Iu(v) || Tu(String.fromCharCode(v)),
|
|
2335
|
-
if (
|
|
2334
|
+
const k = Iu(d) || Tu(String.fromCharCode(d)), F = Iu(v) || Tu(String.fromCharCode(v)), E = Su(d), y = Su(v);
|
|
2335
|
+
if (y ? f = !1 : F && (E || k || (f = !1)), E ? m = !1 : k && (y || F || (m = !1)), v === 34 && l[0] === '"' && d >= 48 && d <= 57 && (m = f = !1), f && m && (f = k, m = F), !f && !m) {
|
|
2336
2336
|
b && (o.content = Mu(o.content, l.index, ot));
|
|
2337
2337
|
continue;
|
|
2338
2338
|
}
|
|
@@ -2343,12 +2343,12 @@ function Ar(u, e) {
|
|
|
2343
2343
|
break;
|
|
2344
2344
|
if (p.single === b && n[t].level === c) {
|
|
2345
2345
|
p = n[t];
|
|
2346
|
-
let
|
|
2347
|
-
b ? (
|
|
2346
|
+
let g, h;
|
|
2347
|
+
b ? (g = e.md.options.quotes[2], h = e.md.options.quotes[3]) : (g = e.md.options.quotes[0], h = e.md.options.quotes[1]), o.content = Mu(o.content, l.index, h), u[p.token].content = Mu(
|
|
2348
2348
|
u[p.token].content,
|
|
2349
2349
|
p.pos,
|
|
2350
|
-
|
|
2351
|
-
), a += h.length - 1, p.token === r && (a +=
|
|
2350
|
+
g
|
|
2351
|
+
), a += h.length - 1, p.token === r && (a += g.length - 1), i = o.content, s = i.length, n.length = t;
|
|
2352
2352
|
continue u;
|
|
2353
2353
|
}
|
|
2354
2354
|
}
|
|
@@ -2516,15 +2516,15 @@ function Ir(u, e, t, n) {
|
|
|
2516
2516
|
let a = oe(u, e + 1), s = a.split("|");
|
|
2517
2517
|
const l = [];
|
|
2518
2518
|
for (let p = 0; p < s.length; p++) {
|
|
2519
|
-
const
|
|
2520
|
-
if (!
|
|
2519
|
+
const g = s[p].trim();
|
|
2520
|
+
if (!g) {
|
|
2521
2521
|
if (p === 0 || p === s.length - 1)
|
|
2522
2522
|
continue;
|
|
2523
2523
|
return !1;
|
|
2524
2524
|
}
|
|
2525
|
-
if (!/^:?-+:?$/.test(
|
|
2525
|
+
if (!/^:?-+:?$/.test(g))
|
|
2526
2526
|
return !1;
|
|
2527
|
-
|
|
2527
|
+
g.charCodeAt(g.length - 1) === 58 ? l.push(g.charCodeAt(0) === 58 ? "center" : "right") : g.charCodeAt(0) === 58 ? l.push("left") : l.push("");
|
|
2528
2528
|
}
|
|
2529
2529
|
if (a = oe(u, e).trim(), a.indexOf("|") === -1 || u.sCount[e] - u.blkIndent >= 4)
|
|
2530
2530
|
return !1;
|
|
@@ -2543,37 +2543,37 @@ function Ir(u, e, t, n) {
|
|
|
2543
2543
|
const F = u.push("tr_open", "tr", 1);
|
|
2544
2544
|
F.map = [e, e + 1];
|
|
2545
2545
|
for (let p = 0; p < s.length; p++) {
|
|
2546
|
-
const
|
|
2547
|
-
l[p] && (
|
|
2546
|
+
const g = u.push("th_open", "th", 1);
|
|
2547
|
+
l[p] && (g.attrs = [["style", "text-align:" + l[p]]]);
|
|
2548
2548
|
const h = u.push("inline", "", 0);
|
|
2549
2549
|
h.content = s[p].trim(), h.children = [], u.push("th_close", "th", -1);
|
|
2550
2550
|
}
|
|
2551
2551
|
u.push("tr_close", "tr", -1), u.push("thead_close", "thead", -1);
|
|
2552
|
-
let
|
|
2552
|
+
let E, y = 0;
|
|
2553
2553
|
for (r = e + 2; r < t && !(u.sCount[r] < u.blkIndent); r++) {
|
|
2554
2554
|
let p = !1;
|
|
2555
|
-
for (let h = 0,
|
|
2555
|
+
for (let h = 0, x = b.length; h < x; h++)
|
|
2556
2556
|
if (b[h](u, r, t, !0)) {
|
|
2557
2557
|
p = !0;
|
|
2558
2558
|
break;
|
|
2559
2559
|
}
|
|
2560
|
-
if (p || (a = oe(u, r).trim(), !a) || u.sCount[r] - u.blkIndent >= 4 || (s = ct(a), s.length && s[0] === "" && s.shift(), s.length && s[s.length - 1] === "" && s.pop(),
|
|
2560
|
+
if (p || (a = oe(u, r).trim(), !a) || u.sCount[r] - u.blkIndent >= 4 || (s = ct(a), s.length && s[0] === "" && s.shift(), s.length && s[s.length - 1] === "" && s.pop(), y += f - s.length, y > Tr))
|
|
2561
2561
|
break;
|
|
2562
2562
|
if (r === e + 2) {
|
|
2563
2563
|
const h = u.push("tbody_open", "tbody", 1);
|
|
2564
|
-
h.map =
|
|
2564
|
+
h.map = E = [e + 2, 0];
|
|
2565
2565
|
}
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2566
|
+
const g = u.push("tr_open", "tr", 1);
|
|
2567
|
+
g.map = [r, r + 1];
|
|
2568
2568
|
for (let h = 0; h < f; h++) {
|
|
2569
|
-
const
|
|
2570
|
-
l[h] && (
|
|
2571
|
-
const
|
|
2572
|
-
|
|
2569
|
+
const x = u.push("td_open", "td", 1);
|
|
2570
|
+
l[h] && (x.attrs = [["style", "text-align:" + l[h]]]);
|
|
2571
|
+
const D = u.push("inline", "", 0);
|
|
2572
|
+
D.content = s[h] ? s[h].trim() : "", D.children = [], u.push("td_close", "td", -1);
|
|
2573
2573
|
}
|
|
2574
2574
|
u.push("tr_close", "tr", -1);
|
|
2575
2575
|
}
|
|
2576
|
-
return
|
|
2576
|
+
return E && (u.push("tbody_close", "tbody", -1), E[1] = r), u.push("table_close", "table", -1), v[1] = r, u.parentType = m, u.line = r, !0;
|
|
2577
2577
|
}
|
|
2578
2578
|
function Nr(u, e, t) {
|
|
2579
2579
|
if (u.sCount[e] - u.blkIndent < 4)
|
|
@@ -2633,29 +2633,29 @@ function Or(u, e, t, n) {
|
|
|
2633
2633
|
u.parentType = "blockquote";
|
|
2634
2634
|
let b = !1, d;
|
|
2635
2635
|
for (d = e; d < t; d++) {
|
|
2636
|
-
const
|
|
2636
|
+
const y = u.sCount[d] < u.blkIndent;
|
|
2637
2637
|
if (r = u.bMarks[d] + u.tShift[d], o = u.eMarks[d], r >= o)
|
|
2638
2638
|
break;
|
|
2639
|
-
if (u.src.charCodeAt(r++) === 62 && !
|
|
2640
|
-
let
|
|
2641
|
-
u.src.charCodeAt(r) === 32 ? (r++,
|
|
2642
|
-
let
|
|
2639
|
+
if (u.src.charCodeAt(r++) === 62 && !y) {
|
|
2640
|
+
let g = u.sCount[d] + 1, h, x;
|
|
2641
|
+
u.src.charCodeAt(r) === 32 ? (r++, g++, x = !1, h = !0) : u.src.charCodeAt(r) === 9 ? (h = !0, (u.bsCount[d] + g) % 4 === 3 ? (r++, g++, x = !1) : x = !0) : h = !1;
|
|
2642
|
+
let D = g;
|
|
2643
2643
|
for (i.push(u.bMarks[d]), u.bMarks[d] = r; r < o; ) {
|
|
2644
|
-
const
|
|
2645
|
-
if (B(
|
|
2646
|
-
|
|
2644
|
+
const T = u.src.charCodeAt(r);
|
|
2645
|
+
if (B(T))
|
|
2646
|
+
T === 9 ? D += 4 - (D + u.bsCount[d] + (x ? 1 : 0)) % 4 : D++;
|
|
2647
2647
|
else
|
|
2648
2648
|
break;
|
|
2649
2649
|
r++;
|
|
2650
2650
|
}
|
|
2651
|
-
b = r >= o, a.push(u.bsCount[d]), u.bsCount[d] = u.sCount[d] + 1 + (h ? 1 : 0), s.push(u.sCount[d]), u.sCount[d] =
|
|
2651
|
+
b = r >= o, a.push(u.bsCount[d]), u.bsCount[d] = u.sCount[d] + 1 + (h ? 1 : 0), s.push(u.sCount[d]), u.sCount[d] = D - g, l.push(u.tShift[d]), u.tShift[d] = r - u.bMarks[d];
|
|
2652
2652
|
continue;
|
|
2653
2653
|
}
|
|
2654
2654
|
if (b)
|
|
2655
2655
|
break;
|
|
2656
2656
|
let p = !1;
|
|
2657
|
-
for (let
|
|
2658
|
-
if (f[
|
|
2657
|
+
for (let g = 0, h = f.length; g < h; g++)
|
|
2658
|
+
if (f[g](u, d, t, !0)) {
|
|
2659
2659
|
p = !0;
|
|
2660
2660
|
break;
|
|
2661
2661
|
}
|
|
@@ -2671,10 +2671,10 @@ function Or(u, e, t, n) {
|
|
|
2671
2671
|
k.markup = ">";
|
|
2672
2672
|
const F = [e, 0];
|
|
2673
2673
|
k.map = F, u.md.block.tokenize(u, e, d);
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2676
|
-
for (let
|
|
2677
|
-
u.bMarks[
|
|
2674
|
+
const E = u.push("blockquote_close", "blockquote", -1);
|
|
2675
|
+
E.markup = ">", u.lineMax = c, u.parentType = m, F[1] = u.line;
|
|
2676
|
+
for (let y = 0; y < l.length; y++)
|
|
2677
|
+
u.bMarks[y + e] = i[y], u.tShift[y + e] = l[y], u.sCount[y + e] = s[y], u.bsCount[y + e] = a[y];
|
|
2678
2678
|
return u.blkIndent = v, !0;
|
|
2679
2679
|
}
|
|
2680
2680
|
function Br(u, e, t, n) {
|
|
@@ -2762,34 +2762,34 @@ function Mr(u, e, t, n) {
|
|
|
2762
2762
|
const k = [a, 0];
|
|
2763
2763
|
i.map = k, i.markup = String.fromCharCode(d);
|
|
2764
2764
|
let F = !1;
|
|
2765
|
-
const
|
|
2765
|
+
const E = u.md.block.ruler.getRules("list"), y = u.parentType;
|
|
2766
2766
|
for (u.parentType = "list"; a < t; ) {
|
|
2767
2767
|
o = b, r = u.eMarks[a];
|
|
2768
2768
|
const p = u.sCount[a] + b - (u.bMarks[a] + u.tShift[a]);
|
|
2769
|
-
let
|
|
2769
|
+
let g = p;
|
|
2770
2770
|
for (; o < r; ) {
|
|
2771
2771
|
const M = u.src.charCodeAt(o);
|
|
2772
2772
|
if (M === 9)
|
|
2773
|
-
|
|
2773
|
+
g += 4 - (g + u.bsCount[a]) % 4;
|
|
2774
2774
|
else if (M === 32)
|
|
2775
|
-
|
|
2775
|
+
g++;
|
|
2776
2776
|
else
|
|
2777
2777
|
break;
|
|
2778
2778
|
o++;
|
|
2779
2779
|
}
|
|
2780
2780
|
const h = o;
|
|
2781
|
-
let
|
|
2782
|
-
h >= r ?
|
|
2783
|
-
const
|
|
2781
|
+
let x;
|
|
2782
|
+
h >= r ? x = 1 : x = g - p, x > 4 && (x = 1);
|
|
2783
|
+
const D = p + x;
|
|
2784
2784
|
i = u.push("list_item_open", "li", 1), i.markup = String.fromCharCode(d);
|
|
2785
|
-
const
|
|
2786
|
-
i.map =
|
|
2787
|
-
const
|
|
2788
|
-
if (u.listIndent = u.blkIndent, u.blkIndent =
|
|
2785
|
+
const T = [a, 0];
|
|
2786
|
+
i.map = T, f && (i.info = u.src.slice(c, b - 1));
|
|
2787
|
+
const I = u.tight, j = u.tShift[a], L = u.sCount[a], R = u.listIndent;
|
|
2788
|
+
if (u.listIndent = u.blkIndent, u.blkIndent = D, u.tight = !0, u.tShift[a] = h - u.bMarks[a], u.sCount[a] = g, h >= r && u.isEmpty(a + 1) ? u.line = Math.min(u.line + 2, t) : u.md.block.tokenize(u, a, t, !0), (!u.tight || F) && (s = !1), F = u.line - a > 1 && u.isEmpty(u.line - 1), u.blkIndent = u.listIndent, u.listIndent = R, u.tShift[a] = j, u.sCount[a] = L, u.tight = I, i = u.push("list_item_close", "li", -1), i.markup = String.fromCharCode(d), a = u.line, T[1] = a, a >= t || u.sCount[a] < u.blkIndent || u.sCount[a] - u.blkIndent >= 4)
|
|
2789
2789
|
break;
|
|
2790
2790
|
let Q = !1;
|
|
2791
|
-
for (let M = 0, uu =
|
|
2792
|
-
if (
|
|
2791
|
+
for (let M = 0, uu = E.length; M < uu; M++)
|
|
2792
|
+
if (E[M](u, a, t, !0)) {
|
|
2793
2793
|
Q = !0;
|
|
2794
2794
|
break;
|
|
2795
2795
|
}
|
|
@@ -2804,58 +2804,58 @@ function Mr(u, e, t, n) {
|
|
|
2804
2804
|
if (d !== u.src.charCodeAt(b - 1))
|
|
2805
2805
|
break;
|
|
2806
2806
|
}
|
|
2807
|
-
return f ? i = u.push("ordered_list_close", "ol", -1) : i = u.push("bullet_list_close", "ul", -1), i.markup = String.fromCharCode(d), k[1] = a, u.line = a, u.parentType =
|
|
2807
|
+
return f ? i = u.push("ordered_list_close", "ol", -1) : i = u.push("bullet_list_close", "ul", -1), i.markup = String.fromCharCode(d), k[1] = a, u.line = a, u.parentType = y, s && Pr(u, v), !0;
|
|
2808
2808
|
}
|
|
2809
2809
|
function jr(u, e, t, n) {
|
|
2810
2810
|
let r = u.bMarks[e] + u.tShift[e], o = u.eMarks[e], c = e + 1;
|
|
2811
2811
|
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(r) !== 91)
|
|
2812
2812
|
return !1;
|
|
2813
|
-
function i(
|
|
2814
|
-
const
|
|
2815
|
-
if (
|
|
2813
|
+
function i(E) {
|
|
2814
|
+
const y = u.lineMax;
|
|
2815
|
+
if (E >= y || u.isEmpty(E))
|
|
2816
2816
|
return null;
|
|
2817
2817
|
let p = !1;
|
|
2818
|
-
if (u.sCount[
|
|
2819
|
-
const
|
|
2818
|
+
if (u.sCount[E] - u.blkIndent > 3 && (p = !0), u.sCount[E] < 0 && (p = !0), !p) {
|
|
2819
|
+
const x = u.md.block.ruler.getRules("reference"), D = u.parentType;
|
|
2820
2820
|
u.parentType = "reference";
|
|
2821
|
-
let
|
|
2822
|
-
for (let
|
|
2823
|
-
if (
|
|
2824
|
-
|
|
2821
|
+
let T = !1;
|
|
2822
|
+
for (let I = 0, j = x.length; I < j; I++)
|
|
2823
|
+
if (x[I](u, E, y, !0)) {
|
|
2824
|
+
T = !0;
|
|
2825
2825
|
break;
|
|
2826
2826
|
}
|
|
2827
|
-
if (u.parentType =
|
|
2827
|
+
if (u.parentType = D, T)
|
|
2828
2828
|
return null;
|
|
2829
2829
|
}
|
|
2830
|
-
const
|
|
2831
|
-
return u.src.slice(
|
|
2830
|
+
const g = u.bMarks[E] + u.tShift[E], h = u.eMarks[E];
|
|
2831
|
+
return u.src.slice(g, h + 1);
|
|
2832
2832
|
}
|
|
2833
2833
|
let a = u.src.slice(r, o + 1);
|
|
2834
2834
|
o = a.length;
|
|
2835
2835
|
let s = -1;
|
|
2836
2836
|
for (r = 1; r < o; r++) {
|
|
2837
|
-
const
|
|
2838
|
-
if (
|
|
2837
|
+
const E = a.charCodeAt(r);
|
|
2838
|
+
if (E === 91)
|
|
2839
2839
|
return !1;
|
|
2840
|
-
if (
|
|
2840
|
+
if (E === 93) {
|
|
2841
2841
|
s = r;
|
|
2842
2842
|
break;
|
|
2843
|
-
} else if (
|
|
2844
|
-
const
|
|
2845
|
-
|
|
2846
|
-
} else if (
|
|
2847
|
-
const
|
|
2848
|
-
|
|
2843
|
+
} else if (E === 10) {
|
|
2844
|
+
const y = i(c);
|
|
2845
|
+
y !== null && (a += y, o = a.length, c++);
|
|
2846
|
+
} else if (E === 92 && (r++, r < o && a.charCodeAt(r) === 10)) {
|
|
2847
|
+
const y = i(c);
|
|
2848
|
+
y !== null && (a += y, o = a.length, c++);
|
|
2849
2849
|
}
|
|
2850
2850
|
}
|
|
2851
2851
|
if (s < 0 || a.charCodeAt(s + 1) !== 58)
|
|
2852
2852
|
return !1;
|
|
2853
2853
|
for (r = s + 2; r < o; r++) {
|
|
2854
|
-
const
|
|
2855
|
-
if (
|
|
2856
|
-
const
|
|
2857
|
-
|
|
2858
|
-
} else if (!B(
|
|
2854
|
+
const E = a.charCodeAt(r);
|
|
2855
|
+
if (E === 10) {
|
|
2856
|
+
const y = i(c);
|
|
2857
|
+
y !== null && (a += y, o = a.length, c++);
|
|
2858
|
+
} else if (!B(E)) break;
|
|
2859
2859
|
}
|
|
2860
2860
|
const l = u.md.helpers.parseLinkDestination(a, r, o);
|
|
2861
2861
|
if (!l.ok)
|
|
@@ -2866,29 +2866,29 @@ function jr(u, e, t, n) {
|
|
|
2866
2866
|
r = l.pos;
|
|
2867
2867
|
const m = r, b = c, d = r;
|
|
2868
2868
|
for (; r < o; r++) {
|
|
2869
|
-
const
|
|
2870
|
-
if (
|
|
2871
|
-
const
|
|
2872
|
-
|
|
2873
|
-
} else if (!B(
|
|
2869
|
+
const E = a.charCodeAt(r);
|
|
2870
|
+
if (E === 10) {
|
|
2871
|
+
const y = i(c);
|
|
2872
|
+
y !== null && (a += y, o = a.length, c++);
|
|
2873
|
+
} else if (!B(E)) break;
|
|
2874
2874
|
}
|
|
2875
2875
|
let v = u.md.helpers.parseLinkTitle(a, r, o);
|
|
2876
2876
|
for (; v.can_continue; ) {
|
|
2877
|
-
const
|
|
2878
|
-
if (
|
|
2879
|
-
a +=
|
|
2877
|
+
const E = i(c);
|
|
2878
|
+
if (E === null) break;
|
|
2879
|
+
a += E, r = o, o = a.length, c++, v = u.md.helpers.parseLinkTitle(a, r, o, v);
|
|
2880
2880
|
}
|
|
2881
2881
|
let k;
|
|
2882
2882
|
for (r < o && d !== r && v.ok ? (k = v.str, r = v.pos) : (k = "", r = m, c = b); r < o; ) {
|
|
2883
|
-
const
|
|
2884
|
-
if (!B(
|
|
2883
|
+
const E = a.charCodeAt(r);
|
|
2884
|
+
if (!B(E))
|
|
2885
2885
|
break;
|
|
2886
2886
|
r++;
|
|
2887
2887
|
}
|
|
2888
2888
|
if (r < o && a.charCodeAt(r) !== 10 && k)
|
|
2889
2889
|
for (k = "", r = m, c = b; r < o; ) {
|
|
2890
|
-
const
|
|
2891
|
-
if (!B(
|
|
2890
|
+
const E = a.charCodeAt(r);
|
|
2891
|
+
if (!B(E))
|
|
2892
2892
|
break;
|
|
2893
2893
|
r++;
|
|
2894
2894
|
}
|
|
@@ -4269,8 +4269,8 @@ var cc = { 207: (u, e, t) => {
|
|
|
4269
4269
|
}, 452: (u) => {
|
|
4270
4270
|
var e = (function(t) {
|
|
4271
4271
|
var n, r = Object.prototype, o = r.hasOwnProperty, c = typeof Symbol == "function" ? Symbol : {}, i = c.iterator || "@@iterator", a = c.asyncIterator || "@@asyncIterator", s = c.toStringTag || "@@toStringTag";
|
|
4272
|
-
function l(
|
|
4273
|
-
return Object.defineProperty(
|
|
4272
|
+
function l(C, _, S) {
|
|
4273
|
+
return Object.defineProperty(C, _, { value: S, enumerable: !0, configurable: !0, writable: !0 }), C[_];
|
|
4274
4274
|
}
|
|
4275
4275
|
try {
|
|
4276
4276
|
l({}, "");
|
|
@@ -4279,8 +4279,8 @@ var cc = { 207: (u, e, t) => {
|
|
|
4279
4279
|
return _[S] = N;
|
|
4280
4280
|
};
|
|
4281
4281
|
}
|
|
4282
|
-
function f(
|
|
4283
|
-
var w = _ && _.prototype instanceof
|
|
4282
|
+
function f(C, _, S, N) {
|
|
4283
|
+
var w = _ && _.prototype instanceof E ? _ : E, $ = Object.create(w.prototype), H = new Q(N || []);
|
|
4284
4284
|
return $._invoke = /* @__PURE__ */ (function(K, cu, O) {
|
|
4285
4285
|
var Z = b;
|
|
4286
4286
|
return function(eu, Le) {
|
|
@@ -4312,40 +4312,40 @@ var cc = { 207: (u, e, t) => {
|
|
|
4312
4312
|
Du.type === "throw" && (Z = k, O.method = "throw", O.arg = Du.arg);
|
|
4313
4313
|
}
|
|
4314
4314
|
};
|
|
4315
|
-
})(
|
|
4315
|
+
})(C, S, H), $;
|
|
4316
4316
|
}
|
|
4317
|
-
function m(
|
|
4317
|
+
function m(C, _, S) {
|
|
4318
4318
|
try {
|
|
4319
|
-
return { type: "normal", arg:
|
|
4319
|
+
return { type: "normal", arg: C.call(_, S) };
|
|
4320
4320
|
} catch (N) {
|
|
4321
4321
|
return { type: "throw", arg: N };
|
|
4322
4322
|
}
|
|
4323
4323
|
}
|
|
4324
4324
|
t.wrap = f;
|
|
4325
4325
|
var b = "suspendedStart", d = "suspendedYield", v = "executing", k = "completed", F = {};
|
|
4326
|
-
function
|
|
4326
|
+
function E() {
|
|
4327
4327
|
}
|
|
4328
|
-
function
|
|
4328
|
+
function y() {
|
|
4329
4329
|
}
|
|
4330
4330
|
function p() {
|
|
4331
4331
|
}
|
|
4332
|
-
var
|
|
4333
|
-
l(
|
|
4332
|
+
var g = {};
|
|
4333
|
+
l(g, i, (function() {
|
|
4334
4334
|
return this;
|
|
4335
4335
|
}));
|
|
4336
|
-
var h = Object.getPrototypeOf,
|
|
4337
|
-
|
|
4338
|
-
var
|
|
4339
|
-
function
|
|
4336
|
+
var h = Object.getPrototypeOf, x = h && h(h(M([])));
|
|
4337
|
+
x && x !== r && o.call(x, i) && (g = x);
|
|
4338
|
+
var D = p.prototype = E.prototype = Object.create(g);
|
|
4339
|
+
function T(C) {
|
|
4340
4340
|
["next", "throw", "return"].forEach((function(_) {
|
|
4341
|
-
l(
|
|
4341
|
+
l(C, _, (function(S) {
|
|
4342
4342
|
return this._invoke(_, S);
|
|
4343
4343
|
}));
|
|
4344
4344
|
}));
|
|
4345
4345
|
}
|
|
4346
|
-
function
|
|
4346
|
+
function I(C, _) {
|
|
4347
4347
|
function S(w, $, H, K) {
|
|
4348
|
-
var cu = m(
|
|
4348
|
+
var cu = m(C[w], C, $);
|
|
4349
4349
|
if (cu.type !== "throw") {
|
|
4350
4350
|
var O = cu.arg, Z = O.value;
|
|
4351
4351
|
return Z && typeof Z == "object" && o.call(Z, "__await") ? _.resolve(Z.__await).then((function(eu) {
|
|
@@ -4370,39 +4370,39 @@ var cc = { 207: (u, e, t) => {
|
|
|
4370
4370
|
return N = N ? N.then(H, H) : H();
|
|
4371
4371
|
};
|
|
4372
4372
|
}
|
|
4373
|
-
function j(
|
|
4374
|
-
var S =
|
|
4373
|
+
function j(C, _) {
|
|
4374
|
+
var S = C.iterator[_.method];
|
|
4375
4375
|
if (S === n) {
|
|
4376
4376
|
if (_.delegate = null, _.method === "throw") {
|
|
4377
|
-
if (
|
|
4377
|
+
if (C.iterator.return && (_.method = "return", _.arg = n, j(C, _), _.method === "throw")) return F;
|
|
4378
4378
|
_.method = "throw", _.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
4379
4379
|
}
|
|
4380
4380
|
return F;
|
|
4381
4381
|
}
|
|
4382
|
-
var N = m(S,
|
|
4382
|
+
var N = m(S, C.iterator, _.arg);
|
|
4383
4383
|
if (N.type === "throw") return _.method = "throw", _.arg = N.arg, _.delegate = null, F;
|
|
4384
4384
|
var w = N.arg;
|
|
4385
|
-
return w ? w.done ? (_[
|
|
4385
|
+
return w ? w.done ? (_[C.resultName] = w.value, _.next = C.nextLoc, _.method !== "return" && (_.method = "next", _.arg = n), _.delegate = null, F) : w : (_.method = "throw", _.arg = new TypeError("iterator result is not an object"), _.delegate = null, F);
|
|
4386
4386
|
}
|
|
4387
|
-
function L(
|
|
4388
|
-
var _ = { tryLoc:
|
|
4389
|
-
1 in
|
|
4387
|
+
function L(C) {
|
|
4388
|
+
var _ = { tryLoc: C[0] };
|
|
4389
|
+
1 in C && (_.catchLoc = C[1]), 2 in C && (_.finallyLoc = C[2], _.afterLoc = C[3]), this.tryEntries.push(_);
|
|
4390
4390
|
}
|
|
4391
|
-
function R(
|
|
4392
|
-
var _ =
|
|
4393
|
-
_.type = "normal", delete _.arg,
|
|
4391
|
+
function R(C) {
|
|
4392
|
+
var _ = C.completion || {};
|
|
4393
|
+
_.type = "normal", delete _.arg, C.completion = _;
|
|
4394
4394
|
}
|
|
4395
|
-
function Q(
|
|
4396
|
-
this.tryEntries = [{ tryLoc: "root" }],
|
|
4395
|
+
function Q(C) {
|
|
4396
|
+
this.tryEntries = [{ tryLoc: "root" }], C.forEach(L, this), this.reset(!0);
|
|
4397
4397
|
}
|
|
4398
|
-
function M(
|
|
4399
|
-
if (
|
|
4400
|
-
var _ =
|
|
4401
|
-
if (_) return _.call(
|
|
4402
|
-
if (typeof
|
|
4403
|
-
if (!isNaN(
|
|
4398
|
+
function M(C) {
|
|
4399
|
+
if (C) {
|
|
4400
|
+
var _ = C[i];
|
|
4401
|
+
if (_) return _.call(C);
|
|
4402
|
+
if (typeof C.next == "function") return C;
|
|
4403
|
+
if (!isNaN(C.length)) {
|
|
4404
4404
|
var S = -1, N = function w() {
|
|
4405
|
-
for (; ++S <
|
|
4405
|
+
for (; ++S < C.length; ) if (o.call(C, S)) return w.value = C[S], w.done = !1, w;
|
|
4406
4406
|
return w.value = n, w.done = !0, w;
|
|
4407
4407
|
};
|
|
4408
4408
|
return N.next = N;
|
|
@@ -4413,47 +4413,47 @@ var cc = { 207: (u, e, t) => {
|
|
|
4413
4413
|
function uu() {
|
|
4414
4414
|
return { value: n, done: !0 };
|
|
4415
4415
|
}
|
|
4416
|
-
return
|
|
4417
|
-
var _ = typeof
|
|
4418
|
-
return !!_ && (_ ===
|
|
4419
|
-
}, t.mark = function(
|
|
4420
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
4421
|
-
}, t.awrap = function(
|
|
4422
|
-
return { __await:
|
|
4423
|
-
}, I
|
|
4416
|
+
return y.prototype = p, l(D, "constructor", p), l(p, "constructor", y), y.displayName = l(p, s, "GeneratorFunction"), t.isGeneratorFunction = function(C) {
|
|
4417
|
+
var _ = typeof C == "function" && C.constructor;
|
|
4418
|
+
return !!_ && (_ === y || (_.displayName || _.name) === "GeneratorFunction");
|
|
4419
|
+
}, t.mark = function(C) {
|
|
4420
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(C, p) : (C.__proto__ = p, l(C, s, "GeneratorFunction")), C.prototype = Object.create(D), C;
|
|
4421
|
+
}, t.awrap = function(C) {
|
|
4422
|
+
return { __await: C };
|
|
4423
|
+
}, T(I.prototype), l(I.prototype, a, (function() {
|
|
4424
4424
|
return this;
|
|
4425
|
-
})), t.AsyncIterator =
|
|
4425
|
+
})), t.AsyncIterator = I, t.async = function(C, _, S, N, w) {
|
|
4426
4426
|
w === void 0 && (w = Promise);
|
|
4427
|
-
var $ = new
|
|
4427
|
+
var $ = new I(f(C, _, S, N), w);
|
|
4428
4428
|
return t.isGeneratorFunction(_) ? $ : $.next().then((function(H) {
|
|
4429
4429
|
return H.done ? H.value : $.next();
|
|
4430
4430
|
}));
|
|
4431
|
-
},
|
|
4431
|
+
}, T(D), l(D, s, "Generator"), l(D, i, (function() {
|
|
4432
4432
|
return this;
|
|
4433
|
-
})), l(
|
|
4433
|
+
})), l(D, "toString", (function() {
|
|
4434
4434
|
return "[object Generator]";
|
|
4435
|
-
})), t.keys = function(
|
|
4435
|
+
})), t.keys = function(C) {
|
|
4436
4436
|
var _ = [];
|
|
4437
|
-
for (var S in
|
|
4437
|
+
for (var S in C) _.push(S);
|
|
4438
4438
|
return _.reverse(), function N() {
|
|
4439
4439
|
for (; _.length; ) {
|
|
4440
4440
|
var w = _.pop();
|
|
4441
|
-
if (w in
|
|
4441
|
+
if (w in C) return N.value = w, N.done = !1, N;
|
|
4442
4442
|
}
|
|
4443
4443
|
return N.done = !0, N;
|
|
4444
4444
|
};
|
|
4445
|
-
}, t.values = M, Q.prototype = { constructor: Q, reset: function(
|
|
4446
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = n, this.done = !1, this.delegate = null, this.method = "next", this.arg = n, this.tryEntries.forEach(R), !
|
|
4445
|
+
}, t.values = M, Q.prototype = { constructor: Q, reset: function(C) {
|
|
4446
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = n, this.done = !1, this.delegate = null, this.method = "next", this.arg = n, this.tryEntries.forEach(R), !C) for (var _ in this) _.charAt(0) === "t" && o.call(this, _) && !isNaN(+_.slice(1)) && (this[_] = n);
|
|
4447
4447
|
}, stop: function() {
|
|
4448
4448
|
this.done = !0;
|
|
4449
|
-
var
|
|
4450
|
-
if (
|
|
4449
|
+
var C = this.tryEntries[0].completion;
|
|
4450
|
+
if (C.type === "throw") throw C.arg;
|
|
4451
4451
|
return this.rval;
|
|
4452
|
-
}, dispatchException: function(
|
|
4453
|
-
if (this.done) throw
|
|
4452
|
+
}, dispatchException: function(C) {
|
|
4453
|
+
if (this.done) throw C;
|
|
4454
4454
|
var _ = this;
|
|
4455
4455
|
function S(cu, O) {
|
|
4456
|
-
return $.type = "throw", $.arg =
|
|
4456
|
+
return $.type = "throw", $.arg = C, _.next = cu, O && (_.method = "next", _.arg = n), !!O;
|
|
4457
4457
|
}
|
|
4458
4458
|
for (var N = this.tryEntries.length - 1; N >= 0; --N) {
|
|
4459
4459
|
var w = this.tryEntries[N], $ = w.completion;
|
|
@@ -4471,7 +4471,7 @@ var cc = { 207: (u, e, t) => {
|
|
|
4471
4471
|
}
|
|
4472
4472
|
}
|
|
4473
4473
|
}
|
|
4474
|
-
}, abrupt: function(
|
|
4474
|
+
}, abrupt: function(C, _) {
|
|
4475
4475
|
for (var S = this.tryEntries.length - 1; S >= 0; --S) {
|
|
4476
4476
|
var N = this.tryEntries[S];
|
|
4477
4477
|
if (N.tryLoc <= this.prev && o.call(N, "finallyLoc") && this.prev < N.finallyLoc) {
|
|
@@ -4479,21 +4479,21 @@ var cc = { 207: (u, e, t) => {
|
|
|
4479
4479
|
break;
|
|
4480
4480
|
}
|
|
4481
4481
|
}
|
|
4482
|
-
w && (
|
|
4482
|
+
w && (C === "break" || C === "continue") && w.tryLoc <= _ && _ <= w.finallyLoc && (w = null);
|
|
4483
4483
|
var $ = w ? w.completion : {};
|
|
4484
|
-
return $.type =
|
|
4485
|
-
}, complete: function(
|
|
4486
|
-
if (
|
|
4487
|
-
return
|
|
4488
|
-
}, finish: function(
|
|
4484
|
+
return $.type = C, $.arg = _, w ? (this.method = "next", this.next = w.finallyLoc, F) : this.complete($);
|
|
4485
|
+
}, complete: function(C, _) {
|
|
4486
|
+
if (C.type === "throw") throw C.arg;
|
|
4487
|
+
return C.type === "break" || C.type === "continue" ? this.next = C.arg : C.type === "return" ? (this.rval = this.arg = C.arg, this.method = "return", this.next = "end") : C.type === "normal" && _ && (this.next = _), F;
|
|
4488
|
+
}, finish: function(C) {
|
|
4489
4489
|
for (var _ = this.tryEntries.length - 1; _ >= 0; --_) {
|
|
4490
4490
|
var S = this.tryEntries[_];
|
|
4491
|
-
if (S.finallyLoc ===
|
|
4491
|
+
if (S.finallyLoc === C) return this.complete(S.completion, S.afterLoc), R(S), F;
|
|
4492
4492
|
}
|
|
4493
|
-
}, catch: function(
|
|
4493
|
+
}, catch: function(C) {
|
|
4494
4494
|
for (var _ = this.tryEntries.length - 1; _ >= 0; --_) {
|
|
4495
4495
|
var S = this.tryEntries[_];
|
|
4496
|
-
if (S.tryLoc ===
|
|
4496
|
+
if (S.tryLoc === C) {
|
|
4497
4497
|
var N = S.completion;
|
|
4498
4498
|
if (N.type === "throw") {
|
|
4499
4499
|
var w = N.arg;
|
|
@@ -4503,8 +4503,8 @@ var cc = { 207: (u, e, t) => {
|
|
|
4503
4503
|
}
|
|
4504
4504
|
}
|
|
4505
4505
|
throw new Error("illegal catch attempt");
|
|
4506
|
-
}, delegateYield: function(
|
|
4507
|
-
return this.delegate = { iterator: M(
|
|
4506
|
+
}, delegateYield: function(C, _, S) {
|
|
4507
|
+
return this.delegate = { iterator: M(C), resultName: _, nextLoc: S }, this.method === "next" && (this.arg = n), F;
|
|
4508
4508
|
} }, t;
|
|
4509
4509
|
})(u.exports);
|
|
4510
4510
|
try {
|
|
@@ -4589,14 +4589,14 @@ function s0(u) {
|
|
|
4589
4589
|
function mu(u) {
|
|
4590
4590
|
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "root", t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, n = (arguments.length > 3 ? arguments[3] : void 0) || {}, r = n.key, o = n.index, c = n.type, i = c === void 0 ? "content" : c, a = n.showComma, s = a !== void 0 && a, l = n.length, f = l === void 0 ? 1 : l, m = s0(u);
|
|
4591
4591
|
if (m === "array") {
|
|
4592
|
-
var b = xt(u.map((function(k, F,
|
|
4593
|
-
return mu(k, "".concat(e, "[").concat(F, "]"), t + 1, { index: F, showComma: F !==
|
|
4592
|
+
var b = xt(u.map((function(k, F, E) {
|
|
4593
|
+
return mu(k, "".concat(e, "[").concat(F, "]"), t + 1, { index: F, showComma: F !== E.length - 1, length: f, type: i });
|
|
4594
4594
|
})));
|
|
4595
4595
|
return [mu("[", e, t, { showComma: !1, key: r, length: u.length, type: "arrayStart" })[0]].concat(b, mu("]", e, t, { showComma: s, length: u.length, type: "arrayEnd" })[0]);
|
|
4596
4596
|
}
|
|
4597
4597
|
if (m === "object") {
|
|
4598
|
-
var d = Object.keys(u), v = xt(d.map((function(k, F,
|
|
4599
|
-
return mu(u[k], /^[a-zA-Z_]\w*$/.test(k) ? "".concat(e, ".").concat(k) : "".concat(e, '["').concat(k, '"]'), t + 1, { key: k, showComma: F !==
|
|
4598
|
+
var d = Object.keys(u), v = xt(d.map((function(k, F, E) {
|
|
4599
|
+
return mu(u[k], /^[a-zA-Z_]\w*$/.test(k) ? "".concat(e, ".").concat(k) : "".concat(e, '["').concat(k, '"]'), t + 1, { key: k, showComma: F !== E.length - 1, length: f, type: i });
|
|
4600
4600
|
})));
|
|
4601
4601
|
return [mu("{", e, t, { showComma: !1, key: r, index: o, length: d.length, type: "objectStart" })[0]].concat(v, mu("}", e, t, { showComma: s, length: d.length, type: "objectEnd" })[0]);
|
|
4602
4602
|
}
|
|
@@ -4674,11 +4674,11 @@ const fc = (0, A.defineComponent)({ name: "TreeNode", props: yt(yt({}, l0), {},
|
|
|
4674
4674
|
})), a = (0, A.computed)((function() {
|
|
4675
4675
|
return u.nodeSelectable(u.node) && (c.value || i.value);
|
|
4676
4676
|
})), s = (0, A.reactive)({ editing: !1 }), l = function(h) {
|
|
4677
|
-
var
|
|
4678
|
-
t("valueChange",
|
|
4677
|
+
var x, D, T = (D = (x = h.target) === null || x === void 0 ? void 0 : x.value) === "null" ? null : D === "undefined" ? void 0 : D === "true" || D !== "false" && (D[0] + D[D.length - 1] === '""' || D[0] + D[D.length - 1] === "''" ? D.slice(1, -1) : typeof Number(D) == "number" && !isNaN(Number(D)) || D === "NaN" ? Number(D) : D);
|
|
4678
|
+
t("valueChange", T, u.node.path);
|
|
4679
4679
|
}, f = (0, A.computed)((function() {
|
|
4680
|
-
var h,
|
|
4681
|
-
return
|
|
4680
|
+
var h, x = (h = u.node) === null || h === void 0 ? void 0 : h.content;
|
|
4681
|
+
return x === null ? x = "null" : x === void 0 && (x = "undefined"), n.value === "string" ? '"'.concat(x, '"') : x + "";
|
|
4682
4682
|
})), m = function() {
|
|
4683
4683
|
var h = u.renderNodeValue;
|
|
4684
4684
|
return h ? h({ node: u.node, defaultValue: f.value }) : f.value;
|
|
@@ -4692,18 +4692,18 @@ const fc = (0, A.defineComponent)({ name: "TreeNode", props: yt(yt({}, l0), {},
|
|
|
4692
4692
|
t("nodeClick", u.node), a.value && u.selectOnClickNode && t("selectedChange", u.node);
|
|
4693
4693
|
}, F = function() {
|
|
4694
4694
|
t("nodeMouseover", u.node);
|
|
4695
|
-
},
|
|
4695
|
+
}, E = function(h) {
|
|
4696
4696
|
if (u.editable && !s.editing) {
|
|
4697
4697
|
s.editing = !0;
|
|
4698
|
-
var
|
|
4699
|
-
var
|
|
4700
|
-
|
|
4698
|
+
var x = function D(T) {
|
|
4699
|
+
var I;
|
|
4700
|
+
T.target !== h.target && ((I = T.target) === null || I === void 0 ? void 0 : I.parentElement) !== h.target && (s.editing = !1, document.removeEventListener("click", D));
|
|
4701
4701
|
};
|
|
4702
|
-
document.removeEventListener("click",
|
|
4702
|
+
document.removeEventListener("click", x), document.addEventListener("click", x);
|
|
4703
4703
|
}
|
|
4704
|
-
},
|
|
4705
|
-
var h = (0, A.ref)(!1),
|
|
4706
|
-
var
|
|
4704
|
+
}, y = (function() {
|
|
4705
|
+
var h = (0, A.ref)(!1), x = (function() {
|
|
4706
|
+
var D, T = (D = _t().mark((function I(j) {
|
|
4707
4707
|
return _t().wrap((function(L) {
|
|
4708
4708
|
for (; ; ) switch (L.prev = L.next) {
|
|
4709
4709
|
case 0:
|
|
@@ -4719,41 +4719,41 @@ const fc = (0, A.defineComponent)({ name: "TreeNode", props: yt(yt({}, l0), {},
|
|
|
4719
4719
|
case "end":
|
|
4720
4720
|
return L.stop();
|
|
4721
4721
|
}
|
|
4722
|
-
}),
|
|
4722
|
+
}), I, null, [[0, 7]]);
|
|
4723
4723
|
})), function() {
|
|
4724
|
-
var
|
|
4724
|
+
var I = this, j = arguments;
|
|
4725
4725
|
return new Promise((function(L, R) {
|
|
4726
|
-
var Q =
|
|
4727
|
-
function M(
|
|
4728
|
-
gt(Q, L, R, M, uu, "next",
|
|
4726
|
+
var Q = D.apply(I, j);
|
|
4727
|
+
function M(C) {
|
|
4728
|
+
gt(Q, L, R, M, uu, "next", C);
|
|
4729
4729
|
}
|
|
4730
|
-
function uu(
|
|
4731
|
-
gt(Q, L, R, M, uu, "throw",
|
|
4730
|
+
function uu(C) {
|
|
4731
|
+
gt(Q, L, R, M, uu, "throw", C);
|
|
4732
4732
|
}
|
|
4733
4733
|
M(void 0);
|
|
4734
4734
|
}));
|
|
4735
4735
|
});
|
|
4736
|
-
return function(
|
|
4737
|
-
return
|
|
4736
|
+
return function(I) {
|
|
4737
|
+
return T.apply(this, arguments);
|
|
4738
4738
|
};
|
|
4739
4739
|
})();
|
|
4740
|
-
return { copy:
|
|
4740
|
+
return { copy: x };
|
|
4741
4741
|
})().copy, p = function() {
|
|
4742
|
-
var h = u.node,
|
|
4743
|
-
|
|
4744
|
-
},
|
|
4742
|
+
var h = u.node, x = h.key, D = h.path, T = u.rootPath, I = new Function("data", "return data".concat(D.slice(T.length)))(u.data), j = JSON.stringify(x ? Lu({}, x, I) : I, null, 2);
|
|
4743
|
+
y(j);
|
|
4744
|
+
}, g = function() {
|
|
4745
4745
|
var h = u.renderNodeActions;
|
|
4746
4746
|
if (!h) return null;
|
|
4747
|
-
var
|
|
4748
|
-
return typeof h == "function" ? h({ node: u.node, defaultActions:
|
|
4747
|
+
var x = { copy: p };
|
|
4748
|
+
return typeof h == "function" ? h({ node: u.node, defaultActions: x }) : (0, A.createVNode)("span", { onClick: p, class: "vjs-tree-node-actions-item" }, [(0, A.createTextVNode)("copy")]);
|
|
4749
4749
|
};
|
|
4750
4750
|
return function() {
|
|
4751
|
-
var h,
|
|
4752
|
-
return (0, A.createVNode)("div", { class: { "vjs-tree-node": !0, "has-selector": u.showSelectController, "has-carets": u.showIcon, "is-highlight": u.highlightSelectedNode && u.checked, dark: u.theme === "dark" }, onClick: k, onMouseover: F, style: u.style }, [u.showLineNumber && (0, A.createVNode)("span", { class: "vjs-node-index" }, [
|
|
4753
|
-
return (0, A.createVNode)("div", { key:
|
|
4751
|
+
var h, x = u.node;
|
|
4752
|
+
return (0, A.createVNode)("div", { class: { "vjs-tree-node": !0, "has-selector": u.showSelectController, "has-carets": u.showIcon, "is-highlight": u.highlightSelectedNode && u.checked, dark: u.theme === "dark" }, onClick: k, onMouseover: F, style: u.style }, [u.showLineNumber && (0, A.createVNode)("span", { class: "vjs-node-index" }, [x.id + 1]), u.showSelectController && a.value && x.type !== "objectEnd" && x.type !== "arrayEnd" && (0, A.createVNode)(ac, { isMultiple: c.value, checked: u.checked, onChange: v }, null), (0, A.createVNode)("div", { class: "vjs-indent" }, [Array.from(Array(x.level)).map((function(D, T) {
|
|
4753
|
+
return (0, A.createVNode)("div", { key: T, class: { "vjs-indent-unit": !0, "has-line": u.showLine } }, [Array.from(Array(u.indent)).map((function() {
|
|
4754
4754
|
return (0, A.createVNode)(A.Fragment, null, [(0, A.createTextVNode)(" ")]);
|
|
4755
4755
|
}))]);
|
|
4756
|
-
})), u.showIcon && (0, A.createVNode)(sc, { nodeType:
|
|
4756
|
+
})), u.showIcon && (0, A.createVNode)(sc, { nodeType: x.type, onClick: d }, null)]), x.key && (0, A.createVNode)("span", { class: "vjs-key" }, [(h = u.renderNodeKey, h ? h({ node: u.node, defaultKey: o.value || "" }) : o.value), (0, A.createVNode)("span", { class: "vjs-colon" }, [":".concat(u.showKeyValueSpace ? " " : "")])]), (0, A.createVNode)("span", null, [x.type !== "content" && x.content ? (0, A.createVNode)(ic, { data: x.content.toString(), onClick: b }, null) : (0, A.createVNode)("span", { class: r.value, onClick: !u.editable || u.editableTrigger && u.editableTrigger !== "click" ? void 0 : E, onDblclick: u.editable && u.editableTrigger === "dblclick" ? E : void 0 }, [u.editable && s.editing ? (0, A.createVNode)("input", { value: f.value, onChange: l, style: { padding: "3px 8px", border: "1px solid #eee", boxShadow: "none", boxSizing: "border-box", borderRadius: 5, fontFamily: "inherit" } }, null) : m()]), x.showComma && (0, A.createVNode)("span", null, [","]), u.showLength && u.collapsed && (0, A.createVNode)("span", { class: "vjs-comment" }, [(0, A.createTextVNode)(" // "), x.length, (0, A.createTextVNode)(" items ")])]), u.renderNodeActions && (0, A.createVNode)("span", { class: "vjs-tree-node-actions" }, [g()])]);
|
|
4757
4757
|
};
|
|
4758
4758
|
} });
|
|
4759
4759
|
function Ct(u, e) {
|
|
@@ -4784,27 +4784,27 @@ const dc = (0, A.defineComponent)({ name: "Tree", props: G(G({}, l0), {}, { coll
|
|
|
4784
4784
|
} }, collapsedOnClickBrackets: { type: Boolean, default: !0 }, style: Object, onSelectedChange: { type: Function }, theme: { type: String, default: "light" } }), slots: ["renderNodeKey", "renderNodeValue", "renderNodeActions"], emits: ["nodeClick", "nodeMouseover", "bracketsClick", "iconClick", "selectedChange", "update:selectedValue", "update:data"], setup: function(u, e) {
|
|
4785
4785
|
var t = e.emit, n = e.slots, r = (0, A.ref)(), o = (0, A.computed)((function() {
|
|
4786
4786
|
return mu(u.data, u.rootPath);
|
|
4787
|
-
})), c = function(p,
|
|
4788
|
-
return o.value.reduce((function(h,
|
|
4789
|
-
var
|
|
4790
|
-
return
|
|
4787
|
+
})), c = function(p, g) {
|
|
4788
|
+
return o.value.reduce((function(h, x) {
|
|
4789
|
+
var D, T = x.level >= p || x.length >= g, I = (D = u.pathCollapsible) === null || D === void 0 ? void 0 : D.call(u, x);
|
|
4790
|
+
return x.type !== "objectStart" && x.type !== "arrayStart" || !T && !I ? h : G(G({}, h), {}, Lu({}, x.path, 1));
|
|
4791
4791
|
}), {});
|
|
4792
4792
|
}, i = (0, A.reactive)({ translateY: 0, visibleData: null, hiddenPaths: c(u.deep, u.collapsedNodeLength) }), a = (0, A.computed)((function() {
|
|
4793
|
-
for (var p = null,
|
|
4794
|
-
var
|
|
4795
|
-
if (p && p.path ===
|
|
4796
|
-
var
|
|
4797
|
-
p = null,
|
|
4793
|
+
for (var p = null, g = [], h = o.value.length, x = 0; x < h; x++) {
|
|
4794
|
+
var D = G(G({}, o.value[x]), {}, { id: x }), T = i.hiddenPaths[D.path];
|
|
4795
|
+
if (p && p.path === D.path) {
|
|
4796
|
+
var I = p.type === "objectStart", j = G(G(G({}, D), p), {}, { showComma: D.showComma, content: I ? "{...}" : "[...]", type: I ? "objectCollapsed" : "arrayCollapsed" });
|
|
4797
|
+
p = null, g.push(j);
|
|
4798
4798
|
} else {
|
|
4799
|
-
if (
|
|
4800
|
-
p =
|
|
4799
|
+
if (T && !p) {
|
|
4800
|
+
p = D;
|
|
4801
4801
|
continue;
|
|
4802
4802
|
}
|
|
4803
4803
|
if (p) continue;
|
|
4804
|
-
|
|
4804
|
+
g.push(D);
|
|
4805
4805
|
}
|
|
4806
4806
|
}
|
|
4807
|
-
return
|
|
4807
|
+
return g;
|
|
4808
4808
|
})), s = (0, A.computed)((function() {
|
|
4809
4809
|
var p = u.selectedValue;
|
|
4810
4810
|
return p && u.selectableType === "multiple" && Array.isArray(p) ? p : [p];
|
|
@@ -4813,65 +4813,65 @@ const dc = (0, A.defineComponent)({ name: "Tree", props: G(G({}, l0), {}, { coll
|
|
|
4813
4813
|
})), f = function() {
|
|
4814
4814
|
var p = a.value;
|
|
4815
4815
|
if (u.virtual) {
|
|
4816
|
-
var
|
|
4817
|
-
|
|
4818
|
-
var
|
|
4819
|
-
i.translateY =
|
|
4820
|
-
return L >=
|
|
4816
|
+
var g, h = u.height / u.itemHeight, x = ((g = r.value) === null || g === void 0 ? void 0 : g.scrollTop) || 0, D = Math.floor(x / u.itemHeight), T = D < 0 ? 0 : D + h > p.length ? p.length - h : D;
|
|
4817
|
+
T < 0 && (T = 0);
|
|
4818
|
+
var I = T + h;
|
|
4819
|
+
i.translateY = T * u.itemHeight, i.visibleData = p.filter((function(j, L) {
|
|
4820
|
+
return L >= T && L < I;
|
|
4821
4821
|
}));
|
|
4822
4822
|
} else i.visibleData = p;
|
|
4823
4823
|
}, m = function() {
|
|
4824
4824
|
f();
|
|
4825
4825
|
}, b = function(p) {
|
|
4826
|
-
var
|
|
4827
|
-
if (
|
|
4828
|
-
var
|
|
4829
|
-
return R ===
|
|
4830
|
-
})),
|
|
4831
|
-
|
|
4832
|
-
} else if (
|
|
4833
|
-
var j = (
|
|
4826
|
+
var g, h, x = p.path, D = u.selectableType;
|
|
4827
|
+
if (D === "multiple") {
|
|
4828
|
+
var T = s.value.findIndex((function(R) {
|
|
4829
|
+
return R === x;
|
|
4830
|
+
})), I = Zu(s.value);
|
|
4831
|
+
T !== -1 ? I.splice(T, 1) : I.push(x), t("update:selectedValue", I), t("selectedChange", I, Zu(s.value));
|
|
4832
|
+
} else if (D === "single" && s.value[0] !== x) {
|
|
4833
|
+
var j = (g = s.value, h = 1, (function(R) {
|
|
4834
4834
|
if (Array.isArray(R)) return R;
|
|
4835
|
-
})(
|
|
4835
|
+
})(g) || (function(R, Q) {
|
|
4836
4836
|
var M = R == null ? null : typeof Symbol < "u" && R[Symbol.iterator] || R["@@iterator"];
|
|
4837
4837
|
if (M != null) {
|
|
4838
|
-
var uu,
|
|
4838
|
+
var uu, C, _ = [], S = !0, N = !1;
|
|
4839
4839
|
try {
|
|
4840
4840
|
for (M = M.call(R); !(S = (uu = M.next()).done) && (_.push(uu.value), !Q || _.length !== Q); S = !0) ;
|
|
4841
4841
|
} catch (w) {
|
|
4842
|
-
N = !0,
|
|
4842
|
+
N = !0, C = w;
|
|
4843
4843
|
} finally {
|
|
4844
4844
|
try {
|
|
4845
4845
|
S || M.return == null || M.return();
|
|
4846
4846
|
} finally {
|
|
4847
|
-
if (N) throw
|
|
4847
|
+
if (N) throw C;
|
|
4848
4848
|
}
|
|
4849
4849
|
}
|
|
4850
4850
|
return _;
|
|
4851
4851
|
}
|
|
4852
|
-
})(
|
|
4852
|
+
})(g, h) || a0(g, h) || (function() {
|
|
4853
4853
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4854
4854
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
4855
|
-
})())[0], L =
|
|
4855
|
+
})())[0], L = x;
|
|
4856
4856
|
t("update:selectedValue", L), t("selectedChange", L, j);
|
|
4857
4857
|
}
|
|
4858
4858
|
}, d = function(p) {
|
|
4859
4859
|
t("nodeClick", p);
|
|
4860
4860
|
}, v = function(p) {
|
|
4861
4861
|
t("nodeMouseover", p);
|
|
4862
|
-
}, k = function(p,
|
|
4863
|
-
if (p) i.hiddenPaths = G(G({}, i.hiddenPaths), {}, Lu({},
|
|
4862
|
+
}, k = function(p, g) {
|
|
4863
|
+
if (p) i.hiddenPaths = G(G({}, i.hiddenPaths), {}, Lu({}, g, 1));
|
|
4864
4864
|
else {
|
|
4865
4865
|
var h = G({}, i.hiddenPaths);
|
|
4866
|
-
delete h[
|
|
4866
|
+
delete h[g], i.hiddenPaths = h;
|
|
4867
4867
|
}
|
|
4868
|
-
}, F = function(p,
|
|
4869
|
-
u.collapsedOnClickBrackets && k(p,
|
|
4870
|
-
},
|
|
4871
|
-
k(p,
|
|
4872
|
-
},
|
|
4873
|
-
var h = ke(u.data),
|
|
4874
|
-
new Function("data", "val", "data".concat(
|
|
4868
|
+
}, F = function(p, g) {
|
|
4869
|
+
u.collapsedOnClickBrackets && k(p, g.path), t("bracketsClick", p, g);
|
|
4870
|
+
}, E = function(p, g) {
|
|
4871
|
+
k(p, g.path), t("iconClick", p, g);
|
|
4872
|
+
}, y = function(p, g) {
|
|
4873
|
+
var h = ke(u.data), x = u.rootPath;
|
|
4874
|
+
new Function("data", "val", "data".concat(g.slice(x.length), "=val"))(h, p), t("update:data", h);
|
|
4875
4875
|
};
|
|
4876
4876
|
return (0, A.watchEffect)((function() {
|
|
4877
4877
|
l.value && (function(p) {
|
|
@@ -4888,8 +4888,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
4888
4888
|
}), (function(p) {
|
|
4889
4889
|
p && (i.hiddenPaths = c(u.deep, p));
|
|
4890
4890
|
})), function() {
|
|
4891
|
-
var p,
|
|
4892
|
-
return (0, A.createVNode)(fc, { key: L.id, data: u.data, rootPath: u.rootPath, indent: u.indent, node: L, collapsed: !!i.hiddenPaths[L.path], theme: u.theme, showDoubleQuotes: u.showDoubleQuotes, showLength: u.showLength, checked: s.value.includes(L.path), selectableType: u.selectableType, showLine: u.showLine, showLineNumber: u.showLineNumber, showSelectController: u.showSelectController, selectOnClickNode: u.selectOnClickNode, nodeSelectable: u.nodeSelectable, highlightSelectedNode: u.highlightSelectedNode, editable: u.editable, editableTrigger: u.editableTrigger, showIcon: u.showIcon, showKeyValueSpace: u.showKeyValueSpace, renderNodeKey:
|
|
4891
|
+
var p, g, h, x, D = (p = u.renderNodeKey) !== null && p !== void 0 ? p : n.renderNodeKey, T = (g = u.renderNodeValue) !== null && g !== void 0 ? g : n.renderNodeValue, I = (h = (x = u.renderNodeActions) !== null && x !== void 0 ? x : n.renderNodeActions) !== null && h !== void 0 && h, j = i.visibleData && i.visibleData.map((function(L) {
|
|
4892
|
+
return (0, A.createVNode)(fc, { key: L.id, data: u.data, rootPath: u.rootPath, indent: u.indent, node: L, collapsed: !!i.hiddenPaths[L.path], theme: u.theme, showDoubleQuotes: u.showDoubleQuotes, showLength: u.showLength, checked: s.value.includes(L.path), selectableType: u.selectableType, showLine: u.showLine, showLineNumber: u.showLineNumber, showSelectController: u.showSelectController, selectOnClickNode: u.selectOnClickNode, nodeSelectable: u.nodeSelectable, highlightSelectedNode: u.highlightSelectedNode, editable: u.editable, editableTrigger: u.editableTrigger, showIcon: u.showIcon, showKeyValueSpace: u.showKeyValueSpace, renderNodeKey: D, renderNodeValue: T, renderNodeActions: I, onNodeClick: d, onNodeMouseover: v, onBracketsClick: F, onIconClick: E, onSelectedChange: b, onValueChange: y, style: u.itemHeight && u.itemHeight !== 20 ? { lineHeight: "".concat(u.itemHeight, "px") } : {} }, null);
|
|
4893
4893
|
}));
|
|
4894
4894
|
return (0, A.createVNode)("div", { ref: r, class: { "vjs-tree": !0, "is-virtual": u.virtual, dark: u.theme === "dark" }, onScroll: u.virtual ? m : void 0, style: u.showLineNumber ? G({ paddingLeft: "".concat(12 * Number(o.value.length.toString().length), "px") }, u.style) : u.style }, [u.virtual ? (0, A.createVNode)("div", { class: "vjs-tree-list", style: { height: "".concat(u.height, "px") } }, [(0, A.createVNode)("div", { class: "vjs-tree-list-holder", style: { height: "".concat(a.value.length * u.itemHeight, "px") } }, [(0, A.createVNode)("div", { class: "vjs-tree-list-holder-inner", style: { transform: "translateY(".concat(i.translateY, "px)") } }, [j])])]) : j]);
|
|
4895
4895
|
};
|
|
@@ -4960,20 +4960,30 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
|
|
|
4960
4960
|
const e = u, t = xu(() => {
|
|
4961
4961
|
if (typeof e.content == "string") {
|
|
4962
4962
|
try {
|
|
4963
|
-
const
|
|
4964
|
-
const
|
|
4965
|
-
return h && typeof h == "object" && !Array.isArray(h) && typeof h.type == "string" &&
|
|
4963
|
+
const y = JSON.parse(e.content), p = (h) => h && typeof h == "object" && !Array.isArray(h) && ("texts" in h || "files" in h) && !("type" in h), g = (h) => {
|
|
4964
|
+
const x = ["text", "file", "image", "voice", "medialib"];
|
|
4965
|
+
return h && typeof h == "object" && !Array.isArray(h) && typeof h.type == "string" && x.includes(h.type) && "content" in h;
|
|
4966
4966
|
};
|
|
4967
|
-
if (
|
|
4968
|
-
|
|
4967
|
+
if (Array.isArray(y)) {
|
|
4968
|
+
const h = [], x = [];
|
|
4969
|
+
for (const T of y)
|
|
4970
|
+
p(T) && (Array.isArray(T.texts) && h.push(...T.texts.filter(Boolean)), Array.isArray(T.files) && x.push(...T.files.filter(Boolean)));
|
|
4971
|
+
if (h.length > 0 || x.length > 0)
|
|
4972
|
+
return { texts: h, files: x };
|
|
4973
|
+
const D = y[0];
|
|
4974
|
+
if (p(D) || g(D))
|
|
4975
|
+
return D;
|
|
4976
|
+
}
|
|
4977
|
+
if (p(y) || g(y))
|
|
4978
|
+
return y;
|
|
4969
4979
|
} catch {
|
|
4970
4980
|
}
|
|
4971
4981
|
return { type: "text", content: e.content };
|
|
4972
4982
|
}
|
|
4973
4983
|
return e.content;
|
|
4974
4984
|
});
|
|
4975
|
-
function n(
|
|
4976
|
-
return !("type" in
|
|
4985
|
+
function n(y) {
|
|
4986
|
+
return !("type" in y);
|
|
4977
4987
|
}
|
|
4978
4988
|
const r = new J({
|
|
4979
4989
|
html: !0,
|
|
@@ -4983,12 +4993,12 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
|
|
|
4983
4993
|
function a() {
|
|
4984
4994
|
n(t.value) || (t.value.type === "image" ? (i.value = t.value.content, c.value = !0) : t.value.type === "medialib" && F.value === "image" && (i.value = v.value, c.value = !0));
|
|
4985
4995
|
}
|
|
4986
|
-
function s(
|
|
4987
|
-
i.value =
|
|
4996
|
+
function s(y) {
|
|
4997
|
+
i.value = y, c.value = !0;
|
|
4988
4998
|
}
|
|
4989
|
-
function l(
|
|
4999
|
+
function l(y) {
|
|
4990
5000
|
try {
|
|
4991
|
-
const h = new URL(
|
|
5001
|
+
const h = new URL(y).pathname.split("/");
|
|
4992
5002
|
return h[h.length - 1] || "未知文件";
|
|
4993
5003
|
} catch {
|
|
4994
5004
|
return "未知文件";
|
|
@@ -4997,12 +5007,12 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
|
|
|
4997
5007
|
function f() {
|
|
4998
5008
|
n(t.value) || window.open(t.value.content, "_blank");
|
|
4999
5009
|
}
|
|
5000
|
-
function m(
|
|
5001
|
-
window.open(
|
|
5010
|
+
function m(y) {
|
|
5011
|
+
window.open(y, "_blank");
|
|
5002
5012
|
}
|
|
5003
|
-
function b(
|
|
5004
|
-
if (!
|
|
5005
|
-
const p =
|
|
5013
|
+
function b(y) {
|
|
5014
|
+
if (!y) return "file";
|
|
5015
|
+
const p = y.toLowerCase();
|
|
5006
5016
|
return p.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/) ? "video" : p.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/) ? "image" : p.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/) ? "audio" : "file";
|
|
5007
5017
|
}
|
|
5008
5018
|
const d = xu(() => {
|
|
@@ -5016,54 +5026,54 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
|
|
|
5016
5026
|
}), v = xu(() => d.value?.file_url || ""), k = xu(() => d.value?.file_name || l(v.value)), F = xu(() => {
|
|
5017
5027
|
if (!v.value)
|
|
5018
5028
|
return "json";
|
|
5019
|
-
const
|
|
5020
|
-
return
|
|
5029
|
+
const y = v.value.toLowerCase();
|
|
5030
|
+
return y.match(/\.(mp4|webm|ogg|mov|avi|wmv|flv|mkv)$/) ? "video" : y.match(/\.(jpg|jpeg|png|gif|bmp|webp|svg)$/) ? "image" : y.match(/\.(mp3|wav|ogg|aac|flac|m4a)$/) ? "audio" : "file";
|
|
5021
5031
|
});
|
|
5022
|
-
function
|
|
5032
|
+
function E() {
|
|
5023
5033
|
v.value && window.open(v.value, "_blank");
|
|
5024
5034
|
}
|
|
5025
|
-
return (
|
|
5035
|
+
return (y, p) => (P(), z("div", xc, [
|
|
5026
5036
|
!n(t.value) && t.value.type === "text" ? (P(), z("div", {
|
|
5027
5037
|
key: 0,
|
|
5028
5038
|
class: "content-text",
|
|
5029
5039
|
innerHTML: o.value
|
|
5030
5040
|
}, null, 8, gc)) : n(t.value) ? (P(), z("div", _c, [
|
|
5031
|
-
(P(!0), z(Me, null, je(t.value.texts, (
|
|
5041
|
+
(P(!0), z(Me, null, je(t.value.texts, (g, h) => (P(), z("div", {
|
|
5032
5042
|
key: `text-${h}`,
|
|
5033
5043
|
class: "content-text",
|
|
5034
|
-
innerHTML: au(r).render(
|
|
5044
|
+
innerHTML: au(r).render(g)
|
|
5035
5045
|
}, null, 8, kc))), 128)),
|
|
5036
5046
|
lu("div", yc, [
|
|
5037
|
-
(P(!0), z(Me, null, je(t.value.files, (
|
|
5047
|
+
(P(!0), z(Me, null, je(t.value.files, (g, h) => (P(), z("div", {
|
|
5038
5048
|
key: `file-${h}`,
|
|
5039
5049
|
class: "file-item"
|
|
5040
5050
|
}, [
|
|
5041
|
-
b(
|
|
5051
|
+
b(g) === "image" ? (P(), z("img", {
|
|
5042
5052
|
key: 0,
|
|
5043
|
-
src:
|
|
5053
|
+
src: g,
|
|
5044
5054
|
alt: "图片",
|
|
5045
5055
|
class: "file-image",
|
|
5046
|
-
onClick: (
|
|
5047
|
-
}, null, 8, Cc)) : b(
|
|
5056
|
+
onClick: (x) => s(g)
|
|
5057
|
+
}, null, 8, Cc)) : b(g) === "video" ? (P(), z("video", {
|
|
5048
5058
|
key: 1,
|
|
5049
5059
|
controls: "",
|
|
5050
|
-
src:
|
|
5051
|
-
class: "file-video"
|
|
5052
|
-
}, "您的浏览器不支持视频播放", 8, vc)) : b(
|
|
5060
|
+
src: g,
|
|
5061
|
+
class: "file-video video"
|
|
5062
|
+
}, "您的浏览器不支持视频播放", 8, vc)) : b(g) === "audio" ? (P(), z("audio", {
|
|
5053
5063
|
key: 2,
|
|
5054
5064
|
controls: "",
|
|
5055
|
-
src:
|
|
5056
|
-
class: "file-audio"
|
|
5065
|
+
src: g,
|
|
5066
|
+
class: "file-audio audio"
|
|
5057
5067
|
}, "您的浏览器不支持音频播放", 8, Dc)) : (P(), z("div", {
|
|
5058
5068
|
key: 3,
|
|
5059
5069
|
class: "content-file",
|
|
5060
|
-
onClick: (
|
|
5070
|
+
onClick: (x) => m(g)
|
|
5061
5071
|
}, [
|
|
5062
5072
|
su(au(bu), {
|
|
5063
5073
|
icon: "mdi:file-document-outline",
|
|
5064
5074
|
class: "file-icon"
|
|
5065
5075
|
}),
|
|
5066
|
-
lu("span", Fc, ue(l(
|
|
5076
|
+
lu("span", Fc, ue(l(g)), 1),
|
|
5067
5077
|
su(au(bu), {
|
|
5068
5078
|
icon: "mdi:download",
|
|
5069
5079
|
class: "download-icon"
|
|
@@ -5094,14 +5104,15 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
|
|
|
5094
5104
|
])) : !n(t.value) && t.value.type === "voice" ? (P(), z("div", Tc, [
|
|
5095
5105
|
lu("audio", {
|
|
5096
5106
|
controls: "",
|
|
5097
|
-
src: t.value.content
|
|
5107
|
+
src: t.value.content,
|
|
5108
|
+
class: "audio"
|
|
5098
5109
|
}, "您的浏览器不支持音频播放", 8, Ic)
|
|
5099
5110
|
])) : !n(t.value) && t.value.type === "medialib" ? (P(), z("div", Nc, [
|
|
5100
5111
|
F.value === "video" ? (P(), z("video", {
|
|
5101
5112
|
key: 0,
|
|
5102
5113
|
controls: "",
|
|
5103
5114
|
src: v.value,
|
|
5104
|
-
class: "medialib-video"
|
|
5115
|
+
class: "medialib-video video"
|
|
5105
5116
|
}, " 您的浏览器不支持视频播放 ", 8, Lc)) : F.value === "image" ? (P(), z("img", {
|
|
5106
5117
|
key: 1,
|
|
5107
5118
|
src: v.value,
|
|
@@ -5112,11 +5123,11 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
|
|
|
5112
5123
|
key: 2,
|
|
5113
5124
|
controls: "",
|
|
5114
5125
|
src: v.value,
|
|
5115
|
-
class: "medialib-audio"
|
|
5126
|
+
class: "medialib-audio audio"
|
|
5116
5127
|
}, " 您的浏览器不支持音频播放 ", 8, Bc)) : F.value === "file" ? (P(), z("div", {
|
|
5117
5128
|
key: 3,
|
|
5118
5129
|
class: "content-file",
|
|
5119
|
-
onClick:
|
|
5130
|
+
onClick: E
|
|
5120
5131
|
}, [
|
|
5121
5132
|
su(au(bu), {
|
|
5122
5133
|
icon: "mdi:file-document-outline",
|
|
@@ -5137,11 +5148,11 @@ const pc = ["src", "alt"], bc = /* @__PURE__ */ ye({
|
|
|
5137
5148
|
su(mc, {
|
|
5138
5149
|
show: c.value,
|
|
5139
5150
|
"image-url": i.value,
|
|
5140
|
-
onClose: p[0] || (p[0] = (
|
|
5151
|
+
onClose: p[0] || (p[0] = (g) => c.value = !1)
|
|
5141
5152
|
}, null, 8, ["show", "image-url"])
|
|
5142
5153
|
]));
|
|
5143
5154
|
}
|
|
5144
|
-
}), zc = /* @__PURE__ */ f0(Mc, [["__scopeId", "data-v-
|
|
5155
|
+
}), zc = /* @__PURE__ */ f0(Mc, [["__scopeId", "data-v-cfe541e3"]]);
|
|
5145
5156
|
export {
|
|
5146
5157
|
mc as ImageViewer,
|
|
5147
5158
|
zc as MessageContentRenderer
|