storybook 10.1.0-alpha.9 → 10.1.0-beta.1

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 (198) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
  5. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  6. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  7. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  8. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  9. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  15. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  16. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  17. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  18. package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
  19. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  20. package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
  26. package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
  27. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  28. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  29. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  30. package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
  31. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  32. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  33. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-SM3UWERX.js → builder-manager-FTVC2JL7.js} +510 -1019
  40. package/dist/_node-chunks/camelcase-3SMT5WKC.js +37 -0
  41. package/dist/_node-chunks/chunk-2OVULPK3.js +54 -0
  42. package/dist/_node-chunks/chunk-3JJPSDXI.js +3043 -0
  43. package/dist/_node-chunks/chunk-54NMJ4II.js +1564 -0
  44. package/dist/_node-chunks/chunk-5V4A6MSI.js +943 -0
  45. package/dist/_node-chunks/chunk-6DEMT5VX.js +299 -0
  46. package/dist/_node-chunks/{chunk-HHSTA6QS.js → chunk-6L7FFBOW.js} +8 -10
  47. package/dist/_node-chunks/chunk-6ULDIDXV.js +46662 -0
  48. package/dist/_node-chunks/chunk-AREL5IXS.js +603 -0
  49. package/dist/_node-chunks/chunk-DWA53E73.js +23 -0
  50. package/dist/_node-chunks/chunk-FNYKBULZ.js +765 -0
  51. package/dist/_node-chunks/chunk-IUYZQKSX.js +70 -0
  52. package/dist/_node-chunks/{chunk-F6EFOEC7.js → chunk-K673CX4Q.js} +469 -983
  53. package/dist/_node-chunks/chunk-KJAFCNZ3.js +61 -0
  54. package/dist/_node-chunks/chunk-N3BJOOY5.js +78 -0
  55. package/dist/_node-chunks/{chunk-EBUEXRH5.js → chunk-O5FMCQHP.js} +116 -276
  56. package/dist/_node-chunks/chunk-RIKQZHV3.js +29 -0
  57. package/dist/_node-chunks/chunk-RURZIE3W.js +3780 -0
  58. package/dist/_node-chunks/chunk-RVII4SK6.js +919 -0
  59. package/dist/_node-chunks/chunk-S3PBHOVC.js +6024 -0
  60. package/dist/_node-chunks/chunk-SQSFX47N.js +61 -0
  61. package/dist/_node-chunks/{chunk-SGM3ZCCT.js → chunk-TURUTKVH.js} +292 -688
  62. package/dist/_node-chunks/chunk-VRICJPXY.js +72 -0
  63. package/dist/_node-chunks/chunk-WIWWMCEU.js +119 -0
  64. package/dist/_node-chunks/{chunk-ATDHMMIZ.js → chunk-XGNRK7QB.js} +15 -24
  65. package/dist/_node-chunks/chunk-Y2FOTPAE.js +4523 -0
  66. package/dist/_node-chunks/{chunk-GHIBZRKD.js → chunk-Y4UYN72K.js} +8133 -8887
  67. package/dist/_node-chunks/chunk-Z4BMBA5L.js +18 -0
  68. package/dist/_node-chunks/chunk-ZMCJS2GU.js +20 -0
  69. package/dist/_node-chunks/dist-TZLZ3T6L.js +121 -0
  70. package/dist/_node-chunks/globby-22GFCZQD.js +3452 -0
  71. package/dist/_node-chunks/lib-37NQ4ZIJ.js +366 -0
  72. package/dist/_node-chunks/mdx-N42X6CFJ-2TRB7OEH.js +14329 -0
  73. package/dist/_node-chunks/p-limit-UD7TYFDW.js +116 -0
  74. package/dist/actions/decorator.js +21 -42
  75. package/dist/actions/index.js +3 -3
  76. package/dist/babel/index.d.ts +671 -335
  77. package/dist/babel/index.js +10 -11
  78. package/dist/bin/core.js +602 -1549
  79. package/dist/bin/dispatcher.js +36 -36
  80. package/dist/bin/loader.js +24 -38
  81. package/dist/channels/index.js +98 -234
  82. package/dist/cli/index.d.ts +1479 -133
  83. package/dist/cli/index.js +30 -8540
  84. package/dist/client-logger/index.js +31 -61
  85. package/dist/common/index.d.ts +139 -62
  86. package/dist/common/index.js +66 -51
  87. package/dist/components/index.d.ts +575 -273
  88. package/dist/components/index.js +14863 -4313
  89. package/dist/core-events/index.js +2 -66
  90. package/dist/core-server/index.d.ts +3 -2
  91. package/dist/core-server/index.js +2911 -8519
  92. package/dist/core-server/presets/common-manager.css +2 -2
  93. package/dist/core-server/presets/common-manager.js +2521 -5233
  94. package/dist/core-server/presets/common-override-preset.js +31 -60
  95. package/dist/core-server/presets/common-preset.js +663 -962
  96. package/dist/csf/index.js +534 -1179
  97. package/dist/csf-tools/index.js +9 -9
  98. package/dist/docs-tools/index.js +6 -6
  99. package/dist/highlight/index.js +2 -2
  100. package/dist/instrumenter/index.js +199 -415
  101. package/dist/manager/globals-runtime.js +59044 -67141
  102. package/dist/manager/globals.js +2 -3
  103. package/dist/manager/manager-stores.d.ts +1 -0
  104. package/dist/manager/manager-stores.js +23 -0
  105. package/dist/manager/runtime.js +11569 -10953
  106. package/dist/manager-api/index.d.ts +1813 -2
  107. package/dist/manager-api/index.js +1348 -2401
  108. package/dist/manager-errors.d.ts +9 -0
  109. package/dist/manager-errors.js +3 -3
  110. package/dist/mocking-utils/index.d.ts +1126 -0
  111. package/dist/mocking-utils/index.js +1181 -0
  112. package/dist/node-logger/index.d.ts +192 -24
  113. package/dist/node-logger/index.js +23 -4471
  114. package/dist/preview/globals.js +2 -3
  115. package/dist/preview/runtime.js +10799 -22393
  116. package/dist/preview-api/index.d.ts +1 -1
  117. package/dist/preview-api/index.js +13 -13
  118. package/dist/preview-errors.d.ts +9 -0
  119. package/dist/preview-errors.js +4 -4
  120. package/dist/router/index.js +347 -899
  121. package/dist/server-errors.d.ts +34 -1
  122. package/dist/server-errors.js +17 -10
  123. package/dist/telemetry/index.d.ts +24 -3
  124. package/dist/telemetry/index.js +25 -24
  125. package/dist/test/index.js +6131 -11916
  126. package/dist/theming/create.d.ts +1 -0
  127. package/dist/theming/create.js +4 -4
  128. package/dist/theming/index.d.ts +3366 -2599
  129. package/dist/theming/index.js +501 -1091
  130. package/dist/types/index.d.ts +72 -8
  131. package/dist/types/index.js +27 -12
  132. package/dist/viewport/index.js +3 -3
  133. package/package.json +26 -17
  134. package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
  135. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  136. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  137. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  138. package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
  139. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  140. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  141. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  142. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  143. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  144. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  145. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  146. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  147. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  148. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  149. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  150. package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
  151. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  152. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  153. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  154. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  155. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  156. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  157. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  158. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  159. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  160. package/dist/_node-chunks/camelcase-H5QSGQLK.js +0 -18
  161. package/dist/_node-chunks/chunk-3THWHQOC.js +0 -61
  162. package/dist/_node-chunks/chunk-45YUOLTU.js +0 -69
  163. package/dist/_node-chunks/chunk-4QSNCPAU.js +0 -64656
  164. package/dist/_node-chunks/chunk-744PQSOU.js +0 -79
  165. package/dist/_node-chunks/chunk-74Z2U7QG.js +0 -1544
  166. package/dist/_node-chunks/chunk-7MB7TFPO.js +0 -1198
  167. package/dist/_node-chunks/chunk-A7GS4RFT.js +0 -697
  168. package/dist/_node-chunks/chunk-BIA3A5UM.js +0 -61
  169. package/dist/_node-chunks/chunk-C5G7CLWX.js +0 -1657
  170. package/dist/_node-chunks/chunk-DLFUKMYJ.js +0 -1531
  171. package/dist/_node-chunks/chunk-EMRGRXKT.js +0 -111
  172. package/dist/_node-chunks/chunk-EX46EHHY.js +0 -420
  173. package/dist/_node-chunks/chunk-F76QKNOJ.js +0 -304
  174. package/dist/_node-chunks/chunk-HDCRUTEF.js +0 -220
  175. package/dist/_node-chunks/chunk-HUYAOIPH.js +0 -90
  176. package/dist/_node-chunks/chunk-IBJZQZJC.js +0 -101
  177. package/dist/_node-chunks/chunk-KZN2RDDT.js +0 -6712
  178. package/dist/_node-chunks/chunk-LYUNFU3F.js +0 -4741
  179. package/dist/_node-chunks/chunk-N44SIS6K.js +0 -28
  180. package/dist/_node-chunks/chunk-NILZM6KR.js +0 -18
  181. package/dist/_node-chunks/chunk-PC4ZRP6W.js +0 -34
  182. package/dist/_node-chunks/chunk-TJNGOQUH.js +0 -4272
  183. package/dist/_node-chunks/chunk-UBSYLHIL.js +0 -1250
  184. package/dist/_node-chunks/chunk-UTCLXPOC.js +0 -1518
  185. package/dist/_node-chunks/chunk-WOXXODXP.js +0 -5029
  186. package/dist/_node-chunks/chunk-XC4MEUA6.js +0 -1586
  187. package/dist/_node-chunks/chunk-YRXXMKRR.js +0 -2256
  188. package/dist/_node-chunks/dist-SL73W244.js +0 -175
  189. package/dist/_node-chunks/globby-ZSHAUQZ5.js +0 -5222
  190. package/dist/_node-chunks/lib-U2VIPUTI.js +0 -518
  191. package/dist/_node-chunks/mdx-N42X6CFJ-ZLHD33JK.js +0 -22017
  192. package/dist/_node-chunks/p-limit-K5BS5MSV.js +0 -168
  193. package/dist/_node-chunks/plugin-5PD4YIUH.js +0 -129
  194. package/dist/_node-chunks/plugin-MONDT2WL.js +0 -159
  195. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-EUZJRG3W.js +0 -69102
  196. package/dist/_node-chunks/webpack-mock-plugin-T4LDXEHE.js +0 -124
  197. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
  198. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
