@wirecat/wordpress-cli 0.0.0-stage → 0.1.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 (256) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +204 -0
  3. package/README.md +248 -2
  4. package/contracts/wirecat.json +2535 -0
  5. package/dist/bin/wordpress.d.ts +3 -0
  6. package/dist/bin/wordpress.d.ts.map +1 -0
  7. package/dist/bin/wordpress.js +40 -0
  8. package/dist/bin/wordpress.js.map +1 -0
  9. package/dist/bundle/agent-LKBRYKNB.js +37 -0
  10. package/dist/bundle/all-profiles-OEV7VFQG.js +320 -0
  11. package/dist/bundle/anthropic-JKTZP2DW.js +91 -0
  12. package/dist/bundle/app-server-7LWLDDE2.js +249 -0
  13. package/dist/bundle/bun-2FLR4IV4.js +169 -0
  14. package/dist/bundle/bun-sqlite-GRSRX5P4.js +76 -0
  15. package/dist/bundle/chunk-2BI25SEE.js +259 -0
  16. package/dist/bundle/chunk-2UEGJ5AJ.js +52 -0
  17. package/dist/bundle/chunk-2XUV7HNE.js +58 -0
  18. package/dist/bundle/chunk-2Z7UOXFC.js +16 -0
  19. package/dist/bundle/chunk-3BM6KBWP.js +2788 -0
  20. package/dist/bundle/chunk-3BRAZVHR.js +1010 -0
  21. package/dist/bundle/chunk-3LMW7U7F.js +1233 -0
  22. package/dist/bundle/chunk-3LVTQFGB.js +2000 -0
  23. package/dist/bundle/chunk-3TKFFSFU.js +106 -0
  24. package/dist/bundle/chunk-3UX4VJWD.js +78 -0
  25. package/dist/bundle/chunk-4HEXAGKT.js +334 -0
  26. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  27. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  28. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  29. package/dist/bundle/chunk-5XPHFV7H.js +2333 -0
  30. package/dist/bundle/chunk-5Z3P543G.js +80 -0
  31. package/dist/bundle/chunk-6UYDKCV6.js +794 -0
  32. package/dist/bundle/chunk-7GNB4LBX.js +50 -0
  33. package/dist/bundle/chunk-7HJFBOAT.js +161 -0
  34. package/dist/bundle/chunk-7JVKQ6NM.js +206 -0
  35. package/dist/bundle/chunk-7QH5BZUG.js +142 -0
  36. package/dist/bundle/chunk-A474OVIW.js +1392 -0
  37. package/dist/bundle/chunk-AENEMQL3.js +1068 -0
  38. package/dist/bundle/chunk-AL7I4DT4.js +65718 -0
  39. package/dist/bundle/chunk-ARGRGTPX.js +108 -0
  40. package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
  41. package/dist/bundle/chunk-BAXNAOOL.js +76 -0
  42. package/dist/bundle/chunk-BH63B66W.js +407 -0
  43. package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
  44. package/dist/bundle/chunk-CFQQTDSA.js +46 -0
  45. package/dist/bundle/chunk-CGCUOT67.js +388 -0
  46. package/dist/bundle/chunk-CHPWBQUK.js +39 -0
  47. package/dist/bundle/chunk-D72URWJE.js +532 -0
  48. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  49. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  50. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  51. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  52. package/dist/bundle/chunk-EHW45LLT.js +100 -0
  53. package/dist/bundle/chunk-F3AV5ZSL.js +338 -0
  54. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  55. package/dist/bundle/chunk-F5ZAN7OC.js +6848 -0
  56. package/dist/bundle/chunk-FMMYBVCH.js +38 -0
  57. package/dist/bundle/chunk-FNB4SWTY.js +66 -0
  58. package/dist/bundle/chunk-FQROWBKV.js +12660 -0
  59. package/dist/bundle/chunk-FV2HJOSC.js +771 -0
  60. package/dist/bundle/chunk-GCAJW4SR.js +53 -0
  61. package/dist/bundle/chunk-GPRJXJC7.js +102 -0
  62. package/dist/bundle/chunk-HCOZUOSN.js +54 -0
  63. package/dist/bundle/chunk-HM6AMYHR.js +72 -0
  64. package/dist/bundle/chunk-HVXOA4FO.js +23 -0
  65. package/dist/bundle/chunk-HWQ7572G.js +95 -0
  66. package/dist/bundle/chunk-IJVTN5L3.js +82 -0
  67. package/dist/bundle/chunk-IZDDBOHU.js +3610 -0
  68. package/dist/bundle/chunk-JAE5B4G7.js +388 -0
  69. package/dist/bundle/chunk-K2Y5K37O.js +218 -0
  70. package/dist/bundle/chunk-KCH224US.js +9581 -0
  71. package/dist/bundle/chunk-KZJQPJK5.js +230 -0
  72. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  73. package/dist/bundle/chunk-LECMHK2F.js +18 -0
  74. package/dist/bundle/chunk-LWEMZJLG.js +1332 -0
  75. package/dist/bundle/chunk-LWTETL2O.js +185 -0
  76. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  77. package/dist/bundle/chunk-MJ6LTG4L.js +170 -0
  78. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  79. package/dist/bundle/chunk-ODVGFCBE.js +557 -0
  80. package/dist/bundle/chunk-OEQNP56V.js +633 -0
  81. package/dist/bundle/chunk-OV6WQY3L.js +39 -0
  82. package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
  83. package/dist/bundle/chunk-PPNTY7LD.js +733 -0
  84. package/dist/bundle/chunk-PRZYRA66.js +358 -0
  85. package/dist/bundle/chunk-PV5UYGRJ.js +41594 -0
  86. package/dist/bundle/chunk-QYTOLPNI.js +52 -0
  87. package/dist/bundle/chunk-R7Y3XU66.js +362 -0
  88. package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
  89. package/dist/bundle/chunk-SD5CXGIG.js +188 -0
  90. package/dist/bundle/chunk-SXY5G62I.js +288 -0
  91. package/dist/bundle/chunk-T37TAXVL.js +29 -0
  92. package/dist/bundle/chunk-T5SOY3AE.js +1197 -0
  93. package/dist/bundle/chunk-TJ7OORSO.js +1876 -0
  94. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  95. package/dist/bundle/chunk-U6VLNYCO.js +73 -0
  96. package/dist/bundle/chunk-UC7JLE6J.js +58 -0
  97. package/dist/bundle/chunk-UUIOAZPH.js +156 -0
  98. package/dist/bundle/chunk-UXQ24OY6.js +4072 -0
  99. package/dist/bundle/chunk-VBRRMGON.js +1007 -0
  100. package/dist/bundle/chunk-VRIBES2C.js +319 -0
  101. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  102. package/dist/bundle/chunk-XT5XYQEZ.js +3414 -0
  103. package/dist/bundle/chunk-XTAS5Z3G.js +2231 -0
  104. package/dist/bundle/chunk-XYQVVW4R.js +24 -0
  105. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  106. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  107. package/dist/bundle/chunk-YUDVRFXN.js +63 -0
  108. package/dist/bundle/chunk-Z3I2MCUT.js +131 -0
  109. package/dist/bundle/chunk-ZDI3WC7V.js +353 -0
  110. package/dist/bundle/chunk-ZVQ7KFMT.js +274 -0
  111. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  112. package/dist/bundle/command-contract-P7YE4EKS.js +37 -0
  113. package/dist/bundle/command-server-entry-XIMCBWMV.js +166 -0
  114. package/dist/bundle/decode-6XK55WYV.js +297 -0
  115. package/dist/bundle/definitions-GIQCGYPR.js +7986 -0
  116. package/dist/bundle/dispatch-JQBAZWCL.js +411 -0
  117. package/dist/bundle/dist-2TV3NVE5.js +7577 -0
  118. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  119. package/dist/bundle/echarts-YRRVLEX3.js +42501 -0
  120. package/dist/bundle/embed-L3EEQSGX.js +38 -0
  121. package/dist/bundle/embedder-BIKLBV3J.js +111 -0
  122. package/dist/bundle/failure-I6AAF5R5.js +25 -0
  123. package/dist/bundle/first-run-W6G6TYZ2.js +29 -0
  124. package/dist/bundle/first-screen-ITIAJIBU.js +37 -0
  125. package/dist/bundle/hast-util-from-html-ZHU6HGIE.js +10531 -0
  126. package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
  127. package/dist/bundle/hast-util-to-mdast-D62XX3NR.js +2272 -0
  128. package/dist/bundle/instructions-AG7SRWTR.js +11 -0
  129. package/dist/bundle/mcp-YGOAUNC3.js +167 -0
  130. package/dist/bundle/mdast-util-from-markdown-WVUJDSUO.js +1900 -0
  131. package/dist/bundle/mdast-util-gfm-KN2D32QS.js +1040 -0
  132. package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
  133. package/dist/bundle/mdast-util-to-markdown-UCAJNHJO.js +18 -0
  134. package/dist/bundle/meeting-combined-CQJ3JHHU.js +24 -0
  135. package/dist/bundle/meeting-model-MZ7VVBNK.js +25 -0
  136. package/dist/bundle/meeting-semantic-DADWRRHP.js +22 -0
  137. package/dist/bundle/micromark-extension-gfm-EEJRRJ36.js +1771 -0
  138. package/dist/bundle/node-GJQYN4FT.js +176 -0
  139. package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
  140. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  141. package/dist/bundle/node-sqlite-TPR62DT2.js +74 -0
  142. package/dist/bundle/oauth-WGY7JQVW.js +20 -0
  143. package/dist/bundle/open-DE7QZNAN.js +23 -0
  144. package/dist/bundle/openai-NHEFT3HS.js +238 -0
  145. package/dist/bundle/process-MEKCZMX3.js +91 -0
  146. package/dist/bundle/program-EP2S5BTM.js +38857 -0
  147. package/dist/bundle/prompt-PWY53BYH.js +17 -0
  148. package/dist/bundle/recognize-74TXHKMQ.js +26 -0
  149. package/dist/bundle/remote-F5TJZ5ER.js +31 -0
  150. package/dist/bundle/rerank-HWUO52UF.js +52 -0
  151. package/dist/bundle/schemas-4K6WWS5N.js +2157 -0
  152. package/dist/bundle/serve-I2USUY4X.js +199 -0
  153. package/dist/bundle/server-GDYDNO6K.js +79 -0
  154. package/dist/bundle/server-KYUW2AHB.js +212 -0
  155. package/dist/bundle/sqlite-runtime-N6VFGBJK.js +20 -0
  156. package/dist/bundle/state-L6JSCN77.js +36 -0
  157. package/dist/bundle/store-EPG2YPN3.js +291 -0
  158. package/dist/bundle/store-SQWQJE32.js +181 -0
  159. package/dist/bundle/store-maintenance-command-FTGSICVA.js +66 -0
  160. package/dist/bundle/surface-SNMHY6GP.js +65 -0
  161. package/dist/bundle/wordpress.js +183 -0
  162. package/dist/commands/api.d.ts +22 -0
  163. package/dist/commands/api.d.ts.map +1 -0
  164. package/dist/commands/api.js +37 -0
  165. package/dist/commands/api.js.map +1 -0
  166. package/dist/commands/content.d.ts +4 -0
  167. package/dist/commands/content.d.ts.map +1 -0
  168. package/dist/commands/content.js +94 -0
  169. package/dist/commands/content.js.map +1 -0
  170. package/dist/commands/session.d.ts +8 -0
  171. package/dist/commands/session.d.ts.map +1 -0
  172. package/dist/commands/session.js +28 -0
  173. package/dist/commands/session.js.map +1 -0
  174. package/dist/config.d.ts +13 -0
  175. package/dist/config.d.ts.map +1 -0
  176. package/dist/config.js +69 -0
  177. package/dist/config.js.map +1 -0
  178. package/dist/context.d.ts +37 -0
  179. package/dist/context.d.ts.map +1 -0
  180. package/dist/context.js +31 -0
  181. package/dist/context.js.map +1 -0
  182. package/dist/generated/definitions.d.ts +3 -0
  183. package/dist/generated/definitions.d.ts.map +1 -0
  184. package/dist/generated/definitions.js +7982 -0
  185. package/dist/generated/definitions.js.map +1 -0
  186. package/dist/generated/manifest.d.ts +6 -0
  187. package/dist/generated/manifest.d.ts.map +1 -0
  188. package/dist/generated/manifest.js +8830 -0
  189. package/dist/generated/manifest.js.map +1 -0
  190. package/dist/generated/schemas.d.ts +229 -0
  191. package/dist/generated/schemas.d.ts.map +1 -0
  192. package/dist/generated/schemas.js +2019 -0
  193. package/dist/generated/schemas.js.map +1 -0
  194. package/dist/generated/types.d.ts +3365 -0
  195. package/dist/generated/types.d.ts.map +1 -0
  196. package/dist/generated/types.js +5 -0
  197. package/dist/generated/types.js.map +1 -0
  198. package/dist/generated/wirecat-config.d.ts +11 -0
  199. package/dist/generated/wirecat-config.d.ts.map +1 -0
  200. package/dist/generated/wirecat-config.js +337 -0
  201. package/dist/generated/wirecat-config.js.map +1 -0
  202. package/dist/identity.d.ts +28 -0
  203. package/dist/identity.d.ts.map +1 -0
  204. package/dist/identity.js +29 -0
  205. package/dist/identity.js.map +1 -0
  206. package/dist/index.d.ts +3 -0
  207. package/dist/index.d.ts.map +1 -0
  208. package/dist/index.js +3 -0
  209. package/dist/index.js.map +1 -0
  210. package/dist/program.d.ts +6 -0
  211. package/dist/program.d.ts.map +1 -0
  212. package/dist/program.js +53 -0
  213. package/dist/program.js.map +1 -0
  214. package/dist/version.d.ts +2 -0
  215. package/dist/version.d.ts.map +1 -0
  216. package/dist/version.js +2 -0
  217. package/dist/version.js.map +1 -0
  218. package/dist/wcat.d.ts +3 -0
  219. package/dist/wcat.d.ts.map +1 -0
  220. package/dist/wcat.js +4 -0
  221. package/dist/wcat.js.map +1 -0
  222. package/package.json +87 -4
  223. package/skills/wordpress-cli/SKILL.md +88 -0
  224. package/skills/wordpress-cli/references/api/api-block-directory.md +17 -0
  225. package/skills/wordpress-cli/references/api/api-block-patterns.md +13 -0
  226. package/skills/wordpress-cli/references/api/api-block-types.md +34 -0
  227. package/skills/wordpress-cli/references/api/api-blocks.md +159 -0
  228. package/skills/wordpress-cli/references/api/api-categories.md +69 -0
  229. package/skills/wordpress-cli/references/api/api-comments.md +79 -0
  230. package/skills/wordpress-cli/references/api/api-font-collections.md +16 -0
  231. package/skills/wordpress-cli/references/api/api-font-families.md +122 -0
  232. package/skills/wordpress-cli/references/api/api-global-styles.md +29 -0
  233. package/skills/wordpress-cli/references/api/api-media.md +106 -0
  234. package/skills/wordpress-cli/references/api/api-menu-items.md +115 -0
  235. package/skills/wordpress-cli/references/api/api-menu-locations.md +22 -0
  236. package/skills/wordpress-cli/references/api/api-menus.md +69 -0
  237. package/skills/wordpress-cli/references/api/api-navigation.md +155 -0
  238. package/skills/wordpress-cli/references/api/api-pages.md +161 -0
  239. package/skills/wordpress-cli/references/api/api-pattern-directory.md +23 -0
  240. package/skills/wordpress-cli/references/api/api-plugins.md +25 -0
  241. package/skills/wordpress-cli/references/api/api-posts.md +166 -0
  242. package/skills/wordpress-cli/references/api/api-search.md +21 -0
  243. package/skills/wordpress-cli/references/api/api-settings.md +19 -0
  244. package/skills/wordpress-cli/references/api/api-sidebars.md +34 -0
  245. package/skills/wordpress-cli/references/api/api-statuses.md +22 -0
  246. package/skills/wordpress-cli/references/api/api-tags.md +69 -0
  247. package/skills/wordpress-cli/references/api/api-taxonomies.md +23 -0
  248. package/skills/wordpress-cli/references/api/api-template-parts.md +38 -0
  249. package/skills/wordpress-cli/references/api/api-templates.md +38 -0
  250. package/skills/wordpress-cli/references/api/api-themes.md +12 -0
  251. package/skills/wordpress-cli/references/api/api-types.md +22 -0
  252. package/skills/wordpress-cli/references/api/api-users.md +149 -0
  253. package/skills/wordpress-cli/references/api/api-widget-types.md +46 -0
  254. package/skills/wordpress-cli/references/api/api-widgets.md +57 -0
  255. package/skills/wordpress-cli/references/api/api-wp-pattern-category.md +69 -0
  256. package/skills/wordpress-cli/references/api.md +44 -0
