compaction de contexte, filtre/pagination/suppression des conversations

- compaction automatique du contexte LLM quand la taille atteint le seuil
  (contexte max - taille de réponse max), par résumé de l'historique ancien
- filtre textuel (?q=) et pagination (20/page) de l'historique des conversations
- correctif ORM : offset de pagination en base 0
- suppression d'une conversation : messages associés supprimés, session en
  cours annulée, popup de confirmation (ConfirmDialog)
- titres de conversation nettoyés du markdown
- styles des listes markdown, variante danger du bouton
- go.mod/go.sum : dépendances go-rod et stealth manquantes du commit précédent
This commit is contained in:
fabien committed 2026-10-05 23:46:12 +02:00
1 parent a970bfa991
commit 51bbb45b32
86 files changed
+770 -113

No files matched your search

@@ -0,0 +1,72 @@
import{$ as e,A as t,B as n,E as r,F as i,G as a,H as o,K as s,M as c,N as l,O as u,Q as d,R as f,S as p,T as m,U as h,Z as g,_,_t as v,a as y,at as b,b as x,bt as S,c as C,d as w,dt as ee,et as te,f as T,ft as ne,it as E,j as D,k as O,lt as k,m as A,nt as j,o as re,p as ie,pt as ae,q as M,r as N,s as P,st as oe,u as se,ut as ce,v as le,vt as F,w as I,y as ue,yt as L,z as R}from"../chunks/DGrvnoUE.js";import"../chunks/xihTtKlq.js";import{t as de}from"../chunks/5WAfNqs_.js";import{t as fe}from"../chunks/BYWIgY43.js";import{t as pe}from"../chunks/guSkOB4x.js";import"../chunks/B6JECYQD.js";var me=S({load:()=>he}),he=async({params:e})=>{let t=await pe.getChat(e.space,e.conversation);return{title:t.chat.title,spaceId:e.space,chatId:e.conversation,chatWithMessage:t}},ge=l(`<a><!></a>`);function _e(e,t){var n=ge();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var ve=l(`<abbr><!></abbr>`);function ye(e,t){var n=ve();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var be=l(`<address><!></address>`);function xe(e,t){var n=be();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Se=l(`<article><!></article>`);function Ce(e,t){var n=Se();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var we=l(`<aside><!></aside>`);function Te(e,t){var n=we();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Ee=l(`<audio><!></audio>`);function De(e,t){var n=Ee();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Oe=l(`<b><!></b>`);function ke(e,t){var n=Oe();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Ae=l(`<bdi><!></bdi>`);function je(e,t){var n=Ae();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Me=l(`<bdo><!></bdo>`);function Ne(e,t){var n=Me();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Pe=l(`<blockquote><!></blockquote>`);function Fe(e,t){var n=Pe();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Ie=l(`<br/>`);function Le(e,t){let n=y(t,`attributes`,19,()=>({}));var r=Ie();T(r,()=>({...n()})),D(e,r)}var Re=l(`<button><!></button>`);function ze(e,t){var n=Re();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Be=l(`<canvas><!></canvas>`);function Ve(e,t){var n=Be();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var He=l(`<cite><!></cite>`);function Ue(e,t){var n=He();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var We=l(`<code><!></code>`);function Ge(e,t){var n=We();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Ke=l(`<datalist><!></datalist>`);function qe(e,t){var n=Ke();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Je=l(`<dd><!></dd>`);function Ye(e,t){var n=Je();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Xe=l(`<del><!></del>`);function Ze(e,t){var n=Xe();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Qe=l(`<details><!></details>`);function $e(e,t){var n=Qe();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var et=l(`<dfn><!></dfn>`);function tt(e,t){var n=et();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var nt=l(`<dialog><!></dialog>`);function rt(e,t){var n=nt();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var it=l(`<div><!></div>`);function at(e,t){var n=it();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var ot=l(`<dl><!></dl>`);function st(e,t){var n=ot();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var ct=l(`<dt><!></dt>`);function lt(e,t){var n=ct();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var ut=l(`<em><!></em>`);function dt(e,t){var n=ut();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var ft=l(`<embed/>`);function pt(e,t){var n=ft();T(n,()=>({...t.attributes})),R(n),D(e,n)}var mt=l(`<fieldset><!></fieldset>`);function ht(e,t){var n=mt();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var gt=l(`<footer><!></footer>`);function _t(e,t){var n=gt();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var vt=l(`<form><!></form>`);function yt(e,t){var n=vt();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var bt=l(`<h1><!></h1>`);function xt(e,t){var n=bt();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var St=l(`<h2><!></h2>`);function Ct(e,t){var n=St();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var wt=l(`<h3><!></h3>`);function Tt(e,t){var n=wt();T(n,()=>({...t.attributes}));var r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Et=l(`<h4><!></h4>`);function Dt(e,t){var n=Et();T(nLine truncated
]`).replace(`lheading`,Wr).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},si=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ci=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,li=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ui=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,di=/[\p{P}\p{S}]/u,fi=/[\s\p{P}\p{S}]/u,pi=/[^\s\p{P}\p{S}]/u,mi=z(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,fi).getRegex(),hi=/[\p{Pi}\p{Ps}"']/u,gi=/(?!~)[\p{P}\p{S}]/u,_i=/(?!~)[\s\p{P}\p{S}]/u,vi=/(?:[^\s\p{P}\p{S}]|~)/u,yi=z(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ir?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),bi=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,xi=z(bi,`u`).replace(/punct/g,di).getRegex(),Si=z(bi,`u`).replace(/punct/g,gi).getRegex(),Ci=z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,hi).replace(/punct/g,di).getRegex(),wi=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Ti=z(wi,`gu`).replace(/notPunctSpace/g,pi).replace(/punctSpace/g,fi).replace(/punct/g,di).getRegex(),Ei=z(wi,`gu`).replace(/notPunctSpace/g,vi).replace(/punctSpace/g,_i).replace(/punct/g,gi).getRegex(),Di=z(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,pi).replace(/punctSpace/g,fi).replace(/punct/g,di).getRegex(),Oi=z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,pi).replace(/punctSpace/g,fi).replace(/punct/g,di).getRegex(),ki=z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,pi).replace(/punctSpace/g,fi).replace(/punct/g,di).getRegex(),Ai=z(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,di).getRegex(),ji=z(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,pi).replace(/punctSpace/g,fi).replace(/punct/g,di).getRegex(),Mi=z(/\\(punct)/,`gu`).replace(/punct/g,di).getRegex(),Ni=z(/^<(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(),Pi=z(Qr).replace(`(?:-->|$)`,`-->`).getRegex(),Fi=z(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Pi).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ii=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Li=z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Ii).getRegex(),Ri=z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Li).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zi=z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Li).replace(`ref`,Jr).getRegex(),Bi=z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Jr).getRegex(),Vi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Hi=z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Ii).getRegex(),Ui=z(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Hi).replace(`ref`,Vi).getRegex()).replace(`nolink`,z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Vi).getRegex()).getRegex(),Wi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gi=z(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Ki={_backpedal:Pr,anyPunctLine truncated
`),n=t.length-1;for(;n>=0&&B.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
`)}function aa(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function oa(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function sa(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ca(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function la(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
`)}function ua(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var da=class{options;rules;lexer;constructor(e){this.options=e||Mr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:ia(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=la(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ra(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:ra(t[0],`
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ra(t[0],`
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ra(t[0],`
`).split(`
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
${s}`:s,r=r?`${r}
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
`),o=t.raw+`
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
`).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
${d.join(`
`)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
`+e.join(`
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
`,1)[0],l=t[1].length,u=this.options.pedantic?sa(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>sa(e,l)),d=e.split(`
`,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
`,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
`,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
`+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
`+d}f=!d.trim(),r+=l+`
`,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=ia(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=aa(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:ra(t[0],`
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=na(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
`):[],a={type:`table`,raw:ra(t[0],`
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(na(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:ra(t[0],`
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&ua(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=ra(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=oa(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),ca(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&ua(e,n[1],r,this.rules))return;let i=t[aa((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ca(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:ea(t[0]),escaped:e}}}},H=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Mr,this.options.tokenizer=this.options.tokenizer||new da,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inR Line truncated
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(B.tabCharGlobal,` `).replace(B.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+i.raw,n.text+=`
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+i.raw,n.text+=`
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
`)?``:`
`)+i.raw,r.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+i.raw,n.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(!(e.charAt(0)===`!`||!Object.hasOwn(this.tokens.links,aa(e.slice(n+1,-1))))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,aa(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},fa=class{options;parser;constructor(e){this.options=e||Mr}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(B.notSpaceStart)?.[0],i=e?e.replace(B.endingNewline,``)+`
`:``;return r?`<pre><code class="language-`+V(r)+`">`+(n?i:V(i,!0))+`</code></pre>
`:`<pre><code>`+(n?i:V(i,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
`+r+`</`+i+`>
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
<thead>
`+t+`</thead>
`+r+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${V(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?V(n,!0):this.parser.parseInline(r),o=ta(e);if(o===null)return a;e=V(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+V(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ta(e);if(i===null)return V(n);e=i;let a=`<img src="${V(e)}" alt="${V(n)}"`;return t&&(a+=` title="${V(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:V(e.text)}},pa=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},U=class e{options;renderer;textRenderer;constructor(e){this.options=e||Mr,this.options.renderer=this.options.renderer||new fa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new pa}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ma=class{options;block;constructor(e){this.options=e||Mr}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?H.lex:H.lexInline}provideParser(e=this.block){return e?U.parse:U.parseInline}},ha=class{defaults=jr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=U;Renderer=fa;TextRenderer=pa;Lexer=H;Tokenizer=da;Hooks=ma;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`Line truncated
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+V(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},ga=new ha;function W(e,t){return ga.parse(e,t)}W.options=W.setOptions=function(e){return ga.setOptions(e),W.defaults=ga.defaults,Nr(W.defaults),W},W.getDefaults=jr,W.defaults=Mr;function _a(...e){return ga.use(...e),W.defaults=ga.defaults,Nr(W.defaults),W}W.use=_a,W.walkTokens=function(e,t){return ga.walkTokens(e,t)},W.parseInline=ga.parseInline,W.Parser=U,W.parser=U.parse,W.Renderer=fa,W.TextRenderer=pa,W.Lexer=H,W.lexer=H.lex,W.Tokenizer=da,W.Hooks=ma,W.parse=W,W.options,W.setOptions,W.walkTokens,W.parseInline,U.parse,H.lex;var va=l(`<blockquote><!></blockquote>`);function ya(e,t){var n=va(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var ba=l(`<br/>`);function xa(e){var t=ba();D(e,t)}var Sa=l(`<pre><code> </code></pre>`);function Ca(e,n){var r=Sa(),i=g(r),a=g(i,!0);F(i),F(r),s(()=>{le(r,1,ue(n.lang)),t(a,n.text)}),D(e,r)}var wa=l(`<code> </code>`);function Ta(e,n){ne(n,!0);var r=wa(),i=g(r,!0);F(r),s(e=>t(i,e),[()=>n.raw.replace(/`/g,``)]),D(e,r),ee()}var Ea=l(`<del><!></del>`);function Da(e,t){var n=Ea(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Oa=l(`<em><!></em>`);function ka(e,t){var n=Oa(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}function Aa(e,n){v();var r=i();s(()=>t(r,n.text)),D(e,r)}var ja=l(`<h1><!></h1>`),Ma=l(`<h2><!></h2>`),Na=l(`<h3><!></h3>`),Pa=l(`<h4><!></h4>`),Fa=l(`<h5><!></h5>`),Ia=l(`<h6><!></h6>`);function La(e,r){ne(r,!0);let a=y(r,`id`,3,void 0),o=b(()=>r.options.headerIds?a()??`${r.options.headerPrefix}${r.slug(r.text)}`:void 0);var l=c(),u=d(l),f=e=>{var t=ja(),i=g(t);m(i,()=>r.children??L),F(t),s(()=>A(t,`id`,n(o))),D(e,t)},p=e=>{var t=Ma(),i=g(t);m(i,()=>r.children??L),F(t),s(()=>A(t,`id`,n(o))),D(e,t)},h=e=>{var t=Na(),i=g(t);m(i,()=>r.children??L),F(t),s(()=>A(t,`id`,n(o))),D(e,t)},_=e=>{var t=Pa(),i=g(t);m(i,()=>r.children??L),F(t),s(()=>A(t,`id`,n(o))),D(e,t)},v=e=>{var t=Fa(),i=g(t);m(i,()=>r.children??L),F(t),s(()=>A(t,`id`,n(o))),D(e,t)},x=e=>{var t=Ia(),i=g(t);m(i,()=>r.children??L),F(t),s(()=>A(t,`id`,n(o))),D(e,t)},S=e=>{var n=i();s(()=>t(n,r.raw)),D(e,n)};O(u,e=>{r.depth===1?e(f):r.depth===2?e(p,1):r.depth===3?e(h,2):r.depth===4?e(_,3):r.depth===5?e(v,4):r.depth===6?e(x,5):e(S,-1)}),D(e,l),ee()}var Ra=l(`<hr/>`);function za(e){var t=Ra();D(e,t)}var Ba=l(`<img/>`);function Va(e,t){ne(t,!0);let r=(e,t=L)=>{var r=Ba();let c;C(r,e=>j(g,e),()=>n(g)),x(r,(e,t)=>k?.(e,t),t),s(()=>{A(r,`src`,n(w)?t().source:void 0),A(r,`data-src`,i()),A(r,`title`,a()),A(r,`alt`,o()),A(r,`loading`,l()?`lazy`:`eager`),c=le(r,1,`svelte-1hoglcg`,null,c,{"fade-in":p()&&n(te)&&!n(T),visible:!p()&&n(te)&&!n(T),error:n(T)})}),f(`load`,r,re),f(`error`,r,ie),R(r),D(e,r)},i=y(t,`href`,3,void 0),a=y(t,`title`,3,void 0),o=y(t,`text`,3,``),l=y(t,`lazy`,3,!0),p=y(t,`fadeIn`,3,!0),m=b(()=>i()===``?void 0:i()),h=b(()=>({source:n(m)})),g=E(void 0),_=E(void 0),v=E(void 0),S=E(!1),w=b(()=>n(S)||!l()),te=b(()=>n(_)===n(h)),T=b(()=>n(v)===n(h)),O=new WeakMap,k=(e,t)=>(O.set(e,t),{update(t){O.set(e,t)},destroy(){O.delete(e)}});M(()=>{l()||j(S,!0)}),M(()=>{let e=n(g);if(n(w)||!e)return;if(typeof IntersectionObserver>`u`){j(S,!0);return}let t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&(j(S,!0),t.disconnect())},{rootMargin:`50px`});return t.observe(e),()=>{t.disconnect()}});let re=e=>{let t=O.get(e.currentTarget);t&&n(v)!==t&&j(_,t)},ie=e=>{let t=O.get(e.currentTarget);t&&(j(v,t),j(_,t))};var ae=c(),N=d(ae);u(N,()=>n(h),e=>{r(e,()=>n(h))}),D(e,ae),ee()}var Ha=l(`<a><!></a>`);function Ua(e,t){let n=y(t,`href`,3,void 0),r=y(t,`title`,3,void 0);var i=Ha(),a=g(i);m(a,()=>t.children??L),F(i),s(()=>{A(i,`href`,n()),A(i,`title`,r())}),D(e,i)}var Wa=l(`<ol><!></ol>`),Ga=l(`<ul><!></ul>`);function Ka(e,t){let n=y(t,`ordered`,3,!1),r=y(t,`start`,3,1);var i=c(),a=d(i),o=e=>{var n=Wa(),i=g(n);m(i,()=>t.children??L),F(n),s(()=>A(n,`start`,r())),D(e,n)},l=e=>{var n=Ga(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)};O(a,e=>{n()?e(o):e(l,-1)}),D(e,i)}var qa=l(`<li><!></li>`);function Ja(e,t){y(t,`listItemIndex`,3,void 0);var n=qa(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var Ya=l(`<p><!></p>`);function Xa(e,t){var n=Ya(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}function Za(e,n){v();var r=i();s(()=>t(r,n.text)),D(e,r)}var Qa=l(`<strong><!></strong>`);function $a(e,t){var n=Qa(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var eo=l(`<table><!></table>`);function to(e,t){var n=eo(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var no=l(`<tbody><!></tbody>`);function ro(e,t){var n=no(),r=g(n);m(r,()=>t.children??L),F(n),D(e,n)}var io=l(`<th><!></th>`),ao=l(`<td><!></td>`);function oo(e,t){let r=b(()=>t.align?`text-align: ${t.align}`:void 0);var i=c(),a=d(i),o=e=>{var i=io(),a=g(i);m(a,()=>t.children??L),F(i),s(()=>_(i,n(r))),D(e,i)},l=e=>{var i=ao(),a=g(i);m(a,()=>t.children??L),F(i),s(()=>_(i,n(r))),D(e,i)};O(a,e=>{t.header?e(o):e(l,- Line truncated
`))return!0;switch(e.type){case`heading`:case`hr`:return e.raw.endsWith(`
`);default:return!1}};hasPotentialReferenceUse=e=>!e.includes(`[`)||!e.includes(`]`)?!1:pc.test(e)||mc.test(e);hasPotentialReferenceUseOutsideDefinitions=e=>{if(!e.includes(`[`)||!e.includes(`]`))return!1;for(let t of e.split(`
`))if(!hc.test(t)&&this.hasPotentialReferenceUse(t))return!0;return!1};hasReferenceDefinition=e=>!e.includes(`[`)||!e.includes(`]`)?!1:hc.test(e);appendIntroducesMatch=(e,t)=>{if(t(e.slice(this.prevSource.length)))return!0;let n=this.prevSource.lastIndexOf(`
`)+1;return!t(this.prevSource.slice(n))&&t(e.slice(n))};isAppendOnlyUpdate=e=>this.prevSource!==``&&e.startsWith(this.prevSource);hasNewReferenceDefinition=e=>e.startsWith(this.prevSource)?this.appendIntroducesMatch(e,this.hasReferenceDefinition):!1;appendedDefinitionInvalidatesTail=e=>this.prevHasPotentialReferenceUse&&this.hasNewReferenceDefinition(e);canUseTailWindow=(e,t,n=this.isAppendOnlyUpdate(e),r=this.appendedDefinitionInvalidatesTail(e))=>{if(this.tailWindowDisabled||this.prevSource===``||this.prevTokens.length===0||!n||t.reparseOffset<=0||r)return!1;if(this.prevHasReferenceDefinition){let n=e.slice(t.reparseOffset);if(this.hasPotentialReferenceUseOutsideDefinitions(n))return!1}return!0};parseSource=(e,t,n,r)=>{if(!this.canUseTailWindow(e,t,n,r))return{tokens:$s(e,this.options,!1),tailTokens:[],usedTailWindow:!1};let i=$s(e.slice(t.reparseOffset),this.options,!1);return{tokens:[...this.prevTokens.slice(0,t.prefixCount),...i],tailTokens:i,usedTailWindow:!0}};hasAnyHtmlSpanMismatch=e=>e.some(this.hasHtmlSpanMismatch);getNextTailWindowBoundary=(e,t,n)=>{if(e.length===0||n)return{prefixCount:0,reparseOffset:0};let r=e[e.length-1];return this.isStableAtSourceEnd(r)?{prefixCount:e.length,reparseOffset:t}:{prefixCount:e.length-1,reparseOffset:t-this.getTokenSourceLength(r)}};updateCachedState=(e,t,n,r)=>{let i=t.usedTailWindow?this.prevHasHtmlSpanMismatch||this.hasAnyHtmlSpanMismatch(t.tailTokens):this.hasAnyHtmlSpanMismatch(t.tokens);this.prevHasPotentialReferenceUse=n?this.prevHasPotentialReferenceUse||this.appendIntroducesMatch(e,this.hasPotentialReferenceUseOutsideDefinitions):this.hasPotentialReferenceUseOutsideDefinitions(e),this.prevHasReferenceDefinition=n?this.prevHasReferenceDefinition||r:this.hasReferenceDefinition(e),this.prevSource=e,this.prevTokens=t.tokens,this.prevHasHtmlSpanMismatch=i,this.prevTailWindowBoundary=this.getNextTailWindowBoundary(t.tokens,e.length,i)};isReferenceSensitiveUpdate=(e,t,n)=>t?n:(this.prevHasReferenceDefinition||this.hasReferenceDefinition(e))&&(this.hasPotentialReferenceUse(this.prevSource)||this.hasPotentialReferenceUse(e));update=e=>{let t=this.getTailWindowBoundary(),n=this.isAppendOnlyUpdate(e),r=n&&this.appendIntroducesMatch(e,this.hasReferenceDefinition),i=this.prevHasPotentialReferenceUse&&r,a=this.parseSource(e,t,n,i),o=a.tokens;if(typeof this.options.walkTokens==`function`)for(let e of o)this.options.walkTokens(e);let s=this.isReferenceSensitiveUpdate(e,n,i),c=n&&!s,l=0,u=a.usedTailWindow?t.reparseOffset:0;if(!s){let e=Math.min(this.prevTokens.length,o.length);for(;l<e;){let e=this.prevTokens[l],n=o[l];if(!oc(e,n))break;a.usedTailWindow?u!==void 0&&l>=t.prefixCount&&(u+=this.getTokenSourceLength(n)):u!==void 0&&(this.hasHtmlSpanMismatch(n)?u=void 0:u+=this.getTokenSourceLength(n)),l++}}return this.updateCachedState(e,a,n,r),{tokens:o,divergeAt:l,divergeOffset:u,canReuse:c,usedTailWindow:a.usedTailWindow}}},_c=e=>typeof e==`object`&&!!e,vc=e=>_c(e)&&typeof e.id==`string`&&typeof e.text==`string`,yc=e=>{let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n),i=e[n];t+=/[A-Za-z0-9_-]/.test(i)?i:`~${r.toString(16).padStart(4,`0`)}`}return t},bc=(e,t=1)=>{let n=`fnref-${yc(e)}`;return t===1?n:`${n}:ref:${t}`},xc=e=>{let t=new WeakMap,n=new WeakMap,r=new Map,i=new Map,a=new Set,o=[],s=e=>{if(Array.isArray(e))for(let t of e)Array.isArray(t)?s(t):_c(t)&&c(t)},c=e=>{if(e.type===`footnoteRef`&&typeof e.id==`string`){let n=(r.get(e.id)??0)+1,a=bc(e.id,n);r.set(e.id,n),t.set(e,Object.freeze({referenceId:a}));let o=i.get(e.id);o?o.push(a):i.set(e.id,[a])}else if(e.type===`footnoteSection`&&Array.isArray(e.footnotes)){let t=[];for(let n of e.footnotes)!vc(n)||a.has(n.id)||(a.add(n.id),t.push({id:n.id,text:n.text}));o.push({token:e,footnotes:t})}e.type!==`image`&&e.type!==`code`&&e.type!==`codespan`&&(s(e.tokens),s(e.items),s(e.header),s(e.rows))};s(e);for(let e of o){let t=e.footnotes.map(e=>Object.freeze({...e,backrefs:Object.freeze([...i.get(e.id)??[]])}));n.set(e.token,Object.freeze({footnotes:Object.freeze(t)}))}return Object.freeze({referenceProps:t,sectionProps:n})},Sc=1e6,Cc=e=>typeof e==`object`&&!!e&&`offset`in e,wc=(e,t,{currentBufferLength:n=0,maxOffsetGap:r=Sc}={})=>typeof e==`string`?t===`offset`?{kind:`drop`,message:`offset mode active, string chunk dropped. Call resetStream() before switching streaming input modes.`}:{kind:`append`,value:e,nextMode:`append`}:!Cc(e)||typeof e.value!=`string`?{kind:`drop`,message:`Invalid chunk object passed to writeChunk(); expected { value: string, offset: number }.`}:!Number.isSafeInteger(e.offset)||e.offset<0?{kind:`drop`,message:`Invalid offset chunk passed to writeChunk(); offset must be a non-negative safe integer.`}:t===`append`?{kind:`drop`,message:`append mode active, offset chunk dropped. Call resetStream() before switching streaming input modes.`}:e.offset-n>r?{kind:`drop`,message:`offset chunk skipped: offset ${e.offset} is more than ${r} chars beyond the current buffer length (${n}).`}:{kind:`offset`,ch Line truncated