@iqmo/browser
Version:
Browser Stlite
3 lines (2 loc) • 22.6 kB
JavaScript
import{c as Xe,r as ie,j as Rt}from"./index-C9lG8Cnd.js";/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:le,setPrototypeOf:se,isFrozen:qe,getPrototypeOf:$e,getOwnPropertyDescriptor:Ke}=Object;let{freeze:y,seal:b,create:ce}=Object,{apply:wt,construct:Ot}=typeof Reflect<"u"&&Reflect;y||(y=function(r){return r}),b||(b=function(r){return r}),wt||(wt=function(r,o,i){return r.apply(o,i)}),Ot||(Ot=function(r,o){return new r(...o)});const it=_(Array.prototype.forEach),Ve=_(Array.prototype.lastIndexOf),ue=_(Array.prototype.pop),X=_(Array.prototype.push),Ze=_(Array.prototype.splice),lt=_(String.prototype.toLowerCase),Lt=_(String.prototype.toString),me=_(String.prototype.match),q=_(String.prototype.replace),Je=_(String.prototype.indexOf),Qe=_(String.prototype.trim),S=_(Object.prototype.hasOwnProperty),A=_(RegExp.prototype.test),$=tn(TypeError);function _(r){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var i=arguments.length,l=new Array(i>1?i-1:0),h=1;h<i;h++)l[h-1]=arguments[h];return wt(r,o,l)}}function tn(r){return function(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return Ot(r,i)}}function a(r,o){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt;se&&se(r,null);let l=o.length;for(;l--;){let h=o[l];if(typeof h=="string"){const R=i(h);R!==h&&(qe(o)||(o[l]=R),h=R)}r[h]=!0}return r}function en(r){for(let o=0;o<r.length;o++)S(r,o)||(r[o]=null);return r}function D(r){const o=ce(null);for(const[i,l]of le(r))S(r,i)&&(Array.isArray(l)?o[i]=en(l):l&&typeof l=="object"&&l.constructor===Object?o[i]=D(l):o[i]=l);return o}function K(r,o){for(;r!==null;){const l=Ke(r,o);if(l){if(l.get)return _(l.get);if(typeof l.value=="function")return _(l.value)}r=$e(r)}function i(){return null}return i}const pe=y(["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"]),vt=y(["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"]),Dt=y(["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"]),nn=y(["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"]),Ct=y(["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"]),on=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fe=y(["#text"]),de=y(["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"]),xt=y(["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"]),ge=y(["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"]),st=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),an=b(/<%[\w\W]*|[\w\W]*%>/gm),ln=b(/\$\{[\w\W]*/gm),sn=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),cn=b(/^aria-[\-\w]+$/),he=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=b(/^(?:\w+script|data):/i),mn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Te=b(/^html$/i),pn=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ee=Object.freeze({__proto__:null,ARIA_ATTR:cn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:sn,DOCTYPE_NAME:Te,ERB_EXPR:an,IS_ALLOWED_URI:he,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const V={element:1,text:3,progressingInstruction:7,comment:8,document:9},fn=function(){return typeof window>"u"?null:window},dn=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let i=null;const l="data-tt-policy-suffix";o&&o.hasAttribute(l)&&(i=o.getAttribute(l));const h="dompurify"+(i?"#"+i:"");try{return r.createPolicy(h,{createHTML(R){return R},createScriptURL(R){return R}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},ye=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ae(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fn();const o=t=>Ae(t);if(o.version="3.2.6",o.removed=[],!r||!r.document||r.document.nodeType!==V.document||!r.Element)return o.isSupported=!1,o;let{document:i}=r;const l=i,h=l.currentScript,{DocumentFragment:R,HTMLTemplateElement:_e,Node:ct,Element:Mt,NodeFilter:F,NamedNodeMap:be=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:Ne,DOMParser:Se,trustedTypes:Z}=r,W=Mt.prototype,Re=K(W,"cloneNode"),we=K(W,"remove"),Oe=K(W,"nextSibling"),Le=K(W,"childNodes"),J=K(W,"parentNode");if(typeof _e=="function"){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let T,B="";const{implementation:ut,createNodeIterator:ve,createDocumentFragment:De,getElementsByTagName:Ce}=i,{importNode:xe}=l;let E=ye();o.isSupported=typeof le=="function"&&typeof J=="function"&&ut&&ut.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:mt,ERB_EXPR:pt,TMPLIT_EXPR:ft,DATA_ATTR:ke,ARIA_ATTR:Ie,IS_SCRIPT_OR_DATA:Me,ATTR_WHITESPACE:Ut,CUSTOM_ELEMENT:Ue}=Ee;let{IS_ALLOWED_URI:Pt}=Ee,m=null;const Ht=a({},[...pe,...vt,...Dt,...Ct,...fe]);let f=null;const zt=a({},[...de,...xt,...ge,...st]);let u=Object.seal(ce(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}})),G=null,dt=null,Ft=!0,gt=!0,Wt=!1,Bt=!0,k=!1,Q=!0,C=!1,ht=!1,Tt=!1,I=!1,tt=!1,et=!1,Gt=!0,Yt=!1;const Pe="user-content-";let Et=!0,Y=!1,M={},U=null;const jt=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"]);let Xt=null;const qt=a({},["audio","video","img","source","image","track"]);let yt=null;const $t=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",O="http://www.w3.org/1999/xhtml";let P=O,At=!1,_t=null;const He=a({},[nt,ot,O],Lt);let rt=a({},["mi","mo","mn","ms","mtext"]),at=a({},["annotation-xml"]);const ze=a({},["title","style","font","a","script"]);let j=null;const Fe=["application/xhtml+xml","text/html"],We="text/html";let p=null,H=null;const Be=i.createElement("form"),Kt=function(t){return t instanceof RegExp||t instanceof Function},bt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===t)){if((!t||typeof t!="object")&&(t={}),t=D(t),j=Fe.indexOf(t.PARSER_MEDIA_TYPE)===-1?We:t.PARSER_MEDIA_TYPE,p=j==="application/xhtml+xml"?Lt:lt,m=S(t,"ALLOWED_TAGS")?a({},t.ALLOWED_TAGS,p):Ht,f=S(t,"ALLOWED_ATTR")?a({},t.ALLOWED_ATTR,p):zt,_t=S(t,"ALLOWED_NAMESPACES")?a({},t.ALLOWED_NAMESPACES,Lt):He,yt=S(t,"ADD_URI_SAFE_ATTR")?a(D($t),t.ADD_URI_SAFE_ATTR,p):$t,Xt=S(t,"ADD_DATA_URI_TAGS")?a(D(qt),t.ADD_DATA_URI_TAGS,p):qt,U=S(t,"FORBID_CONTENTS")?a({},t.FORBID_CONTENTS,p):jt,G=S(t,"FORBID_TAGS")?a({},t.FORBID_TAGS,p):D({}),dt=S(t,"FORBID_ATTR")?a({},t.FORBID_ATTR,p):D({}),M=S(t,"USE_PROFILES")?t.USE_PROFILES:!1,Ft=t.ALLOW_ARIA_ATTR!==!1,gt=t.ALLOW_DATA_ATTR!==!1,Wt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Bt=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=t.SAFE_FOR_TEMPLATES||!1,Q=t.SAFE_FOR_XML!==!1,C=t.WHOLE_DOCUMENT||!1,I=t.RETURN_DOM||!1,tt=t.RETURN_DOM_FRAGMENT||!1,et=t.RETURN_TRUSTED_TYPE||!1,Tt=t.FORCE_BODY||!1,Gt=t.SANITIZE_DOM!==!1,Yt=t.SANITIZE_NAMED_PROPS||!1,Et=t.KEEP_CONTENT!==!1,Y=t.IN_PLACE||!1,Pt=t.ALLOWED_URI_REGEXP||he,P=t.NAMESPACE||O,rt=t.MATHML_TEXT_INTEGRATION_POINTS||rt,at=t.HTML_INTEGRATION_POINTS||at,u=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Kt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Kt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),k&&(gt=!1),tt&&(I=!0),M&&(m=a({},fe),f=[],M.html===!0&&(a(m,pe),a(f,de)),M.svg===!0&&(a(m,vt),a(f,xt),a(f,st)),M.svgFilters===!0&&(a(m,Dt),a(f,xt),a(f,st)),M.mathMl===!0&&(a(m,Ct),a(f,ge),a(f,st))),t.ADD_TAGS&&(m===Ht&&(m=D(m)),a(m,t.ADD_TAGS,p)),t.ADD_ATTR&&(f===zt&&(f=D(f)),a(f,t.ADD_ATTR,p)),t.ADD_URI_SAFE_ATTR&&a(yt,t.ADD_URI_SAFE_ATTR,p),t.FORBID_CONTENTS&&(U===jt&&(U=D(U)),a(U,t.FORBID_CONTENTS,p)),Et&&(m["#text"]=!0),C&&a(m,["html","head","body"]),m.table&&(a(m,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=t.TRUSTED_TYPES_POLICY,B=T.createHTML("")}else T===void 0&&(T=dn(Z,h)),T!==null&&typeof B=="string"&&(B=T.createHTML(""));y&&y(t),H=t}},Vt=a({},[...vt,...Dt,...nn]),Zt=a({},[...Ct,...on]),Ge=function(t){let n=J(t);(!n||!n.tagName)&&(n={namespaceURI:P,tagName:"template"});const e=lt(t.tagName),s=lt(n.tagName);return _t[t.namespaceURI]?t.namespaceURI===ot?n.namespaceURI===O?e==="svg":n.namespaceURI===nt?e==="svg"&&(s==="annotation-xml"||rt[s]):!!Vt[e]:t.namespaceURI===nt?n.namespaceURI===O?e==="math":n.namespaceURI===ot?e==="math"&&at[s]:!!Zt[e]:t.namespaceURI===O?n.namespaceURI===ot&&!at[s]||n.namespaceURI===nt&&!rt[s]?!1:!Zt[e]&&(ze[e]||!Vt[e]):!!(j==="application/xhtml+xml"&&_t[t.namespaceURI]):!1},x=function(t){X(o.removed,{element:t});try{J(t).removeChild(t)}catch{we(t)}},z=function(t,n){try{X(o.removed,{attribute:n.getAttributeNode(t),from:n})}catch{X(o.removed,{attribute:null,from:n})}if(n.removeAttribute(t),t==="is")if(I||tt)try{x(n)}catch{}else try{n.setAttribute(t,"")}catch{}},Jt=function(t){let n=null,e=null;if(Tt)t="<remove></remove>"+t;else{const c=me(t,/^[\r\n\t ]+/);e=c&&c[0]}j==="application/xhtml+xml"&&P===O&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const s=T?T.createHTML(t):t;if(P===O)try{n=new Se().parseFromString(s,j)}catch{}if(!n||!n.documentElement){n=ut.createDocument(P,"template",null);try{n.documentElement.innerHTML=At?B:s}catch{}}const d=n.body||n.documentElement;return t&&e&&d.insertBefore(i.createTextNode(e),d.childNodes[0]||null),P===O?Ce.call(n,C?"html":"body")[0]:C?n.documentElement:d},Qt=function(t){return ve.call(t.ownerDocument||t,t,F.SHOW_ELEMENT|F.SHOW_COMMENT|F.SHOW_TEXT|F.SHOW_PROCESSING_INSTRUCTION|F.SHOW_CDATA_SECTION,null)},Nt=function(t){return t instanceof Ne&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof be)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},te=function(t){return typeof ct=="function"&&t instanceof ct};function L(t,n,e){it(t,s=>{s.call(o,n,e,H)})}const ee=function(t){let n=null;if(L(E.beforeSanitizeElements,t,null),Nt(t))return x(t),!0;const e=p(t.nodeName);if(L(E.uponSanitizeElement,t,{tagName:e,allowedTags:m}),Q&&t.hasChildNodes()&&!te(t.firstElementChild)&&A(/<[/\w!]/g,t.innerHTML)&&A(/<[/\w!]/g,t.textContent)||t.nodeType===V.progressingInstruction||Q&&t.nodeType===V.comment&&A(/<[/\w]/g,t.data))return x(t),!0;if(!m[e]||G[e]){if(!G[e]&&oe(e)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e)))return!1;if(Et&&!U[e]){const s=J(t)||t.parentNode,d=Le(t)||t.childNodes;if(d&&s){const c=d.length;for(let v=c-1;v>=0;--v){const N=Re(d[v],!0);N.__removalCount=(t.__removalCount||0)+1,s.insertBefore(N,Oe(t))}}}return x(t),!0}return t instanceof Mt&&!Ge(t)||(e==="noscript"||e==="noembed"||e==="noframes")&&A(/<\/no(script|embed|frames)/i,t.innerHTML)?(x(t),!0):(k&&t.nodeType===V.text&&(n=t.textContent,it([mt,pt,ft],s=>{n=q(n,s," ")}),t.textContent!==n&&(X(o.removed,{element:t.cloneNode()}),t.textContent=n)),L(E.afterSanitizeElements,t,null),!1)},ne=function(t,n,e){if(Gt&&(n==="id"||n==="name")&&(e in i||e in Be))return!1;if(!(gt&&!dt[n]&&A(ke,n))&&!(Ft&&A(Ie,n))){if(!f[n]||dt[n]){if(!(oe(t)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,t)||u.tagNameCheck instanceof Function&&u.tagNameCheck(t))&&(u.attributeNameCheck instanceof RegExp&&A(u.attributeNameCheck,n)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(n))||n==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))))return!1}else if(!yt[n]&&!A(Pt,q(e,Ut,""))&&!((n==="src"||n==="xlink:href"||n==="href")&&t!=="script"&&Je(e,"data:")===0&&Xt[t])&&!(Wt&&!A(Me,q(e,Ut,"")))&&e)return!1}return!0},oe=function(t){return t!=="annotation-xml"&&me(t,Ue)},re=function(t){L(E.beforeSanitizeAttributes,t,null);const{attributes:n}=t;if(!n||Nt(t))return;const e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:f,forceKeepAttr:void 0};let s=n.length;for(;s--;){const d=n[s],{name:c,namespaceURI:v,value:N}=d,w=p(c),St=N;let g=c==="value"?St:Qe(St);if(e.attrName=w,e.attrValue=g,e.keepAttr=!0,e.forceKeepAttr=void 0,L(E.uponSanitizeAttribute,t,e),g=e.attrValue,Yt&&(w==="id"||w==="name")&&(z(c,t),g=Pe+g),Q&&A(/((--!?|])>)|<\/(style|title)/i,g)){z(c,t);continue}if(e.forceKeepAttr)continue;if(!e.keepAttr){z(c,t);continue}if(!Bt&&A(/\/>/i,g)){z(c,t);continue}k&&it([mt,pt,ft],je=>{g=q(g,je," ")});const ae=p(t.nodeName);if(!ne(ae,w,g)){z(c,t);continue}if(T&&typeof Z=="object"&&typeof Z.getAttributeType=="function"&&!v)switch(Z.getAttributeType(ae,w)){case"TrustedHTML":{g=T.createHTML(g);break}case"TrustedScriptURL":{g=T.createScriptURL(g);break}}if(g!==St)try{v?t.setAttributeNS(v,c,g):t.setAttribute(c,g),Nt(t)?x(t):ue(o.removed)}catch{z(c,t)}}L(E.afterSanitizeAttributes,t,null)},Ye=function t(n){let e=null;const s=Qt(n);for(L(E.beforeSanitizeShadowDOM,n,null);e=s.nextNode();)L(E.uponSanitizeShadowNode,e,null),ee(e),re(e),e.content instanceof R&&t(e.content);L(E.afterSanitizeShadowDOM,n,null)};return o.sanitize=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,s=null,d=null,c=null;if(At=!t,At&&(t="<!-->"),typeof t!="string"&&!te(t))if(typeof t.toString=="function"){if(t=t.toString(),typeof t!="string")throw $("dirty is not a string, aborting")}else throw $("toString is not a function");if(!o.isSupported)return t;if(ht||bt(n),o.removed=[],typeof t=="string"&&(Y=!1),Y){if(t.nodeName){const w=p(t.nodeName);if(!m[w]||G[w])throw $("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof ct)e=Jt("<!---->"),s=e.ownerDocument.importNode(t,!0),s.nodeType===V.element&&s.nodeName==="BODY"||s.nodeName==="HTML"?e=s:e.appendChild(s);else{if(!I&&!k&&!C&&t.indexOf("<")===-1)return T&&et?T.createHTML(t):t;if(e=Jt(t),!e)return I?null:et?B:""}e&&Tt&&x(e.firstChild);const v=Qt(Y?t:e);for(;d=v.nextNode();)ee(d),re(d),d.content instanceof R&&Ye(d.content);if(Y)return t;if(I){if(tt)for(c=De.call(e.ownerDocument);e.firstChild;)c.appendChild(e.firstChild);else c=e;return(f.shadowroot||f.shadowrootmode)&&(c=xe.call(l,c,!0)),c}let N=C?e.outerHTML:e.innerHTML;return C&&m["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&A(Te,e.ownerDocument.doctype.name)&&(N="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
`+N),k&&it([mt,pt,ft],w=>{N=q(N,w," ")}),T&&et?T.createHTML(N):N},o.setConfig=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bt(t),ht=!0},o.clearConfig=function(){H=null,ht=!1},o.isValidAttribute=function(t,n,e){H||bt({});const s=p(t),d=p(n);return ne(s,d,e)},o.addHook=function(t,n){typeof n=="function"&&X(E[t],n)},o.removeHook=function(t,n){if(n!==void 0){const e=Ve(E[t],n);return e===-1?void 0:Ze(E[t],e,1)[0]}return ue(E[t])},o.removeHooks=function(t){E[t]=[]},o.removeAllHooks=function(){E=ye()},o}var kt=Ae();const gn=Xe("div",{target:"e18540fl0"})({name:"1d3w5wq",styles:"width:100%"}),It="data-temp-href-target";kt.addHook("beforeSanitizeAttributes",function(r){r instanceof HTMLElement&&r.hasAttribute("target")&&r.getAttribute("target")==="_blank"&&r.setAttribute(It,"_blank")}),kt.addHook("afterSanitizeAttributes",function(r){r instanceof HTMLElement&&r.hasAttribute(It)&&(r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer"),r.removeAttribute(It))});const hn=r=>{const o={USE_PROFILES:{html:!0},FORCE_BODY:!0};return kt.sanitize(r,o)};function Tn({element:r}){const{body:o}=r,i=ie.useMemo(()=>hn(o),[o]);return Rt.jsx(Rt.Fragment,{children:i&&Rt.jsx(gn,{className:"stHtml","data-testid":"stHtml",dangerouslySetInnerHTML:{__html:i}})})}const En=ie.memo(Tn);export{En as default};