vanilla-breeze 0.1.1 → 0.1.3

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 (134) hide show
  1. package/dist/cdn/components/accordion-wc.js +1 -1
  2. package/dist/cdn/components/analytics-panel.js +34 -0
  3. package/dist/cdn/components/audio-player.js +1 -1
  4. package/dist/cdn/components/audio-visualizer.js +2 -2
  5. package/dist/cdn/components/author-index.js +3 -0
  6. package/dist/cdn/components/brand-mark.js +2 -0
  7. package/dist/cdn/components/calendar-wc.js +2 -2
  8. package/dist/cdn/components/card-list.js +1 -1
  9. package/dist/cdn/components/carousel-wc.js +1 -1
  10. package/dist/cdn/components/change-set.js +1 -1
  11. package/dist/cdn/components/chart-wc.js +11 -11
  12. package/dist/cdn/components/chat-input.js +1 -1
  13. package/dist/cdn/components/chat-window.js +1 -1
  14. package/dist/cdn/components/color-palette.js +13 -7
  15. package/dist/cdn/components/color-picker.js +1 -1
  16. package/dist/cdn/components/combo-box.js +1 -1
  17. package/dist/cdn/components/command-palette.js +1 -1
  18. package/dist/cdn/components/comment-wc.js +2 -0
  19. package/dist/cdn/components/compare-surface.js +1 -1
  20. package/dist/cdn/components/component-sampler.js +4 -4
  21. package/dist/cdn/components/consent-banner.js +1 -1
  22. package/dist/cdn/components/content-lens.js +2 -0
  23. package/dist/cdn/components/content-swap.js +1 -1
  24. package/dist/cdn/components/context-menu.js +1 -1
  25. package/dist/cdn/components/data-table.js +1 -1
  26. package/dist/cdn/components/date-picker.js +1 -1
  27. package/dist/cdn/components/day-view.js +1 -1
  28. package/dist/cdn/components/drag-surface.js +1 -1
  29. package/dist/cdn/components/drop-down.js +1 -1
  30. package/dist/cdn/components/emoji-picker.js +1 -1
  31. package/dist/cdn/components/flow-diagram.js +1 -1
  32. package/dist/cdn/components/font-pairer.js +108 -0
  33. package/dist/cdn/components/foot-notes.js +1 -1
  34. package/dist/cdn/components/form-field.js +1 -1
  35. package/dist/cdn/components/gantt-chart.js +1 -1
  36. package/dist/cdn/components/geo-map.js +7 -7
  37. package/dist/cdn/components/glossary-index.js +1 -1
  38. package/dist/cdn/components/glossary-wc.js +1 -1
  39. package/dist/cdn/components/gradient-builder.js +52 -0
  40. package/dist/cdn/components/heading-links.js +1 -1
  41. package/dist/cdn/components/highlight-wc.js +3 -0
  42. package/dist/cdn/components/image-gallery.js +1 -1
  43. package/dist/cdn/components/image-map.js +1 -1
  44. package/dist/cdn/components/impact-effort.js +1 -1
  45. package/dist/cdn/components/include-file.js +1 -1
  46. package/dist/cdn/components/kanban-board.js +1 -1
  47. package/dist/cdn/components/manifest.json +153 -81
  48. package/dist/cdn/components/markdown-editor.js +1 -1
  49. package/dist/cdn/components/markdown-viewer.js +4 -4
  50. package/dist/cdn/components/motion-specimen.js +21 -0
  51. package/dist/cdn/components/note-wc.js +3 -0
  52. package/dist/cdn/components/notification-wc.js +37 -0
  53. package/dist/cdn/components/page-info.js +55 -24
  54. package/dist/cdn/components/page-stats.js +1 -1
  55. package/dist/cdn/components/page-toc.js +1 -1
  56. package/dist/cdn/components/page-tools.js +1 -1
  57. package/dist/cdn/components/page-tour.js +2 -2
  58. package/dist/cdn/components/palette-generator.js +1 -1
  59. package/dist/cdn/components/popularity-index.js +9 -0
  60. package/dist/cdn/components/print-page.js +1 -1
  61. package/dist/cdn/components/qr-code.js +1 -1
  62. package/dist/cdn/components/reader-view.js +2 -2
  63. package/dist/cdn/components/recently-visited.js +27 -0
  64. package/dist/cdn/components/review-surface.js +11 -11
  65. package/dist/cdn/components/selection-menu.js +2 -0
  66. package/dist/cdn/components/semantic-palette.js +30 -0
  67. package/dist/cdn/components/settings-panel.js +55 -51
  68. package/dist/cdn/components/share-wc.js +2 -2
  69. package/dist/cdn/components/short-cuts.js +1 -1
  70. package/dist/cdn/components/site-index.js +1 -1
  71. package/dist/cdn/components/site-map-wc.js +1 -1
  72. package/dist/cdn/components/site-map.js +1 -1
  73. package/dist/cdn/components/site-search.js +3 -3
  74. package/dist/cdn/components/slide-accept.js +1 -1
  75. package/dist/cdn/components/social-embed.js +1 -1
  76. package/dist/cdn/components/spacing-specimen.js +5 -5
  77. package/dist/cdn/components/split-surface.js +1 -1
  78. package/dist/cdn/components/star-rating.js +1 -1
  79. package/dist/cdn/components/story-map.js +1 -1
  80. package/dist/cdn/components/tab-set.js +1 -1
  81. package/dist/cdn/components/text-reader.js +2 -2
  82. package/dist/cdn/components/theme-export.js +18 -0
  83. package/dist/cdn/components/theme-picker.js +59 -59
  84. package/dist/cdn/components/time-index.js +1 -1
  85. package/dist/cdn/components/time-picker.js +1 -1
  86. package/dist/cdn/components/toast-msg.js +1 -1
  87. package/dist/cdn/components/token-specimen.js +25 -20
  88. package/dist/cdn/components/tool-tip.js +1 -1
  89. package/dist/cdn/components/topic-map.js +4 -0
  90. package/dist/cdn/components/trust-filter.js +4 -0
  91. package/dist/cdn/components/type-specimen.js +16 -13
  92. package/dist/cdn/components/user-story.js +8 -8
  93. package/dist/cdn/components/video-player.js +4 -4
  94. package/dist/cdn/components/watch-wc.js +3 -0
  95. package/dist/cdn/components/week-view.js +1 -1
  96. package/dist/cdn/components/work-item.js +14 -14
  97. package/dist/cdn/components/youtube-player.js +1 -1
  98. package/dist/cdn/packs/design-system.full.js +124 -47
  99. package/dist/cdn/packs/effects.full.js +1 -1
  100. package/dist/cdn/packs/kawaii.full.css +1 -1
  101. package/dist/cdn/packs/kawaii.full.js +1 -1
  102. package/dist/cdn/packs/kawaii.theme.css +1 -1
  103. package/dist/cdn/packs/manifest.json +8 -38
  104. package/dist/cdn/packs/ui.full.css +1 -1
  105. package/dist/cdn/packs/ui.full.js +51 -51
  106. package/dist/cdn/packs/ux-planning.full.js +122 -122
  107. package/dist/cdn/themes/alpha1999.css +1 -1
  108. package/dist/cdn/themes/brutalist.css +1 -1
  109. package/dist/cdn/themes/claymorphism.css +1 -1
  110. package/dist/cdn/themes/genai.css +1 -1
  111. package/dist/cdn/themes/kawaii.css +1 -1
  112. package/dist/cdn/themes/magna.css +1 -1
  113. package/dist/cdn/themes/manifest.json +12 -12
  114. package/dist/cdn/themes/nes.css +1 -1
  115. package/dist/cdn/themes/neumorphism.css +1 -1
  116. package/dist/cdn/themes/rough.css +1 -1
  117. package/dist/cdn/themes/startup.css +1 -1
  118. package/dist/cdn/themes/super2026.css +1 -1
  119. package/dist/cdn/themes/win9x.css +1 -1
  120. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  121. package/dist/cdn/vanilla-breeze-charts.js +11 -11
  122. package/dist/cdn/vanilla-breeze-core.css +1 -1
  123. package/dist/cdn/vanilla-breeze-core.js +119 -47
  124. package/dist/cdn/vanilla-breeze-extras.js +154 -74
  125. package/dist/cdn/vanilla-breeze.css +1 -1
  126. package/dist/cdn/vanilla-breeze.js +629 -248
  127. package/package.json +12 -7
  128. package/dist/cdn/packs/retro.bundle.js +0 -2
  129. package/dist/cdn/packs/retro.components.js +0 -1
  130. package/dist/cdn/packs/retro.effects.css +0 -2
  131. package/dist/cdn/packs/retro.effects.js +0 -16
  132. package/dist/cdn/packs/retro.full.css +0 -5
  133. package/dist/cdn/packs/retro.full.js +0 -16
  134. package/dist/cdn/packs/retro.theme.css +0 -2
