file-viewer3 1.0.7 → 1.0.25

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 (423) hide show
  1. package/LICENSE +160 -0
  2. package/README.en.md +390 -0
  3. package/README.md +306 -87
  4. package/dist/_headers +22 -0
  5. package/dist/assets/3MFLoader--yjh7udp.js +1 -0
  6. package/dist/assets/AMFLoader-C0y7NIAO.js +1 -0
  7. package/dist/assets/ArchiveViewer-6AvBZVl3.js +2 -0
  8. package/dist/assets/ArchiveViewer-B2pHxHFv.css +1 -0
  9. package/dist/assets/AudioViewer-0CSMvCtp.css +1 -0
  10. package/dist/assets/AudioViewer-6a_DDcur.js +1 -0
  11. package/dist/assets/CadViewer-A9PKtCth.css +1 -0
  12. package/dist/assets/CadViewer-D94LUXKO.js +110 -0
  13. package/dist/assets/CodeViewer-BdZGsbFh.js +2 -0
  14. package/dist/assets/CodeViewer-CR2CsPRi.css +1 -0
  15. package/dist/assets/ColladaLoader-DTiuvWJL.js +3 -0
  16. package/dist/assets/DrawingViewer-BplS278E.js +2 -0
  17. package/dist/assets/DrawingViewer-DXiF5YWV.css +1 -0
  18. package/dist/assets/EdaViewer-BXH1Jmwr.js +8 -0
  19. package/dist/assets/EdaViewer-CKf1YQnh.css +1 -0
  20. package/dist/assets/EmailViewer-BsBKZ_A5.js +4 -0
  21. package/dist/assets/EmailViewer-BwvGE4ns.css +1 -0
  22. package/dist/assets/EpubViewer-Cci0l1Vm.css +1 -0
  23. package/dist/assets/EpubViewer-DlGzr8_x.js +2 -0
  24. package/dist/assets/FBXLoader-Bj34Z_uf.js +1 -0
  25. package/dist/assets/GLTFLoader-BNUIXeRP.js +1 -0
  26. package/dist/assets/ImageViewer-BKp7YpMs.css +10 -0
  27. package/dist/assets/ImageViewer-D1Yc0jYg.js +1 -0
  28. package/dist/assets/KMZLoader-DTmXWzX_.js +1 -0
  29. package/dist/assets/MarkdownViewer-CIljbLlu.css +1 -0
  30. package/dist/assets/MarkdownViewer-CRi0rhWw.js +64 -0
  31. package/dist/assets/ModelViewer-C4ir9AyI.css +1 -0
  32. package/dist/assets/ModelViewer-yxcVdLzz.js +2 -0
  33. package/dist/assets/OBJLoader-DW4Mv-mq.js +5 -0
  34. package/dist/assets/OfdViewer-DbkG1-Bp.js +2 -0
  35. package/dist/assets/OfdViewer-Ulv-WZWh.css +1 -0
  36. package/dist/assets/PCDLoader-CHA1g8rk.js +3 -0
  37. package/dist/assets/PLYLoader-DwTzA-Dg.js +2 -0
  38. package/dist/assets/PdfView-_Uu48dkU.js +558 -0
  39. package/dist/assets/PdfView-fKwbB_8j.css +1 -0
  40. package/dist/assets/PptxRender-BNoW_9_0.css +1 -0
  41. package/dist/assets/PptxRender-myCCfHiR.js +32 -0
  42. package/dist/assets/STLLoader-Bt7FMgMu.js +1 -0
  43. package/dist/assets/TDSLoader-D__OhSS9.js +1 -0
  44. package/dist/assets/TypstViewer-4dMAIp9x.js +60 -0
  45. package/dist/assets/TypstViewer-BgYR02wU.css +1 -0
  46. package/dist/assets/USDLoader-BovI5HgZ.js +6 -0
  47. package/dist/assets/UmdViewer-BfIWw5dV.js +3 -0
  48. package/dist/assets/UmdViewer-DpObj56a.css +1 -0
  49. package/dist/assets/VRMLLoader-_VxVXPvX.js +140 -0
  50. package/dist/assets/VTKLoader-BfnzBXsa.js +3 -0
  51. package/dist/assets/XYZLoader-DbQZs-aZ.js +2 -0
  52. package/dist/assets/XlsxTable-CKmWT6Iw.js +5 -0
  53. package/dist/assets/XlsxTable-Ccp_ksQc.css +1 -0
  54. package/dist/assets/__vite-browser-external-j1Zxnfxm.js +1 -0
  55. package/dist/assets/ar-SA-G6X2FPQ2-h0GtAVoD.js +10 -0
  56. package/dist/assets/arc-C_eH0vTw.js +1 -0
  57. package/dist/assets/architecture-7EHR7CIX-nPLvVkG5.js +1 -0
  58. package/dist/assets/architectureDiagram-3BPJPVTR-Cx8fJaC_.js +36 -0
  59. package/dist/assets/archive-D-0w4Z7t.js +2 -0
  60. package/dist/assets/audio-IkwcqgJA.js +2 -0
  61. package/dist/assets/az-AZ-76LH7QW2-D_aQ-6Zd.js +1 -0
  62. package/dist/assets/bash-LmRjUKlR.js +1 -0
  63. package/dist/assets/bg-BG-XCXSNQG7-H7Czia1L.js +5 -0
  64. package/dist/assets/blockDiagram-GPEHLZMM-v3Efy6dm.js +132 -0
  65. package/dist/assets/bn-BD-2XOGV67Q-f6ymEr9g.js +5 -0
  66. package/dist/assets/c4Diagram-AAUBKEIU-BdstYnMv.js +10 -0
  67. package/dist/assets/ca-ES-6MX7JW3Y-DTzyqWmS.js +8 -0
  68. package/dist/assets/cad-DFnQbJJO.js +2 -0
  69. package/dist/assets/cfb-Bv6fOQ4m.js +11 -0
  70. package/dist/assets/channel-C66J400U.js +1 -0
  71. package/dist/assets/chunk-2J33WTMH-BoyKZPbs.js +1 -0
  72. package/dist/assets/chunk-3OPIFGDE-a_QAVzsM.js +62 -0
  73. package/dist/assets/chunk-4BX2VUAB-DZj4_o2K.js +1 -0
  74. package/dist/assets/chunk-55IACEB6-C7hP08Mf.js +1 -0
  75. package/dist/assets/chunk-5ZQYHXKU-DBQ_7Zc2.js +2 -0
  76. package/dist/assets/chunk-6U3AYISY-C6-Mtja1.js +12 -0
  77. package/dist/assets/chunk-727SXJPM-BVNP_kQ-.js +206 -0
  78. package/dist/assets/chunk-AGHRB4JF-DrBKq3qz.js +1 -0
  79. package/dist/assets/chunk-AQP2D5EJ-0N6k4ROT.js +231 -0
  80. package/dist/assets/chunk-BSJP7CBP-b8olRIQO.js +1 -0
  81. package/dist/assets/chunk-CSCIHK7Q-B5j-yHKS.js +124 -0
  82. package/dist/assets/chunk-EIO257PC-C6qii-N9.js +22 -0
  83. package/dist/assets/chunk-FMBD7UC4-CBBZh2UU.js +15 -0
  84. package/dist/assets/chunk-K2UTITRG-Cx4xt2xV.js +35 -0
  85. package/dist/assets/chunk-KSCS5N6A-Dwg0HTxH.js +10 -0
  86. package/dist/assets/chunk-L5ZTLDWV-BPuCpePB.js +1 -0
  87. package/dist/assets/chunk-LZXEDZCA-CvLuVK3G.js +2 -0
  88. package/dist/assets/chunk-ND2GUHAM-CWJPhGEg.js +1 -0
  89. package/dist/assets/chunk-NNHCCRGN-DlpIbxXb.js +159 -0
  90. package/dist/assets/chunk-NZK2D7GU-DuaLWEa1.js +1 -0
  91. package/dist/assets/chunk-O5CBEL6O-dK2KeDfH.js +70 -0
  92. package/dist/assets/chunk-QZHKN3VN-4Bf82riF.js +1 -0
  93. package/dist/assets/chunk-SRAX5OIU-BhbLEiib.js +1 -0
  94. package/dist/assets/chunk-WU5MYG2G-DLkui5D2.js +1 -0
  95. package/dist/assets/chunk-XPW4576I-BvXQTKbm.js +32 -0
  96. package/dist/assets/chunk-Z3N5DIM6-D9TMVU7m.js +1 -0
  97. package/dist/assets/chunk-ZUYEQ4TG-BzFOpW--.js +7 -0
  98. package/dist/assets/classDiagram-4FO5ZUOK-DKj6zlra.js +1 -0
  99. package/dist/assets/classDiagram-v2-Q7XG4LA2-DKj6zlra.js +1 -0
  100. package/dist/assets/compare-BA1y8ff-.css +1 -0
  101. package/dist/assets/compare-QN3IusOj.js +1 -0
  102. package/dist/assets/compiler-qgJWLAtm.js +1 -0
  103. package/dist/assets/core-S5OLGxXP.js +3 -0
  104. package/dist/assets/cose-bilkent-S5V4N54A-CslZOqNN.js +1 -0
  105. package/dist/assets/cpp-V0F2hNk9.js +1 -0
  106. package/dist/assets/cs-CZ-2BRQDIVT-BRw0NNL_.js +11 -0
  107. package/dist/assets/csharp-GZmu99Fo.js +1 -0
  108. package/dist/assets/css-D5l_8KUR.js +1 -0
  109. package/dist/assets/cytoscape.esm-C8YCVR3_.js +321 -0
  110. package/dist/assets/da-DK-5WZEPLOC-q5u_UoZe.js +5 -0
  111. package/dist/assets/dagre-BM42HDAG-D6fpH9H3.js +4 -0
  112. package/dist/assets/dagre-Bx709z4p.js +1 -0
  113. package/dist/assets/de-DE-XR44H4JA-B79lsSt9.js +8 -0
  114. package/dist/assets/defaultLocale-C8Fc0cco.js +1 -0
  115. package/dist/assets/diagram-2AECGRRQ-DGviV3zF.js +43 -0
  116. package/dist/assets/diagram-5GNKFQAL-D8edmK5r.js +10 -0
  117. package/dist/assets/diagram-KO2AKTUF-DonC_-9l.js +3 -0
  118. package/dist/assets/diagram-LMA3HP47-T0-OD5uV.js +24 -0
  119. package/dist/assets/diagram-OG6HWLK6-BsRJiZE3.js +24 -0
  120. package/dist/assets/diff-CJb8JxGC.js +1 -0
  121. package/dist/assets/directory-open-01563666-D4xXyWb_.js +1 -0
  122. package/dist/assets/directory-open-4ed118d0-1i309Asm.js +1 -0
  123. package/dist/assets/dist-ND9DUPs_.js +1 -0
  124. package/dist/assets/dist-S-2Hyh3N.js +1 -0
  125. package/dist/assets/dist-jshluroQ.js +27 -0
  126. package/dist/assets/docx-preview-CAHEyNQy.js +20 -0
  127. package/dist/assets/drawing-B3sCN7BX.js +2 -0
  128. package/dist/assets/ebook-DDycOGR3.js +2 -0
  129. package/dist/assets/eda-JxVOVy9j.js +2 -0
  130. package/dist/assets/el-GR-BZB4AONW-DVV0CNhT.js +10 -0
  131. package/dist/assets/email-D9tCfCzQ.js +2 -0
  132. package/dist/assets/en-B4ZKOASM-CpbJugBW.js +1 -0
  133. package/dist/assets/erDiagram-TEJ5UH35-O-dDoXsU.js +85 -0
  134. package/dist/assets/es-ES-U4NZUMDT-DUvN9FXg.js +9 -0
  135. package/dist/assets/eu-ES-A7QVB2H4-DV6UAZB_.js +11 -0
  136. package/dist/assets/eventmodeling-FCH6USID-BONfeu8r.js +1 -0
  137. package/dist/assets/fa-IR-HGAKTJCU-0ql2xhuq.js +8 -0
  138. package/dist/assets/fflate.module-BIQmJeC9.js +1 -0
  139. package/dist/assets/fi-FI-Z5N7JZ37-CxtRUMtw.js +6 -0
  140. package/dist/assets/file-open-002ab408-BHUWm0Sh.js +1 -0
  141. package/dist/assets/file-open-7c801643-DZtJT5zp.js +1 -0
  142. package/dist/assets/file-save-3189631c-CO9S4HFW.js +1 -0
  143. package/dist/assets/file-save-745eba88-Bwdfz6OZ.js +1 -0
  144. package/dist/assets/flowDiagram-I6XJVG4X-DsWkZiFB.js +162 -0
  145. package/dist/assets/fr-FR-RHASNOE6-CLi1nCBA.js +9 -0
  146. package/dist/assets/ganttDiagram-6RSMTGT7-r5IfYmu1.js +292 -0
  147. package/dist/assets/gitGraph-WXDBUCRP-BPjRwtiT.js +1 -0
  148. package/dist/assets/gitGraphDiagram-PVQCEYII-DGYT-2sl.js +106 -0
  149. package/dist/assets/gl-ES-HMX3MZ6V-NMLOwshd.js +10 -0
  150. package/dist/assets/global-compiler-D1EEBbpA.js +1 -0
  151. package/dist/assets/global-renderer-AKzBLvRw.js +1 -0
  152. package/dist/assets/go-B-PCS5zA.js +1 -0
  153. package/dist/assets/graphlib-B8gBHxth.js +1 -0
  154. package/dist/assets/he-IL-6SHJWFNN-BWPkP_3r.js +10 -0
  155. package/dist/assets/hi-IN-IWLTKZ5I-KNyxys-k.js +4 -0
  156. package/dist/assets/hu-HU-A5ZG7DT2-BjcxkVW9.js +7 -0
  157. package/dist/assets/id-ID-SAP4L64H-B-oUkzcH.js +10 -0
  158. package/dist/assets/image-6zdrB4g6.js +2 -0
  159. package/dist/assets/image-GAAHSSAO-7tK5sChZ.js +1 -0
  160. package/dist/assets/image-blob-reduce.esm-NzmDxm1v.js +2 -0
  161. package/dist/assets/info-J43DQDTF-sQY7EXUc.js +1 -0
  162. package/dist/assets/infoDiagram-5YYISTIA-Dzg1KIdJ.js +2 -0
  163. package/dist/assets/ini-B1CroMsf.js +1 -0
  164. package/dist/assets/init-D6jRqBbL.js +1 -0
  165. package/dist/assets/ishikawaDiagram-YF4QCWOH-C4gAmRlT.js +70 -0
  166. package/dist/assets/it-IT-JPQ66NNP-Bwud0QsX.js +11 -0
  167. package/dist/assets/ja-JP-DBVTYXUO-DgNQ5bjg.js +8 -0
  168. package/dist/assets/java-ChVphriW.js +1 -0
  169. package/dist/assets/javascript-w9aIBC1S.js +1 -0
  170. package/dist/assets/journeyDiagram-JHISSGLW-ofw85AZe.js +139 -0
  171. package/dist/assets/json-DS4EA3dC.js +1 -0
  172. package/dist/assets/jszip.min-C7VJhIfM.js +2 -0
  173. package/dist/assets/kaa-6HZHGXH3-BMz8LTXv.js +1 -0
  174. package/dist/assets/kab-KAB-ZGHBKWFO-B9w0Zir8.js +8 -0
  175. package/dist/assets/kanban-definition-UN3LZRKU-CljG07f4.js +89 -0
  176. package/dist/assets/katex-Vhh-h91d.js +257 -0
  177. package/dist/assets/kk-KZ-P5N5QNE5-2tUcaoKh.js +1 -0
  178. package/dist/assets/km-KH-HSX4SM5Z-_kaSqGhJ.js +11 -0
  179. package/dist/assets/ko-KR-MTYHY66A-CIjaox2B.js +9 -0
  180. package/dist/assets/ku-TR-6OUDTVRD-CkLMAwgC.js +9 -0
  181. package/dist/assets/lib-CxFoY_GP.js +6 -0
  182. package/dist/assets/libarchive-DknIq1tb.js +1 -0
  183. package/dist/assets/libarchive-DxGirPmi.wasm +0 -0
  184. package/dist/assets/linear-DAeDjlp3.js +1 -0
  185. package/dist/assets/logo-DG62cSZK.png +0 -0
  186. package/dist/assets/lt-LT-XHIRWOB4-BsH7UAds.js +3 -0
  187. package/dist/assets/lv-LV-5QDEKY6T-DH8to9BS.js +7 -0
  188. package/dist/assets/main-B8S7RFzE.js +4 -0
  189. package/dist/assets/main-BZ1u3qpM.css +1 -0
  190. package/dist/assets/markdown-C8bVcNXx.js +1 -0
  191. package/dist/assets/md-OHaN-Ra2.js +2 -0
  192. package/dist/assets/mermaid-parser.core-DX-qibXo.js +4 -0
  193. package/dist/assets/mindmap-definition-RKZ34NQL-5NZ4x9hJ.js +96 -0
  194. package/dist/assets/model-B6Ua5SnP.js +2 -0
  195. package/dist/assets/mp4-Dho29Zd7.js +1 -0
  196. package/dist/assets/mr-IN-CRQNXWMA-BrKaFNSo.js +13 -0
  197. package/dist/assets/my-MM-5M5IBNSE-BZSEmctA.js +1 -0
  198. package/dist/assets/nb-NO-T6EIAALU-6a9gavJA.js +10 -0
  199. package/dist/assets/nestedRender-vUCW8qgY.js +3 -0
  200. package/dist/assets/nl-NL-IS3SIHDZ-uxPhLMYz.js +8 -0
  201. package/dist/assets/nn-NO-6E72VCQL-D4PNCwHO.js +8 -0
  202. package/dist/assets/oc-FR-POXYY2M6-C7kpaHdZ.js +8 -0
  203. package/dist/assets/ofd-CM51fmds.js +2 -0
  204. package/dist/assets/ofd-CsX4S_yH.js +6 -0
  205. package/dist/assets/ordinal-hYBb2elL.js +1 -0
  206. package/dist/assets/pa-IN-N4M65BXN-DudflUsb.js +4 -0
  207. package/dist/assets/package-BuR3Qm_h.css +1 -0
  208. package/dist/assets/package-DbhUOWuO.js +296 -0
  209. package/dist/assets/packet-YPE3B663-zJFiRlih.js +1 -0
  210. package/dist/assets/pdf-CZTifdsT.js +2 -0
  211. package/dist/assets/percentages-BXMCSKIN-DuKjcyNK.js +1 -0
  212. package/dist/assets/php-5k5YNuRS.js +2 -0
  213. package/dist/assets/pica-W1nY7k4k.js +2 -0
  214. package/dist/assets/pie-CZr-MxNa.js +1 -0
  215. package/dist/assets/pie-LRSECV5Y-ChrxPon2.js +1 -0
  216. package/dist/assets/pieDiagram-4H26LBE5-rqS9xOI6.js +30 -0
  217. package/dist/assets/pl-PL-T2D74RX3-BjwyDbo2.js +9 -0
  218. package/dist/assets/postal-mime-kkzCFkih.js +29 -0
  219. package/dist/assets/pptx-HCi3sDR0.js +2 -0
  220. package/dist/assets/printLayout-D2pf0W9y.js +24 -0
  221. package/dist/assets/prod-CAexHIHC.js +149 -0
  222. package/dist/assets/pt-BR-5N22H2LF-dhO4g53z.js +9 -0
  223. package/dist/assets/pt-PT-UZXXM6DQ-B0FVw5E6.js +9 -0
  224. package/dist/assets/python-DwhXSSGr.js +1 -0
  225. package/dist/assets/quadrantDiagram-W4KKPZXB-CvbA748i.js +7 -0
  226. package/dist/assets/radar-GUYGQ44K-Ch58tAlJ.js +1 -0
  227. package/dist/assets/reactivity.esm-bundler-Bfmlzvr-.js +1 -0
  228. package/dist/assets/renderer-69XMfifI.js +1 -0
  229. package/dist/assets/requirementDiagram-4Y6WPE33-Ek_Wtky1.js +84 -0
  230. package/dist/assets/ro-RO-JPDTUUEW-CRyQ9zJm.js +11 -0
  231. package/dist/assets/rough.esm-CIepY_sA.js +1 -0
  232. package/dist/assets/roundRect-D01gJrlt.js +1 -0
  233. package/dist/assets/ru-RU-B4JR7IUQ-Ccj6OqLf.js +9 -0
  234. package/dist/assets/runtime-core.esm-bundler-CR6OOEFf.js +1 -0
  235. package/dist/assets/rust-Dk33Kfe-.js +1 -0
  236. package/dist/assets/sankeyDiagram-5OEKKPKP-D3gZ6xE7.js +40 -0
  237. package/dist/assets/sequenceDiagram-3UESZ5HK-C5489xFA.js +162 -0
  238. package/dist/assets/si-LK-N5RQ5JYF-BwS2qaTv.js +1 -0
  239. package/dist/assets/sk-SK-C5VTKIMK-ly1tHoOw.js +6 -0
  240. package/dist/assets/sl-SI-NN7IZMDC-iZiOFm2y.js +6 -0
  241. package/dist/assets/sql-DWRKyvJ-.js +1 -0
  242. package/dist/assets/src-BrOGWJpF.js +1 -0
  243. package/dist/assets/src-D_n3k0l_.js +5 -0
  244. package/dist/assets/stateDiagram-AJRCARHV-1hoVbE34.js +1 -0
  245. package/dist/assets/stateDiagram-v2-BHNVJYJU-CZmypPHd.js +1 -0
  246. package/dist/assets/style-x1XGuNl0.css +1 -0
  247. package/dist/assets/subset-shared.chunk-CK2m59fy.js +1 -0
  248. package/dist/assets/subset-worker.chunk-B5G7hWyg.js +1 -0
  249. package/dist/assets/sv-SE-XGPEYMSR-BNpkY1PO.js +10 -0
  250. package/dist/assets/ta-IN-2NMHFXQM-DsldkrWk.js +9 -0
  251. package/dist/assets/text-CMp0EW11.js +2 -0
  252. package/dist/assets/th-TH-HPSO5L25-AVrKqKOh.js +2 -0
  253. package/dist/assets/three.module-BFsVh7r1.js +4104 -0
  254. package/dist/assets/time-B8nkukJS.js +1 -0
  255. package/dist/assets/timeline-definition-PNZ67QCA-CfMKM_FS.js +120 -0
  256. package/dist/assets/tr-TR-DEFEU3FU-DYarL0Oa.js +7 -0
  257. package/dist/assets/treeView-BLDUP644-CGGdcSoP.js +1 -0
  258. package/dist/assets/treemap-LRROVOQU-C3Zg5qig.js +1 -0
  259. package/dist/assets/typescript-BvteI6YB.js +1 -0
  260. package/dist/assets/typst-DOlgRigg.js +2 -0
  261. package/dist/assets/typst_ts_renderer_bg-DRRWm1TP.wasm +0 -0
  262. package/dist/assets/uk-UA-QMV73CPH-D36-a0jl.js +6 -0
  263. package/dist/assets/umd-r51rBtd2.js +2 -0
  264. package/dist/assets/vennDiagram-CIIHVFJN-GrdHiqIf.js +34 -0
  265. package/dist/assets/vi-VN-M7AON7JQ-zdUBY1Fz.js +5 -0
  266. package/dist/assets/wardley-L42UT6IY-ilBO1QYS.js +1 -0
  267. package/dist/assets/wardleyDiagram-YWT4CUSO-Cgr3uPws.js +78 -0
  268. package/dist/assets/wasm-C3ukMqzA.js +1 -0
  269. package/dist/assets/wasm-pack-shim-BShYmbRf.js +1 -0
  270. package/dist/assets/wasm-pack-shim-BnuNh1z7.js +1 -0
  271. package/dist/assets/word-DQCwLNG7.js +150 -0
  272. package/dist/assets/worker-bundle-Dx5mKZOL.js +6 -0
  273. package/dist/assets/worker-ref-BbTnHTC-.js +1 -0
  274. package/dist/assets/xlsx-B1qUDXfb.js +2 -0
  275. package/dist/assets/xlsx-ff7ER-JZ.png +0 -0
  276. package/dist/assets/xml-DasnpDVC.js +1 -0
  277. package/dist/assets/xychartDiagram-2RQKCTM6-BwoaSxOF.js +7 -0
  278. package/dist/assets/yaml-1XF8XcZB.js +1 -0
  279. package/dist/assets/zh-CN-LNUGB5OW-WQ7J6JkH.js +10 -0
  280. package/dist/assets/zh-HK-E62DVLB3-BoGXaBos.js +1 -0
  281. package/dist/assets/zh-TW-RAJ6MFWO-DZQOFop7.js +9 -0
  282. package/dist/compare.html +21 -0
  283. package/dist/example/README.md +137 -0
  284. package/dist/example/SOURCES.md +49 -0
  285. package/dist/example/app.log +13 -0
  286. package/dist/example/archive.tar.gz +0 -0
  287. package/dist/example/archive.zip +0 -0
  288. package/dist/example/audio.mp3 +0 -0
  289. package/dist/example/audio.ogg +0 -0
  290. package/dist/example/book.epub +0 -0
  291. package/dist/example/book.umd +0 -0
  292. package/dist/example/change.diff +40 -0
  293. package/dist/example/code.cjs +38 -0
  294. package/dist/example/code.css +64 -0
  295. package/dist/example/code.java +55 -0
  296. package/dist/example/code.js +55 -0
  297. package/dist/example/code.jsx +43 -0
  298. package/dist/example/code.mjs +36 -0
  299. package/dist/example/code.py +56 -0
  300. package/dist/example/code.ts +78 -0
  301. package/dist/example/code.tsx +36 -0
  302. package/dist/example/component.vue +68 -0
  303. package/dist/example/config.yaml +48 -0
  304. package/dist/example/config.yml +25 -0
  305. package/dist/example/data.json +50 -0
  306. package/dist/example/data.xml +47 -0
  307. package/dist/example/drawing.dxf +22186 -0
  308. package/dist/example/embedded.html +316 -0
  309. package/dist/example/excel.fods +0 -0
  310. package/dist/example/excel.numbers +0 -0
  311. package/dist/example/excel.ods +0 -0
  312. package/dist/example/excel.xls +0 -0
  313. package/dist/example/excel.xlsb +0 -0
  314. package/dist/example/excel.xlsm +0 -0
  315. package/dist/example/excel.xlsx +0 -0
  316. package/dist/example/flow.excalidraw +1 -0
  317. package/dist/example/index.php +44 -0
  318. package/dist/example/main.c +39 -0
  319. package/dist/example/main.cpp +50 -0
  320. package/dist/example/main.go +55 -0
  321. package/dist/example/main.h +22 -0
  322. package/dist/example/main.hpp +28 -0
  323. package/dist/example/main.rs +36 -0
  324. package/dist/example/markdown.md +84 -0
  325. package/dist/example/model.gltf +66 -0
  326. package/dist/example/model.obj +10 -0
  327. package/dist/example/model.ply +18 -0
  328. package/dist/example/model.step +9 -0
  329. package/dist/example/model.stl +30 -0
  330. package/dist/example/module.cc +36 -0
  331. package/dist/example/notes.markdown +15 -0
  332. package/dist/example/ofd.ofd +0 -0
  333. package/dist/example/page.htm +29 -0
  334. package/dist/example/page.html +33 -0
  335. package/dist/example/pdf.pdf +9125 -3
  336. package/dist/example/pic.bmp +0 -0
  337. package/dist/example/pic.gif +0 -0
  338. package/dist/example/pic.jpeg +0 -0
  339. package/dist/example/pic.jpg +0 -0
  340. package/dist/example/pic.png +0 -0
  341. package/dist/example/pic.tif +0 -0
  342. package/dist/example/pic.tiff +0 -0
  343. package/dist/example/pic.webp +0 -0
  344. package/dist/example/ppt.pptx +0 -0
  345. package/dist/example/process.drawio +249 -0
  346. package/dist/example/program.cs +42 -0
  347. package/dist/example/query.sql +30 -0
  348. package/dist/example/report.typ +90 -0
  349. package/dist/example/sample.dra +0 -0
  350. package/dist/example/sample.dwg +0 -0
  351. package/dist/example/sample.eml +46 -0
  352. package/dist/example/sample.msg +0 -0
  353. package/dist/example/sample.olb +0 -0
  354. package/dist/example/samples/apache/blocks_and_tables.dwf +0 -0
  355. package/dist/example/samples/autodesk/house.dwfx +0 -0
  356. package/dist/example/samples/autodesk/robot-arm.dwfx +0 -0
  357. package/dist/example/script.bash +36 -0
  358. package/dist/example/script.sh +24 -0
  359. package/dist/example/settings.ini +23 -0
  360. package/dist/example/table.csv +4 -0
  361. package/dist/example/template.dot +0 -0
  362. package/dist/example/test.doc +0 -0
  363. package/dist/example/text.txt +3 -0
  364. package/dist/example/vector.svg +6 -0
  365. package/dist/example/video.mp4 +0 -0
  366. package/dist/example/word.docx +0 -0
  367. package/dist/index.html +302 -0
  368. package/dist/vendor/libarchive/libarchive.wasm +0 -0
  369. package/dist/vendor/libarchive/worker-bundle.js +6 -0
  370. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  371. package/dist/wasm/cad/dwg-worker.js +24 -0
  372. package/dist/wasm/cad/libredwg-web.js +15 -0
  373. package/dist/wasm/cad/libredwg-web.wasm +0 -0
  374. package/package.json +118 -41
  375. package/dist/components/ImageViewer.js +0 -1898
  376. package/dist/components/MarkdownViewer.js +0 -1577
  377. package/dist/components/PdfView.js +0 -21660
  378. package/dist/components/PptxRender.js +0 -21165
  379. package/dist/components/XlsxTable.js +0 -69864
  380. package/dist/components/_commonjs-dynamic-modules.js +0 -6
  381. package/dist/components/_commonjsHelpers.js +0 -36
  382. package/dist/components/docx-preview.min.js +0 -5287
  383. package/dist/components/index.js +0 -1711
  384. package/dist/components/worker-ref.js +0 -21
  385. package/dist/index.mjs +0 -6
  386. package/dist/index.umd.js +0 -436
  387. package/dist/src/package/common/type.d.ts +0 -26
  388. package/dist/src/package/common/util.d.ts +0 -5
  389. package/dist/src/package/common/worker-ref.d.ts +0 -12
  390. package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -25
  391. package/dist/src/package/components/FileViewer/index.d.ts +0 -2
  392. package/dist/src/package/components/FileViewer/util.d.ts +0 -2
  393. package/dist/src/package/index.d.ts +0 -12
  394. package/dist/src/package/vendors/docx/index.d.ts +0 -4
  395. package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -13
  396. package/dist/src/package/vendors/image/index.d.ts +0 -4
  397. package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -13
  398. package/dist/src/package/vendors/md/index.d.ts +0 -4
  399. package/dist/src/package/vendors/mp4/index.d.ts +0 -4
  400. package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -13
  401. package/dist/src/package/vendors/pdf/index.d.ts +0 -1
  402. package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
  403. package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -81
  404. package/dist/src/package/vendors/pptx/index.d.ts +0 -6
  405. package/dist/src/package/vendors/pptx/options.d.ts +0 -39
  406. package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
  407. package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
  408. package/dist/src/package/vendors/renders.d.ts +0 -3
  409. package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -13
  410. package/dist/src/package/vendors/text/index.d.ts +0 -6
  411. package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -13
  412. package/dist/src/package/vendors/xlsx/index.d.ts +0 -5
  413. package/dist/src/package/vendors/xlsx/render.d.ts +0 -6
  414. package/dist/src/package/vendors/xlsx/util.d.ts +0 -8
  415. package/dist/src/package/vendors/xlsx/worker/SheetData.d.ts +0 -51
  416. package/dist/src/package/vendors/xlsx/worker/color.d.ts +0 -2
  417. package/dist/src/package/vendors/xlsx/worker/context.d.ts +0 -6
  418. package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
  419. package/dist/src/package/vendors/xlsx/worker/util.d.ts +0 -10
  420. package/dist/style.css +0 -57
  421. package/dist/worker/pdf.worker.js +0 -66
  422. package/dist/worker/pptx.worker.js +0 -21
  423. package/dist/worker/xlsx.worker.js +0 -65
