@opentiny/tiny-robot 0.3.0-rc.1 → 0.3.0-rc.2
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 +459 -458
- package/dist/container/index.js +7 -7
- package/dist/icon-button/index.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/mcp-server-picker/index.js +2 -2
- package/dist/sender/index.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/bubble/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var hn = Object.defineProperty;
|
|
2
2
|
var pn = (u, e, t) => e in u ? hn(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
3
|
+
var Mu = (u, e, t) => pn(u, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { defineComponent as Du, ref as c0, createElementBlock as $, openBlock as S, createElementVNode as Y, createVNode as At, toDisplayString as Au, unref as i0, normalizeClass as Eu, withDirectives as bn, vShow as _n, computed as J, useCssModule as mn, createCommentVNode as Xu, createBlock as eu, resolveDynamicComponent as mu, createTextVNode as xn, inject as $0, normalizeProps as Ae, mergeProps as Ju, h as j0, useSlots as gn, useAttrs as kn, normalizeStyle as En, renderSlot as ge, Fragment as u0, renderList as ke, watch as An, createSlots as G0, withCtx as W0, guardReactiveProps as Cn, provide as Z0 } from "vue";
|
|
5
5
|
import { _ as Dn } from "../loading.js";
|
|
6
6
|
import { t as yn } from "../utils.js";
|
|
7
7
|
import { IconArrowUp as Fn, IconPlugin as V0, IconArrowDown as Tn, IconLoading as Sn, IconError as wn, IconCancelled as vn } from "@opentiny/tiny-robot-svgs";
|
|
@@ -9,7 +9,7 @@ import { _ as re } from "../_plugin-vue_export-helper.js";
|
|
|
9
9
|
import { u as Rn } from "../index2.js";
|
|
10
10
|
class a0 {
|
|
11
11
|
}
|
|
12
|
-
const In = { class: "tr-bubble__step-text" }, Mn = { class: "tr-bubble__step-text-title" }, Ln = { class: "tr-bubble__step-text-content-wrapper" }, On = /* @__PURE__ */
|
|
12
|
+
const In = { class: "tr-bubble__step-text" }, Mn = { class: "tr-bubble__step-text-title" }, Ln = { class: "tr-bubble__step-text-content-wrapper" }, On = /* @__PURE__ */ Du({
|
|
13
13
|
__name: "collapsible-text",
|
|
14
14
|
props: {
|
|
15
15
|
title: {},
|
|
@@ -17,35 +17,35 @@ const In = { class: "tr-bubble__step-text" }, Mn = { class: "tr-bubble__step-tex
|
|
|
17
17
|
defaultOpen: { type: Boolean }
|
|
18
18
|
},
|
|
19
19
|
setup(u) {
|
|
20
|
-
const e = u, t =
|
|
20
|
+
const e = u, t = c0(e.defaultOpen ?? !1);
|
|
21
21
|
return (n, r) => (S(), $("div", In, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
At(
|
|
25
|
-
class:
|
|
22
|
+
Y("div", Mn, [
|
|
23
|
+
Y("span", null, Au(e.title), 1),
|
|
24
|
+
At(i0(Fn), {
|
|
25
|
+
class: Eu(["expand-icon", { "rotate-180": !t.value }]),
|
|
26
26
|
onClick: r[0] || (r[0] = (o) => t.value = !t.value)
|
|
27
27
|
}, null, 8, ["class"])
|
|
28
28
|
]),
|
|
29
|
-
|
|
30
|
-
bn(
|
|
29
|
+
Y("div", Ln, [
|
|
30
|
+
bn(Y("div", { class: "tr-bubble__step-text-content" }, Au(e.content), 513), [
|
|
31
31
|
[_n, t.value]
|
|
32
32
|
])
|
|
33
33
|
])
|
|
34
34
|
]));
|
|
35
35
|
}
|
|
36
|
-
}), Nn = /* @__PURE__ */ re(On, [["__scopeId", "data-v-
|
|
36
|
+
}), Nn = /* @__PURE__ */ re(On, [["__scopeId", "data-v-c614ffd3"]]), Bn = Nn, Pn = { class: "tr-bubble__text" }, zn = /* @__PURE__ */ Du({
|
|
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) => (S(), $("span", Pn,
|
|
43
|
+
return (t, n) => (S(), $("span", Pn, Au(e.content), 1));
|
|
44
44
|
}
|
|
45
|
-
}), qn = /* @__PURE__ */ re(zn, [["__scopeId", "data-v-
|
|
45
|
+
}), qn = /* @__PURE__ */ re(zn, [["__scopeId", "data-v-ddb66b72"]]), s0 = qn, Un = { class: "tr-bubble__step-tool" }, Hn = { class: "tr-bubble__step-tool-header" }, $n = { class: "tr-bubble__step-tool-left" }, jn = { class: "tr-bubble__step-tool-title" }, Gn = { class: "tr-bubble__step-tool-name" }, Wn = { class: "tr-bubble__step-tool-expand" }, Zn = {
|
|
46
46
|
key: 0,
|
|
47
47
|
class: "tr-bubble__step-tool-params"
|
|
48
|
-
}, Vn = ["innerHTML"], Yn = /* @__PURE__ */
|
|
48
|
+
}, Vn = ["innerHTML"], Yn = /* @__PURE__ */ Du({
|
|
49
49
|
__name: "tool",
|
|
50
50
|
props: {
|
|
51
51
|
name: {},
|
|
@@ -55,69 +55,69 @@ const In = { class: "tr-bubble__step-text" }, Mn = { class: "tr-bubble__step-tex
|
|
|
55
55
|
defaultOpen: { type: Boolean }
|
|
56
56
|
},
|
|
57
57
|
setup(u) {
|
|
58
|
-
const e = u, t =
|
|
58
|
+
const e = u, t = c0(e.defaultOpen ?? !1), n = /* @__PURE__ */ new Map([
|
|
59
59
|
["running", { text: "正在调用", icon: Sn }],
|
|
60
60
|
["success", { text: "已调用", icon: V0 }],
|
|
61
61
|
["failed", { text: "调用失败", icon: wn }],
|
|
62
62
|
["cancelled", { text: "已取消", icon: vn }]
|
|
63
|
-
]), r =
|
|
63
|
+
]), r = J(() => n.get(e.status) || { text: "", icon: V0 }), o = mn(), i = (c) => {
|
|
64
64
|
if (!c)
|
|
65
65
|
return "";
|
|
66
66
|
let a = "";
|
|
67
67
|
const s = e.formatPretty ? 2 : 0;
|
|
68
68
|
try {
|
|
69
69
|
typeof c == "string" ? a = JSON.stringify(JSON.parse(c), null, s) : a = JSON.stringify(c, null, s);
|
|
70
|
-
} catch (
|
|
71
|
-
console.warn(
|
|
70
|
+
} catch (d) {
|
|
71
|
+
console.warn(d);
|
|
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
|
+
(d) => {
|
|
76
|
+
let f = "number";
|
|
77
|
+
return /^"/.test(d) ? f = /:$/.test(d) ? "key" : "string" : /true|false/.test(d) ? f = "boolean" : /null/.test(d) && (f = "null"), `<span class="${o[f]}">${d}</span>`;
|
|
78
78
|
}
|
|
79
79
|
), a;
|
|
80
80
|
};
|
|
81
81
|
return (c, a) => (S(), $("div", Un, [
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
Y("div", Hn, [
|
|
83
|
+
Y("div", $n, [
|
|
84
84
|
(S(), eu(mu(r.value.icon), {
|
|
85
|
-
class:
|
|
85
|
+
class: Eu(["tr-bubble__step-tool-icon", `icon-${e.status}`])
|
|
86
86
|
}, null, 8, ["class"])),
|
|
87
|
-
|
|
88
|
-
xn(
|
|
89
|
-
|
|
87
|
+
Y("span", jn, [
|
|
88
|
+
xn(Au(r.value.text) + " ", 1),
|
|
89
|
+
Y("span", Gn, Au(e.name), 1)
|
|
90
90
|
])
|
|
91
91
|
]),
|
|
92
|
-
|
|
93
|
-
At(
|
|
94
|
-
class:
|
|
92
|
+
Y("div", Wn, [
|
|
93
|
+
At(i0(Tn), {
|
|
94
|
+
class: Eu(["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
99
|
t.value ? (S(), $("div", Zn, [
|
|
100
|
-
a[1] || (a[1] =
|
|
101
|
-
|
|
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, Vn)
|
|
105
105
|
])) : Xu("", !0)
|
|
106
106
|
]));
|
|
107
107
|
}
|
|
108
|
-
}), Xn = "
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
}), Xn = "_key_1b448_2", Jn = "_number_1b448_6", Qn = "_string_1b448_10", Kn = "_boolean_1b448_14", ur = {
|
|
109
|
+
key: Xn,
|
|
110
|
+
number: Jn,
|
|
111
111
|
string: Qn,
|
|
112
112
|
boolean: Kn,
|
|
113
|
-
null: "
|
|
113
|
+
null: "_null_1b448_18"
|
|
114
114
|
}, er = {
|
|
115
115
|
$style: ur
|
|
116
|
-
}, tr = /* @__PURE__ */ re(Yn, [["__cssModules", er], ["__scopeId", "data-v-
|
|
116
|
+
}, tr = /* @__PURE__ */ re(Yn, [["__cssModules", er], ["__scopeId", "data-v-1c37a4c4"]]), nr = tr, Ct = /* @__PURE__ */ new Map([
|
|
117
117
|
["text", s0],
|
|
118
118
|
["tool", nr],
|
|
119
119
|
["collapsible-text", Bn]
|
|
120
|
-
]), Dt = Symbol("bubbleContentRendererMap"), yt = Symbol("bubbleContentFallbackRenderer"), rr = /* @__PURE__ */
|
|
120
|
+
]), Dt = Symbol("bubbleContentRendererMap"), yt = Symbol("bubbleContentFallbackRenderer"), rr = /* @__PURE__ */ Du({
|
|
121
121
|
__name: "ContentItem",
|
|
122
122
|
props: {
|
|
123
123
|
item: {}
|
|
@@ -126,8 +126,8 @@ const In = { class: "tr-bubble__step-text" }, Mn = { class: "tr-bubble__step-tex
|
|
|
126
126
|
const e = $0(Dt, Ct), t = $0(yt, s0), n = u, r = (i) => {
|
|
127
127
|
const c = e.get(i) || t;
|
|
128
128
|
return typeof c == "function" ? { isComponent: !1, vNodeOrComponent: c(n.item) } : c instanceof a0 ? { isComponent: !1, vNodeOrComponent: c.render(n.item) } : { isComponent: !0, vNodeOrComponent: c };
|
|
129
|
-
}, o =
|
|
130
|
-
return (i, c) => o.value.isComponent ? (S(), eu(mu(o.value.vNodeOrComponent),
|
|
129
|
+
}, o = J(() => r(n.item.type));
|
|
130
|
+
return (i, c) => o.value.isComponent ? (S(), eu(mu(o.value.vNodeOrComponent), Ae(Ju({ key: 0 }, n.item)), null, 16)) : (S(), eu(mu(o.value.vNodeOrComponent), { key: 1 }));
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
@@ -140,38 +140,38 @@ const {
|
|
|
140
140
|
} = Object;
|
|
141
141
|
let {
|
|
142
142
|
freeze: j,
|
|
143
|
-
seal:
|
|
143
|
+
seal: Q,
|
|
144
144
|
create: Tt
|
|
145
145
|
} = Object, {
|
|
146
|
-
apply:
|
|
147
|
-
construct:
|
|
146
|
+
apply: e0,
|
|
147
|
+
construct: t0
|
|
148
148
|
} = typeof Reflect < "u" && Reflect;
|
|
149
149
|
j || (j = function(e) {
|
|
150
150
|
return e;
|
|
151
151
|
});
|
|
152
|
-
|
|
152
|
+
Q || (Q = function(e) {
|
|
153
153
|
return e;
|
|
154
154
|
});
|
|
155
|
-
|
|
155
|
+
e0 || (e0 = function(e, t, n) {
|
|
156
156
|
return e.apply(t, n);
|
|
157
157
|
});
|
|
158
|
-
|
|
158
|
+
t0 || (t0 = function(e, t) {
|
|
159
159
|
return new e(...t);
|
|
160
160
|
});
|
|
161
|
-
const be = G(Array.prototype.forEach), ar = G(Array.prototype.lastIndexOf), X0 = G(Array.prototype.pop), Gu = G(Array.prototype.push), sr = G(Array.prototype.splice), Ee = G(String.prototype.toLowerCase),
|
|
161
|
+
const be = G(Array.prototype.forEach), ar = G(Array.prototype.lastIndexOf), X0 = G(Array.prototype.pop), Gu = G(Array.prototype.push), sr = G(Array.prototype.splice), Ee = G(String.prototype.toLowerCase), He = G(String.prototype.toString), J0 = G(String.prototype.match), Wu = G(String.prototype.replace), lr = G(String.prototype.indexOf), fr = G(String.prototype.trim), uu = G(Object.prototype.hasOwnProperty), H = G(RegExp.prototype.test), Zu = dr(TypeError);
|
|
162
162
|
function G(u) {
|
|
163
163
|
return function(e) {
|
|
164
164
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
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
|
-
return
|
|
167
|
+
return e0(u, e, n);
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
function dr(u) {
|
|
171
171
|
return function() {
|
|
172
172
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
173
173
|
t[n] = arguments[n];
|
|
174
|
-
return
|
|
174
|
+
return t0(u, t);
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
function F(u, e) {
|
|
@@ -190,13 +190,13 @@ function F(u, e) {
|
|
|
190
190
|
}
|
|
191
191
|
function hr(u) {
|
|
192
192
|
for (let e = 0; e < u.length; e++)
|
|
193
|
-
|
|
193
|
+
uu(u, e) || (u[e] = null);
|
|
194
194
|
return u;
|
|
195
195
|
}
|
|
196
196
|
function du(u) {
|
|
197
197
|
const e = Tt(null);
|
|
198
198
|
for (const [t, n] of Ft(u))
|
|
199
|
-
|
|
199
|
+
uu(u, t) && (Array.isArray(n) ? e[t] = hr(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = du(n) : e[t] = n);
|
|
200
200
|
return e;
|
|
201
201
|
}
|
|
202
202
|
function Vu(u, e) {
|
|
@@ -215,13 +215,13 @@ function Vu(u, e) {
|
|
|
215
215
|
}
|
|
216
216
|
return t;
|
|
217
217
|
}
|
|
218
|
-
const Q0 = j(["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", "section", "select", "shadow", "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"]),
|
|
218
|
+
const Q0 = j(["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", "section", "select", "shadow", "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"]), $e = j(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), je = j(["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"]), pr = j(["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"]), Ge = j(["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"]), br = j(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), K0 = j(["#text"]), ut = j(["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", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "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", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), We = j(["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", "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"]), et = j(["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"]), _e = j(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), _r = Q(/\{\{[\w\W]*|[\w\W]*\}\}/gm), mr = Q(/<%[\w\W]*|[\w\W]*%>/gm), xr = Q(/\$\{[\w\W]*/gm), gr = Q(/^data-[\-\w.\u00B7-\uFFFF]+$/), kr = Q(/^aria-[\-\w]+$/), St = Q(
|
|
219
219
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
220
220
|
// eslint-disable-line no-useless-escape
|
|
221
|
-
), Er =
|
|
221
|
+
), Er = Q(/^(?:\w+script|data):/i), Ar = Q(
|
|
222
222
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
223
223
|
// eslint-disable-line no-control-regex
|
|
224
|
-
), wt =
|
|
224
|
+
), wt = Q(/^html$/i), Cr = Q(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
225
225
|
var tt = /* @__PURE__ */ Object.freeze({
|
|
226
226
|
__proto__: null,
|
|
227
227
|
ARIA_ATTR: kr,
|
|
@@ -290,8 +290,8 @@ function vt() {
|
|
|
290
290
|
Node: c,
|
|
291
291
|
Element: a,
|
|
292
292
|
NodeFilter: s,
|
|
293
|
-
NamedNodeMap:
|
|
294
|
-
HTMLFormElement:
|
|
293
|
+
NamedNodeMap: d = u.NamedNodeMap || u.MozNamedAttrMap,
|
|
294
|
+
HTMLFormElement: f,
|
|
295
295
|
DOMParser: _,
|
|
296
296
|
trustedTypes: p
|
|
297
297
|
} = u, h = a.prototype, C = Vu(h, "cloneNode"), D = Vu(h, "remove"), T = Vu(h, "nextSibling"), E = Vu(h, "childNodes"), k = Vu(h, "parentNode");
|
|
@@ -303,7 +303,7 @@ function vt() {
|
|
|
303
303
|
const {
|
|
304
304
|
implementation: y,
|
|
305
305
|
createNodeIterator: I,
|
|
306
|
-
createDocumentFragment:
|
|
306
|
+
createDocumentFragment: V,
|
|
307
307
|
getElementsByTagName: nu
|
|
308
308
|
} = t, {
|
|
309
309
|
importNode: gu
|
|
@@ -313,9 +313,9 @@ function vt() {
|
|
|
313
313
|
const {
|
|
314
314
|
MUSTACHE_EXPR: zu,
|
|
315
315
|
ERB_EXPR: qu,
|
|
316
|
-
TMPLIT_EXPR:
|
|
316
|
+
TMPLIT_EXPR: yu,
|
|
317
317
|
DATA_ATTR: hu,
|
|
318
|
-
ARIA_ATTR:
|
|
318
|
+
ARIA_ATTR: ve,
|
|
319
319
|
IS_SCRIPT_OR_DATA: tn,
|
|
320
320
|
ATTR_WHITESPACE: x0,
|
|
321
321
|
CUSTOM_ELEMENT: nn
|
|
@@ -323,9 +323,9 @@ function vt() {
|
|
|
323
323
|
let {
|
|
324
324
|
IS_ALLOWED_URI: g0
|
|
325
325
|
} = tt, O = null;
|
|
326
|
-
const k0 = F({}, [...Q0, ...je, ...Ge, ...
|
|
326
|
+
const k0 = F({}, [...Q0, ...$e, ...je, ...Ge, ...K0]);
|
|
327
327
|
let z = null;
|
|
328
|
-
const E0 = F({}, [...ut, ...
|
|
328
|
+
const E0 = F({}, [...ut, ...We, ...et, ..._e]);
|
|
329
329
|
let R = Object.seal(Tt(null, {
|
|
330
330
|
tagNameCheck: {
|
|
331
331
|
writable: !0,
|
|
@@ -345,28 +345,28 @@ function vt() {
|
|
|
345
345
|
enumerable: !0,
|
|
346
346
|
value: !1
|
|
347
347
|
}
|
|
348
|
-
})), Uu = null,
|
|
348
|
+
})), Uu = null, Re = null, A0 = !0, Ie = !0, C0 = !1, D0 = !0, Fu = !1, ae = !0, ku = !1, Me = !1, Le = !1, Tu = !1, se = !1, le = !1, y0 = !0, F0 = !1;
|
|
349
349
|
const rn = "user-content-";
|
|
350
|
-
let
|
|
350
|
+
let Oe = !0, Hu = !1, Su = {}, wu = null;
|
|
351
351
|
const T0 = F({}, ["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"]);
|
|
352
352
|
let S0 = null;
|
|
353
353
|
const w0 = F({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
354
|
-
let
|
|
354
|
+
let Ne = null;
|
|
355
355
|
const v0 = F({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), fe = "http://www.w3.org/1998/Math/MathML", de = "http://www.w3.org/2000/svg", su = "http://www.w3.org/1999/xhtml";
|
|
356
|
-
let
|
|
357
|
-
const on = F({}, [fe, de, su],
|
|
356
|
+
let vu = su, Be = !1, Pe = null;
|
|
357
|
+
const on = F({}, [fe, de, su], He);
|
|
358
358
|
let he = F({}, ["mi", "mo", "mn", "ms", "mtext"]), pe = F({}, ["annotation-xml"]);
|
|
359
359
|
const cn = F({}, ["title", "style", "font", "a", "script"]);
|
|
360
360
|
let $u = null;
|
|
361
361
|
const an = ["application/xhtml+xml", "text/html"], sn = "text/html";
|
|
362
|
-
let N = null,
|
|
362
|
+
let N = null, Ru = null;
|
|
363
363
|
const ln = t.createElement("form"), R0 = function(l) {
|
|
364
364
|
return l instanceof RegExp || l instanceof Function;
|
|
365
|
-
},
|
|
365
|
+
}, ze = function() {
|
|
366
366
|
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
367
|
-
if (!(
|
|
367
|
+
if (!(Ru && Ru === l)) {
|
|
368
368
|
if ((!l || typeof l != "object") && (l = {}), l = du(l), $u = // eslint-disable-next-line unicorn/prefer-includes
|
|
369
|
-
an.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? sn : l.PARSER_MEDIA_TYPE, N = $u === "application/xhtml+xml" ?
|
|
369
|
+
an.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? sn : l.PARSER_MEDIA_TYPE, N = $u === "application/xhtml+xml" ? He : Ee, O = uu(l, "ALLOWED_TAGS") ? F({}, l.ALLOWED_TAGS, N) : k0, z = uu(l, "ALLOWED_ATTR") ? F({}, l.ALLOWED_ATTR, N) : E0, Pe = uu(l, "ALLOWED_NAMESPACES") ? F({}, l.ALLOWED_NAMESPACES, He) : on, Ne = uu(l, "ADD_URI_SAFE_ATTR") ? F(du(v0), l.ADD_URI_SAFE_ATTR, N) : v0, S0 = uu(l, "ADD_DATA_URI_TAGS") ? F(du(w0), l.ADD_DATA_URI_TAGS, N) : w0, wu = uu(l, "FORBID_CONTENTS") ? F({}, l.FORBID_CONTENTS, N) : T0, Uu = uu(l, "FORBID_TAGS") ? F({}, l.FORBID_TAGS, N) : du({}), Re = uu(l, "FORBID_ATTR") ? F({}, l.FORBID_ATTR, N) : du({}), Su = uu(l, "USE_PROFILES") ? l.USE_PROFILES : !1, A0 = l.ALLOW_ARIA_ATTR !== !1, Ie = l.ALLOW_DATA_ATTR !== !1, C0 = l.ALLOW_UNKNOWN_PROTOCOLS || !1, D0 = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Fu = l.SAFE_FOR_TEMPLATES || !1, ae = l.SAFE_FOR_XML !== !1, ku = l.WHOLE_DOCUMENT || !1, Tu = l.RETURN_DOM || !1, se = l.RETURN_DOM_FRAGMENT || !1, le = l.RETURN_TRUSTED_TYPE || !1, Le = l.FORCE_BODY || !1, y0 = l.SANITIZE_DOM !== !1, F0 = l.SANITIZE_NAMED_PROPS || !1, Oe = l.KEEP_CONTENT !== !1, Hu = l.IN_PLACE || !1, g0 = l.ALLOWED_URI_REGEXP || St, vu = l.NAMESPACE || su, he = l.MATHML_TEXT_INTEGRATION_POINTS || he, pe = l.HTML_INTEGRATION_POINTS || pe, R = l.CUSTOM_ELEMENT_HANDLING || {}, l.CUSTOM_ELEMENT_HANDLING && R0(l.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = l.CUSTOM_ELEMENT_HANDLING.tagNameCheck), l.CUSTOM_ELEMENT_HANDLING && R0(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), Fu && (Ie = !1), se && (Tu = !0), Su && (O = F({}, K0), z = [], Su.html === !0 && (F(O, Q0), F(z, ut)), Su.svg === !0 && (F(O, $e), F(z, We), F(z, _e)), Su.svgFilters === !0 && (F(O, je), F(z, We), F(z, _e)), Su.mathMl === !0 && (F(O, Ge), F(z, et), F(z, _e))), l.ADD_TAGS && (O === k0 && (O = du(O)), F(O, l.ADD_TAGS, N)), l.ADD_ATTR && (z === E0 && (z = du(z)), F(z, l.ADD_ATTR, N)), l.ADD_URI_SAFE_ATTR && F(Ne, l.ADD_URI_SAFE_ATTR, N), l.FORBID_CONTENTS && (wu === T0 && (wu = du(wu)), F(wu, l.FORBID_CONTENTS, N)), Oe && (O["#text"] = !0), ku && F(O, ["html", "head", "body"]), O.table && (F(O, ["tbody"]), delete Uu.tbody), l.TRUSTED_TYPES_POLICY) {
|
|
370
370
|
if (typeof l.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
371
371
|
throw Zu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
372
372
|
if (typeof l.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -374,16 +374,16 @@ function vt() {
|
|
|
374
374
|
m = l.TRUSTED_TYPES_POLICY, A = m.createHTML("");
|
|
375
375
|
} else
|
|
376
376
|
m === void 0 && (m = yr(p, r)), m !== null && typeof A == "string" && (A = m.createHTML(""));
|
|
377
|
-
j && j(l),
|
|
377
|
+
j && j(l), Ru = l;
|
|
378
378
|
}
|
|
379
|
-
}, I0 = F({}, [
|
|
379
|
+
}, I0 = F({}, [...$e, ...je, ...pr]), M0 = F({}, [...Ge, ...br]), fn = function(l) {
|
|
380
380
|
let b = k(l);
|
|
381
381
|
(!b || !b.tagName) && (b = {
|
|
382
|
-
namespaceURI:
|
|
382
|
+
namespaceURI: vu,
|
|
383
383
|
tagName: "template"
|
|
384
384
|
});
|
|
385
385
|
const x = Ee(l.tagName), v = Ee(b.tagName);
|
|
386
|
-
return
|
|
386
|
+
return Pe[l.namespaceURI] ? l.namespaceURI === de ? b.namespaceURI === su ? x === "svg" : b.namespaceURI === fe ? x === "svg" && (v === "annotation-xml" || he[v]) : !!I0[x] : l.namespaceURI === fe ? b.namespaceURI === su ? x === "math" : b.namespaceURI === de ? x === "math" && pe[v] : !!M0[x] : l.namespaceURI === su ? b.namespaceURI === de && !pe[v] || b.namespaceURI === fe && !he[v] ? !1 : !M0[x] && (cn[x] || !I0[x]) : !!($u === "application/xhtml+xml" && Pe[l.namespaceURI]) : !1;
|
|
387
387
|
}, ru = function(l) {
|
|
388
388
|
Gu(e.removed, {
|
|
389
389
|
element: l
|
|
@@ -393,7 +393,7 @@ function vt() {
|
|
|
393
393
|
} catch {
|
|
394
394
|
D(l);
|
|
395
395
|
}
|
|
396
|
-
},
|
|
396
|
+
}, Iu = function(l, b) {
|
|
397
397
|
try {
|
|
398
398
|
Gu(e.removed, {
|
|
399
399
|
attribute: b.getAttributeNode(l),
|
|
@@ -406,7 +406,7 @@ function vt() {
|
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
if (b.removeAttribute(l), l === "is")
|
|
409
|
-
if (
|
|
409
|
+
if (Tu || se)
|
|
410
410
|
try {
|
|
411
411
|
ru(b);
|
|
412
412
|
} catch {
|
|
@@ -418,28 +418,28 @@ function vt() {
|
|
|
418
418
|
}
|
|
419
419
|
}, L0 = function(l) {
|
|
420
420
|
let b = null, x = null;
|
|
421
|
-
if (
|
|
421
|
+
if (Le)
|
|
422
422
|
l = "<remove></remove>" + l;
|
|
423
423
|
else {
|
|
424
424
|
const L = J0(l, /^[\r\n\t ]+/);
|
|
425
425
|
x = L && L[0];
|
|
426
426
|
}
|
|
427
|
-
$u === "application/xhtml+xml" &&
|
|
427
|
+
$u === "application/xhtml+xml" && vu === su && (l = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + l + "</body></html>");
|
|
428
428
|
const v = m ? m.createHTML(l) : l;
|
|
429
|
-
if (
|
|
429
|
+
if (vu === su)
|
|
430
430
|
try {
|
|
431
431
|
b = new _().parseFromString(v, $u);
|
|
432
432
|
} catch {
|
|
433
433
|
}
|
|
434
434
|
if (!b || !b.documentElement) {
|
|
435
|
-
b = y.createDocument(
|
|
435
|
+
b = y.createDocument(vu, "template", null);
|
|
436
436
|
try {
|
|
437
|
-
b.documentElement.innerHTML =
|
|
437
|
+
b.documentElement.innerHTML = Be ? A : v;
|
|
438
438
|
} catch {
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
const q = b.body || b.documentElement;
|
|
442
|
-
return l && x && q.insertBefore(t.createTextNode(x), q.childNodes[0] || null),
|
|
442
|
+
return l && x && q.insertBefore(t.createTextNode(x), q.childNodes[0] || null), vu === su ? nu.call(b, ku ? "html" : "body")[0] : ku ? b.documentElement : q;
|
|
443
443
|
}, O0 = function(l) {
|
|
444
444
|
return I.call(
|
|
445
445
|
l.ownerDocument || l,
|
|
@@ -448,19 +448,19 @@ function vt() {
|
|
|
448
448
|
s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION,
|
|
449
449
|
null
|
|
450
450
|
);
|
|
451
|
-
},
|
|
452
|
-
return l instanceof
|
|
451
|
+
}, qe = function(l) {
|
|
452
|
+
return l instanceof f && (typeof l.nodeName != "string" || typeof l.textContent != "string" || typeof l.removeChild != "function" || !(l.attributes instanceof d) || typeof l.removeAttribute != "function" || typeof l.setAttribute != "function" || typeof l.namespaceURI != "string" || typeof l.insertBefore != "function" || typeof l.hasChildNodes != "function");
|
|
453
453
|
}, N0 = function(l) {
|
|
454
454
|
return typeof c == "function" && l instanceof c;
|
|
455
455
|
};
|
|
456
456
|
function lu(g, l, b) {
|
|
457
457
|
be(g, (x) => {
|
|
458
|
-
x.call(e, l, b,
|
|
458
|
+
x.call(e, l, b, Ru);
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
const B0 = function(l) {
|
|
462
462
|
let b = null;
|
|
463
|
-
if (lu(M.beforeSanitizeElements, l, null),
|
|
463
|
+
if (lu(M.beforeSanitizeElements, l, null), qe(l))
|
|
464
464
|
return ru(l), !0;
|
|
465
465
|
const x = N(l.nodeName);
|
|
466
466
|
if (lu(M.uponSanitizeElement, l, {
|
|
@@ -471,7 +471,7 @@ function vt() {
|
|
|
471
471
|
if (!O[x] || Uu[x]) {
|
|
472
472
|
if (!Uu[x] && z0(x) && (R.tagNameCheck instanceof RegExp && H(R.tagNameCheck, x) || R.tagNameCheck instanceof Function && R.tagNameCheck(x)))
|
|
473
473
|
return !1;
|
|
474
|
-
if (
|
|
474
|
+
if (Oe && !wu[x]) {
|
|
475
475
|
const v = k(l) || l.parentNode, q = E(l) || l.childNodes;
|
|
476
476
|
if (q && v) {
|
|
477
477
|
const L = q.length;
|
|
@@ -483,7 +483,7 @@ function vt() {
|
|
|
483
483
|
}
|
|
484
484
|
return ru(l), !0;
|
|
485
485
|
}
|
|
486
|
-
return l instanceof a && !fn(l) || (x === "noscript" || x === "noembed" || x === "noframes") && H(/<\/no(script|embed|frames)/i, l.innerHTML) ? (ru(l), !0) : (
|
|
486
|
+
return l instanceof a && !fn(l) || (x === "noscript" || x === "noembed" || x === "noframes") && H(/<\/no(script|embed|frames)/i, l.innerHTML) ? (ru(l), !0) : (Fu && l.nodeType === Yu.text && (b = l.textContent, be([zu, qu, yu], (v) => {
|
|
487
487
|
b = Wu(b, v, " ");
|
|
488
488
|
}), l.textContent !== b && (Gu(e.removed, {
|
|
489
489
|
element: l.cloneNode()
|
|
@@ -491,9 +491,9 @@ function vt() {
|
|
|
491
491
|
}, P0 = function(l, b, x) {
|
|
492
492
|
if (y0 && (b === "id" || b === "name") && (x in t || x in ln))
|
|
493
493
|
return !1;
|
|
494
|
-
if (!(
|
|
495
|
-
if (!(A0 && H(
|
|
496
|
-
if (!z[b] ||
|
|
494
|
+
if (!(Ie && !Re[b] && H(hu, b))) {
|
|
495
|
+
if (!(A0 && H(ve, b))) {
|
|
496
|
+
if (!z[b] || Re[b]) {
|
|
497
497
|
if (
|
|
498
498
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
499
499
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -502,7 +502,7 @@ function vt() {
|
|
|
502
502
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
503
503
|
b === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && H(R.tagNameCheck, x) || R.tagNameCheck instanceof Function && R.tagNameCheck(x)))
|
|
504
504
|
) return !1;
|
|
505
|
-
} else if (!
|
|
505
|
+
} else if (!Ne[b]) {
|
|
506
506
|
if (!H(g0, Wu(x, x0, ""))) {
|
|
507
507
|
if (!((b === "src" || b === "xlink:href" || b === "href") && l !== "script" && lr(x, "data:") === 0 && S0[l])) {
|
|
508
508
|
if (!(C0 && !H(tn, Wu(x, x0, "")))) {
|
|
@@ -522,7 +522,7 @@ function vt() {
|
|
|
522
522
|
const {
|
|
523
523
|
attributes: b
|
|
524
524
|
} = l;
|
|
525
|
-
if (!b ||
|
|
525
|
+
if (!b || qe(l))
|
|
526
526
|
return;
|
|
527
527
|
const x = {
|
|
528
528
|
attrName: "",
|
|
@@ -537,28 +537,28 @@ function vt() {
|
|
|
537
537
|
name: L,
|
|
538
538
|
namespaceURI: W,
|
|
539
539
|
value: fu
|
|
540
|
-
} = q, ju = N(L),
|
|
541
|
-
let U = L === "value" ?
|
|
542
|
-
if (x.attrName = ju, x.attrValue = U, x.keepAttr = !0, x.forceKeepAttr = void 0, lu(M.uponSanitizeAttribute, l, x), U = x.attrValue, F0 && (ju === "id" || ju === "name") && (
|
|
543
|
-
|
|
540
|
+
} = q, ju = N(L), Ue = fu;
|
|
541
|
+
let U = L === "value" ? Ue : fr(Ue);
|
|
542
|
+
if (x.attrName = ju, x.attrValue = U, x.keepAttr = !0, x.forceKeepAttr = void 0, lu(M.uponSanitizeAttribute, l, x), U = x.attrValue, F0 && (ju === "id" || ju === "name") && (Iu(L, l), U = rn + U), ae && H(/((--!?|])>)|<\/(style|title)/i, U)) {
|
|
543
|
+
Iu(L, l);
|
|
544
544
|
continue;
|
|
545
545
|
}
|
|
546
546
|
if (x.forceKeepAttr)
|
|
547
547
|
continue;
|
|
548
548
|
if (!x.keepAttr) {
|
|
549
|
-
|
|
549
|
+
Iu(L, l);
|
|
550
550
|
continue;
|
|
551
551
|
}
|
|
552
552
|
if (!D0 && H(/\/>/i, U)) {
|
|
553
|
-
|
|
553
|
+
Iu(L, l);
|
|
554
554
|
continue;
|
|
555
555
|
}
|
|
556
|
-
|
|
556
|
+
Fu && be([zu, qu, yu], (H0) => {
|
|
557
557
|
U = Wu(U, H0, " ");
|
|
558
558
|
});
|
|
559
559
|
const U0 = N(l.nodeName);
|
|
560
560
|
if (!P0(U0, ju, U)) {
|
|
561
|
-
|
|
561
|
+
Iu(L, l);
|
|
562
562
|
continue;
|
|
563
563
|
}
|
|
564
564
|
if (m && typeof p == "object" && typeof p.getAttributeType == "function" && !W)
|
|
@@ -572,11 +572,11 @@ function vt() {
|
|
|
572
572
|
break;
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
if (U !==
|
|
575
|
+
if (U !== Ue)
|
|
576
576
|
try {
|
|
577
|
-
W ? l.setAttributeNS(W, L, U) : l.setAttribute(L, U),
|
|
577
|
+
W ? l.setAttributeNS(W, L, U) : l.setAttribute(L, U), qe(l) ? ru(l) : X0(e.removed);
|
|
578
578
|
} catch {
|
|
579
|
-
|
|
579
|
+
Iu(L, l);
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
lu(M.afterSanitizeAttributes, l, null);
|
|
@@ -589,7 +589,7 @@ function vt() {
|
|
|
589
589
|
};
|
|
590
590
|
return e.sanitize = function(g) {
|
|
591
591
|
let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, b = null, x = null, v = null, q = null;
|
|
592
|
-
if (
|
|
592
|
+
if (Be = !g, Be && (g = "<!-->"), typeof g != "string" && !N0(g))
|
|
593
593
|
if (typeof g.toString == "function") {
|
|
594
594
|
if (g = g.toString(), typeof g != "string")
|
|
595
595
|
throw Zu("dirty is not a string, aborting");
|
|
@@ -597,7 +597,7 @@ function vt() {
|
|
|
597
597
|
throw Zu("toString is not a function");
|
|
598
598
|
if (!e.isSupported)
|
|
599
599
|
return g;
|
|
600
|
-
if (
|
|
600
|
+
if (Me || ze(l), e.removed = [], typeof g == "string" && (Hu = !1), Hu) {
|
|
601
601
|
if (g.nodeName) {
|
|
602
602
|
const fu = N(g.nodeName);
|
|
603
603
|
if (!O[fu] || Uu[fu])
|
|
@@ -606,21 +606,21 @@ function vt() {
|
|
|
606
606
|
} else if (g instanceof c)
|
|
607
607
|
b = L0("<!---->"), x = b.ownerDocument.importNode(g, !0), x.nodeType === Yu.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? b = x : b.appendChild(x);
|
|
608
608
|
else {
|
|
609
|
-
if (!
|
|
609
|
+
if (!Tu && !Fu && !ku && // eslint-disable-next-line unicorn/prefer-includes
|
|
610
610
|
g.indexOf("<") === -1)
|
|
611
611
|
return m && le ? m.createHTML(g) : g;
|
|
612
612
|
if (b = L0(g), !b)
|
|
613
|
-
return
|
|
613
|
+
return Tu ? null : le ? A : "";
|
|
614
614
|
}
|
|
615
|
-
b &&
|
|
615
|
+
b && Le && ru(b.firstChild);
|
|
616
616
|
const L = O0(Hu ? g : b);
|
|
617
617
|
for (; v = L.nextNode(); )
|
|
618
618
|
B0(v), q0(v), v.content instanceof o && dn(v.content);
|
|
619
619
|
if (Hu)
|
|
620
620
|
return g;
|
|
621
|
-
if (
|
|
621
|
+
if (Tu) {
|
|
622
622
|
if (se)
|
|
623
|
-
for (q =
|
|
623
|
+
for (q = V.call(b.ownerDocument); b.firstChild; )
|
|
624
624
|
q.appendChild(b.firstChild);
|
|
625
625
|
else
|
|
626
626
|
q = b;
|
|
@@ -628,16 +628,16 @@ function vt() {
|
|
|
628
628
|
}
|
|
629
629
|
let W = ku ? b.outerHTML : b.innerHTML;
|
|
630
630
|
return ku && O["!doctype"] && b.ownerDocument && b.ownerDocument.doctype && b.ownerDocument.doctype.name && H(wt, b.ownerDocument.doctype.name) && (W = "<!DOCTYPE " + b.ownerDocument.doctype.name + `>
|
|
631
|
-
` + W),
|
|
631
|
+
` + W), Fu && be([zu, qu, yu], (fu) => {
|
|
632
632
|
W = Wu(W, fu, " ");
|
|
633
633
|
}), m && le ? m.createHTML(W) : W;
|
|
634
634
|
}, e.setConfig = function() {
|
|
635
635
|
let g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
636
|
-
|
|
636
|
+
ze(g), Me = !0;
|
|
637
637
|
}, e.clearConfig = function() {
|
|
638
|
-
|
|
638
|
+
Ru = null, Me = !1;
|
|
639
639
|
}, e.isValidAttribute = function(g, l, b) {
|
|
640
|
-
|
|
640
|
+
Ru || ze({});
|
|
641
641
|
const x = N(g), v = N(l);
|
|
642
642
|
return P0(x, v, b);
|
|
643
643
|
}, e.addHook = function(g, l) {
|
|
@@ -693,16 +693,16 @@ function Nu(u, e) {
|
|
|
693
693
|
if ((c & 240) === 224 && o + 6 < i) {
|
|
694
694
|
const a = parseInt(n.slice(o + 4, o + 6), 16), s = parseInt(n.slice(o + 7, o + 9), 16);
|
|
695
695
|
if ((a & 192) === 128 && (s & 192) === 128) {
|
|
696
|
-
const
|
|
697
|
-
|
|
696
|
+
const d = c << 12 & 61440 | a << 6 & 4032 | s & 63;
|
|
697
|
+
d < 2048 || d >= 55296 && d <= 57343 ? r += "���" : r += String.fromCharCode(d), o += 6;
|
|
698
698
|
continue;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
701
|
if ((c & 248) === 240 && o + 9 < i) {
|
|
702
|
-
const a = parseInt(n.slice(o + 4, o + 6), 16), s = parseInt(n.slice(o + 7, o + 9), 16),
|
|
703
|
-
if ((a & 192) === 128 && (s & 192) === 128 && (
|
|
704
|
-
let
|
|
705
|
-
|
|
702
|
+
const a = parseInt(n.slice(o + 4, o + 6), 16), s = parseInt(n.slice(o + 7, o + 9), 16), d = parseInt(n.slice(o + 10, o + 12), 16);
|
|
703
|
+
if ((a & 192) === 128 && (s & 192) === 128 && (d & 192) === 128) {
|
|
704
|
+
let f = c << 18 & 1835008 | a << 12 & 258048 | s << 6 & 4032 | d & 63;
|
|
705
|
+
f < 65536 || f > 1114111 ? r += "����" : (f -= 65536, r += String.fromCharCode(55296 + (f >> 10), 56320 + (f & 1023))), o += 9;
|
|
706
706
|
continue;
|
|
707
707
|
}
|
|
708
708
|
}
|
|
@@ -762,7 +762,7 @@ function l0(u) {
|
|
|
762
762
|
let e = "";
|
|
763
763
|
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;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Ce() {
|
|
766
766
|
this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
|
|
767
767
|
}
|
|
768
768
|
const wr = /^([a-z0-9.+-]+:)/i, vr = /:[0-9]*$/, Rr = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, Ir = ["<", ">", '"', "`", " ", "\r", `
|
|
@@ -782,11 +782,11 @@ const wr = /^([a-z0-9.+-]+:)/i, vr = /:[0-9]*$/, Rr = /^(\/\/?(?!\/)[^\?\s]*)(\?
|
|
|
782
782
|
"file:": !0
|
|
783
783
|
};
|
|
784
784
|
function f0(u, e) {
|
|
785
|
-
if (u && u instanceof
|
|
786
|
-
const t = new
|
|
785
|
+
if (u && u instanceof Ce) return u;
|
|
786
|
+
const t = new Ce();
|
|
787
787
|
return t.parse(u, e), t;
|
|
788
788
|
}
|
|
789
|
-
|
|
789
|
+
Ce.prototype.parse = function(u, e) {
|
|
790
790
|
let t, n, r, o = u;
|
|
791
791
|
if (o = o.trim(), !e && u.split("#").length === 1) {
|
|
792
792
|
const s = Rr.exec(o);
|
|
@@ -798,8 +798,8 @@ De.prototype.parse = function(u, e) {
|
|
|
798
798
|
let s = -1;
|
|
799
799
|
for (let h = 0; h < it.length; h++)
|
|
800
800
|
n = o.indexOf(it[h]), n !== -1 && (s === -1 || n < s) && (s = n);
|
|
801
|
-
let
|
|
802
|
-
s === -1 ?
|
|
801
|
+
let d, f;
|
|
802
|
+
s === -1 ? f = o.lastIndexOf("@") : f = o.lastIndexOf("@", s), f !== -1 && (d = o.slice(0, f), o = o.slice(f + 1), this.auth = d), s = -1;
|
|
803
803
|
for (let h = 0; h < ct.length; h++)
|
|
804
804
|
n = o.indexOf(ct[h]), n !== -1 && (s === -1 || n < s) && (s = n);
|
|
805
805
|
s === -1 && (s = o.length), o[s - 1] === ":" && s--;
|
|
@@ -829,7 +829,7 @@ De.prototype.parse = function(u, e) {
|
|
|
829
829
|
const a = o.indexOf("?");
|
|
830
830
|
return a !== -1 && (this.search = o.substr(a), o = o.slice(0, a)), o && (this.pathname = o), lt[t] && this.hostname && !this.pathname && (this.pathname = ""), this;
|
|
831
831
|
};
|
|
832
|
-
|
|
832
|
+
Ce.prototype.parseHost = function(u) {
|
|
833
833
|
let e = vr.exec(u);
|
|
834
834
|
e && (e = e[0], e !== ":" && (this.port = e.substr(1)), u = u.substr(0, u.length - e.length)), u && (this.hostname = u);
|
|
835
835
|
};
|
|
@@ -854,7 +854,7 @@ const Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
854
854
|
// prettier-ignore
|
|
855
855
|
"Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((u) => u.charCodeAt(0))
|
|
856
856
|
);
|
|
857
|
-
var
|
|
857
|
+
var Ze;
|
|
858
858
|
const Hr = /* @__PURE__ */ new Map([
|
|
859
859
|
[0, 65533],
|
|
860
860
|
// C1 Unicode control character reference replacements
|
|
@@ -887,7 +887,7 @@ const Hr = /* @__PURE__ */ new Map([
|
|
|
887
887
|
[159, 376]
|
|
888
888
|
]), $r = (
|
|
889
889
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
890
|
-
(
|
|
890
|
+
(Ze = String.fromCodePoint) !== null && Ze !== void 0 ? Ze : function(u) {
|
|
891
891
|
let e = "";
|
|
892
892
|
return u > 65535 && (u -= 65536, e += String.fromCharCode(u >>> 10 & 1023 | 55296), u = 56320 | u & 1023), e += String.fromCharCode(u), e;
|
|
893
893
|
}
|
|
@@ -905,14 +905,14 @@ var _u;
|
|
|
905
905
|
(function(u) {
|
|
906
906
|
u[u.VALUE_LENGTH = 49152] = "VALUE_LENGTH", u[u.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", u[u.JUMP_TABLE = 127] = "JUMP_TABLE";
|
|
907
907
|
})(_u || (_u = {}));
|
|
908
|
-
function
|
|
908
|
+
function n0(u) {
|
|
909
909
|
return u >= P.ZERO && u <= P.NINE;
|
|
910
910
|
}
|
|
911
911
|
function Wr(u) {
|
|
912
912
|
return u >= P.UPPER_A && u <= P.UPPER_F || u >= P.LOWER_A && u <= P.LOWER_F;
|
|
913
913
|
}
|
|
914
914
|
function Zr(u) {
|
|
915
|
-
return u >= P.UPPER_A && u <= P.UPPER_Z || u >= P.LOWER_A && u <= P.LOWER_Z ||
|
|
915
|
+
return u >= P.UPPER_A && u <= P.UPPER_Z || u >= P.LOWER_A && u <= P.LOWER_Z || n0(u);
|
|
916
916
|
}
|
|
917
917
|
function Vr(u) {
|
|
918
918
|
return u === P.EQUALS || Zr(u);
|
|
@@ -989,7 +989,7 @@ class Yr {
|
|
|
989
989
|
const n = t;
|
|
990
990
|
for (; t < e.length; ) {
|
|
991
991
|
const r = e.charCodeAt(t);
|
|
992
|
-
if (
|
|
992
|
+
if (n0(r) || Wr(r))
|
|
993
993
|
t += 1;
|
|
994
994
|
else
|
|
995
995
|
return this.addToNumericResult(e, n, t, 16), this.emitNumericEntity(r, 3);
|
|
@@ -1009,7 +1009,7 @@ class Yr {
|
|
|
1009
1009
|
const n = t;
|
|
1010
1010
|
for (; t < e.length; ) {
|
|
1011
1011
|
const r = e.charCodeAt(t);
|
|
1012
|
-
if (
|
|
1012
|
+
if (n0(r))
|
|
1013
1013
|
t += 1;
|
|
1014
1014
|
else
|
|
1015
1015
|
return this.addToNumericResult(e, n, t, 10), this.emitNumericEntity(r, 2);
|
|
@@ -1169,7 +1169,7 @@ const Kr = Object.prototype.hasOwnProperty;
|
|
|
1169
1169
|
function uo(u, e) {
|
|
1170
1170
|
return Kr.call(u, e);
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function Fe(u) {
|
|
1173
1173
|
return Array.prototype.slice.call(arguments, 1).forEach(function(t) {
|
|
1174
1174
|
if (t) {
|
|
1175
1175
|
if (typeof t != "object")
|
|
@@ -1186,7 +1186,7 @@ function Bt(u, e, t) {
|
|
|
1186
1186
|
function p0(u) {
|
|
1187
1187
|
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);
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function De(u) {
|
|
1190
1190
|
if (u > 65535) {
|
|
1191
1191
|
u -= 65536;
|
|
1192
1192
|
const e = 55296 + (u >> 10), t = 56320 + (u & 1023);
|
|
@@ -1198,7 +1198,7 @@ const Pt = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, eo = /&([a-z#][a-z0-9]{
|
|
|
1198
1198
|
function ro(u, e) {
|
|
1199
1199
|
if (e.charCodeAt(0) === 35 && no.test(e)) {
|
|
1200
1200
|
const n = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
|
|
1201
|
-
return p0(n) ?
|
|
1201
|
+
return p0(n) ? De(n) : u;
|
|
1202
1202
|
}
|
|
1203
1203
|
const t = Nt(u);
|
|
1204
1204
|
return t !== u ? t : u;
|
|
@@ -1296,16 +1296,16 @@ function ue(u) {
|
|
|
1296
1296
|
return !1;
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
1299
|
-
function
|
|
1299
|
+
function Te(u) {
|
|
1300
1300
|
return u = u.trim().replace(/\s+/g, " "), "ẞ".toLowerCase() === "Ṿ" && (u = u.replace(/ẞ/g, "ß")), u.toLowerCase().toUpperCase();
|
|
1301
1301
|
}
|
|
1302
1302
|
const ho = { mdurl: Br, ucmicro: zr }, po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1303
1303
|
__proto__: null,
|
|
1304
1304
|
arrayReplaceAt: Bt,
|
|
1305
|
-
assign:
|
|
1305
|
+
assign: Fe,
|
|
1306
1306
|
escapeHtml: xu,
|
|
1307
1307
|
escapeRE: fo,
|
|
1308
|
-
fromCodePoint:
|
|
1308
|
+
fromCodePoint: De,
|
|
1309
1309
|
has: uo,
|
|
1310
1310
|
isMdAsciiPunct: ue,
|
|
1311
1311
|
isPunctChar: Ku,
|
|
@@ -1314,7 +1314,7 @@ const ho = { mdurl: Br, ucmicro: zr }, po = /* @__PURE__ */ Object.freeze(/* @__
|
|
|
1314
1314
|
isValidEntityCode: p0,
|
|
1315
1315
|
isWhiteSpace: Qu,
|
|
1316
1316
|
lib: ho,
|
|
1317
|
-
normalizeReference:
|
|
1317
|
+
normalizeReference: Te,
|
|
1318
1318
|
unescapeAll: Bu,
|
|
1319
1319
|
unescapeMd: oo
|
|
1320
1320
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -1428,18 +1428,18 @@ iu.fence = function(u, e, t, n, r) {
|
|
|
1428
1428
|
const o = u[e], i = o.info ? Bu(o.info).trim() : "";
|
|
1429
1429
|
let c = "", a = "";
|
|
1430
1430
|
if (i) {
|
|
1431
|
-
const
|
|
1432
|
-
c =
|
|
1431
|
+
const d = i.split(/(\s+)/g);
|
|
1432
|
+
c = d[0], a = d.slice(2).join("");
|
|
1433
1433
|
}
|
|
1434
1434
|
let s;
|
|
1435
1435
|
if (t.highlight ? s = t.highlight(o.content, c, a) || xu(o.content) : s = xu(o.content), s.indexOf("<pre") === 0)
|
|
1436
1436
|
return s + `
|
|
1437
1437
|
`;
|
|
1438
1438
|
if (i) {
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1439
|
+
const d = o.attrIndex("class"), f = o.attrs ? o.attrs.slice() : [];
|
|
1440
|
+
d < 0 ? f.push(["class", t.langPrefix + c]) : (f[d] = f[d].slice(), f[d][1] += " " + t.langPrefix + c);
|
|
1441
1441
|
const _ = {
|
|
1442
|
-
attrs:
|
|
1442
|
+
attrs: f
|
|
1443
1443
|
};
|
|
1444
1444
|
return `<pre><code${r.renderAttrs(_)}>${s}</code></pre>
|
|
1445
1445
|
`;
|
|
@@ -1472,7 +1472,7 @@ iu.html_inline = function(u, e) {
|
|
|
1472
1472
|
return u[e].content;
|
|
1473
1473
|
};
|
|
1474
1474
|
function Pu() {
|
|
1475
|
-
this.rules =
|
|
1475
|
+
this.rules = Fe({}, iu);
|
|
1476
1476
|
}
|
|
1477
1477
|
Pu.prototype.renderAttrs = function(e) {
|
|
1478
1478
|
let t, n, r;
|
|
@@ -1537,16 +1537,16 @@ Pu.prototype.render = function(u, e, t) {
|
|
|
1537
1537
|
}
|
|
1538
1538
|
return n;
|
|
1539
1539
|
};
|
|
1540
|
-
function
|
|
1540
|
+
function Z() {
|
|
1541
1541
|
this.__rules__ = [], this.__cache__ = null;
|
|
1542
1542
|
}
|
|
1543
|
-
|
|
1543
|
+
Z.prototype.__find__ = function(u) {
|
|
1544
1544
|
for (let e = 0; e < this.__rules__.length; e++)
|
|
1545
1545
|
if (this.__rules__[e].name === u)
|
|
1546
1546
|
return e;
|
|
1547
1547
|
return -1;
|
|
1548
1548
|
};
|
|
1549
|
-
|
|
1549
|
+
Z.prototype.__compile__ = function() {
|
|
1550
1550
|
const u = this, e = [""];
|
|
1551
1551
|
u.__rules__.forEach(function(t) {
|
|
1552
1552
|
t.enabled && t.alt.forEach(function(n) {
|
|
@@ -1558,13 +1558,13 @@ V.prototype.__compile__ = function() {
|
|
|
1558
1558
|
});
|
|
1559
1559
|
});
|
|
1560
1560
|
};
|
|
1561
|
-
|
|
1561
|
+
Z.prototype.at = function(u, e, t) {
|
|
1562
1562
|
const n = this.__find__(u), r = t || {};
|
|
1563
1563
|
if (n === -1)
|
|
1564
1564
|
throw new Error("Parser rule not found: " + u);
|
|
1565
1565
|
this.__rules__[n].fn = e, this.__rules__[n].alt = r.alt || [], this.__cache__ = null;
|
|
1566
1566
|
};
|
|
1567
|
-
|
|
1567
|
+
Z.prototype.before = function(u, e, t, n) {
|
|
1568
1568
|
const r = this.__find__(u), o = n || {};
|
|
1569
1569
|
if (r === -1)
|
|
1570
1570
|
throw new Error("Parser rule not found: " + u);
|
|
@@ -1575,7 +1575,7 @@ V.prototype.before = function(u, e, t, n) {
|
|
|
1575
1575
|
alt: o.alt || []
|
|
1576
1576
|
}), this.__cache__ = null;
|
|
1577
1577
|
};
|
|
1578
|
-
|
|
1578
|
+
Z.prototype.after = function(u, e, t, n) {
|
|
1579
1579
|
const r = this.__find__(u), o = n || {};
|
|
1580
1580
|
if (r === -1)
|
|
1581
1581
|
throw new Error("Parser rule not found: " + u);
|
|
@@ -1586,7 +1586,7 @@ V.prototype.after = function(u, e, t, n) {
|
|
|
1586
1586
|
alt: o.alt || []
|
|
1587
1587
|
}), this.__cache__ = null;
|
|
1588
1588
|
};
|
|
1589
|
-
|
|
1589
|
+
Z.prototype.push = function(u, e, t) {
|
|
1590
1590
|
const n = t || {};
|
|
1591
1591
|
this.__rules__.push({
|
|
1592
1592
|
name: u,
|
|
@@ -1595,7 +1595,7 @@ V.prototype.push = function(u, e, t) {
|
|
|
1595
1595
|
alt: n.alt || []
|
|
1596
1596
|
}), this.__cache__ = null;
|
|
1597
1597
|
};
|
|
1598
|
-
|
|
1598
|
+
Z.prototype.enable = function(u, e) {
|
|
1599
1599
|
Array.isArray(u) || (u = [u]);
|
|
1600
1600
|
const t = [];
|
|
1601
1601
|
return u.forEach(function(n) {
|
|
@@ -1608,12 +1608,12 @@ V.prototype.enable = function(u, e) {
|
|
|
1608
1608
|
this.__rules__[r].enabled = !0, t.push(n);
|
|
1609
1609
|
}, this), this.__cache__ = null, t;
|
|
1610
1610
|
};
|
|
1611
|
-
|
|
1611
|
+
Z.prototype.enableOnly = function(u, e) {
|
|
1612
1612
|
Array.isArray(u) || (u = [u]), this.__rules__.forEach(function(t) {
|
|
1613
1613
|
t.enabled = !1;
|
|
1614
1614
|
}), this.enable(u, e);
|
|
1615
1615
|
};
|
|
1616
|
-
|
|
1616
|
+
Z.prototype.disable = function(u, e) {
|
|
1617
1617
|
Array.isArray(u) || (u = [u]);
|
|
1618
1618
|
const t = [];
|
|
1619
1619
|
return u.forEach(function(n) {
|
|
@@ -1626,7 +1626,7 @@ V.prototype.disable = function(u, e) {
|
|
|
1626
1626
|
this.__rules__[r].enabled = !1, t.push(n);
|
|
1627
1627
|
}, this), this.__cache__ = null, t;
|
|
1628
1628
|
};
|
|
1629
|
-
|
|
1629
|
+
Z.prototype.getRules = function(u) {
|
|
1630
1630
|
return this.__cache__ === null && this.__compile__(), this.__cache__[u] || [];
|
|
1631
1631
|
};
|
|
1632
1632
|
function tu(u, e, t) {
|
|
@@ -1701,8 +1701,8 @@ function Fo(u) {
|
|
|
1701
1701
|
if (c.type === "html_inline" && (Do(c.content) && o > 0 && o--, yo(c.content) && o++), !(o > 0) && c.type === "text" && u.md.linkify.test(c.content)) {
|
|
1702
1702
|
const a = c.content;
|
|
1703
1703
|
let s = u.md.linkify.match(a);
|
|
1704
|
-
const
|
|
1705
|
-
let
|
|
1704
|
+
const d = [];
|
|
1705
|
+
let f = c.level, _ = 0;
|
|
1706
1706
|
s.length > 0 && s[0].index === 0 && i > 0 && r[i - 1].type === "text_special" && (s = s.slice(1));
|
|
1707
1707
|
for (let p = 0; p < s.length; p++) {
|
|
1708
1708
|
const h = s[p].url, C = u.md.normalizeLink(h);
|
|
@@ -1713,20 +1713,20 @@ function Fo(u) {
|
|
|
1713
1713
|
const T = s[p].index;
|
|
1714
1714
|
if (T > _) {
|
|
1715
1715
|
const A = new u.Token("text", "", 0);
|
|
1716
|
-
A.content = a.slice(_, T), A.level =
|
|
1716
|
+
A.content = a.slice(_, T), A.level = f, d.push(A);
|
|
1717
1717
|
}
|
|
1718
1718
|
const E = new u.Token("link_open", "a", 1);
|
|
1719
|
-
E.attrs = [["href", C]], E.level =
|
|
1719
|
+
E.attrs = [["href", C]], E.level = f++, E.markup = "linkify", E.info = "auto", d.push(E);
|
|
1720
1720
|
const k = new u.Token("text", "", 0);
|
|
1721
|
-
k.content = D, k.level =
|
|
1721
|
+
k.content = D, k.level = f, d.push(k);
|
|
1722
1722
|
const m = new u.Token("link_close", "a", -1);
|
|
1723
|
-
m.level = --
|
|
1723
|
+
m.level = --f, m.markup = "linkify", m.info = "auto", d.push(m), _ = s[p].lastIndex;
|
|
1724
1724
|
}
|
|
1725
1725
|
if (_ < a.length) {
|
|
1726
1726
|
const p = new u.Token("text", "", 0);
|
|
1727
|
-
p.content = a.slice(_), p.level =
|
|
1727
|
+
p.content = a.slice(_), p.level = f, d.push(p);
|
|
1728
1728
|
}
|
|
1729
|
-
e[t].children = r = Bt(r, i,
|
|
1729
|
+
e[t].children = r = Bt(r, i, d);
|
|
1730
1730
|
}
|
|
1731
1731
|
}
|
|
1732
1732
|
}
|
|
@@ -1776,15 +1776,15 @@ function Oo(u, e) {
|
|
|
1776
1776
|
u:
|
|
1777
1777
|
for (; a < s; ) {
|
|
1778
1778
|
ft.lastIndex = a;
|
|
1779
|
-
const
|
|
1780
|
-
if (!
|
|
1779
|
+
const d = ft.exec(c);
|
|
1780
|
+
if (!d)
|
|
1781
1781
|
break;
|
|
1782
|
-
let
|
|
1783
|
-
a =
|
|
1784
|
-
const p =
|
|
1782
|
+
let f = !0, _ = !0;
|
|
1783
|
+
a = d.index + 1;
|
|
1784
|
+
const p = d[0] === "'";
|
|
1785
1785
|
let h = 32;
|
|
1786
|
-
if (
|
|
1787
|
-
h = c.charCodeAt(
|
|
1786
|
+
if (d.index - 1 >= 0)
|
|
1787
|
+
h = c.charCodeAt(d.index - 1);
|
|
1788
1788
|
else
|
|
1789
1789
|
for (t = r - 1; t >= 0 && !(u[t].type === "softbreak" || u[t].type === "hardbreak"); t--)
|
|
1790
1790
|
if (u[t].content) {
|
|
@@ -1801,8 +1801,8 @@ function Oo(u, e) {
|
|
|
1801
1801
|
break;
|
|
1802
1802
|
}
|
|
1803
1803
|
const D = ue(h) || Ku(String.fromCharCode(h)), T = ue(C) || Ku(String.fromCharCode(C)), E = Qu(h), k = Qu(C);
|
|
1804
|
-
if (k ?
|
|
1805
|
-
p && (o.content = me(o.content,
|
|
1804
|
+
if (k ? f = !1 : T && (E || D || (f = !1)), E ? _ = !1 : D && (k || T || (_ = !1)), C === 34 && d[0] === '"' && h >= 48 && h <= 57 && (_ = f = !1), f && _ && (f = D, _ = T), !f && !_) {
|
|
1805
|
+
p && (o.content = me(o.content, d.index, dt));
|
|
1806
1806
|
continue;
|
|
1807
1807
|
}
|
|
1808
1808
|
if (_)
|
|
@@ -1813,7 +1813,7 @@ function Oo(u, e) {
|
|
|
1813
1813
|
if (m.single === p && n[t].level === i) {
|
|
1814
1814
|
m = n[t];
|
|
1815
1815
|
let A, y;
|
|
1816
|
-
p ? (A = e.md.options.quotes[2], y = e.md.options.quotes[3]) : (A = e.md.options.quotes[0], y = e.md.options.quotes[1]), o.content = me(o.content,
|
|
1816
|
+
p ? (A = e.md.options.quotes[2], y = e.md.options.quotes[3]) : (A = e.md.options.quotes[0], y = e.md.options.quotes[1]), o.content = me(o.content, d.index, y), u[m.token].content = me(
|
|
1817
1817
|
u[m.token].content,
|
|
1818
1818
|
m.pos,
|
|
1819
1819
|
A
|
|
@@ -1821,12 +1821,12 @@ function Oo(u, e) {
|
|
|
1821
1821
|
continue u;
|
|
1822
1822
|
}
|
|
1823
1823
|
}
|
|
1824
|
-
|
|
1824
|
+
f ? n.push({
|
|
1825
1825
|
token: r,
|
|
1826
|
-
pos:
|
|
1826
|
+
pos: d.index,
|
|
1827
1827
|
single: p,
|
|
1828
1828
|
level: i
|
|
1829
|
-
}) : _ && p && (o.content = me(o.content,
|
|
1829
|
+
}) : _ && p && (o.content = me(o.content, d.index, dt));
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
1832
|
}
|
|
@@ -1848,7 +1848,7 @@ function Bo(u) {
|
|
|
1848
1848
|
e !== t && (i.length = t);
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
|
-
const
|
|
1851
|
+
const Ve = [
|
|
1852
1852
|
["normalize", Eo],
|
|
1853
1853
|
["block", Ao],
|
|
1854
1854
|
["inline", Co],
|
|
@@ -1860,9 +1860,9 @@ const Ye = [
|
|
|
1860
1860
|
["text_join", Bo]
|
|
1861
1861
|
];
|
|
1862
1862
|
function b0() {
|
|
1863
|
-
this.ruler = new
|
|
1864
|
-
for (let u = 0; u <
|
|
1865
|
-
this.ruler.push(
|
|
1863
|
+
this.ruler = new Z();
|
|
1864
|
+
for (let u = 0; u < Ve.length; u++)
|
|
1865
|
+
this.ruler.push(Ve[u][0], Ve[u][1]);
|
|
1866
1866
|
}
|
|
1867
1867
|
b0.prototype.process = function(u) {
|
|
1868
1868
|
const e = this.ruler.getRules("");
|
|
@@ -1873,15 +1873,15 @@ b0.prototype.State = zt;
|
|
|
1873
1873
|
function au(u, e, t, n) {
|
|
1874
1874
|
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;
|
|
1875
1875
|
const r = this.src;
|
|
1876
|
-
for (let o = 0, i = 0, c = 0, a = 0, s = r.length,
|
|
1877
|
-
const
|
|
1878
|
-
if (!
|
|
1879
|
-
if (w(
|
|
1880
|
-
c++,
|
|
1876
|
+
for (let o = 0, i = 0, c = 0, a = 0, s = r.length, d = !1; i < s; i++) {
|
|
1877
|
+
const f = r.charCodeAt(i);
|
|
1878
|
+
if (!d)
|
|
1879
|
+
if (w(f)) {
|
|
1880
|
+
c++, f === 9 ? a += 4 - a % 4 : a++;
|
|
1881
1881
|
continue;
|
|
1882
1882
|
} else
|
|
1883
|
-
|
|
1884
|
-
(
|
|
1883
|
+
d = !0;
|
|
1884
|
+
(f === 10 || i === s - 1) && (f !== 10 && i++, this.bMarks.push(o), this.eMarks.push(i), this.tShift.push(c), this.sCount.push(a), this.bsCount.push(0), d = !1, c = 0, a = 0, o = i + 1);
|
|
1885
1885
|
}
|
|
1886
1886
|
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;
|
|
1887
1887
|
}
|
|
@@ -1933,24 +1933,24 @@ au.prototype.getLines = function(e, t, n, r) {
|
|
|
1933
1933
|
for (let i = 0, c = e; c < t; c++, i++) {
|
|
1934
1934
|
let a = 0;
|
|
1935
1935
|
const s = this.bMarks[c];
|
|
1936
|
-
let
|
|
1937
|
-
for (c + 1 < t || r ?
|
|
1938
|
-
const _ = this.src.charCodeAt(
|
|
1936
|
+
let d = s, f;
|
|
1937
|
+
for (c + 1 < t || r ? f = this.eMarks[c] + 1 : f = this.eMarks[c]; d < f && a < n; ) {
|
|
1938
|
+
const _ = this.src.charCodeAt(d);
|
|
1939
1939
|
if (w(_))
|
|
1940
1940
|
_ === 9 ? a += 4 - (a + this.bsCount[c]) % 4 : a++;
|
|
1941
|
-
else if (
|
|
1941
|
+
else if (d - s < this.tShift[c])
|
|
1942
1942
|
a++;
|
|
1943
1943
|
else
|
|
1944
1944
|
break;
|
|
1945
|
-
|
|
1945
|
+
d++;
|
|
1946
1946
|
}
|
|
1947
|
-
a > n ? o[i] = new Array(a - n + 1).join(" ") + this.src.slice(
|
|
1947
|
+
a > n ? o[i] = new Array(a - n + 1).join(" ") + this.src.slice(d, f) : o[i] = this.src.slice(d, f);
|
|
1948
1948
|
}
|
|
1949
1949
|
return o.join("");
|
|
1950
1950
|
};
|
|
1951
1951
|
au.prototype.Token = tu;
|
|
1952
1952
|
const Po = 65536;
|
|
1953
|
-
function
|
|
1953
|
+
function Ye(u, e) {
|
|
1954
1954
|
const t = u.bMarks[e] + u.tShift[e], n = u.eMarks[e];
|
|
1955
1955
|
return u.src.slice(t, n);
|
|
1956
1956
|
}
|
|
@@ -1982,8 +1982,8 @@ function zo(u, e, t, n) {
|
|
|
1982
1982
|
return !1;
|
|
1983
1983
|
o++;
|
|
1984
1984
|
}
|
|
1985
|
-
let a =
|
|
1986
|
-
const
|
|
1985
|
+
let a = Ye(u, e + 1), s = a.split("|");
|
|
1986
|
+
const d = [];
|
|
1987
1987
|
for (let m = 0; m < s.length; m++) {
|
|
1988
1988
|
const A = s[m].trim();
|
|
1989
1989
|
if (!A) {
|
|
@@ -1993,13 +1993,13 @@ function zo(u, e, t, n) {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
if (!/^:?-+:?$/.test(A))
|
|
1995
1995
|
return !1;
|
|
1996
|
-
A.charCodeAt(A.length - 1) === 58 ?
|
|
1996
|
+
A.charCodeAt(A.length - 1) === 58 ? d.push(A.charCodeAt(0) === 58 ? "center" : "right") : A.charCodeAt(0) === 58 ? d.push("left") : d.push("");
|
|
1997
1997
|
}
|
|
1998
|
-
if (a =
|
|
1998
|
+
if (a = Ye(u, e).trim(), a.indexOf("|") === -1 || u.sCount[e] - u.blkIndent >= 4)
|
|
1999
1999
|
return !1;
|
|
2000
2000
|
s = ht(a), s.length && s[0] === "" && s.shift(), s.length && s[s.length - 1] === "" && s.pop();
|
|
2001
|
-
const
|
|
2002
|
-
if (
|
|
2001
|
+
const f = s.length;
|
|
2002
|
+
if (f === 0 || f !== d.length)
|
|
2003
2003
|
return !1;
|
|
2004
2004
|
if (n)
|
|
2005
2005
|
return !0;
|
|
@@ -2013,7 +2013,7 @@ function zo(u, e, t, n) {
|
|
|
2013
2013
|
T.map = [e, e + 1];
|
|
2014
2014
|
for (let m = 0; m < s.length; m++) {
|
|
2015
2015
|
const A = u.push("th_open", "th", 1);
|
|
2016
|
-
|
|
2016
|
+
d[m] && (A.attrs = [["style", "text-align:" + d[m]]]);
|
|
2017
2017
|
const y = u.push("inline", "", 0);
|
|
2018
2018
|
y.content = s[m].trim(), y.children = [], u.push("th_close", "th", -1);
|
|
2019
2019
|
}
|
|
@@ -2026,7 +2026,7 @@ function zo(u, e, t, n) {
|
|
|
2026
2026
|
m = !0;
|
|
2027
2027
|
break;
|
|
2028
2028
|
}
|
|
2029
|
-
if (m || (a =
|
|
2029
|
+
if (m || (a = Ye(u, r).trim(), !a) || u.sCount[r] - u.blkIndent >= 4 || (s = ht(a), s.length && s[0] === "" && s.shift(), s.length && s[s.length - 1] === "" && s.pop(), k += f - s.length, k > Po))
|
|
2030
2030
|
break;
|
|
2031
2031
|
if (r === e + 2) {
|
|
2032
2032
|
const y = u.push("tbody_open", "tbody", 1);
|
|
@@ -2034,11 +2034,11 @@ function zo(u, e, t, n) {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
const A = u.push("tr_open", "tr", 1);
|
|
2036
2036
|
A.map = [r, r + 1];
|
|
2037
|
-
for (let y = 0; y <
|
|
2037
|
+
for (let y = 0; y < f; y++) {
|
|
2038
2038
|
const I = u.push("td_open", "td", 1);
|
|
2039
|
-
|
|
2040
|
-
const
|
|
2041
|
-
|
|
2039
|
+
d[y] && (I.attrs = [["style", "text-align:" + d[y]]]);
|
|
2040
|
+
const V = u.push("inline", "", 0);
|
|
2041
|
+
V.content = s[y] ? s[y].trim() : "", V.children = [], u.push("td_close", "td", -1);
|
|
2042
2042
|
}
|
|
2043
2043
|
u.push("tr_close", "tr", -1);
|
|
2044
2044
|
}
|
|
@@ -2076,20 +2076,20 @@ function Uo(u, e, t, n) {
|
|
|
2076
2076
|
let a = r - c;
|
|
2077
2077
|
if (a < 3)
|
|
2078
2078
|
return !1;
|
|
2079
|
-
const s = u.src.slice(c, r),
|
|
2080
|
-
if (i === 96 &&
|
|
2079
|
+
const s = u.src.slice(c, r), d = u.src.slice(r, o);
|
|
2080
|
+
if (i === 96 && d.indexOf(String.fromCharCode(i)) >= 0)
|
|
2081
2081
|
return !1;
|
|
2082
2082
|
if (n)
|
|
2083
2083
|
return !0;
|
|
2084
|
-
let
|
|
2085
|
-
for (;
|
|
2086
|
-
if (u.src.charCodeAt(r) === i && !(u.sCount[
|
|
2084
|
+
let f = e, _ = !1;
|
|
2085
|
+
for (; f++, !(f >= t || (r = c = u.bMarks[f] + u.tShift[f], o = u.eMarks[f], r < o && u.sCount[f] < u.blkIndent)); )
|
|
2086
|
+
if (u.src.charCodeAt(r) === i && !(u.sCount[f] - u.blkIndent >= 4) && (r = u.skipChars(r, i), !(r - c < a) && (r = u.skipSpaces(r), !(r < o)))) {
|
|
2087
2087
|
_ = !0;
|
|
2088
2088
|
break;
|
|
2089
2089
|
}
|
|
2090
|
-
a = u.sCount[e], u.line =
|
|
2090
|
+
a = u.sCount[e], u.line = f + (_ ? 1 : 0);
|
|
2091
2091
|
const p = u.push("fence", "code", 0);
|
|
2092
|
-
return p.info =
|
|
2092
|
+
return p.info = d, p.content = u.getLines(e + 1, f, a, !0), p.markup = s, p.map = [e, u.line], !0;
|
|
2093
2093
|
}
|
|
2094
2094
|
function Ho(u, e, t, n) {
|
|
2095
2095
|
let r = u.bMarks[e] + u.tShift[e], o = u.eMarks[e];
|
|
@@ -2098,7 +2098,7 @@ function Ho(u, e, t, n) {
|
|
|
2098
2098
|
return !1;
|
|
2099
2099
|
if (n)
|
|
2100
2100
|
return !0;
|
|
2101
|
-
const c = [], a = [], s = [],
|
|
2101
|
+
const c = [], a = [], s = [], d = [], f = u.md.block.ruler.getRules("blockquote"), _ = u.parentType;
|
|
2102
2102
|
u.parentType = "blockquote";
|
|
2103
2103
|
let p = !1, h;
|
|
2104
2104
|
for (h = e; h < t; h++) {
|
|
@@ -2108,31 +2108,31 @@ function Ho(u, e, t, n) {
|
|
|
2108
2108
|
if (u.src.charCodeAt(r++) === 62 && !k) {
|
|
2109
2109
|
let A = u.sCount[h] + 1, y, I;
|
|
2110
2110
|
u.src.charCodeAt(r) === 32 ? (r++, A++, I = !1, y = !0) : u.src.charCodeAt(r) === 9 ? (y = !0, (u.bsCount[h] + A) % 4 === 3 ? (r++, A++, I = !1) : I = !0) : y = !1;
|
|
2111
|
-
let
|
|
2111
|
+
let V = A;
|
|
2112
2112
|
for (c.push(u.bMarks[h]), u.bMarks[h] = r; r < o; ) {
|
|
2113
2113
|
const nu = u.src.charCodeAt(r);
|
|
2114
2114
|
if (w(nu))
|
|
2115
|
-
nu === 9 ?
|
|
2115
|
+
nu === 9 ? V += 4 - (V + u.bsCount[h] + (I ? 1 : 0)) % 4 : V++;
|
|
2116
2116
|
else
|
|
2117
2117
|
break;
|
|
2118
2118
|
r++;
|
|
2119
2119
|
}
|
|
2120
|
-
p = r >= o, a.push(u.bsCount[h]), u.bsCount[h] = u.sCount[h] + 1 + (y ? 1 : 0), s.push(u.sCount[h]), u.sCount[h] =
|
|
2120
|
+
p = r >= o, a.push(u.bsCount[h]), u.bsCount[h] = u.sCount[h] + 1 + (y ? 1 : 0), s.push(u.sCount[h]), u.sCount[h] = V - A, d.push(u.tShift[h]), u.tShift[h] = r - u.bMarks[h];
|
|
2121
2121
|
continue;
|
|
2122
2122
|
}
|
|
2123
2123
|
if (p)
|
|
2124
2124
|
break;
|
|
2125
2125
|
let m = !1;
|
|
2126
|
-
for (let A = 0, y =
|
|
2127
|
-
if (
|
|
2126
|
+
for (let A = 0, y = f.length; A < y; A++)
|
|
2127
|
+
if (f[A](u, h, t, !0)) {
|
|
2128
2128
|
m = !0;
|
|
2129
2129
|
break;
|
|
2130
2130
|
}
|
|
2131
2131
|
if (m) {
|
|
2132
|
-
u.lineMax = h, u.blkIndent !== 0 && (c.push(u.bMarks[h]), a.push(u.bsCount[h]),
|
|
2132
|
+
u.lineMax = h, u.blkIndent !== 0 && (c.push(u.bMarks[h]), a.push(u.bsCount[h]), d.push(u.tShift[h]), s.push(u.sCount[h]), u.sCount[h] -= u.blkIndent);
|
|
2133
2133
|
break;
|
|
2134
2134
|
}
|
|
2135
|
-
c.push(u.bMarks[h]), a.push(u.bsCount[h]),
|
|
2135
|
+
c.push(u.bMarks[h]), a.push(u.bsCount[h]), d.push(u.tShift[h]), s.push(u.sCount[h]), u.sCount[h] = -1;
|
|
2136
2136
|
}
|
|
2137
2137
|
const C = u.blkIndent;
|
|
2138
2138
|
u.blkIndent = 0;
|
|
@@ -2142,8 +2142,8 @@ function Ho(u, e, t, n) {
|
|
|
2142
2142
|
D.map = T, u.md.block.tokenize(u, e, h);
|
|
2143
2143
|
const E = u.push("blockquote_close", "blockquote", -1);
|
|
2144
2144
|
E.markup = ">", u.lineMax = i, u.parentType = _, T[1] = u.line;
|
|
2145
|
-
for (let k = 0; k <
|
|
2146
|
-
u.bMarks[k + e] = c[k], u.tShift[k + e] =
|
|
2145
|
+
for (let k = 0; k < d.length; k++)
|
|
2146
|
+
u.bMarks[k + e] = c[k], u.tShift[k + e] = d[k], u.sCount[k + e] = s[k], u.bsCount[k + e] = a[k];
|
|
2147
2147
|
return u.blkIndent = C, !0;
|
|
2148
2148
|
}
|
|
2149
2149
|
function $o(u, e, t, n) {
|
|
@@ -2213,21 +2213,21 @@ function Go(u, e, t, n) {
|
|
|
2213
2213
|
let r, o, i, c, a = e, s = !0;
|
|
2214
2214
|
if (u.sCount[a] - u.blkIndent >= 4 || u.listIndent >= 0 && u.sCount[a] - u.listIndent >= 4 && u.sCount[a] < u.blkIndent)
|
|
2215
2215
|
return !1;
|
|
2216
|
-
let
|
|
2217
|
-
n && u.parentType === "paragraph" && u.sCount[a] >= u.blkIndent && (
|
|
2218
|
-
let
|
|
2216
|
+
let d = !1;
|
|
2217
|
+
n && u.parentType === "paragraph" && u.sCount[a] >= u.blkIndent && (d = !0);
|
|
2218
|
+
let f, _, p;
|
|
2219
2219
|
if ((p = bt(u, a)) >= 0) {
|
|
2220
|
-
if (
|
|
2220
|
+
if (f = !0, i = u.bMarks[a] + u.tShift[a], _ = Number(u.src.slice(i, p - 1)), d && _ !== 1) return !1;
|
|
2221
2221
|
} else if ((p = pt(u, a)) >= 0)
|
|
2222
|
-
|
|
2222
|
+
f = !1;
|
|
2223
2223
|
else
|
|
2224
2224
|
return !1;
|
|
2225
|
-
if (
|
|
2225
|
+
if (d && u.skipSpaces(p) >= u.eMarks[a])
|
|
2226
2226
|
return !1;
|
|
2227
2227
|
if (n)
|
|
2228
2228
|
return !0;
|
|
2229
2229
|
const h = u.src.charCodeAt(p - 1), C = u.tokens.length;
|
|
2230
|
-
|
|
2230
|
+
f ? (c = u.push("ordered_list_open", "ol", 1), _ !== 1 && (c.attrs = [["start", _]])) : c = u.push("bullet_list_open", "ul", 1);
|
|
2231
2231
|
const D = [a, 0];
|
|
2232
2232
|
c.map = D, c.markup = String.fromCharCode(h);
|
|
2233
2233
|
let T = !1;
|
|
@@ -2249,22 +2249,22 @@ function Go(u, e, t, n) {
|
|
|
2249
2249
|
const y = o;
|
|
2250
2250
|
let I;
|
|
2251
2251
|
y >= r ? I = 1 : I = A - m, I > 4 && (I = 1);
|
|
2252
|
-
const
|
|
2252
|
+
const V = m + I;
|
|
2253
2253
|
c = u.push("list_item_open", "li", 1), c.markup = String.fromCharCode(h);
|
|
2254
2254
|
const nu = [a, 0];
|
|
2255
|
-
c.map = nu,
|
|
2255
|
+
c.map = nu, f && (c.info = u.src.slice(i, p - 1));
|
|
2256
2256
|
const gu = u.tight, M = u.tShift[a], zu = u.sCount[a], qu = u.listIndent;
|
|
2257
|
-
if (u.listIndent = u.blkIndent, u.blkIndent =
|
|
2257
|
+
if (u.listIndent = u.blkIndent, u.blkIndent = V, u.tight = !0, u.tShift[a] = y - u.bMarks[a], u.sCount[a] = A, y >= 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 = qu, u.tShift[a] = M, u.sCount[a] = zu, u.tight = gu, c = u.push("list_item_close", "li", -1), c.markup = String.fromCharCode(h), a = u.line, nu[1] = a, a >= t || u.sCount[a] < u.blkIndent || u.sCount[a] - u.blkIndent >= 4)
|
|
2258
2258
|
break;
|
|
2259
|
-
let
|
|
2260
|
-
for (let hu = 0,
|
|
2259
|
+
let yu = !1;
|
|
2260
|
+
for (let hu = 0, ve = E.length; hu < ve; hu++)
|
|
2261
2261
|
if (E[hu](u, a, t, !0)) {
|
|
2262
|
-
|
|
2262
|
+
yu = !0;
|
|
2263
2263
|
break;
|
|
2264
2264
|
}
|
|
2265
|
-
if (
|
|
2265
|
+
if (yu)
|
|
2266
2266
|
break;
|
|
2267
|
-
if (
|
|
2267
|
+
if (f) {
|
|
2268
2268
|
if (p = bt(u, a), p < 0)
|
|
2269
2269
|
break;
|
|
2270
2270
|
i = u.bMarks[a] + u.tShift[a];
|
|
@@ -2273,7 +2273,7 @@ function Go(u, e, t, n) {
|
|
|
2273
2273
|
if (h !== u.src.charCodeAt(p - 1))
|
|
2274
2274
|
break;
|
|
2275
2275
|
}
|
|
2276
|
-
return
|
|
2276
|
+
return f ? c = u.push("ordered_list_close", "ol", -1) : c = u.push("bullet_list_close", "ul", -1), c.markup = String.fromCharCode(h), D[1] = a, u.line = a, u.parentType = k, s && jo(u, C), !0;
|
|
2277
2277
|
}
|
|
2278
2278
|
function Wo(u, e, t, n) {
|
|
2279
2279
|
let r = u.bMarks[e] + u.tShift[e], o = u.eMarks[e], i = e + 1;
|
|
@@ -2285,7 +2285,7 @@ function Wo(u, e, t, n) {
|
|
|
2285
2285
|
return null;
|
|
2286
2286
|
let m = !1;
|
|
2287
2287
|
if (u.sCount[E] - u.blkIndent > 3 && (m = !0), u.sCount[E] < 0 && (m = !0), !m) {
|
|
2288
|
-
const I = u.md.block.ruler.getRules("reference"),
|
|
2288
|
+
const I = u.md.block.ruler.getRules("reference"), V = u.parentType;
|
|
2289
2289
|
u.parentType = "reference";
|
|
2290
2290
|
let nu = !1;
|
|
2291
2291
|
for (let gu = 0, M = I.length; gu < M; gu++)
|
|
@@ -2293,7 +2293,7 @@ function Wo(u, e, t, n) {
|
|
|
2293
2293
|
nu = !0;
|
|
2294
2294
|
break;
|
|
2295
2295
|
}
|
|
2296
|
-
if (u.parentType =
|
|
2296
|
+
if (u.parentType = V, nu)
|
|
2297
2297
|
return null;
|
|
2298
2298
|
}
|
|
2299
2299
|
const A = u.bMarks[E] + u.tShift[E], y = u.eMarks[E];
|
|
@@ -2326,13 +2326,13 @@ function Wo(u, e, t, n) {
|
|
|
2326
2326
|
k !== null && (a += k, o = a.length, i++);
|
|
2327
2327
|
} else if (!w(E)) break;
|
|
2328
2328
|
}
|
|
2329
|
-
const
|
|
2330
|
-
if (!
|
|
2329
|
+
const d = u.md.helpers.parseLinkDestination(a, r, o);
|
|
2330
|
+
if (!d.ok)
|
|
2331
2331
|
return !1;
|
|
2332
|
-
const
|
|
2333
|
-
if (!u.md.validateLink(
|
|
2332
|
+
const f = u.md.normalizeLink(d.str);
|
|
2333
|
+
if (!u.md.validateLink(f))
|
|
2334
2334
|
return !1;
|
|
2335
|
-
r =
|
|
2335
|
+
r = d.pos;
|
|
2336
2336
|
const _ = r, p = i, h = r;
|
|
2337
2337
|
for (; r < o; r++) {
|
|
2338
2338
|
const E = a.charCodeAt(r);
|
|
@@ -2363,8 +2363,8 @@ function Wo(u, e, t, n) {
|
|
|
2363
2363
|
}
|
|
2364
2364
|
if (r < o && a.charCodeAt(r) !== 10)
|
|
2365
2365
|
return !1;
|
|
2366
|
-
const T =
|
|
2367
|
-
return T ? (n || (typeof u.env.references > "u" && (u.env.references = {}), typeof u.env.references[T] > "u" && (u.env.references[T] = { title: D, href:
|
|
2366
|
+
const T = Te(a.slice(1, s));
|
|
2367
|
+
return T ? (n || (typeof u.env.references > "u" && (u.env.references = {}), typeof u.env.references[T] > "u" && (u.env.references[T] = { title: D, href: f }), u.line = i), !0) : !1;
|
|
2368
2368
|
}
|
|
2369
2369
|
const Zo = [
|
|
2370
2370
|
"address",
|
|
@@ -2429,7 +2429,7 @@ const Zo = [
|
|
|
2429
2429
|
"tr",
|
|
2430
2430
|
"track",
|
|
2431
2431
|
"ul"
|
|
2432
|
-
], Vo = "[a-zA-Z_:][a-zA-Z0-9:._-]*", Yo = "[^\"'=<>`\\x00-\\x20]+", Xo = "'[^']*'", Jo = '"[^"]*"', Qo = "(?:" + Yo + "|" + Xo + "|" + Jo + ")", Ko = "(?:\\s+" + Vo + "(?:\\s*=\\s*" + Qo + ")?)", Ut = "<[A-Za-z][A-Za-z0-9\\-]*" + Ko + "*\\s*\\/?>", Ht = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", uc = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->", ec = "<[?][\\s\\S]*?[?]>", tc = "<![A-Za-z][^>]*>", nc = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>", rc = new RegExp("^(?:" + Ut + "|" + Ht + "|" + uc + "|" + ec + "|" + tc + "|" + nc + ")"), oc = new RegExp("^(?:" + Ut + "|" + Ht + ")"),
|
|
2432
|
+
], Vo = "[a-zA-Z_:][a-zA-Z0-9:._-]*", Yo = "[^\"'=<>`\\x00-\\x20]+", Xo = "'[^']*'", Jo = '"[^"]*"', Qo = "(?:" + Yo + "|" + Xo + "|" + Jo + ")", Ko = "(?:\\s+" + Vo + "(?:\\s*=\\s*" + Qo + ")?)", Ut = "<[A-Za-z][A-Za-z0-9\\-]*" + Ko + "*\\s*\\/?>", Ht = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", uc = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->", ec = "<[?][\\s\\S]*?[?]>", tc = "<![A-Za-z][^>]*>", nc = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>", rc = new RegExp("^(?:" + Ut + "|" + Ht + "|" + uc + "|" + ec + "|" + tc + "|" + nc + ")"), oc = new RegExp("^(?:" + Ut + "|" + Ht + ")"), Lu = [
|
|
2433
2433
|
[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, !0],
|
|
2434
2434
|
[/^<!--/, /-->/, !0],
|
|
2435
2435
|
[/^<\?/, /\?>/, !0],
|
|
@@ -2443,16 +2443,16 @@ function cc(u, e, t, n) {
|
|
|
2443
2443
|
if (u.sCount[e] - u.blkIndent >= 4 || !u.md.options.html || u.src.charCodeAt(r) !== 60)
|
|
2444
2444
|
return !1;
|
|
2445
2445
|
let i = u.src.slice(r, o), c = 0;
|
|
2446
|
-
for (; c <
|
|
2446
|
+
for (; c < Lu.length && !Lu[c][0].test(i); c++)
|
|
2447
2447
|
;
|
|
2448
|
-
if (c ===
|
|
2448
|
+
if (c === Lu.length)
|
|
2449
2449
|
return !1;
|
|
2450
2450
|
if (n)
|
|
2451
|
-
return
|
|
2451
|
+
return Lu[c][2];
|
|
2452
2452
|
let a = e + 1;
|
|
2453
|
-
if (!
|
|
2453
|
+
if (!Lu[c][1].test(i)) {
|
|
2454
2454
|
for (; a < t && !(u.sCount[a] < u.blkIndent); a++)
|
|
2455
|
-
if (r = u.bMarks[a] + u.tShift[a], o = u.eMarks[a], i = u.src.slice(r, o),
|
|
2455
|
+
if (r = u.bMarks[a] + u.tShift[a], o = u.eMarks[a], i = u.src.slice(r, o), Lu[c][1].test(i)) {
|
|
2456
2456
|
i.length !== 0 && a++;
|
|
2457
2457
|
break;
|
|
2458
2458
|
}
|
|
@@ -2480,10 +2480,10 @@ function ic(u, e, t, n) {
|
|
|
2480
2480
|
a > r && w(u.src.charCodeAt(a - 1)) && (o = a), u.line = e + 1;
|
|
2481
2481
|
const s = u.push("heading_open", "h" + String(c), 1);
|
|
2482
2482
|
s.markup = "########".slice(0, c), s.map = [e, u.line];
|
|
2483
|
-
const
|
|
2484
|
-
|
|
2485
|
-
const
|
|
2486
|
-
return
|
|
2483
|
+
const d = u.push("inline", "", 0);
|
|
2484
|
+
d.content = u.src.slice(r, o).trim(), d.map = [e, u.line], d.children = [];
|
|
2485
|
+
const f = u.push("heading_close", "h" + String(c), -1);
|
|
2486
|
+
return f.markup = "########".slice(0, c), !0;
|
|
2487
2487
|
}
|
|
2488
2488
|
function ac(u, e, t) {
|
|
2489
2489
|
const n = u.md.block.ruler.getRules("paragraph");
|
|
@@ -2520,10 +2520,10 @@ function ac(u, e, t) {
|
|
|
2520
2520
|
u.line = c + 1;
|
|
2521
2521
|
const s = u.push("heading_open", "h" + String(o), 1);
|
|
2522
2522
|
s.markup = String.fromCharCode(i), s.map = [e, u.line];
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2525
|
-
const
|
|
2526
|
-
return
|
|
2523
|
+
const d = u.push("inline", "", 0);
|
|
2524
|
+
d.content = a, d.map = [e, u.line - 1], d.children = [];
|
|
2525
|
+
const f = u.push("heading_close", "h" + String(o), -1);
|
|
2526
|
+
return f.markup = String.fromCharCode(i), u.parentType = r, !0;
|
|
2527
2527
|
}
|
|
2528
2528
|
function sc(u, e, t) {
|
|
2529
2529
|
const n = u.md.block.ruler.getRules("paragraph"), r = u.parentType;
|
|
@@ -2532,8 +2532,8 @@ function sc(u, e, t) {
|
|
|
2532
2532
|
if (u.sCount[o] - u.blkIndent > 3 || u.sCount[o] < 0)
|
|
2533
2533
|
continue;
|
|
2534
2534
|
let s = !1;
|
|
2535
|
-
for (let
|
|
2536
|
-
if (n[
|
|
2535
|
+
for (let d = 0, f = n.length; d < f; d++)
|
|
2536
|
+
if (n[d](u, o, t, !0)) {
|
|
2537
2537
|
s = !0;
|
|
2538
2538
|
break;
|
|
2539
2539
|
}
|
|
@@ -2562,12 +2562,12 @@ const xe = [
|
|
|
2562
2562
|
["lheading", ac],
|
|
2563
2563
|
["paragraph", sc]
|
|
2564
2564
|
];
|
|
2565
|
-
function
|
|
2566
|
-
this.ruler = new
|
|
2565
|
+
function Se() {
|
|
2566
|
+
this.ruler = new Z();
|
|
2567
2567
|
for (let u = 0; u < xe.length; u++)
|
|
2568
2568
|
this.ruler.push(xe[u][0], xe[u][1], { alt: (xe[u][2] || []).slice() });
|
|
2569
2569
|
}
|
|
2570
|
-
|
|
2570
|
+
Se.prototype.tokenize = function(u, e, t) {
|
|
2571
2571
|
const n = this.ruler.getRules(""), r = n.length, o = u.md.options.maxNesting;
|
|
2572
2572
|
let i = e, c = !1;
|
|
2573
2573
|
for (; i < t && (u.line = i = u.skipEmptyLines(i), !(i >= t || u.sCount[i] < u.blkIndent)); ) {
|
|
@@ -2577,8 +2577,8 @@ we.prototype.tokenize = function(u, e, t) {
|
|
|
2577
2577
|
}
|
|
2578
2578
|
const a = u.line;
|
|
2579
2579
|
let s = !1;
|
|
2580
|
-
for (let
|
|
2581
|
-
if (s = n[
|
|
2580
|
+
for (let d = 0; d < r; d++)
|
|
2581
|
+
if (s = n[d](u, i, t, !1), s) {
|
|
2582
2582
|
if (a >= u.line)
|
|
2583
2583
|
throw new Error("block rule didn't increment state.line");
|
|
2584
2584
|
break;
|
|
@@ -2587,13 +2587,13 @@ we.prototype.tokenize = function(u, e, t) {
|
|
|
2587
2587
|
u.tight = !c, u.isEmpty(u.line - 1) && (c = !0), i = u.line, i < t && u.isEmpty(i) && (c = !0, i++, u.line = i);
|
|
2588
2588
|
}
|
|
2589
2589
|
};
|
|
2590
|
-
|
|
2590
|
+
Se.prototype.parse = function(u, e, t, n) {
|
|
2591
2591
|
if (!u)
|
|
2592
2592
|
return;
|
|
2593
2593
|
const r = new this.State(u, e, t, n);
|
|
2594
2594
|
this.tokenize(r, r.line, r.lineMax);
|
|
2595
2595
|
};
|
|
2596
|
-
|
|
2596
|
+
Se.prototype.State = au;
|
|
2597
2597
|
function ce(u, e, t, n) {
|
|
2598
2598
|
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;
|
|
2599
2599
|
}
|
|
@@ -2612,7 +2612,7 @@ ce.prototype.scanDelims = function(u, e) {
|
|
|
2612
2612
|
let o = u;
|
|
2613
2613
|
for (; o < t && this.src.charCodeAt(o) === n; )
|
|
2614
2614
|
o++;
|
|
2615
|
-
const i = o - u, c = o < t ? this.src.charCodeAt(o) : 32, a = ue(r) || Ku(String.fromCharCode(r)), s = ue(c) || Ku(String.fromCharCode(c)),
|
|
2615
|
+
const i = o - u, c = o < t ? this.src.charCodeAt(o) : 32, a = ue(r) || Ku(String.fromCharCode(r)), s = ue(c) || Ku(String.fromCharCode(c)), d = Qu(r), f = Qu(c), _ = !f && (!s || d || a), p = !d && (!a || f || s);
|
|
2616
2616
|
return { can_open: _ && (e || !p || a), can_close: p && (e || !_ || s), length: i };
|
|
2617
2617
|
};
|
|
2618
2618
|
ce.prototype.Token = tu;
|
|
@@ -2670,10 +2670,10 @@ function hc(u, e) {
|
|
|
2670
2670
|
u.pending = u.pending.slice(0, -o.length);
|
|
2671
2671
|
const s = u.push("link_open", "a", 1);
|
|
2672
2672
|
s.attrs = [["href", a]], s.markup = "linkify", s.info = "auto";
|
|
2673
|
-
const
|
|
2674
|
-
|
|
2675
|
-
const
|
|
2676
|
-
|
|
2673
|
+
const d = u.push("text", "", 0);
|
|
2674
|
+
d.content = u.md.normalizeLinkText(c);
|
|
2675
|
+
const f = u.push("link_close", "a", -1);
|
|
2676
|
+
f.markup = "linkify", f.info = "auto";
|
|
2677
2677
|
}
|
|
2678
2678
|
return u.pos += c.length - o.length, !0;
|
|
2679
2679
|
}
|
|
@@ -2740,15 +2740,15 @@ function _c(u, e) {
|
|
|
2740
2740
|
for (; (s = u.src.indexOf("`", a)) !== -1; ) {
|
|
2741
2741
|
for (a = s + 1; a < o && u.src.charCodeAt(a) === 96; )
|
|
2742
2742
|
a++;
|
|
2743
|
-
const
|
|
2744
|
-
if (
|
|
2743
|
+
const d = a - s;
|
|
2744
|
+
if (d === c) {
|
|
2745
2745
|
if (!e) {
|
|
2746
|
-
const
|
|
2747
|
-
|
|
2746
|
+
const f = u.push("code_inline", "code", 0);
|
|
2747
|
+
f.markup = i, f.content = u.src.slice(t, s).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
|
|
2748
2748
|
}
|
|
2749
2749
|
return u.pos = a, !0;
|
|
2750
2750
|
}
|
|
2751
|
-
u.backticks[
|
|
2751
|
+
u.backticks[d] = s;
|
|
2752
2752
|
}
|
|
2753
2753
|
return u.backticksScanned = !0, e || (u.pending += i), u.pos += c, !0;
|
|
2754
2754
|
}
|
|
@@ -2861,29 +2861,29 @@ function Ec(u, e) {
|
|
|
2861
2861
|
let t, n, r, o, i = "", c = "", a = u.pos, s = !0;
|
|
2862
2862
|
if (u.src.charCodeAt(u.pos) !== 91)
|
|
2863
2863
|
return !1;
|
|
2864
|
-
const
|
|
2864
|
+
const d = u.pos, f = u.posMax, _ = u.pos + 1, p = u.md.helpers.parseLinkLabel(u, u.pos, !0);
|
|
2865
2865
|
if (p < 0)
|
|
2866
2866
|
return !1;
|
|
2867
2867
|
let h = p + 1;
|
|
2868
|
-
if (h <
|
|
2869
|
-
for (s = !1, h++; h <
|
|
2868
|
+
if (h < f && u.src.charCodeAt(h) === 40) {
|
|
2869
|
+
for (s = !1, h++; h < f && (t = u.src.charCodeAt(h), !(!w(t) && t !== 10)); h++)
|
|
2870
2870
|
;
|
|
2871
|
-
if (h >=
|
|
2871
|
+
if (h >= f)
|
|
2872
2872
|
return !1;
|
|
2873
2873
|
if (a = h, r = u.md.helpers.parseLinkDestination(u.src, h, u.posMax), r.ok) {
|
|
2874
|
-
for (i = u.md.normalizeLink(r.str), u.md.validateLink(i) ? h = r.pos : i = "", a = h; h <
|
|
2874
|
+
for (i = u.md.normalizeLink(r.str), u.md.validateLink(i) ? h = r.pos : i = "", a = h; h < f && (t = u.src.charCodeAt(h), !(!w(t) && t !== 10)); h++)
|
|
2875
2875
|
;
|
|
2876
|
-
if (r = u.md.helpers.parseLinkTitle(u.src, h, u.posMax), h <
|
|
2877
|
-
for (c = r.str, h = r.pos; h <
|
|
2876
|
+
if (r = u.md.helpers.parseLinkTitle(u.src, h, u.posMax), h < f && a !== h && r.ok)
|
|
2877
|
+
for (c = r.str, h = r.pos; h < f && (t = u.src.charCodeAt(h), !(!w(t) && t !== 10)); h++)
|
|
2878
2878
|
;
|
|
2879
2879
|
}
|
|
2880
|
-
(h >=
|
|
2880
|
+
(h >= f || u.src.charCodeAt(h) !== 41) && (s = !0), h++;
|
|
2881
2881
|
}
|
|
2882
2882
|
if (s) {
|
|
2883
2883
|
if (typeof u.env.references > "u")
|
|
2884
2884
|
return !1;
|
|
2885
|
-
if (h <
|
|
2886
|
-
return u.pos =
|
|
2885
|
+
if (h < f && u.src.charCodeAt(h) === 91 ? (a = h + 1, h = u.md.helpers.parseLinkLabel(u, h), h >= 0 ? n = u.src.slice(a, h++) : h = p + 1) : h = p + 1, n || (n = u.src.slice(_, p)), o = u.env.references[Te(n)], !o)
|
|
2886
|
+
return u.pos = d, !1;
|
|
2887
2887
|
i = o.href, c = o.title;
|
|
2888
2888
|
}
|
|
2889
2889
|
if (!e) {
|
|
@@ -2891,11 +2891,11 @@ function Ec(u, e) {
|
|
|
2891
2891
|
const C = u.push("link_open", "a", 1), D = [["href", i]];
|
|
2892
2892
|
C.attrs = D, c && D.push(["title", c]), u.linkLevel++, u.md.inline.tokenize(u), u.linkLevel--, u.push("link_close", "a", -1);
|
|
2893
2893
|
}
|
|
2894
|
-
return u.pos = h, u.posMax =
|
|
2894
|
+
return u.pos = h, u.posMax = f, !0;
|
|
2895
2895
|
}
|
|
2896
2896
|
function Ac(u, e) {
|
|
2897
|
-
let t, n, r, o, i, c, a, s,
|
|
2898
|
-
const
|
|
2897
|
+
let t, n, r, o, i, c, a, s, d = "";
|
|
2898
|
+
const f = u.pos, _ = u.posMax;
|
|
2899
2899
|
if (u.src.charCodeAt(u.pos) !== 33 || u.src.charCodeAt(u.pos + 1) !== 91)
|
|
2900
2900
|
return !1;
|
|
2901
2901
|
const p = u.pos + 2, h = u.md.helpers.parseLinkLabel(u, u.pos + 1, !1);
|
|
@@ -2906,7 +2906,7 @@ function Ac(u, e) {
|
|
|
2906
2906
|
;
|
|
2907
2907
|
if (o >= _)
|
|
2908
2908
|
return !1;
|
|
2909
|
-
for (s = o, c = u.md.helpers.parseLinkDestination(u.src, o, u.posMax), c.ok && (
|
|
2909
|
+
for (s = o, c = u.md.helpers.parseLinkDestination(u.src, o, u.posMax), c.ok && (d = u.md.normalizeLink(c.str), u.md.validateLink(d) ? o = c.pos : d = ""), s = o; o < _ && (t = u.src.charCodeAt(o), !(!w(t) && t !== 10)); o++)
|
|
2910
2910
|
;
|
|
2911
2911
|
if (c = u.md.helpers.parseLinkTitle(u.src, o, u.posMax), o < _ && s !== o && c.ok)
|
|
2912
2912
|
for (a = c.str, o = c.pos; o < _ && (t = u.src.charCodeAt(o), !(!w(t) && t !== 10)); o++)
|
|
@@ -2914,14 +2914,14 @@ function Ac(u, e) {
|
|
|
2914
2914
|
else
|
|
2915
2915
|
a = "";
|
|
2916
2916
|
if (o >= _ || u.src.charCodeAt(o) !== 41)
|
|
2917
|
-
return u.pos =
|
|
2917
|
+
return u.pos = f, !1;
|
|
2918
2918
|
o++;
|
|
2919
2919
|
} else {
|
|
2920
2920
|
if (typeof u.env.references > "u")
|
|
2921
2921
|
return !1;
|
|
2922
|
-
if (o < _ && u.src.charCodeAt(o) === 91 ? (s = o + 1, o = u.md.helpers.parseLinkLabel(u, o), o >= 0 ? r = u.src.slice(s, o++) : o = h + 1) : o = h + 1, r || (r = u.src.slice(p, h)), i = u.env.references[
|
|
2923
|
-
return u.pos =
|
|
2924
|
-
|
|
2922
|
+
if (o < _ && u.src.charCodeAt(o) === 91 ? (s = o + 1, o = u.md.helpers.parseLinkLabel(u, o), o >= 0 ? r = u.src.slice(s, o++) : o = h + 1) : o = h + 1, r || (r = u.src.slice(p, h)), i = u.env.references[Te(r)], !i)
|
|
2923
|
+
return u.pos = f, !1;
|
|
2924
|
+
d = i.href, a = i.title;
|
|
2925
2925
|
}
|
|
2926
2926
|
if (!e) {
|
|
2927
2927
|
n = u.src.slice(p, h);
|
|
@@ -2932,7 +2932,7 @@ function Ac(u, e) {
|
|
|
2932
2932
|
u.env,
|
|
2933
2933
|
C
|
|
2934
2934
|
);
|
|
2935
|
-
const D = u.push("image", "img", 0), T = [["src",
|
|
2935
|
+
const D = u.push("image", "img", 0), T = [["src", d], ["alt", ""]];
|
|
2936
2936
|
D.attrs = T, D.children = C, D.content = n, a && T.push(["title", a]);
|
|
2937
2937
|
}
|
|
2938
2938
|
return u.pos = o, u.posMax = _, !0;
|
|
@@ -3017,7 +3017,7 @@ function Ic(u, e) {
|
|
|
3017
3017
|
if (o) {
|
|
3018
3018
|
if (!e) {
|
|
3019
3019
|
const i = o[1][0].toLowerCase() === "x" ? parseInt(o[1].slice(1), 16) : parseInt(o[1], 10), c = u.push("text_special", "", 0);
|
|
3020
|
-
c.content = p0(i) ?
|
|
3020
|
+
c.content = p0(i) ? De(i) : De(65533), c.markup = o[0], c.info = "entity";
|
|
3021
3021
|
}
|
|
3022
3022
|
return u.pos += o[0].length, !0;
|
|
3023
3023
|
}
|
|
@@ -3046,19 +3046,19 @@ function xt(u) {
|
|
|
3046
3046
|
if (o.push(0), (u[n].marker !== c.marker || r !== c.token - 1) && (n = i), r = c.token, c.length = c.length || 0, !c.close) continue;
|
|
3047
3047
|
e.hasOwnProperty(c.marker) || (e[c.marker] = [-1, -1, -1, -1, -1, -1]);
|
|
3048
3048
|
const a = e[c.marker][(c.open ? 3 : 0) + c.length % 3];
|
|
3049
|
-
let s = n - o[n] - 1,
|
|
3049
|
+
let s = n - o[n] - 1, d = s;
|
|
3050
3050
|
for (; s > a; s -= o[s] + 1) {
|
|
3051
|
-
const
|
|
3052
|
-
if (
|
|
3051
|
+
const f = u[s];
|
|
3052
|
+
if (f.marker === c.marker && f.open && f.end < 0) {
|
|
3053
3053
|
let _ = !1;
|
|
3054
|
-
if ((
|
|
3054
|
+
if ((f.close || c.open) && (f.length + c.length) % 3 === 0 && (f.length % 3 !== 0 || c.length % 3 !== 0) && (_ = !0), !_) {
|
|
3055
3055
|
const p = s > 0 && !u[s - 1].open ? o[s - 1] + 1 : 0;
|
|
3056
|
-
o[i] = i - s + p, o[s] = p, c.open = !1,
|
|
3056
|
+
o[i] = i - s + p, o[s] = p, c.open = !1, f.end = i, f.close = !1, d = -1, r = -2;
|
|
3057
3057
|
break;
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
3060
|
}
|
|
3061
|
-
|
|
3061
|
+
d !== -1 && (e[c.marker][(c.open ? 3 : 0) + (c.length || 0) % 3] = d);
|
|
3062
3062
|
}
|
|
3063
3063
|
}
|
|
3064
3064
|
function Mc(u) {
|
|
@@ -3074,7 +3074,7 @@ function Lc(u) {
|
|
|
3074
3074
|
r[e].nesting < 0 && n--, r[e].level = n, r[e].nesting > 0 && n++, r[e].type === "text" && e + 1 < o && r[e + 1].type === "text" ? r[e + 1].content = r[e].content + r[e + 1].content : (e !== t && (r[t] = r[e]), t++);
|
|
3075
3075
|
e !== t && (r.length = t);
|
|
3076
3076
|
}
|
|
3077
|
-
const
|
|
3077
|
+
const Xe = [
|
|
3078
3078
|
["text", fc],
|
|
3079
3079
|
["linkify", hc],
|
|
3080
3080
|
["newline", pc],
|
|
@@ -3087,7 +3087,7 @@ const Je = [
|
|
|
3087
3087
|
["autolink", yc],
|
|
3088
3088
|
["html_inline", wc],
|
|
3089
3089
|
["entity", Ic]
|
|
3090
|
-
],
|
|
3090
|
+
], Je = [
|
|
3091
3091
|
["balance_pairs", Mc],
|
|
3092
3092
|
["strikethrough", $t.postProcess],
|
|
3093
3093
|
["emphasis", jt.postProcess],
|
|
@@ -3096,12 +3096,12 @@ const Je = [
|
|
|
3096
3096
|
["fragments_join", Lc]
|
|
3097
3097
|
];
|
|
3098
3098
|
function ie() {
|
|
3099
|
-
this.ruler = new
|
|
3099
|
+
this.ruler = new Z();
|
|
3100
|
+
for (let u = 0; u < Xe.length; u++)
|
|
3101
|
+
this.ruler.push(Xe[u][0], Xe[u][1]);
|
|
3102
|
+
this.ruler2 = new Z();
|
|
3100
3103
|
for (let u = 0; u < Je.length; u++)
|
|
3101
|
-
this.
|
|
3102
|
-
this.ruler2 = new V();
|
|
3103
|
-
for (let u = 0; u < Qe.length; u++)
|
|
3104
|
-
this.ruler2.push(Qe[u][0], Qe[u][1]);
|
|
3104
|
+
this.ruler2.push(Je[u][0], Je[u][1]);
|
|
3105
3105
|
}
|
|
3106
3106
|
ie.prototype.skipToken = function(u) {
|
|
3107
3107
|
const e = u.pos, t = this.ruler.getRules(""), n = t.length, r = u.md.options.maxNesting, o = u.cache;
|
|
@@ -3163,27 +3163,27 @@ function Oc(u) {
|
|
|
3163
3163
|
// but can start with > (markdown blockquote)
|
|
3164
3164
|
"(^|(?![.:/\\-_@])(?:[$+<=>^`||]|" + e.src_ZPCc + "))((?![$+<=>^`||])" + e.tpl_host_port_no_ip_fuzzy_strict + e.src_path + ")", e;
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3166
|
+
function r0(u) {
|
|
3167
3167
|
return Array.prototype.slice.call(arguments, 1).forEach(function(t) {
|
|
3168
3168
|
t && Object.keys(t).forEach(function(n) {
|
|
3169
3169
|
u[n] = t[n];
|
|
3170
3170
|
});
|
|
3171
3171
|
}), u;
|
|
3172
3172
|
}
|
|
3173
|
-
function
|
|
3173
|
+
function we(u) {
|
|
3174
3174
|
return Object.prototype.toString.call(u);
|
|
3175
3175
|
}
|
|
3176
3176
|
function Nc(u) {
|
|
3177
|
-
return
|
|
3177
|
+
return we(u) === "[object String]";
|
|
3178
3178
|
}
|
|
3179
3179
|
function Bc(u) {
|
|
3180
|
-
return
|
|
3180
|
+
return we(u) === "[object Object]";
|
|
3181
3181
|
}
|
|
3182
3182
|
function Pc(u) {
|
|
3183
|
-
return
|
|
3183
|
+
return we(u) === "[object RegExp]";
|
|
3184
3184
|
}
|
|
3185
3185
|
function gt(u) {
|
|
3186
|
-
return
|
|
3186
|
+
return we(u) === "[object Function]";
|
|
3187
3187
|
}
|
|
3188
3188
|
function zc(u) {
|
|
3189
3189
|
return u.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
@@ -3245,7 +3245,7 @@ function kt() {
|
|
|
3245
3245
|
e.normalize(u);
|
|
3246
3246
|
};
|
|
3247
3247
|
}
|
|
3248
|
-
function
|
|
3248
|
+
function ye(u) {
|
|
3249
3249
|
const e = u.re = Oc(u.__opts__), t = u.__tlds__.slice();
|
|
3250
3250
|
u.onCompile(), u.__tlds_replaced__ || t.push(Hc), t.push(e.src_xn), e.src_tlds = t.join("|");
|
|
3251
3251
|
function n(c) {
|
|
@@ -3286,25 +3286,25 @@ function Wc(u, e) {
|
|
|
3286
3286
|
const t = u.__index__, n = u.__last_index__, r = u.__text_cache__.slice(t, n);
|
|
3287
3287
|
this.schema = u.__schema__.toLowerCase(), this.index = t + e, this.lastIndex = n + e, this.raw = r, this.text = r, this.url = r;
|
|
3288
3288
|
}
|
|
3289
|
-
function
|
|
3289
|
+
function o0(u, e) {
|
|
3290
3290
|
const t = new Wc(u, e);
|
|
3291
3291
|
return u.__compiled__[t.schema].normalize(t, u), t;
|
|
3292
3292
|
}
|
|
3293
3293
|
function X(u, e) {
|
|
3294
3294
|
if (!(this instanceof X))
|
|
3295
3295
|
return new X(u, e);
|
|
3296
|
-
e || qc(u) && (e = u, u = {}), this.__opts__ =
|
|
3296
|
+
e || qc(u) && (e = u, u = {}), this.__opts__ = r0({}, Gt, e), this.__index__ = -1, this.__last_index__ = -1, this.__schema__ = "", this.__text_cache__ = "", this.__schemas__ = r0({}, Uc, u), this.__compiled__ = {}, this.__tlds__ = $c, this.__tlds_replaced__ = !1, this.re = {}, ye(this);
|
|
3297
3297
|
}
|
|
3298
3298
|
X.prototype.add = function(e, t) {
|
|
3299
|
-
return this.__schemas__[e] = t,
|
|
3299
|
+
return this.__schemas__[e] = t, ye(this), this;
|
|
3300
3300
|
};
|
|
3301
3301
|
X.prototype.set = function(e) {
|
|
3302
|
-
return this.__opts__ =
|
|
3302
|
+
return this.__opts__ = r0(this.__opts__, e), this;
|
|
3303
3303
|
};
|
|
3304
3304
|
X.prototype.test = function(e) {
|
|
3305
3305
|
if (this.__text_cache__ = e, this.__index__ = -1, !e.length)
|
|
3306
3306
|
return !1;
|
|
3307
|
-
let t, n, r, o, i, c, a, s,
|
|
3307
|
+
let t, n, r, o, i, c, a, s, d;
|
|
3308
3308
|
if (this.re.schema_test.test(e)) {
|
|
3309
3309
|
for (a = this.re.schema_search, a.lastIndex = 0; (t = a.exec(e)) !== null; )
|
|
3310
3310
|
if (o = this.testSchemaAt(e, t[2], a.lastIndex), o) {
|
|
@@ -3312,7 +3312,7 @@ X.prototype.test = function(e) {
|
|
|
3312
3312
|
break;
|
|
3313
3313
|
}
|
|
3314
3314
|
}
|
|
3315
|
-
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:"] && (
|
|
3315
|
+
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:"] && (d = e.indexOf("@"), d >= 0 && (r = e.match(this.re.email_fuzzy)) !== null && (i = r.index + r[1].length, c = r.index + r[0].length, (this.__index__ < 0 || i < this.__index__ || i === this.__index__ && c > this.__last_index__) && (this.__schema__ = "mailto:", this.__index__ = i, this.__last_index__ = c))), this.__index__ >= 0;
|
|
3316
3316
|
};
|
|
3317
3317
|
X.prototype.pretest = function(e) {
|
|
3318
3318
|
return this.re.pretest.test(e);
|
|
@@ -3323,10 +3323,10 @@ X.prototype.testSchemaAt = function(e, t, n) {
|
|
|
3323
3323
|
X.prototype.match = function(e) {
|
|
3324
3324
|
const t = [];
|
|
3325
3325
|
let n = 0;
|
|
3326
|
-
this.__index__ >= 0 && this.__text_cache__ === e && (t.push(
|
|
3326
|
+
this.__index__ >= 0 && this.__text_cache__ === e && (t.push(o0(this, n)), n = this.__last_index__);
|
|
3327
3327
|
let r = n ? e.slice(n) : e;
|
|
3328
3328
|
for (; this.test(r); )
|
|
3329
|
-
t.push(
|
|
3329
|
+
t.push(o0(this, n)), r = r.slice(this.__last_index__), n += this.__last_index__;
|
|
3330
3330
|
return t.length ? t : null;
|
|
3331
3331
|
};
|
|
3332
3332
|
X.prototype.matchAtStart = function(e) {
|
|
@@ -3334,23 +3334,23 @@ X.prototype.matchAtStart = function(e) {
|
|
|
3334
3334
|
const t = this.re.schema_at_start.exec(e);
|
|
3335
3335
|
if (!t) return null;
|
|
3336
3336
|
const n = this.testSchemaAt(e, t[2], t[0].length);
|
|
3337
|
-
return n ? (this.__schema__ = t[2], this.__index__ = t.index + t[1].length, this.__last_index__ = t.index + t[0].length + n,
|
|
3337
|
+
return n ? (this.__schema__ = t[2], this.__index__ = t.index + t[1].length, this.__last_index__ = t.index + t[0].length + n, o0(this, 0)) : null;
|
|
3338
3338
|
};
|
|
3339
3339
|
X.prototype.tlds = function(e, t) {
|
|
3340
3340
|
return e = Array.isArray(e) ? e : [e], t ? (this.__tlds__ = this.__tlds__.concat(e).sort().filter(function(n, r, o) {
|
|
3341
3341
|
return n !== o[r - 1];
|
|
3342
|
-
}).reverse(),
|
|
3342
|
+
}).reverse(), ye(this), this) : (this.__tlds__ = e.slice(), this.__tlds_replaced__ = !0, ye(this), this);
|
|
3343
3343
|
};
|
|
3344
3344
|
X.prototype.normalize = function(e) {
|
|
3345
3345
|
e.schema || (e.url = "http://" + e.url), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = "mailto:" + e.url);
|
|
3346
3346
|
};
|
|
3347
3347
|
X.prototype.onCompile = function() {
|
|
3348
3348
|
};
|
|
3349
|
-
const
|
|
3349
|
+
const Ou = 2147483647, ou = 36, m0 = 1, ee = 26, Zc = 38, Vc = 700, Wt = 72, Zt = 128, Vt = "-", Yc = /^xn--/, Xc = /[^\0-\x7F]/, Jc = /[\x2E\u3002\uFF0E\uFF61]/g, Qc = {
|
|
3350
3350
|
overflow: "Overflow: input needs wider integers to process",
|
|
3351
3351
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
3352
3352
|
"invalid-input": "Invalid input"
|
|
3353
|
-
},
|
|
3353
|
+
}, Qe = ou - m0, cu = Math.floor, Ke = String.fromCharCode;
|
|
3354
3354
|
function pu(u) {
|
|
3355
3355
|
throw new RangeError(Qc[u]);
|
|
3356
3356
|
}
|
|
@@ -3388,9 +3388,9 @@ const ui = (u) => String.fromCodePoint(...u), ei = function(u) {
|
|
|
3388
3388
|
return u + 22 + 75 * (u < 26) - ((e != 0) << 5);
|
|
3389
3389
|
}, Jt = function(u, e, t) {
|
|
3390
3390
|
let n = 0;
|
|
3391
|
-
for (u = t ? cu(u / Vc) : u >> 1, u += cu(u / e); u >
|
|
3392
|
-
u = cu(u /
|
|
3393
|
-
return cu(n + (
|
|
3391
|
+
for (u = t ? cu(u / Vc) : u >> 1, u += cu(u / e); u > Qe * ee >> 1; n += ou)
|
|
3392
|
+
u = cu(u / Qe);
|
|
3393
|
+
return cu(n + (Qe + 1) * u / (u + Zc));
|
|
3394
3394
|
}, Qt = function(u) {
|
|
3395
3395
|
const e = [], t = u.length;
|
|
3396
3396
|
let n = 0, r = Zt, o = Wt, i = u.lastIndexOf(Vt);
|
|
@@ -3399,18 +3399,18 @@ const ui = (u) => String.fromCodePoint(...u), ei = function(u) {
|
|
|
3399
3399
|
u.charCodeAt(c) >= 128 && pu("not-basic"), e.push(u.charCodeAt(c));
|
|
3400
3400
|
for (let c = i > 0 ? i + 1 : 0; c < t; ) {
|
|
3401
3401
|
const a = n;
|
|
3402
|
-
for (let
|
|
3402
|
+
for (let d = 1, f = ou; ; f += ou) {
|
|
3403
3403
|
c >= t && pu("invalid-input");
|
|
3404
3404
|
const _ = ei(u.charCodeAt(c++));
|
|
3405
|
-
_ >= ou && pu("invalid-input"), _ > cu((
|
|
3406
|
-
const p =
|
|
3405
|
+
_ >= ou && pu("invalid-input"), _ > cu((Ou - n) / d) && pu("overflow"), n += _ * d;
|
|
3406
|
+
const p = f <= o ? m0 : f >= o + ee ? ee : f - o;
|
|
3407
3407
|
if (_ < p)
|
|
3408
3408
|
break;
|
|
3409
3409
|
const h = ou - p;
|
|
3410
|
-
|
|
3410
|
+
d > cu(Ou / h) && pu("overflow"), d *= h;
|
|
3411
3411
|
}
|
|
3412
3412
|
const s = e.length + 1;
|
|
3413
|
-
o = Jt(n - a, s, a == 0), cu(n / s) >
|
|
3413
|
+
o = Jt(n - a, s, a == 0), cu(n / s) > Ou - r && pu("overflow"), r += cu(n / s), n %= s, e.splice(n++, 0, r);
|
|
3414
3414
|
}
|
|
3415
3415
|
return String.fromCodePoint(...e);
|
|
3416
3416
|
}, Kt = function(u) {
|
|
@@ -3419,28 +3419,28 @@ const ui = (u) => String.fromCodePoint(...u), ei = function(u) {
|
|
|
3419
3419
|
const t = u.length;
|
|
3420
3420
|
let n = Zt, r = 0, o = Wt;
|
|
3421
3421
|
for (const a of u)
|
|
3422
|
-
a < 128 && e.push(
|
|
3422
|
+
a < 128 && e.push(Ke(a));
|
|
3423
3423
|
const i = e.length;
|
|
3424
3424
|
let c = i;
|
|
3425
3425
|
for (i && e.push(Vt); c < t; ) {
|
|
3426
|
-
let a =
|
|
3427
|
-
for (const
|
|
3428
|
-
|
|
3426
|
+
let a = Ou;
|
|
3427
|
+
for (const d of u)
|
|
3428
|
+
d >= n && d < a && (a = d);
|
|
3429
3429
|
const s = c + 1;
|
|
3430
|
-
a - n > cu((
|
|
3431
|
-
for (const
|
|
3432
|
-
if (
|
|
3433
|
-
let
|
|
3430
|
+
a - n > cu((Ou - r) / s) && pu("overflow"), r += (a - n) * s, n = a;
|
|
3431
|
+
for (const d of u)
|
|
3432
|
+
if (d < n && ++r > Ou && pu("overflow"), d === n) {
|
|
3433
|
+
let f = r;
|
|
3434
3434
|
for (let _ = ou; ; _ += ou) {
|
|
3435
3435
|
const p = _ <= o ? m0 : _ >= o + ee ? ee : _ - o;
|
|
3436
|
-
if (
|
|
3436
|
+
if (f < p)
|
|
3437
3437
|
break;
|
|
3438
|
-
const h =
|
|
3438
|
+
const h = f - p, C = ou - p;
|
|
3439
3439
|
e.push(
|
|
3440
|
-
|
|
3441
|
-
),
|
|
3440
|
+
Ke(Et(p + h % C, 0))
|
|
3441
|
+
), f = cu(h / C);
|
|
3442
3442
|
}
|
|
3443
|
-
e.push(
|
|
3443
|
+
e.push(Ke(Et(f, 0))), o = Jt(r, s, c === i), r = 0, ++c;
|
|
3444
3444
|
}
|
|
3445
3445
|
++r, ++n;
|
|
3446
3446
|
}
|
|
@@ -3668,15 +3668,15 @@ function di(u) {
|
|
|
3668
3668
|
}
|
|
3669
3669
|
return Nu(l0(e), Nu.defaultChars + "%");
|
|
3670
3670
|
}
|
|
3671
|
-
function
|
|
3672
|
-
if (!(this instanceof
|
|
3673
|
-
return new
|
|
3674
|
-
e || h0(u) || (e = u || {}, u = "default"), this.inline = new ie(), this.block = new
|
|
3671
|
+
function K(u, e) {
|
|
3672
|
+
if (!(this instanceof K))
|
|
3673
|
+
return new K(u, e);
|
|
3674
|
+
e || h0(u) || (e = u || {}, u = "default"), this.inline = new ie(), this.block = new Se(), this.core = new b0(), this.renderer = new Pu(), this.linkify = new X(), this.validateLink = li, this.normalizeLink = fi, this.normalizeLinkText = di, this.utils = po, this.helpers = Fe({}, xo), this.options = {}, this.configure(u), e && this.set(e);
|
|
3675
3675
|
}
|
|
3676
|
-
|
|
3677
|
-
return
|
|
3676
|
+
K.prototype.set = function(u) {
|
|
3677
|
+
return Fe(this.options, u), this;
|
|
3678
3678
|
};
|
|
3679
|
-
|
|
3679
|
+
K.prototype.configure = function(u) {
|
|
3680
3680
|
const e = this;
|
|
3681
3681
|
if (h0(u)) {
|
|
3682
3682
|
const t = u;
|
|
@@ -3689,7 +3689,7 @@ Q.prototype.configure = function(u) {
|
|
|
3689
3689
|
u.components[t].rules && e[t].ruler.enableOnly(u.components[t].rules), u.components[t].rules2 && e[t].ruler2.enableOnly(u.components[t].rules2);
|
|
3690
3690
|
}), this;
|
|
3691
3691
|
};
|
|
3692
|
-
|
|
3692
|
+
K.prototype.enable = function(u, e) {
|
|
3693
3693
|
let t = [];
|
|
3694
3694
|
Array.isArray(u) || (u = [u]), ["core", "block", "inline"].forEach(function(r) {
|
|
3695
3695
|
t = t.concat(this[r].ruler.enable(u, !0));
|
|
@@ -3701,7 +3701,7 @@ Q.prototype.enable = function(u, e) {
|
|
|
3701
3701
|
throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + n);
|
|
3702
3702
|
return this;
|
|
3703
3703
|
};
|
|
3704
|
-
|
|
3704
|
+
K.prototype.disable = function(u, e) {
|
|
3705
3705
|
let t = [];
|
|
3706
3706
|
Array.isArray(u) || (u = [u]), ["core", "block", "inline"].forEach(function(r) {
|
|
3707
3707
|
t = t.concat(this[r].ruler.disable(u, !0));
|
|
@@ -3713,35 +3713,35 @@ Q.prototype.disable = function(u, e) {
|
|
|
3713
3713
|
throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + n);
|
|
3714
3714
|
return this;
|
|
3715
3715
|
};
|
|
3716
|
-
|
|
3716
|
+
K.prototype.use = function(u) {
|
|
3717
3717
|
const e = [this].concat(Array.prototype.slice.call(arguments, 1));
|
|
3718
3718
|
return u.apply(u, e), this;
|
|
3719
3719
|
};
|
|
3720
|
-
|
|
3720
|
+
K.prototype.parse = function(u, e) {
|
|
3721
3721
|
if (typeof u != "string")
|
|
3722
3722
|
throw new Error("Input data should be a String");
|
|
3723
3723
|
const t = new this.core.State(u, this, e);
|
|
3724
3724
|
return this.core.process(t), t.tokens;
|
|
3725
3725
|
};
|
|
3726
|
-
|
|
3726
|
+
K.prototype.render = function(u, e) {
|
|
3727
3727
|
return e = e || {}, this.renderer.render(this.parse(u, e), this.options, e);
|
|
3728
3728
|
};
|
|
3729
|
-
|
|
3729
|
+
K.prototype.parseInline = function(u, e) {
|
|
3730
3730
|
const t = new this.core.State(u, this, e);
|
|
3731
3731
|
return t.inlineMode = !0, this.core.process(t), t.tokens;
|
|
3732
3732
|
};
|
|
3733
|
-
|
|
3733
|
+
K.prototype.renderInline = function(u, e) {
|
|
3734
3734
|
return e = e || {}, this.renderer.render(this.parseInline(u, e), this.options, e);
|
|
3735
3735
|
};
|
|
3736
|
-
class
|
|
3736
|
+
class vi extends a0 {
|
|
3737
3737
|
constructor(t = {}) {
|
|
3738
3738
|
super();
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
this.mdConfig = t.mdConfig || {}, this.dompurifyConfig = t.dompurifyConfig || {}, this.sanitizeDisabled = t.sanitizeDisabled ?? !1, this.defaultAttrs = t.defaultAttrs || {}, this.md =
|
|
3739
|
+
Mu(this, "mdConfig");
|
|
3740
|
+
Mu(this, "dompurifyConfig");
|
|
3741
|
+
Mu(this, "sanitizeDisabled");
|
|
3742
|
+
Mu(this, "defaultAttrs");
|
|
3743
|
+
Mu(this, "md");
|
|
3744
|
+
this.mdConfig = t.mdConfig || {}, this.dompurifyConfig = t.dompurifyConfig || {}, this.sanitizeDisabled = t.sanitizeDisabled ?? !1, this.defaultAttrs = t.defaultAttrs || {}, this.md = K(this.mdConfig);
|
|
3745
3745
|
}
|
|
3746
3746
|
render(t) {
|
|
3747
3747
|
const { content: n, ...r } = t;
|
|
@@ -3759,20 +3759,20 @@ class Ri extends a0 {
|
|
|
3759
3759
|
}
|
|
3760
3760
|
const hi = {
|
|
3761
3761
|
key: 0,
|
|
3762
|
-
class: "tr-bubble__avatar"
|
|
3763
|
-
}, pi = {
|
|
3762
|
+
class: /* @__PURE__ */ Eu(["tr-bubble__avatar"])
|
|
3763
|
+
}, pi = {
|
|
3764
3764
|
key: 0,
|
|
3765
3765
|
class: "tr-bubble__content-items"
|
|
3766
|
-
},
|
|
3766
|
+
}, bi = {
|
|
3767
3767
|
key: 1,
|
|
3768
3768
|
class: "tr-bubble__body-text"
|
|
3769
|
-
},
|
|
3769
|
+
}, _i = {
|
|
3770
3770
|
key: 2,
|
|
3771
3771
|
class: "tr-bubble__aborted"
|
|
3772
|
-
},
|
|
3772
|
+
}, mi = {
|
|
3773
3773
|
key: 3,
|
|
3774
3774
|
class: "tr-bubble__footer"
|
|
3775
|
-
},
|
|
3775
|
+
}, xi = /* @__PURE__ */ Du({
|
|
3776
3776
|
__name: "Bubble",
|
|
3777
3777
|
props: {
|
|
3778
3778
|
content: { default: "" },
|
|
@@ -3785,71 +3785,72 @@ const hi = {
|
|
|
3785
3785
|
shape: { default: "corner" },
|
|
3786
3786
|
contentRenderer: {},
|
|
3787
3787
|
customContentField: {},
|
|
3788
|
-
|
|
3788
|
+
abortedText: { default: "(用户停止)" },
|
|
3789
|
+
maxWidth: {}
|
|
3789
3790
|
},
|
|
3790
3791
|
setup(u) {
|
|
3791
|
-
const e = u, t = gn(), n =
|
|
3792
|
+
const e = u, t = gn(), n = J(() => {
|
|
3792
3793
|
const f = e.contentRenderer;
|
|
3793
3794
|
return f ? typeof f == "function" ? { isComponent: !1, vNodeOrComponent: f(e) } : f instanceof a0 ? { isComponent: !1, vNodeOrComponent: f.render(e) } : { isComponent: !0, vNodeOrComponent: f } : null;
|
|
3794
|
-
}), r = kn(), o =
|
|
3795
|
+
}), r = kn(), o = J(() => {
|
|
3795
3796
|
if (!e.customContentField)
|
|
3796
3797
|
return null;
|
|
3797
3798
|
const f = r[e.customContentField];
|
|
3798
3799
|
return typeof f == "string" || Array.isArray(f) && f.length > 0 ? f : null;
|
|
3799
|
-
}), i =
|
|
3800
|
-
|
|
3801
|
-
|
|
3800
|
+
}), i = J(() => o.value || e.content), c = J(() => Array.isArray(i.value) ? "" : i.value), a = J(() => Array.isArray(i.value) ? i.value : []), s = J(() => e.placement === "start"), d = J(() => e.maxWidth ? {
|
|
3801
|
+
"--max-width": yn(e.maxWidth)
|
|
3802
|
+
} : {});
|
|
3803
|
+
return (f, _) => (S(), $("div", {
|
|
3804
|
+
class: Eu([
|
|
3802
3805
|
"tr-bubble",
|
|
3803
3806
|
{
|
|
3804
3807
|
"placement-start": s.value,
|
|
3805
3808
|
"placement-end": !s.value
|
|
3806
3809
|
}
|
|
3807
3810
|
]),
|
|
3808
|
-
style: En(
|
|
3811
|
+
style: En(d.value)
|
|
3809
3812
|
}, [
|
|
3810
3813
|
e.avatar ? (S(), $("div", hi, [
|
|
3811
3814
|
(S(), eu(mu(e.avatar)))
|
|
3812
3815
|
])) : Xu("", !0),
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
+
e.loading ? ge(f.$slots, "loading", {
|
|
3817
|
+
key: 1,
|
|
3818
|
+
bubbleProps: e
|
|
3819
|
+
}, () => [
|
|
3820
|
+
Y("div", {
|
|
3821
|
+
class: Eu(["tr-bubble__content", { "border-corner": e.shape === "corner" }])
|
|
3822
|
+
}, [..._[0] || (_[0] = [
|
|
3823
|
+
Y("img", {
|
|
3824
|
+
src: Dn,
|
|
3825
|
+
alt: "loading",
|
|
3826
|
+
class: "tr-bubble__loading"
|
|
3827
|
+
}, null, -1)
|
|
3828
|
+
])], 2)
|
|
3829
|
+
], !0) : (S(), $("div", {
|
|
3830
|
+
key: 2,
|
|
3831
|
+
class: Eu(["tr-bubble__content", { "border-corner": e.shape === "corner" }])
|
|
3832
|
+
}, [
|
|
3833
|
+
a.value.length ? (S(), $("div", pi, [
|
|
3834
|
+
(S(!0), $(u0, null, ke(a.value, (p, h) => (S(), eu(i0(rr), {
|
|
3835
|
+
key: h,
|
|
3836
|
+
item: p
|
|
3837
|
+
}, null, 8, ["item"]))), 128))
|
|
3838
|
+
])) : ge(f.$slots, "default", {
|
|
3839
|
+
key: 1,
|
|
3816
3840
|
bubbleProps: e
|
|
3817
3841
|
}, () => [
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
], !0) : (S(), $("div", {
|
|
3828
|
-
key: 1,
|
|
3829
|
-
class: Mu(["tr-bubble__content", { "border-corner": e.shape === "corner" }])
|
|
3830
|
-
}, [
|
|
3831
|
-
a.value.length ? (S(), $("div", bi, [
|
|
3832
|
-
(S(!0), $(e0, null, ke(a.value, (_, p) => (S(), eu(Ae(rr), {
|
|
3833
|
-
key: p,
|
|
3834
|
-
item: _
|
|
3835
|
-
}, null, 8, ["item"]))), 128))
|
|
3836
|
-
])) : ge(f.$slots, "default", {
|
|
3837
|
-
key: 1,
|
|
3838
|
-
bubbleProps: e
|
|
3839
|
-
}, () => [
|
|
3840
|
-
n.value ? (S(), $(e0, { key: 0 }, [
|
|
3841
|
-
n.value.isComponent ? (S(), eu(mu(n.value.vNodeOrComponent), Ce(Ju({ key: 0 }, e)), null, 16)) : (S(), eu(mu(n.value.vNodeOrComponent), { key: 1 }))
|
|
3842
|
-
], 64)) : (S(), $("span", _i, Ou(c.value), 1))
|
|
3843
|
-
], !0),
|
|
3844
|
-
e.aborted ? (S(), $("span", mi, "(用户停止)")) : Xu("", !0),
|
|
3845
|
-
t.footer ? (S(), $("div", xi, [
|
|
3846
|
-
ge(f.$slots, "footer", { bubbleProps: e }, void 0, !0)
|
|
3847
|
-
])) : Xu("", !0)
|
|
3848
|
-
], 2))
|
|
3849
|
-
])
|
|
3842
|
+
n.value ? (S(), $(u0, { key: 0 }, [
|
|
3843
|
+
n.value.isComponent ? (S(), eu(mu(n.value.vNodeOrComponent), Ae(Ju({ key: 0 }, e)), null, 16)) : (S(), eu(mu(n.value.vNodeOrComponent), { key: 1 }))
|
|
3844
|
+
], 64)) : (S(), $("span", bi, Au(c.value), 1))
|
|
3845
|
+
], !0),
|
|
3846
|
+
e.aborted ? (S(), $("span", _i, Au(e.abortedText), 1)) : Xu("", !0),
|
|
3847
|
+
t.footer ? (S(), $("div", mi, [
|
|
3848
|
+
ge(f.$slots, "footer", { bubbleProps: e }, void 0, !0)
|
|
3849
|
+
])) : Xu("", !0)
|
|
3850
|
+
], 2))
|
|
3850
3851
|
], 6));
|
|
3851
3852
|
}
|
|
3852
|
-
}),
|
|
3853
|
+
}), Cu = /* @__PURE__ */ re(xi, [["__scopeId", "data-v-1d4a4139"]]), gi = /* @__PURE__ */ Du({
|
|
3853
3854
|
__name: "BubbleList",
|
|
3854
3855
|
props: {
|
|
3855
3856
|
items: {},
|
|
@@ -3859,10 +3860,10 @@ const hi = {
|
|
|
3859
3860
|
autoScroll: { type: Boolean }
|
|
3860
3861
|
},
|
|
3861
3862
|
setup(u) {
|
|
3862
|
-
const e = u, t =
|
|
3863
|
+
const e = u, t = c0(null), { y: n } = Rn(t, {
|
|
3863
3864
|
behavior: "smooth",
|
|
3864
3865
|
throttle: 100
|
|
3865
|
-
}), r =
|
|
3866
|
+
}), r = J(() => e.items.at(-1));
|
|
3866
3867
|
An(
|
|
3867
3868
|
[() => e.items.length, () => {
|
|
3868
3869
|
var c;
|
|
@@ -3873,18 +3874,18 @@ const hi = {
|
|
|
3873
3874
|
},
|
|
3874
3875
|
{ deep: !0 }
|
|
3875
3876
|
);
|
|
3876
|
-
const o =
|
|
3877
|
+
const o = J(() => e.items.map((c) => {
|
|
3877
3878
|
var h;
|
|
3878
3879
|
const a = c.role ? ((h = e.roles) == null ? void 0 : h[c.role]) || {} : {};
|
|
3879
3880
|
if (a.hidden)
|
|
3880
3881
|
return null;
|
|
3881
|
-
const { slots: s, hidden:
|
|
3882
|
+
const { slots: s, hidden: d, ...f } = a, { slots: _, ...p } = c;
|
|
3882
3883
|
return {
|
|
3883
3884
|
id: c.id,
|
|
3884
|
-
props: { ...
|
|
3885
|
+
props: { ...f, ...p, "data-role": c.role },
|
|
3885
3886
|
slots: { ...s, ..._ }
|
|
3886
3887
|
};
|
|
3887
|
-
}).filter((c) => !!c)), i =
|
|
3888
|
+
}).filter((c) => !!c)), i = J(() => {
|
|
3888
3889
|
var s;
|
|
3889
3890
|
if (!(e.loading && e.loadingRole && ((s = e.roles) != null && s[e.loadingRole])))
|
|
3890
3891
|
return null;
|
|
@@ -3896,27 +3897,27 @@ const hi = {
|
|
|
3896
3897
|
ref_key: "scrollContainerRef",
|
|
3897
3898
|
ref: t
|
|
3898
3899
|
}, [
|
|
3899
|
-
(S(!0), $(
|
|
3900
|
-
key: s.id ||
|
|
3900
|
+
(S(!0), $(u0, null, ke(o.value, (s, d) => (S(), eu(Cu, Ju({
|
|
3901
|
+
key: s.id || d
|
|
3901
3902
|
}, { ref_for: !0 }, s.props), G0({ _: 2 }, [
|
|
3902
|
-
ke(s.slots, (
|
|
3903
|
+
ke(s.slots, (f, _) => ({
|
|
3903
3904
|
name: _,
|
|
3904
3905
|
fn: W0((p) => [
|
|
3905
|
-
(S(), eu(mu(
|
|
3906
|
+
(S(), eu(mu(f), Ju({ ref_for: !0 }, p), null, 16))
|
|
3906
3907
|
])
|
|
3907
3908
|
}))
|
|
3908
3909
|
]), 1040))), 128)),
|
|
3909
|
-
i.value ? (S(), eu(
|
|
3910
|
-
ke(i.value.slots, (s,
|
|
3911
|
-
name:
|
|
3912
|
-
fn: W0((
|
|
3913
|
-
(S(), eu(mu(s),
|
|
3910
|
+
i.value ? (S(), eu(Cu, Ae(Ju({ key: 0 }, i.value.props)), G0({ _: 2 }, [
|
|
3911
|
+
ke(i.value.slots, (s, d) => ({
|
|
3912
|
+
name: d,
|
|
3913
|
+
fn: W0((f) => [
|
|
3914
|
+
(S(), eu(mu(s), Ae(Cn(f)), null, 16))
|
|
3914
3915
|
])
|
|
3915
3916
|
}))
|
|
3916
3917
|
]), 1040)) : Xu("", !0)
|
|
3917
3918
|
], 512));
|
|
3918
3919
|
}
|
|
3919
|
-
}), te = /* @__PURE__ */ re(
|
|
3920
|
+
}), te = /* @__PURE__ */ re(gi, [["__scopeId", "data-v-4f1ab0c2"]]), ne = /* @__PURE__ */ Du({
|
|
3920
3921
|
__name: "BubbleProvider",
|
|
3921
3922
|
props: {
|
|
3922
3923
|
contentRenderers: { default: () => ({}) }
|
|
@@ -3930,28 +3931,28 @@ const hi = {
|
|
|
3930
3931
|
return Z0(Dt, t), Z0(yt, s0), (n, r) => ge(n.$slots, "default");
|
|
3931
3932
|
}
|
|
3932
3933
|
});
|
|
3933
|
-
|
|
3934
|
-
const
|
|
3935
|
-
u.component(
|
|
3934
|
+
Cu.name = "TrBubble";
|
|
3935
|
+
const ki = function(u) {
|
|
3936
|
+
u.component(Cu.name, Cu);
|
|
3936
3937
|
};
|
|
3937
|
-
|
|
3938
|
-
const
|
|
3938
|
+
Cu.install = ki;
|
|
3939
|
+
const Ri = Cu;
|
|
3939
3940
|
te.name = "TrBubbleList";
|
|
3940
|
-
const
|
|
3941
|
+
const Ei = function(u) {
|
|
3941
3942
|
u.component(te.name, te);
|
|
3942
3943
|
};
|
|
3943
|
-
te.install =
|
|
3944
|
-
const
|
|
3944
|
+
te.install = Ei;
|
|
3945
|
+
const Ii = te;
|
|
3945
3946
|
ne.name = "TrBubbleProvider";
|
|
3946
|
-
const
|
|
3947
|
+
const Ai = function(u) {
|
|
3947
3948
|
u.component(ne.name, ne);
|
|
3948
3949
|
};
|
|
3949
|
-
ne.install =
|
|
3950
|
-
const
|
|
3950
|
+
ne.install = Ai;
|
|
3951
|
+
const Mi = ne;
|
|
3951
3952
|
export {
|
|
3952
|
-
|
|
3953
|
+
Ri as Bubble,
|
|
3953
3954
|
a0 as BubbleContentClassRenderer,
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3955
|
+
Ii as BubbleList,
|
|
3956
|
+
vi as BubbleMarkdownContentRenderer,
|
|
3957
|
+
Mi as BubbleProvider
|
|
3957
3958
|
};
|