lee-ai-widget 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,36 @@
1
- (function(E,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(E=typeof globalThis<"u"?globalThis:E||self,y(E.LeeAI={}))})(this,function(E){"use strict";var Wi=Object.defineProperty;var En=E=>{throw TypeError(E)};var qi=(E,y,P)=>y in E?Wi(E,y,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[y]=P;var b=(E,y,P)=>qi(E,typeof y!="symbol"?y+"":y,P),Zi=(E,y,P)=>y.has(E)||En("Cannot "+P);var yn=(E,y,P)=>y.has(E)?En("Cannot add the same private member more than once"):y instanceof WeakSet?y.add(E):y.set(E,P);var We=(E,y,P)=>(Zi(E,y,"access private method"),P);var ne,Et,An;async function y(c,e,n,t,r,o){const i=`${c.baseUrl}/ai/chat`,l={provider:c.provider||"google",apiKey:c.apiKey,model:c.model,contents:[...e,{role:"user",parts:[{text:n}]}],options:{systemInstruction:c.systemInstruction,enableSearch:c.enableSearch}};try{const a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!a.ok)throw new Error(`Error: ${a.statusText}`);if(!a.body)throw new Error("ReadableStream not supported");const d=a.body.getReader(),h=new TextDecoder;for(;;){const{done:m,value:g}=await d.read();if(m)break;const T=h.decode(g,{stream:!0});t(T)}r()}catch(a){console.error("Chat API Error:",a),o(a.message||"网络连接失败")}}function P(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let ee=P();function yt(c){ee=c}const At=/[&<>"']/,Sn=new RegExp(At.source,"g"),St=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Rn=new RegExp(St.source,"g"),Ln={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Rt=c=>Ln[c];function F(c,e){if(e){if(At.test(c))return c.replace(Sn,Rt)}else if(St.test(c))return c.replace(Rn,Rt);return c}const In=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function On(c){return c.replace(In,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Dn=/(^|[^\[])\^/g;function w(c,e){let n=typeof c=="string"?c:c.source;e=e||"";const t={replace:(r,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(Dn,"$1"),n=n.replace(r,i),t},getRegex:()=>new RegExp(n,e)};return t}function Lt(c){try{c=encodeURI(c).replace(/%25/g,"%")}catch{return null}return c}const fe={exec:()=>null};function It(c,e){const n=c.replace(/\|/g,(o,i,l)=>{let a=!1,d=i;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),t=n.split(/ \|/);let r=0;if(t[0].trim()||t.shift(),t.length>0&&!t[t.length-1].trim()&&t.pop(),e)if(t.length>e)t.splice(e);else for(;t.length<e;)t.push("");for(;r<t.length;r++)t[r]=t[r].trim().replace(/\\\|/g,"|");return t}function Re(c,e,n){const t=c.length;if(t===0)return"";let r=0;for(;r<t&&c.charAt(t-r-1)===e;)r++;return c.slice(0,t-r)}function Cn(c,e){if(c.indexOf(e[1])===-1)return-1;let n=0;for(let t=0;t<c.length;t++)if(c[t]==="\\")t++;else if(c[t]===e[0])n++;else if(c[t]===e[1]&&(n--,n<0))return t;return-1}function Ot(c,e,n,t){const r=e.href,o=e.title?F(e.title):null,i=c[1].replace(/\\([\[\]])/g,"$1");if(c[0].charAt(0)!=="!"){t.state.inLink=!0;const l={type:"link",raw:n,href:r,title:o,text:i,tokens:t.inlineTokens(i)};return t.state.inLink=!1,l}return{type:"image",raw:n,href:r,title:o,text:F(i)}}function Mn(c,e){const n=c.match(/^(\s+)(?:```)/);if(n===null)return e;const t=n[1];return e.split(`
2
- `).map(r=>{const o=r.match(/^\s+/);if(o===null)return r;const[i]=o;return i.length>=t.length?r.slice(t.length):r}).join(`
1
+ (function(E,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(E=typeof globalThis<"u"?globalThis:E||self,y(E.LeeAI={}))})(this,function(E){"use strict";var Wi=Object.defineProperty;var En=E=>{throw TypeError(E)};var qi=(E,y,P)=>y in E?Wi(E,y,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[y]=P;var b=(E,y,P)=>qi(E,typeof y!="symbol"?y+"":y,P),Zi=(E,y,P)=>y.has(E)||En("Cannot "+P);var yn=(E,y,P)=>y.has(E)?En("Cannot add the same private member more than once"):y instanceof WeakSet?y.add(E):y.set(E,P);var We=(E,y,P)=>(Zi(E,y,"access private method"),P);var ne,Et,An;async function y(c,e,n,t,i,o){const s=`${c.baseUrl}/ai/chat`,l={provider:c.provider||"google",apiKey:c.apiKey,model:c.model,contents:[...e,{role:"user",parts:[{text:n}]}],options:{systemInstruction:c.systemInstruction,enableSearch:c.enableSearch}};try{const a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!a.ok)throw new Error(`Error: ${a.statusText}`);if(!a.body)throw new Error("ReadableStream not supported");const d=a.body.getReader(),h=new TextDecoder;for(;;){const{done:m,value:g}=await d.read();if(m)break;const T=h.decode(g,{stream:!0});t(T)}i()}catch(a){console.error("Chat API Error:",a),o(a.message||"网络连接失败")}}function P(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let ee=P();function yt(c){ee=c}const At=/[&<>"']/,Sn=new RegExp(At.source,"g"),St=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Rn=new RegExp(St.source,"g"),Ln={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Rt=c=>Ln[c];function F(c,e){if(e){if(At.test(c))return c.replace(Sn,Rt)}else if(St.test(c))return c.replace(Rn,Rt);return c}const In=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function On(c){return c.replace(In,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Dn=/(^|[^\[])\^/g;function w(c,e){let n=typeof c=="string"?c:c.source;e=e||"";const t={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(Dn,"$1"),n=n.replace(i,s),t},getRegex:()=>new RegExp(n,e)};return t}function Lt(c){try{c=encodeURI(c).replace(/%25/g,"%")}catch{return null}return c}const fe={exec:()=>null};function It(c,e){const n=c.replace(/\|/g,(o,s,l)=>{let a=!1,d=s;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),t=n.split(/ \|/);let i=0;if(t[0].trim()||t.shift(),t.length>0&&!t[t.length-1].trim()&&t.pop(),e)if(t.length>e)t.splice(e);else for(;t.length<e;)t.push("");for(;i<t.length;i++)t[i]=t[i].trim().replace(/\\\|/g,"|");return t}function Re(c,e,n){const t=c.length;if(t===0)return"";let i=0;for(;i<t&&c.charAt(t-i-1)===e;)i++;return c.slice(0,t-i)}function Cn(c,e){if(c.indexOf(e[1])===-1)return-1;let n=0;for(let t=0;t<c.length;t++)if(c[t]==="\\")t++;else if(c[t]===e[0])n++;else if(c[t]===e[1]&&(n--,n<0))return t;return-1}function Ot(c,e,n,t){const i=e.href,o=e.title?F(e.title):null,s=c[1].replace(/\\([\[\]])/g,"$1");if(c[0].charAt(0)!=="!"){t.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:s,tokens:t.inlineTokens(s)};return t.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:F(s)}}function Mn(c,e){const n=c.match(/^(\s+)(?:```)/);if(n===null)return e;const t=n[1];return e.split(`
2
+ `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=t.length?i.slice(t.length):i}).join(`
3
3
  `)}class Le{constructor(e){b(this,"options");b(this,"rules");b(this,"lexer");this.options=e||ee}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const t=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Re(t,`
4
- `)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const t=n[0],r=Mn(t,n[3]||"");return{type:"code",raw:t,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:r}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let t=n[2].trim();if(/#$/.test(t)){const r=Re(t,"#");(this.options.pedantic||!r||/ $/.test(r))&&(t=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){const t=Re(n[0].replace(/^ *>[ \t]?/gm,""),`
5
- `),r=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(t);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:o,text:t}}}list(e){let n=this.rules.block.list.exec(e);if(n){let t=n[1].trim();const r=t.length>1,o={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");const i=new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`);let l="",a="",d=!1;for(;e;){let h=!1;if(!(n=i.exec(e))||this.rules.block.hr.test(e))break;l=n[0],e=e.substring(l.length);let m=n[2].split(`
4
+ `)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const t=n[0],i=Mn(t,n[3]||"");return{type:"code",raw:t,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:i}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let t=n[2].trim();if(/#$/.test(t)){const i=Re(t,"#");(this.options.pedantic||!i||/ $/.test(i))&&(t=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){const t=Re(n[0].replace(/^ *>[ \t]?/gm,""),`
5
+ `),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(t);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:t}}}list(e){let n=this.rules.block.list.exec(e);if(n){let t=n[1].trim();const i=t.length>1,o={type:"list",raw:"",ordered:i,start:i?+t.slice(0,-1):"",loose:!1,items:[]};t=i?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=i?t:"[*+-]");const s=new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`);let l="",a="",d=!1;for(;e;){let h=!1;if(!(n=s.exec(e))||this.rules.block.hr.test(e))break;l=n[0],e=e.substring(l.length);let m=n[2].split(`
6
6
  `,1)[0].replace(/^\t+/,Ee=>" ".repeat(3*Ee.length)),g=e.split(`
7
7
  `,1)[0],T=0;this.options.pedantic?(T=2,a=m.trimStart()):(T=n[2].search(/[^ ]/),T=T>4?1:T,a=m.slice(T),T+=n[1].length);let $=!1;if(!m&&/^ *$/.test(g)&&(l+=g+`
8
8
  `,e=e.substring(g.length+1),h=!0),!h){const Ee=new RegExp(`^ {0,${Math.min(3,T-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),ze=new RegExp(`^ {0,${Math.min(3,T-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),ie=new RegExp(`^ {0,${Math.min(3,T-1)}}(?:\`\`\`|~~~)`),L=new RegExp(`^ {0,${Math.min(3,T-1)}}#`);for(;e;){const Q=e.split(`
9
9
  `,1)[0];if(g=Q,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),ie.test(g)||L.test(g)||Ee.test(g)||ze.test(e))break;if(g.search(/[^ ]/)>=T||!g.trim())a+=`
10
10
  `+g.slice(T);else{if($||m.search(/[^ ]/)>=4||ie.test(m)||L.test(m)||ze.test(m))break;a+=`
11
11
  `+g}!$&&!g.trim()&&($=!0),l+=Q+`
12
- `,e=e.substring(Q.length+1),m=g.slice(T)}}o.loose||(d?o.loose=!0:/\n *\n *$/.test(l)&&(d=!0));let H=null,X;this.options.gfm&&(H=/^\[[ xX]\] /.exec(a),H&&(X=H[0]!=="[ ] ",a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:l,task:!!H,checked:X,loose:!1,text:a,tokens:[]}),o.raw+=l}o.items[o.items.length-1].raw=l.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let h=0;h<o.items.length;h++)if(this.lexer.state.top=!1,o.items[h].tokens=this.lexer.blockTokens(o.items[h].text,[]),!o.loose){const m=o.items[h].tokens.filter(T=>T.type==="space"),g=m.length>0&&m.some(T=>/\n.*\n/.test(T.raw));o.loose=g}if(o.loose)for(let h=0;h<o.items.length;h++)o.items[h].loose=!0;return o}}html(e){const n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){const n=this.rules.block.def.exec(e);if(n){const t=n[1].toLowerCase().replace(/\s+/g," "),r=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:t,raw:n[0],href:r,title:o}}}table(e){const n=this.rules.block.table.exec(e);if(!n||!/[:|]/.test(n[2]))return;const t=It(n[1]),r=n[2].replace(/^\||\| *$/g,"").split("|"),o=n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
13
- `):[],i={type:"table",raw:n[0],header:[],align:[],rows:[]};if(t.length===r.length){for(const l of r)/^ *-+: *$/.test(l)?i.align.push("right"):/^ *:-+: *$/.test(l)?i.align.push("center"):/^ *:-+ *$/.test(l)?i.align.push("left"):i.align.push(null);for(const l of t)i.header.push({text:l,tokens:this.lexer.inline(l)});for(const l of o)i.rows.push(It(l,i.header.length).map(a=>({text:a,tokens:this.lexer.inline(a)})));return i}}lheading(e){const n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){const n=this.rules.block.paragraph.exec(e);if(n){const t=n[1].charAt(n[1].length-1)===`
14
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:t,tokens:this.lexer.inline(t)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:F(n[1])}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const t=n[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t))return;const i=Re(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{const i=Cn(n[2],"()");if(i>-1){const a=(n[0].indexOf("!")===0?5:4)+n[1].length+i;n[2]=n[2].substring(0,i),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let r=n[2],o="";if(this.options.pedantic){const i=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);i&&(r=i[1],o=i[3])}else o=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(t)?r=r.slice(1):r=r.slice(1,-1)),Ot(n,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer)}}reflink(e,n){let t;if((t=this.rules.inline.reflink.exec(e))||(t=this.rules.inline.nolink.exec(e))){const r=(t[2]||t[1]).replace(/\s+/g," "),o=n[r.toLowerCase()];if(!o){const i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return Ot(t,o,t[0],this.lexer)}}emStrong(e,n,t=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&t.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const i=[...r[0]].length-1;let l,a,d=i,h=0;const m=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,n=n.slice(-1*e.length+i);(r=m.exec(n))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(a=[...l].length,r[3]||r[4]){d+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){h+=a;continue}if(d-=a,d>0)continue;a=Math.min(a,a+d+h);const g=[...r[0]][0].length,T=e.slice(0,i+r.index+g+a);if(Math.min(i,a)%2){const H=T.slice(1,-1);return{type:"em",raw:T,text:H,tokens:this.lexer.inlineTokens(H)}}const $=T.slice(2,-2);return{type:"strong",raw:T,text:$,tokens:this.lexer.inlineTokens($)}}}}codespan(e){const n=this.rules.inline.code.exec(e);if(n){let t=n[2].replace(/\n/g," ");const r=/[^ ]/.test(t),o=/^ /.test(t)&&/ $/.test(t);return r&&o&&(t=t.substring(1,t.length-1)),t=F(t,!0),{type:"codespan",raw:n[0],text:t}}}br(e){const n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){const n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){const n=this.rules.inline.autolink.exec(e);if(n){let t,r;return n[2]==="@"?(t=F(n[1]),r="mailto:"+t):(t=F(n[1]),r=t),{type:"link",raw:n[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(e){var t;let n;if(n=this.rules.inline.url.exec(e)){let r,o;if(n[2]==="@")r=F(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=((t=this.rules.inline._backpedal.exec(n[0]))==null?void 0:t[0])??"";while(i!==n[0]);r=F(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const n=this.rules.inline.text.exec(e);if(n){let t;return this.lexer.state.inRawBlock?t=n[0]:t=F(n[0]),{type:"text",raw:n[0],text:t}}}}const Nn=/^(?: *(?:\n|$))+/,vn=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,zn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,de=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Dt=/(?:[*+-]|\d{1,9}[.)])/,Ct=w(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Dt).getRegex(),qe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$n=/^[^\n]+/,Ze=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Un=w(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ze).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Fn=w(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Dt).getRegex(),Ie="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",je=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Hn=w("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",je).replace("tag",Ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mt=w(qe).replace("hr",de).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ie).getRegex(),Ye={blockquote:w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Mt).getRegex(),code:vn,def:Un,fences:zn,heading:Pn,hr:de,html:Hn,lheading:Ct,list:Fn,newline:Nn,paragraph:Mt,table:fe,text:$n},Nt=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",de).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ie).getRegex(),Bn={...Ye,table:Nt,paragraph:w(qe).replace("hr",de).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Nt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ie).getRegex()},Gn={...Ye,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",je).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(qe).replace("hr",de).replace("heading",` *#{1,6} *[^
12
+ `,e=e.substring(Q.length+1),m=g.slice(T)}}o.loose||(d?o.loose=!0:/\n *\n *$/.test(l)&&(d=!0));let H=null,X;this.options.gfm&&(H=/^\[[ xX]\] /.exec(a),H&&(X=H[0]!=="[ ] ",a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:l,task:!!H,checked:X,loose:!1,text:a,tokens:[]}),o.raw+=l}o.items[o.items.length-1].raw=l.trimEnd(),o.items[o.items.length-1].text=a.trimEnd(),o.raw=o.raw.trimEnd();for(let h=0;h<o.items.length;h++)if(this.lexer.state.top=!1,o.items[h].tokens=this.lexer.blockTokens(o.items[h].text,[]),!o.loose){const m=o.items[h].tokens.filter(T=>T.type==="space"),g=m.length>0&&m.some(T=>/\n.*\n/.test(T.raw));o.loose=g}if(o.loose)for(let h=0;h<o.items.length;h++)o.items[h].loose=!0;return o}}html(e){const n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){const n=this.rules.block.def.exec(e);if(n){const t=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:t,raw:n[0],href:i,title:o}}}table(e){const n=this.rules.block.table.exec(e);if(!n||!/[:|]/.test(n[2]))return;const t=It(n[1]),i=n[2].replace(/^\||\| *$/g,"").split("|"),o=n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
13
+ `):[],s={type:"table",raw:n[0],header:[],align:[],rows:[]};if(t.length===i.length){for(const l of i)/^ *-+: *$/.test(l)?s.align.push("right"):/^ *:-+: *$/.test(l)?s.align.push("center"):/^ *:-+ *$/.test(l)?s.align.push("left"):s.align.push(null);for(const l of t)s.header.push({text:l,tokens:this.lexer.inline(l)});for(const l of o)s.rows.push(It(l,s.header.length).map(a=>({text:a,tokens:this.lexer.inline(a)})));return s}}lheading(e){const n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){const n=this.rules.block.paragraph.exec(e);if(n){const t=n[1].charAt(n[1].length-1)===`
14
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:t,tokens:this.lexer.inline(t)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:F(n[1])}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const t=n[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t))return;const s=Re(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{const s=Cn(n[2],"()");if(s>-1){const a=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s&&(i=s[1],o=s[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(t)?i=i.slice(1):i=i.slice(1,-1)),Ot(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer)}}reflink(e,n){let t;if((t=this.rules.inline.reflink.exec(e))||(t=this.rules.inline.nolink.exec(e))){const i=(t[2]||t[1]).replace(/\s+/g," "),o=n[i.toLowerCase()];if(!o){const s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return Ot(t,o,t[0],this.lexer)}}emStrong(e,n,t=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&t.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const s=[...i[0]].length-1;let l,a,d=s,h=0;const m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,n=n.slice(-1*e.length+s);(i=m.exec(n))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(a=[...l].length,i[3]||i[4]){d+=a;continue}else if((i[5]||i[6])&&s%3&&!((s+a)%3)){h+=a;continue}if(d-=a,d>0)continue;a=Math.min(a,a+d+h);const g=[...i[0]][0].length,T=e.slice(0,s+i.index+g+a);if(Math.min(s,a)%2){const H=T.slice(1,-1);return{type:"em",raw:T,text:H,tokens:this.lexer.inlineTokens(H)}}const $=T.slice(2,-2);return{type:"strong",raw:T,text:$,tokens:this.lexer.inlineTokens($)}}}}codespan(e){const n=this.rules.inline.code.exec(e);if(n){let t=n[2].replace(/\n/g," ");const i=/[^ ]/.test(t),o=/^ /.test(t)&&/ $/.test(t);return i&&o&&(t=t.substring(1,t.length-1)),t=F(t,!0),{type:"codespan",raw:n[0],text:t}}}br(e){const n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){const n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){const n=this.rules.inline.autolink.exec(e);if(n){let t,i;return n[2]==="@"?(t=F(n[1]),i="mailto:"+t):(t=F(n[1]),i=t),{type:"link",raw:n[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(e){var t;let n;if(n=this.rules.inline.url.exec(e)){let i,o;if(n[2]==="@")i=F(n[0]),o="mailto:"+i;else{let s;do s=n[0],n[0]=((t=this.rules.inline._backpedal.exec(n[0]))==null?void 0:t[0])??"";while(s!==n[0]);i=F(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const n=this.rules.inline.text.exec(e);if(n){let t;return this.lexer.state.inRawBlock?t=n[0]:t=F(n[0]),{type:"text",raw:n[0],text:t}}}}const Nn=/^(?: *(?:\n|$))+/,vn=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,zn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,de=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Dt=/(?:[*+-]|\d{1,9}[.)])/,Ct=w(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Dt).getRegex(),qe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$n=/^[^\n]+/,Ze=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Un=w(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ze).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Fn=w(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Dt).getRegex(),Ie="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",je=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Hn=w("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",je).replace("tag",Ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mt=w(qe).replace("hr",de).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ie).getRegex(),Ye={blockquote:w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Mt).getRegex(),code:vn,def:Un,fences:zn,heading:Pn,hr:de,html:Hn,lheading:Ct,list:Fn,newline:Nn,paragraph:Mt,table:fe,text:$n},Nt=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",de).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ie).getRegex(),Bn={...Ye,table:Nt,paragraph:w(qe).replace("hr",de).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Nt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ie).getRegex()},Gn={...Ye,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",je).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(qe).replace("hr",de).replace("heading",` *#{1,6} *[^
15
15
  ]`).replace("lheading",Ct).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zt=/^( {2,}|\\)\n(?!\s*$)/,qn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ge="\\p{P}$+<=>`^|~",Zn=w(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ge).getRegex(),jn=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Yn=w(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ge).getRegex(),Xn=w("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ge).getRegex(),Qn=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ge).getRegex(),Vn=w(/\\([punct])/,"gu").replace(/punct/g,ge).getRegex(),Kn=w(/^<(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(),Jn=w(je).replace("(?:-->|$)","-->").getRegex(),ei=w("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Jn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Oe=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ti=w(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Oe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Pt=w(/^!?\[(label)\]\[(ref)\]/).replace("label",Oe).replace("ref",Ze).getRegex(),$t=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ze).getRegex(),ni=w("reflink|nolink(?!\\()","g").replace("reflink",Pt).replace("nolink",$t).getRegex(),Xe={_backpedal:fe,anyPunctuation:Vn,autolink:Kn,blockSkip:jn,br:zt,code:Wn,del:fe,emStrongLDelim:Yn,emStrongRDelimAst:Xn,emStrongRDelimUnd:Qn,escape:vt,link:ti,nolink:$t,punctuation:Zn,reflink:Pt,reflinkSearch:ni,tag:ei,text:qn,url:fe},ii={...Xe,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",Oe).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Oe).getRegex()},Qe={...Xe,escape:w(vt).replace("])","~|])").getRegex(),url:w(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},si={...Qe,br:w(zt).replace("{2,}","*").getRegex(),text:w(Qe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},De={normal:Ye,gfm:Bn,pedantic:Gn},me={normal:Xe,gfm:Qe,breaks:si,pedantic:ii};class W{constructor(e){b(this,"tokens");b(this,"options");b(this,"state");b(this,"tokenizer");b(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ee,this.options.tokenizer=this.options.tokenizer||new Le,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:De.normal,inline:me.normal};this.options.pedantic?(n.block=De.pedantic,n.inline=me.pedantic):this.options.gfm&&(n.block=De.gfm,this.options.breaks?n.inline=me.breaks:n.inline=me.gfm),this.tokenizer.rules=n}static get rules(){return{block:De,inline:me}}static lex(e,n){return new W(n).lex(e)}static lexInline(e,n){return new W(n).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
16
- `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const t=this.inlineQueue[n];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(l,a,d)=>a+" ".repeat(d.length));let t,r,o,i;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(t=l.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))){if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length),t.raw.length===1&&n.length>0?n[n.length-1].raw+=`
17
- `:n.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
18
- `+t.raw,r.text+=`
19
- `+t.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
20
- `+t.raw,r.text+=`
21
- `+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const a=e.slice(1);let d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},a),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(o=e.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(o))){r=n[n.length-1],i&&r.type==="paragraph"?(r.raw+=`
22
- `+t.raw,r.text+=`
23
- `+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(t),i=o.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&r.type==="text"?(r.raw+=`
24
- `+t.raw,r.text+=`
25
- `+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(t);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let t,r,o,i=e,l,a,d;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)h.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,l.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(d=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(t=h.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))){if(t=this.tokenizer.escape(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.tag(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&t.type==="text"&&r.type==="text"?(r.raw+=t.raw,r.text+=t.text):n.push(t);continue}if(t=this.tokenizer.link(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(t.raw.length),r=n[n.length-1],r&&t.type==="text"&&r.type==="text"?(r.raw+=t.raw,r.text+=t.text):n.push(t);continue}if(t=this.tokenizer.emStrong(e,i,d)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.codespan(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.br(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.del(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.autolink(e)){e=e.substring(t.raw.length),n.push(t);continue}if(!this.state.inLink&&(t=this.tokenizer.url(e))){e=e.substring(t.raw.length),n.push(t);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const m=e.slice(1);let g;this.options.extensions.startInline.forEach(T=>{g=T.call({lexer:this},m),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(o=e.substring(0,h+1))}if(t=this.tokenizer.inlineText(o)){e=e.substring(t.raw.length),t.raw.slice(-1)!=="_"&&(d=t.raw.slice(-1)),a=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=t.raw,r.text+=t.text):n.push(t);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}}class Ce{constructor(e){b(this,"options");this.options=e||ee}code(e,n,t){var o;const r=(o=(n||"").match(/^\S*/))==null?void 0:o[0];return e=e.replace(/\n$/,"")+`
26
- `,r?'<pre><code class="language-'+F(r)+'">'+(t?e:F(e,!0))+`</code></pre>
16
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const t=this.inlineQueue[n];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(l,a,d)=>a+" ".repeat(d.length));let t,i,o,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(t=l.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))){if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length),t.raw.length===1&&n.length>0?n[n.length-1].raw+=`
17
+ `:n.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
18
+ `+t.raw,i.text+=`
19
+ `+t.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
20
+ `+t.raw,i.text+=`
21
+ `+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const a=e.slice(1);let d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},a),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(o=e.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(o))){i=n[n.length-1],s&&i.type==="paragraph"?(i.raw+=`
22
+ `+t.raw,i.text+=`
23
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(t),s=o.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
24
+ `+t.raw,i.text+=`
25
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(t);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let t,i,o,s=e,l,a,d;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)h.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,l.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(d=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(t=h.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))){if(t=this.tokenizer.escape(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.tag(e)){e=e.substring(t.raw.length),i=n[n.length-1],i&&t.type==="text"&&i.type==="text"?(i.raw+=t.raw,i.text+=t.text):n.push(t);continue}if(t=this.tokenizer.link(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(t.raw.length),i=n[n.length-1],i&&t.type==="text"&&i.type==="text"?(i.raw+=t.raw,i.text+=t.text):n.push(t);continue}if(t=this.tokenizer.emStrong(e,s,d)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.codespan(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.br(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.del(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.autolink(e)){e=e.substring(t.raw.length),n.push(t);continue}if(!this.state.inLink&&(t=this.tokenizer.url(e))){e=e.substring(t.raw.length),n.push(t);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const m=e.slice(1);let g;this.options.extensions.startInline.forEach(T=>{g=T.call({lexer:this},m),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(o=e.substring(0,h+1))}if(t=this.tokenizer.inlineText(o)){e=e.substring(t.raw.length),t.raw.slice(-1)!=="_"&&(d=t.raw.slice(-1)),a=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=t.raw,i.text+=t.text):n.push(t);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}}class Ce{constructor(e){b(this,"options");this.options=e||ee}code(e,n,t){var o;const i=(o=(n||"").match(/^\S*/))==null?void 0:o[0];return e=e.replace(/\n$/,"")+`
26
+ `,i?'<pre><code class="language-'+F(i)+'">'+(t?e:F(e,!0))+`</code></pre>
27
27
  `:"<pre><code>"+(t?e:F(e,!0))+`</code></pre>
28
28
  `}blockquote(e){return`<blockquote>
29
29
  ${e}</blockquote>
30
30
  `}html(e,n){return e}heading(e,n,t){return`<h${n}>${e}</h${n}>
31
31
  `}hr(){return`<hr>
32
- `}list(e,n,t){const r=n?"ol":"ul",o=n&&t!==1?' start="'+t+'"':"";return"<"+r+o+`>
33
- `+e+"</"+r+`>
32
+ `}list(e,n,t){const i=n?"ol":"ul",o=n&&t!==1?' start="'+t+'"':"";return"<"+i+o+`>
33
+ `+e+"</"+i+`>
34
34
  `}listitem(e,n,t){return`<li>${e}</li>
35
35
  `}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
36
36
  `}table(e,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
@@ -40,10 +40,10 @@ ${e}</blockquote>
40
40
  `}tablerow(e){return`<tr>
41
41
  ${e}</tr>
42
42
  `}tablecell(e,n){const t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
43
- `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,n,t){const r=Lt(e);if(r===null)return t;e=r;let o='<a href="'+e+'"';return n&&(o+=' title="'+n+'"'),o+=">"+t+"</a>",o}image(e,n,t){const r=Lt(e);if(r===null)return t;e=r;let o=`<img src="${e}" alt="${t}"`;return n&&(o+=` title="${n}"`),o+=">",o}text(e){return e}}class Ve{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,t){return""+t}image(e,n,t){return""+t}br(){return""}}class q{constructor(e){b(this,"options");b(this,"renderer");b(this,"textRenderer");this.options=e||ee,this.options.renderer=this.options.renderer||new Ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ve}static parse(e,n){return new q(n).parse(e)}static parseInline(e,n){return new q(n).parseInline(e)}parse(e,n=!0){let t="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const i=o,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(i.type)){t+=l||"";continue}}switch(o.type){case"space":continue;case"hr":{t+=this.renderer.hr();continue}case"heading":{const i=o;t+=this.renderer.heading(this.parseInline(i.tokens),i.depth,On(this.parseInline(i.tokens,this.textRenderer)));continue}case"code":{const i=o;t+=this.renderer.code(i.text,i.lang,!!i.escaped);continue}case"table":{const i=o;let l="",a="";for(let h=0;h<i.header.length;h++)a+=this.renderer.tablecell(this.parseInline(i.header[h].tokens),{header:!0,align:i.align[h]});l+=this.renderer.tablerow(a);let d="";for(let h=0;h<i.rows.length;h++){const m=i.rows[h];a="";for(let g=0;g<m.length;g++)a+=this.renderer.tablecell(this.parseInline(m[g].tokens),{header:!1,align:i.align[g]});d+=this.renderer.tablerow(a)}t+=this.renderer.table(l,d);continue}case"blockquote":{const i=o,l=this.parse(i.tokens);t+=this.renderer.blockquote(l);continue}case"list":{const i=o,l=i.ordered,a=i.start,d=i.loose;let h="";for(let m=0;m<i.items.length;m++){const g=i.items[m],T=g.checked,$=g.task;let H="";if(g.task){const X=this.renderer.checkbox(!!T);d?g.tokens.length>0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=X+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=X+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:X+" "}):H+=X+" "}H+=this.parse(g.tokens,d),h+=this.renderer.listitem(H,$,!!T)}t+=this.renderer.list(h,l,a);continue}case"html":{const i=o;t+=this.renderer.html(i.text,i.block);continue}case"paragraph":{const i=o;t+=this.renderer.paragraph(this.parseInline(i.tokens));continue}case"text":{let i=o,l=i.tokens?this.parseInline(i.tokens):i.text;for(;r+1<e.length&&e[r+1].type==="text";)i=e[++r],l+=`
44
- `+(i.tokens?this.parseInline(i.tokens):i.text);t+=n?this.renderer.paragraph(l):l;continue}default:{const i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return t}parseInline(e,n){n=n||this.renderer;let t="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const i=this.options.extensions.renderers[o.type].call({parser:this},o);if(i!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){t+=i||"";continue}}switch(o.type){case"escape":{const i=o;t+=n.text(i.text);break}case"html":{const i=o;t+=n.html(i.text);break}case"link":{const i=o;t+=n.link(i.href,i.title,this.parseInline(i.tokens,n));break}case"image":{const i=o;t+=n.image(i.href,i.title,i.text);break}case"strong":{const i=o;t+=n.strong(this.parseInline(i.tokens,n));break}case"em":{const i=o;t+=n.em(this.parseInline(i.tokens,n));break}case"codespan":{const i=o;t+=n.codespan(i.text);break}case"br":{t+=n.br();break}case"del":{const i=o;t+=n.del(this.parseInline(i.tokens,n));break}case"text":{const i=o;t+=n.text(i.text);break}default:{const i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return t}}class ke{constructor(e){b(this,"options");this.options=e||ee}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}b(ke,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class ri{constructor(...e){yn(this,ne);b(this,"defaults",P());b(this,"options",this.setOptions);b(this,"parse",We(this,ne,Et).call(this,W.lex,q.parse));b(this,"parseInline",We(this,ne,Et).call(this,W.lexInline,q.parseInline));b(this,"Parser",q);b(this,"Renderer",Ce);b(this,"TextRenderer",Ve);b(this,"Lexer",W);b(this,"Tokenizer",Le);b(this,"Hooks",ke);this.use(...e)}walkTokens(e,n){var r,o;let t=[];for(const i of e)switch(t=t.concat(n.call(this,i)),i.type){case"table":{const l=i;for(const a of l.header)t=t.concat(this.walkTokens(a.tokens,n));for(const a of l.rows)for(const d of a)t=t.concat(this.walkTokens(d.tokens,n));break}case"list":{const l=i;t=t.concat(this.walkTokens(l.items,n));break}default:{const l=i;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{const d=l[a].flat(1/0);t=t.concat(this.walkTokens(d,n))}):l.tokens&&(t=t.concat(this.walkTokens(l.tokens,n)))}}return t}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const i=n.renderers[o.name];i?n.renderers[o.name]=function(...l){let a=o.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=n[o.level];i?i.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),r.extensions=n),t.renderer){const o=this.defaults.renderer||new Ce(this.defaults);for(const i in t.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(i==="options")continue;const l=i,a=t.renderer[l],d=o[l];o[l]=(...h)=>{let m=a.apply(o,h);return m===!1&&(m=d.apply(o,h)),m||""}}r.renderer=o}if(t.tokenizer){const o=this.defaults.tokenizer||new Le(this.defaults);for(const i in t.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const l=i,a=t.tokenizer[l],d=o[l];o[l]=(...h)=>{let m=a.apply(o,h);return m===!1&&(m=d.apply(o,h)),m}}r.tokenizer=o}if(t.hooks){const o=this.defaults.hooks||new ke;for(const i in t.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(i==="options")continue;const l=i,a=t.hooks[l],d=o[l];ke.passThroughHooks.has(i)?o[l]=h=>{if(this.defaults.async)return Promise.resolve(a.call(o,h)).then(g=>d.call(o,g));const m=a.call(o,h);return d.call(o,m)}:o[l]=(...h)=>{let m=a.apply(o,h);return m===!1&&(m=d.apply(o,h)),m}}r.hooks=o}if(t.walkTokens){const o=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),o&&(a=a.concat(o.call(this,l))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return W.lex(e,n??this.defaults)}parser(e,n){return q.parse(e,n??this.defaults)}}ne=new WeakSet,Et=function(e,n){return(t,r)=>{const o={...r},i={...this.defaults,...o};this.defaults.async===!0&&o.async===!1&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const l=We(this,ne,An).call(this,!!i.silent,!!i.async);if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(a=>e(a,i)).then(a=>i.hooks?i.hooks.processAllTokens(a):a).then(a=>i.walkTokens?Promise.all(this.walkTokens(a,i.walkTokens)).then(()=>a):a).then(a=>n(a,i)).then(a=>i.hooks?i.hooks.postprocess(a):a).catch(l);try{i.hooks&&(t=i.hooks.preprocess(t));let a=e(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let d=n(a,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(a){return l(a)}}},An=function(e,n){return t=>{if(t.message+=`
45
- Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+F(t.message+"",!0)+"</pre>";return n?Promise.resolve(r):r}if(n)return Promise.reject(t);throw t}};const te=new ri;function x(c,e){return te.parse(c,e)}x.options=x.setOptions=function(c){return te.setOptions(c),x.defaults=te.defaults,yt(x.defaults),x},x.getDefaults=P,x.defaults=ee,x.use=function(...c){return te.use(...c),x.defaults=te.defaults,yt(x.defaults),x},x.walkTokens=function(c,e){return te.walkTokens(c,e)},x.parseInline=te.parseInline,x.Parser=q,x.parser=q.parse,x.Renderer=Ce,x.TextRenderer=Ve,x.Lexer=W,x.lexer=W.lex,x.Tokenizer=Le,x.Hooks=ke,x.parse=x,x.options,x.setOptions,x.use,x.walkTokens,x.parseInline,q.parse,W.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Ut,setPrototypeOf:Ft,isFrozen:oi,getPrototypeOf:li,getOwnPropertyDescriptor:ai}=Object;let{freeze:M,seal:B,create:Ke}=Object,{apply:Je,construct:et}=typeof Reflect<"u"&&Reflect;M||(M=function(e){return e}),B||(B=function(e){return e}),Je||(Je=function(e,n){for(var t=arguments.length,r=new Array(t>2?t-2:0),o=2;o<t;o++)r[o-2]=arguments[o];return e.apply(n,r)}),et||(et=function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];return new e(...t)});const Me=v(Array.prototype.forEach),ci=v(Array.prototype.lastIndexOf),Ht=v(Array.prototype.pop),Te=v(Array.prototype.push),ui=v(Array.prototype.splice),Ne=v(String.prototype.toLowerCase),tt=v(String.prototype.toString),nt=v(String.prototype.match),be=v(String.prototype.replace),pi=v(String.prototype.indexOf),hi=v(String.prototype.trim),G=v(Object.prototype.hasOwnProperty),N=v(RegExp.prototype.test),xe=fi(TypeError);function v(c){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];return Je(c,e,t)}}function fi(c){return function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return et(c,n)}}function k(c,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ne;Ft&&Ft(c,null);let t=e.length;for(;t--;){let r=e[t];if(typeof r=="string"){const o=n(r);o!==r&&(oi(e)||(e[t]=o),r=o)}c[r]=!0}return c}function di(c){for(let e=0;e<c.length;e++)G(c,e)||(c[e]=null);return c}function Z(c){const e=Ke(null);for(const[n,t]of Ut(c))G(c,n)&&(Array.isArray(t)?e[n]=di(t):t&&typeof t=="object"&&t.constructor===Object?e[n]=Z(t):e[n]=t);return e}function we(c,e){for(;c!==null;){const t=ai(c,e);if(t){if(t.get)return v(t.get);if(typeof t.value=="function")return v(t.value)}c=li(c)}function n(){return null}return n}const Bt=M(["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"]),it=M(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),st=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"]),gi=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"]),rt=M(["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"]),mi=M(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Gt=M(["#text"]),Wt=M(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","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","slot"]),ot=M(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),qt=M(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ve=M(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ki=B(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ti=B(/<%[\w\W]*|[\w\W]*%>/gm),bi=B(/\$\{[\w\W]*/gm),xi=B(/^data-[\-\w.\u00B7-\uFFFF]+$/),wi=B(/^aria-[\-\w]+$/),Zt=B(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_i=B(/^(?:\w+script|data):/i),Ei=B(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jt=B(/^html$/i),yi=B(/^[a-z][.\w]*(-[.\w]+)+$/i);var Yt=Object.freeze({__proto__:null,ARIA_ATTR:wi,ATTR_WHITESPACE:Ei,CUSTOM_ELEMENT:yi,DATA_ATTR:xi,DOCTYPE_NAME:jt,ERB_EXPR:Ti,IS_ALLOWED_URI:Zt,IS_SCRIPT_OR_DATA:_i,MUSTACHE_EXPR:ki,TMPLIT_EXPR:bi});const _e={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ai=function(){return typeof window>"u"?null:window},Si=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let t=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(t=n.getAttribute(r));const o="dompurify"+(t?"#"+t:"");try{return e.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Xt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qt(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ai();const e=f=>Qt(f);if(e.version="3.3.1",e.removed=[],!c||!c.document||c.document.nodeType!==_e.document||!c.Element)return e.isSupported=!1,e;let{document:n}=c;const t=n,r=t.currentScript,{DocumentFragment:o,HTMLTemplateElement:i,Node:l,Element:a,NodeFilter:d,NamedNodeMap:h=c.NamedNodeMap||c.MozNamedAttrMap,HTMLFormElement:m,DOMParser:g,trustedTypes:T}=c,$=a.prototype,H=we($,"cloneNode"),X=we($,"remove"),Ee=we($,"nextSibling"),ze=we($,"childNodes"),ie=we($,"parentNode");if(typeof i=="function"){const f=n.createElement("template");f.content&&f.content.ownerDocument&&(n=f.content.ownerDocument)}let L,Q="";const{implementation:lt,createNodeIterator:Li,createDocumentFragment:Ii,getElementsByTagName:Oi}=n,{importNode:Di}=t;let z=Xt();e.isSupported=typeof Ut=="function"&&typeof ie=="function"&&lt&&lt.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:at,ERB_EXPR:ct,TMPLIT_EXPR:ut,DATA_ATTR:Ci,ARIA_ATTR:Mi,IS_SCRIPT_OR_DATA:Ni,ATTR_WHITESPACE:Kt,CUSTOM_ELEMENT:vi}=Yt;let{IS_ALLOWED_URI:Jt}=Yt,I=null;const en=k({},[...Bt,...it,...st,...rt,...Gt]);let O=null;const tn=k({},[...Wt,...ot,...qt,...ve]);let A=Object.seal(Ke(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}})),ye=null,pt=null;const oe=Object.seal(Ke(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,ht=!0,sn=!1,rn=!0,le=!1,Pe=!0,se=!1,ft=!1,dt=!1,ae=!1,$e=!1,Ue=!1,on=!0,ln=!1;const zi="user-content-";let gt=!0,Ae=!1,ce={},j=null;const mt=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let an=null;const cn=k({},["audio","video","img","source","image","track"]);let kt=null;const un=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",He="http://www.w3.org/2000/svg",V="http://www.w3.org/1999/xhtml";let ue=V,Tt=!1,bt=null;const Pi=k({},[Fe,He,V],tt);let Be=k({},["mi","mo","mn","ms","mtext"]),Ge=k({},["annotation-xml"]);const $i=k({},["title","style","font","a","script"]);let Se=null;const Ui=["application/xhtml+xml","text/html"],Fi="text/html";let R=null,pe=null;const Hi=n.createElement("form"),pn=function(s){return s instanceof RegExp||s instanceof Function},xt=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pe&&pe===s)){if((!s||typeof s!="object")&&(s={}),s=Z(s),Se=Ui.indexOf(s.PARSER_MEDIA_TYPE)===-1?Fi:s.PARSER_MEDIA_TYPE,R=Se==="application/xhtml+xml"?tt:Ne,I=G(s,"ALLOWED_TAGS")?k({},s.ALLOWED_TAGS,R):en,O=G(s,"ALLOWED_ATTR")?k({},s.ALLOWED_ATTR,R):tn,bt=G(s,"ALLOWED_NAMESPACES")?k({},s.ALLOWED_NAMESPACES,tt):Pi,kt=G(s,"ADD_URI_SAFE_ATTR")?k(Z(un),s.ADD_URI_SAFE_ATTR,R):un,an=G(s,"ADD_DATA_URI_TAGS")?k(Z(cn),s.ADD_DATA_URI_TAGS,R):cn,j=G(s,"FORBID_CONTENTS")?k({},s.FORBID_CONTENTS,R):mt,ye=G(s,"FORBID_TAGS")?k({},s.FORBID_TAGS,R):Z({}),pt=G(s,"FORBID_ATTR")?k({},s.FORBID_ATTR,R):Z({}),ce=G(s,"USE_PROFILES")?s.USE_PROFILES:!1,nn=s.ALLOW_ARIA_ATTR!==!1,ht=s.ALLOW_DATA_ATTR!==!1,sn=s.ALLOW_UNKNOWN_PROTOCOLS||!1,rn=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=s.SAFE_FOR_TEMPLATES||!1,Pe=s.SAFE_FOR_XML!==!1,se=s.WHOLE_DOCUMENT||!1,ae=s.RETURN_DOM||!1,$e=s.RETURN_DOM_FRAGMENT||!1,Ue=s.RETURN_TRUSTED_TYPE||!1,dt=s.FORCE_BODY||!1,on=s.SANITIZE_DOM!==!1,ln=s.SANITIZE_NAMED_PROPS||!1,gt=s.KEEP_CONTENT!==!1,Ae=s.IN_PLACE||!1,Jt=s.ALLOWED_URI_REGEXP||Zt,ue=s.NAMESPACE||V,Be=s.MATHML_TEXT_INTEGRATION_POINTS||Be,Ge=s.HTML_INTEGRATION_POINTS||Ge,A=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&pn(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(A.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&pn(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(A.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),le&&(ht=!1),$e&&(ae=!0),ce&&(I=k({},Gt),O=[],ce.html===!0&&(k(I,Bt),k(O,Wt)),ce.svg===!0&&(k(I,it),k(O,ot),k(O,ve)),ce.svgFilters===!0&&(k(I,st),k(O,ot),k(O,ve)),ce.mathMl===!0&&(k(I,rt),k(O,qt),k(O,ve))),s.ADD_TAGS&&(typeof s.ADD_TAGS=="function"?oe.tagCheck=s.ADD_TAGS:(I===en&&(I=Z(I)),k(I,s.ADD_TAGS,R))),s.ADD_ATTR&&(typeof s.ADD_ATTR=="function"?oe.attributeCheck=s.ADD_ATTR:(O===tn&&(O=Z(O)),k(O,s.ADD_ATTR,R))),s.ADD_URI_SAFE_ATTR&&k(kt,s.ADD_URI_SAFE_ATTR,R),s.FORBID_CONTENTS&&(j===mt&&(j=Z(j)),k(j,s.FORBID_CONTENTS,R)),s.ADD_FORBID_CONTENTS&&(j===mt&&(j=Z(j)),k(j,s.ADD_FORBID_CONTENTS,R)),gt&&(I["#text"]=!0),se&&k(I,["html","head","body"]),I.table&&(k(I,["tbody"]),delete ye.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=s.TRUSTED_TYPES_POLICY,Q=L.createHTML("")}else L===void 0&&(L=Si(T,r)),L!==null&&typeof Q=="string"&&(Q=L.createHTML(""));M&&M(s),pe=s}},hn=k({},[...it,...st,...gi]),fn=k({},[...rt,...mi]),Bi=function(s){let u=ie(s);(!u||!u.tagName)&&(u={namespaceURI:ue,tagName:"template"});const p=Ne(s.tagName),_=Ne(u.tagName);return bt[s.namespaceURI]?s.namespaceURI===He?u.namespaceURI===V?p==="svg":u.namespaceURI===Fe?p==="svg"&&(_==="annotation-xml"||Be[_]):!!hn[p]:s.namespaceURI===Fe?u.namespaceURI===V?p==="math":u.namespaceURI===He?p==="math"&&Ge[_]:!!fn[p]:s.namespaceURI===V?u.namespaceURI===He&&!Ge[_]||u.namespaceURI===Fe&&!Be[_]?!1:!fn[p]&&($i[p]||!hn[p]):!!(Se==="application/xhtml+xml"&&bt[s.namespaceURI]):!1},Y=function(s){Te(e.removed,{element:s});try{ie(s).removeChild(s)}catch{X(s)}},re=function(s,u){try{Te(e.removed,{attribute:u.getAttributeNode(s),from:u})}catch{Te(e.removed,{attribute:null,from:u})}if(u.removeAttribute(s),s==="is")if(ae||$e)try{Y(u)}catch{}else try{u.setAttribute(s,"")}catch{}},dn=function(s){let u=null,p=null;if(dt)s="<remove></remove>"+s;else{const S=nt(s,/^[\r\n\t ]+/);p=S&&S[0]}Se==="application/xhtml+xml"&&ue===V&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");const _=L?L.createHTML(s):s;if(ue===V)try{u=new g().parseFromString(_,Se)}catch{}if(!u||!u.documentElement){u=lt.createDocument(ue,"template",null);try{u.documentElement.innerHTML=Tt?Q:_}catch{}}const C=u.body||u.documentElement;return s&&p&&C.insertBefore(n.createTextNode(p),C.childNodes[0]||null),ue===V?Oi.call(u,se?"html":"body")[0]:se?u.documentElement:C},gn=function(s){return Li.call(s.ownerDocument||s,s,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},wt=function(s){return s instanceof m&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof h)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},mn=function(s){return typeof l=="function"&&s instanceof l};function K(f,s,u){Me(f,p=>{p.call(e,s,u,pe)})}const kn=function(s){let u=null;if(K(z.beforeSanitizeElements,s,null),wt(s))return Y(s),!0;const p=R(s.nodeName);if(K(z.uponSanitizeElement,s,{tagName:p,allowedTags:I}),Pe&&s.hasChildNodes()&&!mn(s.firstElementChild)&&N(/<[/\w!]/g,s.innerHTML)&&N(/<[/\w!]/g,s.textContent)||s.nodeType===_e.progressingInstruction||Pe&&s.nodeType===_e.comment&&N(/<[/\w]/g,s.data))return Y(s),!0;if(!(oe.tagCheck instanceof Function&&oe.tagCheck(p))&&(!I[p]||ye[p])){if(!ye[p]&&bn(p)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,p)||A.tagNameCheck instanceof Function&&A.tagNameCheck(p)))return!1;if(gt&&!j[p]){const _=ie(s)||s.parentNode,C=ze(s)||s.childNodes;if(C&&_){const S=C.length;for(let U=S-1;U>=0;--U){const J=H(C[U],!0);J.__removalCount=(s.__removalCount||0)+1,_.insertBefore(J,Ee(s))}}}return Y(s),!0}return s instanceof a&&!Bi(s)||(p==="noscript"||p==="noembed"||p==="noframes")&&N(/<\/no(script|embed|frames)/i,s.innerHTML)?(Y(s),!0):(le&&s.nodeType===_e.text&&(u=s.textContent,Me([at,ct,ut],_=>{u=be(u,_," ")}),s.textContent!==u&&(Te(e.removed,{element:s.cloneNode()}),s.textContent=u)),K(z.afterSanitizeElements,s,null),!1)},Tn=function(s,u,p){if(on&&(u==="id"||u==="name")&&(p in n||p in Hi))return!1;if(!(ht&&!pt[u]&&N(Ci,u))){if(!(nn&&N(Mi,u))){if(!(oe.attributeCheck instanceof Function&&oe.attributeCheck(u,s))){if(!O[u]||pt[u]){if(!(bn(s)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,s)||A.tagNameCheck instanceof Function&&A.tagNameCheck(s))&&(A.attributeNameCheck instanceof RegExp&&N(A.attributeNameCheck,u)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(u,s))||u==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,p)||A.tagNameCheck instanceof Function&&A.tagNameCheck(p))))return!1}else if(!kt[u]){if(!N(Jt,be(p,Kt,""))){if(!((u==="src"||u==="xlink:href"||u==="href")&&s!=="script"&&pi(p,"data:")===0&&an[s])){if(!(sn&&!N(Ni,be(p,Kt,"")))){if(p)return!1}}}}}}}return!0},bn=function(s){return s!=="annotation-xml"&&nt(s,vi)},xn=function(s){K(z.beforeSanitizeAttributes,s,null);const{attributes:u}=s;if(!u||wt(s))return;const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let _=u.length;for(;_--;){const C=u[_],{name:S,namespaceURI:U,value:J}=C,he=R(S),_t=J;let D=S==="value"?_t:hi(_t);if(p.attrName=he,p.attrValue=D,p.keepAttr=!0,p.forceKeepAttr=void 0,K(z.uponSanitizeAttribute,s,p),D=p.attrValue,ln&&(he==="id"||he==="name")&&(re(S,s),D=zi+D),Pe&&N(/((--!?|])>)|<\/(style|title|textarea)/i,D)){re(S,s);continue}if(he==="attributename"&&nt(D,"href")){re(S,s);continue}if(p.forceKeepAttr)continue;if(!p.keepAttr){re(S,s);continue}if(!rn&&N(/\/>/i,D)){re(S,s);continue}le&&Me([at,ct,ut],_n=>{D=be(D,_n," ")});const wn=R(s.nodeName);if(!Tn(wn,he,D)){re(S,s);continue}if(L&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!U)switch(T.getAttributeType(wn,he)){case"TrustedHTML":{D=L.createHTML(D);break}case"TrustedScriptURL":{D=L.createScriptURL(D);break}}if(D!==_t)try{U?s.setAttributeNS(U,S,D):s.setAttribute(S,D),wt(s)?Y(s):Ht(e.removed)}catch{re(S,s)}}K(z.afterSanitizeAttributes,s,null)},Gi=function f(s){let u=null;const p=gn(s);for(K(z.beforeSanitizeShadowDOM,s,null);u=p.nextNode();)K(z.uponSanitizeShadowNode,u,null),kn(u),xn(u),u.content instanceof o&&f(u.content);K(z.afterSanitizeShadowDOM,s,null)};return e.sanitize=function(f){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=null,p=null,_=null,C=null;if(Tt=!f,Tt&&(f="<!-->"),typeof f!="string"&&!mn(f))if(typeof f.toString=="function"){if(f=f.toString(),typeof f!="string")throw xe("dirty is not a string, aborting")}else throw xe("toString is not a function");if(!e.isSupported)return f;if(ft||xt(s),e.removed=[],typeof f=="string"&&(Ae=!1),Ae){if(f.nodeName){const J=R(f.nodeName);if(!I[J]||ye[J])throw xe("root node is forbidden and cannot be sanitized in-place")}}else if(f instanceof l)u=dn("<!---->"),p=u.ownerDocument.importNode(f,!0),p.nodeType===_e.element&&p.nodeName==="BODY"||p.nodeName==="HTML"?u=p:u.appendChild(p);else{if(!ae&&!le&&!se&&f.indexOf("<")===-1)return L&&Ue?L.createHTML(f):f;if(u=dn(f),!u)return ae?null:Ue?Q:""}u&&dt&&Y(u.firstChild);const S=gn(Ae?f:u);for(;_=S.nextNode();)kn(_),xn(_),_.content instanceof o&&Gi(_.content);if(Ae)return f;if(ae){if($e)for(C=Ii.call(u.ownerDocument);u.firstChild;)C.appendChild(u.firstChild);else C=u;return(O.shadowroot||O.shadowrootmode)&&(C=Di.call(t,C,!0)),C}let U=se?u.outerHTML:u.innerHTML;return se&&I["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&N(jt,u.ownerDocument.doctype.name)&&(U="<!DOCTYPE "+u.ownerDocument.doctype.name+`>
46
- `+U),le&&Me([at,ct,ut],J=>{U=be(U,J," ")}),L&&Ue?L.createHTML(U):U},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xt(f),ft=!0},e.clearConfig=function(){pe=null,ft=!1},e.isValidAttribute=function(f,s,u){pe||xt({});const p=R(f),_=R(s);return Tn(p,_,u)},e.addHook=function(f,s){typeof s=="function"&&Te(z[f],s)},e.removeHook=function(f,s){if(s!==void 0){const u=ci(z[f],s);return u===-1?void 0:ui(z[f],u,1)[0]}return Ht(z[f])},e.removeHooks=function(f){z[f]=[]},e.removeAllHooks=function(){z=Xt()},e}var Ri=Qt();class Vt{constructor(e){b(this,"container");b(this,"box");b(this,"messagesDiv");b(this,"input");b(this,"sendBtn");b(this,"isOpen",!1);b(this,"history",[]);b(this,"config");this.config={title:"企业智能助手",welcomeMessage:"您好,有什么可以帮您?",provider:"google",...e},this.initDOM()}initDOM(){this.container=document.createElement("div"),this.container.className="lee-ai-container";const e=document.createElement("div");e.className="lee-ai-launcher",e.innerHTML='<svg viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"></path></svg>',e.onclick=()=>this.toggle(),this.box=document.createElement("div"),this.box.className="lee-ai-box",this.box.innerHTML=`
43
+ `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,n,t){const i=Lt(e);if(i===null)return t;e=i;let o='<a href="'+e+'"';return n&&(o+=' title="'+n+'"'),o+=">"+t+"</a>",o}image(e,n,t){const i=Lt(e);if(i===null)return t;e=i;let o=`<img src="${e}" alt="${t}"`;return n&&(o+=` title="${n}"`),o+=">",o}text(e){return e}}class Ve{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,t){return""+t}image(e,n,t){return""+t}br(){return""}}class q{constructor(e){b(this,"options");b(this,"renderer");b(this,"textRenderer");this.options=e||ee,this.options.renderer=this.options.renderer||new Ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ve}static parse(e,n){return new q(n).parse(e)}static parseInline(e,n){return new q(n).parseInline(e)}parse(e,n=!0){let t="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const s=o,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){t+=l||"";continue}}switch(o.type){case"space":continue;case"hr":{t+=this.renderer.hr();continue}case"heading":{const s=o;t+=this.renderer.heading(this.parseInline(s.tokens),s.depth,On(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=o;t+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=o;let l="",a="";for(let h=0;h<s.header.length;h++)a+=this.renderer.tablecell(this.parseInline(s.header[h].tokens),{header:!0,align:s.align[h]});l+=this.renderer.tablerow(a);let d="";for(let h=0;h<s.rows.length;h++){const m=s.rows[h];a="";for(let g=0;g<m.length;g++)a+=this.renderer.tablecell(this.parseInline(m[g].tokens),{header:!1,align:s.align[g]});d+=this.renderer.tablerow(a)}t+=this.renderer.table(l,d);continue}case"blockquote":{const s=o,l=this.parse(s.tokens);t+=this.renderer.blockquote(l);continue}case"list":{const s=o,l=s.ordered,a=s.start,d=s.loose;let h="";for(let m=0;m<s.items.length;m++){const g=s.items[m],T=g.checked,$=g.task;let H="";if(g.task){const X=this.renderer.checkbox(!!T);d?g.tokens.length>0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=X+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=X+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:X+" "}):H+=X+" "}H+=this.parse(g.tokens,d),h+=this.renderer.listitem(H,$,!!T)}t+=this.renderer.list(h,l,a);continue}case"html":{const s=o;t+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=o;t+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=o,l=s.tokens?this.parseInline(s.tokens):s.text;for(;i+1<e.length&&e[i+1].type==="text";)s=e[++i],l+=`
44
+ `+(s.tokens?this.parseInline(s.tokens):s.text);t+=n?this.renderer.paragraph(l):l;continue}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(e,n){n=n||this.renderer;let t="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){t+=s||"";continue}}switch(o.type){case"escape":{const s=o;t+=n.text(s.text);break}case"html":{const s=o;t+=n.html(s.text);break}case"link":{const s=o;t+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{const s=o;t+=n.image(s.href,s.title,s.text);break}case"strong":{const s=o;t+=n.strong(this.parseInline(s.tokens,n));break}case"em":{const s=o;t+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{const s=o;t+=n.codespan(s.text);break}case"br":{t+=n.br();break}case"del":{const s=o;t+=n.del(this.parseInline(s.tokens,n));break}case"text":{const s=o;t+=n.text(s.text);break}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}}class ke{constructor(e){b(this,"options");this.options=e||ee}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}b(ke,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class ri{constructor(...e){yn(this,ne);b(this,"defaults",P());b(this,"options",this.setOptions);b(this,"parse",We(this,ne,Et).call(this,W.lex,q.parse));b(this,"parseInline",We(this,ne,Et).call(this,W.lexInline,q.parseInline));b(this,"Parser",q);b(this,"Renderer",Ce);b(this,"TextRenderer",Ve);b(this,"Lexer",W);b(this,"Tokenizer",Le);b(this,"Hooks",ke);this.use(...e)}walkTokens(e,n){var i,o;let t=[];for(const s of e)switch(t=t.concat(n.call(this,s)),s.type){case"table":{const l=s;for(const a of l.header)t=t.concat(this.walkTokens(a.tokens,n));for(const a of l.rows)for(const d of a)t=t.concat(this.walkTokens(d.tokens,n));break}case"list":{const l=s;t=t.concat(this.walkTokens(l.items,n));break}default:{const l=s;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{const d=l[a].flat(1/0);t=t.concat(this.walkTokens(d,n))}):l.tokens&&(t=t.concat(this.walkTokens(l.tokens,n)))}}return t}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(t=>{const i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const s=n.renderers[o.name];s?n.renderers[o.name]=function(...l){let a=o.renderer.apply(this,l);return a===!1&&(a=s.apply(this,l)),a}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=n[o.level];s?s.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),i.extensions=n),t.renderer){const o=this.defaults.renderer||new Ce(this.defaults);for(const s in t.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(s==="options")continue;const l=s,a=t.renderer[l],d=o[l];o[l]=(...h)=>{let m=a.apply(o,h);return m===!1&&(m=d.apply(o,h)),m||""}}i.renderer=o}if(t.tokenizer){const o=this.defaults.tokenizer||new Le(this.defaults);for(const s in t.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const l=s,a=t.tokenizer[l],d=o[l];o[l]=(...h)=>{let m=a.apply(o,h);return m===!1&&(m=d.apply(o,h)),m}}i.tokenizer=o}if(t.hooks){const o=this.defaults.hooks||new ke;for(const s in t.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;const l=s,a=t.hooks[l],d=o[l];ke.passThroughHooks.has(s)?o[l]=h=>{if(this.defaults.async)return Promise.resolve(a.call(o,h)).then(g=>d.call(o,g));const m=a.call(o,h);return d.call(o,m)}:o[l]=(...h)=>{let m=a.apply(o,h);return m===!1&&(m=d.apply(o,h)),m}}i.hooks=o}if(t.walkTokens){const o=this.defaults.walkTokens,s=t.walkTokens;i.walkTokens=function(l){let a=[];return a.push(s.call(this,l)),o&&(a=a.concat(o.call(this,l))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return W.lex(e,n??this.defaults)}parser(e,n){return q.parse(e,n??this.defaults)}}ne=new WeakSet,Et=function(e,n){return(t,i)=>{const o={...i},s={...this.defaults,...o};this.defaults.async===!0&&o.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const l=We(this,ne,An).call(this,!!s.silent,!!s.async);if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then(a=>e(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>n(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(l);try{s.hooks&&(t=s.hooks.preprocess(t));let a=e(t,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let d=n(a,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(a){return l(a)}}},An=function(e,n){return t=>{if(t.message+=`
45
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+F(t.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(t);throw t}};const te=new ri;function x(c,e){return te.parse(c,e)}x.options=x.setOptions=function(c){return te.setOptions(c),x.defaults=te.defaults,yt(x.defaults),x},x.getDefaults=P,x.defaults=ee,x.use=function(...c){return te.use(...c),x.defaults=te.defaults,yt(x.defaults),x},x.walkTokens=function(c,e){return te.walkTokens(c,e)},x.parseInline=te.parseInline,x.Parser=q,x.parser=q.parse,x.Renderer=Ce,x.TextRenderer=Ve,x.Lexer=W,x.lexer=W.lex,x.Tokenizer=Le,x.Hooks=ke,x.parse=x,x.options,x.setOptions,x.use,x.walkTokens,x.parseInline,q.parse,W.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Ut,setPrototypeOf:Ft,isFrozen:oi,getPrototypeOf:li,getOwnPropertyDescriptor:ai}=Object;let{freeze:M,seal:B,create:Ke}=Object,{apply:Je,construct:et}=typeof Reflect<"u"&&Reflect;M||(M=function(e){return e}),B||(B=function(e){return e}),Je||(Je=function(e,n){for(var t=arguments.length,i=new Array(t>2?t-2:0),o=2;o<t;o++)i[o-2]=arguments[o];return e.apply(n,i)}),et||(et=function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];return new e(...t)});const Me=v(Array.prototype.forEach),ci=v(Array.prototype.lastIndexOf),Ht=v(Array.prototype.pop),Te=v(Array.prototype.push),ui=v(Array.prototype.splice),Ne=v(String.prototype.toLowerCase),tt=v(String.prototype.toString),nt=v(String.prototype.match),be=v(String.prototype.replace),pi=v(String.prototype.indexOf),hi=v(String.prototype.trim),G=v(Object.prototype.hasOwnProperty),N=v(RegExp.prototype.test),xe=fi(TypeError);function v(c){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++)t[i-1]=arguments[i];return Je(c,e,t)}}function fi(c){return function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return et(c,n)}}function k(c,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ne;Ft&&Ft(c,null);let t=e.length;for(;t--;){let i=e[t];if(typeof i=="string"){const o=n(i);o!==i&&(oi(e)||(e[t]=o),i=o)}c[i]=!0}return c}function di(c){for(let e=0;e<c.length;e++)G(c,e)||(c[e]=null);return c}function Z(c){const e=Ke(null);for(const[n,t]of Ut(c))G(c,n)&&(Array.isArray(t)?e[n]=di(t):t&&typeof t=="object"&&t.constructor===Object?e[n]=Z(t):e[n]=t);return e}function we(c,e){for(;c!==null;){const t=ai(c,e);if(t){if(t.get)return v(t.get);if(typeof t.value=="function")return v(t.value)}c=li(c)}function n(){return null}return n}const Bt=M(["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"]),it=M(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),st=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"]),gi=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"]),rt=M(["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"]),mi=M(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Gt=M(["#text"]),Wt=M(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","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","slot"]),ot=M(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),qt=M(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ve=M(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ki=B(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ti=B(/<%[\w\W]*|[\w\W]*%>/gm),bi=B(/\$\{[\w\W]*/gm),xi=B(/^data-[\-\w.\u00B7-\uFFFF]+$/),wi=B(/^aria-[\-\w]+$/),Zt=B(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_i=B(/^(?:\w+script|data):/i),Ei=B(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jt=B(/^html$/i),yi=B(/^[a-z][.\w]*(-[.\w]+)+$/i);var Yt=Object.freeze({__proto__:null,ARIA_ATTR:wi,ATTR_WHITESPACE:Ei,CUSTOM_ELEMENT:yi,DATA_ATTR:xi,DOCTYPE_NAME:jt,ERB_EXPR:Ti,IS_ALLOWED_URI:Zt,IS_SCRIPT_OR_DATA:_i,MUSTACHE_EXPR:ki,TMPLIT_EXPR:bi});const _e={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ai=function(){return typeof window>"u"?null:window},Si=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let t=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(t=n.getAttribute(i));const o="dompurify"+(t?"#"+t:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Xt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qt(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ai();const e=f=>Qt(f);if(e.version="3.3.1",e.removed=[],!c||!c.document||c.document.nodeType!==_e.document||!c.Element)return e.isSupported=!1,e;let{document:n}=c;const t=n,i=t.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:d,NamedNodeMap:h=c.NamedNodeMap||c.MozNamedAttrMap,HTMLFormElement:m,DOMParser:g,trustedTypes:T}=c,$=a.prototype,H=we($,"cloneNode"),X=we($,"remove"),Ee=we($,"nextSibling"),ze=we($,"childNodes"),ie=we($,"parentNode");if(typeof s=="function"){const f=n.createElement("template");f.content&&f.content.ownerDocument&&(n=f.content.ownerDocument)}let L,Q="";const{implementation:lt,createNodeIterator:Li,createDocumentFragment:Ii,getElementsByTagName:Oi}=n,{importNode:Di}=t;let z=Xt();e.isSupported=typeof Ut=="function"&&typeof ie=="function"&&lt&&lt.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:at,ERB_EXPR:ct,TMPLIT_EXPR:ut,DATA_ATTR:Ci,ARIA_ATTR:Mi,IS_SCRIPT_OR_DATA:Ni,ATTR_WHITESPACE:Kt,CUSTOM_ELEMENT:vi}=Yt;let{IS_ALLOWED_URI:Jt}=Yt,I=null;const en=k({},[...Bt,...it,...st,...rt,...Gt]);let O=null;const tn=k({},[...Wt,...ot,...qt,...ve]);let A=Object.seal(Ke(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}})),ye=null,pt=null;const oe=Object.seal(Ke(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,ht=!0,sn=!1,rn=!0,le=!1,Pe=!0,se=!1,ft=!1,dt=!1,ae=!1,$e=!1,Ue=!1,on=!0,ln=!1;const zi="user-content-";let gt=!0,Ae=!1,ce={},j=null;const mt=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let an=null;const cn=k({},["audio","video","img","source","image","track"]);let kt=null;const un=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",He="http://www.w3.org/2000/svg",V="http://www.w3.org/1999/xhtml";let ue=V,Tt=!1,bt=null;const Pi=k({},[Fe,He,V],tt);let Be=k({},["mi","mo","mn","ms","mtext"]),Ge=k({},["annotation-xml"]);const $i=k({},["title","style","font","a","script"]);let Se=null;const Ui=["application/xhtml+xml","text/html"],Fi="text/html";let R=null,pe=null;const Hi=n.createElement("form"),pn=function(r){return r instanceof RegExp||r instanceof Function},xt=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pe&&pe===r)){if((!r||typeof r!="object")&&(r={}),r=Z(r),Se=Ui.indexOf(r.PARSER_MEDIA_TYPE)===-1?Fi:r.PARSER_MEDIA_TYPE,R=Se==="application/xhtml+xml"?tt:Ne,I=G(r,"ALLOWED_TAGS")?k({},r.ALLOWED_TAGS,R):en,O=G(r,"ALLOWED_ATTR")?k({},r.ALLOWED_ATTR,R):tn,bt=G(r,"ALLOWED_NAMESPACES")?k({},r.ALLOWED_NAMESPACES,tt):Pi,kt=G(r,"ADD_URI_SAFE_ATTR")?k(Z(un),r.ADD_URI_SAFE_ATTR,R):un,an=G(r,"ADD_DATA_URI_TAGS")?k(Z(cn),r.ADD_DATA_URI_TAGS,R):cn,j=G(r,"FORBID_CONTENTS")?k({},r.FORBID_CONTENTS,R):mt,ye=G(r,"FORBID_TAGS")?k({},r.FORBID_TAGS,R):Z({}),pt=G(r,"FORBID_ATTR")?k({},r.FORBID_ATTR,R):Z({}),ce=G(r,"USE_PROFILES")?r.USE_PROFILES:!1,nn=r.ALLOW_ARIA_ATTR!==!1,ht=r.ALLOW_DATA_ATTR!==!1,sn=r.ALLOW_UNKNOWN_PROTOCOLS||!1,rn=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=r.SAFE_FOR_TEMPLATES||!1,Pe=r.SAFE_FOR_XML!==!1,se=r.WHOLE_DOCUMENT||!1,ae=r.RETURN_DOM||!1,$e=r.RETURN_DOM_FRAGMENT||!1,Ue=r.RETURN_TRUSTED_TYPE||!1,dt=r.FORCE_BODY||!1,on=r.SANITIZE_DOM!==!1,ln=r.SANITIZE_NAMED_PROPS||!1,gt=r.KEEP_CONTENT!==!1,Ae=r.IN_PLACE||!1,Jt=r.ALLOWED_URI_REGEXP||Zt,ue=r.NAMESPACE||V,Be=r.MATHML_TEXT_INTEGRATION_POINTS||Be,Ge=r.HTML_INTEGRATION_POINTS||Ge,A=r.CUSTOM_ELEMENT_HANDLING||{},r.CUSTOM_ELEMENT_HANDLING&&pn(r.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(A.tagNameCheck=r.CUSTOM_ELEMENT_HANDLING.tagNameCheck),r.CUSTOM_ELEMENT_HANDLING&&pn(r.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(A.attributeNameCheck=r.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),r.CUSTOM_ELEMENT_HANDLING&&typeof r.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=r.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),le&&(ht=!1),$e&&(ae=!0),ce&&(I=k({},Gt),O=[],ce.html===!0&&(k(I,Bt),k(O,Wt)),ce.svg===!0&&(k(I,it),k(O,ot),k(O,ve)),ce.svgFilters===!0&&(k(I,st),k(O,ot),k(O,ve)),ce.mathMl===!0&&(k(I,rt),k(O,qt),k(O,ve))),r.ADD_TAGS&&(typeof r.ADD_TAGS=="function"?oe.tagCheck=r.ADD_TAGS:(I===en&&(I=Z(I)),k(I,r.ADD_TAGS,R))),r.ADD_ATTR&&(typeof r.ADD_ATTR=="function"?oe.attributeCheck=r.ADD_ATTR:(O===tn&&(O=Z(O)),k(O,r.ADD_ATTR,R))),r.ADD_URI_SAFE_ATTR&&k(kt,r.ADD_URI_SAFE_ATTR,R),r.FORBID_CONTENTS&&(j===mt&&(j=Z(j)),k(j,r.FORBID_CONTENTS,R)),r.ADD_FORBID_CONTENTS&&(j===mt&&(j=Z(j)),k(j,r.ADD_FORBID_CONTENTS,R)),gt&&(I["#text"]=!0),se&&k(I,["html","head","body"]),I.table&&(k(I,["tbody"]),delete ye.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=r.TRUSTED_TYPES_POLICY,Q=L.createHTML("")}else L===void 0&&(L=Si(T,i)),L!==null&&typeof Q=="string"&&(Q=L.createHTML(""));M&&M(r),pe=r}},hn=k({},[...it,...st,...gi]),fn=k({},[...rt,...mi]),Bi=function(r){let u=ie(r);(!u||!u.tagName)&&(u={namespaceURI:ue,tagName:"template"});const p=Ne(r.tagName),_=Ne(u.tagName);return bt[r.namespaceURI]?r.namespaceURI===He?u.namespaceURI===V?p==="svg":u.namespaceURI===Fe?p==="svg"&&(_==="annotation-xml"||Be[_]):!!hn[p]:r.namespaceURI===Fe?u.namespaceURI===V?p==="math":u.namespaceURI===He?p==="math"&&Ge[_]:!!fn[p]:r.namespaceURI===V?u.namespaceURI===He&&!Ge[_]||u.namespaceURI===Fe&&!Be[_]?!1:!fn[p]&&($i[p]||!hn[p]):!!(Se==="application/xhtml+xml"&&bt[r.namespaceURI]):!1},Y=function(r){Te(e.removed,{element:r});try{ie(r).removeChild(r)}catch{X(r)}},re=function(r,u){try{Te(e.removed,{attribute:u.getAttributeNode(r),from:u})}catch{Te(e.removed,{attribute:null,from:u})}if(u.removeAttribute(r),r==="is")if(ae||$e)try{Y(u)}catch{}else try{u.setAttribute(r,"")}catch{}},dn=function(r){let u=null,p=null;if(dt)r="<remove></remove>"+r;else{const S=nt(r,/^[\r\n\t ]+/);p=S&&S[0]}Se==="application/xhtml+xml"&&ue===V&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");const _=L?L.createHTML(r):r;if(ue===V)try{u=new g().parseFromString(_,Se)}catch{}if(!u||!u.documentElement){u=lt.createDocument(ue,"template",null);try{u.documentElement.innerHTML=Tt?Q:_}catch{}}const C=u.body||u.documentElement;return r&&p&&C.insertBefore(n.createTextNode(p),C.childNodes[0]||null),ue===V?Oi.call(u,se?"html":"body")[0]:se?u.documentElement:C},gn=function(r){return Li.call(r.ownerDocument||r,r,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},wt=function(r){return r instanceof m&&(typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||!(r.attributes instanceof h)||typeof r.removeAttribute!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function")},mn=function(r){return typeof l=="function"&&r instanceof l};function K(f,r,u){Me(f,p=>{p.call(e,r,u,pe)})}const kn=function(r){let u=null;if(K(z.beforeSanitizeElements,r,null),wt(r))return Y(r),!0;const p=R(r.nodeName);if(K(z.uponSanitizeElement,r,{tagName:p,allowedTags:I}),Pe&&r.hasChildNodes()&&!mn(r.firstElementChild)&&N(/<[/\w!]/g,r.innerHTML)&&N(/<[/\w!]/g,r.textContent)||r.nodeType===_e.progressingInstruction||Pe&&r.nodeType===_e.comment&&N(/<[/\w]/g,r.data))return Y(r),!0;if(!(oe.tagCheck instanceof Function&&oe.tagCheck(p))&&(!I[p]||ye[p])){if(!ye[p]&&bn(p)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,p)||A.tagNameCheck instanceof Function&&A.tagNameCheck(p)))return!1;if(gt&&!j[p]){const _=ie(r)||r.parentNode,C=ze(r)||r.childNodes;if(C&&_){const S=C.length;for(let U=S-1;U>=0;--U){const J=H(C[U],!0);J.__removalCount=(r.__removalCount||0)+1,_.insertBefore(J,Ee(r))}}}return Y(r),!0}return r instanceof a&&!Bi(r)||(p==="noscript"||p==="noembed"||p==="noframes")&&N(/<\/no(script|embed|frames)/i,r.innerHTML)?(Y(r),!0):(le&&r.nodeType===_e.text&&(u=r.textContent,Me([at,ct,ut],_=>{u=be(u,_," ")}),r.textContent!==u&&(Te(e.removed,{element:r.cloneNode()}),r.textContent=u)),K(z.afterSanitizeElements,r,null),!1)},Tn=function(r,u,p){if(on&&(u==="id"||u==="name")&&(p in n||p in Hi))return!1;if(!(ht&&!pt[u]&&N(Ci,u))){if(!(nn&&N(Mi,u))){if(!(oe.attributeCheck instanceof Function&&oe.attributeCheck(u,r))){if(!O[u]||pt[u]){if(!(bn(r)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,r)||A.tagNameCheck instanceof Function&&A.tagNameCheck(r))&&(A.attributeNameCheck instanceof RegExp&&N(A.attributeNameCheck,u)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(u,r))||u==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,p)||A.tagNameCheck instanceof Function&&A.tagNameCheck(p))))return!1}else if(!kt[u]){if(!N(Jt,be(p,Kt,""))){if(!((u==="src"||u==="xlink:href"||u==="href")&&r!=="script"&&pi(p,"data:")===0&&an[r])){if(!(sn&&!N(Ni,be(p,Kt,"")))){if(p)return!1}}}}}}}return!0},bn=function(r){return r!=="annotation-xml"&&nt(r,vi)},xn=function(r){K(z.beforeSanitizeAttributes,r,null);const{attributes:u}=r;if(!u||wt(r))return;const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let _=u.length;for(;_--;){const C=u[_],{name:S,namespaceURI:U,value:J}=C,he=R(S),_t=J;let D=S==="value"?_t:hi(_t);if(p.attrName=he,p.attrValue=D,p.keepAttr=!0,p.forceKeepAttr=void 0,K(z.uponSanitizeAttribute,r,p),D=p.attrValue,ln&&(he==="id"||he==="name")&&(re(S,r),D=zi+D),Pe&&N(/((--!?|])>)|<\/(style|title|textarea)/i,D)){re(S,r);continue}if(he==="attributename"&&nt(D,"href")){re(S,r);continue}if(p.forceKeepAttr)continue;if(!p.keepAttr){re(S,r);continue}if(!rn&&N(/\/>/i,D)){re(S,r);continue}le&&Me([at,ct,ut],_n=>{D=be(D,_n," ")});const wn=R(r.nodeName);if(!Tn(wn,he,D)){re(S,r);continue}if(L&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!U)switch(T.getAttributeType(wn,he)){case"TrustedHTML":{D=L.createHTML(D);break}case"TrustedScriptURL":{D=L.createScriptURL(D);break}}if(D!==_t)try{U?r.setAttributeNS(U,S,D):r.setAttribute(S,D),wt(r)?Y(r):Ht(e.removed)}catch{re(S,r)}}K(z.afterSanitizeAttributes,r,null)},Gi=function f(r){let u=null;const p=gn(r);for(K(z.beforeSanitizeShadowDOM,r,null);u=p.nextNode();)K(z.uponSanitizeShadowNode,u,null),kn(u),xn(u),u.content instanceof o&&f(u.content);K(z.afterSanitizeShadowDOM,r,null)};return e.sanitize=function(f){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=null,p=null,_=null,C=null;if(Tt=!f,Tt&&(f="<!-->"),typeof f!="string"&&!mn(f))if(typeof f.toString=="function"){if(f=f.toString(),typeof f!="string")throw xe("dirty is not a string, aborting")}else throw xe("toString is not a function");if(!e.isSupported)return f;if(ft||xt(r),e.removed=[],typeof f=="string"&&(Ae=!1),Ae){if(f.nodeName){const J=R(f.nodeName);if(!I[J]||ye[J])throw xe("root node is forbidden and cannot be sanitized in-place")}}else if(f instanceof l)u=dn("<!---->"),p=u.ownerDocument.importNode(f,!0),p.nodeType===_e.element&&p.nodeName==="BODY"||p.nodeName==="HTML"?u=p:u.appendChild(p);else{if(!ae&&!le&&!se&&f.indexOf("<")===-1)return L&&Ue?L.createHTML(f):f;if(u=dn(f),!u)return ae?null:Ue?Q:""}u&&dt&&Y(u.firstChild);const S=gn(Ae?f:u);for(;_=S.nextNode();)kn(_),xn(_),_.content instanceof o&&Gi(_.content);if(Ae)return f;if(ae){if($e)for(C=Ii.call(u.ownerDocument);u.firstChild;)C.appendChild(u.firstChild);else C=u;return(O.shadowroot||O.shadowrootmode)&&(C=Di.call(t,C,!0)),C}let U=se?u.outerHTML:u.innerHTML;return se&&I["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&N(jt,u.ownerDocument.doctype.name)&&(U="<!DOCTYPE "+u.ownerDocument.doctype.name+`>
46
+ `+U),le&&Me([at,ct,ut],J=>{U=be(U,J," ")}),L&&Ue?L.createHTML(U):U},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xt(f),ft=!0},e.clearConfig=function(){pe=null,ft=!1},e.isValidAttribute=function(f,r,u){pe||xt({});const p=R(f),_=R(r);return Tn(p,_,u)},e.addHook=function(f,r){typeof r=="function"&&Te(z[f],r)},e.removeHook=function(f,r){if(r!==void 0){const u=ci(z[f],r);return u===-1?void 0:ui(z[f],u,1)[0]}return Ht(z[f])},e.removeHooks=function(f){z[f]=[]},e.removeAllHooks=function(){z=Xt()},e}var Ri=Qt();class Vt{constructor(e){b(this,"container");b(this,"box");b(this,"messagesDiv");b(this,"input");b(this,"sendBtn");b(this,"isOpen",!1);b(this,"history",[]);b(this,"config");this.config={title:"企业智能助手",welcomeMessage:"您好,有什么可以帮您?",provider:"google",...e},this.initDOM()}initDOM(){this.container=document.createElement("div"),this.container.className="lee-ai-container";const e=document.createElement("div");e.className="lee-ai-launcher",e.innerHTML='<svg viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"></path></svg>',e.onclick=()=>this.toggle(),this.box=document.createElement("div"),this.box.className="lee-ai-box",this.box.innerHTML=`
47
47
  <div class="lee-ai-header">
48
48
  <span>${this.config.title}</span>
49
49
  <span style="cursor:pointer;font-size:20px" id="lee-ai-close">×</span>
@@ -55,4 +55,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An err
55
55
  <input type="text" class="lee-ai-input" placeholder="输入您的问题..." />
56
56
  <button class="lee-ai-send-btn">发送</button>
57
57
  </div>
58
- `,this.container.appendChild(this.box),this.container.appendChild(e),document.body.appendChild(this.container),this.messagesDiv=this.box.querySelector(".lee-ai-messages"),this.input=this.box.querySelector(".lee-ai-input"),this.sendBtn=this.box.querySelector(".lee-ai-send-btn");const n=this.box.querySelector("#lee-ai-close");n.onclick=()=>this.toggle(!1),this.sendBtn.onclick=()=>this.sendMessage(),this.input.onkeypress=t=>{t.key==="Enter"&&this.sendMessage()}}toggle(e){this.isOpen=e??!this.isOpen,this.box.classList.toggle("open",this.isOpen),this.isOpen&&setTimeout(()=>this.input.focus(),100)}async sendMessage(){const e=this.input.value.trim();if(!e)return;this.input.value="",this.appendMessage(e,"user"),this.setLoading(!0);const n=this.appendMessage("","model");let t="";await y(this.config,this.history,e,r=>{t+=r,n.innerHTML=Ri.sanitize(x.parse(t)),this.scrollToBottom()},()=>{this.setLoading(!1),this.history.push({role:"user",parts:[{text:e}]}),this.history.push({role:"model",parts:[{text:t}]})},r=>{n.innerHTML=`<span style="color:red">错误: ${r}</span>`,this.setLoading(!1)})}appendMessage(e,n){const t=document.createElement("div");return t.className=`lee-ai-msg ${n}`,n==="user"?t.innerText=e:t.innerHTML=e,this.messagesDiv.appendChild(t),this.scrollToBottom(),t}scrollToBottom(){this.messagesDiv.scrollTop=this.messagesDiv.scrollHeight}setLoading(e){this.sendBtn.disabled=e,this.sendBtn.innerText=e?"...":"发送",this.input.disabled=e}}window.LeeAI={init:c=>new Vt(c)},E.Widget=Vt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
58
+ `,this.container.appendChild(this.box),this.container.appendChild(e),document.body.appendChild(this.container),this.messagesDiv=this.box.querySelector(".lee-ai-messages"),this.input=this.box.querySelector(".lee-ai-input"),this.sendBtn=this.box.querySelector(".lee-ai-send-btn");const n=this.box.querySelector("#lee-ai-close");n.onclick=()=>this.toggle(!1),this.sendBtn.onclick=()=>this.sendMessage(),this.input.onkeypress=t=>{t.key==="Enter"&&this.sendMessage()}}toggle(e){this.isOpen=e??!this.isOpen,this.box.classList.toggle("open",this.isOpen),this.isOpen&&setTimeout(()=>this.input.focus(),100)}async sendMessage(){const e=this.input.value.trim();if(!e)return;this.input.value="",this.appendMessage(e,"user"),this.setLoading(!0);const t=this.appendMessage(`
59
+ <div class="lee-ai-typing">
60
+ <div class="lee-ai-dot"></div>
61
+ <div class="lee-ai-dot"></div>
62
+ <div class="lee-ai-dot"></div>
63
+ </div>
64
+ `,"model",!0);let i="",o=!0;await y(this.config,this.history,e,s=>{o&&(t.innerHTML="",o=!1),i+=s,t.innerHTML=Ri.sanitize(x.parse(i)),this.scrollToBottom()},()=>{this.setLoading(!1),this.history.push({role:"user",parts:[{text:e}]}),this.history.push({role:"model",parts:[{text:i}]}),i===""&&(t.innerHTML="(无内容)")},s=>{t.innerHTML=`<span style="color:#ff6b6b">系统错误: ${s}</span>`,this.setLoading(!1)})}appendMessage(e,n,t=!1){const i=document.createElement("div");return i.className=`lee-ai-msg ${n}`,n==="user"?i.innerText=e:t?i.innerHTML=e:i.innerText=e,this.messagesDiv.appendChild(i),this.scrollToBottom(),i}scrollToBottom(){this.messagesDiv.scrollTo({top:this.messagesDiv.scrollHeight,behavior:"smooth"})}setLoading(e){this.sendBtn.disabled=e,this.sendBtn.style.opacity=e?"0.6":"1",this.sendBtn.style.cursor=e?"not-allowed":"pointer",this.input.disabled=e,e||setTimeout(()=>this.input.focus(),100)}}window.LeeAI={init:c=>new Vt(c)},E.Widget=Vt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- :root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}#app{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.vanilla:hover{filter:drop-shadow(0 0 2em #3178c6aa)}.card{padding:2em}.read-the-docs{color:#888}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.lee-ai-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;position:fixed;bottom:20px;right:20px;z-index:99999;line-height:1.5}.lee-ai-launcher{width:60px;height:60px;background:linear-gradient(135deg,#2563eb,#1d4ed8);border-radius:50%;box-shadow:0 4px 14px #00000026;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .2s;color:#fff}.lee-ai-launcher:hover{transform:scale(1.05)}.lee-ai-launcher svg{width:30px;height:30px;fill:#fff}.lee-ai-box{position:absolute;bottom:80px;right:0;width:380px;height:600px;max-height:80vh;background:#fff;border-radius:16px;box-shadow:0 8px 30px #0000001f;display:flex;flex-direction:column;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:all .3s ease;border:1px solid #e5e7eb}.lee-ai-box.open{opacity:1;pointer-events:auto;transform:translateY(0)}.lee-ai-header{background:#2563eb;color:#fff;padding:16px;font-weight:600;display:flex;justify-content:space-between;align-items:center}.lee-ai-messages{flex:1;padding:16px;overflow-y:auto;background:#f8fafc;display:flex;flex-direction:column;gap:12px}.lee-ai-msg{max-width:85%;padding:10px 14px;border-radius:12px;font-size:14px;word-wrap:break-word}.lee-ai-msg.user{background:#2563eb;color:#fff;align-self:flex-end;border-bottom-right-radius:2px}.lee-ai-msg.model{background:#fff;border:1px solid #e2e8f0;align-self:flex-start;border-bottom-left-radius:2px;color:#1f2937}.lee-ai-msg.model code{background:#f1f5f9;padding:2px 4px;border-radius:4px;font-family:monospace}.lee-ai-msg.model pre{background:#1e293b;color:#e2e8f0;padding:10px;border-radius:8px;overflow-x:auto}.lee-ai-input-area{padding:12px;border-top:1px solid #e5e7eb;background:#fff;display:flex;gap:8px}.lee-ai-input{flex:1;padding:10px;border:1px solid #e2e8f0;border-radius:8px;outline:none;font-size:14px}.lee-ai-input:focus{border-color:#2563eb}.lee-ai-send-btn{background:#2563eb;color:#fff;border:none;padding:0 16px;border-radius:8px;cursor:pointer;font-weight:500}.lee-ai-send-btn:disabled{background:#94a3b8;cursor:not-allowed}
1
+ .lee-ai-container{font-family:SF Pro Text,Inter,-apple-system,BlinkMacSystemFont,Roboto,sans-serif;position:fixed;bottom:25px;right:25px;z-index:99999;line-height:1.6;box-sizing:border-box;color:#1a1a1a;text-align:left;-webkit-font-smoothing:antialiased}.lee-ai-container *{box-sizing:border-box}.lee-ai-launcher{width:60px;height:60px;background:#fff;box-shadow:0 4px 6px -1px #0000000d,0 10px 25px -5px #0000001a;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .3s cubic-bezier(.34,1.56,.64,1);border:1px solid rgba(0,0,0,.03)}.lee-ai-launcher:hover{transform:scale(1.08) translateY(-2px);box-shadow:0 8px 12px -1px #00000014,0 20px 35px -5px #0000001f}.lee-ai-launcher svg{width:28px;height:28px;fill:#1a1a1a}.lee-ai-box{position:absolute;bottom:85px;right:0;width:380px;height:650px;max-height:80vh;background:#ffffffd9;backdrop-filter:blur(25px) saturate(180%);-webkit-backdrop-filter:blur(25px) saturate(180%);border-radius:24px;box-shadow:0 20px 40px #00000014,0 0 0 1px #00000008;display:flex;flex-direction:column;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px) scale(.96);transition:all .3s cubic-bezier(.2,.8,.2,1)}.lee-ai-box.open{opacity:1;pointer-events:auto;transform:translateY(0) scale(1)}.lee-ai-header{background:#ffffff80;color:#1a1a1a;padding:18px 24px;font-weight:600;font-size:16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid rgba(0,0,0,.05)}#lee-ai-close{cursor:pointer;font-size:22px;color:#999;transition:color .2s}#lee-ai-close:hover{color:#1a1a1a}.lee-ai-messages{flex:1;padding:24px;overflow-y:auto;background:transparent;display:flex;flex-direction:column;gap:20px;font-size:14px}.lee-ai-messages::-webkit-scrollbar{width:5px}.lee-ai-messages::-webkit-scrollbar-track{background:transparent}.lee-ai-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:10px}.lee-ai-msg{max-width:88%;padding:14px 18px;border-radius:18px;word-wrap:break-word;line-height:1.6;font-size:14px;position:relative;letter-spacing:.2px}.lee-ai-msg.user{background:#1a1a1a;color:#fff;align-self:flex-end;border-bottom-right-radius:4px;box-shadow:0 4px 12px #0000001a}.lee-ai-msg.model{background:#f3f4f6;color:#1f2937;align-self:flex-start;border-bottom-left-radius:4px;border:1px solid rgba(0,0,0,.03)}.lee-ai-msg.model p{margin:0 0 10px}.lee-ai-msg.model strong{color:#000;font-weight:700}.lee-ai-msg.model ul,.lee-ai-msg.model ol{padding-left:20px;margin:10px 0;color:#4b5563}.lee-ai-msg.model code{background:#e5e7eb;padding:2px 6px;border-radius:4px;font-family:SF Mono,Consolas,monospace;color:#d63384;font-size:.9em}.lee-ai-msg.model pre{background:#1f2937;color:#e5e7eb;padding:16px;border-radius:12px;overflow-x:auto;margin:12px 0}.lee-ai-msg.model pre code{background:transparent;color:inherit;padding:0}.lee-ai-input-area{padding:16px 20px 20px;border-top:1px solid rgba(0,0,0,.05);background:#fff9;display:flex;gap:12px;align-items:center}.lee-ai-input{flex:1;padding:12px 16px;background:#fff;border:1px solid #e5e7eb;border-radius:14px;outline:none;font-size:14px;color:#1a1a1a;transition:all .2s;box-shadow:0 2px 5px #00000005}.lee-ai-input:focus{border-color:#9ca3af;box-shadow:0 4px 12px #0000000d;transform:translateY(-1px)}.lee-ai-send-btn{background:#1a1a1a;color:#fff;border:none;padding:12px 20px;border-radius:12px;cursor:pointer;font-weight:600;font-size:14px;transition:all .2s}.lee-ai-send-btn:hover{background:#333;transform:translateY(-1px);box-shadow:0 4px 10px #00000026}.lee-ai-send-btn:active{transform:translateY(1px)}.lee-ai-send-btn:disabled{background:#d1d5db;color:#f3f4f6;cursor:not-allowed}.lee-ai-typing{display:flex;align-items:center;gap:5px;padding:6px 4px;height:24px}.lee-ai-dot{width:5px;height:5px;background-color:#9ca3af;border-radius:50%;animation:lee-ai-pulse-light 1.4s infinite ease-in-out both}.lee-ai-dot:nth-child(1){animation-delay:-.32s}.lee-ai-dot:nth-child(2){animation-delay:-.16s}.lee-ai-dot:nth-child(3){animation-delay:0s}@keyframes lee-ai-pulse-light{0%,80%,to{transform:scale(.8);background-color:#9ca3af}40%{transform:scale(1.2);background-color:#1a1a1a}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lee-ai-widget",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Enterprise AI Agent Widget",
5
5
  "files": [
6
6
  "dist"