@vite-hub/source 0.0.3 → 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 +201 -0
  2. package/README.md +302 -31
  3. package/dist/auth-B-tX_rp0.js +1426 -0
  4. package/dist/client-BwstxtdY.js +8280 -0
  5. package/dist/client.d.ts +49 -0
  6. package/dist/client.js +179 -0
  7. package/dist/collection-B_4w_J8h.d.ts +257 -0
  8. package/dist/collection-cursor-WzV1Jd6v.js +124 -0
  9. package/dist/collection-route-BplWPxHR.js +10 -0
  10. package/dist/drizzle.d.ts +41 -0
  11. package/dist/drizzle.js +89 -0
  12. package/dist/error-diagnostics-X0kuFjBT.js +51 -0
  13. package/dist/file-BX0FSvgE.js +60 -0
  14. package/dist/file-DadN9dbN.d.ts +19 -0
  15. package/dist/file.d.ts +2 -0
  16. package/dist/file.js +2 -0
  17. package/dist/files.d.ts +15 -0
  18. package/dist/files.js +38 -0
  19. package/dist/github.d.ts +20 -0
  20. package/dist/github.js +1332 -0
  21. package/dist/glob-BmFqTvJY.js +993 -0
  22. package/dist/glob.d.ts +23 -0
  23. package/dist/glob.js +2 -0
  24. package/dist/index.d.ts +165 -172
  25. package/dist/index.js +600 -1113
  26. package/dist/markdown.d.ts +5 -0
  27. package/dist/markdown.js +10 -0
  28. package/dist/mcp.d.ts +151 -0
  29. package/dist/mcp.js +497 -0
  30. package/dist/mrmime-40h5OOIp.js +448 -0
  31. package/dist/path-BS8rYm0n.js +1956 -0
  32. package/dist/path-DOBpV8ol.js +32 -0
  33. package/dist/server.d.ts +265 -0
  34. package/dist/server.js +149 -0
  35. package/dist/sse-D9gqqNPj.js +448 -0
  36. package/dist/streamableHttp-BL-E7pl5.js +509 -0
  37. package/dist/types-BigOktIj.d.ts +93 -0
  38. package/dist/types-CoWcW8oz.js +7590 -0
  39. package/dist/vite.d.ts +162 -0
  40. package/dist/vite.js +2284 -0
  41. package/package.json +102 -17
  42. package/tsconfig.vite.json +6 -0
  43. package/types/source/fallback.d.ts +1 -0
  44. package/types/source/index.d.ts +1 -0
