@algorisys/yappydraw 0.8.278 → 0.8.283

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.
Files changed (46) hide show
  1. package/README.md +2 -2
  2. package/chunks/{AllPackages-DytsA6Gg.js → AllPackages-NXu9X6xl.js} +5 -5
  3. package/chunks/{BaseConfiguration-B0Un-ANd.js → BaseConfiguration-Cn1Beeg_.js} +3 -3
  4. package/chunks/{Entities-XwxJEcR3.js → Entities-DNDwR9nR.js} +1 -1
  5. package/chunks/{Factory-B4kWsy6c.js → Factory-hCmMrRZd.js} +8 -8
  6. package/chunks/{InputJax-DQpRzuU2.js → InputJax-BnvzjXPP.js} +1 -1
  7. package/chunks/PrioritizedList-CopFulOu.js +35 -0
  8. package/chunks/{TeXAtom-COgv6VHH.js → TeXAtom-i5HZ7jSY.js} +25 -25
  9. package/chunks/__vite-browser-external-BsdCVVos.js +110 -0
  10. package/chunks/_commonjsHelpers-DaMA6jEr.js +8 -0
  11. package/chunks/{canva-ai-7n8RQQlp.js → canva-ai-6uxuZ0PT.js} +8 -8
  12. package/chunks/{choice-dialog-state-DzWAU-Fv.js → choice-dialog-state-CTLAD7og.js} +1 -1
  13. package/chunks/{design-generator-AHGi1XTI.js → design-generator-l8Wo9SER.js} +1 -1
  14. package/chunks/{drawing-engine-DfKBHdTi.js → drawing-engine-BTqPTS30.js} +1 -1
  15. package/chunks/{drawings-store-Cyv-1e1L.js → drawings-store-B0h0XeLH.js} +19 -19
  16. package/chunks/{ds-operations-C9fmILbu.js → ds-operations-CvCIeybe.js} +1 -1
  17. package/chunks/{export-game-C1SNNfRf.js → export-game-CQ9VCQV9.js} +1 -1
  18. package/chunks/{game-runtime-ztkqHa3o.js → game-runtime-DGFlcZcF.js} +76 -76
  19. package/chunks/{html-CEj6ZeJc.js → html-BBKfobGE.js} +56 -55
  20. package/chunks/html2canvas.esm-BWVIUcAF.js +4802 -0
  21. package/chunks/{index-vjDu6_KH.js → index-D1ifHWAi.js} +15983 -12966
  22. package/chunks/index.es-Cmz4JyRm.js +6665 -0
  23. package/chunks/jspdf.es.min-rJE95jGX.js +9859 -0
  24. package/chunks/lcms-Car3bVu8.js +949 -0
  25. package/chunks/lcms-tShoQ1hy.js +4 -0
  26. package/chunks/{liteAdaptor-BZby1Qz2.js → liteAdaptor-DFCyQb98.js} +2 -2
  27. package/chunks/{lucide-solid-UJTMB-sy.js → lucide-solid-PB_pG8LH.js} +1 -1
  28. package/chunks/{markdown-to-slides-CKGVwM_7.js → markdown-to-slides-Ci06cYoT.js} +16 -16
  29. package/chunks/{mathjax-CnUrFnFS.js → mathjax-BPYOiwki.js} +1 -1
  30. package/chunks/{mathjax-D6cR72fZ.js → mathjax-BYK64638.js} +2 -2
  31. package/chunks/{morph-animator-D7JpZIyR.js → morph-animator-nKcVAyGw.js} +1 -1
  32. package/chunks/{onboarding-tour-DsN4nEFc.js → onboarding-tour-F8YlLQgf.js} +32 -32
  33. package/chunks/pdf-cmyk-CqVZV2FF.js +339 -0
  34. package/chunks/pdf-vector-hLlPZeLt.js +200 -0
  35. package/chunks/pdf-x-DBYFVbAz.js +220 -0
  36. package/chunks/purify.es-C2Qa7b4C.js +906 -0
  37. package/chunks/{search-qTCHUaUH.js → search-Nvw1qYCe.js} +2 -2
  38. package/chunks/{slide-generator-CoHxujzf.js → slide-generator-BwaWABSo.js} +8 -8
  39. package/chunks/{svg-B2urwbCV.js → svg-CGqKTjgw.js} +3 -3
  40. package/chunks/svg2pdf.es.min-BVaMJ-wC.js +2452 -0
  41. package/chunks/{tex-BTCIQDRb.js → tex-Cc_XKudY.js} +4 -4
  42. package/chunks/{turntable-ai-BEZd382K.js → turntable-ai-DyxE4d5_.js} +1 -1
  43. package/chunks/{yappy-NspTXSPk.css → yappy-FCQs01wv.css} +1 -1
  44. package/package.json +1 -1
  45. package/yappy.js +5 -5
  46. package/chunks/PrioritizedList-TjDg4i-s.js +0 -39
