diffdesk 0.1.0__py3-none-any.whl

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.
Files changed (59) hide show
  1. diffdesk/__init__.py +3 -0
  2. diffdesk/agent.py +414 -0
  3. diffdesk/agent_guide.md +112 -0
  4. diffdesk/cli.py +329 -0
  5. diffdesk/config.py +130 -0
  6. diffdesk/gitio.py +391 -0
  7. diffdesk/index.py +635 -0
  8. diffdesk/mcp.py +472 -0
  9. diffdesk/server.py +750 -0
  10. diffdesk/static/app.js +402 -0
  11. diffdesk/static/index.html +129 -0
  12. diffdesk/static/js/api.js +58 -0
  13. diffdesk/static/js/boot.js +12 -0
  14. diffdesk/static/js/diffview.js +359 -0
  15. diffdesk/static/js/dom.js +82 -0
  16. diffdesk/static/js/editor-cm.js +225 -0
  17. diffdesk/static/js/editor-monaco.js +116 -0
  18. diffdesk/static/js/flow.js +227 -0
  19. diffdesk/static/js/hunks.js +40 -0
  20. diffdesk/static/js/markdown.js +102 -0
  21. diffdesk/static/js/settings.js +228 -0
  22. diffdesk/static/js/subject.js +127 -0
  23. diffdesk/static/js/tree.js +492 -0
  24. diffdesk/static/js/treemap.js +217 -0
  25. diffdesk/static/style.css +508 -0
  26. diffdesk/static/vendor/LICENSES.txt +603 -0
  27. diffdesk/static/vendor/codemirror.js +24 -0
  28. diffdesk/static/vendor/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  29. diffdesk/static/vendor/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  30. diffdesk/static/vendor/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  31. diffdesk/static/vendor/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  32. diffdesk/static/vendor/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  33. diffdesk/static/vendor/fonts/KaTeX_Main-Bold.woff2 +0 -0
  34. diffdesk/static/vendor/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  35. diffdesk/static/vendor/fonts/KaTeX_Main-Italic.woff2 +0 -0
  36. diffdesk/static/vendor/fonts/KaTeX_Main-Regular.woff2 +0 -0
  37. diffdesk/static/vendor/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  38. diffdesk/static/vendor/fonts/KaTeX_Math-Italic.woff2 +0 -0
  39. diffdesk/static/vendor/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  40. diffdesk/static/vendor/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  41. diffdesk/static/vendor/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  42. diffdesk/static/vendor/fonts/KaTeX_Script-Regular.woff2 +0 -0
  43. diffdesk/static/vendor/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  44. diffdesk/static/vendor/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  45. diffdesk/static/vendor/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  46. diffdesk/static/vendor/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  47. diffdesk/static/vendor/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  48. diffdesk/static/vendor/fonts/OFL.txt +102 -0
  49. diffdesk/static/vendor/katex.css +2 -0
  50. diffdesk/static/vendor/katex.js +258 -0
  51. diffdesk/static/vendor/marked.js +72 -0
  52. diffdesk/subject.schema.json +59 -0
  53. diffdesk-0.1.0.dist-info/METADATA +520 -0
  54. diffdesk-0.1.0.dist-info/RECORD +59 -0
  55. diffdesk-0.1.0.dist-info/WHEEL +4 -0
  56. diffdesk-0.1.0.dist-info/entry_points.txt +2 -0
  57. diffdesk-0.1.0.dist-info/licenses/LICENSE +21 -0
  58. diffdesk-0.1.0.dist-info/licenses/src/diffdesk/static/vendor/LICENSES.txt +603 -0
  59. diffdesk-0.1.0.dist-info/licenses/src/diffdesk/static/vendor/fonts/OFL.txt +102 -0
