hrms-manual/dist/assets/purify.es-4f9a0368-a1e00f5d.js
2023-09-06 14:51:44 +07:00

3 lines
21 KiB
JavaScript

/*! @license DOMPurify 2.4.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.5/LICENSE */function O(n){return O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},O(n)}function Ct(n,o){return Ct=Object.setPrototypeOf||function(a,l){return a.__proto__=l,a},Ct(n,o)}function Fe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function at(n,o,a){return Fe()?at=Reflect.construct:at=function(l,m,N){var D=[null];D.push.apply(D,m);var K=Function.bind.apply(l,D),I=new K;return N&&Ct(I,N.prototype),I},at.apply(null,arguments)}function w(n){return Ue(n)||He(n)||ze(n)||Pe()}function Ue(n){if(Array.isArray(n))return Mt(n)}function He(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ze(n,o){if(n){if(typeof n=="string")return Mt(n,o);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(n);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Mt(n,o)}}function Mt(n,o){(o==null||o>n.length)&&(o=n.length);for(var a=0,l=new Array(o);a<o;a++)l[a]=n[a];return l}function Pe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var je=Object.hasOwnProperty,ie=Object.setPrototypeOf,Be=Object.isFrozen,Ge=Object.getPrototypeOf,We=Object.getOwnPropertyDescriptor,y=Object.freeze,S=Object.seal,qe=Object.create,pe=typeof Reflect<"u"&&Reflect,lt=pe.apply,It=pe.construct;lt||(lt=function(n,o,a){return n.apply(o,a)});y||(y=function(n){return n});S||(S=function(n){return n});It||(It=function(n,o){return at(n,w(o))});var Ye=E(Array.prototype.forEach),le=E(Array.prototype.pop),$=E(Array.prototype.push),it=E(String.prototype.toLowerCase),kt=E(String.prototype.toString),$e=E(String.prototype.match),A=E(String.prototype.replace),Ke=E(String.prototype.indexOf),Ve=E(String.prototype.trim),g=E(RegExp.prototype.test),xt=Xe(TypeError);function E(n){return function(o){for(var a=arguments.length,l=new Array(a>1?a-1:0),m=1;m<a;m++)l[m-1]=arguments[m];return lt(n,o,l)}}function Xe(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return It(n,a)}}function i(n,o,a){a=a||it,ie&&ie(n,null);for(var l=o.length;l--;){var m=o[l];if(typeof m=="string"){var N=a(m);N!==m&&(Be(o)||(o[l]=N),m=N)}n[m]=!0}return n}function M(n){var o=qe(null),a;for(a in n)lt(je,n,[a])===!0&&(o[a]=n[a]);return o}function rt(n,o){for(;n!==null;){var a=We(n,o);if(a){if(a.get)return E(a.get);if(typeof a.value=="function")return E(a.value)}n=Ge(n)}function l(m){return console.warn("fallback value for",m),null}return l}var ce=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"]),Lt=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"]),Ot=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ze=y(["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"]),Dt=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"]),Je=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ue=y(["#text"]),se=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","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"]),Rt=y(["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"]),me=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"]),ot=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qe=S(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tn=S(/<%[\w\W]*|[\w\W]*%>/gm),en=S(/\${[\w\W]*}/gm),nn=S(/^data-[\-\w.\u00B7-\uFFFF]/),rn=S(/^aria-[\-\w]+$/),on=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),an=S(/^(?:\w+script|data):/i),ln=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cn=S(/^html$/i),un=function(){return typeof window>"u"?null:window},sn=function(n,o){if(O(n)!=="object"||typeof n.createPolicy!="function")return null;var a=null,l="data-tt-policy-suffix";o.currentScript&&o.currentScript.hasAttribute(l)&&(a=o.currentScript.getAttribute(l));var m="dompurify"+(a?"#"+a:"");try{return n.createPolicy(m,{createHTML:function(N){return N},createScriptURL:function(N){return N}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}};function fe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:un(),o=function(t){return fe(t)};if(o.version="2.4.5",o.removed=[],!n||!n.document||n.document.nodeType!==9)return o.isSupported=!1,o;var a=n.document,l=n.document,m=n.DocumentFragment,N=n.HTMLTemplateElement,D=n.Node,K=n.Element,I=n.NodeFilter,Ft=n.NamedNodeMap,de=Ft===void 0?n.NamedNodeMap||n.MozNamedAttrMap:Ft,he=n.HTMLFormElement,ge=n.DOMParser,V=n.trustedTypes,X=K.prototype,ye=rt(X,"cloneNode"),be=rt(X,"nextSibling"),Te=rt(X,"childNodes"),ct=rt(X,"parentNode");if(typeof N=="function"){var ut=l.createElement("template");ut.content&&ut.content.ownerDocument&&(l=ut.content.ownerDocument)}var v=sn(V,a),st=v?v.createHTML(""):"",Z=l,mt=Z.implementation,Ne=Z.createNodeIterator,Ee=Z.createDocumentFragment,ve=Z.getElementsByTagName,Ae=a.importNode,Ut={};try{Ut=M(l).documentMode?l.documentMode:{}}catch{}var _={};o.isSupported=typeof ct=="function"&&mt&&typeof mt.createHTMLDocument<"u"&&Ut!==9;var pt=Qe,ft=tn,dt=en,we=nn,Se=rn,_e=an,Ht=ln,ht=on,f=null,zt=i({},[].concat(w(ce),w(Lt),w(Ot),w(Dt),w(ue))),d=null,Pt=i({},[].concat(w(se),w(Rt),w(me),w(ot))),u=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}})),G=null,gt=null,jt=!0,yt=!0,Bt=!1,Gt=!0,F=!1,R=!1,bt=!1,Tt=!1,U=!1,J=!1,Q=!1,Wt=!0,qt=!1,ke="user-content-",Nt=!0,W=!1,H={},z=null,Yt=i({},["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"]),$t=null,Kt=i({},["audio","video","img","source","image","track"]),Et=null,Vt=i({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",et="http://www.w3.org/2000/svg",k="http://www.w3.org/1999/xhtml",P=k,vt=!1,At=null,xe=i({},[tt,et,k],kt),C,Le=["application/xhtml+xml","text/html"],Oe="text/html",h,j=null,De=l.createElement("form"),Xt=function(t){return t instanceof RegExp||t instanceof Function},wt=function(t){j&&j===t||((!t||O(t)!=="object")&&(t={}),t=M(t),C=Le.indexOf(t.PARSER_MEDIA_TYPE)===-1?C=Oe:C=t.PARSER_MEDIA_TYPE,h=C==="application/xhtml+xml"?kt:it,f="ALLOWED_TAGS"in t?i({},t.ALLOWED_TAGS,h):zt,d="ALLOWED_ATTR"in t?i({},t.ALLOWED_ATTR,h):Pt,At="ALLOWED_NAMESPACES"in t?i({},t.ALLOWED_NAMESPACES,kt):xe,Et="ADD_URI_SAFE_ATTR"in t?i(M(Vt),t.ADD_URI_SAFE_ATTR,h):Vt,$t="ADD_DATA_URI_TAGS"in t?i(M(Kt),t.ADD_DATA_URI_TAGS,h):Kt,z="FORBID_CONTENTS"in t?i({},t.FORBID_CONTENTS,h):Yt,G="FORBID_TAGS"in t?i({},t.FORBID_TAGS,h):{},gt="FORBID_ATTR"in t?i({},t.FORBID_ATTR,h):{},H="USE_PROFILES"in t?t.USE_PROFILES:!1,jt=t.ALLOW_ARIA_ATTR!==!1,yt=t.ALLOW_DATA_ATTR!==!1,Bt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Gt=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=t.SAFE_FOR_TEMPLATES||!1,R=t.WHOLE_DOCUMENT||!1,U=t.RETURN_DOM||!1,J=t.RETURN_DOM_FRAGMENT||!1,Q=t.RETURN_TRUSTED_TYPE||!1,Tt=t.FORCE_BODY||!1,Wt=t.SANITIZE_DOM!==!1,qt=t.SANITIZE_NAMED_PROPS||!1,Nt=t.KEEP_CONTENT!==!1,W=t.IN_PLACE||!1,ht=t.ALLOWED_URI_REGEXP||ht,P=t.NAMESPACE||k,u=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Xt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Xt(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),F&&(yt=!1),J&&(U=!0),H&&(f=i({},w(ue)),d=[],H.html===!0&&(i(f,ce),i(d,se)),H.svg===!0&&(i(f,Lt),i(d,Rt),i(d,ot)),H.svgFilters===!0&&(i(f,Ot),i(d,Rt),i(d,ot)),H.mathMl===!0&&(i(f,Dt),i(d,me),i(d,ot))),t.ADD_TAGS&&(f===zt&&(f=M(f)),i(f,t.ADD_TAGS,h)),t.ADD_ATTR&&(d===Pt&&(d=M(d)),i(d,t.ADD_ATTR,h)),t.ADD_URI_SAFE_ATTR&&i(Et,t.ADD_URI_SAFE_ATTR,h),t.FORBID_CONTENTS&&(z===Yt&&(z=M(z)),i(z,t.FORBID_CONTENTS,h)),Nt&&(f["#text"]=!0),R&&i(f,["html","head","body"]),f.table&&(i(f,["tbody"]),delete G.tbody),y&&y(t),j=t)},Zt=i({},["mi","mo","mn","ms","mtext"]),Jt=i({},["foreignobject","desc","title","annotation-xml"]),Re=i({},["title","style","font","a","script"]),nt=i({},Lt);i(nt,Ot),i(nt,Ze);var St=i({},Dt);i(St,Je);var Ce=function(t){var r=ct(t);(!r||!r.tagName)&&(r={namespaceURI:P,tagName:"template"});var e=it(t.tagName),c=it(r.tagName);return At[t.namespaceURI]?t.namespaceURI===et?r.namespaceURI===k?e==="svg":r.namespaceURI===tt?e==="svg"&&(c==="annotation-xml"||Zt[c]):!!nt[e]:t.namespaceURI===tt?r.namespaceURI===k?e==="math":r.namespaceURI===et?e==="math"&&Jt[c]:!!St[e]:t.namespaceURI===k?r.namespaceURI===et&&!Jt[c]||r.namespaceURI===tt&&!Zt[c]?!1:!St[e]&&(Re[e]||!nt[e]):!!(C==="application/xhtml+xml"&&At[t.namespaceURI]):!1},B=function(t){$(o.removed,{element:t});try{t.parentNode.removeChild(t)}catch{try{t.outerHTML=st}catch{t.remove()}}},_t=function(t,r){try{$(o.removed,{attribute:r.getAttributeNode(t),from:r})}catch{$(o.removed,{attribute:null,from:r})}if(r.removeAttribute(t),t==="is"&&!d[t])if(U||J)try{B(r)}catch{}else try{r.setAttribute(t,"")}catch{}},Qt=function(t){var r,e;if(Tt)t="<remove></remove>"+t;else{var c=$e(t,/^[\r\n\t ]+/);e=c&&c[0]}C==="application/xhtml+xml"&&P===k&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var s=v?v.createHTML(t):t;if(P===k)try{r=new ge().parseFromString(s,C)}catch{}if(!r||!r.documentElement){r=mt.createDocument(P,"template",null);try{r.documentElement.innerHTML=vt?st:s}catch{}}var T=r.body||r.documentElement;return t&&e&&T.insertBefore(l.createTextNode(e),T.childNodes[0]||null),P===k?ve.call(r,R?"html":"body")[0]:R?r.documentElement:T},te=function(t){return Ne.call(t.ownerDocument||t,t,I.SHOW_ELEMENT|I.SHOW_COMMENT|I.SHOW_TEXT,null,!1)},Me=function(t){return t instanceof he&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof de)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},q=function(t){return O(D)==="object"?t instanceof D:t&&O(t)==="object"&&typeof t.nodeType=="number"&&typeof t.nodeName=="string"},x=function(t,r,e){_[t]&&Ye(_[t],function(c){c.call(o,r,e,j)})},ee=function(t){var r;if(x("beforeSanitizeElements",t,null),Me(t)||g(/[\u0080-\uFFFF]/,t.nodeName))return B(t),!0;var e=h(t.nodeName);if(x("uponSanitizeElement",t,{tagName:e,allowedTags:f}),t.hasChildNodes()&&!q(t.firstElementChild)&&(!q(t.content)||!q(t.content.firstElementChild))&&g(/<[/\w]/g,t.innerHTML)&&g(/<[/\w]/g,t.textContent)||e==="select"&&g(/<template/i,t.innerHTML))return B(t),!0;if(!f[e]||G[e]){if(!G[e]&&re(e)&&(u.tagNameCheck instanceof RegExp&&g(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e)))return!1;if(Nt&&!z[e]){var c=ct(t)||t.parentNode,s=Te(t)||t.childNodes;if(s&&c)for(var T=s.length,p=T-1;p>=0;--p)c.insertBefore(ye(s[p],!0),be(t))}return B(t),!0}return t instanceof K&&!Ce(t)||(e==="noscript"||e==="noembed")&&g(/<\/no(script|embed)/i,t.innerHTML)?(B(t),!0):(F&&t.nodeType===3&&(r=t.textContent,r=A(r,pt," "),r=A(r,ft," "),r=A(r,dt," "),t.textContent!==r&&($(o.removed,{element:t.cloneNode()}),t.textContent=r)),x("afterSanitizeElements",t,null),!1)},ne=function(t,r,e){if(Wt&&(r==="id"||r==="name")&&(e in l||e in De))return!1;if(!(yt&&!gt[r]&&g(we,r))&&!(jt&&g(Se,r))){if(!d[r]||gt[r]){if(!(re(t)&&(u.tagNameCheck instanceof RegExp&&g(u.tagNameCheck,t)||u.tagNameCheck instanceof Function&&u.tagNameCheck(t))&&(u.attributeNameCheck instanceof RegExp&&g(u.attributeNameCheck,r)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(r))||r==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&g(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))))return!1}else if(!Et[r]&&!g(ht,A(e,Ht,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&t!=="script"&&Ke(e,"data:")===0&&$t[t])&&!(Bt&&!g(_e,A(e,Ht,"")))&&e)return!1}return!0},re=function(t){return t.indexOf("-")>0},oe=function(t){var r,e,c,s;x("beforeSanitizeAttributes",t,null);var T=t.attributes;if(T){var p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d};for(s=T.length;s--;){r=T[s];var Y=r,L=Y.name,b=Y.namespaceURI;if(e=L==="value"?r.value:Ve(r.value),c=h(L),p.attrName=c,p.attrValue=e,p.keepAttr=!0,p.forceKeepAttr=void 0,x("uponSanitizeAttribute",t,p),e=p.attrValue,!p.forceKeepAttr&&(_t(L,t),!!p.keepAttr)){if(!Gt&&g(/\/>/i,e)){_t(L,t);continue}F&&(e=A(e,pt," "),e=A(e,ft," "),e=A(e,dt," "));var ae=h(t.nodeName);if(ne(ae,c,e)){if(qt&&(c==="id"||c==="name")&&(_t(L,t),e=ke+e),v&&O(V)==="object"&&typeof V.getAttributeType=="function"&&!b)switch(V.getAttributeType(ae,c)){case"TrustedHTML":e=v.createHTML(e);break;case"TrustedScriptURL":e=v.createScriptURL(e);break}try{b?t.setAttributeNS(b,L,e):t.setAttribute(L,e),le(o.removed)}catch{}}}}x("afterSanitizeAttributes",t,null)}},Ie=function t(r){var e,c=te(r);for(x("beforeSanitizeShadowDOM",r,null);e=c.nextNode();)x("uponSanitizeShadowNode",e,null),!ee(e)&&(e.content instanceof m&&t(e.content),oe(e));x("afterSanitizeShadowDOM",r,null)};return o.sanitize=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e,c,s,T,p;if(vt=!t,vt&&(t="<!-->"),typeof t!="string"&&!q(t)){if(typeof t.toString!="function")throw xt("toString is not a function");if(t=t.toString(),typeof t!="string")throw xt("dirty is not a string, aborting")}if(!o.isSupported){if(O(n.toStaticHTML)==="object"||typeof n.toStaticHTML=="function"){if(typeof t=="string")return n.toStaticHTML(t);if(q(t))return n.toStaticHTML(t.outerHTML)}return t}if(bt||wt(r),o.removed=[],typeof t=="string"&&(W=!1),W){if(t.nodeName){var Y=h(t.nodeName);if(!f[Y]||G[Y])throw xt("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof D)e=Qt("<!---->"),c=e.ownerDocument.importNode(t,!0),c.nodeType===1&&c.nodeName==="BODY"||c.nodeName==="HTML"?e=c:e.appendChild(c);else{if(!U&&!F&&!R&&t.indexOf("<")===-1)return v&&Q?v.createHTML(t):t;if(e=Qt(t),!e)return U?null:Q?st:""}e&&Tt&&B(e.firstChild);for(var L=te(W?t:e);s=L.nextNode();)s.nodeType===3&&s===T||ee(s)||(s.content instanceof m&&Ie(s.content),oe(s),T=s);if(T=null,W)return t;if(U){if(J)for(p=Ee.call(e.ownerDocument);e.firstChild;)p.appendChild(e.firstChild);else p=e;return(d.shadowroot||d.shadowrootmod)&&(p=Ae.call(a,p,!0)),p}var b=R?e.outerHTML:e.innerHTML;return R&&f["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&g(cn,e.ownerDocument.doctype.name)&&(b="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
`+b),F&&(b=A(b,pt," "),b=A(b,ft," "),b=A(b,dt," ")),v&&Q?v.createHTML(b):b},o.setConfig=function(t){wt(t),bt=!0},o.clearConfig=function(){j=null,bt=!1},o.isValidAttribute=function(t,r,e){j||wt({});var c=h(t),s=h(r);return ne(c,s,e)},o.addHook=function(t,r){typeof r=="function"&&(_[t]=_[t]||[],$(_[t],r))},o.removeHook=function(t){if(_[t])return le(_[t])},o.removeHooks=function(t){_[t]&&(_[t]=[])},o.removeAllHooks=function(){_={}},o}var mn=fe();export{mn as default};