@clubmed/usg-chat-ui 1.0.1 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/_commonjsHelpers.js +9 -0
- package/chunks/_commonjsHelpers.js.map +1 -0
- package/chunks/browser.js +579 -0
- package/chunks/browser.js.map +1 -0
- package/chunks/client.js +27323 -0
- package/chunks/client.js.map +1 -0
- package/chunks/index.js +59 -32
- package/chunks/index.js.map +1 -1
- package/chunks/index2.js +32 -59
- package/chunks/index2.js.map +1 -1
- package/chunks/index3.js +22 -740
- package/chunks/index3.js.map +1 -1
- package/chunks/index4.js +740 -22
- package/chunks/index4.js.map +1 -1
- package/chunks/index5.js +1 -1
- package/chunks/index6.js +144 -150
- package/chunks/index6.js.map +1 -1
- package/chunks/index7.js +14 -13
- package/chunks/index7.js.map +1 -1
- package/chunks/magic-string.es.js +664 -0
- package/chunks/magic-string.es.js.map +1 -0
- package/chunks/react.esm.js +10007 -0
- package/chunks/react.esm.js.map +1 -0
- package/chunks/{collaboration.js → useCollaboration.js} +536 -523
- package/chunks/useCollaboration.js.map +1 -0
- package/chunks/vi.2VT5v0um.js +10573 -0
- package/chunks/vi.2VT5v0um.js.map +1 -0
- package/contexts/ChatContext.d.ts +2 -1
- package/contexts/ChatContext.js +32 -30
- package/contexts/ChatContext.js.map +1 -1
- package/core/interfaces/ChatConfig.d.ts +4 -0
- package/core/interfaces/StoryVersion.d.ts +7 -2
- package/index.d.ts +1 -0
- package/molecules/AiElements/Message.js +1 -1
- package/molecules/AiElements/Response.js +15 -13
- package/molecules/AiElements/Response.js.map +1 -1
- package/molecules/AiElements/Sources.d.ts +2 -2
- package/molecules/AiElements/Sources.js.map +1 -1
- package/molecules/Buttons/Button.d.ts +1 -1
- package/molecules/Buttons/Button.js +2 -2
- package/molecules/{AiElements → CodeBlock}/CodeBlock.d.ts +5 -2
- package/molecules/CodeBlock/CodeBlock.js +128 -0
- package/molecules/CodeBlock/CodeBlock.js.map +1 -0
- package/molecules/CodeBlock/CodeBlock.test.d.ts +1 -0
- package/molecules/CodeBlock/CodeBlock.test.js +3158 -0
- package/molecules/CodeBlock/CodeBlock.test.js.map +1 -0
- package/molecules/CodeBlock/highlightCode.d.ts +2 -0
- package/molecules/CodeBlock/highlightCode.js +5850 -0
- package/molecules/CodeBlock/highlightCode.js.map +1 -0
- package/molecules/CodeBlock/highlightCode.test.d.ts +1 -0
- package/molecules/CodeBlock/highlightCode.test.js +47 -0
- package/molecules/CodeBlock/highlightCode.test.js.map +1 -0
- package/molecules/Collapsibles/Collapsible.js +1 -1
- package/molecules/Forms/InputGroups/InputGroup.js +1 -1
- package/molecules/Labels/Label.js +2 -2
- package/molecules/Notifications/{Sonner.js → Toaster.js} +2 -2
- package/molecules/Notifications/Toaster.js.map +1 -0
- package/molecules/Notifications/{use-toast.js → useToast.js} +1 -1
- package/molecules/Notifications/useToast.js.map +1 -0
- package/{organisms → molecules}/RichText/DynamicEditor.js.map +1 -1
- package/molecules/RichText/EditorWithAI.js +55854 -0
- package/molecules/RichText/EditorWithAI.js.map +1 -0
- package/molecules/RichText/useCollaboration.d.ts +9 -0
- package/molecules/RichText/useCollaboration.js +8 -0
- package/molecules/RichText/useCollaboration.js.map +1 -0
- package/molecules/RichText/useCollaboration.test.d.ts +1 -0
- package/molecules/RichText/useCollaboration.test.js +70 -0
- package/molecules/RichText/useCollaboration.test.js.map +1 -0
- package/molecules/Tabs/Tabs.js +1 -1
- package/organisms/canvas/ApiDocsCanvas.js +15 -15
- package/organisms/canvas/ApiDocsCanvas.js.map +1 -1
- package/organisms/canvas/ReleaseNoteCanvas.js +2 -2
- package/organisms/canvas/ReleaseNoteCanvas.js.map +1 -1
- package/organisms/canvas/StoryCanvas.js +2 -2
- package/organisms/canvas/StoryCanvas.js.map +1 -1
- package/organisms/chat/MessageActions.js +1 -1
- package/organisms/chat/MessageActions.js.map +1 -1
- package/organisms/chat/hooks/useChat.js +1 -1
- package/organisms/chat/hooks/useChat.js.map +1 -1
- package/organisms/chat/hooks/useChatKeyboardsShortcuts.js +16 -33
- package/organisms/chat/hooks/useChatKeyboardsShortcuts.js.map +1 -1
- package/organisms/chat/hooks/useConversations.js +1 -1
- package/organisms/chat/hooks/useConversations.js.map +1 -1
- package/organisms/settings/SettingsModal.js +1 -1
- package/package.json +3 -4
- package/.npm/_logs/2026-01-19T16_54_30_380Z-debug-0.log +0 -19
- package/.npm/_logs/2026-01-19T16_54_30_467Z-debug-0.log +0 -19
- package/.npm/_logs/2026-01-19T16_54_30_553Z-debug-0.log +0 -14
- package/chunks/collaboration.js.map +0 -1
- package/core/collaboration.d.ts +0 -6
- package/core/collaboration.js +0 -5
- package/core/collaboration.js.map +0 -1
- package/molecules/AiElements/CodeBlock.js +0 -6525
- package/molecules/AiElements/CodeBlock.js.map +0 -1
- package/molecules/Notifications/Sonner.js.map +0 -1
- package/molecules/Notifications/use-toast.js.map +0 -1
- package/molecules/index.d.ts +0 -28
- package/molecules/index.js +0 -88
- package/molecules/index.js.map +0 -1
- package/organisms/RichText/EditorWithAI.js +0 -83167
- package/organisms/RichText/EditorWithAI.js.map +0 -1
- /package/molecules/Notifications/{Sonner.d.ts → Toaster.d.ts} +0 -0
- /package/molecules/Notifications/{use-toast.d.ts → useToast.d.ts} +0 -0
- /package/{organisms → molecules}/RichText/DynamicEditor.d.ts +0 -0
- /package/{organisms → molecules}/RichText/DynamicEditor.js +0 -0
- /package/{organisms → molecules}/RichText/EditorWithAI.d.ts +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function l(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
o as c,
|
|
7
|
+
l as g
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=_commonjsHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import { g as En } from "./_commonjsHelpers.js";
|
|
2
|
+
function gn(U, X) {
|
|
3
|
+
for (var V = 0; V < X.length; V++) {
|
|
4
|
+
const x = X[V];
|
|
5
|
+
if (typeof x != "string" && !Array.isArray(x)) {
|
|
6
|
+
for (const P in x)
|
|
7
|
+
if (P !== "default" && !(P in U)) {
|
|
8
|
+
const p = Object.getOwnPropertyDescriptor(x, P);
|
|
9
|
+
p && Object.defineProperty(U, P, p.get ? p : {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: () => x[P]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return Object.freeze(Object.defineProperty(U, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
}
|
|
18
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
19
|
+
var Be, bt;
|
|
20
|
+
function Dt() {
|
|
21
|
+
if (bt) return Be;
|
|
22
|
+
bt = 1;
|
|
23
|
+
const {
|
|
24
|
+
entries: U,
|
|
25
|
+
setPrototypeOf: X,
|
|
26
|
+
isFrozen: V,
|
|
27
|
+
getPrototypeOf: x,
|
|
28
|
+
getOwnPropertyDescriptor: P
|
|
29
|
+
} = Object;
|
|
30
|
+
let {
|
|
31
|
+
freeze: p,
|
|
32
|
+
seal: b,
|
|
33
|
+
create: Ee
|
|
34
|
+
} = Object, {
|
|
35
|
+
apply: ge,
|
|
36
|
+
construct: Ae
|
|
37
|
+
} = typeof Reflect < "u" && Reflect;
|
|
38
|
+
p || (p = function(o) {
|
|
39
|
+
return o;
|
|
40
|
+
}), b || (b = function(o) {
|
|
41
|
+
return o;
|
|
42
|
+
}), ge || (ge = function(o, l) {
|
|
43
|
+
for (var r = arguments.length, c = new Array(r > 2 ? r - 2 : 0), O = 2; O < r; O++)
|
|
44
|
+
c[O - 2] = arguments[O];
|
|
45
|
+
return o.apply(l, c);
|
|
46
|
+
}), Ae || (Ae = function(o) {
|
|
47
|
+
for (var l = arguments.length, r = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++)
|
|
48
|
+
r[c - 1] = arguments[c];
|
|
49
|
+
return new o(...r);
|
|
50
|
+
});
|
|
51
|
+
const re = h(Array.prototype.forEach), Nt = h(Array.prototype.lastIndexOf), Ye = h(Array.prototype.pop), $ = h(Array.prototype.push), It = h(Array.prototype.splice), ae = h(String.prototype.toLowerCase), he = h(String.prototype.toString), Se = h(String.prototype.match), q = h(String.prototype.replace), Ct = h(String.prototype.indexOf), Mt = h(String.prototype.trim), D = h(Object.prototype.hasOwnProperty), A = h(RegExp.prototype.test), K = wt(TypeError);
|
|
52
|
+
function h(s) {
|
|
53
|
+
return function(o) {
|
|
54
|
+
o instanceof RegExp && (o.lastIndex = 0);
|
|
55
|
+
for (var l = arguments.length, r = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++)
|
|
56
|
+
r[c - 1] = arguments[c];
|
|
57
|
+
return ge(s, o, r);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function wt(s) {
|
|
61
|
+
return function() {
|
|
62
|
+
for (var o = arguments.length, l = new Array(o), r = 0; r < o; r++)
|
|
63
|
+
l[r] = arguments[r];
|
|
64
|
+
return Ae(s, l);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function a(s, o) {
|
|
68
|
+
let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ae;
|
|
69
|
+
X && X(s, null);
|
|
70
|
+
let r = o.length;
|
|
71
|
+
for (; r--; ) {
|
|
72
|
+
let c = o[r];
|
|
73
|
+
if (typeof c == "string") {
|
|
74
|
+
const O = l(c);
|
|
75
|
+
O !== c && (V(o) || (o[r] = O), c = O);
|
|
76
|
+
}
|
|
77
|
+
s[c] = !0;
|
|
78
|
+
}
|
|
79
|
+
return s;
|
|
80
|
+
}
|
|
81
|
+
function xt(s) {
|
|
82
|
+
for (let o = 0; o < s.length; o++)
|
|
83
|
+
D(s, o) || (s[o] = null);
|
|
84
|
+
return s;
|
|
85
|
+
}
|
|
86
|
+
function L(s) {
|
|
87
|
+
const o = Ee(null);
|
|
88
|
+
for (const [l, r] of U(s))
|
|
89
|
+
D(s, l) && (Array.isArray(r) ? o[l] = xt(r) : r && typeof r == "object" && r.constructor === Object ? o[l] = L(r) : o[l] = r);
|
|
90
|
+
return o;
|
|
91
|
+
}
|
|
92
|
+
function Z(s, o) {
|
|
93
|
+
for (; s !== null; ) {
|
|
94
|
+
const r = P(s, o);
|
|
95
|
+
if (r) {
|
|
96
|
+
if (r.get)
|
|
97
|
+
return h(r.get);
|
|
98
|
+
if (typeof r.value == "function")
|
|
99
|
+
return h(r.value);
|
|
100
|
+
}
|
|
101
|
+
s = x(s);
|
|
102
|
+
}
|
|
103
|
+
function l() {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return l;
|
|
107
|
+
}
|
|
108
|
+
const je = p(["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"]), Re = p(["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 = p(["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"]), Pt = p(["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"]), ye = p(["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"]), vt = p(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Xe = p(["#text"]), Ve = p(["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"]), be = p(["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"]), $e = p(["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"]), se = p(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), kt = b(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ut = b(/<%[\w\W]*|[\w\W]*%>/gm), Ft = b(/\$\{[\w\W]*/gm), Ht = b(/^data-[\-\w.\u00B7-\uFFFF]+$/), zt = b(/^aria-[\-\w]+$/), qe = b(
|
|
109
|
+
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
110
|
+
// eslint-disable-line no-useless-escape
|
|
111
|
+
), Gt = b(/^(?:\w+script|data):/i), Wt = b(
|
|
112
|
+
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
113
|
+
// eslint-disable-line no-control-regex
|
|
114
|
+
), Ke = b(/^html$/i), Bt = b(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
115
|
+
var Ze = /* @__PURE__ */ Object.freeze({
|
|
116
|
+
__proto__: null,
|
|
117
|
+
ARIA_ATTR: zt,
|
|
118
|
+
ATTR_WHITESPACE: Wt,
|
|
119
|
+
CUSTOM_ELEMENT: Bt,
|
|
120
|
+
DATA_ATTR: Ht,
|
|
121
|
+
DOCTYPE_NAME: Ke,
|
|
122
|
+
ERB_EXPR: Ut,
|
|
123
|
+
IS_ALLOWED_URI: qe,
|
|
124
|
+
IS_SCRIPT_OR_DATA: Gt,
|
|
125
|
+
MUSTACHE_EXPR: kt,
|
|
126
|
+
TMPLIT_EXPR: Ft
|
|
127
|
+
});
|
|
128
|
+
const J = {
|
|
129
|
+
element: 1,
|
|
130
|
+
text: 3,
|
|
131
|
+
// Deprecated
|
|
132
|
+
progressingInstruction: 7,
|
|
133
|
+
comment: 8,
|
|
134
|
+
document: 9
|
|
135
|
+
}, Yt = function() {
|
|
136
|
+
return typeof window > "u" ? null : window;
|
|
137
|
+
}, jt = function(o, l) {
|
|
138
|
+
if (typeof o != "object" || typeof o.createPolicy != "function")
|
|
139
|
+
return null;
|
|
140
|
+
let r = null;
|
|
141
|
+
const c = "data-tt-policy-suffix";
|
|
142
|
+
l && l.hasAttribute(c) && (r = l.getAttribute(c));
|
|
143
|
+
const O = "dompurify" + (r ? "#" + r : "");
|
|
144
|
+
try {
|
|
145
|
+
return o.createPolicy(O, {
|
|
146
|
+
createHTML(F) {
|
|
147
|
+
return F;
|
|
148
|
+
},
|
|
149
|
+
createScriptURL(F) {
|
|
150
|
+
return F;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
} catch {
|
|
154
|
+
return console.warn("TrustedTypes policy " + O + " could not be created."), null;
|
|
155
|
+
}
|
|
156
|
+
}, Je = function() {
|
|
157
|
+
return {
|
|
158
|
+
afterSanitizeAttributes: [],
|
|
159
|
+
afterSanitizeElements: [],
|
|
160
|
+
afterSanitizeShadowDOM: [],
|
|
161
|
+
beforeSanitizeAttributes: [],
|
|
162
|
+
beforeSanitizeElements: [],
|
|
163
|
+
beforeSanitizeShadowDOM: [],
|
|
164
|
+
uponSanitizeAttribute: [],
|
|
165
|
+
uponSanitizeElement: [],
|
|
166
|
+
uponSanitizeShadowNode: []
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
function Qe() {
|
|
170
|
+
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Yt();
|
|
171
|
+
const o = (i) => Qe(i);
|
|
172
|
+
if (o.version = "3.3.1", o.removed = [], !s || !s.document || s.document.nodeType !== J.document || !s.Element)
|
|
173
|
+
return o.isSupported = !1, o;
|
|
174
|
+
let {
|
|
175
|
+
document: l
|
|
176
|
+
} = s;
|
|
177
|
+
const r = l, c = r.currentScript, {
|
|
178
|
+
DocumentFragment: O,
|
|
179
|
+
HTMLTemplateElement: F,
|
|
180
|
+
Node: De,
|
|
181
|
+
Element: et,
|
|
182
|
+
NodeFilter: Q,
|
|
183
|
+
NamedNodeMap: Vt = s.NamedNodeMap || s.MozNamedAttrMap,
|
|
184
|
+
HTMLFormElement: $t,
|
|
185
|
+
DOMParser: qt,
|
|
186
|
+
trustedTypes: le
|
|
187
|
+
} = s, ee = et.prototype, Kt = Z(ee, "cloneNode"), Zt = Z(ee, "remove"), Jt = Z(ee, "nextSibling"), Qt = Z(ee, "childNodes"), ce = Z(ee, "parentNode");
|
|
188
|
+
if (typeof F == "function") {
|
|
189
|
+
const i = l.createElement("template");
|
|
190
|
+
i.content && i.content.ownerDocument && (l = i.content.ownerDocument);
|
|
191
|
+
}
|
|
192
|
+
let S, te = "";
|
|
193
|
+
const {
|
|
194
|
+
implementation: Le,
|
|
195
|
+
createNodeIterator: en,
|
|
196
|
+
createDocumentFragment: tn,
|
|
197
|
+
getElementsByTagName: nn
|
|
198
|
+
} = l, {
|
|
199
|
+
importNode: on
|
|
200
|
+
} = r;
|
|
201
|
+
let R = Je();
|
|
202
|
+
o.isSupported = typeof U == "function" && typeof ce == "function" && Le && Le.createHTMLDocument !== void 0;
|
|
203
|
+
const {
|
|
204
|
+
MUSTACHE_EXPR: Ne,
|
|
205
|
+
ERB_EXPR: Ie,
|
|
206
|
+
TMPLIT_EXPR: Ce,
|
|
207
|
+
DATA_ATTR: rn,
|
|
208
|
+
ARIA_ATTR: an,
|
|
209
|
+
IS_SCRIPT_OR_DATA: sn,
|
|
210
|
+
ATTR_WHITESPACE: tt,
|
|
211
|
+
CUSTOM_ELEMENT: ln
|
|
212
|
+
} = Ze;
|
|
213
|
+
let {
|
|
214
|
+
IS_ALLOWED_URI: nt
|
|
215
|
+
} = Ze, T = null;
|
|
216
|
+
const ot = a({}, [...je, ...Re, ...Oe, ...ye, ...Xe]);
|
|
217
|
+
let _ = null;
|
|
218
|
+
const it = a({}, [...Ve, ...be, ...$e, ...se]);
|
|
219
|
+
let u = Object.seal(Ee(null, {
|
|
220
|
+
tagNameCheck: {
|
|
221
|
+
writable: !0,
|
|
222
|
+
configurable: !1,
|
|
223
|
+
enumerable: !0,
|
|
224
|
+
value: null
|
|
225
|
+
},
|
|
226
|
+
attributeNameCheck: {
|
|
227
|
+
writable: !0,
|
|
228
|
+
configurable: !1,
|
|
229
|
+
enumerable: !0,
|
|
230
|
+
value: null
|
|
231
|
+
},
|
|
232
|
+
allowCustomizedBuiltInElements: {
|
|
233
|
+
writable: !0,
|
|
234
|
+
configurable: !1,
|
|
235
|
+
enumerable: !0,
|
|
236
|
+
value: !1
|
|
237
|
+
}
|
|
238
|
+
})), ne = null, Me = null;
|
|
239
|
+
const H = Object.seal(Ee(null, {
|
|
240
|
+
tagCheck: {
|
|
241
|
+
writable: !0,
|
|
242
|
+
configurable: !1,
|
|
243
|
+
enumerable: !0,
|
|
244
|
+
value: null
|
|
245
|
+
},
|
|
246
|
+
attributeCheck: {
|
|
247
|
+
writable: !0,
|
|
248
|
+
configurable: !1,
|
|
249
|
+
enumerable: !0,
|
|
250
|
+
value: null
|
|
251
|
+
}
|
|
252
|
+
}));
|
|
253
|
+
let rt = !0, we = !0, at = !1, st = !0, z = !1, fe = !0, v = !1, xe = !1, Pe = !1, G = !1, ue = !1, me = !1, lt = !0, ct = !1;
|
|
254
|
+
const cn = "user-content-";
|
|
255
|
+
let ve = !0, oe = !1, W = {}, N = null;
|
|
256
|
+
const ke = a({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
257
|
+
let ft = null;
|
|
258
|
+
const ut = a({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
259
|
+
let Ue = null;
|
|
260
|
+
const mt = a({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), pe = "http://www.w3.org/1998/Math/MathML", de = "http://www.w3.org/2000/svg", C = "http://www.w3.org/1999/xhtml";
|
|
261
|
+
let B = C, Fe = !1, He = null;
|
|
262
|
+
const fn = a({}, [pe, de, C], he);
|
|
263
|
+
let Te = a({}, ["mi", "mo", "mn", "ms", "mtext"]), _e = a({}, ["annotation-xml"]);
|
|
264
|
+
const un = a({}, ["title", "style", "font", "a", "script"]);
|
|
265
|
+
let ie = null;
|
|
266
|
+
const mn = ["application/xhtml+xml", "text/html"], pn = "text/html";
|
|
267
|
+
let d = null, Y = null;
|
|
268
|
+
const dn = l.createElement("form"), pt = function(e) {
|
|
269
|
+
return e instanceof RegExp || e instanceof Function;
|
|
270
|
+
}, ze = function() {
|
|
271
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
272
|
+
if (!(Y && Y === e)) {
|
|
273
|
+
if ((!e || typeof e != "object") && (e = {}), e = L(e), ie = // eslint-disable-next-line unicorn/prefer-includes
|
|
274
|
+
mn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? pn : e.PARSER_MEDIA_TYPE, d = ie === "application/xhtml+xml" ? he : ae, T = D(e, "ALLOWED_TAGS") ? a({}, e.ALLOWED_TAGS, d) : ot, _ = D(e, "ALLOWED_ATTR") ? a({}, e.ALLOWED_ATTR, d) : it, He = D(e, "ALLOWED_NAMESPACES") ? a({}, e.ALLOWED_NAMESPACES, he) : fn, Ue = D(e, "ADD_URI_SAFE_ATTR") ? a(L(mt), e.ADD_URI_SAFE_ATTR, d) : mt, ft = D(e, "ADD_DATA_URI_TAGS") ? a(L(ut), e.ADD_DATA_URI_TAGS, d) : ut, N = D(e, "FORBID_CONTENTS") ? a({}, e.FORBID_CONTENTS, d) : ke, ne = D(e, "FORBID_TAGS") ? a({}, e.FORBID_TAGS, d) : L({}), Me = D(e, "FORBID_ATTR") ? a({}, e.FORBID_ATTR, d) : L({}), W = D(e, "USE_PROFILES") ? e.USE_PROFILES : !1, rt = e.ALLOW_ARIA_ATTR !== !1, we = e.ALLOW_DATA_ATTR !== !1, at = e.ALLOW_UNKNOWN_PROTOCOLS || !1, st = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, z = e.SAFE_FOR_TEMPLATES || !1, fe = e.SAFE_FOR_XML !== !1, v = e.WHOLE_DOCUMENT || !1, G = e.RETURN_DOM || !1, ue = e.RETURN_DOM_FRAGMENT || !1, me = e.RETURN_TRUSTED_TYPE || !1, Pe = e.FORCE_BODY || !1, lt = e.SANITIZE_DOM !== !1, ct = e.SANITIZE_NAMED_PROPS || !1, ve = e.KEEP_CONTENT !== !1, oe = e.IN_PLACE || !1, nt = e.ALLOWED_URI_REGEXP || qe, B = e.NAMESPACE || C, Te = e.MATHML_TEXT_INTEGRATION_POINTS || Te, _e = e.HTML_INTEGRATION_POINTS || _e, u = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && pt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (u.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && pt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (u.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (u.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), z && (we = !1), ue && (G = !0), W && (T = a({}, Xe), _ = [], W.html === !0 && (a(T, je), a(_, Ve)), W.svg === !0 && (a(T, Re), a(_, be), a(_, se)), W.svgFilters === !0 && (a(T, Oe), a(_, be), a(_, se)), W.mathMl === !0 && (a(T, ye), a(_, $e), a(_, se))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? H.tagCheck = e.ADD_TAGS : (T === ot && (T = L(T)), a(T, e.ADD_TAGS, d))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? H.attributeCheck = e.ADD_ATTR : (_ === it && (_ = L(_)), a(_, e.ADD_ATTR, d))), e.ADD_URI_SAFE_ATTR && a(Ue, e.ADD_URI_SAFE_ATTR, d), e.FORBID_CONTENTS && (N === ke && (N = L(N)), a(N, e.FORBID_CONTENTS, d)), e.ADD_FORBID_CONTENTS && (N === ke && (N = L(N)), a(N, e.ADD_FORBID_CONTENTS, d)), ve && (T["#text"] = !0), v && a(T, ["html", "head", "body"]), T.table && (a(T, ["tbody"]), delete ne.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
275
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
276
|
+
throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
277
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
278
|
+
throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
279
|
+
S = e.TRUSTED_TYPES_POLICY, te = S.createHTML("");
|
|
280
|
+
} else
|
|
281
|
+
S === void 0 && (S = jt(le, c)), S !== null && typeof te == "string" && (te = S.createHTML(""));
|
|
282
|
+
p && p(e), Y = e;
|
|
283
|
+
}
|
|
284
|
+
}, dt = a({}, [...Re, ...Oe, ...Pt]), Tt = a({}, [...ye, ...vt]), Tn = function(e) {
|
|
285
|
+
let t = ce(e);
|
|
286
|
+
(!t || !t.tagName) && (t = {
|
|
287
|
+
namespaceURI: B,
|
|
288
|
+
tagName: "template"
|
|
289
|
+
});
|
|
290
|
+
const n = ae(e.tagName), f = ae(t.tagName);
|
|
291
|
+
return He[e.namespaceURI] ? e.namespaceURI === de ? t.namespaceURI === C ? n === "svg" : t.namespaceURI === pe ? n === "svg" && (f === "annotation-xml" || Te[f]) : !!dt[n] : e.namespaceURI === pe ? t.namespaceURI === C ? n === "math" : t.namespaceURI === de ? n === "math" && _e[f] : !!Tt[n] : e.namespaceURI === C ? t.namespaceURI === de && !_e[f] || t.namespaceURI === pe && !Te[f] ? !1 : !Tt[n] && (un[n] || !dt[n]) : !!(ie === "application/xhtml+xml" && He[e.namespaceURI]) : !1;
|
|
292
|
+
}, I = function(e) {
|
|
293
|
+
$(o.removed, {
|
|
294
|
+
element: e
|
|
295
|
+
});
|
|
296
|
+
try {
|
|
297
|
+
ce(e).removeChild(e);
|
|
298
|
+
} catch {
|
|
299
|
+
Zt(e);
|
|
300
|
+
}
|
|
301
|
+
}, k = function(e, t) {
|
|
302
|
+
try {
|
|
303
|
+
$(o.removed, {
|
|
304
|
+
attribute: t.getAttributeNode(e),
|
|
305
|
+
from: t
|
|
306
|
+
});
|
|
307
|
+
} catch {
|
|
308
|
+
$(o.removed, {
|
|
309
|
+
attribute: null,
|
|
310
|
+
from: t
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
if (t.removeAttribute(e), e === "is")
|
|
314
|
+
if (G || ue)
|
|
315
|
+
try {
|
|
316
|
+
I(t);
|
|
317
|
+
} catch {
|
|
318
|
+
}
|
|
319
|
+
else
|
|
320
|
+
try {
|
|
321
|
+
t.setAttribute(e, "");
|
|
322
|
+
} catch {
|
|
323
|
+
}
|
|
324
|
+
}, _t = function(e) {
|
|
325
|
+
let t = null, n = null;
|
|
326
|
+
if (Pe)
|
|
327
|
+
e = "<remove></remove>" + e;
|
|
328
|
+
else {
|
|
329
|
+
const m = Se(e, /^[\r\n\t ]+/);
|
|
330
|
+
n = m && m[0];
|
|
331
|
+
}
|
|
332
|
+
ie === "application/xhtml+xml" && B === C && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
333
|
+
const f = S ? S.createHTML(e) : e;
|
|
334
|
+
if (B === C)
|
|
335
|
+
try {
|
|
336
|
+
t = new qt().parseFromString(f, ie);
|
|
337
|
+
} catch {
|
|
338
|
+
}
|
|
339
|
+
if (!t || !t.documentElement) {
|
|
340
|
+
t = Le.createDocument(B, "template", null);
|
|
341
|
+
try {
|
|
342
|
+
t.documentElement.innerHTML = Fe ? te : f;
|
|
343
|
+
} catch {
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const g = t.body || t.documentElement;
|
|
347
|
+
return e && n && g.insertBefore(l.createTextNode(n), g.childNodes[0] || null), B === C ? nn.call(t, v ? "html" : "body")[0] : v ? t.documentElement : g;
|
|
348
|
+
}, Et = function(e) {
|
|
349
|
+
return en.call(
|
|
350
|
+
e.ownerDocument || e,
|
|
351
|
+
e,
|
|
352
|
+
// eslint-disable-next-line no-bitwise
|
|
353
|
+
Q.SHOW_ELEMENT | Q.SHOW_COMMENT | Q.SHOW_TEXT | Q.SHOW_PROCESSING_INSTRUCTION | Q.SHOW_CDATA_SECTION,
|
|
354
|
+
null
|
|
355
|
+
);
|
|
356
|
+
}, Ge = function(e) {
|
|
357
|
+
return e instanceof $t && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof Vt) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
358
|
+
}, gt = function(e) {
|
|
359
|
+
return typeof De == "function" && e instanceof De;
|
|
360
|
+
};
|
|
361
|
+
function M(i, e, t) {
|
|
362
|
+
re(i, (n) => {
|
|
363
|
+
n.call(o, e, t, Y);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
const At = function(e) {
|
|
367
|
+
let t = null;
|
|
368
|
+
if (M(R.beforeSanitizeElements, e, null), Ge(e))
|
|
369
|
+
return I(e), !0;
|
|
370
|
+
const n = d(e.nodeName);
|
|
371
|
+
if (M(R.uponSanitizeElement, e, {
|
|
372
|
+
tagName: n,
|
|
373
|
+
allowedTags: T
|
|
374
|
+
}), fe && e.hasChildNodes() && !gt(e.firstElementChild) && A(/<[/\w!]/g, e.innerHTML) && A(/<[/\w!]/g, e.textContent) || e.nodeType === J.progressingInstruction || fe && e.nodeType === J.comment && A(/<[/\w]/g, e.data))
|
|
375
|
+
return I(e), !0;
|
|
376
|
+
if (!(H.tagCheck instanceof Function && H.tagCheck(n)) && (!T[n] || ne[n])) {
|
|
377
|
+
if (!ne[n] && St(n) && (u.tagNameCheck instanceof RegExp && A(u.tagNameCheck, n) || u.tagNameCheck instanceof Function && u.tagNameCheck(n)))
|
|
378
|
+
return !1;
|
|
379
|
+
if (ve && !N[n]) {
|
|
380
|
+
const f = ce(e) || e.parentNode, g = Qt(e) || e.childNodes;
|
|
381
|
+
if (g && f) {
|
|
382
|
+
const m = g.length;
|
|
383
|
+
for (let y = m - 1; y >= 0; --y) {
|
|
384
|
+
const w = Kt(g[y], !0);
|
|
385
|
+
w.__removalCount = (e.__removalCount || 0) + 1, f.insertBefore(w, Jt(e));
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return I(e), !0;
|
|
390
|
+
}
|
|
391
|
+
return e instanceof et && !Tn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && A(/<\/no(script|embed|frames)/i, e.innerHTML) ? (I(e), !0) : (z && e.nodeType === J.text && (t = e.textContent, re([Ne, Ie, Ce], (f) => {
|
|
392
|
+
t = q(t, f, " ");
|
|
393
|
+
}), e.textContent !== t && ($(o.removed, {
|
|
394
|
+
element: e.cloneNode()
|
|
395
|
+
}), e.textContent = t)), M(R.afterSanitizeElements, e, null), !1);
|
|
396
|
+
}, ht = function(e, t, n) {
|
|
397
|
+
if (lt && (t === "id" || t === "name") && (n in l || n in dn))
|
|
398
|
+
return !1;
|
|
399
|
+
if (!(we && !Me[t] && A(rn, t))) {
|
|
400
|
+
if (!(rt && A(an, t))) {
|
|
401
|
+
if (!(H.attributeCheck instanceof Function && H.attributeCheck(t, e))) {
|
|
402
|
+
if (!_[t] || Me[t]) {
|
|
403
|
+
if (
|
|
404
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
405
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
406
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
407
|
+
!(St(e) && (u.tagNameCheck instanceof RegExp && A(u.tagNameCheck, e) || u.tagNameCheck instanceof Function && u.tagNameCheck(e)) && (u.attributeNameCheck instanceof RegExp && A(u.attributeNameCheck, t) || u.attributeNameCheck instanceof Function && u.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
408
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
409
|
+
t === "is" && u.allowCustomizedBuiltInElements && (u.tagNameCheck instanceof RegExp && A(u.tagNameCheck, n) || u.tagNameCheck instanceof Function && u.tagNameCheck(n)))
|
|
410
|
+
) return !1;
|
|
411
|
+
} else if (!Ue[t]) {
|
|
412
|
+
if (!A(nt, q(n, tt, ""))) {
|
|
413
|
+
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Ct(n, "data:") === 0 && ft[e])) {
|
|
414
|
+
if (!(at && !A(sn, q(n, tt, "")))) {
|
|
415
|
+
if (n)
|
|
416
|
+
return !1;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return !0;
|
|
425
|
+
}, St = function(e) {
|
|
426
|
+
return e !== "annotation-xml" && Se(e, ln);
|
|
427
|
+
}, Rt = function(e) {
|
|
428
|
+
M(R.beforeSanitizeAttributes, e, null);
|
|
429
|
+
const {
|
|
430
|
+
attributes: t
|
|
431
|
+
} = e;
|
|
432
|
+
if (!t || Ge(e))
|
|
433
|
+
return;
|
|
434
|
+
const n = {
|
|
435
|
+
attrName: "",
|
|
436
|
+
attrValue: "",
|
|
437
|
+
keepAttr: !0,
|
|
438
|
+
allowedAttributes: _,
|
|
439
|
+
forceKeepAttr: void 0
|
|
440
|
+
};
|
|
441
|
+
let f = t.length;
|
|
442
|
+
for (; f--; ) {
|
|
443
|
+
const g = t[f], {
|
|
444
|
+
name: m,
|
|
445
|
+
namespaceURI: y,
|
|
446
|
+
value: w
|
|
447
|
+
} = g, j = d(m), We = w;
|
|
448
|
+
let E = m === "value" ? We : Mt(We);
|
|
449
|
+
if (n.attrName = j, n.attrValue = E, n.keepAttr = !0, n.forceKeepAttr = void 0, M(R.uponSanitizeAttribute, e, n), E = n.attrValue, ct && (j === "id" || j === "name") && (k(m, e), E = cn + E), fe && A(/((--!?|])>)|<\/(style|title|textarea)/i, E)) {
|
|
450
|
+
k(m, e);
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
if (j === "attributename" && Se(E, "href")) {
|
|
454
|
+
k(m, e);
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
if (n.forceKeepAttr)
|
|
458
|
+
continue;
|
|
459
|
+
if (!n.keepAttr) {
|
|
460
|
+
k(m, e);
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
if (!st && A(/\/>/i, E)) {
|
|
464
|
+
k(m, e);
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
z && re([Ne, Ie, Ce], (yt) => {
|
|
468
|
+
E = q(E, yt, " ");
|
|
469
|
+
});
|
|
470
|
+
const Ot = d(e.nodeName);
|
|
471
|
+
if (!ht(Ot, j, E)) {
|
|
472
|
+
k(m, e);
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
if (S && typeof le == "object" && typeof le.getAttributeType == "function" && !y)
|
|
476
|
+
switch (le.getAttributeType(Ot, j)) {
|
|
477
|
+
case "TrustedHTML": {
|
|
478
|
+
E = S.createHTML(E);
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
case "TrustedScriptURL": {
|
|
482
|
+
E = S.createScriptURL(E);
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
if (E !== We)
|
|
487
|
+
try {
|
|
488
|
+
y ? e.setAttributeNS(y, m, E) : e.setAttribute(m, E), Ge(e) ? I(e) : Ye(o.removed);
|
|
489
|
+
} catch {
|
|
490
|
+
k(m, e);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
M(R.afterSanitizeAttributes, e, null);
|
|
494
|
+
}, _n = function i(e) {
|
|
495
|
+
let t = null;
|
|
496
|
+
const n = Et(e);
|
|
497
|
+
for (M(R.beforeSanitizeShadowDOM, e, null); t = n.nextNode(); )
|
|
498
|
+
M(R.uponSanitizeShadowNode, t, null), At(t), Rt(t), t.content instanceof O && i(t.content);
|
|
499
|
+
M(R.afterSanitizeShadowDOM, e, null);
|
|
500
|
+
};
|
|
501
|
+
return o.sanitize = function(i) {
|
|
502
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, n = null, f = null, g = null;
|
|
503
|
+
if (Fe = !i, Fe && (i = "<!-->"), typeof i != "string" && !gt(i))
|
|
504
|
+
if (typeof i.toString == "function") {
|
|
505
|
+
if (i = i.toString(), typeof i != "string")
|
|
506
|
+
throw K("dirty is not a string, aborting");
|
|
507
|
+
} else
|
|
508
|
+
throw K("toString is not a function");
|
|
509
|
+
if (!o.isSupported)
|
|
510
|
+
return i;
|
|
511
|
+
if (xe || ze(e), o.removed = [], typeof i == "string" && (oe = !1), oe) {
|
|
512
|
+
if (i.nodeName) {
|
|
513
|
+
const w = d(i.nodeName);
|
|
514
|
+
if (!T[w] || ne[w])
|
|
515
|
+
throw K("root node is forbidden and cannot be sanitized in-place");
|
|
516
|
+
}
|
|
517
|
+
} else if (i instanceof De)
|
|
518
|
+
t = _t("<!---->"), n = t.ownerDocument.importNode(i, !0), n.nodeType === J.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? t = n : t.appendChild(n);
|
|
519
|
+
else {
|
|
520
|
+
if (!G && !z && !v && // eslint-disable-next-line unicorn/prefer-includes
|
|
521
|
+
i.indexOf("<") === -1)
|
|
522
|
+
return S && me ? S.createHTML(i) : i;
|
|
523
|
+
if (t = _t(i), !t)
|
|
524
|
+
return G ? null : me ? te : "";
|
|
525
|
+
}
|
|
526
|
+
t && Pe && I(t.firstChild);
|
|
527
|
+
const m = Et(oe ? i : t);
|
|
528
|
+
for (; f = m.nextNode(); )
|
|
529
|
+
At(f), Rt(f), f.content instanceof O && _n(f.content);
|
|
530
|
+
if (oe)
|
|
531
|
+
return i;
|
|
532
|
+
if (G) {
|
|
533
|
+
if (ue)
|
|
534
|
+
for (g = tn.call(t.ownerDocument); t.firstChild; )
|
|
535
|
+
g.appendChild(t.firstChild);
|
|
536
|
+
else
|
|
537
|
+
g = t;
|
|
538
|
+
return (_.shadowroot || _.shadowrootmode) && (g = on.call(r, g, !0)), g;
|
|
539
|
+
}
|
|
540
|
+
let y = v ? t.outerHTML : t.innerHTML;
|
|
541
|
+
return v && T["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && A(Ke, t.ownerDocument.doctype.name) && (y = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
|
|
542
|
+
` + y), z && re([Ne, Ie, Ce], (w) => {
|
|
543
|
+
y = q(y, w, " ");
|
|
544
|
+
}), S && me ? S.createHTML(y) : y;
|
|
545
|
+
}, o.setConfig = function() {
|
|
546
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
547
|
+
ze(i), xe = !0;
|
|
548
|
+
}, o.clearConfig = function() {
|
|
549
|
+
Y = null, xe = !1;
|
|
550
|
+
}, o.isValidAttribute = function(i, e, t) {
|
|
551
|
+
Y || ze({});
|
|
552
|
+
const n = d(i), f = d(e);
|
|
553
|
+
return ht(n, f, t);
|
|
554
|
+
}, o.addHook = function(i, e) {
|
|
555
|
+
typeof e == "function" && $(R[i], e);
|
|
556
|
+
}, o.removeHook = function(i, e) {
|
|
557
|
+
if (e !== void 0) {
|
|
558
|
+
const t = Nt(R[i], e);
|
|
559
|
+
return t === -1 ? void 0 : It(R[i], t, 1)[0];
|
|
560
|
+
}
|
|
561
|
+
return Ye(R[i]);
|
|
562
|
+
}, o.removeHooks = function(i) {
|
|
563
|
+
R[i] = [];
|
|
564
|
+
}, o.removeAllHooks = function() {
|
|
565
|
+
R = Je();
|
|
566
|
+
}, o;
|
|
567
|
+
}
|
|
568
|
+
var Xt = Qe();
|
|
569
|
+
return Be = Xt, Be;
|
|
570
|
+
}
|
|
571
|
+
var Lt = self.DOMPurify || (self.DOMPurify = Dt().default || Dt());
|
|
572
|
+
const An = /* @__PURE__ */ En(Lt), Sn = /* @__PURE__ */ gn({
|
|
573
|
+
__proto__: null,
|
|
574
|
+
default: An
|
|
575
|
+
}, [Lt]);
|
|
576
|
+
export {
|
|
577
|
+
Sn as b
|
|
578
|
+
};
|
|
579
|
+
//# sourceMappingURL=browser.js.map
|