@@ -1,4483 +1,35 @@
1
- import CJS_COMPAT_NODE_URL_jpweijb0qqj from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_jpweijb0qqj from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_jpweijb0qqj from "node:module";
1
+ import CJS_COMPAT_NODE_URL_jdojl2z4eei from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_jdojl2z4eei from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_jdojl2z4eei from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_jpweijb0qqj.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_jpweijb0qqj.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_jpweijb0qqj.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_jdojl2z4eei.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_jdojl2z4eei.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_jdojl2z4eei.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
- require_pretty_hrtime
14
- } from "../_node-chunks/chunk-HUYAOIPH.js";
15
- import {
16
- ansi_styles_default,
17
- boxen,
18
- require_string_width,
19
- stripAnsi
20
- } from "../_node-chunks/chunk-XC4MEUA6.js";
21
- import "../_node-chunks/chunk-IBJZQZJC.js";
22
- import {
23
- execaSync,
24
- optionalEnvToBoolean
25
- } from "../_node-chunks/chunk-LYUNFU3F.js";
26
- import "../_node-chunks/chunk-744PQSOU.js";
27
- import {
28
- require_prompts,
29
- require_src
30
- } from "../_node-chunks/chunk-WOXXODXP.js";
31
- import {
32
- require_picocolors
33
- } from "../_node-chunks/chunk-ATDHMMIZ.js";
34
- import {
35
- __commonJS,
36
- __export,
37
- __name,
38
- __require,
39
- __toESM
40
- } from "../_node-chunks/chunk-3THWHQOC.js";
41
-
42
- // ../node_modules/are-we-there-yet/lib/tracker-base.js
43
- var require_tracker_base = __commonJS({
44
- "../node_modules/are-we-there-yet/lib/tracker-base.js"(exports, module) {
45
- "use strict";
46
- var EventEmitter = __require("events");
47
- var trackerId = 0;
48
- var TrackerBase = class extends EventEmitter {
49
- static {
50
- __name(this, "TrackerBase");
51
- }
52
- constructor(name) {
53
- super();
54
- this.id = ++trackerId;
55
- this.name = name;
56
- }
57
- };
58
- module.exports = TrackerBase;
59
- }
60
- });
61
-
62
- // ../node_modules/are-we-there-yet/lib/tracker.js
63
- var require_tracker = __commonJS({
64
- "../node_modules/are-we-there-yet/lib/tracker.js"(exports, module) {
65
- "use strict";
66
- var TrackerBase = require_tracker_base();
67
- var Tracker = class extends TrackerBase {
68
- static {
69
- __name(this, "Tracker");
70
- }
71
- constructor(name, todo) {
72
- super(name);
73
- this.workDone = 0;
74
- this.workTodo = todo || 0;
75
- }
76
- completed() {
77
- return this.workTodo === 0 ? 0 : this.workDone / this.workTodo;
78
- }
79
- addWork(work) {
80
- this.workTodo += work;
81
- this.emit("change", this.name, this.completed(), this);
82
- }
83
- completeWork(work) {
84
- this.workDone += work;
85
- if (this.workDone > this.workTodo) {
86
- this.workDone = this.workTodo;
87
- }
88
- this.emit("change", this.name, this.completed(), this);
89
- }
90
- finish() {
91
- this.workTodo = this.workDone = 1;
92
- this.emit("change", this.name, 1, this);
93
- }
94
- };
95
- module.exports = Tracker;
96
- }
97
- });
98
-
99
- // ../node_modules/are-we-there-yet/lib/tracker-stream.js
100
- var require_tracker_stream = __commonJS({
101
- "../node_modules/are-we-there-yet/lib/tracker-stream.js"(exports, module) {
102
- "use strict";
103
- var stream = __require("stream");
104
- var Tracker = require_tracker();
105
- var TrackerStream = class extends stream.Transform {
106
- static {
107
- __name(this, "TrackerStream");
108
- }
109
- constructor(name, size, options) {
110
- super(options);
111
- this.tracker = new Tracker(name, size);
112
- this.name = name;
113
- this.id = this.tracker.id;
114
- this.tracker.on("change", this.trackerChange.bind(this));
115
- }
116
- trackerChange(name, completion) {
117
- this.emit("change", name, completion, this);
118
- }
119
- _transform(data, encoding, cb) {
120
- this.tracker.completeWork(data.length ? data.length : 1);
121
- this.push(data);
122
- cb();
123
- }
124
- _flush(cb) {
125
- this.tracker.finish();
126
- cb();
127
- }
128
- completed() {
129
- return this.tracker.completed();
130
- }
131
- addWork(work) {
132
- return this.tracker.addWork(work);
133
- }
134
- finish() {
135
- return this.tracker.finish();
136
- }
137
- };
138
- module.exports = TrackerStream;
139
- }
140
- });
141
-
142
- // ../node_modules/are-we-there-yet/lib/tracker-group.js
143
- var require_tracker_group = __commonJS({
144
- "../node_modules/are-we-there-yet/lib/tracker-group.js"(exports, module) {
145
- "use strict";
146
- var TrackerBase = require_tracker_base();
147
- var Tracker = require_tracker();
148
- var TrackerStream = require_tracker_stream();
149
- var TrackerGroup = class _TrackerGroup extends TrackerBase {
150
- static {
151
- __name(this, "TrackerGroup");
152
- }
153
- parentGroup = null;
154
- trackers = [];
155
- completion = {};
156
- weight = {};
157
- totalWeight = 0;
158
- finished = false;
159
- bubbleChange = bubbleChange(this);
160
- nameInTree() {
161
- var names = [];
162
- var from = this;
163
- while (from) {
164
- names.unshift(from.name);
165
- from = from.parentGroup;
166
- }
167
- return names.join("/");
168
- }
169
- addUnit(unit, weight) {
170
- if (unit.addUnit) {
171
- var toTest = this;
172
- while (toTest) {
173
- if (unit === toTest) {
174
- throw new Error(
175
- "Attempted to add tracker group " + unit.name + " to tree that already includes it " + this.nameInTree(this)
176
- );
177
- }
178
- toTest = toTest.parentGroup;
179
- }
180
- unit.parentGroup = this;
181
- }
182
- this.weight[unit.id] = weight || 1;
183
- this.totalWeight += this.weight[unit.id];
184
- this.trackers.push(unit);
185
- this.completion[unit.id] = unit.completed();
186
- unit.on("change", this.bubbleChange);
187
- if (!this.finished) {
188
- this.emit("change", unit.name, this.completion[unit.id], unit);
189
- }
190
- return unit;
191
- }
192
- completed() {
193
- if (this.trackers.length === 0) {
194
- return 0;
195
- }
196
- var valPerWeight = 1 / this.totalWeight;
197
- var completed = 0;
198
- for (var ii = 0; ii < this.trackers.length; ii++) {
199
- var trackerId = this.trackers[ii].id;
200
- completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId];
201
- }
202
- return completed;
203
- }
204
- newGroup(name, weight) {
205
- return this.addUnit(new _TrackerGroup(name), weight);
206
- }
207
- newItem(name, todo, weight) {
208
- return this.addUnit(new Tracker(name, todo), weight);
209
- }
210
- newStream(name, todo, weight) {
211
- return this.addUnit(new TrackerStream(name, todo), weight);
212
- }
213
- finish() {
214
- this.finished = true;
215
- if (!this.trackers.length) {
216
- this.addUnit(new Tracker(), 1, true);
217
- }
218
- for (var ii = 0; ii < this.trackers.length; ii++) {
219
- var tracker = this.trackers[ii];
220
- tracker.finish();
221
- tracker.removeListener("change", this.bubbleChange);
222
- }
223
- this.emit("change", this.name, 1, this);
224
- }
225
- debug(depth = 0) {
226
- const indent = " ".repeat(depth);
227
- let output = `${indent}${this.name || "top"}: ${this.completed()}
228
- `;
229
- this.trackers.forEach(function(tracker) {
230
- output += tracker instanceof _TrackerGroup ? tracker.debug(depth + 1) : `${indent} ${tracker.name}: ${tracker.completed()}
231
- `;
232
- });
233
- return output;
234
- }
235
- };
236
- function bubbleChange(trackerGroup) {
237
- return function(name, completed, tracker) {
238
- trackerGroup.completion[tracker.id] = completed;
239
- if (trackerGroup.finished) {
240
- return;
241
- }
242
- trackerGroup.emit("change", name || trackerGroup.name, trackerGroup.completed(), trackerGroup);
243
- };
244
- }
245
- __name(bubbleChange, "bubbleChange");
246
- module.exports = TrackerGroup;
247
- }
248
- });
249
-
250
- // ../node_modules/are-we-there-yet/lib/index.js
251
- var require_lib = __commonJS({
252
- "../node_modules/are-we-there-yet/lib/index.js"(exports) {
253
- "use strict";
254
- exports.TrackerGroup = require_tracker_group();
255
- exports.Tracker = require_tracker();
256
- exports.TrackerStream = require_tracker_stream();
257
- }
258
- });
259
-
260
- // ../node_modules/console-control-strings/index.js
261
- var require_console_control_strings = __commonJS({
262
- "../node_modules/console-control-strings/index.js"(exports) {
263
- "use strict";
264
- var prefix = "\x1B[";
265
- exports.up = /* @__PURE__ */ __name(function up(num) {
266
- return prefix + (num || "") + "A";
267
- }, "up");
268
- exports.down = /* @__PURE__ */ __name(function down(num) {
269
- return prefix + (num || "") + "B";
270
- }, "down");
271
- exports.forward = /* @__PURE__ */ __name(function forward(num) {
272
- return prefix + (num || "") + "C";
273
- }, "forward");
274
- exports.back = /* @__PURE__ */ __name(function back(num) {
275
- return prefix + (num || "") + "D";
276
- }, "back");
277
- exports.nextLine = /* @__PURE__ */ __name(function nextLine(num) {
278
- return prefix + (num || "") + "E";
279
- }, "nextLine");
280
- exports.previousLine = /* @__PURE__ */ __name(function previousLine(num) {
281
- return prefix + (num || "") + "F";
282
- }, "previousLine");
283
- exports.horizontalAbsolute = /* @__PURE__ */ __name(function horizontalAbsolute(num) {
284
- if (num == null) throw new Error("horizontalAboslute requires a column to position to");
285
- return prefix + num + "G";
286
- }, "horizontalAbsolute");
287
- exports.eraseData = /* @__PURE__ */ __name(function eraseData() {
288
- return prefix + "J";
289
- }, "eraseData");
290
- exports.eraseLine = /* @__PURE__ */ __name(function eraseLine() {
291
- return prefix + "K";
292
- }, "eraseLine");
293
- exports.goto = function(x, y2) {
294
- return prefix + y2 + ";" + x + "H";
295
- };
296
- exports.gotoSOL = function() {
297
- return "\r";
298
- };
299
- exports.beep = function() {
300
- return "\x07";
301
- };
302
- exports.hideCursor = /* @__PURE__ */ __name(function hideCursor() {
303
- return prefix + "?25l";
304
- }, "hideCursor");
305
- exports.showCursor = /* @__PURE__ */ __name(function showCursor() {
306
- return prefix + "?25h";
307
- }, "showCursor");
308
- var colors2 = {
309
- reset: 0,
310
- // styles
311
- bold: 1,
312
- italic: 3,
313
- underline: 4,
314
- inverse: 7,
315
- // resets
316
- stopBold: 22,
317
- stopItalic: 23,
318
- stopUnderline: 24,
319
- stopInverse: 27,
320
- // colors
321
- white: 37,
322
- black: 30,
323
- blue: 34,
324
- cyan: 36,
325
- green: 32,
326
- magenta: 35,
327
- red: 31,
328
- yellow: 33,
329
- bgWhite: 47,
330
- bgBlack: 40,
331
- bgBlue: 44,
332
- bgCyan: 46,
333
- bgGreen: 42,
334
- bgMagenta: 45,
335
- bgRed: 41,
336
- bgYellow: 43,
337
- grey: 90,
338
- brightBlack: 90,
339
- brightRed: 91,
340
- brightGreen: 92,
341
- brightYellow: 93,
342
- brightBlue: 94,
343
- brightMagenta: 95,
344
- brightCyan: 96,
345
- brightWhite: 97,
346
- bgGrey: 100,
347
- bgBrightBlack: 100,
348
- bgBrightRed: 101,
349
- bgBrightGreen: 102,
350
- bgBrightYellow: 103,
351
- bgBrightBlue: 104,
352
- bgBrightMagenta: 105,
353
- bgBrightCyan: 106,
354
- bgBrightWhite: 107
355
- };
356
- exports.color = /* @__PURE__ */ __name(function color(colorWith) {
357
- if (arguments.length !== 1 || !Array.isArray(colorWith)) {
358
- colorWith = Array.prototype.slice.call(arguments);
359
- }
360
- return prefix + colorWith.map(colorNameToCode).join(";") + "m";
361
- }, "color");
362
- function colorNameToCode(color) {
363
- if (colors2[color] != null) return colors2[color];
364
- throw new Error("Unknown color or style name: " + color);
365
- }
366
- __name(colorNameToCode, "colorNameToCode");
367
- }
368
- });
369
-
370
- // ../node_modules/wide-align/align.js
371
- var require_align = __commonJS({
372
- "../node_modules/wide-align/align.js"(exports) {
373
- "use strict";
374
- var stringWidth2 = require_string_width();
375
- exports.center = alignCenter;
376
- exports.left = alignLeft;
377
- exports.right = alignRight;
378
- function createPadding(width) {
379
- var result = "";
380
- var string = " ";
381
- var n = width;
382
- do {
383
- if (n % 2) {
384
- result += string;
385
- }
386
- n = Math.floor(n / 2);
387
- string += string;
388
- } while (n);
389
- return result;
390
- }
391
- __name(createPadding, "createPadding");
392
- function alignLeft(str, width) {
393
- var trimmed = str.trimRight();
394
- if (trimmed.length === 0 && str.length >= width) return str;
395
- var padding = "";
396
- var strWidth = stringWidth2(trimmed);
397
- if (strWidth < width) {
398
- padding = createPadding(width - strWidth);
399
- }
400
- return trimmed + padding;
401
- }
402
- __name(alignLeft, "alignLeft");
403
- function alignRight(str, width) {
404
- var trimmed = str.trimLeft();
405
- if (trimmed.length === 0 && str.length >= width) return str;
406
- var padding = "";
407
- var strWidth = stringWidth2(trimmed);
408
- if (strWidth < width) {
409
- padding = createPadding(width - strWidth);
410
- }
411
- return padding + trimmed;
412
- }
413
- __name(alignRight, "alignRight");
414
- function alignCenter(str, width) {
415
- var trimmed = str.trim();
416
- if (trimmed.length === 0 && str.length >= width) return str;
417
- var padLeft = "";
418
- var padRight = "";
419
- var strWidth = stringWidth2(trimmed);
420
- if (strWidth < width) {
421
- var padLeftBy = parseInt((width - strWidth) / 2, 10);
422
- padLeft = createPadding(padLeftBy);
423
- padRight = createPadding(width - (strWidth + padLeftBy));
424
- }
425
- return padLeft + trimmed + padRight;
426
- }
427
- __name(alignCenter, "alignCenter");
428
- }
429
- });
430
-
431
- // ../node_modules/aproba/index.js
432
- var require_aproba = __commonJS({
433
- "../node_modules/aproba/index.js"(exports, module) {
434
- "use strict";
435
- module.exports = validate;
436
- function isArguments(thingy) {
437
- return thingy != null && typeof thingy === "object" && thingy.hasOwnProperty("callee");
438
- }
439
- __name(isArguments, "isArguments");
440
- var types = {
441
- "*": { label: "any", check: /* @__PURE__ */ __name(() => true, "check") },
442
- A: { label: "array", check: /* @__PURE__ */ __name((_2) => Array.isArray(_2) || isArguments(_2), "check") },
443
- S: { label: "string", check: /* @__PURE__ */ __name((_2) => typeof _2 === "string", "check") },
444
- N: { label: "number", check: /* @__PURE__ */ __name((_2) => typeof _2 === "number", "check") },
445
- F: { label: "function", check: /* @__PURE__ */ __name((_2) => typeof _2 === "function", "check") },
446
- O: { label: "object", check: /* @__PURE__ */ __name((_2) => typeof _2 === "object" && _2 != null && !types.A.check(_2) && !types.E.check(_2), "check") },
447
- B: { label: "boolean", check: /* @__PURE__ */ __name((_2) => typeof _2 === "boolean", "check") },
448
- E: { label: "error", check: /* @__PURE__ */ __name((_2) => _2 instanceof Error, "check") },
449
- Z: { label: "null", check: /* @__PURE__ */ __name((_2) => _2 == null, "check") }
450
- };
451
- function addSchema(schema, arity) {
452
- const group = arity[schema.length] = arity[schema.length] || [];
453
- if (group.indexOf(schema) === -1) group.push(schema);
454
- }
455
- __name(addSchema, "addSchema");
456
- function validate(rawSchemas, args) {
457
- if (arguments.length !== 2) throw wrongNumberOfArgs(["SA"], arguments.length);
458
- if (!rawSchemas) throw missingRequiredArg(0, "rawSchemas");
459
- if (!args) throw missingRequiredArg(1, "args");
460
- if (!types.S.check(rawSchemas)) throw invalidType(0, ["string"], rawSchemas);
461
- if (!types.A.check(args)) throw invalidType(1, ["array"], args);
462
- const schemas = rawSchemas.split("|");
463
- const arity = {};
464
- schemas.forEach((schema) => {
465
- for (let ii = 0; ii < schema.length; ++ii) {
466
- const type = schema[ii];
467
- if (!types[type]) throw unknownType(ii, type);
468
- }
469
- if (/E.*E/.test(schema)) throw moreThanOneError(schema);
470
- addSchema(schema, arity);
471
- if (/E/.test(schema)) {
472
- addSchema(schema.replace(/E.*$/, "E"), arity);
473
- addSchema(schema.replace(/E/, "Z"), arity);
474
- if (schema.length === 1) addSchema("", arity);
475
- }
476
- });
477
- let matching = arity[args.length];
478
- if (!matching) {
479
- throw wrongNumberOfArgs(Object.keys(arity), args.length);
480
- }
481
- for (let ii = 0; ii < args.length; ++ii) {
482
- let newMatching = matching.filter((schema) => {
483
- const type = schema[ii];
484
- const typeCheck = types[type].check;
485
- return typeCheck(args[ii]);
486
- });
487
- if (!newMatching.length) {
488
- const labels = matching.map((_2) => types[_2[ii]].label).filter((_2) => _2 != null);
489
- throw invalidType(ii, labels, args[ii]);
490
- }
491
- matching = newMatching;
492
- }
493
- }
494
- __name(validate, "validate");
495
- function missingRequiredArg(num) {
496
- return newException("EMISSINGARG", "Missing required argument #" + (num + 1));
497
- }
498
- __name(missingRequiredArg, "missingRequiredArg");
499
- function unknownType(num, type) {
500
- return newException("EUNKNOWNTYPE", "Unknown type " + type + " in argument #" + (num + 1));
501
- }
502
- __name(unknownType, "unknownType");
503
- function invalidType(num, expectedTypes, value) {
504
- let valueType;
505
- Object.keys(types).forEach((typeCode) => {
506
- if (types[typeCode].check(value)) valueType = types[typeCode].label;
507
- });
508
- return newException("EINVALIDTYPE", "Argument #" + (num + 1) + ": Expected " + englishList(expectedTypes) + " but got " + valueType);
509
- }
510
- __name(invalidType, "invalidType");
511
- function englishList(list) {
512
- return list.join(", ").replace(/, ([^,]+)$/, " or $1");
513
- }
514
- __name(englishList, "englishList");
515
- function wrongNumberOfArgs(expected, got) {
516
- const english = englishList(expected);
517
- const args = expected.every((ex) => ex.length === 1) ? "argument" : "arguments";
518
- return newException("EWRONGARGCOUNT", "Expected " + english + " " + args + " but got " + got);
519
- }
520
- __name(wrongNumberOfArgs, "wrongNumberOfArgs");
521
- function moreThanOneError(schema) {
522
- return newException(
523
- "ETOOMANYERRORTYPES",
524
- 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"'
525
- );
526
- }
527
- __name(moreThanOneError, "moreThanOneError");
528
- function newException(code, msg) {
529
- const err = new TypeError(msg);
530
- err.code = code;
531
- if (Error.captureStackTrace) Error.captureStackTrace(err, validate);
532
- return err;
533
- }
534
- __name(newException, "newException");
535
- }
536
- });
537
-
538
- // ../node_modules/gauge/node_modules/ansi-regex/index.js
539
- var require_ansi_regex = __commonJS({
540
- "../node_modules/gauge/node_modules/ansi-regex/index.js"(exports, module) {
541
- "use strict";
542
- module.exports = ({ onlyFirst = false } = {}) => {
543
- const pattern = [
544
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
545
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
546
- ].join("|");
547
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
548
- };
549
- }
550
- });
551
-
552
- // ../node_modules/gauge/node_modules/strip-ansi/index.js
553
- var require_strip_ansi = __commonJS({
554
- "../node_modules/gauge/node_modules/strip-ansi/index.js"(exports, module) {
555
- "use strict";
556
- var ansiRegex2 = require_ansi_regex();
557
- module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
558
- }
559
- });
560
-
561
- // ../node_modules/gauge/lib/wide-truncate.js
562
- var require_wide_truncate = __commonJS({
563
- "../node_modules/gauge/lib/wide-truncate.js"(exports, module) {
564
- "use strict";
565
- var stringWidth2 = require_string_width();
566
- var stripAnsi3 = require_strip_ansi();
567
- module.exports = wideTruncate;
568
- function wideTruncate(str, target) {
569
- if (stringWidth2(str) === 0) {
570
- return str;
571
- }
572
- if (target <= 0) {
573
- return "";
574
- }
575
- if (stringWidth2(str) <= target) {
576
- return str;
577
- }
578
- var noAnsi = stripAnsi3(str);
579
- var ansiSize = str.length + noAnsi.length;
580
- var truncated = str.slice(0, target + ansiSize);
581
- while (stringWidth2(truncated) > target) {
582
- truncated = truncated.slice(0, -1);
583
- }
584
- return truncated;
585
- }
586
- __name(wideTruncate, "wideTruncate");
587
- }
588
- });
589
-
590
- // ../node_modules/gauge/lib/error.js
591
- var require_error = __commonJS({
592
- "../node_modules/gauge/lib/error.js"(exports) {
593
- "use strict";
594
- var util = __require("util");
595
- var User = exports.User = /* @__PURE__ */ __name(function User2(msg) {
596
- var err = new Error(msg);
597
- Error.captureStackTrace(err, User2);
598
- err.code = "EGAUGE";
599
- return err;
600
- }, "User");
601
- exports.MissingTemplateValue = /* @__PURE__ */ __name(function MissingTemplateValue(item, values) {
602
- var err = new User(util.format('Missing template value "%s"', item.type));
603
- Error.captureStackTrace(err, MissingTemplateValue);
604
- err.template = item;
605
- err.values = values;
606
- return err;
607
- }, "MissingTemplateValue");
608
- exports.Internal = /* @__PURE__ */ __name(function Internal(msg) {
609
- var err = new Error(msg);
610
- Error.captureStackTrace(err, Internal);
611
- err.code = "EGAUGEINTERNAL";
612
- return err;
613
- }, "Internal");
614
- }
615
- });
616
-
617
- // ../node_modules/gauge/lib/template-item.js
618
- var require_template_item = __commonJS({
619
- "../node_modules/gauge/lib/template-item.js"(exports, module) {
620
- "use strict";
621
- var stringWidth2 = require_string_width();
622
- module.exports = TemplateItem;
623
- function isPercent(num) {
624
- if (typeof num !== "string") {
625
- return false;
626
- }
627
- return num.slice(-1) === "%";
628
- }
629
- __name(isPercent, "isPercent");
630
- function percent(num) {
631
- return Number(num.slice(0, -1)) / 100;
632
- }
633
- __name(percent, "percent");
634
- function TemplateItem(values, outputLength) {
635
- this.overallOutputLength = outputLength;
636
- this.finished = false;
637
- this.type = null;
638
- this.value = null;
639
- this.length = null;
640
- this.maxLength = null;
641
- this.minLength = null;
642
- this.kerning = null;
643
- this.align = "left";
644
- this.padLeft = 0;
645
- this.padRight = 0;
646
- this.index = null;
647
- this.first = null;
648
- this.last = null;
649
- if (typeof values === "string") {
650
- this.value = values;
651
- } else {
652
- for (var prop in values) {
653
- this[prop] = values[prop];
654
- }
655
- }
656
- if (isPercent(this.length)) {
657
- this.length = Math.round(this.overallOutputLength * percent(this.length));
658
- }
659
- if (isPercent(this.minLength)) {
660
- this.minLength = Math.round(this.overallOutputLength * percent(this.minLength));
661
- }
662
- if (isPercent(this.maxLength)) {
663
- this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength));
664
- }
665
- return this;
666
- }
667
- __name(TemplateItem, "TemplateItem");
668
- TemplateItem.prototype = {};
669
- TemplateItem.prototype.getBaseLength = function() {
670
- var length = this.length;
671
- if (length == null && typeof this.value === "string" && this.maxLength == null && this.minLength == null) {
672
- length = stringWidth2(this.value);
673
- }
674
- return length;
675
- };
676
- TemplateItem.prototype.getLength = function() {
677
- var length = this.getBaseLength();
678
- if (length == null) {
679
- return null;
680
- }
681
- return length + this.padLeft + this.padRight;
682
- };
683
- TemplateItem.prototype.getMaxLength = function() {
684
- if (this.maxLength == null) {
685
- return null;
686
- }
687
- return this.maxLength + this.padLeft + this.padRight;
688
- };
689
- TemplateItem.prototype.getMinLength = function() {
690
- if (this.minLength == null) {
691
- return null;
692
- }
693
- return this.minLength + this.padLeft + this.padRight;
694
- };
695
- }
696
- });
697
-
698
- // ../node_modules/gauge/lib/render-template.js
699
- var require_render_template = __commonJS({
700
- "../node_modules/gauge/lib/render-template.js"(exports, module) {
701
- "use strict";
702
- var align = require_align();
703
- var validate = require_aproba();
704
- var wideTruncate = require_wide_truncate();
705
- var error2 = require_error();
706
- var TemplateItem = require_template_item();
707
- function renderValueWithValues(values) {
708
- return function(item) {
709
- return renderValue(item, values);
710
- };
711
- }
712
- __name(renderValueWithValues, "renderValueWithValues");
713
- var renderTemplate = module.exports = function(width, template, values) {
714
- var items = prepareItems(width, template, values);
715
- var rendered = items.map(renderValueWithValues(values)).join("");
716
- return align.left(wideTruncate(rendered, width), width);
717
- };
718
- function preType(item) {
719
- var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1);
720
- return "pre" + cappedTypeName;
721
- }
722
- __name(preType, "preType");
723
- function postType(item) {
724
- var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1);
725
- return "post" + cappedTypeName;
726
- }
727
- __name(postType, "postType");
728
- function hasPreOrPost(item, values) {
729
- if (!item.type) {
730
- return;
731
- }
732
- return values[preType(item)] || values[postType(item)];
733
- }
734
- __name(hasPreOrPost, "hasPreOrPost");
735
- function generatePreAndPost(baseItem, parentValues) {
736
- var item = Object.assign({}, baseItem);
737
- var values = Object.create(parentValues);
738
- var template = [];
739
- var pre = preType(item);
740
- var post = postType(item);
741
- if (values[pre]) {
742
- template.push({ value: values[pre] });
743
- values[pre] = null;
744
- }
745
- item.minLength = null;
746
- item.length = null;
747
- item.maxLength = null;
748
- template.push(item);
749
- values[item.type] = values[item.type];
750
- if (values[post]) {
751
- template.push({ value: values[post] });
752
- values[post] = null;
753
- }
754
- return function($1, $2, length) {
755
- return renderTemplate(length, template, values);
756
- };
757
- }
758
- __name(generatePreAndPost, "generatePreAndPost");
759
- function prepareItems(width, template, values) {
760
- function cloneAndObjectify(item, index, arr) {
761
- var cloned = new TemplateItem(item, width);
762
- var type = cloned.type;
763
- if (cloned.value == null) {
764
- if (!(type in values)) {
765
- if (cloned.default == null) {
766
- throw new error2.MissingTemplateValue(cloned, values);
767
- } else {
768
- cloned.value = cloned.default;
769
- }
770
- } else {
771
- cloned.value = values[type];
772
- }
773
- }
774
- if (cloned.value == null || cloned.value === "") {
775
- return null;
776
- }
777
- cloned.index = index;
778
- cloned.first = index === 0;
779
- cloned.last = index === arr.length - 1;
780
- if (hasPreOrPost(cloned, values)) {
781
- cloned.value = generatePreAndPost(cloned, values);
782
- }
783
- return cloned;
784
- }
785
- __name(cloneAndObjectify, "cloneAndObjectify");
786
- var output = template.map(cloneAndObjectify).filter(function(item) {
787
- return item != null;
788
- });
789
- var remainingSpace = width;
790
- var variableCount = output.length;
791
- function consumeSpace(length) {
792
- if (length > remainingSpace) {
793
- length = remainingSpace;
794
- }
795
- remainingSpace -= length;
796
- }
797
- __name(consumeSpace, "consumeSpace");
798
- function finishSizing(item, length) {
799
- if (item.finished) {
800
- throw new error2.Internal("Tried to finish template item that was already finished");
801
- }
802
- if (length === Infinity) {
803
- throw new error2.Internal("Length of template item cannot be infinity");
804
- }
805
- if (length != null) {
806
- item.length = length;
807
- }
808
- item.minLength = null;
809
- item.maxLength = null;
810
- --variableCount;
811
- item.finished = true;
812
- if (item.length == null) {
813
- item.length = item.getBaseLength();
814
- }
815
- if (item.length == null) {
816
- throw new error2.Internal("Finished template items must have a length");
817
- }
818
- consumeSpace(item.getLength());
819
- }
820
- __name(finishSizing, "finishSizing");
821
- output.forEach(function(item) {
822
- if (!item.kerning) {
823
- return;
824
- }
825
- var prevPadRight = item.first ? 0 : output[item.index - 1].padRight;
826
- if (!item.first && prevPadRight < item.kerning) {
827
- item.padLeft = item.kerning - prevPadRight;
828
- }
829
- if (!item.last) {
830
- item.padRight = item.kerning;
831
- }
832
- });
833
- output.forEach(function(item) {
834
- if (item.getBaseLength() == null) {
835
- return;
836
- }
837
- finishSizing(item);
838
- });
839
- var resized = 0;
840
- var resizing;
841
- var hunkSize;
842
- do {
843
- resizing = false;
844
- hunkSize = Math.round(remainingSpace / variableCount);
845
- output.forEach(function(item) {
846
- if (item.finished) {
847
- return;
848
- }
849
- if (!item.maxLength) {
850
- return;
851
- }
852
- if (item.getMaxLength() < hunkSize) {
853
- finishSizing(item, item.maxLength);
854
- resizing = true;
855
- }
856
- });
857
- } while (resizing && resized++ < output.length);
858
- if (resizing) {
859
- throw new error2.Internal("Resize loop iterated too many times while determining maxLength");
860
- }
861
- resized = 0;
862
- do {
863
- resizing = false;
864
- hunkSize = Math.round(remainingSpace / variableCount);
865
- output.forEach(function(item) {
866
- if (item.finished) {
867
- return;
868
- }
869
- if (!item.minLength) {
870
- return;
871
- }
872
- if (item.getMinLength() >= hunkSize) {
873
- finishSizing(item, item.minLength);
874
- resizing = true;
875
- }
876
- });
877
- } while (resizing && resized++ < output.length);
878
- if (resizing) {
879
- throw new error2.Internal("Resize loop iterated too many times while determining minLength");
880
- }
881
- hunkSize = Math.round(remainingSpace / variableCount);
882
- output.forEach(function(item) {
883
- if (item.finished) {
884
- return;
885
- }
886
- finishSizing(item, hunkSize);
887
- });
888
- return output;
889
- }
890
- __name(prepareItems, "prepareItems");
891
- function renderFunction(item, values, length) {
892
- validate("OON", arguments);
893
- if (item.type) {
894
- return item.value(values, values[item.type + "Theme"] || {}, length);
895
- } else {
896
- return item.value(values, {}, length);
897
- }
898
- }
899
- __name(renderFunction, "renderFunction");
900
- function renderValue(item, values) {
901
- var length = item.getBaseLength();
902
- var value = typeof item.value === "function" ? renderFunction(item, values, length) : item.value;
903
- if (value == null || value === "") {
904
- return "";
905
- }
906
- var alignWith = align[item.align] || align.left;
907
- var leftPadding = item.padLeft ? align.left("", item.padLeft) : "";
908
- var rightPadding = item.padRight ? align.right("", item.padRight) : "";
909
- var truncated = wideTruncate(String(value), length);
910
- var aligned = alignWith(truncated, length);
911
- return leftPadding + aligned + rightPadding;
912
- }
913
- __name(renderValue, "renderValue");
914
- }
915
- });
916
-
917
- // ../node_modules/gauge/lib/plumbing.js
918
- var require_plumbing = __commonJS({
919
- "../node_modules/gauge/lib/plumbing.js"(exports, module) {
920
- "use strict";
921
- var consoleControl = require_console_control_strings();
922
- var renderTemplate = require_render_template();
923
- var validate = require_aproba();
924
- var Plumbing = module.exports = function(theme, template, width) {
925
- if (!width) {
926
- width = 80;
927
- }
928
- validate("OAN", [theme, template, width]);
929
- this.showing = false;
930
- this.theme = theme;
931
- this.width = width;
932
- this.template = template;
933
- };
934
- Plumbing.prototype = {};
935
- Plumbing.prototype.setTheme = function(theme) {
936
- validate("O", [theme]);
937
- this.theme = theme;
938
- };
939
- Plumbing.prototype.setTemplate = function(template) {
940
- validate("A", [template]);
941
- this.template = template;
942
- };
943
- Plumbing.prototype.setWidth = function(width) {
944
- validate("N", [width]);
945
- this.width = width;
946
- };
947
- Plumbing.prototype.hide = function() {
948
- return consoleControl.gotoSOL() + consoleControl.eraseLine();
949
- };
950
- Plumbing.prototype.hideCursor = consoleControl.hideCursor;
951
- Plumbing.prototype.showCursor = consoleControl.showCursor;
952
- Plumbing.prototype.show = function(status) {
953
- var values = Object.create(this.theme);
954
- for (var key in status) {
955
- values[key] = status[key];
956
- }
957
- return renderTemplate(this.width, this.template, values).trim() + consoleControl.color("reset") + consoleControl.eraseLine() + consoleControl.gotoSOL();
958
- };
959
- }
960
- });
961
-
962
- // ../node_modules/has-unicode/index.js
963
- var require_has_unicode = __commonJS({
964
- "../node_modules/has-unicode/index.js"(exports, module) {
965
- "use strict";
966
- var os = __require("os");
967
- var hasUnicode = module.exports = function() {
968
- if (os.type() == "Windows_NT") {
969
- return false;
970
- }
971
- var isUTF8 = /UTF-?8$/i;
972
- var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG;
973
- return isUTF8.test(ctype);
974
- };
975
- }
976
- });
977
-
978
- // ../node_modules/color-support/index.js
979
- var require_color_support = __commonJS({
980
- "../node_modules/color-support/index.js"(exports, module) {
981
- module.exports = colorSupport({ alwaysReturn: true }, colorSupport);
982
- function hasNone(obj, options) {
983
- obj.level = 0;
984
- obj.hasBasic = false;
985
- obj.has256 = false;
986
- obj.has16m = false;
987
- if (!options.alwaysReturn) {
988
- return false;
989
- }
990
- return obj;
991
- }
992
- __name(hasNone, "hasNone");
993
- function hasBasic(obj) {
994
- obj.hasBasic = true;
995
- obj.has256 = false;
996
- obj.has16m = false;
997
- obj.level = 1;
998
- return obj;
999
- }
1000
- __name(hasBasic, "hasBasic");
1001
- function has256(obj) {
1002
- obj.hasBasic = true;
1003
- obj.has256 = true;
1004
- obj.has16m = false;
1005
- obj.level = 2;
1006
- return obj;
1007
- }
1008
- __name(has256, "has256");
1009
- function has16m(obj) {
1010
- obj.hasBasic = true;
1011
- obj.has256 = true;
1012
- obj.has16m = true;
1013
- obj.level = 3;
1014
- return obj;
1015
- }
1016
- __name(has16m, "has16m");
1017
- function colorSupport(options, obj) {
1018
- options = options || {};
1019
- obj = obj || {};
1020
- if (typeof options.level === "number") {
1021
- switch (options.level) {
1022
- case 0:
1023
- return hasNone(obj, options);
1024
- case 1:
1025
- return hasBasic(obj);
1026
- case 2:
1027
- return has256(obj);
1028
- case 3:
1029
- return has16m(obj);
1030
- }
1031
- }
1032
- obj.level = 0;
1033
- obj.hasBasic = false;
1034
- obj.has256 = false;
1035
- obj.has16m = false;
1036
- if (typeof process === "undefined" || !process || !process.stdout || !process.env || !process.platform) {
1037
- return hasNone(obj, options);
1038
- }
1039
- var env = options.env || process.env;
1040
- var stream = options.stream || process.stdout;
1041
- var term = options.term || env.TERM || "";
1042
- var platform = options.platform || process.platform;
1043
- if (!options.ignoreTTY && !stream.isTTY) {
1044
- return hasNone(obj, options);
1045
- }
1046
- if (!options.ignoreDumb && term === "dumb" && !env.COLORTERM) {
1047
- return hasNone(obj, options);
1048
- }
1049
- if (platform === "win32") {
1050
- return hasBasic(obj);
1051
- }
1052
- if (env.TMUX) {
1053
- return has256(obj);
1054
- }
1055
- if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION)) {
1056
- if (env.TRAVIS) {
1057
- return has256(obj);
1058
- } else {
1059
- return hasNone(obj, options);
1060
- }
1061
- }
1062
- switch (env.TERM_PROGRAM) {
1063
- case "iTerm.app":
1064
- var ver = env.TERM_PROGRAM_VERSION || "0.";
1065
- if (/^[0-2]\./.test(ver)) {
1066
- return has256(obj);
1067
- } else {
1068
- return has16m(obj);
1069
- }
1070
- case "HyperTerm":
1071
- case "Hyper":
1072
- return has16m(obj);
1073
- case "MacTerm":
1074
- return has16m(obj);
1075
- case "Apple_Terminal":
1076
- return has256(obj);
1077
- }
1078
- if (/^xterm-256/.test(term)) {
1079
- return has256(obj);
1080
- }
1081
- if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term)) {
1082
- return hasBasic(obj);
1083
- }
1084
- if (env.COLORTERM) {
1085
- return hasBasic(obj);
1086
- }
1087
- return hasNone(obj, options);
1088
- }
1089
- __name(colorSupport, "colorSupport");
1090
- }
1091
- });
1092
-
1093
- // ../node_modules/gauge/lib/has-color.js
1094
- var require_has_color = __commonJS({
1095
- "../node_modules/gauge/lib/has-color.js"(exports, module) {
1096
- "use strict";
1097
- var colorSupport = require_color_support();
1098
- module.exports = colorSupport().hasBasic;
1099
- }
1100
- });
1101
-
1102
- // ../node_modules/gauge/node_modules/signal-exit/dist/cjs/signals.js
1103
- var require_signals = __commonJS({
1104
- "../node_modules/gauge/node_modules/signal-exit/dist/cjs/signals.js"(exports) {
1105
- "use strict";
1106
- Object.defineProperty(exports, "__esModule", { value: true });
1107
- exports.signals = void 0;
1108
- exports.signals = [];
1109
- exports.signals.push("SIGHUP", "SIGINT", "SIGTERM");
1110
- if (process.platform !== "win32") {
1111
- exports.signals.push(
1112
- "SIGALRM",
1113
- "SIGABRT",
1114
- "SIGVTALRM",
1115
- "SIGXCPU",
1116
- "SIGXFSZ",
1117
- "SIGUSR2",
1118
- "SIGTRAP",
1119
- "SIGSYS",
1120
- "SIGQUIT",
1121
- "SIGIOT"
1122
- // should detect profiler and enable/disable accordingly.
1123
- // see #21
1124
- // 'SIGPROF'
1125
- );
1126
- }
1127
- if (process.platform === "linux") {
1128
- exports.signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1129
- }
1130
- }
1131
- });
1132
-
1133
- // ../node_modules/gauge/node_modules/signal-exit/dist/cjs/index.js
1134
- var require_cjs = __commonJS({
1135
- "../node_modules/gauge/node_modules/signal-exit/dist/cjs/index.js"(exports) {
1136
- "use strict";
1137
- var _a;
1138
- Object.defineProperty(exports, "__esModule", { value: true });
1139
- exports.unload = exports.load = exports.onExit = exports.signals = void 0;
1140
- var signals_js_1 = require_signals();
1141
- Object.defineProperty(exports, "signals", { enumerable: true, get: /* @__PURE__ */ __name(function() {
1142
- return signals_js_1.signals;
1143
- }, "get") });
1144
- var processOk = /* @__PURE__ */ __name((process3) => !!process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function", "processOk");
1145
- var kExitEmitter = Symbol.for("signal-exit emitter");
1146
- var global = globalThis;
1147
- var ObjectDefineProperty = Object.defineProperty.bind(Object);
1148
- var Emitter = class {
1149
- static {
1150
- __name(this, "Emitter");
1151
- }
1152
- emitted = {
1153
- afterExit: false,
1154
- exit: false
1155
- };
1156
- listeners = {
1157
- afterExit: [],
1158
- exit: []
1159
- };
1160
- count = 0;
1161
- id = Math.random();
1162
- constructor() {
1163
- if (global[kExitEmitter]) {
1164
- return global[kExitEmitter];
1165
- }
1166
- ObjectDefineProperty(global, kExitEmitter, {
1167
- value: this,
1168
- writable: false,
1169
- enumerable: false,
1170
- configurable: false
1171
- });
1172
- }
1173
- on(ev, fn) {
1174
- this.listeners[ev].push(fn);
1175
- }
1176
- removeListener(ev, fn) {
1177
- const list = this.listeners[ev];
1178
- const i = list.indexOf(fn);
1179
- if (i === -1) {
1180
- return;
1181
- }
1182
- if (i === 0 && list.length === 1) {
1183
- list.length = 0;
1184
- } else {
1185
- list.splice(i, 1);
1186
- }
1187
- }
1188
- emit(ev, code, signal) {
1189
- if (this.emitted[ev]) {
1190
- return false;
1191
- }
1192
- this.emitted[ev] = true;
1193
- let ret = false;
1194
- for (const fn of this.listeners[ev]) {
1195
- ret = fn(code, signal) === true || ret;
1196
- }
1197
- if (ev === "exit") {
1198
- ret = this.emit("afterExit", code, signal) || ret;
1199
- }
1200
- return ret;
1201
- }
1202
- };
1203
- var SignalExitBase = class {
1204
- static {
1205
- __name(this, "SignalExitBase");
1206
- }
1207
- };
1208
- var signalExitWrap = /* @__PURE__ */ __name((handler) => {
1209
- return {
1210
- onExit(cb, opts) {
1211
- return handler.onExit(cb, opts);
1212
- },
1213
- load() {
1214
- return handler.load();
1215
- },
1216
- unload() {
1217
- return handler.unload();
1218
- }
1219
- };
1220
- }, "signalExitWrap");
1221
- var SignalExitFallback = class extends SignalExitBase {
1222
- static {
1223
- __name(this, "SignalExitFallback");
1224
- }
1225
- onExit() {
1226
- return () => {
1227
- };
1228
- }
1229
- load() {
1230
- }
1231
- unload() {
1232
- }
1233
- };
1234
- var SignalExit = class extends SignalExitBase {
1235
- static {
1236
- __name(this, "SignalExit");
1237
- }
1238
- // "SIGHUP" throws an `ENOSYS` error on Windows,
1239
- // so use a supported signal instead
1240
- /* c8 ignore start */
1241
- #hupSig = process2.platform === "win32" ? "SIGINT" : "SIGHUP";
1242
- /* c8 ignore stop */
1243
- #emitter = new Emitter();
1244
- #process;
1245
- #originalProcessEmit;
1246
- #originalProcessReallyExit;
1247
- #sigListeners = {};
1248
- #loaded = false;
1249
- constructor(process3) {
1250
- super();
1251
- this.#process = process3;
1252
- this.#sigListeners = {};
1253
- for (const sig of signals_js_1.signals) {
1254
- this.#sigListeners[sig] = () => {
1255
- const listeners = this.#process.listeners(sig);
1256
- let { count } = this.#emitter;
1257
- const p = process3;
1258
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
1259
- count += p.__signal_exit_emitter__.count;
1260
- }
1261
- if (listeners.length === count) {
1262
- this.unload();
1263
- const ret = this.#emitter.emit("exit", null, sig);
1264
- const s = sig === "SIGHUP" ? this.#hupSig : sig;
1265
- if (!ret)
1266
- process3.kill(process3.pid, s);
1267
- }
1268
- };
1269
- }
1270
- this.#originalProcessReallyExit = process3.reallyExit;
1271
- this.#originalProcessEmit = process3.emit;
1272
- }
1273
- onExit(cb, opts) {
1274
- if (!processOk(this.#process)) {
1275
- return () => {
1276
- };
1277
- }
1278
- if (this.#loaded === false) {
1279
- this.load();
1280
- }
1281
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
1282
- this.#emitter.on(ev, cb);
1283
- return () => {
1284
- this.#emitter.removeListener(ev, cb);
1285
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
1286
- this.unload();
1287
- }
1288
- };
1289
- }
1290
- load() {
1291
- if (this.#loaded) {
1292
- return;
1293
- }
1294
- this.#loaded = true;
1295
- this.#emitter.count += 1;
1296
- for (const sig of signals_js_1.signals) {
1297
- try {
1298
- const fn = this.#sigListeners[sig];
1299
- if (fn)
1300
- this.#process.on(sig, fn);
1301
- } catch (_2) {
1302
- }
1303
- }
1304
- this.#process.emit = (ev, ...a) => {
1305
- return this.#processEmit(ev, ...a);
1306
- };
1307
- this.#process.reallyExit = (code) => {
1308
- return this.#processReallyExit(code);
1309
- };
1310
- }
1311
- unload() {
1312
- if (!this.#loaded) {
1313
- return;
1314
- }
1315
- this.#loaded = false;
1316
- signals_js_1.signals.forEach((sig) => {
1317
- const listener = this.#sigListeners[sig];
1318
- if (!listener) {
1319
- throw new Error("Listener not defined for signal: " + sig);
1320
- }
1321
- try {
1322
- this.#process.removeListener(sig, listener);
1323
- } catch (_2) {
1324
- }
1325
- });
1326
- this.#process.emit = this.#originalProcessEmit;
1327
- this.#process.reallyExit = this.#originalProcessReallyExit;
1328
- this.#emitter.count -= 1;
1329
- }
1330
- #processReallyExit(code) {
1331
- if (!processOk(this.#process)) {
1332
- return 0;
1333
- }
1334
- this.#process.exitCode = code || 0;
1335
- this.#emitter.emit("exit", this.#process.exitCode, null);
1336
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1337
- }
1338
- #processEmit(ev, ...args) {
1339
- const og = this.#originalProcessEmit;
1340
- if (ev === "exit" && processOk(this.#process)) {
1341
- if (typeof args[0] === "number") {
1342
- this.#process.exitCode = args[0];
1343
- }
1344
- const ret = og.call(this.#process, ev, ...args);
1345
- this.#emitter.emit("exit", this.#process.exitCode, null);
1346
- return ret;
1347
- } else {
1348
- return og.call(this.#process, ev, ...args);
1349
- }
1350
- }
1351
- };
1352
- var process2 = globalThis.process;
1353
- _a = signalExitWrap(processOk(process2) ? new SignalExit(process2) : new SignalExitFallback()), /**
1354
- * Called when the process is exiting, whether via signal, explicit
1355
- * exit, or running out of stuff to do.
1356
- *
1357
- * If the global process object is not suitable for instrumentation,
1358
- * then this will be a no-op.
1359
- *
1360
- * Returns a function that may be used to unload signal-exit.
1361
- */
1362
- exports.onExit = _a.onExit, /**
1363
- * Load the listeners. Likely you never need to call this, unless
1364
- * doing a rather deep integration with signal-exit functionality.
1365
- * Mostly exposed for the benefit of testing.
1366
- *
1367
- * @internal
1368
- */
1369
- exports.load = _a.load, /**
1370
- * Unload the listeners. Likely you never need to call this, unless
1371
- * doing a rather deep integration with signal-exit functionality.
1372
- * Mostly exposed for the benefit of testing.
1373
- *
1374
- * @internal
1375
- */
1376
- exports.unload = _a.unload;
1377
- }
1378
- });
1379
-
1380
- // ../node_modules/gauge/lib/spin.js
1381
- var require_spin = __commonJS({
1382
- "../node_modules/gauge/lib/spin.js"(exports, module) {
1383
- "use strict";
1384
- module.exports = /* @__PURE__ */ __name(function spin(spinstr, spun) {
1385
- return spinstr[spun % spinstr.length];
1386
- }, "spin");
1387
- }
1388
- });
1389
-
1390
- // ../node_modules/gauge/lib/progress-bar.js
1391
- var require_progress_bar = __commonJS({
1392
- "../node_modules/gauge/lib/progress-bar.js"(exports, module) {
1393
- "use strict";
1394
- var validate = require_aproba();
1395
- var renderTemplate = require_render_template();
1396
- var wideTruncate = require_wide_truncate();
1397
- var stringWidth2 = require_string_width();
1398
- module.exports = function(theme, width, completed) {
1399
- validate("ONN", [theme, width, completed]);
1400
- if (completed < 0) {
1401
- completed = 0;
1402
- }
1403
- if (completed > 1) {
1404
- completed = 1;
1405
- }
1406
- if (width <= 0) {
1407
- return "";
1408
- }
1409
- var sofar = Math.round(width * completed);
1410
- var rest = width - sofar;
1411
- var template = [
1412
- { type: "complete", value: repeat(theme.complete, sofar), length: sofar },
1413
- { type: "remaining", value: repeat(theme.remaining, rest), length: rest }
1414
- ];
1415
- return renderTemplate(width, template, theme);
1416
- };
1417
- function repeat(string, width) {
1418
- var result = "";
1419
- var n = width;
1420
- do {
1421
- if (n % 2) {
1422
- result += string;
1423
- }
1424
- n = Math.floor(n / 2);
1425
- string += string;
1426
- } while (n && stringWidth2(result) < width);
1427
- return wideTruncate(result, width);
1428
- }
1429
- __name(repeat, "repeat");
1430
- }
1431
- });
1432
-
1433
- // ../node_modules/gauge/lib/base-theme.js
1434
- var require_base_theme = __commonJS({
1435
- "../node_modules/gauge/lib/base-theme.js"(exports, module) {
1436
- "use strict";
1437
- var spin = require_spin();
1438
- var progressBar = require_progress_bar();
1439
- module.exports = {
1440
- activityIndicator: /* @__PURE__ */ __name(function(values, theme) {
1441
- if (values.spun == null) {
1442
- return;
1443
- }
1444
- return spin(theme, values.spun);
1445
- }, "activityIndicator"),
1446
- progressbar: /* @__PURE__ */ __name(function(values, theme, width) {
1447
- if (values.completed == null) {
1448
- return;
1449
- }
1450
- return progressBar(theme, width, values.completed);
1451
- }, "progressbar")
1452
- };
1453
- }
1454
- });
1455
-
1456
- // ../node_modules/gauge/lib/theme-set.js
1457
- var require_theme_set = __commonJS({
1458
- "../node_modules/gauge/lib/theme-set.js"(exports, module) {
1459
- "use strict";
1460
- module.exports = function() {
1461
- return ThemeSetProto.newThemeSet();
1462
- };
1463
- var ThemeSetProto = {};
1464
- ThemeSetProto.baseTheme = require_base_theme();
1465
- ThemeSetProto.newTheme = function(parent, theme) {
1466
- if (!theme) {
1467
- theme = parent;
1468
- parent = this.baseTheme;
1469
- }
1470
- return Object.assign({}, parent, theme);
1471
- };
1472
- ThemeSetProto.getThemeNames = function() {
1473
- return Object.keys(this.themes);
1474
- };
1475
- ThemeSetProto.addTheme = function(name, parent, theme) {
1476
- this.themes[name] = this.newTheme(parent, theme);
1477
- };
1478
- ThemeSetProto.addToAllThemes = function(theme) {
1479
- var themes = this.themes;
1480
- Object.keys(themes).forEach(function(name) {
1481
- Object.assign(themes[name], theme);
1482
- });
1483
- Object.assign(this.baseTheme, theme);
1484
- };
1485
- ThemeSetProto.getTheme = function(name) {
1486
- if (!this.themes[name]) {
1487
- throw this.newMissingThemeError(name);
1488
- }
1489
- return this.themes[name];
1490
- };
1491
- ThemeSetProto.setDefault = function(opts, name) {
1492
- if (name == null) {
1493
- name = opts;
1494
- opts = {};
1495
- }
1496
- var platform = opts.platform == null ? "fallback" : opts.platform;
1497
- var hasUnicode = !!opts.hasUnicode;
1498
- var hasColor = !!opts.hasColor;
1499
- if (!this.defaults[platform]) {
1500
- this.defaults[platform] = { true: {}, false: {} };
1501
- }
1502
- this.defaults[platform][hasUnicode][hasColor] = name;
1503
- };
1504
- ThemeSetProto.getDefault = function(opts) {
1505
- if (!opts) {
1506
- opts = {};
1507
- }
1508
- var platformName = opts.platform || process.platform;
1509
- var platform = this.defaults[platformName] || this.defaults.fallback;
1510
- var hasUnicode = !!opts.hasUnicode;
1511
- var hasColor = !!opts.hasColor;
1512
- if (!platform) {
1513
- throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor);
1514
- }
1515
- if (!platform[hasUnicode][hasColor]) {
1516
- if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) {
1517
- hasUnicode = false;
1518
- } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) {
1519
- hasColor = false;
1520
- } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) {
1521
- hasUnicode = false;
1522
- hasColor = false;
1523
- } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) {
1524
- hasUnicode = false;
1525
- } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) {
1526
- hasColor = false;
1527
- } else if (platform === this.defaults.fallback) {
1528
- throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor);
1529
- }
1530
- }
1531
- if (platform[hasUnicode][hasColor]) {
1532
- return this.getTheme(platform[hasUnicode][hasColor]);
1533
- } else {
1534
- return this.getDefault(Object.assign({}, opts, { platform: "fallback" }));
1535
- }
1536
- };
1537
- ThemeSetProto.newMissingThemeError = /* @__PURE__ */ __name(function newMissingThemeError(name) {
1538
- var err = new Error('Could not find a gauge theme named "' + name + '"');
1539
- Error.captureStackTrace.call(err, newMissingThemeError);
1540
- err.theme = name;
1541
- err.code = "EMISSINGTHEME";
1542
- return err;
1543
- }, "newMissingThemeError");
1544
- ThemeSetProto.newMissingDefaultThemeError = /* @__PURE__ */ __name(function newMissingDefaultThemeError(platformName, hasUnicode, hasColor) {
1545
- var err = new Error(
1546
- "Could not find a gauge theme for your platform/unicode/color use combo:\n platform = " + platformName + "\n hasUnicode = " + hasUnicode + "\n hasColor = " + hasColor
1547
- );
1548
- Error.captureStackTrace.call(err, newMissingDefaultThemeError);
1549
- err.platform = platformName;
1550
- err.hasUnicode = hasUnicode;
1551
- err.hasColor = hasColor;
1552
- err.code = "EMISSINGTHEME";
1553
- return err;
1554
- }, "newMissingDefaultThemeError");
1555
- ThemeSetProto.newThemeSet = function() {
1556
- var themeset = /* @__PURE__ */ __name(function(opts) {
1557
- return themeset.getDefault(opts);
1558
- }, "themeset");
1559
- return Object.assign(themeset, ThemeSetProto, {
1560
- themes: Object.assign({}, this.themes),
1561
- baseTheme: Object.assign({}, this.baseTheme),
1562
- defaults: JSON.parse(JSON.stringify(this.defaults || {}))
1563
- });
1564
- };
1565
- }
1566
- });
1567
-
1568
- // ../node_modules/gauge/lib/themes.js
1569
- var require_themes = __commonJS({
1570
- "../node_modules/gauge/lib/themes.js"(exports, module) {
1571
- "use strict";
1572
- var color = require_console_control_strings().color;
1573
- var ThemeSet = require_theme_set();
1574
- var themes = module.exports = new ThemeSet();
1575
- themes.addTheme("ASCII", {
1576
- preProgressbar: "[",
1577
- postProgressbar: "]",
1578
- progressbarTheme: {
1579
- complete: "#",
1580
- remaining: "."
1581
- },
1582
- activityIndicatorTheme: "-\\|/",
1583
- preSubsection: ">"
1584
- });
1585
- themes.addTheme("colorASCII", themes.getTheme("ASCII"), {
1586
- progressbarTheme: {
1587
- preComplete: color("bgBrightWhite", "brightWhite"),
1588
- complete: "#",
1589
- postComplete: color("reset"),
1590
- preRemaining: color("bgBrightBlack", "brightBlack"),
1591
- remaining: ".",
1592
- postRemaining: color("reset")
1593
- }
1594
- });
1595
- themes.addTheme("brailleSpinner", {
1596
- preProgressbar: "(",
1597
- postProgressbar: ")",
1598
- progressbarTheme: {
1599
- complete: "#",
1600
- remaining: "\u2802"
1601
- },
1602
- activityIndicatorTheme: "\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F",
1603
- preSubsection: ">"
1604
- });
1605
- themes.addTheme("colorBrailleSpinner", themes.getTheme("brailleSpinner"), {
1606
- progressbarTheme: {
1607
- preComplete: color("bgBrightWhite", "brightWhite"),
1608
- complete: "#",
1609
- postComplete: color("reset"),
1610
- preRemaining: color("bgBrightBlack", "brightBlack"),
1611
- remaining: "\u2802",
1612
- postRemaining: color("reset")
1613
- }
1614
- });
1615
- themes.setDefault({}, "ASCII");
1616
- themes.setDefault({ hasColor: true }, "colorASCII");
1617
- themes.setDefault({ platform: "darwin", hasUnicode: true }, "brailleSpinner");
1618
- themes.setDefault({ platform: "darwin", hasUnicode: true, hasColor: true }, "colorBrailleSpinner");
1619
- themes.setDefault({ platform: "linux", hasUnicode: true }, "brailleSpinner");
1620
- themes.setDefault({ platform: "linux", hasUnicode: true, hasColor: true }, "colorBrailleSpinner");
1621
- }
1622
- });
1623
-
1624
- // ../node_modules/gauge/lib/set-interval.js
1625
- var require_set_interval = __commonJS({
1626
- "../node_modules/gauge/lib/set-interval.js"(exports, module) {
1627
- "use strict";
1628
- module.exports = setInterval;
1629
- }
1630
- });
1631
-
1632
- // ../node_modules/gauge/lib/process.js
1633
- var require_process = __commonJS({
1634
- "../node_modules/gauge/lib/process.js"(exports, module) {
1635
- "use strict";
1636
- module.exports = process;
1637
- }
1638
- });
1639
-
1640
- // ../node_modules/gauge/lib/set-immediate.js
1641
- var require_set_immediate = __commonJS({
1642
- "../node_modules/gauge/lib/set-immediate.js"(exports, module) {
1643
- "use strict";
1644
- var process2 = require_process();
1645
- try {
1646
- module.exports = setImmediate;
1647
- } catch (ex) {
1648
- module.exports = process2.nextTick;
1649
- }
1650
- }
1651
- });
1652
-
1653
- // ../node_modules/gauge/lib/index.js
1654
- var require_lib2 = __commonJS({
1655
- "../node_modules/gauge/lib/index.js"(exports, module) {
1656
- "use strict";
1657
- var Plumbing = require_plumbing();
1658
- var hasUnicode = require_has_unicode();
1659
- var hasColor = require_has_color();
1660
- var onExit = require_cjs().onExit;
1661
- var defaultThemes = require_themes();
1662
- var setInterval2 = require_set_interval();
1663
- var process2 = require_process();
1664
- var setImmediate2 = require_set_immediate();
1665
- module.exports = Gauge;
1666
- function callWith(obj, method) {
1667
- return function() {
1668
- return method.call(obj);
1669
- };
1670
- }
1671
- __name(callWith, "callWith");
1672
- function Gauge(arg1, arg2) {
1673
- var options, writeTo;
1674
- if (arg1 && arg1.write) {
1675
- writeTo = arg1;
1676
- options = arg2 || {};
1677
- } else if (arg2 && arg2.write) {
1678
- writeTo = arg2;
1679
- options = arg1 || {};
1680
- } else {
1681
- writeTo = process2.stderr;
1682
- options = arg1 || arg2 || {};
1683
- }
1684
- this._status = {
1685
- spun: 0,
1686
- section: "",
1687
- subsection: ""
1688
- };
1689
- this._paused = false;
1690
- this._disabled = true;
1691
- this._showing = false;
1692
- this._onScreen = false;
1693
- this._needsRedraw = false;
1694
- this._hideCursor = options.hideCursor == null ? true : options.hideCursor;
1695
- this._fixedFramerate = options.fixedFramerate == null ? !/^v0\.8\./.test(process2.version) : options.fixedFramerate;
1696
- this._lastUpdateAt = null;
1697
- this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval;
1698
- this._themes = options.themes || defaultThemes;
1699
- this._theme = options.theme;
1700
- var theme = this._computeTheme(options.theme);
1701
- var template = options.template || [
1702
- { type: "progressbar", length: 20 },
1703
- { type: "activityIndicator", kerning: 1, length: 1 },
1704
- { type: "section", kerning: 1, default: "" },
1705
- { type: "subsection", kerning: 1, default: "" }
1706
- ];
1707
- this.setWriteTo(writeTo, options.tty);
1708
- var PlumbingClass = options.Plumbing || Plumbing;
1709
- this._gauge = new PlumbingClass(theme, template, this.getWidth());
1710
- this._$$doRedraw = callWith(this, this._doRedraw);
1711
- this._$$handleSizeChange = callWith(this, this._handleSizeChange);
1712
- this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit;
1713
- this._removeOnExit = null;
1714
- if (options.enabled || options.enabled == null && this._tty && this._tty.isTTY) {
1715
- this.enable();
1716
- } else {
1717
- this.disable();
1718
- }
1719
- }
1720
- __name(Gauge, "Gauge");
1721
- Gauge.prototype = {};
1722
- Gauge.prototype.isEnabled = function() {
1723
- return !this._disabled;
1724
- };
1725
- Gauge.prototype.setTemplate = function(template) {
1726
- this._gauge.setTemplate(template);
1727
- if (this._showing) {
1728
- this._requestRedraw();
1729
- }
1730
- };
1731
- Gauge.prototype._computeTheme = function(theme) {
1732
- if (!theme) {
1733
- theme = {};
1734
- }
1735
- if (typeof theme === "string") {
1736
- theme = this._themes.getTheme(theme);
1737
- } else if (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null) {
1738
- var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode;
1739
- var useColor = theme.hasColor == null ? hasColor : theme.hasColor;
1740
- theme = this._themes.getDefault({
1741
- hasUnicode: useUnicode,
1742
- hasColor: useColor,
1743
- platform: theme.platform
1744
- });
1745
- }
1746
- return theme;
1747
- };
1748
- Gauge.prototype.setThemeset = function(themes) {
1749
- this._themes = themes;
1750
- this.setTheme(this._theme);
1751
- };
1752
- Gauge.prototype.setTheme = function(theme) {
1753
- this._gauge.setTheme(this._computeTheme(theme));
1754
- if (this._showing) {
1755
- this._requestRedraw();
1756
- }
1757
- this._theme = theme;
1758
- };
1759
- Gauge.prototype._requestRedraw = function() {
1760
- this._needsRedraw = true;
1761
- if (!this._fixedFramerate) {
1762
- this._doRedraw();
1763
- }
1764
- };
1765
- Gauge.prototype.getWidth = function() {
1766
- return (this._tty && this._tty.columns || 80) - 1;
1767
- };
1768
- Gauge.prototype.setWriteTo = function(writeTo, tty) {
1769
- var enabled = !this._disabled;
1770
- if (enabled) {
1771
- this.disable();
1772
- }
1773
- this._writeTo = writeTo;
1774
- this._tty = tty || writeTo === process2.stderr && process2.stdout.isTTY && process2.stdout || writeTo.isTTY && writeTo || this._tty;
1775
- if (this._gauge) {
1776
- this._gauge.setWidth(this.getWidth());
1777
- }
1778
- if (enabled) {
1779
- this.enable();
1780
- }
1781
- };
1782
- Gauge.prototype.enable = function() {
1783
- if (!this._disabled) {
1784
- return;
1785
- }
1786
- this._disabled = false;
1787
- if (this._tty) {
1788
- this._enableEvents();
1789
- }
1790
- if (this._showing) {
1791
- this.show();
1792
- }
1793
- };
1794
- Gauge.prototype.disable = function() {
1795
- if (this._disabled) {
1796
- return;
1797
- }
1798
- if (this._showing) {
1799
- this._lastUpdateAt = null;
1800
- this._showing = false;
1801
- this._doRedraw();
1802
- this._showing = true;
1803
- }
1804
- this._disabled = true;
1805
- if (this._tty) {
1806
- this._disableEvents();
1807
- }
1808
- };
1809
- Gauge.prototype._enableEvents = function() {
1810
- if (this._cleanupOnExit) {
1811
- this._removeOnExit = onExit(callWith(this, this.disable));
1812
- }
1813
- this._tty.on("resize", this._$$handleSizeChange);
1814
- if (this._fixedFramerate) {
1815
- this.redrawTracker = setInterval2(this._$$doRedraw, this._updateInterval);
1816
- if (this.redrawTracker.unref) {
1817
- this.redrawTracker.unref();
1818
- }
1819
- }
1820
- };
1821
- Gauge.prototype._disableEvents = function() {
1822
- this._tty.removeListener("resize", this._$$handleSizeChange);
1823
- if (this._fixedFramerate) {
1824
- clearInterval(this.redrawTracker);
1825
- }
1826
- if (this._removeOnExit) {
1827
- this._removeOnExit();
1828
- }
1829
- };
1830
- Gauge.prototype.hide = function(cb) {
1831
- if (this._disabled) {
1832
- return cb && process2.nextTick(cb);
1833
- }
1834
- if (!this._showing) {
1835
- return cb && process2.nextTick(cb);
1836
- }
1837
- this._showing = false;
1838
- this._doRedraw();
1839
- cb && setImmediate2(cb);
1840
- };
1841
- Gauge.prototype.show = function(section, completed) {
1842
- this._showing = true;
1843
- if (typeof section === "string") {
1844
- this._status.section = section;
1845
- } else if (typeof section === "object") {
1846
- var sectionKeys = Object.keys(section);
1847
- for (var ii = 0; ii < sectionKeys.length; ++ii) {
1848
- var key = sectionKeys[ii];
1849
- this._status[key] = section[key];
1850
- }
1851
- }
1852
- if (completed != null) {
1853
- this._status.completed = completed;
1854
- }
1855
- if (this._disabled) {
1856
- return;
1857
- }
1858
- this._requestRedraw();
1859
- };
1860
- Gauge.prototype.pulse = function(subsection) {
1861
- this._status.subsection = subsection || "";
1862
- this._status.spun++;
1863
- if (this._disabled) {
1864
- return;
1865
- }
1866
- if (!this._showing) {
1867
- return;
1868
- }
1869
- this._requestRedraw();
1870
- };
1871
- Gauge.prototype._handleSizeChange = function() {
1872
- this._gauge.setWidth(this._tty.columns - 1);
1873
- this._requestRedraw();
1874
- };
1875
- Gauge.prototype._doRedraw = function() {
1876
- if (this._disabled || this._paused) {
1877
- return;
1878
- }
1879
- if (!this._fixedFramerate) {
1880
- var now = Date.now();
1881
- if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) {
1882
- return;
1883
- }
1884
- this._lastUpdateAt = now;
1885
- }
1886
- if (!this._showing && this._onScreen) {
1887
- this._onScreen = false;
1888
- var result = this._gauge.hide();
1889
- if (this._hideCursor) {
1890
- result += this._gauge.showCursor();
1891
- }
1892
- return this._writeTo.write(result);
1893
- }
1894
- if (!this._showing && !this._onScreen) {
1895
- return;
1896
- }
1897
- if (this._showing && !this._onScreen) {
1898
- this._onScreen = true;
1899
- this._needsRedraw = true;
1900
- if (this._hideCursor) {
1901
- this._writeTo.write(this._gauge.hideCursor());
1902
- }
1903
- }
1904
- if (!this._needsRedraw) {
1905
- return;
1906
- }
1907
- if (!this._writeTo.write(this._gauge.show(this._status))) {
1908
- this._paused = true;
1909
- this._writeTo.on("drain", callWith(this, function() {
1910
- this._paused = false;
1911
- this._doRedraw();
1912
- }));
1913
- }
1914
- };
1915
- }
1916
- });
1917
-
1918
- // ../node_modules/set-blocking/index.js
1919
- var require_set_blocking = __commonJS({
1920
- "../node_modules/set-blocking/index.js"(exports, module) {
1921
- module.exports = function(blocking) {
1922
- [process.stdout, process.stderr].forEach(function(stream) {
1923
- if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === "function") {
1924
- stream._handle.setBlocking(blocking);
1925
- }
1926
- });
1927
- };
1928
- }
1929
- });
1930
-
1931
- // ../node_modules/npmlog/lib/log.js
1932
- var require_log = __commonJS({
1933
- "../node_modules/npmlog/lib/log.js"(exports, module) {
1934
- "use strict";
1935
- var Progress = require_lib();
1936
- var Gauge = require_lib2();
1937
- var EE = __require("events").EventEmitter;
1938
- var log2 = exports = module.exports = new EE();
1939
- var util = __require("util");
1940
- var setBlocking = require_set_blocking();
1941
- var consoleControl = require_console_control_strings();
1942
- setBlocking(true);
1943
- var stream = process.stderr;
1944
- Object.defineProperty(log2, "stream", {
1945
- set: /* @__PURE__ */ __name(function(newStream) {
1946
- stream = newStream;
1947
- if (this.gauge) {
1948
- this.gauge.setWriteTo(stream, stream);
1949
- }
1950
- }, "set"),
1951
- get: /* @__PURE__ */ __name(function() {
1952
- return stream;
1953
- }, "get")
1954
- });
1955
- var colorEnabled;
1956
- log2.useColor = function() {
1957
- return colorEnabled != null ? colorEnabled : stream.isTTY;
1958
- };
1959
- log2.enableColor = function() {
1960
- colorEnabled = true;
1961
- this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled });
1962
- };
1963
- log2.disableColor = function() {
1964
- colorEnabled = false;
1965
- this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled });
1966
- };
1967
- log2.level = "info";
1968
- log2.gauge = new Gauge(stream, {
1969
- enabled: false,
1970
- // no progress bars unless asked
1971
- theme: { hasColor: log2.useColor() },
1972
- template: [
1973
- { type: "progressbar", length: 20 },
1974
- { type: "activityIndicator", kerning: 1, length: 1 },
1975
- { type: "section", default: "" },
1976
- ":",
1977
- { type: "logline", kerning: 1, default: "" }
1978
- ]
1979
- });
1980
- log2.tracker = new Progress.TrackerGroup();
1981
- log2.progressEnabled = log2.gauge.isEnabled();
1982
- var unicodeEnabled;
1983
- log2.enableUnicode = function() {
1984
- unicodeEnabled = true;
1985
- this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled });
1986
- };
1987
- log2.disableUnicode = function() {
1988
- unicodeEnabled = false;
1989
- this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled });
1990
- };
1991
- log2.setGaugeThemeset = function(themes) {
1992
- this.gauge.setThemeset(themes);
1993
- };
1994
- log2.setGaugeTemplate = function(template) {
1995
- this.gauge.setTemplate(template);
1996
- };
1997
- log2.enableProgress = function() {
1998
- if (this.progressEnabled || this._paused) {
1999
- return;
2000
- }
2001
- this.progressEnabled = true;
2002
- this.tracker.on("change", this.showProgress);
2003
- this.gauge.enable();
2004
- };
2005
- log2.disableProgress = function() {
2006
- if (!this.progressEnabled) {
2007
- return;
2008
- }
2009
- this.progressEnabled = false;
2010
- this.tracker.removeListener("change", this.showProgress);
2011
- this.gauge.disable();
2012
- };
2013
- var trackerConstructors = ["newGroup", "newItem", "newStream"];
2014
- var mixinLog = /* @__PURE__ */ __name(function(tracker) {
2015
- Object.keys(log2).forEach(function(P2) {
2016
- if (P2[0] === "_") {
2017
- return;
2018
- }
2019
- if (trackerConstructors.filter(function(C2) {
2020
- return C2 === P2;
2021
- }).length) {
2022
- return;
2023
- }
2024
- if (tracker[P2]) {
2025
- return;
2026
- }
2027
- if (typeof log2[P2] !== "function") {
2028
- return;
2029
- }
2030
- var func = log2[P2];
2031
- tracker[P2] = function() {
2032
- return func.apply(log2, arguments);
2033
- };
2034
- });
2035
- if (tracker instanceof Progress.TrackerGroup) {
2036
- trackerConstructors.forEach(function(C2) {
2037
- var func = tracker[C2];
2038
- tracker[C2] = function() {
2039
- return mixinLog(func.apply(tracker, arguments));
2040
- };
2041
- });
2042
- }
2043
- return tracker;
2044
- }, "mixinLog");
2045
- trackerConstructors.forEach(function(C2) {
2046
- log2[C2] = function() {
2047
- return mixinLog(this.tracker[C2].apply(this.tracker, arguments));
2048
- };
2049
- });
2050
- log2.clearProgress = function(cb) {
2051
- if (!this.progressEnabled) {
2052
- return cb && process.nextTick(cb);
2053
- }
2054
- this.gauge.hide(cb);
2055
- };
2056
- log2.showProgress = function(name, completed) {
2057
- if (!this.progressEnabled) {
2058
- return;
2059
- }
2060
- var values = {};
2061
- if (name) {
2062
- values.section = name;
2063
- }
2064
- var last = log2.record[log2.record.length - 1];
2065
- if (last) {
2066
- values.subsection = last.prefix;
2067
- var disp = log2.disp[last.level] || last.level;
2068
- var logline = this._format(disp, log2.style[last.level]);
2069
- if (last.prefix) {
2070
- logline += " " + this._format(last.prefix, this.prefixStyle);
2071
- }
2072
- logline += " " + last.message.split(/\r?\n/)[0];
2073
- values.logline = logline;
2074
- }
2075
- values.completed = completed || this.tracker.completed();
2076
- this.gauge.show(values);
2077
- }.bind(log2);
2078
- log2.pause = function() {
2079
- this._paused = true;
2080
- if (this.progressEnabled) {
2081
- this.gauge.disable();
2082
- }
2083
- };
2084
- log2.resume = function() {
2085
- if (!this._paused) {
2086
- return;
2087
- }
2088
- this._paused = false;
2089
- var b2 = this._buffer;
2090
- this._buffer = [];
2091
- b2.forEach(function(m) {
2092
- this.emitLog(m);
2093
- }, this);
2094
- if (this.progressEnabled) {
2095
- this.gauge.enable();
2096
- }
2097
- };
2098
- log2._buffer = [];
2099
- var id = 0;
2100
- log2.record = [];
2101
- log2.maxRecordSize = 1e4;
2102
- log2.log = function(lvl, prefix, message) {
2103
- var l = this.levels[lvl];
2104
- if (l === void 0) {
2105
- return this.emit("error", new Error(util.format(
2106
- "Undefined log level: %j",
2107
- lvl
2108
- )));
2109
- }
2110
- var a = new Array(arguments.length - 2);
2111
- var stack = null;
2112
- for (var i = 2; i < arguments.length; i++) {
2113
- var arg = a[i - 2] = arguments[i];
2114
- if (typeof arg === "object" && arg instanceof Error && arg.stack) {
2115
- Object.defineProperty(arg, "stack", {
2116
- value: stack = arg.stack + "",
2117
- enumerable: true,
2118
- writable: true
2119
- });
2120
- }
2121
- }
2122
- if (stack) {
2123
- a.unshift(stack + "\n");
2124
- }
2125
- message = util.format.apply(util, a);
2126
- var m = {
2127
- id: id++,
2128
- level: lvl,
2129
- prefix: String(prefix || ""),
2130
- message,
2131
- messageRaw: a
2132
- };
2133
- this.emit("log", m);
2134
- this.emit("log." + lvl, m);
2135
- if (m.prefix) {
2136
- this.emit(m.prefix, m);
2137
- }
2138
- this.record.push(m);
2139
- var mrs = this.maxRecordSize;
2140
- var n = this.record.length - mrs;
2141
- if (n > mrs / 10) {
2142
- var newSize = Math.floor(mrs * 0.9);
2143
- this.record = this.record.slice(-1 * newSize);
2144
- }
2145
- this.emitLog(m);
2146
- }.bind(log2);
2147
- log2.emitLog = function(m) {
2148
- if (this._paused) {
2149
- this._buffer.push(m);
2150
- return;
2151
- }
2152
- if (this.progressEnabled) {
2153
- this.gauge.pulse(m.prefix);
2154
- }
2155
- var l = this.levels[m.level];
2156
- if (l === void 0) {
2157
- return;
2158
- }
2159
- if (l < this.levels[this.level]) {
2160
- return;
2161
- }
2162
- if (l > 0 && !isFinite(l)) {
2163
- return;
2164
- }
2165
- var disp = log2.disp[m.level] != null ? log2.disp[m.level] : m.level;
2166
- this.clearProgress();
2167
- m.message.split(/\r?\n/).forEach(function(line) {
2168
- var heading = this.heading;
2169
- if (heading) {
2170
- this.write(heading, this.headingStyle);
2171
- this.write(" ");
2172
- }
2173
- this.write(disp, log2.style[m.level]);
2174
- var p = m.prefix || "";
2175
- if (p) {
2176
- this.write(" ");
2177
- }
2178
- this.write(p, this.prefixStyle);
2179
- this.write(" " + line + "\n");
2180
- }, this);
2181
- this.showProgress();
2182
- };
2183
- log2._format = function(msg, style) {
2184
- if (!stream) {
2185
- return;
2186
- }
2187
- var output = "";
2188
- if (this.useColor()) {
2189
- style = style || {};
2190
- var settings = [];
2191
- if (style.fg) {
2192
- settings.push(style.fg);
2193
- }
2194
- if (style.bg) {
2195
- settings.push("bg" + style.bg[0].toUpperCase() + style.bg.slice(1));
2196
- }
2197
- if (style.bold) {
2198
- settings.push("bold");
2199
- }
2200
- if (style.underline) {
2201
- settings.push("underline");
2202
- }
2203
- if (style.inverse) {
2204
- settings.push("inverse");
2205
- }
2206
- if (settings.length) {
2207
- output += consoleControl.color(settings);
2208
- }
2209
- if (style.beep) {
2210
- output += consoleControl.beep();
2211
- }
2212
- }
2213
- output += msg;
2214
- if (this.useColor()) {
2215
- output += consoleControl.color("reset");
2216
- }
2217
- return output;
2218
- };
2219
- log2.write = function(msg, style) {
2220
- if (!stream) {
2221
- return;
2222
- }
2223
- stream.write(this._format(msg, style));
2224
- };
2225
- log2.addLevel = function(lvl, n, style, disp) {
2226
- if (disp == null) {
2227
- disp = lvl;
2228
- }
2229
- this.levels[lvl] = n;
2230
- this.style[lvl] = style;
2231
- if (!this[lvl]) {
2232
- this[lvl] = function() {
2233
- var a = new Array(arguments.length + 1);
2234
- a[0] = lvl;
2235
- for (var i = 0; i < arguments.length; i++) {
2236
- a[i + 1] = arguments[i];
2237
- }
2238
- return this.log.apply(this, a);
2239
- }.bind(this);
2240
- }
2241
- this.disp[lvl] = disp;
2242
- };
2243
- log2.prefixStyle = { fg: "magenta" };
2244
- log2.headingStyle = { fg: "white", bg: "black" };
2245
- log2.style = {};
2246
- log2.levels = {};
2247
- log2.disp = {};
2248
- log2.addLevel("silly", -Infinity, { inverse: true }, "sill");
2249
- log2.addLevel("verbose", 1e3, { fg: "cyan", bg: "black" }, "verb");
2250
- log2.addLevel("info", 2e3, { fg: "green" });
2251
- log2.addLevel("timing", 2500, { fg: "green", bg: "black" });
2252
- log2.addLevel("http", 3e3, { fg: "green", bg: "black" });
2253
- log2.addLevel("notice", 3500, { fg: "cyan", bg: "black" });
2254
- log2.addLevel("warn", 4e3, { fg: "black", bg: "yellow" }, "WARN");
2255
- log2.addLevel("error", 5e3, { fg: "red", bg: "black" }, "ERR!");
2256
- log2.addLevel("silent", Infinity);
2257
- log2.on("error", function() {
2258
- });
2259
- }
2260
- });
2261
-
2262
- // ../node_modules/eastasianwidth/eastasianwidth.js
2263
- var require_eastasianwidth = __commonJS({
2264
- "../node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
2265
- var eaw = {};
2266
- if ("undefined" == typeof module) {
2267
- window.eastasianwidth = eaw;
2268
- } else {
2269
- module.exports = eaw;
2270
- }
2271
- eaw.eastAsianWidth = function(character) {
2272
- var x = character.charCodeAt(0);
2273
- var y2 = character.length == 2 ? character.charCodeAt(1) : 0;
2274
- var codePoint = x;
2275
- if (55296 <= x && x <= 56319 && (56320 <= y2 && y2 <= 57343)) {
2276
- x &= 1023;
2277
- y2 &= 1023;
2278
- codePoint = x << 10 | y2;
2279
- codePoint += 65536;
2280
- }
2281
- if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
2282
- return "F";
2283
- }
2284
- if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
2285
- return "H";
2286
- }
2287
- if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
2288
- return "W";
2289
- }
2290
- if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
2291
- return "Na";
2292
- }
2293
- if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
2294
- return "A";
2295
- }
2296
- return "N";
2297
- };
2298
- eaw.characterLength = function(character) {
2299
- var code = this.eastAsianWidth(character);
2300
- if (code == "F" || code == "W" || code == "A") {
2301
- return 2;
2302
- } else {
2303
- return 1;
2304
- }
2305
- };
2306
- function stringToArray(string) {
2307
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
2308
- }
2309
- __name(stringToArray, "stringToArray");
2310
- eaw.length = function(string) {
2311
- var characters = stringToArray(string);
2312
- var len = 0;
2313
- for (var i = 0; i < characters.length; i++) {
2314
- len = len + this.characterLength(characters[i]);
2315
- }
2316
- return len;
2317
- };
2318
- eaw.slice = function(text2, start, end) {
2319
- textLen = eaw.length(text2);
2320
- start = start ? start : 0;
2321
- end = end ? end : 1;
2322
- if (start < 0) {
2323
- start = textLen + start;
2324
- }
2325
- if (end < 0) {
2326
- end = textLen + end;
2327
- }
2328
- var result = "";
2329
- var eawLen = 0;
2330
- var chars = stringToArray(text2);
2331
- for (var i = 0; i < chars.length; i++) {
2332
- var char = chars[i];
2333
- var charLen = eaw.length(char);
2334
- if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
2335
- if (eawLen + charLen <= end) {
2336
- result += char;
2337
- } else {
2338
- break;
2339
- }
2340
- }
2341
- eawLen += charLen;
2342
- }
2343
- return result;
2344
- };
2345
- }
2346
- });
2347
-
2348
- // ../node_modules/emoji-regex/index.js
2349
- var require_emoji_regex = __commonJS({
2350
- "../node_modules/emoji-regex/index.js"(exports, module) {
2351
- "use strict";
2352
- module.exports = function() {
2353
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
2354
- };
2355
- }
2356
- });
2357
-
2358
- // src/node-logger/index.ts
2359
- var import_npmlog = __toESM(require_log(), 1);
2360
- var import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
2361
-
2362
- // src/node-logger/logger/logger.ts
2363
- var logger_exports = {};
2364
- __export(logger_exports, {
2365
- SYMBOLS: () => SYMBOLS,
2366
- debug: () => debug,
2367
- error: () => error,
2368
- getLogLevel: () => getLogLevel,
2369
- info: () => info,
2370
- intro: () => intro,
2371
- log: () => log,
2372
- logBox: () => logBox,
2373
- outro: () => outro,
2374
- setLogLevel: () => setLogLevel,
2375
- shouldLog: () => shouldLog,
2376
- step: () => step,
2377
- warn: () => warn,
2378
- wrapTextForClack: () => wrapTextForClack
2379
- });
2380
-
2381
- // ../node_modules/@clack/core/dist/index.mjs
2382
- var import_picocolors = __toESM(require_picocolors(), 1);
2383
- var import_sisteransi = __toESM(require_src(), 1);
2384
- import { stdout as H, stdin as z } from "node:process";
2385
- import * as V from "node:readline";
2386
- import rt from "node:readline";
2387
- import { ReadStream as Y, WriteStream as nt } from "node:tty";
2388
- var ut = /* @__PURE__ */ __name((t2) => t2 === 161 || t2 === 164 || t2 === 167 || t2 === 168 || t2 === 170 || t2 === 173 || t2 === 174 || t2 >= 176 && t2 <= 180 || t2 >= 182 && t2 <= 186 || t2 >= 188 && t2 <= 191 || t2 === 198 || t2 === 208 || t2 === 215 || t2 === 216 || t2 >= 222 && t2 <= 225 || t2 === 230 || t2 >= 232 && t2 <= 234 || t2 === 236 || t2 === 237 || t2 === 240 || t2 === 242 || t2 === 243 || t2 >= 247 && t2 <= 250 || t2 === 252 || t2 === 254 || t2 === 257 || t2 === 273 || t2 === 275 || t2 === 283 || t2 === 294 || t2 === 295 || t2 === 299 || t2 >= 305 && t2 <= 307 || t2 === 312 || t2 >= 319 && t2 <= 322 || t2 === 324 || t2 >= 328 && t2 <= 331 || t2 === 333 || t2 === 338 || t2 === 339 || t2 === 358 || t2 === 359 || t2 === 363 || t2 === 462 || t2 === 464 || t2 === 466 || t2 === 468 || t2 === 470 || t2 === 472 || t2 === 474 || t2 === 476 || t2 === 593 || t2 === 609 || t2 === 708 || t2 === 711 || t2 >= 713 && t2 <= 715 || t2 === 717 || t2 === 720 || t2 >= 728 && t2 <= 731 || t2 === 733 || t2 === 735 || t2 >= 768 && t2 <= 879 || t2 >= 913 && t2 <= 929 || t2 >= 931 && t2 <= 937 || t2 >= 945 && t2 <= 961 || t2 >= 963 && t2 <= 969 || t2 === 1025 || t2 >= 1040 && t2 <= 1103 || t2 === 1105 || t2 === 8208 || t2 >= 8211 && t2 <= 8214 || t2 === 8216 || t2 === 8217 || t2 === 8220 || t2 === 8221 || t2 >= 8224 && t2 <= 8226 || t2 >= 8228 && t2 <= 8231 || t2 === 8240 || t2 === 8242 || t2 === 8243 || t2 === 8245 || t2 === 8251 || t2 === 8254 || t2 === 8308 || t2 === 8319 || t2 >= 8321 && t2 <= 8324 || t2 === 8364 || t2 === 8451 || t2 === 8453 || t2 === 8457 || t2 === 8467 || t2 === 8470 || t2 === 8481 || t2 === 8482 || t2 === 8486 || t2 === 8491 || t2 === 8531 || t2 === 8532 || t2 >= 8539 && t2 <= 8542 || t2 >= 8544 && t2 <= 8555 || t2 >= 8560 && t2 <= 8569 || t2 === 8585 || t2 >= 8592 && t2 <= 8601 || t2 === 8632 || t2 === 8633 || t2 === 8658 || t2 === 8660 || t2 === 8679 || t2 === 8704 || t2 === 8706 || t2 === 8707 || t2 === 8711 || t2 === 8712 || t2 === 8715 || t2 === 8719 || t2 === 8721 || t2 === 8725 || t2 === 8730 || t2 >= 8733 && t2 <= 8736 || t2 === 8739 || t2 === 8741 || t2 >= 8743 && t2 <= 8748 || t2 === 8750 || t2 >= 8756 && t2 <= 8759 || t2 === 8764 || t2 === 8765 || t2 === 8776 || t2 === 8780 || t2 === 8786 || t2 === 8800 || t2 === 8801 || t2 >= 8804 && t2 <= 8807 || t2 === 8810 || t2 === 8811 || t2 === 8814 || t2 === 8815 || t2 === 8834 || t2 === 8835 || t2 === 8838 || t2 === 8839 || t2 === 8853 || t2 === 8857 || t2 === 8869 || t2 === 8895 || t2 === 8978 || t2 >= 9312 && t2 <= 9449 || t2 >= 9451 && t2 <= 9547 || t2 >= 9552 && t2 <= 9587 || t2 >= 9600 && t2 <= 9615 || t2 >= 9618 && t2 <= 9621 || t2 === 9632 || t2 === 9633 || t2 >= 9635 && t2 <= 9641 || t2 === 9650 || t2 === 9651 || t2 === 9654 || t2 === 9655 || t2 === 9660 || t2 === 9661 || t2 === 9664 || t2 === 9665 || t2 >= 9670 && t2 <= 9672 || t2 === 9675 || t2 >= 9678 && t2 <= 9681 || t2 >= 9698 && t2 <= 9701 || t2 === 9711 || t2 === 9733 || t2 === 9734 || t2 === 9737 || t2 === 9742 || t2 === 9743 || t2 === 9756 || t2 === 9758 || t2 === 9792 || t2 === 9794 || t2 === 9824 || t2 === 9825 || t2 >= 9827 && t2 <= 9829 || t2 >= 9831 && t2 <= 9834 || t2 === 9836 || t2 === 9837 || t2 === 9839 || t2 === 9886 || t2 === 9887 || t2 === 9919 || t2 >= 9926 && t2 <= 9933 || t2 >= 9935 && t2 <= 9939 || t2 >= 9941 && t2 <= 9953 || t2 === 9955 || t2 === 9960 || t2 === 9961 || t2 >= 9963 && t2 <= 9969 || t2 === 9972 || t2 >= 9974 && t2 <= 9977 || t2 === 9979 || t2 === 9980 || t2 === 9982 || t2 === 9983 || t2 === 10045 || t2 >= 10102 && t2 <= 10111 || t2 >= 11094 && t2 <= 11097 || t2 >= 12872 && t2 <= 12879 || t2 >= 57344 && t2 <= 63743 || t2 >= 65024 && t2 <= 65039 || t2 === 65533 || t2 >= 127232 && t2 <= 127242 || t2 >= 127248 && t2 <= 127277 || t2 >= 127280 && t2 <= 127337 || t2 >= 127344 && t2 <= 127373 || t2 === 127375 || t2 === 127376 || t2 >= 127387 && t2 <= 127404 || t2 >= 917760 && t2 <= 917999 || t2 >= 983040 && t2 <= 1048573 || t2 >= 1048576 && t2 <= 1114109, "ut");
2389
- var ot = /* @__PURE__ */ __name((t2) => t2 === 12288 || t2 >= 65281 && t2 <= 65376 || t2 >= 65504 && t2 <= 65510, "ot");
2390
- var at = /* @__PURE__ */ __name((t2) => t2 >= 4352 && t2 <= 4447 || t2 === 8986 || t2 === 8987 || t2 === 9001 || t2 === 9002 || t2 >= 9193 && t2 <= 9196 || t2 === 9200 || t2 === 9203 || t2 === 9725 || t2 === 9726 || t2 === 9748 || t2 === 9749 || t2 >= 9800 && t2 <= 9811 || t2 === 9855 || t2 === 9875 || t2 === 9889 || t2 === 9898 || t2 === 9899 || t2 === 9917 || t2 === 9918 || t2 === 9924 || t2 === 9925 || t2 === 9934 || t2 === 9940 || t2 === 9962 || t2 === 9970 || t2 === 9971 || t2 === 9973 || t2 === 9978 || t2 === 9981 || t2 === 9989 || t2 === 9994 || t2 === 9995 || t2 === 10024 || t2 === 10060 || t2 === 10062 || t2 >= 10067 && t2 <= 10069 || t2 === 10071 || t2 >= 10133 && t2 <= 10135 || t2 === 10160 || t2 === 10175 || t2 === 11035 || t2 === 11036 || t2 === 11088 || t2 === 11093 || t2 >= 11904 && t2 <= 11929 || t2 >= 11931 && t2 <= 12019 || t2 >= 12032 && t2 <= 12245 || t2 >= 12272 && t2 <= 12287 || t2 >= 12289 && t2 <= 12350 || t2 >= 12353 && t2 <= 12438 || t2 >= 12441 && t2 <= 12543 || t2 >= 12549 && t2 <= 12591 || t2 >= 12593 && t2 <= 12686 || t2 >= 12688 && t2 <= 12771 || t2 >= 12783 && t2 <= 12830 || t2 >= 12832 && t2 <= 12871 || t2 >= 12880 && t2 <= 19903 || t2 >= 19968 && t2 <= 42124 || t2 >= 42128 && t2 <= 42182 || t2 >= 43360 && t2 <= 43388 || t2 >= 44032 && t2 <= 55203 || t2 >= 63744 && t2 <= 64255 || t2 >= 65040 && t2 <= 65049 || t2 >= 65072 && t2 <= 65106 || t2 >= 65108 && t2 <= 65126 || t2 >= 65128 && t2 <= 65131 || t2 >= 94176 && t2 <= 94180 || t2 === 94192 || t2 === 94193 || t2 >= 94208 && t2 <= 100343 || t2 >= 100352 && t2 <= 101589 || t2 >= 101632 && t2 <= 101640 || t2 >= 110576 && t2 <= 110579 || t2 >= 110581 && t2 <= 110587 || t2 === 110589 || t2 === 110590 || t2 >= 110592 && t2 <= 110882 || t2 === 110898 || t2 >= 110928 && t2 <= 110930 || t2 === 110933 || t2 >= 110948 && t2 <= 110951 || t2 >= 110960 && t2 <= 111355 || t2 === 126980 || t2 === 127183 || t2 === 127374 || t2 >= 127377 && t2 <= 127386 || t2 >= 127488 && t2 <= 127490 || t2 >= 127504 && t2 <= 127547 || t2 >= 127552 && t2 <= 127560 || t2 === 127568 || t2 === 127569 || t2 >= 127584 && t2 <= 127589 || t2 >= 127744 && t2 <= 127776 || t2 >= 127789 && t2 <= 127797 || t2 >= 127799 && t2 <= 127868 || t2 >= 127870 && t2 <= 127891 || t2 >= 127904 && t2 <= 127946 || t2 >= 127951 && t2 <= 127955 || t2 >= 127968 && t2 <= 127984 || t2 === 127988 || t2 >= 127992 && t2 <= 128062 || t2 === 128064 || t2 >= 128066 && t2 <= 128252 || t2 >= 128255 && t2 <= 128317 || t2 >= 128331 && t2 <= 128334 || t2 >= 128336 && t2 <= 128359 || t2 === 128378 || t2 === 128405 || t2 === 128406 || t2 === 128420 || t2 >= 128507 && t2 <= 128591 || t2 >= 128640 && t2 <= 128709 || t2 === 128716 || t2 >= 128720 && t2 <= 128722 || t2 >= 128725 && t2 <= 128727 || t2 >= 128732 && t2 <= 128735 || t2 === 128747 || t2 === 128748 || t2 >= 128756 && t2 <= 128764 || t2 >= 128992 && t2 <= 129003 || t2 === 129008 || t2 >= 129292 && t2 <= 129338 || t2 >= 129340 && t2 <= 129349 || t2 >= 129351 && t2 <= 129535 || t2 >= 129648 && t2 <= 129660 || t2 >= 129664 && t2 <= 129672 || t2 >= 129680 && t2 <= 129725 || t2 >= 129727 && t2 <= 129733 || t2 >= 129742 && t2 <= 129755 || t2 >= 129760 && t2 <= 129768 || t2 >= 129776 && t2 <= 129784 || t2 >= 131072 && t2 <= 196605 || t2 >= 196608 && t2 <= 262141, "at");
2391
- var R = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
2392
- var k = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
2393
- var y = /\t{1,1000}/y;
2394
- var N = /[\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;
2395
- var M = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
2396
- var lt = /\p{M}+/gu;
2397
- var ht = { limit: 1 / 0, ellipsis: "" };
2398
- var q = /* @__PURE__ */ __name((t2, s = {}, e = {}) => {
2399
- const i = s.limit ?? 1 / 0, r = s.ellipsis ?? "", n = s?.ellipsisWidth ?? (r ? q(r, ht, e).width : 0), F = e.ansiWidth ?? 0, l = e.controlWidth ?? 0, a = e.tabWidth ?? 8, v = e.ambiguousWidth ?? 1, g = e.emojiWidth ?? 2, m = e.fullWidthWidth ?? 2, A = e.regularWidth ?? 1, S = e.wideWidth ?? 2;
2400
- let o = 0, u2 = 0, p = t2.length, E = 0, f = false, d = p, _2 = Math.max(0, i - n), b2 = 0, x = 0, h = 0, c = 0;
2401
- t: for (; ; ) {
2402
- if (x > b2 || u2 >= p && u2 > o) {
2403
- const it = t2.slice(b2, x) || t2.slice(o, u2);
2404
- E = 0;
2405
- for (const K of it.replaceAll(lt, "")) {
2406
- const T2 = K.codePointAt(0) || 0;
2407
- if (ot(T2) ? c = m : at(T2) ? c = S : v !== A && ut(T2) ? c = v : c = A, h + c > _2 && (d = Math.min(d, Math.max(b2, o) + E)), h + c > i) {
2408
- f = true;
2409
- break t;
2410
- }
2411
- E += K.length, h += c;
2412
- }
2413
- b2 = x = 0;
2414
- }
2415
- if (u2 >= p) break;
2416
- if (M.lastIndex = u2, M.test(t2)) {
2417
- if (E = M.lastIndex - u2, c = E * A, h + c > _2 && (d = Math.min(d, u2 + Math.floor((_2 - h) / A))), h + c > i) {
2418
- f = true;
2419
- break;
2420
- }
2421
- h += c, b2 = o, x = u2, u2 = o = M.lastIndex;
2422
- continue;
2423
- }
2424
- if (R.lastIndex = u2, R.test(t2)) {
2425
- if (h + F > _2 && (d = Math.min(d, u2)), h + F > i) {
2426
- f = true;
2427
- break;
2428
- }
2429
- h += F, b2 = o, x = u2, u2 = o = R.lastIndex;
2430
- continue;
2431
- }
2432
- if (k.lastIndex = u2, k.test(t2)) {
2433
- if (E = k.lastIndex - u2, c = E * l, h + c > _2 && (d = Math.min(d, u2 + Math.floor((_2 - h) / l))), h + c > i) {
2434
- f = true;
2435
- break;
2436
- }
2437
- h += c, b2 = o, x = u2, u2 = o = k.lastIndex;
2438
- continue;
2439
- }
2440
- if (y.lastIndex = u2, y.test(t2)) {
2441
- if (E = y.lastIndex - u2, c = E * a, h + c > _2 && (d = Math.min(d, u2 + Math.floor((_2 - h) / a))), h + c > i) {
2442
- f = true;
2443
- break;
2444
- }
2445
- h += c, b2 = o, x = u2, u2 = o = y.lastIndex;
2446
- continue;
2447
- }
2448
- if (N.lastIndex = u2, N.test(t2)) {
2449
- if (h + g > _2 && (d = Math.min(d, u2)), h + g > i) {
2450
- f = true;
2451
- break;
2452
- }
2453
- h += g, b2 = o, x = u2, u2 = o = N.lastIndex;
2454
- continue;
2455
- }
2456
- u2 += 1;
2457
- }
2458
- return { width: f ? _2 : h, index: f ? d : p, truncated: f, ellipsed: f && i >= n };
2459
- }, "q");
2460
- var ct = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
2461
- var w = /* @__PURE__ */ __name((t2, s = {}) => q(t2, ct, s).width, "w");
2462
- var L = "\x1B";
2463
- var J = "\x9B";
2464
- var Ft = 39;
2465
- var P = "\x07";
2466
- var X = "[";
2467
- var pt = "]";
2468
- var Z = "m";
2469
- var O = `${pt}8;;`;
2470
- var Q = new RegExp(`(?:\\${X}(?<code>\\d+)m|\\${O}(?<uri>.*)${P})`, "y");
2471
- var ft = /* @__PURE__ */ __name((t2) => {
2472
- if (t2 >= 30 && t2 <= 37 || t2 >= 90 && t2 <= 97) return 39;
2473
- if (t2 >= 40 && t2 <= 47 || t2 >= 100 && t2 <= 107) return 49;
2474
- if (t2 === 1 || t2 === 2) return 22;
2475
- if (t2 === 3) return 23;
2476
- if (t2 === 4) return 24;
2477
- if (t2 === 7) return 27;
2478
- if (t2 === 8) return 28;
2479
- if (t2 === 9) return 29;
2480
- if (t2 === 0) return 0;
2481
- }, "ft");
2482
- var tt = /* @__PURE__ */ __name((t2) => `${L}${X}${t2}${Z}`, "tt");
2483
- var st = /* @__PURE__ */ __name((t2) => `${L}${O}${t2}${P}`, "st");
2484
- var dt = /* @__PURE__ */ __name((t2) => t2.map((s) => w(s)), "dt");
2485
- var j = /* @__PURE__ */ __name((t2, s, e) => {
2486
- const i = s[Symbol.iterator]();
2487
- let r = false, n = false, F = t2.at(-1), l = F === void 0 ? 0 : w(F), a = i.next(), v = i.next(), g = 0;
2488
- for (; !a.done; ) {
2489
- const m = a.value, A = w(m);
2490
- l + A <= e ? t2[t2.length - 1] += m : (t2.push(m), l = 0), (m === L || m === J) && (r = true, n = s.startsWith(O, g + 1)), r ? n ? m === P && (r = false, n = false) : m === Z && (r = false) : (l += A, l === e && !v.done && (t2.push(""), l = 0)), a = v, v = i.next(), g += m.length;
2491
- }
2492
- F = t2.at(-1), !l && F !== void 0 && F.length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
2493
- }, "j");
2494
- var mt = /* @__PURE__ */ __name((t2) => {
2495
- const s = t2.split(" ");
2496
- let e = s.length;
2497
- for (; e > 0 && !(w(s[e - 1]) > 0); ) e--;
2498
- return e === s.length ? t2 : s.slice(0, e).join(" ") + s.slice(e).join("");
2499
- }, "mt");
2500
- var gt = /* @__PURE__ */ __name((t2, s, e = {}) => {
2501
- if (e.trim !== false && t2.trim() === "") return "";
2502
- let i = "", r, n;
2503
- const F = t2.split(" "), l = dt(F);
2504
- let a = [""];
2505
- for (const [o, u2] of F.entries()) {
2506
- e.trim !== false && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
2507
- let p = w(a.at(-1) ?? "");
2508
- if (o !== 0 && (p >= s && (e.wordWrap === false || e.trim === false) && (a.push(""), p = 0), (p > 0 || e.trim === false) && (a[a.length - 1] += " ", p++)), e.hard && l[o] > s) {
2509
- const E = s - p, f = 1 + Math.floor((l[o] - E - 1) / s);
2510
- Math.floor((l[o] - 1) / s) < f && a.push(""), j(a, u2, s);
2511
- continue;
2512
- }
2513
- if (p + l[o] > s && p > 0 && l[o] > 0) {
2514
- if (e.wordWrap === false && p < s) {
2515
- j(a, u2, s);
2516
- continue;
2517
- }
2518
- a.push("");
2519
- }
2520
- if (p + l[o] > s && e.wordWrap === false) {
2521
- j(a, u2, s);
2522
- continue;
2523
- }
2524
- a[a.length - 1] += u2;
2525
- }
2526
- e.trim !== false && (a = a.map((o) => mt(o)));
2527
- const v = a.join(`
2528
- `), g = v[Symbol.iterator]();
2529
- let m = g.next(), A = g.next(), S = 0;
2530
- for (; !m.done; ) {
2531
- const o = m.value, u2 = A.value;
2532
- if (i += o, o === L || o === J) {
2533
- Q.lastIndex = S + 1;
2534
- const f = Q.exec(v)?.groups;
2535
- if (f?.code !== void 0) {
2536
- const d = Number.parseFloat(f.code);
2537
- r = d === Ft ? void 0 : d;
2538
- } else f?.uri !== void 0 && (n = f.uri.length === 0 ? void 0 : f.uri);
2539
- }
2540
- const p = r ? ft(r) : void 0;
2541
- u2 === `
2542
- ` ? (n && (i += st("")), r && p && (i += tt(p))) : o === `
2543
- ` && (r && p && (i += tt(r)), n && (i += st(n))), S += o.length, m = A, A = g.next();
2544
- }
2545
- return i;
2546
- }, "gt");
2547
- function et(t2, s, e) {
2548
- return String(t2).normalize().replaceAll(`\r
2549
- `, `
2550
- `).split(`
2551
- `).map((i) => gt(i, s, e)).join(`
2552
- `);
2553
- }
2554
- __name(et, "et");
2555
- var Et = ["up", "down", "left", "right", "space", "enter", "cancel"];
2556
- var C = { actions: new Set(Et), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" } };
2557
- function U(t2, s) {
2558
- if (typeof t2 == "string") return C.aliases.get(t2) === s;
2559
- for (const e of t2) if (e !== void 0 && U(e, s)) return true;
2560
- return false;
2561
- }
2562
- __name(U, "U");
2563
- function At(t2, s) {
2564
- if (t2 === s) return;
2565
- const e = t2.split(`
2566
- `), i = s.split(`
2567
- `), r = [];
2568
- for (let n = 0; n < Math.max(e.length, i.length); n++) e[n] !== i[n] && r.push(n);
2569
- return r;
2570
- }
2571
- __name(At, "At");
2572
- var It = globalThis.process.platform.startsWith("win");
2573
- var G = Symbol("clack:cancel");
2574
- function _t(t2) {
2575
- return t2 === G;
2576
- }
2577
- __name(_t, "_t");
2578
- function W(t2, s) {
2579
- const e = t2;
2580
- e.isTTY && e.setRawMode(s);
2581
- }
2582
- __name(W, "W");
2583
- function Ct({ input: t2 = z, output: s = H, overwrite: e = true, hideCursor: i = true } = {}) {
2584
- const r = V.createInterface({ input: t2, output: s, prompt: "", tabSize: 1 });
2585
- V.emitKeypressEvents(t2, r), t2 instanceof Y && t2.isTTY && t2.setRawMode(true);
2586
- const n = /* @__PURE__ */ __name((F, { name: l, sequence: a }) => {
2587
- const v = String(F);
2588
- if (U([v, l, a], "cancel")) {
2589
- i && s.write(import_sisteransi.cursor.show), process.exit(0);
2590
- return;
2591
- }
2592
- if (!e) return;
2593
- const g = l === "return" ? 0 : -1, m = l === "return" ? -1 : 0;
2594
- V.moveCursor(s, g, m, () => {
2595
- V.clearLine(s, 1, () => {
2596
- t2.once("keypress", n);
2597
- });
2598
- });
2599
- }, "n");
2600
- return i && s.write(import_sisteransi.cursor.hide), t2.once("keypress", n), () => {
2601
- t2.off("keypress", n), i && s.write(import_sisteransi.cursor.show), t2 instanceof Y && t2.isTTY && !It && t2.setRawMode(false), r.terminal = false, r.close();
2602
- };
2603
- }
2604
- __name(Ct, "Ct");
2605
- var bt = /* @__PURE__ */ __name((t2) => t2 instanceof nt && t2.columns ? t2.columns : 80, "bt");
2606
- var B = class {
2607
- static {
2608
- __name(this, "B");
2609
- }
2610
- input;
2611
- output;
2612
- _abortSignal;
2613
- rl;
2614
- opts;
2615
- _render;
2616
- _track = false;
2617
- _prevFrame = "";
2618
- _subscribers = /* @__PURE__ */ new Map();
2619
- _cursor = 0;
2620
- state = "initial";
2621
- error = "";
2622
- value;
2623
- userInput = "";
2624
- constructor(s, e = true) {
2625
- const { input: i = z, output: r = H, render: n, signal: F, ...l } = s;
2626
- this.opts = l, 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 = F, this.input = i, this.output = r;
2627
- }
2628
- unsubscribe() {
2629
- this._subscribers.clear();
2630
- }
2631
- setSubscriber(s, e) {
2632
- const i = this._subscribers.get(s) ?? [];
2633
- i.push(e), this._subscribers.set(s, i);
2634
- }
2635
- on(s, e) {
2636
- this.setSubscriber(s, { cb: e });
2637
- }
2638
- once(s, e) {
2639
- this.setSubscriber(s, { cb: e, once: true });
2640
- }
2641
- emit(s, ...e) {
2642
- const i = this._subscribers.get(s) ?? [], r = [];
2643
- for (const n of i) n.cb(...e), n.once && r.push(() => i.splice(i.indexOf(n), 1));
2644
- for (const n of r) n();
2645
- }
2646
- prompt() {
2647
- return new Promise((s) => {
2648
- if (this._abortSignal) {
2649
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), s(G);
2650
- this._abortSignal.addEventListener("abort", () => {
2651
- this.state = "cancel", this.close();
2652
- }, { once: true });
2653
- }
2654
- this.rl = rt.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", () => {
2655
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), W(this.input, false), s(this.value);
2656
- }), this.once("cancel", () => {
2657
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), W(this.input, false), s(G);
2658
- });
2659
- });
2660
- }
2661
- _isActionKey(s, e) {
2662
- return s === " ";
2663
- }
2664
- _setValue(s) {
2665
- this.value = s, this.emit("value", this.value);
2666
- }
2667
- _setUserInput(s, e) {
2668
- this.userInput = s ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
2669
- }
2670
- _clearUserInput() {
2671
- this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
2672
- }
2673
- onKeypress(s, e) {
2674
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(s, 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 && C.aliases.has(e.name) && this.emit("cursor", C.aliases.get(e.name)), C.actions.has(e.name) && this.emit("cursor", e.name)), s && (s.toLowerCase() === "y" || s.toLowerCase() === "n") && this.emit("confirm", s.toLowerCase() === "y"), this.emit("key", s?.toLowerCase(), e), e?.name === "return") {
2675
- if (this.opts.validate) {
2676
- const i = this.opts.validate(this.value);
2677
- i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
2678
- }
2679
- this.state !== "error" && (this.state = "submit");
2680
- }
2681
- U([s, 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();
2682
- }
2683
- close() {
2684
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
2685
- `), W(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
2686
- }
2687
- restoreCursor() {
2688
- const s = et(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
2689
- `).length - 1;
2690
- this.output.write(import_sisteransi.cursor.move(-999, s * -1));
2691
- }
2692
- render() {
2693
- const s = et(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
2694
- if (s !== this._prevFrame) {
2695
- if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
2696
- else {
2697
- const e = At(this._prevFrame, s);
2698
- if (this.restoreCursor(), e && e?.length === 1) {
2699
- const i = e[0];
2700
- this.output.write(import_sisteransi.cursor.move(0, i)), this.output.write(import_sisteransi.erase.lines(1));
2701
- const r = s.split(`
2702
- `);
2703
- this.output.write(r[i]), this._prevFrame = s, this.output.write(import_sisteransi.cursor.move(0, r.length - i - 1));
2704
- return;
2705
- }
2706
- if (e && e?.length > 1) {
2707
- const i = e[0];
2708
- this.output.write(import_sisteransi.cursor.move(0, i)), this.output.write(import_sisteransi.erase.down());
2709
- const r = s.split(`
2710
- `).slice(i);
2711
- this.output.write(r.join(`
2712
- `)), this._prevFrame = s;
2713
- return;
2714
- }
2715
- this.output.write(import_sisteransi.erase.down());
2716
- }
2717
- this.output.write(s), this.state === "initial" && (this.state = "active"), this._prevFrame = s;
2718
- }
2719
- }
2720
- };
2721
- var St = class extends B {
2722
- static {
2723
- __name(this, "St");
2724
- }
2725
- get cursor() {
2726
- return this.value ? 0 : 1;
2727
- }
2728
- get _value() {
2729
- return this.cursor === 0;
2730
- }
2731
- constructor(s) {
2732
- super(s, false), this.value = !!s.initialValue, this.on("userInput", () => {
2733
- this.value = this._value;
2734
- }), this.on("confirm", (e) => {
2735
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
2736
- }), this.on("cursor", () => {
2737
- this.value = !this.value;
2738
- });
2739
- }
2740
- };
2741
- var kt = class extends B {
2742
- static {
2743
- __name(this, "kt");
2744
- }
2745
- options;
2746
- cursor = 0;
2747
- get _value() {
2748
- return this.options[this.cursor].value;
2749
- }
2750
- toggleAll() {
2751
- const s = this.value !== void 0 && this.value.length === this.options.length;
2752
- this.value = s ? [] : this.options.map((e) => e.value);
2753
- }
2754
- toggleInvert() {
2755
- const s = this.options.filter((e) => !this.value.includes(e.value));
2756
- this.value = s.map((e) => e.value);
2757
- }
2758
- toggleValue() {
2759
- this.value === void 0 && (this.value = []);
2760
- const s = this.value.includes(this._value);
2761
- this.value = s ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
2762
- }
2763
- constructor(s) {
2764
- super(s, false), this.options = s.options, this.value = [...s.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === s.cursorAt), 0), this.on("key", (e) => {
2765
- e === "a" && this.toggleAll(), e === "i" && this.toggleInvert();
2766
- }), this.on("cursor", (e) => {
2767
- switch (e) {
2768
- case "left":
2769
- case "up":
2770
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
2771
- break;
2772
- case "down":
2773
- case "right":
2774
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
2775
- break;
2776
- case "space":
2777
- this.toggleValue();
2778
- break;
2779
- }
2780
- });
2781
- }
2782
- };
2783
- var Mt = class extends B {
2784
- static {
2785
- __name(this, "Mt");
2786
- }
2787
- options;
2788
- cursor = 0;
2789
- get _selectedValue() {
2790
- return this.options[this.cursor];
2791
- }
2792
- changeValue() {
2793
- this.value = this._selectedValue.value;
2794
- }
2795
- constructor(s) {
2796
- super(s, false), this.options = s.options, this.cursor = this.options.findIndex(({ value: e }) => e === s.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (e) => {
2797
- switch (e) {
2798
- case "left":
2799
- case "up":
2800
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
2801
- break;
2802
- case "down":
2803
- case "right":
2804
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
2805
- break;
2806
- }
2807
- this.changeValue();
2808
- });
2809
- }
2810
- };
2811
- var Wt = class extends B {
2812
- static {
2813
- __name(this, "Wt");
2814
- }
2815
- get userInputWithCursor() {
2816
- if (this.state === "submit") return this.userInput;
2817
- const s = this.userInput;
2818
- if (this.cursor >= s.length) return `${this.userInput}\u2588`;
2819
- const e = s.slice(0, this.cursor), [i, ...r] = s.slice(this.cursor);
2820
- return `${e}${import_picocolors.default.inverse(i)}${r.join("")}`;
2821
- }
2822
- get cursor() {
2823
- return this._cursor;
2824
- }
2825
- constructor(s) {
2826
- super({ ...s, initialUserInput: s.initialUserInput ?? s.initialValue }), this.on("userInput", (e) => {
2827
- this._setValue(e);
2828
- }), this.on("finalize", () => {
2829
- this.value || (this.value = s.defaultValue), this.value === void 0 && (this.value = "");
2830
- });
2831
- }
2832
- };
2833
-
2834
- // ../node_modules/@clack/prompts/dist/index.mjs
2835
- var import_picocolors2 = __toESM(require_picocolors(), 1);
2836
- import T from "node:process";
2837
- import { WriteStream as rt2 } from "node:tty";
2838
- var import_sisteransi2 = __toESM(require_src(), 1);
2839
- function ot2() {
2840
- return T.platform !== "win32" ? T.env.TERM !== "linux" : !!T.env.CI || !!T.env.WT_SESSION || !!T.env.TERMINUS_SUBLIME || T.env.ConEmuTask === "{cmd::Cmder}" || T.env.TERM_PROGRAM === "Terminus-Sublime" || T.env.TERM_PROGRAM === "vscode" || T.env.TERM === "xterm-256color" || T.env.TERM === "alacritty" || T.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2841
- }
2842
- __name(ot2, "ot");
2843
- var q2 = ot2();
2844
- var se = /* @__PURE__ */ __name(() => process.env.CI === "true", "se");
2845
- var Se = /* @__PURE__ */ __name((e) => e.isTTY === true, "Se");
2846
- var I2 = /* @__PURE__ */ __name((e, r) => q2 ? e : r, "I");
2847
- var we = I2("\u25C6", "*");
2848
- var re = I2("\u25A0", "x");
2849
- var ie = I2("\u25B2", "x");
2850
- var L2 = I2("\u25C7", "o");
2851
- var ne = I2("\u250C", "T");
2852
- var u = I2("\u2502", "|");
2853
- var _ = I2("\u2514", "\u2014");
2854
- var Be = I2("\u2510", "T");
2855
- var _e = I2("\u2518", "\u2014");
2856
- var G2 = I2("\u25CF", ">");
2857
- var H2 = I2("\u25CB", " ");
2858
- var J2 = I2("\u25FB", "[\u2022]");
2859
- var W2 = I2("\u25FC", "[+]");
2860
- var X2 = I2("\u25FB", "[ ]");
2861
- var xe = I2("\u25AA", "\u2022");
2862
- var Y2 = I2("\u2500", "-");
2863
- var ae = I2("\u256E", "+");
2864
- var be = I2("\u251C", "+");
2865
- var oe = I2("\u256F", "+");
2866
- var De = I2("\u2570", "+");
2867
- var Te = I2("\u256D", "+");
2868
- var le = I2("\u25CF", "\u2022");
2869
- var ue = I2("\u25C6", "*");
2870
- var ce = I2("\u25B2", "!");
2871
- var $e = I2("\u25A0", "x");
2872
- var M2 = /* @__PURE__ */ __name((e) => {
2873
- switch (e) {
2874
- case "initial":
2875
- case "active":
2876
- return import_picocolors2.default.cyan(we);
2877
- case "cancel":
2878
- return import_picocolors2.default.red(re);
2879
- case "error":
2880
- return import_picocolors2.default.yellow(ie);
2881
- case "submit":
2882
- return import_picocolors2.default.green(L2);
2883
- }
2884
- }, "M");
2885
- var k2 = /* @__PURE__ */ __name((e) => {
2886
- const { cursor: r, options: s, style: i } = e, n = e.output ?? process.stdout, o = n instanceof rt2 && n.rows !== void 0 ? n.rows : 10, c = import_picocolors2.default.dim("..."), l = e.maxItems ?? Number.POSITIVE_INFINITY, a = Math.max(o - 4, 0), h = Math.min(a, Math.max(l, 5));
2887
- let g = 0;
2888
- r >= g + h - 3 ? g = Math.max(Math.min(r - h + 3, s.length - h), 0) : r < g + 2 && (g = Math.max(r - 2, 0));
2889
- const F = h < s.length && g > 0, y2 = h < s.length && g + h < s.length;
2890
- return s.slice(g, g + h).map((m, p, $2) => {
2891
- const d = p === 0 && F, f = p === $2.length - 1 && y2;
2892
- return d || f ? c : i(m, p + g === r);
2893
- });
2894
- }, "k");
2895
- var ct2 = /* @__PURE__ */ __name((e) => e === 161 || e === 164 || e === 167 || e === 168 || e === 170 || e === 173 || e === 174 || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || e === 198 || e === 208 || e === 215 || e === 216 || e >= 222 && e <= 225 || e === 230 || e >= 232 && e <= 234 || e === 236 || e === 237 || e === 240 || e === 242 || e === 243 || e >= 247 && e <= 250 || e === 252 || e === 254 || e === 257 || e === 273 || e === 275 || e === 283 || e === 294 || e === 295 || e === 299 || e >= 305 && e <= 307 || e === 312 || e >= 319 && e <= 322 || e === 324 || e >= 328 && e <= 331 || e === 333 || e === 338 || e === 339 || e === 358 || e === 359 || e === 363 || e === 462 || e === 464 || e === 466 || e === 468 || e === 470 || e === 472 || e === 474 || e === 476 || e === 593 || e === 609 || e === 708 || e === 711 || e >= 713 && e <= 715 || e === 717 || e === 720 || e >= 728 && e <= 731 || e === 733 || e === 735 || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || e === 1025 || e >= 1040 && e <= 1103 || e === 1105 || e === 8208 || e >= 8211 && e <= 8214 || e === 8216 || e === 8217 || e === 8220 || e === 8221 || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || e === 8240 || e === 8242 || e === 8243 || e === 8245 || e === 8251 || e === 8254 || e === 8308 || e === 8319 || e >= 8321 && e <= 8324 || e === 8364 || e === 8451 || e === 8453 || e === 8457 || e === 8467 || e === 8470 || e === 8481 || e === 8482 || e === 8486 || e === 8491 || e === 8531 || e === 8532 || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || e === 8585 || e >= 8592 && e <= 8601 || e === 8632 || e === 8633 || e === 8658 || e === 8660 || e === 8679 || e === 8704 || e === 8706 || e === 8707 || e === 8711 || e === 8712 || e === 8715 || e === 8719 || e === 8721 || e === 8725 || e === 8730 || e >= 8733 && e <= 8736 || e === 8739 || e === 8741 || e >= 8743 && e <= 8748 || e === 8750 || e >= 8756 && e <= 8759 || e === 8764 || e === 8765 || e === 8776 || e === 8780 || e === 8786 || e === 8800 || e === 8801 || e >= 8804 && e <= 8807 || e === 8810 || e === 8811 || e === 8814 || e === 8815 || e === 8834 || e === 8835 || e === 8838 || e === 8839 || e === 8853 || e === 8857 || e === 8869 || e === 8895 || e === 8978 || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || e === 9632 || e === 9633 || e >= 9635 && e <= 9641 || e === 9650 || e === 9651 || e === 9654 || e === 9655 || e === 9660 || e === 9661 || e === 9664 || e === 9665 || e >= 9670 && e <= 9672 || e === 9675 || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || e === 9711 || e === 9733 || e === 9734 || e === 9737 || e === 9742 || e === 9743 || e === 9756 || e === 9758 || e === 9792 || e === 9794 || e === 9824 || e === 9825 || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || e === 9836 || e === 9837 || e === 9839 || e === 9886 || e === 9887 || e === 9919 || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || e === 9955 || e === 9960 || e === 9961 || e >= 9963 && e <= 9969 || e === 9972 || e >= 9974 && e <= 9977 || e === 9979 || e === 9980 || e === 9982 || e === 9983 || e === 10045 || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || e === 65533 || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || e === 127375 || e === 127376 || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109, "ct");
2896
- var $t = /* @__PURE__ */ __name((e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, "$t");
2897
- var dt2 = /* @__PURE__ */ __name((e) => e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9800 && e <= 9811 || e === 9855 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129672 || e >= 129680 && e <= 129725 || e >= 129727 && e <= 129733 || e >= 129742 && e <= 129755 || e >= 129760 && e <= 129768 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, "dt");
2898
- var de = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
2899
- var z2 = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
2900
- var Z2 = /\t{1,1000}/y;
2901
- var he = /[\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;
2902
- var Q2 = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
2903
- var ht2 = /\p{M}+/gu;
2904
- var mt2 = { limit: 1 / 0, ellipsis: "" };
2905
- var Ne = /* @__PURE__ */ __name((e, r = {}, s = {}) => {
2906
- const i = r.limit ?? 1 / 0, n = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (n ? Ne(n, mt2, s).width : 0), c = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, a = s.tabWidth ?? 8, h = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, F = s.fullWidthWidth ?? 2, y2 = s.regularWidth ?? 1, m = s.wideWidth ?? 2;
2907
- let p = 0, $2 = 0, d = e.length, f = 0, E = false, v = d, w2 = Math.max(0, i - o), B2 = 0, x = 0, A = 0, C2 = 0;
2908
- e: for (; ; ) {
2909
- if (x > B2 || $2 >= d && $2 > p) {
2910
- const O2 = e.slice(B2, x) || e.slice(p, $2);
2911
- f = 0;
2912
- for (const N2 of O2.replaceAll(ht2, "")) {
2913
- const S = N2.codePointAt(0) || 0;
2914
- if ($t(S) ? C2 = F : dt2(S) ? C2 = m : h !== y2 && ct2(S) ? C2 = h : C2 = y2, A + C2 > w2 && (v = Math.min(v, Math.max(B2, p) + f)), A + C2 > i) {
2915
- E = true;
2916
- break e;
2917
- }
2918
- f += N2.length, A += C2;
2919
- }
2920
- B2 = x = 0;
2921
- }
2922
- if ($2 >= d) break;
2923
- if (Q2.lastIndex = $2, Q2.test(e)) {
2924
- if (f = Q2.lastIndex - $2, C2 = f * y2, A + C2 > w2 && (v = Math.min(v, $2 + Math.floor((w2 - A) / y2))), A + C2 > i) {
2925
- E = true;
2926
- break;
2927
- }
2928
- A += C2, B2 = p, x = $2, $2 = p = Q2.lastIndex;
2929
- continue;
2930
- }
2931
- if (de.lastIndex = $2, de.test(e)) {
2932
- if (A + c > w2 && (v = Math.min(v, $2)), A + c > i) {
2933
- E = true;
2934
- break;
2935
- }
2936
- A += c, B2 = p, x = $2, $2 = p = de.lastIndex;
2937
- continue;
2938
- }
2939
- if (z2.lastIndex = $2, z2.test(e)) {
2940
- if (f = z2.lastIndex - $2, C2 = f * l, A + C2 > w2 && (v = Math.min(v, $2 + Math.floor((w2 - A) / l))), A + C2 > i) {
2941
- E = true;
2942
- break;
2943
- }
2944
- A += C2, B2 = p, x = $2, $2 = p = z2.lastIndex;
2945
- continue;
2946
- }
2947
- if (Z2.lastIndex = $2, Z2.test(e)) {
2948
- if (f = Z2.lastIndex - $2, C2 = f * a, A + C2 > w2 && (v = Math.min(v, $2 + Math.floor((w2 - A) / a))), A + C2 > i) {
2949
- E = true;
2950
- break;
2951
- }
2952
- A += C2, B2 = p, x = $2, $2 = p = Z2.lastIndex;
2953
- continue;
2954
- }
2955
- if (he.lastIndex = $2, he.test(e)) {
2956
- if (A + g > w2 && (v = Math.min(v, $2)), A + g > i) {
2957
- E = true;
2958
- break;
2959
- }
2960
- A += g, B2 = p, x = $2, $2 = p = he.lastIndex;
2961
- continue;
2962
- }
2963
- $2 += 1;
2964
- }
2965
- return { width: E ? w2 : A, index: E ? v : d, truncated: E, ellipsed: E && i >= o };
2966
- }, "Ne");
2967
- var pt2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
2968
- var U2 = /* @__PURE__ */ __name((e, r = {}) => Ne(e, pt2, r).width, "U");
2969
- var ee = "\x1B";
2970
- var Le = "\x9B";
2971
- var gt2 = 39;
2972
- var me = "\x07";
2973
- var We = "[";
2974
- var Ft2 = "]";
2975
- var Pe = "m";
2976
- var pe = `${Ft2}8;;`;
2977
- var je = new RegExp(`(?:\\${We}(?<code>\\d+)m|\\${pe}(?<uri>.*)${me})`, "y");
2978
- var ft2 = /* @__PURE__ */ __name((e) => {
2979
- if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
2980
- if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
2981
- if (e === 1 || e === 2) return 22;
2982
- if (e === 3) return 23;
2983
- if (e === 4) return 24;
2984
- if (e === 7) return 27;
2985
- if (e === 8) return 28;
2986
- if (e === 9) return 29;
2987
- if (e === 0) return 0;
2988
- }, "ft");
2989
- var Ve = /* @__PURE__ */ __name((e) => `${ee}${We}${e}${Pe}`, "Ve");
2990
- var ke = /* @__PURE__ */ __name((e) => `${ee}${pe}${e}${me}`, "ke");
2991
- var yt2 = /* @__PURE__ */ __name((e) => e.map((r) => U2(r)), "yt");
2992
- var ge = /* @__PURE__ */ __name((e, r, s) => {
2993
- const i = r[Symbol.iterator]();
2994
- let n = false, o = false, c = e.at(-1), l = c === void 0 ? 0 : U2(c), a = i.next(), h = i.next(), g = 0;
2995
- for (; !a.done; ) {
2996
- const F = a.value, y2 = U2(F);
2997
- l + y2 <= s ? e[e.length - 1] += F : (e.push(F), l = 0), (F === ee || F === Le) && (n = true, o = r.startsWith(pe, g + 1)), n ? o ? F === me && (n = false, o = false) : F === Pe && (n = false) : (l += y2, l === s && !h.done && (e.push(""), l = 0)), a = h, h = i.next(), g += F.length;
2998
- }
2999
- c = e.at(-1), !l && c !== void 0 && c.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
3000
- }, "ge");
3001
- var Et2 = /* @__PURE__ */ __name((e) => {
3002
- const r = e.split(" ");
3003
- let s = r.length;
3004
- for (; s > 0 && !(U2(r[s - 1]) > 0); ) s--;
3005
- return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
3006
- }, "Et");
3007
- var vt2 = /* @__PURE__ */ __name((e, r, s = {}) => {
3008
- if (s.trim !== false && e.trim() === "") return "";
3009
- let i = "", n, o;
3010
- const c = e.split(" "), l = yt2(c);
3011
- let a = [""];
3012
- for (const [p, $2] of c.entries()) {
3013
- s.trim !== false && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
3014
- let d = U2(a.at(-1) ?? "");
3015
- if (p !== 0 && (d >= r && (s.wordWrap === false || s.trim === false) && (a.push(""), d = 0), (d > 0 || s.trim === false) && (a[a.length - 1] += " ", d++)), s.hard && l[p] > r) {
3016
- const f = r - d, E = 1 + Math.floor((l[p] - f - 1) / r);
3017
- Math.floor((l[p] - 1) / r) < E && a.push(""), ge(a, $2, r);
3018
- continue;
3019
- }
3020
- if (d + l[p] > r && d > 0 && l[p] > 0) {
3021
- if (s.wordWrap === false && d < r) {
3022
- ge(a, $2, r);
3023
- continue;
3024
- }
3025
- a.push("");
3026
- }
3027
- if (d + l[p] > r && s.wordWrap === false) {
3028
- ge(a, $2, r);
3029
- continue;
3030
- }
3031
- a[a.length - 1] += $2;
3032
- }
3033
- s.trim !== false && (a = a.map((p) => Et2(p)));
3034
- const h = a.join(`
3035
- `), g = h[Symbol.iterator]();
3036
- let F = g.next(), y2 = g.next(), m = 0;
3037
- for (; !F.done; ) {
3038
- const p = F.value, $2 = y2.value;
3039
- if (i += p, p === ee || p === Le) {
3040
- je.lastIndex = m + 1;
3041
- const E = je.exec(h)?.groups;
3042
- if (E?.code !== void 0) {
3043
- const v = Number.parseFloat(E.code);
3044
- n = v === gt2 ? void 0 : v;
3045
- } else E?.uri !== void 0 && (o = E.uri.length === 0 ? void 0 : E.uri);
3046
- }
3047
- const d = n ? ft2(n) : void 0;
3048
- $2 === `
3049
- ` ? (o && (i += ke("")), n && d && (i += Ve(d))) : p === `
3050
- ` && (n && d && (i += Ve(n)), o && (i += ke(o))), m += p.length, F = y2, y2 = g.next();
3051
- }
3052
- return i;
3053
- }, "vt");
3054
- function Fe(e, r, s) {
3055
- return String(e).normalize().replaceAll(`\r
3056
- `, `
3057
- `).split(`
3058
- `).map((i) => vt2(i, r, s)).join(`
3059
- `);
3060
- }
3061
- __name(Fe, "Fe");
3062
- var wt2 = /* @__PURE__ */ __name((e) => {
3063
- const r = e.active ?? "Yes", s = e.inactive ?? "No";
3064
- return new St({ active: r, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
3065
- const i = `${import_picocolors2.default.gray(u)}
3066
- ${M2(this.state)} ${e.message}
3067
- `, n = this.value ? r : s;
3068
- switch (this.state) {
3069
- case "submit":
3070
- return `${i}${import_picocolors2.default.gray(u)} ${import_picocolors2.default.dim(n)}`;
3071
- case "cancel":
3072
- return `${i}${import_picocolors2.default.gray(u)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}
3073
- ${import_picocolors2.default.gray(u)}`;
3074
- default:
3075
- return `${i}${import_picocolors2.default.cyan(u)} ${this.value ? `${import_picocolors2.default.green(G2)} ${r}` : `${import_picocolors2.default.dim(H2)} ${import_picocolors2.default.dim(r)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(H2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(G2)} ${s}`}
3076
- ${import_picocolors2.default.cyan(_)}
3077
- `;
3078
- }
3079
- } }).prompt();
3080
- }, "wt");
3081
- var b = { message: /* @__PURE__ */ __name((e = [], { symbol: r = import_picocolors2.default.gray(u), secondarySymbol: s = import_picocolors2.default.gray(u), output: i = process.stdout, spacing: n = 1 } = {}) => {
3082
- const o = [];
3083
- for (let l = 0; l < n; l++) o.push(`${s}`);
3084
- const c = Array.isArray(e) ? e : e.split(`
3085
- `);
3086
- if (c.length > 0) {
3087
- const [l, ...a] = c;
3088
- l.length > 0 ? o.push(`${r} ${l}`) : o.push(r);
3089
- for (const h of a) h.length > 0 ? o.push(`${s} ${h}`) : o.push(s);
3090
- }
3091
- i.write(`${o.join(`
3092
- `)}
3093
- `);
3094
- }, "message"), info: /* @__PURE__ */ __name((e, r) => {
3095
- b.message(e, { ...r, symbol: import_picocolors2.default.blue(le) });
3096
- }, "info"), success: /* @__PURE__ */ __name((e, r) => {
3097
- b.message(e, { ...r, symbol: import_picocolors2.default.green(ue) });
3098
- }, "success"), step: /* @__PURE__ */ __name((e, r) => {
3099
- b.message(e, { ...r, symbol: import_picocolors2.default.green(L2) });
3100
- }, "step"), warn: /* @__PURE__ */ __name((e, r) => {
3101
- b.message(e, { ...r, symbol: import_picocolors2.default.yellow(ce) });
3102
- }, "warn"), warning: /* @__PURE__ */ __name((e, r) => {
3103
- b.warn(e, r);
3104
- }, "warning"), error: /* @__PURE__ */ __name((e, r) => {
3105
- b.message(e, { ...r, symbol: import_picocolors2.default.red($e) });
3106
- }, "error") };
3107
- var xt = /* @__PURE__ */ __name((e = "", r) => {
3108
- (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(_)} ${import_picocolors2.default.red(e)}
3109
-
3110
- `);
3111
- }, "xt");
3112
- var bt2 = /* @__PURE__ */ __name((e = "", r) => {
3113
- (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(ne)} ${e}
3114
- `);
3115
- }, "bt");
3116
- var Dt = /* @__PURE__ */ __name((e = "", r) => {
3117
- (r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(u)}
3118
- ${import_picocolors2.default.gray(_)} ${e}
3119
-
3120
- `);
3121
- }, "Dt");
3122
- var Tt = /* @__PURE__ */ __name((e) => {
3123
- const r = /* @__PURE__ */ __name((i, n) => {
3124
- const o = i.label ?? String(i.value);
3125
- return n === "active" ? `${import_picocolors2.default.cyan(J2)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "selected" ? `${import_picocolors2.default.green(W2)} ${import_picocolors2.default.dim(o)}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o))}` : n === "active-selected" ? `${import_picocolors2.default.green(W2)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "submitted" ? `${import_picocolors2.default.dim(o)}` : `${import_picocolors2.default.dim(X2)} ${import_picocolors2.default.dim(o)}`;
3126
- }, "r"), s = e.required ?? true;
3127
- return new kt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(i) {
3128
- if (s && (i === void 0 || i.length === 0)) return `Please select at least one option.
3129
- ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
3130
- }, render() {
3131
- const i = `${import_picocolors2.default.gray(u)}
3132
- ${M2(this.state)} ${e.message}
3133
- `, n = this.value ?? [], o = /* @__PURE__ */ __name((c, l) => {
3134
- const a = n.includes(c.value);
3135
- return l && a ? r(c, "active-selected") : a ? r(c, "selected") : r(c, l ? "active" : "inactive");
3136
- }, "o");
3137
- switch (this.state) {
3138
- case "submit":
3139
- return `${i}${import_picocolors2.default.gray(u)} ${this.options.filter(({ value: c }) => n.includes(c)).map((c) => r(c, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
3140
- case "cancel": {
3141
- const c = this.options.filter(({ value: l }) => n.includes(l)).map((l) => r(l, "cancelled")).join(import_picocolors2.default.dim(", "));
3142
- return `${i}${import_picocolors2.default.gray(u)}${c.trim() ? ` ${c}
3143
- ${import_picocolors2.default.gray(u)}` : ""}`;
3144
- }
3145
- case "error": {
3146
- const c = this.error.split(`
3147
- `).map((l, a) => a === 0 ? `${import_picocolors2.default.yellow(_)} ${import_picocolors2.default.yellow(l)}` : ` ${l}`).join(`
3148
- `);
3149
- return `${i + import_picocolors2.default.yellow(u)} ${k2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, style: o }).join(`
3150
- ${import_picocolors2.default.yellow(u)} `)}
3151
- ${c}
3152
- `;
3153
- }
3154
- default:
3155
- return `${i}${import_picocolors2.default.cyan(u)} ${k2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, style: o }).join(`
3156
- ${import_picocolors2.default.cyan(u)} `)}
3157
- ${import_picocolors2.default.cyan(_)}
3158
- `;
3159
- }
3160
- } }).prompt();
3161
- }, "Tt");
3162
- var fe = /* @__PURE__ */ __name(({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: n, frames: o = q2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: c = q2 ? 80 : 120, signal: l } = {}) => {
3163
- const a = se();
3164
- let h, g, F = false, y2 = false, m = "", p, $2 = performance.now();
3165
- const d = bt(s), f = /* @__PURE__ */ __name((S) => {
3166
- const D2 = S > 1 ? n ?? C.messages.error : i ?? C.messages.cancel;
3167
- y2 = S === 1, F && (N2(D2, S), y2 && typeof r == "function" && r());
3168
- }, "f"), E = /* @__PURE__ */ __name(() => f(2), "E"), v = /* @__PURE__ */ __name(() => f(1), "v"), w2 = /* @__PURE__ */ __name(() => {
3169
- process.on("uncaughtExceptionMonitor", E), process.on("unhandledRejection", E), process.on("SIGINT", v), process.on("SIGTERM", v), process.on("exit", f), l && l.addEventListener("abort", v);
3170
- }, "w"), B2 = /* @__PURE__ */ __name(() => {
3171
- process.removeListener("uncaughtExceptionMonitor", E), process.removeListener("unhandledRejection", E), process.removeListener("SIGINT", v), process.removeListener("SIGTERM", v), process.removeListener("exit", f), l && l.removeEventListener("abort", v);
3172
- }, "B"), x = /* @__PURE__ */ __name(() => {
3173
- if (p === void 0) return;
3174
- a && s.write(`
3175
- `);
3176
- const S = Fe(p, d, { hard: true, trim: false }).split(`
3177
- `);
3178
- S.length > 1 && s.write(import_sisteransi2.cursor.up(S.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
3179
- }, "x"), A = /* @__PURE__ */ __name((S) => S.replace(/\.+$/, ""), "A"), C2 = /* @__PURE__ */ __name((S) => {
3180
- const D2 = (performance.now() - S) / 1e3, R2 = Math.floor(D2 / 60), j2 = Math.floor(D2 % 60);
3181
- return R2 > 0 ? `[${R2}m ${j2}s]` : `[${j2}s]`;
3182
- }, "C"), O2 = /* @__PURE__ */ __name((S = "") => {
3183
- F = true, h = Ct({ output: s }), m = A(S), $2 = performance.now(), s.write(`${import_picocolors2.default.gray(u)}
3184
- `);
3185
- let D2 = 0, R2 = 0;
3186
- w2(), g = setInterval(() => {
3187
- if (a && m === p) return;
3188
- x(), p = m;
3189
- const j2 = import_picocolors2.default.magenta(o[D2]);
3190
- let K;
3191
- if (a) K = `${j2} ${m}...`;
3192
- else if (e === "timer") K = `${j2} ${m} ${C2($2)}`;
3193
- else {
3194
- const qe = ".".repeat(Math.floor(R2)).slice(0, 3);
3195
- K = `${j2} ${m}${qe}`;
3196
- }
3197
- const Ke = Fe(K, d, { hard: true, trim: false });
3198
- s.write(Ke), D2 = D2 + 1 < o.length ? D2 + 1 : 0, R2 = R2 < 4 ? R2 + 0.125 : 0;
3199
- }, c);
3200
- }, "O"), N2 = /* @__PURE__ */ __name((S = "", D2 = 0) => {
3201
- F = false, clearInterval(g), x();
3202
- const R2 = D2 === 0 ? import_picocolors2.default.green(L2) : D2 === 1 ? import_picocolors2.default.red(re) : import_picocolors2.default.red(ie);
3203
- m = S ?? m, e === "timer" ? s.write(`${R2} ${m} ${C2($2)}
3204
- `) : s.write(`${R2} ${m}
3205
- `), B2(), h();
3206
- }, "N");
3207
- return { start: O2, stop: N2, message: /* @__PURE__ */ __name((S = "") => {
3208
- m = A(S ?? m);
3209
- }, "message"), get isCancelled() {
3210
- return y2;
3211
- } };
3212
- }, "fe");
3213
- var He = { light: I2("\u2500", "-"), heavy: I2("\u2501", "="), block: I2("\u2588", "#") };
3214
- var Wt2 = /* @__PURE__ */ __name((e) => {
3215
- const r = /* @__PURE__ */ __name((s, i) => {
3216
- const n = s.label ?? String(s.value);
3217
- switch (i) {
3218
- case "selected":
3219
- return `${import_picocolors2.default.dim(n)}`;
3220
- case "active":
3221
- return `${import_picocolors2.default.green(G2)} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
3222
- case "cancelled":
3223
- return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}`;
3224
- default:
3225
- return `${import_picocolors2.default.dim(H2)} ${import_picocolors2.default.dim(n)}`;
3226
- }
3227
- }, "r");
3228
- return new Mt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
3229
- const s = `${import_picocolors2.default.gray(u)}
3230
- ${M2(this.state)} ${e.message}
3231
- `;
3232
- switch (this.state) {
3233
- case "submit":
3234
- return `${s}${import_picocolors2.default.gray(u)} ${r(this.options[this.cursor], "selected")}`;
3235
- case "cancel":
3236
- return `${s}${import_picocolors2.default.gray(u)} ${r(this.options[this.cursor], "cancelled")}
3237
- ${import_picocolors2.default.gray(u)}`;
3238
- default:
3239
- return `${s}${import_picocolors2.default.cyan(u)} ${k2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, style: /* @__PURE__ */ __name((i, n) => r(i, n ? "active" : "inactive"), "style") }).join(`
3240
- ${import_picocolors2.default.cyan(u)} `)}
3241
- ${import_picocolors2.default.cyan(_)}
3242
- `;
3243
- }
3244
- } }).prompt();
3245
- }, "Wt");
3246
- var Ue = `${import_picocolors2.default.gray(u)} `;
3247
- var Vt2 = /* @__PURE__ */ __name((e) => {
3248
- const r = e.output ?? process.stdout, s = bt(r), i = import_picocolors2.default.gray(u), n = e.spacing ?? 1, o = 3, c = e.retainLog === true, l = !se() && Se(r);
3249
- r.write(`${i}
3250
- `), r.write(`${import_picocolors2.default.green(L2)} ${e.title}
3251
- `);
3252
- for (let d = 0; d < n; d++) r.write(`${i}
3253
- `);
3254
- const a = [{ value: "", full: "" }];
3255
- let h = false;
3256
- const g = /* @__PURE__ */ __name((d) => {
3257
- if (a.length === 0) return;
3258
- let f = 0;
3259
- d && (f += n + 2);
3260
- for (const E of a) {
3261
- const { value: v, result: w2 } = E;
3262
- let B2 = w2?.message ?? v;
3263
- if (B2.length === 0) continue;
3264
- w2 === void 0 && E.header !== void 0 && E.header !== "" && (B2 += `
3265
- ${E.header}`);
3266
- const x = B2.split(`
3267
- `).reduce((A, C2) => C2 === "" ? A + 1 : A + Math.ceil((C2.length + o) / s), 0);
3268
- f += x;
3269
- }
3270
- f > 0 && (f += 1, r.write(import_sisteransi2.erase.lines(f)));
3271
- }, "g"), F = /* @__PURE__ */ __name((d, f, E) => {
3272
- const v = E ? `${d.full}
3273
- ${d.value}` : d.value;
3274
- d.header !== void 0 && d.header !== "" && b.message(d.header.split(`
3275
- `).map(import_picocolors2.default.bold), { output: r, secondarySymbol: i, symbol: i, spacing: 0 }), b.message(v.split(`
3276
- `).map(import_picocolors2.default.dim), { output: r, secondarySymbol: i, symbol: i, spacing: f ?? n });
3277
- }, "F"), y2 = /* @__PURE__ */ __name(() => {
3278
- for (const d of a) {
3279
- const { header: f, value: E, full: v } = d;
3280
- (f === void 0 || f.length === 0) && E.length === 0 || F(d, void 0, c === true && v.length > 0);
3281
- }
3282
- }, "y"), m = /* @__PURE__ */ __name((d, f, E) => {
3283
- if (g(false), (E?.raw !== true || !h) && d.value !== "" && (d.value += `
3284
- `), d.value += f, h = E?.raw === true, e.limit !== void 0) {
3285
- const v = d.value.split(`
3286
- `), w2 = v.length - e.limit;
3287
- if (w2 > 0) {
3288
- const B2 = v.splice(0, w2);
3289
- c && (d.full += (d.full === "" ? "" : `
3290
- `) + B2.join(`
3291
- `));
3292
- }
3293
- d.value = v.join(`
3294
- `);
3295
- }
3296
- l && p();
3297
- }, "m"), p = /* @__PURE__ */ __name(() => {
3298
- for (const d of a) d.result ? d.result.status === "error" ? b.error(d.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : b.success(d.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : d.value !== "" && F(d, 0);
3299
- }, "p"), $2 = /* @__PURE__ */ __name((d, f) => {
3300
- g(false), d.result = f, l && p();
3301
- }, "$");
3302
- return { message(d, f) {
3303
- m(a[0], d, f);
3304
- }, group(d) {
3305
- const f = { header: d, value: "", full: "" };
3306
- return a.push(f), { message(E, v) {
3307
- m(f, E, v);
3308
- }, error(E) {
3309
- $2(f, { status: "error", message: E });
3310
- }, success(E) {
3311
- $2(f, { status: "success", message: E });
3312
- } };
3313
- }, error(d, f) {
3314
- g(true), b.error(d, { output: r, secondarySymbol: i, spacing: 1 }), f?.showLog !== false && y2(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
3315
- }, success(d, f) {
3316
- g(true), b.success(d, { output: r, secondarySymbol: i, spacing: 1 }), f?.showLog === true && y2(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
3317
- } };
3318
- }, "Vt");
3319
- var kt2 = /* @__PURE__ */ __name((e) => new Wt({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
3320
- const r = `${import_picocolors2.default.gray(u)}
3321
- ${M2(this.state)} ${e.message}
3322
- `, s = e.placeholder ? import_picocolors2.default.inverse(e.placeholder[0]) + import_picocolors2.default.dim(e.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.userInput ? this.userInputWithCursor : s, n = this.value ?? "";
3323
- switch (this.state) {
3324
- case "error": {
3325
- const o = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "";
3326
- return `${r.trim()}
3327
- ${import_picocolors2.default.yellow(u)} ${i}
3328
- ${import_picocolors2.default.yellow(_)}${o}
3329
- `;
3330
- }
3331
- case "submit": {
3332
- const o = n ? ` ${import_picocolors2.default.dim(n)}` : "";
3333
- return `${r}${import_picocolors2.default.gray(u)}${o}`;
3334
- }
3335
- case "cancel": {
3336
- const o = n ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}` : "";
3337
- return `${r}${import_picocolors2.default.gray(u)}${o}${n.trim() ? `
3338
- ${import_picocolors2.default.gray(u)}` : ""}`;
3339
- }
3340
- default:
3341
- return `${r}${import_picocolors2.default.cyan(u)} ${i}
3342
- ${import_picocolors2.default.cyan(_)}
3343
- `;
3344
- }
3345
- } }).prompt(), "kt");
3346
-
3347
- // src/node-logger/prompts/prompt-config.ts
3348
- var prompt_config_exports = {};
3349
- __export(prompt_config_exports, {
3350
- getPreferredStdio: () => getPreferredStdio,
3351
- getPromptLibrary: () => getPromptLibrary,
3352
- getPromptProvider: () => getPromptProvider,
3353
- isClackEnabled: () => isClackEnabled,
3354
- isPromptsEnabled: () => isPromptsEnabled,
3355
- setPromptLibrary: () => setPromptLibrary
3356
- });
3357
-
3358
- // src/node-logger/logger/log-tracker.ts
3359
- import { promises as fs } from "node:fs";
3360
- import path, { join } from "node:path";
3361
- import { isCI } from "storybook/internal/common";
3362
-
3363
- // ../lib/cli-storybook/src/automigrate/helpers/cleanLog.ts
3364
- import { EOL } from "node:os";
3365
- var ansiRegex = /* @__PURE__ */ __name(({ onlyFirst = false } = {}) => {
3366
- const pattern = [
3367
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
3368
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
3369
- ].join("|");
3370
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
3371
- }, "ansiRegex");
3372
- var cleanLog = /* @__PURE__ */ __name((str) => str.replace(ansiRegex(), "").replace(/╮│/g, "\u256E\n\u2502").replace(/││/g, "\u2502\n\u2502").replace(/│╰/g, "\u2502\n\u2570").replace(/⚠️ {2}failed to check/g, `${EOL}\u26A0\uFE0F failed to check`), "cleanLog");
3373
-
3374
- // src/node-logger/logger/log-tracker.ts
3375
- var DEBUG_LOG_FILE_NAME = "debug-storybook.log";
3376
- var LogTracker = class {
3377
- static {
3378
- __name(this, "LogTracker");
3379
- }
3380
- /** Array to store log entries */
3381
- #logs = [];
3382
- /** Path where log file will be written */
3383
- #logFilePath = "";
3384
- /**
3385
- * Flag indicating if logs should be written to file it is enabled either by users providing the
3386
- * `--write-logs` flag to a CLI command or when we explicitly enable it by calling
3387
- * `logTracker.enableLogWriting()` e.g. in automigrate or doctor command when there are issues
3388
- */
3389
- #shouldWriteLogsToFile = false;
3390
- constructor() {
3391
- this.#logFilePath = join(process.cwd(), DEBUG_LOG_FILE_NAME);
3392
- }
3393
- /** Enables writing logs to file. */
3394
- enableLogWriting() {
3395
- this.#shouldWriteLogsToFile = true;
3396
- }
3397
- /** Returns whether logs should be written to file. */
3398
- get shouldWriteLogsToFile() {
3399
- return this.#shouldWriteLogsToFile;
3400
- }
3401
- /** Returns the configured log file path. */
3402
- get logFilePath() {
3403
- return this.#logFilePath;
3404
- }
3405
- /** Returns a copy of all stored logs. */
3406
- get logs() {
3407
- return [...this.#logs];
3408
- }
3409
- /**
3410
- * Adds a new log entry.
3411
- *
3412
- * @param level - The log level
3413
- * @param message - The log message
3414
- * @param metadata - Optional metadata to attach to the log, can be any JSON serializable value
3415
- */
3416
- addLog(level, message, metadata) {
3417
- this.#logs.push({
3418
- timestamp: /* @__PURE__ */ new Date(),
3419
- level,
3420
- message: cleanLog(message),
3421
- metadata
3422
- });
3423
- }
3424
- /** Clears all stored logs. */
3425
- clear() {
3426
- this.#logs = [];
3427
- }
3428
- /**
3429
- * Writes all stored logs to a file and clears the log store.
3430
- *
3431
- * @param filePath - Optional custom file path to write logs to
3432
- * @returns The path where logs were written, by default is debug-storybook.log in current working
3433
- * directory
3434
- */
3435
- async writeToFile(filePath = this.#logFilePath) {
3436
- const logContent = this.#logs.map((log2) => {
3437
- const timestamp = log2.timestamp.toLocaleTimeString("en-US", { hour12: false }) + `.${log2.timestamp.getMilliseconds().toString().padStart(3, "0")}`;
3438
- const metadata = log2.metadata ? ` ${JSON.stringify(log2.metadata)}` : "";
3439
- return `[${timestamp}] [${log2.level.toUpperCase()}] ${log2.message}${metadata}`;
3440
- }).join("\n");
3441
- await fs.writeFile(filePath, logContent, "utf-8");
3442
- this.#logs = [];
3443
- return isCI() ? filePath : path.relative(process.cwd(), filePath);
3444
- }
3445
- };
3446
- var logTracker = new LogTracker();
3447
-
3448
- // src/node-logger/prompts/prompt-provider-base.ts
3449
- var PromptProvider = class {
3450
- static {
3451
- __name(this, "PromptProvider");
3452
- }
3453
- };
3454
-
3455
- // src/node-logger/prompts/prompt-provider-clack.ts
3456
- var currentTaskLog = null;
3457
- var ClackPromptProvider = class extends PromptProvider {
3458
- static {
3459
- __name(this, "ClackPromptProvider");
3460
- }
3461
- handleCancel(result, promptOptions) {
3462
- if (_t(result)) {
3463
- if (promptOptions?.onCancel) {
3464
- promptOptions.onCancel();
3465
- } else {
3466
- xt("Operation canceled.");
3467
- process.exit(0);
3468
- }
3469
- }
3470
- }
3471
- async text(options, promptOptions) {
3472
- const result = await kt2(options);
3473
- this.handleCancel(result, promptOptions);
3474
- logTracker.addLog("prompt", options.message, { choice: result });
3475
- return result.toString();
3476
- }
3477
- async confirm(options, promptOptions) {
3478
- const result = await wt2(options);
3479
- this.handleCancel(result, promptOptions);
3480
- logTracker.addLog("prompt", options.message, { choice: result });
3481
- return Boolean(result);
3482
- }
3483
- async select(options, promptOptions) {
3484
- const result = await Wt2(options);
3485
- this.handleCancel(result, promptOptions);
3486
- logTracker.addLog("prompt", options.message, { choice: result });
3487
- return result;
3488
- }
3489
- async multiselect(options, promptOptions) {
3490
- const result = await Tt({
3491
- ...options,
3492
- required: options.required
3493
- });
3494
- this.handleCancel(result, promptOptions);
3495
- logTracker.addLog("prompt", options.message, { choice: result });
3496
- return result;
3497
- }
3498
- spinner(options) {
3499
- const task = fe();
3500
- const spinnerId = `${options.id}-spinner`;
3501
- return {
3502
- start: /* @__PURE__ */ __name((message) => {
3503
- logTracker.addLog("info", `${spinnerId}-start: ${message}`);
3504
- task.start(message);
3505
- }, "start"),
3506
- message: /* @__PURE__ */ __name((message) => {
3507
- logTracker.addLog("info", `${spinnerId}: ${message}`);
3508
- task.message(message);
3509
- }, "message"),
3510
- stop: /* @__PURE__ */ __name((message) => {
3511
- logTracker.addLog("info", `${spinnerId}-stop: ${message}`);
3512
- task.stop(message);
3513
- }, "stop")
3514
- };
3515
- }
3516
- taskLog(options) {
3517
- const task = Vt2(options);
3518
- const taskId = `${options.id}-task`;
3519
- logTracker.addLog("info", `${taskId}-start: ${options.title}`);
3520
- currentTaskLog = task;
3521
- return {
3522
- message: /* @__PURE__ */ __name((message) => {
3523
- logTracker.addLog("info", `${taskId}: ${message}`);
3524
- task.message(message);
3525
- }, "message"),
3526
- error: /* @__PURE__ */ __name((message) => {
3527
- logTracker.addLog("error", `${taskId}-error: ${message}`);
3528
- task.error(message, { showLog: true });
3529
- currentTaskLog = null;
3530
- }, "error"),
3531
- success: /* @__PURE__ */ __name((message, options2) => {
3532
- logTracker.addLog("info", `${taskId}-success: ${message}`);
3533
- task.success(message, options2);
3534
- currentTaskLog = null;
3535
- }, "success")
3536
- };
3537
- }
3538
- };
3539
-
3540
- // src/node-logger/prompts/prompt-provider-prompts.ts
3541
- var import_prompts = __toESM(require_prompts(), 1);
3542
- var PromptsPromptProvider = class extends PromptProvider {
3543
- static {
3544
- __name(this, "PromptsPromptProvider");
3545
- }
3546
- getBaseOptions(promptOptions) {
3547
- return {
3548
- onCancel: /* @__PURE__ */ __name(() => {
3549
- if (promptOptions?.onCancel) {
3550
- promptOptions.onCancel();
3551
- } else {
3552
- logger.info("Operation canceled.");
3553
- process.exit(0);
3554
- }
3555
- }, "onCancel")
3556
- };
3557
- }
3558
- async text(options, promptOptions) {
3559
- const validate = options.validate ? (value) => {
3560
- const result2 = options.validate(value);
3561
- if (result2 instanceof Error) {
3562
- return result2.message;
3563
- }
3564
- if (typeof result2 === "string") {
3565
- return result2;
3566
- }
3567
- return true;
3568
- } : void 0;
3569
- const result = await (0, import_prompts.default)(
3570
- {
3571
- type: "text",
3572
- name: "value",
3573
- message: options.message,
3574
- initial: options.initialValue,
3575
- validate
3576
- },
3577
- { ...this.getBaseOptions(promptOptions) }
3578
- );
3579
- logTracker.addLog("prompt", options.message, { choice: result.value });
3580
- return result.value;
3581
- }
3582
- async confirm(options, promptOptions) {
3583
- const result = await (0, import_prompts.default)(
3584
- {
3585
- type: "confirm",
3586
- name: "value",
3587
- message: options.message,
3588
- initial: options.initialValue,
3589
- active: options.active,
3590
- inactive: options.inactive
3591
- },
3592
- { ...this.getBaseOptions(promptOptions) }
3593
- );
3594
- logTracker.addLog("prompt", options.message, { choice: result.value });
3595
- return result.value;
3596
- }
3597
- async select(options, promptOptions) {
3598
- const result = await (0, import_prompts.default)(
3599
- {
3600
- type: "select",
3601
- name: "value",
3602
- message: options.message,
3603
- choices: options.options.map((opt) => ({
3604
- title: opt.label || String(opt.value),
3605
- value: opt.value,
3606
- description: opt.hint,
3607
- selected: opt.value === options.initialValue
3608
- }))
3609
- },
3610
- { ...this.getBaseOptions(promptOptions) }
3611
- );
3612
- logTracker.addLog("prompt", options.message, { choice: result.value });
3613
- return result.value;
3614
- }
3615
- async multiselect(options, promptOptions) {
3616
- const result = await (0, import_prompts.default)(
3617
- {
3618
- type: "multiselect",
3619
- name: "value",
3620
- message: options.message,
3621
- choices: options.options.map((opt) => ({
3622
- title: opt.label || String(opt.value),
3623
- value: opt.value,
3624
- description: opt.hint,
3625
- selected: options.initialValues?.includes(opt.value)
3626
- })),
3627
- min: options.required ? 1 : 0
3628
- },
3629
- { ...this.getBaseOptions(promptOptions) }
3630
- );
3631
- logTracker.addLog("prompt", options.message, { choice: result.value });
3632
- return result.value;
3633
- }
3634
- spinner(options) {
3635
- let interval;
3636
- const chars = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
3637
- let i = 0;
3638
- const spinnerId = `${options.id}-spinner`;
3639
- return {
3640
- start: /* @__PURE__ */ __name((message) => {
3641
- logTracker.addLog("info", `${spinnerId}-start: ${message}`);
3642
- process.stdout.write("\x1B[?25l");
3643
- interval = setInterval(() => {
3644
- process.stdout.write(`\r${chars[i]} ${message || "Loading..."}`);
3645
- i = (i + 1) % chars.length;
3646
- }, 100);
3647
- }, "start"),
3648
- stop: /* @__PURE__ */ __name((message) => {
3649
- logTracker.addLog("info", `${spinnerId}-stop: ${message}`);
3650
- clearInterval(interval);
3651
- process.stdout.write("\x1B[?25h");
3652
- if (message) {
3653
- process.stdout.write(`\r\u2713 ${message}
3654
- `);
3655
- } else {
3656
- process.stdout.write("\r\x1B[K");
3657
- }
3658
- }, "stop"),
3659
- message: /* @__PURE__ */ __name((text2) => {
3660
- logTracker.addLog("info", `${spinnerId}: ${text2}`);
3661
- process.stdout.write(`\r${text2}`);
3662
- }, "message")
3663
- };
3664
- }
3665
- taskLog(options) {
3666
- logger.info(`${options.title}
3667
- `);
3668
- const taskId = `${options.id}-task`;
3669
- logTracker.addLog("info", `${taskId}-start: ${options.title}`);
3670
- return {
3671
- message: /* @__PURE__ */ __name((text2) => {
3672
- logger.info(text2);
3673
- logTracker.addLog("info", `${taskId}: ${text2}`);
3674
- }, "message"),
3675
- success: /* @__PURE__ */ __name((message) => {
3676
- logger.info(message);
3677
- logTracker.addLog("info", `${taskId}-success: ${message}`);
3678
- }, "success"),
3679
- error: /* @__PURE__ */ __name((message) => {
3680
- logger.error(message);
3681
- logTracker.addLog("error", `${taskId}-error: ${message}`);
3682
- }, "error")
3683
- };
3684
- }
3685
- };
3686
-
3687
- // src/node-logger/prompts/prompt-config.ts
3688
- var PROVIDERS = {
3689
- clack: new ClackPromptProvider(),
3690
- prompts: new PromptsPromptProvider()
3691
- };
3692
- var currentPromptLibrary = optionalEnvToBoolean(process.env.USE_CLACK) ? "clack" : "prompts";
3693
- var setPromptLibrary = /* @__PURE__ */ __name((library) => {
3694
- currentPromptLibrary = library;
3695
- }, "setPromptLibrary");
3696
- var getPromptLibrary = /* @__PURE__ */ __name(() => {
3697
- return currentPromptLibrary;
3698
- }, "getPromptLibrary");
3699
- var getPromptProvider = /* @__PURE__ */ __name(() => {
3700
- return PROVIDERS[currentPromptLibrary];
3701
- }, "getPromptProvider");
3702
- var isClackEnabled = /* @__PURE__ */ __name(() => {
3703
- return currentPromptLibrary === "clack";
3704
- }, "isClackEnabled");
3705
- var isPromptsEnabled = /* @__PURE__ */ __name(() => {
3706
- return currentPromptLibrary === "prompts";
3707
- }, "isPromptsEnabled");
3708
- var getPreferredStdio = /* @__PURE__ */ __name(() => {
3709
- return isClackEnabled() ? "pipe" : "inherit";
3710
- }, "getPreferredStdio");
3711
-
3712
- // src/node-logger/wrap-utils.ts
3713
- var import_picocolors3 = __toESM(require_picocolors(), 1);
3714
-
3715
- // ../node_modules/wrap-ansi/node_modules/string-width/index.js
3716
- var import_eastasianwidth = __toESM(require_eastasianwidth(), 1);
3717
- var import_emoji_regex = __toESM(require_emoji_regex(), 1);
3718
- function stringWidth(string, options = {}) {
3719
- if (typeof string !== "string" || string.length === 0) {
3720
- return 0;
3721
- }
3722
- options = {
3723
- ambiguousIsNarrow: true,
3724
- ...options
3725
- };
3726
- string = stripAnsi(string);
3727
- if (string.length === 0) {
3728
- return 0;
3729
- }
3730
- string = string.replace((0, import_emoji_regex.default)(), " ");
3731
- const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
3732
- let width = 0;
3733
- for (const character of string) {
3734
- const codePoint = character.codePointAt(0);
3735
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
3736
- continue;
3737
- }
3738
- if (codePoint >= 768 && codePoint <= 879) {
3739
- continue;
3740
- }
3741
- const code = import_eastasianwidth.default.eastAsianWidth(character);
3742
- switch (code) {
3743
- case "F":
3744
- case "W":
3745
- width += 2;
3746
- break;
3747
- case "A":
3748
- width += ambiguousCharacterWidth;
3749
- break;
3750
- default:
3751
- width += 1;
3752
- }
3753
- }
3754
- return width;
3755
- }
3756
- __name(stringWidth, "stringWidth");
3757
-
3758
- // ../node_modules/wrap-ansi/index.js
3759
- var ESCAPES = /* @__PURE__ */ new Set([
3760
- "\x1B",
3761
- "\x9B"
3762
- ]);
3763
- var END_CODE = 39;
3764
- var ANSI_ESCAPE_BELL = "\x07";
3765
- var ANSI_CSI = "[";
3766
- var ANSI_OSC = "]";
3767
- var ANSI_SGR_TERMINATOR = "m";
3768
- var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
3769
- var wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
3770
- var wrapAnsiHyperlink = /* @__PURE__ */ __name((uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
3771
- var wordLengths = /* @__PURE__ */ __name((string) => string.split(" ").map((character) => stringWidth(character)), "wordLengths");
3772
- var wrapWord = /* @__PURE__ */ __name((rows, word, columns) => {
3773
- const characters = [...word];
3774
- let isInsideEscape = false;
3775
- let isInsideLinkEscape = false;
3776
- let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
3777
- for (const [index, character] of characters.entries()) {
3778
- const characterLength = stringWidth(character);
3779
- if (visible + characterLength <= columns) {
3780
- rows[rows.length - 1] += character;
3781
- } else {
3782
- rows.push(character);
3783
- visible = 0;
3784
- }
3785
- if (ESCAPES.has(character)) {
3786
- isInsideEscape = true;
3787
- isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK);
3788
- }
3789
- if (isInsideEscape) {
3790
- if (isInsideLinkEscape) {
3791
- if (character === ANSI_ESCAPE_BELL) {
3792
- isInsideEscape = false;
3793
- isInsideLinkEscape = false;
3794
- }
3795
- } else if (character === ANSI_SGR_TERMINATOR) {
3796
- isInsideEscape = false;
3797
- }
3798
- continue;
3799
- }
3800
- visible += characterLength;
3801
- if (visible === columns && index < characters.length - 1) {
3802
- rows.push("");
3803
- visible = 0;
3804
- }
3805
- }
3806
- if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
3807
- rows[rows.length - 2] += rows.pop();
3808
- }
3809
- }, "wrapWord");
3810
- var stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => {
3811
- const words = string.split(" ");
3812
- let last = words.length;
3813
- while (last > 0) {
3814
- if (stringWidth(words[last - 1]) > 0) {
3815
- break;
3816
- }
3817
- last--;
3818
- }
3819
- if (last === words.length) {
3820
- return string;
3821
- }
3822
- return words.slice(0, last).join(" ") + words.slice(last).join("");
3823
- }, "stringVisibleTrimSpacesRight");
3824
- var exec = /* @__PURE__ */ __name((string, columns, options = {}) => {
3825
- if (options.trim !== false && string.trim() === "") {
3826
- return "";
3827
- }
3828
- let returnValue = "";
3829
- let escapeCode;
3830
- let escapeUrl;
3831
- const lengths = wordLengths(string);
3832
- let rows = [""];
3833
- for (const [index, word] of string.split(" ").entries()) {
3834
- if (options.trim !== false) {
3835
- rows[rows.length - 1] = rows[rows.length - 1].trimStart();
3836
- }
3837
- let rowLength = stringWidth(rows[rows.length - 1]);
3838
- if (index !== 0) {
3839
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
3840
- rows.push("");
3841
- rowLength = 0;
3842
- }
3843
- if (rowLength > 0 || options.trim === false) {
3844
- rows[rows.length - 1] += " ";
3845
- rowLength++;
3846
- }
3847
- }
3848
- if (options.hard && lengths[index] > columns) {
3849
- const remainingColumns = columns - rowLength;
3850
- const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
3851
- const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
3852
- if (breaksStartingNextLine < breaksStartingThisLine) {
3853
- rows.push("");
3854
- }
3855
- wrapWord(rows, word, columns);
3856
- continue;
3857
- }
3858
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
3859
- if (options.wordWrap === false && rowLength < columns) {
3860
- wrapWord(rows, word, columns);
3861
- continue;
3862
- }
3863
- rows.push("");
3864
- }
3865
- if (rowLength + lengths[index] > columns && options.wordWrap === false) {
3866
- wrapWord(rows, word, columns);
3867
- continue;
3868
- }
3869
- rows[rows.length - 1] += word;
3870
- }
3871
- if (options.trim !== false) {
3872
- rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
3873
- }
3874
- const pre = [...rows.join("\n")];
3875
- for (const [index, character] of pre.entries()) {
3876
- returnValue += character;
3877
- if (ESCAPES.has(character)) {
3878
- const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
3879
- if (groups.code !== void 0) {
3880
- const code2 = Number.parseFloat(groups.code);
3881
- escapeCode = code2 === END_CODE ? void 0 : code2;
3882
- } else if (groups.uri !== void 0) {
3883
- escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
3884
- }
3885
- }
3886
- const code = ansi_styles_default.codes.get(Number(escapeCode));
3887
- if (pre[index + 1] === "\n") {
3888
- if (escapeUrl) {
3889
- returnValue += wrapAnsiHyperlink("");
3890
- }
3891
- if (escapeCode && code) {
3892
- returnValue += wrapAnsiCode(code);
3893
- }
3894
- } else if (character === "\n") {
3895
- if (escapeCode && code) {
3896
- returnValue += wrapAnsiCode(escapeCode);
3897
- }
3898
- if (escapeUrl) {
3899
- returnValue += wrapAnsiHyperlink(escapeUrl);
3900
- }
3901
- }
3902
- }
3903
- return returnValue;
3904
- }, "exec");
3905
- function wrapAnsi(string, columns, options) {
3906
- return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
3907
- }
3908
- __name(wrapAnsi, "wrapAnsi");
3909
-
3910
- // src/node-logger/wrap-utils.ts
3911
- function getTerminalWidth() {
3912
- const defaultWidth = 80;
3913
- try {
3914
- return process.stdout.columns || defaultWidth;
3915
- } catch {
3916
- return defaultWidth;
3917
- }
3918
- }
3919
- __name(getTerminalWidth, "getTerminalWidth");
3920
- var ANSI_REGEX = /\u001b\[[0-9;]*m|\u001b\]8;;[^\u0007]*\u0007|\u001b\]8;;\u0007/g;
3921
- var URL_REGEX = /(https?:\/\/[^\s\u0000-\u001F\u007F]+)/g;
3922
- function stripAnsi2(str) {
3923
- return str.replace(ANSI_REGEX, "");
3924
- }
3925
- __name(stripAnsi2, "stripAnsi");
3926
- function getVisibleLength(str) {
3927
- return stripAnsi2(str).length;
3928
- }
3929
- __name(getVisibleLength, "getVisibleLength");
3930
- function getEnvFromTerminal(key) {
3931
- return execaSync("echo", [`$${key}`], { shell: true }).stdout.trim();
3932
- }
3933
- __name(getEnvFromTerminal, "getEnvFromTerminal");
3934
- function supportsHyperlinks() {
3935
- try {
3936
- const termProgram = getEnvFromTerminal("TERM_PROGRAM");
3937
- const termProgramVersion = getEnvFromTerminal("TERM_PROGRAM_VERSION");
3938
- switch (termProgram) {
3939
- case "iTerm.app":
3940
- if (termProgramVersion.trim()) {
3941
- const version = termProgramVersion.trim().split(".").map(Number);
3942
- return version[0] > 3 || version[0] === 3 && version[1] >= 1;
3943
- }
3944
- return true;
3945
- // Assume recent version
3946
- case "Apple_Terminal":
3947
- return false;
3948
- default:
3949
- return true;
3950
- }
3951
- } catch (error2) {
3952
- return false;
3953
- }
3954
- }
3955
- __name(supportsHyperlinks, "supportsHyperlinks");
3956
- function protectUrls(text2, options) {
3957
- const defaultMaxUrlLength = Math.floor(getTerminalWidth() * 0.8);
3958
- const maxLineWidth = options?.maxLineWidth ?? getTerminalWidth();
3959
- const useHyperlinks = supportsHyperlinks();
3960
- return text2.replace(URL_REGEX, (match, capturedUrl, offset) => {
3961
- if (!useHyperlinks) {
3962
- return match;
3963
- }
3964
- let searchPos = 0;
3965
- while (true) {
3966
- const hyperlinkStart = text2.indexOf("\x1B]8;;", searchPos);
3967
- if (hyperlinkStart === -1) {
3968
- break;
3969
- }
3970
- const hyperlinkEnd = text2.indexOf("\x1B]8;;\x07", hyperlinkStart);
3971
- if (hyperlinkEnd === -1) {
3972
- searchPos = hyperlinkStart + 1;
3973
- continue;
3974
- }
3975
- if (offset >= hyperlinkStart && offset < hyperlinkEnd + 7) {
3976
- return match;
3977
- }
3978
- searchPos = hyperlinkEnd + 1;
3979
- }
3980
- const textBeforeUrl = text2.substring(0, offset);
3981
- const lastNewlineIndex = textBeforeUrl.lastIndexOf("\n");
3982
- const currentLinePrefix = lastNewlineIndex === -1 ? textBeforeUrl : textBeforeUrl.substring(lastNewlineIndex + 1);
3983
- const prefixLength = getVisibleLength(currentLinePrefix);
3984
- const availableSpace = maxLineWidth - prefixLength;
3985
- const minUrlLength = 20;
3986
- const configuredMax = options?.maxUrlLength ?? defaultMaxUrlLength;
3987
- let effectiveMaxLength = Math.min(configuredMax, defaultMaxUrlLength, availableSpace);
3988
- if (capturedUrl.length <= minUrlLength) {
3989
- effectiveMaxLength = capturedUrl.length;
3990
- } else if (effectiveMaxLength < minUrlLength) {
3991
- effectiveMaxLength = capturedUrl.length;
3992
- }
3993
- if (capturedUrl.length > effectiveMaxLength) {
3994
- const truncatedText = capturedUrl.substring(0, effectiveMaxLength - 3) + "...";
3995
- return `\x1B]8;;${capturedUrl}\x07${truncatedText}\x1B]8;;\x07`;
3996
- }
3997
- return `\x1B]8;;${capturedUrl}\x07${capturedUrl}\x1B]8;;\x07`;
3998
- });
3999
- }
4000
- __name(protectUrls, "protectUrls");
4001
- function createHyperlink(title, url) {
4002
- if (supportsHyperlinks()) {
4003
- return `\x1B]8;;${url}\x07${title}\x1B]8;;\x07`;
4004
- }
4005
- return `${title}: ${url}`;
4006
- }
4007
- __name(createHyperlink, "createHyperlink");
4008
- function splitTextPreservingUrls(text2) {
4009
- const parts = [];
4010
- let lastIndex = 0;
4011
- let match;
4012
- URL_REGEX.lastIndex = 0;
4013
- while ((match = URL_REGEX.exec(text2)) !== null) {
4014
- if (match.index > lastIndex) {
4015
- const beforeUrl = text2.slice(lastIndex, match.index);
4016
- parts.push(...beforeUrl.split(" ").filter((part) => part.length > 0));
4017
- }
4018
- parts.push(match[0]);
4019
- lastIndex = match.index + match[0].length;
4020
- }
4021
- if (lastIndex < text2.length) {
4022
- const remaining = text2.slice(lastIndex);
4023
- parts.push(...remaining.split(" ").filter((part) => part.length > 0));
4024
- }
4025
- return parts;
4026
- }
4027
- __name(splitTextPreservingUrls, "splitTextPreservingUrls");
4028
- var MAX_OPTIMAL_WIDTH = 80;
4029
- function getOptimalWidth(width) {
4030
- return Math.min(width, MAX_OPTIMAL_WIDTH);
4031
- }
4032
- __name(getOptimalWidth, "getOptimalWidth");
4033
- function wrapTextForClack(text2, width) {
4034
- const terminalWidth = width || getTerminalWidth();
4035
- const contentWidth = Math.max(terminalWidth - 10, 40);
4036
- const maxOptimalWidth = getOptimalWidth(contentWidth);
4037
- const protectedText = protectUrls(text2, { maxLineWidth: maxOptimalWidth });
4038
- return wrapAnsi(protectedText, maxOptimalWidth);
4039
- }
4040
- __name(wrapTextForClack, "wrapTextForClack");
4041
- function wrapTextForClackHint(text2, width, label) {
4042
- const terminalWidth = width || getTerminalWidth();
4043
- const labelWidth = label ? getVisibleLength(label) : 0;
4044
- const reservedSpaceFirstLine = 8 + labelWidth;
4045
- const firstLineWidth = Math.min(
4046
- MAX_OPTIMAL_WIDTH - reservedSpaceFirstLine,
4047
- Math.max(terminalWidth - reservedSpaceFirstLine, 30)
4048
- );
4049
- const indentSpaces = 3 + 1;
4050
- const continuationLineWidth = getOptimalWidth(Math.max(terminalWidth - indentSpaces, 30));
4051
- const protectedText = protectUrls(text2, { maxLineWidth: continuationLineWidth });
4052
- const initialWrap = wrapAnsi(protectedText, continuationLineWidth);
4053
- const lines = initialWrap.split("\n");
4054
- if (lines.length > 0 && getVisibleLength(lines[0]) > firstLineWidth) {
4055
- const words = splitTextPreservingUrls(text2);
4056
- let firstLinePart = "";
4057
- let remainingPart = "";
4058
- for (let i = 0; i < words.length; i++) {
4059
- const testLine = i === 0 ? words[i] : firstLinePart + " " + words[i];
4060
- if (getVisibleLength(testLine) <= firstLineWidth) {
4061
- firstLinePart = testLine;
4062
- } else {
4063
- remainingPart = words.slice(i).join(" ");
4064
- break;
4065
- }
4066
- }
4067
- if (!firstLinePart && words.length > 0) {
4068
- firstLinePart = words[0];
4069
- remainingPart = words.slice(1).join(" ");
4070
- }
4071
- let finalLines = [firstLinePart];
4072
- if (remainingPart.trim()) {
4073
- const protectedRemainder = protectUrls(remainingPart.trim(), {
4074
- maxLineWidth: continuationLineWidth
4075
- });
4076
- const wrappedRemainder = wrapAnsi(protectedRemainder, continuationLineWidth);
4077
- finalLines = finalLines.concat(wrappedRemainder.split("\n"));
4078
- }
4079
- if (finalLines.length <= 1) {
4080
- return finalLines[0] || "";
4081
- }
4082
- const indentation2 = (0, import_picocolors3.reset)((0, import_picocolors3.cyan)(u)) + " ".repeat(indentSpaces);
4083
- return finalLines.map((line, index) => {
4084
- if (index === 0) {
4085
- return line;
4086
- }
4087
- return `${indentation2}${(0, import_picocolors3.dim)(line)}`;
4088
- }).join("\n");
4089
- }
4090
- if (lines.length <= 1) {
4091
- return initialWrap;
4092
- }
4093
- const indentation = (0, import_picocolors3.reset)((0, import_picocolors3.cyan)(u)) + " ".repeat(indentSpaces);
4094
- return lines.map((line, index) => {
4095
- if (index === 0) {
4096
- return line;
4097
- }
4098
- return `${indentation}${(0, import_picocolors3.dim)(line)}`;
4099
- }).join("\n");
4100
- }
4101
- __name(wrapTextForClackHint, "wrapTextForClackHint");
4102
-
4103
- // src/node-logger/logger/colors.ts
4104
- var import_picocolors4 = __toESM(require_picocolors(), 1);
4105
- var CLI_COLORS = {
4106
- success: import_picocolors4.default.green,
4107
- error: import_picocolors4.default.red,
4108
- warning: import_picocolors4.default.yellow,
4109
- info: import_picocolors4.default.blue,
4110
- debug: import_picocolors4.default.gray,
4111
- // Only color a link if it is the primary call to action, otherwise links shouldn't be colored
4112
- cta: import_picocolors4.default.cyan
4113
- };
4114
-
4115
- // src/node-logger/logger/logger.ts
4116
- var createLogFunction = /* @__PURE__ */ __name((clackFn, consoleFn) => () => isClackEnabled() ? (message) => {
4117
- if (currentTaskLog) {
4118
- currentTaskLog.message(message);
4119
- } else {
4120
- clackFn(wrapTextForClack(message));
4121
- }
4122
- } : consoleFn, "createLogFunction");
4123
- var LOG_FUNCTIONS = {
4124
- log: createLogFunction(b.message, console.log),
4125
- info: createLogFunction(b.info, console.log),
4126
- warn: createLogFunction(b.warn, console.warn),
4127
- error: createLogFunction(b.error, console.error),
4128
- intro: createLogFunction(bt2, console.log),
4129
- outro: createLogFunction(Dt, console.log),
4130
- step: createLogFunction(b.step, console.log)
4131
- };
4132
- var LOG_LEVELS = {
4133
- trace: 1,
4134
- debug: 2,
4135
- info: 3,
4136
- warn: 4,
4137
- error: 5,
4138
- silent: 10
4139
- };
4140
- var currentLogLevel = "info";
4141
- var setLogLevel = /* @__PURE__ */ __name((level) => {
4142
- currentLogLevel = level;
4143
- }, "setLogLevel");
4144
- var getLogLevel = /* @__PURE__ */ __name(() => {
4145
- return currentLogLevel;
4146
- }, "getLogLevel");
4147
- var shouldLog = /* @__PURE__ */ __name((level) => {
4148
- return LOG_LEVELS[currentLogLevel] <= LOG_LEVELS[level];
4149
- }, "shouldLog");
4150
- function getMinimalTrace() {
4151
- const stack = new Error().stack;
4152
- if (!stack) {
4153
- return;
4154
- }
4155
- const lines = stack.split("\n").slice(1);
4156
- const userStackLines = lines.filter(
4157
- (line) => !["getMinimalTrace", "createLogger", "logFunction"].some((fn) => line.includes(fn))
4158
- );
4159
- if (userStackLines.length === 0) {
4160
- return;
4161
- }
4162
- const callStack = "\n" + userStackLines.slice(0, 2).join("\n");
4163
- return callStack;
4164
- }
4165
- __name(getMinimalTrace, "getMinimalTrace");
4166
- var formatLogMessage = /* @__PURE__ */ __name((args) => {
4167
- return args.map((arg) => {
4168
- if (typeof arg === "string") {
4169
- return arg;
4170
- }
4171
- if (typeof arg === "object") {
4172
- return JSON.stringify(arg, null, 2);
4173
- }
4174
- return String(arg);
4175
- }).join(" ");
4176
- }, "formatLogMessage");
4177
- function createLogger(level, logFn, prefix) {
4178
- return /* @__PURE__ */ __name(function logFunction2(...args) {
4179
- const message = formatLogMessage(args);
4180
- logTracker.addLog(level, message);
4181
- if (level === "prompt") {
4182
- level = "info";
4183
- }
4184
- if (shouldLog(level)) {
4185
- const formattedMessage = prefix ? `${prefix} ${message}` : message;
4186
- logFn(formattedMessage);
4187
- }
4188
- }, "logFunction");
4189
- }
4190
- __name(createLogger, "createLogger");
4191
- var debug = createLogger(
4192
- "debug",
4193
- /* @__PURE__ */ __name(function logFunction(message) {
4194
- if (shouldLog("trace")) {
4195
- message += getMinimalTrace();
4196
- }
4197
- LOG_FUNCTIONS.log()(message);
4198
- }, "logFunction"),
4199
- "[DEBUG]"
4200
- );
4201
- var log = createLogger("info", (...args) => {
4202
- return LOG_FUNCTIONS.log()(...args);
4203
- });
4204
- var info = createLogger("info", (...args) => {
4205
- return LOG_FUNCTIONS.info()(...args);
4206
- });
4207
- var warn = createLogger("warn", (...args) => {
4208
- return LOG_FUNCTIONS.warn()(...args);
4209
- });
4210
- var error = createLogger("error", (...args) => {
4211
- return LOG_FUNCTIONS.error()(...args);
4212
- });
4213
- var logBox = /* @__PURE__ */ __name((message, options) => {
4214
- if (shouldLog("info")) {
4215
- logTracker.addLog("info", message);
4216
- if (isClackEnabled()) {
4217
- if (options?.title) {
4218
- log(options.title);
4219
- }
4220
- log(message);
4221
- } else {
4222
- console.log(
4223
- boxen(message, {
4224
- borderStyle: "round",
4225
- padding: 1,
4226
- borderColor: "#F1618C",
4227
- // pink
4228
- ...options
4229
- })
4230
- );
4231
- }
4232
- }
4233
- }, "logBox");
4234
- var intro = /* @__PURE__ */ __name((message) => {
4235
- logTracker.addLog("info", message);
4236
- console.log("\n");
4237
- LOG_FUNCTIONS.intro()(message);
4238
- }, "intro");
4239
- var outro = /* @__PURE__ */ __name((message) => {
4240
- logTracker.addLog("info", message);
4241
- LOG_FUNCTIONS.outro()(message);
4242
- console.log("\n");
4243
- }, "outro");
4244
- var step = /* @__PURE__ */ __name((message) => {
4245
- logTracker.addLog("info", message);
4246
- LOG_FUNCTIONS.step()(message);
4247
- }, "step");
4248
- var SYMBOLS = {
4249
- success: CLI_COLORS.success("\u2714"),
4250
- error: CLI_COLORS.error("\u2715")
4251
- };
4252
-
4253
- // src/node-logger/prompts/prompt-functions.ts
4254
- var prompt_functions_exports = {};
4255
- __export(prompt_functions_exports, {
4256
- confirm: () => confirm,
4257
- multiselect: () => multiselect,
4258
- select: () => select,
4259
- spinner: () => spinner,
4260
- taskLog: () => taskLog,
4261
- text: () => text
4262
- });
4263
- var activeSpinner = null;
4264
- var activeTaskLog = null;
4265
- var originalConsoleLog = null;
4266
- var patchConsoleLog = /* @__PURE__ */ __name(() => {
4267
- if (!originalConsoleLog) {
4268
- originalConsoleLog = console.log;
4269
- console.log = (...args) => {
4270
- const message = args.map((arg) => typeof arg === "string" ? arg : JSON.stringify(arg)).join(" ");
4271
- if (activeTaskLog) {
4272
- activeTaskLog.message(message);
4273
- } else if (activeSpinner) {
4274
- activeSpinner.message(message);
4275
- } else {
4276
- originalConsoleLog(...args);
4277
- }
4278
- };
4279
- }
4280
- }, "patchConsoleLog");
4281
- var restoreConsoleLog = /* @__PURE__ */ __name(() => {
4282
- if (originalConsoleLog && !activeSpinner && !activeTaskLog) {
4283
- console.log = originalConsoleLog;
4284
- originalConsoleLog = null;
4285
- }
4286
- }, "restoreConsoleLog");
4287
- var text = /* @__PURE__ */ __name(async (options, promptOptions) => {
4288
- return getPromptProvider().text(options, promptOptions);
4289
- }, "text");
4290
- var confirm = /* @__PURE__ */ __name(async (options, promptOptions) => {
4291
- return getPromptProvider().confirm(options, promptOptions);
4292
- }, "confirm");
4293
- var select = /* @__PURE__ */ __name(async (options, promptOptions) => {
4294
- return getPromptProvider().select(options, promptOptions);
4295
- }, "select");
4296
- var multiselect = /* @__PURE__ */ __name(async (options, promptOptions) => {
4297
- return getPromptProvider().multiselect(
4298
- {
4299
- ...options,
4300
- options: options.options.map((opt) => ({
4301
- ...opt,
4302
- hint: opt.hint ? wrapTextForClackHint(opt.hint, void 0, opt.label || String(opt.value)) : void 0
4303
- }))
4304
- },
4305
- promptOptions
4306
- );
4307
- }, "multiselect");
4308
- var spinner = /* @__PURE__ */ __name((options) => {
4309
- const spinnerInstance = getPromptProvider().spinner(options);
4310
- const wrappedSpinner = {
4311
- start: /* @__PURE__ */ __name((message) => {
4312
- activeSpinner = wrappedSpinner;
4313
- patchConsoleLog();
4314
- spinnerInstance.start(message);
4315
- }, "start"),
4316
- stop: /* @__PURE__ */ __name((message) => {
4317
- activeSpinner = null;
4318
- restoreConsoleLog();
4319
- spinnerInstance.stop(message);
4320
- }, "stop"),
4321
- message: /* @__PURE__ */ __name((text2) => {
4322
- spinnerInstance.message(text2);
4323
- }, "message")
4324
- };
4325
- return wrappedSpinner;
4326
- }, "spinner");
4327
- var taskLog = /* @__PURE__ */ __name((options) => {
4328
- const task = getPromptProvider().taskLog(options);
4329
- const wrappedTaskLog = {
4330
- message: /* @__PURE__ */ __name((message) => {
4331
- task.message(wrapTextForClack(message));
4332
- }, "message"),
4333
- success: /* @__PURE__ */ __name((message, options2) => {
4334
- activeTaskLog = null;
4335
- restoreConsoleLog();
4336
- task.success(message, options2);
4337
- }, "success"),
4338
- error: /* @__PURE__ */ __name((message) => {
4339
- activeTaskLog = null;
4340
- restoreConsoleLog();
4341
- task.error(message);
4342
- }, "error")
4343
- };
4344
- activeTaskLog = wrappedTaskLog;
4345
- patchConsoleLog();
4346
- return wrappedTaskLog;
4347
- }, "taskLog");
4348
-
4349
- // src/node-logger/tasks.ts
4350
- var executeTask = /* @__PURE__ */ __name(async (childProcessFactories, {
4351
- id,
4352
- intro: intro2,
4353
- error: error2,
4354
- success,
4355
- limitLines = 4
4356
- }) => {
4357
- logTracker.addLog("info", intro2);
4358
- const task = taskLog({
4359
- id,
4360
- title: intro2,
4361
- retainLog: false,
4362
- limit: limitLines
4363
- });
4364
- const factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
4365
- try {
4366
- for (const factory of factories) {
4367
- const childProcess = factory();
4368
- childProcess.stdout?.on("data", (data) => {
4369
- const message = data.toString().trim();
4370
- logTracker.addLog("info", message);
4371
- task.message(message);
4372
- });
4373
- await childProcess;
4374
- }
4375
- logTracker.addLog("info", success);
4376
- task.success(success);
4377
- } catch (err) {
4378
- const errorMessage = err instanceof Error ? err.stack ?? err.message : String(err);
4379
- logTracker.addLog("error", error2, { error: errorMessage });
4380
- task.error(error2);
4381
- throw err;
4382
- }
4383
- }, "executeTask");
4384
- var executeTaskWithSpinner = /* @__PURE__ */ __name(async (childProcessFactories, { id, intro: intro2, error: error2, success }) => {
4385
- logTracker.addLog("info", intro2);
4386
- const task = spinner({ id });
4387
- task.start(intro2);
4388
- const factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
4389
- try {
4390
- for (const factory of factories) {
4391
- const childProcess = factory();
4392
- childProcess.stdout?.on("data", (data) => {
4393
- const message = data.toString().trim().slice(0, 25);
4394
- logTracker.addLog("info", `${intro2}: ${data.toString()}`);
4395
- task.message(`${intro2}: ${message}`);
4396
- });
4397
- await childProcess;
4398
- }
4399
- logTracker.addLog("info", success);
4400
- task.stop(success);
4401
- } catch (err) {
4402
- logTracker.addLog("error", error2, { error: err });
4403
- task.stop(error2);
4404
- throw err;
4405
- }
4406
- }, "executeTaskWithSpinner");
4407
-
4408
- // src/node-logger/prompts/index.ts
4409
- var prompt = {
4410
- ...prompt_functions_exports,
4411
- ...prompt_config_exports,
4412
- executeTask,
4413
- executeTaskWithSpinner
4414
- };
4415
-
4416
- // src/node-logger/index.ts
4417
- import_npmlog.default.stream = process.stdout;
4418
- function hex(hexColor) {
4419
- if (!/^#?[0-9A-Fa-f]{6}$/.test(hexColor)) {
4420
- throw new Error("Invalid hex color. It must be a 6-character hex code.");
4421
- }
4422
- if (hexColor.startsWith("#")) {
4423
- hexColor = hexColor.slice(1);
4424
- }
4425
- const r = parseInt(hexColor.slice(0, 2), 16);
4426
- const g = parseInt(hexColor.slice(2, 4), 16);
4427
- const b2 = parseInt(hexColor.slice(4, 6), 16);
4428
- return (text2) => `\x1B[38;2;${r};${g};${b2}m${text2}\x1B[39m`;
4429
- }
4430
- __name(hex, "hex");
4431
- var colors = {
4432
- pink: hex("#F1618C"),
4433
- purple: hex("#B57EE5"),
4434
- orange: hex("#F3AD38"),
4435
- green: hex("#A2E05E"),
4436
- blue: hex("#6DABF5"),
4437
- red: hex("#F16161"),
4438
- gray: hex("#B8C2CC")
4439
- };
4440
- var logger = {
4441
- ...logger_exports,
4442
- verbose: /* @__PURE__ */ __name((message) => debug(message), "verbose"),
4443
- info: /* @__PURE__ */ __name((message) => isClackEnabled() ? info(message) : import_npmlog.default.info("", message), "info"),
4444
- plain: /* @__PURE__ */ __name((message) => log(message), "plain"),
4445
- line: /* @__PURE__ */ __name((count = 1) => log(`${Array(count - 1).fill("\n")}`), "line"),
4446
- warn: /* @__PURE__ */ __name((message) => warn(message), "warn"),
4447
- trace: /* @__PURE__ */ __name(({ message, time }) => debug(`${message} (${colors.purple((0, import_pretty_hrtime.default)(time))})`), "trace"),
4448
- setLevel: /* @__PURE__ */ __name((level = "info") => {
4449
- import_npmlog.default.level = level;
4450
- setLogLevel(level);
4451
- }, "setLevel"),
4452
- error: /* @__PURE__ */ __name((message) => {
4453
- let msg;
4454
- if (message instanceof Error && message.stack) {
4455
- msg = message.stack.toString().replace(message.toString(), colors.red(message.toString()));
4456
- } else if (typeof message === "string") {
4457
- msg = message.toString();
4458
- } else {
4459
- msg = String(message);
4460
- }
4461
- error(msg.replaceAll(process.cwd(), "."));
4462
- }, "error")
4463
- };
4464
- var logged = /* @__PURE__ */ new Set();
4465
- var once = /* @__PURE__ */ __name((type) => (message) => {
4466
- if (logged.has(message)) {
4467
- return void 0;
4468
- }
4469
- logged.add(message);
4470
- return logger[type](message);
4471
- }, "once");
4472
- once.clear = () => logged.clear();
4473
- once.verbose = once("verbose");
4474
- once.info = once("info");
4475
- once.warn = once("warn");
4476
- once.error = once("error");
4477
- var deprecate = once("warn");
13
+ CLI_COLORS,
14
+ ConsoleLogger,
15
+ StyledConsoleLogger,
16
+ colors,
17
+ createHyperlink,
18
+ deprecate,
19
+ import_npmlog,
20
+ logTracker,
21
+ logger,
22
+ once,
23
+ prompt,
24
+ protectUrls
25
+ } from "../_node-chunks/chunk-RURZIE3W.js";
26
+ import "../_node-chunks/chunk-XGNRK7QB.js";
27
+ import "../_node-chunks/chunk-2OVULPK3.js";
4478
28
  var export_instance = import_npmlog.default;
4479
29
  export {
4480
30
  CLI_COLORS,
31
+ ConsoleLogger,
32
+ StyledConsoleLogger,
4481
33
  colors,
4482
34
  createHyperlink,
4483
35
  deprecate,