@opensystemslab/map 1.0.0-alpha.11 → 1.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,830 @@
1
+ /*! @license DOMPurify 3.4.11 | (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.11/LICENSE */
2
+ function Mt(n, o) {
3
+ (o == null || o > n.length) && (o = n.length);
4
+ for (var s = 0, l = Array(o); s < o; s++) l[s] = n[s];
5
+ return l;
6
+ }
7
+ function Nn(n) {
8
+ if (Array.isArray(n)) return n;
9
+ }
10
+ function In(n, o) {
11
+ var s = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
12
+ if (s != null) {
13
+ var l, u, m, N, re = [], w = !0, ie = !1;
14
+ try {
15
+ if (m = (s = s.call(n)).next, o !== 0) for (; !(w = (l = m.call(s)).done) && (re.push(l.value), re.length !== o); w = !0) ;
16
+ } catch (Ie) {
17
+ ie = !0, u = Ie;
18
+ } finally {
19
+ try {
20
+ if (!w && s.return != null && (N = s.return(), Object(N) !== N)) return;
21
+ } finally {
22
+ if (ie) throw u;
23
+ }
24
+ }
25
+ return re;
26
+ }
27
+ }
28
+ function Dn() {
29
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
31
+ }
32
+ function Ln(n, o) {
33
+ return Nn(n) || In(n, o) || wn(n, o) || Dn();
34
+ }
35
+ function wn(n, o) {
36
+ if (n) {
37
+ if (typeof n == "string") return Mt(n, o);
38
+ var s = {}.toString.call(n).slice(8, -1);
39
+ return s === "Object" && n.constructor && (s = n.constructor.name), s === "Map" || s === "Set" ? Array.from(n) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? Mt(n, o) : void 0;
40
+ }
41
+ }
42
+ const $t = Object.entries, Pt = Object.setPrototypeOf, Cn = Object.isFrozen, Mn = Object.getPrototypeOf, Pn = Object.getOwnPropertyDescriptor;
43
+ let O = Object.freeze, R = Object.seal, oe = Object.create, Xt = typeof Reflect < "u" && Reflect, Qe = Xt.apply, et = Xt.construct;
44
+ O || (O = function(o) {
45
+ return o;
46
+ });
47
+ R || (R = function(o) {
48
+ return o;
49
+ });
50
+ Qe || (Qe = function(o, s) {
51
+ for (var l = arguments.length, u = new Array(l > 2 ? l - 2 : 0), m = 2; m < l; m++)
52
+ u[m - 2] = arguments[m];
53
+ return o.apply(s, u);
54
+ });
55
+ et || (et = function(o) {
56
+ for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
57
+ l[u - 1] = arguments[u];
58
+ return new o(...l);
59
+ });
60
+ const me = A(Array.prototype.forEach), xn = A(Array.prototype.lastIndexOf), xt = A(Array.prototype.pop), ne = A(Array.prototype.push), kn = A(Array.prototype.splice), Y = Array.isArray, _e = A(String.prototype.toLowerCase), Ve = A(String.prototype.toString), kt = A(String.prototype.match), de = A(String.prototype.replace), vt = A(String.prototype.indexOf), vn = A(String.prototype.trim), Un = A(Number.prototype.toString), Fn = A(Boolean.prototype.toString), Ut = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), Ft = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), S = A(Object.prototype.hasOwnProperty), Te = A(Object.prototype.toString), b = A(RegExp.prototype.test), q = zn(TypeError);
61
+ function A(n) {
62
+ return function(o) {
63
+ o instanceof RegExp && (o.lastIndex = 0);
64
+ for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++)
65
+ l[u - 1] = arguments[u];
66
+ return Qe(n, o, l);
67
+ };
68
+ }
69
+ function zn(n) {
70
+ return function() {
71
+ for (var o = arguments.length, s = new Array(o), l = 0; l < o; l++)
72
+ s[l] = arguments[l];
73
+ return et(n, s);
74
+ };
75
+ }
76
+ function f(n, o) {
77
+ let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _e;
78
+ if (Pt && Pt(n, null), !Y(o))
79
+ return n;
80
+ let l = o.length;
81
+ for (; l--; ) {
82
+ let u = o[l];
83
+ if (typeof u == "string") {
84
+ const m = s(u);
85
+ m !== u && (Cn(o) || (o[l] = m), u = m);
86
+ }
87
+ n[u] = !0;
88
+ }
89
+ return n;
90
+ }
91
+ function Hn(n) {
92
+ for (let o = 0; o < n.length; o++)
93
+ S(n, o) || (n[o] = null);
94
+ return n;
95
+ }
96
+ function D(n) {
97
+ const o = oe(null);
98
+ for (const l of $t(n)) {
99
+ var s = Ln(l, 2);
100
+ const u = s[0], m = s[1];
101
+ S(n, u) && (Y(m) ? o[u] = Hn(m) : m && typeof m == "object" && m.constructor === Object ? o[u] = D(m) : o[u] = m);
102
+ }
103
+ return o;
104
+ }
105
+ function Gn(n) {
106
+ switch (typeof n) {
107
+ case "string":
108
+ return n;
109
+ case "number":
110
+ return Un(n);
111
+ case "boolean":
112
+ return Fn(n);
113
+ case "bigint":
114
+ return Ut ? Ut(n) : "0";
115
+ case "symbol":
116
+ return Ft ? Ft(n) : "Symbol()";
117
+ case "undefined":
118
+ return Te(n);
119
+ case "function":
120
+ case "object": {
121
+ if (n === null)
122
+ return Te(n);
123
+ const o = n, s = U(o, "toString");
124
+ if (typeof s == "function") {
125
+ const l = s(o);
126
+ return typeof l == "string" ? l : Te(l);
127
+ }
128
+ return Te(n);
129
+ }
130
+ default:
131
+ return Te(n);
132
+ }
133
+ }
134
+ function U(n, o) {
135
+ for (; n !== null; ) {
136
+ const l = Pn(n, o);
137
+ if (l) {
138
+ if (l.get)
139
+ return A(l.get);
140
+ if (typeof l.value == "function")
141
+ return A(l.value);
142
+ }
143
+ n = Mn(n);
144
+ }
145
+ function s() {
146
+ return null;
147
+ }
148
+ return s;
149
+ }
150
+ function Bn(n) {
151
+ try {
152
+ return b(n, ""), !0;
153
+ } catch {
154
+ return !1;
155
+ }
156
+ }
157
+ const zt = O(["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"]), qe = O(["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"]), Ke = O(["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"]), Wn = O(["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"]), Ze = O(["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"]), Yn = O(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ht = O(["#text"]), Gt = O(["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"]), Je = O(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Bt = O(["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"]), Ne = O(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), jn = R(/{{[\w\W]*|^[\w\W]*}}/g), $n = R(/<%[\w\W]*|^[\w\W]*%>/g), Xn = R(/\${[\w\W]*/g), Vn = R(/^data-[\-\w.\u00B7-\uFFFF]+$/), qn = R(/^aria-[\-\w]+$/), Wt = R(
158
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
159
+ // eslint-disable-line no-useless-escape
160
+ ), Kn = R(/^(?:\w+script|data):/i), Zn = R(
161
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
162
+ // eslint-disable-line no-control-regex
163
+ ), Jn = R(/^html$/i), Qn = R(/^[a-z][.\w]*(-[.\w]+)+$/i), Yt = R(/<[/\w!]/g), eo = R(/<[/\w]/g), to = R(/<\/no(script|embed|frames)/i), no = R(/\/>/i), v = {
164
+ element: 1,
165
+ attribute: 2,
166
+ text: 3,
167
+ cdataSection: 4,
168
+ entityReference: 5,
169
+ // Deprecated
170
+ entityNode: 6,
171
+ // Deprecated
172
+ processingInstruction: 7,
173
+ comment: 8,
174
+ document: 9,
175
+ documentType: 10,
176
+ documentFragment: 11,
177
+ notation: 12
178
+ // Deprecated
179
+ }, oo = function() {
180
+ return typeof window > "u" ? null : window;
181
+ }, ro = function(o, s) {
182
+ if (typeof o != "object" || typeof o.createPolicy != "function")
183
+ return null;
184
+ let l = null;
185
+ const u = "data-tt-policy-suffix";
186
+ s && s.hasAttribute(u) && (l = s.getAttribute(u));
187
+ const m = "dompurify" + (l ? "#" + l : "");
188
+ try {
189
+ return o.createPolicy(m, {
190
+ createHTML(N) {
191
+ return N;
192
+ },
193
+ createScriptURL(N) {
194
+ return N;
195
+ }
196
+ });
197
+ } catch {
198
+ return console.warn("TrustedTypes policy " + m + " could not be created."), null;
199
+ }
200
+ }, jt = function() {
201
+ return {
202
+ afterSanitizeAttributes: [],
203
+ afterSanitizeElements: [],
204
+ afterSanitizeShadowDOM: [],
205
+ beforeSanitizeAttributes: [],
206
+ beforeSanitizeElements: [],
207
+ beforeSanitizeShadowDOM: [],
208
+ uponSanitizeAttribute: [],
209
+ uponSanitizeElement: [],
210
+ uponSanitizeShadowNode: []
211
+ };
212
+ }, W = function(o, s, l, u) {
213
+ return S(o, s) && Y(o[s]) ? f(u.base ? D(u.base) : {}, o[s], u.transform) : l;
214
+ };
215
+ function Vt() {
216
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : oo();
217
+ const o = (i) => Vt(i);
218
+ if (o.version = "3.4.11", o.removed = [], !n || !n.document || n.document.nodeType !== v.document || !n.Element)
219
+ return o.isSupported = !1, o;
220
+ let s = n.document;
221
+ const l = s, u = l.currentScript;
222
+ n.DocumentFragment;
223
+ const m = n.HTMLTemplateElement, N = n.Node, re = n.Element, w = n.NodeFilter, ie = n.NamedNodeMap;
224
+ ie === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
225
+ const Ie = n.DOMParser, he = n.trustedTypes, j = re.prototype, qt = U(j, "cloneNode"), tt = U(j, "remove"), Kt = U(j, "nextSibling"), ae = U(j, "childNodes"), se = U(j, "parentNode"), nt = U(j, "shadowRoot"), De = U(j, "attributes"), C = N && N.prototype ? U(N.prototype, "nodeType") : null, z = N && N.prototype ? U(N.prototype, "nodeName") : null;
226
+ if (typeof m == "function") {
227
+ const i = s.createElement("template");
228
+ i.content && i.content.ownerDocument && (s = i.content.ownerDocument);
229
+ }
230
+ let L, $ = "", Le, ot = !1, le = 0;
231
+ const rt = function() {
232
+ if (le > 0)
233
+ throw q('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.');
234
+ }, K = function(e) {
235
+ rt(), le++;
236
+ try {
237
+ return L.createHTML(e);
238
+ } finally {
239
+ le--;
240
+ }
241
+ }, Zt = function(e) {
242
+ rt(), le++;
243
+ try {
244
+ return L.createScriptURL(e);
245
+ } finally {
246
+ le--;
247
+ }
248
+ }, Jt = function() {
249
+ return ot || (Le = ro(he, u), ot = !0), Le;
250
+ }, ge = s, we = ge.implementation, it = ge.createNodeIterator, Qt = ge.createDocumentFragment, en = ge.getElementsByTagName, tn = l.importNode;
251
+ let g = jt();
252
+ o.isSupported = typeof $t == "function" && typeof se == "function" && we && we.createHTMLDocument !== void 0;
253
+ const nn = jn, on = $n, rn = Xn, an = Vn, sn = qn, ln = Kn, at = Zn, cn = Qn;
254
+ let st = Wt, d = null;
255
+ const lt = f({}, [...zt, ...qe, ...Ke, ...Ze, ...Ht]);
256
+ let T = null;
257
+ const ct = f({}, [...Gt, ...Je, ...Bt, ...Ne]);
258
+ let _ = Object.seal(oe(null, {
259
+ tagNameCheck: {
260
+ writable: !0,
261
+ configurable: !1,
262
+ enumerable: !0,
263
+ value: null
264
+ },
265
+ attributeNameCheck: {
266
+ writable: !0,
267
+ configurable: !1,
268
+ enumerable: !0,
269
+ value: null
270
+ },
271
+ allowCustomizedBuiltInElements: {
272
+ writable: !0,
273
+ configurable: !1,
274
+ enumerable: !0,
275
+ value: !1
276
+ }
277
+ })), ce = null, ut = null;
278
+ const H = Object.seal(oe(null, {
279
+ tagCheck: {
280
+ writable: !0,
281
+ configurable: !1,
282
+ enumerable: !0,
283
+ value: null
284
+ },
285
+ attributeCheck: {
286
+ writable: !0,
287
+ configurable: !1,
288
+ enumerable: !0,
289
+ value: null
290
+ }
291
+ }));
292
+ let ft = !0, Ce = !0, pt = !1, mt = !0, G = !1, ue = !0, X = !1, Me = !1, Pe = null, xe = null, ke = !1, Z = !1, Ee = !1, Ae = !1, dt = !0, Tt = !1;
293
+ const _t = "user-content-";
294
+ let ve = !0, Ue = !1, J = {}, x = null;
295
+ const Fe = f({}, [
296
+ "annotation-xml",
297
+ "audio",
298
+ "colgroup",
299
+ "desc",
300
+ "foreignobject",
301
+ "head",
302
+ "iframe",
303
+ "math",
304
+ "mi",
305
+ "mn",
306
+ "mo",
307
+ "ms",
308
+ "mtext",
309
+ "noembed",
310
+ "noframes",
311
+ "noscript",
312
+ "plaintext",
313
+ "script",
314
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
315
+ // the UA (customizable <select>) — including any on* handlers — and the
316
+ // engine re-mirrors synchronously whenever a removal changes which
317
+ // option/selectedcontent is current, even inside DOMPurify's inert
318
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
319
+ // mirror target ahead of the walk, which the engine refills, looping
320
+ // forever (DoS) and amplifying output. Dropping its content on removal
321
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
322
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
323
+ "selectedcontent",
324
+ "style",
325
+ "svg",
326
+ "template",
327
+ "thead",
328
+ "title",
329
+ "video",
330
+ "xmp"
331
+ ]);
332
+ let ht = null;
333
+ const gt = f({}, ["audio", "video", "img", "source", "image", "track"]);
334
+ let ze = null;
335
+ const Et = f({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ye = "http://www.w3.org/1998/Math/MathML", Se = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml";
336
+ let Q = k, He = !1, Ge = null;
337
+ const un = f({}, [ye, Se, k], Ve), At = O(["mi", "mo", "mn", "ms", "mtext"]);
338
+ let Be = f({}, At);
339
+ const yt = O(["annotation-xml"]);
340
+ let We = f({}, yt);
341
+ const fn = f({}, ["title", "style", "font", "a", "script"]);
342
+ let fe = null;
343
+ const pn = ["application/xhtml+xml", "text/html"], mn = "text/html";
344
+ let h = null, ee = null;
345
+ const dn = s.createElement("form"), St = function(e) {
346
+ return e instanceof RegExp || e instanceof Function;
347
+ }, Ye = function() {
348
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
349
+ if (ee && ee === e)
350
+ return;
351
+ (!e || typeof e != "object") && (e = {}), e = D(e), fe = // eslint-disable-next-line unicorn/prefer-includes
352
+ pn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? mn : e.PARSER_MEDIA_TYPE, h = fe === "application/xhtml+xml" ? Ve : _e, d = W(e, "ALLOWED_TAGS", lt, {
353
+ transform: h
354
+ }), T = W(e, "ALLOWED_ATTR", ct, {
355
+ transform: h
356
+ }), Ge = W(e, "ALLOWED_NAMESPACES", un, {
357
+ transform: Ve
358
+ }), ze = W(e, "ADD_URI_SAFE_ATTR", Et, {
359
+ transform: h,
360
+ base: Et
361
+ }), ht = W(e, "ADD_DATA_URI_TAGS", gt, {
362
+ transform: h,
363
+ base: gt
364
+ }), x = W(e, "FORBID_CONTENTS", Fe, {
365
+ transform: h
366
+ }), ce = W(e, "FORBID_TAGS", D({}), {
367
+ transform: h
368
+ }), ut = W(e, "FORBID_ATTR", D({}), {
369
+ transform: h
370
+ }), J = S(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? D(e.USE_PROFILES) : e.USE_PROFILES : !1, ft = e.ALLOW_ARIA_ATTR !== !1, Ce = e.ALLOW_DATA_ATTR !== !1, pt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, mt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = e.SAFE_FOR_TEMPLATES || !1, ue = e.SAFE_FOR_XML !== !1, X = e.WHOLE_DOCUMENT || !1, Z = e.RETURN_DOM || !1, Ee = e.RETURN_DOM_FRAGMENT || !1, Ae = e.RETURN_TRUSTED_TYPE || !1, ke = e.FORCE_BODY || !1, dt = e.SANITIZE_DOM !== !1, Tt = e.SANITIZE_NAMED_PROPS || !1, ve = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, st = Bn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Wt, Q = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, Be = S(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? D(e.MATHML_TEXT_INTEGRATION_POINTS) : f({}, At), We = S(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? D(e.HTML_INTEGRATION_POINTS) : f({}, yt);
371
+ const t = S(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? D(e.CUSTOM_ELEMENT_HANDLING) : oe(null);
372
+ if (_ = oe(null), S(t, "tagNameCheck") && St(t.tagNameCheck) && (_.tagNameCheck = t.tagNameCheck), S(t, "attributeNameCheck") && St(t.attributeNameCheck) && (_.attributeNameCheck = t.attributeNameCheck), S(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (_.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), R(_), G && (Ce = !1), Ee && (Z = !0), J && (d = f({}, Ht), T = oe(null), J.html === !0 && (f(d, zt), f(T, Gt)), J.svg === !0 && (f(d, qe), f(T, Je), f(T, Ne)), J.svgFilters === !0 && (f(d, Ke), f(T, Je), f(T, Ne)), J.mathMl === !0 && (f(d, Ze), f(T, Bt), f(T, Ne))), H.tagCheck = null, H.attributeCheck = null, S(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? H.tagCheck = e.ADD_TAGS : Y(e.ADD_TAGS) && (d === lt && (d = D(d)), f(d, e.ADD_TAGS, h))), S(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? H.attributeCheck = e.ADD_ATTR : Y(e.ADD_ATTR) && (T === ct && (T = D(T)), f(T, e.ADD_ATTR, h))), S(e, "ADD_URI_SAFE_ATTR") && Y(e.ADD_URI_SAFE_ATTR) && f(ze, e.ADD_URI_SAFE_ATTR, h), S(e, "FORBID_CONTENTS") && Y(e.FORBID_CONTENTS) && (x === Fe && (x = D(x)), f(x, e.FORBID_CONTENTS, h)), S(e, "ADD_FORBID_CONTENTS") && Y(e.ADD_FORBID_CONTENTS) && (x === Fe && (x = D(x)), f(x, e.ADD_FORBID_CONTENTS, h)), ve && (d["#text"] = !0), X && f(d, ["html", "head", "body"]), d.table && (f(d, ["tbody"]), delete ce.tbody), e.TRUSTED_TYPES_POLICY) {
373
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
374
+ throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
375
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
376
+ throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
377
+ const r = L;
378
+ L = e.TRUSTED_TYPES_POLICY;
379
+ try {
380
+ $ = K("");
381
+ } catch (a) {
382
+ throw L = r, a;
383
+ }
384
+ } else e.TRUSTED_TYPES_POLICY === null ? (L = void 0, $ = "") : (L === void 0 && (L = Jt()), L && typeof $ == "string" && ($ = K("")));
385
+ O && O(e), ee = e;
386
+ }, bt = f({}, [...qe, ...Ke, ...Wn]), Ot = f({}, [...Ze, ...Yn]), Tn = function(e, t, r) {
387
+ return t.namespaceURI === k ? e === "svg" : t.namespaceURI === ye ? e === "svg" && (r === "annotation-xml" || Be[r]) : !!bt[e];
388
+ }, _n = function(e, t, r) {
389
+ return t.namespaceURI === k ? e === "math" : t.namespaceURI === Se ? e === "math" && We[r] : !!Ot[e];
390
+ }, hn = function(e, t, r) {
391
+ return t.namespaceURI === Se && !We[r] || t.namespaceURI === ye && !Be[r] ? !1 : !Ot[e] && (fn[e] || !bt[e]);
392
+ }, gn = function(e) {
393
+ let t = se(e);
394
+ (!t || !t.tagName) && (t = {
395
+ namespaceURI: Q,
396
+ tagName: "template"
397
+ });
398
+ const r = _e(e.tagName), a = _e(t.tagName);
399
+ return Ge[e.namespaceURI] ? e.namespaceURI === Se ? Tn(r, t, a) : e.namespaceURI === ye ? _n(r, t, a) : e.namespaceURI === k ? hn(r, t, a) : !!(fe === "application/xhtml+xml" && Ge[e.namespaceURI]) : !1;
400
+ }, B = function(e) {
401
+ ne(o.removed, {
402
+ element: e
403
+ });
404
+ try {
405
+ se(e).removeChild(e);
406
+ } catch {
407
+ if (tt(e), !se(e))
408
+ throw q("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
409
+ }
410
+ }, Rt = function(e) {
411
+ const t = ae(e);
412
+ if (t) {
413
+ const a = [];
414
+ me(t, (c) => {
415
+ ne(a, c);
416
+ }), me(a, (c) => {
417
+ try {
418
+ tt(c);
419
+ } catch {
420
+ }
421
+ });
422
+ }
423
+ const r = De(e);
424
+ if (r)
425
+ for (let a = r.length - 1; a >= 0; --a) {
426
+ const c = r[a], p = c && c.name;
427
+ if (typeof p == "string")
428
+ try {
429
+ e.removeAttribute(p);
430
+ } catch {
431
+ }
432
+ }
433
+ }, V = function(e, t) {
434
+ try {
435
+ ne(o.removed, {
436
+ attribute: t.getAttributeNode(e),
437
+ from: t
438
+ });
439
+ } catch {
440
+ ne(o.removed, {
441
+ attribute: null,
442
+ from: t
443
+ });
444
+ }
445
+ if (t.removeAttribute(e), e === "is")
446
+ if (Z || Ee)
447
+ try {
448
+ B(t);
449
+ } catch {
450
+ }
451
+ else
452
+ try {
453
+ t.setAttribute(e, "");
454
+ } catch {
455
+ }
456
+ }, En = function(e) {
457
+ const t = De(e);
458
+ if (t)
459
+ for (let r = t.length - 1; r >= 0; --r) {
460
+ const a = t[r], c = a && a.name;
461
+ if (!(typeof c != "string" || T[h(c)]))
462
+ try {
463
+ e.removeAttribute(c);
464
+ } catch {
465
+ }
466
+ }
467
+ }, An = function(e) {
468
+ const t = [e];
469
+ for (; t.length > 0; ) {
470
+ const r = t.pop();
471
+ (C ? C(r) : r.nodeType) === v.element && En(r);
472
+ const c = ae(r);
473
+ if (c)
474
+ for (let p = c.length - 1; p >= 0; --p)
475
+ t.push(c[p]);
476
+ }
477
+ }, Nt = function(e) {
478
+ let t = null, r = null;
479
+ if (ke)
480
+ e = "<remove></remove>" + e;
481
+ else {
482
+ const p = kt(e, /^[\r\n\t ]+/);
483
+ r = p && p[0];
484
+ }
485
+ fe === "application/xhtml+xml" && Q === k && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
486
+ const a = L ? K(e) : e;
487
+ if (Q === k)
488
+ try {
489
+ t = new Ie().parseFromString(a, fe);
490
+ } catch {
491
+ }
492
+ if (!t || !t.documentElement) {
493
+ t = we.createDocument(Q, "template", null);
494
+ try {
495
+ t.documentElement.innerHTML = He ? $ : a;
496
+ } catch {
497
+ }
498
+ }
499
+ const c = t.body || t.documentElement;
500
+ return e && r && c.insertBefore(s.createTextNode(r), c.childNodes[0] || null), Q === k ? en.call(t, X ? "html" : "body")[0] : X ? t.documentElement : c;
501
+ }, It = function(e) {
502
+ return it.call(
503
+ e.ownerDocument || e,
504
+ e,
505
+ // eslint-disable-next-line no-bitwise
506
+ w.SHOW_ELEMENT | w.SHOW_COMMENT | w.SHOW_TEXT | w.SHOW_PROCESSING_INSTRUCTION | w.SHOW_CDATA_SECTION,
507
+ null
508
+ );
509
+ }, be = function(e) {
510
+ return e = de(e, nn, " "), e = de(e, on, " "), e = de(e, rn, " "), e;
511
+ }, je = function(e) {
512
+ var t;
513
+ e.normalize();
514
+ const r = it.call(
515
+ e.ownerDocument || e,
516
+ e,
517
+ // eslint-disable-next-line no-bitwise
518
+ w.SHOW_TEXT | w.SHOW_COMMENT | w.SHOW_CDATA_SECTION | w.SHOW_PROCESSING_INSTRUCTION,
519
+ null
520
+ );
521
+ let a = r.nextNode();
522
+ for (; a; )
523
+ a.data = be(a.data), a = r.nextNode();
524
+ const c = (t = e.querySelectorAll) === null || t === void 0 ? void 0 : t.call(e, "template");
525
+ c && me(c, (p) => {
526
+ te(p.content) && je(p.content);
527
+ });
528
+ }, Oe = function(e) {
529
+ const t = z ? z(e) : null;
530
+ return typeof t != "string" || h(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
531
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
532
+ // makes the direct read diverge from the cached read; a clean form
533
+ // (same-realm OR foreign-realm) has both reads pointing at the same
534
+ // canonical NamedNodeMap.
535
+ e.attributes !== De(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
536
+ // returns the integer 1 for any Element regardless of realm; direct
537
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
538
+ // the named child element. Cheap addition — nodeType is read from
539
+ // an internal slot, no serialization cost — and removes a residual
540
+ // clobbering surface used by several mXSS / PI / comment branches
541
+ // in _sanitizeElements that compare currentNode.nodeType directly.
542
+ e.nodeType !== C(e) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
543
+ // "childNodes" shadows the prototype getter. Direct reads of
544
+ // form.childNodes from a clobbered form return the named child
545
+ // instead of the real NodeList, so any walk that reads it directly
546
+ // skips the form's real children. Compare the direct read to the
547
+ // cached Node.prototype getter — when the form's named-property
548
+ // getter intercepts the read, the two values differ and we flag
549
+ // the form. This catches every clobbering child type (input,
550
+ // select, etc.) regardless of whether the named child happens to
551
+ // carry a numeric .length, which a typeof-based probe would miss
552
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
553
+ e.childNodes !== ae(e);
554
+ }, te = function(e) {
555
+ if (!C || typeof e != "object" || e === null)
556
+ return !1;
557
+ try {
558
+ return C(e) === v.documentFragment;
559
+ } catch {
560
+ return !1;
561
+ }
562
+ }, pe = function(e) {
563
+ if (!C || typeof e != "object" || e === null)
564
+ return !1;
565
+ try {
566
+ return typeof C(e) == "number";
567
+ } catch {
568
+ return !1;
569
+ }
570
+ };
571
+ function F(i, e, t) {
572
+ i.length !== 0 && me(i, (r) => {
573
+ r.call(o, e, t, ee);
574
+ });
575
+ }
576
+ const yn = function(e, t) {
577
+ return !!(ue && e.hasChildNodes() && !pe(e.firstElementChild) && b(Yt, e.textContent) && b(Yt, e.innerHTML) || ue && e.namespaceURI === k && t === "style" && pe(e.firstElementChild) || e.nodeType === v.processingInstruction || ue && e.nodeType === v.comment && b(eo, e.data));
578
+ }, Sn = function(e, t) {
579
+ if (!ce[t] && wt(t) && (_.tagNameCheck instanceof RegExp && b(_.tagNameCheck, t) || _.tagNameCheck instanceof Function && _.tagNameCheck(t)))
580
+ return !1;
581
+ if (ve && !x[t]) {
582
+ const r = se(e), a = ae(e);
583
+ if (a && r) {
584
+ const c = a.length;
585
+ for (let p = c - 1; p >= 0; --p) {
586
+ const y = Ue ? a[p] : qt(a[p], !0);
587
+ r.insertBefore(y, Kt(e));
588
+ }
589
+ }
590
+ }
591
+ return B(e), !0;
592
+ }, Dt = function(e) {
593
+ if (F(g.beforeSanitizeElements, e, null), Oe(e))
594
+ return B(e), !0;
595
+ const t = h(z ? z(e) : e.nodeName);
596
+ if (F(g.uponSanitizeElement, e, {
597
+ tagName: t,
598
+ allowedTags: d
599
+ }), yn(e, t))
600
+ return B(e), !0;
601
+ if (ce[t] || !(H.tagCheck instanceof Function && H.tagCheck(t)) && !d[t])
602
+ return Sn(e, t);
603
+ if ((C ? C(e) : e.nodeType) === v.element && !gn(e) || (t === "noscript" || t === "noembed" || t === "noframes") && b(to, e.innerHTML))
604
+ return B(e), !0;
605
+ if (G && e.nodeType === v.text) {
606
+ const a = be(e.textContent);
607
+ e.textContent !== a && (ne(o.removed, {
608
+ element: e.cloneNode()
609
+ }), e.textContent = a);
610
+ }
611
+ return F(g.afterSanitizeElements, e, null), !1;
612
+ }, Lt = function(e, t, r) {
613
+ if (ut[t] || dt && (t === "id" || t === "name") && (r in s || r in dn))
614
+ return !1;
615
+ const a = T[t] || H.attributeCheck instanceof Function && H.attributeCheck(t, e);
616
+ if (!(Ce && b(an, t))) {
617
+ if (!(ft && b(sn, t))) {
618
+ if (a) {
619
+ if (!ze[t]) {
620
+ if (!b(st, de(r, at, ""))) {
621
+ if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && vt(r, "data:") === 0 && ht[e])) {
622
+ if (!(pt && !b(ln, de(r, at, "")))) {
623
+ if (r)
624
+ return !1;
625
+ }
626
+ }
627
+ }
628
+ }
629
+ } else if (
630
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
631
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
632
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
633
+ !(wt(e) && (_.tagNameCheck instanceof RegExp && b(_.tagNameCheck, e) || _.tagNameCheck instanceof Function && _.tagNameCheck(e)) && (_.attributeNameCheck instanceof RegExp && b(_.attributeNameCheck, t) || _.attributeNameCheck instanceof Function && _.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
634
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
635
+ t === "is" && _.allowCustomizedBuiltInElements && (_.tagNameCheck instanceof RegExp && b(_.tagNameCheck, r) || _.tagNameCheck instanceof Function && _.tagNameCheck(r)))
636
+ ) return !1;
637
+ }
638
+ }
639
+ return !0;
640
+ }, bn = f({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), wt = function(e) {
641
+ return !bn[_e(e)] && b(cn, e);
642
+ }, On = function(e, t, r, a) {
643
+ if (L && typeof he == "object" && typeof he.getAttributeType == "function" && !r)
644
+ switch (he.getAttributeType(e, t)) {
645
+ case "TrustedHTML":
646
+ return K(a);
647
+ case "TrustedScriptURL":
648
+ return Zt(a);
649
+ }
650
+ return a;
651
+ }, Rn = function(e, t, r, a) {
652
+ try {
653
+ r ? e.setAttributeNS(r, t, a) : e.setAttribute(t, a), Oe(e) ? B(e) : xt(o.removed);
654
+ } catch {
655
+ V(t, e);
656
+ }
657
+ }, Ct = function(e) {
658
+ F(g.beforeSanitizeAttributes, e, null);
659
+ const t = e.attributes;
660
+ if (!t || Oe(e))
661
+ return;
662
+ const r = {
663
+ attrName: "",
664
+ attrValue: "",
665
+ keepAttr: !0,
666
+ allowedAttributes: T,
667
+ forceKeepAttr: void 0
668
+ };
669
+ let a = t.length;
670
+ const c = h(e.nodeName);
671
+ for (; a--; ) {
672
+ const p = t[a], y = p.name, E = p.namespaceURI, M = p.value, P = h(y), Xe = M;
673
+ let I = y === "value" ? Xe : vn(Xe);
674
+ if (r.attrName = P, r.attrValue = I, r.keepAttr = !0, r.forceKeepAttr = void 0, F(g.uponSanitizeAttribute, e, r), I = r.attrValue, Tt && (P === "id" || P === "name") && vt(I, _t) !== 0 && (V(y, e), I = _t + I), ue && b(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, I)) {
675
+ V(y, e);
676
+ continue;
677
+ }
678
+ if (P === "attributename" && kt(I, "href")) {
679
+ V(y, e);
680
+ continue;
681
+ }
682
+ if (!r.forceKeepAttr) {
683
+ if (!r.keepAttr) {
684
+ V(y, e);
685
+ continue;
686
+ }
687
+ if (!mt && b(no, I)) {
688
+ V(y, e);
689
+ continue;
690
+ }
691
+ if (G && (I = be(I)), !Lt(c, P, I)) {
692
+ V(y, e);
693
+ continue;
694
+ }
695
+ I = On(c, P, E, I), I !== Xe && Rn(e, y, E, I);
696
+ }
697
+ }
698
+ F(g.afterSanitizeAttributes, e, null);
699
+ }, Re = function(e) {
700
+ let t = null;
701
+ const r = It(e);
702
+ for (F(g.beforeSanitizeShadowDOM, e, null); t = r.nextNode(); )
703
+ if (F(g.uponSanitizeShadowNode, t, null), Dt(t), Ct(t), te(t.content) && Re(t.content), (C ? C(t) : t.nodeType) === v.element) {
704
+ const c = nt(t);
705
+ te(c) && ($e(c), Re(c));
706
+ }
707
+ F(g.afterSanitizeShadowDOM, e, null);
708
+ }, $e = function(e) {
709
+ const t = [{
710
+ node: e,
711
+ shadow: null
712
+ }];
713
+ for (; t.length > 0; ) {
714
+ const r = t.pop();
715
+ if (r.shadow) {
716
+ Re(r.shadow);
717
+ continue;
718
+ }
719
+ const a = r.node, p = (C ? C(a) : a.nodeType) === v.element, y = ae(a);
720
+ if (y)
721
+ for (let E = y.length - 1; E >= 0; --E)
722
+ t.push({
723
+ node: y[E],
724
+ shadow: null
725
+ });
726
+ if (p) {
727
+ const E = z ? z(a) : null;
728
+ if (typeof E == "string" && h(E) === "template") {
729
+ const M = a.content;
730
+ te(M) && t.push({
731
+ node: M,
732
+ shadow: null
733
+ });
734
+ }
735
+ }
736
+ if (p) {
737
+ const E = nt(a);
738
+ te(E) && t.push({
739
+ node: null,
740
+ shadow: E
741
+ }, {
742
+ node: E,
743
+ shadow: null
744
+ });
745
+ }
746
+ }
747
+ };
748
+ return o.sanitize = function(i) {
749
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, r = null, a = null, c = null;
750
+ if (He = !i, He && (i = "<!-->"), typeof i != "string" && !pe(i) && (i = Gn(i), typeof i != "string"))
751
+ throw q("dirty is not a string, aborting");
752
+ if (!o.isSupported)
753
+ return i;
754
+ Me ? (d = Pe, T = xe) : Ye(e), (g.uponSanitizeElement.length > 0 || g.uponSanitizeAttribute.length > 0) && (d = D(d)), g.uponSanitizeAttribute.length > 0 && (T = D(T)), o.removed = [];
755
+ const p = Ue && typeof i != "string" && pe(i);
756
+ if (p) {
757
+ const M = z ? z(i) : i.nodeName;
758
+ if (typeof M == "string") {
759
+ const P = h(M);
760
+ if (!d[P] || ce[P])
761
+ throw q("root node is forbidden and cannot be sanitized in-place");
762
+ }
763
+ if (Oe(i))
764
+ throw q("root node is clobbered and cannot be sanitized in-place");
765
+ try {
766
+ $e(i);
767
+ } catch (P) {
768
+ throw Rt(i), P;
769
+ }
770
+ } else if (pe(i))
771
+ t = Nt("<!---->"), r = t.ownerDocument.importNode(i, !0), r.nodeType === v.element && r.nodeName === "BODY" || r.nodeName === "HTML" ? t = r : t.appendChild(r), $e(r);
772
+ else {
773
+ if (!Z && !G && !X && // eslint-disable-next-line unicorn/prefer-includes
774
+ i.indexOf("<") === -1)
775
+ return L && Ae ? K(i) : i;
776
+ if (t = Nt(i), !t)
777
+ return Z ? null : Ae ? $ : "";
778
+ }
779
+ t && ke && B(t.firstChild);
780
+ const y = It(p ? i : t);
781
+ try {
782
+ for (; a = y.nextNode(); )
783
+ Dt(a), Ct(a), te(a.content) && Re(a.content);
784
+ } catch (M) {
785
+ throw p && Rt(i), M;
786
+ }
787
+ if (p)
788
+ return me(o.removed, (M) => {
789
+ M.element && An(M.element);
790
+ }), G && je(i), i;
791
+ if (Z) {
792
+ if (G && je(t), Ee)
793
+ for (c = Qt.call(t.ownerDocument); t.firstChild; )
794
+ c.appendChild(t.firstChild);
795
+ else
796
+ c = t;
797
+ return (T.shadowroot || T.shadowrootmode) && (c = tn.call(l, c, !0)), c;
798
+ }
799
+ let E = X ? t.outerHTML : t.innerHTML;
800
+ return X && d["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && b(Jn, t.ownerDocument.doctype.name) && (E = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
801
+ ` + E), G && (E = be(E)), L && Ae ? K(E) : E;
802
+ }, o.setConfig = function() {
803
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
804
+ Ye(i), Me = !0, Pe = d, xe = T;
805
+ }, o.clearConfig = function() {
806
+ ee = null, Me = !1, Pe = null, xe = null, L = Le, $ = "";
807
+ }, o.isValidAttribute = function(i, e, t) {
808
+ ee || Ye({});
809
+ const r = h(i), a = h(e);
810
+ return Lt(r, a, t);
811
+ }, o.addHook = function(i, e) {
812
+ typeof e == "function" && S(g, i) && ne(g[i], e);
813
+ }, o.removeHook = function(i, e) {
814
+ if (S(g, i)) {
815
+ if (e !== void 0) {
816
+ const t = xn(g[i], e);
817
+ return t === -1 ? void 0 : kn(g[i], t, 1)[0];
818
+ }
819
+ return xt(g[i]);
820
+ }
821
+ }, o.removeHooks = function(i) {
822
+ S(g, i) && (g[i] = []);
823
+ }, o.removeAllHooks = function() {
824
+ g = jt();
825
+ }, o;
826
+ }
827
+ var io = Vt();
828
+ export {
829
+ io as default
830
+ };