storybook 10.1.0-alpha.8 → 10.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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-57OYTFQ5.js → builder-manager-BDAQHXFI.js} +510 -1019
  40. package/dist/_node-chunks/camelcase-3C7DZZPX.js +37 -0
  41. package/dist/_node-chunks/chunk-2IIQTGNE.js +6024 -0
  42. package/dist/_node-chunks/chunk-56U5LEMP.js +3043 -0
  43. package/dist/_node-chunks/chunk-7LIRCAQE.js +20 -0
  44. package/dist/_node-chunks/chunk-7RN6TXKP.js +603 -0
  45. package/dist/_node-chunks/chunk-7SJ7PZNL.js +4523 -0
  46. package/dist/_node-chunks/{chunk-2GK7NW46.js → chunk-BG4RDXG7.js} +8 -10
  47. package/dist/_node-chunks/chunk-CBQKMXLQ.js +18 -0
  48. package/dist/_node-chunks/chunk-CN2IW2KQ.js +1564 -0
  49. package/dist/_node-chunks/chunk-CQMAU6UQ.js +943 -0
  50. package/dist/_node-chunks/{chunk-RG4Z25PY.js → chunk-D6ND3TVY.js} +116 -276
  51. package/dist/_node-chunks/chunk-DC355CYB.js +61 -0
  52. package/dist/_node-chunks/{chunk-EBYCXVVR.js → chunk-EVK2SBW5.js} +292 -688
  53. package/dist/_node-chunks/chunk-IXWEUXJ2.js +119 -0
  54. package/dist/_node-chunks/{chunk-6F6CCOXH.js → chunk-KVRF22SH.js} +469 -983
  55. package/dist/_node-chunks/chunk-LEDP4QQW.js +919 -0
  56. package/dist/_node-chunks/{chunk-C4KEDJ6O.js → chunk-MMVV6DGG.js} +8133 -8887
  57. package/dist/_node-chunks/chunk-O5CGEVRI.js +29 -0
  58. package/dist/_node-chunks/chunk-OZZO56XN.js +299 -0
  59. package/dist/_node-chunks/chunk-POT2EVGD.js +78 -0
  60. package/dist/_node-chunks/chunk-R5YGFSTV.js +3781 -0
  61. package/dist/_node-chunks/chunk-SQCTM2OS.js +23 -0
  62. package/dist/_node-chunks/chunk-UFOFO5H7.js +54 -0
  63. package/dist/_node-chunks/chunk-VBF7ALJF.js +72 -0
  64. package/dist/_node-chunks/chunk-W6MAMTUF.js +70 -0
  65. package/dist/_node-chunks/chunk-WURL4XOT.js +46662 -0
  66. package/dist/_node-chunks/chunk-XGK6MVKR.js +61 -0
  67. package/dist/_node-chunks/chunk-YV3GDSDT.js +765 -0
  68. package/dist/_node-chunks/{chunk-RSHLCHYY.js → chunk-YWV55YW3.js} +15 -24
  69. package/dist/_node-chunks/dist-KEP4IFRN.js +121 -0
  70. package/dist/_node-chunks/globby-4WUBTDCN.js +3452 -0
  71. package/dist/_node-chunks/lib-JVOEKTYM.js +366 -0
  72. package/dist/_node-chunks/mdx-N42X6CFJ-C5WFYYXR.js +14329 -0
  73. package/dist/_node-chunks/p-limit-LDY632RS.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 +601 -1548
  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 +2910 -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 +11511 -10953
  106. package/dist/manager-api/index.d.ts +1811 -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-2KEDZHZ2.js +0 -18
  161. package/dist/_node-chunks/chunk-34NNXTBR.js +0 -28
  162. package/dist/_node-chunks/chunk-3N2A3KZX.js +0 -420
  163. package/dist/_node-chunks/chunk-5P7P5KDN.js +0 -90
  164. package/dist/_node-chunks/chunk-5WBRBDXI.js +0 -79
  165. package/dist/_node-chunks/chunk-7PWTU7T2.js +0 -697
  166. package/dist/_node-chunks/chunk-CHRHQ7AZ.js +0 -4272
  167. package/dist/_node-chunks/chunk-D4EGQLJI.js +0 -64656
  168. package/dist/_node-chunks/chunk-EKCURTKU.js +0 -1544
  169. package/dist/_node-chunks/chunk-GBVPPW4H.js +0 -1657
  170. package/dist/_node-chunks/chunk-J6VOKT2F.js +0 -220
  171. package/dist/_node-chunks/chunk-JLBYSGXS.js +0 -69
  172. package/dist/_node-chunks/chunk-LLCELSUL.js +0 -1198
  173. package/dist/_node-chunks/chunk-NS4OCQ4F.js +0 -61
  174. package/dist/_node-chunks/chunk-NXVLFYDR.js +0 -1518
  175. package/dist/_node-chunks/chunk-NZPWAJOZ.js +0 -304
  176. package/dist/_node-chunks/chunk-OYFSIV3I.js +0 -6712
  177. package/dist/_node-chunks/chunk-OZ43LMDF.js +0 -5029
  178. package/dist/_node-chunks/chunk-Q5HJHFF2.js +0 -61
  179. package/dist/_node-chunks/chunk-QHER4CEN.js +0 -34
  180. package/dist/_node-chunks/chunk-RF2PJM54.js +0 -1531
  181. package/dist/_node-chunks/chunk-S3OHGEE3.js +0 -101
  182. package/dist/_node-chunks/chunk-S5XOMVSV.js +0 -2256
  183. package/dist/_node-chunks/chunk-SGXQZ47H.js +0 -1586
  184. package/dist/_node-chunks/chunk-TDU6OVUH.js +0 -111
  185. package/dist/_node-chunks/chunk-TYQQFNQX.js +0 -1250
  186. package/dist/_node-chunks/chunk-WNGLARN2.js +0 -4741
  187. package/dist/_node-chunks/chunk-YUOVDCXL.js +0 -18
  188. package/dist/_node-chunks/dist-O5FB7YUW.js +0 -175
  189. package/dist/_node-chunks/globby-3NMV7WHX.js +0 -5222
  190. package/dist/_node-chunks/lib-VZD7BRSA.js +0 -518
  191. package/dist/_node-chunks/mdx-N42X6CFJ-3RP7RKKU.js +0 -22017
  192. package/dist/_node-chunks/p-limit-LIKBTXEJ.js +0 -168
  193. package/dist/_node-chunks/plugin-2NYZBK4A.js +0 -129
  194. package/dist/_node-chunks/plugin-6QGMO7J7.js +0 -159
  195. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-Z2JI6J2H.js +0 -69102
  196. package/dist/_node-chunks/webpack-mock-plugin-D4BE2SSI.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
