@dcodegroup-au/dsg-vue
Version:
Front-end Vue/Tailwind DSG for UntitledUI.
817 lines (816 loc) • 490 kB
JavaScript
import { defineComponent as ki, mergeModels as Pn, useModel as Ti, ref as jn, watch as _i, useTemplateRef as Ai, onMounted as xi, createElementBlock as kt, openBlock as ft, createElementVNode as Bn, createCommentVNode as Un, createBlock as Di, Fragment as Hi, renderList as Oi, toDisplayString as Ni } from "vue";
import { g as Ri } from "./_commonjsHelpers-C6fGbg64.js";
import { _ as Ii } from "./DsgLabel.vue_vue_type_style_index_0_lang-BRVMqZ-w.js";
var Tt = { exports: {} };
/*!
* Vditor v3.11.1 - A markdown editor written in TypeScript.
*
* MIT License
*
* Copyright (c) 2018-present B3log 开源, b3log.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
var Pi = Tt.exports, Vn;
function ji() {
return Vn || (Vn = 1, function(He, Zt) {
(function(tt, Y) {
He.exports = Y();
})(Pi, function() {
return (
/******/
(() => {
var dt = {
/***/
173: (
/***/
(Z) => {
var E = function() {
this.Diff_Timeout = 1, this.Diff_EditCost = 4, this.Match_Threshold = 0.5, this.Match_Distance = 1e3, this.Patch_DeleteThreshold = 0.5, this.Patch_Margin = 4, this.Match_MaxBits = 32;
}, L = -1, x = 1, A = 0;
E.Diff = function(c, l) {
return [c, l];
}, E.prototype.diff_main = function(c, l, y, p) {
typeof p > "u" && (this.Diff_Timeout <= 0 ? p = Number.MAX_VALUE : p = (/* @__PURE__ */ new Date()).getTime() + this.Diff_Timeout * 1e3);
var m = p;
if (c == null || l == null)
throw new Error("Null input. (diff_main)");
if (c == l)
return c ? [new E.Diff(A, c)] : [];
typeof y > "u" && (y = !0);
var f = y, v = this.diff_commonPrefix(c, l), w = c.substring(0, v);
c = c.substring(v), l = l.substring(v), v = this.diff_commonSuffix(c, l);
var b = c.substring(c.length - v);
c = c.substring(0, c.length - v), l = l.substring(0, l.length - v);
var g = this.diff_compute_(c, l, f, m);
return w && g.unshift(new E.Diff(A, w)), b && g.push(new E.Diff(A, b)), this.diff_cleanupMerge(g), g;
}, E.prototype.diff_compute_ = function(c, l, y, p) {
var m;
if (!c)
return [new E.Diff(x, l)];
if (!l)
return [new E.Diff(L, c)];
var f = c.length > l.length ? c : l, v = c.length > l.length ? l : c, w = f.indexOf(v);
if (w != -1)
return m = [new E.Diff(x, f.substring(0, w)), new E.Diff(A, v), new E.Diff(x, f.substring(w + v.length))], c.length > l.length && (m[0][0] = m[2][0] = L), m;
if (v.length == 1)
return [new E.Diff(L, c), new E.Diff(x, l)];
var b = this.diff_halfMatch_(c, l);
if (b) {
var g = b[0], o = b[1], C = b[2], _ = b[3], D = b[4], M = this.diff_main(g, C, y, p), P = this.diff_main(o, _, y, p);
return M.concat([new E.Diff(A, D)], P);
}
return y && c.length > 100 && l.length > 100 ? this.diff_lineMode_(c, l, p) : this.diff_bisect_(c, l, p);
}, E.prototype.diff_lineMode_ = function(c, l, y) {
var p = this.diff_linesToChars_(c, l);
c = p.chars1, l = p.chars2;
var m = p.lineArray, f = this.diff_main(c, l, !1, y);
this.diff_charsToLines_(f, m), this.diff_cleanupSemantic(f), f.push(new E.Diff(A, ""));
for (var v = 0, w = 0, b = 0, g = "", o = ""; v < f.length; ) {
switch (f[v][0]) {
case x:
b++, o += f[v][1];
break;
case L:
w++, g += f[v][1];
break;
case A:
if (w >= 1 && b >= 1) {
f.splice(v - w - b, w + b), v = v - w - b;
for (var C = this.diff_main(g, o, !1, y), _ = C.length - 1; _ >= 0; _--)
f.splice(v, 0, C[_]);
v = v + C.length;
}
b = 0, w = 0, g = "", o = "";
break;
}
v++;
}
return f.pop(), f;
}, E.prototype.diff_bisect_ = function(c, l, y) {
for (var p = c.length, m = l.length, f = Math.ceil((p + m) / 2), v = f, w = 2 * f, b = new Array(w), g = new Array(w), o = 0; o < w; o++)
b[o] = -1, g[o] = -1;
b[v + 1] = 0, g[v + 1] = 0;
for (var C = p - m, _ = C % 2 != 0, D = 0, M = 0, P = 0, V = 0, z = 0; z < f && !((/* @__PURE__ */ new Date()).getTime() > y); z++) {
for (var Q = -z + D; Q <= z - M; Q += 2) {
var ne = v + Q, oe;
Q == -z || Q != z && b[ne - 1] < b[ne + 1] ? oe = b[ne + 1] : oe = b[ne - 1] + 1;
for (var me = oe - Q; oe < p && me < m && c.charAt(oe) == l.charAt(me); )
oe++, me++;
if (b[ne] = oe, oe > p)
M += 2;
else if (me > m)
D += 2;
else if (_) {
var fe = v + C - Q;
if (fe >= 0 && fe < w && g[fe] != -1) {
var le = p - g[fe];
if (oe >= le)
return this.diff_bisectSplit_(c, l, oe, me, y);
}
}
}
for (var we = -z + P; we <= z - V; we += 2) {
var fe = v + we, le;
we == -z || we != z && g[fe - 1] < g[fe + 1] ? le = g[fe + 1] : le = g[fe - 1] + 1;
for (var ke = le - we; le < p && ke < m && c.charAt(p - le - 1) == l.charAt(m - ke - 1); )
le++, ke++;
if (g[fe] = le, le > p)
V += 2;
else if (ke > m)
P += 2;
else if (!_) {
var ne = v + C - we;
if (ne >= 0 && ne < w && b[ne] != -1) {
var oe = b[ne], me = v + oe - ne;
if (le = p - le, oe >= le)
return this.diff_bisectSplit_(c, l, oe, me, y);
}
}
}
}
return [new E.Diff(L, c), new E.Diff(x, l)];
}, E.prototype.diff_bisectSplit_ = function(c, l, y, p, m) {
var f = c.substring(0, y), v = l.substring(0, p), w = c.substring(y), b = l.substring(p), g = this.diff_main(f, v, !1, m), o = this.diff_main(w, b, !1, m);
return g.concat(o);
}, E.prototype.diff_linesToChars_ = function(c, l) {
var y = [], p = {};
y[0] = "";
function m(b) {
for (var g = "", o = 0, C = -1, _ = y.length; C < b.length - 1; ) {
C = b.indexOf(`
`, o), C == -1 && (C = b.length - 1);
var D = b.substring(o, C + 1);
(p.hasOwnProperty ? p.hasOwnProperty(D) : p[D] !== void 0) ? g += String.fromCharCode(p[D]) : (_ == f && (D = b.substring(o), C = b.length), g += String.fromCharCode(_), p[D] = _, y[_++] = D), o = C + 1;
}
return g;
}
var f = 4e4, v = m(c);
f = 65535;
var w = m(l);
return {
chars1: v,
chars2: w,
lineArray: y
};
}, E.prototype.diff_charsToLines_ = function(c, l) {
for (var y = 0; y < c.length; y++) {
for (var p = c[y][1], m = [], f = 0; f < p.length; f++)
m[f] = l[p.charCodeAt(f)];
c[y][1] = m.join("");
}
}, E.prototype.diff_commonPrefix = function(c, l) {
if (!c || !l || c.charAt(0) != l.charAt(0))
return 0;
for (var y = 0, p = Math.min(c.length, l.length), m = p, f = 0; y < m; )
c.substring(f, m) == l.substring(f, m) ? (y = m, f = y) : p = m, m = Math.floor((p - y) / 2 + y);
return m;
}, E.prototype.diff_commonSuffix = function(c, l) {
if (!c || !l || c.charAt(c.length - 1) != l.charAt(l.length - 1))
return 0;
for (var y = 0, p = Math.min(c.length, l.length), m = p, f = 0; y < m; )
c.substring(c.length - m, c.length - f) == l.substring(l.length - m, l.length - f) ? (y = m, f = y) : p = m, m = Math.floor((p - y) / 2 + y);
return m;
}, E.prototype.diff_commonOverlap_ = function(c, l) {
var y = c.length, p = l.length;
if (y == 0 || p == 0)
return 0;
y > p ? c = c.substring(y - p) : y < p && (l = l.substring(0, y));
var m = Math.min(y, p);
if (c == l)
return m;
for (var f = 0, v = 1; ; ) {
var w = c.substring(m - v), b = l.indexOf(w);
if (b == -1)
return f;
v += b, (b == 0 || c.substring(m - v) == l.substring(0, v)) && (f = v, v++);
}
}, E.prototype.diff_halfMatch_ = function(c, l) {
if (this.Diff_Timeout <= 0)
return null;
var y = c.length > l.length ? c : l, p = c.length > l.length ? l : c;
if (y.length < 4 || p.length * 2 < y.length)
return null;
var m = this;
function f(M, P, V) {
for (var z = M.substring(V, V + Math.floor(M.length / 4)), Q = -1, ne = "", oe, me, fe, le; (Q = P.indexOf(z, Q + 1)) != -1; ) {
var we = m.diff_commonPrefix(M.substring(V), P.substring(Q)), ke = m.diff_commonSuffix(M.substring(0, V), P.substring(0, Q));
ne.length < ke + we && (ne = P.substring(Q - ke, Q) + P.substring(Q, Q + we), oe = M.substring(0, V - ke), me = M.substring(V + we), fe = P.substring(0, Q - ke), le = P.substring(Q + we));
}
return ne.length * 2 >= M.length ? [oe, me, fe, le, ne] : null;
}
var v = f(y, p, Math.ceil(y.length / 4)), w = f(y, p, Math.ceil(y.length / 2)), b;
if (!v && !w)
return null;
w ? v ? b = v[4].length > w[4].length ? v : w : b = w : b = v;
var g, o, C, _;
c.length > l.length ? (g = b[0], o = b[1], C = b[2], _ = b[3]) : (C = b[0], _ = b[1], g = b[2], o = b[3]);
var D = b[4];
return [g, o, C, _, D];
}, E.prototype.diff_cleanupSemantic = function(c) {
for (var l = !1, y = [], p = 0, m = null, f = 0, v = 0, w = 0, b = 0, g = 0; f < c.length; )
c[f][0] == A ? (y[p++] = f, v = b, w = g, b = 0, g = 0, m = c[f][1]) : (c[f][0] == x ? b += c[f][1].length : g += c[f][1].length, m && m.length <= Math.max(v, w) && m.length <= Math.max(b, g) && (c.splice(y[p - 1], 0, new E.Diff(L, m)), c[y[p - 1] + 1][0] = x, p--, p--, f = p > 0 ? y[p - 1] : -1, v = 0, w = 0, b = 0, g = 0, m = null, l = !0)), f++;
for (l && this.diff_cleanupMerge(c), this.diff_cleanupSemanticLossless(c), f = 1; f < c.length; ) {
if (c[f - 1][0] == L && c[f][0] == x) {
var o = c[f - 1][1], C = c[f][1], _ = this.diff_commonOverlap_(o, C), D = this.diff_commonOverlap_(C, o);
_ >= D ? (_ >= o.length / 2 || _ >= C.length / 2) && (c.splice(f, 0, new E.Diff(A, C.substring(0, _))), c[f - 1][1] = o.substring(0, o.length - _), c[f + 1][1] = C.substring(_), f++) : (D >= o.length / 2 || D >= C.length / 2) && (c.splice(f, 0, new E.Diff(A, o.substring(0, D))), c[f - 1][0] = x, c[f - 1][1] = C.substring(0, C.length - D), c[f + 1][0] = L, c[f + 1][1] = o.substring(D), f++), f++;
}
f++;
}
}, E.prototype.diff_cleanupSemanticLossless = function(c) {
function l(D, M) {
if (!D || !M)
return 6;
var P = D.charAt(D.length - 1), V = M.charAt(0), z = P.match(E.nonAlphaNumericRegex_), Q = V.match(E.nonAlphaNumericRegex_), ne = z && P.match(E.whitespaceRegex_), oe = Q && V.match(E.whitespaceRegex_), me = ne && P.match(E.linebreakRegex_), fe = oe && V.match(E.linebreakRegex_), le = me && D.match(E.blanklineEndRegex_), we = fe && M.match(E.blanklineStartRegex_);
return le || we ? 5 : me || fe ? 4 : z && !ne && oe ? 3 : ne || oe ? 2 : z || Q ? 1 : 0;
}
for (var y = 1; y < c.length - 1; ) {
if (c[y - 1][0] == A && c[y + 1][0] == A) {
var p = c[y - 1][1], m = c[y][1], f = c[y + 1][1], v = this.diff_commonSuffix(p, m);
if (v) {
var w = m.substring(m.length - v);
p = p.substring(0, p.length - v), m = w + m.substring(0, m.length - v), f = w + f;
}
for (var b = p, g = m, o = f, C = l(p, m) + l(m, f); m.charAt(0) === f.charAt(0); ) {
p += m.charAt(0), m = m.substring(1) + f.charAt(0), f = f.substring(1);
var _ = l(p, m) + l(m, f);
_ >= C && (C = _, b = p, g = m, o = f);
}
c[y - 1][1] != b && (b ? c[y - 1][1] = b : (c.splice(y - 1, 1), y--), c[y][1] = g, o ? c[y + 1][1] = o : (c.splice(y + 1, 1), y--));
}
y++;
}
}, E.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/, E.whitespaceRegex_ = /\s/, E.linebreakRegex_ = /[\r\n]/, E.blanklineEndRegex_ = /\n\r?\n$/, E.blanklineStartRegex_ = /^\r?\n\r?\n/, E.prototype.diff_cleanupEfficiency = function(c) {
for (var l = !1, y = [], p = 0, m = null, f = 0, v = !1, w = !1, b = !1, g = !1; f < c.length; )
c[f][0] == A ? (c[f][1].length < this.Diff_EditCost && (b || g) ? (y[p++] = f, v = b, w = g, m = c[f][1]) : (p = 0, m = null), b = g = !1) : (c[f][0] == L ? g = !0 : b = !0, m && (v && w && b && g || m.length < this.Diff_EditCost / 2 && v + w + b + g == 3) && (c.splice(y[p - 1], 0, new E.Diff(L, m)), c[y[p - 1] + 1][0] = x, p--, m = null, v && w ? (b = g = !0, p = 0) : (p--, f = p > 0 ? y[p - 1] : -1, b = g = !1), l = !0)), f++;
l && this.diff_cleanupMerge(c);
}, E.prototype.diff_cleanupMerge = function(c) {
c.push(new E.Diff(A, ""));
for (var l = 0, y = 0, p = 0, m = "", f = "", v; l < c.length; )
switch (c[l][0]) {
case x:
p++, f += c[l][1], l++;
break;
case L:
y++, m += c[l][1], l++;
break;
case A:
y + p > 1 ? (y !== 0 && p !== 0 && (v = this.diff_commonPrefix(f, m), v !== 0 && (l - y - p > 0 && c[l - y - p - 1][0] == A ? c[l - y - p - 1][1] += f.substring(0, v) : (c.splice(0, 0, new E.Diff(A, f.substring(0, v))), l++), f = f.substring(v), m = m.substring(v)), v = this.diff_commonSuffix(f, m), v !== 0 && (c[l][1] = f.substring(f.length - v) + c[l][1], f = f.substring(0, f.length - v), m = m.substring(0, m.length - v))), l -= y + p, c.splice(l, y + p), m.length && (c.splice(l, 0, new E.Diff(L, m)), l++), f.length && (c.splice(l, 0, new E.Diff(x, f)), l++), l++) : l !== 0 && c[l - 1][0] == A ? (c[l - 1][1] += c[l][1], c.splice(l, 1)) : l++, p = 0, y = 0, m = "", f = "";
break;
}
c[c.length - 1][1] === "" && c.pop();
var w = !1;
for (l = 1; l < c.length - 1; )
c[l - 1][0] == A && c[l + 1][0] == A && (c[l][1].substring(c[l][1].length - c[l - 1][1].length) == c[l - 1][1] ? (c[l][1] = c[l - 1][1] + c[l][1].substring(0, c[l][1].length - c[l - 1][1].length), c[l + 1][1] = c[l - 1][1] + c[l + 1][1], c.splice(l - 1, 1), w = !0) : c[l][1].substring(0, c[l + 1][1].length) == c[l + 1][1] && (c[l - 1][1] += c[l + 1][1], c[l][1] = c[l][1].substring(c[l + 1][1].length) + c[l + 1][1], c.splice(l + 1, 1), w = !0)), l++;
w && this.diff_cleanupMerge(c);
}, E.prototype.diff_xIndex = function(c, l) {
var y = 0, p = 0, m = 0, f = 0, v;
for (v = 0; v < c.length && (c[v][0] !== x && (y += c[v][1].length), c[v][0] !== L && (p += c[v][1].length), !(y > l)); v++)
m = y, f = p;
return c.length != v && c[v][0] === L ? f : f + (l - m);
}, E.prototype.diff_prettyHtml = function(c) {
for (var l = [], y = /&/g, p = /</g, m = />/g, f = /\n/g, v = 0; v < c.length; v++) {
var w = c[v][0], b = c[v][1], g = b.replace(y, "&").replace(p, "<").replace(m, ">").replace(f, "¶<br>");
switch (w) {
case x:
l[v] = '<ins style="background:#e6ffe6;">' + g + "</ins>";
break;
case L:
l[v] = '<del style="background:#ffe6e6;">' + g + "</del>";
break;
case A:
l[v] = "<span>" + g + "</span>";
break;
}
}
return l.join("");
}, E.prototype.diff_text1 = function(c) {
for (var l = [], y = 0; y < c.length; y++)
c[y][0] !== x && (l[y] = c[y][1]);
return l.join("");
}, E.prototype.diff_text2 = function(c) {
for (var l = [], y = 0; y < c.length; y++)
c[y][0] !== L && (l[y] = c[y][1]);
return l.join("");
}, E.prototype.diff_levenshtein = function(c) {
for (var l = 0, y = 0, p = 0, m = 0; m < c.length; m++) {
var f = c[m][0], v = c[m][1];
switch (f) {
case x:
y += v.length;
break;
case L:
p += v.length;
break;
case A:
l += Math.max(y, p), y = 0, p = 0;
break;
}
}
return l += Math.max(y, p), l;
}, E.prototype.diff_toDelta = function(c) {
for (var l = [], y = 0; y < c.length; y++)
switch (c[y][0]) {
case x:
l[y] = "+" + encodeURI(c[y][1]);
break;
case L:
l[y] = "-" + c[y][1].length;
break;
case A:
l[y] = "=" + c[y][1].length;
break;
}
return l.join(" ").replace(/%20/g, " ");
}, E.prototype.diff_fromDelta = function(c, l) {
for (var y = [], p = 0, m = 0, f = l.split(/\t/g), v = 0; v < f.length; v++) {
var w = f[v].substring(1);
switch (f[v].charAt(0)) {
case "+":
try {
y[p++] = new E.Diff(x, decodeURI(w));
} catch {
throw new Error("Illegal escape in diff_fromDelta: " + w);
}
break;
case "-":
// Fall through.
case "=":
var b = parseInt(w, 10);
if (isNaN(b) || b < 0)
throw new Error("Invalid number in diff_fromDelta: " + w);
var g = c.substring(m, m += b);
f[v].charAt(0) == "=" ? y[p++] = new E.Diff(A, g) : y[p++] = new E.Diff(L, g);
break;
default:
if (f[v])
throw new Error("Invalid diff operation in diff_fromDelta: " + f[v]);
}
}
if (m != c.length)
throw new Error("Delta length (" + m + ") does not equal source text length (" + c.length + ").");
return y;
}, E.prototype.match_main = function(c, l, y) {
if (c == null || l == null || y == null)
throw new Error("Null input. (match_main)");
return y = Math.max(0, Math.min(y, c.length)), c == l ? 0 : c.length ? c.substring(y, y + l.length) == l ? y : this.match_bitap_(c, l, y) : -1;
}, E.prototype.match_bitap_ = function(c, l, y) {
if (l.length > this.Match_MaxBits)
throw new Error("Pattern too long for this browser.");
var p = this.match_alphabet_(l), m = this;
function f(oe, me) {
var fe = oe / l.length, le = Math.abs(y - me);
return m.Match_Distance ? fe + le / m.Match_Distance : le ? 1 : fe;
}
var v = this.Match_Threshold, w = c.indexOf(l, y);
w != -1 && (v = Math.min(f(0, w), v), w = c.lastIndexOf(l, y + l.length), w != -1 && (v = Math.min(f(0, w), v)));
var b = 1 << l.length - 1;
w = -1;
for (var g, o, C = l.length + c.length, _, D = 0; D < l.length; D++) {
for (g = 0, o = C; g < o; )
f(D, y + o) <= v ? g = o : C = o, o = Math.floor((C - g) / 2 + g);
C = o;
var M = Math.max(1, y - o + 1), P = Math.min(y + o, c.length) + l.length, V = Array(P + 2);
V[P + 1] = (1 << D) - 1;
for (var z = P; z >= M; z--) {
var Q = p[c.charAt(z - 1)];
if (D === 0 ? V[z] = (V[z + 1] << 1 | 1) & Q : V[z] = (V[z + 1] << 1 | 1) & Q | ((_[z + 1] | _[z]) << 1 | 1) | _[z + 1], V[z] & b) {
var ne = f(D, z - 1);
if (ne <= v)
if (v = ne, w = z - 1, w > y)
M = Math.max(1, 2 * y - w);
else
break;
}
}
if (f(D + 1, y) > v)
break;
_ = V;
}
return w;
}, E.prototype.match_alphabet_ = function(c) {
for (var l = {}, y = 0; y < c.length; y++)
l[c.charAt(y)] = 0;
for (var y = 0; y < c.length; y++)
l[c.charAt(y)] |= 1 << c.length - y - 1;
return l;
}, E.prototype.patch_addContext_ = function(c, l) {
if (l.length != 0) {
if (c.start2 === null)
throw Error("patch not initialized");
for (var y = l.substring(c.start2, c.start2 + c.length1), p = 0; l.indexOf(y) != l.lastIndexOf(y) && y.length < this.Match_MaxBits - this.Patch_Margin - this.Patch_Margin; )
p += this.Patch_Margin, y = l.substring(c.start2 - p, c.start2 + c.length1 + p);
p += this.Patch_Margin;
var m = l.substring(c.start2 - p, c.start2);
m && c.diffs.unshift(new E.Diff(A, m));
var f = l.substring(c.start2 + c.length1, c.start2 + c.length1 + p);
f && c.diffs.push(new E.Diff(A, f)), c.start1 -= m.length, c.start2 -= m.length, c.length1 += m.length + f.length, c.length2 += m.length + f.length;
}
}, E.prototype.patch_make = function(c, l, y) {
var p, m;
if (typeof c == "string" && typeof l == "string" && typeof y > "u")
p = /** @type {string} */
c, m = this.diff_main(
p,
/** @type {string} */
l,
!0
), m.length > 2 && (this.diff_cleanupSemantic(m), this.diff_cleanupEfficiency(m));
else if (c && typeof c == "object" && typeof l > "u" && typeof y > "u")
m = /** @type {!Array.<!diff_match_patch.Diff>} */
c, p = this.diff_text1(m);
else if (typeof c == "string" && l && typeof l == "object" && typeof y > "u")
p = /** @type {string} */
c, m = /** @type {!Array.<!diff_match_patch.Diff>} */
l;
else if (typeof c == "string" && typeof l == "string" && y && typeof y == "object")
p = /** @type {string} */
c, m = /** @type {!Array.<!diff_match_patch.Diff>} */
y;
else
throw new Error("Unknown call format to patch_make.");
if (m.length === 0)
return [];
for (var f = [], v = new E.patch_obj(), w = 0, b = 0, g = 0, o = p, C = p, _ = 0; _ < m.length; _++) {
var D = m[_][0], M = m[_][1];
switch (!w && D !== A && (v.start1 = b, v.start2 = g), D) {
case x:
v.diffs[w++] = m[_], v.length2 += M.length, C = C.substring(0, g) + M + C.substring(g);
break;
case L:
v.length1 += M.length, v.diffs[w++] = m[_], C = C.substring(0, g) + C.substring(g + M.length);
break;
case A:
M.length <= 2 * this.Patch_Margin && w && m.length != _ + 1 ? (v.diffs[w++] = m[_], v.length1 += M.length, v.length2 += M.length) : M.length >= 2 * this.Patch_Margin && w && (this.patch_addContext_(v, o), f.push(v), v = new E.patch_obj(), w = 0, o = C, b = g);
break;
}
D !== x && (b += M.length), D !== L && (g += M.length);
}
return w && (this.patch_addContext_(v, o), f.push(v)), f;
}, E.prototype.patch_deepCopy = function(c) {
for (var l = [], y = 0; y < c.length; y++) {
var p = c[y], m = new E.patch_obj();
m.diffs = [];
for (var f = 0; f < p.diffs.length; f++)
m.diffs[f] = new E.Diff(p.diffs[f][0], p.diffs[f][1]);
m.start1 = p.start1, m.start2 = p.start2, m.length1 = p.length1, m.length2 = p.length2, l[y] = m;
}
return l;
}, E.prototype.patch_apply = function(c, l) {
if (c.length == 0)
return [l, []];
c = this.patch_deepCopy(c);
var y = this.patch_addPadding(c);
l = y + l + y, this.patch_splitMax(c);
for (var p = 0, m = [], f = 0; f < c.length; f++) {
var v = c[f].start2 + p, w = this.diff_text1(c[f].diffs), b, g = -1;
if (w.length > this.Match_MaxBits ? (b = this.match_main(l, w.substring(0, this.Match_MaxBits), v), b != -1 && (g = this.match_main(l, w.substring(w.length - this.Match_MaxBits), v + w.length - this.Match_MaxBits), (g == -1 || b >= g) && (b = -1))) : b = this.match_main(l, w, v), b == -1)
m[f] = !1, p -= c[f].length2 - c[f].length1;
else {
m[f] = !0, p = b - v;
var o;
if (g == -1 ? o = l.substring(b, b + w.length) : o = l.substring(b, g + this.Match_MaxBits), w == o)
l = l.substring(0, b) + this.diff_text2(c[f].diffs) + l.substring(b + w.length);
else {
var C = this.diff_main(w, o, !1);
if (w.length > this.Match_MaxBits && this.diff_levenshtein(C) / w.length > this.Patch_DeleteThreshold)
m[f] = !1;
else {
this.diff_cleanupSemanticLossless(C);
for (var _ = 0, D, M = 0; M < c[f].diffs.length; M++) {
var P = c[f].diffs[M];
P[0] !== A && (D = this.diff_xIndex(C, _)), P[0] === x ? l = l.substring(0, b + D) + P[1] + l.substring(b + D) : P[0] === L && (l = l.substring(0, b + D) + l.substring(b + this.diff_xIndex(C, _ + P[1].length))), P[0] !== L && (_ += P[1].length);
}
}
}
}
}
return l = l.substring(y.length, l.length - y.length), [l, m];
}, E.prototype.patch_addPadding = function(c) {
for (var l = this.Patch_Margin, y = "", p = 1; p <= l; p++)
y += String.fromCharCode(p);
for (var p = 0; p < c.length; p++)
c[p].start1 += l, c[p].start2 += l;
var m = c[0], f = m.diffs;
if (f.length == 0 || f[0][0] != A)
f.unshift(new E.Diff(A, y)), m.start1 -= l, m.start2 -= l, m.length1 += l, m.length2 += l;
else if (l > f[0][1].length) {
var v = l - f[0][1].length;
f[0][1] = y.substring(f[0][1].length) + f[0][1], m.start1 -= v, m.start2 -= v, m.length1 += v, m.length2 += v;
}
if (m = c[c.length - 1], f = m.diffs, f.length == 0 || f[f.length - 1][0] != A)
f.push(new E.Diff(A, y)), m.length1 += l, m.length2 += l;
else if (l > f[f.length - 1][1].length) {
var v = l - f[f.length - 1][1].length;
f[f.length - 1][1] += y.substring(0, v), m.length1 += v, m.length2 += v;
}
return y;
}, E.prototype.patch_splitMax = function(c) {
for (var l = this.Match_MaxBits, y = 0; y < c.length; y++)
if (!(c[y].length1 <= l)) {
var p = c[y];
c.splice(y--, 1);
for (var m = p.start1, f = p.start2, v = ""; p.diffs.length !== 0; ) {
var w = new E.patch_obj(), b = !0;
for (w.start1 = m - v.length, w.start2 = f - v.length, v !== "" && (w.length1 = w.length2 = v.length, w.diffs.push(new E.Diff(A, v))); p.diffs.length !== 0 && w.length1 < l - this.Patch_Margin; ) {
var g = p.diffs[0][0], o = p.diffs[0][1];
g === x ? (w.length2 += o.length, f += o.length, w.diffs.push(p.diffs.shift()), b = !1) : g === L && w.diffs.length == 1 && w.diffs[0][0] == A && o.length > 2 * l ? (w.length1 += o.length, m += o.length, b = !1, w.diffs.push(new E.Diff(g, o)), p.diffs.shift()) : (o = o.substring(0, l - w.length1 - this.Patch_Margin), w.length1 += o.length, m += o.length, g === A ? (w.length2 += o.length, f += o.length) : b = !1, w.diffs.push(new E.Diff(g, o)), o == p.diffs[0][1] ? p.diffs.shift() : p.diffs[0][1] = p.diffs[0][1].substring(o.length));
}
v = this.diff_text2(w.diffs), v = v.substring(v.length - this.Patch_Margin);
var C = this.diff_text1(p.diffs).substring(0, this.Patch_Margin);
C !== "" && (w.length1 += C.length, w.length2 += C.length, w.diffs.length !== 0 && w.diffs[w.diffs.length - 1][0] === A ? w.diffs[w.diffs.length - 1][1] += C : w.diffs.push(new E.Diff(A, C))), b || c.splice(++y, 0, w);
}
}
}, E.prototype.patch_toText = function(c) {
for (var l = [], y = 0; y < c.length; y++)
l[y] = c[y];
return l.join("");
}, E.prototype.patch_fromText = function(c) {
var l = [];
if (!c)
return l;
for (var y = c.split(`
`), p = 0, m = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/; p < y.length; ) {
var f = y[p].match(m);
if (!f)
throw new Error("Invalid patch string: " + y[p]);
var v = new E.patch_obj();
for (l.push(v), v.start1 = parseInt(f[1], 10), f[2] === "" ? (v.start1--, v.length1 = 1) : f[2] == "0" ? v.length1 = 0 : (v.start1--, v.length1 = parseInt(f[2], 10)), v.start2 = parseInt(f[3], 10), f[4] === "" ? (v.start2--, v.length2 = 1) : f[4] == "0" ? v.length2 = 0 : (v.start2--, v.length2 = parseInt(f[4], 10)), p++; p < y.length; ) {
var w = y[p].charAt(0);
try {
var b = decodeURI(y[p].substring(1));
} catch {
throw new Error("Illegal escape in patch_fromText: " + b);
}
if (w == "-")
v.diffs.push(new E.Diff(L, b));
else if (w == "+")
v.diffs.push(new E.Diff(x, b));
else if (w == " ")
v.diffs.push(new E.Diff(A, b));
else {
if (w == "@")
break;
if (w !== "") throw new Error('Invalid patch mode "' + w + '" in: ' + b);
}
p++;
}
}
return l;
}, E.patch_obj = function() {
this.diffs = [], this.start1 = null, this.start2 = null, this.length1 = 0, this.length2 = 0;
}, E.patch_obj.prototype.toString = function() {
var c, l;
this.length1 === 0 ? c = this.start1 + ",0" : this.length1 == 1 ? c = this.start1 + 1 : c = this.start1 + 1 + "," + this.length1, this.length2 === 0 ? l = this.start2 + ",0" : this.length2 == 1 ? l = this.start2 + 1 : l = this.start2 + 1 + "," + this.length2;
for (var y = ["@@ -" + c + " +" + l + ` @@
`], p, m = 0; m < this.diffs.length; m++) {
switch (this.diffs[m][0]) {
case x:
p = "+";
break;
case L:
p = "-";
break;
case A:
p = " ";
break;
}
y[m + 1] = p + encodeURI(this.diffs[m][1]) + `
`;
}
return y.join("").replace(/%20/g, " ");
}, Z.exports = E, Z.exports.diff_match_patch = E, Z.exports.DIFF_DELETE = L, Z.exports.DIFF_INSERT = x, Z.exports.DIFF_EQUAL = A;
}
),
/***/
408: (
/***/
(Z, E, L) => {
L.d(E, {
default: () => (
/* binding */
We
)
});
var x = L(135), A = L(840), c = L(775), l = L(428), y = L(325), p = L(483), m = L(999), f = function(N) {
N === void 0 && (N = document);
var re = function(U) {
var j = document.createElement("img");
j.src = U.getAttribute("data-src"), j.addEventListener("load", function() {
!U.getAttribute("style") && !U.getAttribute("class") && !U.getAttribute("width") && !U.getAttribute("height") && j.naturalHeight > j.naturalWidth && j.naturalWidth / j.naturalHeight < document.querySelector(".vditor-reset").clientWidth / (window.innerHeight - 40) && j.naturalHeight > window.innerHeight - 40 && (U.style.height = window.innerHeight - 40 + "px"), U.src = j.src;
}), U.removeAttribute("data-src");
};
if (!("IntersectionObserver" in window))
return N.querySelectorAll("img").forEach(function(U) {
U.getAttribute("data-src") && re(U);
}), !1;
window.vditorImageIntersectionObserver ? (window.vditorImageIntersectionObserver.disconnect(), N.querySelectorAll("img").forEach(function(U) {
window.vditorImageIntersectionObserver.observe(U);
})) : (window.vditorImageIntersectionObserver = new IntersectionObserver(function(U) {
U.forEach(function(j) {
(typeof j.isIntersecting > "u" ? j.intersectionRatio !== 0 : j.isIntersecting) && j.target.getAttribute("data-src") && re(j.target);
});
}), N.querySelectorAll("img").forEach(function(U) {
window.vditorImageIntersectionObserver.observe(U);
}));
}, v = L(472), w = L(280), b = L(637), g = L(825), o = L(11), C = L(194), _ = L(436), D = L(229), M = L(145), P = L(538), V = L(413), z = L(106), Q = L(673), ne = function(N) {
document.querySelectorAll(".vditor-anchor").forEach(function(re) {
N === 1 && re.classList.add("vditor-anchor--left"), re.onclick = function() {
var U = re.getAttribute("href").substr(1), j = document.getElementById("vditorAnchor-" + U).offsetTop;
document.querySelector("html").scrollTop = j;
};
}), window.onhashchange = function() {
var re = document.getElementById("vditorAnchor-" + decodeURIComponent(window.location.hash.substr(1)));
re && (document.querySelector("html").scrollTop = re.offsetTop);
};
}, oe = L(214), me = L(810), fe = function(N, re) {
if (re === void 0 && (re = "zh_CN"), !(typeof speechSynthesis > "u" || typeof SpeechSynthesisUtterance > "u")) {
var U = function() {
var Ce = speechSynthesis.getVoices(), X, de;
return Ce.forEach(function(xe) {
xe.lang === re.replace("_", "-") && (X = xe), xe.default && (de = xe);
}), X || (X = de), X;
}, j = '<svg><use xlink:href="#vditor-icon-play"></use></svg>', pe = '<svg><use xlink:href="#vditor-icon-pause"></use></svg>';
document.getElementById("vditorIconScript") || (j = '<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>', pe = '<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');
var K = document.querySelector(".vditor-speech");
K || (K = document.createElement("button"), K.className = "vditor-speech", N.insertAdjacentElement("beforeend", K), speechSynthesis.onvoiceschanged !== void 0 && (speechSynthesis.onvoiceschanged = U));
var ge = U(), ie = new SpeechSynthesisUtterance();
ie.voice = ge, ie.onend = ie.onerror = function() {
K.style.display = "none", speechSynthesis.cancel(), K.classList.remove("vditor-speech--current"), K.innerHTML = j;
}, N.addEventListener(window.ontouchstart !== void 0 ? "touchend" : "click", function(Ce) {
var X = Ce.target;
if (X.classList.contains("vditor-speech") || X.parentElement.classList.contains("vditor-speech")) {
K.classList.contains("vditor-speech--current") ? speechSynthesis.speaking && (speechSynthesis.paused ? (speechSynthesis.resume(), K.innerHTML = pe) : (speechSynthesis.pause(), K.innerHTML = j)) : (ie.text = K.getAttribute("data-text"), speechSynthesis.speak(ie), K.classList.add("vditor-speech--current"), K.innerHTML = pe), (0, me.Hc)(window.vditorSpeechRange), N.focus();
return;
}
if (K.style.display = "none", speechSynthesis.cancel(), K.classList.remove("vditor-speech--current"), K.innerHTML = j, getSelection().rangeCount !== 0) {
var de = getSelection().getRangeAt(0), xe = de.toString().trim();
if (xe) {
window.vditorSpeechRange = de.cloneRange();
var Oe = de.getBoundingClientRect();
K.innerHTML = j, K.style.display = "block", K.style.top = Oe.top + Oe.height + document.querySelector("html").scrollTop - 20 + "px", window.ontouchstart !== void 0 ? K.style.left = Ce.changedTouches[Ce.changedTouches.length - 1].pageX + 2 + "px" : K.style.left = Ce.clientX + 2 + "px", K.setAttribute("data-text", xe);
}
}
});
}
}, le = function(N, re, U, j) {
function pe(K) {
return K instanceof U ? K : new U(function(ge) {
ge(K);
});
}
return new (U || (U = Promise))(function(K, ge) {
function ie(de) {
try {
X(j.next(de));
} catch (xe) {
ge(xe);
}
}
function Ce(de) {
try {
X(j.throw(de));
} catch (xe) {
ge(xe);
}
}
function X(de) {
de.done ? K(de.value) : pe(de.value).then(ie, Ce);
}
X((j = j.apply(N, re || [])).next());
});
}, we = function(N, re) {
var U = { label: 0, sent: function() {
if (K[0] & 1) throw K[1];
return K[1];
}, trys: [], ops: [] }, j, pe, K, ge;
return ge = { next: ie(0), throw: ie(1), return: ie(2) }, typeof Symbol == "function" && (ge[Symbol.iterator] = function() {
return this;
}), ge;
function ie(X) {
return function(de) {
return Ce([X, de]);
};
}
function Ce(X) {
if (j) throw new TypeError("Generator is already executing.");
for (; ge && (ge = 0, X[0] && (U = 0)), U; ) try {
if (j = 1, pe && (K = X[0] & 2 ? pe.return : X[0] ? pe.throw || ((K = pe.return) && K.call(pe), 0) : pe.next) && !(K = K.call(pe, X[1])).done) return K;
switch (pe = 0, K && (X = [X[0] & 2, K.value]), X[0]) {
case 0:
case 1:
K = X;
break;
case 4:
return U.label++, { value: X[1], done: !1 };
case 5:
U.label++, pe = X[1], X = [0];
continue;
case 7:
X = U.ops.pop(), U.trys.pop();
continue;
default:
if (K = U.trys, !(K = K.length > 0 && K[K.length - 1]) && (X[0] === 6 || X[0] === 2)) {
U = 0;
continue;
}
if (X[0] === 3 && (!K || X[1] > K[0] && X[1] < K[3])) {
U.label = X[1];
break;
}
if (X[0] === 6 && U.label < K[1]) {
U.label = K[1], K = X;
break;
}
if (K && U.label < K[2]) {
U.label = K[2], U.ops.push(X);
break;
}
K[2] && U.ops.pop(), U.trys.pop();
continue;
}
X = re.call(N, U);
} catch (de) {
X = [6, de], pe = 0;
} finally {
j = K = 0;
}
if (X[0] & 5) throw X[1];
return { value: X[0] ? X[1] : void 0, done: !0 };
}
}, ke = function(N) {
var re, U = {
anchor: 0,
cdn: M.g.CDN,
customEmoji: {},
emojiPath: "".concat(M.g.CDN, "/dist/images/emoji"),
hljs: M.g.HLJS_OPTIONS,
icon: "ant",
lang: "zh_CN",
markdown: M.g.MARKDOWN_OPTIONS,
math: M.g.MATH_OPTIONS,
mode: "light",
speech: {
enable: !1
},
render: {
media: {
enable: !0
}
},
theme: M.g.THEME_OPTIONS
};
return N.cdn && (!((re = N.theme) === null || re === void 0) && re.path || (U.theme.path = "".concat(N.cdn, "/dist/css/content-theme")), N.emojiPath || (U.emojiPath = "".concat(N.cdn, "/dist/images/emoji"))), (0, Q.T)(U, N);
}, ve = function(N, re) {
var U = ke(re);
return (0, V.G)("".concat(U.cdn, "/dist/js/lute/lute.min.js"), "vditorLuteScript").then(function() {
var j = (0, oe.X)({
autoSpace: U.markdown.autoSpace,
gfmAutoLink: U.markdown.gfmAutoLink,
codeBlockPreview: U.markdown.codeBlockPreview,
emojiSite: U.emojiPath,
emojis: U.customEmoji,
fixTermTypo: U.markdown.fixTermTypo,
footnotes: U.markdown.footnotes,
headingAnchor: U.anchor !== 0,
inlineMathDigit: U.math.inlineDigit,
lazyLoadImage: U.lazyLoadImage,
linkBase: U.markdown.linkBase,
linkPrefix: U.markdown.linkPrefix,
listStyle: U.markdown.listStyle,
mark: U.markdown.mark,
mathBlockPreview: U.markdown.mathBlockPreview,
paragraphBeginningSpace: U.markdown.paragraphBeginningSpace,
sanitize: U.markdown.sanitize,
toc: U.markdown.toc
});
return re?.renderers && j.SetJSRenderers({
renderers: {
Md2HTML: re.renderers
}
}), j.SetHeadingID(!0), j.Md2HTML(N);
});
}, k = function(N, re, U) {
return le(void 0, void 0, void 0, function() {
var j, pe, K, ge;
return we(this, function(ie) {
switch (ie.label) {
case 0:
return j = ke(U), [4, ve(re, j)];