@coderminer/vue-markdown 0.0.0-stage → 1.0.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 (291) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/LICENSE +21 -0
  3. package/README.md +579 -3
  4. package/README.zh-CN.md +547 -0
  5. package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +18 -0
  6. package/dist/chunks/MarkdownBlockquote-DVXziX2t.js.map +1 -0
  7. package/dist/chunks/MarkdownBreak-BwCi2Itt.js +18 -0
  8. package/dist/chunks/MarkdownBreak-BwCi2Itt.js.map +1 -0
  9. package/dist/chunks/MarkdownCode-B1k9tmW5.js +65 -0
  10. package/dist/chunks/MarkdownCode-B1k9tmW5.js.map +1 -0
  11. package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +51 -0
  12. package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js.map +1 -0
  13. package/dist/chunks/MarkdownContent-BAK6dqo7.js +15 -0
  14. package/dist/chunks/MarkdownContent-BAK6dqo7.js.map +1 -0
  15. package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js +42 -0
  16. package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js.map +1 -0
  17. package/dist/chunks/MarkdownEmphasis-CppivOEu.js +18 -0
  18. package/dist/chunks/MarkdownEmphasis-CppivOEu.js.map +1 -0
  19. package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +16 -0
  20. package/dist/chunks/MarkdownEmpty-Av5k6bqa.js.map +1 -0
  21. package/dist/chunks/MarkdownError-C0sPs5W0.js +19 -0
  22. package/dist/chunks/MarkdownError-C0sPs5W0.js.map +1 -0
  23. package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +24 -0
  24. package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js.map +1 -0
  25. package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +23 -0
  26. package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js.map +1 -0
  27. package/dist/chunks/MarkdownHeading-DaNcP0_6.js +31 -0
  28. package/dist/chunks/MarkdownHeading-DaNcP0_6.js.map +1 -0
  29. package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +18 -0
  30. package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js.map +1 -0
  31. package/dist/chunks/MarkdownHtml-66lYkvwM.js +15 -0
  32. package/dist/chunks/MarkdownHtml-66lYkvwM.js.map +1 -0
  33. package/dist/chunks/MarkdownImage-BRy76svs.js +53 -0
  34. package/dist/chunks/MarkdownImage-BRy76svs.js.map +1 -0
  35. package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +18 -0
  36. package/dist/chunks/MarkdownInlineCode-MXZYFwex.js.map +1 -0
  37. package/dist/chunks/MarkdownLink-Dbx3NwgV.js +47 -0
  38. package/dist/chunks/MarkdownLink-Dbx3NwgV.js.map +1 -0
  39. package/dist/chunks/MarkdownList-BJ-_C71k.js +22 -0
  40. package/dist/chunks/MarkdownList-BJ-_C71k.js.map +1 -0
  41. package/dist/chunks/MarkdownListItem-Z1EHIY26.js +18 -0
  42. package/dist/chunks/MarkdownListItem-Z1EHIY26.js.map +1 -0
  43. package/dist/chunks/MarkdownLoading-D-RYtXxf.js +17 -0
  44. package/dist/chunks/MarkdownLoading-D-RYtXxf.js.map +1 -0
  45. package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +18 -0
  46. package/dist/chunks/MarkdownParagraph-BxLSmSaG.js.map +1 -0
  47. package/dist/chunks/MarkdownRenderer-DLRRfsdI.js +416 -0
  48. package/dist/chunks/MarkdownRenderer-DLRRfsdI.js.map +1 -0
  49. package/dist/chunks/MarkdownRoot-DEE6iVfh.js +25 -0
  50. package/dist/chunks/MarkdownRoot-DEE6iVfh.js.map +1 -0
  51. package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +18 -0
  52. package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js.map +1 -0
  53. package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +18 -0
  54. package/dist/chunks/MarkdownStrong-uU5MzAoJ.js.map +1 -0
  55. package/dist/chunks/MarkdownTable-DmBTg_CR.js +18 -0
  56. package/dist/chunks/MarkdownTable-DmBTg_CR.js.map +1 -0
  57. package/dist/chunks/MarkdownTableCell-eiCJe847.js +33 -0
  58. package/dist/chunks/MarkdownTableCell-eiCJe847.js.map +1 -0
  59. package/dist/chunks/MarkdownTableRow-DuJaPntg.js +18 -0
  60. package/dist/chunks/MarkdownTableRow-DuJaPntg.js.map +1 -0
  61. package/dist/chunks/MarkdownTableSection-PFHz-R33.js +26 -0
  62. package/dist/chunks/MarkdownTableSection-PFHz-R33.js.map +1 -0
  63. package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +40 -0
  64. package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js.map +1 -0
  65. package/dist/chunks/MarkdownToc-BdOHF-Yo.js +51 -0
  66. package/dist/chunks/MarkdownToc-BdOHF-Yo.js.map +1 -0
  67. package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +27 -0
  68. package/dist/chunks/MarkdownTocItem-DT9mR3vL.js.map +1 -0
  69. package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js +416 -0
  70. package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js.map +1 -0
  71. package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js +262 -0
  72. package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js.map +1 -0
  73. package/dist/chunks/adapters-CMwX_NEI.js +28 -0
  74. package/dist/chunks/adapters-CMwX_NEI.js.map +1 -0
  75. package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
  76. package/dist/chunks/blank-line-Cb-JBP_5.js +90 -0
  77. package/dist/chunks/blank-line-Cb-JBP_5.js.map +1 -0
  78. package/dist/chunks/codemirror-DyphMAEg.js +84 -0
  79. package/dist/chunks/codemirror-DyphMAEg.js.map +1 -0
  80. package/dist/chunks/config-aRYo2R8_.js +12 -0
  81. package/dist/chunks/config-aRYo2R8_.js.map +1 -0
  82. package/dist/chunks/context-8NfW6fxI.js +32 -0
  83. package/dist/chunks/context-8NfW6fxI.js.map +1 -0
  84. package/dist/chunks/default-DWVS-I_8.js +23 -0
  85. package/dist/chunks/default-DWVS-I_8.js.map +1 -0
  86. package/dist/chunks/diagnostics-CtHoJyiX.js +25 -0
  87. package/dist/chunks/diagnostics-CtHoJyiX.js.map +1 -0
  88. package/dist/chunks/export-DZQ3cUry.js +1575 -0
  89. package/dist/chunks/export-DZQ3cUry.js.map +1 -0
  90. package/dist/chunks/hast-nodes-C0bX3M5Z.js +35 -0
  91. package/dist/chunks/hast-nodes-C0bX3M5Z.js.map +1 -0
  92. package/dist/chunks/highlightjs-BEh-YwEG.js +6041 -0
  93. package/dist/chunks/highlightjs-BEh-YwEG.js.map +1 -0
  94. package/dist/chunks/identity-jZEhX2d5.js +6244 -0
  95. package/dist/chunks/identity-jZEhX2d5.js.map +1 -0
  96. package/dist/chunks/labels-BtHiUTQI.js +49 -0
  97. package/dist/chunks/labels-BtHiUTQI.js.map +1 -0
  98. package/dist/chunks/lib-BQiWGWpu.js +5087 -0
  99. package/dist/chunks/lib-BQiWGWpu.js.map +1 -0
  100. package/dist/chunks/lib-LwqA_W3J.js +127 -0
  101. package/dist/chunks/lib-LwqA_W3J.js.map +1 -0
  102. package/dist/chunks/longest-streak-DZE_EqsU.js +10 -0
  103. package/dist/chunks/longest-streak-DZE_EqsU.js.map +1 -0
  104. package/dist/chunks/micromark-factory-space-Db040TnW.js +139 -0
  105. package/dist/chunks/micromark-factory-space-Db040TnW.js.map +1 -0
  106. package/dist/chunks/normalize-CRYv3Wqt.js +220 -0
  107. package/dist/chunks/normalize-CRYv3Wqt.js.map +1 -0
  108. package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
  109. package/dist/chunks/plugin-DqkFHyny.js +28 -0
  110. package/dist/chunks/plugin-DqkFHyny.js.map +1 -0
  111. package/dist/chunks/preset-BjaOuJUL.js +46 -0
  112. package/dist/chunks/preset-BjaOuJUL.js.map +1 -0
  113. package/dist/chunks/registry-DLjr93-V.js +6144 -0
  114. package/dist/chunks/registry-DLjr93-V.js.map +1 -0
  115. package/dist/chunks/render-Cs8iKrgz.js +1724 -0
  116. package/dist/chunks/render-Cs8iKrgz.js.map +1 -0
  117. package/dist/chunks/runtime-DJMnzjah.js +546 -0
  118. package/dist/chunks/runtime-DJMnzjah.js.map +1 -0
  119. package/dist/chunks/security-y4EwUyAs.js +214 -0
  120. package/dist/chunks/security-y4EwUyAs.js.map +1 -0
  121. package/dist/chunks/shared-DNAvZ-UY.js +76 -0
  122. package/dist/chunks/shared-DNAvZ-UY.js.map +1 -0
  123. package/dist/chunks/space-separated-tokens-CmBjEPdR.js +1099 -0
  124. package/dist/chunks/space-separated-tokens-CmBjEPdR.js.map +1 -0
  125. package/dist/chunks/url-D2BoivaE.js +26 -0
  126. package/dist/chunks/url-D2BoivaE.js.map +1 -0
  127. package/dist/chunks/useActiveHeading-BaGVMJnB.js +316 -0
  128. package/dist/chunks/useActiveHeading-BaGVMJnB.js.map +1 -0
  129. package/dist/components/CodeBlock.d.ts +73 -0
  130. package/dist/components/CodeBlock.js +1 -0
  131. package/dist/components/Icon.d.ts +6 -0
  132. package/dist/components/MarkdownBlockquote.d.ts +18 -0
  133. package/dist/components/MarkdownBlockquote.js +1 -0
  134. package/dist/components/MarkdownBreak.d.ts +8 -0
  135. package/dist/components/MarkdownBreak.js +1 -0
  136. package/dist/components/MarkdownChildren.d.ts +17 -0
  137. package/dist/components/MarkdownCode.d.ts +29 -0
  138. package/dist/components/MarkdownCode.js +1 -0
  139. package/dist/components/MarkdownConfigProvider.d.ts +33 -0
  140. package/dist/components/MarkdownConfigProvider.js +1 -0
  141. package/dist/components/MarkdownContent.d.ts +16 -0
  142. package/dist/components/MarkdownContent.js +1 -0
  143. package/dist/components/MarkdownCustomTag.d.ts +20 -0
  144. package/dist/components/MarkdownCustomTag.js +1 -0
  145. package/dist/components/MarkdownEmphasis.d.ts +18 -0
  146. package/dist/components/MarkdownEmphasis.js +1 -0
  147. package/dist/components/MarkdownEmpty.d.ts +8 -0
  148. package/dist/components/MarkdownEmpty.js +1 -0
  149. package/dist/components/MarkdownError.d.ts +11 -0
  150. package/dist/components/MarkdownError.js +1 -0
  151. package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
  152. package/dist/components/MarkdownFootnoteReference.js +1 -0
  153. package/dist/components/MarkdownFootnotes.d.ts +17 -0
  154. package/dist/components/MarkdownFootnotes.js +1 -0
  155. package/dist/components/MarkdownHeading.d.ts +18 -0
  156. package/dist/components/MarkdownHeading.js +1 -0
  157. package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
  158. package/dist/components/MarkdownHorizontalRule.js +1 -0
  159. package/dist/components/MarkdownHtml.d.ts +8 -0
  160. package/dist/components/MarkdownHtml.js +1 -0
  161. package/dist/components/MarkdownImage.d.ts +15 -0
  162. package/dist/components/MarkdownImage.js +1 -0
  163. package/dist/components/MarkdownInlineCode.d.ts +18 -0
  164. package/dist/components/MarkdownInlineCode.js +1 -0
  165. package/dist/components/MarkdownLink.d.ts +22 -0
  166. package/dist/components/MarkdownLink.js +1 -0
  167. package/dist/components/MarkdownList.d.ts +18 -0
  168. package/dist/components/MarkdownList.js +1 -0
  169. package/dist/components/MarkdownListItem.d.ts +18 -0
  170. package/dist/components/MarkdownListItem.js +1 -0
  171. package/dist/components/MarkdownLoading.d.ts +8 -0
  172. package/dist/components/MarkdownLoading.js +1 -0
  173. package/dist/components/MarkdownMath.d.ts +12 -0
  174. package/dist/components/MarkdownMath.js +1 -0
  175. package/dist/components/MarkdownMermaid.d.ts +78 -0
  176. package/dist/components/MarkdownMermaid.js +1 -0
  177. package/dist/components/MarkdownParagraph.d.ts +18 -0
  178. package/dist/components/MarkdownParagraph.js +1 -0
  179. package/dist/components/MarkdownRenderer.d.ts +170 -0
  180. package/dist/components/MarkdownRenderer.js +1 -0
  181. package/dist/components/MarkdownRoot.d.ts +24 -0
  182. package/dist/components/MarkdownRoot.js +1 -0
  183. package/dist/components/MarkdownStrikethrough.d.ts +18 -0
  184. package/dist/components/MarkdownStrikethrough.js +1 -0
  185. package/dist/components/MarkdownStrong.d.ts +18 -0
  186. package/dist/components/MarkdownStrong.js +1 -0
  187. package/dist/components/MarkdownTable.d.ts +18 -0
  188. package/dist/components/MarkdownTable.js +1 -0
  189. package/dist/components/MarkdownTableCell.d.ts +20 -0
  190. package/dist/components/MarkdownTableCell.js +1 -0
  191. package/dist/components/MarkdownTableRow.d.ts +18 -0
  192. package/dist/components/MarkdownTableRow.js +1 -0
  193. package/dist/components/MarkdownTableSection.d.ts +18 -0
  194. package/dist/components/MarkdownTableSection.js +1 -0
  195. package/dist/components/MarkdownTaskItem.d.ts +20 -0
  196. package/dist/components/MarkdownTaskItem.js +1 -0
  197. package/dist/components/MarkdownToc.d.ts +36 -0
  198. package/dist/components/MarkdownToc.js +1 -0
  199. package/dist/components/MarkdownTocItem.d.ts +14 -0
  200. package/dist/components/MarkdownTocItem.js +1 -0
  201. package/dist/components/MermaidBlock.d.ts +50 -0
  202. package/dist/components/MermaidBlock.js +1 -0
  203. package/dist/components/MermaidLiveEditor.d.ts +44 -0
  204. package/dist/components/MermaidLiveEditor.js +1 -0
  205. package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
  206. package/dist/components/VueSyntaxHighlighter.js +1 -0
  207. package/dist/components/codeRegion.d.ts +14 -0
  208. package/dist/components/config.d.ts +7 -0
  209. package/dist/components/context.d.ts +45 -0
  210. package/dist/components/index.d.ts +42 -0
  211. package/dist/components/index.js +38 -0
  212. package/dist/components/render.d.ts +9 -0
  213. package/dist/components/scroll-lock.d.ts +7 -0
  214. package/dist/components/types.d.ts +29 -0
  215. package/dist/composables/useActiveHeading.d.ts +12 -0
  216. package/dist/composables/useCodeHighlighter.d.ts +30 -0
  217. package/dist/composables/useLineWindow.d.ts +38 -0
  218. package/dist/composables/useMarkdownDocument.d.ts +23 -0
  219. package/dist/core/adapters.d.ts +7 -0
  220. package/dist/core/config.d.ts +5 -0
  221. package/dist/core/diagnostics.d.ts +9 -0
  222. package/dist/core/finalize.d.ts +18 -0
  223. package/dist/core/hast-nodes.d.ts +6 -0
  224. package/dist/core/highlight-lines.d.ts +8 -0
  225. package/dist/core/identity.d.ts +4 -0
  226. package/dist/core/labels.d.ts +4 -0
  227. package/dist/core/manifest.d.ts +38 -0
  228. package/dist/core/memo.d.ts +5 -0
  229. package/dist/core/model-hast.d.ts +8 -0
  230. package/dist/core/model.d.ts +10 -0
  231. package/dist/core/normalize.d.ts +27 -0
  232. package/dist/core/parts.d.ts +135 -0
  233. package/dist/core/preset.d.ts +10 -0
  234. package/dist/core/run.d.ts +16 -0
  235. package/dist/core/search.d.ts +5 -0
  236. package/dist/core/security.d.ts +21 -0
  237. package/dist/core/slugger.d.ts +6 -0
  238. package/dist/core/types.d.ts +390 -0
  239. package/dist/core/url.d.ts +10 -0
  240. package/dist/editor/codemirror.d.ts +14 -0
  241. package/dist/editor/index.d.ts +2 -0
  242. package/dist/editor/index.js +1 -0
  243. package/dist/export/index.d.ts +6 -0
  244. package/dist/headless.d.ts +21 -0
  245. package/dist/headless.js +12 -0
  246. package/dist/highlight/highlightjs.d.ts +7 -0
  247. package/dist/highlight/index.d.ts +3 -0
  248. package/dist/highlight/index.js +3 -0
  249. package/dist/highlight/shared.d.ts +16 -0
  250. package/dist/highlight/shiki.d.ts +7 -0
  251. package/dist/highlight/shiki.js +76 -0
  252. package/dist/highlight/shiki.js.map +1 -0
  253. package/dist/html/index.d.ts +17 -0
  254. package/dist/html/index.js +13 -0
  255. package/dist/html/index.js.map +1 -0
  256. package/dist/index.d.ts +24 -0
  257. package/dist/index.js +55 -0
  258. package/dist/index.js.map +1 -0
  259. package/dist/math/index.d.ts +4 -0
  260. package/dist/math/index.js +583 -0
  261. package/dist/math/index.js.map +1 -0
  262. package/dist/math/katex.d.ts +4 -0
  263. package/dist/math/plugin.d.ts +20 -0
  264. package/dist/mermaid/index.d.ts +5 -0
  265. package/dist/mermaid/index.js +3 -0
  266. package/dist/mermaid/plugin.d.ts +14 -0
  267. package/dist/mermaid/runtime.d.ts +12 -0
  268. package/dist/mermaid/sanitize.d.ts +12 -0
  269. package/dist/node-components.d.ts +1 -0
  270. package/dist/node-components.js +39 -0
  271. package/dist/pipeline/custom.d.ts +8 -0
  272. package/dist/pipeline/identity.d.ts +12 -0
  273. package/dist/pipeline/index.d.ts +5 -0
  274. package/dist/pipeline/official.d.ts +6 -0
  275. package/dist/pipeline.d.ts +1 -0
  276. package/dist/pipeline.js +1 -0
  277. package/dist/plugins/builtin.d.ts +15 -0
  278. package/dist/plugins/define.d.ts +7 -0
  279. package/dist/plugins/registry.d.ts +16 -0
  280. package/dist/plugins/source.d.ts +7 -0
  281. package/dist/plugins.d.ts +3 -0
  282. package/dist/plugins.js +1 -0
  283. package/dist/presets.d.ts +3 -0
  284. package/dist/presets.js +1 -0
  285. package/dist/style.css +2 -0
  286. package/dist/styles/components.css +712 -0
  287. package/dist/styles/index.d.ts +1 -0
  288. package/dist/styles/math-full.css +3 -0
  289. package/dist/styles/math.css +18 -0
  290. package/dist/styles/tokens.css +96 -0
  291. package/package.json +211 -6
