for-humanity 0.12.0 → 0.13.1

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 (226) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +16 -9
  3. package/dist/browser.js +14 -16
  4. package/dist/cli.css +2 -968
  5. package/dist/cli.js +92 -2318
  6. package/dist/config.js +1 -0
  7. package/dist/constant/copy.d.ts +100 -0
  8. package/dist/constant/site.d.ts +20 -0
  9. package/dist/constant/status.d.ts +19 -0
  10. package/dist/copy-C1uzvEnr.js +103 -0
  11. package/dist/group-path-XAThmzvC.js +10 -0
  12. package/dist/load-site-B-u5-jv0.js +2343 -0
  13. package/dist/logger-Dv1i9xSV.js +9 -0
  14. package/dist/mermaid/THIRD-PARTY-NOTICES.txt +3134 -0
  15. package/dist/mermaid/chunk--TN-qHgG.js +2 -0
  16. package/dist/mermaid/chunk-0kM1Lv4D.js +2 -0
  17. package/dist/mermaid/chunk-3FHei3pH.js +2001 -0
  18. package/dist/mermaid/chunk-3_2p2GqN.js +2 -0
  19. package/dist/mermaid/chunk-6HLei9i0.js +84 -0
  20. package/dist/mermaid/chunk-7Sz3kAwl.js +2214 -0
  21. package/dist/mermaid/chunk-7Tarqbpa.js +18047 -0
  22. package/dist/mermaid/chunk-9kkt8lzL.js +10 -0
  23. package/dist/mermaid/chunk-B--pNBQF.js +884 -0
  24. package/dist/mermaid/chunk-B4F-pysn.js +4241 -0
  25. package/dist/mermaid/chunk-B58sEIY_.js +14 -0
  26. package/dist/mermaid/chunk-B9_UWzSH.js +1517 -0
  27. package/dist/mermaid/chunk-BB8uZHwY.js +75 -0
  28. package/dist/mermaid/chunk-BFfk0LEc.js +717 -0
  29. package/dist/mermaid/chunk-BKri0qr7.js +89 -0
  30. package/dist/mermaid/chunk-BL404pH5.js +26 -0
  31. package/dist/mermaid/chunk-BLeiQSWo.js +354 -0
  32. package/dist/mermaid/chunk-BOmH_UFd.js +2 -0
  33. package/dist/mermaid/chunk-BSej9Nhy.js +1361 -0
  34. package/dist/mermaid/chunk-BYzrzvCI.js +12 -0
  35. package/dist/mermaid/chunk-BariMtWr.js +3020 -0
  36. package/dist/mermaid/chunk-BcrBoMwH.js +2352 -0
  37. package/dist/mermaid/chunk-Bok8z-Yo.js +67 -0
  38. package/dist/mermaid/chunk-BpTHLKQM.js +1970 -0
  39. package/dist/mermaid/chunk-BqjuxRsC.js +733 -0
  40. package/dist/mermaid/chunk-BuvPd-s5.js +1073 -0
  41. package/dist/mermaid/chunk-BvVehae3.js +5069 -0
  42. package/dist/mermaid/chunk-C-JABYpd.js +3075 -0
  43. package/dist/mermaid/chunk-C9XlTm4w.js +2 -0
  44. package/dist/mermaid/chunk-CApNbSU9.js +6 -0
  45. package/dist/mermaid/chunk-CCM2AH-C.js +9 -0
  46. package/dist/mermaid/chunk-CD1E0F_N.js +2 -0
  47. package/dist/mermaid/chunk-CDWvKG7D.js +2 -0
  48. package/dist/mermaid/chunk-CEVPpC1F.js +34 -0
  49. package/dist/mermaid/chunk-CLDr12lf.js +47504 -0
  50. package/dist/mermaid/chunk-CLVYqOBI.js +61 -0
  51. package/dist/mermaid/chunk-CLeOkFb5.js +15 -0
  52. package/dist/mermaid/chunk-CLgRAtOz.js +37 -0
  53. package/dist/mermaid/chunk-CMqFNUBl.js +134 -0
  54. package/dist/mermaid/chunk-CTPaBJXB.js +2 -0
  55. package/dist/mermaid/chunk-CVi6IGBL.js +2 -0
  56. package/dist/mermaid/chunk-CWV_EN-4.js +4745 -0
  57. package/dist/mermaid/chunk-CZ0dAs3g.js +2 -0
  58. package/dist/mermaid/chunk-C_YGy4Fn.js +236 -0
  59. package/dist/mermaid/chunk-CcVH22Yt.js +100 -0
  60. package/dist/mermaid/chunk-CgG6CD9_.js +7175 -0
  61. package/dist/mermaid/chunk-CgOP6IDB.js +3397 -0
  62. package/dist/mermaid/chunk-Cgg2UTSf.js +13 -0
  63. package/dist/mermaid/chunk-ChJfJJ1A.js +214 -0
  64. package/dist/mermaid/chunk-Ck5XRA46.js +447 -0
  65. package/dist/mermaid/chunk-Ckuw16cl.js +203 -0
  66. package/dist/mermaid/chunk-CpAbRCbF.js +1880 -0
  67. package/dist/mermaid/chunk-CuYekbSv.js +2 -0
  68. package/dist/mermaid/chunk-CwS4wZ5a.js +2 -0
  69. package/dist/mermaid/chunk-D-bcrBO3.js +82 -0
  70. package/dist/mermaid/chunk-D3IEAkCW.js +76 -0
  71. package/dist/mermaid/chunk-D8XfBJ_K.js +645 -0
  72. package/dist/mermaid/chunk-D9Ddd9y4.js +2228 -0
  73. package/dist/mermaid/chunk-DBh1mIbK.js +12 -0
  74. package/dist/mermaid/chunk-DD6Df6Ic.js +5 -0
  75. package/dist/mermaid/chunk-DGVDaXjx.js +8 -0
  76. package/dist/mermaid/chunk-DK9KqIXj.js +632 -0
  77. package/dist/mermaid/chunk-DORnIAsy.js +4487 -0
  78. package/dist/mermaid/chunk-DU69_VcF.js +363 -0
  79. package/dist/mermaid/chunk-DVNvSFoz.js +2144 -0
  80. package/dist/mermaid/chunk-DZe-4kde.js +20 -0
  81. package/dist/mermaid/chunk-D_a06Rz4.js +287 -0
  82. package/dist/mermaid/chunk-DfyFJJi2.js +972 -0
  83. package/dist/mermaid/chunk-DhKYPp1Z.js +2 -0
  84. package/dist/mermaid/chunk-DjFqgNTG.js +94 -0
  85. package/dist/mermaid/chunk-DmbDDrr-.js +65 -0
  86. package/dist/mermaid/chunk-DpuxlyL_.js +696 -0
  87. package/dist/mermaid/chunk-DqGhppWe.js +2 -0
  88. package/dist/mermaid/chunk-DqPZxHXa.js +5 -0
  89. package/dist/mermaid/chunk-Dt_1Jyif.js +293 -0
  90. package/dist/mermaid/chunk-DyQBE_NW.js +1935 -0
  91. package/dist/mermaid/chunk-JckyC4mW.js +1009 -0
  92. package/dist/mermaid/chunk-K7Myuj2-.js +1334 -0
  93. package/dist/mermaid/chunk-KuPYb48V.js +275 -0
  94. package/dist/mermaid/chunk-MFVRUoO0.js +4020 -0
  95. package/dist/mermaid/chunk-MbInCS_6.js +28 -0
  96. package/dist/mermaid/chunk-MexOLyKV.js +355 -0
  97. package/dist/mermaid/chunk-NnbDtJzg.js +21856 -0
  98. package/dist/mermaid/chunk-SGpOYZbI.js +2139 -0
  99. package/dist/mermaid/chunk-TbxLDlcU.js +198 -0
  100. package/dist/mermaid/chunk-TftHqGLg.js +490 -0
  101. package/dist/mermaid/chunk-UjQ8vA_Z.js +4138 -0
  102. package/dist/mermaid/chunk-YgmVTKqc.js +16 -0
  103. package/dist/mermaid/chunk-_a9EZE1v.js +1798 -0
  104. package/dist/mermaid/chunk-dTb8jqeP.js +2 -0
  105. package/dist/mermaid/chunk-fFdMfF8S.js +2240 -0
  106. package/dist/mermaid/chunk-feYbMzBj.js +1267 -0
  107. package/dist/mermaid/chunk-g3Pn8DkW.js +46 -0
  108. package/dist/mermaid/chunk-hM77LvCb.js +19832 -0
  109. package/dist/mermaid/chunk-hUDb-eAW.js +527 -0
  110. package/dist/mermaid/chunk-tpABtZ-3.js +4252 -0
  111. package/dist/mermaid/chunk-xIbz3oFK.js +59 -0
  112. package/dist/mermaid/chunk-yBz-vst0.js +976 -0
  113. package/dist/mermaid/mermaid-BhtR3wyB.js +1145 -0
  114. package/dist/run-site-command-cqCjpIlc.js +129 -0
  115. package/dist/site-config-bllORGpm.js +90 -0
  116. package/dist/site.js +1 -0
  117. package/dist/start-dev-server-x7Ja5uwv.js +184 -0
  118. package/dist/to-change-queue-DbEnZGNK.js +34 -0
  119. package/dist/to-error-message-pF6_7wGK.js +16 -0
  120. package/dist/type/group-path.d.ts +7 -0
  121. package/dist/type/site-config.d.ts +57 -0
  122. package/package.json +34 -17
  123. package/src/component/widget/cursor-face/_constant/cursor-face.ts +0 -14
  124. package/src/component/widget/cursor-face/wg-cursor-face.css +0 -15
  125. package/src/component/widget/cursor-face/wg-cursor-face.tsx +0 -153
  126. package/src/component/widget/navigation/_constant/locale.ts +0 -9
  127. package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -33
  128. package/src/component/widget/navigation/_constant/navigation.ts +0 -9
  129. package/src/component/widget/navigation/_constant/reading-line.ts +0 -4
  130. package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +0 -59
  131. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-branches.ts +0 -15
  132. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-group-branches.ts +0 -70
  133. package/src/component/widget/navigation/_function/to-doc-groups/to-doc-groups.ts +0 -15
  134. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +0 -13
  135. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +0 -13
  136. package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +0 -18
  137. package/src/component/widget/navigation/_function/to-navigation-json.ts +0 -8
  138. package/src/component/widget/navigation/_function/to-toc-groups.ts +0 -38
  139. package/src/component/widget/navigation/_type/doc-branch.ts +0 -11
  140. package/src/component/widget/navigation/_type/doc-group.ts +0 -24
  141. package/src/component/widget/navigation/_type/navigation-data.ts +0 -75
  142. package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -17
  143. package/src/component/widget/navigation/_type/toc-group.ts +0 -39
  144. package/src/component/widget/navigation/_wg-navigation-nav-list.css +0 -48
  145. package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +0 -61
  146. package/src/component/widget/navigation/_wg-navigation-nav.css +0 -21
  147. package/src/component/widget/navigation/_wg-navigation-nav.tsx +0 -33
  148. package/src/component/widget/navigation/_wg-navigation-scroll.tsx +0 -117
  149. package/src/component/widget/navigation/_wg-navigation-toc.css +0 -91
  150. package/src/component/widget/navigation/_wg-navigation-toc.tsx +0 -114
  151. package/src/component/widget/navigation/wg-navigation.css +0 -282
  152. package/src/component/widget/navigation/wg-navigation.tsx +0 -420
  153. package/src/component/widget/prose/_constant/heading-highlight.ts +0 -4
  154. package/src/component/widget/prose/_constant/section.ts +0 -7
  155. package/src/component/widget/prose/_constant/status.ts +0 -9
  156. package/src/component/widget/prose/_function/has-block-content.ts +0 -30
  157. package/src/component/widget/prose/_function/rehype-head.ts +0 -31
  158. package/src/component/widget/prose/_function/rehype-sections/_to-section-headings.ts +0 -20
  159. package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +0 -21
  160. package/src/component/widget/prose/_function/rehype-tables.ts +0 -22
  161. package/src/component/widget/prose/_function/remark-blocks.ts +0 -112
  162. package/src/component/widget/prose/_function/remark-flow.ts +0 -26
  163. package/src/component/widget/prose/_function/remark-links.ts +0 -33
  164. package/src/component/widget/prose/_function/remark-parts.ts +0 -26
  165. package/src/component/widget/prose/_function/remark-status.ts +0 -59
  166. package/src/component/widget/prose/_function/remark-swatch.ts +0 -16
  167. package/src/component/widget/prose/_function/remark-unknown-directives.ts +0 -25
  168. package/src/component/widget/prose/wg-prose.css +0 -484
  169. package/src/component/widget/prose/wg-prose.tsx +0 -43
  170. package/src/component/widget/shell/wg-shell.css +0 -63
  171. package/src/component/widget/shell/wg-shell.tsx +0 -88
  172. package/src/component/widget/shell-controls/wg-shell-controls.css +0 -4
  173. package/src/component/widget/shell-controls/wg-shell-controls.tsx +0 -170
  174. package/src/constant/asset.ts +0 -63
  175. package/src/constant/copy.ts +0 -133
  176. package/src/constant/doc.ts +0 -13
  177. package/src/constant/font.ts +0 -34
  178. package/src/constant/site.ts +0 -24
  179. package/src/constant/status.ts +0 -15
  180. package/src/entry/browser/browser.tsx +0 -22
  181. package/src/entry/cli/_constant/cli.ts +0 -19
  182. package/src/entry/cli/_constant/crawling.ts +0 -14
  183. package/src/entry/cli/_constant/snippet.ts +0 -21
  184. package/src/entry/cli/_function/create-app.tsx +0 -57
  185. package/src/entry/cli/_function/create-dev-app.ts +0 -87
  186. package/src/entry/cli/_function/create-processor/_rehype-assets.ts +0 -70
  187. package/src/entry/cli/_function/create-processor/_rehype-heading-ids.ts +0 -34
  188. package/src/entry/cli/_function/create-processor/_remark-report.ts +0 -15
  189. package/src/entry/cli/_function/create-processor/_remark-snippets.ts +0 -117
  190. package/src/entry/cli/_function/create-processor/_shiki-transformers.ts +0 -91
  191. package/src/entry/cli/_function/create-processor/create-processor.ts +0 -64
  192. package/src/entry/cli/_function/read-docs.ts +0 -128
  193. package/src/entry/cli/_function/read-home.ts +0 -32
  194. package/src/entry/cli/_function/to-crawling-app.ts +0 -42
  195. package/src/entry/cli/cli.test.ts +0 -804
  196. package/src/entry/cli/cli.ts +0 -206
  197. package/src/env.d.ts +0 -6
  198. package/src/page/doc/pg-doc.tsx +0 -35
  199. package/src/page/home/pg-home.tsx +0 -40
  200. package/src/store/navigation/create-navigation-stores.test.ts +0 -74
  201. package/src/store/navigation/create-navigation-stores.ts +0 -59
  202. package/src/store/navigation/navigation-state.ts +0 -36
  203. package/src/store/navigation/navigation-storage.ts +0 -9
  204. package/src/store/navigation/to-navigation-scroll-state.ts +0 -42
  205. package/src/style/base.css +0 -28
  206. package/src/style/token.css +0 -188
  207. package/src/type/doc-content.ts +0 -15
  208. package/src/type/doc-data.ts +0 -38
  209. package/src/type/doc-file-data.ts +0 -21
  210. package/src/type/doc-heading.ts +0 -17
  211. package/src/type/doc-outline.ts +0 -16
  212. package/src/type/doc-section.ts +0 -9
  213. package/src/type/doc.ts +0 -20
  214. package/src/type/group-path.ts +0 -7
  215. package/src/type/site-assets.ts +0 -25
  216. package/src/type/site-config.ts +0 -73
  217. package/src/type/vfile-data.d.ts +0 -10
  218. package/src/util/async/to-change-queue.test.ts +0 -58
  219. package/src/util/async/to-change-queue.ts +0 -43
  220. package/src/util/dom/find-hash-target.ts +0 -18
  221. package/src/util/dom/reveal-hash-target.ts +0 -15
  222. package/src/util/error/to-error-message.ts +0 -10
  223. package/src/util/file/to-asset-path.ts +0 -26
  224. package/src/util/font/to-font-css.test.ts +0 -41
  225. package/src/util/font/to-font-css.ts +0 -28
  226. package/src/util/mermaid/render-flow.js +0 -321
