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