@opentiny/tiny-robot 0.3.0-alpha.36 → 0.3.0-alpha.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bubble/index.js +1383 -1388
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/index.d.ts +1 -12
- package/dist/index2.js +15 -15
- package/dist/mcp-server-picker/index.js +1 -1
- package/dist/prompts/index.js +5 -5
- package/dist/sender/index.js +399 -402
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/bubble/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ou = (u, e, t) =>
|
|
4
|
-
import { defineComponent as
|
|
1
|
+
var bn = Object.defineProperty;
|
|
2
|
+
var pn = (u, e, t) => e in u ? bn(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
|
3
|
+
var Ou = (u, e, t) => pn(u, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { defineComponent as Fu, ref as s0, createElementBlock as W, openBlock as v, createElementVNode as Y, createVNode as Ct, toDisplayString as Du, unref as l0, normalizeClass as Cu, withDirectives as _n, vShow as mn, computed as X, useCssModule as xn, createCommentVNode as Qu, createBlock as hu, resolveDynamicComponent as Pu, createTextVNode as gn, inject as G0, h as xu, useSlots as kn, useAttrs as En, normalizeStyle as An, renderSlot as ke, Fragment as Dt, renderList as Ee, watch as Cn, nextTick as Dn, mergeProps as $e, createSlots as W0, withCtx as Z0, normalizeProps as V0, guardReactiveProps as yn, provide as Y0 } from "vue";
|
|
5
5
|
import { _ as Fn } from "../loading.js";
|
|
6
6
|
import { t as Tn } from "../utils.js";
|
|
7
|
-
import { IconArrowUp as Sn, IconPlugin as
|
|
7
|
+
import { IconArrowUp as Sn, IconPlugin as X0, IconArrowDown as wn, IconLoading as vn, IconError as Rn, IconCancelled as In } from "@opentiny/tiny-robot-svgs";
|
|
8
8
|
import { _ as ce } from "../_plugin-vue_export-helper.js";
|
|
9
9
|
import { u as Mn } from "../index3.js";
|
|
10
10
|
class f0 {
|
|
11
11
|
}
|
|
12
|
-
const Ln = { class: "tr-bubble__step-text" }, On = { class: "tr-bubble__step-text-title" }, Nn = { class: "tr-bubble__step-text-content-wrapper" },
|
|
12
|
+
const Ln = { class: "tr-bubble__step-text" }, On = { class: "tr-bubble__step-text-title" }, Nn = { class: "tr-bubble__step-text-content-wrapper" }, Bn = /* @__PURE__ */ Fu({
|
|
13
13
|
__name: "collapsible-text",
|
|
14
14
|
props: {
|
|
15
15
|
title: {},
|
|
@@ -18,34 +18,34 @@ const Ln = { class: "tr-bubble__step-text" }, On = { class: "tr-bubble__step-tex
|
|
|
18
18
|
},
|
|
19
19
|
setup(u) {
|
|
20
20
|
const e = u, t = s0(e.defaultOpen ?? !1);
|
|
21
|
-
return (n, r) => (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class:
|
|
26
|
-
onClick: r[0] || (r[0] = (
|
|
21
|
+
return (n, r) => (v(), W("div", Ln, [
|
|
22
|
+
Y("div", On, [
|
|
23
|
+
Y("span", null, Du(e.title), 1),
|
|
24
|
+
Ct(l0(Sn), {
|
|
25
|
+
class: Cu(["expand-icon", { "rotate-180": !t.value }]),
|
|
26
|
+
onClick: r[0] || (r[0] = (c) => t.value = !t.value)
|
|
27
27
|
}, null, 8, ["class"])
|
|
28
28
|
]),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
[
|
|
29
|
+
Y("div", Nn, [
|
|
30
|
+
_n(Y("div", { class: "tr-bubble__step-text-content" }, Du(e.content), 513), [
|
|
31
|
+
[mn, t.value]
|
|
32
32
|
])
|
|
33
33
|
])
|
|
34
34
|
]));
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
36
|
+
}), Pn = /* @__PURE__ */ ce(Bn, [["__scopeId", "data-v-c614ffd3"]]), zn = Pn, qn = { class: "tr-bubble__text" }, Un = /* @__PURE__ */ Fu({
|
|
37
37
|
__name: "text",
|
|
38
38
|
props: {
|
|
39
39
|
content: {}
|
|
40
40
|
},
|
|
41
41
|
setup(u) {
|
|
42
42
|
const e = u;
|
|
43
|
-
return (t, n) => (
|
|
43
|
+
return (t, n) => (v(), W("span", qn, Du(e.content), 1));
|
|
44
44
|
}
|
|
45
45
|
}), Hn = /* @__PURE__ */ ce(Un, [["__scopeId", "data-v-ddb66b72"]]), d0 = Hn, $n = { class: "tr-bubble__step-tool" }, jn = { class: "tr-bubble__step-tool-header" }, Gn = { class: "tr-bubble__step-tool-left" }, Wn = { class: "tr-bubble__step-tool-title" }, Zn = { class: "tr-bubble__step-tool-name" }, Vn = { class: "tr-bubble__step-tool-expand" }, Yn = {
|
|
46
46
|
key: 0,
|
|
47
47
|
class: "tr-bubble__step-tool-params"
|
|
48
|
-
}, Xn = ["innerHTML"], Jn = /* @__PURE__ */
|
|
48
|
+
}, Xn = ["innerHTML"], Jn = /* @__PURE__ */ Fu({
|
|
49
49
|
__name: "tool",
|
|
50
50
|
props: {
|
|
51
51
|
name: {},
|
|
@@ -57,52 +57,52 @@ const Ln = { class: "tr-bubble__step-text" }, On = { class: "tr-bubble__step-tex
|
|
|
57
57
|
setup(u) {
|
|
58
58
|
const e = u, t = s0(e.defaultOpen ?? !1), n = /* @__PURE__ */ new Map([
|
|
59
59
|
["running", { text: "正在调用", icon: vn }],
|
|
60
|
-
["success", { text: "已调用", icon:
|
|
60
|
+
["success", { text: "已调用", icon: X0 }],
|
|
61
61
|
["failed", { text: "调用失败", icon: Rn }],
|
|
62
62
|
["cancelled", { text: "已取消", icon: In }]
|
|
63
|
-
]), r = X(() => n.get(e.status) || { text: "", icon:
|
|
64
|
-
if (!
|
|
63
|
+
]), r = X(() => n.get(e.status) || { text: "", icon: X0 }), c = xn(), i = (o) => {
|
|
64
|
+
if (!o)
|
|
65
65
|
return "";
|
|
66
66
|
let a = "";
|
|
67
67
|
const s = e.formatPretty ? 2 : 0;
|
|
68
68
|
try {
|
|
69
|
-
typeof
|
|
70
|
-
} catch (
|
|
71
|
-
console.warn(
|
|
69
|
+
typeof o == "string" ? a = JSON.stringify(JSON.parse(o), null, s) : a = JSON.stringify(o, null, s);
|
|
70
|
+
} catch (f) {
|
|
71
|
+
console.warn(f);
|
|
72
72
|
}
|
|
73
73
|
return a = a.replace(
|
|
74
74
|
/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,
|
|
75
|
-
(
|
|
76
|
-
let
|
|
77
|
-
return /^"/.test(
|
|
75
|
+
(f) => {
|
|
76
|
+
let d = "number";
|
|
77
|
+
return /^"/.test(f) ? d = /:$/.test(f) ? "key" : "string" : /true|false/.test(f) ? d = "boolean" : /null/.test(f) && (d = "null"), `<span class="${c[d]}">${f}</span>`;
|
|
78
78
|
}
|
|
79
79
|
), a;
|
|
80
80
|
};
|
|
81
|
-
return (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
(
|
|
85
|
-
class:
|
|
81
|
+
return (o, a) => (v(), W("div", $n, [
|
|
82
|
+
Y("div", jn, [
|
|
83
|
+
Y("div", Gn, [
|
|
84
|
+
(v(), hu(Pu(r.value.icon), {
|
|
85
|
+
class: Cu(["tr-bubble__step-tool-icon", `icon-${e.status}`])
|
|
86
86
|
}, null, 8, ["class"])),
|
|
87
|
-
|
|
88
|
-
gn(
|
|
89
|
-
|
|
87
|
+
Y("span", Wn, [
|
|
88
|
+
gn(Du(r.value.text) + " ", 1),
|
|
89
|
+
Y("span", Zn, Du(e.name), 1)
|
|
90
90
|
])
|
|
91
91
|
]),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class:
|
|
92
|
+
Y("div", Vn, [
|
|
93
|
+
Ct(l0(wn), {
|
|
94
|
+
class: Cu(["expand-icon", { "-rotate-90": !t.value }]),
|
|
95
95
|
onClick: a[0] || (a[0] = (s) => t.value = !t.value)
|
|
96
96
|
}, null, 8, ["class"])
|
|
97
97
|
])
|
|
98
98
|
]),
|
|
99
|
-
t.value ? (
|
|
100
|
-
a[1] || (a[1] =
|
|
101
|
-
|
|
99
|
+
t.value ? (v(), W("div", Yn, [
|
|
100
|
+
a[1] || (a[1] = Y("hr", { class: "tr-bubble__step-tool-hr" }, null, -1)),
|
|
101
|
+
Y("div", {
|
|
102
102
|
class: "tr-bubble__step-tool-params-content",
|
|
103
103
|
innerHTML: i(e.content)
|
|
104
104
|
}, null, 8, Xn)
|
|
105
|
-
])) :
|
|
105
|
+
])) : Qu("", !0)
|
|
106
106
|
]));
|
|
107
107
|
}
|
|
108
108
|
}), Qn = "_key_1b448_2", Kn = "_number_1b448_6", ur = "_string_1b448_10", er = "_boolean_1b448_14", tr = {
|
|
@@ -113,61 +113,61 @@ const Ln = { class: "tr-bubble__step-text" }, On = { class: "tr-bubble__step-tex
|
|
|
113
113
|
null: "_null_1b448_18"
|
|
114
114
|
}, nr = {
|
|
115
115
|
$style: tr
|
|
116
|
-
}, rr = /* @__PURE__ */ ce(Jn, [["__cssModules", nr], ["__scopeId", "data-v-1c37a4c4"]]),
|
|
116
|
+
}, rr = /* @__PURE__ */ ce(Jn, [["__cssModules", nr], ["__scopeId", "data-v-1c37a4c4"]]), cr = rr, yt = /* @__PURE__ */ new Map([
|
|
117
117
|
["text", d0],
|
|
118
|
-
["tool",
|
|
118
|
+
["tool", cr],
|
|
119
119
|
["collapsible-text", zn]
|
|
120
|
-
]), Ft = Symbol("bubbleContentRendererMap"), Tt = Symbol("bubbleContentFallbackRenderer"),
|
|
120
|
+
]), Ft = Symbol("bubbleContentRendererMap"), Tt = Symbol("bubbleContentFallbackRenderer"), or = /* @__PURE__ */ Fu({
|
|
121
121
|
__name: "ContentItem",
|
|
122
122
|
props: {
|
|
123
123
|
item: {}
|
|
124
124
|
},
|
|
125
125
|
setup(u) {
|
|
126
|
-
const e =
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
return (i,
|
|
126
|
+
const e = G0(Ft, yt), t = G0(Tt, d0), n = u, r = (i) => {
|
|
127
|
+
const o = e.get(i) || t;
|
|
128
|
+
if (typeof o == "function") {
|
|
129
|
+
const a = o;
|
|
130
|
+
return xu(() => a(n.item));
|
|
131
|
+
}
|
|
132
|
+
return o instanceof f0 ? xu(() => o.render(n.item)) : xu(o, n.item);
|
|
133
|
+
}, c = X(() => r(n.item.type));
|
|
134
|
+
return (i, o) => (v(), hu(Pu(c.value)));
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
|
-
/*! @license DOMPurify 3.3.
|
|
137
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
138
138
|
const {
|
|
139
139
|
entries: St,
|
|
140
|
-
setPrototypeOf:
|
|
140
|
+
setPrototypeOf: J0,
|
|
141
141
|
isFrozen: ir,
|
|
142
142
|
getPrototypeOf: ar,
|
|
143
143
|
getOwnPropertyDescriptor: sr
|
|
144
144
|
} = Object;
|
|
145
145
|
let {
|
|
146
|
-
freeze:
|
|
146
|
+
freeze: $,
|
|
147
147
|
seal: Q,
|
|
148
148
|
create: n0
|
|
149
149
|
} = Object, {
|
|
150
150
|
apply: r0,
|
|
151
|
-
construct:
|
|
151
|
+
construct: c0
|
|
152
152
|
} = typeof Reflect < "u" && Reflect;
|
|
153
|
-
|
|
153
|
+
$ || ($ = function(e) {
|
|
154
154
|
return e;
|
|
155
155
|
});
|
|
156
156
|
Q || (Q = function(e) {
|
|
157
157
|
return e;
|
|
158
158
|
});
|
|
159
159
|
r0 || (r0 = function(e, t) {
|
|
160
|
-
for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0),
|
|
161
|
-
r[
|
|
160
|
+
for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), c = 2; c < n; c++)
|
|
161
|
+
r[c - 2] = arguments[c];
|
|
162
162
|
return e.apply(t, r);
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
c0 || (c0 = function(e) {
|
|
165
165
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
|
|
166
166
|
n[r - 1] = arguments[r];
|
|
167
167
|
return new e(...n);
|
|
168
168
|
});
|
|
169
|
-
const _e =
|
|
170
|
-
function
|
|
169
|
+
const _e = j(Array.prototype.forEach), lr = j(Array.prototype.lastIndexOf), Q0 = j(Array.prototype.pop), Zu = j(Array.prototype.push), fr = j(Array.prototype.splice), Ae = j(String.prototype.toLowerCase), je = j(String.prototype.toString), Ge = j(String.prototype.match), Vu = j(String.prototype.replace), dr = j(String.prototype.indexOf), hr = j(String.prototype.trim), uu = j(Object.prototype.hasOwnProperty), H = j(RegExp.prototype.test), Yu = br(TypeError);
|
|
170
|
+
function j(u) {
|
|
171
171
|
return function(e) {
|
|
172
172
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
173
173
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
|
|
@@ -175,36 +175,36 @@ function G(u) {
|
|
|
175
175
|
return r0(u, e, n);
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function br(u) {
|
|
179
179
|
return function() {
|
|
180
180
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
181
181
|
t[n] = arguments[n];
|
|
182
|
-
return
|
|
182
|
+
return c0(u, t);
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function D(u, e) {
|
|
186
186
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ae;
|
|
187
|
-
|
|
187
|
+
J0 && J0(u, null);
|
|
188
188
|
let n = e.length;
|
|
189
189
|
for (; n--; ) {
|
|
190
190
|
let r = e[n];
|
|
191
191
|
if (typeof r == "string") {
|
|
192
|
-
const
|
|
193
|
-
|
|
192
|
+
const c = t(r);
|
|
193
|
+
c !== r && (ir(e) || (e[n] = c), r = c);
|
|
194
194
|
}
|
|
195
195
|
u[r] = !0;
|
|
196
196
|
}
|
|
197
197
|
return u;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function pr(u) {
|
|
200
200
|
for (let e = 0; e < u.length; e++)
|
|
201
201
|
uu(u, e) || (u[e] = null);
|
|
202
202
|
return u;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function cu(u) {
|
|
205
205
|
const e = n0(null);
|
|
206
206
|
for (const [t, n] of St(u))
|
|
207
|
-
uu(u, t) && (Array.isArray(n) ? e[t] =
|
|
207
|
+
uu(u, t) && (Array.isArray(n) ? e[t] = pr(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = cu(n) : e[t] = n);
|
|
208
208
|
return e;
|
|
209
209
|
}
|
|
210
210
|
function Xu(u, e) {
|
|
@@ -212,9 +212,9 @@ function Xu(u, e) {
|
|
|
212
212
|
const n = sr(u, e);
|
|
213
213
|
if (n) {
|
|
214
214
|
if (n.get)
|
|
215
|
-
return
|
|
215
|
+
return j(n.get);
|
|
216
216
|
if (typeof n.value == "function")
|
|
217
|
-
return
|
|
217
|
+
return j(n.value);
|
|
218
218
|
}
|
|
219
219
|
u = ar(u);
|
|
220
220
|
}
|
|
@@ -223,14 +223,14 @@ function Xu(u, e) {
|
|
|
223
223
|
}
|
|
224
224
|
return t;
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const K0 = $(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), We = $(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ze = $(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), _r = $(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Ve = $(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), mr = $(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ut = $(["#text"]), et = $(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Ye = $(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), tt = $(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), me = $(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), xr = Q(/\{\{[\w\W]*|[\w\W]*\}\}/gm), gr = Q(/<%[\w\W]*|[\w\W]*%>/gm), kr = Q(/\$\{[\w\W]*/gm), Er = Q(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ar = Q(/^aria-[\-\w]+$/), wt = Q(
|
|
227
227
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
228
228
|
// eslint-disable-line no-useless-escape
|
|
229
229
|
), Cr = Q(/^(?:\w+script|data):/i), Dr = Q(
|
|
230
230
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
231
231
|
// eslint-disable-line no-control-regex
|
|
232
232
|
), vt = Q(/^html$/i), yr = Q(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
233
|
-
var
|
|
233
|
+
var nt = /* @__PURE__ */ Object.freeze({
|
|
234
234
|
__proto__: null,
|
|
235
235
|
ARIA_ATTR: Ar,
|
|
236
236
|
ATTR_WHITESPACE: Dr,
|
|
@@ -258,9 +258,9 @@ const Ju = {
|
|
|
258
258
|
let n = null;
|
|
259
259
|
const r = "data-tt-policy-suffix";
|
|
260
260
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
261
|
-
const
|
|
261
|
+
const c = "dompurify" + (n ? "#" + n : "");
|
|
262
262
|
try {
|
|
263
|
-
return e.createPolicy(
|
|
263
|
+
return e.createPolicy(c, {
|
|
264
264
|
createHTML(i) {
|
|
265
265
|
return i;
|
|
266
266
|
},
|
|
@@ -269,9 +269,9 @@ const Ju = {
|
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
} catch {
|
|
272
|
-
return console.warn("TrustedTypes policy " +
|
|
272
|
+
return console.warn("TrustedTypes policy " + c + " could not be created."), null;
|
|
273
273
|
}
|
|
274
|
-
},
|
|
274
|
+
}, rt = function() {
|
|
275
275
|
return {
|
|
276
276
|
afterSanitizeAttributes: [],
|
|
277
277
|
afterSanitizeElements: [],
|
|
@@ -287,53 +287,53 @@ const Ju = {
|
|
|
287
287
|
function Rt() {
|
|
288
288
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Fr();
|
|
289
289
|
const e = (g) => Rt(g);
|
|
290
|
-
if (e.version = "3.3.
|
|
290
|
+
if (e.version = "3.3.1", e.removed = [], !u || !u.document || u.document.nodeType !== Ju.document || !u.Element)
|
|
291
291
|
return e.isSupported = !1, e;
|
|
292
292
|
let {
|
|
293
293
|
document: t
|
|
294
294
|
} = u;
|
|
295
295
|
const n = t, r = n.currentScript, {
|
|
296
|
-
DocumentFragment:
|
|
296
|
+
DocumentFragment: c,
|
|
297
297
|
HTMLTemplateElement: i,
|
|
298
|
-
Node:
|
|
298
|
+
Node: o,
|
|
299
299
|
Element: a,
|
|
300
300
|
NodeFilter: s,
|
|
301
|
-
NamedNodeMap:
|
|
302
|
-
HTMLFormElement:
|
|
303
|
-
DOMParser:
|
|
304
|
-
trustedTypes:
|
|
305
|
-
} = u,
|
|
301
|
+
NamedNodeMap: f = u.NamedNodeMap || u.MozNamedAttrMap,
|
|
302
|
+
HTMLFormElement: d,
|
|
303
|
+
DOMParser: _,
|
|
304
|
+
trustedTypes: b
|
|
305
|
+
} = u, h = a.prototype, C = Xu(h, "cloneNode"), y = Xu(h, "remove"), T = Xu(h, "nextSibling"), E = Xu(h, "childNodes"), k = Xu(h, "parentNode");
|
|
306
306
|
if (typeof i == "function") {
|
|
307
307
|
const g = t.createElement("template");
|
|
308
308
|
g.content && g.content.ownerDocument && (t = g.content.ownerDocument);
|
|
309
309
|
}
|
|
310
|
-
let
|
|
310
|
+
let m, A = "";
|
|
311
311
|
const {
|
|
312
|
-
implementation:
|
|
312
|
+
implementation: F,
|
|
313
313
|
createNodeIterator: M,
|
|
314
|
-
createDocumentFragment:
|
|
315
|
-
getElementsByTagName:
|
|
314
|
+
createDocumentFragment: V,
|
|
315
|
+
getElementsByTagName: tu
|
|
316
316
|
} = t, {
|
|
317
|
-
importNode:
|
|
317
|
+
importNode: ku
|
|
318
318
|
} = n;
|
|
319
|
-
let L =
|
|
320
|
-
e.isSupported = typeof St == "function" && typeof k == "function" &&
|
|
319
|
+
let L = rt();
|
|
320
|
+
e.isSupported = typeof St == "function" && typeof k == "function" && F && F.createHTMLDocument !== void 0;
|
|
321
321
|
const {
|
|
322
322
|
MUSTACHE_EXPR: Hu,
|
|
323
323
|
ERB_EXPR: $u,
|
|
324
|
-
TMPLIT_EXPR:
|
|
325
|
-
DATA_ATTR:
|
|
326
|
-
ARIA_ATTR:
|
|
324
|
+
TMPLIT_EXPR: Tu,
|
|
325
|
+
DATA_ATTR: bu,
|
|
326
|
+
ARIA_ATTR: ve,
|
|
327
327
|
IS_SCRIPT_OR_DATA: nn,
|
|
328
328
|
ATTR_WHITESPACE: E0,
|
|
329
329
|
CUSTOM_ELEMENT: rn
|
|
330
|
-
} =
|
|
330
|
+
} = nt;
|
|
331
331
|
let {
|
|
332
332
|
IS_ALLOWED_URI: A0
|
|
333
|
-
} =
|
|
334
|
-
const C0 =
|
|
333
|
+
} = nt, N = null;
|
|
334
|
+
const C0 = D({}, [...K0, ...We, ...Ze, ...Ve, ...ut]);
|
|
335
335
|
let z = null;
|
|
336
|
-
const D0 =
|
|
336
|
+
const D0 = D({}, [...et, ...Ye, ...tt, ...me]);
|
|
337
337
|
let R = Object.seal(n0(null, {
|
|
338
338
|
tagNameCheck: {
|
|
339
339
|
writable: !0,
|
|
@@ -353,8 +353,8 @@ function Rt() {
|
|
|
353
353
|
enumerable: !0,
|
|
354
354
|
value: !1
|
|
355
355
|
}
|
|
356
|
-
})), ju = null,
|
|
357
|
-
const
|
|
356
|
+
})), ju = null, Re = null;
|
|
357
|
+
const Su = Object.seal(n0(null, {
|
|
358
358
|
tagCheck: {
|
|
359
359
|
writable: !0,
|
|
360
360
|
configurable: !1,
|
|
@@ -368,45 +368,45 @@ function Rt() {
|
|
|
368
368
|
value: null
|
|
369
369
|
}
|
|
370
370
|
}));
|
|
371
|
-
let y0 = !0,
|
|
372
|
-
const
|
|
373
|
-
let
|
|
374
|
-
const
|
|
375
|
-
let
|
|
376
|
-
const
|
|
371
|
+
let y0 = !0, Ie = !0, F0 = !1, T0 = !0, wu = !1, se = !0, Eu = !1, Me = !1, Le = !1, vu = !1, le = !1, fe = !1, S0 = !0, w0 = !1;
|
|
372
|
+
const cn = "user-content-";
|
|
373
|
+
let Oe = !0, Gu = !1, Ru = {}, nu = null;
|
|
374
|
+
const Ne = D({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
375
|
+
let v0 = null;
|
|
376
|
+
const R0 = D({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
377
377
|
let Be = null;
|
|
378
|
-
const
|
|
379
|
-
let Iu =
|
|
380
|
-
const
|
|
381
|
-
let be =
|
|
382
|
-
const an =
|
|
378
|
+
const I0 = D({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), de = "http://www.w3.org/1998/Math/MathML", he = "http://www.w3.org/2000/svg", lu = "http://www.w3.org/1999/xhtml";
|
|
379
|
+
let Iu = lu, Pe = !1, ze = null;
|
|
380
|
+
const on = D({}, [de, he, lu], je);
|
|
381
|
+
let be = D({}, ["mi", "mo", "mn", "ms", "mtext"]), pe = D({}, ["annotation-xml"]);
|
|
382
|
+
const an = D({}, ["title", "style", "font", "a", "script"]);
|
|
383
383
|
let Wu = null;
|
|
384
384
|
const sn = ["application/xhtml+xml", "text/html"], ln = "text/html";
|
|
385
|
-
let
|
|
386
|
-
const fn = t.createElement("form"),
|
|
385
|
+
let O = null, Mu = null;
|
|
386
|
+
const fn = t.createElement("form"), M0 = function(l) {
|
|
387
387
|
return l instanceof RegExp || l instanceof Function;
|
|
388
|
-
},
|
|
388
|
+
}, qe = function() {
|
|
389
389
|
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
390
390
|
if (!(Mu && Mu === l)) {
|
|
391
|
-
if ((!l || typeof l != "object") && (l = {}), l =
|
|
392
|
-
sn.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? ln : l.PARSER_MEDIA_TYPE,
|
|
391
|
+
if ((!l || typeof l != "object") && (l = {}), l = cu(l), Wu = // eslint-disable-next-line unicorn/prefer-includes
|
|
392
|
+
sn.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? ln : l.PARSER_MEDIA_TYPE, O = Wu === "application/xhtml+xml" ? je : Ae, N = uu(l, "ALLOWED_TAGS") ? D({}, l.ALLOWED_TAGS, O) : C0, z = uu(l, "ALLOWED_ATTR") ? D({}, l.ALLOWED_ATTR, O) : D0, ze = uu(l, "ALLOWED_NAMESPACES") ? D({}, l.ALLOWED_NAMESPACES, je) : on, Be = uu(l, "ADD_URI_SAFE_ATTR") ? D(cu(I0), l.ADD_URI_SAFE_ATTR, O) : I0, v0 = uu(l, "ADD_DATA_URI_TAGS") ? D(cu(R0), l.ADD_DATA_URI_TAGS, O) : R0, nu = uu(l, "FORBID_CONTENTS") ? D({}, l.FORBID_CONTENTS, O) : Ne, ju = uu(l, "FORBID_TAGS") ? D({}, l.FORBID_TAGS, O) : cu({}), Re = uu(l, "FORBID_ATTR") ? D({}, l.FORBID_ATTR, O) : cu({}), Ru = uu(l, "USE_PROFILES") ? l.USE_PROFILES : !1, y0 = l.ALLOW_ARIA_ATTR !== !1, Ie = l.ALLOW_DATA_ATTR !== !1, F0 = l.ALLOW_UNKNOWN_PROTOCOLS || !1, T0 = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, wu = l.SAFE_FOR_TEMPLATES || !1, se = l.SAFE_FOR_XML !== !1, Eu = l.WHOLE_DOCUMENT || !1, vu = l.RETURN_DOM || !1, le = l.RETURN_DOM_FRAGMENT || !1, fe = l.RETURN_TRUSTED_TYPE || !1, Le = l.FORCE_BODY || !1, S0 = l.SANITIZE_DOM !== !1, w0 = l.SANITIZE_NAMED_PROPS || !1, Oe = l.KEEP_CONTENT !== !1, Gu = l.IN_PLACE || !1, A0 = l.ALLOWED_URI_REGEXP || wt, Iu = l.NAMESPACE || lu, be = l.MATHML_TEXT_INTEGRATION_POINTS || be, pe = l.HTML_INTEGRATION_POINTS || pe, R = l.CUSTOM_ELEMENT_HANDLING || {}, l.CUSTOM_ELEMENT_HANDLING && M0(l.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = l.CUSTOM_ELEMENT_HANDLING.tagNameCheck), l.CUSTOM_ELEMENT_HANDLING && M0(l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = l.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), l.CUSTOM_ELEMENT_HANDLING && typeof l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = l.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), wu && (Ie = !1), le && (vu = !0), Ru && (N = D({}, ut), z = [], Ru.html === !0 && (D(N, K0), D(z, et)), Ru.svg === !0 && (D(N, We), D(z, Ye), D(z, me)), Ru.svgFilters === !0 && (D(N, Ze), D(z, Ye), D(z, me)), Ru.mathMl === !0 && (D(N, Ve), D(z, tt), D(z, me))), l.ADD_TAGS && (typeof l.ADD_TAGS == "function" ? Su.tagCheck = l.ADD_TAGS : (N === C0 && (N = cu(N)), D(N, l.ADD_TAGS, O))), l.ADD_ATTR && (typeof l.ADD_ATTR == "function" ? Su.attributeCheck = l.ADD_ATTR : (z === D0 && (z = cu(z)), D(z, l.ADD_ATTR, O))), l.ADD_URI_SAFE_ATTR && D(Be, l.ADD_URI_SAFE_ATTR, O), l.FORBID_CONTENTS && (nu === Ne && (nu = cu(nu)), D(nu, l.FORBID_CONTENTS, O)), l.ADD_FORBID_CONTENTS && (nu === Ne && (nu = cu(nu)), D(nu, l.ADD_FORBID_CONTENTS, O)), Oe && (N["#text"] = !0), Eu && D(N, ["html", "head", "body"]), N.table && (D(N, ["tbody"]), delete ju.tbody), l.TRUSTED_TYPES_POLICY) {
|
|
393
393
|
if (typeof l.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
394
394
|
throw Yu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
395
395
|
if (typeof l.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
396
396
|
throw Yu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
397
|
-
|
|
397
|
+
m = l.TRUSTED_TYPES_POLICY, A = m.createHTML("");
|
|
398
398
|
} else
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
m === void 0 && (m = Tr(b, r)), m !== null && typeof A == "string" && (A = m.createHTML(""));
|
|
400
|
+
$ && $(l), Mu = l;
|
|
401
401
|
}
|
|
402
|
-
},
|
|
403
|
-
let
|
|
404
|
-
(!
|
|
402
|
+
}, L0 = D({}, [...We, ...Ze, ..._r]), O0 = D({}, [...Ve, ...mr]), dn = function(l) {
|
|
403
|
+
let p = k(l);
|
|
404
|
+
(!p || !p.tagName) && (p = {
|
|
405
405
|
namespaceURI: Iu,
|
|
406
406
|
tagName: "template"
|
|
407
407
|
});
|
|
408
|
-
const x = Ae(l.tagName),
|
|
409
|
-
return
|
|
408
|
+
const x = Ae(l.tagName), w = Ae(p.tagName);
|
|
409
|
+
return ze[l.namespaceURI] ? l.namespaceURI === he ? p.namespaceURI === lu ? x === "svg" : p.namespaceURI === de ? x === "svg" && (w === "annotation-xml" || be[w]) : !!L0[x] : l.namespaceURI === de ? p.namespaceURI === lu ? x === "math" : p.namespaceURI === he ? x === "math" && pe[w] : !!O0[x] : l.namespaceURI === lu ? p.namespaceURI === he && !pe[w] || p.namespaceURI === de && !be[w] ? !1 : !O0[x] && (an[x] || !L0[x]) : !!(Wu === "application/xhtml+xml" && ze[l.namespaceURI]) : !1;
|
|
410
410
|
}, ru = function(l) {
|
|
411
411
|
Zu(e.removed, {
|
|
412
412
|
element: l
|
|
@@ -414,55 +414,55 @@ function Rt() {
|
|
|
414
414
|
try {
|
|
415
415
|
k(l).removeChild(l);
|
|
416
416
|
} catch {
|
|
417
|
-
|
|
417
|
+
y(l);
|
|
418
418
|
}
|
|
419
|
-
},
|
|
419
|
+
}, Au = function(l, p) {
|
|
420
420
|
try {
|
|
421
421
|
Zu(e.removed, {
|
|
422
|
-
attribute:
|
|
423
|
-
from:
|
|
422
|
+
attribute: p.getAttributeNode(l),
|
|
423
|
+
from: p
|
|
424
424
|
});
|
|
425
425
|
} catch {
|
|
426
426
|
Zu(e.removed, {
|
|
427
427
|
attribute: null,
|
|
428
|
-
from:
|
|
428
|
+
from: p
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
|
-
if (
|
|
432
|
-
if (
|
|
431
|
+
if (p.removeAttribute(l), l === "is")
|
|
432
|
+
if (vu || le)
|
|
433
433
|
try {
|
|
434
|
-
ru(
|
|
434
|
+
ru(p);
|
|
435
435
|
} catch {
|
|
436
436
|
}
|
|
437
437
|
else
|
|
438
438
|
try {
|
|
439
|
-
|
|
439
|
+
p.setAttribute(l, "");
|
|
440
440
|
} catch {
|
|
441
441
|
}
|
|
442
|
-
},
|
|
443
|
-
let
|
|
444
|
-
if (
|
|
442
|
+
}, N0 = function(l) {
|
|
443
|
+
let p = null, x = null;
|
|
444
|
+
if (Le)
|
|
445
445
|
l = "<remove></remove>" + l;
|
|
446
446
|
else {
|
|
447
447
|
const I = Ge(l, /^[\r\n\t ]+/);
|
|
448
448
|
x = I && I[0];
|
|
449
449
|
}
|
|
450
|
-
Wu === "application/xhtml+xml" && Iu ===
|
|
451
|
-
const
|
|
452
|
-
if (Iu ===
|
|
450
|
+
Wu === "application/xhtml+xml" && Iu === lu && (l = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + l + "</body></html>");
|
|
451
|
+
const w = m ? m.createHTML(l) : l;
|
|
452
|
+
if (Iu === lu)
|
|
453
453
|
try {
|
|
454
|
-
|
|
454
|
+
p = new _().parseFromString(w, Wu);
|
|
455
455
|
} catch {
|
|
456
456
|
}
|
|
457
|
-
if (!
|
|
458
|
-
|
|
457
|
+
if (!p || !p.documentElement) {
|
|
458
|
+
p = F.createDocument(Iu, "template", null);
|
|
459
459
|
try {
|
|
460
|
-
|
|
460
|
+
p.documentElement.innerHTML = Pe ? A : w;
|
|
461
461
|
} catch {
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const U =
|
|
465
|
-
return l && x && U.insertBefore(t.createTextNode(x), U.childNodes[0] || null), Iu ===
|
|
464
|
+
const U = p.body || p.documentElement;
|
|
465
|
+
return l && x && U.insertBefore(t.createTextNode(x), U.childNodes[0] || null), Iu === lu ? tu.call(p, Eu ? "html" : "body")[0] : Eu ? p.documentElement : U;
|
|
466
466
|
}, B0 = function(l) {
|
|
467
467
|
return M.call(
|
|
468
468
|
l.ownerDocument || l,
|
|
@@ -471,65 +471,65 @@ function Rt() {
|
|
|
471
471
|
s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION,
|
|
472
472
|
null
|
|
473
473
|
);
|
|
474
|
-
},
|
|
475
|
-
return l instanceof
|
|
476
|
-
},
|
|
477
|
-
return typeof
|
|
474
|
+
}, Ue = function(l) {
|
|
475
|
+
return l instanceof d && (typeof l.nodeName != "string" || typeof l.textContent != "string" || typeof l.removeChild != "function" || !(l.attributes instanceof f) || typeof l.removeAttribute != "function" || typeof l.setAttribute != "function" || typeof l.namespaceURI != "string" || typeof l.insertBefore != "function" || typeof l.hasChildNodes != "function");
|
|
476
|
+
}, P0 = function(l) {
|
|
477
|
+
return typeof o == "function" && l instanceof o;
|
|
478
478
|
};
|
|
479
|
-
function
|
|
479
|
+
function fu(g, l, p) {
|
|
480
480
|
_e(g, (x) => {
|
|
481
|
-
x.call(e, l,
|
|
481
|
+
x.call(e, l, p, Mu);
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
const
|
|
485
|
-
let
|
|
486
|
-
if (
|
|
484
|
+
const z0 = function(l) {
|
|
485
|
+
let p = null;
|
|
486
|
+
if (fu(L.beforeSanitizeElements, l, null), Ue(l))
|
|
487
487
|
return ru(l), !0;
|
|
488
|
-
const x =
|
|
489
|
-
if (
|
|
488
|
+
const x = O(l.nodeName);
|
|
489
|
+
if (fu(L.uponSanitizeElement, l, {
|
|
490
490
|
tagName: x,
|
|
491
|
-
allowedTags:
|
|
492
|
-
}),
|
|
491
|
+
allowedTags: N
|
|
492
|
+
}), se && l.hasChildNodes() && !P0(l.firstElementChild) && H(/<[/\w!]/g, l.innerHTML) && H(/<[/\w!]/g, l.textContent) || l.nodeType === Ju.progressingInstruction || se && l.nodeType === Ju.comment && H(/<[/\w]/g, l.data))
|
|
493
493
|
return ru(l), !0;
|
|
494
|
-
if (!(
|
|
495
|
-
if (!ju[x] &&
|
|
494
|
+
if (!(Su.tagCheck instanceof Function && Su.tagCheck(x)) && (!N[x] || ju[x])) {
|
|
495
|
+
if (!ju[x] && U0(x) && (R.tagNameCheck instanceof RegExp && H(R.tagNameCheck, x) || R.tagNameCheck instanceof Function && R.tagNameCheck(x)))
|
|
496
496
|
return !1;
|
|
497
|
-
if (
|
|
498
|
-
const
|
|
499
|
-
if (U &&
|
|
497
|
+
if (Oe && !nu[x]) {
|
|
498
|
+
const w = k(l) || l.parentNode, U = E(l) || l.childNodes;
|
|
499
|
+
if (U && w) {
|
|
500
500
|
const I = U.length;
|
|
501
|
-
for (let
|
|
502
|
-
const
|
|
503
|
-
|
|
501
|
+
for (let G = I - 1; G >= 0; --G) {
|
|
502
|
+
const du = C(U[G], !0);
|
|
503
|
+
du.__removalCount = (l.__removalCount || 0) + 1, w.insertBefore(du, T(l));
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
return ru(l), !0;
|
|
508
508
|
}
|
|
509
|
-
return l instanceof a && !dn(l) || (x === "noscript" || x === "noembed" || x === "noframes") &&
|
|
510
|
-
|
|
511
|
-
}), l.textContent !==
|
|
509
|
+
return l instanceof a && !dn(l) || (x === "noscript" || x === "noembed" || x === "noframes") && H(/<\/no(script|embed|frames)/i, l.innerHTML) ? (ru(l), !0) : (wu && l.nodeType === Ju.text && (p = l.textContent, _e([Hu, $u, Tu], (w) => {
|
|
510
|
+
p = Vu(p, w, " ");
|
|
511
|
+
}), l.textContent !== p && (Zu(e.removed, {
|
|
512
512
|
element: l.cloneNode()
|
|
513
|
-
}), l.textContent =
|
|
514
|
-
},
|
|
515
|
-
if (S0 && (
|
|
513
|
+
}), l.textContent = p)), fu(L.afterSanitizeElements, l, null), !1);
|
|
514
|
+
}, q0 = function(l, p, x) {
|
|
515
|
+
if (S0 && (p === "id" || p === "name") && (x in t || x in fn))
|
|
516
516
|
return !1;
|
|
517
|
-
if (!(
|
|
518
|
-
if (!(y0 &&
|
|
519
|
-
if (!(
|
|
520
|
-
if (!z[
|
|
517
|
+
if (!(Ie && !Re[p] && H(bu, p))) {
|
|
518
|
+
if (!(y0 && H(ve, p))) {
|
|
519
|
+
if (!(Su.attributeCheck instanceof Function && Su.attributeCheck(p, l))) {
|
|
520
|
+
if (!z[p] || Re[p]) {
|
|
521
521
|
if (
|
|
522
522
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
523
523
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
524
524
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
525
|
-
!(
|
|
525
|
+
!(U0(l) && (R.tagNameCheck instanceof RegExp && H(R.tagNameCheck, l) || R.tagNameCheck instanceof Function && R.tagNameCheck(l)) && (R.attributeNameCheck instanceof RegExp && H(R.attributeNameCheck, p) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(p, l)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
526
526
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
527
|
-
|
|
527
|
+
p === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && H(R.tagNameCheck, x) || R.tagNameCheck instanceof Function && R.tagNameCheck(x)))
|
|
528
528
|
) return !1;
|
|
529
|
-
} else if (!Be[
|
|
530
|
-
if (
|
|
531
|
-
if (!((
|
|
532
|
-
if (!(F0 &&
|
|
529
|
+
} else if (!Be[p]) {
|
|
530
|
+
if (!H(A0, Vu(x, E0, ""))) {
|
|
531
|
+
if (!((p === "src" || p === "xlink:href" || p === "href") && l !== "script" && dr(x, "data:") === 0 && v0[l])) {
|
|
532
|
+
if (!(F0 && !H(nn, Vu(x, E0, "")))) {
|
|
533
533
|
if (x)
|
|
534
534
|
return !1;
|
|
535
535
|
}
|
|
@@ -540,14 +540,14 @@ function Rt() {
|
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
return !0;
|
|
543
|
-
},
|
|
543
|
+
}, U0 = function(l) {
|
|
544
544
|
return l !== "annotation-xml" && Ge(l, rn);
|
|
545
|
-
},
|
|
546
|
-
|
|
545
|
+
}, H0 = function(l) {
|
|
546
|
+
fu(L.beforeSanitizeAttributes, l, null);
|
|
547
547
|
const {
|
|
548
|
-
attributes:
|
|
548
|
+
attributes: p
|
|
549
549
|
} = l;
|
|
550
|
-
if (!
|
|
550
|
+
if (!p || Ue(l))
|
|
551
551
|
return;
|
|
552
552
|
const x = {
|
|
553
553
|
attrName: "",
|
|
@@ -556,69 +556,69 @@ function Rt() {
|
|
|
556
556
|
allowedAttributes: z,
|
|
557
557
|
forceKeepAttr: void 0
|
|
558
558
|
};
|
|
559
|
-
let
|
|
560
|
-
for (;
|
|
561
|
-
const U =
|
|
559
|
+
let w = p.length;
|
|
560
|
+
for (; w--; ) {
|
|
561
|
+
const U = p[w], {
|
|
562
562
|
name: I,
|
|
563
|
-
namespaceURI:
|
|
564
|
-
value:
|
|
565
|
-
} = U, Lu =
|
|
566
|
-
let q = I === "value" ?
|
|
567
|
-
if (x.attrName = Lu, x.attrValue = q, x.keepAttr = !0, x.forceKeepAttr = void 0,
|
|
568
|
-
|
|
563
|
+
namespaceURI: G,
|
|
564
|
+
value: du
|
|
565
|
+
} = U, Lu = O(I), He = du;
|
|
566
|
+
let q = I === "value" ? He : hr(He);
|
|
567
|
+
if (x.attrName = Lu, x.attrValue = q, x.keepAttr = !0, x.forceKeepAttr = void 0, fu(L.uponSanitizeAttribute, l, x), q = x.attrValue, w0 && (Lu === "id" || Lu === "name") && (Au(I, l), q = cn + q), se && H(/((--!?|])>)|<\/(style|title|textarea)/i, q)) {
|
|
568
|
+
Au(I, l);
|
|
569
569
|
continue;
|
|
570
570
|
}
|
|
571
571
|
if (Lu === "attributename" && Ge(q, "href")) {
|
|
572
|
-
|
|
572
|
+
Au(I, l);
|
|
573
573
|
continue;
|
|
574
574
|
}
|
|
575
575
|
if (x.forceKeepAttr)
|
|
576
576
|
continue;
|
|
577
577
|
if (!x.keepAttr) {
|
|
578
|
-
|
|
578
|
+
Au(I, l);
|
|
579
579
|
continue;
|
|
580
580
|
}
|
|
581
|
-
if (!T0 &&
|
|
582
|
-
|
|
581
|
+
if (!T0 && H(/\/>/i, q)) {
|
|
582
|
+
Au(I, l);
|
|
583
583
|
continue;
|
|
584
584
|
}
|
|
585
|
-
|
|
586
|
-
q = Vu(q,
|
|
585
|
+
wu && _e([Hu, $u, Tu], (j0) => {
|
|
586
|
+
q = Vu(q, j0, " ");
|
|
587
587
|
});
|
|
588
|
-
const
|
|
589
|
-
if (!
|
|
590
|
-
|
|
588
|
+
const $0 = O(l.nodeName);
|
|
589
|
+
if (!q0($0, Lu, q)) {
|
|
590
|
+
Au(I, l);
|
|
591
591
|
continue;
|
|
592
592
|
}
|
|
593
|
-
if (
|
|
594
|
-
switch (
|
|
593
|
+
if (m && typeof b == "object" && typeof b.getAttributeType == "function" && !G)
|
|
594
|
+
switch (b.getAttributeType($0, Lu)) {
|
|
595
595
|
case "TrustedHTML": {
|
|
596
|
-
q =
|
|
596
|
+
q = m.createHTML(q);
|
|
597
597
|
break;
|
|
598
598
|
}
|
|
599
599
|
case "TrustedScriptURL": {
|
|
600
|
-
q =
|
|
600
|
+
q = m.createScriptURL(q);
|
|
601
601
|
break;
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
-
if (q !==
|
|
604
|
+
if (q !== He)
|
|
605
605
|
try {
|
|
606
|
-
|
|
606
|
+
G ? l.setAttributeNS(G, I, q) : l.setAttribute(I, q), Ue(l) ? ru(l) : Q0(e.removed);
|
|
607
607
|
} catch {
|
|
608
|
-
|
|
608
|
+
Au(I, l);
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
|
|
612
|
-
},
|
|
613
|
-
let
|
|
611
|
+
fu(L.afterSanitizeAttributes, l, null);
|
|
612
|
+
}, hn = function g(l) {
|
|
613
|
+
let p = null;
|
|
614
614
|
const x = B0(l);
|
|
615
|
-
for (
|
|
616
|
-
|
|
617
|
-
|
|
615
|
+
for (fu(L.beforeSanitizeShadowDOM, l, null); p = x.nextNode(); )
|
|
616
|
+
fu(L.uponSanitizeShadowNode, p, null), z0(p), H0(p), p.content instanceof c && g(p.content);
|
|
617
|
+
fu(L.afterSanitizeShadowDOM, l, null);
|
|
618
618
|
};
|
|
619
619
|
return e.sanitize = function(g) {
|
|
620
|
-
let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
621
|
-
if (
|
|
620
|
+
let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, p = null, x = null, w = null, U = null;
|
|
621
|
+
if (Pe = !g, Pe && (g = "<!-->"), typeof g != "string" && !P0(g))
|
|
622
622
|
if (typeof g.toString == "function") {
|
|
623
623
|
if (g = g.toString(), typeof g != "string")
|
|
624
624
|
throw Yu("dirty is not a string, aborting");
|
|
@@ -626,61 +626,61 @@ function Rt() {
|
|
|
626
626
|
throw Yu("toString is not a function");
|
|
627
627
|
if (!e.isSupported)
|
|
628
628
|
return g;
|
|
629
|
-
if (
|
|
629
|
+
if (Me || qe(l), e.removed = [], typeof g == "string" && (Gu = !1), Gu) {
|
|
630
630
|
if (g.nodeName) {
|
|
631
|
-
const
|
|
632
|
-
if (!
|
|
631
|
+
const du = O(g.nodeName);
|
|
632
|
+
if (!N[du] || ju[du])
|
|
633
633
|
throw Yu("root node is forbidden and cannot be sanitized in-place");
|
|
634
634
|
}
|
|
635
|
-
} else if (g instanceof
|
|
636
|
-
|
|
635
|
+
} else if (g instanceof o)
|
|
636
|
+
p = N0("<!---->"), x = p.ownerDocument.importNode(g, !0), x.nodeType === Ju.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? p = x : p.appendChild(x);
|
|
637
637
|
else {
|
|
638
|
-
if (!
|
|
638
|
+
if (!vu && !wu && !Eu && // eslint-disable-next-line unicorn/prefer-includes
|
|
639
639
|
g.indexOf("<") === -1)
|
|
640
|
-
return
|
|
641
|
-
if (
|
|
642
|
-
return
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
const I = B0(Gu ? g :
|
|
646
|
-
for (;
|
|
647
|
-
|
|
640
|
+
return m && fe ? m.createHTML(g) : g;
|
|
641
|
+
if (p = N0(g), !p)
|
|
642
|
+
return vu ? null : fe ? A : "";
|
|
643
|
+
}
|
|
644
|
+
p && Le && ru(p.firstChild);
|
|
645
|
+
const I = B0(Gu ? g : p);
|
|
646
|
+
for (; w = I.nextNode(); )
|
|
647
|
+
z0(w), H0(w), w.content instanceof c && hn(w.content);
|
|
648
648
|
if (Gu)
|
|
649
649
|
return g;
|
|
650
|
-
if (
|
|
651
|
-
if (
|
|
652
|
-
for (U =
|
|
653
|
-
U.appendChild(
|
|
650
|
+
if (vu) {
|
|
651
|
+
if (le)
|
|
652
|
+
for (U = V.call(p.ownerDocument); p.firstChild; )
|
|
653
|
+
U.appendChild(p.firstChild);
|
|
654
654
|
else
|
|
655
|
-
U =
|
|
656
|
-
return (z.shadowroot || z.shadowrootmode) && (U =
|
|
657
|
-
}
|
|
658
|
-
let
|
|
659
|
-
return
|
|
660
|
-
` +
|
|
661
|
-
|
|
662
|
-
}),
|
|
655
|
+
U = p;
|
|
656
|
+
return (z.shadowroot || z.shadowrootmode) && (U = ku.call(n, U, !0)), U;
|
|
657
|
+
}
|
|
658
|
+
let G = Eu ? p.outerHTML : p.innerHTML;
|
|
659
|
+
return Eu && N["!doctype"] && p.ownerDocument && p.ownerDocument.doctype && p.ownerDocument.doctype.name && H(vt, p.ownerDocument.doctype.name) && (G = "<!DOCTYPE " + p.ownerDocument.doctype.name + `>
|
|
660
|
+
` + G), wu && _e([Hu, $u, Tu], (du) => {
|
|
661
|
+
G = Vu(G, du, " ");
|
|
662
|
+
}), m && fe ? m.createHTML(G) : G;
|
|
663
663
|
}, e.setConfig = function() {
|
|
664
664
|
let g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
665
|
-
|
|
665
|
+
qe(g), Me = !0;
|
|
666
666
|
}, e.clearConfig = function() {
|
|
667
|
-
Mu = null,
|
|
668
|
-
}, e.isValidAttribute = function(g, l,
|
|
669
|
-
Mu ||
|
|
670
|
-
const x =
|
|
671
|
-
return
|
|
667
|
+
Mu = null, Me = !1;
|
|
668
|
+
}, e.isValidAttribute = function(g, l, p) {
|
|
669
|
+
Mu || qe({});
|
|
670
|
+
const x = O(g), w = O(l);
|
|
671
|
+
return q0(x, w, p);
|
|
672
672
|
}, e.addHook = function(g, l) {
|
|
673
673
|
typeof l == "function" && Zu(L[g], l);
|
|
674
674
|
}, e.removeHook = function(g, l) {
|
|
675
675
|
if (l !== void 0) {
|
|
676
|
-
const
|
|
677
|
-
return
|
|
676
|
+
const p = lr(L[g], l);
|
|
677
|
+
return p === -1 ? void 0 : fr(L[g], p, 1)[0];
|
|
678
678
|
}
|
|
679
|
-
return
|
|
679
|
+
return Q0(L[g]);
|
|
680
680
|
}, e.removeHooks = function(g) {
|
|
681
681
|
L[g] = [];
|
|
682
682
|
}, e.removeAllHooks = function() {
|
|
683
|
-
L =
|
|
683
|
+
L = rt();
|
|
684
684
|
}, e;
|
|
685
685
|
}
|
|
686
686
|
var Sr = Rt();
|
|
@@ -705,33 +705,33 @@ function zu(u, e) {
|
|
|
705
705
|
const t = wr(e);
|
|
706
706
|
return u.replace(/(%[a-f0-9]{2})+/gi, function(n) {
|
|
707
707
|
let r = "";
|
|
708
|
-
for (let
|
|
709
|
-
const
|
|
710
|
-
if (
|
|
711
|
-
r += t[
|
|
708
|
+
for (let c = 0, i = n.length; c < i; c += 3) {
|
|
709
|
+
const o = parseInt(n.slice(c + 1, c + 3), 16);
|
|
710
|
+
if (o < 128) {
|
|
711
|
+
r += t[o];
|
|
712
712
|
continue;
|
|
713
713
|
}
|
|
714
|
-
if ((
|
|
715
|
-
const a = parseInt(n.slice(
|
|
714
|
+
if ((o & 224) === 192 && c + 3 < i) {
|
|
715
|
+
const a = parseInt(n.slice(c + 4, c + 6), 16);
|
|
716
716
|
if ((a & 192) === 128) {
|
|
717
|
-
const s =
|
|
718
|
-
s < 128 ? r += "��" : r += String.fromCharCode(s),
|
|
717
|
+
const s = o << 6 & 1984 | a & 63;
|
|
718
|
+
s < 128 ? r += "��" : r += String.fromCharCode(s), c += 3;
|
|
719
719
|
continue;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
if ((
|
|
723
|
-
const a = parseInt(n.slice(
|
|
722
|
+
if ((o & 240) === 224 && c + 6 < i) {
|
|
723
|
+
const a = parseInt(n.slice(c + 4, c + 6), 16), s = parseInt(n.slice(c + 7, c + 9), 16);
|
|
724
724
|
if ((a & 192) === 128 && (s & 192) === 128) {
|
|
725
|
-
const
|
|
726
|
-
|
|
725
|
+
const f = o << 12 & 61440 | a << 6 & 4032 | s & 63;
|
|
726
|
+
f < 2048 || f >= 55296 && f <= 57343 ? r += "���" : r += String.fromCharCode(f), c += 6;
|
|
727
727
|
continue;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
if ((
|
|
731
|
-
const a = parseInt(n.slice(
|
|
732
|
-
if ((a & 192) === 128 && (s & 192) === 128 && (
|
|
733
|
-
let
|
|
734
|
-
|
|
730
|
+
if ((o & 248) === 240 && c + 9 < i) {
|
|
731
|
+
const a = parseInt(n.slice(c + 4, c + 6), 16), s = parseInt(n.slice(c + 7, c + 9), 16), f = parseInt(n.slice(c + 10, c + 12), 16);
|
|
732
|
+
if ((a & 192) === 128 && (s & 192) === 128 && (f & 192) === 128) {
|
|
733
|
+
let d = o << 18 & 1835008 | a << 12 & 258048 | s << 6 & 4032 | f & 63;
|
|
734
|
+
d < 65536 || d > 1114111 ? r += "����" : (d -= 65536, r += String.fromCharCode(55296 + (d >> 10), 56320 + (d & 1023))), c += 9;
|
|
735
735
|
continue;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
@@ -742,12 +742,12 @@ function zu(u, e) {
|
|
|
742
742
|
}
|
|
743
743
|
zu.defaultChars = ";/?:@&=+$,#";
|
|
744
744
|
zu.componentChars = "";
|
|
745
|
-
const
|
|
745
|
+
const ot = {};
|
|
746
746
|
function vr(u) {
|
|
747
|
-
let e =
|
|
747
|
+
let e = ot[u];
|
|
748
748
|
if (e)
|
|
749
749
|
return e;
|
|
750
|
-
e =
|
|
750
|
+
e = ot[u] = [];
|
|
751
751
|
for (let t = 0; t < 128; t++) {
|
|
752
752
|
const n = String.fromCharCode(t);
|
|
753
753
|
/^[0-9a-z]$/i.test(n) ? e.push(n) : e.push("%" + ("0" + t.toString(16).toUpperCase()).slice(-2));
|
|
@@ -756,49 +756,49 @@ function vr(u) {
|
|
|
756
756
|
e[u.charCodeAt(t)] = u[t];
|
|
757
757
|
return e;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
typeof e != "string" && (t = e, e =
|
|
759
|
+
function oe(u, e, t) {
|
|
760
|
+
typeof e != "string" && (t = e, e = oe.defaultChars), typeof t > "u" && (t = !0);
|
|
761
761
|
const n = vr(e);
|
|
762
762
|
let r = "";
|
|
763
|
-
for (let
|
|
764
|
-
const
|
|
765
|
-
if (t &&
|
|
766
|
-
r += u.slice(
|
|
763
|
+
for (let c = 0, i = u.length; c < i; c++) {
|
|
764
|
+
const o = u.charCodeAt(c);
|
|
765
|
+
if (t && o === 37 && c + 2 < i && /^[0-9a-f]{2}$/i.test(u.slice(c + 1, c + 3))) {
|
|
766
|
+
r += u.slice(c, c + 3), c += 2;
|
|
767
767
|
continue;
|
|
768
768
|
}
|
|
769
|
-
if (
|
|
770
|
-
r += n[
|
|
769
|
+
if (o < 128) {
|
|
770
|
+
r += n[o];
|
|
771
771
|
continue;
|
|
772
772
|
}
|
|
773
|
-
if (
|
|
774
|
-
if (
|
|
775
|
-
const a = u.charCodeAt(
|
|
773
|
+
if (o >= 55296 && o <= 57343) {
|
|
774
|
+
if (o >= 55296 && o <= 56319 && c + 1 < i) {
|
|
775
|
+
const a = u.charCodeAt(c + 1);
|
|
776
776
|
if (a >= 56320 && a <= 57343) {
|
|
777
|
-
r += encodeURIComponent(u[
|
|
777
|
+
r += encodeURIComponent(u[c] + u[c + 1]), c++;
|
|
778
778
|
continue;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
r += "%EF%BF%BD";
|
|
782
782
|
continue;
|
|
783
783
|
}
|
|
784
|
-
r += encodeURIComponent(u[
|
|
784
|
+
r += encodeURIComponent(u[c]);
|
|
785
785
|
}
|
|
786
786
|
return r;
|
|
787
787
|
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
function
|
|
788
|
+
oe.defaultChars = ";/?:@&=+$,-_.!~*'()#";
|
|
789
|
+
oe.componentChars = "-_.!~*'()";
|
|
790
|
+
function h0(u) {
|
|
791
791
|
let e = "";
|
|
792
792
|
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;
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function Ce() {
|
|
795
795
|
this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
|
|
796
796
|
}
|
|
797
797
|
const Rr = /^([a-z0-9.+-]+:)/i, Ir = /:[0-9]*$/, Mr = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, Lr = ["<", ">", '"', "`", " ", "\r", `
|
|
798
|
-
`, " "], Or = ["{", "}", "|", "\\", "^", "`"].concat(Lr), Nr = ["'"].concat(Or),
|
|
798
|
+
`, " "], Or = ["{", "}", "|", "\\", "^", "`"].concat(Lr), Nr = ["'"].concat(Or), it = ["%", "/", "?", ";", "#"].concat(Nr), at = ["/", "?", "#"], Br = 255, st = /^[+a-z0-9A-Z_-]{0,63}$/, Pr = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, lt = {
|
|
799
799
|
javascript: !0,
|
|
800
800
|
"javascript:": !0
|
|
801
|
-
},
|
|
801
|
+
}, ft = {
|
|
802
802
|
http: !0,
|
|
803
803
|
https: !0,
|
|
804
804
|
ftp: !0,
|
|
@@ -810,70 +810,70 @@ const Rr = /^([a-z0-9.+-]+:)/i, Ir = /:[0-9]*$/, Mr = /^(\/\/?(?!\/)[^\?\s]*)(\?
|
|
|
810
810
|
"gopher:": !0,
|
|
811
811
|
"file:": !0
|
|
812
812
|
};
|
|
813
|
-
function
|
|
814
|
-
if (u && u instanceof
|
|
815
|
-
const t = new
|
|
813
|
+
function b0(u, e) {
|
|
814
|
+
if (u && u instanceof Ce) return u;
|
|
815
|
+
const t = new Ce();
|
|
816
816
|
return t.parse(u, e), t;
|
|
817
817
|
}
|
|
818
|
-
|
|
819
|
-
let t, n, r,
|
|
820
|
-
if (
|
|
821
|
-
const s = Mr.exec(
|
|
818
|
+
Ce.prototype.parse = function(u, e) {
|
|
819
|
+
let t, n, r, c = u;
|
|
820
|
+
if (c = c.trim(), !e && u.split("#").length === 1) {
|
|
821
|
+
const s = Mr.exec(c);
|
|
822
822
|
if (s)
|
|
823
823
|
return this.pathname = s[1], s[2] && (this.search = s[2]), this;
|
|
824
824
|
}
|
|
825
|
-
let i = Rr.exec(
|
|
826
|
-
if (i && (i = i[0], t = i.toLowerCase(), this.protocol = i,
|
|
825
|
+
let i = Rr.exec(c);
|
|
826
|
+
if (i && (i = i[0], t = i.toLowerCase(), this.protocol = i, c = c.substr(i.length)), (e || i || c.match(/^\/\/[^@\/]+@[^@\/]+/)) && (r = c.substr(0, 2) === "//", r && !(i && lt[i]) && (c = c.substr(2), this.slashes = !0)), !lt[i] && (r || i && !ft[i])) {
|
|
827
827
|
let s = -1;
|
|
828
|
-
for (let
|
|
829
|
-
n =
|
|
830
|
-
let
|
|
831
|
-
s === -1 ?
|
|
832
|
-
for (let
|
|
833
|
-
n =
|
|
834
|
-
s === -1 && (s =
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
if (!
|
|
839
|
-
const
|
|
840
|
-
for (let C = 0,
|
|
841
|
-
const T =
|
|
842
|
-
if (T && !T.match(
|
|
828
|
+
for (let h = 0; h < at.length; h++)
|
|
829
|
+
n = c.indexOf(at[h]), n !== -1 && (s === -1 || n < s) && (s = n);
|
|
830
|
+
let f, d;
|
|
831
|
+
s === -1 ? d = c.lastIndexOf("@") : d = c.lastIndexOf("@", s), d !== -1 && (f = c.slice(0, d), c = c.slice(d + 1), this.auth = f), s = -1;
|
|
832
|
+
for (let h = 0; h < it.length; h++)
|
|
833
|
+
n = c.indexOf(it[h]), n !== -1 && (s === -1 || n < s) && (s = n);
|
|
834
|
+
s === -1 && (s = c.length), c[s - 1] === ":" && s--;
|
|
835
|
+
const _ = c.slice(0, s);
|
|
836
|
+
c = c.slice(s), this.parseHost(_), this.hostname = this.hostname || "";
|
|
837
|
+
const b = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
838
|
+
if (!b) {
|
|
839
|
+
const h = this.hostname.split(/\./);
|
|
840
|
+
for (let C = 0, y = h.length; C < y; C++) {
|
|
841
|
+
const T = h[C];
|
|
842
|
+
if (T && !T.match(st)) {
|
|
843
843
|
let E = "";
|
|
844
|
-
for (let k = 0,
|
|
844
|
+
for (let k = 0, m = T.length; k < m; k++)
|
|
845
845
|
T.charCodeAt(k) > 127 ? E += "x" : E += T[k];
|
|
846
|
-
if (!E.match(
|
|
847
|
-
const k =
|
|
848
|
-
A && (k.push(A[1]),
|
|
846
|
+
if (!E.match(st)) {
|
|
847
|
+
const k = h.slice(0, C), m = h.slice(C + 1), A = T.match(Pr);
|
|
848
|
+
A && (k.push(A[1]), m.unshift(A[2])), m.length && (c = m.join(".") + c), this.hostname = k.join(".");
|
|
849
849
|
break;
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
this.hostname.length >
|
|
854
|
+
this.hostname.length > Br && (this.hostname = ""), b && (this.hostname = this.hostname.substr(1, this.hostname.length - 2));
|
|
855
855
|
}
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
-
const a =
|
|
859
|
-
return a !== -1 && (this.search =
|
|
856
|
+
const o = c.indexOf("#");
|
|
857
|
+
o !== -1 && (this.hash = c.substr(o), c = c.slice(0, o));
|
|
858
|
+
const a = c.indexOf("?");
|
|
859
|
+
return a !== -1 && (this.search = c.substr(a), c = c.slice(0, a)), c && (this.pathname = c), ft[t] && this.hostname && !this.pathname && (this.pathname = ""), this;
|
|
860
860
|
};
|
|
861
|
-
|
|
861
|
+
Ce.prototype.parseHost = function(u) {
|
|
862
862
|
let e = Ir.exec(u);
|
|
863
863
|
e && (e = e[0], e !== ":" && (this.port = e.substr(1)), u = u.substr(0, u.length - e.length)), u && (this.hostname = u);
|
|
864
864
|
};
|
|
865
865
|
const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
866
866
|
__proto__: null,
|
|
867
867
|
decode: zu,
|
|
868
|
-
encode:
|
|
869
|
-
format:
|
|
870
|
-
parse:
|
|
871
|
-
}, Symbol.toStringTag, { value: "Module" })), It = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Mt = /[\0-\x1F\x7F-\x9F]/, qr = /[\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]/,
|
|
868
|
+
encode: oe,
|
|
869
|
+
format: h0,
|
|
870
|
+
parse: b0
|
|
871
|
+
}, Symbol.toStringTag, { value: "Module" })), It = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Mt = /[\0-\x1F\x7F-\x9F]/, qr = /[\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]/, p0 = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/, Lt = /[\$\+<->\^`\|~\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]/, Ot = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
872
872
|
__proto__: null,
|
|
873
873
|
Any: It,
|
|
874
874
|
Cc: Mt,
|
|
875
875
|
Cf: qr,
|
|
876
|
-
P:
|
|
876
|
+
P: p0,
|
|
877
877
|
S: Lt,
|
|
878
878
|
Z: Ot
|
|
879
879
|
}, Symbol.toStringTag, { value: "Module" })), Hr = new Uint16Array(
|
|
@@ -925,42 +925,42 @@ function Wr(u) {
|
|
|
925
925
|
var e;
|
|
926
926
|
return u >= 55296 && u <= 57343 || u > 1114111 ? 65533 : (e = jr.get(u)) !== null && e !== void 0 ? e : u;
|
|
927
927
|
}
|
|
928
|
-
var
|
|
928
|
+
var P;
|
|
929
929
|
(function(u) {
|
|
930
930
|
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";
|
|
931
|
-
})(
|
|
931
|
+
})(P || (P = {}));
|
|
932
932
|
const Zr = 32;
|
|
933
933
|
var mu;
|
|
934
934
|
(function(u) {
|
|
935
935
|
u[u.VALUE_LENGTH = 49152] = "VALUE_LENGTH", u[u.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", u[u.JUMP_TABLE = 127] = "JUMP_TABLE";
|
|
936
936
|
})(mu || (mu = {}));
|
|
937
|
-
function
|
|
938
|
-
return u >=
|
|
937
|
+
function o0(u) {
|
|
938
|
+
return u >= P.ZERO && u <= P.NINE;
|
|
939
939
|
}
|
|
940
940
|
function Vr(u) {
|
|
941
|
-
return u >=
|
|
941
|
+
return u >= P.UPPER_A && u <= P.UPPER_F || u >= P.LOWER_A && u <= P.LOWER_F;
|
|
942
942
|
}
|
|
943
943
|
function Yr(u) {
|
|
944
|
-
return u >=
|
|
944
|
+
return u >= P.UPPER_A && u <= P.UPPER_Z || u >= P.LOWER_A && u <= P.LOWER_Z || o0(u);
|
|
945
945
|
}
|
|
946
946
|
function Xr(u) {
|
|
947
|
-
return u ===
|
|
947
|
+
return u === P.EQUALS || Yr(u);
|
|
948
948
|
}
|
|
949
|
-
var
|
|
949
|
+
var B;
|
|
950
950
|
(function(u) {
|
|
951
951
|
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";
|
|
952
|
-
})(
|
|
953
|
-
var
|
|
952
|
+
})(B || (B = {}));
|
|
953
|
+
var _u;
|
|
954
954
|
(function(u) {
|
|
955
955
|
u[u.Legacy = 0] = "Legacy", u[u.Strict = 1] = "Strict", u[u.Attribute = 2] = "Attribute";
|
|
956
|
-
})(
|
|
956
|
+
})(_u || (_u = {}));
|
|
957
957
|
class Jr {
|
|
958
958
|
constructor(e, t, n) {
|
|
959
|
-
this.decodeTree = e, this.emitCodePoint = t, this.errors = n, this.state =
|
|
959
|
+
this.decodeTree = e, this.emitCodePoint = t, this.errors = n, this.state = B.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = _u.Strict;
|
|
960
960
|
}
|
|
961
961
|
/** Resets the instance to make it reusable. */
|
|
962
962
|
startEntity(e) {
|
|
963
|
-
this.decodeMode = e, this.state =
|
|
963
|
+
this.decodeMode = e, this.state = B.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
|
964
964
|
}
|
|
965
965
|
/**
|
|
966
966
|
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
|
@@ -975,15 +975,15 @@ class Jr {
|
|
|
975
975
|
*/
|
|
976
976
|
write(e, t) {
|
|
977
977
|
switch (this.state) {
|
|
978
|
-
case
|
|
979
|
-
return e.charCodeAt(t) ===
|
|
980
|
-
case
|
|
978
|
+
case B.EntityStart:
|
|
979
|
+
return e.charCodeAt(t) === P.NUM ? (this.state = B.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1)) : (this.state = B.NamedEntity, this.stateNamedEntity(e, t));
|
|
980
|
+
case B.NumericStart:
|
|
981
981
|
return this.stateNumericStart(e, t);
|
|
982
|
-
case
|
|
982
|
+
case B.NumericDecimal:
|
|
983
983
|
return this.stateNumericDecimal(e, t);
|
|
984
|
-
case
|
|
984
|
+
case B.NumericHex:
|
|
985
985
|
return this.stateNumericHex(e, t);
|
|
986
|
-
case
|
|
986
|
+
case B.NamedEntity:
|
|
987
987
|
return this.stateNamedEntity(e, t);
|
|
988
988
|
}
|
|
989
989
|
}
|
|
@@ -997,12 +997,12 @@ class Jr {
|
|
|
997
997
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
998
998
|
*/
|
|
999
999
|
stateNumericStart(e, t) {
|
|
1000
|
-
return t >= e.length ? -1 : (e.charCodeAt(t) | Zr) ===
|
|
1000
|
+
return t >= e.length ? -1 : (e.charCodeAt(t) | Zr) === P.LOWER_X ? (this.state = B.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = B.NumericDecimal, this.stateNumericDecimal(e, t));
|
|
1001
1001
|
}
|
|
1002
1002
|
addToNumericResult(e, t, n, r) {
|
|
1003
1003
|
if (t !== n) {
|
|
1004
|
-
const
|
|
1005
|
-
this.result = this.result * Math.pow(r,
|
|
1004
|
+
const c = n - t;
|
|
1005
|
+
this.result = this.result * Math.pow(r, c) + parseInt(e.substr(t, c), r), this.consumed += c;
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
/**
|
|
@@ -1018,7 +1018,7 @@ class Jr {
|
|
|
1018
1018
|
const n = t;
|
|
1019
1019
|
for (; t < e.length; ) {
|
|
1020
1020
|
const r = e.charCodeAt(t);
|
|
1021
|
-
if (
|
|
1021
|
+
if (o0(r) || Vr(r))
|
|
1022
1022
|
t += 1;
|
|
1023
1023
|
else
|
|
1024
1024
|
return this.addToNumericResult(e, n, t, 16), this.emitNumericEntity(r, 3);
|
|
@@ -1038,7 +1038,7 @@ class Jr {
|
|
|
1038
1038
|
const n = t;
|
|
1039
1039
|
for (; t < e.length; ) {
|
|
1040
1040
|
const r = e.charCodeAt(t);
|
|
1041
|
-
if (
|
|
1041
|
+
if (o0(r))
|
|
1042
1042
|
t += 1;
|
|
1043
1043
|
else
|
|
1044
1044
|
return this.addToNumericResult(e, n, t, 10), this.emitNumericEntity(r, 2);
|
|
@@ -1062,11 +1062,11 @@ class Jr {
|
|
|
1062
1062
|
var n;
|
|
1063
1063
|
if (this.consumed <= t)
|
|
1064
1064
|
return (n = this.errors) === null || n === void 0 || n.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
1065
|
-
if (e ===
|
|
1065
|
+
if (e === P.SEMI)
|
|
1066
1066
|
this.consumed += 1;
|
|
1067
|
-
else if (this.decodeMode ===
|
|
1067
|
+
else if (this.decodeMode === _u.Strict)
|
|
1068
1068
|
return 0;
|
|
1069
|
-
return this.emitCodePoint(Wr(this.result), this.consumed), this.errors && (e !==
|
|
1069
|
+
return this.emitCodePoint(Wr(this.result), this.consumed), this.errors && (e !== P.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
|
1070
1070
|
}
|
|
1071
1071
|
/**
|
|
1072
1072
|
* Parses a named entity.
|
|
@@ -1079,18 +1079,18 @@ class Jr {
|
|
|
1079
1079
|
*/
|
|
1080
1080
|
stateNamedEntity(e, t) {
|
|
1081
1081
|
const { decodeTree: n } = this;
|
|
1082
|
-
let r = n[this.treeIndex],
|
|
1082
|
+
let r = n[this.treeIndex], c = (r & mu.VALUE_LENGTH) >> 14;
|
|
1083
1083
|
for (; t < e.length; t++, this.excess++) {
|
|
1084
1084
|
const i = e.charCodeAt(t);
|
|
1085
|
-
if (this.treeIndex = Qr(n, r, this.treeIndex + Math.max(1,
|
|
1085
|
+
if (this.treeIndex = Qr(n, r, this.treeIndex + Math.max(1, c), i), this.treeIndex < 0)
|
|
1086
1086
|
return this.result === 0 || // If we are parsing an attribute
|
|
1087
|
-
this.decodeMode ===
|
|
1088
|
-
(
|
|
1087
|
+
this.decodeMode === _u.Attribute && // We shouldn't have consumed any characters after the entity,
|
|
1088
|
+
(c === 0 || // And there should be no invalid characters.
|
|
1089
1089
|
Xr(i)) ? 0 : this.emitNotTerminatedNamedEntity();
|
|
1090
|
-
if (r = n[this.treeIndex],
|
|
1091
|
-
if (i ===
|
|
1092
|
-
return this.emitNamedEntityData(this.treeIndex,
|
|
1093
|
-
this.decodeMode !==
|
|
1090
|
+
if (r = n[this.treeIndex], c = (r & mu.VALUE_LENGTH) >> 14, c !== 0) {
|
|
1091
|
+
if (i === P.SEMI)
|
|
1092
|
+
return this.emitNamedEntityData(this.treeIndex, c, this.consumed + this.excess);
|
|
1093
|
+
this.decodeMode !== _u.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
return -1;
|
|
@@ -1128,15 +1128,15 @@ class Jr {
|
|
|
1128
1128
|
end() {
|
|
1129
1129
|
var e;
|
|
1130
1130
|
switch (this.state) {
|
|
1131
|
-
case
|
|
1132
|
-
return this.result !== 0 && (this.decodeMode !==
|
|
1133
|
-
case
|
|
1131
|
+
case B.NamedEntity:
|
|
1132
|
+
return this.result !== 0 && (this.decodeMode !== _u.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
1133
|
+
case B.NumericDecimal:
|
|
1134
1134
|
return this.emitNumericEntity(0, 2);
|
|
1135
|
-
case
|
|
1135
|
+
case B.NumericHex:
|
|
1136
1136
|
return this.emitNumericEntity(0, 3);
|
|
1137
|
-
case
|
|
1137
|
+
case B.NumericStart:
|
|
1138
1138
|
return (e = this.errors) === null || e === void 0 || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
1139
|
-
case
|
|
1139
|
+
case B.EntityStart:
|
|
1140
1140
|
return 0;
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
@@ -1144,40 +1144,40 @@ class Jr {
|
|
|
1144
1144
|
function Nt(u) {
|
|
1145
1145
|
let e = "";
|
|
1146
1146
|
const t = new Jr(u, (n) => e += Gr(n));
|
|
1147
|
-
return function(r,
|
|
1148
|
-
let i = 0,
|
|
1149
|
-
for (; (
|
|
1150
|
-
e += r.slice(i,
|
|
1147
|
+
return function(r, c) {
|
|
1148
|
+
let i = 0, o = 0;
|
|
1149
|
+
for (; (o = r.indexOf("&", o)) >= 0; ) {
|
|
1150
|
+
e += r.slice(i, o), t.startEntity(c);
|
|
1151
1151
|
const s = t.write(
|
|
1152
1152
|
r,
|
|
1153
1153
|
// Skip the "&"
|
|
1154
|
-
|
|
1154
|
+
o + 1
|
|
1155
1155
|
);
|
|
1156
1156
|
if (s < 0) {
|
|
1157
|
-
i =
|
|
1157
|
+
i = o + t.end();
|
|
1158
1158
|
break;
|
|
1159
1159
|
}
|
|
1160
|
-
i =
|
|
1160
|
+
i = o + s, o = s === 0 ? i + 1 : i;
|
|
1161
1161
|
}
|
|
1162
1162
|
const a = e + r.slice(i);
|
|
1163
1163
|
return e = "", a;
|
|
1164
1164
|
};
|
|
1165
1165
|
}
|
|
1166
1166
|
function Qr(u, e, t, n) {
|
|
1167
|
-
const r = (e & mu.BRANCH_LENGTH) >> 7,
|
|
1167
|
+
const r = (e & mu.BRANCH_LENGTH) >> 7, c = e & mu.JUMP_TABLE;
|
|
1168
1168
|
if (r === 0)
|
|
1169
|
-
return
|
|
1170
|
-
if (
|
|
1171
|
-
const a = n -
|
|
1169
|
+
return c !== 0 && n === c ? t : -1;
|
|
1170
|
+
if (c) {
|
|
1171
|
+
const a = n - c;
|
|
1172
1172
|
return a < 0 || a >= r ? -1 : u[t + a] - 1;
|
|
1173
1173
|
}
|
|
1174
|
-
let i = t,
|
|
1175
|
-
for (; i <=
|
|
1176
|
-
const a = i +
|
|
1174
|
+
let i = t, o = i + r - 1;
|
|
1175
|
+
for (; i <= o; ) {
|
|
1176
|
+
const a = i + o >>> 1, s = u[a];
|
|
1177
1177
|
if (s < n)
|
|
1178
1178
|
i = a + 1;
|
|
1179
1179
|
else if (s > n)
|
|
1180
|
-
|
|
1180
|
+
o = a - 1;
|
|
1181
1181
|
else
|
|
1182
1182
|
return u[a + r];
|
|
1183
1183
|
}
|
|
@@ -1185,20 +1185,20 @@ function Qr(u, e, t, n) {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
const Kr = Nt(Hr);
|
|
1187
1187
|
Nt($r);
|
|
1188
|
-
function
|
|
1188
|
+
function Bt(u, e = _u.Legacy) {
|
|
1189
1189
|
return Kr(u, e);
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function uc(u) {
|
|
1192
1192
|
return Object.prototype.toString.call(u);
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1195
|
-
return
|
|
1194
|
+
function _0(u) {
|
|
1195
|
+
return uc(u) === "[object String]";
|
|
1196
1196
|
}
|
|
1197
|
-
const
|
|
1198
|
-
function
|
|
1199
|
-
return
|
|
1197
|
+
const ec = Object.prototype.hasOwnProperty;
|
|
1198
|
+
function tc(u, e) {
|
|
1199
|
+
return ec.call(u, e);
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function Fe(u) {
|
|
1202
1202
|
return Array.prototype.slice.call(arguments, 1).forEach(function(t) {
|
|
1203
1203
|
if (t) {
|
|
1204
1204
|
if (typeof t != "object")
|
|
@@ -1209,13 +1209,13 @@ function Se(u) {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
}), u;
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function Pt(u, e, t) {
|
|
1213
1213
|
return [].concat(u.slice(0, e), t, u.slice(e + 1));
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1215
|
+
function m0(u) {
|
|
1216
1216
|
return !(u >= 55296 && u <= 57343 || u >= 64976 && u <= 65007 || (u & 65535) === 65535 || (u & 65535) === 65534 || u >= 0 && u <= 8 || u === 11 || u >= 14 && u <= 31 || u >= 127 && u <= 159 || u > 1114111);
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1218
|
+
function De(u) {
|
|
1219
1219
|
if (u > 65535) {
|
|
1220
1220
|
u -= 65536;
|
|
1221
1221
|
const e = 55296 + (u >> 10), t = 56320 + (u & 1023);
|
|
@@ -1223,40 +1223,40 @@ function Fe(u) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
return String.fromCharCode(u);
|
|
1225
1225
|
}
|
|
1226
|
-
const zt = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,
|
|
1227
|
-
function
|
|
1228
|
-
if (e.charCodeAt(0) === 35 &&
|
|
1226
|
+
const zt = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, nc = /&([a-z#][a-z0-9]{1,31});/gi, rc = new RegExp(zt.source + "|" + nc.source, "gi"), cc = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
|
|
1227
|
+
function oc(u, e) {
|
|
1228
|
+
if (e.charCodeAt(0) === 35 && cc.test(e)) {
|
|
1229
1229
|
const n = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
|
|
1230
|
-
return
|
|
1230
|
+
return m0(n) ? De(n) : u;
|
|
1231
1231
|
}
|
|
1232
|
-
const t =
|
|
1232
|
+
const t = Bt(u);
|
|
1233
1233
|
return t !== u ? t : u;
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function ic(u) {
|
|
1236
1236
|
return u.indexOf("\\") < 0 ? u : u.replace(zt, "$1");
|
|
1237
1237
|
}
|
|
1238
1238
|
function qu(u) {
|
|
1239
|
-
return u.indexOf("\\") < 0 && u.indexOf("&") < 0 ? u : u.replace(
|
|
1240
|
-
return t ||
|
|
1239
|
+
return u.indexOf("\\") < 0 && u.indexOf("&") < 0 ? u : u.replace(rc, function(e, t, n) {
|
|
1240
|
+
return t || oc(e, n);
|
|
1241
1241
|
});
|
|
1242
1242
|
}
|
|
1243
|
-
const
|
|
1243
|
+
const ac = /[&<>"]/, sc = /[&<>"]/g, lc = {
|
|
1244
1244
|
"&": "&",
|
|
1245
1245
|
"<": "<",
|
|
1246
1246
|
">": ">",
|
|
1247
1247
|
'"': """
|
|
1248
1248
|
};
|
|
1249
|
-
function
|
|
1250
|
-
return
|
|
1249
|
+
function fc(u) {
|
|
1250
|
+
return lc[u];
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1253
|
-
return
|
|
1252
|
+
function gu(u) {
|
|
1253
|
+
return ac.test(u) ? u.replace(sc, fc) : u;
|
|
1254
1254
|
}
|
|
1255
|
-
const
|
|
1256
|
-
function
|
|
1257
|
-
return u.replace(
|
|
1255
|
+
const dc = /[.?*+^$[\]\\(){}|-]/g;
|
|
1256
|
+
function hc(u) {
|
|
1257
|
+
return u.replace(dc, "\\$&");
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1259
|
+
function S(u) {
|
|
1260
1260
|
switch (u) {
|
|
1261
1261
|
case 9:
|
|
1262
1262
|
case 32:
|
|
@@ -1264,7 +1264,7 @@ function w(u) {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
return !1;
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1267
|
+
function Ku(u) {
|
|
1268
1268
|
if (u >= 8192 && u <= 8202)
|
|
1269
1269
|
return !0;
|
|
1270
1270
|
switch (u) {
|
|
@@ -1283,10 +1283,10 @@ function ue(u) {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
return !1;
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1287
|
-
return
|
|
1286
|
+
function ue(u) {
|
|
1287
|
+
return p0.test(u) || Lt.test(u);
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function ee(u) {
|
|
1290
1290
|
switch (u) {
|
|
1291
1291
|
case 33:
|
|
1292
1292
|
case 34:
|
|
@@ -1325,37 +1325,37 @@ function te(u) {
|
|
|
1325
1325
|
return !1;
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function Te(u) {
|
|
1329
1329
|
return u = u.trim().replace(/\s+/g, " "), "ẞ".toLowerCase() === "Ṿ" && (u = u.replace(/ẞ/g, "ß")), u.toLowerCase().toUpperCase();
|
|
1330
1330
|
}
|
|
1331
|
-
const
|
|
1331
|
+
const bc = { mdurl: zr, ucmicro: Ur }, pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1332
1332
|
__proto__: null,
|
|
1333
|
-
arrayReplaceAt:
|
|
1334
|
-
assign:
|
|
1335
|
-
escapeHtml:
|
|
1336
|
-
escapeRE:
|
|
1337
|
-
fromCodePoint:
|
|
1338
|
-
has:
|
|
1339
|
-
isMdAsciiPunct:
|
|
1340
|
-
isPunctChar:
|
|
1341
|
-
isSpace:
|
|
1342
|
-
isString:
|
|
1343
|
-
isValidEntityCode:
|
|
1344
|
-
isWhiteSpace:
|
|
1345
|
-
lib:
|
|
1346
|
-
normalizeReference:
|
|
1333
|
+
arrayReplaceAt: Pt,
|
|
1334
|
+
assign: Fe,
|
|
1335
|
+
escapeHtml: gu,
|
|
1336
|
+
escapeRE: hc,
|
|
1337
|
+
fromCodePoint: De,
|
|
1338
|
+
has: tc,
|
|
1339
|
+
isMdAsciiPunct: ee,
|
|
1340
|
+
isPunctChar: ue,
|
|
1341
|
+
isSpace: S,
|
|
1342
|
+
isString: _0,
|
|
1343
|
+
isValidEntityCode: m0,
|
|
1344
|
+
isWhiteSpace: Ku,
|
|
1345
|
+
lib: bc,
|
|
1346
|
+
normalizeReference: Te,
|
|
1347
1347
|
unescapeAll: qu,
|
|
1348
|
-
unescapeMd:
|
|
1348
|
+
unescapeMd: ic
|
|
1349
1349
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1350
|
-
function
|
|
1351
|
-
let n, r,
|
|
1352
|
-
const
|
|
1353
|
-
for (u.pos = e + 1, n = 1; u.pos <
|
|
1354
|
-
if (
|
|
1350
|
+
function _c(u, e, t) {
|
|
1351
|
+
let n, r, c, i;
|
|
1352
|
+
const o = u.posMax, a = u.pos;
|
|
1353
|
+
for (u.pos = e + 1, n = 1; u.pos < o; ) {
|
|
1354
|
+
if (c = u.src.charCodeAt(u.pos), c === 93 && (n--, n === 0)) {
|
|
1355
1355
|
r = !0;
|
|
1356
1356
|
break;
|
|
1357
1357
|
}
|
|
1358
|
-
if (i = u.pos, u.md.inline.skipToken(u),
|
|
1358
|
+
if (i = u.pos, u.md.inline.skipToken(u), c === 91) {
|
|
1359
1359
|
if (i === u.pos - 1)
|
|
1360
1360
|
n++;
|
|
1361
1361
|
else if (t)
|
|
@@ -1365,9 +1365,9 @@ function _o(u, e, t) {
|
|
|
1365
1365
|
let s = -1;
|
|
1366
1366
|
return r && (s = u.pos), u.pos = a, s;
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1368
|
+
function mc(u, e, t) {
|
|
1369
1369
|
let n, r = e;
|
|
1370
|
-
const
|
|
1370
|
+
const c = {
|
|
1371
1371
|
ok: !1,
|
|
1372
1372
|
pos: 0,
|
|
1373
1373
|
str: ""
|
|
@@ -1375,16 +1375,16 @@ function xo(u, e, t) {
|
|
|
1375
1375
|
if (u.charCodeAt(r) === 60) {
|
|
1376
1376
|
for (r++; r < t; ) {
|
|
1377
1377
|
if (n = u.charCodeAt(r), n === 10 || n === 60)
|
|
1378
|
-
return
|
|
1378
|
+
return c;
|
|
1379
1379
|
if (n === 62)
|
|
1380
|
-
return
|
|
1380
|
+
return c.pos = r + 1, c.str = qu(u.slice(e + 1, r)), c.ok = !0, c;
|
|
1381
1381
|
if (n === 92 && r + 1 < t) {
|
|
1382
1382
|
r += 2;
|
|
1383
1383
|
continue;
|
|
1384
1384
|
}
|
|
1385
1385
|
r++;
|
|
1386
1386
|
}
|
|
1387
|
-
return
|
|
1387
|
+
return c;
|
|
1388
1388
|
}
|
|
1389
1389
|
let i = 0;
|
|
1390
1390
|
for (; r < t && (n = u.charCodeAt(r), !(n === 32 || n < 32 || n === 127)); ) {
|
|
@@ -1395,7 +1395,7 @@ function xo(u, e, t) {
|
|
|
1395
1395
|
continue;
|
|
1396
1396
|
}
|
|
1397
1397
|
if (n === 40 && (i++, i > 32))
|
|
1398
|
-
return
|
|
1398
|
+
return c;
|
|
1399
1399
|
if (n === 41) {
|
|
1400
1400
|
if (i === 0)
|
|
1401
1401
|
break;
|
|
@@ -1403,10 +1403,10 @@ function xo(u, e, t) {
|
|
|
1403
1403
|
}
|
|
1404
1404
|
r++;
|
|
1405
1405
|
}
|
|
1406
|
-
return e === r || i !== 0 || (
|
|
1406
|
+
return e === r || i !== 0 || (c.str = qu(u.slice(e, r)), c.pos = r, c.ok = !0), c;
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1409
|
-
let r,
|
|
1408
|
+
function xc(u, e, t, n) {
|
|
1409
|
+
let r, c = e;
|
|
1410
1410
|
const i = {
|
|
1411
1411
|
// if `true`, this is a valid link title
|
|
1412
1412
|
ok: !1,
|
|
@@ -1422,122 +1422,122 @@ function go(u, e, t, n) {
|
|
|
1422
1422
|
if (n)
|
|
1423
1423
|
i.str = n.str, i.marker = n.marker;
|
|
1424
1424
|
else {
|
|
1425
|
-
if (
|
|
1425
|
+
if (c >= t)
|
|
1426
1426
|
return i;
|
|
1427
|
-
let
|
|
1428
|
-
if (
|
|
1427
|
+
let o = u.charCodeAt(c);
|
|
1428
|
+
if (o !== 34 && o !== 39 && o !== 40)
|
|
1429
1429
|
return i;
|
|
1430
|
-
e++,
|
|
1430
|
+
e++, c++, o === 40 && (o = 41), i.marker = o;
|
|
1431
1431
|
}
|
|
1432
|
-
for (;
|
|
1433
|
-
if (r = u.charCodeAt(
|
|
1434
|
-
return i.pos =
|
|
1432
|
+
for (; c < t; ) {
|
|
1433
|
+
if (r = u.charCodeAt(c), r === i.marker)
|
|
1434
|
+
return i.pos = c + 1, i.str += qu(u.slice(e, c)), i.ok = !0, i;
|
|
1435
1435
|
if (r === 40 && i.marker === 41)
|
|
1436
1436
|
return i;
|
|
1437
|
-
r === 92 &&
|
|
1437
|
+
r === 92 && c + 1 < t && c++, c++;
|
|
1438
1438
|
}
|
|
1439
|
-
return i.can_continue = !0, i.str += qu(u.slice(e,
|
|
1439
|
+
return i.can_continue = !0, i.str += qu(u.slice(e, c)), i;
|
|
1440
1440
|
}
|
|
1441
|
-
const
|
|
1441
|
+
const gc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1442
1442
|
__proto__: null,
|
|
1443
|
-
parseLinkDestination:
|
|
1444
|
-
parseLinkLabel:
|
|
1445
|
-
parseLinkTitle:
|
|
1446
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1447
|
-
|
|
1448
|
-
const
|
|
1449
|
-
return "<code" + r.renderAttrs(
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
|
-
const
|
|
1453
|
-
return "<pre" + r.renderAttrs(
|
|
1443
|
+
parseLinkDestination: mc,
|
|
1444
|
+
parseLinkLabel: _c,
|
|
1445
|
+
parseLinkTitle: xc
|
|
1446
|
+
}, Symbol.toStringTag, { value: "Module" })), au = {};
|
|
1447
|
+
au.code_inline = function(u, e, t, n, r) {
|
|
1448
|
+
const c = u[e];
|
|
1449
|
+
return "<code" + r.renderAttrs(c) + ">" + gu(c.content) + "</code>";
|
|
1450
|
+
};
|
|
1451
|
+
au.code_block = function(u, e, t, n, r) {
|
|
1452
|
+
const c = u[e];
|
|
1453
|
+
return "<pre" + r.renderAttrs(c) + "><code>" + gu(u[e].content) + `</code></pre>
|
|
1454
1454
|
`;
|
|
1455
1455
|
};
|
|
1456
|
-
|
|
1457
|
-
const
|
|
1458
|
-
let
|
|
1456
|
+
au.fence = function(u, e, t, n, r) {
|
|
1457
|
+
const c = u[e], i = c.info ? qu(c.info).trim() : "";
|
|
1458
|
+
let o = "", a = "";
|
|
1459
1459
|
if (i) {
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1460
|
+
const f = i.split(/(\s+)/g);
|
|
1461
|
+
o = f[0], a = f.slice(2).join("");
|
|
1462
1462
|
}
|
|
1463
1463
|
let s;
|
|
1464
|
-
if (t.highlight ? s = t.highlight(
|
|
1464
|
+
if (t.highlight ? s = t.highlight(c.content, o, a) || gu(c.content) : s = gu(c.content), s.indexOf("<pre") === 0)
|
|
1465
1465
|
return s + `
|
|
1466
1466
|
`;
|
|
1467
1467
|
if (i) {
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
const
|
|
1471
|
-
attrs:
|
|
1468
|
+
const f = c.attrIndex("class"), d = c.attrs ? c.attrs.slice() : [];
|
|
1469
|
+
f < 0 ? d.push(["class", t.langPrefix + o]) : (d[f] = d[f].slice(), d[f][1] += " " + t.langPrefix + o);
|
|
1470
|
+
const _ = {
|
|
1471
|
+
attrs: d
|
|
1472
1472
|
};
|
|
1473
|
-
return `<pre><code${r.renderAttrs(
|
|
1473
|
+
return `<pre><code${r.renderAttrs(_)}>${s}</code></pre>
|
|
1474
1474
|
`;
|
|
1475
1475
|
}
|
|
1476
|
-
return `<pre><code${r.renderAttrs(
|
|
1476
|
+
return `<pre><code${r.renderAttrs(c)}>${s}</code></pre>
|
|
1477
1477
|
`;
|
|
1478
1478
|
};
|
|
1479
|
-
|
|
1480
|
-
const
|
|
1481
|
-
return
|
|
1479
|
+
au.image = function(u, e, t, n, r) {
|
|
1480
|
+
const c = u[e];
|
|
1481
|
+
return c.attrs[c.attrIndex("alt")][1] = r.renderInlineAsText(c.children, t, n), r.renderToken(u, e, t);
|
|
1482
1482
|
};
|
|
1483
|
-
|
|
1483
|
+
au.hardbreak = function(u, e, t) {
|
|
1484
1484
|
return t.xhtmlOut ? `<br />
|
|
1485
1485
|
` : `<br>
|
|
1486
1486
|
`;
|
|
1487
1487
|
};
|
|
1488
|
-
|
|
1488
|
+
au.softbreak = function(u, e, t) {
|
|
1489
1489
|
return t.breaks ? t.xhtmlOut ? `<br />
|
|
1490
1490
|
` : `<br>
|
|
1491
1491
|
` : `
|
|
1492
1492
|
`;
|
|
1493
1493
|
};
|
|
1494
|
-
|
|
1495
|
-
return
|
|
1494
|
+
au.text = function(u, e) {
|
|
1495
|
+
return gu(u[e].content);
|
|
1496
1496
|
};
|
|
1497
|
-
|
|
1497
|
+
au.html_block = function(u, e) {
|
|
1498
1498
|
return u[e].content;
|
|
1499
1499
|
};
|
|
1500
|
-
|
|
1500
|
+
au.html_inline = function(u, e) {
|
|
1501
1501
|
return u[e].content;
|
|
1502
1502
|
};
|
|
1503
1503
|
function Uu() {
|
|
1504
|
-
this.rules =
|
|
1504
|
+
this.rules = Fe({}, au);
|
|
1505
1505
|
}
|
|
1506
1506
|
Uu.prototype.renderAttrs = function(e) {
|
|
1507
1507
|
let t, n, r;
|
|
1508
1508
|
if (!e.attrs)
|
|
1509
1509
|
return "";
|
|
1510
1510
|
for (r = "", t = 0, n = e.attrs.length; t < n; t++)
|
|
1511
|
-
r += " " +
|
|
1511
|
+
r += " " + gu(e.attrs[t][0]) + '="' + gu(e.attrs[t][1]) + '"';
|
|
1512
1512
|
return r;
|
|
1513
1513
|
};
|
|
1514
1514
|
Uu.prototype.renderToken = function(e, t, n) {
|
|
1515
1515
|
const r = e[t];
|
|
1516
|
-
let
|
|
1516
|
+
let c = "";
|
|
1517
1517
|
if (r.hidden)
|
|
1518
1518
|
return "";
|
|
1519
|
-
r.block && r.nesting !== -1 && t && e[t - 1].hidden && (
|
|
1520
|
-
`),
|
|
1519
|
+
r.block && r.nesting !== -1 && t && e[t - 1].hidden && (c += `
|
|
1520
|
+
`), c += (r.nesting === -1 ? "</" : "<") + r.tag, c += this.renderAttrs(r), r.nesting === 0 && n.xhtmlOut && (c += " /");
|
|
1521
1521
|
let i = !1;
|
|
1522
1522
|
if (r.block && (i = !0, r.nesting === 1 && t + 1 < e.length)) {
|
|
1523
|
-
const
|
|
1524
|
-
(
|
|
1523
|
+
const o = e[t + 1];
|
|
1524
|
+
(o.type === "inline" || o.hidden || o.nesting === -1 && o.tag === r.tag) && (i = !1);
|
|
1525
1525
|
}
|
|
1526
|
-
return
|
|
1527
|
-
` : ">",
|
|
1526
|
+
return c += i ? `>
|
|
1527
|
+
` : ">", c;
|
|
1528
1528
|
};
|
|
1529
1529
|
Uu.prototype.renderInline = function(u, e, t) {
|
|
1530
1530
|
let n = "";
|
|
1531
1531
|
const r = this.rules;
|
|
1532
|
-
for (let
|
|
1533
|
-
const
|
|
1534
|
-
typeof r[
|
|
1532
|
+
for (let c = 0, i = u.length; c < i; c++) {
|
|
1533
|
+
const o = u[c].type;
|
|
1534
|
+
typeof r[o] < "u" ? n += r[o](u, c, e, t, this) : n += this.renderToken(u, c, e);
|
|
1535
1535
|
}
|
|
1536
1536
|
return n;
|
|
1537
1537
|
};
|
|
1538
1538
|
Uu.prototype.renderInlineAsText = function(u, e, t) {
|
|
1539
1539
|
let n = "";
|
|
1540
|
-
for (let r = 0,
|
|
1540
|
+
for (let r = 0, c = u.length; r < c; r++)
|
|
1541
1541
|
switch (u[r].type) {
|
|
1542
1542
|
case "text":
|
|
1543
1543
|
n += u[r].content;
|
|
@@ -1560,22 +1560,22 @@ Uu.prototype.renderInlineAsText = function(u, e, t) {
|
|
|
1560
1560
|
Uu.prototype.render = function(u, e, t) {
|
|
1561
1561
|
let n = "";
|
|
1562
1562
|
const r = this.rules;
|
|
1563
|
-
for (let
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1563
|
+
for (let c = 0, i = u.length; c < i; c++) {
|
|
1564
|
+
const o = u[c].type;
|
|
1565
|
+
o === "inline" ? n += this.renderInline(u[c].children, e, t) : typeof r[o] < "u" ? n += r[o](u, c, e, t, this) : n += this.renderToken(u, c, e, t);
|
|
1566
1566
|
}
|
|
1567
1567
|
return n;
|
|
1568
1568
|
};
|
|
1569
|
-
function
|
|
1569
|
+
function Z() {
|
|
1570
1570
|
this.__rules__ = [], this.__cache__ = null;
|
|
1571
1571
|
}
|
|
1572
|
-
|
|
1572
|
+
Z.prototype.__find__ = function(u) {
|
|
1573
1573
|
for (let e = 0; e < this.__rules__.length; e++)
|
|
1574
1574
|
if (this.__rules__[e].name === u)
|
|
1575
1575
|
return e;
|
|
1576
1576
|
return -1;
|
|
1577
1577
|
};
|
|
1578
|
-
|
|
1578
|
+
Z.prototype.__compile__ = function() {
|
|
1579
1579
|
const u = this, e = [""];
|
|
1580
1580
|
u.__rules__.forEach(function(t) {
|
|
1581
1581
|
t.enabled && t.alt.forEach(function(n) {
|
|
@@ -1587,35 +1587,35 @@ V.prototype.__compile__ = function() {
|
|
|
1587
1587
|
});
|
|
1588
1588
|
});
|
|
1589
1589
|
};
|
|
1590
|
-
|
|
1590
|
+
Z.prototype.at = function(u, e, t) {
|
|
1591
1591
|
const n = this.__find__(u), r = t || {};
|
|
1592
1592
|
if (n === -1)
|
|
1593
1593
|
throw new Error("Parser rule not found: " + u);
|
|
1594
1594
|
this.__rules__[n].fn = e, this.__rules__[n].alt = r.alt || [], this.__cache__ = null;
|
|
1595
1595
|
};
|
|
1596
|
-
|
|
1597
|
-
const r = this.__find__(u),
|
|
1596
|
+
Z.prototype.before = function(u, e, t, n) {
|
|
1597
|
+
const r = this.__find__(u), c = n || {};
|
|
1598
1598
|
if (r === -1)
|
|
1599
1599
|
throw new Error("Parser rule not found: " + u);
|
|
1600
1600
|
this.__rules__.splice(r, 0, {
|
|
1601
1601
|
name: e,
|
|
1602
1602
|
enabled: !0,
|
|
1603
1603
|
fn: t,
|
|
1604
|
-
alt:
|
|
1604
|
+
alt: c.alt || []
|
|
1605
1605
|
}), this.__cache__ = null;
|
|
1606
1606
|
};
|
|
1607
|
-
|
|
1608
|
-
const r = this.__find__(u),
|
|
1607
|
+
Z.prototype.after = function(u, e, t, n) {
|
|
1608
|
+
const r = this.__find__(u), c = n || {};
|
|
1609
1609
|
if (r === -1)
|
|
1610
1610
|
throw new Error("Parser rule not found: " + u);
|
|
1611
1611
|
this.__rules__.splice(r + 1, 0, {
|
|
1612
1612
|
name: e,
|
|
1613
1613
|
enabled: !0,
|
|
1614
1614
|
fn: t,
|
|
1615
|
-
alt:
|
|
1615
|
+
alt: c.alt || []
|
|
1616
1616
|
}), this.__cache__ = null;
|
|
1617
1617
|
};
|
|
1618
|
-
|
|
1618
|
+
Z.prototype.push = function(u, e, t) {
|
|
1619
1619
|
const n = t || {};
|
|
1620
1620
|
this.__rules__.push({
|
|
1621
1621
|
name: u,
|
|
@@ -1624,7 +1624,7 @@ V.prototype.push = function(u, e, t) {
|
|
|
1624
1624
|
alt: n.alt || []
|
|
1625
1625
|
}), this.__cache__ = null;
|
|
1626
1626
|
};
|
|
1627
|
-
|
|
1627
|
+
Z.prototype.enable = function(u, e) {
|
|
1628
1628
|
Array.isArray(u) || (u = [u]);
|
|
1629
1629
|
const t = [];
|
|
1630
1630
|
return u.forEach(function(n) {
|
|
@@ -1637,12 +1637,12 @@ V.prototype.enable = function(u, e) {
|
|
|
1637
1637
|
this.__rules__[r].enabled = !0, t.push(n);
|
|
1638
1638
|
}, this), this.__cache__ = null, t;
|
|
1639
1639
|
};
|
|
1640
|
-
|
|
1640
|
+
Z.prototype.enableOnly = function(u, e) {
|
|
1641
1641
|
Array.isArray(u) || (u = [u]), this.__rules__.forEach(function(t) {
|
|
1642
1642
|
t.enabled = !1;
|
|
1643
1643
|
}), this.enable(u, e);
|
|
1644
1644
|
};
|
|
1645
|
-
|
|
1645
|
+
Z.prototype.disable = function(u, e) {
|
|
1646
1646
|
Array.isArray(u) || (u = [u]);
|
|
1647
1647
|
const t = [];
|
|
1648
1648
|
return u.forEach(function(n) {
|
|
@@ -1655,13 +1655,13 @@ V.prototype.disable = function(u, e) {
|
|
|
1655
1655
|
this.__rules__[r].enabled = !1, t.push(n);
|
|
1656
1656
|
}, this), this.__cache__ = null, t;
|
|
1657
1657
|
};
|
|
1658
|
-
|
|
1658
|
+
Z.prototype.getRules = function(u) {
|
|
1659
1659
|
return this.__cache__ === null && this.__compile__(), this.__cache__[u] || [];
|
|
1660
1660
|
};
|
|
1661
|
-
function
|
|
1661
|
+
function eu(u, e, t) {
|
|
1662
1662
|
this.type = u, this.tag = e, this.attrs = null, this.map = null, this.nesting = t, this.level = 0, this.children = null, this.content = "", this.markup = "", this.info = "", this.meta = null, this.block = !1, this.hidden = !1;
|
|
1663
1663
|
}
|
|
1664
|
-
|
|
1664
|
+
eu.prototype.attrIndex = function(e) {
|
|
1665
1665
|
if (!this.attrs)
|
|
1666
1666
|
return -1;
|
|
1667
1667
|
const t = this.attrs;
|
|
@@ -1670,226 +1670,226 @@ tu.prototype.attrIndex = function(e) {
|
|
|
1670
1670
|
return n;
|
|
1671
1671
|
return -1;
|
|
1672
1672
|
};
|
|
1673
|
-
|
|
1673
|
+
eu.prototype.attrPush = function(e) {
|
|
1674
1674
|
this.attrs ? this.attrs.push(e) : this.attrs = [e];
|
|
1675
1675
|
};
|
|
1676
|
-
|
|
1676
|
+
eu.prototype.attrSet = function(e, t) {
|
|
1677
1677
|
const n = this.attrIndex(e), r = [e, t];
|
|
1678
1678
|
n < 0 ? this.attrPush(r) : this.attrs[n] = r;
|
|
1679
1679
|
};
|
|
1680
|
-
|
|
1680
|
+
eu.prototype.attrGet = function(e) {
|
|
1681
1681
|
const t = this.attrIndex(e);
|
|
1682
1682
|
let n = null;
|
|
1683
1683
|
return t >= 0 && (n = this.attrs[t][1]), n;
|
|
1684
1684
|
};
|
|
1685
|
-
|
|
1685
|
+
eu.prototype.attrJoin = function(e, t) {
|
|
1686
1686
|
const n = this.attrIndex(e);
|
|
1687
1687
|
n < 0 ? this.attrPush([e, t]) : this.attrs[n][1] = this.attrs[n][1] + " " + t;
|
|
1688
1688
|
};
|
|
1689
1689
|
function qt(u, e, t) {
|
|
1690
1690
|
this.src = u, this.env = t, this.tokens = [], this.inlineMode = !1, this.md = e;
|
|
1691
1691
|
}
|
|
1692
|
-
qt.prototype.Token =
|
|
1693
|
-
const
|
|
1694
|
-
function
|
|
1692
|
+
qt.prototype.Token = eu;
|
|
1693
|
+
const kc = /\r\n?|\n/g, Ec = /\0/g;
|
|
1694
|
+
function Ac(u) {
|
|
1695
1695
|
let e;
|
|
1696
|
-
e = u.src.replace(
|
|
1697
|
-
`), e = e.replace(
|
|
1696
|
+
e = u.src.replace(kc, `
|
|
1697
|
+
`), e = e.replace(Ec, "�"), u.src = e;
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1699
|
+
function Cc(u) {
|
|
1700
1700
|
let e;
|
|
1701
1701
|
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);
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1703
|
+
function Dc(u) {
|
|
1704
1704
|
const e = u.tokens;
|
|
1705
1705
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
1706
1706
|
const r = e[t];
|
|
1707
1707
|
r.type === "inline" && u.md.inline.parse(r.content, u.md, u.env, r.children);
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1710
|
+
function yc(u) {
|
|
1711
1711
|
return /^<a[>\s]/i.test(u);
|
|
1712
1712
|
}
|
|
1713
|
-
function
|
|
1713
|
+
function Fc(u) {
|
|
1714
1714
|
return /^<\/a\s*>/i.test(u);
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1716
|
+
function Tc(u) {
|
|
1717
1717
|
const e = u.tokens;
|
|
1718
1718
|
if (u.md.options.linkify)
|
|
1719
1719
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
1720
1720
|
if (e[t].type !== "inline" || !u.md.linkify.pretest(e[t].content))
|
|
1721
1721
|
continue;
|
|
1722
|
-
let r = e[t].children,
|
|
1722
|
+
let r = e[t].children, c = 0;
|
|
1723
1723
|
for (let i = r.length - 1; i >= 0; i--) {
|
|
1724
|
-
const
|
|
1725
|
-
if (
|
|
1726
|
-
for (i--; r[i].level !==
|
|
1724
|
+
const o = r[i];
|
|
1725
|
+
if (o.type === "link_close") {
|
|
1726
|
+
for (i--; r[i].level !== o.level && r[i].type !== "link_open"; )
|
|
1727
1727
|
i--;
|
|
1728
1728
|
continue;
|
|
1729
1729
|
}
|
|
1730
|
-
if (
|
|
1731
|
-
const a =
|
|
1730
|
+
if (o.type === "html_inline" && (yc(o.content) && c > 0 && c--, Fc(o.content) && c++), !(c > 0) && o.type === "text" && u.md.linkify.test(o.content)) {
|
|
1731
|
+
const a = o.content;
|
|
1732
1732
|
let s = u.md.linkify.match(a);
|
|
1733
|
-
const
|
|
1734
|
-
let
|
|
1733
|
+
const f = [];
|
|
1734
|
+
let d = o.level, _ = 0;
|
|
1735
1735
|
s.length > 0 && s[0].index === 0 && i > 0 && r[i - 1].type === "text_special" && (s = s.slice(1));
|
|
1736
|
-
for (let
|
|
1737
|
-
const
|
|
1736
|
+
for (let b = 0; b < s.length; b++) {
|
|
1737
|
+
const h = s[b].url, C = u.md.normalizeLink(h);
|
|
1738
1738
|
if (!u.md.validateLink(C))
|
|
1739
1739
|
continue;
|
|
1740
|
-
let
|
|
1741
|
-
s[
|
|
1742
|
-
const T = s[
|
|
1743
|
-
if (T >
|
|
1740
|
+
let y = s[b].text;
|
|
1741
|
+
s[b].schema ? s[b].schema === "mailto:" && !/^mailto:/i.test(y) ? y = u.md.normalizeLinkText("mailto:" + y).replace(/^mailto:/, "") : y = u.md.normalizeLinkText(y) : y = u.md.normalizeLinkText("http://" + y).replace(/^http:\/\//, "");
|
|
1742
|
+
const T = s[b].index;
|
|
1743
|
+
if (T > _) {
|
|
1744
1744
|
const A = new u.Token("text", "", 0);
|
|
1745
|
-
A.content = a.slice(
|
|
1745
|
+
A.content = a.slice(_, T), A.level = d, f.push(A);
|
|
1746
1746
|
}
|
|
1747
1747
|
const E = new u.Token("link_open", "a", 1);
|
|
1748
|
-
E.attrs = [["href", C]], E.level =
|
|
1748
|
+
E.attrs = [["href", C]], E.level = d++, E.markup = "linkify", E.info = "auto", f.push(E);
|
|
1749
1749
|
const k = new u.Token("text", "", 0);
|
|
1750
|
-
k.content =
|
|
1751
|
-
const
|
|
1752
|
-
|
|
1750
|
+
k.content = y, k.level = d, f.push(k);
|
|
1751
|
+
const m = new u.Token("link_close", "a", -1);
|
|
1752
|
+
m.level = --d, m.markup = "linkify", m.info = "auto", f.push(m), _ = s[b].lastIndex;
|
|
1753
1753
|
}
|
|
1754
|
-
if (
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1754
|
+
if (_ < a.length) {
|
|
1755
|
+
const b = new u.Token("text", "", 0);
|
|
1756
|
+
b.content = a.slice(_), b.level = d, f.push(b);
|
|
1757
1757
|
}
|
|
1758
|
-
e[t].children = r =
|
|
1758
|
+
e[t].children = r = Pt(r, i, f);
|
|
1759
1759
|
}
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
|
-
const Ut = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/,
|
|
1763
|
+
const Ut = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/, Sc = /\((c|tm|r)\)/i, wc = /\((c|tm|r)\)/ig, vc = {
|
|
1764
1764
|
c: "©",
|
|
1765
1765
|
r: "®",
|
|
1766
1766
|
tm: "™"
|
|
1767
1767
|
};
|
|
1768
|
-
function
|
|
1769
|
-
return
|
|
1768
|
+
function Rc(u, e) {
|
|
1769
|
+
return vc[e.toLowerCase()];
|
|
1770
1770
|
}
|
|
1771
|
-
function
|
|
1771
|
+
function Ic(u) {
|
|
1772
1772
|
let e = 0;
|
|
1773
1773
|
for (let t = u.length - 1; t >= 0; t--) {
|
|
1774
1774
|
const n = u[t];
|
|
1775
|
-
n.type === "text" && !e && (n.content = n.content.replace(
|
|
1775
|
+
n.type === "text" && !e && (n.content = n.content.replace(wc, Rc)), n.type === "link_open" && n.info === "auto" && e--, n.type === "link_close" && n.info === "auto" && e++;
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function Mc(u) {
|
|
1779
1779
|
let e = 0;
|
|
1780
1780
|
for (let t = u.length - 1; t >= 0; t--) {
|
|
1781
1781
|
const n = u[t];
|
|
1782
1782
|
n.type === "text" && !e && Ut.test(n.content) && (n.content = n.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–")), n.type === "link_open" && n.info === "auto" && e--, n.type === "link_close" && n.info === "auto" && e++;
|
|
1783
1783
|
}
|
|
1784
1784
|
}
|
|
1785
|
-
function
|
|
1785
|
+
function Lc(u) {
|
|
1786
1786
|
let e;
|
|
1787
1787
|
if (u.md.options.typographer)
|
|
1788
1788
|
for (e = u.tokens.length - 1; e >= 0; e--)
|
|
1789
|
-
u.tokens[e].type === "inline" && (
|
|
1789
|
+
u.tokens[e].type === "inline" && (Sc.test(u.tokens[e].content) && Ic(u.tokens[e].children), Ut.test(u.tokens[e].content) && Mc(u.tokens[e].children));
|
|
1790
1790
|
}
|
|
1791
|
-
const
|
|
1792
|
-
function
|
|
1791
|
+
const Oc = /['"]/, dt = /['"]/g, ht = "’";
|
|
1792
|
+
function xe(u, e, t) {
|
|
1793
1793
|
return u.slice(0, e) + t + u.slice(e + 1);
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function Nc(u, e) {
|
|
1796
1796
|
let t;
|
|
1797
1797
|
const n = [];
|
|
1798
1798
|
for (let r = 0; r < u.length; r++) {
|
|
1799
|
-
const
|
|
1799
|
+
const c = u[r], i = u[r].level;
|
|
1800
1800
|
for (t = n.length - 1; t >= 0 && !(n[t].level <= i); t--)
|
|
1801
1801
|
;
|
|
1802
|
-
if (n.length = t + 1,
|
|
1802
|
+
if (n.length = t + 1, c.type !== "text")
|
|
1803
1803
|
continue;
|
|
1804
|
-
let
|
|
1804
|
+
let o = c.content, a = 0, s = o.length;
|
|
1805
1805
|
u:
|
|
1806
1806
|
for (; a < s; ) {
|
|
1807
|
-
|
|
1808
|
-
const
|
|
1809
|
-
if (!
|
|
1807
|
+
dt.lastIndex = a;
|
|
1808
|
+
const f = dt.exec(o);
|
|
1809
|
+
if (!f)
|
|
1810
1810
|
break;
|
|
1811
|
-
let
|
|
1812
|
-
a =
|
|
1813
|
-
const
|
|
1814
|
-
let
|
|
1815
|
-
if (
|
|
1816
|
-
|
|
1811
|
+
let d = !0, _ = !0;
|
|
1812
|
+
a = f.index + 1;
|
|
1813
|
+
const b = f[0] === "'";
|
|
1814
|
+
let h = 32;
|
|
1815
|
+
if (f.index - 1 >= 0)
|
|
1816
|
+
h = o.charCodeAt(f.index - 1);
|
|
1817
1817
|
else
|
|
1818
1818
|
for (t = r - 1; t >= 0 && !(u[t].type === "softbreak" || u[t].type === "hardbreak"); t--)
|
|
1819
1819
|
if (u[t].content) {
|
|
1820
|
-
|
|
1820
|
+
h = u[t].content.charCodeAt(u[t].content.length - 1);
|
|
1821
1821
|
break;
|
|
1822
1822
|
}
|
|
1823
1823
|
let C = 32;
|
|
1824
1824
|
if (a < s)
|
|
1825
|
-
C =
|
|
1825
|
+
C = o.charCodeAt(a);
|
|
1826
1826
|
else
|
|
1827
1827
|
for (t = r + 1; t < u.length && !(u[t].type === "softbreak" || u[t].type === "hardbreak"); t++)
|
|
1828
1828
|
if (u[t].content) {
|
|
1829
1829
|
C = u[t].content.charCodeAt(0);
|
|
1830
1830
|
break;
|
|
1831
1831
|
}
|
|
1832
|
-
const
|
|
1833
|
-
if (k ?
|
|
1834
|
-
|
|
1832
|
+
const y = ee(h) || ue(String.fromCharCode(h)), T = ee(C) || ue(String.fromCharCode(C)), E = Ku(h), k = Ku(C);
|
|
1833
|
+
if (k ? d = !1 : T && (E || y || (d = !1)), E ? _ = !1 : y && (k || T || (_ = !1)), C === 34 && f[0] === '"' && h >= 48 && h <= 57 && (_ = d = !1), d && _ && (d = y, _ = T), !d && !_) {
|
|
1834
|
+
b && (c.content = xe(c.content, f.index, ht));
|
|
1835
1835
|
continue;
|
|
1836
1836
|
}
|
|
1837
|
-
if (
|
|
1837
|
+
if (_)
|
|
1838
1838
|
for (t = n.length - 1; t >= 0; t--) {
|
|
1839
|
-
let
|
|
1839
|
+
let m = n[t];
|
|
1840
1840
|
if (n[t].level < i)
|
|
1841
1841
|
break;
|
|
1842
|
-
if (
|
|
1843
|
-
|
|
1844
|
-
let A,
|
|
1845
|
-
|
|
1846
|
-
u[
|
|
1847
|
-
|
|
1842
|
+
if (m.single === b && n[t].level === i) {
|
|
1843
|
+
m = n[t];
|
|
1844
|
+
let A, F;
|
|
1845
|
+
b ? (A = e.md.options.quotes[2], F = e.md.options.quotes[3]) : (A = e.md.options.quotes[0], F = e.md.options.quotes[1]), c.content = xe(c.content, f.index, F), u[m.token].content = xe(
|
|
1846
|
+
u[m.token].content,
|
|
1847
|
+
m.pos,
|
|
1848
1848
|
A
|
|
1849
|
-
), a +=
|
|
1849
|
+
), a += F.length - 1, m.token === r && (a += A.length - 1), o = c.content, s = o.length, n.length = t;
|
|
1850
1850
|
continue u;
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
1853
|
-
|
|
1853
|
+
d ? n.push({
|
|
1854
1854
|
token: r,
|
|
1855
|
-
pos:
|
|
1856
|
-
single:
|
|
1855
|
+
pos: f.index,
|
|
1856
|
+
single: b,
|
|
1857
1857
|
level: i
|
|
1858
|
-
}) :
|
|
1858
|
+
}) : _ && b && (c.content = xe(c.content, f.index, ht));
|
|
1859
1859
|
}
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1862
|
+
function Bc(u) {
|
|
1863
1863
|
if (u.md.options.typographer)
|
|
1864
1864
|
for (let e = u.tokens.length - 1; e >= 0; e--)
|
|
1865
|
-
u.tokens[e].type !== "inline" || !
|
|
1865
|
+
u.tokens[e].type !== "inline" || !Oc.test(u.tokens[e].content) || Nc(u.tokens[e].children, u);
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1867
|
+
function Pc(u) {
|
|
1868
1868
|
let e, t;
|
|
1869
1869
|
const n = u.tokens, r = n.length;
|
|
1870
|
-
for (let
|
|
1871
|
-
if (n[
|
|
1872
|
-
const i = n[
|
|
1873
|
-
for (e = 0; e <
|
|
1870
|
+
for (let c = 0; c < r; c++) {
|
|
1871
|
+
if (n[c].type !== "inline") continue;
|
|
1872
|
+
const i = n[c].children, o = i.length;
|
|
1873
|
+
for (e = 0; e < o; e++)
|
|
1874
1874
|
i[e].type === "text_special" && (i[e].type = "text");
|
|
1875
|
-
for (e = t = 0; e <
|
|
1876
|
-
i[e].type === "text" && e + 1 <
|
|
1875
|
+
for (e = t = 0; e < o; e++)
|
|
1876
|
+
i[e].type === "text" && e + 1 < o && i[e + 1].type === "text" ? i[e + 1].content = i[e].content + i[e + 1].content : (e !== t && (i[t] = i[e]), t++);
|
|
1877
1877
|
e !== t && (i.length = t);
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
1880
|
const Je = [
|
|
1881
|
-
["normalize",
|
|
1882
|
-
["block",
|
|
1883
|
-
["inline",
|
|
1884
|
-
["linkify",
|
|
1885
|
-
["replacements",
|
|
1886
|
-
["smartquotes",
|
|
1881
|
+
["normalize", Ac],
|
|
1882
|
+
["block", Cc],
|
|
1883
|
+
["inline", Dc],
|
|
1884
|
+
["linkify", Tc],
|
|
1885
|
+
["replacements", Lc],
|
|
1886
|
+
["smartquotes", Bc],
|
|
1887
1887
|
// `text_join` finds `text_special` tokens (for escape sequences)
|
|
1888
1888
|
// and joins them with the rest of the text
|
|
1889
|
-
["text_join",
|
|
1889
|
+
["text_join", Pc]
|
|
1890
1890
|
];
|
|
1891
1891
|
function x0() {
|
|
1892
|
-
this.ruler = new
|
|
1892
|
+
this.ruler = new Z();
|
|
1893
1893
|
for (let u = 0; u < Je.length; u++)
|
|
1894
1894
|
this.ruler.push(Je[u][0], Je[u][1]);
|
|
1895
1895
|
}
|
|
@@ -1899,55 +1899,55 @@ x0.prototype.process = function(u) {
|
|
|
1899
1899
|
e[t](u);
|
|
1900
1900
|
};
|
|
1901
1901
|
x0.prototype.State = qt;
|
|
1902
|
-
function
|
|
1902
|
+
function su(u, e, t, n) {
|
|
1903
1903
|
this.src = u, this.md = e, this.env = t, this.tokens = n, 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;
|
|
1904
1904
|
const r = this.src;
|
|
1905
|
-
for (let
|
|
1906
|
-
const
|
|
1907
|
-
if (!
|
|
1908
|
-
if (
|
|
1909
|
-
|
|
1905
|
+
for (let c = 0, i = 0, o = 0, a = 0, s = r.length, f = !1; i < s; i++) {
|
|
1906
|
+
const d = r.charCodeAt(i);
|
|
1907
|
+
if (!f)
|
|
1908
|
+
if (S(d)) {
|
|
1909
|
+
o++, d === 9 ? a += 4 - a % 4 : a++;
|
|
1910
1910
|
continue;
|
|
1911
1911
|
} else
|
|
1912
|
-
|
|
1913
|
-
(
|
|
1912
|
+
f = !0;
|
|
1913
|
+
(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), f = !1, o = 0, a = 0, c = i + 1);
|
|
1914
1914
|
}
|
|
1915
1915
|
this.bMarks.push(r.length), this.eMarks.push(r.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
|
|
1916
1916
|
}
|
|
1917
|
-
|
|
1918
|
-
const n = new
|
|
1917
|
+
su.prototype.push = function(u, e, t) {
|
|
1918
|
+
const n = new eu(u, e, t);
|
|
1919
1919
|
return n.block = !0, t < 0 && this.level--, n.level = this.level, t > 0 && this.level++, this.tokens.push(n), n;
|
|
1920
1920
|
};
|
|
1921
|
-
|
|
1921
|
+
su.prototype.isEmpty = function(e) {
|
|
1922
1922
|
return this.bMarks[e] + this.tShift[e] >= this.eMarks[e];
|
|
1923
1923
|
};
|
|
1924
|
-
|
|
1924
|
+
su.prototype.skipEmptyLines = function(e) {
|
|
1925
1925
|
for (let t = this.lineMax; e < t && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); e++)
|
|
1926
1926
|
;
|
|
1927
1927
|
return e;
|
|
1928
1928
|
};
|
|
1929
|
-
|
|
1929
|
+
su.prototype.skipSpaces = function(e) {
|
|
1930
1930
|
for (let t = this.src.length; e < t; e++) {
|
|
1931
1931
|
const n = this.src.charCodeAt(e);
|
|
1932
|
-
if (!
|
|
1932
|
+
if (!S(n))
|
|
1933
1933
|
break;
|
|
1934
1934
|
}
|
|
1935
1935
|
return e;
|
|
1936
1936
|
};
|
|
1937
|
-
|
|
1937
|
+
su.prototype.skipSpacesBack = function(e, t) {
|
|
1938
1938
|
if (e <= t)
|
|
1939
1939
|
return e;
|
|
1940
1940
|
for (; e > t; )
|
|
1941
|
-
if (!
|
|
1941
|
+
if (!S(this.src.charCodeAt(--e)))
|
|
1942
1942
|
return e + 1;
|
|
1943
1943
|
return e;
|
|
1944
1944
|
};
|
|
1945
|
-
|
|
1945
|
+
su.prototype.skipChars = function(e, t) {
|
|
1946
1946
|
for (let n = this.src.length; e < n && this.src.charCodeAt(e) === t; e++)
|
|
1947
1947
|
;
|
|
1948
1948
|
return e;
|
|
1949
1949
|
};
|
|
1950
|
-
|
|
1950
|
+
su.prototype.skipCharsBack = function(e, t, n) {
|
|
1951
1951
|
if (e <= n)
|
|
1952
1952
|
return e;
|
|
1953
1953
|
for (; e > n; )
|
|
@@ -1955,125 +1955,125 @@ au.prototype.skipCharsBack = function(e, t, n) {
|
|
|
1955
1955
|
return e + 1;
|
|
1956
1956
|
return e;
|
|
1957
1957
|
};
|
|
1958
|
-
|
|
1958
|
+
su.prototype.getLines = function(e, t, n, r) {
|
|
1959
1959
|
if (e >= t)
|
|
1960
1960
|
return "";
|
|
1961
|
-
const
|
|
1962
|
-
for (let i = 0,
|
|
1961
|
+
const c = new Array(t - e);
|
|
1962
|
+
for (let i = 0, o = e; o < t; o++, i++) {
|
|
1963
1963
|
let a = 0;
|
|
1964
|
-
const s = this.bMarks[
|
|
1965
|
-
let
|
|
1966
|
-
for (
|
|
1967
|
-
const
|
|
1968
|
-
if (
|
|
1969
|
-
|
|
1970
|
-
else if (
|
|
1964
|
+
const s = this.bMarks[o];
|
|
1965
|
+
let f = s, d;
|
|
1966
|
+
for (o + 1 < t || r ? d = this.eMarks[o] + 1 : d = this.eMarks[o]; f < d && a < n; ) {
|
|
1967
|
+
const _ = this.src.charCodeAt(f);
|
|
1968
|
+
if (S(_))
|
|
1969
|
+
_ === 9 ? a += 4 - (a + this.bsCount[o]) % 4 : a++;
|
|
1970
|
+
else if (f - s < this.tShift[o])
|
|
1971
1971
|
a++;
|
|
1972
1972
|
else
|
|
1973
1973
|
break;
|
|
1974
|
-
|
|
1974
|
+
f++;
|
|
1975
1975
|
}
|
|
1976
|
-
a > n ?
|
|
1976
|
+
a > n ? c[i] = new Array(a - n + 1).join(" ") + this.src.slice(f, d) : c[i] = this.src.slice(f, d);
|
|
1977
1977
|
}
|
|
1978
|
-
return
|
|
1978
|
+
return c.join("");
|
|
1979
1979
|
};
|
|
1980
|
-
|
|
1981
|
-
const
|
|
1980
|
+
su.prototype.Token = eu;
|
|
1981
|
+
const zc = 65536;
|
|
1982
1982
|
function Qe(u, e) {
|
|
1983
1983
|
const t = u.bMarks[e] + u.tShift[e], n = u.eMarks[e];
|
|
1984
1984
|
return u.src.slice(t, n);
|
|
1985
1985
|
}
|
|
1986
1986
|
function bt(u) {
|
|
1987
1987
|
const e = [], t = u.length;
|
|
1988
|
-
let n = 0, r = u.charCodeAt(n),
|
|
1988
|
+
let n = 0, r = u.charCodeAt(n), c = !1, i = 0, o = "";
|
|
1989
1989
|
for (; n < t; )
|
|
1990
|
-
r === 124 && (
|
|
1991
|
-
return e.push(
|
|
1990
|
+
r === 124 && (c ? (o += u.substring(i, n - 1), i = n) : (e.push(o + u.substring(i, n)), o = "", i = n + 1)), c = r === 92, n++, r = u.charCodeAt(n);
|
|
1991
|
+
return e.push(o + u.substring(i)), e;
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1993
|
+
function qc(u, e, t, n) {
|
|
1994
1994
|
if (e + 2 > t)
|
|
1995
1995
|
return !1;
|
|
1996
1996
|
let r = e + 1;
|
|
1997
1997
|
if (u.sCount[r] < u.blkIndent || u.sCount[r] - u.blkIndent >= 4)
|
|
1998
1998
|
return !1;
|
|
1999
|
-
let
|
|
2000
|
-
if (
|
|
1999
|
+
let c = u.bMarks[r] + u.tShift[r];
|
|
2000
|
+
if (c >= u.eMarks[r])
|
|
2001
2001
|
return !1;
|
|
2002
|
-
const i = u.src.charCodeAt(
|
|
2003
|
-
if (i !== 124 && i !== 45 && i !== 58 ||
|
|
2002
|
+
const i = u.src.charCodeAt(c++);
|
|
2003
|
+
if (i !== 124 && i !== 45 && i !== 58 || c >= u.eMarks[r])
|
|
2004
2004
|
return !1;
|
|
2005
|
-
const
|
|
2006
|
-
if (
|
|
2005
|
+
const o = u.src.charCodeAt(c++);
|
|
2006
|
+
if (o !== 124 && o !== 45 && o !== 58 && !S(o) || i === 45 && S(o))
|
|
2007
2007
|
return !1;
|
|
2008
|
-
for (;
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2008
|
+
for (; c < u.eMarks[r]; ) {
|
|
2009
|
+
const m = u.src.charCodeAt(c);
|
|
2010
|
+
if (m !== 124 && m !== 45 && m !== 58 && !S(m))
|
|
2011
2011
|
return !1;
|
|
2012
|
-
|
|
2012
|
+
c++;
|
|
2013
2013
|
}
|
|
2014
2014
|
let a = Qe(u, e + 1), s = a.split("|");
|
|
2015
|
-
const
|
|
2016
|
-
for (let
|
|
2017
|
-
const A = s[
|
|
2015
|
+
const f = [];
|
|
2016
|
+
for (let m = 0; m < s.length; m++) {
|
|
2017
|
+
const A = s[m].trim();
|
|
2018
2018
|
if (!A) {
|
|
2019
|
-
if (
|
|
2019
|
+
if (m === 0 || m === s.length - 1)
|
|
2020
2020
|
continue;
|
|
2021
2021
|
return !1;
|
|
2022
2022
|
}
|
|
2023
2023
|
if (!/^:?-+:?$/.test(A))
|
|
2024
2024
|
return !1;
|
|
2025
|
-
A.charCodeAt(A.length - 1) === 58 ?
|
|
2025
|
+
A.charCodeAt(A.length - 1) === 58 ? f.push(A.charCodeAt(0) === 58 ? "center" : "right") : A.charCodeAt(0) === 58 ? f.push("left") : f.push("");
|
|
2026
2026
|
}
|
|
2027
2027
|
if (a = Qe(u, e).trim(), a.indexOf("|") === -1 || u.sCount[e] - u.blkIndent >= 4)
|
|
2028
2028
|
return !1;
|
|
2029
2029
|
s = bt(a), s.length && s[0] === "" && s.shift(), s.length && s[s.length - 1] === "" && s.pop();
|
|
2030
|
-
const
|
|
2031
|
-
if (
|
|
2030
|
+
const d = s.length;
|
|
2031
|
+
if (d === 0 || d !== f.length)
|
|
2032
2032
|
return !1;
|
|
2033
2033
|
if (n)
|
|
2034
2034
|
return !0;
|
|
2035
|
-
const
|
|
2035
|
+
const _ = u.parentType;
|
|
2036
2036
|
u.parentType = "table";
|
|
2037
|
-
const
|
|
2038
|
-
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2037
|
+
const b = u.md.block.ruler.getRules("blockquote"), h = u.push("table_open", "table", 1), C = [e, 0];
|
|
2038
|
+
h.map = C;
|
|
2039
|
+
const y = u.push("thead_open", "thead", 1);
|
|
2040
|
+
y.map = [e, e + 1];
|
|
2041
2041
|
const T = u.push("tr_open", "tr", 1);
|
|
2042
2042
|
T.map = [e, e + 1];
|
|
2043
|
-
for (let
|
|
2043
|
+
for (let m = 0; m < s.length; m++) {
|
|
2044
2044
|
const A = u.push("th_open", "th", 1);
|
|
2045
|
-
|
|
2046
|
-
const
|
|
2047
|
-
|
|
2045
|
+
f[m] && (A.attrs = [["style", "text-align:" + f[m]]]);
|
|
2046
|
+
const F = u.push("inline", "", 0);
|
|
2047
|
+
F.content = s[m].trim(), F.children = [], u.push("th_close", "th", -1);
|
|
2048
2048
|
}
|
|
2049
2049
|
u.push("tr_close", "tr", -1), u.push("thead_close", "thead", -1);
|
|
2050
2050
|
let E, k = 0;
|
|
2051
2051
|
for (r = e + 2; r < t && !(u.sCount[r] < u.blkIndent); r++) {
|
|
2052
|
-
let
|
|
2053
|
-
for (let
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2052
|
+
let m = !1;
|
|
2053
|
+
for (let F = 0, M = b.length; F < M; F++)
|
|
2054
|
+
if (b[F](u, r, t, !0)) {
|
|
2055
|
+
m = !0;
|
|
2056
2056
|
break;
|
|
2057
2057
|
}
|
|
2058
|
-
if (
|
|
2058
|
+
if (m || (a = Qe(u, r).trim(), !a) || u.sCount[r] - u.blkIndent >= 4 || (s = bt(a), s.length && s[0] === "" && s.shift(), s.length && s[s.length - 1] === "" && s.pop(), k += d - s.length, k > zc))
|
|
2059
2059
|
break;
|
|
2060
2060
|
if (r === e + 2) {
|
|
2061
|
-
const
|
|
2062
|
-
|
|
2061
|
+
const F = u.push("tbody_open", "tbody", 1);
|
|
2062
|
+
F.map = E = [e + 2, 0];
|
|
2063
2063
|
}
|
|
2064
2064
|
const A = u.push("tr_open", "tr", 1);
|
|
2065
2065
|
A.map = [r, r + 1];
|
|
2066
|
-
for (let
|
|
2066
|
+
for (let F = 0; F < d; F++) {
|
|
2067
2067
|
const M = u.push("td_open", "td", 1);
|
|
2068
|
-
|
|
2069
|
-
const
|
|
2070
|
-
|
|
2068
|
+
f[F] && (M.attrs = [["style", "text-align:" + f[F]]]);
|
|
2069
|
+
const V = u.push("inline", "", 0);
|
|
2070
|
+
V.content = s[F] ? s[F].trim() : "", V.children = [], u.push("td_close", "td", -1);
|
|
2071
2071
|
}
|
|
2072
2072
|
u.push("tr_close", "tr", -1);
|
|
2073
2073
|
}
|
|
2074
|
-
return E && (u.push("tbody_close", "tbody", -1), E[1] = r), u.push("table_close", "table", -1), C[1] = r, u.parentType =
|
|
2074
|
+
return E && (u.push("tbody_close", "tbody", -1), E[1] = r), u.push("table_close", "table", -1), C[1] = r, u.parentType = _, u.line = r, !0;
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function Uc(u, e, t) {
|
|
2077
2077
|
if (u.sCount[e] - u.blkIndent < 4)
|
|
2078
2078
|
return !1;
|
|
2079
2079
|
let n = e + 1, r = n;
|
|
@@ -2089,124 +2089,124 @@ function Ho(u, e, t) {
|
|
|
2089
2089
|
break;
|
|
2090
2090
|
}
|
|
2091
2091
|
u.line = r;
|
|
2092
|
-
const
|
|
2093
|
-
return
|
|
2094
|
-
`,
|
|
2092
|
+
const c = u.push("code_block", "code", 0);
|
|
2093
|
+
return c.content = u.getLines(e, r, 4 + u.blkIndent, !1) + `
|
|
2094
|
+
`, c.map = [e, u.line], !0;
|
|
2095
2095
|
}
|
|
2096
|
-
function
|
|
2097
|
-
let r = u.bMarks[e] + u.tShift[e],
|
|
2098
|
-
if (u.sCount[e] - u.blkIndent >= 4 || r + 3 >
|
|
2096
|
+
function Hc(u, e, t, n) {
|
|
2097
|
+
let r = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
|
2098
|
+
if (u.sCount[e] - u.blkIndent >= 4 || r + 3 > c)
|
|
2099
2099
|
return !1;
|
|
2100
2100
|
const i = u.src.charCodeAt(r);
|
|
2101
2101
|
if (i !== 126 && i !== 96)
|
|
2102
2102
|
return !1;
|
|
2103
|
-
let
|
|
2103
|
+
let o = r;
|
|
2104
2104
|
r = u.skipChars(r, i);
|
|
2105
|
-
let a = r -
|
|
2105
|
+
let a = r - o;
|
|
2106
2106
|
if (a < 3)
|
|
2107
2107
|
return !1;
|
|
2108
|
-
const s = u.src.slice(
|
|
2109
|
-
if (i === 96 &&
|
|
2108
|
+
const s = u.src.slice(o, r), f = u.src.slice(r, c);
|
|
2109
|
+
if (i === 96 && f.indexOf(String.fromCharCode(i)) >= 0)
|
|
2110
2110
|
return !1;
|
|
2111
2111
|
if (n)
|
|
2112
2112
|
return !0;
|
|
2113
|
-
let
|
|
2114
|
-
for (;
|
|
2115
|
-
if (u.src.charCodeAt(r) === i && !(u.sCount[
|
|
2116
|
-
|
|
2113
|
+
let d = e, _ = !1;
|
|
2114
|
+
for (; d++, !(d >= t || (r = o = u.bMarks[d] + u.tShift[d], c = u.eMarks[d], r < c && u.sCount[d] < u.blkIndent)); )
|
|
2115
|
+
if (u.src.charCodeAt(r) === i && !(u.sCount[d] - u.blkIndent >= 4) && (r = u.skipChars(r, i), !(r - o < a) && (r = u.skipSpaces(r), !(r < c)))) {
|
|
2116
|
+
_ = !0;
|
|
2117
2117
|
break;
|
|
2118
2118
|
}
|
|
2119
|
-
a = u.sCount[e], u.line =
|
|
2120
|
-
const
|
|
2121
|
-
return
|
|
2119
|
+
a = u.sCount[e], u.line = d + (_ ? 1 : 0);
|
|
2120
|
+
const b = u.push("fence", "code", 0);
|
|
2121
|
+
return b.info = f, b.content = u.getLines(e + 1, d, a, !0), b.markup = s, b.map = [e, u.line], !0;
|
|
2122
2122
|
}
|
|
2123
|
-
function
|
|
2124
|
-
let r = u.bMarks[e] + u.tShift[e],
|
|
2123
|
+
function $c(u, e, t, n) {
|
|
2124
|
+
let r = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
|
2125
2125
|
const i = u.lineMax;
|
|
2126
2126
|
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(r) !== 62)
|
|
2127
2127
|
return !1;
|
|
2128
2128
|
if (n)
|
|
2129
2129
|
return !0;
|
|
2130
|
-
const
|
|
2130
|
+
const o = [], a = [], s = [], f = [], d = u.md.block.ruler.getRules("blockquote"), _ = u.parentType;
|
|
2131
2131
|
u.parentType = "blockquote";
|
|
2132
|
-
let
|
|
2133
|
-
for (
|
|
2134
|
-
const k = u.sCount[
|
|
2135
|
-
if (r = u.bMarks[
|
|
2132
|
+
let b = !1, h;
|
|
2133
|
+
for (h = e; h < t; h++) {
|
|
2134
|
+
const k = u.sCount[h] < u.blkIndent;
|
|
2135
|
+
if (r = u.bMarks[h] + u.tShift[h], c = u.eMarks[h], r >= c)
|
|
2136
2136
|
break;
|
|
2137
2137
|
if (u.src.charCodeAt(r++) === 62 && !k) {
|
|
2138
|
-
let A = u.sCount[
|
|
2139
|
-
u.src.charCodeAt(r) === 32 ? (r++, A++, M = !1,
|
|
2140
|
-
let
|
|
2141
|
-
for (
|
|
2142
|
-
const
|
|
2143
|
-
if (
|
|
2144
|
-
|
|
2138
|
+
let A = u.sCount[h] + 1, F, M;
|
|
2139
|
+
u.src.charCodeAt(r) === 32 ? (r++, A++, M = !1, F = !0) : u.src.charCodeAt(r) === 9 ? (F = !0, (u.bsCount[h] + A) % 4 === 3 ? (r++, A++, M = !1) : M = !0) : F = !1;
|
|
2140
|
+
let V = A;
|
|
2141
|
+
for (o.push(u.bMarks[h]), u.bMarks[h] = r; r < c; ) {
|
|
2142
|
+
const tu = u.src.charCodeAt(r);
|
|
2143
|
+
if (S(tu))
|
|
2144
|
+
tu === 9 ? V += 4 - (V + u.bsCount[h] + (M ? 1 : 0)) % 4 : V++;
|
|
2145
2145
|
else
|
|
2146
2146
|
break;
|
|
2147
2147
|
r++;
|
|
2148
2148
|
}
|
|
2149
|
-
|
|
2149
|
+
b = r >= c, a.push(u.bsCount[h]), u.bsCount[h] = u.sCount[h] + 1 + (F ? 1 : 0), s.push(u.sCount[h]), u.sCount[h] = V - A, f.push(u.tShift[h]), u.tShift[h] = r - u.bMarks[h];
|
|
2150
2150
|
continue;
|
|
2151
2151
|
}
|
|
2152
|
-
if (
|
|
2152
|
+
if (b)
|
|
2153
2153
|
break;
|
|
2154
|
-
let
|
|
2155
|
-
for (let A = 0,
|
|
2156
|
-
if (
|
|
2157
|
-
|
|
2154
|
+
let m = !1;
|
|
2155
|
+
for (let A = 0, F = d.length; A < F; A++)
|
|
2156
|
+
if (d[A](u, h, t, !0)) {
|
|
2157
|
+
m = !0;
|
|
2158
2158
|
break;
|
|
2159
2159
|
}
|
|
2160
|
-
if (
|
|
2161
|
-
u.lineMax =
|
|
2160
|
+
if (m) {
|
|
2161
|
+
u.lineMax = h, u.blkIndent !== 0 && (o.push(u.bMarks[h]), a.push(u.bsCount[h]), f.push(u.tShift[h]), s.push(u.sCount[h]), u.sCount[h] -= u.blkIndent);
|
|
2162
2162
|
break;
|
|
2163
2163
|
}
|
|
2164
|
-
|
|
2164
|
+
o.push(u.bMarks[h]), a.push(u.bsCount[h]), f.push(u.tShift[h]), s.push(u.sCount[h]), u.sCount[h] = -1;
|
|
2165
2165
|
}
|
|
2166
2166
|
const C = u.blkIndent;
|
|
2167
2167
|
u.blkIndent = 0;
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2168
|
+
const y = u.push("blockquote_open", "blockquote", 1);
|
|
2169
|
+
y.markup = ">";
|
|
2170
2170
|
const T = [e, 0];
|
|
2171
|
-
|
|
2171
|
+
y.map = T, u.md.block.tokenize(u, e, h);
|
|
2172
2172
|
const E = u.push("blockquote_close", "blockquote", -1);
|
|
2173
|
-
E.markup = ">", u.lineMax = i, u.parentType =
|
|
2174
|
-
for (let k = 0; k <
|
|
2175
|
-
u.bMarks[k + e] =
|
|
2173
|
+
E.markup = ">", u.lineMax = i, u.parentType = _, T[1] = u.line;
|
|
2174
|
+
for (let k = 0; k < f.length; k++)
|
|
2175
|
+
u.bMarks[k + e] = o[k], u.tShift[k + e] = f[k], u.sCount[k + e] = s[k], u.bsCount[k + e] = a[k];
|
|
2176
2176
|
return u.blkIndent = C, !0;
|
|
2177
2177
|
}
|
|
2178
|
-
function
|
|
2178
|
+
function jc(u, e, t, n) {
|
|
2179
2179
|
const r = u.eMarks[e];
|
|
2180
2180
|
if (u.sCount[e] - u.blkIndent >= 4)
|
|
2181
2181
|
return !1;
|
|
2182
|
-
let
|
|
2183
|
-
const i = u.src.charCodeAt(
|
|
2182
|
+
let c = u.bMarks[e] + u.tShift[e];
|
|
2183
|
+
const i = u.src.charCodeAt(c++);
|
|
2184
2184
|
if (i !== 42 && i !== 45 && i !== 95)
|
|
2185
2185
|
return !1;
|
|
2186
|
-
let
|
|
2187
|
-
for (;
|
|
2188
|
-
const s = u.src.charCodeAt(
|
|
2189
|
-
if (s !== i && !
|
|
2186
|
+
let o = 1;
|
|
2187
|
+
for (; c < r; ) {
|
|
2188
|
+
const s = u.src.charCodeAt(c++);
|
|
2189
|
+
if (s !== i && !S(s))
|
|
2190
2190
|
return !1;
|
|
2191
|
-
s === i &&
|
|
2191
|
+
s === i && o++;
|
|
2192
2192
|
}
|
|
2193
|
-
if (
|
|
2193
|
+
if (o < 3)
|
|
2194
2194
|
return !1;
|
|
2195
2195
|
if (n)
|
|
2196
2196
|
return !0;
|
|
2197
2197
|
u.line = e + 1;
|
|
2198
2198
|
const a = u.push("hr", "hr", 0);
|
|
2199
|
-
return a.map = [e, u.line], a.markup = Array(
|
|
2199
|
+
return a.map = [e, u.line], a.markup = Array(o + 1).join(String.fromCharCode(i)), !0;
|
|
2200
2200
|
}
|
|
2201
|
-
function
|
|
2201
|
+
function pt(u, e) {
|
|
2202
2202
|
const t = u.eMarks[e];
|
|
2203
2203
|
let n = u.bMarks[e] + u.tShift[e];
|
|
2204
2204
|
const r = u.src.charCodeAt(n++);
|
|
2205
2205
|
if (r !== 42 && r !== 45 && r !== 43)
|
|
2206
2206
|
return -1;
|
|
2207
2207
|
if (n < t) {
|
|
2208
|
-
const
|
|
2209
|
-
if (!
|
|
2208
|
+
const c = u.src.charCodeAt(n);
|
|
2209
|
+
if (!S(c))
|
|
2210
2210
|
return -1;
|
|
2211
2211
|
}
|
|
2212
2212
|
return n;
|
|
@@ -2216,122 +2216,122 @@ function _t(u, e) {
|
|
|
2216
2216
|
let r = t;
|
|
2217
2217
|
if (r + 1 >= n)
|
|
2218
2218
|
return -1;
|
|
2219
|
-
let
|
|
2220
|
-
if (
|
|
2219
|
+
let c = u.src.charCodeAt(r++);
|
|
2220
|
+
if (c < 48 || c > 57)
|
|
2221
2221
|
return -1;
|
|
2222
2222
|
for (; ; ) {
|
|
2223
2223
|
if (r >= n)
|
|
2224
2224
|
return -1;
|
|
2225
|
-
if (
|
|
2225
|
+
if (c = u.src.charCodeAt(r++), c >= 48 && c <= 57) {
|
|
2226
2226
|
if (r - t >= 10)
|
|
2227
2227
|
return -1;
|
|
2228
2228
|
continue;
|
|
2229
2229
|
}
|
|
2230
|
-
if (
|
|
2230
|
+
if (c === 41 || c === 46)
|
|
2231
2231
|
break;
|
|
2232
2232
|
return -1;
|
|
2233
2233
|
}
|
|
2234
|
-
return r < n && (
|
|
2234
|
+
return r < n && (c = u.src.charCodeAt(r), !S(c)) ? -1 : r;
|
|
2235
2235
|
}
|
|
2236
|
-
function
|
|
2236
|
+
function Gc(u, e) {
|
|
2237
2237
|
const t = u.level + 2;
|
|
2238
2238
|
for (let n = e + 2, r = u.tokens.length - 2; n < r; n++)
|
|
2239
2239
|
u.tokens[n].level === t && u.tokens[n].type === "paragraph_open" && (u.tokens[n + 2].hidden = !0, u.tokens[n].hidden = !0, n += 2);
|
|
2240
2240
|
}
|
|
2241
|
-
function
|
|
2242
|
-
let r,
|
|
2241
|
+
function Wc(u, e, t, n) {
|
|
2242
|
+
let r, c, i, o, a = e, s = !0;
|
|
2243
2243
|
if (u.sCount[a] - u.blkIndent >= 4 || u.listIndent >= 0 && u.sCount[a] - u.listIndent >= 4 && u.sCount[a] < u.blkIndent)
|
|
2244
2244
|
return !1;
|
|
2245
|
-
let
|
|
2246
|
-
n && u.parentType === "paragraph" && u.sCount[a] >= u.blkIndent && (
|
|
2247
|
-
let
|
|
2248
|
-
if ((
|
|
2249
|
-
if (
|
|
2250
|
-
} else if ((
|
|
2251
|
-
|
|
2245
|
+
let f = !1;
|
|
2246
|
+
n && u.parentType === "paragraph" && u.sCount[a] >= u.blkIndent && (f = !0);
|
|
2247
|
+
let d, _, b;
|
|
2248
|
+
if ((b = _t(u, a)) >= 0) {
|
|
2249
|
+
if (d = !0, i = u.bMarks[a] + u.tShift[a], _ = Number(u.src.slice(i, b - 1)), f && _ !== 1) return !1;
|
|
2250
|
+
} else if ((b = pt(u, a)) >= 0)
|
|
2251
|
+
d = !1;
|
|
2252
2252
|
else
|
|
2253
2253
|
return !1;
|
|
2254
|
-
if (
|
|
2254
|
+
if (f && u.skipSpaces(b) >= u.eMarks[a])
|
|
2255
2255
|
return !1;
|
|
2256
2256
|
if (n)
|
|
2257
2257
|
return !0;
|
|
2258
|
-
const
|
|
2259
|
-
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2258
|
+
const h = u.src.charCodeAt(b - 1), C = u.tokens.length;
|
|
2259
|
+
d ? (o = u.push("ordered_list_open", "ol", 1), _ !== 1 && (o.attrs = [["start", _]])) : o = u.push("bullet_list_open", "ul", 1);
|
|
2260
|
+
const y = [a, 0];
|
|
2261
|
+
o.map = y, o.markup = String.fromCharCode(h);
|
|
2262
2262
|
let T = !1;
|
|
2263
2263
|
const E = u.md.block.ruler.getRules("list"), k = u.parentType;
|
|
2264
2264
|
for (u.parentType = "list"; a < t; ) {
|
|
2265
|
-
|
|
2266
|
-
const
|
|
2267
|
-
let A =
|
|
2268
|
-
for (;
|
|
2269
|
-
const
|
|
2270
|
-
if (
|
|
2265
|
+
c = b, r = u.eMarks[a];
|
|
2266
|
+
const m = u.sCount[a] + b - (u.bMarks[a] + u.tShift[a]);
|
|
2267
|
+
let A = m;
|
|
2268
|
+
for (; c < r; ) {
|
|
2269
|
+
const bu = u.src.charCodeAt(c);
|
|
2270
|
+
if (bu === 9)
|
|
2271
2271
|
A += 4 - (A + u.bsCount[a]) % 4;
|
|
2272
|
-
else if (
|
|
2272
|
+
else if (bu === 32)
|
|
2273
2273
|
A++;
|
|
2274
2274
|
else
|
|
2275
2275
|
break;
|
|
2276
|
-
|
|
2276
|
+
c++;
|
|
2277
2277
|
}
|
|
2278
|
-
const
|
|
2278
|
+
const F = c;
|
|
2279
2279
|
let M;
|
|
2280
|
-
|
|
2281
|
-
const
|
|
2282
|
-
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
const
|
|
2286
|
-
if (u.listIndent = u.blkIndent, u.blkIndent =
|
|
2280
|
+
F >= r ? M = 1 : M = A - m, M > 4 && (M = 1);
|
|
2281
|
+
const V = m + M;
|
|
2282
|
+
o = u.push("list_item_open", "li", 1), o.markup = String.fromCharCode(h);
|
|
2283
|
+
const tu = [a, 0];
|
|
2284
|
+
o.map = tu, d && (o.info = u.src.slice(i, b - 1));
|
|
2285
|
+
const ku = u.tight, L = u.tShift[a], Hu = u.sCount[a], $u = u.listIndent;
|
|
2286
|
+
if (u.listIndent = u.blkIndent, u.blkIndent = V, u.tight = !0, u.tShift[a] = F - u.bMarks[a], u.sCount[a] = A, F >= r && u.isEmpty(a + 1) ? u.line = Math.min(u.line + 2, t) : u.md.block.tokenize(u, a, t, !0), (!u.tight || T) && (s = !1), T = u.line - a > 1 && u.isEmpty(u.line - 1), u.blkIndent = u.listIndent, u.listIndent = $u, u.tShift[a] = L, u.sCount[a] = Hu, u.tight = ku, o = u.push("list_item_close", "li", -1), o.markup = String.fromCharCode(h), a = u.line, tu[1] = a, a >= t || u.sCount[a] < u.blkIndent || u.sCount[a] - u.blkIndent >= 4)
|
|
2287
2287
|
break;
|
|
2288
|
-
let
|
|
2289
|
-
for (let
|
|
2290
|
-
if (E[
|
|
2291
|
-
|
|
2288
|
+
let Tu = !1;
|
|
2289
|
+
for (let bu = 0, ve = E.length; bu < ve; bu++)
|
|
2290
|
+
if (E[bu](u, a, t, !0)) {
|
|
2291
|
+
Tu = !0;
|
|
2292
2292
|
break;
|
|
2293
2293
|
}
|
|
2294
|
-
if (
|
|
2294
|
+
if (Tu)
|
|
2295
2295
|
break;
|
|
2296
|
-
if (
|
|
2297
|
-
if (
|
|
2296
|
+
if (d) {
|
|
2297
|
+
if (b = _t(u, a), b < 0)
|
|
2298
2298
|
break;
|
|
2299
2299
|
i = u.bMarks[a] + u.tShift[a];
|
|
2300
|
-
} else if (
|
|
2300
|
+
} else if (b = pt(u, a), b < 0)
|
|
2301
2301
|
break;
|
|
2302
|
-
if (
|
|
2302
|
+
if (h !== u.src.charCodeAt(b - 1))
|
|
2303
2303
|
break;
|
|
2304
2304
|
}
|
|
2305
|
-
return
|
|
2305
|
+
return d ? o = u.push("ordered_list_close", "ol", -1) : o = u.push("bullet_list_close", "ul", -1), o.markup = String.fromCharCode(h), y[1] = a, u.line = a, u.parentType = k, s && Gc(u, C), !0;
|
|
2306
2306
|
}
|
|
2307
|
-
function
|
|
2308
|
-
let r = u.bMarks[e] + u.tShift[e],
|
|
2307
|
+
function Zc(u, e, t, n) {
|
|
2308
|
+
let r = u.bMarks[e] + u.tShift[e], c = u.eMarks[e], i = e + 1;
|
|
2309
2309
|
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(r) !== 91)
|
|
2310
2310
|
return !1;
|
|
2311
|
-
function
|
|
2311
|
+
function o(E) {
|
|
2312
2312
|
const k = u.lineMax;
|
|
2313
2313
|
if (E >= k || u.isEmpty(E))
|
|
2314
2314
|
return null;
|
|
2315
|
-
let
|
|
2316
|
-
if (u.sCount[E] - u.blkIndent > 3 && (
|
|
2317
|
-
const M = u.md.block.ruler.getRules("reference"),
|
|
2315
|
+
let m = !1;
|
|
2316
|
+
if (u.sCount[E] - u.blkIndent > 3 && (m = !0), u.sCount[E] < 0 && (m = !0), !m) {
|
|
2317
|
+
const M = u.md.block.ruler.getRules("reference"), V = u.parentType;
|
|
2318
2318
|
u.parentType = "reference";
|
|
2319
|
-
let
|
|
2320
|
-
for (let
|
|
2321
|
-
if (M[
|
|
2322
|
-
|
|
2319
|
+
let tu = !1;
|
|
2320
|
+
for (let ku = 0, L = M.length; ku < L; ku++)
|
|
2321
|
+
if (M[ku](u, E, k, !0)) {
|
|
2322
|
+
tu = !0;
|
|
2323
2323
|
break;
|
|
2324
2324
|
}
|
|
2325
|
-
if (u.parentType =
|
|
2325
|
+
if (u.parentType = V, tu)
|
|
2326
2326
|
return null;
|
|
2327
2327
|
}
|
|
2328
|
-
const A = u.bMarks[E] + u.tShift[E],
|
|
2329
|
-
return u.src.slice(A,
|
|
2328
|
+
const A = u.bMarks[E] + u.tShift[E], F = u.eMarks[E];
|
|
2329
|
+
return u.src.slice(A, F + 1);
|
|
2330
2330
|
}
|
|
2331
|
-
let a = u.src.slice(r,
|
|
2332
|
-
|
|
2331
|
+
let a = u.src.slice(r, c + 1);
|
|
2332
|
+
c = a.length;
|
|
2333
2333
|
let s = -1;
|
|
2334
|
-
for (r = 1; r <
|
|
2334
|
+
for (r = 1; r < c; r++) {
|
|
2335
2335
|
const E = a.charCodeAt(r);
|
|
2336
2336
|
if (E === 91)
|
|
2337
2337
|
return !1;
|
|
@@ -2339,63 +2339,63 @@ function Vo(u, e, t, n) {
|
|
|
2339
2339
|
s = r;
|
|
2340
2340
|
break;
|
|
2341
2341
|
} else if (E === 10) {
|
|
2342
|
-
const k =
|
|
2343
|
-
k !== null && (a += k,
|
|
2344
|
-
} else if (E === 92 && (r++, r <
|
|
2345
|
-
const k =
|
|
2346
|
-
k !== null && (a += k,
|
|
2342
|
+
const k = o(i);
|
|
2343
|
+
k !== null && (a += k, c = a.length, i++);
|
|
2344
|
+
} else if (E === 92 && (r++, r < c && a.charCodeAt(r) === 10)) {
|
|
2345
|
+
const k = o(i);
|
|
2346
|
+
k !== null && (a += k, c = a.length, i++);
|
|
2347
2347
|
}
|
|
2348
2348
|
}
|
|
2349
2349
|
if (s < 0 || a.charCodeAt(s + 1) !== 58)
|
|
2350
2350
|
return !1;
|
|
2351
|
-
for (r = s + 2; r <
|
|
2351
|
+
for (r = s + 2; r < c; r++) {
|
|
2352
2352
|
const E = a.charCodeAt(r);
|
|
2353
2353
|
if (E === 10) {
|
|
2354
|
-
const k =
|
|
2355
|
-
k !== null && (a += k,
|
|
2356
|
-
} else if (!
|
|
2354
|
+
const k = o(i);
|
|
2355
|
+
k !== null && (a += k, c = a.length, i++);
|
|
2356
|
+
} else if (!S(E)) break;
|
|
2357
2357
|
}
|
|
2358
|
-
const
|
|
2359
|
-
if (!
|
|
2358
|
+
const f = u.md.helpers.parseLinkDestination(a, r, c);
|
|
2359
|
+
if (!f.ok)
|
|
2360
2360
|
return !1;
|
|
2361
|
-
const
|
|
2362
|
-
if (!u.md.validateLink(
|
|
2361
|
+
const d = u.md.normalizeLink(f.str);
|
|
2362
|
+
if (!u.md.validateLink(d))
|
|
2363
2363
|
return !1;
|
|
2364
|
-
r =
|
|
2365
|
-
const
|
|
2366
|
-
for (; r <
|
|
2364
|
+
r = f.pos;
|
|
2365
|
+
const _ = r, b = i, h = r;
|
|
2366
|
+
for (; r < c; r++) {
|
|
2367
2367
|
const E = a.charCodeAt(r);
|
|
2368
2368
|
if (E === 10) {
|
|
2369
|
-
const k =
|
|
2370
|
-
k !== null && (a += k,
|
|
2371
|
-
} else if (!
|
|
2369
|
+
const k = o(i);
|
|
2370
|
+
k !== null && (a += k, c = a.length, i++);
|
|
2371
|
+
} else if (!S(E)) break;
|
|
2372
2372
|
}
|
|
2373
|
-
let C = u.md.helpers.parseLinkTitle(a, r,
|
|
2373
|
+
let C = u.md.helpers.parseLinkTitle(a, r, c);
|
|
2374
2374
|
for (; C.can_continue; ) {
|
|
2375
|
-
const E =
|
|
2375
|
+
const E = o(i);
|
|
2376
2376
|
if (E === null) break;
|
|
2377
|
-
a += E, r =
|
|
2377
|
+
a += E, r = c, c = a.length, i++, C = u.md.helpers.parseLinkTitle(a, r, c, C);
|
|
2378
2378
|
}
|
|
2379
|
-
let
|
|
2380
|
-
for (r <
|
|
2379
|
+
let y;
|
|
2380
|
+
for (r < c && h !== r && C.ok ? (y = C.str, r = C.pos) : (y = "", r = _, i = b); r < c; ) {
|
|
2381
2381
|
const E = a.charCodeAt(r);
|
|
2382
|
-
if (!
|
|
2382
|
+
if (!S(E))
|
|
2383
2383
|
break;
|
|
2384
2384
|
r++;
|
|
2385
2385
|
}
|
|
2386
|
-
if (r <
|
|
2387
|
-
for (
|
|
2386
|
+
if (r < c && a.charCodeAt(r) !== 10 && y)
|
|
2387
|
+
for (y = "", r = _, i = b; r < c; ) {
|
|
2388
2388
|
const E = a.charCodeAt(r);
|
|
2389
|
-
if (!
|
|
2389
|
+
if (!S(E))
|
|
2390
2390
|
break;
|
|
2391
2391
|
r++;
|
|
2392
2392
|
}
|
|
2393
|
-
if (r <
|
|
2393
|
+
if (r < c && a.charCodeAt(r) !== 10)
|
|
2394
2394
|
return !1;
|
|
2395
|
-
const T =
|
|
2396
|
-
return T ? (n || (typeof u.env.references > "u" && (u.env.references = {}), typeof u.env.references[T] > "u" && (u.env.references[T] = { title:
|
|
2395
|
+
const T = Te(a.slice(1, s));
|
|
2396
|
+
return T ? (n || (typeof u.env.references > "u" && (u.env.references = {}), typeof u.env.references[T] > "u" && (u.env.references[T] = { title: y, href: d }), u.line = i), !0) : !1;
|
|
2397
2397
|
}
|
|
2398
|
-
const
|
|
2398
|
+
const Vc = [
|
|
2399
2399
|
"address",
|
|
2400
2400
|
"article",
|
|
2401
2401
|
"aside",
|
|
@@ -2458,30 +2458,30 @@ const Yo = [
|
|
|
2458
2458
|
"tr",
|
|
2459
2459
|
"track",
|
|
2460
2460
|
"ul"
|
|
2461
|
-
],
|
|
2461
|
+
], Yc = "[a-zA-Z_:][a-zA-Z0-9:._-]*", Xc = "[^\"'=<>`\\x00-\\x20]+", Jc = "'[^']*'", Qc = '"[^"]*"', Kc = "(?:" + Xc + "|" + Jc + "|" + Qc + ")", uo = "(?:\\s+" + Yc + "(?:\\s*=\\s*" + Kc + ")?)", Ht = "<[A-Za-z][A-Za-z0-9\\-]*" + uo + "*\\s*\\/?>", $t = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", eo = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->", to = "<[?][\\s\\S]*?[?]>", no = "<![A-Za-z][^>]*>", ro = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>", co = new RegExp("^(?:" + Ht + "|" + $t + "|" + eo + "|" + to + "|" + no + "|" + ro + ")"), oo = new RegExp("^(?:" + Ht + "|" + $t + ")"), Nu = [
|
|
2462
2462
|
[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, !0],
|
|
2463
2463
|
[/^<!--/, /-->/, !0],
|
|
2464
2464
|
[/^<\?/, /\?>/, !0],
|
|
2465
2465
|
[/^<![A-Z]/, />/, !0],
|
|
2466
2466
|
[/^<!\[CDATA\[/, /\]\]>/, !0],
|
|
2467
|
-
[new RegExp("^</?(" +
|
|
2468
|
-
[new RegExp(
|
|
2467
|
+
[new RegExp("^</?(" + Vc.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, !0],
|
|
2468
|
+
[new RegExp(oo.source + "\\s*$"), /^$/, !1]
|
|
2469
2469
|
];
|
|
2470
|
-
function
|
|
2471
|
-
let r = u.bMarks[e] + u.tShift[e],
|
|
2470
|
+
function io(u, e, t, n) {
|
|
2471
|
+
let r = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
|
2472
2472
|
if (u.sCount[e] - u.blkIndent >= 4 || !u.md.options.html || u.src.charCodeAt(r) !== 60)
|
|
2473
2473
|
return !1;
|
|
2474
|
-
let i = u.src.slice(r,
|
|
2475
|
-
for (;
|
|
2474
|
+
let i = u.src.slice(r, c), o = 0;
|
|
2475
|
+
for (; o < Nu.length && !Nu[o][0].test(i); o++)
|
|
2476
2476
|
;
|
|
2477
|
-
if (
|
|
2477
|
+
if (o === Nu.length)
|
|
2478
2478
|
return !1;
|
|
2479
2479
|
if (n)
|
|
2480
|
-
return Nu[
|
|
2480
|
+
return Nu[o][2];
|
|
2481
2481
|
let a = e + 1;
|
|
2482
|
-
if (!Nu[
|
|
2482
|
+
if (!Nu[o][1].test(i)) {
|
|
2483
2483
|
for (; a < t && !(u.sCount[a] < u.blkIndent); a++)
|
|
2484
|
-
if (r = u.bMarks[a] + u.tShift[a],
|
|
2484
|
+
if (r = u.bMarks[a] + u.tShift[a], c = u.eMarks[a], i = u.src.slice(r, c), Nu[o][1].test(i)) {
|
|
2485
2485
|
i.length !== 0 && a++;
|
|
2486
2486
|
break;
|
|
2487
2487
|
}
|
|
@@ -2490,162 +2490,162 @@ function ac(u, e, t, n) {
|
|
|
2490
2490
|
const s = u.push("html_block", "", 0);
|
|
2491
2491
|
return s.map = [e, a], s.content = u.getLines(e, a, u.blkIndent, !0), !0;
|
|
2492
2492
|
}
|
|
2493
|
-
function
|
|
2494
|
-
let r = u.bMarks[e] + u.tShift[e],
|
|
2493
|
+
function ao(u, e, t, n) {
|
|
2494
|
+
let r = u.bMarks[e] + u.tShift[e], c = u.eMarks[e];
|
|
2495
2495
|
if (u.sCount[e] - u.blkIndent >= 4)
|
|
2496
2496
|
return !1;
|
|
2497
2497
|
let i = u.src.charCodeAt(r);
|
|
2498
|
-
if (i !== 35 || r >=
|
|
2498
|
+
if (i !== 35 || r >= c)
|
|
2499
2499
|
return !1;
|
|
2500
|
-
let
|
|
2501
|
-
for (i = u.src.charCodeAt(++r); i === 35 && r <
|
|
2502
|
-
|
|
2503
|
-
if (
|
|
2500
|
+
let o = 1;
|
|
2501
|
+
for (i = u.src.charCodeAt(++r); i === 35 && r < c && o <= 6; )
|
|
2502
|
+
o++, i = u.src.charCodeAt(++r);
|
|
2503
|
+
if (o > 6 || r < c && !S(i))
|
|
2504
2504
|
return !1;
|
|
2505
2505
|
if (n)
|
|
2506
2506
|
return !0;
|
|
2507
|
-
|
|
2508
|
-
const a = u.skipCharsBack(
|
|
2509
|
-
a > r &&
|
|
2510
|
-
const s = u.push("heading_open", "h" + String(
|
|
2511
|
-
s.markup = "########".slice(0,
|
|
2512
|
-
const
|
|
2513
|
-
|
|
2514
|
-
const
|
|
2515
|
-
return
|
|
2507
|
+
c = u.skipSpacesBack(c, r);
|
|
2508
|
+
const a = u.skipCharsBack(c, 35, r);
|
|
2509
|
+
a > r && S(u.src.charCodeAt(a - 1)) && (c = a), u.line = e + 1;
|
|
2510
|
+
const s = u.push("heading_open", "h" + String(o), 1);
|
|
2511
|
+
s.markup = "########".slice(0, o), s.map = [e, u.line];
|
|
2512
|
+
const f = u.push("inline", "", 0);
|
|
2513
|
+
f.content = u.src.slice(r, c).trim(), f.map = [e, u.line], f.children = [];
|
|
2514
|
+
const d = u.push("heading_close", "h" + String(o), -1);
|
|
2515
|
+
return d.markup = "########".slice(0, o), !0;
|
|
2516
2516
|
}
|
|
2517
|
-
function
|
|
2517
|
+
function so(u, e, t) {
|
|
2518
2518
|
const n = u.md.block.ruler.getRules("paragraph");
|
|
2519
2519
|
if (u.sCount[e] - u.blkIndent >= 4)
|
|
2520
2520
|
return !1;
|
|
2521
2521
|
const r = u.parentType;
|
|
2522
2522
|
u.parentType = "paragraph";
|
|
2523
|
-
let
|
|
2524
|
-
for (;
|
|
2525
|
-
if (u.sCount[
|
|
2523
|
+
let c = 0, i, o = e + 1;
|
|
2524
|
+
for (; o < t && !u.isEmpty(o); o++) {
|
|
2525
|
+
if (u.sCount[o] - u.blkIndent > 3)
|
|
2526
2526
|
continue;
|
|
2527
|
-
if (u.sCount[
|
|
2528
|
-
let
|
|
2529
|
-
const
|
|
2530
|
-
if (
|
|
2531
|
-
|
|
2527
|
+
if (u.sCount[o] >= u.blkIndent) {
|
|
2528
|
+
let b = u.bMarks[o] + u.tShift[o];
|
|
2529
|
+
const h = u.eMarks[o];
|
|
2530
|
+
if (b < h && (i = u.src.charCodeAt(b), (i === 45 || i === 61) && (b = u.skipChars(b, i), b = u.skipSpaces(b), b >= h))) {
|
|
2531
|
+
c = i === 61 ? 1 : 2;
|
|
2532
2532
|
break;
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
|
-
if (u.sCount[
|
|
2535
|
+
if (u.sCount[o] < 0)
|
|
2536
2536
|
continue;
|
|
2537
|
-
let
|
|
2538
|
-
for (let
|
|
2539
|
-
if (n[
|
|
2540
|
-
|
|
2537
|
+
let _ = !1;
|
|
2538
|
+
for (let b = 0, h = n.length; b < h; b++)
|
|
2539
|
+
if (n[b](u, o, t, !0)) {
|
|
2540
|
+
_ = !0;
|
|
2541
2541
|
break;
|
|
2542
2542
|
}
|
|
2543
|
-
if (
|
|
2543
|
+
if (_)
|
|
2544
2544
|
break;
|
|
2545
2545
|
}
|
|
2546
|
-
if (!
|
|
2546
|
+
if (!c)
|
|
2547
2547
|
return !1;
|
|
2548
|
-
const a = u.getLines(e,
|
|
2549
|
-
u.line =
|
|
2550
|
-
const s = u.push("heading_open", "h" + String(
|
|
2548
|
+
const a = u.getLines(e, o, u.blkIndent, !1).trim();
|
|
2549
|
+
u.line = o + 1;
|
|
2550
|
+
const s = u.push("heading_open", "h" + String(c), 1);
|
|
2551
2551
|
s.markup = String.fromCharCode(i), s.map = [e, u.line];
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2554
|
-
const
|
|
2555
|
-
return
|
|
2552
|
+
const f = u.push("inline", "", 0);
|
|
2553
|
+
f.content = a, f.map = [e, u.line - 1], f.children = [];
|
|
2554
|
+
const d = u.push("heading_close", "h" + String(c), -1);
|
|
2555
|
+
return d.markup = String.fromCharCode(i), u.parentType = r, !0;
|
|
2556
2556
|
}
|
|
2557
|
-
function
|
|
2557
|
+
function lo(u, e, t) {
|
|
2558
2558
|
const n = u.md.block.ruler.getRules("paragraph"), r = u.parentType;
|
|
2559
|
-
let
|
|
2560
|
-
for (u.parentType = "paragraph";
|
|
2561
|
-
if (u.sCount[
|
|
2559
|
+
let c = e + 1;
|
|
2560
|
+
for (u.parentType = "paragraph"; c < t && !u.isEmpty(c); c++) {
|
|
2561
|
+
if (u.sCount[c] - u.blkIndent > 3 || u.sCount[c] < 0)
|
|
2562
2562
|
continue;
|
|
2563
2563
|
let s = !1;
|
|
2564
|
-
for (let
|
|
2565
|
-
if (n[
|
|
2564
|
+
for (let f = 0, d = n.length; f < d; f++)
|
|
2565
|
+
if (n[f](u, c, t, !0)) {
|
|
2566
2566
|
s = !0;
|
|
2567
2567
|
break;
|
|
2568
2568
|
}
|
|
2569
2569
|
if (s)
|
|
2570
2570
|
break;
|
|
2571
2571
|
}
|
|
2572
|
-
const i = u.getLines(e,
|
|
2573
|
-
u.line =
|
|
2574
|
-
const
|
|
2575
|
-
|
|
2572
|
+
const i = u.getLines(e, c, u.blkIndent, !1).trim();
|
|
2573
|
+
u.line = c;
|
|
2574
|
+
const o = u.push("paragraph_open", "p", 1);
|
|
2575
|
+
o.map = [e, u.line];
|
|
2576
2576
|
const a = u.push("inline", "", 0);
|
|
2577
2577
|
return a.content = i, a.map = [e, u.line], a.children = [], u.push("paragraph_close", "p", -1), u.parentType = r, !0;
|
|
2578
2578
|
}
|
|
2579
|
-
const
|
|
2579
|
+
const ge = [
|
|
2580
2580
|
// First 2 params - rule name & source. Secondary array - list of rules,
|
|
2581
2581
|
// which can be terminated by this one.
|
|
2582
|
-
["table",
|
|
2583
|
-
["code",
|
|
2584
|
-
["fence",
|
|
2585
|
-
["blockquote",
|
|
2586
|
-
["hr",
|
|
2587
|
-
["list",
|
|
2588
|
-
["reference",
|
|
2589
|
-
["html_block",
|
|
2590
|
-
["heading",
|
|
2591
|
-
["lheading",
|
|
2592
|
-
["paragraph",
|
|
2582
|
+
["table", qc, ["paragraph", "reference"]],
|
|
2583
|
+
["code", Uc],
|
|
2584
|
+
["fence", Hc, ["paragraph", "reference", "blockquote", "list"]],
|
|
2585
|
+
["blockquote", $c, ["paragraph", "reference", "blockquote", "list"]],
|
|
2586
|
+
["hr", jc, ["paragraph", "reference", "blockquote", "list"]],
|
|
2587
|
+
["list", Wc, ["paragraph", "reference", "blockquote"]],
|
|
2588
|
+
["reference", Zc],
|
|
2589
|
+
["html_block", io, ["paragraph", "reference", "blockquote"]],
|
|
2590
|
+
["heading", ao, ["paragraph", "reference", "blockquote"]],
|
|
2591
|
+
["lheading", so],
|
|
2592
|
+
["paragraph", lo]
|
|
2593
2593
|
];
|
|
2594
|
-
function
|
|
2595
|
-
this.ruler = new
|
|
2596
|
-
for (let u = 0; u <
|
|
2597
|
-
this.ruler.push(
|
|
2598
|
-
}
|
|
2599
|
-
|
|
2600
|
-
const n = this.ruler.getRules(""), r = n.length,
|
|
2601
|
-
let i = e,
|
|
2594
|
+
function Se() {
|
|
2595
|
+
this.ruler = new Z();
|
|
2596
|
+
for (let u = 0; u < ge.length; u++)
|
|
2597
|
+
this.ruler.push(ge[u][0], ge[u][1], { alt: (ge[u][2] || []).slice() });
|
|
2598
|
+
}
|
|
2599
|
+
Se.prototype.tokenize = function(u, e, t) {
|
|
2600
|
+
const n = this.ruler.getRules(""), r = n.length, c = u.md.options.maxNesting;
|
|
2601
|
+
let i = e, o = !1;
|
|
2602
2602
|
for (; i < t && (u.line = i = u.skipEmptyLines(i), !(i >= t || u.sCount[i] < u.blkIndent)); ) {
|
|
2603
|
-
if (u.level >=
|
|
2603
|
+
if (u.level >= c) {
|
|
2604
2604
|
u.line = t;
|
|
2605
2605
|
break;
|
|
2606
2606
|
}
|
|
2607
2607
|
const a = u.line;
|
|
2608
2608
|
let s = !1;
|
|
2609
|
-
for (let
|
|
2610
|
-
if (s = n[
|
|
2609
|
+
for (let f = 0; f < r; f++)
|
|
2610
|
+
if (s = n[f](u, i, t, !1), s) {
|
|
2611
2611
|
if (a >= u.line)
|
|
2612
2612
|
throw new Error("block rule didn't increment state.line");
|
|
2613
2613
|
break;
|
|
2614
2614
|
}
|
|
2615
2615
|
if (!s) throw new Error("none of the block rules matched");
|
|
2616
|
-
u.tight = !
|
|
2616
|
+
u.tight = !o, u.isEmpty(u.line - 1) && (o = !0), i = u.line, i < t && u.isEmpty(i) && (o = !0, i++, u.line = i);
|
|
2617
2617
|
}
|
|
2618
2618
|
};
|
|
2619
|
-
|
|
2619
|
+
Se.prototype.parse = function(u, e, t, n) {
|
|
2620
2620
|
if (!u)
|
|
2621
2621
|
return;
|
|
2622
2622
|
const r = new this.State(u, e, t, n);
|
|
2623
2623
|
this.tokenize(r, r.line, r.lineMax);
|
|
2624
2624
|
};
|
|
2625
|
-
|
|
2626
|
-
function
|
|
2625
|
+
Se.prototype.State = su;
|
|
2626
|
+
function ie(u, e, t, n) {
|
|
2627
2627
|
this.src = u, this.env = t, this.md = e, this.tokens = n, this.tokens_meta = Array(n.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;
|
|
2628
2628
|
}
|
|
2629
|
-
|
|
2630
|
-
const u = new
|
|
2629
|
+
ie.prototype.pushPending = function() {
|
|
2630
|
+
const u = new eu("text", "", 0);
|
|
2631
2631
|
return u.content = this.pending, u.level = this.pendingLevel, this.tokens.push(u), this.pending = "", u;
|
|
2632
2632
|
};
|
|
2633
|
-
|
|
2633
|
+
ie.prototype.push = function(u, e, t) {
|
|
2634
2634
|
this.pending && this.pushPending();
|
|
2635
|
-
const n = new
|
|
2635
|
+
const n = new eu(u, e, t);
|
|
2636
2636
|
let r = null;
|
|
2637
2637
|
return t < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()), n.level = this.level, t > 0 && (this.level++, this._prev_delimiters.push(this.delimiters), this.delimiters = [], r = { delimiters: this.delimiters }), this.pendingLevel = this.level, this.tokens.push(n), this.tokens_meta.push(r), n;
|
|
2638
2638
|
};
|
|
2639
|
-
|
|
2639
|
+
ie.prototype.scanDelims = function(u, e) {
|
|
2640
2640
|
const t = this.posMax, n = this.src.charCodeAt(u), r = u > 0 ? this.src.charCodeAt(u - 1) : 32;
|
|
2641
|
-
let
|
|
2642
|
-
for (;
|
|
2643
|
-
|
|
2644
|
-
const i =
|
|
2645
|
-
return { can_open:
|
|
2646
|
-
};
|
|
2647
|
-
|
|
2648
|
-
function
|
|
2641
|
+
let c = u;
|
|
2642
|
+
for (; c < t && this.src.charCodeAt(c) === n; )
|
|
2643
|
+
c++;
|
|
2644
|
+
const i = c - u, o = c < t ? this.src.charCodeAt(c) : 32, a = ee(r) || ue(String.fromCharCode(r)), s = ee(o) || ue(String.fromCharCode(o)), f = Ku(r), d = Ku(o), _ = !d && (!s || f || a), b = !f && (!a || d || s);
|
|
2645
|
+
return { can_open: _ && (e || !b || a), can_close: b && (e || !_ || s), length: i };
|
|
2646
|
+
};
|
|
2647
|
+
ie.prototype.Token = eu;
|
|
2648
|
+
function fo(u) {
|
|
2649
2649
|
switch (u) {
|
|
2650
2650
|
case 10:
|
|
2651
2651
|
case 33:
|
|
@@ -2675,38 +2675,38 @@ function dc(u) {
|
|
|
2675
2675
|
return !1;
|
|
2676
2676
|
}
|
|
2677
2677
|
}
|
|
2678
|
-
function
|
|
2678
|
+
function ho(u, e) {
|
|
2679
2679
|
let t = u.pos;
|
|
2680
|
-
for (; t < u.posMax && !
|
|
2680
|
+
for (; t < u.posMax && !fo(u.src.charCodeAt(t)); )
|
|
2681
2681
|
t++;
|
|
2682
2682
|
return t === u.pos ? !1 : (e || (u.pending += u.src.slice(u.pos, t)), u.pos = t, !0);
|
|
2683
2683
|
}
|
|
2684
|
-
const
|
|
2685
|
-
function
|
|
2684
|
+
const bo = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
|
|
2685
|
+
function po(u, e) {
|
|
2686
2686
|
if (!u.md.options.linkify || u.linkLevel > 0) return !1;
|
|
2687
2687
|
const t = u.pos, n = u.posMax;
|
|
2688
2688
|
if (t + 3 > n || u.src.charCodeAt(t) !== 58 || u.src.charCodeAt(t + 1) !== 47 || u.src.charCodeAt(t + 2) !== 47) return !1;
|
|
2689
|
-
const r = u.pending.match(
|
|
2689
|
+
const r = u.pending.match(bo);
|
|
2690
2690
|
if (!r) return !1;
|
|
2691
|
-
const
|
|
2691
|
+
const c = r[1], i = u.md.linkify.matchAtStart(u.src.slice(t - c.length));
|
|
2692
2692
|
if (!i) return !1;
|
|
2693
|
-
let
|
|
2694
|
-
if (
|
|
2695
|
-
|
|
2696
|
-
const a = u.md.normalizeLink(
|
|
2693
|
+
let o = i.url;
|
|
2694
|
+
if (o.length <= c.length) return !1;
|
|
2695
|
+
o = o.replace(/\*+$/, "");
|
|
2696
|
+
const a = u.md.normalizeLink(o);
|
|
2697
2697
|
if (!u.md.validateLink(a)) return !1;
|
|
2698
2698
|
if (!e) {
|
|
2699
|
-
u.pending = u.pending.slice(0, -
|
|
2699
|
+
u.pending = u.pending.slice(0, -c.length);
|
|
2700
2700
|
const s = u.push("link_open", "a", 1);
|
|
2701
2701
|
s.attrs = [["href", a]], s.markup = "linkify", s.info = "auto";
|
|
2702
|
-
const
|
|
2703
|
-
|
|
2704
|
-
const
|
|
2705
|
-
|
|
2702
|
+
const f = u.push("text", "", 0);
|
|
2703
|
+
f.content = u.md.normalizeLinkText(o);
|
|
2704
|
+
const d = u.push("link_close", "a", -1);
|
|
2705
|
+
d.markup = "linkify", d.info = "auto";
|
|
2706
2706
|
}
|
|
2707
|
-
return u.pos +=
|
|
2707
|
+
return u.pos += o.length - c.length, !0;
|
|
2708
2708
|
}
|
|
2709
|
-
function
|
|
2709
|
+
function _o(u, e) {
|
|
2710
2710
|
let t = u.pos;
|
|
2711
2711
|
if (u.src.charCodeAt(t) !== 10)
|
|
2712
2712
|
return !1;
|
|
@@ -2714,14 +2714,14 @@ function mc(u, e) {
|
|
|
2714
2714
|
if (!e)
|
|
2715
2715
|
if (n >= 0 && u.pending.charCodeAt(n) === 32)
|
|
2716
2716
|
if (n >= 1 && u.pending.charCodeAt(n - 1) === 32) {
|
|
2717
|
-
let
|
|
2718
|
-
for (;
|
|
2719
|
-
u.pending = u.pending.slice(0,
|
|
2717
|
+
let c = n - 1;
|
|
2718
|
+
for (; c >= 1 && u.pending.charCodeAt(c - 1) === 32; ) c--;
|
|
2719
|
+
u.pending = u.pending.slice(0, c), u.push("hardbreak", "br", 0);
|
|
2720
2720
|
} else
|
|
2721
2721
|
u.pending = u.pending.slice(0, -1), u.push("softbreak", "br", 0);
|
|
2722
2722
|
else
|
|
2723
2723
|
u.push("softbreak", "br", 0);
|
|
2724
|
-
for (t++; t < r &&
|
|
2724
|
+
for (t++; t < r && S(u.src.charCodeAt(t)); )
|
|
2725
2725
|
t++;
|
|
2726
2726
|
return u.pos = t, !0;
|
|
2727
2727
|
}
|
|
@@ -2731,69 +2731,69 @@ for (let u = 0; u < 256; u++)
|
|
|
2731
2731
|
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(u) {
|
|
2732
2732
|
g0[u.charCodeAt(0)] = 1;
|
|
2733
2733
|
});
|
|
2734
|
-
function
|
|
2734
|
+
function mo(u, e) {
|
|
2735
2735
|
let t = u.pos;
|
|
2736
2736
|
const n = u.posMax;
|
|
2737
2737
|
if (u.src.charCodeAt(t) !== 92 || (t++, t >= n)) return !1;
|
|
2738
2738
|
let r = u.src.charCodeAt(t);
|
|
2739
2739
|
if (r === 10) {
|
|
2740
|
-
for (e || u.push("hardbreak", "br", 0), t++; t < n && (r = u.src.charCodeAt(t), !!
|
|
2740
|
+
for (e || u.push("hardbreak", "br", 0), t++; t < n && (r = u.src.charCodeAt(t), !!S(r)); )
|
|
2741
2741
|
t++;
|
|
2742
2742
|
return u.pos = t, !0;
|
|
2743
2743
|
}
|
|
2744
|
-
let
|
|
2744
|
+
let c = u.src[t];
|
|
2745
2745
|
if (r >= 55296 && r <= 56319 && t + 1 < n) {
|
|
2746
|
-
const
|
|
2747
|
-
|
|
2746
|
+
const o = u.src.charCodeAt(t + 1);
|
|
2747
|
+
o >= 56320 && o <= 57343 && (c += u.src[t + 1], t++);
|
|
2748
2748
|
}
|
|
2749
|
-
const i = "\\" +
|
|
2749
|
+
const i = "\\" + c;
|
|
2750
2750
|
if (!e) {
|
|
2751
|
-
const
|
|
2752
|
-
r < 256 && g0[r] !== 0 ?
|
|
2751
|
+
const o = u.push("text_special", "", 0);
|
|
2752
|
+
r < 256 && g0[r] !== 0 ? o.content = c : o.content = i, o.markup = i, o.info = "escape";
|
|
2753
2753
|
}
|
|
2754
2754
|
return u.pos = t + 1, !0;
|
|
2755
2755
|
}
|
|
2756
|
-
function
|
|
2756
|
+
function xo(u, e) {
|
|
2757
2757
|
let t = u.pos;
|
|
2758
2758
|
if (u.src.charCodeAt(t) !== 96)
|
|
2759
2759
|
return !1;
|
|
2760
2760
|
const r = t;
|
|
2761
2761
|
t++;
|
|
2762
|
-
const
|
|
2763
|
-
for (; t <
|
|
2762
|
+
const c = u.posMax;
|
|
2763
|
+
for (; t < c && u.src.charCodeAt(t) === 96; )
|
|
2764
2764
|
t++;
|
|
2765
|
-
const i = u.src.slice(r, t),
|
|
2766
|
-
if (u.backticksScanned && (u.backticks[
|
|
2767
|
-
return e || (u.pending += i), u.pos +=
|
|
2765
|
+
const i = u.src.slice(r, t), o = i.length;
|
|
2766
|
+
if (u.backticksScanned && (u.backticks[o] || 0) <= r)
|
|
2767
|
+
return e || (u.pending += i), u.pos += o, !0;
|
|
2768
2768
|
let a = t, s;
|
|
2769
2769
|
for (; (s = u.src.indexOf("`", a)) !== -1; ) {
|
|
2770
|
-
for (a = s + 1; a <
|
|
2770
|
+
for (a = s + 1; a < c && u.src.charCodeAt(a) === 96; )
|
|
2771
2771
|
a++;
|
|
2772
|
-
const
|
|
2773
|
-
if (
|
|
2772
|
+
const f = a - s;
|
|
2773
|
+
if (f === o) {
|
|
2774
2774
|
if (!e) {
|
|
2775
|
-
const
|
|
2776
|
-
|
|
2775
|
+
const d = u.push("code_inline", "code", 0);
|
|
2776
|
+
d.markup = i, d.content = u.src.slice(t, s).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
|
|
2777
2777
|
}
|
|
2778
2778
|
return u.pos = a, !0;
|
|
2779
2779
|
}
|
|
2780
|
-
u.backticks[
|
|
2780
|
+
u.backticks[f] = s;
|
|
2781
2781
|
}
|
|
2782
|
-
return u.backticksScanned = !0, e || (u.pending += i), u.pos +=
|
|
2782
|
+
return u.backticksScanned = !0, e || (u.pending += i), u.pos += o, !0;
|
|
2783
2783
|
}
|
|
2784
|
-
function
|
|
2784
|
+
function go(u, e) {
|
|
2785
2785
|
const t = u.pos, n = u.src.charCodeAt(t);
|
|
2786
2786
|
if (e || n !== 126)
|
|
2787
2787
|
return !1;
|
|
2788
2788
|
const r = u.scanDelims(u.pos, !0);
|
|
2789
|
-
let
|
|
2789
|
+
let c = r.length;
|
|
2790
2790
|
const i = String.fromCharCode(n);
|
|
2791
|
-
if (
|
|
2791
|
+
if (c < 2)
|
|
2792
2792
|
return !1;
|
|
2793
|
-
let
|
|
2794
|
-
|
|
2795
|
-
for (let a = 0; a <
|
|
2796
|
-
|
|
2793
|
+
let o;
|
|
2794
|
+
c % 2 && (o = u.push("text", "", 0), o.content = i, c--);
|
|
2795
|
+
for (let a = 0; a < c; a += 2)
|
|
2796
|
+
o = u.push("text", "", 0), o.content = i + i, u.delimiters.push({
|
|
2797
2797
|
marker: n,
|
|
2798
2798
|
length: 0,
|
|
2799
2799
|
// disable "rule of 3" length checks meant for emphasis
|
|
@@ -2804,40 +2804,40 @@ function gc(u, e) {
|
|
|
2804
2804
|
});
|
|
2805
2805
|
return u.pos += r.length, !0;
|
|
2806
2806
|
}
|
|
2807
|
-
function
|
|
2807
|
+
function mt(u, e) {
|
|
2808
2808
|
let t;
|
|
2809
2809
|
const n = [], r = e.length;
|
|
2810
|
-
for (let
|
|
2811
|
-
const i = e[
|
|
2810
|
+
for (let c = 0; c < r; c++) {
|
|
2811
|
+
const i = e[c];
|
|
2812
2812
|
if (i.marker !== 126 || i.end === -1)
|
|
2813
2813
|
continue;
|
|
2814
|
-
const
|
|
2815
|
-
t = u.tokens[i.token], t.type = "s_open", t.tag = "s", t.nesting = 1, t.markup = "~~", t.content = "", t = u.tokens[
|
|
2814
|
+
const o = e[i.end];
|
|
2815
|
+
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 === "~" && n.push(o.token - 1);
|
|
2816
2816
|
}
|
|
2817
2817
|
for (; n.length; ) {
|
|
2818
|
-
const
|
|
2819
|
-
let i =
|
|
2818
|
+
const c = n.pop();
|
|
2819
|
+
let i = c + 1;
|
|
2820
2820
|
for (; i < u.tokens.length && u.tokens[i].type === "s_close"; )
|
|
2821
2821
|
i++;
|
|
2822
|
-
i--,
|
|
2822
|
+
i--, c !== i && (t = u.tokens[i], u.tokens[i] = u.tokens[c], u.tokens[c] = t);
|
|
2823
2823
|
}
|
|
2824
2824
|
}
|
|
2825
|
-
function
|
|
2825
|
+
function ko(u) {
|
|
2826
2826
|
const e = u.tokens_meta, t = u.tokens_meta.length;
|
|
2827
|
-
|
|
2827
|
+
mt(u, u.delimiters);
|
|
2828
2828
|
for (let n = 0; n < t; n++)
|
|
2829
|
-
e[n] && e[n].delimiters &&
|
|
2829
|
+
e[n] && e[n].delimiters && mt(u, e[n].delimiters);
|
|
2830
2830
|
}
|
|
2831
2831
|
const jt = {
|
|
2832
|
-
tokenize:
|
|
2833
|
-
postProcess:
|
|
2832
|
+
tokenize: go,
|
|
2833
|
+
postProcess: ko
|
|
2834
2834
|
};
|
|
2835
|
-
function
|
|
2835
|
+
function Eo(u, e) {
|
|
2836
2836
|
const t = u.pos, n = u.src.charCodeAt(t);
|
|
2837
2837
|
if (e || n !== 95 && n !== 42)
|
|
2838
2838
|
return !1;
|
|
2839
2839
|
const r = u.scanDelims(u.pos, n === 42);
|
|
2840
|
-
for (let
|
|
2840
|
+
for (let c = 0; c < r.length; c++) {
|
|
2841
2841
|
const i = u.push("text", "", 0);
|
|
2842
2842
|
i.content = String.fromCharCode(n), u.delimiters.push({
|
|
2843
2843
|
// Char code of the starting marker (number).
|
|
@@ -2862,98 +2862,98 @@ function Ec(u, e) {
|
|
|
2862
2862
|
}
|
|
2863
2863
|
return u.pos += r.length, !0;
|
|
2864
2864
|
}
|
|
2865
|
-
function
|
|
2865
|
+
function xt(u, e) {
|
|
2866
2866
|
const t = e.length;
|
|
2867
2867
|
for (let n = t - 1; n >= 0; n--) {
|
|
2868
2868
|
const r = e[n];
|
|
2869
2869
|
if (r.marker !== 95 && r.marker !== 42 || r.end === -1)
|
|
2870
2870
|
continue;
|
|
2871
|
-
const
|
|
2871
|
+
const c = e[r.end], i = n > 0 && e[n - 1].end === r.end + 1 && // check that first two markers match and adjacent
|
|
2872
2872
|
e[n - 1].marker === r.marker && e[n - 1].token === r.token - 1 && // check that last two markers are adjacent (we can safely assume they match)
|
|
2873
|
-
e[r.end + 1].token ===
|
|
2874
|
-
a.type = i ? "strong_open" : "em_open", a.tag = i ? "strong" : "em", a.nesting = 1, a.markup = i ?
|
|
2875
|
-
const s = u.tokens[
|
|
2876
|
-
s.type = i ? "strong_close" : "em_close", s.tag = i ? "strong" : "em", s.nesting = -1, s.markup = i ?
|
|
2873
|
+
e[r.end + 1].token === c.token + 1, o = String.fromCharCode(r.marker), a = u.tokens[r.token];
|
|
2874
|
+
a.type = i ? "strong_open" : "em_open", a.tag = i ? "strong" : "em", a.nesting = 1, a.markup = i ? o + o : o, a.content = "";
|
|
2875
|
+
const s = u.tokens[c.token];
|
|
2876
|
+
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[n - 1].token].content = "", u.tokens[e[r.end + 1].token].content = "", n--);
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
|
-
function
|
|
2879
|
+
function Ao(u) {
|
|
2880
2880
|
const e = u.tokens_meta, t = u.tokens_meta.length;
|
|
2881
|
-
|
|
2881
|
+
xt(u, u.delimiters);
|
|
2882
2882
|
for (let n = 0; n < t; n++)
|
|
2883
|
-
e[n] && e[n].delimiters &&
|
|
2883
|
+
e[n] && e[n].delimiters && xt(u, e[n].delimiters);
|
|
2884
2884
|
}
|
|
2885
2885
|
const Gt = {
|
|
2886
|
-
tokenize:
|
|
2887
|
-
postProcess:
|
|
2886
|
+
tokenize: Eo,
|
|
2887
|
+
postProcess: Ao
|
|
2888
2888
|
};
|
|
2889
|
-
function
|
|
2890
|
-
let t, n, r,
|
|
2889
|
+
function Co(u, e) {
|
|
2890
|
+
let t, n, r, c, i = "", o = "", a = u.pos, s = !0;
|
|
2891
2891
|
if (u.src.charCodeAt(u.pos) !== 91)
|
|
2892
2892
|
return !1;
|
|
2893
|
-
const
|
|
2894
|
-
if (
|
|
2893
|
+
const f = u.pos, d = u.posMax, _ = u.pos + 1, b = u.md.helpers.parseLinkLabel(u, u.pos, !0);
|
|
2894
|
+
if (b < 0)
|
|
2895
2895
|
return !1;
|
|
2896
|
-
let
|
|
2897
|
-
if (
|
|
2898
|
-
for (s = !1,
|
|
2896
|
+
let h = b + 1;
|
|
2897
|
+
if (h < d && u.src.charCodeAt(h) === 40) {
|
|
2898
|
+
for (s = !1, h++; h < d && (t = u.src.charCodeAt(h), !(!S(t) && t !== 10)); h++)
|
|
2899
2899
|
;
|
|
2900
|
-
if (
|
|
2900
|
+
if (h >= d)
|
|
2901
2901
|
return !1;
|
|
2902
|
-
if (a =
|
|
2903
|
-
for (i = u.md.normalizeLink(r.str), u.md.validateLink(i) ?
|
|
2902
|
+
if (a = h, r = u.md.helpers.parseLinkDestination(u.src, h, u.posMax), r.ok) {
|
|
2903
|
+
for (i = u.md.normalizeLink(r.str), u.md.validateLink(i) ? h = r.pos : i = "", a = h; h < d && (t = u.src.charCodeAt(h), !(!S(t) && t !== 10)); h++)
|
|
2904
2904
|
;
|
|
2905
|
-
if (r = u.md.helpers.parseLinkTitle(u.src,
|
|
2906
|
-
for (
|
|
2905
|
+
if (r = u.md.helpers.parseLinkTitle(u.src, h, u.posMax), h < d && a !== h && r.ok)
|
|
2906
|
+
for (o = r.str, h = r.pos; h < d && (t = u.src.charCodeAt(h), !(!S(t) && t !== 10)); h++)
|
|
2907
2907
|
;
|
|
2908
2908
|
}
|
|
2909
|
-
(
|
|
2909
|
+
(h >= d || u.src.charCodeAt(h) !== 41) && (s = !0), h++;
|
|
2910
2910
|
}
|
|
2911
2911
|
if (s) {
|
|
2912
2912
|
if (typeof u.env.references > "u")
|
|
2913
2913
|
return !1;
|
|
2914
|
-
if (
|
|
2915
|
-
return u.pos =
|
|
2916
|
-
i =
|
|
2914
|
+
if (h < d && u.src.charCodeAt(h) === 91 ? (a = h + 1, h = u.md.helpers.parseLinkLabel(u, h), h >= 0 ? n = u.src.slice(a, h++) : h = b + 1) : h = b + 1, n || (n = u.src.slice(_, b)), c = u.env.references[Te(n)], !c)
|
|
2915
|
+
return u.pos = f, !1;
|
|
2916
|
+
i = c.href, o = c.title;
|
|
2917
2917
|
}
|
|
2918
2918
|
if (!e) {
|
|
2919
|
-
u.pos =
|
|
2920
|
-
const C = u.push("link_open", "a", 1),
|
|
2921
|
-
C.attrs =
|
|
2919
|
+
u.pos = _, u.posMax = b;
|
|
2920
|
+
const C = u.push("link_open", "a", 1), y = [["href", i]];
|
|
2921
|
+
C.attrs = y, o && y.push(["title", o]), u.linkLevel++, u.md.inline.tokenize(u), u.linkLevel--, u.push("link_close", "a", -1);
|
|
2922
2922
|
}
|
|
2923
|
-
return u.pos =
|
|
2923
|
+
return u.pos = h, u.posMax = d, !0;
|
|
2924
2924
|
}
|
|
2925
|
-
function
|
|
2926
|
-
let t, n, r,
|
|
2927
|
-
const
|
|
2925
|
+
function Do(u, e) {
|
|
2926
|
+
let t, n, r, c, i, o, a, s, f = "";
|
|
2927
|
+
const d = u.pos, _ = u.posMax;
|
|
2928
2928
|
if (u.src.charCodeAt(u.pos) !== 33 || u.src.charCodeAt(u.pos + 1) !== 91)
|
|
2929
2929
|
return !1;
|
|
2930
|
-
const
|
|
2931
|
-
if (
|
|
2930
|
+
const b = u.pos + 2, h = u.md.helpers.parseLinkLabel(u, u.pos + 1, !1);
|
|
2931
|
+
if (h < 0)
|
|
2932
2932
|
return !1;
|
|
2933
|
-
if (
|
|
2934
|
-
for (
|
|
2933
|
+
if (c = h + 1, c < _ && u.src.charCodeAt(c) === 40) {
|
|
2934
|
+
for (c++; c < _ && (t = u.src.charCodeAt(c), !(!S(t) && t !== 10)); c++)
|
|
2935
2935
|
;
|
|
2936
|
-
if (
|
|
2936
|
+
if (c >= _)
|
|
2937
2937
|
return !1;
|
|
2938
|
-
for (s =
|
|
2938
|
+
for (s = c, o = u.md.helpers.parseLinkDestination(u.src, c, u.posMax), o.ok && (f = u.md.normalizeLink(o.str), u.md.validateLink(f) ? c = o.pos : f = ""), s = c; c < _ && (t = u.src.charCodeAt(c), !(!S(t) && t !== 10)); c++)
|
|
2939
2939
|
;
|
|
2940
|
-
if (
|
|
2941
|
-
for (a =
|
|
2940
|
+
if (o = u.md.helpers.parseLinkTitle(u.src, c, u.posMax), c < _ && s !== c && o.ok)
|
|
2941
|
+
for (a = o.str, c = o.pos; c < _ && (t = u.src.charCodeAt(c), !(!S(t) && t !== 10)); c++)
|
|
2942
2942
|
;
|
|
2943
2943
|
else
|
|
2944
2944
|
a = "";
|
|
2945
|
-
if (
|
|
2946
|
-
return u.pos =
|
|
2947
|
-
|
|
2945
|
+
if (c >= _ || u.src.charCodeAt(c) !== 41)
|
|
2946
|
+
return u.pos = d, !1;
|
|
2947
|
+
c++;
|
|
2948
2948
|
} else {
|
|
2949
2949
|
if (typeof u.env.references > "u")
|
|
2950
2950
|
return !1;
|
|
2951
|
-
if (
|
|
2952
|
-
return u.pos =
|
|
2953
|
-
|
|
2951
|
+
if (c < _ && u.src.charCodeAt(c) === 91 ? (s = c + 1, c = u.md.helpers.parseLinkLabel(u, c), c >= 0 ? r = u.src.slice(s, c++) : c = h + 1) : c = h + 1, r || (r = u.src.slice(b, h)), i = u.env.references[Te(r)], !i)
|
|
2952
|
+
return u.pos = d, !1;
|
|
2953
|
+
f = i.href, a = i.title;
|
|
2954
2954
|
}
|
|
2955
2955
|
if (!e) {
|
|
2956
|
-
n = u.src.slice(
|
|
2956
|
+
n = u.src.slice(b, h);
|
|
2957
2957
|
const C = [];
|
|
2958
2958
|
u.md.inline.parse(
|
|
2959
2959
|
n,
|
|
@@ -2961,13 +2961,13 @@ function Dc(u, e) {
|
|
|
2961
2961
|
u.env,
|
|
2962
2962
|
C
|
|
2963
2963
|
);
|
|
2964
|
-
const
|
|
2965
|
-
|
|
2964
|
+
const y = u.push("image", "img", 0), T = [["src", f], ["alt", ""]];
|
|
2965
|
+
y.attrs = T, y.children = C, y.content = n, a && T.push(["title", a]);
|
|
2966
2966
|
}
|
|
2967
|
-
return u.pos =
|
|
2967
|
+
return u.pos = c, u.posMax = _, !0;
|
|
2968
2968
|
}
|
|
2969
|
-
const
|
|
2970
|
-
function
|
|
2969
|
+
const yo = /^([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])?)*)$/, Fo = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
|
|
2970
|
+
function To(u, e) {
|
|
2971
2971
|
let t = u.pos;
|
|
2972
2972
|
if (u.src.charCodeAt(t) !== 60)
|
|
2973
2973
|
return !1;
|
|
@@ -2978,187 +2978,187 @@ function Tc(u, e) {
|
|
|
2978
2978
|
if (i === 60) return !1;
|
|
2979
2979
|
if (i === 62) break;
|
|
2980
2980
|
}
|
|
2981
|
-
const
|
|
2982
|
-
if (
|
|
2983
|
-
const i = u.md.normalizeLink(
|
|
2981
|
+
const c = u.src.slice(n + 1, t);
|
|
2982
|
+
if (Fo.test(c)) {
|
|
2983
|
+
const i = u.md.normalizeLink(c);
|
|
2984
2984
|
if (!u.md.validateLink(i))
|
|
2985
2985
|
return !1;
|
|
2986
2986
|
if (!e) {
|
|
2987
|
-
const
|
|
2988
|
-
|
|
2987
|
+
const o = u.push("link_open", "a", 1);
|
|
2988
|
+
o.attrs = [["href", i]], o.markup = "autolink", o.info = "auto";
|
|
2989
2989
|
const a = u.push("text", "", 0);
|
|
2990
|
-
a.content = u.md.normalizeLinkText(
|
|
2990
|
+
a.content = u.md.normalizeLinkText(c);
|
|
2991
2991
|
const s = u.push("link_close", "a", -1);
|
|
2992
2992
|
s.markup = "autolink", s.info = "auto";
|
|
2993
2993
|
}
|
|
2994
|
-
return u.pos +=
|
|
2994
|
+
return u.pos += c.length + 2, !0;
|
|
2995
2995
|
}
|
|
2996
|
-
if (
|
|
2997
|
-
const i = u.md.normalizeLink("mailto:" +
|
|
2996
|
+
if (yo.test(c)) {
|
|
2997
|
+
const i = u.md.normalizeLink("mailto:" + c);
|
|
2998
2998
|
if (!u.md.validateLink(i))
|
|
2999
2999
|
return !1;
|
|
3000
3000
|
if (!e) {
|
|
3001
|
-
const
|
|
3002
|
-
|
|
3001
|
+
const o = u.push("link_open", "a", 1);
|
|
3002
|
+
o.attrs = [["href", i]], o.markup = "autolink", o.info = "auto";
|
|
3003
3003
|
const a = u.push("text", "", 0);
|
|
3004
|
-
a.content = u.md.normalizeLinkText(
|
|
3004
|
+
a.content = u.md.normalizeLinkText(c);
|
|
3005
3005
|
const s = u.push("link_close", "a", -1);
|
|
3006
3006
|
s.markup = "autolink", s.info = "auto";
|
|
3007
3007
|
}
|
|
3008
|
-
return u.pos +=
|
|
3008
|
+
return u.pos += c.length + 2, !0;
|
|
3009
3009
|
}
|
|
3010
3010
|
return !1;
|
|
3011
3011
|
}
|
|
3012
|
-
function
|
|
3012
|
+
function So(u) {
|
|
3013
3013
|
return /^<a[>\s]/i.test(u);
|
|
3014
3014
|
}
|
|
3015
|
-
function
|
|
3015
|
+
function wo(u) {
|
|
3016
3016
|
return /^<\/a\s*>/i.test(u);
|
|
3017
3017
|
}
|
|
3018
|
-
function
|
|
3018
|
+
function vo(u) {
|
|
3019
3019
|
const e = u | 32;
|
|
3020
3020
|
return e >= 97 && e <= 122;
|
|
3021
3021
|
}
|
|
3022
|
-
function
|
|
3022
|
+
function Ro(u, e) {
|
|
3023
3023
|
if (!u.md.options.html)
|
|
3024
3024
|
return !1;
|
|
3025
3025
|
const t = u.posMax, n = u.pos;
|
|
3026
3026
|
if (u.src.charCodeAt(n) !== 60 || n + 2 >= t)
|
|
3027
3027
|
return !1;
|
|
3028
3028
|
const r = u.src.charCodeAt(n + 1);
|
|
3029
|
-
if (r !== 33 && r !== 63 && r !== 47 && !
|
|
3029
|
+
if (r !== 33 && r !== 63 && r !== 47 && !vo(r))
|
|
3030
3030
|
return !1;
|
|
3031
|
-
const
|
|
3032
|
-
if (!
|
|
3031
|
+
const c = u.src.slice(n).match(co);
|
|
3032
|
+
if (!c)
|
|
3033
3033
|
return !1;
|
|
3034
3034
|
if (!e) {
|
|
3035
3035
|
const i = u.push("html_inline", "", 0);
|
|
3036
|
-
i.content =
|
|
3036
|
+
i.content = c[0], So(i.content) && u.linkLevel++, wo(i.content) && u.linkLevel--;
|
|
3037
3037
|
}
|
|
3038
|
-
return u.pos +=
|
|
3038
|
+
return u.pos += c[0].length, !0;
|
|
3039
3039
|
}
|
|
3040
|
-
const
|
|
3041
|
-
function
|
|
3040
|
+
const Io = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, Mo = /^&([a-z][a-z0-9]{1,31});/i;
|
|
3041
|
+
function Lo(u, e) {
|
|
3042
3042
|
const t = u.pos, n = u.posMax;
|
|
3043
3043
|
if (u.src.charCodeAt(t) !== 38 || t + 1 >= n) return !1;
|
|
3044
3044
|
if (u.src.charCodeAt(t + 1) === 35) {
|
|
3045
|
-
const
|
|
3046
|
-
if (
|
|
3045
|
+
const c = u.src.slice(t).match(Io);
|
|
3046
|
+
if (c) {
|
|
3047
3047
|
if (!e) {
|
|
3048
|
-
const i =
|
|
3049
|
-
|
|
3048
|
+
const i = c[1][0].toLowerCase() === "x" ? parseInt(c[1].slice(1), 16) : parseInt(c[1], 10), o = u.push("text_special", "", 0);
|
|
3049
|
+
o.content = m0(i) ? De(i) : De(65533), o.markup = c[0], o.info = "entity";
|
|
3050
3050
|
}
|
|
3051
|
-
return u.pos +=
|
|
3051
|
+
return u.pos += c[0].length, !0;
|
|
3052
3052
|
}
|
|
3053
3053
|
} else {
|
|
3054
|
-
const
|
|
3055
|
-
if (
|
|
3056
|
-
const i =
|
|
3057
|
-
if (i !==
|
|
3054
|
+
const c = u.src.slice(t).match(Mo);
|
|
3055
|
+
if (c) {
|
|
3056
|
+
const i = Bt(c[0]);
|
|
3057
|
+
if (i !== c[0]) {
|
|
3058
3058
|
if (!e) {
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3059
|
+
const o = u.push("text_special", "", 0);
|
|
3060
|
+
o.content = i, o.markup = c[0], o.info = "entity";
|
|
3061
3061
|
}
|
|
3062
|
-
return u.pos +=
|
|
3062
|
+
return u.pos += c[0].length, !0;
|
|
3063
3063
|
}
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
3066
|
return !1;
|
|
3067
3067
|
}
|
|
3068
|
-
function
|
|
3068
|
+
function gt(u) {
|
|
3069
3069
|
const e = {}, t = u.length;
|
|
3070
3070
|
if (!t) return;
|
|
3071
3071
|
let n = 0, r = -2;
|
|
3072
|
-
const
|
|
3072
|
+
const c = [];
|
|
3073
3073
|
for (let i = 0; i < t; i++) {
|
|
3074
|
-
const
|
|
3075
|
-
if (
|
|
3076
|
-
e.hasOwnProperty(
|
|
3077
|
-
const a = e[
|
|
3078
|
-
let s = n -
|
|
3079
|
-
for (; s > a; s -=
|
|
3080
|
-
const
|
|
3081
|
-
if (
|
|
3082
|
-
let
|
|
3083
|
-
if ((
|
|
3084
|
-
const
|
|
3085
|
-
|
|
3074
|
+
const o = u[i];
|
|
3075
|
+
if (c.push(0), (u[n].marker !== o.marker || r !== o.token - 1) && (n = i), r = o.token, o.length = o.length || 0, !o.close) continue;
|
|
3076
|
+
e.hasOwnProperty(o.marker) || (e[o.marker] = [-1, -1, -1, -1, -1, -1]);
|
|
3077
|
+
const a = e[o.marker][(o.open ? 3 : 0) + o.length % 3];
|
|
3078
|
+
let s = n - c[n] - 1, f = s;
|
|
3079
|
+
for (; s > a; s -= c[s] + 1) {
|
|
3080
|
+
const d = u[s];
|
|
3081
|
+
if (d.marker === o.marker && d.open && d.end < 0) {
|
|
3082
|
+
let _ = !1;
|
|
3083
|
+
if ((d.close || o.open) && (d.length + o.length) % 3 === 0 && (d.length % 3 !== 0 || o.length % 3 !== 0) && (_ = !0), !_) {
|
|
3084
|
+
const b = s > 0 && !u[s - 1].open ? c[s - 1] + 1 : 0;
|
|
3085
|
+
c[i] = i - s + b, c[s] = b, o.open = !1, d.end = i, d.close = !1, f = -1, r = -2;
|
|
3086
3086
|
break;
|
|
3087
3087
|
}
|
|
3088
3088
|
}
|
|
3089
3089
|
}
|
|
3090
|
-
|
|
3090
|
+
f !== -1 && (e[o.marker][(o.open ? 3 : 0) + (o.length || 0) % 3] = f);
|
|
3091
3091
|
}
|
|
3092
3092
|
}
|
|
3093
|
-
function
|
|
3093
|
+
function Oo(u) {
|
|
3094
3094
|
const e = u.tokens_meta, t = u.tokens_meta.length;
|
|
3095
|
-
|
|
3095
|
+
gt(u.delimiters);
|
|
3096
3096
|
for (let n = 0; n < t; n++)
|
|
3097
|
-
e[n] && e[n].delimiters &&
|
|
3097
|
+
e[n] && e[n].delimiters && gt(e[n].delimiters);
|
|
3098
3098
|
}
|
|
3099
|
-
function
|
|
3099
|
+
function No(u) {
|
|
3100
3100
|
let e, t, n = 0;
|
|
3101
|
-
const r = u.tokens,
|
|
3102
|
-
for (e = t = 0; e <
|
|
3103
|
-
r[e].nesting < 0 && n--, r[e].level = n, r[e].nesting > 0 && n++, r[e].type === "text" && e + 1 <
|
|
3101
|
+
const r = u.tokens, c = u.tokens.length;
|
|
3102
|
+
for (e = t = 0; e < c; e++)
|
|
3103
|
+
r[e].nesting < 0 && n--, r[e].level = n, r[e].nesting > 0 && n++, r[e].type === "text" && e + 1 < c && r[e + 1].type === "text" ? r[e + 1].content = r[e].content + r[e + 1].content : (e !== t && (r[t] = r[e]), t++);
|
|
3104
3104
|
e !== t && (r.length = t);
|
|
3105
3105
|
}
|
|
3106
3106
|
const Ke = [
|
|
3107
|
-
["text",
|
|
3108
|
-
["linkify",
|
|
3109
|
-
["newline",
|
|
3110
|
-
["escape",
|
|
3111
|
-
["backticks",
|
|
3107
|
+
["text", ho],
|
|
3108
|
+
["linkify", po],
|
|
3109
|
+
["newline", _o],
|
|
3110
|
+
["escape", mo],
|
|
3111
|
+
["backticks", xo],
|
|
3112
3112
|
["strikethrough", jt.tokenize],
|
|
3113
3113
|
["emphasis", Gt.tokenize],
|
|
3114
|
-
["link",
|
|
3115
|
-
["image",
|
|
3116
|
-
["autolink",
|
|
3117
|
-
["html_inline",
|
|
3118
|
-
["entity",
|
|
3114
|
+
["link", Co],
|
|
3115
|
+
["image", Do],
|
|
3116
|
+
["autolink", To],
|
|
3117
|
+
["html_inline", Ro],
|
|
3118
|
+
["entity", Lo]
|
|
3119
3119
|
], u0 = [
|
|
3120
|
-
["balance_pairs",
|
|
3120
|
+
["balance_pairs", Oo],
|
|
3121
3121
|
["strikethrough", jt.postProcess],
|
|
3122
3122
|
["emphasis", Gt.postProcess],
|
|
3123
3123
|
// rules for pairs separate '**' into its own text tokens, which may be left unused,
|
|
3124
3124
|
// rule below merges unused segments back with the rest of the text
|
|
3125
|
-
["fragments_join",
|
|
3125
|
+
["fragments_join", No]
|
|
3126
3126
|
];
|
|
3127
|
-
function
|
|
3128
|
-
this.ruler = new
|
|
3127
|
+
function ae() {
|
|
3128
|
+
this.ruler = new Z();
|
|
3129
3129
|
for (let u = 0; u < Ke.length; u++)
|
|
3130
3130
|
this.ruler.push(Ke[u][0], Ke[u][1]);
|
|
3131
|
-
this.ruler2 = new
|
|
3131
|
+
this.ruler2 = new Z();
|
|
3132
3132
|
for (let u = 0; u < u0.length; u++)
|
|
3133
3133
|
this.ruler2.push(u0[u][0], u0[u][1]);
|
|
3134
3134
|
}
|
|
3135
|
-
|
|
3136
|
-
const e = u.pos, t = this.ruler.getRules(""), n = t.length, r = u.md.options.maxNesting,
|
|
3137
|
-
if (typeof
|
|
3138
|
-
u.pos =
|
|
3135
|
+
ae.prototype.skipToken = function(u) {
|
|
3136
|
+
const e = u.pos, t = this.ruler.getRules(""), n = t.length, r = u.md.options.maxNesting, c = u.cache;
|
|
3137
|
+
if (typeof c[e] < "u") {
|
|
3138
|
+
u.pos = c[e];
|
|
3139
3139
|
return;
|
|
3140
3140
|
}
|
|
3141
3141
|
let i = !1;
|
|
3142
3142
|
if (u.level < r) {
|
|
3143
|
-
for (let
|
|
3144
|
-
if (u.level++, i = t[
|
|
3143
|
+
for (let o = 0; o < n; o++)
|
|
3144
|
+
if (u.level++, i = t[o](u, !0), u.level--, i) {
|
|
3145
3145
|
if (e >= u.pos)
|
|
3146
3146
|
throw new Error("inline rule didn't increment state.pos");
|
|
3147
3147
|
break;
|
|
3148
3148
|
}
|
|
3149
3149
|
} else
|
|
3150
3150
|
u.pos = u.posMax;
|
|
3151
|
-
i || u.pos++,
|
|
3151
|
+
i || u.pos++, c[e] = u.pos;
|
|
3152
3152
|
};
|
|
3153
|
-
|
|
3153
|
+
ae.prototype.tokenize = function(u) {
|
|
3154
3154
|
const e = this.ruler.getRules(""), t = e.length, n = u.posMax, r = u.md.options.maxNesting;
|
|
3155
3155
|
for (; u.pos < n; ) {
|
|
3156
|
-
const
|
|
3156
|
+
const c = u.pos;
|
|
3157
3157
|
let i = !1;
|
|
3158
3158
|
if (u.level < r) {
|
|
3159
|
-
for (let
|
|
3160
|
-
if (i = e[
|
|
3161
|
-
if (
|
|
3159
|
+
for (let o = 0; o < t; o++)
|
|
3160
|
+
if (i = e[o](u, !1), i) {
|
|
3161
|
+
if (c >= u.pos)
|
|
3162
3162
|
throw new Error("inline rule didn't increment state.pos");
|
|
3163
3163
|
break;
|
|
3164
3164
|
}
|
|
@@ -3172,17 +3172,17 @@ se.prototype.tokenize = function(u) {
|
|
|
3172
3172
|
}
|
|
3173
3173
|
u.pending && u.pushPending();
|
|
3174
3174
|
};
|
|
3175
|
-
|
|
3175
|
+
ae.prototype.parse = function(u, e, t, n) {
|
|
3176
3176
|
const r = new this.State(u, e, t, n);
|
|
3177
3177
|
this.tokenize(r);
|
|
3178
|
-
const
|
|
3179
|
-
for (let
|
|
3180
|
-
o
|
|
3178
|
+
const c = this.ruler2.getRules(""), i = c.length;
|
|
3179
|
+
for (let o = 0; o < i; o++)
|
|
3180
|
+
c[o](r);
|
|
3181
3181
|
};
|
|
3182
|
-
|
|
3183
|
-
function
|
|
3182
|
+
ae.prototype.State = ie;
|
|
3183
|
+
function Bo(u) {
|
|
3184
3184
|
const e = {};
|
|
3185
|
-
u = u || {}, e.src_Any = It.source, e.src_Cc = Mt.source, e.src_Z = Ot.source, e.src_P =
|
|
3185
|
+
u = u || {}, e.src_Any = It.source, e.src_Cc = Mt.source, e.src_Z = Ot.source, e.src_P = p0.source, e.src_ZPCc = [e.src_Z, e.src_P, e.src_Cc].join("|"), e.src_ZCc = [e.src_Z, e.src_Cc].join("|");
|
|
3186
3186
|
const t = "[><|]";
|
|
3187
3187
|
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
|
|
3188
3188
|
",(?!" + 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)
|
|
@@ -3199,22 +3199,22 @@ function i0(u) {
|
|
|
3199
3199
|
});
|
|
3200
3200
|
}), u;
|
|
3201
3201
|
}
|
|
3202
|
-
function
|
|
3202
|
+
function we(u) {
|
|
3203
3203
|
return Object.prototype.toString.call(u);
|
|
3204
3204
|
}
|
|
3205
|
-
function
|
|
3206
|
-
return
|
|
3205
|
+
function Po(u) {
|
|
3206
|
+
return we(u) === "[object String]";
|
|
3207
3207
|
}
|
|
3208
|
-
function
|
|
3209
|
-
return
|
|
3208
|
+
function zo(u) {
|
|
3209
|
+
return we(u) === "[object Object]";
|
|
3210
3210
|
}
|
|
3211
|
-
function
|
|
3212
|
-
return
|
|
3211
|
+
function qo(u) {
|
|
3212
|
+
return we(u) === "[object RegExp]";
|
|
3213
3213
|
}
|
|
3214
|
-
function
|
|
3215
|
-
return
|
|
3214
|
+
function kt(u) {
|
|
3215
|
+
return we(u) === "[object Function]";
|
|
3216
3216
|
}
|
|
3217
|
-
function
|
|
3217
|
+
function Uo(u) {
|
|
3218
3218
|
return u.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
3219
3219
|
}
|
|
3220
3220
|
const Wt = {
|
|
@@ -3222,12 +3222,12 @@ const Wt = {
|
|
|
3222
3222
|
fuzzyEmail: !0,
|
|
3223
3223
|
fuzzyIP: !1
|
|
3224
3224
|
};
|
|
3225
|
-
function
|
|
3225
|
+
function Ho(u) {
|
|
3226
3226
|
return Object.keys(u || {}).reduce(function(e, t) {
|
|
3227
3227
|
return e || Wt.hasOwnProperty(t);
|
|
3228
3228
|
}, !1);
|
|
3229
3229
|
}
|
|
3230
|
-
const $
|
|
3230
|
+
const $o = {
|
|
3231
3231
|
"http:": {
|
|
3232
3232
|
validate: function(u, e, t) {
|
|
3233
3233
|
const n = u.slice(e);
|
|
@@ -3259,73 +3259,73 @@ const $c = {
|
|
|
3259
3259
|
)), t.re.mailto.test(n) ? n.match(t.re.mailto)[0].length : 0;
|
|
3260
3260
|
}
|
|
3261
3261
|
}
|
|
3262
|
-
},
|
|
3263
|
-
function
|
|
3262
|
+
}, jo = "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]", Go = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
|
|
3263
|
+
function Wo(u) {
|
|
3264
3264
|
u.__index__ = -1, u.__text_cache__ = "";
|
|
3265
3265
|
}
|
|
3266
|
-
function
|
|
3266
|
+
function Zo(u) {
|
|
3267
3267
|
return function(e, t) {
|
|
3268
3268
|
const n = e.slice(t);
|
|
3269
3269
|
return u.test(n) ? n.match(u)[0].length : 0;
|
|
3270
3270
|
};
|
|
3271
3271
|
}
|
|
3272
|
-
function
|
|
3272
|
+
function Et() {
|
|
3273
3273
|
return function(u, e) {
|
|
3274
3274
|
e.normalize(u);
|
|
3275
3275
|
};
|
|
3276
3276
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const e = u.re =
|
|
3279
|
-
u.onCompile(), u.__tlds_replaced__ || t.push(
|
|
3280
|
-
function n(
|
|
3281
|
-
return
|
|
3277
|
+
function ye(u) {
|
|
3278
|
+
const e = u.re = Bo(u.__opts__), t = u.__tlds__.slice();
|
|
3279
|
+
u.onCompile(), u.__tlds_replaced__ || t.push(jo), t.push(e.src_xn), e.src_tlds = t.join("|");
|
|
3280
|
+
function n(o) {
|
|
3281
|
+
return o.replace("%TLDS%", e.src_tlds);
|
|
3282
3282
|
}
|
|
3283
3283
|
e.email_fuzzy = RegExp(n(e.tpl_email_fuzzy), "i"), e.link_fuzzy = RegExp(n(e.tpl_link_fuzzy), "i"), e.link_no_ip_fuzzy = RegExp(n(e.tpl_link_no_ip_fuzzy), "i"), e.host_fuzzy_test = RegExp(n(e.tpl_host_fuzzy_test), "i");
|
|
3284
3284
|
const r = [];
|
|
3285
3285
|
u.__compiled__ = {};
|
|
3286
|
-
function o
|
|
3287
|
-
throw new Error('(LinkifyIt) Invalid schema "' +
|
|
3286
|
+
function c(o, a) {
|
|
3287
|
+
throw new Error('(LinkifyIt) Invalid schema "' + o + '": ' + a);
|
|
3288
3288
|
}
|
|
3289
|
-
Object.keys(u.__schemas__).forEach(function(
|
|
3290
|
-
const a = u.__schemas__[
|
|
3289
|
+
Object.keys(u.__schemas__).forEach(function(o) {
|
|
3290
|
+
const a = u.__schemas__[o];
|
|
3291
3291
|
if (a === null)
|
|
3292
3292
|
return;
|
|
3293
3293
|
const s = { validate: null, link: null };
|
|
3294
|
-
if (u.__compiled__[
|
|
3295
|
-
|
|
3294
|
+
if (u.__compiled__[o] = s, zo(a)) {
|
|
3295
|
+
qo(a.validate) ? s.validate = Zo(a.validate) : kt(a.validate) ? s.validate = a.validate : c(o, a), kt(a.normalize) ? s.normalize = a.normalize : a.normalize ? c(o, a) : s.normalize = Et();
|
|
3296
3296
|
return;
|
|
3297
3297
|
}
|
|
3298
|
-
if (
|
|
3299
|
-
r.push(
|
|
3298
|
+
if (Po(a)) {
|
|
3299
|
+
r.push(o);
|
|
3300
3300
|
return;
|
|
3301
3301
|
}
|
|
3302
|
-
o
|
|
3303
|
-
}), r.forEach(function(
|
|
3304
|
-
u.__compiled__[u.__schemas__[
|
|
3305
|
-
}), u.__compiled__[""] = { validate: null, normalize:
|
|
3306
|
-
const i = Object.keys(u.__compiled__).filter(function(
|
|
3307
|
-
return
|
|
3308
|
-
}).map(
|
|
3302
|
+
c(o, a);
|
|
3303
|
+
}), r.forEach(function(o) {
|
|
3304
|
+
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);
|
|
3305
|
+
}), u.__compiled__[""] = { validate: null, normalize: Et() };
|
|
3306
|
+
const i = Object.keys(u.__compiled__).filter(function(o) {
|
|
3307
|
+
return o.length > 0 && u.__compiled__[o];
|
|
3308
|
+
}).map(Uo).join("|");
|
|
3309
3309
|
u.re.schema_test = RegExp("(^|(?!_)(?:[><|]|" + e.src_ZPCc + "))(" + i + ")", "i"), u.re.schema_search = RegExp("(^|(?!_)(?:[><|]|" + e.src_ZPCc + "))(" + i + ")", "ig"), u.re.schema_at_start = RegExp("^" + u.re.schema_search.source, "i"), u.re.pretest = RegExp(
|
|
3310
3310
|
"(" + u.re.schema_test.source + ")|(" + u.re.host_fuzzy_test.source + ")|@",
|
|
3311
3311
|
"i"
|
|
3312
|
-
),
|
|
3312
|
+
), Wo(u);
|
|
3313
3313
|
}
|
|
3314
|
-
function
|
|
3314
|
+
function Vo(u, e) {
|
|
3315
3315
|
const t = u.__index__, n = u.__last_index__, r = u.__text_cache__.slice(t, n);
|
|
3316
3316
|
this.schema = u.__schema__.toLowerCase(), this.index = t + e, this.lastIndex = n + e, this.raw = r, this.text = r, this.url = r;
|
|
3317
3317
|
}
|
|
3318
3318
|
function a0(u, e) {
|
|
3319
|
-
const t = new
|
|
3319
|
+
const t = new Vo(u, e);
|
|
3320
3320
|
return u.__compiled__[t.schema].normalize(t, u), t;
|
|
3321
3321
|
}
|
|
3322
3322
|
function J(u, e) {
|
|
3323
3323
|
if (!(this instanceof J))
|
|
3324
3324
|
return new J(u, e);
|
|
3325
|
-
e ||
|
|
3325
|
+
e || Ho(u) && (e = u, u = {}), this.__opts__ = i0({}, Wt, e), this.__index__ = -1, this.__last_index__ = -1, this.__schema__ = "", this.__text_cache__ = "", this.__schemas__ = i0({}, $o, u), this.__compiled__ = {}, this.__tlds__ = Go, this.__tlds_replaced__ = !1, this.re = {}, ye(this);
|
|
3326
3326
|
}
|
|
3327
3327
|
J.prototype.add = function(e, t) {
|
|
3328
|
-
return this.__schemas__[e] = t,
|
|
3328
|
+
return this.__schemas__[e] = t, ye(this), this;
|
|
3329
3329
|
};
|
|
3330
3330
|
J.prototype.set = function(e) {
|
|
3331
3331
|
return this.__opts__ = i0(this.__opts__, e), this;
|
|
@@ -3333,15 +3333,15 @@ J.prototype.set = function(e) {
|
|
|
3333
3333
|
J.prototype.test = function(e) {
|
|
3334
3334
|
if (this.__text_cache__ = e, this.__index__ = -1, !e.length)
|
|
3335
3335
|
return !1;
|
|
3336
|
-
let t, n, r,
|
|
3336
|
+
let t, n, r, c, i, o, a, s, f;
|
|
3337
3337
|
if (this.re.schema_test.test(e)) {
|
|
3338
3338
|
for (a = this.re.schema_search, a.lastIndex = 0; (t = a.exec(e)) !== null; )
|
|
3339
|
-
if (
|
|
3340
|
-
this.__schema__ = t[2], this.__index__ = t.index + t[1].length, this.__last_index__ = t.index + t[0].length +
|
|
3339
|
+
if (c = this.testSchemaAt(e, t[2], a.lastIndex), c) {
|
|
3340
|
+
this.__schema__ = t[2], this.__index__ = t.index + t[1].length, this.__last_index__ = t.index + t[0].length + c;
|
|
3341
3341
|
break;
|
|
3342
3342
|
}
|
|
3343
3343
|
}
|
|
3344
|
-
return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (s = e.search(this.re.host_fuzzy_test), s >= 0 && (this.__index__ < 0 || s < this.__index__) && (n = e.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null && (i = n.index + n[1].length, (this.__index__ < 0 || i < this.__index__) && (this.__schema__ = "", this.__index__ = i, this.__last_index__ = n.index + n[0].length))), this.__opts__.fuzzyEmail && this.__compiled__["mailto:"] && (
|
|
3344
|
+
return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (s = e.search(this.re.host_fuzzy_test), s >= 0 && (this.__index__ < 0 || s < this.__index__) && (n = e.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null && (i = n.index + n[1].length, (this.__index__ < 0 || i < this.__index__) && (this.__schema__ = "", this.__index__ = i, this.__last_index__ = n.index + n[0].length))), this.__opts__.fuzzyEmail && this.__compiled__["mailto:"] && (f = e.indexOf("@"), f >= 0 && (r = e.match(this.re.email_fuzzy)) !== null && (i = r.index + r[1].length, o = r.index + r[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;
|
|
3345
3345
|
};
|
|
3346
3346
|
J.prototype.pretest = function(e) {
|
|
3347
3347
|
return this.re.pretest.test(e);
|
|
@@ -3366,21 +3366,21 @@ J.prototype.matchAtStart = function(e) {
|
|
|
3366
3366
|
return n ? (this.__schema__ = t[2], this.__index__ = t.index + t[1].length, this.__last_index__ = t.index + t[0].length + n, a0(this, 0)) : null;
|
|
3367
3367
|
};
|
|
3368
3368
|
J.prototype.tlds = function(e, t) {
|
|
3369
|
-
return e = Array.isArray(e) ? e : [e], t ? (this.__tlds__ = this.__tlds__.concat(e).sort().filter(function(n, r,
|
|
3370
|
-
return n !==
|
|
3371
|
-
}).reverse(),
|
|
3369
|
+
return e = Array.isArray(e) ? e : [e], t ? (this.__tlds__ = this.__tlds__.concat(e).sort().filter(function(n, r, c) {
|
|
3370
|
+
return n !== c[r - 1];
|
|
3371
|
+
}).reverse(), ye(this), this) : (this.__tlds__ = e.slice(), this.__tlds_replaced__ = !0, ye(this), this);
|
|
3372
3372
|
};
|
|
3373
3373
|
J.prototype.normalize = function(e) {
|
|
3374
3374
|
e.schema || (e.url = "http://" + e.url), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = "mailto:" + e.url);
|
|
3375
3375
|
};
|
|
3376
3376
|
J.prototype.onCompile = function() {
|
|
3377
3377
|
};
|
|
3378
|
-
const Bu = 2147483647, ou = 36, k0 = 1,
|
|
3378
|
+
const Bu = 2147483647, ou = 36, k0 = 1, te = 26, Yo = 38, Xo = 700, Zt = 72, Vt = 128, Yt = "-", Jo = /^xn--/, Qo = /[^\0-\x7F]/, Ko = /[\x2E\u3002\uFF0E\uFF61]/g, ui = {
|
|
3379
3379
|
overflow: "Overflow: input needs wider integers to process",
|
|
3380
3380
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
3381
3381
|
"invalid-input": "Invalid input"
|
|
3382
|
-
}, e0 = ou - k0,
|
|
3383
|
-
function
|
|
3382
|
+
}, e0 = ou - k0, iu = Math.floor, t0 = String.fromCharCode;
|
|
3383
|
+
function pu(u) {
|
|
3384
3384
|
throw new RangeError(ui[u]);
|
|
3385
3385
|
}
|
|
3386
3386
|
function ei(u, e) {
|
|
@@ -3393,9 +3393,9 @@ function ei(u, e) {
|
|
|
3393
3393
|
function Xt(u, e) {
|
|
3394
3394
|
const t = u.split("@");
|
|
3395
3395
|
let n = "";
|
|
3396
|
-
t.length > 1 && (n = t[0] + "@", u = t[1]), u = u.replace(
|
|
3397
|
-
const r = u.split("."),
|
|
3398
|
-
return n +
|
|
3396
|
+
t.length > 1 && (n = t[0] + "@", u = t[1]), u = u.replace(Ko, ".");
|
|
3397
|
+
const r = u.split("."), c = ei(r, e).join(".");
|
|
3398
|
+
return n + c;
|
|
3399
3399
|
}
|
|
3400
3400
|
function Jt(u) {
|
|
3401
3401
|
const e = [];
|
|
@@ -3404,8 +3404,8 @@ function Jt(u) {
|
|
|
3404
3404
|
for (; t < n; ) {
|
|
3405
3405
|
const r = u.charCodeAt(t++);
|
|
3406
3406
|
if (r >= 55296 && r <= 56319 && t < n) {
|
|
3407
|
-
const
|
|
3408
|
-
(
|
|
3407
|
+
const c = u.charCodeAt(t++);
|
|
3408
|
+
(c & 64512) == 56320 ? e.push(((r & 1023) << 10) + (c & 1023) + 65536) : (e.push(r), t--);
|
|
3409
3409
|
} else
|
|
3410
3410
|
e.push(r);
|
|
3411
3411
|
}
|
|
@@ -3413,74 +3413,74 @@ function Jt(u) {
|
|
|
3413
3413
|
}
|
|
3414
3414
|
const ti = (u) => String.fromCodePoint(...u), ni = function(u) {
|
|
3415
3415
|
return u >= 48 && u < 58 ? 26 + (u - 48) : u >= 65 && u < 91 ? u - 65 : u >= 97 && u < 123 ? u - 97 : ou;
|
|
3416
|
-
},
|
|
3416
|
+
}, At = function(u, e) {
|
|
3417
3417
|
return u + 22 + 75 * (u < 26) - ((e != 0) << 5);
|
|
3418
3418
|
}, Qt = function(u, e, t) {
|
|
3419
3419
|
let n = 0;
|
|
3420
|
-
for (u = t ?
|
|
3421
|
-
u =
|
|
3422
|
-
return
|
|
3420
|
+
for (u = t ? iu(u / Xo) : u >> 1, u += iu(u / e); u > e0 * te >> 1; n += ou)
|
|
3421
|
+
u = iu(u / e0);
|
|
3422
|
+
return iu(n + (e0 + 1) * u / (u + Yo));
|
|
3423
3423
|
}, Kt = function(u) {
|
|
3424
3424
|
const e = [], t = u.length;
|
|
3425
|
-
let n = 0, r = Vt,
|
|
3425
|
+
let n = 0, r = Vt, c = Zt, i = u.lastIndexOf(Yt);
|
|
3426
3426
|
i < 0 && (i = 0);
|
|
3427
|
-
for (let
|
|
3428
|
-
u.charCodeAt(
|
|
3429
|
-
for (let
|
|
3427
|
+
for (let o = 0; o < i; ++o)
|
|
3428
|
+
u.charCodeAt(o) >= 128 && pu("not-basic"), e.push(u.charCodeAt(o));
|
|
3429
|
+
for (let o = i > 0 ? i + 1 : 0; o < t; ) {
|
|
3430
3430
|
const a = n;
|
|
3431
|
-
for (let
|
|
3432
|
-
|
|
3433
|
-
const
|
|
3434
|
-
|
|
3435
|
-
const
|
|
3436
|
-
if (
|
|
3431
|
+
for (let f = 1, d = ou; ; d += ou) {
|
|
3432
|
+
o >= t && pu("invalid-input");
|
|
3433
|
+
const _ = ni(u.charCodeAt(o++));
|
|
3434
|
+
_ >= ou && pu("invalid-input"), _ > iu((Bu - n) / f) && pu("overflow"), n += _ * f;
|
|
3435
|
+
const b = d <= c ? k0 : d >= c + te ? te : d - c;
|
|
3436
|
+
if (_ < b)
|
|
3437
3437
|
break;
|
|
3438
|
-
const
|
|
3439
|
-
|
|
3438
|
+
const h = ou - b;
|
|
3439
|
+
f > iu(Bu / h) && pu("overflow"), f *= h;
|
|
3440
3440
|
}
|
|
3441
3441
|
const s = e.length + 1;
|
|
3442
|
-
|
|
3442
|
+
c = Qt(n - a, s, a == 0), iu(n / s) > Bu - r && pu("overflow"), r += iu(n / s), n %= s, e.splice(n++, 0, r);
|
|
3443
3443
|
}
|
|
3444
3444
|
return String.fromCodePoint(...e);
|
|
3445
3445
|
}, un = function(u) {
|
|
3446
3446
|
const e = [];
|
|
3447
3447
|
u = Jt(u);
|
|
3448
3448
|
const t = u.length;
|
|
3449
|
-
let n = Vt, r = 0,
|
|
3449
|
+
let n = Vt, r = 0, c = Zt;
|
|
3450
3450
|
for (const a of u)
|
|
3451
3451
|
a < 128 && e.push(t0(a));
|
|
3452
3452
|
const i = e.length;
|
|
3453
|
-
let
|
|
3454
|
-
for (i && e.push(Yt);
|
|
3453
|
+
let o = i;
|
|
3454
|
+
for (i && e.push(Yt); o < t; ) {
|
|
3455
3455
|
let a = Bu;
|
|
3456
|
-
for (const
|
|
3457
|
-
|
|
3458
|
-
const s =
|
|
3459
|
-
a - n >
|
|
3460
|
-
for (const
|
|
3461
|
-
if (
|
|
3462
|
-
let
|
|
3463
|
-
for (let
|
|
3464
|
-
const
|
|
3465
|
-
if (
|
|
3456
|
+
for (const f of u)
|
|
3457
|
+
f >= n && f < a && (a = f);
|
|
3458
|
+
const s = o + 1;
|
|
3459
|
+
a - n > iu((Bu - r) / s) && pu("overflow"), r += (a - n) * s, n = a;
|
|
3460
|
+
for (const f of u)
|
|
3461
|
+
if (f < n && ++r > Bu && pu("overflow"), f === n) {
|
|
3462
|
+
let d = r;
|
|
3463
|
+
for (let _ = ou; ; _ += ou) {
|
|
3464
|
+
const b = _ <= c ? k0 : _ >= c + te ? te : _ - c;
|
|
3465
|
+
if (d < b)
|
|
3466
3466
|
break;
|
|
3467
|
-
const
|
|
3467
|
+
const h = d - b, C = ou - b;
|
|
3468
3468
|
e.push(
|
|
3469
|
-
t0(
|
|
3470
|
-
),
|
|
3469
|
+
t0(At(b + h % C, 0))
|
|
3470
|
+
), d = iu(h / C);
|
|
3471
3471
|
}
|
|
3472
|
-
e.push(t0(
|
|
3472
|
+
e.push(t0(At(d, 0))), c = Qt(r, s, o === i), r = 0, ++o;
|
|
3473
3473
|
}
|
|
3474
3474
|
++r, ++n;
|
|
3475
3475
|
}
|
|
3476
3476
|
return e.join("");
|
|
3477
3477
|
}, ri = function(u) {
|
|
3478
3478
|
return Xt(u, function(e) {
|
|
3479
|
-
return
|
|
3479
|
+
return Jo.test(e) ? Kt(e.slice(4).toLowerCase()) : e;
|
|
3480
3480
|
});
|
|
3481
|
-
},
|
|
3481
|
+
}, ci = function(u) {
|
|
3482
3482
|
return Xt(u, function(e) {
|
|
3483
|
-
return
|
|
3483
|
+
return Qo.test(e) ? "xn--" + un(e) : e;
|
|
3484
3484
|
});
|
|
3485
3485
|
}, en = {
|
|
3486
3486
|
/**
|
|
@@ -3502,9 +3502,9 @@ const ti = (u) => String.fromCodePoint(...u), ni = function(u) {
|
|
|
3502
3502
|
},
|
|
3503
3503
|
decode: Kt,
|
|
3504
3504
|
encode: un,
|
|
3505
|
-
toASCII:
|
|
3505
|
+
toASCII: ci,
|
|
3506
3506
|
toUnicode: ri
|
|
3507
|
-
},
|
|
3507
|
+
}, oi = {
|
|
3508
3508
|
options: {
|
|
3509
3509
|
// Enable HTML tags in source
|
|
3510
3510
|
html: !1,
|
|
@@ -3670,7 +3670,7 @@ const ti = (u) => String.fromCodePoint(...u), ni = function(u) {
|
|
|
3670
3670
|
}
|
|
3671
3671
|
}
|
|
3672
3672
|
}, si = {
|
|
3673
|
-
default:
|
|
3673
|
+
default: oi,
|
|
3674
3674
|
zero: ii,
|
|
3675
3675
|
commonmark: ai
|
|
3676
3676
|
}, li = /^(vbscript|javascript|file|data):/, fi = /^data:image\/(gif|png|jpeg|webp);/;
|
|
@@ -3679,35 +3679,35 @@ function di(u) {
|
|
|
3679
3679
|
return li.test(e) ? fi.test(e) : !0;
|
|
3680
3680
|
}
|
|
3681
3681
|
const tn = ["http:", "https:", "mailto:"];
|
|
3682
|
-
function
|
|
3683
|
-
const e =
|
|
3682
|
+
function hi(u) {
|
|
3683
|
+
const e = b0(u, !0);
|
|
3684
3684
|
if (e.hostname && (!e.protocol || tn.indexOf(e.protocol) >= 0))
|
|
3685
3685
|
try {
|
|
3686
3686
|
e.hostname = en.toASCII(e.hostname);
|
|
3687
3687
|
} catch {
|
|
3688
3688
|
}
|
|
3689
|
-
return
|
|
3689
|
+
return oe(h0(e));
|
|
3690
3690
|
}
|
|
3691
|
-
function
|
|
3692
|
-
const e =
|
|
3691
|
+
function bi(u) {
|
|
3692
|
+
const e = b0(u, !0);
|
|
3693
3693
|
if (e.hostname && (!e.protocol || tn.indexOf(e.protocol) >= 0))
|
|
3694
3694
|
try {
|
|
3695
3695
|
e.hostname = en.toUnicode(e.hostname);
|
|
3696
3696
|
} catch {
|
|
3697
3697
|
}
|
|
3698
|
-
return zu(
|
|
3698
|
+
return zu(h0(e), zu.defaultChars + "%");
|
|
3699
3699
|
}
|
|
3700
3700
|
function K(u, e) {
|
|
3701
3701
|
if (!(this instanceof K))
|
|
3702
3702
|
return new K(u, e);
|
|
3703
|
-
e ||
|
|
3703
|
+
e || _0(u) || (e = u || {}, u = "default"), this.inline = new ae(), this.block = new Se(), this.core = new x0(), this.renderer = new Uu(), this.linkify = new J(), this.validateLink = di, this.normalizeLink = hi, this.normalizeLinkText = bi, this.utils = pc, this.helpers = Fe({}, gc), this.options = {}, this.configure(u), e && this.set(e);
|
|
3704
3704
|
}
|
|
3705
3705
|
K.prototype.set = function(u) {
|
|
3706
|
-
return
|
|
3706
|
+
return Fe(this.options, u), this;
|
|
3707
3707
|
};
|
|
3708
3708
|
K.prototype.configure = function(u) {
|
|
3709
3709
|
const e = this;
|
|
3710
|
-
if (
|
|
3710
|
+
if (_0(u)) {
|
|
3711
3711
|
const t = u;
|
|
3712
3712
|
if (u = si[t], !u)
|
|
3713
3713
|
throw new Error('Wrong `markdown-it` preset "' + t + '", check name');
|
|
@@ -3762,7 +3762,7 @@ K.prototype.parseInline = function(u, e) {
|
|
|
3762
3762
|
K.prototype.renderInline = function(u, e) {
|
|
3763
3763
|
return e = e || {}, this.renderer.render(this.parseInline(u, e), this.options, e);
|
|
3764
3764
|
};
|
|
3765
|
-
class
|
|
3765
|
+
class Ii extends f0 {
|
|
3766
3766
|
constructor(t = {}) {
|
|
3767
3767
|
super();
|
|
3768
3768
|
Ou(this, "mdConfig");
|
|
@@ -3774,37 +3774,34 @@ class Mi extends f0 {
|
|
|
3774
3774
|
}
|
|
3775
3775
|
render(t) {
|
|
3776
3776
|
const { content: n, ...r } = t;
|
|
3777
|
-
let
|
|
3777
|
+
let c = "";
|
|
3778
3778
|
try {
|
|
3779
|
-
|
|
3780
|
-
} catch (
|
|
3781
|
-
console.error("Error rendering markdown:",
|
|
3779
|
+
c = this.md.render(n ?? "");
|
|
3780
|
+
} catch (o) {
|
|
3781
|
+
console.error("Error rendering markdown:", o), c = n ?? "";
|
|
3782
3782
|
}
|
|
3783
3783
|
if (this.sanitizeDisabled)
|
|
3784
|
-
return console.warn("HTML sanitization is disabled, potential XSS risk"),
|
|
3785
|
-
const i = Sr.sanitize(
|
|
3786
|
-
return
|
|
3784
|
+
return console.warn("HTML sanitization is disabled, potential XSS risk"), xu("div", { ...this.defaultAttrs, ...r, innerHTML: c });
|
|
3785
|
+
const i = Sr.sanitize(c, this.dompurifyConfig);
|
|
3786
|
+
return xu("div", { ...this.defaultAttrs, ...r, innerHTML: i });
|
|
3787
3787
|
}
|
|
3788
3788
|
}
|
|
3789
|
-
const
|
|
3789
|
+
const pi = {
|
|
3790
3790
|
key: 0,
|
|
3791
|
-
class: /* @__PURE__ */
|
|
3792
|
-
}, mi = {
|
|
3793
|
-
key: 2,
|
|
3794
|
-
class: "tr-bubble__content-wrapper"
|
|
3791
|
+
class: /* @__PURE__ */ Cu(["tr-bubble__avatar"])
|
|
3795
3792
|
}, _i = {
|
|
3796
3793
|
key: 0,
|
|
3797
3794
|
class: "tr-bubble__content-items"
|
|
3798
|
-
},
|
|
3795
|
+
}, mi = {
|
|
3799
3796
|
key: 1,
|
|
3800
3797
|
class: "tr-bubble__body-text"
|
|
3801
|
-
},
|
|
3798
|
+
}, xi = {
|
|
3802
3799
|
key: 2,
|
|
3803
3800
|
class: "tr-bubble__aborted"
|
|
3804
|
-
},
|
|
3801
|
+
}, gi = {
|
|
3805
3802
|
key: 3,
|
|
3806
3803
|
class: "tr-bubble__footer"
|
|
3807
|
-
},
|
|
3804
|
+
}, ki = /* @__PURE__ */ Fu({
|
|
3808
3805
|
__name: "Bubble",
|
|
3809
3806
|
props: {
|
|
3810
3807
|
content: { default: "" },
|
|
@@ -3822,69 +3819,71 @@ const bi = {
|
|
|
3822
3819
|
},
|
|
3823
3820
|
setup(u) {
|
|
3824
3821
|
const e = u, t = kn(), n = X(() => {
|
|
3825
|
-
const
|
|
3826
|
-
|
|
3827
|
-
|
|
3822
|
+
const d = e.contentRenderer;
|
|
3823
|
+
if (!d)
|
|
3824
|
+
return null;
|
|
3825
|
+
if (typeof d == "function") {
|
|
3826
|
+
const _ = d;
|
|
3827
|
+
return xu(() => _(e));
|
|
3828
|
+
}
|
|
3829
|
+
return d instanceof f0 ? xu(() => d.render(e)) : xu(d, e);
|
|
3830
|
+
}), r = En(), c = X(() => {
|
|
3828
3831
|
if (!e.customContentField)
|
|
3829
3832
|
return null;
|
|
3830
|
-
const
|
|
3831
|
-
return typeof
|
|
3832
|
-
}), i = X(() =>
|
|
3833
|
+
const d = r[e.customContentField];
|
|
3834
|
+
return typeof d == "string" || Array.isArray(d) && d.length > 0 ? d : null;
|
|
3835
|
+
}), i = X(() => c.value || e.content), o = X(() => Array.isArray(i.value) ? "" : i.value), a = X(() => Array.isArray(i.value) ? i.value : []), s = X(() => e.placement === "start"), f = X(() => e.maxWidth ? {
|
|
3833
3836
|
"--max-width": Tn(e.maxWidth)
|
|
3834
3837
|
} : {});
|
|
3835
|
-
return (
|
|
3836
|
-
class:
|
|
3838
|
+
return (d, _) => (v(), W("div", {
|
|
3839
|
+
class: Cu([
|
|
3837
3840
|
"tr-bubble",
|
|
3838
3841
|
{
|
|
3839
3842
|
"placement-start": s.value,
|
|
3840
3843
|
"placement-end": !s.value
|
|
3841
3844
|
}
|
|
3842
3845
|
]),
|
|
3843
|
-
style: An(
|
|
3846
|
+
style: An(f.value)
|
|
3844
3847
|
}, [
|
|
3845
|
-
e.avatar ? (
|
|
3846
|
-
(
|
|
3847
|
-
])) :
|
|
3848
|
-
e.loading ?
|
|
3848
|
+
e.avatar ? (v(), W("div", pi, [
|
|
3849
|
+
(v(), hu(Pu(e.avatar)))
|
|
3850
|
+
])) : Qu("", !0),
|
|
3851
|
+
e.loading ? ke(d.$slots, "loading", {
|
|
3849
3852
|
key: 1,
|
|
3850
3853
|
bubbleProps: e
|
|
3851
3854
|
}, () => [
|
|
3852
|
-
|
|
3853
|
-
class:
|
|
3854
|
-
}, [...
|
|
3855
|
-
|
|
3855
|
+
Y("div", {
|
|
3856
|
+
class: Cu(["tr-bubble__content", { "border-corner": e.shape === "corner" }])
|
|
3857
|
+
}, [..._[0] || (_[0] = [
|
|
3858
|
+
Y("img", {
|
|
3856
3859
|
src: Fn,
|
|
3857
3860
|
alt: "loading",
|
|
3858
3861
|
class: "tr-bubble__loading"
|
|
3859
3862
|
}, null, -1)
|
|
3860
3863
|
])], 2)
|
|
3861
|
-
], !0) : (
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
])) : Pu("", !0)
|
|
3882
|
-
], 2),
|
|
3883
|
-
Qu(f.$slots, "trailer", { bubbleProps: e }, void 0, !0)
|
|
3884
|
-
]))
|
|
3864
|
+
], !0) : (v(), W("div", {
|
|
3865
|
+
key: 2,
|
|
3866
|
+
class: Cu(["tr-bubble__content", { "border-corner": e.shape === "corner" }])
|
|
3867
|
+
}, [
|
|
3868
|
+
a.value.length ? (v(), W("div", _i, [
|
|
3869
|
+
(v(!0), W(Dt, null, Ee(a.value, (b, h) => (v(), hu(l0(or), {
|
|
3870
|
+
key: h,
|
|
3871
|
+
item: b
|
|
3872
|
+
}, null, 8, ["item"]))), 128))
|
|
3873
|
+
])) : ke(d.$slots, "default", {
|
|
3874
|
+
key: 1,
|
|
3875
|
+
bubbleProps: e
|
|
3876
|
+
}, () => [
|
|
3877
|
+
n.value ? (v(), hu(Pu(n.value), { key: 0 })) : (v(), W("span", mi, Du(o.value), 1))
|
|
3878
|
+
], !0),
|
|
3879
|
+
e.aborted ? (v(), W("span", xi, Du(e.abortedText), 1)) : Qu("", !0),
|
|
3880
|
+
t.footer ? (v(), W("div", gi, [
|
|
3881
|
+
ke(d.$slots, "footer", { bubbleProps: e }, void 0, !0)
|
|
3882
|
+
])) : Qu("", !0)
|
|
3883
|
+
], 2))
|
|
3885
3884
|
], 6));
|
|
3886
3885
|
}
|
|
3887
|
-
}),
|
|
3886
|
+
}), yu = /* @__PURE__ */ ce(ki, [["__scopeId", "data-v-6c781ef4"]]), Ei = /* @__PURE__ */ Fu({
|
|
3888
3887
|
__name: "BubbleList",
|
|
3889
3888
|
props: {
|
|
3890
3889
|
items: {},
|
|
@@ -3897,19 +3896,19 @@ const bi = {
|
|
|
3897
3896
|
const e = u, t = s0(null), { y: n } = Mn(t, {
|
|
3898
3897
|
behavior: "smooth",
|
|
3899
3898
|
throttle: 100
|
|
3900
|
-
}), r = X(() => e.items.at(-1)),
|
|
3901
|
-
var
|
|
3899
|
+
}), r = X(() => e.items.at(-1)), c = X(() => {
|
|
3900
|
+
var f, d;
|
|
3902
3901
|
if (!r.value)
|
|
3903
3902
|
return 0;
|
|
3904
|
-
const a = r.value.customContentField || ((
|
|
3903
|
+
const a = r.value.customContentField || ((d = (f = e.roles) == null ? void 0 : f[r.value.role || ""]) == null ? void 0 : d.customContentField);
|
|
3905
3904
|
if (!a)
|
|
3906
3905
|
return 0;
|
|
3907
3906
|
const s = r.value;
|
|
3908
3907
|
if (Array.isArray(s[a])) {
|
|
3909
|
-
const
|
|
3910
|
-
if (
|
|
3908
|
+
const _ = s[a].at(-1);
|
|
3909
|
+
if (_ && typeof _ == "object" && "content" in _)
|
|
3911
3910
|
try {
|
|
3912
|
-
return JSON.stringify(
|
|
3911
|
+
return JSON.stringify(_.content).length;
|
|
3913
3912
|
} catch {
|
|
3914
3913
|
}
|
|
3915
3914
|
return s[a].length;
|
|
@@ -3919,7 +3918,7 @@ const bi = {
|
|
|
3919
3918
|
Cn(
|
|
3920
3919
|
() => {
|
|
3921
3920
|
var a;
|
|
3922
|
-
return [e.autoScroll, e.items.length, (a = r.value) == null ? void 0 : a.content,
|
|
3921
|
+
return [e.autoScroll, e.items.length, (a = r.value) == null ? void 0 : a.content, c.value];
|
|
3923
3922
|
},
|
|
3924
3923
|
([a]) => {
|
|
3925
3924
|
Dn(() => {
|
|
@@ -3928,54 +3927,50 @@ const bi = {
|
|
|
3928
3927
|
},
|
|
3929
3928
|
{ deep: !0 }
|
|
3930
3929
|
);
|
|
3931
|
-
const i = X(() => e.items.map((a
|
|
3932
|
-
var
|
|
3933
|
-
const
|
|
3930
|
+
const i = X(() => e.items.map((a) => {
|
|
3931
|
+
var C;
|
|
3932
|
+
const s = a.role ? ((C = e.roles) == null ? void 0 : C[a.role]) || {} : {};
|
|
3933
|
+
if (s.hidden)
|
|
3934
|
+
return null;
|
|
3935
|
+
const { slots: f, hidden: d, ..._ } = s, { slots: b, ...h } = a;
|
|
3934
3936
|
return {
|
|
3935
3937
|
id: a.id,
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
props: { ...h, ...C, "data-role": a.role },
|
|
3939
|
-
slots: { ...f, ...p }
|
|
3938
|
+
props: { ..._, ...h, "data-role": a.role },
|
|
3939
|
+
slots: { ...f, ...b }
|
|
3940
3940
|
};
|
|
3941
|
-
})),
|
|
3942
|
-
var
|
|
3943
|
-
if (!(e.loading && e.loadingRole && ((
|
|
3941
|
+
}).filter((a) => !!a)), o = X(() => {
|
|
3942
|
+
var f;
|
|
3943
|
+
if (!(e.loading && e.loadingRole && ((f = e.roles) != null && f[e.loadingRole])))
|
|
3944
3944
|
return null;
|
|
3945
3945
|
const { slots: a, ...s } = e.roles[e.loadingRole];
|
|
3946
3946
|
return { props: { ...s, loading: !0 }, slots: a };
|
|
3947
3947
|
});
|
|
3948
|
-
return (a, s) => (
|
|
3948
|
+
return (a, s) => (v(), W("div", {
|
|
3949
3949
|
class: "tr-bubble-list",
|
|
3950
3950
|
ref_key: "scrollContainerRef",
|
|
3951
3951
|
ref: t
|
|
3952
3952
|
}, [
|
|
3953
|
-
(
|
|
3954
|
-
key:
|
|
3955
|
-
}, [
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
c.value ? (S(), eu(Du, Ce(Ku({ key: 0 }, c.value.props)), V0({ _: 2 }, [
|
|
3969
|
-
Ee(c.value.slots, (d, f) => ({
|
|
3970
|
-
name: f,
|
|
3971
|
-
fn: Y0((m) => [
|
|
3972
|
-
(S(), eu(_u(d), Ce(yn(m)), null, 16))
|
|
3953
|
+
(v(!0), W(Dt, null, Ee(i.value, (f, d) => (v(), hu(yu, $e({
|
|
3954
|
+
key: f.id || d
|
|
3955
|
+
}, { ref_for: !0 }, f.props), W0({ _: 2 }, [
|
|
3956
|
+
Ee(f.slots, (_, b) => ({
|
|
3957
|
+
name: b,
|
|
3958
|
+
fn: Z0((h) => [
|
|
3959
|
+
(v(), hu(Pu(_), $e({ ref_for: !0 }, h), null, 16))
|
|
3960
|
+
])
|
|
3961
|
+
}))
|
|
3962
|
+
]), 1040))), 128)),
|
|
3963
|
+
o.value ? (v(), hu(yu, V0($e({ key: 0 }, o.value.props)), W0({ _: 2 }, [
|
|
3964
|
+
Ee(o.value.slots, (f, d) => ({
|
|
3965
|
+
name: d,
|
|
3966
|
+
fn: Z0((_) => [
|
|
3967
|
+
(v(), hu(Pu(f), V0(yn(_)), null, 16))
|
|
3973
3968
|
])
|
|
3974
3969
|
}))
|
|
3975
|
-
]), 1040)) :
|
|
3970
|
+
]), 1040)) : Qu("", !0)
|
|
3976
3971
|
], 512));
|
|
3977
3972
|
}
|
|
3978
|
-
}),
|
|
3973
|
+
}), ne = /* @__PURE__ */ ce(Ei, [["__scopeId", "data-v-a5afaa8b"]]), re = /* @__PURE__ */ Fu({
|
|
3979
3974
|
__name: "BubbleProvider",
|
|
3980
3975
|
props: {
|
|
3981
3976
|
contentRenderers: { default: () => ({}) }
|
|
@@ -3986,31 +3981,31 @@ const bi = {
|
|
|
3986
3981
|
t.set(n, r);
|
|
3987
3982
|
for (const [n, r] of Object.entries(e.contentRenderers))
|
|
3988
3983
|
t.set(n, r);
|
|
3989
|
-
return
|
|
3984
|
+
return Y0(Ft, t), Y0(Tt, d0), (n, r) => ke(n.$slots, "default");
|
|
3990
3985
|
}
|
|
3991
3986
|
});
|
|
3992
|
-
|
|
3987
|
+
yu.name = "TrBubble";
|
|
3988
|
+
const Ai = function(u) {
|
|
3989
|
+
u.component(yu.name, yu);
|
|
3990
|
+
};
|
|
3991
|
+
yu.install = Ai;
|
|
3992
|
+
const Mi = yu;
|
|
3993
|
+
ne.name = "TrBubbleList";
|
|
3993
3994
|
const Ci = function(u) {
|
|
3994
|
-
u.component(
|
|
3995
|
+
u.component(ne.name, ne);
|
|
3995
3996
|
};
|
|
3996
|
-
|
|
3997
|
-
const Li =
|
|
3998
|
-
re.name = "
|
|
3997
|
+
ne.install = Ci;
|
|
3998
|
+
const Li = ne;
|
|
3999
|
+
re.name = "TrBubbleProvider";
|
|
3999
4000
|
const Di = function(u) {
|
|
4000
4001
|
u.component(re.name, re);
|
|
4001
4002
|
};
|
|
4002
4003
|
re.install = Di;
|
|
4003
4004
|
const Oi = re;
|
|
4004
|
-
oe.name = "TrBubbleProvider";
|
|
4005
|
-
const yi = function(u) {
|
|
4006
|
-
u.component(oe.name, oe);
|
|
4007
|
-
};
|
|
4008
|
-
oe.install = yi;
|
|
4009
|
-
const Ni = oe;
|
|
4010
4005
|
export {
|
|
4011
|
-
|
|
4006
|
+
Mi as Bubble,
|
|
4012
4007
|
f0 as BubbleContentClassRenderer,
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4008
|
+
Li as BubbleList,
|
|
4009
|
+
Ii as BubbleMarkdownContentRenderer,
|
|
4010
|
+
Oi as BubbleProvider
|
|
4016
4011
|
};
|