@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 __export = (target, all) => {
20
29
  for (var name in all)
@@ -37,31 +46,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
37
46
  mod
38
47
  ));
39
48
 
40
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
41
- var isAmbiguous, isFullWidth, isWide;
49
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
50
+ var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
42
51
  var init_utils = __esm({
43
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js"() {
52
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
44
53
  init_utils2();
45
- isAmbiguous = (x) => {
46
- 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;
47
- };
54
+ getCodePointsLength = /* @__PURE__ */ (() => {
55
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
56
+ return (input) => {
57
+ let surrogatePairsNr = 0;
58
+ SURROGATE_PAIR_RE.lastIndex = 0;
59
+ while (SURROGATE_PAIR_RE.test(input)) {
60
+ surrogatePairsNr += 1;
61
+ }
62
+ return input.length - surrogatePairsNr;
63
+ };
64
+ })();
48
65
  isFullWidth = (x) => {
49
66
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
50
67
  };
51
- isWide = (x) => {
52
- 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;
68
+ isWideNotCJKTNotEmoji = (x) => {
69
+ 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;
53
70
  };
54
71
  }
55
72
  });
56
73
 
57
- // node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
58
- var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
74
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
75
+ var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
59
76
  var init_dist = __esm({
60
- "node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js"() {
77
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
61
78
  init_utils2();
62
79
  init_utils();
63
- ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
80
+ ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
64
81
  CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
82
+ 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;
65
83
  TAB_RE = /\t{1,1000}/y;
66
84
  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");
67
85
  LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -71,14 +89,21 @@ var init_dist = __esm({
71
89
  const LIMIT = truncationOptions.limit ?? Infinity;
72
90
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
73
91
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
74
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
92
+ const ANSI_WIDTH = 0;
75
93
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
76
94
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
77
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
78
95
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
79
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
96
+ const FULL_WIDTH_WIDTH = 2;
80
97
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
81
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
98
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
99
+ const PARSE_BLOCKS = [
100
+ [LATIN_RE, REGULAR_WIDTH],
101
+ [ANSI_RE, ANSI_WIDTH],
102
+ [CONTROL_RE, CONTROL_WIDTH],
103
+ [TAB_RE, TAB_WIDTH],
104
+ [EMOJI_RE, EMOJI_WIDTH],
105
+ [CJKT_WIDE_RE, WIDE_WIDTH]
106
+ ];
82
107
  let indexPrev = 0;
83
108
  let index = 0;
84
109
  let length = input.length;
@@ -98,10 +123,8 @@ var init_dist = __esm({
98
123
  const codePoint = char.codePointAt(0) || 0;
99
124
  if (isFullWidth(codePoint)) {
100
125
  widthExtra = FULL_WIDTH_WIDTH;
101
- } else if (isWide(codePoint)) {
126
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
102
127
  widthExtra = WIDE_WIDTH;
103
- } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
104
- widthExtra = AMBIGUOUS_WIDTH;
105
128
  } else {
106
129
  widthExtra = REGULAR_WIDTH;
107
130
  }
@@ -117,88 +140,28 @@ var init_dist = __esm({
117
140
  }
118
141
  unmatchedStart = unmatchedEnd = 0;
119
142
  }
120
- if (index >= length)
121
- break;
122
- LATIN_RE.lastIndex = index;
123
- if (LATIN_RE.test(input)) {
124
- lengthExtra = LATIN_RE.lastIndex - index;
125
- widthExtra = lengthExtra * REGULAR_WIDTH;
126
- if (width + widthExtra > truncationLimit) {
127
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
128
- }
129
- if (width + widthExtra > LIMIT) {
130
- truncationEnabled = true;
131
- break;
132
- }
133
- width += widthExtra;
134
- unmatchedStart = indexPrev;
135
- unmatchedEnd = index;
136
- index = indexPrev = LATIN_RE.lastIndex;
137
- continue;
138
- }
139
- ANSI_RE.lastIndex = index;
140
- if (ANSI_RE.test(input)) {
141
- if (width + ANSI_WIDTH > truncationLimit) {
142
- truncationIndex = Math.min(truncationIndex, index);
143
- }
144
- if (width + ANSI_WIDTH > LIMIT) {
145
- truncationEnabled = true;
146
- break;
147
- }
148
- width += ANSI_WIDTH;
149
- unmatchedStart = indexPrev;
150
- unmatchedEnd = index;
151
- index = indexPrev = ANSI_RE.lastIndex;
152
- continue;
153
- }
154
- CONTROL_RE.lastIndex = index;
155
- if (CONTROL_RE.test(input)) {
156
- lengthExtra = CONTROL_RE.lastIndex - index;
157
- widthExtra = lengthExtra * CONTROL_WIDTH;
158
- if (width + widthExtra > truncationLimit) {
159
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
160
- }
161
- if (width + widthExtra > LIMIT) {
162
- truncationEnabled = true;
163
- break;
164
- }
165
- width += widthExtra;
166
- unmatchedStart = indexPrev;
167
- unmatchedEnd = index;
168
- index = indexPrev = CONTROL_RE.lastIndex;
169
- continue;
170
- }
171
- TAB_RE.lastIndex = index;
172
- if (TAB_RE.test(input)) {
173
- lengthExtra = TAB_RE.lastIndex - index;
174
- widthExtra = lengthExtra * TAB_WIDTH;
175
- if (width + widthExtra > truncationLimit) {
176
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
177
- }
178
- if (width + widthExtra > LIMIT) {
179
- truncationEnabled = true;
180
- break;
181
- }
182
- width += widthExtra;
183
- unmatchedStart = indexPrev;
184
- unmatchedEnd = index;
185
- index = indexPrev = TAB_RE.lastIndex;
186
- continue;
143
+ if (index >= length) {
144
+ break outer;
187
145
  }
188
- EMOJI_RE.lastIndex = index;
189
- if (EMOJI_RE.test(input)) {
190
- if (width + EMOJI_WIDTH > truncationLimit) {
191
- truncationIndex = Math.min(truncationIndex, index);
192
- }
193
- if (width + EMOJI_WIDTH > LIMIT) {
194
- truncationEnabled = true;
195
- break;
146
+ for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
147
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
148
+ BLOCK_RE.lastIndex = index;
149
+ if (BLOCK_RE.test(input)) {
150
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
151
+ widthExtra = lengthExtra * BLOCK_WIDTH;
152
+ if (width + widthExtra > truncationLimit) {
153
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
154
+ }
155
+ if (width + widthExtra > LIMIT) {
156
+ truncationEnabled = true;
157
+ break outer;
158
+ }
159
+ width += widthExtra;
160
+ unmatchedStart = indexPrev;
161
+ unmatchedEnd = index;
162
+ index = indexPrev = BLOCK_RE.lastIndex;
163
+ continue outer;
196
164
  }
197
- width += EMOJI_WIDTH;
198
- unmatchedStart = indexPrev;
199
- unmatchedEnd = index;
200
- index = indexPrev = EMOJI_RE.lastIndex;
201
- continue;
202
165
  }
203
166
  index += 1;
204
167
  }
@@ -213,10 +176,10 @@ var init_dist = __esm({
213
176
  }
214
177
  });
215
178
 
216
- // node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
179
+ // node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
217
180
  var NO_TRUNCATION2, fastStringWidth, dist_default2;
218
181
  var init_dist2 = __esm({
219
- "node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js"() {
182
+ "node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
220
183
  init_utils2();
221
184
  init_dist();
222
185
  NO_TRUNCATION2 = {
@@ -231,13 +194,13 @@ var init_dist2 = __esm({
231
194
  }
232
195
  });
233
196
 
234
- // node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
197
+ // node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
235
198
  function wrapAnsi(string, columns, options) {
236
199
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
237
200
  }
238
201
  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;
239
202
  var init_main = __esm({
240
- "node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js"() {
203
+ "node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
241
204
  init_utils2();
242
205
  init_dist2();
243
206
  ESC = "\x1B";
@@ -401,16 +364,19 @@ var init_main = __esm({
401
364
  }
402
365
  const preString = rows.join("\n");
403
366
  let inSurrogate = false;
404
- for (let i = 0; i < preString.length; i++) {
405
- const character = preString[i];
367
+ for (let i2 = 0; i2 < preString.length; i2++) {
368
+ const character = preString[i2];
406
369
  returnValue += character;
407
370
  if (!inSurrogate) {
408
371
  inSurrogate = character >= "\uD800" && character <= "\uDBFF";
372
+ if (inSurrogate) {
373
+ continue;
374
+ }
409
375
  } else {
410
- continue;
376
+ inSurrogate = false;
411
377
  }
412
378
  if (character === ESC || character === CSI) {
413
- GROUP_REGEX.lastIndex = i + 1;
379
+ GROUP_REGEX.lastIndex = i2 + 1;
414
380
  const groupsResult = GROUP_REGEX.exec(preString);
415
381
  const groups = groupsResult?.groups;
416
382
  if (groups?.code !== void 0) {
@@ -420,7 +386,7 @@ var init_main = __esm({
420
386
  escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
421
387
  }
422
388
  }
423
- if (preString[i + 1] === "\n") {
389
+ if (preString[i2 + 1] === "\n") {
424
390
  if (escapeUrl) {
425
391
  returnValue += wrapAnsiHyperlink("");
426
392
  }
@@ -451,7 +417,7 @@ var require_src = __commonJS({
451
417
  var ESC2 = "\x1B";
452
418
  var CSI2 = `${ESC2}[`;
453
419
  var beep = "\x07";
454
- var cursor = {
420
+ var cursor3 = {
455
421
  to(x, y2) {
456
422
  if (!y2) return `${CSI2}${x + 1}G`;
457
423
  return `${CSI2}${y2 + 1};${x + 1}H`;
@@ -480,7 +446,7 @@ var require_src = __commonJS({
480
446
  up: (count = 1) => `${CSI2}S`.repeat(count),
481
447
  down: (count = 1) => `${CSI2}T`.repeat(count)
482
448
  };
483
- var erase = {
449
+ var erase3 = {
484
450
  screen: `${CSI2}2J`,
485
451
  up: (count = 1) => `${CSI2}1J`.repeat(count),
486
452
  down: (count = 1) => `${CSI2}J`.repeat(count),
@@ -489,89 +455,169 @@ var require_src = __commonJS({
489
455
  lineStart: `${CSI2}1K`,
490
456
  lines(count) {
491
457
  let clear = "";
492
- for (let i = 0; i < count; i++)
493
- clear += this.line + (i < count - 1 ? cursor.up() : "");
458
+ for (let i2 = 0; i2 < count; i2++)
459
+ clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
494
460
  if (count)
495
- clear += cursor.left;
461
+ clear += cursor3.left;
496
462
  return clear;
497
463
  }
498
464
  };
499
- module.exports = { cursor, scroll, erase, beep };
465
+ module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
500
466
  }
501
467
  });
502
468
 
503
- // node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
504
- import { styleText as y } from "node:util";
505
- import { stdout as S, stdin as $ } from "node:process";
506
- import * as _ from "node:readline";
507
- import P from "node:readline";
508
- import { ReadStream as D } from "node:tty";
509
- function d(r, t2, e) {
510
- if (!e.some((o) => !o.disabled)) return r;
511
- const s = r + t2, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
512
- return e[n].disabled ? d(n, t2 < 0 ? -1 : 1, e) : n;
469
+ // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
470
+ import { styleText } from "node:util";
471
+ import { stdout, stdin } from "node:process";
472
+ import * as l from "node:readline";
473
+ import l__default from "node:readline";
474
+ import { ReadStream } from "node:tty";
475
+ function findCursor(s, o, l2) {
476
+ if (!l2.some((r2) => !r2.disabled))
477
+ return s;
478
+ const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
479
+ return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
480
+ }
481
+ function isAccessible(n3) {
482
+ if (n3 !== void 0) return n3;
483
+ if (settings.accessible !== void 0) return settings.accessible;
484
+ const e = process.env.ACCESSIBLE;
485
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
513
486
  }
514
- function V(r, t2) {
515
- if (typeof r == "string") return u.aliases.get(r) === t2;
516
- for (const e of r) if (e !== void 0 && V(e, t2)) return true;
487
+ function isActionKey(n3, e) {
488
+ if (typeof n3 == "string")
489
+ return settings.aliases.get(n3) === e;
490
+ for (const s of n3)
491
+ if (s !== void 0 && isActionKey(s, e))
492
+ return true;
517
493
  return false;
518
494
  }
519
- function j(r, t2) {
520
- if (r === t2) return;
521
- const e = r.split(`
522
- `), s = t2.split(`
523
- `), i = Math.max(e.length, s.length), n = [];
524
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
525
- return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
495
+ function diffLines(i2, s) {
496
+ if (i2 === s) return;
497
+ const e = i2.split(`
498
+ `), t2 = s.split(`
499
+ `), r2 = Math.max(e.length, t2.length), f = [];
500
+ for (let n3 = 0; n3 < r2; n3++)
501
+ e[n3] !== t2[n3] && f.push(n3);
502
+ return {
503
+ lines: f,
504
+ numLinesBefore: e.length,
505
+ numLinesAfter: t2.length,
506
+ numLines: r2
507
+ };
526
508
  }
527
- function q(r) {
528
- return r === C;
509
+ function isCancel(e) {
510
+ return e === CANCEL_SYMBOL;
529
511
  }
530
- function w(r, t2) {
531
- const e = r;
532
- e.isTTY && e.setRawMode(t2);
512
+ function setRawMode(e, r2) {
513
+ const o = e;
514
+ o.isTTY && o.setRawMode(r2);
533
515
  }
534
- function z({ input: r = $, output: t2 = S, overwrite: e = true, hideCursor: s = true } = {}) {
535
- const i = _.createInterface({ input: r, output: t2, prompt: "", tabSize: 1 });
536
- _.emitKeypressEvents(r, i), r instanceof D && r.isTTY && r.setRawMode(true);
537
- const n = (o, { name: a, sequence: h }) => {
538
- const l = String(o);
539
- if (V([l, a, h], "cancel")) {
540
- s && t2.write(import_sisteransi.cursor.show), process.exit(0);
516
+ function block({
517
+ input: e = stdin,
518
+ output: r2 = stdout,
519
+ overwrite: o = true,
520
+ hideCursor: n3 = true
521
+ } = {}) {
522
+ const s = l.createInterface({
523
+ input: e,
524
+ output: r2,
525
+ prompt: "",
526
+ tabSize: 1
527
+ });
528
+ l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
529
+ const t2 = (f, { name: a2, sequence: w }) => {
530
+ const c2 = String(f);
531
+ if (isActionKey([c2, a2, w], "cancel")) {
532
+ n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
541
533
  return;
542
534
  }
543
- if (!e) return;
544
- const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
545
- _.moveCursor(t2, f, v, () => {
546
- _.clearLine(t2, 1, () => {
547
- r.once("keypress", n);
535
+ if (!o) return;
536
+ const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
537
+ l.moveCursor(r2, i2, m, () => {
538
+ l.clearLine(r2, 1, () => {
539
+ e.once("keypress", t2);
548
540
  });
549
541
  });
550
542
  };
551
- return s && t2.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
552
- r.off("keypress", n), s && t2.write(import_sisteransi.cursor.show), r instanceof D && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
543
+ return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
544
+ e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
553
545
  };
554
546
  }
555
- function R(r, t2, e, s = e) {
556
- const i = O(r ?? S);
557
- return wrapAnsi(t2, i - e.length, { hard: true, trim: false }).split(`
558
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
547
+ function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
548
+ const f = getColumns(e ?? stdout);
549
+ return wrapAnsi(r2, f - o.length, {
550
+ hard: true,
551
+ trim: false
552
+ }).split(`
553
+ `).map((c2, i2, m) => {
554
+ const d = t2 ? t2(c2, i2) : c2;
555
+ return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
556
+ }).join(`
559
557
  `);
560
558
  }
561
- var import_sisteransi, E, G, u, Y, C, O, A, p, Q, nt, at;
559
+ function runValidation(e, a2) {
560
+ if ("~standard" in e) {
561
+ const n3 = e["~standard"].validate(a2);
562
+ return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
563
+ }
564
+ return e(a2);
565
+ }
566
+ var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, r, n$1, n2;
562
567
  var init_dist3 = __esm({
563
- "node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs"() {
568
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
564
569
  init_utils2();
565
570
  init_main();
566
571
  import_sisteransi = __toESM(require_src(), 1);
567
- E = ["up", "down", "left", "right", "space", "enter", "cancel"];
568
- G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
569
- 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)}` } } };
570
- Y = globalThis.process.platform.startsWith("win");
571
- C = /* @__PURE__ */ Symbol("clack:cancel");
572
- O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
573
- A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
574
- p = class {
572
+ a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
573
+ t = [
574
+ "January",
575
+ "February",
576
+ "March",
577
+ "April",
578
+ "May",
579
+ "June",
580
+ "July",
581
+ "August",
582
+ "September",
583
+ "October",
584
+ "November",
585
+ "December"
586
+ ];
587
+ settings = {
588
+ actions: new Set(a$1),
589
+ aliases: /* @__PURE__ */ new Map([
590
+ // vim support
591
+ ["k", "up"],
592
+ ["j", "down"],
593
+ ["h", "left"],
594
+ ["l", "right"],
595
+ ["", "cancel"],
596
+ // opinionated defaults!
597
+ ["escape", "cancel"]
598
+ ]),
599
+ messages: {
600
+ cancel: "Canceled",
601
+ error: "Something went wrong"
602
+ },
603
+ withGuide: true,
604
+ accessible: void 0,
605
+ date: {
606
+ monthNames: [...t],
607
+ messages: {
608
+ required: "Please enter a valid date",
609
+ invalidMonth: "There are only 12 months in a year",
610
+ invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
611
+ afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
612
+ beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
613
+ }
614
+ }
615
+ };
616
+ R = globalThis.process.platform.startsWith("win");
617
+ CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
618
+ getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
619
+ getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
620
+ y = class {
575
621
  input;
576
622
  output;
577
623
  _abortSignal;
@@ -586,46 +632,92 @@ var init_dist3 = __esm({
586
632
  error = "";
587
633
  value;
588
634
  userInput = "";
635
+ /**
636
+ * Whether accessible (static, screen-reader friendly) output is enabled for
637
+ * this prompt, resolved from the `accessible` option, the global setting,
638
+ * and the `ACCESSIBLE` env var.
639
+ */
640
+ get accessible() {
641
+ return isAccessible(this.opts.accessible);
642
+ }
589
643
  constructor(t2, e = true) {
590
- const { input: s = $, output: i = S, render: n, signal: o, ...a } = t2;
591
- 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;
644
+ const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
645
+ 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;
592
646
  }
647
+ /**
648
+ * Unsubscribe all listeners
649
+ */
593
650
  unsubscribe() {
594
651
  this._subscribers.clear();
595
652
  }
653
+ /**
654
+ * Set a subscriber with opts
655
+ * @param event - The event name
656
+ */
596
657
  setSubscriber(t2, e) {
597
- const s = this._subscribers.get(t2) ?? [];
598
- s.push(e), this._subscribers.set(t2, s);
658
+ const i2 = this._subscribers.get(t2) ?? [];
659
+ i2.push(e), this._subscribers.set(t2, i2);
599
660
  }
661
+ /**
662
+ * Subscribe to an event
663
+ * @param event - The event name
664
+ * @param cb - The callback
665
+ */
600
666
  on(t2, e) {
601
667
  this.setSubscriber(t2, { cb: e });
602
668
  }
669
+ /**
670
+ * Subscribe to an event once
671
+ * @param event - The event name
672
+ * @param cb - The callback
673
+ */
603
674
  once(t2, e) {
604
675
  this.setSubscriber(t2, { cb: e, once: true });
605
676
  }
677
+ /**
678
+ * Emit an event with data
679
+ * @param event - The event name
680
+ * @param data - The data to pass to the callback
681
+ */
606
682
  emit(t2, ...e) {
607
- const s = this._subscribers.get(t2) ?? [], i = [];
608
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
609
- for (const n of i) n();
683
+ const i2 = this._subscribers.get(t2) ?? [], s = [];
684
+ for (const r2 of i2)
685
+ r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
686
+ for (const r2 of s)
687
+ r2();
610
688
  }
611
689
  prompt() {
612
690
  return new Promise((t2) => {
613
691
  if (this._abortSignal) {
614
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t2(C);
615
- this._abortSignal.addEventListener("abort", () => {
616
- this.state = "cancel", this.close();
617
- }, { once: true });
692
+ if (this._abortSignal.aborted)
693
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
694
+ this._abortSignal.addEventListener(
695
+ "abort",
696
+ () => {
697
+ this.state = "cancel", this.close();
698
+ },
699
+ { once: true }
700
+ );
618
701
  }
619
- 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", () => {
620
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(this.value);
702
+ this.rl = l__default.createInterface({
703
+ input: this.input,
704
+ tabSize: 2,
705
+ prompt: "",
706
+ escapeCodeTimeout: 50,
707
+ terminal: true
708
+ }), 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", () => {
709
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
621
710
  }), this.once("cancel", () => {
622
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(C);
711
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
623
712
  });
624
713
  });
625
714
  }
626
715
  _isActionKey(t2, e) {
627
716
  return t2 === " ";
628
717
  }
718
+ _shouldSubmit(t2, e) {
719
+ return true;
720
+ }
629
721
  _setValue(t2) {
630
722
  this.value = t2, this.emit("value", this.value);
631
723
  }
@@ -635,19 +727,22 @@ var init_dist3 = __esm({
635
727
  _clearUserInput() {
636
728
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
637
729
  }
638
- onKeypress(t2, e) {
639
- 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") {
640
- if (this.opts.validate) {
641
- const s = this.opts.validate(this.value);
642
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
730
+ async onKeypress(t2, e) {
731
+ if (this.state !== "validating") {
732
+ 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)) {
733
+ if (this.opts.validate) {
734
+ const i2 = runValidation(this.opts.validate, this.value);
735
+ let s;
736
+ 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));
737
+ }
738
+ this.state !== "error" && (this.state = "submit");
643
739
  }
644
- this.state !== "error" && (this.state = "submit");
740
+ 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();
645
741
  }
646
- 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();
647
742
  }
648
743
  close() {
649
744
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
650
- `), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
745
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
651
746
  }
652
747
  restoreCursor() {
653
748
  const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
@@ -655,34 +750,39 @@ var init_dist3 = __esm({
655
750
  this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
656
751
  }
657
752
  render() {
658
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
753
+ const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
754
+ hard: true,
755
+ trim: false
756
+ });
659
757
  if (t2 !== this._prevFrame) {
660
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
758
+ if (this.state === "initial")
759
+ this.output.write(import_sisteransi.cursor.hide);
661
760
  else {
662
- const e = j(this._prevFrame, t2), s = A(this.output);
761
+ const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
663
762
  if (this.restoreCursor(), e) {
664
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
665
- let o = e.lines.find((a) => a >= i);
666
- if (o === void 0) {
763
+ const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
764
+ let n3 = e.lines.find((o) => o >= s);
765
+ if (n3 === void 0) {
667
766
  this._prevFrame = t2;
668
767
  return;
669
768
  }
670
769
  if (e.lines.length === 1) {
671
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
672
- const a = t2.split(`
770
+ this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
771
+ const o = t2.split(`
673
772
  `);
674
- this.output.write(a[o]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
773
+ this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
675
774
  return;
676
775
  } else if (e.lines.length > 1) {
677
- if (i < n) o = i;
776
+ if (s < r2)
777
+ n3 = s;
678
778
  else {
679
- const h = o - n;
680
- h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
779
+ const h2 = n3 - r2;
780
+ h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
681
781
  }
682
782
  this.output.write(import_sisteransi.erase.down());
683
- const a = t2.split(`
684
- `).slice(o);
685
- this.output.write(a.join(`
783
+ const f = t2.split(`
784
+ `).slice(n3);
785
+ this.output.write(f.join(`
686
786
  `)), this._prevFrame = t2;
687
787
  return;
688
788
  }
@@ -693,7 +793,7 @@ var init_dist3 = __esm({
693
793
  }
694
794
  }
695
795
  };
696
- Q = class extends p {
796
+ r = class extends y {
697
797
  get cursor() {
698
798
  return this.value ? 0 : 1;
699
799
  }
@@ -703,54 +803,60 @@ var init_dist3 = __esm({
703
803
  constructor(t2) {
704
804
  super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
705
805
  this.value = this._value;
706
- }), this.on("confirm", (e) => {
707
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
806
+ }), this.on("confirm", (i2) => {
807
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
708
808
  }), this.on("cursor", () => {
709
809
  this.value = !this.value;
710
810
  });
711
811
  }
712
812
  };
713
- nt = class extends p {
813
+ n$1 = class n extends y {
714
814
  options;
715
815
  cursor = 0;
716
816
  get _selectedValue() {
717
817
  return this.options[this.cursor];
718
818
  }
719
819
  changeValue() {
720
- this.value = this._selectedValue.value;
721
- }
722
- constructor(t2) {
723
- super(t2, false), this.options = t2.options;
724
- const e = this.options.findIndex(({ value: i }) => i === t2.initialValue), s = e === -1 ? 0 : e;
725
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
726
- switch (i) {
820
+ const e = this._selectedValue;
821
+ this.value = e === void 0 ? void 0 : e.value;
822
+ }
823
+ constructor(e) {
824
+ super(e, false), this.options = e.options;
825
+ const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
826
+ this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
827
+ switch (s) {
727
828
  case "left":
728
829
  case "up":
729
- this.cursor = d(this.cursor, -1, this.options);
830
+ this.cursor = findCursor(this.cursor, -1, this.options);
730
831
  break;
731
832
  case "down":
732
833
  case "right":
733
- this.cursor = d(this.cursor, 1, this.options);
834
+ this.cursor = findCursor(this.cursor, 1, this.options);
734
835
  break;
735
836
  }
736
837
  this.changeValue();
737
838
  });
738
839
  }
739
840
  };
740
- at = class extends p {
841
+ n2 = class extends y {
741
842
  get userInputWithCursor() {
742
- if (this.state === "submit") return this.userInput;
843
+ if (this.state === "submit")
844
+ return this.userInput;
743
845
  const t2 = this.userInput;
744
- if (this.cursor >= t2.length) return `${this.userInput}\u2588`;
745
- const e = t2.slice(0, this.cursor), [s, ...i] = t2.slice(this.cursor);
746
- return `${e}${y("inverse", s)}${i.join("")}`;
846
+ if (this.cursor >= t2.length)
847
+ return `${this.userInput}\u2588`;
848
+ const r2 = t2.slice(0, this.cursor), s = t2.slice(this.cursor, this.cursor + 1), e = t2.slice(this.cursor + 1);
849
+ return `${r2}${styleText("inverse", s)}${e}`;
747
850
  }
748
851
  get cursor() {
749
852
  return this._cursor;
750
853
  }
751
854
  constructor(t2) {
752
- super({ ...t2, initialUserInput: t2.initialUserInput ?? t2.initialValue }), this.on("userInput", (e) => {
753
- this._setValue(e);
855
+ super({
856
+ ...t2,
857
+ initialUserInput: t2.initialUserInput ?? t2.initialValue
858
+ }), this.on("userInput", (r2) => {
859
+ this._setValue(r2);
754
860
  }), this.on("finalize", () => {
755
861
  this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
756
862
  });
@@ -759,328 +865,503 @@ var init_dist3 = __esm({
759
865
  }
760
866
  });
761
867
 
762
- // node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
763
- import { styleText as t, stripVTControlCharacters as ne } from "node:util";
764
- import P2 from "node:process";
765
- import { existsSync as Xe, lstatSync as we, readdirSync as ze } from "node:fs";
766
- import { dirname as be, join as Qe } from "node:path";
767
- function Ze() {
768
- 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";
868
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
869
+ import { styleText as styleText2, stripVTControlCharacters } from "node:util";
870
+ import process$1 from "node:process";
871
+ import { existsSync, lstatSync, readdirSync } from "node:fs";
872
+ import { dirname, join } from "node:path";
873
+ function isUnicodeSupported() {
874
+ if (process$1.platform !== "win32") {
875
+ return process$1.env.TERM !== "linux";
876
+ }
877
+ 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";
769
878
  }
770
- var import_sisteransi2, ee, ae, 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, ot2, O2, pt, mt, gt, ft, vt, wt, Ct, fe, Ve, re, _t, je, Ot;
879
+ function formatInstructionFooter(o, e) {
880
+ const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
881
+ return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
882
+ }
883
+ var import_sisteransi2, unicode, isCI, 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, confirm, MULTISELECT_INSTRUCTIONS, log, cancel, intro, outro, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i, text;
771
884
  var init_dist4 = __esm({
772
- "node_modules/.bun/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs"() {
885
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
773
886
  init_utils2();
774
887
  init_dist3();
775
888
  init_dist3();
776
889
  init_main();
777
890
  init_dist2();
778
891
  import_sisteransi2 = __toESM(require_src(), 1);
779
- ee = Ze();
780
- ae = () => process.env.CI === "true";
781
- w2 = (e, i) => ee ? e : i;
782
- _e = w2("\u25C6", "*");
783
- oe = w2("\u25A0", "x");
784
- ue = w2("\u25B2", "x");
785
- F = w2("\u25C7", "o");
786
- le = w2("\u250C", "T");
787
- d2 = w2("\u2502", "|");
788
- E2 = w2("\u2514", "\u2014");
789
- Ie = w2("\u2510", "T");
790
- Ee = w2("\u2518", "\u2014");
791
- z2 = w2("\u25CF", ">");
792
- H2 = w2("\u25CB", " ");
793
- te = w2("\u25FB", "[\u2022]");
794
- U = w2("\u25FC", "[+]");
795
- J = w2("\u25FB", "[ ]");
796
- xe = w2("\u25AA", "\u2022");
797
- se = w2("\u2500", "-");
798
- ce = w2("\u256E", "+");
799
- Ge = w2("\u251C", "+");
800
- $e = w2("\u256F", "+");
801
- de = w2("\u2570", "+");
802
- Oe = w2("\u256D", "+");
803
- he = w2("\u25CF", "\u2022");
804
- pe = w2("\u25C6", "*");
805
- me = w2("\u25B2", "!");
806
- ge = w2("\u25A0", "x");
807
- V2 = (e) => {
808
- switch (e) {
892
+ unicode = isUnicodeSupported();
893
+ isCI = () => process.env.CI === "true";
894
+ unicodeOr = (o, e) => unicode ? o : e;
895
+ S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
896
+ S_STEP_CANCEL = unicodeOr("\u25A0", "x");
897
+ S_STEP_ERROR = unicodeOr("\u25B2", "x");
898
+ S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
899
+ S_BAR_START = unicodeOr("\u250C", "T");
900
+ S_BAR = unicodeOr("\u2502", "|");
901
+ S_BAR_END = unicodeOr("\u2514", "\u2014");
902
+ S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
903
+ S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
904
+ S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
905
+ S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
906
+ S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
907
+ S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
908
+ S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
909
+ S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
910
+ S_BAR_H = unicodeOr("\u2500", "-");
911
+ S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
912
+ S_CONNECT_LEFT = unicodeOr("\u251C", "+");
913
+ S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
914
+ S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
915
+ S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
916
+ S_INFO = unicodeOr("\u25CF", "\u2022");
917
+ S_SUCCESS = unicodeOr("\u25C6", "*");
918
+ S_WARN = unicodeOr("\u25B2", "!");
919
+ S_ERROR = unicodeOr("\u25A0", "x");
920
+ symbol = (o) => {
921
+ switch (o) {
809
922
  case "initial":
810
923
  case "active":
811
- return t("cyan", _e);
924
+ return styleText2("cyan", S_STEP_ACTIVE);
812
925
  case "cancel":
813
- return t("red", oe);
926
+ return styleText2("red", S_STEP_CANCEL);
814
927
  case "error":
815
- return t("yellow", ue);
928
+ return styleText2("yellow", S_STEP_ERROR);
816
929
  case "submit":
817
- return t("green", F);
930
+ return styleText2("green", S_STEP_SUBMIT);
931
+ case "validating":
932
+ return styleText2("dim", S_STEP_ACTIVE);
818
933
  }
819
934
  };
820
- ye = (e) => {
821
- switch (e) {
935
+ symbolBar = (o) => {
936
+ switch (o) {
822
937
  case "initial":
823
938
  case "active":
824
- return t("cyan", d2);
939
+ return styleText2("cyan", S_BAR);
825
940
  case "cancel":
826
- return t("red", d2);
941
+ return styleText2("red", S_BAR);
827
942
  case "error":
828
- return t("yellow", d2);
943
+ return styleText2("yellow", S_BAR);
829
944
  case "submit":
830
- return t("green", d2);
831
- }
832
- };
833
- et2 = (e, i, s, r, u2) => {
834
- let n = i, o = 0;
835
- for (let c2 = s; c2 < r; c2++) {
836
- const a = e[c2];
837
- if (n = n - a.length, o++, n <= u2) break;
838
- }
839
- return { lineCount: n, removals: o };
840
- };
841
- Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
842
- 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);
843
- let p2 = 0;
844
- e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
845
- let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
846
- const S2 = Math.min(p2 + y2, i.length), h = [];
945
+ return styleText2("green", S_BAR);
946
+ }
947
+ };
948
+ I = (l2, e, w, p, b, C2 = false) => {
949
+ let r2 = e, O = 0;
950
+ if (C2)
951
+ for (let i2 = p - 1; i2 >= w; i2--) {
952
+ const m = l2[i2];
953
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
954
+ }
955
+ else
956
+ for (let i2 = w; i2 < p; i2++) {
957
+ const m = l2[i2];
958
+ if (m && (r2 -= m.length), O++, r2 <= b) break;
959
+ }
960
+ return { lineCount: r2, removals: O };
961
+ };
962
+ limitOptions = ({
963
+ cursor: l2,
964
+ options: e,
965
+ style: w,
966
+ output: p = process.stdout,
967
+ maxItems: b = Number.POSITIVE_INFINITY,
968
+ columnPadding: C2 = 0,
969
+ rowPadding: r2 = 4
970
+ }) => {
971
+ const i2 = getColumns(p) - C2, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
847
972
  let f = 0;
848
- m && f++, g && f++;
849
- const v = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
850
- for (let b = v; b < T; b++) {
851
- const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
973
+ l2 >= a2 - 3 && (f = Math.max(
974
+ Math.min(l2 - a2 + 3, e.length - a2),
975
+ 0
976
+ ));
977
+ let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
978
+ const W2 = Math.min(
979
+ f + a2,
980
+ e.length
981
+ ), s = [];
982
+ let g = 0;
983
+ d && g++, c2 && g++;
984
+ const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
985
+ for (let t2 = T; t2 < y2; t2++) {
986
+ const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
987
+ hard: true,
988
+ trim: false
989
+ }).split(`
852
990
  `);
853
- h.push(x), f += x.length;
854
- }
855
- if (f > $2) {
856
- let b = 0, x = 0, G2 = f;
857
- const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
858
- 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));
859
- }
860
- const C2 = [];
861
- m && C2.push(l);
862
- for (const b of h) for (const x of b) C2.push(x);
863
- return g && C2.push(l), C2;
864
- };
865
- ot2 = (e) => {
866
- const i = e.active ?? "Yes", s = e.inactive ?? "No";
867
- return new Q({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
868
- const r = e.withGuide ?? u.withGuide, u2 = `${V2(this.state)} `, n = r ? `${t("gray", d2)} ` : "", o = R(e.output, e.message, n, u2), c2 = `${r ? `${t("gray", d2)}
869
- ` : ""}${o}
870
- `, a = this.value ? i : s;
871
- switch (this.state) {
872
- case "submit": {
873
- const l = r ? `${t("gray", d2)} ` : "";
874
- return `${c2}${l}${t("dim", a)}`;
875
- }
876
- case "cancel": {
877
- const l = r ? `${t("gray", d2)} ` : "";
878
- return `${c2}${l}${t(["strikethrough", "dim"], a)}${r ? `
879
- ${t("gray", d2)}` : ""}`;
880
- }
881
- default: {
882
- const l = r ? `${t("cyan", d2)} ` : "", $2 = r ? t("cyan", E2) : "";
883
- return `${c2}${l}${this.value ? `${t("green", z2)} ${i}` : `${t("dim", H2)} ${t("dim", i)}`}${e.vertical ? r ? `
884
- ${t("cyan", d2)} ` : `
885
- ` : ` ${t("dim", "/")} `}${this.value ? `${t("dim", H2)} ${t("dim", s)}` : `${t("green", z2)} ${s}`}
886
- ${$2}
991
+ s.push(h2), g += h2.length;
992
+ }
993
+ if (g > v) {
994
+ let t2 = 0, n3 = 0, o = g;
995
+ const h2 = l2 - T;
996
+ let u3 = v;
997
+ const L = () => I(s, o, 0, h2, u3), E = () => I(
998
+ s,
999
+ o,
1000
+ h2 + 1,
1001
+ s.length,
1002
+ u3,
1003
+ true
1004
+ );
1005
+ 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));
1006
+ }
1007
+ const x = [];
1008
+ d && x.push(M);
1009
+ for (const t2 of s)
1010
+ for (const n3 of t2)
1011
+ x.push(n3);
1012
+ return c2 && x.push(M), x;
1013
+ };
1014
+ confirm = (e) => {
1015
+ const a2 = e.active ?? "Yes", o = e.inactive ?? "No";
1016
+ return new r({
1017
+ active: a2,
1018
+ inactive: o,
1019
+ signal: e.signal,
1020
+ input: e.input,
1021
+ output: e.output,
1022
+ initialValue: e.initialValue ?? true,
1023
+ render() {
1024
+ const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
1025
+ e.output,
1026
+ e.message,
1027
+ l2,
1028
+ u3
1029
+ ), s = `${i2 ? `${styleText2("gray", S_BAR)}
1030
+ ` : ""}${f}
1031
+ `, c2 = this.value ? a2 : o;
1032
+ switch (this.state) {
1033
+ case "submit": {
1034
+ const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1035
+ return `${s}${r2}${styleText2("dim", c2)}`;
1036
+ }
1037
+ case "cancel": {
1038
+ const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1039
+ return `${s}${r2}${styleText2(["strikethrough", "dim"], c2)}${i2 ? `
1040
+ ${styleText2("gray", S_BAR)}` : ""}`;
1041
+ }
1042
+ default: {
1043
+ const r2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", g = i2 ? styleText2("cyan", S_BAR_END) : "";
1044
+ return `${s}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${e.vertical ? i2 ? `
1045
+ ${styleText2("cyan", S_BAR)} ` : `
1046
+ ` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", o)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${o}`}
1047
+ ${g}
887
1048
  `;
1049
+ }
888
1050
  }
889
1051
  }
890
- } }).prompt();
1052
+ }).prompt();
891
1053
  };
892
- O2 = { message: (e = [], { symbol: i = t("gray", d2), secondarySymbol: s = t("gray", d2), output: r = process.stdout, spacing: u2 = 1, withGuide: n } = {}) => {
893
- const o = [], c2 = n ?? u.withGuide, a = c2 ? s : "", l = c2 ? `${i} ` : "", $2 = c2 ? `${s} ` : "";
894
- for (let p2 = 0; p2 < u2; p2++) o.push(a);
895
- const y2 = Array.isArray(e) ? e : e.split(`
1054
+ MULTISELECT_INSTRUCTIONS = [
1055
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1056
+ `${styleText2("dim", "Space:")} select`,
1057
+ `${styleText2("dim", "Enter:")} confirm`
1058
+ ];
1059
+ log = {
1060
+ message: (s = [], {
1061
+ symbol: e = styleText2("gray", S_BAR),
1062
+ secondarySymbol: r2 = styleText2("gray", S_BAR),
1063
+ output: m = process.stdout,
1064
+ spacing: l2 = 1,
1065
+ withGuide: c2
1066
+ } = {}) => {
1067
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
1068
+ for (let i2 = 0; i2 < l2; i2++)
1069
+ t2.push(f);
1070
+ const g = Array.isArray(s) ? s : s.split(`
896
1071
  `);
897
- if (y2.length > 0) {
898
- const [p2, ...m] = y2;
899
- p2.length > 0 ? o.push(`${l}${p2}`) : o.push(c2 ? i : "");
900
- for (const g of m) g.length > 0 ? o.push(`${$2}${g}`) : o.push(c2 ? s : "");
901
- }
902
- r.write(`${o.join(`
1072
+ if (g.length > 0) {
1073
+ const [i2, ...y2] = g;
1074
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
1075
+ for (const p of y2)
1076
+ p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
1077
+ }
1078
+ m.write(`${t2.join(`
903
1079
  `)}
904
1080
  `);
905
- }, info: (e, i) => {
906
- O2.message(e, { ...i, symbol: t("blue", he) });
907
- }, success: (e, i) => {
908
- O2.message(e, { ...i, symbol: t("green", pe) });
909
- }, step: (e, i) => {
910
- O2.message(e, { ...i, symbol: t("green", F) });
911
- }, warn: (e, i) => {
912
- O2.message(e, { ...i, symbol: t("yellow", me) });
913
- }, warning: (e, i) => {
914
- O2.warn(e, i);
915
- }, error: (e, i) => {
916
- O2.message(e, { ...i, symbol: t("red", ge) });
917
- } };
918
- pt = (e = "", i) => {
919
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
920
- s.write(`${r}${t("red", e)}
1081
+ },
1082
+ info: (s, e) => {
1083
+ log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
1084
+ },
1085
+ success: (s, e) => {
1086
+ log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
1087
+ },
1088
+ step: (s, e) => {
1089
+ log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
1090
+ },
1091
+ warn: (s, e) => {
1092
+ log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
1093
+ },
1094
+ /** alias for `log.warn()`. */
1095
+ warning: (s, e) => {
1096
+ log.warn(s, e);
1097
+ },
1098
+ error: (s, e) => {
1099
+ log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
1100
+ }
1101
+ };
1102
+ cancel = (o = "", t2) => {
1103
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
1104
+ i2.write(`${e}${styleText2("red", o)}
921
1105
 
922
1106
  `);
923
1107
  };
924
- mt = (e = "", i) => {
925
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", le)} ` : "";
926
- s.write(`${r}${e}
1108
+ intro = (o = "", t2) => {
1109
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
1110
+ i2.write(`${e}${o}
927
1111
  `);
928
1112
  };
929
- gt = (e = "", i) => {
930
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", d2)}
931
- ${t("gray", E2)} ` : "";
932
- s.write(`${r}${e}
1113
+ outro = (o = "", t2) => {
1114
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
1115
+ ${styleText2("gray", S_BAR_END)} ` : "";
1116
+ i2.write(`${e}${o}
933
1117
 
934
1118
  `);
935
1119
  };
936
- ft = (e) => t("dim", e);
937
- vt = (e, i, s) => {
938
- const r = { hard: true, trim: false }, u2 = wrapAnsi(e, i, r).split(`
939
- `), n = u2.reduce((a, l) => Math.max(dist_default2(l), a), 0), o = u2.map(s).reduce((a, l) => Math.max(dist_default2(l), a), 0), c2 = i - (o - n);
940
- return wrapAnsi(e, c2, r);
941
- };
942
- wt = (e = "", i = "", s) => {
943
- const r = s?.output ?? P2.stdout, u2 = s?.withGuide ?? u.withGuide, n = s?.format ?? ft, o = ["", ...vt(e, O(r) - 6, n).split(`
944
- `).map(n), ""], c2 = dist_default2(i), a = Math.max(o.reduce((p2, m) => {
945
- const g = dist_default2(m);
946
- return g > p2 ? g : p2;
947
- }, 0), c2) + 2, l = o.map((p2) => `${t("gray", d2)} ${p2}${" ".repeat(a - dist_default2(p2))}${t("gray", d2)}`).join(`
948
- `), $2 = u2 ? `${t("gray", d2)}
949
- ` : "", y2 = u2 ? Ge : de;
950
- r.write(`${$2}${t("green", F)} ${t("reset", i)} ${t("gray", se.repeat(Math.max(a - c2 - 1, 1)) + ce)}
951
- ${l}
952
- ${t("gray", y2 + se.repeat(a + 2) + $e)}
953
- `);
1120
+ W$1 = (o) => o;
1121
+ C = (o, e, s) => {
1122
+ const a2 = {
1123
+ hard: true,
1124
+ trim: false
1125
+ }, i2 = wrapAnsi(o, e, a2).split(`
1126
+ `), c2 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c2);
1127
+ return wrapAnsi(o, g, a2);
1128
+ };
1129
+ note = (o = "", e = "", s) => {
1130
+ const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c2).split(`
1131
+ `).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
1132
+ g.reduce((m, F) => {
1133
+ const O = dist_default2(F);
1134
+ return O > m ? O : m;
1135
+ }, 0),
1136
+ n3
1137
+ ) + 2, h2 = g.map(
1138
+ (m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
1139
+ ).join(`
1140
+ `), T = i2 ? `${styleText2("gray", S_BAR)}
1141
+ ` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
1142
+ a2.write(
1143
+ `${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
1144
+ "gray",
1145
+ S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
1146
+ )}
1147
+ ${h2}
1148
+ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
1149
+ `
1150
+ );
954
1151
  };
955
- Ct = (e) => t("magenta", e);
956
- fe = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u2, frames: n = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: o = ee ? 80 : 120, signal: c2, ...a } = {}) => {
957
- const l = ae();
958
- let $2, y2, p2 = false, m = false, g = "", S2, h = performance.now();
959
- const f = O(s), v = a?.styleFrame ?? Ct, T = (_2) => {
960
- const A2 = _2 > 1 ? u2 ?? u.messages.error : r ?? u.messages.cancel;
961
- m = _2 === 1, p2 && (W(A2, _2), m && typeof i == "function" && i());
962
- }, C2 = () => T(2), b = () => T(1), x = () => {
963
- process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", T), c2 && c2.addEventListener("abort", b);
964
- }, G2 = () => {
965
- process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", T), c2 && c2.removeEventListener("abort", b);
966
- }, M2 = () => {
967
- if (S2 === void 0) return;
968
- l && s.write(`
1152
+ W = (l2) => styleText2("magenta", l2);
1153
+ spinner = ({
1154
+ indicator: l2 = "dots",
1155
+ onCancel: h2,
1156
+ output: n3 = process.stdout,
1157
+ cancelMessage: G,
1158
+ errorMessage: O,
1159
+ frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1160
+ delay: F = unicode ? 80 : 120,
1161
+ signal: m,
1162
+ ...I2
1163
+ } = {}) => {
1164
+ const u3 = isCI();
1165
+ let M, T, d = false, S = false, s = "", p, w = performance.now();
1166
+ const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
1167
+ const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
1168
+ S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
1169
+ }, f = () => g(2), i2 = () => g(1), A = () => {
1170
+ process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
1171
+ }, H = () => {
1172
+ process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
1173
+ }, y2 = () => {
1174
+ if (p === void 0) return;
1175
+ u3 && n3.write(`
969
1176
  `);
970
- const _2 = wrapAnsi(S2, f, { hard: true, trim: false }).split(`
1177
+ const r2 = wrapAnsi(p, x, {
1178
+ hard: true,
1179
+ trim: false
1180
+ }).split(`
971
1181
  `);
972
- _2.length > 1 && s.write(import_sisteransi2.cursor.up(_2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
973
- }, R2 = (_2) => _2.replace(/\.+$/, ""), j2 = (_2) => {
974
- const A2 = (performance.now() - _2) / 1e3, k = Math.floor(A2 / 60), L = Math.floor(A2 % 60);
975
- return k > 0 ? `[${k}m ${L}s]` : `[${L}s]`;
976
- }, D2 = a.withGuide ?? u.withGuide, ie = (_2 = "") => {
977
- p2 = true, $2 = z({ output: s }), g = R2(_2), h = performance.now(), D2 && s.write(`${t("gray", d2)}
1182
+ r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
1183
+ }, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
1184
+ const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
1185
+ return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
1186
+ }, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
1187
+ d = true, M = block({ output: n3 }), s = C2(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
978
1188
  `);
979
- let A2 = 0, k = 0;
980
- x(), y2 = setInterval(() => {
981
- if (l && g === S2) return;
982
- M2(), S2 = g;
983
- const L = v(n[A2]);
984
- let Z;
985
- if (l) Z = `${L} ${g}...`;
986
- else if (e === "timer") Z = `${L} ${g} ${j2(h)}`;
1189
+ let r2 = 0, t2 = 0;
1190
+ A(), T = setInterval(() => {
1191
+ if (u3 && s === p)
1192
+ return;
1193
+ y2(), p = s;
1194
+ const o = k(E[r2]);
1195
+ let v;
1196
+ if (u3)
1197
+ v = `${o} ${s}...`;
1198
+ else if (l2 === "timer")
1199
+ v = `${o} ${s} ${_(w)}`;
987
1200
  else {
988
- const Be = ".".repeat(Math.floor(k)).slice(0, 3);
989
- Z = `${L} ${g}${Be}`;
990
- }
991
- const Ne = wrapAnsi(Z, f, { hard: true, trim: false });
992
- s.write(Ne), A2 = A2 + 1 < n.length ? A2 + 1 : 0, k = k < 4 ? k + 0.125 : 0;
993
- }, o);
994
- }, W = (_2 = "", A2 = 0, k = false) => {
995
- if (!p2) return;
996
- p2 = false, clearInterval(y2), M2();
997
- const L = A2 === 0 ? t("green", F) : A2 === 1 ? t("red", oe) : t("red", ue);
998
- g = _2 ?? g, k || (e === "timer" ? s.write(`${L} ${g} ${j2(h)}
999
- `) : s.write(`${L} ${g}
1000
- `)), G2(), $2();
1201
+ const B = ".".repeat(Math.floor(t2)).slice(0, 3);
1202
+ v = `${o} ${s}${B}`;
1203
+ }
1204
+ const j = wrapAnsi(v, x, {
1205
+ hard: true,
1206
+ trim: false
1207
+ });
1208
+ n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
1209
+ }, F);
1210
+ }, a2 = (e = "", r2 = 0, t2 = false) => {
1211
+ if (!d) return;
1212
+ d = false, clearInterval(T), y2();
1213
+ const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1214
+ s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
1215
+ `) : n3.write(`${o} ${s}
1216
+ `)), H(), M();
1001
1217
  };
1002
- return { start: ie, stop: (_2 = "") => W(_2, 0), message: (_2 = "") => {
1003
- g = R2(_2 ?? g);
1004
- }, cancel: (_2 = "") => W(_2, 1), error: (_2 = "") => W(_2, 2), clear: () => W("", 0, true), get isCancelled() {
1005
- return m;
1006
- } };
1007
- };
1008
- Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1009
- re = (e, i) => e.includes(`
1010
- `) ? e.split(`
1011
- `).map((s) => i(s)).join(`
1012
- `) : i(e);
1013
- _t = (e) => {
1014
- const i = (s, r) => {
1015
- const u2 = s.label ?? String(s.value);
1016
- switch (r) {
1218
+ return {
1219
+ start: P,
1220
+ stop: (e = "") => a2(e, 0),
1221
+ message: (e = "") => {
1222
+ s = C2(e ?? s);
1223
+ },
1224
+ cancel: (e = "") => a2(e, 1),
1225
+ error: (e = "") => a2(e, 2),
1226
+ clear: () => a2("", 0, true),
1227
+ get isCancelled() {
1228
+ return S;
1229
+ }
1230
+ };
1231
+ };
1232
+ u2 = {
1233
+ light: unicodeOr("\u2500", "-"),
1234
+ heavy: unicodeOr("\u2501", "="),
1235
+ block: unicodeOr("\u2588", "#")
1236
+ };
1237
+ SELECT_INSTRUCTIONS = [
1238
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1239
+ `${styleText2("dim", "Enter:")} confirm`
1240
+ ];
1241
+ c = (t2, o) => t2.includes(`
1242
+ `) ? t2.split(`
1243
+ `).map((d) => o(d)).join(`
1244
+ `) : o(t2);
1245
+ select = (t2) => {
1246
+ const o = (n3, m) => {
1247
+ if (n3 === void 0)
1248
+ return "";
1249
+ const s = n3.label ?? String(n3.value);
1250
+ switch (m) {
1017
1251
  case "disabled":
1018
- return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1252
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
1019
1253
  case "selected":
1020
- return `${re(u2, (n) => t("dim", n))}`;
1254
+ return `${c(s, (i2) => styleText2("dim", i2))}`;
1021
1255
  case "active":
1022
- return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1256
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
1023
1257
  case "cancelled":
1024
- return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
1258
+ return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
1025
1259
  default:
1026
- return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
1027
- }
1028
- };
1029
- return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
1030
- 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)}
1031
- ` : ""}${n}
1260
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
1261
+ }
1262
+ }, d = t2.showInstructions ?? true;
1263
+ return new n$1({
1264
+ options: t2.options,
1265
+ signal: t2.signal,
1266
+ input: t2.input,
1267
+ output: t2.output,
1268
+ initialValue: t2.initialValue,
1269
+ render() {
1270
+ const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
1271
+ t2.output,
1272
+ t2.message,
1273
+ s,
1274
+ m
1275
+ ), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
1276
+ ` : ""}${i2}
1032
1277
  `;
1278
+ switch (this.state) {
1279
+ case "submit": {
1280
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1281
+ t2.output,
1282
+ o(this.options[this.cursor], "selected"),
1283
+ r2
1284
+ );
1285
+ return `${u3}${a2}`;
1286
+ }
1287
+ case "cancel": {
1288
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
1289
+ t2.output,
1290
+ o(this.options[this.cursor], "cancelled"),
1291
+ r2
1292
+ );
1293
+ return `${u3}${a2}${n3 ? `
1294
+ ${styleText2("gray", S_BAR)}` : ""}`;
1295
+ }
1296
+ default: {
1297
+ const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1298
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1299
+ `), b = p.length + 1;
1300
+ return `${u3}${r2}${limitOptions({
1301
+ output: t2.output,
1302
+ cursor: this.cursor,
1303
+ options: this.options,
1304
+ maxItems: t2.maxItems,
1305
+ columnPadding: r2.length,
1306
+ rowPadding: a2 + b,
1307
+ style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1308
+ }).join(`
1309
+ ${r2}`)}
1310
+ ${f}
1311
+ `;
1312
+ }
1313
+ }
1314
+ }
1315
+ }).prompt();
1316
+ };
1317
+ i = `${styleText2("gray", S_BAR)} `;
1318
+ text = (t2) => new n2({
1319
+ validate: t2.validate,
1320
+ placeholder: t2.placeholder,
1321
+ defaultValue: t2.defaultValue,
1322
+ initialValue: t2.initialValue,
1323
+ output: t2.output,
1324
+ signal: t2.signal,
1325
+ input: t2.input,
1326
+ render() {
1327
+ const r2 = t2?.withGuide ?? settings.withGuide, l2 = `${`${r2 ? `${styleText2("gray", S_BAR)}
1328
+ ` : ""}${symbol(this.state)} `}${t2.message}
1329
+ `, d = t2.placeholder && t2.placeholder.length > 0 ? (
1330
+ // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
1331
+ styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1))
1332
+ ) : styleText2(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
1033
1333
  switch (this.state) {
1334
+ case "validating": {
1335
+ const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "", c2 = styleText2("dim", o), $ = styleText2("dim", "Validating...");
1336
+ return `${l2}${n3}${c2}
1337
+ ${i2} ${$}
1338
+ `;
1339
+ }
1340
+ case "error": {
1341
+ const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", i2 = r2 ? `${styleText2("yellow", S_BAR)} ` : "", c2 = r2 ? styleText2("yellow", S_BAR_END) : "";
1342
+ return `${l2.trim()}
1343
+ ${i2}${o}
1344
+ ${c2}${n3}
1345
+ `;
1346
+ }
1034
1347
  case "submit": {
1035
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
1036
- return `${o}${a}`;
1348
+ const n3 = s ? `${r2 ? " " : ""}${styleText2("dim", s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
1349
+ return `${l2}${i2}${n3}`;
1037
1350
  }
1038
1351
  case "cancel": {
1039
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
1040
- return `${o}${a}${s ? `
1041
- ${t("gray", d2)}` : ""}`;
1352
+ const n3 = s ? ` ${styleText2(["strikethrough", "dim"], s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
1353
+ return `${l2}${i2}${n3}${s.trim() ? `
1354
+ ${i2}` : ""}`;
1042
1355
  }
1043
1356
  default: {
1044
- const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
1045
- `).length, $2 = s ? 2 : 1;
1046
- 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(`
1047
- ${c2}`)}
1048
- ${a}
1357
+ const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "";
1358
+ return `${l2}${n3}${o}
1359
+ ${i2}
1049
1360
  `;
1050
1361
  }
1051
1362
  }
1052
- } }).prompt();
1053
- };
1054
- je = `${t("gray", d2)} `;
1055
- Ot = (e) => new at({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
1056
- const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${t("gray", d2)}
1057
- ` : ""}${V2(this.state)} `}${e.message}
1058
- `, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1059
- switch (this.state) {
1060
- case "error": {
1061
- const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
1062
- return `${s.trim()}
1063
- ${c2}${u2}
1064
- ${a}${o}
1065
- `;
1066
- }
1067
- case "submit": {
1068
- const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
1069
- return `${s}${c2}${o}`;
1070
- }
1071
- case "cancel": {
1072
- const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
1073
- return `${s}${c2}${o}${n.trim() ? `
1074
- ${c2}` : ""}`;
1075
- }
1076
- default: {
1077
- const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
1078
- return `${s}${o}${u2}
1079
- ${c2}
1080
- `;
1081
- }
1082
1363
  }
1083
- } }).prompt();
1364
+ }).prompt();
1084
1365
  }
1085
1366
  });
1086
1367
 
@@ -1088,21 +1369,21 @@ ${c2}
1088
1369
  var cli_output_exports = {};
1089
1370
  __export(cli_output_exports, {
1090
1371
  LogLevel: () => LogLevel,
1091
- cancel: () => pt,
1372
+ cancel: () => cancel,
1092
1373
  colorUtils: () => colorUtils,
1093
1374
  displayDoNotDevError: () => displayDoNotDevError,
1094
1375
  error: () => error,
1095
1376
  getLogLevel: () => getLogLevel,
1096
1377
  info: () => info,
1097
- intro: () => mt,
1098
- isCancel: () => q,
1378
+ intro: () => intro,
1379
+ isCancel: () => isCancel,
1099
1380
  isDebug: () => isDebug,
1100
1381
  isVerbose: () => isVerbose,
1101
- log: () => log,
1102
- note: () => wt,
1103
- outro: () => gt,
1382
+ log: () => log2,
1383
+ note: () => note,
1384
+ outro: () => outro,
1104
1385
  setLogLevel: () => setLogLevel,
1105
- spinner: () => fe,
1386
+ spinner: () => spinner,
1106
1387
  success: () => success,
1107
1388
  warn: () => warn
1108
1389
  });
@@ -1114,9 +1395,9 @@ function supportsColor() {
1114
1395
  }
1115
1396
  return process.stdout.isTTY === true;
1116
1397
  }
1117
- function colorize(text, color) {
1118
- if (!supportsColor()) return text;
1119
- return `${color}${text}${colors.reset}`;
1398
+ function colorize(text2, color) {
1399
+ if (!supportsColor()) return text2;
1400
+ return `${color}${text2}${colors.reset}`;
1120
1401
  }
1121
1402
  function setLogLevel(level) {
1122
1403
  currentLogLevel = level;
@@ -1178,9 +1459,9 @@ ${contextStr}`;
1178
1459
 
1179
1460
  Original error: ${originalMsg}`;
1180
1461
  }
1181
- O2.error(message);
1462
+ log.error(message);
1182
1463
  }
1183
- var colors, colorUtils, LogLevel, currentLogLevel, log, error, warn, info, success;
1464
+ var colors, colorUtils, LogLevel, currentLogLevel, log2, error, warn, info, success;
1184
1465
  var init_cli_output = __esm({
1185
1466
  "packages/tooling/src/utils/cli-output.ts"() {
1186
1467
  "use strict";
@@ -1225,7 +1506,7 @@ var init_cli_output = __esm({
1225
1506
  currentLogLevel = envLevel;
1226
1507
  }
1227
1508
  }
1228
- log = {
1509
+ log2 = {
1229
1510
  /**
1230
1511
  * Logs an error message (always shows unless Quiet level)
1231
1512
  * Uses clack's log.error + explicit red color
@@ -1233,7 +1514,7 @@ var init_cli_output = __esm({
1233
1514
  error(...args) {
1234
1515
  if (currentLogLevel < 0 /* Quiet */) return;
1235
1516
  const message = formatMessage(...args);
1236
- O2.error(colorize(message, colors.brightRed));
1517
+ log.error(colorize(message, colors.brightRed));
1237
1518
  },
1238
1519
  /**
1239
1520
  * Logs a warning message (shows at Normal level and above)
@@ -1242,7 +1523,7 @@ var init_cli_output = __esm({
1242
1523
  warn(...args) {
1243
1524
  if (currentLogLevel < 1 /* Normal */) return;
1244
1525
  const message = formatMessage(...args);
1245
- O2.warn(colorize(message, colors.brightYellow));
1526
+ log.warn(colorize(message, colors.brightYellow));
1246
1527
  },
1247
1528
  /**
1248
1529
  * Logs an info message (shows at Normal level and above)
@@ -1251,7 +1532,7 @@ var init_cli_output = __esm({
1251
1532
  info(...args) {
1252
1533
  if (currentLogLevel < 1 /* Normal */) return;
1253
1534
  const message = formatMessage(...args);
1254
- O2.info(colorize(message, colors.brightCyan));
1535
+ log.info(colorize(message, colors.brightCyan));
1255
1536
  },
1256
1537
  /**
1257
1538
  * Logs a success message (shows at Normal level and above)
@@ -1260,7 +1541,7 @@ var init_cli_output = __esm({
1260
1541
  success(...args) {
1261
1542
  if (currentLogLevel < 1 /* Normal */) return;
1262
1543
  const message = formatMessage(...args);
1263
- O2.success(colorize(message, colors.brightGreen));
1544
+ log.success(colorize(message, colors.brightGreen));
1264
1545
  },
1265
1546
  /**
1266
1547
  * Logs a debug message (only shows at Verbose level and above)
@@ -1269,7 +1550,7 @@ var init_cli_output = __esm({
1269
1550
  debug(...args) {
1270
1551
  if (currentLogLevel < 2 /* Verbose */) return;
1271
1552
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1272
- O2.message(
1553
+ log.message(
1273
1554
  colorize(
1274
1555
  `[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
1275
1556
  colors.gray
@@ -1283,7 +1564,7 @@ var init_cli_output = __esm({
1283
1564
  trace(...args) {
1284
1565
  if (currentLogLevel < 3 /* Debug */) return;
1285
1566
  const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
1286
- O2.message(
1567
+ log.message(
1287
1568
  colorize(
1288
1569
  `[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
1289
1570
  colors.gray
@@ -1291,10 +1572,10 @@ var init_cli_output = __esm({
1291
1572
  );
1292
1573
  }
1293
1574
  };
1294
- error = log.error.bind(log);
1295
- warn = log.warn.bind(log);
1296
- info = log.info.bind(log);
1297
- success = log.success.bind(log);
1575
+ error = log2.error.bind(log2);
1576
+ warn = log2.warn.bind(log2);
1577
+ info = log2.info.bind(log2);
1578
+ success = log2.success.bind(log2);
1298
1579
  }
1299
1580
  });
1300
1581
 
@@ -1512,9 +1793,9 @@ var require_is_glob = __commonJS({
1512
1793
  index += 2;
1513
1794
  var close = chars[open];
1514
1795
  if (close) {
1515
- var n = str.indexOf(close, index);
1516
- if (n !== -1) {
1517
- index = n + 1;
1796
+ var n3 = str.indexOf(close, index);
1797
+ if (n3 !== -1) {
1798
+ index = n3 + 1;
1518
1799
  }
1519
1800
  }
1520
1801
  if (str[index] === "!") {
@@ -1540,9 +1821,9 @@ var require_is_glob = __commonJS({
1540
1821
  index += 2;
1541
1822
  var close = chars[open];
1542
1823
  if (close) {
1543
- var n = str.indexOf(close, index);
1544
- if (n !== -1) {
1545
- index = n + 1;
1824
+ var n3 = str.indexOf(close, index);
1825
+ if (n3 !== -1) {
1826
+ index = n3 + 1;
1546
1827
  }
1547
1828
  }
1548
1829
  if (str[index] === "!") {
@@ -1620,8 +1901,8 @@ var require_utils = __commonJS({
1620
1901
  if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
1621
1902
  return (Number(max) - Number(min)) / Number(step) >= limit;
1622
1903
  };
1623
- exports.escapeNode = (block, n = 0, type) => {
1624
- const node = block.nodes[n];
1904
+ exports.escapeNode = (block2, n3 = 0, type) => {
1905
+ const node = block2.nodes[n3];
1625
1906
  if (!node) return;
1626
1907
  if (type && node.type === type || node.type === "open" || node.type === "close") {
1627
1908
  if (node.escaped !== true) {
@@ -1638,15 +1919,15 @@ var require_utils = __commonJS({
1638
1919
  }
1639
1920
  return false;
1640
1921
  };
1641
- exports.isInvalidBrace = (block) => {
1642
- if (block.type !== "brace") return false;
1643
- if (block.invalid === true || block.dollar) return true;
1644
- if (block.commas >> 0 + block.ranges >> 0 === 0) {
1645
- block.invalid = true;
1922
+ exports.isInvalidBrace = (block2) => {
1923
+ if (block2.type !== "brace") return false;
1924
+ if (block2.invalid === true || block2.dollar) return true;
1925
+ if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
1926
+ block2.invalid = true;
1646
1927
  return true;
1647
1928
  }
1648
- if (block.open !== true || block.close !== true) {
1649
- block.invalid = true;
1929
+ if (block2.open !== true || block2.close !== true) {
1930
+ block2.invalid = true;
1650
1931
  return true;
1651
1932
  }
1652
1933
  return false;
@@ -1665,8 +1946,8 @@ var require_utils = __commonJS({
1665
1946
  exports.flatten = (...args) => {
1666
1947
  const result = [];
1667
1948
  const flat = (arr) => {
1668
- for (let i = 0; i < arr.length; i++) {
1669
- const ele = arr[i];
1949
+ for (let i2 = 0; i2 < arr.length; i2++) {
1950
+ const ele = arr[i2];
1670
1951
  if (Array.isArray(ele)) {
1671
1952
  flat(ele);
1672
1953
  continue;
@@ -1760,9 +2041,9 @@ var require_to_regex_range = __commonJS({
1760
2041
  if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
1761
2042
  return toRegexRange.cache[cacheKey].result;
1762
2043
  }
1763
- let a = Math.min(min, max);
2044
+ let a2 = Math.min(min, max);
1764
2045
  let b = Math.max(min, max);
1765
- if (Math.abs(a - b) === 1) {
2046
+ if (Math.abs(a2 - b) === 1) {
1766
2047
  let result = min + "|" + max;
1767
2048
  if (opts.capture) {
1768
2049
  return `(${result})`;
@@ -1773,20 +2054,20 @@ var require_to_regex_range = __commonJS({
1773
2054
  return `(?:${result})`;
1774
2055
  }
1775
2056
  let isPadded = hasPadding(min) || hasPadding(max);
1776
- let state = { min, max, a, b };
2057
+ let state = { min, max, a: a2, b };
1777
2058
  let positives = [];
1778
2059
  let negatives = [];
1779
2060
  if (isPadded) {
1780
2061
  state.isPadded = isPadded;
1781
2062
  state.maxLen = String(state.max).length;
1782
2063
  }
1783
- if (a < 0) {
2064
+ if (a2 < 0) {
1784
2065
  let newMin = b < 0 ? Math.abs(b) : 1;
1785
- negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
1786
- a = state.a = 0;
2066
+ negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
2067
+ a2 = state.a = 0;
1787
2068
  }
1788
2069
  if (b >= 0) {
1789
- positives = splitToPatterns(a, b, state, opts);
2070
+ positives = splitToPatterns(a2, b, state, opts);
1790
2071
  }
1791
2072
  state.negatives = negatives;
1792
2073
  state.positives = positives;
@@ -1834,8 +2115,8 @@ var require_to_regex_range = __commonJS({
1834
2115
  let digits = zipped.length;
1835
2116
  let pattern = "";
1836
2117
  let count = 0;
1837
- for (let i = 0; i < digits; i++) {
1838
- let [startDigit, stopDigit] = zipped[i];
2118
+ for (let i2 = 0; i2 < digits; i2++) {
2119
+ let [startDigit, stopDigit] = zipped[i2];
1839
2120
  if (startDigit === stopDigit) {
1840
2121
  pattern += startDigit;
1841
2122
  } else if (startDigit !== "0" || stopDigit !== "9") {
@@ -1854,8 +2135,8 @@ var require_to_regex_range = __commonJS({
1854
2135
  let tokens = [];
1855
2136
  let start = min;
1856
2137
  let prev;
1857
- for (let i = 0; i < ranges.length; i++) {
1858
- let max2 = ranges[i];
2138
+ for (let i2 = 0; i2 < ranges.length; i2++) {
2139
+ let max2 = ranges[i2];
1859
2140
  let obj = rangeToPattern(String(start), String(max2), options);
1860
2141
  let zeros = "";
1861
2142
  if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
@@ -1890,13 +2171,13 @@ var require_to_regex_range = __commonJS({
1890
2171
  }
1891
2172
  return result;
1892
2173
  }
1893
- function zip(a, b) {
2174
+ function zip(a2, b) {
1894
2175
  let arr = [];
1895
- for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
2176
+ for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
1896
2177
  return arr;
1897
2178
  }
1898
- function compare(a, b) {
1899
- return a > b ? 1 : b > a ? -1 : 0;
2179
+ function compare(a2, b) {
2180
+ return a2 > b ? 1 : b > a2 ? -1 : 0;
1900
2181
  }
1901
2182
  function contains(arr, key, val) {
1902
2183
  return arr.some((ele) => ele[key] === val);
@@ -1914,8 +2195,8 @@ var require_to_regex_range = __commonJS({
1914
2195
  }
1915
2196
  return "";
1916
2197
  }
1917
- function toCharacterClass(a, b, options) {
1918
- return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
2198
+ function toCharacterClass(a2, b, options) {
2199
+ return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
1919
2200
  }
1920
2201
  function hasPadding(str) {
1921
2202
  return /^-?(0+)\d/.test(str);
@@ -1994,8 +2275,8 @@ var require_fill_range = __commonJS({
1994
2275
  return negative ? "-" + input : input;
1995
2276
  };
1996
2277
  var toSequence = (parts, options, maxLen) => {
1997
- parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1998
- parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
2278
+ parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
2279
+ parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
1999
2280
  let prefix = options.capture ? "" : "?:";
2000
2281
  let positives = "";
2001
2282
  let negatives = "";
@@ -2016,12 +2297,12 @@ var require_fill_range = __commonJS({
2016
2297
  }
2017
2298
  return result;
2018
2299
  };
2019
- var toRange = (a, b, isNumbers, options) => {
2300
+ var toRange = (a2, b, isNumbers, options) => {
2020
2301
  if (isNumbers) {
2021
- return toRegexRange(a, b, { wrap: false, ...options });
2302
+ return toRegexRange(a2, b, { wrap: false, ...options });
2022
2303
  }
2023
- let start = String.fromCharCode(a);
2024
- if (a === b) return start;
2304
+ let start = String.fromCharCode(a2);
2305
+ if (a2 === b) return start;
2025
2306
  let stop = String.fromCharCode(b);
2026
2307
  return `[${start}-${stop}]`;
2027
2308
  };
@@ -2047,15 +2328,15 @@ var require_fill_range = __commonJS({
2047
2328
  return [];
2048
2329
  };
2049
2330
  var fillNumbers = (start, end, step = 1, options = {}) => {
2050
- let a = Number(start);
2331
+ let a2 = Number(start);
2051
2332
  let b = Number(end);
2052
- if (!Number.isInteger(a) || !Number.isInteger(b)) {
2333
+ if (!Number.isInteger(a2) || !Number.isInteger(b)) {
2053
2334
  if (options.strictRanges === true) throw rangeError([start, end]);
2054
2335
  return [];
2055
2336
  }
2056
- if (a === 0) a = 0;
2337
+ if (a2 === 0) a2 = 0;
2057
2338
  if (b === 0) b = 0;
2058
- let descending = a > b;
2339
+ let descending = a2 > b;
2059
2340
  let startString = String(start);
2060
2341
  let endString = String(end);
2061
2342
  let stepString = String(step);
@@ -2071,13 +2352,13 @@ var require_fill_range = __commonJS({
2071
2352
  let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
2072
2353
  let range = [];
2073
2354
  let index = 0;
2074
- while (descending ? a >= b : a <= b) {
2355
+ while (descending ? a2 >= b : a2 <= b) {
2075
2356
  if (options.toRegex === true && step > 1) {
2076
- push(a);
2357
+ push(a2);
2077
2358
  } else {
2078
- range.push(pad(format(a, index), maxLen, toNumber));
2359
+ range.push(pad(format(a2, index), maxLen, toNumber));
2079
2360
  }
2080
- a = descending ? a - step : a + step;
2361
+ a2 = descending ? a2 - step : a2 + step;
2081
2362
  index++;
2082
2363
  }
2083
2364
  if (options.toRegex === true) {
@@ -2090,19 +2371,19 @@ var require_fill_range = __commonJS({
2090
2371
  return invalidRange(start, end, options);
2091
2372
  }
2092
2373
  let format = options.transform || ((val) => String.fromCharCode(val));
2093
- let a = `${start}`.charCodeAt(0);
2374
+ let a2 = `${start}`.charCodeAt(0);
2094
2375
  let b = `${end}`.charCodeAt(0);
2095
- let descending = a > b;
2096
- let min = Math.min(a, b);
2097
- let max = Math.max(a, b);
2376
+ let descending = a2 > b;
2377
+ let min = Math.min(a2, b);
2378
+ let max = Math.max(a2, b);
2098
2379
  if (options.toRegex && step === 1) {
2099
2380
  return toRange(min, max, false, options);
2100
2381
  }
2101
2382
  let range = [];
2102
2383
  let index = 0;
2103
- while (descending ? a >= b : a <= b) {
2104
- range.push(format(a, index));
2105
- a = descending ? a - step : a + step;
2384
+ while (descending ? a2 >= b : a2 <= b) {
2385
+ range.push(format(a2, index));
2386
+ a2 = descending ? a2 - step : a2 + step;
2106
2387
  index++;
2107
2388
  }
2108
2389
  if (options.toRegex === true) {
@@ -2225,18 +2506,18 @@ var require_expand = __commonJS({
2225
2506
  const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
2226
2507
  const walk = (node, parent = {}) => {
2227
2508
  node.queue = [];
2228
- let p2 = parent;
2229
- let q2 = parent.queue;
2230
- while (p2.type !== "brace" && p2.type !== "root" && p2.parent) {
2231
- p2 = p2.parent;
2232
- q2 = p2.queue;
2509
+ let p = parent;
2510
+ let q = parent.queue;
2511
+ while (p.type !== "brace" && p.type !== "root" && p.parent) {
2512
+ p = p.parent;
2513
+ q = p.queue;
2233
2514
  }
2234
2515
  if (node.invalid || node.dollar) {
2235
- q2.push(append(q2.pop(), stringify2(node, options)));
2516
+ q.push(append(q.pop(), stringify2(node, options)));
2236
2517
  return;
2237
2518
  }
2238
2519
  if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
2239
- q2.push(append(q2.pop(), ["{}"]));
2520
+ q.push(append(q.pop(), ["{}"]));
2240
2521
  return;
2241
2522
  }
2242
2523
  if (node.nodes && node.ranges > 0) {
@@ -2248,26 +2529,26 @@ var require_expand = __commonJS({
2248
2529
  if (range.length === 0) {
2249
2530
  range = stringify2(node, options);
2250
2531
  }
2251
- q2.push(append(q2.pop(), range));
2532
+ q.push(append(q.pop(), range));
2252
2533
  node.nodes = [];
2253
2534
  return;
2254
2535
  }
2255
2536
  const enclose = utils.encloseBrace(node);
2256
2537
  let queue = node.queue;
2257
- let block = node;
2258
- while (block.type !== "brace" && block.type !== "root" && block.parent) {
2259
- block = block.parent;
2260
- queue = block.queue;
2538
+ let block2 = node;
2539
+ while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
2540
+ block2 = block2.parent;
2541
+ queue = block2.queue;
2261
2542
  }
2262
- for (let i = 0; i < node.nodes.length; i++) {
2263
- const child = node.nodes[i];
2543
+ for (let i2 = 0; i2 < node.nodes.length; i2++) {
2544
+ const child = node.nodes[i2];
2264
2545
  if (child.type === "comma" && node.type === "brace") {
2265
- if (i === 1) queue.push("");
2546
+ if (i2 === 1) queue.push("");
2266
2547
  queue.push("");
2267
2548
  continue;
2268
2549
  }
2269
2550
  if (child.type === "close") {
2270
- q2.push(append(q2.pop(), queue, enclose));
2551
+ q.push(append(q.pop(), queue, enclose));
2271
2552
  continue;
2272
2553
  }
2273
2554
  if (child.value && child.type !== "open") {
@@ -2434,7 +2715,7 @@ var require_parse = __commonJS({
2434
2715
  }
2435
2716
  const ast = { type: "root", input, nodes: [] };
2436
2717
  const stack = [ast];
2437
- let block = ast;
2718
+ let block2 = ast;
2438
2719
  let prev = ast;
2439
2720
  let brackets = 0;
2440
2721
  const length = input.length;
@@ -2450,15 +2731,15 @@ var require_parse = __commonJS({
2450
2731
  prev.value += node.value;
2451
2732
  return;
2452
2733
  }
2453
- block.nodes.push(node);
2454
- node.parent = block;
2734
+ block2.nodes.push(node);
2735
+ node.parent = block2;
2455
2736
  node.prev = prev;
2456
2737
  prev = node;
2457
2738
  return node;
2458
2739
  };
2459
2740
  push({ type: "bos" });
2460
2741
  while (index < length) {
2461
- block = stack[stack.length - 1];
2742
+ block2 = stack[stack.length - 1];
2462
2743
  value = advance();
2463
2744
  if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
2464
2745
  continue;
@@ -2495,19 +2776,19 @@ var require_parse = __commonJS({
2495
2776
  continue;
2496
2777
  }
2497
2778
  if (value === CHAR_LEFT_PARENTHESES) {
2498
- block = push({ type: "paren", nodes: [] });
2499
- stack.push(block);
2779
+ block2 = push({ type: "paren", nodes: [] });
2780
+ stack.push(block2);
2500
2781
  push({ type: "text", value });
2501
2782
  continue;
2502
2783
  }
2503
2784
  if (value === CHAR_RIGHT_PARENTHESES) {
2504
- if (block.type !== "paren") {
2785
+ if (block2.type !== "paren") {
2505
2786
  push({ type: "text", value });
2506
2787
  continue;
2507
2788
  }
2508
- block = stack.pop();
2789
+ block2 = stack.pop();
2509
2790
  push({ type: "text", value });
2510
- block = stack[stack.length - 1];
2791
+ block2 = stack[stack.length - 1];
2511
2792
  continue;
2512
2793
  }
2513
2794
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
@@ -2532,7 +2813,7 @@ var require_parse = __commonJS({
2532
2813
  }
2533
2814
  if (value === CHAR_LEFT_CURLY_BRACE) {
2534
2815
  depth++;
2535
- const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
2816
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
2536
2817
  const brace = {
2537
2818
  type: "brace",
2538
2819
  open: true,
@@ -2543,52 +2824,52 @@ var require_parse = __commonJS({
2543
2824
  ranges: 0,
2544
2825
  nodes: []
2545
2826
  };
2546
- block = push(brace);
2547
- stack.push(block);
2827
+ block2 = push(brace);
2828
+ stack.push(block2);
2548
2829
  push({ type: "open", value });
2549
2830
  continue;
2550
2831
  }
2551
2832
  if (value === CHAR_RIGHT_CURLY_BRACE) {
2552
- if (block.type !== "brace") {
2833
+ if (block2.type !== "brace") {
2553
2834
  push({ type: "text", value });
2554
2835
  continue;
2555
2836
  }
2556
2837
  const type = "close";
2557
- block = stack.pop();
2558
- block.close = true;
2838
+ block2 = stack.pop();
2839
+ block2.close = true;
2559
2840
  push({ type, value });
2560
2841
  depth--;
2561
- block = stack[stack.length - 1];
2842
+ block2 = stack[stack.length - 1];
2562
2843
  continue;
2563
2844
  }
2564
2845
  if (value === CHAR_COMMA && depth > 0) {
2565
- if (block.ranges > 0) {
2566
- block.ranges = 0;
2567
- const open = block.nodes.shift();
2568
- block.nodes = [open, { type: "text", value: stringify2(block) }];
2846
+ if (block2.ranges > 0) {
2847
+ block2.ranges = 0;
2848
+ const open = block2.nodes.shift();
2849
+ block2.nodes = [open, { type: "text", value: stringify2(block2) }];
2569
2850
  }
2570
2851
  push({ type: "comma", value });
2571
- block.commas++;
2852
+ block2.commas++;
2572
2853
  continue;
2573
2854
  }
2574
- if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
2575
- const siblings = block.nodes;
2855
+ if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
2856
+ const siblings = block2.nodes;
2576
2857
  if (depth === 0 || siblings.length === 0) {
2577
2858
  push({ type: "text", value });
2578
2859
  continue;
2579
2860
  }
2580
2861
  if (prev.type === "dot") {
2581
- block.range = [];
2862
+ block2.range = [];
2582
2863
  prev.value += value;
2583
2864
  prev.type = "range";
2584
- if (block.nodes.length !== 3 && block.nodes.length !== 5) {
2585
- block.invalid = true;
2586
- block.ranges = 0;
2865
+ if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
2866
+ block2.invalid = true;
2867
+ block2.ranges = 0;
2587
2868
  prev.type = "text";
2588
2869
  continue;
2589
2870
  }
2590
- block.ranges++;
2591
- block.args = [];
2871
+ block2.ranges++;
2872
+ block2.args = [];
2592
2873
  continue;
2593
2874
  }
2594
2875
  if (prev.type === "range") {
@@ -2596,7 +2877,7 @@ var require_parse = __commonJS({
2596
2877
  const before = siblings[siblings.length - 1];
2597
2878
  before.value += prev.value + value;
2598
2879
  prev = before;
2599
- block.ranges--;
2880
+ block2.ranges--;
2600
2881
  continue;
2601
2882
  }
2602
2883
  push({ type: "dot", value });
@@ -2605,9 +2886,9 @@ var require_parse = __commonJS({
2605
2886
  push({ type: "text", value });
2606
2887
  }
2607
2888
  do {
2608
- block = stack.pop();
2609
- if (block.type !== "root") {
2610
- block.nodes.forEach((node) => {
2889
+ block2 = stack.pop();
2890
+ if (block2.type !== "root") {
2891
+ block2.nodes.forEach((node) => {
2611
2892
  if (!node.nodes) {
2612
2893
  if (node.type === "open") node.isOpen = true;
2613
2894
  if (node.type === "close") node.isClose = true;
@@ -2616,8 +2897,8 @@ var require_parse = __commonJS({
2616
2897
  }
2617
2898
  });
2618
2899
  const parent = stack[stack.length - 1];
2619
- const index2 = parent.nodes.indexOf(block);
2620
- parent.nodes.splice(index2, 1, ...block.nodes);
2900
+ const index2 = parent.nodes.indexOf(block2);
2901
+ parent.nodes.splice(index2, 1, ...block2.nodes);
2621
2902
  }
2622
2903
  } while (stack.length > 0);
2623
2904
  push({ type: "eos" });
@@ -3250,9 +3531,9 @@ var require_scan = __commonJS({
3250
3531
  if (opts.parts === true || opts.tokens === true) {
3251
3532
  let prevIndex;
3252
3533
  for (let idx = 0; idx < slashes.length; idx++) {
3253
- const n = prevIndex ? prevIndex + 1 : start;
3254
- const i = slashes[idx];
3255
- const value = input.slice(n, i);
3534
+ const n3 = prevIndex ? prevIndex + 1 : start;
3535
+ const i2 = slashes[idx];
3536
+ const value = input.slice(n3, i2);
3256
3537
  if (opts.tokens) {
3257
3538
  if (idx === 0 && start !== 0) {
3258
3539
  tokens[idx].isPrefix = true;
@@ -3266,7 +3547,7 @@ var require_scan = __commonJS({
3266
3547
  if (idx !== 0 || value !== "") {
3267
3548
  parts.push(value);
3268
3549
  }
3269
- prevIndex = i;
3550
+ prevIndex = i2;
3270
3551
  }
3271
3552
  if (prevIndex && prevIndex + 1 < input.length) {
3272
3553
  const value = input.slice(prevIndex + 1);
@@ -3395,15 +3676,15 @@ var require_parse2 = __commonJS({
3395
3676
  };
3396
3677
  var hasRepeatedCharPrefixOverlap = (branches) => {
3397
3678
  const values = branches.map(normalizeSimpleBranch).filter(Boolean);
3398
- for (let i = 0; i < values.length; i++) {
3399
- for (let j2 = i + 1; j2 < values.length; j2++) {
3400
- const a = values[i];
3401
- const b = values[j2];
3402
- const char = a[0];
3403
- if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
3679
+ for (let i2 = 0; i2 < values.length; i2++) {
3680
+ for (let j = i2 + 1; j < values.length; j++) {
3681
+ const a2 = values[i2];
3682
+ const b = values[j];
3683
+ const char = a2[0];
3684
+ if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
3404
3685
  continue;
3405
3686
  }
3406
- if (a === b || a.startsWith(b) || b.startsWith(a)) {
3687
+ if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
3407
3688
  return true;
3408
3689
  }
3409
3690
  }
@@ -3418,8 +3699,8 @@ var require_parse2 = __commonJS({
3418
3699
  let paren = 0;
3419
3700
  let quote = 0;
3420
3701
  let escaped = false;
3421
- for (let i = 1; i < pattern.length; i++) {
3422
- const ch = pattern[i];
3702
+ for (let i2 = 1; i2 < pattern.length; i2++) {
3703
+ const ch = pattern[i2];
3423
3704
  if (escaped === true) {
3424
3705
  escaped = false;
3425
3706
  continue;
@@ -3453,13 +3734,13 @@ var require_parse2 = __commonJS({
3453
3734
  if (ch === ")") {
3454
3735
  paren--;
3455
3736
  if (paren === 0) {
3456
- if (requireEnd === true && i !== pattern.length - 1) {
3737
+ if (requireEnd === true && i2 !== pattern.length - 1) {
3457
3738
  return;
3458
3739
  }
3459
3740
  return {
3460
3741
  type: pattern[0],
3461
- body: pattern.slice(2, i),
3462
- end: i
3742
+ body: pattern.slice(2, i2),
3743
+ end: i2
3463
3744
  };
3464
3745
  }
3465
3746
  }
@@ -3591,7 +3872,7 @@ var require_parse2 = __commonJS({
3591
3872
  let prev = bos;
3592
3873
  let value;
3593
3874
  const eos = () => state.index === len - 1;
3594
- const peek = state.peek = (n = 1) => input[state.index + n];
3875
+ const peek = state.peek = (n3 = 1) => input[state.index + n3];
3595
3876
  const advance = state.advance = () => input[++state.index] || "";
3596
3877
  const remaining = () => input.slice(state.index + 1);
3597
3878
  const consume = (value2 = "", num = 0) => {
@@ -3672,10 +3953,10 @@ var require_parse2 = __commonJS({
3672
3953
  open.type = "text";
3673
3954
  open.value = literal;
3674
3955
  open.output = safeOutput || utils.escapeRegex(literal);
3675
- for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
3676
- tokens[i].value = "";
3677
- tokens[i].output = "";
3678
- delete tokens[i].suffix;
3956
+ for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
3957
+ tokens[i2].value = "";
3958
+ tokens[i2].output = "";
3959
+ delete tokens[i2].suffix;
3679
3960
  }
3680
3961
  state.output = token.output + open.output;
3681
3962
  state.backtrack = true;
@@ -3918,13 +4199,13 @@ var require_parse2 = __commonJS({
3918
4199
  if (brace.dots === true) {
3919
4200
  const arr = tokens.slice();
3920
4201
  const range = [];
3921
- for (let i = arr.length - 1; i >= 0; i--) {
4202
+ for (let i2 = arr.length - 1; i2 >= 0; i2--) {
3922
4203
  tokens.pop();
3923
- if (arr[i].type === "brace") {
4204
+ if (arr[i2].type === "brace") {
3924
4205
  break;
3925
4206
  }
3926
- if (arr[i].type !== "dots") {
3927
- range.unshift(arr[i].value);
4207
+ if (arr[i2].type !== "dots") {
4208
+ range.unshift(arr[i2].value);
3928
4209
  }
3929
4210
  }
3930
4211
  output = expandRange(range, opts);
@@ -4383,7 +4664,7 @@ var require_picomatch = __commonJS({
4383
4664
  };
4384
4665
  picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
4385
4666
  picomatch.parse = (pattern, options) => {
4386
- if (Array.isArray(pattern)) return pattern.map((p2) => picomatch.parse(p2, options));
4667
+ if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
4387
4668
  return parse2(pattern, { ...options, fastpaths: false });
4388
4669
  };
4389
4670
  picomatch.scan = (input, options) => scan(input, options);
@@ -4467,8 +4748,8 @@ var require_micromatch = __commonJS({
4467
4748
  options.onResult(state);
4468
4749
  }
4469
4750
  };
4470
- for (let i = 0; i < patterns.length; i++) {
4471
- let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
4751
+ for (let i2 = 0; i2 < patterns.length; i2++) {
4752
+ let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
4472
4753
  let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
4473
4754
  if (negated) negatives++;
4474
4755
  for (let item of list) {
@@ -4490,7 +4771,7 @@ var require_micromatch = __commonJS({
4490
4771
  throw new Error(`No matches found for "${patterns.join(", ")}"`);
4491
4772
  }
4492
4773
  if (options.nonull === true || options.nullglob === true) {
4493
- return options.unescape ? patterns.map((p2) => p2.replace(/\\/g, "")) : patterns;
4774
+ return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
4494
4775
  }
4495
4776
  }
4496
4777
  return matches;
@@ -4520,7 +4801,7 @@ var require_micromatch = __commonJS({
4520
4801
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4521
4802
  }
4522
4803
  if (Array.isArray(pattern)) {
4523
- return pattern.some((p2) => micromatch.contains(str, p2, options));
4804
+ return pattern.some((p) => micromatch.contains(str, p, options));
4524
4805
  }
4525
4806
  if (typeof pattern === "string") {
4526
4807
  if (isEmptyString(str) || isEmptyString(pattern)) {
@@ -4565,7 +4846,7 @@ var require_micromatch = __commonJS({
4565
4846
  if (typeof str !== "string") {
4566
4847
  throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
4567
4848
  }
4568
- return [].concat(patterns).every((p2) => picomatch(p2, options)(str));
4849
+ return [].concat(patterns).every((p) => picomatch(p, options)(str));
4569
4850
  };
4570
4851
  micromatch.capture = (glob2, input, options) => {
4571
4852
  let posix = utils.isWindows(options);
@@ -4716,7 +4997,7 @@ var require_pattern = __commonJS({
4716
4997
  exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
4717
4998
  function expandBraceExpansion(pattern) {
4718
4999
  const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
4719
- patterns.sort((a, b) => a.length - b.length);
5000
+ patterns.sort((a2, b) => a2.length - b.length);
4720
5001
  return patterns.filter((pattern2) => pattern2 !== "");
4721
5002
  }
4722
5003
  exports.expandBraceExpansion = expandBraceExpansion;
@@ -4797,8 +5078,8 @@ var require_merge2 = __commonJS({
4797
5078
  }
4798
5079
  const mergedStream = PassThrough(options);
4799
5080
  function addStream() {
4800
- for (let i = 0, len = arguments.length; i < len; i++) {
4801
- streamsQueue.push(pauseStreams(arguments[i], options));
5081
+ for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
5082
+ streamsQueue.push(pauseStreams(arguments[i2], options));
4802
5083
  }
4803
5084
  mergeStream();
4804
5085
  return this;
@@ -4847,8 +5128,8 @@ var require_merge2 = __commonJS({
4847
5128
  stream.pipe(mergedStream, { end: false });
4848
5129
  stream.resume();
4849
5130
  }
4850
- for (let i = 0; i < streams.length; i++) {
4851
- pipe(streams[i]);
5131
+ for (let i2 = 0; i2 < streams.length; i2++) {
5132
+ pipe(streams[i2]);
4852
5133
  }
4853
5134
  next();
4854
5135
  }
@@ -4879,8 +5160,8 @@ var require_merge2 = __commonJS({
4879
5160
  }
4880
5161
  streams.pause();
4881
5162
  } else {
4882
- for (let i = 0, len = streams.length; i < len; i++) {
4883
- streams[i] = pauseStreams(streams[i], options);
5163
+ for (let i2 = 0, len = streams.length; i2 < len; i2++) {
5164
+ streams[i2] = pauseStreams(streams[i2], options);
4884
5165
  }
4885
5166
  }
4886
5167
  return streams;
@@ -4962,13 +5243,13 @@ var require_tasks = __commonJS({
4962
5243
  Object.defineProperty(exports, "__esModule", { value: true });
4963
5244
  exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
4964
5245
  var utils = require_utils3();
4965
- function generate(input, settings) {
4966
- const patterns = processPatterns(input, settings);
4967
- const ignore = processPatterns(settings.ignore, settings);
5246
+ function generate(input, settings2) {
5247
+ const patterns = processPatterns(input, settings2);
5248
+ const ignore = processPatterns(settings2.ignore, settings2);
4968
5249
  const positivePatterns = getPositivePatterns(patterns);
4969
5250
  const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
4970
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
4971
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
5251
+ const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
5252
+ const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
4972
5253
  const staticTasks = convertPatternsToTasks(
4973
5254
  staticPatterns,
4974
5255
  negativePatterns,
@@ -4984,12 +5265,12 @@ var require_tasks = __commonJS({
4984
5265
  return staticTasks.concat(dynamicTasks);
4985
5266
  }
4986
5267
  exports.generate = generate;
4987
- function processPatterns(input, settings) {
5268
+ function processPatterns(input, settings2) {
4988
5269
  let patterns = input;
4989
- if (settings.braceExpansion) {
5270
+ if (settings2.braceExpansion) {
4990
5271
  patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
4991
5272
  }
4992
- if (settings.baseNameMatch) {
5273
+ if (settings2.baseNameMatch) {
4993
5274
  patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
4994
5275
  }
4995
5276
  return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
@@ -5020,7 +5301,7 @@ var require_tasks = __commonJS({
5020
5301
  }
5021
5302
  exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
5022
5303
  function groupPatternsByBaseDirectory(patterns) {
5023
- const group = {};
5304
+ const group2 = {};
5024
5305
  return patterns.reduce((collection, pattern) => {
5025
5306
  const base = utils.pattern.getBaseDirectory(pattern);
5026
5307
  if (base in collection) {
@@ -5029,7 +5310,7 @@ var require_tasks = __commonJS({
5029
5310
  collection[base] = [pattern];
5030
5311
  }
5031
5312
  return collection;
5032
- }, group);
5313
+ }, group2);
5033
5314
  }
5034
5315
  exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
5035
5316
  function convertPatternGroupsToTasks(positive, negative, dynamic) {
@@ -5058,26 +5339,26 @@ var require_async = __commonJS({
5058
5339
  init_utils2();
5059
5340
  Object.defineProperty(exports, "__esModule", { value: true });
5060
5341
  exports.read = void 0;
5061
- function read2(path, settings, callback) {
5062
- settings.fs.lstat(path, (lstatError, lstat) => {
5342
+ function read2(path, settings2, callback) {
5343
+ settings2.fs.lstat(path, (lstatError, lstat) => {
5063
5344
  if (lstatError !== null) {
5064
5345
  callFailureCallback(callback, lstatError);
5065
5346
  return;
5066
5347
  }
5067
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5348
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
5068
5349
  callSuccessCallback(callback, lstat);
5069
5350
  return;
5070
5351
  }
5071
- settings.fs.stat(path, (statError, stat) => {
5352
+ settings2.fs.stat(path, (statError, stat) => {
5072
5353
  if (statError !== null) {
5073
- if (settings.throwErrorOnBrokenSymbolicLink) {
5354
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5074
5355
  callFailureCallback(callback, statError);
5075
5356
  return;
5076
5357
  }
5077
5358
  callSuccessCallback(callback, lstat);
5078
5359
  return;
5079
5360
  }
5080
- if (settings.markSymbolicLink) {
5361
+ if (settings2.markSymbolicLink) {
5081
5362
  stat.isSymbolicLink = () => true;
5082
5363
  }
5083
5364
  callSuccessCallback(callback, stat);
@@ -5101,19 +5382,19 @@ var require_sync = __commonJS({
5101
5382
  init_utils2();
5102
5383
  Object.defineProperty(exports, "__esModule", { value: true });
5103
5384
  exports.read = void 0;
5104
- function read2(path, settings) {
5105
- const lstat = settings.fs.lstatSync(path);
5106
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
5385
+ function read2(path, settings2) {
5386
+ const lstat = settings2.fs.lstatSync(path);
5387
+ if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
5107
5388
  return lstat;
5108
5389
  }
5109
5390
  try {
5110
- const stat = settings.fs.statSync(path);
5111
- if (settings.markSymbolicLink) {
5391
+ const stat = settings2.fs.statSync(path);
5392
+ if (settings2.markSymbolicLink) {
5112
5393
  stat.isSymbolicLink = () => true;
5113
5394
  }
5114
5395
  return stat;
5115
5396
  } catch (error2) {
5116
- if (!settings.throwErrorOnBrokenSymbolicLink) {
5397
+ if (!settings2.throwErrorOnBrokenSymbolicLink) {
5117
5398
  return lstat;
5118
5399
  }
5119
5400
  throw error2;
@@ -5190,8 +5471,8 @@ var require_out = __commonJS({
5190
5471
  }
5191
5472
  exports.stat = stat;
5192
5473
  function statSync3(path, optionsOrSettings) {
5193
- const settings = getSettings(optionsOrSettings);
5194
- return sync.read(path, settings);
5474
+ const settings2 = getSettings(optionsOrSettings);
5475
+ return sync.read(path, settings2);
5195
5476
  }
5196
5477
  exports.statSync = statSync3;
5197
5478
  function getSettings(settingsOrOptions = {}) {
@@ -5239,8 +5520,8 @@ var require_run_parallel = __commonJS({
5239
5520
  if (isSync) queueMicrotask2(end);
5240
5521
  else end();
5241
5522
  }
5242
- function each(i, err, result) {
5243
- results[i] = result;
5523
+ function each(i2, err, result) {
5524
+ results[i2] = result;
5244
5525
  if (--pending === 0 || err) {
5245
5526
  done(err);
5246
5527
  }
@@ -5254,9 +5535,9 @@ var require_run_parallel = __commonJS({
5254
5535
  });
5255
5536
  });
5256
5537
  } else {
5257
- tasks.forEach(function(task, i) {
5538
+ tasks.forEach(function(task, i2) {
5258
5539
  task(function(err, result) {
5259
- each(i, err, result);
5540
+ each(i2, err, result);
5260
5541
  });
5261
5542
  });
5262
5543
  }
@@ -5331,11 +5612,11 @@ var require_common = __commonJS({
5331
5612
  init_utils2();
5332
5613
  Object.defineProperty(exports, "__esModule", { value: true });
5333
5614
  exports.joinPathSegments = void 0;
5334
- function joinPathSegments(a, b, separator) {
5335
- if (a.endsWith(separator)) {
5336
- return a + b;
5615
+ function joinPathSegments(a2, b, separator) {
5616
+ if (a2.endsWith(separator)) {
5617
+ return a2 + b;
5337
5618
  }
5338
- return a + separator + b;
5619
+ return a2 + separator + b;
5339
5620
  }
5340
5621
  exports.joinPathSegments = joinPathSegments;
5341
5622
  }
@@ -5353,16 +5634,16 @@ var require_async2 = __commonJS({
5353
5634
  var constants_1 = require_constants3();
5354
5635
  var utils = require_utils4();
5355
5636
  var common = require_common();
5356
- function read2(directory, settings, callback) {
5357
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5358
- readdirWithFileTypes(directory, settings, callback);
5637
+ function read2(directory, settings2, callback) {
5638
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5639
+ readdirWithFileTypes(directory, settings2, callback);
5359
5640
  return;
5360
5641
  }
5361
- readdir2(directory, settings, callback);
5642
+ readdir2(directory, settings2, callback);
5362
5643
  }
5363
5644
  exports.read = read2;
5364
- function readdirWithFileTypes(directory, settings, callback) {
5365
- settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5645
+ function readdirWithFileTypes(directory, settings2, callback) {
5646
+ settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
5366
5647
  if (readdirError !== null) {
5367
5648
  callFailureCallback(callback, readdirError);
5368
5649
  return;
@@ -5370,13 +5651,13 @@ var require_async2 = __commonJS({
5370
5651
  const entries = dirents.map((dirent) => ({
5371
5652
  dirent,
5372
5653
  name: dirent.name,
5373
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5654
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5374
5655
  }));
5375
- if (!settings.followSymbolicLinks) {
5656
+ if (!settings2.followSymbolicLinks) {
5376
5657
  callSuccessCallback(callback, entries);
5377
5658
  return;
5378
5659
  }
5379
- const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
5660
+ const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
5380
5661
  rpl(tasks, (rplError, rplEntries) => {
5381
5662
  if (rplError !== null) {
5382
5663
  callFailureCallback(callback, rplError);
@@ -5387,15 +5668,15 @@ var require_async2 = __commonJS({
5387
5668
  });
5388
5669
  }
5389
5670
  exports.readdirWithFileTypes = readdirWithFileTypes;
5390
- function makeRplTaskEntry(entry, settings) {
5671
+ function makeRplTaskEntry(entry, settings2) {
5391
5672
  return (done) => {
5392
5673
  if (!entry.dirent.isSymbolicLink()) {
5393
5674
  done(null, entry);
5394
5675
  return;
5395
5676
  }
5396
- settings.fs.stat(entry.path, (statError, stats) => {
5677
+ settings2.fs.stat(entry.path, (statError, stats) => {
5397
5678
  if (statError !== null) {
5398
- if (settings.throwErrorOnBrokenSymbolicLink) {
5679
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5399
5680
  done(statError);
5400
5681
  return;
5401
5682
  }
@@ -5407,16 +5688,16 @@ var require_async2 = __commonJS({
5407
5688
  });
5408
5689
  };
5409
5690
  }
5410
- function readdir2(directory, settings, callback) {
5411
- settings.fs.readdir(directory, (readdirError, names) => {
5691
+ function readdir2(directory, settings2, callback) {
5692
+ settings2.fs.readdir(directory, (readdirError, names) => {
5412
5693
  if (readdirError !== null) {
5413
5694
  callFailureCallback(callback, readdirError);
5414
5695
  return;
5415
5696
  }
5416
5697
  const tasks = names.map((name) => {
5417
- const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5698
+ const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5418
5699
  return (done) => {
5419
- fsStat.stat(path, settings.fsStatSettings, (error2, stats) => {
5700
+ fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
5420
5701
  if (error2 !== null) {
5421
5702
  done(error2);
5422
5703
  return;
@@ -5426,7 +5707,7 @@ var require_async2 = __commonJS({
5426
5707
  path,
5427
5708
  dirent: utils.fs.createDirentFromStats(name, stats)
5428
5709
  };
5429
- if (settings.stats) {
5710
+ if (settings2.stats) {
5430
5711
  entry.stats = stats;
5431
5712
  }
5432
5713
  done(null, entry);
@@ -5463,27 +5744,27 @@ var require_sync2 = __commonJS({
5463
5744
  var constants_1 = require_constants3();
5464
5745
  var utils = require_utils4();
5465
5746
  var common = require_common();
5466
- function read2(directory, settings) {
5467
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5468
- return readdirWithFileTypes(directory, settings);
5747
+ function read2(directory, settings2) {
5748
+ if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5749
+ return readdirWithFileTypes(directory, settings2);
5469
5750
  }
5470
- return readdir2(directory, settings);
5751
+ return readdir2(directory, settings2);
5471
5752
  }
5472
5753
  exports.read = read2;
5473
- function readdirWithFileTypes(directory, settings) {
5474
- const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
5754
+ function readdirWithFileTypes(directory, settings2) {
5755
+ const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
5475
5756
  return dirents.map((dirent) => {
5476
5757
  const entry = {
5477
5758
  dirent,
5478
5759
  name: dirent.name,
5479
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
5760
+ path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
5480
5761
  };
5481
- if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
5762
+ if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
5482
5763
  try {
5483
- const stats = settings.fs.statSync(entry.path);
5764
+ const stats = settings2.fs.statSync(entry.path);
5484
5765
  entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
5485
5766
  } catch (error2) {
5486
- if (settings.throwErrorOnBrokenSymbolicLink) {
5767
+ if (settings2.throwErrorOnBrokenSymbolicLink) {
5487
5768
  throw error2;
5488
5769
  }
5489
5770
  }
@@ -5492,17 +5773,17 @@ var require_sync2 = __commonJS({
5492
5773
  });
5493
5774
  }
5494
5775
  exports.readdirWithFileTypes = readdirWithFileTypes;
5495
- function readdir2(directory, settings) {
5496
- const names = settings.fs.readdirSync(directory);
5776
+ function readdir2(directory, settings2) {
5777
+ const names = settings2.fs.readdirSync(directory);
5497
5778
  return names.map((name) => {
5498
- const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
5499
- const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
5779
+ const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
5780
+ const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
5500
5781
  const entry = {
5501
5782
  name,
5502
5783
  path: entryPath,
5503
5784
  dirent: utils.fs.createDirentFromStats(name, stats)
5504
5785
  };
5505
- if (settings.stats) {
5786
+ if (settings2.stats) {
5506
5787
  entry.stats = stats;
5507
5788
  }
5508
5789
  return entry;
@@ -5589,8 +5870,8 @@ var require_out2 = __commonJS({
5589
5870
  }
5590
5871
  exports.scandir = scandir;
5591
5872
  function scandirSync(path, optionsOrSettings) {
5592
- const settings = getSettings(optionsOrSettings);
5593
- return sync.read(path, settings);
5873
+ const settings2 = getSettings(optionsOrSettings);
5874
+ return sync.read(path, settings2);
5594
5875
  }
5595
5876
  exports.scandirSync = scandirSync;
5596
5877
  function getSettings(settingsOrOptions = {}) {
@@ -5634,9 +5915,9 @@ var require_reusify = __commonJS({
5634
5915
  }
5635
5916
  });
5636
5917
 
5637
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5918
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5638
5919
  var require_queue = __commonJS({
5639
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5920
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5640
5921
  "use strict";
5641
5922
  init_utils2();
5642
5923
  var reusify = require_reusify();
@@ -5816,11 +6097,12 @@ var require_queue = __commonJS({
5816
6097
  current.value = null;
5817
6098
  current.callback = noop;
5818
6099
  current.errorHandler = null;
6100
+ current.next = null;
5819
6101
  if (errorHandler2) {
5820
6102
  errorHandler2(new Error("abort"), val);
5821
6103
  }
5822
6104
  callback.call(context2, new Error("abort"));
5823
- current.release(current);
6105
+ cache.release(current);
5824
6106
  current = next;
5825
6107
  }
5826
6108
  self.drain = noop;
@@ -5871,7 +6153,7 @@ var require_queue = __commonJS({
5871
6153
  queue.drained = drained;
5872
6154
  return queue;
5873
6155
  function push(value) {
5874
- var p2 = new Promise(function(resolve4, reject) {
6156
+ var p = new Promise(function(resolve4, reject) {
5875
6157
  pushCb(value, function(err, result) {
5876
6158
  if (err) {
5877
6159
  reject(err);
@@ -5880,11 +6162,11 @@ var require_queue = __commonJS({
5880
6162
  resolve4(result);
5881
6163
  });
5882
6164
  });
5883
- p2.catch(noop);
5884
- return p2;
6165
+ p.catch(noop);
6166
+ return p;
5885
6167
  }
5886
6168
  function unshift(value) {
5887
- var p2 = new Promise(function(resolve4, reject) {
6169
+ var p = new Promise(function(resolve4, reject) {
5888
6170
  unshiftCb(value, function(err, result) {
5889
6171
  if (err) {
5890
6172
  reject(err);
@@ -5893,11 +6175,11 @@ var require_queue = __commonJS({
5893
6175
  resolve4(result);
5894
6176
  });
5895
6177
  });
5896
- p2.catch(noop);
5897
- return p2;
6178
+ p.catch(noop);
6179
+ return p;
5898
6180
  }
5899
6181
  function drained() {
5900
- var p2 = new Promise(function(resolve4) {
6182
+ var p = new Promise(function(resolve4) {
5901
6183
  process.nextTick(function() {
5902
6184
  if (queue.idle()) {
5903
6185
  resolve4();
@@ -5911,7 +6193,7 @@ var require_queue = __commonJS({
5911
6193
  }
5912
6194
  });
5913
6195
  });
5914
- return p2;
6196
+ return p;
5915
6197
  }
5916
6198
  }
5917
6199
  module.exports = fastqueue;
@@ -5926,11 +6208,11 @@ var require_common2 = __commonJS({
5926
6208
  init_utils2();
5927
6209
  Object.defineProperty(exports, "__esModule", { value: true });
5928
6210
  exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
5929
- function isFatalError(settings, error2) {
5930
- if (settings.errorFilter === null) {
6211
+ function isFatalError(settings2, error2) {
6212
+ if (settings2.errorFilter === null) {
5931
6213
  return true;
5932
6214
  }
5933
- return !settings.errorFilter(error2);
6215
+ return !settings2.errorFilter(error2);
5934
6216
  }
5935
6217
  exports.isFatalError = isFatalError;
5936
6218
  function isAppliedFilter(filter, value) {
@@ -5941,14 +6223,14 @@ var require_common2 = __commonJS({
5941
6223
  return filepath.split(/[/\\]/).join(separator);
5942
6224
  }
5943
6225
  exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
5944
- function joinPathSegments(a, b, separator) {
5945
- if (a === "") {
6226
+ function joinPathSegments(a2, b, separator) {
6227
+ if (a2 === "") {
5946
6228
  return b;
5947
6229
  }
5948
- if (a.endsWith(separator)) {
5949
- return a + b;
6230
+ if (a2.endsWith(separator)) {
6231
+ return a2 + b;
5950
6232
  }
5951
- return a + separator + b;
6233
+ return a2 + separator + b;
5952
6234
  }
5953
6235
  exports.joinPathSegments = joinPathSegments;
5954
6236
  }
@@ -6295,14 +6577,14 @@ var require_out3 = __commonJS({
6295
6577
  }
6296
6578
  exports.walk = walk;
6297
6579
  function walkSync(directory, optionsOrSettings) {
6298
- const settings = getSettings(optionsOrSettings);
6299
- const provider = new sync_1.default(directory, settings);
6580
+ const settings2 = getSettings(optionsOrSettings);
6581
+ const provider = new sync_1.default(directory, settings2);
6300
6582
  return provider.read();
6301
6583
  }
6302
6584
  exports.walkSync = walkSync;
6303
6585
  function walkStream(directory, optionsOrSettings) {
6304
- const settings = getSettings(optionsOrSettings);
6305
- const provider = new stream_1.default(directory, settings);
6586
+ const settings2 = getSettings(optionsOrSettings);
6587
+ const provider = new stream_1.default(directory, settings2);
6306
6588
  return provider.read();
6307
6589
  }
6308
6590
  exports.walkStream = walkStream;
@@ -6388,8 +6670,8 @@ var require_stream3 = __commonJS({
6388
6670
  done();
6389
6671
  }).catch(done);
6390
6672
  };
6391
- for (let i = 0; i < filepaths.length; i++) {
6392
- stream.write(i);
6673
+ for (let i2 = 0; i2 < filepaths.length; i2++) {
6674
+ stream.write(i2);
6393
6675
  }
6394
6676
  return stream;
6395
6677
  }
@@ -7050,14 +7332,14 @@ var require_out4 = __commonJS({
7050
7332
  function generateTasks(source, options) {
7051
7333
  assertPatternsInput(source);
7052
7334
  const patterns = [].concat(source);
7053
- const settings = new settings_1.default(options);
7054
- return taskManager.generate(patterns, settings);
7335
+ const settings2 = new settings_1.default(options);
7336
+ return taskManager.generate(patterns, settings2);
7055
7337
  }
7056
7338
  FastGlob2.generateTasks = generateTasks;
7057
7339
  function isDynamicPattern(source, options) {
7058
7340
  assertPatternsInput(source);
7059
- const settings = new settings_1.default(options);
7060
- return utils.pattern.isDynamicPattern(source, settings);
7341
+ const settings2 = new settings_1.default(options);
7342
+ return utils.pattern.isDynamicPattern(source, settings2);
7061
7343
  }
7062
7344
  FastGlob2.isDynamicPattern = isDynamicPattern;
7063
7345
  function escapePath(source) {
@@ -7099,9 +7381,9 @@ var require_out4 = __commonJS({
7099
7381
  })(FastGlob || (FastGlob = {}));
7100
7382
  function getWorks(source, _Provider, options) {
7101
7383
  const patterns = [].concat(source);
7102
- const settings = new settings_1.default(options);
7103
- const tasks = taskManager.generate(patterns, settings);
7104
- const provider = new _Provider(settings);
7384
+ const settings2 = new settings_1.default(options);
7385
+ const tasks = taskManager.generate(patterns, settings2);
7386
+ const provider = new _Provider(settings2);
7105
7387
  return tasks.map(provider.read, provider);
7106
7388
  }
7107
7389
  function assertPatternsInput(input) {
@@ -7279,14 +7561,14 @@ import "node:fs";
7279
7561
  import { createRequire } from "node:module";
7280
7562
  import {
7281
7563
  resolve,
7282
- join,
7283
- dirname,
7564
+ join as join2,
7565
+ dirname as dirname2,
7284
7566
  relative,
7285
7567
  normalize,
7286
7568
  sep,
7287
7569
  extname
7288
7570
  } from "node:path";
7289
- import "node:url";
7571
+ import { fileURLToPath } from "node:url";
7290
7572
  function safeExecuteAsync(fn, message) {
7291
7573
  return fn().catch((error2) => {
7292
7574
  throw new Error(
@@ -7294,7 +7576,7 @@ function safeExecuteAsync(fn, message) {
7294
7576
  );
7295
7577
  });
7296
7578
  }
7297
- var import_fast_glob, constants, log2, PACKAGE_PATHS, PathResolver;
7579
+ var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
7298
7580
  var init_PathResolver = __esm({
7299
7581
  "packages/core/config/utils/PathResolver.ts"() {
7300
7582
  "use strict";
@@ -7307,7 +7589,7 @@ var init_PathResolver = __esm({
7307
7589
  getPatternsFor: getPatternsFor || void 0,
7308
7590
  I18N_PATHS: I18N_PATHS || void 0
7309
7591
  };
7310
- log2 = {
7592
+ log3 = {
7311
7593
  error: (message, error2) => {
7312
7594
  },
7313
7595
  warn: (message, error2) => {
@@ -7343,6 +7625,7 @@ var init_PathResolver = __esm({
7343
7625
  options;
7344
7626
  _repoRoot;
7345
7627
  _appRoot = null;
7628
+ _writtenPaths = null;
7346
7629
  /**
7347
7630
  * Get or create singleton instance
7348
7631
  * @param options - Configuration options
@@ -7428,7 +7711,7 @@ var init_PathResolver = __esm({
7428
7711
  */
7429
7712
  getDirname(path) {
7430
7713
  if (!path) return "";
7431
- return this.normalizePath(dirname(path));
7714
+ return this.normalizePath(dirname2(path));
7432
7715
  }
7433
7716
  /**
7434
7717
  * Resolve package path using Node's module resolution
@@ -7440,7 +7723,7 @@ var init_PathResolver = __esm({
7440
7723
  resolvePackage(packageSpecifier, fromPath = null) {
7441
7724
  try {
7442
7725
  const basePath = fromPath || this.getAppRoot();
7443
- const require3 = createRequire(join(basePath, "package.json"));
7726
+ const require3 = createRequire(join2(basePath, "package.json"));
7444
7727
  const resolved = require3.resolve(packageSpecifier);
7445
7728
  return this.normalizePath(resolved);
7446
7729
  } catch (error2) {
@@ -7592,7 +7875,7 @@ var init_PathResolver = __esm({
7592
7875
  return cleanContent;
7593
7876
  } catch (error2) {
7594
7877
  if (this.options.debug) {
7595
- log2.warn(`Failed to read file: ${filePath}`, error2);
7878
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7596
7879
  }
7597
7880
  return null;
7598
7881
  }
@@ -7620,7 +7903,7 @@ var init_PathResolver = __esm({
7620
7903
  return cleanContent;
7621
7904
  } catch (error2) {
7622
7905
  if (this.options.debug) {
7623
- log2.warn(`Failed to read file: ${filePath}`, error2);
7906
+ log3.warn(`Failed to read file: ${filePath}`, error2);
7624
7907
  }
7625
7908
  return null;
7626
7909
  }
@@ -7642,16 +7925,16 @@ var init_PathResolver = __esm({
7642
7925
  verbose = false
7643
7926
  } = options;
7644
7927
  const normalizedPath = this.normalizePath(filePath);
7645
- const dir = this.normalizePath(dirname(normalizedPath));
7928
+ const dir = this.normalizePath(dirname2(normalizedPath));
7646
7929
  const fileExists = this.pathExists(normalizedPath);
7647
7930
  if (fileExists && !overwrite) {
7648
7931
  if (verbose) {
7649
- log2.info(`Skipping existing file: ${normalizedPath}`);
7932
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7650
7933
  }
7651
7934
  return false;
7652
7935
  }
7653
7936
  if (dryRun) {
7654
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7937
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7655
7938
  return true;
7656
7939
  }
7657
7940
  try {
@@ -7661,22 +7944,23 @@ var init_PathResolver = __esm({
7661
7944
  }
7662
7945
  const detectedFormat = this._detectFormat(filePath, format);
7663
7946
  let writeContent;
7664
- if (Buffer.isBuffer(content)) {
7947
+ if (Buffer2.isBuffer(content)) {
7665
7948
  writeContent = content;
7666
7949
  } else if (detectedFormat === "json" && typeof content === "object") {
7667
- writeContent = JSON.stringify(content, null, 2);
7950
+ writeContent = `${JSON.stringify(content, null, 2)}
7951
+ `;
7668
7952
  } else {
7669
7953
  writeContent = String(content);
7670
7954
  }
7671
7955
  try {
7672
7956
  return await safeExecuteAsync(async () => {
7673
- if (Buffer.isBuffer(writeContent)) {
7957
+ if (Buffer2.isBuffer(writeContent)) {
7674
7958
  await fs.promises.writeFile(normalizedPath, writeContent);
7675
7959
  } else {
7676
7960
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
7677
7961
  }
7678
7962
  if (verbose) {
7679
- log2.info(
7963
+ log3.info(
7680
7964
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7681
7965
  );
7682
7966
  }
@@ -7703,16 +7987,16 @@ var init_PathResolver = __esm({
7703
7987
  verbose = false
7704
7988
  } = options;
7705
7989
  const normalizedPath = this.normalizePath(filePath);
7706
- const dir = this.normalizePath(dirname(normalizedPath));
7990
+ const dir = this.normalizePath(dirname2(normalizedPath));
7707
7991
  const fileExists = this.pathExists(normalizedPath);
7708
7992
  if (fileExists && !overwrite) {
7709
7993
  if (verbose) {
7710
- log2.info(`Skipping existing file: ${normalizedPath}`);
7994
+ log3.info(`Skipping existing file: ${normalizedPath}`);
7711
7995
  }
7712
7996
  return false;
7713
7997
  }
7714
7998
  if (dryRun) {
7715
- log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7999
+ log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
7716
8000
  return true;
7717
8001
  }
7718
8002
  try {
@@ -7722,21 +8006,23 @@ var init_PathResolver = __esm({
7722
8006
  }
7723
8007
  const detectedFormat = this._detectFormat(filePath, format);
7724
8008
  let writeContent;
7725
- if (Buffer.isBuffer(content)) {
8009
+ if (Buffer2.isBuffer(content)) {
7726
8010
  writeContent = content;
7727
8011
  } else if (detectedFormat === "json" && typeof content === "object") {
7728
- writeContent = JSON.stringify(content, null, 2);
8012
+ writeContent = `${JSON.stringify(content, null, 2)}
8013
+ `;
7729
8014
  } else {
7730
8015
  writeContent = String(content);
7731
8016
  }
7732
8017
  try {
7733
- if (Buffer.isBuffer(writeContent)) {
8018
+ if (Buffer2.isBuffer(writeContent)) {
7734
8019
  fs.writeFileSync(normalizedPath, writeContent);
7735
8020
  } else {
7736
8021
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7737
8022
  }
8023
+ this._writtenPaths?.add(normalizedPath);
7738
8024
  if (verbose) {
7739
- log2.info(
8025
+ log3.info(
7740
8026
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
7741
8027
  );
7742
8028
  }
@@ -7761,15 +8047,15 @@ var init_PathResolver = __esm({
7761
8047
  const fileExists = this.pathExists(normalizedDestPath);
7762
8048
  if (fileExists && !overwrite) {
7763
8049
  if (verbose) {
7764
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
8050
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7765
8051
  }
7766
8052
  return false;
7767
8053
  }
7768
8054
  if (dryRun) {
7769
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
8055
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7770
8056
  return true;
7771
8057
  }
7772
- const dir = this.normalizePath(dirname(normalizedDestPath));
8058
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7773
8059
  try {
7774
8060
  await fs.promises.mkdir(dir, { recursive: true });
7775
8061
  } catch (error2) {
@@ -7779,7 +8065,7 @@ var init_PathResolver = __esm({
7779
8065
  return await safeExecuteAsync(async () => {
7780
8066
  await fs.promises.copyFile(srcPath, normalizedDestPath);
7781
8067
  if (verbose) {
7782
- log2.info(
8068
+ log3.info(
7783
8069
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7784
8070
  );
7785
8071
  }
@@ -7803,15 +8089,15 @@ var init_PathResolver = __esm({
7803
8089
  const fileExists = this.pathExists(normalizedDestPath);
7804
8090
  if (fileExists && !overwrite) {
7805
8091
  if (verbose) {
7806
- log2.info(`Skipping existing file: ${normalizedDestPath}`);
8092
+ log3.info(`Skipping existing file: ${normalizedDestPath}`);
7807
8093
  }
7808
8094
  return false;
7809
8095
  }
7810
8096
  if (dryRun) {
7811
- log2.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
8097
+ log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
7812
8098
  return true;
7813
8099
  }
7814
- const dir = this.normalizePath(dirname(normalizedDestPath));
8100
+ const dir = this.normalizePath(dirname2(normalizedDestPath));
7815
8101
  try {
7816
8102
  fs.mkdirSync(dir, { recursive: true });
7817
8103
  } catch (error2) {
@@ -7819,8 +8105,9 @@ var init_PathResolver = __esm({
7819
8105
  }
7820
8106
  try {
7821
8107
  fs.copyFileSync(srcPath, normalizedDestPath);
8108
+ this._writtenPaths?.add(normalizedDestPath);
7822
8109
  if (verbose) {
7823
- log2.info(
8110
+ log3.info(
7824
8111
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
7825
8112
  );
7826
8113
  }
@@ -7837,7 +8124,7 @@ var init_PathResolver = __esm({
7837
8124
  return fs.existsSync(filePath);
7838
8125
  } catch (error2) {
7839
8126
  if (!silent) {
7840
- log2.error(`Error checking path existence: ${filePath}`, error2);
8127
+ log3.error(`Error checking path existence: ${filePath}`, error2);
7841
8128
  }
7842
8129
  return false;
7843
8130
  }
@@ -7863,7 +8150,7 @@ var init_PathResolver = __esm({
7863
8150
  return fs.readdirSync(dirPath, options);
7864
8151
  } catch (error2) {
7865
8152
  if (this.options.debug) {
7866
- log2.warn(`Failed to read directory: ${dirPath}`, error2);
8153
+ log3.warn(`Failed to read directory: ${dirPath}`, error2);
7867
8154
  }
7868
8155
  const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
7869
8156
  return isObjectOptions && options.withFileTypes ? [] : [];
@@ -7881,11 +8168,29 @@ var init_PathResolver = __esm({
7881
8168
  return fs.statSync(filePath);
7882
8169
  } catch (error2) {
7883
8170
  if (this.options.debug) {
7884
- log2.warn(`Failed to stat file: ${filePath}`, error2);
8171
+ log3.warn(`Failed to stat file: ${filePath}`, error2);
7885
8172
  }
7886
8173
  return null;
7887
8174
  }
7888
8175
  }
8176
+ /**
8177
+ * Resolve the real path of a file, following symlinks
8178
+ * @param filePath - Path to resolve
8179
+ * @returns Resolved real path
8180
+ */
8181
+ realpathSync(filePath) {
8182
+ return fs.realpathSync(filePath);
8183
+ }
8184
+ /**
8185
+ * Watch a directory for changes
8186
+ * @param dirPath - Directory to watch
8187
+ * @param options - fs.watch options
8188
+ * @param callback - Callback for change events
8189
+ * @returns FSWatcher instance
8190
+ */
8191
+ watch(dirPath, options, callback) {
8192
+ return fs.watch(dirPath, options, callback);
8193
+ }
7889
8194
  /**
7890
8195
  * Get file stats synchronously (follows symlinks)
7891
8196
  * Returns null if file doesn't exist (graceful degradation)
@@ -7898,7 +8203,7 @@ var init_PathResolver = __esm({
7898
8203
  return fs.lstatSync(filePath);
7899
8204
  } catch (error2) {
7900
8205
  if (this.options.debug) {
7901
- log2.warn(`Failed to lstat file: ${filePath}`, error2);
8206
+ log3.warn(`Failed to lstat file: ${filePath}`, error2);
7902
8207
  }
7903
8208
  return null;
7904
8209
  }
@@ -7965,6 +8270,28 @@ var init_PathResolver = __esm({
7965
8270
  * Get app root (where vite.config.ts is, Vite's config.root)
7966
8271
  * Falls back to repoRoot if not set
7967
8272
  */
8273
+ /**
8274
+ * Start recording every path written by writeSync/copySync.
8275
+ * Lets a generator know exactly which files the current run produced,
8276
+ * without comparing file timestamps to a clock.
8277
+ */
8278
+ startWriteRecording() {
8279
+ this._writtenPaths = /* @__PURE__ */ new Set();
8280
+ }
8281
+ /**
8282
+ * Stop recording and return the normalized paths written since
8283
+ * startWriteRecording().
8284
+ */
8285
+ stopWriteRecording() {
8286
+ if (!this._writtenPaths) {
8287
+ throw new Error(
8288
+ "stopWriteRecording() called without startWriteRecording()"
8289
+ );
8290
+ }
8291
+ const written = this._writtenPaths;
8292
+ this._writtenPaths = null;
8293
+ return written;
8294
+ }
7968
8295
  getAppRoot() {
7969
8296
  if (!this._appRoot) {
7970
8297
  return this._repoRoot;
@@ -7987,7 +8314,7 @@ var init_PathResolver = __esm({
7987
8314
  * @returns True if repoRoot is the monorepo (has packages directory)
7988
8315
  */
7989
8316
  isMonorepo() {
7990
- const packagesDir = join(this._repoRoot, "packages");
8317
+ const packagesDir = join2(this._repoRoot, "packages");
7991
8318
  return this.pathExists(packagesDir);
7992
8319
  }
7993
8320
  /**
@@ -8004,7 +8331,7 @@ var init_PathResolver = __esm({
8004
8331
  * Find files matching pattern within directory
8005
8332
  */
8006
8333
  async findFiles(directory, pattern, options = {}) {
8007
- const searchPattern = this.normalizePath(join(directory, pattern));
8334
+ const searchPattern = this.normalizePath(join2(directory, pattern));
8008
8335
  const appRoot = this.getAppRoot();
8009
8336
  const normalizeAppRoot = this.normalizePath(appRoot);
8010
8337
  const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
@@ -8051,7 +8378,7 @@ var init_PathResolver = __esm({
8051
8378
  return null;
8052
8379
  }
8053
8380
  const resolvedPath = this.normalizePath(
8054
- join(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8381
+ join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
8055
8382
  );
8056
8383
  const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
8057
8384
  if (this.pathExists(resolvedDir)) {
@@ -8222,6 +8549,15 @@ var init_PathResolver = __esm({
8222
8549
  const cjsPath = this.getEmptyCjsModulePath();
8223
8550
  return cjsPath.replace(/\.cjs$/, ".js");
8224
8551
  }
8552
+ /**
8553
+ * Get absolute path to empty flag component module.
8554
+ * Returns `export default () => null;` — used by flag filtering plugins
8555
+ * to replace unused flag files at build time.
8556
+ */
8557
+ getEmptyFlagModulePath() {
8558
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8559
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8560
+ }
8225
8561
  /**
8226
8562
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8227
8563
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8247,13 +8583,13 @@ var init_PathResolver = __esm({
8247
8583
  const maxLevels = this.options.maxLevels;
8248
8584
  while (levelsChecked < maxLevels) {
8249
8585
  const toolingPath = this.normalizePath(
8250
- join(currentDir, PACKAGE_PATHS.TOOLING)
8586
+ join2(currentDir, PACKAGE_PATHS.TOOLING)
8251
8587
  );
8252
- const corePath = this.normalizePath(join(currentDir, PACKAGE_PATHS.CORE));
8588
+ const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
8253
8589
  if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
8254
8590
  return currentDir;
8255
8591
  }
8256
- const appsDir = join(currentDir, "apps");
8592
+ const appsDir = join2(currentDir, "apps");
8257
8593
  if (this.pathExists(appsDir)) {
8258
8594
  const appsDirStat = this.statSync(appsDir);
8259
8595
  if (appsDirStat?.isDirectory()) {
@@ -8261,15 +8597,15 @@ var init_PathResolver = __esm({
8261
8597
  }
8262
8598
  }
8263
8599
  const packageJsonPath = this.normalizePath(
8264
- join(currentDir, "package.json")
8600
+ join2(currentDir, "package.json")
8265
8601
  );
8266
8602
  if (this.pathExists(packageJsonPath)) {
8267
- const parentDir2 = this.normalizePath(dirname(currentDir));
8603
+ const parentDir2 = this.normalizePath(dirname2(currentDir));
8268
8604
  if (parentDir2 === currentDir) {
8269
8605
  return currentDir;
8270
8606
  }
8271
8607
  }
8272
- const parentDir = this.normalizePath(dirname(currentDir));
8608
+ const parentDir = this.normalizePath(dirname2(currentDir));
8273
8609
  if (parentDir === currentDir) {
8274
8610
  break;
8275
8611
  }
@@ -8320,7 +8656,7 @@ __export(pathResolver_exports, {
8320
8656
  isWithinApp: () => isWithinApp,
8321
8657
  isWithinRepoRoot: () => isWithinRepoRoot,
8322
8658
  joinPath: () => joinPath,
8323
- lstatSync: () => lstatSync2,
8659
+ lstatSync: () => lstatSync3,
8324
8660
  normalizePath: () => normalizePath,
8325
8661
  openFile: () => openFile,
8326
8662
  pathExists: () => pathExists,
@@ -8328,7 +8664,7 @@ __export(pathResolver_exports, {
8328
8664
  read: () => read,
8329
8665
  readSync: () => readSync,
8330
8666
  readdir: () => readdir,
8331
- readdirSync: () => readdirSync2,
8667
+ readdirSync: () => readdirSync3,
8332
8668
  remove: () => remove,
8333
8669
  removeSync: () => removeSync,
8334
8670
  resolveAppPath: () => resolveAppPath,
@@ -8345,8 +8681,8 @@ __export(pathResolver_exports, {
8345
8681
  });
8346
8682
  import { createRequire as createRequire2 } from "node:module";
8347
8683
  import {
8348
- join as join2,
8349
- dirname as dirname2,
8684
+ join as join3,
8685
+ dirname as dirname3,
8350
8686
  basename as basename2,
8351
8687
  extname as extname2,
8352
8688
  relative as relative2,
@@ -8355,11 +8691,11 @@ import {
8355
8691
  isAbsolute as pathIsAbsolute
8356
8692
  } from "node:path";
8357
8693
  import { fileURLToPath as fileURLToPath2 } from "node:url";
8358
- function readdirSync2(dirPath, options) {
8694
+ function readdirSync3(dirPath, options) {
8359
8695
  return pathResolverInstance.readdirSync(dirPath, options);
8360
8696
  }
8361
8697
  function getDirnameFromUrl(importMetaUrl) {
8362
- return dirname2(fileURLToPath2(importMetaUrl));
8698
+ return dirname3(fileURLToPath2(importMetaUrl));
8363
8699
  }
8364
8700
  function findNodeModulesDir(startDir) {
8365
8701
  let currentDir = normalizePath(startDir);
@@ -8422,7 +8758,7 @@ function getTemplatesRoot() {
8422
8758
  const mode = detectExecutionMode();
8423
8759
  if (mode === "development") {
8424
8760
  const fileUrlPath = fileURLToPath2(import.meta.url);
8425
- const frameworkRoot = normalizePath(dirname2(fileUrlPath), "../../../..");
8761
+ const frameworkRoot = normalizePath(dirname3(fileUrlPath), "../../../..");
8426
8762
  return normalizePath(frameworkRoot, PACKAGE_PATHS.CLI, "templates");
8427
8763
  } else {
8428
8764
  try {
@@ -8438,7 +8774,7 @@ function getTemplatesRoot() {
8438
8774
  try {
8439
8775
  const req = createRequire2(import.meta.url);
8440
8776
  const cliPackageJsonPath = req.resolve("@donotdev/cli/package.json");
8441
- const cliRoot2 = normalizePath(dirname2(cliPackageJsonPath));
8777
+ const cliRoot2 = normalizePath(dirname3(cliPackageJsonPath));
8442
8778
  const templatesPath = normalizePath(cliRoot2, "templates");
8443
8779
  if (pathExists(templatesPath)) {
8444
8780
  return templatesPath;
@@ -8490,20 +8826,20 @@ async function isBinaryFile(filePath) {
8490
8826
  try {
8491
8827
  let fileHandle = null;
8492
8828
  try {
8493
- const buffer = Buffer.alloc(4096);
8829
+ const buffer = Buffer2.alloc(4096);
8494
8830
  const fs2 = await import("node:fs");
8495
8831
  fileHandle = await fs2.promises.open(filePath, "r");
8496
8832
  const { bytesRead } = await fileHandle.read(buffer, 0, 4096, 0);
8497
8833
  if (bytesRead === 0) {
8498
8834
  return false;
8499
8835
  }
8500
- for (let i = 0; i < bytesRead; i++) {
8501
- if (buffer[i] === 0) {
8836
+ for (let i2 = 0; i2 < bytesRead; i2++) {
8837
+ if (buffer[i2] === 0) {
8502
8838
  return true;
8503
8839
  }
8504
8840
  }
8505
- for (let i = 0; i < bytesRead; i++) {
8506
- const byte = buffer[i];
8841
+ for (let i2 = 0; i2 < bytesRead; i2++) {
8842
+ const byte = buffer[i2];
8507
8843
  if (byte && (byte < 9 || byte > 13 && byte < 32 && byte !== 27)) {
8508
8844
  return true;
8509
8845
  }
@@ -8515,8 +8851,8 @@ async function isBinaryFile(filePath) {
8515
8851
  }
8516
8852
  }
8517
8853
  } catch (err) {
8518
- const { log: log3 } = await Promise.resolve().then(() => (init_cli_output(), cli_output_exports));
8519
- log3.warn(`Error checking if file is binary: ${filePath}`, err);
8854
+ const { log: log4 } = await Promise.resolve().then(() => (init_cli_output(), cli_output_exports));
8855
+ log4.warn(`Error checking if file is binary: ${filePath}`, err);
8520
8856
  return true;
8521
8857
  }
8522
8858
  }
@@ -8524,8 +8860,8 @@ async function glob(pattern, options = {}) {
8524
8860
  const patterns = Array.isArray(pattern) ? pattern : [pattern];
8525
8861
  const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
8526
8862
  const normalizeCwd = pathResolverInstance.normalizePath(cwd);
8527
- const relativePatterns = patterns.map((p2) => {
8528
- const normalizedPattern = pathResolverInstance.normalizePath(p2);
8863
+ const relativePatterns = patterns.map((p) => {
8864
+ const normalizedPattern = pathResolverInstance.normalizePath(p);
8529
8865
  if (normalizedPattern.startsWith(normalizeCwd)) {
8530
8866
  return normalizedPattern.slice(normalizeCwd.length + 1);
8531
8867
  }
@@ -8551,8 +8887,8 @@ function globSync(pattern, options = {}) {
8551
8887
  const patterns = Array.isArray(pattern) ? pattern : [pattern];
8552
8888
  const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
8553
8889
  const normalizeCwd = pathResolverInstance.normalizePath(cwd);
8554
- const relativePatterns = patterns.map((p2) => {
8555
- const normalizedPattern = pathResolverInstance.normalizePath(p2);
8890
+ const relativePatterns = patterns.map((p) => {
8891
+ const normalizedPattern = pathResolverInstance.normalizePath(p);
8556
8892
  if (normalizedPattern.startsWith(normalizeCwd)) {
8557
8893
  return normalizedPattern.slice(normalizeCwd.length + 1);
8558
8894
  }
@@ -8576,7 +8912,7 @@ function globSync(pattern, options = {}) {
8576
8912
  globstar: true,
8577
8913
  throwErrorOnBrokenSymbolicLink: options.throwErrorOnBrokenSymbolicLink
8578
8914
  });
8579
- return results.map((p2) => pathResolverInstance.normalizePath(p2));
8915
+ return results.map((p) => pathResolverInstance.normalizePath(p));
8580
8916
  }
8581
8917
  async function pathExistsAsync(filePath) {
8582
8918
  try {
@@ -8595,7 +8931,7 @@ async function openFile(filePath, flags) {
8595
8931
  function stripBom(content) {
8596
8932
  return content.charCodeAt(0) === 65279 ? content.slice(1) : content;
8597
8933
  }
8598
- var pathResolverInstance, getPathResolver, getRepoRoot, getAppRoot, setAppRoot, resolvePackage, resolveFrameworkPackage, resolvePackageAsset, resolveAppPath, resolveRepoPath, resolvePath, normalizePath, getRelativePath, createImportPath, getFileInfo, pathExists, read, readSync, write, writeSync, copy, copySync, remove, removeSync, statSync2, lstatSync2, ensureDir, ensureDirSync, readdir, isWithinApp, findFiles, clearPathCache, fromAppRoot, getRelativePathBetween, getDirname, getBasename, getExtname, getDirnameFromPath, isAbsolute, joinPath, isWithinRepoRoot;
8934
+ var pathResolverInstance, getPathResolver, getRepoRoot, getAppRoot, setAppRoot, resolvePackage, resolveFrameworkPackage, resolvePackageAsset, resolveAppPath, resolveRepoPath, resolvePath, normalizePath, getRelativePath, createImportPath, getFileInfo, pathExists, read, readSync, write, writeSync, copy, copySync, remove, removeSync, statSync2, lstatSync3, ensureDir, ensureDirSync, readdir, isWithinApp, findFiles, clearPathCache, fromAppRoot, getRelativePathBetween, getDirname, getBasename, getExtname, getDirnameFromPath, isAbsolute, joinPath, isWithinRepoRoot;
8599
8935
  var init_pathResolver = __esm({
8600
8936
  "packages/tooling/src/utils/pathResolver.ts"() {
8601
8937
  "use strict";
@@ -8613,7 +8949,7 @@ var init_pathResolver = __esm({
8613
8949
  resolveRepoPath = (relativePath) => pathResolverInstance.resolveRepoPath(relativePath);
8614
8950
  resolvePath = (relativePath, baseDir) => pathResolverInstance.resolvePath(relativePath, baseDir);
8615
8951
  normalizePath = (...pathSegments) => {
8616
- return pathResolverInstance.normalizePath(join2(...pathSegments));
8952
+ return pathResolverInstance.normalizePath(join3(...pathSegments));
8617
8953
  };
8618
8954
  getRelativePath = (absolutePath) => pathResolverInstance.getRelativePath(absolutePath);
8619
8955
  createImportPath = (absolutePath) => pathResolverInstance.createImportPath(absolutePath);
@@ -8628,7 +8964,7 @@ var init_pathResolver = __esm({
8628
8964
  remove = async (path) => pathResolverInstance.remove(path);
8629
8965
  removeSync = (path) => pathResolverInstance.removeSync(path);
8630
8966
  statSync2 = (filePath) => pathResolverInstance.statSync(filePath);
8631
- lstatSync2 = (filePath) => pathResolverInstance.lstatSync(filePath);
8967
+ lstatSync3 = (filePath) => pathResolverInstance.lstatSync(filePath);
8632
8968
  ensureDir = async (dirPath) => pathResolverInstance.ensureDir(dirPath);
8633
8969
  ensureDirSync = (dirPath) => pathResolverInstance.ensureDirSync(dirPath);
8634
8970
  readdir = async (dirPath, options) => pathResolverInstance.readdir(dirPath, options);
@@ -8636,13 +8972,13 @@ var init_pathResolver = __esm({
8636
8972
  findFiles = async (directory, pattern, options = {}) => pathResolverInstance.findFiles(directory, pattern, options);
8637
8973
  clearPathCache = () => pathResolverInstance.clearCache();
8638
8974
  fromAppRoot = (...pathSegments) => {
8639
- return pathResolverInstance.resolveAppPath(join2(...pathSegments));
8975
+ return pathResolverInstance.resolveAppPath(join3(...pathSegments));
8640
8976
  };
8641
8977
  getRelativePathBetween = (from, to) => {
8642
8978
  return normalizePath(relative2(from, to));
8643
8979
  };
8644
8980
  getDirname = (filePath) => {
8645
- return normalizePath(dirname2(filePath));
8981
+ return normalizePath(dirname3(filePath));
8646
8982
  };
8647
8983
  getBasename = (filePath, ext) => {
8648
8984
  return basename2(filePath, ext);
@@ -8651,7 +8987,7 @@ var init_pathResolver = __esm({
8651
8987
  return extname2(filePath);
8652
8988
  };
8653
8989
  getDirnameFromPath = (filePath) => {
8654
- return pathResolverInstance.normalizePath(dirname2(filePath));
8990
+ return pathResolverInstance.normalizePath(dirname3(filePath));
8655
8991
  };
8656
8992
  isAbsolute = (filePath) => {
8657
8993
  return pathIsAbsolute(filePath);
@@ -8675,10 +9011,10 @@ var init_pathResolver = __esm({
8675
9011
  });
8676
9012
 
8677
9013
  // packages/tooling/src/bundler/utils.ts
8678
- import { Buffer } from "node:buffer";
9014
+ import { Buffer as Buffer2 } from "node:buffer";
8679
9015
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8680
9016
  import { createRequire as createRequire3 } from "node:module";
8681
- import { dirname as dirname3, resolve as resolve3 } from "node:path";
9017
+ import { dirname as dirname4, resolve as resolve3 } from "node:path";
8682
9018
  import process from "node:process";
8683
9019
  import { fileURLToPath as fileURLToPath3 } from "node:url";
8684
9020
  var require2, __filename, __dirname;
@@ -8687,12 +9023,12 @@ var init_utils2 = __esm({
8687
9023
  "use strict";
8688
9024
  require2 = createRequire3(import.meta.url);
8689
9025
  __filename = fileURLToPath3(import.meta.url);
8690
- __dirname = dirname3(__filename);
9026
+ __dirname = dirname4(__filename);
8691
9027
  if (typeof globalThis !== "undefined") {
8692
9028
  globalThis.require = require2;
8693
9029
  globalThis.__filename = __filename;
8694
9030
  globalThis.__dirname = __dirname;
8695
- globalThis.Buffer = Buffer;
9031
+ globalThis.Buffer = Buffer2;
8696
9032
  globalThis.process = process;
8697
9033
  if (typeof global === "undefined") {
8698
9034
  globalThis.global = globalThis;
@@ -8703,24 +9039,24 @@ var init_utils2 = __esm({
8703
9039
 
8704
9040
  // packages/tooling/src/utils/cli-input.ts
8705
9041
  async function askForInput(message, defaultValue = "") {
8706
- const result = await Ot({
9042
+ const result = await text({
8707
9043
  message,
8708
9044
  placeholder: defaultValue || void 0,
8709
9045
  defaultValue: defaultValue || void 0
8710
9046
  });
8711
- if (q(result)) {
8712
- pt("Operation cancelled.");
9047
+ if (isCancel(result)) {
9048
+ cancel("Operation cancelled.");
8713
9049
  process.exit(0);
8714
9050
  }
8715
9051
  return result;
8716
9052
  }
8717
9053
  async function askForConfirmation(message, defaultValue = false) {
8718
- const result = await ot2({
9054
+ const result = await confirm({
8719
9055
  message,
8720
9056
  initialValue: defaultValue
8721
9057
  });
8722
- if (q(result)) {
8723
- pt("Operation cancelled.");
9058
+ if (isCancel(result)) {
9059
+ cancel("Operation cancelled.");
8724
9060
  process.exit(0);
8725
9061
  }
8726
9062
  return result;
@@ -8731,13 +9067,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
8731
9067
  label: choice.title,
8732
9068
  hint: choice.hint
8733
9069
  }));
8734
- const result = await _t({
9070
+ const result = await select({
8735
9071
  message,
8736
9072
  options,
8737
9073
  initialValue: choices[defaultValue]?.value
8738
9074
  });
8739
- if (q(result)) {
8740
- pt("Operation cancelled.");
9075
+ if (isCancel(result)) {
9076
+ cancel("Operation cancelled.");
8741
9077
  process.exit(0);
8742
9078
  }
8743
9079
  return result;
@@ -8811,8 +9147,8 @@ async function isTextFile(filePath) {
8811
9147
  try {
8812
9148
  const buffer = await read(filePath, { format: "buffer" });
8813
9149
  if (buffer.length === 0) return true;
8814
- for (let i = 0; i < Math.min(buffer.length, 1e3); i++) {
8815
- if (buffer[i] === 0) return false;
9150
+ for (let i2 = 0; i2 < Math.min(buffer.length, 1e3); i2++) {
9151
+ if (buffer[i2] === 0) return false;
8816
9152
  }
8817
9153
  return true;
8818
9154
  } catch {
@@ -8837,7 +9173,7 @@ async function replacePlaceholders(filePath, replacements) {
8837
9173
  }
8838
9174
  await write(filePath, content, { overwrite: true });
8839
9175
  } catch (error2) {
8840
- log.warn(
9176
+ log2.warn(
8841
9177
  `Warning: Could not process file ${filePath}: ${error2.message || "Unknown error"}`
8842
9178
  );
8843
9179
  }
@@ -8891,14 +9227,14 @@ function isReservedAppName(name) {
8891
9227
  async function updateRootPackageJson(rootDir, appNames) {
8892
9228
  const packageJsonPath = joinPath(rootDir, "package.json");
8893
9229
  if (!pathExists(packageJsonPath)) {
8894
- log.warn("Root package.json not found, skipping script updates");
9230
+ log2.warn("Root package.json not found, skipping script updates");
8895
9231
  return;
8896
9232
  }
8897
9233
  try {
8898
9234
  const packageJson = await read(packageJsonPath, { format: "json" });
8899
9235
  packageJson.scripts = packageJson.scripts || {};
8900
9236
  } catch (error2) {
8901
- log.warn(
9237
+ log2.warn(
8902
9238
  `Warning: Could not update root package.json: ${error2.message || "Unknown error"}`
8903
9239
  );
8904
9240
  }
@@ -8968,16 +9304,16 @@ function loadMatrix(mode) {
8968
9304
  return cachedMatrix;
8969
9305
  }
8970
9306
  function resolveGroup(groupName, matrix) {
8971
- const group = matrix.groups[groupName];
8972
- if (!group) return {};
9307
+ const group2 = matrix.groups[groupName];
9308
+ if (!group2) return {};
8973
9309
  const result = {};
8974
- if (group.includes) {
8975
- for (const included of group.includes) {
9310
+ if (group2.includes) {
9311
+ for (const included of group2.includes) {
8976
9312
  Object.assign(result, resolveGroup(included, matrix));
8977
9313
  }
8978
9314
  }
8979
- if (group.packages) {
8980
- Object.assign(result, group.packages);
9315
+ if (group2.packages) {
9316
+ Object.assign(result, group2.packages);
8981
9317
  }
8982
9318
  return result;
8983
9319
  }
@@ -9339,9 +9675,9 @@ function generatePackageJson(templateName, mode, options = {}) {
9339
9675
  }
9340
9676
  if (mode === "published") {
9341
9677
  const overrides = {};
9342
- for (const [groupName, group] of Object.entries(matrix.groups || {})) {
9678
+ for (const [groupName, group2] of Object.entries(matrix.groups || {})) {
9343
9679
  if (groupName.startsWith("@donotdev/")) {
9344
- const version = group.packages?.[groupName];
9680
+ const version = group2.packages?.[groupName];
9345
9681
  if (version) {
9346
9682
  overrides[groupName] = version.replace(/^\^/, "");
9347
9683
  }
@@ -9373,7 +9709,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9373
9709
  workspaceRoot = workspaceRoot || currentDir;
9374
9710
  }
9375
9711
  templatesRoot = templatesRoot || getTemplatesRoot();
9376
- mt("\u{1F680} DoNotDev App Creator");
9712
+ intro("\u{1F680} DoNotDev App Creator");
9377
9713
  if (!appName) {
9378
9714
  appName = await askForInput(
9379
9715
  `App name - '${RESERVED_APP_NAMES.join("', '")}' reserved`,
@@ -9435,18 +9771,18 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9435
9771
  1
9436
9772
  );
9437
9773
  if (action === "skip") {
9438
- log.info(`\u23ED\uFE0F Skipping app: ${appName}`);
9774
+ log2.info(`\u23ED\uFE0F Skipping app: ${appName}`);
9439
9775
  return;
9440
9776
  }
9441
9777
  if (action === "replace") {
9442
9778
  await remove(appDir);
9443
9779
  }
9444
9780
  } else {
9445
- log.info(`\u23ED\uFE0F App "${appName}" already exists, skipping.`);
9781
+ log2.info(`\u23ED\uFE0F App "${appName}" already exists, skipping.`);
9446
9782
  return;
9447
9783
  }
9448
9784
  }
9449
- const s = fe();
9785
+ const s = spinner();
9450
9786
  s.start(`Creating app: ${appName}`);
9451
9787
  await ensureDir(appDir);
9452
9788
  const builder = appTemplate;
@@ -9571,7 +9907,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9571
9907
  joinPath(templatesRoot, functionsTemplateName)
9572
9908
  );
9573
9909
  if (!functionsTemplateExists) {
9574
- log.warn(
9910
+ log2.warn(
9575
9911
  `Functions template "${functionsTemplateName}" not found \u2014 skipping functions scaffolding.`
9576
9912
  );
9577
9913
  } else {
@@ -9635,7 +9971,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9635
9971
  });
9636
9972
  if (firebaseJson.hosting?.rewrites && Array.isArray(firebaseJson.hosting.rewrites)) {
9637
9973
  firebaseJson.hosting.rewrites = firebaseJson.hosting.rewrites.filter(
9638
- (r) => r.destination !== "/index.html"
9974
+ (r2) => r2.destination !== "/index.html"
9639
9975
  );
9640
9976
  }
9641
9977
  if (firebaseJson.hosting) {
@@ -9749,16 +10085,16 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9749
10085
  const appsDir = joinPath(workspaceRoot, "apps");
9750
10086
  const allDirs = pathExists(appsDir) ? (await readdir(appsDir, {
9751
10087
  withFileTypes: true
9752
- })).filter((d3) => d3.isDirectory()).map((d3) => d3.name).filter(isValidFileName) : [];
10088
+ })).filter((d) => d.isDirectory()).map((d) => d.name).filter(isValidFileName) : [];
9753
10089
  await updateRootPackageJson(workspaceRoot, allDirs);
9754
10090
  }
9755
10091
  if (isInteractive) {
9756
- gt("\u{1F389} App created successfully!");
10092
+ outro("\u{1F389} App created successfully!");
9757
10093
  const firebaseStep = row.functionsTemplate === "functions-firebase" ? `2. Set Firebase project: cd apps/${appName} && firebase use --add (or edit .firebaserc)
9758
10094
  3. bun install
9759
10095
  4. bun run dev` : `2. bun install
9760
10096
  3. bun run dev`;
9761
- wt(
10097
+ note(
9762
10098
  `Next steps:
9763
10099
 
9764
10100
  1. cd apps/${appName}
@@ -9806,7 +10142,7 @@ async function main(options) {
9806
10142
  await createApp(options?.name);
9807
10143
  }
9808
10144
  } catch (error2) {
9809
- log.error("\n\u274C Error creating app:", error2);
10145
+ log2.error("\n\u274C Error creating app:", error2);
9810
10146
  throw error2;
9811
10147
  }
9812
10148
  }