@@ -0,0 +1,906 @@
1
+ function Ye(r, i) {
2
+ (i == null || i > r.length) && (i = r.length);
3
+ for (var s = 0, c = Array(i); s < i; s++) c[s] = r[s];
4
+ return c;
5
+ }
6
+ function Hn(r) {
7
+ if (Array.isArray(r)) return r;
8
+ }
9
+ function Wn(r, i) {
10
+ var s = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
11
+ if (s != null) {
12
+ var c, f, d, y, st = [], I = !0, lt = !1;
13
+ try {
14
+ if (d = (s = s.call(r)).next, i !== 0) for (; !(I = (c = d.call(s)).done) && (st.push(c.value), st.length !== i); I = !0) ;
15
+ } catch (xt) {
16
+ lt = !0, f = xt;
17
+ } finally {
18
+ try {
19
+ if (!I && s.return != null && (y = s.return(), Object(y) !== y)) return;
20
+ } finally {
21
+ if (lt) throw f;
22
+ }
23
+ }
24
+ return st;
25
+ }
26
+ }
27
+ function Gn() {
28
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
29
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
30
+ }
31
+ function Bn(r, i) {
32
+ return Hn(r) || Wn(r, i) || Yn(r, i) || Gn();
33
+ }
34
+ function Yn(r, i) {
35
+ if (r) {
36
+ if (typeof r == "string") return Ye(r, i);
37
+ var s = {}.toString.call(r).slice(8, -1);
38
+ 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) ? Ye(r, i) : void 0;
39
+ }
40
+ }
41
+ const an = Object.entries, je = Object.setPrototypeOf, jn = Object.isFrozen, $n = Object.getPrototypeOf, Xn = Object.getOwnPropertyDescriptor;
42
+ let S = Object.freeze, b = Object.seal, it = Object.create, sn = typeof Reflect < "u" && Reflect, se = sn.apply, le = sn.construct;
43
+ S || (S = function(i) {
44
+ return i;
45
+ });
46
+ b || (b = function(i) {
47
+ return i;
48
+ });
49
+ se || (se = function(i, s) {
50
+ for (var c = arguments.length, f = new Array(c > 2 ? c - 2 : 0), d = 2; d < c; d++)
51
+ f[d - 2] = arguments[d];
52
+ return i.apply(s, f);
53
+ });
54
+ le || (le = function(i) {
55
+ for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
56
+ c[f - 1] = arguments[f];
57
+ return new i(...c);
58
+ });
59
+ const V = A(Array.prototype.forEach), Vn = A(Array.prototype.lastIndexOf), $e = A(Array.prototype.pop), dt = A(Array.prototype.push), qn = A(Array.prototype.splice), at = Array.isArray, _t = A(String.prototype.toLowerCase), ee = A(String.prototype.toString), Xe = A(String.prototype.match), Tt = A(String.prototype.replace), Ve = A(String.prototype.indexOf), Kn = A(String.prototype.trim), Zn = A(Number.prototype.toString), Jn = A(Boolean.prototype.toString), qe = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), Ke = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), N = A(Object.prototype.hasOwnProperty), ht = A(Object.prototype.toString), O = A(RegExp.prototype.test), X = Qn(TypeError);
60
+ function A(r) {
61
+ return function(i) {
62
+ i instanceof RegExp && (i.lastIndex = 0);
63
+ for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
64
+ c[f - 1] = arguments[f];
65
+ return se(r, i, c);
66
+ };
67
+ }
68
+ function Qn(r) {
69
+ return function() {
70
+ for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)
71
+ s[c] = arguments[c];
72
+ return le(r, s);
73
+ };
74
+ }
75
+ function p(r, i) {
76
+ let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
77
+ if (je && je(r, null), !at(i))
78
+ return r;
79
+ let c = i.length;
80
+ for (; c--; ) {
81
+ let f = i[c];
82
+ if (typeof f == "string") {
83
+ const d = s(f);
84
+ d !== f && (jn(i) || (i[c] = d), f = d);
85
+ }
86
+ r[f] = !0;
87
+ }
88
+ return r;
89
+ }
90
+ function to(r) {
91
+ for (let i = 0; i < r.length; i++)
92
+ N(r, i) || (r[i] = null);
93
+ return r;
94
+ }
95
+ function C(r) {
96
+ const i = it(null);
97
+ for (const c of an(r)) {
98
+ var s = Bn(c, 2);
99
+ const f = s[0], d = s[1];
100
+ N(r, f) && (at(d) ? i[f] = to(d) : d && typeof d == "object" && d.constructor === Object ? i[f] = C(d) : i[f] = d);
101
+ }
102
+ return i;
103
+ }
104
+ function eo(r) {
105
+ switch (typeof r) {
106
+ case "string":
107
+ return r;
108
+ case "number":
109
+ return Zn(r);
110
+ case "boolean":
111
+ return Jn(r);
112
+ case "bigint":
113
+ return qe ? qe(r) : "0";
114
+ case "symbol":
115
+ return Ke ? Ke(r) : "Symbol()";
116
+ case "undefined":
117
+ return ht(r);
118
+ case "function":
119
+ case "object": {
120
+ if (r === null)
121
+ return ht(r);
122
+ const i = r, s = P(i, "toString");
123
+ if (typeof s == "function") {
124
+ const c = s(i);
125
+ return typeof c == "string" ? c : ht(c);
126
+ }
127
+ return ht(r);
128
+ }
129
+ default:
130
+ return ht(r);
131
+ }
132
+ }
133
+ function P(r, i) {
134
+ for (; r !== null; ) {
135
+ const c = Xn(r, i);
136
+ if (c) {
137
+ if (c.get)
138
+ return A(c.get);
139
+ if (typeof c.value == "function")
140
+ return A(c.value);
141
+ }
142
+ r = $n(r);
143
+ }
144
+ function s() {
145
+ return null;
146
+ }
147
+ return s;
148
+ }
149
+ function no(r) {
150
+ try {
151
+ return O(r, ""), !0;
152
+ } catch {
153
+ return !1;
154
+ }
155
+ }
156
+ const Ze = 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"]), oo = 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"]), ro = S(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Je = S(["#text"]), Qe = 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"]), tn = 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"]), io = b(/{{[\w\W]*|^[\w\W]*}}/g), ao = b(/<%[\w\W]*|^[\w\W]*%>/g), so = b(/\${[\w\W]*/g), lo = b(/^data-[\-\w.\u00B7-\uFFFF]+$/), co = b(/^aria-[\-\w]+$/), en = b(
157
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
158
+ // eslint-disable-line no-useless-escape
159
+ ), uo = b(/^(?:\w+script|data):/i), fo = b(
160
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
161
+ // eslint-disable-line no-control-regex
162
+ ), po = b(/^html$/i), mo = b(/^[a-z][.\w]*(-[.\w]+)+$/i), nn = b(/<[/\w!]/g), on = b(/<[/\w]/g), To = b(/<\/no(script|embed|frames)/i), ho = b(/\/>/i), M = {
163
+ element: 1,
164
+ attribute: 2,
165
+ text: 3,
166
+ cdataSection: 4,
167
+ entityReference: 5,
168
+ // Deprecated
169
+ entityNode: 6,
170
+ // Deprecated
171
+ processingInstruction: 7,
172
+ comment: 8,
173
+ document: 9,
174
+ documentType: 10,
175
+ documentFragment: 11,
176
+ notation: 12
177
+ // Deprecated
178
+ }, ln = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"], _o = S(p({}, ln)), go = (function() {
179
+ const r = {};
180
+ return V(ln, (i) => {
181
+ r[i] = b(new RegExp("</" + i + "(?=[\\t\\n\\f\\r />])", "i"));
182
+ }), S(r);
183
+ })(), Eo = function() {
184
+ return typeof window > "u" ? null : window;
185
+ }, Ao = function(i, s) {
186
+ if (typeof i != "object" || typeof i.createPolicy != "function")
187
+ return null;
188
+ let c = null;
189
+ const f = "data-tt-policy-suffix";
190
+ s && s.hasAttribute(f) && (c = s.getAttribute(f));
191
+ const d = "dompurify" + (c ? "#" + c : "");
192
+ try {
193
+ return i.createPolicy(d, {
194
+ createHTML(y) {
195
+ return y;
196
+ },
197
+ createScriptURL(y) {
198
+ return y;
199
+ }
200
+ });
201
+ } catch {
202
+ return console.warn("TrustedTypes policy " + d + " could not be created."), null;
203
+ }
204
+ }, rn = function() {
205
+ return {
206
+ afterSanitizeAttributes: [],
207
+ afterSanitizeElements: [],
208
+ afterSanitizeShadowDOM: [],
209
+ beforeSanitizeAttributes: [],
210
+ beforeSanitizeElements: [],
211
+ beforeSanitizeShadowDOM: [],
212
+ uponSanitizeAttribute: [],
213
+ uponSanitizeElement: [],
214
+ uponSanitizeShadowNode: []
215
+ };
216
+ }, W = function(i, s, c, f) {
217
+ return N(i, s) && at(i[s]) ? p(f.base ? C(f.base) : {}, i[s], f.transform) : c;
218
+ }, ae = function(i, s, c) {
219
+ const f = N(i, s) ? i[s] : void 0;
220
+ return f && typeof f == "object" ? C(f) : c();
221
+ };
222
+ function cn() {
223
+ let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Eo();
224
+ const i = (o) => cn(o);
225
+ if (i.version = "3.4.15", i.removed = [], !r || !r.document || r.document.nodeType !== M.document || !r.Element)
226
+ return i.isSupported = !1, i;
227
+ let s = r.document;
228
+ const c = s, f = c.currentScript;
229
+ r.DocumentFragment;
230
+ const d = r.HTMLTemplateElement, y = r.Node, st = r.Element, I = r.NodeFilter, lt = r.NamedNodeMap;
231
+ lt === void 0 && (r.NamedNodeMap || r.MozNamedAttrMap), r.HTMLFormElement;
232
+ const xt = r.DOMParser, gt = r.trustedTypes, U = st.prototype, un = P(U, "cloneNode"), vt = P(U, "remove"), ce = P(U, "removeAttributeNode"), fn = P(U, "nextSibling"), q = P(U, "childNodes"), K = P(U, "parentNode"), ue = P(U, "shadowRoot"), kt = P(U, "attributes"), G = 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) {
233
+ return G ? G(t) : t.nodeType;
234
+ }, Ut = function(t) {
235
+ return Z ? Z(t) : t.nodeName;
236
+ };
237
+ if (typeof d == "function") {
238
+ const o = s.createElement("template");
239
+ o.content && o.content.ownerDocument && (s = o.content.ownerDocument);
240
+ }
241
+ let L, B = "", Ft, fe = !1, ut = 0;
242
+ const pe = function() {
243
+ if (ut > 0)
244
+ 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.');
245
+ }, J = function(t) {
246
+ pe(), ut++;
247
+ try {
248
+ return L.createHTML(t);
249
+ } finally {
250
+ ut--;
251
+ }
252
+ }, pn = function(t) {
253
+ pe(), ut++;
254
+ try {
255
+ return L.createScriptURL(t);
256
+ } finally {
257
+ ut--;
258
+ }
259
+ }, mn = function() {
260
+ return fe || (Ft = Ao(gt, f), fe = !0), Ft;
261
+ }, At = s, zt = At.implementation, me = At.createNodeIterator, dn = At.createDocumentFragment, Tn = At.getElementsByTagName, hn = c.importNode;
262
+ let T = rn();
263
+ i.isSupported = typeof an == "function" && typeof K == "function" && zt && zt.createHTMLDocument !== void 0;
264
+ const _n = io, gn = ao, En = so, An = lo, yn = co, Sn = uo, de = fo, bn = mo;
265
+ let Te = en, h = null;
266
+ const Ht = p({}, [...Ze, ...ne, ...oe, ...re, ...Je]);
267
+ let _ = null;
268
+ const Wt = p({}, [...Qe, ...ie, ...tn, ...Pt]);
269
+ let x = Object.seal(it(null, {
270
+ tagNameCheck: {
271
+ writable: !0,
272
+ configurable: !1,
273
+ enumerable: !0,
274
+ value: null
275
+ },
276
+ attributeNameCheck: {
277
+ writable: !0,
278
+ configurable: !1,
279
+ enumerable: !0,
280
+ value: null
281
+ },
282
+ allowCustomizedBuiltInElements: {
283
+ writable: !0,
284
+ configurable: !1,
285
+ enumerable: !0,
286
+ value: !1
287
+ }
288
+ })), ft = null, he = null;
289
+ const F = Object.seal(it(null, {
290
+ tagCheck: {
291
+ writable: !0,
292
+ configurable: !1,
293
+ enumerable: !0,
294
+ value: null
295
+ },
296
+ attributeCheck: {
297
+ writable: !0,
298
+ configurable: !1,
299
+ enumerable: !0,
300
+ value: null
301
+ }
302
+ }));
303
+ let _e = !0, Gt = !0, ge = !1, Ee = !0, z = !1, Y = !0, j = !1, Bt = !1, yt = null, St = null, Yt = !1, Q = !1, bt = !1, Ot = !1, Ae = !0, ye = !1;
304
+ const Se = "user-content-";
305
+ let jt = !0, $t = !1, tt = {}, et = null;
306
+ const be = p({}, [
307
+ "annotation-xml",
308
+ "audio",
309
+ "colgroup",
310
+ "desc",
311
+ "foreignobject",
312
+ "head",
313
+ "iframe",
314
+ "math",
315
+ "mi",
316
+ "mn",
317
+ "mo",
318
+ "ms",
319
+ "mtext",
320
+ "noembed",
321
+ "noframes",
322
+ "noscript",
323
+ "plaintext",
324
+ "script",
325
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
326
+ // the UA (customizable <select>) — including any on* handlers — and the
327
+ // engine re-mirrors synchronously whenever a removal changes which
328
+ // option/selectedcontent is current, even inside DOMPurify's inert
329
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
330
+ // mirror target ahead of the walk, which the engine refills, looping
331
+ // forever (DoS) and amplifying output. Dropping its content on removal
332
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
333
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
334
+ "selectedcontent",
335
+ "style",
336
+ "svg",
337
+ "template",
338
+ "thead",
339
+ "title",
340
+ "video",
341
+ "xmp"
342
+ ]);
343
+ let Oe = null;
344
+ const Re = p({}, ["audio", "video", "img", "source", "image", "track"]);
345
+ let Le = null;
346
+ const De = 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";
347
+ let nt = v, Xt = !1, Vt = null;
348
+ const On = p({}, [Rt, Lt, v], ee), we = S(["mi", "mo", "mn", "ms", "mtext"]);
349
+ let qt = p({}, we);
350
+ const Ne = S(["annotation-xml"]);
351
+ let Kt = p({}, Ne);
352
+ const Rn = p({}, ["title", "style", "font", "a", "script"]);
353
+ let pt = null;
354
+ const Ln = ["application/xhtml+xml", "text/html"], Dn = "text/html";
355
+ let E = null, ot = null;
356
+ const wn = s.createElement("form"), Ie = function(t) {
357
+ return t instanceof RegExp || t instanceof Function;
358
+ }, Zt = function() {
359
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
360
+ if (ot && ot === t)
361
+ return;
362
+ (!t || typeof t != "object") && (t = {}), t = C(t), pt = // eslint-disable-next-line unicorn/prefer-includes
363
+ Ln.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Dn : t.PARSER_MEDIA_TYPE, E = pt === "application/xhtml+xml" ? ee : _t, h = W(t, "ALLOWED_TAGS", Ht, {
364
+ transform: E
365
+ }), _ = W(t, "ALLOWED_ATTR", Wt, {
366
+ transform: E
367
+ }), Vt = W(t, "ALLOWED_NAMESPACES", On, {
368
+ transform: ee
369
+ }), Le = W(t, "ADD_URI_SAFE_ATTR", De, {
370
+ transform: E,
371
+ base: De
372
+ }), Oe = W(t, "ADD_DATA_URI_TAGS", Re, {
373
+ transform: E,
374
+ base: Re
375
+ }), et = W(t, "FORBID_CONTENTS", be, {
376
+ transform: E
377
+ }), ft = W(t, "FORBID_TAGS", C({}), {
378
+ transform: E
379
+ }), he = W(t, "FORBID_ATTR", C({}), {
380
+ transform: E
381
+ }), tt = N(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? C(t.USE_PROFILES) : t.USE_PROFILES : !1, _e = t.ALLOW_ARIA_ATTR !== !1, Gt = t.ALLOW_DATA_ATTR !== !1, ge = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Ee = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, z = 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, Ae = t.SANITIZE_DOM !== !1, ye = t.SANITIZE_NAMED_PROPS || !1, jt = t.KEEP_CONTENT !== !1, $t = t.IN_PLACE || !1, Te = no(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : en, nt = typeof t.NAMESPACE == "string" ? t.NAMESPACE : v, qt = ae(
382
+ t,
383
+ "MATHML_TEXT_INTEGRATION_POINTS",
384
+ () => p({}, we)
385
+ // Default built-in map
386
+ ), Kt = ae(
387
+ t,
388
+ "HTML_INTEGRATION_POINTS",
389
+ () => p({}, Ne)
390
+ // Default built-in map
391
+ );
392
+ const e = ae(t, "CUSTOM_ELEMENT_HANDLING", () => it(null));
393
+ if (x = it(null), N(e, "tagNameCheck") && Ie(e.tagNameCheck) && (x.tagNameCheck = e.tagNameCheck), N(e, "attributeNameCheck") && Ie(e.attributeNameCheck) && (x.attributeNameCheck = e.attributeNameCheck), N(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (x.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), b(x), z && (Gt = !1), bt && (Q = !0), tt && (h = p({}, Je), _ = it(null), tt.html === !0 && (p(h, Ze), p(_, Qe)), 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(_, tn), p(_, Pt))), F.tagCheck = null, F.attributeCheck = null, N(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? F.tagCheck = t.ADD_TAGS : at(t.ADD_TAGS) && (h === Ht && (h = C(h)), p(h, t.ADD_TAGS, E))), N(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? F.attributeCheck = t.ADD_ATTR : at(t.ADD_ATTR) && (_ === Wt && (_ = C(_)), p(_, t.ADD_ATTR, E))), N(t, "ADD_FORBID_CONTENTS") && at(t.ADD_FORBID_CONTENTS) && (et === be && (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) {
394
+ if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
395
+ throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
396
+ if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
397
+ throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
398
+ const n = L;
399
+ L = t.TRUSTED_TYPES_POLICY;
400
+ try {
401
+ B = J("");
402
+ } catch (a) {
403
+ throw L = n, a;
404
+ }
405
+ } else t.TRUSTED_TYPES_POLICY === null ? (L = void 0, B = "") : (L === void 0 && (L = mn()), L && typeof B == "string" && (B = J("")));
406
+ S && S(t), ot = t;
407
+ }, Me = p({}, [...ne, ...oe, ...oo]), Ce = p({}, [...re, ...ro]), Nn = function(t, e, n) {
408
+ return e.namespaceURI === v ? t === "svg" : e.namespaceURI === Rt ? t === "svg" && (n === "annotation-xml" || qt[n]) : !!Me[t];
409
+ }, In = function(t, e, n) {
410
+ return e.namespaceURI === v ? t === "math" : e.namespaceURI === Lt ? t === "math" && Kt[n] : !!Ce[t];
411
+ }, Mn = function(t, e, n) {
412
+ return e.namespaceURI === Lt && !Kt[n] || e.namespaceURI === Rt && !qt[n] ? !1 : !Ce[t] && (Rn[t] || !Me[t]);
413
+ }, Cn = function(t) {
414
+ let e = K(t);
415
+ (!e || !e.tagName) && (e = {
416
+ namespaceURI: nt,
417
+ tagName: "template"
418
+ });
419
+ const n = _t(t.tagName), a = _t(e.tagName);
420
+ return Vt[t.namespaceURI] ? t.namespaceURI === Lt ? Nn(n, e, a) : t.namespaceURI === Rt ? In(n, e, a) : t.namespaceURI === v ? Mn(n, e, a) : !!(pt === "application/xhtml+xml" && Vt[t.namespaceURI]) : !1;
421
+ }, H = function(t) {
422
+ dt(i.removed, {
423
+ element: t
424
+ });
425
+ try {
426
+ K(t).removeChild(t);
427
+ } catch {
428
+ if (vt(t), !K(t))
429
+ throw X("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
430
+ }
431
+ }, Pe = function(t, e, n) {
432
+ try {
433
+ ce(t, e);
434
+ } catch {
435
+ try {
436
+ t.removeAttribute(n);
437
+ } catch {
438
+ }
439
+ }
440
+ }, Dt = function(t) {
441
+ wt(t);
442
+ const e = q(t);
443
+ if (e) {
444
+ const a = [];
445
+ V(e, (l) => {
446
+ dt(a, l);
447
+ }), V(a, (l) => {
448
+ try {
449
+ vt(l);
450
+ } catch {
451
+ }
452
+ });
453
+ }
454
+ const n = kt(t);
455
+ if (n)
456
+ for (let a = n.length - 1; a >= 0; --a) {
457
+ const l = n[a], u = l && l.name;
458
+ typeof u == "string" && Pe(t, l, u);
459
+ }
460
+ }, $ = function(t, e, n) {
461
+ if (!n)
462
+ try {
463
+ n = e.getAttributeNode(t);
464
+ } catch {
465
+ n = null;
466
+ }
467
+ dt(i.removed, {
468
+ attribute: n || null,
469
+ from: e
470
+ });
471
+ try {
472
+ n ? ce(e, n) : e.removeAttribute(t);
473
+ } catch {
474
+ try {
475
+ e.removeAttribute(t);
476
+ } catch {
477
+ }
478
+ }
479
+ if (t === "is")
480
+ if (Q || bt)
481
+ try {
482
+ H(e);
483
+ } catch {
484
+ }
485
+ else
486
+ try {
487
+ e.setAttribute(t, "");
488
+ } catch {
489
+ }
490
+ }, Pn = function(t) {
491
+ const e = kt(t);
492
+ if (e)
493
+ for (let n = e.length - 1; n >= 0; --n) {
494
+ const a = e[n], l = a && a.name;
495
+ typeof l != "string" || _[E(l)] || Pe(t, a, l);
496
+ }
497
+ }, wt = function(t) {
498
+ const e = [t];
499
+ for (; e.length > 0; ) {
500
+ const n = e.pop();
501
+ ct(n) === M.element && Pn(n);
502
+ const l = q(n);
503
+ if (l)
504
+ for (let u = l.length - 1; u >= 0; --u)
505
+ e.push(l[u]);
506
+ }
507
+ }, xe = function(t, e) {
508
+ return Y ? t === "patchsrc" ? !0 : t === "for" && e !== "label" && e !== "output" : !1;
509
+ }, xn = function(t) {
510
+ if (!Y)
511
+ return;
512
+ const e = [t];
513
+ for (; e.length > 0; ) {
514
+ const n = e.pop(), a = ct(n);
515
+ if (a === M.processingInstruction || a === M.comment && O(on, n.data)) {
516
+ try {
517
+ vt(n);
518
+ } catch {
519
+ }
520
+ continue;
521
+ }
522
+ if (a === M.element) {
523
+ const u = n, m = E(Ut(n));
524
+ try {
525
+ u.hasAttribute && u.hasAttribute("patchsrc") && u.removeAttribute("patchsrc"), u.hasAttribute && u.hasAttribute("for") && xe("for", m) && u.removeAttribute("for");
526
+ } catch {
527
+ }
528
+ }
529
+ const l = q(n);
530
+ if (l)
531
+ for (let u = l.length - 1; u >= 0; --u)
532
+ e.push(l[u]);
533
+ }
534
+ }, ve = function(t) {
535
+ let e = null, n = null;
536
+ if (Yt)
537
+ t = "<remove></remove>" + t;
538
+ else {
539
+ const u = Xe(t, /^[\r\n\t ]+/);
540
+ n = u && u[0];
541
+ }
542
+ pt === "application/xhtml+xml" && nt === v && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
543
+ const a = L ? J(t) : t;
544
+ if (nt === v)
545
+ try {
546
+ e = new xt().parseFromString(a, pt);
547
+ } catch {
548
+ }
549
+ if (!e || !e.documentElement) {
550
+ e = zt.createDocument(nt, "template", null);
551
+ try {
552
+ e.documentElement.innerHTML = Xt ? B : a;
553
+ } catch {
554
+ }
555
+ }
556
+ const l = e.body || e.documentElement;
557
+ return t && n && l.insertBefore(s.createTextNode(n), l.childNodes[0] || null), nt === v ? Tn.call(e, j ? "html" : "body")[0] : j ? e.documentElement : l;
558
+ }, ke = function(t) {
559
+ const e = Et ? Et(t) : t.ownerDocument;
560
+ return me.call(
561
+ e || t,
562
+ t,
563
+ // eslint-disable-next-line no-bitwise
564
+ I.SHOW_ELEMENT | I.SHOW_COMMENT | I.SHOW_TEXT | I.SHOW_PROCESSING_INSTRUCTION | I.SHOW_CDATA_SECTION,
565
+ null
566
+ );
567
+ }, Nt = function(t) {
568
+ return t = Tt(t, _n, " "), t = Tt(t, gn, " "), t = Tt(t, En, " "), t;
569
+ }, Jt = function(t) {
570
+ var e;
571
+ t.normalize();
572
+ const n = Et ? Et(t) : t.ownerDocument, a = me.call(
573
+ n || t,
574
+ t,
575
+ // eslint-disable-next-line no-bitwise
576
+ I.SHOW_TEXT | I.SHOW_COMMENT | I.SHOW_CDATA_SECTION | I.SHOW_PROCESSING_INSTRUCTION,
577
+ null
578
+ );
579
+ let l = a.nextNode();
580
+ for (; l; )
581
+ l.data = Nt(l.data), l = a.nextNode();
582
+ const u = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
583
+ u && V(u, (m) => {
584
+ rt(m.content) && Jt(m.content);
585
+ });
586
+ }, It = function(t) {
587
+ const e = Z ? Z(t) : null;
588
+ 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
589
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
590
+ // makes the direct read diverge from the cached read; a clean form
591
+ // (same-realm OR foreign-realm) has both reads pointing at the same
592
+ // canonical NamedNodeMap.
593
+ t.attributes !== kt(t) || typeof t.removeAttribute != "function" || // A form descendant named "removeAttributeNode" or "getAttributeNode"
594
+ // shadows these Attr-node methods via [LegacyOverrideBuiltIns].
595
+ // _removeAttribute() / _stripAttributeNode() reach for
596
+ // element.removeAttributeNode(attr) first; when it is shadowed the call
597
+ // throws and the name-based fallback element.removeAttribute(name)
598
+ // ASCII-lowercases its lookup key in an HTML document, silently missing
599
+ // a case-preserved event-handler attribute (e.g. an ONANIMATIONSTART
600
+ // that reached the sanitizer through an XML/XHTML parse). Flag the form
601
+ // so it is removed wholesale, exactly as for the other shadowed methods.
602
+ 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
603
+ // returns the integer 1 for any Element regardless of realm; direct
604
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
605
+ // the named child element. Cheap addition — nodeType is read from
606
+ // an internal slot, no serialization cost — and removes a residual
607
+ // clobbering surface used by several mXSS / PI / comment branches
608
+ // in _sanitizeElements that compare currentNode.nodeType directly.
609
+ t.nodeType !== G(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
610
+ // "childNodes" shadows the prototype getter. Direct reads of
611
+ // form.childNodes from a clobbered form return the named child
612
+ // instead of the real NodeList, so any walk that reads it directly
613
+ // skips the form's real children. Compare the direct read to the
614
+ // cached Node.prototype getter — when the form's named-property
615
+ // getter intercepts the read, the two values differ and we flag
616
+ // the form. This catches every clobbering child type (input,
617
+ // select, etc.) regardless of whether the named child happens to
618
+ // carry a numeric .length, which a typeof-based probe would miss
619
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
620
+ t.childNodes !== q(t);
621
+ }, rt = function(t) {
622
+ if (!G || typeof t != "object" || t === null)
623
+ return !1;
624
+ try {
625
+ return G(t) === M.documentFragment;
626
+ } catch {
627
+ return !1;
628
+ }
629
+ }, mt = function(t) {
630
+ if (!G || typeof t != "object" || t === null)
631
+ return !1;
632
+ try {
633
+ return typeof G(t) == "number";
634
+ } catch {
635
+ return !1;
636
+ }
637
+ };
638
+ function k(o, t, e) {
639
+ o.length !== 0 && V(o, (n) => {
640
+ n.call(i, t, e, ot);
641
+ });
642
+ }
643
+ const vn = function(t, e) {
644
+ return !!(Y && t.hasChildNodes() && !mt(t.firstElementChild) && O(nn, t.textContent) && O(nn, t.innerHTML) || Y && t.namespaceURI === v && _o[e] && (mt(t.firstElementChild) || typeof t.textContent == "string" && O(go[e], t.textContent)) || t.nodeType === M.processingInstruction || Y && t.nodeType === M.comment && O(on, t.data));
645
+ }, Mt = function(t, e) {
646
+ if (t instanceof RegExp)
647
+ return O(t, e);
648
+ if (t instanceof Function) {
649
+ for (var n = arguments.length, a = new Array(n > 2 ? n - 2 : 0), l = 2; l < n; l++)
650
+ a[l - 2] = arguments[l];
651
+ return !!t(e, ...a);
652
+ }
653
+ return !1;
654
+ }, kn = function(t, e, n) {
655
+ if (!ft[e] && We(e) && Mt(x.tagNameCheck, e))
656
+ return !1;
657
+ if (jt && !et[e]) {
658
+ const a = K(t), l = q(t);
659
+ if (l && a) {
660
+ const u = l.length;
661
+ for (let m = u - 1; m >= 0; --m) {
662
+ const g = t === n ? un(l[m], !0) : l[m];
663
+ a.insertBefore(g, fn(t));
664
+ }
665
+ }
666
+ }
667
+ return H(t), !0;
668
+ }, Ue = function(t, e, n, a) {
669
+ return t.length === 0 ? e : e === n || e === a ? C(e) : e;
670
+ }, Fe = function(t, e) {
671
+ return t === e || K(t) !== null ? !1 : ($t && wt(t), !0);
672
+ }, ze = function(t, e) {
673
+ if (k(T.beforeSanitizeElements, t, null), Fe(t, e))
674
+ return !0;
675
+ if (It(t))
676
+ return H(t), !0;
677
+ const n = E(Ut(t));
678
+ if (h = Ue(T.uponSanitizeElement, h, Ht, yt), k(T.uponSanitizeElement, t, {
679
+ tagName: n,
680
+ allowedTags: h
681
+ }), Fe(t, e))
682
+ return !0;
683
+ if (vn(t, n))
684
+ return H(t), !0;
685
+ if (ft[n] || !(F.tagCheck instanceof Function && F.tagCheck(n)) && !h[n]) {
686
+ const l = kn(t, n, e);
687
+ return l === !1 && k(T.afterSanitizeElements, t, null), l;
688
+ }
689
+ if (ct(t) === M.element && !Cn(t) || (n === "noscript" || n === "noembed" || n === "noframes") && O(To, t.innerHTML))
690
+ return H(t), !0;
691
+ if (z && t.nodeType === M.text) {
692
+ const l = Nt(t.textContent);
693
+ t.textContent !== l && (dt(i.removed, {
694
+ element: t.cloneNode()
695
+ }), t.textContent = l);
696
+ }
697
+ return k(T.afterSanitizeElements, t, null), !1;
698
+ }, He = function(t, e, n) {
699
+ if (he[e] || xe(e, t) || Ae && (e === "id" || e === "name") && (n in s || n in wn))
700
+ return !1;
701
+ const a = _[e] || F.attributeCheck instanceof Function && F.attributeCheck(e, t);
702
+ return Gt && O(An, e) || _e && O(yn, e) ? !0 : a ? Le[e] || O(Te, Tt(n, de, "")) || (e === "src" || e === "xlink:href" || e === "href") && t !== "script" && Ve(n, "data:") === 0 && Oe[t] || ge && !O(Sn, Tt(n, de, "")) ? !0 : !n : (
703
+ // Condition a) covers a basically valid custom element tag name whose
704
+ // tag passes the configured tagNameCheck and whose attribute name
705
+ // passes the configured attributeNameCheck ...
706
+ We(t) && Mt(x.tagNameCheck, t) && Mt(x.attributeNameCheck, e, t) || // Condition b) covers an `is` attribute whose value passes the
707
+ // configured tagNameCheck while customized built-in elements are
708
+ // allowed.
709
+ e === "is" && x.allowCustomizedBuiltInElements && Mt(x.tagNameCheck, n)
710
+ );
711
+ }, Un = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), We = function(t) {
712
+ return !Un[_t(t)] && O(bn, t);
713
+ }, Fn = function(t, e, n, a) {
714
+ if (L && typeof gt == "object" && typeof gt.getAttributeType == "function" && !n)
715
+ switch (gt.getAttributeType(t, e)) {
716
+ case "TrustedHTML":
717
+ return J(a);
718
+ case "TrustedScriptURL":
719
+ return pn(a);
720
+ }
721
+ return a;
722
+ }, zn = function(t, e, n, a) {
723
+ try {
724
+ return n ? t.setAttributeNS(n, e, a) : t.setAttribute(e, a), It(t) ? (H(t), !1) : !0;
725
+ } catch {
726
+ return $(e, t), !1;
727
+ }
728
+ }, Ge = function(t) {
729
+ k(T.beforeSanitizeAttributes, t, null);
730
+ const e = t.attributes;
731
+ if (!e || It(t))
732
+ return;
733
+ _ = Ue(T.uponSanitizeAttribute, _, Wt, St);
734
+ const n = {
735
+ attrName: "",
736
+ attrValue: "",
737
+ keepAttr: !0,
738
+ allowedAttributes: _,
739
+ forceKeepAttr: void 0
740
+ };
741
+ let a = e.length;
742
+ const l = E(t.nodeName);
743
+ for (; a--; ) {
744
+ const u = e[a], m = u.name, g = u.namespaceURI, D = u.value, w = E(m), te = D;
745
+ let R = m === "value" ? te : Kn(te), Be = !1;
746
+ if (n.attrName = w, n.attrValue = R, n.keepAttr = !0, n.forceKeepAttr = void 0, k(T.uponSanitizeAttribute, t, n), R = n.attrValue, ye && (w === "id" || w === "name") && Ve(R, Se) !== 0 && ($(m, t, u), R = Se + R, Be = !0), Y && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
747
+ $(m, t, u);
748
+ continue;
749
+ }
750
+ if (w === "attributename" && Xe(R, "href")) {
751
+ $(m, t, u);
752
+ continue;
753
+ }
754
+ if (!n.forceKeepAttr) {
755
+ if (!n.keepAttr) {
756
+ $(m, t, u);
757
+ continue;
758
+ }
759
+ if (!Ee && O(ho, R)) {
760
+ $(m, t, u);
761
+ continue;
762
+ }
763
+ if (z && (R = Nt(R)), !He(l, w, R)) {
764
+ $(m, t, u);
765
+ continue;
766
+ }
767
+ R = Fn(l, w, g, R), R !== te && zn(t, m, g, R) && Be && $e(i.removed);
768
+ }
769
+ }
770
+ k(T.afterSanitizeAttributes, t, null);
771
+ }, Ct = function(t) {
772
+ let e = null;
773
+ const n = ke(t);
774
+ for (k(T.beforeSanitizeShadowDOM, t, null); e = n.nextNode(); )
775
+ if (k(T.uponSanitizeShadowNode, e, null), ze(e, t), Ge(e), rt(e.content) && Ct(e.content), ct(e) === M.element) {
776
+ const a = ue(e);
777
+ rt(a) && (Qt(a), Ct(a));
778
+ }
779
+ k(T.afterSanitizeShadowDOM, t, null);
780
+ }, Qt = function(t) {
781
+ const e = [{
782
+ node: t,
783
+ shadow: null
784
+ }];
785
+ for (; e.length > 0; ) {
786
+ const n = e.pop();
787
+ if (n.shadow) {
788
+ Ct(n.shadow);
789
+ continue;
790
+ }
791
+ const a = n.node, u = ct(a) === M.element, m = q(a);
792
+ if (m)
793
+ for (let g = m.length - 1; g >= 0; --g)
794
+ e.push({
795
+ node: m[g],
796
+ shadow: null
797
+ });
798
+ if (u) {
799
+ const g = Z ? Z(a) : null;
800
+ if (typeof g == "string" && E(g) === "template") {
801
+ const D = a.content;
802
+ rt(D) && e.push({
803
+ node: D,
804
+ shadow: null
805
+ });
806
+ }
807
+ }
808
+ if (u) {
809
+ const g = ue(a);
810
+ rt(g) && e.push({
811
+ node: null,
812
+ shadow: g
813
+ }, {
814
+ node: g,
815
+ shadow: null
816
+ });
817
+ }
818
+ }
819
+ };
820
+ return i.sanitize = function(o) {
821
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, n = null, a = null, l = null;
822
+ if (Xt = !o, Xt && (o = "<!-->"), typeof o != "string" && !mt(o) && (o = eo(o), typeof o != "string"))
823
+ throw X("dirty is not a string, aborting");
824
+ if (!i.isSupported)
825
+ return o;
826
+ Bt ? (h = yt, _ = St) : Zt(t), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (h = C(h)), T.uponSanitizeAttribute.length > 0 && (_ = C(_)), i.removed = [];
827
+ const u = $t && typeof o != "string" && mt(o);
828
+ if (u) {
829
+ xn(o);
830
+ const D = Ut(o);
831
+ if (typeof D == "string") {
832
+ const w = E(D);
833
+ if (!h[w] || ft[w])
834
+ throw Dt(o), X("root node is forbidden and cannot be sanitized in-place");
835
+ }
836
+ if (It(o))
837
+ throw Dt(o), X("root node is clobbered and cannot be sanitized in-place");
838
+ try {
839
+ Qt(o);
840
+ } catch (w) {
841
+ throw Dt(o), w;
842
+ }
843
+ } else if (mt(o))
844
+ e = ve("<!---->"), n = e.ownerDocument.importNode(o, !0), n.nodeType === M.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? e = n : e.appendChild(n), Qt(e);
845
+ else {
846
+ if (!Q && !z && !j && // eslint-disable-next-line unicorn/prefer-includes
847
+ o.indexOf("<") === -1)
848
+ return L && Ot ? J(o) : o;
849
+ if (e = ve(o), !e)
850
+ return Q ? null : Ot ? B : "";
851
+ }
852
+ e && Yt && H(e.firstChild);
853
+ const m = u ? o : e;
854
+ try {
855
+ const D = ke(m);
856
+ for (; a = D.nextNode(); )
857
+ ze(a, m), Ge(a), rt(a.content) && Ct(a.content);
858
+ } catch (D) {
859
+ throw u && (Dt(o), V(i.removed, (w) => {
860
+ w.element && wt(w.element);
861
+ })), D;
862
+ }
863
+ if (u)
864
+ return V(i.removed, (D) => {
865
+ D.element && wt(D.element);
866
+ }), z && Jt(o), o;
867
+ if (Q) {
868
+ if (z && Jt(e), bt)
869
+ for (l = dn.call(e.ownerDocument); e.firstChild; )
870
+ l.appendChild(e.firstChild);
871
+ else
872
+ l = e;
873
+ return (_.shadowroot || _.shadowrootmode) && (l = hn.call(c, l, !0)), l;
874
+ }
875
+ let g = j ? e.outerHTML : e.innerHTML;
876
+ return j && h["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && O(po, e.ownerDocument.doctype.name) && (g = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
877
+ ` + g), z && (g = Nt(g)), L && Ot ? J(g) : g;
878
+ }, i.setConfig = function() {
879
+ let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
880
+ Zt(o), Bt = !0, yt = h, St = _;
881
+ }, i.clearConfig = function() {
882
+ ot = null, Bt = !1, yt = null, St = null, L = Ft, B = "";
883
+ }, i.isValidAttribute = function(o, t, e) {
884
+ ot || Zt({});
885
+ const n = E(o), a = E(t);
886
+ return He(n, a, e);
887
+ }, i.addHook = function(o, t) {
888
+ typeof t == "function" && N(T, o) && dt(T[o], t);
889
+ }, i.removeHook = function(o, t) {
890
+ if (N(T, o)) {
891
+ if (t !== void 0) {
892
+ const e = Vn(T[o], t);
893
+ return e === -1 ? void 0 : qn(T[o], e, 1)[0];
894
+ }
895
+ return $e(T[o]);
896
+ }
897
+ }, i.removeHooks = function(o) {
898
+ N(T, o) && (T[o] = []);
899
+ }, i.removeAllHooks = function() {
900
+ T = rn();
901
+ }, i;
902
+ }
903
+ var So = cn();
904
+ export {
905
+ So as default
906
+ };