super-agent-sdk 1.0.21 → 1.0.23
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/README.md +14 -10
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +24 -2
- package/dist/index.mjs +306 -285
- package/dist/{mammoth.browser-BWTaSUmQ.cjs → mammoth.browser-CKp13R4W.cjs} +63 -63
- package/dist/{mammoth.browser-DFPCY35d.js → mammoth.browser-_e1UoKEX.js} +3708 -3725
- package/dist/{nosUploader-DjJ7u2B1.js → nosUploader-2VXYPLap.js} +2 -1
- package/dist/{nosUploader-DLX7JsnR.cjs → nosUploader-Dk2GyRpT.cjs} +4 -4
- package/dist/{purify.es-CImoWRjX.js → purify.es-C-6FFqDW.js} +205 -214
- package/dist/purify.es-Dsdnkgrg.cjs +3 -0
- package/dist/widget.cjs +323 -29
- package/dist/widget.d.ts +56 -11
- package/dist/widget.mjs +27999 -5544
- package/package.json +3 -1
- package/dist/purify.es-BnmCBz16.cjs +0 -3
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.4.
|
|
2
|
-
function
|
|
1
|
+
/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */
|
|
2
|
+
function We(r, i) {
|
|
3
3
|
(i == null || i > r.length) && (i = r.length);
|
|
4
4
|
for (var s = 0, c = Array(i); s < i; s++) c[s] = r[s];
|
|
5
5
|
return c;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function Fn(r) {
|
|
8
8
|
if (Array.isArray(r)) return r;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function zn(r, i) {
|
|
11
11
|
var s = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
|
|
12
12
|
if (s != null) {
|
|
13
|
-
var c, f, d, y, st = [],
|
|
13
|
+
var c, f, d, y, st = [], N = !0, lt = !1;
|
|
14
14
|
try {
|
|
15
|
-
if (d = (s = s.call(r)).next, i !== 0) for (; !(
|
|
15
|
+
if (d = (s = s.call(r)).next, i !== 0) for (; !(N = (c = d.call(s)).done) && (st.push(c.value), st.length !== i); N = !0) ;
|
|
16
16
|
} catch (xt) {
|
|
17
17
|
lt = !0, f = xt;
|
|
18
18
|
} finally {
|
|
19
19
|
try {
|
|
20
|
-
if (!
|
|
20
|
+
if (!N && s.return != null && (y = s.return(), Object(y) !== y)) return;
|
|
21
21
|
} finally {
|
|
22
22
|
if (lt) throw f;
|
|
23
23
|
}
|
|
@@ -25,22 +25,22 @@ function Wn(r, i) {
|
|
|
25
25
|
return st;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Hn() {
|
|
29
29
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
30
30
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function Gn(r, i) {
|
|
33
|
+
return Fn(r) || zn(r, i) || Wn(r, i) || Hn();
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Wn(r, i) {
|
|
36
36
|
if (r) {
|
|
37
|
-
if (typeof r == "string") return
|
|
37
|
+
if (typeof r == "string") return We(r, i);
|
|
38
38
|
var s = {}.toString.call(r).slice(8, -1);
|
|
39
|
-
return s === "Object" && r.constructor && (s = r.constructor.name), s === "Map" || s === "Set" ? Array.from(r) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ?
|
|
39
|
+
return s === "Object" && r.constructor && (s = r.constructor.name), s === "Map" || s === "Set" ? Array.from(r) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? We(r, i) : void 0;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
let S = Object.freeze, b = Object.seal, it = Object.create,
|
|
42
|
+
const on = Object.entries, Be = Object.setPrototypeOf, Bn = Object.isFrozen, Yn = Object.getPrototypeOf, jn = Object.getOwnPropertyDescriptor;
|
|
43
|
+
let S = Object.freeze, b = Object.seal, it = Object.create, rn = typeof Reflect < "u" && Reflect, se = rn.apply, le = rn.construct;
|
|
44
44
|
S || (S = function(i) {
|
|
45
45
|
return i;
|
|
46
46
|
});
|
|
@@ -57,7 +57,7 @@ le || (le = function(i) {
|
|
|
57
57
|
c[f - 1] = arguments[f];
|
|
58
58
|
return new i(...c);
|
|
59
59
|
});
|
|
60
|
-
const V = A(Array.prototype.forEach),
|
|
60
|
+
const V = A(Array.prototype.forEach), $n = A(Array.prototype.lastIndexOf), Ye = A(Array.prototype.pop), dt = A(Array.prototype.push), Xn = A(Array.prototype.splice), at = Array.isArray, _t = A(String.prototype.toLowerCase), ee = A(String.prototype.toString), je = A(String.prototype.match), Tt = A(String.prototype.replace), $e = A(String.prototype.indexOf), Vn = A(String.prototype.trim), qn = A(Number.prototype.toString), Kn = A(Boolean.prototype.toString), Xe = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), Ve = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), I = A(Object.prototype.hasOwnProperty), ht = A(Object.prototype.toString), O = A(RegExp.prototype.test), X = Zn(TypeError);
|
|
61
61
|
function A(r) {
|
|
62
62
|
return function(i) {
|
|
63
63
|
i instanceof RegExp && (i.lastIndex = 0);
|
|
@@ -66,7 +66,7 @@ function A(r) {
|
|
|
66
66
|
return se(r, i, c);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Zn(r) {
|
|
70
70
|
return function() {
|
|
71
71
|
for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)
|
|
72
72
|
s[c] = arguments[c];
|
|
@@ -75,45 +75,45 @@ function Qn(r) {
|
|
|
75
75
|
}
|
|
76
76
|
function p(r, i) {
|
|
77
77
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
|
|
78
|
-
if (
|
|
78
|
+
if (Be && Be(r, null), !at(i))
|
|
79
79
|
return r;
|
|
80
80
|
let c = i.length;
|
|
81
81
|
for (; c--; ) {
|
|
82
82
|
let f = i[c];
|
|
83
83
|
if (typeof f == "string") {
|
|
84
84
|
const d = s(f);
|
|
85
|
-
d !== f && (
|
|
85
|
+
d !== f && (Bn(i) || (i[c] = d), f = d);
|
|
86
86
|
}
|
|
87
87
|
r[f] = !0;
|
|
88
88
|
}
|
|
89
89
|
return r;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Jn(r) {
|
|
92
92
|
for (let i = 0; i < r.length; i++)
|
|
93
|
-
|
|
93
|
+
I(r, i) || (r[i] = null);
|
|
94
94
|
return r;
|
|
95
95
|
}
|
|
96
96
|
function C(r) {
|
|
97
97
|
const i = it(null);
|
|
98
|
-
for (const c of
|
|
99
|
-
var s =
|
|
98
|
+
for (const c of on(r)) {
|
|
99
|
+
var s = Gn(c, 2);
|
|
100
100
|
const f = s[0], d = s[1];
|
|
101
|
-
|
|
101
|
+
I(r, f) && (at(d) ? i[f] = Jn(d) : d && typeof d == "object" && d.constructor === Object ? i[f] = C(d) : i[f] = d);
|
|
102
102
|
}
|
|
103
103
|
return i;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Qn(r) {
|
|
106
106
|
switch (typeof r) {
|
|
107
107
|
case "string":
|
|
108
108
|
return r;
|
|
109
109
|
case "number":
|
|
110
|
-
return
|
|
110
|
+
return qn(r);
|
|
111
111
|
case "boolean":
|
|
112
|
-
return
|
|
112
|
+
return Kn(r);
|
|
113
113
|
case "bigint":
|
|
114
|
-
return
|
|
114
|
+
return Xe ? Xe(r) : "0";
|
|
115
115
|
case "symbol":
|
|
116
|
-
return
|
|
116
|
+
return Ve ? Ve(r) : "Symbol()";
|
|
117
117
|
case "undefined":
|
|
118
118
|
return ht(r);
|
|
119
119
|
case "function":
|
|
@@ -133,34 +133,34 @@ function eo(r) {
|
|
|
133
133
|
}
|
|
134
134
|
function P(r, i) {
|
|
135
135
|
for (; r !== null; ) {
|
|
136
|
-
const c =
|
|
136
|
+
const c = jn(r, i);
|
|
137
137
|
if (c) {
|
|
138
138
|
if (c.get)
|
|
139
139
|
return A(c.get);
|
|
140
140
|
if (typeof c.value == "function")
|
|
141
141
|
return A(c.value);
|
|
142
142
|
}
|
|
143
|
-
r =
|
|
143
|
+
r = Yn(r);
|
|
144
144
|
}
|
|
145
145
|
function s() {
|
|
146
146
|
return null;
|
|
147
147
|
}
|
|
148
148
|
return s;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function to(r) {
|
|
151
151
|
try {
|
|
152
152
|
return O(r, ""), !0;
|
|
153
153
|
} catch {
|
|
154
154
|
return !1;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
const
|
|
157
|
+
const qe = S(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), ne = S(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), oe = S(["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"]), eo = S(["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"]), re = S(["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"]), no = S(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ke = S(["#text"]), Ze = S(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), ie = S(["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", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "pointer-events", "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-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "vector-effect", "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"]), Je = S(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "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"]), Pt = S(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), oo = b(/{{[\w\W]*|^[\w\W]*}}/g), ro = b(/<%[\w\W]*|^[\w\W]*%>/g), io = b(/\${[\w\W]*/g), ao = b(/^data-[\-\w.\u00B7-\uFFFF]+$/), so = b(/^aria-[\-\w]+$/), Qe = b(
|
|
158
158
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
159
159
|
// eslint-disable-line no-useless-escape
|
|
160
|
-
),
|
|
160
|
+
), lo = b(/^(?:\w+script|data):/i), co = b(
|
|
161
161
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
162
162
|
// eslint-disable-line no-control-regex
|
|
163
|
-
),
|
|
163
|
+
), uo = b(/^html$/i), fo = b(/^[a-z][.\w]*(-[.\w]+)+$/i), tn = b(/<[/\w!]/g), en = b(/<[/\w]/g), po = b(/<\/no(script|embed|frames)/i), mo = b(/\/>/i), M = {
|
|
164
164
|
element: 1,
|
|
165
165
|
attribute: 2,
|
|
166
166
|
text: 3,
|
|
@@ -176,14 +176,14 @@ const Ze = S(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
176
176
|
documentFragment: 11,
|
|
177
177
|
notation: 12
|
|
178
178
|
// Deprecated
|
|
179
|
-
},
|
|
179
|
+
}, an = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"], To = S(p({}, an)), ho = function() {
|
|
180
180
|
const r = {};
|
|
181
|
-
return V(
|
|
181
|
+
return V(an, (i) => {
|
|
182
182
|
r[i] = b(new RegExp("</" + i + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
183
183
|
}), S(r);
|
|
184
|
-
}(),
|
|
184
|
+
}(), _o = function() {
|
|
185
185
|
return typeof window > "u" ? null : window;
|
|
186
|
-
},
|
|
186
|
+
}, go = function(i, s) {
|
|
187
187
|
if (typeof i != "object" || typeof i.createPolicy != "function")
|
|
188
188
|
return null;
|
|
189
189
|
let c = null;
|
|
@@ -202,7 +202,7 @@ const Ze = S(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
202
202
|
} catch {
|
|
203
203
|
return console.warn("TrustedTypes policy " + d + " could not be created."), null;
|
|
204
204
|
}
|
|
205
|
-
},
|
|
205
|
+
}, nn = function() {
|
|
206
206
|
return {
|
|
207
207
|
afterSanitizeAttributes: [],
|
|
208
208
|
afterSanitizeElements: [],
|
|
@@ -214,24 +214,24 @@ const Ze = S(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
214
214
|
uponSanitizeElement: [],
|
|
215
215
|
uponSanitizeShadowNode: []
|
|
216
216
|
};
|
|
217
|
-
},
|
|
218
|
-
return
|
|
217
|
+
}, H = function(i, s, c, f) {
|
|
218
|
+
return I(i, s) && at(i[s]) ? p(f.base ? C(f.base) : {}, i[s], f.transform) : c;
|
|
219
219
|
}, ae = function(i, s, c) {
|
|
220
|
-
const f =
|
|
220
|
+
const f = I(i, s) ? i[s] : void 0;
|
|
221
221
|
return f && typeof f == "object" ? C(f) : c();
|
|
222
222
|
};
|
|
223
|
-
function
|
|
224
|
-
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
225
|
-
const i = (o) =>
|
|
226
|
-
if (i.version = "3.4.
|
|
223
|
+
function sn() {
|
|
224
|
+
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _o();
|
|
225
|
+
const i = (o) => sn(o);
|
|
226
|
+
if (i.version = "3.4.14", i.removed = [], !r || !r.document || r.document.nodeType !== M.document || !r.Element)
|
|
227
227
|
return i.isSupported = !1, i;
|
|
228
228
|
let s = r.document;
|
|
229
229
|
const c = s, f = c.currentScript;
|
|
230
230
|
r.DocumentFragment;
|
|
231
|
-
const d = r.HTMLTemplateElement, y = r.Node, st = r.Element,
|
|
231
|
+
const d = r.HTMLTemplateElement, y = r.Node, st = r.Element, N = r.NodeFilter, lt = r.NamedNodeMap;
|
|
232
232
|
lt === void 0 && (r.NamedNodeMap || r.MozNamedAttrMap), r.HTMLFormElement;
|
|
233
|
-
const xt = r.DOMParser, gt = r.trustedTypes,
|
|
234
|
-
return
|
|
233
|
+
const xt = r.DOMParser, gt = r.trustedTypes, G = st.prototype, ln = P(G, "cloneNode"), vt = P(G, "remove"), cn = P(G, "nextSibling"), q = P(G, "childNodes"), K = P(G, "parentNode"), ce = P(G, "shadowRoot"), kt = P(G, "attributes"), W = y && y.prototype ? P(y.prototype, "nodeType") : null, Z = y && y.prototype ? P(y.prototype, "nodeName") : null, Et = y && y.prototype ? P(y.prototype, "ownerDocument") : null, ct = function(t) {
|
|
234
|
+
return W ? W(t) : t.nodeType;
|
|
235
235
|
}, Ut = function(t) {
|
|
236
236
|
return Z ? Z(t) : t.nodeName;
|
|
237
237
|
};
|
|
@@ -239,34 +239,34 @@ function cn() {
|
|
|
239
239
|
const o = s.createElement("template");
|
|
240
240
|
o.content && o.content.ownerDocument && (s = o.content.ownerDocument);
|
|
241
241
|
}
|
|
242
|
-
let L, B = "", Ft,
|
|
243
|
-
const
|
|
242
|
+
let L, B = "", Ft, ue = !1, ut = 0;
|
|
243
|
+
const fe = function() {
|
|
244
244
|
if (ut > 0)
|
|
245
245
|
throw X('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
246
246
|
}, J = function(t) {
|
|
247
|
-
|
|
247
|
+
fe(), ut++;
|
|
248
248
|
try {
|
|
249
249
|
return L.createHTML(t);
|
|
250
250
|
} finally {
|
|
251
251
|
ut--;
|
|
252
252
|
}
|
|
253
|
-
},
|
|
254
|
-
|
|
253
|
+
}, un = function(t) {
|
|
254
|
+
fe(), ut++;
|
|
255
255
|
try {
|
|
256
256
|
return L.createScriptURL(t);
|
|
257
257
|
} finally {
|
|
258
258
|
ut--;
|
|
259
259
|
}
|
|
260
|
-
},
|
|
261
|
-
return
|
|
262
|
-
}, At = s, zt = At.implementation,
|
|
263
|
-
let T =
|
|
264
|
-
i.isSupported = typeof
|
|
265
|
-
const _n = io, gn = ao, En = so, An = lo,
|
|
266
|
-
let
|
|
267
|
-
const Ht = p({}, [...
|
|
260
|
+
}, fn = function() {
|
|
261
|
+
return ue || (Ft = go(gt, f), ue = !0), Ft;
|
|
262
|
+
}, At = s, zt = At.implementation, pe = At.createNodeIterator, pn = At.createDocumentFragment, mn = At.getElementsByTagName, dn = c.importNode;
|
|
263
|
+
let T = nn();
|
|
264
|
+
i.isSupported = typeof on == "function" && typeof K == "function" && zt && zt.createHTMLDocument !== void 0;
|
|
265
|
+
const Tn = oo, hn = ro, _n = io, gn = ao, En = so, An = lo, me = co, yn = fo;
|
|
266
|
+
let de = Qe, h = null;
|
|
267
|
+
const Ht = p({}, [...qe, ...ne, ...oe, ...re, ...Ke]);
|
|
268
268
|
let _ = null;
|
|
269
|
-
const
|
|
269
|
+
const Gt = p({}, [...Ze, ...ie, ...Je, ...Pt]);
|
|
270
270
|
let x = Object.seal(it(null, {
|
|
271
271
|
tagNameCheck: {
|
|
272
272
|
writable: !0,
|
|
@@ -286,8 +286,8 @@ function cn() {
|
|
|
286
286
|
enumerable: !0,
|
|
287
287
|
value: !1
|
|
288
288
|
}
|
|
289
|
-
})), ft = null,
|
|
290
|
-
const
|
|
289
|
+
})), ft = null, Te = null;
|
|
290
|
+
const U = Object.seal(it(null, {
|
|
291
291
|
tagCheck: {
|
|
292
292
|
writable: !0,
|
|
293
293
|
configurable: !1,
|
|
@@ -301,10 +301,10 @@ function cn() {
|
|
|
301
301
|
value: null
|
|
302
302
|
}
|
|
303
303
|
}));
|
|
304
|
-
let
|
|
305
|
-
const
|
|
304
|
+
let he = !0, Wt = !0, _e = !1, ge = !0, F = !1, Y = !0, j = !1, Bt = !1, yt = null, St = null, Yt = !1, Q = !1, bt = !1, Ot = !1, Ee = !0, Ae = !1;
|
|
305
|
+
const ye = "user-content-";
|
|
306
306
|
let jt = !0, $t = !1, tt = {}, et = null;
|
|
307
|
-
const
|
|
307
|
+
const Se = p({}, [
|
|
308
308
|
"annotation-xml",
|
|
309
309
|
"audio",
|
|
310
310
|
"colgroup",
|
|
@@ -341,57 +341,57 @@ function cn() {
|
|
|
341
341
|
"video",
|
|
342
342
|
"xmp"
|
|
343
343
|
]);
|
|
344
|
-
let
|
|
345
|
-
const
|
|
346
|
-
let
|
|
347
|
-
const
|
|
344
|
+
let be = null;
|
|
345
|
+
const Oe = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
346
|
+
let Re = null;
|
|
347
|
+
const Le = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Rt = "http://www.w3.org/1998/Math/MathML", Lt = "http://www.w3.org/2000/svg", v = "http://www.w3.org/1999/xhtml";
|
|
348
348
|
let nt = v, Xt = !1, Vt = null;
|
|
349
|
-
const
|
|
350
|
-
let qt = p({},
|
|
351
|
-
const
|
|
352
|
-
let Kt = p({},
|
|
353
|
-
const
|
|
349
|
+
const Sn = p({}, [Rt, Lt, v], ee), De = S(["mi", "mo", "mn", "ms", "mtext"]);
|
|
350
|
+
let qt = p({}, De);
|
|
351
|
+
const we = S(["annotation-xml"]);
|
|
352
|
+
let Kt = p({}, we);
|
|
353
|
+
const bn = p({}, ["title", "style", "font", "a", "script"]);
|
|
354
354
|
let pt = null;
|
|
355
|
-
const
|
|
355
|
+
const On = ["application/xhtml+xml", "text/html"], Rn = "text/html";
|
|
356
356
|
let E = null, ot = null;
|
|
357
|
-
const
|
|
357
|
+
const Ln = s.createElement("form"), Ie = function(t) {
|
|
358
358
|
return t instanceof RegExp || t instanceof Function;
|
|
359
359
|
}, Zt = function() {
|
|
360
360
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
361
361
|
if (ot && ot === t)
|
|
362
362
|
return;
|
|
363
363
|
(!t || typeof t != "object") && (t = {}), t = C(t), pt = // eslint-disable-next-line unicorn/prefer-includes
|
|
364
|
-
|
|
364
|
+
On.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Rn : t.PARSER_MEDIA_TYPE, E = pt === "application/xhtml+xml" ? ee : _t, h = H(t, "ALLOWED_TAGS", Ht, {
|
|
365
365
|
transform: E
|
|
366
|
-
}), _ =
|
|
366
|
+
}), _ = H(t, "ALLOWED_ATTR", Gt, {
|
|
367
367
|
transform: E
|
|
368
|
-
}), Vt =
|
|
368
|
+
}), Vt = H(t, "ALLOWED_NAMESPACES", Sn, {
|
|
369
369
|
transform: ee
|
|
370
|
-
}),
|
|
370
|
+
}), Re = H(t, "ADD_URI_SAFE_ATTR", Le, {
|
|
371
371
|
transform: E,
|
|
372
|
-
base:
|
|
373
|
-
}),
|
|
372
|
+
base: Le
|
|
373
|
+
}), be = H(t, "ADD_DATA_URI_TAGS", Oe, {
|
|
374
374
|
transform: E,
|
|
375
|
-
base:
|
|
376
|
-
}), et =
|
|
375
|
+
base: Oe
|
|
376
|
+
}), et = H(t, "FORBID_CONTENTS", Se, {
|
|
377
377
|
transform: E
|
|
378
|
-
}), ft =
|
|
378
|
+
}), ft = H(t, "FORBID_TAGS", C({}), {
|
|
379
379
|
transform: E
|
|
380
|
-
}),
|
|
380
|
+
}), Te = H(t, "FORBID_ATTR", C({}), {
|
|
381
381
|
transform: E
|
|
382
|
-
}), tt =
|
|
382
|
+
}), tt = I(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? C(t.USE_PROFILES) : t.USE_PROFILES : !1, he = t.ALLOW_ARIA_ATTR !== !1, Wt = t.ALLOW_DATA_ATTR !== !1, _e = t.ALLOW_UNKNOWN_PROTOCOLS || !1, ge = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, F = t.SAFE_FOR_TEMPLATES || !1, Y = t.SAFE_FOR_XML !== !1, j = t.WHOLE_DOCUMENT || !1, Q = t.RETURN_DOM || !1, bt = t.RETURN_DOM_FRAGMENT || !1, Ot = t.RETURN_TRUSTED_TYPE || !1, Yt = t.FORCE_BODY || !1, Ee = t.SANITIZE_DOM !== !1, Ae = t.SANITIZE_NAMED_PROPS || !1, jt = t.KEEP_CONTENT !== !1, $t = t.IN_PLACE || !1, de = to(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : Qe, nt = typeof t.NAMESPACE == "string" ? t.NAMESPACE : v, qt = ae(
|
|
383
383
|
t,
|
|
384
384
|
"MATHML_TEXT_INTEGRATION_POINTS",
|
|
385
|
-
() => p({},
|
|
385
|
+
() => p({}, De)
|
|
386
386
|
// Default built-in map
|
|
387
387
|
), Kt = ae(
|
|
388
388
|
t,
|
|
389
389
|
"HTML_INTEGRATION_POINTS",
|
|
390
|
-
() => p({},
|
|
390
|
+
() => p({}, we)
|
|
391
391
|
// Default built-in map
|
|
392
392
|
);
|
|
393
393
|
const e = ae(t, "CUSTOM_ELEMENT_HANDLING", () => it(null));
|
|
394
|
-
if (x = it(null),
|
|
394
|
+
if (x = it(null), I(e, "tagNameCheck") && Ie(e.tagNameCheck) && (x.tagNameCheck = e.tagNameCheck), I(e, "attributeNameCheck") && Ie(e.attributeNameCheck) && (x.attributeNameCheck = e.attributeNameCheck), I(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (x.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), b(x), F && (Wt = !1), bt && (Q = !0), tt && (h = p({}, Ke), _ = it(null), tt.html === !0 && (p(h, qe), p(_, Ze)), tt.svg === !0 && (p(h, ne), p(_, ie), p(_, Pt)), tt.svgFilters === !0 && (p(h, oe), p(_, ie), p(_, Pt)), tt.mathMl === !0 && (p(h, re), p(_, Je), p(_, Pt))), U.tagCheck = null, U.attributeCheck = null, I(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? U.tagCheck = t.ADD_TAGS : at(t.ADD_TAGS) && (h === Ht && (h = C(h)), p(h, t.ADD_TAGS, E))), I(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? U.attributeCheck = t.ADD_ATTR : at(t.ADD_ATTR) && (_ === Gt && (_ = C(_)), p(_, t.ADD_ATTR, E))), I(t, "ADD_FORBID_CONTENTS") && at(t.ADD_FORBID_CONTENTS) && (et === Se && (et = C(et)), p(et, t.ADD_FORBID_CONTENTS, E)), jt && (h["#text"] = !0), j && p(h, ["html", "head", "body"]), h.table && (p(h, ["tbody"]), delete ft.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
395
395
|
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
396
396
|
throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
397
397
|
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -403,23 +403,23 @@ function cn() {
|
|
|
403
403
|
} catch (a) {
|
|
404
404
|
throw L = n, a;
|
|
405
405
|
}
|
|
406
|
-
} else t.TRUSTED_TYPES_POLICY === null ? (L = void 0, B = "") : (L === void 0 && (L =
|
|
406
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (L = void 0, B = "") : (L === void 0 && (L = fn()), L && typeof B == "string" && (B = J("")));
|
|
407
407
|
S && S(t), ot = t;
|
|
408
|
-
},
|
|
409
|
-
return e.namespaceURI === v ? t === "svg" : e.namespaceURI === Rt ? t === "svg" && (n === "annotation-xml" || qt[n]) : !!
|
|
408
|
+
}, Ne = p({}, [...ne, ...oe, ...eo]), Me = p({}, [...re, ...no]), Dn = function(t, e, n) {
|
|
409
|
+
return e.namespaceURI === v ? t === "svg" : e.namespaceURI === Rt ? t === "svg" && (n === "annotation-xml" || qt[n]) : !!Ne[t];
|
|
410
|
+
}, wn = function(t, e, n) {
|
|
411
|
+
return e.namespaceURI === v ? t === "math" : e.namespaceURI === Lt ? t === "math" && Kt[n] : !!Me[t];
|
|
410
412
|
}, In = function(t, e, n) {
|
|
411
|
-
return e.namespaceURI ===
|
|
412
|
-
},
|
|
413
|
-
return e.namespaceURI === Lt && !Kt[n] || e.namespaceURI === Rt && !qt[n] ? !1 : !Ce[t] && (Rn[t] || !Me[t]);
|
|
414
|
-
}, Cn = function(t) {
|
|
413
|
+
return e.namespaceURI === Lt && !Kt[n] || e.namespaceURI === Rt && !qt[n] ? !1 : !Me[t] && (bn[t] || !Ne[t]);
|
|
414
|
+
}, Nn = function(t) {
|
|
415
415
|
let e = K(t);
|
|
416
416
|
(!e || !e.tagName) && (e = {
|
|
417
417
|
namespaceURI: nt,
|
|
418
418
|
tagName: "template"
|
|
419
419
|
});
|
|
420
420
|
const n = _t(t.tagName), a = _t(e.tagName);
|
|
421
|
-
return Vt[t.namespaceURI] ? t.namespaceURI === Lt ?
|
|
422
|
-
},
|
|
421
|
+
return Vt[t.namespaceURI] ? t.namespaceURI === Lt ? Dn(n, e, a) : t.namespaceURI === Rt ? wn(n, e, a) : t.namespaceURI === v ? In(n, e, a) : !!(pt === "application/xhtml+xml" && Vt[t.namespaceURI]) : !1;
|
|
422
|
+
}, z = function(t) {
|
|
423
423
|
dt(i.removed, {
|
|
424
424
|
element: t
|
|
425
425
|
});
|
|
@@ -429,9 +429,9 @@ function cn() {
|
|
|
429
429
|
if (vt(t), !K(t))
|
|
430
430
|
throw X("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
431
431
|
}
|
|
432
|
-
},
|
|
432
|
+
}, Ce = function(t, e, n) {
|
|
433
433
|
try {
|
|
434
|
-
|
|
434
|
+
t.removeAttributeNode(e);
|
|
435
435
|
} catch {
|
|
436
436
|
try {
|
|
437
437
|
t.removeAttribute(n);
|
|
@@ -456,7 +456,7 @@ function cn() {
|
|
|
456
456
|
if (n)
|
|
457
457
|
for (let a = n.length - 1; a >= 0; --a) {
|
|
458
458
|
const l = n[a], u = l && l.name;
|
|
459
|
-
typeof u == "string" &&
|
|
459
|
+
typeof u == "string" && Ce(t, l, u);
|
|
460
460
|
}
|
|
461
461
|
}, $ = function(t, e, n) {
|
|
462
462
|
if (!n)
|
|
@@ -470,7 +470,7 @@ function cn() {
|
|
|
470
470
|
from: e
|
|
471
471
|
});
|
|
472
472
|
try {
|
|
473
|
-
n ?
|
|
473
|
+
n ? e.removeAttributeNode(n) : e.removeAttribute(t);
|
|
474
474
|
} catch {
|
|
475
475
|
try {
|
|
476
476
|
e.removeAttribute(t);
|
|
@@ -480,7 +480,7 @@ function cn() {
|
|
|
480
480
|
if (t === "is")
|
|
481
481
|
if (Q || bt)
|
|
482
482
|
try {
|
|
483
|
-
|
|
483
|
+
z(e);
|
|
484
484
|
} catch {
|
|
485
485
|
}
|
|
486
486
|
else
|
|
@@ -488,32 +488,32 @@ function cn() {
|
|
|
488
488
|
e.setAttribute(t, "");
|
|
489
489
|
} catch {
|
|
490
490
|
}
|
|
491
|
-
},
|
|
491
|
+
}, Mn = function(t) {
|
|
492
492
|
const e = kt(t);
|
|
493
493
|
if (e)
|
|
494
494
|
for (let n = e.length - 1; n >= 0; --n) {
|
|
495
495
|
const a = e[n], l = a && a.name;
|
|
496
|
-
typeof l != "string" || _[E(l)] ||
|
|
496
|
+
typeof l != "string" || _[E(l)] || Ce(t, a, l);
|
|
497
497
|
}
|
|
498
498
|
}, wt = function(t) {
|
|
499
499
|
const e = [t];
|
|
500
500
|
for (; e.length > 0; ) {
|
|
501
501
|
const n = e.pop();
|
|
502
|
-
ct(n) === M.element &&
|
|
502
|
+
ct(n) === M.element && Mn(n);
|
|
503
503
|
const l = q(n);
|
|
504
504
|
if (l)
|
|
505
505
|
for (let u = l.length - 1; u >= 0; --u)
|
|
506
506
|
e.push(l[u]);
|
|
507
507
|
}
|
|
508
|
-
},
|
|
508
|
+
}, Pe = function(t, e) {
|
|
509
509
|
return Y ? t === "patchsrc" ? !0 : t === "for" && e !== "label" && e !== "output" : !1;
|
|
510
|
-
},
|
|
510
|
+
}, Cn = function(t) {
|
|
511
511
|
if (!Y)
|
|
512
512
|
return;
|
|
513
513
|
const e = [t];
|
|
514
514
|
for (; e.length > 0; ) {
|
|
515
515
|
const n = e.pop(), a = ct(n);
|
|
516
|
-
if (a === M.processingInstruction || a === M.comment && O(
|
|
516
|
+
if (a === M.processingInstruction || a === M.comment && O(en, n.data)) {
|
|
517
517
|
try {
|
|
518
518
|
vt(n);
|
|
519
519
|
} catch {
|
|
@@ -523,7 +523,7 @@ function cn() {
|
|
|
523
523
|
if (a === M.element) {
|
|
524
524
|
const u = n, m = E(Ut(n));
|
|
525
525
|
try {
|
|
526
|
-
u.hasAttribute && u.hasAttribute("patchsrc") && u.removeAttribute("patchsrc"), u.hasAttribute && u.hasAttribute("for") &&
|
|
526
|
+
u.hasAttribute && u.hasAttribute("patchsrc") && u.removeAttribute("patchsrc"), u.hasAttribute && u.hasAttribute("for") && Pe("for", m) && u.removeAttribute("for");
|
|
527
527
|
} catch {
|
|
528
528
|
}
|
|
529
529
|
}
|
|
@@ -532,12 +532,12 @@ function cn() {
|
|
|
532
532
|
for (let u = l.length - 1; u >= 0; --u)
|
|
533
533
|
e.push(l[u]);
|
|
534
534
|
}
|
|
535
|
-
},
|
|
535
|
+
}, xe = function(t) {
|
|
536
536
|
let e = null, n = null;
|
|
537
537
|
if (Yt)
|
|
538
538
|
t = "<remove></remove>" + t;
|
|
539
539
|
else {
|
|
540
|
-
const u =
|
|
540
|
+
const u = je(t, /^[\r\n\t ]+/);
|
|
541
541
|
n = u && u[0];
|
|
542
542
|
}
|
|
543
543
|
pt === "application/xhtml+xml" && nt === v && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
@@ -555,59 +555,50 @@ function cn() {
|
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
const l = e.body || e.documentElement;
|
|
558
|
-
return t && n && l.insertBefore(s.createTextNode(n), l.childNodes[0] || null), nt === v ?
|
|
559
|
-
},
|
|
558
|
+
return t && n && l.insertBefore(s.createTextNode(n), l.childNodes[0] || null), nt === v ? mn.call(e, j ? "html" : "body")[0] : j ? e.documentElement : l;
|
|
559
|
+
}, ve = function(t) {
|
|
560
560
|
const e = Et ? Et(t) : t.ownerDocument;
|
|
561
|
-
return
|
|
561
|
+
return pe.call(
|
|
562
562
|
e || t,
|
|
563
563
|
t,
|
|
564
564
|
// eslint-disable-next-line no-bitwise
|
|
565
|
-
|
|
565
|
+
N.SHOW_ELEMENT | N.SHOW_COMMENT | N.SHOW_TEXT | N.SHOW_PROCESSING_INSTRUCTION | N.SHOW_CDATA_SECTION,
|
|
566
566
|
null
|
|
567
567
|
);
|
|
568
|
-
},
|
|
569
|
-
return t = Tt(t,
|
|
568
|
+
}, It = function(t) {
|
|
569
|
+
return t = Tt(t, Tn, " "), t = Tt(t, hn, " "), t = Tt(t, _n, " "), t;
|
|
570
570
|
}, Jt = function(t) {
|
|
571
571
|
var e;
|
|
572
572
|
t.normalize();
|
|
573
|
-
const n = Et ? Et(t) : t.ownerDocument, a =
|
|
573
|
+
const n = Et ? Et(t) : t.ownerDocument, a = pe.call(
|
|
574
574
|
n || t,
|
|
575
575
|
t,
|
|
576
576
|
// eslint-disable-next-line no-bitwise
|
|
577
|
-
|
|
577
|
+
N.SHOW_TEXT | N.SHOW_COMMENT | N.SHOW_CDATA_SECTION | N.SHOW_PROCESSING_INSTRUCTION,
|
|
578
578
|
null
|
|
579
579
|
);
|
|
580
580
|
let l = a.nextNode();
|
|
581
581
|
for (; l; )
|
|
582
|
-
l.data =
|
|
582
|
+
l.data = It(l.data), l = a.nextNode();
|
|
583
583
|
const u = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
|
|
584
584
|
u && V(u, (m) => {
|
|
585
585
|
rt(m.content) && Jt(m.content);
|
|
586
586
|
});
|
|
587
|
-
},
|
|
587
|
+
}, Nt = function(t) {
|
|
588
588
|
const e = Z ? Z(t) : null;
|
|
589
589
|
return typeof e != "string" || E(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
590
590
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
591
591
|
// makes the direct read diverge from the cached read; a clean form
|
|
592
592
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
593
593
|
// canonical NamedNodeMap.
|
|
594
|
-
t.attributes !== kt(t) || typeof t.removeAttribute != "function" ||
|
|
595
|
-
// shadows these Attr-node methods via [LegacyOverrideBuiltIns].
|
|
596
|
-
// _removeAttribute() / _stripAttributeNode() reach for
|
|
597
|
-
// element.removeAttributeNode(attr) first; when it is shadowed the call
|
|
598
|
-
// throws and the name-based fallback element.removeAttribute(name)
|
|
599
|
-
// ASCII-lowercases its lookup key in an HTML document, silently missing
|
|
600
|
-
// a case-preserved event-handler attribute (e.g. an ONANIMATIONSTART
|
|
601
|
-
// that reached the sanitizer through an XML/XHTML parse). Flag the form
|
|
602
|
-
// so it is removed wholesale, exactly as for the other shadowed methods.
|
|
603
|
-
typeof t.removeAttributeNode != "function" || typeof t.getAttributeNode != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
594
|
+
t.attributes !== kt(t) || typeof t.removeAttribute != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
604
595
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
605
596
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
606
597
|
// the named child element. Cheap addition — nodeType is read from
|
|
607
598
|
// an internal slot, no serialization cost — and removes a residual
|
|
608
599
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
609
600
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
610
|
-
t.nodeType !==
|
|
601
|
+
t.nodeType !== W(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
611
602
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
612
603
|
// form.childNodes from a clobbered form return the named child
|
|
613
604
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -620,18 +611,18 @@ function cn() {
|
|
|
620
611
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
621
612
|
t.childNodes !== q(t);
|
|
622
613
|
}, rt = function(t) {
|
|
623
|
-
if (!
|
|
614
|
+
if (!W || typeof t != "object" || t === null)
|
|
624
615
|
return !1;
|
|
625
616
|
try {
|
|
626
|
-
return
|
|
617
|
+
return W(t) === M.documentFragment;
|
|
627
618
|
} catch {
|
|
628
619
|
return !1;
|
|
629
620
|
}
|
|
630
621
|
}, mt = function(t) {
|
|
631
|
-
if (!
|
|
622
|
+
if (!W || typeof t != "object" || t === null)
|
|
632
623
|
return !1;
|
|
633
624
|
try {
|
|
634
|
-
return typeof
|
|
625
|
+
return typeof W(t) == "number";
|
|
635
626
|
} catch {
|
|
636
627
|
return !1;
|
|
637
628
|
}
|
|
@@ -641,8 +632,8 @@ function cn() {
|
|
|
641
632
|
n.call(i, t, e, ot);
|
|
642
633
|
});
|
|
643
634
|
}
|
|
644
|
-
const
|
|
645
|
-
return !!(Y && t.hasChildNodes() && !mt(t.firstElementChild) && O(
|
|
635
|
+
const Pn = function(t, e) {
|
|
636
|
+
return !!(Y && t.hasChildNodes() && !mt(t.firstElementChild) && O(tn, t.textContent) && O(tn, t.innerHTML) || Y && t.namespaceURI === v && To[e] && (mt(t.firstElementChild) || typeof t.textContent == "string" && O(ho[e], t.textContent)) || t.nodeType === M.processingInstruction || Y && t.nodeType === M.comment && O(en, t.data));
|
|
646
637
|
}, Mt = function(t, e) {
|
|
647
638
|
if (t instanceof RegExp)
|
|
648
639
|
return O(t, e);
|
|
@@ -652,86 +643,86 @@ function cn() {
|
|
|
652
643
|
return !!t(e, ...a);
|
|
653
644
|
}
|
|
654
645
|
return !1;
|
|
655
|
-
},
|
|
656
|
-
if (!ft[e] &&
|
|
646
|
+
}, xn = function(t, e, n) {
|
|
647
|
+
if (!ft[e] && He(e) && Mt(x.tagNameCheck, e))
|
|
657
648
|
return !1;
|
|
658
649
|
if (jt && !et[e]) {
|
|
659
650
|
const a = K(t), l = q(t);
|
|
660
651
|
if (l && a) {
|
|
661
652
|
const u = l.length;
|
|
662
653
|
for (let m = u - 1; m >= 0; --m) {
|
|
663
|
-
const g = t === n ?
|
|
664
|
-
a.insertBefore(g,
|
|
654
|
+
const g = t === n ? ln(l[m], !0) : l[m];
|
|
655
|
+
a.insertBefore(g, cn(t));
|
|
665
656
|
}
|
|
666
657
|
}
|
|
667
658
|
}
|
|
668
|
-
return
|
|
669
|
-
},
|
|
659
|
+
return z(t), !0;
|
|
660
|
+
}, ke = function(t, e, n, a) {
|
|
670
661
|
return t.length === 0 ? e : e === n || e === a ? C(e) : e;
|
|
671
|
-
},
|
|
662
|
+
}, Ue = function(t, e) {
|
|
672
663
|
return t === e || K(t) !== null ? !1 : ($t && wt(t), !0);
|
|
673
|
-
},
|
|
674
|
-
if (k(T.beforeSanitizeElements, t, null),
|
|
664
|
+
}, Fe = function(t, e) {
|
|
665
|
+
if (k(T.beforeSanitizeElements, t, null), Ue(t, e))
|
|
675
666
|
return !0;
|
|
676
|
-
if (
|
|
677
|
-
return
|
|
667
|
+
if (Nt(t))
|
|
668
|
+
return z(t), !0;
|
|
678
669
|
const n = E(Ut(t));
|
|
679
|
-
if (h =
|
|
670
|
+
if (h = ke(T.uponSanitizeElement, h, Ht, yt), k(T.uponSanitizeElement, t, {
|
|
680
671
|
tagName: n,
|
|
681
672
|
allowedTags: h
|
|
682
|
-
}),
|
|
673
|
+
}), Ue(t, e))
|
|
683
674
|
return !0;
|
|
684
|
-
if (
|
|
685
|
-
return
|
|
686
|
-
if (ft[n] || !(
|
|
687
|
-
const l =
|
|
675
|
+
if (Pn(t, n))
|
|
676
|
+
return z(t), !0;
|
|
677
|
+
if (ft[n] || !(U.tagCheck instanceof Function && U.tagCheck(n)) && !h[n]) {
|
|
678
|
+
const l = xn(t, n, e);
|
|
688
679
|
return l === !1 && k(T.afterSanitizeElements, t, null), l;
|
|
689
680
|
}
|
|
690
|
-
if (ct(t) === M.element && !
|
|
691
|
-
return
|
|
692
|
-
if (
|
|
693
|
-
const l =
|
|
681
|
+
if (ct(t) === M.element && !Nn(t) || (n === "noscript" || n === "noembed" || n === "noframes") && O(po, t.innerHTML))
|
|
682
|
+
return z(t), !0;
|
|
683
|
+
if (F && t.nodeType === M.text) {
|
|
684
|
+
const l = It(t.textContent);
|
|
694
685
|
t.textContent !== l && (dt(i.removed, {
|
|
695
686
|
element: t.cloneNode()
|
|
696
687
|
}), t.textContent = l);
|
|
697
688
|
}
|
|
698
689
|
return k(T.afterSanitizeElements, t, null), !1;
|
|
699
|
-
},
|
|
700
|
-
if (
|
|
690
|
+
}, ze = function(t, e, n) {
|
|
691
|
+
if (Te[e] || Pe(e, t) || Ee && (e === "id" || e === "name") && (n in s || n in Ln))
|
|
701
692
|
return !1;
|
|
702
|
-
const a = _[e] ||
|
|
703
|
-
return
|
|
693
|
+
const a = _[e] || U.attributeCheck instanceof Function && U.attributeCheck(e, t);
|
|
694
|
+
return Wt && O(gn, e) || he && O(En, e) ? !0 : a ? Re[e] || O(de, Tt(n, me, "")) || (e === "src" || e === "xlink:href" || e === "href") && t !== "script" && $e(n, "data:") === 0 && be[t] || _e && !O(An, Tt(n, me, "")) ? !0 : !n : (
|
|
704
695
|
// Condition a) covers a basically valid custom element tag name whose
|
|
705
696
|
// tag passes the configured tagNameCheck and whose attribute name
|
|
706
697
|
// passes the configured attributeNameCheck ...
|
|
707
|
-
|
|
698
|
+
He(t) && Mt(x.tagNameCheck, t) && Mt(x.attributeNameCheck, e, t) || // Condition b) covers an `is` attribute whose value passes the
|
|
708
699
|
// configured tagNameCheck while customized built-in elements are
|
|
709
700
|
// allowed.
|
|
710
701
|
e === "is" && x.allowCustomizedBuiltInElements && Mt(x.tagNameCheck, n)
|
|
711
702
|
);
|
|
712
|
-
},
|
|
713
|
-
return !
|
|
714
|
-
},
|
|
703
|
+
}, vn = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), He = function(t) {
|
|
704
|
+
return !vn[_t(t)] && O(yn, t);
|
|
705
|
+
}, kn = function(t, e, n, a) {
|
|
715
706
|
if (L && typeof gt == "object" && typeof gt.getAttributeType == "function" && !n)
|
|
716
707
|
switch (gt.getAttributeType(t, e)) {
|
|
717
708
|
case "TrustedHTML":
|
|
718
709
|
return J(a);
|
|
719
710
|
case "TrustedScriptURL":
|
|
720
|
-
return
|
|
711
|
+
return un(a);
|
|
721
712
|
}
|
|
722
713
|
return a;
|
|
723
|
-
},
|
|
714
|
+
}, Un = function(t, e, n, a) {
|
|
724
715
|
try {
|
|
725
|
-
|
|
716
|
+
n ? t.setAttributeNS(n, e, a) : t.setAttribute(e, a), Nt(t) ? z(t) : Ye(i.removed);
|
|
726
717
|
} catch {
|
|
727
|
-
|
|
718
|
+
$(e, t);
|
|
728
719
|
}
|
|
729
720
|
}, Ge = function(t) {
|
|
730
721
|
k(T.beforeSanitizeAttributes, t, null);
|
|
731
722
|
const e = t.attributes;
|
|
732
|
-
if (!e ||
|
|
723
|
+
if (!e || Nt(t))
|
|
733
724
|
return;
|
|
734
|
-
_ =
|
|
725
|
+
_ = ke(T.uponSanitizeAttribute, _, Gt, St);
|
|
735
726
|
const n = {
|
|
736
727
|
attrName: "",
|
|
737
728
|
attrValue: "",
|
|
@@ -743,12 +734,12 @@ function cn() {
|
|
|
743
734
|
const l = E(t.nodeName);
|
|
744
735
|
for (; a--; ) {
|
|
745
736
|
const u = e[a], m = u.name, g = u.namespaceURI, D = u.value, w = E(m), te = D;
|
|
746
|
-
let R = m === "value" ? te :
|
|
747
|
-
if (n.attrName = w, n.attrValue = R, n.keepAttr = !0, n.forceKeepAttr = void 0, k(T.uponSanitizeAttribute, t, n), R = n.attrValue,
|
|
737
|
+
let R = m === "value" ? te : Vn(te);
|
|
738
|
+
if (n.attrName = w, n.attrValue = R, n.keepAttr = !0, n.forceKeepAttr = void 0, k(T.uponSanitizeAttribute, t, n), R = n.attrValue, Ae && (w === "id" || w === "name") && $e(R, ye) !== 0 && ($(m, t, u), R = ye + R), Y && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
748
739
|
$(m, t, u);
|
|
749
740
|
continue;
|
|
750
741
|
}
|
|
751
|
-
if (w === "attributename" &&
|
|
742
|
+
if (w === "attributename" && je(R, "href")) {
|
|
752
743
|
$(m, t, u);
|
|
753
744
|
continue;
|
|
754
745
|
}
|
|
@@ -757,24 +748,24 @@ function cn() {
|
|
|
757
748
|
$(m, t, u);
|
|
758
749
|
continue;
|
|
759
750
|
}
|
|
760
|
-
if (!
|
|
751
|
+
if (!ge && O(mo, R)) {
|
|
761
752
|
$(m, t, u);
|
|
762
753
|
continue;
|
|
763
754
|
}
|
|
764
|
-
if (
|
|
755
|
+
if (F && (R = It(R)), !ze(l, w, R)) {
|
|
765
756
|
$(m, t, u);
|
|
766
757
|
continue;
|
|
767
758
|
}
|
|
768
|
-
R =
|
|
759
|
+
R = kn(l, w, g, R), R !== te && Un(t, m, g, R);
|
|
769
760
|
}
|
|
770
761
|
}
|
|
771
762
|
k(T.afterSanitizeAttributes, t, null);
|
|
772
763
|
}, Ct = function(t) {
|
|
773
764
|
let e = null;
|
|
774
|
-
const n =
|
|
765
|
+
const n = ve(t);
|
|
775
766
|
for (k(T.beforeSanitizeShadowDOM, t, null); e = n.nextNode(); )
|
|
776
|
-
if (k(T.uponSanitizeShadowNode, e, null),
|
|
777
|
-
const a =
|
|
767
|
+
if (k(T.uponSanitizeShadowNode, e, null), Fe(e, t), Ge(e), rt(e.content) && Ct(e.content), ct(e) === M.element) {
|
|
768
|
+
const a = ce(e);
|
|
778
769
|
rt(a) && (Qt(a), Ct(a));
|
|
779
770
|
}
|
|
780
771
|
k(T.afterSanitizeShadowDOM, t, null);
|
|
@@ -807,7 +798,7 @@ function cn() {
|
|
|
807
798
|
}
|
|
808
799
|
}
|
|
809
800
|
if (u) {
|
|
810
|
-
const g =
|
|
801
|
+
const g = ce(a);
|
|
811
802
|
rt(g) && e.push({
|
|
812
803
|
node: null,
|
|
813
804
|
shadow: g
|
|
@@ -820,21 +811,21 @@ function cn() {
|
|
|
820
811
|
};
|
|
821
812
|
return i.sanitize = function(o) {
|
|
822
813
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, n = null, a = null, l = null;
|
|
823
|
-
if (Xt = !o, Xt && (o = "<!-->"), typeof o != "string" && !mt(o) && (o =
|
|
814
|
+
if (Xt = !o, Xt && (o = "<!-->"), typeof o != "string" && !mt(o) && (o = Qn(o), typeof o != "string"))
|
|
824
815
|
throw X("dirty is not a string, aborting");
|
|
825
816
|
if (!i.isSupported)
|
|
826
817
|
return o;
|
|
827
818
|
Bt ? (h = yt, _ = St) : Zt(t), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (h = C(h)), T.uponSanitizeAttribute.length > 0 && (_ = C(_)), i.removed = [];
|
|
828
819
|
const u = $t && typeof o != "string" && mt(o);
|
|
829
820
|
if (u) {
|
|
830
|
-
|
|
821
|
+
Cn(o);
|
|
831
822
|
const D = Ut(o);
|
|
832
823
|
if (typeof D == "string") {
|
|
833
824
|
const w = E(D);
|
|
834
825
|
if (!h[w] || ft[w])
|
|
835
826
|
throw Dt(o), X("root node is forbidden and cannot be sanitized in-place");
|
|
836
827
|
}
|
|
837
|
-
if (
|
|
828
|
+
if (Nt(o))
|
|
838
829
|
throw Dt(o), X("root node is clobbered and cannot be sanitized in-place");
|
|
839
830
|
try {
|
|
840
831
|
Qt(o);
|
|
@@ -842,20 +833,20 @@ function cn() {
|
|
|
842
833
|
throw Dt(o), w;
|
|
843
834
|
}
|
|
844
835
|
} else if (mt(o))
|
|
845
|
-
e =
|
|
836
|
+
e = xe("<!---->"), n = e.ownerDocument.importNode(o, !0), n.nodeType === M.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? e = n : e.appendChild(n), Qt(n);
|
|
846
837
|
else {
|
|
847
|
-
if (!Q && !
|
|
838
|
+
if (!Q && !F && !j && // eslint-disable-next-line unicorn/prefer-includes
|
|
848
839
|
o.indexOf("<") === -1)
|
|
849
840
|
return L && Ot ? J(o) : o;
|
|
850
|
-
if (e =
|
|
841
|
+
if (e = xe(o), !e)
|
|
851
842
|
return Q ? null : Ot ? B : "";
|
|
852
843
|
}
|
|
853
|
-
e && Yt &&
|
|
844
|
+
e && Yt && z(e.firstChild);
|
|
854
845
|
const m = u ? o : e;
|
|
855
846
|
try {
|
|
856
|
-
const D =
|
|
847
|
+
const D = ve(m);
|
|
857
848
|
for (; a = D.nextNode(); )
|
|
858
|
-
|
|
849
|
+
Fe(a, m), Ge(a), rt(a.content) && Ct(a.content);
|
|
859
850
|
} catch (D) {
|
|
860
851
|
throw u && (Dt(o), V(i.removed, (w) => {
|
|
861
852
|
w.element && wt(w.element);
|
|
@@ -864,18 +855,18 @@ function cn() {
|
|
|
864
855
|
if (u)
|
|
865
856
|
return V(i.removed, (D) => {
|
|
866
857
|
D.element && wt(D.element);
|
|
867
|
-
}),
|
|
858
|
+
}), F && Jt(o), o;
|
|
868
859
|
if (Q) {
|
|
869
|
-
if (
|
|
870
|
-
for (l =
|
|
860
|
+
if (F && Jt(e), bt)
|
|
861
|
+
for (l = pn.call(e.ownerDocument); e.firstChild; )
|
|
871
862
|
l.appendChild(e.firstChild);
|
|
872
863
|
else
|
|
873
864
|
l = e;
|
|
874
|
-
return (_.shadowroot || _.shadowrootmode) && (l =
|
|
865
|
+
return (_.shadowroot || _.shadowrootmode) && (l = dn.call(c, l, !0)), l;
|
|
875
866
|
}
|
|
876
867
|
let g = j ? e.outerHTML : e.innerHTML;
|
|
877
|
-
return j && h["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && O(
|
|
878
|
-
` + g),
|
|
868
|
+
return j && h["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && O(uo, e.ownerDocument.doctype.name) && (g = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
|
|
869
|
+
` + g), F && (g = It(g)), L && Ot ? J(g) : g;
|
|
879
870
|
}, i.setConfig = function() {
|
|
880
871
|
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
881
872
|
Zt(o), Bt = !0, yt = h, St = _;
|
|
@@ -884,24 +875,24 @@ function cn() {
|
|
|
884
875
|
}, i.isValidAttribute = function(o, t, e) {
|
|
885
876
|
ot || Zt({});
|
|
886
877
|
const n = E(o), a = E(t);
|
|
887
|
-
return
|
|
878
|
+
return ze(n, a, e);
|
|
888
879
|
}, i.addHook = function(o, t) {
|
|
889
|
-
typeof t == "function" &&
|
|
880
|
+
typeof t == "function" && I(T, o) && dt(T[o], t);
|
|
890
881
|
}, i.removeHook = function(o, t) {
|
|
891
|
-
if (
|
|
882
|
+
if (I(T, o)) {
|
|
892
883
|
if (t !== void 0) {
|
|
893
|
-
const e =
|
|
894
|
-
return e === -1 ? void 0 :
|
|
884
|
+
const e = $n(T[o], t);
|
|
885
|
+
return e === -1 ? void 0 : Xn(T[o], e, 1)[0];
|
|
895
886
|
}
|
|
896
|
-
return
|
|
887
|
+
return Ye(T[o]);
|
|
897
888
|
}
|
|
898
889
|
}, i.removeHooks = function(o) {
|
|
899
|
-
|
|
890
|
+
I(T, o) && (T[o] = []);
|
|
900
891
|
}, i.removeAllHooks = function() {
|
|
901
|
-
T =
|
|
892
|
+
T = nn();
|
|
902
893
|
}, i;
|
|
903
894
|
}
|
|
904
|
-
var
|
|
895
|
+
var Eo = sn();
|
|
905
896
|
export {
|
|
906
|
-
|
|
897
|
+
Eo as default
|
|
907
898
|
};
|