@covalent/components 8.15.0-beta.12 → 8.15.0-beta.13
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/notebook/notebook.d.ts +14 -1
- package/notebook/notebook.d.ts.map +1 -1
- package/notebook-cell/notebook-cell.d.ts.map +1 -1
- package/notebook-cell.js +8 -5
- package/notebook-cell.mjs +11 -8
- package/notebook.js +12 -18
- package/notebook.mjs +812 -753
- package/package.json +1 -1
package/notebook.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { i as F0, r as
|
1
|
+
import { i as F0, r as w0, s as v0, x as B, D as S0, e as T0 } from "./query-assigned-elements-4a39219d.mjs";
|
2
2
|
import { n as su } from "./property-9b6ea53b.mjs";
|
3
3
|
import "./alert.mjs";
|
4
4
|
import "./button.mjs";
|
@@ -43,66 +43,66 @@ function I0(u) {
|
|
43
43
|
return e;
|
44
44
|
e = Mu[u] = [];
|
45
45
|
for (let t = 0; t < 128; t++) {
|
46
|
-
const
|
47
|
-
e.push(
|
46
|
+
const r = String.fromCharCode(t);
|
47
|
+
e.push(r);
|
48
48
|
}
|
49
49
|
for (let t = 0; t < u.length; t++) {
|
50
|
-
const
|
51
|
-
e[
|
50
|
+
const r = u.charCodeAt(t);
|
51
|
+
e[r] = "%" + ("0" + r.toString(16).toUpperCase()).slice(-2);
|
52
52
|
}
|
53
53
|
return e;
|
54
54
|
}
|
55
55
|
function V(u, e) {
|
56
56
|
typeof e != "string" && (e = V.defaultChars);
|
57
57
|
const t = I0(e);
|
58
|
-
return u.replace(/(%[a-f0-9]{2})+/gi, function(
|
59
|
-
let
|
60
|
-
for (let c = 0, i =
|
61
|
-
const o = parseInt(
|
58
|
+
return u.replace(/(%[a-f0-9]{2})+/gi, function(r) {
|
59
|
+
let n = "";
|
60
|
+
for (let c = 0, i = r.length; c < i; c += 3) {
|
61
|
+
const o = parseInt(r.slice(c + 1, c + 3), 16);
|
62
62
|
if (o < 128) {
|
63
|
-
|
63
|
+
n += t[o];
|
64
64
|
continue;
|
65
65
|
}
|
66
66
|
if ((o & 224) === 192 && c + 3 < i) {
|
67
|
-
const a = parseInt(
|
67
|
+
const a = parseInt(r.slice(c + 4, c + 6), 16);
|
68
68
|
if ((a & 192) === 128) {
|
69
69
|
const s = o << 6 & 1984 | a & 63;
|
70
|
-
s < 128 ?
|
70
|
+
s < 128 ? n += "��" : n += String.fromCharCode(s), c += 3;
|
71
71
|
continue;
|
72
72
|
}
|
73
73
|
}
|
74
74
|
if ((o & 240) === 224 && c + 6 < i) {
|
75
|
-
const a = parseInt(
|
75
|
+
const a = parseInt(r.slice(c + 4, c + 6), 16), s = parseInt(r.slice(c + 7, c + 9), 16);
|
76
76
|
if ((a & 192) === 128 && (s & 192) === 128) {
|
77
77
|
const l = o << 12 & 61440 | a << 6 & 4032 | s & 63;
|
78
|
-
l < 2048 || l >= 55296 && l <= 57343 ?
|
78
|
+
l < 2048 || l >= 55296 && l <= 57343 ? n += "���" : n += String.fromCharCode(l), c += 6;
|
79
79
|
continue;
|
80
80
|
}
|
81
81
|
}
|
82
82
|
if ((o & 248) === 240 && c + 9 < i) {
|
83
|
-
const a = parseInt(
|
83
|
+
const a = parseInt(r.slice(c + 4, c + 6), 16), s = parseInt(r.slice(c + 7, c + 9), 16), l = parseInt(r.slice(c + 10, c + 12), 16);
|
84
84
|
if ((a & 192) === 128 && (s & 192) === 128 && (l & 192) === 128) {
|
85
85
|
let d = o << 18 & 1835008 | a << 12 & 258048 | s << 6 & 4032 | l & 63;
|
86
|
-
d < 65536 || d > 1114111 ?
|
86
|
+
d < 65536 || d > 1114111 ? n += "����" : (d -= 65536, n += String.fromCharCode(55296 + (d >> 10), 56320 + (d & 1023))), c += 9;
|
87
87
|
continue;
|
88
88
|
}
|
89
89
|
}
|
90
|
-
|
90
|
+
n += "�";
|
91
91
|
}
|
92
|
-
return
|
92
|
+
return n;
|
93
93
|
});
|
94
94
|
}
|
95
95
|
V.defaultChars = ";/?:@&=+$,#";
|
96
96
|
V.componentChars = "";
|
97
|
-
const
|
97
|
+
const Ru = {};
|
98
98
|
function B0(u) {
|
99
|
-
let e =
|
99
|
+
let e = Ru[u];
|
100
100
|
if (e)
|
101
101
|
return e;
|
102
|
-
e =
|
102
|
+
e = Ru[u] = [];
|
103
103
|
for (let t = 0; t < 128; t++) {
|
104
|
-
const
|
105
|
-
/^[0-9a-z]$/i.test(
|
104
|
+
const r = String.fromCharCode(t);
|
105
|
+
/^[0-9a-z]$/i.test(r) ? e.push(r) : e.push("%" + ("0" + t.toString(16).toUpperCase()).slice(-2));
|
106
106
|
}
|
107
107
|
for (let t = 0; t < u.length; t++)
|
108
108
|
e[u.charCodeAt(t)] = u[t];
|
@@ -110,44 +110,44 @@ function B0(u) {
|
|
110
110
|
}
|
111
111
|
function uu(u, e, t) {
|
112
112
|
typeof e != "string" && (t = e, e = uu.defaultChars), typeof t > "u" && (t = !0);
|
113
|
-
const
|
114
|
-
let
|
113
|
+
const r = B0(e);
|
114
|
+
let n = "";
|
115
115
|
for (let c = 0, i = u.length; c < i; c++) {
|
116
116
|
const o = u.charCodeAt(c);
|
117
117
|
if (t && o === 37 && c + 2 < i && /^[0-9a-f]{2}$/i.test(u.slice(c + 1, c + 3))) {
|
118
|
-
|
118
|
+
n += u.slice(c, c + 3), c += 2;
|
119
119
|
continue;
|
120
120
|
}
|
121
121
|
if (o < 128) {
|
122
|
-
|
122
|
+
n += r[o];
|
123
123
|
continue;
|
124
124
|
}
|
125
125
|
if (o >= 55296 && o <= 57343) {
|
126
126
|
if (o >= 55296 && o <= 56319 && c + 1 < i) {
|
127
127
|
const a = u.charCodeAt(c + 1);
|
128
128
|
if (a >= 56320 && a <= 57343) {
|
129
|
-
|
129
|
+
n += encodeURIComponent(u[c] + u[c + 1]), c++;
|
130
130
|
continue;
|
131
131
|
}
|
132
132
|
}
|
133
|
-
|
133
|
+
n += "%EF%BF%BD";
|
134
134
|
continue;
|
135
135
|
}
|
136
|
-
|
136
|
+
n += encodeURIComponent(u[c]);
|
137
137
|
}
|
138
|
-
return
|
138
|
+
return n;
|
139
139
|
}
|
140
140
|
uu.defaultChars = ";/?:@&=+$,-_.!~*'()#";
|
141
141
|
uu.componentChars = "-_.!~*'()";
|
142
|
-
function
|
142
|
+
function Au(u) {
|
143
143
|
let e = "";
|
144
144
|
return e += u.protocol || "", e += u.slashes ? "//" : "", e += u.auth ? u.auth + "@" : "", u.hostname && u.hostname.indexOf(":") !== -1 ? e += "[" + u.hostname + "]" : e += u.hostname || "", e += u.port ? ":" + u.port : "", e += u.pathname || "", e += u.search || "", e += u.hash || "", e;
|
145
145
|
}
|
146
146
|
function iu() {
|
147
147
|
this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
|
148
148
|
}
|
149
|
-
const z0 = /^([a-z0-9.+-]+:)/i, M0 = /:[0-9]*$/,
|
150
|
-
`, " "], L0 = ["{", "}", "|", "\\", "^", "`"].concat(
|
149
|
+
const z0 = /^([a-z0-9.+-]+:)/i, M0 = /:[0-9]*$/, R0 = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, q0 = ["<", ">", '"', "`", " ", "\r", `
|
150
|
+
`, " "], L0 = ["{", "}", "|", "\\", "^", "`"].concat(q0), P0 = ["'"].concat(L0), qu = ["%", "/", "?", ";", "#"].concat(P0), Lu = ["/", "?", "#"], O0 = 255, Pu = /^[+a-z0-9A-Z_-]{0,63}$/, $0 = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, Ou = {
|
151
151
|
javascript: !0,
|
152
152
|
"javascript:": !0
|
153
153
|
}, $u = {
|
@@ -169,21 +169,21 @@ function Fu(u, e) {
|
|
169
169
|
return t.parse(u, e), t;
|
170
170
|
}
|
171
171
|
iu.prototype.parse = function(u, e) {
|
172
|
-
let t,
|
172
|
+
let t, r, n, c = u;
|
173
173
|
if (c = c.trim(), !e && u.split("#").length === 1) {
|
174
|
-
const s =
|
174
|
+
const s = R0.exec(c);
|
175
175
|
if (s)
|
176
176
|
return this.pathname = s[1], s[2] && (this.search = s[2]), this;
|
177
177
|
}
|
178
178
|
let i = z0.exec(c);
|
179
|
-
if (i && (i = i[0], t = i.toLowerCase(), this.protocol = i, c = c.substr(i.length)), (e || i || c.match(/^\/\/[^@\/]+@[^@\/]+/)) && (
|
179
|
+
if (i && (i = i[0], t = i.toLowerCase(), this.protocol = i, c = c.substr(i.length)), (e || i || c.match(/^\/\/[^@\/]+@[^@\/]+/)) && (n = c.substr(0, 2) === "//", n && !(i && Ou[i]) && (c = c.substr(2), this.slashes = !0)), !Ou[i] && (n || i && !$u[i])) {
|
180
180
|
let s = -1;
|
181
181
|
for (let f = 0; f < Lu.length; f++)
|
182
|
-
|
182
|
+
r = c.indexOf(Lu[f]), r !== -1 && (s === -1 || r < s) && (s = r);
|
183
183
|
let l, d;
|
184
184
|
s === -1 ? d = c.lastIndexOf("@") : d = c.lastIndexOf("@", s), d !== -1 && (l = c.slice(0, d), c = c.slice(d + 1), this.auth = l), s = -1;
|
185
|
-
for (let f = 0; f <
|
186
|
-
|
185
|
+
for (let f = 0; f < qu.length; f++)
|
186
|
+
r = c.indexOf(qu[f]), r !== -1 && (s === -1 || r < s) && (s = r);
|
187
187
|
s === -1 && (s = c.length), c[s - 1] === ":" && s--;
|
188
188
|
const b = c.slice(0, s);
|
189
189
|
c = c.slice(s), this.parseHost(b), this.hostname = this.hostname || "";
|
@@ -219,14 +219,14 @@ const N0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
219
219
|
__proto__: null,
|
220
220
|
decode: V,
|
221
221
|
encode: uu,
|
222
|
-
format:
|
222
|
+
format: Au,
|
223
223
|
parse: Fu
|
224
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
224
|
+
}, Symbol.toStringTag, { value: "Module" })), Xu = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Yu = /[\0-\x1F\x7F-\x9F]/, j0 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, wu = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, u0 = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, e0 = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, U0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
225
225
|
__proto__: null,
|
226
|
-
Any:
|
226
|
+
Any: Xu,
|
227
227
|
Cc: Yu,
|
228
228
|
Cf: j0,
|
229
|
-
P:
|
229
|
+
P: wu,
|
230
230
|
S: u0,
|
231
231
|
Z: e0
|
232
232
|
}, Symbol.toStringTag, { value: "Module" })), H0 = new Uint16Array(
|
@@ -278,42 +278,42 @@ function W0(u) {
|
|
278
278
|
var e;
|
279
279
|
return u >= 55296 && u <= 57343 || u > 1114111 ? 65533 : (e = V0.get(u)) !== null && e !== void 0 ? e : u;
|
280
280
|
}
|
281
|
-
var
|
281
|
+
var A;
|
282
282
|
(function(u) {
|
283
283
|
u[u.NUM = 35] = "NUM", u[u.SEMI = 59] = "SEMI", u[u.EQUALS = 61] = "EQUALS", u[u.ZERO = 48] = "ZERO", u[u.NINE = 57] = "NINE", u[u.LOWER_A = 97] = "LOWER_A", u[u.LOWER_F = 102] = "LOWER_F", u[u.LOWER_X = 120] = "LOWER_X", u[u.LOWER_Z = 122] = "LOWER_Z", u[u.UPPER_A = 65] = "UPPER_A", u[u.UPPER_F = 70] = "UPPER_F", u[u.UPPER_Z = 90] = "UPPER_Z";
|
284
|
-
})(
|
284
|
+
})(A || (A = {}));
|
285
285
|
const J0 = 32;
|
286
286
|
var $;
|
287
287
|
(function(u) {
|
288
288
|
u[u.VALUE_LENGTH = 49152] = "VALUE_LENGTH", u[u.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", u[u.JUMP_TABLE = 127] = "JUMP_TABLE";
|
289
289
|
})($ || ($ = {}));
|
290
290
|
function Du(u) {
|
291
|
-
return u >=
|
291
|
+
return u >= A.ZERO && u <= A.NINE;
|
292
292
|
}
|
293
293
|
function Q0(u) {
|
294
|
-
return u >=
|
295
|
-
}
|
296
|
-
function X0(u) {
|
297
|
-
return u >= y.UPPER_A && u <= y.UPPER_Z || u >= y.LOWER_A && u <= y.LOWER_Z || Du(u);
|
294
|
+
return u >= A.UPPER_A && u <= A.UPPER_F || u >= A.LOWER_A && u <= A.LOWER_F;
|
298
295
|
}
|
299
296
|
function K0(u) {
|
300
|
-
return u
|
297
|
+
return u >= A.UPPER_A && u <= A.UPPER_Z || u >= A.LOWER_A && u <= A.LOWER_Z || Du(u);
|
301
298
|
}
|
302
|
-
|
299
|
+
function X0(u) {
|
300
|
+
return u === A.EQUALS || K0(u);
|
301
|
+
}
|
302
|
+
var y;
|
303
303
|
(function(u) {
|
304
304
|
u[u.EntityStart = 0] = "EntityStart", u[u.NumericStart = 1] = "NumericStart", u[u.NumericDecimal = 2] = "NumericDecimal", u[u.NumericHex = 3] = "NumericHex", u[u.NamedEntity = 4] = "NamedEntity";
|
305
|
-
})(
|
305
|
+
})(y || (y = {}));
|
306
306
|
var O;
|
307
307
|
(function(u) {
|
308
308
|
u[u.Legacy = 0] = "Legacy", u[u.Strict = 1] = "Strict", u[u.Attribute = 2] = "Attribute";
|
309
309
|
})(O || (O = {}));
|
310
310
|
class Y0 {
|
311
|
-
constructor(e, t,
|
312
|
-
this.decodeTree = e, this.emitCodePoint = t, this.errors =
|
311
|
+
constructor(e, t, r) {
|
312
|
+
this.decodeTree = e, this.emitCodePoint = t, this.errors = r, this.state = y.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = O.Strict;
|
313
313
|
}
|
314
314
|
/** Resets the instance to make it reusable. */
|
315
315
|
startEntity(e) {
|
316
|
-
this.decodeMode = e, this.state =
|
316
|
+
this.decodeMode = e, this.state = y.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
317
317
|
}
|
318
318
|
/**
|
319
319
|
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
@@ -328,15 +328,15 @@ class Y0 {
|
|
328
328
|
*/
|
329
329
|
write(e, t) {
|
330
330
|
switch (this.state) {
|
331
|
-
case
|
332
|
-
return e.charCodeAt(t) ===
|
333
|
-
case
|
331
|
+
case y.EntityStart:
|
332
|
+
return e.charCodeAt(t) === A.NUM ? (this.state = y.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1)) : (this.state = y.NamedEntity, this.stateNamedEntity(e, t));
|
333
|
+
case y.NumericStart:
|
334
334
|
return this.stateNumericStart(e, t);
|
335
|
-
case
|
335
|
+
case y.NumericDecimal:
|
336
336
|
return this.stateNumericDecimal(e, t);
|
337
|
-
case
|
337
|
+
case y.NumericHex:
|
338
338
|
return this.stateNumericHex(e, t);
|
339
|
-
case
|
339
|
+
case y.NamedEntity:
|
340
340
|
return this.stateNamedEntity(e, t);
|
341
341
|
}
|
342
342
|
}
|
@@ -350,12 +350,12 @@ class Y0 {
|
|
350
350
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
351
351
|
*/
|
352
352
|
stateNumericStart(e, t) {
|
353
|
-
return t >= e.length ? -1 : (e.charCodeAt(t) | J0) ===
|
353
|
+
return t >= e.length ? -1 : (e.charCodeAt(t) | J0) === A.LOWER_X ? (this.state = y.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = y.NumericDecimal, this.stateNumericDecimal(e, t));
|
354
354
|
}
|
355
|
-
addToNumericResult(e, t,
|
356
|
-
if (t !==
|
357
|
-
const c =
|
358
|
-
this.result = this.result * Math.pow(
|
355
|
+
addToNumericResult(e, t, r, n) {
|
356
|
+
if (t !== r) {
|
357
|
+
const c = r - t;
|
358
|
+
this.result = this.result * Math.pow(n, c) + parseInt(e.substr(t, c), n), this.consumed += c;
|
359
359
|
}
|
360
360
|
}
|
361
361
|
/**
|
@@ -368,15 +368,15 @@ class Y0 {
|
|
368
368
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
369
369
|
*/
|
370
370
|
stateNumericHex(e, t) {
|
371
|
-
const
|
371
|
+
const r = t;
|
372
372
|
for (; t < e.length; ) {
|
373
|
-
const
|
374
|
-
if (Du(
|
373
|
+
const n = e.charCodeAt(t);
|
374
|
+
if (Du(n) || Q0(n))
|
375
375
|
t += 1;
|
376
376
|
else
|
377
|
-
return this.addToNumericResult(e,
|
377
|
+
return this.addToNumericResult(e, r, t, 16), this.emitNumericEntity(n, 3);
|
378
378
|
}
|
379
|
-
return this.addToNumericResult(e,
|
379
|
+
return this.addToNumericResult(e, r, t, 16), -1;
|
380
380
|
}
|
381
381
|
/**
|
382
382
|
* Parses a decimal numeric entity.
|
@@ -388,15 +388,15 @@ class Y0 {
|
|
388
388
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
389
389
|
*/
|
390
390
|
stateNumericDecimal(e, t) {
|
391
|
-
const
|
391
|
+
const r = t;
|
392
392
|
for (; t < e.length; ) {
|
393
|
-
const
|
394
|
-
if (Du(
|
393
|
+
const n = e.charCodeAt(t);
|
394
|
+
if (Du(n))
|
395
395
|
t += 1;
|
396
396
|
else
|
397
|
-
return this.addToNumericResult(e,
|
397
|
+
return this.addToNumericResult(e, r, t, 10), this.emitNumericEntity(n, 2);
|
398
398
|
}
|
399
|
-
return this.addToNumericResult(e,
|
399
|
+
return this.addToNumericResult(e, r, t, 10), -1;
|
400
400
|
}
|
401
401
|
/**
|
402
402
|
* Validate and emit a numeric entity.
|
@@ -412,14 +412,14 @@ class Y0 {
|
|
412
412
|
* @returns The number of characters that were consumed.
|
413
413
|
*/
|
414
414
|
emitNumericEntity(e, t) {
|
415
|
-
var
|
415
|
+
var r;
|
416
416
|
if (this.consumed <= t)
|
417
|
-
return (
|
418
|
-
if (e ===
|
417
|
+
return (r = this.errors) === null || r === void 0 || r.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
418
|
+
if (e === A.SEMI)
|
419
419
|
this.consumed += 1;
|
420
420
|
else if (this.decodeMode === O.Strict)
|
421
421
|
return 0;
|
422
|
-
return this.emitCodePoint(W0(this.result), this.consumed), this.errors && (e !==
|
422
|
+
return this.emitCodePoint(W0(this.result), this.consumed), this.errors && (e !== A.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
423
423
|
}
|
424
424
|
/**
|
425
425
|
* Parses a named entity.
|
@@ -431,17 +431,17 @@ class Y0 {
|
|
431
431
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
432
432
|
*/
|
433
433
|
stateNamedEntity(e, t) {
|
434
|
-
const { decodeTree:
|
435
|
-
let
|
434
|
+
const { decodeTree: r } = this;
|
435
|
+
let n = r[this.treeIndex], c = (n & $.VALUE_LENGTH) >> 14;
|
436
436
|
for (; t < e.length; t++, this.excess++) {
|
437
437
|
const i = e.charCodeAt(t);
|
438
|
-
if (this.treeIndex = ue(
|
438
|
+
if (this.treeIndex = ue(r, n, this.treeIndex + Math.max(1, c), i), this.treeIndex < 0)
|
439
439
|
return this.result === 0 || // If we are parsing an attribute
|
440
440
|
this.decodeMode === O.Attribute && // We shouldn't have consumed any characters after the entity,
|
441
441
|
(c === 0 || // And there should be no invalid characters.
|
442
|
-
|
443
|
-
if (
|
444
|
-
if (i ===
|
442
|
+
X0(i)) ? 0 : this.emitNotTerminatedNamedEntity();
|
443
|
+
if (n = r[this.treeIndex], c = (n & $.VALUE_LENGTH) >> 14, c !== 0) {
|
444
|
+
if (i === A.SEMI)
|
445
445
|
return this.emitNamedEntityData(this.treeIndex, c, this.consumed + this.excess);
|
446
446
|
this.decodeMode !== O.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
|
447
447
|
}
|
@@ -455,8 +455,8 @@ class Y0 {
|
|
455
455
|
*/
|
456
456
|
emitNotTerminatedNamedEntity() {
|
457
457
|
var e;
|
458
|
-
const { result: t, decodeTree:
|
459
|
-
return this.emitNamedEntityData(t,
|
458
|
+
const { result: t, decodeTree: r } = this, n = (r[t] & $.VALUE_LENGTH) >> 14;
|
459
|
+
return this.emitNamedEntityData(t, n, this.consumed), (e = this.errors) === null || e === void 0 || e.missingSemicolonAfterCharacterReference(), this.consumed;
|
460
460
|
}
|
461
461
|
/**
|
462
462
|
* Emit a named entity.
|
@@ -467,9 +467,9 @@ class Y0 {
|
|
467
467
|
*
|
468
468
|
* @returns The number of characters consumed.
|
469
469
|
*/
|
470
|
-
emitNamedEntityData(e, t,
|
471
|
-
const { decodeTree:
|
472
|
-
return this.emitCodePoint(t === 1 ?
|
470
|
+
emitNamedEntityData(e, t, r) {
|
471
|
+
const { decodeTree: n } = this;
|
472
|
+
return this.emitCodePoint(t === 1 ? n[e] & ~$.VALUE_LENGTH : n[e + 1], r), t === 3 && this.emitCodePoint(n[e + 2], r), r;
|
473
473
|
}
|
474
474
|
/**
|
475
475
|
* Signal to the parser that the end of the input was reached.
|
@@ -481,28 +481,28 @@ class Y0 {
|
|
481
481
|
end() {
|
482
482
|
var e;
|
483
483
|
switch (this.state) {
|
484
|
-
case
|
484
|
+
case y.NamedEntity:
|
485
485
|
return this.result !== 0 && (this.decodeMode !== O.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
486
|
-
case
|
486
|
+
case y.NumericDecimal:
|
487
487
|
return this.emitNumericEntity(0, 2);
|
488
|
-
case
|
488
|
+
case y.NumericHex:
|
489
489
|
return this.emitNumericEntity(0, 3);
|
490
|
-
case
|
490
|
+
case y.NumericStart:
|
491
491
|
return (e = this.errors) === null || e === void 0 || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
492
|
-
case
|
492
|
+
case y.EntityStart:
|
493
493
|
return 0;
|
494
494
|
}
|
495
495
|
}
|
496
496
|
}
|
497
497
|
function t0(u) {
|
498
498
|
let e = "";
|
499
|
-
const t = new Y0(u, (
|
500
|
-
return function(
|
499
|
+
const t = new Y0(u, (r) => e += G0(r));
|
500
|
+
return function(n, c) {
|
501
501
|
let i = 0, o = 0;
|
502
|
-
for (; (o =
|
503
|
-
e +=
|
502
|
+
for (; (o = n.indexOf("&", o)) >= 0; ) {
|
503
|
+
e += n.slice(i, o), t.startEntity(c);
|
504
504
|
const s = t.write(
|
505
|
-
|
505
|
+
n,
|
506
506
|
// Skip the "&"
|
507
507
|
o + 1
|
508
508
|
);
|
@@ -512,57 +512,57 @@ function t0(u) {
|
|
512
512
|
}
|
513
513
|
i = o + s, o = s === 0 ? i + 1 : i;
|
514
514
|
}
|
515
|
-
const a = e +
|
515
|
+
const a = e + n.slice(i);
|
516
516
|
return e = "", a;
|
517
517
|
};
|
518
518
|
}
|
519
|
-
function ue(u, e, t,
|
520
|
-
const
|
521
|
-
if (
|
522
|
-
return c !== 0 &&
|
519
|
+
function ue(u, e, t, r) {
|
520
|
+
const n = (e & $.BRANCH_LENGTH) >> 7, c = e & $.JUMP_TABLE;
|
521
|
+
if (n === 0)
|
522
|
+
return c !== 0 && r === c ? t : -1;
|
523
523
|
if (c) {
|
524
|
-
const a =
|
525
|
-
return a < 0 || a >=
|
524
|
+
const a = r - c;
|
525
|
+
return a < 0 || a >= n ? -1 : u[t + a] - 1;
|
526
526
|
}
|
527
|
-
let i = t, o = i +
|
527
|
+
let i = t, o = i + n - 1;
|
528
528
|
for (; i <= o; ) {
|
529
529
|
const a = i + o >>> 1, s = u[a];
|
530
|
-
if (s <
|
530
|
+
if (s < r)
|
531
531
|
i = a + 1;
|
532
|
-
else if (s >
|
532
|
+
else if (s > r)
|
533
533
|
o = a - 1;
|
534
534
|
else
|
535
|
-
return u[a +
|
535
|
+
return u[a + n];
|
536
536
|
}
|
537
537
|
return -1;
|
538
538
|
}
|
539
539
|
const ee = t0(H0);
|
540
540
|
t0(Z0);
|
541
|
-
function
|
541
|
+
function n0(u, e = O.Legacy) {
|
542
542
|
return ee(u, e);
|
543
543
|
}
|
544
544
|
function te(u) {
|
545
545
|
return Object.prototype.toString.call(u);
|
546
546
|
}
|
547
|
-
function
|
547
|
+
function vu(u) {
|
548
548
|
return te(u) === "[object String]";
|
549
549
|
}
|
550
|
-
const
|
551
|
-
function
|
552
|
-
return
|
550
|
+
const ne = Object.prototype.hasOwnProperty;
|
551
|
+
function re(u, e) {
|
552
|
+
return ne.call(u, e);
|
553
553
|
}
|
554
554
|
function lu(u) {
|
555
555
|
return Array.prototype.slice.call(arguments, 1).forEach(function(t) {
|
556
556
|
if (t) {
|
557
557
|
if (typeof t != "object")
|
558
558
|
throw new TypeError(t + "must be object");
|
559
|
-
Object.keys(t).forEach(function(
|
560
|
-
u[
|
559
|
+
Object.keys(t).forEach(function(r) {
|
560
|
+
u[r] = t[r];
|
561
561
|
});
|
562
562
|
}
|
563
563
|
}), u;
|
564
564
|
}
|
565
|
-
function
|
565
|
+
function r0(u, e, t) {
|
566
566
|
return [].concat(u.slice(0, e), t, u.slice(e + 1));
|
567
567
|
}
|
568
568
|
function Su(u) {
|
@@ -579,18 +579,18 @@ function ou(u) {
|
|
579
579
|
const c0 = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, ce = /&([a-z#][a-z0-9]{1,31});/gi, ie = new RegExp(c0.source + "|" + ce.source, "gi"), oe = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
|
580
580
|
function ae(u, e) {
|
581
581
|
if (e.charCodeAt(0) === 35 && oe.test(e)) {
|
582
|
-
const
|
583
|
-
return Su(
|
582
|
+
const r = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
|
583
|
+
return Su(r) ? ou(r) : u;
|
584
584
|
}
|
585
|
-
const t =
|
585
|
+
const t = n0(u);
|
586
586
|
return t !== u ? t : u;
|
587
587
|
}
|
588
588
|
function se(u) {
|
589
589
|
return u.indexOf("\\") < 0 ? u : u.replace(c0, "$1");
|
590
590
|
}
|
591
591
|
function G(u) {
|
592
|
-
return u.indexOf("\\") < 0 && u.indexOf("&") < 0 ? u : u.replace(ie, function(e, t,
|
593
|
-
return t || ae(e,
|
592
|
+
return u.indexOf("\\") < 0 && u.indexOf("&") < 0 ? u : u.replace(ie, function(e, t, r) {
|
593
|
+
return t || ae(e, r);
|
594
594
|
});
|
595
595
|
}
|
596
596
|
const le = /[&<>"]/, fe = /[&<>"]/g, de = {
|
@@ -636,10 +636,10 @@ function Q(u) {
|
|
636
636
|
}
|
637
637
|
return !1;
|
638
638
|
}
|
639
|
-
function X(u) {
|
640
|
-
return vu.test(u) || u0.test(u);
|
641
|
-
}
|
642
639
|
function K(u) {
|
640
|
+
return wu.test(u) || u0.test(u);
|
641
|
+
}
|
642
|
+
function X(u) {
|
643
643
|
switch (u) {
|
644
644
|
case 33:
|
645
645
|
case 34:
|
@@ -683,16 +683,16 @@ function fu(u) {
|
|
683
683
|
}
|
684
684
|
const xe = { mdurl: N0, ucmicro: U0 }, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
685
685
|
__proto__: null,
|
686
|
-
arrayReplaceAt:
|
686
|
+
arrayReplaceAt: r0,
|
687
687
|
assign: lu,
|
688
688
|
escapeHtml: N,
|
689
689
|
escapeRE: pe,
|
690
690
|
fromCodePoint: ou,
|
691
|
-
has:
|
692
|
-
isMdAsciiPunct:
|
693
|
-
isPunctChar:
|
691
|
+
has: re,
|
692
|
+
isMdAsciiPunct: X,
|
693
|
+
isPunctChar: K,
|
694
694
|
isSpace: E,
|
695
|
-
isString:
|
695
|
+
isString: vu,
|
696
696
|
isValidEntityCode: Su,
|
697
697
|
isWhiteSpace: Q,
|
698
698
|
lib: xe,
|
@@ -701,65 +701,65 @@ const xe = { mdurl: N0, ucmicro: U0 }, _e = /* @__PURE__ */ Object.freeze(/* @__
|
|
701
701
|
unescapeMd: se
|
702
702
|
}, Symbol.toStringTag, { value: "Module" }));
|
703
703
|
function me(u, e, t) {
|
704
|
-
let
|
704
|
+
let r, n, c, i;
|
705
705
|
const o = u.posMax, a = u.pos;
|
706
|
-
for (u.pos = e + 1,
|
707
|
-
if (c = u.src.charCodeAt(u.pos), c === 93 && (
|
708
|
-
|
706
|
+
for (u.pos = e + 1, r = 1; u.pos < o; ) {
|
707
|
+
if (c = u.src.charCodeAt(u.pos), c === 93 && (r--, r === 0)) {
|
708
|
+
n = !0;
|
709
709
|
break;
|
710
710
|
}
|
711
711
|
if (i = u.pos, u.md.inline.skipToken(u), c === 91) {
|
712
712
|
if (i === u.pos - 1)
|
713
|
-
|
713
|
+
r++;
|
714
714
|
else if (t)
|
715
715
|
return u.pos = a, -1;
|
716
716
|
}
|
717
717
|
}
|
718
718
|
let s = -1;
|
719
|
-
return
|
719
|
+
return n && (s = u.pos), u.pos = a, s;
|
720
720
|
}
|
721
721
|
function ge(u, e, t) {
|
722
|
-
let
|
722
|
+
let r, n = e;
|
723
723
|
const c = {
|
724
724
|
ok: !1,
|
725
725
|
pos: 0,
|
726
726
|
str: ""
|
727
727
|
};
|
728
|
-
if (u.charCodeAt(
|
729
|
-
for (
|
730
|
-
if (
|
728
|
+
if (u.charCodeAt(n) === 60) {
|
729
|
+
for (n++; n < t; ) {
|
730
|
+
if (r = u.charCodeAt(n), r === 10 || r === 60)
|
731
731
|
return c;
|
732
|
-
if (
|
733
|
-
return c.pos =
|
734
|
-
if (
|
735
|
-
|
732
|
+
if (r === 62)
|
733
|
+
return c.pos = n + 1, c.str = G(u.slice(e + 1, n)), c.ok = !0, c;
|
734
|
+
if (r === 92 && n + 1 < t) {
|
735
|
+
n += 2;
|
736
736
|
continue;
|
737
737
|
}
|
738
|
-
|
738
|
+
n++;
|
739
739
|
}
|
740
740
|
return c;
|
741
741
|
}
|
742
742
|
let i = 0;
|
743
|
-
for (;
|
744
|
-
if (
|
745
|
-
if (u.charCodeAt(
|
743
|
+
for (; n < t && (r = u.charCodeAt(n), !(r === 32 || r < 32 || r === 127)); ) {
|
744
|
+
if (r === 92 && n + 1 < t) {
|
745
|
+
if (u.charCodeAt(n + 1) === 32)
|
746
746
|
break;
|
747
|
-
|
747
|
+
n += 2;
|
748
748
|
continue;
|
749
749
|
}
|
750
|
-
if (
|
750
|
+
if (r === 40 && (i++, i > 32))
|
751
751
|
return c;
|
752
|
-
if (
|
752
|
+
if (r === 41) {
|
753
753
|
if (i === 0)
|
754
754
|
break;
|
755
755
|
i--;
|
756
756
|
}
|
757
|
-
|
757
|
+
n++;
|
758
758
|
}
|
759
|
-
return e ===
|
759
|
+
return e === n || i !== 0 || (c.str = G(u.slice(e, n)), c.pos = n, c.ok = !0), c;
|
760
760
|
}
|
761
|
-
function ke(u, e, t,
|
762
|
-
let
|
761
|
+
function ke(u, e, t, r) {
|
762
|
+
let n, c = e;
|
763
763
|
const i = {
|
764
764
|
// if `true`, this is a valid link title
|
765
765
|
ok: !1,
|
@@ -772,8 +772,8 @@ function ke(u, e, t, n) {
|
|
772
772
|
// expected closing marker character code
|
773
773
|
marker: 0
|
774
774
|
};
|
775
|
-
if (
|
776
|
-
i.str =
|
775
|
+
if (r)
|
776
|
+
i.str = r.str, i.marker = r.marker;
|
777
777
|
else {
|
778
778
|
if (c >= t)
|
779
779
|
return i;
|
@@ -783,11 +783,11 @@ function ke(u, e, t, n) {
|
|
783
783
|
e++, c++, o === 40 && (o = 41), i.marker = o;
|
784
784
|
}
|
785
785
|
for (; c < t; ) {
|
786
|
-
if (
|
786
|
+
if (n = u.charCodeAt(c), n === i.marker)
|
787
787
|
return i.pos = c + 1, i.str += G(u.slice(e, c)), i.ok = !0, i;
|
788
|
-
if (
|
788
|
+
if (n === 40 && i.marker === 41)
|
789
789
|
return i;
|
790
|
-
|
790
|
+
n === 92 && c + 1 < t && c++, c++;
|
791
791
|
}
|
792
792
|
return i.can_continue = !0, i.str += G(u.slice(e, c)), i;
|
793
793
|
}
|
@@ -796,17 +796,17 @@ const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
796
796
|
parseLinkDestination: ge,
|
797
797
|
parseLinkLabel: me,
|
798
798
|
parseLinkTitle: ke
|
799
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
800
|
-
|
799
|
+
}, Symbol.toStringTag, { value: "Module" })), R = {};
|
800
|
+
R.code_inline = function(u, e, t, r, n) {
|
801
801
|
const c = u[e];
|
802
|
-
return "<code" +
|
802
|
+
return "<code" + n.renderAttrs(c) + ">" + N(c.content) + "</code>";
|
803
803
|
};
|
804
|
-
|
804
|
+
R.code_block = function(u, e, t, r, n) {
|
805
805
|
const c = u[e];
|
806
|
-
return "<pre" +
|
806
|
+
return "<pre" + n.renderAttrs(c) + "><code>" + N(u[e].content) + `</code></pre>
|
807
807
|
`;
|
808
808
|
};
|
809
|
-
|
809
|
+
R.fence = function(u, e, t, r, n) {
|
810
810
|
const c = u[e], i = c.info ? G(c.info).trim() : "";
|
811
811
|
let o = "", a = "";
|
812
812
|
if (i) {
|
@@ -823,192 +823,192 @@ q.fence = function(u, e, t, n, r) {
|
|
823
823
|
const b = {
|
824
824
|
attrs: d
|
825
825
|
};
|
826
|
-
return `<pre><code${
|
826
|
+
return `<pre><code${n.renderAttrs(b)}>${s}</code></pre>
|
827
827
|
`;
|
828
828
|
}
|
829
|
-
return `<pre><code${
|
829
|
+
return `<pre><code${n.renderAttrs(c)}>${s}</code></pre>
|
830
830
|
`;
|
831
831
|
};
|
832
|
-
|
832
|
+
R.image = function(u, e, t, r, n) {
|
833
833
|
const c = u[e];
|
834
|
-
return c.attrs[c.attrIndex("alt")][1] =
|
834
|
+
return c.attrs[c.attrIndex("alt")][1] = n.renderInlineAsText(c.children, t, r), n.renderToken(u, e, t);
|
835
835
|
};
|
836
|
-
|
836
|
+
R.hardbreak = function(u, e, t) {
|
837
837
|
return t.xhtmlOut ? `<br />
|
838
838
|
` : `<br>
|
839
839
|
`;
|
840
840
|
};
|
841
|
-
|
841
|
+
R.softbreak = function(u, e, t) {
|
842
842
|
return t.breaks ? t.xhtmlOut ? `<br />
|
843
843
|
` : `<br>
|
844
844
|
` : `
|
845
845
|
`;
|
846
846
|
};
|
847
|
-
|
847
|
+
R.text = function(u, e) {
|
848
848
|
return N(u[e].content);
|
849
849
|
};
|
850
|
-
|
850
|
+
R.html_block = function(u, e) {
|
851
851
|
return u[e].content;
|
852
852
|
};
|
853
|
-
|
853
|
+
R.html_inline = function(u, e) {
|
854
854
|
return u[e].content;
|
855
855
|
};
|
856
856
|
function W() {
|
857
|
-
this.rules = lu({},
|
857
|
+
this.rules = lu({}, R);
|
858
858
|
}
|
859
859
|
W.prototype.renderAttrs = function(e) {
|
860
|
-
let t,
|
860
|
+
let t, r, n;
|
861
861
|
if (!e.attrs)
|
862
862
|
return "";
|
863
|
-
for (
|
864
|
-
|
865
|
-
return
|
863
|
+
for (n = "", t = 0, r = e.attrs.length; t < r; t++)
|
864
|
+
n += " " + N(e.attrs[t][0]) + '="' + N(e.attrs[t][1]) + '"';
|
865
|
+
return n;
|
866
866
|
};
|
867
|
-
W.prototype.renderToken = function(e, t,
|
868
|
-
const
|
867
|
+
W.prototype.renderToken = function(e, t, r) {
|
868
|
+
const n = e[t];
|
869
869
|
let c = "";
|
870
|
-
if (
|
870
|
+
if (n.hidden)
|
871
871
|
return "";
|
872
|
-
|
873
|
-
`), c += (
|
872
|
+
n.block && n.nesting !== -1 && t && e[t - 1].hidden && (c += `
|
873
|
+
`), c += (n.nesting === -1 ? "</" : "<") + n.tag, c += this.renderAttrs(n), n.nesting === 0 && r.xhtmlOut && (c += " /");
|
874
874
|
let i = !1;
|
875
|
-
if (
|
875
|
+
if (n.block && (i = !0, n.nesting === 1 && t + 1 < e.length)) {
|
876
876
|
const o = e[t + 1];
|
877
|
-
(o.type === "inline" || o.hidden || o.nesting === -1 && o.tag ===
|
877
|
+
(o.type === "inline" || o.hidden || o.nesting === -1 && o.tag === n.tag) && (i = !1);
|
878
878
|
}
|
879
879
|
return c += i ? `>
|
880
880
|
` : ">", c;
|
881
881
|
};
|
882
882
|
W.prototype.renderInline = function(u, e, t) {
|
883
|
-
let
|
884
|
-
const
|
883
|
+
let r = "";
|
884
|
+
const n = this.rules;
|
885
885
|
for (let c = 0, i = u.length; c < i; c++) {
|
886
886
|
const o = u[c].type;
|
887
|
-
typeof
|
887
|
+
typeof n[o] < "u" ? r += n[o](u, c, e, t, this) : r += this.renderToken(u, c, e);
|
888
888
|
}
|
889
|
-
return
|
889
|
+
return r;
|
890
890
|
};
|
891
891
|
W.prototype.renderInlineAsText = function(u, e, t) {
|
892
|
-
let
|
893
|
-
for (let
|
894
|
-
switch (u[
|
892
|
+
let r = "";
|
893
|
+
for (let n = 0, c = u.length; n < c; n++)
|
894
|
+
switch (u[n].type) {
|
895
895
|
case "text":
|
896
|
-
|
896
|
+
r += u[n].content;
|
897
897
|
break;
|
898
898
|
case "image":
|
899
|
-
|
899
|
+
r += this.renderInlineAsText(u[n].children, e, t);
|
900
900
|
break;
|
901
901
|
case "html_inline":
|
902
902
|
case "html_block":
|
903
|
-
|
903
|
+
r += u[n].content;
|
904
904
|
break;
|
905
905
|
case "softbreak":
|
906
906
|
case "hardbreak":
|
907
|
-
|
907
|
+
r += `
|
908
908
|
`;
|
909
909
|
break;
|
910
910
|
}
|
911
|
-
return
|
911
|
+
return r;
|
912
912
|
};
|
913
913
|
W.prototype.render = function(u, e, t) {
|
914
|
-
let
|
915
|
-
const
|
914
|
+
let r = "";
|
915
|
+
const n = this.rules;
|
916
916
|
for (let c = 0, i = u.length; c < i; c++) {
|
917
917
|
const o = u[c].type;
|
918
|
-
o === "inline" ?
|
918
|
+
o === "inline" ? r += this.renderInline(u[c].children, e, t) : typeof n[o] < "u" ? r += n[o](u, c, e, t, this) : r += this.renderToken(u, c, e, t);
|
919
919
|
}
|
920
|
-
return
|
920
|
+
return r;
|
921
921
|
};
|
922
|
-
function
|
922
|
+
function w() {
|
923
923
|
this.__rules__ = [], this.__cache__ = null;
|
924
924
|
}
|
925
|
-
|
925
|
+
w.prototype.__find__ = function(u) {
|
926
926
|
for (let e = 0; e < this.__rules__.length; e++)
|
927
927
|
if (this.__rules__[e].name === u)
|
928
928
|
return e;
|
929
929
|
return -1;
|
930
930
|
};
|
931
|
-
|
931
|
+
w.prototype.__compile__ = function() {
|
932
932
|
const u = this, e = [""];
|
933
933
|
u.__rules__.forEach(function(t) {
|
934
|
-
t.enabled && t.alt.forEach(function(
|
935
|
-
e.indexOf(
|
934
|
+
t.enabled && t.alt.forEach(function(r) {
|
935
|
+
e.indexOf(r) < 0 && e.push(r);
|
936
936
|
});
|
937
937
|
}), u.__cache__ = {}, e.forEach(function(t) {
|
938
|
-
u.__cache__[t] = [], u.__rules__.forEach(function(
|
939
|
-
|
938
|
+
u.__cache__[t] = [], u.__rules__.forEach(function(r) {
|
939
|
+
r.enabled && (t && r.alt.indexOf(t) < 0 || u.__cache__[t].push(r.fn));
|
940
940
|
});
|
941
941
|
});
|
942
942
|
};
|
943
|
-
|
944
|
-
const
|
945
|
-
if (
|
943
|
+
w.prototype.at = function(u, e, t) {
|
944
|
+
const r = this.__find__(u), n = t || {};
|
945
|
+
if (r === -1)
|
946
946
|
throw new Error("Parser rule not found: " + u);
|
947
|
-
this.__rules__[
|
947
|
+
this.__rules__[r].fn = e, this.__rules__[r].alt = n.alt || [], this.__cache__ = null;
|
948
948
|
};
|
949
|
-
|
950
|
-
const
|
951
|
-
if (
|
949
|
+
w.prototype.before = function(u, e, t, r) {
|
950
|
+
const n = this.__find__(u), c = r || {};
|
951
|
+
if (n === -1)
|
952
952
|
throw new Error("Parser rule not found: " + u);
|
953
|
-
this.__rules__.splice(
|
953
|
+
this.__rules__.splice(n, 0, {
|
954
954
|
name: e,
|
955
955
|
enabled: !0,
|
956
956
|
fn: t,
|
957
957
|
alt: c.alt || []
|
958
958
|
}), this.__cache__ = null;
|
959
959
|
};
|
960
|
-
|
961
|
-
const
|
962
|
-
if (
|
960
|
+
w.prototype.after = function(u, e, t, r) {
|
961
|
+
const n = this.__find__(u), c = r || {};
|
962
|
+
if (n === -1)
|
963
963
|
throw new Error("Parser rule not found: " + u);
|
964
|
-
this.__rules__.splice(
|
964
|
+
this.__rules__.splice(n + 1, 0, {
|
965
965
|
name: e,
|
966
966
|
enabled: !0,
|
967
967
|
fn: t,
|
968
968
|
alt: c.alt || []
|
969
969
|
}), this.__cache__ = null;
|
970
970
|
};
|
971
|
-
|
972
|
-
const
|
971
|
+
w.prototype.push = function(u, e, t) {
|
972
|
+
const r = t || {};
|
973
973
|
this.__rules__.push({
|
974
974
|
name: u,
|
975
975
|
enabled: !0,
|
976
976
|
fn: e,
|
977
|
-
alt:
|
977
|
+
alt: r.alt || []
|
978
978
|
}), this.__cache__ = null;
|
979
979
|
};
|
980
|
-
|
980
|
+
w.prototype.enable = function(u, e) {
|
981
981
|
Array.isArray(u) || (u = [u]);
|
982
982
|
const t = [];
|
983
|
-
return u.forEach(function(
|
984
|
-
const
|
985
|
-
if (
|
983
|
+
return u.forEach(function(r) {
|
984
|
+
const n = this.__find__(r);
|
985
|
+
if (n < 0) {
|
986
986
|
if (e)
|
987
987
|
return;
|
988
|
-
throw new Error("Rules manager: invalid rule name " +
|
988
|
+
throw new Error("Rules manager: invalid rule name " + r);
|
989
989
|
}
|
990
|
-
this.__rules__[
|
990
|
+
this.__rules__[n].enabled = !0, t.push(r);
|
991
991
|
}, this), this.__cache__ = null, t;
|
992
992
|
};
|
993
|
-
|
993
|
+
w.prototype.enableOnly = function(u, e) {
|
994
994
|
Array.isArray(u) || (u = [u]), this.__rules__.forEach(function(t) {
|
995
995
|
t.enabled = !1;
|
996
996
|
}), this.enable(u, e);
|
997
997
|
};
|
998
|
-
|
998
|
+
w.prototype.disable = function(u, e) {
|
999
999
|
Array.isArray(u) || (u = [u]);
|
1000
1000
|
const t = [];
|
1001
|
-
return u.forEach(function(
|
1002
|
-
const
|
1003
|
-
if (
|
1001
|
+
return u.forEach(function(r) {
|
1002
|
+
const n = this.__find__(r);
|
1003
|
+
if (n < 0) {
|
1004
1004
|
if (e)
|
1005
1005
|
return;
|
1006
|
-
throw new Error("Rules manager: invalid rule name " +
|
1006
|
+
throw new Error("Rules manager: invalid rule name " + r);
|
1007
1007
|
}
|
1008
|
-
this.__rules__[
|
1008
|
+
this.__rules__[n].enabled = !1, t.push(r);
|
1009
1009
|
}, this), this.__cache__ = null, t;
|
1010
1010
|
};
|
1011
|
-
|
1011
|
+
w.prototype.getRules = function(u) {
|
1012
1012
|
return this.__cache__ === null && this.__compile__(), this.__cache__[u] || [];
|
1013
1013
|
};
|
1014
1014
|
function I(u, e, t) {
|
@@ -1018,74 +1018,74 @@ I.prototype.attrIndex = function(e) {
|
|
1018
1018
|
if (!this.attrs)
|
1019
1019
|
return -1;
|
1020
1020
|
const t = this.attrs;
|
1021
|
-
for (let
|
1022
|
-
if (t[
|
1023
|
-
return
|
1021
|
+
for (let r = 0, n = t.length; r < n; r++)
|
1022
|
+
if (t[r][0] === e)
|
1023
|
+
return r;
|
1024
1024
|
return -1;
|
1025
1025
|
};
|
1026
1026
|
I.prototype.attrPush = function(e) {
|
1027
1027
|
this.attrs ? this.attrs.push(e) : this.attrs = [e];
|
1028
1028
|
};
|
1029
1029
|
I.prototype.attrSet = function(e, t) {
|
1030
|
-
const
|
1031
|
-
|
1030
|
+
const r = this.attrIndex(e), n = [e, t];
|
1031
|
+
r < 0 ? this.attrPush(n) : this.attrs[r] = n;
|
1032
1032
|
};
|
1033
1033
|
I.prototype.attrGet = function(e) {
|
1034
1034
|
const t = this.attrIndex(e);
|
1035
|
-
let
|
1036
|
-
return t >= 0 && (
|
1035
|
+
let r = null;
|
1036
|
+
return t >= 0 && (r = this.attrs[t][1]), r;
|
1037
1037
|
};
|
1038
1038
|
I.prototype.attrJoin = function(e, t) {
|
1039
|
-
const
|
1040
|
-
|
1039
|
+
const r = this.attrIndex(e);
|
1040
|
+
r < 0 ? this.attrPush([e, t]) : this.attrs[r][1] = this.attrs[r][1] + " " + t;
|
1041
1041
|
};
|
1042
1042
|
function i0(u, e, t) {
|
1043
1043
|
this.src = u, this.env = t, this.tokens = [], this.inlineMode = !1, this.md = e;
|
1044
1044
|
}
|
1045
1045
|
i0.prototype.Token = I;
|
1046
1046
|
const De = /\r\n?|\n/g, Ee = /\0/g;
|
1047
|
-
function
|
1047
|
+
function ye(u) {
|
1048
1048
|
let e;
|
1049
1049
|
e = u.src.replace(De, `
|
1050
1050
|
`), e = e.replace(Ee, "�"), u.src = e;
|
1051
1051
|
}
|
1052
|
-
function
|
1052
|
+
function Ae(u) {
|
1053
1053
|
let e;
|
1054
1054
|
u.inlineMode ? (e = new u.Token("inline", "", 0), e.content = u.src, e.map = [0, 1], e.children = [], u.tokens.push(e)) : u.md.block.parse(u.src, u.md, u.env, u.tokens);
|
1055
1055
|
}
|
1056
1056
|
function Fe(u) {
|
1057
1057
|
const e = u.tokens;
|
1058
|
-
for (let t = 0,
|
1059
|
-
const
|
1060
|
-
|
1058
|
+
for (let t = 0, r = e.length; t < r; t++) {
|
1059
|
+
const n = e[t];
|
1060
|
+
n.type === "inline" && u.md.inline.parse(n.content, u.md, u.env, n.children);
|
1061
1061
|
}
|
1062
1062
|
}
|
1063
|
-
function
|
1063
|
+
function we(u) {
|
1064
1064
|
return /^<a[>\s]/i.test(u);
|
1065
1065
|
}
|
1066
|
-
function
|
1066
|
+
function ve(u) {
|
1067
1067
|
return /^<\/a\s*>/i.test(u);
|
1068
1068
|
}
|
1069
1069
|
function Se(u) {
|
1070
1070
|
const e = u.tokens;
|
1071
1071
|
if (u.md.options.linkify)
|
1072
|
-
for (let t = 0,
|
1072
|
+
for (let t = 0, r = e.length; t < r; t++) {
|
1073
1073
|
if (e[t].type !== "inline" || !u.md.linkify.pretest(e[t].content))
|
1074
1074
|
continue;
|
1075
|
-
let
|
1076
|
-
for (let i =
|
1077
|
-
const o =
|
1075
|
+
let n = e[t].children, c = 0;
|
1076
|
+
for (let i = n.length - 1; i >= 0; i--) {
|
1077
|
+
const o = n[i];
|
1078
1078
|
if (o.type === "link_close") {
|
1079
|
-
for (i--;
|
1079
|
+
for (i--; n[i].level !== o.level && n[i].type !== "link_open"; )
|
1080
1080
|
i--;
|
1081
1081
|
continue;
|
1082
1082
|
}
|
1083
|
-
if (o.type === "html_inline" && (
|
1083
|
+
if (o.type === "html_inline" && (we(o.content) && c > 0 && c--, ve(o.content) && c++), !(c > 0) && o.type === "text" && u.md.linkify.test(o.content)) {
|
1084
1084
|
const a = o.content;
|
1085
1085
|
let s = u.md.linkify.match(a);
|
1086
1086
|
const l = [];
|
1087
1087
|
let d = o.level, b = 0;
|
1088
|
-
s.length > 0 && s[0].index === 0 && i > 0 &&
|
1088
|
+
s.length > 0 && s[0].index === 0 && i > 0 && n[i - 1].type === "text_special" && (s = s.slice(1));
|
1089
1089
|
for (let h = 0; h < s.length; h++) {
|
1090
1090
|
const f = s[h].url, g = u.md.normalizeLink(f);
|
1091
1091
|
if (!u.md.validateLink(g))
|
@@ -1108,7 +1108,7 @@ function Se(u) {
|
|
1108
1108
|
const h = new u.Token("text", "", 0);
|
1109
1109
|
h.content = a.slice(b), h.level = d, l.push(h);
|
1110
1110
|
}
|
1111
|
-
e[t].children =
|
1111
|
+
e[t].children = n = r0(n, i, l);
|
1112
1112
|
}
|
1113
1113
|
}
|
1114
1114
|
}
|
@@ -1124,35 +1124,35 @@ function ze(u, e) {
|
|
1124
1124
|
function Me(u) {
|
1125
1125
|
let e = 0;
|
1126
1126
|
for (let t = u.length - 1; t >= 0; t--) {
|
1127
|
-
const
|
1128
|
-
|
1127
|
+
const r = u[t];
|
1128
|
+
r.type === "text" && !e && (r.content = r.content.replace(Ie, ze)), r.type === "link_open" && r.info === "auto" && e--, r.type === "link_close" && r.info === "auto" && e++;
|
1129
1129
|
}
|
1130
1130
|
}
|
1131
|
-
function
|
1131
|
+
function Re(u) {
|
1132
1132
|
let e = 0;
|
1133
1133
|
for (let t = u.length - 1; t >= 0; t--) {
|
1134
|
-
const
|
1135
|
-
|
1134
|
+
const r = u[t];
|
1135
|
+
r.type === "text" && !e && o0.test(r.content) && (r.content = r.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1—").replace(/(^|\s)--(?=\s|$)/mg, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1–")), r.type === "link_open" && r.info === "auto" && e--, r.type === "link_close" && r.info === "auto" && e++;
|
1136
1136
|
}
|
1137
1137
|
}
|
1138
|
-
function
|
1138
|
+
function qe(u) {
|
1139
1139
|
let e;
|
1140
1140
|
if (u.md.options.typographer)
|
1141
1141
|
for (e = u.tokens.length - 1; e >= 0; e--)
|
1142
|
-
u.tokens[e].type === "inline" && (Te.test(u.tokens[e].content) && Me(u.tokens[e].children), o0.test(u.tokens[e].content) &&
|
1142
|
+
u.tokens[e].type === "inline" && (Te.test(u.tokens[e].content) && Me(u.tokens[e].children), o0.test(u.tokens[e].content) && Re(u.tokens[e].children));
|
1143
1143
|
}
|
1144
1144
|
const Le = /['"]/, Nu = /['"]/g, ju = "’";
|
1145
|
-
function
|
1145
|
+
function ru(u, e, t) {
|
1146
1146
|
return u.slice(0, e) + t + u.slice(e + 1);
|
1147
1147
|
}
|
1148
1148
|
function Pe(u, e) {
|
1149
1149
|
let t;
|
1150
|
-
const
|
1151
|
-
for (let
|
1152
|
-
const c = u[
|
1153
|
-
for (t =
|
1150
|
+
const r = [];
|
1151
|
+
for (let n = 0; n < u.length; n++) {
|
1152
|
+
const c = u[n], i = u[n].level;
|
1153
|
+
for (t = r.length - 1; t >= 0 && !(r[t].level <= i); t--)
|
1154
1154
|
;
|
1155
|
-
if (
|
1155
|
+
if (r.length = t + 1, c.type !== "text")
|
1156
1156
|
continue;
|
1157
1157
|
let o = c.content, a = 0, s = o.length;
|
1158
1158
|
u:
|
@@ -1168,7 +1168,7 @@ function Pe(u, e) {
|
|
1168
1168
|
if (l.index - 1 >= 0)
|
1169
1169
|
f = o.charCodeAt(l.index - 1);
|
1170
1170
|
else
|
1171
|
-
for (t =
|
1171
|
+
for (t = n - 1; t >= 0 && !(u[t].type === "softbreak" || u[t].type === "hardbreak"); t--)
|
1172
1172
|
if (u[t].content) {
|
1173
1173
|
f = u[t].content.charCodeAt(u[t].content.length - 1);
|
1174
1174
|
break;
|
@@ -1177,38 +1177,38 @@ function Pe(u, e) {
|
|
1177
1177
|
if (a < s)
|
1178
1178
|
g = o.charCodeAt(a);
|
1179
1179
|
else
|
1180
|
-
for (t =
|
1180
|
+
for (t = n + 1; t < u.length && !(u[t].type === "softbreak" || u[t].type === "hardbreak"); t++)
|
1181
1181
|
if (u[t].content) {
|
1182
1182
|
g = u[t].content.charCodeAt(0);
|
1183
1183
|
break;
|
1184
1184
|
}
|
1185
|
-
const k =
|
1185
|
+
const k = X(f) || K(String.fromCharCode(f)), D = X(g) || K(String.fromCharCode(g)), p = Q(f), _ = Q(g);
|
1186
1186
|
if (_ ? d = !1 : D && (p || k || (d = !1)), p ? b = !1 : k && (_ || D || (b = !1)), g === 34 && l[0] === '"' && f >= 48 && f <= 57 && (b = d = !1), d && b && (d = k, b = D), !d && !b) {
|
1187
|
-
h && (c.content =
|
1187
|
+
h && (c.content = ru(c.content, l.index, ju));
|
1188
1188
|
continue;
|
1189
1189
|
}
|
1190
1190
|
if (b)
|
1191
|
-
for (t =
|
1192
|
-
let x =
|
1193
|
-
if (
|
1191
|
+
for (t = r.length - 1; t >= 0; t--) {
|
1192
|
+
let x = r[t];
|
1193
|
+
if (r[t].level < i)
|
1194
1194
|
break;
|
1195
|
-
if (x.single === h &&
|
1196
|
-
x =
|
1195
|
+
if (x.single === h && r[t].level === i) {
|
1196
|
+
x = r[t];
|
1197
1197
|
let m, C;
|
1198
|
-
h ? (m = e.md.options.quotes[2], C = e.md.options.quotes[3]) : (m = e.md.options.quotes[0], C = e.md.options.quotes[1]), c.content =
|
1198
|
+
h ? (m = e.md.options.quotes[2], C = e.md.options.quotes[3]) : (m = e.md.options.quotes[0], C = e.md.options.quotes[1]), c.content = ru(c.content, l.index, C), u[x.token].content = ru(
|
1199
1199
|
u[x.token].content,
|
1200
1200
|
x.pos,
|
1201
1201
|
m
|
1202
|
-
), a += C.length - 1, x.token ===
|
1202
|
+
), a += C.length - 1, x.token === n && (a += m.length - 1), o = c.content, s = o.length, r.length = t;
|
1203
1203
|
continue u;
|
1204
1204
|
}
|
1205
1205
|
}
|
1206
|
-
d ?
|
1207
|
-
token:
|
1206
|
+
d ? r.push({
|
1207
|
+
token: n,
|
1208
1208
|
pos: l.index,
|
1209
1209
|
single: h,
|
1210
1210
|
level: i
|
1211
|
-
}) : b && h && (c.content =
|
1211
|
+
}) : b && h && (c.content = ru(c.content, l.index, ju));
|
1212
1212
|
}
|
1213
1213
|
}
|
1214
1214
|
}
|
@@ -1219,11 +1219,11 @@ function Oe(u) {
|
|
1219
1219
|
}
|
1220
1220
|
function $e(u) {
|
1221
1221
|
let e, t;
|
1222
|
-
const
|
1223
|
-
for (let c = 0; c <
|
1224
|
-
if (
|
1222
|
+
const r = u.tokens, n = r.length;
|
1223
|
+
for (let c = 0; c < n; c++) {
|
1224
|
+
if (r[c].type !== "inline")
|
1225
1225
|
continue;
|
1226
|
-
const i =
|
1226
|
+
const i = r[c].children, o = i.length;
|
1227
1227
|
for (e = 0; e < o; e++)
|
1228
1228
|
i[e].type === "text_special" && (i[e].type = "text");
|
1229
1229
|
for (e = t = 0; e < o; e++)
|
@@ -1232,32 +1232,32 @@ function $e(u) {
|
|
1232
1232
|
}
|
1233
1233
|
}
|
1234
1234
|
const xu = [
|
1235
|
-
["normalize",
|
1236
|
-
["block",
|
1235
|
+
["normalize", ye],
|
1236
|
+
["block", Ae],
|
1237
1237
|
["inline", Fe],
|
1238
1238
|
["linkify", Se],
|
1239
|
-
["replacements",
|
1239
|
+
["replacements", qe],
|
1240
1240
|
["smartquotes", Oe],
|
1241
1241
|
// `text_join` finds `text_special` tokens (for escape sequences)
|
1242
1242
|
// and joins them with the rest of the text
|
1243
1243
|
["text_join", $e]
|
1244
1244
|
];
|
1245
1245
|
function Tu() {
|
1246
|
-
this.ruler = new
|
1246
|
+
this.ruler = new w();
|
1247
1247
|
for (let u = 0; u < xu.length; u++)
|
1248
1248
|
this.ruler.push(xu[u][0], xu[u][1]);
|
1249
1249
|
}
|
1250
1250
|
Tu.prototype.process = function(u) {
|
1251
1251
|
const e = this.ruler.getRules("");
|
1252
|
-
for (let t = 0,
|
1252
|
+
for (let t = 0, r = e.length; t < r; t++)
|
1253
1253
|
e[t](u);
|
1254
1254
|
};
|
1255
1255
|
Tu.prototype.State = i0;
|
1256
|
-
function
|
1257
|
-
this.src = u, this.md = e, this.env = t, this.tokens =
|
1258
|
-
const
|
1259
|
-
for (let c = 0, i = 0, o = 0, a = 0, s =
|
1260
|
-
const d =
|
1256
|
+
function q(u, e, t, r) {
|
1257
|
+
this.src = u, this.md = e, this.env = t, this.tokens = r, this.bMarks = [], this.eMarks = [], this.tShift = [], this.sCount = [], this.bsCount = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.ddIndent = -1, this.listIndent = -1, this.parentType = "root", this.level = 0;
|
1258
|
+
const n = this.src;
|
1259
|
+
for (let c = 0, i = 0, o = 0, a = 0, s = n.length, l = !1; i < s; i++) {
|
1260
|
+
const d = n.charCodeAt(i);
|
1261
1261
|
if (!l)
|
1262
1262
|
if (E(d)) {
|
1263
1263
|
o++, d === 9 ? a += 4 - a % 4 : a++;
|
@@ -1266,29 +1266,29 @@ function R(u, e, t, n) {
|
|
1266
1266
|
l = !0;
|
1267
1267
|
(d === 10 || i === s - 1) && (d !== 10 && i++, this.bMarks.push(c), this.eMarks.push(i), this.tShift.push(o), this.sCount.push(a), this.bsCount.push(0), l = !1, o = 0, a = 0, c = i + 1);
|
1268
1268
|
}
|
1269
|
-
this.bMarks.push(
|
1269
|
+
this.bMarks.push(n.length), this.eMarks.push(n.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
|
1270
1270
|
}
|
1271
|
-
|
1272
|
-
const
|
1273
|
-
return
|
1271
|
+
q.prototype.push = function(u, e, t) {
|
1272
|
+
const r = new I(u, e, t);
|
1273
|
+
return r.block = !0, t < 0 && this.level--, r.level = this.level, t > 0 && this.level++, this.tokens.push(r), r;
|
1274
1274
|
};
|
1275
|
-
|
1275
|
+
q.prototype.isEmpty = function(e) {
|
1276
1276
|
return this.bMarks[e] + this.tShift[e] >= this.eMarks[e];
|
1277
1277
|
};
|
1278
|
-
|
1278
|
+
q.prototype.skipEmptyLines = function(e) {
|
1279
1279
|
for (let t = this.lineMax; e < t && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); e++)
|
1280
1280
|
;
|
1281
1281
|
return e;
|
1282
1282
|
};
|
1283
|
-
|
1283
|
+
q.prototype.skipSpaces = function(e) {
|
1284
1284
|
for (let t = this.src.length; e < t; e++) {
|
1285
|
-
const
|
1286
|
-
if (!E(
|
1285
|
+
const r = this.src.charCodeAt(e);
|
1286
|
+
if (!E(r))
|
1287
1287
|
break;
|
1288
1288
|
}
|
1289
1289
|
return e;
|
1290
1290
|
};
|
1291
|
-
|
1291
|
+
q.prototype.skipSpacesBack = function(e, t) {
|
1292
1292
|
if (e <= t)
|
1293
1293
|
return e;
|
1294
1294
|
for (; e > t; )
|
@@ -1296,20 +1296,20 @@ R.prototype.skipSpacesBack = function(e, t) {
|
|
1296
1296
|
return e + 1;
|
1297
1297
|
return e;
|
1298
1298
|
};
|
1299
|
-
|
1300
|
-
for (let
|
1299
|
+
q.prototype.skipChars = function(e, t) {
|
1300
|
+
for (let r = this.src.length; e < r && this.src.charCodeAt(e) === t; e++)
|
1301
1301
|
;
|
1302
1302
|
return e;
|
1303
1303
|
};
|
1304
|
-
|
1305
|
-
if (e <=
|
1304
|
+
q.prototype.skipCharsBack = function(e, t, r) {
|
1305
|
+
if (e <= r)
|
1306
1306
|
return e;
|
1307
|
-
for (; e >
|
1307
|
+
for (; e > r; )
|
1308
1308
|
if (t !== this.src.charCodeAt(--e))
|
1309
1309
|
return e + 1;
|
1310
1310
|
return e;
|
1311
1311
|
};
|
1312
|
-
|
1312
|
+
q.prototype.getLines = function(e, t, r, n) {
|
1313
1313
|
if (e >= t)
|
1314
1314
|
return "";
|
1315
1315
|
const c = new Array(t - e);
|
@@ -1317,7 +1317,7 @@ R.prototype.getLines = function(e, t, n, r) {
|
|
1317
1317
|
let a = 0;
|
1318
1318
|
const s = this.bMarks[o];
|
1319
1319
|
let l = s, d;
|
1320
|
-
for (o + 1 < t ||
|
1320
|
+
for (o + 1 < t || n ? d = this.eMarks[o] + 1 : d = this.eMarks[o]; l < d && a < r; ) {
|
1321
1321
|
const b = this.src.charCodeAt(l);
|
1322
1322
|
if (E(b))
|
1323
1323
|
b === 9 ? a += 4 - (a + this.bsCount[o]) % 4 : a++;
|
@@ -1327,39 +1327,39 @@ R.prototype.getLines = function(e, t, n, r) {
|
|
1327
1327
|
break;
|
1328
1328
|
l++;
|
1329
1329
|
}
|
1330
|
-
a >
|
1330
|
+
a > r ? c[i] = new Array(a - r + 1).join(" ") + this.src.slice(l, d) : c[i] = this.src.slice(l, d);
|
1331
1331
|
}
|
1332
1332
|
return c.join("");
|
1333
1333
|
};
|
1334
|
-
|
1334
|
+
q.prototype.Token = I;
|
1335
1335
|
const Ne = 65536;
|
1336
1336
|
function _u(u, e) {
|
1337
|
-
const t = u.bMarks[e] + u.tShift[e],
|
1338
|
-
return u.src.slice(t,
|
1337
|
+
const t = u.bMarks[e] + u.tShift[e], r = u.eMarks[e];
|
1338
|
+
return u.src.slice(t, r);
|
1339
1339
|
}
|
1340
1340
|
function Uu(u) {
|
1341
1341
|
const e = [], t = u.length;
|
1342
|
-
let
|
1343
|
-
for (;
|
1344
|
-
|
1342
|
+
let r = 0, n = u.charCodeAt(r), c = !1, i = 0, o = "";
|
1343
|
+
for (; r < t; )
|
1344
|
+
n === 124 && (c ? (o += u.substring(i, r - 1), i = r) : (e.push(o + u.substring(i, r)), o = "", i = r + 1)), c = n === 92, r++, n = u.charCodeAt(r);
|
1345
1345
|
return e.push(o + u.substring(i)), e;
|
1346
1346
|
}
|
1347
|
-
function je(u, e, t,
|
1347
|
+
function je(u, e, t, r) {
|
1348
1348
|
if (e + 2 > t)
|
1349
1349
|
return !1;
|
1350
|
-
let
|
1351
|
-
if (u.sCount[
|
1350
|
+
let n = e + 1;
|
1351
|
+
if (u.sCount[n] < u.blkIndent || u.sCount[n] - u.blkIndent >= 4)
|
1352
1352
|
return !1;
|
1353
|
-
let c = u.bMarks[
|
1354
|
-
if (c >= u.eMarks[
|
1353
|
+
let c = u.bMarks[n] + u.tShift[n];
|
1354
|
+
if (c >= u.eMarks[n])
|
1355
1355
|
return !1;
|
1356
1356
|
const i = u.src.charCodeAt(c++);
|
1357
|
-
if (i !== 124 && i !== 45 && i !== 58 || c >= u.eMarks[
|
1357
|
+
if (i !== 124 && i !== 45 && i !== 58 || c >= u.eMarks[n])
|
1358
1358
|
return !1;
|
1359
1359
|
const o = u.src.charCodeAt(c++);
|
1360
1360
|
if (o !== 124 && o !== 45 && o !== 58 && !E(o) || i === 45 && E(o))
|
1361
1361
|
return !1;
|
1362
|
-
for (; c < u.eMarks[
|
1362
|
+
for (; c < u.eMarks[n]; ) {
|
1363
1363
|
const x = u.src.charCodeAt(c);
|
1364
1364
|
if (x !== 124 && x !== 45 && x !== 58 && !E(x))
|
1365
1365
|
return !1;
|
@@ -1384,7 +1384,7 @@ function je(u, e, t, n) {
|
|
1384
1384
|
const d = s.length;
|
1385
1385
|
if (d === 0 || d !== l.length)
|
1386
1386
|
return !1;
|
1387
|
-
if (
|
1387
|
+
if (r)
|
1388
1388
|
return !0;
|
1389
1389
|
const b = u.parentType;
|
1390
1390
|
u.parentType = "table";
|
@@ -1402,21 +1402,21 @@ function je(u, e, t, n) {
|
|
1402
1402
|
}
|
1403
1403
|
u.push("tr_close", "tr", -1), u.push("thead_close", "thead", -1);
|
1404
1404
|
let p, _ = 0;
|
1405
|
-
for (
|
1405
|
+
for (n = e + 2; n < t && !(u.sCount[n] < u.blkIndent); n++) {
|
1406
1406
|
let x = !1;
|
1407
1407
|
for (let C = 0, F = h.length; C < F; C++)
|
1408
|
-
if (h[C](u,
|
1408
|
+
if (h[C](u, n, t, !0)) {
|
1409
1409
|
x = !0;
|
1410
1410
|
break;
|
1411
1411
|
}
|
1412
|
-
if (x || (a = _u(u,
|
1412
|
+
if (x || (a = _u(u, n).trim(), !a) || u.sCount[n] - u.blkIndent >= 4 || (s = Uu(a), s.length && s[0] === "" && s.shift(), s.length && s[s.length - 1] === "" && s.pop(), _ += d - s.length, _ > Ne))
|
1413
1413
|
break;
|
1414
|
-
if (
|
1414
|
+
if (n === e + 2) {
|
1415
1415
|
const C = u.push("tbody_open", "tbody", 1);
|
1416
1416
|
C.map = p = [e + 2, 0];
|
1417
1417
|
}
|
1418
1418
|
const m = u.push("tr_open", "tr", 1);
|
1419
|
-
m.map = [
|
1419
|
+
m.map = [n, n + 1];
|
1420
1420
|
for (let C = 0; C < d; C++) {
|
1421
1421
|
const F = u.push("td_open", "td", 1);
|
1422
1422
|
l[C] && (F.attrs = [["style", "text-align:" + l[C]]]);
|
@@ -1425,48 +1425,48 @@ function je(u, e, t, n) {
|
|
1425
1425
|
}
|
1426
1426
|
u.push("tr_close", "tr", -1);
|
1427
1427
|
}
|
1428
|
-
return p && (u.push("tbody_close", "tbody", -1), p[1] =
|
1428
|
+
return p && (u.push("tbody_close", "tbody", -1), p[1] = n), u.push("table_close", "table", -1), g[1] = n, u.parentType = b, u.line = n, !0;
|
1429
1429
|
}
|
1430
1430
|
function Ue(u, e, t) {
|
1431
1431
|
if (u.sCount[e] - u.blkIndent < 4)
|
1432
1432
|
return !1;
|
1433
|
-
let
|
1434
|
-
for (;
|
1435
|
-
if (u.isEmpty(
|
1436
|
-
|
1433
|
+
let r = e + 1, n = r;
|
1434
|
+
for (; r < t; ) {
|
1435
|
+
if (u.isEmpty(r)) {
|
1436
|
+
r++;
|
1437
1437
|
continue;
|
1438
1438
|
}
|
1439
|
-
if (u.sCount[
|
1440
|
-
|
1439
|
+
if (u.sCount[r] - u.blkIndent >= 4) {
|
1440
|
+
r++, n = r;
|
1441
1441
|
continue;
|
1442
1442
|
}
|
1443
1443
|
break;
|
1444
1444
|
}
|
1445
|
-
u.line =
|
1445
|
+
u.line = n;
|
1446
1446
|
const c = u.push("code_block", "code", 0);
|
1447
|
-
return c.content = u.getLines(e,
|
1447
|
+
return c.content = u.getLines(e, n, 4 + u.blkIndent, !1) + `
|
1448
1448
|
`, c.map = [e, u.line], !0;
|
1449
1449
|
}
|
1450
|
-
function He(u, e, t,
|
1451
|
-
let
|
1452
|
-
if (u.sCount[e] - u.blkIndent >= 4 ||
|
1450
|
+
function He(u, e, t, r) {
|
1451
|
+
let n = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
1452
|
+
if (u.sCount[e] - u.blkIndent >= 4 || n + 3 > c)
|
1453
1453
|
return !1;
|
1454
|
-
const i = u.src.charCodeAt(
|
1454
|
+
const i = u.src.charCodeAt(n);
|
1455
1455
|
if (i !== 126 && i !== 96)
|
1456
1456
|
return !1;
|
1457
|
-
let o =
|
1458
|
-
|
1459
|
-
let a =
|
1457
|
+
let o = n;
|
1458
|
+
n = u.skipChars(n, i);
|
1459
|
+
let a = n - o;
|
1460
1460
|
if (a < 3)
|
1461
1461
|
return !1;
|
1462
|
-
const s = u.src.slice(o,
|
1462
|
+
const s = u.src.slice(o, n), l = u.src.slice(n, c);
|
1463
1463
|
if (i === 96 && l.indexOf(String.fromCharCode(i)) >= 0)
|
1464
1464
|
return !1;
|
1465
|
-
if (
|
1465
|
+
if (r)
|
1466
1466
|
return !0;
|
1467
1467
|
let d = e, b = !1;
|
1468
|
-
for (; d++, !(d >= t || (
|
1469
|
-
if (u.src.charCodeAt(
|
1468
|
+
for (; d++, !(d >= t || (n = o = u.bMarks[d] + u.tShift[d], c = u.eMarks[d], n < c && u.sCount[d] < u.blkIndent)); )
|
1469
|
+
if (u.src.charCodeAt(n) === i && !(u.sCount[d] - u.blkIndent >= 4) && (n = u.skipChars(n, i), !(n - o < a) && (n = u.skipSpaces(n), !(n < c)))) {
|
1470
1470
|
b = !0;
|
1471
1471
|
break;
|
1472
1472
|
}
|
@@ -1474,33 +1474,33 @@ function He(u, e, t, n) {
|
|
1474
1474
|
const h = u.push("fence", "code", 0);
|
1475
1475
|
return h.info = l, h.content = u.getLines(e + 1, d, a, !0), h.markup = s, h.map = [e, u.line], !0;
|
1476
1476
|
}
|
1477
|
-
function Ze(u, e, t,
|
1478
|
-
let
|
1477
|
+
function Ze(u, e, t, r) {
|
1478
|
+
let n = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
1479
1479
|
const i = u.lineMax;
|
1480
|
-
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(
|
1480
|
+
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(n) !== 62)
|
1481
1481
|
return !1;
|
1482
|
-
if (
|
1482
|
+
if (r)
|
1483
1483
|
return !0;
|
1484
1484
|
const o = [], a = [], s = [], l = [], d = u.md.block.ruler.getRules("blockquote"), b = u.parentType;
|
1485
1485
|
u.parentType = "blockquote";
|
1486
1486
|
let h = !1, f;
|
1487
1487
|
for (f = e; f < t; f++) {
|
1488
1488
|
const _ = u.sCount[f] < u.blkIndent;
|
1489
|
-
if (
|
1489
|
+
if (n = u.bMarks[f] + u.tShift[f], c = u.eMarks[f], n >= c)
|
1490
1490
|
break;
|
1491
|
-
if (u.src.charCodeAt(
|
1491
|
+
if (u.src.charCodeAt(n++) === 62 && !_) {
|
1492
1492
|
let m = u.sCount[f] + 1, C, F;
|
1493
|
-
u.src.charCodeAt(
|
1493
|
+
u.src.charCodeAt(n) === 32 ? (n++, m++, F = !1, C = !0) : u.src.charCodeAt(n) === 9 ? (C = !0, (u.bsCount[f] + m) % 4 === 3 ? (n++, m++, F = !1) : F = !0) : C = !1;
|
1494
1494
|
let T = m;
|
1495
|
-
for (o.push(u.bMarks[f]), u.bMarks[f] =
|
1496
|
-
const L = u.src.charCodeAt(
|
1495
|
+
for (o.push(u.bMarks[f]), u.bMarks[f] = n; n < c; ) {
|
1496
|
+
const L = u.src.charCodeAt(n);
|
1497
1497
|
if (E(L))
|
1498
1498
|
L === 9 ? T += 4 - (T + u.bsCount[f] + (F ? 1 : 0)) % 4 : T++;
|
1499
1499
|
else
|
1500
1500
|
break;
|
1501
|
-
|
1501
|
+
n++;
|
1502
1502
|
}
|
1503
|
-
h =
|
1503
|
+
h = n >= c, a.push(u.bsCount[f]), u.bsCount[f] = u.sCount[f] + 1 + (C ? 1 : 0), s.push(u.sCount[f]), u.sCount[f] = T - m, l.push(u.tShift[f]), u.tShift[f] = n - u.bMarks[f];
|
1504
1504
|
continue;
|
1505
1505
|
}
|
1506
1506
|
if (h)
|
@@ -1529,8 +1529,8 @@ function Ze(u, e, t, n) {
|
|
1529
1529
|
u.bMarks[_ + e] = o[_], u.tShift[_ + e] = l[_], u.sCount[_ + e] = s[_], u.bsCount[_ + e] = a[_];
|
1530
1530
|
return u.blkIndent = g, !0;
|
1531
1531
|
}
|
1532
|
-
function Ve(u, e, t,
|
1533
|
-
const
|
1532
|
+
function Ve(u, e, t, r) {
|
1533
|
+
const n = u.eMarks[e];
|
1534
1534
|
if (u.sCount[e] - u.blkIndent >= 4)
|
1535
1535
|
return !1;
|
1536
1536
|
let c = u.bMarks[e] + u.tShift[e];
|
@@ -1538,7 +1538,7 @@ function Ve(u, e, t, n) {
|
|
1538
1538
|
if (i !== 42 && i !== 45 && i !== 95)
|
1539
1539
|
return !1;
|
1540
1540
|
let o = 1;
|
1541
|
-
for (; c <
|
1541
|
+
for (; c < n; ) {
|
1542
1542
|
const s = u.src.charCodeAt(c++);
|
1543
1543
|
if (s !== i && !E(s))
|
1544
1544
|
return !1;
|
@@ -1546,7 +1546,7 @@ function Ve(u, e, t, n) {
|
|
1546
1546
|
}
|
1547
1547
|
if (o < 3)
|
1548
1548
|
return !1;
|
1549
|
-
if (
|
1549
|
+
if (r)
|
1550
1550
|
return !0;
|
1551
1551
|
u.line = e + 1;
|
1552
1552
|
const a = u.push("hr", "hr", 0);
|
@@ -1554,30 +1554,30 @@ function Ve(u, e, t, n) {
|
|
1554
1554
|
}
|
1555
1555
|
function Hu(u, e) {
|
1556
1556
|
const t = u.eMarks[e];
|
1557
|
-
let
|
1558
|
-
const
|
1559
|
-
if (
|
1557
|
+
let r = u.bMarks[e] + u.tShift[e];
|
1558
|
+
const n = u.src.charCodeAt(r++);
|
1559
|
+
if (n !== 42 && n !== 45 && n !== 43)
|
1560
1560
|
return -1;
|
1561
|
-
if (
|
1562
|
-
const c = u.src.charCodeAt(
|
1561
|
+
if (r < t) {
|
1562
|
+
const c = u.src.charCodeAt(r);
|
1563
1563
|
if (!E(c))
|
1564
1564
|
return -1;
|
1565
1565
|
}
|
1566
|
-
return
|
1566
|
+
return r;
|
1567
1567
|
}
|
1568
1568
|
function Zu(u, e) {
|
1569
|
-
const t = u.bMarks[e] + u.tShift[e],
|
1570
|
-
let
|
1571
|
-
if (
|
1569
|
+
const t = u.bMarks[e] + u.tShift[e], r = u.eMarks[e];
|
1570
|
+
let n = t;
|
1571
|
+
if (n + 1 >= r)
|
1572
1572
|
return -1;
|
1573
|
-
let c = u.src.charCodeAt(
|
1573
|
+
let c = u.src.charCodeAt(n++);
|
1574
1574
|
if (c < 48 || c > 57)
|
1575
1575
|
return -1;
|
1576
1576
|
for (; ; ) {
|
1577
|
-
if (
|
1577
|
+
if (n >= r)
|
1578
1578
|
return -1;
|
1579
|
-
if (c = u.src.charCodeAt(
|
1580
|
-
if (
|
1579
|
+
if (c = u.src.charCodeAt(n++), c >= 48 && c <= 57) {
|
1580
|
+
if (n - t >= 10)
|
1581
1581
|
return -1;
|
1582
1582
|
continue;
|
1583
1583
|
}
|
@@ -1585,19 +1585,19 @@ function Zu(u, e) {
|
|
1585
1585
|
break;
|
1586
1586
|
return -1;
|
1587
1587
|
}
|
1588
|
-
return
|
1588
|
+
return n < r && (c = u.src.charCodeAt(n), !E(c)) ? -1 : n;
|
1589
1589
|
}
|
1590
1590
|
function Ge(u, e) {
|
1591
1591
|
const t = u.level + 2;
|
1592
|
-
for (let
|
1593
|
-
u.tokens[
|
1592
|
+
for (let r = e + 2, n = u.tokens.length - 2; r < n; r++)
|
1593
|
+
u.tokens[r].level === t && u.tokens[r].type === "paragraph_open" && (u.tokens[r + 2].hidden = !0, u.tokens[r].hidden = !0, r += 2);
|
1594
1594
|
}
|
1595
|
-
function We(u, e, t,
|
1596
|
-
let
|
1595
|
+
function We(u, e, t, r) {
|
1596
|
+
let n, c, i, o, a = e, s = !0;
|
1597
1597
|
if (u.sCount[a] - u.blkIndent >= 4 || u.listIndent >= 0 && u.sCount[a] - u.listIndent >= 4 && u.sCount[a] < u.blkIndent)
|
1598
1598
|
return !1;
|
1599
1599
|
let l = !1;
|
1600
|
-
|
1600
|
+
r && u.parentType === "paragraph" && u.sCount[a] >= u.blkIndent && (l = !0);
|
1601
1601
|
let d, b, h;
|
1602
1602
|
if ((h = Zu(u, a)) >= 0) {
|
1603
1603
|
if (d = !0, i = u.bMarks[a] + u.tShift[a], b = Number(u.src.slice(i, h - 1)), l && b !== 1)
|
@@ -1608,7 +1608,7 @@ function We(u, e, t, n) {
|
|
1608
1608
|
return !1;
|
1609
1609
|
if (l && u.skipSpaces(h) >= u.eMarks[a])
|
1610
1610
|
return !1;
|
1611
|
-
if (
|
1611
|
+
if (r)
|
1612
1612
|
return !0;
|
1613
1613
|
const f = u.src.charCodeAt(h - 1), g = u.tokens.length;
|
1614
1614
|
d ? (o = u.push("ordered_list_open", "ol", 1), b !== 1 && (o.attrs = [["start", b]])) : o = u.push("bullet_list_open", "ul", 1);
|
@@ -1617,10 +1617,10 @@ function We(u, e, t, n) {
|
|
1617
1617
|
let D = !1;
|
1618
1618
|
const p = u.md.block.ruler.getRules("list"), _ = u.parentType;
|
1619
1619
|
for (u.parentType = "list"; a < t; ) {
|
1620
|
-
c = h,
|
1620
|
+
c = h, n = u.eMarks[a];
|
1621
1621
|
const x = u.sCount[a] + h - (u.bMarks[a] + u.tShift[a]);
|
1622
1622
|
let m = x;
|
1623
|
-
for (; c <
|
1623
|
+
for (; c < n; ) {
|
1624
1624
|
const U = u.src.charCodeAt(c);
|
1625
1625
|
if (U === 9)
|
1626
1626
|
m += 4 - (m + u.bsCount[a]) % 4;
|
@@ -1632,16 +1632,16 @@ function We(u, e, t, n) {
|
|
1632
1632
|
}
|
1633
1633
|
const C = c;
|
1634
1634
|
let F;
|
1635
|
-
C >=
|
1635
|
+
C >= n ? F = 1 : F = m - x, F > 4 && (F = 1);
|
1636
1636
|
const T = x + F;
|
1637
1637
|
o = u.push("list_item_open", "li", 1), o.markup = String.fromCharCode(f);
|
1638
1638
|
const L = [a, 0];
|
1639
1639
|
o.map = L, d && (o.info = u.src.slice(i, h - 1));
|
1640
|
-
const J = u.tight, bu = u.tShift[a], E0 = u.sCount[a],
|
1641
|
-
if (u.listIndent = u.blkIndent, u.blkIndent = T, u.tight = !0, u.tShift[a] = C - u.bMarks[a], u.sCount[a] = m, C >=
|
1640
|
+
const J = u.tight, bu = u.tShift[a], E0 = u.sCount[a], y0 = u.listIndent;
|
1641
|
+
if (u.listIndent = u.blkIndent, u.blkIndent = T, u.tight = !0, u.tShift[a] = C - u.bMarks[a], u.sCount[a] = m, C >= n && u.isEmpty(a + 1) ? u.line = Math.min(u.line + 2, t) : u.md.block.tokenize(u, a, t, !0), (!u.tight || D) && (s = !1), D = u.line - a > 1 && u.isEmpty(u.line - 1), u.blkIndent = u.listIndent, u.listIndent = y0, u.tShift[a] = bu, u.sCount[a] = E0, u.tight = J, o = u.push("list_item_close", "li", -1), o.markup = String.fromCharCode(f), a = u.line, L[1] = a, a >= t || u.sCount[a] < u.blkIndent || u.sCount[a] - u.blkIndent >= 4)
|
1642
1642
|
break;
|
1643
1643
|
let zu = !1;
|
1644
|
-
for (let U = 0,
|
1644
|
+
for (let U = 0, A0 = p.length; U < A0; U++)
|
1645
1645
|
if (p[U](u, a, t, !0)) {
|
1646
1646
|
zu = !0;
|
1647
1647
|
break;
|
@@ -1659,9 +1659,9 @@ function We(u, e, t, n) {
|
|
1659
1659
|
}
|
1660
1660
|
return d ? o = u.push("ordered_list_close", "ol", -1) : o = u.push("bullet_list_close", "ul", -1), o.markup = String.fromCharCode(f), k[1] = a, u.line = a, u.parentType = _, s && Ge(u, g), !0;
|
1661
1661
|
}
|
1662
|
-
function Je(u, e, t,
|
1663
|
-
let
|
1664
|
-
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(
|
1662
|
+
function Je(u, e, t, r) {
|
1663
|
+
let n = u.bMarks[e] + u.tShift[e], c = u.eMarks[e], i = e + 1;
|
1664
|
+
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(n) !== 91)
|
1665
1665
|
return !1;
|
1666
1666
|
function o(p) {
|
1667
1667
|
const _ = u.lineMax;
|
@@ -1683,75 +1683,75 @@ function Je(u, e, t, n) {
|
|
1683
1683
|
const m = u.bMarks[p] + u.tShift[p], C = u.eMarks[p];
|
1684
1684
|
return u.src.slice(m, C + 1);
|
1685
1685
|
}
|
1686
|
-
let a = u.src.slice(
|
1686
|
+
let a = u.src.slice(n, c + 1);
|
1687
1687
|
c = a.length;
|
1688
1688
|
let s = -1;
|
1689
|
-
for (
|
1690
|
-
const p = a.charCodeAt(
|
1689
|
+
for (n = 1; n < c; n++) {
|
1690
|
+
const p = a.charCodeAt(n);
|
1691
1691
|
if (p === 91)
|
1692
1692
|
return !1;
|
1693
1693
|
if (p === 93) {
|
1694
|
-
s =
|
1694
|
+
s = n;
|
1695
1695
|
break;
|
1696
1696
|
} else if (p === 10) {
|
1697
1697
|
const _ = o(i);
|
1698
1698
|
_ !== null && (a += _, c = a.length, i++);
|
1699
|
-
} else if (p === 92 && (
|
1699
|
+
} else if (p === 92 && (n++, n < c && a.charCodeAt(n) === 10)) {
|
1700
1700
|
const _ = o(i);
|
1701
1701
|
_ !== null && (a += _, c = a.length, i++);
|
1702
1702
|
}
|
1703
1703
|
}
|
1704
1704
|
if (s < 0 || a.charCodeAt(s + 1) !== 58)
|
1705
1705
|
return !1;
|
1706
|
-
for (
|
1707
|
-
const p = a.charCodeAt(
|
1706
|
+
for (n = s + 2; n < c; n++) {
|
1707
|
+
const p = a.charCodeAt(n);
|
1708
1708
|
if (p === 10) {
|
1709
1709
|
const _ = o(i);
|
1710
1710
|
_ !== null && (a += _, c = a.length, i++);
|
1711
1711
|
} else if (!E(p))
|
1712
1712
|
break;
|
1713
1713
|
}
|
1714
|
-
const l = u.md.helpers.parseLinkDestination(a,
|
1714
|
+
const l = u.md.helpers.parseLinkDestination(a, n, c);
|
1715
1715
|
if (!l.ok)
|
1716
1716
|
return !1;
|
1717
1717
|
const d = u.md.normalizeLink(l.str);
|
1718
1718
|
if (!u.md.validateLink(d))
|
1719
1719
|
return !1;
|
1720
|
-
|
1721
|
-
const b =
|
1722
|
-
for (;
|
1723
|
-
const p = a.charCodeAt(
|
1720
|
+
n = l.pos;
|
1721
|
+
const b = n, h = i, f = n;
|
1722
|
+
for (; n < c; n++) {
|
1723
|
+
const p = a.charCodeAt(n);
|
1724
1724
|
if (p === 10) {
|
1725
1725
|
const _ = o(i);
|
1726
1726
|
_ !== null && (a += _, c = a.length, i++);
|
1727
1727
|
} else if (!E(p))
|
1728
1728
|
break;
|
1729
1729
|
}
|
1730
|
-
let g = u.md.helpers.parseLinkTitle(a,
|
1730
|
+
let g = u.md.helpers.parseLinkTitle(a, n, c);
|
1731
1731
|
for (; g.can_continue; ) {
|
1732
1732
|
const p = o(i);
|
1733
1733
|
if (p === null)
|
1734
1734
|
break;
|
1735
|
-
a += p,
|
1735
|
+
a += p, n = c, c = a.length, i++, g = u.md.helpers.parseLinkTitle(a, n, c, g);
|
1736
1736
|
}
|
1737
1737
|
let k;
|
1738
|
-
for (
|
1739
|
-
const p = a.charCodeAt(
|
1738
|
+
for (n < c && f !== n && g.ok ? (k = g.str, n = g.pos) : (k = "", n = b, i = h); n < c; ) {
|
1739
|
+
const p = a.charCodeAt(n);
|
1740
1740
|
if (!E(p))
|
1741
1741
|
break;
|
1742
|
-
|
1742
|
+
n++;
|
1743
1743
|
}
|
1744
|
-
if (
|
1745
|
-
for (k = "",
|
1746
|
-
const p = a.charCodeAt(
|
1744
|
+
if (n < c && a.charCodeAt(n) !== 10 && k)
|
1745
|
+
for (k = "", n = b, i = h; n < c; ) {
|
1746
|
+
const p = a.charCodeAt(n);
|
1747
1747
|
if (!E(p))
|
1748
1748
|
break;
|
1749
|
-
|
1749
|
+
n++;
|
1750
1750
|
}
|
1751
|
-
if (
|
1751
|
+
if (n < c && a.charCodeAt(n) !== 10)
|
1752
1752
|
return !1;
|
1753
1753
|
const D = fu(a.slice(1, s));
|
1754
|
-
return D ? (
|
1754
|
+
return D ? (r || (typeof u.env.references > "u" && (u.env.references = {}), typeof u.env.references[D] > "u" && (u.env.references[D] = { title: k, href: d }), u.line = i), !0) : !1;
|
1755
1755
|
}
|
1756
1756
|
const Qe = [
|
1757
1757
|
"address",
|
@@ -1816,7 +1816,7 @@ const Qe = [
|
|
1816
1816
|
"tr",
|
1817
1817
|
"track",
|
1818
1818
|
"ul"
|
1819
|
-
],
|
1819
|
+
], Ke = "[a-zA-Z_:][a-zA-Z0-9:._-]*", Xe = "[^\"'=<>`\\x00-\\x20]+", Ye = "'[^']*'", ut = '"[^"]*"', et = "(?:" + Xe + "|" + Ye + "|" + ut + ")", tt = "(?:\\s+" + Ke + "(?:\\s*=\\s*" + et + ")?)", a0 = "<[A-Za-z][A-Za-z0-9\\-]*" + tt + "*\\s*\\/?>", s0 = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", nt = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->", rt = "<[?][\\s\\S]*?[?]>", ct = "<![A-Za-z][^>]*>", it = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>", ot = new RegExp("^(?:" + a0 + "|" + s0 + "|" + nt + "|" + rt + "|" + ct + "|" + it + ")"), at = new RegExp("^(?:" + a0 + "|" + s0 + ")"), H = [
|
1820
1820
|
[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, !0],
|
1821
1821
|
[/^<!--/, /-->/, !0],
|
1822
1822
|
[/^<\?/, /\?>/, !0],
|
@@ -1825,21 +1825,21 @@ const Qe = [
|
|
1825
1825
|
[new RegExp("^</?(" + Qe.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, !0],
|
1826
1826
|
[new RegExp(at.source + "\\s*$"), /^$/, !1]
|
1827
1827
|
];
|
1828
|
-
function st(u, e, t,
|
1829
|
-
let
|
1830
|
-
if (u.sCount[e] - u.blkIndent >= 4 || !u.md.options.html || u.src.charCodeAt(
|
1828
|
+
function st(u, e, t, r) {
|
1829
|
+
let n = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
1830
|
+
if (u.sCount[e] - u.blkIndent >= 4 || !u.md.options.html || u.src.charCodeAt(n) !== 60)
|
1831
1831
|
return !1;
|
1832
|
-
let i = u.src.slice(
|
1832
|
+
let i = u.src.slice(n, c), o = 0;
|
1833
1833
|
for (; o < H.length && !H[o][0].test(i); o++)
|
1834
1834
|
;
|
1835
1835
|
if (o === H.length)
|
1836
1836
|
return !1;
|
1837
|
-
if (
|
1837
|
+
if (r)
|
1838
1838
|
return H[o][2];
|
1839
1839
|
let a = e + 1;
|
1840
1840
|
if (!H[o][1].test(i)) {
|
1841
1841
|
for (; a < t && !(u.sCount[a] < u.blkIndent); a++)
|
1842
|
-
if (
|
1842
|
+
if (n = u.bMarks[a] + u.tShift[a], c = u.eMarks[a], i = u.src.slice(n, c), H[o][1].test(i)) {
|
1843
1843
|
i.length !== 0 && a++;
|
1844
1844
|
break;
|
1845
1845
|
}
|
@@ -1848,35 +1848,35 @@ function st(u, e, t, n) {
|
|
1848
1848
|
const s = u.push("html_block", "", 0);
|
1849
1849
|
return s.map = [e, a], s.content = u.getLines(e, a, u.blkIndent, !0), !0;
|
1850
1850
|
}
|
1851
|
-
function lt(u, e, t,
|
1852
|
-
let
|
1851
|
+
function lt(u, e, t, r) {
|
1852
|
+
let n = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
1853
1853
|
if (u.sCount[e] - u.blkIndent >= 4)
|
1854
1854
|
return !1;
|
1855
|
-
let i = u.src.charCodeAt(
|
1856
|
-
if (i !== 35 ||
|
1855
|
+
let i = u.src.charCodeAt(n);
|
1856
|
+
if (i !== 35 || n >= c)
|
1857
1857
|
return !1;
|
1858
1858
|
let o = 1;
|
1859
|
-
for (i = u.src.charCodeAt(++
|
1860
|
-
o++, i = u.src.charCodeAt(++
|
1861
|
-
if (o > 6 ||
|
1859
|
+
for (i = u.src.charCodeAt(++n); i === 35 && n < c && o <= 6; )
|
1860
|
+
o++, i = u.src.charCodeAt(++n);
|
1861
|
+
if (o > 6 || n < c && !E(i))
|
1862
1862
|
return !1;
|
1863
|
-
if (
|
1863
|
+
if (r)
|
1864
1864
|
return !0;
|
1865
|
-
c = u.skipSpacesBack(c,
|
1866
|
-
const a = u.skipCharsBack(c, 35,
|
1867
|
-
a >
|
1865
|
+
c = u.skipSpacesBack(c, n);
|
1866
|
+
const a = u.skipCharsBack(c, 35, n);
|
1867
|
+
a > n && E(u.src.charCodeAt(a - 1)) && (c = a), u.line = e + 1;
|
1868
1868
|
const s = u.push("heading_open", "h" + String(o), 1);
|
1869
1869
|
s.markup = "########".slice(0, o), s.map = [e, u.line];
|
1870
1870
|
const l = u.push("inline", "", 0);
|
1871
|
-
l.content = u.src.slice(
|
1871
|
+
l.content = u.src.slice(n, c).trim(), l.map = [e, u.line], l.children = [];
|
1872
1872
|
const d = u.push("heading_close", "h" + String(o), -1);
|
1873
1873
|
return d.markup = "########".slice(0, o), !0;
|
1874
1874
|
}
|
1875
1875
|
function ft(u, e, t) {
|
1876
|
-
const
|
1876
|
+
const r = u.md.block.ruler.getRules("paragraph");
|
1877
1877
|
if (u.sCount[e] - u.blkIndent >= 4)
|
1878
1878
|
return !1;
|
1879
|
-
const
|
1879
|
+
const n = u.parentType;
|
1880
1880
|
u.parentType = "paragraph";
|
1881
1881
|
let c = 0, i, o = e + 1;
|
1882
1882
|
for (; o < t && !u.isEmpty(o); o++) {
|
@@ -1893,8 +1893,8 @@ function ft(u, e, t) {
|
|
1893
1893
|
if (u.sCount[o] < 0)
|
1894
1894
|
continue;
|
1895
1895
|
let b = !1;
|
1896
|
-
for (let h = 0, f =
|
1897
|
-
if (
|
1896
|
+
for (let h = 0, f = r.length; h < f; h++)
|
1897
|
+
if (r[h](u, o, t, !0)) {
|
1898
1898
|
b = !0;
|
1899
1899
|
break;
|
1900
1900
|
}
|
@@ -1910,17 +1910,17 @@ function ft(u, e, t) {
|
|
1910
1910
|
const l = u.push("inline", "", 0);
|
1911
1911
|
l.content = a, l.map = [e, u.line - 1], l.children = [];
|
1912
1912
|
const d = u.push("heading_close", "h" + String(c), -1);
|
1913
|
-
return d.markup = String.fromCharCode(i), u.parentType =
|
1913
|
+
return d.markup = String.fromCharCode(i), u.parentType = n, !0;
|
1914
1914
|
}
|
1915
1915
|
function dt(u, e, t) {
|
1916
|
-
const
|
1916
|
+
const r = u.md.block.ruler.getRules("paragraph"), n = u.parentType;
|
1917
1917
|
let c = e + 1;
|
1918
1918
|
for (u.parentType = "paragraph"; c < t && !u.isEmpty(c); c++) {
|
1919
1919
|
if (u.sCount[c] - u.blkIndent > 3 || u.sCount[c] < 0)
|
1920
1920
|
continue;
|
1921
1921
|
let s = !1;
|
1922
|
-
for (let l = 0, d =
|
1923
|
-
if (
|
1922
|
+
for (let l = 0, d = r.length; l < d; l++)
|
1923
|
+
if (r[l](u, c, t, !0)) {
|
1924
1924
|
s = !0;
|
1925
1925
|
break;
|
1926
1926
|
}
|
@@ -1932,7 +1932,7 @@ function dt(u, e, t) {
|
|
1932
1932
|
const o = u.push("paragraph_open", "p", 1);
|
1933
1933
|
o.map = [e, u.line];
|
1934
1934
|
const a = u.push("inline", "", 0);
|
1935
|
-
return a.content = i, a.map = [e, u.line], a.children = [], u.push("paragraph_close", "p", -1), u.parentType =
|
1935
|
+
return a.content = i, a.map = [e, u.line], a.children = [], u.push("paragraph_close", "p", -1), u.parentType = n, !0;
|
1936
1936
|
}
|
1937
1937
|
const cu = [
|
1938
1938
|
// First 2 params - rule name & source. Secondary array - list of rules,
|
@@ -1950,12 +1950,12 @@ const cu = [
|
|
1950
1950
|
["paragraph", dt]
|
1951
1951
|
];
|
1952
1952
|
function du() {
|
1953
|
-
this.ruler = new
|
1953
|
+
this.ruler = new w();
|
1954
1954
|
for (let u = 0; u < cu.length; u++)
|
1955
1955
|
this.ruler.push(cu[u][0], cu[u][1], { alt: (cu[u][2] || []).slice() });
|
1956
1956
|
}
|
1957
1957
|
du.prototype.tokenize = function(u, e, t) {
|
1958
|
-
const
|
1958
|
+
const r = this.ruler.getRules(""), n = r.length, c = u.md.options.maxNesting;
|
1959
1959
|
let i = e, o = !1;
|
1960
1960
|
for (; i < t && (u.line = i = u.skipEmptyLines(i), !(i >= t || u.sCount[i] < u.blkIndent)); ) {
|
1961
1961
|
if (u.level >= c) {
|
@@ -1964,8 +1964,8 @@ du.prototype.tokenize = function(u, e, t) {
|
|
1964
1964
|
}
|
1965
1965
|
const a = u.line;
|
1966
1966
|
let s = !1;
|
1967
|
-
for (let l = 0; l <
|
1968
|
-
if (s =
|
1967
|
+
for (let l = 0; l < n; l++)
|
1968
|
+
if (s = r[l](u, i, t, !1), s) {
|
1969
1969
|
if (a >= u.line)
|
1970
1970
|
throw new Error("block rule didn't increment state.line");
|
1971
1971
|
break;
|
@@ -1975,15 +1975,15 @@ du.prototype.tokenize = function(u, e, t) {
|
|
1975
1975
|
u.tight = !o, u.isEmpty(u.line - 1) && (o = !0), i = u.line, i < t && u.isEmpty(i) && (o = !0, i++, u.line = i);
|
1976
1976
|
}
|
1977
1977
|
};
|
1978
|
-
du.prototype.parse = function(u, e, t,
|
1978
|
+
du.prototype.parse = function(u, e, t, r) {
|
1979
1979
|
if (!u)
|
1980
1980
|
return;
|
1981
|
-
const
|
1982
|
-
this.tokenize(
|
1981
|
+
const n = new this.State(u, e, t, r);
|
1982
|
+
this.tokenize(n, n.line, n.lineMax);
|
1983
1983
|
};
|
1984
|
-
du.prototype.State =
|
1985
|
-
function eu(u, e, t,
|
1986
|
-
this.src = u, this.env = t, this.md = e, this.tokens =
|
1984
|
+
du.prototype.State = q;
|
1985
|
+
function eu(u, e, t, r) {
|
1986
|
+
this.src = u, this.env = t, this.md = e, this.tokens = r, this.tokens_meta = Array(r.length), this.pos = 0, this.posMax = this.src.length, this.level = 0, this.pending = "", this.pendingLevel = 0, this.cache = {}, this.delimiters = [], this._prev_delimiters = [], this.backticks = {}, this.backticksScanned = !1, this.linkLevel = 0;
|
1987
1987
|
}
|
1988
1988
|
eu.prototype.pushPending = function() {
|
1989
1989
|
const u = new I("text", "", 0);
|
@@ -1991,16 +1991,16 @@ eu.prototype.pushPending = function() {
|
|
1991
1991
|
};
|
1992
1992
|
eu.prototype.push = function(u, e, t) {
|
1993
1993
|
this.pending && this.pushPending();
|
1994
|
-
const
|
1995
|
-
let
|
1996
|
-
return t < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()),
|
1994
|
+
const r = new I(u, e, t);
|
1995
|
+
let n = null;
|
1996
|
+
return t < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()), r.level = this.level, t > 0 && (this.level++, this._prev_delimiters.push(this.delimiters), this.delimiters = [], n = { delimiters: this.delimiters }), this.pendingLevel = this.level, this.tokens.push(r), this.tokens_meta.push(n), r;
|
1997
1997
|
};
|
1998
1998
|
eu.prototype.scanDelims = function(u, e) {
|
1999
|
-
const t = this.posMax,
|
1999
|
+
const t = this.posMax, r = this.src.charCodeAt(u), n = u > 0 ? this.src.charCodeAt(u - 1) : 32;
|
2000
2000
|
let c = u;
|
2001
|
-
for (; c < t && this.src.charCodeAt(c) ===
|
2001
|
+
for (; c < t && this.src.charCodeAt(c) === r; )
|
2002
2002
|
c++;
|
2003
|
-
const i = c - u, o = c < t ? this.src.charCodeAt(c) : 32, a =
|
2003
|
+
const i = c - u, o = c < t ? this.src.charCodeAt(c) : 32, a = X(n) || K(String.fromCharCode(n)), s = X(o) || K(String.fromCharCode(o)), l = Q(n), d = Q(o), b = !d && (!s || l || a), h = !l && (!a || d || s);
|
2004
2004
|
return { can_open: b && (e || !h || a), can_close: h && (e || !b || s), length: i };
|
2005
2005
|
};
|
2006
2006
|
eu.prototype.Token = I;
|
@@ -2044,13 +2044,13 @@ const pt = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
|
|
2044
2044
|
function xt(u, e) {
|
2045
2045
|
if (!u.md.options.linkify || u.linkLevel > 0)
|
2046
2046
|
return !1;
|
2047
|
-
const t = u.pos,
|
2048
|
-
if (t + 3 >
|
2047
|
+
const t = u.pos, r = u.posMax;
|
2048
|
+
if (t + 3 > r || u.src.charCodeAt(t) !== 58 || u.src.charCodeAt(t + 1) !== 47 || u.src.charCodeAt(t + 2) !== 47)
|
2049
2049
|
return !1;
|
2050
|
-
const
|
2051
|
-
if (!
|
2050
|
+
const n = u.pending.match(pt);
|
2051
|
+
if (!n)
|
2052
2052
|
return !1;
|
2053
|
-
const c =
|
2053
|
+
const c = n[1], i = u.md.linkify.matchAtStart(u.src.slice(t - c.length));
|
2054
2054
|
if (!i)
|
2055
2055
|
return !1;
|
2056
2056
|
let o = i.url;
|
@@ -2075,11 +2075,11 @@ function _t(u, e) {
|
|
2075
2075
|
let t = u.pos;
|
2076
2076
|
if (u.src.charCodeAt(t) !== 10)
|
2077
2077
|
return !1;
|
2078
|
-
const
|
2078
|
+
const r = u.pending.length - 1, n = u.posMax;
|
2079
2079
|
if (!e)
|
2080
|
-
if (
|
2081
|
-
if (
|
2082
|
-
let c =
|
2080
|
+
if (r >= 0 && u.pending.charCodeAt(r) === 32)
|
2081
|
+
if (r >= 1 && u.pending.charCodeAt(r - 1) === 32) {
|
2082
|
+
let c = r - 1;
|
2083
2083
|
for (; c >= 1 && u.pending.charCodeAt(c - 1) === 32; )
|
2084
2084
|
c--;
|
2085
2085
|
u.pending = u.pending.slice(0, c), u.push("hardbreak", "br", 0);
|
@@ -2087,7 +2087,7 @@ function _t(u, e) {
|
|
2087
2087
|
u.pending = u.pending.slice(0, -1), u.push("softbreak", "br", 0);
|
2088
2088
|
else
|
2089
2089
|
u.push("softbreak", "br", 0);
|
2090
|
-
for (t++; t <
|
2090
|
+
for (t++; t < n && E(u.src.charCodeAt(t)); )
|
2091
2091
|
t++;
|
2092
2092
|
return u.pos = t, !0;
|
2093
2093
|
}
|
@@ -2099,24 +2099,24 @@ for (let u = 0; u < 256; u++)
|
|
2099
2099
|
});
|
2100
2100
|
function mt(u, e) {
|
2101
2101
|
let t = u.pos;
|
2102
|
-
const
|
2103
|
-
if (u.src.charCodeAt(t) !== 92 || (t++, t >=
|
2102
|
+
const r = u.posMax;
|
2103
|
+
if (u.src.charCodeAt(t) !== 92 || (t++, t >= r))
|
2104
2104
|
return !1;
|
2105
|
-
let
|
2106
|
-
if (
|
2107
|
-
for (e || u.push("hardbreak", "br", 0), t++; t <
|
2105
|
+
let n = u.src.charCodeAt(t);
|
2106
|
+
if (n === 10) {
|
2107
|
+
for (e || u.push("hardbreak", "br", 0), t++; t < r && (n = u.src.charCodeAt(t), !!E(n)); )
|
2108
2108
|
t++;
|
2109
2109
|
return u.pos = t, !0;
|
2110
2110
|
}
|
2111
2111
|
let c = u.src[t];
|
2112
|
-
if (
|
2112
|
+
if (n >= 55296 && n <= 56319 && t + 1 < r) {
|
2113
2113
|
const o = u.src.charCodeAt(t + 1);
|
2114
2114
|
o >= 56320 && o <= 57343 && (c += u.src[t + 1], t++);
|
2115
2115
|
}
|
2116
2116
|
const i = "\\" + c;
|
2117
2117
|
if (!e) {
|
2118
2118
|
const o = u.push("text_special", "", 0);
|
2119
|
-
|
2119
|
+
n < 256 && Iu[n] !== 0 ? o.content = c : o.content = i, o.markup = i, o.info = "escape";
|
2120
2120
|
}
|
2121
2121
|
return u.pos = t + 1, !0;
|
2122
2122
|
}
|
@@ -2124,13 +2124,13 @@ function gt(u, e) {
|
|
2124
2124
|
let t = u.pos;
|
2125
2125
|
if (u.src.charCodeAt(t) !== 96)
|
2126
2126
|
return !1;
|
2127
|
-
const
|
2127
|
+
const n = t;
|
2128
2128
|
t++;
|
2129
2129
|
const c = u.posMax;
|
2130
2130
|
for (; t < c && u.src.charCodeAt(t) === 96; )
|
2131
2131
|
t++;
|
2132
|
-
const i = u.src.slice(
|
2133
|
-
if (u.backticksScanned && (u.backticks[o] || 0) <=
|
2132
|
+
const i = u.src.slice(n, t), o = i.length;
|
2133
|
+
if (u.backticksScanned && (u.backticks[o] || 0) <= n)
|
2134
2134
|
return e || (u.pending += i), u.pos += o, !0;
|
2135
2135
|
let a = t, s;
|
2136
2136
|
for (; (s = u.src.indexOf("`", a)) !== -1; ) {
|
@@ -2149,40 +2149,40 @@ function gt(u, e) {
|
|
2149
2149
|
return u.backticksScanned = !0, e || (u.pending += i), u.pos += o, !0;
|
2150
2150
|
}
|
2151
2151
|
function kt(u, e) {
|
2152
|
-
const t = u.pos,
|
2153
|
-
if (e ||
|
2152
|
+
const t = u.pos, r = u.src.charCodeAt(t);
|
2153
|
+
if (e || r !== 126)
|
2154
2154
|
return !1;
|
2155
|
-
const
|
2156
|
-
let c =
|
2157
|
-
const i = String.fromCharCode(
|
2155
|
+
const n = u.scanDelims(u.pos, !0);
|
2156
|
+
let c = n.length;
|
2157
|
+
const i = String.fromCharCode(r);
|
2158
2158
|
if (c < 2)
|
2159
2159
|
return !1;
|
2160
2160
|
let o;
|
2161
2161
|
c % 2 && (o = u.push("text", "", 0), o.content = i, c--);
|
2162
2162
|
for (let a = 0; a < c; a += 2)
|
2163
2163
|
o = u.push("text", "", 0), o.content = i + i, u.delimiters.push({
|
2164
|
-
marker:
|
2164
|
+
marker: r,
|
2165
2165
|
length: 0,
|
2166
2166
|
// disable "rule of 3" length checks meant for emphasis
|
2167
2167
|
token: u.tokens.length - 1,
|
2168
2168
|
end: -1,
|
2169
|
-
open:
|
2170
|
-
close:
|
2169
|
+
open: n.can_open,
|
2170
|
+
close: n.can_close
|
2171
2171
|
});
|
2172
|
-
return u.pos +=
|
2172
|
+
return u.pos += n.length, !0;
|
2173
2173
|
}
|
2174
2174
|
function Vu(u, e) {
|
2175
2175
|
let t;
|
2176
|
-
const
|
2177
|
-
for (let c = 0; c <
|
2176
|
+
const r = [], n = e.length;
|
2177
|
+
for (let c = 0; c < n; c++) {
|
2178
2178
|
const i = e[c];
|
2179
2179
|
if (i.marker !== 126 || i.end === -1)
|
2180
2180
|
continue;
|
2181
2181
|
const o = e[i.end];
|
2182
|
-
t = u.tokens[i.token], t.type = "s_open", t.tag = "s", t.nesting = 1, t.markup = "~~", t.content = "", t = u.tokens[o.token], t.type = "s_close", t.tag = "s", t.nesting = -1, t.markup = "~~", t.content = "", u.tokens[o.token - 1].type === "text" && u.tokens[o.token - 1].content === "~" &&
|
2182
|
+
t = u.tokens[i.token], t.type = "s_open", t.tag = "s", t.nesting = 1, t.markup = "~~", t.content = "", t = u.tokens[o.token], t.type = "s_close", t.tag = "s", t.nesting = -1, t.markup = "~~", t.content = "", u.tokens[o.token - 1].type === "text" && u.tokens[o.token - 1].content === "~" && r.push(o.token - 1);
|
2183
2183
|
}
|
2184
|
-
for (;
|
2185
|
-
const c =
|
2184
|
+
for (; r.length; ) {
|
2185
|
+
const c = r.pop();
|
2186
2186
|
let i = c + 1;
|
2187
2187
|
for (; i < u.tokens.length && u.tokens[i].type === "s_close"; )
|
2188
2188
|
i++;
|
@@ -2192,27 +2192,27 @@ function Vu(u, e) {
|
|
2192
2192
|
function Ct(u) {
|
2193
2193
|
const e = u.tokens_meta, t = u.tokens_meta.length;
|
2194
2194
|
Vu(u, u.delimiters);
|
2195
|
-
for (let
|
2196
|
-
e[
|
2195
|
+
for (let r = 0; r < t; r++)
|
2196
|
+
e[r] && e[r].delimiters && Vu(u, e[r].delimiters);
|
2197
2197
|
}
|
2198
2198
|
const l0 = {
|
2199
2199
|
tokenize: kt,
|
2200
2200
|
postProcess: Ct
|
2201
2201
|
};
|
2202
2202
|
function Dt(u, e) {
|
2203
|
-
const t = u.pos,
|
2204
|
-
if (e ||
|
2203
|
+
const t = u.pos, r = u.src.charCodeAt(t);
|
2204
|
+
if (e || r !== 95 && r !== 42)
|
2205
2205
|
return !1;
|
2206
|
-
const
|
2207
|
-
for (let c = 0; c <
|
2206
|
+
const n = u.scanDelims(u.pos, r === 42);
|
2207
|
+
for (let c = 0; c < n.length; c++) {
|
2208
2208
|
const i = u.push("text", "", 0);
|
2209
|
-
i.content = String.fromCharCode(
|
2209
|
+
i.content = String.fromCharCode(r), u.delimiters.push({
|
2210
2210
|
// Char code of the starting marker (number).
|
2211
2211
|
//
|
2212
|
-
marker:
|
2212
|
+
marker: r,
|
2213
2213
|
// Total length of these series of delimiters.
|
2214
2214
|
//
|
2215
|
-
length:
|
2215
|
+
length: n.length,
|
2216
2216
|
// A position of the token this delimiter corresponds to.
|
2217
2217
|
//
|
2218
2218
|
token: u.tokens.length - 1,
|
@@ -2223,38 +2223,38 @@ function Dt(u, e) {
|
|
2223
2223
|
// Boolean flags that determine if this delimiter could open or close
|
2224
2224
|
// an emphasis.
|
2225
2225
|
//
|
2226
|
-
open:
|
2227
|
-
close:
|
2226
|
+
open: n.can_open,
|
2227
|
+
close: n.can_close
|
2228
2228
|
});
|
2229
2229
|
}
|
2230
|
-
return u.pos +=
|
2230
|
+
return u.pos += n.length, !0;
|
2231
2231
|
}
|
2232
2232
|
function Gu(u, e) {
|
2233
2233
|
const t = e.length;
|
2234
|
-
for (let
|
2235
|
-
const
|
2236
|
-
if (
|
2234
|
+
for (let r = t - 1; r >= 0; r--) {
|
2235
|
+
const n = e[r];
|
2236
|
+
if (n.marker !== 95 && n.marker !== 42 || n.end === -1)
|
2237
2237
|
continue;
|
2238
|
-
const c = e[
|
2239
|
-
e[
|
2240
|
-
e[
|
2238
|
+
const c = e[n.end], i = r > 0 && e[r - 1].end === n.end + 1 && // check that first two markers match and adjacent
|
2239
|
+
e[r - 1].marker === n.marker && e[r - 1].token === n.token - 1 && // check that last two markers are adjacent (we can safely assume they match)
|
2240
|
+
e[n.end + 1].token === c.token + 1, o = String.fromCharCode(n.marker), a = u.tokens[n.token];
|
2241
2241
|
a.type = i ? "strong_open" : "em_open", a.tag = i ? "strong" : "em", a.nesting = 1, a.markup = i ? o + o : o, a.content = "";
|
2242
2242
|
const s = u.tokens[c.token];
|
2243
|
-
s.type = i ? "strong_close" : "em_close", s.tag = i ? "strong" : "em", s.nesting = -1, s.markup = i ? o + o : o, s.content = "", i && (u.tokens[e[
|
2243
|
+
s.type = i ? "strong_close" : "em_close", s.tag = i ? "strong" : "em", s.nesting = -1, s.markup = i ? o + o : o, s.content = "", i && (u.tokens[e[r - 1].token].content = "", u.tokens[e[n.end + 1].token].content = "", r--);
|
2244
2244
|
}
|
2245
2245
|
}
|
2246
2246
|
function Et(u) {
|
2247
2247
|
const e = u.tokens_meta, t = u.tokens_meta.length;
|
2248
2248
|
Gu(u, u.delimiters);
|
2249
|
-
for (let
|
2250
|
-
e[
|
2249
|
+
for (let r = 0; r < t; r++)
|
2250
|
+
e[r] && e[r].delimiters && Gu(u, e[r].delimiters);
|
2251
2251
|
}
|
2252
2252
|
const f0 = {
|
2253
2253
|
tokenize: Dt,
|
2254
2254
|
postProcess: Et
|
2255
2255
|
};
|
2256
|
-
function
|
2257
|
-
let t,
|
2256
|
+
function yt(u, e) {
|
2257
|
+
let t, r, n, c, i = "", o = "", a = u.pos, s = !0;
|
2258
2258
|
if (u.src.charCodeAt(u.pos) !== 91)
|
2259
2259
|
return !1;
|
2260
2260
|
const l = u.pos, d = u.posMax, b = u.pos + 1, h = u.md.helpers.parseLinkLabel(u, u.pos, !0);
|
@@ -2266,11 +2266,11 @@ function At(u, e) {
|
|
2266
2266
|
;
|
2267
2267
|
if (f >= d)
|
2268
2268
|
return !1;
|
2269
|
-
if (a = f,
|
2270
|
-
for (i = u.md.normalizeLink(
|
2269
|
+
if (a = f, n = u.md.helpers.parseLinkDestination(u.src, f, u.posMax), n.ok) {
|
2270
|
+
for (i = u.md.normalizeLink(n.str), u.md.validateLink(i) ? f = n.pos : i = "", a = f; f < d && (t = u.src.charCodeAt(f), !(!E(t) && t !== 10)); f++)
|
2271
2271
|
;
|
2272
|
-
if (
|
2273
|
-
for (o =
|
2272
|
+
if (n = u.md.helpers.parseLinkTitle(u.src, f, u.posMax), f < d && a !== f && n.ok)
|
2273
|
+
for (o = n.str, f = n.pos; f < d && (t = u.src.charCodeAt(f), !(!E(t) && t !== 10)); f++)
|
2274
2274
|
;
|
2275
2275
|
}
|
2276
2276
|
(f >= d || u.src.charCodeAt(f) !== 41) && (s = !0), f++;
|
@@ -2278,7 +2278,7 @@ function At(u, e) {
|
|
2278
2278
|
if (s) {
|
2279
2279
|
if (typeof u.env.references > "u")
|
2280
2280
|
return !1;
|
2281
|
-
if (f < d && u.src.charCodeAt(f) === 91 ? (a = f + 1, f = u.md.helpers.parseLinkLabel(u, f), f >= 0 ?
|
2281
|
+
if (f < d && u.src.charCodeAt(f) === 91 ? (a = f + 1, f = u.md.helpers.parseLinkLabel(u, f), f >= 0 ? r = u.src.slice(a, f++) : f = h + 1) : f = h + 1, r || (r = u.src.slice(b, h)), c = u.env.references[fu(r)], !c)
|
2282
2282
|
return u.pos = l, !1;
|
2283
2283
|
i = c.href, o = c.title;
|
2284
2284
|
}
|
@@ -2289,8 +2289,8 @@ function At(u, e) {
|
|
2289
2289
|
}
|
2290
2290
|
return u.pos = f, u.posMax = d, !0;
|
2291
2291
|
}
|
2292
|
-
function
|
2293
|
-
let t,
|
2292
|
+
function At(u, e) {
|
2293
|
+
let t, r, n, c, i, o, a, s, l = "";
|
2294
2294
|
const d = u.pos, b = u.posMax;
|
2295
2295
|
if (u.src.charCodeAt(u.pos) !== 33 || u.src.charCodeAt(u.pos + 1) !== 91)
|
2296
2296
|
return !1;
|
@@ -2315,32 +2315,32 @@ function yt(u, e) {
|
|
2315
2315
|
} else {
|
2316
2316
|
if (typeof u.env.references > "u")
|
2317
2317
|
return !1;
|
2318
|
-
if (c < b && u.src.charCodeAt(c) === 91 ? (s = c + 1, c = u.md.helpers.parseLinkLabel(u, c), c >= 0 ?
|
2318
|
+
if (c < b && u.src.charCodeAt(c) === 91 ? (s = c + 1, c = u.md.helpers.parseLinkLabel(u, c), c >= 0 ? n = u.src.slice(s, c++) : c = f + 1) : c = f + 1, n || (n = u.src.slice(h, f)), i = u.env.references[fu(n)], !i)
|
2319
2319
|
return u.pos = d, !1;
|
2320
2320
|
l = i.href, a = i.title;
|
2321
2321
|
}
|
2322
2322
|
if (!e) {
|
2323
|
-
|
2323
|
+
r = u.src.slice(h, f);
|
2324
2324
|
const g = [];
|
2325
2325
|
u.md.inline.parse(
|
2326
|
-
|
2326
|
+
r,
|
2327
2327
|
u.md,
|
2328
2328
|
u.env,
|
2329
2329
|
g
|
2330
2330
|
);
|
2331
2331
|
const k = u.push("image", "img", 0), D = [["src", l], ["alt", ""]];
|
2332
|
-
k.attrs = D, k.children = g, k.content =
|
2332
|
+
k.attrs = D, k.children = g, k.content = r, a && D.push(["title", a]);
|
2333
2333
|
}
|
2334
2334
|
return u.pos = c, u.posMax = b, !0;
|
2335
2335
|
}
|
2336
|
-
const Ft = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,
|
2337
|
-
function
|
2336
|
+
const Ft = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/, wt = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
|
2337
|
+
function vt(u, e) {
|
2338
2338
|
let t = u.pos;
|
2339
2339
|
if (u.src.charCodeAt(t) !== 60)
|
2340
2340
|
return !1;
|
2341
|
-
const
|
2341
|
+
const r = u.pos, n = u.posMax;
|
2342
2342
|
for (; ; ) {
|
2343
|
-
if (++t >=
|
2343
|
+
if (++t >= n)
|
2344
2344
|
return !1;
|
2345
2345
|
const i = u.src.charCodeAt(t);
|
2346
2346
|
if (i === 60)
|
@@ -2348,8 +2348,8 @@ function wt(u, e) {
|
|
2348
2348
|
if (i === 62)
|
2349
2349
|
break;
|
2350
2350
|
}
|
2351
|
-
const c = u.src.slice(
|
2352
|
-
if (
|
2351
|
+
const c = u.src.slice(r + 1, t);
|
2352
|
+
if (wt.test(c)) {
|
2353
2353
|
const i = u.md.normalizeLink(c);
|
2354
2354
|
if (!u.md.validateLink(i))
|
2355
2355
|
return !1;
|
@@ -2392,13 +2392,13 @@ function It(u) {
|
|
2392
2392
|
function Bt(u, e) {
|
2393
2393
|
if (!u.md.options.html)
|
2394
2394
|
return !1;
|
2395
|
-
const t = u.posMax,
|
2396
|
-
if (u.src.charCodeAt(
|
2395
|
+
const t = u.posMax, r = u.pos;
|
2396
|
+
if (u.src.charCodeAt(r) !== 60 || r + 2 >= t)
|
2397
2397
|
return !1;
|
2398
|
-
const
|
2399
|
-
if (
|
2398
|
+
const n = u.src.charCodeAt(r + 1);
|
2399
|
+
if (n !== 33 && n !== 63 && n !== 47 && !It(n))
|
2400
2400
|
return !1;
|
2401
|
-
const c = u.src.slice(
|
2401
|
+
const c = u.src.slice(r).match(ot);
|
2402
2402
|
if (!c)
|
2403
2403
|
return !1;
|
2404
2404
|
if (!e) {
|
@@ -2408,9 +2408,9 @@ function Bt(u, e) {
|
|
2408
2408
|
return u.pos += c[0].length, !0;
|
2409
2409
|
}
|
2410
2410
|
const zt = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, Mt = /^&([a-z][a-z0-9]{1,31});/i;
|
2411
|
-
function
|
2412
|
-
const t = u.pos,
|
2413
|
-
if (u.src.charCodeAt(t) !== 38 || t + 1 >=
|
2411
|
+
function Rt(u, e) {
|
2412
|
+
const t = u.pos, r = u.posMax;
|
2413
|
+
if (u.src.charCodeAt(t) !== 38 || t + 1 >= r)
|
2414
2414
|
return !1;
|
2415
2415
|
if (u.src.charCodeAt(t + 1) === 35) {
|
2416
2416
|
const c = u.src.slice(t).match(zt);
|
@@ -2424,7 +2424,7 @@ function qt(u, e) {
|
|
2424
2424
|
} else {
|
2425
2425
|
const c = u.src.slice(t).match(Mt);
|
2426
2426
|
if (c) {
|
2427
|
-
const i =
|
2427
|
+
const i = n0(c[0]);
|
2428
2428
|
if (i !== c[0]) {
|
2429
2429
|
if (!e) {
|
2430
2430
|
const o = u.push("text_special", "", 0);
|
@@ -2440,22 +2440,22 @@ function Wu(u) {
|
|
2440
2440
|
const e = {}, t = u.length;
|
2441
2441
|
if (!t)
|
2442
2442
|
return;
|
2443
|
-
let
|
2443
|
+
let r = 0, n = -2;
|
2444
2444
|
const c = [];
|
2445
2445
|
for (let i = 0; i < t; i++) {
|
2446
2446
|
const o = u[i];
|
2447
|
-
if (c.push(0), (u[
|
2447
|
+
if (c.push(0), (u[r].marker !== o.marker || n !== o.token - 1) && (r = i), n = o.token, o.length = o.length || 0, !o.close)
|
2448
2448
|
continue;
|
2449
2449
|
e.hasOwnProperty(o.marker) || (e[o.marker] = [-1, -1, -1, -1, -1, -1]);
|
2450
2450
|
const a = e[o.marker][(o.open ? 3 : 0) + o.length % 3];
|
2451
|
-
let s =
|
2451
|
+
let s = r - c[r] - 1, l = s;
|
2452
2452
|
for (; s > a; s -= c[s] + 1) {
|
2453
2453
|
const d = u[s];
|
2454
2454
|
if (d.marker === o.marker && d.open && d.end < 0) {
|
2455
2455
|
let b = !1;
|
2456
2456
|
if ((d.close || o.open) && (d.length + o.length) % 3 === 0 && (d.length % 3 !== 0 || o.length % 3 !== 0) && (b = !0), !b) {
|
2457
2457
|
const h = s > 0 && !u[s - 1].open ? c[s - 1] + 1 : 0;
|
2458
|
-
c[i] = i - s + h, c[s] = h, o.open = !1, d.end = i, d.close = !1, l = -1,
|
2458
|
+
c[i] = i - s + h, c[s] = h, o.open = !1, d.end = i, d.close = !1, l = -1, n = -2;
|
2459
2459
|
break;
|
2460
2460
|
}
|
2461
2461
|
}
|
@@ -2463,18 +2463,18 @@ function Wu(u) {
|
|
2463
2463
|
l !== -1 && (e[o.marker][(o.open ? 3 : 0) + (o.length || 0) % 3] = l);
|
2464
2464
|
}
|
2465
2465
|
}
|
2466
|
-
function
|
2466
|
+
function qt(u) {
|
2467
2467
|
const e = u.tokens_meta, t = u.tokens_meta.length;
|
2468
2468
|
Wu(u.delimiters);
|
2469
|
-
for (let
|
2470
|
-
e[
|
2469
|
+
for (let r = 0; r < t; r++)
|
2470
|
+
e[r] && e[r].delimiters && Wu(e[r].delimiters);
|
2471
2471
|
}
|
2472
2472
|
function Lt(u) {
|
2473
|
-
let e, t,
|
2474
|
-
const
|
2473
|
+
let e, t, r = 0;
|
2474
|
+
const n = u.tokens, c = u.tokens.length;
|
2475
2475
|
for (e = t = 0; e < c; e++)
|
2476
|
-
|
2477
|
-
e !== t && (
|
2476
|
+
n[e].nesting < 0 && r--, n[e].level = r, n[e].nesting > 0 && r++, n[e].type === "text" && e + 1 < c && n[e + 1].type === "text" ? n[e + 1].content = n[e].content + n[e + 1].content : (e !== t && (n[t] = n[e]), t++);
|
2477
|
+
e !== t && (n.length = t);
|
2478
2478
|
}
|
2479
2479
|
const mu = [
|
2480
2480
|
["text", bt],
|
@@ -2484,13 +2484,13 @@ const mu = [
|
|
2484
2484
|
["backticks", gt],
|
2485
2485
|
["strikethrough", l0.tokenize],
|
2486
2486
|
["emphasis", f0.tokenize],
|
2487
|
-
["link",
|
2488
|
-
["image",
|
2489
|
-
["autolink",
|
2487
|
+
["link", yt],
|
2488
|
+
["image", At],
|
2489
|
+
["autolink", vt],
|
2490
2490
|
["html_inline", Bt],
|
2491
|
-
["entity",
|
2491
|
+
["entity", Rt]
|
2492
2492
|
], gu = [
|
2493
|
-
["balance_pairs",
|
2493
|
+
["balance_pairs", qt],
|
2494
2494
|
["strikethrough", l0.postProcess],
|
2495
2495
|
["emphasis", f0.postProcess],
|
2496
2496
|
// rules for pairs separate '**' into its own text tokens, which may be left unused,
|
@@ -2498,22 +2498,22 @@ const mu = [
|
|
2498
2498
|
["fragments_join", Lt]
|
2499
2499
|
];
|
2500
2500
|
function tu() {
|
2501
|
-
this.ruler = new
|
2501
|
+
this.ruler = new w();
|
2502
2502
|
for (let u = 0; u < mu.length; u++)
|
2503
2503
|
this.ruler.push(mu[u][0], mu[u][1]);
|
2504
|
-
this.ruler2 = new
|
2504
|
+
this.ruler2 = new w();
|
2505
2505
|
for (let u = 0; u < gu.length; u++)
|
2506
2506
|
this.ruler2.push(gu[u][0], gu[u][1]);
|
2507
2507
|
}
|
2508
2508
|
tu.prototype.skipToken = function(u) {
|
2509
|
-
const e = u.pos, t = this.ruler.getRules(""),
|
2509
|
+
const e = u.pos, t = this.ruler.getRules(""), r = t.length, n = u.md.options.maxNesting, c = u.cache;
|
2510
2510
|
if (typeof c[e] < "u") {
|
2511
2511
|
u.pos = c[e];
|
2512
2512
|
return;
|
2513
2513
|
}
|
2514
2514
|
let i = !1;
|
2515
|
-
if (u.level <
|
2516
|
-
for (let o = 0; o <
|
2515
|
+
if (u.level < n) {
|
2516
|
+
for (let o = 0; o < r; o++)
|
2517
2517
|
if (u.level++, i = t[o](u, !0), u.level--, i) {
|
2518
2518
|
if (e >= u.pos)
|
2519
2519
|
throw new Error("inline rule didn't increment state.pos");
|
@@ -2524,11 +2524,11 @@ tu.prototype.skipToken = function(u) {
|
|
2524
2524
|
i || u.pos++, c[e] = u.pos;
|
2525
2525
|
};
|
2526
2526
|
tu.prototype.tokenize = function(u) {
|
2527
|
-
const e = this.ruler.getRules(""), t = e.length,
|
2528
|
-
for (; u.pos <
|
2527
|
+
const e = this.ruler.getRules(""), t = e.length, r = u.posMax, n = u.md.options.maxNesting;
|
2528
|
+
for (; u.pos < r; ) {
|
2529
2529
|
const c = u.pos;
|
2530
2530
|
let i = !1;
|
2531
|
-
if (u.level <
|
2531
|
+
if (u.level < n) {
|
2532
2532
|
for (let o = 0; o < t; o++)
|
2533
2533
|
if (i = e[o](u, !1), i) {
|
2534
2534
|
if (c >= u.pos)
|
@@ -2537,7 +2537,7 @@ tu.prototype.tokenize = function(u) {
|
|
2537
2537
|
}
|
2538
2538
|
}
|
2539
2539
|
if (i) {
|
2540
|
-
if (u.pos >=
|
2540
|
+
if (u.pos >= r)
|
2541
2541
|
break;
|
2542
2542
|
continue;
|
2543
2543
|
}
|
@@ -2545,17 +2545,17 @@ tu.prototype.tokenize = function(u) {
|
|
2545
2545
|
}
|
2546
2546
|
u.pending && u.pushPending();
|
2547
2547
|
};
|
2548
|
-
tu.prototype.parse = function(u, e, t,
|
2549
|
-
const
|
2550
|
-
this.tokenize(
|
2548
|
+
tu.prototype.parse = function(u, e, t, r) {
|
2549
|
+
const n = new this.State(u, e, t, r);
|
2550
|
+
this.tokenize(n);
|
2551
2551
|
const c = this.ruler2.getRules(""), i = c.length;
|
2552
2552
|
for (let o = 0; o < i; o++)
|
2553
|
-
c[o](
|
2553
|
+
c[o](n);
|
2554
2554
|
};
|
2555
2555
|
tu.prototype.State = eu;
|
2556
2556
|
function Pt(u) {
|
2557
2557
|
const e = {};
|
2558
|
-
u = u || {}, e.src_Any =
|
2558
|
+
u = u || {}, e.src_Any = Xu.source, e.src_Cc = Yu.source, e.src_Z = e0.source, e.src_P = wu.source, e.src_ZPCc = [e.src_Z, e.src_P, e.src_Cc].join("|"), e.src_ZCc = [e.src_Z, e.src_Cc].join("|");
|
2559
2559
|
const t = "[><|]";
|
2560
2560
|
return e.src_pseudo_letter = "(?:(?!" + t + "|" + e.src_ZPCc + ")" + e.src_Any + ")", e.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", e.src_auth = "(?:(?:(?!" + e.src_ZCc + "|[@/\\[\\]()]).)+@)?", e.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?", e.src_host_terminator = "(?=$|" + t + "|" + e.src_ZPCc + ")(?!" + (u["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + e.src_ZPCc + "))", e.src_path = "(?:[/?#](?:(?!" + e.src_ZCc + "|" + t + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + e.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + e.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + e.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + e.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + e.src_ZCc + "|[']).)+\\'|\\'(?=" + e.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + e.src_ZCc + "|[.]|$)|" + (u["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + // allow `,,,` in paths
|
2561
2561
|
",(?!" + e.src_ZCc + "|$)|;(?!" + e.src_ZCc + "|$)|\\!+(?!" + e.src_ZCc + "|[!]|$)|\\?(?!" + e.src_ZCc + "|[?]|$))+|\\/)?", e.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*', e.src_xn = "xn--[a-z0-9\\-]{1,59}", e.src_domain_root = // Allow letters & digits (http://test1)
|
@@ -2567,8 +2567,8 @@ function Pt(u) {
|
|
2567
2567
|
}
|
2568
2568
|
function Eu(u) {
|
2569
2569
|
return Array.prototype.slice.call(arguments, 1).forEach(function(t) {
|
2570
|
-
t && Object.keys(t).forEach(function(
|
2571
|
-
u[
|
2570
|
+
t && Object.keys(t).forEach(function(r) {
|
2571
|
+
u[r] = t[r];
|
2572
2572
|
});
|
2573
2573
|
}), u;
|
2574
2574
|
}
|
@@ -2603,33 +2603,33 @@ function Ut(u) {
|
|
2603
2603
|
const Ht = {
|
2604
2604
|
"http:": {
|
2605
2605
|
validate: function(u, e, t) {
|
2606
|
-
const
|
2606
|
+
const r = u.slice(e);
|
2607
2607
|
return t.re.http || (t.re.http = new RegExp(
|
2608
2608
|
"^\\/\\/" + t.re.src_auth + t.re.src_host_port_strict + t.re.src_path,
|
2609
2609
|
"i"
|
2610
|
-
)), t.re.http.test(
|
2610
|
+
)), t.re.http.test(r) ? r.match(t.re.http)[0].length : 0;
|
2611
2611
|
}
|
2612
2612
|
},
|
2613
2613
|
"https:": "http:",
|
2614
2614
|
"ftp:": "http:",
|
2615
2615
|
"//": {
|
2616
2616
|
validate: function(u, e, t) {
|
2617
|
-
const
|
2617
|
+
const r = u.slice(e);
|
2618
2618
|
return t.re.no_http || (t.re.no_http = new RegExp(
|
2619
2619
|
"^" + t.re.src_auth + // Don't allow single-level domains, because of false positives like '//test'
|
2620
2620
|
// with code comments
|
2621
2621
|
"(?:localhost|(?:(?:" + t.re.src_domain + ")\\.)+" + t.re.src_domain_root + ")" + t.re.src_port + t.re.src_host_terminator + t.re.src_path,
|
2622
2622
|
"i"
|
2623
|
-
)), t.re.no_http.test(
|
2623
|
+
)), t.re.no_http.test(r) ? e >= 3 && u[e - 3] === ":" || e >= 3 && u[e - 3] === "/" ? 0 : r.match(t.re.no_http)[0].length : 0;
|
2624
2624
|
}
|
2625
2625
|
},
|
2626
2626
|
"mailto:": {
|
2627
2627
|
validate: function(u, e, t) {
|
2628
|
-
const
|
2628
|
+
const r = u.slice(e);
|
2629
2629
|
return t.re.mailto || (t.re.mailto = new RegExp(
|
2630
2630
|
"^" + t.re.src_email_name + "@" + t.re.src_host_strict,
|
2631
2631
|
"i"
|
2632
|
-
)), t.re.mailto.test(
|
2632
|
+
)), t.re.mailto.test(r) ? r.match(t.re.mailto)[0].length : 0;
|
2633
2633
|
}
|
2634
2634
|
}
|
2635
2635
|
}, Zt = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]", Vt = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
|
@@ -2638,8 +2638,8 @@ function Gt(u) {
|
|
2638
2638
|
}
|
2639
2639
|
function Wt(u) {
|
2640
2640
|
return function(e, t) {
|
2641
|
-
const
|
2642
|
-
return u.test(
|
2641
|
+
const r = e.slice(t);
|
2642
|
+
return u.test(r) ? r.match(u)[0].length : 0;
|
2643
2643
|
};
|
2644
2644
|
}
|
2645
2645
|
function Qu() {
|
@@ -2650,11 +2650,11 @@ function Qu() {
|
|
2650
2650
|
function au(u) {
|
2651
2651
|
const e = u.re = Pt(u.__opts__), t = u.__tlds__.slice();
|
2652
2652
|
u.onCompile(), u.__tlds_replaced__ || t.push(Zt), t.push(e.src_xn), e.src_tlds = t.join("|");
|
2653
|
-
function
|
2653
|
+
function r(o) {
|
2654
2654
|
return o.replace("%TLDS%", e.src_tlds);
|
2655
2655
|
}
|
2656
|
-
e.email_fuzzy = RegExp(
|
2657
|
-
const
|
2656
|
+
e.email_fuzzy = RegExp(r(e.tpl_email_fuzzy), "i"), e.link_fuzzy = RegExp(r(e.tpl_link_fuzzy), "i"), e.link_no_ip_fuzzy = RegExp(r(e.tpl_link_no_ip_fuzzy), "i"), e.host_fuzzy_test = RegExp(r(e.tpl_host_fuzzy_test), "i");
|
2657
|
+
const n = [];
|
2658
2658
|
u.__compiled__ = {};
|
2659
2659
|
function c(o, a) {
|
2660
2660
|
throw new Error('(LinkifyIt) Invalid schema "' + o + '": ' + a);
|
@@ -2669,11 +2669,11 @@ function au(u) {
|
|
2669
2669
|
return;
|
2670
2670
|
}
|
2671
2671
|
if (Ot(a)) {
|
2672
|
-
|
2672
|
+
n.push(o);
|
2673
2673
|
return;
|
2674
2674
|
}
|
2675
2675
|
c(o, a);
|
2676
|
-
}),
|
2676
|
+
}), n.forEach(function(o) {
|
2677
2677
|
u.__compiled__[u.__schemas__[o]] && (u.__compiled__[o].validate = u.__compiled__[u.__schemas__[o]].validate, u.__compiled__[o].normalize = u.__compiled__[u.__schemas__[o]].normalize);
|
2678
2678
|
}), u.__compiled__[""] = { validate: null, normalize: Qu() };
|
2679
2679
|
const i = Object.keys(u.__compiled__).filter(function(o) {
|
@@ -2685,28 +2685,28 @@ function au(u) {
|
|
2685
2685
|
), Gt(u);
|
2686
2686
|
}
|
2687
2687
|
function Jt(u, e) {
|
2688
|
-
const t = u.__index__,
|
2689
|
-
this.schema = u.__schema__.toLowerCase(), this.index = t + e, this.lastIndex =
|
2688
|
+
const t = u.__index__, r = u.__last_index__, n = u.__text_cache__.slice(t, r);
|
2689
|
+
this.schema = u.__schema__.toLowerCase(), this.index = t + e, this.lastIndex = r + e, this.raw = n, this.text = n, this.url = n;
|
2690
2690
|
}
|
2691
|
-
function
|
2691
|
+
function yu(u, e) {
|
2692
2692
|
const t = new Jt(u, e);
|
2693
2693
|
return u.__compiled__[t.schema].normalize(t, u), t;
|
2694
2694
|
}
|
2695
|
-
function
|
2696
|
-
if (!(this instanceof
|
2697
|
-
return new
|
2695
|
+
function v(u, e) {
|
2696
|
+
if (!(this instanceof v))
|
2697
|
+
return new v(u, e);
|
2698
2698
|
e || Ut(u) && (e = u, u = {}), this.__opts__ = Eu({}, d0, e), this.__index__ = -1, this.__last_index__ = -1, this.__schema__ = "", this.__text_cache__ = "", this.__schemas__ = Eu({}, Ht, u), this.__compiled__ = {}, this.__tlds__ = Vt, this.__tlds_replaced__ = !1, this.re = {}, au(this);
|
2699
2699
|
}
|
2700
|
-
|
2700
|
+
v.prototype.add = function(e, t) {
|
2701
2701
|
return this.__schemas__[e] = t, au(this), this;
|
2702
2702
|
};
|
2703
|
-
|
2703
|
+
v.prototype.set = function(e) {
|
2704
2704
|
return this.__opts__ = Eu(this.__opts__, e), this;
|
2705
2705
|
};
|
2706
|
-
|
2706
|
+
v.prototype.test = function(e) {
|
2707
2707
|
if (this.__text_cache__ = e, this.__index__ = -1, !e.length)
|
2708
2708
|
return !1;
|
2709
|
-
let t,
|
2709
|
+
let t, r, n, c, i, o, a, s, l;
|
2710
2710
|
if (this.re.schema_test.test(e)) {
|
2711
2711
|
for (a = this.re.schema_search, a.lastIndex = 0; (t = a.exec(e)) !== null; )
|
2712
2712
|
if (c = this.testSchemaAt(e, t[2], a.lastIndex), c) {
|
@@ -2714,99 +2714,99 @@ w.prototype.test = function(e) {
|
|
2714
2714
|
break;
|
2715
2715
|
}
|
2716
2716
|
}
|
2717
|
-
return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (s = e.search(this.re.host_fuzzy_test), s >= 0 && (this.__index__ < 0 || s < this.__index__) && (
|
2717
|
+
return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (s = e.search(this.re.host_fuzzy_test), s >= 0 && (this.__index__ < 0 || s < this.__index__) && (r = e.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null && (i = r.index + r[1].length, (this.__index__ < 0 || i < this.__index__) && (this.__schema__ = "", this.__index__ = i, this.__last_index__ = r.index + r[0].length))), this.__opts__.fuzzyEmail && this.__compiled__["mailto:"] && (l = e.indexOf("@"), l >= 0 && (n = e.match(this.re.email_fuzzy)) !== null && (i = n.index + n[1].length, o = n.index + n[0].length, (this.__index__ < 0 || i < this.__index__ || i === this.__index__ && o > this.__last_index__) && (this.__schema__ = "mailto:", this.__index__ = i, this.__last_index__ = o))), this.__index__ >= 0;
|
2718
2718
|
};
|
2719
|
-
|
2719
|
+
v.prototype.pretest = function(e) {
|
2720
2720
|
return this.re.pretest.test(e);
|
2721
2721
|
};
|
2722
|
-
|
2723
|
-
return this.__compiled__[t.toLowerCase()] ? this.__compiled__[t.toLowerCase()].validate(e,
|
2722
|
+
v.prototype.testSchemaAt = function(e, t, r) {
|
2723
|
+
return this.__compiled__[t.toLowerCase()] ? this.__compiled__[t.toLowerCase()].validate(e, r, this) : 0;
|
2724
2724
|
};
|
2725
|
-
|
2725
|
+
v.prototype.match = function(e) {
|
2726
2726
|
const t = [];
|
2727
|
-
let
|
2728
|
-
this.__index__ >= 0 && this.__text_cache__ === e && (t.push(
|
2729
|
-
let
|
2730
|
-
for (; this.test(
|
2731
|
-
t.push(
|
2727
|
+
let r = 0;
|
2728
|
+
this.__index__ >= 0 && this.__text_cache__ === e && (t.push(yu(this, r)), r = this.__last_index__);
|
2729
|
+
let n = r ? e.slice(r) : e;
|
2730
|
+
for (; this.test(n); )
|
2731
|
+
t.push(yu(this, r)), n = n.slice(this.__last_index__), r += this.__last_index__;
|
2732
2732
|
return t.length ? t : null;
|
2733
2733
|
};
|
2734
|
-
|
2734
|
+
v.prototype.matchAtStart = function(e) {
|
2735
2735
|
if (this.__text_cache__ = e, this.__index__ = -1, !e.length)
|
2736
2736
|
return null;
|
2737
2737
|
const t = this.re.schema_at_start.exec(e);
|
2738
2738
|
if (!t)
|
2739
2739
|
return null;
|
2740
|
-
const
|
2741
|
-
return
|
2740
|
+
const r = this.testSchemaAt(e, t[2], t[0].length);
|
2741
|
+
return r ? (this.__schema__ = t[2], this.__index__ = t.index + t[1].length, this.__last_index__ = t.index + t[0].length + r, yu(this, 0)) : null;
|
2742
2742
|
};
|
2743
|
-
|
2744
|
-
return e = Array.isArray(e) ? e : [e], t ? (this.__tlds__ = this.__tlds__.concat(e).sort().filter(function(
|
2745
|
-
return
|
2743
|
+
v.prototype.tlds = function(e, t) {
|
2744
|
+
return e = Array.isArray(e) ? e : [e], t ? (this.__tlds__ = this.__tlds__.concat(e).sort().filter(function(r, n, c) {
|
2745
|
+
return r !== c[n - 1];
|
2746
2746
|
}).reverse(), au(this), this) : (this.__tlds__ = e.slice(), this.__tlds_replaced__ = !0, au(this), this);
|
2747
2747
|
};
|
2748
|
-
|
2748
|
+
v.prototype.normalize = function(e) {
|
2749
2749
|
e.schema || (e.url = "http://" + e.url), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = "mailto:" + e.url);
|
2750
2750
|
};
|
2751
|
-
|
2751
|
+
v.prototype.onCompile = function() {
|
2752
2752
|
};
|
2753
|
-
const Z = 2147483647, z = 36, Bu = 1, Y = 26, Qt = 38,
|
2753
|
+
const Z = 2147483647, z = 36, Bu = 1, Y = 26, Qt = 38, Kt = 700, h0 = 72, b0 = 128, p0 = "-", Xt = /^xn--/, Yt = /[^\0-\x7F]/, un = /[\x2E\u3002\uFF0E\uFF61]/g, en = {
|
2754
2754
|
overflow: "Overflow: input needs wider integers to process",
|
2755
2755
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
2756
2756
|
"invalid-input": "Invalid input"
|
2757
2757
|
}, ku = z - Bu, M = Math.floor, Cu = String.fromCharCode;
|
2758
2758
|
function P(u) {
|
2759
|
-
throw new RangeError(
|
2759
|
+
throw new RangeError(en[u]);
|
2760
2760
|
}
|
2761
|
-
function
|
2761
|
+
function tn(u, e) {
|
2762
2762
|
const t = [];
|
2763
|
-
let
|
2764
|
-
for (;
|
2765
|
-
t[
|
2763
|
+
let r = u.length;
|
2764
|
+
for (; r--; )
|
2765
|
+
t[r] = e(u[r]);
|
2766
2766
|
return t;
|
2767
2767
|
}
|
2768
2768
|
function x0(u, e) {
|
2769
2769
|
const t = u.split("@");
|
2770
|
-
let
|
2771
|
-
t.length > 1 && (
|
2772
|
-
const
|
2773
|
-
return
|
2770
|
+
let r = "";
|
2771
|
+
t.length > 1 && (r = t[0] + "@", u = t[1]), u = u.replace(un, ".");
|
2772
|
+
const n = u.split("."), c = tn(n, e).join(".");
|
2773
|
+
return r + c;
|
2774
2774
|
}
|
2775
2775
|
function _0(u) {
|
2776
2776
|
const e = [];
|
2777
2777
|
let t = 0;
|
2778
|
-
const
|
2779
|
-
for (; t <
|
2780
|
-
const
|
2781
|
-
if (
|
2778
|
+
const r = u.length;
|
2779
|
+
for (; t < r; ) {
|
2780
|
+
const n = u.charCodeAt(t++);
|
2781
|
+
if (n >= 55296 && n <= 56319 && t < r) {
|
2782
2782
|
const c = u.charCodeAt(t++);
|
2783
|
-
(c & 64512) == 56320 ? e.push(((
|
2783
|
+
(c & 64512) == 56320 ? e.push(((n & 1023) << 10) + (c & 1023) + 65536) : (e.push(n), t--);
|
2784
2784
|
} else
|
2785
|
-
e.push(
|
2785
|
+
e.push(n);
|
2786
2786
|
}
|
2787
2787
|
return e;
|
2788
2788
|
}
|
2789
|
-
const
|
2789
|
+
const nn = (u) => String.fromCodePoint(...u), rn = function(u) {
|
2790
2790
|
return u >= 48 && u < 58 ? 26 + (u - 48) : u >= 65 && u < 91 ? u - 65 : u >= 97 && u < 123 ? u - 97 : z;
|
2791
|
-
},
|
2791
|
+
}, Ku = function(u, e) {
|
2792
2792
|
return u + 22 + 75 * (u < 26) - ((e != 0) << 5);
|
2793
2793
|
}, m0 = function(u, e, t) {
|
2794
|
-
let
|
2795
|
-
for (u = t ? M(u /
|
2794
|
+
let r = 0;
|
2795
|
+
for (u = t ? M(u / Kt) : u >> 1, u += M(u / e); u > ku * Y >> 1; r += z)
|
2796
2796
|
u = M(u / ku);
|
2797
|
-
return M(
|
2797
|
+
return M(r + (ku + 1) * u / (u + Qt));
|
2798
2798
|
}, g0 = function(u) {
|
2799
2799
|
const e = [], t = u.length;
|
2800
|
-
let
|
2800
|
+
let r = 0, n = b0, c = h0, i = u.lastIndexOf(p0);
|
2801
2801
|
i < 0 && (i = 0);
|
2802
2802
|
for (let o = 0; o < i; ++o)
|
2803
2803
|
u.charCodeAt(o) >= 128 && P("not-basic"), e.push(u.charCodeAt(o));
|
2804
2804
|
for (let o = i > 0 ? i + 1 : 0; o < t; ) {
|
2805
|
-
const a =
|
2805
|
+
const a = r;
|
2806
2806
|
for (let l = 1, d = z; ; d += z) {
|
2807
2807
|
o >= t && P("invalid-input");
|
2808
|
-
const b =
|
2809
|
-
b >= z && P("invalid-input"), b > M((Z -
|
2808
|
+
const b = rn(u.charCodeAt(o++));
|
2809
|
+
b >= z && P("invalid-input"), b > M((Z - r) / l) && P("overflow"), r += b * l;
|
2810
2810
|
const h = d <= c ? Bu : d >= c + Y ? Y : d - c;
|
2811
2811
|
if (b < h)
|
2812
2812
|
break;
|
@@ -2814,14 +2814,14 @@ const rr = (u) => String.fromCodePoint(...u), nr = function(u) {
|
|
2814
2814
|
l > M(Z / f) && P("overflow"), l *= f;
|
2815
2815
|
}
|
2816
2816
|
const s = e.length + 1;
|
2817
|
-
c = m0(
|
2817
|
+
c = m0(r - a, s, a == 0), M(r / s) > Z - n && P("overflow"), n += M(r / s), r %= s, e.splice(r++, 0, n);
|
2818
2818
|
}
|
2819
2819
|
return String.fromCodePoint(...e);
|
2820
2820
|
}, k0 = function(u) {
|
2821
2821
|
const e = [];
|
2822
2822
|
u = _0(u);
|
2823
2823
|
const t = u.length;
|
2824
|
-
let
|
2824
|
+
let r = b0, n = 0, c = h0;
|
2825
2825
|
for (const a of u)
|
2826
2826
|
a < 128 && e.push(Cu(a));
|
2827
2827
|
const i = e.length;
|
@@ -2829,31 +2829,31 @@ const rr = (u) => String.fromCodePoint(...u), nr = function(u) {
|
|
2829
2829
|
for (i && e.push(p0); o < t; ) {
|
2830
2830
|
let a = Z;
|
2831
2831
|
for (const l of u)
|
2832
|
-
l >=
|
2832
|
+
l >= r && l < a && (a = l);
|
2833
2833
|
const s = o + 1;
|
2834
|
-
a -
|
2834
|
+
a - r > M((Z - n) / s) && P("overflow"), n += (a - r) * s, r = a;
|
2835
2835
|
for (const l of u)
|
2836
|
-
if (l <
|
2837
|
-
let d =
|
2836
|
+
if (l < r && ++n > Z && P("overflow"), l === r) {
|
2837
|
+
let d = n;
|
2838
2838
|
for (let b = z; ; b += z) {
|
2839
2839
|
const h = b <= c ? Bu : b >= c + Y ? Y : b - c;
|
2840
2840
|
if (d < h)
|
2841
2841
|
break;
|
2842
2842
|
const f = d - h, g = z - h;
|
2843
2843
|
e.push(
|
2844
|
-
Cu(
|
2844
|
+
Cu(Ku(h + f % g, 0))
|
2845
2845
|
), d = M(f / g);
|
2846
2846
|
}
|
2847
|
-
e.push(Cu(
|
2847
|
+
e.push(Cu(Ku(d, 0))), c = m0(n, s, o === i), n = 0, ++o;
|
2848
2848
|
}
|
2849
|
-
++
|
2849
|
+
++n, ++r;
|
2850
2850
|
}
|
2851
2851
|
return e.join("");
|
2852
|
-
},
|
2852
|
+
}, cn = function(u) {
|
2853
2853
|
return x0(u, function(e) {
|
2854
|
-
return
|
2854
|
+
return Xt.test(e) ? g0(e.slice(4).toLowerCase()) : e;
|
2855
2855
|
});
|
2856
|
-
},
|
2856
|
+
}, on = function(u) {
|
2857
2857
|
return x0(u, function(e) {
|
2858
2858
|
return Yt.test(e) ? "xn--" + k0(e) : e;
|
2859
2859
|
});
|
@@ -2873,13 +2873,13 @@ const rr = (u) => String.fromCodePoint(...u), nr = function(u) {
|
|
2873
2873
|
*/
|
2874
2874
|
ucs2: {
|
2875
2875
|
decode: _0,
|
2876
|
-
encode:
|
2876
|
+
encode: nn
|
2877
2877
|
},
|
2878
2878
|
decode: g0,
|
2879
2879
|
encode: k0,
|
2880
|
-
toASCII:
|
2881
|
-
toUnicode:
|
2882
|
-
},
|
2880
|
+
toASCII: on,
|
2881
|
+
toUnicode: cn
|
2882
|
+
}, an = {
|
2883
2883
|
options: {
|
2884
2884
|
// Enable HTML tags in source
|
2885
2885
|
html: !1,
|
@@ -2915,7 +2915,7 @@ const rr = (u) => String.fromCodePoint(...u), nr = function(u) {
|
|
2915
2915
|
block: {},
|
2916
2916
|
inline: {}
|
2917
2917
|
}
|
2918
|
-
},
|
2918
|
+
}, sn = {
|
2919
2919
|
options: {
|
2920
2920
|
// Enable HTML tags in source
|
2921
2921
|
html: !1,
|
@@ -2970,7 +2970,7 @@ const rr = (u) => String.fromCodePoint(...u), nr = function(u) {
|
|
2970
2970
|
]
|
2971
2971
|
}
|
2972
2972
|
}
|
2973
|
-
},
|
2973
|
+
}, ln = {
|
2974
2974
|
options: {
|
2975
2975
|
// Enable HTML tags in source
|
2976
2976
|
html: !0,
|
@@ -3044,47 +3044,47 @@ const rr = (u) => String.fromCodePoint(...u), nr = function(u) {
|
|
3044
3044
|
]
|
3045
3045
|
}
|
3046
3046
|
}
|
3047
|
-
},
|
3048
|
-
default:
|
3049
|
-
zero:
|
3050
|
-
commonmark:
|
3051
|
-
},
|
3052
|
-
function
|
3047
|
+
}, fn = {
|
3048
|
+
default: an,
|
3049
|
+
zero: sn,
|
3050
|
+
commonmark: ln
|
3051
|
+
}, dn = /^(vbscript|javascript|file|data):/, hn = /^data:image\/(gif|png|jpeg|webp);/;
|
3052
|
+
function bn(u) {
|
3053
3053
|
const e = u.trim().toLowerCase();
|
3054
|
-
return
|
3054
|
+
return dn.test(e) ? hn.test(e) : !0;
|
3055
3055
|
}
|
3056
3056
|
const D0 = ["http:", "https:", "mailto:"];
|
3057
|
-
function
|
3057
|
+
function pn(u) {
|
3058
3058
|
const e = Fu(u, !0);
|
3059
3059
|
if (e.hostname && (!e.protocol || D0.indexOf(e.protocol) >= 0))
|
3060
3060
|
try {
|
3061
3061
|
e.hostname = C0.toASCII(e.hostname);
|
3062
3062
|
} catch {
|
3063
3063
|
}
|
3064
|
-
return uu(
|
3064
|
+
return uu(Au(e));
|
3065
3065
|
}
|
3066
|
-
function
|
3066
|
+
function xn(u) {
|
3067
3067
|
const e = Fu(u, !0);
|
3068
3068
|
if (e.hostname && (!e.protocol || D0.indexOf(e.protocol) >= 0))
|
3069
3069
|
try {
|
3070
3070
|
e.hostname = C0.toUnicode(e.hostname);
|
3071
3071
|
} catch {
|
3072
3072
|
}
|
3073
|
-
return V(
|
3073
|
+
return V(Au(e), V.defaultChars + "%");
|
3074
3074
|
}
|
3075
3075
|
function S(u, e) {
|
3076
3076
|
if (!(this instanceof S))
|
3077
3077
|
return new S(u, e);
|
3078
|
-
e ||
|
3078
|
+
e || vu(u) || (e = u || {}, u = "default"), this.inline = new tu(), this.block = new du(), this.core = new Tu(), this.renderer = new W(), this.linkify = new v(), this.validateLink = bn, this.normalizeLink = pn, this.normalizeLinkText = xn, this.utils = _e, this.helpers = lu({}, Ce), this.options = {}, this.configure(u), e && this.set(e);
|
3079
3079
|
}
|
3080
3080
|
S.prototype.set = function(u) {
|
3081
3081
|
return lu(this.options, u), this;
|
3082
3082
|
};
|
3083
3083
|
S.prototype.configure = function(u) {
|
3084
3084
|
const e = this;
|
3085
|
-
if (
|
3085
|
+
if (vu(u)) {
|
3086
3086
|
const t = u;
|
3087
|
-
if (u =
|
3087
|
+
if (u = fn[t], !u)
|
3088
3088
|
throw new Error('Wrong `markdown-it` preset "' + t + '", check name');
|
3089
3089
|
}
|
3090
3090
|
if (!u)
|
@@ -3095,26 +3095,26 @@ S.prototype.configure = function(u) {
|
|
3095
3095
|
};
|
3096
3096
|
S.prototype.enable = function(u, e) {
|
3097
3097
|
let t = [];
|
3098
|
-
Array.isArray(u) || (u = [u]), ["core", "block", "inline"].forEach(function(
|
3099
|
-
t = t.concat(this[
|
3098
|
+
Array.isArray(u) || (u = [u]), ["core", "block", "inline"].forEach(function(n) {
|
3099
|
+
t = t.concat(this[n].ruler.enable(u, !0));
|
3100
3100
|
}, this), t = t.concat(this.inline.ruler2.enable(u, !0));
|
3101
|
-
const
|
3102
|
-
return t.indexOf(
|
3101
|
+
const r = u.filter(function(n) {
|
3102
|
+
return t.indexOf(n) < 0;
|
3103
3103
|
});
|
3104
|
-
if (
|
3105
|
-
throw new Error("MarkdownIt. Failed to enable unknown rule(s): " +
|
3104
|
+
if (r.length && !e)
|
3105
|
+
throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + r);
|
3106
3106
|
return this;
|
3107
3107
|
};
|
3108
3108
|
S.prototype.disable = function(u, e) {
|
3109
3109
|
let t = [];
|
3110
|
-
Array.isArray(u) || (u = [u]), ["core", "block", "inline"].forEach(function(
|
3111
|
-
t = t.concat(this[
|
3110
|
+
Array.isArray(u) || (u = [u]), ["core", "block", "inline"].forEach(function(n) {
|
3111
|
+
t = t.concat(this[n].ruler.disable(u, !0));
|
3112
3112
|
}, this), t = t.concat(this.inline.ruler2.disable(u, !0));
|
3113
|
-
const
|
3114
|
-
return t.indexOf(
|
3113
|
+
const r = u.filter(function(n) {
|
3114
|
+
return t.indexOf(n) < 0;
|
3115
3115
|
});
|
3116
|
-
if (
|
3117
|
-
throw new Error("MarkdownIt. Failed to disable unknown rule(s): " +
|
3116
|
+
if (r.length && !e)
|
3117
|
+
throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + r);
|
3118
3118
|
return this;
|
3119
3119
|
};
|
3120
3120
|
S.prototype.use = function(u) {
|
@@ -3137,37 +3137,66 @@ S.prototype.parseInline = function(u, e) {
|
|
3137
3137
|
S.prototype.renderInline = function(u, e) {
|
3138
3138
|
return e = e || {}, this.renderer.render(this.parseInline(u, e), this.options, e);
|
3139
3139
|
};
|
3140
|
-
const
|
3140
|
+
const _n = `:host{--cv-notebook-height: 100%;--cv-notebook-width: 100%}:host cv-notebook-cell.dragged{transform:translateZ(0)}:host cv-icon-button button{font-variation-settings:"FILL" 1}.error{margin:.75rem 1px;padding:0 .25rem}.notebook{background-color:var(--cv-theme-surface-container-lowest);box-sizing:border-box;display:flex;flex-direction:column;height:100%}.notebookCells{box-sizing:border-box;display:flex;flex-direction:column;gap:.5rem;height:calc(100% - 106px);overflow-y:auto;overflow-x:hidden;padding:1rem;width:100%}.notebookActions{display:flex;gap:1rem;justify-content:center;padding-top:1rem}:host .notebookHeaderActions{--cv-select-height: 2.25rem;--cv-select-label-top-position: -25.25px;--mdc-icon-button-size: 40px;--mdc-icon-size: 22px;align-items:center;border:1px solid var(--cv-theme-outline-variant);box-shadow:0 0 2px 0 var(--cv-theme-on-positive-container-16);box-sizing:border-box;display:flex;gap:.15rem;padding:7px .25rem}:host .notebookHeaderActions cv-select{margin-left:.5rem}.drag-over{border-bottom:1.5px solid var(--cv-theme-primary)}.input-container{display:flex;align-items:center;gap:.5rem}
|
3141
3141
|
`;
|
3142
|
-
var
|
3143
|
-
for (var
|
3144
|
-
(i = u[c]) && (
|
3145
|
-
return
|
3142
|
+
var mn = Object.defineProperty, gn = Object.getOwnPropertyDescriptor, nu = (u, e, t, r) => {
|
3143
|
+
for (var n = r > 1 ? void 0 : r ? gn(e, t) : e, c = u.length - 1, i; c >= 0; c--)
|
3144
|
+
(i = u[c]) && (n = (r ? i(e, t, n) : i(n)) || n);
|
3145
|
+
return r && n && mn(e, t, n), n;
|
3146
3146
|
};
|
3147
|
-
let j = class extends
|
3147
|
+
let j = class extends v0 {
|
3148
3148
|
constructor() {
|
3149
|
-
super(
|
3149
|
+
super(), this.cells = [], this.cellTypes = [], this._clipboardCell = null, this._draggedCellIndex = null, this._selectedCellIndex = null, this._handleKeydown = this._handleKeydown.bind(this);
|
3150
3150
|
}
|
3151
3151
|
// Add a cell to the notebook
|
3152
3152
|
addCell(u) {
|
3153
|
-
|
3153
|
+
const e = this.createNewCell(u);
|
3154
|
+
this._clipboardCell = { ...e }, this.pasteCell(), this._clipboardCell = null;
|
3155
|
+
}
|
3156
|
+
connectedCallback() {
|
3157
|
+
super.connectedCallback(), document.addEventListener("keydown", this._handleKeydown);
|
3154
3158
|
}
|
3155
3159
|
// Copy the selected cell
|
3156
3160
|
copyCell() {
|
3157
3161
|
this._selectedCellIndex !== null && (this._clipboardCell = { ...this.cells[this._selectedCellIndex] });
|
3158
3162
|
}
|
3163
|
+
createNewCell(u) {
|
3164
|
+
const e = u === "markdown" ? u : this.defaultLanguage || "python";
|
3165
|
+
return {
|
3166
|
+
cell_type: u,
|
3167
|
+
code: "",
|
3168
|
+
execution_count: null,
|
3169
|
+
language: e,
|
3170
|
+
metadata: {
|
3171
|
+
tags: [],
|
3172
|
+
trusted: !1
|
3173
|
+
},
|
3174
|
+
outputs: [],
|
3175
|
+
source: ""
|
3176
|
+
};
|
3177
|
+
}
|
3159
3178
|
// Cut the selected cell
|
3160
3179
|
cutCell() {
|
3161
3180
|
this._selectedCellIndex !== null && (this._clipboardCell = this.cells[this._selectedCellIndex], this.deleteCell());
|
3162
3181
|
}
|
3163
3182
|
// Delete the selected cell
|
3164
3183
|
deleteCell() {
|
3165
|
-
this._selectedCellIndex !== null
|
3184
|
+
if (this._selectedCellIndex !== null) {
|
3185
|
+
this.cells.splice(this._selectedCellIndex, 1);
|
3186
|
+
const u = Math.min(
|
3187
|
+
this._selectedCellIndex + 1,
|
3188
|
+
this.cells.length - 1
|
3189
|
+
);
|
3190
|
+
this.scrollToSelectedCell(u), this.dispatchUpdatedCells();
|
3191
|
+
}
|
3166
3192
|
}
|
3167
3193
|
// Deselect all the cells
|
3168
3194
|
deselectAllCells() {
|
3169
3195
|
this.cells.forEach((u) => u.selected = !1);
|
3170
3196
|
}
|
3197
|
+
disconnectedCallback() {
|
3198
|
+
super.disconnectedCallback(), document.removeEventListener("keydown", this._handleKeydown);
|
3199
|
+
}
|
3171
3200
|
// Dispatch a custom cell event
|
3172
3201
|
dispatchCustomCellEvent(u, e) {
|
3173
3202
|
!e && this._selectedCellIndex && (e = this.cells[this._selectedCellIndex]), e && this.dispatchEvent(
|
@@ -3194,7 +3223,7 @@ let j = class extends w0 {
|
|
3194
3223
|
}
|
3195
3224
|
getDragImage(u) {
|
3196
3225
|
const e = this.cells[u], t = B`
|
3197
|
-
<div class="dragImage" style="
|
3226
|
+
<div class="dragImage" style="width: 80%;">
|
3198
3227
|
<cv-notebook-cell
|
3199
3228
|
.code="${e.code}"
|
3200
3229
|
.language="${e.language}"
|
@@ -3204,8 +3233,21 @@ let j = class extends w0 {
|
|
3204
3233
|
.showEditor="false"
|
3205
3234
|
></cv-notebook-cell>
|
3206
3235
|
</div>
|
3207
|
-
`,
|
3208
|
-
return S0(t,
|
3236
|
+
`, r = document.createElement("div");
|
3237
|
+
return S0(t, r), r;
|
3238
|
+
}
|
3239
|
+
scrollToSelectedCell(u) {
|
3240
|
+
var r, n;
|
3241
|
+
this.selectCell(u);
|
3242
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector(
|
3243
|
+
`#cell-${this._selectedCellIndex}`
|
3244
|
+
), t = (n = this.shadowRoot) == null ? void 0 : n.querySelector(
|
3245
|
+
"#notebook-cells"
|
3246
|
+
);
|
3247
|
+
if (e && t) {
|
3248
|
+
const c = t.getBoundingClientRect(), i = e.getBoundingClientRect(), o = i.top < c.top, a = i.bottom > c.bottom;
|
3249
|
+
o ? t.scrollTop = e.offsetTop - t.offsetTop : a && (t.scrollTop = e.offsetTop - t.offsetTop - t.clientHeight + e.clientHeight);
|
3250
|
+
}
|
3209
3251
|
}
|
3210
3252
|
// Dispatch an event when the cell type is changed
|
3211
3253
|
handleCellTypeChange(u) {
|
@@ -3226,9 +3268,9 @@ let j = class extends w0 {
|
|
3226
3268
|
handleDragStart(u, e) {
|
3227
3269
|
if (this._draggedCellIndex = e, this.deselectAllCells(), u.dataTransfer) {
|
3228
3270
|
u.currentTarget.classList.add("dragged"), u.dataTransfer.effectAllowed = "move", u.dataTransfer.setData("text/plain", e.toString());
|
3229
|
-
const
|
3230
|
-
|
3231
|
-
document.body.removeChild(
|
3271
|
+
const n = this.getDragImage(e).firstElementChild;
|
3272
|
+
n.style.position = "absolute", n.style.top = "-1000px", document.body.appendChild(n), u.dataTransfer.setDragImage(n, 0, 0), setTimeout(() => {
|
3273
|
+
document.body.removeChild(n);
|
3232
3274
|
}, 0);
|
3233
3275
|
}
|
3234
3276
|
}
|
@@ -3245,7 +3287,7 @@ let j = class extends w0 {
|
|
3245
3287
|
...this.cells.slice(0, e),
|
3246
3288
|
t,
|
3247
3289
|
...this.cells.slice(e)
|
3248
|
-
], this.cells = this.cells.map((
|
3290
|
+
], this.cells = this.cells.map((r, n) => ({ ...r, index: n })), this._draggedCellIndex = null, this.dispatchUpdatedCells();
|
3249
3291
|
}
|
3250
3292
|
}
|
3251
3293
|
handleDragLeave(u) {
|
@@ -3269,6 +3311,31 @@ let j = class extends w0 {
|
|
3269
3311
|
})
|
3270
3312
|
);
|
3271
3313
|
}
|
3314
|
+
_handleKeydown(u) {
|
3315
|
+
var t, r, n, c;
|
3316
|
+
let e = (t = this.cells) == null ? void 0 : t.findIndex((i) => i.selected);
|
3317
|
+
switch (u.key) {
|
3318
|
+
case "ArrowUp":
|
3319
|
+
e = Math.max(e - 1, 0), this.scrollToSelectedCell(e);
|
3320
|
+
break;
|
3321
|
+
case "ArrowDown":
|
3322
|
+
e = Math.min(
|
3323
|
+
e + 1,
|
3324
|
+
this.cells.length - 1
|
3325
|
+
), this.scrollToSelectedCell(e);
|
3326
|
+
break;
|
3327
|
+
case "Enter":
|
3328
|
+
if (u.shiftKey)
|
3329
|
+
this.runCell();
|
3330
|
+
else {
|
3331
|
+
const i = (r = this.shadowRoot) == null ? void 0 : r.querySelector(
|
3332
|
+
`#cell-${e}`
|
3333
|
+
), o = (n = i == null ? void 0 : i.shadowRoot) == null ? void 0 : n.querySelector("cv-code-editor");
|
3334
|
+
(c = o == null ? void 0 : o.editor) == null || c.focus();
|
3335
|
+
}
|
3336
|
+
break;
|
3337
|
+
}
|
3338
|
+
}
|
3272
3339
|
// Shows the cell editor on clicking output for markdown cells
|
3273
3340
|
handleOutputCLick(u) {
|
3274
3341
|
const e = this.cells[u];
|
@@ -3284,24 +3351,24 @@ let j = class extends w0 {
|
|
3284
3351
|
renderCellOutput(u) {
|
3285
3352
|
var e;
|
3286
3353
|
return (e = u.outputs) != null && e.length ? B`${u.outputs.map(
|
3287
|
-
(t) => B`${t.data && Object.keys(t.data).map((
|
3288
|
-
const
|
3289
|
-
|
3354
|
+
(t) => B`${t.data && Object.keys(t.data).map((r) => {
|
3355
|
+
const n = document.createElement("div");
|
3356
|
+
n.style.maxWidth = "100%", n.style.overflow = "auto";
|
3290
3357
|
const c = S({ html: !0 });
|
3291
|
-
switch (
|
3358
|
+
switch (r) {
|
3292
3359
|
case "text/markdown":
|
3293
|
-
|
3360
|
+
n.innerHTML = c.render(t.data[r]);
|
3294
3361
|
break;
|
3295
3362
|
case "text/html":
|
3296
|
-
|
3363
|
+
n.innerHTML = t.data[r];
|
3297
3364
|
break;
|
3298
3365
|
case "image/png": {
|
3299
3366
|
const i = document.createElement("img");
|
3300
|
-
i.style.maxWidth = "100%", i.draggable = !1, i.src = `data:image/png;base64, ${t.data[
|
3367
|
+
i.style.maxWidth = "100%", i.draggable = !1, i.src = `data:image/png;base64, ${t.data[r]}`, n.appendChild(i);
|
3301
3368
|
break;
|
3302
3369
|
}
|
3303
3370
|
}
|
3304
|
-
return
|
3371
|
+
return n;
|
3305
3372
|
})}`
|
3306
3373
|
)}` : B``;
|
3307
3374
|
}
|
@@ -3354,10 +3421,10 @@ let j = class extends w0 {
|
|
3354
3421
|
)}
|
3355
3422
|
</cv-select>
|
3356
3423
|
</section>
|
3357
|
-
<section class="notebookCells">
|
3424
|
+
<section class="notebookCells" id="notebook-cells">
|
3358
3425
|
${this.cells.map(
|
3359
3426
|
(e, t) => {
|
3360
|
-
var
|
3427
|
+
var r, n;
|
3361
3428
|
return B`<cv-notebook-cell
|
3362
3429
|
.code="${e.code}"
|
3363
3430
|
.index="${t}"
|
@@ -3381,7 +3448,7 @@ let j = class extends w0 {
|
|
3381
3448
|
>
|
3382
3449
|
${this.renderCellOutput(e)}
|
3383
3450
|
</div>
|
3384
|
-
${((
|
3451
|
+
${((r = e.inputs) == null ? void 0 : r.length) && e.inputs.map(
|
3385
3452
|
(c) => B`
|
3386
3453
|
<div class="input-container" slot="input">
|
3387
3454
|
<cv-typography scale="body2">
|
@@ -3396,7 +3463,7 @@ let j = class extends w0 {
|
|
3396
3463
|
</div>
|
3397
3464
|
`
|
3398
3465
|
)}
|
3399
|
-
${((
|
3466
|
+
${((n = e.errors) == null ? void 0 : n.length) && B`<div slot="error">
|
3400
3467
|
${e.errors && e.errors.map(
|
3401
3468
|
(c) => B`<cv-alert
|
3402
3469
|
descriptionText="${c}"
|
@@ -3413,19 +3480,10 @@ let j = class extends w0 {
|
|
3413
3480
|
)}
|
3414
3481
|
</section>
|
3415
3482
|
<section class="notebookActions">
|
3416
|
-
<cv-button
|
3417
|
-
outlined
|
3418
|
-
@click=${() => this.addCell({
|
3419
|
-
code: "",
|
3420
|
-
language: this.defaultLanguage || "python"
|
3421
|
-
})}
|
3422
|
-
>
|
3483
|
+
<cv-button outlined @click=${() => this.addCell("code")}>
|
3423
3484
|
<cv-icon style="font-size: 20px;">add</cv-icon>Code cell
|
3424
3485
|
</cv-button>
|
3425
|
-
<cv-button
|
3426
|
-
outlined
|
3427
|
-
@click=${() => this.addCell({ code: "", language: "markdown" })}
|
3428
|
-
>
|
3486
|
+
<cv-button outlined @click=${() => this.addCell("markdown")}>
|
3429
3487
|
<cv-icon style="font-size: 20px;">add</cv-icon>Markdown
|
3430
3488
|
</cv-button>
|
3431
3489
|
</section>
|
@@ -3433,12 +3491,12 @@ let j = class extends w0 {
|
|
3433
3491
|
}
|
3434
3492
|
removeCSS(u, e) {
|
3435
3493
|
const t = e == null ? void 0 : e.querySelectorAll(u);
|
3436
|
-
t == null || t.forEach((
|
3494
|
+
t == null || t.forEach((r) => r.classList.remove(u));
|
3437
3495
|
}
|
3438
3496
|
runCell() {
|
3439
3497
|
if (this._selectedCellIndex !== null) {
|
3440
3498
|
const u = this.cells[this._selectedCellIndex];
|
3441
|
-
this.dispatchCustomCellEvent("run-cell", u);
|
3499
|
+
this.dispatchCustomCellEvent("run-cell", u), this._selectedCellIndex + 1 < this.cells.length && this.scrollToSelectedCell(this._selectedCellIndex + 1);
|
3442
3500
|
}
|
3443
3501
|
this.requestUpdate();
|
3444
3502
|
}
|
@@ -3452,33 +3510,34 @@ let j = class extends w0 {
|
|
3452
3510
|
return u.language !== "markdown" || u.language === "markdown" && !((e = u.outputs) != null && e.length);
|
3453
3511
|
}
|
3454
3512
|
updated(u) {
|
3455
|
-
u.has("cells") && this.cells.forEach((e) => {
|
3456
|
-
|
3513
|
+
u.has("cells") && this.cells.forEach((e, t) => {
|
3514
|
+
var r;
|
3515
|
+
e.showEditor = this.shouldRenderEditor(e), (r = e.inputs) != null && r.length && this.scrollToSelectedCell(t);
|
3457
3516
|
});
|
3458
3517
|
}
|
3459
3518
|
};
|
3460
3519
|
j.styles = [
|
3461
3520
|
F0`
|
3462
|
-
${
|
3521
|
+
${w0(_n)}
|
3463
3522
|
`
|
3464
3523
|
];
|
3465
|
-
|
3524
|
+
nu([
|
3466
3525
|
su({ type: Array })
|
3467
3526
|
], j.prototype, "cells", 2);
|
3468
|
-
|
3527
|
+
nu([
|
3469
3528
|
su({ type: Array })
|
3470
3529
|
], j.prototype, "cellTypes", 2);
|
3471
|
-
|
3530
|
+
nu([
|
3472
3531
|
su({ type: String })
|
3473
3532
|
], j.prototype, "cellType", 2);
|
3474
|
-
|
3533
|
+
nu([
|
3475
3534
|
su({ type: String })
|
3476
3535
|
], j.prototype, "defaultLanguage", 2);
|
3477
|
-
j =
|
3536
|
+
j = nu([
|
3478
3537
|
T0("cv-notebook")
|
3479
3538
|
], j);
|
3480
|
-
const
|
3539
|
+
const rr = j;
|
3481
3540
|
export {
|
3482
3541
|
j as CovalentNotebook,
|
3483
|
-
|
3542
|
+
rr as default
|
3484
3543
|
};
|