vanilla-breeze 0.4.1 → 0.6.0

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 (282) hide show
  1. package/custom-elements.json +23012 -11383
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +1 -1
  4. package/dist/cdn/components/ai-chat.js +9 -6
  5. package/dist/cdn/components/ai-summary.js +4 -2
  6. package/dist/cdn/components/analytics-panel.js +19 -21
  7. package/dist/cdn/components/audio-player.js +17 -7
  8. package/dist/cdn/components/audio-visualizer.js +3 -3
  9. package/dist/cdn/components/author-index.js +2 -2
  10. package/dist/cdn/components/brand-mark.js +1 -1
  11. package/dist/cdn/components/bread-crumb.js +1 -1
  12. package/dist/cdn/components/calendar-wc.js +2 -2
  13. package/dist/cdn/components/card-list.js +1 -1
  14. package/dist/cdn/components/carousel-wc.js +1 -1
  15. package/dist/cdn/components/change-set.js +1 -11
  16. package/dist/cdn/components/chart-wc.js +32 -32
  17. package/dist/cdn/components/chat-input.js +1 -1
  18. package/dist/cdn/components/chat-window.js +1 -1
  19. package/dist/cdn/components/color-picker.js +1 -1
  20. package/dist/cdn/components/combo-box.js +1 -1
  21. package/dist/cdn/components/command-palette.js +1 -1
  22. package/dist/cdn/components/comment-box.js +50 -49
  23. package/dist/cdn/components/comment-thread.js +50 -49
  24. package/dist/cdn/components/comment-wc.js +1 -1
  25. package/dist/cdn/components/compare-surface.js +1 -1
  26. package/dist/cdn/components/consent-banner.js +1 -1
  27. package/dist/cdn/components/content-lens.js +1 -1
  28. package/dist/cdn/components/content-swap.js +1 -1
  29. package/dist/cdn/components/context-menu.js +1 -1
  30. package/dist/cdn/components/data-table.js +1 -1
  31. package/dist/cdn/components/date-picker.js +1 -1
  32. package/dist/cdn/components/day-view.js +1 -1
  33. package/dist/cdn/components/diagram-wc.js +2 -2
  34. package/dist/cdn/components/drag-surface.js +1 -1
  35. package/dist/cdn/components/drop-down.js +1 -1
  36. package/dist/cdn/components/emoji-picker.js +1 -1
  37. package/dist/cdn/components/flow-diagram.js +1 -1
  38. package/dist/cdn/components/foot-notes.js +1 -1
  39. package/dist/cdn/components/form-field.js +1 -1
  40. package/dist/cdn/components/geo-map.js +170 -54
  41. package/dist/cdn/components/glossary-index.js +1 -1
  42. package/dist/cdn/components/glossary-wc.js +1 -1
  43. package/dist/cdn/components/heading-links.js +1 -1
  44. package/dist/cdn/components/highlight-wc.js +6 -2
  45. package/dist/cdn/components/icon-wc.js +11 -10
  46. package/dist/cdn/components/image-gallery.js +1 -1
  47. package/dist/cdn/components/image-map.js +1 -1
  48. package/dist/cdn/components/include-file.js +1 -1
  49. package/dist/cdn/components/manifest.json +101 -101
  50. package/dist/cdn/components/markdown-editor.js +60 -1
  51. package/dist/cdn/components/markdown-viewer.js +50 -49
  52. package/dist/cdn/components/nav-bar.js +1 -1
  53. package/dist/cdn/components/note-wc.js +6 -2
  54. package/dist/cdn/components/notification-wc.js +33 -32
  55. package/dist/cdn/components/page-info.js +6 -72
  56. package/dist/cdn/components/page-stats.js +1 -1
  57. package/dist/cdn/components/page-toc.js +1 -1
  58. package/dist/cdn/components/page-tools.js +1 -1
  59. package/dist/cdn/components/page-tour.js +1 -38
  60. package/dist/cdn/components/pager-wc.js +1 -1
  61. package/dist/cdn/components/poll-wc.js +1 -1
  62. package/dist/cdn/components/pop-over.js +1 -1
  63. package/dist/cdn/components/popularity-index.js +1 -8
  64. package/dist/cdn/components/print-page.js +1 -1
  65. package/dist/cdn/components/progress-tracker.js +1 -1
  66. package/dist/cdn/components/qr-code.js +1 -1
  67. package/dist/cdn/components/reaction-bar.js +1 -1
  68. package/dist/cdn/components/reader-view.js +25 -25
  69. package/dist/cdn/components/reading-progress.js +1 -1
  70. package/dist/cdn/components/recently-visited.js +1 -26
  71. package/dist/cdn/components/score-card.js +21 -5
  72. package/dist/cdn/components/selection-menu.js +1 -1
  73. package/dist/cdn/components/settings-panel.js +88 -142
  74. package/dist/cdn/components/share-wc.js +2 -2
  75. package/dist/cdn/components/short-cuts.js +1 -1
  76. package/dist/cdn/components/site-index.js +1 -10
  77. package/dist/cdn/components/site-map.js +1 -1
  78. package/dist/cdn/components/site-search.js +1 -51
  79. package/dist/cdn/components/slide-accept.js +1 -1
  80. package/dist/cdn/components/social-embed.js +1 -1
  81. package/dist/cdn/components/split-surface.js +1 -1
  82. package/dist/cdn/components/star-rating.js +1 -1
  83. package/dist/cdn/components/status-wc.js +1 -1
  84. package/dist/cdn/components/stepper-wc.js +1 -1
  85. package/dist/cdn/components/tab-set.js +1 -1
  86. package/dist/cdn/components/text-reader.js +2 -2
  87. package/dist/cdn/components/theme-picker.js +84 -81
  88. package/dist/cdn/components/time-index.js +1 -11
  89. package/dist/cdn/components/time-picker.js +1 -1
  90. package/dist/cdn/components/toast-msg.js +6 -6
  91. package/dist/cdn/components/tool-tip.js +1 -1
  92. package/dist/cdn/components/topic-map.js +6 -3
  93. package/dist/cdn/components/trust-filter.js +1 -3
  94. package/dist/cdn/components/version-switcher.js +5 -15
  95. package/dist/cdn/components/video-player.js +67 -9
  96. package/dist/cdn/components/watch-wc.js +6 -2
  97. package/dist/cdn/components/week-view.js +1 -1
  98. package/dist/cdn/components/youtube-player.js +1 -1
  99. package/dist/cdn/emoji-extended.js +2 -0
  100. package/dist/cdn/fonts/atkinson-hyperlegible-OFL.txt +93 -0
  101. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-italic.woff2 +0 -0
  102. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
  103. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-italic.woff2 +0 -0
  104. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
  105. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-italic.woff2 +0 -0
  106. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2 +0 -0
  107. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-italic.woff2 +0 -0
  108. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2 +0 -0
  109. package/dist/cdn/fonts/latinmodern-math-GUST-LICENSE.txt +30 -0
  110. package/dist/cdn/fonts/latinmodern-math.woff2 +0 -0
  111. package/dist/cdn/fonts/math-fonts.css +14 -0
  112. package/dist/cdn/packs/effects.full.css +1 -1
  113. package/dist/cdn/packs/effects.full.js +1 -1
  114. package/dist/cdn/packs/fonts-display.full.css +1 -1
  115. package/dist/cdn/packs/fonts-display.theme.css +1 -1
  116. package/dist/cdn/packs/icons.bundle.js +1 -1
  117. package/dist/cdn/packs/icons.full.css +1 -1
  118. package/dist/cdn/packs/icons.theme.css +1 -1
  119. package/dist/cdn/packs/journal.effects.css +1 -1
  120. package/dist/cdn/packs/journal.full.css +1 -1
  121. package/dist/cdn/packs/kawaii.effects.css +1 -1
  122. package/dist/cdn/packs/kawaii.full.css +2 -2
  123. package/dist/cdn/packs/kawaii.full.js +6 -6
  124. package/dist/cdn/packs/kawaii.theme.css +1 -1
  125. package/dist/cdn/packs/manifest.json +17 -17
  126. package/dist/cdn/packs/memphis.full.css +1 -1
  127. package/dist/cdn/packs/memphis.theme.css +1 -1
  128. package/dist/cdn/packs/ui.full.css +1 -1
  129. package/dist/cdn/packs/ui.full.js +88 -85
  130. package/dist/cdn/themes/8bit.css +1 -1
  131. package/dist/cdn/themes/8bit.tokens.json +1 -1
  132. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  133. package/dist/cdn/themes/alpha1999.css +1 -1
  134. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  135. package/dist/cdn/themes/art-deco-dark.tokens.json +33 -1
  136. package/dist/cdn/themes/art-deco.css +1 -1
  137. package/dist/cdn/themes/art-deco.tokens.json +23 -1
  138. package/dist/cdn/themes/bauhaus-dark.tokens.json +23 -1
  139. package/dist/cdn/themes/bauhaus.css +1 -1
  140. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  141. package/dist/cdn/themes/brutalist-dark.tokens.json +33 -1
  142. package/dist/cdn/themes/brutalist.css +1 -1
  143. package/dist/cdn/themes/brutalist.tokens.json +23 -1
  144. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  145. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  146. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  147. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  148. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  149. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  150. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  151. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  152. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  153. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  154. package/dist/cdn/themes/classic.css +1 -1
  155. package/dist/cdn/themes/classic.tokens.json +1 -1
  156. package/dist/cdn/themes/claymorphism-dark.tokens.json +33 -1
  157. package/dist/cdn/themes/claymorphism.css +1 -1
  158. package/dist/cdn/themes/claymorphism.tokens.json +24 -1
  159. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  160. package/dist/cdn/themes/clinical.css +1 -1
  161. package/dist/cdn/themes/clinical.tokens.json +1 -1
  162. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  163. package/dist/cdn/themes/cottagecore.css +1 -1
  164. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  165. package/dist/cdn/themes/cyber.css +1 -1
  166. package/dist/cdn/themes/cyber.tokens.json +1 -1
  167. package/dist/cdn/themes/dawn-dark.tokens.json +33 -1
  168. package/dist/cdn/themes/dawn.css +1 -1
  169. package/dist/cdn/themes/dawn.tokens.json +23 -1
  170. package/dist/cdn/themes/dracula.css +1 -1
  171. package/dist/cdn/themes/dracula.tokens.json +1 -1
  172. package/dist/cdn/themes/dusk.css +1 -1
  173. package/dist/cdn/themes/dusk.tokens.json +1 -1
  174. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  175. package/dist/cdn/themes/editorial.css +1 -1
  176. package/dist/cdn/themes/editorial.tokens.json +1 -1
  177. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  178. package/dist/cdn/themes/financial.css +1 -1
  179. package/dist/cdn/themes/financial.tokens.json +1 -1
  180. package/dist/cdn/themes/genai.css +1 -1
  181. package/dist/cdn/themes/genai.tokens.json +1 -1
  182. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  183. package/dist/cdn/themes/glassmorphism.css +1 -1
  184. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  185. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  186. package/dist/cdn/themes/government.css +1 -1
  187. package/dist/cdn/themes/government.tokens.json +1 -1
  188. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  189. package/dist/cdn/themes/gruvbox.css +1 -1
  190. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  191. package/dist/cdn/themes/high-noon-dark.tokens.json +23 -1
  192. package/dist/cdn/themes/high-noon.css +1 -1
  193. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  194. package/dist/cdn/themes/journal-dark.tokens.json +36 -2
  195. package/dist/cdn/themes/journal.css +1 -1
  196. package/dist/cdn/themes/journal.tokens.json +26 -2
  197. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  198. package/dist/cdn/themes/kawaii.css +1 -1
  199. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  200. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  201. package/dist/cdn/themes/magna.css +1 -1
  202. package/dist/cdn/themes/magna.tokens.json +1 -1
  203. package/dist/cdn/themes/manifest.json +44 -68
  204. package/dist/cdn/themes/midnight.css +1 -1
  205. package/dist/cdn/themes/midnight.tokens.json +1 -1
  206. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  207. package/dist/cdn/themes/minimal.css +1 -1
  208. package/dist/cdn/themes/minimal.tokens.json +1 -1
  209. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  210. package/dist/cdn/themes/modern.css +1 -1
  211. package/dist/cdn/themes/modern.tokens.json +1 -1
  212. package/dist/cdn/themes/nes-dark.tokens.json +7 -2
  213. package/dist/cdn/themes/nes.css +1 -1
  214. package/dist/cdn/themes/nes.tokens.json +1 -1
  215. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  216. package/dist/cdn/themes/neumorphism.css +1 -1
  217. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  218. package/dist/cdn/themes/nord-dark.tokens.json +33 -1
  219. package/dist/cdn/themes/nord.css +1 -1
  220. package/dist/cdn/themes/nord.tokens.json +23 -1
  221. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  222. package/dist/cdn/themes/organic.css +1 -1
  223. package/dist/cdn/themes/organic.tokens.json +1 -1
  224. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  225. package/dist/cdn/themes/rose-pine.css +1 -1
  226. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  227. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  228. package/dist/cdn/themes/rough.css +1 -1
  229. package/dist/cdn/themes/rough.tokens.json +1 -1
  230. package/dist/cdn/themes/solarized-dark.tokens.json +23 -1
  231. package/dist/cdn/themes/solarized.css +1 -1
  232. package/dist/cdn/themes/solarized.tokens.json +23 -1
  233. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  234. package/dist/cdn/themes/startup.css +1 -1
  235. package/dist/cdn/themes/startup.tokens.json +1 -1
  236. package/dist/cdn/themes/super2026-dark.tokens.json +33 -1
  237. package/dist/cdn/themes/super2026.css +1 -1
  238. package/dist/cdn/themes/super2026.tokens.json +23 -1
  239. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  240. package/dist/cdn/themes/swiss.css +1 -1
  241. package/dist/cdn/themes/swiss.tokens.json +1 -1
  242. package/dist/cdn/themes/terminal.css +1 -1
  243. package/dist/cdn/themes/terminal.tokens.json +1 -1
  244. package/dist/cdn/themes/tokyo-night-dark.tokens.json +33 -1
  245. package/dist/cdn/themes/tokyo-night.css +1 -1
  246. package/dist/cdn/themes/tokyo-night.tokens.json +23 -1
  247. package/dist/cdn/themes/vaporwave-dark.tokens.json +33 -1
  248. package/dist/cdn/themes/vaporwave.css +1 -1
  249. package/dist/cdn/themes/vaporwave.tokens.json +23 -1
  250. package/dist/cdn/themes/win9x-dark.tokens.json +20 -5
  251. package/dist/cdn/themes/win9x.css +1 -1
  252. package/dist/cdn/themes/win9x.tokens.json +3 -1
  253. package/dist/cdn/vanilla-breeze-autoload.js +553 -0
  254. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  255. package/dist/cdn/vanilla-breeze-charts.js +32 -32
  256. package/dist/cdn/vanilla-breeze-core.css +1 -1
  257. package/dist/cdn/vanilla-breeze-core.js +183 -281
  258. package/dist/cdn/vanilla-breeze-dev.css +1 -1
  259. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  260. package/dist/cdn/vanilla-breeze-extras.js +286 -134
  261. package/dist/cdn/vanilla-breeze.css +1 -1
  262. package/dist/cdn/vanilla-breeze.js +574 -656
  263. package/dist/cdn/view-transitions.css +2 -0
  264. package/package.json +17 -9
  265. package/dist/cdn/themes/amber.css +0 -2
  266. package/dist/cdn/themes/anthropic.css +0 -2
  267. package/dist/cdn/themes/anthropic.tokens.json +0 -564
  268. package/dist/cdn/themes/coral.css +0 -2
  269. package/dist/cdn/themes/emerald.css +0 -2
  270. package/dist/cdn/themes/forest.css +0 -2
  271. package/dist/cdn/themes/ibm.css +0 -2
  272. package/dist/cdn/themes/ibm.tokens.json +0 -568
  273. package/dist/cdn/themes/indigo.css +0 -2
  274. package/dist/cdn/themes/lavender.css +0 -2
  275. package/dist/cdn/themes/mcdonalds.css +0 -2
  276. package/dist/cdn/themes/mcdonalds.tokens.json +0 -533
  277. package/dist/cdn/themes/ocean.css +0 -2
  278. package/dist/cdn/themes/rose.css +0 -2
  279. package/dist/cdn/themes/slate.css +0 -2
  280. package/dist/cdn/themes/starbucks.css +0 -2
  281. package/dist/cdn/themes/starbucks.tokens.json +0 -593
  282. package/dist/cdn/themes/sunset.css +0 -2
