@lifesg/react-design-system 4.0.0-alpha.15 → 4.0.0-alpha.16
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.
- package/cjs/external/dompurify/dist/purify.es.js +2 -2
- package/cjs/external/dompurify/dist/purify.es.js.map +1 -1
- package/cjs/modal/modal.js +1 -1
- package/cjs/modal/modal.js.map +1 -1
- package/cjs/modal-v2/modal-v2.js +1 -1
- package/cjs/modal-v2/modal-v2.js.map +1 -1
- package/cjs/overlay/overlay.js +1 -1
- package/cjs/overlay/overlay.js.map +1 -1
- package/external/dompurify/dist/purify.es.js +2 -2
- package/external/dompurify/dist/purify.es.js.map +1 -1
- package/modal/index.d.ts +1 -1
- package/modal/modal.d.ts +1 -1
- package/modal/modal.js +1 -1
- package/modal/modal.js.map +1 -1
- package/modal/types.d.ts +13 -0
- package/modal-v2/modal-v2.d.ts +1 -1
- package/modal-v2/modal-v2.js +1 -1
- package/modal-v2/modal-v2.js.map +1 -1
- package/modal-v2/types.d.ts +13 -0
- package/overlay/overlay.js +1 -1
- package/overlay/overlay.js.map +1 -1
- package/overlay/types.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*! @license DOMPurify 3.4.
|
|
2
|
+
/*! @license DOMPurify 3.4.17 | (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.17/LICENSE */
|
|
3
3
|
function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
5
|
-
function e(e,n){return function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(c=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);c=!0);}catch(t){s=!0,r=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0});const n=Object.entries,o=Object.setPrototypeOf,r=Object.isFrozen,i=Object.getPrototypeOf,a=Object.getOwnPropertyDescriptor;let l=Object.freeze,c=Object.seal,s=Object.create,u="undefined"!=typeof Reflect&&Reflect,f=u.apply,p=u.construct;l||(l=function(t){return t}),c||(c=function(t){return t}),f||(f=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return t.apply(e,o)}),p||(p=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return new t(...n)});const m=L(Array.prototype.forEach),d=L(Array.prototype.lastIndexOf),h=L(Array.prototype.pop),y=L(Array.prototype.push),g=L(Array.prototype.splice),b=Array.isArray,S=L(String.prototype.toLowerCase),T=L(String.prototype.toString),A=L(String.prototype.match),w=L(String.prototype.replace),E=L(String.prototype.indexOf),v=L(String.prototype.trim),O=L(Number.prototype.toString),N=L(Boolean.prototype.toString),_="undefined"==typeof BigInt?null:L(BigInt.prototype.toString),x="undefined"==typeof Symbol?null:L(Symbol.prototype.toString),D=L(Object.prototype.hasOwnProperty),R=L(Object.prototype.toString),k=L(RegExp.prototype.test),C=(I=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return p(I,e)});var I;function L(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return f(t,e,o)}}function z(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;if(o&&o(t,null),!b(e))return t;let i=e.length;for(;i--;){let o=e[i];if("string"==typeof o){const t=n(o);t!==o&&(r(e)||(e[i]=t),o=t)}t[o]=!0}return t}function M(t){for(let e=0;e<t.length;e++)D(t,e)||(t[e]=null);return t}function P(t){const o=s(null);for(const i of n(t)){var r=e(i,2);const n=r[0],a=r[1];D(t,n)&&(b(a)?o[n]=M(a):a&&"object"==typeof a&&a.constructor===Object?o[n]=P(a):o[n]=a)}return o}function U(t,e){for(;null!==t;){const n=a(t,e);if(n){if(n.get)return L(n.get);if("function"==typeof n.value)return L(n.value)}t=i(t)}return function(){return null}}const F=l(["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"]),H=l(["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"]),j=l(["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"]),B=l(["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"]),W=l(["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"]),Y=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G=l(["#text"]),q=l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),$=l(["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","dominant-baseline","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","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),X=l(["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"]),K=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),V=c(/{{[\w\W]*|^[\w\W]*}}/g),Z=c(/<%[\w\W]*|^[\w\W]*%>/g),J=c(/\${[\w\W]*/g),Q=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),tt=c(/^aria-[\-\w]+$/),et=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nt=c(/^(?:\w+script|data):/i),ot=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rt=c(/^html$/i),it=c(/^[a-z][.\w]*(-[.\w]+)+$/i),at=c(/<[/\w!]/g),lt=c(/<[/\w]/g),ct=c(/<\/no(script|embed|frames)/i),st=c(/\/>/i),ut=1,ft=3,pt=7,mt=8,dt=9,ht=11,yt=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],gt=l(z({},yt)),bt=function(){const t={};return m(yt,(e=>{t[e]=c(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))})),l(t)}(),St=function(){return"undefined"==typeof window?null:window},Tt=function(t,e,n,o){return D(t,e)&&b(t[e])?z(o.base?P(o.base):{},t[e],o.transform):n},At=function(t,e,n){const o=D(t,e)?t[e]:void 0;return o&&"object"==typeof o?P(o):n()};var wt=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:St();const o=e=>t(e);if(o.version="3.4.16",o.removed=[],!e||!e.document||e.document.nodeType!==dt||!e.Element)return o.isSupported=!1,o;let r=e.document;const i=r,a=i.currentScript;e.DocumentFragment;const u=e.HTMLTemplateElement,f=e.Node,p=e.Element,I=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const L=e.DOMParser,M=e.trustedTypes,yt=p.prototype,wt=U(yt,"cloneNode"),Et=U(yt,"remove"),vt=U(yt,"removeAttributeNode"),Ot=U(yt,"nextSibling"),Nt=U(yt,"childNodes"),_t=U(yt,"parentNode"),xt=U(yt,"shadowRoot"),Dt=U(yt,"attributes"),Rt=f&&f.prototype?U(f.prototype,"nodeType"):null,kt=f&&f.prototype?U(f.prototype,"nodeName"):null,Ct=f&&f.prototype?U(f.prototype,"ownerDocument"):null,It=function(t){return Rt?Rt(t):t.nodeType},Lt=function(t){return kt?kt(t):t.nodeName};if("function"==typeof u){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let zt,Mt,Pt="",Ut=!1,Ft=0;const Ht=function(){if(Ft>0)throw C('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},jt=function(t){Ht(),Ft++;try{return zt.createHTML(t)}finally{Ft--}},Bt=function(){return Ut||(Mt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(M,a),Ut=!0),Mt},Wt=r,Yt=Wt.implementation,Gt=Wt.createNodeIterator,qt=Wt.createDocumentFragment,$t=Wt.getElementsByTagName,Xt=i.importNode;let Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof n&&"function"==typeof _t&&Yt&&void 0!==Yt.createHTMLDocument;const Vt=V,Zt=Z,Jt=J,Qt=Q,te=tt,ee=nt,ne=ot,oe=it;let re=et,ie=null;const ae=z({},[...F,...H,...j,...W,...G]);let le=null;const ce=z({},[...q,...$,...X,...K]);let se=Object.seal(s(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}})),ue=null,fe=null;const pe=Object.seal(s(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let me=!0,de=!0,he=!1,ye=!0,ge=!1,be=!0,Se=!1,Te=!1,Ae=null,we=null,Ee=!1,ve=!1,Oe=!1,Ne=!1,_e=!0,xe=!1;const De="user-content-";let Re=!0,ke=!1,Ce={},Ie=null;const Le=z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let ze=null;const Me=z({},["audio","video","img","source","image","track"]);let Pe=null;const Ue=z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",He="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml";let Be=je,We=!1,Ye=null;const Ge=z({},[Fe,He,je],T),qe=l(["mi","mo","mn","ms","mtext"]);let $e=z({},qe);const Xe=l(["annotation-xml"]);let Ke=z({},Xe);const Ve=z({},["title","style","font","a","script"]);let Ze=null;const Je=["application/xhtml+xml","text/html"];let Qe=null,tn=null;const en=r.createElement("form"),nn=function(t){return t instanceof RegExp||t instanceof Function},on=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(tn&&tn===t)return;t&&"object"==typeof t||(t={}),t=P(t),Ze=-1===Je.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Qe="application/xhtml+xml"===Ze?T:S,ie=Tt(t,"ALLOWED_TAGS",ae,{transform:Qe}),le=Tt(t,"ALLOWED_ATTR",ce,{transform:Qe}),Ye=Tt(t,"ALLOWED_NAMESPACES",Ge,{transform:T}),Pe=Tt(t,"ADD_URI_SAFE_ATTR",Ue,{transform:Qe,base:Ue}),ze=Tt(t,"ADD_DATA_URI_TAGS",Me,{transform:Qe,base:Me}),Ie=Tt(t,"FORBID_CONTENTS",Le,{transform:Qe}),ue=Tt(t,"FORBID_TAGS",P({}),{transform:Qe}),fe=Tt(t,"FORBID_ATTR",P({}),{transform:Qe}),Ce=!!D(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?P(t.USE_PROFILES):t.USE_PROFILES),me=!1!==t.ALLOW_ARIA_ATTR,de=!1!==t.ALLOW_DATA_ATTR,he=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ge=t.SAFE_FOR_TEMPLATES||!1,be=!1!==t.SAFE_FOR_XML,Se=t.WHOLE_DOCUMENT||!1,ve=t.RETURN_DOM||!1,Oe=t.RETURN_DOM_FRAGMENT||!1,Ne=t.RETURN_TRUSTED_TYPE||!1,Ee=t.FORCE_BODY||!1,_e=!1!==t.SANITIZE_DOM,xe=t.SANITIZE_NAMED_PROPS||!1,Re=!1!==t.KEEP_CONTENT,ke=t.IN_PLACE||!1,re=function(t){try{return k(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:et,Be="string"==typeof t.NAMESPACE?t.NAMESPACE:je,$e=At(t,"MATHML_TEXT_INTEGRATION_POINTS",(()=>z({},qe))),Ke=At(t,"HTML_INTEGRATION_POINTS",(()=>z({},Xe)));const e=At(t,"CUSTOM_ELEMENT_HANDLING",(()=>s(null)));if(se=s(null),D(e,"tagNameCheck")&&nn(e.tagNameCheck)&&(se.tagNameCheck=e.tagNameCheck),D(e,"attributeNameCheck")&&nn(e.attributeNameCheck)&&(se.attributeNameCheck=e.attributeNameCheck),D(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(se.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),c(se),ge&&(de=!1),Oe&&(ve=!0),Ce&&(ie=z({},G),le=s(null),!0===Ce.html&&(z(ie,F),z(le,q)),!0===Ce.svg&&(z(ie,H),z(le,$),z(le,K)),!0===Ce.svgFilters&&(z(ie,j),z(le,$),z(le,K)),!0===Ce.mathMl&&(z(ie,W),z(le,X),z(le,K))),pe.tagCheck=null,pe.attributeCheck=null,D(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?pe.tagCheck=t.ADD_TAGS:b(t.ADD_TAGS)&&(ie===ae&&(ie=P(ie)),z(ie,t.ADD_TAGS,Qe))),D(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?pe.attributeCheck=t.ADD_ATTR:b(t.ADD_ATTR)&&(le===ce&&(le=P(le)),z(le,t.ADD_ATTR,Qe))),D(t,"ADD_FORBID_CONTENTS")&&b(t.ADD_FORBID_CONTENTS)&&(Ie===Le&&(Ie=P(Ie)),z(Ie,t.ADD_FORBID_CONTENTS,Qe)),Re&&(ie["#text"]=!0),Se&&z(ie,["html","head","body"]),ie.table&&(z(ie,["tbody"]),delete ue.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw C('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw C('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=zt;zt=t.TRUSTED_TYPES_POLICY;try{Pt=jt("")}catch(t){throw zt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(zt=void 0,Pt=""):(void 0===zt&&(zt=Bt()),zt&&"string"==typeof Pt&&(Pt=jt("")));l&&l(t),tn=t},rn=z({},[...H,...j,...B]),an=z({},[...W,...Y]),ln=function(t){let e=_t(t);e&&e.tagName||(e={namespaceURI:Be,tagName:"template"});const n=S(t.tagName),o=S(e.tagName);return!!Ye[t.namespaceURI]&&(t.namespaceURI===He?function(t,e,n){return e.namespaceURI===je?"svg"===t:e.namespaceURI===Fe?"svg"===t&&("annotation-xml"===n||$e[n]):Boolean(rn[t])}(n,e,o):t.namespaceURI===Fe?function(t,e,n){return e.namespaceURI===je?"math"===t:e.namespaceURI===He?"math"===t&&Ke[n]:Boolean(an[t])}(n,e,o):t.namespaceURI===je?function(t,e,n){return!(e.namespaceURI===He&&!Ke[n])&&!(e.namespaceURI===Fe&&!$e[n])&&!an[t]&&(Ve[t]||!rn[t])}(n,e,o):!("application/xhtml+xml"!==Ze||!Ye[t.namespaceURI]))},cn=function(t){y(o.removed,{element:t});try{_t(t).removeChild(t)}catch(e){if(Et(t),!_t(t))throw C("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},sn=function(t,e,n){try{vt(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},un=function(t){mn(t);const e=Nt(t);if(e){const t=[];m(e,(e=>{y(t,e)})),m(t,(t=>{try{Et(t)}catch(t){}}))}const n=Dt(t);if(n)for(let e=n.length-1;e>=0;--e){const o=n[e],r=o&&o.name;"string"==typeof r&&sn(t,o,r)}},fn=function(t,e,n){if(!n)try{n=e.getAttributeNode(t)}catch(t){n=null}y(o.removed,{attribute:n||null,from:e});try{n?vt(e,n):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(ve||Oe)try{cn(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},pn=function(t){const e=Dt(t);if(e)for(let n=e.length-1;n>=0;--n){const o=e[n],r=o&&o.name;"string"!=typeof r||le[Qe(r)]||sn(t,o,r)}},mn=function(t){const e=[t];for(;e.length>0;){const t=e.pop();It(t)===ut&&pn(t);const n=Nt(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},dn=function(t,e){return!!be&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},hn=function(t){let e=null,n=null;if(Ee)t="<remove></remove>"+t;else{const e=A(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Ze&&Be===je&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=zt?jt(t):t;if(Be===je)try{e=(new L).parseFromString(o,Ze)}catch(t){}if(!e||!e.documentElement){e=Yt.createDocument(Be,"template",null);try{e.documentElement.innerHTML=We?Pt:o}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Be===je?$t.call(e,Se?"html":"body")[0]:Se?e.documentElement:i},yn=function(t){const e=Ct?Ct(t):t.ownerDocument;return Gt.call(e||t,t,I.SHOW_ELEMENT|I.SHOW_COMMENT|I.SHOW_TEXT|I.SHOW_PROCESSING_INSTRUCTION|I.SHOW_CDATA_SECTION,null)},gn=function(t){return t=w(t,Vt," "),t=w(t,Zt," "),t=w(t,Jt," ")},bn=function(t){var e;t.normalize();const n=Ct?Ct(t):t.ownerDocument,o=Gt.call(n||t,t,I.SHOW_TEXT|I.SHOW_COMMENT|I.SHOW_CDATA_SECTION|I.SHOW_PROCESSING_INSTRUCTION,null);let r=o.nextNode();for(;r;)r.data=gn(r.data),r=o.nextNode();const i=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");i&&m(i,(t=>{Tn(t.content)&&bn(t.content)}))},Sn=function(t){const e=kt?kt(t):null;return"string"==typeof e&&("form"===Qe(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==Dt(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==Rt(t)||t.childNodes!==Nt(t)))},Tn=function(t){if(!Rt||"object"!=typeof t||null===t)return!1;try{return Rt(t)===ht}catch(t){return!1}},An=function(t){if(!Rt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof Rt(t)}catch(t){return!1}};function wn(t,e,n){0!==t.length&&m(t,(t=>{t.call(o,e,n,tn)}))}const En=function(t,e){if(t instanceof RegExp)return k(t,e);if(t instanceof Function){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return Boolean(t(e,...o))}return!1},vn=function(t,e,n,o){return 0===t.length?e:e===n||e===o?P(e):e},On=function(t,e){return t!==e&&null===_t(t)&&(ke&&mn(t),!0)},Nn=function(t,e){if(wn(Kt.beforeSanitizeElements,t,null),On(t,e))return!0;if(Sn(t))return cn(t),!0;const n=Qe(Lt(t));if(ie=vn(Kt.uponSanitizeElement,ie,ae,Ae),wn(Kt.uponSanitizeElement,t,{tagName:n,allowedTags:ie}),On(t,e))return!0;if(function(t,e){return!!(be&&t.hasChildNodes()&&!An(t.firstElementChild)&&k(at,t.textContent)&&k(at,t.innerHTML))||!!(be&&t.namespaceURI===je&>[e]&&(An(t.firstElementChild)||"string"==typeof t.textContent&&k(bt[e],t.textContent)))||t.nodeType===pt||!(!be||t.nodeType!==mt||!k(lt,t.data))}(t,n))return cn(t),!0;if(ue[n]||!(pe.tagCheck instanceof Function&&pe.tagCheck(n))&&!ie[n]){const o=function(t,e,n){if(!ue[e]&&Dn(e)&&En(se.tagNameCheck,e))return!1;if(Re&&!Ie[e]){const e=_t(t),o=Nt(t);if(o&&e)for(let r=o.length-1;r>=0;--r){const i=t===n?wt(o[r],!0):o[r];e.insertBefore(i,Ot(t))}}return cn(t),!0}(t,n,e);return!(!1!==o||(wn(Kt.afterSanitizeElements,t,null),!On(t,e)))||o}if(It(t)===ut&&!ln(t))return cn(t),!0;if(("noscript"===n||"noembed"===n||"noframes"===n)&&k(ct,t.innerHTML))return cn(t),!0;if(ge&&t.nodeType===ft){const e=gn(t.textContent);t.textContent!==e&&(y(o.removed,{element:t.cloneNode()}),t.textContent=e)}return wn(Kt.afterSanitizeElements,t,null),On(t,e)},_n=function(t,e,n){if(fe[e])return!1;if(dn(e,t))return!1;if(_e&&("id"===e||"name"===e)&&(n in r||n in en))return!1;const o=le[e]||pe.attributeCheck instanceof Function&&pe.attributeCheck(e,t);return!(!de||!k(Qt,e))||(!(!me||!k(te,e))||(o?!!Pe[e]||(!!k(re,w(n,ne,""))||(!("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==E(n,"data:")||!ze[t])||(!(!he||k(ee,w(n,ne,"")))||!n))):Dn(t)&&En(se.tagNameCheck,t)&&En(se.attributeNameCheck,e,t)||"is"===e&&se.allowCustomizedBuiltInElements&&En(se.tagNameCheck,n)))},xn=z({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Dn=function(t){return!xn[S(t)]&&k(oe,t)},Rn=function(t,e,n,o){if(zt&&"object"==typeof M&&"function"==typeof M.getAttributeType&&!n)switch(M.getAttributeType(t,e)){case"TrustedHTML":return jt(o);case"TrustedScriptURL":return function(t){Ht(),Ft++;try{return zt.createScriptURL(t)}finally{Ft--}}(o)}return o},kn=function(t,e,n,o){try{return n?t.setAttributeNS(n,e,o):t.setAttribute(e,o),!Sn(t)||(cn(t),!1)}catch(n){return fn(e,t),!1}},Cn=function(t,e){if(wn(Kt.beforeSanitizeAttributes,t,null),On(t,e))return;const n=t.attributes;if(!n||Sn(t))return;le=vn(Kt.uponSanitizeAttribute,le,ce,we);const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0};let i=n.length;const a=Qe(t.nodeName);for(;i--;){const e=n[i],l=e.name,c=e.namespaceURI,s=e.value,u=Qe(l),f=s;let p="value"===l?f:v(f),m=!1;r.attrName=u,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,wn(Kt.uponSanitizeAttribute,t,r),p=r.attrValue,!xe||"id"!==u&&"name"!==u||0===E(p,De)||(fn(l,t,e),p=De+p,m=!0),be&&k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,p)?fn(l,t,e):"attributename"===u&&A(p,"href")?fn(l,t,e):r.forceKeepAttr||(r.keepAttr&&(ye||!k(st,p))?(ge&&(p=gn(p)),_n(a,u,p)?(p=Rn(a,u,c,p),p!==f&&kn(t,l,c,p)&&m&&h(o.removed)):fn(l,t,e)):fn(l,t,e))}wn(Kt.afterSanitizeAttributes,t,null),On(t,e)},In=function(t){let e=null;const n=yn(t);for(wn(Kt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(wn(Kt.uponSanitizeShadowNode,e,null),Nn(e,t),Cn(e,t),Tn(e.content)&&In(e.content),It(e)===ut){const t=xt(e);Tn(t)&&(Ln(t),In(t))}wn(Kt.afterSanitizeShadowDOM,t,null)},Ln=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){In(t.shadow);continue}const n=t.node,o=It(n)===ut,r=Nt(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(o){const t=kt?kt(n):null;if("string"==typeof t&&"template"===Qe(t)){const t=n.content;Tn(t)&&e.push({node:t,shadow:null})}}if(o){const t=xt(n);Tn(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return o.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,a=null,l=null;if(We=!t,We&&(t="\x3c!--\x3e"),"string"!=typeof t&&!An(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return O(t);case"boolean":return N(t);case"bigint":return _?_(t):"0";case"symbol":return x?x(t):"Symbol()";case"undefined":default:return R(t);case"function":case"object":{if(null===t)return R(t);const e=t,n=U(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:R(t)}return R(t)}}}(t)))throw C("dirty is not a string, aborting");if(!o.isSupported)return t;Te?(ie=Ae,le=we):on(e),(Kt.uponSanitizeElement.length>0||Kt.uponSanitizeAttribute.length>0)&&(ie=P(ie)),Kt.uponSanitizeAttribute.length>0&&(le=P(le)),o.removed=[];const c=ke&&"string"!=typeof t&&An(t);if(c){!function(t){if(!be)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=It(t);if(n===pt||n===mt&&k(lt,t.data)){try{Et(t)}catch(t){}continue}if(n===ut){const e=t,n=Qe(Lt(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&dn("for",n)&&e.removeAttribute("for")}catch(t){}}const o=Nt(t);if(o)for(let t=o.length-1;t>=0;--t)e.push(o[t])}}(t);const e=Lt(t);if("string"==typeof e){const n=Qe(e);if(!ie[n]||ue[n])throw un(t),C("root node is forbidden and cannot be sanitized in-place")}if(Sn(t))throw un(t),C("root node is clobbered and cannot be sanitized in-place");try{Ln(t)}catch(e){throw un(t),e}}else if(An(t))n=hn("\x3c!----\x3e"),r=n.ownerDocument.importNode(t,!0),r.nodeType===ut&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r),Ln(n);else{if(!ve&&!ge&&!Se&&-1===t.indexOf("<"))return zt&&Ne?jt(t):t;if(n=hn(t),!n)return ve?null:Ne?Pt:""}n&&Ee&&cn(n.firstChild);const s=c?t:n;try{const t=yn(s);for(;a=t.nextNode();)Nn(a,s),Cn(a,s),Tn(a.content)&&In(a.content)}catch(e){throw c&&(un(t),m(o.removed,(t=>{t.element&&mn(t.element)}))),e}if(c){let e=!1;if(m(o.removed,(n=>{n.element&&(n.element===t&&(e=!0),mn(n.element))})),e)throw C("a node selected for removal could not be safely returned; refusing to sanitize in place");return ge&&bn(t),t}if(ve){if(ge&&bn(n),Oe)for(l=qt.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(le.shadowroot||le.shadowrootmode)&&(l=Xt.call(i,l,!0)),l}let u=Se?n.outerHTML:n.innerHTML;return Se&&ie["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&k(rt,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),ge&&(u=gn(u)),zt&&Ne?jt(u):u},o.setConfig=function(){on(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Te=!0,Ae=ie,we=le},o.clearConfig=function(){tn=null,Te=!1,Ae=null,we=null,zt=Mt,Pt=""},o.isValidAttribute=function(t,e,n){tn||on({});const o=Qe(t),r=Qe(e);return _n(o,r,n)},o.addHook=function(t,e){"function"==typeof e&&D(Kt,t)&&y(Kt[t],e)},o.removeHook=function(t,e){if(D(Kt,t)){if(void 0!==e){const n=d(Kt[t],e);return-1===n?void 0:g(Kt[t],n,1)[0]}return h(Kt[t])}},o.removeHooks=function(t){D(Kt,t)&&(Kt[t]=[])},o.removeAllHooks=function(){Kt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();exports.default=wt;
|
|
5
|
+
function e(e,n){return function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(c=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);c=!0);}catch(t){u=!0,r=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0});const n=Object.entries,o=Object.setPrototypeOf,r=Object.isFrozen,i=Object.getPrototypeOf,a=Object.getOwnPropertyDescriptor;let l=Object.freeze,c=Object.seal,u=Object.create,s="undefined"!=typeof Reflect&&Reflect,f=s.apply,p=s.construct;l||(l=function(t){return t}),c||(c=function(t){return t}),f||(f=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return t.apply(e,o)}),p||(p=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return new t(...n)});const m=P(Array.prototype.forEach),d=P(Array.prototype.lastIndexOf),h=P(Array.prototype.pop),y=P(Array.prototype.push),g=P(Array.prototype.slice),b=P(Array.prototype.splice),S=Array.isArray,T=U(Set),A=P(Set.prototype.add),w=P(Set.prototype.has),E=P(String.prototype.toLowerCase),v=P(String.prototype.toString),O=P(String.prototype.match),_=P(String.prototype.replace),x=P(String.prototype.indexOf),N=P(String.prototype.trim),D=P(Number.prototype.toString),k=P(Boolean.prototype.toString),C="undefined"==typeof BigInt?null:P(BigInt.prototype.toString),R="undefined"==typeof Symbol?null:P(Symbol.prototype.toString),I=P(Object.prototype.hasOwnProperty),L=P(Object.prototype.toString),z=P(RegExp.prototype.test),M=U(TypeError);function P(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return f(t,e,o)}}function U(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return p(t,n)}}function F(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(o&&o(t,null),!S(e))return t;let i=e.length;for(;i--;){let o=e[i];if("string"==typeof o){const t=n(o);t!==o&&(r(e)||(e[i]=t),o=t)}t[o]=!0}return t}function H(t){for(let e=0;e<t.length;e++)I(t,e)||(t[e]=null);return t}function j(t){const o=u(null);for(const i of n(t)){var r=e(i,2);const n=r[0],a=r[1];I(t,n)&&(S(a)?o[n]=H(a):a&&"object"==typeof a&&a.constructor===Object?o[n]=j(a):o[n]=a)}return o}function B(t,e){for(;null!==t;){const n=a(t,e);if(n){if(n.get)return P(n.get);if("function"==typeof n.value)return P(n.value)}t=i(t)}return function(){return null}}const W=l(["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"]),Y=l(["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"]),G=l(["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"]),q=l(["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"]),$=l(["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"]),X=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),K=l(["#text"]),V=l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Z=l(["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","dominant-baseline","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","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),J=l(["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"]),Q=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tt=c(/{{[\w\W]*|^[\w\W]*}}/g),et=c(/<%[\w\W]*|^[\w\W]*%>/g),nt=c(/\${[\w\W]*/g),ot=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),rt=c(/^aria-[\-\w]+$/),it=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),at=c(/^(?:\w+script|data):/i),lt=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ct=c(/^html$/i),ut=c(/^[a-z][.\w]*(-[.\w]+)+$/i),st=c(/<[/\w!]/g),ft=c(/<[/\w]/g),pt=c(/<\/no(script|embed|frames)/i),mt=c(/\/>/i),dt=1,ht=3,yt=7,gt=8,bt=9,St=11,Tt=l(F({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),At=function(){return"undefined"==typeof window?null:window},wt=function(t,e,n,o){return I(t,e)&&S(t[e])?F(o.base?j(o.base):{},t[e],o.transform):n},Et=function(t,e,n){const o=I(t,e)?t[e]:void 0;return o&&"object"==typeof o?j(o):n()};var vt=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:At();const o=e=>t(e);if(o.version="3.4.17",o.removed=[],!e||!e.document||e.document.nodeType!==bt||!e.Element)return o.isSupported=!1,o;let r=e.document;const s=r,f=s.currentScript;e.DocumentFragment;const p=e.HTMLTemplateElement,U=e.Node,H=e.Element,vt=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const Ot=e.DOMParser,_t=e.trustedTypes,xt=H.prototype,Nt=B(xt,"cloneNode"),Dt=B(xt,"remove"),kt=B(xt,"removeAttributeNode"),Ct=B(xt,"nextSibling"),Rt=B(xt,"childNodes"),It=B(xt,"parentNode"),Lt=B(xt,"shadowRoot"),zt=B(xt,"attributes"),Mt=U&&U.prototype?B(U.prototype,"nodeType"):null,Pt=U&&U.prototype?B(U.prototype,"nodeName"):null,Ut=U&&U.prototype?B(U.prototype,"ownerDocument"):null,Ft=function(t){return Mt?Mt(t):t.nodeType},Ht=function(t){return Pt?Pt(t):t.nodeName},jt=function(t,e){for(;null!==t;){const n=a(t,e);if(n)return n.get?P(n.get):null;t=i(t)}return null}(xt,"namespaceURI"),Bt=function(t){return jt?jt(t):t.namespaceURI};if("function"==typeof p){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let Wt,Yt,Gt="",qt=!1,$t=0;const Xt=function(){if($t>0)throw M('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Kt=function(t){Xt(),$t++;try{return Wt.createHTML(t)}finally{$t--}},Vt=function(){return qt||(Yt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(_t,f),qt=!0),Yt},Zt=r,Jt=Zt.implementation,Qt=Zt.createNodeIterator,te=Zt.createDocumentFragment,ee=Zt.getElementsByTagName,ne=s.importNode;let oe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof n&&"function"==typeof It&&Jt&&void 0!==Jt.createHTMLDocument;const re=tt,ie=et,ae=nt,le=ot,ce=rt,ue=at,se=lt,fe=ut;let pe=it,me=null;const de=F({},[...W,...Y,...G,...$,...K]);let he=null;const ye=F({},[...V,...Z,...J,...Q]);let ge=Object.seal(u(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}})),be=null,Se=null;const Te=Object.seal(u(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ae=!0,we=!0,Ee=!1,ve=!0,Oe=!1,_e=!0,xe=!1,Ne=!1,De=null,ke=null,Ce=!1,Re=!1,Ie=!1,Le=!1,ze=!0,Me=!1;const Pe="user-content-";let Ue=!0,Fe=!1,He=null,je={},Be=null;const We=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Ge=F({},["audio","video","img","source","image","track"]);let qe=null;const $e=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml";let Ze=Ve,Je=!1,Qe=null;const tn=F({},[Xe,Ke,Ve],v),en=l(["mi","mo","mn","ms","mtext"]);let nn=F({},en);const on=l(["annotation-xml"]);let rn=F({},on);const an=F({},["title","style","font","a","script"]);let ln=null;const cn=["application/xhtml+xml","text/html"];let un=null,sn=null;const fn=r.createElement("form"),pn=function(t){return t instanceof RegExp||t instanceof Function},mn=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(sn&&sn===t)return;t&&"object"==typeof t||(t={}),t=j(t),ln=-1===cn.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,un="application/xhtml+xml"===ln?v:E,me=wt(t,"ALLOWED_TAGS",de,{transform:un}),he=wt(t,"ALLOWED_ATTR",ye,{transform:un}),Qe=wt(t,"ALLOWED_NAMESPACES",tn,{transform:v}),qe=wt(t,"ADD_URI_SAFE_ATTR",$e,{transform:un,base:$e}),Ye=wt(t,"ADD_DATA_URI_TAGS",Ge,{transform:un,base:Ge}),Be=wt(t,"FORBID_CONTENTS",We,{transform:un}),be=wt(t,"FORBID_TAGS",j({}),{transform:un}),Se=wt(t,"FORBID_ATTR",j({}),{transform:un}),je=!!I(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?j(t.USE_PROFILES):t.USE_PROFILES),Ae=!1!==t.ALLOW_ARIA_ATTR,we=!1!==t.ALLOW_DATA_ATTR,Ee=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Oe=t.SAFE_FOR_TEMPLATES||!1,_e=!1!==t.SAFE_FOR_XML,xe=t.WHOLE_DOCUMENT||!1,Re=t.RETURN_DOM||!1,Ie=t.RETURN_DOM_FRAGMENT||!1,Le=t.RETURN_TRUSTED_TYPE||!1,Ce=t.FORCE_BODY||!1,ze=!1!==t.SANITIZE_DOM,Me=t.SANITIZE_NAMED_PROPS||!1,Ue=!1!==t.KEEP_CONTENT,Fe=t.IN_PLACE||!1,pe=function(t){try{return z(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:it,Ze="string"==typeof t.NAMESPACE?t.NAMESPACE:Ve,nn=Et(t,"MATHML_TEXT_INTEGRATION_POINTS",(()=>F({},en))),rn=Et(t,"HTML_INTEGRATION_POINTS",(()=>F({},on)));const e=Et(t,"CUSTOM_ELEMENT_HANDLING",(()=>u(null)));if(ge=u(null),I(e,"tagNameCheck")&&pn(e.tagNameCheck)&&(ge.tagNameCheck=e.tagNameCheck),I(e,"attributeNameCheck")&&pn(e.attributeNameCheck)&&(ge.attributeNameCheck=e.attributeNameCheck),I(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ge.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),c(ge),Oe&&(we=!1),Ie&&(Re=!0),je&&(me=F({},K),he=u(null),!0===je.html&&(F(me,W),F(he,V)),!0===je.svg&&(F(me,Y),F(he,Z),F(he,Q)),!0===je.svgFilters&&(F(me,G),F(he,Z),F(he,Q)),!0===je.mathMl&&(F(me,$),F(he,J),F(he,Q))),Te.tagCheck=null,Te.attributeCheck=null,I(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?Te.tagCheck=t.ADD_TAGS:S(t.ADD_TAGS)&&(me===de&&(me=j(me)),F(me,t.ADD_TAGS,un))),I(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?Te.attributeCheck=t.ADD_ATTR:S(t.ADD_ATTR)&&(he===ye&&(he=j(he)),F(he,t.ADD_ATTR,un))),I(t,"ADD_FORBID_CONTENTS")&&S(t.ADD_FORBID_CONTENTS)&&(Be===We&&(Be=j(Be)),F(Be,t.ADD_FORBID_CONTENTS,un)),Ue&&(me["#text"]=!0),xe&&F(me,["html","head","body"]),me.table&&(F(me,["tbody"]),delete be.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Wt;Wt=t.TRUSTED_TYPES_POLICY;try{Gt=Kt("")}catch(t){throw Wt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(Wt=void 0,Gt=""):(void 0===Wt&&(Wt=Vt()),Wt&&"string"==typeof Gt&&(Gt=Kt("")));l&&l(t),sn=t},dn=F({},[...Y,...G,...q]),hn=F({},[...$,...X]),yn=function(t){const e=Bt(t),n=E(Ht(t)),o=It(t);let r,i;return o&&Ft(o)===dt?(r={namespaceURI:Bt(o)},i=E(Ht(o))):(r={namespaceURI:Ze},i="template"),!!Qe[e]&&(e===Ke?function(t,e,n){return e.namespaceURI===Ve?"svg"===t:e.namespaceURI===Xe?"svg"===t&&("annotation-xml"===n||nn[n]):Boolean(dn[t])}(n,r,i):e===Xe?function(t,e,n){return e.namespaceURI===Ve?"math"===t:e.namespaceURI===Ke?"math"===t&&rn[n]:Boolean(hn[t])}(n,r,i):e===Ve?function(t,e,n){return!(e.namespaceURI===Ke&&!rn[n])&&!(e.namespaceURI===Xe&&!nn[n])&&!hn[t]&&(an[t]||!dn[t])}(n,r,i):!("application/xhtml+xml"!==ln||!Qe[e]))},gn=function(t){y(o.removed,{element:t});try{It(t).removeChild(t)}catch(e){if(Dt(t),!It(t))throw M("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},bn=function(t,e,n){try{kt(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},Sn=function(t){En(t);const e=Rt(t);e&&m(g(e),(t=>{try{Dt(t)}catch(t){}}));const n=Ft(t)===dt?zt(t):null;if(n)for(let e=n.length-1;e>=0;--e){const o=n[e],r=o&&o.name;"string"==typeof r&&bn(t,o,r)}},Tn=function(t,e,n){if(!n)try{n=e.getAttributeNode(t)}catch(t){n=null}y(o.removed,{attribute:n||null,from:e});try{n?kt(e,n):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(Re||Ie)try{gn(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},An=function(t){const e=zt(t);if(e)for(let n=e.length-1;n>=0;--n){const o=e[n],r=o&&o.name;"string"!=typeof r||he[un(r)]||bn(t,o,r)}},wn=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[t];for(;o.length>0;){const t=o.pop();if(!1===e(t))continue;if(n&&Ft(t)===dt){const e=Lt(t);Ln(e)&&o.push(e)}const r=Rt(t);if(r)for(let t=r.length-1;t>=0;--t)o.push(r[t])}},En=function(t){wn(t,(t=>{Ft(t)===dt&&An(t)}))},vn=function(t){const e=[];return wn(t,(t=>{e.push(t)}),!0),e},On=function(t,e){let n=!1;return m(o.removed,(e=>{e.element&&(n=n||e.element===t,En(e.element))})),function(t,e){const n=T();m(vn(t),(t=>{Ft(t)===dt&&A(n,t)})),m(e,(t=>{Ft(t)!==dt||w(n,t)||An(t)}))}(t,e),n},_n=function(t,e,n,o){const r=Dn(t);let i;for(;i=r.nextNode();)w(o,i)&&!w(He,i)&&(e&&Mn(oe.uponSanitizeShadowNode,i,null),Hn(i,n),$n(i,n),Ln(i.content)&&Xn(i.content))},xn=function(t,e){return!!_e&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},Nn=function(t){let e=null,n=null;if(Ce)t="<remove></remove>"+t;else{const e=O(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===ln&&Ze===Ve&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=Wt?Kt(t):t;if(Ze===Ve)try{e=(new Ot).parseFromString(o,ln)}catch(t){}if(!e||!e.documentElement){e=Jt.createDocument(Ze,"template",null);try{e.documentElement.innerHTML=Je?Gt:o}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Ze===Ve?ee.call(e,xe?"html":"body")[0]:xe?e.documentElement:i},Dn=function(t){const e=Ut?Ut(t):t.ownerDocument;return Qt.call(e||t,t,vt.SHOW_ELEMENT|vt.SHOW_COMMENT|vt.SHOW_TEXT|vt.SHOW_PROCESSING_INSTRUCTION|vt.SHOW_CDATA_SECTION,null)},kn=function(t){return t=_(t,re," "),t=_(t,ie," "),t=_(t,ae," ")},Cn=function(t){var e;Rn(t);const n=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");n&&m(n,(t=>{Ln(t.content)&&Cn(t.content)}))},Rn=function(t){t.normalize();const e=Ut?Ut(t):t.ownerDocument,n=Qt.call(e||t,t,vt.SHOW_TEXT|vt.SHOW_COMMENT|vt.SHOW_CDATA_SECTION|vt.SHOW_PROCESSING_INSTRUCTION,null);let o=n.nextNode();for(;o;)o.data=kn(o.data),o=n.nextNode()},In=function(t){const e=Pt?Pt(t):null;return"string"==typeof e&&("form"===un(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==zt(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==Mt(t)||t.childNodes!==Rt(t)))},Ln=function(t){if(!Mt||"object"!=typeof t||null===t)return!1;try{return Mt(t)===St}catch(t){return!1}},zn=function(t){if(!Mt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof Mt(t)}catch(t){return!1}};function Mn(t,e,n){0!==t.length&&m(t,(t=>{t.call(o,e,n,sn)}))}const Pn=function(t,e){if(t instanceof RegExp)return z(t,e);if(t instanceof Function){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return Boolean(t(e,...o))}return!1},Un=function(t,e,n,o){return 0===t.length?e:e===n||e===o?j(e):e},Fn=function(t,e){return t!==e&&null===It(t)&&(Fe&&En(t),!0)},Hn=function(t,e){var n;if(n=t,He&&A(He,n),Mn(oe.beforeSanitizeElements,t,null),Fn(t,e))return!0;if(In(t))return gn(t),!0;const r=un(Ht(t));if(me=Un(oe.uponSanitizeElement,me,de,De),Mn(oe.uponSanitizeElement,t,{tagName:r,allowedTags:me}),Fn(t,e))return!0;if(function(t,e){return!!(_e&&t.hasChildNodes()&&!zn(t.firstElementChild)&&z(st,t.textContent)&&z(st,t.innerHTML))||!!(_e&&Tt[e]&&Ft(t)===dt&&Bt(t)===Ve&&(zn(t.firstElementChild)||"string"==typeof t.textContent&&z(st,t.textContent)))||t.nodeType===yt||!(!_e||t.nodeType!==gt||!z(ft,t.data))}(t,r))return gn(t),!0;if(be[r]||!(Te.tagCheck instanceof Function&&Te.tagCheck(r))&&!me[r]){const n=function(t,e,n){if(!be[e]&&Wn(e)&&Pn(ge.tagNameCheck,e))return!1;if(Ue&&!Be[e]&&!Be[E(e)]){const e=It(t),o=Rt(t);if(o&&e)for(let r=o.length-1;r>=0;--r){const i=t===n?Nt(o[r],!0):o[r];e.insertBefore(i,Ct(t))}}return gn(t),!0}(t,r,e);return!(!1!==n||(Mn(oe.afterSanitizeElements,t,null),!Fn(t,e)))||n}if(Ft(t)===dt&&!yn(t))return gn(t),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&z(pt,t.innerHTML))return gn(t),!0;if(Oe&&t.nodeType===ht){const e=kn(t.textContent);t.textContent!==e&&(y(o.removed,{element:t.cloneNode()}),t.textContent=e)}return Mn(oe.afterSanitizeElements,t,null),Fn(t,e)},jn=function(t,e,n){if(Se[e])return!1;if(xn(e,t))return!1;if(ze&&("id"===e||"name"===e)&&(n in r||n in fn))return!1;const o=he[e]||Te.attributeCheck instanceof Function&&Te.attributeCheck(e,t);return!(!we||!z(le,e))||(!(!Ae||!z(ce,e))||(o?!!qe[e]||(!!z(pe,_(n,se,""))||(!("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==x(n,"data:")||!Ye[t])||(!(!Ee||z(ue,_(n,se,"")))||!n))):Wn(t)&&Pn(ge.tagNameCheck,t)&&Pn(ge.attributeNameCheck,e,t)||"is"===e&&ge.allowCustomizedBuiltInElements&&Pn(ge.tagNameCheck,n)))},Bn=F({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Wn=function(t){return!Bn[E(t)]&&z(fe,t)},Yn=function(t,e,n,o){if(Wt&&"object"==typeof _t&&"function"==typeof _t.getAttributeType&&!n)switch(_t.getAttributeType(t,e)){case"TrustedHTML":return Kt(o);case"TrustedScriptURL":return function(t){Xt(),$t++;try{return Wt.createScriptURL(t)}finally{$t--}}(o)}return o},Gn=function(t,e,n,o){try{return n?t.setAttributeNS(n,e,o):t.setAttribute(e,o),!In(t)||(gn(t),!1)}catch(n){return Tn(e,t),!1}},qn=function(t,e){return!(!_e||!z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e))||"attributename"===E(t)&&null!==O(e,"href")},$n=function(t,e){if(Mn(oe.beforeSanitizeAttributes,t,null),Fn(t,e))return;const n=t.attributes;if(!n||In(t))return;he=Un(oe.uponSanitizeAttribute,he,ye,ke);const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he,forceKeepAttr:void 0};let i=n.length;const a=un(t.nodeName);for(;i--;){const e=n[i],l=e.name,c=e.namespaceURI,u=e.value,s=un(l),f=u;let p="value"===l?f:N(f),m=!1;r.attrName=s,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,Mn(oe.uponSanitizeAttribute,t,r),p=r.attrValue,!Me||"id"!==s&&"name"!==s||0===x(p,Pe)||(Tn(l,t,e),p=Pe+p,m=!0),qn(l,p)?Tn(l,t,e):r.forceKeepAttr||(r.keepAttr&&(ve||!z(mt,p))?(Oe&&(p=kn(p)),jn(a,s,p)?(p=Yn(a,s,c,p),p!==f&&Gn(t,l,c,p)&&m&&h(o.removed)):Tn(l,t,e)):Tn(l,t,e))}Mn(oe.afterSanitizeAttributes,t,null),Fn(t,e)},Xn=function(t){let e=null;const n=Dn(t);for(Mn(oe.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(Mn(oe.uponSanitizeShadowNode,e,null),Hn(e,t),$n(e,t),Ln(e.content)&&Xn(e.content),Ft(e)===dt){const t=Lt(e);Ln(t)&&(Kn(t),Xn(t))}Oe&&Rn(t),Mn(oe.afterSanitizeShadowDOM,t,null)},Kn=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){Xn(t.shadow);continue}const n=t.node,o=Ft(n)===dt,r=Rt(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(o){const t=Pt?Pt(n):null;if("string"==typeof t&&"template"===un(t)){const t=n.content;Ln(t)&&e.push({node:t,shadow:null})}}if(o){const t=Lt(n);Ln(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return o.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,a=null;if(Je=!t,Je&&(t="\x3c!--\x3e"),"string"!=typeof t&&!zn(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return D(t);case"boolean":return k(t);case"bigint":return C?C(t):"0";case"symbol":return R?R(t):"Symbol()";case"undefined":default:return L(t);case"function":case"object":{if(null===t)return L(t);const e=t,n=B(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:L(t)}return L(t)}}}(t)))throw M("dirty is not a string, aborting");if(!o.isSupported)return t;Ne?(me=De,he=ke):mn(e),(oe.uponSanitizeElement.length>0||oe.uponSanitizeAttribute.length>0)&&(me=j(me)),oe.uponSanitizeAttribute.length>0&&(he=j(he)),o.removed=[];const l=Fe&&"string"!=typeof t&&zn(t);let c=[];const u=He;if(l){f=t,_e&&wn(f,(t=>{const e=Ft(t);if(e===yt||e===gt&&z(ft,t.data)){try{Dt(t)}catch(t){}return!1}if(e===dt){const e=t,n=un(Ht(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&xn("for",n)&&e.removeAttribute("for")}catch(t){}}return!0}));const e=Ht(t);if("string"==typeof e){const n=un(e);if(!me[n]||be[n])throw Sn(t),M("root node is forbidden and cannot be sanitized in-place")}if(In(t))throw Sn(t),M("root node is clobbered and cannot be sanitized in-place");c=vn(t),He=T()}else if(zn(t))n=Nn("\x3c!----\x3e"),r=n.ownerDocument.importNode(t,!0),r.nodeType===dt&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r),Kn(n);else{if(!Re&&!Oe&&!xe&&-1===t.indexOf("<"))return Wt&&Le?Kt(t):t;if(n=Nn(t),!n)return Re?null:Le?Gt:""}var f;n&&Ce&&gn(n.firstChild);const p=l?t:n;try{l&&Kn(t);const e=Dn(p);for(;i=e.nextNode();)Hn(i,p),$n(i,p),Ln(i.content)&&Xn(i.content);l&&function(t,e){const n=He;let o=null;const r=()=>(o||(o=T(),m(e,(t=>{A(o,t)}))),o);for(let e=0;;e++){const o=vn(t),i=[t];let a=!1;if(m(o,(t=>{Ft(t)===St?y(i,t):a||w(n,t)||(a=w(r(),t))})),!a)return;if(e>=8)throw M("the tree kept changing during in-place sanitization; refusing to return it");m(i,((e,n)=>{_n(e,n>0,t,r())}))}}(t,c)}catch(e){throw l&&(Sn(t),On(t,c)),e}finally{He=u}if(l){if(On(t,c))throw M("a node selected for removal could not be safely returned; refusing to sanitize in place");return Oe&&Cn(t),t}if(Re){if(Oe&&Cn(n),Ie)for(a=te.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(he.shadowroot||he.shadowrootmode)&&(a=ne.call(s,a,!0)),a}let d=xe?n.outerHTML:n.innerHTML;return xe&&me["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&z(ct,n.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+d),Oe&&(d=kn(d)),Wt&&Le?Kt(d):d},o.setConfig=function(){mn(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ne=!0,De=me,ke=he},o.clearConfig=function(){sn=null,Ne=!1,De=null,ke=null,Wt=Yt,Gt=""},o.isValidAttribute=function(t,e,n){sn||mn({});const o=un(t),r=un(e);return("string"!=typeof n||!(qn(e,n)||!ve&&z(mt,n)))&&jn(o,r,n)},o.addHook=function(t,e){"function"==typeof e&&I(oe,t)&&y(oe[t],e)},o.removeHook=function(t,e){if(I(oe,t)){if(void 0!==e){const n=d(oe[t],e);return-1===n?void 0:b(oe[t],n,1)[0]}return h(oe[t])}},o.removeHooks=function(t){I(oe,t)&&(oe[t]=[])},o.removeAllHooks=function(){oe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();exports.default=vt;
|
|
6
6
|
//# sourceMappingURL=purify.es.js.map
|