@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.
- package/CHANGELOG.md +27 -0
- package/LICENSE +204 -0
- package/README.md +248 -2
- package/contracts/wirecat.json +2535 -0
- package/dist/bin/wordpress.d.ts +3 -0
- package/dist/bin/wordpress.d.ts.map +1 -0
- package/dist/bin/wordpress.js +40 -0
- package/dist/bin/wordpress.js.map +1 -0
- package/dist/bundle/agent-LKBRYKNB.js +37 -0
- package/dist/bundle/all-profiles-OEV7VFQG.js +320 -0
- package/dist/bundle/anthropic-JKTZP2DW.js +91 -0
- package/dist/bundle/app-server-7LWLDDE2.js +249 -0
- package/dist/bundle/bun-2FLR4IV4.js +169 -0
- package/dist/bundle/bun-sqlite-GRSRX5P4.js +76 -0
- package/dist/bundle/chunk-2BI25SEE.js +259 -0
- package/dist/bundle/chunk-2UEGJ5AJ.js +52 -0
- package/dist/bundle/chunk-2XUV7HNE.js +58 -0
- package/dist/bundle/chunk-2Z7UOXFC.js +16 -0
- package/dist/bundle/chunk-3BM6KBWP.js +2788 -0
- package/dist/bundle/chunk-3BRAZVHR.js +1010 -0
- package/dist/bundle/chunk-3LMW7U7F.js +1233 -0
- package/dist/bundle/chunk-3LVTQFGB.js +2000 -0
- package/dist/bundle/chunk-3TKFFSFU.js +106 -0
- package/dist/bundle/chunk-3UX4VJWD.js +78 -0
- package/dist/bundle/chunk-4HEXAGKT.js +334 -0
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/chunk-5XPHFV7H.js +2333 -0
- package/dist/bundle/chunk-5Z3P543G.js +80 -0
- package/dist/bundle/chunk-6UYDKCV6.js +794 -0
- package/dist/bundle/chunk-7GNB4LBX.js +50 -0
- package/dist/bundle/chunk-7HJFBOAT.js +161 -0
- package/dist/bundle/chunk-7JVKQ6NM.js +206 -0
- package/dist/bundle/chunk-7QH5BZUG.js +142 -0
- package/dist/bundle/chunk-A474OVIW.js +1392 -0
- package/dist/bundle/chunk-AENEMQL3.js +1068 -0
- package/dist/bundle/chunk-AL7I4DT4.js +65718 -0
- package/dist/bundle/chunk-ARGRGTPX.js +108 -0
- package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
- package/dist/bundle/chunk-BAXNAOOL.js +76 -0
- package/dist/bundle/chunk-BH63B66W.js +407 -0
- package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
- package/dist/bundle/chunk-CFQQTDSA.js +46 -0
- package/dist/bundle/chunk-CGCUOT67.js +388 -0
- package/dist/bundle/chunk-CHPWBQUK.js +39 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-EHW45LLT.js +100 -0
- package/dist/bundle/chunk-F3AV5ZSL.js +338 -0
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/chunk-F5ZAN7OC.js +6848 -0
- package/dist/bundle/chunk-FMMYBVCH.js +38 -0
- package/dist/bundle/chunk-FNB4SWTY.js +66 -0
- package/dist/bundle/chunk-FQROWBKV.js +12660 -0
- package/dist/bundle/chunk-FV2HJOSC.js +771 -0
- package/dist/bundle/chunk-GCAJW4SR.js +53 -0
- package/dist/bundle/chunk-GPRJXJC7.js +102 -0
- package/dist/bundle/chunk-HCOZUOSN.js +54 -0
- package/dist/bundle/chunk-HM6AMYHR.js +72 -0
- package/dist/bundle/chunk-HVXOA4FO.js +23 -0
- package/dist/bundle/chunk-HWQ7572G.js +95 -0
- package/dist/bundle/chunk-IJVTN5L3.js +82 -0
- package/dist/bundle/chunk-IZDDBOHU.js +3610 -0
- package/dist/bundle/chunk-JAE5B4G7.js +388 -0
- package/dist/bundle/chunk-K2Y5K37O.js +218 -0
- package/dist/bundle/chunk-KCH224US.js +9581 -0
- package/dist/bundle/chunk-KZJQPJK5.js +230 -0
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/chunk-LECMHK2F.js +18 -0
- package/dist/bundle/chunk-LWEMZJLG.js +1332 -0
- package/dist/bundle/chunk-LWTETL2O.js +185 -0
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/chunk-MJ6LTG4L.js +170 -0
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/chunk-ODVGFCBE.js +557 -0
- package/dist/bundle/chunk-OEQNP56V.js +633 -0
- package/dist/bundle/chunk-OV6WQY3L.js +39 -0
- package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
- package/dist/bundle/chunk-PPNTY7LD.js +733 -0
- package/dist/bundle/chunk-PRZYRA66.js +358 -0
- package/dist/bundle/chunk-PV5UYGRJ.js +41594 -0
- package/dist/bundle/chunk-QYTOLPNI.js +52 -0
- package/dist/bundle/chunk-R7Y3XU66.js +362 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-SD5CXGIG.js +188 -0
- package/dist/bundle/chunk-SXY5G62I.js +288 -0
- package/dist/bundle/chunk-T37TAXVL.js +29 -0
- package/dist/bundle/chunk-T5SOY3AE.js +1197 -0
- package/dist/bundle/chunk-TJ7OORSO.js +1876 -0
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/chunk-U6VLNYCO.js +73 -0
- package/dist/bundle/chunk-UC7JLE6J.js +58 -0
- package/dist/bundle/chunk-UUIOAZPH.js +156 -0
- package/dist/bundle/chunk-UXQ24OY6.js +4072 -0
- package/dist/bundle/chunk-VBRRMGON.js +1007 -0
- package/dist/bundle/chunk-VRIBES2C.js +319 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XT5XYQEZ.js +3414 -0
- package/dist/bundle/chunk-XTAS5Z3G.js +2231 -0
- package/dist/bundle/chunk-XYQVVW4R.js +24 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/chunk-YUDVRFXN.js +63 -0
- package/dist/bundle/chunk-Z3I2MCUT.js +131 -0
- package/dist/bundle/chunk-ZDI3WC7V.js +353 -0
- package/dist/bundle/chunk-ZVQ7KFMT.js +274 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-P7YE4EKS.js +37 -0
- package/dist/bundle/command-server-entry-XIMCBWMV.js +166 -0
- package/dist/bundle/decode-6XK55WYV.js +297 -0
- package/dist/bundle/definitions-GIQCGYPR.js +7986 -0
- package/dist/bundle/dispatch-JQBAZWCL.js +411 -0
- package/dist/bundle/dist-2TV3NVE5.js +7577 -0
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/echarts-YRRVLEX3.js +42501 -0
- package/dist/bundle/embed-L3EEQSGX.js +38 -0
- package/dist/bundle/embedder-BIKLBV3J.js +111 -0
- package/dist/bundle/failure-I6AAF5R5.js +25 -0
- package/dist/bundle/first-run-W6G6TYZ2.js +29 -0
- package/dist/bundle/first-screen-ITIAJIBU.js +37 -0
- package/dist/bundle/hast-util-from-html-ZHU6HGIE.js +10531 -0
- package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
- package/dist/bundle/hast-util-to-mdast-D62XX3NR.js +2272 -0
- package/dist/bundle/instructions-AG7SRWTR.js +11 -0
- package/dist/bundle/mcp-YGOAUNC3.js +167 -0
- package/dist/bundle/mdast-util-from-markdown-WVUJDSUO.js +1900 -0
- package/dist/bundle/mdast-util-gfm-KN2D32QS.js +1040 -0
- package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
- package/dist/bundle/mdast-util-to-markdown-UCAJNHJO.js +18 -0
- package/dist/bundle/meeting-combined-CQJ3JHHU.js +24 -0
- package/dist/bundle/meeting-model-MZ7VVBNK.js +25 -0
- package/dist/bundle/meeting-semantic-DADWRRHP.js +22 -0
- package/dist/bundle/micromark-extension-gfm-EEJRRJ36.js +1771 -0
- package/dist/bundle/node-GJQYN4FT.js +176 -0
- package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-TPR62DT2.js +74 -0
- package/dist/bundle/oauth-WGY7JQVW.js +20 -0
- package/dist/bundle/open-DE7QZNAN.js +23 -0
- package/dist/bundle/openai-NHEFT3HS.js +238 -0
- package/dist/bundle/process-MEKCZMX3.js +91 -0
- package/dist/bundle/program-EP2S5BTM.js +38857 -0
- package/dist/bundle/prompt-PWY53BYH.js +17 -0
- package/dist/bundle/recognize-74TXHKMQ.js +26 -0
- package/dist/bundle/remote-F5TJZ5ER.js +31 -0
- package/dist/bundle/rerank-HWUO52UF.js +52 -0
- package/dist/bundle/schemas-4K6WWS5N.js +2157 -0
- package/dist/bundle/serve-I2USUY4X.js +199 -0
- package/dist/bundle/server-GDYDNO6K.js +79 -0
- package/dist/bundle/server-KYUW2AHB.js +212 -0
- package/dist/bundle/sqlite-runtime-N6VFGBJK.js +20 -0
- package/dist/bundle/state-L6JSCN77.js +36 -0
- package/dist/bundle/store-EPG2YPN3.js +291 -0
- package/dist/bundle/store-SQWQJE32.js +181 -0
- package/dist/bundle/store-maintenance-command-FTGSICVA.js +66 -0
- package/dist/bundle/surface-SNMHY6GP.js +65 -0
- package/dist/bundle/wordpress.js +183 -0
- package/dist/commands/api.d.ts +22 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +37 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/content.d.ts +4 -0
- package/dist/commands/content.d.ts.map +1 -0
- package/dist/commands/content.js +94 -0
- package/dist/commands/content.js.map +1 -0
- package/dist/commands/session.d.ts +8 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +28 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +69 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +37 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +31 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +7982 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +8830 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +229 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +2019 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +3365 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/generated/wirecat-config.d.ts +11 -0
- package/dist/generated/wirecat-config.d.ts.map +1 -0
- package/dist/generated/wirecat-config.js +337 -0
- package/dist/generated/wirecat-config.js.map +1 -0
- package/dist/identity.d.ts +28 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +29 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +53 -0
- package/dist/program.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/package.json +87 -4
- package/skills/wordpress-cli/SKILL.md +88 -0
- package/skills/wordpress-cli/references/api/api-block-directory.md +17 -0
- package/skills/wordpress-cli/references/api/api-block-patterns.md +13 -0
- package/skills/wordpress-cli/references/api/api-block-types.md +34 -0
- package/skills/wordpress-cli/references/api/api-blocks.md +159 -0
- package/skills/wordpress-cli/references/api/api-categories.md +69 -0
- package/skills/wordpress-cli/references/api/api-comments.md +79 -0
- package/skills/wordpress-cli/references/api/api-font-collections.md +16 -0
- package/skills/wordpress-cli/references/api/api-font-families.md +122 -0
- package/skills/wordpress-cli/references/api/api-global-styles.md +29 -0
- package/skills/wordpress-cli/references/api/api-media.md +106 -0
- package/skills/wordpress-cli/references/api/api-menu-items.md +115 -0
- package/skills/wordpress-cli/references/api/api-menu-locations.md +22 -0
- package/skills/wordpress-cli/references/api/api-menus.md +69 -0
- package/skills/wordpress-cli/references/api/api-navigation.md +155 -0
- package/skills/wordpress-cli/references/api/api-pages.md +161 -0
- package/skills/wordpress-cli/references/api/api-pattern-directory.md +23 -0
- package/skills/wordpress-cli/references/api/api-plugins.md +25 -0
- package/skills/wordpress-cli/references/api/api-posts.md +166 -0
- package/skills/wordpress-cli/references/api/api-search.md +21 -0
- package/skills/wordpress-cli/references/api/api-settings.md +19 -0
- package/skills/wordpress-cli/references/api/api-sidebars.md +34 -0
- package/skills/wordpress-cli/references/api/api-statuses.md +22 -0
- package/skills/wordpress-cli/references/api/api-tags.md +69 -0
- package/skills/wordpress-cli/references/api/api-taxonomies.md +23 -0
- package/skills/wordpress-cli/references/api/api-template-parts.md +38 -0
- package/skills/wordpress-cli/references/api/api-templates.md +38 -0
- package/skills/wordpress-cli/references/api/api-themes.md +12 -0
- package/skills/wordpress-cli/references/api/api-types.md +22 -0
- package/skills/wordpress-cli/references/api/api-users.md +149 -0
- package/skills/wordpress-cli/references/api/api-widget-types.md +46 -0
- package/skills/wordpress-cli/references/api/api-widgets.md +57 -0
- package/skills/wordpress-cli/references/api/api-wp-pattern-category.md +69 -0
- package/skills/wordpress-cli/references/api.md +44 -0
|
@@ -0,0 +1,932 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
__name
|
|
5
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/ansi-regex@6.6.0/node_modules/ansi-regex/index.js
|
|
8
|
+
var ST = String.raw`(?:\u001B\u005C|\u009C)`;
|
|
9
|
+
var stringControls = String.raw`\u0018\u001A\u001B\u0080-\u009F`;
|
|
10
|
+
var osc = String.raw`(?:\u001B\]|\u009D)[^\u0007${stringControls}]*(?:\u0007|${ST})`;
|
|
11
|
+
var controlString = String.raw`(?:\u001B[PX^_k]|[\u0090\u0098\u009E\u009F])[^${stringControls}]*${ST}`;
|
|
12
|
+
var linuxPalette = String.raw`\u001B\](?:P[\dA-Fa-f]{7}|R)(?:\u0007|${ST})?`;
|
|
13
|
+
var csi = String.raw`(?:\u001B\[|\u009B)[\u0030-\u003F]*[\u0020-\u002F]*[\u0040-\u007E]`;
|
|
14
|
+
var escape = String.raw`\u001B(?:[\u0020-\u002F]+[\u0030-\u007E]|[\dA-PR-TZcf-oq-uy=><~|}])`;
|
|
15
|
+
var pattern = `${linuxPalette}|${osc}|${controlString}|${csi}|${escape}`;
|
|
16
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
17
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
18
|
+
}
|
|
19
|
+
__name(ansiRegex, "ansiRegex");
|
|
20
|
+
|
|
21
|
+
// node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js
|
|
22
|
+
var regex = ansiRegex();
|
|
23
|
+
function stripAnsi(string) {
|
|
24
|
+
if (typeof string !== "string") {
|
|
25
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
26
|
+
}
|
|
27
|
+
if (!string.includes("\x1B") && !string.includes("\x9B")) {
|
|
28
|
+
return string;
|
|
29
|
+
}
|
|
30
|
+
return string.replace(regex, "");
|
|
31
|
+
}
|
|
32
|
+
__name(stripAnsi, "stripAnsi");
|
|
33
|
+
|
|
34
|
+
// node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/lookup-data.js
|
|
35
|
+
var ambiguousMinimalCodePoint = 161;
|
|
36
|
+
var ambiguousMaximumCodePoint = 1114109;
|
|
37
|
+
var ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
|
|
38
|
+
var fullwidthMinimalCodePoint = 12288;
|
|
39
|
+
var fullwidthMaximumCodePoint = 65510;
|
|
40
|
+
var fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
|
|
41
|
+
var wideMinimalCodePoint = 4352;
|
|
42
|
+
var wideMaximumCodePoint = 262141;
|
|
43
|
+
var wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101594, 101631, 101664, 101760, 101874, 101888, 102801, 102816, 102866, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110888, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110952, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127406, 127406, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128729, 128732, 128735, 128747, 128748, 128756, 128764, 128986, 128986, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129734, 129736, 129736, 129740, 129757, 129759, 129771, 129775, 129786, 131072, 196605, 196608, 262141];
|
|
44
|
+
|
|
45
|
+
// node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/utilities.js
|
|
46
|
+
var isInRange = /* @__PURE__ */ __name((ranges, codePoint) => {
|
|
47
|
+
let low = 0;
|
|
48
|
+
let high = Math.floor(ranges.length / 2) - 1;
|
|
49
|
+
while (low <= high) {
|
|
50
|
+
const mid = Math.floor((low + high) / 2);
|
|
51
|
+
const i = mid * 2;
|
|
52
|
+
if (codePoint < ranges[i]) {
|
|
53
|
+
high = mid - 1;
|
|
54
|
+
} else if (codePoint > ranges[i + 1]) {
|
|
55
|
+
low = mid + 1;
|
|
56
|
+
} else {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}, "isInRange");
|
|
62
|
+
|
|
63
|
+
// node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/lookup.js
|
|
64
|
+
var commonCjkCodePoint = 19968;
|
|
65
|
+
var [wideFastPathStart, wideFastPathEnd] = /* @__PURE__ */ findWideFastPathRange(wideRanges);
|
|
66
|
+
function findWideFastPathRange(ranges) {
|
|
67
|
+
let fastPathStart = ranges[0];
|
|
68
|
+
let fastPathEnd = ranges[1];
|
|
69
|
+
for (let index = 0; index < ranges.length; index += 2) {
|
|
70
|
+
const start = ranges[index];
|
|
71
|
+
const end = ranges[index + 1];
|
|
72
|
+
if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) {
|
|
73
|
+
return [start, end];
|
|
74
|
+
}
|
|
75
|
+
if (end - start > fastPathEnd - fastPathStart) {
|
|
76
|
+
fastPathStart = start;
|
|
77
|
+
fastPathEnd = end;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return [fastPathStart, fastPathEnd];
|
|
81
|
+
}
|
|
82
|
+
__name(findWideFastPathRange, "findWideFastPathRange");
|
|
83
|
+
var isAmbiguous = /* @__PURE__ */ __name((codePoint) => {
|
|
84
|
+
if (codePoint < ambiguousMinimalCodePoint || codePoint > ambiguousMaximumCodePoint) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return isInRange(ambiguousRanges, codePoint);
|
|
88
|
+
}, "isAmbiguous");
|
|
89
|
+
var isFullwidth = /* @__PURE__ */ __name((codePoint) => {
|
|
90
|
+
if (codePoint < fullwidthMinimalCodePoint || codePoint > fullwidthMaximumCodePoint) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return isInRange(fullwidthRanges, codePoint);
|
|
94
|
+
}, "isFullwidth");
|
|
95
|
+
var isWide = /* @__PURE__ */ __name((codePoint) => {
|
|
96
|
+
if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
if (codePoint < wideMinimalCodePoint || codePoint > wideMaximumCodePoint) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return isInRange(wideRanges, codePoint);
|
|
103
|
+
}, "isWide");
|
|
104
|
+
|
|
105
|
+
// node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/index.js
|
|
106
|
+
function validate(codePoint) {
|
|
107
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
108
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
__name(validate, "validate");
|
|
112
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
113
|
+
validate(codePoint);
|
|
114
|
+
if (isFullwidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
115
|
+
return 2;
|
|
116
|
+
}
|
|
117
|
+
return 1;
|
|
118
|
+
}
|
|
119
|
+
__name(eastAsianWidth, "eastAsianWidth");
|
|
120
|
+
|
|
121
|
+
// node_modules/.pnpm/string-width@8.3.0/node_modules/string-width/index.js
|
|
122
|
+
var segmenter = new Intl.Segmenter();
|
|
123
|
+
var visibleCharacterRegex = new RegExp("[^\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]", "v");
|
|
124
|
+
var spacingMarkRegex = new RegExp("\\p{Spacing_Mark}", "v");
|
|
125
|
+
var rgiEmojiRegex = new RegExp("^\\p{RGI_Emoji}$", "v");
|
|
126
|
+
var unqualifiedKeycapRegex = /^[\d#*]\u20E3$/;
|
|
127
|
+
var extendedPictographicRegex = new RegExp("\\p{Extended_Pictographic}", "gu");
|
|
128
|
+
function isDoubleWidthNonRgiEmojiSequence(segment) {
|
|
129
|
+
if (segment.length > 50) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (unqualifiedKeycapRegex.test(segment)) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
if (segment.includes("\u200D")) {
|
|
136
|
+
const pictographics = segment.match(extendedPictographicRegex);
|
|
137
|
+
return pictographics !== null && pictographics.length >= 2;
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
__name(isDoubleWidthNonRgiEmojiSequence, "isDoubleWidthNonRgiEmojiSequence");
|
|
142
|
+
function baseVisible(segment) {
|
|
143
|
+
const index = segment.search(visibleCharacterRegex);
|
|
144
|
+
return index === -1 ? void 0 : segment.slice(index);
|
|
145
|
+
}
|
|
146
|
+
__name(baseVisible, "baseVisible");
|
|
147
|
+
function isHangulLeadingJamo(codePoint) {
|
|
148
|
+
return codePoint >= 4352 && codePoint <= 4447 || codePoint >= 43360 && codePoint <= 43388;
|
|
149
|
+
}
|
|
150
|
+
__name(isHangulLeadingJamo, "isHangulLeadingJamo");
|
|
151
|
+
function isHangulVowelJamo(codePoint) {
|
|
152
|
+
return codePoint >= 4448 && codePoint <= 4519 || codePoint >= 55216 && codePoint <= 55238;
|
|
153
|
+
}
|
|
154
|
+
__name(isHangulVowelJamo, "isHangulVowelJamo");
|
|
155
|
+
function isHangulTrailingJamo(codePoint) {
|
|
156
|
+
return codePoint >= 4520 && codePoint <= 4607 || codePoint >= 55243 && codePoint <= 55291;
|
|
157
|
+
}
|
|
158
|
+
__name(isHangulTrailingJamo, "isHangulTrailingJamo");
|
|
159
|
+
function isHangulJamo(codePoint) {
|
|
160
|
+
return isHangulLeadingJamo(codePoint) || isHangulVowelJamo(codePoint) || isHangulTrailingJamo(codePoint);
|
|
161
|
+
}
|
|
162
|
+
__name(isHangulJamo, "isHangulJamo");
|
|
163
|
+
function hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {
|
|
164
|
+
const codePoints = [];
|
|
165
|
+
for (const character of visibleSegment) {
|
|
166
|
+
if (!visibleCharacterRegex.test(character)) {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
codePoints.push(character.codePointAt(0));
|
|
170
|
+
}
|
|
171
|
+
if (codePoints.length === 0) {
|
|
172
|
+
return void 0;
|
|
173
|
+
}
|
|
174
|
+
let width = 0;
|
|
175
|
+
for (let index = 0; index < codePoints.length; index++) {
|
|
176
|
+
const codePoint = codePoints[index];
|
|
177
|
+
if (!isHangulJamo(codePoint)) {
|
|
178
|
+
if (width === 0) {
|
|
179
|
+
return void 0;
|
|
180
|
+
}
|
|
181
|
+
for (let remaining = index; remaining < codePoints.length; remaining++) {
|
|
182
|
+
width += eastAsianWidth(codePoints[remaining], eastAsianWidthOptions);
|
|
183
|
+
}
|
|
184
|
+
return width;
|
|
185
|
+
}
|
|
186
|
+
if (isHangulLeadingJamo(codePoint) && isHangulVowelJamo(codePoints[index + 1])) {
|
|
187
|
+
width += 2;
|
|
188
|
+
index += isHangulTrailingJamo(codePoints[index + 2]) ? 2 : 1;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
192
|
+
}
|
|
193
|
+
return width;
|
|
194
|
+
}
|
|
195
|
+
__name(hangulClusterWidth, "hangulClusterWidth");
|
|
196
|
+
function trailingWidth(visibleSegment, eastAsianWidthOptions) {
|
|
197
|
+
let extra = 0;
|
|
198
|
+
let first = true;
|
|
199
|
+
for (const character of visibleSegment) {
|
|
200
|
+
if (first) {
|
|
201
|
+
first = false;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
if (spacingMarkRegex.test(character) || character >= "\uFF00" && character <= "\uFFEF") {
|
|
205
|
+
extra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return extra;
|
|
209
|
+
}
|
|
210
|
+
__name(trailingWidth, "trailingWidth");
|
|
211
|
+
function stringWidth(input, options = {}) {
|
|
212
|
+
if (typeof input !== "string" || input.length === 0) {
|
|
213
|
+
return 0;
|
|
214
|
+
}
|
|
215
|
+
const {
|
|
216
|
+
ambiguousIsNarrow = true,
|
|
217
|
+
countAnsiEscapeCodes = false
|
|
218
|
+
} = options;
|
|
219
|
+
let string = input;
|
|
220
|
+
if (!countAnsiEscapeCodes && (string.includes("\x1B") || string.includes("\x9B"))) {
|
|
221
|
+
string = stripAnsi(string);
|
|
222
|
+
}
|
|
223
|
+
if (string.length === 0) {
|
|
224
|
+
return 0;
|
|
225
|
+
}
|
|
226
|
+
if (/^[\u0020-\u007E]*$/.test(string)) {
|
|
227
|
+
return string.length;
|
|
228
|
+
}
|
|
229
|
+
let width = 0;
|
|
230
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
231
|
+
for (const { segment } of segmenter.segment(string)) {
|
|
232
|
+
const visibleSegment = baseVisible(segment);
|
|
233
|
+
if (visibleSegment === void 0) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (rgiEmojiRegex.test(segment) || isDoubleWidthNonRgiEmojiSequence(segment)) {
|
|
237
|
+
width += 2;
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
const hangulWidth = hangulClusterWidth(visibleSegment, eastAsianWidthOptions);
|
|
241
|
+
if (hangulWidth !== void 0) {
|
|
242
|
+
width += hangulWidth;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const codePoint = visibleSegment.codePointAt(0);
|
|
246
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
247
|
+
width += trailingWidth(visibleSegment, eastAsianWidthOptions);
|
|
248
|
+
}
|
|
249
|
+
return width;
|
|
250
|
+
}
|
|
251
|
+
__name(stringWidth, "stringWidth");
|
|
252
|
+
|
|
253
|
+
// node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js
|
|
254
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
255
|
+
var wrapAnsi16 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16");
|
|
256
|
+
var wrapAnsi256 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256");
|
|
257
|
+
var wrapAnsi16m = /* @__PURE__ */ __name((offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, "wrapAnsi16m");
|
|
258
|
+
var styles = {
|
|
259
|
+
modifier: {
|
|
260
|
+
reset: [0, 0],
|
|
261
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
262
|
+
bold: [1, 22],
|
|
263
|
+
dim: [2, 22],
|
|
264
|
+
italic: [3, 23],
|
|
265
|
+
underline: [4, 24],
|
|
266
|
+
overline: [53, 55],
|
|
267
|
+
inverse: [7, 27],
|
|
268
|
+
hidden: [8, 28],
|
|
269
|
+
strikethrough: [9, 29]
|
|
270
|
+
},
|
|
271
|
+
color: {
|
|
272
|
+
black: [30, 39],
|
|
273
|
+
red: [31, 39],
|
|
274
|
+
green: [32, 39],
|
|
275
|
+
yellow: [33, 39],
|
|
276
|
+
blue: [34, 39],
|
|
277
|
+
magenta: [35, 39],
|
|
278
|
+
cyan: [36, 39],
|
|
279
|
+
white: [37, 39],
|
|
280
|
+
// Bright color
|
|
281
|
+
blackBright: [90, 39],
|
|
282
|
+
gray: [90, 39],
|
|
283
|
+
// Alias of `blackBright`
|
|
284
|
+
grey: [90, 39],
|
|
285
|
+
// Alias of `blackBright`
|
|
286
|
+
redBright: [91, 39],
|
|
287
|
+
greenBright: [92, 39],
|
|
288
|
+
yellowBright: [93, 39],
|
|
289
|
+
blueBright: [94, 39],
|
|
290
|
+
magentaBright: [95, 39],
|
|
291
|
+
cyanBright: [96, 39],
|
|
292
|
+
whiteBright: [97, 39]
|
|
293
|
+
},
|
|
294
|
+
bgColor: {
|
|
295
|
+
bgBlack: [40, 49],
|
|
296
|
+
bgRed: [41, 49],
|
|
297
|
+
bgGreen: [42, 49],
|
|
298
|
+
bgYellow: [43, 49],
|
|
299
|
+
bgBlue: [44, 49],
|
|
300
|
+
bgMagenta: [45, 49],
|
|
301
|
+
bgCyan: [46, 49],
|
|
302
|
+
bgWhite: [47, 49],
|
|
303
|
+
// Bright color
|
|
304
|
+
bgBlackBright: [100, 49],
|
|
305
|
+
bgGray: [100, 49],
|
|
306
|
+
// Alias of `bgBlackBright`
|
|
307
|
+
bgGrey: [100, 49],
|
|
308
|
+
// Alias of `bgBlackBright`
|
|
309
|
+
bgRedBright: [101, 49],
|
|
310
|
+
bgGreenBright: [102, 49],
|
|
311
|
+
bgYellowBright: [103, 49],
|
|
312
|
+
bgBlueBright: [104, 49],
|
|
313
|
+
bgMagentaBright: [105, 49],
|
|
314
|
+
bgCyanBright: [106, 49],
|
|
315
|
+
bgWhiteBright: [107, 49]
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
319
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
320
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
321
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
322
|
+
function assembleStyles() {
|
|
323
|
+
const codes = /* @__PURE__ */ new Map();
|
|
324
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
325
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
326
|
+
styles[styleName] = {
|
|
327
|
+
open: `\x1B[${style[0]}m`,
|
|
328
|
+
close: `\x1B[${style[1]}m`
|
|
329
|
+
};
|
|
330
|
+
group[styleName] = styles[styleName];
|
|
331
|
+
codes.set(style[0], style[1]);
|
|
332
|
+
}
|
|
333
|
+
Object.defineProperty(styles, groupName, {
|
|
334
|
+
value: group,
|
|
335
|
+
enumerable: false
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
Object.defineProperty(styles, "codes", {
|
|
339
|
+
value: codes,
|
|
340
|
+
enumerable: false
|
|
341
|
+
});
|
|
342
|
+
styles.color.close = "\x1B[39m";
|
|
343
|
+
styles.bgColor.close = "\x1B[49m";
|
|
344
|
+
styles.color.ansi = wrapAnsi16();
|
|
345
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
346
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
347
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
348
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
349
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
350
|
+
Object.defineProperties(styles, {
|
|
351
|
+
rgbToAnsi256: {
|
|
352
|
+
value(red, green, blue) {
|
|
353
|
+
if (red === green && green === blue) {
|
|
354
|
+
if (red < 8) {
|
|
355
|
+
return 16;
|
|
356
|
+
}
|
|
357
|
+
if (red > 248) {
|
|
358
|
+
return 231;
|
|
359
|
+
}
|
|
360
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
361
|
+
}
|
|
362
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
363
|
+
},
|
|
364
|
+
enumerable: false
|
|
365
|
+
},
|
|
366
|
+
hexToRgb: {
|
|
367
|
+
value(hex) {
|
|
368
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
369
|
+
if (!matches) {
|
|
370
|
+
return [0, 0, 0];
|
|
371
|
+
}
|
|
372
|
+
let [colorString] = matches;
|
|
373
|
+
if (colorString.length === 3) {
|
|
374
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
375
|
+
}
|
|
376
|
+
const integer = Number.parseInt(colorString, 16);
|
|
377
|
+
return [
|
|
378
|
+
/* eslint-disable no-bitwise */
|
|
379
|
+
integer >> 16 & 255,
|
|
380
|
+
integer >> 8 & 255,
|
|
381
|
+
integer & 255
|
|
382
|
+
/* eslint-enable no-bitwise */
|
|
383
|
+
];
|
|
384
|
+
},
|
|
385
|
+
enumerable: false
|
|
386
|
+
},
|
|
387
|
+
hexToAnsi256: {
|
|
388
|
+
value: /* @__PURE__ */ __name((hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), "value"),
|
|
389
|
+
enumerable: false
|
|
390
|
+
},
|
|
391
|
+
ansi256ToAnsi: {
|
|
392
|
+
value(code) {
|
|
393
|
+
if (code < 8) {
|
|
394
|
+
return 30 + code;
|
|
395
|
+
}
|
|
396
|
+
if (code < 16) {
|
|
397
|
+
return 90 + (code - 8);
|
|
398
|
+
}
|
|
399
|
+
let red;
|
|
400
|
+
let green;
|
|
401
|
+
let blue;
|
|
402
|
+
if (code >= 232) {
|
|
403
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
404
|
+
green = red;
|
|
405
|
+
blue = red;
|
|
406
|
+
} else {
|
|
407
|
+
code -= 16;
|
|
408
|
+
const remainder = code % 36;
|
|
409
|
+
red = Math.floor(code / 36) / 5;
|
|
410
|
+
green = Math.floor(remainder / 6) / 5;
|
|
411
|
+
blue = remainder % 6 / 5;
|
|
412
|
+
}
|
|
413
|
+
const value = Math.max(red, green, blue) * 2;
|
|
414
|
+
if (value === 0) {
|
|
415
|
+
return 30;
|
|
416
|
+
}
|
|
417
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
418
|
+
if (value === 2) {
|
|
419
|
+
result += 60;
|
|
420
|
+
}
|
|
421
|
+
return result;
|
|
422
|
+
},
|
|
423
|
+
enumerable: false
|
|
424
|
+
},
|
|
425
|
+
rgbToAnsi: {
|
|
426
|
+
value: /* @__PURE__ */ __name((red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), "value"),
|
|
427
|
+
enumerable: false
|
|
428
|
+
},
|
|
429
|
+
hexToAnsi: {
|
|
430
|
+
value: /* @__PURE__ */ __name((hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), "value"),
|
|
431
|
+
enumerable: false
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
return styles;
|
|
435
|
+
}
|
|
436
|
+
__name(assembleStyles, "assembleStyles");
|
|
437
|
+
var ansiStyles = assembleStyles();
|
|
438
|
+
var ansi_styles_default = ansiStyles;
|
|
439
|
+
|
|
440
|
+
// node_modules/.pnpm/wrap-ansi@10.0.2/node_modules/wrap-ansi/index.js
|
|
441
|
+
var ANSI_ESCAPE = "\x1B";
|
|
442
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
443
|
+
var C1_CSI = "\x9B";
|
|
444
|
+
var ANSI_CSI = "[";
|
|
445
|
+
var ANSI_OSC = "]";
|
|
446
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
447
|
+
var ANSI_SGR_RESET = 0;
|
|
448
|
+
var ANSI_SGR_RESET_FOREGROUND = 39;
|
|
449
|
+
var ANSI_SGR_RESET_BACKGROUND = 49;
|
|
450
|
+
var ANSI_SGR_RESET_UNDERLINE_COLOR = 59;
|
|
451
|
+
var ANSI_SGR_FOREGROUND_EXTENDED = 38;
|
|
452
|
+
var ANSI_SGR_BACKGROUND_EXTENDED = 48;
|
|
453
|
+
var ANSI_SGR_UNDERLINE_COLOR_EXTENDED = 58;
|
|
454
|
+
var ANSI_SGR_COLOR_MODE_RGB = 2;
|
|
455
|
+
var ANSI_SGR_COLOR_MODE_256 = 5;
|
|
456
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;`;
|
|
457
|
+
var ESCAPES = /* @__PURE__ */ new Set([
|
|
458
|
+
ANSI_ESCAPE,
|
|
459
|
+
C1_CSI
|
|
460
|
+
]);
|
|
461
|
+
var ESCAPE_CHARACTERS = [...ESCAPES].join("");
|
|
462
|
+
var CSI_INTRODUCER = `(?:${ANSI_ESCAPE}\\${ANSI_CSI}|${C1_CSI})`;
|
|
463
|
+
var CSI_PARAMETERS = "[0-?]*[ -/]*[@-~]";
|
|
464
|
+
var SGR_PARAMETERS = `(?<sgr>[0-9;:]*)${ANSI_SGR_TERMINATOR}`;
|
|
465
|
+
var OSC_STRING_TERMINATOR = `(?:${ANSI_ESCAPE_BELL}|${ANSI_ESCAPE}\\\\)`;
|
|
466
|
+
var OSC_STRING_PAYLOAD = String.raw`[^\u0000-\u001F\u007F-\u009F]*`;
|
|
467
|
+
var LINK_PARAMETERS = String.raw`8;(?<parameters>[^;\u0000-\u001F\u007F-\u009F]*);(?<uri>${OSC_STRING_PAYLOAD})${OSC_STRING_TERMINATOR}`;
|
|
468
|
+
var OSC_STRING = `${OSC_STRING_PAYLOAD}${OSC_STRING_TERMINATOR}`;
|
|
469
|
+
var ANSI_ESCAPE_REGEX = new RegExp(
|
|
470
|
+
`${CSI_INTRODUCER}(?:${SGR_PARAMETERS}|${CSI_PARAMETERS})|${ANSI_ESCAPE}\\${ANSI_OSC}(?:${LINK_PARAMETERS}|${OSC_STRING})`,
|
|
471
|
+
"y"
|
|
472
|
+
);
|
|
473
|
+
var ANSI_SGR_MODIFIER_CLOSE_CODES = new Set(ansi_styles_default.codes.values());
|
|
474
|
+
ANSI_SGR_MODIFIER_CLOSE_CODES.delete(ANSI_SGR_RESET);
|
|
475
|
+
var segmenter2 = new Intl.Segmenter();
|
|
476
|
+
var getStringWidth = /* @__PURE__ */ __name((string) => stringWidth(string, { countAnsiEscapeCodes: true }), "getStringWidth");
|
|
477
|
+
var TAB_SIZE = 8;
|
|
478
|
+
var ESCAPE_INTRODUCER_REGEX = new RegExp(`[${ESCAPE_CHARACTERS}]`, "g");
|
|
479
|
+
var ROW_BOUNDARY_REGEX = new RegExp(`[\\n${ESCAPE_CHARACTERS}]`, "g");
|
|
480
|
+
var ASCII_PRINTABLE_REGEX = /^[ -~]*$/;
|
|
481
|
+
var wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ANSI_ESCAPE}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
|
|
482
|
+
var wrapAnsiHyperlink = /* @__PURE__ */ __name((url, parameters = "") => `${ANSI_ESCAPE}${ANSI_ESCAPE_LINK}${parameters};${url}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
|
|
483
|
+
var matchAnsiEscape = /* @__PURE__ */ __name((string, index) => {
|
|
484
|
+
if (!ESCAPES.has(string[index])) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
ANSI_ESCAPE_REGEX.lastIndex = index;
|
|
488
|
+
return ANSI_ESCAPE_REGEX.exec(string) ?? void 0;
|
|
489
|
+
}, "matchAnsiEscape");
|
|
490
|
+
var forEachSegment = /* @__PURE__ */ __name((string, onPlainText, onEscape = () => {
|
|
491
|
+
}) => {
|
|
492
|
+
let plainStart = 0;
|
|
493
|
+
let index = 0;
|
|
494
|
+
while (index < string.length) {
|
|
495
|
+
ESCAPE_INTRODUCER_REGEX.lastIndex = index;
|
|
496
|
+
const introducer = ESCAPE_INTRODUCER_REGEX.exec(string);
|
|
497
|
+
if (!introducer) {
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
const escape2 = matchAnsiEscape(string, introducer.index);
|
|
501
|
+
if (!escape2) {
|
|
502
|
+
index = introducer.index + 1;
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (introducer.index > plainStart) {
|
|
506
|
+
onPlainText(string.slice(plainStart, introducer.index));
|
|
507
|
+
}
|
|
508
|
+
onEscape(escape2[0]);
|
|
509
|
+
index = introducer.index + escape2[0].length;
|
|
510
|
+
plainStart = index;
|
|
511
|
+
}
|
|
512
|
+
if (plainStart < string.length) {
|
|
513
|
+
onPlainText(string.slice(plainStart));
|
|
514
|
+
}
|
|
515
|
+
}, "forEachSegment");
|
|
516
|
+
var getWidth = /* @__PURE__ */ __name((string) => {
|
|
517
|
+
let plainText = "";
|
|
518
|
+
forEachSegment(string, (part) => {
|
|
519
|
+
plainText += part;
|
|
520
|
+
});
|
|
521
|
+
return getStringWidth(plainText);
|
|
522
|
+
}, "getWidth");
|
|
523
|
+
var getTokens = /* @__PURE__ */ __name((string) => {
|
|
524
|
+
const tokens = [];
|
|
525
|
+
forEachSegment(string, (plainText) => {
|
|
526
|
+
if (ASCII_PRINTABLE_REGEX.test(plainText)) {
|
|
527
|
+
for (const character of plainText) {
|
|
528
|
+
tokens.push({ value: character, width: 1 });
|
|
529
|
+
}
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
for (const { segment } of segmenter2.segment(plainText)) {
|
|
533
|
+
tokens.push({ value: segment, width: getStringWidth(segment) });
|
|
534
|
+
}
|
|
535
|
+
}, (escape2) => {
|
|
536
|
+
tokens.push({ value: escape2, width: 0 });
|
|
537
|
+
});
|
|
538
|
+
return tokens;
|
|
539
|
+
}, "getTokens");
|
|
540
|
+
var splitWords = /* @__PURE__ */ __name((string) => {
|
|
541
|
+
let currentWord = { value: "", plainText: "" };
|
|
542
|
+
const words = [currentWord];
|
|
543
|
+
forEachSegment(string, (plainText) => {
|
|
544
|
+
const parts = plainText.split(" ");
|
|
545
|
+
currentWord.value += parts[0];
|
|
546
|
+
currentWord.plainText += parts[0];
|
|
547
|
+
for (let index = 1; index < parts.length; index++) {
|
|
548
|
+
currentWord = { value: parts[index], plainText: parts[index] };
|
|
549
|
+
words.push(currentWord);
|
|
550
|
+
}
|
|
551
|
+
}, (escape2) => {
|
|
552
|
+
currentWord.value += escape2;
|
|
553
|
+
});
|
|
554
|
+
for (const word of words) {
|
|
555
|
+
word.width = getStringWidth(word.plainText);
|
|
556
|
+
}
|
|
557
|
+
return words;
|
|
558
|
+
}, "splitWords");
|
|
559
|
+
var getColonColorToken = /* @__PURE__ */ __name((parameter) => {
|
|
560
|
+
const parts = parameter.split(":");
|
|
561
|
+
const code = Number.parseInt(parts[0], 10);
|
|
562
|
+
const mode = Number.parseInt(parts[1], 10);
|
|
563
|
+
if (![ANSI_SGR_FOREGROUND_EXTENDED, ANSI_SGR_BACKGROUND_EXTENDED, ANSI_SGR_UNDERLINE_COLOR_EXTENDED].includes(code)) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (mode === ANSI_SGR_COLOR_MODE_256 && parts.length === 3 && /^\d+$/.test(parts[2])) {
|
|
567
|
+
return { code, open: parameter, hasArguments: true };
|
|
568
|
+
}
|
|
569
|
+
if (mode !== ANSI_SGR_COLOR_MODE_RGB) {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
const components = parts.length === 6 ? parts.slice(3) : parts.slice(2);
|
|
573
|
+
const colorSpace = parts.length === 6 ? parts[2] : void 0;
|
|
574
|
+
if (components.length === 3 && components.every((component) => /^\d+$/.test(component)) && (colorSpace === void 0 || /^\d*$/.test(colorSpace))) {
|
|
575
|
+
return { code, open: parameter, hasArguments: true };
|
|
576
|
+
}
|
|
577
|
+
}, "getColonColorToken");
|
|
578
|
+
var getSgrTokens = /* @__PURE__ */ __name((sgrParameters) => {
|
|
579
|
+
const parameters = sgrParameters.split(";");
|
|
580
|
+
const sgrTokens = [];
|
|
581
|
+
for (let index = 0; index < parameters.length; index++) {
|
|
582
|
+
const parameter = parameters[index];
|
|
583
|
+
if (parameter.includes(":")) {
|
|
584
|
+
const colonColorToken = getColonColorToken(parameter);
|
|
585
|
+
if (colonColorToken) {
|
|
586
|
+
sgrTokens.push(colonColorToken);
|
|
587
|
+
}
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
const code = parameter === "" ? ANSI_SGR_RESET : Number.parseInt(parameter, 10);
|
|
591
|
+
if (!Number.isFinite(code)) {
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
if (code === ANSI_SGR_FOREGROUND_EXTENDED || code === ANSI_SGR_BACKGROUND_EXTENDED || code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED) {
|
|
595
|
+
if (index + 1 >= parameters.length) {
|
|
596
|
+
break;
|
|
597
|
+
}
|
|
598
|
+
const mode = Number.parseInt(parameters[index + 1], 10);
|
|
599
|
+
const colorIndex = Number.parseInt(parameters[index + 2], 10);
|
|
600
|
+
if (mode === ANSI_SGR_COLOR_MODE_256 && Number.isFinite(colorIndex)) {
|
|
601
|
+
sgrTokens.push({ code, open: [code, mode, colorIndex].join(";"), hasArguments: true });
|
|
602
|
+
index += 2;
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
const red = Number.parseInt(parameters[index + 2], 10);
|
|
606
|
+
const green = Number.parseInt(parameters[index + 3], 10);
|
|
607
|
+
const blue = Number.parseInt(parameters[index + 4], 10);
|
|
608
|
+
if (mode === ANSI_SGR_COLOR_MODE_RGB && Number.isFinite(red) && Number.isFinite(green) && Number.isFinite(blue)) {
|
|
609
|
+
sgrTokens.push({ code, open: [code, mode, red, green, blue].join(";"), hasArguments: true });
|
|
610
|
+
index += 4;
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
sgrTokens.push({ code, open: String(code), hasArguments: false });
|
|
616
|
+
}
|
|
617
|
+
return sgrTokens;
|
|
618
|
+
}, "getSgrTokens");
|
|
619
|
+
var removeActiveStyle = /* @__PURE__ */ __name((activeStyles, family) => {
|
|
620
|
+
const activeStyleIndex = activeStyles.findIndex((activeStyle) => activeStyle.family === family);
|
|
621
|
+
if (activeStyleIndex !== -1) {
|
|
622
|
+
activeStyles.splice(activeStyleIndex, 1);
|
|
623
|
+
}
|
|
624
|
+
}, "removeActiveStyle");
|
|
625
|
+
var upsertActiveStyle = /* @__PURE__ */ __name((activeStyles, nextActiveStyle) => {
|
|
626
|
+
removeActiveStyle(activeStyles, nextActiveStyle.family);
|
|
627
|
+
activeStyles.push(nextActiveStyle);
|
|
628
|
+
}, "upsertActiveStyle");
|
|
629
|
+
var removeModifierStylesByClose = /* @__PURE__ */ __name((activeStyles, closeCode) => {
|
|
630
|
+
for (let index = activeStyles.length - 1; index >= 0; index--) {
|
|
631
|
+
const activeStyle = activeStyles[index];
|
|
632
|
+
if (activeStyle.family.startsWith("modifier-") && activeStyle.close === closeCode) {
|
|
633
|
+
activeStyles.splice(index, 1);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}, "removeModifierStylesByClose");
|
|
637
|
+
var getColorStyle = /* @__PURE__ */ __name((sgrToken) => {
|
|
638
|
+
const { code, open, hasArguments } = sgrToken;
|
|
639
|
+
if (code >= 30 && code <= 37 || code >= 90 && code <= 97 || code === ANSI_SGR_FOREGROUND_EXTENDED && hasArguments) {
|
|
640
|
+
return {
|
|
641
|
+
family: "foreground",
|
|
642
|
+
open,
|
|
643
|
+
close: ANSI_SGR_RESET_FOREGROUND
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
if (code >= 40 && code <= 47 || code >= 100 && code <= 107 || code === ANSI_SGR_BACKGROUND_EXTENDED && hasArguments) {
|
|
647
|
+
return {
|
|
648
|
+
family: "background",
|
|
649
|
+
open,
|
|
650
|
+
close: ANSI_SGR_RESET_BACKGROUND
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
if (code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED && hasArguments) {
|
|
654
|
+
return {
|
|
655
|
+
family: "underlineColor",
|
|
656
|
+
open,
|
|
657
|
+
close: ANSI_SGR_RESET_UNDERLINE_COLOR
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
}, "getColorStyle");
|
|
661
|
+
var applySgrResetCode = /* @__PURE__ */ __name((code, activeStyles) => {
|
|
662
|
+
if (code === ANSI_SGR_RESET) {
|
|
663
|
+
activeStyles.length = 0;
|
|
664
|
+
return true;
|
|
665
|
+
}
|
|
666
|
+
if (code === ANSI_SGR_RESET_FOREGROUND) {
|
|
667
|
+
removeActiveStyle(activeStyles, "foreground");
|
|
668
|
+
return true;
|
|
669
|
+
}
|
|
670
|
+
if (code === ANSI_SGR_RESET_BACKGROUND) {
|
|
671
|
+
removeActiveStyle(activeStyles, "background");
|
|
672
|
+
return true;
|
|
673
|
+
}
|
|
674
|
+
if (code === ANSI_SGR_RESET_UNDERLINE_COLOR) {
|
|
675
|
+
removeActiveStyle(activeStyles, "underlineColor");
|
|
676
|
+
return true;
|
|
677
|
+
}
|
|
678
|
+
if (ANSI_SGR_MODIFIER_CLOSE_CODES.has(code)) {
|
|
679
|
+
removeModifierStylesByClose(activeStyles, code);
|
|
680
|
+
return true;
|
|
681
|
+
}
|
|
682
|
+
return false;
|
|
683
|
+
}, "applySgrResetCode");
|
|
684
|
+
var applySgrToken = /* @__PURE__ */ __name((sgrToken, activeStyles) => {
|
|
685
|
+
const { code } = sgrToken;
|
|
686
|
+
if (applySgrResetCode(code, activeStyles)) {
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
const colorStyle = getColorStyle(sgrToken);
|
|
690
|
+
if (colorStyle) {
|
|
691
|
+
upsertActiveStyle(activeStyles, colorStyle);
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
const close = ansi_styles_default.codes.get(code);
|
|
695
|
+
if (close !== void 0 && close !== ANSI_SGR_RESET) {
|
|
696
|
+
upsertActiveStyle(activeStyles, {
|
|
697
|
+
family: `modifier-${code}`,
|
|
698
|
+
open: sgrToken.open,
|
|
699
|
+
close
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
}, "applySgrToken");
|
|
703
|
+
var applySgrParameters = /* @__PURE__ */ __name((sgrParameters, activeStyles) => {
|
|
704
|
+
for (const sgrToken of getSgrTokens(sgrParameters)) {
|
|
705
|
+
applySgrToken(sgrToken, activeStyles);
|
|
706
|
+
}
|
|
707
|
+
}, "applySgrParameters");
|
|
708
|
+
var applySgrResets = /* @__PURE__ */ __name((sgrParameters, activeStyles) => {
|
|
709
|
+
for (const { code } of getSgrTokens(sgrParameters)) {
|
|
710
|
+
applySgrResetCode(code, activeStyles);
|
|
711
|
+
}
|
|
712
|
+
}, "applySgrResets");
|
|
713
|
+
var applyLeadingSgrResets = /* @__PURE__ */ __name((string, startIndex, activeStyles) => {
|
|
714
|
+
let index = startIndex;
|
|
715
|
+
while (index < string.length) {
|
|
716
|
+
const match = matchAnsiEscape(string, index);
|
|
717
|
+
if (!match) {
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
if (match.groups.sgr !== void 0) {
|
|
721
|
+
applySgrResets(match.groups.sgr, activeStyles);
|
|
722
|
+
}
|
|
723
|
+
index += match[0].length;
|
|
724
|
+
}
|
|
725
|
+
}, "applyLeadingSgrResets");
|
|
726
|
+
var getClosingSgrSequence = /* @__PURE__ */ __name((activeStyles) => [...activeStyles].reverse().map((activeStyle) => wrapAnsiCode(activeStyle.close)).join(""), "getClosingSgrSequence");
|
|
727
|
+
var getOpeningSgrSequence = /* @__PURE__ */ __name((activeStyles) => activeStyles.map((activeStyle) => wrapAnsiCode(activeStyle.open)).join(""), "getOpeningSgrSequence");
|
|
728
|
+
var wrapWord = /* @__PURE__ */ __name((rows, word, columns, rowWidth) => {
|
|
729
|
+
const tokens = getTokens(word);
|
|
730
|
+
let visible = rowWidth;
|
|
731
|
+
for (let index = 0; index < tokens.length; index++) {
|
|
732
|
+
const token = tokens[index];
|
|
733
|
+
if (token.width > 0 && visible > 0 && visible + token.width > columns) {
|
|
734
|
+
rows.push("");
|
|
735
|
+
visible = 0;
|
|
736
|
+
}
|
|
737
|
+
rows[rows.length - 1] += token.value;
|
|
738
|
+
visible += token.width;
|
|
739
|
+
if (visible === columns && index < tokens.length - 1) {
|
|
740
|
+
rows.push("");
|
|
741
|
+
visible = 0;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
|
|
745
|
+
rows[rows.length - 2] += rows.pop();
|
|
746
|
+
}
|
|
747
|
+
return getWidth(rows.at(-1));
|
|
748
|
+
}, "wrapWord");
|
|
749
|
+
var stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => {
|
|
750
|
+
if (!string.includes(" ")) {
|
|
751
|
+
return string;
|
|
752
|
+
}
|
|
753
|
+
const segments = [];
|
|
754
|
+
forEachSegment(string, (plainText) => {
|
|
755
|
+
segments.push({ value: plainText, isEscape: false });
|
|
756
|
+
}, (escape2) => {
|
|
757
|
+
segments.push({ value: escape2, isEscape: true });
|
|
758
|
+
});
|
|
759
|
+
for (let index = segments.length - 1; index >= 0; index--) {
|
|
760
|
+
const segment = segments[index];
|
|
761
|
+
if (segment.isEscape) {
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
let end = segment.value.length;
|
|
765
|
+
while (end > 0 && segment.value[end - 1] === " ") {
|
|
766
|
+
end--;
|
|
767
|
+
}
|
|
768
|
+
segment.value = segment.value.slice(0, end);
|
|
769
|
+
if (getStringWidth(segment.value) > 0) {
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return segments.map((segment) => segment.value).join("");
|
|
774
|
+
}, "stringVisibleTrimSpacesRight");
|
|
775
|
+
var expandTabs = /* @__PURE__ */ __name((line) => {
|
|
776
|
+
if (!line.includes(" ")) {
|
|
777
|
+
return line;
|
|
778
|
+
}
|
|
779
|
+
let visible = 0;
|
|
780
|
+
let expandedLine = "";
|
|
781
|
+
let plainTextSinceTab = "";
|
|
782
|
+
const expandPlainText = /* @__PURE__ */ __name((plainText) => {
|
|
783
|
+
const segments = plainText.split(" ");
|
|
784
|
+
for (const [index, segment] of segments.entries()) {
|
|
785
|
+
expandedLine += segment;
|
|
786
|
+
plainTextSinceTab += segment;
|
|
787
|
+
if (index < segments.length - 1) {
|
|
788
|
+
visible += getStringWidth(plainTextSinceTab);
|
|
789
|
+
plainTextSinceTab = "";
|
|
790
|
+
const spaces = TAB_SIZE - visible % TAB_SIZE;
|
|
791
|
+
expandedLine += " ".repeat(spaces);
|
|
792
|
+
visible += spaces;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}, "expandPlainText");
|
|
796
|
+
forEachSegment(line, expandPlainText, (escape2) => {
|
|
797
|
+
expandedLine += escape2;
|
|
798
|
+
});
|
|
799
|
+
return expandedLine;
|
|
800
|
+
}, "expandTabs");
|
|
801
|
+
var restoreStylesAcrossRows = /* @__PURE__ */ __name((preString) => {
|
|
802
|
+
let returnValue = "";
|
|
803
|
+
let activeHyperlink;
|
|
804
|
+
const activeStyles = [];
|
|
805
|
+
let index = 0;
|
|
806
|
+
let copiedIndex = 0;
|
|
807
|
+
while (index < preString.length) {
|
|
808
|
+
ROW_BOUNDARY_REGEX.lastIndex = index;
|
|
809
|
+
const boundary = ROW_BOUNDARY_REGEX.exec(preString);
|
|
810
|
+
if (!boundary) {
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
index = boundary.index;
|
|
814
|
+
if (boundary[0] !== "\n") {
|
|
815
|
+
const escape2 = matchAnsiEscape(preString, index);
|
|
816
|
+
if (!escape2) {
|
|
817
|
+
index++;
|
|
818
|
+
continue;
|
|
819
|
+
}
|
|
820
|
+
const { groups } = escape2;
|
|
821
|
+
if (groups.sgr !== void 0) {
|
|
822
|
+
applySgrParameters(groups.sgr, activeStyles);
|
|
823
|
+
} else if (groups.uri !== void 0) {
|
|
824
|
+
activeHyperlink = groups.uri.length === 0 ? void 0 : { parameters: groups.parameters, uri: groups.uri };
|
|
825
|
+
}
|
|
826
|
+
index += escape2[0].length;
|
|
827
|
+
continue;
|
|
828
|
+
}
|
|
829
|
+
returnValue += preString.slice(copiedIndex, index);
|
|
830
|
+
if (index > copiedIndex) {
|
|
831
|
+
if (activeHyperlink) {
|
|
832
|
+
returnValue += wrapAnsiHyperlink("");
|
|
833
|
+
}
|
|
834
|
+
returnValue += getClosingSgrSequence(activeStyles);
|
|
835
|
+
}
|
|
836
|
+
returnValue += "\n";
|
|
837
|
+
index++;
|
|
838
|
+
copiedIndex = index;
|
|
839
|
+
if (index < preString.length && preString[index] !== "\n") {
|
|
840
|
+
const openingStyles = [...activeStyles];
|
|
841
|
+
applyLeadingSgrResets(preString, index, openingStyles);
|
|
842
|
+
returnValue += getOpeningSgrSequence(openingStyles);
|
|
843
|
+
if (activeHyperlink) {
|
|
844
|
+
returnValue += wrapAnsiHyperlink(activeHyperlink.uri, activeHyperlink.parameters);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
return returnValue + preString.slice(copiedIndex);
|
|
849
|
+
}, "restoreStylesAcrossRows");
|
|
850
|
+
var exec = /* @__PURE__ */ __name((string, columns, options = {}) => {
|
|
851
|
+
if (options.trim !== false && string.trim() === "") {
|
|
852
|
+
return "";
|
|
853
|
+
}
|
|
854
|
+
const words = splitWords(string);
|
|
855
|
+
let rows = [""];
|
|
856
|
+
let rowLength = 0;
|
|
857
|
+
let trimmedRowIndex = -1;
|
|
858
|
+
let isFirstWord = true;
|
|
859
|
+
for (const word of words) {
|
|
860
|
+
const rowIndex = rows.length - 1;
|
|
861
|
+
if (options.trim !== false && trimmedRowIndex !== rowIndex) {
|
|
862
|
+
const row = rows[rowIndex];
|
|
863
|
+
const trimmedRow = row.trimStart();
|
|
864
|
+
if (trimmedRow.length !== row.length) {
|
|
865
|
+
rows[rowIndex] = trimmedRow;
|
|
866
|
+
rowLength = getWidth(trimmedRow);
|
|
867
|
+
}
|
|
868
|
+
if (trimmedRow.length > 0) {
|
|
869
|
+
trimmedRowIndex = rowIndex;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if (isFirstWord) {
|
|
873
|
+
isFirstWord = false;
|
|
874
|
+
} else {
|
|
875
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
876
|
+
rows.push("");
|
|
877
|
+
rowLength = 0;
|
|
878
|
+
}
|
|
879
|
+
if (rowLength > 0 || options.trim === false) {
|
|
880
|
+
rows[rows.length - 1] += " ";
|
|
881
|
+
rowLength++;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
if (options.hard && options.wordWrap !== false && word.width > columns) {
|
|
885
|
+
const remainingColumns = columns - rowLength;
|
|
886
|
+
const breaksStartingThisLine = 1 + Math.floor((word.width - remainingColumns - 1) / columns);
|
|
887
|
+
const breaksStartingNextLine = Math.floor((word.width - 1) / columns);
|
|
888
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
889
|
+
rows.push("");
|
|
890
|
+
rowLength = 0;
|
|
891
|
+
}
|
|
892
|
+
rowLength = wrapWord(rows, word.value, columns, rowLength);
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
if (rowLength + word.width > columns && rowLength > 0 && word.width > 0) {
|
|
896
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
897
|
+
rowLength = wrapWord(rows, word.value, columns, rowLength);
|
|
898
|
+
continue;
|
|
899
|
+
}
|
|
900
|
+
rows.push("");
|
|
901
|
+
rowLength = 0;
|
|
902
|
+
}
|
|
903
|
+
if (rowLength + word.width > columns && options.wordWrap === false) {
|
|
904
|
+
rowLength = wrapWord(rows, word.value, columns, rowLength);
|
|
905
|
+
continue;
|
|
906
|
+
}
|
|
907
|
+
rows[rows.length - 1] += word.value;
|
|
908
|
+
rowLength += word.width;
|
|
909
|
+
}
|
|
910
|
+
if (options.trim !== false) {
|
|
911
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
912
|
+
}
|
|
913
|
+
return restoreStylesAcrossRows(rows.join("\n"));
|
|
914
|
+
}, "exec");
|
|
915
|
+
var normalizeText = /* @__PURE__ */ __name((string) => {
|
|
916
|
+
let normalizedString = "";
|
|
917
|
+
forEachSegment(string, (plainText) => {
|
|
918
|
+
normalizedString += plainText.normalize();
|
|
919
|
+
}, (escape2) => {
|
|
920
|
+
normalizedString += escape2;
|
|
921
|
+
});
|
|
922
|
+
return normalizedString;
|
|
923
|
+
}, "normalizeText");
|
|
924
|
+
function wrapAnsi(string, columns, options) {
|
|
925
|
+
return normalizeText(String(string)).replaceAll("\r\n", "\n").split("\n").map((line) => exec(expandTabs(line), columns, options)).join("\n");
|
|
926
|
+
}
|
|
927
|
+
__name(wrapAnsi, "wrapAnsi");
|
|
928
|
+
|
|
929
|
+
export {
|
|
930
|
+
stringWidth,
|
|
931
|
+
wrapAnsi
|
|
932
|
+
};
|