var wr=Object.defineProperty;var yr=(t,e,n)=>e in t?wr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var S=(t,e,n)=>yr(t,typeof e!="symbol"?e+"":e,n);/*! @license DOMPurify 3.4.10 | (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.10/LICENSE */function gn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,s=Array(e);n2?s-2:0),l=2;l1?n-1:0),i=1;i"u"?null:C(BigInt.prototype.toString),xn=typeof Symbol>"u"?null:C(Symbol.prototype.toString),G=C(Object.prototype.hasOwnProperty),Me=C(Object.prototype.toString),z=C(RegExp.prototype.test),ge=$r(TypeError);function C(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:$e;if(dn&&dn(t,null),!ce(e))return t;let s=e.length;for(;s--;){let i=e[s];if(typeof i=="string"){const l=n(i);l!==i&&(Or(e)||(e[s]=l),i=l)}t[i]=!0}return t}function vr(t){for(let e=0;e/g),qr=v(/\${[\w\W]*/g),jr=v(/^data-[\-\w.\u00B7-\uFFFF]+$/),Yr=v(/^aria-[\-\w]+$/),An=v(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zr=v(/^(?:\w+script|data):/i),Xr=v(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vr=v(/^html$/i),Qr=v(/^[a-z][.\w]*(-[.\w]+)+$/i),En=v(/<[/\w!]/g),Kr=v(/<[/\w]/g),Jr=v(/<\/no(script|embed|frames)/i),es=v(/\/>/i),ee={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ts=function(){return typeof window>"u"?null:window},ns=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));const l="dompurify"+(s?"#"+s:"");try{return e.createPolicy(l,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Rn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},le=function(e,n,s,i){return G(e,n)&&ce(e[n])?x(i.base?H(i.base):{},e[n],i.transform):s};function $n(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ts();const e=f=>$n(f);if(e.version="3.4.10",e.removed=[],!t||!t.document||t.document.nodeType!==ee.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const s=n,i=s.currentScript;t.DocumentFragment;const l=t.HTMLTemplateElement,c=t.Node,u=t.Element,o=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,b=t.trustedTypes,k=u.prototype,I=te(k,"cloneNode"),d=te(k,"remove"),W=te(k,"nextSibling"),y=te(k,"childNodes"),V=te(k,"parentNode"),Q=te(k,"shadowRoot"),ue=te(k,"attributes"),F=c&&c.prototype?te(c.prototype,"nodeType"):null,q=c&&c.prototype?te(c.prototype,"nodeName"):null;if(typeof l=="function"){const f=n.createElement("template");f.content&&f.content.ownerDocument&&(n=f.content.ownerDocument)}let N,pe="",nt,Ft=!1,Ie=0;const Bt=function(){if(Ie>0)throw ge('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.')},be=function(r){Bt(),Ie++;try{return N.createHTML(r)}finally{Ie--}},Zn=function(r){Bt(),Ie++;try{return N.createScriptURL(r)}finally{Ie--}},Xn=function(){return Ft||(nt=ns(b,i),Ft=!0),nt},Fe=n,rt=Fe.implementation,Ht=Fe.createNodeIterator,Vn=Fe.createDocumentFragment,Qn=Fe.getElementsByTagName,Kn=s.importNode;let P=Rn();e.isSupported=typeof Mn=="function"&&typeof V=="function"&&rt&&rt.createHTMLDocument!==void 0;const Jn=Gr,er=Wr,tr=qr,nr=jr,rr=Yr,sr=Zr,Gt=Xr,ir=Qr;let Wt=An,O=null;const st=x({},[..._n,...wt,...yt,...St,...wn]);let L=null;const it=x({},[...yn,...At,...Sn,...Ze]);let E=Object.seal(Ee(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}})),Oe=null,qt=null;const se=Object.seal(Ee(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let jt=!0,ot=!0,Yt=!1,Zt=!0,ie=!1,Le=!0,he=!1,lt=!1,at=!1,Te=!1,Be=!1,He=!1,Xt=!0,Vt=!1;const Qt="user-content-";let ct=!0,ut=!1,xe={},K=null;const pt=x({},["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 Kt=null;const Jt=x({},["audio","video","img","source","image","track"]);let ht=null;const en=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ge="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",J="http://www.w3.org/1999/xhtml";let _e=J,ft=!1,gt=null;const or=x({},[Ge,We,J],_t),tn=$(["mi","mo","mn","ms","mtext"]);let dt=x({},tn);const nn=$(["annotation-xml"]);let mt=x({},nn);const lr=x({},["title","style","font","a","script"]);let Ne=null;const ar=["application/xhtml+xml","text/html"],cr="text/html";let R=null,we=null;const ur=n.createElement("form"),rn=function(r){return r instanceof RegExp||r instanceof Function},kt=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(we&&we===r)return;(!r||typeof r!="object")&&(r={}),r=H(r),Ne=ar.indexOf(r.PARSER_MEDIA_TYPE)===-1?cr:r.PARSER_MEDIA_TYPE,R=Ne==="application/xhtml+xml"?_t:$e,O=le(r,"ALLOWED_TAGS",st,{transform:R}),L=le(r,"ALLOWED_ATTR",it,{transform:R}),gt=le(r,"ALLOWED_NAMESPACES",or,{transform:_t}),ht=le(r,"ADD_URI_SAFE_ATTR",en,{transform:R,base:en}),Kt=le(r,"ADD_DATA_URI_TAGS",Jt,{transform:R,base:Jt}),K=le(r,"FORBID_CONTENTS",pt,{transform:R}),Oe=le(r,"FORBID_TAGS",H({}),{transform:R}),qt=le(r,"FORBID_ATTR",H({}),{transform:R}),xe=G(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?H(r.USE_PROFILES):r.USE_PROFILES:!1,jt=r.ALLOW_ARIA_ATTR!==!1,ot=r.ALLOW_DATA_ATTR!==!1,Yt=r.ALLOW_UNKNOWN_PROTOCOLS||!1,Zt=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=r.SAFE_FOR_TEMPLATES||!1,Le=r.SAFE_FOR_XML!==!1,he=r.WHOLE_DOCUMENT||!1,Te=r.RETURN_DOM||!1,Be=r.RETURN_DOM_FRAGMENT||!1,He=r.RETURN_TRUSTED_TYPE||!1,at=r.FORCE_BODY||!1,Xt=r.SANITIZE_DOM!==!1,Vt=r.SANITIZE_NAMED_PROPS||!1,ct=r.KEEP_CONTENT!==!1,ut=r.IN_PLACE||!1,Wt=Fr(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:An,_e=typeof r.NAMESPACE=="string"?r.NAMESPACE:J,dt=G(r,"MATHML_TEXT_INTEGRATION_POINTS")&&r.MATHML_TEXT_INTEGRATION_POINTS&&typeof r.MATHML_TEXT_INTEGRATION_POINTS=="object"?H(r.MATHML_TEXT_INTEGRATION_POINTS):x({},tn),mt=G(r,"HTML_INTEGRATION_POINTS")&&r.HTML_INTEGRATION_POINTS&&typeof r.HTML_INTEGRATION_POINTS=="object"?H(r.HTML_INTEGRATION_POINTS):x({},nn);const a=G(r,"CUSTOM_ELEMENT_HANDLING")&&r.CUSTOM_ELEMENT_HANDLING&&typeof r.CUSTOM_ELEMENT_HANDLING=="object"?H(r.CUSTOM_ELEMENT_HANDLING):Ee(null);if(E=Ee(null),G(a,"tagNameCheck")&&rn(a.tagNameCheck)&&(E.tagNameCheck=a.tagNameCheck),G(a,"attributeNameCheck")&&rn(a.attributeNameCheck)&&(E.attributeNameCheck=a.attributeNameCheck),G(a,"allowCustomizedBuiltInElements")&&typeof a.allowCustomizedBuiltInElements=="boolean"&&(E.allowCustomizedBuiltInElements=a.allowCustomizedBuiltInElements),v(E),ie&&(ot=!1),Be&&(Te=!0),xe&&(O=x({},wn),L=Ee(null),xe.html===!0&&(x(O,_n),x(L,yn)),xe.svg===!0&&(x(O,wt),x(L,At),x(L,Ze)),xe.svgFilters===!0&&(x(O,yt),x(L,At),x(L,Ze)),xe.mathMl===!0&&(x(O,St),x(L,Sn),x(L,Ze))),se.tagCheck=null,se.attributeCheck=null,G(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?se.tagCheck=r.ADD_TAGS:ce(r.ADD_TAGS)&&(O===st&&(O=H(O)),x(O,r.ADD_TAGS,R))),G(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?se.attributeCheck=r.ADD_ATTR:ce(r.ADD_ATTR)&&(L===it&&(L=H(L)),x(L,r.ADD_ATTR,R))),G(r,"ADD_URI_SAFE_ATTR")&&ce(r.ADD_URI_SAFE_ATTR)&&x(ht,r.ADD_URI_SAFE_ATTR,R),G(r,"FORBID_CONTENTS")&&ce(r.FORBID_CONTENTS)&&(K===pt&&(K=H(K)),x(K,r.FORBID_CONTENTS,R)),G(r,"ADD_FORBID_CONTENTS")&&ce(r.ADD_FORBID_CONTENTS)&&(K===pt&&(K=H(K)),x(K,r.ADD_FORBID_CONTENTS,R)),ct&&(O["#text"]=!0),he&&x(O,["html","head","body"]),O.table&&(x(O,["tbody"]),delete Oe.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const h=N;N=r.TRUSTED_TYPES_POLICY;try{pe=be("")}catch(m){throw N=h,m}}else r.TRUSTED_TYPES_POLICY===null?(N=void 0,pe=""):(N===void 0&&(N=Xn()),N&&typeof pe=="string"&&(pe=be("")));(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&O===st&&(O=H(O)),P.uponSanitizeAttribute.length>0&&L===it&&(L=H(L)),$&&$(r),we=r},sn=x({},[...wt,...yt,...Br]),on=x({},[...St,...Hr]),pr=function(r,a,h){return a.namespaceURI===J?r==="svg":a.namespaceURI===Ge?r==="svg"&&(h==="annotation-xml"||dt[h]):!!sn[r]},hr=function(r,a,h){return a.namespaceURI===J?r==="math":a.namespaceURI===We?r==="math"&&mt[h]:!!on[r]},fr=function(r,a,h){return a.namespaceURI===We&&!mt[h]||a.namespaceURI===Ge&&!dt[h]?!1:!on[r]&&(lr[r]||!sn[r])},gr=function(r){let a=V(r);(!a||!a.tagName)&&(a={namespaceURI:_e,tagName:"template"});const h=$e(r.tagName),m=$e(a.tagName);return gt[r.namespaceURI]?r.namespaceURI===We?pr(h,a,m):r.namespaceURI===Ge?hr(h,a,m):r.namespaceURI===J?fr(h,a,m):!!(Ne==="application/xhtml+xml"&>[r.namespaceURI]):!1},oe=function(r){Se(e.removed,{element:r});try{V(r).removeChild(r)}catch{if(d(r),!V(r))throw ge("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ln=function(r){const a=y(r);if(a){const m=[];Ce(a,T=>{Se(m,T)}),Ce(m,T=>{try{d(T)}catch{}})}const h=ue(r);if(h)for(let m=h.length-1;m>=0;--m){const T=h[m],w=T&&T.name;if(typeof w=="string")try{r.removeAttribute(w)}catch{}}},fe=function(r,a){try{Se(e.removed,{attribute:a.getAttributeNode(r),from:a})}catch{Se(e.removed,{attribute:null,from:a})}if(a.removeAttribute(r),r==="is")if(Te||Be)try{oe(a)}catch{}else try{a.setAttribute(r,"")}catch{}},dr=function(r){const a=ue(r);if(a)for(let h=a.length-1;h>=0;--h){const m=a[h],T=m&&m.name;if(!(typeof T!="string"||L[R(T)]))try{r.removeAttribute(T)}catch{}}},mr=function(r){const a=[r];for(;a.length>0;){const h=a.pop();(F?F(h):h.nodeType)===ee.element&&dr(h);const T=y(h);if(T)for(let w=T.length-1;w>=0;--w)a.push(T[w])}},an=function(r){let a=null,h=null;if(at)r=""+r;else{const w=kn(r,/^[\r\n\t ]+/);h=w&&w[0]}Ne==="application/xhtml+xml"&&_e===J&&(r=''+r+"");const m=N?be(r):r;if(_e===J)try{a=new p().parseFromString(m,Ne)}catch{}if(!a||!a.documentElement){a=rt.createDocument(_e,"template",null);try{a.documentElement.innerHTML=ft?pe:m}catch{}}const T=a.body||a.documentElement;return r&&h&&T.insertBefore(n.createTextNode(h),T.childNodes[0]||null),_e===J?Qn.call(a,he?"html":"body")[0]:he?a.documentElement:T},cn=function(r){return Ht.call(r.ownerDocument||r,r,o.SHOW_ELEMENT|o.SHOW_COMMENT|o.SHOW_TEXT|o.SHOW_PROCESSING_INSTRUCTION|o.SHOW_CDATA_SECTION,null)},qe=function(r){return r=Pe(r,Jn," "),r=Pe(r,er," "),r=Pe(r,tr," "),r},bt=function(r){var a;r.normalize();const h=Ht.call(r.ownerDocument||r,r,o.SHOW_TEXT|o.SHOW_COMMENT|o.SHOW_CDATA_SECTION|o.SHOW_PROCESSING_INSTRUCTION,null);let m=h.nextNode();for(;m;)m.data=qe(m.data),m=h.nextNode();const T=(a=r.querySelectorAll)===null||a===void 0?void 0:a.call(r,"template");T&&Ce(T,w=>{ye(w.content)&&bt(w.content)})},je=function(r){const a=q?q(r):null;return typeof a!="string"||R(a)!=="form"?!1:typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||r.attributes!==ue(r)||typeof r.removeAttribute!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function"||r.nodeType!==F(r)||r.childNodes!==y(r)},ye=function(r){if(!F||typeof r!="object"||r===null)return!1;try{return F(r)===ee.documentFragment}catch{return!1}},De=function(r){if(!F||typeof r!="object"||r===null)return!1;try{return typeof F(r)=="number"}catch{return!1}};function re(f,r,a){f.length!==0&&Ce(f,h=>{h.call(e,r,a,we)})}const kr=function(r,a){return!!(Le&&r.hasChildNodes()&&!De(r.firstElementChild)&&z(En,r.textContent)&&z(En,r.innerHTML)||Le&&r.namespaceURI===J&&a==="style"&&De(r.firstElementChild)||r.nodeType===ee.processingInstruction||Le&&r.nodeType===ee.comment&&z(Kr,r.data))},br=function(r,a){if(!Oe[a]&&hn(a)&&(E.tagNameCheck instanceof RegExp&&z(E.tagNameCheck,a)||E.tagNameCheck instanceof Function&&E.tagNameCheck(a)))return!1;if(ct&&!K[a]){const h=V(r),m=y(r);if(m&&h){const T=m.length;for(let w=T-1;w>=0;--w){const M=ut?m[w]:I(m[w],!0);h.insertBefore(M,W(r))}}}return oe(r),!0},un=function(r){if(re(P.beforeSanitizeElements,r,null),je(r))return oe(r),!0;const a=R(q?q(r):r.nodeName);if(re(P.uponSanitizeElement,r,{tagName:a,allowedTags:O}),kr(r,a))return oe(r),!0;if(Oe[a]||!(se.tagCheck instanceof Function&&se.tagCheck(a))&&!O[a])return br(r,a);if((F?F(r):r.nodeType)===ee.element&&!gr(r)||(a==="noscript"||a==="noembed"||a==="noframes")&&z(Jr,r.innerHTML))return oe(r),!0;if(ie&&r.nodeType===ee.text){const m=qe(r.textContent);r.textContent!==m&&(Se(e.removed,{element:r.cloneNode()}),r.textContent=m)}return re(P.afterSanitizeElements,r,null),!1},pn=function(r,a,h){if(qt[a]||Xt&&(a==="id"||a==="name")&&(h in n||h in ur))return!1;const m=L[a]||se.attributeCheck instanceof Function&&se.attributeCheck(a,r);if(!(ot&&z(nr,a))){if(!(jt&&z(rr,a))){if(m){if(!ht[a]){if(!z(Wt,Pe(h,Gt,""))){if(!((a==="src"||a==="xlink:href"||a==="href")&&r!=="script"&&bn(h,"data:")===0&&Kt[r])){if(!(Yt&&!z(sr,Pe(h,Gt,"")))){if(h)return!1}}}}}else if(!(hn(r)&&(E.tagNameCheck instanceof RegExp&&z(E.tagNameCheck,r)||E.tagNameCheck instanceof Function&&E.tagNameCheck(r))&&(E.attributeNameCheck instanceof RegExp&&z(E.attributeNameCheck,a)||E.attributeNameCheck instanceof Function&&E.attributeNameCheck(a,r))||a==="is"&&E.allowCustomizedBuiltInElements&&(E.tagNameCheck instanceof RegExp&&z(E.tagNameCheck,h)||E.tagNameCheck instanceof Function&&E.tagNameCheck(h))))return!1}}return!0},Tr=x({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),hn=function(r){return!Tr[$e(r)]&&z(ir,r)},xr=function(r,a,h,m){if(N&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!h)switch(b.getAttributeType(r,a)){case"TrustedHTML":return be(m);case"TrustedScriptURL":return Zn(m)}return m},_r=function(r,a,h,m){try{h?r.setAttributeNS(h,a,m):r.setAttribute(a,m),je(r)?oe(r):mn(e.removed)}catch{fe(a,r)}},fn=function(r){re(P.beforeSanitizeAttributes,r,null);const a=r.attributes;if(!a||je(r))return;const h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0};let m=a.length;const T=R(r.nodeName);for(;m--;){const w=a[m],M=w.name,D=w.namespaceURI,j=w.value,Y=R(M),xt=j;let B=M==="value"?xt:Pr(xt);if(h.attrName=Y,h.attrValue=B,h.keepAttr=!0,h.forceKeepAttr=void 0,re(P.uponSanitizeAttribute,r,h),B=h.attrValue,Vt&&(Y==="id"||Y==="name")&&bn(B,Qt)!==0&&(fe(M,r),B=Qt+B),Le&&z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,B)){fe(M,r);continue}if(Y==="attributename"&&kn(B,"href")){fe(M,r);continue}if(!h.forceKeepAttr){if(!h.keepAttr){fe(M,r);continue}if(!Zt&&z(es,B)){fe(M,r);continue}if(ie&&(B=qe(B)),!pn(T,Y,B)){fe(M,r);continue}B=xr(T,Y,D,B),B!==xt&&_r(r,M,D,B)}}re(P.afterSanitizeAttributes,r,null)},Ye=function(r){let a=null;const h=cn(r);for(re(P.beforeSanitizeShadowDOM,r,null);a=h.nextNode();)if(re(P.uponSanitizeShadowNode,a,null),un(a),fn(a),ye(a.content)&&Ye(a.content),(F?F(a):a.nodeType)===ee.element){const T=Q(a);ye(T)&&(Tt(T),Ye(T))}re(P.afterSanitizeShadowDOM,r,null)},Tt=function(r){const a=[{node:r,shadow:null}];for(;a.length>0;){const h=a.pop();if(h.shadow){Ye(h.shadow);continue}const m=h.node,w=(F?F(m):m.nodeType)===ee.element,M=y(m);if(M)for(let D=M.length-1;D>=0;--D)a.push({node:M[D],shadow:null});if(w){const D=q?q(m):null;if(typeof D=="string"&&R(D)==="template"){const j=m.content;ye(j)&&a.push({node:j,shadow:null})}}if(w){const D=Q(m);ye(D)&&a.push({node:null,shadow:D},{node:D,shadow:null})}}};return e.sanitize=function(f){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,h=null,m=null,T=null;if(ft=!f,ft&&(f=""),typeof f!="string"&&!De(f)&&(f=Ur(f),typeof f!="string"))throw ge("dirty is not a string, aborting");if(!e.isSupported)return f;lt||kt(r),e.removed=[];const w=ut&&typeof f!="string"&&De(f);if(w){const j=q?q(f):f.nodeName;if(typeof j=="string"){const Y=R(j);if(!O[Y]||Oe[Y])throw ge("root node is forbidden and cannot be sanitized in-place")}if(je(f))throw ge("root node is clobbered and cannot be sanitized in-place");try{Tt(f)}catch(Y){throw ln(f),Y}}else if(De(f))a=an(""),h=a.ownerDocument.importNode(f,!0),h.nodeType===ee.element&&h.nodeName==="BODY"||h.nodeName==="HTML"?a=h:a.appendChild(h),Tt(h);else{if(!Te&&!ie&&!he&&f.indexOf("<")===-1)return N&&He?be(f):f;if(a=an(f),!a)return Te?null:He?pe:""}a&&at&&oe(a.firstChild);const M=cn(w?f:a);try{for(;m=M.nextNode();)un(m),fn(m),ye(m.content)&&Ye(m.content)}catch(j){throw w&&ln(f),j}if(w)return Ce(e.removed,j=>{j.element&&mr(j.element)}),ie&&bt(f),f;if(Te){if(ie&&bt(a),Be)for(T=Vn.call(a.ownerDocument);a.firstChild;)T.appendChild(a.firstChild);else T=a;return(L.shadowroot||L.shadowrootmode)&&(T=Kn.call(s,T,!0)),T}let D=he?a.outerHTML:a.innerHTML;return he&&O["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&z(Vr,a.ownerDocument.doctype.name)&&(D=" `+D),ie&&(D=qe(D)),N&&He?be(D):D},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kt(f),lt=!0},e.clearConfig=function(){we=null,lt=!1,N=nt,pe=""},e.isValidAttribute=function(f,r,a){we||kt({});const h=R(f),m=R(r);return pn(h,m,a)},e.addHook=function(f,r){typeof r=="function"&&Se(P[f],r)},e.removeHook=function(f,r){if(r!==void 0){const a=Dr(P[f],r);return a===-1?void 0:Cr(P[f],a,1)[0]}return mn(P[f])},e.removeHooks=function(f){P[f]=[]},e.removeAllHooks=function(){P=Rn()},e}var qs=$n();function Nt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ke=Nt();function vn(t){ke=t}var de={exec:()=>null};function Ae(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function _(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,l)=>{let c=typeof l=="string"?l:l.source;return c=c.replace(U.caret,"$1"),n=n.replace(i,c),s},getRegex:()=>new RegExp(n,e)};return s}var rs=((t="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ae(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ae(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Ae(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ae(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Ae(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Ae(t=>new RegExp(`^ {0,${t}}>`))},ss=/^(?:[ \t]*(?:\n|$))+/,is=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,os=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ue=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ls=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Dt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Un=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fn=_(Un).replace(/bull/g,Dt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),as=_(Un).replace(/bull/g,Dt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ct=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cs=/^[^\n]+/,Pt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,us=_(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Pt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ps=_(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Dt).getRegex(),et="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Mt=/|$))/,hs=_("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Mt).replace("tag",et).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bn=_(Ct).replace("hr",Ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",et).getRegex(),fs=_(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bn).getRegex(),zt={blockquote:fs,code:is,def:us,fences:os,heading:ls,hr:Ue,html:hs,lheading:Fn,list:ps,newline:ss,paragraph:Bn,table:de,text:cs},In=_("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",et).getRegex(),gs={...zt,lheading:as,table:In,paragraph:_(Ct).replace("hr",Ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",In).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",et).getRegex()},ds={...zt,html:_(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Mt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:de,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_(Ct).replace("hr",Ue).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Fn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ms=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ks=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Hn=/^( {2,}|\\)\n(?!\s*$)/,bs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",rs?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Wn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ys=_(Wn,"u").replace(/punct/g,Re).getRegex(),Ss=_(Wn,"u").replace(/punct/g,Gn).getRegex(),qn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",As=_(qn,"gu").replace(/notPunctSpace/g,$t).replace(/punctSpace/g,tt).replace(/punct/g,Re).getRegex(),Es=_(qn,"gu").replace(/notPunctSpace/g,_s).replace(/punctSpace/g,xs).replace(/punct/g,Gn).getRegex(),Rs=_("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$t).replace(/punctSpace/g,tt).replace(/punct/g,Re).getRegex(),Is=_(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Re).getRegex(),Os="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ls=_(Os,"gu").replace(/notPunctSpace/g,$t).replace(/punctSpace/g,tt).replace(/punct/g,Re).getRegex(),Ns=_(/\\(punct)/,"gu").replace(/punct/g,Re).getRegex(),Ds=_(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cs=_(Mt).replace("(?:-->|$)","-->").getRegex(),Ps=_("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Cs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qe=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ms=_(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),jn=_(/^!?\[(label)\]\[(ref)\]/).replace("label",Qe).replace("ref",Pt).getRegex(),Yn=_(/^!?\[(ref)\](?:\[\])?/).replace("ref",Pt).getRegex(),zs=_("reflink|nolink(?!\\()","g").replace("reflink",jn).replace("nolink",Yn).getRegex(),On=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vt={_backpedal:de,anyPunctuation:Ns,autolink:Ds,blockSkip:ws,br:Hn,code:ks,del:de,delLDelim:de,delRDelim:de,emStrongLDelim:ys,emStrongRDelimAst:As,emStrongRDelimUnd:Rs,escape:ms,link:Ms,nolink:Yn,punctuation:Ts,reflink:jn,reflinkSearch:zs,tag:Ps,text:bs,url:de},$s={...vt,link:_(/^!?\[(label)\]\((.*?)\)/).replace("label",Qe).getRegex(),reflink:_(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qe).getRegex()},It={...vt,emStrongRDelimAst:Es,emStrongLDelim:Ss,delLDelim:Is,delRDelim:Ls,url:_(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",On).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Ln=t=>Us[t];function ne(t,e){if(e){if(U.escapeTest.test(t))return t.replace(U.escapeReplace,Ln)}else if(U.escapeTestNoEncode.test(t))return t.replace(U.escapeReplaceNoEncode,Ln);return t}function Nn(t){try{t=encodeURI(t).replace(U.percentDecode,"%")}catch{return null}return t}function Dn(t,e){var l;let n=t.replace(U.findPipe,(c,u,o)=>{let g=!1,p=u;for(;--p>=0&&o[p]==="\\";)g=!g;return g?"|":" |"}),s=n.split(U.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!((l=s.at(-1))!=null&&l.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length=0&&U.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(` `)}function Fs(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s0?-2:-1}function Bs(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let l=4-n%4;s+=" ".repeat(l),n+=l}else s+=i,n++;return s}function Pn(t,e,n,s,i){let l=e.href,c=e.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:c,text:u,tokens:s.inlineTokens(u)};return s.state.inLink=!1,o}function Hs(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(` `).map(l=>{let c=l.match(n.other.beginningSpace);if(c===null)return l;let[u]=c;return u.length>=i.length?l.slice(i.length):l}).join(` `)}var Ke=class{constructor(t){S(this,"options");S(this,"rules");S(this,"lexer");this.options=t||ke}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:Cn(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=Hs(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=ae(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:ae(e[0],` `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ae(e[0],` `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ae(e[0],` `).split(` `),s="",i="",l=[];for(;n.length>0;){let c=!1,u=[],o;for(o=0;o1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let l=this.rules.other.listItemRegex(n),c=!1;for(;t;){let o=!1,g="",p="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;g=e[0],t=t.substring(g.length);let b=Bs(e[2].split(` `,1)[0],e[1].length),k=t.split(` `,1)[0],I=!b.trim(),d=0;if(this.options.pedantic?(d=2,p=b.trimStart()):I?d=e[1].length+1:(d=b.search(this.rules.other.nonSpaceChar),d=d>4?1:d,p=b.slice(d),d+=e[1].length),I&&this.rules.other.blankLine.test(k)&&(g+=k+` `,t=t.substring(k.length+1),o=!0),!o){let W=this.rules.other.nextBulletRegex(d),y=this.rules.other.hrRegex(d),V=this.rules.other.fencesBeginRegex(d),Q=this.rules.other.headingBeginRegex(d),ue=this.rules.other.htmlBeginRegex(d),F=this.rules.other.blockquoteBeginRegex(d);for(;t;){let q=t.split(` `,1)[0],N;if(k=q,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),N=k):N=k.replace(this.rules.other.tabCharGlobal," "),V.test(k)||Q.test(k)||ue.test(k)||F.test(k)||W.test(k)||y.test(k))break;if(N.search(this.rules.other.nonSpaceChar)>=d||!k.trim())p+=` `+N.slice(d);else{if(I||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||V.test(b)||Q.test(b)||y.test(b))break;p+=` `+k}I=!k.trim(),g+=q+` `,t=t.substring(q.length+1),b=N.slice(d)}}i.loose||(c?i.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),i.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=g}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let o of i.items){this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]);let g=o.tokens[0];if(o.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){o.text=o.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(o.raw);if(p){let b={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};o.checked=b.checked,i.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=b.raw+o.tokens[0].raw,o.tokens[0].text=b.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(b)):o.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):o.tokens.unshift(b)}}else o.task&&(o.task=!1);if(!i.loose){let p=o.tokens.filter(k=>k.type==="space"),b=p.length>0&&p.some(k=>this.rules.other.anyLine.test(k.raw));i.loose=b}}if(i.loose)for(let o of i.items){o.loose=!0;for(let g of o.tokens)g.type==="text"&&(g.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Cn(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:ae(e[0],` `),href:s,title:i}}}table(t){var c;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Dn(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(c=e[3])!=null&&c.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],l={type:"table",raw:ae(e[0],` `),header:[],align:[],rows:[]};if(n.length===s.length){for(let u of s)this.rules.other.tableAlignRight.test(u)?l.align.push("right"):this.rules.other.tableAlignCenter.test(u)?l.align.push("center"):this.rules.other.tableAlignLeft.test(u)?l.align.push("left"):l.align.push(null);for(let u=0;u({text:o,tokens:this.lexer.inline(o),header:!1,align:l.align[g]})));return l}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:ae(e[0],` `),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===` `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=ae(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=Fs(e[2],"()");if(l===-2)return;if(l>-1){let c=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,c).trim(),e[3]=""}}let s=e[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],i=l[3])}else i=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Pn(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[s.toLowerCase()];if(!i){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Pn(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,l,c,u=i,o=0,g=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,e=e.slice(-1*t.length+i);(s=g.exec(e))!==null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(c=[...l].length,s[3]||s[4]){u+=c;continue}else if((s[5]||s[6])&&i%3&&!((i+c)%3)){o+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+o);let p=[...s[0]][0].length,b=t.slice(0,i+s.index+p+c);if(Math.min(i,c)%2){let I=b.slice(1,-1);return{type:"em",raw:b,text:I,tokens:this.lexer.inlineTokens(I)}}let k=b.slice(2,-2);return{type:"strong",raw:b,text:k,tokens:this.lexer.inlineTokens(k)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,l,c,u=i,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+i);(s=o.exec(e))!==null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l||(c=[...l].length,c!==i))continue;if(s[3]||s[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let g=[...s[0]][0].length,p=t.slice(0,i+s.index+g+c),b=p.slice(i,-i);return{type:"del",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let s,i;if(e[2]==="@")s=e[0],i="mailto:"+s;else{let l;do l=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(l!==e[0]);s=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Z=class Ot{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"inlineQueue");S(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ke,this.options.tokenizer=this.options.tokenizer||new Ke,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:U,block:Xe.normal,inline:ze.normal};this.options.pedantic?(n.block=Xe.pedantic,n.inline=ze.pedantic):this.options.gfm&&(n.block=Xe.gfm,this.options.breaks?n.inline=ze.breaks:n.inline=ze.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xe,inline:ze}}static lex(e,n){return new Ot(n).lex(e)}static lexInline(e,n){return new Ot(n).inlineTokens(e)}lex(e){e=e.replace(U.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let n=0;n(o=p.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let p=n.at(-1);o.raw.length===1&&p!==void 0?p.raw+=` `:n.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+o.raw,p.text+=` `+o.text,this.inlineQueue.at(-1).src=p.text):n.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+o.raw,p.text+=` `+o.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},n.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),n.push(o);continue}let g=e;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,b=e.slice(1),k;this.options.extensions.startBlock.forEach(I=>{k=I.call({lexer:this},b),typeof k=="number"&&k>=0&&(p=Math.min(p,k))}),p<1/0&&p>=0&&(g=e.substring(0,p+1))}if(this.state.top&&(o=this.tokenizer.paragraph(g))){let p=n.at(-1);s&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+o.raw,p.text+=` `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(o),s=g.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+o.raw,p.text+=` `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var g,p,b,k,I;this.tokenizer.lexer=this;let s=e,i=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)d.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,i.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)l=i[2]?i[2].length:0,s=s.slice(0,i.index+l)+"["+"a".repeat(i[0].length-l-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((p=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:p.call({lexer:this},s))??s;let c=!1,u="",o=1/0;for(;e;){if(e.length(d=y.call({lexer:this},e,n))?(e=e.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let y=n.at(-1);d.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=d.raw,y.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(e,s,u)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(e,s,u)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),n.push(d);continue}let W=e;if((I=this.options.extensions)!=null&&I.startInline){let y=1/0,V=e.slice(1),Q;this.options.extensions.startInline.forEach(ue=>{Q=ue.call({lexer:this},V),typeof Q=="number"&&Q>=0&&(y=Math.min(y,Q))}),y<1/0&&y>=0&&(W=e.substring(0,y+1))}if(d=this.tokenizer.inlineText(W)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(u=d.raw.slice(-1)),c=!0;let y=n.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=d.raw,y.text+=d.text):n.push(d);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Je=class{constructor(t){S(this,"options");S(this,"parser");this.options=t||ke}space(t){return""}code({text:t,lang:e,escaped:n}){var l;let s=(l=(e||"").match(U.notSpaceStart))==null?void 0:l[0],i=t.replace(U.endingNewline,"")+` `;return s?'
'+(n?i:ne(i,!0))+`
`:"
"+(n?i:ne(i,!0))+`
`}blockquote({tokens:t}){return`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)} `}hr(t){return`
`}list(t){let e=t.ordered,n=t.start,s="";for(let c=0;c `+s+" `}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • `}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    `}table(t){let e="",n="";for(let i=0;i${s}`),` `+e+` `+s+`
    `}tablerow({text:t}){return` ${t} `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` `}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${ne(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),i=Nn(t);if(i===null)return s;t=i;let l='
    ",l}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=Nn(t);if(i===null)return ne(n);t=i;let l=`${ne(n)}{let o=c[u].flat(1/0);n=n.concat(this.walkTokens(o,e))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let l=e.renderers[i.name];l?e.renderers[i.name]=function(...c){let u=i.renderer.apply(this,c);return u===!1&&(u=l.apply(this,c)),u}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[i.level];l?l.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new Je(this.defaults);for(let l in n.renderer){if(!(l in i))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let c=l,u=n.renderer[c],o=i[c];i[c]=(...g)=>{let p=u.apply(i,g);return p===!1&&(p=o.apply(i,g)),p||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Ke(this.defaults);for(let l in n.tokenizer){if(!(l in i))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let c=l,u=n.tokenizer[c],o=i[c];i[c]=(...g)=>{let p=u.apply(i,g);return p===!1&&(p=o.apply(i,g)),p}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ve;for(let l in n.hooks){if(!(l in i))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let c=l,u=n.hooks[c],o=i[c];ve.passThroughHooks.has(l)?i[c]=g=>{if(this.defaults.async&&ve.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await u.call(i,g);return o.call(i,b)})();let p=u.call(i,g);return o.call(i,p)}:i[c]=(...g)=>{if(this.defaults.async)return(async()=>{let b=await u.apply(i,g);return b===!1&&(b=await o.apply(i,g)),b})();let p=u.apply(i,g);return p===!1&&(p=o.apply(i,g)),p}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,l=n.walkTokens;s.walkTokens=function(c){let u=[];return u.push(l.call(this,c)),i&&(u=u.concat(i.call(this,c))),u}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Z.lex(t,e??this.defaults)}parser(t,e){return X.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},l=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let c=i.hooks?await i.hooks.preprocess(e):e,u=await(i.hooks?await i.hooks.provideLexer(t):t?Z.lex:Z.lexInline)(c,i),o=i.hooks?await i.hooks.processAllTokens(u):u;i.walkTokens&&await Promise.all(this.walkTokens(o,i.walkTokens));let g=await(i.hooks?await i.hooks.provideParser(t):t?X.parse:X.parseInline)(o,i);return i.hooks?await i.hooks.postprocess(g):g})().catch(l);try{i.hooks&&(e=i.hooks.preprocess(e));let c=(i.hooks?i.hooks.provideLexer(t):t?Z.lex:Z.lexInline)(e,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=(i.hooks?i.hooks.provideParser(t):t?X.parse:X.parseInline)(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return l(c)}}}onError(t,e){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,t){let s="

    An error occurred:

    "+ne(n.message+"",!0)+"
    ";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},me=new Gs;function A(t,e){return me.parse(t,e)}A.options=A.setOptions=function(t){return me.setOptions(t),A.defaults=me.defaults,vn(A.defaults),A};A.getDefaults=Nt;A.defaults=ke;A.use=function(...t){return me.use(...t),A.defaults=me.defaults,vn(A.defaults),A};A.walkTokens=function(t,e){return me.walkTokens(t,e)};A.parseInline=me.parseInline;A.Parser=X;A.parser=X.parse;A.Renderer=Je;A.TextRenderer=Ut;A.Lexer=Z;A.lexer=Z.lex;A.Tokenizer=Ke;A.Hooks=ve;A.parse=A;A.options;A.setOptions;A.use;A.walkTokens;A.parseInline;X.parse;Z.lex;export{A as g,qs as p};