@borurio-print/print-designer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +117 -0
  2. package/dist-lib/PrintDesigner.vue.d.ts +3 -0
  3. package/dist-lib/assets/iconfont/iconfont.d.ts +1 -0
  4. package/dist-lib/components/IconFont.vue.d.ts +14 -0
  5. package/dist-lib/core/componentRegistry.d.ts +25 -0
  6. package/dist-lib/core/dynamicText.d.ts +21 -0
  7. package/dist-lib/core/elementInteraction.d.ts +31 -0
  8. package/dist-lib/core/pdfGenerator.d.ts +5 -0
  9. package/dist-lib/core/types.d.ts +117 -0
  10. package/dist-lib/html2canvas.esm-BWVIUcAF.js +4802 -0
  11. package/dist-lib/iconfont-BnrPP-u4.js +35 -0
  12. package/dist-lib/index-CWXXAPGm.js +6957 -0
  13. package/dist-lib/index.d.ts +8 -0
  14. package/dist-lib/index.es-D9S6l8PM.js +6649 -0
  15. package/dist-lib/index.js +11 -0
  16. package/dist-lib/locales/en-US.d.ts +87 -0
  17. package/dist-lib/locales/zh-CN.d.ts +87 -0
  18. package/dist-lib/pdfGenerator-CjZCu1Cq.js +9594 -0
  19. package/dist-lib/purify.es-C841O74m.js +897 -0
  20. package/dist-lib/style.css +1 -0
  21. package/dist-lib/views/print-designer/components/BarcodeSvgElement.vue.d.ts +11 -0
  22. package/dist-lib/views/print-designer/components/ComponentPanel.vue.d.ts +8 -0
  23. package/dist-lib/views/print-designer/components/ElementListPanel.vue.d.ts +14 -0
  24. package/dist-lib/views/print-designer/components/ElementPropertiesPanel.vue.d.ts +12 -0
  25. package/dist-lib/views/print-designer/components/PdfPagesRenderer.vue.d.ts +14 -0
  26. package/dist-lib/views/print-designer/components/PreviewPanel.vue.d.ts +14 -0
  27. package/dist-lib/views/print-designer/components/PrintDialog.vue.d.ts +16 -0
  28. package/dist-lib/views/print-designer/components/QrcodeSvgElement.vue.d.ts +11 -0
  29. package/dist-lib/views/print-designer/components/SvgElementsRenderer.vue.d.ts +27 -0
  30. package/dist-lib/views/print-designer/components/SvgSelectionBox.vue.d.ts +11 -0
  31. package/dist-lib/views/print-designer/components/TemplateCanvas.vue.d.ts +19 -0
  32. package/dist-lib/views/print-designer/components/TemplateInfoDialog.vue.d.ts +17 -0
  33. package/dist-lib/views/print-designer/components/TemplateInfoPanel.vue.d.ts +13 -0
  34. package/dist-lib/views/print-designer/components/WorkspaceToolbar.vue.d.ts +19 -0
  35. package/dist-lib/views/print-designer/components/properties/ContentProperty.vue.d.ts +12 -0
  36. package/dist-lib/views/print-designer/components/properties/FixedTimeProperty.vue.d.ts +12 -0
  37. package/dist-lib/views/print-designer/components/properties/FontSizeProperty.vue.d.ts +12 -0
  38. package/dist-lib/views/print-designer/components/properties/FontWeightProperty.vue.d.ts +12 -0
  39. package/dist-lib/views/print-designer/components/properties/HeightProperty.vue.d.ts +12 -0
  40. package/dist-lib/views/print-designer/components/properties/IncludeTimeProperty.vue.d.ts +12 -0
  41. package/dist-lib/views/print-designer/components/properties/RotationProperty.vue.d.ts +12 -0
  42. package/dist-lib/views/print-designer/components/properties/StrokeWidthProperty.vue.d.ts +12 -0
  43. package/dist-lib/views/print-designer/components/properties/TimeModeProperty.vue.d.ts +12 -0
  44. package/dist-lib/views/print-designer/components/properties/WidthProperty.vue.d.ts +12 -0
  45. package/package.json +61 -0
