@donotdev/cli 0.1.45 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dependencies-matrix.json +191 -150
  2. package/dist/bin/commands/agent-setup.js +632 -524
  3. package/dist/bin/commands/build.js +1239 -935
  4. package/dist/bin/commands/bump.js +1285 -946
  5. package/dist/bin/commands/cacheout.js +543 -405
  6. package/dist/bin/commands/coach.js +546 -408
  7. package/dist/bin/commands/create-app.js +1198 -862
  8. package/dist/bin/commands/create-project.js +1238 -902
  9. package/dist/bin/commands/db.js +139128 -93775
  10. package/dist/bin/commands/deploy.js +2308 -1936
  11. package/dist/bin/commands/dev.js +912 -662
  12. package/dist/bin/commands/doctor.js +634 -526
  13. package/dist/bin/commands/emu.js +1093 -785
  14. package/dist/bin/commands/format.js +588 -450
  15. package/dist/bin/commands/get-demo.js +1043 -756
  16. package/dist/bin/commands/make-admin.js +20974 -38424
  17. package/dist/bin/commands/preview.js +913 -663
  18. package/dist/bin/commands/seed.js +139129 -93776
  19. package/dist/bin/commands/setup-cicd.js +1130 -817
  20. package/dist/bin/commands/setup.js +1299 -960
  21. package/dist/bin/commands/staging.js +2308 -1936
  22. package/dist/bin/commands/sync-secrets.js +996 -733
  23. package/dist/bin/commands/type-check.js +733 -598
  24. package/dist/bin/commands/wai.js +533 -395
  25. package/dist/bin/dndev.js +9 -8
  26. package/dist/index.js +2720 -2290
  27. package/package.json +3 -3
  28. package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
  29. package/templates/app-next/src/app/layout.tsx.example +19 -1
  30. package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
  31. package/templates/functions-firebase/src/billing/index.ts.example +0 -1
  32. package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
  33. package/templates/functions-firebase/src/index.ts.example +0 -1
  34. package/templates/functions-supabase/supabase/config.toml.example +4 -0
  35. package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
  36. package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
  37. package/templates/functions-vercel/.env.example +9 -0
  38. package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
  39. package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
  40. package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
  41. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
  42. package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
  43. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
  44. package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
  45. package/templates/root-consumer/.claude/settings.json.example +11 -1
  46. package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  47. package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
@@ -5,16 +5,25 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
8
+ get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
9
9
  }) : x)(function(x) {
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + x + '" is not supported');
12
12
  });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ var __esm = (fn, res, err) => function __init() {
14
+ if (err) throw err[0];
15
+ try {
16
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
+ } catch (e) {
18
+ throw err = [e], e;
19
+ }
15
20
  };
16
21
  var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
+ try {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ } catch (e) {
25
+ throw mod = 0, e;
26
+ }
18
27
  };
19
28
  var __copyProps = (to, from, except, desc) => {
20
29
  if (from && typeof from === "object" || typeof from === "function") {
@@ -33,31 +42,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
42
  mod
34
43
  ));
35
44
 
36
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
37
- var isAmbiguous, isFullWidth, isWide;
45
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
46
+ var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
38
47
  var init_utils = __esm({
39
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js"() {
48
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
40
49
  init_utils2();
41
- isAmbiguous = (x) => {
42
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
43
- };
50
+ getCodePointsLength = /* @__PURE__ */ (() => {
51
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
52
+ return (input) => {
53
+ let surrogatePairsNr = 0;
54
+ SURROGATE_PAIR_RE.lastIndex = 0;
55
+ while (SURROGATE_PAIR_RE.test(input)) {
56
+ surrogatePairsNr += 1;
57
+ }
58
+ return input.length - surrogatePairsNr;
59
+ };
60
+ })();
44
61
  isFullWidth = (x) => {
45
62
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
46
63
  };
47
- isWide = (x) => {
48
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9800 && x <= 9811 || x === 9855 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
64
+ isWideNotCJKTNotEmoji = (x) => {
65
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
49
66
  };
50
67
  }
51
68
  });
52
69
 
