function $e(r,t,a){if(a||arguments.length===2)for(var i=0,l=t.length,f;i<l;i++)(f||!(i in t))&&(f||(f=Array.prototype.slice.call(t,0,i)),f[i]=t[i]);return r.concat(f||Array.prototype.slice.call(t))}/*!
 * content-type
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */var vt=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Jt=/\\([\u000b\u0020-\u00ff])/g,en=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,tn=nn;function nn(r){if(!r)throw new TypeError("argument string is required");var t=typeof r=="object"?rn(r):r;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var a=t.indexOf(";"),i=a!==-1?t.slice(0,a).trim():t.trim();if(!en.test(i))throw new TypeError("invalid media type");var l=new on(i.toLowerCase());if(a!==-1){var f,u,p;for(vt.lastIndex=a;u=vt.exec(t);){if(u.index!==a)throw new TypeError("invalid parameter format");a+=u[0].length,f=u[1].toLowerCase(),p=u[2],p.charCodeAt(0)===34&&(p=p.slice(1,-1),p.indexOf("\\")!==-1&&(p=p.replace(Jt,"$1"))),l.parameters[f]=p}if(a!==t.length)throw new TypeError("invalid parameter format")}return l}function rn(r){var t;if(typeof r.getHeader=="function"?t=r.getHeader("content-type"):typeof r.headers=="object"&&(t=r.headers&&r.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function on(r){this.parameters=Object.create(null),this.type=r}var ge=new Map,Ft=function(t){return t.cloneNode(!0)},wt=function(){return window.location.protocol==="file:"},Gt=function(t,a,i){var l=new XMLHttpRequest;l.onreadystatechange=function(){try{if(!/\.svg/i.test(t)&&l.readyState===2){var f=l.getResponseHeader("Content-Type");if(!f)throw new Error("Content type not found");var u=tn(f).type;if(!(u==="image/svg+xml"||u==="text/plain"))throw new Error("Invalid content type: ".concat(u))}if(l.readyState===4){if(l.status===404||l.responseXML===null)throw new Error(wt()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+t);if(l.status===200||wt()&&l.status===0)i(null,l);else throw new Error("There was a problem injecting the SVG: "+l.status+" "+l.statusText)}}catch(p){if(l.abort(),p instanceof Error)i(p,l);else throw p}},l.open("GET",t),l.withCredentials=a,l.overrideMimeType&&l.overrideMimeType("text/xml"),l.send()},V={},Lt=function(t,a){V[t]=V[t]||[],V[t].push(a)},an=function(t){for(var a=function(u,p){setTimeout(function(){if(Array.isArray(V[t])){var S=ge.get(t),N=V[t][u];S instanceof SVGSVGElement&&N(null,Ft(S)),S instanceof Error&&N(S),u===V[t].length-1&&delete V[t]}},0)},i=0,l=V[t].length;i<l;i++)a(i)},sn=function(t,a,i){if(ge.has(t)){var l=ge.get(t);if(l===void 0){Lt(t,i);return}if(l instanceof SVGSVGElement){i(null,Ft(l));return}}ge.set(t,void 0),Lt(t,i),Gt(t,a,function(f,u){var p;f?ge.set(t,f):((p=u.responseXML)===null||p===void 0?void 0:p.documentElement)instanceof SVGSVGElement&&ge.set(t,u.responseXML.documentElement),an(t)})},ln=function(t,a,i){Gt(t,a,function(l,f){var u;l?i(l):((u=f.responseXML)===null||u===void 0?void 0:u.documentElement)instanceof SVGSVGElement&&i(null,f.responseXML.documentElement)})},cn=0,fn=function(){return++cn},W=[],Ot={},un="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xlink",Ct=function(t,a,i,l,f,u,p){var S=t.getAttribute("data-src")||t.getAttribute("src");if(!S){p(new Error("Invalid data-src or src attribute"));return}if(W.indexOf(t)!==-1){W.splice(W.indexOf(t),1),t=null;return}W.push(t),t.setAttribute("src","");var N=l?sn:ln;N(S,f,function(re,m){if(!m){W.splice(W.indexOf(t),1),t=null,p(re);return}var $=t.getAttribute("id");$&&m.setAttribute("id",$);var U=t.getAttribute("title");U&&m.setAttribute("title",U);var x=t.getAttribute("width");x&&m.setAttribute("width",x);var Z=t.getAttribute("height");Z&&m.setAttribute("height",Z);var ie=Array.from(new Set($e($e($e([],(m.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(t.getAttribute("class")||"").split(" "),!0))).join(" ").trim();m.setAttribute("class",ie);var K=t.getAttribute("style");K&&m.setAttribute("style",K),m.setAttribute("data-src",S);var oe=[].filter.call(t.attributes,function(O){return/^data-\w[\w-]*$/.test(O.name)});if(Array.prototype.forEach.call(oe,function(O){O.name&&O.value&&m.setAttribute(O.name,O.value)}),i){var P={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},g,R,F,ae,se;Object.keys(P).forEach(function(O){g=O,F=P[O],R=m.querySelectorAll(g+"[id]");for(var ze=function(E,Be){ae=R[E].id,se=ae+"-"+fn();var d;Array.prototype.forEach.call(F,function(te){d=m.querySelectorAll("["+te+'*="'+ae+'"]');for(var I=0,ye=d.length;I<ye;I++){var ue=d[I].getAttribute(te);ue&&!ue.match(new RegExp('url\\("?#'+ae+'"?\\)'))||d[I].setAttribute(te,"url(#"+se+")")}});for(var j=m.querySelectorAll("[*|href]"),J=[],ee=0,_e=j.length;ee<_e;ee++){var Se=j[ee].getAttributeNS(Ze,"href");Se&&Se.toString()==="#"+R[E].id&&J.push(j[ee])}for(var fe=0,X=J.length;fe<X;fe++)J[fe].setAttributeNS(Ze,"href","#"+se);R[E].id=se},ce=0,T=R.length;ce<T;ce++)ze(ce)})}m.removeAttribute("xmlns:a");for(var Q=m.querySelectorAll("script"),le=[],L,B,G=0,Te=Q.length;G<Te;G++)B=Q[G].getAttribute("type"),(!B||B==="application/ecmascript"||B==="application/javascript"||B==="text/javascript")&&(L=Q[G].innerText||Q[G].textContent,L&&le.push(L),m.removeChild(Q[G]));if(le.length>0&&(a==="always"||a==="once"&&!Ot[S])){for(var Ae=0,Ge=le.length;Ae<Ge;Ae++)new Function(le[Ae])(window);Ot[S]=!0}var He=m.querySelectorAll("style");if(Array.prototype.forEach.call(He,function(O){O.textContent+=""}),m.setAttribute("xmlns",un),m.setAttribute("xmlns:xlink",Ze),u(m),!t.parentNode){W.splice(W.indexOf(t),1),t=null,p(new Error("Parent node is null"));return}t.parentNode.replaceChild(m,t),W.splice(W.indexOf(t),1),t=null,p(null,m)})},pn=function(t,a){var i=a===void 0?{}:a,l=i.afterAll,f=l===void 0?function(){}:l,u=i.afterEach,p=u===void 0?function(){}:u,S=i.beforeEach,N=S===void 0?function(){}:S,re=i.cacheRequests,m=re===void 0?!0:re,$=i.evalScripts,U=$===void 0?"never":$,x=i.httpRequestWithCredentials,Z=x===void 0?!1:x,ie=i.renumerateIRIElements,K=ie===void 0?!0:ie;if(t&&"length"in t)for(var oe=0,P=0,g=t.length;P<g;P++)Ct(t[P],U,K,m,Z,N,function(R,F){p(R,F),t&&"length"in t&&t.length===++oe&&f(oe)});else t?Ct(t,U,K,m,Z,N,function(R,F){p(R,F),f(1),t=null}):f(0)};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:Ht,setPrototypeOf:Nt,isFrozen:mn,getPrototypeOf:dn,getOwnPropertyDescriptor:hn}=Object;let{freeze:w,seal:M,create:zt}=Object,{apply:nt,construct:rt}=typeof Reflect<"u"&&Reflect;w||(w=function(t){return t});M||(M=function(t){return t});nt||(nt=function(t,a,i){return t.apply(a,i)});rt||(rt=function(t,a){return new t(...a)});const ke=D(Array.prototype.forEach),Dt=D(Array.prototype.pop),we=D(Array.prototype.push),Fe=D(String.prototype.toLowerCase),Ke=D(String.prototype.toString),It=D(String.prototype.match),Le=D(String.prototype.replace),En=D(String.prototype.indexOf),gn=D(String.prototype.trim),k=D(Object.prototype.hasOwnProperty),v=D(RegExp.prototype.test),Oe=Tn(TypeError);function D(r){return function(t){for(var a=arguments.length,i=new Array(a>1?a-1:0),l=1;l<a;l++)i[l-1]=arguments[l];return nt(r,t,i)}}function Tn(r){return function(){for(var t=arguments.length,a=new Array(t),i=0;i<t;i++)a[i]=arguments[i];return rt(r,a)}}function c(r,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe;Nt&&Nt(r,null);let i=t.length;for(;i--;){let l=t[i];if(typeof l=="string"){const f=a(l);f!==l&&(mn(t)||(t[i]=f),l=f)}r[l]=!0}return r}function An(r){for(let t=0;t<r.length;t++)k(r,t)||(r[t]=null);return r}function ne(r){const t=zt(null);for(const[a,i]of Ht(r))k(r,a)&&(Array.isArray(i)?t[a]=An(i):i&&typeof i=="object"&&i.constructor===Object?t[a]=ne(i):t[a]=i);return t}function Ce(r,t){for(;r!==null;){const i=hn(r,t);if(i){if(i.get)return D(i.get);if(typeof i.value=="function")return D(i.value)}r=dn(r)}function a(){return null}return a}const Mt=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"]),Qe=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"]),Je=w(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_n=w(["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"]),et=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","mprescripts"]),Sn=w(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xt=w(["#text"]),Pt=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","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),tt=w(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kt=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"]),Ue=w(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yn=M(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Rn=M(/<%[\w\W]*|[\w\W]*%>/gm),bn=M(/\${[\w\W]*}/gm),vn=M(/^data-[\-\w.\u00B7-\uFFFF]/),wn=M(/^aria-[\-\w]+$/),Wt=M(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ln=M(/^(?:\w+script|data):/i),On=M(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bt=M(/^html$/i),Cn=M(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ut=Object.freeze({__proto__:null,MUSTACHE_EXPR:yn,ERB_EXPR:Rn,TMPLIT_EXPR:bn,DATA_ATTR:vn,ARIA_ATTR:wn,IS_ALLOWED_URI:Wt,IS_SCRIPT_OR_DATA:Ln,ATTR_WHITESPACE:On,DOCTYPE_NAME:Bt,CUSTOM_ELEMENT:Cn});const Ne={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Nn=function(){return typeof window>"u"?null:window},Dn=function(t,a){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const l="data-tt-policy-suffix";a&&a.hasAttribute(l)&&(i=a.getAttribute(l));const f="dompurify"+(i?"#"+i:"");try{return t.createPolicy(f,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}};function jt(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nn();const t=s=>jt(s);if(t.version="3.1.7",t.removed=[],!r||!r.document||r.document.nodeType!==Ne.document)return t.isSupported=!1,t;let{document:a}=r;const i=a,l=i.currentScript,{DocumentFragment:f,HTMLTemplateElement:u,Node:p,Element:S,NodeFilter:N,NamedNodeMap:re=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:m,DOMParser:$,trustedTypes:U}=r,x=S.prototype,Z=Ce(x,"cloneNode"),ie=Ce(x,"remove"),K=Ce(x,"nextSibling"),oe=Ce(x,"childNodes"),P=Ce(x,"parentNode");if(typeof u=="function"){const s=a.createElement("template");s.content&&s.content.ownerDocument&&(a=s.content.ownerDocument)}let g,R="";const{implementation:F,createNodeIterator:ae,createDocumentFragment:se,getElementsByTagName:Q}=a,{importNode:le}=i;let L={};t.isSupported=typeof Ht=="function"&&typeof P=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:G,TMPLIT_EXPR:Te,DATA_ATTR:Ae,ARIA_ATTR:Ge,IS_SCRIPT_OR_DATA:He,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:ze}=Ut;let{IS_ALLOWED_URI:ce}=Ut,T=null;const We=c({},[...Mt,...Qe,...Je,...et,...xt]);let E=null;const Be=c({},[...Pt,...tt,...kt,...Ue]);let d=Object.seal(zt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),j=null,J=null,ee=!0,_e=!0,Se=!1,fe=!0,X=!1,te=!0,I=!1,ye=!1,ue=!1,pe=!1,De=!1,Ie=!1,it=!0,ot=!1;const qt="user-content-";let je=!0,Re=!1,me={},de=null;const at=c({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let st=null;const lt=c({},["audio","video","img","source","image","track"]);let qe=null;const ct=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",xe="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xhtml";let he=q,Ye=!1,Xe=null;const Yt=c({},[Me,xe,q],Ke);let be=null;const Xt=["application/xhtml+xml","text/html"],Vt="text/html";let A=null,Ee=null;const $t=a.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},Ve=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ee&&Ee===e)){if((!e||typeof e!="object")&&(e={}),e=ne(e),be=Xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Vt:e.PARSER_MEDIA_TYPE,A=be==="application/xhtml+xml"?Ke:Fe,T=k(e,"ALLOWED_TAGS")?c({},e.ALLOWED_TAGS,A):We,E=k(e,"ALLOWED_ATTR")?c({},e.ALLOWED_ATTR,A):Be,Xe=k(e,"ALLOWED_NAMESPACES")?c({},e.ALLOWED_NAMESPACES,Ke):Yt,qe=k(e,"ADD_URI_SAFE_ATTR")?c(ne(ct),e.ADD_URI_SAFE_ATTR,A):ct,st=k(e,"ADD_DATA_URI_TAGS")?c(ne(lt),e.ADD_DATA_URI_TAGS,A):lt,de=k(e,"FORBID_CONTENTS")?c({},e.FORBID_CONTENTS,A):at,j=k(e,"FORBID_TAGS")?c({},e.FORBID_TAGS,A):{},J=k(e,"FORBID_ATTR")?c({},e.FORBID_ATTR,A):{},me=k(e,"USE_PROFILES")?e.USE_PROFILES:!1,ee=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,fe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,X=e.SAFE_FOR_TEMPLATES||!1,te=e.SAFE_FOR_XML!==!1,I=e.WHOLE_DOCUMENT||!1,pe=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,ue=e.FORCE_BODY||!1,it=e.SANITIZE_DOM!==!1,ot=e.SANITIZE_NAMED_PROPS||!1,je=e.KEEP_CONTENT!==!1,Re=e.IN_PLACE||!1,ce=e.ALLOWED_URI_REGEXP||Wt,he=e.NAMESPACE||q,d=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(d.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(d.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(d.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(_e=!1),De&&(pe=!0),me&&(T=c({},xt),E=[],me.html===!0&&(c(T,Mt),c(E,Pt)),me.svg===!0&&(c(T,Qe),c(E,tt),c(E,Ue)),me.svgFilters===!0&&(c(T,Je),c(E,tt),c(E,Ue)),me.mathMl===!0&&(c(T,et),c(E,kt),c(E,Ue))),e.ADD_TAGS&&(T===We&&(T=ne(T)),c(T,e.ADD_TAGS,A)),e.ADD_ATTR&&(E===Be&&(E=ne(E)),c(E,e.ADD_ATTR,A)),e.ADD_URI_SAFE_ATTR&&c(qe,e.ADD_URI_SAFE_ATTR,A),e.FORBID_CONTENTS&&(de===at&&(de=ne(de)),c(de,e.FORBID_CONTENTS,A)),je&&(T["#text"]=!0),I&&c(T,["html","head","body"]),T.table&&(c(T,["tbody"]),delete j.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Oe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Oe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,R=g.createHTML("")}else g===void 0&&(g=Dn(U,l)),g!==null&&typeof R=="string"&&(R=g.createHTML(""));w&&w(e),Ee=e}},ut=c({},["mi","mo","mn","ms","mtext"]),pt=c({},["annotation-xml"]),Zt=c({},["title","style","font","a","script"]),mt=c({},[...Qe,...Je,..._n]),dt=c({},[...et,...Sn]),Kt=function(e){let n=P(e);(!n||!n.tagName)&&(n={namespaceURI:he,tagName:"template"});const o=Fe(e.tagName),h=Fe(n.tagName);return Xe[e.namespaceURI]?e.namespaceURI===xe?n.namespaceURI===q?o==="svg":n.namespaceURI===Me?o==="svg"&&(h==="annotation-xml"||ut[h]):!!mt[o]:e.namespaceURI===Me?n.namespaceURI===q?o==="math":n.namespaceURI===xe?o==="math"&&pt[h]:!!dt[o]:e.namespaceURI===q?n.namespaceURI===xe&&!pt[h]||n.namespaceURI===Me&&!ut[h]?!1:!dt[o]&&(Zt[o]||!mt[o]):!!(be==="application/xhtml+xml"&&Xe[e.namespaceURI]):!1},H=function(e){we(t.removed,{element:e});try{P(e).removeChild(e)}catch{ie(e)}},Pe=function(e,n){try{we(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{we(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e==="is"&&!E[e])if(pe||De)try{H(n)}catch{}else try{n.setAttribute(e,"")}catch{}},ht=function(e){let n=null,o=null;if(ue)e="<remove></remove>"+e;else{const _=It(e,/^[\r\n\t ]+/);o=_&&_[0]}be==="application/xhtml+xml"&&he===q&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const h=g?g.createHTML(e):e;if(he===q)try{n=new $().parseFromString(h,be)}catch{}if(!n||!n.documentElement){n=F.createDocument(he,"template",null);try{n.documentElement.innerHTML=Ye?R:h}catch{}}const y=n.body||n.documentElement;return e&&o&&y.insertBefore(a.createTextNode(o),y.childNodes[0]||null),he===q?Q.call(n,I?"html":"body")[0]:I?n.documentElement:y},Et=function(e){return ae.call(e.ownerDocument||e,e,N.SHOW_ELEMENT|N.SHOW_COMMENT|N.SHOW_TEXT|N.SHOW_PROCESSING_INSTRUCTION|N.SHOW_CDATA_SECTION,null)},gt=function(e){return e instanceof m&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof re)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Tt=function(e){return typeof p=="function"&&e instanceof p},Y=function(e,n,o){L[e]&&ke(L[e],h=>{h.call(t,n,o,Ee)})},At=function(e){let n=null;if(Y("beforeSanitizeElements",e,null),gt(e))return H(e),!0;const o=A(e.nodeName);if(Y("uponSanitizeElement",e,{tagName:o,allowedTags:T}),e.hasChildNodes()&&!Tt(e.firstElementChild)&&v(/<[/\w]/g,e.innerHTML)&&v(/<[/\w]/g,e.textContent)||e.nodeType===Ne.progressingInstruction||te&&e.nodeType===Ne.comment&&v(/<[/\w]/g,e.data))return H(e),!0;if(!T[o]||j[o]){if(!j[o]&&St(o)&&(d.tagNameCheck instanceof RegExp&&v(d.tagNameCheck,o)||d.tagNameCheck instanceof Function&&d.tagNameCheck(o)))return!1;if(je&&!de[o]){const h=P(e)||e.parentNode,y=oe(e)||e.childNodes;if(y&&h){const _=y.length;for(let C=_-1;C>=0;--C){const z=Z(y[C],!0);z.__removalCount=(e.__removalCount||0)+1,h.insertBefore(z,K(e))}}}return H(e),!0}return e instanceof S&&!Kt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&v(/<\/no(script|embed|frames)/i,e.innerHTML)?(H(e),!0):(X&&e.nodeType===Ne.text&&(n=e.textContent,ke([B,G,Te],h=>{n=Le(n,h," ")}),e.textContent!==n&&(we(t.removed,{element:e.cloneNode()}),e.textContent=n)),Y("afterSanitizeElements",e,null),!1)},_t=function(e,n,o){if(it&&(n==="id"||n==="name")&&(o in a||o in $t))return!1;if(!(_e&&!J[n]&&v(Ae,n))){if(!(ee&&v(Ge,n))){if(!E[n]||J[n]){if(!(St(e)&&(d.tagNameCheck instanceof RegExp&&v(d.tagNameCheck,e)||d.tagNameCheck instanceof Function&&d.tagNameCheck(e))&&(d.attributeNameCheck instanceof RegExp&&v(d.attributeNameCheck,n)||d.attributeNameCheck instanceof Function&&d.attributeNameCheck(n))||n==="is"&&d.allowCustomizedBuiltInElements&&(d.tagNameCheck instanceof RegExp&&v(d.tagNameCheck,o)||d.tagNameCheck instanceof Function&&d.tagNameCheck(o))))return!1}else if(!qe[n]){if(!v(ce,Le(o,O,""))){if(!((n==="src"||n==="xlink:href"||n==="href")&&e!=="script"&&En(o,"data:")===0&&st[e])){if(!(Se&&!v(He,Le(o,O,"")))){if(o)return!1}}}}}}return!0},St=function(e){return e!=="annotation-xml"&&It(e,ze)},yt=function(e){Y("beforeSanitizeAttributes",e,null);const{attributes:n}=e;if(!n)return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E};let h=n.length;for(;h--;){const y=n[h],{name:_,namespaceURI:C,value:z}=y,ve=A(_);let b=_==="value"?z:gn(z);if(o.attrName=ve,o.attrValue=b,o.keepAttr=!0,o.forceKeepAttr=void 0,Y("uponSanitizeAttribute",e,o),b=o.attrValue,o.forceKeepAttr||(Pe(_,e),!o.keepAttr))continue;if(!fe&&v(/\/>/i,b)){Pe(_,e);continue}X&&ke([B,G,Te],bt=>{b=Le(b,bt," ")});const Rt=A(e.nodeName);if(_t(Rt,ve,b)){if(ot&&(ve==="id"||ve==="name")&&(Pe(_,e),b=qt+b),te&&v(/((--!?|])>)|<\/(style|title)/i,b)){Pe(_,e);continue}if(g&&typeof U=="object"&&typeof U.getAttributeType=="function"&&!C)switch(U.getAttributeType(Rt,ve)){case"TrustedHTML":{b=g.createHTML(b);break}case"TrustedScriptURL":{b=g.createScriptURL(b);break}}try{C?e.setAttributeNS(C,_,b):e.setAttribute(_,b),gt(e)?H(e):Dt(t.removed)}catch{}}}Y("afterSanitizeAttributes",e,null)},Qt=function s(e){let n=null;const o=Et(e);for(Y("beforeSanitizeShadowDOM",e,null);n=o.nextNode();)Y("uponSanitizeShadowNode",n,null),!At(n)&&(n.content instanceof f&&s(n.content),yt(n));Y("afterSanitizeShadowDOM",e,null)};return t.sanitize=function(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,o=null,h=null,y=null;if(Ye=!s,Ye&&(s="<!-->"),typeof s!="string"&&!Tt(s))if(typeof s.toString=="function"){if(s=s.toString(),typeof s!="string")throw Oe("dirty is not a string, aborting")}else throw Oe("toString is not a function");if(!t.isSupported)return s;if(ye||Ve(e),t.removed=[],typeof s=="string"&&(Re=!1),Re){if(s.nodeName){const z=A(s.nodeName);if(!T[z]||j[z])throw Oe("root node is forbidden and cannot be sanitized in-place")}}else if(s instanceof p)n=ht("<!---->"),o=n.ownerDocument.importNode(s,!0),o.nodeType===Ne.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?n=o:n.appendChild(o);else{if(!pe&&!X&&!I&&s.indexOf("<")===-1)return g&&Ie?g.createHTML(s):s;if(n=ht(s),!n)return pe?null:Ie?R:""}n&&ue&&H(n.firstChild);const _=Et(Re?s:n);for(;h=_.nextNode();)At(h)||(h.content instanceof f&&Qt(h.content),yt(h));if(Re)return s;if(pe){if(De)for(y=se.call(n.ownerDocument);n.firstChild;)y.appendChild(n.firstChild);else y=n;return(E.shadowroot||E.shadowrootmode)&&(y=le.call(i,y,!0)),y}let C=I?n.outerHTML:n.innerHTML;return I&&T["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&v(Bt,n.ownerDocument.doctype.name)&&(C="<!DOCTYPE "+n.ownerDocument.doctype.name+`>
`+C),X&&ke([B,G,Te],z=>{C=Le(C,z," ")}),g&&Ie?g.createHTML(C):C},t.setConfig=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ve(s),ye=!0},t.clearConfig=function(){Ee=null,ye=!1},t.isValidAttribute=function(s,e,n){Ee||Ve({});const o=A(s),h=A(e);return _t(o,h,n)},t.addHook=function(s,e){typeof e=="function"&&(L[s]=L[s]||[],we(L[s],e))},t.removeHook=function(s){if(L[s])return Dt(L[s])},t.removeHooks=function(s){L[s]&&(L[s]=[])},t.removeAllHooks=function(){L={}},t}var In=jt();function Mn(){pn(document.querySelectorAll("[data-inject-svg]"),{beforeEach(r){In.sanitize(r,{IN_PLACE:!0,USE_PROFILES:{svg:!0,svgFilters:!0}}),r.dataset.viewbox&&r.setAttribute("viewBox",r.dataset.viewbox),r.dataset.ariaLabel&&r.setAttribute("aria-label",r.dataset.ariaLabel),r.removeAttribute("id"),r.removeAttribute("data-inject-svg")},afterAll(r){console.debug(`Injected ${r} SVGs.`)}})}export{Mn as i};
