@wirecat/drive-cli 0.71.0 → 0.72.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 (258) hide show
  1. package/README.md +150 -71
  2. package/contracts/wirecat.json +77 -8
  3. package/dist/bin/drive.js +2 -2
  4. package/dist/bundle/agent-23OB2NZP.js +46 -0
  5. package/dist/bundle/{all-profiles-3QJG2NAN.js → all-profiles-GXGDVNQJ.js} +67 -25
  6. package/dist/bundle/{anthropic-PSWTEU6G.js → anthropic-H5C4GQHC.js} +9 -9
  7. package/dist/bundle/{app-server-PVTA6ABR.js → app-server-EQ3UK4C7.js} +97 -79
  8. package/dist/bundle/{bun-LU5LP3JI.js → bun-DTJVSRY3.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-PYMKLBRU.js → bun-sqlite-JIFY7MAE.js} +9 -9
  10. package/dist/bundle/chunk-2Q325BBD.js +353 -0
  11. package/dist/bundle/chunk-35FIJGTT.js +52 -0
  12. package/dist/bundle/{chunk-RWDKMU74.js → chunk-3FRQ6V4T.js} +3 -3
  13. package/dist/bundle/chunk-47L262VI.js +340 -0
  14. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  15. package/dist/bundle/{chunk-YVI5SQPY.js → chunk-4HPXWYTE.js} +1 -1
  16. package/dist/bundle/{chunk-QETR5HIZ.js → chunk-4IUNYYYL.js} +4385 -2684
  17. package/dist/bundle/{chunk-I4RWW3UD.js → chunk-4JS32SRX.js} +20 -5
  18. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  19. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  20. package/dist/bundle/{chunk-3N2OFXB5.js → chunk-55FH6IEL.js} +5 -5
  21. package/dist/bundle/{chunk-6TNNT2MQ.js → chunk-5BNMWSU2.js} +483 -176
  22. package/dist/bundle/{chunk-6XFIITOG.js → chunk-5H747A76.js} +5532 -3265
  23. package/dist/bundle/{chunk-MNLL5YLM.js → chunk-5KWCO56H.js} +2 -2
  24. package/dist/bundle/{chunk-GZ2D4KXG.js → chunk-5U3NCE5R.js} +35 -12
  25. package/dist/bundle/{chunk-CJLVYIOP.js → chunk-6CCO3JCM.js} +30 -21
  26. package/dist/bundle/{chunk-26DHFMGZ.js → chunk-6ZW2ZJYC.js} +2 -2
  27. package/dist/bundle/{chunk-COJSWDNU.js → chunk-75DAHQOV.js} +3 -3
  28. package/dist/bundle/{chunk-Q7DOMFJ4.js → chunk-77OBW43F.js} +6 -6
  29. package/dist/bundle/{chunk-FCS26CYQ.js → chunk-7EFM6AW3.js} +4 -4
  30. package/dist/bundle/{chunk-XMMFBPGC.js → chunk-A3S7QM5L.js} +3 -3
  31. package/dist/bundle/{chunk-ASMMG72J.js → chunk-AA4LKC6W.js} +244 -565
  32. package/dist/bundle/chunk-ASTKHB6B.js +3233 -0
  33. package/dist/bundle/{chunk-LXKYKRHD.js → chunk-BM6V7456.js} +8 -227
  34. package/dist/bundle/chunk-BO6EDBYJ.js +50 -0
  35. package/dist/bundle/{chunk-YPFWNVHV.js → chunk-BPA3R4KN.js} +2 -100
  36. package/dist/bundle/chunk-CIFE4KPX.js +2159 -0
  37. package/dist/bundle/chunk-CKB4XZZJ.js +730 -0
  38. package/dist/bundle/{chunk-RJOQH5YY.js → chunk-COJTCEZP.js} +111 -859
  39. package/dist/bundle/{chunk-FJH7DJWK.js → chunk-CWPYDT73.js} +6 -6
  40. package/dist/bundle/{chunk-BKSQBBYG.js → chunk-D4JNCXS7.js} +9 -9
  41. package/dist/bundle/chunk-DCPWZIOV.js +696 -0
  42. package/dist/bundle/{chunk-PRW6SYA3.js → chunk-DHMNCOQI.js} +313 -257
  43. package/dist/bundle/chunk-DOQMH4DC.js +280 -0
  44. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  45. package/dist/bundle/{chunk-YJIGGUPI.js → chunk-DWRUOLBF.js} +4 -4
  46. package/dist/bundle/{chunk-6W763DZN.js → chunk-E3VWZC3K.js} +14 -13
  47. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  48. package/dist/bundle/{chunk-KGYVHPGE.js → chunk-EVG3AA5M.js} +2 -2
  49. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  50. package/dist/bundle/{chunk-Y2NWGNUB.js → chunk-FBEZSA76.js} +5 -5
  51. package/dist/bundle/{chunk-2BVVU7GG.js → chunk-FBQJN74J.js} +1 -1
  52. package/dist/bundle/{chunk-Z56QFOBR.js → chunk-FIZOPJYY.js} +1 -1
  53. package/dist/bundle/chunk-FNAYSZWK.js +783 -0
  54. package/dist/bundle/{chunk-GPQ44Y2R.js → chunk-FRCJHGZM.js} +2 -2
  55. package/dist/bundle/{chunk-35SCQ4VI.js → chunk-FTG5QBSD.js} +41 -33
  56. package/dist/bundle/{chunk-KYKW2W6X.js → chunk-FUDUXIVG.js} +1 -1
  57. package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
  58. package/dist/bundle/{chunk-FT3LN3HP.js → chunk-GIEZYBRC.js} +1 -1
  59. package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
  60. package/dist/bundle/chunk-GU6ICH53.js +108 -0
  61. package/dist/bundle/{chunk-ACUAV6VX.js → chunk-GUMKKRE6.js} +107 -71
  62. package/dist/bundle/{chunk-KGERXYTV.js → chunk-GWCDOYSC.js} +1 -1
  63. package/dist/bundle/{chunk-OJSBWP3F.js → chunk-GXGSC622.js} +69 -7
  64. package/dist/bundle/chunk-HAGXTGJC.js +188 -0
  65. package/dist/bundle/{chunk-XF4EXO2C.js → chunk-IMAWQC5K.js} +6 -6
  66. package/dist/bundle/{chunk-HKY7X6NY.js → chunk-IVGVVSPW.js} +4 -4
  67. package/dist/bundle/{chunk-P7CUM5IB.js → chunk-J4NUHSM7.js} +1 -1
  68. package/dist/bundle/{chunk-MIA7P6FZ.js → chunk-K652FYCO.js} +6 -6
  69. package/dist/bundle/chunk-K6ZWNTXY.js +561 -0
  70. package/dist/bundle/{chunk-COOOO5B3.js → chunk-KF3ZBQJV.js} +4 -4
  71. package/dist/bundle/chunk-KFZCHJRT.js +80 -0
  72. package/dist/bundle/chunk-KLPFDFLI.js +221 -0
  73. package/dist/bundle/{chunk-EOEU3AZN.js → chunk-KP2XMCNT.js} +13 -13
  74. package/dist/bundle/{chunk-FP54WSIR.js → chunk-KWDZ3KVH.js} +4 -4
  75. package/dist/bundle/{chunk-QNRRK3CN.js → chunk-KX4C32WD.js} +2 -2
  76. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  77. package/dist/bundle/{chunk-2LHAVY4U.js → chunk-M2ZWYVWO.js} +1 -1
  78. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  79. package/dist/bundle/{chunk-3EBBLKIT.js → chunk-ML2QIWX2.js} +4 -4
  80. package/dist/bundle/{chunk-ZM63SUHG.js → chunk-MUFF2YTH.js} +2 -2
  81. package/dist/bundle/{chunk-2PUNKUYJ.js → chunk-N24YSLED.js} +9150 -9869
  82. package/dist/bundle/chunk-N4GTCPML.js +7 -0
  83. package/dist/bundle/{chunk-B5KSXHJ7.js → chunk-NBMGDRP4.js} +1 -1
  84. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  85. package/dist/bundle/{chunk-JDV7HNNQ.js → chunk-NNGA4QDR.js} +13 -26
  86. package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
  87. package/dist/bundle/chunk-O7CZZ36M.js +80 -0
  88. package/dist/bundle/{chunk-ICDCAQ6K.js → chunk-OAONP6KI.js} +13 -9
  89. package/dist/bundle/{chunk-WVDCCYS3.js → chunk-OESP4PHB.js} +17 -17
  90. package/dist/bundle/chunk-OHR6IZNH.js +116 -0
  91. package/dist/bundle/{chunk-4QNW4NK6.js → chunk-OLCU7Q2B.js} +1 -1
  92. package/dist/bundle/{chunk-SDKQNOL5.js → chunk-OLDQLEPA.js} +6 -6
  93. package/dist/bundle/{chunk-ZCR3IRZ2.js → chunk-OPIPG6AP.js} +16 -9
  94. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  95. package/dist/bundle/chunk-PRYMT3OG.js +30 -0
  96. package/dist/bundle/chunk-QDUIVMEW.js +36 -0
  97. package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-QKBPCX7Y.js} +1 -1
  98. package/dist/bundle/{chunk-QXC6IEH6.js → chunk-QSLOACDT.js} +201 -423
  99. package/dist/bundle/{chunk-7PDHGZN4.js → chunk-QUZFDU4K.js} +4 -4
  100. package/dist/bundle/{chunk-3UGYFXH6.js → chunk-R32DHS6J.js} +187 -379
  101. package/dist/bundle/{chunk-6SJOTNHF.js → chunk-R57QUYBG.js} +6 -28
  102. package/dist/bundle/{chunk-UTO2GO4P.js → chunk-R64OSDOD.js} +45 -66
  103. package/dist/bundle/{chunk-GBKNJWOZ.js → chunk-RSPBVKOC.js} +8 -8
  104. package/dist/bundle/{chunk-HL52XXZX.js → chunk-SPNPJ3FZ.js} +3 -4
  105. package/dist/bundle/chunk-SQHDSIFL.js +388 -0
  106. package/dist/bundle/{chunk-YPNWIB6H.js → chunk-ST35FIUG.js} +3 -3
  107. package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
  108. package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
  109. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  110. package/dist/bundle/{chunk-X4TIMMKJ.js → chunk-TTPWKTVR.js} +1 -1
  111. package/dist/bundle/{chunk-TAFHYHKA.js → chunk-U7VEJ3CW.js} +45 -27
  112. package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
  113. package/dist/bundle/{chunk-4HWJOU7N.js → chunk-UIQ35CA5.js} +1 -1
  114. package/dist/bundle/{chunk-SAKO3P4H.js → chunk-UJY26HW4.js} +1 -1
  115. package/dist/bundle/{chunk-D5TGYUVU.js → chunk-UWG3PRY7.js} +9 -60
  116. package/dist/bundle/{chunk-JZHBZOJR.js → chunk-VAR3MJU6.js} +3 -3
  117. package/dist/bundle/{chunk-GOWXXYEF.js → chunk-VPQSI5IU.js} +4 -4
  118. package/dist/bundle/{chunk-QFR2PNJN.js → chunk-VQPT3Y7W.js} +12 -12
  119. package/dist/bundle/{chunk-Z3KUSRCF.js → chunk-WMG3H2VK.js} +2 -2
  120. package/dist/bundle/{chunk-4PA4DHYV.js → chunk-X5BGAZC5.js} +6 -6
  121. package/dist/bundle/{chunk-2UUWXPOB.js → chunk-XC6TRWLZ.js} +3 -3
  122. package/dist/bundle/{chunk-OF422U5D.js → chunk-XQZEMRCU.js} +402 -402
  123. package/dist/bundle/{chunk-72C4YOCH.js → chunk-XZ7MO6EU.js} +7 -7
  124. package/dist/bundle/{chunk-SERXSCN3.js → chunk-YAIOEPKU.js} +337 -390
  125. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  126. package/dist/bundle/{chunk-RESDD3Q4.js → chunk-YWOLQEDV.js} +16 -3
  127. package/dist/bundle/{chunk-YMJ6IDGT.js → chunk-ZFDSJ5YJ.js} +38 -8
  128. package/dist/bundle/{chunk-HMS6EEQL.js → chunk-ZFUZEFU6.js} +3 -3
  129. package/dist/bundle/{chunk-TAUBRNC5.js → chunk-ZJKXSMXK.js} +72 -59
  130. package/dist/bundle/{chunk-22QQUKWA.js → chunk-ZKWT6HXT.js} +1 -1
  131. package/dist/bundle/chunk-ZPUY3COZ.js +250 -0
  132. package/dist/bundle/{cli-556DERZL.js → cli-2P5FW2RL.js} +201 -98
  133. package/dist/bundle/command-contract-BMQT2G5X.js +45 -0
  134. package/dist/bundle/{command-server-entry-AYLGNZWD.js → command-server-entry-KP2UDGLA.js} +36 -34
  135. package/dist/bundle/{decode-QU24MWMN.js → decode-K2JZ5D6V.js} +10 -10
  136. package/dist/bundle/{dispatch-4KODNOXV.js → dispatch-KOQZA74A.js} +10 -10
  137. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  138. package/dist/bundle/drive.js +11 -11
  139. package/dist/bundle/{echarts-BXX4OQWC.js → echarts-URO3QGCG.js} +2 -2
  140. package/dist/bundle/{embed-KG27KG3D.js → embed-JLIPWTNN.js} +10 -10
  141. package/dist/bundle/{embedder-IPAVUQUV.js → embedder-LUTDO3HS.js} +15 -15
  142. package/dist/bundle/entry-AVF6LMG7.js +25 -0
  143. package/dist/bundle/{failure-ESL7ETL4.js → failure-GJMQLM7O.js} +4 -4
  144. package/dist/bundle/first-run-VYTIEUDA.js +31 -0
  145. package/dist/bundle/first-screen-QVZPF7KL.js +45 -0
  146. package/dist/bundle/google-VX7IPACN.js +46 -0
  147. package/dist/bundle/{google-api-VCDBSNOW.js → google-api-RFXKRLL4.js} +88 -73
  148. package/dist/bundle/grants-4XWJFVD6.js +133 -0
  149. package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
  150. package/dist/bundle/hast-util-to-html-VP6XLPKJ.js +998 -0
  151. package/dist/bundle/hast-util-to-mdast-IZ5PRX72.js +2272 -0
  152. package/dist/bundle/{identity-LOWMVGZY.js → identity-FXPB5EMT.js} +7 -6
  153. package/dist/bundle/{instructions-2VECIDXF.js → instructions-IROIUVZI.js} +1 -1
  154. package/dist/bundle/{login-7GBONT7V.js → login-WIY5VQU7.js} +96 -81
  155. package/dist/bundle/{mcp-O6ACR2DX.js → mcp-NJIOKW3E.js} +2 -2
  156. package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-HEZF7KJ4.js} +137 -195
  157. package/dist/bundle/mdast-util-gfm-AQW6R6MG.js +925 -0
  158. package/dist/bundle/mdast-util-to-hast-DF2QVIRV.js +879 -0
  159. package/dist/bundle/mdast-util-to-markdown-XYLXB3Z3.js +18 -0
  160. package/dist/bundle/meeting-combined-JUNV35GM.js +28 -0
  161. package/dist/bundle/meeting-model-XY4UNWWK.js +29 -0
  162. package/dist/bundle/{meeting-semantic-G7PFOKU7.js → meeting-semantic-62QNQMOM.js} +10 -10
  163. package/dist/bundle/{micromark-extension-gfm-GRL24TU6.js → micromark-extension-gfm-OE2GBORZ.js} +11 -78
  164. package/dist/bundle/{node-MPEQSFI3.js → node-IACCI2CW.js} +2 -2
  165. package/dist/bundle/{node-sqlite-OLQMAYB4.js → node-sqlite-WYIRC7C7.js} +10 -10
  166. package/dist/bundle/notes-search-DEDUJKSN.js +70 -0
  167. package/dist/bundle/oauth-HXBXF4VI.js +22 -0
  168. package/dist/bundle/{open-OXTE672W.js → open-H32B6BCT.js} +8 -8
  169. package/dist/bundle/{openai-EB3TPIZY.js → openai-VHMPJJUG.js} +22 -21
  170. package/dist/bundle/{process-F6TKXWWA.js → process-RNHPF5OK.js} +1 -1
  171. package/dist/bundle/{program-4IFDZ7FM.js → program-GYMJ3DDH.js} +275 -1148
  172. package/dist/bundle/{prompt-F5RRHPN2.js → prompt-TOG2CRCE.js} +8 -8
  173. package/dist/bundle/{reasons-UORHJDHK.js → reasons-TLFQ45YX.js} +6 -5
  174. package/dist/bundle/{recognize-DAVNZND3.js → recognize-GYGY45EY.js} +7 -7
  175. package/dist/bundle/remote-6XN2QLI5.js +35 -0
  176. package/dist/bundle/{rerank-CND2GVLZ.js → rerank-HJO3O4TW.js} +11 -11
  177. package/dist/bundle/{serve-ZHSPUIGX.js → serve-XPCNLHCR.js} +19 -19
  178. package/dist/bundle/server-UBJZ66XE.js +97 -0
  179. package/dist/bundle/{server-YMAK4LHC.js → server-WPT3NC5B.js} +89 -70
  180. package/dist/bundle/{services-ZILSFJ6E.js → services-253KKKVU.js} +109 -89
  181. package/dist/bundle/{sqlite-runtime-S5VPMZQH.js → sqlite-runtime-EZASGJXW.js} +9 -9
  182. package/dist/bundle/{start-CR6X25RT.js → start-UHI35JFL.js} +7 -7
  183. package/dist/bundle/{state-YFPHVIIJ.js → state-KJTSPFGK.js} +9 -9
  184. package/dist/bundle/{store-UODRT6X4.js → store-62J2H2A3.js} +36 -25
  185. package/dist/bundle/{store-CL4ZJZRI.js → store-G5B7T7M7.js} +38 -23
  186. package/dist/bundle/store-maintenance-command-C6T4YLVF.js +85 -0
  187. package/dist/bundle/surface-3OT64BHS.js +83 -0
  188. package/dist/bundle/tokens-EHYO6D2X.js +133 -0
  189. package/dist/commands/documents.d.ts.map +1 -1
  190. package/dist/commands/documents.js +11 -1
  191. package/dist/commands/documents.js.map +1 -1
  192. package/dist/commands/remote.d.ts.map +1 -1
  193. package/dist/commands/remote.js +8 -22
  194. package/dist/commands/remote.js.map +1 -1
  195. package/dist/commands/sync.d.ts.map +1 -1
  196. package/dist/commands/sync.js +14 -4
  197. package/dist/commands/sync.js.map +1 -1
  198. package/dist/config.d.ts +5 -0
  199. package/dist/config.d.ts.map +1 -1
  200. package/dist/config.js +5 -0
  201. package/dist/config.js.map +1 -1
  202. package/dist/first-screen.d.ts.map +1 -1
  203. package/dist/first-screen.js +2 -1
  204. package/dist/first-screen.js.map +1 -1
  205. package/dist/generated/manifest.d.ts +2 -1
  206. package/dist/generated/manifest.d.ts.map +1 -1
  207. package/dist/generated/manifest.js +782 -0
  208. package/dist/generated/manifest.js.map +1 -1
  209. package/dist/generated/types.d.ts +262 -58
  210. package/dist/generated/types.d.ts.map +1 -1
  211. package/dist/google.d.ts.map +1 -1
  212. package/dist/google.js +5 -5
  213. package/dist/google.js.map +1 -1
  214. package/dist/model.d.ts +5 -2
  215. package/dist/model.d.ts.map +1 -1
  216. package/dist/model.js.map +1 -1
  217. package/dist/policy-keys.js +1 -1
  218. package/dist/policy-keys.js.map +1 -1
  219. package/dist/program.d.ts.map +1 -1
  220. package/dist/program.js +9 -4
  221. package/dist/program.js.map +1 -1
  222. package/dist/state.d.ts.map +1 -1
  223. package/dist/state.js +6 -1
  224. package/dist/state.js.map +1 -1
  225. package/dist/store.d.ts.map +1 -1
  226. package/dist/store.js +2 -7
  227. package/dist/store.js.map +1 -1
  228. package/dist/supported.d.ts +2 -2
  229. package/dist/supported.d.ts.map +1 -1
  230. package/dist/supported.js +2 -3
  231. package/dist/supported.js.map +1 -1
  232. package/dist/sync.d.ts +2 -1
  233. package/dist/sync.d.ts.map +1 -1
  234. package/dist/sync.js +5 -2
  235. package/dist/sync.js.map +1 -1
  236. package/dist/version.d.ts +1 -1
  237. package/dist/version.js +1 -1
  238. package/package.json +3 -3
  239. package/scenarios/find-decision.md +1 -1
  240. package/skills/drive-cli/SKILL.md +4 -2
  241. package/dist/bundle/chunk-J5Q5FS2N.js +0 -593
  242. package/dist/bundle/chunk-L46C6HQ7.js +0 -729
  243. package/dist/bundle/chunk-UDMNY63V.js +0 -899
  244. package/dist/bundle/chunk-VKE77B3F.js +0 -2
  245. package/dist/bundle/command-contract-VRTOAV6W.js +0 -43
  246. package/dist/bundle/entry-MVXQETWS.js +0 -25
  247. package/dist/bundle/first-run-4UVLW2WR.js +0 -31
  248. package/dist/bundle/first-screen-JAKAIINI.js +0 -41
  249. package/dist/bundle/google-22NXXJX5.js +0 -45
  250. package/dist/bundle/grants-MQMTVCRQ.js +0 -118
  251. package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
  252. package/dist/bundle/meeting-combined-LVP4AZKA.js +0 -27
  253. package/dist/bundle/meeting-model-RAY5XDXZ.js +0 -29
  254. package/dist/bundle/oauth-SGH2I2BY.js +0 -22
  255. package/dist/bundle/remote-D5EYYIAU.js +0 -35
  256. package/dist/bundle/server-DUVJWP3Q.js +0 -80
  257. package/dist/bundle/store-maintenance-command-DY5XIBWR.js +0 -72
  258. package/dist/bundle/tokens-AF7QOFOF.js +0 -118
