@linker-design-plus/tiny-peony 1.4.24 → 1.4.25
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.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +328 -320
- package/dist/index.mjs.map +1 -1
- package/dist/typings/shared.d.ts +2 -1
- package/dist/utils/shared.d.ts +0 -6
- package/package.json +8 -7
package/dist/index.mjs
CHANGED
|
@@ -7,15 +7,8 @@ var kC = (I) => Object.prototype.toString.call(I), ge = (I) => kC(I) === "[objec
|
|
|
7
7
|
const B = `${I}-${E}`;
|
|
8
8
|
return [Be(B), B];
|
|
9
9
|
};
|
|
10
|
-
const II = NB("tag"), ZA = NB("c"),
|
|
11
|
-
|
|
12
|
-
return function(...t) {
|
|
13
|
-
E || (requestAnimationFrame(() => {
|
|
14
|
-
I.apply(this, t), E = !1;
|
|
15
|
-
}), E = !0);
|
|
16
|
-
};
|
|
17
|
-
}, Qe = () => typeof window > "u" ? !1 : window.location.protocol === "https:", MI = (I) => Object.prototype.toString.call(I).slice(8, -1).toLocaleLowerCase(), GB = (I) => MI(I) === "string", kB = (I) => MI(I) === "array", Ee = (I) => MI(I) === "null", ee = (I) => MI(I) === "undefined", q = (I) => Ee(I) || ee(I), $ = (I) => I instanceof HTMLElement, HA = (I) => (I == null ? void 0 : I.nodeType) === Node.TEXT_NODE;
|
|
18
|
-
var te = /* @__PURE__ */ ((I) => (I.None = "None", I.Caret = "Caret", I.Range = "Range", I))(te || {}), b = /* @__PURE__ */ ((I) => (I.pausation = "pausation", I.pronunciation = "pronunciation", I.anchor = "anchor", I.homophones = "homophones", I.highlight = "highlight", I))(b || {}), SB = /* @__PURE__ */ ((I) => (I.single = "single", I.multiple = "multiple", I))(SB || {});
|
|
10
|
+
const II = NB("tag"), ZA = NB("c"), Qe = () => typeof window > "u" ? !1 : window.location.protocol === "https:", MI = (I) => Object.prototype.toString.call(I).slice(8, -1).toLocaleLowerCase(), GB = (I) => MI(I) === "string", kB = (I) => MI(I) === "array", Ee = (I) => MI(I) === "null", ee = (I) => MI(I) === "undefined", q = (I) => Ee(I) || ee(I), $ = (I) => I instanceof HTMLElement, HA = (I) => (I == null ? void 0 : I.nodeType) === Node.TEXT_NODE;
|
|
11
|
+
var te = /* @__PURE__ */ ((I) => (I.None = "None", I.Caret = "Caret", I.Range = "Range", I))(te || {}), x = /* @__PURE__ */ ((I) => (I.pausation = "pausation", I.pronunciation = "pronunciation", I.anchor = "anchor", I.homophones = "homophones", I.highlight = "highlight", I.placeholderoldSpace = "placeholderoldSpace", I))(x || {}), SB = /* @__PURE__ */ ((I) => (I.single = "single", I.multiple = "multiple", I))(SB || {});
|
|
19
12
|
class oe {
|
|
20
13
|
}
|
|
21
14
|
class ne {
|
|
@@ -41,9 +34,9 @@ class se extends ae {
|
|
|
41
34
|
}
|
|
42
35
|
}
|
|
43
36
|
const ce = (I, E) => {
|
|
44
|
-
var
|
|
37
|
+
var y;
|
|
45
38
|
E.preventDefault();
|
|
46
|
-
const B = ((
|
|
39
|
+
const B = ((y = E.data) == null ? void 0 : y.length) ?? 0, t = I.content.calcTextCount() - B, o = I.maxLength - t;
|
|
47
40
|
if (o >= B || !B) return;
|
|
48
41
|
const r = o <= 0 ? B : B - o, a = window.getSelection(), i = a == null ? void 0 : a.getRangeAt(0);
|
|
49
42
|
if (q(a) || q(i)) return;
|
|
@@ -127,11 +120,14 @@ class de extends ne {
|
|
|
127
120
|
let a = "";
|
|
128
121
|
for (let i = 0; i < r.length; i++) {
|
|
129
122
|
const h = r[i];
|
|
130
|
-
HA(h) ? a += h.textContent ?? "" : $(h) && (a +=
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
123
|
+
HA(h) ? a += h.textContent ?? "" : $(h) && (a += ((c) => {
|
|
124
|
+
const { type: y, value: D, raw: u } = c.dataset;
|
|
125
|
+
if ([x.anchor, x.placeholderoldSpace].includes(y)) {
|
|
126
|
+
const R = t(c);
|
|
127
|
+
return typeof R == "string" ? R : "";
|
|
128
|
+
}
|
|
129
|
+
return y === x.pronunciation ? D ?? "" : u ?? "";
|
|
130
|
+
})(h));
|
|
135
131
|
}
|
|
136
132
|
return a;
|
|
137
133
|
};
|
|
@@ -165,7 +161,7 @@ class de extends ne {
|
|
|
165
161
|
*/
|
|
166
162
|
_calcRange(B) {
|
|
167
163
|
const t = B.commonAncestorContainer;
|
|
168
|
-
if ($(B.startContainer) && B.startContainer.dataset.type ===
|
|
164
|
+
if ($(B.startContainer) && B.startContainer.dataset.type === x.highlight && B.endContainer.nodeType === Node.TEXT_NODE) {
|
|
169
165
|
const h = document.createRange();
|
|
170
166
|
return h.setStartAfter(B.startContainer), h.collapse(!0), h;
|
|
171
167
|
}
|
|
@@ -285,13 +281,13 @@ class he extends re {
|
|
|
285
281
|
const t = window.getSelection();
|
|
286
282
|
if (q(t)) return;
|
|
287
283
|
const o = (h) => {
|
|
288
|
-
let d = this._editor.content.getParas(), { index: c } = h[0],
|
|
284
|
+
let d = this._editor.content.getParas(), { index: c } = h[0], y = null, D = 0;
|
|
289
285
|
for (; D < h.length; ) {
|
|
290
|
-
if (
|
|
291
|
-
if (d = Array.from(
|
|
286
|
+
if (y = d[c], HA(y)) return y;
|
|
287
|
+
if (d = Array.from(y.childNodes), D++, D >= h.length) break;
|
|
292
288
|
c = h[D].index;
|
|
293
289
|
}
|
|
294
|
-
return
|
|
290
|
+
return y;
|
|
295
291
|
}, r = o(B.startMatchedIndexes), a = o(B.endMatchedIndexes), i = document.createRange();
|
|
296
292
|
i.setStart(r, B.startOffset), i.setEnd(a, B.endOffset), t.removeAllRanges(), t.addRange(i);
|
|
297
293
|
}
|
|
@@ -355,14 +351,14 @@ const yI = (I, E) => {
|
|
|
355
351
|
const [D] = PA(
|
|
356
352
|
i.commonAncestorContainer,
|
|
357
353
|
(m) => m.tagName === "P" && m.classList.contains(GA)
|
|
358
|
-
), [u] = PA(i.startContainer, (m) => m.tagName === "SPAN" && m.dataset.type ===
|
|
354
|
+
), [u] = PA(i.startContainer, (m) => m.tagName === "SPAN" && m.dataset.type === x.anchor), R = document.createRange(), F = !!u;
|
|
359
355
|
R.setStart(i.startContainer, i.startOffset), R.setEndAfter(D.lastChild);
|
|
360
356
|
const M = R.extractContents();
|
|
361
357
|
if (!(D != null && D.textContent))
|
|
362
358
|
D.innerHTML = o;
|
|
363
359
|
else if (HA(D.lastChild))
|
|
364
360
|
D.lastChild.textContent += o;
|
|
365
|
-
else if ($(D.lastChild) && D.lastChild.dataset.type ===
|
|
361
|
+
else if ($(D.lastChild) && D.lastChild.dataset.type === x.anchor) {
|
|
366
362
|
const { lastChild: m } = D.lastChild;
|
|
367
363
|
HA(m) ? m.textContent += o : m == null || m.appendChild(document.createTextNode(o));
|
|
368
364
|
} else
|
|
@@ -385,7 +381,7 @@ const yI = (I, E) => {
|
|
|
385
381
|
S.innerHTML = r;
|
|
386
382
|
else if (HA(S.firstChild))
|
|
387
383
|
S.firstChild.textContent = r + S.firstChild.textContent;
|
|
388
|
-
else if ($(S.firstChild) && S.firstChild.dataset.type ===
|
|
384
|
+
else if ($(S.firstChild) && S.firstChild.dataset.type === x.anchor) {
|
|
389
385
|
const { firstChild: m } = S.firstChild;
|
|
390
386
|
HA(m) ? m.textContent = r + m.textContent : m == null || m.insertBefore(document.createTextNode(r), m.firstChild);
|
|
391
387
|
} else
|
|
@@ -433,7 +429,7 @@ class Ne extends oe {
|
|
|
433
429
|
var t;
|
|
434
430
|
if (B.removedNodes.length) {
|
|
435
431
|
const o = B.removedNodes[0];
|
|
436
|
-
if ($(o) && o.dataset.type ===
|
|
432
|
+
if ($(o) && o.dataset.type === x.highlight) {
|
|
437
433
|
const r = window.getSelection(), { range: a } = this.cursor;
|
|
438
434
|
if (q(a) || q(r)) return;
|
|
439
435
|
const i = document.createTextNode(""), h = document.createRange();
|
|
@@ -454,7 +450,7 @@ class Ne extends oe {
|
|
|
454
450
|
var D;
|
|
455
451
|
const r = o.parentNode, a = o.firstChild;
|
|
456
452
|
if (o && o.getAttribute("data-placeholder") !== null) return;
|
|
457
|
-
const h = o && o.style.textIndent === "20px" && o.style.fontSize && o.style.color, d = o && o.style.backgroundColor && ((D = o.parentElement) == null ? void 0 : D.style.textIndent) === "0px", c = o && Array.from(o.childNodes).every((u) => HA(u) && !u.textContent || $(u) && u.tagName === "BR"),
|
|
453
|
+
const h = o && o.style.textIndent === "20px" && o.style.fontSize && o.style.color, d = o && o.style.backgroundColor && ((D = o.parentElement) == null ? void 0 : D.style.textIndent) === "0px", c = o && Array.from(o.childNodes).every((u) => HA(u) && !u.textContent || $(u) && u.tagName === "BR"), y = o && $(o.firstChild) && o.firstChild.tagName === "BR";
|
|
458
454
|
if (h || d) {
|
|
459
455
|
for (; o.firstChild; )
|
|
460
456
|
r == null || r.insertBefore(o.firstChild, o);
|
|
@@ -465,7 +461,7 @@ class Ne extends oe {
|
|
|
465
461
|
const u = window.getSelection(), F = (u == null ? void 0 : u.getRangeAt(0)).cloneRange();
|
|
466
462
|
F.setStartAfter(F.startContainer), F.setEndAfter(F.endContainer), u == null || u.removeAllRanges(), u == null || u.addRange(F);
|
|
467
463
|
}
|
|
468
|
-
|
|
464
|
+
y && o.removeChild(o.firstChild);
|
|
469
465
|
}), this.content.getParas().forEach((o) => {
|
|
470
466
|
const r = o.firstChild, a = o.lastChild;
|
|
471
467
|
o.childNodes.length > 1 && ($(a) && a.tagName === "BR" && a.remove(), $(r) && r.tagName === "BR" && r.remove(), Array.from(o.childNodes).forEach((i) => {
|
|
@@ -487,22 +483,22 @@ class Ne extends oe {
|
|
|
487
483
|
var r, a, i, h, d;
|
|
488
484
|
const t = window.getSelection(), o = t.getRangeAt(0);
|
|
489
485
|
if (B.key === "Backspace" && o.startOffset === 0 && o.collapsed) {
|
|
490
|
-
const [c] = PA(o.startContainer, (D) => D.tagName === "P" && D.classList.contains(GA)),
|
|
491
|
-
if (
|
|
486
|
+
const [c] = PA(o.startContainer, (D) => D.tagName === "P" && D.classList.contains(GA)), y = c == null ? void 0 : c.previousElementSibling;
|
|
487
|
+
if (y) {
|
|
492
488
|
B.preventDefault();
|
|
493
|
-
const D =
|
|
489
|
+
const D = y.childNodes, u = y.childNodes[0];
|
|
494
490
|
if (
|
|
495
491
|
// 一个节点
|
|
496
492
|
D.length === 1 && // 空文本节点
|
|
497
493
|
(HA(u) && u.textContent === "" || // 换行元素节点
|
|
498
494
|
$(u) && u.tagName === "BR")
|
|
499
495
|
) {
|
|
500
|
-
|
|
496
|
+
y.remove();
|
|
501
497
|
const R = document.createRange();
|
|
502
498
|
R.setStart(c.firstChild, 0), R.collapse(!0), t.removeAllRanges(), t.addRange(R);
|
|
503
499
|
} else {
|
|
504
500
|
const R = document.createRange();
|
|
505
|
-
R.selectNodeContents(
|
|
501
|
+
R.selectNodeContents(y), R.collapse(!1), t.removeAllRanges(), t.addRange(R);
|
|
506
502
|
const F = document.createDocumentFragment(), M = c.firstChild;
|
|
507
503
|
for (; c.firstChild; )
|
|
508
504
|
F.appendChild(c.firstChild);
|
|
@@ -513,9 +509,9 @@ class Ne extends oe {
|
|
|
513
509
|
}
|
|
514
510
|
}
|
|
515
511
|
if (B.key === "Delete" && Ge()) {
|
|
516
|
-
const c = getSelection(),
|
|
517
|
-
if (q(c) || q(
|
|
518
|
-
const D = WA(
|
|
512
|
+
const c = getSelection(), y = (r = getSelection()) == null ? void 0 : r.getRangeAt(0);
|
|
513
|
+
if (q(c) || q(y)) return;
|
|
514
|
+
const D = WA(y.endContainer), u = D == null ? void 0 : D.nextElementSibling;
|
|
519
515
|
if (q(D) || q(u)) return;
|
|
520
516
|
const R = document.createRange();
|
|
521
517
|
for (R.selectNodeContents(D), R.collapse(!1); u.firstChild; )
|
|
@@ -525,11 +521,11 @@ class Ne extends oe {
|
|
|
525
521
|
if (B.key === "Enter") {
|
|
526
522
|
const { range: c } = this.cursor;
|
|
527
523
|
if (ge(c)) return;
|
|
528
|
-
const [
|
|
529
|
-
if (c != null && c.collapsed && c.startOffset === 0 &&
|
|
524
|
+
const [y] = PA(c == null ? void 0 : c.commonAncestorContainer, (D) => D.tagName === "SPAN" && D.dataset.type === x.anchor);
|
|
525
|
+
if (c != null && c.collapsed && c.startOffset === 0 && y) {
|
|
530
526
|
B.preventDefault();
|
|
531
527
|
const D = document.createElement("p");
|
|
532
|
-
D.innerHTML = "<br />", this._editorElement.insertBefore(D,
|
|
528
|
+
D.innerHTML = "<br />", this._editorElement.insertBefore(D, y.parentElement);
|
|
533
529
|
}
|
|
534
530
|
if (c && B.shiftKey) {
|
|
535
531
|
const D = WA(c.startContainer);
|
|
@@ -621,14 +617,14 @@ const Kg = (I, E, B, t) => {
|
|
|
621
617
|
const t = I.previousSibling, o = I.nextSibling, r = E ?? I.textContent ?? "";
|
|
622
618
|
if (B && // 空节点
|
|
623
619
|
(!t && !o || // 相邻停顿节点
|
|
624
|
-
$(t) && t.dataset.type ===
|
|
620
|
+
$(t) && t.dataset.type === x.pausation || // 相邻功能节点
|
|
625
621
|
$(t) && [
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
622
|
+
x.anchor,
|
|
623
|
+
x.homophones,
|
|
624
|
+
x.pausation,
|
|
625
|
+
x.pronunciation
|
|
630
626
|
].includes(t.dataset.type))) {
|
|
631
|
-
$(I) && I.dataset.type !==
|
|
627
|
+
$(I) && I.dataset.type !== x.pausation ? I.replaceWith(I.dataset.raw ?? "") : (a = I.parentNode) == null || a.removeChild(I);
|
|
632
628
|
return;
|
|
633
629
|
}
|
|
634
630
|
if (HA(t)) {
|
|
@@ -758,12 +754,12 @@ function Ug(...I) {
|
|
|
758
754
|
B = lB(B), t = lB(t);
|
|
759
755
|
const r = [], a = () => {
|
|
760
756
|
r.forEach((c) => c()), r.length = 0;
|
|
761
|
-
}, i = (c,
|
|
757
|
+
}, i = (c, y, D, u) => (c.addEventListener(y, D, u), () => c.removeEventListener(y, D, u)), h = gI(
|
|
762
758
|
() => [Ye(E), Jg(o)],
|
|
763
|
-
([c,
|
|
759
|
+
([c, y]) => {
|
|
764
760
|
if (a(), !c)
|
|
765
761
|
return;
|
|
766
|
-
const D = Me(
|
|
762
|
+
const D = Me(y) ? { ...y } : y;
|
|
767
763
|
r.push(
|
|
768
764
|
...B.flatMap((u) => t.map((R) => i(c, u, R, D)))
|
|
769
765
|
);
|
|
@@ -789,8 +785,8 @@ function dB(I, E = {}) {
|
|
|
789
785
|
controls: B = !1,
|
|
790
786
|
navigator: t = JB
|
|
791
787
|
} = E, o = YB(() => t && "permissions" in t), r = rB(), a = typeof I == "string" ? { name: I } : I, i = rB(), h = () => {
|
|
792
|
-
var c,
|
|
793
|
-
i.value = (
|
|
788
|
+
var c, y;
|
|
789
|
+
i.value = (y = (c = r.value) == null ? void 0 : c.state) != null ? y : "prompt";
|
|
794
790
|
};
|
|
795
791
|
Ug(r, "change", h, { passive: !0 });
|
|
796
792
|
const d = pe(async () => {
|
|
@@ -820,7 +816,7 @@ function me(I = {}) {
|
|
|
820
816
|
source: t,
|
|
821
817
|
copiedDuring: o = 1500,
|
|
822
818
|
legacy: r = !1
|
|
823
|
-
} = I, a = YB(() => E && "clipboard" in E), i = dB("clipboard-read"), h = dB("clipboard-write"), d = MA(() => a.value || r), c = yA(""),
|
|
819
|
+
} = I, a = YB(() => E && "clipboard" in E), i = dB("clipboard-read"), h = dB("clipboard-write"), d = MA(() => a.value || r), c = yA(""), y = yA(!1), D = Je(() => y.value = !1, o, { immediate: !1 });
|
|
824
820
|
function u() {
|
|
825
821
|
a.value && G(i.value) ? E.clipboard.readText().then((S) => {
|
|
826
822
|
c.value = S;
|
|
@@ -828,7 +824,7 @@ function me(I = {}) {
|
|
|
828
824
|
}
|
|
829
825
|
d.value && B && Ug(["copy", "cut"], u, { passive: !0 });
|
|
830
826
|
async function R(S = Jg(t)) {
|
|
831
|
-
d.value && S != null && (a.value && G(h.value) ? await E.clipboard.writeText(S) : F(S), c.value = S,
|
|
827
|
+
d.value && S != null && (a.value && G(h.value) ? await E.clipboard.writeText(S) : F(S), c.value = S, y.value = !0, D.start());
|
|
832
828
|
}
|
|
833
829
|
function F(S) {
|
|
834
830
|
const p = document.createElement("textarea");
|
|
@@ -844,7 +840,7 @@ function me(I = {}) {
|
|
|
844
840
|
return {
|
|
845
841
|
isSupported: d,
|
|
846
842
|
text: c,
|
|
847
|
-
copied:
|
|
843
|
+
copied: y,
|
|
848
844
|
copy: R
|
|
849
845
|
};
|
|
850
846
|
}
|
|
@@ -865,10 +861,10 @@ function HI(I = {}) {
|
|
|
865
861
|
scroll: i = !0,
|
|
866
862
|
eventFilter: h
|
|
867
863
|
} = I;
|
|
868
|
-
let d = null, c = 0,
|
|
864
|
+
let d = null, c = 0, y = 0;
|
|
869
865
|
const D = yA(o.x), u = yA(o.y), R = yA(null), F = typeof E == "function" ? E : Ke[E], M = (K) => {
|
|
870
866
|
const W = F(K);
|
|
871
|
-
d = K, W && ([D.value, u.value] = W, R.value = "mouse"), r && (c = r.scrollX,
|
|
867
|
+
d = K, W && ([D.value, u.value] = W, R.value = "mouse"), r && (c = r.scrollX, y = r.scrollY);
|
|
872
868
|
}, G = (K) => {
|
|
873
869
|
if (K.touches.length > 0) {
|
|
874
870
|
const W = F(K.touches[0]);
|
|
@@ -878,7 +874,7 @@ function HI(I = {}) {
|
|
|
878
874
|
if (!d || !r)
|
|
879
875
|
return;
|
|
880
876
|
const K = F(d);
|
|
881
|
-
d instanceof MouseEvent && K && (D.value = K[0] + r.scrollX - c, u.value = K[1] + r.scrollY -
|
|
877
|
+
d instanceof MouseEvent && K && (D.value = K[0] + r.scrollX - c, u.value = K[1] + r.scrollY - y);
|
|
882
878
|
}, p = () => {
|
|
883
879
|
D.value = o.x, u.value = o.y;
|
|
884
880
|
}, m = h ? (K) => h(() => M(K), {}) : (K) => M(K), P = h ? (K) => h(() => G(K), {}) : (K) => G(K), X = h ? () => h(() => S(), {}) : () => S();
|
|
@@ -926,7 +922,7 @@ const ve = ["onClick"], qe = /* @__PURE__ */ vA({
|
|
|
926
922
|
for (const [t, o] of E)
|
|
927
923
|
B[t] = o;
|
|
928
924
|
return B;
|
|
929
|
-
}, HB = /* @__PURE__ */ JA(qe, [["__scopeId", "data-v-a957cba2"]]), xe = 0, Mg =
|
|
925
|
+
}, HB = /* @__PURE__ */ JA(qe, [["__scopeId", "data-v-a957cba2"]]), xe = 0, Mg = x.pausation, [uC] = II(Mg), mB = uC("close"), { x: be, y: Te } = HI(), Pe = `<svg class="${mB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
930
926
|
<g id="V1.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
931
927
|
<g id="虚拟精品录音间-插入停顿" transform="translate(-1287, -152)" fill="currentColor" fill-rule="nonzero">
|
|
932
928
|
<g id="编组-4备份-4" transform="translate(1227, 149)">
|
|
@@ -953,17 +949,17 @@ const ve = ["onClick"], qe = /* @__PURE__ */ vA({
|
|
|
953
949
|
`
|
|
954
950
|
), E;
|
|
955
951
|
}, We = (I, E) => {
|
|
956
|
-
const B = SC(
|
|
952
|
+
const B = SC(x.pausation), { onOK: t } = E, o = (d, c) => {
|
|
957
953
|
t == null || t(d, c), r();
|
|
958
954
|
}, r = () => {
|
|
959
955
|
h.component && (h.component.props.visible = !1);
|
|
960
956
|
}, a = (d) => {
|
|
961
|
-
var c,
|
|
957
|
+
var c, y;
|
|
962
958
|
if (h.component) {
|
|
963
959
|
let D = Te.value, u = be.value;
|
|
964
960
|
if (d.popupContainer) {
|
|
965
961
|
const { offsetTop: R, offsetLeft: F, offsetHeight: M, offsetWidth: G } = d.popupContainer;
|
|
966
|
-
D = R + M + 5 + (((c = d.extraPos) == null ? void 0 : c.top) ?? 0), u = F - (88 - G) / 2 + (((
|
|
962
|
+
D = R + M + 5 + (((c = d.extraPos) == null ? void 0 : c.top) ?? 0), u = F - (88 - G) / 2 + (((y = d.extraPos) == null ? void 0 : y.left) ?? 0);
|
|
967
963
|
}
|
|
968
964
|
B.setAttribute("style", `top: ${D}px; left: ${u}px`), Object.entries(d).forEach(([R, F]) => {
|
|
969
965
|
h.component.props[R] = F;
|
|
@@ -1028,8 +1024,8 @@ class Ve extends pI {
|
|
|
1028
1024
|
}
|
|
1029
1025
|
if (q(this.modalInstance)) {
|
|
1030
1026
|
const i = (h, d) => {
|
|
1031
|
-
var
|
|
1032
|
-
if (q(this.modalInstance) || q((
|
|
1027
|
+
var y;
|
|
1028
|
+
if (q(this.modalInstance) || q((y = this.modalInstance) == null ? void 0 : y.target)) return;
|
|
1033
1029
|
const { target: c } = this.modalInstance;
|
|
1034
1030
|
c.dataset.value = String(d), c.firstElementChild.innerHTML = `停顿: ${d}S`;
|
|
1035
1031
|
};
|
|
@@ -1157,7 +1153,7 @@ const Oe = { style: { display: "none" } }, Xe = /* @__PURE__ */ vA({
|
|
|
1157
1153
|
}
|
|
1158
1154
|
}), ze = /* @__PURE__ */ JA(Xe, [["__scopeId", "data-v-e430f236"]]);
|
|
1159
1155
|
let Ze = 0;
|
|
1160
|
-
const kg =
|
|
1156
|
+
const kg = x.pronunciation, [Sg] = II(kg), KB = Sg("close"), { x: _e, y: $e } = HI(), At = `<svg class="${KB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
1161
1157
|
<g id="V1.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
1162
1158
|
<g id="虚拟精品录音间-读音替换" transform="translate(-1287, -152)" fill="currentColor" fill-rule="nonzero">
|
|
1163
1159
|
<g id="编组-4备份-4" transform="translate(1227, 149)">
|
|
@@ -1169,7 +1165,7 @@ const kg = b.pronunciation, [Sg] = II(kg), KB = Sg("close"), { x: _e, y: $e } =
|
|
|
1169
1165
|
</g>
|
|
1170
1166
|
</g>
|
|
1171
1167
|
</svg>`, gt = (I, E) => {
|
|
1172
|
-
const B = SC(
|
|
1168
|
+
const B = SC(x.pronunciation), { oldText: t, onOk: o, onCancel: r, onTryPlay: a } = E, i = (R, F, M) => {
|
|
1173
1169
|
o == null || o(R, F, M), d();
|
|
1174
1170
|
}, h = (R) => {
|
|
1175
1171
|
r == null || r(R), d();
|
|
@@ -1227,8 +1223,8 @@ class It extends pI {
|
|
|
1227
1223
|
if (q(this.modalInstance)) {
|
|
1228
1224
|
const i = (h, d, c) => {
|
|
1229
1225
|
if (q(this.modalInstance) || q(this.modalInstance.target)) return;
|
|
1230
|
-
const { target:
|
|
1231
|
-
q(D) || (
|
|
1226
|
+
const { target: y } = this.modalInstance, D = y.querySelector(`.${Sg("replace-text")}`);
|
|
1227
|
+
q(D) || (y.dataset.value = d, D.innerHTML = d);
|
|
1232
1228
|
};
|
|
1233
1229
|
this.modalInstance = gt(ze, {
|
|
1234
1230
|
oldText: r.dataset.raw,
|
|
@@ -1278,7 +1274,7 @@ const vB = [
|
|
|
1278
1274
|
"rgba(255, 232, 145, 0.5)",
|
|
1279
1275
|
"rgba(201, 233, 104, 0.5)",
|
|
1280
1276
|
"rgba(255, 206, 190, 0.5)"
|
|
1281
|
-
], Lg =
|
|
1277
|
+
], Lg = x.anchor, [zg] = II(Lg);
|
|
1282
1278
|
class Ct extends pI {
|
|
1283
1279
|
constructor(B) {
|
|
1284
1280
|
super();
|
|
@@ -1339,7 +1335,7 @@ class Ct extends pI {
|
|
|
1339
1335
|
if (HA(fA)) {
|
|
1340
1336
|
const J = fA.textContent;
|
|
1341
1337
|
let H = fA.parentNode, dA = AA.startContainer;
|
|
1342
|
-
H.dataset.type ===
|
|
1338
|
+
H.dataset.type === x.highlight && (dA = H.nextSibling, H = H.parentNode);
|
|
1343
1339
|
const wA = H.cloneNode(!1), RA = document.createDocumentFragment();
|
|
1344
1340
|
for (; H.firstChild && H.firstChild !== dA; )
|
|
1345
1341
|
RA.appendChild(H.firstChild);
|
|
@@ -1351,7 +1347,7 @@ class Ct extends pI {
|
|
|
1351
1347
|
[p, m, P, X] = h(
|
|
1352
1348
|
CA,
|
|
1353
1349
|
c,
|
|
1354
|
-
|
|
1350
|
+
y,
|
|
1355
1351
|
EA ? D : CA[0],
|
|
1356
1352
|
EA ? u : CA[0].childNodes.length,
|
|
1357
1353
|
EA ? kA : null,
|
|
@@ -1384,7 +1380,7 @@ class Ct extends pI {
|
|
|
1384
1380
|
var Z, eA, BA, tA;
|
|
1385
1381
|
const fA = Array.isArray(AA) ? AA : [AA], [U] = K, v = document.createRange();
|
|
1386
1382
|
v.setStart(W, EA), v.setEnd(CA, nA), (Z = getSelection()) == null || Z.removeAllRanges(), (eA = getSelection()) == null || eA.addRange(v);
|
|
1387
|
-
const O = v.startContainer === v.endContainer && ((tA = (BA = v.startContainer.parentElement) == null ? void 0 : BA.dataset) == null ? void 0 : tA.type) ===
|
|
1383
|
+
const O = v.startContainer === v.endContainer && ((tA = (BA = v.startContainer.parentElement) == null ? void 0 : BA.dataset) == null ? void 0 : tA.type) === x.highlight ? v.startContainer.parentElement.cloneNode(!1) : null, z = v.cloneContents(), J = document.createDocumentFragment();
|
|
1388
1384
|
Array.from(z.childNodes).forEach((DA) => {
|
|
1389
1385
|
if (!$(DA) || !DA.classList.contains(zg())) {
|
|
1390
1386
|
O && O.appendChild(DA), J.appendChild(O ?? DA);
|
|
@@ -1393,12 +1389,12 @@ class Ct extends pI {
|
|
|
1393
1389
|
J.append(...Array.from(DA.childNodes));
|
|
1394
1390
|
});
|
|
1395
1391
|
let H = document.createTextNode(""), dA = 0, wA = document.createTextNode(""), RA = 0;
|
|
1396
|
-
return fA.includes("start") && (H = J.firstChild, dA = 0), fA.includes("end") && (wA = J.lastChild, RA = HA(wA) ? wA.data.length : $(J.lastChild) && J.lastChild.dataset.type ===
|
|
1392
|
+
return fA.includes("start") && (H = J.firstChild, dA = 0), fA.includes("end") && (wA = J.lastChild, RA = HA(wA) ? wA.data.length : $(J.lastChild) && J.lastChild.dataset.type === x.highlight ? J.lastChild.childNodes.length : J.childNodes.length), v.deleteContents(), U.insertBefore(J, typeof kA == "function" ? kA() : kA), [H, dA, wA, RA];
|
|
1397
1393
|
}, d = async (K) => {
|
|
1398
1394
|
var EA, CA;
|
|
1399
1395
|
const W = document.createRange();
|
|
1400
|
-
p === P && $(p) && p.dataset.type ===
|
|
1401
|
-
}, { startContainer: c, startOffset:
|
|
1396
|
+
p === P && $(p) && p.dataset.type === x.highlight ? W.selectNode(p) : (W.setStart(p, m), W.setEnd(P, X)), (EA = getSelection()) == null || EA.removeAllRanges(), (CA = getSelection()) == null || CA.addRange(W), this.editor.cursor.range = W, this._insertAnchorTag(B.anchor, K);
|
|
1397
|
+
}, { startContainer: c, startOffset: y, endContainer: D, endOffset: u } = t, R = r(D), F = WA(c), M = WA(D), G = F === M ? [F] : [F, ...hC(F, M), M], S = G.map((K, W) => {
|
|
1402
1398
|
let EA = [], CA = 0, nA = K.childNodes.length;
|
|
1403
1399
|
switch (W) {
|
|
1404
1400
|
case 0: {
|
|
@@ -1428,7 +1424,7 @@ class Ct extends pI {
|
|
|
1428
1424
|
return B.length ? Math.max(...B) + 1 : 1;
|
|
1429
1425
|
}
|
|
1430
1426
|
_insertAnchorTag(B, t) {
|
|
1431
|
-
const o = this._newAnchorId, r = String(Date.now()), a = vB[(o - 1) % 10], i = this.editor.cursor.range, { startContainer: h, startOffset: d, endContainer: c, endOffset:
|
|
1427
|
+
const o = this._newAnchorId, r = String(Date.now()), a = vB[(o - 1) % 10], i = this.editor.cursor.range, { startContainer: h, startOffset: d, endContainer: c, endOffset: y } = i, D = (p) => $(p) && p.tagName === "DIV" ? p.firstElementChild : $(p) && p.tagName === "P" ? p : WA(p), u = (p) => {
|
|
1432
1428
|
const m = document.createElement("span");
|
|
1433
1429
|
return Kg(
|
|
1434
1430
|
m,
|
|
@@ -1457,7 +1453,7 @@ class Ct extends pI {
|
|
|
1457
1453
|
if (F(p, P))
|
|
1458
1454
|
W.selectNode(Array.from(p.childNodes).slice(m, X)[0]);
|
|
1459
1455
|
else {
|
|
1460
|
-
const AA = $(P) && [
|
|
1456
|
+
const AA = $(P) && [x.pausation].includes(P.dataset.type) ? P.childNodes.length : X;
|
|
1461
1457
|
$(p) && p.tagName === "P" ? (W.setStart(p.firstChild, 0), W.setEnd(p, p.childNodes.length)) : (W.setStart(p, m), W.setEnd(P, AA));
|
|
1462
1458
|
}
|
|
1463
1459
|
const EA = window.getSelection();
|
|
@@ -1471,7 +1467,7 @@ class Ct extends pI {
|
|
|
1471
1467
|
}, F = (p, m) => {
|
|
1472
1468
|
var P, X;
|
|
1473
1469
|
return $(p) && p.tagName === "P" && p === m && // @ts-ignore
|
|
1474
|
-
((X = (P = Array.from(p.childNodes).slice(i.startOffset, i.endOffset)[0]) == null ? void 0 : P.dataset) == null ? void 0 : X.type) ===
|
|
1470
|
+
((X = (P = Array.from(p.childNodes).slice(i.startOffset, i.endOffset)[0]) == null ? void 0 : P.dataset) == null ? void 0 : X.type) === x.highlight;
|
|
1475
1471
|
}, M = D(h), G = D(c), S = hC(M, G);
|
|
1476
1472
|
if (M === G) {
|
|
1477
1473
|
const p = F(h, c);
|
|
@@ -1479,16 +1475,16 @@ class Ct extends pI {
|
|
|
1479
1475
|
p ? h : $(h) && h.tagName === "P" ? h.firstChild : h,
|
|
1480
1476
|
p ? d : $(h) && h.tagName === "P" ? 0 : d,
|
|
1481
1477
|
c,
|
|
1482
|
-
|
|
1478
|
+
y,
|
|
1483
1479
|
!0
|
|
1484
1480
|
), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
|
|
1485
1481
|
return;
|
|
1486
1482
|
}
|
|
1487
|
-
R(h, d, M, M.childNodes.length, !0), S.forEach((p) => R(p, 0, p, p.childNodes.length)), R(G.firstChild, 0, c,
|
|
1483
|
+
R(h, d, M, M.childNodes.length, !0), S.forEach((p) => R(p, 0, p, p.childNodes.length)), R(G.firstChild, 0, c, y, !1), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
|
|
1488
1484
|
}
|
|
1489
1485
|
_isIntersectOtherAnchors() {
|
|
1490
1486
|
const { range: B } = this.editor.cursor;
|
|
1491
|
-
return Array.from(document.querySelectorAll(`.tag-${
|
|
1487
|
+
return Array.from(document.querySelectorAll(`.tag-${x.anchor}`)).some((o) => B == null ? void 0 : B.intersectsNode(o));
|
|
1492
1488
|
}
|
|
1493
1489
|
_calcTopValue(B) {
|
|
1494
1490
|
return B.top - this.editor.editorTop() + 16;
|
|
@@ -1497,15 +1493,15 @@ class Ct extends pI {
|
|
|
1497
1493
|
var R;
|
|
1498
1494
|
if (!($(B) && B.classList.contains(zg()))) return;
|
|
1499
1495
|
const t = B, o = Array.from(
|
|
1500
|
-
document.querySelectorAll(`.tag-${
|
|
1496
|
+
document.querySelectorAll(`.tag-${x.anchor}`)
|
|
1501
1497
|
), r = t.dataset.id, a = Number((R = t.dataset.id) == null ? void 0 : R.split("_")[1]), i = o.indexOf(t), h = this._calcTopValue(t.getBoundingClientRect()), d = [];
|
|
1502
1498
|
if (i < 0) return;
|
|
1503
1499
|
for (let F = i; F < o.length && r === o[F].dataset.id; F++)
|
|
1504
1500
|
d.push(o[F]);
|
|
1505
|
-
const
|
|
1501
|
+
const y = Object.values(this.data).flat().find((F) => F.id === a), D = String(Date.now()), u = { ...y, data: { ...y.data, uid: D } };
|
|
1506
1502
|
d.forEach((F) => {
|
|
1507
1503
|
F.dataset.uid = D, F.dataset.top = String(h);
|
|
1508
|
-
}), this._recordAnchor(u.data, u.id, h,
|
|
1504
|
+
}), this._recordAnchor(u.data, u.id, h, y.background);
|
|
1509
1505
|
}
|
|
1510
1506
|
_fixedAnchorOrder(B) {
|
|
1511
1507
|
const t = this.data[B.top], r = Array.from(document.querySelectorAll(`span[data-top="${B.top}"]`)).map((a) => [Number(a.dataset.id.split("_")[1]), a.dataset.uid]).reduce((a, i) => {
|
|
@@ -1526,7 +1522,7 @@ class Ct extends pI {
|
|
|
1526
1522
|
}
|
|
1527
1523
|
_fixedAnchorHighlightContent() {
|
|
1528
1524
|
Array.from(
|
|
1529
|
-
this.editor.element.querySelectorAll(`span[data-type="${
|
|
1525
|
+
this.editor.element.querySelectorAll(`span[data-type="${x.highlight}"]`)
|
|
1530
1526
|
).forEach((B) => {
|
|
1531
1527
|
B.dataset.raw = B.innerHTML;
|
|
1532
1528
|
});
|
|
@@ -1602,7 +1598,7 @@ const Bt = ["onClick"], Qt = /* @__PURE__ */ vA({
|
|
|
1602
1598
|
[LI, B.visible]
|
|
1603
1599
|
]);
|
|
1604
1600
|
}
|
|
1605
|
-
}), Et = /* @__PURE__ */ JA(Qt, [["__scopeId", "data-v-8471a3e1"]]), et = 0, pg =
|
|
1601
|
+
}), Et = /* @__PURE__ */ JA(Qt, [["__scopeId", "data-v-8471a3e1"]]), et = 0, pg = x.homophones, [NI] = II(pg), qB = NI("close"), { x: tt, y: ot } = HI(), nt = `<svg class="${qB}" width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
1606
1602
|
<g id="V1.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
1607
1603
|
<g id="虚拟精品录音间-读音替换" transform="translate(-1287, -152)" fill="currentColor" fill-rule="nonzero">
|
|
1608
1604
|
<g id="编组-4备份-4" transform="translate(1227, 149)">
|
|
@@ -1617,7 +1613,7 @@ const Bt = ["onClick"], Qt = /* @__PURE__ */ vA({
|
|
|
1617
1613
|
const r = document.createElement("span");
|
|
1618
1614
|
return Kg(
|
|
1619
1615
|
r,
|
|
1620
|
-
{ class:
|
|
1616
|
+
{ class: NI(), contenteditable: !1 },
|
|
1621
1617
|
{
|
|
1622
1618
|
type: pg,
|
|
1623
1619
|
id: `${pg}_${et}`,
|
|
@@ -1628,12 +1624,12 @@ const Bt = ["onClick"], Qt = /* @__PURE__ */ vA({
|
|
|
1628
1624
|
formattedData: o.join()
|
|
1629
1625
|
},
|
|
1630
1626
|
`
|
|
1631
|
-
<span class="${
|
|
1627
|
+
<span class="${NI("raw")}">${I}[${E}]</span>
|
|
1632
1628
|
${nt}
|
|
1633
1629
|
`
|
|
1634
1630
|
), r;
|
|
1635
1631
|
}, rt = (I, E) => {
|
|
1636
|
-
const B = SC(
|
|
1632
|
+
const B = SC(x.homophones), { word: t, data: o, onOK: r, onCancel: a } = E, i = (u, R) => {
|
|
1637
1633
|
r == null || r(u, R), d();
|
|
1638
1634
|
}, h = (u) => {
|
|
1639
1635
|
a == null || a(u), d();
|
|
@@ -1697,11 +1693,11 @@ class at extends pI {
|
|
|
1697
1693
|
return;
|
|
1698
1694
|
}
|
|
1699
1695
|
if (q(this.modalInstance)) {
|
|
1700
|
-
const d = (c,
|
|
1696
|
+
const d = (c, y) => {
|
|
1701
1697
|
var M, G;
|
|
1702
1698
|
if (q(this.modalInstance) || q(this.modalInstance.target)) return;
|
|
1703
|
-
const { target: D } = this.modalInstance, u = D.querySelector(`.${
|
|
1704
|
-
q(u) || q(R) || q(F) || (D.dataset.value =
|
|
1699
|
+
const { target: D } = this.modalInstance, u = D.querySelector(`.${NI("raw")}`), R = (M = D.dataset.data) == null ? void 0 : M.split(",").indexOf(y), F = (G = D.dataset.formattedData) == null ? void 0 : G.split(",");
|
|
1700
|
+
q(u) || q(R) || q(F) || (D.dataset.value = y, D.dataset.formattedValue = F[R], u.innerHTML = `${D.dataset.raw}[${y}]`);
|
|
1705
1701
|
};
|
|
1706
1702
|
this.modalInstance = rt(Et, {
|
|
1707
1703
|
word: r.dataset.raw,
|
|
@@ -1725,27 +1721,27 @@ class at extends pI {
|
|
|
1725
1721
|
var d;
|
|
1726
1722
|
let h = a;
|
|
1727
1723
|
for (let c = 0; c < r.length; c++) {
|
|
1728
|
-
const
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
].includes(D) ?
|
|
1724
|
+
const y = r[c], D = (d = y == null ? void 0 : y.dataset) == null ? void 0 : d.type, u = [
|
|
1725
|
+
x.pausation,
|
|
1726
|
+
x.pronunciation,
|
|
1727
|
+
x.homophones
|
|
1728
|
+
].includes(D) ? y.dataset.raw ?? "" : y.textContent ?? "", R = i.wordIndex - (h + 1);
|
|
1733
1729
|
if (R >= u.length) {
|
|
1734
1730
|
h += u.length;
|
|
1735
1731
|
continue;
|
|
1736
1732
|
}
|
|
1737
|
-
if ($(
|
|
1738
|
-
if ([
|
|
1739
|
-
if (
|
|
1740
|
-
this._calc(
|
|
1733
|
+
if ($(y)) {
|
|
1734
|
+
if ([x.pausation, x.pronunciation].includes(D)) return;
|
|
1735
|
+
if (x.homophones === D) {
|
|
1736
|
+
this._calc(y, R, i);
|
|
1741
1737
|
return;
|
|
1742
1738
|
}
|
|
1743
|
-
if (
|
|
1744
|
-
o(Array.from(
|
|
1739
|
+
if (x.anchor === D) {
|
|
1740
|
+
o(Array.from(y.childNodes), h, i);
|
|
1745
1741
|
return;
|
|
1746
1742
|
}
|
|
1747
1743
|
}
|
|
1748
|
-
this._calc(
|
|
1744
|
+
this._calc(y, R, i);
|
|
1749
1745
|
return;
|
|
1750
1746
|
}
|
|
1751
1747
|
};
|
|
@@ -1767,7 +1763,7 @@ class at extends pI {
|
|
|
1767
1763
|
);
|
|
1768
1764
|
a.selectNode(B), a.setStart(B, t), a.setEnd(B, t + 1), a.deleteContents(), a.insertNode(i), r == null || r.removeAllRanges(), r == null || r.addRange(a), this.editor.cursor.toEnd(i);
|
|
1769
1765
|
}
|
|
1770
|
-
$(B) && B.dataset.type ===
|
|
1766
|
+
$(B) && B.dataset.type === x.homophones && (B.dataset.value = o.modify, B.firstElementChild.innerHTML = `${o.word}[${o.modify}]`);
|
|
1771
1767
|
}
|
|
1772
1768
|
setup() {
|
|
1773
1769
|
}
|
|
@@ -1802,11 +1798,11 @@ const st = {
|
|
|
1802
1798
|
return Kg(
|
|
1803
1799
|
h,
|
|
1804
1800
|
{ class: yC },
|
|
1805
|
-
{ type:
|
|
1801
|
+
{ type: x.highlight, raw: i }
|
|
1806
1802
|
), h;
|
|
1807
1803
|
}, t = (i) => {
|
|
1808
1804
|
var c;
|
|
1809
|
-
return (((c = I.value) == null ? void 0 : c.content.getTextContent()) ?? []).reduce((
|
|
1805
|
+
return (((c = I.value) == null ? void 0 : c.content.getTextContent()) ?? []).reduce((y, D, u) => {
|
|
1810
1806
|
const R = [];
|
|
1811
1807
|
let F = 0;
|
|
1812
1808
|
for (; F !== -1; )
|
|
@@ -1816,7 +1812,7 @@ const st = {
|
|
|
1816
1812
|
paraIndex: u,
|
|
1817
1813
|
index: F
|
|
1818
1814
|
}), F += i.length);
|
|
1819
|
-
return
|
|
1815
|
+
return y.concat(R);
|
|
1820
1816
|
}, []);
|
|
1821
1817
|
}, o = (i, h, d) => {
|
|
1822
1818
|
var D;
|
|
@@ -1825,35 +1821,35 @@ const st = {
|
|
|
1825
1821
|
dynamicMatchingContent: h.matchingContent,
|
|
1826
1822
|
dynamicMatchingContentIndex: h.index,
|
|
1827
1823
|
restIndex: h.index
|
|
1828
|
-
},
|
|
1824
|
+
}, y = [];
|
|
1829
1825
|
for (let u = 0; u < i.length; u++) {
|
|
1830
|
-
if (!c.dynamicMatchingContent.length) return
|
|
1831
|
-
const R = i[u], F = (D = R == null ? void 0 : R.dataset) == null ? void 0 : D.type, M = [
|
|
1826
|
+
if (!c.dynamicMatchingContent.length) return y;
|
|
1827
|
+
const R = i[u], F = (D = R == null ? void 0 : R.dataset) == null ? void 0 : D.type, M = [x.pausation, x.homophones, x.highlight].includes(
|
|
1832
1828
|
F
|
|
1833
|
-
) ? R.dataset.raw ?? "" :
|
|
1829
|
+
) ? R.dataset.raw ?? "" : x.pronunciation === F ? R.dataset.value ?? "" : R.textContent ?? "";
|
|
1834
1830
|
if (c.restIndex = c.dynamicMatchingContentIndex - (c.accuSearchIndex + 1), c.restIndex >= M.length) {
|
|
1835
1831
|
c.accuSearchIndex += M.length;
|
|
1836
1832
|
continue;
|
|
1837
1833
|
}
|
|
1838
|
-
if (
|
|
1839
|
-
if (
|
|
1840
|
-
|
|
1834
|
+
if (x.pausation === F) continue;
|
|
1835
|
+
if (x.anchor === F) {
|
|
1836
|
+
y.push(...o(Array.from(R.childNodes), h, c));
|
|
1841
1837
|
continue;
|
|
1842
1838
|
}
|
|
1843
1839
|
let G, S;
|
|
1844
1840
|
switch (F) {
|
|
1845
|
-
case
|
|
1841
|
+
case x.pronunciation: {
|
|
1846
1842
|
G = R.querySelector(".tag-pronunciation__replace-text").childNodes[0], S = IC(
|
|
1847
1843
|
G.textContent,
|
|
1848
1844
|
c.dynamicMatchingContent
|
|
1849
1845
|
).length;
|
|
1850
1846
|
break;
|
|
1851
1847
|
}
|
|
1852
|
-
case
|
|
1848
|
+
case x.homophones: {
|
|
1853
1849
|
G = R.querySelector(".tag-homophones__raw").childNodes[0], S = 1;
|
|
1854
1850
|
break;
|
|
1855
1851
|
}
|
|
1856
|
-
case
|
|
1852
|
+
case x.highlight: {
|
|
1857
1853
|
G = R.childNodes[0], S = IC(
|
|
1858
1854
|
G.textContent,
|
|
1859
1855
|
c.dynamicMatchingContent
|
|
@@ -1868,7 +1864,7 @@ const st = {
|
|
|
1868
1864
|
break;
|
|
1869
1865
|
}
|
|
1870
1866
|
}
|
|
1871
|
-
|
|
1867
|
+
y.push({
|
|
1872
1868
|
content: h.matchingContent,
|
|
1873
1869
|
matchedContent: c.dynamicMatchingContent.slice(0, S),
|
|
1874
1870
|
node: G,
|
|
@@ -1876,24 +1872,24 @@ const st = {
|
|
|
1876
1872
|
endOffset: c.restIndex + S,
|
|
1877
1873
|
parentNodeType: F,
|
|
1878
1874
|
isPausationNode: !1,
|
|
1879
|
-
isPronunciationNode:
|
|
1880
|
-
isHomophoneNode:
|
|
1881
|
-
isHighlightNode:
|
|
1875
|
+
isPronunciationNode: x.pronunciation === F,
|
|
1876
|
+
isHomophoneNode: x.homophones === F,
|
|
1877
|
+
isHighlightNode: x.highlight === F,
|
|
1882
1878
|
isHighlight: ![
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1879
|
+
x.pronunciation,
|
|
1880
|
+
x.homophones,
|
|
1881
|
+
x.highlight
|
|
1886
1882
|
].includes(F)
|
|
1887
1883
|
}), c.accuSearchIndex = -1, c.dynamicMatchingContent = c.dynamicMatchingContent.slice(S), c.dynamicMatchingContentIndex = 0, c.restIndex = 0;
|
|
1888
1884
|
}
|
|
1889
|
-
return
|
|
1885
|
+
return y;
|
|
1890
1886
|
};
|
|
1891
1887
|
return {
|
|
1892
1888
|
renderHighlight: (i) => {
|
|
1893
1889
|
const h = (d) => {
|
|
1894
1890
|
var D;
|
|
1895
|
-
const c = ((D = I.value) == null ? void 0 : D.content.getParas()) ?? [],
|
|
1896
|
-
|
|
1891
|
+
const c = ((D = I.value) == null ? void 0 : D.content.getParas()) ?? [], y = o(Array.from(c[d.paraIndex].childNodes), d);
|
|
1892
|
+
y.some((u) => !u.isHighlight) || y.forEach((u) => {
|
|
1897
1893
|
const R = window.getSelection();
|
|
1898
1894
|
if (q(R)) return;
|
|
1899
1895
|
const F = document.createRange();
|
|
@@ -1907,8 +1903,8 @@ const st = {
|
|
|
1907
1903
|
Array.from(
|
|
1908
1904
|
((h = I.value) == null ? void 0 : h._editorElement.querySelectorAll(`.${yC}`)) ?? []
|
|
1909
1905
|
).forEach((d) => {
|
|
1910
|
-
const c = Array.from(d.childNodes),
|
|
1911
|
-
c.forEach((F) => R.appendChild(F)), d.replaceWith(R), lg(
|
|
1906
|
+
const c = Array.from(d.childNodes), y = c[0], D = c.length - 1, u = c[D] !== c[0] && HA(c[D]) ? c[D] : null, R = document.createDocumentFragment();
|
|
1907
|
+
c.forEach((F) => R.appendChild(F)), d.replaceWith(R), lg(y), u && lg(u);
|
|
1912
1908
|
});
|
|
1913
1909
|
}
|
|
1914
1910
|
};
|
|
@@ -2346,7 +2342,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2346
2342
|
return typeof __filename < "u" && (t || (t = __filename)), function(r = {}) {
|
|
2347
2343
|
var a, i = Object.assign({}, r), h, d, c = new Promise((A, g) => {
|
|
2348
2344
|
h = A, d = g;
|
|
2349
|
-
}),
|
|
2345
|
+
}), y = typeof window == "object", D = typeof importScripts == "function", u = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", R = Object.assign({}, i), F = "./this.program", M = (A, g) => {
|
|
2350
2346
|
throw g;
|
|
2351
2347
|
}, G = "", S, p, m;
|
|
2352
2348
|
if (u) {
|
|
@@ -2361,7 +2357,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2361
2357
|
}, !i.thisProgram && process.argv.length > 1 && (F = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), M = (A, g) => {
|
|
2362
2358
|
throw process.exitCode = A, g;
|
|
2363
2359
|
};
|
|
2364
|
-
} else (
|
|
2360
|
+
} else (y || D) && (D ? G = self.location.href : typeof document < "u" && document.currentScript && (G = document.currentScript.src), t && (G = t), G.startsWith("blob:") ? G = "" : G = G.substr(0, G.replace(/[?#].*/, "").lastIndexOf("/") + 1), S = (A) => {
|
|
2365
2361
|
var g = new XMLHttpRequest();
|
|
2366
2362
|
return g.open("GET", A, !1), g.send(null), g.responseText;
|
|
2367
2363
|
}, D && (m = (A) => {
|
|
@@ -2554,14 +2550,14 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2554
2550
|
EI[w] = g;
|
|
2555
2551
|
});
|
|
2556
2552
|
function Q(w) {
|
|
2557
|
-
var
|
|
2558
|
-
|
|
2559
|
-
for (var k = 0; k < A.length; ++k) Eg(A[k],
|
|
2553
|
+
var f = C(w);
|
|
2554
|
+
f.length !== A.length && eI("Mismatched type converter count");
|
|
2555
|
+
for (var k = 0; k < A.length; ++k) Eg(A[k], f[k]);
|
|
2560
2556
|
}
|
|
2561
2557
|
var n = new Array(g.length), s = [], l = 0;
|
|
2562
|
-
g.forEach((w,
|
|
2563
|
-
wg.hasOwnProperty(w) ? n[
|
|
2564
|
-
n[
|
|
2558
|
+
g.forEach((w, f) => {
|
|
2559
|
+
wg.hasOwnProperty(w) ? n[f] = wg[w] : (s.push(w), Fg.hasOwnProperty(w) || (Fg[w] = []), Fg[w].push(() => {
|
|
2560
|
+
n[f] = wg[w], ++l, l === s.length && Q(n);
|
|
2565
2561
|
}));
|
|
2566
2562
|
}), s.length === 0 && Q(n);
|
|
2567
2563
|
};
|
|
@@ -2642,8 +2638,8 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2642
2638
|
if (!l) return n.call(this);
|
|
2643
2639
|
var w;
|
|
2644
2640
|
this.isConst ? w = l.constPointerType : w = l.pointerType;
|
|
2645
|
-
var
|
|
2646
|
-
return
|
|
2641
|
+
var f = qC(g, this.registeredClass, w.registeredClass);
|
|
2642
|
+
return f === null ? n.call(this) : this.isSmartPointer ? tI(w.registeredClass.instancePrototype, { ptrType: w, ptr: f, smartPtrType: this, smartPtr: A }) : tI(w.registeredClass.instancePrototype, { ptrType: w, ptr: f });
|
|
2647
2643
|
}
|
|
2648
2644
|
var Wg = (A) => typeof FinalizationRegistry > "u" ? (Wg = (g) => g, A) : (qI = new FinalizationRegistry((g) => {
|
|
2649
2645
|
vC(g.$$);
|
|
@@ -2745,8 +2741,8 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2745
2741
|
(g = this.rawDestructor) == null || g.call(this, A);
|
|
2746
2742
|
}, argPackAdvance: og, readValueFromPointer: iI, fromWireType: cQ });
|
|
2747
2743
|
};
|
|
2748
|
-
function rI(A, g, C, Q, n, s, l, w,
|
|
2749
|
-
this.name = A, this.registeredClass = g, this.isReference = C, this.isConst = Q, this.isSmartPointer = n, this.pointeeType = s, this.sharingPolicy = l, this.rawGetPointee = w, this.rawConstructor =
|
|
2744
|
+
function rI(A, g, C, Q, n, s, l, w, f, k, Y) {
|
|
2745
|
+
this.name = A, this.registeredClass = g, this.isReference = C, this.isConst = Q, this.isSmartPointer = n, this.pointeeType = s, this.sharingPolicy = l, this.rawGetPointee = w, this.rawConstructor = f, this.rawShare = k, this.rawDestructor = Y, !n && g.baseClass === void 0 ? Q ? (this.toWireType = yQ, this.destructorFunction = null) : (this.toWireType = RQ, this.destructorFunction = null) : this.toWireType = fQ;
|
|
2750
2746
|
}
|
|
2751
2747
|
var NQ = (A, g, C) => {
|
|
2752
2748
|
i.hasOwnProperty(A) || eI("Replacing nonexistent public symbol"), i[A].overloadTable !== void 0 && C !== void 0 ? i[A].overloadTable[C] = g : (i[A] = g, i[A].argCount = C);
|
|
@@ -2790,8 +2786,8 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2790
2786
|
}
|
|
2791
2787
|
}
|
|
2792
2788
|
throw g.forEach(n), new bC(`${A}: ` + C.map(TC).join([", "]));
|
|
2793
|
-
}, UQ = (A, g, C, Q, n, s, l, w,
|
|
2794
|
-
Y = zA(Y), s = Dg(n, s), w && (w = Dg(l, w)), k && (k = Dg(
|
|
2789
|
+
}, UQ = (A, g, C, Q, n, s, l, w, f, k, Y, j, b) => {
|
|
2790
|
+
Y = zA(Y), s = Dg(n, s), w && (w = Dg(l, w)), k && (k = Dg(f, k)), b = Dg(j, b);
|
|
2795
2791
|
var V = DQ(Y);
|
|
2796
2792
|
dQ(V, function() {
|
|
2797
2793
|
aI(`Cannot construct ${Y} due to unbound types`, [Q]);
|
|
@@ -2808,7 +2804,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2808
2804
|
return iB.apply(this, AC);
|
|
2809
2805
|
}), L = Object.create(FA, { constructor: { value: LA } });
|
|
2810
2806
|
LA.prototype = L;
|
|
2811
|
-
var T = new uQ(Y, LA, L,
|
|
2807
|
+
var T = new uQ(Y, LA, L, b, hA, s, w, k);
|
|
2812
2808
|
T.baseClass && ((NA = T.baseClass).__derivedClasses ?? (NA.__derivedClasses = []), T.baseClass.__derivedClasses.push(T));
|
|
2813
2809
|
var UA = new rI(Y, T, !0, !1, !1), sA = new rI(Y + "*", T, !1, !1, !1), VA = new rI(Y + " const*", T, !1, !0, !1);
|
|
2814
2810
|
return xC[A] = { pointerType: sA, constPointerType: VA }, NQ(V, LA), [UA, sA, VA];
|
|
@@ -2832,7 +2828,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2832
2828
|
return n instanceof Object ? n : Q;
|
|
2833
2829
|
}
|
|
2834
2830
|
function JQ(A, g, C, Q) {
|
|
2835
|
-
for (var n = PC(A), s = A.length, l = "", w = "",
|
|
2831
|
+
for (var n = PC(A), s = A.length, l = "", w = "", f = 0; f < s - 2; ++f) l += (f !== 0 ? ", " : "") + "arg" + f, w += (f !== 0 ? ", " : "") + "arg" + f + "Wired";
|
|
2836
2832
|
var k = `
|
|
2837
2833
|
return function (${l}) {
|
|
2838
2834
|
if (arguments.length !== ${s - 2}) {
|
|
@@ -2843,15 +2839,15 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
|
|
|
2843
2839
|
var Y = n ? "destructors" : "null", j = ["humanName", "throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"];
|
|
2844
2840
|
g && (k += "var thisWired = classParam['toWireType'](" + Y + `, this);
|
|
2845
2841
|
`);
|
|
2846
|
-
for (var
|
|
2847
|
-
`, j.push("argType" +
|
|
2842
|
+
for (var f = 0; f < s - 2; ++f) k += "var arg" + f + "Wired = argType" + f + "['toWireType'](" + Y + ", arg" + f + `);
|
|
2843
|
+
`, j.push("argType" + f);
|
|
2848
2844
|
if (g && (w = "thisWired" + (w.length > 0 ? ", " : "") + w), k += (C || Q ? "var rv = " : "") + "invoker(fn" + (w.length > 0 ? ", " : "") + w + `);
|
|
2849
2845
|
`, n) k += `runDestructors(destructors);
|
|
2850
2846
|
`;
|
|
2851
|
-
else for (var
|
|
2852
|
-
var
|
|
2853
|
-
A[
|
|
2854
|
-
`, j.push(`${
|
|
2847
|
+
else for (var f = g ? 1 : 2; f < A.length; ++f) {
|
|
2848
|
+
var b = f === 1 ? "thisWired" : "arg" + (f - 2) + "Wired";
|
|
2849
|
+
A[f].destructorFunction !== null && (k += `${b}_dtor(${b});
|
|
2850
|
+
`, j.push(`${b}_dtor`));
|
|
2855
2851
|
}
|
|
2856
2852
|
return C && (k += `var ret = retType['fromWireType'](rv);
|
|
2857
2853
|
return ret;
|
|
@@ -2861,11 +2857,11 @@ return ret;
|
|
|
2861
2857
|
function PI(A, g, C, Q, n, s) {
|
|
2862
2858
|
var l = g.length;
|
|
2863
2859
|
l < 2 && oA("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
2864
|
-
for (var w = g[1] !== null && C !== null,
|
|
2865
|
-
if (!
|
|
2866
|
-
let [
|
|
2867
|
-
|
|
2868
|
-
var _ = pQ(Function,
|
|
2860
|
+
for (var w = g[1] !== null && C !== null, f = PC(g), k = g[0].name !== "void", Y = [A, oA, Q, n, MQ, g[0], g[1]], j = 0; j < l - 2; ++j) Y.push(g[j + 2]);
|
|
2861
|
+
if (!f) for (var j = w ? 1 : 2; j < g.length; ++j) g[j].destructorFunction !== null && Y.push(g[j].destructorFunction);
|
|
2862
|
+
let [b, V] = JQ(g, w, k, s);
|
|
2863
|
+
b.push(V);
|
|
2864
|
+
var _ = pQ(Function, b)(...Y);
|
|
2869
2865
|
return nI(A, _);
|
|
2870
2866
|
}
|
|
2871
2867
|
var jI = (A, g) => {
|
|
@@ -2876,18 +2872,18 @@ return ret;
|
|
|
2876
2872
|
let g = A.indexOf("(");
|
|
2877
2873
|
return g !== -1 ? A.substr(0, g) : A;
|
|
2878
2874
|
}, YQ = (A, g, C, Q, n, s, l, w) => {
|
|
2879
|
-
var
|
|
2875
|
+
var f = jI(C, Q);
|
|
2880
2876
|
g = zA(g), g = jC(g), s = Dg(n, s), hg([], [A], (k) => {
|
|
2881
2877
|
k = k[0];
|
|
2882
2878
|
var Y = `${k.name}.${g}`;
|
|
2883
2879
|
function j() {
|
|
2884
|
-
aI(`Cannot call ${Y} due to unbound types`,
|
|
2880
|
+
aI(`Cannot call ${Y} due to unbound types`, f);
|
|
2885
2881
|
}
|
|
2886
2882
|
g.startsWith("@@") && (g = Symbol[g.substring(2)]);
|
|
2887
|
-
var
|
|
2888
|
-
return
|
|
2883
|
+
var b = k.registeredClass.constructor;
|
|
2884
|
+
return b[g] === void 0 ? (j.argCount = C - 1, b[g] = j) : (bI(b, g, Y), b[g].overloadTable[C - 1] = j), hg([], f, (V) => {
|
|
2889
2885
|
var _ = [V[0], null].concat(V.slice(1)), hA = PI(Y, _, null, s, l, w);
|
|
2890
|
-
if (
|
|
2886
|
+
if (b[g].overloadTable === void 0 ? (hA.argCount = C - 1, b[g] = hA) : b[g].overloadTable[C - 1] = hA, k.registeredClass.__derivedClasses) for (let FA of k.registeredClass.__derivedClasses) FA.constructor.hasOwnProperty(g) || (FA.constructor[g] = hA);
|
|
2891
2887
|
return [];
|
|
2892
2888
|
}), [];
|
|
2893
2889
|
});
|
|
@@ -2895,24 +2891,24 @@ return ret;
|
|
|
2895
2891
|
var l = jI(g, C);
|
|
2896
2892
|
n = Dg(Q, n), hg([], [A], (w) => {
|
|
2897
2893
|
w = w[0];
|
|
2898
|
-
var
|
|
2894
|
+
var f = `constructor ${w.name}`;
|
|
2899
2895
|
if (w.registeredClass.constructor_body === void 0 && (w.registeredClass.constructor_body = []), w.registeredClass.constructor_body[g - 1] !== void 0) throw new Ng(`Cannot register multiple constructors with identical number of parameters (${g - 1}) for class '${w.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
2900
2896
|
return w.registeredClass.constructor_body[g - 1] = () => {
|
|
2901
2897
|
aI(`Cannot construct ${w.name} due to unbound types`, l);
|
|
2902
|
-
}, hg([], l, (k) => (k.splice(1, 0, null), w.registeredClass.constructor_body[g - 1] = PI(
|
|
2898
|
+
}, hg([], l, (k) => (k.splice(1, 0, null), w.registeredClass.constructor_body[g - 1] = PI(f, k, null, n, s), [])), [];
|
|
2903
2899
|
});
|
|
2904
|
-
}, mQ = (A, g, C, Q, n, s, l, w,
|
|
2900
|
+
}, mQ = (A, g, C, Q, n, s, l, w, f) => {
|
|
2905
2901
|
var k = jI(C, Q);
|
|
2906
2902
|
g = zA(g), g = jC(g), s = Dg(n, s), hg([], [A], (Y) => {
|
|
2907
2903
|
Y = Y[0];
|
|
2908
2904
|
var j = `${Y.name}.${g}`;
|
|
2909
2905
|
g.startsWith("@@") && (g = Symbol[g.substring(2)]), w && Y.registeredClass.pureVirtualFunctions.push(g);
|
|
2910
|
-
function
|
|
2906
|
+
function b() {
|
|
2911
2907
|
aI(`Cannot call ${j} due to unbound types`, k);
|
|
2912
2908
|
}
|
|
2913
2909
|
var V = Y.registeredClass.instancePrototype, _ = V[g];
|
|
2914
|
-
return _ === void 0 || _.overloadTable === void 0 && _.className !== Y.name && _.argCount === C - 2 ? (
|
|
2915
|
-
var FA = PI(j, hA, Y, s, l,
|
|
2910
|
+
return _ === void 0 || _.overloadTable === void 0 && _.className !== Y.name && _.argCount === C - 2 ? (b.argCount = C - 2, b.className = Y.name, V[g] = b) : (bI(V, g, j), V[g].overloadTable[C - 2] = b), hg([], k, (hA) => {
|
|
2911
|
+
var FA = PI(j, hA, Y, s, l, f);
|
|
2916
2912
|
return V[g].overloadTable === void 0 ? (FA.argCount = C - 2, V[g] = FA) : V[g].overloadTable[C - 2] = FA, [];
|
|
2917
2913
|
}), [];
|
|
2918
2914
|
});
|
|
@@ -2975,18 +2971,18 @@ return ret;
|
|
|
2975
2971
|
var l = 32 - 8 * C;
|
|
2976
2972
|
s = (Y) => Y << l >>> l;
|
|
2977
2973
|
}
|
|
2978
|
-
var w = g.includes("unsigned"),
|
|
2974
|
+
var w = g.includes("unsigned"), f = (Y, j) => {
|
|
2979
2975
|
}, k;
|
|
2980
2976
|
w ? k = function(Y, j) {
|
|
2981
|
-
return
|
|
2977
|
+
return f(j, this.name), j >>> 0;
|
|
2982
2978
|
} : k = function(Y, j) {
|
|
2983
|
-
return
|
|
2979
|
+
return f(j, this.name), j;
|
|
2984
2980
|
}, Eg(A, { name: g, fromWireType: s, toWireType: k, argPackAdvance: og, readValueFromPointer: PQ(g, C, Q !== 0), destructorFunction: null });
|
|
2985
2981
|
}, WQ = (A, g, C) => {
|
|
2986
2982
|
var Q = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], n = Q[g];
|
|
2987
2983
|
function s(l) {
|
|
2988
|
-
var w = H[l >> 2],
|
|
2989
|
-
return new n(U.buffer,
|
|
2984
|
+
var w = H[l >> 2], f = H[l + 4 >> 2];
|
|
2985
|
+
return new n(U.buffer, f, w);
|
|
2990
2986
|
}
|
|
2991
2987
|
C = zA(C), Eg(A, { name: C, fromWireType: s, argPackAdvance: og, readValueFromPointer: s }, { ignoreDuplicateRegistrations: !0 });
|
|
2992
2988
|
}, VQ = (A, g) => {
|
|
@@ -2996,8 +2992,8 @@ return ret;
|
|
|
2996
2992
|
for (var n = C, s = C + Q - 1, l = 0; l < A.length; ++l) {
|
|
2997
2993
|
var w = A.charCodeAt(l);
|
|
2998
2994
|
if (w >= 55296 && w <= 57343) {
|
|
2999
|
-
var
|
|
3000
|
-
w = 65536 + ((w & 1023) << 10) |
|
|
2995
|
+
var f = A.charCodeAt(++l);
|
|
2996
|
+
w = 65536 + ((w & 1023) << 10) | f & 1023;
|
|
3001
2997
|
}
|
|
3002
2998
|
if (w <= 127) {
|
|
3003
2999
|
if (C >= s) break;
|
|
@@ -3034,8 +3030,8 @@ return ret;
|
|
|
3034
3030
|
s += String.fromCharCode((l & 31) << 6 | w);
|
|
3035
3031
|
continue;
|
|
3036
3032
|
}
|
|
3037
|
-
var
|
|
3038
|
-
if ((l & 240) == 224 ? l = (l & 15) << 12 | w << 6 |
|
|
3033
|
+
var f = A[g++] & 63;
|
|
3034
|
+
if ((l & 240) == 224 ? l = (l & 15) << 12 | w << 6 | f : l = (l & 7) << 18 | w << 12 | f << 6 | A[g++] & 63, l < 65536) s += String.fromCharCode(l);
|
|
3039
3035
|
else {
|
|
3040
3036
|
var k = l - 65536;
|
|
3041
3037
|
s += String.fromCharCode(55296 | k >> 10, 56320 | k & 1023);
|
|
@@ -3047,29 +3043,29 @@ return ret;
|
|
|
3047
3043
|
var C = g === "std::string";
|
|
3048
3044
|
Eg(A, { name: g, fromWireType(Q) {
|
|
3049
3045
|
var n = H[Q >> 2], s = Q + 4, l;
|
|
3050
|
-
if (C) for (var w = s,
|
|
3051
|
-
var k = s +
|
|
3052
|
-
if (
|
|
3046
|
+
if (C) for (var w = s, f = 0; f <= n; ++f) {
|
|
3047
|
+
var k = s + f;
|
|
3048
|
+
if (f == n || v[k] == 0) {
|
|
3053
3049
|
var Y = k - w, j = cI(w, Y);
|
|
3054
3050
|
l === void 0 ? l = j : (l += "\0", l += j), w = k + 1;
|
|
3055
3051
|
}
|
|
3056
3052
|
}
|
|
3057
3053
|
else {
|
|
3058
|
-
for (var
|
|
3059
|
-
l =
|
|
3054
|
+
for (var b = new Array(n), f = 0; f < n; ++f) b[f] = String.fromCharCode(v[s + f]);
|
|
3055
|
+
l = b.join("");
|
|
3060
3056
|
}
|
|
3061
3057
|
return tg(Q), l;
|
|
3062
3058
|
}, toWireType(Q, n) {
|
|
3063
3059
|
n instanceof ArrayBuffer && (n = new Uint8Array(n));
|
|
3064
3060
|
var s, l = typeof n == "string";
|
|
3065
3061
|
l || n instanceof Uint8Array || n instanceof Uint8ClampedArray || n instanceof Int8Array || oA("Cannot pass non-string to std::string"), C && l ? s = XI(n) : s = n.length;
|
|
3066
|
-
var w = $I(4 + s + 1),
|
|
3067
|
-
if (H[w >> 2] = s, C && l) VC(n,
|
|
3062
|
+
var w = $I(4 + s + 1), f = w + 4;
|
|
3063
|
+
if (H[w >> 2] = s, C && l) VC(n, f, s + 1);
|
|
3068
3064
|
else if (l) for (var k = 0; k < s; ++k) {
|
|
3069
3065
|
var Y = n.charCodeAt(k);
|
|
3070
|
-
Y > 255 && (tg(
|
|
3066
|
+
Y > 255 && (tg(f), oA("String has UTF-16 code units that do not fit in 8 bits")), v[f + k] = Y;
|
|
3071
3067
|
}
|
|
3072
|
-
else for (var k = 0; k < s; ++k) v[
|
|
3068
|
+
else for (var k = 0; k < s; ++k) v[f + k] = n[k];
|
|
3073
3069
|
return Q !== null && Q.push(tg, w), w;
|
|
3074
3070
|
}, argPackAdvance: og, readValueFromPointer: iI, destructorFunction(Q) {
|
|
3075
3071
|
tg(Q);
|
|
@@ -3122,18 +3118,18 @@ return ret;
|
|
|
3122
3118
|
C = zA(C);
|
|
3123
3119
|
var Q, n, s, l;
|
|
3124
3120
|
g === 2 ? (Q = XQ, n = zQ, l = ZQ, s = (w) => z[w >> 1]) : g === 4 && (Q = _Q, n = $Q, l = AE, s = (w) => H[w >> 2]), Eg(A, { name: C, fromWireType: (w) => {
|
|
3125
|
-
for (var
|
|
3126
|
-
var
|
|
3127
|
-
if (j ==
|
|
3128
|
-
var V =
|
|
3129
|
-
k === void 0 ? k = _ : (k += "\0", k += _), Y =
|
|
3121
|
+
for (var f = H[w >> 2], k, Y = w + 4, j = 0; j <= f; ++j) {
|
|
3122
|
+
var b = w + 4 + j * g;
|
|
3123
|
+
if (j == f || s(b) == 0) {
|
|
3124
|
+
var V = b - Y, _ = Q(Y, V);
|
|
3125
|
+
k === void 0 ? k = _ : (k += "\0", k += _), Y = b + g;
|
|
3130
3126
|
}
|
|
3131
3127
|
}
|
|
3132
3128
|
return tg(w), k;
|
|
3133
|
-
}, toWireType: (w,
|
|
3134
|
-
typeof
|
|
3135
|
-
var k = l(
|
|
3136
|
-
return H[Y >> 2] = k / g, n(
|
|
3129
|
+
}, toWireType: (w, f) => {
|
|
3130
|
+
typeof f != "string" && oA(`Cannot pass non-string to C++ string type ${C}`);
|
|
3131
|
+
var k = l(f), Y = $I(4 + k + g);
|
|
3132
|
+
return H[Y >> 2] = k / g, n(f, Y + 4, k + g), w !== null && w.push(tg, Y), Y;
|
|
3137
3133
|
}, argPackAdvance: og, readValueFromPointer: iI, destructorFunction(w) {
|
|
3138
3134
|
tg(w);
|
|
3139
3135
|
} });
|
|
@@ -3257,8 +3253,8 @@ return ret;
|
|
|
3257
3253
|
l = w;
|
|
3258
3254
|
break;
|
|
3259
3255
|
}
|
|
3260
|
-
for (var
|
|
3261
|
-
return
|
|
3256
|
+
for (var f = [], w = l; w < Q.length; w++) f.push("..");
|
|
3257
|
+
return f = f.concat(n.slice(l)), f.join("/");
|
|
3262
3258
|
} }, ZI = [];
|
|
3263
3259
|
function lI(A, g, C) {
|
|
3264
3260
|
var Q = XI(A) + 1, n = new Array(Q), s = OI(A, n, 0, n.length);
|
|
@@ -3446,15 +3442,15 @@ return ret;
|
|
|
3446
3442
|
return RE.forEach((s) => {
|
|
3447
3443
|
n || s.canHandle(g) && (s.handle(A, g, C, Q), n = !0);
|
|
3448
3444
|
}), n;
|
|
3449
|
-
}, NE = (A, g, C, Q, n, s, l, w,
|
|
3445
|
+
}, NE = (A, g, C, Q, n, s, l, w, f, k) => {
|
|
3450
3446
|
var Y = g ? eg.resolve(lA.join2(A, g)) : A;
|
|
3451
|
-
function j(
|
|
3447
|
+
function j(b) {
|
|
3452
3448
|
function V(_) {
|
|
3453
|
-
k == null || k(), w || fE(A, g, _, Q, n,
|
|
3449
|
+
k == null || k(), w || fE(A, g, _, Q, n, f), s == null || s(), Cg();
|
|
3454
3450
|
}
|
|
3455
|
-
FE(
|
|
3451
|
+
FE(b, Y, V, () => {
|
|
3456
3452
|
l == null || l(), Cg();
|
|
3457
|
-
}) || V(
|
|
3453
|
+
}) || V(b);
|
|
3458
3454
|
}
|
|
3459
3455
|
_A(), typeof C == "string" ? yE(C, j, l) : j(C);
|
|
3460
3456
|
}, GE = (A) => {
|
|
@@ -3528,11 +3524,11 @@ return ret;
|
|
|
3528
3524
|
for (var Q = A.split("/").filter((j) => !!j), n = e.root, s = "/", l = 0; l < Q.length; l++) {
|
|
3529
3525
|
var w = l === Q.length - 1;
|
|
3530
3526
|
if (w && g.parent) break;
|
|
3531
|
-
if (n = e.lookupNode(n, Q[l]), s = lA.join2(s, Q[l]), e.isMountpoint(n) && (!w || w && g.follow_mount) && (n = n.mounted.root), !w || g.follow) for (var
|
|
3527
|
+
if (n = e.lookupNode(n, Q[l]), s = lA.join2(s, Q[l]), e.isMountpoint(n) && (!w || w && g.follow_mount) && (n = n.mounted.root), !w || g.follow) for (var f = 0; e.isLink(n.mode); ) {
|
|
3532
3528
|
var k = e.readlink(s);
|
|
3533
3529
|
s = eg.resolve(lA.dirname(s), k);
|
|
3534
3530
|
var Y = e.lookupPath(s, { recurse_count: g.recurse_count + 1 });
|
|
3535
|
-
if (n = Y.node,
|
|
3531
|
+
if (n = Y.node, f++ > 40) throw new e.ErrnoError(32);
|
|
3536
3532
|
}
|
|
3537
3533
|
}
|
|
3538
3534
|
return { path: s, node: n };
|
|
@@ -3674,16 +3670,16 @@ return ret;
|
|
|
3674
3670
|
if (C = l.path, s = l.node, e.isMountpoint(s)) throw new e.ErrnoError(10);
|
|
3675
3671
|
if (!e.isDir(s.mode)) throw new e.ErrnoError(54);
|
|
3676
3672
|
}
|
|
3677
|
-
var w = { type: A, opts: g, mountpoint: C, mounts: [] },
|
|
3678
|
-
return
|
|
3673
|
+
var w = { type: A, opts: g, mountpoint: C, mounts: [] }, f = A.mount(w);
|
|
3674
|
+
return f.mount = w, w.root = f, Q ? e.root = f : s && (s.mounted = w, s.mount && s.mount.mounts.push(w)), f;
|
|
3679
3675
|
}, unmount(A) {
|
|
3680
3676
|
var g = e.lookupPath(A, { follow_mount: !1 });
|
|
3681
3677
|
if (!e.isMountpoint(g.node)) throw new e.ErrnoError(28);
|
|
3682
3678
|
var C = g.node, Q = C.mounted, n = e.getMounts(Q);
|
|
3683
3679
|
Object.keys(e.nameTable).forEach((l) => {
|
|
3684
3680
|
for (var w = e.nameTable[l]; w; ) {
|
|
3685
|
-
var
|
|
3686
|
-
n.includes(w.mount) && e.destroyNode(w), w =
|
|
3681
|
+
var f = w.name_next;
|
|
3682
|
+
n.includes(w.mount) && e.destroyNode(w), w = f;
|
|
3687
3683
|
}
|
|
3688
3684
|
}), C.mounted = null;
|
|
3689
3685
|
var s = C.mount.mounts.indexOf(Q);
|
|
@@ -3721,27 +3717,27 @@ return ret;
|
|
|
3721
3717
|
if (!Q.node_ops.symlink) throw new e.ErrnoError(63);
|
|
3722
3718
|
return Q.node_ops.symlink(Q, n, A);
|
|
3723
3719
|
}, rename(A, g) {
|
|
3724
|
-
var C = lA.dirname(A), Q = lA.dirname(g), n = lA.basename(A), s = lA.basename(g), l, w,
|
|
3725
|
-
if (l = e.lookupPath(A, { parent: !0 }), w = l.node, l = e.lookupPath(g, { parent: !0 }),
|
|
3726
|
-
if (w.mount !==
|
|
3720
|
+
var C = lA.dirname(A), Q = lA.dirname(g), n = lA.basename(A), s = lA.basename(g), l, w, f;
|
|
3721
|
+
if (l = e.lookupPath(A, { parent: !0 }), w = l.node, l = e.lookupPath(g, { parent: !0 }), f = l.node, !w || !f) throw new e.ErrnoError(44);
|
|
3722
|
+
if (w.mount !== f.mount) throw new e.ErrnoError(75);
|
|
3727
3723
|
var k = e.lookupNode(w, n), Y = eg.relative(A, Q);
|
|
3728
3724
|
if (Y.charAt(0) !== ".") throw new e.ErrnoError(28);
|
|
3729
3725
|
if (Y = eg.relative(g, C), Y.charAt(0) !== ".") throw new e.ErrnoError(55);
|
|
3730
3726
|
var j;
|
|
3731
3727
|
try {
|
|
3732
|
-
j = e.lookupNode(
|
|
3728
|
+
j = e.lookupNode(f, s);
|
|
3733
3729
|
} catch {
|
|
3734
3730
|
}
|
|
3735
3731
|
if (k !== j) {
|
|
3736
|
-
var
|
|
3732
|
+
var b = e.isDir(k.mode), V = e.mayDelete(w, n, b);
|
|
3737
3733
|
if (V) throw new e.ErrnoError(V);
|
|
3738
|
-
if (V = j ? e.mayDelete(
|
|
3734
|
+
if (V = j ? e.mayDelete(f, s, b) : e.mayCreate(f, s), V) throw new e.ErrnoError(V);
|
|
3739
3735
|
if (!w.node_ops.rename) throw new e.ErrnoError(63);
|
|
3740
3736
|
if (e.isMountpoint(k) || j && e.isMountpoint(j)) throw new e.ErrnoError(10);
|
|
3741
|
-
if (
|
|
3737
|
+
if (f !== w && (V = e.nodePermissions(w, "w"), V)) throw new e.ErrnoError(V);
|
|
3742
3738
|
e.hashRemoveNode(k);
|
|
3743
3739
|
try {
|
|
3744
|
-
w.node_ops.rename(k,
|
|
3740
|
+
w.node_ops.rename(k, f, s);
|
|
3745
3741
|
} catch (_) {
|
|
3746
3742
|
throw _;
|
|
3747
3743
|
} finally {
|
|
@@ -3995,15 +3991,15 @@ return ret;
|
|
|
3995
3991
|
}, createDataFile(A, g, C, Q, n, s) {
|
|
3996
3992
|
var l = g;
|
|
3997
3993
|
A && (A = typeof A == "string" ? A : e.getPath(A), l = g ? lA.join2(A, g) : A);
|
|
3998
|
-
var w = _I(Q, n),
|
|
3994
|
+
var w = _I(Q, n), f = e.create(l, w);
|
|
3999
3995
|
if (C) {
|
|
4000
3996
|
if (typeof C == "string") {
|
|
4001
3997
|
for (var k = new Array(C.length), Y = 0, j = C.length; Y < j; ++Y) k[Y] = C.charCodeAt(Y);
|
|
4002
3998
|
C = k;
|
|
4003
3999
|
}
|
|
4004
|
-
e.chmod(
|
|
4005
|
-
var
|
|
4006
|
-
e.write(
|
|
4000
|
+
e.chmod(f, w | 146);
|
|
4001
|
+
var b = e.open(f, 577);
|
|
4002
|
+
e.write(b, C, 0, C.length, 0, s), e.close(b), e.chmod(f, w);
|
|
4007
4003
|
}
|
|
4008
4004
|
}, createDevice(A, g, C, Q) {
|
|
4009
4005
|
var n = lA.join2(typeof A == "string" ? A : e.getPath(A), g), s = _I(!!C, !!Q);
|
|
@@ -4012,28 +4008,28 @@ return ret;
|
|
|
4012
4008
|
return e.registerDevice(l, { open(w) {
|
|
4013
4009
|
w.seekable = !1;
|
|
4014
4010
|
}, close(w) {
|
|
4015
|
-
var
|
|
4016
|
-
(
|
|
4017
|
-
}, read(w,
|
|
4018
|
-
for (var
|
|
4011
|
+
var f;
|
|
4012
|
+
(f = Q == null ? void 0 : Q.buffer) != null && f.length && Q(10);
|
|
4013
|
+
}, read(w, f, k, Y, j) {
|
|
4014
|
+
for (var b = 0, V = 0; V < Y; V++) {
|
|
4019
4015
|
var _;
|
|
4020
4016
|
try {
|
|
4021
4017
|
_ = C();
|
|
4022
4018
|
} catch {
|
|
4023
4019
|
throw new e.ErrnoError(29);
|
|
4024
4020
|
}
|
|
4025
|
-
if (_ === void 0 &&
|
|
4021
|
+
if (_ === void 0 && b === 0) throw new e.ErrnoError(6);
|
|
4026
4022
|
if (_ == null) break;
|
|
4027
|
-
|
|
4023
|
+
b++, f[k + V] = _;
|
|
4028
4024
|
}
|
|
4029
|
-
return
|
|
4030
|
-
}, write(w,
|
|
4031
|
-
for (var
|
|
4032
|
-
Q(
|
|
4025
|
+
return b && (w.node.timestamp = Date.now()), b;
|
|
4026
|
+
}, write(w, f, k, Y, j) {
|
|
4027
|
+
for (var b = 0; b < Y; b++) try {
|
|
4028
|
+
Q(f[k + b]);
|
|
4033
4029
|
} catch {
|
|
4034
4030
|
throw new e.ErrnoError(29);
|
|
4035
4031
|
}
|
|
4036
|
-
return Y && (w.node.timestamp = Date.now()),
|
|
4032
|
+
return Y && (w.node.timestamp = Date.now()), b;
|
|
4037
4033
|
} }), e.mkdev(n, s, l);
|
|
4038
4034
|
}, forceLoadFile(A) {
|
|
4039
4035
|
if (A.isDevice || A.isFolder || A.link || A.contents) return !0;
|
|
@@ -4087,29 +4083,29 @@ return ret;
|
|
|
4087
4083
|
if (!D) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
|
|
4088
4084
|
var l = new s(), w = { isDevice: !1, contents: l };
|
|
4089
4085
|
} else var w = { isDevice: !1, url: C };
|
|
4090
|
-
var
|
|
4091
|
-
w.contents ?
|
|
4086
|
+
var f = e.createFile(A, g, w, Q, n);
|
|
4087
|
+
w.contents ? f.contents = w.contents : w.url && (f.contents = null, f.url = w.url), Object.defineProperties(f, { usedBytes: { get: function() {
|
|
4092
4088
|
return this.contents.length;
|
|
4093
4089
|
} } });
|
|
4094
|
-
var k = {}, Y = Object.keys(
|
|
4095
|
-
Y.forEach((
|
|
4096
|
-
var V =
|
|
4097
|
-
k[
|
|
4090
|
+
var k = {}, Y = Object.keys(f.stream_ops);
|
|
4091
|
+
Y.forEach((b) => {
|
|
4092
|
+
var V = f.stream_ops[b];
|
|
4093
|
+
k[b] = (..._) => (e.forceLoadFile(f), V(..._));
|
|
4098
4094
|
});
|
|
4099
|
-
function j(
|
|
4100
|
-
var LA =
|
|
4095
|
+
function j(b, V, _, hA, FA) {
|
|
4096
|
+
var LA = b.node.contents;
|
|
4101
4097
|
if (FA >= LA.length) return 0;
|
|
4102
4098
|
var L = Math.min(LA.length - FA, hA);
|
|
4103
4099
|
if (LA.slice) for (var T = 0; T < L; T++) V[_ + T] = LA[FA + T];
|
|
4104
4100
|
else for (var T = 0; T < L; T++) V[_ + T] = LA.get(FA + T);
|
|
4105
4101
|
return L;
|
|
4106
4102
|
}
|
|
4107
|
-
return k.read = (
|
|
4108
|
-
e.forceLoadFile(
|
|
4103
|
+
return k.read = (b, V, _, hA, FA) => (e.forceLoadFile(f), j(b, V, _, hA, FA)), k.mmap = (b, V, _, hA, FA) => {
|
|
4104
|
+
e.forceLoadFile(f);
|
|
4109
4105
|
var LA = CB(V);
|
|
4110
4106
|
if (!LA) throw new e.ErrnoError(48);
|
|
4111
|
-
return j(
|
|
4112
|
-
},
|
|
4107
|
+
return j(b, U, LA, V, _), { ptr: LA, allocated: !0 };
|
|
4108
|
+
}, f.stream_ops = k, f;
|
|
4113
4109
|
} }, Xg = { DEFAULT_POLLMASK: 5, calculateAt(A, g, C) {
|
|
4114
4110
|
if (lA.isAbs(g)) return g;
|
|
4115
4111
|
var Q;
|
|
@@ -4153,9 +4149,9 @@ return ret;
|
|
|
4153
4149
|
for (var n = 0, s = 0; s < C; s++) {
|
|
4154
4150
|
var l = H[g >> 2], w = H[g + 4 >> 2];
|
|
4155
4151
|
g += 8;
|
|
4156
|
-
var
|
|
4157
|
-
if (
|
|
4158
|
-
if (n +=
|
|
4152
|
+
var f = e.read(A, U, l, w, Q);
|
|
4153
|
+
if (f < 0) return -1;
|
|
4154
|
+
if (n += f, f < w) break;
|
|
4159
4155
|
}
|
|
4160
4156
|
return n;
|
|
4161
4157
|
};
|
|
@@ -4184,9 +4180,9 @@ return ret;
|
|
|
4184
4180
|
for (var n = 0, s = 0; s < C; s++) {
|
|
4185
4181
|
var l = H[g >> 2], w = H[g + 4 >> 2];
|
|
4186
4182
|
g += 8;
|
|
4187
|
-
var
|
|
4188
|
-
if (
|
|
4189
|
-
n +=
|
|
4183
|
+
var f = e.write(A, U, l, w, Q);
|
|
4184
|
+
if (f < 0) return -1;
|
|
4185
|
+
n += f;
|
|
4190
4186
|
}
|
|
4191
4187
|
return n;
|
|
4192
4188
|
};
|
|
@@ -4213,13 +4209,13 @@ return ret;
|
|
|
4213
4209
|
U.set(A, g);
|
|
4214
4210
|
}, KE = (A, g, C, Q) => {
|
|
4215
4211
|
var n = H[Q + 40 >> 2], s = { tm_sec: J[Q >> 2], tm_min: J[Q + 4 >> 2], tm_hour: J[Q + 8 >> 2], tm_mday: J[Q + 12 >> 2], tm_mon: J[Q + 16 >> 2], tm_year: J[Q + 20 >> 2], tm_wday: J[Q + 24 >> 2], tm_yday: J[Q + 28 >> 2], tm_isdst: J[Q + 32 >> 2], tm_gmtoff: J[Q + 36 >> 2], tm_zone: n ? cI(n) : "" }, l = cI(C), w = { "%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y" };
|
|
4216
|
-
for (var
|
|
4212
|
+
for (var f in w) l = l.replace(new RegExp(f, "g"), w[f]);
|
|
4217
4213
|
var k = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Y = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
4218
4214
|
function j(L, T, UA) {
|
|
4219
4215
|
for (var sA = typeof L == "number" ? L.toString() : L || ""; sA.length < T; ) sA = UA[0] + sA;
|
|
4220
4216
|
return sA;
|
|
4221
4217
|
}
|
|
4222
|
-
function
|
|
4218
|
+
function b(L, T) {
|
|
4223
4219
|
return j(L, T, "0");
|
|
4224
4220
|
}
|
|
4225
4221
|
function V(L, T) {
|
|
@@ -4253,14 +4249,14 @@ return ret;
|
|
|
4253
4249
|
}
|
|
4254
4250
|
var FA = { "%a": (L) => k[L.tm_wday].substring(0, 3), "%A": (L) => k[L.tm_wday], "%b": (L) => Y[L.tm_mon].substring(0, 3), "%B": (L) => Y[L.tm_mon], "%C": (L) => {
|
|
4255
4251
|
var T = L.tm_year + 1900;
|
|
4256
|
-
return
|
|
4257
|
-
}, "%d": (L) =>
|
|
4252
|
+
return b(T / 100 | 0, 2);
|
|
4253
|
+
}, "%d": (L) => b(L.tm_mday, 2), "%e": (L) => j(L.tm_mday, 2, " "), "%g": (L) => hA(L).toString().substring(2), "%G": hA, "%H": (L) => b(L.tm_hour, 2), "%I": (L) => {
|
|
4258
4254
|
var T = L.tm_hour;
|
|
4259
|
-
return T == 0 ? T = 12 : T > 12 && (T -= 12),
|
|
4260
|
-
}, "%j": (L) =>
|
|
4261
|
-
`, "%p": (L) => L.tm_hour >= 0 && L.tm_hour < 12 ? "AM" : "PM", "%S": (L) =>
|
|
4255
|
+
return T == 0 ? T = 12 : T > 12 && (T -= 12), b(T, 2);
|
|
4256
|
+
}, "%j": (L) => b(L.tm_mday + YE(dI(L.tm_year + 1900) ? BB : QB, L.tm_mon - 1), 3), "%m": (L) => b(L.tm_mon + 1, 2), "%M": (L) => b(L.tm_min, 2), "%n": () => `
|
|
4257
|
+
`, "%p": (L) => L.tm_hour >= 0 && L.tm_hour < 12 ? "AM" : "PM", "%S": (L) => b(L.tm_sec, 2), "%t": () => " ", "%u": (L) => L.tm_wday || 7, "%U": (L) => {
|
|
4262
4258
|
var T = L.tm_yday + 7 - L.tm_wday;
|
|
4263
|
-
return
|
|
4259
|
+
return b(Math.floor(T / 7), 2);
|
|
4264
4260
|
}, "%V": (L) => {
|
|
4265
4261
|
var T = Math.floor((L.tm_yday + 7 - (L.tm_wday + 6) % 7) / 7);
|
|
4266
4262
|
if ((L.tm_wday + 371 - L.tm_yday - 2) % 7 <= 2 && T++, T) {
|
|
@@ -4273,16 +4269,16 @@ return ret;
|
|
|
4273
4269
|
var sA = (L.tm_wday + 7 - L.tm_yday - 1) % 7;
|
|
4274
4270
|
(sA == 4 || sA == 5 && dI(L.tm_year % 400 - 1)) && T++;
|
|
4275
4271
|
}
|
|
4276
|
-
return
|
|
4272
|
+
return b(T, 2);
|
|
4277
4273
|
}, "%w": (L) => L.tm_wday, "%W": (L) => {
|
|
4278
4274
|
var T = L.tm_yday + 7 - (L.tm_wday + 6) % 7;
|
|
4279
|
-
return
|
|
4275
|
+
return b(Math.floor(T / 7), 2);
|
|
4280
4276
|
}, "%y": (L) => (L.tm_year + 1900).toString().substring(2), "%Y": (L) => L.tm_year + 1900, "%z": (L) => {
|
|
4281
4277
|
var T = L.tm_gmtoff, UA = T >= 0;
|
|
4282
4278
|
return T = Math.abs(T) / 60, T = T / 60 * 100 + T % 60, (UA ? "+" : "-") + ("0000" + T).slice(-4);
|
|
4283
4279
|
}, "%Z": (L) => L.tm_zone, "%%": () => "%" };
|
|
4284
4280
|
l = l.replace(/%%/g, "\0\0");
|
|
4285
|
-
for (var
|
|
4281
|
+
for (var f in FA) l.includes(f) && (l = l.replace(new RegExp(f, "g"), FA[f](s)));
|
|
4286
4282
|
l = l.replace(/\0\0/g, "%");
|
|
4287
4283
|
var LA = lI(l, !1);
|
|
4288
4284
|
return LA.length > g ? 0 : (mE(LA, A), LA.length - 1);
|
|
@@ -4297,7 +4293,7 @@ return ret;
|
|
|
4297
4293
|
}
|
|
4298
4294
|
}, lQ(), rQ(), FQ(), bC = i.UnboundTypeError = LQ(Error, "UnboundTypeError"), qQ(), e.createPreloadedFile = NE, e.staticInit();
|
|
4299
4295
|
var qE = { t: $B, f: gQ, x: IQ, p: CQ, k: EQ, j: UQ, d: YQ, o: HQ, c: mQ, E: WC, i: TQ, b: jQ, a: WQ, y: VQ, h: OQ, e: gE, l: IE, v: CE, w: BE, u: QE, m: eE, r: rE, s: sE, B: lE, C: dE, A: kE, z: LE, n: ME, g: JE, D: AB, q: vE }, bA = _B(), EB = (A) => (EB = bA.H)(A), $I = (A) => ($I = bA.J)(A), tg = (A) => (tg = bA.K)(A), eB = (A, g) => (eB = bA.L)(A, g), tB = (A, g) => (tB = bA.M)(A, g), oB = (A) => (oB = bA.N)(A);
|
|
4300
|
-
i.dynCall_jiji = (A, g, C, Q, n) => (i.dynCall_jiji = bA.O)(A, g, C, Q, n), i.dynCall_viijii = (A, g, C, Q, n, s, l) => (i.dynCall_viijii = bA.P)(A, g, C, Q, n, s, l), i.dynCall_iiiiij = (A, g, C, Q, n, s, l) => (i.dynCall_iiiiij = bA.Q)(A, g, C, Q, n, s, l), i.dynCall_iiiiijj = (A, g, C, Q, n, s, l, w,
|
|
4296
|
+
i.dynCall_jiji = (A, g, C, Q, n) => (i.dynCall_jiji = bA.O)(A, g, C, Q, n), i.dynCall_viijii = (A, g, C, Q, n, s, l) => (i.dynCall_viijii = bA.P)(A, g, C, Q, n, s, l), i.dynCall_iiiiij = (A, g, C, Q, n, s, l) => (i.dynCall_iiiiij = bA.Q)(A, g, C, Q, n, s, l), i.dynCall_iiiiijj = (A, g, C, Q, n, s, l, w, f) => (i.dynCall_iiiiijj = bA.R)(A, g, C, Q, n, s, l, w, f), i.dynCall_iiiiiijj = (A, g, C, Q, n, s, l, w, f, k) => (i.dynCall_iiiiiijj = bA.S)(A, g, C, Q, n, s, l, w, f, k);
|
|
4301
4297
|
var wI;
|
|
4302
4298
|
rA = function A() {
|
|
4303
4299
|
wI || nB(), wI || (rA = A);
|
|
@@ -4360,7 +4356,7 @@ const ho = [
|
|
|
4360
4356
|
},
|
|
4361
4357
|
r.content
|
|
4362
4358
|
), B = (o, r, a) => {
|
|
4363
|
-
const { title: i, content: h, modalClass: d } = r, c = iC(i) ? I(o, r) : i,
|
|
4359
|
+
const { title: i, content: h, modalClass: d } = r, c = iC(i) ? I(o, r) : i, y = iC(h) ? E(o, r) : h, D = [
|
|
4364
4360
|
"common-modal",
|
|
4365
4361
|
["info", "success", "warning", "error", "confirm", "syncConfirm"].includes(o) && `common-modal__${o}`,
|
|
4366
4362
|
r.hideHeaderBorder !== !1 && "hide-header-border"
|
|
@@ -4372,7 +4368,7 @@ const ho = [
|
|
|
4372
4368
|
draggable: !0,
|
|
4373
4369
|
...co(r, ["title", "content", "modalClass"]),
|
|
4374
4370
|
title: c,
|
|
4375
|
-
content:
|
|
4371
|
+
content: y,
|
|
4376
4372
|
class: D,
|
|
4377
4373
|
modalClass: iC(d) || Array.isArray(d) ? d : ""
|
|
4378
4374
|
};
|
|
@@ -4462,7 +4458,7 @@ const ho = [
|
|
|
4462
4458
|
return [o, (a) => {
|
|
4463
4459
|
t.value = a, E == null || E(t.value);
|
|
4464
4460
|
}];
|
|
4465
|
-
},
|
|
4461
|
+
}, GI = "tag-range-highlight", fo = () => {
|
|
4466
4462
|
const I = gg(fg), [E, B] = KA({
|
|
4467
4463
|
index: -1,
|
|
4468
4464
|
offset: -1
|
|
@@ -4473,7 +4469,7 @@ const ho = [
|
|
|
4473
4469
|
if (q(I) || q(I.editorCore.value)) return;
|
|
4474
4470
|
const { cursor: h, content: d } = I.editorCore.value, { range: c } = h;
|
|
4475
4471
|
if (q(c)) return;
|
|
4476
|
-
const { startContainer:
|
|
4472
|
+
const { startContainer: y, endContainer: D, startOffset: u, endOffset: R } = c, F = WA(c.startContainer), M = WA(c.endContainer), G = hC(F, M), S = d.getParas(), p = F === M;
|
|
4477
4473
|
B({
|
|
4478
4474
|
index: S.indexOf(F),
|
|
4479
4475
|
offset: p && u > R ? R : u
|
|
@@ -4486,7 +4482,7 @@ const ho = [
|
|
|
4486
4482
|
return Kg(
|
|
4487
4483
|
K,
|
|
4488
4484
|
{
|
|
4489
|
-
class:
|
|
4485
|
+
class: GI,
|
|
4490
4486
|
style: "background: #3367d1;color: #fff;line-height: 34px;padding: 8px 0 8.5px 0;"
|
|
4491
4487
|
},
|
|
4492
4488
|
{
|
|
@@ -4505,27 +4501,27 @@ const ho = [
|
|
|
4505
4501
|
(AA = I.editorCore.value) == null || AA.content.update(kA);
|
|
4506
4502
|
};
|
|
4507
4503
|
if (F === M) {
|
|
4508
|
-
const X = $(
|
|
4504
|
+
const X = $(y) && y.tagName === "P";
|
|
4509
4505
|
P(
|
|
4510
|
-
X ?
|
|
4506
|
+
X ? y.firstChild : y,
|
|
4511
4507
|
X ? 0 : u,
|
|
4512
4508
|
D,
|
|
4513
4509
|
R
|
|
4514
4510
|
);
|
|
4515
4511
|
return;
|
|
4516
4512
|
}
|
|
4517
|
-
P(
|
|
4513
|
+
P(y, u, F, F.childNodes.length), G.forEach((X) => P(X, 0, X, X.childNodes.length)), P(M.firstChild, 0, D, R);
|
|
4518
4514
|
}, a = () => {
|
|
4519
4515
|
var d;
|
|
4520
4516
|
Array.from(
|
|
4521
|
-
document.body.querySelectorAll(`.${
|
|
4517
|
+
document.body.querySelectorAll(`.${GI}`)
|
|
4522
4518
|
).forEach((c) => c.replaceWith(c.textContent ?? "")), (d = I == null ? void 0 : I.editorCore.value) == null || d._editorElement.normalize();
|
|
4523
4519
|
};
|
|
4524
4520
|
return {
|
|
4525
4521
|
highlightRange: r,
|
|
4526
4522
|
unhighlightRange: a,
|
|
4527
4523
|
revertRange: () => {
|
|
4528
|
-
var
|
|
4524
|
+
var y, D;
|
|
4529
4525
|
if (q(I) || q(I.editorCore.value)) return;
|
|
4530
4526
|
a();
|
|
4531
4527
|
const { content: h } = I.editorCore.value, d = h.getParas(), c = document.createRange();
|
|
@@ -4535,7 +4531,7 @@ const ho = [
|
|
|
4535
4531
|
), c.setEnd(
|
|
4536
4532
|
d[t.value.index].firstChild,
|
|
4537
4533
|
t.value.offset ?? 0
|
|
4538
|
-
), (
|
|
4534
|
+
), (y = getSelection()) == null || y.removeAllRanges(), (D = getSelection()) == null || D.addRange(c), I.editorCore.value.cursor._recordRange();
|
|
4539
4535
|
}
|
|
4540
4536
|
};
|
|
4541
4537
|
}, Ro = (I, E, B) => {
|
|
@@ -4553,12 +4549,12 @@ const ho = [
|
|
|
4553
4549
|
onChange: (U) => {
|
|
4554
4550
|
var v;
|
|
4555
4551
|
r.value = U, a.value = !!((v = t.value) != null && v.element.querySelector(
|
|
4556
|
-
`span[data-type=${
|
|
4552
|
+
`span[data-type=${x.pausation}]`
|
|
4557
4553
|
)), B("update:textCount", U), B("change", U);
|
|
4558
4554
|
},
|
|
4559
4555
|
onUndoChange: (U) => {
|
|
4560
4556
|
var v;
|
|
4561
|
-
q((v = o.value.plugin[
|
|
4557
|
+
q((v = o.value.plugin[x.anchor]) == null ? void 0 : v.data) || (o.value.plugin[x.anchor].data = JSON.parse(U));
|
|
4562
4558
|
}
|
|
4563
4559
|
}), o.value = {
|
|
4564
4560
|
base: {
|
|
@@ -4568,16 +4564,16 @@ const ho = [
|
|
|
4568
4564
|
command: t.value.command
|
|
4569
4565
|
},
|
|
4570
4566
|
plugin: {
|
|
4571
|
-
[
|
|
4572
|
-
[
|
|
4573
|
-
[
|
|
4574
|
-
[
|
|
4567
|
+
[x.pausation]: t.value.plugin.pausation,
|
|
4568
|
+
[x.pronunciation]: t.value.plugin.pronunciation,
|
|
4569
|
+
[x.homophones]: t.value.plugin.homophones,
|
|
4570
|
+
[x.anchor]: t.value.plugin.anchor
|
|
4575
4571
|
}
|
|
4576
4572
|
}, i = new MutationObserver(([U]) => {
|
|
4577
4573
|
var v, O;
|
|
4578
|
-
Object.keys(((O = (v = o.value) == null ? void 0 : v.plugin[
|
|
4574
|
+
Object.keys(((O = (v = o.value) == null ? void 0 : v.plugin[x.anchor]) == null ? void 0 : O.data) ?? []).forEach((z) => {
|
|
4579
4575
|
var wA, RA;
|
|
4580
|
-
const J = ((RA = (wA = o.value) == null ? void 0 : wA.plugin[
|
|
4576
|
+
const J = ((RA = (wA = o.value) == null ? void 0 : wA.plugin[x.anchor]) == null ? void 0 : RA.data[z]) ?? [], [H, dA] = J.reduce(
|
|
4581
4577
|
(Z, eA) => {
|
|
4582
4578
|
const BA = Array.from(
|
|
4583
4579
|
document.body.querySelectorAll(`span[data-frag-id="anchor_${eA.id}"]`)
|
|
@@ -4586,14 +4582,14 @@ const ho = [
|
|
|
4586
4582
|
},
|
|
4587
4583
|
[[], []]
|
|
4588
4584
|
);
|
|
4589
|
-
o.value.plugin[
|
|
4585
|
+
o.value.plugin[x.anchor].data[z] = H, dA.forEach((Z) => B("anchorRemove", Z.data));
|
|
4590
4586
|
});
|
|
4591
4587
|
}), i.observe(I.value, {
|
|
4592
4588
|
childList: !0,
|
|
4593
4589
|
subtree: !0,
|
|
4594
4590
|
characterData: !0
|
|
4595
4591
|
});
|
|
4596
|
-
},
|
|
4592
|
+
}, y = () => {
|
|
4597
4593
|
var U;
|
|
4598
4594
|
(U = t.value) == null || U.destroy(), t.value = void 0, o.value = void 0, i == null || i.disconnect(), i = null;
|
|
4599
4595
|
}, D = (U) => {
|
|
@@ -4617,7 +4613,7 @@ const ho = [
|
|
|
4617
4613
|
return q(v) || q(O) || q(z) ? !1 : z.some((dA) => v.intersectsNode(dA));
|
|
4618
4614
|
}, K = (U) => {
|
|
4619
4615
|
var v;
|
|
4620
|
-
return HA(U) ? ((v = U.textContent) == null ? void 0 : v.replace(/</g, "<").replace(/>/g, ">")) ?? "" : U.dataset.type ===
|
|
4616
|
+
return HA(U) ? ((v = U.textContent) == null ? void 0 : v.replace(/</g, "<").replace(/>/g, ">")) ?? "" : U.dataset.type === x.pausation ? `<break time="${Number(U.dataset.value) * 1e3}"/>` : U.dataset.type === x.pronunciation ? U.dataset.value : U.dataset.type === x.highlight ? U.dataset.raw : U.dataset.type === x.homophones ? `<phoneme alphabet="py" ph="${U.dataset.formattedValue}">${U.dataset.raw}</phoneme>` : "";
|
|
4621
4617
|
}, W = (U, v) => {
|
|
4622
4618
|
var wA;
|
|
4623
4619
|
const O = Le(U);
|
|
@@ -4626,7 +4622,7 @@ const ho = [
|
|
|
4626
4622
|
const J = (wA = t.value) == null ? void 0 : wA.cursor.range;
|
|
4627
4623
|
let H = -1;
|
|
4628
4624
|
if (v && (J != null && J.collapse)) {
|
|
4629
|
-
const [RA] = PA(J == null ? void 0 : J.startContainer, (Z) => $(Z) && Z.dataset.type ===
|
|
4625
|
+
const [RA] = PA(J == null ? void 0 : J.startContainer, (Z) => $(Z) && Z.dataset.type === x.anchor);
|
|
4630
4626
|
H = O.findIndex((Z) => Z === RA), z = H > -1 ? O.slice(H) : O;
|
|
4631
4627
|
}
|
|
4632
4628
|
return z.map((RA, Z) => {
|
|
@@ -4649,7 +4645,7 @@ const ho = [
|
|
|
4649
4645
|
var J;
|
|
4650
4646
|
return (J = z.textContent) == null ? void 0 : J.trim();
|
|
4651
4647
|
}
|
|
4652
|
-
).map((z) => Array.from(z.childNodes)).flat().every((z) => HA(z) && ["", " ", null].includes(z.textContent) || $(z) && z.dataset.type ===
|
|
4648
|
+
).map((z) => Array.from(z.childNodes)).flat().every((z) => HA(z) && ["", " ", null].includes(z.textContent) || $(z) && z.dataset.type === x.anchor || $(z) && z.tagName === "BR");
|
|
4653
4649
|
}, nA = (U) => {
|
|
4654
4650
|
U.forEach((v) => {
|
|
4655
4651
|
var z;
|
|
@@ -4678,7 +4674,7 @@ const ho = [
|
|
|
4678
4674
|
const H = document.createDocumentFragment();
|
|
4679
4675
|
Array.from(J.childNodes).forEach((dA) => H.appendChild(dA)), J.replaceWith(H);
|
|
4680
4676
|
}), U.withRefineHighlight || Array.from(
|
|
4681
|
-
O.querySelectorAll(`.${
|
|
4677
|
+
O.querySelectorAll(`.${GI}`)
|
|
4682
4678
|
).forEach((J) => {
|
|
4683
4679
|
J.replaceWith(J.textContent ?? "");
|
|
4684
4680
|
}), O.innerHTML;
|
|
@@ -4691,7 +4687,7 @@ const ho = [
|
|
|
4691
4687
|
}
|
|
4692
4688
|
YI(t.value, JI(t.value, v));
|
|
4693
4689
|
};
|
|
4694
|
-
return mg(c), RB(
|
|
4690
|
+
return mg(c), RB(y), {
|
|
4695
4691
|
editorCore: t,
|
|
4696
4692
|
editorAction: o,
|
|
4697
4693
|
count: r,
|
|
@@ -4722,21 +4718,21 @@ const ho = [
|
|
|
4722
4718
|
setup(I) {
|
|
4723
4719
|
const [E] = ZA("quick-context-menu"), B = gg(fg), { x: t, y: o } = HI(), r = (G, S) => {
|
|
4724
4720
|
var p, m;
|
|
4725
|
-
(m = (p = B == null ? void 0 : B.editorAction.value) == null ? void 0 : p.plugin.pausation) == null || m.add({ delay: S }),
|
|
4721
|
+
(m = (p = B == null ? void 0 : B.editorAction.value) == null ? void 0 : p.plugin.pausation) == null || m.add({ delay: S }), y(!1);
|
|
4726
4722
|
}, a = async () => {
|
|
4727
4723
|
let G = "", S = [];
|
|
4728
4724
|
G = await (window.microApp ? window.rawWindow.navigator : window.navigator).clipboard.readText(), S = (G == null ? void 0 : G.split(/(?:\r?\n){2,}/).map((m) => m.trim()).filter((m) => m)) ?? [], YI(
|
|
4729
4725
|
B.editorCore.value,
|
|
4730
4726
|
JI(B.editorCore.value, S)
|
|
4731
|
-
),
|
|
4732
|
-
}, i = yA(), h = yA(!1), d = yA({ zIndex: -10 }), c = Qe(),
|
|
4727
|
+
), y(!1);
|
|
4728
|
+
}, i = yA(), h = yA(!1), d = yA({ zIndex: -10 }), c = Qe(), y = (G) => {
|
|
4733
4729
|
h.value = G ?? !h.value, F(!1);
|
|
4734
4730
|
}, D = (G) => {
|
|
4735
4731
|
const S = G.target, [p] = PA(S, (m) => m.classList.contains(ko));
|
|
4736
|
-
p && (G.preventDefault(), G.stopPropagation(), d.value = { top: `${o.value}px`, left: `${t.value}px` },
|
|
4732
|
+
p && (G.preventDefault(), G.stopPropagation(), d.value = { top: `${o.value}px`, left: `${t.value}px` }, y(!0));
|
|
4737
4733
|
}, u = (G) => {
|
|
4738
4734
|
var S;
|
|
4739
|
-
(S = i.value) != null && S.contains(G.target) || (d.value = { zIndex: -10 },
|
|
4735
|
+
(S = i.value) != null && S.contains(G.target) || (d.value = { zIndex: -10 }, y(!1));
|
|
4740
4736
|
}, R = yA(), F = (G) => {
|
|
4741
4737
|
var S;
|
|
4742
4738
|
(S = R.value) == null || S.$el.setAttribute("style", G ? "display: block" : "display: none");
|
|
@@ -4783,7 +4779,19 @@ const ho = [
|
|
|
4783
4779
|
[LI, h.value]
|
|
4784
4780
|
]);
|
|
4785
4781
|
}
|
|
4786
|
-
}), Lo = /* @__PURE__ */ JA(So, [["__scopeId", "data-v-2c4a9bcb"]])
|
|
4782
|
+
}), Lo = /* @__PURE__ */ JA(So, [["__scopeId", "data-v-2c4a9bcb"]]);
|
|
4783
|
+
function kI(I) {
|
|
4784
|
+
let E = null, B = null, t = null;
|
|
4785
|
+
const o = function(...r) {
|
|
4786
|
+
B = r, t = this, E == null && (E = requestAnimationFrame(() => {
|
|
4787
|
+
E = null, B && (I.apply(t, B), B = t = null);
|
|
4788
|
+
}));
|
|
4789
|
+
};
|
|
4790
|
+
return o.cancel = () => {
|
|
4791
|
+
E != null && (cancelAnimationFrame(E), E = null), B = t = null;
|
|
4792
|
+
}, o;
|
|
4793
|
+
}
|
|
4794
|
+
const Uo = {}, Mo = {
|
|
4787
4795
|
class: "icon",
|
|
4788
4796
|
style: { width: "1.0615234375em", height: "1em", "vertical-align": "middle", fill: "currentColor", overflow: "hidden" },
|
|
4789
4797
|
viewBox: "0 0 1087 1024",
|
|
@@ -5031,16 +5039,16 @@ const nn = /* @__PURE__ */ JA(en, [["render", on]]), jB = () => {
|
|
|
5031
5039
|
range: c
|
|
5032
5040
|
} = E.editorCore.value.cursor;
|
|
5033
5041
|
if (q(c)) return;
|
|
5034
|
-
const
|
|
5035
|
-
if (q(
|
|
5042
|
+
const y = WA(c.endContainer);
|
|
5043
|
+
if (q(y) || q(y.parentNode)) return;
|
|
5036
5044
|
const D = document.createRange();
|
|
5037
|
-
D.setStart(c.endContainer, c.endOffset), D.setEndAfter(
|
|
5045
|
+
D.setStart(c.endContainer, c.endOffset), D.setEndAfter(y);
|
|
5038
5046
|
const u = D.extractContents(), R = (((m = B.activedContent.value) == null ? void 0 : m.content) ?? "").split($g), F = document.createDocumentFragment();
|
|
5039
5047
|
R.forEach((P) => {
|
|
5040
5048
|
F.appendChild(d(P));
|
|
5041
5049
|
});
|
|
5042
|
-
const M = F.lastChild, G =
|
|
5043
|
-
G.insertBefore(F,
|
|
5050
|
+
const M = F.lastChild, G = y.parentNode;
|
|
5051
|
+
G.insertBefore(F, y.nextSibling), G.insertBefore(u, M.nextSibling);
|
|
5044
5052
|
const S = window.getSelection();
|
|
5045
5053
|
if (!S) return;
|
|
5046
5054
|
const p = document.createRange();
|
|
@@ -5049,11 +5057,11 @@ const nn = /* @__PURE__ */ JA(en, [["render", on]]), jB = () => {
|
|
|
5049
5057
|
const {
|
|
5050
5058
|
content: d,
|
|
5051
5059
|
contentPage: c,
|
|
5052
|
-
setRefineContent:
|
|
5060
|
+
setRefineContent: y,
|
|
5053
5061
|
setActivedRefineContent: D,
|
|
5054
5062
|
setContentPage: u
|
|
5055
5063
|
} = B, R = d.value.filter((M, G) => G !== c.value - 1), F = R[c.value - 1] ? c.value : c.value - 1;
|
|
5056
|
-
u(F),
|
|
5064
|
+
u(F), y(R), D(d.value[c.value - 1]);
|
|
5057
5065
|
}, h = yA();
|
|
5058
5066
|
return gI(() => {
|
|
5059
5067
|
var d;
|
|
@@ -5254,7 +5262,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5254
5262
|
var d, c;
|
|
5255
5263
|
if ((d = i.children) != null && d.length) {
|
|
5256
5264
|
if (I.shortcutPosition.value === ag.底部) {
|
|
5257
|
-
const
|
|
5265
|
+
const y = Number.parseFloat(getComputedStyle(I.scrollElm.value).height), D = ((c = I.scrollElm.value) == null ? void 0 : c.scrollTop) ?? 0, u = y + D, R = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).top), F = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).height), M = sC.length * Zg + _g * 2, G = i.children.length * Zg, S = (sC.length - h) * Zg + _g, p = (
|
|
5258
5266
|
// 弹窗定位 + 高度
|
|
5259
5267
|
R + F + // 指令列表高度 + marginTop 8px
|
|
5260
5268
|
M + 8 + // 子指令列表高度 + bottomTop 8px
|
|
@@ -5268,13 +5276,13 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5268
5276
|
}
|
|
5269
5277
|
}, [t, o] = fI(), [r, a] = KA(-1);
|
|
5270
5278
|
return () => {
|
|
5271
|
-
const i = (d, c,
|
|
5279
|
+
const i = (d, c, y = !0) => {
|
|
5272
5280
|
var D, u;
|
|
5273
5281
|
return N(cg, null, [N("li", {
|
|
5274
5282
|
class: uI("shortcut-item"),
|
|
5275
5283
|
onClick: () => E(d),
|
|
5276
|
-
onMouseenter:
|
|
5277
|
-
onMouseleave:
|
|
5284
|
+
onMouseenter: y ? () => B(d, c) : DC,
|
|
5285
|
+
onMouseleave: y ? () => o(!1) : DC
|
|
5278
5286
|
}, [N(OA("a-space"), {
|
|
5279
5287
|
style: "justify-content: space-between",
|
|
5280
5288
|
fill: !0
|
|
@@ -5374,9 +5382,9 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5374
5382
|
return;
|
|
5375
5383
|
}
|
|
5376
5384
|
h(), o(!0);
|
|
5377
|
-
},
|
|
5385
|
+
}, y = kI(() => {
|
|
5378
5386
|
t.value && h();
|
|
5379
|
-
}), D =
|
|
5387
|
+
}), D = kI(async (M) => {
|
|
5380
5388
|
var S, p;
|
|
5381
5389
|
if (!t.value || (S = B.value) != null && S.contains(i.target)) return;
|
|
5382
5390
|
const G = (p = I == null ? void 0 : I.editorCore.value) == null ? void 0 : p.cursor;
|
|
@@ -5390,10 +5398,10 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5390
5398
|
});
|
|
5391
5399
|
mg(() => {
|
|
5392
5400
|
var M;
|
|
5393
|
-
document.addEventListener("mousedown", d), document.addEventListener("mouseup", c), document.addEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.addEventListener("scroll",
|
|
5401
|
+
document.addEventListener("mousedown", d), document.addEventListener("mouseup", c), document.addEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.addEventListener("scroll", y);
|
|
5394
5402
|
}), GC(() => {
|
|
5395
5403
|
var M;
|
|
5396
|
-
document.removeEventListener("mousedown", d), document.removeEventListener("mouseup", c), document.removeEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.removeEventListener("scroll",
|
|
5404
|
+
document.removeEventListener("mousedown", d), document.removeEventListener("mouseup", c), document.removeEventListener("selectionchange", D), (M = E.scrollElm.value) == null || M.removeEventListener("scroll", y);
|
|
5397
5405
|
});
|
|
5398
5406
|
const u = () => {
|
|
5399
5407
|
E.highlightRange(), o(!1), E.showRefineGenerator(), NC(() => {
|
|
@@ -5440,7 +5448,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5440
5448
|
sg.顶部对齐
|
|
5441
5449
|
), d = () => {
|
|
5442
5450
|
if (!I.visible.value) return;
|
|
5443
|
-
const
|
|
5451
|
+
const y = I.scrollElm.value, D = Number.parseFloat(getComputedStyle(y).height), R = y.scrollTop + D, F = Number.parseFloat(getComputedStyle(E.value).top), M = Number.parseFloat(
|
|
5444
5452
|
getComputedStyle(I.refineGeneratorRef.value).height
|
|
5445
5453
|
);
|
|
5446
5454
|
o(
|
|
@@ -5450,13 +5458,13 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5450
5458
|
), h(
|
|
5451
5459
|
R > F + M + hB + Gn ? sg.顶部对齐 : sg.底部对齐
|
|
5452
5460
|
);
|
|
5453
|
-
}, c =
|
|
5461
|
+
}, c = kI(d);
|
|
5454
5462
|
return mg(() => {
|
|
5455
|
-
var
|
|
5456
|
-
(
|
|
5463
|
+
var y;
|
|
5464
|
+
(y = B.value) == null || y.addEventListener("scroll", c);
|
|
5457
5465
|
}), GC(() => {
|
|
5458
|
-
var
|
|
5459
|
-
(
|
|
5466
|
+
var y;
|
|
5467
|
+
(y = B.value) == null || y.removeEventListener("scroll", c);
|
|
5460
5468
|
}), {
|
|
5461
5469
|
generatorPosition: t,
|
|
5462
5470
|
shortcutPosition: r,
|
|
@@ -5485,12 +5493,12 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5485
5493
|
createSession: a,
|
|
5486
5494
|
sendSessionMessage: i,
|
|
5487
5495
|
abortSession: h
|
|
5488
|
-
} = o.refineContext, [d, c] = KA(void 0),
|
|
5496
|
+
} = o.refineContext, [d, c] = KA(void 0), y = () => (i.abort(), h({
|
|
5489
5497
|
sessionId: d.value
|
|
5490
5498
|
})), D = yA(), [u, R] = KA({
|
|
5491
5499
|
zIndex: -10
|
|
5492
5500
|
}), [F, M] = KA(!1, (rA) => {
|
|
5493
|
-
rA || (d.value && [jA.等待生成, jA.正在生成].includes(v.value) &&
|
|
5501
|
+
rA || (d.value && [jA.等待生成, jA.正在生成].includes(v.value) && y(), c(void 0), EA(!1), nA(void 0), U(!1), O(jA.未生成), J(0), dA([]), RA(void 0), AA(!0), R({
|
|
5494
5502
|
zIndex: -10
|
|
5495
5503
|
}));
|
|
5496
5504
|
}), G = () => {
|
|
@@ -5507,7 +5515,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5507
5515
|
}, p = (rA) => {
|
|
5508
5516
|
var _A;
|
|
5509
5517
|
F.value && ((_A = D.value) != null && _A.contains(rA.target) || (B(), M(!1)));
|
|
5510
|
-
}, m =
|
|
5518
|
+
}, m = kI(() => {
|
|
5511
5519
|
F.value && G();
|
|
5512
5520
|
}), [P, X] = KA(void 0);
|
|
5513
5521
|
mg(() => {
|
|
@@ -5551,7 +5559,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5551
5559
|
messageRequest: {
|
|
5552
5560
|
agent_id: r,
|
|
5553
5561
|
message: {
|
|
5554
|
-
content: Array.from(document.body.querySelectorAll(`.${
|
|
5562
|
+
content: Array.from(document.body.querySelectorAll(`.${GI}`)).map((XA) => XA.textContent ?? "").join(`
|
|
5555
5563
|
`),
|
|
5556
5564
|
conversation_id: _A.data.conversionId
|
|
5557
5565
|
},
|
|
@@ -5590,7 +5598,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
|
|
|
5590
5598
|
setContentVisible: U,
|
|
5591
5599
|
setContentState: O,
|
|
5592
5600
|
showRefineGenerator: S,
|
|
5593
|
-
abortSession:
|
|
5601
|
+
abortSession: y,
|
|
5594
5602
|
/** highlight range */
|
|
5595
5603
|
scrollElm: P,
|
|
5596
5604
|
highlightRange: E,
|
|
@@ -5799,7 +5807,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
|
|
|
5799
5807
|
hasPausationTag: h,
|
|
5800
5808
|
getContent: d,
|
|
5801
5809
|
setContent: c,
|
|
5802
|
-
appendContent:
|
|
5810
|
+
appendContent: y,
|
|
5803
5811
|
getTextContent: D,
|
|
5804
5812
|
insertContent: u,
|
|
5805
5813
|
deleteContent: R,
|
|
@@ -5824,7 +5832,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
|
|
|
5824
5832
|
editorAction: a,
|
|
5825
5833
|
getContent: d,
|
|
5826
5834
|
setContent: c,
|
|
5827
|
-
appendContent:
|
|
5835
|
+
appendContent: y,
|
|
5828
5836
|
getTextContent: D,
|
|
5829
5837
|
insertContent: u,
|
|
5830
5838
|
deleteContent: R,
|
|
@@ -6036,7 +6044,7 @@ const DB = /* @__PURE__ */ JA(mn, [["render", Kn]]), [TA] = ZA("editor-container
|
|
|
6036
6044
|
}, [JSON.stringify(AA.value), Object.values(AA.value).flat().length])]),
|
|
6037
6045
|
innerGetContent: d,
|
|
6038
6046
|
innerSetContent: c,
|
|
6039
|
-
innerAppendContent:
|
|
6047
|
+
innerAppendContent: y,
|
|
6040
6048
|
innerGetTextContent: D,
|
|
6041
6049
|
innerInsertContent: u,
|
|
6042
6050
|
innerDeleteContent: R,
|
|
@@ -6151,7 +6159,7 @@ export {
|
|
|
6151
6159
|
pI as IPlugin,
|
|
6152
6160
|
re as IUndoManager,
|
|
6153
6161
|
SB as ListenModeEnum,
|
|
6154
|
-
|
|
6162
|
+
x as PluginFlag,
|
|
6155
6163
|
te as SelectionType,
|
|
6156
6164
|
bn as default
|
|
6157
6165
|
};
|