@@ -0,0 +1,1956 @@
1
+ import { r as normalizeSourcePath } from "./path-DOBpV8ol.js";
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+ //#endregion
25
+ //#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/constants.js
26
+ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27
+ const WIN_SLASH = "\\\\/";
28
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
29
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
30
+ /**
31
+ * Posix glob regex
32
+ */
33
+ const DOT_LITERAL = "\\.";
34
+ const PLUS_LITERAL = "\\+";
35
+ const QMARK_LITERAL = "\\?";
36
+ const SLASH_LITERAL = "\\/";
37
+ const ONE_CHAR = "(?=.)";
38
+ const QMARK = "[^/]";
39
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
40
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
41
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
42
+ const POSIX_CHARS = {
43
+ DOT_LITERAL,
44
+ PLUS_LITERAL,
45
+ QMARK_LITERAL,
46
+ SLASH_LITERAL,
47
+ ONE_CHAR,
48
+ QMARK,
49
+ END_ANCHOR,
50
+ DOTS_SLASH,
51
+ NO_DOT: `(?!${DOT_LITERAL})`,
52
+ NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
53
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
54
+ NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
55
+ QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
56
+ STAR: `${QMARK}*?`,
57
+ START_ANCHOR,
58
+ SEP: "/"
59
+ };
60
+ /**
61
+ * Windows glob regex
62
+ */
63
+ const WINDOWS_CHARS = {
64
+ ...POSIX_CHARS,
65
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
66
+ QMARK: WIN_NO_SLASH,
67
+ STAR: `${WIN_NO_SLASH}*?`,
68
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
69
+ NO_DOT: `(?!${DOT_LITERAL})`,
70
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
71
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
72
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
73
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
74
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
75
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
76
+ SEP: "\\"
77
+ };
78
+ module.exports = {
79
+ DEFAULT_MAX_EXTGLOB_RECURSION,
80
+ MAX_LENGTH: 65536,
81
+ POSIX_REGEX_SOURCE: {
82
+ __proto__: null,
83
+ alnum: "a-zA-Z0-9",
84
+ alpha: "a-zA-Z",
85
+ ascii: "\\x00-\\x7F",
86
+ blank: " \\t",
87
+ cntrl: "\\x00-\\x1F\\x7F",
88
+ digit: "0-9",
89
+ graph: "\\x21-\\x7E",
90
+ lower: "a-z",
91
+ print: "\\x20-\\x7E ",
92
+ punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
93
+ space: " \\t\\r\\n\\v\\f",
94
+ upper: "A-Z",
95
+ word: "A-Za-z0-9_",
96
+ xdigit: "A-Fa-f0-9"
97
+ },
98
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
99
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
100
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
101
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
102
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
103
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
104
+ REPLACEMENTS: {
105
+ __proto__: null,
106
+ "***": "*",
107
+ "**/**": "**",
108
+ "**/**/**": "**"
109
+ },
110
+ CHAR_0: 48,
111
+ CHAR_9: 57,
112
+ CHAR_UPPERCASE_A: 65,
113
+ CHAR_LOWERCASE_A: 97,
114
+ CHAR_UPPERCASE_Z: 90,
115
+ CHAR_LOWERCASE_Z: 122,
116
+ CHAR_LEFT_PARENTHESES: 40,
117
+ CHAR_RIGHT_PARENTHESES: 41,
118
+ CHAR_ASTERISK: 42,
119
+ CHAR_AMPERSAND: 38,
120
+ CHAR_AT: 64,
121
+ CHAR_BACKWARD_SLASH: 92,
122
+ CHAR_CARRIAGE_RETURN: 13,
123
+ CHAR_CIRCUMFLEX_ACCENT: 94,
124
+ CHAR_COLON: 58,
125
+ CHAR_COMMA: 44,
126
+ CHAR_DOT: 46,
127
+ CHAR_DOUBLE_QUOTE: 34,
128
+ CHAR_EQUAL: 61,
129
+ CHAR_EXCLAMATION_MARK: 33,
130
+ CHAR_FORM_FEED: 12,
131
+ CHAR_FORWARD_SLASH: 47,
132
+ CHAR_GRAVE_ACCENT: 96,
133
+ CHAR_HASH: 35,
134
+ CHAR_HYPHEN_MINUS: 45,
135
+ CHAR_LEFT_ANGLE_BRACKET: 60,
136
+ CHAR_LEFT_CURLY_BRACE: 123,
137
+ CHAR_LEFT_SQUARE_BRACKET: 91,
138
+ CHAR_LINE_FEED: 10,
139
+ CHAR_NO_BREAK_SPACE: 160,
140
+ CHAR_PERCENT: 37,
141
+ CHAR_PLUS: 43,
142
+ CHAR_QUESTION_MARK: 63,
143
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
144
+ CHAR_RIGHT_CURLY_BRACE: 125,
145
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
146
+ CHAR_SEMICOLON: 59,
147
+ CHAR_SINGLE_QUOTE: 39,
148
+ CHAR_SPACE: 32,
149
+ CHAR_TAB: 9,
150
+ CHAR_UNDERSCORE: 95,
151
+ CHAR_VERTICAL_LINE: 124,
152
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
153
+ /**
154
+ * Create EXTGLOB_CHARS
155
+ */
156
+ extglobChars(chars) {
157
+ return {
158
+ "!": {
159
+ type: "negate",
160
+ open: "(?:(?!(?:",
161
+ close: `))${chars.STAR})`
162
+ },
163
+ "?": {
164
+ type: "qmark",
165
+ open: "(?:",
166
+ close: ")?"
167
+ },
168
+ "+": {
169
+ type: "plus",
170
+ open: "(?:",
171
+ close: ")+"
172
+ },
173
+ "*": {
174
+ type: "star",
175
+ open: "(?:",
176
+ close: ")*"
177
+ },
178
+ "@": {
179
+ type: "at",
180
+ open: "(?:",
181
+ close: ")"
182
+ }
183
+ };
184
+ },
185
+ /**
186
+ * Create GLOB_CHARS
187
+ */
188
+ globChars(win32) {
189
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
190
+ }
191
+ };
192
+ }));
193
+ //#endregion
194
+ //#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/utils.js
195
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
196
+ const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
197
+ exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
198
+ exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
199
+ exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
200
+ exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
201
+ exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
202
+ exports.isWindows = () => {
203
+ if (typeof navigator !== "undefined" && navigator.platform) {
204
+ const platform = navigator.platform.toLowerCase();
205
+ return platform === "win32" || platform === "windows";
206
+ }
207
+ if (typeof process !== "undefined" && process.platform) return process.platform === "win32";
208
+ return false;
209
+ };
210
+ exports.removeBackslashes = (str) => {
211
+ return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
212
+ return match === "\\" ? "" : match;
213
+ });
214
+ };
215
+ exports.escapeLast = (input, char, lastIdx) => {
216
+ const idx = input.lastIndexOf(char, lastIdx);
217
+ if (idx === -1) return input;
218
+ if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
219
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
220
+ };
221
+ exports.removePrefix = (input, state = {}) => {
222
+ let output = input;
223
+ if (output.startsWith("./")) {
224
+ output = output.slice(2);
225
+ state.prefix = "./";
226
+ }
227
+ return output;
228
+ };
229
+ exports.wrapOutput = (input, state = {}, options = {}) => {
230
+ let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
231
+ if (state.negated === true) output = `(?:^(?!${output}).*$)`;
232
+ return output;
233
+ };
234
+ exports.basename = (path, { windows } = {}) => {
235
+ const segs = path.split(windows ? /[\\/]/ : "/");
236
+ const last = segs[segs.length - 1];
237
+ if (last === "") return segs[segs.length - 2];
238
+ return last;
239
+ };
240
+ }));
241
+ //#endregion
242
+ //#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/scan.js
243
+ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
244
+ const utils = require_utils();
245
+ const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
246
+ const isPathSeparator = (code) => {
247
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
248
+ };
249
+ const depth = (token) => {
250
+ if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
251
+ };
252
+ /**
253
+ * Quickly scans a glob pattern and returns an object with a handful of
254
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
255
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
256
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
257
+ *
258
+ * ```js
259
+ * const pm = require('picomatch');
260
+ * console.log(pm.scan('foo/bar/*.js'));
261
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
262
+ * ```
263
+ * @param {String} `str`
264
+ * @param {Object} `options`
265
+ * @return {Object} Returns an object with tokens and regex source string.
266
+ * @api public
267
+ */
268
+ const scan = (input, options) => {
269
+ const opts = options || {};
270
+ const length = input.length - 1;
271
+ const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
272
+ const slashes = [];
273
+ const tokens = [];
274
+ const parts = [];
275
+ let str = input;
276
+ let index = -1;
277
+ let start = 0;
278
+ let lastIndex = 0;
279
+ let isBrace = false;
280
+ let isBracket = false;
281
+ let isGlob = false;
282
+ let isExtglob = false;
283
+ let isGlobstar = false;
284
+ let braceEscaped = false;
285
+ let backslashes = false;
286
+ let negated = false;
287
+ let negatedExtglob = false;
288
+ let finished = false;
289
+ let braces = 0;
290
+ let prev;
291
+ let code;
292
+ let token = {
293
+ value: "",
294
+ depth: 0,
295
+ isGlob: false
296
+ };
297
+ const eos = () => index >= length;
298
+ const peek = () => str.charCodeAt(index + 1);
299
+ const advance = () => {
300
+ prev = code;
301
+ return str.charCodeAt(++index);
302
+ };
303
+ while (index < length) {
304
+ code = advance();
305
+ let next;
306
+ if (code === CHAR_BACKWARD_SLASH) {
307
+ backslashes = token.backslashes = true;
308
+ code = advance();
309
+ if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
310
+ continue;
311
+ }
312
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
313
+ braces++;
314
+ while (eos() !== true && (code = advance())) {
315
+ if (code === CHAR_BACKWARD_SLASH) {
316
+ backslashes = token.backslashes = true;
317
+ advance();
318
+ continue;
319
+ }
320
+ if (code === CHAR_LEFT_CURLY_BRACE) {
321
+ braces++;
322
+ continue;
323
+ }
324
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
325
+ isBrace = token.isBrace = true;
326
+ isGlob = token.isGlob = true;
327
+ finished = true;
328
+ if (scanToEnd === true) continue;
329
+ break;
330
+ }
331
+ if (braceEscaped !== true && code === CHAR_COMMA) {
332
+ isBrace = token.isBrace = true;
333
+ isGlob = token.isGlob = true;
334
+ finished = true;
335
+ if (scanToEnd === true) continue;
336
+ break;
337
+ }
338
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
339
+ braces--;
340
+ if (braces === 0) {
341
+ braceEscaped = false;
342
+ isBrace = token.isBrace = true;
343
+ finished = true;
344
+ break;
345
+ }
346
+ }
347
+ }
348
+ if (scanToEnd === true) continue;
349
+ break;
350
+ }
351
+ if (code === CHAR_FORWARD_SLASH) {
352
+ slashes.push(index);
353
+ tokens.push(token);
354
+ token = {
355
+ value: "",
356
+ depth: 0,
357
+ isGlob: false
358
+ };
359
+ if (finished === true) continue;
360
+ if (prev === CHAR_DOT && index === start + 1) {
361
+ start += 2;
362
+ continue;
363
+ }
364
+ lastIndex = index + 1;
365
+ continue;
366
+ }
367
+ if (opts.noext !== true) {
368
+ if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
369
+ isGlob = token.isGlob = true;
370
+ isExtglob = token.isExtglob = true;
371
+ finished = true;
372
+ if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
373
+ if (scanToEnd === true) {
374
+ let parens = 0;
375
+ while (eos() !== true && (code = advance())) {
376
+ if (code === CHAR_BACKWARD_SLASH) {
377
+ backslashes = token.backslashes = true;
378
+ advance();
379
+ continue;
380
+ }
381
+ if (code === CHAR_LEFT_PARENTHESES) {
382
+ parens++;
383
+ continue;
384
+ }
385
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
386
+ finished = true;
387
+ break;
388
+ }
389
+ }
390
+ continue;
391
+ }
392
+ break;
393
+ }
394
+ }
395
+ if (code === CHAR_ASTERISK) {
396
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
397
+ isGlob = token.isGlob = true;
398
+ finished = true;
399
+ if (scanToEnd === true) continue;
400
+ break;
401
+ }
402
+ if (code === CHAR_QUESTION_MARK) {
403
+ isGlob = token.isGlob = true;
404
+ finished = true;
405
+ if (scanToEnd === true) continue;
406
+ break;
407
+ }
408
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
409
+ while (eos() !== true && (next = advance())) {
410
+ if (next === CHAR_BACKWARD_SLASH) {
411
+ backslashes = token.backslashes = true;
412
+ advance();
413
+ continue;
414
+ }
415
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
416
+ isBracket = token.isBracket = true;
417
+ isGlob = token.isGlob = true;
418
+ finished = true;
419
+ break;
420
+ }
421
+ }
422
+ if (scanToEnd === true) continue;
423
+ break;
424
+ }
425
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
426
+ negated = token.negated = true;
427
+ start++;
428
+ continue;
429
+ }
430
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
431
+ isGlob = token.isGlob = true;
432
+ if (scanToEnd === true) {
433
+ let parens = 1;
434
+ while (eos() !== true && (code = advance())) {
435
+ if (code === CHAR_BACKWARD_SLASH) {
436
+ backslashes = token.backslashes = true;
437
+ advance();
438
+ continue;
439
+ }
440
+ if (code === CHAR_LEFT_PARENTHESES) {
441
+ parens++;
442
+ continue;
443
+ }
444
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
445
+ finished = true;
446
+ break;
447
+ }
448
+ }
449
+ continue;
450
+ }
451
+ break;
452
+ }
453
+ if (isGlob === true) {
454
+ finished = true;
455
+ if (scanToEnd === true) continue;
456
+ break;
457
+ }
458
+ }
459
+ if (opts.noext === true) {
460
+ isExtglob = false;
461
+ isGlob = false;
462
+ }
463
+ let base = str;
464
+ let prefix = "";
465
+ let glob = "";
466
+ if (start > 0) {
467
+ prefix = str.slice(0, start);
468
+ str = str.slice(start);
469
+ lastIndex -= start;
470
+ }
471
+ if (base && isGlob === true && lastIndex > 0) {
472
+ base = str.slice(0, lastIndex);
473
+ glob = str.slice(lastIndex);
474
+ } else if (isGlob === true) {
475
+ base = "";
476
+ glob = str;
477
+ } else base = str;
478
+ if (base && base !== "" && base !== "/" && base !== str) {
479
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
480
+ }
481
+ if (opts.unescape === true) {
482
+ if (glob) glob = utils.removeBackslashes(glob);
483
+ if (base && backslashes === true) base = utils.removeBackslashes(base);
484
+ }
485
+ const state = {
486
+ prefix,
487
+ input,
488
+ start,
489
+ base,
490
+ glob,
491
+ isBrace,
492
+ isBracket,
493
+ isGlob,
494
+ isExtglob,
495
+ isGlobstar,
496
+ negated,
497
+ negatedExtglob
498
+ };
499
+ if (opts.tokens === true) {
500
+ state.maxDepth = 0;
501
+ if (!isPathSeparator(code)) tokens.push(token);
502
+ state.tokens = tokens;
503
+ }
504
+ if (opts.parts === true || opts.tokens === true) {
505
+ let prevIndex;
506
+ for (let idx = 0; idx < slashes.length; idx++) {
507
+ const n = prevIndex !== void 0 ? prevIndex + 1 : start;
508
+ const i = slashes[idx];
509
+ const value = input.slice(n, i);
510
+ if (opts.tokens) {
511
+ if (idx === 0 && start !== 0) {
512
+ tokens[idx].isPrefix = true;
513
+ tokens[idx].value = prefix;
514
+ } else tokens[idx].value = value;
515
+ depth(tokens[idx]);
516
+ state.maxDepth += tokens[idx].depth;
517
+ }
518
+ if (i >= start) {
519
+ parts.push(value);
520
+ prevIndex = i;
521
+ }
522
+ }
523
+ const n = prevIndex !== void 0 ? prevIndex + 1 : start;
524
+ const value = input.slice(n);
525
+ parts.push(value);
526
+ if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
527
+ tokens[tokens.length - 1].value = value;
528
+ depth(tokens[tokens.length - 1]);
529
+ state.maxDepth += tokens[tokens.length - 1].depth;
530
+ }
531
+ state.slashes = slashes;
532
+ state.parts = parts;
533
+ }
534
+ return state;
535
+ };
536
+ module.exports = scan;
537
+ }));
538
+ //#endregion
539
+ //#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/parse.js
540
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
541
+ const constants = require_constants();
542
+ const utils = require_utils();
543
+ /**
544
+ * Constants
545
+ */
546
+ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
547
+ /**
548
+ * Helpers
549
+ */
550
+ const expandRange = (args, options) => {
551
+ if (typeof options.expandRange === "function") return options.expandRange(...args, options);
552
+ args.sort();
553
+ const value = `[${args.join("-")}]`;
554
+ try {
555
+ new RegExp(value);
556
+ } catch (ex) {
557
+ return args.map((v) => utils.escapeRegex(v)).join("..");
558
+ }
559
+ return value;
560
+ };
561
+ /**
562
+ * Create the message for a syntax error
563
+ */
564
+ const syntaxError = (type, char) => {
565
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
566
+ };
567
+ const splitTopLevel = (input) => {
568
+ const parts = [];
569
+ let bracket = 0;
570
+ let paren = 0;
571
+ let quote = 0;
572
+ let value = "";
573
+ let escaped = false;
574
+ for (const ch of input) {
575
+ if (escaped === true) {
576
+ value += ch;
577
+ escaped = false;
578
+ continue;
579
+ }
580
+ if (ch === "\\") {
581
+ value += ch;
582
+ escaped = true;
583
+ continue;
584
+ }
585
+ if (ch === "\"") {
586
+ quote = quote === 1 ? 0 : 1;
587
+ value += ch;
588
+ continue;
589
+ }
590
+ if (quote === 0) {
591
+ if (ch === "[") bracket++;
592
+ else if (ch === "]" && bracket > 0) bracket--;
593
+ else if (bracket === 0) {
594
+ if (ch === "(") paren++;
595
+ else if (ch === ")" && paren > 0) paren--;
596
+ else if (ch === "|" && paren === 0) {
597
+ parts.push(value);
598
+ value = "";
599
+ continue;
600
+ }
601
+ }
602
+ }
603
+ value += ch;
604
+ }
605
+ parts.push(value);
606
+ return parts;
607
+ };
608
+ const isPlainBranch = (branch) => {
609
+ let escaped = false;
610
+ for (const ch of branch) {
611
+ if (escaped === true) {
612
+ escaped = false;
613
+ continue;
614
+ }
615
+ if (ch === "\\") {
616
+ escaped = true;
617
+ continue;
618
+ }
619
+ if (/[?*+@!()[\]{}]/.test(ch)) return false;
620
+ }
621
+ return true;
622
+ };
623
+ const normalizeSimpleBranch = (branch) => {
624
+ let value = branch.trim();
625
+ let changed = true;
626
+ while (changed === true) {
627
+ changed = false;
628
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
629
+ value = value.slice(2, -1);
630
+ changed = true;
631
+ }
632
+ }
633
+ if (!isPlainBranch(value)) return;
634
+ return value.replace(/\\(.)/g, "$1");
635
+ };
636
+ const hasRepeatedCharPrefixOverlap = (branches) => {
637
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
638
+ for (let i = 0; i < values.length; i++) for (let j = i + 1; j < values.length; j++) {
639
+ const a = values[i];
640
+ const b = values[j];
641
+ const char = a[0];
642
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
643
+ if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
644
+ }
645
+ return false;
646
+ };
647
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
648
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
649
+ let bracket = 0;
650
+ let paren = 0;
651
+ let quote = 0;
652
+ let escaped = false;
653
+ for (let i = 1; i < pattern.length; i++) {
654
+ const ch = pattern[i];
655
+ if (escaped === true) {
656
+ escaped = false;
657
+ continue;
658
+ }
659
+ if (ch === "\\") {
660
+ escaped = true;
661
+ continue;
662
+ }
663
+ if (ch === "\"") {
664
+ quote = quote === 1 ? 0 : 1;
665
+ continue;
666
+ }
667
+ if (quote === 1) continue;
668
+ if (ch === "[") {
669
+ bracket++;
670
+ continue;
671
+ }
672
+ if (ch === "]" && bracket > 0) {
673
+ bracket--;
674
+ continue;
675
+ }
676
+ if (bracket > 0) continue;
677
+ if (ch === "(") {
678
+ paren++;
679
+ continue;
680
+ }
681
+ if (ch === ")") {
682
+ paren--;
683
+ if (paren === 0) {
684
+ if (requireEnd === true && i !== pattern.length - 1) return;
685
+ return {
686
+ type: pattern[0],
687
+ body: pattern.slice(2, i),
688
+ end: i
689
+ };
690
+ }
691
+ }
692
+ }
693
+ };
694
+ const buildCharClassStar = (chars) => {
695
+ return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
696
+ };
697
+ const getStarExtglobSequenceChars = (pattern) => {
698
+ let index = 0;
699
+ const chars = [];
700
+ while (index < pattern.length) {
701
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
702
+ if (!match || match.type !== "*") return;
703
+ const branches = splitTopLevel(match.body).map((branch) => branch.trim());
704
+ if (branches.length !== 1) return;
705
+ const branch = normalizeSimpleBranch(branches[0]);
706
+ if (!branch || branch.length !== 1) return;
707
+ chars.push(branch);
708
+ index += match.end + 1;
709
+ }
710
+ if (chars.length < 1) return;
711
+ return chars;
712
+ };
713
+ const repeatedExtglobRecursion = (pattern) => {
714
+ let depth = 0;
715
+ let value = pattern.trim();
716
+ let match = parseRepeatedExtglob(value);
717
+ while (match) {
718
+ depth++;
719
+ value = match.body.trim();
720
+ match = parseRepeatedExtglob(value);
721
+ }
722
+ return depth;
723
+ };
724
+ const analyzeRepeatedExtglob = (body, options) => {
725
+ if (options.maxExtglobRecursion === false) return { risky: false };
726
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
727
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
728
+ if (branches.length > 1) {
729
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
730
+ }
731
+ const safeChars = [];
732
+ let sawStarSequence = false;
733
+ let combinable = true;
734
+ for (const branch of branches) {
735
+ const chars = getStarExtglobSequenceChars(branch);
736
+ if (chars) {
737
+ sawStarSequence = true;
738
+ safeChars.push(...chars);
739
+ continue;
740
+ }
741
+ const literal = normalizeSimpleBranch(branch);
742
+ if (literal && literal.length === 1) {
743
+ safeChars.push(literal);
744
+ continue;
745
+ }
746
+ combinable = false;
747
+ if (repeatedExtglobRecursion(branch) > max) return { risky: true };
748
+ }
749
+ if (sawStarSequence) return combinable ? {
750
+ risky: true,
751
+ safeOutput: buildCharClassStar([...new Set(safeChars)])
752
+ } : { risky: true };
753
+ return { risky: false };
754
+ };
755
+ /**
756
+ * Parse the given input string.
757
+ * @param {String} input
758
+ * @param {Object} options
759
+ * @return {Object}
760
+ */
761
+ const parse = (input, options) => {
762
+ if (typeof input !== "string") throw new TypeError("Expected a string");
763
+ input = REPLACEMENTS[input] || input;
764
+ const opts = { ...options };
765
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
766
+ let len = input.length;
767
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
768
+ const bos = {
769
+ type: "bos",
770
+ value: "",
771
+ output: opts.prepend || ""
772
+ };
773
+ const tokens = [bos];
774
+ const capture = opts.capture ? "" : "?:";
775
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
776
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
777
+ const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
778
+ const globstar = (opts) => {
779
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
780
+ };
781
+ const nodot = opts.dot ? "" : NO_DOT;
782
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
783
+ let star = opts.bash === true ? globstar(opts) : STAR;
784
+ if (opts.capture) star = `(${star})`;
785
+ if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
786
+ const state = {
787
+ input,
788
+ index: -1,
789
+ start: 0,
790
+ dot: opts.dot === true,
791
+ consumed: "",
792
+ output: "",
793
+ prefix: "",
794
+ backtrack: false,
795
+ negated: false,
796
+ brackets: 0,
797
+ braces: 0,
798
+ parens: 0,
799
+ quotes: 0,
800
+ globstar: false,
801
+ tokens
802
+ };
803
+ input = utils.removePrefix(input, state);
804
+ len = input.length;
805
+ const extglobs = [];
806
+ const braces = [];
807
+ const stack = [];
808
+ let prev = bos;
809
+ let value;
810
+ /**
811
+ * Tokenizing helpers
812
+ */
813
+ const eos = () => state.index === len - 1;
814
+ const peek = state.peek = (n = 1) => input[state.index + n];
815
+ const advance = state.advance = () => input[++state.index] || "";
816
+ const remaining = () => input.slice(state.index + 1);
817
+ const consume = (value = "", num = 0) => {
818
+ state.consumed += value;
819
+ state.index += num;
820
+ };
821
+ const append = (token) => {
822
+ state.output += token.output != null ? token.output : token.value;
823
+ consume(token.value);
824
+ };
825
+ const negate = () => {
826
+ let count = 1;
827
+ while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
828
+ advance();
829
+ state.start++;
830
+ count++;
831
+ }
832
+ if (count % 2 === 0) return false;
833
+ state.negated = true;
834
+ state.start++;
835
+ return true;
836
+ };
837
+ const increment = (type) => {
838
+ state[type]++;
839
+ stack.push(type);
840
+ };
841
+ const decrement = (type) => {
842
+ state[type]--;
843
+ stack.pop();
844
+ };
845
+ /**
846
+ * Push tokens onto the tokens array. This helper speeds up
847
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
848
+ * and 2) helping us avoid creating extra tokens when consecutive
849
+ * characters are plain text. This improves performance and simplifies
850
+ * lookbehinds.
851
+ */
852
+ const push = (tok) => {
853
+ if (prev.type === "globstar") {
854
+ const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
855
+ const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
856
+ if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
857
+ state.output = state.output.slice(0, -prev.output.length);
858
+ prev.type = "star";
859
+ prev.value = "*";
860
+ prev.output = star;
861
+ state.output += prev.output;
862
+ }
863
+ }
864
+ if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
865
+ if (tok.value || tok.output) append(tok);
866
+ if (prev && prev.type === "text" && tok.type === "text") {
867
+ prev.output = (prev.output || prev.value) + tok.value;
868
+ prev.value += tok.value;
869
+ return;
870
+ }
871
+ tok.prev = prev;
872
+ tokens.push(tok);
873
+ prev = tok;
874
+ };
875
+ const extglobOpen = (type, value) => {
876
+ const token = {
877
+ ...EXTGLOB_CHARS[value],
878
+ conditions: 1,
879
+ inner: ""
880
+ };
881
+ token.prev = prev;
882
+ token.parens = state.parens;
883
+ token.output = state.output;
884
+ token.startIndex = state.index;
885
+ token.tokensIndex = tokens.length;
886
+ const output = (opts.capture ? "(" : "") + token.open;
887
+ increment("parens");
888
+ push({
889
+ type,
890
+ value,
891
+ output: state.output ? "" : ONE_CHAR
892
+ });
893
+ push({
894
+ type: "paren",
895
+ extglob: true,
896
+ value: advance(),
897
+ output
898
+ });
899
+ extglobs.push(token);
900
+ };
901
+ const extglobClose = (token) => {
902
+ const literal = input.slice(token.startIndex, state.index + 1);
903
+ const body = input.slice(token.startIndex + 2, state.index);
904
+ const analysis = analyzeRepeatedExtglob(body, opts);
905
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
906
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
907
+ const open = tokens[token.tokensIndex];
908
+ open.type = "text";
909
+ open.value = literal;
910
+ open.output = safeOutput || utils.escapeRegex(literal);
911
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
912
+ tokens[i].value = "";
913
+ tokens[i].output = "";
914
+ delete tokens[i].suffix;
915
+ }
916
+ state.output = token.output + open.output;
917
+ state.backtrack = true;
918
+ push({
919
+ type: "paren",
920
+ extglob: true,
921
+ value,
922
+ output: ""
923
+ });
924
+ decrement("parens");
925
+ return;
926
+ }
927
+ let output = token.close + (opts.capture ? ")" : "");
928
+ let rest;
929
+ if (token.type === "negate") {
930
+ let extglobStar = star;
931
+ if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
932
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
933
+ if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
934
+ ...options,
935
+ fastpaths: false
936
+ }).output})${extglobStar})`;
937
+ if (token.prev.type === "bos") state.negatedExtglob = true;
938
+ }
939
+ push({
940
+ type: "paren",
941
+ extglob: true,
942
+ value,
943
+ output
944
+ });
945
+ decrement("parens");
946
+ };
947
+ /**
948
+ * Fast paths
949
+ */
950
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
951
+ let backslashes = false;
952
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
953
+ if (first === "\\") {
954
+ backslashes = true;
955
+ return m;
956
+ }
957
+ if (first === "?") {
958
+ if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
959
+ if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
960
+ return QMARK.repeat(chars.length);
961
+ }
962
+ if (first === ".") return DOT_LITERAL.repeat(chars.length);
963
+ if (first === "*") {
964
+ if (esc) return esc + first + (rest ? star : "");
965
+ return star;
966
+ }
967
+ return esc ? m : `\\${m}`;
968
+ });
969
+ if (backslashes === true) {
970
+ if (opts.unescape === true) output = output.replace(/\\/g, "");
971
+ else output = output.replace(/\\+/g, (m) => {
972
+ return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
973
+ });
974
+ }
975
+ if (output === input && opts.contains === true) {
976
+ state.output = input;
977
+ return state;
978
+ }
979
+ state.output = utils.wrapOutput(output, state, options);
980
+ return state;
981
+ }
982
+ /**
983
+ * Tokenize input until we reach end-of-string
984
+ */
985
+ while (!eos()) {
986
+ value = advance();
987
+ if (value === "\0") continue;
988
+ /**
989
+ * Escaped characters
990
+ */
991
+ if (value === "\\") {
992
+ const next = peek();
993
+ if (next === "/" && opts.bash !== true) continue;
994
+ if (next === "." || next === ";") continue;
995
+ if (!next) {
996
+ value += "\\";
997
+ push({
998
+ type: "text",
999
+ value
1000
+ });
1001
+ continue;
1002
+ }
1003
+ const match = /^\\+/.exec(remaining());
1004
+ let slashes = 0;
1005
+ if (match && match[0].length > 2) {
1006
+ slashes = match[0].length;
1007
+ state.index += slashes;
1008
+ if (slashes % 2 !== 0) value += "\\";
1009
+ }
1010
+ if (opts.unescape === true) value = advance();
1011
+ else value += advance();
1012
+ if (state.brackets === 0) {
1013
+ push({
1014
+ type: "text",
1015
+ value
1016
+ });
1017
+ continue;
1018
+ }
1019
+ }
1020
+ /**
1021
+ * If we're inside a regex character class, continue
1022
+ * until we reach the closing bracket.
1023
+ */
1024
+ if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
1025
+ if (opts.posix !== false && value === ":") {
1026
+ const inner = prev.value.slice(1);
1027
+ if (inner.includes("[")) {
1028
+ prev.posix = true;
1029
+ if (inner.includes(":")) {
1030
+ const idx = prev.value.lastIndexOf("[");
1031
+ const pre = prev.value.slice(0, idx);
1032
+ const rest = prev.value.slice(idx + 2);
1033
+ const posix = POSIX_REGEX_SOURCE[rest];
1034
+ if (posix) {
1035
+ prev.value = pre + posix;
1036
+ state.backtrack = true;
1037
+ advance();
1038
+ if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
1039
+ continue;
1040
+ }
1041
+ }
1042
+ }
1043
+ }
1044
+ if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
1045
+ if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
1046
+ if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
1047
+ prev.value += value;
1048
+ append({ value });
1049
+ continue;
1050
+ }
1051
+ /**
1052
+ * If we're inside a quoted string, continue
1053
+ * until we reach the closing double quote.
1054
+ */
1055
+ if (state.quotes === 1 && value !== "\"") {
1056
+ value = utils.escapeRegex(value);
1057
+ prev.value += value;
1058
+ append({ value });
1059
+ continue;
1060
+ }
1061
+ /**
1062
+ * Double quotes
1063
+ */
1064
+ if (value === "\"") {
1065
+ state.quotes = state.quotes === 1 ? 0 : 1;
1066
+ if (opts.keepQuotes === true) push({
1067
+ type: "text",
1068
+ value
1069
+ });
1070
+ continue;
1071
+ }
1072
+ /**
1073
+ * Parentheses
1074
+ */
1075
+ if (value === "(") {
1076
+ increment("parens");
1077
+ push({
1078
+ type: "paren",
1079
+ value
1080
+ });
1081
+ continue;
1082
+ }
1083
+ if (value === ")") {
1084
+ if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
1085
+ const extglob = extglobs[extglobs.length - 1];
1086
+ if (extglob && state.parens === extglob.parens + 1) {
1087
+ extglobClose(extglobs.pop());
1088
+ continue;
1089
+ }
1090
+ push({
1091
+ type: "paren",
1092
+ value,
1093
+ output: state.parens ? ")" : "\\)"
1094
+ });
1095
+ decrement("parens");
1096
+ continue;
1097
+ }
1098
+ /**
1099
+ * Square brackets
1100
+ */
1101
+ if (value === "[") {
1102
+ if (opts.nobracket === true || !remaining().includes("]")) {
1103
+ if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
1104
+ value = `\\${value}`;
1105
+ } else increment("brackets");
1106
+ push({
1107
+ type: "bracket",
1108
+ value
1109
+ });
1110
+ continue;
1111
+ }
1112
+ if (value === "]") {
1113
+ if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
1114
+ push({
1115
+ type: "text",
1116
+ value,
1117
+ output: `\\${value}`
1118
+ });
1119
+ continue;
1120
+ }
1121
+ if (state.brackets === 0) {
1122
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
1123
+ push({
1124
+ type: "text",
1125
+ value,
1126
+ output: `\\${value}`
1127
+ });
1128
+ continue;
1129
+ }
1130
+ decrement("brackets");
1131
+ const prevValue = prev.value.slice(1);
1132
+ if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
1133
+ prev.value += value;
1134
+ append({ value });
1135
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
1136
+ const escaped = utils.escapeRegex(prev.value);
1137
+ state.output = state.output.slice(0, -prev.value.length);
1138
+ if (opts.literalBrackets === true) {
1139
+ state.output += escaped;
1140
+ prev.value = escaped;
1141
+ continue;
1142
+ }
1143
+ prev.value = `(${capture}${escaped}|${prev.value})`;
1144
+ state.output += prev.value;
1145
+ continue;
1146
+ }
1147
+ /**
1148
+ * Braces
1149
+ */
1150
+ if (value === "{" && opts.nobrace !== true) {
1151
+ increment("braces");
1152
+ const open = {
1153
+ type: "brace",
1154
+ value,
1155
+ output: "(",
1156
+ outputIndex: state.output.length,
1157
+ tokensIndex: state.tokens.length
1158
+ };
1159
+ braces.push(open);
1160
+ push(open);
1161
+ continue;
1162
+ }
1163
+ if (value === "}") {
1164
+ const brace = braces[braces.length - 1];
1165
+ if (opts.nobrace === true || !brace) {
1166
+ push({
1167
+ type: "text",
1168
+ value,
1169
+ output: value
1170
+ });
1171
+ continue;
1172
+ }
1173
+ let output = ")";
1174
+ if (brace.dots === true) {
1175
+ const arr = tokens.slice();
1176
+ const range = [];
1177
+ for (let i = arr.length - 1; i >= 0; i--) {
1178
+ tokens.pop();
1179
+ if (arr[i].type === "brace") break;
1180
+ if (arr[i].type !== "dots") range.unshift(arr[i].value);
1181
+ }
1182
+ output = expandRange(range, opts);
1183
+ state.backtrack = true;
1184
+ }
1185
+ if (brace.comma !== true && brace.dots !== true) {
1186
+ const out = state.output.slice(0, brace.outputIndex);
1187
+ const toks = state.tokens.slice(brace.tokensIndex);
1188
+ brace.value = brace.output = "\\{";
1189
+ value = output = "\\}";
1190
+ state.output = out;
1191
+ for (const t of toks) state.output += t.output || t.value;
1192
+ }
1193
+ push({
1194
+ type: "brace",
1195
+ value,
1196
+ output
1197
+ });
1198
+ decrement("braces");
1199
+ braces.pop();
1200
+ continue;
1201
+ }
1202
+ /**
1203
+ * Pipes
1204
+ */
1205
+ if (value === "|") {
1206
+ if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
1207
+ push({
1208
+ type: "text",
1209
+ value
1210
+ });
1211
+ continue;
1212
+ }
1213
+ /**
1214
+ * Commas
1215
+ */
1216
+ if (value === ",") {
1217
+ let output = value;
1218
+ const brace = braces[braces.length - 1];
1219
+ if (brace && stack[stack.length - 1] === "braces") {
1220
+ brace.comma = true;
1221
+ output = "|";
1222
+ }
1223
+ push({
1224
+ type: "comma",
1225
+ value,
1226
+ output
1227
+ });
1228
+ continue;
1229
+ }
1230
+ /**
1231
+ * Slashes
1232
+ */
1233
+ if (value === "/") {
1234
+ if (prev.type === "dot" && state.index === state.start + 1) {
1235
+ state.start = state.index + 1;
1236
+ state.consumed = "";
1237
+ state.output = "";
1238
+ tokens.pop();
1239
+ prev = bos;
1240
+ continue;
1241
+ }
1242
+ push({
1243
+ type: "slash",
1244
+ value,
1245
+ output: SLASH_LITERAL
1246
+ });
1247
+ continue;
1248
+ }
1249
+ /**
1250
+ * Dots
1251
+ */
1252
+ if (value === ".") {
1253
+ if (state.braces > 0 && prev.type === "dot") {
1254
+ if (prev.value === ".") prev.output = DOT_LITERAL;
1255
+ const brace = braces[braces.length - 1];
1256
+ prev.type = "dots";
1257
+ prev.output += value;
1258
+ prev.value += value;
1259
+ brace.dots = true;
1260
+ continue;
1261
+ }
1262
+ if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
1263
+ push({
1264
+ type: "text",
1265
+ value,
1266
+ output: DOT_LITERAL
1267
+ });
1268
+ continue;
1269
+ }
1270
+ push({
1271
+ type: "dot",
1272
+ value,
1273
+ output: DOT_LITERAL
1274
+ });
1275
+ continue;
1276
+ }
1277
+ /**
1278
+ * Question marks
1279
+ */
1280
+ if (value === "?") {
1281
+ if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1282
+ extglobOpen("qmark", value);
1283
+ continue;
1284
+ }
1285
+ if (prev && prev.type === "paren") {
1286
+ const next = peek();
1287
+ let output = value;
1288
+ if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
1289
+ push({
1290
+ type: "text",
1291
+ value,
1292
+ output
1293
+ });
1294
+ continue;
1295
+ }
1296
+ if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
1297
+ push({
1298
+ type: "qmark",
1299
+ value,
1300
+ output: QMARK_NO_DOT
1301
+ });
1302
+ continue;
1303
+ }
1304
+ push({
1305
+ type: "qmark",
1306
+ value,
1307
+ output: QMARK
1308
+ });
1309
+ continue;
1310
+ }
1311
+ /**
1312
+ * Exclamation
1313
+ */
1314
+ if (value === "!") {
1315
+ if (opts.noextglob !== true && peek() === "(") {
1316
+ if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
1317
+ extglobOpen("negate", value);
1318
+ continue;
1319
+ }
1320
+ }
1321
+ if (opts.nonegate !== true && state.index === 0) {
1322
+ negate();
1323
+ continue;
1324
+ }
1325
+ }
1326
+ /**
1327
+ * Plus
1328
+ */
1329
+ if (value === "+") {
1330
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1331
+ extglobOpen("plus", value);
1332
+ continue;
1333
+ }
1334
+ if (prev && prev.value === "(" || opts.regex === false) {
1335
+ push({
1336
+ type: "plus",
1337
+ value,
1338
+ output: PLUS_LITERAL
1339
+ });
1340
+ continue;
1341
+ }
1342
+ if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
1343
+ push({
1344
+ type: "plus",
1345
+ value
1346
+ });
1347
+ continue;
1348
+ }
1349
+ push({
1350
+ type: "plus",
1351
+ value: PLUS_LITERAL
1352
+ });
1353
+ continue;
1354
+ }
1355
+ /**
1356
+ * Plain text
1357
+ */
1358
+ if (value === "@") {
1359
+ if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
1360
+ push({
1361
+ type: "at",
1362
+ extglob: true,
1363
+ value,
1364
+ output: ""
1365
+ });
1366
+ continue;
1367
+ }
1368
+ push({
1369
+ type: "text",
1370
+ value
1371
+ });
1372
+ continue;
1373
+ }
1374
+ /**
1375
+ * Plain text
1376
+ */
1377
+ if (value !== "*") {
1378
+ if (value === "$" || value === "^") value = `\\${value}`;
1379
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1380
+ if (match) {
1381
+ value += match[0];
1382
+ state.index += match[0].length;
1383
+ }
1384
+ push({
1385
+ type: "text",
1386
+ value
1387
+ });
1388
+ continue;
1389
+ }
1390
+ /**
1391
+ * Stars
1392
+ */
1393
+ if (prev && (prev.type === "globstar" || prev.star === true)) {
1394
+ prev.type = "star";
1395
+ prev.star = true;
1396
+ prev.value += value;
1397
+ prev.output = star;
1398
+ state.backtrack = true;
1399
+ state.globstar = true;
1400
+ consume(value);
1401
+ continue;
1402
+ }
1403
+ let rest = remaining();
1404
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1405
+ extglobOpen("star", value);
1406
+ continue;
1407
+ }
1408
+ if (prev.type === "star") {
1409
+ if (opts.noglobstar === true) {
1410
+ consume(value);
1411
+ continue;
1412
+ }
1413
+ const prior = prev.prev;
1414
+ const before = prior.prev;
1415
+ const isStart = prior.type === "slash" || prior.type === "bos";
1416
+ const afterStar = before && (before.type === "star" || before.type === "globstar");
1417
+ if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
1418
+ push({
1419
+ type: "star",
1420
+ value,
1421
+ output: ""
1422
+ });
1423
+ continue;
1424
+ }
1425
+ const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
1426
+ const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
1427
+ if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
1428
+ push({
1429
+ type: "star",
1430
+ value,
1431
+ output: ""
1432
+ });
1433
+ continue;
1434
+ }
1435
+ while (rest.slice(0, 3) === "/**") {
1436
+ const after = input[state.index + 4];
1437
+ if (after && after !== "/") break;
1438
+ rest = rest.slice(3);
1439
+ consume("/**", 3);
1440
+ }
1441
+ const isEnd = eos() || state.parens > 0 && rest === ")".repeat(state.parens) && !extglobs.some((extglob) => extglob.type === "negate");
1442
+ if (prior.type === "bos" && eos()) {
1443
+ prev.type = "globstar";
1444
+ prev.value += value;
1445
+ prev.output = globstar(opts);
1446
+ state.output = prev.output;
1447
+ state.globstar = true;
1448
+ consume(value);
1449
+ continue;
1450
+ }
1451
+ if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && isEnd) {
1452
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1453
+ prior.output = `(?:${prior.output}`;
1454
+ prev.type = "globstar";
1455
+ prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
1456
+ prev.value += value;
1457
+ state.globstar = true;
1458
+ state.output += prior.output + prev.output;
1459
+ consume(value);
1460
+ continue;
1461
+ }
1462
+ if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
1463
+ const end = rest[1] !== void 0 ? "|$" : "";
1464
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1465
+ prior.output = `(?:${prior.output}`;
1466
+ prev.type = "globstar";
1467
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1468
+ prev.value += value;
1469
+ state.output += prior.output + prev.output;
1470
+ state.globstar = true;
1471
+ consume(value + advance());
1472
+ push({
1473
+ type: "slash",
1474
+ value: "/",
1475
+ output: ""
1476
+ });
1477
+ continue;
1478
+ }
1479
+ if (prior.type === "bos" && rest[0] === "/") {
1480
+ prev.type = "globstar";
1481
+ prev.value += value;
1482
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1483
+ state.output = prev.output;
1484
+ state.globstar = true;
1485
+ consume(value + advance());
1486
+ push({
1487
+ type: "slash",
1488
+ value: "/",
1489
+ output: ""
1490
+ });
1491
+ continue;
1492
+ }
1493
+ state.output = state.output.slice(0, -prev.output.length);
1494
+ prev.type = "globstar";
1495
+ prev.output = globstar(opts);
1496
+ prev.value += value;
1497
+ state.output += prev.output;
1498
+ state.globstar = true;
1499
+ consume(value);
1500
+ continue;
1501
+ }
1502
+ const token = {
1503
+ type: "star",
1504
+ value,
1505
+ output: star
1506
+ };
1507
+ if (opts.bash === true) {
1508
+ token.output = ".*?";
1509
+ if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
1510
+ push(token);
1511
+ continue;
1512
+ }
1513
+ if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
1514
+ token.output = value;
1515
+ push(token);
1516
+ continue;
1517
+ }
1518
+ if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
1519
+ if (prev.type === "dot") {
1520
+ state.output += NO_DOT_SLASH;
1521
+ prev.output += NO_DOT_SLASH;
1522
+ } else if (opts.dot === true) {
1523
+ state.output += NO_DOTS_SLASH;
1524
+ prev.output += NO_DOTS_SLASH;
1525
+ } else {
1526
+ state.output += nodot;
1527
+ prev.output += nodot;
1528
+ }
1529
+ if (peek() !== "*") {
1530
+ state.output += ONE_CHAR;
1531
+ prev.output += ONE_CHAR;
1532
+ }
1533
+ }
1534
+ push(token);
1535
+ }
1536
+ while (state.brackets > 0) {
1537
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
1538
+ state.output = utils.escapeLast(state.output, "[");
1539
+ decrement("brackets");
1540
+ }
1541
+ while (state.parens > 0) {
1542
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
1543
+ state.output = utils.escapeLast(state.output, "(");
1544
+ decrement("parens");
1545
+ }
1546
+ while (state.braces > 0) {
1547
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
1548
+ state.output = utils.escapeLast(state.output, "{");
1549
+ decrement("braces");
1550
+ }
1551
+ if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
1552
+ type: "maybe_slash",
1553
+ value: "",
1554
+ output: `${SLASH_LITERAL}?`
1555
+ });
1556
+ if (state.backtrack === true) {
1557
+ state.output = "";
1558
+ for (const token of state.tokens) {
1559
+ state.output += token.output != null ? token.output : token.value;
1560
+ if (token.suffix) state.output += token.suffix;
1561
+ }
1562
+ }
1563
+ return state;
1564
+ };
1565
+ /**
1566
+ * Fast paths for creating regular expressions for common glob patterns.
1567
+ * This can significantly speed up processing and has very little downside
1568
+ * impact when none of the fast paths match.
1569
+ */
1570
+ parse.fastpaths = (input, options) => {
1571
+ const opts = { ...options };
1572
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1573
+ const len = input.length;
1574
+ if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1575
+ input = REPLACEMENTS[input] || input;
1576
+ const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows);
1577
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
1578
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1579
+ const capture = opts.capture ? "" : "?:";
1580
+ const state = {
1581
+ negated: false,
1582
+ prefix: ""
1583
+ };
1584
+ let star = opts.bash === true ? ".*?" : STAR;
1585
+ if (opts.capture) star = `(${star})`;
1586
+ const globstar = (opts) => {
1587
+ if (opts.noglobstar === true) return star;
1588
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1589
+ };
1590
+ const create = (str) => {
1591
+ switch (str) {
1592
+ case "*": return `${nodot}${ONE_CHAR}${star}`;
1593
+ case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
1594
+ case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1595
+ case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
1596
+ case "**": return nodot + globstar(opts);
1597
+ case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
1598
+ case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1599
+ case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
1600
+ default: {
1601
+ const match = /^(.*?)\.(\w+)$/.exec(str);
1602
+ if (!match) return;
1603
+ const source = create(match[1]);
1604
+ if (!source) return;
1605
+ return source + DOT_LITERAL + match[2];
1606
+ }
1607
+ }
1608
+ };
1609
+ let source = create(utils.removePrefix(input, state));
1610
+ if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
1611
+ return source;
1612
+ };
1613
+ module.exports = parse;
1614
+ }));
1615
+ //#endregion
1616
+ //#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/lib/picomatch.js
1617
+ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1618
+ const scan = require_scan();
1619
+ const parse = require_parse();
1620
+ const utils = require_utils();
1621
+ const constants = require_constants();
1622
+ const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
1623
+ /**
1624
+ * Creates a matcher function from one or more glob patterns. The
1625
+ * returned function takes a string to match as its first argument,
1626
+ * and returns true if the string is a match. The returned matcher
1627
+ * function also takes a boolean as the second argument that, when true,
1628
+ * returns an object with additional information.
1629
+ *
1630
+ * ```js
1631
+ * const picomatch = require('picomatch');
1632
+ * // picomatch(glob[, options]);
1633
+ *
1634
+ * const isMatch = picomatch('*.!(*a)');
1635
+ * console.log(isMatch('a.a')); //=> false
1636
+ * console.log(isMatch('a.b')); //=> true
1637
+ *
1638
+ * // For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
1639
+ * const picomatch = require('picomatch/posix');
1640
+ * // the same API, defaulting to posix paths
1641
+ * const isMatch = picomatch('a/*');
1642
+ * console.log(isMatch('a\\b')); //=> false
1643
+ * console.log(isMatch('a/b')); //=> true
1644
+ *
1645
+ * // you can still configure the matcher function to accept windows paths
1646
+ * const isMatch = picomatch('a/*', { options: windows });
1647
+ * console.log(isMatch('a\\b')); //=> true
1648
+ * console.log(isMatch('a/b')); //=> true
1649
+ * ```
1650
+ * @name picomatch
1651
+ * @param {String|Array} `globs` One or more glob patterns.
1652
+ * @param {Object=} `options`
1653
+ * @return {Function=} Returns a matcher function.
1654
+ * @api public
1655
+ */
1656
+ const picomatch = (glob, options, returnState = false) => {
1657
+ if (Array.isArray(glob)) {
1658
+ const fns = glob.map((input) => picomatch(input, options, returnState));
1659
+ const arrayMatcher = (str) => {
1660
+ for (const isMatch of fns) {
1661
+ const state = isMatch(str);
1662
+ if (state) return state;
1663
+ }
1664
+ return false;
1665
+ };
1666
+ return arrayMatcher;
1667
+ }
1668
+ const isState = isObject(glob) && glob.tokens && glob.input;
1669
+ if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
1670
+ const opts = options || {};
1671
+ const posix = opts.windows;
1672
+ const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
1673
+ const state = regex.state;
1674
+ delete regex.state;
1675
+ let isIgnored = () => false;
1676
+ if (opts.ignore) {
1677
+ const ignoreOpts = {
1678
+ ...options,
1679
+ ignore: null,
1680
+ onMatch: null,
1681
+ onResult: null
1682
+ };
1683
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
1684
+ }
1685
+ const matcher = (input, returnObject = false) => {
1686
+ const { isMatch, match, output } = picomatch.test(input, regex, options, {
1687
+ glob,
1688
+ posix
1689
+ });
1690
+ const result = {
1691
+ glob,
1692
+ state,
1693
+ regex,
1694
+ posix,
1695
+ input,
1696
+ output,
1697
+ match,
1698
+ isMatch
1699
+ };
1700
+ if (typeof opts.onResult === "function") opts.onResult(result);
1701
+ if (isMatch === false) {
1702
+ result.isMatch = false;
1703
+ return returnObject ? result : false;
1704
+ }
1705
+ if (isIgnored(input)) {
1706
+ if (typeof opts.onIgnore === "function") opts.onIgnore(result);
1707
+ result.isMatch = false;
1708
+ return returnObject ? result : false;
1709
+ }
1710
+ if (typeof opts.onMatch === "function") opts.onMatch(result);
1711
+ return returnObject ? result : true;
1712
+ };
1713
+ if (returnState) matcher.state = state;
1714
+ return matcher;
1715
+ };
1716
+ /**
1717
+ * Test `input` with the given `regex`. This is used by the main
1718
+ * `picomatch()` function to test the input string.
1719
+ *
1720
+ * ```js
1721
+ * const picomatch = require('picomatch');
1722
+ * // picomatch.test(input, regex[, options]);
1723
+ *
1724
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
1725
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
1726
+ * ```
1727
+ * @param {String} `input` String to test.
1728
+ * @param {RegExp} `regex`
1729
+ * @return {Object} Returns an object with matching info.
1730
+ * @api public
1731
+ */
1732
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
1733
+ if (typeof input !== "string") throw new TypeError("Expected input to be a string");
1734
+ if (input === "") return {
1735
+ isMatch: false,
1736
+ output: ""
1737
+ };
1738
+ const opts = options || {};
1739
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
1740
+ let match = input === glob;
1741
+ let output = match && format ? format(input) : input;
1742
+ if (match === false) {
1743
+ output = format ? format(input) : input;
1744
+ match = output === glob;
1745
+ }
1746
+ if (match === false || opts.capture === true) {
1747
+ if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
1748
+ else match = regex.exec(output);
1749
+ }
1750
+ return {
1751
+ isMatch: Boolean(match),
1752
+ match,
1753
+ output
1754
+ };
1755
+ };
1756
+ /**
1757
+ * Match the basename of a filepath.
1758
+ *
1759
+ * ```js
1760
+ * const picomatch = require('picomatch');
1761
+ * // picomatch.matchBase(input, glob[, options]);
1762
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
1763
+ * ```
1764
+ * @param {String} `input` String to test.
1765
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
1766
+ * @return {Boolean}
1767
+ * @api public
1768
+ */
1769
+ picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
1770
+ return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input, { windows: posix }));
1771
+ };
1772
+ /**
1773
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
1774
+ *
1775
+ * ```js
1776
+ * const picomatch = require('picomatch');
1777
+ * // picomatch.isMatch(string, patterns[, options]);
1778
+ *
1779
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
1780
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
1781
+ * ```
1782
+ * @param {String|Array} str The string to test.
1783
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
1784
+ * @param {Object} [options] See available [options](#options).
1785
+ * @return {Boolean} Returns true if any patterns match `str`
1786
+ * @api public
1787
+ */
1788
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
1789
+ /**
1790
+ * Parse a glob pattern to create the source string for a regular
1791
+ * expression.
1792
+ *
1793
+ * ```js
1794
+ * const picomatch = require('picomatch');
1795
+ * const result = picomatch.parse(pattern[, options]);
1796
+ * ```
1797
+ * @param {String} `pattern`
1798
+ * @param {Object} `options`
1799
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
1800
+ * @api public
1801
+ */
1802
+ picomatch.parse = (pattern, options) => {
1803
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
1804
+ return parse(pattern, {
1805
+ ...options,
1806
+ fastpaths: false
1807
+ });
1808
+ };
1809
+ /**
1810
+ * Scan a glob pattern to separate the pattern into segments.
1811
+ *
1812
+ * ```js
1813
+ * const picomatch = require('picomatch');
1814
+ * // picomatch.scan(input[, options]);
1815
+ *
1816
+ * const result = picomatch.scan('!./foo/*.js');
1817
+ * console.log(result);
1818
+ * { prefix: '!./',
1819
+ * input: '!./foo/*.js',
1820
+ * start: 3,
1821
+ * base: 'foo',
1822
+ * glob: '*.js',
1823
+ * isBrace: false,
1824
+ * isBracket: false,
1825
+ * isGlob: true,
1826
+ * isExtglob: false,
1827
+ * isGlobstar: false,
1828
+ * negated: true }
1829
+ * ```
1830
+ * @param {String} `input` Glob pattern to scan.
1831
+ * @param {Object} `options`
1832
+ * @return {Object} Returns an object with
1833
+ * @api public
1834
+ */
1835
+ picomatch.scan = (input, options) => scan(input, options);
1836
+ /**
1837
+ * Compile a regular expression from the `state` object returned by the
1838
+ * [parse()](#parse) method.
1839
+ *
1840
+ * ```js
1841
+ * const picomatch = require('picomatch');
1842
+ * const state = picomatch.parse('*.js');
1843
+ * // picomatch.compileRe(state[, options]);
1844
+ *
1845
+ * console.log(picomatch.compileRe(state));
1846
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1847
+ * ```
1848
+ * @param {Object} `state`
1849
+ * @param {Object} `options`
1850
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
1851
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
1852
+ * @return {RegExp}
1853
+ * @api public
1854
+ */
1855
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
1856
+ if (returnOutput === true) return state.output;
1857
+ const opts = options || {};
1858
+ const prepend = opts.contains ? "" : "^";
1859
+ const append = opts.contains ? "" : "$";
1860
+ let source = `${prepend}(?:${state.output})${append}`;
1861
+ if (state && state.negated === true) source = `^(?!${source}).*$`;
1862
+ const regex = picomatch.toRegex(source, options);
1863
+ if (returnState === true) regex.state = state;
1864
+ return regex;
1865
+ };
1866
+ /**
1867
+ * Create a regular expression from a parsed glob pattern.
1868
+ *
1869
+ * ```js
1870
+ * const picomatch = require('picomatch');
1871
+ * // picomatch.makeRe(state[, options]);
1872
+ *
1873
+ * const result = picomatch.makeRe('*.js');
1874
+ * console.log(result);
1875
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1876
+ * ```
1877
+ * @param {String} `state` The object returned from the `.parse` method.
1878
+ * @param {Object} `options`
1879
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
1880
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
1881
+ * @return {RegExp} Returns a regex created from the given pattern.
1882
+ * @api public
1883
+ */
1884
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
1885
+ if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
1886
+ let parsed = {
1887
+ negated: false,
1888
+ fastpaths: true
1889
+ };
1890
+ if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
1891
+ if (!parsed.output) parsed = parse(input, options);
1892
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
1893
+ };
1894
+ /**
1895
+ * Create a regular expression from the given regex source string.
1896
+ *
1897
+ * ```js
1898
+ * const picomatch = require('picomatch');
1899
+ * // picomatch.toRegex(source[, options]);
1900
+ *
1901
+ * const { output } = picomatch.parse('*.js');
1902
+ * console.log(picomatch.toRegex(output));
1903
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
1904
+ * ```
1905
+ * @param {String} `source` Regular expression source string.
1906
+ * @param {Object} `options`
1907
+ * @return {RegExp}
1908
+ * @api public
1909
+ */
1910
+ picomatch.toRegex = (source, options) => {
1911
+ try {
1912
+ const opts = options || {};
1913
+ return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
1914
+ } catch (err) {
1915
+ if (options && options.debug === true) throw err;
1916
+ return /$^/;
1917
+ }
1918
+ };
1919
+ /**
1920
+ * Picomatch constants.
1921
+ * @return {Object}
1922
+ */
1923
+ picomatch.constants = constants;
1924
+ /**
1925
+ * Expose "picomatch"
1926
+ */
1927
+ module.exports = picomatch;
1928
+ }));
1929
+ //#endregion
1930
+ //#region ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/index.js
1931
+ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1932
+ const pico = require_picomatch$1();
1933
+ const utils = require_utils();
1934
+ function picomatch(glob, options, returnState = false) {
1935
+ if (options && (options.windows === null || options.windows === void 0)) options = {
1936
+ ...options,
1937
+ windows: utils.isWindows()
1938
+ };
1939
+ return pico(glob, options, returnState);
1940
+ }
1941
+ Object.assign(picomatch, pico);
1942
+ module.exports = picomatch;
1943
+ }));
1944
+ //#endregion
1945
+ //#region src/sources/path.ts
1946
+ var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
1947
+ function createPathMatcher(patterns) {
1948
+ if (!patterns) return () => true;
1949
+ const match = (0, import_picomatch.default)((Array.isArray(patterns) ? patterns : [String(patterns)]).map((pattern) => normalizeSourcePath(pattern)), { dot: true });
1950
+ return (path) => match(normalizeSourcePath(path));
1951
+ }
1952
+ function matchesAny(path, patterns) {
1953
+ return createPathMatcher(patterns)(path);
1954
+ }
1955
+ //#endregion
1956
+ export { __toESM as a, __commonJSMin as i, matchesAny as n, require_picomatch as r, createPathMatcher as t };