@@ -0,0 +1,1040 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ normalizeIdentifier
5
+ } from "./chunk-F4BX7TH2.js";
6
+ import {
7
+ ccount
8
+ } from "./chunk-MEYYH47C.js";
9
+ import {
10
+ ok
11
+ } from "./chunk-ECYOTDJM.js";
12
+ import {
13
+ handle
14
+ } from "./chunk-TJ7OORSO.js";
15
+ import "./chunk-QYTOLPNI.js";
16
+ import "./chunk-XTAS5Z3G.js";
17
+ import {
18
+ unicodePunctuation,
19
+ unicodeWhitespace
20
+ } from "./chunk-UC7JLE6J.js";
21
+ import "./chunk-4HP6KGBI.js";
22
+ import "./chunk-NMQRSEZM.js";
23
+ import {
24
+ toString
25
+ } from "./chunk-XFLCVHSQ.js";
26
+ import {
27
+ EXIT,
28
+ SKIP,
29
+ convert,
30
+ visit,
31
+ visitParents
32
+ } from "./chunk-TRYYWV7J.js";
33
+ import {
34
+ __name
35
+ } from "./chunk-ZVVMGPBJ.js";
36
+
37
+ // node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js
38
+ function escapeStringRegexp(string) {
39
+ if (typeof string !== "string") {
40
+ throw new TypeError("Expected a string");
41
+ }
42
+ return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
43
+ }
44
+ __name(escapeStringRegexp, "escapeStringRegexp");
45
+
46
+ // node_modules/.pnpm/mdast-util-find-and-replace@3.0.4/node_modules/mdast-util-find-and-replace/lib/index.js
47
+ function findAndReplace(tree, list, options) {
48
+ const settings = options || {};
49
+ const ignored = convert(settings.ignore || []);
50
+ const pairs = toPairs(list);
51
+ let pairIndex = -1;
52
+ while (++pairIndex < pairs.length) {
53
+ visitParents(tree, visitor);
54
+ }
55
+ function visitor(node, parents, index) {
56
+ if (node.type === "text" && typeof index === "number") {
57
+ return handler(node, parents, index);
58
+ }
59
+ if (ignored(node, index, parents[parents.length - 1])) return SKIP;
60
+ }
61
+ __name(visitor, "visitor");
62
+ function handler(node, parents, index) {
63
+ const parent = parents[parents.length - 1];
64
+ const find = pairs[pairIndex][0];
65
+ const replace2 = pairs[pairIndex][1];
66
+ let start = 0;
67
+ let change = false;
68
+ let nodes = [];
69
+ find.lastIndex = 0;
70
+ let match = find.exec(node.value);
71
+ while (match) {
72
+ const position = match.index;
73
+ const matchObject = {
74
+ index: match.index,
75
+ input: match.input,
76
+ stack: [...parents, node]
77
+ };
78
+ let value = replace2(...match, matchObject);
79
+ if (typeof value === "string") {
80
+ value = value.length > 0 ? { type: "text", value } : void 0;
81
+ }
82
+ if (value === false) {
83
+ find.lastIndex = position + 1;
84
+ } else {
85
+ if (start !== position) {
86
+ add({ type: "text", value: node.value.slice(start, position) });
87
+ }
88
+ if (Array.isArray(value)) {
89
+ for (const child of value) add(child);
90
+ } else if (value) {
91
+ add(value);
92
+ }
93
+ start = position + match[0].length;
94
+ change = true;
95
+ }
96
+ if (!find.global) {
97
+ break;
98
+ }
99
+ match = find.exec(node.value);
100
+ }
101
+ if (change) {
102
+ if (start < node.value.length) {
103
+ add({ type: "text", value: node.value.slice(start) });
104
+ }
105
+ parent.children.splice(index, 1, ...nodes);
106
+ } else {
107
+ nodes = [node];
108
+ }
109
+ return index + nodes.length;
110
+ function add(child) {
111
+ const previous2 = nodes[nodes.length - 1];
112
+ if (previous2 && previous2.type === "text" && child.type === "text") {
113
+ previous2.value += child.value;
114
+ } else {
115
+ nodes.push(child);
116
+ }
117
+ }
118
+ __name(add, "add");
119
+ }
120
+ __name(handler, "handler");
121
+ }
122
+ __name(findAndReplace, "findAndReplace");
123
+ function toPairs(tupleOrList) {
124
+ if (!Array.isArray(tupleOrList)) {
125
+ throw new TypeError("Expected find and replace tuple or list of tuples");
126
+ }
127
+ const result = [];
128
+ const list = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? (
129
+ /** @type {FindAndReplaceList} */
130
+ tupleOrList
131
+ ) : [
132
+ /** @type {FindAndReplaceTuple} */
133
+ tupleOrList
134
+ ];
135
+ let index = -1;
136
+ while (++index < list.length) {
137
+ const tuple = list[index];
138
+ result.push([toExpression(tuple[0]), toFunction(tuple[1])]);
139
+ }
140
+ return result;
141
+ }
142
+ __name(toPairs, "toPairs");
143
+ function toExpression(find) {
144
+ return typeof find === "string" ? new RegExp(escapeStringRegexp(find), "g") : find;
145
+ }
146
+ __name(toExpression, "toExpression");
147
+ function toFunction(replace2) {
148
+ return typeof replace2 === "function" ? replace2 : function() {
149
+ return replace2;
150
+ };
151
+ }
152
+ __name(toFunction, "toFunction");
153
+
154
+ // node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.1.0/node_modules/mdast-util-gfm-autolink-literal/lib/index.js
155
+ var inConstruct = "phrasing";
156
+ var notInConstruct = ["autolink", "link", "image", "label"];
157
+ function gfmAutolinkLiteralFromMarkdown() {
158
+ return {
159
+ transforms: [transformGfmAutolinkLiterals],
160
+ enter: {
161
+ literalAutolink: enterLiteralAutolink,
162
+ literalAutolinkEmail: enterLiteralAutolinkValue,
163
+ literalAutolinkHttp: enterLiteralAutolinkValue,
164
+ literalAutolinkWww: enterLiteralAutolinkValue
165
+ },
166
+ exit: {
167
+ literalAutolink: exitLiteralAutolink,
168
+ literalAutolinkEmail: exitLiteralAutolinkEmail,
169
+ literalAutolinkHttp: exitLiteralAutolinkHttp,
170
+ literalAutolinkWww: exitLiteralAutolinkWww
171
+ }
172
+ };
173
+ }
174
+ __name(gfmAutolinkLiteralFromMarkdown, "gfmAutolinkLiteralFromMarkdown");
175
+ function gfmAutolinkLiteralToMarkdown() {
176
+ return {
177
+ unsafe: [
178
+ {
179
+ character: "@",
180
+ before: "[+\\-.\\w]",
181
+ after: "[\\-.\\w]",
182
+ inConstruct,
183
+ notInConstruct
184
+ },
185
+ {
186
+ character: ".",
187
+ before: "[Ww]",
188
+ after: "[\\-.\\w]",
189
+ inConstruct,
190
+ notInConstruct
191
+ },
192
+ {
193
+ character: ":",
194
+ before: "[ps]",
195
+ after: "\\/",
196
+ inConstruct,
197
+ notInConstruct
198
+ }
199
+ ]
200
+ };
201
+ }
202
+ __name(gfmAutolinkLiteralToMarkdown, "gfmAutolinkLiteralToMarkdown");
203
+ function enterLiteralAutolink(token) {
204
+ this.enter(
205
+ { type: "link", title: null, url: "", children: [], position: void 0 },
206
+ token
207
+ );
208
+ }
209
+ __name(enterLiteralAutolink, "enterLiteralAutolink");
210
+ function enterLiteralAutolinkValue(token) {
211
+ this.config.enter.autolinkProtocol.call(this, token);
212
+ }
213
+ __name(enterLiteralAutolinkValue, "enterLiteralAutolinkValue");
214
+ function exitLiteralAutolinkHttp(token) {
215
+ this.config.exit.autolinkProtocol.call(this, token);
216
+ }
217
+ __name(exitLiteralAutolinkHttp, "exitLiteralAutolinkHttp");
218
+ function exitLiteralAutolinkWww(token) {
219
+ this.config.exit.data.call(this, token);
220
+ const node = this.stack[this.stack.length - 1];
221
+ ok(node.type === "link");
222
+ node.url = "http://" + this.sliceSerialize(token);
223
+ }
224
+ __name(exitLiteralAutolinkWww, "exitLiteralAutolinkWww");
225
+ function exitLiteralAutolinkEmail(token) {
226
+ this.config.exit.autolinkEmail.call(this, token);
227
+ }
228
+ __name(exitLiteralAutolinkEmail, "exitLiteralAutolinkEmail");
229
+ function exitLiteralAutolink(token) {
230
+ this.exit(token);
231
+ }
232
+ __name(exitLiteralAutolink, "exitLiteralAutolink");
233
+ function transformGfmAutolinkLiterals(tree) {
234
+ findAndReplace(
235
+ tree,
236
+ [
237
+ [
238
+ /(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,
239
+ findUrl
240
+ ],
241
+ [
242
+ /(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,
243
+ findXmpp
244
+ ],
245
+ [/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g, findMailto],
246
+ [
247
+ /(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,
248
+ findEmail
249
+ ]
250
+ ],
251
+ { ignore: ["link", "linkReference"] }
252
+ );
253
+ }
254
+ __name(transformGfmAutolinkLiterals, "transformGfmAutolinkLiterals");
255
+ function findUrl(_, protocol, domain, path, match) {
256
+ if (!previous(match)) {
257
+ return false;
258
+ }
259
+ let prefix = "";
260
+ if (/^w/i.test(protocol)) {
261
+ domain = protocol + domain;
262
+ protocol = "";
263
+ prefix = "http://";
264
+ }
265
+ if (unicodePunctuation(domain.charCodeAt(0)) || !isCorrectDomain(domain)) {
266
+ return false;
267
+ }
268
+ const parts = splitUrl(domain + path);
269
+ const result = {
270
+ type: "link",
271
+ title: null,
272
+ url: prefix + protocol + parts[0],
273
+ children: [{ type: "text", value: protocol + parts[0], position: void 0 }],
274
+ position: void 0
275
+ };
276
+ if (parts[1]) {
277
+ return [result, { type: "text", value: parts[1], position: void 0 }];
278
+ }
279
+ return result;
280
+ }
281
+ __name(findUrl, "findUrl");
282
+ function findEmail(_, atext, label) {
283
+ if (/[\d\-_]$/.test(label)) {
284
+ return false;
285
+ }
286
+ return {
287
+ type: "link",
288
+ title: null,
289
+ url: "mailto:" + atext + "@" + label,
290
+ children: [{ type: "text", value: atext + "@" + label, position: void 0 }],
291
+ position: void 0
292
+ };
293
+ }
294
+ __name(findEmail, "findEmail");
295
+ function findMailto(_, atext, label) {
296
+ if (/[\d\-_]$/.test(label)) {
297
+ return false;
298
+ }
299
+ const value = "mailto:" + atext + "@" + label;
300
+ return {
301
+ type: "link",
302
+ title: null,
303
+ url: value,
304
+ children: [{ type: "text", value, position: void 0 }],
305
+ position: void 0
306
+ };
307
+ }
308
+ __name(findMailto, "findMailto");
309
+ function findXmpp(matchValue, atext, label, resource, match) {
310
+ if (/[\d\-_]$/.test(label) || resource && (!/[A-Za-z]$/.test(resource) || match.input.charAt(match.index + matchValue.length) === "@")) {
311
+ return false;
312
+ }
313
+ const value = "xmpp:" + atext + "@" + label + (resource || "");
314
+ return {
315
+ type: "link",
316
+ title: null,
317
+ url: value,
318
+ children: [{ type: "text", value, position: void 0 }],
319
+ position: void 0
320
+ };
321
+ }
322
+ __name(findXmpp, "findXmpp");
323
+ function isCorrectDomain(domain) {
324
+ const parts = domain.split(".");
325
+ if (parts.length < 2 || parts[parts.length - 1] && (/_/.test(parts[parts.length - 1]) || !/[\dA-Za-z]/.test(parts[parts.length - 1])) || parts[parts.length - 2] && (/_/.test(parts[parts.length - 2]) || !/[\dA-Za-z]/.test(parts[parts.length - 2]))) {
326
+ return false;
327
+ }
328
+ return true;
329
+ }
330
+ __name(isCorrectDomain, "isCorrectDomain");
331
+ function splitUrl(url) {
332
+ let index = url.length;
333
+ while (index > 0) {
334
+ const code = url.charCodeAt(index - 1);
335
+ if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 62 || code === 63 || code === 93 || code === 125) {
336
+ index--;
337
+ } else {
338
+ break;
339
+ }
340
+ }
341
+ if (index === url.length) {
342
+ return [url, void 0];
343
+ }
344
+ let trail = url.slice(index);
345
+ url = url.slice(0, index);
346
+ let closingParenIndex = trail.indexOf(")");
347
+ const openingParens = ccount(url, "(");
348
+ let closingParens = ccount(url, ")");
349
+ while (closingParenIndex !== -1 && openingParens > closingParens) {
350
+ url += trail.slice(0, closingParenIndex + 1);
351
+ trail = trail.slice(closingParenIndex + 1);
352
+ closingParenIndex = trail.indexOf(")");
353
+ closingParens++;
354
+ }
355
+ return [url, trail];
356
+ }
357
+ __name(splitUrl, "splitUrl");
358
+ function previous(match) {
359
+ const code = match.input.charCodeAt(match.index - 1);
360
+ return match.index === 0 || unicodeWhitespace(code) || unicodePunctuation(code);
361
+ }
362
+ __name(previous, "previous");
363
+
364
+ // node_modules/.pnpm/mdast-util-gfm-footnote@2.1.0/node_modules/mdast-util-gfm-footnote/lib/index.js
365
+ footnoteReference.peek = footnoteReferencePeek;
366
+ function enterFootnoteCallString() {
367
+ this.buffer();
368
+ }
369
+ __name(enterFootnoteCallString, "enterFootnoteCallString");
370
+ function enterFootnoteCall(token) {
371
+ this.enter({ type: "footnoteReference", identifier: "", label: "" }, token);
372
+ }
373
+ __name(enterFootnoteCall, "enterFootnoteCall");
374
+ function enterFootnoteDefinitionLabelString() {
375
+ this.buffer();
376
+ }
377
+ __name(enterFootnoteDefinitionLabelString, "enterFootnoteDefinitionLabelString");
378
+ function enterFootnoteDefinition(token) {
379
+ this.enter(
380
+ { type: "footnoteDefinition", identifier: "", label: "", children: [] },
381
+ token
382
+ );
383
+ }
384
+ __name(enterFootnoteDefinition, "enterFootnoteDefinition");
385
+ function exitFootnoteCallString(token) {
386
+ const label = this.resume();
387
+ const node = this.stack[this.stack.length - 1];
388
+ ok(node.type === "footnoteReference");
389
+ node.identifier = normalizeIdentifier(
390
+ this.sliceSerialize(token)
391
+ ).toLowerCase();
392
+ node.label = label;
393
+ }
394
+ __name(exitFootnoteCallString, "exitFootnoteCallString");
395
+ function exitFootnoteCall(token) {
396
+ this.exit(token);
397
+ }
398
+ __name(exitFootnoteCall, "exitFootnoteCall");
399
+ function exitFootnoteDefinitionLabelString(token) {
400
+ const label = this.resume();
401
+ const node = this.stack[this.stack.length - 1];
402
+ ok(node.type === "footnoteDefinition");
403
+ node.identifier = normalizeIdentifier(
404
+ this.sliceSerialize(token)
405
+ ).toLowerCase();
406
+ node.label = label;
407
+ }
408
+ __name(exitFootnoteDefinitionLabelString, "exitFootnoteDefinitionLabelString");
409
+ function exitFootnoteDefinition(token) {
410
+ this.exit(token);
411
+ }
412
+ __name(exitFootnoteDefinition, "exitFootnoteDefinition");
413
+ function footnoteReferencePeek() {
414
+ return "[";
415
+ }
416
+ __name(footnoteReferencePeek, "footnoteReferencePeek");
417
+ function footnoteReference(node, _, state, info) {
418
+ const tracker = state.createTracker(info);
419
+ let value = tracker.move("[^");
420
+ const exit2 = state.enter("footnoteReference");
421
+ const subexit = state.enter("reference");
422
+ value += tracker.move(
423
+ state.safe(state.associationId(node), { after: "]", before: value })
424
+ );
425
+ subexit();
426
+ exit2();
427
+ value += tracker.move("]");
428
+ return value;
429
+ }
430
+ __name(footnoteReference, "footnoteReference");
431
+ function gfmFootnoteFromMarkdown() {
432
+ return {
433
+ enter: {
434
+ gfmFootnoteCallString: enterFootnoteCallString,
435
+ gfmFootnoteCall: enterFootnoteCall,
436
+ gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,
437
+ gfmFootnoteDefinition: enterFootnoteDefinition
438
+ },
439
+ exit: {
440
+ gfmFootnoteCallString: exitFootnoteCallString,
441
+ gfmFootnoteCall: exitFootnoteCall,
442
+ gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,
443
+ gfmFootnoteDefinition: exitFootnoteDefinition
444
+ }
445
+ };
446
+ }
447
+ __name(gfmFootnoteFromMarkdown, "gfmFootnoteFromMarkdown");
448
+ function gfmFootnoteToMarkdown(options) {
449
+ let firstLineBlank = false;
450
+ if (options && options.firstLineBlank) {
451
+ firstLineBlank = true;
452
+ }
453
+ return {
454
+ handlers: { footnoteDefinition, footnoteReference },
455
+ // This is on by default already.
456
+ unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
457
+ };
458
+ function footnoteDefinition(node, _, state, info) {
459
+ const tracker = state.createTracker(info);
460
+ let value = tracker.move("[^");
461
+ const exit2 = state.enter("footnoteDefinition");
462
+ const subexit = state.enter("label");
463
+ value += tracker.move(
464
+ state.safe(state.associationId(node), { before: value, after: "]" })
465
+ );
466
+ subexit();
467
+ value += tracker.move("]:");
468
+ if (node.children && node.children.length > 0) {
469
+ tracker.shift(4);
470
+ value += tracker.move(
471
+ (firstLineBlank ? "\n" : " ") + state.indentLines(
472
+ state.containerFlow(node, tracker.current()),
473
+ firstLineBlank ? mapAll : mapExceptFirst
474
+ )
475
+ );
476
+ }
477
+ exit2();
478
+ return value;
479
+ }
480
+ __name(footnoteDefinition, "footnoteDefinition");
481
+ }
482
+ __name(gfmFootnoteToMarkdown, "gfmFootnoteToMarkdown");
483
+ function mapExceptFirst(line, index, blank) {
484
+ return index === 0 ? line : mapAll(line, index, blank);
485
+ }
486
+ __name(mapExceptFirst, "mapExceptFirst");
487
+ function mapAll(line, index, blank) {
488
+ return (blank ? "" : " ") + line;
489
+ }
490
+ __name(mapAll, "mapAll");
491
+
492
+ // node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.1/node_modules/mdast-util-gfm-strikethrough/lib/index.js
493
+ var constructsWithoutStrikethrough = [
494
+ "autolink",
495
+ "destinationLiteral",
496
+ "destinationRaw",
497
+ "reference",
498
+ "titleQuote",
499
+ "titleApostrophe"
500
+ ];
501
+ handleDelete.attention = attentionDelete;
502
+ handleDelete.peek = peekDelete;
503
+ function gfmStrikethroughFromMarkdown() {
504
+ return {
505
+ canContainEols: ["delete"],
506
+ enter: { strikethrough: enterStrikethrough },
507
+ exit: { strikethrough: exitStrikethrough }
508
+ };
509
+ }
510
+ __name(gfmStrikethroughFromMarkdown, "gfmStrikethroughFromMarkdown");
511
+ function gfmStrikethroughToMarkdown() {
512
+ return {
513
+ handlers: { delete: handleDelete },
514
+ unsafe: [
515
+ {
516
+ character: "~",
517
+ inConstruct: "phrasing",
518
+ notInConstruct: constructsWithoutStrikethrough
519
+ }
520
+ ]
521
+ };
522
+ }
523
+ __name(gfmStrikethroughToMarkdown, "gfmStrikethroughToMarkdown");
524
+ function enterStrikethrough(token) {
525
+ this.enter({ type: "delete", children: [], position: void 0 }, token);
526
+ }
527
+ __name(enterStrikethrough, "enterStrikethrough");
528
+ function exitStrikethrough(token) {
529
+ this.exit(token);
530
+ }
531
+ __name(exitStrikethrough, "exitStrikethrough");
532
+ function handleDelete(node, _, state, info) {
533
+ const tracker = state.createTracker(info);
534
+ const sequence = state.stack.includes("strikethrough") ? "~" : "~~";
535
+ const exit2 = state.enter("strikethrough");
536
+ let value = tracker.move(sequence);
537
+ value += state.containerPhrasing(node, {
538
+ ...tracker.current(),
539
+ before: value,
540
+ after: "~"
541
+ });
542
+ value += tracker.move(sequence);
543
+ exit2();
544
+ return value;
545
+ }
546
+ __name(handleDelete, "handleDelete");
547
+ function attentionDelete() {
548
+ return { construct: "strikethrough", markers: ["~"], sizes: [2, 1] };
549
+ }
550
+ __name(attentionDelete, "attentionDelete");
551
+ function peekDelete() {
552
+ return "~";
553
+ }
554
+ __name(peekDelete, "peekDelete");
555
+
556
+ // node_modules/.pnpm/markdown-table@3.1.0/node_modules/markdown-table/index.js
557
+ function defaultStringLength(value) {
558
+ return value.length;
559
+ }
560
+ __name(defaultStringLength, "defaultStringLength");
561
+ function markdownTable(table, options) {
562
+ const settings = options || {};
563
+ const align = (settings.align || []).concat();
564
+ const stringLength = settings.stringLength || defaultStringLength;
565
+ const alignments = [];
566
+ const cellMatrix = [];
567
+ const sizeMatrix = [];
568
+ const longestCellByColumn = [];
569
+ let mostCellsPerRow = 0;
570
+ let rowIndex = -1;
571
+ while (++rowIndex < table.length) {
572
+ const row2 = [];
573
+ const sizes2 = [];
574
+ let columnIndex2 = -1;
575
+ if (table[rowIndex].length > mostCellsPerRow) {
576
+ mostCellsPerRow = table[rowIndex].length;
577
+ }
578
+ while (++columnIndex2 < table[rowIndex].length) {
579
+ const cell = serialize(table[rowIndex][columnIndex2]);
580
+ if (settings.alignDelimiters !== false) {
581
+ const size = stringLength(cell);
582
+ sizes2[columnIndex2] = size;
583
+ if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) {
584
+ longestCellByColumn[columnIndex2] = size;
585
+ }
586
+ }
587
+ row2.push(cell);
588
+ }
589
+ cellMatrix[rowIndex] = row2;
590
+ sizeMatrix[rowIndex] = sizes2;
591
+ }
592
+ let columnIndex = -1;
593
+ if (typeof align === "object" && "length" in align) {
594
+ while (++columnIndex < mostCellsPerRow) {
595
+ alignments[columnIndex] = toAlignment(align[columnIndex]);
596
+ }
597
+ } else {
598
+ const code = toAlignment(align);
599
+ while (++columnIndex < mostCellsPerRow) {
600
+ alignments[columnIndex] = code;
601
+ }
602
+ }
603
+ columnIndex = -1;
604
+ const row = [];
605
+ const sizes = [];
606
+ while (++columnIndex < mostCellsPerRow) {
607
+ const code = alignments[columnIndex];
608
+ let before = "";
609
+ let after = "";
610
+ if (code === 99) {
611
+ before = ":";
612
+ after = ":";
613
+ } else if (code === 108) {
614
+ before = ":";
615
+ } else if (code === 114) {
616
+ after = ":";
617
+ }
618
+ let size = settings.alignDelimiters === false ? 1 : Math.max(
619
+ 1,
620
+ longestCellByColumn[columnIndex] - before.length - after.length
621
+ );
622
+ const cell = before + "-".repeat(size) + after;
623
+ if (settings.alignDelimiters !== false) {
624
+ size = before.length + size + after.length;
625
+ if (size > longestCellByColumn[columnIndex]) {
626
+ longestCellByColumn[columnIndex] = size;
627
+ }
628
+ sizes[columnIndex] = size;
629
+ }
630
+ row[columnIndex] = cell;
631
+ }
632
+ cellMatrix.splice(1, 0, row);
633
+ sizeMatrix.splice(1, 0, sizes);
634
+ rowIndex = -1;
635
+ const lines = [];
636
+ while (++rowIndex < cellMatrix.length) {
637
+ const row2 = cellMatrix[rowIndex];
638
+ const sizes2 = sizeMatrix[rowIndex];
639
+ const cellsInRow = settings.fillRows === false ? Math.max(1, cellMatrix[rowIndex === 1 ? 0 : rowIndex].length) : mostCellsPerRow;
640
+ columnIndex = -1;
641
+ const line = [];
642
+ while (++columnIndex < cellsInRow) {
643
+ const cell = row2[columnIndex] || "";
644
+ let before = "";
645
+ let after = "";
646
+ if (settings.alignDelimiters !== false) {
647
+ const size = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0);
648
+ const code = alignments[columnIndex];
649
+ if (code === 114) {
650
+ before = " ".repeat(size);
651
+ } else if (code === 99) {
652
+ const half = size / 2;
653
+ if (size % 2) {
654
+ before = " ".repeat(half + 0.5);
655
+ after = " ".repeat(half - 0.5);
656
+ } else {
657
+ before = " ".repeat(half);
658
+ after = before;
659
+ }
660
+ } else {
661
+ after = " ".repeat(size);
662
+ }
663
+ }
664
+ if (settings.delimiterStart !== false && !columnIndex) {
665
+ line.push("|");
666
+ }
667
+ if (settings.padding !== false && // Don’t add the opening space if we’re not aligning and the cell is
668
+ // empty: there will be a closing space.
669
+ !(settings.alignDelimiters === false && cell === "") && (settings.delimiterStart !== false || columnIndex)) {
670
+ line.push(" ");
671
+ }
672
+ if (settings.alignDelimiters !== false) {
673
+ line.push(before);
674
+ }
675
+ line.push(cell);
676
+ if (settings.alignDelimiters !== false) {
677
+ line.push(after);
678
+ }
679
+ if (settings.padding !== false) {
680
+ line.push(" ");
681
+ }
682
+ if (settings.delimiterEnd !== false || columnIndex !== cellsInRow - 1) {
683
+ line.push("|");
684
+ }
685
+ }
686
+ lines.push(
687
+ settings.delimiterEnd === false ? line.join("").replace(/ +$/, "") : line.join("")
688
+ );
689
+ }
690
+ return lines.join("\n");
691
+ }
692
+ __name(markdownTable, "markdownTable");
693
+ function serialize(value) {
694
+ return value === null || value === void 0 ? "" : String(value);
695
+ }
696
+ __name(serialize, "serialize");
697
+ function toAlignment(value) {
698
+ const code = typeof value === "string" ? value.codePointAt(0) : 0;
699
+ return code === 67 || code === 99 ? 99 : code === 76 || code === 108 ? 108 : code === 82 || code === 114 ? 114 : 0;
700
+ }
701
+ __name(toAlignment, "toAlignment");
702
+
703
+ // node_modules/.pnpm/mdast-util-gfm-table@2.0.1/node_modules/mdast-util-gfm-table/lib/index.js
704
+ function gfmTableFromMarkdown() {
705
+ return {
706
+ enter: {
707
+ table: enterTable,
708
+ tableData: enterCell,
709
+ tableHeader: enterCell,
710
+ tableRow: enterRow
711
+ },
712
+ exit: {
713
+ codeText: exitCodeText,
714
+ table: exitTable,
715
+ tableData: exit,
716
+ tableHeader: exit,
717
+ tableRow: exit
718
+ }
719
+ };
720
+ }
721
+ __name(gfmTableFromMarkdown, "gfmTableFromMarkdown");
722
+ function enterTable(token) {
723
+ const align = token._align;
724
+ ok(align, "expected `_align` on table");
725
+ this.enter(
726
+ {
727
+ type: "table",
728
+ align: align.map(function(d) {
729
+ return d === "none" ? null : d;
730
+ }),
731
+ children: [],
732
+ position: void 0
733
+ },
734
+ token
735
+ );
736
+ this.data.inTable = true;
737
+ }
738
+ __name(enterTable, "enterTable");
739
+ function exitTable(token) {
740
+ this.exit(token);
741
+ this.data.inTable = void 0;
742
+ }
743
+ __name(exitTable, "exitTable");
744
+ function enterRow(token) {
745
+ this.enter({ type: "tableRow", children: [], position: void 0 }, token);
746
+ }
747
+ __name(enterRow, "enterRow");
748
+ function exit(token) {
749
+ this.exit(token);
750
+ }
751
+ __name(exit, "exit");
752
+ function enterCell(token) {
753
+ this.enter({ type: "tableCell", children: [], position: void 0 }, token);
754
+ }
755
+ __name(enterCell, "enterCell");
756
+ function exitCodeText(token) {
757
+ let value = this.resume();
758
+ if (this.data.inTable) {
759
+ value = value.replace(/\\([\\|])/g, replace);
760
+ }
761
+ const node = this.stack[this.stack.length - 1];
762
+ ok(node.type === "inlineCode");
763
+ node.value = value;
764
+ this.exit(token);
765
+ }
766
+ __name(exitCodeText, "exitCodeText");
767
+ function replace($0, $1) {
768
+ return $1 === "|" ? $1 : $0;
769
+ }
770
+ __name(replace, "replace");
771
+ function gfmTableToMarkdown(options) {
772
+ const settings = options || {};
773
+ const {
774
+ tableCellPadding: padding,
775
+ tablePipeAlign: alignDelimiters,
776
+ stringLength
777
+ } = settings;
778
+ const around = padding ? " " : "|";
779
+ return {
780
+ handlers: {
781
+ inlineCode: inlineCodeWithTable,
782
+ table: handleTable,
783
+ tableCell: handleTableCell,
784
+ tableRow: handleTableRow
785
+ },
786
+ join: [joinTable],
787
+ unsafe: [
788
+ { character: "\r", inConstruct: "tableCell" },
789
+ { character: "\n", inConstruct: "tableCell" },
790
+ // A pipe, when followed by a tab or space (padding), or a dash or colon
791
+ // (unpadded delimiter row), could result in a table.
792
+ { atBreak: true, character: "|", after: "[ :-]" },
793
+ // A pipe in a cell must be encoded.
794
+ { character: "|", inConstruct: "tableCell" },
795
+ // A colon must be followed by a dash, in which case it could start a
796
+ // delimiter row.
797
+ { atBreak: true, character: ":", after: "-" },
798
+ // A delimiter row can also start with a dash, when followed by more
799
+ // dashes, a colon, or a pipe.
800
+ // This is a stricter version than the built in check for lists, thematic
801
+ // breaks, and setex heading underlines though:
802
+ // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>
803
+ { atBreak: true, character: "-", after: "[:|-]" }
804
+ ]
805
+ };
806
+ function handleTable(node, _, state, info) {
807
+ const matrix = handleTableAsData(node, state, info);
808
+ const head = matrix[0];
809
+ if (head) {
810
+ let columns = node.align ? node.align.length : 0;
811
+ let index = -1;
812
+ if (!columns) {
813
+ while (++index < matrix.length) {
814
+ if (matrix[index].length > columns) columns = matrix[index].length;
815
+ }
816
+ }
817
+ while (head.length < columns) head.push("");
818
+ }
819
+ return serializeData(matrix, node.align);
820
+ }
821
+ __name(handleTable, "handleTable");
822
+ function handleTableRow(node, _, state, info) {
823
+ const row = handleTableRowAsData(node, state, info);
824
+ const value = serializeData([row]);
825
+ return value.slice(0, value.indexOf("\n"));
826
+ }
827
+ __name(handleTableRow, "handleTableRow");
828
+ function handleTableCell(node, _, state, info) {
829
+ const exit2 = state.enter("tableCell");
830
+ const subexit = state.enter("phrasing");
831
+ const value = state.containerPhrasing(node, {
832
+ ...info,
833
+ before: around,
834
+ after: around
835
+ });
836
+ subexit();
837
+ exit2();
838
+ return value;
839
+ }
840
+ __name(handleTableCell, "handleTableCell");
841
+ function serializeData(matrix, align) {
842
+ return markdownTable(matrix, {
843
+ align,
844
+ alignDelimiters,
845
+ fillRows: false,
846
+ padding,
847
+ stringLength
848
+ });
849
+ }
850
+ __name(serializeData, "serializeData");
851
+ function handleTableAsData(node, state, info) {
852
+ const { children } = node;
853
+ let index = -1;
854
+ const result = [];
855
+ const subexit = state.enter("table");
856
+ while (++index < children.length) {
857
+ result[index] = handleTableRowAsData(children[index], state, info);
858
+ }
859
+ subexit();
860
+ return result;
861
+ }
862
+ __name(handleTableAsData, "handleTableAsData");
863
+ function handleTableRowAsData(node, state, info) {
864
+ const { children } = node;
865
+ let index = -1;
866
+ const result = [];
867
+ const subexit = state.enter("tableRow");
868
+ while (++index < children.length) {
869
+ result[index] = handleTableCell(children[index], node, state, info);
870
+ }
871
+ subexit();
872
+ return result;
873
+ }
874
+ __name(handleTableRowAsData, "handleTableRowAsData");
875
+ function inlineCodeWithTable(node, parent, state) {
876
+ const value = handle.inlineCode(node, parent, state);
877
+ if (!state.stack.includes("tableCell")) return value;
878
+ const result = [];
879
+ let start = 0;
880
+ let index = value.indexOf("|");
881
+ while (index !== -1) {
882
+ let before = index;
883
+ while (before > start && value.charCodeAt(before - 1) === 92) {
884
+ before--;
885
+ }
886
+ result.push(value.slice(start, index));
887
+ if ((index - before) % 2 === 0) result.push("\\");
888
+ start = index;
889
+ index = value.indexOf("|", index + 1);
890
+ }
891
+ result.push(value.slice(start));
892
+ return result.join("");
893
+ }
894
+ __name(inlineCodeWithTable, "inlineCodeWithTable");
895
+ }
896
+ __name(gfmTableToMarkdown, "gfmTableToMarkdown");
897
+ function joinTable(left, right, parent, state) {
898
+ if (left.type === "table" && parent.type === "listItem" && parent.spread === false && (right.type === "definition" || right.type === "heading" && formatHeadingAsSetext(right, state) || right.type === "paragraph" || right.type === "table")) {
899
+ return 1;
900
+ }
901
+ }
902
+ __name(joinTable, "joinTable");
903
+ function formatHeadingAsSetext(node, state) {
904
+ let literalWithBreak = false;
905
+ visit(node, function(node2) {
906
+ if (node2.type === "break" || "value" in node2 && /\r?\n|\r/.test(node2.value)) {
907
+ literalWithBreak = true;
908
+ return EXIT;
909
+ }
910
+ });
911
+ return Boolean(
912
+ (!node.depth || node.depth < 3) && toString(node) && (state.options.setext || literalWithBreak)
913
+ );
914
+ }
915
+ __name(formatHeadingAsSetext, "formatHeadingAsSetext");
916
+
917
+ // node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.1/node_modules/mdast-util-gfm-task-list-item/lib/index.js
918
+ function gfmTaskListItemFromMarkdown() {
919
+ return {
920
+ exit: {
921
+ taskListCheckValueChecked: exitCheck,
922
+ taskListCheckValueUnchecked: exitCheck,
923
+ paragraph: exitParagraphWithTaskListItem
924
+ }
925
+ };
926
+ }
927
+ __name(gfmTaskListItemFromMarkdown, "gfmTaskListItemFromMarkdown");
928
+ function gfmTaskListItemToMarkdown() {
929
+ return {
930
+ handlers: { paragraph: paragraphWithTaskListItem },
931
+ join: [joinDefinitionsBeforeTaskListItemParagraph]
932
+ };
933
+ }
934
+ __name(gfmTaskListItemToMarkdown, "gfmTaskListItemToMarkdown");
935
+ function exitCheck(token) {
936
+ const node = this.stack[this.stack.length - 2];
937
+ ok(node.type === "listItem");
938
+ node.checked = token.type === "taskListCheckValueChecked";
939
+ }
940
+ __name(exitCheck, "exitCheck");
941
+ function exitParagraphWithTaskListItem(token) {
942
+ const parent = this.stack[this.stack.length - 2];
943
+ if (parent && parent.type === "listItem" && typeof parent.checked === "boolean") {
944
+ const node = this.stack[this.stack.length - 1];
945
+ ok(node.type === "paragraph");
946
+ const head = node.children[0];
947
+ if (head && head.type === "text") {
948
+ const siblings = parent.children;
949
+ let index = -1;
950
+ let firstParagraph;
951
+ while (++index < siblings.length) {
952
+ const sibling = siblings[index];
953
+ if (sibling.type === "paragraph") {
954
+ firstParagraph = sibling;
955
+ break;
956
+ }
957
+ }
958
+ if (firstParagraph === node) {
959
+ head.value = head.value.slice(1);
960
+ if (head.value.length === 0) {
961
+ node.children.shift();
962
+ } else if (node.position && head.position && typeof head.position.start.offset === "number") {
963
+ head.position.start.column++;
964
+ head.position.start.offset++;
965
+ node.position.start = { ...head.position.start };
966
+ }
967
+ }
968
+ }
969
+ }
970
+ this.exit(token);
971
+ }
972
+ __name(exitParagraphWithTaskListItem, "exitParagraphWithTaskListItem");
973
+ function paragraphWithTaskListItem(node, parent, state, info) {
974
+ if (!parent || parent.type !== "listItem" || taskListItemParagraph(parent) !== node) {
975
+ return handle.paragraph(node, parent, state, info);
976
+ }
977
+ const checkbox = "[" + (parent.checked ? "x" : " ") + "] ";
978
+ const tracker = state.createTracker(info);
979
+ tracker.move(checkbox);
980
+ const value = handle.paragraph(
981
+ node.children.length > 0 ? node : { type: "paragraph", children: [{ type: "text", value: " " }] },
982
+ parent,
983
+ state,
984
+ { ...info, ...tracker.current() }
985
+ );
986
+ return checkbox + value;
987
+ }
988
+ __name(paragraphWithTaskListItem, "paragraphWithTaskListItem");
989
+ function joinDefinitionsBeforeTaskListItemParagraph(left, _, parent) {
990
+ if (!(left.type === "definition" && parent.type === "listItem")) {
991
+ return;
992
+ }
993
+ const paragraph = taskListItemParagraph(parent);
994
+ if (paragraph && parent.children.indexOf(left) < parent.children.indexOf(paragraph)) {
995
+ return 0;
996
+ }
997
+ }
998
+ __name(joinDefinitionsBeforeTaskListItemParagraph, "joinDefinitionsBeforeTaskListItemParagraph");
999
+ function taskListItemParagraph(node) {
1000
+ if (typeof node.checked !== "boolean") {
1001
+ return;
1002
+ }
1003
+ for (const child of node.children) {
1004
+ if (child.type === "paragraph") {
1005
+ return child;
1006
+ }
1007
+ if (child.type !== "definition") {
1008
+ return;
1009
+ }
1010
+ }
1011
+ }
1012
+ __name(taskListItemParagraph, "taskListItemParagraph");
1013
+
1014
+ // node_modules/.pnpm/mdast-util-gfm@3.1.0/node_modules/mdast-util-gfm/lib/index.js
1015
+ function gfmFromMarkdown() {
1016
+ return [
1017
+ gfmAutolinkLiteralFromMarkdown(),
1018
+ gfmFootnoteFromMarkdown(),
1019
+ gfmStrikethroughFromMarkdown(),
1020
+ gfmTableFromMarkdown(),
1021
+ gfmTaskListItemFromMarkdown()
1022
+ ];
1023
+ }
1024
+ __name(gfmFromMarkdown, "gfmFromMarkdown");
1025
+ function gfmToMarkdown(options) {
1026
+ return {
1027
+ extensions: [
1028
+ gfmAutolinkLiteralToMarkdown(),
1029
+ gfmFootnoteToMarkdown(options),
1030
+ gfmStrikethroughToMarkdown(),
1031
+ gfmTableToMarkdown(options),
1032
+ gfmTaskListItemToMarkdown()
1033
+ ]
1034
+ };
1035
+ }
1036
+ __name(gfmToMarkdown, "gfmToMarkdown");
1037
+ export {
1038
+ gfmFromMarkdown,
1039
+ gfmToMarkdown
1040
+ };