blob: 95099606c09310c5715f46adadb118e7f9ece1c7 [file] [edit]
/*! @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<t;n++)r[n]=e[n];return r}function n(e){if(Array.isArray(e))return e}function r(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function i(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
function a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};let c=Object.entries,l=Object.keys,u=Object.setPrototypeOf,d=Object.isFrozen,f=Object.getPrototypeOf,p=Object.getOwnPropertyDescriptor,m=Object.freeze,h=Object.seal,g=Object.create,ee=typeof Reflect<`u`&&Reflect,te=ee.apply,ne=ee.construct;m||(m=function(e){return e}),h||(h=function(e){return e}),te||(te=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)}),ne||(ne=function(e){return new e(...[...arguments].slice(1))});let _=E(Array.prototype.forEach),re=E(Array.prototype.lastIndexOf),ie=E(Array.prototype.pop),ae=E(Array.prototype.push),oe=E(Array.prototype.slice),se=E(Array.prototype.splice),ce=Array.isArray,le=Ce(Set),ue=E(Set.prototype.add),de=E(Set.prototype.has),fe=E(Set.prototype.delete),pe=Ce(Map),me=E(Map.prototype.get),he=E(Map.prototype.set),v=E(String.prototype.toLowerCase),ge=E(String.prototype.toString),_e=E(String.prototype.match),ve=E(String.prototype.replace),ye=E(String.prototype.indexOf),be=E(String.prototype.trim),xe=E(Number.prototype.toString),y=E(Boolean.prototype.toString),b=typeof BigInt>`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<e.length;t++)x(e,t)||(e[t]=null);return e}function we(e){let t=g(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];x(e,i)&&(t[i]=ce(o)?O(o):o&&typeof o==`object`&&o.constructor===Object?we(o):o)}return t}function Te(e){let t=g(null),n=l(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}function Ee(e){switch(typeof e){case`string`:return e;case`number`:return xe(e);case`boolean`:return y(e);case`bigint`:return b?b(e):`0`;case`symbol`:return Se?Se(e):`Symbol()`;case`undefined`:return S(e);case`function`:case`object`:{if(e===null)return S(e);let t=e,n=k(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:S(e)}return S(e)}default:return S(e)}}function k(e,t){for(;e!==null;){let n=p(e,t);if(n){if(n.get)return E(n.get);if(typeof n.value==`function`)return E(n.value)}e=f(e)}function n(){return null}return n}function De(e,t){for(;e!==null;){let n=p(e,t);if(n)return n.get?E(n.get):null;e=f(e)}return null}function Oe(e){if(!e)return!1;try{return w(e,``),!0}catch(e){return!1}}let ke=m(/* @__PURE__ */ `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`.split(`.`)),Ae=m(/* @__PURE__ */ `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`.split(`.`)),je=m([`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`]),Me=m([`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`]),Ne=m(/* @__PURE__ */ `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`.split(`.`)),Pe=m([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Fe=m([`#text`]),Ie=m(/* @__PURE__ */ `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`.split(`.`)),Le=m(/* @__PURE__ */ `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`.split(`.`)),Re=m(/* @__PURE__ */ `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`.split(`.`)),ze=m([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Be=h(/{{[\w\W]*|^[\w\W]*}}/g),Ve=h(/<%[\w\W]*|^[\w\W]*%>/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]|^-?>|--!?>|<!-$/g),nt=h(/<\/no(script|embed|frames)/i),rt=h(/\/>/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=`<remove></remove>`+e;else{let t=_e(e,at);r=t&&t[0]}X===`application/xhtml+xml`&&Y===J&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);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=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
`+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