@@ -0,0 +1,1798 @@
1
+ import { m as e, p as t } from "./chunk-DVNvSFoz.js";
2
+ import { n } from "./chunk-BYzrzvCI.js";
3
+ import { F as r, k as i, s as a, y as o, z as s } from "./chunk-MFVRUoO0.js";
4
+ import { a as c } from "./chunk-K7Myuj2-.js";
5
+ import { n as l, t as u } from "./chunk-KuPYb48V.js";
6
+ //#region node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js
7
+ function d() {
8
+ return {
9
+ async: !1,
10
+ breaks: !1,
11
+ extensions: null,
12
+ gfm: !0,
13
+ hooks: null,
14
+ pedantic: !1,
15
+ renderer: null,
16
+ silent: !1,
17
+ tokenizer: null,
18
+ walkTokens: null
19
+ };
20
+ }
21
+ var f = d();
22
+ function p(e) {
23
+ f = e;
24
+ }
25
+ var m = { exec: () => null };
26
+ function h(e, t = "") {
27
+ let n = typeof e == "string" ? e : e.source, r = {
28
+ replace: (e, t) => {
29
+ let i = typeof t == "string" ? t : t.source;
30
+ return i = i.replace(_.caret, "$1"), n = n.replace(e, i), r;
31
+ },
32
+ getRegex: () => new RegExp(n, t)
33
+ };
34
+ return r;
35
+ }
36
+ var g = (() => {
37
+ try {
38
+ return !0;
39
+ } catch {
40
+ return !1;
41
+ }
42
+ })(), _ = {
43
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
44
+ outputLinkReplace: /\\([\[\]])/g,
45
+ indentCodeCompensation: /^(\s+)(?:```)/,
46
+ beginningSpace: /^\s+/,
47
+ endingHash: /#$/,
48
+ startingSpaceChar: /^ /,
49
+ endingSpaceChar: / $/,
50
+ nonSpaceChar: /[^ ]/,
51
+ newLineCharGlobal: /\n/g,
52
+ tabCharGlobal: /\t/g,
53
+ multipleSpaceGlobal: /\s+/g,
54
+ blankLine: /^[ \t]*$/,
55
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
56
+ blockquoteStart: /^ {0,3}>/,
57
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
58
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
59
+ listReplaceTabs: /^\t+/,
60
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
61
+ listIsTask: /^\[[ xX]\] /,
62
+ listReplaceTask: /^\[[ xX]\] +/,
63
+ anyLine: /\n.*\n/,
64
+ hrefBrackets: /^<(.*)>$/,
65
+ tableDelimiter: /[:|]/,
66
+ tableAlignChars: /^\||\| *$/g,
67
+ tableRowBlankLine: /\n[ \t]*$/,
68
+ tableAlignRight: /^ *-+: *$/,
69
+ tableAlignCenter: /^ *:-+: *$/,
70
+ tableAlignLeft: /^ *:-+ *$/,
71
+ startATag: /^<a /i,
72
+ endATag: /^<\/a>/i,
73
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
74
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
75
+ startAngleBracket: /^</,
76
+ endAngleBracket: />$/,
77
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
78
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
79
+ escapeTest: /[&<>"']/,
80
+ escapeReplace: /[&<>"']/g,
81
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
82
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
83
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
84
+ caret: /(^|[^\[])\^/g,
85
+ percentDecode: /%25/g,
86
+ findPipe: /\|/g,
87
+ splitPipe: / \|/,
88
+ slashPipe: /\\\|/g,
89
+ carriageReturn: /\r\n|\r/g,
90
+ spaceLine: /^ +$/gm,
91
+ notSpaceStart: /^\S*/,
92
+ endingNewline: /\n$/,
93
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
94
+ nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
95
+ hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
96
+ fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
97
+ headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
98
+ htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
99
+ }, ee = /^(?:[ \t]*(?:\n|$))+/, te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ne = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, v = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, re = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, y = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = h(ie).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(), oe = h(ie).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(), b = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, se = /^[^\n]+/, x = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ce = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", x).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), le = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, y).getRegex(), S = "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", C = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ue = h("^ {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", C).replace("tag", S).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), de = h(b).replace("hr", v).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", S).getRegex(), w = {
100
+ blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", de).getRegex(),
101
+ code: te,
102
+ def: ce,
103
+ fences: ne,
104
+ heading: re,
105
+ hr: v,
106
+ html: ue,
107
+ lheading: ae,
108
+ list: le,
109
+ newline: ee,
110
+ paragraph: de,
111
+ table: m,
112
+ text: se
113
+ }, fe = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v).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[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", S).getRegex(), pe = {
114
+ ...w,
115
+ lheading: oe,
116
+ table: fe,
117
+ paragraph: h(b).replace("hr", v).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", fe).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", S).getRegex()
118
+ }, me = {
119
+ ...w,
120
+ html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", C).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(),
121
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
122
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
123
+ fences: m,
124
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
125
+ paragraph: h(b).replace("hr", v).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
126
+ }, he = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ge = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _e = /^( {2,}|\\)\n(?!\s*$)/, ve = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, T = /[\p{P}\p{S}]/u, E = /[\s\p{P}\p{S}]/u, ye = /[^\s\p{P}\p{S}]/u, be = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, E).getRegex(), xe = /(?!~)[\p{P}\p{S}]/u, Se = /(?!~)[\s\p{P}\p{S}]/u, Ce = /(?:[^\s\p{P}\p{S}]|~)/u, we = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", g ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Te = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ee = h(Te, "u").replace(/punct/g, T).getRegex(), De = h(Te, "u").replace(/punct/g, xe).getRegex(), Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ke = h(Oe, "gu").replace(/notPunctSpace/g, ye).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Ae = h(Oe, "gu").replace(/notPunctSpace/g, Ce).replace(/punctSpace/g, Se).replace(/punct/g, xe).getRegex(), je = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ye).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Me = h(/\\(punct)/, "gu").replace(/punct/g, T).getRegex(), Ne = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Pe = h(C).replace("(?:-->|$)", "-->").getRegex(), Fe = h("^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", Pe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), D = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ie = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", D).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Le = h(/^!?\[(label)\]\[(ref)\]/).replace("label", D).replace("ref", x).getRegex(), Re = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", x).getRegex(), ze = h("reflink|nolink(?!\\()", "g").replace("reflink", Le).replace("nolink", Re).getRegex(), Be = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, O = {
127
+ _backpedal: m,
128
+ anyPunctuation: Me,
129
+ autolink: Ne,
130
+ blockSkip: we,
131
+ br: _e,
132
+ code: ge,
133
+ del: m,
134
+ emStrongLDelim: Ee,
135
+ emStrongRDelimAst: ke,
136
+ emStrongRDelimUnd: je,
137
+ escape: he,
138
+ link: Ie,
139
+ nolink: Re,
140
+ punctuation: be,
141
+ reflink: Le,
142
+ reflinkSearch: ze,
143
+ tag: Fe,
144
+ text: ve,
145
+ url: m
146
+ }, Ve = {
147
+ ...O,
148
+ link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", D).getRegex(),
149
+ reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", D).getRegex()
150
+ }, k = {
151
+ ...O,
152
+ emStrongRDelimAst: Ae,
153
+ emStrongLDelim: De,
154
+ url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Be).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
155
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
156
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
157
+ text: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Be).getRegex()
158
+ }, He = {
159
+ ...k,
160
+ br: h(_e).replace("{2,}", "*").getRegex(),
161
+ text: h(k.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
162
+ }, A = {
163
+ normal: w,
164
+ gfm: pe,
165
+ pedantic: me
166
+ }, j = {
167
+ normal: O,
168
+ gfm: k,
169
+ breaks: He,
170
+ pedantic: Ve
171
+ }, Ue = {
172
+ "&": "&amp;",
173
+ "<": "&lt;",
174
+ ">": "&gt;",
175
+ "\"": "&quot;",
176
+ "'": "&#39;"
177
+ }, We = (e) => Ue[e];
178
+ function M(e, t) {
179
+ if (t) {
180
+ if (_.escapeTest.test(e)) return e.replace(_.escapeReplace, We);
181
+ } else if (_.escapeTestNoEncode.test(e)) return e.replace(_.escapeReplaceNoEncode, We);
182
+ return e;
183
+ }
184
+ function Ge(e) {
185
+ try {
186
+ e = encodeURI(e).replace(_.percentDecode, "%");
187
+ } catch {
188
+ return null;
189
+ }
190
+ return e;
191
+ }
192
+ function Ke(e, t) {
193
+ let n = e.replace(_.findPipe, (e, t, n) => {
194
+ let r = !1, i = t;
195
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
196
+ return r ? "|" : " |";
197
+ }).split(_.splitPipe), r = 0;
198
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
199
+ if (n.length > t) n.splice(t);
200
+ else for (; n.length < t;) n.push("");
201
+ }
202
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(_.slashPipe, "|");
203
+ return n;
204
+ }
205
+ function N(e, t, n) {
206
+ let r = e.length;
207
+ if (r === 0) return "";
208
+ let i = 0;
209
+ for (; i < r;) {
210
+ let a = e.charAt(r - i - 1);
211
+ if (a === t && !n) i++;
212
+ else if (a !== t && n) i++;
213
+ else break;
214
+ }
215
+ return e.slice(0, r - i);
216
+ }
217
+ function qe(e, t) {
218
+ if (e.indexOf(t[1]) === -1) return -1;
219
+ let n = 0;
220
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
221
+ else if (e[r] === t[0]) n++;
222
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
223
+ return n > 0 ? -2 : -1;
224
+ }
225
+ function Je(e, t, n, r, i) {
226
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
227
+ r.state.inLink = !0;
228
+ let c = {
229
+ type: e[0].charAt(0) === "!" ? "image" : "link",
230
+ raw: n,
231
+ href: a,
232
+ title: o,
233
+ text: s,
234
+ tokens: r.inlineTokens(s)
235
+ };
236
+ return r.state.inLink = !1, c;
237
+ }
238
+ function Ye(e, t, n) {
239
+ let r = e.match(n.other.indentCodeCompensation);
240
+ if (r === null) return t;
241
+ let i = r[1];
242
+ return t.split("\n").map((e) => {
243
+ let t = e.match(n.other.beginningSpace);
244
+ if (t === null) return e;
245
+ let [r] = t;
246
+ return r.length >= i.length ? e.slice(i.length) : e;
247
+ }).join("\n");
248
+ }
249
+ var P = class {
250
+ options;
251
+ rules;
252
+ lexer;
253
+ constructor(e) {
254
+ this.options = e || f;
255
+ }
256
+ space(e) {
257
+ let t = this.rules.block.newline.exec(e);
258
+ if (t && t[0].length > 0) return {
259
+ type: "space",
260
+ raw: t[0]
261
+ };
262
+ }
263
+ code(e) {
264
+ let t = this.rules.block.code.exec(e);
265
+ if (t) {
266
+ let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
267
+ return {
268
+ type: "code",
269
+ raw: t[0],
270
+ codeBlockStyle: "indented",
271
+ text: this.options.pedantic ? e : N(e, "\n")
272
+ };
273
+ }
274
+ }
275
+ fences(e) {
276
+ let t = this.rules.block.fences.exec(e);
277
+ if (t) {
278
+ let e = t[0], n = Ye(e, t[3] || "", this.rules);
279
+ return {
280
+ type: "code",
281
+ raw: e,
282
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
283
+ text: n
284
+ };
285
+ }
286
+ }
287
+ heading(e) {
288
+ let t = this.rules.block.heading.exec(e);
289
+ if (t) {
290
+ let e = t[2].trim();
291
+ if (this.rules.other.endingHash.test(e)) {
292
+ let t = N(e, "#");
293
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
294
+ }
295
+ return {
296
+ type: "heading",
297
+ raw: t[0],
298
+ depth: t[1].length,
299
+ text: e,
300
+ tokens: this.lexer.inline(e)
301
+ };
302
+ }
303
+ }
304
+ hr(e) {
305
+ let t = this.rules.block.hr.exec(e);
306
+ if (t) return {
307
+ type: "hr",
308
+ raw: N(t[0], "\n")
309
+ };
310
+ }
311
+ blockquote(e) {
312
+ let t = this.rules.block.blockquote.exec(e);
313
+ if (t) {
314
+ let e = N(t[0], "\n").split("\n"), n = "", r = "", i = [];
315
+ for (; e.length > 0;) {
316
+ let t = !1, a = [], o = 0;
317
+ for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
318
+ else if (!t) a.push(e[o]);
319
+ else break;
320
+ e = e.slice(o);
321
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
322
+ n = n ? `${n}
323
+ ${s}` : s, r = r ? `${r}
324
+ ${c}` : c;
325
+ let l = this.lexer.state.top;
326
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
327
+ let u = i.at(-1);
328
+ if (u?.type === "code") break;
329
+ if (u?.type === "blockquote") {
330
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
331
+ i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
332
+ break;
333
+ }
334
+ if (u?.type === "list") {
335
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
336
+ i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
337
+ }
338
+ }
339
+ return {
340
+ type: "blockquote",
341
+ raw: n,
342
+ tokens: i,
343
+ text: r
344
+ };
345
+ }
346
+ }
347
+ list(e) {
348
+ let t = this.rules.block.list.exec(e);
349
+ if (t) {
350
+ let n = t[1].trim(), r = n.length > 1, i = {
351
+ type: "list",
352
+ raw: "",
353
+ ordered: r,
354
+ start: r ? +n.slice(0, -1) : "",
355
+ loose: !1,
356
+ items: []
357
+ };
358
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
359
+ let a = this.rules.other.listItemRegex(n), o = !1;
360
+ for (; e;) {
361
+ let n = !1, r = "", s = "";
362
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
363
+ r = t[0], e = e.substring(r.length);
364
+ let c = t[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
365
+ if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = t[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
366
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d);
367
+ for (; e;) {
368
+ let f = e.split("\n", 1)[0], p;
369
+ if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || t.test(l) || n.test(l)) break;
370
+ if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
371
+ else {
372
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
373
+ s += "\n" + l;
374
+ }
375
+ !u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
376
+ }
377
+ }
378
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0));
379
+ let f = null, p;
380
+ this.options.gfm && (f = this.rules.other.listIsTask.exec(s), f && (p = f[0] !== "[ ] ", s = s.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
381
+ type: "list_item",
382
+ raw: r,
383
+ task: !!f,
384
+ checked: p,
385
+ loose: !1,
386
+ text: s,
387
+ tokens: []
388
+ }), i.raw += r;
389
+ }
390
+ let s = i.items.at(-1);
391
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
392
+ else return;
393
+ i.raw = i.raw.trimEnd();
394
+ for (let e = 0; e < i.items.length; e++) if (this.lexer.state.top = !1, i.items[e].tokens = this.lexer.blockTokens(i.items[e].text, []), !i.loose) {
395
+ let t = i.items[e].tokens.filter((e) => e.type === "space");
396
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
397
+ }
398
+ if (i.loose) for (let e = 0; e < i.items.length; e++) i.items[e].loose = !0;
399
+ return i;
400
+ }
401
+ }
402
+ html(e) {
403
+ let t = this.rules.block.html.exec(e);
404
+ if (t) return {
405
+ type: "html",
406
+ block: !0,
407
+ raw: t[0],
408
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
409
+ text: t[0]
410
+ };
411
+ }
412
+ def(e) {
413
+ let t = this.rules.block.def.exec(e);
414
+ if (t) {
415
+ let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
416
+ return {
417
+ type: "def",
418
+ tag: e,
419
+ raw: t[0],
420
+ href: n,
421
+ title: r
422
+ };
423
+ }
424
+ }
425
+ table(e) {
426
+ let t = this.rules.block.table.exec(e);
427
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
428
+ let n = Ke(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
429
+ type: "table",
430
+ raw: t[0],
431
+ header: [],
432
+ align: [],
433
+ rows: []
434
+ };
435
+ if (n.length === r.length) {
436
+ for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
437
+ for (let e = 0; e < n.length; e++) a.header.push({
438
+ text: n[e],
439
+ tokens: this.lexer.inline(n[e]),
440
+ header: !0,
441
+ align: a.align[e]
442
+ });
443
+ for (let e of i) a.rows.push(Ke(e, a.header.length).map((e, t) => ({
444
+ text: e,
445
+ tokens: this.lexer.inline(e),
446
+ header: !1,
447
+ align: a.align[t]
448
+ })));
449
+ return a;
450
+ }
451
+ }
452
+ lheading(e) {
453
+ let t = this.rules.block.lheading.exec(e);
454
+ if (t) return {
455
+ type: "heading",
456
+ raw: t[0],
457
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
458
+ text: t[1],
459
+ tokens: this.lexer.inline(t[1])
460
+ };
461
+ }
462
+ paragraph(e) {
463
+ let t = this.rules.block.paragraph.exec(e);
464
+ if (t) {
465
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
466
+ return {
467
+ type: "paragraph",
468
+ raw: t[0],
469
+ text: e,
470
+ tokens: this.lexer.inline(e)
471
+ };
472
+ }
473
+ }
474
+ text(e) {
475
+ let t = this.rules.block.text.exec(e);
476
+ if (t) return {
477
+ type: "text",
478
+ raw: t[0],
479
+ text: t[0],
480
+ tokens: this.lexer.inline(t[0])
481
+ };
482
+ }
483
+ escape(e) {
484
+ let t = this.rules.inline.escape.exec(e);
485
+ if (t) return {
486
+ type: "escape",
487
+ raw: t[0],
488
+ text: t[1]
489
+ };
490
+ }
491
+ tag(e) {
492
+ let t = this.rules.inline.tag.exec(e);
493
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
494
+ type: "html",
495
+ raw: t[0],
496
+ inLink: this.lexer.state.inLink,
497
+ inRawBlock: this.lexer.state.inRawBlock,
498
+ block: !1,
499
+ text: t[0]
500
+ };
501
+ }
502
+ link(e) {
503
+ let t = this.rules.inline.link.exec(e);
504
+ if (t) {
505
+ let e = t[2].trim();
506
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
507
+ if (!this.rules.other.endAngleBracket.test(e)) return;
508
+ let t = N(e.slice(0, -1), "\\");
509
+ if ((e.length - t.length) % 2 == 0) return;
510
+ } else {
511
+ let e = qe(t[2], "()");
512
+ if (e === -2) return;
513
+ if (e > -1) {
514
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
515
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
516
+ }
517
+ }
518
+ let n = t[2], r = "";
519
+ if (this.options.pedantic) {
520
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
521
+ e && (n = e[1], r = e[3]);
522
+ } else r = t[3] ? t[3].slice(1, -1) : "";
523
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Je(t, {
524
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
525
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
526
+ }, t[0], this.lexer, this.rules);
527
+ }
528
+ }
529
+ reflink(e, t) {
530
+ let n;
531
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
532
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
533
+ if (!e) {
534
+ let e = n[0].charAt(0);
535
+ return {
536
+ type: "text",
537
+ raw: e,
538
+ text: e
539
+ };
540
+ }
541
+ return Je(n, e, n[0], this.lexer, this.rules);
542
+ }
543
+ }
544
+ emStrong(e, t, n = "") {
545
+ let r = this.rules.inline.emStrongLDelim.exec(e);
546
+ if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
547
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
548
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
549
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
550
+ if (a = [...i].length, r[3] || r[4]) {
551
+ o += a;
552
+ continue;
553
+ }
554
+ if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
555
+ s += a;
556
+ continue;
557
+ }
558
+ if (o -= a, o > 0) continue;
559
+ a = Math.min(a, a + o + s);
560
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
561
+ if (Math.min(n, a) % 2) {
562
+ let e = c.slice(1, -1);
563
+ return {
564
+ type: "em",
565
+ raw: c,
566
+ text: e,
567
+ tokens: this.lexer.inlineTokens(e)
568
+ };
569
+ }
570
+ let l = c.slice(2, -2);
571
+ return {
572
+ type: "strong",
573
+ raw: c,
574
+ text: l,
575
+ tokens: this.lexer.inlineTokens(l)
576
+ };
577
+ }
578
+ }
579
+ }
580
+ codespan(e) {
581
+ let t = this.rules.inline.code.exec(e);
582
+ if (t) {
583
+ let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
584
+ return n && r && (e = e.substring(1, e.length - 1)), {
585
+ type: "codespan",
586
+ raw: t[0],
587
+ text: e
588
+ };
589
+ }
590
+ }
591
+ br(e) {
592
+ let t = this.rules.inline.br.exec(e);
593
+ if (t) return {
594
+ type: "br",
595
+ raw: t[0]
596
+ };
597
+ }
598
+ del(e) {
599
+ let t = this.rules.inline.del.exec(e);
600
+ if (t) return {
601
+ type: "del",
602
+ raw: t[0],
603
+ text: t[2],
604
+ tokens: this.lexer.inlineTokens(t[2])
605
+ };
606
+ }
607
+ autolink(e) {
608
+ let t = this.rules.inline.autolink.exec(e);
609
+ if (t) {
610
+ let e, n;
611
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
612
+ type: "link",
613
+ raw: t[0],
614
+ text: e,
615
+ href: n,
616
+ tokens: [{
617
+ type: "text",
618
+ raw: e,
619
+ text: e
620
+ }]
621
+ };
622
+ }
623
+ }
624
+ url(e) {
625
+ let t;
626
+ if (t = this.rules.inline.url.exec(e)) {
627
+ let e, n;
628
+ if (t[2] === "@") e = t[0], n = "mailto:" + e;
629
+ else {
630
+ let r;
631
+ do
632
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
633
+ while (r !== t[0]);
634
+ e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
635
+ }
636
+ return {
637
+ type: "link",
638
+ raw: t[0],
639
+ text: e,
640
+ href: n,
641
+ tokens: [{
642
+ type: "text",
643
+ raw: e,
644
+ text: e
645
+ }]
646
+ };
647
+ }
648
+ }
649
+ inlineText(e) {
650
+ let t = this.rules.inline.text.exec(e);
651
+ if (t) {
652
+ let e = this.lexer.state.inRawBlock;
653
+ return {
654
+ type: "text",
655
+ raw: t[0],
656
+ text: t[0],
657
+ escaped: e
658
+ };
659
+ }
660
+ }
661
+ }, F = class e {
662
+ tokens;
663
+ options;
664
+ state;
665
+ tokenizer;
666
+ inlineQueue;
667
+ constructor(e) {
668
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || f, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
669
+ inLink: !1,
670
+ inRawBlock: !1,
671
+ top: !0
672
+ };
673
+ let t = {
674
+ other: _,
675
+ block: A.normal,
676
+ inline: j.normal
677
+ };
678
+ this.options.pedantic ? (t.block = A.pedantic, t.inline = j.pedantic) : this.options.gfm && (t.block = A.gfm, t.inline = this.options.breaks ? j.breaks : j.gfm), this.tokenizer.rules = t;
679
+ }
680
+ static get rules() {
681
+ return {
682
+ block: A,
683
+ inline: j
684
+ };
685
+ }
686
+ static lex(t, n) {
687
+ return new e(n).lex(t);
688
+ }
689
+ static lexInline(t, n) {
690
+ return new e(n).inlineTokens(t);
691
+ }
692
+ lex(e) {
693
+ e = e.replace(_.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
694
+ for (let e = 0; e < this.inlineQueue.length; e++) {
695
+ let t = this.inlineQueue[e];
696
+ this.inlineTokens(t.src, t.tokens);
697
+ }
698
+ return this.inlineQueue = [], this.tokens;
699
+ }
700
+ blockTokens(e, t = [], n = !1) {
701
+ for (this.options.pedantic && (e = e.replace(_.tabCharGlobal, " ").replace(_.spaceLine, "")); e;) {
702
+ let r;
703
+ if (this.options.extensions?.block?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
704
+ if (r = this.tokenizer.space(e)) {
705
+ e = e.substring(r.raw.length);
706
+ let n = t.at(-1);
707
+ r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
708
+ continue;
709
+ }
710
+ if (r = this.tokenizer.code(e)) {
711
+ e = e.substring(r.raw.length);
712
+ let n = t.at(-1);
713
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
714
+ continue;
715
+ }
716
+ if ((r = this.tokenizer.fences(e)) || (r = this.tokenizer.heading(e)) || (r = this.tokenizer.hr(e)) || (r = this.tokenizer.blockquote(e)) || (r = this.tokenizer.list(e)) || (r = this.tokenizer.html(e))) {
717
+ e = e.substring(r.raw.length), t.push(r);
718
+ continue;
719
+ }
720
+ if (r = this.tokenizer.def(e)) {
721
+ e = e.substring(r.raw.length);
722
+ let n = t.at(-1);
723
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
724
+ href: r.href,
725
+ title: r.title
726
+ }, t.push(r));
727
+ continue;
728
+ }
729
+ if ((r = this.tokenizer.table(e)) || (r = this.tokenizer.lheading(e))) {
730
+ e = e.substring(r.raw.length), t.push(r);
731
+ continue;
732
+ }
733
+ let i = e;
734
+ if (this.options.extensions?.startBlock) {
735
+ let t = 1 / 0, n = e.slice(1), r;
736
+ this.options.extensions.startBlock.forEach((e) => {
737
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
738
+ }), t < 1 / 0 && t >= 0 && (i = e.substring(0, t + 1));
739
+ }
740
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
741
+ let a = t.at(-1);
742
+ n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith("\n") ? "" : "\n") + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
743
+ } else if (r = this.tokenizer.text(e)) {
744
+ e = e.substring(r.raw.length);
745
+ let n = t.at(-1);
746
+ n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
747
+ } else if (e) {
748
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
749
+ if (this.options.silent) {
750
+ console.error(t);
751
+ break;
752
+ }
753
+ throw Error(t);
754
+ }
755
+ }
756
+ return this.state.top = !0, t;
757
+ }
758
+ inline(e, t = []) {
759
+ return this.inlineQueue.push({
760
+ src: e,
761
+ tokens: t
762
+ }), t;
763
+ }
764
+ inlineTokens(e, t = []) {
765
+ let n = e, r = null;
766
+ if (this.tokens.links) {
767
+ let e = Object.keys(this.tokens.links);
768
+ if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
769
+ }
770
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
771
+ let i;
772
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
773
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
774
+ let a = !1, o = "";
775
+ for (; e;) {
776
+ a || (o = ""), a = !1;
777
+ let r;
778
+ if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
779
+ if ((r = this.tokenizer.escape(e)) || (r = this.tokenizer.tag(e)) || (r = this.tokenizer.link(e))) {
780
+ e = e.substring(r.raw.length), t.push(r);
781
+ continue;
782
+ }
783
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
784
+ e = e.substring(r.raw.length);
785
+ let n = t.at(-1);
786
+ r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
787
+ continue;
788
+ }
789
+ if ((r = this.tokenizer.emStrong(e, n, o)) || (r = this.tokenizer.codespan(e)) || (r = this.tokenizer.br(e)) || (r = this.tokenizer.del(e)) || (r = this.tokenizer.autolink(e)) || !this.state.inLink && (r = this.tokenizer.url(e))) {
790
+ e = e.substring(r.raw.length), t.push(r);
791
+ continue;
792
+ }
793
+ let i = e;
794
+ if (this.options.extensions?.startInline) {
795
+ let t = 1 / 0, n = e.slice(1), r;
796
+ this.options.extensions.startInline.forEach((e) => {
797
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
798
+ }), t < 1 / 0 && t >= 0 && (i = e.substring(0, t + 1));
799
+ }
800
+ if (r = this.tokenizer.inlineText(i)) {
801
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
802
+ let n = t.at(-1);
803
+ n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
804
+ } else if (e) {
805
+ let t = "Infinite loop on byte: " + e.charCodeAt(0);
806
+ if (this.options.silent) {
807
+ console.error(t);
808
+ break;
809
+ }
810
+ throw Error(t);
811
+ }
812
+ }
813
+ return t;
814
+ }
815
+ }, I = class {
816
+ options;
817
+ parser;
818
+ constructor(e) {
819
+ this.options = e || f;
820
+ }
821
+ space(e) {
822
+ return "";
823
+ }
824
+ code({ text: e, lang: t, escaped: n }) {
825
+ let r = (t || "").match(_.notSpaceStart)?.[0], i = e.replace(_.endingNewline, "") + "\n";
826
+ return r ? "<pre><code class=\"language-" + M(r) + "\">" + (n ? i : M(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : M(i, !0)) + "</code></pre>\n";
827
+ }
828
+ blockquote({ tokens: e }) {
829
+ return `<blockquote>
830
+ ${this.parser.parse(e)}</blockquote>
831
+ `;
832
+ }
833
+ html({ text: e }) {
834
+ return e;
835
+ }
836
+ def(e) {
837
+ return "";
838
+ }
839
+ heading({ tokens: e, depth: t }) {
840
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
841
+ `;
842
+ }
843
+ hr(e) {
844
+ return "<hr>\n";
845
+ }
846
+ list(e) {
847
+ let t = e.ordered, n = e.start, r = "";
848
+ for (let t = 0; t < e.items.length; t++) {
849
+ let n = e.items[t];
850
+ r += this.listitem(n);
851
+ }
852
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
853
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
854
+ }
855
+ listitem(e) {
856
+ let t = "";
857
+ if (e.task) {
858
+ let n = this.checkbox({ checked: !!e.checked });
859
+ e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + M(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
860
+ type: "text",
861
+ raw: n + " ",
862
+ text: n + " ",
863
+ escaped: !0
864
+ }) : t += n + " ";
865
+ }
866
+ return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
867
+ `;
868
+ }
869
+ checkbox({ checked: e }) {
870
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
871
+ }
872
+ paragraph({ tokens: e }) {
873
+ return `<p>${this.parser.parseInline(e)}</p>
874
+ `;
875
+ }
876
+ table(e) {
877
+ let t = "", n = "";
878
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
879
+ t += this.tablerow({ text: n });
880
+ let r = "";
881
+ for (let t = 0; t < e.rows.length; t++) {
882
+ let i = e.rows[t];
883
+ n = "";
884
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
885
+ r += this.tablerow({ text: n });
886
+ }
887
+ return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
888
+ }
889
+ tablerow({ text: e }) {
890
+ return `<tr>
891
+ ${e}</tr>
892
+ `;
893
+ }
894
+ tablecell(e) {
895
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
896
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
897
+ `;
898
+ }
899
+ strong({ tokens: e }) {
900
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
901
+ }
902
+ em({ tokens: e }) {
903
+ return `<em>${this.parser.parseInline(e)}</em>`;
904
+ }
905
+ codespan({ text: e }) {
906
+ return `<code>${M(e, !0)}</code>`;
907
+ }
908
+ br(e) {
909
+ return "<br>";
910
+ }
911
+ del({ tokens: e }) {
912
+ return `<del>${this.parser.parseInline(e)}</del>`;
913
+ }
914
+ link({ href: e, title: t, tokens: n }) {
915
+ let r = this.parser.parseInline(n), i = Ge(e);
916
+ if (i === null) return r;
917
+ e = i;
918
+ let a = "<a href=\"" + e + "\"";
919
+ return t && (a += " title=\"" + M(t) + "\""), a += ">" + r + "</a>", a;
920
+ }
921
+ image({ href: e, title: t, text: n, tokens: r }) {
922
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
923
+ let i = Ge(e);
924
+ if (i === null) return M(n);
925
+ e = i;
926
+ let a = `<img src="${e}" alt="${n}"`;
927
+ return t && (a += ` title="${M(t)}"`), a += ">", a;
928
+ }
929
+ text(e) {
930
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : M(e.text);
931
+ }
932
+ }, L = class {
933
+ strong({ text: e }) {
934
+ return e;
935
+ }
936
+ em({ text: e }) {
937
+ return e;
938
+ }
939
+ codespan({ text: e }) {
940
+ return e;
941
+ }
942
+ del({ text: e }) {
943
+ return e;
944
+ }
945
+ html({ text: e }) {
946
+ return e;
947
+ }
948
+ text({ text: e }) {
949
+ return e;
950
+ }
951
+ link({ text: e }) {
952
+ return "" + e;
953
+ }
954
+ image({ text: e }) {
955
+ return "" + e;
956
+ }
957
+ br() {
958
+ return "";
959
+ }
960
+ }, R = class e {
961
+ options;
962
+ renderer;
963
+ textRenderer;
964
+ constructor(e) {
965
+ this.options = e || f, this.options.renderer = this.options.renderer || new I(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
966
+ }
967
+ static parse(t, n) {
968
+ return new e(n).parse(t);
969
+ }
970
+ static parseInline(t, n) {
971
+ return new e(n).parseInline(t);
972
+ }
973
+ parse(e, t = !0) {
974
+ let n = "";
975
+ for (let r = 0; r < e.length; r++) {
976
+ let i = e[r];
977
+ if (this.options.extensions?.renderers?.[i.type]) {
978
+ let e = i, t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
979
+ if (t !== !1 || ![
980
+ "space",
981
+ "hr",
982
+ "heading",
983
+ "code",
984
+ "table",
985
+ "blockquote",
986
+ "list",
987
+ "html",
988
+ "def",
989
+ "paragraph",
990
+ "text"
991
+ ].includes(e.type)) {
992
+ n += t || "";
993
+ continue;
994
+ }
995
+ }
996
+ let a = i;
997
+ switch (a.type) {
998
+ case "space":
999
+ n += this.renderer.space(a);
1000
+ continue;
1001
+ case "hr":
1002
+ n += this.renderer.hr(a);
1003
+ continue;
1004
+ case "heading":
1005
+ n += this.renderer.heading(a);
1006
+ continue;
1007
+ case "code":
1008
+ n += this.renderer.code(a);
1009
+ continue;
1010
+ case "table":
1011
+ n += this.renderer.table(a);
1012
+ continue;
1013
+ case "blockquote":
1014
+ n += this.renderer.blockquote(a);
1015
+ continue;
1016
+ case "list":
1017
+ n += this.renderer.list(a);
1018
+ continue;
1019
+ case "html":
1020
+ n += this.renderer.html(a);
1021
+ continue;
1022
+ case "def":
1023
+ n += this.renderer.def(a);
1024
+ continue;
1025
+ case "paragraph":
1026
+ n += this.renderer.paragraph(a);
1027
+ continue;
1028
+ case "text": {
1029
+ let i = a, o = this.renderer.text(i);
1030
+ for (; r + 1 < e.length && e[r + 1].type === "text";) i = e[++r], o += "\n" + this.renderer.text(i);
1031
+ n += t ? this.renderer.paragraph({
1032
+ type: "paragraph",
1033
+ raw: o,
1034
+ text: o,
1035
+ tokens: [{
1036
+ type: "text",
1037
+ raw: o,
1038
+ text: o,
1039
+ escaped: !0
1040
+ }]
1041
+ }) : o;
1042
+ continue;
1043
+ }
1044
+ default: {
1045
+ let e = "Token with \"" + a.type + "\" type was not found.";
1046
+ if (this.options.silent) return console.error(e), "";
1047
+ throw Error(e);
1048
+ }
1049
+ }
1050
+ }
1051
+ return n;
1052
+ }
1053
+ parseInline(e, t = this.renderer) {
1054
+ let n = "";
1055
+ for (let r = 0; r < e.length; r++) {
1056
+ let i = e[r];
1057
+ if (this.options.extensions?.renderers?.[i.type]) {
1058
+ let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1059
+ if (e !== !1 || ![
1060
+ "escape",
1061
+ "html",
1062
+ "link",
1063
+ "image",
1064
+ "strong",
1065
+ "em",
1066
+ "codespan",
1067
+ "br",
1068
+ "del",
1069
+ "text"
1070
+ ].includes(i.type)) {
1071
+ n += e || "";
1072
+ continue;
1073
+ }
1074
+ }
1075
+ let a = i;
1076
+ switch (a.type) {
1077
+ case "escape":
1078
+ n += t.text(a);
1079
+ break;
1080
+ case "html":
1081
+ n += t.html(a);
1082
+ break;
1083
+ case "link":
1084
+ n += t.link(a);
1085
+ break;
1086
+ case "image":
1087
+ n += t.image(a);
1088
+ break;
1089
+ case "strong":
1090
+ n += t.strong(a);
1091
+ break;
1092
+ case "em":
1093
+ n += t.em(a);
1094
+ break;
1095
+ case "codespan":
1096
+ n += t.codespan(a);
1097
+ break;
1098
+ case "br":
1099
+ n += t.br(a);
1100
+ break;
1101
+ case "del":
1102
+ n += t.del(a);
1103
+ break;
1104
+ case "text":
1105
+ n += t.text(a);
1106
+ break;
1107
+ default: {
1108
+ let e = "Token with \"" + a.type + "\" type was not found.";
1109
+ if (this.options.silent) return console.error(e), "";
1110
+ throw Error(e);
1111
+ }
1112
+ }
1113
+ }
1114
+ return n;
1115
+ }
1116
+ }, z = class {
1117
+ options;
1118
+ block;
1119
+ constructor(e) {
1120
+ this.options = e || f;
1121
+ }
1122
+ static passThroughHooks = /* @__PURE__ */ new Set([
1123
+ "preprocess",
1124
+ "postprocess",
1125
+ "processAllTokens",
1126
+ "emStrongMask"
1127
+ ]);
1128
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
1129
+ "preprocess",
1130
+ "postprocess",
1131
+ "processAllTokens"
1132
+ ]);
1133
+ preprocess(e) {
1134
+ return e;
1135
+ }
1136
+ postprocess(e) {
1137
+ return e;
1138
+ }
1139
+ processAllTokens(e) {
1140
+ return e;
1141
+ }
1142
+ emStrongMask(e) {
1143
+ return e;
1144
+ }
1145
+ provideLexer() {
1146
+ return this.block ? F.lex : F.lexInline;
1147
+ }
1148
+ provideParser() {
1149
+ return this.block ? R.parse : R.parseInline;
1150
+ }
1151
+ }, B = new class {
1152
+ defaults = d();
1153
+ options = this.setOptions;
1154
+ parse = this.parseMarkdown(!0);
1155
+ parseInline = this.parseMarkdown(!1);
1156
+ Parser = R;
1157
+ Renderer = I;
1158
+ TextRenderer = L;
1159
+ Lexer = F;
1160
+ Tokenizer = P;
1161
+ Hooks = z;
1162
+ constructor(...e) {
1163
+ this.use(...e);
1164
+ }
1165
+ walkTokens(e, t) {
1166
+ let n = [];
1167
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1168
+ case "table": {
1169
+ let e = r;
1170
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1171
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1172
+ break;
1173
+ }
1174
+ case "list": {
1175
+ let e = r;
1176
+ n = n.concat(this.walkTokens(e.items, t));
1177
+ break;
1178
+ }
1179
+ default: {
1180
+ let e = r;
1181
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1182
+ let i = e[r].flat(1 / 0);
1183
+ n = n.concat(this.walkTokens(i, t));
1184
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1185
+ }
1186
+ }
1187
+ return n;
1188
+ }
1189
+ use(...e) {
1190
+ let t = this.defaults.extensions || {
1191
+ renderers: {},
1192
+ childTokens: {}
1193
+ };
1194
+ return e.forEach((e) => {
1195
+ let n = { ...e };
1196
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1197
+ if (!e.name) throw Error("extension name required");
1198
+ if ("renderer" in e) {
1199
+ let n = t.renderers[e.name];
1200
+ n ? t.renderers[e.name] = function(...t) {
1201
+ let r = e.renderer.apply(this, t);
1202
+ return r === !1 && (r = n.apply(this, t)), r;
1203
+ } : t.renderers[e.name] = e.renderer;
1204
+ }
1205
+ if ("tokenizer" in e) {
1206
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1207
+ let n = t[e.level];
1208
+ n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
1209
+ }
1210
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1211
+ }), n.extensions = t), e.renderer) {
1212
+ let t = this.defaults.renderer || new I(this.defaults);
1213
+ for (let n in e.renderer) {
1214
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1215
+ if (["options", "parser"].includes(n)) continue;
1216
+ let r = n, i = e.renderer[r], a = t[r];
1217
+ t[r] = (...e) => {
1218
+ let n = i.apply(t, e);
1219
+ return n === !1 && (n = a.apply(t, e)), n || "";
1220
+ };
1221
+ }
1222
+ n.renderer = t;
1223
+ }
1224
+ if (e.tokenizer) {
1225
+ let t = this.defaults.tokenizer || new P(this.defaults);
1226
+ for (let n in e.tokenizer) {
1227
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1228
+ if ([
1229
+ "options",
1230
+ "rules",
1231
+ "lexer"
1232
+ ].includes(n)) continue;
1233
+ let r = n, i = e.tokenizer[r], a = t[r];
1234
+ t[r] = (...e) => {
1235
+ let n = i.apply(t, e);
1236
+ return n === !1 && (n = a.apply(t, e)), n;
1237
+ };
1238
+ }
1239
+ n.tokenizer = t;
1240
+ }
1241
+ if (e.hooks) {
1242
+ let t = this.defaults.hooks || new z();
1243
+ for (let n in e.hooks) {
1244
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1245
+ if (["options", "block"].includes(n)) continue;
1246
+ let r = n, i = e.hooks[r], a = t[r];
1247
+ t[r] = z.passThroughHooks.has(n) ? (e) => {
1248
+ if (this.defaults.async && z.passThroughHooksRespectAsync.has(n)) return (async () => {
1249
+ let n = await i.call(t, e);
1250
+ return a.call(t, n);
1251
+ })();
1252
+ let r = i.call(t, e);
1253
+ return a.call(t, r);
1254
+ } : (...e) => {
1255
+ if (this.defaults.async) return (async () => {
1256
+ let n = await i.apply(t, e);
1257
+ return n === !1 && (n = await a.apply(t, e)), n;
1258
+ })();
1259
+ let n = i.apply(t, e);
1260
+ return n === !1 && (n = a.apply(t, e)), n;
1261
+ };
1262
+ }
1263
+ n.hooks = t;
1264
+ }
1265
+ if (e.walkTokens) {
1266
+ let t = this.defaults.walkTokens, r = e.walkTokens;
1267
+ n.walkTokens = function(e) {
1268
+ let n = [];
1269
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1270
+ };
1271
+ }
1272
+ this.defaults = {
1273
+ ...this.defaults,
1274
+ ...n
1275
+ };
1276
+ }), this;
1277
+ }
1278
+ setOptions(e) {
1279
+ return this.defaults = {
1280
+ ...this.defaults,
1281
+ ...e
1282
+ }, this;
1283
+ }
1284
+ lexer(e, t) {
1285
+ return F.lex(e, t ?? this.defaults);
1286
+ }
1287
+ parser(e, t) {
1288
+ return R.parse(e, t ?? this.defaults);
1289
+ }
1290
+ parseMarkdown(e) {
1291
+ return (t, n) => {
1292
+ let r = { ...n }, i = {
1293
+ ...this.defaults,
1294
+ ...r
1295
+ }, a = this.onError(!!i.silent, !!i.async);
1296
+ if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1297
+ if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1298
+ if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1299
+ if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1300
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer() : e ? F.lex : F.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1301
+ i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
1302
+ let o = await (i.hooks ? await i.hooks.provideParser() : e ? R.parse : R.parseInline)(a, i);
1303
+ return i.hooks ? await i.hooks.postprocess(o) : o;
1304
+ })().catch(a);
1305
+ try {
1306
+ i.hooks && (t = i.hooks.preprocess(t));
1307
+ let n = (i.hooks ? i.hooks.provideLexer() : e ? F.lex : F.lexInline)(t, i);
1308
+ i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
1309
+ let r = (i.hooks ? i.hooks.provideParser() : e ? R.parse : R.parseInline)(n, i);
1310
+ return i.hooks && (r = i.hooks.postprocess(r)), r;
1311
+ } catch (e) {
1312
+ return a(e);
1313
+ }
1314
+ };
1315
+ }
1316
+ onError(e, t) {
1317
+ return (n) => {
1318
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1319
+ let e = "<p>An error occurred:</p><pre>" + M(n.message + "", !0) + "</pre>";
1320
+ return t ? Promise.resolve(e) : e;
1321
+ }
1322
+ if (t) return Promise.reject(n);
1323
+ throw n;
1324
+ };
1325
+ }
1326
+ }();
1327
+ function V(e, t) {
1328
+ return B.parse(e, t);
1329
+ }
1330
+ V.options = V.setOptions = function(e) {
1331
+ return B.setOptions(e), V.defaults = B.defaults, p(V.defaults), V;
1332
+ }, V.getDefaults = d, V.defaults = f, V.use = function(...e) {
1333
+ return B.use(...e), V.defaults = B.defaults, p(V.defaults), V;
1334
+ }, V.walkTokens = function(e, t) {
1335
+ return B.walkTokens(e, t);
1336
+ }, V.parseInline = B.parseInline, V.Parser = R, V.parser = R.parse, V.Renderer = I, V.TextRenderer = L, V.Lexer = F, V.lexer = F.lex, V.Tokenizer = P, V.Hooks = z, V.parse = V, V.options, V.setOptions, V.use, V.walkTokens, V.parseInline, R.parse, F.lex;
1337
+ //#endregion
1338
+ //#region node_modules/.pnpm/ts-dedent@2.3.0/node_modules/ts-dedent/esm/index.js
1339
+ function Xe(e) {
1340
+ var t = [...arguments].slice(1), n = Array.from(typeof e == "string" ? [e] : e);
1341
+ n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
1342
+ var r = n.reduce(function(e, t) {
1343
+ var n = t.match(/\n([\t ]+|(?!\s).)/g);
1344
+ return n ? e.concat(n.map(function(e) {
1345
+ return e.match(/[\t ]/g)?.length ?? 0;
1346
+ })) : e;
1347
+ }, []);
1348
+ if (r.length) {
1349
+ var i = RegExp(`
1350
+ [ ]{${Math.min.apply(Math, r)}}`, "g");
1351
+ n = n.map(function(e) {
1352
+ return e.replace(i, "\n");
1353
+ });
1354
+ }
1355
+ n[0] = n[0].replace(/^\r?\n/, "");
1356
+ var a = n[0];
1357
+ return t.forEach(function(e, t) {
1358
+ var r = a.match(/(?:^|\n)( *)$/), i = r ? r[1] : "", o = e;
1359
+ typeof e == "string" && e.includes("\n") && (o = String(e).split("\n").map(function(e, t) {
1360
+ return t === 0 ? e : `${i}${e}`;
1361
+ }).join("\n")), a += o + n[t + 1];
1362
+ }), a;
1363
+ }
1364
+ //#endregion
1365
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AQDTSKZB.mjs
1366
+ var H = typeof performance < "u" && typeof performance.now == "function", U = /* @__PURE__ */ n(() => H ? performance.now() : 0, "now"), W = "🧜 ", Ze = "Mermaid render", Qe = "Mermaid", $e = {
1367
+ parse: "tertiary",
1368
+ prepare: "secondary",
1369
+ measure: "primary",
1370
+ layout: "primary-dark",
1371
+ layoutCore: "error",
1372
+ draw: "primary-light",
1373
+ paint: "secondary-dark",
1374
+ serialize: "tertiary-dark",
1375
+ render: "primary-light"
1376
+ };
1377
+ (class {
1378
+ constructor() {
1379
+ this.enabled = !1, this.autoPrint = !0, this.records = [], this.maxRecords = 200, this.roots = [], this.stack = [], this.buckets = {};
1380
+ }
1381
+ static {
1382
+ n(this, "Profiler");
1383
+ }
1384
+ enable() {
1385
+ return this.enabled = !0, this;
1386
+ }
1387
+ disable() {
1388
+ return this.enabled = !1, this;
1389
+ }
1390
+ start(e) {
1391
+ this.enabled && (this.roots = [], this.stack = [], this.buckets = {}, this.begin(e));
1392
+ }
1393
+ tickSync(e, t) {
1394
+ if (!this.enabled) return t();
1395
+ let n = U();
1396
+ try {
1397
+ return t();
1398
+ } finally {
1399
+ this.buckets[e] = (this.buckets[e] ?? 0) + (U() - n);
1400
+ }
1401
+ }
1402
+ async tick(e, t) {
1403
+ if (!this.enabled) return t();
1404
+ let n = U();
1405
+ try {
1406
+ return await t();
1407
+ } finally {
1408
+ this.buckets[e] = (this.buckets[e] ?? 0) + (U() - n);
1409
+ }
1410
+ }
1411
+ stop() {
1412
+ if (!this.enabled) return;
1413
+ for (; this.stack.length > 0;) this.end();
1414
+ let e = this.roots.at(-1), t = this.runLabel ?? e?.name;
1415
+ return e && (this.records.push({
1416
+ label: t ?? e.name,
1417
+ tree: e,
1418
+ buckets: { ...this.buckets }
1419
+ }), this.records.length > this.maxRecords && this.records.splice(0, this.records.length - this.maxRecords), this.autoPrint && this.printSummary(e, t)), this.runLabel = void 0, e;
1420
+ }
1421
+ begin(e) {
1422
+ if (!this.enabled) return;
1423
+ let t = {
1424
+ name: e,
1425
+ start: U(),
1426
+ duration: -1,
1427
+ children: []
1428
+ }, n = this.stack.at(-1);
1429
+ if (n ? n.children.push(t) : this.roots.push(t), this.stack.push(t), H && typeof performance.mark == "function") try {
1430
+ performance.mark(`${W}${e} \u25B6`);
1431
+ } catch {}
1432
+ }
1433
+ end() {
1434
+ if (!this.enabled) return;
1435
+ let e = this.stack.pop();
1436
+ if (!e) return;
1437
+ let t = U();
1438
+ if (e.duration = t - e.start, H && typeof performance.measure == "function") try {
1439
+ performance.measure(`${W}${e.name}`, {
1440
+ start: e.start,
1441
+ end: t,
1442
+ detail: { devtools: {
1443
+ dataType: "track-entry",
1444
+ track: Ze,
1445
+ trackGroup: Qe,
1446
+ color: $e[e.name] ?? "primary",
1447
+ tooltipText: `${e.name} \u2014 ${e.duration.toFixed(1)} ms`
1448
+ } }
1449
+ });
1450
+ } catch {}
1451
+ }
1452
+ async span(e, t) {
1453
+ if (!this.enabled) return t();
1454
+ this.begin(e);
1455
+ try {
1456
+ return await t();
1457
+ } finally {
1458
+ this.end();
1459
+ }
1460
+ }
1461
+ report() {
1462
+ return this.records.at(-1)?.tree ?? this.roots.at(-1);
1463
+ }
1464
+ clear() {
1465
+ this.records.length = 0, this.roots = [], this.stack = [], this.runLabel = void 0;
1466
+ }
1467
+ reset() {
1468
+ this.roots = [], this.stack = [];
1469
+ }
1470
+ printSummary(e = this.report(), t) {
1471
+ if (!e) return;
1472
+ let r = e.duration, i = t && t !== e.name ? `${e.name} [${t}]` : e.name, a = ["ms % phase"], o = /* @__PURE__ */ n((e, t) => {
1473
+ let n = " ".repeat(t), i = e.duration.toFixed(1).padStart(8), s = r > 0 ? `${(e.duration / r * 100).toFixed(0).padStart(3)}%` : " -";
1474
+ a.push(`${i} ${s} ${n}${e.name}`);
1475
+ for (let n of e.children) o(n, t + 1);
1476
+ if (e.children.length > 0) {
1477
+ let t = e.children.reduce((e, t) => e + t.duration, 0), r = e.duration - t;
1478
+ if (r > .5) {
1479
+ let e = r.toFixed(1).padStart(8);
1480
+ a.push(`${e} ${n} (self)`);
1481
+ }
1482
+ }
1483
+ }, "walk");
1484
+ o(e, 0);
1485
+ let s = Object.keys(this.buckets);
1486
+ if (s.length > 0) {
1487
+ a.push("—— buckets (summed) ——");
1488
+ for (let e of s) a.push(`${this.buckets[e].toFixed(1).padStart(8)} ${e}`);
1489
+ }
1490
+ console.log(`${W}mermaid render profile \xB7 ${i}
1491
+ ${a.join("\n")}`);
1492
+ }
1493
+ }), globalThis.injected ??= {
1494
+ includeLargeFeatures: !0,
1495
+ profiling: !1,
1496
+ version: "0.0.0"
1497
+ };
1498
+ function et(e, { markdownAutoWrap: t }) {
1499
+ return Xe(e.replace(/<br\/>/g, "\n").replace(/\n{2,}/g, "\n"));
1500
+ }
1501
+ n(et, "preprocessMarkdown");
1502
+ function tt(e) {
1503
+ return e.split(/\\n|\n|<br\s*\/?>/gi).map((e) => e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map((e) => ({
1504
+ content: e,
1505
+ type: "normal"
1506
+ })) ?? []);
1507
+ }
1508
+ n(tt, "nonMarkdownToLines");
1509
+ function G(e, t = {}) {
1510
+ let r = et(e, t), i = V.lexer(r), a = [[]], o = 0;
1511
+ function s(e, t = "normal") {
1512
+ e.type === "text" ? e.text.split("\n").forEach((e, n) => {
1513
+ n !== 0 && (o++, a.push([])), e.split(" ").forEach((e) => {
1514
+ e = e.replace(/&#39;/g, "'"), e && a[o].push({
1515
+ content: e,
1516
+ type: t
1517
+ });
1518
+ });
1519
+ }) : e.type === "strong" || e.type === "em" ? e.tokens.forEach((t) => {
1520
+ s(t, e.type);
1521
+ }) : e.type === "html" && a[o].push({
1522
+ content: e.text,
1523
+ type: "normal"
1524
+ });
1525
+ }
1526
+ return n(s, "processNode"), i.forEach((e) => {
1527
+ e.type === "paragraph" ? e.tokens?.forEach((e) => {
1528
+ s(e);
1529
+ }) : e.type === "html" ? a[o].push({
1530
+ content: e.text,
1531
+ type: "normal"
1532
+ }) : a[o].push({
1533
+ content: e.raw,
1534
+ type: "normal"
1535
+ });
1536
+ }), a;
1537
+ }
1538
+ n(G, "markdownToLines");
1539
+ function nt(e) {
1540
+ return e ? `<p>${e.replace(/\\n|\n/g, "<br />")}</p>` : "";
1541
+ }
1542
+ n(nt, "nonMarkdownToHTML");
1543
+ function rt(t, { markdownAutoWrap: r } = {}) {
1544
+ let i = V.lexer(t);
1545
+ function a(t) {
1546
+ return t.type === "text" ? r === !1 ? t.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;") : t.text.replace(/\n */g, "<br/>") : t.type === "strong" ? `<strong>${t.tokens?.map(a).join("")}</strong>` : t.type === "em" ? `<em>${t.tokens?.map(a).join("")}</em>` : t.type === "paragraph" ? `<p>${t.tokens?.map(a).join("")}</p>` : t.type === "space" ? "" : t.type === "html" ? `${t.text}` : t.type === "escape" ? t.text : (e.warn(`Unsupported markdown: ${t.type}`), t.raw);
1547
+ }
1548
+ return n(a, "output"), i.map(a).join("");
1549
+ }
1550
+ n(rt, "markdownToHTML");
1551
+ var it = (function(e) {
1552
+ var t = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(e) {
1553
+ return setTimeout(e, 16);
1554
+ };
1555
+ function r() {
1556
+ var n = this;
1557
+ n.reads = [], n.writes = [], n.raf = t.bind(e);
1558
+ }
1559
+ n(r, "FastDom"), r.prototype = {
1560
+ constructor: r,
1561
+ runTasks: /* @__PURE__ */ n(function(e) {
1562
+ for (var t; t = e.shift();) t();
1563
+ }, "runTasks"),
1564
+ measure: /* @__PURE__ */ n(function(e, t) {
1565
+ var n = t ? e.bind(t) : e;
1566
+ return this.reads.push(n), i(this), n;
1567
+ }, "measure"),
1568
+ mutate: /* @__PURE__ */ n(function(e, t) {
1569
+ var n = t ? e.bind(t) : e;
1570
+ return this.writes.push(n), i(this), n;
1571
+ }, "mutate"),
1572
+ clear: /* @__PURE__ */ n(function(e) {
1573
+ return o(this.reads, e) || o(this.writes, e);
1574
+ }, "clear"),
1575
+ extend: /* @__PURE__ */ n(function(e) {
1576
+ if (typeof e != "object") throw Error("expected object");
1577
+ var t = Object.create(this);
1578
+ return s(t, e), t.fastdom = this, t.initialize && t.initialize(), t;
1579
+ }, "extend"),
1580
+ catch: null
1581
+ };
1582
+ function i(e) {
1583
+ e.scheduled || (e.scheduled = !0, e.raf(a.bind(null, e)));
1584
+ }
1585
+ n(i, "scheduleFlush");
1586
+ function a(e) {
1587
+ var t = e.writes, n = e.reads, r;
1588
+ try {
1589
+ n.length, e.runTasks(n), t.length, e.runTasks(t);
1590
+ } catch (e) {
1591
+ r = e;
1592
+ }
1593
+ if (e.scheduled = !1, (n.length || t.length) && i(e), r) {
1594
+ if (r.message, e.catch) e.catch(r);
1595
+ else throw r;
1596
+ }
1597
+ }
1598
+ n(a, "flush");
1599
+ function o(e, t) {
1600
+ var n = e.indexOf(t);
1601
+ return !!~n && !!e.splice(n, 1);
1602
+ }
1603
+ n(o, "remove");
1604
+ function s(e, t) {
1605
+ for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
1606
+ }
1607
+ return n(s, "mixin"), e.fastdom = e.fastdom || new r();
1608
+ })(typeof window < "u" ? window : globalThis), at = {
1609
+ initialize: /* @__PURE__ */ n(function() {
1610
+ this._tasks = /* @__PURE__ */ new Map();
1611
+ }, "initialize"),
1612
+ mutate: /* @__PURE__ */ n(function(e, t) {
1613
+ return K(this, "mutate", e, t);
1614
+ }, "mutate"),
1615
+ measure: /* @__PURE__ */ n(function(e, t) {
1616
+ return K(this, "measure", e, t);
1617
+ }, "measure"),
1618
+ clear: /* @__PURE__ */ n(function(e) {
1619
+ var t = this._tasks, n = t.get(e);
1620
+ this.fastdom.clear(n), t.delete(e);
1621
+ }, "clear")
1622
+ };
1623
+ function K(e, t, n, r) {
1624
+ var i = e._tasks, a = e.fastdom, o, s = new Promise(function(e, c) {
1625
+ o = a[t](function() {
1626
+ i.delete(s);
1627
+ try {
1628
+ e(r ? n.call(r) : n());
1629
+ } catch (e) {
1630
+ c(e);
1631
+ }
1632
+ }, r);
1633
+ });
1634
+ return i.set(s, o), s;
1635
+ }
1636
+ n(K, "create");
1637
+ var { initialize: ot, mutate: st, measure: ct, clear: lt } = at, ut = at, dt = it.extend({ raf(e) {
1638
+ typeof queueMicrotask == "function" ? queueMicrotask(e) : setTimeout(e, 0);
1639
+ } }).extend(ut);
1640
+ function ft(e) {
1641
+ return Intl.Segmenter ? [...new Intl.Segmenter().segment(e)].map((e) => e.segment) : [...e];
1642
+ }
1643
+ n(ft, "splitTextToChars");
1644
+ function pt(e, t) {
1645
+ return q(e, [], ft(t.content), t.type);
1646
+ }
1647
+ n(pt, "splitWordToFitWidth");
1648
+ function q(e, t, n, r) {
1649
+ if (n.length === 0) return [{
1650
+ content: t.join(""),
1651
+ type: r
1652
+ }, {
1653
+ content: "",
1654
+ type: r
1655
+ }];
1656
+ let [i, ...a] = n, o = [...t, i];
1657
+ return e([{
1658
+ content: o.join(""),
1659
+ type: r
1660
+ }]) ? q(e, o, a, r) : (t.length === 0 && i && (t.push(i), n.shift()), [{
1661
+ content: t.join(""),
1662
+ type: r
1663
+ }, {
1664
+ content: n.join(""),
1665
+ type: r
1666
+ }]);
1667
+ }
1668
+ n(q, "splitWordToFitWidthRecursion");
1669
+ function mt(e, t) {
1670
+ if (e.some(({ content: e }) => e.includes("\n"))) throw Error("splitLineToFitWidth does not support newlines in the line");
1671
+ return J(e, t);
1672
+ }
1673
+ n(mt, "splitLineToFitWidth");
1674
+ function J(e, t, n = [], r = []) {
1675
+ if (e.length === 0) return r.length > 0 && n.push(r), n.length > 0 ? n : [];
1676
+ let i = "";
1677
+ e[0].content === " " && (i = " ", e.shift());
1678
+ let a = e.shift() ?? {
1679
+ content: " ",
1680
+ type: "normal"
1681
+ }, o = [...r];
1682
+ if (i !== "" && o.push({
1683
+ content: i,
1684
+ type: "normal"
1685
+ }), o.push(a), t(o)) return J(e, t, n, o);
1686
+ if (r.length > 0) n.push(r), e.unshift(a);
1687
+ else if (a.content) {
1688
+ let [r, i] = pt(t, a);
1689
+ n.push([r]), i.content && e.unshift(i);
1690
+ }
1691
+ return J(e, t, n);
1692
+ }
1693
+ n(J, "splitLineToFitWidthRecursion");
1694
+ function Y(e, t) {
1695
+ t && e.attr("style", t);
1696
+ }
1697
+ n(Y, "applyStyle");
1698
+ var ht = 16384;
1699
+ async function X(e, t, n, c, l = !1, u = o(), d = 0) {
1700
+ let f = e.append("foreignObject");
1701
+ f.attr("width", `${Math.min(10 * n, ht)}px`), f.attr("height", `${Math.min(10 * n, ht)}px`);
1702
+ let p = f.append("xhtml:div"), m = i(t.label) ? await r(t.label.replace(a.lineBreakRegex, "\n"), u) : s(t.label, u), h = t.isNode ? "nodeLabel" : "edgeLabel", g = p.append("span");
1703
+ g.html(m), Y(g, t.labelStyle), g.attr("class", `${h} ${c}`), Y(p, t.labelStyle), p.style("display", "table-cell"), p.style("white-space", "nowrap"), p.style("line-height", "1.5"), n !== Infinity && (p.style("max-width", n + "px"), p.style("text-align", "center")), p.attr("xmlns", "http://www.w3.org/1999/xhtml"), l && p.attr("class", "labelBkg");
1704
+ let _ = await dt.measure(() => p.node().getBoundingClientRect());
1705
+ return _.width === n ? (p.style("display", "table"), p.style("white-space", "break-spaces"), p.style("width", n + "px")) : _.width < d && (p.style("display", "table"), p.style("width", d + "px"), p.style("text-align", "center")), f.node();
1706
+ }
1707
+ n(X, "addHtmlSpan");
1708
+ function Z(e, t, n, r = !1) {
1709
+ let i = e.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", t * n - .1 + "em").attr("dy", n + "em");
1710
+ return r && i.attr("text-anchor", "middle"), i;
1711
+ }
1712
+ n(Z, "createTspan");
1713
+ function gt(e, t, n) {
1714
+ let r = e.append("text"), i = Z(r, 1, t);
1715
+ $(i, n);
1716
+ let a = i.node().getComputedTextLength();
1717
+ return r.remove(), a;
1718
+ }
1719
+ n(gt, "computeWidthOfText");
1720
+ function _t(e, t, n) {
1721
+ let r = e.append("text"), i = Z(r, 1, t);
1722
+ $(i, [{
1723
+ content: n,
1724
+ type: "normal"
1725
+ }]);
1726
+ let a = i.node()?.getBoundingClientRect();
1727
+ return a && r.remove(), a;
1728
+ }
1729
+ n(_t, "computeDimensionOfText");
1730
+ function vt(e, t, r, i = !1, a = !1) {
1731
+ let o = 1.1, s = t.append("g"), c = s.insert("rect").attr("class", "background").attr("style", "stroke: none"), l = s.append("text").attr("y", "-10.1");
1732
+ a && l.attr("text-anchor", "middle");
1733
+ let u = 0;
1734
+ for (let t of r) {
1735
+ let r = /* @__PURE__ */ n((t) => gt(s, o, t) <= e, "checkWidth"), i = r(t) ? [t] : mt(t, r);
1736
+ for (let e of i) $(Z(l, u, o, a), e), u++;
1737
+ }
1738
+ if (i) {
1739
+ let e = l.node().getBBox();
1740
+ return c.attr("x", e.x - 2).attr("y", e.y - 2).attr("width", e.width + 4).attr("height", e.height + 4), s.node();
1741
+ }
1742
+ return l.node();
1743
+ }
1744
+ n(vt, "createFormattedText");
1745
+ function Q(e) {
1746
+ return e.replace(/&(amp|lt|gt);/g, (e, t) => {
1747
+ switch (t) {
1748
+ case "amp": return "&";
1749
+ case "lt": return "<";
1750
+ case "gt": return ">";
1751
+ default: return e;
1752
+ }
1753
+ });
1754
+ }
1755
+ n(Q, "decodeHTMLEntities");
1756
+ function $(e, t) {
1757
+ e.text(""), t.forEach((t, n) => {
1758
+ let r = e.append("tspan").attr("font-style", t.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
1759
+ n === 0 ? r.text(Q(t.content)) : r.text(" " + Q(t.content));
1760
+ });
1761
+ }
1762
+ n($, "updateTextContentAndStyles");
1763
+ async function yt(e, t = {}) {
1764
+ let n = [];
1765
+ e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (e, r, i) => (n.push((async () => {
1766
+ let n = `${r}:${i}`;
1767
+ return await l(n) ? await u(n, void 0, { class: "label-icon" }) : `<i class='${s(e, t).replace(":", " ")}'></i>`;
1768
+ })()), e));
1769
+ let r = await Promise.all(n);
1770
+ return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => r.shift() ?? "");
1771
+ }
1772
+ n(yt, "replaceIconSubstring");
1773
+ var bt = /* @__PURE__ */ n(async (n, r = "", { style: a = "", isTitle: o = !1, classes: s = "", useHtmlLabels: l = !0, markdown: u = !0, isNode: d = !0, width: f = 200, minWidth: p = 0, addSvgBackground: m = !1 } = {}, h) => {
1774
+ if (e.debug("XYZ createText", r, a, o, s, l, d, "addSvgBackground: ", m), l) {
1775
+ let e = u ? rt(r, h) : nt(r), t = await yt(c(e), h), o = r.replace(/\\\\/g, "\\");
1776
+ return await X(n, {
1777
+ isNode: d,
1778
+ label: i(r) ? o : t,
1779
+ labelStyle: a.replace("fill:", "color:")
1780
+ }, f, s, m, h, p);
1781
+ }
1782
+ {
1783
+ let e = c(r.replace(/<br\s*\/?>/g, "<br/>")), i = vt(f, n, u ? G(e.replace("<br>", "<br/>"), h) : tt(e), r ? m : !1, !d);
1784
+ if (d) {
1785
+ /stroke:/.exec(a) && (a = a.replace("stroke:", "lineColor:"));
1786
+ let e = a.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1787
+ t(i).attr("style", e);
1788
+ } else {
1789
+ let e = a.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
1790
+ t(i).select("rect").attr("style", e.replace(/background:/g, "fill:"));
1791
+ let n = a.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1792
+ t(i).select("text").attr("style", n);
1793
+ }
1794
+ return o ? t(i).selectAll("tspan.text-outer-tspan").classed("title-row", !0) : t(i).selectAll("tspan.text-outer-tspan").classed("row", !0), i;
1795
+ }
1796
+ }, "createText");
1797
+ //#endregion
1798
+ export { Xe as a, G as i, bt as n, dt as r, _t as t };