/*
 @license DOMPurify 3.0.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.0.1/LICENSE */
!function(C,M){"object"==typeof exports&&"undefined"!=typeof module?module.exports=M():"function"==typeof define&&define.amd?define(M):(C="undefined"!=typeof globalThis?globalThis:C||self).DOMPurify=M()}(this,function(){function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(f){return typeof f}:function(f){return f&&"function"==typeof Symbol&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},C(e)}function M(e,f){return M=Object.setPrototypeOf||function(d,
g){return d.__proto__=g,d},M(e,f)}function rb(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function ma(e,f,d){return ma=rb()?Reflect.construct:function(g,m,n){var q=[null];q.push.apply(q,m);g=new (Function.bind.apply(g,q));return n&&M(g,n.prototype),g},ma.apply(null,arguments)}function sb(e,f){if(!(e=function(d){if(Array.isArray(d))return d}(e)||
function(d,g){var m=null==d?null:"undefined"!=typeof Symbol&&d[Symbol.iterator]||d["@@iterator"];if(null!=m){var n,q=[],v=!0,F=!1;try{for(m=m.call(d);!(v=(n=m.next()).done)&&(q.push(n.value),!g||q.length!==g);v=!0);}catch(J){F=!0;var N=J}finally{try{v||null==m.return||m.return()}finally{if(F)throw N;}}return q}}(e,f)||na(e,f)))throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return e}function z(e){var f=
Array.isArray(e)?oa(e):void 0;f||(f="undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"]?Array.from(e):void 0);if(!(e=f||na(e)))throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return e}function na(e,f){if(e){if("string"==typeof e)return oa(e,f);var d=Object.prototype.toString.call(e).slice(8,-1);return"Object"===d&&e.constructor&&(d=e.constructor.name),"Map"===d||"Set"===
d?Array.from(e):"Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?oa(e,f):void 0}}function oa(e,f){(null==f||f>e.length)&&(f=e.length);for(var d=0,g=Array(f);d<f;d++)g[d]=e[d];return g}function y(e){return function(f){for(var d=arguments.length,g=Array(1<d?d-1:0),m=1;m<d;m++)g[m-1]=arguments[m];return La(e,f,g)}}function l(e,f,d){d=d||da;Ma&&Ma(e,null);for(var g=f.length;g--;){var m=f[g];if("string"==typeof m){var n=d(m);n!==m&&(tb(f)||(f[g]=n),m=n)}e[m]=!0}return e}function R(e){var f,
d=ub(null);e=function(m,n){var q="undefined"!=typeof Symbol&&m[Symbol.iterator]||m["@@iterator"];if(!q){if(Array.isArray(m)||(q=na(m))||n&&m&&"number"==typeof m.length){q&&(m=q);var v=0;n=function(){};return{s:n,n:function(){return v>=m.length?{done:!0}:{done:!1,value:m[v++]}},e:function(G){throw G;},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var F,N=!0,J=!1;return{s:function(){q=
q.call(m)},n:function(){var G=q.next();return N=G.done,G},e:function(G){J=!0;F=G},f:function(){try{N||null==q.return||q.return()}finally{if(J)throw F;}}}}(Na(e));try{for(e.s();!(f=e.n()).done;){var g=sb(f.value,2);d[g[0]]=g[1]}}catch(m){e.e(m)}finally{e.f()}return d}function ea(e,f){for(;null!==e;){var d=vb(e,f);if(d){if(d.get)return y(d.get);if("function"==typeof d.value)return y(d.value)}e=wb(e)}return function(g){return console.warn("fallback value for",g),null}}var Na=Object.entries,Ma=Object.setPrototypeOf,
tb=Object.isFrozen,wb=Object.getPrototypeOf,vb=Object.getOwnPropertyDescriptor,w=Object.freeze,D=Object.seal,ub=Object.create,Oa="undefined"!=typeof Reflect&&Reflect,La=Oa.apply,Pa=Oa.construct;La||=function(e,f,d){return e.apply(f,d)};w||=function(e){return e};D||=function(e){return e};Pa||=function(e,f){return ma(e,z(f))};var Qa,xb=y(Array.prototype.forEach),Ra=y(Array.prototype.pop),aa=y(Array.prototype.push),da=y(String.prototype.toLowerCase),pa=y(String.prototype.toString),yb=y(String.prototype.match),
A=y(String.prototype.replace),zb=y(String.prototype.indexOf),Ab=y(String.prototype.trim),x=y(RegExp.prototype.test),qa=(Qa=TypeError,function(){for(var e=arguments.length,f=Array(e),d=0;d<e;d++)f[d]=arguments[d];return Pa(Qa,f)}),Sa=w("a abbr acronym address area article aside audio b bdi bdo big blink blockquote body br button canvas caption center cite code col colgroup content data datalist dd decorator del details dfn dialog dir div dl dt element em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i img input ins kbd label legend li main map mark marquee menu menuitem meter nav nobr ol optgroup option output p picture pre progress q rp rt ruby s samp section select shadow small source spacer span strike strong style sub summary sup table tbody td template textarea tfoot th thead time tr track tt u ul var video wbr".split(" ")),
ra=w("svg a altglyph altglyphdef altglyphitem animatecolor animatemotion animatetransform circle clippath defs desc ellipse filter font g glyph glyphref hkern image line lineargradient marker mask metadata mpath path pattern polygon polyline radialgradient rect stop style switch symbol text textpath title tref tspan view vkern".split(" ")),sa=w("feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" ")),
Bb=w("animate color-profile cursor discard fedropshadow 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".split(" ")),ta=w("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".split(" ")),Cb=w("maction maligngroup malignmark mlongdiv mscarries mscarry msgroup mstack msline msrow semantics annotation annotation-xml mprescripts none".split(" ")),
Ta=w(["#text"]),Ua=w("accept action align alt autocapitalize autocomplete autopictureinpicture autoplay background bgcolor border capture cellpadding cellspacing checked cite class clear color cols colspan controls controlslist coords crossorigin datetime decoding default dir disabled disablepictureinpicture disableremoteplayback download draggable enctype enterkeyhint face for headers height hidden high href hreflang id inputmode integrity ismap kind label lang list loading loop low max maxlength media method min minlength multiple muted name nonce noshade novalidate nowrap open optimum pattern placeholder playsinline poster preload pubdate radiogroup readonly rel required rev reversed role rows rowspan spellcheck scope selected shape size sizes span srclang start src srcset step style summary tabindex title translate type usemap valign value width xmlns slot".split(" ")),
ua=w("accent-height accumulate additive alignment-baseline 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 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 k k1 k2 k3 k4 kerning keypoints keysplines keytimes lang lengthadjust letter-spacing kernelmatrix kernelunitlength lighting-color local marker-end marker-mid marker-start markerheight markerunits markerwidth maskcontentunits maskunits max mask media method mode min name numoctaves offset operator opacity order orient orientation origin overflow paint-order path pathlength patterncontentunits patterntransform patternunits points preservealpha preserveaspectratio primitiveunits r rx ry radius refx refy repeatcount repeatdur restart result rotate scale seed shape-rendering 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 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".split(" ")),
Va=w("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".split(" ")),
fa=w(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),va=D(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wa=D(/<%[\w\W]*|[\w\W]*%>/gm),xa=D(/\${[\w\W]*}/gm),Db=D(/^data-[\-\w.\u00B7-\uFFFF]/),Eb=D(/^aria-[\-\w]+$/),Fb=D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gb=D(/^(?:\w+script|data):/i),Wa=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hb=D(/^html$/i),Ib=function(e,f){if("object"!==C(e)||"function"!=typeof e.createPolicy)return null;
var d=null;f.currentScript&&f.currentScript.hasAttribute("data-tt-policy-suffix")&&(d=f.currentScript.getAttribute("data-tt-policy-suffix"));f="dompurify"+(d?"#"+d:"");try{return e.createPolicy(f,{createHTML:function(g){return g},createScriptURL:function(g){return g}})}catch(g){return console.warn("TrustedTypes policy "+f+" could not be created."),null}};return function f(){var d=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,g=function(a){return f(a)};
if(g.version="3.0.1",g.removed=[],!d||!d.document||9!==d.document.nodeType)return g.isSupported=!1,g;var m=d.document,n=d.document,q=d.DocumentFragment,v=d.HTMLTemplateElement,F=d.Node,N=d.Element,J=d.NodeFilter,G=d.NamedNodeMap,Jb=void 0===G?d.NamedNodeMap||d.MozNamedAttrMap:G,Kb=d.HTMLFormElement,Lb=d.DOMParser,ha=d.trustedTypes;d=N.prototype;var Mb=ea(d,"cloneNode"),Nb=ea(d,"nextSibling"),Ob=ea(d,"childNodes"),ya=ea(d,"parentNode");"function"==typeof v&&(v=n.createElement("template"),v.content&&
v.content.ownerDocument&&(n=v.content.ownerDocument));var B=Ib(ha,m),Xa=B?B.createHTML(""):"";v=n;var za=v.implementation,Pb=v.createNodeIterator,Qb=v.createDocumentFragment,Rb=v.getElementsByTagName,Sb=m.importNode,E={};g.isSupported="function"==typeof Na&&"function"==typeof ya&&za&&void 0!==za.createHTMLDocument;var S,r,Aa=Fb,t=null,Ya=l({},[].concat(z(Sa),z(ra),z(sa),z(ta),z(Ta))),u=null,Za=l({},[].concat(z(Ua),z(ua),z(Va),z(fa))),p=Object.seal(Object.create(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}})),ba=null,Ba=null,$a=!0,Ca=!0,ab=!1,bb=!0,T=!1,O=!1,Da=!1,Ea=!1,U=!1,ia=!1,ja=!1,cb=!0,db=!1,Fa=!0,ca=!1,V={},W=null,eb=l({},"annotation-xml audio colgroup desc foreignobject head iframe math mi mn mo ms mtext noembed noframes noscript plaintext script style svg template thead title video xmp".split(" ")),fb=null,gb=
l({},"audio video img source image track".split(" ")),Ga=null,hb=l({},"alt class for id label name pattern placeholder role summary title value style xmlns".split(" ")),X="http://www.w3.org/1999/xhtml",ib=!1,Ha=null,Tb=l({},["http://www.w3.org/1998/Math/MathML","http://www.w3.org/2000/svg","http://www.w3.org/1999/xhtml"],pa),Ub=["application/xhtml+xml","text/html"],Y=null,Vb=n.createElement("form"),jb=function(a){return a instanceof RegExp||a instanceof Function},Ia=function(a){Y&&Y===a||(a&&"object"===
C(a)||(a={}),a=R(a),S=S=-1===Ub.indexOf(a.PARSER_MEDIA_TYPE)?"text/html":a.PARSER_MEDIA_TYPE,r="application/xhtml+xml"===S?pa:da,t="ALLOWED_TAGS"in a?l({},a.ALLOWED_TAGS,r):Ya,u="ALLOWED_ATTR"in a?l({},a.ALLOWED_ATTR,r):Za,Ha="ALLOWED_NAMESPACES"in a?l({},a.ALLOWED_NAMESPACES,pa):Tb,Ga="ADD_URI_SAFE_ATTR"in a?l(R(hb),a.ADD_URI_SAFE_ATTR,r):hb,fb="ADD_DATA_URI_TAGS"in a?l(R(gb),a.ADD_DATA_URI_TAGS,r):gb,W="FORBID_CONTENTS"in a?l({},a.FORBID_CONTENTS,r):eb,ba="FORBID_TAGS"in a?l({},a.FORBID_TAGS,r):
{},Ba="FORBID_ATTR"in a?l({},a.FORBID_ATTR,r):{},V="USE_PROFILES"in a&&a.USE_PROFILES,$a=!1!==a.ALLOW_ARIA_ATTR,Ca=!1!==a.ALLOW_DATA_ATTR,ab=a.ALLOW_UNKNOWN_PROTOCOLS||!1,bb=!1!==a.ALLOW_SELF_CLOSE_IN_ATTR,T=a.SAFE_FOR_TEMPLATES||!1,O=a.WHOLE_DOCUMENT||!1,U=a.RETURN_DOM||!1,ia=a.RETURN_DOM_FRAGMENT||!1,ja=a.RETURN_TRUSTED_TYPE||!1,Ea=a.FORCE_BODY||!1,cb=!1!==a.SANITIZE_DOM,db=a.SANITIZE_NAMED_PROPS||!1,Fa=!1!==a.KEEP_CONTENT,ca=a.IN_PLACE||!1,Aa=a.ALLOWED_URI_REGEXP||Aa,X=a.NAMESPACE||"http://www.w3.org/1999/xhtml",
p=a.CUSTOM_ELEMENT_HANDLING||{},a.CUSTOM_ELEMENT_HANDLING&&jb(a.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(p.tagNameCheck=a.CUSTOM_ELEMENT_HANDLING.tagNameCheck),a.CUSTOM_ELEMENT_HANDLING&&jb(a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(p.attributeNameCheck=a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),a.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(p.allowCustomizedBuiltInElements=a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),T&&
(Ca=!1),ia&&(U=!0),V&&(t=l({},z(Ta)),u=[],!0===V.html&&(l(t,Sa),l(u,Ua)),!0===V.svg&&(l(t,ra),l(u,ua),l(u,fa)),!0===V.svgFilters&&(l(t,sa),l(u,ua),l(u,fa)),!0===V.mathMl&&(l(t,ta),l(u,Va),l(u,fa))),a.ADD_TAGS&&(t===Ya&&(t=R(t)),l(t,a.ADD_TAGS,r)),a.ADD_ATTR&&(u===Za&&(u=R(u)),l(u,a.ADD_ATTR,r)),a.ADD_URI_SAFE_ATTR&&l(Ga,a.ADD_URI_SAFE_ATTR,r),a.FORBID_CONTENTS&&(W===eb&&(W=R(W)),l(W,a.FORBID_CONTENTS,r)),Fa&&(t["#text"]=!0),O&&l(t,["html","head","body"]),t.table&&(l(t,["tbody"]),delete ba.tbody),
w&&w(a),Y=a)},kb=l({},["mi","mo","mn","ms","mtext"]),lb=l({},["foreignobject","desc","title","annotation-xml"]),Wb=l({},["title","style","font","a","script"]),ka=l({},ra);l(ka,sa);l(ka,Bb);var Ja=l({},ta);l(Ja,Cb);var P=function(a){aa(g.removed,{element:a});try{a.parentNode.removeChild(a)}catch(b){a.remove()}},Ka=function(a,b){try{aa(g.removed,{attribute:b.getAttributeNode(a),from:b})}catch(c){aa(g.removed,{attribute:null,from:b})}if(b.removeAttribute(a),"is"===a&&!u[a])if(U||ia)try{P(b)}catch(c){}else try{b.setAttribute(a,
"")}catch(c){}},mb=function(a){if(Ea)a="<remove></remove>"+a;else var b=(b=yb(a,/^[\r\n\t ]+/))&&b[0];"application/xhtml+xml"===S&&"http://www.w3.org/1999/xhtml"===X&&(a='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+a+"</body></html>");var c=B?B.createHTML(a):a;if("http://www.w3.org/1999/xhtml"===X)try{var h=(new Lb).parseFromString(c,S)}catch(k){}if(!h||!h.documentElement){h=za.createDocument(X,"template",null);try{h.documentElement.innerHTML=ib?Xa:c}catch(k){}}c=h.body||h.documentElement;
return a&&b&&c.insertBefore(n.createTextNode(b),c.childNodes[0]||null),"http://www.w3.org/1999/xhtml"===X?Rb.call(h,O?"html":"body")[0]:O?h.documentElement:c},nb=function(a){return Pb.call(a.ownerDocument||a,a,J.SHOW_ELEMENT|J.SHOW_COMMENT|J.SHOW_TEXT,null,!1)},la=function(a){return"object"===C(F)?a instanceof F:a&&"object"===C(a)&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName},H=function(a,b,c){E[a]&&xb(E[a],function(h){h.call(g,b,c,Y)})},ob=function(a){if(H("beforeSanitizeElements",a,
null),a instanceof Kb&&("string"!=typeof a.nodeName||"string"!=typeof a.textContent||"function"!=typeof a.removeChild||!(a.attributes instanceof Jb)||"function"!=typeof a.removeAttribute||"function"!=typeof a.setAttribute||"string"!=typeof a.namespaceURI||"function"!=typeof a.insertBefore||"function"!=typeof a.hasChildNodes))return P(a),!0;var b=r(a.nodeName);if(H("uponSanitizeElement",a,{tagName:b,allowedTags:t}),!(!a.hasChildNodes()||la(a.firstElementChild)||la(a.content)&&la(a.content.firstElementChild))&&
x(/<[/\w]/g,a.innerHTML)&&x(/<[/\w]/g,a.textContent))return P(a),!0;if(!t[b]||ba[b]){if(!ba[b]&&0<b.indexOf("-")&&(p.tagNameCheck instanceof RegExp&&x(p.tagNameCheck,b)||p.tagNameCheck instanceof Function&&p.tagNameCheck(b)))return!1;if(Fa&&!W[b]){var c=ya(a)||a.parentNode;if((b=Ob(a)||a.childNodes)&&c)for(var h=b.length-1;0<=h;--h)c.insertBefore(Mb(b[h],!0),Nb(a))}return P(a),!0}if(h=a instanceof N){(h=ya(a))&&h.tagName||(h={namespaceURI:X,tagName:"template"});var k=da(a.tagName),I=da(h.tagName);
h=!(Ha[a.namespaceURI]&&("http://www.w3.org/2000/svg"===a.namespaceURI?"http://www.w3.org/1999/xhtml"===h.namespaceURI?"svg"===k:"http://www.w3.org/1998/Math/MathML"===h.namespaceURI?"svg"===k&&("annotation-xml"===I||kb[I]):ka[k]:"http://www.w3.org/1998/Math/MathML"===a.namespaceURI?"http://www.w3.org/1999/xhtml"===h.namespaceURI?"math"===k:"http://www.w3.org/2000/svg"===h.namespaceURI?"math"===k&&lb[I]:Ja[k]:"http://www.w3.org/1999/xhtml"===a.namespaceURI?!("http://www.w3.org/2000/svg"===h.namespaceURI&&
!lb[I]||"http://www.w3.org/1998/Math/MathML"===h.namespaceURI&&!kb[I]||Ja[k]||!Wb[k]&&ka[k]):"application/xhtml+xml"===S&&Ha[a.namespaceURI]))}return h?(P(a),!0):"noscript"!==b&&"noembed"!==b||!x(/<\/no(script|embed)/i,a.innerHTML)?(T&&3===a.nodeType&&(c=a.textContent,c=A(c,va," "),c=A(c,wa," "),c=A(c,xa," "),a.textContent!==c&&(aa(g.removed,{element:a.cloneNode()}),a.textContent=c)),H("afterSanitizeElements",a,null),!1):(P(a),!0)},pb=function(a,b,c){if(cb&&("id"===b||"name"===b)&&(c in n||c in Vb))return!1;
if(!Ca||Ba[b]||!x(Db,b))if(!$a||!x(Eb,b))if(!u[b]||Ba[b]){if(!(0<a.indexOf("-")&&(p.tagNameCheck instanceof RegExp&&x(p.tagNameCheck,a)||p.tagNameCheck instanceof Function&&p.tagNameCheck(a))&&(p.attributeNameCheck instanceof RegExp&&x(p.attributeNameCheck,b)||p.attributeNameCheck instanceof Function&&p.attributeNameCheck(b))||"is"===b&&p.allowCustomizedBuiltInElements&&(p.tagNameCheck instanceof RegExp&&x(p.tagNameCheck,c)||p.tagNameCheck instanceof Function&&p.tagNameCheck(c))))return!1}else if(!(Ga[b]||
x(Aa,A(c,Wa,""))||("src"===b||"xlink:href"===b||"href"===b)&&"script"!==a&&0===zb(c,"data:")&&fb[a]||ab&&!x(Gb,A(c,Wa,"")))&&c)return!1;return!0},qb=function(a){var b,c,h,k;H("beforeSanitizeAttributes",a,null);var I=a.attributes;if(I){var K={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:u};for(k=I.length;k--;){var Z=b=I[k],Q=Z.name;Z=Z.namespaceURI;if(c="value"===Q?b.value:Ab(b.value),h=r(Q),K.attrName=h,K.attrValue=c,K.keepAttr=!0,K.forceKeepAttr=void 0,H("uponSanitizeAttribute",a,K),c=
K.attrValue,!K.forceKeepAttr&&(Ka(Q,a),K.keepAttr))if(bb||!x(/\/>/i,c)){if(T&&(c=A(c,va," "),c=A(c,wa," "),c=A(c,xa," ")),b=r(a.nodeName),pb(b,h,c)){if((!db||"id"!==h&&"name"!==h||(Ka(Q,a),c="user-content-"+c),B&&"object"===C(ha)&&"function"==typeof ha.getAttributeType)&&!Z)switch(ha.getAttributeType(b,h)){case "TrustedHTML":c=B.createHTML(c);break;case "TrustedScriptURL":c=B.createScriptURL(c)}try{Z?a.setAttributeNS(Z,Q,c):a.setAttribute(Q,c),Ra(g.removed)}catch(Yb){}}}else Ka(Q,a)}H("afterSanitizeAttributes",
a,null)}},Xb=function c(b){var h,k=nb(b);for(H("beforeSanitizeShadowDOM",b,null);h=k.nextNode();)H("uponSanitizeShadowNode",h,null),ob(h)||(h.content instanceof q&&c(h.content),qb(h));H("afterSanitizeShadowDOM",b,null)};return g.sanitize=function(b){var c,h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if((ib=!b)&&(b="\x3c!--\x3e"),"string"!=typeof b&&!la(b)){if("function"!=typeof b.toString)throw qa("toString is not a function");if("string"!=typeof(b=b.toString()))throw qa("dirty is not a string, aborting");
}if(!g.isSupported)return b;if(Da||Ia(h),g.removed=[],"string"==typeof b&&(ca=!1),ca){if(b.nodeName){var k=r(b.nodeName);if(!t[k]||ba[k])throw qa("root node is forbidden and cannot be sanitized in-place");}}else if(b instanceof F)1===(k=(c=mb("\x3c!----\x3e")).ownerDocument.importNode(b,!0)).nodeType&&"BODY"===k.nodeName||"HTML"===k.nodeName?c=k:c.appendChild(k);else{if(!U&&!T&&!O&&-1===b.indexOf("<"))return B&&ja?B.createHTML(b):b;if(!(c=mb(b)))return U?null:ja?Xa:""}c&&Ea&&P(c.firstChild);for(h=
nb(ca?b:c);k=h.nextNode();)ob(k)||(k.content instanceof q&&Xb(k.content),qb(k));if(ca)return b;if(U){if(ia)for(k=Qb.call(c.ownerDocument);c.firstChild;)k.appendChild(c.firstChild);else k=c;return(u.shadowroot||u.shadowrootmod)&&(k=Sb.call(m,k,!0)),k}k=O?c.outerHTML:c.innerHTML;return O&&t["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&x(Hb,c.ownerDocument.doctype.name)&&(k="<!DOCTYPE "+c.ownerDocument.doctype.name+">\n"+k),T&&(k=A(k,va," "),k=A(k,wa," "),k=A(k,
xa," ")),B&&ja?B.createHTML(k):k},g.setConfig=function(b){Ia(b);Da=!0},g.clearConfig=function(){Y=null;Da=!1},g.isValidAttribute=function(b,c,h){Y||Ia({});b=r(b);c=r(c);return pb(b,c,h)},g.addHook=function(b,c){"function"==typeof c&&(E[b]=E[b]||[],aa(E[b],c))},g.removeHook=function(b){if(E[b])return Ra(E[b])},g.removeHooks=function(b){E[b]&&(E[b]=[])},g.removeAllHooks=function(){E={}},g}()});//# sourceMappingURL=purify.js.map