@@ -1,2103 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- toString
5
- } from "./chunk-XFLCVHSQ.js";
6
- import {
7
- normalizeIdentifier,
8
- unicodePunctuation,
9
- unicodeWhitespace
10
- } from "./chunk-6Y2BYFXQ.js";
11
- import {
12
- __name
13
- } from "./chunk-ZVVMGPBJ.js";
14
-
15
- // node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.js
16
- function ccount(value, character) {
17
- const source = String(value);
18
- if (typeof character !== "string") {
19
- throw new TypeError("Expected character");
20
- }
21
- let count = 0;
22
- let index = source.indexOf(character);
23
- while (index !== -1) {
24
- count++;
25
- index = source.indexOf(character, index + character.length);
26
- }
27
- return count;
28
- }
29
- __name(ccount, "ccount");
30
-
31
- // node_modules/.pnpm/devlop@1.1.0/node_modules/devlop/lib/default.js
32
- function ok() {
33
- }
34
- __name(ok, "ok");
35
-
36
- // node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js
37
- function escapeStringRegexp(string) {
38
- if (typeof string !== "string") {
39
- throw new TypeError("Expected a string");
40
- }
41
- return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
42
- }
43
- __name(escapeStringRegexp, "escapeStringRegexp");
44
-
45
- // node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
46
- var convert = (
47
- // Note: overloads in JSDoc can’t yet use different `@template`s.
48
- /**
49
- * @type {(
50
- * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
51
- * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
52
- * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
53
- * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
54
- * ((test?: Test) => Check)
55
- * )}
56
- */
57
- /**
58
- * @param {Test} [test]
59
- * @returns {Check}
60
- */
61
- /* @__PURE__ */ __name((function(test) {
62
- if (test === null || test === void 0) {
63
- return ok2;
64
- }
65
- if (typeof test === "function") {
66
- return castFactory(test);
67
- }
68
- if (typeof test === "object") {
69
- return Array.isArray(test) ? anyFactory(test) : (
70
- // Cast because `ReadonlyArray` goes into the above but `isArray`
71
- // narrows to `Array`.
72
- propertiesFactory(
73
- /** @type {Props} */
74
- test
75
- )
76
- );
77
- }
78
- if (typeof test === "string") {
79
- return typeFactory(test);
80
- }
81
- throw new Error("Expected function, string, or object as test");
82
- }), "convert")
83
- );
84
- function anyFactory(tests) {
85
- const checks = [];
86
- let index = -1;
87
- while (++index < tests.length) {
88
- checks[index] = convert(tests[index]);
89
- }
90
- return castFactory(any);
91
- function any(...parameters) {
92
- let index2 = -1;
93
- while (++index2 < checks.length) {
94
- if (checks[index2].apply(this, parameters)) return true;
95
- }
96
- return false;
97
- }
98
- __name(any, "any");
99
- }
100
- __name(anyFactory, "anyFactory");
101
- function propertiesFactory(check) {
102
- const checkAsRecord = (
103
- /** @type {Record<string, unknown>} */
104
- check
105
- );
106
- return castFactory(all);
107
- function all(node) {
108
- const nodeAsRecord = (
109
- /** @type {Record<string, unknown>} */
110
- /** @type {unknown} */
111
- node
112
- );
113
- let key;
114
- for (key in check) {
115
- if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
116
- }
117
- return true;
118
- }
119
- __name(all, "all");
120
- }
121
- __name(propertiesFactory, "propertiesFactory");
122
- function typeFactory(check) {
123
- return castFactory(type);
124
- function type(node) {
125
- return node && node.type === check;
126
- }
127
- __name(type, "type");
128
- }
129
- __name(typeFactory, "typeFactory");
130
- function castFactory(testFunction) {
131
- return check;
132
- function check(value, index, parent) {
133
- return Boolean(
134
- looksLikeANode(value) && testFunction.call(
135
- this,
136
- value,
137
- typeof index === "number" ? index : void 0,
138
- parent || void 0
139
- )
140
- );
141
- }
142
- __name(check, "check");
143
- }
144
- __name(castFactory, "castFactory");
145
- function ok2() {
146
- return true;
147
- }
148
- __name(ok2, "ok");
149
- function looksLikeANode(value) {
150
- return value !== null && typeof value === "object" && "type" in value;
151
- }
152
- __name(looksLikeANode, "looksLikeANode");
153
-
154
- // node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/color.node.js
155
- function color(d) {
156
- return "\x1B[33m" + d + "\x1B[39m";
157
- }
158
- __name(color, "color");
159
-
160
- // node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/index.js
161
- var empty = [];
162
- var CONTINUE = true;
163
- var EXIT = false;
164
- var SKIP = "skip";
165
- function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
166
- if (!tree || typeof tree !== "object") {
167
- throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
168
- }
169
- let preorder = true;
170
- let check;
171
- let visitors;
172
- let enter;
173
- let exit2;
174
- if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
175
- check = /** @type {Test} */
176
- testOrEnterOrVisitors;
177
- visitors = enterOrVisitorsOrReverse;
178
- if (reverse) preorder = false;
179
- } else {
180
- visitors = /** @type {Visitors | Visitor} */
181
- testOrEnterOrVisitors;
182
- if (enterOrVisitorsOrReverse) preorder = false;
183
- }
184
- if (typeof visitors === "function") {
185
- enter = visitors;
186
- } else if (visitors && typeof visitors === "object") {
187
- if (visitors.enter === null || visitors.enter === void 0) {
188
- } else if (typeof visitors.enter === "function") {
189
- enter = visitors.enter;
190
- } else {
191
- throw new Error(
192
- "Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor"
193
- );
194
- }
195
- if (typeof visitors.exit === "function") {
196
- exit2 = visitors.exit;
197
- } else {
198
- throw new Error(
199
- "Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)"
200
- );
201
- }
202
- } else {
203
- throw new Error(
204
- "Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors"
205
- );
206
- }
207
- const is2 = convert(check);
208
- const step = preorder ? 1 : -1;
209
- factory(tree, void 0, [])();
210
- function factory(node, index, parents) {
211
- const value = (
212
- /** @type {Record<string, unknown>} */
213
- node && typeof node === "object" ? node : {}
214
- );
215
- if (typeof value.type === "string") {
216
- const name = (
217
- // `hast`
218
- typeof value.tagName === "string" ? value.tagName : (
219
- // `xast`
220
- typeof value.name === "string" ? value.name : void 0
221
- )
222
- );
223
- Object.defineProperty(visit2, "name", {
224
- value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
225
- });
226
- }
227
- return visit2;
228
- function visit2() {
229
- const matches = !check || is2(node, index, parents[parents.length - 1] || void 0);
230
- let result = empty;
231
- if (enter && matches) {
232
- result = toResult(enter(node, parents, index));
233
- if (result[0] === EXIT) {
234
- return result;
235
- }
236
- }
237
- if ("children" in node && node.children) {
238
- const nodeAsParent = (
239
- /** @type {UnistParent} */
240
- node
241
- );
242
- if (nodeAsParent.children && result[0] !== SKIP) {
243
- let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
244
- const grandparents = [...parents, nodeAsParent];
245
- while (offset > -1 && offset < nodeAsParent.children.length) {
246
- const child = nodeAsParent.children[offset];
247
- const subresult = factory(child, offset, grandparents)();
248
- if (subresult[0] === EXIT) {
249
- return subresult;
250
- }
251
- offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
252
- }
253
- }
254
- }
255
- if (exit2 && matches) {
256
- const exitResult = toResult(exit2(node, parents, index));
257
- if (exitResult[0] === SKIP) {
258
- throw new Error(
259
- "Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing"
260
- );
261
- }
262
- if (exitResult[0] === EXIT || typeof exitResult[1] === "number") {
263
- return exitResult;
264
- }
265
- }
266
- return result;
267
- }
268
- __name(visit2, "visit");
269
- }
270
- __name(factory, "factory");
271
- }
272
- __name(visitParents, "visitParents");
273
- function toResult(value) {
274
- if (Array.isArray(value)) {
275
- return value;
276
- }
277
- if (typeof value === "number") {
278
- return [CONTINUE, value];
279
- }
280
- return value === null || value === void 0 ? empty : [value];
281
- }
282
- __name(toResult, "toResult");
283
-
284
- // node_modules/.pnpm/mdast-util-find-and-replace@3.0.4/node_modules/mdast-util-find-and-replace/lib/index.js
285
- function findAndReplace(tree, list2, options) {
286
- const settings = options || {};
287
- const ignored = convert(settings.ignore || []);
288
- const pairs = toPairs(list2);
289
- let pairIndex = -1;
290
- while (++pairIndex < pairs.length) {
291
- visitParents(tree, visitor);
292
- }
293
- function visitor(node, parents, index) {
294
- if (node.type === "text" && typeof index === "number") {
295
- return handler(node, parents, index);
296
- }
297
- if (ignored(node, index, parents[parents.length - 1])) return SKIP;
298
- }
299
- __name(visitor, "visitor");
300
- function handler(node, parents, index) {
301
- const parent = parents[parents.length - 1];
302
- const find = pairs[pairIndex][0];
303
- const replace2 = pairs[pairIndex][1];
304
- let start = 0;
305
- let change = false;
306
- let nodes = [];
307
- find.lastIndex = 0;
308
- let match = find.exec(node.value);
309
- while (match) {
310
- const position = match.index;
311
- const matchObject = {
312
- index: match.index,
313
- input: match.input,
314
- stack: [...parents, node]
315
- };
316
- let value = replace2(...match, matchObject);
317
- if (typeof value === "string") {
318
- value = value.length > 0 ? { type: "text", value } : void 0;
319
- }
320
- if (value === false) {
321
- find.lastIndex = position + 1;
322
- } else {
323
- if (start !== position) {
324
- add({ type: "text", value: node.value.slice(start, position) });
325
- }
326
- if (Array.isArray(value)) {
327
- for (const child of value) add(child);
328
- } else if (value) {
329
- add(value);
330
- }
331
- start = position + match[0].length;
332
- change = true;
333
- }
334
- if (!find.global) {
335
- break;
336
- }
337
- match = find.exec(node.value);
338
- }
339
- if (change) {
340
- if (start < node.value.length) {
341
- add({ type: "text", value: node.value.slice(start) });
342
- }
343
- parent.children.splice(index, 1, ...nodes);
344
- } else {
345
- nodes = [node];
346
- }
347
- return index + nodes.length;
348
- function add(child) {
349
- const previous2 = nodes[nodes.length - 1];
350
- if (previous2 && previous2.type === "text" && child.type === "text") {
351
- previous2.value += child.value;
352
- } else {
353
- nodes.push(child);
354
- }
355
- }
356
- __name(add, "add");
357
- }
358
- __name(handler, "handler");
359
- }
360
- __name(findAndReplace, "findAndReplace");
361
- function toPairs(tupleOrList) {
362
- if (!Array.isArray(tupleOrList)) {
363
- throw new TypeError("Expected find and replace tuple or list of tuples");
364
- }
365
- const result = [];
366
- const list2 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? (
367
- /** @type {FindAndReplaceList} */
368
- tupleOrList
369
- ) : [
370
- /** @type {FindAndReplaceTuple} */
371
- tupleOrList
372
- ];
373
- let index = -1;
374
- while (++index < list2.length) {
375
- const tuple = list2[index];
376
- result.push([toExpression(tuple[0]), toFunction(tuple[1])]);
377
- }
378
- return result;
379
- }
380
- __name(toPairs, "toPairs");
381
- function toExpression(find) {
382
- return typeof find === "string" ? new RegExp(escapeStringRegexp(find), "g") : find;
383
- }
384
- __name(toExpression, "toExpression");
385
- function toFunction(replace2) {
386
- return typeof replace2 === "function" ? replace2 : function() {
387
- return replace2;
388
- };
389
- }
390
- __name(toFunction, "toFunction");
391
-
392
- // node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.1/node_modules/mdast-util-gfm-autolink-literal/lib/index.js
393
- var inConstruct = "phrasing";
394
- var notInConstruct = ["autolink", "link", "image", "label"];
395
- function gfmAutolinkLiteralFromMarkdown() {
396
- return {
397
- transforms: [transformGfmAutolinkLiterals],
398
- enter: {
399
- literalAutolink: enterLiteralAutolink,
400
- literalAutolinkEmail: enterLiteralAutolinkValue,
401
- literalAutolinkHttp: enterLiteralAutolinkValue,
402
- literalAutolinkWww: enterLiteralAutolinkValue
403
- },
404
- exit: {
405
- literalAutolink: exitLiteralAutolink,
406
- literalAutolinkEmail: exitLiteralAutolinkEmail,
407
- literalAutolinkHttp: exitLiteralAutolinkHttp,
408
- literalAutolinkWww: exitLiteralAutolinkWww
409
- }
410
- };
411
- }
412
- __name(gfmAutolinkLiteralFromMarkdown, "gfmAutolinkLiteralFromMarkdown");
413
- function gfmAutolinkLiteralToMarkdown() {
414
- return {
415
- unsafe: [
416
- {
417
- character: "@",
418
- before: "[+\\-.\\w]",
419
- after: "[\\-.\\w]",
420
- inConstruct,
421
- notInConstruct
422
- },
423
- {
424
- character: ".",
425
- before: "[Ww]",
426
- after: "[\\-.\\w]",
427
- inConstruct,
428
- notInConstruct
429
- },
430
- {
431
- character: ":",
432
- before: "[ps]",
433
- after: "\\/",
434
- inConstruct,
435
- notInConstruct
436
- }
437
- ]
438
- };
439
- }
440
- __name(gfmAutolinkLiteralToMarkdown, "gfmAutolinkLiteralToMarkdown");
441
- function enterLiteralAutolink(token) {
442
- this.enter({ type: "link", title: null, url: "", children: [] }, token);
443
- }
444
- __name(enterLiteralAutolink, "enterLiteralAutolink");
445
- function enterLiteralAutolinkValue(token) {
446
- this.config.enter.autolinkProtocol.call(this, token);
447
- }
448
- __name(enterLiteralAutolinkValue, "enterLiteralAutolinkValue");
449
- function exitLiteralAutolinkHttp(token) {
450
- this.config.exit.autolinkProtocol.call(this, token);
451
- }
452
- __name(exitLiteralAutolinkHttp, "exitLiteralAutolinkHttp");
453
- function exitLiteralAutolinkWww(token) {
454
- this.config.exit.data.call(this, token);
455
- const node = this.stack[this.stack.length - 1];
456
- ok(node.type === "link");
457
- node.url = "http://" + this.sliceSerialize(token);
458
- }
459
- __name(exitLiteralAutolinkWww, "exitLiteralAutolinkWww");
460
- function exitLiteralAutolinkEmail(token) {
461
- this.config.exit.autolinkEmail.call(this, token);
462
- }
463
- __name(exitLiteralAutolinkEmail, "exitLiteralAutolinkEmail");
464
- function exitLiteralAutolink(token) {
465
- this.exit(token);
466
- }
467
- __name(exitLiteralAutolink, "exitLiteralAutolink");
468
- function transformGfmAutolinkLiterals(tree) {
469
- findAndReplace(
470
- tree,
471
- [
472
- [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl],
473
- [new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)", "gu"), findEmail]
474
- ],
475
- { ignore: ["link", "linkReference"] }
476
- );
477
- }
478
- __name(transformGfmAutolinkLiterals, "transformGfmAutolinkLiterals");
479
- function findUrl(_, protocol, domain, path, match) {
480
- let prefix = "";
481
- if (!previous(match)) {
482
- return false;
483
- }
484
- if (/^w/i.test(protocol)) {
485
- domain = protocol + domain;
486
- protocol = "";
487
- prefix = "http://";
488
- }
489
- if (!isCorrectDomain(domain)) {
490
- return false;
491
- }
492
- const parts = splitUrl(domain + path);
493
- if (!parts[0]) return false;
494
- const result = {
495
- type: "link",
496
- title: null,
497
- url: prefix + protocol + parts[0],
498
- children: [{ type: "text", value: protocol + parts[0] }]
499
- };
500
- if (parts[1]) {
501
- return [result, { type: "text", value: parts[1] }];
502
- }
503
- return result;
504
- }
505
- __name(findUrl, "findUrl");
506
- function findEmail(_, atext, label, match) {
507
- if (
508
- // Not an expected previous character.
509
- !previous(match, true) || // Label ends in not allowed character.
510
- /[-\d_]$/.test(label)
511
- ) {
512
- return false;
513
- }
514
- return {
515
- type: "link",
516
- title: null,
517
- url: "mailto:" + atext + "@" + label,
518
- children: [{ type: "text", value: atext + "@" + label }]
519
- };
520
- }
521
- __name(findEmail, "findEmail");
522
- function isCorrectDomain(domain) {
523
- const parts = domain.split(".");
524
- if (parts.length < 2 || parts[parts.length - 1] && (/_/.test(parts[parts.length - 1]) || !/[a-zA-Z\d]/.test(parts[parts.length - 1])) || parts[parts.length - 2] && (/_/.test(parts[parts.length - 2]) || !/[a-zA-Z\d]/.test(parts[parts.length - 2]))) {
525
- return false;
526
- }
527
- return true;
528
- }
529
- __name(isCorrectDomain, "isCorrectDomain");
530
- function splitUrl(url) {
531
- const trailExec = /[!"&'),.:;<>?\]}]+$/.exec(url);
532
- if (!trailExec) {
533
- return [url, void 0];
534
- }
535
- url = url.slice(0, trailExec.index);
536
- let trail = trailExec[0];
537
- let closingParenIndex = trail.indexOf(")");
538
- const openingParens = ccount(url, "(");
539
- let closingParens = ccount(url, ")");
540
- while (closingParenIndex !== -1 && openingParens > closingParens) {
541
- url += trail.slice(0, closingParenIndex + 1);
542
- trail = trail.slice(closingParenIndex + 1);
543
- closingParenIndex = trail.indexOf(")");
544
- closingParens++;
545
- }
546
- return [url, trail];
547
- }
548
- __name(splitUrl, "splitUrl");
549
- function previous(match, email) {
550
- const code2 = match.input.charCodeAt(match.index - 1);
551
- return (match.index === 0 || unicodeWhitespace(code2) || unicodePunctuation(code2)) && // If it’s an email, the previous character should not be a slash.
552
- (!email || code2 !== 47);
553
- }
554
- __name(previous, "previous");
555
-
556
- // node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.js
557
- footnoteReference.peek = footnoteReferencePeek;
558
- function enterFootnoteCallString() {
559
- this.buffer();
560
- }
561
- __name(enterFootnoteCallString, "enterFootnoteCallString");
562
- function enterFootnoteCall(token) {
563
- this.enter({ type: "footnoteReference", identifier: "", label: "" }, token);
564
- }
565
- __name(enterFootnoteCall, "enterFootnoteCall");
566
- function enterFootnoteDefinitionLabelString() {
567
- this.buffer();
568
- }
569
- __name(enterFootnoteDefinitionLabelString, "enterFootnoteDefinitionLabelString");
570
- function enterFootnoteDefinition(token) {
571
- this.enter(
572
- { type: "footnoteDefinition", identifier: "", label: "", children: [] },
573
- token
574
- );
575
- }
576
- __name(enterFootnoteDefinition, "enterFootnoteDefinition");
577
- function exitFootnoteCallString(token) {
578
- const label = this.resume();
579
- const node = this.stack[this.stack.length - 1];
580
- ok(node.type === "footnoteReference");
581
- node.identifier = normalizeIdentifier(
582
- this.sliceSerialize(token)
583
- ).toLowerCase();
584
- node.label = label;
585
- }
586
- __name(exitFootnoteCallString, "exitFootnoteCallString");
587
- function exitFootnoteCall(token) {
588
- this.exit(token);
589
- }
590
- __name(exitFootnoteCall, "exitFootnoteCall");
591
- function exitFootnoteDefinitionLabelString(token) {
592
- const label = this.resume();
593
- const node = this.stack[this.stack.length - 1];
594
- ok(node.type === "footnoteDefinition");
595
- node.identifier = normalizeIdentifier(
596
- this.sliceSerialize(token)
597
- ).toLowerCase();
598
- node.label = label;
599
- }
600
- __name(exitFootnoteDefinitionLabelString, "exitFootnoteDefinitionLabelString");
601
- function exitFootnoteDefinition(token) {
602
- this.exit(token);
603
- }
604
- __name(exitFootnoteDefinition, "exitFootnoteDefinition");
605
- function footnoteReferencePeek() {
606
- return "[";
607
- }
608
- __name(footnoteReferencePeek, "footnoteReferencePeek");
609
- function footnoteReference(node, _, state, info) {
610
- const tracker = state.createTracker(info);
611
- let value = tracker.move("[^");
612
- const exit2 = state.enter("footnoteReference");
613
- const subexit = state.enter("reference");
614
- value += tracker.move(
615
- state.safe(state.associationId(node), { after: "]", before: value })
616
- );
617
- subexit();
618
- exit2();
619
- value += tracker.move("]");
620
- return value;
621
- }
622
- __name(footnoteReference, "footnoteReference");
623
- function gfmFootnoteFromMarkdown() {
624
- return {
625
- enter: {
626
- gfmFootnoteCallString: enterFootnoteCallString,
627
- gfmFootnoteCall: enterFootnoteCall,
628
- gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,
629
- gfmFootnoteDefinition: enterFootnoteDefinition
630
- },
631
- exit: {
632
- gfmFootnoteCallString: exitFootnoteCallString,
633
- gfmFootnoteCall: exitFootnoteCall,
634
- gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,
635
- gfmFootnoteDefinition: exitFootnoteDefinition
636
- }
637
- };
638
- }
639
- __name(gfmFootnoteFromMarkdown, "gfmFootnoteFromMarkdown");
640
- function gfmFootnoteToMarkdown(options) {
641
- let firstLineBlank = false;
642
- if (options && options.firstLineBlank) {
643
- firstLineBlank = true;
644
- }
645
- return {
646
- handlers: { footnoteDefinition, footnoteReference },
647
- // This is on by default already.
648
- unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
649
- };
650
- function footnoteDefinition(node, _, state, info) {
651
- const tracker = state.createTracker(info);
652
- let value = tracker.move("[^");
653
- const exit2 = state.enter("footnoteDefinition");
654
- const subexit = state.enter("label");
655
- value += tracker.move(
656
- state.safe(state.associationId(node), { before: value, after: "]" })
657
- );
658
- subexit();
659
- value += tracker.move("]:");
660
- if (node.children && node.children.length > 0) {
661
- tracker.shift(4);
662
- value += tracker.move(
663
- (firstLineBlank ? "\n" : " ") + state.indentLines(
664
- state.containerFlow(node, tracker.current()),
665
- firstLineBlank ? mapAll : mapExceptFirst
666
- )
667
- );
668
- }
669
- exit2();
670
- return value;
671
- }
672
- __name(footnoteDefinition, "footnoteDefinition");
673
- }
674
- __name(gfmFootnoteToMarkdown, "gfmFootnoteToMarkdown");
675
- function mapExceptFirst(line, index, blank) {
676
- return index === 0 ? line : mapAll(line, index, blank);
677
- }
678
- __name(mapExceptFirst, "mapExceptFirst");
679
- function mapAll(line, index, blank) {
680
- return (blank ? "" : " ") + line;
681
- }
682
- __name(mapAll, "mapAll");
683
-
684
- // node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.1/node_modules/mdast-util-gfm-strikethrough/lib/index.js
685
- var constructsWithoutStrikethrough = [
686
- "autolink",
687
- "destinationLiteral",
688
- "destinationRaw",
689
- "reference",
690
- "titleQuote",
691
- "titleApostrophe"
692
- ];
693
- handleDelete.attention = attentionDelete;
694
- handleDelete.peek = peekDelete;
695
- function gfmStrikethroughFromMarkdown() {
696
- return {
697
- canContainEols: ["delete"],
698
- enter: { strikethrough: enterStrikethrough },
699
- exit: { strikethrough: exitStrikethrough }
700
- };
701
- }
702
- __name(gfmStrikethroughFromMarkdown, "gfmStrikethroughFromMarkdown");
703
- function gfmStrikethroughToMarkdown() {
704
- return {
705
- handlers: { delete: handleDelete },
706
- unsafe: [
707
- {
708
- character: "~",
709
- inConstruct: "phrasing",
710
- notInConstruct: constructsWithoutStrikethrough
711
- }
712
- ]
713
- };
714
- }
715
- __name(gfmStrikethroughToMarkdown, "gfmStrikethroughToMarkdown");
716
- function enterStrikethrough(token) {
717
- this.enter({ type: "delete", children: [], position: void 0 }, token);
718
- }
719
- __name(enterStrikethrough, "enterStrikethrough");
720
- function exitStrikethrough(token) {
721
- this.exit(token);
722
- }
723
- __name(exitStrikethrough, "exitStrikethrough");
724
- function handleDelete(node, _, state, info) {
725
- const tracker = state.createTracker(info);
726
- const sequence = state.stack.includes("strikethrough") ? "~" : "~~";
727
- const exit2 = state.enter("strikethrough");
728
- let value = tracker.move(sequence);
729
- value += state.containerPhrasing(node, {
730
- ...tracker.current(),
731
- before: value,
732
- after: "~"
733
- });
734
- value += tracker.move(sequence);
735
- exit2();
736
- return value;
737
- }
738
- __name(handleDelete, "handleDelete");
739
- function attentionDelete() {
740
- return { construct: "strikethrough", markers: ["~"], sizes: [2, 1] };
741
- }
742
- __name(attentionDelete, "attentionDelete");
743
- function peekDelete() {
744
- return "~";
745
- }
746
- __name(peekDelete, "peekDelete");
747
-
748
- // node_modules/.pnpm/markdown-table@3.0.4/node_modules/markdown-table/index.js
749
- function defaultStringLength(value) {
750
- return value.length;
751
- }
752
- __name(defaultStringLength, "defaultStringLength");
753
- function markdownTable(table, options) {
754
- const settings = options || {};
755
- const align = (settings.align || []).concat();
756
- const stringLength = settings.stringLength || defaultStringLength;
757
- const alignments = [];
758
- const cellMatrix = [];
759
- const sizeMatrix = [];
760
- const longestCellByColumn = [];
761
- let mostCellsPerRow = 0;
762
- let rowIndex = -1;
763
- while (++rowIndex < table.length) {
764
- const row2 = [];
765
- const sizes2 = [];
766
- let columnIndex2 = -1;
767
- if (table[rowIndex].length > mostCellsPerRow) {
768
- mostCellsPerRow = table[rowIndex].length;
769
- }
770
- while (++columnIndex2 < table[rowIndex].length) {
771
- const cell = serialize(table[rowIndex][columnIndex2]);
772
- if (settings.alignDelimiters !== false) {
773
- const size = stringLength(cell);
774
- sizes2[columnIndex2] = size;
775
- if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) {
776
- longestCellByColumn[columnIndex2] = size;
777
- }
778
- }
779
- row2.push(cell);
780
- }
781
- cellMatrix[rowIndex] = row2;
782
- sizeMatrix[rowIndex] = sizes2;
783
- }
784
- let columnIndex = -1;
785
- if (typeof align === "object" && "length" in align) {
786
- while (++columnIndex < mostCellsPerRow) {
787
- alignments[columnIndex] = toAlignment(align[columnIndex]);
788
- }
789
- } else {
790
- const code2 = toAlignment(align);
791
- while (++columnIndex < mostCellsPerRow) {
792
- alignments[columnIndex] = code2;
793
- }
794
- }
795
- columnIndex = -1;
796
- const row = [];
797
- const sizes = [];
798
- while (++columnIndex < mostCellsPerRow) {
799
- const code2 = alignments[columnIndex];
800
- let before = "";
801
- let after = "";
802
- if (code2 === 99) {
803
- before = ":";
804
- after = ":";
805
- } else if (code2 === 108) {
806
- before = ":";
807
- } else if (code2 === 114) {
808
- after = ":";
809
- }
810
- let size = settings.alignDelimiters === false ? 1 : Math.max(
811
- 1,
812
- longestCellByColumn[columnIndex] - before.length - after.length
813
- );
814
- const cell = before + "-".repeat(size) + after;
815
- if (settings.alignDelimiters !== false) {
816
- size = before.length + size + after.length;
817
- if (size > longestCellByColumn[columnIndex]) {
818
- longestCellByColumn[columnIndex] = size;
819
- }
820
- sizes[columnIndex] = size;
821
- }
822
- row[columnIndex] = cell;
823
- }
824
- cellMatrix.splice(1, 0, row);
825
- sizeMatrix.splice(1, 0, sizes);
826
- rowIndex = -1;
827
- const lines = [];
828
- while (++rowIndex < cellMatrix.length) {
829
- const row2 = cellMatrix[rowIndex];
830
- const sizes2 = sizeMatrix[rowIndex];
831
- columnIndex = -1;
832
- const line = [];
833
- while (++columnIndex < mostCellsPerRow) {
834
- const cell = row2[columnIndex] || "";
835
- let before = "";
836
- let after = "";
837
- if (settings.alignDelimiters !== false) {
838
- const size = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0);
839
- const code2 = alignments[columnIndex];
840
- if (code2 === 114) {
841
- before = " ".repeat(size);
842
- } else if (code2 === 99) {
843
- if (size % 2) {
844
- before = " ".repeat(size / 2 + 0.5);
845
- after = " ".repeat(size / 2 - 0.5);
846
- } else {
847
- before = " ".repeat(size / 2);
848
- after = before;
849
- }
850
- } else {
851
- after = " ".repeat(size);
852
- }
853
- }
854
- if (settings.delimiterStart !== false && !columnIndex) {
855
- line.push("|");
856
- }
857
- if (settings.padding !== false && // Don’t add the opening space if we’re not aligning and the cell is
858
- // empty: there will be a closing space.
859
- !(settings.alignDelimiters === false && cell === "") && (settings.delimiterStart !== false || columnIndex)) {
860
- line.push(" ");
861
- }
862
- if (settings.alignDelimiters !== false) {
863
- line.push(before);
864
- }
865
- line.push(cell);
866
- if (settings.alignDelimiters !== false) {
867
- line.push(after);
868
- }
869
- if (settings.padding !== false) {
870
- line.push(" ");
871
- }
872
- if (settings.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) {
873
- line.push("|");
874
- }
875
- }
876
- lines.push(
877
- settings.delimiterEnd === false ? line.join("").replace(/ +$/, "") : line.join("")
878
- );
879
- }
880
- return lines.join("\n");
881
- }
882
- __name(markdownTable, "markdownTable");
883
- function serialize(value) {
884
- return value === null || value === void 0 ? "" : String(value);
885
- }
886
- __name(serialize, "serialize");
887
- function toAlignment(value) {
888
- const code2 = typeof value === "string" ? value.codePointAt(0) : 0;
889
- return code2 === 67 || code2 === 99 ? 99 : code2 === 76 || code2 === 108 ? 108 : code2 === 82 || code2 === 114 ? 114 : 0;
890
- }
891
- __name(toAlignment, "toAlignment");
892
-
893
- // node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.js
894
- var phrasing = (
895
- /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
896
- convert([
897
- "break",
898
- "delete",
899
- "emphasis",
900
- // To do: next major: removed since footnotes were added to GFM.
901
- "footnote",
902
- "footnoteReference",
903
- "image",
904
- "imageReference",
905
- "inlineCode",
906
- // Enabled by `mdast-util-math`:
907
- "inlineMath",
908
- "link",
909
- "linkReference",
910
- // Enabled by `mdast-util-mdx`:
911
- "mdxJsxTextElement",
912
- // Enabled by `mdast-util-mdx`:
913
- "mdxTextExpression",
914
- "strong",
915
- "text",
916
- // Enabled by `mdast-util-directive`:
917
- "textDirective"
918
- ])
919
- );
920
-
921
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
922
- function blockquote(node, _, state, info) {
923
- const exit2 = state.enter("blockquote");
924
- const tracker = state.createTracker(info);
925
- tracker.move("> ");
926
- tracker.shift(2);
927
- const value = state.indentLines(
928
- state.containerFlow(node, tracker.current()),
929
- map
930
- );
931
- exit2();
932
- return value;
933
- }
934
- __name(blockquote, "blockquote");
935
- function map(line, _, blank) {
936
- return ">" + (blank ? "" : " ") + line;
937
- }
938
- __name(map, "map");
939
-
940
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
941
- function patternInScope(stack, pattern) {
942
- return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
943
- }
944
- __name(patternInScope, "patternInScope");
945
- function listInScope(stack, list2, none) {
946
- if (typeof list2 === "string") {
947
- list2 = [list2];
948
- }
949
- if (!list2 || list2.length === 0) {
950
- return none;
951
- }
952
- let index = -1;
953
- while (++index < list2.length) {
954
- if (stack.includes(list2[index])) {
955
- return true;
956
- }
957
- }
958
- return false;
959
- }
960
- __name(listInScope, "listInScope");
961
-
962
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/break.js
963
- function hardBreak(_, _1, state, info) {
964
- let index = -1;
965
- while (++index < state.unsafe.length) {
966
- const pattern = state.unsafe[index];
967
- if (pattern.character === "\n" && !pattern.before && !pattern.after && patternInScope(state.stack, pattern)) {
968
- return /[\t ]/.test(info.before) ? "" : " ";
969
- }
970
- }
971
- return "\\\n";
972
- }
973
- __name(hardBreak, "hardBreak");
974
-
975
- // node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.js
976
- function longestStreak(value, substring) {
977
- const source = String(value);
978
- let index = source.indexOf(substring);
979
- let expected = index;
980
- let count = 0;
981
- let max = 0;
982
- if (typeof substring !== "string") {
983
- throw new TypeError("Expected substring");
984
- }
985
- while (index !== -1) {
986
- if (index === expected) {
987
- if (++count > max) {
988
- max = count;
989
- }
990
- } else {
991
- count = 1;
992
- }
993
- expected = index + substring.length;
994
- index = source.indexOf(substring, expected);
995
- }
996
- return max;
997
- }
998
- __name(longestStreak, "longestStreak");
999
-
1000
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
1001
- function formatCodeAsIndented(node, state) {
1002
- return Boolean(
1003
- state.options.fences === false && node.value && // If there’s no info…
1004
- !node.lang && // And there’s a non-whitespace character…
1005
- /[^\n\r ]/.test(node.value) && // And the value doesn’t start or end in a blank…
1006
- !/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(node.value)
1007
- );
1008
- }
1009
- __name(formatCodeAsIndented, "formatCodeAsIndented");
1010
-
1011
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
1012
- function checkFence(state) {
1013
- const marker = state.options.fence || "`";
1014
- if (marker !== "`" && marker !== "~") {
1015
- throw new Error(
1016
- "Cannot serialize code with `" + marker + "` for `options.fence`, expected `` ` `` or `~`"
1017
- );
1018
- }
1019
- return marker;
1020
- }
1021
- __name(checkFence, "checkFence");
1022
-
1023
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/code.js
1024
- function code(node, _, state, info) {
1025
- const marker = checkFence(state);
1026
- const raw = node.value || "";
1027
- if (formatCodeAsIndented(node, state)) {
1028
- const exit3 = state.enter("codeIndented");
1029
- const value2 = state.indentLines(raw, map2);
1030
- exit3();
1031
- return value2;
1032
- }
1033
- const tracker = state.createTracker(info);
1034
- const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3));
1035
- const exit2 = state.enter("codeFenced");
1036
- const suffix = marker === "`" ? "GraveAccent" : "Tilde";
1037
- let value = tracker.move(sequence);
1038
- if (node.lang) {
1039
- const subexit = state.enter(`codeFencedLang${suffix}`);
1040
- value += tracker.move(
1041
- state.safe(node.lang, {
1042
- before: value,
1043
- after: " ",
1044
- encode: ["`"],
1045
- ...tracker.current()
1046
- })
1047
- );
1048
- subexit();
1049
- }
1050
- if (node.lang && node.meta) {
1051
- const subexit = state.enter(`codeFencedMeta${suffix}`);
1052
- value += tracker.move(" ");
1053
- value += tracker.move(
1054
- state.safe(node.meta, {
1055
- before: value,
1056
- after: "\n",
1057
- encode: ["`"],
1058
- ...tracker.current()
1059
- })
1060
- );
1061
- subexit();
1062
- }
1063
- value += tracker.move("\n");
1064
- if (raw) {
1065
- value += tracker.move(raw + "\n");
1066
- }
1067
- value += tracker.move(sequence);
1068
- exit2();
1069
- return value;
1070
- }
1071
- __name(code, "code");
1072
- function map2(line, _, blank) {
1073
- return (blank ? "" : " ") + line;
1074
- }
1075
- __name(map2, "map");
1076
-
1077
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
1078
- function checkQuote(state) {
1079
- const marker = state.options.quote || '"';
1080
- if (marker !== '"' && marker !== "'") {
1081
- throw new Error(
1082
- "Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`"
1083
- );
1084
- }
1085
- return marker;
1086
- }
1087
- __name(checkQuote, "checkQuote");
1088
-
1089
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/definition.js
1090
- function definition(node, _, state, info) {
1091
- const quote = checkQuote(state);
1092
- const suffix = quote === '"' ? "Quote" : "Apostrophe";
1093
- const exit2 = state.enter("definition");
1094
- let subexit = state.enter("label");
1095
- const tracker = state.createTracker(info);
1096
- let value = tracker.move("[");
1097
- value += tracker.move(
1098
- state.safe(state.associationId(node), {
1099
- before: value,
1100
- after: "]",
1101
- ...tracker.current()
1102
- })
1103
- );
1104
- value += tracker.move("]: ");
1105
- subexit();
1106
- if (
1107
- // If there’s no url, or…
1108
- !node.url || // If there are control characters or whitespace.
1109
- /[\0- \u007F]/.test(node.url)
1110
- ) {
1111
- subexit = state.enter("destinationLiteral");
1112
- value += tracker.move("<");
1113
- value += tracker.move(
1114
- state.safe(node.url, { before: value, after: ">", ...tracker.current() })
1115
- );
1116
- value += tracker.move(">");
1117
- } else {
1118
- subexit = state.enter("destinationRaw");
1119
- value += tracker.move(
1120
- state.safe(node.url, {
1121
- before: value,
1122
- after: node.title ? " " : "\n",
1123
- ...tracker.current()
1124
- })
1125
- );
1126
- }
1127
- subexit();
1128
- if (node.title) {
1129
- subexit = state.enter(`title${suffix}`);
1130
- value += tracker.move(" " + quote);
1131
- value += tracker.move(
1132
- state.safe(node.title, {
1133
- before: value,
1134
- after: quote,
1135
- ...tracker.current()
1136
- })
1137
- );
1138
- value += tracker.move(quote);
1139
- subexit();
1140
- }
1141
- exit2();
1142
- return value;
1143
- }
1144
- __name(definition, "definition");
1145
-
1146
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
1147
- function checkEmphasis(state) {
1148
- const marker = state.options.emphasis || "*";
1149
- if (marker !== "*" && marker !== "_") {
1150
- throw new Error(
1151
- "Cannot serialize emphasis with `" + marker + "` for `options.emphasis`, expected `*`, or `_`"
1152
- );
1153
- }
1154
- return marker;
1155
- }
1156
- __name(checkEmphasis, "checkEmphasis");
1157
-
1158
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
1159
- emphasis.attention = attention;
1160
- emphasis.peek = peek;
1161
- function emphasis(node, _, state, info) {
1162
- const exit2 = state.enter("phrasing");
1163
- const value = state.containerPhrasing({ type: "root", children: [node] }, info);
1164
- exit2();
1165
- return value;
1166
- }
1167
- __name(emphasis, "emphasis");
1168
- function attention(_, state) {
1169
- const marker = checkEmphasis(state);
1170
- return {
1171
- construct: "emphasis",
1172
- markers: marker === "*" ? ["*", "_"] : ["_", "*"],
1173
- sizes: [1]
1174
- };
1175
- }
1176
- __name(attention, "attention");
1177
- function peek(_, _1, state) {
1178
- return state.options.emphasis || "*";
1179
- }
1180
- __name(peek, "peek");
1181
-
1182
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
1183
- function encodeCharacterReference(code2) {
1184
- return "&#x" + code2.toString(16).toUpperCase() + ";";
1185
- }
1186
- __name(encodeCharacterReference, "encodeCharacterReference");
1187
-
1188
- // node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.js
1189
- function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
1190
- let check;
1191
- let visitors;
1192
- let reverse;
1193
- if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
1194
- check = /** @type {Test} */
1195
- testOrEnterOrVisitors;
1196
- visitors = enterOrVisitorsOrReverse;
1197
- reverse = maybeReverse;
1198
- } else {
1199
- visitors = /** @type {Visitor | Visitors} */
1200
- testOrEnterOrVisitors;
1201
- reverse = enterOrVisitorsOrReverse;
1202
- }
1203
- if (typeof visitors === "function") {
1204
- visitParents(tree, check, wrap(visitors), reverse);
1205
- } else {
1206
- visitParents(tree, check, wrapVisitors(visitors), reverse);
1207
- }
1208
- }
1209
- __name(visit, "visit");
1210
- function wrapVisitors(visitors) {
1211
- if (!visitors || typeof visitors !== "object") return visitors;
1212
- return {
1213
- enter: typeof visitors.enter === "function" ? wrap(visitors.enter) : visitors.enter,
1214
- exit: typeof visitors.exit === "function" ? wrap(visitors.exit) : visitors.exit
1215
- };
1216
- }
1217
- __name(wrapVisitors, "wrapVisitors");
1218
- function wrap(visitor) {
1219
- return overload;
1220
- function overload(node, parents, index) {
1221
- return visitor(node, index, parents[parents.length - 1]);
1222
- }
1223
- __name(overload, "overload");
1224
- }
1225
- __name(wrap, "wrap");
1226
-
1227
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
1228
- function formatHeadingAsSetext(node, state) {
1229
- let literalWithBreak = false;
1230
- visit(node, function(node2) {
1231
- if ("value" in node2 && /\r?\n|\r/.test(node2.value) || node2.type === "break") {
1232
- literalWithBreak = true;
1233
- return EXIT;
1234
- }
1235
- });
1236
- return Boolean(
1237
- (!node.depth || node.depth < 3) && toString(node) && (state.options.setext || literalWithBreak)
1238
- );
1239
- }
1240
- __name(formatHeadingAsSetext, "formatHeadingAsSetext");
1241
-
1242
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/heading.js
1243
- function heading(node, _, state, info) {
1244
- const rank = Math.max(Math.min(6, node.depth || 1), 1);
1245
- const tracker = state.createTracker(info);
1246
- if (formatHeadingAsSetext(node, state)) {
1247
- const exit3 = state.enter("headingSetext");
1248
- const subexit2 = state.enter("phrasing");
1249
- const value2 = state.containerPhrasing(node, {
1250
- ...tracker.current(),
1251
- before: "\n",
1252
- after: "\n"
1253
- });
1254
- subexit2();
1255
- exit3();
1256
- return value2 + "\n" + (rank === 1 ? "=" : "-").repeat(
1257
- // The whole size…
1258
- value2.length - // Minus the position of the character after the last EOL (or
1259
- // 0 if there is none)…
1260
- (Math.max(value2.lastIndexOf("\r"), value2.lastIndexOf("\n")) + 1)
1261
- );
1262
- }
1263
- const sequence = "#".repeat(rank);
1264
- const exit2 = state.enter("headingAtx");
1265
- const subexit = state.enter("phrasing");
1266
- tracker.move(sequence + " ");
1267
- let value = state.containerPhrasing(node, {
1268
- before: "# ",
1269
- after: "\n",
1270
- ...tracker.current()
1271
- });
1272
- const head = value.charCodeAt(0);
1273
- if (head === 9 || head === 32) {
1274
- value = encodeCharacterReference(head) + value.slice(1);
1275
- }
1276
- value = value ? sequence + " " + value : sequence;
1277
- if (state.options.closeAtx) {
1278
- value += " " + sequence;
1279
- }
1280
- subexit();
1281
- exit2();
1282
- return value;
1283
- }
1284
- __name(heading, "heading");
1285
-
1286
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/html.js
1287
- html.peek = htmlPeek;
1288
- function html(node) {
1289
- return node.value || "";
1290
- }
1291
- __name(html, "html");
1292
- function htmlPeek() {
1293
- return "<";
1294
- }
1295
- __name(htmlPeek, "htmlPeek");
1296
-
1297
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image.js
1298
- image.peek = imagePeek;
1299
- function image(node, _, state, info) {
1300
- const quote = checkQuote(state);
1301
- const suffix = quote === '"' ? "Quote" : "Apostrophe";
1302
- const exit2 = state.enter("image");
1303
- let subexit = state.enter("label");
1304
- const tracker = state.createTracker(info);
1305
- let value = tracker.move("![");
1306
- value += tracker.move(
1307
- state.safe(node.alt, { before: value, after: "]", ...tracker.current() })
1308
- );
1309
- value += tracker.move("](");
1310
- subexit();
1311
- if (
1312
- // If there’s no url but there is a title…
1313
- !node.url && node.title || // If there are control characters or whitespace.
1314
- /[\0- \u007F]/.test(node.url)
1315
- ) {
1316
- subexit = state.enter("destinationLiteral");
1317
- value += tracker.move("<");
1318
- value += tracker.move(
1319
- state.safe(node.url, { before: value, after: ">", ...tracker.current() })
1320
- );
1321
- value += tracker.move(">");
1322
- } else {
1323
- subexit = state.enter("destinationRaw");
1324
- value += tracker.move(
1325
- state.safe(node.url, {
1326
- before: value,
1327
- after: node.title ? " " : ")",
1328
- ...tracker.current()
1329
- })
1330
- );
1331
- }
1332
- subexit();
1333
- if (node.title) {
1334
- subexit = state.enter(`title${suffix}`);
1335
- value += tracker.move(" " + quote);
1336
- value += tracker.move(
1337
- state.safe(node.title, {
1338
- before: value,
1339
- after: quote,
1340
- ...tracker.current()
1341
- })
1342
- );
1343
- value += tracker.move(quote);
1344
- subexit();
1345
- }
1346
- value += tracker.move(")");
1347
- exit2();
1348
- return value;
1349
- }
1350
- __name(image, "image");
1351
- function imagePeek() {
1352
- return "!";
1353
- }
1354
- __name(imagePeek, "imagePeek");
1355
-
1356
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
1357
- imageReference.peek = imageReferencePeek;
1358
- function imageReference(node, _, state, info) {
1359
- const type = node.referenceType;
1360
- const exit2 = state.enter("imageReference");
1361
- let subexit = state.enter("label");
1362
- const tracker = state.createTracker(info);
1363
- let value = tracker.move("![");
1364
- const alt = state.safe(node.alt, {
1365
- before: value,
1366
- after: "]",
1367
- ...tracker.current()
1368
- });
1369
- value += tracker.move(alt + "][");
1370
- subexit();
1371
- const stack = state.stack;
1372
- state.stack = stack.filter(function(d) {
1373
- return d !== "phrasing";
1374
- });
1375
- subexit = state.enter("reference");
1376
- const reference = state.safe(state.associationId(node), {
1377
- before: value,
1378
- after: "]",
1379
- ...tracker.current()
1380
- });
1381
- subexit();
1382
- state.stack = stack;
1383
- exit2();
1384
- if (type === "full" || !alt || alt !== reference) {
1385
- value += tracker.move(reference + "]");
1386
- } else if (type === "shortcut") {
1387
- value = value.slice(0, -1);
1388
- } else {
1389
- value += tracker.move("]");
1390
- }
1391
- return value;
1392
- }
1393
- __name(imageReference, "imageReference");
1394
- function imageReferencePeek() {
1395
- return "!";
1396
- }
1397
- __name(imageReferencePeek, "imageReferencePeek");
1398
-
1399
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
1400
- inlineCode.peek = inlineCodePeek;
1401
- function inlineCode(node, _, state) {
1402
- let value = node.value || "";
1403
- let sequence = "`";
1404
- let index = -1;
1405
- while (new RegExp("(^|[^`])" + sequence + "([^`]|$)").test(value)) {
1406
- sequence += "`";
1407
- }
1408
- if (/[^\n\r ]/.test(value) && (/^[\n\r ]/.test(value) && /[\n\r ]$/.test(value) || /^`|`$/.test(value))) {
1409
- value = " " + value + " ";
1410
- }
1411
- while (++index < state.unsafe.length) {
1412
- const pattern = state.unsafe[index];
1413
- const expression = state.compilePattern(pattern);
1414
- if (!pattern.atBreak) continue;
1415
- let match;
1416
- while (match = expression.exec(value)) {
1417
- let position = match.index;
1418
- if (value.charCodeAt(position) === 10 && value.charCodeAt(position - 1) === 13) {
1419
- position--;
1420
- }
1421
- value = value.slice(0, position) + " " + value.slice(match.index + 1);
1422
- }
1423
- }
1424
- return sequence + value + sequence;
1425
- }
1426
- __name(inlineCode, "inlineCode");
1427
- function inlineCodePeek() {
1428
- return "`";
1429
- }
1430
- __name(inlineCodePeek, "inlineCodePeek");
1431
-
1432
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
1433
- function formatLinkAsAutolink(node, state) {
1434
- const raw = toString(node);
1435
- return Boolean(
1436
- !state.options.resourceLink && // If there’s a url…
1437
- node.url && // And there’s no title…
1438
- !node.title && // And the content of `node` is a single text node…
1439
- node.children && node.children.length === 1 && node.children[0].type === "text" && // And if the url is the same as the content…
1440
- (raw === node.url || "mailto:" + raw === node.url) && // And that starts w/ a protocol…
1441
- /^[a-z][+\-.a-z]+:/i.test(node.url) && // And that doesn’t contain ASCII control codes (character escapes and
1442
- // references don’t work), space, or angle brackets…
1443
- !/[\0- <>\u007F]/.test(node.url)
1444
- );
1445
- }
1446
- __name(formatLinkAsAutolink, "formatLinkAsAutolink");
1447
-
1448
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link.js
1449
- link.peek = linkPeek;
1450
- function link(node, _, state, info) {
1451
- const quote = checkQuote(state);
1452
- const suffix = quote === '"' ? "Quote" : "Apostrophe";
1453
- const tracker = state.createTracker(info);
1454
- if (formatLinkAsAutolink(node, state)) {
1455
- const stack = state.stack;
1456
- state.stack = stack.filter(function(d) {
1457
- return d !== "phrasing";
1458
- });
1459
- const exit3 = state.enter("autolink");
1460
- let value2 = tracker.move("<");
1461
- value2 += tracker.move(
1462
- state.containerPhrasing(node, {
1463
- before: value2,
1464
- after: ">",
1465
- ...tracker.current()
1466
- })
1467
- );
1468
- value2 += tracker.move(">");
1469
- exit3();
1470
- state.stack = stack;
1471
- return value2;
1472
- }
1473
- const exit2 = state.enter("link");
1474
- let subexit = state.enter("label");
1475
- let value = tracker.move("[");
1476
- value += tracker.move(
1477
- state.containerPhrasing(node, {
1478
- before: value,
1479
- after: "](",
1480
- ...tracker.current()
1481
- })
1482
- );
1483
- value += tracker.move("](");
1484
- subexit();
1485
- if (
1486
- // If there’s no url but there is a title…
1487
- !node.url && node.title || // If there are control characters or whitespace.
1488
- /[\0- \u007F]/.test(node.url)
1489
- ) {
1490
- subexit = state.enter("destinationLiteral");
1491
- value += tracker.move("<");
1492
- value += tracker.move(
1493
- state.safe(node.url, { before: value, after: ">", ...tracker.current() })
1494
- );
1495
- value += tracker.move(">");
1496
- } else {
1497
- subexit = state.enter("destinationRaw");
1498
- value += tracker.move(
1499
- state.safe(node.url, {
1500
- before: value,
1501
- after: node.title ? " " : ")",
1502
- ...tracker.current()
1503
- })
1504
- );
1505
- }
1506
- subexit();
1507
- if (node.title) {
1508
- subexit = state.enter(`title${suffix}`);
1509
- value += tracker.move(" " + quote);
1510
- value += tracker.move(
1511
- state.safe(node.title, {
1512
- before: value,
1513
- after: quote,
1514
- ...tracker.current()
1515
- })
1516
- );
1517
- value += tracker.move(quote);
1518
- subexit();
1519
- }
1520
- value += tracker.move(")");
1521
- exit2();
1522
- return value;
1523
- }
1524
- __name(link, "link");
1525
- function linkPeek(node, _, state) {
1526
- return formatLinkAsAutolink(node, state) ? "<" : "[";
1527
- }
1528
- __name(linkPeek, "linkPeek");
1529
-
1530
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
1531
- linkReference.peek = linkReferencePeek;
1532
- function linkReference(node, _, state, info) {
1533
- const type = node.referenceType;
1534
- const exit2 = state.enter("linkReference");
1535
- let subexit = state.enter("label");
1536
- const tracker = state.createTracker(info);
1537
- let value = tracker.move("[");
1538
- const text2 = state.containerPhrasing(node, {
1539
- before: value,
1540
- after: "]",
1541
- ...tracker.current()
1542
- });
1543
- value += tracker.move(text2 + "][");
1544
- subexit();
1545
- const stack = state.stack;
1546
- state.stack = stack.filter(function(d) {
1547
- return d !== "phrasing";
1548
- });
1549
- subexit = state.enter("reference");
1550
- const reference = state.safe(state.associationId(node), {
1551
- before: value,
1552
- after: "]",
1553
- ...tracker.current()
1554
- });
1555
- subexit();
1556
- state.stack = stack;
1557
- exit2();
1558
- if (type === "full" || !text2 || text2 !== reference) {
1559
- value += tracker.move(reference + "]");
1560
- } else if (type === "shortcut") {
1561
- value = value.slice(0, -1);
1562
- } else {
1563
- value += tracker.move("]");
1564
- }
1565
- return value;
1566
- }
1567
- __name(linkReference, "linkReference");
1568
- function linkReferencePeek() {
1569
- return "[";
1570
- }
1571
- __name(linkReferencePeek, "linkReferencePeek");
1572
-
1573
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
1574
- function checkBullet(state) {
1575
- const marker = state.options.bullet || "*";
1576
- if (marker !== "*" && marker !== "+" && marker !== "-") {
1577
- throw new Error(
1578
- "Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`"
1579
- );
1580
- }
1581
- return marker;
1582
- }
1583
- __name(checkBullet, "checkBullet");
1584
-
1585
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
1586
- function checkBulletOther(state) {
1587
- const bullet = checkBullet(state);
1588
- const bulletOther = state.options.bulletOther;
1589
- if (!bulletOther) {
1590
- return bullet === "*" ? "-" : "*";
1591
- }
1592
- if (bulletOther !== "*" && bulletOther !== "+" && bulletOther !== "-") {
1593
- throw new Error(
1594
- "Cannot serialize items with `" + bulletOther + "` for `options.bulletOther`, expected `*`, `+`, or `-`"
1595
- );
1596
- }
1597
- if (bulletOther === bullet) {
1598
- throw new Error(
1599
- "Expected `bullet` (`" + bullet + "`) and `bulletOther` (`" + bulletOther + "`) to be different"
1600
- );
1601
- }
1602
- return bulletOther;
1603
- }
1604
- __name(checkBulletOther, "checkBulletOther");
1605
-
1606
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
1607
- function checkBulletOrdered(state) {
1608
- const marker = state.options.bulletOrdered || ".";
1609
- if (marker !== "." && marker !== ")") {
1610
- throw new Error(
1611
- "Cannot serialize items with `" + marker + "` for `options.bulletOrdered`, expected `.` or `)`"
1612
- );
1613
- }
1614
- return marker;
1615
- }
1616
- __name(checkBulletOrdered, "checkBulletOrdered");
1617
-
1618
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
1619
- function checkRule(state) {
1620
- const marker = state.options.rule || "*";
1621
- if (marker !== "*" && marker !== "-" && marker !== "_") {
1622
- throw new Error(
1623
- "Cannot serialize rules with `" + marker + "` for `options.rule`, expected `*`, `-`, or `_`"
1624
- );
1625
- }
1626
- return marker;
1627
- }
1628
- __name(checkRule, "checkRule");
1629
-
1630
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list.js
1631
- function list(node, parent, state, info) {
1632
- const exit2 = state.enter("list");
1633
- const bulletCurrent = state.bulletCurrent;
1634
- let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state);
1635
- const bulletOther = node.ordered ? bullet === "." ? ")" : "." : checkBulletOther(state);
1636
- let useDifferentMarker = parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false;
1637
- if (!node.ordered) {
1638
- const firstListItem = node.children ? node.children[0] : void 0;
1639
- if (
1640
- // Bullet could be used as a thematic break marker:
1641
- (bullet === "*" || bullet === "-") && // Empty first list item:
1642
- firstListItem && (!firstListItem.children || !firstListItem.children[0]) && // Directly in two other list items:
1643
- state.stack[state.stack.length - 1] === "list" && state.stack[state.stack.length - 2] === "listItem" && state.stack[state.stack.length - 3] === "list" && state.stack[state.stack.length - 4] === "listItem" && // That are each the first child.
1644
- state.indexStack[state.indexStack.length - 1] === 0 && state.indexStack[state.indexStack.length - 2] === 0 && state.indexStack[state.indexStack.length - 3] === 0
1645
- ) {
1646
- useDifferentMarker = true;
1647
- }
1648
- if (checkRule(state) === bullet && firstListItem) {
1649
- let index = -1;
1650
- while (++index < node.children.length) {
1651
- const item = node.children[index];
1652
- if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") {
1653
- useDifferentMarker = true;
1654
- break;
1655
- }
1656
- }
1657
- }
1658
- }
1659
- if (useDifferentMarker) {
1660
- bullet = bulletOther;
1661
- }
1662
- state.bulletCurrent = bullet;
1663
- const value = state.containerFlow(node, info);
1664
- state.bulletLastUsed = bullet;
1665
- state.bulletCurrent = bulletCurrent;
1666
- exit2();
1667
- return value;
1668
- }
1669
- __name(list, "list");
1670
-
1671
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
1672
- function checkListItemIndent(state) {
1673
- const style = state.options.listItemIndent || "one";
1674
- if (style !== "tab" && style !== "one" && style !== "mixed") {
1675
- throw new Error(
1676
- "Cannot serialize items with `" + style + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`"
1677
- );
1678
- }
1679
- return style;
1680
- }
1681
- __name(checkListItemIndent, "checkListItemIndent");
1682
-
1683
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
1684
- function listItem(node, parent, state, info) {
1685
- const listItemIndent = checkListItemIndent(state);
1686
- let bullet = state.bulletCurrent || checkBullet(state);
1687
- if (parent && parent.type === "list" && parent.ordered) {
1688
- bullet = (typeof parent.start === "number" && parent.start > -1 ? parent.start : 1) + (state.options.incrementListMarker === false ? 0 : parent.children.indexOf(node)) + bullet;
1689
- }
1690
- let size = bullet.length + 1;
1691
- if (listItemIndent === "tab" || listItemIndent === "mixed" && (parent && parent.type === "list" && parent.spread || node.spread)) {
1692
- size = Math.ceil(size / 4) * 4;
1693
- }
1694
- const tracker = state.createTracker(info);
1695
- tracker.move(bullet + " ".repeat(size - bullet.length));
1696
- tracker.shift(size);
1697
- const exit2 = state.enter("listItem");
1698
- const value = state.indentLines(
1699
- state.containerFlow(node, tracker.current()),
1700
- map3
1701
- );
1702
- exit2();
1703
- return value;
1704
- function map3(line, index, blank) {
1705
- if (index) {
1706
- return (blank ? "" : " ".repeat(size)) + line;
1707
- }
1708
- return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line;
1709
- }
1710
- __name(map3, "map");
1711
- }
1712
- __name(listItem, "listItem");
1713
-
1714
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
1715
- function paragraph(node, _, state, info) {
1716
- const exit2 = state.enter("paragraph");
1717
- const subexit = state.enter("phrasing");
1718
- const value = state.containerPhrasing(node, info);
1719
- subexit();
1720
- exit2();
1721
- return value;
1722
- }
1723
- __name(paragraph, "paragraph");
1724
-
1725
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/root.js
1726
- function root(node, _, state, info) {
1727
- const hasPhrasing = node.children.some(function(d) {
1728
- return phrasing(d);
1729
- });
1730
- if (!hasPhrasing) return state.containerFlow(node, info);
1731
- const exit2 = state.enter("phrasing");
1732
- const value = state.containerPhrasing(node, info);
1733
- exit2();
1734
- return value;
1735
- }
1736
- __name(root, "root");
1737
-
1738
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
1739
- function checkStrong(state) {
1740
- const marker = state.options.strong || "*";
1741
- if (marker !== "*" && marker !== "_") {
1742
- throw new Error(
1743
- "Cannot serialize strong with `" + marker + "` for `options.strong`, expected `*`, or `_`"
1744
- );
1745
- }
1746
- return marker;
1747
- }
1748
- __name(checkStrong, "checkStrong");
1749
-
1750
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/strong.js
1751
- strong.attention = attention2;
1752
- strong.peek = peek2;
1753
- function strong(node, _, state, info) {
1754
- const exit2 = state.enter("phrasing");
1755
- const value = state.containerPhrasing({ type: "root", children: [node] }, info);
1756
- exit2();
1757
- return value;
1758
- }
1759
- __name(strong, "strong");
1760
- function attention2(_, state) {
1761
- const marker = checkStrong(state);
1762
- return {
1763
- construct: "strong",
1764
- markers: marker === "*" ? ["*", "_"] : ["_", "*"],
1765
- sizes: [2]
1766
- };
1767
- }
1768
- __name(attention2, "attention");
1769
- function peek2(_, _1, state) {
1770
- return state.options.strong || "*";
1771
- }
1772
- __name(peek2, "peek");
1773
-
1774
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/text.js
1775
- function text(node, parent, state, info) {
1776
- const siblings = parent ? parent.children : [];
1777
- const index = siblings.indexOf(node);
1778
- return state.safe(node.value, {
1779
- ...info,
1780
- afterNode: siblings[index + 1],
1781
- beforeNode: siblings[index - 1]
1782
- });
1783
- }
1784
- __name(text, "text");
1785
-
1786
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
1787
- function checkRuleRepetition(state) {
1788
- const repetition = state.options.ruleRepetition || 3;
1789
- if (repetition < 3) {
1790
- throw new Error(
1791
- "Cannot serialize rules with repetition `" + repetition + "` for `options.ruleRepetition`, expected `3` or more"
1792
- );
1793
- }
1794
- return repetition;
1795
- }
1796
- __name(checkRuleRepetition, "checkRuleRepetition");
1797
-
1798
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
1799
- function thematicBreak(_, _1, state) {
1800
- const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
1801
- return state.options.ruleSpaces ? value.slice(0, -1) : value;
1802
- }
1803
- __name(thematicBreak, "thematicBreak");
1804
-
1805
- // node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/index.js
1806
- var handle = {
1807
- blockquote,
1808
- break: hardBreak,
1809
- code,
1810
- definition,
1811
- emphasis,
1812
- hardBreak,
1813
- heading,
1814
- html,
1815
- image,
1816
- imageReference,
1817
- inlineCode,
1818
- link,
1819
- linkReference,
1820
- list,
1821
- listItem,
1822
- paragraph,
1823
- root,
1824
- strong,
1825
- text,
1826
- thematicBreak
1827
- };
1828
-
1829
- // node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.js
1830
- function gfmTableFromMarkdown() {
1831
- return {
1832
- enter: {
1833
- table: enterTable,
1834
- tableData: enterCell,
1835
- tableHeader: enterCell,
1836
- tableRow: enterRow
1837
- },
1838
- exit: {
1839
- codeText: exitCodeText,
1840
- table: exitTable,
1841
- tableData: exit,
1842
- tableHeader: exit,
1843
- tableRow: exit
1844
- }
1845
- };
1846
- }
1847
- __name(gfmTableFromMarkdown, "gfmTableFromMarkdown");
1848
- function enterTable(token) {
1849
- const align = token._align;
1850
- ok(align, "expected `_align` on table");
1851
- this.enter(
1852
- {
1853
- type: "table",
1854
- align: align.map(function(d) {
1855
- return d === "none" ? null : d;
1856
- }),
1857
- children: []
1858
- },
1859
- token
1860
- );
1861
- this.data.inTable = true;
1862
- }
1863
- __name(enterTable, "enterTable");
1864
- function exitTable(token) {
1865
- this.exit(token);
1866
- this.data.inTable = void 0;
1867
- }
1868
- __name(exitTable, "exitTable");
1869
- function enterRow(token) {
1870
- this.enter({ type: "tableRow", children: [] }, token);
1871
- }
1872
- __name(enterRow, "enterRow");
1873
- function exit(token) {
1874
- this.exit(token);
1875
- }
1876
- __name(exit, "exit");
1877
- function enterCell(token) {
1878
- this.enter({ type: "tableCell", children: [] }, token);
1879
- }
1880
- __name(enterCell, "enterCell");
1881
- function exitCodeText(token) {
1882
- let value = this.resume();
1883
- if (this.data.inTable) {
1884
- value = value.replace(/\\([\\|])/g, replace);
1885
- }
1886
- const node = this.stack[this.stack.length - 1];
1887
- ok(node.type === "inlineCode");
1888
- node.value = value;
1889
- this.exit(token);
1890
- }
1891
- __name(exitCodeText, "exitCodeText");
1892
- function replace($0, $1) {
1893
- return $1 === "|" ? $1 : $0;
1894
- }
1895
- __name(replace, "replace");
1896
- function gfmTableToMarkdown(options) {
1897
- const settings = options || {};
1898
- const padding = settings.tableCellPadding;
1899
- const alignDelimiters = settings.tablePipeAlign;
1900
- const stringLength = settings.stringLength;
1901
- const around = padding ? " " : "|";
1902
- return {
1903
- unsafe: [
1904
- { character: "\r", inConstruct: "tableCell" },
1905
- { character: "\n", inConstruct: "tableCell" },
1906
- // A pipe, when followed by a tab or space (padding), or a dash or colon
1907
- // (unpadded delimiter row), could result in a table.
1908
- { atBreak: true, character: "|", after: "[ :-]" },
1909
- // A pipe in a cell must be encoded.
1910
- { character: "|", inConstruct: "tableCell" },
1911
- // A colon must be followed by a dash, in which case it could start a
1912
- // delimiter row.
1913
- { atBreak: true, character: ":", after: "-" },
1914
- // A delimiter row can also start with a dash, when followed by more
1915
- // dashes, a colon, or a pipe.
1916
- // This is a stricter version than the built in check for lists, thematic
1917
- // breaks, and setex heading underlines though:
1918
- // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>
1919
- { atBreak: true, character: "-", after: "[:|-]" }
1920
- ],
1921
- handlers: {
1922
- inlineCode: inlineCodeWithTable,
1923
- table: handleTable,
1924
- tableCell: handleTableCell,
1925
- tableRow: handleTableRow
1926
- }
1927
- };
1928
- function handleTable(node, _, state, info) {
1929
- return serializeData(handleTableAsData(node, state, info), node.align);
1930
- }
1931
- __name(handleTable, "handleTable");
1932
- function handleTableRow(node, _, state, info) {
1933
- const row = handleTableRowAsData(node, state, info);
1934
- const value = serializeData([row]);
1935
- return value.slice(0, value.indexOf("\n"));
1936
- }
1937
- __name(handleTableRow, "handleTableRow");
1938
- function handleTableCell(node, _, state, info) {
1939
- const exit2 = state.enter("tableCell");
1940
- const subexit = state.enter("phrasing");
1941
- const value = state.containerPhrasing(node, {
1942
- ...info,
1943
- before: around,
1944
- after: around
1945
- });
1946
- subexit();
1947
- exit2();
1948
- return value;
1949
- }
1950
- __name(handleTableCell, "handleTableCell");
1951
- function serializeData(matrix, align) {
1952
- return markdownTable(matrix, {
1953
- align,
1954
- // @ts-expect-error: `markdown-table` types should support `null`.
1955
- alignDelimiters,
1956
- // @ts-expect-error: `markdown-table` types should support `null`.
1957
- padding,
1958
- // @ts-expect-error: `markdown-table` types should support `null`.
1959
- stringLength
1960
- });
1961
- }
1962
- __name(serializeData, "serializeData");
1963
- function handleTableAsData(node, state, info) {
1964
- const children = node.children;
1965
- let index = -1;
1966
- const result = [];
1967
- const subexit = state.enter("table");
1968
- while (++index < children.length) {
1969
- result[index] = handleTableRowAsData(children[index], state, info);
1970
- }
1971
- subexit();
1972
- return result;
1973
- }
1974
- __name(handleTableAsData, "handleTableAsData");
1975
- function handleTableRowAsData(node, state, info) {
1976
- const children = node.children;
1977
- let index = -1;
1978
- const result = [];
1979
- const subexit = state.enter("tableRow");
1980
- while (++index < children.length) {
1981
- result[index] = handleTableCell(children[index], node, state, info);
1982
- }
1983
- subexit();
1984
- return result;
1985
- }
1986
- __name(handleTableRowAsData, "handleTableRowAsData");
1987
- function inlineCodeWithTable(node, parent, state) {
1988
- let value = handle.inlineCode(node, parent, state);
1989
- if (state.stack.includes("tableCell")) {
1990
- value = value.replace(/\|/g, "\\$&");
1991
- }
1992
- return value;
1993
- }
1994
- __name(inlineCodeWithTable, "inlineCodeWithTable");
1995
- }
1996
- __name(gfmTableToMarkdown, "gfmTableToMarkdown");
1997
-
1998
- // node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0/node_modules/mdast-util-gfm-task-list-item/lib/index.js
1999
- function gfmTaskListItemFromMarkdown() {
2000
- return {
2001
- exit: {
2002
- taskListCheckValueChecked: exitCheck,
2003
- taskListCheckValueUnchecked: exitCheck,
2004
- paragraph: exitParagraphWithTaskListItem
2005
- }
2006
- };
2007
- }
2008
- __name(gfmTaskListItemFromMarkdown, "gfmTaskListItemFromMarkdown");
2009
- function gfmTaskListItemToMarkdown() {
2010
- return {
2011
- unsafe: [{ atBreak: true, character: "-", after: "[:|-]" }],
2012
- handlers: { listItem: listItemWithTaskListItem }
2013
- };
2014
- }
2015
- __name(gfmTaskListItemToMarkdown, "gfmTaskListItemToMarkdown");
2016
- function exitCheck(token) {
2017
- const node = this.stack[this.stack.length - 2];
2018
- ok(node.type === "listItem");
2019
- node.checked = token.type === "taskListCheckValueChecked";
2020
- }
2021
- __name(exitCheck, "exitCheck");
2022
- function exitParagraphWithTaskListItem(token) {
2023
- const parent = this.stack[this.stack.length - 2];
2024
- if (parent && parent.type === "listItem" && typeof parent.checked === "boolean") {
2025
- const node = this.stack[this.stack.length - 1];
2026
- ok(node.type === "paragraph");
2027
- const head = node.children[0];
2028
- if (head && head.type === "text") {
2029
- const siblings = parent.children;
2030
- let index = -1;
2031
- let firstParaghraph;
2032
- while (++index < siblings.length) {
2033
- const sibling = siblings[index];
2034
- if (sibling.type === "paragraph") {
2035
- firstParaghraph = sibling;
2036
- break;
2037
- }
2038
- }
2039
- if (firstParaghraph === node) {
2040
- head.value = head.value.slice(1);
2041
- if (head.value.length === 0) {
2042
- node.children.shift();
2043
- } else if (node.position && head.position && typeof head.position.start.offset === "number") {
2044
- head.position.start.column++;
2045
- head.position.start.offset++;
2046
- node.position.start = Object.assign({}, head.position.start);
2047
- }
2048
- }
2049
- }
2050
- }
2051
- this.exit(token);
2052
- }
2053
- __name(exitParagraphWithTaskListItem, "exitParagraphWithTaskListItem");
2054
- function listItemWithTaskListItem(node, parent, state, info) {
2055
- const head = node.children[0];
2056
- const checkable = typeof node.checked === "boolean" && head && head.type === "paragraph";
2057
- const checkbox = "[" + (node.checked ? "x" : " ") + "] ";
2058
- const tracker = state.createTracker(info);
2059
- if (checkable) {
2060
- tracker.move(checkbox);
2061
- }
2062
- let value = handle.listItem(node, parent, state, {
2063
- ...info,
2064
- ...tracker.current()
2065
- });
2066
- if (checkable) {
2067
- value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check);
2068
- }
2069
- return value;
2070
- function check($0) {
2071
- return $0 + checkbox;
2072
- }
2073
- __name(check, "check");
2074
- }
2075
- __name(listItemWithTaskListItem, "listItemWithTaskListItem");
2076
-
2077
- // node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules/mdast-util-gfm/lib/index.js
2078
- function gfmFromMarkdown() {
2079
- return [
2080
- gfmAutolinkLiteralFromMarkdown(),
2081
- gfmFootnoteFromMarkdown(),
2082
- gfmStrikethroughFromMarkdown(),
2083
- gfmTableFromMarkdown(),
2084
- gfmTaskListItemFromMarkdown()
2085
- ];
2086
- }
2087
- __name(gfmFromMarkdown, "gfmFromMarkdown");
2088
- function gfmToMarkdown(options) {
2089
- return {
2090
- extensions: [
2091
- gfmAutolinkLiteralToMarkdown(),
2092
- gfmFootnoteToMarkdown(options),
2093
- gfmStrikethroughToMarkdown(),
2094
- gfmTableToMarkdown(options),
2095
- gfmTaskListItemToMarkdown()
2096
- ]
2097
- };
2098
- }
2099
- __name(gfmToMarkdown, "gfmToMarkdown");
2100
- export {
2101
- gfmFromMarkdown,
2102
- gfmToMarkdown
2103
- };