53
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
54
- var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
70
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
71
+ var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
55
72
  var init_dist = __esm({
56
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js"() {
73
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
57
74
  init_utils2();
58
75
  init_utils();
59
- ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
76
+ ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
60
77
  CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
78
+ CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
61
79
  TAB_RE = /\t{1,1000}/y;
62
80
  EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
63
81
  LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -67,14 +85,21 @@ var init_dist = __esm({
67
85
  const LIMIT = truncationOptions.limit ?? Infinity;
68
86
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
69
87
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
70
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
88
+ const ANSI_WIDTH = 0;
71
89
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
72
90
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
73
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
74
91
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
75
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
92
+ const FULL_WIDTH_WIDTH = 2;
76
93
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
77
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
94
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
95
+ const PARSE_BLOCKS = [
96
+ [LATIN_RE, REGULAR_WIDTH],
97
+ [ANSI_RE, ANSI_WIDTH],
98
+ [CONTROL_RE, CONTROL_WIDTH],
99
+ [TAB_RE, TAB_WIDTH],
100
+ [EMOJI_RE, EMOJI_WIDTH],
101
+ [CJKT_WIDE_RE, WIDE_WIDTH]
102
+ ];
78
103
  let indexPrev = 0;
79
104
  let index = 0;
80
105
  let length = input.length;
@@ -94,10 +119,8 @@ var init_dist = __esm({
94
119
  const codePoint = char.codePointAt(0) || 0;
95
120
  if (isFullWidth(codePoint)) {
96
121
  widthExtra = FULL_WIDTH_WIDTH;
97
- } else if (isWide(codePoint)) {
122
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
98
123
  widthExtra = WIDE_WIDTH;
99
- } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
100
- widthExtra = AMBIGUOUS_WIDTH;
101
124
  } else {
102
125
  widthExtra = REGULAR_WIDTH;
103
126
  }
@@ -113,88 +136,28 @@ var init_dist = __esm({
113
136
  }
114
137
  unmatchedStart = unmatchedEnd = 0;
115
138
  }
116
- if (index >= length)
117
- break;
118
- LATIN_RE.lastIndex = index;
119
- if (LATIN_RE.test(input)) {
120
- lengthExtra = LATIN_RE.lastIndex - index;
121
- widthExtra = lengthExtra * REGULAR_WIDTH;
122
- if (width + widthExtra > truncationLimit) {
123
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
124
- }
125
- if (width + widthExtra > LIMIT) {
126
- truncationEnabled = true;
127
- break;
128
- }
129
- width += widthExtra;
130
- unmatchedStart = indexPrev;
131
- unmatchedEnd = index;
132
- index = indexPrev = LATIN_RE.lastIndex;
133
- continue;
139
+ if (index >= length) {
140
+ break outer;
134
141
  }
135
- ANSI_RE.lastIndex = index;
136
- if (ANSI_RE.test(input)) {
137
- if (width + ANSI_WIDTH > truncationLimit) {
138
- truncationIndex = Math.min(truncationIndex, index);
139
- }
140
- if (width + ANSI_WIDTH > LIMIT) {
141
- truncationEnabled = true;
142
- break;
143
- }
144
- width += ANSI_WIDTH;
145
- unmatchedStart = indexPrev;
146
- unmatchedEnd = index;
147
- index = indexPrev = ANSI_RE.lastIndex;
148
- continue;
149
- }
150
- CONTROL_RE.lastIndex = index;
151
- if (CONTROL_RE.test(input)) {
152
- lengthExtra = CONTROL_RE.lastIndex - index;
153
- widthExtra = lengthExtra * CONTROL_WIDTH;
154
- if (width + widthExtra > truncationLimit) {
155
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
156
- }
157
- if (width + widthExtra > LIMIT) {
158
- truncationEnabled = true;
159
- break;
160
- }
161
- width += widthExtra;
162
- unmatchedStart = indexPrev;
163
- unmatchedEnd = index;
164
- index = indexPrev = CONTROL_RE.lastIndex;
165
- continue;
166
- }
167
- TAB_RE.lastIndex = index;
168
- if (TAB_RE.test(input)) {
169
- lengthExtra = TAB_RE.lastIndex - index;
170
- widthExtra = lengthExtra * TAB_WIDTH;
171
- if (width + widthExtra > truncationLimit) {
172
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
173
- }
174
- if (width + widthExtra > LIMIT) {
175
- truncationEnabled = true;
176
- break;
177
- }
178
- width += widthExtra;
179
- unmatchedStart = indexPrev;
180
- unmatchedEnd = index;
181
- index = indexPrev = TAB_RE.lastIndex;
182
- continue;
183
- }
184
- EMOJI_RE.lastIndex = index;
185
- if (EMOJI_RE.test(input)) {
186
- if (width + EMOJI_WIDTH > truncationLimit) {
187
- truncationIndex = Math.min(truncationIndex, index);
188
- }
189
- if (width + EMOJI_WIDTH > LIMIT) {
190
- truncationEnabled = true;
191
- break;
142
+ for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
143
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
144
+ BLOCK_RE.lastIndex = index;
145
+ if (BLOCK_RE.test(input)) {
146
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
147
+ widthExtra = lengthExtra * BLOCK_WIDTH;
148
+ if (width + widthExtra > truncationLimit) {
149
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
150
+ }
151
+ if (width + widthExtra > LIMIT) {
152
+ truncationEnabled = true;
153
+ break outer;
154
+ }
155
+ width += widthExtra;
156
+ unmatchedStart = indexPrev;
157
+ unmatchedEnd = index;
158
+ index = indexPrev = BLOCK_RE.lastIndex;
159
+ continue outer;
192
160
  }
193
- width += EMOJI_WIDTH;
194
- unmatchedStart = indexPrev;
195
- unmatchedEnd = index;
196
- index = indexPrev = EMOJI_RE.lastIndex;
197
- continue;
198
161
  }
199
162
  index += 1;
200
163
  }
@@ -209,10 +172,10 @@ var init_dist = __esm({
209
172
  }
210
173
  });
211
174
 
212
- // node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
175
+ // node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
213
176
  var NO_TRUNCATION2, fastStringWidth, dist_default2;
214
177
  var init_dist2 = __esm({
215
- "node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js"() {
178
+ "node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
216
179
  init_utils2();
217
180
  init_dist();
218
181
  NO_TRUNCATION2 = {
@@ -227,13 +190,13 @@ var init_dist2 = __esm({
227
190
  }
228
191
  });
229
192
 
230
- // node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
193
+ // node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
231
194
  function wrapAnsi(string, columns, options) {
232
195
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
233
196
  }
234
197
  var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
235
198
  var init_main = __esm({
236
- "node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js"() {
199
+ "node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
237
200
  init_utils2();
238
201
  init_dist2();
239
202
  ESC = "\x1B";
@@ -397,16 +360,19 @@ var init_main = __esm({
397
360
  }
398
361
  const preString = rows.join("\n");
399
362
  let inSurrogate = false;
400
- for (let i = 0; i < preString.length; i++) {
401
- const character = preString[i];
363
+ for (let i2 = 0; i2 < preString.length; i2++) {
364
+ const character = preString[i2];
402
365
  returnValue += character;
403
366
  if (!inSurrogate) {
404
367
  inSurrogate = character >= "\uD800" && character <= "\uDBFF";
368
+ if (inSurrogate) {
369
+ continue;
370
+ }
405
371
  } else {
406
- continue;
372
+ inSurrogate = false;
407
373
  }
408
374
  if (character === ESC || character === CSI) {
409
- GROUP_REGEX.lastIndex = i + 1;
375
+ GROUP_REGEX.lastIndex = i2 + 1;
410
376
  const groupsResult = GROUP_REGEX.exec(preString);
411
377
  const groups = groupsResult?.groups;
412
378
  if (groups?.code !== void 0) {
@@ -416,7 +382,7 @@ var init_main = __esm({
416
382
  escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
417
383
  }
418
384
  }
419
- if (preString[i + 1] === "\n") {
385
+ if (preString[i2 + 1] === "\n") {
420
386
  if (escapeUrl) {
421
387
  returnValue += wrapAnsiHyperlink("");
422
388
  }
@@ -447,7 +413,7 @@ var require_src = __commonJS({
447
413
  var ESC2 = "\x1B";
448
414
  var CSI2 = `${ESC2}[`;
449
415
  var beep = "\x07";
450
- var cursor = {
416
+ var cursor3 = {
451
417
  to(x, y2) {
452
418
  if (!y2) return `${CSI2}${x + 1}G`;
453
419
  return `${CSI2}${y2 + 1};${x + 1}H`;
@@ -476,7 +442,7 @@ var require_src = __commonJS({
476
442
  up: (count = 1) => `${CSI2}S`.repeat(count),
477
443
  down: (count = 1) => `${CSI2}T`.repeat(count)
478
444
  };
479
- var erase = {
445
+ var erase3 = {
480
446
  screen: `${CSI2}2J`,
481
447
  up: (count = 1) => `${CSI2}1J`.repeat(count),
482
448
  down: (count = 1) => `${CSI2}J`.repeat(count),
@@ -485,67 +451,137 @@ var require_src = __commonJS({
485
451
  lineStart: `${CSI2}1K`,
486
452
  lines(count) {
487
453
  let clear = "";
488
- for (let i = 0; i < count; i++)
489
- clear += this.line + (i < count - 1 ? cursor.up() : "");
454
+ for (let i2 = 0; i2 < count; i2++)
455
+ clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
490
456
  if (count)
491
- clear += cursor.left;
457
+ clear += cursor3.left;
492
458
  return clear;
493
459
  }
494
460
  };
495
- module.exports = { cursor, scroll, erase, beep };
461
+ module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
496
462
  }
497
463
  });
498
464
 
499
- // node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
500
- import { styleText as y } from "node:util";
501
- import { stdout as S, stdin as $ } from "node:process";
502
- import P from "node:readline";
503
- import { ReadStream as D } from "node:tty";
504
- function d(r, t2, e) {
505
- if (!e.some((o) => !o.disabled)) return r;
506
- const s = r + t2, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
507
- return e[n].disabled ? d(n, t2 < 0 ? -1 : 1, e) : n;
465
+ // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
466
+ import { styleText } from "node:util";
467
+ import { stdout, stdin } from "node:process";
468
+ import l__default from "node:readline";
469
+ import { ReadStream } from "node:tty";
470
+ function findCursor(s, o, l) {
471
+ if (!l.some((r2) => !r2.disabled))
472
+ return s;
473
+ const t2 = s + o, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
474
+ return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;
475
+ }
476
+ function isAccessible(n3) {
477
+ if (n3 !== void 0) return n3;
478
+ if (settings.accessible !== void 0) return settings.accessible;
479
+ const e = process.env.ACCESSIBLE;
480
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
508
481
  }
509
- function V(r, t2) {
510
- if (typeof r == "string") return u.aliases.get(r) === t2;
511
- for (const e of r) if (e !== void 0 && V(e, t2)) return true;
482
+ function isActionKey(n3, e) {
483
+ if (typeof n3 == "string")
484
+ return settings.aliases.get(n3) === e;
485
+ for (const s of n3)
486
+ if (s !== void 0 && isActionKey(s, e))
487
+ return true;
512
488
  return false;
513
489
  }
514
- function j(r, t2) {
515
- if (r === t2) return;
516
- const e = r.split(`
517
- `), s = t2.split(`
518
- `), i = Math.max(e.length, s.length), n = [];
519
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
520
- return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
490
+ function diffLines(i2, s) {
491
+ if (i2 === s) return;
492
+ const e = i2.split(`
493
+ `), t2 = s.split(`
494
+ `), r2 = Math.max(e.length, t2.length), f = [];
495
+ for (let n3 = 0; n3 < r2; n3++)
496
+ e[n3] !== t2[n3] && f.push(n3);
497
+ return {
498
+ lines: f,
499
+ numLinesBefore: e.length,
500
+ numLinesAfter: t2.length,
501
+ numLines: r2
502
+ };
521
503
  }
522
- function q(r) {
523
- return r === C;
504
+ function isCancel(e) {
505
+ return e === CANCEL_SYMBOL;
524
506
  }
525
- function w(r, t2) {
526
- const e = r;
527
- e.isTTY && e.setRawMode(t2);
507
+ function setRawMode(e, r2) {
508
+ const o = e;
509
+ o.isTTY && o.setRawMode(r2);
528
510
  }
529
- function R(r, t2, e, s = e) {
530
- const i = O(r ?? S);
531
- return wrapAnsi(t2, i - e.length, { hard: true, trim: false }).split(`
532
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
511
+ function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
512
+ const f = getColumns(e ?? stdout);
513
+ return wrapAnsi(r2, f - o.length, {
514
+ hard: true,
515
+ trim: false
516
+ }).split(`
517
+ `).map((c2, i2, m2) => {
518
+ const d = t2 ? t2(c2, i2) : c2;
519
+ return i2 === 0 ? `${n3}${d}` : i2 === m2.length - 1 ? `${s}${d}` : `${o}${d}`;
520
+ }).join(`
533
521
  `);
534
522
  }
535
- var import_sisteransi, E, G, u, Y, C, O, A, p, it, nt;
523
+ function runValidation(e, a2) {
524
+ if ("~standard" in e) {
525
+ const n3 = e["~standard"].validate(a2);
526
+ return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
527
+ }
528
+ return e(a2);
529
+ }
530
+ var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, a, n$1;
536
531
  var init_dist3 = __esm({
537
- "node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs"() {
532
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
538
533
  init_utils2();
539
534
  init_main();
540
535
  import_sisteransi = __toESM(require_src(), 1);
541
- E = ["up", "down", "left", "right", "space", "enter", "cancel"];
542
- G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
543
- u = { actions: new Set(E), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t2) => `There are only ${r} days in ${t2}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
544
- Y = globalThis.process.platform.startsWith("win");
545
- C = /* @__PURE__ */ Symbol("clack:cancel");
546
- O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
547
- A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
548
- p = class {
536
+ a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
537
+ t = [
538
+ "January",
539
+ "February",
540
+ "March",
541
+ "April",
542
+ "May",
543
+ "June",
544
+ "July",
545
+ "August",
546
+ "September",
547
+ "October",
548
+ "November",
549
+ "December"
550
+ ];
551
+ settings = {
552
+ actions: new Set(a$1),
553
+ aliases: /* @__PURE__ */ new Map([
554
+ // vim support
555
+ ["k", "up"],
556
+ ["j", "down"],
557
+ ["h", "left"],
558
+ ["l", "right"],
559
+ ["", "cancel"],
560
+ // opinionated defaults!
561
+ ["escape", "cancel"]
562
+ ]),
563
+ messages: {
564
+ cancel: "Canceled",
565
+ error: "Something went wrong"
566
+ },
567
+ withGuide: true,
568
+ accessible: void 0,
569
+ date: {
570
+ monthNames: [...t],
571
+ messages: {
572
+ required: "Please enter a valid date",
573
+ invalidMonth: "There are only 12 months in a year",
574
+ invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
575
+ afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
576
+ beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
577
+ }
578
+ }
579
+ };
580
+ R = globalThis.process.platform.startsWith("win");
581
+ CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
582
+ getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
583
+ getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
584
+ y = class {
549
585
  input;
550
586
  output;
551
587
  _abortSignal;
@@ -560,46 +596,92 @@ var init_dist3 = __esm({
560
596
  error = "";
561
597
  value;
562
598
  userInput = "";
599
+ /**
600
+ * Whether accessible (static, screen-reader friendly) output is enabled for
601
+ * this prompt, resolved from the `accessible` option, the global setting,
602
+ * and the `ACCESSIBLE` env var.
603
+ */
604
+ get accessible() {
605
+ return isAccessible(this.opts.accessible);
606
+ }
563
607
  constructor(t2, e = true) {
564
- const { input: s = $, output: i = S, render: n, signal: o, ...a } = t2;
565
- this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = o, this.input = s, this.output = i;
608
+ const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
609
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
566
610
  }
611
+ /**
612
+ * Unsubscribe all listeners
613
+ */
567
614
  unsubscribe() {
568
615
  this._subscribers.clear();
569
616
  }
617
+ /**
618
+ * Set a subscriber with opts
619
+ * @param event - The event name
620
+ */
570
621
  setSubscriber(t2, e) {
571
- const s = this._subscribers.get(t2) ?? [];
572
- s.push(e), this._subscribers.set(t2, s);
622
+ const i2 = this._subscribers.get(t2) ?? [];
623
+ i2.push(e), this._subscribers.set(t2, i2);
573
624
  }
625
+ /**
626
+ * Subscribe to an event
627
+ * @param event - The event name
628
+ * @param cb - The callback
629
+ */
574
630
  on(t2, e) {
575
631
  this.setSubscriber(t2, { cb: e });
576
632
  }
633
+ /**
634
+ * Subscribe to an event once
635
+ * @param event - The event name
636
+ * @param cb - The callback
637
+ */
577
638
  once(t2, e) {
578
639
  this.setSubscriber(t2, { cb: e, once: true });
579
640
  }
641
+ /**
642
+ * Emit an event with data
643
+ * @param event - The event name
644
+ * @param data - The data to pass to the callback
645
+ */
580
646
  emit(t2, ...e) {
581
- const s = this._subscribers.get(t2) ?? [], i = [];
582
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
583
- for (const n of i) n();
647
+ const i2 = this._subscribers.get(t2) ?? [], s = [];
648
+ for (const r2 of i2)
649
+ r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
650
+ for (const r2 of s)
651
+ r2();
584
652
  }
585
653
  prompt() {
586
654
  return new Promise((t2) => {
587
655
  if (this._abortSignal) {
588
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t2(C);
589
- this._abortSignal.addEventListener("abort", () => {
590
- this.state = "cancel", this.close();
591
- }, { once: true });
656
+ if (this._abortSignal.aborted)
657
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
658
+ this._abortSignal.addEventListener(
659
+ "abort",
660
+ () => {
661
+ this.state = "cancel", this.close();
662
+ },
663
+ { once: true }
664
+ );
592
665
  }
593
- this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
594
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(this.value);
666
+ this.rl = l__default.createInterface({
667
+ input: this.input,
668
+ tabSize: 2,
669
+ prompt: "",
670
+ escapeCodeTimeout: 50,
671
+ terminal: true
672
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
673
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
595
674
  }), this.once("cancel", () => {
596
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(C);
675
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
597
676
  });
598
677
  });
599
678
  }
600
679
  _isActionKey(t2, e) {
601
680
  return t2 === " ";
602
681
  }
682
+ _shouldSubmit(t2, e) {
683
+ return true;
684
+ }
603
685
  _setValue(t2) {
604
686
  this.value = t2, this.emit("value", this.value);
605
687
  }
@@ -609,19 +691,22 @@ var init_dist3 = __esm({
609
691
  _clearUserInput() {
610
692
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
611
693
  }
612
- onKeypress(t2, e) {
613
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2?.toLowerCase(), e), e?.name === "return") {
614
- if (this.opts.validate) {
615
- const s = this.opts.validate(this.value);
616
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
694
+ async onKeypress(t2, e) {
695
+ if (this.state !== "validating") {
696
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
697
+ if (this.opts.validate) {
698
+ const i2 = runValidation(this.opts.validate, this.value);
699
+ let s;
700
+ i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
701
+ }
702
+ this.state !== "error" && (this.state = "submit");
617
703
  }
618
- this.state !== "error" && (this.state = "submit");
704
+ isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
619
705
  }
620
- V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
621
706
  }
622
707
  close() {
623
708
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
624
- `), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
709
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
625
710
  }
626
711
  restoreCursor() {
627
712
  const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
@@ -629,34 +714,39 @@ var init_dist3 = __esm({
629
714
  this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
630
715
  }
631
716
  render() {
632
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
717
+ const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
718
+ hard: true,
719
+ trim: false
720
+ });
633
721
  if (t2 !== this._prevFrame) {
634
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
722
+ if (this.state === "initial")
723
+ this.output.write(import_sisteransi.cursor.hide);
635
724
  else {
636
- const e = j(this._prevFrame, t2), s = A(this.output);
725
+ const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
637
726
  if (this.restoreCursor(), e) {
638
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
639
- let o = e.lines.find((a) => a >= i);
640
- if (o === void 0) {
727
+ const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
728
+ let n3 = e.lines.find((o) => o >= s);
729
+ if (n3 === void 0) {
641
730
  this._prevFrame = t2;
642
731
  return;
643
732
  }
644
733
  if (e.lines.length === 1) {
645
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
646
- const a = t2.split(`
734
+ this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
735
+ const o = t2.split(`
647
736
  `);
648
- this.output.write(a[o]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
737
+ this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
649
738
  return;
650
739
  } else if (e.lines.length > 1) {
651
- if (i < n) o = i;
740
+ if (s < r2)
741
+ n3 = s;
652
742
  else {
653
- const h = o - n;
654
- h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
743
+ const h2 = n3 - r2;
744
+ h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
655
745
  }
656
746
  this.output.write(import_sisteransi.erase.down());
657
- const a = t2.split(`
658
- `).slice(o);
659
- this.output.write(a.join(`
747
+ const f = t2.split(`
748
+ `).slice(n3);
749
+ this.output.write(f.join(`
660
750
  `)), this._prevFrame = t2;
661
751
  return;
662
752
  }
@@ -667,44 +757,48 @@ var init_dist3 = __esm({
667
757
  }
668
758
  }
669
759
  };
670
- it = class extends p {
760
+ a = class extends y {
671
761
  options;
672
762
  cursor = 0;
673
763
  get _value() {
674
- return this.options[this.cursor].value;
764
+ return this.options[this.cursor]?.value;
675
765
  }
676
766
  get _enabledOptions() {
677
- return this.options.filter((t2) => t2.disabled !== true);
767
+ return this.options.filter((e) => e.disabled !== true);
678
768
  }
679
769
  toggleAll() {
680
- const t2 = this._enabledOptions, e = this.value !== void 0 && this.value.length === t2.length;
681
- this.value = e ? [] : t2.map((s) => s.value);
770
+ const e = this._enabledOptions, i2 = this.value !== void 0 && this.value.length === e.length;
771
+ this.value = i2 ? [] : e.map((t2) => t2.value);
682
772
  }
683
773
  toggleInvert() {
684
- const t2 = this.value;
685
- if (!t2) return;
686
- const e = this._enabledOptions.filter((s) => !t2.includes(s.value));
687
- this.value = e.map((s) => s.value);
774
+ const e = this.value;
775
+ if (!e)
776
+ return;
777
+ const i2 = this._enabledOptions.filter((t2) => !e.includes(t2.value));
778
+ this.value = i2.map((t2) => t2.value);
688
779
  }
689
780
  toggleValue() {
690
781
  this.value === void 0 && (this.value = []);
691
- const t2 = this.value.includes(this._value);
692
- this.value = t2 ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
693
- }
694
- constructor(t2) {
695
- super(t2, false), this.options = t2.options, this.value = [...t2.initialValues ?? []];
696
- const e = Math.max(this.options.findIndex(({ value: s }) => s === t2.cursorAt), 0);
697
- this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.on("key", (s) => {
698
- s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
699
- }), this.on("cursor", (s) => {
700
- switch (s) {
782
+ const e = this.value.includes(this._value);
783
+ this.value = e ? this.value.filter((i2) => i2 !== this._value) : [...this.value, this._value];
784
+ }
785
+ constructor(e) {
786
+ super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
787
+ const i2 = Math.max(
788
+ this.options.findIndex(({ value: t2 }) => t2 === e.cursorAt),
789
+ 0
790
+ );
791
+ this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2, l) => {
792
+ l.name === "a" && this.toggleAll(), l.name === "i" && this.toggleInvert();
793
+ }), this.on("cursor", (t2) => {
794
+ switch (t2) {
701
795
  case "left":
702
796
  case "up":
703
- this.cursor = d(this.cursor, -1, this.options);
797
+ this.cursor = findCursor(this.cursor, -1, this.options);
704
798
  break;
705
799
  case "down":
706
800
  case "right":
707
- this.cursor = d(this.cursor, 1, this.options);
801
+ this.cursor = findCursor(this.cursor, 1, this.options);
708
802
  break;
709
803
  case "space":
710
804
  this.toggleValue();
@@ -713,27 +807,28 @@ var init_dist3 = __esm({
713
807
  });
714
808
  }
715
809
  };
716
- nt = class extends p {
810
+ n$1 = class n extends y {
717
811
  options;
718
812
  cursor = 0;
719
813
  get _selectedValue() {
720
814
  return this.options[this.cursor];
721
815
  }
722
816
  changeValue() {
723
- this.value = this._selectedValue.value;
817
+ const e = this._selectedValue;
818
+ this.value = e === void 0 ? void 0 : e.value;
724
819
  }
725
- constructor(t2) {
726
- super(t2, false), this.options = t2.options;
727
- const e = this.options.findIndex(({ value: i }) => i === t2.initialValue), s = e === -1 ? 0 : e;
728
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
729
- switch (i) {
820
+ constructor(e) {
821
+ super(e, false), this.options = e.options;
822
+ const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
823
+ this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
824
+ switch (s) {
730
825
  case "left":
731
826
  case "up":
732
- this.cursor = d(this.cursor, -1, this.options);
827
+ this.cursor = findCursor(this.cursor, -1, this.options);
733
828
  break;
734
829
  case "down":
735
830
  case "right":
736
- this.cursor = d(this.cursor, 1, this.options);
831
+ this.cursor = findCursor(this.cursor, 1, this.options);
737
832
  break;
738
833
  }
739
834
  this.changeValue();
@@ -743,240 +838,398 @@ var init_dist3 = __esm({
743
838
  }
744
839
  });
745
840
 
746
- // node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
747
- import { styleText as t, stripVTControlCharacters as ne } from "node:util";
748
- import P2 from "node:process";
749
- import { existsSync as Xe, lstatSync as we, readdirSync as ze } from "node:fs";
750
- import { dirname as be, join as Qe } from "node:path";
751
- function Ze() {
752
- return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
841
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
842
+ import { styleText as styleText2, stripVTControlCharacters } from "node:util";
843
+ import process$1 from "node:process";
844
+ import { existsSync, lstatSync, readdirSync } from "node:fs";
845
+ import { dirname, join } from "node:path";
846
+ function isUnicodeSupported() {
847
+ if (process$1.platform !== "win32") {
848
+ return process$1.env.TERM !== "linux";
849
+ }
850
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
851
+ }
852
+ function formatInstructionFooter(o, e) {
853
+ const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
854
+ return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
753
855
  }
754
- var import_sisteransi2, ee, w2, _e, oe, ue, F, le, d2, E2, Ie, Ee, z2, H2, te, U, J, xe, se, ce, Ge, $e, de, Oe, he, pe, me, ge, V2, ye, et2, Y2, O2, pt, Q2, yt, Ve, re, _t, je;
856
+ var import_sisteransi2, unicode, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, m, multiselect, log, cancel, u2, SELECT_INSTRUCTIONS, c, select, i;
755
857
  var init_dist4 = __esm({
756
- "node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs"() {
858
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
757
859
  init_utils2();
758
860
  init_dist3();
759
861
  init_dist3();
760
862
  init_main();
761
863
  init_dist2();
762
864
  import_sisteransi2 = __toESM(require_src(), 1);
763
- ee = Ze();
764
- w2 = (e, i) => ee ? e : i;
765
- _e = w2("\u25C6", "*");
766
- oe = w2("\u25A0", "x");
767
- ue = w2("\u25B2", "x");
768
- F = w2("\u25C7", "o");
769
- le = w2("\u250C", "T");
770
- d2 = w2("\u2502", "|");
771
- E2 = w2("\u2514", "\u2014");
772
- Ie = w2("\u2510", "T");
773
- Ee = w2("\u2518", "\u2014");
774
- z2 = w2("\u25CF", ">");
775
- H2 = w2("\u25CB", " ");
776
- te = w2("\u25FB", "[\u2022]");
777
- U = w2("\u25FC", "[+]");
778
- J = w2("\u25FB", "[ ]");
779
- xe = w2("\u25AA", "\u2022");
780
- se = w2("\u2500", "-");
781
- ce = w2("\u256E", "+");
782
- Ge = w2("\u251C", "+");
783
- $e = w2("\u256F", "+");
784
- de = w2("\u2570", "+");
785
- Oe = w2("\u256D", "+");
786
- he = w2("\u25CF", "\u2022");
787
- pe = w2("\u25C6", "*");
788
- me = w2("\u25B2", "!");
789
- ge = w2("\u25A0", "x");
790
- V2 = (e) => {
791
- switch (e) {
865
+ unicode = isUnicodeSupported();
866
+ unicodeOr = (o, e) => unicode ? o : e;
867
+ S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
868
+ S_STEP_CANCEL = unicodeOr("\u25A0", "x");
869
+ S_STEP_ERROR = unicodeOr("\u25B2", "x");
870
+ S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
871
+ S_BAR_START = unicodeOr("\u250C", "T");
872
+ S_BAR = unicodeOr("\u2502", "|");
873
+ S_BAR_END = unicodeOr("\u2514", "\u2014");
874
+ S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
875
+ S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
876
+ S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
877
+ S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
878
+ S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
879
+ S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
880
+ S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
881
+ S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
882
+ S_BAR_H = unicodeOr("\u2500", "-");
883
+ S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
884
+ S_CONNECT_LEFT = unicodeOr("\u251C", "+");
885
+ S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
886
+ S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
887
+ S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
888
+ S_INFO = unicodeOr("\u25CF", "\u2022");
889
+ S_SUCCESS = unicodeOr("\u25C6", "*");
890
+ S_WARN = unicodeOr("\u25B2", "!");
891
+ S_ERROR = unicodeOr("\u25A0", "x");
892
+ symbol = (o) => {
893
+ switch (o) {
792
894
  case "initial":
793
895
  case "active":
794
- return t("cyan", _e);
896
+ return styleText2("cyan", S_STEP_ACTIVE);
795
897
  case "cancel":
796
- return t("red", oe);
898
+ return styleText2("red", S_STEP_CANCEL);
797
899
  case "error":
798
- return t("yellow", ue);
900
+ return styleText2("yellow", S_STEP_ERROR);
799
901
  case "submit":
800
- return t("green", F);
902
+ return styleText2("green", S_STEP_SUBMIT);
903
+ case "validating":
904
+ return styleText2("dim", S_STEP_ACTIVE);
801
905
  }
802
906
  };
803
- ye = (e) => {
804
- switch (e) {
907
+ symbolBar = (o) => {
908
+ switch (o) {
805
909
  case "initial":
806
910
  case "active":
807
- return t("cyan", d2);
911
+ return styleText2("cyan", S_BAR);
808
912
  case "cancel":
809
- return t("red", d2);
913
+ return styleText2("red", S_BAR);
810
914
  case "error":
811
- return t("yellow", d2);
915
+ return styleText2("yellow", S_BAR);
812
916
  case "submit":
813
- return t("green", d2);
814
- }
815
- };
816
- et2 = (e, i, s, r, u2) => {
817
- let n = i, o = 0;
818
- for (let c2 = s; c2 < r; c2++) {
819
- const a = e[c2];
820
- if (n = n - a.length, o++, n <= u2) break;
821
- }
822
- return { lineCount: n, removals: o };
823
- };
824
- Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
825
- const c2 = O(r) - n, a = A(r), l = t("dim", "..."), $2 = Math.max(a - o, 0), y2 = Math.max(Math.min(u2, $2), 5);
826
- let p2 = 0;
827
- e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
828
- let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
829
- const S2 = Math.min(p2 + y2, i.length), h = [];
917
+ return styleText2("green", S_BAR);
918
+ }
919
+ };
920
+ I = (l, e, w, p, b, C = false) => {
921
+ let r2 = e, O = 0;
922
+ if (C)
923
+ for (let i2 = p - 1; i2 >= w; i2--) {
924
+ const m2 = l[i2];
925
+ if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
926
+ }
927
+ else
928
+ for (let i2 = w; i2 < p; i2++) {
929
+ const m2 = l[i2];
930
+ if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
931
+ }
932
+ return { lineCount: r2, removals: O };
933
+ };
934
+ limitOptions = ({
935
+ cursor: l,
936
+ options: e,
937
+ style: w,
938
+ output: p = process.stdout,
939
+ maxItems: b = Number.POSITIVE_INFINITY,
940
+ columnPadding: C = 0,
941
+ rowPadding: r2 = 4
942
+ }) => {
943
+ const i2 = getColumns(p) - C, m2 = getRows(p), M = styleText2("dim", "..."), v = Math.max(m2 - r2, 0), a2 = Math.max(Math.min(b, v), 5);
830
944
  let f = 0;
831
- m && f++, g && f++;
832
- const v = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
833
- for (let b = v; b < T; b++) {
834
- const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
945
+ l >= a2 - 3 && (f = Math.max(
946
+ Math.min(l - a2 + 3, e.length - a2),
947
+ 0
948
+ ));
949
+ let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
950
+ const W = Math.min(
951
+ f + a2,
952
+ e.length
953
+ ), s = [];
954
+ let g = 0;
955
+ d && g++, c2 && g++;
956
+ const T = f + (d ? 1 : 0), y2 = W - (c2 ? 1 : 0);
957
+ for (let t2 = T; t2 < y2; t2++) {
958
+ const n3 = e[t2], o = n3 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
959
+ hard: true,
960
+ trim: false
961
+ }).split(`
835
962
  `);
836
- h.push(x), f += x.length;
837
- }
838
- if (f > $2) {
839
- let b = 0, x = 0, G2 = f;
840
- const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
841
- m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $2 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $2 && ({ lineCount: G2, removals: b } = R2(0, M2))), b > 0 && (m = true, h.splice(0, b)), x > 0 && (g = true, h.splice(h.length - x, x));
842
- }
843
- const C2 = [];
844
- m && C2.push(l);
845
- for (const b of h) for (const x of b) C2.push(x);
846
- return g && C2.push(l), C2;
847
- };
848
- O2 = { message: (e = [], { symbol: i = t("gray", d2), secondarySymbol: s = t("gray", d2), output: r = process.stdout, spacing: u2 = 1, withGuide: n } = {}) => {
849
- const o = [], c2 = n ?? u.withGuide, a = c2 ? s : "", l = c2 ? `${i} ` : "", $2 = c2 ? `${s} ` : "";
850
- for (let p2 = 0; p2 < u2; p2++) o.push(a);
851
- const y2 = Array.isArray(e) ? e : e.split(`
852
- `);
853
- if (y2.length > 0) {
854
- const [p2, ...m] = y2;
855
- p2.length > 0 ? o.push(`${l}${p2}`) : o.push(c2 ? i : "");
856
- for (const g of m) g.length > 0 ? o.push(`${$2}${g}`) : o.push(c2 ? s : "");
857
- }
858
- r.write(`${o.join(`
859
- `)}
860
- `);
861
- }, info: (e, i) => {
862
- O2.message(e, { ...i, symbol: t("blue", he) });
863
- }, success: (e, i) => {
864
- O2.message(e, { ...i, symbol: t("green", pe) });
865
- }, step: (e, i) => {
866
- O2.message(e, { ...i, symbol: t("green", F) });
867
- }, warn: (e, i) => {
868
- O2.message(e, { ...i, symbol: t("yellow", me) });
869
- }, warning: (e, i) => {
870
- O2.warn(e, i);
871
- }, error: (e, i) => {
872
- O2.message(e, { ...i, symbol: t("red", ge) });
873
- } };
874
- pt = (e = "", i) => {
875
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
876
- s.write(`${r}${t("red", e)}
877
-
878
- `);
879
- };
880
- Q2 = (e, i) => e.split(`
881
- `).map((s) => i(s)).join(`
963
+ s.push(h2), g += h2.length;
964
+ }
965
+ if (g > v) {
966
+ let t2 = 0, n3 = 0, o = g;
967
+ const h2 = l - T;
968
+ let u3 = v;
969
+ const L = () => I(s, o, 0, h2, u3), E = () => I(
970
+ s,
971
+ o,
972
+ h2 + 1,
973
+ s.length,
974
+ u3,
975
+ true
976
+ );
977
+ d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
978
+ }
979
+ const x = [];
980
+ d && x.push(M);
981
+ for (const t2 of s)
982
+ for (const n3 of t2)
983
+ x.push(n3);
984
+ return c2 && x.push(M), x;
985
+ };
986
+ MULTISELECT_INSTRUCTIONS = [
987
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
988
+ `${styleText2("dim", "Space:")} select`,
989
+ `${styleText2("dim", "Enter:")} confirm`
990
+ ];
991
+ m = (i2, u3) => i2.split(`
992
+ `).map((d) => u3(d)).join(`
882
993
  `);
883
- yt = (e) => {
884
- const i = (r, u2) => {
885
- const n = r.label ?? String(r.value);
886
- return u2 === "disabled" ? `${t("gray", J)} ${Q2(n, (o) => t(["strikethrough", "gray"], o))}${r.hint ? ` ${t("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u2 === "active" ? `${t("cyan", te)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "selected" ? `${t("green", U)} ${Q2(n, (o) => t("dim", o))}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "cancelled" ? `${Q2(n, (o) => t(["strikethrough", "dim"], o))}` : u2 === "active-selected" ? `${t("green", U)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "submitted" ? `${Q2(n, (o) => t("dim", o))}` : `${t("dim", J)} ${Q2(n, (o) => t("dim", o))}`;
887
- }, s = e.required ?? true;
888
- return new it({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(r) {
889
- if (s && (r === void 0 || r.length === 0)) return `Please select at least one option.
890
- ${t("reset", t("dim", `Press ${t(["gray", "bgWhite", "inverse"], " space ")} to select, ${t("gray", t("bgWhite", t("inverse", " enter ")))} to submit`))}`;
891
- }, render() {
892
- const r = e.withGuide ?? u.withGuide, u2 = R(e.output, e.message, r ? `${ye(this.state)} ` : "", `${V2(this.state)} `), n = `${r ? `${t("gray", d2)}
893
- ` : ""}${u2}
894
- `, o = this.value ?? [], c2 = (a, l) => {
895
- if (a.disabled) return i(a, "disabled");
896
- const $2 = o.includes(a.value);
897
- return l && $2 ? i(a, "active-selected") : $2 ? i(a, "selected") : i(a, l ? "active" : "inactive");
898
- };
899
- switch (this.state) {
900
- case "submit": {
901
- const a = this.options.filter(({ value: $2 }) => o.includes($2)).map(($2) => i($2, "submitted")).join(t("dim", ", ")) || t("dim", "none"), l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
902
- return `${n}${l}`;
903
- }
904
- case "cancel": {
905
- const a = this.options.filter(({ value: $2 }) => o.includes($2)).map(($2) => i($2, "cancelled")).join(t("dim", ", "));
906
- if (a.trim() === "") return `${n}${t("gray", d2)}`;
907
- const l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
908
- return `${n}${l}${r ? `
909
- ${t("gray", d2)}` : ""}`;
910
- }
911
- case "error": {
912
- const a = r ? `${t("yellow", d2)} ` : "", l = this.error.split(`
913
- `).map((p2, m) => m === 0 ? `${r ? `${t("yellow", E2)} ` : ""}${t("yellow", p2)}` : ` ${p2}`).join(`
914
- `), $2 = n.split(`
915
- `).length, y2 = l.split(`
994
+ multiselect = (i2) => {
995
+ const u3 = (t2, a2) => {
996
+ const r2 = t2.label ?? String(t2.value);
997
+ return a2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2(["strikethrough", "gray"], o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : a2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m(r2, (o) => styleText2("dim", o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "cancelled" ? `${m(r2, (o) => styleText2(["strikethrough", "dim"], o))}` : a2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "submitted" ? `${m(r2, (o) => styleText2("dim", o))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2("dim", o))}`;
998
+ }, d = i2.required ?? true, x = i2.showInstructions ?? true;
999
+ return new a({
1000
+ options: i2.options,
1001
+ signal: i2.signal,
1002
+ input: i2.input,
1003
+ output: i2.output,
1004
+ initialValues: i2.initialValues,
1005
+ required: d,
1006
+ cursorAt: i2.cursorAt,
1007
+ validate(t2) {
1008
+ if (d && (t2 === void 0 || t2.length === 0))
1009
+ return `Please select at least one option.
1010
+ ${styleText2(
1011
+ "reset",
1012
+ styleText2(
1013
+ "dim",
1014
+ `Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2(
1015
+ "gray",
1016
+ styleText2("bgWhite", styleText2("inverse", " enter "))
1017
+ )} to submit`
1018
+ )
1019
+ )}`;
1020
+ },
1021
+ render() {
1022
+ const t2 = i2.withGuide ?? settings.withGuide, a2 = wrapTextWithPrefix(
1023
+ i2.output,
1024
+ i2.message,
1025
+ t2 ? `${symbolBar(this.state)} ` : "",
1026
+ `${symbol(this.state)} `
1027
+ ), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
1028
+ ` : ""}${a2}
1029
+ `, o = this.value ?? [], g = (n3, l) => {
1030
+ if (n3.disabled)
1031
+ return u3(n3, "disabled");
1032
+ const s = o.includes(n3.value);
1033
+ return l && s ? u3(n3, "active-selected") : s ? u3(n3, "selected") : u3(n3, l ? "active" : "inactive");
1034
+ };
1035
+ switch (this.state) {
1036
+ case "submit": {
1037
+ const n3 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l = wrapTextWithPrefix(
1038
+ i2.output,
1039
+ n3,
1040
+ t2 ? `${styleText2("gray", S_BAR)} ` : ""
1041
+ );
1042
+ return `${r2}${l}`;
1043
+ }
1044
+ case "cancel": {
1045
+ const n3 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "cancelled")).join(styleText2("dim", ", "));
1046
+ if (n3.trim() === "")
1047
+ return `${r2}${styleText2("gray", S_BAR)}`;
1048
+ const l = wrapTextWithPrefix(
1049
+ i2.output,
1050
+ n3,
1051
+ t2 ? `${styleText2("gray", S_BAR)} ` : ""
1052
+ );
1053
+ return `${r2}${l}${t2 ? `
1054
+ ${styleText2("gray", S_BAR)}` : ""}`;
1055
+ }
1056
+ case "error": {
1057
+ const n3 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l = this.error.split(`
1058
+ `).map(
1059
+ ($, v) => v === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
1060
+ ).join(`
1061
+ `), s = r2.split(`
1062
+ `).length, h2 = l.split(`
916
1063
  `).length + 1;
917
- return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: $2 + y2, style: c2 }).join(`
918
- ${a}`)}
1064
+ return `${r2}${n3}${limitOptions({
1065
+ output: i2.output,
1066
+ options: this.options,
1067
+ cursor: this.cursor,
1068
+ maxItems: i2.maxItems,
1069
+ columnPadding: n3.length,
1070
+ rowPadding: s + h2,
1071
+ style: g
1072
+ }).join(`
1073
+ ${n3}`)}
919
1074
  ${l}
920
1075
  `;
921
- }
922
- default: {
923
- const a = r ? `${t("cyan", d2)} ` : "", l = n.split(`
924
- `).length, $2 = r ? 2 : 1;
925
- return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: l + $2, style: c2 }).join(`
926
- ${a}`)}
927
- ${r ? t("cyan", E2) : ""}
1076
+ }
1077
+ default: {
1078
+ const n3 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l = r2.split(`
1079
+ `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
1080
+ `), $ = s.length + 1;
1081
+ return `${r2}${n3}${limitOptions({
1082
+ output: i2.output,
1083
+ options: this.options,
1084
+ cursor: this.cursor,
1085
+ maxItems: i2.maxItems,
1086
+ columnPadding: n3.length,
1087
+ rowPadding: l + $,
1088
+ style: g
1089
+ }).join(`
1090
+ ${n3}`)}
1091
+ ${h2}
928
1092
  `;
1093
+ }
929
1094
  }
930
1095
  }
931
- } }).prompt();
1096
+ }).prompt();
932
1097
  };
933
- Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
934
- re = (e, i) => e.includes(`
935
- `) ? e.split(`
936
- `).map((s) => i(s)).join(`
937
- `) : i(e);
938
- _t = (e) => {
939
- const i = (s, r) => {
940
- const u2 = s.label ?? String(s.value);
941
- switch (r) {
1098
+ log = {
1099
+ message: (s = [], {
1100
+ symbol: e = styleText2("gray", S_BAR),
1101
+ secondarySymbol: r2 = styleText2("gray", S_BAR),
1102
+ output: m2 = process.stdout,
1103
+ spacing: l = 1,
1104
+ withGuide: c2
1105
+ } = {}) => {
1106
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
1107
+ for (let i2 = 0; i2 < l; i2++)
1108
+ t2.push(f);
1109
+ const g = Array.isArray(s) ? s : s.split(`
1110
+ `);
1111
+ if (g.length > 0) {
1112
+ const [i2, ...y2] = g;
1113
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
1114
+ for (const p of y2)
1115
+ p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
1116
+ }
1117
+ m2.write(`${t2.join(`
1118
+ `)}
1119
+ `);
1120
+ },
1121
+ info: (s, e) => {
1122
+ log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
1123
+ },
1124
+ success: (s, e) => {
1125
+ log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
1126
+ },
1127
+ step: (s, e) => {
1128
+ log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
1129
+ },
1130
+ warn: (s, e) => {
1131
+ log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
1132
+ },
1133
+ /** alias for `log.warn()`. */
1134
+ warning: (s, e) => {
1135
+ log.warn(s, e);
1136
+ },
1137
+ error: (s, e) => {
1138
+ log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
1139
+ }
1140
+ };
1141
+ cancel = (o = "", t2) => {
1142
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
1143
+ i2.write(`${e}${styleText2("red", o)}
1144
+
1145
+ `);
1146
+ };
1147
+ u2 = {
1148
+ light: unicodeOr("\u2500", "-"),
1149
+ heavy: unicodeOr("\u2501", "="),
1150
+ block: unicodeOr("\u2588", "#")
1151
+ };
1152
+ SELECT_INSTRUCTIONS = [
1153
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1154
+ `${styleText2("dim", "Enter:")} confirm`
1155
+ ];
1156
+ c = (t2, o) => t2.includes(`
1157
+ `) ? t2.split(`
1158
+ `).map((d) => o(d)).join(`
1159
+ `) : o(t2);
1160
+ select = (t2) => {
1161
+ const o = (n3, m2) => {
1162
+ if (n3 === void 0)
1163
+ return "";
1164
+ const s = n3.label ?? String(n3.value);
1165
+ switch (m2) {
942
1166
  case "disabled":
943
- return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1167
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
944
1168
  case "selected":
945
- return `${re(u2, (n) => t("dim", n))}`;
1169
+ return `${c(s, (i2) => styleText2("dim", i2))}`;
946
1170
  case "active":
947
- return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1171
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
948
1172
  case "cancelled":
949
- return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
1173
+ return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
950
1174
  default:
951
- return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
952
- }
953
- };
954
- return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
955
- const s = e.withGuide ?? u.withGuide, r = `${V2(this.state)} `, u2 = `${ye(this.state)} `, n = R(e.output, e.message, u2, r), o = `${s ? `${t("gray", d2)}
956
- ` : ""}${n}
1175
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
1176
+ }
1177
+ }, d = t2.showInstructions ?? true;
1178
+ return new n$1({
1179
+ options: t2.options,
1180
+ signal: t2.signal,
1181
+ input: t2.input,
1182
+ output: t2.output,
1183
+ initialValue: t2.initialValue,
1184
+ render() {
1185
+ const n3 = t2.withGuide ?? settings.withGuide, m2 = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
1186
+ t2.output,
1187
+ t2.message,
1188
+ s,
1189
+ m2
1190
+ ), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
1191
+ ` : ""}${i2}
957
1192
  `;
958
- switch (this.state) {
959
- case "submit": {
960
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
961
- return `${o}${a}`;
962
- }
963
- case "cancel": {
964
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
965
- return `${o}${a}${s ? `
966
- ${t("gray", d2)}` : ""}`;
967
- }
968
- default: {
969
- const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
970
- `).length, $2 = s ? 2 : 1;
971
- return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $2, style: (y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
972
- ${c2}`)}
973
- ${a}
1193
+ switch (this.state) {
1194
+ case "submit": {
1195
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1196
+ t2.output,
1197
+ o(this.options[this.cursor], "selected"),
1198
+ r2
1199
+ );
1200
+ return `${u3}${a2}`;
1201
+ }
1202
+ case "cancel": {
1203
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1204
+ t2.output,
1205
+ o(this.options[this.cursor], "cancelled"),
1206
+ r2
1207
+ );
1208
+ return `${u3}${a2}${n3 ? `
1209
+ ${styleText2("gray", S_BAR)}` : ""}`;
1210
+ }
1211
+ default: {
1212
+ const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1213
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1214
+ `), b = p.length + 1;
1215
+ return `${u3}${r2}${limitOptions({
1216
+ output: t2.output,
1217
+ cursor: this.cursor,
1218
+ options: this.options,
1219
+ maxItems: t2.maxItems,
1220
+ columnPadding: r2.length,
1221
+ rowPadding: a2 + b,
1222
+ style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1223
+ }).join(`
1224
+ ${r2}`)}
1225
+ ${f}
974
1226
  `;
1227
+ }
975
1228
  }
976
1229
  }
977
- } }).prompt();
1230
+ }).prompt();
978
1231
  };
979
- je = `${t("gray", d2)} `;
1232
+ i = `${styleText2("gray", S_BAR)} `;
980
1233
  }
981
1234
  });
982
1235
 
@@ -989,9 +1242,9 @@ function supportsColor() {
989
1242
  }
990
1243
  return process.stdout.isTTY === true;
991
1244
  }
992
- function colorize(text, color) {
993
- if (!supportsColor()) return text;
994
- return `${color}${text}${colors.reset}`;
1245
+ function colorize(text2, color) {
1246
+ if (!supportsColor()) return text2;
1247
+ return `${color}${text2}${colors.reset}`;
995
1248
  }
996
1249
  function stringify(value) {
997
1250
  if (typeof value === "string") return value;
@@ -1021,7 +1274,7 @@ function stringify(value) {
1021
1274
  function formatMessage(...args) {
1022
1275
  return args.map(stringify).join(" ");
1023
1276
  }
1024
- var colors, currentLogLevel, log, error, warn, info, success;
1277
+ var colors, currentLogLevel, log2, error, warn, info, success;
1025
1278
  var init_cli_output = __esm({
1026
1279
  "packages/tooling/src/utils/cli-output.ts"() {
1027
1280
  "use strict";
@@ -1054,7 +1307,7 @@ var init_cli_output = __esm({
1054
1307
  currentLogLevel = envLevel;
1055
1308
  }
1056
1309
  }
1057
- log = {
1310
+ log2 = {
1058
1311
  /**
1059
1312
  * Logs an error message (always shows unless Quiet level)
1060
1313
  * Uses clack's log.error + explicit red color
@@ -1062,7 +1315,7 @@ var init_cli_output = __esm({
1062
1315
  error(...args) {
1063
1316
  if (currentLogLevel < 0 /* Quiet */) return;
1064
1317
  const message = formatMessage(...args);
1065
- O2.error(colorize(message, colors.brightRed));
1318
+ log.error(colorize(message, colors.brightRed));
1066
1319
  },
1067
1320
  /**
1068
1321
  * Logs a warning message (shows at Normal level and above)
@@ -1071,7 +1324,7 @@ var init_cli_output = __esm({
1071
1324
  warn(...args) {
1072
1325
  if (currentLogLevel < 1 /* Normal */) return;
1073
1326
  const message = formatMessage(...args);
1074
- O2.warn(colorize(message, colors.brightYellow));
1327
+ log.warn(colorize(message, colors.brightYellow));
1075
1328
  },
1076
1329
  /**
1077
1330
  * Logs an info message (shows at Normal level and above)
@@ -1080,7 +1333,7 @@ var init_cli_output = __esm({
1080
1333
  info(...args) {
1081
1334
  if (currentLogLevel < 1 /* Normal */) return;
1082
1335
  const message = formatMessage(...args);
1083
- O2.info(colorize(message, colors.brightCyan));
1336
+ log.info(colorize(message, colors.brightCyan));
1084
1337
  },
1085
1338
  /**
1086
1339
  * Logs a success message (shows at Normal level and above)
@@ -1089,7 +1342,7 @@ var init_cli_output = __esm({
1089
1342
  success(...args) {
1090
1343
  if (currentLogLevel < 1 /* Normal */) return;
1091
1344
  const message = formatMessage(...args);
1092
- O2.success(colorize(message, colors.brightGreen));
1345
+ log.success(colorize(message, colors.brightGreen));
1093
1346
  },
1094
1347
  /**
1095
1348
  * Logs a debug message (only shows at Verbose level and above)
@@ -1098,7 +1351,7 @@ var init_cli_output = __esm({
1098
1351
  debug(...args) {
1099
1352
  if (currentLogLevel < 2 /* Verbose */) return;
1100
1353
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1101
- O2.message(
1354
+ log.message(
1102
1355
  colorize(
1103
1356
  `[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
1104
1357
  colors.gray
@@ -1112,7 +1365,7 @@ var init_cli_output = __esm({
1112
1365
  trace(...args) {
1113
1366
  if (currentLogLevel < 3 /* Debug */) return;
1114
1367
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1115
- O2.message(
1368
+ log.message(
1116
1369
  colorize(
1117
1370
  `[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
1118
1371
  colors.gray
@@ -1120,10 +1373,10 @@ var init_cli_output = __esm({
1120
1373
  );
1121
1374
  }
1122
1375
  };
1123
- error = log.error.bind(log);
1124
- warn = log.warn.bind(log);
1125
- info = log.info.bind(log);
1126
- success = log.success.bind(log);
1376
+ error = log2.error.bind(log2);
1377
+ warn = log2.warn.bind(log2);
1378
+ info = log2.info.bind(log2);
1379
+ success = log2.success.bind(log2);
1127
1380
  }
1128
1381
  });
1129
1382
 
@@ -1483,9 +1736,9 @@ var require_is_glob = __commonJS({
1483
1736
  index += 2;
1484
1737
  var close = chars[open];
1485
1738
  if (close) {
1486
- var n = str.indexOf(close, index);
1487
- if (n !== -1) {
1488
- index = n + 1;
1739
+ var n3 = str.indexOf(close, index);
1740
+ if (n3 !== -1) {
1741
+ index = n3 + 1;
1489
1742
  }
1490
1743
  }
1491
1744
  if (str[index] === "!") {
@@ -1511,9 +1764,9 @@ var require_is_glob = __commonJS({
1511
1764
  index += 2;
1512
1765
  var close = chars[open];
1513
1766
  if (close) {
1514
- var n = str.indexOf(close, index);
1515
- if (n !== -1) {
1516
- index = n + 1;
1767
+ var n3 = str.indexOf(close, index);
1768
+ if (n3 !== -1) {
1769
+ index = n3 + 1;
1517
1770
  }
1518
1771
  }
1519
1772
  if (str[index] === "!") {
@@ -1591,8 +1844,8 @@ var require_utils = __commonJS({
1591
1844
  if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
1592
1845
  return (Number(max) - Number(min)) / Number(step) >= limit;
1593
1846
  };
1594
- exports.escapeNode = (block, n = 0, type) => {
1595
- const node = block.nodes[n];
1847
+ exports.escapeNode = (block2, n3 = 0, type) => {
1848
+ const node = block2.nodes[n3];
1596
1849
  if (!node) return;
1597
1850
  if (type && node.type === type || node.type === "open" || node.type === "close") {
1598
1851
  if (node.escaped !== true) {
@@ -1609,15 +1862,15 @@ var require_utils = __commonJS({
1609
1862
  }
1610
1863
  return false;
1611
1864
  };
1612
- exports.isInvalidBrace = (block) => {
1613
- if (block.type !== "brace") return false;
1614
- if (block.invalid === true || block.dollar) return true;
1615
- if (block.commas >> 0 + block.ranges >> 0 === 0) {
1616
- block.invalid = true;
1865
+ exports.isInvalidBrace = (block2) => {
1866
+ if (block2.type !== "brace") return false;
1867
+ if (block2.invalid === true || block2.dollar) return true;
1868
+ if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
1869
+ block2.invalid = true;
1617
1870
  return true;
1618
1871
  }
1619
- if (block.open !== true || block.close !== true) {
1620
- block.invalid = true;
1872
+ if (block2.open !== true || block2.close !== true) {
1873
+ block2.invalid = true;
1621
1874
  return true;
1622
1875
  }
1623
1876
  return false;
@@ -1636,8 +1889,8 @@ var require_utils = __commonJS({
1636
1889
  exports.flatten = (...args) => {
1637
1890
  const result = [];
1638
1891
  const flat = (arr) => {
1639
- for (let i = 0; i < arr.length; i++) {
1640
- const ele = arr[i];
1892
+ for (let i2 = 0; i2 < arr.length; i2++) {
1893
+ const ele = arr[i2];
1641
1894
  if (Array.isArray(ele)) {
1642
1895
  flat(ele);
1643
1896
  continue;
@@ -1731,9 +1984,9 @@ var require_to_regex_range = __commonJS({
1731
1984
  if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
1732
1985
  return toRegexRange.cache[cacheKey].result;
1733
1986
  }
1734
- let a = Math.min(min, max);
1987
+ let a2 = Math.min(min, max);
1735
1988
  let b = Math.max(min, max);
1736
- if (Math.abs(a - b) === 1) {
1989
+ if (Math.abs(a2 - b) === 1) {
1737
1990
  let result = min + "|" + max;
1738
1991
  if (opts.capture) {
1739
1992
  return `(${result})`;
@@ -1744,20 +1997,20 @@ var require_to_regex_range = __commonJS({
1744
1997
  return `(?:${result})`;
1745
1998
  }
1746
1999
  let isPadded = hasPadding(min) || hasPadding(max);
1747
- let state = { min, max, a, b };
2000
+ let state = { min, max, a: a2, b };
1748
2001
  let positives = [];
1749
2002
  let negatives = [];
1750
2003
  if (isPadded) {
1751
2004
  state.isPadded = isPadded;
1752
2005
  state.maxLen = String(state.max).length;
1753
2006
  }
1754
- if (a < 0) {
2007
+ if (a2 < 0) {
1755
2008
  let newMin = b < 0 ? Math.abs(b) : 1;
1756
- negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
1757
- a = state.a = 0;
2009
+ negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
2010
+ a2 = state.a = 0;
1758
2011
  }
1759
2012
  if (b >= 0) {
1760
- positives = splitToPatterns(a, b, state, opts);
2013
+ positives = splitToPatterns(a2, b, state, opts);
1761
2014
  }
1762
2015
  state.negatives = negatives;
1763
2016
  state.positives = positives;
@@ -1805,8 +2058,8 @@ var require_to_regex_range = __commonJS({
1805
2058
  let digits = zipped.length;
1806
2059
  let pattern = "";
1807
2060
  let count = 0;
1808
- for (let i = 0; i < digits; i++) {
1809
- let [startDigit, stopDigit] = zipped[i];
2061
+ for (let i2 = 0; i2 < digits; i2++) {
2062
+ let [startDigit, stopDigit] = zipped[i2];
1810
2063
  if (startDigit === stopDigit) {
1811
2064
  pattern += startDigit;
1812
2065
  } else if (startDigit !== "0" || stopDigit !== "9") {
@@ -1825,8 +2078,8 @@ var require_to_regex_range = __commonJS({
1825
2078
  let tokens = [];
1826
2079
  let start = min;
1827
2080
  let prev;
1828
- for (let i = 0; i < ranges.length; i++) {
1829
- let max2 = ranges[i];
2081
+ for (let i2 = 0; i2 < ranges.length; i2++) {
2082
+ let max2 = ranges[i2];
1830
2083
  let obj = rangeToPattern(String(start), String(max2), options);
1831
2084
  let zeros = "";
1832
2085
  if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
@@ -1861,13 +2114,13 @@ var require_to_regex_range = __commonJS({
1861
2114
  }
1862
2115
  return result;
1863
2116
  }
1864
- function zip(a, b) {
2117
+ function zip(a2, b) {
1865
2118
  let arr = [];
1866
- for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
2119
+ for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
1867
2120
  return arr;
1868
2121
  }
1869
- function compare(a, b) {
1870
- return a > b ? 1 : b > a ? -1 : 0;
2122
+ function compare(a2, b) {
2123
+ return a2 > b ? 1 : b > a2 ? -1 : 0;
1871
2124
  }
1872
2125
  function contains(arr, key, val) {
1873
2126
  return arr.some((ele) => ele[key] === val);
@@ -1885,8 +2138,8 @@ var require_to_regex_range = __commonJS({
1885
2138
  }
1886
2139
  return "";
1887
2140
  }
1888
- function toCharacterClass(a, b, options) {
1889
- return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
2141
+ function toCharacterClass(a2, b, options) {
2142
+ return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
1890
2143
  }
1891
2144
  function hasPadding(str) {
1892
2145
  return /^-?(0+)\d/.test(str);
@@ -1965,8 +2218,8 @@ var require_fill_range = __commonJS({
1965
2218
  return negative ? "-" + input : input;
1966
2219
  };
1967
2220
  var toSequence = (parts, options, maxLen) => {
1968
- parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1969
- parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
2221
+ parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
2222
+ parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
1970
2223
  let prefix = options.capture ? "" : "?:";
1971
2224
  let positives = "";
1972
2225
  let negatives = "";
@@ -1987,12 +2240,12 @@ var require_fill_range = __commonJS({
1987
2240
  }
1988
2241
  return result;
1989
2242
  };
1990
- var toRange = (a, b, isNumbers, options) => {
2243
+ var toRange = (a2, b, isNumbers, options) => {
1991
2244
  if (isNumbers) {
1992
- return toRegexRange(a, b, { wrap: false, ...options });
2245
+ return toRegexRange(a2, b, { wrap: false, ...options });
1993
2246
  }
1994
- let start = String.fromCharCode(a);
1995
- if (a === b) return start;
2247
+ let start = String.fromCharCode(a2);
2248
+ if (a2 === b) return start;
1996
2249
  let stop = String.fromCharCode(b);
1997
2250
  return `[${start}-${stop}]`;
1998
2251
  };
@@ -2018,15 +2271,15 @@ var require_fill_range = __commonJS({
2018
2271
  return [];
2019
2272
  };
2020
2273
  var fillNumbers = (start, end, step = 1, options = {}) => {
2021
- let a = Number(start);
2274
+ let a2 = Number(start);
2022
2275
  let b = Number(end);
2023
- if (!Number.isInteger(a) || !Number.isInteger(b)) {
2276
+ if (!Number.isInteger(a2) || !Number.isInteger(b)) {
2024
2277
  if (options.strictRanges === true) throw rangeError([start, end]);
2025
2278
  return [];
2026
2279
  }
2027
- if (a === 0) a = 0;
2280
+ if (a2 === 0) a2 = 0;
2028
2281
  if (b === 0) b = 0;
2029
- let descending = a > b;
2282
+ let descending = a2 > b;
2030
2283
  let startString = String(start);
2031
2284
  let endString = String(end);
2032
2285
  let stepString = String(step);
@@ -2042,13 +2295,13 @@ var require_fill_range = __commonJS({
2042
2295
  let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
2043
2296
  let range = [];
2044
2297
  let index = 0;
2045
- while (descending ? a >= b : a <= b) {
2298
+ while (descending ? a2 >= b : a2 <= b) {
2046
2299
  if (options.toRegex === true && step > 1) {
2047
- push(a);
2300
+ push(a2);
2048
2301
  } else {
2049
- range.push(pad(format(a, index), maxLen, toNumber));
2302
+ range.push(pad(format(a2, index), maxLen, toNumber));
2050
2303
  }
2051
- a = descending ? a - step : a + step;
2304
+ a2 = descending ? a2 - step : a2 + step;
2052
2305
  index++;
2053
2306
  }
2054
2307
  if (options.toRegex === true) {
@@ -2061,19 +2314,19 @@ var require_fill_range = __commonJS({
2061
2314
  return invalidRange(start, end, options);
2062
2315
  }
2063
2316
  let format = options.transform || ((val) => String.fromCharCode(val));
2064
- let a = `${start}`.charCodeAt(0);
2317
+ let a2 = `${start}`.charCodeAt(0);
2065
2318
  let b = `${end}`.charCodeAt(0);
2066
- let descending = a > b;
2067
- let min = Math.min(a, b);
2068
- let max = Math.max(a, b);
2319
+ let descending = a2 > b;
2320
+ let min = Math.min(a2, b);
2321
+ let max = Math.max(a2, b);
2069
2322
  if (options.toRegex && step === 1) {
2070
2323
  return toRange(min, max, false, options);
2071
2324
  }
2072
2325
  let range = [];
2073
2326
  let index = 0;
2074
- while (descending ? a >= b : a <= b) {
2075
- range.push(format(a, index));
2076
- a = descending ? a - step : a + step;
2327
+ while (descending ? a2 >= b : a2 <= b) {
2328
+ range.push(format(a2, index));
2329
+ a2 = descending ? a2 - step : a2 + step;
2077
2330
  index++;
2078
2331
  }
2079
2332
  if (options.toRegex === true) {
@@ -2196,18 +2449,18 @@ var require_expand = __commonJS({
2196
2449
  const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
2197
2450
  const walk = (node, parent = {}) => {
2198
2451
  node.queue = [];
2199
- let p2 = parent;
2200
- let q2 = parent.queue;
2201
- while (p2.type !== "brace" && p2.type !== "root" && p2.parent) {
2202
- p2 = p2.parent;
2203
- q2 = p2.queue;
2452
+ let p = parent;
2453
+ let q = parent.queue;
2454
+ while (p.type !== "brace" && p.type !== "root" && p.parent) {
2455
+ p = p.parent;
2456
+ q = p.queue;
2204
2457
  }
2205
2458
  if (node.invalid || node.dollar) {
2206
- q2.push(append(q2.pop(), stringify2(node, options)));
2459
+ q.push(append(q.pop(), stringify2(node, options)));
2207
2460
  return;
2208
2461
  }
2209
2462
  if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
2210
- q2.push(append(q2.pop(), ["{}"]));
2463
+ q.push(append(q.pop(), ["{}"]));
2211
2464
  return;
2212
2465
  }
2213
2466
  if (node.nodes && node.ranges > 0) {
@@ -2219,26 +2472,26 @@ var require_expand = __commonJS({
2219
2472
  if (range.length === 0) {
2220
2473
  range = stringify2(node, options);
2221
2474
  }
2222
- q2.push(append(q2.pop(), range));
2475
+ q.push(append(q.pop(), range));
2223
2476
  node.nodes = [];
2224
2477
  return;
2225
2478
  }
2226
2479
  const enclose = utils.encloseBrace(node);
2227
2480
  let queue = node.queue;
2228
- let block = node;
2229
- while (block.type !== "brace" && block.type !== "root" && block.parent) {
2230
- block = block.parent;
2231
- queue = block.queue;
2481
+ let block2 = node;
2482
+ while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
2483
+ block2 = block2.parent;
2484
+ queue = block2.queue;
2232
2485
  }
2233
- for (let i = 0; i < node.nodes.length; i++) {
2234
- const child = node.nodes[i];
2486
+ for (let i2 = 0; i2 < node.nodes.length; i2++) {
2487
+ const child = node.nodes[i2];
2235
2488
  if (child.type === "comma" && node.type === "brace") {
2236
- if (i === 1) queue.push("");
2489
+ if (i2 === 1) queue.push("");
2237
2490
  queue.push("");
2238
2491
  continue;
2239
2492
  }
2240
2493
  if (child.type === "close") {
2241
- q2.push(append(q2.pop(), queue, enclose));
2494
+ q.push(append(q.pop(), queue, enclose));
2242
2495
  continue;
2243
2496
  }
2244
2497
  if (child.value && child.type !== "open") {
@@ -2405,7 +2658,7 @@ var require_parse = __commonJS({
2405
2658
  }
2406
2659
  const ast = { type: "root", input, nodes: [] };
2407
2660
  const stack = [ast];
2408
- let block = ast;
2661
+ let block2 = ast;
2409
2662
  let prev = ast;
2410
2663
  let brackets = 0;
2411
2664
  const length = input.length;
@@ -2421,15 +2674,15 @@ var require_parse = __commonJS({
2421
2674
  prev.value += node.value;
2422
2675
  return;
2423
2676
  }
2424
- block.nodes.push(node);
2425
- node.parent = block;
2677
+ block2.nodes.push(node);
2678
+ node.parent = block2;
2426
2679
  node.prev = prev;
2427
2680
  prev = node;
2428
2681
  return node;
2429
2682
  };
2430
2683
  push({ type: "bos" });
2431
2684
  while (index < length) {
2432
- block = stack[stack.length - 1];
2685
+ block2 = stack[stack.length - 1];
2433
2686
  value = advance();
2434
2687
  if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
2435
2688
  continue;
@@ -2466,19 +2719,19 @@ var require_parse = __commonJS({
2466
2719
  continue;
2467
2720
  }
2468
2721
  if (value === CHAR_LEFT_PARENTHESES) {
2469
- block = push({ type: "paren", nodes: [] });
2470
- stack.push(block);
2722
+ block2 = push({ type: "paren", nodes: [] });
2723
+ stack.push(block2);
2471
2724
  push({ type: "text", value });
2472
2725
  continue;
2473
2726
  }
2474
2727
  if (value === CHAR_RIGHT_PARENTHESES) {
2475
- if (block.type !== "paren") {
2728
+ if (block2.type !== "paren") {
2476
2729
  push({ type: "text", value });
2477
2730
  continue;
2478
2731
  }
2479
- block = stack.pop();
2732
+ block2 = stack.pop();
2480
2733
  push({ type: "text", value });
2481
- block = stack[stack.length - 1];
2734
+ block2 = stack[stack.length - 1];
2482
2735
  continue;
2483
2736
  }
2484
2737
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
@@ -2503,7 +2756,7 @@ var require_parse = __commonJS({
2503
2756
  }
2504
2757
  if (value === CHAR_LEFT_CURLY_BRACE) {
2505
2758
  depth++;
2506
- const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
2759
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
2507
2760
  const brace = {
2508
2761
  type: "brace",
2509
2762
  open: true,
@@ -2514,52 +2767,52 @@ var require_parse = __commonJS({
2514
2767
  ranges: 0,
2515
2768
  nodes: []
2516
2769
  };
2517
- block = push(brace);
2518
- stack.push(block);
2770
+ block2 = push(brace);
2771
+ stack.push(block2);
2519
2772
  push({ type: "open", value });
2520
2773
  continue;
2521
2774
  }
2522
2775
  if (value === CHAR_RIGHT_CURLY_BRACE) {
2523
- if (block.type !== "brace") {
2776
+ if (block2.type !== "brace") {
2524
2777
  push({ type: "text", value });
2525
2778
  continue;
2526
2779
  }
2527
2780
  const type = "close";
2528
- block = stack.pop();
2529
- block.close = true;
2781
+ block2 = stack.pop();
2782
+ block2.close = true;
2530
2783
  push({ type, value });
2531
2784
  depth--;
2532
- block = stack[stack.length - 1];
2785
+ block2 = stack[stack.length - 1];
2533
2786
  continue;
2534
2787
  }
2535
2788
  if (value === CHAR_COMMA && depth > 0) {
2536
- if (block.ranges > 0) {
2537
- block.ranges = 0;
2538
- const open = block.nodes.shift();
2539
- block.nodes = [open, { type: "text", value: stringify2(block) }];
2789
+ if (block2.ranges > 0) {
2790
+ block2.ranges = 0;
2791
+ const open = block2.nodes.shift();
2792
+ block2.nodes = [open, { type: "text", value: stringify2(block2) }];
2540
2793
  }
2541
2794
  push({ type: "comma", value });
2542
- block.commas++;
2795
+ block2.commas++;
2543
2796
  continue;
2544
2797
  }
2545
- if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
2546
- const siblings = block.nodes;
2798
+ if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
2799
+ const siblings = block2.nodes;
2547
2800
  if (depth === 0 || siblings.length === 0) {
2548
2801
  push({ type: "text", value });
2549
2802
  continue;
2550
2803
  }
2551
2804
  if (prev.type === "dot") {
2552
- block.range = [];
2805
+ block2.range = [];
2553
2806
  prev.value += value;
2554
2807
  prev.type = "range";
2555
- if (block.nodes.length !== 3 && block.nodes.length !== 5) {
2556
- block.invalid = true;
2557
- block.ranges = 0;
2808
+ if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
2809
+ block2.invalid = true;
2810
+ block2.ranges = 0;
2558
2811
  prev.type = "text";
2559
2812
  continue;
2560
2813
  }
2561
- block.ranges++;
2562
- block.args = [];
2814
+ block2.ranges++;
2815
+ block2.args = [];
2563
2816
  continue;
2564
2817
  }
2565
2818
  if (prev.type === "range") {
@@ -2567,7 +2820,7 @@ var require_parse = __commonJS({
2567
2820
  const before = siblings[siblings.length - 1];
2568
2821
  before.value += prev.value + value;
2569
2822
  prev = before;
2570
- block.ranges--;
2823
+ block2.ranges--;
2571
2824
  continue;
2572
2825
  }
2573
2826
  push({ type: "dot", value });
@@ -2576,9 +2829,9 @@ var require_parse = __commonJS({
2576
2829
  push({ type: "text", value });
2577
2830
  }
2578
2831
  do {
2579
- block = stack.pop();
2580
- if (block.type !== "root") {
2581
- block.nodes.forEach((node) => {
2832
+ block2 = stack.pop();
2833
+ if (block2.type !== "root") {
2834
+ block2.nodes.forEach((node) => {
2582
2835
  if (!node.nodes) {
2583
2836
  if (node.type === "open") node.isOpen = true;
2584
2837
  if (node.type === "close") node.isClose = true;
@@ -2587,8 +2840,8 @@ var require_parse = __commonJS({
2587
2840
  }
2588
2841
  });
2589
2842
  const parent = stack[stack.length - 1];
2590
- const index2 = parent.nodes.indexOf(block);
2591
- parent.nodes.splice(index2, 1, ...block.nodes);
2843
+ const index2 = parent.nodes.indexOf(block2);
2844
+ parent.nodes.splice(index2, 1, ...block2.nodes);
2592
2845
  }
2593
2846
  } while (stack.length > 0);
2594
2847
  push({ type: "eos" });
@@ -3221,9 +3474,9 @@ var require_scan = __commonJS({
3221
3474
  if (opts.parts === true || opts.tokens === true) {
3222
3475
  let prevIndex;
3223
3476
  for (let idx = 0; idx < slashes.length; idx++) {
3224
- const n = prevIndex ? prevIndex + 1 : start;
3225
- const i = slashes[idx];
3226
- const value = input.slice(n, i);
3477
+ const n3 = prevIndex ? prevIndex + 1 : start;
3478
+ const i2 = slashes[idx];
3479
+ const value = input.slice(n3, i2);
3227
3480
  if (opts.tokens) {
3228
3481
  if (idx === 0 && start !== 0) {
3229
3482
  tokens[idx].isPrefix = true;
@@ -3237,7 +3490,7 @@ var require_scan = __commonJS({
3237
3490
  if (idx !== 0 || value !== "") {
3238
3491
  parts.push(value);
3239
3492
  }
3240
- prevIndex = i;
3493
+ prevIndex = i2;
3241
3494
  }
3242
3495
  if (prevIndex && prevIndex + 1 < input.length) {
3243
3496
  const value = input.slice(prevIndex + 1);
@@ -3366,15 +3619,15 @@ var require_parse2 = __commonJS({
3366
3619
  };
3367
3620
  var hasRepeatedCharPrefixOverlap = (branches) => {
3368
3621
  const values = branches.map(normalizeSimpleBranch).filter(Boolean);
3369
- for (let i = 0; i < values.length; i++) {
3370
- for (let j2 = i + 1; j2 < values.length; j2++) {
3371
- const a = values[i];
3372
- const b = values[j2];
3373
- const char = a[0];
3374
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
3622
+ for (let i2 = 0; i2 < values.length; i2++) {
3623
+ for (let j = i2 + 1; j < values.length; j++) {
3624
+ const a2 = values[i2];
3625
+ const b = values[j];
3626
+ const char = a2[0];
3627
+ if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
3375
3628
  continue;
3376
3629
  }
3377
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
3630
+ if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
3378
3631
  return true;
3379
3632
  }
3380
3633
  }
@@ -3389,8 +3642,8 @@ var require_parse2 = __commonJS({
3389
3642
  let paren = 0;
3390
3643
  let quote = 0;
3391
3644
  let escaped = false;
3392
- for (let i = 1; i < pattern.length; i++) {
3393
- const ch = pattern[i];
3645
+ for (let i2 = 1; i2 < pattern.length; i2++) {
3646
+ const ch = pattern[i2];
3394
3647
  if (escaped === true) {
3395
3648
  escaped = false;
3396
3649
  continue;
@@ -3424,13 +3677,13 @@ var require_parse2 = __commonJS({
3424
3677
  if (ch === ")") {
3425
3678
  paren--;
3426
3679
  if (paren === 0) {
3427
- if (requireEnd === true && i !== pattern.length - 1) {
3680
+ if (requireEnd === true && i2 !== pattern.length - 1) {
3428
3681
  return;
3429
3682
  }
3430
3683
  return {
3431
3684
  type: pattern[0],
3432
- body: pattern.slice(2, i),
3433
- end: i
3685
+ body: pattern.slice(2, i2),
3686
+ end: i2
3434
3687
  };
3435
3688
  }
3436
3689
  }
@@ -3562,7 +3815,7 @@ var require_parse2 = __commonJS({
3562
3815
  let prev = bos;
3563
3816
  let value;
3564
3817
  const eos = () => state.index === len - 1;
3565
- const peek = state.peek = (n = 1) => input[state.index + n];
3818
+ const peek = state.peek = (n3 = 1) => input[state.index + n3];
3566
3819
  const advance = state.advance = () => input[++state.index] || "";
3567
3820
  const remaining = () => input.slice(state.index + 1);
3568
3821
  const consume = (value2 = "", num = 0) => {
@@ -3643,10 +3896,10 @@ var require_parse2 = __commonJS({
3643
3896
  open.type = "text";
3644
3897
  open.value = literal;
3645
3898
  open.output = safeOutput || utils.escapeRegex(literal);
3646
- for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
3647
- tokens[i].value = "";
3648
- tokens[i].output = "";
3649
- delete tokens[i].suffix;
3899
+ for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
3900
+ tokens[i2].value = "";
3901
+ tokens[i2].output = "";
3902
+ delete tokens[i2].suffix;
3650
3903
  }
3651
3904
  state.output = token.output + open.output;
3652
3905
  state.backtrack = true;
@@ -3677,10 +3930,10 @@ var require_parse2 = __commonJS({
3677
3930
  };
3678
3931
  if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
3679
3932
  let backslashes = false;
3680
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
3933
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc, chars, first, rest, index) => {
3681
3934
  if (first === "\\") {
3682
3935
  backslashes = true;
3683
- return m;
3936
+ return m2;
3684
3937
  }
3685
3938
  if (first === "?") {
3686
3939
  if (esc) {
@@ -3700,14 +3953,14 @@ var require_parse2 = __commonJS({
3700
3953
  }
3701
3954
  return star;
3702
3955
  }
3703
- return esc ? m : `\\${m}`;
3956
+ return esc ? m2 : `\\${m2}`;
3704
3957
  });
3705
3958
  if (backslashes === true) {
3706
3959
  if (opts.unescape === true) {
3707
3960
  output = output.replace(/\\/g, "");
3708
3961
  } else {
3709
- output = output.replace(/\\+/g, (m) => {
3710
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
3962
+ output = output.replace(/\\+/g, (m2) => {
3963
+ return m2.length % 2 === 0 ? "\\\\" : m2 ? "\\" : "";
3711
3964
  });
3712
3965
  }
3713
3966
  }
@@ -3889,13 +4142,13 @@ var require_parse2 = __commonJS({
3889
4142
  if (brace.dots === true) {
3890
4143
  const arr = tokens.slice();
3891
4144
  const range = [];
3892
- for (let i = arr.length - 1; i >= 0; i--) {
4145
+ for (let i2 = arr.length - 1; i2 >= 0; i2--) {
3893
4146
  tokens.pop();
3894
- if (arr[i].type === "brace") {
4147
+ if (arr[i2].type === "brace") {
3895
4148
  break;
3896
4149
  }
3897
- if (arr[i].type !== "dots") {
3898
- range.unshift(arr[i].value);
4150
+ if (arr[i2].type !== "dots") {
4151
+ range.unshift(arr[i2].value);
3899
4152
  }
3900
4153
  }
3901
4154
  output = expandRange(range, opts);
@@ -4354,7 +4607,7 @@ var require_picomatch = __commonJS({
4354
4607
  };
4355
4608
  picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
4356
4609
  picomatch.parse = (pattern, options) => {
4357
- if (Array.isArray(pattern)) return pattern.map((p2) => picomatch.parse(p2, options));
4610
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
4358
4611
  return parse2(pattern, { ...options, fastpaths: false });
4359
4612
  };
4360
4613
  picomatch.scan = (input, options) => scan(input, options);
@@ -4438,8 +4691,8 @@ var require_micromatch = __commonJS({
4438
4691
  options.onResult(state);
4439
4692
  }
4440
4693
  };
4441
- for (let i = 0; i < patterns.length; i++) {
4442
- let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
4694
+ for (let i2 = 0; i2 < patterns.length; i2++) {
4695
+ let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
4443
4696
  let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
4444
4697
  if (negated) negatives++;
4445
4698
  for (let item of list) {
@@ -4461,7 +4714,7 @@ var require_micromatch = __commonJS({
4461
4714
  throw new Error(`No matches found for "${patterns.join(", ")}"`);
4462
4715
  }
4463
4716
  if (options.nonull === true || options.nullglob === true) {
4464
- return options.unescape ? patterns.map((p2) => p2.replace(/\\/g, "")) : patterns;
4717
+ return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
4465
4718
  }
4466
4719
  }
4467
4720
  return matches;
@@ -4491,7 +4744,7 @@ var require_micromatch = __commonJS({
4491
4744
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4492
4745
  }
4493
4746
  if (Array.isArray(pattern)) {
4494
- return pattern.some((p2) => micromatch.contains(str, p2, options));
4747
+ return pattern.some((p) => micromatch.contains(str, p, options));
4495
4748
  }
4496
4749
  if (typeof pattern === "string") {
4497
4750
  if (isEmptyString(str) || isEmptyString(pattern)) {
@@ -4536,7 +4789,7 @@ var require_micromatch = __commonJS({
4536
4789
  if (typeof str !== "string") {
4537
4790
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4538
4791
  }
4539
- return [].concat(patterns).every((p2) => picomatch(p2, options)(str));
4792
+ return [].concat(patterns).every((p) => picomatch(p, options)(str));
4540
4793
  };
4541
4794
  micromatch.capture = (glob, input, options) => {
4542
4795
  let posix = utils.isWindows(options);
@@ -4687,7 +4940,7 @@ var require_pattern = __commonJS({
4687
4940
  exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
4688
4941
  function expandBraceExpansion(pattern) {
4689
4942
  const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
4690
- patterns.sort((a, b) => a.length - b.length);
4943
+ patterns.sort((a2, b) => a2.length - b.length);
4691
4944
  return patterns.filter((pattern2) => pattern2 !== "");
4692
4945
  }
4693
4946
  exports.expandBraceExpansion = expandBraceExpansion;
@@ -4768,8 +5021,8 @@ var require_merge2 = __commonJS({
4768
5021
  }
4769
5022
  const mergedStream = PassThrough(options);
4770
5023
  function addStream() {
4771
- for (let i = 0, len = arguments.length; i < len; i++) {
4772
- streamsQueue.push(pauseStreams(arguments[i], options));
5024
+ for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
5025
+ streamsQueue.push(pauseStreams(arguments[i2], options));
4773
5026
  }
4774
5027
  mergeStream();
4775
5028
  return this;
@@ -4818,8 +5071,8 @@ var require_merge2 = __commonJS({
4818
5071
  stream.pipe(mergedStream, { end: false });
4819
5072
  stream.resume();
4820
5073
  }
4821
- for (let i = 0; i < streams.length; i++) {
4822
- pipe(streams[i]);
5074
+ for (let i2 = 0; i2 < streams.length; i2++) {
5075
+ pipe(streams[i2]);
4823
5076
  }
4824
5077
  next();
4825
5078
  }
@@ -4850,8 +5103,8 @@ var require_merge2 = __commonJS({
4850
5103
  }
4851
5104
  streams.pause();
4852
5105
  } else {
4853
- for (let i = 0, len = streams.length; i < len; i++) {
4854
- streams[i] = pauseStreams(streams[i], options);
5106
+ for (let i2 = 0, len = streams.length; i2 < len; i2++) {
5107
+ streams[i2] = pauseStreams(streams[i2], options);
4855
5108
  }
4856
5109
  }
4857
5110
  return streams;
@@ -4933,13 +5186,13 @@ var require_tasks = __commonJS({
4933
5186
  Object.defineProperty(exports, "__esModule", { value: true });
4934
5187
  exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
4935
5188
  var utils = require_utils3();
4936
- function generate(input, settings) {
4937
- const patterns = processPatterns(input, settings);
4938
- const ignore = processPatterns(settings.ignore, settings);
5189
+ function generate(input, settings2) {
5190
+ const patterns = processPatterns(input, settings2);
5191
+ const ignore = processPatterns(settings2.ignore, settings2);
4939
5192
  const positivePatterns = getPositivePatterns(patterns);
4940
5193
  const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
4941
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
4942
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
5194
+ const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
5195
+ const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
4943
5196
  const staticTasks = convertPatternsToTasks(
4944
5197
  staticPatterns,
4945
5198
  negativePatterns,
@@ -4955,12 +5208,12 @@ var require_tasks = __commonJS({
4955
5208
  return staticTasks.concat(dynamicTasks);
4956
5209
  }
4957
5210
  exports.generate = generate;
4958
- function processPatterns(input, settings) {
5211
+ function processPatterns(input, settings2) {
4959
5212
  let patterns = input;
4960
- if (settings.braceExpansion) {
5213
+ if (settings2.braceExpansion) {
4961
5214
  patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
4962
5215
  }
4963
- if (settings.baseNameMatch) {
5216
+ if (settings2.baseNameMatch) {
4964
5217
  patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
4965
5218
  }
4966
5219
  return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
@@ -4991,7 +5244,7 @@ var require_tasks = __commonJS({
4991
5244
  }
4992
5245
  exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
4993
5246
  function groupPatternsByBaseDirectory(patterns) {
4994
- const group = {};
5247
+ const group2 = {};
4995
5248
  return patterns.reduce((collection, pattern) => {
4996
5249
  const base = utils.pattern.getBaseDirectory(pattern);
4997
5250
  if (base in collection) {
@@ -5000,7 +5253,7 @@ var require_tasks = __commonJS({
5000
5253
  collection[base] = [pattern];
5001
5254
  }
5002
5255
  return collection;
5003
- }, group);
5256
+ }, group2);
5004
5257
  }
5005
5258
  exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
5006
5259
  function convertPatternGroupsToTasks(positive, negative, dynamic) {
@@ -5029,26 +5282,26 @@ var require_async = __commonJS({
5029
5282
  init_utils2();
5030
5283
  Object.defineProperty(exports, "__esModule", { value: true });
5031
5284
  exports.read = void 0;
5032
- function read(path, settings, callback) {
5033
- settings.fs.lstat(path, (lstatError, lstat) => {
5285
+ function read(path, settings2, callback) {
5286
+ settings2.fs.lstat(path, (lstatError, lstat) => {
5034
5287
  if (lstatError !== null) {
5035
5288
  callFailureCallback(callback, lstatError);
5036
5289
  return;
5037
5290
  }
5038
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5291
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
5039
5292
  callSuccessCallback(callback, lstat);
5040
5293
  return;
5041
5294
  }
5042
- settings.fs.stat(path, (statError, stat) => {
5295
+ settings2.fs.stat(path, (statError, stat) => {
5043
5296
  if (statError !== null) {
5044
- if (settings.throwErrorOnBrokenSymbolicLink) {
5297
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5045
5298
  callFailureCallback(callback, statError);
5046
5299
  return;
5047
5300
  }
5048
5301
  callSuccessCallback(callback, lstat);
5049
5302
  return;
5050
5303
  }
5051
- if (settings.markSymbolicLink) {
5304
+ if (settings2.markSymbolicLink) {
5052
5305
  stat.isSymbolicLink = () => true;
5053
5306
  }
5054
5307
  callSuccessCallback(callback, stat);
@@ -5072,19 +5325,19 @@ var require_sync = __commonJS({
5072
5325
  init_utils2();
5073
5326
  Object.defineProperty(exports, "__esModule", { value: true });
5074
5327
  exports.read = void 0;
5075
- function read(path, settings) {
5076
- const lstat = settings.fs.lstatSync(path);
5077
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5328
+ function read(path, settings2) {
5329
+ const lstat = settings2.fs.lstatSync(path);
5330
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
5078
5331
  return lstat;
5079
5332
  }
5080
5333
  try {
5081
- const stat = settings.fs.statSync(path);
5082
- if (settings.markSymbolicLink) {
5334
+ const stat = settings2.fs.statSync(path);
5335
+ if (settings2.markSymbolicLink) {
5083
5336
  stat.isSymbolicLink = () => true;
5084
5337
  }
5085
5338
  return stat;
5086
5339
  } catch (error2) {
5087
- if (!settings.throwErrorOnBrokenSymbolicLink) {
5340
+ if (!settings2.throwErrorOnBrokenSymbolicLink) {
5088
5341
  return lstat;
5089
5342
  }
5090
5343
  throw error2;
@@ -5161,8 +5414,8 @@ var require_out = __commonJS({
5161
5414
  }
5162
5415
  exports.stat = stat;
5163
5416
  function statSync3(path, optionsOrSettings) {
5164
- const settings = getSettings(optionsOrSettings);
5165
- return sync.read(path, settings);
5417
+ const settings2 = getSettings(optionsOrSettings);
5418
+ return sync.read(path, settings2);
5166
5419
  }
5167
5420
  exports.statSync = statSync3;
5168
5421
  function getSettings(settingsOrOptions = {}) {
@@ -5210,8 +5463,8 @@ var require_run_parallel = __commonJS({
5210
5463
  if (isSync) queueMicrotask2(end);
5211
5464
  else end();
5212
5465
  }
5213
- function each(i, err, result) {
5214
- results[i] = result;
5466
+ function each(i2, err, result) {
5467
+ results[i2] = result;
5215
5468
  if (--pending === 0 || err) {
5216
5469
  done(err);
5217
5470
  }
@@ -5225,9 +5478,9 @@ var require_run_parallel = __commonJS({
5225
5478
  });
5226
5479
  });
5227
5480
  } else {
5228
- tasks.forEach(function(task, i) {
5481
+ tasks.forEach(function(task, i2) {
5229
5482
  task(function(err, result) {
5230
- each(i, err, result);
5483
+ each(i2, err, result);
5231
5484
  });
5232
5485
  });
5233
5486
  }
@@ -5302,11 +5555,11 @@ var require_common = __commonJS({
5302
5555
  init_utils2();
5303
5556
  Object.defineProperty(exports, "__esModule", { value: true });
5304
5557
  exports.joinPathSegments = void 0;
5305
- function joinPathSegments(a, b, separator) {
5306
- if (a.endsWith(separator)) {
5307
- return a + b;
5558
+ function joinPathSegments(a2, b, separator) {
5559
+ if (a2.endsWith(separator)) {
5560
+ return a2 + b;
5308
5561
  }
5309
- return a + separator + b;
5562
+ return a2 + separator + b;
5310
5563
  }
5311
5564
  exports.joinPathSegments = joinPathSegments;
5312
5565
  }
@@ -5324,16 +5577,16 @@ var require_async2 = __commonJS({
5324
5577
  var constants_1 = require_constants3();
5325
5578
  var utils = require_utils4();
5326
5579
  var common = require_common();
5327
- function read(directory, settings, callback) {
5328
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5329
- readdirWithFileTypes(directory, settings, callback);
5580
+ function read(directory, settings2, callback) {
5581
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5582
+ readdirWithFileTypes(directory, settings2, callback);
5330
5583
  return;
5331
5584
  }
5332
- readdir(directory, settings, callback);
5585
+ readdir(directory, settings2, callback);
5333
5586
  }
5334
5587
  exports.read = read;
5335
- function readdirWithFileTypes(directory, settings, callback) {
5336
- settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5588
+ function readdirWithFileTypes(directory, settings2, callback) {
5589
+ settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5337
5590
  if (readdirError !== null) {
5338
5591
  callFailureCallback(callback, readdirError);
5339
5592
  return;
@@ -5341,13 +5594,13 @@ var require_async2 = __commonJS({
5341
5594
  const entries = dirents.map((dirent) => ({
5342
5595
  dirent,
5343
5596
  name: dirent.name,
5344
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5597
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5345
5598
  }));
5346
- if (!settings.followSymbolicLinks) {
5599
+ if (!settings2.followSymbolicLinks) {
5347
5600
  callSuccessCallback(callback, entries);
5348
5601
  return;
5349
5602
  }
5350
- const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
5603
+ const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
5351
5604
  rpl(tasks, (rplError, rplEntries) => {
5352
5605
  if (rplError !== null) {
5353
5606
  callFailureCallback(callback, rplError);
@@ -5358,15 +5611,15 @@ var require_async2 = __commonJS({
5358
5611
  });
5359
5612
  }
5360
5613
  exports.readdirWithFileTypes = readdirWithFileTypes;
5361
- function makeRplTaskEntry(entry, settings) {
5614
+ function makeRplTaskEntry(entry, settings2) {
5362
5615
  return (done) => {
5363
5616
  if (!entry.dirent.isSymbolicLink()) {
5364
5617
  done(null, entry);
5365
5618
  return;
5366
5619
  }
5367
- settings.fs.stat(entry.path, (statError, stats) => {
5620
+ settings2.fs.stat(entry.path, (statError, stats) => {
5368
5621
  if (statError !== null) {
5369
- if (settings.throwErrorOnBrokenSymbolicLink) {
5622
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5370
5623
  done(statError);
5371
5624
  return;
5372
5625
  }
@@ -5378,16 +5631,16 @@ var require_async2 = __commonJS({
5378
5631
  });
5379
5632
  };
5380
5633
  }
5381
- function readdir(directory, settings, callback) {
5382
- settings.fs.readdir(directory, (readdirError, names) => {
5634
+ function readdir(directory, settings2, callback) {
5635
+ settings2.fs.readdir(directory, (readdirError, names) => {
5383
5636
  if (readdirError !== null) {
5384
5637
  callFailureCallback(callback, readdirError);
5385
5638
  return;
5386
5639
  }
5387
5640
  const tasks = names.map((name) => {
5388
- const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5641
+ const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5389
5642
  return (done) => {
5390
- fsStat.stat(path, settings.fsStatSettings, (error2, stats) => {
5643
+ fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
5391
5644
  if (error2 !== null) {
5392
5645
  done(error2);
5393
5646
  return;
@@ -5397,7 +5650,7 @@ var require_async2 = __commonJS({
5397
5650
  path,
5398
5651
  dirent: utils.fs.createDirentFromStats(name, stats)
5399
5652
  };
5400
- if (settings.stats) {
5653
+ if (settings2.stats) {
5401
5654
  entry.stats = stats;
5402
5655
  }
5403
5656
  done(null, entry);
@@ -5434,27 +5687,27 @@ var require_sync2 = __commonJS({
5434
5687
  var constants_1 = require_constants3();
5435
5688
  var utils = require_utils4();
5436
5689
  var common = require_common();
5437
- function read(directory, settings) {
5438
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5439
- return readdirWithFileTypes(directory, settings);
5690
+ function read(directory, settings2) {
5691
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5692
+ return readdirWithFileTypes(directory, settings2);
5440
5693
  }
5441
- return readdir(directory, settings);
5694
+ return readdir(directory, settings2);
5442
5695
  }
5443
5696
  exports.read = read;
5444
- function readdirWithFileTypes(directory, settings) {
5445
- const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
5697
+ function readdirWithFileTypes(directory, settings2) {
5698
+ const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
5446
5699
  return dirents.map((dirent) => {
5447
5700
  const entry = {
5448
5701
  dirent,
5449
5702
  name: dirent.name,
5450
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5703
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5451
5704
  };
5452
- if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
5705
+ if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
5453
5706
  try {
5454
- const stats = settings.fs.statSync(entry.path);
5707
+ const stats = settings2.fs.statSync(entry.path);
5455
5708
  entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
5456
5709
  } catch (error2) {
5457
- if (settings.throwErrorOnBrokenSymbolicLink) {
5710
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5458
5711
  throw error2;
5459
5712
  }
5460
5713
  }
@@ -5463,17 +5716,17 @@ var require_sync2 = __commonJS({
5463
5716
  });
5464
5717
  }
5465
5718
  exports.readdirWithFileTypes = readdirWithFileTypes;
5466
- function readdir(directory, settings) {
5467
- const names = settings.fs.readdirSync(directory);
5719
+ function readdir(directory, settings2) {
5720
+ const names = settings2.fs.readdirSync(directory);
5468
5721
  return names.map((name) => {
5469
- const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5470
- const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
5722
+ const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5723
+ const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
5471
5724
  const entry = {
5472
5725
  name,
5473
5726
  path: entryPath,
5474
5727
  dirent: utils.fs.createDirentFromStats(name, stats)
5475
5728
  };
5476
- if (settings.stats) {
5729
+ if (settings2.stats) {
5477
5730
  entry.stats = stats;
5478
5731
  }
5479
5732
  return entry;
@@ -5560,8 +5813,8 @@ var require_out2 = __commonJS({
5560
5813
  }
5561
5814
  exports.scandir = scandir;
5562
5815
  function scandirSync(path, optionsOrSettings) {
5563
- const settings = getSettings(optionsOrSettings);
5564
- return sync.read(path, settings);
5816
+ const settings2 = getSettings(optionsOrSettings);
5817
+ return sync.read(path, settings2);
5565
5818
  }
5566
5819
  exports.scandirSync = scandirSync;
5567
5820
  function getSettings(settingsOrOptions = {}) {
@@ -5605,9 +5858,9 @@ var require_reusify = __commonJS({
5605
5858
  }
5606
5859
  });
5607
5860
 
5608
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5861
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5609
5862
  var require_queue = __commonJS({
5610
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5863
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5611
5864
  "use strict";
5612
5865
  init_utils2();
5613
5866
  var reusify = require_reusify();
@@ -5787,11 +6040,12 @@ var require_queue = __commonJS({
5787
6040
  current.value = null;
5788
6041
  current.callback = noop;
5789
6042
  current.errorHandler = null;
6043
+ current.next = null;
5790
6044
  if (errorHandler2) {
5791
6045
  errorHandler2(new Error("abort"), val);
5792
6046
  }
5793
6047
  callback.call(context2, new Error("abort"));
5794
- current.release(current);
6048
+ cache.release(current);
5795
6049
  current = next;
5796
6050
  }
5797
6051
  self.drain = noop;
@@ -5842,7 +6096,7 @@ var require_queue = __commonJS({
5842
6096
  queue.drained = drained;
5843
6097
  return queue;
5844
6098
  function push(value) {
5845
- var p2 = new Promise(function(resolve4, reject) {
6099
+ var p = new Promise(function(resolve4, reject) {
5846
6100
  pushCb(value, function(err, result) {
5847
6101
  if (err) {
5848
6102
  reject(err);
@@ -5851,11 +6105,11 @@ var require_queue = __commonJS({
5851
6105
  resolve4(result);
5852
6106
  });
5853
6107
  });
5854
- p2.catch(noop);
5855
- return p2;
6108
+ p.catch(noop);
6109
+ return p;
5856
6110
  }
5857
6111
  function unshift(value) {
5858
- var p2 = new Promise(function(resolve4, reject) {
6112
+ var p = new Promise(function(resolve4, reject) {
5859
6113
  unshiftCb(value, function(err, result) {
5860
6114
  if (err) {
5861
6115
  reject(err);
@@ -5864,11 +6118,11 @@ var require_queue = __commonJS({
5864
6118
  resolve4(result);
5865
6119
  });
5866
6120
  });
5867
- p2.catch(noop);
5868
- return p2;
6121
+ p.catch(noop);
6122
+ return p;
5869
6123
  }
5870
6124
  function drained() {
5871
- var p2 = new Promise(function(resolve4) {
6125
+ var p = new Promise(function(resolve4) {
5872
6126
  process.nextTick(function() {
5873
6127
  if (queue.idle()) {
5874
6128
  resolve4();
@@ -5882,7 +6136,7 @@ var require_queue = __commonJS({
5882
6136
  }
5883
6137
  });
5884
6138
  });
5885
- return p2;
6139
+ return p;
5886
6140
  }
5887
6141
  }
5888
6142
  module.exports = fastqueue;
@@ -5897,11 +6151,11 @@ var require_common2 = __commonJS({
5897
6151
  init_utils2();
5898
6152
  Object.defineProperty(exports, "__esModule", { value: true });
5899
6153
  exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
5900
- function isFatalError(settings, error2) {
5901
- if (settings.errorFilter === null) {
6154
+ function isFatalError(settings2, error2) {
6155
+ if (settings2.errorFilter === null) {
5902
6156
  return true;
5903
6157
  }
5904
- return !settings.errorFilter(error2);
6158
+ return !settings2.errorFilter(error2);
5905
6159
  }
5906
6160
  exports.isFatalError = isFatalError;
5907
6161
  function isAppliedFilter(filter, value) {
@@ -5912,14 +6166,14 @@ var require_common2 = __commonJS({
5912
6166
  return filepath.split(/[/\\]/).join(separator);
5913
6167
  }
5914
6168
  exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
5915
- function joinPathSegments(a, b, separator) {
5916
- if (a === "") {
6169
+ function joinPathSegments(a2, b, separator) {
6170
+ if (a2 === "") {
5917
6171
  return b;
5918
6172
  }
5919
- if (a.endsWith(separator)) {
5920
- return a + b;
6173
+ if (a2.endsWith(separator)) {
6174
+ return a2 + b;
5921
6175
  }
5922
- return a + separator + b;
6176
+ return a2 + separator + b;
5923
6177
  }
5924
6178
  exports.joinPathSegments = joinPathSegments;
5925
6179
  }
@@ -6266,14 +6520,14 @@ var require_out3 = __commonJS({
6266
6520
  }
6267
6521
  exports.walk = walk;
6268
6522
  function walkSync(directory, optionsOrSettings) {
6269
- const settings = getSettings(optionsOrSettings);
6270
- const provider = new sync_1.default(directory, settings);
6523
+ const settings2 = getSettings(optionsOrSettings);
6524
+ const provider = new sync_1.default(directory, settings2);
6271
6525
  return provider.read();
6272
6526
  }
6273
6527
  exports.walkSync = walkSync;
6274
6528
  function walkStream(directory, optionsOrSettings) {
6275
- const settings = getSettings(optionsOrSettings);
6276
- const provider = new stream_1.default(directory, settings);
6529
+ const settings2 = getSettings(optionsOrSettings);
6530
+ const provider = new stream_1.default(directory, settings2);
6277
6531
  return provider.read();
6278
6532
  }
6279
6533
  exports.walkStream = walkStream;
@@ -6359,8 +6613,8 @@ var require_stream3 = __commonJS({
6359
6613
  done();
6360
6614
  }).catch(done);
6361
6615
  };
6362
- for (let i = 0; i < filepaths.length; i++) {
6363
- stream.write(i);
6616
+ for (let i2 = 0; i2 < filepaths.length; i2++) {
6617
+ stream.write(i2);
6364
6618
  }
6365
6619
  return stream;
6366
6620
  }
@@ -7021,14 +7275,14 @@ var require_out4 = __commonJS({
7021
7275
  function generateTasks(source, options) {
7022
7276
  assertPatternsInput(source);
7023
7277
  const patterns = [].concat(source);
7024
- const settings = new settings_1.default(options);
7025
- return taskManager.generate(patterns, settings);
7278
+ const settings2 = new settings_1.default(options);
7279
+ return taskManager.generate(patterns, settings2);
7026
7280
  }
7027
7281
  FastGlob2.generateTasks = generateTasks;
7028
7282
  function isDynamicPattern(source, options) {
7029
7283
  assertPatternsInput(source);
7030
- const settings = new settings_1.default(options);
7031
- return utils.pattern.isDynamicPattern(source, settings);
7284
+ const settings2 = new settings_1.default(options);
7285
+ return utils.pattern.isDynamicPattern(source, settings2);
7032
7286
  }
7033
7287
  FastGlob2.isDynamicPattern = isDynamicPattern;
7034
7288
  function escapePath(source) {
@@ -7070,9 +7324,9 @@ var require_out4 = __commonJS({
7070
7324
  })(FastGlob || (FastGlob = {}));
7071
7325
  function getWorks(source, _Provider, options) {
7072
7326
  const patterns = [].concat(source);
7073
- const settings = new settings_1.default(options);
7074
- const tasks = taskManager.generate(patterns, settings);
7075
- const provider = new _Provider(settings);
7327
+ const settings2 = new settings_1.default(options);
7328
+ const tasks = taskManager.generate(patterns, settings2);
7329
+ const provider = new _Provider(settings2);
7076
7330
  return tasks.map(provider.read, provider);
7077
7331
  }
7078
7332
  function assertPatternsInput(input) {
@@ -7250,14 +7504,14 @@ import "node:fs";
7250
7504
  import { createRequire } from "node:module";
7251
7505
  import {
7252
7506
  resolve,
7253
- join,
7254
- dirname,
7507
+ join as join2,
7508
+ dirname as dirname2,
7255
7509
  relative,
7256
7510
  normalize,
7257
7511
  sep,
7258
7512
  extname
7259
7513
  } from "node:path";
7260
- import "node:url";
7514
+ import { fileURLToPath } from "node:url";
7261
7515
  function safeExecuteAsync(fn, message) {
7262
7516
  return fn().catch((error2) => {
7263
7517
  throw new Error(
@@ -7265,7 +7519,7 @@ function safeExecuteAsync(fn, message) {
7265
7519
  );
7266
7520
  });
7267
7521
  }
7268
- var import_fast_glob, constants, log2, PACKAGE_PATHS, PathResolver;
7522
+ var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
7269
7523
  var init_PathResolver = __esm({
7270
7524
  "packages/core/config/utils/PathResolver.ts"() {
7271
7525
  "use strict";
@@ -7278,7 +7532,7 @@ var init_PathResolver = __esm({
7278
7532
  getPatternsFor: getPatternsFor || void 0,
7279
7533
  I18N_PATHS: I18N_PATHS || void 0
7280
7534
  };
7281
- log2 = {
7535
+ log3 = {
7282
7536
  error: (message, error2) => {
7283
7537
  },
7284
7538
  warn: (message, error2) => {
@@ -7314,6 +7568,7 @@ var init_PathResolver = __esm({
7314
7568
  options;
7315
7569
  _repoRoot;
7316
7570
  _appRoot = null;
7571
+ _writtenPaths = null;
7317
7572
  /**
7318
7573
  * Get or create singleton instance
7319
7574
  * @param options - Configuration options
@@ -7399,7 +7654,7 @@ var init_PathResolver = __esm({
7399
7654
  */
7400
7655
  getDirname(path) {
7401
7656
  if (!path) return "";
7402
- return this.normalizePath(dirname(path));
7657
+ return this.normalizePath(dirname2(path));
7403
7658
  }
7404
7659
  /**
7405
7660
  * Resolve package path using Node's module resolution
@@ -7411,7 +7666,7 @@ var init_PathResolver = __esm({
7411
7666
  resolvePackage(packageSpecifier, fromPath = null) {
7412
7667
  try {
7413
7668
  const basePath = fromPath || this.getAppRoot();
7414
- const require3 = createRequire(join(basePath, "package.json"));
7669
+ const require3 = createRequire(join2(basePath, "package.json"));
7415
7670
  const resolved = require3.resolve(packageSpecifier);
7416
7671
  return this.normalizePath(resolved);
7417
7672
  } catch (error2) {
@@ -7563,7 +7818,7 @@ var init_PathResolver = __esm({
7563
7818
  return cleanContent;
7564
7819
  } catch (error2) {
7565
7820
  if (this.options.debug) {
7566
- log2.warn(`Failed to read file: ${filePath}`, error2);
7821
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7567
7822
  }
7568
7823
  return null;
7569
7824
  }
@@ -7591,7 +7846,7 @@ var init_PathResolver = __esm({
7591
7846
  return cleanContent;
7592
7847
  } catch (error2) {
7593
7848
  if (this.options.debug) {
7594
- log2.warn(`Failed to read file: ${filePath}`, error2);
7849
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7595
7850
  }
7596
7851
  return null;
7597
7852
  }
@@ -7613,16 +7868,16 @@ var init_PathResolver = __esm({
7613
7868
  verbose = false
7614
7869
  } = options;
7615
7870
  const normalizedPath = this.normalizePath(filePath);
7616
- const dir = this.normalizePath(dirname(normalizedPath));
7871
+ const dir = this.normalizePath(dirname2(normalizedPath));
7617
7872
  const fileExists = this.pathExists(normalizedPath);
7618
7873
  if (fileExists && !overwrite) {
7619
7874
  if (verbose) {
7620
- log2.info(`Skipping existing file: ${normalizedPath}`);
7875
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7621
7876
  }
7622
7877
  return false;
7623
7878
  }
7624
7879
  if (dryRun) {
7625
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7880
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7626
7881
  return true;
7627
7882
  }
7628
7883
  try {
@@ -7632,22 +7887,23 @@ var init_PathResolver = __esm({
7632
7887
  }
7633
7888
  const detectedFormat = this._detectFormat(filePath, format);
7634
7889
  let writeContent;
7635
- if (Buffer.isBuffer(content)) {
7890
+ if (Buffer2.isBuffer(content)) {
7636
7891
  writeContent = content;
7637
7892
  } else if (detectedFormat === "json" && typeof content === "object") {
7638
- writeContent = JSON.stringify(content, null, 2);
7893
+ writeContent = `${JSON.stringify(content, null, 2)}
7894
+ `;
7639
7895
  } else {
7640
7896
  writeContent = String(content);
7641
7897
  }
7642
7898
  try {
7643
7899
  return await safeExecuteAsync(async () => {
7644
- if (Buffer.isBuffer(writeContent)) {
7900
+ if (Buffer2.isBuffer(writeContent)) {
7645
7901
  await fs.promises.writeFile(normalizedPath, writeContent);
7646
7902
  } else {
7647
7903
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
7648
7904
  }
7649
7905
  if (verbose) {
7650
- log2.info(
7906
+ log3.info(
7651
7907
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7652
7908
  );
7653
7909
  }
@@ -7674,16 +7930,16 @@ var init_PathResolver = __esm({
7674
7930
  verbose = false
7675
7931
  } = options;
7676
7932
  const normalizedPath = this.normalizePath(filePath);
7677
- const dir = this.normalizePath(dirname(normalizedPath));
7933
+ const dir = this.normalizePath(dirname2(normalizedPath));
7678
7934
  const fileExists = this.pathExists(normalizedPath);
7679
7935
  if (fileExists && !overwrite) {
7680
7936
  if (verbose) {
7681
- log2.info(`Skipping existing file: ${normalizedPath}`);
7937
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7682
7938
  }
7683
7939
  return false;
7684
7940
  }
7685
7941
  if (dryRun) {
7686
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7942
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7687
7943
  return true;
7688
7944
  }
7689
7945
  try {
@@ -7693,21 +7949,23 @@ var init_PathResolver = __esm({
7693
7949
  }
7694
7950
  const detectedFormat = this._detectFormat(filePath, format);
7695
7951
  let writeContent;
7696
- if (Buffer.isBuffer(content)) {
7952
+ if (Buffer2.isBuffer(content)) {
7697
7953
  writeContent = content;
7698
7954
  } else if (detectedFormat === "json" && typeof content === "object") {
7699
- writeContent = JSON.stringify(content, null, 2);
7955
+ writeContent = `${JSON.stringify(content, null, 2)}
7956
+ `;
7700
7957
  } else {
7701
7958
  writeContent = String(content);
7702
7959
  }
7703
7960
  try {
7704
- if (Buffer.isBuffer(writeContent)) {
7961
+ if (Buffer2.isBuffer(writeContent)) {
7705
7962
  fs.writeFileSync(normalizedPath, writeContent);
7706
7963
  } else {
7707
7964
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7708
7965
  }
7966
+ this._writtenPaths?.add(normalizedPath);
7709
7967
  if (verbose) {
7710
- log2.info(
7968
+ log3.info(
7711
7969
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7712
7970
  );
7713
7971
  }
@@ -7732,15 +7990,15 @@ var init_PathResolver = __esm({
7732
7990
  const fileExists = this.pathExists(normalizedDestPath);
7733
7991
  if (fileExists && !overwrite) {
7734
7992
  if (verbose) {
7735
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
7993
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7736
7994
  }
7737
7995
  return false;
7738
7996
  }
7739
7997
  if (dryRun) {
7740
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7998
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7741
7999
  return true;
7742
8000
  }
7743
- const dir = this.normalizePath(dirname(normalizedDestPath));
8001
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7744
8002
  try {
7745
8003
  await fs.promises.mkdir(dir, { recursive: true });
7746
8004
  } catch (error2) {
@@ -7750,7 +8008,7 @@ var init_PathResolver = __esm({
7750
8008
  return await safeExecuteAsync(async () => {
7751
8009
  await fs.promises.copyFile(srcPath, normalizedDestPath);
7752
8010
  if (verbose) {
7753
- log2.info(
8011
+ log3.info(
7754
8012
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7755
8013
  );
7756
8014
  }
@@ -7774,15 +8032,15 @@ var init_PathResolver = __esm({
7774
8032
  const fileExists = this.pathExists(normalizedDestPath);
7775
8033
  if (fileExists && !overwrite) {
7776
8034
  if (verbose) {
7777
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
8035
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7778
8036
  }
7779
8037
  return false;
7780
8038
  }
7781
8039
  if (dryRun) {
7782
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
8040
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7783
8041
  return true;
7784
8042
  }
7785
- const dir = this.normalizePath(dirname(normalizedDestPath));
8043
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7786
8044
  try {
7787
8045
  fs.mkdirSync(dir, { recursive: true });
7788
8046
  } catch (error2) {
@@ -7790,8 +8048,9 @@ var init_PathResolver = __esm({
7790
8048
  }
7791
8049
  try {
7792
8050
  fs.copyFileSync(srcPath, normalizedDestPath);
8051
+ this._writtenPaths?.add(normalizedDestPath);
7793
8052
  if (verbose) {
7794
- log2.info(
8053
+ log3.info(
7795
8054
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7796
8055
  );
7797
8056
  }
@@ -7808,7 +8067,7 @@ var init_PathResolver = __esm({
7808
8067
  return fs.existsSync(filePath);
7809
8068
  } catch (error2) {
7810
8069
  if (!silent) {
7811
- log2.error(`Error checking path existence: ${filePath}`, error2);
8070
+ log3.error(`Error checking path existence: ${filePath}`, error2);
7812
8071
  }
7813
8072
  return false;
7814
8073
  }
@@ -7834,7 +8093,7 @@ var init_PathResolver = __esm({
7834
8093
  return fs.readdirSync(dirPath, options);
7835
8094
  } catch (error2) {
7836
8095
  if (this.options.debug) {
7837
- log2.warn(`Failed to read directory: ${dirPath}`, error2);
8096
+ log3.warn(`Failed to read directory: ${dirPath}`, error2);
7838
8097
  }
7839
8098
  const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
7840
8099
  return isObjectOptions && options.withFileTypes ? [] : [];
@@ -7852,11 +8111,29 @@ var init_PathResolver = __esm({
7852
8111
  return fs.statSync(filePath);
7853
8112
  } catch (error2) {
7854
8113
  if (this.options.debug) {
7855
- log2.warn(`Failed to stat file: ${filePath}`, error2);
8114
+ log3.warn(`Failed to stat file: ${filePath}`, error2);
7856
8115
  }
7857
8116
  return null;
7858
8117
  }
7859
8118
  }
8119
+ /**
8120
+ * Resolve the real path of a file, following symlinks
8121
+ * @param filePath - Path to resolve
8122
+ * @returns Resolved real path
8123
+ */
8124
+ realpathSync(filePath) {
8125
+ return fs.realpathSync(filePath);
8126
+ }
8127
+ /**
8128
+ * Watch a directory for changes
8129
+ * @param dirPath - Directory to watch
8130
+ * @param options - fs.watch options
8131
+ * @param callback - Callback for change events
8132
+ * @returns FSWatcher instance
8133
+ */
8134
+ watch(dirPath, options, callback) {
8135
+ return fs.watch(dirPath, options, callback);
8136
+ }
7860
8137
  /**
7861
8138
  * Get file stats synchronously (follows symlinks)
7862
8139
  * Returns null if file doesn't exist (graceful degradation)
@@ -7869,7 +8146,7 @@ var init_PathResolver = __esm({
7869
8146
  return fs.lstatSync(filePath);
7870
8147
  } catch (error2) {
7871
8148
  if (this.options.debug) {
7872
- log2.warn(`Failed to lstat file: ${filePath}`, error2);
8149
+ log3.warn(`Failed to lstat file: ${filePath}`, error2);
7873
8150
  }
7874
8151
  return null;
7875
8152
  }
@@ -7936,6 +8213,28 @@ var init_PathResolver = __esm({
7936
8213
  * Get app root (where vite.config.ts is, Vite's config.root)
7937
8214
  * Falls back to repoRoot if not set
7938
8215
  */
8216
+ /**
8217
+ * Start recording every path written by writeSync/copySync.
8218
+ * Lets a generator know exactly which files the current run produced,
8219
+ * without comparing file timestamps to a clock.
8220
+ */
8221
+ startWriteRecording() {
8222
+ this._writtenPaths = /* @__PURE__ */ new Set();
8223
+ }
8224
+ /**
8225
+ * Stop recording and return the normalized paths written since
8226
+ * startWriteRecording().
8227
+ */
8228
+ stopWriteRecording() {
8229
+ if (!this._writtenPaths) {
8230
+ throw new Error(
8231
+ "stopWriteRecording() called without startWriteRecording()"
8232
+ );
8233
+ }
8234
+ const written = this._writtenPaths;
8235
+ this._writtenPaths = null;
8236
+ return written;
8237
+ }
7939
8238
  getAppRoot() {
7940
8239
  if (!this._appRoot) {
7941
8240
  return this._repoRoot;
@@ -7958,7 +8257,7 @@ var init_PathResolver = __esm({
7958
8257
  * @returns True if repoRoot is the monorepo (has packages directory)
7959
8258
  */
7960
8259
  isMonorepo() {
7961
- const packagesDir = join(this._repoRoot, "packages");
8260
+ const packagesDir = join2(this._repoRoot, "packages");
7962
8261
  return this.pathExists(packagesDir);
7963
8262
  }
7964
8263
  /**
@@ -7975,7 +8274,7 @@ var init_PathResolver = __esm({
7975
8274
  * Find files matching pattern within directory
7976
8275
  */
7977
8276
  async findFiles(directory, pattern, options = {}) {
7978
- const searchPattern = this.normalizePath(join(directory, pattern));
8277
+ const searchPattern = this.normalizePath(join2(directory, pattern));
7979
8278
  const appRoot = this.getAppRoot();
7980
8279
  const normalizeAppRoot = this.normalizePath(appRoot);
7981
8280
  const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
@@ -8022,7 +8321,7 @@ var init_PathResolver = __esm({
8022
8321
  return null;
8023
8322
  }
8024
8323
  const resolvedPath = this.normalizePath(
8025
- join(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8324
+ join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8026
8325
  );
8027
8326
  const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
8028
8327
  if (this.pathExists(resolvedDir)) {
@@ -8193,6 +8492,15 @@ var init_PathResolver = __esm({
8193
8492
  const cjsPath = this.getEmptyCjsModulePath();
8194
8493
  return cjsPath.replace(/\.cjs$/, ".js");
8195
8494
  }
8495
+ /**
8496
+ * Get absolute path to empty flag component module.
8497
+ * Returns `export default () => null;` — used by flag filtering plugins
8498
+ * to replace unused flag files at build time.
8499
+ */
8500
+ getEmptyFlagModulePath() {
8501
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8502
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8503
+ }
8196
8504
  /**
8197
8505
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8198
8506
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8218,13 +8526,13 @@ var init_PathResolver = __esm({
8218
8526
  const maxLevels = this.options.maxLevels;
8219
8527
  while (levelsChecked < maxLevels) {
8220
8528
  const toolingPath = this.normalizePath(
8221
- join(currentDir, PACKAGE_PATHS.TOOLING)
8529
+ join2(currentDir, PACKAGE_PATHS.TOOLING)
8222
8530
  );
8223
- const corePath = this.normalizePath(join(currentDir, PACKAGE_PATHS.CORE));
8531
+ const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
8224
8532
  if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
8225
8533
  return currentDir;
8226
8534
  }
8227
- const appsDir = join(currentDir, "apps");
8535
+ const appsDir = join2(currentDir, "apps");
8228
8536
  if (this.pathExists(appsDir)) {
8229
8537
  const appsDirStat = this.statSync(appsDir);
8230
8538
  if (appsDirStat?.isDirectory()) {
@@ -8232,15 +8540,15 @@ var init_PathResolver = __esm({
8232
8540
  }
8233
8541
  }
8234
8542
  const packageJsonPath = this.normalizePath(
8235
- join(currentDir, "package.json")
8543
+ join2(currentDir, "package.json")
8236
8544
  );
8237
8545
  if (this.pathExists(packageJsonPath)) {
8238
- const parentDir2 = this.normalizePath(dirname(currentDir));
8546
+ const parentDir2 = this.normalizePath(dirname2(currentDir));
8239
8547
  if (parentDir2 === currentDir) {
8240
8548
  return currentDir;
8241
8549
  }
8242
8550
  }
8243
- const parentDir = this.normalizePath(dirname(currentDir));
8551
+ const parentDir = this.normalizePath(dirname2(currentDir));
8244
8552
  if (parentDir === currentDir) {
8245
8553
  break;
8246
8554
  }
@@ -8256,8 +8564,8 @@ var init_PathResolver = __esm({
8256
8564
  // packages/tooling/src/utils/pathResolver.ts
8257
8565
  import { createRequire as createRequire2 } from "node:module";
8258
8566
  import {
8259
- join as join2,
8260
- dirname as dirname2,
8567
+ join as join3,
8568
+ dirname as dirname3,
8261
8569
  basename as basename2,
8262
8570
  extname as extname2,
8263
8571
  relative as relative2,
@@ -8266,7 +8574,7 @@ import {
8266
8574
  isAbsolute as pathIsAbsolute
8267
8575
  } from "node:path";
8268
8576
  import { fileURLToPath as fileURLToPath2 } from "node:url";
8269
- function readdirSync2(dirPath, options) {
8577
+ function readdirSync3(dirPath, options) {
8270
8578
  return pathResolverInstance.readdirSync(dirPath, options);
8271
8579
  }
8272
8580
  var pathResolverInstance, getRepoRoot, normalizePath, pathExists, readSync, writeSync, statSync2, joinPath;
@@ -8278,7 +8586,7 @@ var init_pathResolver = __esm({
8278
8586
  pathResolverInstance = PathResolver.getInstance({ debug: false });
8279
8587
  getRepoRoot = () => pathResolverInstance.getRepoRoot();
8280
8588
  normalizePath = (...pathSegments) => {
8281
- return pathResolverInstance.normalizePath(join2(...pathSegments));
8589
+ return pathResolverInstance.normalizePath(join3(...pathSegments));
8282
8590
  };
8283
8591
  pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
8284
8592
  readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
@@ -8337,10 +8645,10 @@ var init_typed_file_operations = __esm({
8337
8645
  });
8338
8646
 
8339
8647
  // packages/tooling/src/bundler/utils.ts
8340
- import { Buffer } from "node:buffer";
8648
+ import { Buffer as Buffer2 } from "node:buffer";
8341
8649
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8342
8650
  import { createRequire as createRequire3 } from "node:module";
8343
- import { dirname as dirname3, resolve as resolve3 } from "node:path";
8651
+ import { dirname as dirname4, resolve as resolve3 } from "node:path";
8344
8652
  import process from "node:process";
8345
8653
  import { fileURLToPath as fileURLToPath3 } from "node:url";
8346
8654
  var require2, __filename, __dirname;
@@ -8349,12 +8657,12 @@ var init_utils2 = __esm({
8349
8657
  "use strict";
8350
8658
  require2 = createRequire3(import.meta.url);
8351
8659
  __filename = fileURLToPath3(import.meta.url);
8352
- __dirname = dirname3(__filename);
8660
+ __dirname = dirname4(__filename);
8353
8661
  if (typeof globalThis !== "undefined") {
8354
8662
  globalThis.require = require2;
8355
8663
  globalThis.__filename = __filename;
8356
8664
  globalThis.__dirname = __dirname;
8357
- globalThis.Buffer = Buffer;
8665
+ globalThis.Buffer = Buffer2;
8358
8666
  globalThis.process = process;
8359
8667
  if (typeof global === "undefined") {
8360
8668
  globalThis.global = globalThis;
@@ -8381,7 +8689,7 @@ function detectApps(projectRoot) {
8381
8689
  const appsDir = joinPath(projectRoot, "apps");
8382
8690
  const appsDirStat = statSync2(appsDir);
8383
8691
  if (pathExists(appsDir) && appsDirStat?.isDirectory()) {
8384
- const appDirs = readdirSync2(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
8692
+ const appDirs = readdirSync3(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
8385
8693
  for (const appDir of appDirs) {
8386
8694
  const appPath = joinPath(appsDir, appDir);
8387
8695
  const packageJsonPath = joinPath(appPath, "package.json");
@@ -8558,17 +8866,17 @@ var init_app_detection = __esm({
8558
8866
  async function selectApp(projectRoot, appName) {
8559
8867
  const apps = detectApps(projectRoot);
8560
8868
  if (apps.length === 0) {
8561
- log.error("No apps found in this project.");
8562
- log.info('Run "dndev init" to create a new project.');
8869
+ log2.error("No apps found in this project.");
8870
+ log2.info('Run "dndev init" to create a new project.');
8563
8871
  return null;
8564
8872
  }
8565
8873
  if (appName) {
8566
- const app = apps.find((a) => a.name === appName);
8874
+ const app = apps.find((a2) => a2.name === appName);
8567
8875
  if (!app) {
8568
- log.warn(`App "${appName}" not found.`);
8569
- log.info("Available apps:");
8570
- apps.forEach((a) => log.info(` - ${a.name}`));
8571
- log.info("Please select from the list:");
8876
+ log2.warn(`App "${appName}" not found.`);
8877
+ log2.info("Available apps:");
8878
+ apps.forEach((a2) => log2.info(` - ${a2.name}`));
8879
+ log2.info("Please select from the list:");
8572
8880
  } else {
8573
8881
  return app;
8574
8882
  }
@@ -8576,7 +8884,7 @@ async function selectApp(projectRoot, appName) {
8576
8884
  if (apps.length === 1) {
8577
8885
  return apps[0] || null;
8578
8886
  }
8579
- const selected = await _t({
8887
+ const selected = await select({
8580
8888
  message: "Select app:",
8581
8889
  options: apps.map((app) => ({
8582
8890
  value: app.name,
@@ -8586,7 +8894,7 @@ async function selectApp(projectRoot, appName) {
8586
8894
  if (typeof selected !== "string") {
8587
8895
  return null;
8588
8896
  }
8589
- return apps.find((a) => a.name === selected) || null;
8897
+ return apps.find((a2) => a2.name === selected) || null;
8590
8898
  }
8591
8899
  var init_app_selector = __esm({
8592
8900
  "packages/tooling/src/utils/app-selector.ts"() {
@@ -8605,14 +8913,14 @@ async function askForMultiSelection(message, choices, defaultIndices = []) {
8605
8913
  label: choice.title,
8606
8914
  hint: choice.hint
8607
8915
  }));
8608
- const initialValues = defaultIndices.map((i) => choices[i]?.value).filter(Boolean);
8609
- const result = await yt({
8916
+ const initialValues = defaultIndices.map((i2) => choices[i2]?.value).filter(Boolean);
8917
+ const result = await multiselect({
8610
8918
  message,
8611
8919
  options,
8612
8920
  initialValues: initialValues.length > 0 ? initialValues : void 0
8613
8921
  });
8614
- if (q(result)) {
8615
- pt("Operation cancelled.");
8922
+ if (isCancel(result)) {
8923
+ cancel("Operation cancelled.");
8616
8924
  process.exit(0);
8617
8925
  }
8618
8926
  return result;
@@ -8695,13 +9003,13 @@ init_utils2();
8695
9003
 
8696
9004
  // packages/tooling/src/apps/emu-firebase.ts
8697
9005
  init_utils2();
9006
+ init_app_detection();
8698
9007
  init_cli_input();
8699
9008
  init_cli_output();
8700
9009
  init_pathResolver();
8701
9010
  import { spawnSync as spawnSync2, execFileSync } from "node:child_process";
8702
9011
  import { platform as platform2 } from "node:os";
8703
9012
  init_typed_file_operations();
8704
- init_app_detection();
8705
9013
  function discoverFirebaseProjectId(appPath) {
8706
9014
  const firebasercPath = joinPath(appPath, ".firebaserc");
8707
9015
  if (pathExists(firebasercPath)) {
@@ -8742,7 +9050,7 @@ function killPorts(ports) {
8742
9050
  for (const pid of Array.from(pids)) {
8743
9051
  try {
8744
9052
  execFileSync("taskkill", ["/F", "/PID", pid], { stdio: "ignore" });
8745
- log.debug(`Killed process ${pid} on port ${port}`);
9053
+ log2.debug(`Killed process ${pid} on port ${port}`);
8746
9054
  } catch {
8747
9055
  }
8748
9056
  }
@@ -8756,7 +9064,7 @@ function killPorts(ports) {
8756
9064
  for (const pid of pids) {
8757
9065
  try {
8758
9066
  process.kill(Number(pid), "SIGKILL");
8759
- log.debug(`Killed process ${pid} on port ${port}`);
9067
+ log2.debug(`Killed process ${pid} on port ${port}`);
8760
9068
  } catch {
8761
9069
  }
8762
9070
  }
@@ -8826,7 +9134,7 @@ async function startFirebase(app, projectRoot, options = {}) {
8826
9134
  hint: "Stripe webhook forwarding (for payment testing)"
8827
9135
  }
8828
9136
  ];
8829
- log.info(`Starting Firebase emulators + dev server for ${app.name}...
9137
+ log2.info(`Starting Firebase emulators + dev server for ${app.name}...
8830
9138
  `);
8831
9139
  if (selectedServices.length === 0) {
8832
9140
  selectedServices = await askForMultiSelection(
@@ -8836,7 +9144,7 @@ async function startFirebase(app, projectRoot, options = {}) {
8836
9144
  // Default: Functions and Firestore
8837
9145
  );
8838
9146
  } else {
8839
- log.info(`Selected services: ${selectedServices.join(", ")}
9147
+ log2.info(`Selected services: ${selectedServices.join(", ")}
8840
9148
  `);
8841
9149
  }
8842
9150
  const useAuth = selectedServices.includes("auth");
@@ -8844,16 +9152,16 @@ async function startFirebase(app, projectRoot, options = {}) {
8844
9152
  const useFirestore = selectedServices.includes("firestore");
8845
9153
  const useStripe = selectedServices.includes("stripe");
8846
9154
  if (!useFunctions) {
8847
- log.error("Functions emulator is required for Firebase apps.");
9155
+ log2.error("Functions emulator is required for Firebase apps.");
8848
9156
  return 1;
8849
9157
  }
8850
9158
  const functionsDir = getFunctionsPath(app);
8851
9159
  const envLocalPath = joinPath(functionsDir, ".env.local");
8852
9160
  if (pathExists(envLocalPath)) {
8853
9161
  loadEnvFile(envLocalPath);
8854
- log.debug("Loaded functions/.env.local for emulator context");
9162
+ log2.debug("Loaded functions/.env.local for emulator context");
8855
9163
  } else {
8856
- log.warn(
9164
+ log2.warn(
8857
9165
  "No .env.local found in functions directory. Emulator may lack required secrets."
8858
9166
  );
8859
9167
  }
@@ -8869,7 +9177,7 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
8869
9177
  ` : `FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
8870
9178
  `;
8871
9179
  writeSync(envLocalPath, newContent);
8872
- log.debug("Set FIREBASE_AUTH_EMULATOR_HOST in functions/.env.local");
9180
+ log2.debug("Set FIREBASE_AUTH_EMULATOR_HOST in functions/.env.local");
8873
9181
  } else if (!useAuth && hasAuthEmulatorHost) {
8874
9182
  const lines = existingContent.split("\n");
8875
9183
  const filteredLines = lines.filter(
@@ -8877,12 +9185,12 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
8877
9185
  );
8878
9186
  const newContent = filteredLines.join("\n");
8879
9187
  writeSync(envLocalPath, newContent);
8880
- log.debug(
9188
+ log2.debug(
8881
9189
  "Removed FIREBASE_AUTH_EMULATOR_HOST from functions/.env.local"
8882
9190
  );
8883
9191
  }
8884
9192
  }
8885
- log.info("Building functions...");
9193
+ log2.info("Building functions...");
8886
9194
  const buildResult = spawnSync2("bun", ["run", "build"], {
8887
9195
  cwd: functionsDir,
8888
9196
  stdio: "pipe",
@@ -8898,7 +9206,7 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
8898
9206
  if (buildResult.stderr) {
8899
9207
  process.stderr.write(buildResult.stderr);
8900
9208
  }
8901
- log.error("Functions build failed. Fix errors and try again.");
9209
+ log2.error("Functions build failed. Fix errors and try again.");
8902
9210
  return 1;
8903
9211
  }
8904
9212
  const appFirebaseJson = joinPath(app.path, "firebase.json");
@@ -8914,7 +9222,7 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
8914
9222
  }
8915
9223
  const ports = getEmulatorPorts(emulatorConfig);
8916
9224
  if (ports.length > 0) {
8917
- log.info("Clearing ports...");
9225
+ log2.info("Clearing ports...");
8918
9226
  killPorts(ports);
8919
9227
  }
8920
9228
  const emulatorsToStart = [];
@@ -8956,12 +9264,12 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
8956
9264
  if (useStripe && projectId) {
8957
9265
  const stripeWebhookUrl = `http://localhost:5001/${projectId}/${region}/stripeWebhook`;
8958
9266
  concurrentlyArgs.push(`stripe listen --forward-to ${stripeWebhookUrl}`);
8959
- log.info("");
8960
- log.info("Stripe webhook forwarding will start automatically");
8961
- log.info(` Webhook URL: ${stripeWebhookUrl}`);
8962
- log.info(" To trigger test events, run in another terminal:");
8963
- log.info(" stripe trigger checkout.session.completed");
8964
- log.info("");
9267
+ log2.info("");
9268
+ log2.info("Stripe webhook forwarding will start automatically");
9269
+ log2.info(` Webhook URL: ${stripeWebhookUrl}`);
9270
+ log2.info(" To trigger test events, run in another terminal:");
9271
+ log2.info(" stripe trigger checkout.session.completed");
9272
+ log2.info("");
8965
9273
  }
8966
9274
  const isWindows = platform2() === "win32";
8967
9275
  const childProcess = spawnCrossPlatform(
@@ -8982,7 +9290,7 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
8982
9290
  };
8983
9291
  const cleanup = (signal) => {
8984
9292
  if (!childProcess.pid) return;
8985
- log.debug(`Received ${signal}, cleaning up processes...`);
9293
+ log2.debug(`Received ${signal}, cleaning up processes...`);
8986
9294
  if (isWindows) {
8987
9295
  try {
8988
9296
  execFileSync(
@@ -9014,7 +9322,7 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
9014
9322
  for (const signal of signals) {
9015
9323
  const handler = () => {
9016
9324
  cleanup(signal);
9017
- handlers.forEach((h) => h());
9325
+ handlers.forEach((h2) => h2());
9018
9326
  process.exit(SIGNAL_EXIT_CODES[signal] ?? 130);
9019
9327
  };
9020
9328
  process.on(signal, handler);
@@ -9022,17 +9330,17 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
9022
9330
  }
9023
9331
  return new Promise((resolve4) => {
9024
9332
  childProcess.on("exit", (code, signal) => {
9025
- handlers.forEach((h) => h());
9333
+ handlers.forEach((h2) => h2());
9026
9334
  if (signal) {
9027
- log.debug(`Process killed by signal: ${signal}`);
9335
+ log2.debug(`Process killed by signal: ${signal}`);
9028
9336
  resolve4(SIGNAL_EXIT_CODES[signal] ?? 130);
9029
9337
  } else {
9030
9338
  resolve4(code ?? 0);
9031
9339
  }
9032
9340
  });
9033
9341
  childProcess.on("error", (error2) => {
9034
- handlers.forEach((h) => h());
9035
- log.error(`Failed to start Firebase emulators: ${error2.message}`);
9342
+ handlers.forEach((h2) => h2());
9343
+ log2.error(`Failed to start Firebase emulators: ${error2.message}`);
9036
9344
  resolve4(1);
9037
9345
  });
9038
9346
  });
@@ -9052,18 +9360,18 @@ function isDockerRunning() {
9052
9360
  }
9053
9361
  }
9054
9362
  async function startSupabase(app, _projectRoot) {
9055
- log.info(`Starting Supabase local stack + dev server for ${app.name}...
9363
+ log2.info(`Starting Supabase local stack + dev server for ${app.name}...
9056
9364
  `);
9057
9365
  if (!isDockerRunning()) {
9058
- log.error("Docker is not running. Supabase local dev requires Docker.");
9059
- log.error("Start Docker Desktop and try again.\n");
9366
+ log2.error("Docker is not running. Supabase local dev requires Docker.");
9367
+ log2.error("Start Docker Desktop and try again.\n");
9060
9368
  return 1;
9061
9369
  }
9062
9370
  try {
9063
9371
  execSync2("supabase --version", { stdio: "pipe" });
9064
9372
  } catch {
9065
- log.error("Supabase CLI not found. Install it:");
9066
- log.error(" bun install -g supabase\n");
9373
+ log2.error("Supabase CLI not found. Install it:");
9374
+ log2.error(" bun install -g supabase\n");
9067
9375
  return 1;
9068
9376
  }
9069
9377
  const isWindows = platform3() === "win32";
@@ -9118,7 +9426,7 @@ async function startSupabase(app, _projectRoot) {
9118
9426
  return new Promise((resolve4) => {
9119
9427
  childProcess.on("exit", (code) => resolve4(code ?? 0));
9120
9428
  childProcess.on("error", (error2) => {
9121
- log.error(`Failed to start Supabase local dev: ${error2.message}`);
9429
+ log2.error(`Failed to start Supabase local dev: ${error2.message}`);
9122
9430
  resolve4(1);
9123
9431
  });
9124
9432
  });
@@ -9130,13 +9438,13 @@ init_cli_output();
9130
9438
  import { execFileSync as execFileSync3, execSync as execSync3 } from "node:child_process";
9131
9439
  import { platform as platform4 } from "node:os";
9132
9440
  async function startVercel(app, _projectRoot) {
9133
- log.info(`Starting Vercel dev server for ${app.name}...
9441
+ log2.info(`Starting Vercel dev server for ${app.name}...
9134
9442
  `);
9135
9443
  try {
9136
9444
  execSync3("vercel --version", { stdio: "pipe" });
9137
9445
  } catch {
9138
- log.error("Vercel CLI not found. Install it:");
9139
- log.error(" bun install -g vercel\n");
9446
+ log2.error("Vercel CLI not found. Install it:");
9447
+ log2.error(" bun install -g vercel\n");
9140
9448
  return 1;
9141
9449
  }
9142
9450
  const isWindows = platform4() === "win32";
@@ -9176,7 +9484,7 @@ async function startVercel(app, _projectRoot) {
9176
9484
  return new Promise((resolve4) => {
9177
9485
  childProcess.on("exit", (code) => resolve4(code ?? 0));
9178
9486
  childProcess.on("error", (error2) => {
9179
- log.error(`Failed to start Vercel dev: ${error2.message}`);
9487
+ log2.error(`Failed to start Vercel dev: ${error2.message}`);
9180
9488
  resolve4(1);
9181
9489
  });
9182
9490
  });
@@ -9207,10 +9515,10 @@ async function main(options) {
9207
9515
  switch (emuTarget) {
9208
9516
  case "firebase": {
9209
9517
  if (!app.functions) {
9210
- log.error(
9518
+ log2.error(
9211
9519
  `App "${app.name}" has Firebase config but no functions directory.`
9212
9520
  );
9213
- log.error('Use "dndev dev" for apps without backend functions.\n');
9521
+ log2.error('Use "dndev dev" for apps without backend functions.\n');
9214
9522
  return 1;
9215
9523
  }
9216
9524
  const selectedServices = parseFirebaseServices(args, options);
@@ -9224,11 +9532,11 @@ async function main(options) {
9224
9532
  case "vercel":
9225
9533
  return startVercel(app, projectRoot);
9226
9534
  default:
9227
- log.error(`App "${app.name}" does not have a detected backend.`);
9228
- log.error(
9535
+ log2.error(`App "${app.name}" does not have a detected backend.`);
9536
+ log2.error(
9229
9537
  "Expected: firebase.json (Firebase), supabase/config.toml or @donotdev/supabase (Supabase), or vercel.json (Vercel)."
9230
9538
  );
9231
- log.error('Use "dndev dev" for apps without a backend.\n');
9539
+ log2.error('Use "dndev dev" for apps without a backend.\n');
9232
9540
  return 1;
9233
9541
  }
9234
9542
  }