@@ -0,0 +1,1724 @@
1
+ import { n as e } from "./labels-BtHiUTQI.js";
2
+ import { n as t, t as n } from "./diagnostics-CtHoJyiX.js";
3
+ import { t as r } from "./objectSpread2-CtBNx0TF.js";
4
+ import { i } from "./adapters-CMwX_NEI.js";
5
+ import { t as a } from "./asyncToGenerator-ChigusFD.js";
6
+ import { r as o } from "./config-aRYo2R8_.js";
7
+ import { n as s, r as c } from "./context-8NfW6fxI.js";
8
+ import { a as l, i as u, o as d } from "./shared-DNAvZ-UY.js";
9
+ import { n as f, t as p } from "./MarkdownCode-B1k9tmW5.js";
10
+ import { t as m } from "./MarkdownBlockquote-DVXziX2t.js";
11
+ import { t as h } from "./MarkdownBreak-BwCi2Itt.js";
12
+ import { t as g } from "./MarkdownCustomTag-BBdn3-WO.js";
13
+ import { t as _ } from "./MarkdownEmphasis-CppivOEu.js";
14
+ import { t as v } from "./MarkdownHeading-DaNcP0_6.js";
15
+ import { t as y } from "./MarkdownHorizontalRule-QNe_cuUI.js";
16
+ import { t as b } from "./MarkdownImage-BRy76svs.js";
17
+ import { t as x } from "./MarkdownInlineCode-MXZYFwex.js";
18
+ import { t as S } from "./MarkdownLink-Dbx3NwgV.js";
19
+ import { t as C } from "./MarkdownList-BJ-_C71k.js";
20
+ import { a as ee, n as te, o as ne, t as re } from "./runtime-DJMnzjah.js";
21
+ import { t as ie } from "./MarkdownListItem-Z1EHIY26.js";
22
+ import { t as w } from "./MarkdownFootnoteReference-Dy3Khwyj.js";
23
+ import { t as T } from "./MarkdownFootnotes-BRPzkbXv.js";
24
+ import { t as E } from "./MarkdownParagraph-BxLSmSaG.js";
25
+ import { t as D } from "./MarkdownStrikethrough-CblvbqDk.js";
26
+ import { t as ae } from "./MarkdownTaskItem-BcmKo1lk.js";
27
+ import { t as O } from "./MarkdownStrong-uU5MzAoJ.js";
28
+ import { t as oe } from "./MarkdownTable-DmBTg_CR.js";
29
+ import { t as se } from "./MarkdownTableCell-eiCJe847.js";
30
+ import { t as k } from "./MarkdownTableRow-DuJaPntg.js";
31
+ import { t as ce } from "./MarkdownTableSection-PFHz-R33.js";
32
+ import { computed as A, createBlock as j, createCommentVNode as le, createElementBlock as M, createElementVNode as ue, createSlots as N, createVNode as P, defineComponent as F, guardReactiveProps as I, h as L, normalizeClass as de, normalizeProps as R, normalizeStyle as fe, onMounted as z, onScopeDispose as B, onUnmounted as pe, openBlock as V, ref as H, renderSlot as U, resolveDynamicComponent as me, shallowRef as W, toDisplayString as he, toValue as G, unref as K, useSlots as ge, watch as _e, withCtx as q } from "vue";
33
+ // src/composables/useCodeHighlighter.ts
34
+ var J;
35
+ function Y() {
36
+ return J || (J = import("./highlightjs-BEh-YwEG.js").then((e) => e.n).then((e) => e.highlightjs).catch((e) => {
37
+ throw J = void 0, e;
38
+ })), J;
39
+ }
40
+ function ve(e) {
41
+ let r = A(() => {
42
+ var t, n;
43
+ return (t = (n = G(e.theme)) == null ? G(e.contextTheme) : n) == null ? "light" : t;
44
+ }), i = W(u(G(e.source), G(e.language))), o = W(G(e.highlighter)), s = /* @__PURE__ */ new Set();
45
+ function c(t) {
46
+ var n;
47
+ let r = `${t.code}\u001f${t.message}`;
48
+ s.has(r) || (s.add(r), (n = e.onDiagnostic) == null || n.call(e, t));
49
+ }
50
+ function d() {
51
+ return r.value === "dark" || r.value === "auto" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
52
+ }
53
+ let f = 0, p;
54
+ function m() {
55
+ return h.apply(this, arguments);
56
+ }
57
+ function h() {
58
+ return h = a(function* () {
59
+ var a;
60
+ let s = ++f;
61
+ if (!((a = G(e.enabled)) == null || a)) return;
62
+ let p = G(e.highlighter);
63
+ if (p && typeof p.highlight != "function" && (c(n("highlighter-invalid", "The supplied highlighter does not implement `highlight()`. Falling back to plain text.", {
64
+ severity: "warning",
65
+ phase: "render"
66
+ })), p = void 0), !p) try {
67
+ p = yield Y();
68
+ } catch (e) {
69
+ c(n("highlighter-unavailable", "The default highlight.js adapter could not be loaded. Install the optional `highlight.js` peer dependency to enable syntax highlighting.", {
70
+ severity: "warning",
71
+ phase: "render"
72
+ })), p = void 0;
73
+ }
74
+ if (s !== f) return;
75
+ if (!p || typeof p.highlight != "function") {
76
+ o.value = void 0, i.value = u(G(e.source), G(e.language));
77
+ return;
78
+ }
79
+ o.value = p;
80
+ try {
81
+ var m, h;
82
+ yield (m = p.load) == null ? void 0 : m.call(p);
83
+ let t = G(e.language);
84
+ t && (yield (h = p.loadLanguage) == null ? void 0 : h.call(p, t));
85
+ } catch (e) {
86
+ c(n("highlighter-load", `The highlighter could not prepare this language: ${t(e)}`, {
87
+ severity: "warning",
88
+ phase: "render"
89
+ }));
90
+ }
91
+ if (s !== f) return;
92
+ let g = G(e.source), _ = G(e.language);
93
+ i.value = l(p, g, _, {
94
+ theme: r.value,
95
+ colorScheme: d()
96
+ });
97
+ }), h.apply(this, arguments);
98
+ }
99
+ function g() {
100
+ var t;
101
+ p && (clearTimeout(p), p = void 0);
102
+ let n = (t = G(e.delay)) == null ? 0 : t;
103
+ return n > 0 ? new Promise((e) => {
104
+ p = setTimeout(() => {
105
+ p = void 0, m().then(e);
106
+ }, n);
107
+ }) : m();
108
+ }
109
+ _e(() => [G(e.source), G(e.language)], ([e, t]) => {
110
+ i.value = u(e, t);
111
+ }), _e(() => {
112
+ var t;
113
+ return [
114
+ G(e.source),
115
+ G(e.language),
116
+ G(e.highlighter),
117
+ r.value,
118
+ (t = G(e.enabled)) == null || t
119
+ ];
120
+ }, () => {
121
+ g();
122
+ }), z(() => {
123
+ g();
124
+ }), B(() => {
125
+ f += 1, p && (clearTimeout(p), p = void 0);
126
+ });
127
+ function _() {
128
+ return i.value;
129
+ }
130
+ return {
131
+ result: i,
132
+ active: o,
133
+ resolvedTheme: r,
134
+ refresh: g,
135
+ getHighlighted: _
136
+ };
137
+ }
138
+ // src/core/highlight-lines.ts
139
+ function ye(e) {
140
+ let t = /* @__PURE__ */ new Set();
141
+ for (let n of e == null ? [] : e) {
142
+ if (typeof n == "number") {
143
+ Number.isInteger(n) && n > 0 && t.add(n);
144
+ continue;
145
+ }
146
+ if (typeof n != "string") continue;
147
+ let e = /^\s*(\d+)\s*(?:-\s*(\d+))?\s*$/.exec(n);
148
+ if (!e) continue;
149
+ let r = Number(e[1]), i = e[2] ? Number(e[2]) : r;
150
+ if (!(r <= 0 || i < r)) for (let e = r; e <= i; e += 1) t.add(e);
151
+ }
152
+ return t;
153
+ }
154
+ // src/composables/useLineWindow.ts
155
+ function be(e) {
156
+ let t = A(() => d(G(e.nodes))), n = A(() => t.value.length), r = H(!1), i = H(0), a = H(0), o = H(), s = H(!1), c = A(() => ye(G(e.highlightLines))), l = A(() => {
157
+ var t;
158
+ return Math.max(0, (t = G(e.maxLines)) == null ? 0 : t);
159
+ }), u = A(() => l.value > 0 && n.value > l.value), f = A(() => u.value && !r.value), p = A(() => f.value ? Math.min(n.value, l.value) : n.value), m = A(() => {
160
+ var t;
161
+ return (t = G(e.virtual)) != null && t;
162
+ }), h = A(() => {
163
+ var t;
164
+ return (t = G(e.virtualThreshold)) == null ? 200 : t;
165
+ }), g = A(() => {
166
+ var t;
167
+ return (t = G(e.lineHeight)) == null ? 20 : t;
168
+ }), _ = A(() => s.value && m.value && p.value >= h.value), v = A(() => _.value ? Math.max(0, Math.floor(i.value / g.value) - 4) : 0), y = A(() => _.value ? Math.min(p.value, Math.ceil((i.value + a.value) / g.value) + 4) : p.value), b = A(() => {
169
+ let e = [];
170
+ for (let r = v.value; r < y.value; r += 1) {
171
+ var n;
172
+ e.push({
173
+ index: r,
174
+ nodes: (n = t.value[r]) == null ? [] : n
175
+ });
176
+ }
177
+ return e;
178
+ });
179
+ function x(e) {
180
+ let t = e.target;
181
+ i.value = t.scrollTop, a.value = t.clientHeight;
182
+ }
183
+ function S() {
184
+ o.value && (a.value = o.value.clientHeight);
185
+ }
186
+ function C() {
187
+ r.value = !r.value;
188
+ }
189
+ function ee(e) {
190
+ return c.value.has(e + 1);
191
+ }
192
+ return z(() => {
193
+ S(), s.value = !0;
194
+ }), _e(() => G(e.source), () => {
195
+ r.value = !1;
196
+ }), {
197
+ highlightedLines: t,
198
+ expanded: r,
199
+ truncatable: u,
200
+ totalLines: p,
201
+ virtualActive: _,
202
+ startLine: v,
203
+ endLine: y,
204
+ visibleLines: b,
205
+ lineHeight: g,
206
+ scrollRef: o,
207
+ onScroll: x,
208
+ measure: S,
209
+ toggle: C,
210
+ isHighlightedLine: ee
211
+ };
212
+ }
213
+ // src/components/Icon.ts
214
+ var X = {
215
+ copy: ["M8 8h12v12H8z", "M4 16V4h12"],
216
+ check: ["M4 12l5 5L20 6"],
217
+ download: [
218
+ "M12 3v12",
219
+ "M7 10l5 5 5-5",
220
+ "M4 20h16"
221
+ ],
222
+ preview: ["M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z", "M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"],
223
+ source: [
224
+ "M8 6l-5 6 5 6",
225
+ "M16 6l5 6-5 6",
226
+ "M14 4l-4 16"
227
+ ],
228
+ "zoom-in": [
229
+ "M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12z",
230
+ "M10 7v6",
231
+ "M7 10h6",
232
+ "M15.5 15.5L21 21"
233
+ ],
234
+ "zoom-out": [
235
+ "M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12z",
236
+ "M7 10h6",
237
+ "M15.5 15.5L21 21"
238
+ ],
239
+ reset: [
240
+ "M8 8h8v8H8z",
241
+ "M4 12h4",
242
+ "M16 12h4",
243
+ "M12 4v4",
244
+ "M12 16v4"
245
+ ],
246
+ image: [
247
+ "M4 5h16v14H4z",
248
+ "M4 16l4-4 4 4 3-3 5 5",
249
+ "M9 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"
250
+ ],
251
+ fullscreen: [
252
+ "M8 3H3v5",
253
+ "M16 3h5v5",
254
+ "M21 16v5h-5",
255
+ "M3 16v5h5"
256
+ ],
257
+ "exit-fullscreen": [
258
+ "M3 8h5V3",
259
+ "M21 8h-5V3",
260
+ "M16 21v-5h5",
261
+ "M8 21v-5H3"
262
+ ],
263
+ retry: ["M20 12a8 8 0 1 1-2.34-5.66", "M20 4v6h-6"],
264
+ diagram: [
265
+ "M4 5h6v4H4z",
266
+ "M14 15h6v4h-6z",
267
+ "M7 9v3h10v3"
268
+ ]
269
+ }, Z = (e) => L("svg", {
270
+ class: "vmd-icon",
271
+ viewBox: "0 0 24 24",
272
+ "aria-hidden": "true",
273
+ focusable: "false",
274
+ fill: "none",
275
+ stroke: "currentColor",
276
+ "stroke-width": 1.8,
277
+ "stroke-linecap": "round",
278
+ "stroke-linejoin": "round"
279
+ }, X[e.name].map((e) => L("path", { d: e }))), xe = [
280
+ "data-vmd-theme",
281
+ "data-language",
282
+ "data-highlighter",
283
+ "data-virtual"
284
+ ], Se = {
285
+ "data-vmd-part": "code-header",
286
+ class: "vmd-code-header"
287
+ }, Ce = {
288
+ key: 0,
289
+ "data-vmd-part": "code-body",
290
+ class: "vmd-code-body vmd-code-block-body"
291
+ }, we = ["data-virtual"], Te = {
292
+ key: 2,
293
+ "data-vmd-part": "code-body",
294
+ class: "vmd-code-body"
295
+ }, Ee = /* @__PURE__ */ F({
296
+ __name: "CodeBlock",
297
+ props: {
298
+ node: {},
299
+ code: { default: void 0 },
300
+ language: { default: void 0 },
301
+ highlighter: { default: void 0 },
302
+ theme: { default: void 0 },
303
+ actions: { default: () => [] },
304
+ showActions: {
305
+ type: Boolean,
306
+ default: !0
307
+ },
308
+ showDownload: {
309
+ type: Boolean,
310
+ default: !1
311
+ },
312
+ title: { default: void 0 },
313
+ fileName: { default: void 0 },
314
+ lineNumbers: {
315
+ type: Boolean,
316
+ default: !1
317
+ },
318
+ highlightLines: { default: () => [] },
319
+ maxLines: { default: 0 },
320
+ virtual: {
321
+ type: Boolean,
322
+ default: !1
323
+ },
324
+ virtualThreshold: { default: 200 },
325
+ lineHeight: { default: 20 },
326
+ delay: { default: 0 },
327
+ standalone: {
328
+ type: Boolean,
329
+ default: !1
330
+ },
331
+ ignoreRegion: {
332
+ type: Boolean,
333
+ default: !1
334
+ }
335
+ },
336
+ emits: [
337
+ "copy",
338
+ "download",
339
+ "action",
340
+ "error"
341
+ ],
342
+ setup(i, { expose: l, emit: u }) {
343
+ let d = i, p = u, m = c(), h = o(), g = ge(), _ = f({
344
+ standalone: () => d.standalone,
345
+ ignoreRegion: () => d.ignoreRegion
346
+ }), v = A(() => {
347
+ var e, t;
348
+ return d.code === void 0 ? (e = (t = d.node) == null ? void 0 : t.code) == null ? "" : e : d.code;
349
+ }), y = A(() => {
350
+ var e, t;
351
+ return d.language === void 0 ? (e = (t = d.node) == null ? void 0 : t.language) == null ? "" : e : d.language;
352
+ }), b = A(() => y.value || "text");
353
+ function x(e) {
354
+ var t;
355
+ (t = m.onRenderError) == null || t.call(m, e), p("error", e);
356
+ }
357
+ let { result: S, active: C, resolvedTheme: ee, getHighlighted: te } = ve({
358
+ source: v,
359
+ language: y,
360
+ highlighter: () => {
361
+ var e, t;
362
+ return (e = (t = d.highlighter) == null ? m.highlighter : t) == null ? h.value.highlighter : e;
363
+ },
364
+ theme: () => d.theme,
365
+ contextTheme: () => {
366
+ var e;
367
+ return (e = m.theme) == null ? h.value.theme : e;
368
+ },
369
+ enabled: () => !_.value,
370
+ onDiagnostic: x
371
+ }), { highlightedLines: ne, expanded: re, truncatable: ie, virtualActive: w, startLine: T, endLine: E, totalLines: D, visibleLines: ae, lineHeight: O, scrollRef: oe, onScroll: se, toggle: k, isHighlightedLine: ce } = be({
372
+ nodes: () => S.value.nodes,
373
+ source: v,
374
+ maxLines: () => d.maxLines,
375
+ virtual: () => d.virtual,
376
+ virtualThreshold: () => d.virtualThreshold,
377
+ lineHeight: () => d.lineHeight,
378
+ highlightLines: () => d.highlightLines
379
+ }), le = A(() => S.value.mode === "block"), N = A(() => d.lineNumbers || d.highlightLines.length > 0 || d.maxLines > 0 || d.virtual), I = H("idle"), R = A(() => I.value === "copied" ? e(m.labels.copied) : I.value === "failed" ? e(m.labels.copyFailed) : ""), z, B;
380
+ pe(() => {
381
+ z && clearTimeout(z), B && URL.revokeObjectURL(B);
382
+ });
383
+ function W() {
384
+ return he.apply(this, arguments);
385
+ }
386
+ function he() {
387
+ return he = a(function* () {
388
+ let e = v.value;
389
+ try {
390
+ if (typeof navigator < "u" && navigator.clipboard) yield navigator.clipboard.writeText(e);
391
+ else if (typeof document < "u") {
392
+ let t = document.createElement("textarea");
393
+ t.value = e, document.body.appendChild(t), t.select();
394
+ let n = document.execCommand("copy");
395
+ if (t.remove(), n === !1) throw Error("The copy command was rejected.");
396
+ } else throw Error("Clipboard access is not available.");
397
+ p("copy", e), I.value = "copied", z && clearTimeout(z), z = setTimeout(() => {
398
+ I.value = "idle";
399
+ }, 1500);
400
+ } catch (e) {
401
+ I.value = "failed", x(n("copy-error", `The source could not be copied to the clipboard: ${t(e)}`, {
402
+ severity: "warning",
403
+ phase: "render"
404
+ })), z && clearTimeout(z), z = setTimeout(() => {
405
+ I.value = "idle";
406
+ }, 1500);
407
+ }
408
+ }), he.apply(this, arguments);
409
+ }
410
+ function G() {
411
+ return J.apply(this, arguments);
412
+ }
413
+ function J() {
414
+ return J = a(function* () {
415
+ let e = v.value;
416
+ if (typeof document < "u" && typeof URL < "u") try {
417
+ let t = new Blob([e], { type: "text/plain;charset=utf-8" }), n = URL.createObjectURL(t);
418
+ B = n;
419
+ let r = document.createElement("a");
420
+ r.href = n, r.download = d.fileName || `code.${y.value || "txt"}`, r.click(), setTimeout(() => {
421
+ URL.revokeObjectURL(n), B === n && (B = void 0);
422
+ }, 1e3), p("download", e);
423
+ } catch (e) {
424
+ x(n("download-error", `The source could not be downloaded: ${t(e)}`, {
425
+ severity: "warning",
426
+ phase: "render"
427
+ }));
428
+ }
429
+ }), J.apply(this, arguments);
430
+ }
431
+ let Y = A(() => ({
432
+ copy: W,
433
+ download: G
434
+ })), ye = A(() => ({
435
+ node: d.node,
436
+ source: v.value,
437
+ language: y.value,
438
+ highlighted: S.value,
439
+ nodes: S.value.nodes,
440
+ lines: ne.value,
441
+ visibleLines: ae.value,
442
+ actions: Y.value
443
+ })), X = A(() => ({
444
+ source: v.value,
445
+ language: y.value,
446
+ fileName: d.fileName,
447
+ title: d.title,
448
+ highlighted: S.value,
449
+ nodes: S.value.nodes,
450
+ actions: Y.value
451
+ })), Ee = A(() => r(r({}, X.value), {}, { label: b.value }));
452
+ function De() {
453
+ let t = [];
454
+ w.value && T.value > 0 && t.push(L("div", {
455
+ key: "spacer-top",
456
+ "aria-hidden": "true",
457
+ style: { height: `${T.value * O.value}px` }
458
+ }));
459
+ for (let e of ae.value) {
460
+ let n = ce(e.index);
461
+ t.push(L("div", {
462
+ class: "vmd-highlighter-line",
463
+ "data-vmd-part": "highlighter-line",
464
+ "data-line": String(e.index + 1),
465
+ "data-highlighted": n ? "true" : void 0,
466
+ key: `line-${e.index}`
467
+ }, [d.lineNumbers ? L("span", {
468
+ class: "vmd-highlighter-gutter",
469
+ "data-vmd-part": "highlighter-gutter",
470
+ "aria-hidden": "true"
471
+ }, String(e.index + 1)) : null, L("code", { class: ["vmd-highlighter-code", y.value ? `language-${y.value}` : void 0] }, $(e.nodes, m))]));
472
+ }
473
+ return w.value && E.value < D.value && t.push(L("div", {
474
+ key: "spacer-bottom",
475
+ "aria-hidden": "true",
476
+ style: { height: `${(D.value - E.value) * O.value}px` }
477
+ })), ie.value && t.push(L("button", {
478
+ type: "button",
479
+ class: "vmd-highlighter-toggle",
480
+ "data-vmd-part": "highlighter-toggle",
481
+ "aria-expanded": re.value ? "true" : "false",
482
+ onClick: k
483
+ }, re.value ? e(m.labels.showLess) : e(m.labels.showAll))), t;
484
+ }
485
+ let Oe = F({ setup() {
486
+ return () => m.renderHostSlot("code", ye.value, () => {
487
+ let e = g.code;
488
+ if (e) {
489
+ let t = e(ye.value);
490
+ if (!s(t)) return t;
491
+ }
492
+ return le.value ? $(S.value.nodes, m) : N.value ? De() : $(S.value.nodes, m);
493
+ });
494
+ } }), ke = F({ setup() {
495
+ return () => m.renderHostSlot("toolbar", X.value, () => {
496
+ let r = g.toolbar;
497
+ if (r) {
498
+ let e = r(X.value);
499
+ if (!s(e)) return e;
500
+ }
501
+ return m.renderHostSlot("code-actions", X.value, () => {
502
+ let r = g["code-actions"];
503
+ if (r) {
504
+ let e = r(X.value);
505
+ if (!s(e)) return e;
506
+ }
507
+ if (!d.showActions && d.actions.length === 0) return null;
508
+ let i = [];
509
+ if (d.showActions) {
510
+ let t = I.value === "copied" ? e(m.labels.copied) : I.value === "failed" ? e(m.labels.copyFailed) : e(m.labels.copy);
511
+ if (i.push(L("button", {
512
+ type: "button",
513
+ class: "vmd-code-action",
514
+ "data-vmd-part": "code-action",
515
+ "data-action": "copy",
516
+ "data-icon": "true",
517
+ "data-state": I.value,
518
+ "aria-label": t,
519
+ title: t,
520
+ onClick: W
521
+ }, [L(Z, { name: I.value === "copied" ? "check" : "copy" }), L("span", { class: "vmd-visually-hidden" }, t)])), d.showDownload) {
522
+ let t = e(m.labels.download);
523
+ i.push(L("button", {
524
+ type: "button",
525
+ class: "vmd-code-action",
526
+ "data-vmd-part": "code-action",
527
+ "data-action": "download",
528
+ "data-icon": "true",
529
+ "aria-label": t,
530
+ title: t,
531
+ onClick: G
532
+ }, [L(Z, { name: "download" }), L("span", { class: "vmd-visually-hidden" }, t)]));
533
+ }
534
+ }
535
+ for (let r of d.actions) i.push(L("button", {
536
+ type: "button",
537
+ class: "vmd-code-action",
538
+ "data-vmd-part": "code-action",
539
+ "data-action": r.key,
540
+ onClick: function() {
541
+ var e = a(function* () {
542
+ try {
543
+ yield r.run({
544
+ code: v.value,
545
+ language: y.value,
546
+ copy: W,
547
+ download: G
548
+ }), p("action", r.key);
549
+ } catch (e) {
550
+ x(n("action-error", `The "${r.key}" action failed: ${t(e)}`, {
551
+ severity: "warning",
552
+ phase: "render"
553
+ }));
554
+ }
555
+ });
556
+ return function() {
557
+ return e.apply(this, arguments);
558
+ };
559
+ }()
560
+ }, e(r.label)));
561
+ return i.push(L("span", {
562
+ class: "vmd-code-feedback",
563
+ "data-vmd-part": "code-feedback",
564
+ "data-state": I.value,
565
+ role: "status",
566
+ "aria-live": "polite"
567
+ }, R.value)), i;
568
+ });
569
+ });
570
+ } }), Ae = F({ setup() {
571
+ return () => m.renderHostSlot("header", Ee.value, () => {
572
+ let e = g.header;
573
+ if (e) {
574
+ let t = e(Ee.value);
575
+ if (!s(t)) return t;
576
+ }
577
+ return [L("span", {
578
+ class: "vmd-code-heading",
579
+ "data-vmd-part": "code-heading"
580
+ }, [
581
+ L(Z, { name: "source" }),
582
+ d.title ? L("span", {
583
+ class: "vmd-code-title",
584
+ "data-vmd-part": "code-title"
585
+ }, d.title) : null,
586
+ d.fileName ? L("span", {
587
+ class: "vmd-code-file-name",
588
+ "data-vmd-part": "code-file-name"
589
+ }, d.fileName) : null,
590
+ L("span", {
591
+ class: "vmd-code-lang",
592
+ "data-vmd-part": "code-lang"
593
+ }, b.value)
594
+ ]), L("span", {
595
+ class: "vmd-code-toolbar",
596
+ "data-vmd-part": "code-toolbar"
597
+ }, [L(ke)])];
598
+ });
599
+ } });
600
+ return _e(() => [v.value, y.value], () => {
601
+ I.value = "idle";
602
+ }), l({
603
+ copy: W,
604
+ download: G,
605
+ getHighlighted: te,
606
+ highlighted: S
607
+ }), (e, t) => {
608
+ var n;
609
+ return K(_) ? (V(), j(me(K(_)), {
610
+ key: 0,
611
+ node: i.node,
612
+ code: v.value,
613
+ language: y.value,
614
+ theme: K(ee),
615
+ highlighter: K(C),
616
+ actions: i.actions,
617
+ "show-actions": i.showActions,
618
+ "show-download": i.showDownload,
619
+ title: i.title,
620
+ "file-name": i.fileName,
621
+ "line-numbers": i.lineNumbers,
622
+ "highlight-lines": i.highlightLines,
623
+ "max-lines": i.maxLines,
624
+ virtual: i.virtual,
625
+ "virtual-threshold": i.virtualThreshold,
626
+ "line-height": K(O),
627
+ delay: i.delay,
628
+ highlighted: K(S),
629
+ "action-handlers": Y.value,
630
+ copy: W,
631
+ download: G
632
+ }, {
633
+ default: q(() => [U(e.$slots, "default")]),
634
+ _: 3
635
+ }, 8, [
636
+ "node",
637
+ "code",
638
+ "language",
639
+ "theme",
640
+ "highlighter",
641
+ "actions",
642
+ "show-actions",
643
+ "show-download",
644
+ "title",
645
+ "file-name",
646
+ "line-numbers",
647
+ "highlight-lines",
648
+ "max-lines",
649
+ "virtual",
650
+ "virtual-threshold",
651
+ "line-height",
652
+ "delay",
653
+ "highlighted",
654
+ "action-handlers"
655
+ ])) : (V(), M("div", {
656
+ key: 1,
657
+ "data-vmd-part": "code",
658
+ class: "vmd-code vmd-code-block",
659
+ "data-vmd-theme": K(ee),
660
+ "data-language": b.value,
661
+ "data-highlighter": (n = K(C)) == null ? void 0 : n.id,
662
+ "data-virtual": K(w) ? "true" : void 0
663
+ }, [ue("div", Se, [P(K(Ae))]), le.value ? (V(), M("div", Ce, [P(K(Oe))])) : N.value ? (V(), M("div", {
664
+ key: 1,
665
+ ref_key: "scrollRef",
666
+ ref: oe,
667
+ "data-vmd-part": "code-body",
668
+ class: "vmd-code-body vmd-code-lines",
669
+ "data-virtual": K(w) ? "true" : void 0,
670
+ style: fe(K(w) ? {
671
+ maxHeight: `${K(O) * 20}px`,
672
+ overflow: "auto"
673
+ } : void 0),
674
+ onScroll: t[0] || (t[0] = (...e) => K(se) && K(se)(...e))
675
+ }, [P(K(Oe))], 44, we)) : (V(), M("pre", Te, [ue("code", { class: de(["vmd-code-element", y.value ? `language-${y.value}` : void 0]) }, [P(K(Oe))], 2)]))], 8, xe));
676
+ };
677
+ }
678
+ }), De = [
679
+ "data-display",
680
+ "data-error",
681
+ "aria-label"
682
+ ], Oe = {
683
+ key: 0,
684
+ "data-vmd-part": "math-error",
685
+ class: "vmd-math-error",
686
+ role: "status"
687
+ }, ke = /* @__PURE__ */ F({
688
+ __name: "MarkdownMath",
689
+ props: {
690
+ node: {},
691
+ tex: {},
692
+ displayMode: { type: Boolean },
693
+ rendered: {},
694
+ error: {},
695
+ mathEngine: {}
696
+ },
697
+ setup(t) {
698
+ let r = t, i = c(), a = A(() => {
699
+ var e, t;
700
+ return (e = r.tex) == null ? ((t = r.node) == null ? void 0 : t.kind) === "math" ? r.node.tex : "" : e;
701
+ }), o = A(() => {
702
+ var e, t;
703
+ return (e = r.displayMode) == null ? ((t = r.node) == null ? void 0 : t.kind) === "math" && r.node.displayMode : e;
704
+ }), s = A(() => {
705
+ var e, t;
706
+ return (e = r.rendered) == null ? ((t = r.node) == null ? void 0 : t.kind) === "math" ? r.node.rendered : [] : e;
707
+ }), l = A(() => {
708
+ var e;
709
+ return (e = r.mathEngine) == null ? i.mathEngine : e;
710
+ }), u = A(() => {
711
+ if (l.value) try {
712
+ return l.value.render(a.value, { displayMode: o.value });
713
+ } catch (e) {
714
+ return {
715
+ nodes: [{
716
+ kind: "text",
717
+ key: "math-error",
718
+ value: a.value
719
+ }],
720
+ error: e instanceof Error ? e.message : String(e)
721
+ };
722
+ }
723
+ }), d = A(() => !l.value && (s.value === void 0 || s.value.length === 0) && a.value !== ""), f = A(() => {
724
+ var e, t, n;
725
+ let r = (e = (t = (n = u.value) == null ? void 0 : n.nodes) == null ? s.value : t) == null ? [] : e;
726
+ return r.length > 0 ? r : d.value ? [{
727
+ kind: "text",
728
+ key: "math-source",
729
+ value: a.value
730
+ }] : r;
731
+ });
732
+ function p(e) {
733
+ if (e) for (let n of e) {
734
+ var t;
735
+ if (n.kind !== "element") continue;
736
+ if (((t = n.attrs.class) == null ? "" : t).split(/\s+/).includes("katex-error")) return n.attrs.title || "Invalid TeX expression.";
737
+ let e = p(n.children);
738
+ if (e) return e;
739
+ }
740
+ }
741
+ let m = A(() => u.value ? void 0 : p(s.value)), h = A(() => {
742
+ var e, t, n;
743
+ return (e = (t = r.error) == null ? (n = u.value) == null ? void 0 : n.error : t) == null ? m.value : e;
744
+ }), g = A(() => e(i.labels.math, { tex: a.value })), _ = !1;
745
+ function v() {
746
+ if (!_) {
747
+ if (h.value) {
748
+ var e, t;
749
+ _ = !0;
750
+ let r = n("math-error", h.value, { phase: "render" });
751
+ (e = i.onMathError) == null || e.call(i, r), (t = i.onRenderError) == null || t.call(i, r);
752
+ } else if (d.value) {
753
+ var r, a;
754
+ _ = !0;
755
+ let e = n("math-engine-unavailable", "No math engine or pre-rendered math output is available. Provide `mathEngine`, `rendered`, or use `mathPlugin()`.", {
756
+ severity: "warning",
757
+ phase: "render"
758
+ });
759
+ (r = i.onMathError) == null || r.call(i, e), (a = i.onRenderError) == null || a.call(i, e);
760
+ }
761
+ }
762
+ }
763
+ z(v), _e([h, d], v);
764
+ let y = F({ setup() {
765
+ return () => i.renderHostSlot("math", {
766
+ tex: a.value,
767
+ displayMode: o.value,
768
+ rendered: f.value,
769
+ error: h.value
770
+ }, () => $(f.value, i));
771
+ } }), b = F({ setup() {
772
+ return () => i.renderHostSlot("math-error", {
773
+ tex: a.value,
774
+ error: h.value,
775
+ retry: () => void 0
776
+ }, () => L("span", { class: "vmd-math-fallback" }, a.value));
777
+ } });
778
+ return (e, t) => (V(), M("span", {
779
+ "data-vmd-part": "math",
780
+ class: "vmd-math",
781
+ "data-display": o.value ? "true" : "false",
782
+ "data-error": h.value ? "true" : void 0,
783
+ "aria-label": g.value
784
+ }, [h.value ? (V(), M("span", Oe, [P(K(b))])) : (V(), j(K(y), { key: 1 }))], 8, De));
785
+ }
786
+ }), Ae = [
787
+ "data-vmd-theme",
788
+ "data-status",
789
+ "data-renderer",
790
+ "data-fullscreen",
791
+ "data-compact",
792
+ "data-view",
793
+ "aria-label"
794
+ ], je = ["data-vmd-part"], Me = {
795
+ "data-vmd-part": "mermaid-header",
796
+ class: "vmd-mermaid-header"
797
+ }, Ne = {
798
+ key: 0,
799
+ "data-vmd-part": "mermaid-preview",
800
+ class: "vmd-mermaid-preview"
801
+ }, Pe = {
802
+ key: 0,
803
+ class: "vmd-mermaid-error-banner"
804
+ }, Fe = {
805
+ key: 1,
806
+ "data-vmd-part": "mermaid-source",
807
+ class: "vmd-mermaid-source"
808
+ }, Ie = "Renderer returned no usable diagram output.", Le = /* @__PURE__ */ F({
809
+ __name: "MermaidBlock",
810
+ props: {
811
+ node: { default: void 0 },
812
+ source: { default: void 0 },
813
+ renderer: { default: void 0 },
814
+ theme: { default: void 0 },
815
+ showErrors: {
816
+ type: Boolean,
817
+ default: !1
818
+ },
819
+ enableZoom: {
820
+ type: Boolean,
821
+ default: !0
822
+ },
823
+ allowFullscreen: {
824
+ type: Boolean,
825
+ default: !0
826
+ },
827
+ compact: {
828
+ type: Boolean,
829
+ default: !1
830
+ },
831
+ actions: { default: () => [] }
832
+ },
833
+ emits: [
834
+ "rendered",
835
+ "error",
836
+ "copy",
837
+ "export",
838
+ "fullscreen",
839
+ "action"
840
+ ],
841
+ setup(o, { expose: l, emit: u }) {
842
+ let d = o, f = u, p = c(), m = ge(), h = A(() => {
843
+ var e, t;
844
+ return (e = d.source) == null ? ((t = d.node) == null ? void 0 : t.kind) === "mermaid" ? d.node.code : "" : e;
845
+ }), g = A(() => {
846
+ var e, t;
847
+ return (e = (t = d.theme) == null ? p.theme : t) == null ? "light" : e;
848
+ }), _ = H("idle"), v = W(), y = W(), b = H(""), x = H("preview"), S = H(1), C = H(!1), ie = H(), w = H(!1), T = !1, E, D = A(() => d.renderer && i(d.renderer) ? d.renderer : p.mermaidRenderer), ae = A(() => D.value && i(D.value) ? D.value.id : "mermaid"), O = A(() => e(p.labels.mermaid, { source: h.value })), oe = 0;
849
+ function se(e) {
850
+ var t;
851
+ if (!e || typeof e != "object") return {
852
+ nodes: [],
853
+ error: Ie
854
+ };
855
+ let n = typeof e.svg == "string" && e.svg ? e.svg : void 0, i = Array.isArray(e.nodes) ? ee(e.nodes) : [];
856
+ if (i.length > 0) return r(r({}, e), {}, {
857
+ svg: n,
858
+ nodes: i
859
+ });
860
+ if (n) {
861
+ let t = ne(n);
862
+ if (t.length > 0) return r(r({}, e), {}, {
863
+ svg: n,
864
+ nodes: t
865
+ });
866
+ }
867
+ return r(r({}, e), {}, {
868
+ svg: n,
869
+ nodes: [],
870
+ error: (t = e.error) == null ? Ie : t
871
+ });
872
+ }
873
+ function k() {
874
+ return ce.apply(this, arguments);
875
+ }
876
+ function ce() {
877
+ return ce = a(function* () {
878
+ let e = ++oe;
879
+ _.value = "pending", b.value = "";
880
+ let t = D.value, a = re(), o;
881
+ if (t && i(t)) try {
882
+ o = se(yield t.render(h.value, {
883
+ theme: g.value,
884
+ id: a
885
+ }));
886
+ } catch (e) {
887
+ o = {
888
+ nodes: [],
889
+ error: e instanceof Error ? e.message : String(e)
890
+ };
891
+ }
892
+ else {
893
+ let e = yield te(h.value, {
894
+ theme: g.value,
895
+ id: a
896
+ });
897
+ o = e.error || e.nodes.length > 0 ? e : r(r({}, e), {}, { error: Ie });
898
+ }
899
+ if (e === oe) {
900
+ if (v.value = o, o.error) {
901
+ var s;
902
+ _.value = "error", b.value = o.error, f("error", o.error);
903
+ let e = o.error.indexOf("Mermaid is not available") !== -1;
904
+ (s = p.onRenderError) == null || s.call(p, n(e ? "mermaid-unavailable" : "mermaid-error", o.error, { phase: "render" }));
905
+ } else _.value = "ready", y.value = o, f("rendered", o);
906
+ }
907
+ }), ce.apply(this, arguments);
908
+ }
909
+ z(() => {
910
+ T = !0, k();
911
+ }), pe(() => {
912
+ T = !1, E && clearTimeout(E), typeof document < "u" && document.removeEventListener("keydown", B);
913
+ }), _e(() => [
914
+ h.value,
915
+ D.value,
916
+ g.value
917
+ ], () => {
918
+ T && k();
919
+ });
920
+ function j() {
921
+ return N.apply(this, arguments);
922
+ }
923
+ function N() {
924
+ return N = a(function* () {
925
+ try {
926
+ typeof navigator < "u" && navigator.clipboard && (yield navigator.clipboard.writeText(h.value)), w.value = !0, f("copy", h.value), E && clearTimeout(E), E = setTimeout(() => {
927
+ w.value = !1;
928
+ }, 1500);
929
+ } catch (r) {
930
+ var e;
931
+ w.value = !1;
932
+ let i = `The source could not be copied to the clipboard: ${t(r)}`;
933
+ f("error", i), (e = p.onRenderError) == null || e.call(p, n("copy-error", i, {
934
+ severity: "warning",
935
+ phase: "render",
936
+ plugin: "mermaid"
937
+ }));
938
+ }
939
+ }), N.apply(this, arguments);
940
+ }
941
+ function I(e, t) {
942
+ if (typeof document > "u" || typeof URL > "u") return;
943
+ let n = URL.createObjectURL(e), r = document.createElement("a");
944
+ r.href = n, r.download = t, r.click(), setTimeout(() => URL.revokeObjectURL(n), 1e3);
945
+ }
946
+ function de() {
947
+ return R.apply(this, arguments);
948
+ }
949
+ function R() {
950
+ return R = a(function* () {
951
+ var e;
952
+ let t = (e = y.value) == null ? void 0 : e.svg;
953
+ if (t && typeof document < "u" && typeof Image < "u") try {
954
+ var n;
955
+ let e = URL.createObjectURL(new Blob([t], { type: "image/svg+xml" })), r = new Image();
956
+ yield new Promise((t, n) => {
957
+ r.onload = () => t(), r.onerror = () => n(/* @__PURE__ */ Error("Mermaid SVG could not be decoded.")), r.src = e;
958
+ });
959
+ let i = document.createElement("canvas");
960
+ i.width = r.width || 800, i.height = r.height || 600, (n = i.getContext("2d")) == null || n.drawImage(r, 0, 0), URL.revokeObjectURL(e);
961
+ let a = yield new Promise((e) => i.toBlob(e, "image/png"));
962
+ a && (I(a, "diagram.png"), f("export", "png"));
963
+ } catch (e) {}
964
+ }), R.apply(this, arguments);
965
+ }
966
+ function fe() {
967
+ var e;
968
+ let t = (e = y.value) == null ? void 0 : e.svg;
969
+ t && (I(new Blob([t], { type: "image/svg+xml" }), "diagram.svg"), f("export", "svg"));
970
+ }
971
+ function B(e) {
972
+ e.key === "Escape" && C.value && U(!1);
973
+ }
974
+ function U() {
975
+ return me.apply(this, arguments);
976
+ }
977
+ function me() {
978
+ return me = a(function* (e = !C.value) {
979
+ if (!d.allowFullscreen) return;
980
+ let t = ie.value;
981
+ if (typeof document < "u") {
982
+ if (e) {
983
+ var n;
984
+ try {
985
+ var r;
986
+ yield t == null || (r = t.requestFullscreen) == null ? void 0 : r.call(t);
987
+ } catch (e) {}
988
+ if (!T) return;
989
+ C.value = !0, document.addEventListener("keydown", B), t == null || (n = t.focus) == null || n.call(t);
990
+ } else {
991
+ try {
992
+ document.fullscreenElement && (yield document.exitFullscreen());
993
+ } catch (e) {}
994
+ if (!T) return;
995
+ C.value = !1, document.removeEventListener("keydown", B);
996
+ }
997
+ f("fullscreen", C.value);
998
+ }
999
+ }), me.apply(this, arguments);
1000
+ }
1001
+ function G(e) {
1002
+ S.value = Math.min(4, Math.max(.25, Number((S.value + e).toFixed(2))));
1003
+ }
1004
+ function q() {
1005
+ S.value = 1;
1006
+ }
1007
+ function J() {
1008
+ x.value = "preview";
1009
+ }
1010
+ function Y() {
1011
+ x.value = "source";
1012
+ }
1013
+ let ve = A(() => ({
1014
+ copy: j,
1015
+ exportPng: de,
1016
+ downloadSvg: fe,
1017
+ fullscreen: () => U(),
1018
+ retry: k,
1019
+ zoomIn: () => G(.25),
1020
+ zoomOut: () => G(-.25),
1021
+ resetZoom: q
1022
+ }));
1023
+ function ye(e) {
1024
+ return be.apply(this, arguments);
1025
+ }
1026
+ function be() {
1027
+ return be = a(function* (e) {
1028
+ try {
1029
+ yield e.run(r({ source: h.value }, ve.value)), f("action", e.key);
1030
+ } catch (r) {
1031
+ var i;
1032
+ let a = `The "${e.key}" action failed: ${t(r)}`;
1033
+ f("error", a), (i = p.onRenderError) == null || i.call(p, n("action-error", a, {
1034
+ severity: "warning",
1035
+ phase: "render",
1036
+ plugin: "mermaid"
1037
+ }));
1038
+ }
1039
+ }), be.apply(this, arguments);
1040
+ }
1041
+ let X = A(() => ({
1042
+ source: h.value,
1043
+ label: O.value,
1044
+ view: x.value,
1045
+ status: _.value,
1046
+ copied: w.value,
1047
+ fullscreen: C.value,
1048
+ compact: d.compact,
1049
+ actions: ve.value,
1050
+ showPreview: J,
1051
+ showSource: Y
1052
+ })), xe = A(() => ({
1053
+ view: x.value,
1054
+ status: _.value,
1055
+ actions: {
1056
+ preview: J,
1057
+ source: Y
1058
+ }
1059
+ })), Se = A(() => ({
1060
+ source: h.value,
1061
+ status: _.value,
1062
+ copied: w.value,
1063
+ fullscreen: C.value,
1064
+ enableZoom: d.enableZoom,
1065
+ allowFullscreen: d.allowFullscreen,
1066
+ compact: d.compact,
1067
+ actions: ve.value
1068
+ })), Ce = F({ setup() {
1069
+ return () => {
1070
+ var t;
1071
+ return p.renderHostSlot("mermaid", {
1072
+ source: h.value,
1073
+ svg: (t = y.value) == null ? void 0 : t.svg,
1074
+ status: _.value,
1075
+ error: b.value,
1076
+ actions: {
1077
+ copy: j,
1078
+ exportPng: de,
1079
+ fullscreen: () => U(),
1080
+ retry: k
1081
+ }
1082
+ }, () => {
1083
+ let t = m.mermaid;
1084
+ if (t) {
1085
+ var n;
1086
+ let e = t({
1087
+ source: h.value,
1088
+ svg: (n = y.value) == null ? void 0 : n.svg,
1089
+ status: _.value,
1090
+ error: b.value,
1091
+ actions: {
1092
+ copy: j,
1093
+ exportPng: de,
1094
+ fullscreen: () => U(),
1095
+ retry: k
1096
+ }
1097
+ });
1098
+ if (!s(e)) return e;
1099
+ }
1100
+ return y.value ? L("div", {
1101
+ class: "vmd-mermaid-diagram",
1102
+ style: { transform: `scale(${S.value})` }
1103
+ }, $(y.value.nodes, p)) : _.value === "error" ? d.showErrors ? L("div", {
1104
+ "data-vmd-part": "mermaid-error",
1105
+ class: "vmd-mermaid-error",
1106
+ role: "status"
1107
+ }, b.value) : L("div", {
1108
+ "data-vmd-part": "mermaid-fallback",
1109
+ class: "vmd-mermaid-fallback",
1110
+ role: "status"
1111
+ }, e(p.labels.mermaidFallback)) : L("div", {
1112
+ "data-vmd-part": "mermaid-pending",
1113
+ class: "vmd-mermaid-pending",
1114
+ role: "status"
1115
+ }, "Rendering diagram…");
1116
+ });
1117
+ };
1118
+ } }), we = F({ setup() {
1119
+ return () => p.renderHostSlot("mermaid-error", {
1120
+ source: h.value,
1121
+ error: b.value,
1122
+ retry: k,
1123
+ focusSource: Y
1124
+ }, () => {
1125
+ let e = m["mermaid-error"];
1126
+ if (e) {
1127
+ let t = e({
1128
+ source: h.value,
1129
+ error: b.value,
1130
+ retry: k,
1131
+ focusSource: Y
1132
+ });
1133
+ if (!s(t)) return t;
1134
+ }
1135
+ return L("div", {
1136
+ "data-vmd-part": "mermaid-error",
1137
+ class: "vmd-mermaid-error",
1138
+ role: "status"
1139
+ }, b.value);
1140
+ });
1141
+ } }), Te = F({ setup() {
1142
+ return () => p.renderHostSlot("tabs", xe.value, () => {
1143
+ let t = m.tabs;
1144
+ if (t) {
1145
+ let e = t(xe.value);
1146
+ if (!s(e)) return e;
1147
+ }
1148
+ return L("div", {
1149
+ "data-vmd-part": "mermaid-tabs",
1150
+ class: "vmd-mermaid-tabs",
1151
+ role: "tablist"
1152
+ }, [L("button", {
1153
+ type: "button",
1154
+ role: "tab",
1155
+ "data-action": "preview",
1156
+ "aria-selected": x.value === "preview" ? "true" : "false",
1157
+ "data-active": x.value === "preview" ? "true" : void 0,
1158
+ onClick: J
1159
+ }, [L(Z, { name: "preview" }), e(p.labels.preview)]), L("button", {
1160
+ type: "button",
1161
+ role: "tab",
1162
+ "data-action": "source",
1163
+ "aria-selected": x.value === "source" ? "true" : "false",
1164
+ "data-active": x.value === "source" ? "true" : void 0,
1165
+ onClick: Y
1166
+ }, [L(Z, { name: "source" }), e(p.labels.source)])]);
1167
+ });
1168
+ } }), Ee = F({ setup() {
1169
+ return () => p.renderHostSlot("actions", Se.value, () => {
1170
+ let t = m.actions;
1171
+ if (t) {
1172
+ let e = t(Se.value);
1173
+ if (!s(e)) return e;
1174
+ }
1175
+ if (d.compact) return null;
1176
+ let n = w.value ? e(p.labels.copied) : e(p.labels.copy), r = (e, t, n, r) => L("button", {
1177
+ type: "button",
1178
+ class: "vmd-mermaid-action",
1179
+ "data-vmd-part": "mermaid-action",
1180
+ "data-action": e,
1181
+ "data-icon": "true",
1182
+ "aria-label": t,
1183
+ title: t,
1184
+ onClick: r
1185
+ }, [L(Z, { name: n }), L("span", { class: "vmd-visually-hidden" }, t)]), i = [];
1186
+ d.enableZoom && i.push(r("zoom-in", e(p.labels.zoomIn), "zoom-in", () => G(.25)), r("zoom-out", e(p.labels.zoomOut), "zoom-out", () => G(-.25)), r("reset-zoom", e(p.labels.reset), "reset", q)), i.push(r("copy", n, w.value ? "check" : "copy", j), r("export-png", e(p.labels.exportPng), "image", de), r("download-svg", `${e(p.labels.download)} SVG`, "download", fe)), d.allowFullscreen && i.push(r("fullscreen", C.value ? e(p.labels.exitFullscreen) : e(p.labels.fullscreen), C.value ? "exit-fullscreen" : "fullscreen", () => U())), i.push(r("retry", e(p.labels.retry), "retry", k));
1187
+ for (let t of d.actions) {
1188
+ let n = e(t.label);
1189
+ i.push(L("button", {
1190
+ type: "button",
1191
+ class: "vmd-mermaid-action",
1192
+ "data-vmd-part": "mermaid-action",
1193
+ "data-action": t.key,
1194
+ onClick: () => void ye(t)
1195
+ }, n));
1196
+ }
1197
+ return L("div", {
1198
+ "data-vmd-part": "mermaid-actions",
1199
+ class: "vmd-mermaid-actions"
1200
+ }, i);
1201
+ });
1202
+ } }), De = F({ setup() {
1203
+ return () => p.renderHostSlot("header", X.value, () => {
1204
+ let e = m.header;
1205
+ if (e) {
1206
+ let t = e(X.value);
1207
+ if (!s(t)) return t;
1208
+ }
1209
+ return [
1210
+ L("span", { class: "vmd-mermaid-label" }, [L(Z, { name: "diagram" }), O.value]),
1211
+ L(Te),
1212
+ L(Ee)
1213
+ ];
1214
+ });
1215
+ } });
1216
+ return l({
1217
+ render: k,
1218
+ copy: j,
1219
+ exportPng: de,
1220
+ downloadSvg: fe,
1221
+ toggleFullscreen: U
1222
+ }), (e, t) => (V(), M("div", {
1223
+ ref_key: "root",
1224
+ ref: ie,
1225
+ "data-vmd-part": "mermaid",
1226
+ class: "vmd-mermaid",
1227
+ "data-vmd-theme": g.value,
1228
+ "data-status": _.value,
1229
+ "data-renderer": ae.value,
1230
+ "data-fullscreen": C.value ? "true" : void 0,
1231
+ "data-compact": o.compact ? "true" : void 0,
1232
+ "data-view": x.value,
1233
+ role: "figure",
1234
+ "aria-label": O.value,
1235
+ tabindex: "-1"
1236
+ }, [ue("div", {
1237
+ class: "vmd-mermaid-surface",
1238
+ "data-vmd-part": C.value ? "mermaid-fullscreen" : void 0
1239
+ }, [ue("div", Me, [P(K(De))]), x.value === "preview" ? (V(), M("div", Ne, [y.value && _.value === "error" && o.showErrors ? (V(), M("div", Pe, [P(K(we))])) : le("", !0), P(K(Ce))])) : (V(), M("pre", Fe, [ue("code", null, he(h.value), 1)]))], 8, je)], 8, Ae));
1240
+ }
1241
+ }), Re = /* @__PURE__ */ F({
1242
+ __name: "MarkdownMermaid",
1243
+ props: {
1244
+ node: { default: void 0 },
1245
+ code: { default: void 0 },
1246
+ renderer: { default: void 0 },
1247
+ theme: { default: void 0 },
1248
+ showErrors: {
1249
+ type: Boolean,
1250
+ default: !1
1251
+ },
1252
+ enableZoom: {
1253
+ type: Boolean,
1254
+ default: !0
1255
+ },
1256
+ allowFullscreen: {
1257
+ type: Boolean,
1258
+ default: !0
1259
+ },
1260
+ compact: {
1261
+ type: Boolean,
1262
+ default: !1
1263
+ },
1264
+ actions: { default: () => [] }
1265
+ },
1266
+ emits: [
1267
+ "rendered",
1268
+ "error",
1269
+ "copy",
1270
+ "export",
1271
+ "fullscreen",
1272
+ "action"
1273
+ ],
1274
+ setup(e, { expose: t, emit: n }) {
1275
+ let r = e, i = n, a = c(), o = H(), s = A(() => {
1276
+ var e, t;
1277
+ return (e = r.code) == null ? ((t = r.node) == null ? void 0 : t.kind) === "mermaid" ? r.node.code : "" : e;
1278
+ }), l = A(() => {
1279
+ var e;
1280
+ return (e = a.regions) == null ? void 0 : e.mermaidBlock;
1281
+ });
1282
+ function u() {
1283
+ var e;
1284
+ return (e = o.value) == null ? void 0 : e.render();
1285
+ }
1286
+ function d() {
1287
+ var e;
1288
+ return (e = o.value) == null ? void 0 : e.copy();
1289
+ }
1290
+ function f() {
1291
+ var e;
1292
+ return (e = o.value) == null ? void 0 : e.exportPng();
1293
+ }
1294
+ function p() {
1295
+ var e;
1296
+ (e = o.value) == null || e.downloadSvg();
1297
+ }
1298
+ function m() {
1299
+ var e;
1300
+ return (e = o.value) == null ? void 0 : e.toggleFullscreen();
1301
+ }
1302
+ return t({
1303
+ render: u,
1304
+ copy: d,
1305
+ exportPng: f,
1306
+ downloadSvg: p,
1307
+ toggleFullscreen: m
1308
+ }), (t, n) => l.value ? (V(), j(me(l.value), {
1309
+ key: 0,
1310
+ node: e.node,
1311
+ source: s.value,
1312
+ renderer: e.renderer,
1313
+ theme: e.theme,
1314
+ "show-errors": e.showErrors,
1315
+ "enable-zoom": e.enableZoom,
1316
+ "allow-fullscreen": e.allowFullscreen,
1317
+ compact: e.compact,
1318
+ actions: e.actions,
1319
+ onRendered: n[0] || (n[0] = (e) => i("rendered", e)),
1320
+ onError: n[1] || (n[1] = (e) => i("error", e)),
1321
+ onCopy: n[2] || (n[2] = (e) => i("copy", e)),
1322
+ onExport: n[3] || (n[3] = (e) => i("export", e)),
1323
+ onFullscreen: n[4] || (n[4] = (e) => i("fullscreen", e)),
1324
+ onAction: n[5] || (n[5] = (e) => i("action", e))
1325
+ }, N({ _: 2 }, [
1326
+ t.$slots.header ? {
1327
+ name: "header",
1328
+ fn: q((e) => [U(t.$slots, "header", R(I(e || {})))]),
1329
+ key: "0"
1330
+ } : void 0,
1331
+ t.$slots.tabs ? {
1332
+ name: "tabs",
1333
+ fn: q((e) => [U(t.$slots, "tabs", R(I(e || {})))]),
1334
+ key: "1"
1335
+ } : void 0,
1336
+ t.$slots.actions ? {
1337
+ name: "actions",
1338
+ fn: q((e) => [U(t.$slots, "actions", R(I(e || {})))]),
1339
+ key: "2"
1340
+ } : void 0,
1341
+ t.$slots.mermaid ? {
1342
+ name: "mermaid",
1343
+ fn: q((e) => [U(t.$slots, "mermaid", R(I(e || {})))]),
1344
+ key: "3"
1345
+ } : void 0,
1346
+ t.$slots["mermaid-error"] ? {
1347
+ name: "mermaid-error",
1348
+ fn: q((e) => [U(t.$slots, "mermaid-error", R(I(e || {})))]),
1349
+ key: "4"
1350
+ } : void 0
1351
+ ]), 1064, [
1352
+ "node",
1353
+ "source",
1354
+ "renderer",
1355
+ "theme",
1356
+ "show-errors",
1357
+ "enable-zoom",
1358
+ "allow-fullscreen",
1359
+ "compact",
1360
+ "actions"
1361
+ ])) : (V(), j(Le, {
1362
+ key: 1,
1363
+ ref_key: "block",
1364
+ ref: o,
1365
+ node: e.node,
1366
+ source: s.value,
1367
+ renderer: e.renderer,
1368
+ theme: e.theme,
1369
+ "show-errors": e.showErrors,
1370
+ "enable-zoom": e.enableZoom,
1371
+ "allow-fullscreen": e.allowFullscreen,
1372
+ compact: e.compact,
1373
+ actions: e.actions,
1374
+ onRendered: n[6] || (n[6] = (e) => i("rendered", e)),
1375
+ onError: n[7] || (n[7] = (e) => i("error", e)),
1376
+ onCopy: n[8] || (n[8] = (e) => i("copy", e)),
1377
+ onExport: n[9] || (n[9] = (e) => i("export", e)),
1378
+ onFullscreen: n[10] || (n[10] = (e) => i("fullscreen", e)),
1379
+ onAction: n[11] || (n[11] = (e) => i("action", e))
1380
+ }, N({ _: 2 }, [
1381
+ t.$slots.header ? {
1382
+ name: "header",
1383
+ fn: q((e) => [U(t.$slots, "header", R(I(e || {})))]),
1384
+ key: "0"
1385
+ } : void 0,
1386
+ t.$slots.tabs ? {
1387
+ name: "tabs",
1388
+ fn: q((e) => [U(t.$slots, "tabs", R(I(e || {})))]),
1389
+ key: "1"
1390
+ } : void 0,
1391
+ t.$slots.actions ? {
1392
+ name: "actions",
1393
+ fn: q((e) => [U(t.$slots, "actions", R(I(e || {})))]),
1394
+ key: "2"
1395
+ } : void 0,
1396
+ t.$slots.mermaid ? {
1397
+ name: "mermaid",
1398
+ fn: q((e) => [U(t.$slots, "mermaid", R(I(e || {})))]),
1399
+ key: "3"
1400
+ } : void 0,
1401
+ t.$slots["mermaid-error"] ? {
1402
+ name: "mermaid-error",
1403
+ fn: q((e) => [U(t.$slots, "mermaid-error", R(I(e || {})))]),
1404
+ key: "4"
1405
+ } : void 0
1406
+ ]), 1032, [
1407
+ "node",
1408
+ "source",
1409
+ "renderer",
1410
+ "theme",
1411
+ "show-errors",
1412
+ "enable-zoom",
1413
+ "allow-fullscreen",
1414
+ "compact",
1415
+ "actions"
1416
+ ]));
1417
+ }
1418
+ }), ze = {
1419
+ p: E,
1420
+ h1: v,
1421
+ h2: v,
1422
+ h3: v,
1423
+ h4: v,
1424
+ h5: v,
1425
+ h6: v,
1426
+ em: _,
1427
+ strong: O,
1428
+ del: D,
1429
+ a: S,
1430
+ img: b,
1431
+ ul: C,
1432
+ ol: C,
1433
+ li: ie,
1434
+ blockquote: m,
1435
+ hr: y,
1436
+ table: oe,
1437
+ thead: ce,
1438
+ tbody: ce,
1439
+ tfoot: ce,
1440
+ tr: k,
1441
+ th: se,
1442
+ td: se,
1443
+ code: x,
1444
+ br: h
1445
+ }, Be = {
1446
+ p: "paragraph",
1447
+ h1: "heading",
1448
+ h2: "heading",
1449
+ h3: "heading",
1450
+ h4: "heading",
1451
+ h5: "heading",
1452
+ h6: "heading",
1453
+ em: "emphasis",
1454
+ strong: "strong",
1455
+ del: "strikethrough",
1456
+ a: "link",
1457
+ img: "image",
1458
+ ul: "list",
1459
+ ol: "list",
1460
+ li: "listItem",
1461
+ blockquote: "blockquote",
1462
+ hr: "horizontalRule",
1463
+ table: "table",
1464
+ thead: "tableSection",
1465
+ tbody: "tableSection",
1466
+ tfoot: "tableSection",
1467
+ tr: "tableRow",
1468
+ th: "tableCell",
1469
+ td: "tableCell",
1470
+ code: "inlineCode",
1471
+ br: "break",
1472
+ input: "taskItem"
1473
+ };
1474
+ function Ve(e) {
1475
+ if (e === "code") return p;
1476
+ if (e === "custom") return g;
1477
+ if (e === "math") return ke;
1478
+ if (e === "mermaid") return Re;
1479
+ }
1480
+ function Q(e) {
1481
+ return typeof e == "string" || typeof e == "object";
1482
+ }
1483
+ function He(e) {
1484
+ return typeof e == "function";
1485
+ }
1486
+ function Ue(e) {
1487
+ var t;
1488
+ return e.kind === "element" ? (t = Be[e.tag]) == null ? e.tag : t : e.kind;
1489
+ }
1490
+ function We(e) {
1491
+ var t;
1492
+ return ((t = e.attrs.class) == null ? "" : t).split(/\s+/).filter(Boolean);
1493
+ }
1494
+ function Ge(e) {
1495
+ return e.children.find((e) => e.kind === "element" && e.tag === "input" && e.attrs.type === "checkbox");
1496
+ }
1497
+ function Ke(e) {
1498
+ if (e.kind === "element") {
1499
+ if (e.tag === "li" && Ge(e)) return "taskItem";
1500
+ if (e.tag === "sup" && (We(e).includes("footnote-ref") || e.attrs["data-footnote-ref"] !== void 0 || e.children.some((e) => e.kind === "element" && e.tag === "a" && (We(e).includes("footnote-ref") || e.attrs["data-footnote-ref"] !== void 0)))) return "footnoteReference";
1501
+ if (e.tag === "section" && (We(e).includes("footnotes") || e.attrs["data-footnotes"] !== void 0)) return "footnotes";
1502
+ }
1503
+ }
1504
+ function qe(e, t) {
1505
+ for (let n of e) if (n.kind === "element" && n.attrs.id === t || "children" in n && Array.isArray(n.children) && qe(n.children, t)) return !0;
1506
+ return !1;
1507
+ }
1508
+ function Je(e) {
1509
+ if (e.kind === "element") for (let n of e.children) {
1510
+ var t;
1511
+ if (n.kind === "element" && n.tag === "a" && (t = n.attrs.href) != null && t.startsWith("#")) return n.attrs.href.slice(1);
1512
+ }
1513
+ }
1514
+ function Ye(e) {
1515
+ if (e.kind === "element") {
1516
+ let t = Ue(e);
1517
+ return t === e.tag ? [e.tag] : [e.tag, t];
1518
+ }
1519
+ return e.kind === "custom" ? [e.tag, "custom"] : e.kind === "plugin" ? [e.type, "plugin"] : [e.kind];
1520
+ }
1521
+ function Xe(e, t) {
1522
+ for (let r of Ye(e)) {
1523
+ var n;
1524
+ let e = (n = t.nodeComponents) == null ? void 0 : n[r];
1525
+ if (He(e)) return e;
1526
+ }
1527
+ }
1528
+ function Ze(e, t) {
1529
+ if (e.kind === "element" && e.tag === "code") {
1530
+ var n;
1531
+ let e = (n = t.nodeComponents) == null ? void 0 : n.inlineCode;
1532
+ if (Q(e)) return e;
1533
+ let r = t.components.code;
1534
+ return typeof r == "function" || Q(r) ? r : void 0;
1535
+ }
1536
+ let r = Ke(e);
1537
+ if (r) {
1538
+ var i;
1539
+ let e = (i = t.nodeComponents) == null ? void 0 : i[r];
1540
+ if (Q(e)) return e;
1541
+ }
1542
+ let a = Ue(e);
1543
+ for (let n of Ye(e)) {
1544
+ var o, s;
1545
+ let e = (o = t.nodeComponents) == null ? void 0 : o[n];
1546
+ if (Q(e)) return e;
1547
+ let r = t.components[n];
1548
+ if (typeof r == "function" || Q(r)) return r;
1549
+ if (n !== a && (s = t.nodeComponents) != null && s[a]) {
1550
+ let e = t.nodeComponents[a];
1551
+ if (Q(e)) return e;
1552
+ }
1553
+ }
1554
+ }
1555
+ function Qe(e, t) {
1556
+ if (!e.segments || e.segments.length === 0) return e.value;
1557
+ let n = t.components.mark;
1558
+ return e.segments.map((e, t) => e.match ? typeof n == "string" ? L(n, {
1559
+ class: "vmd-search-match",
1560
+ "data-vmd-part": "search-match",
1561
+ key: t
1562
+ }, e.value) : typeof n == "object" || typeof n == "function" ? L(n, {
1563
+ class: "vmd-search-match",
1564
+ "data-vmd-part": "search-match",
1565
+ key: t
1566
+ }, { default: () => e.value }) : L("mark", {
1567
+ class: "vmd-search-match",
1568
+ "data-vmd-part": "search-match",
1569
+ key: t
1570
+ }, e.value) : e.value);
1571
+ }
1572
+ function $e(e, t) {
1573
+ var n;
1574
+ let r = (n = t.nodeComponents) == null ? void 0 : n[e];
1575
+ return Q(r) ? r : void 0;
1576
+ }
1577
+ function et(e) {
1578
+ return e.kind === "element" || e.kind === "custom" ? {
1579
+ kind: e.kind,
1580
+ tag: e.tag,
1581
+ attrs: e.attrs
1582
+ } : {
1583
+ kind: e.kind,
1584
+ attrs: {}
1585
+ };
1586
+ }
1587
+ function tt(e, t) {
1588
+ return () => $(e.children, t);
1589
+ }
1590
+ var nt = /* @__PURE__ */ new WeakMap();
1591
+ function rt(e) {
1592
+ let t = nt.get(e);
1593
+ if (t !== void 0) return t;
1594
+ let n = e.props, r = Array.isArray(n) ? n.indexOf("children") !== -1 : typeof n == "object" && !!n && Object.prototype.hasOwnProperty.call(n, "children");
1595
+ return nt.set(e, r), r;
1596
+ }
1597
+ function it(e, t, n, i, a = {}, o) {
1598
+ let s = r(r(r({}, i), a), {}, { key: t.key });
1599
+ "children" in s && (typeof e == "string" || !rt(e)) && delete s.children;
1600
+ let c = o == null ? (() => []) : o;
1601
+ return typeof e == "string" ? L(e, s, c) : L(e, r(r({}, s), {}, { node: t }), { default: c });
1602
+ }
1603
+ function at(e, t, n = !1) {
1604
+ var i, a, o;
1605
+ let s = (i = t.nodeComponents) == null ? void 0 : i.code, c = e.language ? `language-${e.language}` : void 0, l = `${e.key}-code`;
1606
+ if (!n && He(s)) return s(r(r({ node: e }, et(e)), {}, {
1607
+ key: l,
1608
+ children: () => [e.code],
1609
+ defaultRender: () => at(e, t, !0),
1610
+ context: t
1611
+ }));
1612
+ let u = (a = (o = Q(s) ? s : void 0) == null ? Q(t.components.code) ? t.components.code : void 0 : o) == null ? "code" : a;
1613
+ return typeof u == "string" ? L(u, {
1614
+ class: c ? ["vmd-code-element", c] : "vmd-code-element",
1615
+ key: l
1616
+ }, e.code) : L(u, r({
1617
+ node: e,
1618
+ className: c,
1619
+ key: l
1620
+ }, s ? {
1621
+ code: e.code,
1622
+ language: e.language
1623
+ } : {}), { default: () => [e.code] });
1624
+ }
1625
+ function ot(e, t) {
1626
+ var n, r;
1627
+ let i = t.components.pre;
1628
+ return typeof i == "function" || Q(i) ? it(i, e, t, {}, {}, () => [at(e, t)]) : Q(t.components.code) || Q((n = t.nodeComponents) == null ? void 0 : n.code) || He((r = t.nodeComponents) == null ? void 0 : r.code) ? it(p, e, t, {}, {}, () => [at(e, t)]) : L(Ee, {
1629
+ node: e,
1630
+ key: e.key
1631
+ });
1632
+ }
1633
+ function st(e, t) {
1634
+ let n = Ge(e), r = (n == null ? void 0 : n.attrs.checked) !== void 0 && n.attrs.checked !== "false", i = e.children.filter((e) => e !== n);
1635
+ return L(ae, {
1636
+ node: e,
1637
+ key: e.key,
1638
+ checked: r,
1639
+ children: e.children
1640
+ }, { default: () => $(i, t) });
1641
+ }
1642
+ function ct(e, t) {
1643
+ return L(T, {
1644
+ node: e,
1645
+ key: e.key
1646
+ }, { default: () => $(e.children, t) });
1647
+ }
1648
+ function lt(e, t) {
1649
+ let n = Je(e), r = n !== void 0 && t.document !== void 0 && !qe(t.document.nodes, n);
1650
+ return L(w, {
1651
+ node: e,
1652
+ key: e.key,
1653
+ missing: r
1654
+ }, { default: () => $(e.children, t) });
1655
+ }
1656
+ function ut(e, t, n) {
1657
+ if (n === "taskItem") return st(e, t);
1658
+ if (n === "footnotes") return ct(e, t);
1659
+ if (n === "footnoteReference") return lt(e, t);
1660
+ }
1661
+ function dt(e, t) {
1662
+ var n;
1663
+ let r = (n = $e(e.tag, t)) == null ? $e("custom", t) : n;
1664
+ return it(r == null ? g : r, e, t, e.attrs, {
1665
+ tag: e.tag,
1666
+ customProps: e.props
1667
+ }, tt(e, t));
1668
+ }
1669
+ function ft(e, t) {
1670
+ switch (e.kind) {
1671
+ case "text": return Qe(e, t);
1672
+ case "element": {
1673
+ let n = Ze(e, t);
1674
+ if (!n) {
1675
+ let n = Ke(e), r = n ? ut(e, t, n) : void 0;
1676
+ if (r !== void 0) return r;
1677
+ }
1678
+ let i = n == null ? ze[e.tag] : n;
1679
+ if (!i) {
1680
+ let n = r({}, e.attrs);
1681
+ return delete n.children, L(e.tag, r(r({}, n), {}, { key: e.key }), tt(e, t));
1682
+ }
1683
+ return it(i, e, t, e.attrs, { children: e.children }, tt(e, t));
1684
+ }
1685
+ case "code": return ot(e, t);
1686
+ case "custom": return dt(e, t);
1687
+ case "math":
1688
+ var n, i;
1689
+ return it((n = (i = Ze(e, t)) == null ? Ve("math") : i) == null ? "span" : n, e, t, {}, {
1690
+ tex: e.tex,
1691
+ displayMode: e.displayMode,
1692
+ rendered: e.rendered
1693
+ });
1694
+ case "mermaid":
1695
+ var a, o;
1696
+ return it((a = (o = Ze(e, t)) == null ? Ve("mermaid") : o) == null ? "pre" : a, e, t, {}, { code: e.code });
1697
+ case "plugin":
1698
+ var s, c;
1699
+ return it((s = (c = Ze(e, t)) == null ? Ve(e.type) : c) == null ? "div" : s, e, t, {}, { payload: e.payload }, e.children ? () => $(e.children, t) : () => []);
1700
+ default: return null;
1701
+ }
1702
+ }
1703
+ function pt(e, t) {
1704
+ if (e.kind === "text") return Qe(e, t);
1705
+ if (e.kind !== "code") {
1706
+ let n = Xe(e, t);
1707
+ if (n) {
1708
+ let i = n, a = e.kind === "element" || e.kind === "custom" ? tt(e, t) : void 0;
1709
+ return i(r(r({ node: e }, et(e)), {}, {
1710
+ key: e.key,
1711
+ children: () => a ? a() : [],
1712
+ defaultRender: () => ft(e, t),
1713
+ context: t
1714
+ }));
1715
+ }
1716
+ }
1717
+ return ft(e, t);
1718
+ }
1719
+ function $(e, t) {
1720
+ return e.map((e) => pt(e, t));
1721
+ }
1722
+ export { Ee as a, ke as i, Re as n, be as o, Le as r, ve as s, $ as t };
1723
+
1724
+ //# sourceMappingURL=render-Cs8iKrgz.js.map