/*! @license DOMPurify 3.5.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.5.0/LICENSE */ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.DOMPurify=t())})(this,function(){"use strict";function e(e,t){this.v=e,this.k=t}function t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:E(BigInt.prototype.toString),Se=typeof Symbol>`u`?null:E(Symbol.prototype.toString),x=E(Object.prototype.hasOwnProperty),S=E(Object.prototype.toString),C=RegExp.prototype.test,w=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),te(C,e,[t])},T=Ce(TypeError);function E(e){return function(t){var n=[...arguments].slice(1);return te(e,t,n)}}function Ce(e){return function(){return ne(e,[...arguments])}}function D(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v;if(u&&u(e,null),!ce(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(d(t)||(t[r]=e),i=e)}e[i]=!0}return e}function O(e){for(let t=0;t/g),He=h(/\${[\w\W]*/g),Ue=h(/{{|}}|\${|<%|%>/),We=h(/[^\t\n\f\r ]/),Ge=h(/\u0000/g),Ke=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),qe=h(/^aria-[\-\w]+$/),Je=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ye=h(/^(?:\w+script|data):/i),Xe=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ze=h(/^html$/i),Qe=h(/^[a-z][.\w]*(-[.\w]+)+$/i),$e=h(/<[/\w!]/g),et=h(/<[/\w]/g),tt=h(/<[/\w]|^-?>|--!?>|/i),it=h(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),at=h(/^[\r\n\t ]+/),A={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},ot=m(D({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),st=m(D({},[`textarea`,`title`])),ct=m(D({},[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`embed`,`frame`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`])),lt=function(){return typeof window>`u`?null:window},ut=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},dt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},j=function(e,t,n,r){return x(e,t)&&ce(e[t])?D(r.base?Te(r.base):{},e[t],r.transform):n},ft=function(e,t,n){let r=x(e,t)?e[t]:void 0;return r&&typeof r==`object`?we(r):n};function pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lt(),t=e=>pt(e);if(t.version=`3.5.0`,t.removed=[],!e||!e.document||e.document.nodeType!==A.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,s=e.Element,l=e.NodeFilter,u=e.DOMParser,d=e.trustedTypes,f=s.prototype,p=k(f,`cloneNode`),ee=k(f,`remove`),te=k(f,`removeChild`),ne=k(f,`removeAttributeNode`),xe=k(f,`nextSibling`),y=k(f,`childNodes`),b=k(f,`parentNode`),Se=k(f,`shadowRoot`),S=k(f,`attributes`),C=o&&o.prototype?k(o.prototype,`nodeType`):null,E=o&&o.prototype?k(o.prototype,`nodeName`):null,Ce=o&&o.prototype?k(o.prototype,`ownerDocument`):null,O=function(e){return C?C(e):e.nodeType},M=function(e){return E?E(e):e.nodeName},mt=De(f,`namespaceURI`),ht=function(e){return mt?mt(e):e.namespaceURI},gt=function(e){return O(e)===A.element?S(e):null};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let N,P=``,_t,vt=!1,yt=0,bt=function(){if(yt>0)throw T(`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.`)},xt=function(e){bt(),yt++;try{return N.createHTML(e)}finally{yt--}},St=function(e){return N&&$t?xt(e):e},Ct=function(e){bt(),yt++;try{return N.createScriptURL(e)}finally{yt--}},wt=function(){return vt||(_t=ut(d,i),vt=!0),_t},Tt=n,Et=Tt.implementation,Dt=Tt.createNodeIterator,Ot=Tt.createDocumentFragment,kt=Tt.getElementsByTagName,At=r.importNode,F=dt();t.isSupported=typeof c==`function`&&typeof b==`function`&&Et&&Et.createHTMLDocument!==void 0;let jt=Be,Mt=Ve,Nt=He,Pt=Ke,Ft=qe,It=Ye,Lt=Xe,Rt=Qe,zt=Je,I=null,Bt=D({},[...ke,...Ae,...je,...Ne,...Fe]),L=null,Vt=D({},[...Ie,...Le,...Re,...ze]),R=null,Ht=null,Ut=null,z=Object.seal(g(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Wt=!0,Gt=!0,Kt=!1,qt=!0,B=!1,V=!0,H=!1,Jt=!1,Yt=null,Xt=null,Zt=!1,U=!1,Qt=!1,$t=!1,en=!0,tn=!1,nn=`user-content-`,rn=!0,an=!1,W=null,G=null,K=!1,q=null,on=D({},/* @__PURE__ */ `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`.split(`.`)),sn=null,cn=D({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ln=null,un=D({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),dn=`http://www.w3.org/1998/Math/MathML`,fn=`http://www.w3.org/2000/svg`,J=`http://www.w3.org/1999/xhtml`,Y=J,pn=!1,mn=null,hn=D({},[dn,fn,J],ge),gn=m(D({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),_n=null,vn=m(D({},[`annotation-xml`])),yn=null,bn=m(g(null)),xn=D({},[`title`,`style`,`font`,`a`,`script`]),X=null,Sn=[`application/xhtml+xml`,`text/html`],Z=null,Cn=null,wn=null,Tn=n.createElement(`form`),En=function(e){return e instanceof RegExp||e instanceof Function},Dn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=we(e),X=Sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Z=X===`application/xhtml+xml`?ge:v,I=j(e,`ALLOWED_TAGS`,Bt,{transform:Z}),L=j(e,`ALLOWED_ATTR`,Vt,{transform:Z}),mn=j(e,`ALLOWED_NAMESPACES`,hn,{transform:ge}),ln=j(e,`ADD_URI_SAFE_ATTR`,un,{transform:Z,base:un}),sn=j(e,`ADD_DATA_URI_TAGS`,cn,{transform:Z,base:cn}),q=j(e,`FORBID_CONTENTS`,on,{transform:Z}),Ht=j(e,`FORBID_TAGS`,g(null),{transform:Z}),Ut=j(e,`FORBID_ATTR`,g(null),{transform:Z}),K=x(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?we(e.USE_PROFILES):e.USE_PROFILES:!1,Wt=e.ALLOW_ARIA_ATTR!==!1,Gt=e.ALLOW_DATA_ATTR!==!1,Kt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,qt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,B=e.SAFE_FOR_TEMPLATES||!1,V=e.SAFE_FOR_XML!==!1,H=e.WHOLE_DOCUMENT||!1,U=e.RETURN_DOM||!1,Qt=e.RETURN_DOM_FRAGMENT||!1,$t=e.RETURN_TRUSTED_TYPE||!1,Zt=e.FORCE_BODY||!1,en=e.SANITIZE_DOM!==!1,tn=e.SANITIZE_NAMED_PROPS||!1,rn=e.KEEP_CONTENT!==!1,an=e.IN_PLACE||!1,zt=Oe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Je,Y=typeof e.NAMESPACE==`string`?e.NAMESPACE:J,_n=ft(e,`MATHML_TEXT_INTEGRATION_POINTS`,gn),yn=ft(e,`HTML_INTEGRATION_POINTS`,vn);let t=ft(e,`CUSTOM_ELEMENT_HANDLING`,bn);if(R=g(null),x(t,`tagNameCheck`)&&En(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),x(t,`attributeNameCheck`)&&En(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),x(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),h(R),B&&(Gt=!1),Qt&&(U=!0),K&&((x(e,`ALLOWED_TAGS`)||x(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),I=D({},Fe),L=g(null),K.html===!0&&(D(I,ke),D(L,Ie)),K.svg===!0&&(D(I,Ae),D(L,Le),D(L,ze)),K.svgFilters===!0&&(D(I,je),D(L,Le),D(L,ze)),K.mathMl===!0&&(D(I,Ne),D(L,Re),D(L,ze))),z.tagCheck=null,z.attributeCheck=null,x(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?z.tagCheck=e.ADD_TAGS:ce(e.ADD_TAGS)&&(I===Bt&&(I=Te(I)),D(I,e.ADD_TAGS,Z))),x(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?z.attributeCheck=e.ADD_ATTR:ce(e.ADD_ATTR)&&(L===Vt&&(L=Te(L)),D(L,e.ADD_ATTR,Z))),x(e,`ADD_FORBID_CONTENTS`)&&ce(e.ADD_FORBID_CONTENTS)&&(q===on&&(q=Te(q)),D(q,e.ADD_FORBID_CONTENTS,Z)),rn&&(I[`#text`]=!0),H&&D(I,[`html`,`head`,`body`]),I.table&&(I.tbody=!0,delete Ht.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=N;N=e.TRUSTED_TYPES_POLICY;try{P=xt(``)}catch(e){throw N=t,e}}else e.TRUSTED_TYPES_POLICY===null?(N=void 0,P=``):(N===void 0&&(N=wt()),N&&typeof P==`string`&&(P=xt(``)));Cn=m(e)},On=D({},[...Ae,...je,...Me]),kn=D({},[...Ne,...Pe]),An=function(e,t,n){return t===J?e===`svg`:t===dn?e===`svg`&&(n===`annotation-xml`||_n[n]):!!On[e]},jn=function(e,t,n){return t===J?e===`math`:t===fn?e===`math`&&yn[n]:!!kn[e]},Mn=function(e,t,n){return t===fn&&!yn[n]||t===dn&&!_n[n]?!1:!kn[e]&&(xn[e]||!On[e])},Nn=function(e){let t=ht(e),n=v(M(e)),r=b(e),i=Y,a=`template`;return r&&O(r)===A.element&&(i=ht(r),a=v(M(r))),mn[t]?t===fn?An(n,i,a):t===dn?jn(n,i,a):t===J?Mn(n,i,a):X===`application/xhtml+xml`:!1},Q=function(e){ae(t.removed,{element:e}),qn(e);try{b(e).removeChild(e)}catch(t){if(ee(e),!b(e))throw T(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Pn=function(e,t,n){try{ne(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},Fn=function(e){zn(e);let t=y(e);t&&_(oe(t),t=>{try{te(e,t)}catch(e){}}),O(e)===A.element&&Ln(e,!1)},In=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch(e){r=null}if(ae(t.removed,{attribute:r||null,from:n}),r)Pn(n,r,e);else try{n.removeAttribute(e)}catch(e){}if(e===`is`){if(U||Qt)try{Q(n)}catch(e){}else try{n.setAttribute(e,``)}catch(e){}}},Ln=function(e,t){let n=S(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&L[Z(a)])&&Pn(e,i,a)}},Rn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&O(e)===A.element){let t=Se(e);ar(t)&&r.push(t)}let i=y(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},zn=function(e){Rn(e,e=>{O(e)===A.element&&Ln(e,!0)})},Bn=function(e){let t=[];return Rn(e,e=>{t.push(e)},!0),t},Vn=function(e,t){let n=le();_(Bn(e),e=>{O(e)===A.element&&ue(n,e)}),_(t,e=>{O(e)===A.element&&!de(n,e)&&Ln(e,!0)})},Hn=function(e,n){let r=!1;return _(t.removed,t=>{t.element&&(r=r||t.element===e,zn(t.element))}),Vn(e,n),r},Un=function(e,t){Fn(e),Hn(e,t)},Wn=function(e,t){let n=W,r=null,i=()=>(r||(r=le(),_(t,e=>{ue(r,e)})),r);for(let t=0;;t++){let r=Bn(e),a=[e],o=!1;if(_(r,e=>{O(e)===A.documentFragment?ae(a,e):!o&&!de(n,e)&&(o=de(i(),e))}),!o)return;if(t>=8)throw T(`the tree kept changing during in-place sanitization; refusing to return it`);_(a,(t,n)=>{Gn(t,n>0,e,i())})}},Gn=function(e,t,n,r){let i=Zn(e),a;for(;a=i.nextNode();)de(r,a)&&!de(W,a)&&(t&&$(F.uponSanitizeShadowNode,a,null),xr(a,n))},Kn=function(e){if(!W)return;ue(W,e);let t=me(G,e);if(t!==void 0){if(t>=8)throw T(`the tree kept changing during in-place sanitization; refusing to return it`);he(G,e,t+1)}},qn=function(e){W&&(fe(W,e),me(G,e)===void 0&&he(G,e,0))},Jn=function(e,t){return V?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Yn=function(e){V&&Rn(e,e=>{let t=O(e);if(t===A.processingInstruction||t===A.comment&&w(et,e.data)){try{ee(e)}catch(e){}return!1}if(t===A.element){let t=e,n=Z(M(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Jn(`for`,n)&&t.removeAttribute(`for`)}catch(e){}}return!0})},Xn=function(e){let t=null,r=null;if(Zt)e=``+e;else{let t=_e(e,at);r=t&&t[0]}X===`application/xhtml+xml`&&Y===J&&(e=``+e+``);let i=N?xt(e):e;if(Y===J)try{t=new u().parseFromString(i,X)}catch(e){}if(!t||!t.documentElement){t=Et.createDocument(Y,`template`,null);try{t.documentElement.innerHTML=pn?P:i}catch(e){}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Y===J?kt.call(t,H?`html`:`body`)[0]:H?t.documentElement:a},Zn=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=Ce?Ce(e):e.ownerDocument;return Dt.call(n||e,e,(t?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Qn=function(e){return e=ve(e,jt,` `),e=ve(e,Mt,` `),e=ve(e,Nt,` `),e},$n=function(e){var t;nr(e);let n=(t=e.querySelectorAll)==null?void 0:t.call(e,`template`);n&&_(n,e=>{ar(e.content)&&$n(e.content)})},er=D({},[`caption`,`colgroup`,`col`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`,`style`,`script`,`template`]),tr=function(e){var t;if(X===`application/xhtml+xml`)return;let n=(t=e.querySelectorAll)==null?void 0:t.call(e,`table,tbody,thead,tfoot,tr,colgroup`);n&&n.length!==0&&_(n,t=>{_(oe(y(t)),n=>{let r=O(n);if(!(r===A.text?w(We,n.data):r===A.element&&!er[v(M(n))]))return;let i=t;for(;i&&v(M(i))!==`table`;)i=i===e?null:b(i);let a=i&&i!==e?b(i):null;if(a)try{a.insertBefore(n,i)}catch(e){}})})},nr=function(e){tr(e),e.normalize();let t=Zn(e,!0),n=null,r=t.nextNode();for(;r;){let e=r.data;if(w(Ge,e)&&(e=ve(e,Ge,``),r.data=e),w(Ue,e)&&(e=Qn(e),r.data=e),e&&O(r)===A.text){if(n){let t=n.data,r=t[t.length-1]+e[0];w(Ue,r)&&(n.data=Qn(t+e[0]))}n=r}r=t.nextNode()}},rr=function(e){let t=E?E(e):null;return typeof t!=`string`||Z(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==S(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==C(e)||e.childNodes!==y(e)},ir=function(e){if(!C||typeof e!=`object`||!e)return null;try{let t=C(e);return typeof t==`number`?t:null}catch(e){return null}},ar=function(e){return ir(e)===A.documentFragment},or=function(e){return ir(e)!==null};function $(e,n,r){e.length!==0&&_(e,e=>{e.call(t,n,r,Cn)})}let sr=function(e,t){let n=!!ct[t],r=!!ot[t];return!n&&!r&&!st[t]||ht(e)!==J?!1:n?e.hasChildNodes():or(e.firstElementChild)?!0:r&&typeof e.textContent==`string`&&w($e,e.textContent)},cr=function(e,t,n){return!!(V&&n===A.element&&e.hasChildNodes()&&!or(e.firstElementChild)&&w($e,e.textContent)&&w($e,e.innerHTML)||V&&n===A.element&&sr(e,t)||n===A.processingInstruction||V&&n===A.comment&&w(tt,e.data))},lr=function(e,t){return e instanceof RegExp?w(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},ur=function(e,t,n){if(!Ht[t]&&gr(t)&&lr(R.tagNameCheck,t))return!1;if(rn&&!q[t]&&!q[v(t)]){let t=b(e),r=y(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?p(r[a],!0):r[a];t.insertBefore(i,xe(e))}}}return Q(e),!0},dr=function(e,t,n,r){return e.length===0?t:t===n||t===r?Te(t):t},fr=function(e,t){return e===t||b(e)!==null?!1:(an&&zn(e),qn(e),!0)},pr=function(e,n){if(Kn(e),$(F.beforeSanitizeElements,e,null),fr(e,n))return!0;if(rr(e))return Q(e),!0;let r=Z(M(e)),i=O(e);if(I=dr(F.uponSanitizeElement,I,Bt,Yt),$(F.uponSanitizeElement,e,{tagName:r,allowedTags:I}),fr(e,n))return!0;if(cr(e,r,i))return Q(e),!0;if((Ht[r]||!(z.tagCheck instanceof Function&&z.tagCheck(r))&&!I[r])&&ur(e,r,n))return!0;if(i===A.element&&!Nn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&w(nt,e.innerHTML))return Q(e),!0;if(B&&i===A.text){let n=e.textContent,r=Qn(n);n!==r&&(ae(t.removed,{element:e.cloneNode()}),e.textContent=r)}return $(F.afterSanitizeElements,e,null),fr(e,n)},mr=function(e,t,r){if(Ut[t]||Jn(t,e)||en&&(t===`id`||t===`name`)&&(r in n||r in Tn))return!1;let i=L[t]||z.attributeCheck instanceof Function&&z.attributeCheck(t,e);if(Gt&&w(Pt,t)||Wt&&w(Ft,t))return!0;if(!i)return gr(e)&&lr(R.tagNameCheck,e)&&lr(R.attributeNameCheck,t,e)||t===`is`&&R.allowCustomizedBuiltInElements&&lr(R.tagNameCheck,r);if(ln[t])return!0;let a=ve(r,Lt,``);return w(zt,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ye(r,`data:`)===0&&sn[e]||Kt&&!w(It,a)?!0:!r},hr=D({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),gr=function(e){return!hr[v(e)]&&w(Rt,e)},_r=function(e,t,n,r){if(N&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return xt(r);case`TrustedScriptURL`:return Ct(r)}return r},vr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!rr(e)||(Q(e),!1)}catch(n){return In(t,e),!1}},yr=function(e,t){return V&&w(it,t)?!0:v(e)===`attributename`&&ye(t,`href`)!==-1},br=function(e,n){if($(F.beforeSanitizeAttributes,e,null),fr(e,n))return;let r=gt(e);if(!r||rr(e))return;L=dr(F.uponSanitizeAttribute,L,Vt,Xt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},a=r.length,o=Z(M(e));for(;a--;){let n=r[a];if(!n)continue;let s=n.name,c=n.namespaceURI,l=n.value,u=Z(s),d=l,f=s===`value`?d:be(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(F.uponSanitizeAttribute,e,i),f=i.attrValue,tn&&(u===`id`||u===`name`)&&ye(f,nn)!==0&&(In(s,e,n),f=nn+f,p=!0),yr(s,f)?In(s,e,n):i.forceKeepAttr||(i.keepAttr?!qt&&w(rt,f)?In(s,e,n):(B&&(f=Qn(f)),mr(o,u,f)?(f=_r(o,u,c,f),f!==d&&vr(e,s,c,f)&&p&&ie(t.removed)):In(s,e,n)):In(s,e,n))}$(F.afterSanitizeAttributes,e,null),fr(e,n)},xr=function(e,t){pr(e,t),br(e,t),ar(e.content)&&Sr(e.content)},Sr=function(e){let t=null,n=Zn(e);for($(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(F.uponSanitizeShadowNode,t,null),xr(t,e),O(t)===A.element){let e=Se(t);ar(e)&&(Cr(e),Sr(e))}B&&nr(e),$(F.afterSanitizeShadowDOM,e,null)},Cr=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Sr(e.shadow);continue}let n=e.node,r=O(n)===A.element,i=y(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=E?E(n):null;if(typeof e==`string`&&Z(e)===`template`){let e=n.content;ar(e)&&t.push({node:e,shadow:null})}}if(r){let e=Se(n);ar(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}},wr=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(pn=!e,pn&&(e=``),typeof e!=`string`&&!or(e)&&(e=Ee(e),typeof e!=`string`))throw T(`dirty is not a string, aborting`);if(!t.isSupported)return e;Jt?(I=Yt,L=Xt):Dn(n),wn=Cn,t.removed=[];let c=an&&typeof e!=`string`&&or(e),l=[],u=W,d=G;if(c){Yn(e),l=Bn(e);let t=M(e);if(typeof t==`string`){let n=Z(t);if(!I[n]||Ht[n])throw Un(e,l),T(`root node is forbidden and cannot be sanitized in-place`)}if(rr(e))throw Un(e,l),T(`root node is clobbered and cannot be sanitized in-place`);W=le(),G=pe()}else if(or(e))i=Xn(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===A.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Cr(i);else{if(!U&&!B&&!H&&e.indexOf(`<`)===-1)return St(e);if(i=Xn(e),!i)return U?null:$t?P:``}i&&Zt&&Q(i.firstChild);let f=c?e:i;try{c&&Cr(e);let t=Zn(f);for(;o=t.nextNode();)xr(o,f);c&&Wn(e,l)}catch(t){throw c&&Un(e,l),t}finally{W=u,G=d}if(c){if(Hn(e,l))throw T(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return B&&$n(e),e}if(U){if(B&&$n(i),Qt)for(s=Ot.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=At.call(r,s,!0)),s}B&&nr(i);let p=H?i.outerHTML:i.innerHTML;return H&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Ze,i.ownerDocument.doctype.name)&&(p=` `+p),St(p)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=wn,i=I,a=L,o=t.removed;wn=null;try{return wr(e,n)}finally{wn=r,r&&(Jt||Dn(r),I=i,L=a,t.removed=o)}},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dn(e),Jt=!0,Yt=I,Xt=L},t.clearConfig=function(){Cn=null,Jt=!1,Yt=null,Xt=null,N=_t,P=``},t.isValidAttribute=function(e,t,n){Cn||Dn({});let r=Z(e),i=Z(t);return typeof n==`string`&&(yr(t,n)||!qt&&w(rt,n))?!1:mr(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&x(F,e)&&ae(F[e],t)},t.removeHook=function(e,t){if(x(F,e)){if(t!==void 0){let n=re(F[e],t);return n===-1?void 0:se(F[e],n,1)[0]}return ie(F[e])}},t.removeHooks=function(e){x(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=dt()},t}return pt()}); //# sourceMappingURL=purify.min.js.map