@@ -0,0 +1,897 @@
1
+ function We(r, i) {
2
+ (i == null || i > r.length) && (i = r.length);
3
+ for (var s = 0, c = Array(i); s < i; s++) c[s] = r[s];
4
+ return c;
5
+ }
6
+ function Fn(r) {
7
+ if (Array.isArray(r)) return r;
8
+ }
9
+ function zn(r, i) {
10
+ var s = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
11
+ if (s != null) {
12
+ var c, f, d, y, st = [], N = !0, lt = !1;
13
+ try {
14
+ if (d = (s = s.call(r)).next, i !== 0) for (; !(N = (c = d.call(s)).done) && (st.push(c.value), st.length !== i); N = !0) ;
15
+ } catch (xt) {
16
+ lt = !0, f = xt;
17
+ } finally {
18
+ try {
19
+ if (!N && s.return != null && (y = s.return(), Object(y) !== y)) return;
20
+ } finally {
21
+ if (lt) throw f;
22
+ }
23
+ }
24
+ return st;
25
+ }
26
+ }
27
+ function Hn() {
28
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
29
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
30
+ }
31
+ function Gn(r, i) {
32
+ return Fn(r) || zn(r, i) || Wn(r, i) || Hn();
33
+ }
34
+ function Wn(r, i) {
35
+ if (r) {
36
+ if (typeof r == "string") return We(r, i);
37
+ var s = {}.toString.call(r).slice(8, -1);
38
+ return s === "Object" && r.constructor && (s = r.constructor.name), s === "Map" || s === "Set" ? Array.from(r) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? We(r, i) : void 0;
39
+ }
40
+ }
41
+ const on = Object.entries, Be = Object.setPrototypeOf, Bn = Object.isFrozen, Yn = Object.getPrototypeOf, jn = Object.getOwnPropertyDescriptor;
42
+ let S = Object.freeze, b = Object.seal, it = Object.create, rn = typeof Reflect < "u" && Reflect, se = rn.apply, le = rn.construct;
43
+ S || (S = function(i) {
44
+ return i;
45
+ });
46
+ b || (b = function(i) {
47
+ return i;
48
+ });
49
+ se || (se = function(i, s) {
50
+ for (var c = arguments.length, f = new Array(c > 2 ? c - 2 : 0), d = 2; d < c; d++)
51
+ f[d - 2] = arguments[d];
52
+ return i.apply(s, f);
53
+ });
54
+ le || (le = function(i) {
55
+ for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
56
+ c[f - 1] = arguments[f];
57
+ return new i(...c);
58
+ });
59
+ const V = A(Array.prototype.forEach), $n = A(Array.prototype.lastIndexOf), Ye = A(Array.prototype.pop), dt = A(Array.prototype.push), Xn = A(Array.prototype.splice), at = Array.isArray, _t = A(String.prototype.toLowerCase), ee = A(String.prototype.toString), je = A(String.prototype.match), Tt = A(String.prototype.replace), $e = A(String.prototype.indexOf), Vn = A(String.prototype.trim), qn = A(Number.prototype.toString), Kn = A(Boolean.prototype.toString), Xe = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), Ve = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), I = A(Object.prototype.hasOwnProperty), ht = A(Object.prototype.toString), O = A(RegExp.prototype.test), X = Zn(TypeError);
60
+ function A(r) {
61
+ return function(i) {
62
+ i instanceof RegExp && (i.lastIndex = 0);
63
+ for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++)
64
+ c[f - 1] = arguments[f];
65
+ return se(r, i, c);
66
+ };
67
+ }
68
+ function Zn(r) {
69
+ return function() {
70
+ for (var i = arguments.length, s = new Array(i), c = 0; c < i; c++)
71
+ s[c] = arguments[c];
72
+ return le(r, s);
73
+ };
74
+ }
75
+ function p(r, i) {
76
+ let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
77
+ if (Be && Be(r, null), !at(i))
78
+ return r;
79
+ let c = i.length;
80
+ for (; c--; ) {
81
+ let f = i[c];
82
+ if (typeof f == "string") {
83
+ const d = s(f);
84
+ d !== f && (Bn(i) || (i[c] = d), f = d);
85
+ }
86
+ r[f] = !0;
87
+ }
88
+ return r;
89
+ }
90
+ function Jn(r) {
91
+ for (let i = 0; i < r.length; i++)
92
+ I(r, i) || (r[i] = null);
93
+ return r;
94
+ }
95
+ function C(r) {
96
+ const i = it(null);
97
+ for (const c of on(r)) {
98
+ var s = Gn(c, 2);
99
+ const f = s[0], d = s[1];
100
+ I(r, f) && (at(d) ? i[f] = Jn(d) : d && typeof d == "object" && d.constructor === Object ? i[f] = C(d) : i[f] = d);
101
+ }
102
+ return i;
103
+ }
104
+ function Qn(r) {
105
+ switch (typeof r) {
106
+ case "string":
107
+ return r;
108
+ case "number":
109
+ return qn(r);
110
+ case "boolean":
111
+ return Kn(r);
112
+ case "bigint":
113
+ return Xe ? Xe(r) : "0";
114
+ case "symbol":
115
+ return Ve ? Ve(r) : "Symbol()";
116
+ case "undefined":
117
+ return ht(r);
118
+ case "function":
119
+ case "object": {
120
+ if (r === null)
121
+ return ht(r);
122
+ const i = r, s = P(i, "toString");
123
+ if (typeof s == "function") {
124
+ const c = s(i);
125
+ return typeof c == "string" ? c : ht(c);
126
+ }
127
+ return ht(r);
128
+ }
129
+ default:
130
+ return ht(r);
131
+ }
132
+ }
133
+ function P(r, i) {
134
+ for (; r !== null; ) {
135
+ const c = jn(r, i);
136
+ if (c) {
137
+ if (c.get)
138
+ return A(c.get);
139
+ if (typeof c.value == "function")
140
+ return A(c.value);
141
+ }
142
+ r = Yn(r);
143
+ }
144
+ function s() {
145
+ return null;
146
+ }
147
+ return s;
148
+ }
149
+ function to(r) {
150
+ try {
151
+ return O(r, ""), !0;
152
+ } catch {
153
+ return !1;
154
+ }
155
+ }
156
+ const qe = S(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), ne = S(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), oe = S(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), eo = S(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), re = S(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), no = S(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ke = S(["#text"]), Ze = S(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), ie = S(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "pointer-events", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "vector-effect", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Je = S(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Pt = S(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), oo = b(/{{[\w\W]*|^[\w\W]*}}/g), ro = b(/<%[\w\W]*|^[\w\W]*%>/g), io = b(/\${[\w\W]*/g), ao = b(/^data-[\-\w.\u00B7-\uFFFF]+$/), so = b(/^aria-[\-\w]+$/), Qe = b(
157
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
158
+ // eslint-disable-line no-useless-escape
159
+ ), lo = b(/^(?:\w+script|data):/i), co = b(
160
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
161
+ // eslint-disable-line no-control-regex
162
+ ), uo = b(/^html$/i), fo = b(/^[a-z][.\w]*(-[.\w]+)+$/i), tn = b(/<[/\w!]/g), en = b(/<[/\w]/g), po = b(/<\/no(script|embed|frames)/i), mo = b(/\/>/i), M = {
163
+ element: 1,
164
+ attribute: 2,
165
+ text: 3,
166
+ cdataSection: 4,
167
+ entityReference: 5,
168
+ // Deprecated
169
+ entityNode: 6,
170
+ // Deprecated
171
+ processingInstruction: 7,
172
+ comment: 8,
173
+ document: 9,
174
+ documentType: 10,
175
+ documentFragment: 11,
176
+ notation: 12
177
+ // Deprecated
178
+ }, an = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"], To = S(p({}, an)), ho = (function() {
179
+ const r = {};
180
+ return V(an, (i) => {
181
+ r[i] = b(new RegExp("</" + i + "(?=[\\t\\n\\f\\r />])", "i"));
182
+ }), S(r);
183
+ })(), _o = function() {
184
+ return typeof window > "u" ? null : window;
185
+ }, go = function(i, s) {
186
+ if (typeof i != "object" || typeof i.createPolicy != "function")
187
+ return null;
188
+ let c = null;
189
+ const f = "data-tt-policy-suffix";
190
+ s && s.hasAttribute(f) && (c = s.getAttribute(f));
191
+ const d = "dompurify" + (c ? "#" + c : "");
192
+ try {
193
+ return i.createPolicy(d, {
194
+ createHTML(y) {
195
+ return y;
196
+ },
197
+ createScriptURL(y) {
198
+ return y;
199
+ }
200
+ });
201
+ } catch {
202
+ return console.warn("TrustedTypes policy " + d + " could not be created."), null;
203
+ }
204
+ }, nn = function() {
205
+ return {
206
+ afterSanitizeAttributes: [],
207
+ afterSanitizeElements: [],
208
+ afterSanitizeShadowDOM: [],
209
+ beforeSanitizeAttributes: [],
210
+ beforeSanitizeElements: [],
211
+ beforeSanitizeShadowDOM: [],
212
+ uponSanitizeAttribute: [],
213
+ uponSanitizeElement: [],
214
+ uponSanitizeShadowNode: []
215
+ };
216
+ }, H = function(i, s, c, f) {
217
+ return I(i, s) && at(i[s]) ? p(f.base ? C(f.base) : {}, i[s], f.transform) : c;
218
+ }, ae = function(i, s, c) {
219
+ const f = I(i, s) ? i[s] : void 0;
220
+ return f && typeof f == "object" ? C(f) : c();
221
+ };
222
+ function sn() {
223
+ let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _o();
224
+ const i = (o) => sn(o);
225
+ if (i.version = "3.4.14", i.removed = [], !r || !r.document || r.document.nodeType !== M.document || !r.Element)
226
+ return i.isSupported = !1, i;
227
+ let s = r.document;
228
+ const c = s, f = c.currentScript;
229
+ r.DocumentFragment;
230
+ const d = r.HTMLTemplateElement, y = r.Node, st = r.Element, N = r.NodeFilter, lt = r.NamedNodeMap;
231
+ lt === void 0 && (r.NamedNodeMap || r.MozNamedAttrMap), r.HTMLFormElement;
232
+ const xt = r.DOMParser, gt = r.trustedTypes, G = st.prototype, ln = P(G, "cloneNode"), vt = P(G, "remove"), cn = P(G, "nextSibling"), q = P(G, "childNodes"), K = P(G, "parentNode"), ce = P(G, "shadowRoot"), kt = P(G, "attributes"), W = y && y.prototype ? P(y.prototype, "nodeType") : null, Z = y && y.prototype ? P(y.prototype, "nodeName") : null, Et = y && y.prototype ? P(y.prototype, "ownerDocument") : null, ct = function(t) {
233
+ return W ? W(t) : t.nodeType;
234
+ }, Ut = function(t) {
235
+ return Z ? Z(t) : t.nodeName;
236
+ };
237
+ if (typeof d == "function") {
238
+ const o = s.createElement("template");
239
+ o.content && o.content.ownerDocument && (s = o.content.ownerDocument);
240
+ }
241
+ let L, B = "", Ft, ue = !1, ut = 0;
242
+ const fe = function() {
243
+ if (ut > 0)
244
+ throw X('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
245
+ }, J = function(t) {
246
+ fe(), ut++;
247
+ try {
248
+ return L.createHTML(t);
249
+ } finally {
250
+ ut--;
251
+ }
252
+ }, un = function(t) {
253
+ fe(), ut++;
254
+ try {
255
+ return L.createScriptURL(t);
256
+ } finally {
257
+ ut--;
258
+ }
259
+ }, fn = function() {
260
+ return ue || (Ft = go(gt, f), ue = !0), Ft;
261
+ }, At = s, zt = At.implementation, pe = At.createNodeIterator, pn = At.createDocumentFragment, mn = At.getElementsByTagName, dn = c.importNode;
262
+ let T = nn();
263
+ i.isSupported = typeof on == "function" && typeof K == "function" && zt && zt.createHTMLDocument !== void 0;
264
+ const Tn = oo, hn = ro, _n = io, gn = ao, En = so, An = lo, me = co, yn = fo;
265
+ let de = Qe, h = null;
266
+ const Ht = p({}, [...qe, ...ne, ...oe, ...re, ...Ke]);
267
+ let _ = null;
268
+ const Gt = p({}, [...Ze, ...ie, ...Je, ...Pt]);
269
+ let x = Object.seal(it(null, {
270
+ tagNameCheck: {
271
+ writable: !0,
272
+ configurable: !1,
273
+ enumerable: !0,
274
+ value: null
275
+ },
276
+ attributeNameCheck: {
277
+ writable: !0,
278
+ configurable: !1,
279
+ enumerable: !0,
280
+ value: null
281
+ },
282
+ allowCustomizedBuiltInElements: {
283
+ writable: !0,
284
+ configurable: !1,
285
+ enumerable: !0,
286
+ value: !1
287
+ }
288
+ })), ft = null, Te = null;
289
+ const U = Object.seal(it(null, {
290
+ tagCheck: {
291
+ writable: !0,
292
+ configurable: !1,
293
+ enumerable: !0,
294
+ value: null
295
+ },
296
+ attributeCheck: {
297
+ writable: !0,
298
+ configurable: !1,
299
+ enumerable: !0,
300
+ value: null
301
+ }
302
+ }));
303
+ let he = !0, Wt = !0, _e = !1, ge = !0, F = !1, Y = !0, j = !1, Bt = !1, yt = null, St = null, Yt = !1, Q = !1, bt = !1, Ot = !1, Ee = !0, Ae = !1;
304
+ const ye = "user-content-";
305
+ let jt = !0, $t = !1, tt = {}, et = null;
306
+ const Se = p({}, [
307
+ "annotation-xml",
308
+ "audio",
309
+ "colgroup",
310
+ "desc",
311
+ "foreignobject",
312
+ "head",
313
+ "iframe",
314
+ "math",
315
+ "mi",
316
+ "mn",
317
+ "mo",
318
+ "ms",
319
+ "mtext",
320
+ "noembed",
321
+ "noframes",
322
+ "noscript",
323
+ "plaintext",
324
+ "script",
325
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
326
+ // the UA (customizable <select>) — including any on* handlers — and the
327
+ // engine re-mirrors synchronously whenever a removal changes which
328
+ // option/selectedcontent is current, even inside DOMPurify's inert
329
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
330
+ // mirror target ahead of the walk, which the engine refills, looping
331
+ // forever (DoS) and amplifying output. Dropping its content on removal
332
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
333
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
334
+ "selectedcontent",
335
+ "style",
336
+ "svg",
337
+ "template",
338
+ "thead",
339
+ "title",
340
+ "video",
341
+ "xmp"
342
+ ]);
343
+ let be = null;
344
+ const Oe = p({}, ["audio", "video", "img", "source", "image", "track"]);
345
+ let Re = null;
346
+ const Le = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Rt = "http://www.w3.org/1998/Math/MathML", Lt = "http://www.w3.org/2000/svg", v = "http://www.w3.org/1999/xhtml";
347
+ let nt = v, Xt = !1, Vt = null;
348
+ const Sn = p({}, [Rt, Lt, v], ee), De = S(["mi", "mo", "mn", "ms", "mtext"]);
349
+ let qt = p({}, De);
350
+ const we = S(["annotation-xml"]);
351
+ let Kt = p({}, we);
352
+ const bn = p({}, ["title", "style", "font", "a", "script"]);
353
+ let pt = null;
354
+ const On = ["application/xhtml+xml", "text/html"], Rn = "text/html";
355
+ let E = null, ot = null;
356
+ const Ln = s.createElement("form"), Ie = function(t) {
357
+ return t instanceof RegExp || t instanceof Function;
358
+ }, Zt = function() {
359
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
360
+ if (ot && ot === t)
361
+ return;
362
+ (!t || typeof t != "object") && (t = {}), t = C(t), pt = // eslint-disable-next-line unicorn/prefer-includes
363
+ On.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Rn : t.PARSER_MEDIA_TYPE, E = pt === "application/xhtml+xml" ? ee : _t, h = H(t, "ALLOWED_TAGS", Ht, {
364
+ transform: E
365
+ }), _ = H(t, "ALLOWED_ATTR", Gt, {
366
+ transform: E
367
+ }), Vt = H(t, "ALLOWED_NAMESPACES", Sn, {
368
+ transform: ee
369
+ }), Re = H(t, "ADD_URI_SAFE_ATTR", Le, {
370
+ transform: E,
371
+ base: Le
372
+ }), be = H(t, "ADD_DATA_URI_TAGS", Oe, {
373
+ transform: E,
374
+ base: Oe
375
+ }), et = H(t, "FORBID_CONTENTS", Se, {
376
+ transform: E
377
+ }), ft = H(t, "FORBID_TAGS", C({}), {
378
+ transform: E
379
+ }), Te = H(t, "FORBID_ATTR", C({}), {
380
+ transform: E
381
+ }), tt = I(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? C(t.USE_PROFILES) : t.USE_PROFILES : !1, he = t.ALLOW_ARIA_ATTR !== !1, Wt = t.ALLOW_DATA_ATTR !== !1, _e = t.ALLOW_UNKNOWN_PROTOCOLS || !1, ge = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, F = t.SAFE_FOR_TEMPLATES || !1, Y = t.SAFE_FOR_XML !== !1, j = t.WHOLE_DOCUMENT || !1, Q = t.RETURN_DOM || !1, bt = t.RETURN_DOM_FRAGMENT || !1, Ot = t.RETURN_TRUSTED_TYPE || !1, Yt = t.FORCE_BODY || !1, Ee = t.SANITIZE_DOM !== !1, Ae = t.SANITIZE_NAMED_PROPS || !1, jt = t.KEEP_CONTENT !== !1, $t = t.IN_PLACE || !1, de = to(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : Qe, nt = typeof t.NAMESPACE == "string" ? t.NAMESPACE : v, qt = ae(
382
+ t,
383
+ "MATHML_TEXT_INTEGRATION_POINTS",
384
+ () => p({}, De)
385
+ // Default built-in map
386
+ ), Kt = ae(
387
+ t,
388
+ "HTML_INTEGRATION_POINTS",
389
+ () => p({}, we)
390
+ // Default built-in map
391
+ );
392
+ const e = ae(t, "CUSTOM_ELEMENT_HANDLING", () => it(null));
393
+ if (x = it(null), I(e, "tagNameCheck") && Ie(e.tagNameCheck) && (x.tagNameCheck = e.tagNameCheck), I(e, "attributeNameCheck") && Ie(e.attributeNameCheck) && (x.attributeNameCheck = e.attributeNameCheck), I(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (x.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), b(x), F && (Wt = !1), bt && (Q = !0), tt && (h = p({}, Ke), _ = it(null), tt.html === !0 && (p(h, qe), p(_, Ze)), tt.svg === !0 && (p(h, ne), p(_, ie), p(_, Pt)), tt.svgFilters === !0 && (p(h, oe), p(_, ie), p(_, Pt)), tt.mathMl === !0 && (p(h, re), p(_, Je), p(_, Pt))), U.tagCheck = null, U.attributeCheck = null, I(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? U.tagCheck = t.ADD_TAGS : at(t.ADD_TAGS) && (h === Ht && (h = C(h)), p(h, t.ADD_TAGS, E))), I(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? U.attributeCheck = t.ADD_ATTR : at(t.ADD_ATTR) && (_ === Gt && (_ = C(_)), p(_, t.ADD_ATTR, E))), I(t, "ADD_FORBID_CONTENTS") && at(t.ADD_FORBID_CONTENTS) && (et === Se && (et = C(et)), p(et, t.ADD_FORBID_CONTENTS, E)), jt && (h["#text"] = !0), j && p(h, ["html", "head", "body"]), h.table && (p(h, ["tbody"]), delete ft.tbody), t.TRUSTED_TYPES_POLICY) {
394
+ if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
395
+ throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
396
+ if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
397
+ throw X('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
398
+ const n = L;
399
+ L = t.TRUSTED_TYPES_POLICY;
400
+ try {
401
+ B = J("");
402
+ } catch (a) {
403
+ throw L = n, a;
404
+ }
405
+ } else t.TRUSTED_TYPES_POLICY === null ? (L = void 0, B = "") : (L === void 0 && (L = fn()), L && typeof B == "string" && (B = J("")));
406
+ S && S(t), ot = t;
407
+ }, Ne = p({}, [...ne, ...oe, ...eo]), Me = p({}, [...re, ...no]), Dn = function(t, e, n) {
408
+ return e.namespaceURI === v ? t === "svg" : e.namespaceURI === Rt ? t === "svg" && (n === "annotation-xml" || qt[n]) : !!Ne[t];
409
+ }, wn = function(t, e, n) {
410
+ return e.namespaceURI === v ? t === "math" : e.namespaceURI === Lt ? t === "math" && Kt[n] : !!Me[t];
411
+ }, In = function(t, e, n) {
412
+ return e.namespaceURI === Lt && !Kt[n] || e.namespaceURI === Rt && !qt[n] ? !1 : !Me[t] && (bn[t] || !Ne[t]);
413
+ }, Nn = function(t) {
414
+ let e = K(t);
415
+ (!e || !e.tagName) && (e = {
416
+ namespaceURI: nt,
417
+ tagName: "template"
418
+ });
419
+ const n = _t(t.tagName), a = _t(e.tagName);
420
+ return Vt[t.namespaceURI] ? t.namespaceURI === Lt ? Dn(n, e, a) : t.namespaceURI === Rt ? wn(n, e, a) : t.namespaceURI === v ? In(n, e, a) : !!(pt === "application/xhtml+xml" && Vt[t.namespaceURI]) : !1;
421
+ }, z = function(t) {
422
+ dt(i.removed, {
423
+ element: t
424
+ });
425
+ try {
426
+ K(t).removeChild(t);
427
+ } catch {
428
+ if (vt(t), !K(t))
429
+ throw X("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
430
+ }
431
+ }, Ce = function(t, e, n) {
432
+ try {
433
+ t.removeAttributeNode(e);
434
+ } catch {
435
+ try {
436
+ t.removeAttribute(n);
437
+ } catch {
438
+ }
439
+ }
440
+ }, Dt = function(t) {
441
+ wt(t);
442
+ const e = q(t);
443
+ if (e) {
444
+ const a = [];
445
+ V(e, (l) => {
446
+ dt(a, l);
447
+ }), V(a, (l) => {
448
+ try {
449
+ vt(l);
450
+ } catch {
451
+ }
452
+ });
453
+ }
454
+ const n = kt(t);
455
+ if (n)
456
+ for (let a = n.length - 1; a >= 0; --a) {
457
+ const l = n[a], u = l && l.name;
458
+ typeof u == "string" && Ce(t, l, u);
459
+ }
460
+ }, $ = function(t, e, n) {
461
+ if (!n)
462
+ try {
463
+ n = e.getAttributeNode(t);
464
+ } catch {
465
+ n = null;
466
+ }
467
+ dt(i.removed, {
468
+ attribute: n || null,
469
+ from: e
470
+ });
471
+ try {
472
+ n ? e.removeAttributeNode(n) : e.removeAttribute(t);
473
+ } catch {
474
+ try {
475
+ e.removeAttribute(t);
476
+ } catch {
477
+ }
478
+ }
479
+ if (t === "is")
480
+ if (Q || bt)
481
+ try {
482
+ z(e);
483
+ } catch {
484
+ }
485
+ else
486
+ try {
487
+ e.setAttribute(t, "");
488
+ } catch {
489
+ }
490
+ }, Mn = function(t) {
491
+ const e = kt(t);
492
+ if (e)
493
+ for (let n = e.length - 1; n >= 0; --n) {
494
+ const a = e[n], l = a && a.name;
495
+ typeof l != "string" || _[E(l)] || Ce(t, a, l);
496
+ }
497
+ }, wt = function(t) {
498
+ const e = [t];
499
+ for (; e.length > 0; ) {
500
+ const n = e.pop();
501
+ ct(n) === M.element && Mn(n);
502
+ const l = q(n);
503
+ if (l)
504
+ for (let u = l.length - 1; u >= 0; --u)
505
+ e.push(l[u]);
506
+ }
507
+ }, Pe = function(t, e) {
508
+ return Y ? t === "patchsrc" ? !0 : t === "for" && e !== "label" && e !== "output" : !1;
509
+ }, Cn = function(t) {
510
+ if (!Y)
511
+ return;
512
+ const e = [t];
513
+ for (; e.length > 0; ) {
514
+ const n = e.pop(), a = ct(n);
515
+ if (a === M.processingInstruction || a === M.comment && O(en, n.data)) {
516
+ try {
517
+ vt(n);
518
+ } catch {
519
+ }
520
+ continue;
521
+ }
522
+ if (a === M.element) {
523
+ const u = n, m = E(Ut(n));
524
+ try {
525
+ u.hasAttribute && u.hasAttribute("patchsrc") && u.removeAttribute("patchsrc"), u.hasAttribute && u.hasAttribute("for") && Pe("for", m) && u.removeAttribute("for");
526
+ } catch {
527
+ }
528
+ }
529
+ const l = q(n);
530
+ if (l)
531
+ for (let u = l.length - 1; u >= 0; --u)
532
+ e.push(l[u]);
533
+ }
534
+ }, xe = function(t) {
535
+ let e = null, n = null;
536
+ if (Yt)
537
+ t = "<remove></remove>" + t;
538
+ else {
539
+ const u = je(t, /^[\r\n\t ]+/);
540
+ n = u && u[0];
541
+ }
542
+ pt === "application/xhtml+xml" && nt === v && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
543
+ const a = L ? J(t) : t;
544
+ if (nt === v)
545
+ try {
546
+ e = new xt().parseFromString(a, pt);
547
+ } catch {
548
+ }
549
+ if (!e || !e.documentElement) {
550
+ e = zt.createDocument(nt, "template", null);
551
+ try {
552
+ e.documentElement.innerHTML = Xt ? B : a;
553
+ } catch {
554
+ }
555
+ }
556
+ const l = e.body || e.documentElement;
557
+ return t && n && l.insertBefore(s.createTextNode(n), l.childNodes[0] || null), nt === v ? mn.call(e, j ? "html" : "body")[0] : j ? e.documentElement : l;
558
+ }, ve = function(t) {
559
+ const e = Et ? Et(t) : t.ownerDocument;
560
+ return pe.call(
561
+ e || t,
562
+ t,
563
+ // eslint-disable-next-line no-bitwise
564
+ N.SHOW_ELEMENT | N.SHOW_COMMENT | N.SHOW_TEXT | N.SHOW_PROCESSING_INSTRUCTION | N.SHOW_CDATA_SECTION,
565
+ null
566
+ );
567
+ }, It = function(t) {
568
+ return t = Tt(t, Tn, " "), t = Tt(t, hn, " "), t = Tt(t, _n, " "), t;
569
+ }, Jt = function(t) {
570
+ var e;
571
+ t.normalize();
572
+ const n = Et ? Et(t) : t.ownerDocument, a = pe.call(
573
+ n || t,
574
+ t,
575
+ // eslint-disable-next-line no-bitwise
576
+ N.SHOW_TEXT | N.SHOW_COMMENT | N.SHOW_CDATA_SECTION | N.SHOW_PROCESSING_INSTRUCTION,
577
+ null
578
+ );
579
+ let l = a.nextNode();
580
+ for (; l; )
581
+ l.data = It(l.data), l = a.nextNode();
582
+ const u = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
583
+ u && V(u, (m) => {
584
+ rt(m.content) && Jt(m.content);
585
+ });
586
+ }, Nt = function(t) {
587
+ const e = Z ? Z(t) : null;
588
+ return typeof e != "string" || E(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
589
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
590
+ // makes the direct read diverge from the cached read; a clean form
591
+ // (same-realm OR foreign-realm) has both reads pointing at the same
592
+ // canonical NamedNodeMap.
593
+ t.attributes !== kt(t) || typeof t.removeAttribute != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
594
+ // returns the integer 1 for any Element regardless of realm; direct
595
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
596
+ // the named child element. Cheap addition — nodeType is read from
597
+ // an internal slot, no serialization cost — and removes a residual
598
+ // clobbering surface used by several mXSS / PI / comment branches
599
+ // in _sanitizeElements that compare currentNode.nodeType directly.
600
+ t.nodeType !== W(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
601
+ // "childNodes" shadows the prototype getter. Direct reads of
602
+ // form.childNodes from a clobbered form return the named child
603
+ // instead of the real NodeList, so any walk that reads it directly
604
+ // skips the form's real children. Compare the direct read to the
605
+ // cached Node.prototype getter — when the form's named-property
606
+ // getter intercepts the read, the two values differ and we flag
607
+ // the form. This catches every clobbering child type (input,
608
+ // select, etc.) regardless of whether the named child happens to
609
+ // carry a numeric .length, which a typeof-based probe would miss
610
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
611
+ t.childNodes !== q(t);
612
+ }, rt = function(t) {
613
+ if (!W || typeof t != "object" || t === null)
614
+ return !1;
615
+ try {
616
+ return W(t) === M.documentFragment;
617
+ } catch {
618
+ return !1;
619
+ }
620
+ }, mt = function(t) {
621
+ if (!W || typeof t != "object" || t === null)
622
+ return !1;
623
+ try {
624
+ return typeof W(t) == "number";
625
+ } catch {
626
+ return !1;
627
+ }
628
+ };
629
+ function k(o, t, e) {
630
+ o.length !== 0 && V(o, (n) => {
631
+ n.call(i, t, e, ot);
632
+ });
633
+ }
634
+ const Pn = function(t, e) {
635
+ return !!(Y && t.hasChildNodes() && !mt(t.firstElementChild) && O(tn, t.textContent) && O(tn, t.innerHTML) || Y && t.namespaceURI === v && To[e] && (mt(t.firstElementChild) || typeof t.textContent == "string" && O(ho[e], t.textContent)) || t.nodeType === M.processingInstruction || Y && t.nodeType === M.comment && O(en, t.data));
636
+ }, Mt = function(t, e) {
637
+ if (t instanceof RegExp)
638
+ return O(t, e);
639
+ if (t instanceof Function) {
640
+ for (var n = arguments.length, a = new Array(n > 2 ? n - 2 : 0), l = 2; l < n; l++)
641
+ a[l - 2] = arguments[l];
642
+ return !!t(e, ...a);
643
+ }
644
+ return !1;
645
+ }, xn = function(t, e, n) {
646
+ if (!ft[e] && He(e) && Mt(x.tagNameCheck, e))
647
+ return !1;
648
+ if (jt && !et[e]) {
649
+ const a = K(t), l = q(t);
650
+ if (l && a) {
651
+ const u = l.length;
652
+ for (let m = u - 1; m >= 0; --m) {
653
+ const g = t === n ? ln(l[m], !0) : l[m];
654
+ a.insertBefore(g, cn(t));
655
+ }
656
+ }
657
+ }
658
+ return z(t), !0;
659
+ }, ke = function(t, e, n, a) {
660
+ return t.length === 0 ? e : e === n || e === a ? C(e) : e;
661
+ }, Ue = function(t, e) {
662
+ return t === e || K(t) !== null ? !1 : ($t && wt(t), !0);
663
+ }, Fe = function(t, e) {
664
+ if (k(T.beforeSanitizeElements, t, null), Ue(t, e))
665
+ return !0;
666
+ if (Nt(t))
667
+ return z(t), !0;
668
+ const n = E(Ut(t));
669
+ if (h = ke(T.uponSanitizeElement, h, Ht, yt), k(T.uponSanitizeElement, t, {
670
+ tagName: n,
671
+ allowedTags: h
672
+ }), Ue(t, e))
673
+ return !0;
674
+ if (Pn(t, n))
675
+ return z(t), !0;
676
+ if (ft[n] || !(U.tagCheck instanceof Function && U.tagCheck(n)) && !h[n]) {
677
+ const l = xn(t, n, e);
678
+ return l === !1 && k(T.afterSanitizeElements, t, null), l;
679
+ }
680
+ if (ct(t) === M.element && !Nn(t) || (n === "noscript" || n === "noembed" || n === "noframes") && O(po, t.innerHTML))
681
+ return z(t), !0;
682
+ if (F && t.nodeType === M.text) {
683
+ const l = It(t.textContent);
684
+ t.textContent !== l && (dt(i.removed, {
685
+ element: t.cloneNode()
686
+ }), t.textContent = l);
687
+ }
688
+ return k(T.afterSanitizeElements, t, null), !1;
689
+ }, ze = function(t, e, n) {
690
+ if (Te[e] || Pe(e, t) || Ee && (e === "id" || e === "name") && (n in s || n in Ln))
691
+ return !1;
692
+ const a = _[e] || U.attributeCheck instanceof Function && U.attributeCheck(e, t);
693
+ return Wt && O(gn, e) || he && O(En, e) ? !0 : a ? Re[e] || O(de, Tt(n, me, "")) || (e === "src" || e === "xlink:href" || e === "href") && t !== "script" && $e(n, "data:") === 0 && be[t] || _e && !O(An, Tt(n, me, "")) ? !0 : !n : (
694
+ // Condition a) covers a basically valid custom element tag name whose
695
+ // tag passes the configured tagNameCheck and whose attribute name
696
+ // passes the configured attributeNameCheck ...
697
+ He(t) && Mt(x.tagNameCheck, t) && Mt(x.attributeNameCheck, e, t) || // Condition b) covers an `is` attribute whose value passes the
698
+ // configured tagNameCheck while customized built-in elements are
699
+ // allowed.
700
+ e === "is" && x.allowCustomizedBuiltInElements && Mt(x.tagNameCheck, n)
701
+ );
702
+ }, vn = p({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), He = function(t) {
703
+ return !vn[_t(t)] && O(yn, t);
704
+ }, kn = function(t, e, n, a) {
705
+ if (L && typeof gt == "object" && typeof gt.getAttributeType == "function" && !n)
706
+ switch (gt.getAttributeType(t, e)) {
707
+ case "TrustedHTML":
708
+ return J(a);
709
+ case "TrustedScriptURL":
710
+ return un(a);
711
+ }
712
+ return a;
713
+ }, Un = function(t, e, n, a) {
714
+ try {
715
+ n ? t.setAttributeNS(n, e, a) : t.setAttribute(e, a), Nt(t) ? z(t) : Ye(i.removed);
716
+ } catch {
717
+ $(e, t);
718
+ }
719
+ }, Ge = function(t) {
720
+ k(T.beforeSanitizeAttributes, t, null);
721
+ const e = t.attributes;
722
+ if (!e || Nt(t))
723
+ return;
724
+ _ = ke(T.uponSanitizeAttribute, _, Gt, St);
725
+ const n = {
726
+ attrName: "",
727
+ attrValue: "",
728
+ keepAttr: !0,
729
+ allowedAttributes: _,
730
+ forceKeepAttr: void 0
731
+ };
732
+ let a = e.length;
733
+ const l = E(t.nodeName);
734
+ for (; a--; ) {
735
+ const u = e[a], m = u.name, g = u.namespaceURI, D = u.value, w = E(m), te = D;
736
+ let R = m === "value" ? te : Vn(te);
737
+ if (n.attrName = w, n.attrValue = R, n.keepAttr = !0, n.forceKeepAttr = void 0, k(T.uponSanitizeAttribute, t, n), R = n.attrValue, Ae && (w === "id" || w === "name") && $e(R, ye) !== 0 && ($(m, t, u), R = ye + R), Y && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
738
+ $(m, t, u);
739
+ continue;
740
+ }
741
+ if (w === "attributename" && je(R, "href")) {
742
+ $(m, t, u);
743
+ continue;
744
+ }
745
+ if (!n.forceKeepAttr) {
746
+ if (!n.keepAttr) {
747
+ $(m, t, u);
748
+ continue;
749
+ }
750
+ if (!ge && O(mo, R)) {
751
+ $(m, t, u);
752
+ continue;
753
+ }
754
+ if (F && (R = It(R)), !ze(l, w, R)) {
755
+ $(m, t, u);
756
+ continue;
757
+ }
758
+ R = kn(l, w, g, R), R !== te && Un(t, m, g, R);
759
+ }
760
+ }
761
+ k(T.afterSanitizeAttributes, t, null);
762
+ }, Ct = function(t) {
763
+ let e = null;
764
+ const n = ve(t);
765
+ for (k(T.beforeSanitizeShadowDOM, t, null); e = n.nextNode(); )
766
+ if (k(T.uponSanitizeShadowNode, e, null), Fe(e, t), Ge(e), rt(e.content) && Ct(e.content), ct(e) === M.element) {
767
+ const a = ce(e);
768
+ rt(a) && (Qt(a), Ct(a));
769
+ }
770
+ k(T.afterSanitizeShadowDOM, t, null);
771
+ }, Qt = function(t) {
772
+ const e = [{
773
+ node: t,
774
+ shadow: null
775
+ }];
776
+ for (; e.length > 0; ) {
777
+ const n = e.pop();
778
+ if (n.shadow) {
779
+ Ct(n.shadow);
780
+ continue;
781
+ }
782
+ const a = n.node, u = ct(a) === M.element, m = q(a);
783
+ if (m)
784
+ for (let g = m.length - 1; g >= 0; --g)
785
+ e.push({
786
+ node: m[g],
787
+ shadow: null
788
+ });
789
+ if (u) {
790
+ const g = Z ? Z(a) : null;
791
+ if (typeof g == "string" && E(g) === "template") {
792
+ const D = a.content;
793
+ rt(D) && e.push({
794
+ node: D,
795
+ shadow: null
796
+ });
797
+ }
798
+ }
799
+ if (u) {
800
+ const g = ce(a);
801
+ rt(g) && e.push({
802
+ node: null,
803
+ shadow: g
804
+ }, {
805
+ node: g,
806
+ shadow: null
807
+ });
808
+ }
809
+ }
810
+ };
811
+ return i.sanitize = function(o) {
812
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, n = null, a = null, l = null;
813
+ if (Xt = !o, Xt && (o = "<!-->"), typeof o != "string" && !mt(o) && (o = Qn(o), typeof o != "string"))
814
+ throw X("dirty is not a string, aborting");
815
+ if (!i.isSupported)
816
+ return o;
817
+ Bt ? (h = yt, _ = St) : Zt(t), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (h = C(h)), T.uponSanitizeAttribute.length > 0 && (_ = C(_)), i.removed = [];
818
+ const u = $t && typeof o != "string" && mt(o);
819
+ if (u) {
820
+ Cn(o);
821
+ const D = Ut(o);
822
+ if (typeof D == "string") {
823
+ const w = E(D);
824
+ if (!h[w] || ft[w])
825
+ throw Dt(o), X("root node is forbidden and cannot be sanitized in-place");
826
+ }
827
+ if (Nt(o))
828
+ throw Dt(o), X("root node is clobbered and cannot be sanitized in-place");
829
+ try {
830
+ Qt(o);
831
+ } catch (w) {
832
+ throw Dt(o), w;
833
+ }
834
+ } else if (mt(o))
835
+ e = xe("<!---->"), n = e.ownerDocument.importNode(o, !0), n.nodeType === M.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? e = n : e.appendChild(n), Qt(n);
836
+ else {
837
+ if (!Q && !F && !j && // eslint-disable-next-line unicorn/prefer-includes
838
+ o.indexOf("<") === -1)
839
+ return L && Ot ? J(o) : o;
840
+ if (e = xe(o), !e)
841
+ return Q ? null : Ot ? B : "";
842
+ }
843
+ e && Yt && z(e.firstChild);
844
+ const m = u ? o : e;
845
+ try {
846
+ const D = ve(m);
847
+ for (; a = D.nextNode(); )
848
+ Fe(a, m), Ge(a), rt(a.content) && Ct(a.content);
849
+ } catch (D) {
850
+ throw u && (Dt(o), V(i.removed, (w) => {
851
+ w.element && wt(w.element);
852
+ })), D;
853
+ }
854
+ if (u)
855
+ return V(i.removed, (D) => {
856
+ D.element && wt(D.element);
857
+ }), F && Jt(o), o;
858
+ if (Q) {
859
+ if (F && Jt(e), bt)
860
+ for (l = pn.call(e.ownerDocument); e.firstChild; )
861
+ l.appendChild(e.firstChild);
862
+ else
863
+ l = e;
864
+ return (_.shadowroot || _.shadowrootmode) && (l = dn.call(c, l, !0)), l;
865
+ }
866
+ let g = j ? e.outerHTML : e.innerHTML;
867
+ return j && h["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && O(uo, e.ownerDocument.doctype.name) && (g = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
868
+ ` + g), F && (g = It(g)), L && Ot ? J(g) : g;
869
+ }, i.setConfig = function() {
870
+ let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
871
+ Zt(o), Bt = !0, yt = h, St = _;
872
+ }, i.clearConfig = function() {
873
+ ot = null, Bt = !1, yt = null, St = null, L = Ft, B = "";
874
+ }, i.isValidAttribute = function(o, t, e) {
875
+ ot || Zt({});
876
+ const n = E(o), a = E(t);
877
+ return ze(n, a, e);
878
+ }, i.addHook = function(o, t) {
879
+ typeof t == "function" && I(T, o) && dt(T[o], t);
880
+ }, i.removeHook = function(o, t) {
881
+ if (I(T, o)) {
882
+ if (t !== void 0) {
883
+ const e = $n(T[o], t);
884
+ return e === -1 ? void 0 : Xn(T[o], e, 1)[0];
885
+ }
886
+ return Ye(T[o]);
887
+ }
888
+ }, i.removeHooks = function(o) {
889
+ I(T, o) && (T[o] = []);
890
+ }, i.removeAllHooks = function() {
891
+ T = nn();
892
+ }, i;
893
+ }
894
+ var Eo = sn();
895
+ export {
896
+ Eo as default
897
+ };