@signalwire/web-components 4.0.0-dev-20260714201720 → 4.0.0-dev-20260721161304

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