comarkserv 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 (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +389 -0
  3. package/dist/THIRD_PARTY_LICENSES.md +932 -0
  4. package/dist/build-CsToYJrU.mjs +2 -0
  5. package/dist/build-Cv5aO0CB.mjs +205 -0
  6. package/dist/cli.d.mts +1 -0
  7. package/dist/cli.mjs +894 -0
  8. package/dist/cloudflared-6f_lzz4F.mjs +181 -0
  9. package/dist/dist-B-IALNns.mjs +2 -0
  10. package/dist/dist-BK-bpLWg.mjs +2 -0
  11. package/dist/dist-BQzCbTko.mjs +1693 -0
  12. package/dist/dist-BWcWG5YB.mjs +671 -0
  13. package/dist/dist-BiVw4ojz.mjs +592 -0
  14. package/dist/dist-BnmL9jeq.mjs +538 -0
  15. package/dist/dist-BtedNLrc.mjs +276 -0
  16. package/dist/dist-BvdNTrap.mjs +2710 -0
  17. package/dist/dist-ByijHttv.mjs +69 -0
  18. package/dist/dist-C2E4zSX1.mjs +347 -0
  19. package/dist/dist-CWYRQLUT.mjs +2 -0
  20. package/dist/dist-CXQ7eTfT.mjs +417 -0
  21. package/dist/dist-CfsjQ0o8.mjs +905 -0
  22. package/dist/dist-CsTXDvwi.mjs +300 -0
  23. package/dist/dist-CtONMLh4.mjs +283 -0
  24. package/dist/dist-DMftjyxU.mjs +370 -0
  25. package/dist/dist-Dr9uTCX7.mjs +2 -0
  26. package/dist/dist-Dxvc11TH.mjs +339 -0
  27. package/dist/dist-GmbcGEAc.mjs +3 -0
  28. package/dist/dist-V1rkISnf.mjs +220 -0
  29. package/dist/dist-ZoN94PJ0.mjs +76 -0
  30. package/dist/dist-fh99cWMN.mjs +524 -0
  31. package/dist/editor-CHDyOp-8.mjs +721 -0
  32. package/dist/index.d.mts +301 -0
  33. package/dist/index.mjs +6 -0
  34. package/dist/languages-C0kEygG_.mjs +119 -0
  35. package/dist/markdown-BqKed1Vq.mjs +710 -0
  36. package/dist/markdown-DWuqfzps.mjs +2 -0
  37. package/dist/rolldown-runtime-CMFfr-1z.mjs +26 -0
  38. package/dist/server-Dkjk_D1Y.mjs +2628 -0
  39. package/dist/terminal-aKr5Xlp3.mjs +169 -0
  40. package/dist/themes-mEufQ_3e.mjs +2194 -0
  41. package/dist/twinkleplop.production-Coccf2Q9.mjs +2 -0
  42. package/dist/twinkleplop.production-DekYmX6O.mjs +4697 -0
  43. package/dist/twinkleplop.tokens-CgBUTCSg.mjs +76 -0
  44. package/package.json +133 -0
@@ -0,0 +1,721 @@
1
+ import { n as __require, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-CMFfr-1z.mjs";
2
+ //#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
3
+ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
+ let p = process || {};
5
+ let argv = p.argv || [];
6
+ let env = p.env || {};
7
+ let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
8
+ let formatter = (open, close, replace = open) => (input) => {
9
+ let string = "" + input, index = string.indexOf(close, open.length);
10
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
11
+ };
12
+ let replaceClose = (string, close, replace, index) => {
13
+ let result = "", cursor = 0;
14
+ do {
15
+ result += string.substring(cursor, index) + replace;
16
+ cursor = index + close.length;
17
+ index = string.indexOf(close, cursor);
18
+ } while (~index);
19
+ return result + string.substring(cursor);
20
+ };
21
+ let createColors = (enabled = isColorSupported) => {
22
+ let f = enabled ? formatter : () => String;
23
+ return {
24
+ isColorSupported: enabled,
25
+ reset: f("\x1B[0m", "\x1B[0m"),
26
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
27
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
28
+ italic: f("\x1B[3m", "\x1B[23m"),
29
+ underline: f("\x1B[4m", "\x1B[24m"),
30
+ inverse: f("\x1B[7m", "\x1B[27m"),
31
+ hidden: f("\x1B[8m", "\x1B[28m"),
32
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
33
+ black: f("\x1B[30m", "\x1B[39m"),
34
+ red: f("\x1B[31m", "\x1B[39m"),
35
+ green: f("\x1B[32m", "\x1B[39m"),
36
+ yellow: f("\x1B[33m", "\x1B[39m"),
37
+ blue: f("\x1B[34m", "\x1B[39m"),
38
+ magenta: f("\x1B[35m", "\x1B[39m"),
39
+ cyan: f("\x1B[36m", "\x1B[39m"),
40
+ white: f("\x1B[37m", "\x1B[39m"),
41
+ gray: f("\x1B[90m", "\x1B[39m"),
42
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
43
+ bgRed: f("\x1B[41m", "\x1B[49m"),
44
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
45
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
46
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
47
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
48
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
49
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
50
+ blackBright: f("\x1B[90m", "\x1B[39m"),
51
+ redBright: f("\x1B[91m", "\x1B[39m"),
52
+ greenBright: f("\x1B[92m", "\x1B[39m"),
53
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
54
+ blueBright: f("\x1B[94m", "\x1B[39m"),
55
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
56
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
57
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
58
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
59
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
60
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
61
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
62
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
63
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
64
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
65
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
66
+ };
67
+ };
68
+ module.exports = createColors();
69
+ module.exports.createColors = createColors;
70
+ }));
71
+ //#endregion
72
+ //#region node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/quote.js
73
+ var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74
+ /** @import { ControlOperator } from './parse' */
75
+ /** @type {ControlOperator['op'][]} */
76
+ var OPS = [
77
+ "||",
78
+ "&&",
79
+ ";;",
80
+ "|&",
81
+ "<(",
82
+ "<<<",
83
+ ">>",
84
+ ">&",
85
+ "<&",
86
+ "&",
87
+ ";",
88
+ "(",
89
+ ")",
90
+ "|",
91
+ "<",
92
+ ">"
93
+ ];
94
+ var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
95
+ var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
96
+ /** @type {typeof import('./quote')} */
97
+ module.exports = function quote(xs) {
98
+ return xs.map(function(s) {
99
+ if (s === "") return "''";
100
+ if (s && typeof s === "object") {
101
+ if ("op" in s && s.op === "glob") {
102
+ if (typeof s.pattern !== "string") throw new TypeError("glob token requires a string `pattern`");
103
+ if (LINE_TERMINATORS.test(s.pattern)) throw new TypeError("glob `pattern` must not contain line terminators");
104
+ return s.pattern.replace(GLOB_SHELL_SPECIAL, "\\$&");
105
+ }
106
+ if ("op" in s && typeof s.op === "string") {
107
+ if (OPS.indexOf(s.op) < 0) throw new TypeError("invalid `op` value: " + JSON.stringify(s.op));
108
+ return s.op.replace(/[\s\S]/g, "\\$&");
109
+ }
110
+ if ("comment" in s && typeof s.comment === "string") {
111
+ if (LINE_TERMINATORS.test(s.comment)) throw new TypeError("`comment` must not contain line terminators");
112
+ return "#" + s.comment;
113
+ }
114
+ throw new TypeError("unrecognized object token shape");
115
+ }
116
+ if (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['])/g, "\\$1") + "'";
117
+ if (/["'\s]/.test(s)) return "\"" + s.replace(/(["\\$`!])/g, "\\$1") + "\"";
118
+ return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g, "$1\\$2");
119
+ }).join(" ");
120
+ };
121
+ }));
122
+ //#endregion
123
+ //#region node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/parse.js
124
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
125
+ /**
126
+ * @import {
127
+ * ControlOperator,
128
+ * Env,
129
+ * GlobPattern,
130
+ * ParseEntry,
131
+ * } from './parse' */
132
+ var CONTROL = "(?:" + [
133
+ "\\|\\|",
134
+ "\\&\\&",
135
+ ";;",
136
+ "\\|\\&",
137
+ "\\<\\(",
138
+ "\\<\\<\\<",
139
+ ">>",
140
+ ">\\&",
141
+ "<\\&",
142
+ "[&;()|<>]"
143
+ ].join("|") + ")";
144
+ var controlRE = new RegExp("^" + CONTROL + "$");
145
+ var META = "|&;()<> \\t";
146
+ var SINGLE_QUOTE = "'([^']*?)'";
147
+ var DOUBLE_QUOTE = "\"((\\\\\"|[^\"])*?)\"";
148
+ var hash = /^#$/;
149
+ var SQ = "'";
150
+ var DQ = "\"";
151
+ var DS = "$";
152
+ var TOKEN = "";
153
+ var mult = 4294967296;
154
+ for (var i = 0; i < 4; i++) TOKEN += (mult * Math.random()).toString(16);
155
+ var startsWithToken = new RegExp("^" + TOKEN);
156
+ /**
157
+ * @param {string} s
158
+ * @param {RegExp} r
159
+ */
160
+ function matchAll(s, r) {
161
+ var origIndex = r.lastIndex;
162
+ var matches = [];
163
+ var matchObj;
164
+ while (matchObj = r.exec(s)) {
165
+ matches[matches.length] = matchObj;
166
+ if (r.lastIndex === matchObj.index) r.lastIndex += 1;
167
+ }
168
+ r.lastIndex = origIndex;
169
+ return matches;
170
+ }
171
+ /**
172
+ * @param {Env} env
173
+ * @param {string} pre
174
+ * @param {string} key
175
+ */
176
+ function getVar(env, pre, key) {
177
+ var r = typeof env === "function" ? env(key) : env[key];
178
+ if (typeof r === "undefined" && key != "") r = "";
179
+ else if (typeof r === "undefined") r = "$";
180
+ if (typeof r === "object") return pre + TOKEN + JSON.stringify(r) + TOKEN;
181
+ return pre + r;
182
+ }
183
+ /**
184
+ * @param {string} string
185
+ * @param {Env} [env]
186
+ * @param {{ escape?: string, splitUnquoted?: boolean | string }} [opts]
187
+ * @returns {ParseEntry[]}
188
+ */
189
+ function parseInternal(string, env, opts) {
190
+ if (!opts) opts = {};
191
+ var BS = opts.escape || "\\";
192
+ var ifs = opts.splitUnquoted === true ? " \n" : typeof opts.splitUnquoted === "string" ? opts.splitUnquoted : "";
193
+ var BAREWORD = "(\\" + BS + "['\"" + META + "]|[^\\s'\"" + META + "])+";
194
+ var matches = matchAll(string, new RegExp(["(" + CONTROL + ")", "(" + BAREWORD + "|" + DOUBLE_QUOTE + "|" + SINGLE_QUOTE + ")+"].join("|"), "g"));
195
+ if (matches.length === 0) return [];
196
+ if (!env) env = {};
197
+ var commented = false;
198
+ return matches.map(function(match) {
199
+ var s = match[0];
200
+ if (!s || commented) return;
201
+ if (controlRE.test(s)) return { op: s };
202
+ /** @type {string | boolean} */
203
+ var quote = false;
204
+ var esc = false;
205
+ var out = "";
206
+ /** @type {string[]} */
207
+ var words = [];
208
+ var sawQuote = false;
209
+ /** @type {number | null} */
210
+ var pendingNw = null;
211
+ var isGlob = false;
212
+ /** @type {number} */
213
+ var i;
214
+ function parseEnvVar() {
215
+ i += 1;
216
+ /** @type {number | RegExpMatchArray | null} */
217
+ var varend;
218
+ /** @type {string} */
219
+ var varname;
220
+ var char = s.charAt(i);
221
+ if (char === "{") {
222
+ i += 1;
223
+ if (s.charAt(i) === "}") throw new Error("Bad substitution: " + s.slice(i - 2, i + 1));
224
+ var depth = 1;
225
+ varend = i;
226
+ while (depth > 0 && varend < s.length) {
227
+ if (s.charAt(varend) === "{" && s.charAt(varend - 1) === "$") depth += 1;
228
+ else if (s.charAt(varend) === "}") depth -= 1;
229
+ varend += 1;
230
+ }
231
+ if (depth !== 0) throw new Error("Bad substitution: " + s.slice(i));
232
+ varend -= 1;
233
+ varname = s.slice(i, varend);
234
+ i = varend;
235
+ } else if (/[*@#?$!_-]/.test(char)) {
236
+ varname = char;
237
+ i += 1;
238
+ } else {
239
+ var slicedFromI = s.slice(i);
240
+ varend = slicedFromI.match(/[^\w\d_]/);
241
+ if (!varend) {
242
+ varname = slicedFromI;
243
+ i = s.length;
244
+ } else {
245
+ varname = slicedFromI.slice(0, varend.index);
246
+ i += varend.index - 1;
247
+ }
248
+ }
249
+ return getVar(env, "", varname);
250
+ }
251
+ function flushRun() {
252
+ if (pendingNw === null) return;
253
+ if (pendingNw === 0) {
254
+ if (out !== "") {
255
+ words[words.length] = out;
256
+ out = "";
257
+ }
258
+ } else {
259
+ words[words.length] = out;
260
+ out = "";
261
+ for (var fe = 1; fe < pendingNw; fe += 1) words[words.length] = "";
262
+ }
263
+ pendingNw = null;
264
+ }
265
+ for (i = 0; i < s.length; i++) {
266
+ var c = s.charAt(i);
267
+ if (ifs && c !== DS) flushRun();
268
+ isGlob = isGlob || !quote && (c === "*" || c === "?");
269
+ if (esc) {
270
+ out += c;
271
+ esc = false;
272
+ } else if (quote) {
273
+ if (c === quote) quote = false;
274
+ else if (quote == SQ) out += c;
275
+ else if (c === BS) {
276
+ i += 1;
277
+ c = s.charAt(i);
278
+ if (c === DQ || c === BS || c === DS) out += c;
279
+ else out += BS + c;
280
+ } else if (c === DS) out += parseEnvVar();
281
+ else out += c;
282
+ } else if (c === DQ || c === SQ) {
283
+ quote = c;
284
+ sawQuote = true;
285
+ } else if (controlRE.test(c)) return { op: s };
286
+ else if (hash.test(c)) {
287
+ commented = true;
288
+ var commentObj = { comment: string.slice(match.index + i + 1) };
289
+ if (out.length) return [out, commentObj];
290
+ return [commentObj];
291
+ } else if (c === BS) esc = true;
292
+ else if (c === DS) {
293
+ var value = parseEnvVar();
294
+ if (!ifs) out += value;
295
+ else for (var vi = 0; vi < value.length; vi += 1) {
296
+ var vc = value.charAt(vi);
297
+ if (ifs.indexOf(vc) < 0) {
298
+ flushRun();
299
+ out += vc;
300
+ } else if (pendingNw === null) pendingNw = vc === " " || vc === " " || vc === "\n" ? 0 : 1;
301
+ else if (vc !== " " && vc !== " " && vc !== "\n") pendingNw += 1;
302
+ }
303
+ } else out += c;
304
+ }
305
+ if (isGlob) return {
306
+ op: "glob",
307
+ pattern: out
308
+ };
309
+ if (ifs) {
310
+ if (pendingNw !== null && pendingNw > 0) {
311
+ words[words.length] = out;
312
+ out = "";
313
+ for (var te = 1; te < pendingNw; te += 1) words[words.length] = "";
314
+ }
315
+ if (out !== "" || sawQuote && words.length === 0) words[words.length] = out;
316
+ return words;
317
+ }
318
+ return out;
319
+ }).reduce(function(prev, arg) {
320
+ if (typeof arg === "undefined") return prev;
321
+ /** @type {ParseEntry[]} */ [].concat(arg).forEach(function(entry) {
322
+ prev[prev.length] = entry;
323
+ });
324
+ return prev;
325
+ }, []);
326
+ }
327
+ /** @type {typeof import('./parse')} */
328
+ module.exports = function parse(s, env, opts) {
329
+ var mapped = parseInternal(s, env, opts);
330
+ if (typeof env !== "function") return mapped;
331
+ return mapped.reduce(function(acc, s) {
332
+ if (typeof s === "object") {
333
+ acc[acc.length] = s;
334
+ return acc;
335
+ }
336
+ var xs = s.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
337
+ if (xs.length === 1) {
338
+ acc[acc.length] = xs[0];
339
+ return acc;
340
+ }
341
+ xs.filter(Boolean).forEach(function(x) {
342
+ acc[acc.length] = startsWithToken.test(x) ? JSON.parse(x.split(TOKEN)[1]) : x;
343
+ });
344
+ return acc;
345
+ }, []);
346
+ };
347
+ }));
348
+ //#endregion
349
+ //#region node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/index.js
350
+ var require_shell_quote = /* @__PURE__ */ __commonJSMin(((exports) => {
351
+ exports.quote = require_quote();
352
+ exports.parse = require_parse();
353
+ }));
354
+ //#endregion
355
+ //#region node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js
356
+ var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
357
+ module.exports = {
358
+ "/Applications/Atom.app/Contents/MacOS/Atom": "atom",
359
+ "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta": "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta",
360
+ "/Applications/Brackets.app/Contents/MacOS/Brackets": "brackets",
361
+ "/Applications/Sublime Text.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
362
+ "/Applications/Sublime Text.app/Contents/MacOS/sublime_text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
363
+ "/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2": "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl",
364
+ "/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl",
365
+ "/Applications/Visual Studio Code.app/Contents/MacOS/Code": "code",
366
+ "/Applications/Visual Studio Code.app/Contents/MacOS/Electron": "code",
367
+ "/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders": "code-insiders",
368
+ "/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron": "code-insiders",
369
+ "/Applications/VSCodium.app/Contents/MacOS/Electron": "codium",
370
+ "/Applications/Cursor.app/Contents/MacOS/Cursor": "cursor",
371
+ "/Applications/Trae.app/Contents/MacOS/Electron": "trae",
372
+ "/Applications/Antigravity.app/Contents/MacOS/Electron": "antigravity",
373
+ "/Applications/AppCode.app/Contents/MacOS/appcode": "/Applications/AppCode.app/Contents/MacOS/appcode",
374
+ "/Applications/CLion.app/Contents/MacOS/clion": "/Applications/CLion.app/Contents/MacOS/clion",
375
+ "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
376
+ "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea",
377
+ "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea",
378
+ "/Applications/PhpStorm.app/Contents/MacOS/phpstorm": "/Applications/PhpStorm.app/Contents/MacOS/phpstorm",
379
+ "/Applications/PyCharm.app/Contents/MacOS/pycharm": "/Applications/PyCharm.app/Contents/MacOS/pycharm",
380
+ "/Applications/PyCharm CE.app/Contents/MacOS/pycharm": "/Applications/PyCharm CE.app/Contents/MacOS/pycharm",
381
+ "/Applications/RubyMine.app/Contents/MacOS/rubymine": "/Applications/RubyMine.app/Contents/MacOS/rubymine",
382
+ "/Applications/WebStorm.app/Contents/MacOS/webstorm": "/Applications/WebStorm.app/Contents/MacOS/webstorm",
383
+ "/Applications/MacVim.app/Contents/MacOS/MacVim": "mvim",
384
+ "/Applications/GoLand.app/Contents/MacOS/goland": "/Applications/GoLand.app/Contents/MacOS/goland",
385
+ "/Applications/Rider.app/Contents/MacOS/rider": "/Applications/Rider.app/Contents/MacOS/rider",
386
+ "/Applications/Zed.app/Contents/MacOS/zed": "zed"
387
+ };
388
+ }));
389
+ //#endregion
390
+ //#region node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js
391
+ var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
392
+ module.exports = {
393
+ atom: "atom",
394
+ Brackets: "brackets",
395
+ "code-insiders": "code-insiders",
396
+ code: "code",
397
+ vscodium: "vscodium",
398
+ codium: "codium",
399
+ cursor: "cursor",
400
+ trae: "trae",
401
+ antigravity: "antigravity",
402
+ emacs: "emacs",
403
+ gvim: "gvim",
404
+ idea: "idea",
405
+ "idea.sh": "idea",
406
+ phpstorm: "phpstorm",
407
+ "phpstorm.sh": "phpstorm",
408
+ pycharm: "pycharm",
409
+ "pycharm.sh": "pycharm",
410
+ rubymine: "rubymine",
411
+ "rubymine.sh": "rubymine",
412
+ sublime_text: "subl",
413
+ vim: "vim",
414
+ webstorm: "webstorm",
415
+ "webstorm.sh": "webstorm",
416
+ goland: "goland",
417
+ "goland.sh": "goland",
418
+ rider: "rider",
419
+ "rider.sh": "rider",
420
+ zed: "zed"
421
+ };
422
+ }));
423
+ //#endregion
424
+ //#region node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js
425
+ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
426
+ module.exports = [
427
+ "Brackets.exe",
428
+ "Code.exe",
429
+ "Code - Insiders.exe",
430
+ "VSCodium.exe",
431
+ "Cursor.exe",
432
+ "atom.exe",
433
+ "sublime_text.exe",
434
+ "notepad++.exe",
435
+ "clion.exe",
436
+ "clion64.exe",
437
+ "idea.exe",
438
+ "idea64.exe",
439
+ "phpstorm.exe",
440
+ "phpstorm64.exe",
441
+ "pycharm.exe",
442
+ "pycharm64.exe",
443
+ "rubymine.exe",
444
+ "rubymine64.exe",
445
+ "webstorm.exe",
446
+ "webstorm64.exe",
447
+ "goland.exe",
448
+ "goland64.exe",
449
+ "rider.exe",
450
+ "rider64.exe",
451
+ "Trae.exe",
452
+ "zed.exe",
453
+ "Antigravity.exe"
454
+ ];
455
+ }));
456
+ //#endregion
457
+ //#region node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js
458
+ var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
459
+ const path$2 = __require("path");
460
+ const shellQuote = require_shell_quote();
461
+ const childProcess$1 = __require("child_process");
462
+ const COMMON_EDITORS_MACOS = require_macos();
463
+ const COMMON_EDITORS_LINUX = require_linux();
464
+ const COMMON_EDITORS_WIN = require_windows();
465
+ function getEditorFromMacProcesses(output) {
466
+ const processNames = Object.keys(COMMON_EDITORS_MACOS);
467
+ const processList = output.split("\n");
468
+ for (let i = 0; i < processNames.length; i++) {
469
+ const processName = processNames[i];
470
+ if (processList.includes(processName)) return COMMON_EDITORS_MACOS[processName];
471
+ const processNameWithoutApplications = processName.replace("/Applications", "");
472
+ if (output.indexOf(processNameWithoutApplications) !== -1) {
473
+ if (processName !== COMMON_EDITORS_MACOS[processName]) return COMMON_EDITORS_MACOS[processName];
474
+ const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
475
+ if (runningProcess !== void 0) return runningProcess;
476
+ }
477
+ }
478
+ }
479
+ function getEditorFromWindowsProcesses(output) {
480
+ const runningProcesses = output.split("\r\n");
481
+ for (let i = 0; i < runningProcesses.length; i++) {
482
+ const fullProcessPath = runningProcesses[i].trim();
483
+ const shortProcessName = path$2.win32.basename(fullProcessPath);
484
+ if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) return fullProcessPath;
485
+ }
486
+ }
487
+ function getEditorFromLinuxProcesses(output) {
488
+ const processNames = Object.keys(COMMON_EDITORS_LINUX);
489
+ for (let i = 0; i < processNames.length; i++) {
490
+ const processName = processNames[i];
491
+ if (output.indexOf(processName) !== -1) return COMMON_EDITORS_LINUX[processName];
492
+ }
493
+ }
494
+ function guessEditor(specifiedEditor) {
495
+ if (specifiedEditor) return shellQuote.parse(specifiedEditor);
496
+ if (process.env.LAUNCH_EDITOR) return [process.env.LAUNCH_EDITOR];
497
+ if (process.versions.webcontainer) return [process.env.EDITOR || "code"];
498
+ try {
499
+ if (process.platform === "darwin") {
500
+ const editor = getEditorFromMacProcesses(childProcess$1.execSync("ps x -o comm=", { stdio: [
501
+ "pipe",
502
+ "pipe",
503
+ "ignore"
504
+ ] }).toString());
505
+ if (editor !== void 0) return [editor];
506
+ } else if (process.platform === "win32") {
507
+ const editor = getEditorFromWindowsProcesses(childProcess$1.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
508
+ "pipe",
509
+ "pipe",
510
+ "ignore"
511
+ ] }).toString());
512
+ if (editor !== void 0) return [editor];
513
+ } else if (process.platform === "linux") {
514
+ const editor = getEditorFromLinuxProcesses(childProcess$1.execSync("ps x --no-heading -o comm --sort=comm", { stdio: [
515
+ "pipe",
516
+ "pipe",
517
+ "ignore"
518
+ ] }).toString());
519
+ if (editor !== void 0) return [editor];
520
+ }
521
+ } catch (ignoreError) {}
522
+ if (process.env.VISUAL) return [process.env.VISUAL];
523
+ else if (process.env.EDITOR) return [process.env.EDITOR];
524
+ return [null];
525
+ }
526
+ module.exports = guessEditor;
527
+ module.exports.getEditorFromMacProcesses = getEditorFromMacProcesses;
528
+ module.exports.getEditorFromWindowsProcesses = getEditorFromWindowsProcesses;
529
+ module.exports.getEditorFromLinuxProcesses = getEditorFromLinuxProcesses;
530
+ }));
531
+ //#endregion
532
+ //#region node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js
533
+ var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
534
+ const path$1 = __require("path");
535
+ module.exports = function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
536
+ switch (path$1.basename(editor).replace(/\.(exe|cmd|bat)$/i, "")) {
537
+ case "atom":
538
+ case "Atom":
539
+ case "Atom Beta":
540
+ case "subl":
541
+ case "sublime":
542
+ case "sublime_text":
543
+ case "wstorm":
544
+ case "charm":
545
+ case "zed": return [`${fileName}:${lineNumber}:${columnNumber}`];
546
+ case "notepad++": return [
547
+ "-n" + lineNumber,
548
+ "-c" + columnNumber,
549
+ fileName
550
+ ];
551
+ case "vim":
552
+ case "mvim": return [`+call cursor(${lineNumber}, ${columnNumber})`, fileName];
553
+ case "joe":
554
+ case "gvim": return [`+${lineNumber}`, fileName];
555
+ case "emacs":
556
+ case "emacsclient": return [`+${lineNumber}:${columnNumber}`, fileName];
557
+ case "rmate":
558
+ case "mate":
559
+ case "mine": return [
560
+ "--line",
561
+ lineNumber,
562
+ fileName
563
+ ];
564
+ case "code":
565
+ case "Code":
566
+ case "code-insiders":
567
+ case "Code - Insiders":
568
+ case "codium":
569
+ case "trae":
570
+ case "antigravity":
571
+ case "cursor":
572
+ case "vscodium":
573
+ case "VSCodium": return [
574
+ "-r",
575
+ "-g",
576
+ `${fileName}:${lineNumber}:${columnNumber}`
577
+ ];
578
+ case "appcode":
579
+ case "clion":
580
+ case "clion64":
581
+ case "idea":
582
+ case "idea64":
583
+ case "phpstorm":
584
+ case "phpstorm64":
585
+ case "pycharm":
586
+ case "pycharm64":
587
+ case "rubymine":
588
+ case "rubymine64":
589
+ case "webstorm":
590
+ case "webstorm64":
591
+ case "goland":
592
+ case "goland64":
593
+ case "rider":
594
+ case "rider64": return [
595
+ "--line",
596
+ lineNumber,
597
+ "--column",
598
+ columnNumber,
599
+ fileName
600
+ ];
601
+ }
602
+ if (process.env.LAUNCH_EDITOR) return [
603
+ fileName,
604
+ lineNumber,
605
+ columnNumber
606
+ ];
607
+ return [fileName];
608
+ };
609
+ }));
610
+ //#endregion
611
+ //#region src/editor.ts
612
+ var import_launch_editor = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
613
+ /**
614
+ * Copyright (c) 2015-present, Facebook, Inc.
615
+ *
616
+ * This source code is licensed under the MIT license found in the
617
+ * LICENSE file at
618
+ * https://github.com/facebookincubator/create-react-app/blob/master/LICENSE
619
+ *
620
+ * Modified by Yuxi Evan You
621
+ */
622
+ const fs = __require("fs");
623
+ const os = __require("os");
624
+ const path = __require("path");
625
+ const colors = require_picocolors();
626
+ const childProcess = __require("child_process");
627
+ const guessEditor = require_guess();
628
+ const getArgumentsForPosition = require_get_args();
629
+ function wrapErrorCallback(cb) {
630
+ return (fileName, errorMessage) => {
631
+ console.log();
632
+ console.log(colors.red("Could not open " + path.basename(fileName) + " in the editor."));
633
+ if (errorMessage) {
634
+ if (errorMessage[errorMessage.length - 1] !== ".") errorMessage += ".";
635
+ console.log(colors.red("The editor process exited with an error: " + errorMessage));
636
+ }
637
+ console.log();
638
+ if (cb) cb(fileName, errorMessage);
639
+ };
640
+ }
641
+ function isTerminalEditor(editor) {
642
+ switch (editor) {
643
+ case "vim":
644
+ case "emacs":
645
+ case "nano": return true;
646
+ }
647
+ return false;
648
+ }
649
+ const positionRE = /:(\d+)(:(\d+))?$/;
650
+ function parseFile(file) {
651
+ if (file.startsWith("file://")) file = __require("url").fileURLToPath(file);
652
+ const fileName = file.replace(positionRE, "");
653
+ const match = file.match(positionRE);
654
+ return {
655
+ fileName,
656
+ lineNumber: match && match[1],
657
+ columnNumber: match && match[3]
658
+ };
659
+ }
660
+ let currentChildProcess = null;
661
+ function launchEditor(file, specifiedEditor, onErrorCallback) {
662
+ const parsed = parseFile(file);
663
+ let { fileName } = parsed;
664
+ const { lineNumber, columnNumber } = parsed;
665
+ if (process.platform === "win32" && path.resolve(fileName).startsWith("\\\\")) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
666
+ if (!fs.existsSync(fileName)) return;
667
+ if (typeof specifiedEditor === "function") {
668
+ onErrorCallback = specifiedEditor;
669
+ specifiedEditor = void 0;
670
+ }
671
+ onErrorCallback = wrapErrorCallback(onErrorCallback);
672
+ const [editor, ...args] = guessEditor(specifiedEditor);
673
+ if (!editor) {
674
+ onErrorCallback(fileName, null);
675
+ return;
676
+ }
677
+ if (process.platform === "linux" && fileName.startsWith("/mnt/") && /Microsoft/i.test(os.release())) fileName = path.relative("", fileName);
678
+ if (lineNumber) {
679
+ const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
680
+ args.push.apply(args, extraArgs);
681
+ } else args.push(fileName);
682
+ if (currentChildProcess && isTerminalEditor(editor)) currentChildProcess.kill("SIGKILL");
683
+ if (process.platform === "win32") {
684
+ function escapeCmdArgs(cmdArgs) {
685
+ return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
686
+ }
687
+ function doubleQuoteIfNeeded(str) {
688
+ if (str.includes("^")) return `^"${str}^"`;
689
+ else if (str.includes(" ")) return `"${str}"`;
690
+ return str;
691
+ }
692
+ const launchCommand = [editor, ...args.map(escapeCmdArgs)].map(doubleQuoteIfNeeded).join(" ");
693
+ currentChildProcess = childProcess.exec(launchCommand, {
694
+ stdio: "inherit",
695
+ shell: true
696
+ });
697
+ } else currentChildProcess = childProcess.spawn(editor, args, { stdio: "inherit" });
698
+ currentChildProcess.on("exit", function(errorCode) {
699
+ currentChildProcess = null;
700
+ if (errorCode) onErrorCallback(fileName, "(code " + errorCode + ")");
701
+ });
702
+ currentChildProcess.on("error", function(error) {
703
+ let { code, message } = error;
704
+ if ("ENOENT" === code) message = `${message} ('${editor}' command does not exist in 'PATH')`;
705
+ onErrorCallback(fileName, message);
706
+ });
707
+ }
708
+ module.exports = launchEditor;
709
+ })))(), 1);
710
+ /**
711
+ * Opens a file with launch-editor. It uses `LAUNCH_EDITOR`, `VISUAL` or `EDITOR`,
712
+ * or else an editor that runs, such as VS Code, Cursor, Zed or WebStorm.
713
+ */
714
+ const openInEditor = (file, line) => new Promise((resolve, reject) => {
715
+ (0, import_launch_editor.default)(line ? `${file}:${line}` : file, void 0, (_file, message) => {
716
+ reject(new Error(message || "comarkserv found no editor. Set the LAUNCH_EDITOR or EDITOR environment variable, for example to code or zed."));
717
+ });
718
+ setTimeout(resolve, 100);
719
+ });
720
+ //#endregion
721
+ export { openInEditor };