@@ -0,0 +1,72 @@
1
+ /* Bundled for diffdesk from marked 18.1.3. MIT license, see LICENSES.txt. */
2
+ var je=Object.defineProperty;var xe=r=>{throw TypeError(r)};var He=(r,e,t)=>e in r?je(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var f=(r,e,t)=>He(r,typeof e!="symbol"?e+"":e,t),Ne=(r,e,t)=>e.has(r)||xe("Cannot "+t);var be=(r,e,t)=>e.has(r)?xe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t);var V=(r,e,t)=>(Ne(r,e,"access private method"),t);function oe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=oe();function Pe(r){q=r}var L={exec:()=>null};function E(r){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),n=e[s];return n||(n=r(s),e[s]=n),n}}function h(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(S.caret,"$1"),t=t.replace(n,a),s},getRegex:()=>new RegExp(t,e)};return s}var Ie=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),S={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:E(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:E(r=>new RegExp(`^ {0,${r}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:E(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:E(r=>new RegExp(`^ {0,${r}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:E(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:E(r=>new RegExp(`^ {0,${r}}(?:</?(?:${G})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:E(r=>new RegExp(`^ {0,${r}}>`))},Fe=/^(?:[ \t]*(?:\n|$))+/,Xe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ge=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,X=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,We=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ce=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ce=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Ee=h(Ce).replace(/bull/g,ce).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ue=h(Ce).replace(/bull/g,ce).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),pe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Je=/^[^\n]+/,he=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Ke=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",he).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Ve=h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ce).getRegex(),G="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ue=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ye=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ue).replace("tag",G).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le=r=>h(pe).replace("hr",X).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",r).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",G).getRegex(),et=Le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),tt=Le(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),rt=h(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",tt).getRegex(),ge={blockquote:rt,code:Xe,def:Ke,fences:Ge,heading:We,hr:X,html:Ye,lheading:Ee,list:Ve,newline:Fe,paragraph:et,table:L,text:Je},me=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",X).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",G).getRegex(),nt={...ge,lheading:Ue,table:me,paragraph:h(pe).replace("hr",X).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",me).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",G).getRegex()},st={...ge,html:h(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",ue).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:L,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(pe).replace("hr",X).replace("heading",` *#{1,6} *[^
3
+ ]`).replace("lheading",Ee).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},it=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Be=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,at=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,Q=/[\s\p{P}\p{S}]/u,W=/[^\s\p{P}\p{S}]/u,ot=h(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Q).getRegex(),ct=/[\p{Pi}\p{Ps}"']/u,ve=/(?!~)[\p{P}\p{S}]/u,pt=/(?!~)[\s\p{P}\p{S}]/u,ht=/(?:[^\s\p{P}\p{S}]|~)/u,ut=h(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ie?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gt=h(qe,"u").replace(/punct/g,T).getRegex(),kt=h(qe,"u").replace(/punct/g,ve).getRegex(),dt=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,ft=h(dt,"u").replace(/openQuote/g,ct).replace(/punct/g,T).getRegex(),Ze="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xt=h(Ze,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,Q).replace(/punct/g,T).getRegex(),bt=h(Ze,"gu").replace(/notPunctSpace/g,ht).replace(/punctSpace/g,pt).replace(/punct/g,ve).getRegex(),mt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",wt=h(mt,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,Q).replace(/punct/g,T).getRegex(),St=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,Q).replace(/punct/g,T).getRegex(),$t="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",yt=h($t,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,Q).replace(/punct/g,T).getRegex(),Rt=h(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),At="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Tt=h(At,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,Q).replace(/punct/g,T).getRegex(),zt=h(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),_t=h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,T).getRegex(),Pt=h(/^<(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(),It=h(ue).replace("(?:-->|$)","-->").getRegex(),Ct=h("^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",It).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),De=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,re=h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",De).getRegex(),Et=h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Lt=h(/^!?\[(label)\]\[(ref)\]/).replace("label",re).replace("ref",he).getRegex(),Bt=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",he).getRegex(),we=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,vt=h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",De).getRegex(),qt=h("reflink|nolink(?!\\()","g").replace("reflink",h(/^!?\[(label)\]\[(ref)\]/).replace("label",vt).replace("ref",we).getRegex()).replace("nolink",h(/^!?\[(ref)\](?:\[\])?/).replace("ref",we).getRegex()).getRegex(),Se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zt=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Dt=h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Zt).getRegex(),ke={_backpedal:L,anyPunctuation:zt,anyPunctuationOutsideCode:_t,autolink:Pt,blockSkip:ut,br:Be,code:lt,del:L,delLDelim:L,delRDelim:L,emStrongLDelim:gt,emStrongRDelimAst:xt,emStrongRDelimUnd:St,escape:it,link:Et,nolink:Bt,punctuation:ot,reflink:Lt,reflinkSearch:qt,tag:Ct,text:at,url:L},Ot={...ke,emStrongLDelim:ft,emStrongRDelimAst:wt,emStrongRDelimUnd:yt,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",re).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",re).getRegex()},le={...ke,emStrongRDelimAst:bt,emStrongLDelim:kt,delLDelim:Rt,delRDelim:Tt,url:h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Dt).replace("protocol",Se).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Se).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",Ie?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Mt={...le,br:h(Be).replace("{2,}","*").getRegex(),text:h(le.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Y={normal:ge,gfm:nt,pedantic:st},N={normal:ke,gfm:le,breaks:Mt,pedantic:Ot},Qt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$e=r=>Qt[r];function y(r,e){if(e){if(S.escapeTest.test(r))return r.replace(S.escapeReplace,$e)}else if(S.escapeTestNoEncode.test(r))return r.replace(S.escapeReplaceNoEncode,$e);return r}function jt(r){return S.numericCharacterReference.test(r)?r.replace(S.numericCharacterReferenceOrAmpersand,(e,t,s)=>{if(t===void 0&&s===void 0)return"&amp;";let n=t===void 0?Number.parseInt(s,16):Number.parseInt(t,10);return n===0||n>1114111||n>=55296&&n<=57343?"\uFFFD":n===38?"&amp;":String.fromCodePoint(n)}):r}function ye(r){try{r=encodeURI(r).replace(S.percentDecode,"%")}catch{return null}return r}function Re(r,e){let t=r.replace(S.findPipe,(i,a,l)=>{let p=!1,c=a;for(;--c>=0&&l[c]==="\\";)p=!p;return p?"|":" |"}),s=t.split(S.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(S.slashPipe,"|");return s}function _(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s;){let i=r.charAt(s-n-1);if(i===e&&!t)n++;else if(i!==e&&t)n++;else break}return r.slice(0,s-n)}function Ae(r){let e=r.split(`
4
+ `),t=e.length-1;for(;t>=0&&S.blankLine.test(e[t]);)t--;return e.length-t<=2?r:e.slice(0,t+1).join(`
5
+ `)}function ne(r){return r.trim().replace(S.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function Te(r,e){if(r.indexOf(e[0])===-1&&r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}var M=new WeakMap;function de(r){let e={"*":-1,_:-1},t=-1,s=r.length;for(let n=0;n<s;n++){let i=r[n];if(i!=="*"&&i!=="_"&&i!=="~")continue;let a=n===0?`
6
+ `:r[n-1],l=n+1;for(;l<s&&r[l]===i;)l++;a!==" "&&a!==" "&&a!==`
7
+ `&&a!=="\r"&&a!=="\f"&&(i==="~"?t=n:e[i]=n),n=l-1}return{maskedSrc:r,lastPossibleEmStrongCloserIndex:e,lastPossibleDelCloserIndex:t}}function Ht(r,e){let t=de(e),s=M.get(r);s?s.push(t):M.set(r,[t])}function Nt(r){let e=M.get(r);e&&(e.pop(),e.length===0&&M.delete(r))}function Ft(r,e,t){let s=M.get(r)?.at(-1);return s&&s.maskedSrc===e?s.lastPossibleEmStrongCloserIndex[t]:de(e).lastPossibleEmStrongCloserIndex[t]}function Xt(r,e){let t=M.get(r)?.at(-1);return t&&t.maskedSrc===e?t.lastPossibleDelCloserIndex:de(e).lastPossibleDelCloserIndex}function ee(r,e=0){let t=e,s="";for(let n of r)if(n===" "){let i=4-t%4;s+=" ".repeat(i),t+=i}else s+=n,t++;return s}function ze(r,e,t,s,n){let i=e.href,a=e.title||null,l=r[1].replace(n.other.outputLinkReplace,"$1"),p=r[0].charAt(0)==="!",c=s.state.inLink,o=s.state.linkEmitted,u=s.state.inRawBlock;s.state.inLink=!0,s.state.linkEmitted=!1;let k=s.inlineTokens(l),g=s.state.linkEmitted;if(s.state.linkEmitted=o,s.state.inLink=c,!p){if(g){s.state.inRawBlock=u;return}s.state.linkEmitted=!0}return{type:p?"image":"link",raw:t,href:i,title:a,text:l,tokens:k}}function Gt(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
8
+ `).map(i=>{let a=i.match(t.other.beginningSpace);if(a===null)return i;let[l]=a;return i.slice(Math.min(l.length,n.length))}).join(`
9
+ `)}function _e(r,e,t,s){if(!e.includes("<"))return!1;for(let n=0;n<e.length;n++){if(e[n]==="\\"){n++;continue}if(e[n]==="`"){let l=s.inline.code.exec(e.slice(n));if(l){n+=l[0].length-1;continue}}if(e[n]!=="<")continue;let i=r.slice(t+n),a=s.inline.tag.exec(i)||s.inline.autolink.exec(i);if(a){if(a[0].length>e.length-n)return!0;n+=a[0].length-1}}return!1}var O=class{constructor(r){f(this,"options");f(this,"rules");f(this,"lexer");this.options=r||q}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=this.options.pedantic?e[0]:Ae(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=Gt(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=_(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(t=s.trim())}return{type:"heading",raw:_(e[0],`
10
+ `),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:_(e[0],`
11
+ `)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=_(e[0],`
12
+ `).split(`
13
+ `),s="",n="",i=[];for(;t.length>0;){let a=!1,l=[],p;for(p=0;p<t.length;p++)if(this.rules.other.blockquoteStart.test(t[p]))l.push(t[p]),a=!0;else if(!a)l.push(t[p]);else break;t=t.slice(p);let c=l.join(`
14
+ `),o=c.replace(this.rules.other.blockquoteMarkerWhitespace,(g,b,m)=>b+ee(m,b.length)).replace(this.rules.other.blockquoteSetextReplace,`
15
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
16
+ ${c}`:c,n=n?`${n}
17
+ ${o}`:o;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,i,!0),this.lexer.state.top=u,t.length===0)break;let k=i.at(-1);if(k?.type==="code"||k?.type==="heading"||k?.type==="hr"||k?.type==="html"||k?.type==="table")break;if(k?.type==="blockquote"){let g=k,b=t.join(`
18
+ `),m=g.raw+`
19
+ `+b.replace(this.rules.other.blockquoteSetextReplace2,""),d=this.blockquote(m);i[i.length-1]=d;let $=m.substring(d.raw.length).replace(/^\n/,""),w=$?$.split(`
20
+ `).length:0,z=w?t.slice(0,-w):t;if(z.length>0&&(s=`${s}
21
+ ${z.join(`
22
+ `)}`),n=n.substring(0,n.length-g.text.length)+d.text,t=t.slice(z.length),t.length>0&&this.rules.other.blockquoteStart.test(t[0]))continue;break}else if(k?.type==="list"){let g=k,b=g.raw+`
23
+ `+t.join(`
24
+ `),m=this.list(b);i[i.length-1]=m;let d=m.raw.length>g.raw.length?b.slice(g.raw.length+1,m.raw.length).split(`
25
+ `).length:0;if(d>0){let $=t.slice(0,d).join(`
26
+ `);s=`${s}
27
+ ${$}`,n=`${n}
28
+ ${$}`}t=t.slice(d);continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=r,s=()=>t.length-r.length,n=e[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let l=this.rules.other.listItemRegex(n),p=!1;for(;r;){let o=!1,u="";if(!(e=l.exec(r))||this.rules.block.hr.test(r))break;let k=s();r=r.substring(e[0].length);let g=e[2].split(`
29
+ `,1)[0],b=e[1].length,m=this.options.pedantic?ee(g,b):g.replace(this.rules.other.leadingSpaceTab,Z=>ee(Z,b)),d=r.split(`
30
+ `,1)[0],$=!m.trim(),w=0;if(this.options.pedantic?(w=2,u=m.trimStart()):$?w=b+1:(w=m.search(this.rules.other.nonSpaceChar),w=w>4?1:w,u=m.slice(w),w+=b),$&&this.rules.other.blankLine.test(d)&&(r=r.substring(d.length+1),o=!0),!o){let Z=this.rules.other.nextBulletRegex(w),j=this.rules.other.hrRegex(w),U=this.rules.other.fencesBeginRegex(w),J=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(w):this.rules.other.headingBeginRegex(w),C=this.rules.other.htmlBeginRegex(w),K=this.rules.other.blockquoteBeginRegex(w);for(;r;){let H=r.split(`
31
+ `,1)[0],D;if(d=H,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),D=d):D=d.replace(this.rules.other.leadingSpaceTab,ie=>ee(ie)),U.test(d)||J.test(d)||C.test(d)||K.test(d)||Z.test(d)||j.test(d))break;if(D.search(this.rules.other.nonSpaceChar)>=w||!d.trim())u+=`
32
+ `+D.slice(w);else{if($||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(m)||J.test(m)||C.test(m)||j.test(m))break;let ie=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(d)&&this.rules.block.lheading.test(`${m}
33
+ ${d}`)?` ${D.replace(/^ {0,3}/,"")}`:d;u+=`
34
+ `+ie}$=!d.trim(),r=r.substring(H.length+1),m=D.slice(w)}}let z=t.slice(k,s());a.loose||(p?a.loose=!0:this.rules.other.doubleBlankLine.test(z)&&(p=!0)),a.items.push({type:"list_item",raw:z,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]})}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=t.slice(0,s()).trimEnd();for(let o of a.items)if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),!a.loose){let u=o.tokens.filter(g=>g.type==="space"),k=u.length>0&&u.some(g=>this.rules.other.anyLine.test(g.raw));a.loose=k}for(let o of a.items){let u=o.tokens[0];if(o.task&&(u?.type==="text"||u?.type==="paragraph")){o.text=o.text.replace(this.rules.other.listReplaceTask,""),u.raw=u.raw.replace(this.rules.other.listReplaceTask,""),u.text=u.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let k=this.rules.other.listTaskCheckbox.exec(o.raw);if(k){let g={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};o.checked=g.checked,a.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=g.raw+o.tokens[0].raw,o.tokens[0].text=g.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(g)):o.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):o.tokens.unshift(g)}}else o.task&&(o.task=!1)}if(a.loose)for(let o of a.items){o.loose=!0;for(let u of o.tokens)u.type==="text"&&(u.type="paragraph")}return a}}html(r){let e=this.rules.block.html.exec(r);if(e){let t=Ae(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(r){let e=this.rules.block.def.exec(r);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&Te(e[2],"()")!==-1)return;let t=ne(e[1]),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:_(e[0],`
35
+ `),href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Re(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
36
+ `):[],i={type:"table",raw:_(e[0],`
37
+ `),header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of n)i.rows.push(Re(a,i.header.length).map((l,p)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[p]})));return i}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e){let t=e[1].trim();return{type:"heading",raw:_(e[0],`
38
+ `),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
39
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(r);if(e){let t=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&_e(r,e[1],t,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let l=_(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{let l=Te(e[2],"()");if(l===-2)return;if(l>-1){let p=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,p).trim(),e[3]=""}}let n=_(e[0].slice(0,-1),"\\");if((e[0].length-n.length)%2===0)return;let i=e[2],a="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(i);l&&(i=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),ze(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&_e(r,t[1],s,this.rules))return;let n=e[ne(t[2]||t[1])];if(!n){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return ze(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!s||!s[1]&&!s[2]&&!s[3]&&!s[4])return;let n=s[0][0],i=t===n,a=e.length-r.length,l=a;for(;!this.options.pedantic&&l>0&&e[l-1]===n;)l--;let p=[...e.slice(Math.max(0,l-2),l)].at(-1)??"",c=p==="*"||p==="_"||!!this.rules.inline.punctuation.exec(p);l<a&&(t=p);let o=l<a?c:!!this.rules.inline.punctuation.exec(t);if(s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))return;let u=s[1]||s[3]||"";if(!u||!t||o){let k=[...s[0]].length-1,g,b,m=k,d=0,$=a-l+k,w=!this.options.pedantic&&!!p.trim()&&(!!u||n==="*"&&!c);if(n!=="*"&&n!=="_")return;let z=n==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,Z=Ft(this,e,n),j=e.length-r.length+k;if(Z<j)return;e=e.slice(-1*r.length+k);let U=Z-j;for(z.lastIndex=0;(s=z.exec(e))!==null&&!(s.index>U);){if(g=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!g)continue;if(b=[...g].length,s[3]||s[4]){m+=b;continue}else if(s[5]||s[6]||w){if(i&&(s[5]||s[6]))break;if($%3&&!(($+b)%3)){d+=b;continue}}if(m-=b,m>0)continue;b=Math.min(b,b+m+d);let J=[...s[0]][0].length,C=r.slice(0,k+s.index+J+b);if(Math.min(k,b)%2){let H=C.slice(1,-1);return{type:"em",raw:C,text:H,tokens:this.lexer.inlineTokens(H)}}let K=C.slice(2,-2);return{type:"strong",raw:C,text:K,tokens:this.lexer.inlineTokens(K)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,i,a,l=n,p=this.rules.inline.delRDelim,c=Xt(this,e),o=e.length-r.length+n;if(c<o)return;e=e.slice(-1*r.length+n);let u=c-o;for(p.lastIndex=0;(s=p.exec(e))!==null&&!(s.index>u);){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(a=[...i].length,a!==n))continue;if(s[3]||s[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let k=[...s[0]][0].length,g=r.slice(0,n+s.index+k+a),b=g.slice(n,-n);return{type:"del",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:t?e[0]:jt(e[0]),escaped:t}}}},I,Oe,Me,Qe,B,R=(B=class{constructor(e){be(this,I);f(this,"tokens");f(this,"options");f(this,"state");f(this,"inlineQueue");f(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||q,this.options.tokenizer=this.options.tokenizer||new O,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:S,block:Y.normal,inline:N.normal};this.options.pedantic?(t.block=Y.pedantic,t.inline=N.pedantic):this.options.gfm&&(t.block=Y.gfm,this.options.breaks?t.inline=N.breaks:t.inline=N.gfm),this.tokenizer.rules=t}static get rules(){return{block:Y,inline:N}}static lex(e,t){return new B(t).lex(e)}static lexInline(e,t){return new B(t).inlineTokens(e)}lex(e){e=e.replace(S.carriageReturn,`
40
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.state.inRawBlock=!1,this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(S.tabCharGlobal," ").replace(S.spaceLine,""));let n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(l=>(i=l.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 l=t.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
41
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
42
+ `)?"":`
43
+ `)+i.raw,l.text+=`
44
+ `+i.text,this.inlineQueue.at(-1).src=l.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 l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
45
+ `)?"":`
46
+ `)+i.raw,l.text+=`
47
+ `+i.raw,this.inlineQueue.at(-1).src=l.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 l=1/0,p=e.slice(1),c;this.options.extensions.startBlock.forEach(o=>{c=o.call({lexer:this},p),typeof c=="number"&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(a=e.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let l=t.at(-1);s&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
48
+ `)?"":`
49
+ `)+i.raw,l.text+=`
50
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(i),s=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let l=t.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
51
+ `)?"":`
52
+ `)+i.raw,l.text+=`
53
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.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 s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let n=s[0],i=n.lastIndexOf("[");if(!(n.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,ne(n.slice(i+1,-1))))&&!(i>1&&this.linkInText(n.slice(1,i-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return V(this,I,Oe).call(this,e,t)}finally{this.state.linkParenPossible=s}}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},I=new WeakSet,Oe=function(e,t){let s=e.includes("*")||e.includes("_")||e.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==O.prototype.emStrong||this.tokenizer.del!==O.prototype.del?V(this,I,Qe).call(this,e):e;Ht(this.tokenizer,s);try{return V(this,I,Me).call(this,e,s,t)}finally{Nt(this.tokenizer)}},Me=function(e,t,s){let n=!1,i="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(i=""),n=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,s))?(e=e.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=s.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(l=this.tokenizer.emStrong(e,t,i)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.del(e,t,i)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),s.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),s.push(l);continue}let p=e;if(this.options.extensions?.startInline){let c=1/0,o=e.slice(1),u;this.options.extensions.startInline.forEach(k=>{u=k.call({lexer:this},o),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(p=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(p)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(i=l.raw.slice(-1)),n=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s},Qe=function(e){let t=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,n=i=>{let a=i.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,ne(i.slice(a+1,-1))))return i;if(a>1&&i.charAt(0)!=="!"){let l=i.slice(1,a-1);if(this.linkInText(l))return"["+l.replace(s,n)+"]["+"a".repeat(i.length-a-2)+"]"}return"["+"a".repeat(i.length-2)+"]"};t=t.replace(s,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,n,i)=>i?"+".repeat(s.length):n?n+s.slice(n.length,-n.length).replace(/`/g,"+")+n:s),t=t.replace(this.tokenizer.rules.inline.blockSkip,(s,n,i)=>{let a=i?i.length:0;return s.slice(0,a)+"["+"a".repeat(s.length-a-2)+"]"}),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t},B),se=class{constructor(r){f(this,"options");f(this,"parser");this.options=r||q}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(S.notSpaceStart)?.[0],n=r?r.replace(S.endingNewline,"")+`
54
+ `:"";return s?'<pre><code class="language-'+y(s)+'">'+(t?n:y(n,!0))+`</code></pre>
55
+ `:"<pre><code>"+(t?n:y(n,!0))+`</code></pre>
56
+ `}blockquote({tokens:r}){return`<blockquote>
57
+ ${this.parser.parse(r)}</blockquote>
58
+ `}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
59
+ `}hr(r){return`<hr>
60
+ `}list(r){let e=r.ordered,t=r.start,s="";for(let a=0;a<r.items.length;a++){let l=r.items[a];s+=this.listitem(l)}let n=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+n+i+`>
61
+ `+s+"</"+n+`>
62
+ `}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
63
+ `}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
64
+ `}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let i=r.rows[n];t="";for(let a=0;a<i.length;a++)t+=this.tablecell(i[a]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
65
+ <thead>
66
+ `+e+`</thead>
67
+ `+s+`</table>
68
+ `}tablerow({text:r}){return`<tr>
69
+ ${r}</tr>
70
+ `}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
71
+ `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${y(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,text:t,tokens:s,autolink:n}){let i=n?y(t,!0):this.parser.parseInline(s),a=ye(r);if(a===null)return i;r=y(a,n);let l='<a href="'+r+'"';return e&&(l+=' title="'+y(e)+'"'),l+=">"+i+"</a>",l}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=ye(r);if(n===null)return y(t);r=n;let i=`<img src="${y(r)}" alt="${y(t)}"`;return e&&(i+=` title="${y(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:y(r.text)}},fe=class{constructor(){f(this,"parser")}strong({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}em({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}codespan({text:r}){return r}del({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}html({text:r}){return r}text({text:r}){return r}link({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}image({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}br(){return""}checkbox({raw:r}){return r}},A=class ae{constructor(e){f(this,"options");f(this,"renderer");f(this,"textRenderer");this.options=e||q,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new fe,this.textRenderer.parser=this}static parse(e,t){return new ae(t).parse(e)}static parseInline(e,t){return new ae(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=n,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){t+=l||"";continue}}let i=n;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 a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}let a=i;switch(a.type){case"escape":{s+=t.text(a);break}case"html":{s+=t.html(a);break}case"link":{s+=t.link(a);break}case"image":{s+=t.image(a);break}case"checkbox":{s+=t.checkbox(a);break}case"strong":{s+=t.strong(a);break}case"em":{s+=t.em(a);break}case"codespan":{s+=t.codespan(a);break}case"br":{s+=t.br(a);break}case"del":{s+=t.del(a);break}case"text":{s+=t.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},te,F=(te=class{constructor(r){f(this,"options");f(this,"block");this.options=r||q}preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?R.lex:R.lexInline}provideParser(r=this.block){return r?A.parse:A.parseInline}},f(te,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),f(te,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),te);function P(r,e){if(Array.isArray(e))for(let t=0;t<e.length;t++)r.push(e[t]);else r.push(e)}var Wt=class{constructor(...r){f(this,"defaults",oe());f(this,"options",this.setOptions);f(this,"parse",this.parseMarkdown(!0));f(this,"parseInline",this.parseMarkdown(!1));f(this,"Parser",A);f(this,"Renderer",se);f(this,"TextRenderer",fe);f(this,"Lexer",R);f(this,"Tokenizer",O);f(this,"Hooks",F);this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(P(t,e.call(this,s)),s.type){case"table":{let n=s;for(let i of n.header)P(t,this.walkTokens(i.tokens,e));for(let i of n.rows)for(let a of i)P(t,this.walkTokens(a.tokens,e));break}case"list":{let n=s;P(t,this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(i=>{let a=n[i].flat(1/0);P(t,this.walkTokens(a,e))}):n.tokens&&P(t,this.walkTokens(n.tokens,e))}}return t}use(...r){let e=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let i=e.renderers[n.name];i?e.renderers[n.name]=function(...a){let l=n.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new se(this.defaults);for(let i in t.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=t.renderer[a],p=n[a];n[a]=(...c)=>{let o=l.apply(n,c);return o===!1&&(o=p.apply(n,c)),o===!1?"":o??""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new O(this.defaults);for(let i in t.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=t.tokenizer[a],p=n[a];n[a]=(...c)=>{let o=l.apply(n,c);return o===!1&&(o=p.apply(n,c)),o}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new F;for(let i in t.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=t.hooks[a],p=n[a];F.passThroughHooks.has(i)?n[a]=c=>{if(n.options.async&&F.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await l.call(n,c);return p.call(n,u)})();let o=l.call(n,c);return p.call(n,o)}:n[a]=(...c)=>{if(n.options.async)return(async()=>{let u=await l.apply(n,c);return u===!1&&(u=await p.apply(n,c)),u})();let o=l.apply(n,c);return o===!1&&(o=p.apply(n,c)),o}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(a){let l=[];return P(l,i.call(this,a)),n&&P(l,n.call(this,a)),l}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return R.lex(r,e??this.defaults)}parser(r,e){return A.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=r),n.async)return(async()=>{let a=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer(r):r?R.lex:R.lexInline)(a,n),p=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(p,n.walkTokens));let c=await(n.hooks?await n.hooks.provideParser(r):r?A.parse:A.parseInline)(p,n);return n.hooks?await n.hooks.postprocess(c):c})().catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let a=(n.hooks?n.hooks.provideLexer(r):r?R.lex:R.lexInline)(e,n);n.hooks&&(a=n.hooks.processAllTokens(a)),n.walkTokens&&this.walkTokens(a,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(r):r?A.parse:A.parseInline)(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(r,e){return t=>{if(t.message+=`
72
+ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},v=new Wt;function x(r,e){return v.parse(r,e)}x.options=x.setOptions=function(r){return v.setOptions(r),x.defaults=v.defaults,Pe(x.defaults),x};x.getDefaults=oe;x.defaults=q;function Ut(...r){return v.use(...r),x.defaults=v.defaults,Pe(x.defaults),x}x.use=Ut;x.walkTokens=function(r,e){return v.walkTokens(r,e)};x.parseInline=v.parseInline;x.Parser=A;x.parser=A.parse;x.Renderer=se;x.TextRenderer=fe;x.Lexer=R;x.lexer=R.lex;x.Tokenizer=O;x.Hooks=F;x.parse=x;var Kt=x.options,Vt=x.setOptions,Yt=x.walkTokens,er=x.parseInline,tr=x,rr=A.parse,nr=R.lex;export{F as Hooks,R as Lexer,Wt as Marked,A as Parser,se as Renderer,fe as TextRenderer,O as Tokenizer,q as defaults,oe as getDefaults,nr as lexer,x as marked,Kt as options,tr as parse,er as parseInline,rr as parser,Vt as setOptions,Ut as use,Yt as walkTokens};
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ysBach/diffdesk/subject.schema.json",
4
+ "title": "diffdesk subject",
5
+ "description": "One change to review: a commit range plus the reasons for it. Unknown fields are allowed and shown in the 'More' table.",
6
+ "type": "object",
7
+ "required": ["id", "title"],
8
+ "additionalProperties": true,
9
+ "$defs": {
10
+ "name": {
11
+ "type": "string",
12
+ "pattern": "^(?!.*\\.\\.)[A-Za-z0-9][A-Za-z0-9._-]*$"
13
+ },
14
+ "revision": {
15
+ "type": ["string", "null"],
16
+ "pattern": "^(?!-)(?!.*\\.\\.)[^\\s:\\u0000-\\u001f\\u007f]+$"
17
+ },
18
+ "relpath": {
19
+ "type": "string",
20
+ "pattern": "^(?![/~])(?!(.*/)?\\.\\.?(/|$))(?!.*//)(?!.*/$)[^\\\\\\u0000-\\u001f\\u007f]+$"
21
+ },
22
+ "strings": {
23
+ "type": "array",
24
+ "items": {"type": "string"}
25
+ }
26
+ },
27
+ "properties": {
28
+ "id": {
29
+ "$ref": "#/$defs/name",
30
+ "description": "Subject ID: letters, digits, '.', '_' and '-', starting with a letter or digit, without '..'. Unique inside its package."
31
+ },
32
+ "package": {
33
+ "$ref": "#/$defs/name",
34
+ "description": "Package name. Default: the first folder below the subjects folder."
35
+ },
36
+ "title": {"type": "string", "minLength": 1, "description": "One-line title."},
37
+ "priority": {"type": "string", "description": "For example P1, P2, P3."},
38
+ "origin": {"type": "string", "description": "Who made the change, for example new or gpt."},
39
+ "recommended": {"type": "string", "description": "Suggested verdict, for example accept, reject or user-decision."},
40
+ "decisions": {"$ref": "#/$defs/strings", "description": "IDs of decisions this change depends on."},
41
+ "summary": {"type": "string", "description": "One sentence: what is wrong and what the change does."},
42
+ "why": {"type": "string", "description": "Markdown with the reasons. LaTeX in $...$ is allowed."},
43
+ "refs": {"$ref": "#/$defs/strings", "description": "Paths or links to supporting documents."},
44
+ "repo": {"type": ["string", "null"], "description": "Absolute path of the git work tree."},
45
+ "base": {"$ref": "#/$defs/revision", "description": "Old side of the diff (usually the parent commit). Null if there is no diff."},
46
+ "head": {"$ref": "#/$defs/revision", "description": "New side of the diff. Null if there is no diff."},
47
+ "files": {
48
+ "type": "array",
49
+ "items": {"$ref": "#/$defs/relpath"},
50
+ "description": "Files to review, relative to the repository. Empty: every file changed between base and head."
51
+ },
52
+ "tests": {"type": "string", "description": "Test command and result."},
53
+ "senior_verdict": {"type": "string", "description": "Verdict of a second reviewer."},
54
+ "branch": {"type": "string", "minLength": 1, "description": "Branch name. Default: the branch checked out in repo."},
55
+ "order": {"type": "number", "description": "Position inside the branch when commit order cannot decide."},
56
+ "depends_on": {"$ref": "#/$defs/strings", "description": "IDs of subjects (or names of packages) this subject depends on."},
57
+ "tags": {"$ref": "#/$defs/strings", "description": "Free labels, searched by the filter box."}
58
+ }
59
+ }