vult-security-kyc 0.0.3 → 0.0.5

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,87 +1,91 @@
1
1
  var Rn = Object.defineProperty;
2
- var Dn = (s, n, l) => n in s ? Rn(s, n, { enumerable: !0, configurable: !0, writable: !0, value: l }) : s[n] = l;
3
- var E = (s, n, l) => Dn(s, typeof n != "symbol" ? n + "" : n, l);
4
- function In(s) {
2
+ var Dn = (s, i, u) => i in s ? Rn(s, i, { enumerable: !0, configurable: !0, writable: !0, value: u }) : s[i] = u;
3
+ var g = (s, i, u) => Dn(s, typeof i != "symbol" ? i + "" : i, u);
4
+ function Ln(s) {
5
5
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
6
6
  }
7
- /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
8
- var Ye, bt;
9
- function vt() {
10
- if (bt) return Ye;
11
- bt = 1;
7
+ /*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
8
+ var Ve, vt;
9
+ function Ct() {
10
+ if (vt) return Ve;
11
+ vt = 1;
12
12
  const {
13
13
  entries: s,
14
- setPrototypeOf: n,
15
- isFrozen: l,
14
+ setPrototypeOf: i,
15
+ isFrozen: u,
16
16
  getPrototypeOf: d,
17
- getOwnPropertyDescriptor: T
17
+ getOwnPropertyDescriptor: A
18
18
  } = Object;
19
19
  let {
20
- freeze: m,
21
- seal: D,
22
- create: q
20
+ freeze: E,
21
+ seal: m,
22
+ create: M
23
23
  } = Object, {
24
- apply: Z,
25
- construct: W
24
+ apply: J,
25
+ construct: F
26
26
  } = typeof Reflect < "u" && Reflect;
27
- m || (m = function(o) {
27
+ E || (E = function(o) {
28
28
  return o;
29
- }), D || (D = function(o) {
29
+ }), m || (m = function(o) {
30
30
  return o;
31
- }), Z || (Z = function(o, f, u) {
32
- return o.apply(f, u);
33
- }), W || (W = function(o, f) {
34
- return new o(...f);
31
+ }), J || (J = function(o, f) {
32
+ for (var a = arguments.length, p = new Array(a > 2 ? a - 2 : 0), v = 2; v < a; v++)
33
+ p[v - 2] = arguments[v];
34
+ return o.apply(f, p);
35
+ }), F || (F = function(o) {
36
+ for (var f = arguments.length, a = new Array(f > 1 ? f - 1 : 0), p = 1; p < f; p++)
37
+ a[p - 1] = arguments[p];
38
+ return new o(...a);
35
39
  });
36
- const fe = L(Array.prototype.forEach), Pt = L(Array.prototype.lastIndexOf), $e = L(Array.prototype.pop), Q = L(Array.prototype.push), kt = L(Array.prototype.splice), me = L(String.prototype.toLowerCase), ye = L(String.prototype.toString), je = L(String.prototype.match), J = L(String.prototype.replace), Ht = L(String.prototype.indexOf), Ut = L(String.prototype.trim), M = L(Object.prototype.hasOwnProperty), I = L(RegExp.prototype.test), ee = Wt(TypeError);
40
+ const me = L(Array.prototype.forEach), kt = L(Array.prototype.lastIndexOf), Xe = L(Array.prototype.pop), ee = L(Array.prototype.push), Ht = L(Array.prototype.splice), de = L(String.prototype.toLowerCase), Ie = L(String.prototype.toString), Re = L(String.prototype.match), te = L(String.prototype.replace), Wt = L(String.prototype.indexOf), Ut = L(String.prototype.trim), N = L(Object.prototype.hasOwnProperty), D = L(RegExp.prototype.test), ne = zt(TypeError);
37
41
  function L(c) {
38
42
  return function(o) {
39
43
  o instanceof RegExp && (o.lastIndex = 0);
40
- for (var f = arguments.length, u = new Array(f > 1 ? f - 1 : 0), w = 1; w < f; w++)
41
- u[w - 1] = arguments[w];
42
- return Z(c, o, u);
44
+ for (var f = arguments.length, a = new Array(f > 1 ? f - 1 : 0), p = 1; p < f; p++)
45
+ a[p - 1] = arguments[p];
46
+ return J(c, o, a);
43
47
  };
44
48
  }
45
- function Wt(c) {
49
+ function zt(c) {
46
50
  return function() {
47
- for (var o = arguments.length, f = new Array(o), u = 0; u < o; u++)
48
- f[u] = arguments[u];
49
- return W(c, f);
51
+ for (var o = arguments.length, f = new Array(o), a = 0; a < o; a++)
52
+ f[a] = arguments[a];
53
+ return F(c, f);
50
54
  };
51
55
  }
52
- function a(c, o) {
53
- let f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : me;
54
- n && n(c, null);
55
- let u = o.length;
56
- for (; u--; ) {
57
- let w = o[u];
58
- if (typeof w == "string") {
59
- const x = f(w);
60
- x !== w && (l(o) || (o[u] = x), w = x);
56
+ function l(c, o) {
57
+ let f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : de;
58
+ i && i(c, null);
59
+ let a = o.length;
60
+ for (; a--; ) {
61
+ let p = o[a];
62
+ if (typeof p == "string") {
63
+ const v = f(p);
64
+ v !== p && (u(o) || (o[a] = v), p = v);
61
65
  }
62
- c[w] = !0;
66
+ c[p] = !0;
63
67
  }
64
68
  return c;
65
69
  }
66
- function zt(c) {
70
+ function Ft(c) {
67
71
  for (let o = 0; o < c.length; o++)
68
- M(c, o) || (c[o] = null);
72
+ N(c, o) || (c[o] = null);
69
73
  return c;
70
74
  }
71
- function N(c) {
72
- const o = q(null);
73
- for (const [f, u] of s(c))
74
- M(c, f) && (Array.isArray(u) ? o[f] = zt(u) : u && typeof u == "object" && u.constructor === Object ? o[f] = N(u) : o[f] = u);
75
+ function P(c) {
76
+ const o = M(null);
77
+ for (const [f, a] of s(c))
78
+ N(c, f) && (Array.isArray(a) ? o[f] = Ft(a) : a && typeof a == "object" && a.constructor === Object ? o[f] = P(a) : o[f] = a);
75
79
  return o;
76
80
  }
77
- function te(c, o) {
81
+ function ie(c, o) {
78
82
  for (; c !== null; ) {
79
- const u = T(c, o);
80
- if (u) {
81
- if (u.get)
82
- return L(u.get);
83
- if (typeof u.value == "function")
84
- return L(u.value);
83
+ const a = A(c, o);
84
+ if (a) {
85
+ if (a.get)
86
+ return L(a.get);
87
+ if (typeof a.value == "function")
88
+ return L(a.value);
85
89
  }
86
90
  c = d(c);
87
91
  }
@@ -90,55 +94,55 @@ function vt() {
90
94
  }
91
95
  return f;
92
96
  }
93
- const Ke = m(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Re = m(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), De = m(["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"]), Ft = m(["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"]), Ie = m(["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"]), Gt = m(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Xe = m(["#text"]), qe = m(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Le = m(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Ze = m(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), de = m(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Bt = D(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Yt = D(/<%[\w\W]*|[\w\W]*%>/gm), Vt = D(/\$\{[\w\W]*/gm), $t = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), jt = D(/^aria-[\-\w]+$/), Qe = D(
97
+ const Ke = E(["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"]), De = E(["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"]), Le = E(["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"]), Gt = E(["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"]), be = E(["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"]), Bt = E(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), qe = E(["#text"]), Ze = E(["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", "slot"]), Oe = E(["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"]), Qe = E(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), pe = E(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Yt = m(/\{\{[\w\W]*|[\w\W]*\}\}/gm), $t = m(/<%[\w\W]*|[\w\W]*%>/gm), Vt = m(/\$\{[\w\W]*/gm), jt = m(/^data-[\-\w.\u00B7-\uFFFF]+$/), Xt = m(/^aria-[\-\w]+$/), Je = m(
94
98
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
95
99
  // eslint-disable-line no-useless-escape
96
- ), Kt = D(/^(?:\w+script|data):/i), Xt = D(
100
+ ), Kt = m(/^(?:\w+script|data):/i), qt = m(
97
101
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
98
102
  // eslint-disable-line no-control-regex
99
- ), Je = D(/^html$/i), qt = D(/^[a-z][.\w]*(-[.\w]+)+$/i);
100
- var et = /* @__PURE__ */ Object.freeze({
103
+ ), et = m(/^html$/i), Zt = m(/^[a-z][.\w]*(-[.\w]+)+$/i);
104
+ var tt = /* @__PURE__ */ Object.freeze({
101
105
  __proto__: null,
102
- ARIA_ATTR: jt,
103
- ATTR_WHITESPACE: Xt,
104
- CUSTOM_ELEMENT: qt,
105
- DATA_ATTR: $t,
106
- DOCTYPE_NAME: Je,
107
- ERB_EXPR: Yt,
108
- IS_ALLOWED_URI: Qe,
106
+ ARIA_ATTR: Xt,
107
+ ATTR_WHITESPACE: qt,
108
+ CUSTOM_ELEMENT: Zt,
109
+ DATA_ATTR: jt,
110
+ DOCTYPE_NAME: et,
111
+ ERB_EXPR: $t,
112
+ IS_ALLOWED_URI: Je,
109
113
  IS_SCRIPT_OR_DATA: Kt,
110
- MUSTACHE_EXPR: Bt,
114
+ MUSTACHE_EXPR: Yt,
111
115
  TMPLIT_EXPR: Vt
112
116
  });
113
- const ne = {
117
+ const oe = {
114
118
  element: 1,
115
119
  text: 3,
116
120
  // Deprecated
117
121
  progressingInstruction: 7,
118
122
  comment: 8,
119
123
  document: 9
120
- }, Zt = function() {
124
+ }, Qt = function() {
121
125
  return typeof window > "u" ? null : window;
122
- }, Qt = function(o, f) {
126
+ }, Jt = function(o, f) {
123
127
  if (typeof o != "object" || typeof o.createPolicy != "function")
124
128
  return null;
125
- let u = null;
126
- const w = "data-tt-policy-suffix";
127
- f && f.hasAttribute(w) && (u = f.getAttribute(w));
128
- const x = "dompurify" + (u ? "#" + u : "");
129
+ let a = null;
130
+ const p = "data-tt-policy-suffix";
131
+ f && f.hasAttribute(p) && (a = f.getAttribute(p));
132
+ const v = "dompurify" + (a ? "#" + a : "");
129
133
  try {
130
- return o.createPolicy(x, {
131
- createHTML(z) {
132
- return z;
134
+ return o.createPolicy(v, {
135
+ createHTML(G) {
136
+ return G;
133
137
  },
134
- createScriptURL(z) {
135
- return z;
138
+ createScriptURL(G) {
139
+ return G;
136
140
  }
137
141
  });
138
142
  } catch {
139
- return console.warn("TrustedTypes policy " + x + " could not be created."), null;
143
+ return console.warn("TrustedTypes policy " + v + " could not be created."), null;
140
144
  }
141
- }, tt = function() {
145
+ }, nt = function() {
142
146
  return {
143
147
  afterSanitizeAttributes: [],
144
148
  afterSanitizeElements: [],
@@ -151,57 +155,57 @@ function vt() {
151
155
  uponSanitizeShadowNode: []
152
156
  };
153
157
  };
154
- function nt() {
155
- let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Zt();
156
- const o = (r) => nt(r);
157
- if (o.version = "3.2.6", o.removed = [], !c || !c.document || c.document.nodeType !== ne.document || !c.Element)
158
+ function it() {
159
+ let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qt();
160
+ const o = (r) => it(r);
161
+ if (o.version = "3.3.0", o.removed = [], !c || !c.document || c.document.nodeType !== oe.document || !c.Element)
158
162
  return o.isSupported = !1, o;
159
163
  let {
160
164
  document: f
161
165
  } = c;
162
- const u = f, w = u.currentScript, {
163
- DocumentFragment: x,
164
- HTMLTemplateElement: z,
165
- Node: Oe,
166
- Element: it,
167
- NodeFilter: ie,
168
- NamedNodeMap: en = c.NamedNodeMap || c.MozNamedAttrMap,
169
- HTMLFormElement: tn,
170
- DOMParser: nn,
171
- trustedTypes: pe
172
- } = c, oe = it.prototype, on = te(oe, "cloneNode"), rn = te(oe, "remove"), sn = te(oe, "nextSibling"), an = te(oe, "childNodes"), he = te(oe, "parentNode");
173
- if (typeof z == "function") {
166
+ const a = f, p = a.currentScript, {
167
+ DocumentFragment: v,
168
+ HTMLTemplateElement: G,
169
+ Node: ve,
170
+ Element: ot,
171
+ NodeFilter: re,
172
+ NamedNodeMap: tn = c.NamedNodeMap || c.MozNamedAttrMap,
173
+ HTMLFormElement: nn,
174
+ DOMParser: on,
175
+ trustedTypes: he
176
+ } = c, se = ot.prototype, rn = ie(se, "cloneNode"), sn = ie(se, "remove"), an = ie(se, "nextSibling"), ln = ie(se, "childNodes"), ge = ie(se, "parentNode");
177
+ if (typeof G == "function") {
174
178
  const r = f.createElement("template");
175
179
  r.content && r.content.ownerDocument && (f = r.content.ownerDocument);
176
180
  }
177
- let O, re = "";
181
+ let b, ae = "";
178
182
  const {
179
- implementation: be,
180
- createNodeIterator: ln,
181
- createDocumentFragment: cn,
182
- getElementsByTagName: un
183
+ implementation: Ce,
184
+ createNodeIterator: cn,
185
+ createDocumentFragment: un,
186
+ getElementsByTagName: fn
183
187
  } = f, {
184
- importNode: fn
185
- } = u;
186
- let b = tt();
187
- o.isSupported = typeof s == "function" && typeof he == "function" && be && be.createHTMLDocument !== void 0;
188
+ importNode: mn
189
+ } = a;
190
+ let O = nt();
191
+ o.isSupported = typeof s == "function" && typeof ge == "function" && Ce && Ce.createHTMLDocument !== void 0;
188
192
  const {
189
- MUSTACHE_EXPR: ve,
190
- ERB_EXPR: Me,
191
- TMPLIT_EXPR: Ce,
192
- DATA_ATTR: mn,
193
- ARIA_ATTR: dn,
194
- IS_SCRIPT_OR_DATA: pn,
195
- ATTR_WHITESPACE: ot,
196
- CUSTOM_ELEMENT: hn
197
- } = et;
193
+ MUSTACHE_EXPR: Me,
194
+ ERB_EXPR: Ne,
195
+ TMPLIT_EXPR: xe,
196
+ DATA_ATTR: dn,
197
+ ARIA_ATTR: pn,
198
+ IS_SCRIPT_OR_DATA: hn,
199
+ ATTR_WHITESPACE: rt,
200
+ CUSTOM_ELEMENT: gn
201
+ } = tt;
198
202
  let {
199
- IS_ALLOWED_URI: rt
200
- } = et, _ = null;
201
- const st = a({}, [...Ke, ...Re, ...De, ...Ie, ...Xe]);
202
- let S = null;
203
- const at = a({}, [...qe, ...Le, ...Ze, ...de]);
204
- let h = Object.seal(q(null, {
203
+ IS_ALLOWED_URI: st
204
+ } = tt, w = null;
205
+ const at = l({}, [...Ke, ...De, ...Le, ...be, ...qe]);
206
+ let y = null;
207
+ const lt = l({}, [...Ze, ...Oe, ...Qe, ...pe]);
208
+ let T = Object.seal(M(null, {
205
209
  tagNameCheck: {
206
210
  writable: !0,
207
211
  configurable: !1,
@@ -220,70 +224,85 @@ function vt() {
220
224
  enumerable: !0,
221
225
  value: !1
222
226
  }
223
- })), se = null, Ne = null, lt = !0, xe = !0, ct = !1, ut = !0, F = !1, ge = !0, U = !1, Pe = !1, ke = !1, G = !1, Ee = !1, Te = !1, ft = !0, mt = !1;
224
- const gn = "user-content-";
225
- let He = !0, ae = !1, B = {}, Y = null;
226
- const dt = a({}, ["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"]);
227
- let pt = null;
228
- const ht = a({}, ["audio", "video", "img", "source", "image", "track"]);
229
- let Ue = null;
230
- const gt = a({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), _e = "http://www.w3.org/1998/Math/MathML", Ae = "http://www.w3.org/2000/svg", P = "http://www.w3.org/1999/xhtml";
231
- let V = P, We = !1, ze = null;
232
- const En = a({}, [_e, Ae, P], ye);
233
- let Se = a({}, ["mi", "mo", "mn", "ms", "mtext"]), we = a({}, ["annotation-xml"]);
234
- const Tn = a({}, ["title", "style", "font", "a", "script"]);
235
- let le = null;
236
- const _n = ["application/xhtml+xml", "text/html"], An = "text/html";
237
- let A = null, $ = null;
238
- const Sn = f.createElement("form"), Et = function(e) {
227
+ })), le = null, Pe = null;
228
+ const B = Object.seal(M(null, {
229
+ tagCheck: {
230
+ writable: !0,
231
+ configurable: !1,
232
+ enumerable: !0,
233
+ value: null
234
+ },
235
+ attributeCheck: {
236
+ writable: !0,
237
+ configurable: !1,
238
+ enumerable: !0,
239
+ value: null
240
+ }
241
+ }));
242
+ let ct = !0, ke = !0, ut = !1, ft = !0, Y = !1, Ee = !0, U = !1, He = !1, We = !1, $ = !1, Te = !1, _e = !1, mt = !0, dt = !1;
243
+ const En = "user-content-";
244
+ let Ue = !0, ce = !1, V = {}, j = null;
245
+ const pt = l({}, ["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"]);
246
+ let ht = null;
247
+ const gt = l({}, ["audio", "video", "img", "source", "image", "track"]);
248
+ let ze = null;
249
+ const Et = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ae = "http://www.w3.org/1998/Math/MathML", we = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml";
250
+ let X = k, Fe = !1, Ge = null;
251
+ const Tn = l({}, [Ae, we, k], Ie);
252
+ let Se = l({}, ["mi", "mo", "mn", "ms", "mtext"]), ye = l({}, ["annotation-xml"]);
253
+ const _n = l({}, ["title", "style", "font", "a", "script"]);
254
+ let ue = null;
255
+ const An = ["application/xhtml+xml", "text/html"], wn = "text/html";
256
+ let S = null, K = null;
257
+ const Sn = f.createElement("form"), Tt = function(e) {
239
258
  return e instanceof RegExp || e instanceof Function;
240
- }, Fe = function() {
259
+ }, Be = function() {
241
260
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
242
- if (!($ && $ === e)) {
243
- if ((!e || typeof e != "object") && (e = {}), e = N(e), le = // eslint-disable-next-line unicorn/prefer-includes
244
- _n.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? An : e.PARSER_MEDIA_TYPE, A = le === "application/xhtml+xml" ? ye : me, _ = M(e, "ALLOWED_TAGS") ? a({}, e.ALLOWED_TAGS, A) : st, S = M(e, "ALLOWED_ATTR") ? a({}, e.ALLOWED_ATTR, A) : at, ze = M(e, "ALLOWED_NAMESPACES") ? a({}, e.ALLOWED_NAMESPACES, ye) : En, Ue = M(e, "ADD_URI_SAFE_ATTR") ? a(N(gt), e.ADD_URI_SAFE_ATTR, A) : gt, pt = M(e, "ADD_DATA_URI_TAGS") ? a(N(ht), e.ADD_DATA_URI_TAGS, A) : ht, Y = M(e, "FORBID_CONTENTS") ? a({}, e.FORBID_CONTENTS, A) : dt, se = M(e, "FORBID_TAGS") ? a({}, e.FORBID_TAGS, A) : N({}), Ne = M(e, "FORBID_ATTR") ? a({}, e.FORBID_ATTR, A) : N({}), B = M(e, "USE_PROFILES") ? e.USE_PROFILES : !1, lt = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, ct = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ut = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, F = e.SAFE_FOR_TEMPLATES || !1, ge = e.SAFE_FOR_XML !== !1, U = e.WHOLE_DOCUMENT || !1, G = e.RETURN_DOM || !1, Ee = e.RETURN_DOM_FRAGMENT || !1, Te = e.RETURN_TRUSTED_TYPE || !1, ke = e.FORCE_BODY || !1, ft = e.SANITIZE_DOM !== !1, mt = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, ae = e.IN_PLACE || !1, rt = e.ALLOWED_URI_REGEXP || Qe, V = e.NAMESPACE || P, Se = e.MATHML_TEXT_INTEGRATION_POINTS || Se, we = e.HTML_INTEGRATION_POINTS || we, h = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Et(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (h.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Et(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (h.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (h.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), F && (xe = !1), Ee && (G = !0), B && (_ = a({}, Xe), S = [], B.html === !0 && (a(_, Ke), a(S, qe)), B.svg === !0 && (a(_, Re), a(S, Le), a(S, de)), B.svgFilters === !0 && (a(_, De), a(S, Le), a(S, de)), B.mathMl === !0 && (a(_, Ie), a(S, Ze), a(S, de))), e.ADD_TAGS && (_ === st && (_ = N(_)), a(_, e.ADD_TAGS, A)), e.ADD_ATTR && (S === at && (S = N(S)), a(S, e.ADD_ATTR, A)), e.ADD_URI_SAFE_ATTR && a(Ue, e.ADD_URI_SAFE_ATTR, A), e.FORBID_CONTENTS && (Y === dt && (Y = N(Y)), a(Y, e.FORBID_CONTENTS, A)), He && (_["#text"] = !0), U && a(_, ["html", "head", "body"]), _.table && (a(_, ["tbody"]), delete se.tbody), e.TRUSTED_TYPES_POLICY) {
261
+ if (!(K && K === e)) {
262
+ if ((!e || typeof e != "object") && (e = {}), e = P(e), ue = // eslint-disable-next-line unicorn/prefer-includes
263
+ An.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? wn : e.PARSER_MEDIA_TYPE, S = ue === "application/xhtml+xml" ? Ie : de, w = N(e, "ALLOWED_TAGS") ? l({}, e.ALLOWED_TAGS, S) : at, y = N(e, "ALLOWED_ATTR") ? l({}, e.ALLOWED_ATTR, S) : lt, Ge = N(e, "ALLOWED_NAMESPACES") ? l({}, e.ALLOWED_NAMESPACES, Ie) : Tn, ze = N(e, "ADD_URI_SAFE_ATTR") ? l(P(Et), e.ADD_URI_SAFE_ATTR, S) : Et, ht = N(e, "ADD_DATA_URI_TAGS") ? l(P(gt), e.ADD_DATA_URI_TAGS, S) : gt, j = N(e, "FORBID_CONTENTS") ? l({}, e.FORBID_CONTENTS, S) : pt, le = N(e, "FORBID_TAGS") ? l({}, e.FORBID_TAGS, S) : P({}), Pe = N(e, "FORBID_ATTR") ? l({}, e.FORBID_ATTR, S) : P({}), V = N(e, "USE_PROFILES") ? e.USE_PROFILES : !1, ct = e.ALLOW_ARIA_ATTR !== !1, ke = e.ALLOW_DATA_ATTR !== !1, ut = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ft = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Y = e.SAFE_FOR_TEMPLATES || !1, Ee = e.SAFE_FOR_XML !== !1, U = e.WHOLE_DOCUMENT || !1, $ = e.RETURN_DOM || !1, Te = e.RETURN_DOM_FRAGMENT || !1, _e = e.RETURN_TRUSTED_TYPE || !1, We = e.FORCE_BODY || !1, mt = e.SANITIZE_DOM !== !1, dt = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, ce = e.IN_PLACE || !1, st = e.ALLOWED_URI_REGEXP || Je, X = e.NAMESPACE || k, Se = e.MATHML_TEXT_INTEGRATION_POINTS || Se, ye = e.HTML_INTEGRATION_POINTS || ye, T = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (T.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (T.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Y && (ke = !1), Te && ($ = !0), V && (w = l({}, qe), y = [], V.html === !0 && (l(w, Ke), l(y, Ze)), V.svg === !0 && (l(w, De), l(y, Oe), l(y, pe)), V.svgFilters === !0 && (l(w, Le), l(y, Oe), l(y, pe)), V.mathMl === !0 && (l(w, be), l(y, Qe), l(y, pe))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : (w === at && (w = P(w)), l(w, e.ADD_TAGS, S))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : (y === lt && (y = P(y)), l(y, e.ADD_ATTR, S))), e.ADD_URI_SAFE_ATTR && l(ze, e.ADD_URI_SAFE_ATTR, S), e.FORBID_CONTENTS && (j === pt && (j = P(j)), l(j, e.FORBID_CONTENTS, S)), Ue && (w["#text"] = !0), U && l(w, ["html", "head", "body"]), w.table && (l(w, ["tbody"]), delete le.tbody), e.TRUSTED_TYPES_POLICY) {
245
264
  if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
246
- throw ee('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
265
+ throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
247
266
  if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
248
- throw ee('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
249
- O = e.TRUSTED_TYPES_POLICY, re = O.createHTML("");
267
+ throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
268
+ b = e.TRUSTED_TYPES_POLICY, ae = b.createHTML("");
250
269
  } else
251
- O === void 0 && (O = Qt(pe, w)), O !== null && typeof re == "string" && (re = O.createHTML(""));
252
- m && m(e), $ = e;
270
+ b === void 0 && (b = Jt(he, p)), b !== null && typeof ae == "string" && (ae = b.createHTML(""));
271
+ E && E(e), K = e;
253
272
  }
254
- }, Tt = a({}, [...Re, ...De, ...Ft]), _t = a({}, [...Ie, ...Gt]), wn = function(e) {
255
- let t = he(e);
273
+ }, _t = l({}, [...De, ...Le, ...Gt]), At = l({}, [...be, ...Bt]), yn = function(e) {
274
+ let t = ge(e);
256
275
  (!t || !t.tagName) && (t = {
257
- namespaceURI: V,
276
+ namespaceURI: X,
258
277
  tagName: "template"
259
278
  });
260
- const i = me(e.tagName), p = me(t.tagName);
261
- return ze[e.namespaceURI] ? e.namespaceURI === Ae ? t.namespaceURI === P ? i === "svg" : t.namespaceURI === _e ? i === "svg" && (p === "annotation-xml" || Se[p]) : !!Tt[i] : e.namespaceURI === _e ? t.namespaceURI === P ? i === "math" : t.namespaceURI === Ae ? i === "math" && we[p] : !!_t[i] : e.namespaceURI === P ? t.namespaceURI === Ae && !we[p] || t.namespaceURI === _e && !Se[p] ? !1 : !_t[i] && (Tn[i] || !Tt[i]) : !!(le === "application/xhtml+xml" && ze[e.namespaceURI]) : !1;
262
- }, C = function(e) {
263
- Q(o.removed, {
279
+ const n = de(e.tagName), h = de(t.tagName);
280
+ return Ge[e.namespaceURI] ? e.namespaceURI === we ? t.namespaceURI === k ? n === "svg" : t.namespaceURI === Ae ? n === "svg" && (h === "annotation-xml" || Se[h]) : !!_t[n] : e.namespaceURI === Ae ? t.namespaceURI === k ? n === "math" : t.namespaceURI === we ? n === "math" && ye[h] : !!At[n] : e.namespaceURI === k ? t.namespaceURI === we && !ye[h] || t.namespaceURI === Ae && !Se[h] ? !1 : !At[n] && (_n[n] || !_t[n]) : !!(ue === "application/xhtml+xml" && Ge[e.namespaceURI]) : !1;
281
+ }, x = function(e) {
282
+ ee(o.removed, {
264
283
  element: e
265
284
  });
266
285
  try {
267
- he(e).removeChild(e);
286
+ ge(e).removeChild(e);
268
287
  } catch {
269
- rn(e);
288
+ sn(e);
270
289
  }
271
- }, j = function(e, t) {
290
+ }, z = function(e, t) {
272
291
  try {
273
- Q(o.removed, {
292
+ ee(o.removed, {
274
293
  attribute: t.getAttributeNode(e),
275
294
  from: t
276
295
  });
277
296
  } catch {
278
- Q(o.removed, {
297
+ ee(o.removed, {
279
298
  attribute: null,
280
299
  from: t
281
300
  });
282
301
  }
283
302
  if (t.removeAttribute(e), e === "is")
284
- if (G || Ee)
303
+ if ($ || Te)
285
304
  try {
286
- C(t);
305
+ x(t);
287
306
  } catch {
288
307
  }
289
308
  else
@@ -291,98 +310,100 @@ function vt() {
291
310
  t.setAttribute(e, "");
292
311
  } catch {
293
312
  }
294
- }, At = function(e) {
295
- let t = null, i = null;
296
- if (ke)
313
+ }, wt = function(e) {
314
+ let t = null, n = null;
315
+ if (We)
297
316
  e = "<remove></remove>" + e;
298
317
  else {
299
- const g = je(e, /^[\r\n\t ]+/);
300
- i = g && g[0];
318
+ const _ = Re(e, /^[\r\n\t ]+/);
319
+ n = _ && _[0];
301
320
  }
302
- le === "application/xhtml+xml" && V === P && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
303
- const p = O ? O.createHTML(e) : e;
304
- if (V === P)
321
+ ue === "application/xhtml+xml" && X === k && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
322
+ const h = b ? b.createHTML(e) : e;
323
+ if (X === k)
305
324
  try {
306
- t = new nn().parseFromString(p, le);
325
+ t = new on().parseFromString(h, ue);
307
326
  } catch {
308
327
  }
309
328
  if (!t || !t.documentElement) {
310
- t = be.createDocument(V, "template", null);
329
+ t = Ce.createDocument(X, "template", null);
311
330
  try {
312
- t.documentElement.innerHTML = We ? re : p;
331
+ t.documentElement.innerHTML = Fe ? ae : h;
313
332
  } catch {
314
333
  }
315
334
  }
316
- const y = t.body || t.documentElement;
317
- return e && i && y.insertBefore(f.createTextNode(i), y.childNodes[0] || null), V === P ? un.call(t, U ? "html" : "body")[0] : U ? t.documentElement : y;
335
+ const R = t.body || t.documentElement;
336
+ return e && n && R.insertBefore(f.createTextNode(n), R.childNodes[0] || null), X === k ? fn.call(t, U ? "html" : "body")[0] : U ? t.documentElement : R;
318
337
  }, St = function(e) {
319
- return ln.call(
338
+ return cn.call(
320
339
  e.ownerDocument || e,
321
340
  e,
322
341
  // eslint-disable-next-line no-bitwise
323
- ie.SHOW_ELEMENT | ie.SHOW_COMMENT | ie.SHOW_TEXT | ie.SHOW_PROCESSING_INSTRUCTION | ie.SHOW_CDATA_SECTION,
342
+ re.SHOW_ELEMENT | re.SHOW_COMMENT | re.SHOW_TEXT | re.SHOW_PROCESSING_INSTRUCTION | re.SHOW_CDATA_SECTION,
324
343
  null
325
344
  );
326
- }, Ge = function(e) {
327
- return e instanceof tn && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof en) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
328
- }, wt = function(e) {
329
- return typeof Oe == "function" && e instanceof Oe;
345
+ }, Ye = function(e) {
346
+ return e instanceof nn && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof tn) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
347
+ }, yt = function(e) {
348
+ return typeof ve == "function" && e instanceof ve;
330
349
  };
331
- function k(r, e, t) {
332
- fe(r, (i) => {
333
- i.call(o, e, t, $);
350
+ function H(r, e, t) {
351
+ me(r, (n) => {
352
+ n.call(o, e, t, K);
334
353
  });
335
354
  }
336
- const yt = function(e) {
355
+ const It = function(e) {
337
356
  let t = null;
338
- if (k(b.beforeSanitizeElements, e, null), Ge(e))
339
- return C(e), !0;
340
- const i = A(e.nodeName);
341
- if (k(b.uponSanitizeElement, e, {
342
- tagName: i,
343
- allowedTags: _
344
- }), ge && e.hasChildNodes() && !wt(e.firstElementChild) && I(/<[/\w!]/g, e.innerHTML) && I(/<[/\w!]/g, e.textContent) || e.nodeType === ne.progressingInstruction || ge && e.nodeType === ne.comment && I(/<[/\w]/g, e.data))
345
- return C(e), !0;
346
- if (!_[i] || se[i]) {
347
- if (!se[i] && Dt(i) && (h.tagNameCheck instanceof RegExp && I(h.tagNameCheck, i) || h.tagNameCheck instanceof Function && h.tagNameCheck(i)))
357
+ if (H(O.beforeSanitizeElements, e, null), Ye(e))
358
+ return x(e), !0;
359
+ const n = S(e.nodeName);
360
+ if (H(O.uponSanitizeElement, e, {
361
+ tagName: n,
362
+ allowedTags: w
363
+ }), Ee && e.hasChildNodes() && !yt(e.firstElementChild) && D(/<[/\w!]/g, e.innerHTML) && D(/<[/\w!]/g, e.textContent) || e.nodeType === oe.progressingInstruction || Ee && e.nodeType === oe.comment && D(/<[/\w]/g, e.data))
364
+ return x(e), !0;
365
+ if (!(B.tagCheck instanceof Function && B.tagCheck(n)) && (!w[n] || le[n])) {
366
+ if (!le[n] && Dt(n) && (T.tagNameCheck instanceof RegExp && D(T.tagNameCheck, n) || T.tagNameCheck instanceof Function && T.tagNameCheck(n)))
348
367
  return !1;
349
- if (He && !Y[i]) {
350
- const p = he(e) || e.parentNode, y = an(e) || e.childNodes;
351
- if (y && p) {
352
- const g = y.length;
353
- for (let v = g - 1; v >= 0; --v) {
354
- const H = on(y[v], !0);
355
- H.__removalCount = (e.__removalCount || 0) + 1, p.insertBefore(H, sn(e));
368
+ if (Ue && !j[n]) {
369
+ const h = ge(e) || e.parentNode, R = ln(e) || e.childNodes;
370
+ if (R && h) {
371
+ const _ = R.length;
372
+ for (let C = _ - 1; C >= 0; --C) {
373
+ const W = rn(R[C], !0);
374
+ W.__removalCount = (e.__removalCount || 0) + 1, h.insertBefore(W, an(e));
356
375
  }
357
376
  }
358
377
  }
359
- return C(e), !0;
378
+ return x(e), !0;
360
379
  }
361
- return e instanceof it && !wn(e) || (i === "noscript" || i === "noembed" || i === "noframes") && I(/<\/no(script|embed|frames)/i, e.innerHTML) ? (C(e), !0) : (F && e.nodeType === ne.text && (t = e.textContent, fe([ve, Me, Ce], (p) => {
362
- t = J(t, p, " ");
363
- }), e.textContent !== t && (Q(o.removed, {
380
+ return e instanceof ot && !yn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && D(/<\/no(script|embed|frames)/i, e.innerHTML) ? (x(e), !0) : (Y && e.nodeType === oe.text && (t = e.textContent, me([Me, Ne, xe], (h) => {
381
+ t = te(t, h, " ");
382
+ }), e.textContent !== t && (ee(o.removed, {
364
383
  element: e.cloneNode()
365
- }), e.textContent = t)), k(b.afterSanitizeElements, e, null), !1);
366
- }, Rt = function(e, t, i) {
367
- if (ft && (t === "id" || t === "name") && (i in f || i in Sn))
384
+ }), e.textContent = t)), H(O.afterSanitizeElements, e, null), !1);
385
+ }, Rt = function(e, t, n) {
386
+ if (mt && (t === "id" || t === "name") && (n in f || n in Sn))
368
387
  return !1;
369
- if (!(xe && !Ne[t] && I(mn, t))) {
370
- if (!(lt && I(dn, t))) {
371
- if (!S[t] || Ne[t]) {
372
- if (
373
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
374
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
375
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
376
- !(Dt(e) && (h.tagNameCheck instanceof RegExp && I(h.tagNameCheck, e) || h.tagNameCheck instanceof Function && h.tagNameCheck(e)) && (h.attributeNameCheck instanceof RegExp && I(h.attributeNameCheck, t) || h.attributeNameCheck instanceof Function && h.attributeNameCheck(t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
377
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
378
- t === "is" && h.allowCustomizedBuiltInElements && (h.tagNameCheck instanceof RegExp && I(h.tagNameCheck, i) || h.tagNameCheck instanceof Function && h.tagNameCheck(i)))
379
- ) return !1;
380
- } else if (!Ue[t]) {
381
- if (!I(rt, J(i, ot, ""))) {
382
- if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Ht(i, "data:") === 0 && pt[e])) {
383
- if (!(ct && !I(pn, J(i, ot, "")))) {
384
- if (i)
385
- return !1;
388
+ if (!(ke && !Pe[t] && D(dn, t))) {
389
+ if (!(ct && D(pn, t))) {
390
+ if (!(B.attributeCheck instanceof Function && B.attributeCheck(t, e))) {
391
+ if (!y[t] || Pe[t]) {
392
+ if (
393
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
394
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
395
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
396
+ !(Dt(e) && (T.tagNameCheck instanceof RegExp && D(T.tagNameCheck, e) || T.tagNameCheck instanceof Function && T.tagNameCheck(e)) && (T.attributeNameCheck instanceof RegExp && D(T.attributeNameCheck, t) || T.attributeNameCheck instanceof Function && T.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
397
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
398
+ t === "is" && T.allowCustomizedBuiltInElements && (T.tagNameCheck instanceof RegExp && D(T.tagNameCheck, n) || T.tagNameCheck instanceof Function && T.tagNameCheck(n)))
399
+ ) return !1;
400
+ } else if (!ze[t]) {
401
+ if (!D(st, te(n, rt, ""))) {
402
+ if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Wt(n, "data:") === 0 && ht[e])) {
403
+ if (!(ut && !D(hn, te(n, rt, "")))) {
404
+ if (n)
405
+ return !1;
406
+ }
386
407
  }
387
408
  }
388
409
  }
@@ -391,154 +412,158 @@ function vt() {
391
412
  }
392
413
  return !0;
393
414
  }, Dt = function(e) {
394
- return e !== "annotation-xml" && je(e, hn);
395
- }, It = function(e) {
396
- k(b.beforeSanitizeAttributes, e, null);
415
+ return e !== "annotation-xml" && Re(e, gn);
416
+ }, Lt = function(e) {
417
+ H(O.beforeSanitizeAttributes, e, null);
397
418
  const {
398
419
  attributes: t
399
420
  } = e;
400
- if (!t || Ge(e))
421
+ if (!t || Ye(e))
401
422
  return;
402
- const i = {
423
+ const n = {
403
424
  attrName: "",
404
425
  attrValue: "",
405
426
  keepAttr: !0,
406
- allowedAttributes: S,
427
+ allowedAttributes: y,
407
428
  forceKeepAttr: void 0
408
429
  };
409
- let p = t.length;
410
- for (; p--; ) {
411
- const y = t[p], {
412
- name: g,
413
- namespaceURI: v,
414
- value: H
415
- } = y, ce = A(g), Be = H;
416
- let R = g === "value" ? Be : Ut(Be);
417
- if (i.attrName = ce, i.attrValue = R, i.keepAttr = !0, i.forceKeepAttr = void 0, k(b.uponSanitizeAttribute, e, i), R = i.attrValue, mt && (ce === "id" || ce === "name") && (j(g, e), R = gn + R), ge && I(/((--!?|])>)|<\/(style|title)/i, R)) {
418
- j(g, e);
430
+ let h = t.length;
431
+ for (; h--; ) {
432
+ const R = t[h], {
433
+ name: _,
434
+ namespaceURI: C,
435
+ value: W
436
+ } = R, q = S(_), $e = W;
437
+ let I = _ === "value" ? $e : Ut($e);
438
+ if (n.attrName = q, n.attrValue = I, n.keepAttr = !0, n.forceKeepAttr = void 0, H(O.uponSanitizeAttribute, e, n), I = n.attrValue, dt && (q === "id" || q === "name") && (z(_, e), I = En + I), Ee && D(/((--!?|])>)|<\/(style|title|textarea)/i, I)) {
439
+ z(_, e);
440
+ continue;
441
+ }
442
+ if (q === "attributename" && Re(I, "href")) {
443
+ z(_, e);
419
444
  continue;
420
445
  }
421
- if (i.forceKeepAttr)
446
+ if (n.forceKeepAttr)
422
447
  continue;
423
- if (!i.keepAttr) {
424
- j(g, e);
448
+ if (!n.keepAttr) {
449
+ z(_, e);
425
450
  continue;
426
451
  }
427
- if (!ut && I(/\/>/i, R)) {
428
- j(g, e);
452
+ if (!ft && D(/\/>/i, I)) {
453
+ z(_, e);
429
454
  continue;
430
455
  }
431
- F && fe([ve, Me, Ce], (Ot) => {
432
- R = J(R, Ot, " ");
456
+ Y && me([Me, Ne, xe], (Ot) => {
457
+ I = te(I, Ot, " ");
433
458
  });
434
- const Lt = A(e.nodeName);
435
- if (!Rt(Lt, ce, R)) {
436
- j(g, e);
459
+ const bt = S(e.nodeName);
460
+ if (!Rt(bt, q, I)) {
461
+ z(_, e);
437
462
  continue;
438
463
  }
439
- if (O && typeof pe == "object" && typeof pe.getAttributeType == "function" && !v)
440
- switch (pe.getAttributeType(Lt, ce)) {
464
+ if (b && typeof he == "object" && typeof he.getAttributeType == "function" && !C)
465
+ switch (he.getAttributeType(bt, q)) {
441
466
  case "TrustedHTML": {
442
- R = O.createHTML(R);
467
+ I = b.createHTML(I);
443
468
  break;
444
469
  }
445
470
  case "TrustedScriptURL": {
446
- R = O.createScriptURL(R);
471
+ I = b.createScriptURL(I);
447
472
  break;
448
473
  }
449
474
  }
450
- if (R !== Be)
475
+ if (I !== $e)
451
476
  try {
452
- v ? e.setAttributeNS(v, g, R) : e.setAttribute(g, R), Ge(e) ? C(e) : $e(o.removed);
477
+ C ? e.setAttributeNS(C, _, I) : e.setAttribute(_, I), Ye(e) ? x(e) : Xe(o.removed);
453
478
  } catch {
454
- j(g, e);
479
+ z(_, e);
455
480
  }
456
481
  }
457
- k(b.afterSanitizeAttributes, e, null);
458
- }, yn = function r(e) {
482
+ H(O.afterSanitizeAttributes, e, null);
483
+ }, In = function r(e) {
459
484
  let t = null;
460
- const i = St(e);
461
- for (k(b.beforeSanitizeShadowDOM, e, null); t = i.nextNode(); )
462
- k(b.uponSanitizeShadowNode, t, null), yt(t), It(t), t.content instanceof x && r(t.content);
463
- k(b.afterSanitizeShadowDOM, e, null);
485
+ const n = St(e);
486
+ for (H(O.beforeSanitizeShadowDOM, e, null); t = n.nextNode(); )
487
+ H(O.uponSanitizeShadowNode, t, null), It(t), Lt(t), t.content instanceof v && r(t.content);
488
+ H(O.afterSanitizeShadowDOM, e, null);
464
489
  };
465
490
  return o.sanitize = function(r) {
466
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, i = null, p = null, y = null;
467
- if (We = !r, We && (r = "<!-->"), typeof r != "string" && !wt(r))
491
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, n = null, h = null, R = null;
492
+ if (Fe = !r, Fe && (r = "<!-->"), typeof r != "string" && !yt(r))
468
493
  if (typeof r.toString == "function") {
469
494
  if (r = r.toString(), typeof r != "string")
470
- throw ee("dirty is not a string, aborting");
495
+ throw ne("dirty is not a string, aborting");
471
496
  } else
472
- throw ee("toString is not a function");
497
+ throw ne("toString is not a function");
473
498
  if (!o.isSupported)
474
499
  return r;
475
- if (Pe || Fe(e), o.removed = [], typeof r == "string" && (ae = !1), ae) {
500
+ if (He || Be(e), o.removed = [], typeof r == "string" && (ce = !1), ce) {
476
501
  if (r.nodeName) {
477
- const H = A(r.nodeName);
478
- if (!_[H] || se[H])
479
- throw ee("root node is forbidden and cannot be sanitized in-place");
502
+ const W = S(r.nodeName);
503
+ if (!w[W] || le[W])
504
+ throw ne("root node is forbidden and cannot be sanitized in-place");
480
505
  }
481
- } else if (r instanceof Oe)
482
- t = At("<!---->"), i = t.ownerDocument.importNode(r, !0), i.nodeType === ne.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? t = i : t.appendChild(i);
506
+ } else if (r instanceof ve)
507
+ t = wt("<!---->"), n = t.ownerDocument.importNode(r, !0), n.nodeType === oe.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? t = n : t.appendChild(n);
483
508
  else {
484
- if (!G && !F && !U && // eslint-disable-next-line unicorn/prefer-includes
509
+ if (!$ && !Y && !U && // eslint-disable-next-line unicorn/prefer-includes
485
510
  r.indexOf("<") === -1)
486
- return O && Te ? O.createHTML(r) : r;
487
- if (t = At(r), !t)
488
- return G ? null : Te ? re : "";
511
+ return b && _e ? b.createHTML(r) : r;
512
+ if (t = wt(r), !t)
513
+ return $ ? null : _e ? ae : "";
489
514
  }
490
- t && ke && C(t.firstChild);
491
- const g = St(ae ? r : t);
492
- for (; p = g.nextNode(); )
493
- yt(p), It(p), p.content instanceof x && yn(p.content);
494
- if (ae)
515
+ t && We && x(t.firstChild);
516
+ const _ = St(ce ? r : t);
517
+ for (; h = _.nextNode(); )
518
+ It(h), Lt(h), h.content instanceof v && In(h.content);
519
+ if (ce)
495
520
  return r;
496
- if (G) {
497
- if (Ee)
498
- for (y = cn.call(t.ownerDocument); t.firstChild; )
499
- y.appendChild(t.firstChild);
521
+ if ($) {
522
+ if (Te)
523
+ for (R = un.call(t.ownerDocument); t.firstChild; )
524
+ R.appendChild(t.firstChild);
500
525
  else
501
- y = t;
502
- return (S.shadowroot || S.shadowrootmode) && (y = fn.call(u, y, !0)), y;
526
+ R = t;
527
+ return (y.shadowroot || y.shadowrootmode) && (R = mn.call(a, R, !0)), R;
503
528
  }
504
- let v = U ? t.outerHTML : t.innerHTML;
505
- return U && _["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && I(Je, t.ownerDocument.doctype.name) && (v = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
506
- ` + v), F && fe([ve, Me, Ce], (H) => {
507
- v = J(v, H, " ");
508
- }), O && Te ? O.createHTML(v) : v;
529
+ let C = U ? t.outerHTML : t.innerHTML;
530
+ return U && w["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && D(et, t.ownerDocument.doctype.name) && (C = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
531
+ ` + C), Y && me([Me, Ne, xe], (W) => {
532
+ C = te(C, W, " ");
533
+ }), b && _e ? b.createHTML(C) : C;
509
534
  }, o.setConfig = function() {
510
535
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
511
- Fe(r), Pe = !0;
536
+ Be(r), He = !0;
512
537
  }, o.clearConfig = function() {
513
- $ = null, Pe = !1;
538
+ K = null, He = !1;
514
539
  }, o.isValidAttribute = function(r, e, t) {
515
- $ || Fe({});
516
- const i = A(r), p = A(e);
517
- return Rt(i, p, t);
540
+ K || Be({});
541
+ const n = S(r), h = S(e);
542
+ return Rt(n, h, t);
518
543
  }, o.addHook = function(r, e) {
519
- typeof e == "function" && Q(b[r], e);
544
+ typeof e == "function" && ee(O[r], e);
520
545
  }, o.removeHook = function(r, e) {
521
546
  if (e !== void 0) {
522
- const t = Pt(b[r], e);
523
- return t === -1 ? void 0 : kt(b[r], t, 1)[0];
547
+ const t = kt(O[r], e);
548
+ return t === -1 ? void 0 : Ht(O[r], t, 1)[0];
524
549
  }
525
- return $e(b[r]);
550
+ return Xe(O[r]);
526
551
  }, o.removeHooks = function(r) {
527
- b[r] = [];
552
+ O[r] = [];
528
553
  }, o.removeAllHooks = function() {
529
- b = tt();
554
+ O = nt();
530
555
  }, o;
531
556
  }
532
- var Jt = nt();
533
- return Ye = Jt, Ye;
557
+ var en = it();
558
+ return Ve = en, Ve;
534
559
  }
535
- var Ve, Mt;
536
- function Ln() {
537
- return Mt || (Mt = 1, Ve = window.DOMPurify || (window.DOMPurify = vt().default || vt())), Ve;
560
+ var je, Mt;
561
+ function bn() {
562
+ return Mt || (Mt = 1, je = window.DOMPurify || (window.DOMPurify = Ct().default || Ct())), je;
538
563
  }
539
- var On = Ln();
540
- const bn = /* @__PURE__ */ In(On), vn = ({ color: s }) => {
541
- const n = `
564
+ var On = bn();
565
+ const vn = /* @__PURE__ */ Ln(On), Cn = ({ color: s }) => {
566
+ const i = `
542
567
  <svg
543
568
  width="48"
544
569
  height="48"
@@ -580,29 +605,30 @@ const bn = /* @__PURE__ */ In(On), vn = ({ color: s }) => {
580
605
  />
581
606
  </svg>
582
607
  `;
583
- return bn.sanitize(n, {
608
+ return vn.sanitize(i, {
584
609
  ALLOWED_TAGS: ["style", "def"],
585
610
  ALLOWED_ATTR: ["class"],
586
611
  USE_PROFILES: { svg: !0 }
587
612
  });
588
- }, X = (s, n) => {
589
- Object.entries(n).forEach(([l, d]) => {
590
- d !== void 0 && (s.style[l] = d);
613
+ }, Q = (s, i) => {
614
+ Object.entries(i).forEach(([u, d]) => {
615
+ d !== void 0 && (s.style[u] = d);
591
616
  });
592
- }, K = /* @__PURE__ */ new Map();
593
- function ue({ element: s, event: n, handler: l }) {
594
- s.addEventListener(n, l), K.has(s) || K.set(s, []), K.get(s).push({ event: n, handler: l });
617
+ }, Z = /* @__PURE__ */ new Map();
618
+ function fe({ element: s, event: i, handler: u }) {
619
+ s.addEventListener(i, u), Z.has(s) || Z.set(s, []), Z.get(s).push({ event: i, handler: u });
595
620
  }
596
- function Ct(s) {
597
- K.has(s) && (K.get(s).forEach(({ event: l, handler: d }) => {
598
- s.removeEventListener(l, d);
599
- }), K.delete(s));
621
+ function Nt(s) {
622
+ Z.has(s) && (Z.get(s).forEach(({ event: u, handler: d }) => {
623
+ s.removeEventListener(u, d);
624
+ }), Z.delete(s));
600
625
  }
601
626
  const Mn = ({
602
627
  removeElementFromDOM: s,
603
- onDismiss: n
628
+ onDismiss: i,
629
+ mainWindowId: u
604
630
  }) => {
605
- const l = {
631
+ const d = {
606
632
  width: "100%",
607
633
  height: window.innerHeight + "px",
608
634
  position: "fixed",
@@ -613,14 +639,14 @@ const Mn = ({
613
639
  justifyContent: "center",
614
640
  alignItems: "center",
615
641
  zIndex: "1400"
616
- }, d = document.createElement("div"), T = () => {
617
- s(), n && n();
642
+ }, A = document.createElement("div"), E = () => {
643
+ s(), i && i();
618
644
  }, m = document.createElement("div");
619
- return m.innerHTML = vn({ color: "#d9d9d9" }), ue({
620
- element: d,
645
+ return m.innerHTML = Cn({ color: "#d9d9d9" }), fe({
646
+ element: A,
621
647
  event: "click",
622
- handler: T
623
- }), d.setAttribute("id", "MainWindow"), X(m, {
648
+ handler: E
649
+ }), A.setAttribute("id", u), Q(m, {
624
650
  position: "fixed",
625
651
  display: "flex",
626
652
  justifyContent: "center",
@@ -630,51 +656,53 @@ const Mn = ({
630
656
  height: "100%",
631
657
  backgroundColor: "rgba(0,0,0,.55)",
632
658
  zIndex: "-1"
633
- }), X(d, l), d.append(m), d;
634
- }, Nt = () => innerWidth > 1080 && innerWidth > innerHeight ? {
659
+ }), Q(A, d), A.append(m), A;
660
+ }, xt = () => innerWidth > 1080 && innerWidth > innerHeight ? {
635
661
  width: `${innerHeight * 0.7 * (9 / 16)}px`,
636
662
  height: `${innerHeight * 0.7}px`
637
663
  } : {
638
664
  width: "95%",
639
665
  height: "95%"
640
666
  };
641
- function xt(s) {
642
- const n = s.toLowerCase().trim(), d = {
667
+ function Pt(s) {
668
+ const i = s.toLowerCase().trim(), d = {
643
669
  development: "dev",
644
670
  production: "prod"
645
- }[n] || n, T = {
671
+ }[i] || i, A = {
646
672
  dev: "https://face-dev.vultpayments.dev",
647
673
  stage: "https://face-stage.vultpayments.dev",
648
674
  demo: "https://face-demo.vultsecurity.com",
649
675
  prod: "https://face.vultsecurity.com"
650
676
  };
651
- return T[d] ? T[d] : (console.warn(`Unknown environment: ${s}. Using dev domain as default.`), T.dev);
677
+ return A[d] ? A[d] : (console.warn(`Unknown environment: ${s}. Using dev domain as default.`), A.dev);
652
678
  }
653
- const Cn = async ({
654
- KYC_VARS: s
679
+ const Nn = async ({
680
+ KYC_VARS: s,
681
+ iframeId: i,
682
+ iframeContainerId: u
655
683
  }) => {
656
- const n = xt(s.env), l = document.createElement("div");
657
- l.setAttribute("id", "Iframe_Container");
658
- const d = Nt();
659
- X(l, {
660
- width: d.width,
661
- height: d.height,
684
+ const d = Pt(s.env), A = document.createElement("div");
685
+ A.setAttribute("id", u);
686
+ const E = xt();
687
+ Q(A, {
688
+ width: E.width,
689
+ height: E.height,
662
690
  overflow: "hidden",
663
691
  borderRadius: "20px"
664
692
  });
665
- const T = document.createElement("iframe");
666
- return ue({
667
- element: T,
693
+ const m = document.createElement("iframe");
694
+ return fe({
695
+ element: m,
668
696
  event: "load",
669
697
  handler: () => {
670
- const m = document.getElementById(
671
- "KYC_WIDGET"
698
+ const M = document.getElementById(
699
+ i
672
700
  );
673
- m && setTimeout(() => {
674
- m.contentWindow && (m.contentWindow.postMessage(
701
+ M && setTimeout(() => {
702
+ M.contentWindow && (M.contentWindow.postMessage(
675
703
  "Incoming from kyc",
676
- n
677
- ), m.contentWindow.postMessage(
704
+ d
705
+ ), M.contentWindow.postMessage(
678
706
  {
679
707
  type: "RESPONSE_WINDOW_SIZE",
680
708
  data: {
@@ -683,21 +711,21 @@ const Cn = async ({
683
711
  success: !0
684
712
  }
685
713
  },
686
- n
714
+ d
687
715
  ));
688
716
  }, 1e3);
689
717
  }
690
- }), T.id = "KYC_WIDGET", T.allow = "camera", T.height = `${window.innerHeight}px`, window.innerWidth >= 768 ? T.src = `${n}/show-qr${s.sessionURL}/${s.session_id}` : T.src = `${n}${s.sessionURL}/${s.session_id}`, X(T, {
718
+ }), m.id = i, m.allow = "camera", m.height = `${window.innerHeight}px`, window.innerWidth >= 768 ? m.src = `${d}/show-qr${s.sessionURL}/${s.session_id}` : m.src = `${d}${s.sessionURL}/${s.session_id}`, Q(m, {
691
719
  border: "0px",
692
720
  width: "100%",
693
721
  height: "100%",
694
722
  overflow: "hidden",
695
723
  borderRadius: "20px"
696
- }), l.append(T), l;
724
+ }), A.append(m), A;
697
725
  };
698
- class xn {
699
- constructor(n) {
700
- E(this, "KYC_VARS", {
726
+ class Pn {
727
+ constructor(i) {
728
+ g(this, "KYC_VARS", {
701
729
  session_id: "",
702
730
  onComplete: function() {
703
731
  },
@@ -707,19 +735,25 @@ class xn {
707
735
  sessionURL: "",
708
736
  env: "dev"
709
737
  });
710
- E(this, "locationData", null);
711
- E(this, "isResizing", !1);
712
- E(this, "resizeTimerID", null);
713
- E(this, "domain", "");
714
- E(this, "previousWidth", 0);
715
- E(this, "previousHeight", 0);
738
+ g(this, "locationData", null);
739
+ g(this, "isResizing", !1);
740
+ g(this, "resizeTimerID", null);
741
+ g(this, "domain", "");
742
+ g(this, "previousWidth", 0);
743
+ g(this, "previousHeight", 0);
716
744
  // Threshold for considering a resize significant (address bars typically change height by ~50-100px)
717
- E(this, "RESIZE_THRESHOLD_HEIGHT", 100);
718
- E(this, "RESIZE_THRESHOLD_WIDTH", 50);
719
- E(this, "windowEventListener", (n) => {
720
- const l = n;
721
- if (l.data.type === "REQUEST_WINDOW_SIZE") {
722
- const d = document.getElementById("KYC_WIDGET");
745
+ g(this, "RESIZE_THRESHOLD_HEIGHT", 100);
746
+ g(this, "RESIZE_THRESHOLD_WIDTH", 50);
747
+ // Unique instance IDs to prevent conflicts with multiple instances
748
+ g(this, "instanceId", "");
749
+ g(this, "mainWindowId", "");
750
+ g(this, "iframeId", "");
751
+ g(this, "iframeContainerId", "");
752
+ g(this, "isClosing", !1);
753
+ g(this, "windowEventListener", (i) => {
754
+ const u = i;
755
+ if (u.data.type === "REQUEST_WINDOW_SIZE") {
756
+ const d = document.getElementById(this.iframeId);
723
757
  d && d.contentWindow && d.contentWindow.postMessage(
724
758
  {
725
759
  type: "RESPONSE_WINDOW_SIZE",
@@ -732,12 +766,12 @@ class xn {
732
766
  this.domain
733
767
  );
734
768
  }
735
- if (l.data.type === "APP_STATUS")
736
- switch (l.data.data.status) {
769
+ if (u.data.type === "APP_STATUS")
770
+ switch (u.data.data.status) {
737
771
  case "complete": {
738
772
  if (this.KYC_VARS.onComplete) {
739
- if (l.data.data.response) {
740
- this.KYC_VARS.onComplete(l.data.data.response);
773
+ if (u.data.data.response) {
774
+ this.KYC_VARS.onComplete(u.data.data.response);
741
775
  return;
742
776
  }
743
777
  this.KYC_VARS.onComplete();
@@ -745,37 +779,37 @@ class xn {
745
779
  break;
746
780
  }
747
781
  case "testing": {
748
- console.log(l.data.data.status);
782
+ console.log(u.data.data.status);
749
783
  break;
750
784
  }
751
785
  }
752
786
  });
753
- E(this, "setLocationData", (n) => {
754
- this.locationData = n;
787
+ g(this, "setLocationData", (i) => {
788
+ this.locationData = i;
755
789
  });
756
- E(this, "resizeHandler", () => {
790
+ g(this, "resizeHandler", () => {
757
791
  console.log("resize");
758
- const n = window.innerWidth, l = window.innerHeight, d = Math.abs(n - this.previousWidth), T = Math.abs(l - this.previousHeight);
759
- if (!(this.previousWidth === 0 && this.previousHeight === 0 || d >= this.RESIZE_THRESHOLD_WIDTH || T >= this.RESIZE_THRESHOLD_HEIGHT)) {
792
+ const i = window.innerWidth, u = window.innerHeight, d = Math.abs(i - this.previousWidth), A = Math.abs(u - this.previousHeight);
793
+ if (!(this.previousWidth === 0 && this.previousHeight === 0 || d >= this.RESIZE_THRESHOLD_WIDTH || A >= this.RESIZE_THRESHOLD_HEIGHT)) {
760
794
  console.log("resize ignored (likely address bar hide/show on mobile)");
761
795
  return;
762
796
  }
763
797
  this.isResizing = !0, this.resizeTimerID && clearTimeout(this.resizeTimerID), this.resizeTimerID = setTimeout(() => {
764
798
  console.log("triggered state change");
765
- const D = document.getElementById(
766
- "KYC_WIDGET"
767
- ), q = document.getElementById(
768
- "MainWindow"
769
- ), Z = document.getElementById(
770
- "Iframe_Container"
771
- ), W = Nt();
772
- X(Z, {
773
- width: W.width,
774
- height: W.height
775
- }), X(q, {
799
+ const m = document.getElementById(
800
+ this.iframeId
801
+ ), M = document.getElementById(
802
+ this.mainWindowId
803
+ ), J = document.getElementById(
804
+ this.iframeContainerId
805
+ ), F = xt();
806
+ Q(J, {
807
+ width: F.width,
808
+ height: F.height
809
+ }), Q(M, {
776
810
  width: `${window.innerWidth}px`,
777
811
  height: `${window.innerHeight}px`
778
- }), D.contentWindow && (D.contentWindow.postMessage(
812
+ }), m.contentWindow && (m.contentWindow.postMessage(
779
813
  {
780
814
  type: "RESPONSE_PARENT_RESIZED",
781
815
  data: {
@@ -785,62 +819,76 @@ class xn {
785
819
  }
786
820
  },
787
821
  this.domain
788
- ), console.log(q), console.log("triggered state change")), this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight;
822
+ ), console.log(M), console.log("triggered state change")), this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight;
789
823
  }, 1e3);
790
824
  });
791
- E(this, "setupResizingServices", () => {
792
- this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight, ue({
825
+ g(this, "setupResizingServices", () => {
826
+ this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight, fe({
793
827
  element: window,
794
828
  event: "resize",
795
829
  handler: this.resizeHandler
796
830
  });
797
831
  });
798
- E(this, "setUpHtml", async () => {
832
+ g(this, "setUpHtml", async () => {
799
833
  try {
800
- const n = Mn({
834
+ await this.close();
835
+ const i = document.getElementById(this.mainWindowId);
836
+ i && i.remove();
837
+ const u = Mn({
801
838
  removeElementFromDOM: this.close,
802
- onDismiss: this.KYC_VARS.onDismiss
839
+ onDismiss: this.KYC_VARS.onDismiss,
840
+ mainWindowId: this.mainWindowId
803
841
  });
804
- window.document.body.append(n);
805
- const l = await Cn({
842
+ window.document.body.append(u);
843
+ const d = await Nn({
806
844
  KYC_VARS: this.KYC_VARS,
807
- setLocationData: this.setLocationData
845
+ setLocationData: this.setLocationData,
846
+ iframeId: this.iframeId,
847
+ iframeContainerId: this.iframeContainerId
808
848
  });
809
- n.append(l);
849
+ u.append(d);
810
850
  } catch {
811
851
  console.error("Error setting up HTML");
812
852
  }
813
853
  });
814
- E(this, "setSessionType", (n) => n.Session_Type === "IDAuthentication" ? "/authenticate" : n.Session_Type === "IDVerification" ? "/verify" : "");
854
+ g(this, "setSessionType", (i) => i.Session_Type === "IDAuthentication" ? "/authenticate" : i.Session_Type === "IDVerification" ? "/verify" : "");
815
855
  // start - creates HTML div elements and appends to DOM body element.
816
- E(this, "startIDVerify", async (n) => {
856
+ g(this, "startIDVerify", async (i) => {
817
857
  try {
818
- if (!n || n === "") {
858
+ if (this.isClosing) {
859
+ console.warn("Widget is currently closing, please wait before starting a new session");
860
+ return;
861
+ }
862
+ if (!i || i === "") {
819
863
  console.error("You need a session ID to continue");
820
864
  return;
821
865
  }
822
866
  this.KYC_VARS = {
823
867
  ...this.KYC_VARS,
824
- session_id: n
825
- }, await this.setUpHtml(), this.setupResizingServices(), ue({
868
+ session_id: i
869
+ }, await this.setUpHtml(), this.setupResizingServices(), fe({
826
870
  element: window,
827
871
  event: "message",
828
872
  handler: this.windowEventListener
829
873
  });
830
874
  } catch {
831
- console.error("There was an error starting ID Authentication.");
875
+ console.error("There was an error starting ID Verification.");
832
876
  }
833
877
  });
834
- E(this, "startIDAuthenticate", async (n) => {
878
+ g(this, "startIDAuthenticate", async (i) => {
835
879
  try {
836
- if (!n || n === "") {
880
+ if (this.isClosing) {
881
+ console.warn("Widget is currently closing, please wait before starting a new session");
882
+ return;
883
+ }
884
+ if (!i || i === "") {
837
885
  console.error("You need a session ID to continue");
838
886
  return;
839
887
  }
840
888
  this.KYC_VARS = {
841
889
  ...this.KYC_VARS,
842
- session_id: n
843
- }, this.setUpHtml(), this.setupResizingServices(), ue({
890
+ session_id: i
891
+ }, await this.setUpHtml(), this.setupResizingServices(), fe({
844
892
  element: window,
845
893
  event: "message",
846
894
  handler: this.windowEventListener
@@ -849,35 +897,41 @@ class xn {
849
897
  console.error("There was an error starting ID Authentication.");
850
898
  }
851
899
  });
852
- E(this, "close", () => {
853
- const n = document.getElementById("MainWindow");
854
- n == null || n.remove();
855
- const l = document.getElementById("KYC_WIDGET");
856
- n && Ct(n), l && Ct(l), window.removeEventListener("resize", this.resizeHandler), window.removeEventListener("message", this.windowEventListener);
900
+ g(this, "close", async () => {
901
+ if (!this.isClosing) {
902
+ this.isClosing = !0;
903
+ try {
904
+ this.resizeTimerID && (clearTimeout(this.resizeTimerID), this.resizeTimerID = null), window.removeEventListener("resize", this.resizeHandler), window.removeEventListener("message", this.windowEventListener);
905
+ const i = document.getElementById(this.mainWindowId), u = document.getElementById(this.iframeId);
906
+ i && (Nt(i), i.remove()), u && Nt(u), await new Promise((d) => setTimeout(d, 0));
907
+ } finally {
908
+ this.isClosing = !1;
909
+ }
910
+ }
857
911
  });
858
- if (!n) {
912
+ if (!i) {
859
913
  console.error("Cannot initiate without initial configuration.");
860
914
  return;
861
915
  }
862
- if (!n.Session_Type) {
916
+ if (!i.Session_Type) {
863
917
  console.error("Cannot initiate without a Session_Type.");
864
918
  return;
865
919
  }
866
- if (!n.env) {
920
+ if (!i.env) {
867
921
  console.error("Environment is required. Please provide a valid environment.");
868
922
  return;
869
923
  }
870
- this.domain = xt(n.env), this.KYC_VARS = {
871
- ...n,
872
- sessionURL: this.setSessionType(n),
924
+ this.instanceId = `kyc-widget-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.mainWindowId = `${this.instanceId}-main-window`, this.iframeId = `${this.instanceId}-iframe`, this.iframeContainerId = `${this.instanceId}-iframe-container`, this.domain = Pt(i.env), this.KYC_VARS = {
925
+ ...i,
926
+ sessionURL: this.setSessionType(i),
873
927
  session_id: ""
874
928
  // Will be set when starting verification/authentication
875
929
  };
876
930
  }
877
931
  }
878
- const Pn = "IDAuthentication", kn = "IDVerification";
932
+ const kn = "IDAuthentication", Hn = "IDVerification";
879
933
  export {
880
- Pn as IDA,
881
- kn as IDV,
882
- xn as KYCWidget
934
+ kn as IDA,
935
+ Hn as IDV,
936
+ Pn as KYCWidget
883
937
  };