@@ -0,0 +1,3781 @@
1
+ import CJS_COMPAT_NODE_URL_hjmvusgt1gv from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_hjmvusgt1gv from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_hjmvusgt1gv from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_hjmvusgt1gv.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_hjmvusgt1gv.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_hjmvusgt1gv.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ require_picocolors
14
+ } from "./chunk-YWV55YW3.js";
15
+ import {
16
+ __commonJS,
17
+ __export,
18
+ __require,
19
+ __toESM
20
+ } from "./chunk-UFOFO5H7.js";
21
+
22
+ // ../node_modules/are-we-there-yet/lib/tracker-base.js
23
+ var require_tracker_base = __commonJS({
24
+ "../node_modules/are-we-there-yet/lib/tracker-base.js"(exports, module) {
25
+ "use strict";
26
+ var EventEmitter = __require("events"), trackerId = 0, TrackerBase = class extends EventEmitter {
27
+ constructor(name) {
28
+ super(), this.id = ++trackerId, this.name = name;
29
+ }
30
+ };
31
+ module.exports = TrackerBase;
32
+ }
33
+ });
34
+
35
+ // ../node_modules/are-we-there-yet/lib/tracker.js
36
+ var require_tracker = __commonJS({
37
+ "../node_modules/are-we-there-yet/lib/tracker.js"(exports, module) {
38
+ "use strict";
39
+ var TrackerBase = require_tracker_base(), Tracker = class extends TrackerBase {
40
+ constructor(name, todo) {
41
+ super(name), this.workDone = 0, this.workTodo = todo || 0;
42
+ }
43
+ completed() {
44
+ return this.workTodo === 0 ? 0 : this.workDone / this.workTodo;
45
+ }
46
+ addWork(work) {
47
+ this.workTodo += work, this.emit("change", this.name, this.completed(), this);
48
+ }
49
+ completeWork(work) {
50
+ this.workDone += work, this.workDone > this.workTodo && (this.workDone = this.workTodo), this.emit("change", this.name, this.completed(), this);
51
+ }
52
+ finish() {
53
+ this.workTodo = this.workDone = 1, this.emit("change", this.name, 1, this);
54
+ }
55
+ };
56
+ module.exports = Tracker;
57
+ }
58
+ });
59
+
60
+ // ../node_modules/are-we-there-yet/lib/tracker-stream.js
61
+ var require_tracker_stream = __commonJS({
62
+ "../node_modules/are-we-there-yet/lib/tracker-stream.js"(exports, module) {
63
+ "use strict";
64
+ var stream = __require("stream"), Tracker = require_tracker(), TrackerStream = class extends stream.Transform {
65
+ constructor(name, size, options) {
66
+ super(options), this.tracker = new Tracker(name, size), this.name = name, this.id = this.tracker.id, this.tracker.on("change", this.trackerChange.bind(this));
67
+ }
68
+ trackerChange(name, completion) {
69
+ this.emit("change", name, completion, this);
70
+ }
71
+ _transform(data, encoding, cb) {
72
+ this.tracker.completeWork(data.length ? data.length : 1), this.push(data), cb();
73
+ }
74
+ _flush(cb) {
75
+ this.tracker.finish(), cb();
76
+ }
77
+ completed() {
78
+ return this.tracker.completed();
79
+ }
80
+ addWork(work) {
81
+ return this.tracker.addWork(work);
82
+ }
83
+ finish() {
84
+ return this.tracker.finish();
85
+ }
86
+ };
87
+ module.exports = TrackerStream;
88
+ }
89
+ });
90
+
91
+ // ../node_modules/are-we-there-yet/lib/tracker-group.js
92
+ var require_tracker_group = __commonJS({
93
+ "../node_modules/are-we-there-yet/lib/tracker-group.js"(exports, module) {
94
+ "use strict";
95
+ var TrackerBase = require_tracker_base(), Tracker = require_tracker(), TrackerStream = require_tracker_stream(), TrackerGroup = class _TrackerGroup extends TrackerBase {
96
+ parentGroup = null;
97
+ trackers = [];
98
+ completion = {};
99
+ weight = {};
100
+ totalWeight = 0;
101
+ finished = !1;
102
+ bubbleChange = bubbleChange(this);
103
+ nameInTree() {
104
+ for (var names = [], from = this; from; )
105
+ names.unshift(from.name), from = from.parentGroup;
106
+ return names.join("/");
107
+ }
108
+ addUnit(unit, weight) {
109
+ if (unit.addUnit) {
110
+ for (var toTest = this; toTest; ) {
111
+ if (unit === toTest)
112
+ throw new Error(
113
+ "Attempted to add tracker group " + unit.name + " to tree that already includes it " + this.nameInTree(this)
114
+ );
115
+ toTest = toTest.parentGroup;
116
+ }
117
+ unit.parentGroup = this;
118
+ }
119
+ return this.weight[unit.id] = weight || 1, this.totalWeight += this.weight[unit.id], this.trackers.push(unit), this.completion[unit.id] = unit.completed(), unit.on("change", this.bubbleChange), this.finished || this.emit("change", unit.name, this.completion[unit.id], unit), unit;
120
+ }
121
+ completed() {
122
+ if (this.trackers.length === 0)
123
+ return 0;
124
+ for (var valPerWeight = 1 / this.totalWeight, completed = 0, ii = 0; ii < this.trackers.length; ii++) {
125
+ var trackerId = this.trackers[ii].id;
126
+ completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId];
127
+ }
128
+ return completed;
129
+ }
130
+ newGroup(name, weight) {
131
+ return this.addUnit(new _TrackerGroup(name), weight);
132
+ }
133
+ newItem(name, todo, weight) {
134
+ return this.addUnit(new Tracker(name, todo), weight);
135
+ }
136
+ newStream(name, todo, weight) {
137
+ return this.addUnit(new TrackerStream(name, todo), weight);
138
+ }
139
+ finish() {
140
+ this.finished = !0, this.trackers.length || this.addUnit(new Tracker(), 1, !0);
141
+ for (var ii = 0; ii < this.trackers.length; ii++) {
142
+ var tracker = this.trackers[ii];
143
+ tracker.finish(), tracker.removeListener("change", this.bubbleChange);
144
+ }
145
+ this.emit("change", this.name, 1, this);
146
+ }
147
+ debug(depth = 0) {
148
+ let indent = " ".repeat(depth), output = `${indent}${this.name || "top"}: ${this.completed()}
149
+ `;
150
+ return this.trackers.forEach(function(tracker) {
151
+ output += tracker instanceof _TrackerGroup ? tracker.debug(depth + 1) : `${indent} ${tracker.name}: ${tracker.completed()}
152
+ `;
153
+ }), output;
154
+ }
155
+ };
156
+ function bubbleChange(trackerGroup) {
157
+ return function(name, completed, tracker) {
158
+ trackerGroup.completion[tracker.id] = completed, !trackerGroup.finished && trackerGroup.emit("change", name || trackerGroup.name, trackerGroup.completed(), trackerGroup);
159
+ };
160
+ }
161
+ module.exports = TrackerGroup;
162
+ }
163
+ });
164
+
165
+ // ../node_modules/are-we-there-yet/lib/index.js
166
+ var require_lib = __commonJS({
167
+ "../node_modules/are-we-there-yet/lib/index.js"(exports) {
168
+ "use strict";
169
+ exports.TrackerGroup = require_tracker_group();
170
+ exports.Tracker = require_tracker();
171
+ exports.TrackerStream = require_tracker_stream();
172
+ }
173
+ });
174
+
175
+ // ../node_modules/console-control-strings/index.js
176
+ var require_console_control_strings = __commonJS({
177
+ "../node_modules/console-control-strings/index.js"(exports) {
178
+ "use strict";
179
+ var prefix = "\x1B[";
180
+ exports.up = function(num) {
181
+ return prefix + (num || "") + "A";
182
+ };
183
+ exports.down = function(num) {
184
+ return prefix + (num || "") + "B";
185
+ };
186
+ exports.forward = function(num) {
187
+ return prefix + (num || "") + "C";
188
+ };
189
+ exports.back = function(num) {
190
+ return prefix + (num || "") + "D";
191
+ };
192
+ exports.nextLine = function(num) {
193
+ return prefix + (num || "") + "E";
194
+ };
195
+ exports.previousLine = function(num) {
196
+ return prefix + (num || "") + "F";
197
+ };
198
+ exports.horizontalAbsolute = function(num) {
199
+ if (num == null) throw new Error("horizontalAboslute requires a column to position to");
200
+ return prefix + num + "G";
201
+ };
202
+ exports.eraseData = function() {
203
+ return prefix + "J";
204
+ };
205
+ exports.eraseLine = function() {
206
+ return prefix + "K";
207
+ };
208
+ exports.goto = function(x2, y2) {
209
+ return prefix + y2 + ";" + x2 + "H";
210
+ };
211
+ exports.gotoSOL = function() {
212
+ return "\r";
213
+ };
214
+ exports.beep = function() {
215
+ return "\x07";
216
+ };
217
+ exports.hideCursor = function() {
218
+ return prefix + "?25l";
219
+ };
220
+ exports.showCursor = function() {
221
+ return prefix + "?25h";
222
+ };
223
+ var colors2 = {
224
+ reset: 0,
225
+ // styles
226
+ bold: 1,
227
+ italic: 3,
228
+ underline: 4,
229
+ inverse: 7,
230
+ // resets
231
+ stopBold: 22,
232
+ stopItalic: 23,
233
+ stopUnderline: 24,
234
+ stopInverse: 27,
235
+ // colors
236
+ white: 37,
237
+ black: 30,
238
+ blue: 34,
239
+ cyan: 36,
240
+ green: 32,
241
+ magenta: 35,
242
+ red: 31,
243
+ yellow: 33,
244
+ bgWhite: 47,
245
+ bgBlack: 40,
246
+ bgBlue: 44,
247
+ bgCyan: 46,
248
+ bgGreen: 42,
249
+ bgMagenta: 45,
250
+ bgRed: 41,
251
+ bgYellow: 43,
252
+ grey: 90,
253
+ brightBlack: 90,
254
+ brightRed: 91,
255
+ brightGreen: 92,
256
+ brightYellow: 93,
257
+ brightBlue: 94,
258
+ brightMagenta: 95,
259
+ brightCyan: 96,
260
+ brightWhite: 97,
261
+ bgGrey: 100,
262
+ bgBrightBlack: 100,
263
+ bgBrightRed: 101,
264
+ bgBrightGreen: 102,
265
+ bgBrightYellow: 103,
266
+ bgBrightBlue: 104,
267
+ bgBrightMagenta: 105,
268
+ bgBrightCyan: 106,
269
+ bgBrightWhite: 107
270
+ };
271
+ exports.color = function(colorWith) {
272
+ return (arguments.length !== 1 || !Array.isArray(colorWith)) && (colorWith = Array.prototype.slice.call(arguments)), prefix + colorWith.map(colorNameToCode).join(";") + "m";
273
+ };
274
+ function colorNameToCode(color) {
275
+ if (colors2[color] != null) return colors2[color];
276
+ throw new Error("Unknown color or style name: " + color);
277
+ }
278
+ }
279
+ });
280
+
281
+ // ../node_modules/string-width/node_modules/ansi-regex/index.js
282
+ var require_ansi_regex = __commonJS({
283
+ "../node_modules/string-width/node_modules/ansi-regex/index.js"(exports, module) {
284
+ "use strict";
285
+ module.exports = ({ onlyFirst = !1 } = {}) => {
286
+ let pattern = [
287
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
288
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
289
+ ].join("|");
290
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
291
+ };
292
+ }
293
+ });
294
+
295
+ // ../node_modules/string-width/node_modules/strip-ansi/index.js
296
+ var require_strip_ansi = __commonJS({
297
+ "../node_modules/string-width/node_modules/strip-ansi/index.js"(exports, module) {
298
+ "use strict";
299
+ var ansiRegex2 = require_ansi_regex();
300
+ module.exports = (string) => typeof string == "string" ? string.replace(ansiRegex2(), "") : string;
301
+ }
302
+ });
303
+
304
+ // ../node_modules/is-fullwidth-code-point/index.js
305
+ var require_is_fullwidth_code_point = __commonJS({
306
+ "../node_modules/is-fullwidth-code-point/index.js"(exports, module) {
307
+ "use strict";
308
+ var isFullwidthCodePoint = (codePoint) => Number.isNaN(codePoint) ? !1 : codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
309
+ codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
310
+ codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
311
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
312
+ 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
313
+ 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
314
+ 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
315
+ 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
316
+ 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
317
+ 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
318
+ 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
319
+ 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
320
+ 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
321
+ 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
322
+ 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
323
+ 131072 <= codePoint && codePoint <= 262141);
324
+ module.exports = isFullwidthCodePoint;
325
+ module.exports.default = isFullwidthCodePoint;
326
+ }
327
+ });
328
+
329
+ // ../node_modules/string-width/node_modules/emoji-regex/index.js
330
+ var require_emoji_regex = __commonJS({
331
+ "../node_modules/string-width/node_modules/emoji-regex/index.js"(exports, module) {
332
+ "use strict";
333
+ module.exports = function() {
334
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
335
+ };
336
+ }
337
+ });
338
+
339
+ // ../node_modules/string-width/index.js
340
+ var require_string_width = __commonJS({
341
+ "../node_modules/string-width/index.js"(exports, module) {
342
+ "use strict";
343
+ var stripAnsi3 = require_strip_ansi(), isFullwidthCodePoint = require_is_fullwidth_code_point(), emojiRegex2 = require_emoji_regex(), stringWidth2 = (string) => {
344
+ if (typeof string != "string" || string.length === 0 || (string = stripAnsi3(string), string.length === 0))
345
+ return 0;
346
+ string = string.replace(emojiRegex2(), " ");
347
+ let width = 0;
348
+ for (let i = 0; i < string.length; i++) {
349
+ let code = string.codePointAt(i);
350
+ code <= 31 || code >= 127 && code <= 159 || code >= 768 && code <= 879 || (code > 65535 && i++, width += isFullwidthCodePoint(code) ? 2 : 1);
351
+ }
352
+ return width;
353
+ };
354
+ module.exports = stringWidth2;
355
+ module.exports.default = stringWidth2;
356
+ }
357
+ });
358
+
359
+ // ../node_modules/wide-align/align.js
360
+ var require_align = __commonJS({
361
+ "../node_modules/wide-align/align.js"(exports) {
362
+ "use strict";
363
+ var stringWidth2 = require_string_width();
364
+ exports.center = alignCenter;
365
+ exports.left = alignLeft;
366
+ exports.right = alignRight;
367
+ function createPadding(width) {
368
+ var result = "", string = " ", n = width;
369
+ do
370
+ n % 2 && (result += string), n = Math.floor(n / 2), string += string;
371
+ while (n);
372
+ return result;
373
+ }
374
+ function alignLeft(str, width) {
375
+ var trimmed = str.trimRight();
376
+ if (trimmed.length === 0 && str.length >= width) return str;
377
+ var padding = "", strWidth = stringWidth2(trimmed);
378
+ return strWidth < width && (padding = createPadding(width - strWidth)), trimmed + padding;
379
+ }
380
+ function alignRight(str, width) {
381
+ var trimmed = str.trimLeft();
382
+ if (trimmed.length === 0 && str.length >= width) return str;
383
+ var padding = "", strWidth = stringWidth2(trimmed);
384
+ return strWidth < width && (padding = createPadding(width - strWidth)), padding + trimmed;
385
+ }
386
+ function alignCenter(str, width) {
387
+ var trimmed = str.trim();
388
+ if (trimmed.length === 0 && str.length >= width) return str;
389
+ var padLeft = "", padRight = "", strWidth = stringWidth2(trimmed);
390
+ if (strWidth < width) {
391
+ var padLeftBy = parseInt((width - strWidth) / 2, 10);
392
+ padLeft = createPadding(padLeftBy), padRight = createPadding(width - (strWidth + padLeftBy));
393
+ }
394
+ return padLeft + trimmed + padRight;
395
+ }
396
+ }
397
+ });
398
+
399
+ // ../node_modules/aproba/index.js
400
+ var require_aproba = __commonJS({
401
+ "../node_modules/aproba/index.js"(exports, module) {
402
+ "use strict";
403
+ module.exports = validate;
404
+ function isArguments(thingy) {
405
+ return thingy != null && typeof thingy == "object" && thingy.hasOwnProperty("callee");
406
+ }
407
+ var types = {
408
+ "*": { label: "any", check: () => !0 },
409
+ A: { label: "array", check: (_) => Array.isArray(_) || isArguments(_) },
410
+ S: { label: "string", check: (_) => typeof _ == "string" },
411
+ N: { label: "number", check: (_) => typeof _ == "number" },
412
+ F: { label: "function", check: (_) => typeof _ == "function" },
413
+ O: { label: "object", check: (_) => typeof _ == "object" && _ != null && !types.A.check(_) && !types.E.check(_) },
414
+ B: { label: "boolean", check: (_) => typeof _ == "boolean" },
415
+ E: { label: "error", check: (_) => _ instanceof Error },
416
+ Z: { label: "null", check: (_) => _ == null }
417
+ };
418
+ function addSchema(schema, arity) {
419
+ let group = arity[schema.length] = arity[schema.length] || [];
420
+ group.indexOf(schema) === -1 && group.push(schema);
421
+ }
422
+ function validate(rawSchemas, args) {
423
+ if (arguments.length !== 2) throw wrongNumberOfArgs(["SA"], arguments.length);
424
+ if (!rawSchemas) throw missingRequiredArg(0, "rawSchemas");
425
+ if (!args) throw missingRequiredArg(1, "args");
426
+ if (!types.S.check(rawSchemas)) throw invalidType(0, ["string"], rawSchemas);
427
+ if (!types.A.check(args)) throw invalidType(1, ["array"], args);
428
+ let schemas = rawSchemas.split("|"), arity = {};
429
+ schemas.forEach((schema) => {
430
+ for (let ii = 0; ii < schema.length; ++ii) {
431
+ let type = schema[ii];
432
+ if (!types[type]) throw unknownType(ii, type);
433
+ }
434
+ if (/E.*E/.test(schema)) throw moreThanOneError(schema);
435
+ addSchema(schema, arity), /E/.test(schema) && (addSchema(schema.replace(/E.*$/, "E"), arity), addSchema(schema.replace(/E/, "Z"), arity), schema.length === 1 && addSchema("", arity));
436
+ });
437
+ let matching = arity[args.length];
438
+ if (!matching)
439
+ throw wrongNumberOfArgs(Object.keys(arity), args.length);
440
+ for (let ii = 0; ii < args.length; ++ii) {
441
+ let newMatching = matching.filter((schema) => {
442
+ let type = schema[ii], typeCheck = types[type].check;
443
+ return typeCheck(args[ii]);
444
+ });
445
+ if (!newMatching.length) {
446
+ let labels = matching.map((_) => types[_[ii]].label).filter((_) => _ != null);
447
+ throw invalidType(ii, labels, args[ii]);
448
+ }
449
+ matching = newMatching;
450
+ }
451
+ }
452
+ function missingRequiredArg(num) {
453
+ return newException("EMISSINGARG", "Missing required argument #" + (num + 1));
454
+ }
455
+ function unknownType(num, type) {
456
+ return newException("EUNKNOWNTYPE", "Unknown type " + type + " in argument #" + (num + 1));
457
+ }
458
+ function invalidType(num, expectedTypes, value) {
459
+ let valueType;
460
+ return Object.keys(types).forEach((typeCode) => {
461
+ types[typeCode].check(value) && (valueType = types[typeCode].label);
462
+ }), newException("EINVALIDTYPE", "Argument #" + (num + 1) + ": Expected " + englishList(expectedTypes) + " but got " + valueType);
463
+ }
464
+ function englishList(list) {
465
+ return list.join(", ").replace(/, ([^,]+)$/, " or $1");
466
+ }
467
+ function wrongNumberOfArgs(expected, got) {
468
+ let english = englishList(expected), args = expected.every((ex) => ex.length === 1) ? "argument" : "arguments";
469
+ return newException("EWRONGARGCOUNT", "Expected " + english + " " + args + " but got " + got);
470
+ }
471
+ function moreThanOneError(schema) {
472
+ return newException(
473
+ "ETOOMANYERRORTYPES",
474
+ 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"'
475
+ );
476
+ }
477
+ function newException(code, msg) {
478
+ let err = new TypeError(msg);
479
+ return err.code = code, Error.captureStackTrace && Error.captureStackTrace(err, validate), err;
480
+ }
481
+ }
482
+ });
483
+
484
+ // ../node_modules/gauge/node_modules/ansi-regex/index.js
485
+ var require_ansi_regex2 = __commonJS({
486
+ "../node_modules/gauge/node_modules/ansi-regex/index.js"(exports, module) {
487
+ "use strict";
488
+ module.exports = ({ onlyFirst = !1 } = {}) => {
489
+ let pattern = [
490
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
491
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
492
+ ].join("|");
493
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
494
+ };
495
+ }
496
+ });
497
+
498
+ // ../node_modules/gauge/node_modules/strip-ansi/index.js
499
+ var require_strip_ansi2 = __commonJS({
500
+ "../node_modules/gauge/node_modules/strip-ansi/index.js"(exports, module) {
501
+ "use strict";
502
+ var ansiRegex2 = require_ansi_regex2();
503
+ module.exports = (string) => typeof string == "string" ? string.replace(ansiRegex2(), "") : string;
504
+ }
505
+ });
506
+
507
+ // ../node_modules/gauge/lib/wide-truncate.js
508
+ var require_wide_truncate = __commonJS({
509
+ "../node_modules/gauge/lib/wide-truncate.js"(exports, module) {
510
+ "use strict";
511
+ var stringWidth2 = require_string_width(), stripAnsi3 = require_strip_ansi2();
512
+ module.exports = wideTruncate;
513
+ function wideTruncate(str, target) {
514
+ if (stringWidth2(str) === 0)
515
+ return str;
516
+ if (target <= 0)
517
+ return "";
518
+ if (stringWidth2(str) <= target)
519
+ return str;
520
+ for (var noAnsi = stripAnsi3(str), ansiSize = str.length + noAnsi.length, truncated = str.slice(0, target + ansiSize); stringWidth2(truncated) > target; )
521
+ truncated = truncated.slice(0, -1);
522
+ return truncated;
523
+ }
524
+ }
525
+ });
526
+
527
+ // ../node_modules/gauge/lib/error.js
528
+ var require_error = __commonJS({
529
+ "../node_modules/gauge/lib/error.js"(exports) {
530
+ "use strict";
531
+ var util = __require("util"), User = exports.User = function User2(msg) {
532
+ var err = new Error(msg);
533
+ return Error.captureStackTrace(err, User2), err.code = "EGAUGE", err;
534
+ };
535
+ exports.MissingTemplateValue = function MissingTemplateValue(item, values) {
536
+ var err = new User(util.format('Missing template value "%s"', item.type));
537
+ return Error.captureStackTrace(err, MissingTemplateValue), err.template = item, err.values = values, err;
538
+ };
539
+ exports.Internal = function Internal(msg) {
540
+ var err = new Error(msg);
541
+ return Error.captureStackTrace(err, Internal), err.code = "EGAUGEINTERNAL", err;
542
+ };
543
+ }
544
+ });
545
+
546
+ // ../node_modules/gauge/lib/template-item.js
547
+ var require_template_item = __commonJS({
548
+ "../node_modules/gauge/lib/template-item.js"(exports, module) {
549
+ "use strict";
550
+ var stringWidth2 = require_string_width();
551
+ module.exports = TemplateItem;
552
+ function isPercent(num) {
553
+ return typeof num != "string" ? !1 : num.slice(-1) === "%";
554
+ }
555
+ function percent(num) {
556
+ return Number(num.slice(0, -1)) / 100;
557
+ }
558
+ function TemplateItem(values, outputLength) {
559
+ if (this.overallOutputLength = outputLength, this.finished = !1, this.type = null, this.value = null, this.length = null, this.maxLength = null, this.minLength = null, this.kerning = null, this.align = "left", this.padLeft = 0, this.padRight = 0, this.index = null, this.first = null, this.last = null, typeof values == "string")
560
+ this.value = values;
561
+ else
562
+ for (var prop in values)
563
+ this[prop] = values[prop];
564
+ return isPercent(this.length) && (this.length = Math.round(this.overallOutputLength * percent(this.length))), isPercent(this.minLength) && (this.minLength = Math.round(this.overallOutputLength * percent(this.minLength))), isPercent(this.maxLength) && (this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength))), this;
565
+ }
566
+ TemplateItem.prototype = {};
567
+ TemplateItem.prototype.getBaseLength = function() {
568
+ var length = this.length;
569
+ return length == null && typeof this.value == "string" && this.maxLength == null && this.minLength == null && (length = stringWidth2(this.value)), length;
570
+ };
571
+ TemplateItem.prototype.getLength = function() {
572
+ var length = this.getBaseLength();
573
+ return length == null ? null : length + this.padLeft + this.padRight;
574
+ };
575
+ TemplateItem.prototype.getMaxLength = function() {
576
+ return this.maxLength == null ? null : this.maxLength + this.padLeft + this.padRight;
577
+ };
578
+ TemplateItem.prototype.getMinLength = function() {
579
+ return this.minLength == null ? null : this.minLength + this.padLeft + this.padRight;
580
+ };
581
+ }
582
+ });
583
+
584
+ // ../node_modules/gauge/lib/render-template.js
585
+ var require_render_template = __commonJS({
586
+ "../node_modules/gauge/lib/render-template.js"(exports, module) {
587
+ "use strict";
588
+ var align = require_align(), validate = require_aproba(), wideTruncate = require_wide_truncate(), error2 = require_error(), TemplateItem = require_template_item();
589
+ function renderValueWithValues(values) {
590
+ return function(item) {
591
+ return renderValue(item, values);
592
+ };
593
+ }
594
+ var renderTemplate = module.exports = function(width, template, values) {
595
+ var items = prepareItems(width, template, values), rendered = items.map(renderValueWithValues(values)).join("");
596
+ return align.left(wideTruncate(rendered, width), width);
597
+ };
598
+ function preType(item) {
599
+ var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1);
600
+ return "pre" + cappedTypeName;
601
+ }
602
+ function postType(item) {
603
+ var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1);
604
+ return "post" + cappedTypeName;
605
+ }
606
+ function hasPreOrPost(item, values) {
607
+ if (item.type)
608
+ return values[preType(item)] || values[postType(item)];
609
+ }
610
+ function generatePreAndPost(baseItem, parentValues) {
611
+ var item = Object.assign({}, baseItem), values = Object.create(parentValues), template = [], pre = preType(item), post = postType(item);
612
+ return values[pre] && (template.push({ value: values[pre] }), values[pre] = null), item.minLength = null, item.length = null, item.maxLength = null, template.push(item), values[item.type] = values[item.type], values[post] && (template.push({ value: values[post] }), values[post] = null), function($1, $2, length) {
613
+ return renderTemplate(length, template, values);
614
+ };
615
+ }
616
+ function prepareItems(width, template, values) {
617
+ function cloneAndObjectify(item, index, arr) {
618
+ var cloned = new TemplateItem(item, width), type = cloned.type;
619
+ if (cloned.value == null)
620
+ if (type in values)
621
+ cloned.value = values[type];
622
+ else {
623
+ if (cloned.default == null)
624
+ throw new error2.MissingTemplateValue(cloned, values);
625
+ cloned.value = cloned.default;
626
+ }
627
+ return cloned.value == null || cloned.value === "" ? null : (cloned.index = index, cloned.first = index === 0, cloned.last = index === arr.length - 1, hasPreOrPost(cloned, values) && (cloned.value = generatePreAndPost(cloned, values)), cloned);
628
+ }
629
+ var output = template.map(cloneAndObjectify).filter(function(item) {
630
+ return item != null;
631
+ }), remainingSpace = width, variableCount = output.length;
632
+ function consumeSpace(length) {
633
+ length > remainingSpace && (length = remainingSpace), remainingSpace -= length;
634
+ }
635
+ function finishSizing(item, length) {
636
+ if (item.finished)
637
+ throw new error2.Internal("Tried to finish template item that was already finished");
638
+ if (length === 1 / 0)
639
+ throw new error2.Internal("Length of template item cannot be infinity");
640
+ if (length != null && (item.length = length), item.minLength = null, item.maxLength = null, --variableCount, item.finished = !0, item.length == null && (item.length = item.getBaseLength()), item.length == null)
641
+ throw new error2.Internal("Finished template items must have a length");
642
+ consumeSpace(item.getLength());
643
+ }
644
+ output.forEach(function(item) {
645
+ if (item.kerning) {
646
+ var prevPadRight = item.first ? 0 : output[item.index - 1].padRight;
647
+ !item.first && prevPadRight < item.kerning && (item.padLeft = item.kerning - prevPadRight), item.last || (item.padRight = item.kerning);
648
+ }
649
+ }), output.forEach(function(item) {
650
+ item.getBaseLength() != null && finishSizing(item);
651
+ });
652
+ var resized = 0, resizing, hunkSize;
653
+ do
654
+ resizing = !1, hunkSize = Math.round(remainingSpace / variableCount), output.forEach(function(item) {
655
+ item.finished || item.maxLength && item.getMaxLength() < hunkSize && (finishSizing(item, item.maxLength), resizing = !0);
656
+ });
657
+ while (resizing && resized++ < output.length);
658
+ if (resizing)
659
+ throw new error2.Internal("Resize loop iterated too many times while determining maxLength");
660
+ resized = 0;
661
+ do
662
+ resizing = !1, hunkSize = Math.round(remainingSpace / variableCount), output.forEach(function(item) {
663
+ item.finished || item.minLength && item.getMinLength() >= hunkSize && (finishSizing(item, item.minLength), resizing = !0);
664
+ });
665
+ while (resizing && resized++ < output.length);
666
+ if (resizing)
667
+ throw new error2.Internal("Resize loop iterated too many times while determining minLength");
668
+ return hunkSize = Math.round(remainingSpace / variableCount), output.forEach(function(item) {
669
+ item.finished || finishSizing(item, hunkSize);
670
+ }), output;
671
+ }
672
+ function renderFunction(item, values, length) {
673
+ return validate("OON", arguments), item.type ? item.value(values, values[item.type + "Theme"] || {}, length) : item.value(values, {}, length);
674
+ }
675
+ function renderValue(item, values) {
676
+ var length = item.getBaseLength(), value = typeof item.value == "function" ? renderFunction(item, values, length) : item.value;
677
+ if (value == null || value === "")
678
+ return "";
679
+ var alignWith = align[item.align] || align.left, leftPadding = item.padLeft ? align.left("", item.padLeft) : "", rightPadding = item.padRight ? align.right("", item.padRight) : "", truncated = wideTruncate(String(value), length), aligned = alignWith(truncated, length);
680
+ return leftPadding + aligned + rightPadding;
681
+ }
682
+ }
683
+ });
684
+
685
+ // ../node_modules/gauge/lib/plumbing.js
686
+ var require_plumbing = __commonJS({
687
+ "../node_modules/gauge/lib/plumbing.js"(exports, module) {
688
+ "use strict";
689
+ var consoleControl = require_console_control_strings(), renderTemplate = require_render_template(), validate = require_aproba(), Plumbing = module.exports = function(theme, template, width) {
690
+ width || (width = 80), validate("OAN", [theme, template, width]), this.showing = !1, this.theme = theme, this.width = width, this.template = template;
691
+ };
692
+ Plumbing.prototype = {};
693
+ Plumbing.prototype.setTheme = function(theme) {
694
+ validate("O", [theme]), this.theme = theme;
695
+ };
696
+ Plumbing.prototype.setTemplate = function(template) {
697
+ validate("A", [template]), this.template = template;
698
+ };
699
+ Plumbing.prototype.setWidth = function(width) {
700
+ validate("N", [width]), this.width = width;
701
+ };
702
+ Plumbing.prototype.hide = function() {
703
+ return consoleControl.gotoSOL() + consoleControl.eraseLine();
704
+ };
705
+ Plumbing.prototype.hideCursor = consoleControl.hideCursor;
706
+ Plumbing.prototype.showCursor = consoleControl.showCursor;
707
+ Plumbing.prototype.show = function(status) {
708
+ var values = Object.create(this.theme);
709
+ for (var key in status)
710
+ values[key] = status[key];
711
+ return renderTemplate(this.width, this.template, values).trim() + consoleControl.color("reset") + consoleControl.eraseLine() + consoleControl.gotoSOL();
712
+ };
713
+ }
714
+ });
715
+
716
+ // ../node_modules/has-unicode/index.js
717
+ var require_has_unicode = __commonJS({
718
+ "../node_modules/has-unicode/index.js"(exports, module) {
719
+ "use strict";
720
+ var os = __require("os"), hasUnicode = module.exports = function() {
721
+ if (os.type() == "Windows_NT")
722
+ return !1;
723
+ var isUTF8 = /UTF-?8$/i, ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG;
724
+ return isUTF8.test(ctype);
725
+ };
726
+ }
727
+ });
728
+
729
+ // ../node_modules/color-support/index.js
730
+ var require_color_support = __commonJS({
731
+ "../node_modules/color-support/index.js"(exports, module) {
732
+ module.exports = colorSupport({ alwaysReturn: !0 }, colorSupport);
733
+ function hasNone(obj, options) {
734
+ return obj.level = 0, obj.hasBasic = !1, obj.has256 = !1, obj.has16m = !1, options.alwaysReturn ? obj : !1;
735
+ }
736
+ function hasBasic(obj) {
737
+ return obj.hasBasic = !0, obj.has256 = !1, obj.has16m = !1, obj.level = 1, obj;
738
+ }
739
+ function has256(obj) {
740
+ return obj.hasBasic = !0, obj.has256 = !0, obj.has16m = !1, obj.level = 2, obj;
741
+ }
742
+ function has16m(obj) {
743
+ return obj.hasBasic = !0, obj.has256 = !0, obj.has16m = !0, obj.level = 3, obj;
744
+ }
745
+ function colorSupport(options, obj) {
746
+ if (options = options || {}, obj = obj || {}, typeof options.level == "number")
747
+ switch (options.level) {
748
+ case 0:
749
+ return hasNone(obj, options);
750
+ case 1:
751
+ return hasBasic(obj);
752
+ case 2:
753
+ return has256(obj);
754
+ case 3:
755
+ return has16m(obj);
756
+ }
757
+ if (obj.level = 0, obj.hasBasic = !1, obj.has256 = !1, obj.has16m = !1, typeof process > "u" || !process || !process.stdout || !process.env || !process.platform)
758
+ return hasNone(obj, options);
759
+ var env = options.env || process.env, stream = options.stream || process.stdout, term = options.term || env.TERM || "", platform = options.platform || process.platform;
760
+ if (!options.ignoreTTY && !stream.isTTY || !options.ignoreDumb && term === "dumb" && !env.COLORTERM)
761
+ return hasNone(obj, options);
762
+ if (platform === "win32")
763
+ return hasBasic(obj);
764
+ if (env.TMUX)
765
+ return has256(obj);
766
+ if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION))
767
+ return env.TRAVIS ? has256(obj) : hasNone(obj, options);
768
+ switch (env.TERM_PROGRAM) {
769
+ case "iTerm.app":
770
+ var ver = env.TERM_PROGRAM_VERSION || "0.";
771
+ return /^[0-2]\./.test(ver) ? has256(obj) : has16m(obj);
772
+ case "HyperTerm":
773
+ case "Hyper":
774
+ return has16m(obj);
775
+ case "MacTerm":
776
+ return has16m(obj);
777
+ case "Apple_Terminal":
778
+ return has256(obj);
779
+ }
780
+ return /^xterm-256/.test(term) ? has256(obj) : /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term) || env.COLORTERM ? hasBasic(obj) : hasNone(obj, options);
781
+ }
782
+ }
783
+ });
784
+
785
+ // ../node_modules/gauge/lib/has-color.js
786
+ var require_has_color = __commonJS({
787
+ "../node_modules/gauge/lib/has-color.js"(exports, module) {
788
+ "use strict";
789
+ var colorSupport = require_color_support();
790
+ module.exports = colorSupport().hasBasic;
791
+ }
792
+ });
793
+
794
+ // ../node_modules/gauge/node_modules/signal-exit/dist/cjs/signals.js
795
+ var require_signals = __commonJS({
796
+ "../node_modules/gauge/node_modules/signal-exit/dist/cjs/signals.js"(exports) {
797
+ "use strict";
798
+ Object.defineProperty(exports, "__esModule", { value: !0 });
799
+ exports.signals = void 0;
800
+ exports.signals = [];
801
+ exports.signals.push("SIGHUP", "SIGINT", "SIGTERM");
802
+ process.platform !== "win32" && exports.signals.push(
803
+ "SIGALRM",
804
+ "SIGABRT",
805
+ "SIGVTALRM",
806
+ "SIGXCPU",
807
+ "SIGXFSZ",
808
+ "SIGUSR2",
809
+ "SIGTRAP",
810
+ "SIGSYS",
811
+ "SIGQUIT",
812
+ "SIGIOT"
813
+ // should detect profiler and enable/disable accordingly.
814
+ // see #21
815
+ // 'SIGPROF'
816
+ );
817
+ process.platform === "linux" && exports.signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
818
+ }
819
+ });
820
+
821
+ // ../node_modules/gauge/node_modules/signal-exit/dist/cjs/index.js
822
+ var require_cjs = __commonJS({
823
+ "../node_modules/gauge/node_modules/signal-exit/dist/cjs/index.js"(exports) {
824
+ "use strict";
825
+ var _a;
826
+ Object.defineProperty(exports, "__esModule", { value: !0 });
827
+ exports.unload = exports.load = exports.onExit = exports.signals = void 0;
828
+ var signals_js_1 = require_signals();
829
+ Object.defineProperty(exports, "signals", { enumerable: !0, get: function() {
830
+ return signals_js_1.signals;
831
+ } });
832
+ var processOk = (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", kExitEmitter = Symbol.for("signal-exit emitter"), global2 = globalThis, ObjectDefineProperty = Object.defineProperty.bind(Object), Emitter = class {
833
+ emitted = {
834
+ afterExit: !1,
835
+ exit: !1
836
+ };
837
+ listeners = {
838
+ afterExit: [],
839
+ exit: []
840
+ };
841
+ count = 0;
842
+ id = Math.random();
843
+ constructor() {
844
+ if (global2[kExitEmitter])
845
+ return global2[kExitEmitter];
846
+ ObjectDefineProperty(global2, kExitEmitter, {
847
+ value: this,
848
+ writable: !1,
849
+ enumerable: !1,
850
+ configurable: !1
851
+ });
852
+ }
853
+ on(ev, fn) {
854
+ this.listeners[ev].push(fn);
855
+ }
856
+ removeListener(ev, fn) {
857
+ let list = this.listeners[ev], i = list.indexOf(fn);
858
+ i !== -1 && (i === 0 && list.length === 1 ? list.length = 0 : list.splice(i, 1));
859
+ }
860
+ emit(ev, code, signal) {
861
+ if (this.emitted[ev])
862
+ return !1;
863
+ this.emitted[ev] = !0;
864
+ let ret = !1;
865
+ for (let fn of this.listeners[ev])
866
+ ret = fn(code, signal) === !0 || ret;
867
+ return ev === "exit" && (ret = this.emit("afterExit", code, signal) || ret), ret;
868
+ }
869
+ }, SignalExitBase = class {
870
+ }, signalExitWrap = (handler) => ({
871
+ onExit(cb, opts) {
872
+ return handler.onExit(cb, opts);
873
+ },
874
+ load() {
875
+ return handler.load();
876
+ },
877
+ unload() {
878
+ return handler.unload();
879
+ }
880
+ }), SignalExitFallback = class extends SignalExitBase {
881
+ onExit() {
882
+ return () => {
883
+ };
884
+ }
885
+ load() {
886
+ }
887
+ unload() {
888
+ }
889
+ }, SignalExit = class extends SignalExitBase {
890
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
891
+ // so use a supported signal instead
892
+ /* c8 ignore start */
893
+ #hupSig = process2.platform === "win32" ? "SIGINT" : "SIGHUP";
894
+ /* c8 ignore stop */
895
+ #emitter = new Emitter();
896
+ #process;
897
+ #originalProcessEmit;
898
+ #originalProcessReallyExit;
899
+ #sigListeners = {};
900
+ #loaded = !1;
901
+ constructor(process3) {
902
+ super(), this.#process = process3, this.#sigListeners = {};
903
+ for (let sig of signals_js_1.signals)
904
+ this.#sigListeners[sig] = () => {
905
+ let listeners = this.#process.listeners(sig), { count } = this.#emitter, p = process3;
906
+ if (typeof p.__signal_exit_emitter__ == "object" && typeof p.__signal_exit_emitter__.count == "number" && (count += p.__signal_exit_emitter__.count), listeners.length === count) {
907
+ this.unload();
908
+ let ret = this.#emitter.emit("exit", null, sig), s = sig === "SIGHUP" ? this.#hupSig : sig;
909
+ ret || process3.kill(process3.pid, s);
910
+ }
911
+ };
912
+ this.#originalProcessReallyExit = process3.reallyExit, this.#originalProcessEmit = process3.emit;
913
+ }
914
+ onExit(cb, opts) {
915
+ if (!processOk(this.#process))
916
+ return () => {
917
+ };
918
+ this.#loaded === !1 && this.load();
919
+ let ev = opts?.alwaysLast ? "afterExit" : "exit";
920
+ return this.#emitter.on(ev, cb), () => {
921
+ this.#emitter.removeListener(ev, cb), this.#emitter.listeners.exit.length === 0 && this.#emitter.listeners.afterExit.length === 0 && this.unload();
922
+ };
923
+ }
924
+ load() {
925
+ if (!this.#loaded) {
926
+ this.#loaded = !0, this.#emitter.count += 1;
927
+ for (let sig of signals_js_1.signals)
928
+ try {
929
+ let fn = this.#sigListeners[sig];
930
+ fn && this.#process.on(sig, fn);
931
+ } catch {
932
+ }
933
+ this.#process.emit = (ev, ...a) => this.#processEmit(ev, ...a), this.#process.reallyExit = (code) => this.#processReallyExit(code);
934
+ }
935
+ }
936
+ unload() {
937
+ this.#loaded && (this.#loaded = !1, signals_js_1.signals.forEach((sig) => {
938
+ let listener = this.#sigListeners[sig];
939
+ if (!listener)
940
+ throw new Error("Listener not defined for signal: " + sig);
941
+ try {
942
+ this.#process.removeListener(sig, listener);
943
+ } catch {
944
+ }
945
+ }), this.#process.emit = this.#originalProcessEmit, this.#process.reallyExit = this.#originalProcessReallyExit, this.#emitter.count -= 1);
946
+ }
947
+ #processReallyExit(code) {
948
+ return processOk(this.#process) ? (this.#process.exitCode = code || 0, this.#emitter.emit("exit", this.#process.exitCode, null), this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode)) : 0;
949
+ }
950
+ #processEmit(ev, ...args) {
951
+ let og = this.#originalProcessEmit;
952
+ if (ev === "exit" && processOk(this.#process)) {
953
+ typeof args[0] == "number" && (this.#process.exitCode = args[0]);
954
+ let ret = og.call(this.#process, ev, ...args);
955
+ return this.#emitter.emit("exit", this.#process.exitCode, null), ret;
956
+ } else
957
+ return og.call(this.#process, ev, ...args);
958
+ }
959
+ }, process2 = globalThis.process;
960
+ _a = signalExitWrap(processOk(process2) ? new SignalExit(process2) : new SignalExitFallback()), /**
961
+ * Called when the process is exiting, whether via signal, explicit
962
+ * exit, or running out of stuff to do.
963
+ *
964
+ * If the global process object is not suitable for instrumentation,
965
+ * then this will be a no-op.
966
+ *
967
+ * Returns a function that may be used to unload signal-exit.
968
+ */
969
+ exports.onExit = _a.onExit, /**
970
+ * Load the listeners. Likely you never need to call this, unless
971
+ * doing a rather deep integration with signal-exit functionality.
972
+ * Mostly exposed for the benefit of testing.
973
+ *
974
+ * @internal
975
+ */
976
+ exports.load = _a.load, /**
977
+ * Unload the listeners. Likely you never need to call this, unless
978
+ * doing a rather deep integration with signal-exit functionality.
979
+ * Mostly exposed for the benefit of testing.
980
+ *
981
+ * @internal
982
+ */
983
+ exports.unload = _a.unload;
984
+ }
985
+ });
986
+
987
+ // ../node_modules/gauge/lib/spin.js
988
+ var require_spin = __commonJS({
989
+ "../node_modules/gauge/lib/spin.js"(exports, module) {
990
+ "use strict";
991
+ module.exports = function(spinstr, spun) {
992
+ return spinstr[spun % spinstr.length];
993
+ };
994
+ }
995
+ });
996
+
997
+ // ../node_modules/gauge/lib/progress-bar.js
998
+ var require_progress_bar = __commonJS({
999
+ "../node_modules/gauge/lib/progress-bar.js"(exports, module) {
1000
+ "use strict";
1001
+ var validate = require_aproba(), renderTemplate = require_render_template(), wideTruncate = require_wide_truncate(), stringWidth2 = require_string_width();
1002
+ module.exports = function(theme, width, completed) {
1003
+ if (validate("ONN", [theme, width, completed]), completed < 0 && (completed = 0), completed > 1 && (completed = 1), width <= 0)
1004
+ return "";
1005
+ var sofar = Math.round(width * completed), rest = width - sofar, template = [
1006
+ { type: "complete", value: repeat(theme.complete, sofar), length: sofar },
1007
+ { type: "remaining", value: repeat(theme.remaining, rest), length: rest }
1008
+ ];
1009
+ return renderTemplate(width, template, theme);
1010
+ };
1011
+ function repeat(string, width) {
1012
+ var result = "", n = width;
1013
+ do
1014
+ n % 2 && (result += string), n = Math.floor(n / 2), string += string;
1015
+ while (n && stringWidth2(result) < width);
1016
+ return wideTruncate(result, width);
1017
+ }
1018
+ }
1019
+ });
1020
+
1021
+ // ../node_modules/gauge/lib/base-theme.js
1022
+ var require_base_theme = __commonJS({
1023
+ "../node_modules/gauge/lib/base-theme.js"(exports, module) {
1024
+ "use strict";
1025
+ var spin = require_spin(), progressBar = require_progress_bar();
1026
+ module.exports = {
1027
+ activityIndicator: function(values, theme) {
1028
+ if (values.spun != null)
1029
+ return spin(theme, values.spun);
1030
+ },
1031
+ progressbar: function(values, theme, width) {
1032
+ if (values.completed != null)
1033
+ return progressBar(theme, width, values.completed);
1034
+ }
1035
+ };
1036
+ }
1037
+ });
1038
+
1039
+ // ../node_modules/gauge/lib/theme-set.js
1040
+ var require_theme_set = __commonJS({
1041
+ "../node_modules/gauge/lib/theme-set.js"(exports, module) {
1042
+ "use strict";
1043
+ module.exports = function() {
1044
+ return ThemeSetProto.newThemeSet();
1045
+ };
1046
+ var ThemeSetProto = {};
1047
+ ThemeSetProto.baseTheme = require_base_theme();
1048
+ ThemeSetProto.newTheme = function(parent, theme) {
1049
+ return theme || (theme = parent, parent = this.baseTheme), Object.assign({}, parent, theme);
1050
+ };
1051
+ ThemeSetProto.getThemeNames = function() {
1052
+ return Object.keys(this.themes);
1053
+ };
1054
+ ThemeSetProto.addTheme = function(name, parent, theme) {
1055
+ this.themes[name] = this.newTheme(parent, theme);
1056
+ };
1057
+ ThemeSetProto.addToAllThemes = function(theme) {
1058
+ var themes = this.themes;
1059
+ Object.keys(themes).forEach(function(name) {
1060
+ Object.assign(themes[name], theme);
1061
+ }), Object.assign(this.baseTheme, theme);
1062
+ };
1063
+ ThemeSetProto.getTheme = function(name) {
1064
+ if (!this.themes[name])
1065
+ throw this.newMissingThemeError(name);
1066
+ return this.themes[name];
1067
+ };
1068
+ ThemeSetProto.setDefault = function(opts, name) {
1069
+ name == null && (name = opts, opts = {});
1070
+ var platform = opts.platform == null ? "fallback" : opts.platform, hasUnicode = !!opts.hasUnicode, hasColor = !!opts.hasColor;
1071
+ this.defaults[platform] || (this.defaults[platform] = { true: {}, false: {} }), this.defaults[platform][hasUnicode][hasColor] = name;
1072
+ };
1073
+ ThemeSetProto.getDefault = function(opts) {
1074
+ opts || (opts = {});
1075
+ var platformName = opts.platform || process.platform, platform = this.defaults[platformName] || this.defaults.fallback, hasUnicode = !!opts.hasUnicode, hasColor = !!opts.hasColor;
1076
+ if (!platform)
1077
+ throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor);
1078
+ if (!platform[hasUnicode][hasColor]) {
1079
+ if (hasUnicode && hasColor && platform[!hasUnicode][hasColor])
1080
+ hasUnicode = !1;
1081
+ else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor])
1082
+ hasColor = !1;
1083
+ else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor])
1084
+ hasUnicode = !1, hasColor = !1;
1085
+ else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor])
1086
+ hasUnicode = !1;
1087
+ else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor])
1088
+ hasColor = !1;
1089
+ else if (platform === this.defaults.fallback)
1090
+ throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor);
1091
+ }
1092
+ return platform[hasUnicode][hasColor] ? this.getTheme(platform[hasUnicode][hasColor]) : this.getDefault(Object.assign({}, opts, { platform: "fallback" }));
1093
+ };
1094
+ ThemeSetProto.newMissingThemeError = function newMissingThemeError(name) {
1095
+ var err = new Error('Could not find a gauge theme named "' + name + '"');
1096
+ return Error.captureStackTrace.call(err, newMissingThemeError), err.theme = name, err.code = "EMISSINGTHEME", err;
1097
+ };
1098
+ ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError(platformName, hasUnicode, hasColor) {
1099
+ var err = new Error(
1100
+ `Could not find a gauge theme for your platform/unicode/color use combo:
1101
+ platform = ` + platformName + `
1102
+ hasUnicode = ` + hasUnicode + `
1103
+ hasColor = ` + hasColor
1104
+ );
1105
+ return Error.captureStackTrace.call(err, newMissingDefaultThemeError), err.platform = platformName, err.hasUnicode = hasUnicode, err.hasColor = hasColor, err.code = "EMISSINGTHEME", err;
1106
+ };
1107
+ ThemeSetProto.newThemeSet = function() {
1108
+ var themeset = function(opts) {
1109
+ return themeset.getDefault(opts);
1110
+ };
1111
+ return Object.assign(themeset, ThemeSetProto, {
1112
+ themes: Object.assign({}, this.themes),
1113
+ baseTheme: Object.assign({}, this.baseTheme),
1114
+ defaults: JSON.parse(JSON.stringify(this.defaults || {}))
1115
+ });
1116
+ };
1117
+ }
1118
+ });
1119
+
1120
+ // ../node_modules/gauge/lib/themes.js
1121
+ var require_themes = __commonJS({
1122
+ "../node_modules/gauge/lib/themes.js"(exports, module) {
1123
+ "use strict";
1124
+ var color = require_console_control_strings().color, ThemeSet = require_theme_set(), themes = module.exports = new ThemeSet();
1125
+ themes.addTheme("ASCII", {
1126
+ preProgressbar: "[",
1127
+ postProgressbar: "]",
1128
+ progressbarTheme: {
1129
+ complete: "#",
1130
+ remaining: "."
1131
+ },
1132
+ activityIndicatorTheme: "-\\|/",
1133
+ preSubsection: ">"
1134
+ });
1135
+ themes.addTheme("colorASCII", themes.getTheme("ASCII"), {
1136
+ progressbarTheme: {
1137
+ preComplete: color("bgBrightWhite", "brightWhite"),
1138
+ complete: "#",
1139
+ postComplete: color("reset"),
1140
+ preRemaining: color("bgBrightBlack", "brightBlack"),
1141
+ remaining: ".",
1142
+ postRemaining: color("reset")
1143
+ }
1144
+ });
1145
+ themes.addTheme("brailleSpinner", {
1146
+ preProgressbar: "(",
1147
+ postProgressbar: ")",
1148
+ progressbarTheme: {
1149
+ complete: "#",
1150
+ remaining: "\u2802"
1151
+ },
1152
+ activityIndicatorTheme: "\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F",
1153
+ preSubsection: ">"
1154
+ });
1155
+ themes.addTheme("colorBrailleSpinner", themes.getTheme("brailleSpinner"), {
1156
+ progressbarTheme: {
1157
+ preComplete: color("bgBrightWhite", "brightWhite"),
1158
+ complete: "#",
1159
+ postComplete: color("reset"),
1160
+ preRemaining: color("bgBrightBlack", "brightBlack"),
1161
+ remaining: "\u2802",
1162
+ postRemaining: color("reset")
1163
+ }
1164
+ });
1165
+ themes.setDefault({}, "ASCII");
1166
+ themes.setDefault({ hasColor: !0 }, "colorASCII");
1167
+ themes.setDefault({ platform: "darwin", hasUnicode: !0 }, "brailleSpinner");
1168
+ themes.setDefault({ platform: "darwin", hasUnicode: !0, hasColor: !0 }, "colorBrailleSpinner");
1169
+ themes.setDefault({ platform: "linux", hasUnicode: !0 }, "brailleSpinner");
1170
+ themes.setDefault({ platform: "linux", hasUnicode: !0, hasColor: !0 }, "colorBrailleSpinner");
1171
+ }
1172
+ });
1173
+
1174
+ // ../node_modules/gauge/lib/set-interval.js
1175
+ var require_set_interval = __commonJS({
1176
+ "../node_modules/gauge/lib/set-interval.js"(exports, module) {
1177
+ "use strict";
1178
+ module.exports = setInterval;
1179
+ }
1180
+ });
1181
+
1182
+ // ../node_modules/gauge/lib/process.js
1183
+ var require_process = __commonJS({
1184
+ "../node_modules/gauge/lib/process.js"(exports, module) {
1185
+ "use strict";
1186
+ module.exports = process;
1187
+ }
1188
+ });
1189
+
1190
+ // ../node_modules/gauge/lib/set-immediate.js
1191
+ var require_set_immediate = __commonJS({
1192
+ "../node_modules/gauge/lib/set-immediate.js"(exports, module) {
1193
+ "use strict";
1194
+ var process2 = require_process();
1195
+ try {
1196
+ module.exports = setImmediate;
1197
+ } catch {
1198
+ module.exports = process2.nextTick;
1199
+ }
1200
+ }
1201
+ });
1202
+
1203
+ // ../node_modules/gauge/lib/index.js
1204
+ var require_lib2 = __commonJS({
1205
+ "../node_modules/gauge/lib/index.js"(exports, module) {
1206
+ "use strict";
1207
+ var Plumbing = require_plumbing(), hasUnicode = require_has_unicode(), hasColor = require_has_color(), onExit = require_cjs().onExit, defaultThemes = require_themes(), setInterval2 = require_set_interval(), process2 = require_process(), setImmediate2 = require_set_immediate();
1208
+ module.exports = Gauge;
1209
+ function callWith(obj, method) {
1210
+ return function() {
1211
+ return method.call(obj);
1212
+ };
1213
+ }
1214
+ function Gauge(arg1, arg2) {
1215
+ var options, writeTo;
1216
+ arg1 && arg1.write ? (writeTo = arg1, options = arg2 || {}) : arg2 && arg2.write ? (writeTo = arg2, options = arg1 || {}) : (writeTo = process2.stderr, options = arg1 || arg2 || {}), this._status = {
1217
+ spun: 0,
1218
+ section: "",
1219
+ subsection: ""
1220
+ }, this._paused = !1, this._disabled = !0, this._showing = !1, this._onScreen = !1, this._needsRedraw = !1, this._hideCursor = options.hideCursor == null ? !0 : options.hideCursor, this._fixedFramerate = options.fixedFramerate == null ? !/^v0\.8\./.test(process2.version) : options.fixedFramerate, this._lastUpdateAt = null, this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval, this._themes = options.themes || defaultThemes, this._theme = options.theme;
1221
+ var theme = this._computeTheme(options.theme), template = options.template || [
1222
+ { type: "progressbar", length: 20 },
1223
+ { type: "activityIndicator", kerning: 1, length: 1 },
1224
+ { type: "section", kerning: 1, default: "" },
1225
+ { type: "subsection", kerning: 1, default: "" }
1226
+ ];
1227
+ this.setWriteTo(writeTo, options.tty);
1228
+ var PlumbingClass = options.Plumbing || Plumbing;
1229
+ this._gauge = new PlumbingClass(theme, template, this.getWidth()), this._$$doRedraw = callWith(this, this._doRedraw), this._$$handleSizeChange = callWith(this, this._handleSizeChange), this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit, this._removeOnExit = null, options.enabled || options.enabled == null && this._tty && this._tty.isTTY ? this.enable() : this.disable();
1230
+ }
1231
+ Gauge.prototype = {};
1232
+ Gauge.prototype.isEnabled = function() {
1233
+ return !this._disabled;
1234
+ };
1235
+ Gauge.prototype.setTemplate = function(template) {
1236
+ this._gauge.setTemplate(template), this._showing && this._requestRedraw();
1237
+ };
1238
+ Gauge.prototype._computeTheme = function(theme) {
1239
+ if (theme || (theme = {}), typeof theme == "string")
1240
+ theme = this._themes.getTheme(theme);
1241
+ else if (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null) {
1242
+ var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode, useColor = theme.hasColor == null ? hasColor : theme.hasColor;
1243
+ theme = this._themes.getDefault({
1244
+ hasUnicode: useUnicode,
1245
+ hasColor: useColor,
1246
+ platform: theme.platform
1247
+ });
1248
+ }
1249
+ return theme;
1250
+ };
1251
+ Gauge.prototype.setThemeset = function(themes) {
1252
+ this._themes = themes, this.setTheme(this._theme);
1253
+ };
1254
+ Gauge.prototype.setTheme = function(theme) {
1255
+ this._gauge.setTheme(this._computeTheme(theme)), this._showing && this._requestRedraw(), this._theme = theme;
1256
+ };
1257
+ Gauge.prototype._requestRedraw = function() {
1258
+ this._needsRedraw = !0, this._fixedFramerate || this._doRedraw();
1259
+ };
1260
+ Gauge.prototype.getWidth = function() {
1261
+ return (this._tty && this._tty.columns || 80) - 1;
1262
+ };
1263
+ Gauge.prototype.setWriteTo = function(writeTo, tty) {
1264
+ var enabled = !this._disabled;
1265
+ enabled && this.disable(), this._writeTo = writeTo, this._tty = tty || writeTo === process2.stderr && process2.stdout.isTTY && process2.stdout || writeTo.isTTY && writeTo || this._tty, this._gauge && this._gauge.setWidth(this.getWidth()), enabled && this.enable();
1266
+ };
1267
+ Gauge.prototype.enable = function() {
1268
+ this._disabled && (this._disabled = !1, this._tty && this._enableEvents(), this._showing && this.show());
1269
+ };
1270
+ Gauge.prototype.disable = function() {
1271
+ this._disabled || (this._showing && (this._lastUpdateAt = null, this._showing = !1, this._doRedraw(), this._showing = !0), this._disabled = !0, this._tty && this._disableEvents());
1272
+ };
1273
+ Gauge.prototype._enableEvents = function() {
1274
+ this._cleanupOnExit && (this._removeOnExit = onExit(callWith(this, this.disable))), this._tty.on("resize", this._$$handleSizeChange), this._fixedFramerate && (this.redrawTracker = setInterval2(this._$$doRedraw, this._updateInterval), this.redrawTracker.unref && this.redrawTracker.unref());
1275
+ };
1276
+ Gauge.prototype._disableEvents = function() {
1277
+ this._tty.removeListener("resize", this._$$handleSizeChange), this._fixedFramerate && clearInterval(this.redrawTracker), this._removeOnExit && this._removeOnExit();
1278
+ };
1279
+ Gauge.prototype.hide = function(cb) {
1280
+ if (this._disabled || !this._showing)
1281
+ return cb && process2.nextTick(cb);
1282
+ this._showing = !1, this._doRedraw(), cb && setImmediate2(cb);
1283
+ };
1284
+ Gauge.prototype.show = function(section, completed) {
1285
+ if (this._showing = !0, typeof section == "string")
1286
+ this._status.section = section;
1287
+ else if (typeof section == "object")
1288
+ for (var sectionKeys = Object.keys(section), ii = 0; ii < sectionKeys.length; ++ii) {
1289
+ var key = sectionKeys[ii];
1290
+ this._status[key] = section[key];
1291
+ }
1292
+ completed != null && (this._status.completed = completed), !this._disabled && this._requestRedraw();
1293
+ };
1294
+ Gauge.prototype.pulse = function(subsection) {
1295
+ this._status.subsection = subsection || "", this._status.spun++, !this._disabled && this._showing && this._requestRedraw();
1296
+ };
1297
+ Gauge.prototype._handleSizeChange = function() {
1298
+ this._gauge.setWidth(this._tty.columns - 1), this._requestRedraw();
1299
+ };
1300
+ Gauge.prototype._doRedraw = function() {
1301
+ if (!(this._disabled || this._paused)) {
1302
+ if (!this._fixedFramerate) {
1303
+ var now = Date.now();
1304
+ if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval)
1305
+ return;
1306
+ this._lastUpdateAt = now;
1307
+ }
1308
+ if (!this._showing && this._onScreen) {
1309
+ this._onScreen = !1;
1310
+ var result = this._gauge.hide();
1311
+ return this._hideCursor && (result += this._gauge.showCursor()), this._writeTo.write(result);
1312
+ }
1313
+ !this._showing && !this._onScreen || (this._showing && !this._onScreen && (this._onScreen = !0, this._needsRedraw = !0, this._hideCursor && this._writeTo.write(this._gauge.hideCursor())), this._needsRedraw && (this._writeTo.write(this._gauge.show(this._status)) || (this._paused = !0, this._writeTo.on("drain", callWith(this, function() {
1314
+ this._paused = !1, this._doRedraw();
1315
+ })))));
1316
+ }
1317
+ };
1318
+ }
1319
+ });
1320
+
1321
+ // ../node_modules/set-blocking/index.js
1322
+ var require_set_blocking = __commonJS({
1323
+ "../node_modules/set-blocking/index.js"(exports, module) {
1324
+ module.exports = function(blocking) {
1325
+ [process.stdout, process.stderr].forEach(function(stream) {
1326
+ stream._handle && stream.isTTY && typeof stream._handle.setBlocking == "function" && stream._handle.setBlocking(blocking);
1327
+ });
1328
+ };
1329
+ }
1330
+ });
1331
+
1332
+ // ../node_modules/npmlog/lib/log.js
1333
+ var require_log = __commonJS({
1334
+ "../node_modules/npmlog/lib/log.js"(exports, module) {
1335
+ "use strict";
1336
+ var Progress = require_lib(), Gauge = require_lib2(), EE = __require("events").EventEmitter, log2 = exports = module.exports = new EE(), util = __require("util"), setBlocking = require_set_blocking(), consoleControl = require_console_control_strings();
1337
+ setBlocking(!0);
1338
+ var stream = process.stderr;
1339
+ Object.defineProperty(log2, "stream", {
1340
+ set: function(newStream) {
1341
+ stream = newStream, this.gauge && this.gauge.setWriteTo(stream, stream);
1342
+ },
1343
+ get: function() {
1344
+ return stream;
1345
+ }
1346
+ });
1347
+ var colorEnabled;
1348
+ log2.useColor = function() {
1349
+ return colorEnabled ?? stream.isTTY;
1350
+ };
1351
+ log2.enableColor = function() {
1352
+ colorEnabled = !0, this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled });
1353
+ };
1354
+ log2.disableColor = function() {
1355
+ colorEnabled = !1, this.gauge.setTheme({ hasColor: colorEnabled, hasUnicode: unicodeEnabled });
1356
+ };
1357
+ log2.level = "info";
1358
+ log2.gauge = new Gauge(stream, {
1359
+ enabled: !1,
1360
+ // no progress bars unless asked
1361
+ theme: { hasColor: log2.useColor() },
1362
+ template: [
1363
+ { type: "progressbar", length: 20 },
1364
+ { type: "activityIndicator", kerning: 1, length: 1 },
1365
+ { type: "section", default: "" },
1366
+ ":",
1367
+ { type: "logline", kerning: 1, default: "" }
1368
+ ]
1369
+ });
1370
+ log2.tracker = new Progress.TrackerGroup();
1371
+ log2.progressEnabled = log2.gauge.isEnabled();
1372
+ var unicodeEnabled;
1373
+ log2.enableUnicode = function() {
1374
+ unicodeEnabled = !0, this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled });
1375
+ };
1376
+ log2.disableUnicode = function() {
1377
+ unicodeEnabled = !1, this.gauge.setTheme({ hasColor: this.useColor(), hasUnicode: unicodeEnabled });
1378
+ };
1379
+ log2.setGaugeThemeset = function(themes) {
1380
+ this.gauge.setThemeset(themes);
1381
+ };
1382
+ log2.setGaugeTemplate = function(template) {
1383
+ this.gauge.setTemplate(template);
1384
+ };
1385
+ log2.enableProgress = function() {
1386
+ this.progressEnabled || this._paused || (this.progressEnabled = !0, this.tracker.on("change", this.showProgress), this.gauge.enable());
1387
+ };
1388
+ log2.disableProgress = function() {
1389
+ this.progressEnabled && (this.progressEnabled = !1, this.tracker.removeListener("change", this.showProgress), this.gauge.disable());
1390
+ };
1391
+ var trackerConstructors = ["newGroup", "newItem", "newStream"], mixinLog = function(tracker) {
1392
+ return Object.keys(log2).forEach(function(P2) {
1393
+ if (P2[0] !== "_" && !trackerConstructors.filter(function(C) {
1394
+ return C === P2;
1395
+ }).length && !tracker[P2] && typeof log2[P2] == "function") {
1396
+ var func = log2[P2];
1397
+ tracker[P2] = function() {
1398
+ return func.apply(log2, arguments);
1399
+ };
1400
+ }
1401
+ }), tracker instanceof Progress.TrackerGroup && trackerConstructors.forEach(function(C) {
1402
+ var func = tracker[C];
1403
+ tracker[C] = function() {
1404
+ return mixinLog(func.apply(tracker, arguments));
1405
+ };
1406
+ }), tracker;
1407
+ };
1408
+ trackerConstructors.forEach(function(C) {
1409
+ log2[C] = function() {
1410
+ return mixinLog(this.tracker[C].apply(this.tracker, arguments));
1411
+ };
1412
+ });
1413
+ log2.clearProgress = function(cb) {
1414
+ if (!this.progressEnabled)
1415
+ return cb && process.nextTick(cb);
1416
+ this.gauge.hide(cb);
1417
+ };
1418
+ log2.showProgress = function(name, completed) {
1419
+ if (this.progressEnabled) {
1420
+ var values = {};
1421
+ name && (values.section = name);
1422
+ var last = log2.record[log2.record.length - 1];
1423
+ if (last) {
1424
+ values.subsection = last.prefix;
1425
+ var disp = log2.disp[last.level] || last.level, logline = this._format(disp, log2.style[last.level]);
1426
+ last.prefix && (logline += " " + this._format(last.prefix, this.prefixStyle)), logline += " " + last.message.split(/\r?\n/)[0], values.logline = logline;
1427
+ }
1428
+ values.completed = completed || this.tracker.completed(), this.gauge.show(values);
1429
+ }
1430
+ }.bind(log2);
1431
+ log2.pause = function() {
1432
+ this._paused = !0, this.progressEnabled && this.gauge.disable();
1433
+ };
1434
+ log2.resume = function() {
1435
+ if (this._paused) {
1436
+ this._paused = !1;
1437
+ var b2 = this._buffer;
1438
+ this._buffer = [], b2.forEach(function(m) {
1439
+ this.emitLog(m);
1440
+ }, this), this.progressEnabled && this.gauge.enable();
1441
+ }
1442
+ };
1443
+ log2._buffer = [];
1444
+ var id = 0;
1445
+ log2.record = [];
1446
+ log2.maxRecordSize = 1e4;
1447
+ log2.log = function(lvl, prefix, message) {
1448
+ var l = this.levels[lvl];
1449
+ if (l === void 0)
1450
+ return this.emit("error", new Error(util.format(
1451
+ "Undefined log level: %j",
1452
+ lvl
1453
+ )));
1454
+ for (var a = new Array(arguments.length - 2), stack = null, i = 2; i < arguments.length; i++) {
1455
+ var arg = a[i - 2] = arguments[i];
1456
+ typeof arg == "object" && arg instanceof Error && arg.stack && Object.defineProperty(arg, "stack", {
1457
+ value: stack = arg.stack + "",
1458
+ enumerable: !0,
1459
+ writable: !0
1460
+ });
1461
+ }
1462
+ stack && a.unshift(stack + `
1463
+ `), message = util.format.apply(util, a);
1464
+ var m = {
1465
+ id: id++,
1466
+ level: lvl,
1467
+ prefix: String(prefix || ""),
1468
+ message,
1469
+ messageRaw: a
1470
+ };
1471
+ this.emit("log", m), this.emit("log." + lvl, m), m.prefix && this.emit(m.prefix, m), this.record.push(m);
1472
+ var mrs = this.maxRecordSize, n = this.record.length - mrs;
1473
+ if (n > mrs / 10) {
1474
+ var newSize = Math.floor(mrs * 0.9);
1475
+ this.record = this.record.slice(-1 * newSize);
1476
+ }
1477
+ this.emitLog(m);
1478
+ }.bind(log2);
1479
+ log2.emitLog = function(m) {
1480
+ if (this._paused) {
1481
+ this._buffer.push(m);
1482
+ return;
1483
+ }
1484
+ this.progressEnabled && this.gauge.pulse(m.prefix);
1485
+ var l = this.levels[m.level];
1486
+ if (l !== void 0 && !(l < this.levels[this.level]) && !(l > 0 && !isFinite(l))) {
1487
+ var disp = log2.disp[m.level] != null ? log2.disp[m.level] : m.level;
1488
+ this.clearProgress(), m.message.split(/\r?\n/).forEach(function(line) {
1489
+ var heading = this.heading;
1490
+ heading && (this.write(heading, this.headingStyle), this.write(" ")), this.write(disp, log2.style[m.level]);
1491
+ var p = m.prefix || "";
1492
+ p && this.write(" "), this.write(p, this.prefixStyle), this.write(" " + line + `
1493
+ `);
1494
+ }, this), this.showProgress();
1495
+ }
1496
+ };
1497
+ log2._format = function(msg, style) {
1498
+ if (stream) {
1499
+ var output = "";
1500
+ if (this.useColor()) {
1501
+ style = style || {};
1502
+ var settings = [];
1503
+ style.fg && settings.push(style.fg), style.bg && settings.push("bg" + style.bg[0].toUpperCase() + style.bg.slice(1)), style.bold && settings.push("bold"), style.underline && settings.push("underline"), style.inverse && settings.push("inverse"), settings.length && (output += consoleControl.color(settings)), style.beep && (output += consoleControl.beep());
1504
+ }
1505
+ return output += msg, this.useColor() && (output += consoleControl.color("reset")), output;
1506
+ }
1507
+ };
1508
+ log2.write = function(msg, style) {
1509
+ stream && stream.write(this._format(msg, style));
1510
+ };
1511
+ log2.addLevel = function(lvl, n, style, disp) {
1512
+ disp == null && (disp = lvl), this.levels[lvl] = n, this.style[lvl] = style, this[lvl] || (this[lvl] = function() {
1513
+ var a = new Array(arguments.length + 1);
1514
+ a[0] = lvl;
1515
+ for (var i = 0; i < arguments.length; i++)
1516
+ a[i + 1] = arguments[i];
1517
+ return this.log.apply(this, a);
1518
+ }.bind(this)), this.disp[lvl] = disp;
1519
+ };
1520
+ log2.prefixStyle = { fg: "magenta" };
1521
+ log2.headingStyle = { fg: "white", bg: "black" };
1522
+ log2.style = {};
1523
+ log2.levels = {};
1524
+ log2.disp = {};
1525
+ log2.addLevel("silly", -1 / 0, { inverse: !0 }, "sill");
1526
+ log2.addLevel("verbose", 1e3, { fg: "cyan", bg: "black" }, "verb");
1527
+ log2.addLevel("info", 2e3, { fg: "green" });
1528
+ log2.addLevel("timing", 2500, { fg: "green", bg: "black" });
1529
+ log2.addLevel("http", 3e3, { fg: "green", bg: "black" });
1530
+ log2.addLevel("notice", 3500, { fg: "cyan", bg: "black" });
1531
+ log2.addLevel("warn", 4e3, { fg: "black", bg: "yellow" }, "WARN");
1532
+ log2.addLevel("error", 5e3, { fg: "red", bg: "black" }, "ERR!");
1533
+ log2.addLevel("silent", 1 / 0);
1534
+ log2.on("error", function() {
1535
+ });
1536
+ }
1537
+ });
1538
+
1539
+ // ../node_modules/pretty-hrtime/index.js
1540
+ var require_pretty_hrtime = __commonJS({
1541
+ "../node_modules/pretty-hrtime/index.js"(exports, module) {
1542
+ "use strict";
1543
+ var minimalDesc = ["h", "min", "s", "ms", "\u03BCs", "ns"], verboseDesc = ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"], convert = [3600, 60, 1, 1e6, 1e3, 1];
1544
+ module.exports = function(source, opts) {
1545
+ var verbose, precise, i, spot, sourceAtStep, valAtStep, decimals, strAtStep, results, totalSeconds;
1546
+ if (verbose = !1, precise = !1, opts && (verbose = opts.verbose || !1, precise = opts.precise || !1), !Array.isArray(source) || source.length !== 2 || typeof source[0] != "number" || typeof source[1] != "number")
1547
+ return "";
1548
+ for (source[1] < 0 && (totalSeconds = source[0] + source[1] / 1e9, source[0] = parseInt(totalSeconds), source[1] = parseFloat((totalSeconds % 1).toPrecision(9)) * 1e9), results = "", i = 0; i < 6 && (spot = i < 3 ? 0 : 1, sourceAtStep = source[spot], i !== 3 && i !== 0 && (sourceAtStep = sourceAtStep % convert[i - 1]), i === 2 && (sourceAtStep += source[1] / 1e9), valAtStep = sourceAtStep / convert[i], !(valAtStep >= 1 && (verbose && (valAtStep = Math.floor(valAtStep)), precise ? strAtStep = valAtStep.toString() : (decimals = valAtStep >= 10 ? 0 : 2, strAtStep = valAtStep.toFixed(decimals)), strAtStep.indexOf(".") > -1 && strAtStep[strAtStep.length - 1] === "0" && (strAtStep = strAtStep.replace(/\.?0+$/, "")), results && (results += " "), results += strAtStep, verbose ? (results += " " + verboseDesc[i], strAtStep !== "1" && (results += "s")) : results += " " + minimalDesc[i], !verbose))); i++)
1549
+ ;
1550
+ return results;
1551
+ };
1552
+ }
1553
+ });
1554
+
1555
+ // ../node_modules/sisteransi/src/index.js
1556
+ var require_src = __commonJS({
1557
+ "../node_modules/sisteransi/src/index.js"(exports, module) {
1558
+ "use strict";
1559
+ var cursor = {
1560
+ to(x2, y2) {
1561
+ return y2 ? `\x1B[${y2 + 1};${x2 + 1}H` : `\x1B[${x2 + 1}G`;
1562
+ },
1563
+ move(x2, y2) {
1564
+ let ret = "";
1565
+ return x2 < 0 ? ret += `\x1B[${-x2}D` : x2 > 0 && (ret += `\x1B[${x2}C`), y2 < 0 ? ret += `\x1B[${-y2}A` : y2 > 0 && (ret += `\x1B[${y2}B`), ret;
1566
+ },
1567
+ up: (count = 1) => `\x1B[${count}A`,
1568
+ down: (count = 1) => `\x1B[${count}B`,
1569
+ forward: (count = 1) => `\x1B[${count}C`,
1570
+ backward: (count = 1) => `\x1B[${count}D`,
1571
+ nextLine: (count = 1) => "\x1B[E".repeat(count),
1572
+ prevLine: (count = 1) => "\x1B[F".repeat(count),
1573
+ left: "\x1B[G",
1574
+ hide: "\x1B[?25l",
1575
+ show: "\x1B[?25h",
1576
+ save: "\x1B7",
1577
+ restore: "\x1B8"
1578
+ }, scroll = {
1579
+ up: (count = 1) => "\x1B[S".repeat(count),
1580
+ down: (count = 1) => "\x1B[T".repeat(count)
1581
+ }, erase = {
1582
+ screen: "\x1B[2J",
1583
+ up: (count = 1) => "\x1B[1J".repeat(count),
1584
+ down: (count = 1) => "\x1B[J".repeat(count),
1585
+ line: "\x1B[2K",
1586
+ lineEnd: "\x1B[K",
1587
+ lineStart: "\x1B[1K",
1588
+ lines(count) {
1589
+ let clear = "";
1590
+ for (let i = 0; i < count; i++)
1591
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
1592
+ return count && (clear += cursor.left), clear;
1593
+ }
1594
+ };
1595
+ module.exports = { cursor, scroll, erase, beep: "\x07" };
1596
+ }
1597
+ });
1598
+
1599
+ // ../node_modules/eastasianwidth/eastasianwidth.js
1600
+ var require_eastasianwidth = __commonJS({
1601
+ "../node_modules/eastasianwidth/eastasianwidth.js"(exports, module) {
1602
+ var eaw = {};
1603
+ typeof module > "u" ? window.eastasianwidth = eaw : module.exports = eaw;
1604
+ eaw.eastAsianWidth = function(character) {
1605
+ var x2 = character.charCodeAt(0), y2 = character.length == 2 ? character.charCodeAt(1) : 0, codePoint = x2;
1606
+ return 55296 <= x2 && x2 <= 56319 && 56320 <= y2 && y2 <= 57343 && (x2 &= 1023, y2 &= 1023, codePoint = x2 << 10 | y2, codePoint += 65536), codePoint == 12288 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : codePoint == 8361 || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 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 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || codePoint == 172 || codePoint == 175 || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : codePoint == 161 || codePoint == 164 || 167 <= codePoint && codePoint <= 168 || codePoint == 170 || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || codePoint == 198 || codePoint == 208 || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || codePoint == 230 || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || codePoint == 240 || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || codePoint == 252 || codePoint == 254 || codePoint == 257 || codePoint == 273 || codePoint == 275 || codePoint == 283 || 294 <= codePoint && codePoint <= 295 || codePoint == 299 || 305 <= codePoint && codePoint <= 307 || codePoint == 312 || 319 <= codePoint && codePoint <= 322 || codePoint == 324 || 328 <= codePoint && codePoint <= 331 || codePoint == 333 || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || codePoint == 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 || 713 <= codePoint && codePoint <= 715 || codePoint == 717 || codePoint == 720 || 728 <= codePoint && codePoint <= 731 || codePoint == 733 || codePoint == 735 || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || codePoint == 1025 || 1040 <= codePoint && codePoint <= 1103 || codePoint == 1105 || codePoint == 8208 || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || codePoint == 8240 || 8242 <= codePoint && codePoint <= 8243 || codePoint == 8245 || codePoint == 8251 || codePoint == 8254 || codePoint == 8308 || codePoint == 8319 || 8321 <= codePoint && codePoint <= 8324 || codePoint == 8364 || codePoint == 8451 || codePoint == 8453 || codePoint == 8457 || codePoint == 8467 || codePoint == 8470 || 8481 <= codePoint && codePoint <= 8482 || codePoint == 8486 || codePoint == 8491 || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || codePoint == 8585 || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || codePoint == 8658 || codePoint == 8660 || codePoint == 8679 || codePoint == 8704 || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || codePoint == 8715 || codePoint == 8719 || codePoint == 8721 || codePoint == 8725 || codePoint == 8730 || 8733 <= codePoint && codePoint <= 8736 || codePoint == 8739 || codePoint == 8741 || 8743 <= codePoint && codePoint <= 8748 || codePoint == 8750 || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || codePoint == 8776 || codePoint == 8780 || codePoint == 8786 || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || codePoint == 8853 || codePoint == 8857 || codePoint == 8869 || codePoint == 8895 || codePoint == 8978 || 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 || codePoint == 9675 || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || codePoint == 9711 || 9733 <= codePoint && codePoint <= 9734 || codePoint == 9737 || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || codePoint == 9756 || codePoint == 9758 || codePoint == 9792 || codePoint == 9794 || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || codePoint == 9839 || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || codePoint == 9955 || 9960 <= codePoint && codePoint <= 9983 || codePoint == 10045 || codePoint == 10071 || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || codePoint == 65533 || 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 ? "A" : "N";
1607
+ };
1608
+ eaw.characterLength = function(character) {
1609
+ var code = this.eastAsianWidth(character);
1610
+ return code == "F" || code == "W" || code == "A" ? 2 : 1;
1611
+ };
1612
+ function stringToArray(string) {
1613
+ return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1614
+ }
1615
+ eaw.length = function(string) {
1616
+ for (var characters = stringToArray(string), len = 0, i = 0; i < characters.length; i++)
1617
+ len = len + this.characterLength(characters[i]);
1618
+ return len;
1619
+ };
1620
+ eaw.slice = function(text2, start, end) {
1621
+ textLen = eaw.length(text2), start = start || 0, end = end || 1, start < 0 && (start = textLen + start), end < 0 && (end = textLen + end);
1622
+ for (var result = "", eawLen = 0, chars = stringToArray(text2), i = 0; i < chars.length; i++) {
1623
+ var char = chars[i], charLen = eaw.length(char);
1624
+ if (eawLen >= start - (charLen == 2 ? 1 : 0))
1625
+ if (eawLen + charLen <= end)
1626
+ result += char;
1627
+ else
1628
+ break;
1629
+ eawLen += charLen;
1630
+ }
1631
+ return result;
1632
+ };
1633
+ }
1634
+ });
1635
+
1636
+ // ../node_modules/emoji-regex/index.js
1637
+ var require_emoji_regex2 = __commonJS({
1638
+ "../node_modules/emoji-regex/index.js"(exports, module) {
1639
+ "use strict";
1640
+ module.exports = function() {
1641
+ 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;
1642
+ };
1643
+ }
1644
+ });
1645
+
1646
+ // src/node-logger/index.ts
1647
+ var import_npmlog = __toESM(require_log(), 1), import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
1648
+
1649
+ // src/node-logger/logger/logger.ts
1650
+ var logger_exports = {};
1651
+ __export(logger_exports, {
1652
+ SYMBOLS: () => SYMBOLS,
1653
+ debug: () => debug,
1654
+ error: () => error,
1655
+ getLogLevel: () => getLogLevel,
1656
+ info: () => info,
1657
+ intro: () => intro,
1658
+ log: () => log,
1659
+ logBox: () => logBox,
1660
+ outro: () => outro,
1661
+ setLogLevel: () => setLogLevel,
1662
+ shouldLog: () => shouldLog,
1663
+ step: () => step,
1664
+ warn: () => warn,
1665
+ wrapTextForClack: () => wrapTextForClack
1666
+ });
1667
+
1668
+ // ../node_modules/@clack/core/dist/index.mjs
1669
+ var import_picocolors = __toESM(require_picocolors(), 1), import_sisteransi = __toESM(require_src(), 1);
1670
+ import { stdout as z, stdin as Y } from "node:process";
1671
+ import * as k from "node:readline";
1672
+ import nt from "node:readline";
1673
+ import { ReadStream as q } from "node:tty";
1674
+ var ut = (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, ot = (t2) => t2 === 12288 || t2 >= 65281 && t2 <= 65376 || t2 >= 65504 && t2 <= 65510, at = (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, N = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, M = /\t{1,1000}/y, O = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu"), L = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, lt = new RegExp("\\p{M}+", "gu"), ht = { limit: 1 / 0, ellipsis: "" }, J = (t2, s = {}, e = {}) => {
1675
+ let i = s.limit ?? 1 / 0, r = s.ellipsis ?? "", n = s?.ellipsisWidth ?? (r ? J(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, V = e.wideWidth ?? 2, o = 0, u = 0, p = t2.length, E = 0, f = !1, d2 = p, _ = Math.max(0, i - n), C = 0, x2 = 0, h = 0, c = 0;
1676
+ t: for (; ; ) {
1677
+ if (x2 > C || u >= p && u > o) {
1678
+ let rt = t2.slice(C, x2) || t2.slice(o, u);
1679
+ E = 0;
1680
+ for (let H2 of rt.replaceAll(lt, "")) {
1681
+ let R2 = H2.codePointAt(0) || 0;
1682
+ if (ot(R2) ? c = m : at(R2) ? c = V : v !== A && ut(R2) ? c = v : c = A, h + c > _ && (d2 = Math.min(d2, Math.max(C, o) + E)), h + c > i) {
1683
+ f = !0;
1684
+ break t;
1685
+ }
1686
+ E += H2.length, h += c;
1687
+ }
1688
+ C = x2 = 0;
1689
+ }
1690
+ if (u >= p) break;
1691
+ if (L.lastIndex = u, L.test(t2)) {
1692
+ if (E = L.lastIndex - u, c = E * A, h + c > _ && (d2 = Math.min(d2, u + Math.floor((_ - h) / A))), h + c > i) {
1693
+ f = !0;
1694
+ break;
1695
+ }
1696
+ h += c, C = o, x2 = u, u = o = L.lastIndex;
1697
+ continue;
1698
+ }
1699
+ if (N.lastIndex = u, N.test(t2)) {
1700
+ if (h + F > _ && (d2 = Math.min(d2, u)), h + F > i) {
1701
+ f = !0;
1702
+ break;
1703
+ }
1704
+ h += F, C = o, x2 = u, u = o = N.lastIndex;
1705
+ continue;
1706
+ }
1707
+ if (y.lastIndex = u, y.test(t2)) {
1708
+ if (E = y.lastIndex - u, c = E * l, h + c > _ && (d2 = Math.min(d2, u + Math.floor((_ - h) / l))), h + c > i) {
1709
+ f = !0;
1710
+ break;
1711
+ }
1712
+ h += c, C = o, x2 = u, u = o = y.lastIndex;
1713
+ continue;
1714
+ }
1715
+ if (M.lastIndex = u, M.test(t2)) {
1716
+ if (E = M.lastIndex - u, c = E * a, h + c > _ && (d2 = Math.min(d2, u + Math.floor((_ - h) / a))), h + c > i) {
1717
+ f = !0;
1718
+ break;
1719
+ }
1720
+ h += c, C = o, x2 = u, u = o = M.lastIndex;
1721
+ continue;
1722
+ }
1723
+ if (O.lastIndex = u, O.test(t2)) {
1724
+ if (h + g > _ && (d2 = Math.min(d2, u)), h + g > i) {
1725
+ f = !0;
1726
+ break;
1727
+ }
1728
+ h += g, C = o, x2 = u, u = o = O.lastIndex;
1729
+ continue;
1730
+ }
1731
+ u += 1;
1732
+ }
1733
+ return { width: f ? _ : h, index: f ? d2 : p, truncated: f, ellipsed: f && i >= n };
1734
+ }, ct = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 }, S = (t2, s = {}) => J(t2, ct, s).width, W = "\x1B", X = "\x9B", Ft = 39, P = "\x07", Z = "[", pt = "]", Q = "m", j = `${pt}8;;`, tt = new RegExp(`(?:\\${Z}(?<code>\\d+)m|\\${j}(?<uri>.*)${P})`, "y"), ft = (t2) => {
1735
+ if (t2 >= 30 && t2 <= 37 || t2 >= 90 && t2 <= 97) return 39;
1736
+ if (t2 >= 40 && t2 <= 47 || t2 >= 100 && t2 <= 107) return 49;
1737
+ if (t2 === 1 || t2 === 2) return 22;
1738
+ if (t2 === 3) return 23;
1739
+ if (t2 === 4) return 24;
1740
+ if (t2 === 7) return 27;
1741
+ if (t2 === 8) return 28;
1742
+ if (t2 === 9) return 29;
1743
+ if (t2 === 0) return 0;
1744
+ }, st = (t2) => `${W}${Z}${t2}${Q}`, et = (t2) => `${W}${j}${t2}${P}`, dt = (t2) => t2.map((s) => S(s)), U = (t2, s, e) => {
1745
+ let i = s[Symbol.iterator](), r = !1, n = !1, F = t2.at(-1), l = F === void 0 ? 0 : S(F), a = i.next(), v = i.next(), g = 0;
1746
+ for (; !a.done; ) {
1747
+ let m = a.value, A = S(m);
1748
+ l + A <= e ? t2[t2.length - 1] += m : (t2.push(m), l = 0), (m === W || m === X) && (r = !0, n = s.startsWith(j, g + 1)), r ? n ? m === P && (r = !1, n = !1) : m === Q && (r = !1) : (l += A, l === e && !v.done && (t2.push(""), l = 0)), a = v, v = i.next(), g += m.length;
1749
+ }
1750
+ F = t2.at(-1), !l && F !== void 0 && F.length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
1751
+ }, mt = (t2) => {
1752
+ let s = t2.split(" "), e = s.length;
1753
+ for (; e > 0 && !(S(s[e - 1]) > 0); ) e--;
1754
+ return e === s.length ? t2 : s.slice(0, e).join(" ") + s.slice(e).join("");
1755
+ }, gt = (t2, s, e = {}) => {
1756
+ if (e.trim !== !1 && t2.trim() === "") return "";
1757
+ let i = "", r, n, F = t2.split(" "), l = dt(F), a = [""];
1758
+ for (let [o, u] of F.entries()) {
1759
+ e.trim !== !1 && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
1760
+ let p = S(a.at(-1) ?? "");
1761
+ if (o !== 0 && (p >= s && (e.wordWrap === !1 || e.trim === !1) && (a.push(""), p = 0), (p > 0 || e.trim === !1) && (a[a.length - 1] += " ", p++)), e.hard && l[o] > s) {
1762
+ let E = s - p, f = 1 + Math.floor((l[o] - E - 1) / s);
1763
+ Math.floor((l[o] - 1) / s) < f && a.push(""), U(a, u, s);
1764
+ continue;
1765
+ }
1766
+ if (p + l[o] > s && p > 0 && l[o] > 0) {
1767
+ if (e.wordWrap === !1 && p < s) {
1768
+ U(a, u, s);
1769
+ continue;
1770
+ }
1771
+ a.push("");
1772
+ }
1773
+ if (p + l[o] > s && e.wordWrap === !1) {
1774
+ U(a, u, s);
1775
+ continue;
1776
+ }
1777
+ a[a.length - 1] += u;
1778
+ }
1779
+ e.trim !== !1 && (a = a.map((o) => mt(o)));
1780
+ let v = a.join(`
1781
+ `), g = v[Symbol.iterator](), m = g.next(), A = g.next(), V = 0;
1782
+ for (; !m.done; ) {
1783
+ let o = m.value, u = A.value;
1784
+ if (i += o, o === W || o === X) {
1785
+ tt.lastIndex = V + 1;
1786
+ let f = tt.exec(v)?.groups;
1787
+ if (f?.code !== void 0) {
1788
+ let d2 = Number.parseFloat(f.code);
1789
+ r = d2 === Ft ? void 0 : d2;
1790
+ } else f?.uri !== void 0 && (n = f.uri.length === 0 ? void 0 : f.uri);
1791
+ }
1792
+ let p = r ? ft(r) : void 0;
1793
+ u === `
1794
+ ` ? (n && (i += et("")), r && p && (i += st(p))) : o === `
1795
+ ` && (r && p && (i += st(r)), n && (i += et(n))), V += o.length, m = A, A = g.next();
1796
+ }
1797
+ return i;
1798
+ };
1799
+ function it(t2, s, e) {
1800
+ return String(t2).normalize().replaceAll(`\r
1801
+ `, `
1802
+ `).split(`
1803
+ `).map((i) => gt(i, s, e)).join(`
1804
+ `);
1805
+ }
1806
+ var Et = ["up", "down", "left", "right", "space", "enter", "cancel"], b = { 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" } };
1807
+ function G(t2, s) {
1808
+ if (typeof t2 == "string") return b.aliases.get(t2) === s;
1809
+ for (let e of t2) if (e !== void 0 && G(e, s)) return !0;
1810
+ return !1;
1811
+ }
1812
+ function At(t2, s) {
1813
+ if (t2 === s) return;
1814
+ let e = t2.split(`
1815
+ `), i = s.split(`
1816
+ `), r = [];
1817
+ for (let n = 0; n < Math.max(e.length, i.length); n++) e[n] !== i[n] && r.push(n);
1818
+ return r;
1819
+ }
1820
+ var It = globalThis.process.platform.startsWith("win"), K = Symbol("clack:cancel");
1821
+ function _t(t2) {
1822
+ return t2 === K;
1823
+ }
1824
+ function T(t2, s) {
1825
+ let e = t2;
1826
+ e.isTTY && e.setRawMode(s);
1827
+ }
1828
+ function bt({ input: t2 = Y, output: s = z, overwrite: e = !0, hideCursor: i = !0 } = {}) {
1829
+ let r = k.createInterface({ input: t2, output: s, prompt: "", tabSize: 1 });
1830
+ k.emitKeypressEvents(t2, r), t2 instanceof q && t2.isTTY && t2.setRawMode(!0);
1831
+ let n = (F, { name: l, sequence: a }) => {
1832
+ let v = String(F);
1833
+ if (G([v, l, a], "cancel")) {
1834
+ i && s.write(import_sisteransi.cursor.show), process.exit(0);
1835
+ return;
1836
+ }
1837
+ if (!e) return;
1838
+ k.moveCursor(s, l === "return" ? 0 : -1, l === "return" ? -1 : 0, () => {
1839
+ k.clearLine(s, 1, () => {
1840
+ t2.once("keypress", n);
1841
+ });
1842
+ });
1843
+ };
1844
+ return i && s.write(import_sisteransi.cursor.hide), t2.once("keypress", n), () => {
1845
+ t2.off("keypress", n), i && s.write(import_sisteransi.cursor.show), t2 instanceof q && t2.isTTY && !It && t2.setRawMode(!1), r.terminal = !1, r.close();
1846
+ };
1847
+ }
1848
+ var Ct = (t2) => "columns" in t2 && typeof t2.columns == "number" ? t2.columns : 80, Bt = (t2) => "rows" in t2 && typeof t2.rows == "number" ? t2.rows : 20, B = class {
1849
+ input;
1850
+ output;
1851
+ _abortSignal;
1852
+ rl;
1853
+ opts;
1854
+ _render;
1855
+ _track = !1;
1856
+ _prevFrame = "";
1857
+ _subscribers = /* @__PURE__ */ new Map();
1858
+ _cursor = 0;
1859
+ state = "initial";
1860
+ error = "";
1861
+ value;
1862
+ userInput = "";
1863
+ constructor(s, e = !0) {
1864
+ let { input: i = Y, output: r = z, render: n, signal: F, ...l } = s;
1865
+ 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;
1866
+ }
1867
+ unsubscribe() {
1868
+ this._subscribers.clear();
1869
+ }
1870
+ setSubscriber(s, e) {
1871
+ let i = this._subscribers.get(s) ?? [];
1872
+ i.push(e), this._subscribers.set(s, i);
1873
+ }
1874
+ on(s, e) {
1875
+ this.setSubscriber(s, { cb: e });
1876
+ }
1877
+ once(s, e) {
1878
+ this.setSubscriber(s, { cb: e, once: !0 });
1879
+ }
1880
+ emit(s, ...e) {
1881
+ let i = this._subscribers.get(s) ?? [], r = [];
1882
+ for (let n of i) n.cb(...e), n.once && r.push(() => i.splice(i.indexOf(n), 1));
1883
+ for (let n of r) n();
1884
+ }
1885
+ prompt() {
1886
+ return new Promise((s) => {
1887
+ if (this._abortSignal) {
1888
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), s(K);
1889
+ this._abortSignal.addEventListener("abort", () => {
1890
+ this.state = "cancel", this.close();
1891
+ }, { once: !0 });
1892
+ }
1893
+ this.rl = nt.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: !0 }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), T(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
1894
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1), s(this.value);
1895
+ }), this.once("cancel", () => {
1896
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1), s(K);
1897
+ });
1898
+ });
1899
+ }
1900
+ _isActionKey(s, e) {
1901
+ return s === " ";
1902
+ }
1903
+ _setValue(s) {
1904
+ this.value = s, this.emit("value", this.value);
1905
+ }
1906
+ _setUserInput(s, e) {
1907
+ this.userInput = s ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
1908
+ }
1909
+ _clearUserInput() {
1910
+ this.rl?.write(null, { ctrl: !0, name: "u" }), this._setUserInput("");
1911
+ }
1912
+ onKeypress(s, e) {
1913
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(s, e) && this.rl?.write(null, { ctrl: !0, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && b.aliases.has(e.name) && this.emit("cursor", b.aliases.get(e.name)), b.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") {
1914
+ if (this.opts.validate) {
1915
+ let i = this.opts.validate(this.value);
1916
+ i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
1917
+ }
1918
+ this.state !== "error" && (this.state = "submit");
1919
+ }
1920
+ G([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();
1921
+ }
1922
+ close() {
1923
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
1924
+ `), T(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
1925
+ }
1926
+ restoreCursor() {
1927
+ let s = it(this._prevFrame, process.stdout.columns, { hard: !0, trim: !1 }).split(`
1928
+ `).length - 1;
1929
+ this.output.write(import_sisteransi.cursor.move(-999, s * -1));
1930
+ }
1931
+ render() {
1932
+ let s = it(this._render(this) ?? "", process.stdout.columns, { hard: !0, trim: !1 });
1933
+ if (s !== this._prevFrame) {
1934
+ if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
1935
+ else {
1936
+ let e = At(this._prevFrame, s);
1937
+ if (this.restoreCursor(), e && e?.length === 1) {
1938
+ let i = e[0];
1939
+ this.output.write(import_sisteransi.cursor.move(0, i)), this.output.write(import_sisteransi.erase.lines(1));
1940
+ let r = s.split(`
1941
+ `);
1942
+ this.output.write(r[i]), this._prevFrame = s, this.output.write(import_sisteransi.cursor.move(0, r.length - i - 1));
1943
+ return;
1944
+ }
1945
+ if (e && e?.length > 1) {
1946
+ let i = e[0];
1947
+ this.output.write(import_sisteransi.cursor.move(0, i)), this.output.write(import_sisteransi.erase.down());
1948
+ let r = s.split(`
1949
+ `).slice(i);
1950
+ this.output.write(r.join(`
1951
+ `)), this._prevFrame = s;
1952
+ return;
1953
+ }
1954
+ this.output.write(import_sisteransi.erase.down());
1955
+ }
1956
+ this.output.write(s), this.state === "initial" && (this.state = "active"), this._prevFrame = s;
1957
+ }
1958
+ }
1959
+ };
1960
+ var Vt = class extends B {
1961
+ get cursor() {
1962
+ return this.value ? 0 : 1;
1963
+ }
1964
+ get _value() {
1965
+ return this.cursor === 0;
1966
+ }
1967
+ constructor(s) {
1968
+ super(s, !1), this.value = !!s.initialValue, this.on("userInput", () => {
1969
+ this.value = this._value;
1970
+ }), this.on("confirm", (e) => {
1971
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
1972
+ }), this.on("cursor", () => {
1973
+ this.value = !this.value;
1974
+ });
1975
+ }
1976
+ };
1977
+ function w(t2, s, e) {
1978
+ let i = t2 + s, r = Math.max(e.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
1979
+ return e[n].disabled ? w(n, s < 0 ? -1 : 1, e) : n;
1980
+ }
1981
+ var yt = class extends B {
1982
+ options;
1983
+ cursor = 0;
1984
+ get _value() {
1985
+ return this.options[this.cursor].value;
1986
+ }
1987
+ get _enabledOptions() {
1988
+ return this.options.filter((s) => s.disabled !== !0);
1989
+ }
1990
+ toggleAll() {
1991
+ let s = this._enabledOptions, e = this.value !== void 0 && this.value.length === s.length;
1992
+ this.value = e ? [] : s.map((i) => i.value);
1993
+ }
1994
+ toggleInvert() {
1995
+ let s = this.value;
1996
+ if (!s) return;
1997
+ let e = this._enabledOptions.filter((i) => !s.includes(i.value));
1998
+ this.value = e.map((i) => i.value);
1999
+ }
2000
+ toggleValue() {
2001
+ this.value === void 0 && (this.value = []);
2002
+ let s = this.value.includes(this._value);
2003
+ this.value = s ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
2004
+ }
2005
+ constructor(s) {
2006
+ super(s, !1), this.options = s.options, this.value = [...s.initialValues ?? []];
2007
+ let e = Math.max(this.options.findIndex(({ value: i }) => i === s.cursorAt), 0);
2008
+ this.cursor = this.options[e].disabled ? w(e, 1, this.options) : e, this.on("key", (i) => {
2009
+ i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
2010
+ }), this.on("cursor", (i) => {
2011
+ switch (i) {
2012
+ case "left":
2013
+ case "up":
2014
+ this.cursor = w(this.cursor, -1, this.options);
2015
+ break;
2016
+ case "down":
2017
+ case "right":
2018
+ this.cursor = w(this.cursor, 1, this.options);
2019
+ break;
2020
+ case "space":
2021
+ this.toggleValue();
2022
+ break;
2023
+ }
2024
+ });
2025
+ }
2026
+ };
2027
+ var Lt = class extends B {
2028
+ options;
2029
+ cursor = 0;
2030
+ get _selectedValue() {
2031
+ return this.options[this.cursor];
2032
+ }
2033
+ changeValue() {
2034
+ this.value = this._selectedValue.value;
2035
+ }
2036
+ constructor(s) {
2037
+ super(s, !1), this.options = s.options;
2038
+ let e = this.options.findIndex(({ value: r }) => r === s.initialValue), i = e === -1 ? 0 : e;
2039
+ this.cursor = this.options[i].disabled ? w(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
2040
+ switch (r) {
2041
+ case "left":
2042
+ case "up":
2043
+ this.cursor = w(this.cursor, -1, this.options);
2044
+ break;
2045
+ case "down":
2046
+ case "right":
2047
+ this.cursor = w(this.cursor, 1, this.options);
2048
+ break;
2049
+ }
2050
+ this.changeValue();
2051
+ });
2052
+ }
2053
+ };
2054
+ var Tt = class extends B {
2055
+ get userInputWithCursor() {
2056
+ if (this.state === "submit") return this.userInput;
2057
+ let s = this.userInput;
2058
+ if (this.cursor >= s.length) return `${this.userInput}\u2588`;
2059
+ let e = s.slice(0, this.cursor), [i, ...r] = s.slice(this.cursor);
2060
+ return `${e}${import_picocolors.default.inverse(i)}${r.join("")}`;
2061
+ }
2062
+ get cursor() {
2063
+ return this._cursor;
2064
+ }
2065
+ constructor(s) {
2066
+ super({ ...s, initialUserInput: s.initialUserInput ?? s.initialValue }), this.on("userInput", (e) => {
2067
+ this._setValue(e);
2068
+ }), this.on("finalize", () => {
2069
+ this.value || (this.value = s.defaultValue), this.value === void 0 && (this.value = "");
2070
+ });
2071
+ }
2072
+ };
2073
+
2074
+ // ../node_modules/@clack/prompts/dist/index.mjs
2075
+ var import_picocolors2 = __toESM(require_picocolors(), 1);
2076
+ import N2 from "node:process";
2077
+ var import_sisteransi2 = __toESM(require_src(), 1);
2078
+ function ut2() {
2079
+ return N2.platform !== "win32" ? N2.env.TERM !== "linux" : !!N2.env.CI || !!N2.env.WT_SESSION || !!N2.env.TERMINUS_SUBLIME || N2.env.ConEmuTask === "{cmd::Cmder}" || N2.env.TERM_PROGRAM === "Terminus-Sublime" || N2.env.TERM_PROGRAM === "vscode" || N2.env.TERM === "xterm-256color" || N2.env.TERM === "alacritty" || N2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2080
+ }
2081
+ var z2 = ut2(), ne = () => process.env.CI === "true", Be = (e) => e.isTTY === !0, I2 = (e, i) => z2 ? e : i, be = I2("\u25C6", "*"), ae = I2("\u25A0", "x"), oe = I2("\u25B2", "x"), W2 = I2("\u25C7", "o"), le = I2("\u250C", "T"), d = I2("\u2502", "|"), x = I2("\u2514", "\u2014"), xe = I2("\u2510", "T"), _e = I2("\u2518", "\u2014"), J2 = I2("\u25CF", ">"), H = I2("\u25CB", " "), Z2 = I2("\u25FB", "[\u2022]"), j2 = I2("\u25FC", "[+]"), X2 = I2("\u25FB", "[ ]"), De = I2("\u25AA", "\u2022"), Q2 = I2("\u2500", "-"), ue = I2("\u256E", "+"), Te = I2("\u251C", "+"), ce = I2("\u256F", "+"), Me = I2("\u2570", "+"), Re = I2("\u256D", "+"), de = I2("\u25CF", "\u2022"), $e = I2("\u25C6", "*"), he = I2("\u25B2", "!"), me = I2("\u25A0", "x"), L2 = (e) => {
2082
+ switch (e) {
2083
+ case "initial":
2084
+ case "active":
2085
+ return import_picocolors2.default.cyan(be);
2086
+ case "cancel":
2087
+ return import_picocolors2.default.red(ae);
2088
+ case "error":
2089
+ return import_picocolors2.default.yellow(oe);
2090
+ case "submit":
2091
+ return import_picocolors2.default.green(W2);
2092
+ }
2093
+ }, ct2 = (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, dt2 = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, $t = (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, pe = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, ee = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, te = /\t{1,1000}/y, ge = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu"), se = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, ht2 = new RegExp("\\p{M}+", "gu"), mt2 = { limit: 1 / 0, ellipsis: "" }, Oe = (e, i = {}, s = {}) => {
2094
+ let r = i.limit ?? 1 / 0, n = i.ellipsis ?? "", o = i?.ellipsisWidth ?? (n ? Oe(n, mt2, s).width : 0), l = s.ansiWidth ?? 0, u = s.controlWidth ?? 0, a = s.tabWidth ?? 8, h = s.ambiguousWidth ?? 1, y2 = s.emojiWidth ?? 2, E = s.fullWidthWidth ?? 2, f = s.regularWidth ?? 1, F = s.wideWidth ?? 2, c = 0, m = 0, $2 = e.length, p = 0, g = !1, v = $2, S2 = Math.max(0, r - o), w2 = 0, b2 = 0, A = 0, C = 0;
2095
+ e: for (; ; ) {
2096
+ if (b2 > w2 || m >= $2 && m > c) {
2097
+ let _ = e.slice(w2, b2) || e.slice(c, m);
2098
+ p = 0;
2099
+ for (let D2 of _.replaceAll(ht2, "")) {
2100
+ let T2 = D2.codePointAt(0) || 0;
2101
+ if (dt2(T2) ? C = E : $t(T2) ? C = F : h !== f && ct2(T2) ? C = h : C = f, A + C > S2 && (v = Math.min(v, Math.max(w2, c) + p)), A + C > r) {
2102
+ g = !0;
2103
+ break e;
2104
+ }
2105
+ p += D2.length, A += C;
2106
+ }
2107
+ w2 = b2 = 0;
2108
+ }
2109
+ if (m >= $2) break;
2110
+ if (se.lastIndex = m, se.test(e)) {
2111
+ if (p = se.lastIndex - m, C = p * f, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / f))), A + C > r) {
2112
+ g = !0;
2113
+ break;
2114
+ }
2115
+ A += C, w2 = c, b2 = m, m = c = se.lastIndex;
2116
+ continue;
2117
+ }
2118
+ if (pe.lastIndex = m, pe.test(e)) {
2119
+ if (A + l > S2 && (v = Math.min(v, m)), A + l > r) {
2120
+ g = !0;
2121
+ break;
2122
+ }
2123
+ A += l, w2 = c, b2 = m, m = c = pe.lastIndex;
2124
+ continue;
2125
+ }
2126
+ if (ee.lastIndex = m, ee.test(e)) {
2127
+ if (p = ee.lastIndex - m, C = p * u, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / u))), A + C > r) {
2128
+ g = !0;
2129
+ break;
2130
+ }
2131
+ A += C, w2 = c, b2 = m, m = c = ee.lastIndex;
2132
+ continue;
2133
+ }
2134
+ if (te.lastIndex = m, te.test(e)) {
2135
+ if (p = te.lastIndex - m, C = p * a, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / a))), A + C > r) {
2136
+ g = !0;
2137
+ break;
2138
+ }
2139
+ A += C, w2 = c, b2 = m, m = c = te.lastIndex;
2140
+ continue;
2141
+ }
2142
+ if (ge.lastIndex = m, ge.test(e)) {
2143
+ if (A + y2 > S2 && (v = Math.min(v, m)), A + y2 > r) {
2144
+ g = !0;
2145
+ break;
2146
+ }
2147
+ A += y2, w2 = c, b2 = m, m = c = ge.lastIndex;
2148
+ continue;
2149
+ }
2150
+ m += 1;
2151
+ }
2152
+ return { width: g ? S2 : A, index: g ? v : $2, truncated: g, ellipsed: g && r >= o };
2153
+ }, pt2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 }, M2 = (e, i = {}) => Oe(e, pt2, i).width, re = "\x1B", Ne = "\x9B", gt2 = 39, fe = "\x07", Pe = "[", ft2 = "]", Le = "m", Fe = `${ft2}8;;`, We = new RegExp(`(?:\\${Pe}(?<code>\\d+)m|\\${Fe}(?<uri>.*)${fe})`, "y"), Ft2 = (e) => {
2154
+ if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
2155
+ if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
2156
+ if (e === 1 || e === 2) return 22;
2157
+ if (e === 3) return 23;
2158
+ if (e === 4) return 24;
2159
+ if (e === 7) return 27;
2160
+ if (e === 8) return 28;
2161
+ if (e === 9) return 29;
2162
+ if (e === 0) return 0;
2163
+ }, je = (e) => `${re}${Pe}${e}${Le}`, Ve = (e) => `${re}${Fe}${e}${fe}`, yt2 = (e) => e.map((i) => M2(i)), ye = (e, i, s) => {
2164
+ let r = i[Symbol.iterator](), n = !1, o = !1, l = e.at(-1), u = l === void 0 ? 0 : M2(l), a = r.next(), h = r.next(), y2 = 0;
2165
+ for (; !a.done; ) {
2166
+ let E = a.value, f = M2(E);
2167
+ u + f <= s ? e[e.length - 1] += E : (e.push(E), u = 0), (E === re || E === Ne) && (n = !0, o = i.startsWith(Fe, y2 + 1)), n ? o ? E === fe && (n = !1, o = !1) : E === Le && (n = !1) : (u += f, u === s && !h.done && (e.push(""), u = 0)), a = h, h = r.next(), y2 += E.length;
2168
+ }
2169
+ l = e.at(-1), !u && l !== void 0 && l.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
2170
+ }, Et2 = (e) => {
2171
+ let i = e.split(" "), s = i.length;
2172
+ for (; s > 0 && !(M2(i[s - 1]) > 0); ) s--;
2173
+ return s === i.length ? e : i.slice(0, s).join(" ") + i.slice(s).join("");
2174
+ }, vt2 = (e, i, s = {}) => {
2175
+ if (s.trim !== !1 && e.trim() === "") return "";
2176
+ let r = "", n, o, l = e.split(" "), u = yt2(l), a = [""];
2177
+ for (let [c, m] of l.entries()) {
2178
+ s.trim !== !1 && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
2179
+ let $2 = M2(a.at(-1) ?? "");
2180
+ if (c !== 0 && ($2 >= i && (s.wordWrap === !1 || s.trim === !1) && (a.push(""), $2 = 0), ($2 > 0 || s.trim === !1) && (a[a.length - 1] += " ", $2++)), s.hard && u[c] > i) {
2181
+ let p = i - $2, g = 1 + Math.floor((u[c] - p - 1) / i);
2182
+ Math.floor((u[c] - 1) / i) < g && a.push(""), ye(a, m, i);
2183
+ continue;
2184
+ }
2185
+ if ($2 + u[c] > i && $2 > 0 && u[c] > 0) {
2186
+ if (s.wordWrap === !1 && $2 < i) {
2187
+ ye(a, m, i);
2188
+ continue;
2189
+ }
2190
+ a.push("");
2191
+ }
2192
+ if ($2 + u[c] > i && s.wordWrap === !1) {
2193
+ ye(a, m, i);
2194
+ continue;
2195
+ }
2196
+ a[a.length - 1] += m;
2197
+ }
2198
+ s.trim !== !1 && (a = a.map((c) => Et2(c)));
2199
+ let h = a.join(`
2200
+ `), y2 = h[Symbol.iterator](), E = y2.next(), f = y2.next(), F = 0;
2201
+ for (; !E.done; ) {
2202
+ let c = E.value, m = f.value;
2203
+ if (r += c, c === re || c === Ne) {
2204
+ We.lastIndex = F + 1;
2205
+ let g = We.exec(h)?.groups;
2206
+ if (g?.code !== void 0) {
2207
+ let v = Number.parseFloat(g.code);
2208
+ n = v === gt2 ? void 0 : v;
2209
+ } else g?.uri !== void 0 && (o = g.uri.length === 0 ? void 0 : g.uri);
2210
+ }
2211
+ let $2 = n ? Ft2(n) : void 0;
2212
+ m === `
2213
+ ` ? (o && (r += Ve("")), n && $2 && (r += je($2))) : c === `
2214
+ ` && (n && $2 && (r += je(n)), o && (r += Ve(o))), F += c.length, E = f, f = y2.next();
2215
+ }
2216
+ return r;
2217
+ };
2218
+ function U2(e, i, s) {
2219
+ return String(e).normalize().replaceAll(`\r
2220
+ `, `
2221
+ `).split(`
2222
+ `).map((r) => vt2(r, i, s)).join(`
2223
+ `);
2224
+ }
2225
+ var At2 = (e, i, s, r, n) => {
2226
+ let o = i, l = 0;
2227
+ for (let u = s; u < r; u++) {
2228
+ let a = e[u];
2229
+ if (o = o - a.length, l++, o <= n) break;
2230
+ }
2231
+ return { lineCount: o, removals: l };
2232
+ }, K2 = (e) => {
2233
+ let { cursor: i, options: s, style: r } = e, n = e.output ?? process.stdout, o = Ct(n), l = e.columnPadding ?? 0, u = e.rowPadding ?? 4, a = o - l, h = Bt(n), y2 = import_picocolors2.default.dim("..."), E = e.maxItems ?? Number.POSITIVE_INFINITY, f = Math.max(h - u, 0), F = Math.max(Math.min(E, f), 5), c = 0;
2234
+ i >= F - 3 && (c = Math.max(Math.min(i - F + 3, s.length - F), 0));
2235
+ let m = F < s.length && c > 0, $2 = F < s.length && c + F < s.length, p = Math.min(c + F, s.length), g = [], v = 0;
2236
+ m && v++, $2 && v++;
2237
+ let S2 = c + (m ? 1 : 0), w2 = p - ($2 ? 1 : 0);
2238
+ for (let A = S2; A < w2; A++) {
2239
+ let C = U2(r(s[A], A === i), a, { hard: !0, trim: !1 }).split(`
2240
+ `);
2241
+ g.push(C), v += C.length;
2242
+ }
2243
+ if (v > f) {
2244
+ let A = 0, C = 0, _ = v, D2 = i - S2, T2 = (k2, B2) => At2(g, _, k2, B2, f);
2245
+ m ? ({ lineCount: _, removals: A } = T2(0, D2), _ > f && ({ lineCount: _, removals: C } = T2(D2 + 1, g.length))) : ({ lineCount: _, removals: C } = T2(D2 + 1, g.length), _ > f && ({ lineCount: _, removals: A } = T2(0, D2))), A > 0 && (m = !0, g.splice(0, A)), C > 0 && ($2 = !0, g.splice(g.length - C, C));
2246
+ }
2247
+ let b2 = [];
2248
+ m && b2.push(y2);
2249
+ for (let A of g) for (let C of A) b2.push(C);
2250
+ return $2 && b2.push(y2), b2;
2251
+ };
2252
+ var St2 = [Re, ue, Me, ce], wt = [le, xe, x, _e];
2253
+ function Ue(e, i, s, r) {
2254
+ let n = s, o = s;
2255
+ return r === "center" ? n = Math.floor((i - e) / 2) : r === "right" && (n = i - e - s), o = i - n - e, [n, o];
2256
+ }
2257
+ var Bt2 = (e) => e, bt2 = (e = "", i = "", s) => {
2258
+ let r = s?.output ?? process.stdout, n = Ct(r), o = 2, l = s?.titlePadding ?? 1, u = s?.contentPadding ?? 2, a = s?.width === void 0 || s.width === "auto" ? 1 : Math.min(1, s.width), h = s?.includePrefix ? `${d} ` : "", y2 = s?.formatBorder ?? Bt2, E = (s?.rounded ? St2 : wt).map(y2), f = y2(Q2), F = y2(d), c = M2(h), m = M2(i), $2 = n - c, p = Math.floor(n * a) - c;
2259
+ if (s?.width === "auto") {
2260
+ let _ = e.split(`
2261
+ `), D2 = m + l * 2;
2262
+ for (let k2 of _) {
2263
+ let B2 = M2(k2) + u * 2;
2264
+ B2 > D2 && (D2 = B2);
2265
+ }
2266
+ let T2 = D2 + o;
2267
+ T2 < p && (p = T2);
2268
+ }
2269
+ p % 2 !== 0 && (p < $2 ? p++ : p--);
2270
+ let g = p - o, v = g - l * 2, S2 = m > v ? `${i.slice(0, v - 3)}...` : i, [w2, b2] = Ue(M2(S2), g, l, s?.titleAlign), A = U2(e, g - u * 2, { hard: !0, trim: !1 });
2271
+ r.write(`${h}${E[0]}${f.repeat(w2)}${S2}${f.repeat(b2)}${E[1]}
2272
+ `);
2273
+ let C = A.split(`
2274
+ `);
2275
+ for (let _ of C) {
2276
+ let [D2, T2] = Ue(M2(_), g, u, s?.contentAlign);
2277
+ r.write(`${h}${F}${" ".repeat(D2)}${_}${" ".repeat(T2)}${F}
2278
+ `);
2279
+ }
2280
+ r.write(`${h}${E[2]}${f.repeat(g)}${E[3]}
2281
+ `);
2282
+ }, xt = (e) => {
2283
+ let i = e.active ?? "Yes", s = e.inactive ?? "No";
2284
+ return new Vt({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? !0, render() {
2285
+ let r = `${import_picocolors2.default.gray(d)}
2286
+ ${L2(this.state)} ${e.message}
2287
+ `, n = this.value ? i : s;
2288
+ switch (this.state) {
2289
+ case "submit":
2290
+ return `${r}${import_picocolors2.default.gray(d)} ${import_picocolors2.default.dim(n)}`;
2291
+ case "cancel":
2292
+ return `${r}${import_picocolors2.default.gray(d)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}
2293
+ ${import_picocolors2.default.gray(d)}`;
2294
+ default:
2295
+ return `${r}${import_picocolors2.default.cyan(d)} ${this.value ? `${import_picocolors2.default.green(J2)} ${i}` : `${import_picocolors2.default.dim(H)} ${import_picocolors2.default.dim(i)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(H)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(J2)} ${s}`}
2296
+ ${import_picocolors2.default.cyan(x)}
2297
+ `;
2298
+ }
2299
+ } }).prompt();
2300
+ };
2301
+ var R = { message: (e = [], { symbol: i = import_picocolors2.default.gray(d), secondarySymbol: s = import_picocolors2.default.gray(d), output: r = process.stdout, spacing: n = 1 } = {}) => {
2302
+ let o = [];
2303
+ for (let u = 0; u < n; u++) o.push(`${s}`);
2304
+ let l = Array.isArray(e) ? e : e.split(`
2305
+ `);
2306
+ if (l.length > 0) {
2307
+ let [u, ...a] = l;
2308
+ u.length > 0 ? o.push(`${i} ${u}`) : o.push(i);
2309
+ for (let h of a) h.length > 0 ? o.push(`${s} ${h}`) : o.push(s);
2310
+ }
2311
+ r.write(`${o.join(`
2312
+ `)}
2313
+ `);
2314
+ }, info: (e, i) => {
2315
+ R.message(e, { ...i, symbol: import_picocolors2.default.blue(de) });
2316
+ }, success: (e, i) => {
2317
+ R.message(e, { ...i, symbol: import_picocolors2.default.green($e) });
2318
+ }, step: (e, i) => {
2319
+ R.message(e, { ...i, symbol: import_picocolors2.default.green(W2) });
2320
+ }, warn: (e, i) => {
2321
+ R.message(e, { ...i, symbol: import_picocolors2.default.yellow(he) });
2322
+ }, warning: (e, i) => {
2323
+ R.warn(e, i);
2324
+ }, error: (e, i) => {
2325
+ R.message(e, { ...i, symbol: import_picocolors2.default.red(me) });
2326
+ } }, Tt2 = (e = "", i) => {
2327
+ (i?.output ?? process.stdout).write(`${import_picocolors2.default.gray(x)} ${import_picocolors2.default.red(e)}
2328
+
2329
+ `);
2330
+ }, Mt2 = (e = "", i) => {
2331
+ (i?.output ?? process.stdout).write(`${import_picocolors2.default.gray(le)} ${e}
2332
+ `);
2333
+ }, Rt = (e = "", i) => {
2334
+ (i?.output ?? process.stdout).write(`${import_picocolors2.default.gray(d)}
2335
+ ${import_picocolors2.default.gray(x)} ${e}
2336
+
2337
+ `);
2338
+ }, Ot = (e) => {
2339
+ let i = (r, n) => {
2340
+ let o = r.label ?? String(r.value);
2341
+ return n === "disabled" ? `${import_picocolors2.default.gray(X2)} ${import_picocolors2.default.gray(o)}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint ?? "disabled"})`)}` : ""}` : n === "active" ? `${import_picocolors2.default.cyan(Z2)} ${o}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint})`)}` : ""}` : n === "selected" ? `${import_picocolors2.default.green(j2)} ${import_picocolors2.default.dim(o)}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint})`)}` : ""}` : n === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o))}` : n === "active-selected" ? `${import_picocolors2.default.green(j2)} ${o}${r.hint ? ` ${import_picocolors2.default.dim(`(${r.hint})`)}` : ""}` : n === "submitted" ? `${import_picocolors2.default.dim(o)}` : `${import_picocolors2.default.dim(X2)} ${import_picocolors2.default.dim(o)}`;
2342
+ }, s = e.required ?? !0;
2343
+ return new yt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(r) {
2344
+ if (s && (r === void 0 || r.length === 0)) return `Please select at least one option.
2345
+ ${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`))}`;
2346
+ }, render() {
2347
+ let r = `${import_picocolors2.default.gray(d)}
2348
+ ${L2(this.state)} ${e.message}
2349
+ `, n = this.value ?? [], o = (l, u) => {
2350
+ if (l.disabled) return i(l, "disabled");
2351
+ let a = n.includes(l.value);
2352
+ return u && a ? i(l, "active-selected") : a ? i(l, "selected") : i(l, u ? "active" : "inactive");
2353
+ };
2354
+ switch (this.state) {
2355
+ case "submit":
2356
+ return `${r}${import_picocolors2.default.gray(d)} ${this.options.filter(({ value: l }) => n.includes(l)).map((l) => i(l, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
2357
+ case "cancel": {
2358
+ let l = this.options.filter(({ value: u }) => n.includes(u)).map((u) => i(u, "cancelled")).join(import_picocolors2.default.dim(", "));
2359
+ return `${r}${import_picocolors2.default.gray(d)}${l.trim() ? ` ${l}
2360
+ ${import_picocolors2.default.gray(d)}` : ""}`;
2361
+ }
2362
+ case "error": {
2363
+ let l = `${import_picocolors2.default.yellow(d)} `, u = this.error.split(`
2364
+ `).map((a, h) => h === 0 ? `${import_picocolors2.default.yellow(x)} ${import_picocolors2.default.yellow(a)}` : ` ${a}`).join(`
2365
+ `);
2366
+ return `${r}${l}${K2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, style: o }).join(`
2367
+ ${l}`)}
2368
+ ${u}
2369
+ `;
2370
+ }
2371
+ default: {
2372
+ let l = `${import_picocolors2.default.cyan(d)} `;
2373
+ return `${r}${l}${K2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, style: o }).join(`
2374
+ ${l}`)}
2375
+ ${import_picocolors2.default.cyan(x)}
2376
+ `;
2377
+ }
2378
+ }
2379
+ } }).prompt();
2380
+ };
2381
+ var Vt2 = import_picocolors2.default.magenta, Ee = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: n, frames: o = z2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: l = z2 ? 80 : 120, signal: u, ...a } = {}) => {
2382
+ let h = ne(), y2, E, f = !1, F = !1, c = "", m, $2 = performance.now(), p = Ct(s), g = a?.styleFrame ?? Vt2, v = (B2) => {
2383
+ let O2 = B2 > 1 ? n ?? b.messages.error : r ?? b.messages.cancel;
2384
+ F = B2 === 1, f && (k2(O2, B2), F && typeof i == "function" && i());
2385
+ }, S2 = () => v(2), w2 = () => v(1), b2 = () => {
2386
+ process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", w2), process.on("SIGTERM", w2), process.on("exit", v), u && u.addEventListener("abort", w2);
2387
+ }, A = () => {
2388
+ process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT", w2), process.removeListener("SIGTERM", w2), process.removeListener("exit", v), u && u.removeEventListener("abort", w2);
2389
+ }, C = () => {
2390
+ if (m === void 0) return;
2391
+ h && s.write(`
2392
+ `);
2393
+ let B2 = U2(m, p, { hard: !0, trim: !1 }).split(`
2394
+ `);
2395
+ B2.length > 1 && s.write(import_sisteransi2.cursor.up(B2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
2396
+ }, _ = (B2) => B2.replace(/\.+$/, ""), D2 = (B2) => {
2397
+ let O2 = (performance.now() - B2) / 1e3, P2 = Math.floor(O2 / 60), G2 = Math.floor(O2 % 60);
2398
+ return P2 > 0 ? `[${P2}m ${G2}s]` : `[${G2}s]`;
2399
+ }, T2 = (B2 = "") => {
2400
+ f = !0, y2 = bt({ output: s }), c = _(B2), $2 = performance.now(), s.write(`${import_picocolors2.default.gray(d)}
2401
+ `);
2402
+ let O2 = 0, P2 = 0;
2403
+ b2(), E = setInterval(() => {
2404
+ if (h && c === m) return;
2405
+ C(), m = c;
2406
+ let G2 = g(o[O2]), Y2;
2407
+ if (h) Y2 = `${G2} ${c}...`;
2408
+ else if (e === "timer") Y2 = `${G2} ${c} ${D2($2)}`;
2409
+ else {
2410
+ let Xe = ".".repeat(Math.floor(P2)).slice(0, 3);
2411
+ Y2 = `${G2} ${c}${Xe}`;
2412
+ }
2413
+ let Je = U2(Y2, p, { hard: !0, trim: !1 });
2414
+ s.write(Je), O2 = O2 + 1 < o.length ? O2 + 1 : 0, P2 = P2 < 4 ? P2 + 0.125 : 0;
2415
+ }, l);
2416
+ }, k2 = (B2 = "", O2 = 0) => {
2417
+ if (!f) return;
2418
+ f = !1, clearInterval(E), C();
2419
+ let P2 = O2 === 0 ? import_picocolors2.default.green(W2) : O2 === 1 ? import_picocolors2.default.red(ae) : import_picocolors2.default.red(oe);
2420
+ c = B2 ?? c, e === "timer" ? s.write(`${P2} ${c} ${D2($2)}
2421
+ `) : s.write(`${P2} ${c}
2422
+ `), A(), y2();
2423
+ };
2424
+ return { start: T2, stop: k2, message: (B2 = "") => {
2425
+ c = _(B2 ?? c);
2426
+ }, get isCancelled() {
2427
+ return F;
2428
+ } };
2429
+ }, Ke = { light: I2("\u2500", "-"), heavy: I2("\u2501", "="), block: I2("\u2588", "#") };
2430
+ var Gt = (e) => {
2431
+ let i = (s, r) => {
2432
+ let n = s.label ?? String(s.value);
2433
+ switch (r) {
2434
+ case "disabled":
2435
+ return `${import_picocolors2.default.gray(H)} ${import_picocolors2.default.gray(n)}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
2436
+ case "selected":
2437
+ return `${import_picocolors2.default.dim(n)}`;
2438
+ case "active":
2439
+ return `${import_picocolors2.default.green(J2)} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
2440
+ case "cancelled":
2441
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}`;
2442
+ default:
2443
+ return `${import_picocolors2.default.dim(H)} ${import_picocolors2.default.dim(n)}`;
2444
+ }
2445
+ };
2446
+ return new Lt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
2447
+ let s = `${import_picocolors2.default.gray(d)}
2448
+ ${L2(this.state)} ${e.message}
2449
+ `;
2450
+ switch (this.state) {
2451
+ case "submit":
2452
+ return `${s}${import_picocolors2.default.gray(d)} ${i(this.options[this.cursor], "selected")}`;
2453
+ case "cancel":
2454
+ return `${s}${import_picocolors2.default.gray(d)} ${i(this.options[this.cursor], "cancelled")}
2455
+ ${import_picocolors2.default.gray(d)}`;
2456
+ default: {
2457
+ let r = `${import_picocolors2.default.cyan(d)} `;
2458
+ return `${s}${r}${K2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: r.length, style: (n, o) => i(n, n.disabled ? "disabled" : o ? "active" : "inactive") }).join(`
2459
+ ${r}`)}
2460
+ ${import_picocolors2.default.cyan(x)}
2461
+ `;
2462
+ }
2463
+ }
2464
+ } }).prompt();
2465
+ };
2466
+ var qe = `${import_picocolors2.default.gray(d)} `;
2467
+ var Kt = (e) => {
2468
+ let i = e.output ?? process.stdout, s = Ct(i), r = import_picocolors2.default.gray(d), n = e.spacing ?? 1, o = 3, l = e.retainLog === !0, u = !ne() && Be(i);
2469
+ i.write(`${r}
2470
+ `), i.write(`${import_picocolors2.default.green(W2)} ${e.title}
2471
+ `);
2472
+ for (let $2 = 0; $2 < n; $2++) i.write(`${r}
2473
+ `);
2474
+ let a = [{ value: "", full: "" }], h = !1, y2 = ($2) => {
2475
+ if (a.length === 0) return;
2476
+ let p = 0;
2477
+ $2 && (p += n + 2);
2478
+ for (let g of a) {
2479
+ let { value: v, result: S2 } = g, w2 = S2?.message ?? v;
2480
+ if (w2.length === 0) continue;
2481
+ S2 === void 0 && g.header !== void 0 && g.header !== "" && (w2 += `
2482
+ ${g.header}`);
2483
+ let b2 = w2.split(`
2484
+ `).reduce((A, C) => C === "" ? A + 1 : A + Math.ceil((C.length + o) / s), 0);
2485
+ p += b2;
2486
+ }
2487
+ p > 0 && (p += 1, i.write(import_sisteransi2.erase.lines(p)));
2488
+ }, E = ($2, p, g) => {
2489
+ let v = g ? `${$2.full}
2490
+ ${$2.value}` : $2.value;
2491
+ $2.header !== void 0 && $2.header !== "" && R.message($2.header.split(`
2492
+ `).map(import_picocolors2.default.bold), { output: i, secondarySymbol: r, symbol: r, spacing: 0 }), R.message(v.split(`
2493
+ `).map(import_picocolors2.default.dim), { output: i, secondarySymbol: r, symbol: r, spacing: p ?? n });
2494
+ }, f = () => {
2495
+ for (let $2 of a) {
2496
+ let { header: p, value: g, full: v } = $2;
2497
+ (p === void 0 || p.length === 0) && g.length === 0 || E($2, void 0, l === !0 && v.length > 0);
2498
+ }
2499
+ }, F = ($2, p, g) => {
2500
+ if (y2(!1), (g?.raw !== !0 || !h) && $2.value !== "" && ($2.value += `
2501
+ `), $2.value += p, h = g?.raw === !0, e.limit !== void 0) {
2502
+ let v = $2.value.split(`
2503
+ `), S2 = v.length - e.limit;
2504
+ if (S2 > 0) {
2505
+ let w2 = v.splice(0, S2);
2506
+ l && ($2.full += ($2.full === "" ? "" : `
2507
+ `) + w2.join(`
2508
+ `));
2509
+ }
2510
+ $2.value = v.join(`
2511
+ `);
2512
+ }
2513
+ u && c();
2514
+ }, c = () => {
2515
+ for (let $2 of a) $2.result ? $2.result.status === "error" ? R.error($2.result.message, { output: i, secondarySymbol: r, spacing: 0 }) : R.success($2.result.message, { output: i, secondarySymbol: r, spacing: 0 }) : $2.value !== "" && E($2, 0);
2516
+ }, m = ($2, p) => {
2517
+ y2(!1), $2.result = p, u && c();
2518
+ };
2519
+ return { message($2, p) {
2520
+ F(a[0], $2, p);
2521
+ }, group($2) {
2522
+ let p = { header: $2, value: "", full: "" };
2523
+ return a.push(p), { message(g, v) {
2524
+ F(p, g, v);
2525
+ }, error(g) {
2526
+ m(p, { status: "error", message: g });
2527
+ }, success(g) {
2528
+ m(p, { status: "success", message: g });
2529
+ } };
2530
+ }, error($2, p) {
2531
+ y2(!0), R.error($2, { output: i, secondarySymbol: r, spacing: 1 }), p?.showLog !== !1 && f(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
2532
+ }, success($2, p) {
2533
+ y2(!0), R.success($2, { output: i, secondarySymbol: r, spacing: 1 }), p?.showLog === !0 && f(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
2534
+ } };
2535
+ }, qt = (e) => new Tt({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
2536
+ let i = `${import_picocolors2.default.gray(d)}
2537
+ ${L2(this.state)} ${e.message}
2538
+ `, 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("_")), r = this.userInput ? this.userInputWithCursor : s, n = this.value ?? "";
2539
+ switch (this.state) {
2540
+ case "error": {
2541
+ let o = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "";
2542
+ return `${i.trim()}
2543
+ ${import_picocolors2.default.yellow(d)} ${r}
2544
+ ${import_picocolors2.default.yellow(x)}${o}
2545
+ `;
2546
+ }
2547
+ case "submit": {
2548
+ let o = n ? ` ${import_picocolors2.default.dim(n)}` : "";
2549
+ return `${i}${import_picocolors2.default.gray(d)}${o}`;
2550
+ }
2551
+ case "cancel": {
2552
+ let o = n ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}` : "";
2553
+ return `${i}${import_picocolors2.default.gray(d)}${o}${n.trim() ? `
2554
+ ${import_picocolors2.default.gray(d)}` : ""}`;
2555
+ }
2556
+ default:
2557
+ return `${i}${import_picocolors2.default.cyan(d)} ${r}
2558
+ ${import_picocolors2.default.cyan(x)}
2559
+ `;
2560
+ }
2561
+ } }).prompt();
2562
+
2563
+ // src/node-logger/prompts/prompt-config.ts
2564
+ var prompt_config_exports = {};
2565
+ __export(prompt_config_exports, {
2566
+ getPreferredStdio: () => getPreferredStdio,
2567
+ getPromptLibrary: () => getPromptLibrary,
2568
+ getPromptProvider: () => getPromptProvider,
2569
+ isClackEnabled: () => isClackEnabled,
2570
+ setPromptLibrary: () => setPromptLibrary
2571
+ });
2572
+
2573
+ // src/node-logger/logger/log-tracker.ts
2574
+ import { promises as fs } from "node:fs";
2575
+ import path, { join } from "node:path";
2576
+ import { isCI } from "storybook/internal/common";
2577
+ var DEBUG_LOG_FILE_NAME = "debug-storybook.log", DEFAULT_LOG_FILE_PATH = join(process.cwd(), DEBUG_LOG_FILE_NAME), LogTracker = class {
2578
+ /** Array to store log entries */
2579
+ #logs = [];
2580
+ /**
2581
+ * Flag indicating if logs should be written to file it is enabled either by users providing the
2582
+ * `--logfile` flag to a CLI command or when we explicitly enable it by calling
2583
+ * `logTracker.enableLogWriting()` e.g. in automigrate or doctor command when there are issues
2584
+ */
2585
+ #shouldWriteLogsToFile = !1;
2586
+ /** Enables writing logs to file. */
2587
+ enableLogWriting() {
2588
+ this.#shouldWriteLogsToFile = !0;
2589
+ }
2590
+ /** Returns whether logs should be written to file. */
2591
+ get shouldWriteLogsToFile() {
2592
+ return this.#shouldWriteLogsToFile;
2593
+ }
2594
+ /** Returns a copy of all stored logs. */
2595
+ get logs() {
2596
+ return [...this.#logs];
2597
+ }
2598
+ /**
2599
+ * Adds a new log entry.
2600
+ *
2601
+ * @param level - The log level
2602
+ * @param message - The log message
2603
+ * @param metadata - Optional metadata to attach to the log, can be any JSON serializable value
2604
+ */
2605
+ addLog(level, message, metadata) {
2606
+ this.#logs.push({
2607
+ timestamp: /* @__PURE__ */ new Date(),
2608
+ level,
2609
+ message,
2610
+ metadata
2611
+ });
2612
+ }
2613
+ /** Clears all stored logs. */
2614
+ clear() {
2615
+ this.#logs = [];
2616
+ }
2617
+ /**
2618
+ * Writes all stored logs to a file and clears the log store.
2619
+ *
2620
+ * @param filePath - Optional custom file path to write logs to
2621
+ * @returns The path where logs were written, by default is debug-storybook.log in current working
2622
+ * directory
2623
+ */
2624
+ async writeToFile(filePath) {
2625
+ let logFilePath = typeof filePath == "string" ? filePath : DEFAULT_LOG_FILE_PATH, logContent = this.#logs.map((log2) => {
2626
+ let timestamp = log2.timestamp.toLocaleTimeString("en-US", { hour12: !1 }) + `.${log2.timestamp.getMilliseconds().toString().padStart(3, "0")}`, metadata = log2.metadata ? ` ${JSON.stringify(log2.metadata)}` : "";
2627
+ return `[${timestamp}] [${log2.level.toUpperCase()}] ${log2.message}${metadata}`;
2628
+ }).join(`
2629
+ `);
2630
+ return await fs.writeFile(logFilePath, logContent, "utf-8"), this.#logs = [], isCI() ? logFilePath : path.relative(process.cwd(), logFilePath);
2631
+ }
2632
+ }, logTracker = new LogTracker();
2633
+
2634
+ // src/node-logger/wrap-utils.ts
2635
+ var import_picocolors3 = __toESM(require_picocolors(), 1);
2636
+
2637
+ // ../node_modules/ansi-regex/index.js
2638
+ function ansiRegex({ onlyFirst = !1 } = {}) {
2639
+ let pattern = "(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
2640
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
2641
+ }
2642
+
2643
+ // ../node_modules/strip-ansi/index.js
2644
+ var regex = ansiRegex();
2645
+ function stripAnsi(string) {
2646
+ if (typeof string != "string")
2647
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
2648
+ return string.replace(regex, "");
2649
+ }
2650
+
2651
+ // ../node_modules/wrap-ansi/node_modules/string-width/index.js
2652
+ var import_eastasianwidth = __toESM(require_eastasianwidth(), 1), import_emoji_regex = __toESM(require_emoji_regex2(), 1);
2653
+ function stringWidth(string, options = {}) {
2654
+ if (typeof string != "string" || string.length === 0 || (options = {
2655
+ ambiguousIsNarrow: !0,
2656
+ ...options
2657
+ }, string = stripAnsi(string), string.length === 0))
2658
+ return 0;
2659
+ string = string.replace((0, import_emoji_regex.default)(), " ");
2660
+ let ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2, width = 0;
2661
+ for (let character of string) {
2662
+ let codePoint = character.codePointAt(0);
2663
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint >= 768 && codePoint <= 879)
2664
+ continue;
2665
+ switch (import_eastasianwidth.default.eastAsianWidth(character)) {
2666
+ case "F":
2667
+ case "W":
2668
+ width += 2;
2669
+ break;
2670
+ case "A":
2671
+ width += ambiguousCharacterWidth;
2672
+ break;
2673
+ default:
2674
+ width += 1;
2675
+ }
2676
+ }
2677
+ return width;
2678
+ }
2679
+
2680
+ // ../node_modules/ansi-styles/index.js
2681
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`, wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, styles = {
2682
+ modifier: {
2683
+ reset: [0, 0],
2684
+ // 21 isn't widely supported and 22 does the same thing
2685
+ bold: [1, 22],
2686
+ dim: [2, 22],
2687
+ italic: [3, 23],
2688
+ underline: [4, 24],
2689
+ overline: [53, 55],
2690
+ inverse: [7, 27],
2691
+ hidden: [8, 28],
2692
+ strikethrough: [9, 29]
2693
+ },
2694
+ color: {
2695
+ black: [30, 39],
2696
+ red: [31, 39],
2697
+ green: [32, 39],
2698
+ yellow: [33, 39],
2699
+ blue: [34, 39],
2700
+ magenta: [35, 39],
2701
+ cyan: [36, 39],
2702
+ white: [37, 39],
2703
+ // Bright color
2704
+ blackBright: [90, 39],
2705
+ gray: [90, 39],
2706
+ // Alias of `blackBright`
2707
+ grey: [90, 39],
2708
+ // Alias of `blackBright`
2709
+ redBright: [91, 39],
2710
+ greenBright: [92, 39],
2711
+ yellowBright: [93, 39],
2712
+ blueBright: [94, 39],
2713
+ magentaBright: [95, 39],
2714
+ cyanBright: [96, 39],
2715
+ whiteBright: [97, 39]
2716
+ },
2717
+ bgColor: {
2718
+ bgBlack: [40, 49],
2719
+ bgRed: [41, 49],
2720
+ bgGreen: [42, 49],
2721
+ bgYellow: [43, 49],
2722
+ bgBlue: [44, 49],
2723
+ bgMagenta: [45, 49],
2724
+ bgCyan: [46, 49],
2725
+ bgWhite: [47, 49],
2726
+ // Bright color
2727
+ bgBlackBright: [100, 49],
2728
+ bgGray: [100, 49],
2729
+ // Alias of `bgBlackBright`
2730
+ bgGrey: [100, 49],
2731
+ // Alias of `bgBlackBright`
2732
+ bgRedBright: [101, 49],
2733
+ bgGreenBright: [102, 49],
2734
+ bgYellowBright: [103, 49],
2735
+ bgBlueBright: [104, 49],
2736
+ bgMagentaBright: [105, 49],
2737
+ bgCyanBright: [106, 49],
2738
+ bgWhiteBright: [107, 49]
2739
+ }
2740
+ }, modifierNames = Object.keys(styles.modifier), foregroundColorNames = Object.keys(styles.color), backgroundColorNames = Object.keys(styles.bgColor), colorNames = [...foregroundColorNames, ...backgroundColorNames];
2741
+ function assembleStyles() {
2742
+ let codes = /* @__PURE__ */ new Map();
2743
+ for (let [groupName, group] of Object.entries(styles)) {
2744
+ for (let [styleName, style] of Object.entries(group))
2745
+ styles[styleName] = {
2746
+ open: `\x1B[${style[0]}m`,
2747
+ close: `\x1B[${style[1]}m`
2748
+ }, group[styleName] = styles[styleName], codes.set(style[0], style[1]);
2749
+ Object.defineProperty(styles, groupName, {
2750
+ value: group,
2751
+ enumerable: !1
2752
+ });
2753
+ }
2754
+ return Object.defineProperty(styles, "codes", {
2755
+ value: codes,
2756
+ enumerable: !1
2757
+ }), styles.color.close = "\x1B[39m", styles.bgColor.close = "\x1B[49m", styles.color.ansi = wrapAnsi16(), styles.color.ansi256 = wrapAnsi256(), styles.color.ansi16m = wrapAnsi16m(), styles.bgColor.ansi = wrapAnsi16(10), styles.bgColor.ansi256 = wrapAnsi256(10), styles.bgColor.ansi16m = wrapAnsi16m(10), Object.defineProperties(styles, {
2758
+ rgbToAnsi256: {
2759
+ value(red, green, blue) {
2760
+ return red === green && green === blue ? red < 8 ? 16 : red > 248 ? 231 : Math.round((red - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
2761
+ },
2762
+ enumerable: !1
2763
+ },
2764
+ hexToRgb: {
2765
+ value(hex2) {
2766
+ let matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex2.toString(16));
2767
+ if (!matches)
2768
+ return [0, 0, 0];
2769
+ let [colorString] = matches;
2770
+ colorString.length === 3 && (colorString = [...colorString].map((character) => character + character).join(""));
2771
+ let integer = Number.parseInt(colorString, 16);
2772
+ return [
2773
+ /* eslint-disable no-bitwise */
2774
+ integer >> 16 & 255,
2775
+ integer >> 8 & 255,
2776
+ integer & 255
2777
+ /* eslint-enable no-bitwise */
2778
+ ];
2779
+ },
2780
+ enumerable: !1
2781
+ },
2782
+ hexToAnsi256: {
2783
+ value: (hex2) => styles.rgbToAnsi256(...styles.hexToRgb(hex2)),
2784
+ enumerable: !1
2785
+ },
2786
+ ansi256ToAnsi: {
2787
+ value(code) {
2788
+ if (code < 8)
2789
+ return 30 + code;
2790
+ if (code < 16)
2791
+ return 90 + (code - 8);
2792
+ let red, green, blue;
2793
+ if (code >= 232)
2794
+ red = ((code - 232) * 10 + 8) / 255, green = red, blue = red;
2795
+ else {
2796
+ code -= 16;
2797
+ let remainder = code % 36;
2798
+ red = Math.floor(code / 36) / 5, green = Math.floor(remainder / 6) / 5, blue = remainder % 6 / 5;
2799
+ }
2800
+ let value = Math.max(red, green, blue) * 2;
2801
+ if (value === 0)
2802
+ return 30;
2803
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
2804
+ return value === 2 && (result += 60), result;
2805
+ },
2806
+ enumerable: !1
2807
+ },
2808
+ rgbToAnsi: {
2809
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
2810
+ enumerable: !1
2811
+ },
2812
+ hexToAnsi: {
2813
+ value: (hex2) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex2)),
2814
+ enumerable: !1
2815
+ }
2816
+ }), styles;
2817
+ }
2818
+ var ansiStyles = assembleStyles(), ansi_styles_default = ansiStyles;
2819
+
2820
+ // ../node_modules/wrap-ansi/index.js
2821
+ var ESCAPES = /* @__PURE__ */ new Set([
2822
+ "\x1B",
2823
+ "\x9B"
2824
+ ]), END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC = "]", ANSI_SGR_TERMINATOR = "m", ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`, wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`, wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)), wrapWord = (rows, word, columns) => {
2825
+ let characters = [...word], isInsideEscape = !1, isInsideLinkEscape = !1, visible = stringWidth(stripAnsi(rows[rows.length - 1]));
2826
+ for (let [index, character] of characters.entries()) {
2827
+ let characterLength = stringWidth(character);
2828
+ if (visible + characterLength <= columns ? rows[rows.length - 1] += character : (rows.push(character), visible = 0), ESCAPES.has(character) && (isInsideEscape = !0, isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK)), isInsideEscape) {
2829
+ isInsideLinkEscape ? character === ANSI_ESCAPE_BELL && (isInsideEscape = !1, isInsideLinkEscape = !1) : character === ANSI_SGR_TERMINATOR && (isInsideEscape = !1);
2830
+ continue;
2831
+ }
2832
+ visible += characterLength, visible === columns && index < characters.length - 1 && (rows.push(""), visible = 0);
2833
+ }
2834
+ !visible && rows[rows.length - 1].length > 0 && rows.length > 1 && (rows[rows.length - 2] += rows.pop());
2835
+ }, stringVisibleTrimSpacesRight = (string) => {
2836
+ let words = string.split(" "), last = words.length;
2837
+ for (; last > 0 && !(stringWidth(words[last - 1]) > 0); )
2838
+ last--;
2839
+ return last === words.length ? string : words.slice(0, last).join(" ") + words.slice(last).join("");
2840
+ }, exec = (string, columns, options = {}) => {
2841
+ if (options.trim !== !1 && string.trim() === "")
2842
+ return "";
2843
+ let returnValue = "", escapeCode, escapeUrl, lengths = wordLengths(string), rows = [""];
2844
+ for (let [index, word] of string.split(" ").entries()) {
2845
+ options.trim !== !1 && (rows[rows.length - 1] = rows[rows.length - 1].trimStart());
2846
+ let rowLength = stringWidth(rows[rows.length - 1]);
2847
+ if (index !== 0 && (rowLength >= columns && (options.wordWrap === !1 || options.trim === !1) && (rows.push(""), rowLength = 0), (rowLength > 0 || options.trim === !1) && (rows[rows.length - 1] += " ", rowLength++)), options.hard && lengths[index] > columns) {
2848
+ let remainingColumns = columns - rowLength, breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
2849
+ Math.floor((lengths[index] - 1) / columns) < breaksStartingThisLine && rows.push(""), wrapWord(rows, word, columns);
2850
+ continue;
2851
+ }
2852
+ if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
2853
+ if (options.wordWrap === !1 && rowLength < columns) {
2854
+ wrapWord(rows, word, columns);
2855
+ continue;
2856
+ }
2857
+ rows.push("");
2858
+ }
2859
+ if (rowLength + lengths[index] > columns && options.wordWrap === !1) {
2860
+ wrapWord(rows, word, columns);
2861
+ continue;
2862
+ }
2863
+ rows[rows.length - 1] += word;
2864
+ }
2865
+ options.trim !== !1 && (rows = rows.map((row) => stringVisibleTrimSpacesRight(row)));
2866
+ let pre = [...rows.join(`
2867
+ `)];
2868
+ for (let [index, character] of pre.entries()) {
2869
+ if (returnValue += character, ESCAPES.has(character)) {
2870
+ let { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} };
2871
+ if (groups.code !== void 0) {
2872
+ let code2 = Number.parseFloat(groups.code);
2873
+ escapeCode = code2 === END_CODE ? void 0 : code2;
2874
+ } else groups.uri !== void 0 && (escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri);
2875
+ }
2876
+ let code = ansi_styles_default.codes.get(Number(escapeCode));
2877
+ pre[index + 1] === `
2878
+ ` ? (escapeUrl && (returnValue += wrapAnsiHyperlink("")), escapeCode && code && (returnValue += wrapAnsiCode(code))) : character === `
2879
+ ` && (escapeCode && code && (returnValue += wrapAnsiCode(escapeCode)), escapeUrl && (returnValue += wrapAnsiHyperlink(escapeUrl)));
2880
+ }
2881
+ return returnValue;
2882
+ };
2883
+ function wrapAnsi(string, columns, options) {
2884
+ return String(string).normalize().replace(/\r\n/g, `
2885
+ `).split(`
2886
+ `).map((line) => exec(line, columns, options)).join(`
2887
+ `);
2888
+ }
2889
+
2890
+ // src/node-logger/wrap-utils.ts
2891
+ function getTerminalWidth() {
2892
+ try {
2893
+ return process.stdout.columns || 80;
2894
+ } catch {
2895
+ return 80;
2896
+ }
2897
+ }
2898
+ var ANSI_REGEX = /\u001b\[[0-9;]*m|\u001b\]8;;[^\u0007]*\u0007|\u001b\]8;;\u0007/g, URL_REGEX = /(https?:\/\/[^\s\u0000-\u001F\u007F]+)/g;
2899
+ function stripAnsi2(str) {
2900
+ return str.replace(ANSI_REGEX, "");
2901
+ }
2902
+ function getVisibleLength(str) {
2903
+ return stripAnsi2(str).length;
2904
+ }
2905
+ function getEnvFromTerminal(key) {
2906
+ return (process.env[key] || "").trim();
2907
+ }
2908
+ function supportsHyperlinks() {
2909
+ try {
2910
+ let termProgram = getEnvFromTerminal("TERM_PROGRAM"), termProgramVersion = getEnvFromTerminal("TERM_PROGRAM_VERSION");
2911
+ switch (termProgram) {
2912
+ case "iTerm.app":
2913
+ if (termProgramVersion.trim()) {
2914
+ let version = termProgramVersion.trim().split(".").map(Number);
2915
+ return version[0] > 3 || version[0] === 3 && version[1] >= 1;
2916
+ }
2917
+ return !0;
2918
+ // Assume recent version
2919
+ case "Apple_Terminal":
2920
+ return !1;
2921
+ default:
2922
+ return !0;
2923
+ }
2924
+ } catch {
2925
+ return !1;
2926
+ }
2927
+ }
2928
+ function protectUrls(text2, options) {
2929
+ let defaultMaxUrlLength = Math.floor(getTerminalWidth() * 0.8), maxLineWidth = options?.maxLineWidth ?? getTerminalWidth(), useHyperlinks = supportsHyperlinks();
2930
+ return text2.replace(URL_REGEX, (match, capturedUrl, offset) => {
2931
+ if (!useHyperlinks)
2932
+ return match;
2933
+ let searchPos = 0;
2934
+ for (; ; ) {
2935
+ let hyperlinkStart = text2.indexOf("\x1B]8;;", searchPos);
2936
+ if (hyperlinkStart === -1)
2937
+ break;
2938
+ let hyperlinkEnd = text2.indexOf("\x1B]8;;\x07", hyperlinkStart);
2939
+ if (hyperlinkEnd === -1) {
2940
+ searchPos = hyperlinkStart + 1;
2941
+ continue;
2942
+ }
2943
+ if (offset >= hyperlinkStart && offset < hyperlinkEnd + 7)
2944
+ return match;
2945
+ searchPos = hyperlinkEnd + 1;
2946
+ }
2947
+ let textBeforeUrl = text2.substring(0, offset), lastNewlineIndex = textBeforeUrl.lastIndexOf(`
2948
+ `), currentLinePrefix = lastNewlineIndex === -1 ? textBeforeUrl : textBeforeUrl.substring(lastNewlineIndex + 1), prefixLength = getVisibleLength(currentLinePrefix), availableSpace = maxLineWidth - prefixLength, minUrlLength = 20, configuredMax = options?.maxUrlLength ?? defaultMaxUrlLength, effectiveMaxLength = Math.min(configuredMax, defaultMaxUrlLength, availableSpace);
2949
+ if ((capturedUrl.length <= minUrlLength || effectiveMaxLength < minUrlLength) && (effectiveMaxLength = capturedUrl.length), capturedUrl.length > effectiveMaxLength) {
2950
+ let truncatedText = capturedUrl.substring(0, effectiveMaxLength - 3) + "...";
2951
+ return `\x1B]8;;${capturedUrl}\x07${truncatedText}\x1B]8;;\x07`;
2952
+ }
2953
+ return `\x1B]8;;${capturedUrl}\x07${capturedUrl}\x1B]8;;\x07`;
2954
+ });
2955
+ }
2956
+ function createHyperlink(title, url) {
2957
+ return supportsHyperlinks() ? `\x1B]8;;${url}\x07${title}\x1B]8;;\x07` : `${title}: ${url}`;
2958
+ }
2959
+ function splitTextPreservingUrls(text2) {
2960
+ let parts = [], lastIndex = 0, match;
2961
+ for (URL_REGEX.lastIndex = 0; (match = URL_REGEX.exec(text2)) !== null; ) {
2962
+ if (match.index > lastIndex) {
2963
+ let beforeUrl = text2.slice(lastIndex, match.index);
2964
+ parts.push(...beforeUrl.split(" ").filter((part) => part.length > 0));
2965
+ }
2966
+ parts.push(match[0]), lastIndex = match.index + match[0].length;
2967
+ }
2968
+ if (lastIndex < text2.length) {
2969
+ let remaining = text2.slice(lastIndex);
2970
+ parts.push(...remaining.split(" ").filter((part) => part.length > 0));
2971
+ }
2972
+ return parts;
2973
+ }
2974
+ var MAX_OPTIMAL_WIDTH = 80;
2975
+ function getOptimalWidth(width) {
2976
+ return Math.min(width, MAX_OPTIMAL_WIDTH);
2977
+ }
2978
+ function wrapTextForClack(text2, width) {
2979
+ let terminalWidth = width || getTerminalWidth(), contentWidth = Math.max(terminalWidth - 10, 40), maxOptimalWidth = getOptimalWidth(contentWidth), protectedText = protectUrls(text2, { maxLineWidth: maxOptimalWidth });
2980
+ return wrapAnsi(protectedText, maxOptimalWidth);
2981
+ }
2982
+ function wrapTextForClackHint(text2, width, label, _indentSpaces = 4) {
2983
+ let terminalWidth = width || getTerminalWidth(), reservedSpaceFirstLine = 8 + (label ? getVisibleLength(label) : 0), firstLineWidth = Math.min(
2984
+ MAX_OPTIMAL_WIDTH - reservedSpaceFirstLine,
2985
+ Math.max(terminalWidth - reservedSpaceFirstLine, 30)
2986
+ ), indentSpaces = _indentSpaces, continuationLineWidth = getOptimalWidth(Math.max(terminalWidth - indentSpaces, 30)), protectedText = protectUrls(text2, { maxLineWidth: continuationLineWidth }), initialWrap = wrapAnsi(protectedText, continuationLineWidth), lines = initialWrap.split(`
2987
+ `);
2988
+ if (lines.length > 0 && getVisibleLength(lines[0]) > firstLineWidth) {
2989
+ let words = splitTextPreservingUrls(text2), firstLinePart = "", remainingPart = "";
2990
+ for (let i = 0; i < words.length; i++) {
2991
+ let testLine = i === 0 ? words[i] : firstLinePart + " " + words[i];
2992
+ if (getVisibleLength(testLine) <= firstLineWidth)
2993
+ firstLinePart = testLine;
2994
+ else {
2995
+ remainingPart = words.slice(i).join(" ");
2996
+ break;
2997
+ }
2998
+ }
2999
+ !firstLinePart && words.length > 0 && (firstLinePart = words[0], remainingPart = words.slice(1).join(" "));
3000
+ let finalLines = [firstLinePart];
3001
+ if (remainingPart.trim()) {
3002
+ let protectedRemainder = protectUrls(remainingPart.trim(), {
3003
+ maxLineWidth: continuationLineWidth
3004
+ }), wrappedRemainder = wrapAnsi(protectedRemainder, continuationLineWidth);
3005
+ finalLines = finalLines.concat(wrappedRemainder.split(`
3006
+ `));
3007
+ }
3008
+ if (finalLines.length <= 1)
3009
+ return finalLines[0] || "";
3010
+ let indentation2 = indentSpaces > 0 ? (0, import_picocolors3.reset)((0, import_picocolors3.cyan)(d)) + " ".repeat(indentSpaces) : "";
3011
+ return finalLines.map((line, index) => index === 0 ? line : `${indentation2}${(0, import_picocolors3.dim)(line)}`).join(`
3012
+ `);
3013
+ }
3014
+ if (lines.length <= 1)
3015
+ return initialWrap;
3016
+ let indentation = (0, import_picocolors3.reset)((0, import_picocolors3.cyan)(d)) + " ".repeat(indentSpaces);
3017
+ return lines.map((line, index) => index === 0 ? line : `${indentation}${(0, import_picocolors3.dim)(line)}`).join(`
3018
+ `);
3019
+ }
3020
+
3021
+ // src/node-logger/prompts/prompt-provider-base.ts
3022
+ var PromptProvider = class {
3023
+ };
3024
+
3025
+ // src/node-logger/prompts/prompt-provider-clack.ts
3026
+ var getCurrentTaskLog = () => globalThis.STORYBOOK_CURRENT_TASK_LOG ? globalThis.STORYBOOK_CURRENT_TASK_LOG[globalThis.STORYBOOK_CURRENT_TASK_LOG.length - 1] : null, setCurrentTaskLog = (taskLog2) => {
3027
+ globalThis.STORYBOOK_CURRENT_TASK_LOG = [
3028
+ ...globalThis.STORYBOOK_CURRENT_TASK_LOG || [],
3029
+ taskLog2
3030
+ ];
3031
+ }, clearCurrentTaskLog = () => {
3032
+ globalThis.STORYBOOK_CURRENT_TASK_LOG && globalThis.STORYBOOK_CURRENT_TASK_LOG.pop();
3033
+ }, ClackPromptProvider = class extends PromptProvider {
3034
+ handleCancel(result, promptOptions) {
3035
+ _t(result) && (promptOptions?.onCancel ? promptOptions.onCancel() : (Tt2("Operation canceled."), process.exit(0)));
3036
+ }
3037
+ async text(options, promptOptions) {
3038
+ let result = await qt(options);
3039
+ return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result.toString();
3040
+ }
3041
+ async confirm(options, promptOptions) {
3042
+ let result = await xt({
3043
+ ...options,
3044
+ message: wrapTextForClackHint(options.message, void 0, void 0, 2)
3045
+ });
3046
+ return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), !!result;
3047
+ }
3048
+ async select(options, promptOptions) {
3049
+ let result = await Gt({
3050
+ ...options,
3051
+ message: wrapTextForClackHint(options.message, void 0, void 0, 2)
3052
+ });
3053
+ return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
3054
+ }
3055
+ async multiselect(options, promptOptions) {
3056
+ let result = await Ot({
3057
+ ...options,
3058
+ required: options.required
3059
+ });
3060
+ return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
3061
+ }
3062
+ spinner(options) {
3063
+ let task = Ee(), spinnerId = `${options.id}-spinner`;
3064
+ return {
3065
+ start: (message) => {
3066
+ logTracker.addLog("info", `${spinnerId}-start: ${message}`), task.start(message);
3067
+ },
3068
+ message: (message) => {
3069
+ logTracker.addLog("info", `${spinnerId}: ${message}`), task.message(message);
3070
+ },
3071
+ stop: (message) => {
3072
+ logTracker.addLog("info", `${spinnerId}-stop: ${message}`), task.stop(message);
3073
+ }
3074
+ };
3075
+ }
3076
+ taskLog(options) {
3077
+ let isCurrentTaskActive = !!getCurrentTaskLog(), task = getCurrentTaskLog() || Kt(options), taskId = `${options.id}-task`;
3078
+ return logTracker.addLog("info", `${taskId}-start: ${options.title}`), isCurrentTaskActive || setCurrentTaskLog(task), {
3079
+ message: (message) => {
3080
+ logTracker.addLog("info", `${taskId}: ${message}`), task.message(message);
3081
+ },
3082
+ error: (message) => {
3083
+ logTracker.addLog("error", `${taskId}-error: ${message}`), task.error(message, { showLog: !0 }), clearCurrentTaskLog();
3084
+ },
3085
+ success: (message, options2) => {
3086
+ logTracker.addLog("info", `${taskId}-success: ${message}`), isCurrentTaskActive || task.success(message, options2), clearCurrentTaskLog();
3087
+ },
3088
+ group(title) {
3089
+ logTracker.addLog("info", `${taskId}-group: ${title}`);
3090
+ let group = task.group(title);
3091
+ return setCurrentTaskLog(group), {
3092
+ message: (message) => {
3093
+ group.message(message);
3094
+ },
3095
+ success: (message) => {
3096
+ group.success(message), clearCurrentTaskLog();
3097
+ },
3098
+ error: (message) => {
3099
+ group.error(message), clearCurrentTaskLog();
3100
+ }
3101
+ };
3102
+ }
3103
+ };
3104
+ }
3105
+ };
3106
+
3107
+ // src/node-logger/prompts/prompt-config.ts
3108
+ var PROVIDERS = {
3109
+ clack: new ClackPromptProvider()
3110
+ }, currentPromptLibrary = "clack", setPromptLibrary = (library) => {
3111
+ currentPromptLibrary = library;
3112
+ }, getPromptLibrary = () => currentPromptLibrary, getPromptProvider = () => PROVIDERS[currentPromptLibrary], isClackEnabled = () => currentPromptLibrary === "clack", getPreferredStdio = () => isClackEnabled() ? "pipe" : "inherit";
3113
+
3114
+ // src/node-logger/logger/colors.ts
3115
+ var import_picocolors4 = __toESM(require_picocolors(), 1), CLI_COLORS = {
3116
+ success: import_picocolors4.default.green,
3117
+ error: import_picocolors4.default.red,
3118
+ warning: import_picocolors4.default.yellow,
3119
+ info: process.platform === "win32" ? import_picocolors4.default.cyan : import_picocolors4.default.blue,
3120
+ debug: import_picocolors4.default.gray,
3121
+ // Only color a link if it is the primary call to action, otherwise links shouldn't be colored
3122
+ cta: import_picocolors4.default.cyan,
3123
+ muted: import_picocolors4.default.dim,
3124
+ storybook: (text2) => `\x1B[38;2;255;71;133m${text2}\x1B[39m`
3125
+ };
3126
+
3127
+ // src/node-logger/logger/logger.ts
3128
+ var createLogFunction = (clackFn, consoleFn, cliColors) => () => isClackEnabled() ? (...args) => {
3129
+ let [message, ...rest] = args, currentTaskLog = getCurrentTaskLog();
3130
+ currentTaskLog ? currentTaskLog.message(
3131
+ cliColors && typeof message == "string" ? cliColors(message) : message
3132
+ ) : typeof message == "string" ? clackFn(wrapTextForClack(message), ...rest) : clackFn(message, ...rest);
3133
+ } : consoleFn, LOG_FUNCTIONS = {
3134
+ log: createLogFunction(R.message, console.log),
3135
+ info: createLogFunction(R.info, console.log),
3136
+ warn: createLogFunction(R.warn, console.warn, CLI_COLORS.warning),
3137
+ error: createLogFunction(R.error, console.error, CLI_COLORS.error),
3138
+ intro: createLogFunction(Mt2, console.log),
3139
+ outro: createLogFunction(Rt, console.log),
3140
+ step: createLogFunction(R.step, console.log)
3141
+ }, LOG_LEVELS = {
3142
+ trace: 1,
3143
+ debug: 2,
3144
+ info: 3,
3145
+ warn: 4,
3146
+ error: 5,
3147
+ silent: 10
3148
+ }, currentLogLevel = "info", setLogLevel = (level) => {
3149
+ currentLogLevel = level;
3150
+ }, getLogLevel = () => currentLogLevel, shouldLog = (level) => LOG_LEVELS[currentLogLevel] <= LOG_LEVELS[level];
3151
+ function getMinimalTrace() {
3152
+ let stack = new Error().stack;
3153
+ if (!stack)
3154
+ return;
3155
+ let userStackLines = stack.split(`
3156
+ `).slice(1).filter(
3157
+ (line) => !["getMinimalTrace", "createLogger", "logFunction"].some((fn) => line.includes(fn))
3158
+ );
3159
+ return userStackLines.length === 0 ? void 0 : `
3160
+ ` + userStackLines.slice(0, 2).join(`
3161
+ `);
3162
+ }
3163
+ var formatLogMessage = (args) => args.map((arg) => typeof arg == "string" ? arg : typeof arg == "object" ? JSON.stringify(arg, null, 2) : String(arg)).join(" ");
3164
+ function createLogger(level, logFn, prefix) {
3165
+ return function(...args) {
3166
+ let [message, ...rest] = args, msg = formatLogMessage([message]);
3167
+ if (logTracker.addLog(level, msg), level === "prompt" && (level = "info"), shouldLog(level)) {
3168
+ let formattedMessage = prefix ? `${prefix} ${msg}` : message;
3169
+ logFn(formattedMessage, ...rest);
3170
+ }
3171
+ };
3172
+ }
3173
+ var debug = createLogger(
3174
+ "debug",
3175
+ function(message) {
3176
+ shouldLog("trace") && (message += getMinimalTrace()), LOG_FUNCTIONS.log()(message);
3177
+ },
3178
+ "[DEBUG]"
3179
+ ), log = createLogger(
3180
+ "info",
3181
+ (...args) => LOG_FUNCTIONS.log()(...args)
3182
+ ), info = createLogger(
3183
+ "info",
3184
+ (...args) => LOG_FUNCTIONS.info()(...args)
3185
+ ), warn = createLogger(
3186
+ "warn",
3187
+ (...args) => LOG_FUNCTIONS.warn()(...args)
3188
+ ), error = createLogger(
3189
+ "error",
3190
+ (...args) => LOG_FUNCTIONS.error()(...args)
3191
+ ), logBox = (message, { title, ...options } = {}) => {
3192
+ shouldLog("info") && (logTracker.addLog("info", message), isClackEnabled() ? bt2(message, title, {
3193
+ ...options,
3194
+ width: options.width ?? "auto"
3195
+ }) : console.log(message));
3196
+ }, intro = (message) => {
3197
+ logTracker.addLog("info", message), shouldLog("info") && (console.log(""), LOG_FUNCTIONS.intro()(message));
3198
+ }, outro = (message) => {
3199
+ logTracker.addLog("info", message), shouldLog("info") && LOG_FUNCTIONS.outro()(message);
3200
+ }, step = (message) => {
3201
+ logTracker.addLog("info", message), shouldLog("info") && LOG_FUNCTIONS.step()(message);
3202
+ }, SYMBOLS = {
3203
+ success: CLI_COLORS.success("\u2714"),
3204
+ error: CLI_COLORS.error("\u2715")
3205
+ };
3206
+
3207
+ // src/node-logger/logger/console.ts
3208
+ var import_picocolors5 = __toESM(require_picocolors(), 1);
3209
+ var ConsoleLogger = class _ConsoleLogger {
3210
+ constructor() {
3211
+ this.Console = _ConsoleLogger;
3212
+ this.timers = /* @__PURE__ */ new Map();
3213
+ this.counters = /* @__PURE__ */ new Map();
3214
+ this.lastStatusLine = null;
3215
+ this.statusLineCount = 0;
3216
+ }
3217
+ // These will be overridden by child classes
3218
+ get prefix() {
3219
+ return "";
3220
+ }
3221
+ get color() {
3222
+ return (text2) => text2;
3223
+ }
3224
+ formatMessage(...data) {
3225
+ let message = data.join(" ");
3226
+ return this.prefix ? `${this.color(this.prefix)} ${message}` : message;
3227
+ }
3228
+ assert(condition, ...data) {
3229
+ condition || error(this.formatMessage("Assertion failed:", ...data));
3230
+ }
3231
+ // Needs some proper implementation
3232
+ // Take a look at https://github.com/webpack/webpack/blob/5f898719ae47b89bee3c126bf5d2e0081ea8c91f/lib/node/nodeConsole.js#L4
3233
+ // for some inspiration
3234
+ // status(...data: any[]): void {
3235
+ // const message = this.formatMessage(...data);
3236
+ // // If we have a previous status line, we need to clear it
3237
+ // if (this.lastStatusLine !== null) {
3238
+ // this.clearStatus();
3239
+ // }
3240
+ // // Write the status message directly to stdout without adding newlines
3241
+ // process.stdout.write(message);
3242
+ // // Update tracking variables
3243
+ // this.lastStatusLine = message;
3244
+ // this.statusLineCount = 1; // For now, assume single line status messages
3245
+ // // If the message contains newlines, count them
3246
+ // const newlineCount = (message.match(/\n/g) || []).length;
3247
+ // this.statusLineCount = newlineCount + 1;
3248
+ // }
3249
+ // /** Clears the current status line if one exists */
3250
+ // clearStatus(): void {
3251
+ // if (this.lastStatusLine !== null) {
3252
+ // // Move cursor to the beginning of the current line
3253
+ // process.stdout.write('\r');
3254
+ // // Clear the current line
3255
+ // process.stdout.clearLine(1);
3256
+ // // Reset tracking variables
3257
+ // this.lastStatusLine = null;
3258
+ // this.statusLineCount = 0;
3259
+ // }
3260
+ // }
3261
+ /**
3262
+ * The **`console.clear()`** static method clears the console if possible.
3263
+ *
3264
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)
3265
+ */
3266
+ clear() {
3267
+ console.clear();
3268
+ }
3269
+ /**
3270
+ * The **`console.count()`** static method logs the number of times that this particular call to
3271
+ * `count()` has been called.
3272
+ *
3273
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
3274
+ */
3275
+ count(label) {
3276
+ let key = label || "default", currentCount = (this.counters.get(key) || 0) + 1;
3277
+ this.counters.set(key, currentCount), log(this.formatMessage(`${key}: ${currentCount}`));
3278
+ }
3279
+ /**
3280
+ * The **`console.countReset()`** static method resets counter used with console/count_static.
3281
+ *
3282
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
3283
+ */
3284
+ countReset(label) {
3285
+ let key = label || "default";
3286
+ this.counters.delete(key);
3287
+ }
3288
+ /**
3289
+ * The **`console.debug()`** static method outputs a message to the console at the 'debug' log
3290
+ * level.
3291
+ *
3292
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
3293
+ */
3294
+ debug(...data) {
3295
+ process.stdout.write(`
3296
+ `), debug(this.formatMessage(...data));
3297
+ }
3298
+ /**
3299
+ * The **`console.dir()`** static method displays a list of the properties of the specified
3300
+ * JavaScript object.
3301
+ *
3302
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
3303
+ */
3304
+ dir(item, options) {
3305
+ console.dir(item, options);
3306
+ }
3307
+ /**
3308
+ * The **`console.dirxml()`** static method displays an interactive tree of the descendant
3309
+ * elements of the specified XML/HTML element.
3310
+ *
3311
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
3312
+ */
3313
+ dirxml(...data) {
3314
+ console.dirxml(...data);
3315
+ }
3316
+ /**
3317
+ * The **`console.error()`** static method outputs a message to the console at the 'error' log
3318
+ * level.
3319
+ *
3320
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
3321
+ */
3322
+ error(...data) {
3323
+ process.stdout.write(`
3324
+ `), error(this.formatMessage(...data));
3325
+ }
3326
+ /**
3327
+ * The **`console.group()`** static method creates a new inline group in the Web console log,
3328
+ * causing any subsequent console messages to be indented by an additional level, until
3329
+ * console/groupEnd_static is called.
3330
+ *
3331
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
3332
+ */
3333
+ group(...data) {
3334
+ console.group(...data);
3335
+ }
3336
+ /**
3337
+ * The **`console.groupCollapsed()`** static method creates a new inline group in the console.
3338
+ *
3339
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
3340
+ */
3341
+ groupCollapsed(...data) {
3342
+ console.groupCollapsed(...data);
3343
+ }
3344
+ /**
3345
+ * The **`console.groupEnd()`** static method exits the current inline group in the console.
3346
+ *
3347
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
3348
+ */
3349
+ groupEnd() {
3350
+ console.groupEnd();
3351
+ }
3352
+ /**
3353
+ * The **`console.info()`** static method outputs a message to the console at the 'info' log
3354
+ * level.
3355
+ *
3356
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
3357
+ */
3358
+ info(...data) {
3359
+ process.stdout.write(`
3360
+ `), log(this.formatMessage(...data));
3361
+ }
3362
+ /**
3363
+ * The **`console.log()`** static method outputs a message to the console.
3364
+ *
3365
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
3366
+ */
3367
+ log(...data) {
3368
+ process.stdout.write(`
3369
+ `), log(this.formatMessage(...data));
3370
+ }
3371
+ /**
3372
+ * The **`console.table()`** static method displays tabular data as a table.
3373
+ *
3374
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)
3375
+ */
3376
+ table(tabularData, properties) {
3377
+ console.table(tabularData, properties);
3378
+ }
3379
+ /**
3380
+ * The **`console.time()`** static method starts a timer you can use to track how long an
3381
+ * operation takes.
3382
+ *
3383
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
3384
+ */
3385
+ time(label) {
3386
+ let key = label || "default";
3387
+ this.timers.set(key, Date.now());
3388
+ }
3389
+ /**
3390
+ * The **`console.timeEnd()`** static method stops a timer that was previously started by calling
3391
+ * console/time_static.
3392
+ *
3393
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
3394
+ */
3395
+ timeEnd(label) {
3396
+ let key = label || "default", startTime = this.timers.get(key);
3397
+ if (startTime) {
3398
+ let duration = Date.now() - startTime;
3399
+ log(this.formatMessage(`${key}: ${duration}ms`)), this.timers.delete(key);
3400
+ } else
3401
+ warn(this.formatMessage(`Timer '${key}' does not exist`));
3402
+ }
3403
+ /**
3404
+ * The **`console.timeLog()`** static method logs the current value of a timer that was previously
3405
+ * started by calling console/time_static.
3406
+ *
3407
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
3408
+ */
3409
+ timeLog(label, ...data) {
3410
+ let key = label || "default", startTime = this.timers.get(key);
3411
+ if (startTime) {
3412
+ let duration = Date.now() - startTime;
3413
+ log(this.formatMessage(`${key}: ${duration}ms`, ...data));
3414
+ } else
3415
+ warn(this.formatMessage(`Timer '${key}' does not exist`));
3416
+ }
3417
+ timeStamp(label) {
3418
+ let timestamp = (/* @__PURE__ */ new Date()).toISOString();
3419
+ log(this.formatMessage(`[${timestamp}]${label ? ` ${label}` : ""}`));
3420
+ }
3421
+ /**
3422
+ * The **`console.trace()`** static method outputs a stack trace to the console.
3423
+ *
3424
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)
3425
+ */
3426
+ trace(...data) {
3427
+ console.trace(...data);
3428
+ }
3429
+ /**
3430
+ * The **`console.warn()`** static method outputs a warning message to the console at the
3431
+ * 'warning' log level.
3432
+ *
3433
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
3434
+ */
3435
+ warn(...data) {
3436
+ process.stdout.write(`
3437
+ `), warn(this.formatMessage(...data));
3438
+ }
3439
+ profile(label) {
3440
+ console.profile(label), log(this.formatMessage(`Profile started: ${label}`));
3441
+ }
3442
+ profileEnd(label) {
3443
+ console.profileEnd(label), log(this.formatMessage(`Profile ended: ${label}`));
3444
+ }
3445
+ }, StyledConsoleLogger = class extends ConsoleLogger {
3446
+ constructor(options) {
3447
+ super(), this._prefix = options.prefix || "", this._color = options.color;
3448
+ }
3449
+ // Override the getter methods from parent class
3450
+ get prefix() {
3451
+ return this._prefix;
3452
+ }
3453
+ get color() {
3454
+ return import_picocolors5.default[this._color];
3455
+ }
3456
+ };
3457
+
3458
+ // src/node-logger/prompts/prompt-functions.ts
3459
+ var prompt_functions_exports = {};
3460
+ __export(prompt_functions_exports, {
3461
+ confirm: () => confirm,
3462
+ multiselect: () => multiselect,
3463
+ select: () => select,
3464
+ spinner: () => spinner,
3465
+ taskLog: () => taskLog,
3466
+ text: () => text
3467
+ });
3468
+
3469
+ // src/client-logger/index.ts
3470
+ import { global } from "@storybook/global";
3471
+ var { LOGLEVEL } = global, levels = {
3472
+ trace: 1,
3473
+ debug: 2,
3474
+ info: 3,
3475
+ warn: 4,
3476
+ error: 5,
3477
+ silent: 10
3478
+ }, currentLogLevelString = LOGLEVEL, currentLogLevelNumber = levels[currentLogLevelString] || levels.info, logger = {
3479
+ trace: (message, ...rest) => {
3480
+ currentLogLevelNumber <= levels.trace && console.trace(message, ...rest);
3481
+ },
3482
+ debug: (message, ...rest) => {
3483
+ currentLogLevelNumber <= levels.debug && console.debug(message, ...rest);
3484
+ },
3485
+ info: (message, ...rest) => {
3486
+ currentLogLevelNumber <= levels.info && console.info(message, ...rest);
3487
+ },
3488
+ warn: (message, ...rest) => {
3489
+ currentLogLevelNumber <= levels.warn && console.warn(message, ...rest);
3490
+ },
3491
+ error: (message, ...rest) => {
3492
+ currentLogLevelNumber <= levels.error && console.error(message, ...rest);
3493
+ },
3494
+ log: (message, ...rest) => {
3495
+ currentLogLevelNumber < levels.silent && console.log(message, ...rest);
3496
+ }
3497
+ }, logged = /* @__PURE__ */ new Set(), once = (type) => (message, ...rest) => {
3498
+ if (!logged.has(message))
3499
+ return logged.add(message), logger[type](message, ...rest);
3500
+ };
3501
+ once.clear = () => logged.clear();
3502
+ once.trace = once("trace");
3503
+ once.debug = once("debug");
3504
+ once.info = once("info");
3505
+ once.warn = once("warn");
3506
+ once.error = once("error");
3507
+ once.log = once("log");
3508
+ var deprecate = once("warn"), pretty = (type) => (...args) => {
3509
+ let argArray = [];
3510
+ if (args.length) {
3511
+ let startTagRe = /<span\s+style=(['"])([^'"]*)\1\s*>/gi, endTagRe = /<\/span>/gi, reResultArray;
3512
+ for (argArray.push(args[0].replace(startTagRe, "%c").replace(endTagRe, "%c")); reResultArray = startTagRe.exec(args[0]); )
3513
+ argArray.push(reResultArray[2]), argArray.push("");
3514
+ for (let j3 = 1; j3 < args.length; j3++)
3515
+ argArray.push(args[j3]);
3516
+ }
3517
+ logger[type].apply(logger, argArray);
3518
+ };
3519
+ pretty.trace = pretty("trace");
3520
+ pretty.debug = pretty("debug");
3521
+ pretty.info = pretty("info");
3522
+ pretty.warn = pretty("warn");
3523
+ pretty.error = pretty("error");
3524
+
3525
+ // src/node-logger/prompts/prompt-functions.ts
3526
+ var activeSpinner = null, activeTaskLog = null, originalConsoleLog = null, isInteractiveTerminal = () => process.stdout.isTTY && process.stdin.isTTY && !process.env.CI, patchConsoleLog = () => {
3527
+ originalConsoleLog || (originalConsoleLog = console.log, console.log = (...args) => {
3528
+ let message = args.map((arg) => typeof arg == "string" ? arg : JSON.stringify(arg)).join(" ");
3529
+ activeTaskLog ? shouldLog("info") && activeTaskLog.message(message) : activeSpinner ? shouldLog("info") && activeSpinner.message(message) : originalConsoleLog(...args);
3530
+ });
3531
+ }, restoreConsoleLog = () => {
3532
+ originalConsoleLog && !activeSpinner && !activeTaskLog && (console.log = originalConsoleLog, originalConsoleLog = null);
3533
+ }, text = async (options, promptOptions) => getPromptProvider().text(options, promptOptions), confirm = async (options, promptOptions) => getPromptProvider().confirm(options, promptOptions), select = async (options, promptOptions) => getPromptProvider().select(options, promptOptions), multiselect = async (options, promptOptions) => getPromptProvider().multiselect(
3534
+ {
3535
+ ...options,
3536
+ options: options.options.map((opt) => ({
3537
+ ...opt,
3538
+ hint: opt.hint ? wrapTextForClackHint(opt.hint, void 0, opt.label || String(opt.value), 0) : void 0
3539
+ }))
3540
+ },
3541
+ promptOptions
3542
+ ), spinner = (options) => {
3543
+ if (isInteractiveTerminal()) {
3544
+ let spinnerInstance = getPromptProvider().spinner(options), wrappedSpinner = {
3545
+ start: (message) => {
3546
+ activeSpinner = wrappedSpinner, patchConsoleLog(), shouldLog("info") && spinnerInstance.start(message);
3547
+ },
3548
+ stop: (message) => {
3549
+ activeSpinner = null, restoreConsoleLog(), shouldLog("info") && spinnerInstance.stop(message);
3550
+ },
3551
+ message: (text2) => {
3552
+ shouldLog("info") && spinnerInstance.message(text2);
3553
+ }
3554
+ };
3555
+ return wrappedSpinner;
3556
+ } else {
3557
+ let maybeLog = shouldLog("info") ? logger.log : (_) => {
3558
+ };
3559
+ return {
3560
+ start: (message) => {
3561
+ message && maybeLog(message);
3562
+ },
3563
+ stop: (message) => {
3564
+ message && maybeLog(message);
3565
+ },
3566
+ message: (message) => {
3567
+ maybeLog(message);
3568
+ }
3569
+ };
3570
+ }
3571
+ }, taskLog = (options) => {
3572
+ if (isInteractiveTerminal() && shouldLog("info")) {
3573
+ let task = getPromptProvider().taskLog(options), wrappedTaskLog = {
3574
+ message: (message) => {
3575
+ task.message(wrapTextForClack(message));
3576
+ },
3577
+ success: (message, options2) => {
3578
+ activeTaskLog = null, restoreConsoleLog(), task.success(message, options2);
3579
+ },
3580
+ error: (message) => {
3581
+ activeTaskLog = null, restoreConsoleLog(), task.error(message);
3582
+ },
3583
+ group: function(title) {
3584
+ return this.message(`
3585
+ ${title}
3586
+ `), {
3587
+ message: (message) => {
3588
+ task.message(wrapTextForClack(message));
3589
+ },
3590
+ success: (message) => {
3591
+ task.success(message);
3592
+ },
3593
+ error: (message) => {
3594
+ task.error(message);
3595
+ }
3596
+ };
3597
+ }
3598
+ };
3599
+ return activeTaskLog = wrappedTaskLog, patchConsoleLog(), wrappedTaskLog;
3600
+ } else {
3601
+ let maybeLog = shouldLog("info") ? logger.log : (_) => {
3602
+ };
3603
+ return {
3604
+ message: (message) => {
3605
+ maybeLog(message);
3606
+ },
3607
+ success: (message) => {
3608
+ maybeLog(message);
3609
+ },
3610
+ error: (message) => {
3611
+ maybeLog(message);
3612
+ },
3613
+ group: (title) => (maybeLog(`
3614
+ ${title}
3615
+ `), {
3616
+ message: (message) => {
3617
+ maybeLog(message);
3618
+ },
3619
+ success: (message) => {
3620
+ maybeLog(message);
3621
+ },
3622
+ error: (message) => {
3623
+ maybeLog(message);
3624
+ }
3625
+ })
3626
+ };
3627
+ }
3628
+ };
3629
+
3630
+ // src/node-logger/tasks.ts
3631
+ function setupAbortController() {
3632
+ let abortController = new AbortController(), isRawMode = !1, wasRawMode = process.stdin.isRaw, onKeyPress = (chunk) => {
3633
+ let key = chunk.toString();
3634
+ (key === "c" || key === "C") && abortController.abort();
3635
+ }, cleanup = () => {
3636
+ isRawMode && (process.stdin.setRawMode(wasRawMode ?? !1), process.stdin.removeListener("data", onKeyPress), wasRawMode || process.stdin.pause());
3637
+ };
3638
+ if (process.stdin.isTTY)
3639
+ try {
3640
+ isRawMode = !0, process.stdin.setRawMode(!0), process.stdin.resume(), process.stdin.on("data", onKeyPress);
3641
+ } catch {
3642
+ isRawMode = !1;
3643
+ }
3644
+ return { abortController, cleanup };
3645
+ }
3646
+ var executeTask = async (childProcessFactories, {
3647
+ intro: intro2,
3648
+ error: error2,
3649
+ success,
3650
+ abortable = !1
3651
+ }) => {
3652
+ logTracker.addLog("info", intro2), log(intro2);
3653
+ let abortController, cleanup;
3654
+ if (abortable) {
3655
+ let result = setupAbortController();
3656
+ abortController = result.abortController, cleanup = result.cleanup;
3657
+ }
3658
+ let factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
3659
+ try {
3660
+ for (let factory of factories) {
3661
+ let childProcess = factory(abortController?.signal);
3662
+ childProcess.stdout?.on("data", (data) => {
3663
+ let message = data.toString().trim();
3664
+ logTracker.addLog("info", message), log(message);
3665
+ }), await childProcess;
3666
+ }
3667
+ logTracker.addLog("info", success), log(CLI_COLORS.success(success));
3668
+ } catch (err) {
3669
+ if (abortController?.signal.aborted || err.message?.includes("Command was killed with SIGINT") || err.message?.includes("The operation was aborted")) {
3670
+ logTracker.addLog("info", `${intro2} aborted`), log(CLI_COLORS.error(`${intro2} aborted`));
3671
+ return;
3672
+ }
3673
+ let errorMessage = err instanceof Error ? err.stack ?? err.message : String(err);
3674
+ throw logTracker.addLog("error", error2, { error: errorMessage }), log(CLI_COLORS.error(String(err.message ?? err))), err;
3675
+ } finally {
3676
+ cleanup?.();
3677
+ }
3678
+ }, executeTaskWithSpinner = async (childProcessFactories, {
3679
+ id,
3680
+ intro: intro2,
3681
+ error: error2,
3682
+ success,
3683
+ abortable = !1
3684
+ }) => {
3685
+ logTracker.addLog("info", intro2);
3686
+ let abortController, cleanup;
3687
+ if (abortable) {
3688
+ let result = setupAbortController();
3689
+ abortController = result.abortController, cleanup = result.cleanup;
3690
+ }
3691
+ let task = spinner({ id });
3692
+ task.start(intro2);
3693
+ let factories = Array.isArray(childProcessFactories) ? childProcessFactories : [childProcessFactories];
3694
+ try {
3695
+ for (let factory of factories) {
3696
+ let childProcess = factory(abortController?.signal);
3697
+ childProcess.stdout?.on("data", (data) => {
3698
+ let message = data.toString().trim().slice(0, 25);
3699
+ logTracker.addLog("info", `${intro2}: ${data.toString()}`), task.message(`${intro2}: ${message}`);
3700
+ }), await childProcess;
3701
+ }
3702
+ logTracker.addLog("info", success), task.stop(success);
3703
+ } catch (err) {
3704
+ if (abortController?.signal.aborted || err.message?.includes("Command was killed with SIGINT") || err.message?.includes("The operation was aborted")) {
3705
+ logTracker.addLog("info", `${intro2} aborted`), task.stop(CLI_COLORS.warning(`${intro2} aborted`));
3706
+ return;
3707
+ }
3708
+ let errorMessage = err instanceof Error ? err.stack ?? err.message : String(err);
3709
+ throw logTracker.addLog("error", error2, { error: errorMessage }), task.stop(CLI_COLORS.error(error2)), err;
3710
+ } finally {
3711
+ cleanup?.();
3712
+ }
3713
+ };
3714
+
3715
+ // src/node-logger/prompts/index.ts
3716
+ var prompt = {
3717
+ ...prompt_functions_exports,
3718
+ ...prompt_config_exports,
3719
+ executeTask,
3720
+ executeTaskWithSpinner
3721
+ };
3722
+
3723
+ // src/node-logger/index.ts
3724
+ import_npmlog.default.stream = process.stdout;
3725
+ function hex(hexColor) {
3726
+ if (!/^#?[0-9A-Fa-f]{6}$/.test(hexColor))
3727
+ throw new Error("Invalid hex color. It must be a 6-character hex code.");
3728
+ hexColor.startsWith("#") && (hexColor = hexColor.slice(1));
3729
+ let r = parseInt(hexColor.slice(0, 2), 16), g = parseInt(hexColor.slice(2, 4), 16), b2 = parseInt(hexColor.slice(4, 6), 16);
3730
+ return (text2) => `\x1B[38;2;${r};${g};${b2}m${text2}\x1B[39m`;
3731
+ }
3732
+ var colors = {
3733
+ pink: hex("#F1618C"),
3734
+ purple: hex("#B57EE5"),
3735
+ orange: hex("#F3AD38"),
3736
+ green: hex("#A2E05E"),
3737
+ blue: hex("#6DABF5"),
3738
+ red: hex("#F16161"),
3739
+ gray: hex("#B8C2CC")
3740
+ }, logger2 = {
3741
+ ...logger_exports,
3742
+ verbose: (message) => debug(message),
3743
+ line: (count = 1) => log(`${Array(count - 1).fill(`
3744
+ `)}`),
3745
+ /** For non-critical issues or warnings */
3746
+ warn: (message) => warn(message),
3747
+ trace: ({ message, time }) => debug(`${message} (${colors.purple((0, import_pretty_hrtime.default)(time))})`),
3748
+ setLevel: (level = "info") => {
3749
+ import_npmlog.default.level = level, setLogLevel(level);
3750
+ },
3751
+ error: (message) => {
3752
+ let msg;
3753
+ message instanceof Error && message.stack ? msg = message.stack.toString().replace(message.toString(), colors.red(message.toString())) : typeof message == "string" ? msg = message.toString() : msg = String(message), error(msg.replaceAll(process.cwd(), "."));
3754
+ }
3755
+ };
3756
+ var logged2 = /* @__PURE__ */ new Set(), once2 = (type) => (message) => {
3757
+ if (!logged2.has(message))
3758
+ return logged2.add(message), logger2[type](message);
3759
+ };
3760
+ once2.clear = () => logged2.clear();
3761
+ once2.verbose = once2("verbose");
3762
+ once2.info = once2("info");
3763
+ once2.warn = once2("warn");
3764
+ once2.error = once2("error");
3765
+ var deprecate2 = once2("warn");
3766
+
3767
+ export {
3768
+ require_pretty_hrtime,
3769
+ logTracker,
3770
+ protectUrls,
3771
+ createHyperlink,
3772
+ CLI_COLORS,
3773
+ ConsoleLogger,
3774
+ StyledConsoleLogger,
3775
+ prompt,
3776
+ import_npmlog,
3777
+ colors,
3778
+ logger2 as logger,
3779
+ once2 as once,
3780
+ deprecate2 as deprecate
3781
+ };