@@ -1,60 +1,61 @@
1
- var Me=Object.defineProperty;var T=(n,e)=>()=>(n&&(e=n(n=0)),e);var he=(n,e)=>{for(var t in e)Me(n,t,{get:e[t],enumerable:!0})};function A(n,e,t={}){let s=t.priority??10,r={impl:e,bundle:t.bundle,contract:t.contract,priority:s},i=ue.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 "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${t.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 "${t.bundle}" (first wins at equal priority).`);return}ue.set(n,r),customElements.define(n,e)}var Rt,ue,z=T(()=>{Rt=window.matchMedia("(prefers-reduced-motion: reduce)"),ue=new Map});var w,q=T(()=>{w=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,s,r){e.addEventListener(t,s,r),this.#e.push(()=>e.removeEventListener(t,s,r))}setup(){}teardown(){}setState(e,t){this.#t||(this.#t=this.attachInternals());let s=this.#t.states;try{t?s.add(e):s.delete(e)}catch{let r=`--${e}`;t?s.add(r):s.delete(r)}}_adoptInternals(e){this.#t||(this.#t=e)}}});function W(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function ye(n){E=n}function u(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(b.caret,"$1"),t=t.replace(r,a),s},getRegex:()=>new RegExp(t,e)};return s}function y(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,be)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,be);return n}function ke(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}function xe(n,e){let t=n.replace(b.findPipe,(i,a,o)=>{let l=!1,h=a;for(;--h>=0&&o[h]==="\\";)l=!l;return l?"|":" |"}),s=t.split(b.splitPipe),r=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(;r<s.length;r++)s[r]=s[r].trim().replace(b.slashPipe,"|");return s}function L(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s;){let i=n.charAt(s-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return n.slice(0,s-r)}function vt(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function At(n,e=0){let t=e,s="";for(let r of n)if(r===" "){let i=4-t%4;s+=" ".repeat(i),t+=i}else s+=r,t++;return s}function we(n,e,t,s,r){let i=e.href,a=e.title||null,o=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:a,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,l}function St(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
2
- `).map(i=>{let a=i.match(t.other.beginningSpace);if(a===null)return i;let[o]=a;return o.length>=r.length?i.slice(r.length):i}).join(`
3
- `)}function f(n,e){return $.parse(n,e)}var E,S,De,b,He,Oe,Ze,_,Qe,X,ve,Ae,Ve,Y,je,J,Fe,Ue,O,ee,Ge,Se,Ke,te,ge,We,Xe,Ye,Je,$e,et,R,Z,re,tt,Ee,rt,st,nt,Re,it,at,Ce,lt,ot,ct,ht,ut,pt,dt,ft,gt,mt,M,bt,Te,ze,kt,me,se,xt,U,wt,N,I,yt,be,D,k,H,ne,x,P,$t,$,qt,It,Lt,Pt,_t,Bt,Nt,qe=T(()=>{E=W();S={exec:()=>null};De=(()=>{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)}}>`)},He=/^(?:[ \t]*(?:\n|$))+/,Oe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ze=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,X=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ve=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ae=u(ve).replace(/bull/g,X).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(),Ve=u(ve).replace(/bull/g,X).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(),Y=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,je=/^[^\n]+/,J=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Fe=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",J).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ue=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,X).getRegex(),O="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",ee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ge=u("^ {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",ee).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Se=u(Y).replace("hr",_).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",O).getRegex(),Ke=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Se).getRegex(),te={blockquote:Ke,code:Oe,def:Fe,fences:Ze,heading:Qe,hr:_,html:Ge,lheading:Ae,list:Ue,newline:He,paragraph:Se,table:S,text:je},ge=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_).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",O).getRegex(),We={...te,lheading:Ve,table:ge,paragraph:u(Y).replace("hr",_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ge).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",O).getRegex()},Xe={...te,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).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:S,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(Y).replace("hr",_).replace("heading",` *#{1,6} *[^
4
- ]`).replace("lheading",Ae).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ye=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Je=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$e=/^( {2,}|\\)\n(?!\s*$)/,et=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,R=/[\p{P}\p{S}]/u,Z=/[\s\p{P}\p{S}]/u,re=/[^\s\p{P}\p{S}]/u,tt=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Z).getRegex(),Ee=/(?!~)[\p{P}\p{S}]/u,rt=/(?!~)[\s\p{P}\p{S}]/u,st=/(?:[^\s\p{P}\p{S}]|~)/u,nt=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",De?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Re=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,it=u(Re,"u").replace(/punct/g,R).getRegex(),at=u(Re,"u").replace(/punct/g,Ee).getRegex(),Ce="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lt=u(Ce,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Z).replace(/punct/g,R).getRegex(),ot=u(Ce,"gu").replace(/notPunctSpace/g,st).replace(/punctSpace/g,rt).replace(/punct/g,Ee).getRegex(),ct=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Z).replace(/punct/g,R).getRegex(),ht=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,R).getRegex(),ut="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",pt=u(ut,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Z).replace(/punct/g,R).getRegex(),dt=u(/\\(punct)/,"gu").replace(/punct/g,R).getRegex(),ft=u(/^<(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(),gt=u(ee).replace("(?:-->|$)","-->").getRegex(),mt=u("^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",gt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bt=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",M).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Te=u(/^!?\[(label)\]\[(ref)\]/).replace("label",M).replace("ref",J).getRegex(),ze=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",J).getRegex(),kt=u("reflink|nolink(?!\\()","g").replace("reflink",Te).replace("nolink",ze).getRegex(),me=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,se={_backpedal:S,anyPunctuation:dt,autolink:ft,blockSkip:nt,br:$e,code:Je,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:it,emStrongRDelimAst:lt,emStrongRDelimUnd:ct,escape:Ye,link:bt,nolink:ze,punctuation:tt,reflink:Te,reflinkSearch:kt,tag:mt,text:et,url:S},xt={...se,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",M).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M).getRegex()},U={...se,emStrongRDelimAst:ot,emStrongLDelim:at,delLDelim:ht,delRDelim:pt,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",me).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:u(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",me).getRegex()},wt={...U,br:u($e).replace("{2,}","*").getRegex(),text:u(U.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},N={normal:te,gfm:We,pedantic:Xe},I={normal:se,gfm:U,breaks:wt,pedantic:xt},yt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},be=n=>yt[n];D=class{options;rules;lexer;constructor(n){this.options=n||E}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 t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:L(t,`
5
- `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=St(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=L(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:L(e[0],`
6
- `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=L(e[0],`
1
+ var Ve=Object.defineProperty;var $=(i,e)=>()=>(i&&(e=i(i=0)),e);var fe=(i,e)=>{for(var t in e)Ve(i,t,{get:e[t],enumerable:!0})};function A(i,e,t={}){let r=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:r},n=me.get(i);if(customElements.get(i)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}me.set(i,s),customElements.define(i,e)}var pr,me,L=$(()=>{pr=window.matchMedia("(prefers-reduced-motion: reduce)"),me=new Map});var w,z=$(()=>{w=class extends HTMLElement{#e=[];#r;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,s){e.addEventListener(t,r,s),this.#e.push(()=>e.removeEventListener(t,r,s))}_reinit(){for(let e of this.#e)e();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#r||(this.#r=this.attachInternals());let r=this.#r.states;try{t?r.add(e):r.delete(e)}catch{let s=`--${e}`;t?r.add(s):r.delete(s)}}_adoptInternals(e){this.#r||(this.#r=e)}#t(){return this.constructor.formAssociated&&this.#r?this.#r:null}get validity(){return this.#t()?.validity}get validationMessage(){return this.#t()?.validationMessage??""}get willValidate(){return this.#t()?.willValidate??!1}get form(){return this.#t()?.form??null}checkValidity(){return this.#t()?.checkValidity()??!0}reportValidity(){return this.#t()?.reportValidity()??!0}}});function nt(i){return String(i).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function ge(i,e=!1){let t=nt(i);return e?/(^|,)(javascript|vbscript|livescript):/.test(t)?!0:/(^|,)data:/.test(t)?t.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(t)}function ke(i){let e=String(i).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(e)}function ot(i,e){if(We.has(e))return!0;let t=i.namespaceURI;return!!(t&&!Qe.has(t)||e==="title"&&t!==j||be.has(e)&&t===j&&i.children?.length||Ge.has(e)&&(i.getAttribute("attributeName")||i.getAttribute("attributename")||"").toLowerCase().includes("href"))}function ct(i,e){for(let t of[...i.attributes]){let r=t.name.toLowerCase();if(r.startsWith("on")||Je.has(r)||!e.keepIds&&Ye.has(r)){i.removeAttribute(t.name);continue}if(r==="style"){(!e.keepStyle||ke(t.value))&&i.removeAttribute(t.name);continue}if((r==="id"||r==="name")&&!e.keepIds){let s=lt(t.value);r==="id"?e.ids.set(t.value,s):e.ids.set(`name:${t.value}`,s),i.setAttribute(t.name,s);continue}if(Ke.has(r)||r.endsWith(":href")){ge(t.value,!1)&&i.removeAttribute(t.name);continue}Xe.has(r)&&ge(t.value,!0)&&i.removeAttribute(t.name)}}function ht(i,e){let t=(i.getAttribute("type")||"").toLowerCase();e==="button"&&t!=="button"&&i.setAttribute("type","button"),e==="input"&&/^(submit|reset|image)$/.test(t)&&i.setAttribute("type","button")}function ut(i,e){for(let t of i)for(let r of[...t.attributes]){let s=r.name.toLowerCase(),n=r.value;if((s==="href"||s.endsWith(":href"))&&n.startsWith("#")){let a=pt(n.slice(1));e.has(a)&&t.setAttribute(r.name,`#${e.get(a)}`)}else if(s==="usemap"&&n.startsWith("#")){let a=e.get(`name:${n.slice(1)}`);a?t.setAttribute(r.name,`#${a}`):t.removeAttribute(r.name)}else if(et.has(s)){let a=n.split(/\s+/).filter(Boolean).map(o=>e.get(o)||(o.startsWith(Q)?o:null)).filter(Boolean);a.length?t.setAttribute(r.name,a.join(" ")):t.removeAttribute(r.name)}else n.includes("url(#")&&t.setAttribute(r.name,n.replace(/url\(#([^)]+)\)/g,(a,o)=>e.has(o)?`url(#${e.get(o)})`:a))}}function pt(i){try{return decodeURIComponent(i)}catch{return i}}function xe(i){let e=i.childNodes;if(e)for(let t of[...e])t.nodeType===8?t.remove():(t.nodeType===1||t.nodeType===11)&&xe(t)}function we(i,e){xe(i);let t=[...i.querySelectorAll("*")];e.includeRoot&&t.unshift(i);let r=new Map,s=[],n={...e,ids:r};for(let a of t){if(!ft(a,i))continue;let o=at(a);if(e.svgOnly&&(be.has(o)||o==="style")){if(o==="style"&&ke(a.textContent||"")){a.remove();continue}}else if(ot(a,o)){a.remove();continue}if(!e.keepIds&&!e.svgOnly&&rt.has(o)){dt(a);continue}if(o==="template"){let h=a.content;h&&we(h,{...e,includeRoot:!1})}ct(a,n),e.keepIds||ht(a,o);let l=tt[o];if(l)for(let h of l)a.removeAttribute(h);if(o==="include-file"&&!e.allowIncludeFile&&a.removeAttribute("src"),!e.keepIds&&!e.svgOnly&&o.includes("-")&&o!=="include-file"&&!it.has(o))for(let h of st)a.removeAttribute(h);s.push(a)}!e.keepIds&&r.size&&ut(s,r)}function dt(i){let e=i.parentNode;if(e){for(let t of[...i.childNodes])e.insertBefore(t,i);i.remove()}}function ft(i,e){let t=i;for(;t;){if(t===e)return!0;t=t.parentNode??t.parent??null}return!1}function q(i,e={}){let t=document.createElement("template");return i&&typeof i=="string"&&(t.innerHTML=i,we(t.content,{allowIncludeFile:!!e.allowIncludeFile,keepIds:!!e.keepIds,keepStyle:!!e.keepStyle})),t.content}var Ze,j,je,Qe,Q,We,be,Ge,Ke,Xe,Je,Ye,et,tt,rt,st,it,at,lt,W=$(()=>{Ze="http://www.w3.org/1999/xhtml",j="http://www.w3.org/2000/svg",je="http://www.w3.org/1998/Math/MathML",Qe=new Set([Ze,j,je]),Q="user-content-",We=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),be=new Set(["title","desc"]),Ge=new Set(["animate","set","animatemotion","animatetransform"]),Ke=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),Xe=new Set(["src","poster","srcset"]),Je=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),Ye=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),et=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),tt={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},rt=new Set(["social-embed","youtube-player","geo-map"]),st=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],it=new Set(["audio-player","video-player","image-map","brand-mark"]);at=i=>String(i.localName||i.tagName||"").toLowerCase(),lt=i=>i.startsWith(Q)?i:Q+i});function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function $e(i){T=i}function u(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(s,n)=>{let a=typeof n=="string"?n:n.source;return a=a.replace(b.caret,"$1"),t=t.replace(s,a),r},getRegex:()=>new RegExp(t,e)};return r}function y(i,e){if(e){if(b.escapeTest.test(i))return i.replace(b.escapeReplace,Ae)}else if(b.escapeTestNoEncode.test(i))return i.replace(b.escapeReplaceNoEncode,Ae);return i}function Se(i){try{i=encodeURI(i).replace(b.percentDecode,"%")}catch{return null}return i}function Ee(i,e){let t=i.replace(b.findPipe,(n,a,o)=>{let l=!1,h=a;for(;--h>=0&&o[h]==="\\";)l=!l;return l?"|":" |"}),r=t.split(b.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(b.slashPipe,"|");return r}function _(i,e,t){let r=i.length;if(r===0)return"";let s=0;for(;s<r;){let n=i.charAt(r-s-1);if(n===e&&!t)s++;else if(n!==e&&t)s++;else break}return i.slice(0,r-s)}function Jt(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function Yt(i,e=0){let t=e,r="";for(let s of i)if(s===" "){let n=4-t%4;r+=" ".repeat(n),t+=n}else r+=s,t++;return r}function Te(i,e,t,r,s){let n=e.href,a=e.title||null,o=i[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:n,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function er(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
2
+ `).map(n=>{let a=n.match(t.other.beginningSpace);if(a===null)return n;let[o]=a;return o.length>=s.length?n.slice(s.length):n}).join(`
3
+ `)}function f(i,e){return E.parse(i,e)}var T,S,mt,b,gt,bt,kt,M,xt,Y,Re,Ce,wt,ee,yt,te,vt,At,O,re,St,Le,Et,se,ye,Tt,$t,Rt,Ct,ze,Lt,R,U,ie,zt,Ie,It,_t,Nt,_e,Mt,qt,Ne,Pt,Bt,Dt,Ht,Ot,Ut,Ft,Vt,Zt,jt,B,Qt,Me,qe,Wt,ve,ne,Gt,G,Kt,P,I,Xt,Ae,D,k,H,ae,x,N,le,E,gr,br,kr,xr,wr,yr,vr,Pe=$(()=>{T=J();S={exec:()=>null};mt=(()=>{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:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}>`)},gt=/^(?:[ \t]*(?:\n|$))+/,bt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,M=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Y=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ce=u(Re).replace(/bull/g,Y).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(),wt=u(Re).replace(/bull/g,Y).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(),ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yt=/^[^\n]+/,te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vt=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),At=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Y).getRegex(),O="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",re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,St=u("^ {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",re).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le=u(ee).replace("hr",M).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",O).getRegex(),Et=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Le).getRegex(),se={blockquote:Et,code:bt,def:vt,fences:kt,heading:xt,hr:M,html:St,lheading:Ce,list:At,newline:gt,paragraph:Le,table:S,text:yt},ye=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",M).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",O).getRegex(),Tt={...se,lheading:wt,table:ye,paragraph:u(ee).replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ye).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",O).getRegex()},$t={...se,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re).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:S,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(ee).replace("hr",M).replace("heading",` *#{1,6} *[^
4
+ ]`).replace("lheading",Ce).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ct=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ze=/^( {2,}|\\)\n(?!\s*$)/,Lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,R=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,ie=/[^\s\p{P}\p{S}]/u,zt=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),Ie=/(?!~)[\p{P}\p{S}]/u,It=/(?!~)[\s\p{P}\p{S}]/u,_t=/(?:[^\s\p{P}\p{S}]|~)/u,Nt=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",mt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_e=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Mt=u(_e,"u").replace(/punct/g,R).getRegex(),qt=u(_e,"u").replace(/punct/g,Ie).getRegex(),Ne="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Pt=u(Ne,"gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Bt=u(Ne,"gu").replace(/notPunctSpace/g,_t).replace(/punctSpace/g,It).replace(/punct/g,Ie).getRegex(),Dt=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Ht=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,R).getRegex(),Ot="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ut=u(Ot,"gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Ft=u(/\\(punct)/,"gu").replace(/punct/g,R).getRegex(),Vt=u(/^<(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(),Zt=u(re).replace("(?:-->|$)","-->").getRegex(),jt=u("^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",Zt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Qt=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",B).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Me=u(/^!?\[(label)\]\[(ref)\]/).replace("label",B).replace("ref",te).getRegex(),qe=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",te).getRegex(),Wt=u("reflink|nolink(?!\\()","g").replace("reflink",Me).replace("nolink",qe).getRegex(),ve=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ne={_backpedal:S,anyPunctuation:Ft,autolink:Vt,blockSkip:Nt,br:ze,code:Ct,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:Mt,emStrongRDelimAst:Pt,emStrongRDelimUnd:Dt,escape:Rt,link:Qt,nolink:qe,punctuation:zt,reflink:Me,reflinkSearch:Wt,tag:jt,text:Lt,url:S},Gt={...ne,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",B).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B).getRegex()},G={...ne,emStrongRDelimAst:Bt,emStrongLDelim:qt,delLDelim:Ht,delRDelim:Ut,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ve).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:u(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ve).getRegex()},Kt={...G,br:u(ze).replace("{2,}","*").getRegex(),text:u(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},P={normal:se,gfm:Tt,pedantic:$t},I={normal:ne,gfm:G,breaks:Kt,pedantic:Gt},Xt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ae=i=>Xt[i];D=class{options;rules;lexer;constructor(i){this.options=i||T}space(i){let e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){let e=this.rules.block.code.exec(i);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:_(t,`
5
+ `)}}}fences(i){let e=this.rules.block.fences.exec(i);if(e){let t=e[0],r=er(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(i){let e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=_(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){let e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:_(e[0],`
6
+ `)}}blockquote(i){let e=this.rules.block.blockquote.exec(i);if(e){let t=_(e[0],`
7
7
  `).split(`
8
- `),s="",r="",i=[];for(;t.length>0;){let a=!1,o=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))o.push(t[l]),a=!0;else if(!a)o.push(t[l]);else break;t=t.slice(l);let h=o.join(`
8
+ `),r="",s="",n=[];for(;t.length>0;){let a=!1,o=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))o.push(t[l]),a=!0;else if(!a)o.push(t[l]);else break;t=t.slice(l);let h=o.join(`
9
9
  `),c=h.replace(this.rules.other.blockquoteSetextReplace,`
10
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
11
- ${h}`:h,r=r?`${r}
12
- ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=d,t.length===0)break;let p=i.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let m=p,g=m.raw+`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11
+ ${h}`:h,s=s?`${s}
12
+ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,n,!0),this.lexer.state.top=d,t.length===0)break;let p=n.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let g=p,m=g.raw+`
13
13
  `+t.join(`
14
- `),v=this.blockquote(g);i[i.length-1]=v,s=s.substring(0,s.length-m.raw.length)+v.raw,r=r.substring(0,r.length-m.text.length)+v.text;break}else if(p?.type==="list"){let m=p,g=m.raw+`
14
+ `),v=this.blockquote(m);n[n.length-1]=v,r=r.substring(0,r.length-g.raw.length)+v.raw,s=s.substring(0,s.length-g.text.length)+v.text;break}else if(p?.type==="list"){let g=p,m=g.raw+`
15
15
  `+t.join(`
16
- `),v=this.list(g);i[i.length-1]=v,s=s.substring(0,s.length-p.raw.length)+v.raw,r=r.substring(0,r.length-m.raw.length)+v.raw,t=g.substring(i.at(-1).raw.length).split(`
17
- `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),s=t.length>1,r={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let i=this.rules.other.listItemRegex(t),a=!1;for(;n;){let l=!1,h="",c="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;h=e[0],n=n.substring(h.length);let d=At(e[2].split(`
18
- `,1)[0],e[1].length),p=n.split(`
19
- `,1)[0],m=!d.trim(),g=0;if(this.options.pedantic?(g=2,c=d.trimStart()):m?g=e[1].length+1:(g=d.search(this.rules.other.nonSpaceChar),g=g>4?1:g,c=d.slice(g),g+=e[1].length),m&&this.rules.other.blankLine.test(p)&&(h+=p+`
20
- `,n=n.substring(p.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(g),le=this.rules.other.hrRegex(g),oe=this.rules.other.fencesBeginRegex(g),ce=this.rules.other.headingBeginRegex(g),Be=this.rules.other.htmlBeginRegex(g),Ne=this.rules.other.blockquoteBeginRegex(g);for(;n;){let j=n.split(`
21
- `,1)[0],C;if(p=j,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),C=p):C=p.replace(this.rules.other.tabCharGlobal," "),oe.test(p)||ce.test(p)||Be.test(p)||Ne.test(p)||v.test(p)||le.test(p))break;if(C.search(this.rules.other.nonSpaceChar)>=g||!p.trim())c+=`
22
- `+C.slice(g);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||oe.test(d)||ce.test(d)||le.test(d))break;c+=`
23
- `+p}m=!p.trim(),h+=j+`
24
- `,n=n.substring(j.length+1),d=C.slice(g)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),r.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=h}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.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(l.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=c.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!r.loose){let h=l.tokens.filter(d=>d.type==="space"),c=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=c}}if(r.loose)for(let l of r.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return r}}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 t=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"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:r}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=xe(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(xe(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
26
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}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 t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=L(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=vt(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=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(t)?s=s.slice(1):s=s.slice(1,-1)),we(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return we(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,a,o=r,l=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+r);(s=h.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(a=[...i].length,s[3]||s[4]){o+=a;continue}else if((s[5]||s[6])&&r%3&&!((r+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let c=[...s[0]][0].length,d=n.slice(0,r+s.index+c+a);if(Math.min(r,a)%2){let m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,a,o=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*n.length+r);(s=l.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(a=[...i].length,a!==r))continue;if(s[3]||s[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...s[0]][0].length,c=n.slice(0,r+s.index+h+a),d=c.slice(r,-r);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},k=class G{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||E,this.options.tokenizer=this.options.tokenizer||new D,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 t={other:b,block:N.normal,inline:I.normal};this.options.pedantic?(t.block=N.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=N.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:N,inline:I}}static lex(e,t){return new G(t).lex(e)}static lexInline(e,t){return new G(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=t.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
28
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
16
+ `),v=this.list(m);n[n.length-1]=v,r=r.substring(0,r.length-p.raw.length)+v.raw,s=s.substring(0,s.length-g.raw.length)+v.raw,t=m.substring(n.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:r,tokens:n,text:s}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim(),r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let n=this.rules.other.listItemRegex(t),a=!1;for(;i;){let l=!1,h="",c="";if(!(e=n.exec(i))||this.rules.block.hr.test(i))break;h=e[0],i=i.substring(h.length);let d=Yt(e[2].split(`
18
+ `,1)[0],e[1].length),p=i.split(`
19
+ `,1)[0],g=!d.trim(),m=0;if(this.options.pedantic?(m=2,c=d.trimStart()):g?m=e[1].length+1:(m=d.search(this.rules.other.nonSpaceChar),m=m>4?1:m,c=d.slice(m),m+=e[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+`
20
+ `,i=i.substring(p.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(m),ue=this.rules.other.hrRegex(m),pe=this.rules.other.fencesBeginRegex(m),de=this.rules.other.headingBeginRegex(m),Ue=this.rules.other.htmlBeginRegex(m),Fe=this.rules.other.blockquoteBeginRegex(m);for(;i;){let Z=i.split(`
21
+ `,1)[0],C;if(p=Z,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),C=p):C=p.replace(this.rules.other.tabCharGlobal," "),pe.test(p)||de.test(p)||Ue.test(p)||Fe.test(p)||v.test(p)||ue.test(p))break;if(C.search(this.rules.other.nonSpaceChar)>=m||!p.trim())c+=`
22
+ `+C.slice(m);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||pe.test(d)||de.test(d)||ue.test(d))break;c+=`
23
+ `+p}g=!p.trim(),h+=Z+`
24
+ `,i=i.substring(Z.length+1),d=C.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),s.raw+=h}let o=s.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.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(l.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=c.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!s.loose){let h=l.tokens.filter(d=>d.type==="space"),c=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=c}}if(s.loose)for(let l of s.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(i){let e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){let e=this.rules.block.def.exec(i);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:s}}}table(i){let e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Ee(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],n={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?n.align.push("right"):this.rules.other.tableAlignCenter.test(a)?n.align.push("center"):this.rules.other.tableAlignLeft.test(a)?n.align.push("left"):n.align.push(null);for(let a=0;a<t.length;a++)n.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:n.align[a]});for(let a of s)n.rows.push(Ee(a,n.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:n.align[l]})));return n}}lheading(i){let e=this.rules.block.lheading.exec(i);if(e){let t=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(i){let e=this.rules.block.paragraph.exec(i);if(e){let t=e[1].charAt(e[1].length-1)===`
26
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){let e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){let e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){let e=this.rules.inline.tag.exec(i);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(i){let e=this.rules.inline.link.exec(i);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let n=_(t.slice(0,-1),"\\");if((t.length-n.length)%2===0)return}else{let n=Jt(e[2],"()");if(n===-2)return;if(n>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(r);n&&(r=n[1],s=n[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),Te(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let n=t[0].charAt(0);return{type:"text",raw:n,text:n}}return Te(t,s,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(i);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,n,a,o=s,l=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*i.length+s);(r=h.exec(e))!==null;){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(a=[...n].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&s%3&&!((s+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let c=[...r[0]][0].length,d=i.slice(0,s+r.index+c+a);if(Math.min(s,a)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(i){let e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){let e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i,e,t=""){let r=this.rules.inline.delLDelim.exec(i);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,n,a,o=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*i.length+s);(r=l.exec(e))!==null;){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(a=[...n].length,a!==s))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...r[0]][0].length,c=i.slice(0,s+r.index+h+a),d=c.slice(s,-s);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(i){let e=this.rules.inline.autolink.exec(i);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(i){let e;if(e=this.rules.inline.url.exec(i)){let t,r;if(e[2]==="@")t=e[0],r="mailto:"+t;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);t=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(i){let e=this.rules.inline.text.exec(i);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},k=class K{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new D,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 t={other:b,block:P.normal,inline:I.normal};this.options.pedantic?(t.block=P.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=P.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:P,inline:I}}static lex(e,t){return new K(t).lex(e)}static lexInline(e,t){return new K(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let a=t.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
28
+ `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
29
29
  `)?"":`
30
- `)+r.raw,a.text+=`
31
- `+r.text,this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
30
+ `)+s.raw,a.text+=`
31
+ `+s.text,this.inlineQueue.at(-1).src=a.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
32
32
  `)?"":`
33
- `)+r.raw,a.text+=`
34
- `+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
33
+ `)+s.raw,a.text+=`
34
+ `+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},t.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let n=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(n=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(n))){let a=t.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
35
35
  `)?"":`
36
- `)+r.raw,a.text+=`
37
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),s=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
36
+ `)+s.raw,a.text+=`
37
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s),r=n.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
38
38
  `)?"":`