@@ -1,1577 +0,0 @@
1
- var Y = Object.defineProperty;
2
- var ee = (o, n, t) => n in o ? Y(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
3
- var O = (o, n, t) => (ee(o, typeof n != "symbol" ? n + "" : n, t), t);
4
- import { defineComponent as te, computed as ne, openBlock as ie, createElementBlock as se, unref as re } from "vue";
5
- import { _ as le } from "./index.js";
6
- function F() {
7
- return {
8
- async: !1,
9
- baseUrl: null,
10
- breaks: !1,
11
- extensions: null,
12
- gfm: !0,
13
- headerIds: !0,
14
- headerPrefix: "",
15
- highlight: null,
16
- hooks: null,
17
- langPrefix: "language-",
18
- mangle: !0,
19
- pedantic: !1,
20
- renderer: null,
21
- sanitize: !1,
22
- sanitizer: null,
23
- silent: !1,
24
- smartypants: !1,
25
- tokenizer: null,
26
- walkTokens: null,
27
- xhtml: !1
28
- };
29
- }
30
- let I = F();
31
- function oe(o) {
32
- I = o;
33
- }
34
- const V = /[&<>"']/, ae = new RegExp(V.source, "g"), X = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, ce = new RegExp(X.source, "g"), he = {
35
- "&": "&amp;",
36
- "<": "&lt;",
37
- ">": "&gt;",
38
- '"': "&quot;",
39
- "'": "&#39;"
40
- }, U = (o) => he[o];
41
- function b(o, n) {
42
- if (n) {
43
- if (V.test(o))
44
- return o.replace(ae, U);
45
- } else if (X.test(o))
46
- return o.replace(ce, U);
47
- return o;
48
- }
49
- const ue = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
50
- function W(o) {
51
- return o.replace(ue, (n, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
52
- }
53
- const pe = /(^|[^\[])\^/g;
54
- function m(o, n) {
55
- o = typeof o == "string" ? o : o.source, n = n || "";
56
- const t = {
57
- replace: (e, i) => (i = i.source || i, i = i.replace(pe, "$1"), o = o.replace(e, i), t),
58
- getRegex: () => new RegExp(o, n)
59
- };
60
- return t;
61
- }
62
- const fe = /[^\w:]/g, ge = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
63
- function P(o, n, t) {
64
- if (o) {
65
- let e;
66
- try {
67
- e = decodeURIComponent(W(t)).replace(fe, "").toLowerCase();
68
- } catch {
69
- return null;
70
- }
71
- if (e.indexOf("javascript:") === 0 || e.indexOf("vbscript:") === 0 || e.indexOf("data:") === 0)
72
- return null;
73
- }
74
- n && !ge.test(t) && (t = xe(n, t));
75
- try {
76
- t = encodeURI(t).replace(/%25/g, "%");
77
- } catch {
78
- return null;
79
- }
80
- return t;
81
- }
82
- const L = {}, de = /^[^:]+:\/*[^/]*$/, ke = /^([^:]+:)[\s\S]*$/, me = /^([^:]+:\/*[^/]*)[\s\S]*$/;
83
- function xe(o, n) {
84
- L[" " + o] || (de.test(o) ? L[" " + o] = o + "/" : L[" " + o] = B(o, "/", !0)), o = L[" " + o];
85
- const t = o.indexOf(":") === -1;
86
- return n.substring(0, 2) === "//" ? t ? n : o.replace(ke, "$1") + n : n.charAt(0) === "/" ? t ? n : o.replace(me, "$1") + n : o + n;
87
- }
88
- const Z = { exec: function() {
89
- } };
90
- function Q(o, n) {
91
- const t = o.replace(/\|/g, (s, r, l) => {
92
- let c = !1, d = r;
93
- for (; --d >= 0 && l[d] === "\\"; )
94
- c = !c;
95
- return c ? "|" : " |";
96
- }), e = t.split(/ \|/);
97
- let i = 0;
98
- if (e[0].trim() || e.shift(), e.length > 0 && !e[e.length - 1].trim() && e.pop(), e.length > n)
99
- e.splice(n);
100
- else
101
- for (; e.length < n; )
102
- e.push("");
103
- for (; i < e.length; i++)
104
- e[i] = e[i].trim().replace(/\\\|/g, "|");
105
- return e;
106
- }
107
- function B(o, n, t) {
108
- const e = o.length;
109
- if (e === 0)
110
- return "";
111
- let i = 0;
112
- for (; i < e; ) {
113
- const s = o.charAt(e - i - 1);
114
- if (s === n && !t)
115
- i++;
116
- else if (s !== n && t)
117
- i++;
118
- else
119
- break;
120
- }
121
- return o.slice(0, e - i);
122
- }
123
- function we(o, n) {
124
- if (o.indexOf(n[1]) === -1)
125
- return -1;
126
- const t = o.length;
127
- let e = 0, i = 0;
128
- for (; i < t; i++)
129
- if (o[i] === "\\")
130
- i++;
131
- else if (o[i] === n[0])
132
- e++;
133
- else if (o[i] === n[1] && (e--, e < 0))
134
- return i;
135
- return -1;
136
- }
137
- function be(o) {
138
- o && o.sanitize && !o.silent && console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");
139
- }
140
- function j(o, n) {
141
- if (n < 1)
142
- return "";
143
- let t = "";
144
- for (; n > 1; )
145
- n & 1 && (t += o), n >>= 1, o += o;
146
- return t + o;
147
- }
148
- function N(o, n, t, e) {
149
- const i = n.href, s = n.title ? b(n.title) : null, r = o[1].replace(/\\([\[\]])/g, "$1");
150
- if (o[0].charAt(0) !== "!") {
151
- e.state.inLink = !0;
152
- const l = {
153
- type: "link",
154
- raw: t,
155
- href: i,
156
- title: s,
157
- text: r,
158
- tokens: e.inlineTokens(r)
159
- };
160
- return e.state.inLink = !1, l;
161
- }
162
- return {
163
- type: "image",
164
- raw: t,
165
- href: i,
166
- title: s,
167
- text: b(r)
168
- };
169
- }
170
- function _e(o, n) {
171
- const t = o.match(/^(\s+)(?:```)/);
172
- if (t === null)
173
- return n;
174
- const e = t[1];
175
- return n.split(`
176
- `).map((i) => {
177
- const s = i.match(/^\s+/);
178
- if (s === null)
179
- return i;
180
- const [r] = s;
181
- return r.length >= e.length ? i.slice(e.length) : i;
182
- }).join(`
183
- `);
184
- }
185
- class q {
186
- constructor(n) {
187
- this.options = n || I;
188
- }
189
- space(n) {
190
- const t = this.rules.block.newline.exec(n);
191
- if (t && t[0].length > 0)
192
- return {
193
- type: "space",
194
- raw: t[0]
195
- };
196
- }
197
- code(n) {
198
- const t = this.rules.block.code.exec(n);
199
- if (t) {
200
- const e = t[0].replace(/^ {1,4}/gm, "");
201
- return {
202
- type: "code",
203
- raw: t[0],
204
- codeBlockStyle: "indented",
205
- text: this.options.pedantic ? e : B(e, `
206
- `)
207
- };
208
- }
209
- }
210
- fences(n) {
211
- const t = this.rules.block.fences.exec(n);
212
- if (t) {
213
- const e = t[0], i = _e(e, t[3] || "");
214
- return {
215
- type: "code",
216
- raw: e,
217
- lang: t[2] ? t[2].trim().replace(this.rules.inline._escapes, "$1") : t[2],
218
- text: i
219
- };
220
- }
221
- }
222
- heading(n) {
223
- const t = this.rules.block.heading.exec(n);
224
- if (t) {
225
- let e = t[2].trim();
226
- if (/#$/.test(e)) {
227
- const i = B(e, "#");
228
- (this.options.pedantic || !i || / $/.test(i)) && (e = i.trim());
229
- }
230
- return {
231
- type: "heading",
232
- raw: t[0],
233
- depth: t[1].length,
234
- text: e,
235
- tokens: this.lexer.inline(e)
236
- };
237
- }
238
- }
239
- hr(n) {
240
- const t = this.rules.block.hr.exec(n);
241
- if (t)
242
- return {
243
- type: "hr",
244
- raw: t[0]
245
- };
246
- }
247
- blockquote(n) {
248
- const t = this.rules.block.blockquote.exec(n);
249
- if (t) {
250
- const e = t[0].replace(/^ *>[ \t]?/gm, ""), i = this.lexer.state.top;
251
- this.lexer.state.top = !0;
252
- const s = this.lexer.blockTokens(e);
253
- return this.lexer.state.top = i, {
254
- type: "blockquote",
255
- raw: t[0],
256
- tokens: s,
257
- text: e
258
- };
259
- }
260
- }
261
- list(n) {
262
- let t = this.rules.block.list.exec(n);
263
- if (t) {
264
- let e, i, s, r, l, c, d, f, g, k, h, z, _ = t[1].trim();
265
- const T = _.length > 1, x = {
266
- type: "list",
267
- raw: "",
268
- ordered: T,
269
- start: T ? +_.slice(0, -1) : "",
270
- loose: !1,
271
- items: []
272
- };
273
- _ = T ? `\\d{1,9}\\${_.slice(-1)}` : `\\${_}`, this.options.pedantic && (_ = T ? _ : "[*+-]");
274
- const w = new RegExp(`^( {0,3}${_})((?:[ ][^\\n]*)?(?:\\n|$))`);
275
- for (; n && (z = !1, !(!(t = w.exec(n)) || this.rules.block.hr.test(n))); ) {
276
- if (e = t[0], n = n.substring(e.length), f = t[2].split(`
277
- `, 1)[0].replace(/^\t+/, (S) => " ".repeat(3 * S.length)), g = n.split(`
278
- `, 1)[0], this.options.pedantic ? (r = 2, h = f.trimLeft()) : (r = t[2].search(/[^ ]/), r = r > 4 ? 1 : r, h = f.slice(r), r += t[1].length), c = !1, !f && /^ *$/.test(g) && (e += g + `
279
- `, n = n.substring(g.length + 1), z = !0), !z) {
280
- const S = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), y = new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), $ = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), C = new RegExp(`^ {0,${Math.min(3, r - 1)}}#`);
281
- for (; n && (k = n.split(`
282
- `, 1)[0], g = k, this.options.pedantic && (g = g.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !($.test(g) || C.test(g) || S.test(g) || y.test(n))); ) {
283
- if (g.search(/[^ ]/) >= r || !g.trim())
284
- h += `
285
- ` + g.slice(r);
286
- else {
287
- if (c || f.search(/[^ ]/) >= 4 || $.test(f) || C.test(f) || y.test(f))
288
- break;
289
- h += `
290
- ` + g;
291
- }
292
- !c && !g.trim() && (c = !0), e += k + `
293
- `, n = n.substring(k.length + 1), f = g.slice(r);
294
- }
295
- }
296
- x.loose || (d ? x.loose = !0 : /\n *\n *$/.test(e) && (d = !0)), this.options.gfm && (i = /^\[[ xX]\] /.exec(h), i && (s = i[0] !== "[ ] ", h = h.replace(/^\[[ xX]\] +/, ""))), x.items.push({
297
- type: "list_item",
298
- raw: e,
299
- task: !!i,
300
- checked: s,
301
- loose: !1,
302
- text: h
303
- }), x.raw += e;
304
- }
305
- x.items[x.items.length - 1].raw = e.trimRight(), x.items[x.items.length - 1].text = h.trimRight(), x.raw = x.raw.trimRight();
306
- const E = x.items.length;
307
- for (l = 0; l < E; l++)
308
- if (this.lexer.state.top = !1, x.items[l].tokens = this.lexer.blockTokens(x.items[l].text, []), !x.loose) {
309
- const S = x.items[l].tokens.filter(($) => $.type === "space"), y = S.length > 0 && S.some(($) => /\n.*\n/.test($.raw));
310
- x.loose = y;
311
- }
312
- if (x.loose)
313
- for (l = 0; l < E; l++)
314
- x.items[l].loose = !0;
315
- return x;
316
- }
317
- }
318
- html(n) {
319
- const t = this.rules.block.html.exec(n);
320
- if (t) {
321
- const e = {
322
- type: "html",
323
- raw: t[0],
324
- pre: !this.options.sanitizer && (t[1] === "pre" || t[1] === "script" || t[1] === "style"),
325
- text: t[0]
326
- };
327
- if (this.options.sanitize) {
328
- const i = this.options.sanitizer ? this.options.sanitizer(t[0]) : b(t[0]);
329
- e.type = "paragraph", e.text = i, e.tokens = this.lexer.inline(i);
330
- }
331
- return e;
332
- }
333
- }
334
- def(n) {
335
- const t = this.rules.block.def.exec(n);
336
- if (t) {
337
- const e = t[1].toLowerCase().replace(/\s+/g, " "), i = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline._escapes, "$1") : t[3];
338
- return {
339
- type: "def",
340
- tag: e,
341
- raw: t[0],
342
- href: i,
343
- title: s
344
- };
345
- }
346
- }
347
- table(n) {
348
- const t = this.rules.block.table.exec(n);
349
- if (t) {
350
- const e = {
351
- type: "table",
352
- header: Q(t[1]).map((i) => ({ text: i })),
353
- align: t[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
354
- rows: t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
355
- `) : []
356
- };
357
- if (e.header.length === e.align.length) {
358
- e.raw = t[0];
359
- let i = e.align.length, s, r, l, c;
360
- for (s = 0; s < i; s++)
361
- /^ *-+: *$/.test(e.align[s]) ? e.align[s] = "right" : /^ *:-+: *$/.test(e.align[s]) ? e.align[s] = "center" : /^ *:-+ *$/.test(e.align[s]) ? e.align[s] = "left" : e.align[s] = null;
362
- for (i = e.rows.length, s = 0; s < i; s++)
363
- e.rows[s] = Q(e.rows[s], e.header.length).map((d) => ({ text: d }));
364
- for (i = e.header.length, r = 0; r < i; r++)
365
- e.header[r].tokens = this.lexer.inline(e.header[r].text);
366
- for (i = e.rows.length, r = 0; r < i; r++)
367
- for (c = e.rows[r], l = 0; l < c.length; l++)
368
- c[l].tokens = this.lexer.inline(c[l].text);
369
- return e;
370
- }
371
- }
372
- }
373
- lheading(n) {
374
- const t = this.rules.block.lheading.exec(n);
375
- if (t)
376
- return {
377
- type: "heading",
378
- raw: t[0],
379
- depth: t[2].charAt(0) === "=" ? 1 : 2,
380
- text: t[1],
381
- tokens: this.lexer.inline(t[1])
382
- };
383
- }
384
- paragraph(n) {
385
- const t = this.rules.block.paragraph.exec(n);
386
- if (t) {
387
- const e = t[1].charAt(t[1].length - 1) === `
388
- ` ? t[1].slice(0, -1) : t[1];
389
- return {
390
- type: "paragraph",
391
- raw: t[0],
392
- text: e,
393
- tokens: this.lexer.inline(e)
394
- };
395
- }
396
- }
397
- text(n) {
398
- const t = this.rules.block.text.exec(n);
399
- if (t)
400
- return {
401
- type: "text",
402
- raw: t[0],
403
- text: t[0],
404
- tokens: this.lexer.inline(t[0])
405
- };
406
- }
407
- escape(n) {
408
- const t = this.rules.inline.escape.exec(n);
409
- if (t)
410
- return {
411
- type: "escape",
412
- raw: t[0],
413
- text: b(t[1])
414
- };
415
- }
416
- tag(n) {
417
- const t = this.rules.inline.tag.exec(n);
418
- if (t)
419
- return !this.lexer.state.inLink && /^<a /i.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
420
- type: this.options.sanitize ? "text" : "html",
421
- raw: t[0],
422
- inLink: this.lexer.state.inLink,
423
- inRawBlock: this.lexer.state.inRawBlock,
424
- text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(t[0]) : b(t[0]) : t[0]
425
- };
426
- }
427
- link(n) {
428
- const t = this.rules.inline.link.exec(n);
429
- if (t) {
430
- const e = t[2].trim();
431
- if (!this.options.pedantic && /^</.test(e)) {
432
- if (!/>$/.test(e))
433
- return;
434
- const r = B(e.slice(0, -1), "\\");
435
- if ((e.length - r.length) % 2 === 0)
436
- return;
437
- } else {
438
- const r = we(t[2], "()");
439
- if (r > -1) {
440
- const c = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + r;
441
- t[2] = t[2].substring(0, r), t[0] = t[0].substring(0, c).trim(), t[3] = "";
442
- }
443
- }
444
- let i = t[2], s = "";
445
- if (this.options.pedantic) {
446
- const r = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);
447
- r && (i = r[1], s = r[3]);
448
- } else
449
- s = t[3] ? t[3].slice(1, -1) : "";
450
- return i = i.trim(), /^</.test(i) && (this.options.pedantic && !/>$/.test(e) ? i = i.slice(1) : i = i.slice(1, -1)), N(t, {
451
- href: i && i.replace(this.rules.inline._escapes, "$1"),
452
- title: s && s.replace(this.rules.inline._escapes, "$1")
453
- }, t[0], this.lexer);
454
- }
455
- }
456
- reflink(n, t) {
457
- let e;
458
- if ((e = this.rules.inline.reflink.exec(n)) || (e = this.rules.inline.nolink.exec(n))) {
459
- let i = (e[2] || e[1]).replace(/\s+/g, " ");
460
- if (i = t[i.toLowerCase()], !i) {
461
- const s = e[0].charAt(0);
462
- return {
463
- type: "text",
464
- raw: s,
465
- text: s
466
- };
467
- }
468
- return N(e, i, e[0], this.lexer);
469
- }
470
- }
471
- emStrong(n, t, e = "") {
472
- let i = this.rules.inline.emStrong.lDelim.exec(n);
473
- if (!i || i[3] && e.match(/[\p{L}\p{N}]/u))
474
- return;
475
- const s = i[1] || i[2] || "";
476
- if (!s || s && (e === "" || this.rules.inline.punctuation.exec(e))) {
477
- const r = i[0].length - 1;
478
- let l, c, d = r, f = 0;
479
- const g = i[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
480
- for (g.lastIndex = 0, t = t.slice(-1 * n.length + r); (i = g.exec(t)) != null; ) {
481
- if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l)
482
- continue;
483
- if (c = l.length, i[3] || i[4]) {
484
- d += c;
485
- continue;
486
- } else if ((i[5] || i[6]) && r % 3 && !((r + c) % 3)) {
487
- f += c;
488
- continue;
489
- }
490
- if (d -= c, d > 0)
491
- continue;
492
- c = Math.min(c, c + d + f);
493
- const k = n.slice(0, r + i.index + (i[0].length - l.length) + c);
494
- if (Math.min(r, c) % 2) {
495
- const z = k.slice(1, -1);
496
- return {
497
- type: "em",
498
- raw: k,
499
- text: z,
500
- tokens: this.lexer.inlineTokens(z)
501
- };
502
- }
503
- const h = k.slice(2, -2);
504
- return {
505
- type: "strong",
506
- raw: k,
507
- text: h,
508
- tokens: this.lexer.inlineTokens(h)
509
- };
510
- }
511
- }
512
- }
513
- codespan(n) {
514
- const t = this.rules.inline.code.exec(n);
515
- if (t) {
516
- let e = t[2].replace(/\n/g, " ");
517
- const i = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e);
518
- return i && s && (e = e.substring(1, e.length - 1)), e = b(e, !0), {
519
- type: "codespan",
520
- raw: t[0],
521
- text: e
522
- };
523
- }
524
- }
525
- br(n) {
526
- const t = this.rules.inline.br.exec(n);
527
- if (t)
528
- return {
529
- type: "br",
530
- raw: t[0]
531
- };
532
- }
533
- del(n) {
534
- const t = this.rules.inline.del.exec(n);
535
- if (t)
536
- return {
537
- type: "del",
538
- raw: t[0],
539
- text: t[2],
540
- tokens: this.lexer.inlineTokens(t[2])
541
- };
542
- }
543
- autolink(n, t) {
544
- const e = this.rules.inline.autolink.exec(n);
545
- if (e) {
546
- let i, s;
547
- return e[2] === "@" ? (i = b(this.options.mangle ? t(e[1]) : e[1]), s = "mailto:" + i) : (i = b(e[1]), s = i), {
548
- type: "link",
549
- raw: e[0],
550
- text: i,
551
- href: s,
552
- tokens: [
553
- {
554
- type: "text",
555
- raw: i,
556
- text: i
557
- }
558
- ]
559
- };
560
- }
561
- }
562
- url(n, t) {
563
- let e;
564
- if (e = this.rules.inline.url.exec(n)) {
565
- let i, s;
566
- if (e[2] === "@")
567
- i = b(this.options.mangle ? t(e[0]) : e[0]), s = "mailto:" + i;
568
- else {
569
- let r;
570
- do
571
- r = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])[0];
572
- while (r !== e[0]);
573
- i = b(e[0]), e[1] === "www." ? s = "http://" + e[0] : s = e[0];
574
- }
575
- return {
576
- type: "link",
577
- raw: e[0],
578
- text: i,
579
- href: s,
580
- tokens: [
581
- {
582
- type: "text",
583
- raw: i,
584
- text: i
585
- }
586
- ]
587
- };
588
- }
589
- }
590
- inlineText(n, t) {
591
- const e = this.rules.inline.text.exec(n);
592
- if (e) {
593
- let i;
594
- return this.lexer.state.inRawBlock ? i = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(e[0]) : b(e[0]) : e[0] : i = b(this.options.smartypants ? t(e[0]) : e[0]), {
595
- type: "text",
596
- raw: e[0],
597
- text: i
598
- };
599
- }
600
- }
601
- }
602
- const u = {
603
- newline: /^(?: *(?:\n|$))+/,
604
- code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
605
- fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
606
- hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
607
- heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
608
- blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
609
- list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
610
- html: "^ {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|$))",
611
- def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
612
- table: Z,
613
- lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
614
- // regex template, placeholders will be replaced according to different paragraph
615
- // interruption rules of commonmark and the original markdown spec:
616
- _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
617
- text: /^[^\n]+/
618
- };
619
- u._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
620
- u._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
621
- u.def = m(u.def).replace("label", u._label).replace("title", u._title).getRegex();
622
- u.bullet = /(?:[*+-]|\d{1,9}[.)])/;
623
- u.listItemStart = m(/^( *)(bull) */).replace("bull", u.bullet).getRegex();
624
- u.list = m(u.list).replace(/bull/g, u.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + u.def.source + ")").getRegex();
625
- u._tag = "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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
626
- u._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
627
- u.html = m(u.html, "i").replace("comment", u._comment).replace("tag", u._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
628
- u.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").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", u._tag).getRegex();
629
- u.blockquote = m(u.blockquote).replace("paragraph", u.paragraph).getRegex();
630
- u.normal = { ...u };
631
- u.gfm = {
632
- ...u.normal,
633
- table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
634
- // Cells
635
- };
636
- u.gfm.table = m(u.gfm.table).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\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", u._tag).getRegex();
637
- u.gfm.paragraph = m(u._paragraph).replace("hr", u.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", u.gfm.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", u._tag).getRegex();
638
- u.pedantic = {
639
- ...u.normal,
640
- html: m(
641
- `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
642
- ).replace("comment", u._comment).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(),
643
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
644
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
645
- fences: Z,
646
- // fences not supported
647
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
648
- paragraph: m(u.normal._paragraph).replace("hr", u.hr).replace("heading", ` *#{1,6} *[^
649
- ]`).replace("lheading", u.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
650
- };
651
- const a = {
652
- escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
653
- autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
654
- url: Z,
655
- tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
656
- // CDATA section
657
- link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
658
- reflink: /^!?\[(label)\]\[(ref)\]/,
659
- nolink: /^!?\[(ref)\](?:\[\])?/,
660
- reflinkSearch: "reflink|nolink(?!\\()",
661
- emStrong: {
662
- lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
663
- // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
664
- // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
665
- rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,
666
- rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/
667
- // ^- Not allowed for _
668
- },
669
- code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
670
- br: /^( {2,}|\\)\n(?!\s*$)/,
671
- del: Z,
672
- text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
673
- punctuation: /^([\spunctuation])/
674
- };
675
- a._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
676
- a.punctuation = m(a.punctuation).replace(/punctuation/g, a._punctuation).getRegex();
677
- a.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
678
- a.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
679
- a._comment = m(u._comment).replace("(?:-->|$)", "-->").getRegex();
680
- a.emStrong.lDelim = m(a.emStrong.lDelim).replace(/punct/g, a._punctuation).getRegex();
681
- a.emStrong.rDelimAst = m(a.emStrong.rDelimAst, "g").replace(/punct/g, a._punctuation).getRegex();
682
- a.emStrong.rDelimUnd = m(a.emStrong.rDelimUnd, "g").replace(/punct/g, a._punctuation).getRegex();
683
- a._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
684
- a._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
685
- a._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])?)+(?![-_])/;
686
- a.autolink = m(a.autolink).replace("scheme", a._scheme).replace("email", a._email).getRegex();
687
- a._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
688
- a.tag = m(a.tag).replace("comment", a._comment).replace("attribute", a._attribute).getRegex();
689
- a._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
690
- a._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
691
- a._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
692
- a.link = m(a.link).replace("label", a._label).replace("href", a._href).replace("title", a._title).getRegex();
693
- a.reflink = m(a.reflink).replace("label", a._label).replace("ref", u._label).getRegex();
694
- a.nolink = m(a.nolink).replace("ref", u._label).getRegex();
695
- a.reflinkSearch = m(a.reflinkSearch, "g").replace("reflink", a.reflink).replace("nolink", a.nolink).getRegex();
696
- a.normal = { ...a };
697
- a.pedantic = {
698
- ...a.normal,
699
- strong: {
700
- start: /^__|\*\*/,
701
- middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
702
- endAst: /\*\*(?!\*)/g,
703
- endUnd: /__(?!_)/g
704
- },
705
- em: {
706
- start: /^_|\*/,
707
- middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
708
- endAst: /\*(?!\*)/g,
709
- endUnd: /_(?!_)/g
710
- },
711
- link: m(/^!?\[(label)\]\((.*?)\)/).replace("label", a._label).getRegex(),
712
- reflink: m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", a._label).getRegex()
713
- };
714
- a.gfm = {
715
- ...a.normal,
716
- escape: m(a.escape).replace("])", "~|])").getRegex(),
717
- _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
718
- url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
719
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
720
- del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
721
- text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
722
- };
723
- a.gfm.url = m(a.gfm.url, "i").replace("email", a.gfm._extended_email).getRegex();
724
- a.breaks = {
725
- ...a.gfm,
726
- br: m(a.br).replace("{2,}", "*").getRegex(),
727
- text: m(a.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
728
- };
729
- function ye(o) {
730
- return o.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
731
- }
732
- function H(o) {
733
- let n = "", t, e;
734
- const i = o.length;
735
- for (t = 0; t < i; t++)
736
- e = o.charCodeAt(t), Math.random() > 0.5 && (e = "x" + e.toString(16)), n += "&#" + e + ";";
737
- return n;
738
- }
739
- class R {
740
- constructor(n) {
741
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = n || I, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
742
- inLink: !1,
743
- inRawBlock: !1,
744
- top: !0
745
- };
746
- const t = {
747
- block: u.normal,
748
- inline: a.normal
749
- };
750
- this.options.pedantic ? (t.block = u.pedantic, t.inline = a.pedantic) : this.options.gfm && (t.block = u.gfm, this.options.breaks ? t.inline = a.breaks : t.inline = a.gfm), this.tokenizer.rules = t;
751
- }
752
- /**
753
- * Expose Rules
754
- */
755
- static get rules() {
756
- return {
757
- block: u,
758
- inline: a
759
- };
760
- }
761
- /**
762
- * Static Lex Method
763
- */
764
- static lex(n, t) {
765
- return new R(t).lex(n);
766
- }
767
- /**
768
- * Static Lex Inline Method
769
- */
770
- static lexInline(n, t) {
771
- return new R(t).inlineTokens(n);
772
- }
773
- /**
774
- * Preprocessing
775
- */
776
- lex(n) {
777
- n = n.replace(/\r\n|\r/g, `
778
- `), this.blockTokens(n, this.tokens);
779
- let t;
780
- for (; t = this.inlineQueue.shift(); )
781
- this.inlineTokens(t.src, t.tokens);
782
- return this.tokens;
783
- }
784
- /**
785
- * Lexing
786
- */
787
- blockTokens(n, t = []) {
788
- this.options.pedantic ? n = n.replace(/\t/g, " ").replace(/^ +$/gm, "") : n = n.replace(/^( *)(\t+)/gm, (l, c, d) => c + " ".repeat(d.length));
789
- let e, i, s, r;
790
- for (; n; )
791
- if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (e = l.call({ lexer: this }, n, t)) ? (n = n.substring(e.raw.length), t.push(e), !0) : !1))) {
792
- if (e = this.tokenizer.space(n)) {
793
- n = n.substring(e.raw.length), e.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
794
- ` : t.push(e);
795
- continue;
796
- }
797
- if (e = this.tokenizer.code(n)) {
798
- n = n.substring(e.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
799
- ` + e.raw, i.text += `
800
- ` + e.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e);
801
- continue;
802
- }
803
- if (e = this.tokenizer.fences(n)) {
804
- n = n.substring(e.raw.length), t.push(e);
805
- continue;
806
- }
807
- if (e = this.tokenizer.heading(n)) {
808
- n = n.substring(e.raw.length), t.push(e);
809
- continue;
810
- }
811
- if (e = this.tokenizer.hr(n)) {
812
- n = n.substring(e.raw.length), t.push(e);
813
- continue;
814
- }
815
- if (e = this.tokenizer.blockquote(n)) {
816
- n = n.substring(e.raw.length), t.push(e);
817
- continue;
818
- }
819
- if (e = this.tokenizer.list(n)) {
820
- n = n.substring(e.raw.length), t.push(e);
821
- continue;
822
- }
823
- if (e = this.tokenizer.html(n)) {
824
- n = n.substring(e.raw.length), t.push(e);
825
- continue;
826
- }
827
- if (e = this.tokenizer.def(n)) {
828
- n = n.substring(e.raw.length), i = t[t.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
829
- ` + e.raw, i.text += `
830
- ` + e.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[e.tag] || (this.tokens.links[e.tag] = {
831
- href: e.href,
832
- title: e.title
833
- });
834
- continue;
835
- }
836
- if (e = this.tokenizer.table(n)) {
837
- n = n.substring(e.raw.length), t.push(e);
838
- continue;
839
- }
840
- if (e = this.tokenizer.lheading(n)) {
841
- n = n.substring(e.raw.length), t.push(e);
842
- continue;
843
- }
844
- if (s = n, this.options.extensions && this.options.extensions.startBlock) {
845
- let l = 1 / 0;
846
- const c = n.slice(1);
847
- let d;
848
- this.options.extensions.startBlock.forEach(function(f) {
849
- d = f.call({ lexer: this }, c), typeof d == "number" && d >= 0 && (l = Math.min(l, d));
850
- }), l < 1 / 0 && l >= 0 && (s = n.substring(0, l + 1));
851
- }
852
- if (this.state.top && (e = this.tokenizer.paragraph(s))) {
853
- i = t[t.length - 1], r && i.type === "paragraph" ? (i.raw += `
854
- ` + e.raw, i.text += `
855
- ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e), r = s.length !== n.length, n = n.substring(e.raw.length);
856
- continue;
857
- }
858
- if (e = this.tokenizer.text(n)) {
859
- n = n.substring(e.raw.length), i = t[t.length - 1], i && i.type === "text" ? (i.raw += `
860
- ` + e.raw, i.text += `
861
- ` + e.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : t.push(e);
862
- continue;
863
- }
864
- if (n) {
865
- const l = "Infinite loop on byte: " + n.charCodeAt(0);
866
- if (this.options.silent) {
867
- console.error(l);
868
- break;
869
- } else
870
- throw new Error(l);
871
- }
872
- }
873
- return this.state.top = !0, t;
874
- }
875
- inline(n, t = []) {
876
- return this.inlineQueue.push({ src: n, tokens: t }), t;
877
- }
878
- /**
879
- * Lexing/Compiling
880
- */
881
- inlineTokens(n, t = []) {
882
- let e, i, s, r = n, l, c, d;
883
- if (this.tokens.links) {
884
- const f = Object.keys(this.tokens.links);
885
- if (f.length > 0)
886
- for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
887
- f.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, l.index) + "[" + j("a", l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
888
- }
889
- for (; (l = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
890
- r = r.slice(0, l.index) + "[" + j("a", l[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
891
- for (; (l = this.tokenizer.rules.inline.escapedEmSt.exec(r)) != null; )
892
- r = r.slice(0, l.index + l[0].length - 2) + "++" + r.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex), this.tokenizer.rules.inline.escapedEmSt.lastIndex--;
893
- for (; n; )
894
- if (c || (d = ""), c = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (e = f.call({ lexer: this }, n, t)) ? (n = n.substring(e.raw.length), t.push(e), !0) : !1))) {
895
- if (e = this.tokenizer.escape(n)) {
896
- n = n.substring(e.raw.length), t.push(e);
897
- continue;
898
- }
899
- if (e = this.tokenizer.tag(n)) {
900
- n = n.substring(e.raw.length), i = t[t.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
901
- continue;
902
- }
903
- if (e = this.tokenizer.link(n)) {
904
- n = n.substring(e.raw.length), t.push(e);
905
- continue;
906
- }
907
- if (e = this.tokenizer.reflink(n, this.tokens.links)) {
908
- n = n.substring(e.raw.length), i = t[t.length - 1], i && e.type === "text" && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
909
- continue;
910
- }
911
- if (e = this.tokenizer.emStrong(n, r, d)) {
912
- n = n.substring(e.raw.length), t.push(e);
913
- continue;
914
- }
915
- if (e = this.tokenizer.codespan(n)) {
916
- n = n.substring(e.raw.length), t.push(e);
917
- continue;
918
- }
919
- if (e = this.tokenizer.br(n)) {
920
- n = n.substring(e.raw.length), t.push(e);
921
- continue;
922
- }
923
- if (e = this.tokenizer.del(n)) {
924
- n = n.substring(e.raw.length), t.push(e);
925
- continue;
926
- }
927
- if (e = this.tokenizer.autolink(n, H)) {
928
- n = n.substring(e.raw.length), t.push(e);
929
- continue;
930
- }
931
- if (!this.state.inLink && (e = this.tokenizer.url(n, H))) {
932
- n = n.substring(e.raw.length), t.push(e);
933
- continue;
934
- }
935
- if (s = n, this.options.extensions && this.options.extensions.startInline) {
936
- let f = 1 / 0;
937
- const g = n.slice(1);
938
- let k;
939
- this.options.extensions.startInline.forEach(function(h) {
940
- k = h.call({ lexer: this }, g), typeof k == "number" && k >= 0 && (f = Math.min(f, k));
941
- }), f < 1 / 0 && f >= 0 && (s = n.substring(0, f + 1));
942
- }
943
- if (e = this.tokenizer.inlineText(s, ye)) {
944
- n = n.substring(e.raw.length), e.raw.slice(-1) !== "_" && (d = e.raw.slice(-1)), c = !0, i = t[t.length - 1], i && i.type === "text" ? (i.raw += e.raw, i.text += e.text) : t.push(e);
945
- continue;
946
- }
947
- if (n) {
948
- const f = "Infinite loop on byte: " + n.charCodeAt(0);
949
- if (this.options.silent) {
950
- console.error(f);
951
- break;
952
- } else
953
- throw new Error(f);
954
- }
955
- }
956
- return t;
957
- }
958
- }
959
- class D {
960
- constructor(n) {
961
- this.options = n || I;
962
- }
963
- code(n, t, e) {
964
- const i = (t || "").match(/\S*/)[0];
965
- if (this.options.highlight) {
966
- const s = this.options.highlight(n, i);
967
- s != null && s !== n && (e = !0, n = s);
968
- }
969
- return n = n.replace(/\n$/, "") + `
970
- `, i ? '<pre><code class="' + this.options.langPrefix + b(i) + '">' + (e ? n : b(n, !0)) + `</code></pre>
971
- ` : "<pre><code>" + (e ? n : b(n, !0)) + `</code></pre>
972
- `;
973
- }
974
- /**
975
- * @param {string} quote
976
- */
977
- blockquote(n) {
978
- return `<blockquote>
979
- ${n}</blockquote>
980
- `;
981
- }
982
- html(n) {
983
- return n;
984
- }
985
- /**
986
- * @param {string} text
987
- * @param {string} level
988
- * @param {string} raw
989
- * @param {any} slugger
990
- */
991
- heading(n, t, e, i) {
992
- if (this.options.headerIds) {
993
- const s = this.options.headerPrefix + i.slug(e);
994
- return `<h${t} id="${s}">${n}</h${t}>
995
- `;
996
- }
997
- return `<h${t}>${n}</h${t}>
998
- `;
999
- }
1000
- hr() {
1001
- return this.options.xhtml ? `<hr/>
1002
- ` : `<hr>
1003
- `;
1004
- }
1005
- list(n, t, e) {
1006
- const i = t ? "ol" : "ul", s = t && e !== 1 ? ' start="' + e + '"' : "";
1007
- return "<" + i + s + `>
1008
- ` + n + "</" + i + `>
1009
- `;
1010
- }
1011
- /**
1012
- * @param {string} text
1013
- */
1014
- listitem(n) {
1015
- return `<li>${n}</li>
1016
- `;
1017
- }
1018
- checkbox(n) {
1019
- return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
1020
- }
1021
- /**
1022
- * @param {string} text
1023
- */
1024
- paragraph(n) {
1025
- return `<p>${n}</p>
1026
- `;
1027
- }
1028
- /**
1029
- * @param {string} header
1030
- * @param {string} body
1031
- */
1032
- table(n, t) {
1033
- return t && (t = `<tbody>${t}</tbody>`), `<table>
1034
- <thead>
1035
- ` + n + `</thead>
1036
- ` + t + `</table>
1037
- `;
1038
- }
1039
- /**
1040
- * @param {string} content
1041
- */
1042
- tablerow(n) {
1043
- return `<tr>
1044
- ${n}</tr>
1045
- `;
1046
- }
1047
- tablecell(n, t) {
1048
- const e = t.header ? "th" : "td";
1049
- return (t.align ? `<${e} align="${t.align}">` : `<${e}>`) + n + `</${e}>
1050
- `;
1051
- }
1052
- /**
1053
- * span level renderer
1054
- * @param {string} text
1055
- */
1056
- strong(n) {
1057
- return `<strong>${n}</strong>`;
1058
- }
1059
- /**
1060
- * @param {string} text
1061
- */
1062
- em(n) {
1063
- return `<em>${n}</em>`;
1064
- }
1065
- /**
1066
- * @param {string} text
1067
- */
1068
- codespan(n) {
1069
- return `<code>${n}</code>`;
1070
- }
1071
- br() {
1072
- return this.options.xhtml ? "<br/>" : "<br>";
1073
- }
1074
- /**
1075
- * @param {string} text
1076
- */
1077
- del(n) {
1078
- return `<del>${n}</del>`;
1079
- }
1080
- /**
1081
- * @param {string} href
1082
- * @param {string} title
1083
- * @param {string} text
1084
- */
1085
- link(n, t, e) {
1086
- if (n = P(this.options.sanitize, this.options.baseUrl, n), n === null)
1087
- return e;
1088
- let i = '<a href="' + n + '"';
1089
- return t && (i += ' title="' + t + '"'), i += ">" + e + "</a>", i;
1090
- }
1091
- /**
1092
- * @param {string} href
1093
- * @param {string} title
1094
- * @param {string} text
1095
- */
1096
- image(n, t, e) {
1097
- if (n = P(this.options.sanitize, this.options.baseUrl, n), n === null)
1098
- return e;
1099
- let i = `<img src="${n}" alt="${e}"`;
1100
- return t && (i += ` title="${t}"`), i += this.options.xhtml ? "/>" : ">", i;
1101
- }
1102
- text(n) {
1103
- return n;
1104
- }
1105
- }
1106
- class G {
1107
- // no need for block level renderers
1108
- strong(n) {
1109
- return n;
1110
- }
1111
- em(n) {
1112
- return n;
1113
- }
1114
- codespan(n) {
1115
- return n;
1116
- }
1117
- del(n) {
1118
- return n;
1119
- }
1120
- html(n) {
1121
- return n;
1122
- }
1123
- text(n) {
1124
- return n;
1125
- }
1126
- link(n, t, e) {
1127
- return "" + e;
1128
- }
1129
- image(n, t, e) {
1130
- return "" + e;
1131
- }
1132
- br() {
1133
- return "";
1134
- }
1135
- }
1136
- class J {
1137
- constructor() {
1138
- this.seen = {};
1139
- }
1140
- /**
1141
- * @param {string} value
1142
- */
1143
- serialize(n) {
1144
- return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
1145
- }
1146
- /**
1147
- * Finds the next safe (unique) slug to use
1148
- * @param {string} originalSlug
1149
- * @param {boolean} isDryRun
1150
- */
1151
- getNextSafeSlug(n, t) {
1152
- let e = n, i = 0;
1153
- if (this.seen.hasOwnProperty(e)) {
1154
- i = this.seen[n];
1155
- do
1156
- i++, e = n + "-" + i;
1157
- while (this.seen.hasOwnProperty(e));
1158
- }
1159
- return t || (this.seen[n] = i, this.seen[e] = 0), e;
1160
- }
1161
- /**
1162
- * Convert string to unique id
1163
- * @param {object} [options]
1164
- * @param {boolean} [options.dryrun] Generates the next unique slug without
1165
- * updating the internal accumulator.
1166
- */
1167
- slug(n, t = {}) {
1168
- const e = this.serialize(n);
1169
- return this.getNextSafeSlug(e, t.dryrun);
1170
- }
1171
- }
1172
- class A {
1173
- constructor(n) {
1174
- this.options = n || I, this.options.renderer = this.options.renderer || new D(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new G(), this.slugger = new J();
1175
- }
1176
- /**
1177
- * Static Parse Method
1178
- */
1179
- static parse(n, t) {
1180
- return new A(t).parse(n);
1181
- }
1182
- /**
1183
- * Static Parse Inline Method
1184
- */
1185
- static parseInline(n, t) {
1186
- return new A(t).parseInline(n);
1187
- }
1188
- /**
1189
- * Parse Loop
1190
- */
1191
- parse(n, t = !0) {
1192
- let e = "", i, s, r, l, c, d, f, g, k, h, z, _, T, x, w, E, S, y, $;
1193
- const C = n.length;
1194
- for (i = 0; i < C; i++) {
1195
- if (h = n[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[h.type] && ($ = this.options.extensions.renderers[h.type].call({ parser: this }, h), $ !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(h.type))) {
1196
- e += $ || "";
1197
- continue;
1198
- }
1199
- switch (h.type) {
1200
- case "space":
1201
- continue;
1202
- case "hr": {
1203
- e += this.renderer.hr();
1204
- continue;
1205
- }
1206
- case "heading": {
1207
- e += this.renderer.heading(
1208
- this.parseInline(h.tokens),
1209
- h.depth,
1210
- W(this.parseInline(h.tokens, this.textRenderer)),
1211
- this.slugger
1212
- );
1213
- continue;
1214
- }
1215
- case "code": {
1216
- e += this.renderer.code(
1217
- h.text,
1218
- h.lang,
1219
- h.escaped
1220
- );
1221
- continue;
1222
- }
1223
- case "table": {
1224
- for (g = "", f = "", l = h.header.length, s = 0; s < l; s++)
1225
- f += this.renderer.tablecell(
1226
- this.parseInline(h.header[s].tokens),
1227
- { header: !0, align: h.align[s] }
1228
- );
1229
- for (g += this.renderer.tablerow(f), k = "", l = h.rows.length, s = 0; s < l; s++) {
1230
- for (d = h.rows[s], f = "", c = d.length, r = 0; r < c; r++)
1231
- f += this.renderer.tablecell(
1232
- this.parseInline(d[r].tokens),
1233
- { header: !1, align: h.align[r] }
1234
- );
1235
- k += this.renderer.tablerow(f);
1236
- }
1237
- e += this.renderer.table(g, k);
1238
- continue;
1239
- }
1240
- case "blockquote": {
1241
- k = this.parse(h.tokens), e += this.renderer.blockquote(k);
1242
- continue;
1243
- }
1244
- case "list": {
1245
- for (z = h.ordered, _ = h.start, T = h.loose, l = h.items.length, k = "", s = 0; s < l; s++)
1246
- w = h.items[s], E = w.checked, S = w.task, x = "", w.task && (y = this.renderer.checkbox(E), T ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = y + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = y + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
1247
- type: "text",
1248
- text: y
1249
- }) : x += y), x += this.parse(w.tokens, T), k += this.renderer.listitem(x, S, E);
1250
- e += this.renderer.list(k, z, _);
1251
- continue;
1252
- }
1253
- case "html": {
1254
- e += this.renderer.html(h.text);
1255
- continue;
1256
- }
1257
- case "paragraph": {
1258
- e += this.renderer.paragraph(this.parseInline(h.tokens));
1259
- continue;
1260
- }
1261
- case "text": {
1262
- for (k = h.tokens ? this.parseInline(h.tokens) : h.text; i + 1 < C && n[i + 1].type === "text"; )
1263
- h = n[++i], k += `
1264
- ` + (h.tokens ? this.parseInline(h.tokens) : h.text);
1265
- e += t ? this.renderer.paragraph(k) : k;
1266
- continue;
1267
- }
1268
- default: {
1269
- const M = 'Token with "' + h.type + '" type was not found.';
1270
- if (this.options.silent) {
1271
- console.error(M);
1272
- return;
1273
- } else
1274
- throw new Error(M);
1275
- }
1276
- }
1277
- }
1278
- return e;
1279
- }
1280
- /**
1281
- * Parse Inline Tokens
1282
- */
1283
- parseInline(n, t) {
1284
- t = t || this.renderer;
1285
- let e = "", i, s, r;
1286
- const l = n.length;
1287
- for (i = 0; i < l; i++) {
1288
- if (s = n[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type] && (r = this.options.extensions.renderers[s.type].call({ parser: this }, s), r !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type))) {
1289
- e += r || "";
1290
- continue;
1291
- }
1292
- switch (s.type) {
1293
- case "escape": {
1294
- e += t.text(s.text);
1295
- break;
1296
- }
1297
- case "html": {
1298
- e += t.html(s.text);
1299
- break;
1300
- }
1301
- case "link": {
1302
- e += t.link(s.href, s.title, this.parseInline(s.tokens, t));
1303
- break;
1304
- }
1305
- case "image": {
1306
- e += t.image(s.href, s.title, s.text);
1307
- break;
1308
- }
1309
- case "strong": {
1310
- e += t.strong(this.parseInline(s.tokens, t));
1311
- break;
1312
- }
1313
- case "em": {
1314
- e += t.em(this.parseInline(s.tokens, t));
1315
- break;
1316
- }
1317
- case "codespan": {
1318
- e += t.codespan(s.text);
1319
- break;
1320
- }
1321
- case "br": {
1322
- e += t.br();
1323
- break;
1324
- }
1325
- case "del": {
1326
- e += t.del(this.parseInline(s.tokens, t));
1327
- break;
1328
- }
1329
- case "text": {
1330
- e += t.text(s.text);
1331
- break;
1332
- }
1333
- default: {
1334
- const c = 'Token with "' + s.type + '" type was not found.';
1335
- if (this.options.silent) {
1336
- console.error(c);
1337
- return;
1338
- } else
1339
- throw new Error(c);
1340
- }
1341
- }
1342
- }
1343
- return e;
1344
- }
1345
- }
1346
- class v {
1347
- constructor(n) {
1348
- this.options = n || I;
1349
- }
1350
- /**
1351
- * Process markdown before marked
1352
- */
1353
- preprocess(n) {
1354
- return n;
1355
- }
1356
- /**
1357
- * Process HTML after marked is finished
1358
- */
1359
- postprocess(n) {
1360
- return n;
1361
- }
1362
- }
1363
- O(v, "passThroughHooks", /* @__PURE__ */ new Set([
1364
- "preprocess",
1365
- "postprocess"
1366
- ]));
1367
- function $e(o, n, t) {
1368
- return (e) => {
1369
- if (e.message += `
1370
- Please report this to https://github.com/markedjs/marked.`, o) {
1371
- const i = "<p>An error occurred:</p><pre>" + b(e.message + "", !0) + "</pre>";
1372
- if (n)
1373
- return Promise.resolve(i);
1374
- if (t) {
1375
- t(null, i);
1376
- return;
1377
- }
1378
- return i;
1379
- }
1380
- if (n)
1381
- return Promise.reject(e);
1382
- if (t) {
1383
- t(e);
1384
- return;
1385
- }
1386
- throw e;
1387
- };
1388
- }
1389
- function K(o, n) {
1390
- return (t, e, i) => {
1391
- typeof e == "function" && (i = e, e = null);
1392
- const s = { ...e };
1393
- e = { ...p.defaults, ...s };
1394
- const r = $e(e.silent, e.async, i);
1395
- if (typeof t > "u" || t === null)
1396
- return r(new Error("marked(): input parameter is undefined or null"));
1397
- if (typeof t != "string")
1398
- return r(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1399
- if (be(e), e.hooks && (e.hooks.options = e), i) {
1400
- const l = e.highlight;
1401
- let c;
1402
- try {
1403
- e.hooks && (t = e.hooks.preprocess(t)), c = o(t, e);
1404
- } catch (g) {
1405
- return r(g);
1406
- }
1407
- const d = function(g) {
1408
- let k;
1409
- if (!g)
1410
- try {
1411
- e.walkTokens && p.walkTokens(c, e.walkTokens), k = n(c, e), e.hooks && (k = e.hooks.postprocess(k));
1412
- } catch (h) {
1413
- g = h;
1414
- }
1415
- return e.highlight = l, g ? r(g) : i(null, k);
1416
- };
1417
- if (!l || l.length < 3 || (delete e.highlight, !c.length))
1418
- return d();
1419
- let f = 0;
1420
- p.walkTokens(c, function(g) {
1421
- g.type === "code" && (f++, setTimeout(() => {
1422
- l(g.text, g.lang, function(k, h) {
1423
- if (k)
1424
- return d(k);
1425
- h != null && h !== g.text && (g.text = h, g.escaped = !0), f--, f === 0 && d();
1426
- });
1427
- }, 0));
1428
- }), f === 0 && d();
1429
- return;
1430
- }
1431
- if (e.async)
1432
- return Promise.resolve(e.hooks ? e.hooks.preprocess(t) : t).then((l) => o(l, e)).then((l) => e.walkTokens ? Promise.all(p.walkTokens(l, e.walkTokens)).then(() => l) : l).then((l) => n(l, e)).then((l) => e.hooks ? e.hooks.postprocess(l) : l).catch(r);
1433
- try {
1434
- e.hooks && (t = e.hooks.preprocess(t));
1435
- const l = o(t, e);
1436
- e.walkTokens && p.walkTokens(l, e.walkTokens);
1437
- let c = n(l, e);
1438
- return e.hooks && (c = e.hooks.postprocess(c)), c;
1439
- } catch (l) {
1440
- return r(l);
1441
- }
1442
- };
1443
- }
1444
- function p(o, n, t) {
1445
- return K(R.lex, A.parse)(o, n, t);
1446
- }
1447
- p.options = p.setOptions = function(o) {
1448
- return p.defaults = { ...p.defaults, ...o }, oe(p.defaults), p;
1449
- };
1450
- p.getDefaults = F;
1451
- p.defaults = I;
1452
- p.use = function(...o) {
1453
- const n = p.defaults.extensions || { renderers: {}, childTokens: {} };
1454
- o.forEach((t) => {
1455
- const e = { ...t };
1456
- if (e.async = p.defaults.async || e.async || !1, t.extensions && (t.extensions.forEach((i) => {
1457
- if (!i.name)
1458
- throw new Error("extension name required");
1459
- if (i.renderer) {
1460
- const s = n.renderers[i.name];
1461
- s ? n.renderers[i.name] = function(...r) {
1462
- let l = i.renderer.apply(this, r);
1463
- return l === !1 && (l = s.apply(this, r)), l;
1464
- } : n.renderers[i.name] = i.renderer;
1465
- }
1466
- if (i.tokenizer) {
1467
- if (!i.level || i.level !== "block" && i.level !== "inline")
1468
- throw new Error("extension level must be 'block' or 'inline'");
1469
- n[i.level] ? n[i.level].unshift(i.tokenizer) : n[i.level] = [i.tokenizer], i.start && (i.level === "block" ? n.startBlock ? n.startBlock.push(i.start) : n.startBlock = [i.start] : i.level === "inline" && (n.startInline ? n.startInline.push(i.start) : n.startInline = [i.start]));
1470
- }
1471
- i.childTokens && (n.childTokens[i.name] = i.childTokens);
1472
- }), e.extensions = n), t.renderer) {
1473
- const i = p.defaults.renderer || new D();
1474
- for (const s in t.renderer) {
1475
- const r = i[s];
1476
- i[s] = (...l) => {
1477
- let c = t.renderer[s].apply(i, l);
1478
- return c === !1 && (c = r.apply(i, l)), c;
1479
- };
1480
- }
1481
- e.renderer = i;
1482
- }
1483
- if (t.tokenizer) {
1484
- const i = p.defaults.tokenizer || new q();
1485
- for (const s in t.tokenizer) {
1486
- const r = i[s];
1487
- i[s] = (...l) => {
1488
- let c = t.tokenizer[s].apply(i, l);
1489
- return c === !1 && (c = r.apply(i, l)), c;
1490
- };
1491
- }
1492
- e.tokenizer = i;
1493
- }
1494
- if (t.hooks) {
1495
- const i = p.defaults.hooks || new v();
1496
- for (const s in t.hooks) {
1497
- const r = i[s];
1498
- v.passThroughHooks.has(s) ? i[s] = (l) => {
1499
- if (p.defaults.async)
1500
- return Promise.resolve(t.hooks[s].call(i, l)).then((d) => r.call(i, d));
1501
- const c = t.hooks[s].call(i, l);
1502
- return r.call(i, c);
1503
- } : i[s] = (...l) => {
1504
- let c = t.hooks[s].apply(i, l);
1505
- return c === !1 && (c = r.apply(i, l)), c;
1506
- };
1507
- }
1508
- e.hooks = i;
1509
- }
1510
- if (t.walkTokens) {
1511
- const i = p.defaults.walkTokens;
1512
- e.walkTokens = function(s) {
1513
- let r = [];
1514
- return r.push(t.walkTokens.call(this, s)), i && (r = r.concat(i.call(this, s))), r;
1515
- };
1516
- }
1517
- p.setOptions(e);
1518
- });
1519
- };
1520
- p.walkTokens = function(o, n) {
1521
- let t = [];
1522
- for (const e of o)
1523
- switch (t = t.concat(n.call(p, e)), e.type) {
1524
- case "table": {
1525
- for (const i of e.header)
1526
- t = t.concat(p.walkTokens(i.tokens, n));
1527
- for (const i of e.rows)
1528
- for (const s of i)
1529
- t = t.concat(p.walkTokens(s.tokens, n));
1530
- break;
1531
- }
1532
- case "list": {
1533
- t = t.concat(p.walkTokens(e.items, n));
1534
- break;
1535
- }
1536
- default:
1537
- p.defaults.extensions && p.defaults.extensions.childTokens && p.defaults.extensions.childTokens[e.type] ? p.defaults.extensions.childTokens[e.type].forEach(function(i) {
1538
- t = t.concat(p.walkTokens(e[i], n));
1539
- }) : e.tokens && (t = t.concat(p.walkTokens(e.tokens, n)));
1540
- }
1541
- return t;
1542
- };
1543
- p.parseInline = K(R.lexInline, A.parseInline);
1544
- p.Parser = A;
1545
- p.parser = A.parse;
1546
- p.Renderer = D;
1547
- p.TextRenderer = G;
1548
- p.Lexer = R;
1549
- p.lexer = R.lex;
1550
- p.Tokenizer = q;
1551
- p.Slugger = J;
1552
- p.Hooks = v;
1553
- p.parse = p;
1554
- p.options;
1555
- p.setOptions;
1556
- p.use;
1557
- p.walkTokens;
1558
- p.parseInline;
1559
- A.parse;
1560
- R.lex;
1561
- const ze = ["innerHTML"], Se = /* @__PURE__ */ te({
1562
- __name: "MarkdownViewer",
1563
- props: {
1564
- data: null
1565
- },
1566
- setup(o) {
1567
- const n = o, t = ne(() => p(n.data));
1568
- return (e, i) => (ie(), se("div", {
1569
- class: "markdown-body",
1570
- innerHTML: re(t)
1571
- }, null, 8, ze));
1572
- }
1573
- });
1574
- const Ie = /* @__PURE__ */ le(Se, [["__scopeId", "data-v-e0bd8a5a"]]);
1575
- export {
1576
- Ie as default
1577
- };