wrec 0.20.7 → 0.20.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/wrec.es.js CHANGED
@@ -6,19 +6,19 @@ var R = (i, t, e) => (Zt(i, t, "read from private field"), e ? e.call(i) : t.get
6
6
  const {
7
7
  entries: Ke,
8
8
  setPrototypeOf: ze,
9
- isFrozen: Ln,
9
+ isFrozen: Nn,
10
10
  getPrototypeOf: Dn,
11
11
  getOwnPropertyDescriptor: In
12
12
  } = Object;
13
13
  let {
14
- freeze: N,
14
+ freeze: L,
15
15
  seal: I,
16
16
  create: ce
17
17
  } = Object, {
18
18
  apply: le,
19
19
  construct: fe
20
20
  } = typeof Reflect < "u" && Reflect;
21
- N || (N = function(t) {
21
+ L || (L = function(t) {
22
22
  return t;
23
23
  });
24
24
  I || (I = function(t) {
@@ -34,8 +34,8 @@ fe || (fe = function(t) {
34
34
  n[s - 1] = arguments[s];
35
35
  return new t(...n);
36
36
  });
37
- const Mt = L(Array.prototype.forEach), Pn = L(Array.prototype.lastIndexOf), $e = L(Array.prototype.pop), ft = L(Array.prototype.push), vn = L(Array.prototype.splice), Lt = L(String.prototype.toLowerCase), Jt = L(String.prototype.toString), Qt = L(String.prototype.match), ut = L(String.prototype.replace), xn = L(String.prototype.indexOf), kn = L(String.prototype.trim), P = L(Object.prototype.hasOwnProperty), M = L(RegExp.prototype.test), pt = Fn(TypeError);
38
- function L(i) {
37
+ const Mt = N(Array.prototype.forEach), Pn = N(Array.prototype.lastIndexOf), $e = N(Array.prototype.pop), ft = N(Array.prototype.push), xn = N(Array.prototype.splice), Nt = N(String.prototype.toLowerCase), Jt = N(String.prototype.toString), Qt = N(String.prototype.match), ut = N(String.prototype.replace), vn = N(String.prototype.indexOf), kn = N(String.prototype.trim), P = N(Object.prototype.hasOwnProperty), M = N(RegExp.prototype.test), pt = Fn(TypeError);
38
+ function N(i) {
39
39
  return function(t) {
40
40
  t instanceof RegExp && (t.lastIndex = 0);
41
41
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
@@ -51,14 +51,14 @@ function Fn(i) {
51
51
  };
52
52
  }
53
53
  function d(i, t) {
54
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Lt;
54
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Nt;
55
55
  ze && ze(i, null);
56
56
  let n = t.length;
57
57
  for (; n--; ) {
58
58
  let s = t[n];
59
59
  if (typeof s == "string") {
60
60
  const r = e(s);
61
- r !== s && (Ln(t) || (t[n] = r), s = r);
61
+ r !== s && (Nn(t) || (t[n] = r), s = r);
62
62
  }
63
63
  i[s] = !0;
64
64
  }
@@ -80,9 +80,9 @@ function ht(i, t) {
80
80
  const n = In(i, t);
81
81
  if (n) {
82
82
  if (n.get)
83
- return L(n.get);
83
+ return N(n.get);
84
84
  if (typeof n.value == "function")
85
- return L(n.value);
85
+ return N(n.value);
86
86
  }
87
87
  i = Dn(i);
88
88
  }
@@ -91,7 +91,7 @@ function ht(i, t) {
91
91
  }
92
92
  return e;
93
93
  }
94
- const We = N(["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"]), te = N(["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"]), ee = N(["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"]), Hn = N(["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"]), ne = N(["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"]), zn = N(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ge = N(["#text"]), Be = N(["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 = N(["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"]), je = N(["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"]), Nt = N(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), $n = I(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Wn = I(/<%[\w\W]*|[\w\W]*%>/gm), Gn = I(/\$\{[\w\W]*/gm), Bn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), jn = I(/^aria-[\-\w]+$/), Ze = I(
94
+ const We = L(["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"]), te = L(["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"]), ee = L(["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"]), Hn = L(["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"]), ne = L(["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"]), zn = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ge = L(["#text"]), Be = L(["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 = L(["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"]), je = L(["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"]), Lt = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), $n = I(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Wn = I(/<%[\w\W]*|[\w\W]*%>/gm), Gn = I(/\$\{[\w\W]*/gm), Bn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), jn = I(/^aria-[\-\w]+$/), Ze = I(
95
95
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
96
96
  // eslint-disable-line no-useless-escape
97
97
  ), Yn = I(/^(?:\w+script|data):/i), Vn = I(
@@ -177,20 +177,20 @@ function Qe() {
177
177
  }
178
178
  let O, rt = "";
179
179
  const {
180
- implementation: xt,
180
+ implementation: vt,
181
181
  createNodeIterator: mn,
182
182
  createDocumentFragment: dn,
183
183
  getElementsByTagName: Tn
184
184
  } = e, {
185
- importNode: En
185
+ importNode: gn
186
186
  } = n;
187
187
  let C = Ve();
188
- t.isSupported = typeof Ke == "function" && typeof _t == "function" && xt && xt.createHTMLDocument !== void 0;
188
+ t.isSupported = typeof Ke == "function" && typeof _t == "function" && vt && vt.createHTMLDocument !== void 0;
189
189
  const {
190
190
  MUSTACHE_EXPR: kt,
191
191
  ERB_EXPR: Ft,
192
192
  TMPLIT_EXPR: Ut,
193
- DATA_ATTR: gn,
193
+ DATA_ATTR: En,
194
194
  ARIA_ATTR: An,
195
195
  IS_SCRIPT_OR_DATA: _n,
196
196
  ATTR_WHITESPACE: me,
@@ -201,8 +201,8 @@ function Qe() {
201
201
  } = Ye, _ = null;
202
202
  const Te = d({}, [...We, ...te, ...ee, ...ne, ...Ge]);
203
203
  let S = null;
204
- const Ee = d({}, [...Be, ...oe, ...je, ...Nt]);
205
- let E = Object.seal(ce(null, {
204
+ const ge = d({}, [...Be, ...oe, ...je, ...Lt]);
205
+ let g = Object.seal(ce(null, {
206
206
  tagNameCheck: {
207
207
  writable: !0,
208
208
  configurable: !1,
@@ -236,9 +236,9 @@ function Qe() {
236
236
  value: null
237
237
  }
238
238
  }));
239
- let ge = !0, zt = !0, Ae = !1, _e = !0, Z = !1, bt = !0, V = !1, $t = !1, Wt = !1, J = !1, St = !1, yt = !1, be = !0, Se = !1;
239
+ let Ee = !0, zt = !0, Ae = !1, _e = !0, Z = !1, bt = !0, V = !1, $t = !1, Wt = !1, J = !1, St = !1, yt = !1, be = !0, Se = !1;
240
240
  const Sn = "user-content-";
241
- let Gt = !0, ct = !1, Q = {}, v = null;
241
+ let Gt = !0, ct = !1, Q = {}, x = null;
242
242
  const Bt = d({}, ["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"]);
243
243
  let ye = null;
244
244
  const Re = d({}, ["audio", "video", "img", "source", "image", "track"]);
@@ -257,7 +257,7 @@ function Qe() {
257
257
  let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
258
258
  if (!(et && et === o)) {
259
259
  if ((!o || typeof o != "object") && (o = {}), o = k(o), lt = // eslint-disable-next-line unicorn/prefer-includes
260
- wn.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? On : o.PARSER_MEDIA_TYPE, A = lt === "application/xhtml+xml" ? Jt : Lt, _ = P(o, "ALLOWED_TAGS") ? d({}, o.ALLOWED_TAGS, A) : Te, S = P(o, "ALLOWED_ATTR") ? d({}, o.ALLOWED_ATTR, A) : Ee, Vt = P(o, "ALLOWED_NAMESPACES") ? d({}, o.ALLOWED_NAMESPACES, Jt) : yn, jt = P(o, "ADD_URI_SAFE_ATTR") ? d(k(we), o.ADD_URI_SAFE_ATTR, A) : we, ye = P(o, "ADD_DATA_URI_TAGS") ? d(k(Re), o.ADD_DATA_URI_TAGS, A) : Re, v = P(o, "FORBID_CONTENTS") ? d({}, o.FORBID_CONTENTS, A) : Bt, at = P(o, "FORBID_TAGS") ? d({}, o.FORBID_TAGS, A) : k({}), Ht = P(o, "FORBID_ATTR") ? d({}, o.FORBID_ATTR, A) : k({}), Q = P(o, "USE_PROFILES") ? o.USE_PROFILES : !1, ge = o.ALLOW_ARIA_ATTR !== !1, zt = o.ALLOW_DATA_ATTR !== !1, Ae = o.ALLOW_UNKNOWN_PROTOCOLS || !1, _e = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = o.SAFE_FOR_TEMPLATES || !1, bt = o.SAFE_FOR_XML !== !1, V = o.WHOLE_DOCUMENT || !1, J = o.RETURN_DOM || !1, St = o.RETURN_DOM_FRAGMENT || !1, yt = o.RETURN_TRUSTED_TYPE || !1, Wt = o.FORCE_BODY || !1, be = o.SANITIZE_DOM !== !1, Se = o.SANITIZE_NAMED_PROPS || !1, Gt = o.KEEP_CONTENT !== !1, ct = o.IN_PLACE || !1, de = o.ALLOWED_URI_REGEXP || Ze, tt = o.NAMESPACE || z, Ot = o.MATHML_TEXT_INTEGRATION_POINTS || Ot, Ct = o.HTML_INTEGRATION_POINTS || Ct, E = o.CUSTOM_ELEMENT_HANDLING || {}, o.CUSTOM_ELEMENT_HANDLING && Oe(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (E.tagNameCheck = o.CUSTOM_ELEMENT_HANDLING.tagNameCheck), o.CUSTOM_ELEMENT_HANDLING && Oe(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (E.attributeNameCheck = o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Z && (zt = !1), St && (J = !0), Q && (_ = d({}, Ge), S = [], Q.html === !0 && (d(_, We), d(S, Be)), Q.svg === !0 && (d(_, te), d(S, oe), d(S, Nt)), Q.svgFilters === !0 && (d(_, ee), d(S, oe), d(S, Nt)), Q.mathMl === !0 && (d(_, ne), d(S, je), d(S, Nt))), o.ADD_TAGS && (typeof o.ADD_TAGS == "function" ? K.tagCheck = o.ADD_TAGS : (_ === Te && (_ = k(_)), d(_, o.ADD_TAGS, A))), o.ADD_ATTR && (typeof o.ADD_ATTR == "function" ? K.attributeCheck = o.ADD_ATTR : (S === Ee && (S = k(S)), d(S, o.ADD_ATTR, A))), o.ADD_URI_SAFE_ATTR && d(jt, o.ADD_URI_SAFE_ATTR, A), o.FORBID_CONTENTS && (v === Bt && (v = k(v)), d(v, o.FORBID_CONTENTS, A)), o.ADD_FORBID_CONTENTS && (v === Bt && (v = k(v)), d(v, o.ADD_FORBID_CONTENTS, A)), Gt && (_["#text"] = !0), V && d(_, ["html", "head", "body"]), _.table && (d(_, ["tbody"]), delete at.tbody), o.TRUSTED_TYPES_POLICY) {
260
+ wn.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? On : o.PARSER_MEDIA_TYPE, A = lt === "application/xhtml+xml" ? Jt : Nt, _ = P(o, "ALLOWED_TAGS") ? d({}, o.ALLOWED_TAGS, A) : Te, S = P(o, "ALLOWED_ATTR") ? d({}, o.ALLOWED_ATTR, A) : ge, Vt = P(o, "ALLOWED_NAMESPACES") ? d({}, o.ALLOWED_NAMESPACES, Jt) : yn, jt = P(o, "ADD_URI_SAFE_ATTR") ? d(k(we), o.ADD_URI_SAFE_ATTR, A) : we, ye = P(o, "ADD_DATA_URI_TAGS") ? d(k(Re), o.ADD_DATA_URI_TAGS, A) : Re, x = P(o, "FORBID_CONTENTS") ? d({}, o.FORBID_CONTENTS, A) : Bt, at = P(o, "FORBID_TAGS") ? d({}, o.FORBID_TAGS, A) : k({}), Ht = P(o, "FORBID_ATTR") ? d({}, o.FORBID_ATTR, A) : k({}), Q = P(o, "USE_PROFILES") ? o.USE_PROFILES : !1, Ee = o.ALLOW_ARIA_ATTR !== !1, zt = o.ALLOW_DATA_ATTR !== !1, Ae = o.ALLOW_UNKNOWN_PROTOCOLS || !1, _e = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = o.SAFE_FOR_TEMPLATES || !1, bt = o.SAFE_FOR_XML !== !1, V = o.WHOLE_DOCUMENT || !1, J = o.RETURN_DOM || !1, St = o.RETURN_DOM_FRAGMENT || !1, yt = o.RETURN_TRUSTED_TYPE || !1, Wt = o.FORCE_BODY || !1, be = o.SANITIZE_DOM !== !1, Se = o.SANITIZE_NAMED_PROPS || !1, Gt = o.KEEP_CONTENT !== !1, ct = o.IN_PLACE || !1, de = o.ALLOWED_URI_REGEXP || Ze, tt = o.NAMESPACE || z, Ot = o.MATHML_TEXT_INTEGRATION_POINTS || Ot, Ct = o.HTML_INTEGRATION_POINTS || Ct, g = o.CUSTOM_ELEMENT_HANDLING || {}, o.CUSTOM_ELEMENT_HANDLING && Oe(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (g.tagNameCheck = o.CUSTOM_ELEMENT_HANDLING.tagNameCheck), o.CUSTOM_ELEMENT_HANDLING && Oe(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (g.attributeNameCheck = o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Z && (zt = !1), St && (J = !0), Q && (_ = d({}, Ge), S = [], Q.html === !0 && (d(_, We), d(S, Be)), Q.svg === !0 && (d(_, te), d(S, oe), d(S, Lt)), Q.svgFilters === !0 && (d(_, ee), d(S, oe), d(S, Lt)), Q.mathMl === !0 && (d(_, ne), d(S, je), d(S, Lt))), o.ADD_TAGS && (typeof o.ADD_TAGS == "function" ? K.tagCheck = o.ADD_TAGS : (_ === Te && (_ = k(_)), d(_, o.ADD_TAGS, A))), o.ADD_ATTR && (typeof o.ADD_ATTR == "function" ? K.attributeCheck = o.ADD_ATTR : (S === ge && (S = k(S)), d(S, o.ADD_ATTR, A))), o.ADD_URI_SAFE_ATTR && d(jt, o.ADD_URI_SAFE_ATTR, A), o.FORBID_CONTENTS && (x === Bt && (x = k(x)), d(x, o.FORBID_CONTENTS, A)), o.ADD_FORBID_CONTENTS && (x === Bt && (x = k(x)), d(x, o.ADD_FORBID_CONTENTS, A)), Gt && (_["#text"] = !0), V && d(_, ["html", "head", "body"]), _.table && (d(_, ["tbody"]), delete at.tbody), o.TRUSTED_TYPES_POLICY) {
261
261
  if (typeof o.TRUSTED_TYPES_POLICY.createHTML != "function")
262
262
  throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
263
263
  if (typeof o.TRUSTED_TYPES_POLICY.createScriptURL != "function")
@@ -265,7 +265,7 @@ function Qe() {
265
265
  O = o.TRUSTED_TYPES_POLICY, rt = O.createHTML("");
266
266
  } else
267
267
  O === void 0 && (O = Kn(H, s)), O !== null && typeof rt == "string" && (rt = O.createHTML(""));
268
- N && N(o), et = o;
268
+ L && L(o), et = o;
269
269
  }
270
270
  }, Ce = d({}, [...te, ...ee, ...Hn]), Me = d({}, [...ne, ...zn]), Mn = function(o) {
271
271
  let a = _t(o);
@@ -273,9 +273,9 @@ function Qe() {
273
273
  namespaceURI: tt,
274
274
  tagName: "template"
275
275
  });
276
- const l = Lt(o.tagName), T = Lt(a.tagName);
276
+ const l = Nt(o.tagName), T = Nt(a.tagName);
277
277
  return Vt[o.namespaceURI] ? o.namespaceURI === wt ? a.namespaceURI === z ? l === "svg" : a.namespaceURI === Rt ? l === "svg" && (T === "annotation-xml" || Ot[T]) : !!Ce[l] : o.namespaceURI === Rt ? a.namespaceURI === z ? l === "math" : a.namespaceURI === wt ? l === "math" && Ct[T] : !!Me[l] : o.namespaceURI === z ? a.namespaceURI === wt && !Ct[T] || a.namespaceURI === Rt && !Ot[T] ? !1 : !Me[l] && (Rn[l] || !Ce[l]) : !!(lt === "application/xhtml+xml" && Vt[o.namespaceURI]) : !1;
278
- }, x = function(o) {
278
+ }, v = function(o) {
279
279
  ft(t.removed, {
280
280
  element: o
281
281
  });
@@ -299,7 +299,7 @@ function Qe() {
299
299
  if (a.removeAttribute(o), o === "is")
300
300
  if (J || St)
301
301
  try {
302
- x(a);
302
+ v(a);
303
303
  } catch {
304
304
  }
305
305
  else
@@ -307,13 +307,13 @@ function Qe() {
307
307
  a.setAttribute(o, "");
308
308
  } catch {
309
309
  }
310
- }, Ne = function(o) {
310
+ }, Le = function(o) {
311
311
  let a = null, l = null;
312
312
  if (Wt)
313
313
  o = "<remove></remove>" + o;
314
314
  else {
315
- const g = Qt(o, /^[\r\n\t ]+/);
316
- l = g && g[0];
315
+ const E = Qt(o, /^[\r\n\t ]+/);
316
+ l = E && E[0];
317
317
  }
318
318
  lt === "application/xhtml+xml" && tt === z && (o = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + o + "</body></html>");
319
319
  const T = O ? O.createHTML(o) : o;
@@ -323,7 +323,7 @@ function Qe() {
323
323
  } catch {
324
324
  }
325
325
  if (!a || !a.documentElement) {
326
- a = xt.createDocument(tt, "template", null);
326
+ a = vt.createDocument(tt, "template", null);
327
327
  try {
328
328
  a.documentElement.innerHTML = Yt ? rt : T;
329
329
  } catch {
@@ -331,7 +331,7 @@ function Qe() {
331
331
  }
332
332
  const w = a.body || a.documentElement;
333
333
  return o && l && w.insertBefore(e.createTextNode(l), w.childNodes[0] || null), tt === z ? Tn.call(a, V ? "html" : "body")[0] : V ? a.documentElement : w;
334
- }, Le = function(o) {
334
+ }, Ne = function(o) {
335
335
  return mn.call(
336
336
  o.ownerDocument || o,
337
337
  o,
@@ -352,29 +352,29 @@ function Qe() {
352
352
  const Ie = function(o) {
353
353
  let a = null;
354
354
  if ($(C.beforeSanitizeElements, o, null), qt(o))
355
- return x(o), !0;
355
+ return v(o), !0;
356
356
  const l = A(o.nodeName);
357
357
  if ($(C.uponSanitizeElement, o, {
358
358
  tagName: l,
359
359
  allowedTags: _
360
360
  }), bt && o.hasChildNodes() && !De(o.firstElementChild) && M(/<[/\w!]/g, o.innerHTML) && M(/<[/\w!]/g, o.textContent) || o.nodeType === mt.progressingInstruction || bt && o.nodeType === mt.comment && M(/<[/\w]/g, o.data))
361
- return x(o), !0;
361
+ return v(o), !0;
362
362
  if (!(K.tagCheck instanceof Function && K.tagCheck(l)) && (!_[l] || at[l])) {
363
- if (!at[l] && ve(l) && (E.tagNameCheck instanceof RegExp && M(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
363
+ if (!at[l] && xe(l) && (g.tagNameCheck instanceof RegExp && M(g.tagNameCheck, l) || g.tagNameCheck instanceof Function && g.tagNameCheck(l)))
364
364
  return !1;
365
- if (Gt && !v[l]) {
365
+ if (Gt && !x[l]) {
366
366
  const T = _t(o) || o.parentNode, w = hn(o) || o.childNodes;
367
367
  if (w && T) {
368
- const g = w.length;
369
- for (let D = g - 1; D >= 0; --D) {
368
+ const E = w.length;
369
+ for (let D = E - 1; D >= 0; --D) {
370
370
  const W = fn(w[D], !0);
371
371
  W.__removalCount = (o.__removalCount || 0) + 1, T.insertBefore(W, pn(o));
372
372
  }
373
373
  }
374
374
  }
375
- return x(o), !0;
375
+ return v(o), !0;
376
376
  }
377
- return o instanceof p && !Mn(o) || (l === "noscript" || l === "noembed" || l === "noframes") && M(/<\/no(script|embed|frames)/i, o.innerHTML) ? (x(o), !0) : (Z && o.nodeType === mt.text && (a = o.textContent, Mt([kt, Ft, Ut], (T) => {
377
+ return o instanceof p && !Mn(o) || (l === "noscript" || l === "noembed" || l === "noframes") && M(/<\/no(script|embed|frames)/i, o.innerHTML) ? (v(o), !0) : (Z && o.nodeType === mt.text && (a = o.textContent, Mt([kt, Ft, Ut], (T) => {
378
378
  a = ut(a, T, " ");
379
379
  }), o.textContent !== a && (ft(t.removed, {
380
380
  element: o.cloneNode()
@@ -382,21 +382,21 @@ function Qe() {
382
382
  }, Pe = function(o, a, l) {
383
383
  if (be && (a === "id" || a === "name") && (l in e || l in Cn))
384
384
  return !1;
385
- if (!(zt && !Ht[a] && M(gn, a))) {
386
- if (!(ge && M(An, a))) {
385
+ if (!(zt && !Ht[a] && M(En, a))) {
386
+ if (!(Ee && M(An, a))) {
387
387
  if (!(K.attributeCheck instanceof Function && K.attributeCheck(a, o))) {
388
388
  if (!S[a] || Ht[a]) {
389
389
  if (
390
390
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
391
391
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
392
392
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
393
- !(ve(o) && (E.tagNameCheck instanceof RegExp && M(E.tagNameCheck, o) || E.tagNameCheck instanceof Function && E.tagNameCheck(o)) && (E.attributeNameCheck instanceof RegExp && M(E.attributeNameCheck, a) || E.attributeNameCheck instanceof Function && E.attributeNameCheck(a, o)) || // Alternative, second condition checks if it's an `is`-attribute, AND
393
+ !(xe(o) && (g.tagNameCheck instanceof RegExp && M(g.tagNameCheck, o) || g.tagNameCheck instanceof Function && g.tagNameCheck(o)) && (g.attributeNameCheck instanceof RegExp && M(g.attributeNameCheck, a) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(a, o)) || // Alternative, second condition checks if it's an `is`-attribute, AND
394
394
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
395
- a === "is" && E.allowCustomizedBuiltInElements && (E.tagNameCheck instanceof RegExp && M(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
395
+ a === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && M(g.tagNameCheck, l) || g.tagNameCheck instanceof Function && g.tagNameCheck(l)))
396
396
  ) return !1;
397
397
  } else if (!jt[a]) {
398
398
  if (!M(de, ut(l, me, ""))) {
399
- if (!((a === "src" || a === "xlink:href" || a === "href") && o !== "script" && xn(l, "data:") === 0 && ye[o])) {
399
+ if (!((a === "src" || a === "xlink:href" || a === "href") && o !== "script" && vn(l, "data:") === 0 && ye[o])) {
400
400
  if (!(Ae && !M(_n, ut(l, me, "")))) {
401
401
  if (l)
402
402
  return !1;
@@ -408,9 +408,9 @@ function Qe() {
408
408
  }
409
409
  }
410
410
  return !0;
411
- }, ve = function(o) {
412
- return o !== "annotation-xml" && Qt(o, bn);
413
411
  }, xe = function(o) {
412
+ return o !== "annotation-xml" && Qt(o, bn);
413
+ }, ve = function(o) {
414
414
  $(C.beforeSanitizeAttributes, o, null);
415
415
  const {
416
416
  attributes: a
@@ -427,27 +427,27 @@ function Qe() {
427
427
  let T = a.length;
428
428
  for (; T--; ) {
429
429
  const w = a[T], {
430
- name: g,
430
+ name: E,
431
431
  namespaceURI: D,
432
432
  value: W
433
- } = w, nt = A(g), Kt = W;
434
- let y = g === "value" ? Kt : kn(Kt);
435
- if (l.attrName = nt, l.attrValue = y, l.keepAttr = !0, l.forceKeepAttr = void 0, $(C.uponSanitizeAttribute, o, l), y = l.attrValue, Se && (nt === "id" || nt === "name") && (X(g, o), y = Sn + y), bt && M(/((--!?|])>)|<\/(style|title|textarea)/i, y)) {
436
- X(g, o);
433
+ } = w, nt = A(E), Kt = W;
434
+ let y = E === "value" ? Kt : kn(Kt);
435
+ if (l.attrName = nt, l.attrValue = y, l.keepAttr = !0, l.forceKeepAttr = void 0, $(C.uponSanitizeAttribute, o, l), y = l.attrValue, Se && (nt === "id" || nt === "name") && (X(E, o), y = Sn + y), bt && M(/((--!?|])>)|<\/(style|title|textarea)/i, y)) {
436
+ X(E, o);
437
437
  continue;
438
438
  }
439
439
  if (nt === "attributename" && Qt(y, "href")) {
440
- X(g, o);
440
+ X(E, o);
441
441
  continue;
442
442
  }
443
443
  if (l.forceKeepAttr)
444
444
  continue;
445
445
  if (!l.keepAttr) {
446
- X(g, o);
446
+ X(E, o);
447
447
  continue;
448
448
  }
449
449
  if (!_e && M(/\/>/i, y)) {
450
- X(g, o);
450
+ X(E, o);
451
451
  continue;
452
452
  }
453
453
  Z && Mt([kt, Ft, Ut], (Fe) => {
@@ -455,7 +455,7 @@ function Qe() {
455
455
  });
456
456
  const ke = A(o.nodeName);
457
457
  if (!Pe(ke, nt, y)) {
458
- X(g, o);
458
+ X(E, o);
459
459
  continue;
460
460
  }
461
461
  if (O && typeof H == "object" && typeof H.getAttributeType == "function" && !D)
@@ -471,17 +471,17 @@ function Qe() {
471
471
  }
472
472
  if (y !== Kt)
473
473
  try {
474
- D ? o.setAttributeNS(D, g, y) : o.setAttribute(g, y), qt(o) ? x(o) : $e(t.removed);
474
+ D ? o.setAttributeNS(D, E, y) : o.setAttribute(E, y), qt(o) ? v(o) : $e(t.removed);
475
475
  } catch {
476
- X(g, o);
476
+ X(E, o);
477
477
  }
478
478
  }
479
479
  $(C.afterSanitizeAttributes, o, null);
480
- }, Nn = function f(o) {
480
+ }, Ln = function f(o) {
481
481
  let a = null;
482
- const l = Le(o);
482
+ const l = Ne(o);
483
483
  for ($(C.beforeSanitizeShadowDOM, o, null); a = l.nextNode(); )
484
- $(C.uponSanitizeShadowNode, a, null), Ie(a), xe(a), a.content instanceof r && f(a.content);
484
+ $(C.uponSanitizeShadowNode, a, null), Ie(a), ve(a), a.content instanceof r && f(a.content);
485
485
  $(C.afterSanitizeShadowDOM, o, null);
486
486
  };
487
487
  return t.sanitize = function(f) {
@@ -501,18 +501,18 @@ function Qe() {
501
501
  throw pt("root node is forbidden and cannot be sanitized in-place");
502
502
  }
503
503
  } else if (f instanceof u)
504
- a = Ne("<!---->"), l = a.ownerDocument.importNode(f, !0), l.nodeType === mt.element && l.nodeName === "BODY" || l.nodeName === "HTML" ? a = l : a.appendChild(l);
504
+ a = Le("<!---->"), l = a.ownerDocument.importNode(f, !0), l.nodeType === mt.element && l.nodeName === "BODY" || l.nodeName === "HTML" ? a = l : a.appendChild(l);
505
505
  else {
506
506
  if (!J && !Z && !V && // eslint-disable-next-line unicorn/prefer-includes
507
507
  f.indexOf("<") === -1)
508
508
  return O && yt ? O.createHTML(f) : f;
509
- if (a = Ne(f), !a)
509
+ if (a = Le(f), !a)
510
510
  return J ? null : yt ? rt : "";
511
511
  }
512
- a && Wt && x(a.firstChild);
513
- const g = Le(ct ? f : a);
514
- for (; T = g.nextNode(); )
515
- Ie(T), xe(T), T.content instanceof r && Nn(T.content);
512
+ a && Wt && v(a.firstChild);
513
+ const E = Ne(ct ? f : a);
514
+ for (; T = E.nextNode(); )
515
+ Ie(T), ve(T), T.content instanceof r && Ln(T.content);
516
516
  if (ct)
517
517
  return f;
518
518
  if (J) {
@@ -521,7 +521,7 @@ function Qe() {
521
521
  w.appendChild(a.firstChild);
522
522
  else
523
523
  w = a;
524
- return (S.shadowroot || S.shadowrootmode) && (w = En.call(n, w, !0)), w;
524
+ return (S.shadowroot || S.shadowrootmode) && (w = gn.call(n, w, !0)), w;
525
525
  }
526
526
  let D = V ? a.outerHTML : a.innerHTML;
527
527
  return V && _["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && M(Je, a.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
@@ -542,7 +542,7 @@ function Qe() {
542
542
  }, t.removeHook = function(f, o) {
543
543
  if (o !== void 0) {
544
544
  const a = Pn(C[f], o);
545
- return a === -1 ? void 0 : vn(C[f], a, 1)[0];
545
+ return a === -1 ? void 0 : xn(C[f], a, 1)[0];
546
546
  }
547
547
  return $e(C[f]);
548
548
  }, t.removeHooks = function(f) {
@@ -588,21 +588,21 @@ function nn(i) {
588
588
  const Dt = typeof window < "u" && typeof window.document < "u";
589
589
  let Xe = class extends Error {
590
590
  };
591
- var q, Pt, F, gt, At, Y, vt, on;
591
+ var q, Pt, F, Et, At, Y, xt, on;
592
592
  const it = class it {
593
593
  constructor(t, e, n) {
594
- j(this, vt);
594
+ j(this, xt);
595
595
  j(this, Pt, /* @__PURE__ */ Symbol("objectId"));
596
596
  // This cannot be replaced by a WeakMap<ChangeListener, Set<string>>
597
597
  // because there is no way to iterate over the keys of a WeakMap.
598
598
  j(this, F, []);
599
- j(this, gt);
599
+ j(this, Et);
600
600
  j(this, At);
601
601
  j(this, Y);
602
602
  if (!t) throw new Xe("name cannot be empty");
603
603
  if (R(it, q).has(t))
604
604
  throw new Xe(`WrecState with name "${t}" already exists`);
605
- if (ot(this, gt, t), ot(this, At, e), ot(this, Y, en({}, He(this, vt, on).bind(this))), e && Dt) {
605
+ if (ot(this, Et, t), ot(this, At, e), ot(this, Y, en({}, He(this, xt, on).bind(this))), e && Dt) {
606
606
  const s = sessionStorage.getItem("wrec-state-" + t), r = s ? JSON.parse(s) : void 0;
607
607
  r && (n = r);
608
608
  }
@@ -659,7 +659,7 @@ const it = class it {
659
659
  // This is useful for debugging from the DevTools console.
660
660
  // For example: state.log()
661
661
  log() {
662
- console.log("WrecState:", R(this, gt));
662
+ console.log("WrecState:", R(this, Et));
663
663
  for (const [t, e] of Object.entries(R(this, Y)))
664
664
  console.log(` ${t} = ${JSON.stringify(e)}`);
665
665
  }
@@ -667,7 +667,7 @@ const it = class it {
667
667
  ot(this, F, R(this, F).filter((e) => e.listenerRef.deref() !== t));
668
668
  }
669
669
  };
670
- q = new WeakMap(), Pt = new WeakMap(), F = new WeakMap(), gt = new WeakMap(), At = new WeakMap(), Y = new WeakMap(), vt = new WeakSet(), on = function(t, e, n) {
670
+ q = new WeakMap(), Pt = new WeakMap(), F = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), Y = new WeakMap(), xt = new WeakSet(), on = function(t, e, n) {
671
671
  const s = /* @__PURE__ */ new Set();
672
672
  for (const r of R(this, F)) {
673
673
  const c = r.listenerRef.deref();
@@ -713,9 +713,10 @@ function Zn(i, t, e) {
713
713
  }
714
714
  const Jn = /* @__PURE__ */ new Set([
715
715
  "class",
716
+ "disabled",
716
717
  "hidden",
717
718
  "id",
718
- "disabled",
719
+ "tabindex",
719
720
  "title"
720
721
  ]), Qn = /* @__PURE__ */ new Set([
721
722
  "onblur",
@@ -733,18 +734,18 @@ tn.addHook("uponSanitizeAttribute", (i, t) => {
733
734
  });
734
735
  class st extends Error {
735
736
  }
736
- const to = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, sn = "a-zA-Z_$", eo = sn + "0-9", Et = `[${sn}][${eo}]*`, no = /<!--\s*(.*?)\s*-->/, oo = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, se = new RegExp(`^this\\.${Et}$`), ie = new RegExp(`this\\.${Et}(\\.${Et})*`, "g"), rn = new RegExp(`this\\.${Et}(\\.${Et})*`), so = /* @__PURE__ */ new Set(["class", "style"]), io = 5;
737
- function ro(i) {
737
+ const to = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, sn = "a-zA-Z_$", eo = sn + "0-9", gt = `[${sn}][${eo}]*`, no = /<!--\s*(.*?)\s*-->/, oo = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, se = new RegExp(`^this\\.${gt}$`), ie = new RegExp(`this\\.${gt}(\\.${gt})*`, "g"), rn = new RegExp(`this\\.${gt}(\\.${gt})*`), so = 5;
738
+ function io(i) {
738
739
  return i instanceof HTMLButtonElement || i instanceof HTMLFieldSetElement || i instanceof HTMLInputElement || i instanceof HTMLSelectElement || i instanceof HTMLTextAreaElement || i instanceof U;
739
740
  }
740
- function ho(i, t, e) {
741
+ function po(i, t, e) {
741
742
  const n = document.createElement(i);
742
743
  if (t)
743
744
  for (const [s, r] of Object.entries(t))
744
745
  n.setAttribute(s, r);
745
746
  return e && (n.innerHTML = e), n;
746
747
  }
747
- const ao = (i) => i === String ? "" : i === Number ? 0 : i === Boolean ? !1 : i === Array ? [] : i === Object ? {} : void 0;
748
+ const ro = (i) => i === String ? "" : i === Number ? 0 : i === Boolean ? !1 : i === Array ? [] : i === Object ? {} : void 0;
748
749
  function It(i) {
749
750
  const t = [];
750
751
  let e = i.firstElementChild;
@@ -752,7 +753,7 @@ function It(i) {
752
753
  t.push(e), e.shadowRoot && t.push(...It(e.shadowRoot)), e.firstElementChild && t.push(...It(e)), e = e.nextElementSibling;
753
754
  return t;
754
755
  }
755
- const dt = (i) => i.substring(io).split(".")[0];
756
+ const dt = (i) => i.substring(so).split(".")[0];
756
757
  function an(i, t) {
757
758
  let e = i[0];
758
759
  return t.forEach((n, s) => {
@@ -770,11 +771,11 @@ function he(i) {
770
771
  const { localName: t } = i;
771
772
  return t === "input" || t === "select";
772
773
  }
773
- const co = (i) => i.replace(/<!--[\s\S]*?-->/g, "");
774
+ const ao = (i) => i.replace(/<!--[\s\S]*?-->/g, "");
774
775
  function cn(i, t, e, n) {
775
776
  return i.slice(0, t) + n + i.slice(t + e);
776
777
  }
777
- function lo(i) {
778
+ function co(i) {
778
779
  let t = i.trim(), e = null;
779
780
  /^\s*<tr[\s>]/i.test(t) ? (t = `<table><tbody>${t}</tbody></table>`, e = "tbody") : /^\s*<(td|th)[\s>]/i.test(t) ? (t = `<table><tbody><tr>${t}</tr></tbody></table>`, e = "tr") : /^\s*<option[\s>]/i.test(t) ? (t = `<select>${t}</select>`, e = "select") : /^\s*<col[\s>]/i.test(t) && (t = `<table><colgroup>${t}</colgroup></table>`, e = "colgroup");
780
781
  const n = tn.sanitize(t, {
@@ -813,7 +814,7 @@ function ae(i, t, e) {
813
814
  const [n, s] = t.split(":");
814
815
  i instanceof CSSStyleRule ? i.style.setProperty(n, e) : (ln(i, n, e), n === "value" && he(i) && (i.value = e));
815
816
  }
816
- async function fo(i) {
817
+ async function lo(i) {
817
818
  const t = /* @__PURE__ */ new Set();
818
819
  for (const n of It(i.content)) {
819
820
  const { localName: s } = n;
@@ -925,7 +926,7 @@ class U extends HTMLElement {
925
926
  if (!s) throw new st("static property html must be set");
926
927
  s.startsWith("<") || (s = `<span><!--${s}--></span>`), e.innerHTML = n + s;
927
928
  }
928
- await fo(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
929
+ await lo(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
929
930
  }
930
931
  changed(t, e, n) {
931
932
  this[e] = n;
@@ -952,8 +953,8 @@ class U extends HTMLElement {
952
953
  e.required && !r && this.#e(this, t, "is a required attribute");
953
954
  let c = e.value;
954
955
  this.hasOwnProperty(t) && (c = this[t], delete this[t]);
955
- const { type: u } = e, p = u === Boolean ? c || r : n.includes(s) && r ? this.#A(t, s) : c || ao(u), h = "#" + t;
956
- this[h] = p, e.computed && this.#N(t, e), Object.defineProperty(this, t, {
956
+ const { type: u } = e, p = u === Boolean ? c || r : n.includes(s) && r ? this.#A(t, s) : c || ro(u), h = "#" + t;
957
+ this[h] = p, e.computed && this.#L(t, e), Object.defineProperty(this, t, {
957
958
  enumerable: !0,
958
959
  get() {
959
960
  return this[h];
@@ -962,9 +963,9 @@ class U extends HTMLElement {
962
963
  u === Number && typeof m == "string" && (m = re(m));
963
964
  const b = this[h];
964
965
  if (m === b) return;
965
- this.#x(t, u, m), this[h] = m;
966
+ this.#v(t, u, m), this[h] = m;
966
967
  const { state: G, stateProp: H } = this.#t.properties[t];
967
- H && Zn(G, H, m), this.#D(t), this.#L(t, u, m, s), this.#g(t), this.#I(t, m);
968
+ H && Zn(G, H, m), this.#D(t), this.#N(t, u, m, s), this.#E(t), this.#I(t, m);
968
969
  const B = this.#c[t];
969
970
  B && this.setFormValue(B, String(m)), this.propertyChangedCallback(t, b, m), e.dispatch && this.dispatch("change", {
970
971
  tagName: this.localName,
@@ -978,7 +979,7 @@ class U extends HTMLElement {
978
979
  #m() {
979
980
  const t = this.hasAttribute("disabled"), e = It(this.shadowRoot);
980
981
  for (const n of e)
981
- ro(n) && (n.disabled = t);
982
+ io(n) && (n.disabled = t);
982
983
  }
983
984
  disconnectedCallback() {
984
985
  this.#n.clear(), this.#l.clear(), this.#u.clear();
@@ -1000,7 +1001,7 @@ class U extends HTMLElement {
1000
1001
  #O(t) {
1001
1002
  const e = t instanceof U;
1002
1003
  for (const n of t.getAttributeNames()) {
1003
- const s = t.getAttribute(n), r = this.#E(t, s);
1004
+ const s = t.getAttribute(n), r = this.#g(t, s);
1004
1005
  if (r) {
1005
1006
  const c = this[r];
1006
1007
  c === void 0 && this.#a(t, n, r), t[r] = c;
@@ -1042,7 +1043,7 @@ class U extends HTMLElement {
1042
1043
  s && (n = s.textContent?.trim() ?? "");
1043
1044
  }
1044
1045
  if (n) {
1045
- const s = this.#E(t, n);
1046
+ const s = this.#g(t, n);
1046
1047
  s && Tt(t) ? t.textContent = this[s] : this.#r(n, t);
1047
1048
  }
1048
1049
  }
@@ -1101,7 +1102,7 @@ class U extends HTMLElement {
1101
1102
  const { target: b } = m;
1102
1103
  if (!b) return;
1103
1104
  const G = b.value, { type: H } = this.#t.properties[h];
1104
- this[h] = H === Number ? re(G) : G, this.#g(h);
1105
+ this[h] = H === Number ? re(G) : G, this.#E(h);
1105
1106
  });
1106
1107
  }
1107
1108
  #i(t) {
@@ -1129,12 +1130,12 @@ class U extends HTMLElement {
1129
1130
  // Subclasses can override this to add functionality.
1130
1131
  propertyChangedCallback(t, e, n) {
1131
1132
  }
1132
- #E(t, e) {
1133
+ #g(t, e) {
1133
1134
  if (!e || !se.test(e)) return;
1134
1135
  const n = dt(e);
1135
1136
  return this[n] === void 0 && this.#a(t, "", n), n;
1136
1137
  }
1137
- #g(t) {
1138
+ #E(t) {
1138
1139
  const s = this.#t.propToExprsMap.get(t) || [];
1139
1140
  for (const r of s) {
1140
1141
  let c = this.#o(r);
@@ -1148,7 +1149,7 @@ class U extends HTMLElement {
1148
1149
  }
1149
1150
  }
1150
1151
  }
1151
- #N(t, e) {
1152
+ #L(t, e) {
1152
1153
  const { computed: n, uses: s } = e, r = this.#t.propToComputedMap;
1153
1154
  function c(p, h) {
1154
1155
  let m = r.get(p);
@@ -1228,7 +1229,7 @@ class U extends HTMLElement {
1228
1229
  }
1229
1230
  // Updates the matching attribute for a property if there is one.
1230
1231
  // VS Code thinks this is never called, but it is called by #defineProp.
1231
- #L(t, e, n, s) {
1232
+ #N(t, e, n, s) {
1232
1233
  if (pe(n) && this.hasAttribute(s)) {
1233
1234
  const r = e === Boolean ? this.hasAttribute(s) : this.#A(t, s);
1234
1235
  n !== r && ln(this, t, n);
@@ -1255,7 +1256,7 @@ class U extends HTMLElement {
1255
1256
  if (t instanceof HTMLElement && Tt(t))
1256
1257
  t.value = r;
1257
1258
  else if (n && s === "string" && r.trim().startsWith("<")) {
1258
- const c = lo(r);
1259
+ const c = co(r);
1259
1260
  t.replaceChildren(...c), this.#S(t), this.#d(t);
1260
1261
  } else n && (t.textContent = r);
1261
1262
  }
@@ -1282,7 +1283,7 @@ class U extends HTMLElement {
1282
1283
  for (const n of Object.keys(t))
1283
1284
  e[n] = n;
1284
1285
  }
1285
- this.#v(t, e);
1286
+ this.#x(t, e);
1286
1287
  for (const [n, s] of Object.entries(e))
1287
1288
  if (this.#i(s)) {
1288
1289
  const r = qe(t, n);
@@ -1293,25 +1294,19 @@ class U extends HTMLElement {
1293
1294
  t.addListener(this, e);
1294
1295
  }
1295
1296
  #P() {
1296
- const t = this.#t, e = new Set(Object.keys(t.properties));
1297
- for (const n of e)
1298
- so.has(n) && this.#e(
1299
- null,
1300
- "",
1301
- `property "${n}" is not allowed because it is a reserved attribute`
1302
- );
1303
- for (const n of this.getAttributeNames())
1304
- if (!Jn.has(n) && !n.startsWith("on")) {
1305
- if (n === "form-assoc") {
1297
+ const t = new Set(Object.keys(this.#t.properties));
1298
+ for (const e of this.getAttributeNames())
1299
+ if (!Jn.has(e) && !e.startsWith("on")) {
1300
+ if (e === "form-assoc") {
1306
1301
  this.#T();
1307
1302
  continue;
1308
1303
  }
1309
- if (!e.has(U.getPropName(n))) {
1310
- if (n === "name") {
1304
+ if (!t.has(U.getPropName(e))) {
1305
+ if (e === "name") {
1311
1306
  this.#T();
1312
1307
  continue;
1313
1308
  }
1314
- this.#e(null, n, "is not a supported attribute");
1309
+ this.#e(null, e, "is not a supported attribute");
1315
1310
  }
1316
1311
  }
1317
1312
  }
@@ -1323,7 +1318,7 @@ class U extends HTMLElement {
1323
1318
  this[c] === void 0 && this.#a(t, e, c);
1324
1319
  }), s;
1325
1320
  }
1326
- #v(t, e) {
1321
+ #x(t, e) {
1327
1322
  for (const [n, s] of Object.entries(e)) {
1328
1323
  let r = qe(t, n);
1329
1324
  if (r === void 0)
@@ -1337,7 +1332,7 @@ class U extends HTMLElement {
1337
1332
  }
1338
1333
  // When type is an array, this can't validate the type of the array elements.
1339
1334
  // This is called by #defineProp.
1340
- #x(t, e, n) {
1335
+ #v(t, e, n) {
1341
1336
  if (n instanceof e) return;
1342
1337
  let s = typeof n;
1343
1338
  if (s === "object") {
@@ -1374,7 +1369,7 @@ class U extends HTMLElement {
1374
1369
  }
1375
1370
  }
1376
1371
  }
1377
- function mo(i, ...t) {
1372
+ function ho(i, ...t) {
1378
1373
  let e = an(i, t);
1379
1374
  for (; ; ) {
1380
1375
  const n = to.exec(e);
@@ -1391,12 +1386,12 @@ function mo(i, ...t) {
1391
1386
  }
1392
1387
  return e;
1393
1388
  }
1394
- function To(i, ...t) {
1389
+ function mo(i, ...t) {
1395
1390
  let e = an(i, t);
1396
1391
  for (; ; ) {
1397
1392
  const n = oo.exec(e);
1398
1393
  if (!n || n[1] === "style") break;
1399
- const s = co(n[2]);
1394
+ const s = ao(n[2]);
1400
1395
  if (rn.test(s)) {
1401
1396
  const r = `<!-- ${s.trim()} -->`, c = n.index + n[0].indexOf(">") + 1;
1402
1397
  e = cn(e, c, s.length, r);
@@ -1407,7 +1402,7 @@ function To(i, ...t) {
1407
1402
  export {
1408
1403
  U as Wrec,
1409
1404
  ue as WrecState,
1410
- ho as createElement,
1411
- mo as css,
1412
- To as html
1405
+ po as createElement,
1406
+ ho as css,
1407
+ mo as html
1413
1408
  };
package/dist/wrec.umd.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(T,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(T=typeof globalThis<"u"?globalThis:T||self,E(T.wrec={}))})(this,(function(T){"use strict";var ln=T=>{throw TypeError(T)};var ge=(T,E,M)=>E.has(T)||ln("Cannot "+M);var O=(T,E,M)=>(ge(T,E,"read from private field"),M?M.call(T):E.get(T)),q=(T,E,M)=>E.has(T)?ln("Cannot add the same private member more than once"):E instanceof WeakSet?E.add(T):E.set(T,M),ct=(T,E,M,yt)=>(ge(T,E,"write to private field"),yt?yt.call(T,M):E.set(T,M),M),fn=(T,E,M)=>(ge(T,E,"access private method"),M);var K,Lt,H,gt,Et,Y,Dt,un;const{entries:E,setPrototypeOf:M,isFrozen:yt,getPrototypeOf:pn,getOwnPropertyDescriptor:hn}=Object;let{freeze:N,seal:x,create:zt}=Object,{apply:$t,construct:Wt}=typeof Reflect<"u"&&Reflect;N||(N=function(t){return t}),x||(x=function(t){return t}),$t||($t=function(t,e){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];return t.apply(e,s)}),Wt||(Wt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return new t(...n)});const Rt=D(Array.prototype.forEach),mn=D(Array.prototype.lastIndexOf),Ee=D(Array.prototype.pop),lt=D(Array.prototype.push),dn=D(Array.prototype.splice),wt=D(String.prototype.toLowerCase),Gt=D(String.prototype.toString),Bt=D(String.prototype.match),ft=D(String.prototype.replace),Tn=D(String.prototype.indexOf),gn=D(String.prototype.trim),k=D(Object.prototype.hasOwnProperty),L=D(RegExp.prototype.test),ut=En(TypeError);function D(r){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return $t(r,t,n)}}function En(r){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Wt(r,e)}}function d(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wt;M&&M(r,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=e(s);i!==s&&(yt(t)||(t[n]=i),s=i)}r[s]=!0}return r}function An(r){for(let t=0;t<r.length;t++)k(r,t)||(r[t]=null);return r}function U(r){const t=zt(null);for(const[e,n]of E(r))k(r,e)&&(Array.isArray(n)?t[e]=An(n):n&&typeof n=="object"&&n.constructor===Object?t[e]=U(n):t[e]=n);return t}function pt(r,t){for(;r!==null;){const n=hn(r,t);if(n){if(n.get)return D(n.get);if(typeof n.value=="function")return D(n.value)}r=pn(r)}function e(){return null}return e}const Ae=N(["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=N(["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"]),Yt=N(["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"]),_n=N(["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"]),Vt=N(["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"]),bn=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_e=N(["#text"]),be=N(["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"]),Xt=N(["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"]),Se=N(["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"]),Ot=N(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sn=x(/\{\{[\w\W]*|[\w\W]*\}\}/gm),yn=x(/<%[\w\W]*|[\w\W]*%>/gm),Rn=x(/\$\{[\w\W]*/gm),wn=x(/^data-[\-\w.\u00B7-\uFFFF]+$/),On=x(/^aria-[\-\w]+$/),ye=x(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cn=x(/^(?:\w+script|data):/i),Mn=x(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Re=x(/^html$/i),Nn=x(/^[a-z][.\w]*(-[.\w]+)+$/i);var we=Object.freeze({__proto__:null,ARIA_ATTR:On,ATTR_WHITESPACE:Mn,CUSTOM_ELEMENT:Nn,DATA_ATTR:wn,DOCTYPE_NAME:Re,ERB_EXPR:yn,IS_ALLOWED_URI:ye,IS_SCRIPT_OR_DATA:Cn,MUSTACHE_EXPR:Sn,TMPLIT_EXPR:Rn});const ht={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ln=function(){return typeof window>"u"?null:window},Dn=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";e&&e.hasAttribute(s)&&(n=e.getAttribute(s));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Oe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ce(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ln();const t=f=>Ce(f);if(t.version="3.3.1",t.removed=[],!r||!r.document||r.document.nodeType!==ht.document||!r.Element)return t.isSupported=!1,t;let{document:e}=r;const n=e,s=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:c,Node:u,Element:p,NodeFilter:h,NamedNodeMap:m=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:y,DOMParser:V,trustedTypes:W}=r,X=p.prototype,qn=pt(X,"cloneNode"),Kn=pt(X,"remove"),Zn=pt(X,"nextSibling"),Jn=pt(X,"childNodes"),It=pt(X,"parentNode");if(typeof c=="function"){const f=e.createElement("template");f.content&&f.content.ownerDocument&&(e=f.content.ownerDocument)}let I,At="";const{implementation:ee,createNodeIterator:Qn,createDocumentFragment:to,getElementsByTagName:eo}=e,{importNode:no}=n;let P=Oe();t.isSupported=typeof E=="function"&&typeof It=="function"&&ee&&ee.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ne,ERB_EXPR:oe,TMPLIT_EXPR:se,DATA_ATTR:oo,ARIA_ATTR:so,IS_SCRIPT_OR_DATA:io,ATTR_WHITESPACE:Ue,CUSTOM_ELEMENT:ro}=we;let{IS_ALLOWED_URI:He}=we,S=null;const ze=d({},[...Ae,...jt,...Yt,...Vt,..._e]);let R=null;const $e=d({},[...be,...Xt,...Se,...Ot]);let A=Object.seal(zt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_t=null,ie=null;const et=Object.seal(zt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let We=!0,re=!0,Ge=!1,Be=!0,nt=!1,Pt=!0,Z=!1,ae=!1,ce=!1,ot=!1,vt=!1,xt=!1,je=!0,Ye=!1;const ao="user-content-";let le=!0,bt=!1,st={},z=null;const fe=d({},["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"]);let Ve=null;const Xe=d({},["audio","video","img","source","image","track"]);let ue=null;const qe=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kt="http://www.w3.org/1998/Math/MathML",Ft="http://www.w3.org/2000/svg",G="http://www.w3.org/1999/xhtml";let it=G,pe=!1,he=null;const co=d({},[kt,Ft,G],Gt);let Ut=d({},["mi","mo","mn","ms","mtext"]),Ht=d({},["annotation-xml"]);const lo=d({},["title","style","font","a","script"]);let St=null;const fo=["application/xhtml+xml","text/html"],uo="text/html";let b=null,rt=null;const po=e.createElement("form"),Ke=function(o){return o instanceof RegExp||o instanceof Function},me=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rt&&rt===o)){if((!o||typeof o!="object")&&(o={}),o=U(o),St=fo.indexOf(o.PARSER_MEDIA_TYPE)===-1?uo:o.PARSER_MEDIA_TYPE,b=St==="application/xhtml+xml"?Gt:wt,S=k(o,"ALLOWED_TAGS")?d({},o.ALLOWED_TAGS,b):ze,R=k(o,"ALLOWED_ATTR")?d({},o.ALLOWED_ATTR,b):$e,he=k(o,"ALLOWED_NAMESPACES")?d({},o.ALLOWED_NAMESPACES,Gt):co,ue=k(o,"ADD_URI_SAFE_ATTR")?d(U(qe),o.ADD_URI_SAFE_ATTR,b):qe,Ve=k(o,"ADD_DATA_URI_TAGS")?d(U(Xe),o.ADD_DATA_URI_TAGS,b):Xe,z=k(o,"FORBID_CONTENTS")?d({},o.FORBID_CONTENTS,b):fe,_t=k(o,"FORBID_TAGS")?d({},o.FORBID_TAGS,b):U({}),ie=k(o,"FORBID_ATTR")?d({},o.FORBID_ATTR,b):U({}),st=k(o,"USE_PROFILES")?o.USE_PROFILES:!1,We=o.ALLOW_ARIA_ATTR!==!1,re=o.ALLOW_DATA_ATTR!==!1,Ge=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nt=o.SAFE_FOR_TEMPLATES||!1,Pt=o.SAFE_FOR_XML!==!1,Z=o.WHOLE_DOCUMENT||!1,ot=o.RETURN_DOM||!1,vt=o.RETURN_DOM_FRAGMENT||!1,xt=o.RETURN_TRUSTED_TYPE||!1,ce=o.FORCE_BODY||!1,je=o.SANITIZE_DOM!==!1,Ye=o.SANITIZE_NAMED_PROPS||!1,le=o.KEEP_CONTENT!==!1,bt=o.IN_PLACE||!1,He=o.ALLOWED_URI_REGEXP||ye,it=o.NAMESPACE||G,Ut=o.MATHML_TEXT_INTEGRATION_POINTS||Ut,Ht=o.HTML_INTEGRATION_POINTS||Ht,A=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Ke(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(A.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Ke(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(A.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),nt&&(re=!1),vt&&(ot=!0),st&&(S=d({},_e),R=[],st.html===!0&&(d(S,Ae),d(R,be)),st.svg===!0&&(d(S,jt),d(R,Xt),d(R,Ot)),st.svgFilters===!0&&(d(S,Yt),d(R,Xt),d(R,Ot)),st.mathMl===!0&&(d(S,Vt),d(R,Se),d(R,Ot))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?et.tagCheck=o.ADD_TAGS:(S===ze&&(S=U(S)),d(S,o.ADD_TAGS,b))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?et.attributeCheck=o.ADD_ATTR:(R===$e&&(R=U(R)),d(R,o.ADD_ATTR,b))),o.ADD_URI_SAFE_ATTR&&d(ue,o.ADD_URI_SAFE_ATTR,b),o.FORBID_CONTENTS&&(z===fe&&(z=U(z)),d(z,o.FORBID_CONTENTS,b)),o.ADD_FORBID_CONTENTS&&(z===fe&&(z=U(z)),d(z,o.ADD_FORBID_CONTENTS,b)),le&&(S["#text"]=!0),Z&&d(S,["html","head","body"]),S.table&&(d(S,["tbody"]),delete _t.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=o.TRUSTED_TYPES_POLICY,At=I.createHTML("")}else I===void 0&&(I=Dn(W,s)),I!==null&&typeof At=="string"&&(At=I.createHTML(""));N&&N(o),rt=o}},Ze=d({},[...jt,...Yt,..._n]),Je=d({},[...Vt,...bn]),ho=function(o){let a=It(o);(!a||!a.tagName)&&(a={namespaceURI:it,tagName:"template"});const l=wt(o.tagName),g=wt(a.tagName);return he[o.namespaceURI]?o.namespaceURI===Ft?a.namespaceURI===G?l==="svg":a.namespaceURI===kt?l==="svg"&&(g==="annotation-xml"||Ut[g]):!!Ze[l]:o.namespaceURI===kt?a.namespaceURI===G?l==="math":a.namespaceURI===Ft?l==="math"&&Ht[g]:!!Je[l]:o.namespaceURI===G?a.namespaceURI===Ft&&!Ht[g]||a.namespaceURI===kt&&!Ut[g]?!1:!Je[l]&&(lo[l]||!Ze[l]):!!(St==="application/xhtml+xml"&&he[o.namespaceURI]):!1},$=function(o){lt(t.removed,{element:o});try{It(o).removeChild(o)}catch{Kn(o)}},J=function(o,a){try{lt(t.removed,{attribute:a.getAttributeNode(o),from:a})}catch{lt(t.removed,{attribute:null,from:a})}if(a.removeAttribute(o),o==="is")if(ot||vt)try{$(a)}catch{}else try{a.setAttribute(o,"")}catch{}},Qe=function(o){let a=null,l=null;if(ce)o="<remove></remove>"+o;else{const _=Bt(o,/^[\r\n\t ]+/);l=_&&_[0]}St==="application/xhtml+xml"&&it===G&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const g=I?I.createHTML(o):o;if(it===G)try{a=new V().parseFromString(g,St)}catch{}if(!a||!a.documentElement){a=ee.createDocument(it,"template",null);try{a.documentElement.innerHTML=pe?At:g}catch{}}const C=a.body||a.documentElement;return o&&l&&C.insertBefore(e.createTextNode(l),C.childNodes[0]||null),it===G?eo.call(a,Z?"html":"body")[0]:Z?a.documentElement:C},tn=function(o){return Qn.call(o.ownerDocument||o,o,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},de=function(o){return o instanceof y&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof m)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},en=function(o){return typeof u=="function"&&o instanceof u};function B(f,o,a){Rt(f,l=>{l.call(t,o,a,rt)})}const nn=function(o){let a=null;if(B(P.beforeSanitizeElements,o,null),de(o))return $(o),!0;const l=b(o.nodeName);if(B(P.uponSanitizeElement,o,{tagName:l,allowedTags:S}),Pt&&o.hasChildNodes()&&!en(o.firstElementChild)&&L(/<[/\w!]/g,o.innerHTML)&&L(/<[/\w!]/g,o.textContent)||o.nodeType===ht.progressingInstruction||Pt&&o.nodeType===ht.comment&&L(/<[/\w]/g,o.data))return $(o),!0;if(!(et.tagCheck instanceof Function&&et.tagCheck(l))&&(!S[l]||_t[l])){if(!_t[l]&&sn(l)&&(A.tagNameCheck instanceof RegExp&&L(A.tagNameCheck,l)||A.tagNameCheck instanceof Function&&A.tagNameCheck(l)))return!1;if(le&&!z[l]){const g=It(o)||o.parentNode,C=Jn(o)||o.childNodes;if(C&&g){const _=C.length;for(let v=_-1;v>=0;--v){const j=qn(C[v],!0);j.__removalCount=(o.__removalCount||0)+1,g.insertBefore(j,Zn(o))}}}return $(o),!0}return o instanceof p&&!ho(o)||(l==="noscript"||l==="noembed"||l==="noframes")&&L(/<\/no(script|embed|frames)/i,o.innerHTML)?($(o),!0):(nt&&o.nodeType===ht.text&&(a=o.textContent,Rt([ne,oe,se],g=>{a=ft(a,g," ")}),o.textContent!==a&&(lt(t.removed,{element:o.cloneNode()}),o.textContent=a)),B(P.afterSanitizeElements,o,null),!1)},on=function(o,a,l){if(je&&(a==="id"||a==="name")&&(l in e||l in po))return!1;if(!(re&&!ie[a]&&L(oo,a))){if(!(We&&L(so,a))){if(!(et.attributeCheck instanceof Function&&et.attributeCheck(a,o))){if(!R[a]||ie[a]){if(!(sn(o)&&(A.tagNameCheck instanceof RegExp&&L(A.tagNameCheck,o)||A.tagNameCheck instanceof Function&&A.tagNameCheck(o))&&(A.attributeNameCheck instanceof RegExp&&L(A.attributeNameCheck,a)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(a,o))||a==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&L(A.tagNameCheck,l)||A.tagNameCheck instanceof Function&&A.tagNameCheck(l))))return!1}else if(!ue[a]){if(!L(He,ft(l,Ue,""))){if(!((a==="src"||a==="xlink:href"||a==="href")&&o!=="script"&&Tn(l,"data:")===0&&Ve[o])){if(!(Ge&&!L(io,ft(l,Ue,"")))){if(l)return!1}}}}}}}return!0},sn=function(o){return o!=="annotation-xml"&&Bt(o,ro)},rn=function(o){B(P.beforeSanitizeAttributes,o,null);const{attributes:a}=o;if(!a||de(o))return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0};let g=a.length;for(;g--;){const C=a[g],{name:_,namespaceURI:v,value:j}=C,at=b(_),Te=j;let w=_==="value"?Te:gn(Te);if(l.attrName=at,l.attrValue=w,l.keepAttr=!0,l.forceKeepAttr=void 0,B(P.uponSanitizeAttribute,o,l),w=l.attrValue,Ye&&(at==="id"||at==="name")&&(J(_,o),w=ao+w),Pt&&L(/((--!?|])>)|<\/(style|title|textarea)/i,w)){J(_,o);continue}if(at==="attributename"&&Bt(w,"href")){J(_,o);continue}if(l.forceKeepAttr)continue;if(!l.keepAttr){J(_,o);continue}if(!Be&&L(/\/>/i,w)){J(_,o);continue}nt&&Rt([ne,oe,se],cn=>{w=ft(w,cn," ")});const an=b(o.nodeName);if(!on(an,at,w)){J(_,o);continue}if(I&&typeof W=="object"&&typeof W.getAttributeType=="function"&&!v)switch(W.getAttributeType(an,at)){case"TrustedHTML":{w=I.createHTML(w);break}case"TrustedScriptURL":{w=I.createScriptURL(w);break}}if(w!==Te)try{v?o.setAttributeNS(v,_,w):o.setAttribute(_,w),de(o)?$(o):Ee(t.removed)}catch{J(_,o)}}B(P.afterSanitizeAttributes,o,null)},mo=function f(o){let a=null;const l=tn(o);for(B(P.beforeSanitizeShadowDOM,o,null);a=l.nextNode();)B(P.uponSanitizeShadowNode,a,null),nn(a),rn(a),a.content instanceof i&&f(a.content);B(P.afterSanitizeShadowDOM,o,null)};return t.sanitize=function(f){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,l=null,g=null,C=null;if(pe=!f,pe&&(f="<!-->"),typeof f!="string"&&!en(f))if(typeof f.toString=="function"){if(f=f.toString(),typeof f!="string")throw ut("dirty is not a string, aborting")}else throw ut("toString is not a function");if(!t.isSupported)return f;if(ae||me(o),t.removed=[],typeof f=="string"&&(bt=!1),bt){if(f.nodeName){const j=b(f.nodeName);if(!S[j]||_t[j])throw ut("root node is forbidden and cannot be sanitized in-place")}}else if(f instanceof u)a=Qe("<!---->"),l=a.ownerDocument.importNode(f,!0),l.nodeType===ht.element&&l.nodeName==="BODY"||l.nodeName==="HTML"?a=l:a.appendChild(l);else{if(!ot&&!nt&&!Z&&f.indexOf("<")===-1)return I&&xt?I.createHTML(f):f;if(a=Qe(f),!a)return ot?null:xt?At:""}a&&ce&&$(a.firstChild);const _=tn(bt?f:a);for(;g=_.nextNode();)nn(g),rn(g),g.content instanceof i&&mo(g.content);if(bt)return f;if(ot){if(vt)for(C=to.call(a.ownerDocument);a.firstChild;)C.appendChild(a.firstChild);else C=a;return(R.shadowroot||R.shadowrootmode)&&(C=no.call(n,C,!0)),C}let v=Z?a.outerHTML:a.innerHTML;return Z&&S["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&L(Re,a.ownerDocument.doctype.name)&&(v="<!DOCTYPE "+a.ownerDocument.doctype.name+`>
2
- `+v),nt&&Rt([ne,oe,se],j=>{v=ft(v,j," ")}),I&&xt?I.createHTML(v):v},t.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};me(f),ae=!0},t.clearConfig=function(){rt=null,ae=!1},t.isValidAttribute=function(f,o,a){rt||me({});const l=b(f),g=b(o);return on(l,g,a)},t.addHook=function(f,o){typeof o=="function"&&lt(P[f],o)},t.removeHook=function(f,o){if(o!==void 0){const a=mn(P[f],o);return a===-1?void 0:dn(P[f],a,1)[0]}return Ee(P[f])},t.removeHooks=function(f){P[f]=[]},t.removeAllHooks=function(){P=Oe()},t}var Me=Ce();function Ne(r,t,e=""){const n=new WeakMap,s={get(i,c){const u=Reflect.get(i,c);if(u===null||typeof u!="object")return u;const p=n.get(u);if(p)return p;const h=e?`${e}.${c}`:c,m=Ne(u,t,h);return n.set(u,m),m},set(i,c,u){const p=Reflect.get(i,c);if(p!==u){Reflect.set(i,c,u);const h=e?`${e}.${c}`:c;t(h,p,u)}return!0}};return new Proxy(r,s)}function Le(r){const t={};for(const[e,n]of Object.entries(r)){const s=typeof n=="object"&&n!==null;t[e]=s?Le(n):n}return t}const Ct=typeof window<"u"&&typeof window.document<"u";let De=class extends Error{};const tt=class tt{constructor(t,e,n){q(this,Dt);q(this,Lt,Symbol("objectId"));q(this,H,[]);q(this,gt);q(this,Et);q(this,Y);if(!t)throw new De("name cannot be empty");if(O(tt,K).has(t))throw new De(`WrecState with name "${t}" already exists`);if(ct(this,gt,t),ct(this,Et,e),ct(this,Y,Ne({},fn(this,Dt,un).bind(this))),e&&Ct){const s=sessionStorage.getItem("wrec-state-"+t),i=s?JSON.parse(s):void 0;i&&(n=i)}if(n)for(const[s,i]of Object.entries(n))this.addProperty(s,i);O(tt,K).set(t,this)}static get(t){return O(this,K).get(t)}addListener(t,e={}){const n=O(this,H).find(s=>s.listenerRef.deref()===t);if(n){const{propertyMap:s}=n;for(const[i,c]of Object.entries(e))s[i]=c}else O(this,H).push({listenerRef:new WeakRef(t),propertyMap:e})}addProperty(t,e){Object.defineProperty(this,t,{enumerable:!0,get(){return O(this,Y)[t]},set(n){O(this,Y)[t]=n}}),O(this,Y)[t]=e}get id(){return O(this,Lt)}log(){console.log("WrecState:",O(this,gt));for(const[t,e]of Object.entries(O(this,Y)))console.log(` ${t} = ${JSON.stringify(e)}`)}removeListener(t){ct(this,H,O(this,H).filter(e=>e.listenerRef.deref()!==t))}};K=new WeakMap,Lt=new WeakMap,H=new WeakMap,gt=new WeakMap,Et=new WeakMap,Y=new WeakMap,Dt=new WeakSet,un=function(t,e,n){const s=new Set;for(const i of O(this,H)){const c=i.listenerRef.deref();if(!c)s.add(i);else if(Ct&&c instanceof HTMLElement&&!c.isConnected)s.add(i);else{const{propertyMap:u}=i,p=Object.keys(u);(p.length===0||p.includes(t))&&c.changed(t,u[t],n,e,this)}}ct(this,H,O(this,H).filter(i=>!s.has(i)))},q(tt,K,new Map),Ct&&window.addEventListener("beforeunload",()=>{for(const[t,e]of O(tt,K).entries())if(O(e,Et)){const n=Le(e);sessionStorage.setItem("wrec-state-"+t,JSON.stringify(n))}});let Mt=tt;Ct&&process.env.NODE_ENV==="development"&&(window.WrecState=Mt);function Ie(r,t){let e=r;for(const n of t.split("."))e=e[n];return e}function In(r,t,e){const n=t.split("."),s=n.length-1;let i=r;n.forEach((c,u)=>{u===s?i[c]=e:i=i[c]})}const Pn=new Set(["class","hidden","id","disabled","title"]),vn=new Set(["onblur","onchange","onclick","onfocus","oninput","onkeydown","onreset","onsubmit"]);Me.addHook("uponSanitizeAttribute",(r,t)=>{const{attrName:e}=t,n=e.toLowerCase();vn.has(n)&&(t.forceKeepAttr=!0)});class Q extends Error{}const xn=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,Pe="a-zA-Z_$",kn=Pe+"0-9",mt=`[${Pe}][${kn}]*`,Fn=/<!--\s*(.*?)\s*-->/,Un=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,qt=new RegExp(`^this\\.${mt}$`),Kt=new RegExp(`this\\.${mt}(\\.${mt})*`,"g"),ve=new RegExp(`this\\.${mt}(\\.${mt})*`),Hn=new Set(["class","style"]),zn=5;function $n(r){return r instanceof HTMLButtonElement||r instanceof HTMLFieldSetElement||r instanceof HTMLInputElement||r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement||r instanceof F}function Wn(r,t,e){const n=document.createElement(r);if(t)for(const[s,i]of Object.entries(t))n.setAttribute(s,i);return e&&(n.innerHTML=e),n}const Gn=r=>r===String?"":r===Number?0:r===Boolean?!1:r===Array?[]:r===Object?{}:void 0;function Nt(r){const t=[];let e=r.firstElementChild;for(;e;)t.push(e),e.shadowRoot&&t.push(...Nt(e.shadowRoot)),e.firstElementChild&&t.push(...Nt(e)),e=e.nextElementSibling;return t}const dt=r=>r.substring(zn).split(".")[0];function xe(r,t){let e=r[0];return t.forEach((n,s)=>{e+=n+r[s+1]}),e}function Zt(r){const t=typeof r;return t==="string"||t==="number"||t==="boolean"}function Tt(r){return r.localName==="textarea"}function Jt(r){const{localName:t}=r;return t==="input"||t==="select"}const Bn=r=>r.replace(/<!--[\s\S]*?-->/g,"");function ke(r,t,e,n){return r.slice(0,t)+n+r.slice(t+e)}function jn(r){let t=r.trim(),e=null;/^\s*<tr[\s>]/i.test(t)?(t=`<table><tbody>${t}</tbody></table>`,e="tbody"):/^\s*<(td|th)[\s>]/i.test(t)?(t=`<table><tbody><tr>${t}</tr></tbody></table>`,e="tr"):/^\s*<option[\s>]/i.test(t)?(t=`<select>${t}</select>`,e="select"):/^\s*<col[\s>]/i.test(t)&&(t=`<table><colgroup>${t}</colgroup></table>`,e="colgroup");const n=Me.sanitize(t,{ADD_TAGS:["#comment"],ALLOW_UNKNOWN_PROTOCOLS:!0,RETURN_DOM_FRAGMENT:!0});if(e){const s=n.querySelector(e);if(s)return s.childNodes}return n.childNodes}function Qt(r){const t=Number(r);if(isNaN(t))throw new Q(`can't convert "${r}" to a number`);return t}function Fe(r,t,e){const[n,s]=t.split(":");if(Zt(e))if(typeof e=="boolean"){e?r.setAttribute(n,n):r.removeAttribute(n);const i=F.getPropName(n);r[i]=e}else{const i=r.getAttribute(t),c=String(e);i!==c&&(r.setAttribute(n,c),n==="value"&&Jt(r)&&(r.value=c))}else{const i=F.getPropName(t);r[i]=e}}function te(r,t,e){const[n,s]=t.split(":");r instanceof CSSStyleRule?r.style.setProperty(n,e):(Fe(r,n,e),n==="value"&&Jt(r)&&(r.value=e))}async function Yn(r){const t=new Set;for(const n of Nt(r.content)){const{localName:s}=n;s.includes("-")&&t.add(s)}function e(n){return new Promise((s,i)=>{setTimeout(()=>{const c=`custom element <${n}> not defined`;i(new Error(c))},1e3)})}return Promise.all([...t].map(async n=>Promise.race([customElements.whenDefined(n),e(n)])))}class F extends HTMLElement{static attrToPropMap=new Map;static propToAttrMap=new Map;static css="";static elementName="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static template=null;#t=this.constructor;#n=new Map;#c={};#s;#l={};#f=null;#u=new Map;static define(t){if(this.elementName=t,customElements.get(t))throw new Q(`custom element ${t} is already defined`);customElements.define(t,this)}constructor(){super(),this.attachShadow({mode:"open"});const t=this.#t;t.attrToPropMap||(t.attrToPropMap=new Map),t.properties||(t.properties={}),t.propToAttrMap||(t.propToExprsMap=new Map),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,n){t==="disabled"&&this.#m();const s=F.getPropName(t);if(this.#i(s)){const i=this.#_(s,String(n));this[s]=i;const c=this.#c[s];c&&this.setFormValue(c,String(i)),this.propertyChangedCallback(s,e,n)}}async#y(){const t=this.#t;let{template:e}=t;if(!e){e=t.template=document.createElement("template");let n=`<style>
1
+ (function(T,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(T=typeof globalThis<"u"?globalThis:T||self,E(T.wrec={}))})(this,(function(T){"use strict";var ln=T=>{throw TypeError(T)};var ge=(T,E,M)=>E.has(T)||ln("Cannot "+M);var O=(T,E,M)=>(ge(T,E,"read from private field"),M?M.call(T):E.get(T)),q=(T,E,M)=>E.has(T)?ln("Cannot add the same private member more than once"):E instanceof WeakSet?E.add(T):E.set(T,M),ct=(T,E,M,yt)=>(ge(T,E,"write to private field"),yt?yt.call(T,M):E.set(T,M),M),fn=(T,E,M)=>(ge(T,E,"access private method"),M);var K,Nt,H,gt,Et,Y,Dt,un;const{entries:E,setPrototypeOf:M,isFrozen:yt,getPrototypeOf:pn,getOwnPropertyDescriptor:hn}=Object;let{freeze:L,seal:x,create:zt}=Object,{apply:$t,construct:Wt}=typeof Reflect<"u"&&Reflect;L||(L=function(t){return t}),x||(x=function(t){return t}),$t||($t=function(t,e){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];return t.apply(e,s)}),Wt||(Wt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return new t(...n)});const Rt=D(Array.prototype.forEach),mn=D(Array.prototype.lastIndexOf),Ee=D(Array.prototype.pop),lt=D(Array.prototype.push),dn=D(Array.prototype.splice),wt=D(String.prototype.toLowerCase),Gt=D(String.prototype.toString),Bt=D(String.prototype.match),ft=D(String.prototype.replace),Tn=D(String.prototype.indexOf),gn=D(String.prototype.trim),k=D(Object.prototype.hasOwnProperty),N=D(RegExp.prototype.test),ut=En(TypeError);function D(r){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return $t(r,t,n)}}function En(r){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Wt(r,e)}}function d(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wt;M&&M(r,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=e(s);i!==s&&(yt(t)||(t[n]=i),s=i)}r[s]=!0}return r}function An(r){for(let t=0;t<r.length;t++)k(r,t)||(r[t]=null);return r}function U(r){const t=zt(null);for(const[e,n]of E(r))k(r,e)&&(Array.isArray(n)?t[e]=An(n):n&&typeof n=="object"&&n.constructor===Object?t[e]=U(n):t[e]=n);return t}function pt(r,t){for(;r!==null;){const n=hn(r,t);if(n){if(n.get)return D(n.get);if(typeof n.value=="function")return D(n.value)}r=pn(r)}function e(){return null}return e}const Ae=L(["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=L(["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"]),Yt=L(["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"]),_n=L(["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"]),Vt=L(["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"]),bn=L(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_e=L(["#text"]),be=L(["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"]),Xt=L(["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"]),Se=L(["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"]),Ot=L(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sn=x(/\{\{[\w\W]*|[\w\W]*\}\}/gm),yn=x(/<%[\w\W]*|[\w\W]*%>/gm),Rn=x(/\$\{[\w\W]*/gm),wn=x(/^data-[\-\w.\u00B7-\uFFFF]+$/),On=x(/^aria-[\-\w]+$/),ye=x(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cn=x(/^(?:\w+script|data):/i),Mn=x(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Re=x(/^html$/i),Ln=x(/^[a-z][.\w]*(-[.\w]+)+$/i);var we=Object.freeze({__proto__:null,ARIA_ATTR:On,ATTR_WHITESPACE:Mn,CUSTOM_ELEMENT:Ln,DATA_ATTR:wn,DOCTYPE_NAME:Re,ERB_EXPR:yn,IS_ALLOWED_URI:ye,IS_SCRIPT_OR_DATA:Cn,MUSTACHE_EXPR:Sn,TMPLIT_EXPR:Rn});const ht={element:1,text:3,progressingInstruction:7,comment:8,document:9},Nn=function(){return typeof window>"u"?null:window},Dn=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";e&&e.hasAttribute(s)&&(n=e.getAttribute(s));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Oe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ce(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nn();const t=f=>Ce(f);if(t.version="3.3.1",t.removed=[],!r||!r.document||r.document.nodeType!==ht.document||!r.Element)return t.isSupported=!1,t;let{document:e}=r;const n=e,s=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:c,Node:u,Element:p,NodeFilter:h,NamedNodeMap:m=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:y,DOMParser:V,trustedTypes:W}=r,X=p.prototype,Xn=pt(X,"cloneNode"),qn=pt(X,"remove"),Kn=pt(X,"nextSibling"),Zn=pt(X,"childNodes"),It=pt(X,"parentNode");if(typeof c=="function"){const f=e.createElement("template");f.content&&f.content.ownerDocument&&(e=f.content.ownerDocument)}let I,At="";const{implementation:ee,createNodeIterator:Jn,createDocumentFragment:Qn,getElementsByTagName:to}=e,{importNode:eo}=n;let P=Oe();t.isSupported=typeof E=="function"&&typeof It=="function"&&ee&&ee.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ne,ERB_EXPR:oe,TMPLIT_EXPR:se,DATA_ATTR:no,ARIA_ATTR:oo,IS_SCRIPT_OR_DATA:so,ATTR_WHITESPACE:Ue,CUSTOM_ELEMENT:io}=we;let{IS_ALLOWED_URI:He}=we,S=null;const ze=d({},[...Ae,...jt,...Yt,...Vt,..._e]);let R=null;const $e=d({},[...be,...Xt,...Se,...Ot]);let A=Object.seal(zt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_t=null,ie=null;const et=Object.seal(zt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let We=!0,re=!0,Ge=!1,Be=!0,nt=!1,Pt=!0,Z=!1,ae=!1,ce=!1,ot=!1,vt=!1,xt=!1,je=!0,Ye=!1;const ro="user-content-";let le=!0,bt=!1,st={},z=null;const fe=d({},["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"]);let Ve=null;const Xe=d({},["audio","video","img","source","image","track"]);let ue=null;const qe=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kt="http://www.w3.org/1998/Math/MathML",Ft="http://www.w3.org/2000/svg",G="http://www.w3.org/1999/xhtml";let it=G,pe=!1,he=null;const ao=d({},[kt,Ft,G],Gt);let Ut=d({},["mi","mo","mn","ms","mtext"]),Ht=d({},["annotation-xml"]);const co=d({},["title","style","font","a","script"]);let St=null;const lo=["application/xhtml+xml","text/html"],fo="text/html";let b=null,rt=null;const uo=e.createElement("form"),Ke=function(o){return o instanceof RegExp||o instanceof Function},me=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rt&&rt===o)){if((!o||typeof o!="object")&&(o={}),o=U(o),St=lo.indexOf(o.PARSER_MEDIA_TYPE)===-1?fo:o.PARSER_MEDIA_TYPE,b=St==="application/xhtml+xml"?Gt:wt,S=k(o,"ALLOWED_TAGS")?d({},o.ALLOWED_TAGS,b):ze,R=k(o,"ALLOWED_ATTR")?d({},o.ALLOWED_ATTR,b):$e,he=k(o,"ALLOWED_NAMESPACES")?d({},o.ALLOWED_NAMESPACES,Gt):ao,ue=k(o,"ADD_URI_SAFE_ATTR")?d(U(qe),o.ADD_URI_SAFE_ATTR,b):qe,Ve=k(o,"ADD_DATA_URI_TAGS")?d(U(Xe),o.ADD_DATA_URI_TAGS,b):Xe,z=k(o,"FORBID_CONTENTS")?d({},o.FORBID_CONTENTS,b):fe,_t=k(o,"FORBID_TAGS")?d({},o.FORBID_TAGS,b):U({}),ie=k(o,"FORBID_ATTR")?d({},o.FORBID_ATTR,b):U({}),st=k(o,"USE_PROFILES")?o.USE_PROFILES:!1,We=o.ALLOW_ARIA_ATTR!==!1,re=o.ALLOW_DATA_ATTR!==!1,Ge=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nt=o.SAFE_FOR_TEMPLATES||!1,Pt=o.SAFE_FOR_XML!==!1,Z=o.WHOLE_DOCUMENT||!1,ot=o.RETURN_DOM||!1,vt=o.RETURN_DOM_FRAGMENT||!1,xt=o.RETURN_TRUSTED_TYPE||!1,ce=o.FORCE_BODY||!1,je=o.SANITIZE_DOM!==!1,Ye=o.SANITIZE_NAMED_PROPS||!1,le=o.KEEP_CONTENT!==!1,bt=o.IN_PLACE||!1,He=o.ALLOWED_URI_REGEXP||ye,it=o.NAMESPACE||G,Ut=o.MATHML_TEXT_INTEGRATION_POINTS||Ut,Ht=o.HTML_INTEGRATION_POINTS||Ht,A=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Ke(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(A.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Ke(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(A.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),nt&&(re=!1),vt&&(ot=!0),st&&(S=d({},_e),R=[],st.html===!0&&(d(S,Ae),d(R,be)),st.svg===!0&&(d(S,jt),d(R,Xt),d(R,Ot)),st.svgFilters===!0&&(d(S,Yt),d(R,Xt),d(R,Ot)),st.mathMl===!0&&(d(S,Vt),d(R,Se),d(R,Ot))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?et.tagCheck=o.ADD_TAGS:(S===ze&&(S=U(S)),d(S,o.ADD_TAGS,b))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?et.attributeCheck=o.ADD_ATTR:(R===$e&&(R=U(R)),d(R,o.ADD_ATTR,b))),o.ADD_URI_SAFE_ATTR&&d(ue,o.ADD_URI_SAFE_ATTR,b),o.FORBID_CONTENTS&&(z===fe&&(z=U(z)),d(z,o.FORBID_CONTENTS,b)),o.ADD_FORBID_CONTENTS&&(z===fe&&(z=U(z)),d(z,o.ADD_FORBID_CONTENTS,b)),le&&(S["#text"]=!0),Z&&d(S,["html","head","body"]),S.table&&(d(S,["tbody"]),delete _t.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=o.TRUSTED_TYPES_POLICY,At=I.createHTML("")}else I===void 0&&(I=Dn(W,s)),I!==null&&typeof At=="string"&&(At=I.createHTML(""));L&&L(o),rt=o}},Ze=d({},[...jt,...Yt,..._n]),Je=d({},[...Vt,...bn]),po=function(o){let a=It(o);(!a||!a.tagName)&&(a={namespaceURI:it,tagName:"template"});const l=wt(o.tagName),g=wt(a.tagName);return he[o.namespaceURI]?o.namespaceURI===Ft?a.namespaceURI===G?l==="svg":a.namespaceURI===kt?l==="svg"&&(g==="annotation-xml"||Ut[g]):!!Ze[l]:o.namespaceURI===kt?a.namespaceURI===G?l==="math":a.namespaceURI===Ft?l==="math"&&Ht[g]:!!Je[l]:o.namespaceURI===G?a.namespaceURI===Ft&&!Ht[g]||a.namespaceURI===kt&&!Ut[g]?!1:!Je[l]&&(co[l]||!Ze[l]):!!(St==="application/xhtml+xml"&&he[o.namespaceURI]):!1},$=function(o){lt(t.removed,{element:o});try{It(o).removeChild(o)}catch{qn(o)}},J=function(o,a){try{lt(t.removed,{attribute:a.getAttributeNode(o),from:a})}catch{lt(t.removed,{attribute:null,from:a})}if(a.removeAttribute(o),o==="is")if(ot||vt)try{$(a)}catch{}else try{a.setAttribute(o,"")}catch{}},Qe=function(o){let a=null,l=null;if(ce)o="<remove></remove>"+o;else{const _=Bt(o,/^[\r\n\t ]+/);l=_&&_[0]}St==="application/xhtml+xml"&&it===G&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const g=I?I.createHTML(o):o;if(it===G)try{a=new V().parseFromString(g,St)}catch{}if(!a||!a.documentElement){a=ee.createDocument(it,"template",null);try{a.documentElement.innerHTML=pe?At:g}catch{}}const C=a.body||a.documentElement;return o&&l&&C.insertBefore(e.createTextNode(l),C.childNodes[0]||null),it===G?to.call(a,Z?"html":"body")[0]:Z?a.documentElement:C},tn=function(o){return Jn.call(o.ownerDocument||o,o,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},de=function(o){return o instanceof y&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof m)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},en=function(o){return typeof u=="function"&&o instanceof u};function B(f,o,a){Rt(f,l=>{l.call(t,o,a,rt)})}const nn=function(o){let a=null;if(B(P.beforeSanitizeElements,o,null),de(o))return $(o),!0;const l=b(o.nodeName);if(B(P.uponSanitizeElement,o,{tagName:l,allowedTags:S}),Pt&&o.hasChildNodes()&&!en(o.firstElementChild)&&N(/<[/\w!]/g,o.innerHTML)&&N(/<[/\w!]/g,o.textContent)||o.nodeType===ht.progressingInstruction||Pt&&o.nodeType===ht.comment&&N(/<[/\w]/g,o.data))return $(o),!0;if(!(et.tagCheck instanceof Function&&et.tagCheck(l))&&(!S[l]||_t[l])){if(!_t[l]&&sn(l)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,l)||A.tagNameCheck instanceof Function&&A.tagNameCheck(l)))return!1;if(le&&!z[l]){const g=It(o)||o.parentNode,C=Zn(o)||o.childNodes;if(C&&g){const _=C.length;for(let v=_-1;v>=0;--v){const j=Xn(C[v],!0);j.__removalCount=(o.__removalCount||0)+1,g.insertBefore(j,Kn(o))}}}return $(o),!0}return o instanceof p&&!po(o)||(l==="noscript"||l==="noembed"||l==="noframes")&&N(/<\/no(script|embed|frames)/i,o.innerHTML)?($(o),!0):(nt&&o.nodeType===ht.text&&(a=o.textContent,Rt([ne,oe,se],g=>{a=ft(a,g," ")}),o.textContent!==a&&(lt(t.removed,{element:o.cloneNode()}),o.textContent=a)),B(P.afterSanitizeElements,o,null),!1)},on=function(o,a,l){if(je&&(a==="id"||a==="name")&&(l in e||l in uo))return!1;if(!(re&&!ie[a]&&N(no,a))){if(!(We&&N(oo,a))){if(!(et.attributeCheck instanceof Function&&et.attributeCheck(a,o))){if(!R[a]||ie[a]){if(!(sn(o)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,o)||A.tagNameCheck instanceof Function&&A.tagNameCheck(o))&&(A.attributeNameCheck instanceof RegExp&&N(A.attributeNameCheck,a)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(a,o))||a==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,l)||A.tagNameCheck instanceof Function&&A.tagNameCheck(l))))return!1}else if(!ue[a]){if(!N(He,ft(l,Ue,""))){if(!((a==="src"||a==="xlink:href"||a==="href")&&o!=="script"&&Tn(l,"data:")===0&&Ve[o])){if(!(Ge&&!N(so,ft(l,Ue,"")))){if(l)return!1}}}}}}}return!0},sn=function(o){return o!=="annotation-xml"&&Bt(o,io)},rn=function(o){B(P.beforeSanitizeAttributes,o,null);const{attributes:a}=o;if(!a||de(o))return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0};let g=a.length;for(;g--;){const C=a[g],{name:_,namespaceURI:v,value:j}=C,at=b(_),Te=j;let w=_==="value"?Te:gn(Te);if(l.attrName=at,l.attrValue=w,l.keepAttr=!0,l.forceKeepAttr=void 0,B(P.uponSanitizeAttribute,o,l),w=l.attrValue,Ye&&(at==="id"||at==="name")&&(J(_,o),w=ro+w),Pt&&N(/((--!?|])>)|<\/(style|title|textarea)/i,w)){J(_,o);continue}if(at==="attributename"&&Bt(w,"href")){J(_,o);continue}if(l.forceKeepAttr)continue;if(!l.keepAttr){J(_,o);continue}if(!Be&&N(/\/>/i,w)){J(_,o);continue}nt&&Rt([ne,oe,se],cn=>{w=ft(w,cn," ")});const an=b(o.nodeName);if(!on(an,at,w)){J(_,o);continue}if(I&&typeof W=="object"&&typeof W.getAttributeType=="function"&&!v)switch(W.getAttributeType(an,at)){case"TrustedHTML":{w=I.createHTML(w);break}case"TrustedScriptURL":{w=I.createScriptURL(w);break}}if(w!==Te)try{v?o.setAttributeNS(v,_,w):o.setAttribute(_,w),de(o)?$(o):Ee(t.removed)}catch{J(_,o)}}B(P.afterSanitizeAttributes,o,null)},ho=function f(o){let a=null;const l=tn(o);for(B(P.beforeSanitizeShadowDOM,o,null);a=l.nextNode();)B(P.uponSanitizeShadowNode,a,null),nn(a),rn(a),a.content instanceof i&&f(a.content);B(P.afterSanitizeShadowDOM,o,null)};return t.sanitize=function(f){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,l=null,g=null,C=null;if(pe=!f,pe&&(f="<!-->"),typeof f!="string"&&!en(f))if(typeof f.toString=="function"){if(f=f.toString(),typeof f!="string")throw ut("dirty is not a string, aborting")}else throw ut("toString is not a function");if(!t.isSupported)return f;if(ae||me(o),t.removed=[],typeof f=="string"&&(bt=!1),bt){if(f.nodeName){const j=b(f.nodeName);if(!S[j]||_t[j])throw ut("root node is forbidden and cannot be sanitized in-place")}}else if(f instanceof u)a=Qe("<!---->"),l=a.ownerDocument.importNode(f,!0),l.nodeType===ht.element&&l.nodeName==="BODY"||l.nodeName==="HTML"?a=l:a.appendChild(l);else{if(!ot&&!nt&&!Z&&f.indexOf("<")===-1)return I&&xt?I.createHTML(f):f;if(a=Qe(f),!a)return ot?null:xt?At:""}a&&ce&&$(a.firstChild);const _=tn(bt?f:a);for(;g=_.nextNode();)nn(g),rn(g),g.content instanceof i&&ho(g.content);if(bt)return f;if(ot){if(vt)for(C=Qn.call(a.ownerDocument);a.firstChild;)C.appendChild(a.firstChild);else C=a;return(R.shadowroot||R.shadowrootmode)&&(C=eo.call(n,C,!0)),C}let v=Z?a.outerHTML:a.innerHTML;return Z&&S["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&N(Re,a.ownerDocument.doctype.name)&&(v="<!DOCTYPE "+a.ownerDocument.doctype.name+`>
2
+ `+v),nt&&Rt([ne,oe,se],j=>{v=ft(v,j," ")}),I&&xt?I.createHTML(v):v},t.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};me(f),ae=!0},t.clearConfig=function(){rt=null,ae=!1},t.isValidAttribute=function(f,o,a){rt||me({});const l=b(f),g=b(o);return on(l,g,a)},t.addHook=function(f,o){typeof o=="function"&&lt(P[f],o)},t.removeHook=function(f,o){if(o!==void 0){const a=mn(P[f],o);return a===-1?void 0:dn(P[f],a,1)[0]}return Ee(P[f])},t.removeHooks=function(f){P[f]=[]},t.removeAllHooks=function(){P=Oe()},t}var Me=Ce();function Le(r,t,e=""){const n=new WeakMap,s={get(i,c){const u=Reflect.get(i,c);if(u===null||typeof u!="object")return u;const p=n.get(u);if(p)return p;const h=e?`${e}.${c}`:c,m=Le(u,t,h);return n.set(u,m),m},set(i,c,u){const p=Reflect.get(i,c);if(p!==u){Reflect.set(i,c,u);const h=e?`${e}.${c}`:c;t(h,p,u)}return!0}};return new Proxy(r,s)}function Ne(r){const t={};for(const[e,n]of Object.entries(r)){const s=typeof n=="object"&&n!==null;t[e]=s?Ne(n):n}return t}const Ct=typeof window<"u"&&typeof window.document<"u";let De=class extends Error{};const tt=class tt{constructor(t,e,n){q(this,Dt);q(this,Nt,Symbol("objectId"));q(this,H,[]);q(this,gt);q(this,Et);q(this,Y);if(!t)throw new De("name cannot be empty");if(O(tt,K).has(t))throw new De(`WrecState with name "${t}" already exists`);if(ct(this,gt,t),ct(this,Et,e),ct(this,Y,Le({},fn(this,Dt,un).bind(this))),e&&Ct){const s=sessionStorage.getItem("wrec-state-"+t),i=s?JSON.parse(s):void 0;i&&(n=i)}if(n)for(const[s,i]of Object.entries(n))this.addProperty(s,i);O(tt,K).set(t,this)}static get(t){return O(this,K).get(t)}addListener(t,e={}){const n=O(this,H).find(s=>s.listenerRef.deref()===t);if(n){const{propertyMap:s}=n;for(const[i,c]of Object.entries(e))s[i]=c}else O(this,H).push({listenerRef:new WeakRef(t),propertyMap:e})}addProperty(t,e){Object.defineProperty(this,t,{enumerable:!0,get(){return O(this,Y)[t]},set(n){O(this,Y)[t]=n}}),O(this,Y)[t]=e}get id(){return O(this,Nt)}log(){console.log("WrecState:",O(this,gt));for(const[t,e]of Object.entries(O(this,Y)))console.log(` ${t} = ${JSON.stringify(e)}`)}removeListener(t){ct(this,H,O(this,H).filter(e=>e.listenerRef.deref()!==t))}};K=new WeakMap,Nt=new WeakMap,H=new WeakMap,gt=new WeakMap,Et=new WeakMap,Y=new WeakMap,Dt=new WeakSet,un=function(t,e,n){const s=new Set;for(const i of O(this,H)){const c=i.listenerRef.deref();if(!c)s.add(i);else if(Ct&&c instanceof HTMLElement&&!c.isConnected)s.add(i);else{const{propertyMap:u}=i,p=Object.keys(u);(p.length===0||p.includes(t))&&c.changed(t,u[t],n,e,this)}}ct(this,H,O(this,H).filter(i=>!s.has(i)))},q(tt,K,new Map),Ct&&window.addEventListener("beforeunload",()=>{for(const[t,e]of O(tt,K).entries())if(O(e,Et)){const n=Ne(e);sessionStorage.setItem("wrec-state-"+t,JSON.stringify(n))}});let Mt=tt;Ct&&process.env.NODE_ENV==="development"&&(window.WrecState=Mt);function Ie(r,t){let e=r;for(const n of t.split("."))e=e[n];return e}function In(r,t,e){const n=t.split("."),s=n.length-1;let i=r;n.forEach((c,u)=>{u===s?i[c]=e:i=i[c]})}const Pn=new Set(["class","disabled","hidden","id","tabindex","title"]),vn=new Set(["onblur","onchange","onclick","onfocus","oninput","onkeydown","onreset","onsubmit"]);Me.addHook("uponSanitizeAttribute",(r,t)=>{const{attrName:e}=t,n=e.toLowerCase();vn.has(n)&&(t.forceKeepAttr=!0)});class Q extends Error{}const xn=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,Pe="a-zA-Z_$",kn=Pe+"0-9",mt=`[${Pe}][${kn}]*`,Fn=/<!--\s*(.*?)\s*-->/,Un=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,qt=new RegExp(`^this\\.${mt}$`),Kt=new RegExp(`this\\.${mt}(\\.${mt})*`,"g"),ve=new RegExp(`this\\.${mt}(\\.${mt})*`),Hn=5;function zn(r){return r instanceof HTMLButtonElement||r instanceof HTMLFieldSetElement||r instanceof HTMLInputElement||r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement||r instanceof F}function $n(r,t,e){const n=document.createElement(r);if(t)for(const[s,i]of Object.entries(t))n.setAttribute(s,i);return e&&(n.innerHTML=e),n}const Wn=r=>r===String?"":r===Number?0:r===Boolean?!1:r===Array?[]:r===Object?{}:void 0;function Lt(r){const t=[];let e=r.firstElementChild;for(;e;)t.push(e),e.shadowRoot&&t.push(...Lt(e.shadowRoot)),e.firstElementChild&&t.push(...Lt(e)),e=e.nextElementSibling;return t}const dt=r=>r.substring(Hn).split(".")[0];function xe(r,t){let e=r[0];return t.forEach((n,s)=>{e+=n+r[s+1]}),e}function Zt(r){const t=typeof r;return t==="string"||t==="number"||t==="boolean"}function Tt(r){return r.localName==="textarea"}function Jt(r){const{localName:t}=r;return t==="input"||t==="select"}const Gn=r=>r.replace(/<!--[\s\S]*?-->/g,"");function ke(r,t,e,n){return r.slice(0,t)+n+r.slice(t+e)}function Bn(r){let t=r.trim(),e=null;/^\s*<tr[\s>]/i.test(t)?(t=`<table><tbody>${t}</tbody></table>`,e="tbody"):/^\s*<(td|th)[\s>]/i.test(t)?(t=`<table><tbody><tr>${t}</tr></tbody></table>`,e="tr"):/^\s*<option[\s>]/i.test(t)?(t=`<select>${t}</select>`,e="select"):/^\s*<col[\s>]/i.test(t)&&(t=`<table><colgroup>${t}</colgroup></table>`,e="colgroup");const n=Me.sanitize(t,{ADD_TAGS:["#comment"],ALLOW_UNKNOWN_PROTOCOLS:!0,RETURN_DOM_FRAGMENT:!0});if(e){const s=n.querySelector(e);if(s)return s.childNodes}return n.childNodes}function Qt(r){const t=Number(r);if(isNaN(t))throw new Q(`can't convert "${r}" to a number`);return t}function Fe(r,t,e){const[n,s]=t.split(":");if(Zt(e))if(typeof e=="boolean"){e?r.setAttribute(n,n):r.removeAttribute(n);const i=F.getPropName(n);r[i]=e}else{const i=r.getAttribute(t),c=String(e);i!==c&&(r.setAttribute(n,c),n==="value"&&Jt(r)&&(r.value=c))}else{const i=F.getPropName(t);r[i]=e}}function te(r,t,e){const[n,s]=t.split(":");r instanceof CSSStyleRule?r.style.setProperty(n,e):(Fe(r,n,e),n==="value"&&Jt(r)&&(r.value=e))}async function jn(r){const t=new Set;for(const n of Lt(r.content)){const{localName:s}=n;s.includes("-")&&t.add(s)}function e(n){return new Promise((s,i)=>{setTimeout(()=>{const c=`custom element <${n}> not defined`;i(new Error(c))},1e3)})}return Promise.all([...t].map(async n=>Promise.race([customElements.whenDefined(n),e(n)])))}class F extends HTMLElement{static attrToPropMap=new Map;static propToAttrMap=new Map;static css="";static elementName="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static template=null;#t=this.constructor;#n=new Map;#c={};#s;#l={};#f=null;#u=new Map;static define(t){if(this.elementName=t,customElements.get(t))throw new Q(`custom element ${t} is already defined`);customElements.define(t,this)}constructor(){super(),this.attachShadow({mode:"open"});const t=this.#t;t.attrToPropMap||(t.attrToPropMap=new Map),t.properties||(t.properties={}),t.propToAttrMap||(t.propToExprsMap=new Map),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,n){t==="disabled"&&this.#m();const s=F.getPropName(t);if(this.#i(s)){const i=this.#_(s,String(n));this[s]=i;const c=this.#c[s];c&&this.setFormValue(c,String(i)),this.propertyChangedCallback(s,e,n)}}async#y(){const t=this.#t;let{template:e}=t;if(!e){e=t.template=document.createElement("template");let n=`<style>
3
3
  :host([hidden]) { display: none; }`;t.css&&(n+=t.css),n+=`</style>
4
- `;let s=t.html.trim();if(!s)throw new Q("static property html must be set");s.startsWith("<")||(s=`<span><!--${s}--></span>`),e.innerHTML=n+s}await Yn(e),this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,n){this[e]=n}connectedCallback(){this.#P(),this.#w(),this.#y().then(()=>{this.hasAttribute("disabled")&&this.#m(),this.#S(this.shadowRoot),this.#d(this.shadowRoot),this.#R()})}#R(){const t=this.#t,{properties:e}=t;for(const[n,{computed:s}]of Object.entries(e))s&&(this[n]=this.#o(s))}#w(){const t=this.#t,{observedAttributes:e,properties:n}=t;for(const[s,i]of Object.entries(n))i.computed||this.#h(s,i,e);for(const[s,i]of Object.entries(n))i.computed&&this.#h(s,i,e)}#h(t,e,n){const s=F.getAttrName(t),i=this.hasAttribute(s);e.required&&!i&&this.#e(this,t,"is a required attribute");let c=e.value;this.hasOwnProperty(t)&&(c=this[t],delete this[t]);const{type:u}=e,p=u===Boolean?c||i:n.includes(s)&&i?this.#A(t,s):c||Gn(u),h="#"+t;this[h]=p,e.computed&&this.#N(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[h]},set(m){u===Number&&typeof m=="string"&&(m=Qt(m));const y=this[h];if(m===y)return;this.#x(t,u,m),this[h]=m;const{state:V,stateProp:W}=this.#t.properties[t];W&&In(V,W,m),this.#D(t),this.#L(t,u,m,s),this.#E(t),this.#I(t,m);const X=this.#c[t];X&&this.setFormValue(X,String(m)),this.propertyChangedCallback(t,y,m),e.dispatch&&this.dispatch("change",{tagName:this.localName,property:t,oldValue:y,value:m})}})}#m(){const t=this.hasAttribute("disabled"),e=Nt(this.shadowRoot);for(const n of e)$n(n)&&(n.disabled=t)}disconnectedCallback(){this.#n.clear(),this.#l.clear(),this.#u.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}#O(t){const e=t instanceof F;for(const n of t.getAttributeNames()){const s=t.getAttribute(n),i=this.#g(t,s);if(i){const c=this[i];c===void 0&&this.#a(t,n,i),t[i]=c;let[u,p]=n.split(":");u==="value"&&(p?(t["on"+p]===void 0&&this.#e(t,n,"refers to an unsupported event name"),t.setAttribute(u,this[i])):p="change"),e&&t.#u.set(F.getPropName(u),i)}this.#r(s,t,n)}}#o(t){return new Function("return "+t).call(this)}#C(t){const{localName:e}=t;if(e==="style"){const{sheet:n}=t,s=n?.cssRules??[],i=Array.from(s);for(const c of i)if(c.constructor===CSSStyleRule){const u=Array.from(c.style);for(const p of u)if(p.startsWith("--")){const h=c.style.getPropertyValue(p);this.#r(h,c,p)}}}else{let n="";if(Tt(t)){this.#r(t.textContent,t);const s=t.textContent?.match(Fn);s&&(n=s[1])}else{const s=Array.from(t.childNodes).find(i=>i.nodeType===Node.COMMENT_NODE);s&&(n=s.textContent?.trim()??"")}if(n){const s=this.#g(t,n);s&&Tt(t)?t.textContent=this[s]:this.#r(n,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const c=this.getAttribute("name");if(c)if(this.#i("value"))t=`value:${c}`;else return;else return}const e={},n=t.split(",");for(const c of n){const[u,p]=c.split(":");e[u.trim()]=p.trim()}this.#c=e,this.#s=new FormData,this.#f=this.attachInternals(),this.#f.setFormValue(this.#s);const s=Object.keys(this.#t.properties),i=this.#l;for(const c of s)i[c]=this[c]}formResetCallback(){const t=this.#l;for(const e of Object.keys(t)){let n=t[e];qt.test(n)&&(n=this.#o(n)),this[e]=n}}static getAttrName(t){let e=this.propToAttrMap.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),this.propToAttrMap.set(t,e)),e}static getPropName(t){let e=this.attrToPropMap.get(t);return e||(e=t.replace(/-([a-z])/g,(n,s)=>s.toUpperCase()),this.attrToPropMap.set(t,e)),e}#M(t,e,n){if(n.length!==1)return;const[s]=n;if(!qt.test(s))return;const i=Jt(t)||Tt(t);let[c,u]=(e??"").split(":");if(!(i&&c==="value"||Tt(t)))return;u?t["on"+u]===void 0&&this.#e(t,e,"refers to an unsupported event name"):u="change";const h=dt(s);t.addEventListener(u,m=>{const{target:y}=m;if(!y)return;const V=y.value,{type:W}=this.#t.properties[h];this[h]=W===Number?Qt(V):V,this.#E(h)})}#i(t){return!!this.#t.properties[t]}#d(t){const e=Array.from(t.querySelectorAll("*"));for(const n of e)this.#O(n),n.firstElementChild||this.#C(n)}#T(){if(this.#t.formAssociated||this.closest("form")===null)return;const t=this.#t.name;throw new Q(`inside form, class ${t} requires "static formAssociated = true;"`)}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(e=>F.getAttrName(e));return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,n){}#g(t,e){if(!e||!qt.test(e))return;const n=dt(e);return this[n]===void 0&&this.#a(t,"",n),n}#E(t){const s=this.#t.propToExprsMap.get(t)||[];for(const i of s){let c=this.#o(i);const u=this.#n.get(i)??[];for(const p of u)if(p instanceof HTMLElement)this.#b(p,c);else if(!(p instanceof CSSStyleRule)){const{element:h,attrName:m}=p;h instanceof CSSStyleRule?h.style.setProperty(m,c):te(h,m,c)}}}#N(t,e){const{computed:n,uses:s}=e,i=this.#t.propToComputedMap;function c(p,h){let m=i.get(p);m||(m=[],i.set(p,m)),m.push([t,h])}const u=n.match(Kt)||[];for(const p of u){const h=dt(p);this[h]===void 0&&this.#a(null,t,h),typeof this[h]!="function"&&c(h,n)}if(s)for(const p of s.split(","))c(p,n)}#r(t,e,n=void 0){if(!t)return;const s=this.#p(e,n,t);if(!s){const p=t.replaceAll("this..","this.");n?te(e,n,p):"textContent"in e&&(e.textContent=p);return}const i=this.#t;s.forEach(p=>{const h=dt(p);if(typeof this[h]=="function")return;const m=i.propToExprsMap;let y=m.get(h);y||(y=[],m.set(h,y)),y.includes(t)||y.push(t)});for(const[p,h]of this.#n.entries())for(const m of h){const y=m instanceof HTMLElement||m instanceof CSSStyleRule?m:m.element;y instanceof CSSStyleRule||y.isConnected||this.#n.set(p,h.filter(V=>V!==m))}let c=this.#n.get(t);c||(c=[],this.#n.set(t,c)),c.push(n?{element:e,attrName:n}:e),e instanceof HTMLElement&&this.#M(e,n,s);const u=this.#o(t);n?te(e,n,u):this.#b(e,u)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){!this.#s||!Zt(e)||(this.#s.set(t,e),this.#f?.setFormValue(this.#s))}#e(t,e,n){const s=t instanceof HTMLElement?t.localName:"CSS rule";throw new Q(`component ${this.#t.elementName}`+(t?`, element "${s}"`:"")+(e?`, attribute "${e}"`:"")+` ${n}`)}#a(t,e,n){this.#e(t,e,`refers to missing property "${n}"`)}#A(t,e){return this.#_(t,this.getAttribute(e))}#_(t,e){if(e?.match(Kt))return e;const n=this.#t,{type:s}=n.properties[t];if(s||this.#e(null,t,"does not specify its type"),s===String)return e;if(s===Number)return Qt(e);if(s===Boolean)return e==="true"?!0:e==="false"||e==="null"?!1:(e&&e!==t&&this.#e(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t)}#L(t,e,n,s){if(Zt(n)&&this.hasAttribute(s)){const i=e===Boolean?this.hasAttribute(s):this.#A(t,s);n!==i&&Fe(this,t,n)}}#D(t){const n=this.#t.propToComputedMap.get(t)||[];for(const[s,i]of n)this[s]=this.#o(i)}#b(t,e){if(e===void 0)return;const n=t instanceof HTMLElement;Array.isArray(e)&&(e=e.join(""));const s=typeof e;s!=="string"&&s!=="number"&&this.#e(t,void 0," computed content is not a string or number");const i=String(e);if(t instanceof HTMLElement&&Tt(t))t.value=i;else if(n&&s==="string"&&i.trim().startsWith("<")){const c=jn(i);t.replaceChildren(...c),this.#S(t),this.#d(t)}else n&&(t.textContent=i)}#I(t,e){const n=this.#u.get(t);if(!n)return;const s=this.getRootNode();if(!(s instanceof ShadowRoot))return;const{host:i}=s;if(!i)return;const c=i;c[n]=e}useState(t,e){if(!e){e={};for(const n of Object.keys(t))e[n]=n}this.#v(t,e);for(const[n,s]of Object.entries(e))if(this.#i(s)){const i=Ie(t,n);i!==void 0&&(this[s]=i);const c=this.#t.properties[s];c.state=t,c.stateProp=n}t.addListener(this,e)}#P(){const t=this.#t,e=new Set(Object.keys(t.properties));for(const n of e)Hn.has(n)&&this.#e(null,"",`property "${n}" is not allowed because it is a reserved attribute`);for(const n of this.getAttributeNames())if(!Pn.has(n)&&!n.startsWith("on")){if(n==="form-assoc"){this.#T();continue}if(!e.has(F.getPropName(n))){if(n==="name"){this.#T();continue}this.#e(null,n,"is not a supported attribute")}}}#p(t,e,n){const s=n.match(Kt);if(s)return s.forEach(i=>{const c=dt(i);this[c]===void 0&&this.#a(t,e,c)}),s}#v(t,e){for(const[n,s]of Object.entries(e)){let i=Ie(t,n);if(i===void 0)throw new Q(`invalid state path "${n}"`);i=this[s],this.#i(s)||this.#e(null,s,"refers to missing property in useState map")}}#x(t,e,n){if(n instanceof e)return;let s=typeof n;if(s==="object"){const{constructor:i}=n;s=i.name,i!==e&&this.#e(null,t,`was set to a ${s}, but must be a ${e.name}`)}s!==e.name.toLowerCase()&&this.#e(null,t,`was set to a ${s}, but must be a ${e.name}`)}#S(t){const e=Array.from(t.querySelectorAll("*"));for(const n of e){const s=[];for(const i of Array.from(n.attributes)){const c=i.name;if(c.startsWith("on")){let u=c.slice(2);u=u[0].toLowerCase()+u.slice(1).toLowerCase();const p=i.value;this.#p(n,c,p);let h;typeof this[p]=="function"?h=m=>this[p](m):(this.#p(n,c,p),h=()=>this.#o(p)),n.addEventListener(u,h),s.push(c)}}for(const i of s)n.removeAttribute(i)}}}function Vn(r,...t){let e=xe(r,t);for(;;){const n=xn.exec(e);if(!n)break;const s=n[2];if(ve.test(s)){const i=n[1];if(!i.startsWith("--")){const c=`--${i}: ${s};
5
- ${i}: var(--${i})`;e=ke(e,n.index,n[0].length,c)}}}return e}function Xn(r,...t){let e=xe(r,t);for(;;){const n=Un.exec(e);if(!n||n[1]==="style")break;const s=Bn(n[2]);if(ve.test(s)){const i=`<!-- ${s.trim()} -->`,c=n.index+n[0].indexOf(">")+1;e=ke(e,c,s.length,i)}}return e}T.Wrec=F,T.WrecState=Mt,T.createElement=Wn,T.css=Vn,T.html=Xn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
4
+ `;let s=t.html.trim();if(!s)throw new Q("static property html must be set");s.startsWith("<")||(s=`<span><!--${s}--></span>`),e.innerHTML=n+s}await jn(e),this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,n){this[e]=n}connectedCallback(){this.#P(),this.#w(),this.#y().then(()=>{this.hasAttribute("disabled")&&this.#m(),this.#S(this.shadowRoot),this.#d(this.shadowRoot),this.#R()})}#R(){const t=this.#t,{properties:e}=t;for(const[n,{computed:s}]of Object.entries(e))s&&(this[n]=this.#o(s))}#w(){const t=this.#t,{observedAttributes:e,properties:n}=t;for(const[s,i]of Object.entries(n))i.computed||this.#h(s,i,e);for(const[s,i]of Object.entries(n))i.computed&&this.#h(s,i,e)}#h(t,e,n){const s=F.getAttrName(t),i=this.hasAttribute(s);e.required&&!i&&this.#e(this,t,"is a required attribute");let c=e.value;this.hasOwnProperty(t)&&(c=this[t],delete this[t]);const{type:u}=e,p=u===Boolean?c||i:n.includes(s)&&i?this.#A(t,s):c||Wn(u),h="#"+t;this[h]=p,e.computed&&this.#L(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[h]},set(m){u===Number&&typeof m=="string"&&(m=Qt(m));const y=this[h];if(m===y)return;this.#x(t,u,m),this[h]=m;const{state:V,stateProp:W}=this.#t.properties[t];W&&In(V,W,m),this.#D(t),this.#N(t,u,m,s),this.#E(t),this.#I(t,m);const X=this.#c[t];X&&this.setFormValue(X,String(m)),this.propertyChangedCallback(t,y,m),e.dispatch&&this.dispatch("change",{tagName:this.localName,property:t,oldValue:y,value:m})}})}#m(){const t=this.hasAttribute("disabled"),e=Lt(this.shadowRoot);for(const n of e)zn(n)&&(n.disabled=t)}disconnectedCallback(){this.#n.clear(),this.#l.clear(),this.#u.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}#O(t){const e=t instanceof F;for(const n of t.getAttributeNames()){const s=t.getAttribute(n),i=this.#g(t,s);if(i){const c=this[i];c===void 0&&this.#a(t,n,i),t[i]=c;let[u,p]=n.split(":");u==="value"&&(p?(t["on"+p]===void 0&&this.#e(t,n,"refers to an unsupported event name"),t.setAttribute(u,this[i])):p="change"),e&&t.#u.set(F.getPropName(u),i)}this.#r(s,t,n)}}#o(t){return new Function("return "+t).call(this)}#C(t){const{localName:e}=t;if(e==="style"){const{sheet:n}=t,s=n?.cssRules??[],i=Array.from(s);for(const c of i)if(c.constructor===CSSStyleRule){const u=Array.from(c.style);for(const p of u)if(p.startsWith("--")){const h=c.style.getPropertyValue(p);this.#r(h,c,p)}}}else{let n="";if(Tt(t)){this.#r(t.textContent,t);const s=t.textContent?.match(Fn);s&&(n=s[1])}else{const s=Array.from(t.childNodes).find(i=>i.nodeType===Node.COMMENT_NODE);s&&(n=s.textContent?.trim()??"")}if(n){const s=this.#g(t,n);s&&Tt(t)?t.textContent=this[s]:this.#r(n,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const c=this.getAttribute("name");if(c)if(this.#i("value"))t=`value:${c}`;else return;else return}const e={},n=t.split(",");for(const c of n){const[u,p]=c.split(":");e[u.trim()]=p.trim()}this.#c=e,this.#s=new FormData,this.#f=this.attachInternals(),this.#f.setFormValue(this.#s);const s=Object.keys(this.#t.properties),i=this.#l;for(const c of s)i[c]=this[c]}formResetCallback(){const t=this.#l;for(const e of Object.keys(t)){let n=t[e];qt.test(n)&&(n=this.#o(n)),this[e]=n}}static getAttrName(t){let e=this.propToAttrMap.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),this.propToAttrMap.set(t,e)),e}static getPropName(t){let e=this.attrToPropMap.get(t);return e||(e=t.replace(/-([a-z])/g,(n,s)=>s.toUpperCase()),this.attrToPropMap.set(t,e)),e}#M(t,e,n){if(n.length!==1)return;const[s]=n;if(!qt.test(s))return;const i=Jt(t)||Tt(t);let[c,u]=(e??"").split(":");if(!(i&&c==="value"||Tt(t)))return;u?t["on"+u]===void 0&&this.#e(t,e,"refers to an unsupported event name"):u="change";const h=dt(s);t.addEventListener(u,m=>{const{target:y}=m;if(!y)return;const V=y.value,{type:W}=this.#t.properties[h];this[h]=W===Number?Qt(V):V,this.#E(h)})}#i(t){return!!this.#t.properties[t]}#d(t){const e=Array.from(t.querySelectorAll("*"));for(const n of e)this.#O(n),n.firstElementChild||this.#C(n)}#T(){if(this.#t.formAssociated||this.closest("form")===null)return;const t=this.#t.name;throw new Q(`inside form, class ${t} requires "static formAssociated = true;"`)}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(e=>F.getAttrName(e));return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,n){}#g(t,e){if(!e||!qt.test(e))return;const n=dt(e);return this[n]===void 0&&this.#a(t,"",n),n}#E(t){const s=this.#t.propToExprsMap.get(t)||[];for(const i of s){let c=this.#o(i);const u=this.#n.get(i)??[];for(const p of u)if(p instanceof HTMLElement)this.#b(p,c);else if(!(p instanceof CSSStyleRule)){const{element:h,attrName:m}=p;h instanceof CSSStyleRule?h.style.setProperty(m,c):te(h,m,c)}}}#L(t,e){const{computed:n,uses:s}=e,i=this.#t.propToComputedMap;function c(p,h){let m=i.get(p);m||(m=[],i.set(p,m)),m.push([t,h])}const u=n.match(Kt)||[];for(const p of u){const h=dt(p);this[h]===void 0&&this.#a(null,t,h),typeof this[h]!="function"&&c(h,n)}if(s)for(const p of s.split(","))c(p,n)}#r(t,e,n=void 0){if(!t)return;const s=this.#p(e,n,t);if(!s){const p=t.replaceAll("this..","this.");n?te(e,n,p):"textContent"in e&&(e.textContent=p);return}const i=this.#t;s.forEach(p=>{const h=dt(p);if(typeof this[h]=="function")return;const m=i.propToExprsMap;let y=m.get(h);y||(y=[],m.set(h,y)),y.includes(t)||y.push(t)});for(const[p,h]of this.#n.entries())for(const m of h){const y=m instanceof HTMLElement||m instanceof CSSStyleRule?m:m.element;y instanceof CSSStyleRule||y.isConnected||this.#n.set(p,h.filter(V=>V!==m))}let c=this.#n.get(t);c||(c=[],this.#n.set(t,c)),c.push(n?{element:e,attrName:n}:e),e instanceof HTMLElement&&this.#M(e,n,s);const u=this.#o(t);n?te(e,n,u):this.#b(e,u)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){!this.#s||!Zt(e)||(this.#s.set(t,e),this.#f?.setFormValue(this.#s))}#e(t,e,n){const s=t instanceof HTMLElement?t.localName:"CSS rule";throw new Q(`component ${this.#t.elementName}`+(t?`, element "${s}"`:"")+(e?`, attribute "${e}"`:"")+` ${n}`)}#a(t,e,n){this.#e(t,e,`refers to missing property "${n}"`)}#A(t,e){return this.#_(t,this.getAttribute(e))}#_(t,e){if(e?.match(Kt))return e;const n=this.#t,{type:s}=n.properties[t];if(s||this.#e(null,t,"does not specify its type"),s===String)return e;if(s===Number)return Qt(e);if(s===Boolean)return e==="true"?!0:e==="false"||e==="null"?!1:(e&&e!==t&&this.#e(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t)}#N(t,e,n,s){if(Zt(n)&&this.hasAttribute(s)){const i=e===Boolean?this.hasAttribute(s):this.#A(t,s);n!==i&&Fe(this,t,n)}}#D(t){const n=this.#t.propToComputedMap.get(t)||[];for(const[s,i]of n)this[s]=this.#o(i)}#b(t,e){if(e===void 0)return;const n=t instanceof HTMLElement;Array.isArray(e)&&(e=e.join(""));const s=typeof e;s!=="string"&&s!=="number"&&this.#e(t,void 0," computed content is not a string or number");const i=String(e);if(t instanceof HTMLElement&&Tt(t))t.value=i;else if(n&&s==="string"&&i.trim().startsWith("<")){const c=Bn(i);t.replaceChildren(...c),this.#S(t),this.#d(t)}else n&&(t.textContent=i)}#I(t,e){const n=this.#u.get(t);if(!n)return;const s=this.getRootNode();if(!(s instanceof ShadowRoot))return;const{host:i}=s;if(!i)return;const c=i;c[n]=e}useState(t,e){if(!e){e={};for(const n of Object.keys(t))e[n]=n}this.#v(t,e);for(const[n,s]of Object.entries(e))if(this.#i(s)){const i=Ie(t,n);i!==void 0&&(this[s]=i);const c=this.#t.properties[s];c.state=t,c.stateProp=n}t.addListener(this,e)}#P(){const t=new Set(Object.keys(this.#t.properties));for(const e of this.getAttributeNames())if(!Pn.has(e)&&!e.startsWith("on")){if(e==="form-assoc"){this.#T();continue}if(!t.has(F.getPropName(e))){if(e==="name"){this.#T();continue}this.#e(null,e,"is not a supported attribute")}}}#p(t,e,n){const s=n.match(Kt);if(s)return s.forEach(i=>{const c=dt(i);this[c]===void 0&&this.#a(t,e,c)}),s}#v(t,e){for(const[n,s]of Object.entries(e)){let i=Ie(t,n);if(i===void 0)throw new Q(`invalid state path "${n}"`);i=this[s],this.#i(s)||this.#e(null,s,"refers to missing property in useState map")}}#x(t,e,n){if(n instanceof e)return;let s=typeof n;if(s==="object"){const{constructor:i}=n;s=i.name,i!==e&&this.#e(null,t,`was set to a ${s}, but must be a ${e.name}`)}s!==e.name.toLowerCase()&&this.#e(null,t,`was set to a ${s}, but must be a ${e.name}`)}#S(t){const e=Array.from(t.querySelectorAll("*"));for(const n of e){const s=[];for(const i of Array.from(n.attributes)){const c=i.name;if(c.startsWith("on")){let u=c.slice(2);u=u[0].toLowerCase()+u.slice(1).toLowerCase();const p=i.value;this.#p(n,c,p);let h;typeof this[p]=="function"?h=m=>this[p](m):(this.#p(n,c,p),h=()=>this.#o(p)),n.addEventListener(u,h),s.push(c)}}for(const i of s)n.removeAttribute(i)}}}function Yn(r,...t){let e=xe(r,t);for(;;){const n=xn.exec(e);if(!n)break;const s=n[2];if(ve.test(s)){const i=n[1];if(!i.startsWith("--")){const c=`--${i}: ${s};
5
+ ${i}: var(--${i})`;e=ke(e,n.index,n[0].length,c)}}}return e}function Vn(r,...t){let e=xe(r,t);for(;;){const n=Un.exec(e);if(!n||n[1]==="style")break;const s=Gn(n[2]);if(ve.test(s)){const i=`<!-- ${s.trim()} -->`,c=n.index+n[0].indexOf(">")+1;e=ke(e,c,s.length,i)}}return e}T.Wrec=F,T.WrecState=Mt,T.createElement=$n,T.css=Yn,T.html=Vn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wrec",
3
3
  "description": "a small library that greatly simplifies building web components",
4
4
  "author": "R. Mark Volkmann",
5
- "version": "0.20.7",
5
+ "version": "0.20.8",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",