39
- `)+r.raw,a.text+=`
40
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let a=!1,o="";for(;e;){a||(o=""),a=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=t.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,s,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(m=>{p=m.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);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 t}},H=class{options;parser;constructor(n){this.options=n||E}space(n){return""}code({text:n,lang:e,escaped:t}){let s=(e||"").match(b.notSpaceStart)?.[0],r=n.replace(b.endingNewline,"")+`
41
- `;return s?'<pre><code class="language-'+y(s)+'">'+(t?r:y(r,!0))+`</code></pre>
42
- `:"<pre><code>"+(t?r:y(r,!0))+`</code></pre>
43
- `}blockquote({tokens:n}){return`<blockquote>
44
- ${this.parser.parse(n)}</blockquote>
45
- `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
46
- `}hr(n){return`<hr>
47
- `}list(n){let e=n.ordered,t=n.start,s="";for(let a=0;a<n.items.length;a++){let o=n.items[a];s+=this.listitem(o)}let r=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+r+i+`>
48
- `+s+"</"+r+`>
49
- `}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
50
- `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
51
- `}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let s="";for(let r=0;r<n.rows.length;r++){let i=n.rows[r];t="";for(let a=0;a<i.length;a++)t+=this.tablecell(i[a]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
39
+ `)+s.raw,a.text+=`
40
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)n=s[2]?s[2].length:0,r=r.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,o="";for(;e;){a||(o=""),a=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=t.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,r,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,r,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);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 t}},H=class{options;parser;constructor(i){this.options=i||T}space(i){return""}code({text:i,lang:e,escaped:t}){let r=(e||"").match(b.notSpaceStart)?.[0],s=i.replace(b.endingNewline,"")+`
41
+ `;return r?'<pre><code class="language-'+y(r)+'">'+(t?s:y(s,!0))+`</code></pre>
42
+ `:"<pre><code>"+(t?s:y(s,!0))+`</code></pre>
43
+ `}blockquote({tokens:i}){return`<blockquote>
44
+ ${this.parser.parse(i)}</blockquote>
45
+ `}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:e}){return`<h${e}>${this.parser.parseInline(i)}</h${e}>
46
+ `}hr(i){return`<hr>
47
+ `}list(i){let e=i.ordered,t=i.start,r="";for(let a=0;a<i.items.length;a++){let o=i.items[a];r+=this.listitem(o)}let s=e?"ol":"ul",n=e&&t!==1?' start="'+t+'"':"";return"<"+s+n+`>
48
+ `+r+"</"+s+`>
49
+ `}listitem(i){return`<li>${this.parser.parse(i.tokens)}</li>
50
+ `}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
51
+ `}table(i){let e="",t="";for(let s=0;s<i.header.length;s++)t+=this.tablecell(i.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<i.rows.length;s++){let n=i.rows[s];t="";for(let a=0;a<n.length;a++)t+=this.tablecell(n[a]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
52
52
  <thead>
53
53
  `+e+`</thead>
54
- `+s+`</table>
55
- `}tablerow({text:n}){return`<tr>
56
- ${n}</tr>
57
- `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
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>${y(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=ke(n);if(r===null)return s;n=r;let i='<a href="'+n+'"';return e&&(i+=' title="'+y(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=ke(n);if(r===null)return y(t);n=r;let i=`<img src="${n}" alt="${y(t)}"`;return e&&(i+=` title="${y(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:y(n.text)}},ne=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}},x=class K{options;renderer;textRenderer;constructor(e){this.options=e||E,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ne}static parse(e,t){return new K(t).parse(e)}static parseInline(e,t){return new K(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let a=r,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){t+=o||"";continue}}let i=r;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let i=e[r];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 a=i;switch(a.type){case"escape":{s+=t.text(a);break}case"html":{s+=t.html(a);break}case"link":{s+=t.link(a);break}case"image":{s+=t.image(a);break}case"checkbox":{s+=t.checkbox(a);break}case"strong":{s+=t.strong(a);break}case"em":{s+=t.em(a);break}case"codespan":{s+=t.codespan(a);break}case"br":{s+=t.br(a);break}case"del":{s+=t.del(a);break}case"text":{s+=t.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},P=class{options;block;constructor(n){this.options=n||E}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?k.lex:k.lexInline}provideParser(n=this.block){return n?x.parse:x.parseInline}},$t=class{defaults=W();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=x;Renderer=H;TextRenderer=ne;Lexer=k;Tokenizer=D;Hooks=P;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(let s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let i of r.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let a of i)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let r=s;t=t.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let a=r[i].flat(1/0);t=t.concat(this.walkTokens(a,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let o=r.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new H(this.defaults);for(let i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,o=t.renderer[a],l=r[a];r[a]=(...h)=>{let c=o.apply(r,h);return c===!1&&(c=l.apply(r,h)),c||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new D(this.defaults);for(let i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,o=t.tokenizer[a],l=r[a];r[a]=(...h)=>{let c=o.apply(r,h);return c===!1&&(c=l.apply(r,h)),c}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new P;for(let i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,o=t.hooks[a],l=r[a];P.passThroughHooks.has(i)?r[a]=h=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await o.call(r,h);return l.call(r,d)})();let c=o.call(r,h);return l.call(r,c)}:r[a]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(r,h);return d===!1&&(d=await l.apply(r,h)),d})();let c=o.apply(r,h);return c===!1&&(c=l.apply(r,h)),c}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),r&&(o=o.concat(r.call(this,a))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return k.lex(n,e??this.defaults)}parser(n,e){return x.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.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(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(e):e,o=await(r.hooks?await r.hooks.provideLexer(n):n?k.lex:k.lexInline)(a,r),l=r.hooks?await r.hooks.processAllTokens(o):o;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let h=await(r.hooks?await r.hooks.provideParser(n):n?x.parse:x.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(h):h})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let a=(r.hooks?r.hooks.provideLexer(n):n?k.lex:k.lexInline)(e,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let o=(r.hooks?r.hooks.provideParser(n):n?x.parse:x.parseInline)(a,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(a){return i(a)}}}onError(n,e){return t=>{if(t.message+=`
59
- Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},$=new $t;f.options=f.setOptions=function(n){return $.setOptions(n),f.defaults=$.defaults,ye(f.defaults),f};f.getDefaults=W;f.defaults=E;f.use=function(...n){return $.use(...n),f.defaults=$.defaults,ye(f.defaults),f};f.walkTokens=function(n,e){return $.walkTokens(n,e)};f.parseInline=$.parseInline;f.Parser=x;f.parser=x.parse;f.Renderer=H;f.TextRenderer=ne;f.Lexer=k;f.lexer=k.lex;f.Tokenizer=D;f.Hooks=P;f.parse=f;qt=f.options,It=f.setOptions,Lt=f.use,Pt=f.walkTokens,_t=f.parseInline,Bt=x.parse,Nt=k.lex});var Ie={};he(Ie,{MarkdownViewer:()=>Q});var Q,Le=T(()=>{z();q();qe();Q=class extends w{#e=null;#t=null;#s=null;#n=null;#i=null;static get observedAttributes(){return["src"]}setup(){this.#a()}teardown(){this.#t?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,t,s){e==="src"&&s&&t!==s&&this.isConnected&&this.#a()}get parser(){return this.#e}set parser(e){this.#e=typeof e=="function"?e:null}get markdown(){return this.#n??this.#i??""}set markdown(e){let t=e==null?null:String(e);this.#n!==t&&(this.#n=t,this.#a())}async render(){await this.#a()}async reload(){this.getAttribute("src")&&await this.#a()}#r(){if(this.getAttribute("src"))return null;let e=this.querySelector('script[type="text/markdown"]');if(e)return e.textContent;let t=this.querySelector("template[data-md]");if(t)return t.content.textContent;let s=this.querySelector(":scope > pre");return s?s.textContent:null}async#a(){let e=this.getAttribute("src"),t;if(this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),e){this.#t?.abort(),this.#t=new AbortController,this.setAttribute("data-loading",""),this.#l("markdown-viewer:fetch",{src:e});try{let i=await fetch(e,{signal:this.#t.signal});if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);t=await i.text()}catch(i){if(i.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#l("markdown-viewer:error",{error:i.message});return}this.removeAttribute("data-loading")}else this.#n!=null?t=this.#n:t=this.#r();if(t==null)return;this.#i=t;let s;try{s=await(await this.#c())(t)}catch(i){this.setAttribute("data-error",""),this.#l("markdown-viewer:error",{error:i.message});return}this.#s||(this.#s=document.createElement("div"),this.#s.className="md-content",this.#s.setAttribute("part","content"),this.appendChild(this.#s)),this.#s.innerHTML=s,this.#o(),this.setAttribute("data-rendered","");let r=this.getAttribute("ping");if(r&&navigator.sendBeacon?.(r,JSON.stringify({src:e||"inline"})),this.#l("markdown-viewer:rendered",{src:e,node:this.#s}),this.hasAttribute("highlight"))for(let i of this.#s.querySelectorAll('pre > code[class*="language-"]')){let a=i.className.match(/language-(\S+)/)?.[1]||"";this.#l("markdown-viewer:highlight",{node:i,language:a})}}async#c(){return this.#e?this.#e:e=>f.parse(e,{gfm:!0})}#o(){if(!this.#s)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#s.dataset.theme=e)}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-viewer",Q)});var Pe={};he(Pe,{MarkdownEditor:()=>V});var V,_e=T(()=>{z();q();V=class extends w{#e=null;#t=null;#s=null;#n=null;#i="";#r=null;static get observedAttributes(){return["name","placeholder","rows"]}setup(){this.#a(),this.#c(),this.#l()}teardown(){this.#r!==null&&clearTimeout(this.#r),this.removeAttribute("data-editing")}attributeChangedCallback(e,t,s){!this.#e||t===s||(e==="name"&&(this.#e.name=s||""),e==="placeholder"&&(this.#e.placeholder=s||""),e==="rows"&&(this.#e.rows=parseInt(s,10)||10))}get value(){return this.#e?.value??""}set value(e){if(!this.#e)return;let t=e==null?"":String(e);this.#e.value!==t&&(this.#e.value=t,this.#l(),this.dispatchEvent(new CustomEvent("markdown-editor:change",{detail:{value:t,source:"api"},bubbles:!0})))}get textarea(){return this.#e}#a(){let t=this.querySelector("textarea")?.value||"";this.#s=document.createElement("section"),this.#s.className="md-editor-pane",this.#s.setAttribute("aria-label","Markdown source"),this.#n=document.createElement("section"),this.#n.className="md-preview-pane",this.#n.setAttribute("aria-label","Rendered preview"),this.#n.setAttribute("aria-live","polite"),this.#e=document.createElement("textarea"),this.#e.className="md-editor-input",this.#e.value=t,this.#e.name=this.getAttribute("name")||"",this.#e.placeholder=this.getAttribute("placeholder")||"Write markdown here...",this.#e.rows=parseInt(this.getAttribute("rows")??"",10)||10,this.#e.setAttribute("spellcheck","true"),this.#t=document.createElement("markdown-viewer"),this.hasAttribute("highlight")&&this.#t.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;s&&(this.#t.dataset.theme=s),this.#s.appendChild(this.#e),this.#n.appendChild(this.#t),this.innerHTML="",this.appendChild(this.#s),this.appendChild(this.#n),this.#i=t}#c(){let e=this.#e;e&&(this.listen(e,"input",()=>{this.#h("markdown-editor:input",{value:e.value}),this.#o()}),this.listen(e,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(e,"blur",()=>{this.removeAttribute("data-editing"),e.value!==this.#i&&(this.#i=e.value,this.#h("markdown-editor:change",{value:e.value}))}),this.hasAttribute("data-tab-indent")&&this.listen(e,"keydown",t=>{let s=t;if(s.key==="Tab"&&!s.shiftKey&&!s.ctrlKey&&!s.metaKey){s.preventDefault();let{selectionStart:r,selectionEnd:i}=e;e.setRangeText(" ",r,i,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#o(){this.#r!==null&&clearTimeout(this.#r),this.#r=setTimeout(()=>this.#l(),150)}#l(){if(!this.#t)return;let e=this.#e?.value||"";if(!e.trim()){let s=this.#t.querySelector(".md-content");s&&(s.innerHTML="");return}let t=this.#t.querySelector('script[type="text/markdown"]');t||(t=document.createElement("script"),t.type="text/markdown",this.#t.prepend(t)),t.textContent=e,this.#t.removeAttribute("data-rendered"),this.#t.render?.()}#h(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-editor",V)});z();q();function B(n){let e=(Date.now()-n.getTime())/1e3;if(e<0)return null;if(e<60)return"just now";if(e<3600){let s=Math.floor(e/60);return`${s} minute${s!==1?"s":""} ago`}if(e<86400){let s=Math.floor(e/3600);return`${s} hour${s!==1?"s":""} ago`}if(e<2592e3){let s=Math.floor(e/86400);return`${s} day${s!==1?"s":""} ago`}if(e<31536e3){let s=Math.floor(e/2592e3);return`${s} month${s!==1?"s":""} ago`}let t=Math.floor(e/31536e3);return`${t} year${t!==1?"s":""} ago`}function pe(n=document){for(let e of n.querySelectorAll("time[data-relative]")){let t=e.getAttribute("datetime");if(!t)continue;let s=B(new Date(t));s&&(e.textContent=s)}}var F=typeof document<"u"?document.documentElement:null,de;function fe(){pe(),de||(de=setInterval(()=>pe(),6e4))}F&&!F.hasAttribute("data-vb-time-relative-init")&&(F.setAttribute("data-vb-time-relative-init",""),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",fe,{once:!0}):fe());z();q();var ie=class extends w{static formAssociated=!0;static observedAttributes=["value","disabled","placeholder","submit-label","cancel-label","data-show-cancel"];#e;#t;#s;#n;#i;#r;#a;#c=null;constructor(){super(),this.#e=this.attachInternals(),this._adoptInternals(this.#e)}setup(){Promise.resolve().then(()=>(Le(),Ie)).catch(()=>console.warn('[VB] comment-box: markdown-viewer failed to load (missing importmap for "marked"?)')),Promise.resolve().then(()=>(_e(),Pe)).catch(()=>console.warn("[VB] comment-box: markdown-editor failed to load"));let e=[...this.querySelectorAll(':scope > [slot="toolbar"]')],t=this.querySelector(":scope > markdown-editor");if(!t){t=document.createElement("markdown-editor");let r=document.createElement("textarea");this.hasAttribute("placeholder")&&(r.placeholder=this.getAttribute("placeholder")||""),this.hasAttribute("value")&&(r.value=this.getAttribute("value")||""),t.appendChild(r)}this.#t=t,this.#s=document.createElement("div"),this.#s.className="comment-box-actions",this.#n=document.createElement("div"),this.#n.className="comment-box-toolbar",this.#n.setAttribute("role","toolbar"),e.forEach(r=>this.#n.appendChild(r)),this.#s.appendChild(this.#n);let s=document.createElement("div");s.className="comment-box-buttons",this.hasAttribute("data-show-cancel")&&(this.#r=document.createElement("button"),this.#r.type="button",this.#r.className="comment-box-cancel",this.#r.textContent=this.getAttribute("cancel-label")||"Cancel",s.appendChild(this.#r)),this.#i=document.createElement("button"),this.#i.type="button",this.#i.className="comment-box-submit",this.#i.textContent=this.getAttribute("submit-label")||"Comment",s.appendChild(this.#i),this.#s.appendChild(s),this.hasAttribute("data-max-length")&&(this.#a=document.createElement("span"),this.#a.className="comment-box-counter",this.#a.setAttribute("aria-live","polite"),this.#s.appendChild(this.#a)),this.replaceChildren(this.#t,this.#s),this.listen(this.#i,"click",this.#p),this.#r&&this.listen(this.#r,"click",this.#u),this.#l(),this.#t.hasAttribute("data-upgraded")||this.listen(this.#t,"markdown-editor:upgraded",()=>this.#l(),{once:!0}),this.#b(),this.#f(),this.#g(),this.#m()}get#o(){return this.#t?.textarea??this.#t?.querySelector("textarea")??null}#l(){let e=this.#o;!e||e===this.#c||(this.#c=e,this.listen(e,"input",this.#h),this.listen(e,"keydown",this.#d))}attributeChangedCallback(e,t,s){if(!(!this.isConnected||!this.#t))if(e==="value")this.value=s??"";else if(e==="placeholder"){let r=this.#o;r&&(r.placeholder=s??"")}else e==="disabled"?this.#b():e==="submit-label"?this.#i.textContent=s||"Comment":e==="cancel-label"?this.#r&&(this.#r.textContent=s||"Cancel"):e==="data-show-cancel"&&(this.hasAttribute("data-show-cancel")&&!this.#r?(this.#r=document.createElement("button"),this.#r.type="button",this.#r.className="comment-box-cancel",this.#r.textContent=this.getAttribute("cancel-label")||"Cancel",this.#i.parentNode.insertBefore(this.#r,this.#i),this.listen(this.#r,"click",this.#u)):!this.hasAttribute("data-show-cancel")&&this.#r&&(this.#r.remove(),this.#r=null))}#h=()=>{this.#f(),this.#g(),this.#m(),this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))};#d=e=>{e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#p())};#p=()=>{if(this.#k())return;let e=this.value,t=new CustomEvent("comment-box:submit",{bubbles:!0,cancelable:!0,detail:{value:e}});this.dispatchEvent(t)&&this.clear()};#u=()=>{let e=this.value;this.dispatchEvent(new CustomEvent("comment-box:cancel",{bubbles:!0,detail:{value:e}}))};#k(){return this.hasAttribute("disabled")?!0:!this.#e.checkValidity()}#b(){let e=this.hasAttribute("disabled"),t=this.#o;t&&(t.disabled=e),this.#i.disabled=e,this.#r&&(this.#r.disabled=e)}#f(){this.#e.setFormValue(this.value)}#g(){let e=this.value,t=Number(this.getAttribute("data-min-length"))||0,s=Number(this.getAttribute("data-max-length"))||1/0,r=this.hasAttribute("required"),i=this.#o&&this.contains(this.#o)?this.#o:null;if(r&&e.length===0){this.#e.setValidity({valueMissing:!0},"Please add a comment.",i||void 0);return}if(e.length<t){this.#e.setValidity({tooShort:!0},`At least ${t} characters required.`,i||void 0);return}if(e.length>s){this.#e.setValidity({tooLong:!0},`No more than ${s} characters.`,i||void 0);return}this.#e.setValidity({})}#m(){if(!this.#a)return;let e=Number(this.getAttribute("data-max-length"))||0,t=this.value.length;this.#a.textContent=e?`${t} / ${e}`:String(t),this.#a.classList.toggle("is-over",e>0&&t>e)}get value(){return this.#t?.value??""}set value(e){this.#t&&(this.#t.value=e==null?"":String(e),this.#f(),this.#g(),this.#m())}clear(){this.value="",this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:"",length:0}}))}focus(){this.#o?.focus()}formResetCallback(){this.value=this.getAttribute("value")??""}formStateRestoreCallback(e){e!=null&&(this.value=e)}get form(){return this.#e.form}get name(){return this.getAttribute("name")}get type(){return this.localName}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}};A("comment-box",ie);var ae=class extends w{#e=null;#t=null;#s=0;setup(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Comments"),this.#e=this.querySelector(":scope > template[data-reply-form]"),this.#n().forEach(e=>this.#i(e)),this.#s=setInterval(()=>this.#p(),6e4)}teardown(){clearInterval(this.#s)}#n(){return[...this.querySelectorAll(":scope > article[data-comment]")]}#i(e){if(e.dataset.decorated==="")return;e.dataset.decorated="";let t=this.#r(e);e.style.setProperty("--comment-depth",String(t)),t>0&&e.setAttribute("aria-level",String(t+1));let s=this.#a(e),r=e.querySelector(":scope > [data-comment-body]");r?e.insertBefore(s,r):e.prepend(s);let i=this.#c(e);e.appendChild(i)}#r(e){let t=0,s=e.dataset.parent,r=new Set;for(;s&&!r.has(s);){r.add(s);let i=this.querySelector(`:scope > article[data-comment][id="${CSS.escape(s)}"]`);if(!i)break;t+=1,s=i.dataset.parent}return t}#a(e){let t=document.createElement("header");t.className="comment-header";let s=e.dataset.author||"Unknown",r=e.dataset.authorHref,i=e.dataset.authorAvatar;if(i){let l=document.createElement("user-avatar");l.setAttribute("src",i),l.setAttribute("name",s),t.appendChild(l)}let a=document.createElement(r?"a":"span");a.className="comment-author",a.textContent=s,r&&(a.href=r),t.appendChild(a);let o=e.dataset.time;if(o){let l=document.createElement("time");l.className="comment-time",l.setAttribute("datetime",o),l.setAttribute("title",this.#u(o)),l.textContent=B(new Date(o))||o,t.appendChild(l)}if(e.dataset.edited){let l=document.createElement("span");l.className="comment-edited",l.title=`Edited ${this.#u(e.dataset.edited)}`,l.textContent="(edited)",t.appendChild(l)}return t}#c(e){let t=document.createElement("footer");if(t.className="comment-footer",t.setAttribute("role","toolbar"),this.hasAttribute("data-disabled"))return t;let s=document.createElement("button");if(s.type="button",s.className="comment-action comment-reply",s.textContent="Reply",s.setAttribute("aria-label",`Reply to ${e.dataset.author||"comment"}`),this.listen(s,"click",()=>this.#o(e)),t.appendChild(s),e.hasAttribute("data-mine")){let r=document.createElement("button");r.type="button",r.className="comment-action comment-edit",r.textContent="Edit",r.setAttribute("aria-label","Edit your comment"),this.listen(r,"click",()=>this.#h(e)),t.appendChild(r);let i=document.createElement("button");i.type="button",i.className="comment-action comment-delete",i.textContent="Delete",i.setAttribute("aria-label","Delete your comment"),this.listen(i,"click",()=>this.#d(e)),t.appendChild(i)}return t}#o(e){if(this.#t&&this.#l(),!this.#e)return;let t=this.#e.content.cloneNode(!0),s=t.firstElementChild?.cloneNode?t.firstElementChild:document.createElement("comment-box");s.hasAttribute("data-show-cancel")||s.setAttribute("data-show-cancel","");let r=document.createElement("div");r.className="comment-reply-form",r.setAttribute("data-parent",e.id||""),r.appendChild(s),e.appendChild(r),this.#t=r,requestAnimationFrame(()=>s.focus?.()),s.addEventListener("comment-box:submit",i=>{this.dispatchEvent(new CustomEvent("comment-thread:reply",{bubbles:!0,detail:{parentId:e.id,value:i.detail.value}})),this.#l()}),s.addEventListener("comment-box:cancel",()=>this.#l())}#l(){this.#t&&(this.#t.remove(),this.#t=null)}#h(e){let s=e.querySelector(":scope > [data-comment-body]")?.textContent.trim()??"";this.dispatchEvent(new CustomEvent("comment-thread:edit-request",{bubbles:!0,detail:{commentId:e.id,value:s}}))}#d(e){this.dispatchEvent(new CustomEvent("comment-thread:delete-request",{bubbles:!0,detail:{commentId:e.id}}))}#p(){for(let e of this.querySelectorAll(":scope > article[data-comment] > .comment-header > time")){let t=e.getAttribute("datetime");if(!t)continue;let s=B(new Date(t));s&&(e.textContent=s)}}#u(e){try{return new Date(e).toLocaleString()}catch{return e}}addComment(e){let t=document.createElement("article");t.setAttribute("data-comment",""),t.id=e.id,t.dataset.author=e.author,e.authorHref&&(t.dataset.authorHref=e.authorHref),e.authorAvatar&&(t.dataset.authorAvatar=e.authorAvatar),t.dataset.time=e.time,e.parentId&&(t.dataset.parent=e.parentId),e.mine&&t.setAttribute("data-mine",""),e.edited&&(t.dataset.edited=e.edited);let s=document.createElement("div");return s.setAttribute("data-comment-body",""),s.innerHTML=e.body,t.appendChild(s),this.#e?this.insertBefore(t,this.#e):this.appendChild(t),this.#i(t),t}updateComment(e,t={}){let s=this.querySelector(`:scope > article[data-comment][id="${CSS.escape(e)}"]`);if(!s)return;if(t.body!=null){let a=s.querySelector(":scope > [data-comment-body]");a&&(a.innerHTML=t.body)}t.author!=null&&(s.dataset.author=t.author),t.edited!=null&&(s.dataset.edited=t.edited),s.querySelector(":scope > .comment-header")?.remove();let r=s.querySelector(":scope > [data-comment-body]"),i=this.#a(s);r?s.insertBefore(i,r):s.prepend(i)}removeComment(e){let t=this.querySelector(`:scope > article[data-comment][id="${CSS.escape(e)}"]`);t&&t.remove()}};A("comment-thread",ae);export{ae as CommentThread};
54
+ `+r+`</table>
55
+ `}tablerow({text:i}){return`<tr>
56
+ ${i}</tr>
57
+ `}tablecell(i){let e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
58
+ `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${y(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let r=this.parser.parseInline(t),s=Se(i);if(s===null)return r;i=s;let n='<a href="'+i+'"';return e&&(n+=' title="'+y(e)+'"'),n+=">"+r+"</a>",n}image({href:i,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let s=Se(i);if(s===null)return y(t);i=s;let n=`<img src="${i}" alt="${y(t)}"`;return e&&(n+=` title="${y(e)}"`),n+=">",n}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:y(i.text)}},ae=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},x=class X{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ae}static parse(e,t){return new X(t).parse(e)}static parseInline(e,t){return new X(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let a=s,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){t+=o||"";continue}}let n=s;switch(n.type){case"space":{t+=this.renderer.space(n);break}case"hr":{t+=this.renderer.hr(n);break}case"heading":{t+=this.renderer.heading(n);break}case"code":{t+=this.renderer.code(n);break}case"table":{t+=this.renderer.table(n);break}case"blockquote":{t+=this.renderer.blockquote(n);break}case"list":{t+=this.renderer.list(n);break}case"checkbox":{t+=this.renderer.checkbox(n);break}case"html":{t+=this.renderer.html(n);break}case"def":{t+=this.renderer.def(n);break}case"paragraph":{t+=this.renderer.paragraph(n);break}case"text":{t+=this.renderer.text(n);break}default:{let a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let o=this.options.extensions.renderers[n.type].call({parser:this},n);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=o||"";continue}}let a=n;switch(a.type){case"escape":{r+=t.text(a);break}case"html":{r+=t.html(a);break}case"link":{r+=t.link(a);break}case"image":{r+=t.image(a);break}case"checkbox":{r+=t.checkbox(a);break}case"strong":{r+=t.strong(a);break}case"em":{r+=t.em(a);break}case"codespan":{r+=t.codespan(a);break}case"br":{r+=t.br(a);break}case"del":{r+=t.del(a);break}case"text":{r+=t.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},N=class{options;block;constructor(i){this.options=i||T}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(i=this.block){return i?k.lex:k.lexInline}provideParser(i=this.block){return i?x.parse:x.parseInline}},le=class{defaults=J();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=x;Renderer=H;TextRenderer=ae;Lexer=k;Tokenizer=D;Hooks=N;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let r of i)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let n of s.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of s.rows)for(let a of n)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let s=r;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let a=s[n].flat(1/0);t=t.concat(this.walkTokens(a,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=e.renderers[s.name];n?e.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=n.apply(this,a)),o}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=e[s.level];n?n.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){let s=this.defaults.renderer||new H(this.defaults);for(let n in t.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let a=n,o=t.renderer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new D(this.defaults);for(let n in t.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let a=n,o=t.tokenizer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new N;for(let n in t.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let a=n,o=t.hooks[a],l=s[a];N.passThroughHooks.has(n)?s[a]=h=>{if(this.defaults.async&&N.passThroughHooksRespectAsync.has(n))return(async()=>{let d=await o.call(s,h);return l.call(s,d)})();let c=o.call(s,h);return l.call(s,c)}:s[a]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(s,h);return d===!1&&(d=await l.apply(s,h)),d})();let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,n=t.walkTokens;r.walkTokens=function(a){let o=[];return o.push(n.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return k.lex(i,e??this.defaults)}parser(i,e){return x.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let r={...t},s={...this.defaults,...r},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return n(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 n(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=i),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(e):e,o=await(s.hooks?await s.hooks.provideLexer(i):i?k.lex:k.lexInline)(a,s),l=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(i):i?x.parse:x.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(n);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer(i):i?k.lex:k.lexInline)(e,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let o=(s.hooks?s.hooks.provideParser(i):i?x.parse:x.parseInline)(a,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(a){return n(a)}}}onError(i,e){return t=>{if(t.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,i){let r="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},E=new le;f.options=f.setOptions=function(i){return E.setOptions(i),f.defaults=E.defaults,$e(f.defaults),f};f.getDefaults=J;f.defaults=T;f.use=function(...i){return E.use(...i),f.defaults=E.defaults,$e(f.defaults),f};f.walkTokens=function(i,e){return E.walkTokens(i,e)};f.parseInline=E.parseInline;f.Parser=x;f.parser=x.parse;f.Renderer=H;f.TextRenderer=ae;f.Lexer=k;f.lexer=k.lex;f.Tokenizer=D;f.Hooks=N;f.parse=f;gr=f.options,br=f.setOptions,kr=f.use,xr=f.walkTokens,wr=f.parseInline,yr=x.parse,vr=k.lex});var Be={};fe(Be,{MarkdownViewer:()=>F});var tr,rr,sr,ir,nr,F,oe=$(()=>{L();z();Pe();W();tr="Failed to load markdown",rr=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,sr=i=>i.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`),ir={name:"vbCallout",level:"block",start(i){return i.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(i){let e=rr.exec(i);if(!e||e.index!==0)return;let t=e[1],r=(e[2]||"").trim()||t[0].toUpperCase()+t.slice(1),s={type:"vbCallout",raw:e[0],kind:t,title:r,tokens:[]};return this.lexer.blockTokens(e[3],s.tokens),s},renderer(i){return`<aside data-callout="${i.kind}" role="note"><p data-callout-title><strong>${sr(i.title)}</strong></p>${this.parser.parse(i.tokens)}</aside>
60
+ `}},nr=new le({gfm:!0,extensions:[ir]}),F=class extends w{#e=null;#r=null;#t=null;#l=null;#s=null;#i=null;#a=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#u()}teardown(){this.#r?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,t,r){t===r||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#u()}get parser(){return this.#e}set parser(e){this.#e=typeof e=="function"?e:null}get markdown(){return this.#s??this.#i??""}set markdown(e){let t=e==null?null:String(e);this.#s!==t&&(this.#s=t,this.#u())}async render(){await this.#u()}async reload(){this.getAttribute("src")&&await this.#u()}#n(){let e=this.querySelector('script[type="text/markdown"]');if(e)return e.textContent;let t=this.querySelector("template[data-md]");if(t)return t.content.textContent;let r=this.querySelector(":scope > pre");return r?r.textContent:null}#c(e){let t;try{t=new URL(e,document.baseURI)}catch{throw new Error(`Invalid URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Refused ${t.protocol} URL: only http(s) is allowed`);return this.#h(t.href),t.href}#h(e){if(!this.hasAttribute("allow-cross-origin")&&new URL(e).origin!==location.origin)throw new Error(`Refused cross-origin URL ${e} (add allow-cross-origin to permit)`)}async#u(){let e=++this.#a,t=this.getAttribute("src"),r;if(this.#r?.abort(),this.#r=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#l?.remove(),this.#l=null,t){let a=new AbortController;this.#r=a,this.setAttribute("data-loading",""),this.#f("markdown-viewer:fetch",{src:t});try{let o=this.#c(t),l=await fetch(o,{signal:a.signal});if(l.url&&this.#h(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);r=await l.text()}catch(o){if(o.name==="AbortError"||e!==this.#a)return;this.#o(o);return}if(e!==this.#a)return;this.removeAttribute("data-loading")}else this.#s!=null?r=this.#s:r=this.#n();if(r==null){this.#t?.replaceChildren();return}this.#i=r;let s;try{s=await(await this.#m())(r)}catch(a){if(e!==this.#a)return;this.#o(a);return}if(e!==this.#a)return;(!this.#t||this.#t.parentNode!==this)&&(this.#t=document.createElement("div"),this.#t.className="md-content",this.#t.setAttribute("part","content"),this.appendChild(this.#t)),this.hasAttribute("dir")?this.#t.removeAttribute("dir"):this.#t.setAttribute("dir","auto"),this.#p()?this.#t.replaceChildren(q(String(s??""))):this.#t.innerHTML=String(s??""),this.#d(),this.setAttribute("data-rendered","");let n=this.getAttribute("ping");if(n&&navigator.sendBeacon?.(n,JSON.stringify({src:t||"inline"})),this.#f("markdown-viewer:rendered",{src:t,node:this.#t}),this.hasAttribute("highlight"))for(let a of this.#t.querySelectorAll('pre > code[class*="language-"]')){let o=a.className.match(/language-(\S+)/)?.[1]||"";this.#f("markdown-viewer:highlight",{node:a,language:o})}}#o(e){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#t?.replaceChildren(),!this.querySelector(":scope > pre")){let t=document.createElement("p");t.setAttribute("role","alert"),t.setAttribute("data-md-error",""),t.textContent=this.getAttribute("data-label-error")||tr,this.append(t),this.#l=t}this.#f("markdown-viewer:error",{error:e.message})}async#m(){return this.#e?this.#e:e=>nr.parse(e)}#p(){let e=this.getAttribute("sanitize");return e==null?!0:!/^(off|false)$/i.test(e.trim())}#d(){if(!this.#t)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#t.dataset.theme=e)}#f(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-viewer",F)});var He={};fe(He,{MarkdownEditor:()=>V});var De,ar,V,Oe=$(()=>{L();z();oe();De={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},ar=0,V=class extends w{#e=null;#r=null;#t=null;#l=null;#s=null;#i="";#a=null;#n=null;#c=!1;#h={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#u()||this.#o(),this.#x(),this.#g()}teardown(){this.#n!==null&&clearTimeout(this.#n),this.#n=null,this.#c=!1,this.removeAttribute("data-editing")}attributeChangedCallback(e,t,r){!this.#e||t===r||(e==="placeholder"?this.#f(this.#e,"placeholder",r??this.#h.placeholder):e==="rows"?this.#m():e==="highlight"?this.#r?.toggleAttribute("highlight",r!=null):this.#p())}get value(){return this.#e?.value??this.#a??""}set value(e){let t=e==null?"":String(e);if(!this.#e){this.#a=t;return}this.#e.value!==t&&(this.#e.value=t,this.#i=t,this.#g(),this.#b("markdown-editor:change",{value:t,source:"api"}))}get textarea(){return this.#e}#u(){return!!(this.#e&&this.#t?.parentNode===this&&this.#l?.parentNode===this&&this.#t.contains(this.#e))}#o(){let e=this.#e&&this.contains(this.#e)?this.#e:this.querySelector("textarea"),t=[...this.childNodes];e||(e=document.createElement("textarea"),t.push(e)),this.#e=e,this.#h={placeholder:e.getAttribute("placeholder"),rows:e.getAttribute("rows")},this.hasAttribute("placeholder")&&(e.placeholder=this.getAttribute("placeholder")??""),this.#m(),e.hasAttribute("dir")||(e.dir="auto"),e.hasAttribute("spellcheck")||(e.spellcheck=!0),this.#t=document.createElement("section"),this.#t.className="md-editor-pane",this.#t.append(...t),this.#l=document.createElement("section"),this.#l.className="md-preview-pane",this.#r=document.createElement("markdown-viewer");let r=e.getAttribute("dir");r&&r!=="auto"&&(this.#l.dir=r),this.#r.dir=r||"auto",this.hasAttribute("highlight")&&this.#r.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#r.dataset.theme=s),this.#l.append(this.#r),this.hasAttribute("data-tab-indent")){this.#s=document.createElement("span"),this.#s.className="visually-hidden",this.#s.id=`md-editor-tab-hint-${++ar}`,this.#s.textContent=this.dataset.labelTabHint||De.tabHint,this.#t.append(this.#s);let n=e.getAttribute("aria-describedby");e.setAttribute("aria-describedby",n?`${n} ${this.#s.id}`:this.#s.id)}this.replaceChildren(this.#t,this.#l),this.#p(),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&!e.labels?.length&&!e.title&&e.setAttribute("aria-label",this.#d("source")),this.#a!=null&&(e.value=this.#a,this.#a=null),this.#i=e.value}#m(){if(!this.#e)return;let e=this.getAttribute("rows")??this.#h.rows;this.#e.rows=parseInt(e??"",10)||10}#p(){this.#t?.setAttribute("aria-label",this.#d("source")),this.#l?.setAttribute("aria-label",this.#d("preview"))}#d(e){return(e==="source"?this.dataset.labelSource:this.dataset.labelPreview)||De[e]}#f(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}#x(){let e=this.#e;e&&(this.listen(e,"input",()=>{this.#b("markdown-editor:input",{value:e.value}),this.#v()}),this.listen(e,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(e,"blur",()=>{this.removeAttribute("data-editing"),this.#c=!1,e.value!==this.#i&&(this.#i=e.value,this.#b("markdown-editor:change",{value:e.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",t=>{!e.form||t.target!==e.form||queueMicrotask(()=>{this.#i=e.value,this.#g()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(e,"keydown",t=>{let r=t;if(r.key==="Escape"){this.#c=!0;return}if(r.key!=="Tab"||r.shiftKey||r.ctrlKey||r.metaKey||r.altKey){["Shift","Control","Alt","Meta"].includes(r.key)||(this.#c=!1);return}if(this.#c||e.readOnly||e.disabled){this.#c=!1;return}if(r.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:n}=e;e.setRangeText(" ",s,n,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#v(){this.#n!==null&&clearTimeout(this.#n),this.#n=setTimeout(()=>this.#g(),150)}#g(){this.#n!==null&&clearTimeout(this.#n),this.#n=null,this.#r&&(this.#r.markdown=this.#e?.value??"")}#b(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-editor",V)});L();z();W();L();z();var lr=i=>Math.max(10,Math.ceil(i*.1)),ce=class extends w{static formAssociated=!0;static observedAttributes=["value","disabled","placeholder","label","submit-label","cancel-label","data-show-cancel"];#e;#r=null;#t=null;#l=null;#s=null;#i=null;#a=null;#n=null;#c=null;#h=!1;#u=!1;constructor(){super(),this.#e=this.attachInternals(),this._adoptInternals(this.#e)}setup(){Promise.resolve().then(()=>(oe(),Be)).catch(()=>console.warn('[VB] comment-box: markdown-viewer failed to load (missing importmap for "marked"?)')),Promise.resolve().then(()=>(Oe(),He)).catch(()=>console.warn("[VB] comment-box: markdown-editor failed to load"));let e=[...this.querySelectorAll(':scope > [slot="toolbar"]'),...this.querySelectorAll(":scope > .comment-box-actions > .comment-box-toolbar > *")],t=this.querySelector(":scope > markdown-editor");if(!t){t=document.createElement("markdown-editor");let s=document.createElement("textarea");this.hasAttribute("value")&&(s.value=this.getAttribute("value")||""),t.appendChild(s)}this.#r=t,this.hasAttribute("placeholder")&&this.#r.setAttribute("placeholder",this.getAttribute("placeholder")||""),this.#t=document.createElement("div"),this.#t.className="comment-box-actions",this.#l=document.createElement("div"),this.#l.className="comment-box-toolbar",e.forEach(s=>this.#l?.appendChild(s)),e.length&&(this.#l.setAttribute("role","group"),this.#l.setAttribute("aria-label","Comment tools")),this.#t.appendChild(this.#l);let r=document.createElement("div");r.className="comment-box-buttons",this.#i=null,this.hasAttribute("data-show-cancel")&&(this.#i=this.#m(),r.appendChild(this.#i)),this.#s=document.createElement("button"),this.#s.type="button",this.#s.className="comment-box-submit",this.#s.textContent=this.getAttribute("submit-label")||"Comment",r.appendChild(this.#s),this.#t.appendChild(r),this.#a=null,this.#n=null,this.hasAttribute("data-max-length")&&(this.#a=document.createElement("span"),this.#a.className="comment-box-counter",this.#a.setAttribute("aria-hidden","true"),this.#t.appendChild(this.#a),this.#n=document.createElement("span"),this.#n.className="comment-box-status visually-hidden",this.#n.setAttribute("role","status"),this.#t.appendChild(this.#n)),this.replaceChildren(this.#r,this.#t),this.listen(this.#s,"click",this.#v),this.#i&&this.listen(this.#i,"click",this.#g),this.#p(),this.listen(this.#r,"markdown-editor:upgraded",()=>this.#p()),this.#k(),this.#w(),this.#y(),this.#S()}teardown(){this.#c=null}get#o(){return this.#r?.textarea??this.#r?.querySelector("textarea")??null}#m(){let e=document.createElement("button");return e.type="button",e.className="comment-box-cancel",e.textContent=this.getAttribute("cancel-label")||"Cancel",e}#p(){let e=this.#o;e&&(this.#d(e),this.#k(),this.#y(),e!==this.#c&&(this.#c=e,this.listen(e,"input",this.#f),this.listen(e,"keydown",this.#x)))}#d(e=this.#o){if(!e)return;let t=this.#e.labels?.[0],r=this.getAttribute("label")||t?.textContent?.trim()||"Comment";e.setAttribute("aria-label",r)}attributeChangedCallback(e,t,r){!this.isConnected||!this.#r||(e==="value"?this.value=r??"":e==="placeholder"?r==null?this.#r.removeAttribute("placeholder"):this.#r.setAttribute("placeholder",r):e==="label"?this.#d():e==="disabled"?this.#k():e==="submit-label"?this.#s&&(this.#s.textContent=r||"Comment"):e==="cancel-label"?this.#i&&(this.#i.textContent=r||"Cancel"):e==="data-show-cancel"&&(this.hasAttribute("data-show-cancel")&&!this.#i&&this.#s?(this.#i=this.#m(),this.#s.before(this.#i),this.listen(this.#i,"click",this.#g),this.#k()):!this.hasAttribute("data-show-cancel")&&this.#i&&(this.#i.remove(),this.#i=null)))}#f=()=>{this.#w(),this.#y(),this.#S(),this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))};#x=e=>{e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#v())};#v=()=>{if(this.#h||this.#b())return;if(!this.#e.validity.valid){this.#e.reportValidity(),this.#o?.focus();return}let e=this.value,t=[],r=!0,s=new CustomEvent("comment-box:submit",{bubbles:!0,cancelable:!0,detail:{value:e,waitUntil(a){if(!r)throw new DOMException("waitUntil() must be called while comment-box:submit is dispatching","InvalidStateError");t.push(Promise.resolve(a))}}}),n=this.dispatchEvent(s);if(r=!1,!!n){if(!t.length){this.clear();return}this.#A(!0),Promise.all(t).then(()=>{this.#A(!1),this.clear()},()=>{this.#A(!1),this.#o?.focus()})}};#g=()=>{let e=this.value;this.dispatchEvent(new CustomEvent("comment-box:cancel",{bubbles:!0,detail:{value:e}}))};#b(){return this.hasAttribute("disabled")||this.#u}#A(e){this.#h=e,e?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this.#k()}#k(){let e=this.#b(),t=this.#o;t&&(t.disabled=e,t.readOnly=this.#h),this.#s&&(this.#s.disabled=e,this.#h?this.#s.setAttribute("aria-disabled","true"):this.#s.removeAttribute("aria-disabled")),this.#i&&(this.#i.disabled=e)}#w(){this.#e.setFormValue(this.value)}#y(){let e=this.value,t=Number(this.getAttribute("data-min-length"))||0,r=Number(this.getAttribute("data-max-length"))||1/0,s=this.hasAttribute("required"),n=this.#o&&this.contains(this.#o)?this.#o:null;if(s&&e.length===0){this.#e.setValidity({valueMissing:!0},"Please add a comment.",n||void 0);return}if(e.length<t){this.#e.setValidity({tooShort:!0},`At least ${t} characters required.`,n||void 0);return}if(e.length>r){this.#e.setValidity({tooLong:!0},`No more than ${r} characters.`,n||void 0);return}this.#e.setValidity({})}#S(){if(!this.#a)return;let e=Number(this.getAttribute("data-max-length"))||0,t=this.value.length;if(this.#a.textContent=e?`${t} / ${e}`:String(t),this.#a.classList.toggle("is-over",e>0&&t>e),!this.#n)return;let r=e-t,s="";e&&r<0?s=`${-r} characters over the limit`:e&&r<=lr(e)&&(s=`${r} characters remaining`),this.#n.textContent!==s&&(this.#n.textContent=s)}get value(){return this.#r?.value??""}set value(e){this.#r&&(this.#r.value=e==null?"":String(e),this.#w(),this.#y(),this.#S())}get busy(){return this.#h}clear(){this.value="",this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:"",length:0}}))}focus(){this.#o?.focus()}formResetCallback(){this.value=this.getAttribute("value")??""}formStateRestoreCallback(e){e!=null&&(this.value=e)}formDisabledCallback(e){this.#u=e,this.#k()}get form(){return this.#e.form}get name(){return this.getAttribute("name")}get type(){return this.localName}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}};A("comment-box",ce);var or=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function cr(i){if(!i)return null;try{let e=new URL(i,document.baseURI);return e.protocol==="http:"||e.protocol==="https:"?i:null}catch{return null}}var hr=0,he=class extends w{#e=null;#r=null;#t=0;setup(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Comments"),this.#e=this.querySelector(":scope > template[data-reply-form]"),this.#l().forEach(e=>this.#i(e)),this.listen(this,"click",this.#o),this.listen(this,"comment-box:submit",this.#d),this.listen(this,"comment-box:cancel",this.#f),this.#k(),this.#t=setInterval(()=>this.#k(),6e4)}teardown(){clearInterval(this.#t)}#l(){return[...this.querySelectorAll(":scope > article[data-comment]")]}#s(e){return this.querySelector(`:scope > article[data-comment][id="${CSS.escape(e)}"]`)}#i(e){if(e.dataset.decorated==="")return;e.dataset.decorated="";let t=this.#a(e);e.style.setProperty("--comment-depth",String(t)),this.#n(e),e.appendChild(this.#h(e))}#a(e){let t=0,r=e.dataset.parent,s=new Set;for(;r&&!s.has(r);){s.add(r);let n=this.#s(r);if(!n)break;t+=1,r=n.dataset.parent}return t}#n(e){e.querySelector(":scope > .comment-header")?.remove();let t=this.#c(e),r=e.querySelector(":scope > [data-comment-body]");r?e.insertBefore(t,r):e.prepend(t);let s=[...t.querySelectorAll(".comment-author, .comment-time")].map(n=>n.id);e.setAttribute("aria-labelledby",s.join(" "))}#c(e){let t=document.createElement("header");t.className="comment-header";let r=e.id||`comment-thread-${++hr}`,s=e.dataset.author||"Unknown",n=cr(e.dataset.authorHref),a=e.dataset.authorAvatar;if(a){let h=document.createElement("user-avatar"),c=document.createElement("img");c.src=a,c.alt="",c.loading="lazy",c.decoding="async",h.appendChild(c),t.appendChild(h)}let o=document.createElement(n?"a":"span");o.className="comment-author",o.id=`${r}-author`,o.textContent=s,n&&(o.href=n),t.appendChild(o);let l=e.dataset.time;if(l){let h=document.createElement("time");h.className="comment-time",h.id=`${r}-time`,h.setAttribute("datetime",l);let c=this.#w(l);c&&h.setAttribute("title",c),h.textContent=this.#A(l)||l,t.appendChild(h)}if(e.dataset.edited){let h=document.createElement("span");h.className="comment-edited";let c=this.#w(e.dataset.edited);c&&(h.title=`Edited ${c}`),h.textContent="(edited)",t.appendChild(h)}return t}#h(e){let t=document.createElement("footer");if(t.className="comment-footer",this.hasAttribute("data-disabled"))return t;t.setAttribute("role","group"),t.setAttribute("aria-label","Comment actions");let r=document.createElement("button");if(r.type="button",r.className="comment-action comment-reply",r.textContent="Reply",t.appendChild(r),e.hasAttribute("data-mine")){let s=document.createElement("button");s.type="button",s.className="comment-action comment-edit",s.textContent="Edit",t.appendChild(s);let n=document.createElement("button");n.type="button",n.className="comment-action comment-delete",n.textContent="Delete",t.appendChild(n)}return this.#u(e,t),t}#u(e,t=e.querySelector(":scope > .comment-footer")){if(!t)return;let r=e.dataset.author||"Unknown",s=e.dataset.time?this.#w(e.dataset.time):"",n=s?` from ${s}`:"";t.querySelector(".comment-reply")?.setAttribute("aria-label",`Reply to ${r}${n}`),t.querySelector(".comment-edit")?.setAttribute("aria-label",`Edit your comment${n}`),t.querySelector(".comment-delete")?.setAttribute("aria-label",`Delete your comment${n}`)}#o=e=>{let t=e.target.closest?.("button.comment-action");if(!t)return;let r=t.closest("article[data-comment]");!r||r.parentElement!==this||(t.classList.contains("comment-reply")?this.#m(r):t.classList.contains("comment-edit")?this.#v(r):t.classList.contains("comment-delete")&&this.#g(r))};#m(e){if(this.#r&&this.#x(!1),!this.#e)return;let r=this.#e.content.cloneNode(!0).firstElementChild??document.createElement("comment-box");r.hasAttribute("data-show-cancel")||r.setAttribute("data-show-cancel",""),r.localName==="comment-box"&&!r.hasAttribute("label")&&r.setAttribute("label",`Reply to ${e.dataset.author||"comment"}`);let s=document.createElement("div");s.className="comment-reply-form",s.setAttribute("data-parent",e.id||""),s.appendChild(r),e.appendChild(s),this.#r=s,requestAnimationFrame(()=>r.focus?.())}#p(e){let t=e.target.closest?.(".comment-reply-form");return t&&t===this.#r?t:null}#d=e=>{let t=this.#p(e);if(!t)return;let r=e,s=t.parentElement,n=[],a=!0,o=this.dispatchEvent(new CustomEvent("comment-thread:reply",{bubbles:!0,cancelable:!0,detail:{parentId:s.id,value:r.detail.value,waitUntil(h){if(!a)throw new DOMException("waitUntil() must be called while comment-thread:reply is dispatching","InvalidStateError");n.push(Promise.resolve(h))}}}));if(a=!1,!o){r.preventDefault();return}if(!n.length){this.#x(!0);return}let l=Promise.all(n);r.detail.waitUntil?.(l),l.then(()=>{this.#r===t&&this.#x(!0)},()=>{})};#f=e=>{this.#p(e)&&this.#x(!0)};#x(e){let t=this.#r;if(!t)return;let r=t.parentElement,s=t.contains(document.activeElement);t.remove(),this.#r=null,(e||s)&&r?.querySelector(":scope > .comment-footer > .comment-reply")?.focus()}#v(e){let r=e.querySelector(":scope > [data-comment-body]")?.textContent.trim()??"";this.dispatchEvent(new CustomEvent("comment-thread:edit-request",{bubbles:!0,detail:{commentId:e.id,value:r}}))}#g(e){this.dispatchEvent(new CustomEvent("comment-thread:delete-request",{bubbles:!0,detail:{commentId:e.id}}))}#b(){return this.closest("[lang]")?.lang||void 0}#A(e){let t=new Date(e).getTime();if(Number.isNaN(t))return"";let r=(t-Date.now())/1e3,s=new Intl.RelativeTimeFormat(this.#b(),{numeric:"auto"});for(let[n,a]of or)if(Math.abs(r)>=a)return s.format(Math.trunc(r/a),n);return s.format(0,"second")}#k(){for(let e of this.querySelectorAll(":scope > article[data-comment] > .comment-header > time")){let t=e.getAttribute("datetime");if(!t)continue;let r=this.#A(t);r&&(e.textContent=r)}}#w(e){let t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(this.#b(),{dateStyle:"medium",timeStyle:"short"}).format(t)}#y(e,t){t.bodyText!=null?e.textContent=String(t.bodyText):t.bodyHtml!=null&&e.replaceChildren(q(String(t.bodyHtml))),"body"in t&&console.warn("[VB] comment-thread: `body` was removed \u2014 pass `bodyText` (plain text) or `bodyHtml` (sanitized HTML).")}addComment(e){let t=document.createElement("article");t.setAttribute("data-comment",""),t.id=e.id,t.dataset.author=e.author,e.authorHref&&(t.dataset.authorHref=e.authorHref),e.authorAvatar&&(t.dataset.authorAvatar=e.authorAvatar),t.dataset.time=e.time,e.parentId&&(t.dataset.parent=e.parentId),e.mine&&t.setAttribute("data-mine",""),e.edited&&(t.dataset.edited=e.edited);let r=document.createElement("div");r.setAttribute("data-comment-body",""),this.#y(r,e),t.appendChild(r);let s=e.parentId?this.#S(e.parentId):null;if(s)s.after(t);else if(this.#e?.parentNode===this)this.insertBefore(t,this.#e);else{let n=this.#l(),a=n[n.length-1];a?a.after(t):this.appendChild(t)}return this.#i(t),t}#S(e){let t=this.#s(e);if(!t)return null;let r=new Set([e]),s=t,n=t.nextElementSibling;for(;n instanceof HTMLElement&&n.matches("article[data-comment]")&&r.has(n.dataset.parent??"");)n.id&&r.add(n.id),s=n,n=n.nextElementSibling;return s}updateComment(e,t={}){let r=this.#s(e);if(!r)return;let s=r.querySelector(":scope > [data-comment-body]");s&&this.#y(s,t),t.author!=null&&(r.dataset.author=t.author),t.edited!=null&&(r.dataset.edited=t.edited),this.#n(r),this.#u(r)}removeComment(e){this.#s(e)?.remove()}};A("comment-thread",he);export{he as CommentThread};
60
61
  //# sourceMappingURL=comment-thread.js.map
@@ -1,2 +1,2 @@
1
- var s=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,n,r){e.addEventListener(t,n,r),this.#e.push(()=>e.removeEventListener(t,n,r))}setup(){}teardown(){}setState(e,t){this.#t||(this.#t=this.attachInternals());let n=this.#t.states;try{t?n.add(e):n.delete(e)}catch{let r=`--${e}`;t?n.add(r):n.delete(r)}}_adoptInternals(e){this.#t||(this.#t=e)}};var m=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function u(i,e,t={}){let n=t.priority??10,r={impl:e,bundle:t.bundle,contract:t.contract,priority:n},o=l.get(i);if(customElements.get(i)){if(!o||o.priority>=n){o&&o.priority===n&&o.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=n){o.priority===n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${o.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}l.set(i,r),customElements.define(i,e)}var c=class extends s{setup(){if(this.querySelector(":scope > button"))return;let e=document.createElement("button");e.type="button";let t=document.createElement("icon-wc");t.setAttribute("name","message-circle"),t.setAttribute("size","sm"),t.setAttribute("aria-hidden","true"),e.appendChild(t);let n=this.closest("selection-menu")?.getAttribute("for"),r=this.closest("review-surface")||(n?document.querySelector(`review-surface[for="${n}"]`):null);r?(e.setAttribute("aria-label","Add comment"),e.addEventListener("click",()=>this.#e(r))):(e.setAttribute("aria-label","Comments not available"),e.style.opacity="0.4",e.setAttribute("title","Wrap content in <review-surface> to enable comments")),this.appendChild(e)}#e(e){let t=this.closest("selection-menu");if(!t)return;let n=t.getSelection();if(!n)return;let r=n.range.getBoundingClientRect(),o=e.getBoundingClientRect(),a=(r.left+r.width/2-o.left)/o.width*100,d=(r.top-o.top)/o.height*100;typeof e.addPin=="function"&&e.addPin({x:a,y:d,text:n.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:n.text,x:a,y:d},bubbles:!0})),t.dismiss()}};u("comment-wc",c);
1
+ var c=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,n){e.addEventListener(t,i,n),this.#t.push(()=>e.removeEventListener(t,i,n))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{t?i.add(e):i.delete(e)}catch{let n=`--${e}`;t?i.add(n):i.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};var b=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function f(s,e,t={}){let i=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:i},r=u.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}u.set(s,n),customElements.define(s,e)}var h=0,a=class extends c{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let t=document.createElement("button");t.type="button";let i=document.createElement("icon-wc");i.setAttribute("name","message-circle"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),t.appendChild(i);let n=document.createElement("span");n.className="comment-wc-reason visually-hidden",n.id=`comment-wc-reason-${++h}`,n.textContent="Comments are unavailable: this content has no review surface.",this.append(t,n),this.#t=t,this.#e=n}this.#n(),this.listen(this,"click",this.#r);let e=this.closest("selection-menu");e&&this.listen(e,"toggle",()=>this.#n())}#i(){let e=this.closest("review-surface");if(e)return e;let t=this.closest("selection-menu")?.getAttribute("for");return t?document.querySelector(`review-surface[for="${CSS.escape(t)}"]`):null}#n(){let e=this.#t;if(!e)return;!!this.#i()?(e.removeAttribute("aria-disabled"),e.removeAttribute("aria-describedby"),e.setAttribute("aria-label","Add comment")):(e.setAttribute("aria-disabled","true"),e.setAttribute("aria-label","Add comment"),this.#e&&e.setAttribute("aria-describedby",this.#e.id))}#r=e=>{if(!this.#t?.contains(e.target))return;this.#n();let t=this.#i();if(!t)return;let i=this.closest("selection-menu");if(!i)return;let n=i.getSelection();if(!n)return;let r=n.range.getBoundingClientRect(),o=t.getBoundingClientRect(),d=(r.left+r.width/2-o.left)/o.width*100,l=(r.top-o.top)/o.height*100;typeof t.addPin=="function"&&t.addPin({x:d,y:l,text:n.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:n.text,x:d,y:l},bubbles:!0})),i.dismiss()}};f("comment-wc",a);
2
2
  //# sourceMappingURL=comment-wc.js.map
@@ -1,2 +1,2 @@
1
- var l=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=c.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}c.set(s,n),customElements.define(s,t)}var o=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let n=`--${t}`;e?i.add(n):i.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}};var a=class extends o{#t;#e=!1;setup(){let t=[...this.children];if(t.length<2)return!1;t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children will be ignored.");let e=this.getAttribute("position"),i=e!==null?Number(e):50,n=Math.min(100,Math.max(0,isNaN(i)?50:i));return this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-label","Comparison slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow",String(Math.round(n))),this.#t.setAttribute("tabindex","0"),this.appendChild(this.#t),this.#i(n),this.listen(this.#t,"pointerdown",this.#s),this.listen(this.#t,"keydown",this.#o),!0}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#e=!1}#s=t=>{t.preventDefault(),this.#e=!0,this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#n),this.#t.addEventListener("pointerup",this.#r)};#n=t=>{if(!this.#e)return;let e=this.getBoundingClientRect(),i=t.clientX-e.left,n=Math.min(100,Math.max(0,i/e.width*100));this.#i(n)};#r=t=>{this.#e=!1,this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#n),this.#t.removeEventListener("pointerup",this.#r)};#o=t=>{let e=t.shiftKey?10:1,i=Number(this.#t.getAttribute("aria-valuenow"));t.key==="ArrowLeft"||t.key==="ArrowDown"?(t.preventDefault(),this.#i(Math.max(0,i-e))):(t.key==="ArrowRight"||t.key==="ArrowUp")&&(t.preventDefault(),this.#i(Math.min(100,i+e)))};#i(t){let e=Math.round(t);this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(e)),this.#t.style.left=`${t}%`),this.setAttribute("position",String(e)),this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:t},bubbles:!0}))}get position(){return Number(this.getAttribute("position"))||0}set position(t){let e=Math.min(100,Math.max(0,Number(t)||0));this.#i(e)}};d("compare-surface",a);export{a as CompareSurface};
1
+ var h=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function u(n,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=c.get(n);if(customElements.get(n)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}c.set(n,s),customElements.define(n,t)}var o=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};var d="Comparison slider";function a(n){if(n===null||n.trim()==="")return 50;let t=Number(n);return Number.isNaN(t)?50:Math.min(100,Math.max(0,t))}var l=class extends o{static observedAttributes=["position","label","aria-label"];#t=null;#e=!1;#i=!1;#r=50;setup(){let t=[...this.children].filter(e=>!e.classList.contains("comparison-divider"));return t.length<2?!1:(t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children are hidden."),this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("tabindex","0"),this.#o(),this.appendChild(this.#t),this.#n(a(this.getAttribute("position"))),this.listen(this.#t,"pointerdown",this.#c),this.listen(this.#t,"pointermove",this.#u),this.listen(this.#t,"pointerup",this.#s),this.listen(this.#t,"pointercancel",this.#s),this.listen(this.#t,"lostpointercapture",this.#s),this.listen(this.#t,"keydown",this.#d),!0)}teardown(){this.#t?.remove(),this.#t=null,this.#e=!1}attributeChangedCallback(t,e,i){if(!(!this.#t||e===i))if(t==="position"){if(this.#i)return;this.#n(a(i))}else this.#o()}#o(){if(!this.#t)return;let t=this.getAttribute("label")||this.getAttribute("aria-label")||d;this.#t.setAttribute("aria-label",t)}get#a(){return getComputedStyle(this).direction==="rtl"}#c=t=>{t.preventDefault(),this.#e=!0,this.#t?.setPointerCapture(t.pointerId)};#u=t=>{if(!this.#e)return;let e=this.getBoundingClientRect();if(!e.width)return;let i=this.#a?e.right-t.clientX:t.clientX-e.left;this.#l(i/e.width*100)};#s=t=>{this.#e&&(this.#e=!1,this.#t?.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))};#d=t=>{let e=t.shiftKey?10:1,i=this.#a?-1:1,s=this.#r,r;switch(t.key){case"ArrowRight":r=s+e*i;break;case"ArrowLeft":r=s-e*i;break;case"ArrowUp":r=s+e;break;case"ArrowDown":r=s-e;break;case"PageUp":r=s+10;break;case"PageDown":r=s-10;break;case"Home":r=0;break;case"End":r=100;break;default:return}t.preventDefault(),this.#l(r)};#l(t){let e=this.#r;if(this.#n(Math.min(100,Math.max(0,t))),this.#r!==e){this.#i=!0;try{this.setAttribute("position",String(this.#r))}finally{this.#i=!1}this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:this.#r},bubbles:!0}))}}#n(t){this.#r=Math.round(t),this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(this.#r)),this.#t.setAttribute("aria-valuetext",`${this.#r}%`))}get position(){return this.#t?this.#r:Math.round(a(this.getAttribute("position")))}set position(t){let e=Number(t),i=Math.round(Math.min(100,Math.max(0,Number.isNaN(e)?0:e)));this.setAttribute("position",String(i))}};u("compare-surface",l);export{l as CompareSurface};
2
2
  //# sourceMappingURL=compare-surface.js.map