@@ -1,4 +1,4 @@
1
- var ot=window.matchMedia("(prefers-reduced-motion: reduce)");var te=new Map;function re(n,e,r={}){let s=r.priority??10,t={impl:e,bundle:r.bundle,contract:r.contract,priority:s},i=te.get(n);if(customElements.get(n)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}te.set(n,t),customElements.define(n,e)}var C=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,s,t){e.addEventListener(r,s,t),this.#t.push(()=>e.removeEventListener(r,s,t))}setup(){}teardown(){}};function Q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R=Q();function ce(n){R=n}var $={exec:()=>null};function p(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(b.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var ye=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<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,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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},$e=/^(?:[ \t]*(?:\n|$))+/,Se=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Te=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,H=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,he=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pe=p(he).replace(/bull/g,H).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ae=p(he).replace(/bull/g,H).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ze=/^[^\n]+/,F=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ve=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ee=p(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,H).getRegex(),B="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",G=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pe=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",G).replace("tag",B).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ue=p(j).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),Ce=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ue).getRegex(),X={blockquote:Ce,code:Se,def:ve,fences:Re,heading:Te,hr:P,html:Pe,lheading:pe,list:Ee,newline:$e,paragraph:ue,table:$,text:ze},ne=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),_e={...X,lheading:Ae,table:ne,paragraph:p(j).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ne).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex()},Le={...X,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",G).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:$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(j).replace("hr",P).replace("heading",` *#{1,6} *[^
1
+ var ot=window.matchMedia("(prefers-reduced-motion: reduce)");var te=new Map;function re(n,e,r={}){let s=r.priority??10,t={impl:e,bundle:r.bundle,contract:r.contract,priority:s},i=te.get(n);if(customElements.get(n)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}te.set(n,t),customElements.define(n,e)}var C=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,s,t){e.addEventListener(r,s,t),this.#t.push(()=>e.removeEventListener(r,s,t))}setup(){}teardown(){}};function Q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R=Q();function ce(n){R=n}var $={exec:()=>null};function p(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(b.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var ye=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<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,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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},$e=/^(?:[ \t]*(?:\n|$))+/,Se=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Te=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,H=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,he=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pe=p(he).replace(/bull/g,H).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ae=p(he).replace(/bull/g,H).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ze=/^[^\n]+/,F=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ve=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ee=p(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,H).getRegex(),B="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",G=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pe=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",G).replace("tag",B).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ue=p(j).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),Ce=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ue).getRegex(),X={blockquote:Ce,code:Se,def:ve,fences:Re,heading:Te,hr:P,html:Pe,lheading:pe,list:Ee,newline:$e,paragraph:ue,table:$,text:ze},ne=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),_e={...X,lheading:Ae,table:ne,paragraph:p(j).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ne).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex()},Le={...X,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",G).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:$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(j).replace("hr",P).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",pe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ie=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ge=/^( {2,}|\\)\n(?!\s*$)/,Be=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,M=/[\s\p{P}\p{S}]/u,W=/[^\s\p{P}\p{S}]/u,Me=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,M).getRegex(),de=/(?!~)[\p{P}\p{S}]/u,De=/(?!~)[\s\p{P}\p{S}]/u,Ze=/(?:[^\s\p{P}\p{S}]|~)/u,Ne=p(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ye?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ke=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Oe=p(ke,"u").replace(/punct/g,T).getRegex(),Qe=p(ke,"u").replace(/punct/g,de).getRegex(),fe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",He=p(fe,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,M).replace(/punct/g,T).getRegex(),je=p(fe,"gu").replace(/notPunctSpace/g,Ze).replace(/punctSpace/g,De).replace(/punct/g,de).getRegex(),Fe=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,M).replace(/punct/g,T).getRegex(),Ge=p(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),Xe="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",We=p(Xe,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,M).replace(/punct/g,T).getRegex(),Ue=p(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),Je=p(/^<(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(),Ke=p(G).replace("(?:-->|$)","-->").getRegex(),Ve=p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ke).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),L=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ye=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",L).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),be=p(/^!?\[(label)\]\[(ref)\]/).replace("label",L).replace("ref",F).getRegex(),xe=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",F).getRegex(),et=p("reflink|nolink(?!\\()","g").replace("reflink",be).replace("nolink",xe).getRegex(),se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,U={_backpedal:$,anyPunctuation:Ue,autolink:Je,blockSkip:Ne,br:ge,code:Ie,del:$,delLDelim:$,delRDelim:$,emStrongLDelim:Oe,emStrongRDelimAst:He,emStrongRDelimUnd:Fe,escape:qe,link:Ye,nolink:xe,punctuation:Me,reflink:be,reflinkSearch:et,tag:Ve,text:Be,url:$},tt={...U,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",L).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",L).getRegex()},Z={...U,emStrongRDelimAst:je,emStrongLDelim:Qe,delLDelim:Ge,delRDelim:We,url:p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",se).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",se).getRegex()},rt={...Z,br:p(ge).replace("{2,}","*").getRegex(),text:p(Z.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_={normal:X,gfm:_e,pedantic:Le},z={normal:U,gfm:Z,breaks:rt,pedantic:tt},nt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ie=n=>nt[n];function w(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,ie)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,ie);return n}function le(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}function ae(n,e){let r=n.replace(b.findPipe,(i,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),s=r.split(b.splitPipe),t=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(;t<s.length;t++)s[t]=s[t].trim().replace(b.slashPipe,"|");return s}function v(n,e,r){let s=n.length;if(s===0)return"";let t=0;for(;t<s;){let i=n.charAt(s-t-1);if(i===e&&!r)t++;else if(i!==e&&r)t++;else break}return n.slice(0,s-t)}function st(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function it(n,e=0){let r=e,s="";for(let t of n)if(t===" "){let i=4-r%4;s+=" ".repeat(i),r+=i}else s+=t,r++;return s}function oe(n,e,r,s,t){let i=e.href,l=e.title||null,o=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}function lt(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
3
3
  `).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[o]=l;return o.length>=t.length?i.slice(t.length):i}).join(`
4
4
  `)}var q=class{options;rules;lexer;constructor(n){this.options=n||R}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:v(r,`
@@ -23,7 +23,7 @@ ${c}`:c;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
23
23
  `+u}f=!u.trim(),h+=D+`
24
24
  `,n=n.substring(D.length+1),g=A.slice(k)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),t.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=h}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a of t.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(a.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};a.checked=c.checked,t.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!t.loose){let h=a.tokens.filter(g=>g.type==="space"),c=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));t.loose=c}}if(t.loose)for(let a of t.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return t}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:t}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=ae(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
25
  `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of t)i.rows.push(ae(l,i.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[a]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let r=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
26
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=v(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=st(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),oe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return oe(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+t);(s=h.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){o+=l;continue}else if((s[5]||s[6])&&t%3&&!((t+l)%3)){a+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+a);let c=[...s[0]][0].length,g=n.slice(0,t+s.index+c+l);if(Math.min(t,l)%2){let f=g.slice(1,-1);return{type:"em",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}let u=g.slice(2,-2);return{type:"strong",raw:g,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,r=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*n.length+t);(s=a.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==t))continue;if(s[3]||s[4]){o+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o);let h=[...s[0]][0].length,c=n.slice(0,t+s.index+h+l),g=c.slice(t,-t);return{type:"del",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},x=class N{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R,this.options.tokenizer=this.options.tokenizer||new q,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:b,block:_.normal,inline:z.normal};this.options.pedantic?(r.block=_.pedantic,r.inline=z.pedantic):this.options.gfm&&(r.block=_.gfm,this.options.breaks?r.inline=z.breaks:r.inline=z.gfm),this.tokenizer.rules=r}static get rules(){return{block:_,inline:z}}static lex(e,r){return new N(r).lex(e)}static lexInline(e,r){return new N(r).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
26
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=v(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=st(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),oe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return oe(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+t);(s=h.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){o+=l;continue}else if((s[5]||s[6])&&t%3&&!((t+l)%3)){a+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+a);let c=[...s[0]][0].length,g=n.slice(0,t+s.index+c+l);if(Math.min(t,l)%2){let f=g.slice(1,-1);return{type:"em",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}let u=g.slice(2,-2);return{type:"strong",raw:g,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,r=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,o=t,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*n.length+t);(s=a.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==t))continue;if(s[3]||s[4]){o+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o);let h=[...s[0]][0].length,c=n.slice(0,t+s.index+h+l),g=c.slice(t,-t);return{type:"del",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},x=class N{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R,this.options.tokenizer=this.options.tokenizer||new q,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:b,block:_.normal,inline:z.normal};this.options.pedantic?(r.block=_.pedantic,r.inline=z.pedantic):this.options.gfm&&(r.block=_.gfm,this.options.breaks?r.inline=z.breaks:r.inline=z.gfm),this.tokenizer.rules=r}static get rules(){return{block:_,inline:z}}static lex(e,r){return new N(r).lex(e)}static lexInline(e,r){return new N(r).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
27
  `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(l=>(t=l.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=r.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
28
28
  `:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
29
29
  `)?"":`
@@ -37,7 +37,7 @@ ${c}`:c;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
37
37
  `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t),s=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
38
38
  `)?"":`
39
39
  `)+t.raw,l.text+=`
40
- `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=t[2]?t[2].length:0,s=s.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,o="";for(;e;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,g=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},g),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(h)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},I=class{options;parser;constructor(n){this.options=n||R}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(b.notSpaceStart)?.[0],t=n.replace(b.endingNewline,"")+`
40
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)i=t[2]?t[2].length:0,s=s.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,o="";for(;e;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e,s,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,g=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},g),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(h)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},I=class{options;parser;constructor(n){this.options=n||R}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(b.notSpaceStart)?.[0],t=n.replace(b.endingNewline,"")+`
41
41
  `;return s?'<pre><code class="language-'+w(s)+'">'+(r?t:w(t,!0))+`</code></pre>
42
42
  `:"<pre><code>"+(r?t:w(t,!0))+`</code></pre>
43
43
  `}blockquote({tokens:n}){return`<blockquote>
@@ -55,6 +55,6 @@ ${this.parser.parse(n)}</blockquote>
55
55
  `}tablerow({text:n}){return`<tr>
56
56
  ${n}</tr>
57
57
  `}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
58
- `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${w(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=le(n);if(t===null)return s;n=t;let i='<a href="'+n+'"';return e&&(i+=' title="'+w(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=le(n);if(t===null)return w(r);n=t;let i=`<img src="${n}" alt="${w(r)}"`;return e&&(i+=` title="${w(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:w(n.text)}},J=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},m=class O{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new I,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new J}static parse(e,r){return new O(r).parse(e)}static parseInline(e,r){return new O(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let t=e[s];if(this.options.extensions?.renderers?.[t.type]){let l=t,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=o||"";continue}}let i=t;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=o||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"checkbox":{s+=r.checkbox(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},E=class{options;block;constructor(n){this.options=n||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?x.lex:x.lexInline}provideParser(){return this.block?m.parse:m.parseInline}},at=class{defaults=Q();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=m;Renderer=I;TextRenderer=J;Lexer=x;Tokenizer=q;Hooks=E;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let o=t.renderer.apply(this,l);return o===!1&&(o=i.apply(this,l)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new I(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,o=r.renderer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new q(this.defaults);for(let i in r.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,o=r.tokenizer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new E;for(let i in r.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,o=r.hooks[l],a=t[l];E.passThroughHooks.has(i)?t[l]=h=>{if(this.defaults.async&&E.passThroughHooksRespectAsync.has(i))return(async()=>{let g=await o.call(t,h);return a.call(t,g)})();let c=o.call(t,h);return a.call(t,c)}:t[l]=(...h)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(t,h);return g===!1&&(g=await a.apply(t,h)),g})();let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(l){let o=[];return o.push(i.call(this,l)),t&&(o=o.concat(t.call(this,l))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return x.lex(n,e??this.defaults)}parser(n,e){return m.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},i=this.onError(!!t.silent,!!t.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(t.hooks&&(t.hooks.options=t,t.hooks.block=n),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,o=await(t.hooks?await t.hooks.provideLexer():n?x.lex:x.lexInline)(l,t),a=t.hooks?await t.hooks.processAllTokens(o):o;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser():n?m.parse:m.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer():n?x.lex:x.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let o=(t.hooks?t.hooks.provideParser():n?m.parse:m.parseInline)(l,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(l){return i(l)}}}onError(n,e){return r=>{if(r.message+=`
58
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${w(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=le(n);if(t===null)return s;n=t;let i='<a href="'+n+'"';return e&&(i+=' title="'+w(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=le(n);if(t===null)return w(r);n=t;let i=`<img src="${n}" alt="${w(r)}"`;return e&&(i+=` title="${w(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:w(n.text)}},J=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},m=class O{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new I,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new J}static parse(e,r){return new O(r).parse(e)}static parseInline(e,r){return new O(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let t=e[s];if(this.options.extensions?.renderers?.[t.type]){let l=t,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=o||"";continue}}let i=t;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=o||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"checkbox":{s+=r.checkbox(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},E=class{options;block;constructor(n){this.options=n||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?x.lex:x.lexInline}provideParser(n=this.block){return n?m.parse:m.parseInline}},at=class{defaults=Q();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=m;Renderer=I;TextRenderer=J;Lexer=x;Tokenizer=q;Hooks=E;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let o=t.renderer.apply(this,l);return o===!1&&(o=i.apply(this,l)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new I(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,o=r.renderer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new q(this.defaults);for(let i in r.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,o=r.tokenizer[l],a=t[l];t[l]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new E;for(let i in r.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,o=r.hooks[l],a=t[l];E.passThroughHooks.has(i)?t[l]=h=>{if(this.defaults.async&&E.passThroughHooksRespectAsync.has(i))return(async()=>{let g=await o.call(t,h);return a.call(t,g)})();let c=o.call(t,h);return a.call(t,c)}:t[l]=(...h)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(t,h);return g===!1&&(g=await a.apply(t,h)),g})();let c=o.apply(t,h);return c===!1&&(c=a.apply(t,h)),c}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(l){let o=[];return o.push(i.call(this,l)),t&&(o=o.concat(t.call(this,l))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return x.lex(n,e??this.defaults)}parser(n,e){return m.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},i=this.onError(!!t.silent,!!t.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(t.hooks&&(t.hooks.options=t,t.hooks.block=n),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,o=await(t.hooks?await t.hooks.provideLexer(n):n?x.lex:x.lexInline)(l,t),a=t.hooks?await t.hooks.processAllTokens(o):o;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser(n):n?m.parse:m.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer(n):n?x.lex:x.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let o=(t.hooks?t.hooks.provideParser(n):n?m.parse:m.parseInline)(l,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(l){return i(l)}}}onError(n,e){return r=>{if(r.message+=`
59
59
  Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+w(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},S=new at;function d(n,e){return S.parse(n,e)}d.options=d.setOptions=function(n){return S.setOptions(n),d.defaults=S.defaults,ce(d.defaults),d};d.getDefaults=Q;d.defaults=R;d.use=function(...n){return S.use(...n),d.defaults=S.defaults,ce(d.defaults),d};d.walkTokens=function(n,e){return S.walkTokens(n,e)};d.parseInline=S.parseInline;d.Parser=m;d.parser=m.parse;d.Renderer=I;d.TextRenderer=J;d.Lexer=x;d.lexer=x.lex;d.Tokenizer=q;d.Hooks=E;d.parse=d;var pt=d.options,ut=d.setOptions,gt=d.use,dt=d.walkTokens,kt=d.parseInline;var ft=m.parse,bt=x.lex;var K=class extends C{#t=null;#n=null;#e=null;static get observedAttributes(){return["src"]}setup(){this.#s()}teardown(){this.#n?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,r,s){e==="src"&&s&&r!==s&&this.isConnected&&this.#s()}get parser(){return this.#t}set parser(e){this.#t=typeof e=="function"?e:null}async render(){await this.#s()}async reload(){this.getAttribute("src")&&await this.#s()}#i(){if(this.getAttribute("src"))return null;let e=this.querySelector('script[type="text/markdown"]');if(e)return e.textContent;let r=this.querySelector("template[data-md]");if(r)return r.content.textContent;let s=this.querySelector(":scope > pre");return s?s.textContent:null}async#s(){let e=this.getAttribute("src"),r;if(this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),e){this.#n?.abort(),this.#n=new AbortController,this.setAttribute("data-loading",""),this.#r("markdown-viewer:fetch",{src:e});try{let i=await fetch(e,{signal:this.#n.signal});if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);r=await i.text()}catch(i){if(i.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#r("markdown-viewer:error",{error:i.message});return}this.removeAttribute("data-loading")}else r=this.#i();if(r==null)return;let s;try{s=await(await this.#l())(r)}catch(i){this.setAttribute("data-error",""),this.#r("markdown-viewer:error",{error:i.message});return}this.#e||(this.#e=document.createElement("div"),this.#e.className="md-content",this.#e.setAttribute("part","content"),this.appendChild(this.#e)),this.#e.innerHTML=s,this.#a(),this.setAttribute("data-rendered","");let t=this.getAttribute("ping");if(t&&navigator.sendBeacon?.(t,JSON.stringify({src:e||"inline"})),this.#r("markdown-viewer:rendered",{src:e,node:this.#e}),this.hasAttribute("highlight"))for(let i of this.#e.querySelectorAll('pre > code[class*="language-"]')){let l=i.className.match(/language-(\S+)/)?.[1]||"";this.#r("markdown-viewer:highlight",{node:i,language:l})}}async#l(){return this.#t?this.#t:e=>d.parse(e,{gfm:!0})}#a(){if(!this.#e)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#e.dataset.theme=e)}#r(e,r){this.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,composed:!0}))}};re("markdown-viewer",K);export{K as MarkdownViewer};
60
60
  //# sourceMappingURL=markdown-viewer.js.map
@@ -0,0 +1,21 @@
1
+ var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function f(i,t,n={}){let s=n.priority??10,r={impl:t,bundle:n.bundle,contract:n.contract,priority:s},e=m.get(i);if(customElements.get(i)){if(!e||e.priority>=s){e&&e.priority===s&&e.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}" (priority ${e.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${e.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(e&&e.priority>=s){e.priority===s&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}m.set(i,r),customElements.define(i,t)}var l=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,n,s,r){t.addEventListener(n,s,r),this.#e.push(()=>t.removeEventListener(n,s,r))}setup(){}teardown(){}};var v="1,2,3,4,5,in-1,in-2,in-3,out-1,out-2,out-3,out-4,out-5,elastic-1,elastic-2,squish-1,squish-2",g="instant,fast,normal,slow,slower",p="ms-keyframes",E=`
2
+ @keyframes ms-slide { from { inset-inline-start: 0 } to { inset-inline-start: calc(100% - 1rem) } }
3
+ @keyframes ms-fill { 0% { transform: scaleX(0) } 60% { transform: scaleX(1) } 100% { transform: scaleX(1); opacity: 0.3 } }
4
+ @media (prefers-reduced-motion: reduce) {
5
+ motion-specimen .ms-dot { animation: none !important; inset-inline-start: calc(50% - 0.5rem) !important }
6
+ motion-specimen .ms-bar-fill { animation: none !important; transform: scaleX(0.6) !important; opacity: 0.6 !important }
7
+ }
8
+ `;function k(){if(typeof document>"u"||document.getElementById(p))return;let i=document.createElement("style");i.id=p,i.textContent=E,document.head.append(i)}var b="var(--font-mono, monospace)",h="var(--color-text-muted, #666)",y="var(--color-interactive, oklch(55% 0.2 260))",$="var(--color-surface-sunken, #f1f1f1)",u=class extends l{static observedAttributes=["type","tokens","prefix","duration","show-values","label"];setup(){k(),this.#e()}attributeChangedCallback(){this.isConnected&&this.hasAttribute("data-upgraded")&&this.#e()}#e(){let t=this.getAttribute("type")||"easing",n=this.getAttribute("duration")||"1.2s",s=this.getAttribute("show-values")!=="false",r=this.getAttribute("label")||"",e="";r&&(e+=`<p style="font-weight:600;margin:0 0 var(--size-s,0.75rem)">${r}</p>`),(t==="easing"||t==="both")&&(e+=this.#r(n,s)),(t==="duration"||t==="both")&&(t==="both"&&(e+='<div aria-hidden="true" style="block-size:var(--size-m,1rem)"></div>'),e+=this.#o(s)),this.innerHTML=e,s&&requestAnimationFrame(()=>this.#a())}#t(){return"display:grid;grid-template-columns:5rem 1fr auto;align-items:center;gap:var(--size-s,0.75rem);min-block-size:1.75rem"}#n(){return`font-family:${b};font-size:var(--font-size-sm,0.875rem);color:${h};text-align:end`}#s(){return`font-family:${b};font-size:var(--font-size-xs,0.75rem);color:${h};font-variant-numeric:tabular-nums;white-space:nowrap`}#i(){return"list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--size-2xs,0.375rem)"}#r(t,n){let s=(this.getAttribute("tokens")||v).split(",").map(o=>o.trim()),r=this.getAttribute("prefix")||"--ease-",e=`position:relative;display:block;block-size:0.5rem;background:${$};border-radius:999px`,c=`position:absolute;inset-block-start:50%;inset-inline-start:0;inline-size:1rem;block-size:1rem;background:${y};border-radius:50%;transform:translateY(-50%)`,a=s.map(o=>{let d=`${r}${o}`;return`<li class="ms-row ms-row-ease" role="listitem" style="${this.#t()}">
9
+ <span style="${this.#n()}">${o}</span>
10
+ <span style="${e}" aria-hidden="true">
11
+ <span class="ms-dot" style="${c};animation: ms-slide ${t} var(${d}) infinite alternate"></span>
12
+ </span>
13
+ ${n?`<span class="ms-value" data-var="${d}" style="${this.#s()}"></span>`:""}
14
+ </li>`}).join("");return`<ul class="ms-list" role="list" aria-label="Easing scale" style="${this.#i()}">${a}</ul>`}#o(t){let n=(this.getAttribute("tokens")||g).split(",").map(a=>a.trim()),s=this.getAttribute("prefix")||"--duration-",r=`position:relative;display:block;block-size:0.5rem;background:${$};border-radius:999px;overflow:hidden`,e=`position:absolute;inset-block:0;inset-inline-start:0;inline-size:100%;background:${y};transform-origin:left center;animation-name:ms-fill;animation-iteration-count:infinite;animation-timing-function:linear`,c=n.map(a=>{let o=`${s}${a}`;return`<li class="ms-row ms-row-dur" role="listitem" style="${this.#t()}">
15
+ <span style="${this.#n()}">${a}</span>
16
+ <span style="${r}" aria-hidden="true">
17
+ <span class="ms-bar-fill" style="${e};animation-duration: var(${o})"></span>
18
+ </span>
19
+ ${t?`<span class="ms-value" data-var="${o}" style="${this.#s()}"></span>`:""}
20
+ </li>`}).join("");return`<ul class="ms-list" role="list" aria-label="Duration scale" style="${this.#i()}">${c}</ul>`}#a(){this.querySelectorAll(".ms-value").forEach(t=>{let n=t.getAttribute("data-var");if(!n)return;let s=getComputedStyle(this).getPropertyValue(n).trim();t.textContent=s||"\u2014"})}};f("motion-specimen",u);
21
+ //# sourceMappingURL=motion-specimen.js.map
@@ -0,0 +1,3 @@
1
+ var S=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,i){t.addEventListener(e,n,i),this.#t.push(()=>t.removeEventListener(e,n,i))}setup(){}teardown(){}};var it=window.matchMedia("(prefers-reduced-motion: reduce)");var P=new Map;function F(o,t,e={}){let n=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:n},s=P.get(o);if(customElements.get(o)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}P.set(o,i),customElements.define(o,t)}function j(){let o=globalThis.localStorage;if(!o)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return o.getItem(t)},async setRaw(t,e){o.setItem(t,e)},async removeRaw(t){o.removeItem(t)},async keys(t){let e=[];for(let n=0;n<o.length;n++){let i=o.key(n);i&&i.startsWith(t)&&e.push(i)}return e}}}var k=null;function g(){return k||(k=j()),k}function O(o,t){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${o}:${t}`}function I(o){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${o}:`}function q(o){try{let t=JSON.parse(o);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var x={configure(o={}){k=o.backend??null},async set(o,t,e){let n={data:e,timestamp:Date.now()};await g().setRaw(O(o,t),JSON.stringify(n))},async get(o,t,e){let n=await g().getRaw(O(o,t));if(n==null)return null;let i=q(n);return!i||e?.maxAge!=null&&Date.now()-i.timestamp>e.maxAge?null:i.data},async remove(o,t){await g().removeRaw(O(o,t))},async list(o){let t=I(o),e=await g().keys(t),n=[];for(let i of e){let s=await g().getRaw(i);if(s==null)continue;let r=q(s);r&&n.push({key:i.slice(t.length),data:r.data,timestamp:r.timestamp})}return n},async clear(o){let t=I(o),e=await g().keys(t);for(let n of e)await g().removeRaw(n)},async clearAll(){let o=await g().keys("vb:");for(let t of o)await g().removeRaw(t)},async setMany(o,t){for(let[e,n]of t)await x.set(o,e,n)}};var M="[data-highlights]",D="highlights",J=["yellow","green","blue","pink"],_=8,L=8,K=typeof CSS<"u"&&"highlights"in CSS;function V(o){let t=2166136261;for(let e=0;e<o.length;e++)t^=o.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function z(){return"hn-"+crypto.randomUUID().slice(0,8)}function U(o,t){return getComputedStyle(o).getPropertyValue(`--highlight-${t}`).trim()}var v=null,A=0;function Y(o){if(v){A++;return}v=new CSSStyleSheet;let t=o.map(e=>`::highlight(hn-${e}) { background-color: var(--highlight-${e}); text-decoration-line: underline; text-decoration-color: var(--highlight-${e}); text-underline-offset: 2px; }`).join(`
2
+ `);v.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,v],A=1}function Q(){A--,A<=0&&v&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(o=>o!==v),v=null,A=0)}var d=null,N=null;function Z(){return d||(d=document.createElement("div"),d.className="hn-toolbar",d.setAttribute("role","toolbar"),d.setAttribute("aria-label","Highlight tools"),d.setAttribute("popover","auto"),d.hidden=!0,document.body.appendChild(d),d.addEventListener("toggle",o=>{o.newState==="closed"&&(d.hidden=!0,N=null)}),d)}function R(o,t,e){let n=Z();n.innerHTML="",N=t;let i=t.colors,s=t.element,r=e?.color,l=document.createElement("div");if(l.className="hn-swatches",l.setAttribute("role","group"),l.setAttribute("aria-label","Highlight colors"),i.forEach((a,c)=>{let h=document.createElement("button");h.type="button",h.className="hn-swatch",h.dataset.color=a,h.setAttribute("aria-label",`Highlight ${a}${r===a?" (current)":""}`),h.setAttribute("tabindex",c===0?"0":"-1");let f=U(s,a);f&&(h.style.backgroundColor=f),r===a&&h.setAttribute("aria-pressed","true"),h.addEventListener("click",()=>{e?t._changeColor(e.id,a):t._createFromSelection(a),C()}),l.appendChild(h)}),n.appendChild(l),e){let a=document.createElement("span");a.className="hn-separator",a.setAttribute("aria-hidden","true"),n.appendChild(a);let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent=e.note?"Edit Note":"Add Note",c.addEventListener("click",()=>{w(t,e),C()}),n.appendChild(c);let h=document.createElement("button");h.type="button",h.className="hn-action hn-action-remove",h.textContent="Remove",h.addEventListener("click",()=>{t.removeHighlight(e.id),C()}),n.appendChild(h)}l.addEventListener("keydown",a=>{let c=[...l.querySelectorAll("button")],h=c.indexOf(document.activeElement);if(h<0)return;let f=-1;if(a.key==="ArrowRight"||a.key==="ArrowDown")a.preventDefault(),f=(h+1)%c.length;else if(a.key==="ArrowLeft"||a.key==="ArrowUp")a.preventDefault(),f=(h-1+c.length)%c.length;else if(a.key==="Escape"){C();return}f>=0&&(c[h].setAttribute("tabindex","-1"),c[f].setAttribute("tabindex","0"),c[f].focus())}),n.hidden=!1;try{n.showPopover()}catch{}tt(o),requestAnimationFrame(()=>{let a=n.querySelector(".hn-swatch");a&&a.focus()})}var u=null;function w(o,t){y();let e=o.element,n=b(e,t.startOffset,t.endOffset);if(!n)return;u=document.createElement("div"),u.className="hn-note-panel",u.setAttribute("role","dialog"),u.setAttribute("aria-label","Private note");let i=document.createElement("header");i.className="hn-note-header",i.innerHTML="<small>PRIVATE NOTE</small>",u.appendChild(i);let s=document.createElement("blockquote");s.className="hn-note-quote",s.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,u.appendChild(s);let r=document.createElement("textarea");r.className="hn-note-textarea",r.placeholder="Add a note\u2026",r.value=t.note||"",r.rows=3,r.setAttribute("aria-label","Note for highlighted text"),u.appendChild(r);let l=document.createElement("footer");l.className="hn-note-actions";let a=document.createElement("button");a.type="button",a.className="hn-action hn-action-save",a.textContent="Save",a.addEventListener("click",()=>{o._updateNote(t.id,r.value.trim()),y()});let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent="Cancel",c.addEventListener("click",()=>y()),l.append(a,c),u.appendChild(l),r.addEventListener("keydown",m=>{m.key==="Escape"&&(m.preventDefault(),y()),m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),o._updateNote(t.id,r.value.trim()),y())}),e.style.position="relative",e.appendChild(u);let h=n.getClientRects()[0],f=e.getBoundingClientRect();if(h){let m=h.top-f.top;u.style.top=`${m}px`}requestAnimationFrame(()=>{r.focus(),document.addEventListener("pointerdown",G)})}function G(o){u&&!u.contains(o.target)&&y()}function y(){u&&(document.removeEventListener("pointerdown",G),u.remove(),u=null)}function tt(o){d&&requestAnimationFrame(()=>{let t=d.getBoundingClientRect(),e=t.width||200,n=t.height||40,i=o.top-n-_,s=o.left+o.width/2-e/2;i<L&&(i=o.bottom+_);let r=window.innerWidth-e-L;s=Math.max(L,Math.min(s,r)),d.style.top=`${i}px`,d.style.left=`${s}px`})}function C(){if(d){try{d.hidePopover()}catch{}d.hidden=!0,N=null}}var p=null;function T(o){p||(p=document.createElement("div"),p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true"),p.className="hn-sr-only",document.body.appendChild(p)),p.textContent="",requestAnimationFrame(()=>{p.textContent=o})}function W(o,t,e){let n=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),i=0;for(;n.nextNode();){if(n.currentNode===t)return i+e;i+=(n.currentNode.textContent??"").length}return-1}function b(o,t,e){let n=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),i=0,s=null,r=0,l=null,a=0;for(;n.nextNode();){let c=n.currentNode,h=(c.textContent??"").length;if(!s&&i+h>t&&(s=c,r=t-i),i+h>=e){l=c,a=e-i;break}i+=h}if(!s||!l)return null;try{let c=document.createRange();return c.setStart(s,Math.min(r,(s.textContent??"").length)),c.setEnd(l,Math.min(a,(l.textContent??"").length)),c}catch{return null}}var B=class{#t;#s;#n;#u;#e=[];#a=!K;#c;#l;#h=!1;#d=[];constructor(t){this.#t=t,this.#u=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#s=e&&e!==""?e:location.pathname;let n=t.dataset.highlightsColors;this.#n=n?n.split(",").map(i=>i.trim()).filter(Boolean):[...J],this.#a||Y(this.#n),this.#o(),this.#u||(this.#c=this.#m.bind(this),this.#l=this.#p.bind(this),t.addEventListener("pointerup",this.#c),t.addEventListener("click",this.#l)),t.setAttribute("data-highlights-init",""),this.#y().then(()=>{this.#h||this.#o()})}get colors(){return[...this.#n]}get element(){return this.#t}getHighlights(){return this.#e.map(t=>({...t}))}removeHighlight(t){let e=this.#e.findIndex(n=>n.id===t);e<0||(this.#e.splice(e,1),this.#i(),this.#o(),this.#r("highlights:removed",{id:t}),T("Highlight removed"))}clearAll(){this.#e=[],this.#i(),this.#o()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#e})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#e=e.highlights,this.#i(),this.#o()}catch{}}destroy(){if(!this.#h){if(this.#h=!0,this.#c&&this.#t.removeEventListener("pointerup",this.#c),this.#l&&this.#t.removeEventListener("click",this.#l),this.#a)this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()});else{for(let t of this.#n)CSS.highlights.delete(`hn-${t}`);Q()}this.#f(),this.#t.removeAttribute("data-highlights-init"),N===this&&C(),y()}}#m(){requestAnimationFrame(()=>{if(this.#h||this.#t.hasAttribute("data-selection-menu"))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);if(!this.#t.contains(e.commonAncestorContainer))return;let n=e.getBoundingClientRect();R(n,this,null)})}#p(t){if(this.#t.hasAttribute("data-selection-menu"))return;let e=t.target.closest?.(".hn-margin-annotation");if(e){let i=e.dataset.hnId,s=this.#e.find(r=>r.id===i);if(s){w(this,s);return}}let n=t.target.closest?.("mark[data-hn-id]");if(n){let i=n.dataset.hnId,s=this.#e.find(r=>r.id===i);if(s){this.#r("highlights:clicked",{id:i});let r=n.getBoundingClientRect();R(r,this,s);return}}if(!this.#a){let i=this.#b(t.clientX,t.clientY);if(i){this.#r("highlights:clicked",{id:i.id});let s=b(this.#t,i.startOffset,i.endOffset);s&&R(s.getBoundingClientRect(),this,i)}}}#b(t,e){for(let n of this.#e){let i=b(this.#t,n.startOffset,n.endOffset);if(!i)continue;let s=i.getClientRects();for(let r of s)if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)return n}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let n=e.getRangeAt(0);if(!this.#t.contains(n.commonAncestorContainer))return;let i=W(this.#t,n.startContainer,n.startOffset),s=W(this.#t,n.endContainer,n.endOffset);if(i<0||s<0||i>=s)return;let r=e.toString().trim(),l={id:z(),startOffset:i,endOffset:s,text:r,color:t,note:"",created:Date.now()};this.#e.push(l),this.#i(),this.#o(),e.removeAllRanges(),this.#r("highlights:added",{id:l.id,text:r,color:t,note:""}),T("Highlight added")}_changeColor(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.color=e,this.#i(),this.#o())}_updateNote(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.note=e,this.#i(),this.#g(),this.#r("highlights:note-changed",{id:t,note:e}),T("Note saved"))}async#y(){let t=await x.get(D,this.#s);if(!t||!Array.isArray(t.highlights))return;let e=V(this.#t.textContent);t.contentHash&&t.contentHash!==e?(this.#e=t.highlights.filter(n=>{let i=b(this.#t,n.startOffset,n.endOffset);return i?i.toString().trim()===n.text:!1}),this.#i()):this.#e=t.highlights}#i(){let t={version:1,contentHash:V(this.#t.textContent),highlights:this.#e};x.set(D,this.#s,t).catch(()=>{})}#o(){this.#a?this.#E():this.#v(),this.#g()}#v(){let t=new Map;for(let e of this.#n)t.set(e,[]);for(let e of this.#e){let n=b(this.#t,e.startOffset,e.endOffset);n&&t.has(e.color)&&t.get(e.color).push(n)}for(let[e,n]of t){let i=`hn-${e}`;n.length===0?CSS.highlights.delete(i):CSS.highlights.set(i,new Highlight(...n))}}#E(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let n=e.parentNode;for(;e.firstChild;)n.insertBefore(e.firstChild,e);n.removeChild(e)}),this.#t.normalize();let t=[...this.#e].sort((e,n)=>n.startOffset-e.startOffset);for(let e of t){let n=b(this.#t,e.startOffset,e.endOffset);if(!n)continue;let i=U(this.#t,e.color),s=document.createElement("mark");s.dataset.hnId=e.id,s.dataset.hnColor=e.color,i&&(s.style.backgroundColor=i,s.style.textDecorationColor=i);try{n.surroundContents(s)}catch{let r=n.extractContents();s.appendChild(r),n.insertNode(s)}}}#f(){for(let t of this.#d)t.remove();this.#d=[]}#g(){if(this.#f(),this.#e.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");for(let e of this.#e){let n=b(this.#t,e.startOffset,e.endOffset);if(!n)continue;let i=n.getClientRects();if(i.length===0)continue;let s=i[0],r=this.#t.getBoundingClientRect(),l=s.top-r.top,a=document.createElement("span");a.className="hn-margin-annotation",a.dataset.hnId=e.id,a.setAttribute("aria-hidden","true"),a.style.top=`${l}px`,e.note?(a.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',a.classList.add("hn-has-note")):a.textContent="You highlighted",this.#t.appendChild(a),this.#d.push(a)}}#r(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},$=new WeakMap;function E(o){if($.has(o))return $.get(o);let t=new B(o);return $.set(o,t),t}function X(o=document){o.querySelectorAll(M).forEach(t=>{t.hasAttribute("data-highlights-init")||E(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>X()):X();var et=new MutationObserver(o=>{for(let t of o)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=e;n.matches(M)&&E(n),n.querySelectorAll(M).forEach(i=>{i.hasAttribute("data-highlights-init")||E(i)})}});et.observe(document.documentElement,{childList:!0,subtree:!0});var H=class extends S{#t=!1;setup(){this.#t=!!this.closest("selection-menu");let t=document.createElement("button");t.type="button",t.setAttribute("aria-label",this.#t?"Add private note":"View notes");let e=document.createElement("icon-wc");e.setAttribute("name","sticky-note"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),this.#t?t.addEventListener("click",()=>this.#s()):t.addEventListener("click",()=>this.#n()),this.appendChild(t)}#s(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let n=e.target;n.hasAttribute("data-highlights-init")||n.setAttribute("data-highlights","");let i=E(n),s=i.getHighlights(),r=null;for(let l of s)if(e.text&&l.text&&e.text.includes(l.text.slice(0,20))){r=l;break}if(!r){i._createFromSelection("yellow");let l=i.getHighlights();r=l[l.length-1]}r&&w(i,r),t.dismiss()}#n(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let n=E(e),i=n.getHighlights(),s=i.filter(r=>r.note);s.length>0?w(n,s[0]):i.length>0&&w(n,i[0])}};F("note-wc",H);
3
+ //# sourceMappingURL=note-wc.js.map
@@ -0,0 +1,37 @@
1
+ var B=window.matchMedia("(prefers-reduced-motion: reduce)");var E=new Map;function k(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},a=E.get(s);if(customElements.get(s)){if(!a||a.priority>=i){a&&a.priority===i&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=i){a.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}E.set(s,n),customElements.define(s,t)}var m=class extends HTMLElement{#i=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#i)t();this.#i=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#i.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function T(){let s=globalThis.localStorage;if(!s)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return s.getItem(t)},async setRaw(t,e){s.setItem(t,e)},async removeRaw(t){s.removeItem(t)},async keys(t){let e=[];for(let i=0;i<s.length;i++){let n=s.key(i);n&&n.startsWith(t)&&e.push(n)}return e}}}var y=null;function u(){return y||(y=T()),y}function g(s,t){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${s}:${t}`}function A(s){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${s}:`}function $(s){try{let t=JSON.parse(s);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var h={configure(s={}){y=s.backend??null},async set(s,t,e){let i={data:e,timestamp:Date.now()};await u().setRaw(g(s,t),JSON.stringify(i))},async get(s,t,e){let i=await u().getRaw(g(s,t));if(i==null)return null;let n=$(i);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(s,t){await u().removeRaw(g(s,t))},async list(s){let t=A(s),e=await u().keys(t),i=[];for(let n of e){let a=await u().getRaw(n);if(a==null)continue;let r=$(a);r&&i.push({key:n.slice(t.length),data:r.data,timestamp:r.timestamp})}return i},async clear(s){let t=A(s),e=await u().keys(t);for(let i of e)await u().removeRaw(i)},async clearAll(){let s=await u().keys("vb:");for(let t of s)await u().removeRaw(t)},async setMany(s,t){for(let[e,i]of t)await h.set(s,e,i)}};var d={baseUrl:"/go",headers:{},services:{}},b=class extends Error{constructor(t,e,i,n){super(`VBService(${i}): ${t} ${n}`),this.name="VBServiceError",this.status=t,this.body=e,this.role=i,this.path=n}};function q(s,t){if(!t)return s;let e=s??new URLSearchParams;for(let[i,n]of Object.entries(t))n!=null&&e.set(i,String(n));return e}async function x(s){if((s.headers.get("content-type")??"").includes("application/json"))try{return await s.json()}catch{return null}try{return await s.text()}catch{return null}}var w=class s{static configure(t={}){d={baseUrl:t.baseUrl??d.baseUrl,headers:{...d.headers,...t.headers??{}},services:{...d.services,...t.services??{}}}}static resolve(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");return d.services[t]?C(d.services[t]):d.baseUrl?`${C(d.baseUrl)}/${t}`:`/go/${t}`}static _reset(){d={baseUrl:"/go",headers:{},services:{}}}constructor(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");this.role=t}async get(t,e){return this.#i("GET",t,{params:e})}async post(t,e){return this.#i("POST",t,{body:e})}async patch(t,e){return this.#i("PATCH",t,{body:e})}async delete(t){return this.#i("DELETE",t,{})}async#i(t,e,i){let n=s.resolve(this.role),a=e?e.startsWith("/")?e:`/${e}`:"",r=new URL(`${n}${a}`,globalThis.location?.origin??"http://localhost"),l=q(r.searchParams,i.params);l&&(r.search=l.toString());let o={method:t,headers:{...d.headers}};i.body!==void 0&&(o.body=JSON.stringify(i.body),o.headers["content-type"]="application/json");let p=r.toString(),f=await fetch(p,o),S=await x(f);if(!f.ok)throw new b(f.status,S,this.role,`${a||"/"}`);return S}};function C(s){return s.endsWith("/")?s.slice(0,-1):s}var N={update:"package",alert:"alert-triangle",watch:"eye",system:"settings",message:"mail",stewardship:"shield"};function c(s){return String(s??"").replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}var v=class extends m{#i="panel";#w=null;#e=null;#t=null;#a=null;#s=new Set;#f=[];#o=!1;#r=null;#g=new Set;#p="all";#n=[];setup(){return this.#i=this.getAttribute("mode")==="banner"?"banner":"panel",this.#i==="banner"?this.#v():this.#E()}teardown(){this.#r!=null&&(clearInterval(this.#r),this.#r=null)}async#v(){let t=this.getAttribute("persist");if(t||console.warn("[notification-wc] banner mode requires a persist attribute"),this.dataset.mode="banner",this.dataset.variant=this.getAttribute("variant")||"info",this.dataset.position=this.getAttribute("position")||"top",t){let i=Number(this.getAttribute("expires")??""),n=Number.isFinite(i)&&i>0?i*864e5:void 0,a=await h.get("notifications",t,n?{maxAge:n}:void 0);if(a&&a.dismissed){this.hidden=!0;return}}let e=this.querySelector('[value="dismiss"], [data-dismiss]');e&&(this.#w=e,this.listen(e,"click",this.#S))}#S=async t=>{t.preventDefault();let e=this.getAttribute("persist");e&&await h.set("notifications",e,{dismissed:!0}),this.dispatchEvent(new CustomEvent("notification-wc:dismiss",{bubbles:!0,composed:!0,detail:{id:e}})),this.hidden=!0};async#E(){if(this.dataset.mode="panel",await this.#k(),this.#A(),this.#$(),await this.#c(),this.#u(),this.listen(document,"click",this.#B),this.listen(document,"keydown",this.#L),this.listen(document,"page-watch:add",()=>this.#c()),this.listen(document,"page-watch:remove",()=>this.#c()),this.getAttribute("src")){await this.#y();let t=Number(this.getAttribute("poll"));Number.isFinite(t)&&t>0&&(this.#r=setInterval(()=>this.#y(),t))}}async#k(){let t=this.getAttribute("storage-key")||"notifications",e=await h.get(t,"read-ids");Array.isArray(e)&&(this.#s=new Set(e.filter(i=>typeof i=="string")))}async#b(){let t=this.getAttribute("storage-key")||"notifications";await h.set(t,"read-ids",Array.from(this.#s))}#A(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#e){let t=this.#e.querySelector(".notification-badge");t||(t=document.createElement("span"),t.className="notification-badge",t.hidden=!0,this.#e.appendChild(t))}else{let t=document.createElement("button");t.type="button",t.setAttribute("data-trigger",""),t.className="notification-trigger",t.setAttribute("aria-label","Notifications"),t.innerHTML='<icon-wc name="bell" size="sm"></icon-wc><span class="notification-badge" hidden>0</span>',this.#e=t,this.prepend(t)}this.#a=this.#e.querySelector(".notification-badge"),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.listen(this.#e,"click",this.#N)}#$(){this.#t=document.createElement("div"),this.#t.className="notification-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label","Notifications"),this.#t.hidden=!0;let t=`notification-panel-${crypto.randomUUID().slice(0,8)}`;this.#t.id=t,this.#e?.setAttribute("aria-controls",t),this.#t.innerHTML=`
2
+ <header class="notification-header">
3
+ <strong>Notifications</strong>
4
+ <button type="button" class="notification-mark-all">Mark all read</button>
5
+ </header>
6
+ <nav class="notification-tabs" role="tablist" aria-label="Notification categories">
7
+ <button type="button" role="tab" data-tab="all" aria-selected="true">All</button>
8
+ <button type="button" role="tab" data-tab="watching" aria-selected="false">Watching <span class="notification-tab-count" hidden>0</span></button>
9
+ </nav>
10
+ <ul class="notification-list" role="list" data-tab-panel="all"></ul>
11
+ <ul class="notification-watch-list" role="list" data-tab-panel="watching" hidden></ul>
12
+ <footer class="notification-footer" hidden>
13
+ <em>No notifications</em>
14
+ </footer>
15
+ `,this.appendChild(this.#t);let e=this.#t.querySelector(".notification-mark-all");e&&this.listen(e,"click",this.#R);for(let i of this.#t.querySelectorAll('[role="tab"]'))this.listen(i,"click",this.#q);this.#d()}#l(){let t=Array.from(this.querySelectorAll(":scope > article")),e=new Map;for(let i of t){let n=i.getAttribute("data-id")||i.id||`static-${e.size}`,a=i.getAttribute("data-type")||"update",r=i.getAttribute("data-date")||"",l=i.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim()||n,p=i.querySelector("p")?.textContent?.trim()||"",f=i.querySelector("a");e.set(n,{id:n,type:a,date:r,title:l,body:p,url:f?.getAttribute("href")||null,source:"static"})}for(let i of this.#f)if(!(!i||typeof i.id!="string")){if(i.dismissed){e.delete(i.id);continue}e.set(i.id,{...e.get(i.id),...i,source:"dynamic"})}return Array.from(e.values()).sort((i,n)=>{let a=i.date?Date.parse(i.date):0;return(n.date?Date.parse(n.date):0)-a})}#d(){if(!this.#t)return;let t=this.#t.querySelector(".notification-list"),e=this.#t.querySelector(".notification-footer");if(!t)return;let i=this.#l();t.innerHTML=i.map(n=>this.#C(n)).join(""),e&&(e.hidden=i.length>0);for(let n of t.querySelectorAll("[data-notification-id]"))this.listen(n,"click",this.#M);this.#u()}#C(t){let e=N[t.type]||"bell",i=this.#s.has(t.id),n=t.date?new Date(t.date).toLocaleString():"",a=`
16
+ <icon-wc class="notification-type-icon" name="${c(e)}" size="sm"></icon-wc>
17
+ <div class="notification-body">
18
+ <h4>${c(t.title)}</h4>
19
+ ${t.body?`<p>${c(t.body)}</p>`:""}
20
+ ${n?`<time datetime="${c(t.date)}">${c(n)}</time>`:""}
21
+ </div>
22
+ `,r=t.url?"a":"button",l=t.url?`href="${c(t.url)}"`:'type="button"';return`<li role="listitem" data-notification-id="${c(t.id)}" data-type="${c(t.type||"update")}"${i?" data-read":""}>
23
+ <${r} class="notification-row" ${l}>${a}</${r}>
24
+ </li>`}#u(){if(!this.#a)return;let e=this.#l().filter(i=>!this.#s.has(i.id)).length;e>0?(this.#a.textContent=String(e),this.#a.hidden=!1,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell-dot")):(this.#a.hidden=!0,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell"))}async#c(){try{this.#n=await h.list("watches")}catch{this.#n=[]}this.#m()}#m(){if(!this.#t)return;let t=this.#t.querySelector(".notification-watch-list"),e=this.#t.querySelector(".notification-tab-count");if(t){if(t.innerHTML=this.#n.map(i=>this.#T(i)).join("")||`<li class="notification-empty"><em>You aren't watching any pages yet. Use the &ldquo;Watch&rdquo; button on a page to start.</em></li>`,e){let i=this.#n.length;i>0?(e.textContent=String(i),e.hidden=!1):e.hidden=!0}for(let i of t.querySelectorAll("[data-watch-unwatch]"))this.listen(i,"click",this.#x)}}#T(t){let e=t.data||{},i=e.url||t.key,n=e.title||i,a=e.lastChecked?new Date(e.lastChecked).toLocaleString():"\u2014",r=!!e.lastChanged;return`<li class="notification-watch-item"${r?" data-changed":""}>
25
+ <a class="notification-watch-row" href="${c(i)}">
26
+ <icon-wc class="notification-type-icon" name="eye" size="sm"></icon-wc>
27
+ <div class="notification-body">
28
+ <h4>${c(n)}${r?' <span class="notification-changed-badge">Changed</span>':""}</h4>
29
+ <p>${c(i)}</p>
30
+ <time>Last checked: ${c(a)}</time>
31
+ </div>
32
+ </a>
33
+ <button type="button" class="notification-unwatch" data-watch-unwatch data-watch-key="${c(t.key)}" aria-label="Unwatch ${c(n)}">
34
+ <icon-wc name="x" size="xs"></icon-wc>
35
+ </button>
36
+ </li>`}#q=t=>{let e=t.currentTarget.dataset.tab;if(!e||e===this.#p||(this.#p=e,!this.#t))return;for(let n of this.#t.querySelectorAll('[role="tab"]')){let a=n.dataset.tab===e;n.setAttribute("aria-selected",a?"true":"false")}for(let n of this.#t.querySelectorAll("[data-tab-panel]"))n.hidden=n.dataset.tabPanel!==e;let i=this.#t.querySelector(".notification-footer");i&&(i.hidden=!0)};#x=async t=>{t.preventDefault(),t.stopPropagation();let i=t.currentTarget.getAttribute("data-watch-key");if(!i)return;let n=this.#n.find(a=>a.key===i);await h.remove("watches",i),this.#n=this.#n.filter(a=>a.key!==i),this.#m(),this.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:n?.data?.url||i,subscriptionId:n?.data?.subscriptionId||null}}))};#N=t=>{t.stopPropagation(),this.#o?this.#h():this.#I()};#B=t=>{this.#o&&!this.contains(t.target)&&this.#h()};#L=t=>{t.key==="Escape"&&this.#o&&(t.preventDefault(),this.#h(),this.#e?.focus())};#M=async t=>{let e=t.currentTarget.closest("[data-notification-id]");if(!e)return;let i=e.getAttribute("data-notification-id");i&&(this.#s.has(i)||(this.#s.add(i),e.setAttribute("data-read",""),await this.#b(),this.#u(),this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:i}}))))};#R=async()=>{let t=this.#l();for(let e of t)this.#s.add(e.id);await this.#b(),this.#d();for(let e of t)this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:e.id}}))};#I(){this.#t&&(this.#o=!0,this.#t.hidden=!1,this.#e?.setAttribute("aria-expanded","true"),this.#c(),this.dispatchEvent(new CustomEvent("notification-wc:open",{bubbles:!0,composed:!0})))}#h(){this.#t&&(this.#o=!1,this.#t.hidden=!0,this.#e?.setAttribute("aria-expanded","false"),this.dispatchEvent(new CustomEvent("notification-wc:close",{bubbles:!0,composed:!0})))}async#y(){let t=this.getAttribute("src");if(!t)return;let e,i=0;try{if(t.startsWith("http")||t.startsWith("/")){let o=await fetch(t,{headers:{accept:"application/json"}});if(i=o.status,!o.ok)throw new Error(`${o.status}`);e=await o.json()}else e=await new w(t).get("/")}catch(o){let p=o instanceof b?o.status:i;if(p===404||p===503)return;let f=o instanceof b?`${o.status}`:String(o);console.warn("[notification-wc] failed to fetch",t,f);return}let n=Array.isArray(e)?e:Array.isArray(e?.notifications)?e.notifications:[],a=this.#g,r=a.size===0,l=this.hasAttribute("toast-new")?document.querySelector("toast-msg"):null;for(let o of n)o?.id&&(a.has(o.id)||(this.dispatchEvent(new CustomEvent("notification-wc:new",{bubbles:!0,composed:!0,detail:{notification:o}})),!r&&l&&typeof l.show=="function"&&l.show({message:o.title||o.body||"New notification",variant:o.type==="alert"||o.type==="stewardship"?"warning":"info",duration:5e3})),a.add(o.id));this.#f=n,this.#d()}};k("notification-wc",v);export{v as NotificationWc};
37
+ //# sourceMappingURL=notification-wc.js.map
@@ -1,51 +1,82 @@
1
- var y=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function b(s,e,o={}){let t=o.priority??10,r={impl:e,bundle:o.bundle,contract:o.contract,priority:t},n=v.get(s);if(customElements.get(s)){if(!n||n.priority>=t){n&&n.priority===t&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${o.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${o.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=t){n.priority===t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${n.bundle}". Skipping "${o.bundle}" (first wins at equal priority).`);return}v.set(s,r),customElements.define(s,e)}var l=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,o,t,r){e.addEventListener(o,t,r),this.#e.push(()=>e.removeEventListener(o,t,r))}setup(){}teardown(){}};var h=class s extends l{setup(){this.hasAttribute("auto")&&this.#r(),this.#e(),this.#n(),this.#o()}#e(){for(let e of this.querySelectorAll("time[data-relative]")){let o=e.getAttribute("datetime");if(!o)continue;let t=s.#t(new Date(o));t&&(e.textContent=t)}}static#t(e){let t=Date.now()-e.getTime();if(t<0)return null;let r=Math.floor(t/1e3),n=Math.floor(r/60),a=Math.floor(n/60),i=Math.floor(a/24);return i>365?`${Math.floor(i/365)} year${Math.floor(i/365)!==1?"s":""} ago`:i>30?`${Math.floor(i/30)} month${Math.floor(i/30)!==1?"s":""} ago`:i>0?`${i} day${i!==1?"s":""} ago`:a>0?`${a} hour${a!==1?"s":""} ago`:n>0?`${n} minute${n!==1?"s":""} ago`:"just now"}#n(){let e=this.querySelector("[data-reading-time]");if(!e)return;let o=document.querySelectorAll("[data-signable]");if(!o.length)return;let t=0;for(let n of o){let a=n.textContent?.trim()||"";t+=a.split(/\s+/).filter(Boolean).length}let r=Math.max(1,Math.ceil(t/200));e.textContent=`~${r} min`}#o(){let e="declared",t=this.querySelector(".page-info-badge");t&&t.setAttribute("data-trust",e),this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:e,tier:1},bubbles:!0}))}#r(){let e=f=>document.querySelector(`meta[name="${f}"]`)?.content,o=f=>document.querySelector(`meta[property="${f}"]`)?.content,t=e("author"),r=o("article:author"),n=e("last-modified"),a=e("content-version"),i=e("content-version-url"),d=e("content-provenance"),m=e("ai-tools"),p=e("human-review"),u=e("license"),$=e("license-url"),c={human:"Human written","human-ai-assisted":"Human-written, AI-assisted","ai-human-edited":"AI draft, human edited","ai-human-reviewed":"AI-generated, human-reviewed","ai-generated":"AI-generated",synthesized:"Synthesized from sources",translated:"Translated",migrated:"Migrated content"}[d]||d||"";this.innerHTML=`
1
+ var J=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;function N(t,e,n={}){let i=n.priority??10,o={impl:e,bundle:n.bundle,contract:n.contract,priority:i},r=M.get(t);if(customElements.get(t)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${r.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}M.set(t,o),customElements.define(t,e)}var y=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,n,i,o){e.addEventListener(n,i,o),this.#t.push(()=>e.removeEventListener(n,i,o))}setup(){}teardown(){}};var B="https://vanilla-breeze.com/specs/canonical-document-v1",F=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT","NAV","ASIDE","HEADER","FOOTER","FIGCAPTION","PAGE-INFO","CHANGE-SET","PAGE-TOC","PAGE-TOOLS","PAGE-STATS","CONTENT-LENS","BUTTON","DIALOG","MENU","FORM","DEL"]),U=new Set(["ARTICLE","SECTION","ASIDE","NAV","HEADER","FOOTER","DIV","MAIN","HGROUP","H1","H2","H3","H4","H5","H6","P","BLOCKQUOTE","PRE","HR","OL","UL","LI","DL","DT","DD","TABLE","THEAD","TBODY","TFOOT","TR","TD","TH","CAPTION","FIGURE","DETAILS","SUMMARY","ADDRESS","FORM","FIELDSET","LEGEND"]),V=new Set(["PRE","TEXTAREA"]);function _(t){return!t||t.nodeType!==1?!1:!!(F.has(t.tagName)||t.hasAttribute("hidden")||t.getAttribute("aria-hidden")==="true"||t.getAttribute("data-signable")==="false")}function D(t,e,n){if(_(t))return;let i=U.has(t.tagName),o=n||V.has(t.tagName);for(let r of t.childNodes)if(r.nodeType===3){let s=r.nodeValue||"";if(!s)continue;if(o)x(e,s.normalize("NFC"));else{let a=s.normalize("NFC").replace(/\s+/g," ");if(a===""||a===" "&&(e.text===""||e.text.endsWith(" ")||e.text.endsWith(`
2
+ `)))continue;x(e,a)}}else if(r.nodeType===1){if(r.tagName==="BR"){w(e,`
3
+ `);continue}D(r,e,o)}i&&w(e,`
4
+
5
+ `),t.tagName==="HR"&&w(e,`
6
+
7
+ `)}function x(t,e){t.text+=e}function w(t,e){if(!t.text.endsWith(e)){if(e===`
8
+
9
+ `&&t.text.endsWith(`
10
+ `)){t.text=t.text.replace(/\n+$/,"")+`
11
+
12
+ `;return}e===`
13
+ `&&t.text.endsWith(`
14
+
15
+ `)||(t.text+=e)}}function G(t){let e=[...t.querySelectorAll("[data-signable]")],n=e.filter(o=>!e.some(r=>r!==o&&r.contains(o))),i={text:""};for(let o of n)D(o,i,!1);return i.text.replace(/^\s+/,"").replace(/\s+$/,"")}function f(t,e){return t.querySelector(`meta[name="${$(e)}"]`)?.getAttribute("content")||""}function E(t,e){return t.querySelector(`meta[property="${$(e)}"]`)?.getAttribute("content")||""}function z(t,e){return t.querySelector(`meta[itemprop="${$(e)}"]`)?.getAttribute("content")||""}function R(t,e){return t.querySelector(`link[rel="${$(e)}"]`)?.getAttribute("href")||""}function $(t){return String(t).replace(/[^a-zA-Z0-9:_\-/]/g,"")}function j(t){if(!t)return"";try{let e=new URL(t);e.search="",e.hash="";let n=`${e.protocol}//${e.hostname.toLowerCase()}`;return e.port&&(n+=`:${e.port}`),n+=e.pathname,n}catch{return t}}function O(t){if(!t)return"";let e=String(t).match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:""}function K(t){return E(t,"og:title")||t.title||""}function W(t){let e=f(t,"keywords");return e?e.split(",").map(n=>n.trim()).filter(Boolean):[]}function X(t){let e=new Set;for(let n of t.querySelectorAll('meta[name="concept"]')){let i=(n.getAttribute("content")||"").trim();i&&e.add(i)}return[...e].sort()}function Y(t){return R(t,"license")||f(t,"license")}function H(t,e={}){let n=e.url??t?.location?.href??"",i=O(E(t,"article:published_time")),o=O(f(t,"last-modified")||E(t,"article:modified_time"));return{"@context":B,"@version":1,url:j(n),title:K(t),author:f(t,"author"),authorUrl:E(t,"article:author")||R(t,"author"),published:i,modified:o,version:z(t,"version"),keywords:W(t),concepts:X(t),provenance:f(t,"vb:provenance"),review:f(t,"vb:review"),status:f(t,"vb:status"),license:Y(t),content:G(t)}}function q(t){return JSON.stringify(t)}var C=class t extends y{setup(){this.hasAttribute("auto")&&this.#l(),this.#t(),this.#r(),this.#i(),this.#o()}#t(){for(let e of this.querySelectorAll("time[data-relative]")){let n=e.getAttribute("datetime");if(!n)continue;let i=t.#n(new Date(n));i&&(e.textContent=i)}}static#n(e){let i=Date.now()-e.getTime();if(i<0)return null;let o=Math.floor(i/1e3),r=Math.floor(o/60),s=Math.floor(r/60),a=Math.floor(s/24);return a>365?`${Math.floor(a/365)} year${Math.floor(a/365)!==1?"s":""} ago`:a>30?`${Math.floor(a/30)} month${Math.floor(a/30)!==1?"s":""} ago`:a>0?`${a} day${a!==1?"s":""} ago`:s>0?`${s} hour${s!==1?"s":""} ago`:r>0?`${r} minute${r!==1?"s":""} ago`:"just now"}#r(){let e=this.querySelector("[data-reading-time]");if(!e)return;let n=document.querySelectorAll("[data-signable]");if(!n.length)return;let i=0;for(let r of n){let s=r.textContent?.trim()||"";i+=s.split(/\s+/).filter(Boolean).length}let o=Math.max(1,Math.ceil(i/200));e.textContent=`~${o} min`}#i(){let e=!!document.querySelector('meta[name="vb:provenance"], meta[name="author"]'),n=e?"declared":"undeclared",i=this.querySelector(".page-info-badge");i&&i.setAttribute("data-trust",n),this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:n,tier:e?1:0},bubbles:!0}))}async#o(){let n=document.querySelector('meta[name="vb:signature"]')?.content;if(!n)return;let i=document.querySelector('meta[name="vb:signature-algorithm"]')?.content;if(i&&i!=="ECDSA-P256-SHA256"){this.#e("failed",{reason:`unsupported-algorithm:${i}`});return}let o=document.querySelector('link[rel="author-key"]')?.getAttribute("href");if(!o){this.#e("failed",{reason:"missing-author-key"});return}let r;try{let c=new URL(o,document.baseURI),u=await fetch(c,{credentials:"omit"});if(!u.ok)throw new Error(`status ${u.status}`);let l=await u.json(),h={kty:l.kty,crv:l.crv,x:l.x,y:l.y,use:l.use||"sig",key_ops:["verify"]};r=await crypto.subtle.importKey("jwk",h,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}catch(c){this.#e("key-unavailable",{reason:c.message});return}let s;try{let c=document.querySelector('link[rel="canonical"]')?.href||document.location.href;s=q(H(document,{url:c}))}catch(c){this.#e("failed",{reason:`canonicalize:${c.message}`});return}let a;try{let c=new TextEncoder().encode(s),u=Uint8Array.from(atob(n),l=>l.charCodeAt(0));a=await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},r,u,c)}catch(c){this.#e("failed",{reason:`verify:${c.message}`});return}this.#e(a?"verified":"failed",{reason:a?"ok":"mismatch"})}#e(e,n={}){let o={undeclared:0,declared:1,"domain-anchored":2,verified:3,failed:-1,"key-unavailable":-2}[e]??0,r=this.querySelector(".page-info-badge");if(r){r.setAttribute("data-trust",e);let s=r.getAttribute("aria-label")||"";e==="verified"&&!s.includes("verified")?r.setAttribute("aria-label",`${s} \u2014 verified`.trim()):e==="failed"?r.setAttribute("aria-label",`${s} \u2014 verification failed`.trim()):e==="key-unavailable"&&r.setAttribute("aria-label",`${s} \u2014 author key unavailable`.trim())}this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:e,tier:o,...n},bubbles:!0}))}static#a={human:"Human written","ai-assisted":"Human-written, AI-assisted","ai-generated":"AI-generated",translated:"Translated",synthesized:"Synthesized from sources",migrated:"Migrated content"};static#s={unreviewed:"Unreviewed","fact-checked":"Fact-checked","editor-reviewed":"Editor-reviewed"};static#c={draft:"Draft",published:"Published",archived:"Archived"};static#d(e){if(!e)return"";let n=String(e).trim().split(/\s+/).filter(Boolean);return n.length?n.map(o=>t.#a[o]||o).join(" \xB7 "):""}#l(){let e=d=>document.querySelector(`meta[name="${d}"]`)?.content,n=d=>document.querySelector(`meta[property="${d}"]`)?.content,i=d=>document.querySelector(`meta[itemprop="${d}"]`)?.content,o=d=>document.querySelector(`link[rel="${d}"]`)?.href,r=e("author"),s=n("article:author")||o("author"),a=e("last-modified")||n("article:modified_time"),c=n("article:published_time"),u=e("keywords"),l=e("license"),h=o("license"),p=i("version"),g=e("vb:provenance"),v=e("vb:review"),m=e("vb:status"),S=e("vb:ai-tools"),L=e("vb:version-url"),A=Array.from(document.querySelectorAll('meta[name="concept"]')).map(d=>d.getAttribute("content")?.trim()).filter(Boolean),b=t.#d(g),k=t.#s[v]||v||"",T=t.#c[m]||m||"",P=g||S||v||l,I=a||c||p;this.innerHTML=`
2
16
  <details>
3
17
  <summary>
4
- ${t?`
18
+ ${r?`
5
19
  <span class="page-info-author">
6
- ${r?`<a href="${r}" rel="author">${t}</a>`:t}
20
+ ${s?`<a href="${s}" rel="author">${r}</a>`:r}
7
21
  </span>
8
22
  <span class="page-info-sep" aria-hidden="true">&middot;</span>
9
23
  `:""}
10
- ${n?`
11
- <time datetime="${n}" data-relative>${n}</time>
24
+ ${a?`
25
+ <time datetime="${a}" data-relative>${a}</time>
12
26
  <span class="page-info-sep" aria-hidden="true">&middot;</span>
13
27
  `:""}
14
- ${c?`
28
+ ${b?`
15
29
  <span class="page-info-badge"
16
- data-provenance="${d||""}"
30
+ data-provenance="${g||""}"
17
31
  data-trust="declared"
18
- aria-label="Content provenance: ${c}">
19
- ${c}
32
+ aria-label="Content provenance: ${b}">
33
+ ${b}
20
34
  </span>
21
35
  `:""}
36
+ ${m&&m!=="published"?`
37
+ <span class="page-info-sep" aria-hidden="true">&middot;</span>
38
+ <span class="page-info-badge" data-status="${m}">${T}</span>
39
+ `:""}
22
40
  </summary>
23
41
  <div class="page-info-panel">
24
- ${t?`
42
+ ${r?`
25
43
  <section>
26
44
  <h2 class="page-info-section-heading">Author</h2>
27
- <p>${r?`<a href="${r}" rel="author">${t}</a>`:t}</p>
45
+ <p>${s?`<a href="${s}" rel="author">${r}</a>`:r}</p>
46
+ </section>
47
+ `:""}
48
+ ${I?`
49
+ <section>
50
+ <h2 class="page-info-section-heading">History</h2>
51
+ <dl>
52
+ ${c?`<dl-item><dt>Published</dt><dd><time datetime="${c}" data-relative>${c}</time></dd></dl-item>`:""}
53
+ ${a?`<dl-item><dt>Last updated</dt><dd><time datetime="${a}" data-relative>${a}</time></dd></dl-item>`:""}
54
+ ${p?`<dl-item><dt>Version</dt><dd>${L?`<a href="${L}">${p}</a>`:p}</dd></dl-item>`:""}
55
+ </dl>
28
56
  </section>
29
57
  `:""}
30
- <section>
31
- <h2 class="page-info-section-heading">History</h2>
32
- <dl>
33
- ${n?`<div><dt>Last updated</dt><dd><time datetime="${n}" data-relative>${n}</time></dd></div>`:""}
34
- ${a?`<div><dt>Version</dt><dd>${i?`<a href="${i}">${a}</a>`:a}</dd></div>`:""}
35
- </dl>
36
- </section>
37
- ${d?`
58
+ ${P?`
38
59
  <section>
39
60
  <h2 class="page-info-section-heading">How this was made</h2>
40
61
  <dl>
41
- <div><dt>Authorship</dt><dd>${c}</dd></div>
42
- ${m?`<div><dt>AI tools used</dt><dd>${m}</dd></div>`:""}
43
- ${p?`<div><dt>Human review</dt><dd>${p}</dd></div>`:""}
44
- ${u?`<div><dt>License</dt><dd>${$?`<a href="${$}" rel="license">${u}</a>`:u}</dd></div>`:""}
62
+ ${g?`<dl-item><dt>Authorship</dt><dd>${b}</dd></dl-item>`:""}
63
+ ${S?`<dl-item><dt>AI tools used</dt><dd>${S}</dd></dl-item>`:""}
64
+ ${k?`<dl-item><dt>Review</dt><dd>${k}</dd></dl-item>`:""}
65
+ ${T?`<dl-item><dt>Status</dt><dd>${T}</dd></dl-item>`:""}
66
+ ${l?`<dl-item><dt>License</dt><dd>${h?`<a href="${h}" rel="license">${l}</a>`:l}</dd></dl-item>`:""}
67
+ </dl>
68
+ </section>
69
+ `:""}
70
+ ${u||A.length?`
71
+ <section>
72
+ <h2 class="page-info-section-heading">Topic</h2>
73
+ <dl>
74
+ ${A.length?`<dl-item><dt>Concepts</dt><dd>${A.map(d=>`<a href="/topics/${d}/" rel="tag" data-concept="${d}">${d}</a>`).join(", ")}</dd></dl-item>`:""}
75
+ ${u?`<dl-item><dt>Keywords</dt><dd>${u}</dd></dl-item>`:""}
45
76
  </dl>
46
77
  </section>
47
78
  `:""}
48
79
  </div>
49
80
  </details>
50
- `}};b("page-info",h);export{h as PageInfo};
81
+ `}};N("page-info",C);export{C as PageInfo};
51
82
  //# sourceMappingURL=page-info.js.map
@@ -1,2 +1,2 @@
1
- var b=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function h(i,n,t={}){let o=t.priority??10,r={impl:n,bundle:t.bundle,contract:t.contract,priority:o},e=m.get(i);if(customElements.get(i)){if(!e||e.priority>=o){e&&e.priority===o&&e.impl!==n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}" (priority ${e.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${e.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(e&&e.priority>=o){e.priority===o&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}m.set(i,r),customElements.define(i,n)}var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let n of this.#e)n();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(n,t,o,r){n.addEventListener(t,o,r),this.#e.push(()=>n.removeEventListener(t,o,r))}setup(){}teardown(){}};var l=class i extends c{setup(){if(this.querySelector("dl"))return;let n=this.dataset.for;if(!n)return;let t=document.getElementById(n);if(!t)return;let o=parseInt(this.dataset.wpm,10)||238,r=(this.dataset.show||"reading-time").split(",").map(a=>a.trim()),u=(t.textContent?.trim()||"").split(/\s+/).filter(Boolean).length,f=Math.max(1,Math.ceil(u/o)),d=document.createElement("dl");if(d.className="page-stats-list",r.includes("reading-time")&&d.appendChild(this.#e("Reading time",`<time datetime="PT${f}M">${f} min read</time>`)),r.includes("word-count")&&d.appendChild(this.#e("Word count",`${u.toLocaleString()} words`)),r.includes("last-modified")){let a=this.#t();if(a){let p=a.toISOString().split("T")[0],y=i.#n(a);d.appendChild(this.#e("Last updated",`<time datetime="${p}" data-relative>${y}</time>`))}}this.appendChild(d)}#e(n,t){let o=document.createElement("dl-item"),r=document.createElement("dt");r.className="sr-only",r.textContent=n;let e=document.createElement("dd");return e.innerHTML=t,o.appendChild(r),o.appendChild(e),o}#t(){let n=document.querySelector('meta[name="last-modified"]');if(n?.content){let o=new Date(n.content);if(!isNaN(o))return o}let t=new Date(document.lastModified);return isNaN(t)?null:t}static#n(n){let t=Date.now()-n.getTime();if(t<0)return n.toLocaleDateString();let o=Math.floor(t/1e3),r=Math.floor(o/60),e=Math.floor(r/60),s=Math.floor(e/24);return s>365?`${Math.floor(s/365)} year${Math.floor(s/365)!==1?"s":""} ago`:s>30?`${Math.floor(s/30)} month${Math.floor(s/30)!==1?"s":""} ago`:s>0?`${s} day${s!==1?"s":""} ago`:e>0?`${e} hour${e!==1?"s":""} ago`:r>0?`${r} minute${r!==1?"s":""} ago`:"just now"}};h("page-stats",l);export{l as PageStats};
1
+ var y=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function h(i,n,t={}){let o=t.priority??10,r={impl:n,bundle:t.bundle,contract:t.contract,priority:o},e=m.get(i);if(customElements.get(i)){if(!e||e.priority>=o){e&&e.priority===o&&e.impl!==n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}" (priority ${e.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${e.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(e&&e.priority>=o){e.priority===o&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}m.set(i,r),customElements.define(i,n)}var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let n of this.#e)n();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(n,t,o,r){n.addEventListener(t,o,r),this.#e.push(()=>n.removeEventListener(t,o,r))}setup(){}teardown(){}};var l=class i extends c{setup(){if(this.querySelector("dl"))return;let n=this.dataset.for;if(!n)return;let t=document.getElementById(n);if(!t)return;let o=parseInt(this.dataset.wpm,10)||238,r=(this.dataset.show||"reading-time").split(",").map(a=>a.trim()),u=(t.textContent?.trim()||"").split(/\s+/).filter(Boolean).length,f=Math.max(1,Math.ceil(u/o)),d=document.createElement("dl");if(d.className="page-stats-list",r.includes("reading-time")&&d.appendChild(this.#e("Reading time",`<time datetime="PT${f}M">${f} min read</time>`)),r.includes("word-count")&&d.appendChild(this.#e("Word count",`${u.toLocaleString()} words`)),r.includes("last-modified")){let a=this.#t();if(a){let p=a.toISOString().split("T")[0],b=i.#n(a);d.appendChild(this.#e("Last updated",`<time datetime="${p}" data-relative>${b}</time>`))}}this.appendChild(d)}#e(n,t){let o=document.createElement("dl-item"),r=document.createElement("dt");r.className="visually-hidden",r.textContent=n;let e=document.createElement("dd");return e.innerHTML=t,o.appendChild(r),o.appendChild(e),o}#t(){let n=document.querySelector('meta[name="last-modified"]');if(n?.content){let o=new Date(n.content);if(!isNaN(o))return o}let t=new Date(document.lastModified);return isNaN(t)?null:t}static#n(n){let t=Date.now()-n.getTime();if(t<0)return n.toLocaleDateString();let o=Math.floor(t/1e3),r=Math.floor(o/60),e=Math.floor(r/60),s=Math.floor(e/24);return s>365?`${Math.floor(s/365)} year${Math.floor(s/365)!==1?"s":""} ago`:s>30?`${Math.floor(s/30)} month${Math.floor(s/30)!==1?"s":""} ago`:s>0?`${s} day${s!==1?"s":""} ago`:e>0?`${e} hour${e!==1?"s":""} ago`:r>0?`${r} minute${r!==1?"s":""} ago`:"just now"}};h("page-stats",l);export{l as PageStats};
2
2
  //# sourceMappingURL=page-stats.js.map
@@ -1,2 +1,2 @@
1
- var k=window.matchMedia("(prefers-reduced-motion: reduce)");var b=new Map;function y(r,e,t={}){let i=t.priority??10,o={impl:e,bundle:t.bundle,contract:t.contract,priority:i},s=b.get(r);if(customElements.get(r)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}b.set(r,o),customElements.define(r,e)}var h=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,o){e.addEventListener(t,i,o),this.#e.push(()=>e.removeEventListener(t,i,o))}setup(){}teardown(){}};var m=class extends h{#e;#t=[];#s=new Map;#a;#i;#o;#r=!1;setup(){requestAnimationFrame(()=>this.#c())}teardown(){this.#e?.disconnect(),clearTimeout(this.#o)}#c(){this.#r=this.#h(),this.#r?this.#u():this.#g(),this.#w(),this.#f(),this.#b()}#h(){return this.querySelector("nav, details")!==null}#u(){this.#i=this.querySelector("details");let e=this.querySelectorAll('a[href^="#"]');for(let t of e){let i=t.getAttribute("href");if(!i)continue;let o=i.slice(1);if(o){let s=document.getElementById(o);s&&(this.#t.push(s),this.#s.set(o,t),t.classList.contains("link")||t.classList.add("link"),t.addEventListener("click",c=>{c.preventDefault(),this.#d(s)}))}}}#f(){this.#a=window.matchMedia("(min-width: 64rem)"),this.listen(this.#a,"change",this.#m),this.listen(window,"resize",this.#p)}#m=e=>{e.matches&&this.#i&&(this.#i.open=!0)};#p=()=>{clearTimeout(this.#o),this.#o=setTimeout(()=>this.#n(),150)};#b(){this.listen(window,"hashchange",this.#y),this.#n()}#y=()=>{this.#n()};#n(){let e=window.location.hash.slice(1);e&&this.#s.has(e)&&this.#l(e)}#l(e){for(let i of this.#s.values())i.classList.remove("active"),i.removeAttribute("aria-current");let t=this.#s.get(e);t&&(t.classList.add("active"),t.setAttribute("aria-current","true"))}#g(){let e=this.getAttribute("levels")||"h2,h3",t=this.getAttribute("scope")||"main",i=this.getAttribute("title")||"On this page",o=document.querySelector(t);if(!o)return;let s=e.split(",").map(n=>n.trim()).join(",");if(this.#t=Array.from(o.querySelectorAll(s)).filter(n=>n.id).filter(n=>!n.hasAttribute("data-toc-ignore")&&!n.closest("[data-toc-ignore]")),this.#t.length===0)return;this.#i=document.createElement("details"),this.#i.className="details",this.#i.open=!0;let c=this.#i,u=document.createElement("summary");u.className="summary",u.textContent=i,c.appendChild(u);let l=document.createElement("nav");l.className="nav",l.setAttribute("aria-label",i);let f=document.createElement("ul");f.className="list";let g=e.split(",").map(n=>n.trim().toLowerCase());for(let n of this.#t){let v=n.tagName.toLowerCase(),p=g.indexOf(v),w=p>=0?p:0,d=document.createElement("li");d.className="item",d.dataset.level=String(w);let a=document.createElement("a");a.href=`#${n.id}`,a.className="link",a.textContent=this.#v(n),a.addEventListener("click",E=>{E.preventDefault(),this.#d(n)}),d.appendChild(a),f.appendChild(d),this.#s.set(n.id,a)}l.appendChild(f),c.appendChild(l),this.appendChild(c)}#v(e){let t=e.cloneNode(!0);return t.querySelectorAll(".heading-anchor").forEach(o=>o.remove()),t.textContent.trim()}#d(e){let t=new URL(window.location.href);t.hash=e.id,window.history.pushState(null,"",t),e.scrollIntoView({behavior:"smooth",block:"start"}),e.focus(),this.dispatchEvent(new CustomEvent("page-toc:navigate",{bubbles:!0,detail:{id:e.id}}))}#w(){if(this.#t.length===0)return;let e=new Set;this.#e=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?e.add(i.target.id):e.delete(i.target.id);this.#E(e)},{rootMargin:"-80px 0px -70% 0px",threshold:0});for(let t of this.#t)this.#e.observe(t)}#E(e){for(let t of this.#t)if(e.has(t.id)){this.#l(t.id);return}this.#n()}refresh(){this.#r||(this.innerHTML=""),this.#s.clear(),this.#t=[],this.#e?.disconnect(),this.#c()}};y("page-toc",m);export{m as PageToc};
1
+ var w=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function y(a,e,t={}){let i=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:i},n=g.get(a);if(customElements.get(a)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}g.set(a,s),customElements.define(a,e)}var f=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,s){e.addEventListener(t,i,s),this.#t.push(()=>e.removeEventListener(t,i,s))}setup(){}teardown(){}};var p=class extends f{#t;#i=[];#n=new Map;#a;#e;#r;#o=!1;setup(){requestAnimationFrame(()=>this.#c())}teardown(){this.#t?.disconnect(),clearTimeout(this.#r)}#c(){this.#o=this.#h(),this.#o?this.#u():this.#y(),this.#w(),this.#f(),this.#b()}#h(){return this.querySelector("nav, details")!==null}#u(){this.#e=this.querySelector("details");let e=this.querySelectorAll('a[href^="#"]');for(let t of e){let i=t.getAttribute("href");if(!i)continue;let s=i.slice(1);if(s){let n=document.getElementById(s);n&&(this.#i.push(n),this.#n.set(s,t),t.classList.contains("link")||t.classList.add("link"),t.addEventListener("click",c=>{c.preventDefault(),this.#d(n)}))}}}#f(){this.#a=window.matchMedia("(min-width: 64rem)"),this.listen(this.#a,"change",this.#m),this.listen(window,"resize",this.#p)}#m=e=>{e.matches&&this.#e&&(this.#e.open=!0)};#p=()=>{clearTimeout(this.#r),this.#r=setTimeout(()=>this.#s(),150)};#b(){this.listen(window,"hashchange",this.#g),this.#s()}#g=()=>{this.#s()};#s(){let e=window.location.hash.slice(1);e&&this.#n.has(e)&&this.#l(e)}#l(e){for(let i of this.#n.values())i.classList.remove("active"),i.removeAttribute("aria-current");let t=this.#n.get(e);t&&(t.classList.add("active"),t.setAttribute("aria-current","true"))}#y(){let e=(this.getAttribute("levels")||"h2,h3").split(",").map(r=>r.trim().toLowerCase()),t=this.getAttribute("scope")||"main",i=this.getAttribute("title")||"On this page",s=document.querySelector(t);if(!s||(this.#i=Array.from(s.querySelectorAll(e.join(","))).filter(r=>r.id).filter(r=>!r.hasAttribute("data-toc-ignore")&&!r.closest("[data-toc-ignore]")),this.#i.length===0))return;let n={depth:-1,children:[]},c=[n];for(let r of this.#i){let l=e.indexOf(r.tagName.toLowerCase());for(;c[c.length-1].depth>=l;)c.pop();let o={heading:r,depth:l,children:[]};c[c.length-1].children.push(o),c.push(o)}let b=r=>{let l=document.createElement("ul");l.className="list";for(let o of r){let h=document.createElement("li");h.className="item",h.dataset.level=String(o.depth);let d=document.createElement("a");d.href=`#${o.heading.id}`,d.className="link",d.textContent=this.#v(o.heading),d.addEventListener("click",v=>{v.preventDefault(),this.#d(o.heading)}),h.appendChild(d),o.children.length&&h.appendChild(b(o.children)),l.appendChild(h),this.#n.set(o.heading.id,d)}return l};this.#e=document.createElement("details"),this.#e.className="details",this.#e.open=!0;let m=document.createElement("summary");m.className="summary",m.textContent=i,this.#e.appendChild(m);let u=document.createElement("nav");u.className="nav",u.setAttribute("aria-label",i),u.appendChild(b(n.children)),this.#e.appendChild(u),this.appendChild(this.#e)}#v(e){let t=e.cloneNode(!0);return t.querySelectorAll(".heading-anchor").forEach(s=>s.remove()),t.textContent.trim()}#d(e){let t=new URL(window.location.href);t.hash=e.id,window.history.pushState(null,"",t),e.scrollIntoView({behavior:"smooth",block:"start"}),e.focus(),this.dispatchEvent(new CustomEvent("page-toc:navigate",{bubbles:!0,detail:{id:e.id}}))}#w(){if(this.#i.length===0)return;let e=new Set;this.#t=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?e.add(i.target.id):e.delete(i.target.id);this.#E(e)},{rootMargin:"-80px 0px -70% 0px",threshold:0});for(let t of this.#i)this.#t.observe(t)}#E(e){for(let t of this.#i)if(e.has(t.id)){this.#l(t.id);return}this.#s()}refresh(){this.#o||(this.innerHTML=""),this.#n.clear(),this.#i=[],this.#t?.disconnect(),this.#c()}};y("page-toc",p);export{p as PageToc};
2
2
  //# sourceMappingURL=page-toc.js.map
@@ -1,2 +1,2 @@
1
- var h=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function c(o,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=l.get(o);if(customElements.get(o)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(o,n),customElements.define(o,t)}var r=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};var d=0,a=class extends r{#t=null;#e=null;#o=null;#i=!1;#s=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#a(),this.#l();let t=this.dataset.breakpoint||"48rem";this.#o=matchMedia(`(max-width: ${t})`),this.#n(this.#o),this.listen(this.#o,"change",e=>this.#n(e)),this.#s=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&this.#i&&this.#d()}),this.#s.observe(this,{childList:!0})}teardown(){this.#s?.disconnect(),this.#s=null,this.#i&&this.#r(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null}get tools(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-page-tools-internal"))}#a(){if((this.dataset.orientation||"auto")!=="auto")return;let i=(this.dataset.position||"sticky")==="inline"?"horizontal":"vertical";this.dataset.resolvedOrientation=i}#l(){let t=`pt-${++d}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0,this.#t.innerHTML=`<icon-wc name="${e}" size="md"></icon-wc>`,this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.#e.hidden=!0,this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"toggle",n=>{n.newState==="closed"&&this.#t.focus()})}#n(t){t.matches??t?this.#c():this.#r()}#c(){if(this.#i)return;this.#i=!0;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#t.hidden=!1,this.#e.hidden=!1,this.dataset.collapsed=""}#r(){if(!this.#i)return;this.#i=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.#e.hidden=!0,delete this.dataset.collapsed}#d(){let t=this.tools;for(let e of t)this.#e.appendChild(e)}};c("page-tools",a);export{a as PageTools};
1
+ var h=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function c(o,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=l.get(o);if(customElements.get(o)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(o,n),customElements.define(o,t)}var r=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};var d=0,a=class extends r{#t=null;#e=null;#o=null;#i=!1;#s=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#a(),this.#l();let t=this.dataset.breakpoint||"48rem";this.#o=matchMedia(`(max-width: ${t})`),this.#n(this.#o),this.listen(this.#o,"change",e=>this.#n(e)),this.#s=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&this.#i&&this.#d()}),this.#s.observe(this,{childList:!0})}teardown(){this.#s?.disconnect(),this.#s=null,this.#i&&this.#r(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null}get tools(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-page-tools-internal"))}#a(){if((this.dataset.orientation||"auto")!=="auto")return;let i=(this.dataset.position||"sticky")==="inline"?"horizontal":"vertical";this.dataset.resolvedOrientation=i}#l(){let t=`pt-${++d}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0,this.#t.innerHTML=`<icon-wc name="${e}" size="md"></icon-wc>`,this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.#e.hidden=!0,this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"toggle",n=>{n.newState==="closed"&&this.#t.focus()})}#n(t){t.matches??t?this.#c():this.#r()}#c(){if(this.#i)return;this.#i=!0;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#t.hidden=!1,this.#e.hidden=!1,this.dataset.collapsed=""}#r(){if(!this.#i)return;this.#i=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.#e.hidden=!0,delete this.dataset.collapsed}#d(){let t=this.tools;for(let e of t)this.#e.appendChild(e)}};c("page-tools",a);export{a as PageTools};
2
2
  //# sourceMappingURL=page-tools.js.map