@tuongaz/seeflow 0.1.3 → 0.1.4

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.
@@ -1,3 +0,0 @@
1
- /*! @license DOMPurify 3.4.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.3/LICENSE */function Tt(n,o){(o==null||o>n.length)&&(o=n.length);for(var r=0,s=Array(o);r<o;r++)s[r]=n[r];return s}function Qt(n){if(Array.isArray(n))return n}function en(n,o){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var s,f,u,C,U=[],B=!0,v=!1;try{if(u=(r=r.call(n)).next,o!==0)for(;!(B=(s=u.call(r)).done)&&(U.push(s.value),U.length!==o);B=!0);}catch(se){v=!0,f=se}finally{try{if(!B&&r.return!=null&&(C=r.return(),Object(C)!==C))return}finally{if(v)throw f}}return U}}function tn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nn(n,o){return Qt(n)||en(n,o)||on(n,o)||tn()}function on(n,o){if(n){if(typeof n=="string")return Tt(n,o);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tt(n,o):void 0}}const Nt=Object.entries,gt=Object.setPrototypeOf,rn=Object.isFrozen,an=Object.getPrototypeOf,sn=Object.getOwnPropertyDescriptor;let O=Object.freeze,L=Object.seal,Z=Object.create,Lt=typeof Reflect<"u"&&Reflect,We=Lt.apply,je=Lt.construct;O||(O=function(o){return o});L||(L=function(o){return o});We||(We=function(o,r){for(var s=arguments.length,f=new Array(s>2?s-2:0),u=2;u<s;u++)f[u-2]=arguments[u];return o.apply(r,f)});je||(je=function(o){for(var r=arguments.length,s=new Array(r>1?r-1:0),f=1;f<r;f++)s[f-1]=arguments[f];return new o(...s)});const X=T(Array.prototype.forEach),ln=T(Array.prototype.lastIndexOf),_t=T(Array.prototype.pop),V=T(Array.prototype.push),cn=T(Array.prototype.splice),b=Array.isArray,ae=T(String.prototype.toLowerCase),Ue=T(String.prototype.toString),At=T(String.prototype.match),q=T(String.prototype.replace),Et=T(String.prototype.indexOf),fn=T(String.prototype.trim),un=T(Number.prototype.toString),mn=T(Boolean.prototype.toString),ht=typeof BigInt>"u"?null:T(BigInt.prototype.toString),St=typeof Symbol>"u"?null:T(Symbol.prototype.toString),m=T(Object.prototype.hasOwnProperty),re=T(Object.prototype.toString),S=T(RegExp.prototype.test),he=pn(TypeError);function T(n){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var r=arguments.length,s=new Array(r>1?r-1:0),f=1;f<r;f++)s[f-1]=arguments[f];return We(n,o,s)}}function pn(n){return function(){for(var o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];return je(n,r)}}function l(n,o){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ae;if(gt&&gt(n,null),!b(o))return n;let s=o.length;for(;s--;){let f=o[s];if(typeof f=="string"){const u=r(f);u!==f&&(rn(o)||(o[s]=u),f=u)}n[f]=!0}return n}function dn(n){for(let o=0;o<n.length;o++)m(n,o)||(n[o]=null);return n}function I(n){const o=Z(null);for(const s of Nt(n)){var r=nn(s,2);const f=r[0],u=r[1];m(n,f)&&(b(u)?o[f]=dn(u):u&&typeof u=="object"&&u.constructor===Object?o[f]=I(u):o[f]=u)}return o}function Tn(n){switch(typeof n){case"string":return n;case"number":return un(n);case"boolean":return mn(n);case"bigint":return ht?ht(n):"0";case"symbol":return St?St(n):"Symbol()";case"undefined":return re(n);case"function":case"object":{if(n===null)return re(n);const o=n,r=J(o,"toString");if(typeof r=="function"){const s=r(o);return typeof s=="string"?s:re(s)}return re(n)}default:return re(n)}}function J(n,o){for(;n!==null;){const s=sn(n,o);if(s){if(s.get)return T(s.get);if(typeof s.value=="function")return T(s.value)}n=an(n)}function r(){return null}return r}function gn(n){try{return S(n,""),!0}catch{return!1}}const yt=O(["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"]),He=O(["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"]),ze=O(["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=O(["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"]),Ge=O(["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"]),An=O(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rt=O(["#text"]),bt=O(["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"]),Be=O(["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"]),Ot=O(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Se=O(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),En=L(/{{[\w\W]*|^[\w\W]*}}/g),hn=L(/<%[\w\W]*|^[\w\W]*%>/g),Sn=L(/\${[\w\W]*/g),yn=L(/^data-[\-\w.\u00B7-\uFFFF]+$/),Rn=L(/^aria-[\-\w]+$/),Dt=L(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bn=L(/^(?:\w+script|data):/i),On=L(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Dn=L(/^html$/i),In=L(/^[a-z][.\w]*(-[.\w]+)+$/i),K={element:1,text:3,progressingInstruction:7,comment:8,document:9},Nn=function(){return typeof window>"u"?null:window},Ln=function(o,r){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let s=null;const f="data-tt-policy-suffix";r&&r.hasAttribute(f)&&(s=r.getAttribute(f));const u="dompurify"+(s?"#"+s:"");try{return o.createPolicy(u,{createHTML(C){return C},createScriptURL(C){return C}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},It=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ct(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nn();const o=a=>Ct(a);if(o.version="3.4.3",o.removed=[],!n||!n.document||n.document.nodeType!==K.document||!n.Element)return o.isSupported=!1,o;let r=n.document;const s=r,f=s.currentScript,u=n.DocumentFragment,C=n.HTMLTemplateElement,U=n.Node,B=n.Element,v=n.NodeFilter,se=n.NamedNodeMap,Mt=se===void 0?n.NamedNodeMap||n.MozNamedAttrMap:se,wt=n.HTMLFormElement,xt=n.DOMParser,le=n.trustedTypes,Q=B.prototype,Pt=J(Q,"cloneNode"),kt=J(Q,"remove"),vt=J(Q,"nextSibling"),Ft=J(Q,"childNodes"),ce=J(Q,"parentNode");if(typeof C=="function"){const a=r.createElement("template");a.content&&a.content.ownerDocument&&(r=a.content.ownerDocument)}let y,ee="";const fe=r,ye=fe.implementation,Ut=fe.createNodeIterator,Ht=fe.createDocumentFragment,zt=fe.getElementsByTagName,Gt=s.importNode;let R=It();o.isSupported=typeof Nt=="function"&&typeof ce=="function"&&ye&&ye.createHTMLDocument!==void 0;const ue=En,me=hn,pe=Sn,Bt=yn,Wt=Rn,jt=bn,Ye=On,Yt=In;let $e=Dt,_=null;const Xe=l({},[...yt,...He,...ze,...Ge,...Rt]);let h=null;const Ve=l({},[...bt,...Be,...Ot,...Se]);let p=Object.seal(Z(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}})),te=null,de=null;const F=Object.seal(Z(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let qe=!0,Re=!0,Ke=!1,Ze=!0,H=!1,ne=!0,z=!1,be=!1,Oe=!1,W=!1,Te=!1,ge=!1,Je=!0,Qe=!1;const et="user-content-";let De=!0,oe=!1,j={},x=null;const Ie=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"]);let tt=null;const nt=l({},["audio","video","img","source","image","track"]);let Ne=null;const ot=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_e="http://www.w3.org/1998/Math/MathML",Ae="http://www.w3.org/2000/svg",P="http://www.w3.org/1999/xhtml";let Y=P,Le=!1,Ce=null;const $t=l({},[_e,Ae,P],Ue);let Me=l({},["mi","mo","mn","ms","mtext"]),we=l({},["annotation-xml"]);const Xt=l({},["title","style","font","a","script"]);let ie=null;const Vt=["application/xhtml+xml","text/html"],qt="text/html";let g=null,$=null;const Kt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},xe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if($&&$===e)return;(!e||typeof e!="object")&&(e={}),e=I(e),ie=Vt.indexOf(e.PARSER_MEDIA_TYPE)===-1?qt:e.PARSER_MEDIA_TYPE,g=ie==="application/xhtml+xml"?Ue:ae,_=m(e,"ALLOWED_TAGS")&&b(e.ALLOWED_TAGS)?l({},e.ALLOWED_TAGS,g):Xe,h=m(e,"ALLOWED_ATTR")&&b(e.ALLOWED_ATTR)?l({},e.ALLOWED_ATTR,g):Ve,Ce=m(e,"ALLOWED_NAMESPACES")&&b(e.ALLOWED_NAMESPACES)?l({},e.ALLOWED_NAMESPACES,Ue):$t,Ne=m(e,"ADD_URI_SAFE_ATTR")&&b(e.ADD_URI_SAFE_ATTR)?l(I(ot),e.ADD_URI_SAFE_ATTR,g):ot,tt=m(e,"ADD_DATA_URI_TAGS")&&b(e.ADD_DATA_URI_TAGS)?l(I(nt),e.ADD_DATA_URI_TAGS,g):nt,x=m(e,"FORBID_CONTENTS")&&b(e.FORBID_CONTENTS)?l({},e.FORBID_CONTENTS,g):Ie,te=m(e,"FORBID_TAGS")&&b(e.FORBID_TAGS)?l({},e.FORBID_TAGS,g):I({}),de=m(e,"FORBID_ATTR")&&b(e.FORBID_ATTR)?l({},e.FORBID_ATTR,g):I({}),j=m(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?I(e.USE_PROFILES):e.USE_PROFILES:!1,qe=e.ALLOW_ARIA_ATTR!==!1,Re=e.ALLOW_DATA_ATTR!==!1,Ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,ne=e.SAFE_FOR_XML!==!1,z=e.WHOLE_DOCUMENT||!1,W=e.RETURN_DOM||!1,Te=e.RETURN_DOM_FRAGMENT||!1,ge=e.RETURN_TRUSTED_TYPE||!1,Oe=e.FORCE_BODY||!1,Je=e.SANITIZE_DOM!==!1,Qe=e.SANITIZE_NAMED_PROPS||!1,De=e.KEEP_CONTENT!==!1,oe=e.IN_PLACE||!1,$e=gn(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Dt,Y=typeof e.NAMESPACE=="string"?e.NAMESPACE:P,Me=m(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS=="object"?I(e.MATHML_TEXT_INTEGRATION_POINTS):l({},["mi","mo","mn","ms","mtext"]),we=m(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS=="object"?I(e.HTML_INTEGRATION_POINTS):l({},["annotation-xml"]);const t=m(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING=="object"?I(e.CUSTOM_ELEMENT_HANDLING):Z(null);if(p=Z(null),m(t,"tagNameCheck")&&it(t.tagNameCheck)&&(p.tagNameCheck=t.tagNameCheck),m(t,"attributeNameCheck")&&it(t.attributeNameCheck)&&(p.attributeNameCheck=t.attributeNameCheck),m(t,"allowCustomizedBuiltInElements")&&typeof t.allowCustomizedBuiltInElements=="boolean"&&(p.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),H&&(Re=!1),Te&&(W=!0),j&&(_=l({},Rt),h=Z(null),j.html===!0&&(l(_,yt),l(h,bt)),j.svg===!0&&(l(_,He),l(h,Be),l(h,Se)),j.svgFilters===!0&&(l(_,ze),l(h,Be),l(h,Se)),j.mathMl===!0&&(l(_,Ge),l(h,Ot),l(h,Se))),F.tagCheck=null,F.attributeCheck=null,m(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?F.tagCheck=e.ADD_TAGS:b(e.ADD_TAGS)&&(_===Xe&&(_=I(_)),l(_,e.ADD_TAGS,g))),m(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?F.attributeCheck=e.ADD_ATTR:b(e.ADD_ATTR)&&(h===Ve&&(h=I(h)),l(h,e.ADD_ATTR,g))),m(e,"ADD_URI_SAFE_ATTR")&&b(e.ADD_URI_SAFE_ATTR)&&l(Ne,e.ADD_URI_SAFE_ATTR,g),m(e,"FORBID_CONTENTS")&&b(e.FORBID_CONTENTS)&&(x===Ie&&(x=I(x)),l(x,e.FORBID_CONTENTS,g)),m(e,"ADD_FORBID_CONTENTS")&&b(e.ADD_FORBID_CONTENTS)&&(x===Ie&&(x=I(x)),l(x,e.ADD_FORBID_CONTENTS,g)),De&&(_["#text"]=!0),z&&l(_,["html","head","body"]),_.table&&(l(_,["tbody"]),delete te.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=e.TRUSTED_TYPES_POLICY,ee=y.createHTML("")}else y===void 0&&(y=Ln(le,f)),y!==null&&typeof ee=="string"&&(ee=y.createHTML(""));O&&O(e),$=e},rt=l({},[...He,...ze,..._n]),at=l({},[...Ge,...An]),Zt=function(e){let t=ce(e);(!t||!t.tagName)&&(t={namespaceURI:Y,tagName:"template"});const i=ae(e.tagName),c=ae(t.tagName);return Ce[e.namespaceURI]?e.namespaceURI===Ae?t.namespaceURI===P?i==="svg":t.namespaceURI===_e?i==="svg"&&(c==="annotation-xml"||Me[c]):!!rt[i]:e.namespaceURI===_e?t.namespaceURI===P?i==="math":t.namespaceURI===Ae?i==="math"&&we[c]:!!at[i]:e.namespaceURI===P?t.namespaceURI===Ae&&!we[c]||t.namespaceURI===_e&&!Me[c]?!1:!at[i]&&(Xt[i]||!rt[i]):!!(ie==="application/xhtml+xml"&&Ce[e.namespaceURI]):!1},M=function(e){V(o.removed,{element:e});try{ce(e).removeChild(e)}catch{kt(e)}},G=function(e,t){try{V(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(W||Te)try{M(t)}catch{}else try{t.setAttribute(e,"")}catch{}},st=function(e){let t=null,i=null;if(Oe)e="<remove></remove>"+e;else{const d=At(e,/^[\r\n\t ]+/);i=d&&d[0]}ie==="application/xhtml+xml"&&Y===P&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=y?y.createHTML(e):e;if(Y===P)try{t=new xt().parseFromString(c,ie)}catch{}if(!t||!t.documentElement){t=ye.createDocument(Y,"template",null);try{t.documentElement.innerHTML=Le?ee:c}catch{}}const A=t.body||t.documentElement;return e&&i&&A.insertBefore(r.createTextNode(i),A.childNodes[0]||null),Y===P?zt.call(t,z?"html":"body")[0]:z?t.documentElement:A},lt=function(e){return Ut.call(e.ownerDocument||e,e,v.SHOW_ELEMENT|v.SHOW_COMMENT|v.SHOW_TEXT|v.SHOW_PROCESSING_INSTRUCTION|v.SHOW_CDATA_SECTION,null)},Pe=function(e){return e instanceof wt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Mt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},ke=function(e){return typeof U=="function"&&e instanceof U};function k(a,e,t){X(a,i=>{i.call(o,e,t,$)})}const ct=function(e){let t=null;if(k(R.beforeSanitizeElements,e,null),Pe(e))return M(e),!0;const i=g(e.nodeName);if(k(R.uponSanitizeElement,e,{tagName:i,allowedTags:_}),ne&&e.hasChildNodes()&&!ke(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||ne&&e.namespaceURI===P&&i==="style"&&ke(e.firstElementChild)||e.nodeType===K.progressingInstruction||ne&&e.nodeType===K.comment&&S(/<[/\w]/g,e.data))return M(e),!0;if(te[i]||!(F.tagCheck instanceof Function&&F.tagCheck(i))&&!_[i]){if(!te[i]&&ut(i)&&(p.tagNameCheck instanceof RegExp&&S(p.tagNameCheck,i)||p.tagNameCheck instanceof Function&&p.tagNameCheck(i)))return!1;if(De&&!x[i]){const c=ce(e)||e.parentNode,A=Ft(e)||e.childNodes;if(A&&c){const d=A.length;for(let D=d-1;D>=0;--D){const N=Pt(A[D],!0);c.insertBefore(N,vt(e))}}}return M(e),!0}return e instanceof B&&!Zt(e)||(i==="noscript"||i==="noembed"||i==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(M(e),!0):(H&&e.nodeType===K.text&&(t=e.textContent,X([ue,me,pe],c=>{t=q(t,c," ")}),e.textContent!==t&&(V(o.removed,{element:e.cloneNode()}),e.textContent=t)),k(R.afterSanitizeElements,e,null),!1)},ft=function(e,t,i){if(de[t]||Je&&(t==="id"||t==="name")&&(i in r||i in Kt))return!1;const c=h[t]||F.attributeCheck instanceof Function&&F.attributeCheck(t,e);if(!(Re&&!de[t]&&S(Bt,t))){if(!(qe&&S(Wt,t))){if(!c||de[t]){if(!(ut(e)&&(p.tagNameCheck instanceof RegExp&&S(p.tagNameCheck,e)||p.tagNameCheck instanceof Function&&p.tagNameCheck(e))&&(p.attributeNameCheck instanceof RegExp&&S(p.attributeNameCheck,t)||p.attributeNameCheck instanceof Function&&p.attributeNameCheck(t,e))||t==="is"&&p.allowCustomizedBuiltInElements&&(p.tagNameCheck instanceof RegExp&&S(p.tagNameCheck,i)||p.tagNameCheck instanceof Function&&p.tagNameCheck(i))))return!1}else if(!Ne[t]){if(!S($e,q(i,Ye,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Et(i,"data:")===0&&tt[e])){if(!(Ke&&!S(jt,q(i,Ye,"")))){if(i)return!1}}}}}}return!0},Jt=l({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ut=function(e){return!Jt[ae(e)]&&S(Yt,e)},mt=function(e){k(R.beforeSanitizeAttributes,e,null);const t=e.attributes;if(!t||Pe(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:h,forceKeepAttr:void 0};let c=t.length;for(;c--;){const A=t[c],d=A.name,D=A.namespaceURI,N=A.value,w=g(d),Fe=N;let E=d==="value"?Fe:fn(Fe);if(i.attrName=w,i.attrValue=E,i.keepAttr=!0,i.forceKeepAttr=void 0,k(R.uponSanitizeAttribute,e,i),E=i.attrValue,Qe&&(w==="id"||w==="name")&&Et(E,et)!==0&&(G(d,e),E=et+E),ne&&S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,E)){G(d,e);continue}if(w==="attributename"&&At(E,"href")){G(d,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){G(d,e);continue}if(!Ze&&S(/\/>/i,E)){G(d,e);continue}H&&X([ue,me,pe],dt=>{E=q(E,dt," ")});const pt=g(e.nodeName);if(!ft(pt,w,E)){G(d,e);continue}if(y&&typeof le=="object"&&typeof le.getAttributeType=="function"&&!D)switch(le.getAttributeType(pt,w)){case"TrustedHTML":{E=y.createHTML(E);break}case"TrustedScriptURL":{E=y.createScriptURL(E);break}}if(E!==Fe)try{D?e.setAttributeNS(D,d,E):e.setAttribute(d,E),Pe(e)?M(e):_t(o.removed)}catch{G(d,e)}}k(R.afterSanitizeAttributes,e,null)},ve=function(e){let t=null;const i=lt(e);for(k(R.beforeSanitizeShadowDOM,e,null);t=i.nextNode();)k(R.uponSanitizeShadowNode,t,null),ct(t),mt(t),t.content instanceof u&&ve(t.content);k(R.afterSanitizeShadowDOM,e,null)},Ee=function(e){if(e.nodeType===K.element&&e.shadowRoot instanceof u){const c=e.shadowRoot;Ee(c),ve(c)}const t=e.childNodes;if(!t)return;const i=[];X(t,c=>{V(i,c)});for(const c of i)Ee(c)};return o.sanitize=function(a){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,i=null,c=null,A=null;if(Le=!a,Le&&(a="<!-->"),typeof a!="string"&&!ke(a)&&(a=Tn(a),typeof a!="string"))throw he("dirty is not a string, aborting");if(!o.isSupported)return a;if(be||xe(e),o.removed=[],typeof a=="string"&&(oe=!1),oe){const N=a.nodeName;if(typeof N=="string"){const w=g(N);if(!_[w]||te[w])throw he("root node is forbidden and cannot be sanitized in-place")}Ee(a)}else if(a instanceof U)t=st("<!---->"),i=t.ownerDocument.importNode(a,!0),i.nodeType===K.element&&i.nodeName==="BODY"||i.nodeName==="HTML"?t=i:t.appendChild(i),Ee(i);else{if(!W&&!H&&!z&&a.indexOf("<")===-1)return y&&ge?y.createHTML(a):a;if(t=st(a),!t)return W?null:ge?ee:""}t&&Oe&&M(t.firstChild);const d=lt(oe?a:t);for(;c=d.nextNode();)ct(c),mt(c),c.content instanceof u&&ve(c.content);if(oe)return a;if(W){if(H){t.normalize();let N=t.innerHTML;X([ue,me,pe],w=>{N=q(N,w," ")}),t.innerHTML=N}if(Te)for(A=Ht.call(t.ownerDocument);t.firstChild;)A.appendChild(t.firstChild);else A=t;return(h.shadowroot||h.shadowrootmode)&&(A=Gt.call(s,A,!0)),A}let D=z?t.outerHTML:t.innerHTML;return z&&_["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&S(Dn,t.ownerDocument.doctype.name)&&(D="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
3
- `+D),H&&X([ue,me,pe],N=>{D=q(D,N," ")}),y&&ge?y.createHTML(D):D},o.setConfig=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xe(a),be=!0},o.clearConfig=function(){$=null,be=!1},o.isValidAttribute=function(a,e,t){$||xe({});const i=g(a),c=g(e);return ft(i,c,t)},o.addHook=function(a,e){typeof e=="function"&&V(R[a],e)},o.removeHook=function(a,e){if(e!==void 0){const t=ln(R[a],e);return t===-1?void 0:cn(R[a],t,1)[0]}return _t(R[a])},o.removeHooks=function(a){R[a]=[]},o.removeAllHooks=function(){R=It()},o}var Cn=Ct();export{Cn as default};