@arcote.tech/arc-cli 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ var __export = (target, all) => {
29
29
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
30
30
  var __require = import.meta.require;
31
31
 
32
- // node_modules/commander/lib/error.js
32
+ // ../../node_modules/commander/lib/error.js
33
33
  var require_error = __commonJS((exports) => {
34
34
  class CommanderError extends Error {
35
35
  constructor(exitCode, code, message) {
@@ -53,7 +53,7 @@ var require_error = __commonJS((exports) => {
53
53
  exports.InvalidArgumentError = InvalidArgumentError;
54
54
  });
55
55
 
56
- // node_modules/commander/lib/argument.js
56
+ // ../../node_modules/commander/lib/argument.js
57
57
  var require_argument = __commonJS((exports) => {
58
58
  var { InvalidArgumentError } = require_error();
59
59
 
@@ -132,7 +132,7 @@ var require_argument = __commonJS((exports) => {
132
132
  exports.humanReadableArgName = humanReadableArgName;
133
133
  });
134
134
 
135
- // node_modules/commander/lib/help.js
135
+ // ../../node_modules/commander/lib/help.js
136
136
  var require_help = __commonJS((exports) => {
137
137
  var { humanReadableArgName } = require_argument();
138
138
 
@@ -379,7 +379,7 @@ var require_help = __commonJS((exports) => {
379
379
  exports.Help = Help;
380
380
  });
381
381
 
382
- // node_modules/commander/lib/option.js
382
+ // ../../node_modules/commander/lib/option.js
383
383
  var require_option = __commonJS((exports) => {
384
384
  var { InvalidArgumentError } = require_error();
385
385
 
@@ -531,7 +531,7 @@ var require_option = __commonJS((exports) => {
531
531
  exports.DualOptions = DualOptions;
532
532
  });
533
533
 
534
- // node_modules/commander/lib/suggestSimilar.js
534
+ // ../../node_modules/commander/lib/suggestSimilar.js
535
535
  var require_suggestSimilar = __commonJS((exports) => {
536
536
  var maxDistance = 3;
537
537
  function editDistance(a, b) {
@@ -604,7 +604,7 @@ var require_suggestSimilar = __commonJS((exports) => {
604
604
  exports.suggestSimilar = suggestSimilar;
605
605
  });
606
606
 
607
- // node_modules/commander/lib/command.js
607
+ // ../../node_modules/commander/lib/command.js
608
608
  var require_command = __commonJS((exports) => {
609
609
  var EventEmitter = __require("node:events").EventEmitter;
610
610
  var childProcess = __require("node:child_process");
@@ -1787,7 +1787,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1787
1787
  exports.Command = Command;
1788
1788
  });
1789
1789
 
1790
- // node_modules/commander/index.js
1790
+ // ../../node_modules/commander/index.js
1791
1791
  var require_commander = __commonJS((exports, module) => {
1792
1792
  var { Argument } = require_argument();
1793
1793
  var { Command } = require_command();
@@ -4153,12 +4153,11 @@ var require_brace_expansion = __commonJS((exports, module) => {
4153
4153
  }
4154
4154
  });
4155
4155
 
4156
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/constants.js
4156
+ // ../../node_modules/picomatch/lib/constants.js
4157
4157
  var require_constants = __commonJS((exports, module) => {
4158
4158
  var path4 = __require("node:path");
4159
4159
  var WIN_SLASH = "\\\\/";
4160
4160
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
4161
- var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
4162
4161
  var DOT_LITERAL = "\\.";
4163
4162
  var PLUS_LITERAL = "\\+";
4164
4163
  var QMARK_LITERAL = "\\?";
@@ -4206,7 +4205,6 @@ var require_constants = __commonJS((exports, module) => {
4206
4205
  END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
4207
4206
  };
4208
4207
  var POSIX_REGEX_SOURCE = {
4209
- __proto__: null,
4210
4208
  alnum: "a-zA-Z0-9",
4211
4209
  alpha: "a-zA-Z",
4212
4210
  ascii: "\\x00-\\x7F",
@@ -4223,7 +4221,6 @@ var require_constants = __commonJS((exports, module) => {
4223
4221
  xdigit: "A-Fa-f0-9"
4224
4222
  };
4225
4223
  module.exports = {
4226
- DEFAULT_MAX_EXTGLOB_RECURSION,
4227
4224
  MAX_LENGTH: 1024 * 64,
4228
4225
  POSIX_REGEX_SOURCE,
4229
4226
  REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
@@ -4233,7 +4230,6 @@ var require_constants = __commonJS((exports, module) => {
4233
4230
  REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
4234
4231
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
4235
4232
  REPLACEMENTS: {
4236
- __proto__: null,
4237
4233
  "***": "*",
4238
4234
  "**/**": "**",
4239
4235
  "**/**/**": "**"
@@ -4297,7 +4293,7 @@ var require_constants = __commonJS((exports, module) => {
4297
4293
  };
4298
4294
  });
4299
4295
 
4300
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/utils.js
4296
+ // ../../node_modules/picomatch/lib/utils.js
4301
4297
  var require_utils = __commonJS((exports) => {
4302
4298
  var path4 = __require("node:path");
4303
4299
  var win322 = process.platform === "win32";
@@ -4357,7 +4353,7 @@ var require_utils = __commonJS((exports) => {
4357
4353
  };
4358
4354
  });
4359
4355
 
4360
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/scan.js
4356
+ // ../../node_modules/picomatch/lib/scan.js
4361
4357
  var require_scan = __commonJS((exports, module) => {
4362
4358
  var utils = require_utils();
4363
4359
  var {
@@ -4672,7 +4668,7 @@ var require_scan = __commonJS((exports, module) => {
4672
4668
  module.exports = scan;
4673
4669
  });
4674
4670
 
4675
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/parse.js
4671
+ // ../../node_modules/picomatch/lib/parse.js
4676
4672
  var require_parse = __commonJS((exports, module) => {
4677
4673
  var constants = require_constants();
4678
4674
  var utils = require_utils();
@@ -4699,213 +4695,6 @@ var require_parse = __commonJS((exports, module) => {
4699
4695
  var syntaxError = (type, char) => {
4700
4696
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
4701
4697
  };
4702
- var splitTopLevel = (input) => {
4703
- const parts = [];
4704
- let bracket = 0;
4705
- let paren = 0;
4706
- let quote = 0;
4707
- let value = "";
4708
- let escaped = false;
4709
- for (const ch of input) {
4710
- if (escaped === true) {
4711
- value += ch;
4712
- escaped = false;
4713
- continue;
4714
- }
4715
- if (ch === "\\") {
4716
- value += ch;
4717
- escaped = true;
4718
- continue;
4719
- }
4720
- if (ch === '"') {
4721
- quote = quote === 1 ? 0 : 1;
4722
- value += ch;
4723
- continue;
4724
- }
4725
- if (quote === 0) {
4726
- if (ch === "[") {
4727
- bracket++;
4728
- } else if (ch === "]" && bracket > 0) {
4729
- bracket--;
4730
- } else if (bracket === 0) {
4731
- if (ch === "(") {
4732
- paren++;
4733
- } else if (ch === ")" && paren > 0) {
4734
- paren--;
4735
- } else if (ch === "|" && paren === 0) {
4736
- parts.push(value);
4737
- value = "";
4738
- continue;
4739
- }
4740
- }
4741
- }
4742
- value += ch;
4743
- }
4744
- parts.push(value);
4745
- return parts;
4746
- };
4747
- var isPlainBranch = (branch) => {
4748
- let escaped = false;
4749
- for (const ch of branch) {
4750
- if (escaped === true) {
4751
- escaped = false;
4752
- continue;
4753
- }
4754
- if (ch === "\\") {
4755
- escaped = true;
4756
- continue;
4757
- }
4758
- if (/[?*+@!()[\]{}]/.test(ch)) {
4759
- return false;
4760
- }
4761
- }
4762
- return true;
4763
- };
4764
- var normalizeSimpleBranch = (branch) => {
4765
- let value = branch.trim();
4766
- let changed = true;
4767
- while (changed === true) {
4768
- changed = false;
4769
- if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
4770
- value = value.slice(2, -1);
4771
- changed = true;
4772
- }
4773
- }
4774
- if (!isPlainBranch(value)) {
4775
- return;
4776
- }
4777
- return value.replace(/\\(.)/g, "$1");
4778
- };
4779
- var hasRepeatedCharPrefixOverlap = (branches) => {
4780
- const values = branches.map(normalizeSimpleBranch).filter(Boolean);
4781
- for (let i = 0;i < values.length; i++) {
4782
- for (let j = i + 1;j < values.length; j++) {
4783
- const a = values[i];
4784
- const b = values[j];
4785
- const char = a[0];
4786
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
4787
- continue;
4788
- }
4789
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
4790
- return true;
4791
- }
4792
- }
4793
- }
4794
- return false;
4795
- };
4796
- var parseRepeatedExtglob = (pattern, requireEnd = true) => {
4797
- if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
4798
- return;
4799
- }
4800
- let bracket = 0;
4801
- let paren = 0;
4802
- let quote = 0;
4803
- let escaped = false;
4804
- for (let i = 1;i < pattern.length; i++) {
4805
- const ch = pattern[i];
4806
- if (escaped === true) {
4807
- escaped = false;
4808
- continue;
4809
- }
4810
- if (ch === "\\") {
4811
- escaped = true;
4812
- continue;
4813
- }
4814
- if (ch === '"') {
4815
- quote = quote === 1 ? 0 : 1;
4816
- continue;
4817
- }
4818
- if (quote === 1) {
4819
- continue;
4820
- }
4821
- if (ch === "[") {
4822
- bracket++;
4823
- continue;
4824
- }
4825
- if (ch === "]" && bracket > 0) {
4826
- bracket--;
4827
- continue;
4828
- }
4829
- if (bracket > 0) {
4830
- continue;
4831
- }
4832
- if (ch === "(") {
4833
- paren++;
4834
- continue;
4835
- }
4836
- if (ch === ")") {
4837
- paren--;
4838
- if (paren === 0) {
4839
- if (requireEnd === true && i !== pattern.length - 1) {
4840
- return;
4841
- }
4842
- return {
4843
- type: pattern[0],
4844
- body: pattern.slice(2, i),
4845
- end: i
4846
- };
4847
- }
4848
- }
4849
- }
4850
- };
4851
- var getStarExtglobSequenceOutput = (pattern) => {
4852
- let index = 0;
4853
- const chars = [];
4854
- while (index < pattern.length) {
4855
- const match2 = parseRepeatedExtglob(pattern.slice(index), false);
4856
- if (!match2 || match2.type !== "*") {
4857
- return;
4858
- }
4859
- const branches = splitTopLevel(match2.body).map((branch2) => branch2.trim());
4860
- if (branches.length !== 1) {
4861
- return;
4862
- }
4863
- const branch = normalizeSimpleBranch(branches[0]);
4864
- if (!branch || branch.length !== 1) {
4865
- return;
4866
- }
4867
- chars.push(branch);
4868
- index += match2.end + 1;
4869
- }
4870
- if (chars.length < 1) {
4871
- return;
4872
- }
4873
- const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
4874
- return `${source}*`;
4875
- };
4876
- var repeatedExtglobRecursion = (pattern) => {
4877
- let depth = 0;
4878
- let value = pattern.trim();
4879
- let match2 = parseRepeatedExtglob(value);
4880
- while (match2) {
4881
- depth++;
4882
- value = match2.body.trim();
4883
- match2 = parseRepeatedExtglob(value);
4884
- }
4885
- return depth;
4886
- };
4887
- var analyzeRepeatedExtglob = (body, options) => {
4888
- if (options.maxExtglobRecursion === false) {
4889
- return { risky: false };
4890
- }
4891
- const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
4892
- const branches = splitTopLevel(body).map((branch) => branch.trim());
4893
- if (branches.length > 1) {
4894
- if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
4895
- return { risky: true };
4896
- }
4897
- }
4898
- for (const branch of branches) {
4899
- const safeOutput = getStarExtglobSequenceOutput(branch);
4900
- if (safeOutput) {
4901
- return { risky: true, safeOutput };
4902
- }
4903
- if (repeatedExtglobRecursion(branch) > max) {
4904
- return { risky: true };
4905
- }
4906
- }
4907
- return { risky: false };
4908
- };
4909
4698
  var parse = (input, options) => {
4910
4699
  if (typeof input !== "string") {
4911
4700
  throw new TypeError("Expected a string");
@@ -5038,8 +4827,6 @@ var require_parse = __commonJS((exports, module) => {
5038
4827
  token.prev = prev;
5039
4828
  token.parens = state.parens;
5040
4829
  token.output = state.output;
5041
- token.startIndex = state.index;
5042
- token.tokensIndex = tokens.length;
5043
4830
  const output = (opts.capture ? "(" : "") + token.open;
5044
4831
  increment("parens");
5045
4832
  push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
@@ -5047,26 +4834,6 @@ var require_parse = __commonJS((exports, module) => {
5047
4834
  extglobs.push(token);
5048
4835
  };
5049
4836
  const extglobClose = (token) => {
5050
- const literal = input.slice(token.startIndex, state.index + 1);
5051
- const body = input.slice(token.startIndex + 2, state.index);
5052
- const analysis = analyzeRepeatedExtglob(body, opts);
5053
- if ((token.type === "plus" || token.type === "star") && analysis.risky) {
5054
- const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined;
5055
- const open = tokens[token.tokensIndex];
5056
- open.type = "text";
5057
- open.value = literal;
5058
- open.output = safeOutput || utils.escapeRegex(literal);
5059
- for (let i = token.tokensIndex + 1;i < tokens.length; i++) {
5060
- tokens[i].value = "";
5061
- tokens[i].output = "";
5062
- delete tokens[i].suffix;
5063
- }
5064
- state.output = token.output + open.output;
5065
- state.backtrack = true;
5066
- push({ type: "paren", extglob: true, value, output: "" });
5067
- decrement("parens");
5068
- return;
5069
- }
5070
4837
  let output = token.close + (opts.capture ? ")" : "");
5071
4838
  let rest;
5072
4839
  if (token.type === "negate") {
@@ -5679,7 +5446,7 @@ var require_parse = __commonJS((exports, module) => {
5679
5446
  module.exports = parse;
5680
5447
  });
5681
5448
 
5682
- // node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/picomatch.js
5449
+ // ../../node_modules/picomatch/lib/picomatch.js
5683
5450
  var require_picomatch = __commonJS((exports, module) => {
5684
5451
  var path4 = __require("node:path");
5685
5452
  var scan = require_scan();
@@ -5820,7 +5587,7 @@ var require_picomatch = __commonJS((exports, module) => {
5820
5587
  module.exports = picomatch;
5821
5588
  });
5822
5589
 
5823
- // node_modules/chokidar/node_modules/readdirp/index.js
5590
+ // ../../node_modules/readdirp/index.js
5824
5591
  var require_readdirp = __commonJS((exports, module) => {
5825
5592
  var fs2 = __require("node:fs");
5826
5593
  var { Readable } = __require("node:stream");
@@ -6048,1441 +5815,7 @@ var require_readdirp = __commonJS((exports, module) => {
6048
5815
  readdirp.promise = readdirpPromise;
6049
5816
  readdirp.ReaddirpStream = ReaddirpStream;
6050
5817
  readdirp.default = readdirp;
6051
- module.exports = readdirp;
6052
- });
6053
-
6054
- // ../../node_modules/picomatch/lib/constants.js
6055
- var require_constants2 = __commonJS((exports, module) => {
6056
- var path4 = __require("node:path");
6057
- var WIN_SLASH = "\\\\/";
6058
- var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
6059
- var DOT_LITERAL = "\\.";
6060
- var PLUS_LITERAL = "\\+";
6061
- var QMARK_LITERAL = "\\?";
6062
- var SLASH_LITERAL = "\\/";
6063
- var ONE_CHAR = "(?=.)";
6064
- var QMARK = "[^/]";
6065
- var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
6066
- var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
6067
- var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
6068
- var NO_DOT = `(?!${DOT_LITERAL})`;
6069
- var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
6070
- var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
6071
- var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
6072
- var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
6073
- var STAR = `${QMARK}*?`;
6074
- var POSIX_CHARS = {
6075
- DOT_LITERAL,
6076
- PLUS_LITERAL,
6077
- QMARK_LITERAL,
6078
- SLASH_LITERAL,
6079
- ONE_CHAR,
6080
- QMARK,
6081
- END_ANCHOR,
6082
- DOTS_SLASH,
6083
- NO_DOT,
6084
- NO_DOTS,
6085
- NO_DOT_SLASH,
6086
- NO_DOTS_SLASH,
6087
- QMARK_NO_DOT,
6088
- STAR,
6089
- START_ANCHOR
6090
- };
6091
- var WINDOWS_CHARS = {
6092
- ...POSIX_CHARS,
6093
- SLASH_LITERAL: `[${WIN_SLASH}]`,
6094
- QMARK: WIN_NO_SLASH,
6095
- STAR: `${WIN_NO_SLASH}*?`,
6096
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
6097
- NO_DOT: `(?!${DOT_LITERAL})`,
6098
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6099
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
6100
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6101
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
6102
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
6103
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
6104
- };
6105
- var POSIX_REGEX_SOURCE = {
6106
- alnum: "a-zA-Z0-9",
6107
- alpha: "a-zA-Z",
6108
- ascii: "\\x00-\\x7F",
6109
- blank: " \\t",
6110
- cntrl: "\\x00-\\x1F\\x7F",
6111
- digit: "0-9",
6112
- graph: "\\x21-\\x7E",
6113
- lower: "a-z",
6114
- print: "\\x20-\\x7E ",
6115
- punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
6116
- space: " \\t\\r\\n\\v\\f",
6117
- upper: "A-Z",
6118
- word: "A-Za-z0-9_",
6119
- xdigit: "A-Fa-f0-9"
6120
- };
6121
- module.exports = {
6122
- MAX_LENGTH: 1024 * 64,
6123
- POSIX_REGEX_SOURCE,
6124
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
6125
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
6126
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
6127
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
6128
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
6129
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
6130
- REPLACEMENTS: {
6131
- "***": "*",
6132
- "**/**": "**",
6133
- "**/**/**": "**"
6134
- },
6135
- CHAR_0: 48,
6136
- CHAR_9: 57,
6137
- CHAR_UPPERCASE_A: 65,
6138
- CHAR_LOWERCASE_A: 97,
6139
- CHAR_UPPERCASE_Z: 90,
6140
- CHAR_LOWERCASE_Z: 122,
6141
- CHAR_LEFT_PARENTHESES: 40,
6142
- CHAR_RIGHT_PARENTHESES: 41,
6143
- CHAR_ASTERISK: 42,
6144
- CHAR_AMPERSAND: 38,
6145
- CHAR_AT: 64,
6146
- CHAR_BACKWARD_SLASH: 92,
6147
- CHAR_CARRIAGE_RETURN: 13,
6148
- CHAR_CIRCUMFLEX_ACCENT: 94,
6149
- CHAR_COLON: 58,
6150
- CHAR_COMMA: 44,
6151
- CHAR_DOT: 46,
6152
- CHAR_DOUBLE_QUOTE: 34,
6153
- CHAR_EQUAL: 61,
6154
- CHAR_EXCLAMATION_MARK: 33,
6155
- CHAR_FORM_FEED: 12,
6156
- CHAR_FORWARD_SLASH: 47,
6157
- CHAR_GRAVE_ACCENT: 96,
6158
- CHAR_HASH: 35,
6159
- CHAR_HYPHEN_MINUS: 45,
6160
- CHAR_LEFT_ANGLE_BRACKET: 60,
6161
- CHAR_LEFT_CURLY_BRACE: 123,
6162
- CHAR_LEFT_SQUARE_BRACKET: 91,
6163
- CHAR_LINE_FEED: 10,
6164
- CHAR_NO_BREAK_SPACE: 160,
6165
- CHAR_PERCENT: 37,
6166
- CHAR_PLUS: 43,
6167
- CHAR_QUESTION_MARK: 63,
6168
- CHAR_RIGHT_ANGLE_BRACKET: 62,
6169
- CHAR_RIGHT_CURLY_BRACE: 125,
6170
- CHAR_RIGHT_SQUARE_BRACKET: 93,
6171
- CHAR_SEMICOLON: 59,
6172
- CHAR_SINGLE_QUOTE: 39,
6173
- CHAR_SPACE: 32,
6174
- CHAR_TAB: 9,
6175
- CHAR_UNDERSCORE: 95,
6176
- CHAR_VERTICAL_LINE: 124,
6177
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
6178
- SEP: path4.sep,
6179
- extglobChars(chars) {
6180
- return {
6181
- "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
6182
- "?": { type: "qmark", open: "(?:", close: ")?" },
6183
- "+": { type: "plus", open: "(?:", close: ")+" },
6184
- "*": { type: "star", open: "(?:", close: ")*" },
6185
- "@": { type: "at", open: "(?:", close: ")" }
6186
- };
6187
- },
6188
- globChars(win322) {
6189
- return win322 === true ? WINDOWS_CHARS : POSIX_CHARS;
6190
- }
6191
- };
6192
- });
6193
-
6194
- // ../../node_modules/picomatch/lib/utils.js
6195
- var require_utils2 = __commonJS((exports) => {
6196
- var path4 = __require("node:path");
6197
- var win322 = process.platform === "win32";
6198
- var {
6199
- REGEX_BACKSLASH,
6200
- REGEX_REMOVE_BACKSLASH,
6201
- REGEX_SPECIAL_CHARS,
6202
- REGEX_SPECIAL_CHARS_GLOBAL
6203
- } = require_constants2();
6204
- exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
6205
- exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
6206
- exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
6207
- exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
6208
- exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
6209
- exports.removeBackslashes = (str) => {
6210
- return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => {
6211
- return match2 === "\\" ? "" : match2;
6212
- });
6213
- };
6214
- exports.supportsLookbehinds = () => {
6215
- const segs = process.version.slice(1).split(".").map(Number);
6216
- if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
6217
- return true;
6218
- }
6219
- return false;
6220
- };
6221
- exports.isWindows = (options) => {
6222
- if (options && typeof options.windows === "boolean") {
6223
- return options.windows;
6224
- }
6225
- return win322 === true || path4.sep === "\\";
6226
- };
6227
- exports.escapeLast = (input, char, lastIdx) => {
6228
- const idx = input.lastIndexOf(char, lastIdx);
6229
- if (idx === -1)
6230
- return input;
6231
- if (input[idx - 1] === "\\")
6232
- return exports.escapeLast(input, char, idx - 1);
6233
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
6234
- };
6235
- exports.removePrefix = (input, state = {}) => {
6236
- let output = input;
6237
- if (output.startsWith("./")) {
6238
- output = output.slice(2);
6239
- state.prefix = "./";
6240
- }
6241
- return output;
6242
- };
6243
- exports.wrapOutput = (input, state = {}, options = {}) => {
6244
- const prepend = options.contains ? "" : "^";
6245
- const append = options.contains ? "" : "$";
6246
- let output = `${prepend}(?:${input})${append}`;
6247
- if (state.negated === true) {
6248
- output = `(?:^(?!${output}).*$)`;
6249
- }
6250
- return output;
6251
- };
6252
- });
6253
-
6254
- // ../../node_modules/picomatch/lib/scan.js
6255
- var require_scan2 = __commonJS((exports, module) => {
6256
- var utils = require_utils2();
6257
- var {
6258
- CHAR_ASTERISK,
6259
- CHAR_AT,
6260
- CHAR_BACKWARD_SLASH,
6261
- CHAR_COMMA,
6262
- CHAR_DOT,
6263
- CHAR_EXCLAMATION_MARK,
6264
- CHAR_FORWARD_SLASH,
6265
- CHAR_LEFT_CURLY_BRACE,
6266
- CHAR_LEFT_PARENTHESES,
6267
- CHAR_LEFT_SQUARE_BRACKET,
6268
- CHAR_PLUS,
6269
- CHAR_QUESTION_MARK,
6270
- CHAR_RIGHT_CURLY_BRACE,
6271
- CHAR_RIGHT_PARENTHESES,
6272
- CHAR_RIGHT_SQUARE_BRACKET
6273
- } = require_constants2();
6274
- var isPathSeparator = (code) => {
6275
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
6276
- };
6277
- var depth = (token) => {
6278
- if (token.isPrefix !== true) {
6279
- token.depth = token.isGlobstar ? Infinity : 1;
6280
- }
6281
- };
6282
- var scan = (input, options) => {
6283
- const opts = options || {};
6284
- const length = input.length - 1;
6285
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
6286
- const slashes = [];
6287
- const tokens = [];
6288
- const parts = [];
6289
- let str = input;
6290
- let index = -1;
6291
- let start = 0;
6292
- let lastIndex = 0;
6293
- let isBrace = false;
6294
- let isBracket = false;
6295
- let isGlob = false;
6296
- let isExtglob = false;
6297
- let isGlobstar = false;
6298
- let braceEscaped = false;
6299
- let backslashes = false;
6300
- let negated = false;
6301
- let negatedExtglob = false;
6302
- let finished = false;
6303
- let braces = 0;
6304
- let prev;
6305
- let code;
6306
- let token = { value: "", depth: 0, isGlob: false };
6307
- const eos = () => index >= length;
6308
- const peek = () => str.charCodeAt(index + 1);
6309
- const advance = () => {
6310
- prev = code;
6311
- return str.charCodeAt(++index);
6312
- };
6313
- while (index < length) {
6314
- code = advance();
6315
- let next;
6316
- if (code === CHAR_BACKWARD_SLASH) {
6317
- backslashes = token.backslashes = true;
6318
- code = advance();
6319
- if (code === CHAR_LEFT_CURLY_BRACE) {
6320
- braceEscaped = true;
6321
- }
6322
- continue;
6323
- }
6324
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
6325
- braces++;
6326
- while (eos() !== true && (code = advance())) {
6327
- if (code === CHAR_BACKWARD_SLASH) {
6328
- backslashes = token.backslashes = true;
6329
- advance();
6330
- continue;
6331
- }
6332
- if (code === CHAR_LEFT_CURLY_BRACE) {
6333
- braces++;
6334
- continue;
6335
- }
6336
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
6337
- isBrace = token.isBrace = true;
6338
- isGlob = token.isGlob = true;
6339
- finished = true;
6340
- if (scanToEnd === true) {
6341
- continue;
6342
- }
6343
- break;
6344
- }
6345
- if (braceEscaped !== true && code === CHAR_COMMA) {
6346
- isBrace = token.isBrace = true;
6347
- isGlob = token.isGlob = true;
6348
- finished = true;
6349
- if (scanToEnd === true) {
6350
- continue;
6351
- }
6352
- break;
6353
- }
6354
- if (code === CHAR_RIGHT_CURLY_BRACE) {
6355
- braces--;
6356
- if (braces === 0) {
6357
- braceEscaped = false;
6358
- isBrace = token.isBrace = true;
6359
- finished = true;
6360
- break;
6361
- }
6362
- }
6363
- }
6364
- if (scanToEnd === true) {
6365
- continue;
6366
- }
6367
- break;
6368
- }
6369
- if (code === CHAR_FORWARD_SLASH) {
6370
- slashes.push(index);
6371
- tokens.push(token);
6372
- token = { value: "", depth: 0, isGlob: false };
6373
- if (finished === true)
6374
- continue;
6375
- if (prev === CHAR_DOT && index === start + 1) {
6376
- start += 2;
6377
- continue;
6378
- }
6379
- lastIndex = index + 1;
6380
- continue;
6381
- }
6382
- if (opts.noext !== true) {
6383
- const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
6384
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
6385
- isGlob = token.isGlob = true;
6386
- isExtglob = token.isExtglob = true;
6387
- finished = true;
6388
- if (code === CHAR_EXCLAMATION_MARK && index === start) {
6389
- negatedExtglob = true;
6390
- }
6391
- if (scanToEnd === true) {
6392
- while (eos() !== true && (code = advance())) {
6393
- if (code === CHAR_BACKWARD_SLASH) {
6394
- backslashes = token.backslashes = true;
6395
- code = advance();
6396
- continue;
6397
- }
6398
- if (code === CHAR_RIGHT_PARENTHESES) {
6399
- isGlob = token.isGlob = true;
6400
- finished = true;
6401
- break;
6402
- }
6403
- }
6404
- continue;
6405
- }
6406
- break;
6407
- }
6408
- }
6409
- if (code === CHAR_ASTERISK) {
6410
- if (prev === CHAR_ASTERISK)
6411
- isGlobstar = token.isGlobstar = true;
6412
- isGlob = token.isGlob = true;
6413
- finished = true;
6414
- if (scanToEnd === true) {
6415
- continue;
6416
- }
6417
- break;
6418
- }
6419
- if (code === CHAR_QUESTION_MARK) {
6420
- isGlob = token.isGlob = true;
6421
- finished = true;
6422
- if (scanToEnd === true) {
6423
- continue;
6424
- }
6425
- break;
6426
- }
6427
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
6428
- while (eos() !== true && (next = advance())) {
6429
- if (next === CHAR_BACKWARD_SLASH) {
6430
- backslashes = token.backslashes = true;
6431
- advance();
6432
- continue;
6433
- }
6434
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
6435
- isBracket = token.isBracket = true;
6436
- isGlob = token.isGlob = true;
6437
- finished = true;
6438
- break;
6439
- }
6440
- }
6441
- if (scanToEnd === true) {
6442
- continue;
6443
- }
6444
- break;
6445
- }
6446
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
6447
- negated = token.negated = true;
6448
- start++;
6449
- continue;
6450
- }
6451
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
6452
- isGlob = token.isGlob = true;
6453
- if (scanToEnd === true) {
6454
- while (eos() !== true && (code = advance())) {
6455
- if (code === CHAR_LEFT_PARENTHESES) {
6456
- backslashes = token.backslashes = true;
6457
- code = advance();
6458
- continue;
6459
- }
6460
- if (code === CHAR_RIGHT_PARENTHESES) {
6461
- finished = true;
6462
- break;
6463
- }
6464
- }
6465
- continue;
6466
- }
6467
- break;
6468
- }
6469
- if (isGlob === true) {
6470
- finished = true;
6471
- if (scanToEnd === true) {
6472
- continue;
6473
- }
6474
- break;
6475
- }
6476
- }
6477
- if (opts.noext === true) {
6478
- isExtglob = false;
6479
- isGlob = false;
6480
- }
6481
- let base2 = str;
6482
- let prefix = "";
6483
- let glob2 = "";
6484
- if (start > 0) {
6485
- prefix = str.slice(0, start);
6486
- str = str.slice(start);
6487
- lastIndex -= start;
6488
- }
6489
- if (base2 && isGlob === true && lastIndex > 0) {
6490
- base2 = str.slice(0, lastIndex);
6491
- glob2 = str.slice(lastIndex);
6492
- } else if (isGlob === true) {
6493
- base2 = "";
6494
- glob2 = str;
6495
- } else {
6496
- base2 = str;
6497
- }
6498
- if (base2 && base2 !== "" && base2 !== "/" && base2 !== str) {
6499
- if (isPathSeparator(base2.charCodeAt(base2.length - 1))) {
6500
- base2 = base2.slice(0, -1);
6501
- }
6502
- }
6503
- if (opts.unescape === true) {
6504
- if (glob2)
6505
- glob2 = utils.removeBackslashes(glob2);
6506
- if (base2 && backslashes === true) {
6507
- base2 = utils.removeBackslashes(base2);
6508
- }
6509
- }
6510
- const state = {
6511
- prefix,
6512
- input,
6513
- start,
6514
- base: base2,
6515
- glob: glob2,
6516
- isBrace,
6517
- isBracket,
6518
- isGlob,
6519
- isExtglob,
6520
- isGlobstar,
6521
- negated,
6522
- negatedExtglob
6523
- };
6524
- if (opts.tokens === true) {
6525
- state.maxDepth = 0;
6526
- if (!isPathSeparator(code)) {
6527
- tokens.push(token);
6528
- }
6529
- state.tokens = tokens;
6530
- }
6531
- if (opts.parts === true || opts.tokens === true) {
6532
- let prevIndex;
6533
- for (let idx = 0;idx < slashes.length; idx++) {
6534
- const n = prevIndex ? prevIndex + 1 : start;
6535
- const i = slashes[idx];
6536
- const value = input.slice(n, i);
6537
- if (opts.tokens) {
6538
- if (idx === 0 && start !== 0) {
6539
- tokens[idx].isPrefix = true;
6540
- tokens[idx].value = prefix;
6541
- } else {
6542
- tokens[idx].value = value;
6543
- }
6544
- depth(tokens[idx]);
6545
- state.maxDepth += tokens[idx].depth;
6546
- }
6547
- if (idx !== 0 || value !== "") {
6548
- parts.push(value);
6549
- }
6550
- prevIndex = i;
6551
- }
6552
- if (prevIndex && prevIndex + 1 < input.length) {
6553
- const value = input.slice(prevIndex + 1);
6554
- parts.push(value);
6555
- if (opts.tokens) {
6556
- tokens[tokens.length - 1].value = value;
6557
- depth(tokens[tokens.length - 1]);
6558
- state.maxDepth += tokens[tokens.length - 1].depth;
6559
- }
6560
- }
6561
- state.slashes = slashes;
6562
- state.parts = parts;
6563
- }
6564
- return state;
6565
- };
6566
- module.exports = scan;
6567
- });
6568
-
6569
- // ../../node_modules/picomatch/lib/parse.js
6570
- var require_parse2 = __commonJS((exports, module) => {
6571
- var constants = require_constants2();
6572
- var utils = require_utils2();
6573
- var {
6574
- MAX_LENGTH,
6575
- POSIX_REGEX_SOURCE,
6576
- REGEX_NON_SPECIAL_CHARS,
6577
- REGEX_SPECIAL_CHARS_BACKREF,
6578
- REPLACEMENTS
6579
- } = constants;
6580
- var expandRange = (args, options) => {
6581
- if (typeof options.expandRange === "function") {
6582
- return options.expandRange(...args, options);
6583
- }
6584
- args.sort();
6585
- const value = `[${args.join("-")}]`;
6586
- try {
6587
- new RegExp(value);
6588
- } catch (ex) {
6589
- return args.map((v) => utils.escapeRegex(v)).join("..");
6590
- }
6591
- return value;
6592
- };
6593
- var syntaxError = (type, char) => {
6594
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
6595
- };
6596
- var parse = (input, options) => {
6597
- if (typeof input !== "string") {
6598
- throw new TypeError("Expected a string");
6599
- }
6600
- input = REPLACEMENTS[input] || input;
6601
- const opts = { ...options };
6602
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
6603
- let len = input.length;
6604
- if (len > max) {
6605
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
6606
- }
6607
- const bos = { type: "bos", value: "", output: opts.prepend || "" };
6608
- const tokens = [bos];
6609
- const capture = opts.capture ? "" : "?:";
6610
- const win322 = utils.isWindows(options);
6611
- const PLATFORM_CHARS = constants.globChars(win322);
6612
- const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
6613
- const {
6614
- DOT_LITERAL,
6615
- PLUS_LITERAL,
6616
- SLASH_LITERAL,
6617
- ONE_CHAR,
6618
- DOTS_SLASH,
6619
- NO_DOT,
6620
- NO_DOT_SLASH,
6621
- NO_DOTS_SLASH,
6622
- QMARK,
6623
- QMARK_NO_DOT,
6624
- STAR,
6625
- START_ANCHOR
6626
- } = PLATFORM_CHARS;
6627
- const globstar = (opts2) => {
6628
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
6629
- };
6630
- const nodot = opts.dot ? "" : NO_DOT;
6631
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
6632
- let star3 = opts.bash === true ? globstar(opts) : STAR;
6633
- if (opts.capture) {
6634
- star3 = `(${star3})`;
6635
- }
6636
- if (typeof opts.noext === "boolean") {
6637
- opts.noextglob = opts.noext;
6638
- }
6639
- const state = {
6640
- input,
6641
- index: -1,
6642
- start: 0,
6643
- dot: opts.dot === true,
6644
- consumed: "",
6645
- output: "",
6646
- prefix: "",
6647
- backtrack: false,
6648
- negated: false,
6649
- brackets: 0,
6650
- braces: 0,
6651
- parens: 0,
6652
- quotes: 0,
6653
- globstar: false,
6654
- tokens
6655
- };
6656
- input = utils.removePrefix(input, state);
6657
- len = input.length;
6658
- const extglobs = [];
6659
- const braces = [];
6660
- const stack = [];
6661
- let prev = bos;
6662
- let value;
6663
- const eos = () => state.index === len - 1;
6664
- const peek = state.peek = (n = 1) => input[state.index + n];
6665
- const advance = state.advance = () => input[++state.index] || "";
6666
- const remaining = () => input.slice(state.index + 1);
6667
- const consume = (value2 = "", num = 0) => {
6668
- state.consumed += value2;
6669
- state.index += num;
6670
- };
6671
- const append = (token) => {
6672
- state.output += token.output != null ? token.output : token.value;
6673
- consume(token.value);
6674
- };
6675
- const negate = () => {
6676
- let count = 1;
6677
- while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
6678
- advance();
6679
- state.start++;
6680
- count++;
6681
- }
6682
- if (count % 2 === 0) {
6683
- return false;
6684
- }
6685
- state.negated = true;
6686
- state.start++;
6687
- return true;
6688
- };
6689
- const increment = (type) => {
6690
- state[type]++;
6691
- stack.push(type);
6692
- };
6693
- const decrement = (type) => {
6694
- state[type]--;
6695
- stack.pop();
6696
- };
6697
- const push = (tok) => {
6698
- if (prev.type === "globstar") {
6699
- const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
6700
- const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
6701
- if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
6702
- state.output = state.output.slice(0, -prev.output.length);
6703
- prev.type = "star";
6704
- prev.value = "*";
6705
- prev.output = star3;
6706
- state.output += prev.output;
6707
- }
6708
- }
6709
- if (extglobs.length && tok.type !== "paren") {
6710
- extglobs[extglobs.length - 1].inner += tok.value;
6711
- }
6712
- if (tok.value || tok.output)
6713
- append(tok);
6714
- if (prev && prev.type === "text" && tok.type === "text") {
6715
- prev.value += tok.value;
6716
- prev.output = (prev.output || "") + tok.value;
6717
- return;
6718
- }
6719
- tok.prev = prev;
6720
- tokens.push(tok);
6721
- prev = tok;
6722
- };
6723
- const extglobOpen = (type, value2) => {
6724
- const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
6725
- token.prev = prev;
6726
- token.parens = state.parens;
6727
- token.output = state.output;
6728
- const output = (opts.capture ? "(" : "") + token.open;
6729
- increment("parens");
6730
- push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
6731
- push({ type: "paren", extglob: true, value: advance(), output });
6732
- extglobs.push(token);
6733
- };
6734
- const extglobClose = (token) => {
6735
- let output = token.close + (opts.capture ? ")" : "");
6736
- let rest;
6737
- if (token.type === "negate") {
6738
- let extglobStar = star3;
6739
- if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
6740
- extglobStar = globstar(opts);
6741
- }
6742
- if (extglobStar !== star3 || eos() || /^\)+$/.test(remaining())) {
6743
- output = token.close = `)$))${extglobStar}`;
6744
- }
6745
- if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
6746
- const expression = parse(rest, { ...options, fastpaths: false }).output;
6747
- output = token.close = `)${expression})${extglobStar})`;
6748
- }
6749
- if (token.prev.type === "bos") {
6750
- state.negatedExtglob = true;
6751
- }
6752
- }
6753
- push({ type: "paren", extglob: true, value, output });
6754
- decrement("parens");
6755
- };
6756
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
6757
- let backslashes = false;
6758
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
6759
- if (first === "\\") {
6760
- backslashes = true;
6761
- return m;
6762
- }
6763
- if (first === "?") {
6764
- if (esc) {
6765
- return esc + first + (rest ? QMARK.repeat(rest.length) : "");
6766
- }
6767
- if (index === 0) {
6768
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
6769
- }
6770
- return QMARK.repeat(chars.length);
6771
- }
6772
- if (first === ".") {
6773
- return DOT_LITERAL.repeat(chars.length);
6774
- }
6775
- if (first === "*") {
6776
- if (esc) {
6777
- return esc + first + (rest ? star3 : "");
6778
- }
6779
- return star3;
6780
- }
6781
- return esc ? m : `\\${m}`;
6782
- });
6783
- if (backslashes === true) {
6784
- if (opts.unescape === true) {
6785
- output = output.replace(/\\/g, "");
6786
- } else {
6787
- output = output.replace(/\\+/g, (m) => {
6788
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
6789
- });
6790
- }
6791
- }
6792
- if (output === input && opts.contains === true) {
6793
- state.output = input;
6794
- return state;
6795
- }
6796
- state.output = utils.wrapOutput(output, state, options);
6797
- return state;
6798
- }
6799
- while (!eos()) {
6800
- value = advance();
6801
- if (value === "\x00") {
6802
- continue;
6803
- }
6804
- if (value === "\\") {
6805
- const next = peek();
6806
- if (next === "/" && opts.bash !== true) {
6807
- continue;
6808
- }
6809
- if (next === "." || next === ";") {
6810
- continue;
6811
- }
6812
- if (!next) {
6813
- value += "\\";
6814
- push({ type: "text", value });
6815
- continue;
6816
- }
6817
- const match2 = /^\\+/.exec(remaining());
6818
- let slashes = 0;
6819
- if (match2 && match2[0].length > 2) {
6820
- slashes = match2[0].length;
6821
- state.index += slashes;
6822
- if (slashes % 2 !== 0) {
6823
- value += "\\";
6824
- }
6825
- }
6826
- if (opts.unescape === true) {
6827
- value = advance();
6828
- } else {
6829
- value += advance();
6830
- }
6831
- if (state.brackets === 0) {
6832
- push({ type: "text", value });
6833
- continue;
6834
- }
6835
- }
6836
- if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
6837
- if (opts.posix !== false && value === ":") {
6838
- const inner = prev.value.slice(1);
6839
- if (inner.includes("[")) {
6840
- prev.posix = true;
6841
- if (inner.includes(":")) {
6842
- const idx = prev.value.lastIndexOf("[");
6843
- const pre = prev.value.slice(0, idx);
6844
- const rest2 = prev.value.slice(idx + 2);
6845
- const posix2 = POSIX_REGEX_SOURCE[rest2];
6846
- if (posix2) {
6847
- prev.value = pre + posix2;
6848
- state.backtrack = true;
6849
- advance();
6850
- if (!bos.output && tokens.indexOf(prev) === 1) {
6851
- bos.output = ONE_CHAR;
6852
- }
6853
- continue;
6854
- }
6855
- }
6856
- }
6857
- }
6858
- if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
6859
- value = `\\${value}`;
6860
- }
6861
- if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
6862
- value = `\\${value}`;
6863
- }
6864
- if (opts.posix === true && value === "!" && prev.value === "[") {
6865
- value = "^";
6866
- }
6867
- prev.value += value;
6868
- append({ value });
6869
- continue;
6870
- }
6871
- if (state.quotes === 1 && value !== '"') {
6872
- value = utils.escapeRegex(value);
6873
- prev.value += value;
6874
- append({ value });
6875
- continue;
6876
- }
6877
- if (value === '"') {
6878
- state.quotes = state.quotes === 1 ? 0 : 1;
6879
- if (opts.keepQuotes === true) {
6880
- push({ type: "text", value });
6881
- }
6882
- continue;
6883
- }
6884
- if (value === "(") {
6885
- increment("parens");
6886
- push({ type: "paren", value });
6887
- continue;
6888
- }
6889
- if (value === ")") {
6890
- if (state.parens === 0 && opts.strictBrackets === true) {
6891
- throw new SyntaxError(syntaxError("opening", "("));
6892
- }
6893
- const extglob = extglobs[extglobs.length - 1];
6894
- if (extglob && state.parens === extglob.parens + 1) {
6895
- extglobClose(extglobs.pop());
6896
- continue;
6897
- }
6898
- push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
6899
- decrement("parens");
6900
- continue;
6901
- }
6902
- if (value === "[") {
6903
- if (opts.nobracket === true || !remaining().includes("]")) {
6904
- if (opts.nobracket !== true && opts.strictBrackets === true) {
6905
- throw new SyntaxError(syntaxError("closing", "]"));
6906
- }
6907
- value = `\\${value}`;
6908
- } else {
6909
- increment("brackets");
6910
- }
6911
- push({ type: "bracket", value });
6912
- continue;
6913
- }
6914
- if (value === "]") {
6915
- if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
6916
- push({ type: "text", value, output: `\\${value}` });
6917
- continue;
6918
- }
6919
- if (state.brackets === 0) {
6920
- if (opts.strictBrackets === true) {
6921
- throw new SyntaxError(syntaxError("opening", "["));
6922
- }
6923
- push({ type: "text", value, output: `\\${value}` });
6924
- continue;
6925
- }
6926
- decrement("brackets");
6927
- const prevValue = prev.value.slice(1);
6928
- if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
6929
- value = `/${value}`;
6930
- }
6931
- prev.value += value;
6932
- append({ value });
6933
- if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
6934
- continue;
6935
- }
6936
- const escaped = utils.escapeRegex(prev.value);
6937
- state.output = state.output.slice(0, -prev.value.length);
6938
- if (opts.literalBrackets === true) {
6939
- state.output += escaped;
6940
- prev.value = escaped;
6941
- continue;
6942
- }
6943
- prev.value = `(${capture}${escaped}|${prev.value})`;
6944
- state.output += prev.value;
6945
- continue;
6946
- }
6947
- if (value === "{" && opts.nobrace !== true) {
6948
- increment("braces");
6949
- const open = {
6950
- type: "brace",
6951
- value,
6952
- output: "(",
6953
- outputIndex: state.output.length,
6954
- tokensIndex: state.tokens.length
6955
- };
6956
- braces.push(open);
6957
- push(open);
6958
- continue;
6959
- }
6960
- if (value === "}") {
6961
- const brace = braces[braces.length - 1];
6962
- if (opts.nobrace === true || !brace) {
6963
- push({ type: "text", value, output: value });
6964
- continue;
6965
- }
6966
- let output = ")";
6967
- if (brace.dots === true) {
6968
- const arr = tokens.slice();
6969
- const range = [];
6970
- for (let i = arr.length - 1;i >= 0; i--) {
6971
- tokens.pop();
6972
- if (arr[i].type === "brace") {
6973
- break;
6974
- }
6975
- if (arr[i].type !== "dots") {
6976
- range.unshift(arr[i].value);
6977
- }
6978
- }
6979
- output = expandRange(range, opts);
6980
- state.backtrack = true;
6981
- }
6982
- if (brace.comma !== true && brace.dots !== true) {
6983
- const out = state.output.slice(0, brace.outputIndex);
6984
- const toks = state.tokens.slice(brace.tokensIndex);
6985
- brace.value = brace.output = "\\{";
6986
- value = output = "\\}";
6987
- state.output = out;
6988
- for (const t of toks) {
6989
- state.output += t.output || t.value;
6990
- }
6991
- }
6992
- push({ type: "brace", value, output });
6993
- decrement("braces");
6994
- braces.pop();
6995
- continue;
6996
- }
6997
- if (value === "|") {
6998
- if (extglobs.length > 0) {
6999
- extglobs[extglobs.length - 1].conditions++;
7000
- }
7001
- push({ type: "text", value });
7002
- continue;
7003
- }
7004
- if (value === ",") {
7005
- let output = value;
7006
- const brace = braces[braces.length - 1];
7007
- if (brace && stack[stack.length - 1] === "braces") {
7008
- brace.comma = true;
7009
- output = "|";
7010
- }
7011
- push({ type: "comma", value, output });
7012
- continue;
7013
- }
7014
- if (value === "/") {
7015
- if (prev.type === "dot" && state.index === state.start + 1) {
7016
- state.start = state.index + 1;
7017
- state.consumed = "";
7018
- state.output = "";
7019
- tokens.pop();
7020
- prev = bos;
7021
- continue;
7022
- }
7023
- push({ type: "slash", value, output: SLASH_LITERAL });
7024
- continue;
7025
- }
7026
- if (value === ".") {
7027
- if (state.braces > 0 && prev.type === "dot") {
7028
- if (prev.value === ".")
7029
- prev.output = DOT_LITERAL;
7030
- const brace = braces[braces.length - 1];
7031
- prev.type = "dots";
7032
- prev.output += value;
7033
- prev.value += value;
7034
- brace.dots = true;
7035
- continue;
7036
- }
7037
- if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
7038
- push({ type: "text", value, output: DOT_LITERAL });
7039
- continue;
7040
- }
7041
- push({ type: "dot", value, output: DOT_LITERAL });
7042
- continue;
7043
- }
7044
- if (value === "?") {
7045
- const isGroup = prev && prev.value === "(";
7046
- if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7047
- extglobOpen("qmark", value);
7048
- continue;
7049
- }
7050
- if (prev && prev.type === "paren") {
7051
- const next = peek();
7052
- let output = value;
7053
- if (next === "<" && !utils.supportsLookbehinds()) {
7054
- throw new Error("Node.js v10 or higher is required for regex lookbehinds");
7055
- }
7056
- if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
7057
- output = `\\${value}`;
7058
- }
7059
- push({ type: "text", value, output });
7060
- continue;
7061
- }
7062
- if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
7063
- push({ type: "qmark", value, output: QMARK_NO_DOT });
7064
- continue;
7065
- }
7066
- push({ type: "qmark", value, output: QMARK });
7067
- continue;
7068
- }
7069
- if (value === "!") {
7070
- if (opts.noextglob !== true && peek() === "(") {
7071
- if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
7072
- extglobOpen("negate", value);
7073
- continue;
7074
- }
7075
- }
7076
- if (opts.nonegate !== true && state.index === 0) {
7077
- negate();
7078
- continue;
7079
- }
7080
- }
7081
- if (value === "+") {
7082
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7083
- extglobOpen("plus", value);
7084
- continue;
7085
- }
7086
- if (prev && prev.value === "(" || opts.regex === false) {
7087
- push({ type: "plus", value, output: PLUS_LITERAL });
7088
- continue;
7089
- }
7090
- if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
7091
- push({ type: "plus", value });
7092
- continue;
7093
- }
7094
- push({ type: "plus", value: PLUS_LITERAL });
7095
- continue;
7096
- }
7097
- if (value === "@") {
7098
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7099
- push({ type: "at", extglob: true, value, output: "" });
7100
- continue;
7101
- }
7102
- push({ type: "text", value });
7103
- continue;
7104
- }
7105
- if (value !== "*") {
7106
- if (value === "$" || value === "^") {
7107
- value = `\\${value}`;
7108
- }
7109
- const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining());
7110
- if (match2) {
7111
- value += match2[0];
7112
- state.index += match2[0].length;
7113
- }
7114
- push({ type: "text", value });
7115
- continue;
7116
- }
7117
- if (prev && (prev.type === "globstar" || prev.star === true)) {
7118
- prev.type = "star";
7119
- prev.star = true;
7120
- prev.value += value;
7121
- prev.output = star3;
7122
- state.backtrack = true;
7123
- state.globstar = true;
7124
- consume(value);
7125
- continue;
7126
- }
7127
- let rest = remaining();
7128
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
7129
- extglobOpen("star", value);
7130
- continue;
7131
- }
7132
- if (prev.type === "star") {
7133
- if (opts.noglobstar === true) {
7134
- consume(value);
7135
- continue;
7136
- }
7137
- const prior = prev.prev;
7138
- const before = prior.prev;
7139
- const isStart = prior.type === "slash" || prior.type === "bos";
7140
- const afterStar = before && (before.type === "star" || before.type === "globstar");
7141
- if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
7142
- push({ type: "star", value, output: "" });
7143
- continue;
7144
- }
7145
- const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
7146
- const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
7147
- if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
7148
- push({ type: "star", value, output: "" });
7149
- continue;
7150
- }
7151
- while (rest.slice(0, 3) === "/**") {
7152
- const after = input[state.index + 4];
7153
- if (after && after !== "/") {
7154
- break;
7155
- }
7156
- rest = rest.slice(3);
7157
- consume("/**", 3);
7158
- }
7159
- if (prior.type === "bos" && eos()) {
7160
- prev.type = "globstar";
7161
- prev.value += value;
7162
- prev.output = globstar(opts);
7163
- state.output = prev.output;
7164
- state.globstar = true;
7165
- consume(value);
7166
- continue;
7167
- }
7168
- if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
7169
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
7170
- prior.output = `(?:${prior.output}`;
7171
- prev.type = "globstar";
7172
- prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
7173
- prev.value += value;
7174
- state.globstar = true;
7175
- state.output += prior.output + prev.output;
7176
- consume(value);
7177
- continue;
7178
- }
7179
- if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
7180
- const end = rest[1] !== undefined ? "|$" : "";
7181
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
7182
- prior.output = `(?:${prior.output}`;
7183
- prev.type = "globstar";
7184
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
7185
- prev.value += value;
7186
- state.output += prior.output + prev.output;
7187
- state.globstar = true;
7188
- consume(value + advance());
7189
- push({ type: "slash", value: "/", output: "" });
7190
- continue;
7191
- }
7192
- if (prior.type === "bos" && rest[0] === "/") {
7193
- prev.type = "globstar";
7194
- prev.value += value;
7195
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
7196
- state.output = prev.output;
7197
- state.globstar = true;
7198
- consume(value + advance());
7199
- push({ type: "slash", value: "/", output: "" });
7200
- continue;
7201
- }
7202
- state.output = state.output.slice(0, -prev.output.length);
7203
- prev.type = "globstar";
7204
- prev.output = globstar(opts);
7205
- prev.value += value;
7206
- state.output += prev.output;
7207
- state.globstar = true;
7208
- consume(value);
7209
- continue;
7210
- }
7211
- const token = { type: "star", value, output: star3 };
7212
- if (opts.bash === true) {
7213
- token.output = ".*?";
7214
- if (prev.type === "bos" || prev.type === "slash") {
7215
- token.output = nodot + token.output;
7216
- }
7217
- push(token);
7218
- continue;
7219
- }
7220
- if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
7221
- token.output = value;
7222
- push(token);
7223
- continue;
7224
- }
7225
- if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
7226
- if (prev.type === "dot") {
7227
- state.output += NO_DOT_SLASH;
7228
- prev.output += NO_DOT_SLASH;
7229
- } else if (opts.dot === true) {
7230
- state.output += NO_DOTS_SLASH;
7231
- prev.output += NO_DOTS_SLASH;
7232
- } else {
7233
- state.output += nodot;
7234
- prev.output += nodot;
7235
- }
7236
- if (peek() !== "*") {
7237
- state.output += ONE_CHAR;
7238
- prev.output += ONE_CHAR;
7239
- }
7240
- }
7241
- push(token);
7242
- }
7243
- while (state.brackets > 0) {
7244
- if (opts.strictBrackets === true)
7245
- throw new SyntaxError(syntaxError("closing", "]"));
7246
- state.output = utils.escapeLast(state.output, "[");
7247
- decrement("brackets");
7248
- }
7249
- while (state.parens > 0) {
7250
- if (opts.strictBrackets === true)
7251
- throw new SyntaxError(syntaxError("closing", ")"));
7252
- state.output = utils.escapeLast(state.output, "(");
7253
- decrement("parens");
7254
- }
7255
- while (state.braces > 0) {
7256
- if (opts.strictBrackets === true)
7257
- throw new SyntaxError(syntaxError("closing", "}"));
7258
- state.output = utils.escapeLast(state.output, "{");
7259
- decrement("braces");
7260
- }
7261
- if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
7262
- push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
7263
- }
7264
- if (state.backtrack === true) {
7265
- state.output = "";
7266
- for (const token of state.tokens) {
7267
- state.output += token.output != null ? token.output : token.value;
7268
- if (token.suffix) {
7269
- state.output += token.suffix;
7270
- }
7271
- }
7272
- }
7273
- return state;
7274
- };
7275
- parse.fastpaths = (input, options) => {
7276
- const opts = { ...options };
7277
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
7278
- const len = input.length;
7279
- if (len > max) {
7280
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
7281
- }
7282
- input = REPLACEMENTS[input] || input;
7283
- const win322 = utils.isWindows(options);
7284
- const {
7285
- DOT_LITERAL,
7286
- SLASH_LITERAL,
7287
- ONE_CHAR,
7288
- DOTS_SLASH,
7289
- NO_DOT,
7290
- NO_DOTS,
7291
- NO_DOTS_SLASH,
7292
- STAR,
7293
- START_ANCHOR
7294
- } = constants.globChars(win322);
7295
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
7296
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
7297
- const capture = opts.capture ? "" : "?:";
7298
- const state = { negated: false, prefix: "" };
7299
- let star3 = opts.bash === true ? ".*?" : STAR;
7300
- if (opts.capture) {
7301
- star3 = `(${star3})`;
7302
- }
7303
- const globstar = (opts2) => {
7304
- if (opts2.noglobstar === true)
7305
- return star3;
7306
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
7307
- };
7308
- const create = (str) => {
7309
- switch (str) {
7310
- case "*":
7311
- return `${nodot}${ONE_CHAR}${star3}`;
7312
- case ".*":
7313
- return `${DOT_LITERAL}${ONE_CHAR}${star3}`;
7314
- case "*.*":
7315
- return `${nodot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
7316
- case "*/*":
7317
- return `${nodot}${star3}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star3}`;
7318
- case "**":
7319
- return nodot + globstar(opts);
7320
- case "**/*":
7321
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star3}`;
7322
- case "**/*.*":
7323
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
7324
- case "**/.*":
7325
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star3}`;
7326
- default: {
7327
- const match2 = /^(.*?)\.(\w+)$/.exec(str);
7328
- if (!match2)
7329
- return;
7330
- const source2 = create(match2[1]);
7331
- if (!source2)
7332
- return;
7333
- return source2 + DOT_LITERAL + match2[2];
7334
- }
7335
- }
7336
- };
7337
- const output = utils.removePrefix(input, state);
7338
- let source = create(output);
7339
- if (source && opts.strictSlashes !== true) {
7340
- source += `${SLASH_LITERAL}?`;
7341
- }
7342
- return source;
7343
- };
7344
- module.exports = parse;
7345
- });
7346
-
7347
- // ../../node_modules/picomatch/lib/picomatch.js
7348
- var require_picomatch2 = __commonJS((exports, module) => {
7349
- var path4 = __require("node:path");
7350
- var scan = require_scan2();
7351
- var parse = require_parse2();
7352
- var utils = require_utils2();
7353
- var constants = require_constants2();
7354
- var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
7355
- var picomatch = (glob2, options, returnState = false) => {
7356
- if (Array.isArray(glob2)) {
7357
- const fns = glob2.map((input) => picomatch(input, options, returnState));
7358
- const arrayMatcher = (str) => {
7359
- for (const isMatch of fns) {
7360
- const state2 = isMatch(str);
7361
- if (state2)
7362
- return state2;
7363
- }
7364
- return false;
7365
- };
7366
- return arrayMatcher;
7367
- }
7368
- const isState = isObject(glob2) && glob2.tokens && glob2.input;
7369
- if (glob2 === "" || typeof glob2 !== "string" && !isState) {
7370
- throw new TypeError("Expected pattern to be a non-empty string");
7371
- }
7372
- const opts = options || {};
7373
- const posix2 = utils.isWindows(options);
7374
- const regex2 = isState ? picomatch.compileRe(glob2, options) : picomatch.makeRe(glob2, options, false, true);
7375
- const state = regex2.state;
7376
- delete regex2.state;
7377
- let isIgnored = () => false;
7378
- if (opts.ignore) {
7379
- const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
7380
- isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
7381
- }
7382
- const matcher = (input, returnObject = false) => {
7383
- const { isMatch, match: match2, output } = picomatch.test(input, regex2, options, { glob: glob2, posix: posix2 });
7384
- const result = { glob: glob2, state, regex: regex2, posix: posix2, input, output, match: match2, isMatch };
7385
- if (typeof opts.onResult === "function") {
7386
- opts.onResult(result);
7387
- }
7388
- if (isMatch === false) {
7389
- result.isMatch = false;
7390
- return returnObject ? result : false;
7391
- }
7392
- if (isIgnored(input)) {
7393
- if (typeof opts.onIgnore === "function") {
7394
- opts.onIgnore(result);
7395
- }
7396
- result.isMatch = false;
7397
- return returnObject ? result : false;
7398
- }
7399
- if (typeof opts.onMatch === "function") {
7400
- opts.onMatch(result);
7401
- }
7402
- return returnObject ? result : true;
7403
- };
7404
- if (returnState) {
7405
- matcher.state = state;
7406
- }
7407
- return matcher;
7408
- };
7409
- picomatch.test = (input, regex2, options, { glob: glob2, posix: posix2 } = {}) => {
7410
- if (typeof input !== "string") {
7411
- throw new TypeError("Expected input to be a string");
7412
- }
7413
- if (input === "") {
7414
- return { isMatch: false, output: "" };
7415
- }
7416
- const opts = options || {};
7417
- const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
7418
- let match2 = input === glob2;
7419
- let output = match2 && format2 ? format2(input) : input;
7420
- if (match2 === false) {
7421
- output = format2 ? format2(input) : input;
7422
- match2 = output === glob2;
7423
- }
7424
- if (match2 === false || opts.capture === true) {
7425
- if (opts.matchBase === true || opts.basename === true) {
7426
- match2 = picomatch.matchBase(input, regex2, options, posix2);
7427
- } else {
7428
- match2 = regex2.exec(output);
7429
- }
7430
- }
7431
- return { isMatch: Boolean(match2), match: match2, output };
7432
- };
7433
- picomatch.matchBase = (input, glob2, options, posix2 = utils.isWindows(options)) => {
7434
- const regex2 = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);
7435
- return regex2.test(path4.basename(input));
7436
- };
7437
- picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
7438
- picomatch.parse = (pattern, options) => {
7439
- if (Array.isArray(pattern))
7440
- return pattern.map((p) => picomatch.parse(p, options));
7441
- return parse(pattern, { ...options, fastpaths: false });
7442
- };
7443
- picomatch.scan = (input, options) => scan(input, options);
7444
- picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
7445
- if (returnOutput === true) {
7446
- return state.output;
7447
- }
7448
- const opts = options || {};
7449
- const prepend = opts.contains ? "" : "^";
7450
- const append = opts.contains ? "" : "$";
7451
- let source = `${prepend}(?:${state.output})${append}`;
7452
- if (state && state.negated === true) {
7453
- source = `^(?!${source}).*$`;
7454
- }
7455
- const regex2 = picomatch.toRegex(source, options);
7456
- if (returnState === true) {
7457
- regex2.state = state;
7458
- }
7459
- return regex2;
7460
- };
7461
- picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
7462
- if (!input || typeof input !== "string") {
7463
- throw new TypeError("Expected a non-empty string");
7464
- }
7465
- let parsed = { negated: false, fastpaths: true };
7466
- if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
7467
- parsed.output = parse.fastpaths(input, options);
7468
- }
7469
- if (!parsed.output) {
7470
- parsed = parse(input, options);
7471
- }
7472
- return picomatch.compileRe(parsed, options, returnOutput, returnState);
7473
- };
7474
- picomatch.toRegex = (source, options) => {
7475
- try {
7476
- const opts = options || {};
7477
- return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
7478
- } catch (err) {
7479
- if (options && options.debug === true)
7480
- throw err;
7481
- return /$^/;
7482
- }
7483
- };
7484
- picomatch.constants = constants;
7485
- module.exports = picomatch;
5818
+ module.exports = readdirp;
7486
5819
  });
7487
5820
 
7488
5821
  // ../../node_modules/normalize-path/index.js
@@ -7521,7 +5854,7 @@ var require_normalize_path = __commonJS((exports, module) => {
7521
5854
  // ../../node_modules/anymatch/index.js
7522
5855
  var require_anymatch = __commonJS((exports, module) => {
7523
5856
  Object.defineProperty(exports, "__esModule", { value: true });
7524
- var picomatch = require_picomatch2();
5857
+ var picomatch = require_picomatch();
7525
5858
  var normalizePath = require_normalize_path();
7526
5859
  var BANG = "!";
7527
5860
  var DEFAULT_OPTIONS = { returnIndex: false };
@@ -7739,7 +6072,7 @@ var require_is_glob = __commonJS((exports, module) => {
7739
6072
  };
7740
6073
  });
7741
6074
 
7742
- // node_modules/chokidar/node_modules/glob-parent/index.js
6075
+ // ../../node_modules/glob-parent/index.js
7743
6076
  var require_glob_parent = __commonJS((exports, module) => {
7744
6077
  var isGlob = require_is_glob();
7745
6078
  var pathPosixDirname = __require("node:path").posix.dirname;
@@ -7766,7 +6099,7 @@ var require_glob_parent = __commonJS((exports, module) => {
7766
6099
  });
7767
6100
 
7768
6101
  // ../../node_modules/braces/lib/utils.js
7769
- var require_utils3 = __commonJS((exports) => {
6102
+ var require_utils2 = __commonJS((exports) => {
7770
6103
  exports.isInteger = (num) => {
7771
6104
  if (typeof num === "number") {
7772
6105
  return Number.isInteger(num);
@@ -7854,7 +6187,7 @@ var require_utils3 = __commonJS((exports) => {
7854
6187
 
7855
6188
  // ../../node_modules/braces/lib/stringify.js
7856
6189
  var require_stringify = __commonJS((exports, module) => {
7857
- var utils = require_utils3();
6190
+ var utils = require_utils2();
7858
6191
  module.exports = (ast, options = {}) => {
7859
6192
  const stringify = (node, parent = {}) => {
7860
6193
  const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
@@ -8326,7 +6659,7 @@ var require_fill_range = __commonJS((exports, module) => {
8326
6659
  // ../../node_modules/braces/lib/compile.js
8327
6660
  var require_compile = __commonJS((exports, module) => {
8328
6661
  var fill = require_fill_range();
8329
- var utils = require_utils3();
6662
+ var utils = require_utils2();
8330
6663
  var compile = (ast, options = {}) => {
8331
6664
  const walk = (node, parent = {}) => {
8332
6665
  const invalidBlock = utils.isInvalidBrace(parent);
@@ -8376,7 +6709,7 @@ var require_compile = __commonJS((exports, module) => {
8376
6709
  var require_expand = __commonJS((exports, module) => {
8377
6710
  var fill = require_fill_range();
8378
6711
  var stringify = require_stringify();
8379
- var utils = require_utils3();
6712
+ var utils = require_utils2();
8380
6713
  var append = (queue = "", stash = "", enclose = false) => {
8381
6714
  const result = [];
8382
6715
  queue = [].concat(queue);
@@ -8467,7 +6800,7 @@ var require_expand = __commonJS((exports, module) => {
8467
6800
  });
8468
6801
 
8469
6802
  // ../../node_modules/braces/lib/constants.js
8470
- var require_constants3 = __commonJS((exports, module) => {
6803
+ var require_constants2 = __commonJS((exports, module) => {
8471
6804
  module.exports = {
8472
6805
  MAX_LENGTH: 1e4,
8473
6806
  CHAR_0: "0",
@@ -8519,7 +6852,7 @@ var require_constants3 = __commonJS((exports, module) => {
8519
6852
  });
8520
6853
 
8521
6854
  // ../../node_modules/braces/lib/parse.js
8522
- var require_parse3 = __commonJS((exports, module) => {
6855
+ var require_parse2 = __commonJS((exports, module) => {
8523
6856
  var stringify = require_stringify();
8524
6857
  var {
8525
6858
  MAX_LENGTH,
@@ -8537,7 +6870,7 @@ var require_parse3 = __commonJS((exports, module) => {
8537
6870
  CHAR_SINGLE_QUOTE,
8538
6871
  CHAR_NO_BREAK_SPACE,
8539
6872
  CHAR_ZERO_WIDTH_NOBREAK_SPACE
8540
- } = require_constants3();
6873
+ } = require_constants2();
8541
6874
  var parse = (input, options = {}) => {
8542
6875
  if (typeof input !== "string") {
8543
6876
  throw new TypeError("Expected a string");
@@ -8750,7 +7083,7 @@ var require_braces = __commonJS((exports, module) => {
8750
7083
  var stringify = require_stringify();
8751
7084
  var compile = require_compile();
8752
7085
  var expand2 = require_expand();
8753
- var parse = require_parse3();
7086
+ var parse = require_parse2();
8754
7087
  var braces = (input, options = {}) => {
8755
7088
  let output = [];
8756
7089
  if (Array.isArray(input)) {
@@ -9080,8 +7413,8 @@ var require_is_binary_path = __commonJS((exports, module) => {
9080
7413
  module.exports = (filePath) => extensions.has(path4.extname(filePath).slice(1).toLowerCase());
9081
7414
  });
9082
7415
 
9083
- // node_modules/chokidar/lib/constants.js
9084
- var require_constants4 = __commonJS((exports) => {
7416
+ // ../../node_modules/chokidar/lib/constants.js
7417
+ var require_constants3 = __commonJS((exports) => {
9085
7418
  var { sep: sep2 } = __require("node:path");
9086
7419
  var { platform: platform3 } = process;
9087
7420
  var os2 = __require("node:os");
@@ -9140,7 +7473,7 @@ var require_constants4 = __commonJS((exports) => {
9140
7473
  exports.isIBMi = os2.type() === "OS400";
9141
7474
  });
9142
7475
 
9143
- // node_modules/chokidar/lib/nodefs-handler.js
7476
+ // ../../node_modules/chokidar/lib/nodefs-handler.js
9144
7477
  var require_nodefs_handler = __commonJS((exports, module) => {
9145
7478
  var fs2 = __require("node:fs");
9146
7479
  var sysPath = __require("node:path");
@@ -9163,7 +7496,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
9163
7496
  STR_END,
9164
7497
  BRACE_START,
9165
7498
  STAR
9166
- } = require_constants4();
7499
+ } = require_constants3();
9167
7500
  var THROTTLE_MODE_WATCH = "watch";
9168
7501
  var open = promisify(fs2.open);
9169
7502
  var stat = promisify(fs2.stat);
@@ -9670,7 +8003,7 @@ var require_fsevents2 = __commonJS((exports) => {
9670
8003
  exports.constants = events;
9671
8004
  });
9672
8005
 
9673
- // node_modules/chokidar/lib/fsevents-handler.js
8006
+ // ../../node_modules/chokidar/lib/fsevents-handler.js
9674
8007
  var require_fsevents_handler = __commonJS((exports, module) => {
9675
8008
  var fs2 = __require("node:fs");
9676
8009
  var sysPath = __require("node:path");
@@ -9715,7 +8048,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
9715
8048
  FUNCTION_TYPE,
9716
8049
  EMPTY_FN,
9717
8050
  IDENTITY_FN
9718
- } = require_constants4();
8051
+ } = require_constants3();
9719
8052
  var Depth = (value) => isNaN(value) ? {} : { depth: value };
9720
8053
  var stat = promisify(fs2.stat);
9721
8054
  var lstat2 = promisify(fs2.lstat);
@@ -10040,7 +8373,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
10040
8373
  module.exports.canUse = canUse;
10041
8374
  });
10042
8375
 
10043
- // node_modules/chokidar/index.js
8376
+ // ../../node_modules/chokidar/index.js
10044
8377
  var require_chokidar = __commonJS((exports) => {
10045
8378
  var { EventEmitter: EventEmitter3 } = __require("node:events");
10046
8379
  var fs2 = __require("node:fs");
@@ -10087,7 +8420,7 @@ var require_chokidar = __commonJS((exports) => {
10087
8420
  isWindows: isWindows4,
10088
8421
  isMacos,
10089
8422
  isIBMi
10090
- } = require_constants4();
8423
+ } = require_constants3();
10091
8424
  var stat = promisify(fs2.stat);
10092
8425
  var readdir2 = promisify(fs2.readdir);
10093
8426
  var arrify = (value = []) => Array.isArray(value) ? value : [value];
@@ -11020,7 +9353,7 @@ var require_buffer_equal_constant_time = __commonJS((exports, module) => {
11020
9353
  // ../../node_modules/jwa/index.js
11021
9354
  var require_jwa = __commonJS((exports, module) => {
11022
9355
  var Buffer2 = require_safe_buffer().Buffer;
11023
- var crypto = __require("node:crypto");
9356
+ var crypto2 = __require("node:crypto");
11024
9357
  var formatEcdsa = require_ecdsa_sig_formatter();
11025
9358
  var util = __require("node:util");
11026
9359
  var MSG_INVALID_ALGORITHM = `"%s" is not a valid algorithm.
@@ -11029,7 +9362,7 @@ var require_jwa = __commonJS((exports, module) => {
11029
9362
  var MSG_INVALID_SECRET = "secret must be a string or buffer";
11030
9363
  var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer";
11031
9364
  var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object";
11032
- var supportsKeyObjects = typeof crypto.createPublicKey === "function";
9365
+ var supportsKeyObjects = typeof crypto2.createPublicKey === "function";
11033
9366
  if (supportsKeyObjects) {
11034
9367
  MSG_INVALID_VERIFIER_KEY += " or a KeyObject";
11035
9368
  MSG_INVALID_SECRET += "or a KeyObject";
@@ -11119,17 +9452,17 @@ var require_jwa = __commonJS((exports, module) => {
11119
9452
  return function sign(thing, secret) {
11120
9453
  checkIsSecretKey(secret);
11121
9454
  thing = normalizeInput(thing);
11122
- var hmac = crypto.createHmac("sha" + bits, secret);
9455
+ var hmac = crypto2.createHmac("sha" + bits, secret);
11123
9456
  var sig = (hmac.update(thing), hmac.digest("base64"));
11124
9457
  return fromBase64(sig);
11125
9458
  };
11126
9459
  }
11127
9460
  var bufferEqual;
11128
- var timingSafeEqual = "timingSafeEqual" in crypto ? function timingSafeEqual(a, b) {
9461
+ var timingSafeEqual = "timingSafeEqual" in crypto2 ? function timingSafeEqual(a, b) {
11129
9462
  if (a.byteLength !== b.byteLength) {
11130
9463
  return false;
11131
9464
  }
11132
- return crypto.timingSafeEqual(a, b);
9465
+ return crypto2.timingSafeEqual(a, b);
11133
9466
  } : function timingSafeEqual(a, b) {
11134
9467
  if (!bufferEqual) {
11135
9468
  bufferEqual = require_buffer_equal_constant_time();
@@ -11146,7 +9479,7 @@ var require_jwa = __commonJS((exports, module) => {
11146
9479
  return function sign(thing, privateKey) {
11147
9480
  checkIsPrivateKey(privateKey);
11148
9481
  thing = normalizeInput(thing);
11149
- var signer = crypto.createSign("RSA-SHA" + bits);
9482
+ var signer = crypto2.createSign("RSA-SHA" + bits);
11150
9483
  var sig = (signer.update(thing), signer.sign(privateKey, "base64"));
11151
9484
  return fromBase64(sig);
11152
9485
  };
@@ -11156,7 +9489,7 @@ var require_jwa = __commonJS((exports, module) => {
11156
9489
  checkIsPublicKey(publicKey);
11157
9490
  thing = normalizeInput(thing);
11158
9491
  signature = toBase64(signature);
11159
- var verifier = crypto.createVerify("RSA-SHA" + bits);
9492
+ var verifier = crypto2.createVerify("RSA-SHA" + bits);
11160
9493
  verifier.update(thing);
11161
9494
  return verifier.verify(publicKey, signature, "base64");
11162
9495
  };
@@ -11165,11 +9498,11 @@ var require_jwa = __commonJS((exports, module) => {
11165
9498
  return function sign(thing, privateKey) {
11166
9499
  checkIsPrivateKey(privateKey);
11167
9500
  thing = normalizeInput(thing);
11168
- var signer = crypto.createSign("RSA-SHA" + bits);
9501
+ var signer = crypto2.createSign("RSA-SHA" + bits);
11169
9502
  var sig = (signer.update(thing), signer.sign({
11170
9503
  key: privateKey,
11171
- padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
11172
- saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST
9504
+ padding: crypto2.constants.RSA_PKCS1_PSS_PADDING,
9505
+ saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST
11173
9506
  }, "base64"));
11174
9507
  return fromBase64(sig);
11175
9508
  };
@@ -11179,12 +9512,12 @@ var require_jwa = __commonJS((exports, module) => {
11179
9512
  checkIsPublicKey(publicKey);
11180
9513
  thing = normalizeInput(thing);
11181
9514
  signature = toBase64(signature);
11182
- var verifier = crypto.createVerify("RSA-SHA" + bits);
9515
+ var verifier = crypto2.createVerify("RSA-SHA" + bits);
11183
9516
  verifier.update(thing);
11184
9517
  return verifier.verify({
11185
9518
  key: publicKey,
11186
- padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
11187
- saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST
9519
+ padding: crypto2.constants.RSA_PKCS1_PSS_PADDING,
9520
+ saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST
11188
9521
  }, signature, "base64");
11189
9522
  };
11190
9523
  }
@@ -11672,7 +10005,7 @@ var require_timespan = __commonJS((exports, module) => {
11672
10005
  });
11673
10006
 
11674
10007
  // ../../node_modules/semver/internal/constants.js
11675
- var require_constants5 = __commonJS((exports, module) => {
10008
+ var require_constants4 = __commonJS((exports, module) => {
11676
10009
  var SEMVER_SPEC_VERSION = "2.0.0";
11677
10010
  var MAX_LENGTH = 256;
11678
10011
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
@@ -11711,7 +10044,7 @@ var require_re = __commonJS((exports, module) => {
11711
10044
  MAX_SAFE_COMPONENT_LENGTH,
11712
10045
  MAX_SAFE_BUILD_LENGTH,
11713
10046
  MAX_LENGTH
11714
- } = require_constants5();
10047
+ } = require_constants4();
11715
10048
  var debug = require_debug();
11716
10049
  exports = module.exports = {};
11717
10050
  var re = exports.re = [];
@@ -11831,7 +10164,7 @@ var require_identifiers = __commonJS((exports, module) => {
11831
10164
  // ../../node_modules/semver/classes/semver.js
11832
10165
  var require_semver = __commonJS((exports, module) => {
11833
10166
  var debug = require_debug();
11834
- var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants5();
10167
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants4();
11835
10168
  var { safeRe: re, t } = require_re();
11836
10169
  var parseOptions = require_parse_options();
11837
10170
  var { compareIdentifiers } = require_identifiers();
@@ -12098,7 +10431,7 @@ var require_semver = __commonJS((exports, module) => {
12098
10431
  });
12099
10432
 
12100
10433
  // ../../node_modules/semver/functions/parse.js
12101
- var require_parse4 = __commonJS((exports, module) => {
10434
+ var require_parse3 = __commonJS((exports, module) => {
12102
10435
  var SemVer = require_semver();
12103
10436
  var parse = (version, options, throwErrors = false) => {
12104
10437
  if (version instanceof SemVer) {
@@ -12118,7 +10451,7 @@ var require_parse4 = __commonJS((exports, module) => {
12118
10451
 
12119
10452
  // ../../node_modules/semver/functions/valid.js
12120
10453
  var require_valid = __commonJS((exports, module) => {
12121
- var parse = require_parse4();
10454
+ var parse = require_parse3();
12122
10455
  var valid = (version, options) => {
12123
10456
  const v = parse(version, options);
12124
10457
  return v ? v.version : null;
@@ -12128,7 +10461,7 @@ var require_valid = __commonJS((exports, module) => {
12128
10461
 
12129
10462
  // ../../node_modules/semver/functions/clean.js
12130
10463
  var require_clean = __commonJS((exports, module) => {
12131
- var parse = require_parse4();
10464
+ var parse = require_parse3();
12132
10465
  var clean = (version, options) => {
12133
10466
  const s = parse(version.trim().replace(/^[=v]+/, ""), options);
12134
10467
  return s ? s.version : null;
@@ -12156,7 +10489,7 @@ var require_inc = __commonJS((exports, module) => {
12156
10489
 
12157
10490
  // ../../node_modules/semver/functions/diff.js
12158
10491
  var require_diff = __commonJS((exports, module) => {
12159
- var parse = require_parse4();
10492
+ var parse = require_parse3();
12160
10493
  var diff = (version1, version2) => {
12161
10494
  const v1 = parse(version1, null, true);
12162
10495
  const v2 = parse(version2, null, true);
@@ -12218,7 +10551,7 @@ var require_patch = __commonJS((exports, module) => {
12218
10551
 
12219
10552
  // ../../node_modules/semver/functions/prerelease.js
12220
10553
  var require_prerelease = __commonJS((exports, module) => {
12221
- var parse = require_parse4();
10554
+ var parse = require_parse3();
12222
10555
  var prerelease = (version, options) => {
12223
10556
  const parsed = parse(version, options);
12224
10557
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
@@ -12364,7 +10697,7 @@ var require_cmp = __commonJS((exports, module) => {
12364
10697
  // ../../node_modules/semver/functions/coerce.js
12365
10698
  var require_coerce = __commonJS((exports, module) => {
12366
10699
  var SemVer = require_semver();
12367
- var parse = require_parse4();
10700
+ var parse = require_parse3();
12368
10701
  var { safeRe: re, t } = require_re();
12369
10702
  var coerce = (version, options) => {
12370
10703
  if (version instanceof SemVer) {
@@ -12594,7 +10927,7 @@ var require_range = __commonJS((exports, module) => {
12594
10927
  tildeTrimReplace,
12595
10928
  caretTrimReplace
12596
10929
  } = require_re();
12597
- var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants5();
10930
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants4();
12598
10931
  var isNullSet = (c) => c.value === "<0.0.0-0";
12599
10932
  var isAny = (c) => c.value === "";
12600
10933
  var isSatisfiable = (comparators, options) => {
@@ -13365,10 +11698,10 @@ var require_subset = __commonJS((exports, module) => {
13365
11698
  // ../../node_modules/semver/index.js
13366
11699
  var require_semver2 = __commonJS((exports, module) => {
13367
11700
  var internalRe = require_re();
13368
- var constants = require_constants5();
11701
+ var constants = require_constants4();
13369
11702
  var SemVer = require_semver();
13370
11703
  var identifiers = require_identifiers();
13371
- var parse = require_parse4();
11704
+ var parse = require_parse3();
13372
11705
  var valid = require_valid();
13373
11706
  var clean = require_clean();
13374
11707
  var inc = require_inc();
@@ -14411,8 +12744,8 @@ function isBaseMapInstance(obj) {
14411
12744
  return Object.getPrototypeOf(obj) === Map.prototype;
14412
12745
  }
14413
12746
  function latest(proxyDraft) {
14414
- var _a2;
14415
- return (_a2 = proxyDraft.copy) !== null && _a2 !== undefined ? _a2 : proxyDraft.original;
12747
+ var _a;
12748
+ return (_a = proxyDraft.copy) !== null && _a !== undefined ? _a : proxyDraft.original;
14416
12749
  }
14417
12750
  function isDraft(target) {
14418
12751
  return !!getProxyDraft(target);
@@ -14423,9 +12756,9 @@ function getProxyDraft(value) {
14423
12756
  return value === null || value === undefined ? undefined : value[PROXY_DRAFT];
14424
12757
  }
14425
12758
  function getValue(value) {
14426
- var _a2;
12759
+ var _a;
14427
12760
  const proxyDraft = getProxyDraft(value);
14428
- return proxyDraft ? (_a2 = proxyDraft.copy) !== null && _a2 !== undefined ? _a2 : proxyDraft.original : value;
12761
+ return proxyDraft ? (_a = proxyDraft.copy) !== null && _a !== undefined ? _a : proxyDraft.original : value;
14429
12762
  }
14430
12763
  function isDraftable(value, options) {
14431
12764
  if (!value || typeof value !== "object")
@@ -14622,8 +12955,8 @@ function cloneIfNeeded(target) {
14622
12955
  return isDraft(target) ? deepClone(target) : target;
14623
12956
  }
14624
12957
  function markChanged(proxyDraft) {
14625
- var _a2;
14626
- proxyDraft.assignedMap = (_a2 = proxyDraft.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
12958
+ var _a;
12959
+ proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !== undefined ? _a : new Map;
14627
12960
  if (!proxyDraft.operated) {
14628
12961
  proxyDraft.operated = true;
14629
12962
  if (proxyDraft.parent) {
@@ -14726,11 +13059,11 @@ function handleValue(target, handledSet, options) {
14726
13059
  const setMap = isSet ? new Map : undefined;
14727
13060
  handledSet.add(target);
14728
13061
  forEach(target, (key, value) => {
14729
- var _a2;
13062
+ var _a;
14730
13063
  if (isDraft(value)) {
14731
13064
  const proxyDraft = getProxyDraft(value);
14732
13065
  ensureShallowCopy(proxyDraft);
14733
- const updatedValue = ((_a2 = proxyDraft.assignedMap) === null || _a2 === undefined ? undefined : _a2.size) || proxyDraft.operated ? proxyDraft.copy : proxyDraft.original;
13066
+ const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a === undefined ? undefined : _a.size) || proxyDraft.operated ? proxyDraft.copy : proxyDraft.original;
14734
13067
  set(isSet ? setMap : target, key, updatedValue);
14735
13068
  } else {
14736
13069
  handleValue(value, handledSet, options);
@@ -14778,7 +13111,7 @@ function markFinalization(target, key, value, generatePatches) {
14778
13111
  proxyDraft.callbacks = [];
14779
13112
  }
14780
13113
  proxyDraft.callbacks.push((patches, inversePatches) => {
14781
- var _a2;
13114
+ var _a;
14782
13115
  const copy = target.type === 3 ? target.setMap : target.copy;
14783
13116
  if (isEqual(get(copy, key), value)) {
14784
13117
  let updatedValue = proxyDraft.original;
@@ -14788,7 +13121,7 @@ function markFinalization(target, key, value, generatePatches) {
14788
13121
  finalizeSetValue(target);
14789
13122
  finalizePatches(target, generatePatches, patches, inversePatches);
14790
13123
  if (target.options.enableAutoFreeze) {
14791
- target.options.updatedValues = (_a2 = target.options.updatedValues) !== null && _a2 !== undefined ? _a2 : new WeakMap;
13124
+ target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !== undefined ? _a : new WeakMap;
14792
13125
  target.options.updatedValues.set(updatedValue, proxyDraft.original);
14793
13126
  }
14794
13127
  set(copy, key, updatedValue);
@@ -14949,7 +13282,7 @@ function createDraft(createDraftOptions) {
14949
13282
  if (parentDraft) {
14950
13283
  const target = parentDraft;
14951
13284
  target.finalities.draft.push((patches, inversePatches) => {
14952
- var _a2, _b;
13285
+ var _a, _b;
14953
13286
  const oldProxyDraft = getProxyDraft(proxy);
14954
13287
  let copy = target.type === 3 ? target.setMap : target.copy;
14955
13288
  const draft = get(copy, key);
@@ -14962,7 +13295,7 @@ function createDraft(createDraftOptions) {
14962
13295
  finalizeSetValue(proxyDraft2);
14963
13296
  finalizePatches(proxyDraft2, generatePatches, patches, inversePatches);
14964
13297
  if (target.options.enableAutoFreeze) {
14965
- target.options.updatedValues = (_a2 = target.options.updatedValues) !== null && _a2 !== undefined ? _a2 : new WeakMap;
13298
+ target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !== undefined ? _a : new WeakMap;
14966
13299
  target.options.updatedValues.set(updatedValue, proxyDraft2.original);
14967
13300
  }
14968
13301
  set(copy, key, updatedValue);
@@ -14981,9 +13314,9 @@ function createDraft(createDraftOptions) {
14981
13314
  return proxy;
14982
13315
  }
14983
13316
  function finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {
14984
- var _a2;
13317
+ var _a;
14985
13318
  const proxyDraft = getProxyDraft(result);
14986
- const original = (_a2 = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a2 !== undefined ? _a2 : result;
13319
+ const original = (_a = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a !== undefined ? _a : result;
14987
13320
  const hasReturnedValue = !!returnedValue.length;
14988
13321
  if (proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.operated) {
14989
13322
  while (proxyDraft.finalities.draft.length > 0) {
@@ -15004,7 +13337,7 @@ function finalizeDraft(result, returnedValue, patches, inversePatches, enableAut
15004
13337
  ];
15005
13338
  }
15006
13339
  function draftify(baseState, options) {
15007
- var _a2;
13340
+ var _a;
15008
13341
  const finalities = {
15009
13342
  draft: [],
15010
13343
  revoke: [],
@@ -15017,7 +13350,7 @@ function draftify(baseState, options) {
15017
13350
  patches = [];
15018
13351
  inversePatches = [];
15019
13352
  }
15020
- const isMutable = ((_a2 = options.mark) === null || _a2 === undefined ? undefined : _a2.call(options, baseState, dataTypes)) === dataTypes.mutable || !isDraftable(baseState, options);
13353
+ const isMutable = ((_a = options.mark) === null || _a === undefined ? undefined : _a.call(options, baseState, dataTypes)) === dataTypes.mutable || !isDraftable(baseState, options);
15021
13354
  const draft = isMutable ? baseState : createDraft({
15022
13355
  original: baseState,
15023
13356
  parentDraft: null,
@@ -15061,7 +13394,7 @@ function handleReturnValue(options) {
15061
13394
  }
15062
13395
  }
15063
13396
  function getCurrent(target) {
15064
- var _a2;
13397
+ var _a;
15065
13398
  const proxyDraft = getProxyDraft(target);
15066
13399
  if (!isDraftable(target, proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.options))
15067
13400
  return target;
@@ -15093,7 +13426,7 @@ function getCurrent(target) {
15093
13426
  }
15094
13427
  });
15095
13428
  if (type === 3) {
15096
- const value = (_a2 = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a2 !== undefined ? _a2 : currentValue;
13429
+ const value = (_a = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a !== undefined ? _a : currentValue;
15097
13430
  return !isBaseSetInstance(value) ? new (Object.getPrototypeOf(value)).constructor(currentValue) : new Set(currentValue);
15098
13431
  }
15099
13432
  return currentValue;
@@ -16007,15 +14340,15 @@ function typeValidatorBuilder(typeName, comparatorStrategy) {
16007
14340
  function string() {
16008
14341
  return new ArcString;
16009
14342
  }
16010
- function id(name, generateFn) {
16011
- return new ArcId(name, generateFn);
16012
- }
16013
14343
 
16014
14344
  class ArcFragmentBase {
16015
14345
  is(type) {
16016
14346
  return this.types.includes(type);
16017
14347
  }
16018
14348
  }
14349
+ function id(name, generateFn) {
14350
+ return new ArcId(name, generateFn);
14351
+ }
16019
14352
 
16020
14353
  class AggregateBase {
16021
14354
  value;
@@ -17491,14 +15824,14 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17491
15824
  throw new Error(`Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.`);
17492
15825
  }
17493
15826
  }, mapHandler, mapHandlerKeys, getNextIterator = (target, iterator, { isValuesIterator }) => () => {
17494
- var _a2, _b;
15827
+ var _a, _b;
17495
15828
  const result = iterator.next();
17496
15829
  if (result.done)
17497
15830
  return result;
17498
15831
  const key = result.value;
17499
15832
  let value = target.setMap.get(key);
17500
15833
  const currentDraft = getProxyDraft(value);
17501
- const mutable = ((_b = (_a2 = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a2, value, dataTypes)) === dataTypes.mutable;
15834
+ const mutable = ((_b = (_a = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a, value, dataTypes)) === dataTypes.mutable;
17502
15835
  if (target.options.strict) {
17503
15836
  checkReadable(key, target.options, mutable);
17504
15837
  }
@@ -17524,7 +15857,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17524
15857
  throw new Error(`Invalid options: ${String(arg)}, 'options' should be an object.`);
17525
15858
  }
17526
15859
  return function create(arg0, arg1, arg2) {
17527
- var _a2, _b, _c;
15860
+ var _a, _b, _c;
17528
15861
  if (typeof arg0 === "function" && typeof arg1 !== "function") {
17529
15862
  return function(base22, ...args) {
17530
15863
  return create(base22, (draft2) => arg0.call(this, draft2, ...args), arg1);
@@ -17553,7 +15886,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17553
15886
  }
17554
15887
  return;
17555
15888
  } : options.mark;
17556
- const enablePatches = (_a2 = options.enablePatches) !== null && _a2 !== undefined ? _a2 : false;
15889
+ const enablePatches = (_a = options.enablePatches) !== null && _a !== undefined ? _a : false;
17557
15890
  const strict = (_b = options.strict) !== null && _b !== undefined ? _b : false;
17558
15891
  const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== undefined ? _c : false;
17559
15892
  const _options = {
@@ -17624,7 +15957,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
17624
15957
  }
17625
15958
  return returnValue(result);
17626
15959
  };
17627
- }, create, constructorString, TOKEN_PREFIX = "arc:token:", eventWireInstanceCounter = 0, EVENT_TABLES, arrayValidator, ArcArray, objectValidator, ArcObject, ArcPrimitive, ArcBoolean, stringValidator, ArcString, ArcId, numberValidator, ArcNumber, ArcContextElement, ArcEvent, ForkedStoreState, ForkedDataStorage, MasterStoreState, MasterDataStorage2, dateValidator, SQLiteReadWriteTransaction, createSQLiteAdapterFactory = (db) => {
15960
+ }, create, constructorString, TOKEN_PREFIX = "arc:token:", eventWireInstanceCounter = 0, EVENT_TABLES, arrayValidator, ArcArray, objectValidator, ArcObject, ArcPrimitive, stringValidator, ArcString, ArcContextElement, ArcBoolean, ArcId, numberValidator, ArcNumber, ArcEvent, ForkedStoreState, ForkedDataStorage, MasterStoreState, MasterDataStorage2, dateValidator, SQLiteReadWriteTransaction, createSQLiteAdapterFactory = (db) => {
17628
15961
  return async (context) => {
17629
15962
  const adapter = new SQLiteAdapter(db, context);
17630
15963
  await adapter.initialize();
@@ -17705,10 +16038,10 @@ var init_dist = __esm(() => {
17705
16038
  });
17706
16039
  },
17707
16040
  get(key) {
17708
- var _a2, _b;
16041
+ var _a, _b;
17709
16042
  const target = getProxyDraft(this);
17710
16043
  const value = latest(target).get(key);
17711
- const mutable = ((_b = (_a2 = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a2, value, dataTypes)) === dataTypes.mutable;
16044
+ const mutable = ((_b = (_a = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a, value, dataTypes)) === dataTypes.mutable;
17712
16045
  if (target.options.strict) {
17713
16046
  checkReadable(value, target.options, mutable);
17714
16047
  }
@@ -17891,8 +16224,8 @@ var init_dist = __esm(() => {
17891
16224
  setHandlerKeys = Reflect.ownKeys(setHandler);
17892
16225
  proxyHandler = {
17893
16226
  get(target, key, receiver) {
17894
- var _a2, _b;
17895
- const copy = (_a2 = target.copy) === null || _a2 === undefined ? undefined : _a2[key];
16227
+ var _a, _b;
16228
+ const copy = (_a = target.copy) === null || _a === undefined ? undefined : _a[key];
17896
16229
  if (copy && target.finalities.draftsCache.has(copy)) {
17897
16230
  return copy;
17898
16231
  }
@@ -17958,7 +16291,7 @@ var init_dist = __esm(() => {
17958
16291
  return value;
17959
16292
  },
17960
16293
  set(target, key, value) {
17961
- var _a2;
16294
+ var _a;
17962
16295
  if (target.type === 3 || target.type === 2) {
17963
16296
  throw new Error(`Map/Set draft does not support any property assignment.`);
17964
16297
  }
@@ -17975,7 +16308,7 @@ var init_dist = __esm(() => {
17975
16308
  const currentProxyDraft = getProxyDraft(current);
17976
16309
  if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {
17977
16310
  target.copy[key] = value;
17978
- target.assignedMap = (_a2 = target.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
16311
+ target.assignedMap = (_a = target.assignedMap) !== null && _a !== undefined ? _a : new Map;
17979
16312
  target.assignedMap.set(key, false);
17980
16313
  return true;
17981
16314
  }
@@ -18020,7 +16353,7 @@ var init_dist = __esm(() => {
18020
16353
  throw new Error(`Cannot call 'defineProperty()' on drafts`);
18021
16354
  },
18022
16355
  deleteProperty(target, key) {
18023
- var _a2;
16356
+ var _a;
18024
16357
  if (target.type === 1) {
18025
16358
  return proxyHandler.set.call(this, target, key, undefined, target.proxy);
18026
16359
  }
@@ -18029,7 +16362,7 @@ var init_dist = __esm(() => {
18029
16362
  markChanged(target);
18030
16363
  target.assignedMap.set(key, false);
18031
16364
  } else {
18032
- target.assignedMap = (_a2 = target.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
16365
+ target.assignedMap = (_a = target.assignedMap) !== null && _a !== undefined ? _a : new Map;
18033
16366
  target.assignedMap.delete(key);
18034
16367
  }
18035
16368
  if (target.copy)
@@ -18315,37 +16648,6 @@ var init_dist = __esm(() => {
18315
16648
  return value;
18316
16649
  }
18317
16650
  };
18318
- ArcBoolean = class ArcBoolean extends ArcPrimitive {
18319
- hasToBeTrue() {
18320
- return this.validation("hasToBeTrue", (value) => {
18321
- if (!value)
18322
- return {
18323
- current: value
18324
- };
18325
- });
18326
- }
18327
- validation(name, validator) {
18328
- const instance = this.pipeValidation(name, validator);
18329
- return instance;
18330
- }
18331
- toJsonSchema() {
18332
- const schema = { type: "boolean" };
18333
- if (this._description) {
18334
- schema.description = this._description;
18335
- }
18336
- return schema;
18337
- }
18338
- getColumnData() {
18339
- const storeData = this.getStoreData();
18340
- return {
18341
- type: "boolean",
18342
- storeData: {
18343
- ...storeData,
18344
- isNullable: false
18345
- }
18346
- };
18347
- }
18348
- };
18349
16651
  stringValidator = typeValidatorBuilder("string");
18350
16652
  ArcString = class ArcString extends ArcPrimitive {
18351
16653
  constructor() {
@@ -18493,6 +16795,52 @@ var init_dist = __esm(() => {
18493
16795
  };
18494
16796
  }
18495
16797
  };
16798
+ ArcContextElement = class ArcContextElement extends ArcFragmentBase {
16799
+ name;
16800
+ types = ["context-element"];
16801
+ get id() {
16802
+ return this.name;
16803
+ }
16804
+ constructor(name) {
16805
+ super();
16806
+ this.name = name;
16807
+ }
16808
+ _seeds;
16809
+ getSeeds() {
16810
+ return this._seeds;
16811
+ }
16812
+ };
16813
+ ArcBoolean = class ArcBoolean extends ArcPrimitive {
16814
+ hasToBeTrue() {
16815
+ return this.validation("hasToBeTrue", (value) => {
16816
+ if (!value)
16817
+ return {
16818
+ current: value
16819
+ };
16820
+ });
16821
+ }
16822
+ validation(name, validator) {
16823
+ const instance = this.pipeValidation(name, validator);
16824
+ return instance;
16825
+ }
16826
+ toJsonSchema() {
16827
+ const schema = { type: "boolean" };
16828
+ if (this._description) {
16829
+ schema.description = this._description;
16830
+ }
16831
+ return schema;
16832
+ }
16833
+ getColumnData() {
16834
+ const storeData = this.getStoreData();
16835
+ return {
16836
+ type: "boolean",
16837
+ storeData: {
16838
+ ...storeData,
16839
+ isNullable: false
16840
+ }
16841
+ };
16842
+ }
16843
+ };
18496
16844
  ArcId = class ArcId extends ArcBranded {
18497
16845
  generateFn;
18498
16846
  constructor(name, generateFn) {
@@ -18558,17 +16906,6 @@ var init_dist = __esm(() => {
18558
16906
  };
18559
16907
  }
18560
16908
  };
18561
- ArcContextElement = class ArcContextElement extends ArcFragmentBase {
18562
- name;
18563
- types = ["context-element"];
18564
- get id() {
18565
- return this.name;
18566
- }
18567
- constructor(name) {
18568
- super();
18569
- this.name = name;
18570
- }
18571
- };
18572
16909
  ArcEvent = class ArcEvent extends ArcContextElement {
18573
16910
  data;
18574
16911
  eventId = id("event");
@@ -19148,7 +17485,7 @@ var init_dist = __esm(() => {
19148
17485
  };
19149
17486
  });
19150
17487
 
19151
- // node_modules/commander/esm.mjs
17488
+ // ../../node_modules/commander/esm.mjs
19152
17489
  var import__ = __toESM(require_commander(), 1);
19153
17490
  var {
19154
17491
  program,
@@ -19164,10 +17501,10 @@ var {
19164
17501
  Help
19165
17502
  } = import__.default;
19166
17503
 
19167
- // node_modules/find-up/index.js
17504
+ // ../../node_modules/find-up/index.js
19168
17505
  import path2 from "node:path";
19169
17506
 
19170
- // node_modules/find-up/node_modules/locate-path/index.js
17507
+ // ../../node_modules/locate-path/index.js
19171
17508
  import process2 from "node:process";
19172
17509
  import path from "node:path";
19173
17510
  import fs, { promises as fsPromises } from "node:fs";
@@ -19213,7 +17550,7 @@ function toPath2(urlOrPath) {
19213
17550
  return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
19214
17551
  }
19215
17552
 
19216
- // node_modules/find-up/index.js
17553
+ // ../../node_modules/find-up/index.js
19217
17554
  var findUpStop = Symbol("findUpStop");
19218
17555
  function findUpMultipleSync(name, options = {}) {
19219
17556
  let directory = path2.resolve(toPath2(options.cwd) ?? "");
@@ -21422,35 +19759,8 @@ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
21422
19759
  };
21423
19760
 
21424
19761
  // node_modules/glob/node_modules/minimatch/dist/esm/ast.js
21425
- var _a;
21426
19762
  var types = new Set(["!", "?", "+", "*", "@"]);
21427
19763
  var isExtglobType = (c) => types.has(c);
21428
- var isExtglobAST = (c) => isExtglobType(c.type);
21429
- var adoptionMap = new Map([
21430
- ["!", ["@"]],
21431
- ["?", ["?", "@"]],
21432
- ["@", ["@"]],
21433
- ["*", ["*", "+", "?", "@"]],
21434
- ["+", ["+", "@"]]
21435
- ]);
21436
- var adoptionWithSpaceMap = new Map([
21437
- ["!", ["?"]],
21438
- ["@", ["?"]],
21439
- ["+", ["?", "*"]]
21440
- ]);
21441
- var adoptionAnyMap = new Map([
21442
- ["!", ["?", "@"]],
21443
- ["?", ["?", "@"]],
21444
- ["@", ["?", "@"]],
21445
- ["*", ["*", "+", "?", "@"]],
21446
- ["+", ["+", "@", "?", "*"]]
21447
- ]);
21448
- var usurpMap = new Map([
21449
- ["!", new Map([["!", "@"]])],
21450
- ["?", new Map([["*", "*"], ["+", "*"]])],
21451
- ["@", new Map([["!", "!"], ["?", "?"], ["@", "@"], ["*", "*"], ["+", "+"]])],
21452
- ["+", new Map([["?", "*"], ["*", "*"]])]
21453
- ]);
21454
19764
  var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
21455
19765
  var startNoDot = "(?!\\.)";
21456
19766
  var addPatternStart = new Set(["[", "."]);
@@ -21538,7 +19848,7 @@ class AST {
21538
19848
  for (const p of parts) {
21539
19849
  if (p === "")
21540
19850
  continue;
21541
- if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
19851
+ if (typeof p !== "string" && !(p instanceof AST && p.#parent === this)) {
21542
19852
  throw new Error("invalid part: " + p);
21543
19853
  }
21544
19854
  this.#parts.push(p);
@@ -21563,7 +19873,7 @@ class AST {
21563
19873
  const p = this.#parent;
21564
19874
  for (let i = 0;i < this.#parentIndex; i++) {
21565
19875
  const pp = p.#parts[i];
21566
- if (!(pp instanceof _a && pp.type === "!")) {
19876
+ if (!(pp instanceof AST && pp.type === "!")) {
21567
19877
  return false;
21568
19878
  }
21569
19879
  }
@@ -21588,14 +19898,13 @@ class AST {
21588
19898
  this.push(part.clone(this));
21589
19899
  }
21590
19900
  clone(parent) {
21591
- const c = new _a(this.type, parent);
19901
+ const c = new AST(this.type, parent);
21592
19902
  for (const p of this.#parts) {
21593
19903
  c.copyIn(p);
21594
19904
  }
21595
19905
  return c;
21596
19906
  }
21597
- static #parseAST(str, ast, pos, opt, extDepth) {
21598
- const maxDepth = opt.maxExtglobRecursion ?? 2;
19907
+ static #parseAST(str, ast, pos, opt) {
21599
19908
  let escaping = false;
21600
19909
  let inBrace = false;
21601
19910
  let braceStart = -1;
@@ -21627,12 +19936,11 @@ class AST {
21627
19936
  acc2 += c;
21628
19937
  continue;
21629
19938
  }
21630
- const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
21631
- if (doRecurse) {
19939
+ if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(") {
21632
19940
  ast.push(acc2);
21633
19941
  acc2 = "";
21634
- const ext = new _a(c, ast);
21635
- i2 = _a.#parseAST(str, ext, i2, opt, extDepth + 1);
19942
+ const ext = new AST(c, ast);
19943
+ i2 = AST.#parseAST(str, ext, i2, opt);
21636
19944
  ast.push(ext);
21637
19945
  continue;
21638
19946
  }
@@ -21642,7 +19950,7 @@ class AST {
21642
19950
  return i2;
21643
19951
  }
21644
19952
  let i = pos + 1;
21645
- let part = new _a(null, ast);
19953
+ let part = new AST(null, ast);
21646
19954
  const parts = [];
21647
19955
  let acc = "";
21648
19956
  while (i < str.length) {
@@ -21669,21 +19977,19 @@ class AST {
21669
19977
  acc += c;
21670
19978
  continue;
21671
19979
  }
21672
- const doRecurse = isExtglobType(c) && str.charAt(i) === "(" && (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
21673
- if (doRecurse) {
21674
- const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
19980
+ if (isExtglobType(c) && str.charAt(i) === "(") {
21675
19981
  part.push(acc);
21676
19982
  acc = "";
21677
- const ext = new _a(c, part);
19983
+ const ext = new AST(c, part);
21678
19984
  part.push(ext);
21679
- i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
19985
+ i = AST.#parseAST(str, ext, i, opt);
21680
19986
  continue;
21681
19987
  }
21682
19988
  if (c === "|") {
21683
19989
  part.push(acc);
21684
19990
  acc = "";
21685
19991
  parts.push(part);
21686
- part = new _a(null, ast);
19992
+ part = new AST(null, ast);
21687
19993
  continue;
21688
19994
  }
21689
19995
  if (c === ")") {
@@ -21702,101 +20008,9 @@ class AST {
21702
20008
  ast.#parts = [str.substring(pos - 1)];
21703
20009
  return i;
21704
20010
  }
21705
- #canAdoptWithSpace(child) {
21706
- return this.#canAdopt(child, adoptionWithSpaceMap);
21707
- }
21708
- #canAdopt(child, map = adoptionMap) {
21709
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
21710
- return false;
21711
- }
21712
- const gc = child.#parts[0];
21713
- if (!gc || typeof gc !== "object" || gc.type === null) {
21714
- return false;
21715
- }
21716
- return this.#canAdoptType(gc.type, map);
21717
- }
21718
- #canAdoptType(c, map = adoptionAnyMap) {
21719
- return !!map.get(this.type)?.includes(c);
21720
- }
21721
- #adoptWithSpace(child, index) {
21722
- const gc = child.#parts[0];
21723
- const blank = new _a(null, gc, this.options);
21724
- blank.#parts.push("");
21725
- gc.push(blank);
21726
- this.#adopt(child, index);
21727
- }
21728
- #adopt(child, index) {
21729
- const gc = child.#parts[0];
21730
- this.#parts.splice(index, 1, ...gc.#parts);
21731
- for (const p of gc.#parts) {
21732
- if (typeof p === "object")
21733
- p.#parent = this;
21734
- }
21735
- this.#toString = undefined;
21736
- }
21737
- #canUsurpType(c) {
21738
- const m = usurpMap.get(this.type);
21739
- return !!m?.has(c);
21740
- }
21741
- #canUsurp(child) {
21742
- if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
21743
- return false;
21744
- }
21745
- const gc = child.#parts[0];
21746
- if (!gc || typeof gc !== "object" || gc.type === null) {
21747
- return false;
21748
- }
21749
- return this.#canUsurpType(gc.type);
21750
- }
21751
- #usurp(child) {
21752
- const m = usurpMap.get(this.type);
21753
- const gc = child.#parts[0];
21754
- const nt = m?.get(gc.type);
21755
- if (!nt)
21756
- return false;
21757
- this.#parts = gc.#parts;
21758
- for (const p of this.#parts) {
21759
- if (typeof p === "object")
21760
- p.#parent = this;
21761
- }
21762
- this.type = nt;
21763
- this.#toString = undefined;
21764
- this.#emptyExt = false;
21765
- }
21766
- #flatten() {
21767
- if (!isExtglobAST(this)) {
21768
- for (const p of this.#parts) {
21769
- if (typeof p === "object")
21770
- p.#flatten();
21771
- }
21772
- } else {
21773
- let iterations = 0;
21774
- let done = false;
21775
- do {
21776
- done = true;
21777
- for (let i = 0;i < this.#parts.length; i++) {
21778
- const c = this.#parts[i];
21779
- if (typeof c === "object") {
21780
- c.#flatten();
21781
- if (this.#canAdopt(c)) {
21782
- done = false;
21783
- this.#adopt(c, i);
21784
- } else if (this.#canAdoptWithSpace(c)) {
21785
- done = false;
21786
- this.#adoptWithSpace(c, i);
21787
- } else if (this.#canUsurp(c)) {
21788
- done = false;
21789
- this.#usurp(c);
21790
- }
21791
- }
21792
- }
21793
- } while (!done && ++iterations < 10);
21794
- }
21795
- this.#toString = undefined;
21796
- }
21797
20011
  static fromGlob(pattern, options = {}) {
21798
- const ast = new _a(null, undefined, options);
21799
- _a.#parseAST(pattern, ast, 0, options, 0);
20012
+ const ast = new AST(null, undefined, options);
20013
+ AST.#parseAST(pattern, ast, 0, options);
21800
20014
  return ast;
21801
20015
  }
21802
20016
  toMMPattern() {
@@ -21819,14 +20033,12 @@ class AST {
21819
20033
  }
21820
20034
  toRegExpSource(allowDot) {
21821
20035
  const dot = allowDot ?? !!this.#options.dot;
21822
- if (this.#root === this) {
21823
- this.#flatten();
20036
+ if (this.#root === this)
21824
20037
  this.#fillNegs();
21825
- }
21826
- if (!isExtglobAST(this)) {
20038
+ if (!this.type) {
21827
20039
  const noEmpty = this.isStart() && this.isEnd();
21828
20040
  const src = this.#parts.map((p) => {
21829
- const [re, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
20041
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
21830
20042
  this.#hasMagic = this.#hasMagic || hasMagic;
21831
20043
  this.#uflag = this.#uflag || uflag;
21832
20044
  return re;
@@ -21860,10 +20072,9 @@ class AST {
21860
20072
  let body = this.#partsToRegExp(dot);
21861
20073
  if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
21862
20074
  const s = this.toString();
21863
- const me = this;
21864
- me.#parts = [s];
21865
- me.type = null;
21866
- me.#hasMagic = undefined;
20075
+ this.#parts = [s];
20076
+ this.type = null;
20077
+ this.#hasMagic = undefined;
21867
20078
  return [s, unescape(this.toString()), false, false];
21868
20079
  }
21869
20080
  let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
@@ -21901,13 +20112,11 @@ class AST {
21901
20112
  let escaping = false;
21902
20113
  let re = "";
21903
20114
  let uflag = false;
21904
- let inStar = false;
21905
20115
  for (let i = 0;i < glob.length; i++) {
21906
20116
  const c = glob.charAt(i);
21907
20117
  if (escaping) {
21908
20118
  escaping = false;
21909
20119
  re += (reSpecials.has(c) ? "\\" : "") + c;
21910
- inStar = false;
21911
20120
  continue;
21912
20121
  }
21913
20122
  if (c === "\\") {
@@ -21925,19 +20134,16 @@ class AST {
21925
20134
  uflag = uflag || needUflag;
21926
20135
  i += consumed - 1;
21927
20136
  hasMagic = hasMagic || magic;
21928
- inStar = false;
21929
20137
  continue;
21930
20138
  }
21931
20139
  }
21932
20140
  if (c === "*") {
21933
- if (inStar)
21934
- continue;
21935
- inStar = true;
21936
- re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
20141
+ if (noEmpty && glob === "*")
20142
+ re += starNoEmpty;
20143
+ else
20144
+ re += star;
21937
20145
  hasMagic = true;
21938
20146
  continue;
21939
- } else {
21940
- inStar = false;
21941
20147
  }
21942
20148
  if (c === "?") {
21943
20149
  re += qmark;
@@ -21949,7 +20155,6 @@ class AST {
21949
20155
  return [re, unescape(glob), !!hasMagic, uflag];
21950
20156
  }
21951
20157
  }
21952
- _a = AST;
21953
20158
 
21954
20159
  // node_modules/glob/node_modules/minimatch/dist/esm/escape.js
21955
20160
  var escape = (s, { windowsPathsNoEscape = false } = {}) => {
@@ -22104,13 +20309,11 @@ class Minimatch {
22104
20309
  isWindows;
22105
20310
  platform;
22106
20311
  windowsNoMagicRoot;
22107
- maxGlobstarRecursion;
22108
20312
  regexp;
22109
20313
  constructor(pattern, options = {}) {
22110
20314
  assertValidPattern(pattern);
22111
20315
  options = options || {};
22112
20316
  this.options = options;
22113
- this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
22114
20317
  this.pattern = pattern;
22115
20318
  this.platform = options.platform || defaultPlatform;
22116
20319
  this.isWindows = this.platform === "win32";
@@ -22405,8 +20608,7 @@ class Minimatch {
22405
20608
  this.negate = negate;
22406
20609
  }
22407
20610
  matchOne(file, pattern, partial = false) {
22408
- let fileStartIndex = 0;
22409
- let patternStartIndex = 0;
20611
+ const options = this.options;
22410
20612
  if (this.isWindows) {
22411
20613
  const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
22412
20614
  const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
@@ -22415,14 +20617,14 @@ class Minimatch {
22415
20617
  const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
22416
20618
  const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
22417
20619
  if (typeof fdi === "number" && typeof pdi === "number") {
22418
- const [fd, pd] = [
22419
- file[fdi],
22420
- pattern[pdi]
22421
- ];
20620
+ const [fd, pd] = [file[fdi], pattern[pdi]];
22422
20621
  if (fd.toLowerCase() === pd.toLowerCase()) {
22423
20622
  pattern[pdi] = fd;
22424
- patternStartIndex = pdi;
22425
- fileStartIndex = fdi;
20623
+ if (pdi > fdi) {
20624
+ pattern = pattern.slice(pdi);
20625
+ } else if (fdi > pdi) {
20626
+ file = file.slice(fdi);
20627
+ }
22426
20628
  }
22427
20629
  }
22428
20630
  }
@@ -22430,118 +20632,53 @@ class Minimatch {
22430
20632
  if (optimizationLevel >= 2) {
22431
20633
  file = this.levelTwoFileOptimize(file);
22432
20634
  }
22433
- if (pattern.includes(GLOBSTAR)) {
22434
- return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
22435
- }
22436
- return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
22437
- }
22438
- #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
22439
- const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
22440
- const lastgs = pattern.lastIndexOf(GLOBSTAR);
22441
- const [head, body, tail] = partial ? [
22442
- pattern.slice(patternIndex, firstgs),
22443
- pattern.slice(firstgs + 1),
22444
- []
22445
- ] : [
22446
- pattern.slice(patternIndex, firstgs),
22447
- pattern.slice(firstgs + 1, lastgs),
22448
- pattern.slice(lastgs + 1)
22449
- ];
22450
- if (head.length) {
22451
- const fileHead = file.slice(fileIndex, fileIndex + head.length);
22452
- if (!this.#matchOne(fileHead, head, partial, 0, 0))
22453
- return false;
22454
- fileIndex += head.length;
22455
- }
22456
- let fileTailMatch = 0;
22457
- if (tail.length) {
22458
- if (tail.length + fileIndex > file.length)
20635
+ this.debug("matchOne", this, { file, pattern });
20636
+ this.debug("matchOne", file.length, pattern.length);
20637
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
20638
+ this.debug("matchOne loop");
20639
+ var p = pattern[pi];
20640
+ var f = file[fi];
20641
+ this.debug(pattern, p, f);
20642
+ if (p === false) {
22459
20643
  return false;
22460
- let tailStart = file.length - tail.length;
22461
- if (this.#matchOne(file, tail, partial, tailStart, 0)) {
22462
- fileTailMatch = tail.length;
22463
- } else {
22464
- if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
22465
- return false;
22466
- }
22467
- tailStart--;
22468
- if (!this.#matchOne(file, tail, partial, tailStart, 0))
22469
- return false;
22470
- fileTailMatch = tail.length + 1;
22471
20644
  }
22472
- }
22473
- if (!body.length) {
22474
- let sawSome = !!fileTailMatch;
22475
- for (let i2 = fileIndex;i2 < file.length - fileTailMatch; i2++) {
22476
- const f = String(file[i2]);
22477
- sawSome = true;
22478
- if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
22479
- return false;
20645
+ if (p === GLOBSTAR) {
20646
+ this.debug("GLOBSTAR", [pattern, p, f]);
20647
+ var fr = fi;
20648
+ var pr = pi + 1;
20649
+ if (pr === pl) {
20650
+ this.debug("** at the end");
20651
+ for (;fi < fl; fi++) {
20652
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
20653
+ return false;
20654
+ }
20655
+ return true;
22480
20656
  }
22481
- }
22482
- return partial || sawSome;
22483
- }
22484
- const bodySegments = [[[], 0]];
22485
- let currentBody = bodySegments[0];
22486
- let nonGsParts = 0;
22487
- const nonGsPartsSums = [0];
22488
- for (const b of body) {
22489
- if (b === GLOBSTAR) {
22490
- nonGsPartsSums.push(nonGsParts);
22491
- currentBody = [[], 0];
22492
- bodySegments.push(currentBody);
22493
- } else {
22494
- currentBody[0].push(b);
22495
- nonGsParts++;
22496
- }
22497
- }
22498
- let i = bodySegments.length - 1;
22499
- const fileLength = file.length - fileTailMatch;
22500
- for (const b of bodySegments) {
22501
- b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
22502
- }
22503
- return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
22504
- }
22505
- #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
22506
- const bs = bodySegments[bodyIndex];
22507
- if (!bs) {
22508
- for (let i = fileIndex;i < file.length; i++) {
22509
- sawTail = true;
22510
- const f = file[i];
22511
- if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
22512
- return false;
20657
+ while (fr < fl) {
20658
+ var swallowee = file[fr];
20659
+ this.debug(`
20660
+ globstar while`, file, fr, pattern, pr, swallowee);
20661
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
20662
+ this.debug("globstar found match!", fr, fl, swallowee);
20663
+ return true;
20664
+ } else {
20665
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
20666
+ this.debug("dot detected!", file, fr, pattern, pr);
20667
+ break;
20668
+ }
20669
+ this.debug("globstar swallow a segment, and continue");
20670
+ fr++;
20671
+ }
20672
+ }
20673
+ if (partial) {
20674
+ this.debug(`
20675
+ >>> no match, partial?`, file, fr, pattern, pr);
20676
+ if (fr === fl) {
20677
+ return true;
20678
+ }
22513
20679
  }
22514
- }
22515
- return sawTail;
22516
- }
22517
- const [body, after] = bs;
22518
- while (fileIndex <= after) {
22519
- const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
22520
- if (m && globStarDepth < this.maxGlobstarRecursion) {
22521
- const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
22522
- if (sub !== false)
22523
- return sub;
22524
- }
22525
- const f = file[fileIndex];
22526
- if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
22527
20680
  return false;
22528
20681
  }
22529
- fileIndex++;
22530
- }
22531
- return partial || null;
22532
- }
22533
- #matchOne(file, pattern, partial, fileIndex, patternIndex) {
22534
- let fi;
22535
- let pi;
22536
- let pl;
22537
- let fl;
22538
- for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
22539
- this.debug("matchOne loop");
22540
- let p = pattern[pi];
22541
- let f = file[fi];
22542
- this.debug(pattern, p, f);
22543
- if (p === false || p === GLOBSTAR)
22544
- return false;
22545
20682
  let hit;
22546
20683
  if (typeof p === "string") {
22547
20684
  hit = f === p;
@@ -27408,6 +25545,7 @@ function parsePo(content) {
27408
25545
  let msgid = "";
27409
25546
  let msgstr = "";
27410
25547
  let obsolete = false;
25548
+ let inManual = false;
27411
25549
  const flush = () => {
27412
25550
  if (msgid) {
27413
25551
  entries.push({
@@ -27415,7 +25553,8 @@ function parsePo(content) {
27415
25553
  msgstr,
27416
25554
  locations,
27417
25555
  hash: hash || hashMsgid(msgid),
27418
- obsolete
25556
+ obsolete,
25557
+ ...inManual ? { manual: true } : {}
27419
25558
  });
27420
25559
  }
27421
25560
  locations = [];
@@ -27426,6 +25565,16 @@ function parsePo(content) {
27426
25565
  };
27427
25566
  for (const line of lines) {
27428
25567
  const trimmed = line.trim();
25568
+ if (trimmed === "# manual") {
25569
+ inManual = true;
25570
+ continue;
25571
+ }
25572
+ if (trimmed === "# end manual") {
25573
+ if (msgid)
25574
+ flush();
25575
+ inManual = false;
25576
+ continue;
25577
+ }
27429
25578
  if (trimmed === "" || trimmed.startsWith("#,")) {
27430
25579
  if (msgid)
27431
25580
  flush();
@@ -27468,8 +25617,19 @@ function parsePo(content) {
27468
25617
  }
27469
25618
  function writePo(entries) {
27470
25619
  const lines = [];
27471
- const active = entries.filter((e) => !e.obsolete);
25620
+ const manual = entries.filter((e) => e.manual);
25621
+ const active = entries.filter((e) => !e.obsolete && !e.manual);
27472
25622
  const obsolete = entries.filter((e) => e.obsolete);
25623
+ if (manual.length > 0) {
25624
+ lines.push("# manual");
25625
+ for (const entry of manual) {
25626
+ lines.push(`msgid ${quoteString(entry.msgid)}`);
25627
+ lines.push(`msgstr ${quoteString(entry.msgstr)}`);
25628
+ lines.push("");
25629
+ }
25630
+ lines.push("# end manual");
25631
+ lines.push("");
25632
+ }
27473
25633
  for (const entry of active) {
27474
25634
  for (const loc of entry.locations) {
27475
25635
  lines.push(`#: ${loc}`);
@@ -27496,10 +25656,14 @@ function mergeCatalog(existing, extracted) {
27496
25656
  for (const entry of existing) {
27497
25657
  existingMap.set(entry.msgid, entry);
27498
25658
  }
25659
+ const manualEntries = existing.filter((e) => e.manual);
25660
+ const manualIds = new Set(manualEntries.map((e) => e.msgid));
27499
25661
  const result = [];
27500
25662
  const seen = new Set;
27501
25663
  for (const [msgid, locations] of extracted) {
27502
25664
  seen.add(msgid);
25665
+ if (manualIds.has(msgid))
25666
+ continue;
27503
25667
  const prev = existingMap.get(msgid);
27504
25668
  result.push({
27505
25669
  msgid,
@@ -27510,7 +25674,7 @@ function mergeCatalog(existing, extracted) {
27510
25674
  });
27511
25675
  }
27512
25676
  for (const entry of existing) {
27513
- if (!seen.has(entry.msgid) && !entry.obsolete && entry.msgstr) {
25677
+ if (!seen.has(entry.msgid) && !entry.obsolete && !entry.manual && entry.msgstr) {
27514
25678
  result.push({
27515
25679
  ...entry,
27516
25680
  obsolete: true,
@@ -27518,7 +25682,8 @@ function mergeCatalog(existing, extracted) {
27518
25682
  });
27519
25683
  }
27520
25684
  }
27521
- return result;
25685
+ result.sort((a, b) => a.msgid.localeCompare(b.msgid));
25686
+ return [...manualEntries, ...result];
27522
25687
  }
27523
25688
  function extractQuoted(s) {
27524
25689
  const trimmed = s.trim();
@@ -27545,7 +25710,11 @@ function compileCatalog(poPath) {
27545
25710
  result[entry.msgid] = entry.msgstr;
27546
25711
  }
27547
25712
  }
27548
- return result;
25713
+ const sorted = {};
25714
+ for (const key of Object.keys(result).sort()) {
25715
+ sorted[key] = result[key];
25716
+ }
25717
+ return sorted;
27549
25718
  }
27550
25719
  function compileAllCatalogs(localesDir, outDir) {
27551
25720
  mkdirSync3(outDir, { recursive: true });
@@ -27751,8 +25920,11 @@ async function buildPackages(rootDir, outDir, packages) {
27751
25920
  const tmpDir = join6(outDir, "_entries");
27752
25921
  mkdirSync5(tmpDir, { recursive: true });
27753
25922
  const entrypoints = [];
25923
+ const fileToName = new Map;
27754
25924
  for (const pkg of packages) {
27755
25925
  const safeName = pkg.path.split("/").pop();
25926
+ const moduleName = pkg.name.includes("/") ? pkg.name.split("/").pop() : pkg.name;
25927
+ fileToName.set(safeName, moduleName);
27756
25928
  const wrapperFile = join6(tmpDir, `${safeName}.ts`);
27757
25929
  writeFileSync5(wrapperFile, `export * from "${pkg.name}";
27758
25930
  `);
@@ -27792,9 +25964,13 @@ async function buildPackages(rootDir, outDir, packages) {
27792
25964
  await finalizeTranslations(rootDir, join6(outDir, ".."), i18nCollector);
27793
25965
  const { rmSync } = await import("node:fs");
27794
25966
  rmSync(tmpDir, { recursive: true, force: true });
27795
- const moduleFiles = result.outputs.filter((o) => o.kind === "entry-point").map((o) => o.path.split("/").pop());
25967
+ const moduleEntries = result.outputs.filter((o) => o.kind === "entry-point").map((o) => {
25968
+ const file = o.path.split("/").pop();
25969
+ const safeName = file.replace(/\.js$/, "");
25970
+ return { file, name: fileToName.get(safeName) ?? safeName };
25971
+ });
27796
25972
  const manifest = {
27797
- modules: moduleFiles,
25973
+ modules: moduleEntries,
27798
25974
  buildTime: new Date().toISOString()
27799
25975
  };
27800
25976
  writeFileSync5(join6(outDir, "manifest.json"), JSON.stringify(manifest, null, 2));
@@ -28011,37 +26187,39 @@ export const { createPortal, flushSync } = ReactDOM;`
28011
26187
  ["arc-workspace", "@arcote.tech/arc-workspace"],
28012
26188
  ["platform", "@arcote.tech/platform"]
28013
26189
  ];
28014
- const arcEps = [];
26190
+ const baseExternal = [
26191
+ "react",
26192
+ "react-dom",
26193
+ "react/jsx-runtime",
26194
+ "react/jsx-dev-runtime",
26195
+ "react-dom/client"
26196
+ ];
26197
+ const allArcPkgs = arcEntries.map(([, pkg]) => pkg);
28015
26198
  for (const [name, pkg] of arcEntries) {
28016
26199
  const f = join7(tmpDir, `${name}.ts`);
28017
26200
  Bun.write(f, `export * from "${pkg}";
28018
26201
  `);
28019
- arcEps.push(f);
28020
- }
28021
- const r2 = await Bun.build({
28022
- entrypoints: arcEps,
28023
- outdir: outDir,
28024
- splitting: true,
28025
- format: "esm",
28026
- target: "browser",
28027
- naming: "[name].[ext]",
28028
- external: [
28029
- "react",
28030
- "react-dom",
28031
- "react/jsx-runtime",
28032
- "react/jsx-dev-runtime",
28033
- "react-dom/client"
28034
- ],
28035
- define: {
28036
- ONLY_SERVER: "false",
28037
- ONLY_BROWSER: "true",
28038
- ONLY_CLIENT: "true"
26202
+ const r2 = await Bun.build({
26203
+ entrypoints: [f],
26204
+ outdir: outDir,
26205
+ format: "esm",
26206
+ target: "browser",
26207
+ naming: "[name].[ext]",
26208
+ external: [
26209
+ ...baseExternal,
26210
+ ...allArcPkgs.filter((p) => p !== pkg)
26211
+ ],
26212
+ define: {
26213
+ ONLY_SERVER: "false",
26214
+ ONLY_BROWSER: "true",
26215
+ ONLY_CLIENT: "true"
26216
+ }
26217
+ });
26218
+ if (!r2.success) {
26219
+ for (const l of r2.logs)
26220
+ console.error(l);
26221
+ throw new Error(`Shell build failed for ${pkg}`);
28039
26222
  }
28040
- });
28041
- if (!r2.success) {
28042
- for (const l of r2.logs)
28043
- console.error(l);
28044
- throw new Error("Shell Arc build failed");
28045
26223
  }
28046
26224
  const { rmSync } = await import("node:fs");
28047
26225
  rmSync(tmpDir, { recursive: true, force: true });
@@ -28049,7 +26227,7 @@ export const { createPortal, flushSync } = ReactDOM;`
28049
26227
  async function loadServerContext(packages) {
28050
26228
  const ctxPackages = packages.filter((p) => isContextPackage(p.packageJson));
28051
26229
  if (ctxPackages.length === 0)
28052
- return null;
26230
+ return { context: null, moduleAccess: new Map };
28053
26231
  globalThis.ONLY_SERVER = true;
28054
26232
  globalThis.ONLY_BROWSER = false;
28055
26233
  globalThis.ONLY_CLIENT = false;
@@ -28069,8 +26247,17 @@ async function loadServerContext(packages) {
28069
26247
  err(`Failed to load server context from ${ctx.name}: ${e}`);
28070
26248
  }
28071
26249
  }
28072
- const { getContext } = await import(platformEntry);
28073
- return getContext() ?? null;
26250
+ const nonCtxPackages = packages.filter((p) => !isContextPackage(p.packageJson));
26251
+ for (const pkg of nonCtxPackages) {
26252
+ try {
26253
+ await import(pkg.entrypoint);
26254
+ } catch {}
26255
+ }
26256
+ const { getContext, getAllModuleAccess } = await import(platformEntry);
26257
+ return {
26258
+ context: getContext() ?? null,
26259
+ moduleAccess: getAllModuleAccess()
26260
+ };
28074
26261
  }
28075
26262
 
28076
26263
  // src/commands/platform-build.ts
@@ -28279,8 +26466,33 @@ class ContextHandler {
28279
26466
  if (this.initialized)
28280
26467
  return;
28281
26468
  await this.model.init();
26469
+ await this.runSeeds();
28282
26470
  this.initialized = true;
28283
26471
  }
26472
+ async runSeeds() {
26473
+ for (const element of this.context.elements) {
26474
+ if (!("getSeeds" in element))
26475
+ continue;
26476
+ const seedInfo = element.getSeeds();
26477
+ if (!seedInfo)
26478
+ continue;
26479
+ const { data, idFactory } = seedInfo;
26480
+ const tableName = element.name;
26481
+ const store = this.dataStorage.getStore(tableName);
26482
+ const existing = await store.find({});
26483
+ if (existing.length > 0)
26484
+ continue;
26485
+ const changes = data.map((row) => ({
26486
+ type: "set",
26487
+ data: {
26488
+ ...row,
26489
+ _id: row._id ?? idFactory.generate()
26490
+ }
26491
+ }));
26492
+ await store.applyChanges(changes);
26493
+ console.log(`[ARC:Seed] Seeded ${data.length} row(s) into ${tableName}`);
26494
+ }
26495
+ }
28284
26496
  async executeCommand(commandName, params, rawToken) {
28285
26497
  const scoped = new ScopedModel(this.model, "request");
28286
26498
  if (rawToken)
@@ -29555,16 +27767,69 @@ function serveFile(filePath, headers = {}) {
29555
27767
  headers: { "Content-Type": getMime(filePath), ...headers }
29556
27768
  });
29557
27769
  }
29558
- function staticFilesHandler(ws, devMode) {
27770
+ var MODULE_SIG_SECRET = process.env.ARC_MODULE_SECRET ?? crypto.randomUUID();
27771
+ var MODULE_SIG_TTL = 3600;
27772
+ function signModuleUrl(filename) {
27773
+ const exp = Math.floor(Date.now() / 1000) + MODULE_SIG_TTL;
27774
+ const hasher = new Bun.CryptoHasher("sha256");
27775
+ hasher.update(`${filename}:${exp}:${MODULE_SIG_SECRET}`);
27776
+ const sig = hasher.digest("hex").slice(0, 16);
27777
+ return `/modules/${filename}?sig=${sig}&exp=${exp}`;
27778
+ }
27779
+ function verifyModuleSignature(filename, sig, exp) {
27780
+ if (!sig || !exp)
27781
+ return false;
27782
+ if (Number(exp) < Date.now() / 1000)
27783
+ return false;
27784
+ const hasher = new Bun.CryptoHasher("sha256");
27785
+ hasher.update(`${filename}:${exp}:${MODULE_SIG_SECRET}`);
27786
+ return hasher.digest("hex").slice(0, 16) === sig;
27787
+ }
27788
+ async function filterManifestForToken(manifest, moduleAccessMap, tokenPayload) {
27789
+ const filtered = [];
27790
+ for (const mod of manifest.modules) {
27791
+ const access = moduleAccessMap.get(mod.name);
27792
+ if (!access) {
27793
+ filtered.push(mod);
27794
+ continue;
27795
+ }
27796
+ if (!tokenPayload)
27797
+ continue;
27798
+ let granted = false;
27799
+ for (const rule of access.rules) {
27800
+ if (tokenPayload.tokenType === rule.token.name) {
27801
+ granted = rule.check ? await rule.check(tokenPayload) : true;
27802
+ if (granted)
27803
+ break;
27804
+ }
27805
+ }
27806
+ if (granted) {
27807
+ filtered.push({ ...mod, url: signModuleUrl(mod.file) });
27808
+ }
27809
+ }
27810
+ return { modules: filtered, buildTime: manifest.buildTime };
27811
+ }
27812
+ function staticFilesHandler(ws, devMode, moduleAccessMap) {
29559
27813
  return (_req, url, ctx) => {
29560
27814
  const path4 = url.pathname;
29561
27815
  if (path4.startsWith("/shell/"))
29562
27816
  return serveFile(join8(ws.shellDir, path4.slice(7)), ctx.corsHeaders);
29563
- if (path4.startsWith("/modules/"))
29564
- return serveFile(join8(ws.modulesDir, path4.slice(9)), {
27817
+ if (path4.startsWith("/modules/")) {
27818
+ const fileWithParams = path4.slice(9);
27819
+ const filename = fileWithParams.split("?")[0];
27820
+ const moduleName = filename.replace(/\.js$/, "");
27821
+ if (moduleAccessMap.has(moduleName)) {
27822
+ const sig = url.searchParams.get("sig");
27823
+ const exp = url.searchParams.get("exp");
27824
+ if (!verifyModuleSignature(filename, sig, exp)) {
27825
+ return new Response("Forbidden", { status: 403, headers: ctx.corsHeaders });
27826
+ }
27827
+ }
27828
+ return serveFile(join8(ws.modulesDir, filename), {
29565
27829
  ...ctx.corsHeaders,
29566
27830
  "Cache-Control": devMode ? "no-cache" : "max-age=31536000,immutable"
29567
27831
  });
27832
+ }
29568
27833
  if (path4.startsWith("/locales/"))
29569
27834
  return serveFile(join8(ws.arcDir, path4.slice(1)), ctx.corsHeaders);
29570
27835
  if (path4 === "/styles.css")
@@ -29582,10 +27847,11 @@ function staticFilesHandler(ws, devMode) {
29582
27847
  return null;
29583
27848
  };
29584
27849
  }
29585
- function apiEndpointsHandler(ws, getManifest, cm) {
27850
+ function apiEndpointsHandler(ws, getManifest, cm, moduleAccessMap) {
29586
27851
  return (_req, url, ctx) => {
29587
- if (url.pathname === "/api/modules")
29588
- return Response.json(getManifest(), { headers: ctx.corsHeaders });
27852
+ if (url.pathname === "/api/modules") {
27853
+ return filterManifestForToken(getManifest(), moduleAccessMap, ctx.tokenPayload).then((filtered) => Response.json(filtered, { headers: ctx.corsHeaders }));
27854
+ }
29589
27855
  if (url.pathname === "/api/translations") {
29590
27856
  const config = readTranslationsConfig(ws.rootDir);
29591
27857
  return Response.json(config ?? { locales: [], sourceLocale: "" }, {
@@ -29636,6 +27902,7 @@ function spaFallbackHandler(shellHtml) {
29636
27902
  }
29637
27903
  async function startPlatformServer(opts) {
29638
27904
  const { ws, port, devMode, context } = opts;
27905
+ const moduleAccessMap = opts.moduleAccess ?? new Map;
29639
27906
  let manifest = opts.manifest;
29640
27907
  const getManifest = () => manifest;
29641
27908
  const shellHtml = generateShellHtml(ws.appName, ws.manifest);
@@ -29658,9 +27925,9 @@ async function startPlatformServer(opts) {
29658
27925
  corsHeaders: cors
29659
27926
  };
29660
27927
  const handlers = [
29661
- apiEndpointsHandler(ws, getManifest, null),
27928
+ apiEndpointsHandler(ws, getManifest, null, moduleAccessMap),
29662
27929
  ...devMode ? [devReloadHandler(sseClients)] : [],
29663
- staticFilesHandler(ws, !!devMode),
27930
+ staticFilesHandler(ws, !!devMode, moduleAccessMap),
29664
27931
  spaFallbackHandler(shellHtml)
29665
27932
  ];
29666
27933
  for (const handler of handlers) {
@@ -29705,9 +27972,9 @@ async function startPlatformServer(opts) {
29705
27972
  dbAdapterFactory: createBunSQLiteAdapterFactory2(dbPath),
29706
27973
  port,
29707
27974
  httpHandlers: [
29708
- apiEndpointsHandler(ws, getManifest, null),
27975
+ apiEndpointsHandler(ws, getManifest, null, moduleAccessMap),
29709
27976
  ...devMode ? [devReloadHandler(sseClients)] : [],
29710
- staticFilesHandler(ws, !!devMode),
27977
+ staticFilesHandler(ws, !!devMode, moduleAccessMap),
29711
27978
  spaFallbackHandler(shellHtml)
29712
27979
  ],
29713
27980
  onWsClose: (clientId) => cleanupClientSubs(clientId)
@@ -29741,7 +28008,7 @@ async function platformDev() {
29741
28008
  const port = 5005;
29742
28009
  let manifest = await buildAll(ws);
29743
28010
  log2("Loading server context...");
29744
- const context = await loadServerContext(ws.packages);
28011
+ const { context, moduleAccess } = await loadServerContext(ws.packages);
29745
28012
  if (context) {
29746
28013
  ok("Context loaded");
29747
28014
  } else {
@@ -29752,6 +28019,7 @@ async function platformDev() {
29752
28019
  port,
29753
28020
  manifest,
29754
28021
  context,
28022
+ moduleAccess,
29755
28023
  dbPath: join9(ws.rootDir, ".arc", "data", "dev.db"),
29756
28024
  devMode: true
29757
28025
  });
@@ -29831,7 +28099,7 @@ async function platformStart() {
29831
28099
  }
29832
28100
  const manifest = JSON.parse(readFileSync7(manifestPath, "utf-8"));
29833
28101
  log2("Loading server context...");
29834
- const context = await loadServerContext(ws.packages);
28102
+ const { context, moduleAccess } = await loadServerContext(ws.packages);
29835
28103
  if (context) {
29836
28104
  ok("Context loaded");
29837
28105
  } else {
@@ -29842,6 +28110,7 @@ async function platformStart() {
29842
28110
  port,
29843
28111
  manifest,
29844
28112
  context,
28113
+ moduleAccess,
29845
28114
  dbPath: join10(ws.rootDir, ".arc", "data", "prod.db"),
29846
28115
  devMode: false
29847
28116
  });