@depup/vercel 50.32.5-depup.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 (96) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +38 -0
  3. package/changes.json +38 -0
  4. package/dist/chunks/chunk-2DLBVZWU.js +197 -0
  5. package/dist/chunks/chunk-2HSQ7YUK.js +93 -0
  6. package/dist/chunks/chunk-2IQTNMUG.js +86 -0
  7. package/dist/chunks/chunk-3FRG2XGZ.js +466 -0
  8. package/dist/chunks/chunk-3KMKI2FP.js +34 -0
  9. package/dist/chunks/chunk-3XFFP2BA.js +110 -0
  10. package/dist/chunks/chunk-4S3Y3ATR.js +5383 -0
  11. package/dist/chunks/chunk-7EHTK7LP.js +359 -0
  12. package/dist/chunks/chunk-7YHZDJ4G.js +116 -0
  13. package/dist/chunks/chunk-A3NYPUKZ.js +17 -0
  14. package/dist/chunks/chunk-AA7QEJFB.js +5204 -0
  15. package/dist/chunks/chunk-AHU7WNL2.js +24 -0
  16. package/dist/chunks/chunk-AKQZ7KG3.js +4172 -0
  17. package/dist/chunks/chunk-AQLVWVEN.js +39155 -0
  18. package/dist/chunks/chunk-BQ3DXZNT.js +968 -0
  19. package/dist/chunks/chunk-E65JE2CC.js +102 -0
  20. package/dist/chunks/chunk-EKPSCRJZ.js +26 -0
  21. package/dist/chunks/chunk-EOZFDJSY.js +18 -0
  22. package/dist/chunks/chunk-FDJURQMQ.js +4676 -0
  23. package/dist/chunks/chunk-FLKHKWZV.js +1854 -0
  24. package/dist/chunks/chunk-G6BUEBF5.js +192 -0
  25. package/dist/chunks/chunk-GBNIO3KP.js +771 -0
  26. package/dist/chunks/chunk-GGP5R3FU.js +129 -0
  27. package/dist/chunks/chunk-H5XJSH37.js +91 -0
  28. package/dist/chunks/chunk-IB5L4LKZ.js +1082 -0
  29. package/dist/chunks/chunk-IE7MNZ56.js +149 -0
  30. package/dist/chunks/chunk-IK7DLK2T.js +16112 -0
  31. package/dist/chunks/chunk-IUGPWINM.js +104 -0
  32. package/dist/chunks/chunk-J7HDA5GH.js +54 -0
  33. package/dist/chunks/chunk-JLYZNGYY.js +293 -0
  34. package/dist/chunks/chunk-JQ4NA5MX.js +250 -0
  35. package/dist/chunks/chunk-LL26LVRR.js +81 -0
  36. package/dist/chunks/chunk-LW5ZNGW7.js +127 -0
  37. package/dist/chunks/chunk-LWBSOTJP.js +1772 -0
  38. package/dist/chunks/chunk-MBGJBHYD.js +388 -0
  39. package/dist/chunks/chunk-NUKAG3YM.js +168 -0
  40. package/dist/chunks/chunk-O7I4ZOCC.js +58 -0
  41. package/dist/chunks/chunk-OWR3XNE3.js +48 -0
  42. package/dist/chunks/chunk-P3SKP5WM.js +27 -0
  43. package/dist/chunks/chunk-P4I4DMEU.js +342 -0
  44. package/dist/chunks/chunk-P5Q6F5IA.js +107 -0
  45. package/dist/chunks/chunk-PMSMUMUO.js +30 -0
  46. package/dist/chunks/chunk-QXRJ52T4.js +2977 -0
  47. package/dist/chunks/chunk-RQXPRFRM.js +90 -0
  48. package/dist/chunks/chunk-S7KYDPEM.js +1564 -0
  49. package/dist/chunks/chunk-SGGLJFUZ.js +68 -0
  50. package/dist/chunks/chunk-SOTR4CXR.js +34 -0
  51. package/dist/chunks/chunk-TEVP63TU.js +1717 -0
  52. package/dist/chunks/chunk-TNBMKNET.js +323 -0
  53. package/dist/chunks/chunk-TZ2YI2VH.js +87 -0
  54. package/dist/chunks/chunk-U6XOC6E4.js +903 -0
  55. package/dist/chunks/chunk-V5P25P7F.js +22 -0
  56. package/dist/chunks/chunk-WQ5CUZWR.js +333 -0
  57. package/dist/chunks/chunk-WU2BPWRP.js +12237 -0
  58. package/dist/chunks/chunk-XPKWKPWA.js +44 -0
  59. package/dist/chunks/chunk-XR53KVJD.js +33 -0
  60. package/dist/chunks/chunk-Y4JJYHUG.js +16 -0
  61. package/dist/chunks/chunk-YPQSDAEW.js +29 -0
  62. package/dist/chunks/chunk-ZB2UO4V2.js +135 -0
  63. package/dist/chunks/chunk-ZLCMHY2G.js +1528 -0
  64. package/dist/chunks/compile-vercel-config-XU3YY2CZ.js +32 -0
  65. package/dist/chunks/delete-EJ2V7KQO.js +144 -0
  66. package/dist/chunks/disable-BKRFMX4U.js +122 -0
  67. package/dist/chunks/discard-4WF34DXK.js +118 -0
  68. package/dist/chunks/edit-FQE7JGU3.js +509 -0
  69. package/dist/chunks/emit-flags-datafiles-QYKPNWPX.js +17 -0
  70. package/dist/chunks/enable-VCNMX63U.js +122 -0
  71. package/dist/chunks/export-3KNVJCQR.js +133 -0
  72. package/dist/chunks/list-43XQCGKH.js +382 -0
  73. package/dist/chunks/list-DUL6PHUR.js +394 -0
  74. package/dist/chunks/publish-CF7GVZK3.js +128 -0
  75. package/dist/chunks/query-KWKO7VWO.js +954 -0
  76. package/dist/chunks/reorder-GU65YMIN.js +259 -0
  77. package/dist/chunks/restore-Q7ENGWVJ.js +158 -0
  78. package/dist/chunks/routes-Q5CWG44T.js +20 -0
  79. package/dist/chunks/schema-PJKLO2K2.js +176 -0
  80. package/dist/chunks/stamp-RTPE2EBB.js +15 -0
  81. package/dist/chunks/types-563KUQRV.js +108 -0
  82. package/dist/chunks/update-route-version-E3V47KNI.js +13 -0
  83. package/dist/commands/build/index.js +1597 -0
  84. package/dist/commands/deploy/index.js +1711 -0
  85. package/dist/commands/dev/builder-worker.cjs +95 -0
  86. package/dist/commands/dev/index.js +20810 -0
  87. package/dist/commands/env/index.js +2154 -0
  88. package/dist/commands/link/index.js +225 -0
  89. package/dist/commands/list/index.js +528 -0
  90. package/dist/commands-bulk.js +29627 -0
  91. package/dist/get-latest-worker.cjs +272 -0
  92. package/dist/help.js +14 -0
  93. package/dist/index.js +24274 -0
  94. package/dist/vc.js +36 -0
  95. package/dist/version.mjs +1 -0
  96. package/package.json +254 -0
@@ -0,0 +1,4172 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import {
8
+ highlight
9
+ } from "./chunk-V5P25P7F.js";
10
+ import {
11
+ require_dist as require_dist2
12
+ } from "./chunk-IK7DLK2T.js";
13
+ import {
14
+ require_lib as require_lib2
15
+ } from "./chunk-QXRJ52T4.js";
16
+ import {
17
+ getLocalPathConfig
18
+ } from "./chunk-OWR3XNE3.js";
19
+ import {
20
+ DEFAULT_VERCEL_CONFIG_FILENAME,
21
+ VERCEL_CONFIG_EXTENSIONS
22
+ } from "./chunk-MBGJBHYD.js";
23
+ import {
24
+ VERCEL_DIR,
25
+ createPrompt,
26
+ esm_default,
27
+ esm_default2,
28
+ esm_default3,
29
+ getUser,
30
+ global_path_default,
31
+ humanizePath,
32
+ isBackspaceKey,
33
+ isEnterKey,
34
+ makeTheme,
35
+ onExit,
36
+ require_cli_width,
37
+ require_graceful_fs,
38
+ require_lib2 as require_lib,
39
+ require_source as require_source2,
40
+ require_wrap_ansi,
41
+ useKeypress,
42
+ usePrefix,
43
+ useState
44
+ } from "./chunk-AQLVWVEN.js";
45
+ import {
46
+ APIError,
47
+ NowError,
48
+ getCommandName,
49
+ printError,
50
+ require_strip_ansi
51
+ } from "./chunk-ZLCMHY2G.js";
52
+ import {
53
+ init_pkg,
54
+ pkg_default
55
+ } from "./chunk-3XFFP2BA.js";
56
+ import {
57
+ emoji,
58
+ link_default,
59
+ output_manager_default,
60
+ prependEmoji,
61
+ require_ansi_escapes,
62
+ require_dist,
63
+ require_signal_exit
64
+ } from "./chunk-FDJURQMQ.js";
65
+ import {
66
+ require_source
67
+ } from "./chunk-S7KYDPEM.js";
68
+ import {
69
+ __commonJS,
70
+ __publicField,
71
+ __require,
72
+ __toESM
73
+ } from "./chunk-TZ2YI2VH.js";
74
+
75
+ // ../../node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js
76
+ var require_strip_bom = __commonJS({
77
+ "../../node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js"(exports, module) {
78
+ "use strict";
79
+ module.exports = (x) => {
80
+ if (typeof x !== "string") {
81
+ throw new TypeError("Expected a string, got " + typeof x);
82
+ }
83
+ if (x.charCodeAt(0) === 65279) {
84
+ return x.slice(1);
85
+ }
86
+ return x;
87
+ };
88
+ }
89
+ });
90
+
91
+ // ../../node_modules/.pnpm/is-arrayish@0.2.1/node_modules/is-arrayish/index.js
92
+ var require_is_arrayish = __commonJS({
93
+ "../../node_modules/.pnpm/is-arrayish@0.2.1/node_modules/is-arrayish/index.js"(exports, module) {
94
+ "use strict";
95
+ module.exports = function isArrayish(obj) {
96
+ if (!obj) {
97
+ return false;
98
+ }
99
+ return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && obj.splice instanceof Function;
100
+ };
101
+ }
102
+ });
103
+
104
+ // ../../node_modules/.pnpm/error-ex@1.3.2/node_modules/error-ex/index.js
105
+ var require_error_ex = __commonJS({
106
+ "../../node_modules/.pnpm/error-ex@1.3.2/node_modules/error-ex/index.js"(exports, module) {
107
+ "use strict";
108
+ var util = __require("util");
109
+ var isArrayish = require_is_arrayish();
110
+ var errorEx = function errorEx2(name, properties) {
111
+ if (!name || name.constructor !== String) {
112
+ properties = name || {};
113
+ name = Error.name;
114
+ }
115
+ var errorExError = function ErrorEXError(message) {
116
+ if (!this) {
117
+ return new ErrorEXError(message);
118
+ }
119
+ message = message instanceof Error ? message.message : message || this.message;
120
+ Error.call(this, message);
121
+ Error.captureStackTrace(this, errorExError);
122
+ this.name = name;
123
+ Object.defineProperty(this, "message", {
124
+ configurable: true,
125
+ enumerable: false,
126
+ get: function() {
127
+ var newMessage = message.split(/\r?\n/g);
128
+ for (var key in properties) {
129
+ if (!properties.hasOwnProperty(key)) {
130
+ continue;
131
+ }
132
+ var modifier = properties[key];
133
+ if ("message" in modifier) {
134
+ newMessage = modifier.message(this[key], newMessage) || newMessage;
135
+ if (!isArrayish(newMessage)) {
136
+ newMessage = [newMessage];
137
+ }
138
+ }
139
+ }
140
+ return newMessage.join("\n");
141
+ },
142
+ set: function(v) {
143
+ message = v;
144
+ }
145
+ });
146
+ var overwrittenStack = null;
147
+ var stackDescriptor = Object.getOwnPropertyDescriptor(this, "stack");
148
+ var stackGetter = stackDescriptor.get;
149
+ var stackValue = stackDescriptor.value;
150
+ delete stackDescriptor.value;
151
+ delete stackDescriptor.writable;
152
+ stackDescriptor.set = function(newstack) {
153
+ overwrittenStack = newstack;
154
+ };
155
+ stackDescriptor.get = function() {
156
+ var stack = (overwrittenStack || (stackGetter ? stackGetter.call(this) : stackValue)).split(/\r?\n+/g);
157
+ if (!overwrittenStack) {
158
+ stack[0] = this.name + ": " + this.message;
159
+ }
160
+ var lineCount = 1;
161
+ for (var key in properties) {
162
+ if (!properties.hasOwnProperty(key)) {
163
+ continue;
164
+ }
165
+ var modifier = properties[key];
166
+ if ("line" in modifier) {
167
+ var line = modifier.line(this[key]);
168
+ if (line) {
169
+ stack.splice(lineCount++, 0, " " + line);
170
+ }
171
+ }
172
+ if ("stack" in modifier) {
173
+ modifier.stack(this[key], stack);
174
+ }
175
+ }
176
+ return stack.join("\n");
177
+ };
178
+ Object.defineProperty(this, "stack", stackDescriptor);
179
+ };
180
+ if (Object.setPrototypeOf) {
181
+ Object.setPrototypeOf(errorExError.prototype, Error.prototype);
182
+ Object.setPrototypeOf(errorExError, Error);
183
+ } else {
184
+ util.inherits(errorExError, Error);
185
+ }
186
+ return errorExError;
187
+ };
188
+ errorEx.append = function(str, def) {
189
+ return {
190
+ message: function(v, message) {
191
+ v = v || def;
192
+ if (v) {
193
+ message[0] += " " + str.replace("%s", v.toString());
194
+ }
195
+ return message;
196
+ }
197
+ };
198
+ };
199
+ errorEx.line = function(str, def) {
200
+ return {
201
+ line: function(v) {
202
+ v = v || def;
203
+ if (v) {
204
+ return str.replace("%s", v.toString());
205
+ }
206
+ return null;
207
+ }
208
+ };
209
+ };
210
+ module.exports = errorEx;
211
+ }
212
+ });
213
+
214
+ // ../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/unicode.js
215
+ var require_unicode = __commonJS({
216
+ "../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/unicode.js"(exports, module) {
217
+ var Uni = module.exports;
218
+ module.exports.isWhiteSpace = function isWhiteSpace(x) {
219
+ return x === " " || x === "\xA0" || x === "\uFEFF" || x >= " " && x <= "\r" || x === "\u1680" || x === "\u180E" || x >= "\u2000" && x <= "\u200A" || x === "\u2028" || x === "\u2029" || x === "\u202F" || x === "\u205F" || x === "\u3000";
220
+ };
221
+ module.exports.isWhiteSpaceJSON = function isWhiteSpaceJSON(x) {
222
+ return x === " " || x === " " || x === "\n" || x === "\r";
223
+ };
224
+ module.exports.isLineTerminator = function isLineTerminator(x) {
225
+ return x === "\n" || x === "\r" || x === "\u2028" || x === "\u2029";
226
+ };
227
+ module.exports.isLineTerminatorJSON = function isLineTerminatorJSON(x) {
228
+ return x === "\n" || x === "\r";
229
+ };
230
+ module.exports.isIdentifierStart = function isIdentifierStart(x) {
231
+ return x === "$" || x === "_" || x >= "A" && x <= "Z" || x >= "a" && x <= "z" || x >= "\x80" && Uni.NonAsciiIdentifierStart.test(x);
232
+ };
233
+ module.exports.isIdentifierPart = function isIdentifierPart(x) {
234
+ return x === "$" || x === "_" || x >= "A" && x <= "Z" || x >= "a" && x <= "z" || x >= "0" && x <= "9" || x >= "\x80" && Uni.NonAsciiIdentifierPart.test(x);
235
+ };
236
+ module.exports.NonAsciiIdentifierStart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;
237
+ module.exports.NonAsciiIdentifierPart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;
238
+ }
239
+ });
240
+
241
+ // ../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/parse.js
242
+ var require_parse = __commonJS({
243
+ "../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/parse.js"(exports, module) {
244
+ var Uni = require_unicode();
245
+ function isHexDigit(x) {
246
+ return x >= "0" && x <= "9" || x >= "A" && x <= "F" || x >= "a" && x <= "f";
247
+ }
248
+ function isOctDigit(x) {
249
+ return x >= "0" && x <= "7";
250
+ }
251
+ function isDecDigit(x) {
252
+ return x >= "0" && x <= "9";
253
+ }
254
+ var unescapeMap = {
255
+ "'": "'",
256
+ '"': '"',
257
+ "\\": "\\",
258
+ "b": "\b",
259
+ "f": "\f",
260
+ "n": "\n",
261
+ "r": "\r",
262
+ "t": " ",
263
+ "v": "\v",
264
+ "/": "/"
265
+ };
266
+ function formatError(input, msg, position, lineno, column, json5) {
267
+ var result = msg + " at " + (lineno + 1) + ":" + (column + 1), tmppos = position - column - 1, srcline = "", underline = "";
268
+ var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON;
269
+ if (tmppos < position - 70) {
270
+ tmppos = position - 70;
271
+ }
272
+ while (1) {
273
+ var chr = input[++tmppos];
274
+ if (isLineTerminator(chr) || tmppos === input.length) {
275
+ if (position >= tmppos) {
276
+ underline += "^";
277
+ }
278
+ break;
279
+ }
280
+ srcline += chr;
281
+ if (position === tmppos) {
282
+ underline += "^";
283
+ } else if (position > tmppos) {
284
+ underline += input[tmppos] === " " ? " " : " ";
285
+ }
286
+ if (srcline.length > 78)
287
+ break;
288
+ }
289
+ return result + "\n" + srcline + "\n" + underline;
290
+ }
291
+ function parse(input, options) {
292
+ var json5 = !(options.mode === "json" || options.legacy);
293
+ var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON;
294
+ var isWhiteSpace = json5 ? Uni.isWhiteSpace : Uni.isWhiteSpaceJSON;
295
+ var length = input.length, lineno = 0, linestart = 0, position = 0, stack = [];
296
+ var tokenStart = function() {
297
+ };
298
+ var tokenEnd = function(v) {
299
+ return v;
300
+ };
301
+ if (options._tokenize) {
302
+ ;
303
+ (function() {
304
+ var start = null;
305
+ tokenStart = function() {
306
+ if (start !== null)
307
+ throw Error("internal error, token overlap");
308
+ start = position;
309
+ };
310
+ tokenEnd = function(v, type) {
311
+ if (start != position) {
312
+ var hash = {
313
+ raw: input.substr(start, position - start),
314
+ type,
315
+ stack: stack.slice(0)
316
+ };
317
+ if (v !== void 0)
318
+ hash.value = v;
319
+ options._tokenize.call(null, hash);
320
+ }
321
+ start = null;
322
+ return v;
323
+ };
324
+ })();
325
+ }
326
+ function fail(msg) {
327
+ var column = position - linestart;
328
+ if (!msg) {
329
+ if (position < length) {
330
+ var token = "'" + JSON.stringify(input[position]).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
331
+ if (!msg)
332
+ msg = "Unexpected token " + token;
333
+ } else {
334
+ if (!msg)
335
+ msg = "Unexpected end of input";
336
+ }
337
+ }
338
+ var error = SyntaxError(formatError(input, msg, position, lineno, column, json5));
339
+ error.row = lineno + 1;
340
+ error.column = column + 1;
341
+ throw error;
342
+ }
343
+ function newline(chr) {
344
+ if (chr === "\r" && input[position] === "\n")
345
+ position++;
346
+ linestart = position;
347
+ lineno++;
348
+ }
349
+ function parseGeneric() {
350
+ var result;
351
+ while (position < length) {
352
+ tokenStart();
353
+ var chr = input[position++];
354
+ if (chr === '"' || chr === "'" && json5) {
355
+ return tokenEnd(parseString(chr), "literal");
356
+ } else if (chr === "{") {
357
+ tokenEnd(void 0, "separator");
358
+ return parseObject();
359
+ } else if (chr === "[") {
360
+ tokenEnd(void 0, "separator");
361
+ return parseArray();
362
+ } else if (chr === "-" || chr === "." || isDecDigit(chr) || json5 && (chr === "+" || chr === "I" || chr === "N")) {
363
+ return tokenEnd(parseNumber(), "literal");
364
+ } else if (chr === "n") {
365
+ parseKeyword("null");
366
+ return tokenEnd(null, "literal");
367
+ } else if (chr === "t") {
368
+ parseKeyword("true");
369
+ return tokenEnd(true, "literal");
370
+ } else if (chr === "f") {
371
+ parseKeyword("false");
372
+ return tokenEnd(false, "literal");
373
+ } else {
374
+ position--;
375
+ return tokenEnd(void 0);
376
+ }
377
+ }
378
+ }
379
+ function parseKey() {
380
+ var result;
381
+ while (position < length) {
382
+ tokenStart();
383
+ var chr = input[position++];
384
+ if (chr === '"' || chr === "'" && json5) {
385
+ return tokenEnd(parseString(chr), "key");
386
+ } else if (chr === "{") {
387
+ tokenEnd(void 0, "separator");
388
+ return parseObject();
389
+ } else if (chr === "[") {
390
+ tokenEnd(void 0, "separator");
391
+ return parseArray();
392
+ } else if (chr === "." || isDecDigit(chr)) {
393
+ return tokenEnd(parseNumber(true), "key");
394
+ } else if (json5 && Uni.isIdentifierStart(chr) || chr === "\\" && input[position] === "u") {
395
+ var rollback = position - 1;
396
+ var result = parseIdentifier();
397
+ if (result === void 0) {
398
+ position = rollback;
399
+ return tokenEnd(void 0);
400
+ } else {
401
+ return tokenEnd(result, "key");
402
+ }
403
+ } else {
404
+ position--;
405
+ return tokenEnd(void 0);
406
+ }
407
+ }
408
+ }
409
+ function skipWhiteSpace() {
410
+ tokenStart();
411
+ while (position < length) {
412
+ var chr = input[position++];
413
+ if (isLineTerminator(chr)) {
414
+ position--;
415
+ tokenEnd(void 0, "whitespace");
416
+ tokenStart();
417
+ position++;
418
+ newline(chr);
419
+ tokenEnd(void 0, "newline");
420
+ tokenStart();
421
+ } else if (isWhiteSpace(chr)) {
422
+ } else if (chr === "/" && json5 && (input[position] === "/" || input[position] === "*")) {
423
+ position--;
424
+ tokenEnd(void 0, "whitespace");
425
+ tokenStart();
426
+ position++;
427
+ skipComment(input[position++] === "*");
428
+ tokenEnd(void 0, "comment");
429
+ tokenStart();
430
+ } else {
431
+ position--;
432
+ break;
433
+ }
434
+ }
435
+ return tokenEnd(void 0, "whitespace");
436
+ }
437
+ function skipComment(multi) {
438
+ while (position < length) {
439
+ var chr = input[position++];
440
+ if (isLineTerminator(chr)) {
441
+ if (!multi) {
442
+ position--;
443
+ return;
444
+ }
445
+ newline(chr);
446
+ } else if (chr === "*" && multi) {
447
+ if (input[position] === "/") {
448
+ position++;
449
+ return;
450
+ }
451
+ } else {
452
+ }
453
+ }
454
+ if (multi) {
455
+ fail("Unclosed multiline comment");
456
+ }
457
+ }
458
+ function parseKeyword(keyword) {
459
+ var _pos = position;
460
+ var len = keyword.length;
461
+ for (var i = 1; i < len; i++) {
462
+ if (position >= length || keyword[i] != input[position]) {
463
+ position = _pos - 1;
464
+ fail();
465
+ }
466
+ position++;
467
+ }
468
+ }
469
+ function parseObject() {
470
+ var result = options.null_prototype ? /* @__PURE__ */ Object.create(null) : {}, empty_object = {}, is_non_empty = false;
471
+ while (position < length) {
472
+ skipWhiteSpace();
473
+ var item1 = parseKey();
474
+ skipWhiteSpace();
475
+ tokenStart();
476
+ var chr = input[position++];
477
+ tokenEnd(void 0, "separator");
478
+ if (chr === "}" && item1 === void 0) {
479
+ if (!json5 && is_non_empty) {
480
+ position--;
481
+ fail("Trailing comma in object");
482
+ }
483
+ return result;
484
+ } else if (chr === ":" && item1 !== void 0) {
485
+ skipWhiteSpace();
486
+ stack.push(item1);
487
+ var item2 = parseGeneric();
488
+ stack.pop();
489
+ if (item2 === void 0)
490
+ fail("No value found for key " + item1);
491
+ if (typeof item1 !== "string") {
492
+ if (!json5 || typeof item1 !== "number") {
493
+ fail("Wrong key type: " + item1);
494
+ }
495
+ }
496
+ if ((item1 in empty_object || empty_object[item1] != null) && options.reserved_keys !== "replace") {
497
+ if (options.reserved_keys === "throw") {
498
+ fail("Reserved key: " + item1);
499
+ } else {
500
+ }
501
+ } else {
502
+ if (typeof options.reviver === "function") {
503
+ item2 = options.reviver.call(null, item1, item2);
504
+ }
505
+ if (item2 !== void 0) {
506
+ is_non_empty = true;
507
+ Object.defineProperty(result, item1, {
508
+ value: item2,
509
+ enumerable: true,
510
+ configurable: true,
511
+ writable: true
512
+ });
513
+ }
514
+ }
515
+ skipWhiteSpace();
516
+ tokenStart();
517
+ var chr = input[position++];
518
+ tokenEnd(void 0, "separator");
519
+ if (chr === ",") {
520
+ continue;
521
+ } else if (chr === "}") {
522
+ return result;
523
+ } else {
524
+ fail();
525
+ }
526
+ } else {
527
+ position--;
528
+ fail();
529
+ }
530
+ }
531
+ fail();
532
+ }
533
+ function parseArray() {
534
+ var result = [];
535
+ while (position < length) {
536
+ skipWhiteSpace();
537
+ stack.push(result.length);
538
+ var item = parseGeneric();
539
+ stack.pop();
540
+ skipWhiteSpace();
541
+ tokenStart();
542
+ var chr = input[position++];
543
+ tokenEnd(void 0, "separator");
544
+ if (item !== void 0) {
545
+ if (typeof options.reviver === "function") {
546
+ item = options.reviver.call(null, String(result.length), item);
547
+ }
548
+ if (item === void 0) {
549
+ result.length++;
550
+ item = true;
551
+ } else {
552
+ result.push(item);
553
+ }
554
+ }
555
+ if (chr === ",") {
556
+ if (item === void 0) {
557
+ fail("Elisions are not supported");
558
+ }
559
+ } else if (chr === "]") {
560
+ if (!json5 && item === void 0 && result.length) {
561
+ position--;
562
+ fail("Trailing comma in array");
563
+ }
564
+ return result;
565
+ } else {
566
+ position--;
567
+ fail();
568
+ }
569
+ }
570
+ }
571
+ function parseNumber() {
572
+ position--;
573
+ var start = position, chr = input[position++], t;
574
+ var to_num = function(is_octal2) {
575
+ var str = input.substr(start, position - start);
576
+ if (is_octal2) {
577
+ var result = parseInt(str.replace(/^0o?/, ""), 8);
578
+ } else {
579
+ var result = Number(str);
580
+ }
581
+ if (Number.isNaN(result)) {
582
+ position--;
583
+ fail('Bad numeric literal - "' + input.substr(start, position - start + 1) + '"');
584
+ } else if (!json5 && !str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i)) {
585
+ position--;
586
+ fail('Non-json numeric literal - "' + input.substr(start, position - start + 1) + '"');
587
+ } else {
588
+ return result;
589
+ }
590
+ };
591
+ if (chr === "-" || chr === "+" && json5)
592
+ chr = input[position++];
593
+ if (chr === "N" && json5) {
594
+ parseKeyword("NaN");
595
+ return NaN;
596
+ }
597
+ if (chr === "I" && json5) {
598
+ parseKeyword("Infinity");
599
+ return to_num();
600
+ }
601
+ if (chr >= "1" && chr <= "9") {
602
+ while (position < length && isDecDigit(input[position]))
603
+ position++;
604
+ chr = input[position++];
605
+ }
606
+ if (chr === "0") {
607
+ chr = input[position++];
608
+ var is_octal = chr === "o" || chr === "O" || isOctDigit(chr);
609
+ var is_hex = chr === "x" || chr === "X";
610
+ if (json5 && (is_octal || is_hex)) {
611
+ while (position < length && (is_hex ? isHexDigit : isOctDigit)(input[position]))
612
+ position++;
613
+ var sign = 1;
614
+ if (input[start] === "-") {
615
+ sign = -1;
616
+ start++;
617
+ } else if (input[start] === "+") {
618
+ start++;
619
+ }
620
+ return sign * to_num(is_octal);
621
+ }
622
+ }
623
+ if (chr === ".") {
624
+ while (position < length && isDecDigit(input[position]))
625
+ position++;
626
+ chr = input[position++];
627
+ }
628
+ if (chr === "e" || chr === "E") {
629
+ chr = input[position++];
630
+ if (chr === "-" || chr === "+")
631
+ position++;
632
+ while (position < length && isDecDigit(input[position]))
633
+ position++;
634
+ chr = input[position++];
635
+ }
636
+ position--;
637
+ return to_num();
638
+ }
639
+ function parseIdentifier() {
640
+ position--;
641
+ var result = "";
642
+ while (position < length) {
643
+ var chr = input[position++];
644
+ if (chr === "\\" && input[position] === "u" && isHexDigit(input[position + 1]) && isHexDigit(input[position + 2]) && isHexDigit(input[position + 3]) && isHexDigit(input[position + 4])) {
645
+ chr = String.fromCharCode(parseInt(input.substr(position + 1, 4), 16));
646
+ position += 5;
647
+ }
648
+ if (result.length) {
649
+ if (Uni.isIdentifierPart(chr)) {
650
+ result += chr;
651
+ } else {
652
+ position--;
653
+ return result;
654
+ }
655
+ } else {
656
+ if (Uni.isIdentifierStart(chr)) {
657
+ result += chr;
658
+ } else {
659
+ return void 0;
660
+ }
661
+ }
662
+ }
663
+ fail();
664
+ }
665
+ function parseString(endChar) {
666
+ var result = "";
667
+ while (position < length) {
668
+ var chr = input[position++];
669
+ if (chr === endChar) {
670
+ return result;
671
+ } else if (chr === "\\") {
672
+ if (position >= length)
673
+ fail();
674
+ chr = input[position++];
675
+ if (unescapeMap[chr] && (json5 || chr != "v" && chr != "'")) {
676
+ result += unescapeMap[chr];
677
+ } else if (json5 && isLineTerminator(chr)) {
678
+ newline(chr);
679
+ } else if (chr === "u" || chr === "x" && json5) {
680
+ var off = chr === "u" ? 4 : 2;
681
+ for (var i = 0; i < off; i++) {
682
+ if (position >= length)
683
+ fail();
684
+ if (!isHexDigit(input[position]))
685
+ fail("Bad escape sequence");
686
+ position++;
687
+ }
688
+ result += String.fromCharCode(parseInt(input.substr(position - off, off), 16));
689
+ } else if (json5 && isOctDigit(chr)) {
690
+ if (chr < "4" && isOctDigit(input[position]) && isOctDigit(input[position + 1])) {
691
+ var digits = 3;
692
+ } else if (isOctDigit(input[position])) {
693
+ var digits = 2;
694
+ } else {
695
+ var digits = 1;
696
+ }
697
+ position += digits - 1;
698
+ result += String.fromCharCode(parseInt(input.substr(position - digits, digits), 8));
699
+ } else if (json5) {
700
+ result += chr;
701
+ } else {
702
+ position--;
703
+ fail();
704
+ }
705
+ } else if (isLineTerminator(chr)) {
706
+ fail();
707
+ } else {
708
+ if (!json5 && chr.charCodeAt(0) < 32) {
709
+ position--;
710
+ fail("Unexpected control character");
711
+ }
712
+ result += chr;
713
+ }
714
+ }
715
+ fail();
716
+ }
717
+ skipWhiteSpace();
718
+ var return_value = parseGeneric();
719
+ if (return_value !== void 0 || position < length) {
720
+ skipWhiteSpace();
721
+ if (position >= length) {
722
+ if (typeof options.reviver === "function") {
723
+ return_value = options.reviver.call(null, "", return_value);
724
+ }
725
+ return return_value;
726
+ } else {
727
+ fail();
728
+ }
729
+ } else {
730
+ if (position) {
731
+ fail("No data, only a whitespace");
732
+ } else {
733
+ fail("No data, empty input");
734
+ }
735
+ }
736
+ }
737
+ module.exports.parse = function parseJSON(input, options) {
738
+ if (typeof options === "function") {
739
+ options = {
740
+ reviver: options
741
+ };
742
+ }
743
+ if (input === void 0) {
744
+ return void 0;
745
+ }
746
+ if (typeof input !== "string")
747
+ input = String(input);
748
+ if (options == null)
749
+ options = {};
750
+ if (options.reserved_keys == null)
751
+ options.reserved_keys = "ignore";
752
+ if (options.reserved_keys === "throw" || options.reserved_keys === "ignore") {
753
+ if (options.null_prototype == null) {
754
+ options.null_prototype = true;
755
+ }
756
+ }
757
+ try {
758
+ return parse(input, options);
759
+ } catch (err) {
760
+ if (err instanceof SyntaxError && err.row != null && err.column != null) {
761
+ var old_err = err;
762
+ err = SyntaxError(old_err.message);
763
+ err.column = old_err.column;
764
+ err.row = old_err.row;
765
+ }
766
+ throw err;
767
+ }
768
+ };
769
+ module.exports.tokenize = function tokenizeJSON(input, options) {
770
+ if (options == null)
771
+ options = {};
772
+ options._tokenize = function(smth) {
773
+ if (options._addstack)
774
+ smth.stack.unshift.apply(smth.stack, options._addstack);
775
+ tokens.push(smth);
776
+ };
777
+ var tokens = [];
778
+ tokens.data = module.exports.parse(input, options);
779
+ return tokens;
780
+ };
781
+ }
782
+ });
783
+
784
+ // ../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/index.js
785
+ var require_parse_json = __commonJS({
786
+ "../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/index.js"(exports, module) {
787
+ "use strict";
788
+ var errorEx = require_error_ex();
789
+ var fallback = require_parse();
790
+ function appendPosition(message) {
791
+ const posRe = / at (\d+:\d+) in/;
792
+ const numbers = posRe.exec(message);
793
+ return message.replace(posRe, " in") + ":" + numbers[1];
794
+ }
795
+ var JSONError = errorEx("JSONError", {
796
+ fileName: errorEx.append("in %s"),
797
+ appendPosition: {
798
+ message: (shouldAppend, original) => {
799
+ if (shouldAppend) {
800
+ original[0] = appendPosition(original[0]);
801
+ }
802
+ return original;
803
+ }
804
+ }
805
+ });
806
+ module.exports = (input, reviver, filename) => {
807
+ if (typeof reviver === "string") {
808
+ filename = reviver;
809
+ reviver = null;
810
+ }
811
+ try {
812
+ try {
813
+ return JSON.parse(input, reviver);
814
+ } catch (err) {
815
+ fallback.parse(input, {
816
+ mode: "json",
817
+ reviver
818
+ });
819
+ throw err;
820
+ }
821
+ } catch (err) {
822
+ const jsonErr = new JSONError(err);
823
+ if (filename) {
824
+ jsonErr.fileName = filename;
825
+ jsonErr.appendPosition = true;
826
+ }
827
+ throw jsonErr;
828
+ }
829
+ };
830
+ }
831
+ });
832
+
833
+ // ../../node_modules/.pnpm/pify@2.3.0/node_modules/pify/index.js
834
+ var require_pify = __commonJS({
835
+ "../../node_modules/.pnpm/pify@2.3.0/node_modules/pify/index.js"(exports, module) {
836
+ "use strict";
837
+ var processFn = function(fn, P, opts) {
838
+ return function() {
839
+ var that = this;
840
+ var args = new Array(arguments.length);
841
+ for (var i = 0; i < arguments.length; i++) {
842
+ args[i] = arguments[i];
843
+ }
844
+ return new P(function(resolve, reject) {
845
+ args.push(function(err, result) {
846
+ if (err) {
847
+ reject(err);
848
+ } else if (opts.multiArgs) {
849
+ var results = new Array(arguments.length - 1);
850
+ for (var i2 = 1; i2 < arguments.length; i2++) {
851
+ results[i2 - 1] = arguments[i2];
852
+ }
853
+ resolve(results);
854
+ } else {
855
+ resolve(result);
856
+ }
857
+ });
858
+ fn.apply(that, args);
859
+ });
860
+ };
861
+ };
862
+ var pify = module.exports = function(obj, P, opts) {
863
+ if (typeof P !== "function") {
864
+ opts = P;
865
+ P = Promise;
866
+ }
867
+ opts = opts || {};
868
+ opts.exclude = opts.exclude || [/.+Sync$/];
869
+ var filter = function(key) {
870
+ var match = function(pattern) {
871
+ return typeof pattern === "string" ? key === pattern : pattern.test(key);
872
+ };
873
+ return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
874
+ };
875
+ var ret = typeof obj === "function" ? function() {
876
+ if (opts.excludeMain) {
877
+ return obj.apply(this, arguments);
878
+ }
879
+ return processFn(obj, P, opts).apply(this, arguments);
880
+ } : {};
881
+ return Object.keys(obj).reduce(function(ret2, key) {
882
+ var x = obj[key];
883
+ ret2[key] = typeof x === "function" && filter(key) ? processFn(x, P, opts) : x;
884
+ return ret2;
885
+ }, ret);
886
+ };
887
+ pify.all = pify;
888
+ }
889
+ });
890
+
891
+ // ../../node_modules/.pnpm/load-json-file@3.0.0/node_modules/load-json-file/index.js
892
+ var require_load_json_file = __commonJS({
893
+ "../../node_modules/.pnpm/load-json-file@3.0.0/node_modules/load-json-file/index.js"(exports, module) {
894
+ "use strict";
895
+ var path = __require("path");
896
+ var fs = require_graceful_fs();
897
+ var stripBom = require_strip_bom();
898
+ var parseJson = require_parse_json();
899
+ var pify = require_pify();
900
+ var parse = (data, fp) => parseJson(stripBom(data), path.relative(".", fp));
901
+ module.exports = (fp) => pify(fs.readFile)(fp, "utf8").then((data) => parse(data, fp));
902
+ module.exports.sync = (fp) => parse(fs.readFileSync(fp, "utf8"), fp);
903
+ }
904
+ });
905
+
906
+ // ../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js
907
+ var require_imurmurhash = __commonJS({
908
+ "../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports, module) {
909
+ (function() {
910
+ var cache;
911
+ function MurmurHash3(key, seed) {
912
+ var m = this instanceof MurmurHash3 ? this : cache;
913
+ m.reset(seed);
914
+ if (typeof key === "string" && key.length > 0) {
915
+ m.hash(key);
916
+ }
917
+ if (m !== this) {
918
+ return m;
919
+ }
920
+ }
921
+ ;
922
+ MurmurHash3.prototype.hash = function(key) {
923
+ var h1, k1, i, top, len;
924
+ len = key.length;
925
+ this.len += len;
926
+ k1 = this.k1;
927
+ i = 0;
928
+ switch (this.rem) {
929
+ case 0:
930
+ k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0;
931
+ case 1:
932
+ k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0;
933
+ case 2:
934
+ k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0;
935
+ case 3:
936
+ k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0;
937
+ k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0;
938
+ }
939
+ this.rem = len + this.rem & 3;
940
+ len -= this.rem;
941
+ if (len > 0) {
942
+ h1 = this.h1;
943
+ while (1) {
944
+ k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295;
945
+ k1 = k1 << 15 | k1 >>> 17;
946
+ k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295;
947
+ h1 ^= k1;
948
+ h1 = h1 << 13 | h1 >>> 19;
949
+ h1 = h1 * 5 + 3864292196 & 4294967295;
950
+ if (i >= len) {
951
+ break;
952
+ }
953
+ k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16;
954
+ top = key.charCodeAt(i++);
955
+ k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8;
956
+ }
957
+ k1 = 0;
958
+ switch (this.rem) {
959
+ case 3:
960
+ k1 ^= (key.charCodeAt(i + 2) & 65535) << 16;
961
+ case 2:
962
+ k1 ^= (key.charCodeAt(i + 1) & 65535) << 8;
963
+ case 1:
964
+ k1 ^= key.charCodeAt(i) & 65535;
965
+ }
966
+ this.h1 = h1;
967
+ }
968
+ this.k1 = k1;
969
+ return this;
970
+ };
971
+ MurmurHash3.prototype.result = function() {
972
+ var k1, h1;
973
+ k1 = this.k1;
974
+ h1 = this.h1;
975
+ if (k1 > 0) {
976
+ k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295;
977
+ k1 = k1 << 15 | k1 >>> 17;
978
+ k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295;
979
+ h1 ^= k1;
980
+ }
981
+ h1 ^= this.len;
982
+ h1 ^= h1 >>> 16;
983
+ h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295;
984
+ h1 ^= h1 >>> 13;
985
+ h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295;
986
+ h1 ^= h1 >>> 16;
987
+ return h1 >>> 0;
988
+ };
989
+ MurmurHash3.prototype.reset = function(seed) {
990
+ this.h1 = typeof seed === "number" ? seed : 0;
991
+ this.rem = this.k1 = this.len = 0;
992
+ return this;
993
+ };
994
+ cache = new MurmurHash3();
995
+ if (typeof module != "undefined") {
996
+ module.exports = MurmurHash3;
997
+ } else {
998
+ this.MurmurHash3 = MurmurHash3;
999
+ }
1000
+ })();
1001
+ }
1002
+ });
1003
+
1004
+ // ../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js
1005
+ var require_write_file_atomic = __commonJS({
1006
+ "../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports, module) {
1007
+ "use strict";
1008
+ module.exports = writeFile;
1009
+ module.exports.sync = writeFileSync;
1010
+ module.exports._getTmpname = getTmpname;
1011
+ module.exports._cleanupOnExit = cleanupOnExit;
1012
+ var fs = require_graceful_fs();
1013
+ var MurmurHash3 = require_imurmurhash();
1014
+ var onExit2 = require_signal_exit();
1015
+ var path = __require("path");
1016
+ var activeFiles = {};
1017
+ var threadId = function getId() {
1018
+ try {
1019
+ var workerThreads = __require("worker_threads");
1020
+ return workerThreads.threadId;
1021
+ } catch (e) {
1022
+ return 0;
1023
+ }
1024
+ }();
1025
+ var invocations = 0;
1026
+ function getTmpname(filename) {
1027
+ return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result();
1028
+ }
1029
+ function cleanupOnExit(tmpfile) {
1030
+ return function() {
1031
+ try {
1032
+ fs.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile);
1033
+ } catch (_) {
1034
+ }
1035
+ };
1036
+ }
1037
+ function writeFile(filename, data, options, callback) {
1038
+ if (options) {
1039
+ if (options instanceof Function) {
1040
+ callback = options;
1041
+ options = {};
1042
+ } else if (typeof options === "string") {
1043
+ options = { encoding: options };
1044
+ }
1045
+ } else {
1046
+ options = {};
1047
+ }
1048
+ var Promise2 = options.Promise || global.Promise;
1049
+ var truename;
1050
+ var fd;
1051
+ var tmpfile;
1052
+ var removeOnExitHandler = onExit2(cleanupOnExit(() => tmpfile));
1053
+ var absoluteName = path.resolve(filename);
1054
+ new Promise2(function serializeSameFile(resolve) {
1055
+ if (!activeFiles[absoluteName])
1056
+ activeFiles[absoluteName] = [];
1057
+ activeFiles[absoluteName].push(resolve);
1058
+ if (activeFiles[absoluteName].length === 1)
1059
+ resolve();
1060
+ }).then(function getRealPath() {
1061
+ return new Promise2(function(resolve) {
1062
+ fs.realpath(filename, function(_, realname) {
1063
+ truename = realname || filename;
1064
+ tmpfile = getTmpname(truename);
1065
+ resolve();
1066
+ });
1067
+ });
1068
+ }).then(function stat() {
1069
+ return new Promise2(function stat2(resolve) {
1070
+ if (options.mode && options.chown)
1071
+ resolve();
1072
+ else {
1073
+ fs.stat(truename, function(err, stats) {
1074
+ if (err || !stats)
1075
+ resolve();
1076
+ else {
1077
+ options = Object.assign({}, options);
1078
+ if (options.mode == null) {
1079
+ options.mode = stats.mode;
1080
+ }
1081
+ if (options.chown == null && process.getuid) {
1082
+ options.chown = { uid: stats.uid, gid: stats.gid };
1083
+ }
1084
+ resolve();
1085
+ }
1086
+ });
1087
+ }
1088
+ });
1089
+ }).then(function thenWriteFile() {
1090
+ return new Promise2(function(resolve, reject) {
1091
+ fs.open(tmpfile, "w", options.mode, function(err, _fd) {
1092
+ fd = _fd;
1093
+ if (err)
1094
+ reject(err);
1095
+ else
1096
+ resolve();
1097
+ });
1098
+ });
1099
+ }).then(function write() {
1100
+ return new Promise2(function(resolve, reject) {
1101
+ if (Buffer.isBuffer(data)) {
1102
+ fs.write(fd, data, 0, data.length, 0, function(err) {
1103
+ if (err)
1104
+ reject(err);
1105
+ else
1106
+ resolve();
1107
+ });
1108
+ } else if (data != null) {
1109
+ fs.write(fd, String(data), 0, String(options.encoding || "utf8"), function(err) {
1110
+ if (err)
1111
+ reject(err);
1112
+ else
1113
+ resolve();
1114
+ });
1115
+ } else
1116
+ resolve();
1117
+ });
1118
+ }).then(function syncAndClose() {
1119
+ return new Promise2(function(resolve, reject) {
1120
+ if (options.fsync !== false) {
1121
+ fs.fsync(fd, function(err) {
1122
+ if (err)
1123
+ fs.close(fd, () => reject(err));
1124
+ else
1125
+ fs.close(fd, resolve);
1126
+ });
1127
+ } else {
1128
+ fs.close(fd, resolve);
1129
+ }
1130
+ });
1131
+ }).then(function chown() {
1132
+ fd = null;
1133
+ if (options.chown) {
1134
+ return new Promise2(function(resolve, reject) {
1135
+ fs.chown(tmpfile, options.chown.uid, options.chown.gid, function(err) {
1136
+ if (err)
1137
+ reject(err);
1138
+ else
1139
+ resolve();
1140
+ });
1141
+ });
1142
+ }
1143
+ }).then(function chmod() {
1144
+ if (options.mode) {
1145
+ return new Promise2(function(resolve, reject) {
1146
+ fs.chmod(tmpfile, options.mode, function(err) {
1147
+ if (err)
1148
+ reject(err);
1149
+ else
1150
+ resolve();
1151
+ });
1152
+ });
1153
+ }
1154
+ }).then(function rename() {
1155
+ return new Promise2(function(resolve, reject) {
1156
+ fs.rename(tmpfile, truename, function(err) {
1157
+ if (err)
1158
+ reject(err);
1159
+ else
1160
+ resolve();
1161
+ });
1162
+ });
1163
+ }).then(function success() {
1164
+ removeOnExitHandler();
1165
+ callback();
1166
+ }, function fail(err) {
1167
+ return new Promise2((resolve) => {
1168
+ return fd ? fs.close(fd, resolve) : resolve();
1169
+ }).then(() => {
1170
+ removeOnExitHandler();
1171
+ fs.unlink(tmpfile, function() {
1172
+ callback(err);
1173
+ });
1174
+ });
1175
+ }).then(function checkQueue() {
1176
+ activeFiles[absoluteName].shift();
1177
+ if (activeFiles[absoluteName].length > 0) {
1178
+ activeFiles[absoluteName][0]();
1179
+ } else
1180
+ delete activeFiles[absoluteName];
1181
+ });
1182
+ }
1183
+ function writeFileSync(filename, data, options) {
1184
+ if (typeof options === "string")
1185
+ options = { encoding: options };
1186
+ else if (!options)
1187
+ options = {};
1188
+ try {
1189
+ filename = fs.realpathSync(filename);
1190
+ } catch (ex) {
1191
+ }
1192
+ var tmpfile = getTmpname(filename);
1193
+ if (!options.mode || !options.chown) {
1194
+ try {
1195
+ var stats = fs.statSync(filename);
1196
+ options = Object.assign({}, options);
1197
+ if (!options.mode) {
1198
+ options.mode = stats.mode;
1199
+ }
1200
+ if (!options.chown && process.getuid) {
1201
+ options.chown = { uid: stats.uid, gid: stats.gid };
1202
+ }
1203
+ } catch (ex) {
1204
+ }
1205
+ }
1206
+ var fd;
1207
+ var cleanup = cleanupOnExit(tmpfile);
1208
+ var removeOnExitHandler = onExit2(cleanup);
1209
+ try {
1210
+ fd = fs.openSync(tmpfile, "w", options.mode);
1211
+ if (Buffer.isBuffer(data)) {
1212
+ fs.writeSync(fd, data, 0, data.length, 0);
1213
+ } else if (data != null) {
1214
+ fs.writeSync(fd, String(data), 0, String(options.encoding || "utf8"));
1215
+ }
1216
+ if (options.fsync !== false) {
1217
+ fs.fsyncSync(fd);
1218
+ }
1219
+ fs.closeSync(fd);
1220
+ if (options.chown)
1221
+ fs.chownSync(tmpfile, options.chown.uid, options.chown.gid);
1222
+ if (options.mode)
1223
+ fs.chmodSync(tmpfile, options.mode);
1224
+ fs.renameSync(tmpfile, filename);
1225
+ removeOnExitHandler();
1226
+ } catch (err) {
1227
+ if (fd) {
1228
+ try {
1229
+ fs.closeSync(fd);
1230
+ } catch (ex) {
1231
+ }
1232
+ }
1233
+ removeOnExitHandler();
1234
+ cleanup();
1235
+ throw err;
1236
+ }
1237
+ }
1238
+ }
1239
+ });
1240
+
1241
+ // ../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js
1242
+ var require_is_plain_obj = __commonJS({
1243
+ "../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports, module) {
1244
+ "use strict";
1245
+ var toString = Object.prototype.toString;
1246
+ module.exports = function(x) {
1247
+ var prototype;
1248
+ return toString.call(x) === "[object Object]" && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));
1249
+ };
1250
+ }
1251
+ });
1252
+
1253
+ // ../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js
1254
+ var require_sort_keys = __commonJS({
1255
+ "../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports, module) {
1256
+ "use strict";
1257
+ var isPlainObj = require_is_plain_obj();
1258
+ module.exports = function(obj, opts) {
1259
+ if (!isPlainObj(obj)) {
1260
+ throw new TypeError("Expected a plain object");
1261
+ }
1262
+ opts = opts || {};
1263
+ if (typeof opts === "function") {
1264
+ opts = { compare: opts };
1265
+ }
1266
+ var deep = opts.deep;
1267
+ var seenInput = [];
1268
+ var seenOutput = [];
1269
+ var sortKeys = function(x) {
1270
+ var seenIndex = seenInput.indexOf(x);
1271
+ if (seenIndex !== -1) {
1272
+ return seenOutput[seenIndex];
1273
+ }
1274
+ var ret = {};
1275
+ var keys = Object.keys(x).sort(opts.compare);
1276
+ seenInput.push(x);
1277
+ seenOutput.push(ret);
1278
+ for (var i = 0; i < keys.length; i++) {
1279
+ var key = keys[i];
1280
+ var val = x[key];
1281
+ ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val;
1282
+ }
1283
+ return ret;
1284
+ };
1285
+ return sortKeys(obj);
1286
+ };
1287
+ }
1288
+ });
1289
+
1290
+ // ../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js
1291
+ var require_pify2 = __commonJS({
1292
+ "../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports, module) {
1293
+ "use strict";
1294
+ var processFn = (fn, opts) => function() {
1295
+ const P = opts.promiseModule;
1296
+ const args = new Array(arguments.length);
1297
+ for (let i = 0; i < arguments.length; i++) {
1298
+ args[i] = arguments[i];
1299
+ }
1300
+ return new P((resolve, reject) => {
1301
+ if (opts.errorFirst) {
1302
+ args.push(function(err, result) {
1303
+ if (opts.multiArgs) {
1304
+ const results = new Array(arguments.length - 1);
1305
+ for (let i = 1; i < arguments.length; i++) {
1306
+ results[i - 1] = arguments[i];
1307
+ }
1308
+ if (err) {
1309
+ results.unshift(err);
1310
+ reject(results);
1311
+ } else {
1312
+ resolve(results);
1313
+ }
1314
+ } else if (err) {
1315
+ reject(err);
1316
+ } else {
1317
+ resolve(result);
1318
+ }
1319
+ });
1320
+ } else {
1321
+ args.push(function(result) {
1322
+ if (opts.multiArgs) {
1323
+ const results = new Array(arguments.length - 1);
1324
+ for (let i = 0; i < arguments.length; i++) {
1325
+ results[i] = arguments[i];
1326
+ }
1327
+ resolve(results);
1328
+ } else {
1329
+ resolve(result);
1330
+ }
1331
+ });
1332
+ }
1333
+ fn.apply(this, args);
1334
+ });
1335
+ };
1336
+ module.exports = (obj, opts) => {
1337
+ opts = Object.assign({
1338
+ exclude: [/.+(Sync|Stream)$/],
1339
+ errorFirst: true,
1340
+ promiseModule: Promise
1341
+ }, opts);
1342
+ const filter = (key) => {
1343
+ const match = (pattern) => typeof pattern === "string" ? key === pattern : pattern.test(key);
1344
+ return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
1345
+ };
1346
+ let ret;
1347
+ if (typeof obj === "function") {
1348
+ ret = function() {
1349
+ if (opts.excludeMain) {
1350
+ return obj.apply(this, arguments);
1351
+ }
1352
+ return processFn(obj, opts).apply(this, arguments);
1353
+ };
1354
+ } else {
1355
+ ret = Object.create(Object.getPrototypeOf(obj));
1356
+ }
1357
+ for (const key in obj) {
1358
+ const x = obj[key];
1359
+ ret[key] = typeof x === "function" && filter(key) ? processFn(x, opts) : x;
1360
+ }
1361
+ return ret;
1362
+ };
1363
+ }
1364
+ });
1365
+
1366
+ // ../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js
1367
+ var require_make_dir = __commonJS({
1368
+ "../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports, module) {
1369
+ "use strict";
1370
+ var fs = __require("fs");
1371
+ var path = __require("path");
1372
+ var pify = require_pify2();
1373
+ var defaults = {
1374
+ mode: 511 & ~process.umask(),
1375
+ fs
1376
+ };
1377
+ var checkPath = (pth) => {
1378
+ if (process.platform === "win32") {
1379
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
1380
+ if (pathHasInvalidWinCharacters) {
1381
+ const err = new Error(`Path contains invalid characters: ${pth}`);
1382
+ err.code = "EINVAL";
1383
+ throw err;
1384
+ }
1385
+ }
1386
+ };
1387
+ module.exports = (input, opts) => Promise.resolve().then(() => {
1388
+ checkPath(input);
1389
+ opts = Object.assign({}, defaults, opts);
1390
+ const mkdir = pify(opts.fs.mkdir);
1391
+ const stat = pify(opts.fs.stat);
1392
+ const make = (pth) => {
1393
+ return mkdir(pth, opts.mode).then(() => pth).catch((err) => {
1394
+ if (err.code === "ENOENT") {
1395
+ if (err.message.includes("null bytes") || path.dirname(pth) === pth) {
1396
+ throw err;
1397
+ }
1398
+ return make(path.dirname(pth)).then(() => make(pth));
1399
+ }
1400
+ return stat(pth).then((stats) => stats.isDirectory() ? pth : Promise.reject()).catch(() => {
1401
+ throw err;
1402
+ });
1403
+ });
1404
+ };
1405
+ return make(path.resolve(input));
1406
+ });
1407
+ module.exports.sync = (input, opts) => {
1408
+ checkPath(input);
1409
+ opts = Object.assign({}, defaults, opts);
1410
+ const make = (pth) => {
1411
+ try {
1412
+ opts.fs.mkdirSync(pth, opts.mode);
1413
+ } catch (err) {
1414
+ if (err.code === "ENOENT") {
1415
+ if (err.message.includes("null bytes") || path.dirname(pth) === pth) {
1416
+ throw err;
1417
+ }
1418
+ make(path.dirname(pth));
1419
+ return make(pth);
1420
+ }
1421
+ try {
1422
+ if (!opts.fs.statSync(pth).isDirectory()) {
1423
+ throw new Error("The path is not a directory");
1424
+ }
1425
+ } catch (_) {
1426
+ throw err;
1427
+ }
1428
+ }
1429
+ return pth;
1430
+ };
1431
+ return make(path.resolve(input));
1432
+ };
1433
+ }
1434
+ });
1435
+
1436
+ // ../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js
1437
+ var require_detect_indent = __commonJS({
1438
+ "../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports, module) {
1439
+ "use strict";
1440
+ var INDENT_RE = /^(?:( )+|\t+)/;
1441
+ function getMostUsed(indents) {
1442
+ let result = 0;
1443
+ let maxUsed = 0;
1444
+ let maxWeight = 0;
1445
+ for (const entry of indents) {
1446
+ const key = entry[0];
1447
+ const val = entry[1];
1448
+ const u = val[0];
1449
+ const w = val[1];
1450
+ if (u > maxUsed || u === maxUsed && w > maxWeight) {
1451
+ maxUsed = u;
1452
+ maxWeight = w;
1453
+ result = Number(key);
1454
+ }
1455
+ }
1456
+ return result;
1457
+ }
1458
+ module.exports = (str) => {
1459
+ if (typeof str !== "string") {
1460
+ throw new TypeError("Expected a string");
1461
+ }
1462
+ let tabs = 0;
1463
+ let spaces = 0;
1464
+ let prev = 0;
1465
+ const indents = /* @__PURE__ */ new Map();
1466
+ let current;
1467
+ let isIndent;
1468
+ for (const line of str.split(/\n/g)) {
1469
+ if (!line) {
1470
+ continue;
1471
+ }
1472
+ let indent2;
1473
+ const matches = line.match(INDENT_RE);
1474
+ if (matches) {
1475
+ indent2 = matches[0].length;
1476
+ if (matches[1]) {
1477
+ spaces++;
1478
+ } else {
1479
+ tabs++;
1480
+ }
1481
+ } else {
1482
+ indent2 = 0;
1483
+ }
1484
+ const diff = indent2 - prev;
1485
+ prev = indent2;
1486
+ if (diff) {
1487
+ isIndent = diff > 0;
1488
+ current = indents.get(isIndent ? diff : -diff);
1489
+ if (current) {
1490
+ current[0]++;
1491
+ } else {
1492
+ current = [1, 0];
1493
+ indents.set(diff, current);
1494
+ }
1495
+ } else if (current) {
1496
+ current[1] += Number(isIndent);
1497
+ }
1498
+ }
1499
+ const amount = getMostUsed(indents);
1500
+ let type;
1501
+ let indent;
1502
+ if (!amount) {
1503
+ type = null;
1504
+ indent = "";
1505
+ } else if (spaces >= tabs) {
1506
+ type = "space";
1507
+ indent = " ".repeat(amount);
1508
+ } else {
1509
+ type = "tab";
1510
+ indent = " ".repeat(amount);
1511
+ }
1512
+ return {
1513
+ amount,
1514
+ type,
1515
+ indent
1516
+ };
1517
+ };
1518
+ }
1519
+ });
1520
+
1521
+ // ../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js
1522
+ var require_write_json_file = __commonJS({
1523
+ "../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports, module) {
1524
+ "use strict";
1525
+ var path = __require("path");
1526
+ var fs = require_graceful_fs();
1527
+ var writeFileAtomic = require_write_file_atomic();
1528
+ var sortKeys = require_sort_keys();
1529
+ var makeDir = require_make_dir();
1530
+ var pify = require_pify();
1531
+ var detectIndent = require_detect_indent();
1532
+ var init = (fn, fp, data, opts) => {
1533
+ if (!fp) {
1534
+ throw new TypeError("Expected a filepath");
1535
+ }
1536
+ if (data === void 0) {
1537
+ throw new TypeError("Expected data to stringify");
1538
+ }
1539
+ opts = Object.assign({
1540
+ indent: " ",
1541
+ sortKeys: false
1542
+ }, opts);
1543
+ if (opts.sortKeys) {
1544
+ data = sortKeys(data, {
1545
+ deep: true,
1546
+ compare: typeof opts.sortKeys === "function" && opts.sortKeys
1547
+ });
1548
+ }
1549
+ return fn(fp, data, opts);
1550
+ };
1551
+ var readFile = (fp) => pify(fs.readFile)(fp, "utf8").catch(() => {
1552
+ });
1553
+ var main = (fp, data, opts) => {
1554
+ return (opts.detectIndent ? readFile(fp) : Promise.resolve()).then((str) => {
1555
+ const indent = str ? detectIndent(str).indent : opts.indent;
1556
+ const json = JSON.stringify(data, opts.replacer, indent);
1557
+ return pify(writeFileAtomic)(fp, `${json}
1558
+ `, { mode: opts.mode });
1559
+ });
1560
+ };
1561
+ var mainSync = (fp, data, opts) => {
1562
+ let indent = opts.indent;
1563
+ if (opts.detectIndent) {
1564
+ try {
1565
+ const file = fs.readFileSync(fp, "utf8");
1566
+ indent = detectIndent(file).indent;
1567
+ } catch (err) {
1568
+ if (err.code !== "ENOENT") {
1569
+ throw err;
1570
+ }
1571
+ }
1572
+ }
1573
+ const json = JSON.stringify(data, opts.replacer, indent);
1574
+ return writeFileAtomic.sync(fp, `${json}
1575
+ `, { mode: opts.mode });
1576
+ };
1577
+ module.exports = (fp, data, opts) => {
1578
+ return makeDir(path.dirname(fp), { fs }).then(() => init(main, fp, data, opts));
1579
+ };
1580
+ module.exports.sync = (fp, data, opts) => {
1581
+ makeDir.sync(path.dirname(fp), { fs });
1582
+ init(mainSync, fp, data, opts);
1583
+ };
1584
+ }
1585
+ });
1586
+
1587
+ // ../../node_modules/.pnpm/yoctocolors-cjs@2.1.3/node_modules/yoctocolors-cjs/index.js
1588
+ var require_yoctocolors_cjs = __commonJS({
1589
+ "../../node_modules/.pnpm/yoctocolors-cjs@2.1.3/node_modules/yoctocolors-cjs/index.js"(exports, module) {
1590
+ var tty = __require("tty");
1591
+ var hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;
1592
+ var format = (open2, close) => {
1593
+ if (!hasColors) {
1594
+ return (input) => input;
1595
+ }
1596
+ const openCode = `\x1B[${open2}m`;
1597
+ const closeCode = `\x1B[${close}m`;
1598
+ return (input) => {
1599
+ const string = input + "";
1600
+ let index = string.indexOf(closeCode);
1601
+ if (index === -1) {
1602
+ return openCode + string + closeCode;
1603
+ }
1604
+ let result = openCode;
1605
+ let lastIndex = 0;
1606
+ const reopenOnNestedClose = close === 22;
1607
+ const replaceCode = (reopenOnNestedClose ? closeCode : "") + openCode;
1608
+ while (index !== -1) {
1609
+ result += string.slice(lastIndex, index) + replaceCode;
1610
+ lastIndex = index + closeCode.length;
1611
+ index = string.indexOf(closeCode, lastIndex);
1612
+ }
1613
+ result += string.slice(lastIndex) + closeCode;
1614
+ return result;
1615
+ };
1616
+ };
1617
+ var colors4 = {};
1618
+ colors4.reset = format(0, 0);
1619
+ colors4.bold = format(1, 22);
1620
+ colors4.dim = format(2, 22);
1621
+ colors4.italic = format(3, 23);
1622
+ colors4.underline = format(4, 24);
1623
+ colors4.overline = format(53, 55);
1624
+ colors4.inverse = format(7, 27);
1625
+ colors4.hidden = format(8, 28);
1626
+ colors4.strikethrough = format(9, 29);
1627
+ colors4.black = format(30, 39);
1628
+ colors4.red = format(31, 39);
1629
+ colors4.green = format(32, 39);
1630
+ colors4.yellow = format(33, 39);
1631
+ colors4.blue = format(34, 39);
1632
+ colors4.magenta = format(35, 39);
1633
+ colors4.cyan = format(36, 39);
1634
+ colors4.white = format(37, 39);
1635
+ colors4.gray = format(90, 39);
1636
+ colors4.bgBlack = format(40, 49);
1637
+ colors4.bgRed = format(41, 49);
1638
+ colors4.bgGreen = format(42, 49);
1639
+ colors4.bgYellow = format(43, 49);
1640
+ colors4.bgBlue = format(44, 49);
1641
+ colors4.bgMagenta = format(45, 49);
1642
+ colors4.bgCyan = format(46, 49);
1643
+ colors4.bgWhite = format(47, 49);
1644
+ colors4.bgGray = format(100, 49);
1645
+ colors4.redBright = format(91, 39);
1646
+ colors4.greenBright = format(92, 39);
1647
+ colors4.yellowBright = format(93, 39);
1648
+ colors4.blueBright = format(94, 39);
1649
+ colors4.magentaBright = format(95, 39);
1650
+ colors4.cyanBright = format(96, 39);
1651
+ colors4.whiteBright = format(97, 39);
1652
+ colors4.bgRedBright = format(101, 49);
1653
+ colors4.bgGreenBright = format(102, 49);
1654
+ colors4.bgYellowBright = format(103, 49);
1655
+ colors4.bgBlueBright = format(104, 49);
1656
+ colors4.bgMagentaBright = format(105, 49);
1657
+ colors4.bgCyanBright = format(106, 49);
1658
+ colors4.bgWhiteBright = format(107, 49);
1659
+ module.exports = colors4;
1660
+ }
1661
+ });
1662
+
1663
+ // ../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry_operation.js
1664
+ var require_retry_operation = __commonJS({
1665
+ "../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry_operation.js"(exports, module) {
1666
+ function RetryOperation(timeouts, options) {
1667
+ if (typeof options === "boolean") {
1668
+ options = { forever: options };
1669
+ }
1670
+ this._timeouts = timeouts;
1671
+ this._options = options || {};
1672
+ this._fn = null;
1673
+ this._errors = [];
1674
+ this._attempts = 1;
1675
+ this._operationTimeout = null;
1676
+ this._operationTimeoutCb = null;
1677
+ this._timeout = null;
1678
+ if (this._options.forever) {
1679
+ this._cachedTimeouts = this._timeouts.slice(0);
1680
+ }
1681
+ }
1682
+ module.exports = RetryOperation;
1683
+ RetryOperation.prototype.stop = function() {
1684
+ if (this._timeout) {
1685
+ clearTimeout(this._timeout);
1686
+ }
1687
+ this._timeouts = [];
1688
+ this._cachedTimeouts = null;
1689
+ };
1690
+ RetryOperation.prototype.retry = function(err) {
1691
+ if (this._timeout) {
1692
+ clearTimeout(this._timeout);
1693
+ }
1694
+ if (!err) {
1695
+ return false;
1696
+ }
1697
+ this._errors.push(err);
1698
+ var timeout = this._timeouts.shift();
1699
+ if (timeout === void 0) {
1700
+ if (this._cachedTimeouts) {
1701
+ this._errors.splice(this._errors.length - 1, this._errors.length);
1702
+ this._timeouts = this._cachedTimeouts.slice(0);
1703
+ timeout = this._timeouts.shift();
1704
+ } else {
1705
+ return false;
1706
+ }
1707
+ }
1708
+ var self = this;
1709
+ var timer = setTimeout(function() {
1710
+ self._attempts++;
1711
+ if (self._operationTimeoutCb) {
1712
+ self._timeout = setTimeout(function() {
1713
+ self._operationTimeoutCb(self._attempts);
1714
+ }, self._operationTimeout);
1715
+ if (this._options.unref) {
1716
+ self._timeout.unref();
1717
+ }
1718
+ }
1719
+ self._fn(self._attempts);
1720
+ }, timeout);
1721
+ if (this._options.unref) {
1722
+ timer.unref();
1723
+ }
1724
+ return true;
1725
+ };
1726
+ RetryOperation.prototype.attempt = function(fn, timeoutOps) {
1727
+ this._fn = fn;
1728
+ if (timeoutOps) {
1729
+ if (timeoutOps.timeout) {
1730
+ this._operationTimeout = timeoutOps.timeout;
1731
+ }
1732
+ if (timeoutOps.cb) {
1733
+ this._operationTimeoutCb = timeoutOps.cb;
1734
+ }
1735
+ }
1736
+ var self = this;
1737
+ if (this._operationTimeoutCb) {
1738
+ this._timeout = setTimeout(function() {
1739
+ self._operationTimeoutCb();
1740
+ }, self._operationTimeout);
1741
+ }
1742
+ this._fn(this._attempts);
1743
+ };
1744
+ RetryOperation.prototype.try = function(fn) {
1745
+ console.log("Using RetryOperation.try() is deprecated");
1746
+ this.attempt(fn);
1747
+ };
1748
+ RetryOperation.prototype.start = function(fn) {
1749
+ console.log("Using RetryOperation.start() is deprecated");
1750
+ this.attempt(fn);
1751
+ };
1752
+ RetryOperation.prototype.start = RetryOperation.prototype.try;
1753
+ RetryOperation.prototype.errors = function() {
1754
+ return this._errors;
1755
+ };
1756
+ RetryOperation.prototype.attempts = function() {
1757
+ return this._attempts;
1758
+ };
1759
+ RetryOperation.prototype.mainError = function() {
1760
+ if (this._errors.length === 0) {
1761
+ return null;
1762
+ }
1763
+ var counts = {};
1764
+ var mainError = null;
1765
+ var mainErrorCount = 0;
1766
+ for (var i = 0; i < this._errors.length; i++) {
1767
+ var error = this._errors[i];
1768
+ var message = error.message;
1769
+ var count = (counts[message] || 0) + 1;
1770
+ counts[message] = count;
1771
+ if (count >= mainErrorCount) {
1772
+ mainError = error;
1773
+ mainErrorCount = count;
1774
+ }
1775
+ }
1776
+ return mainError;
1777
+ };
1778
+ }
1779
+ });
1780
+
1781
+ // ../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry.js
1782
+ var require_retry = __commonJS({
1783
+ "../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry.js"(exports) {
1784
+ var RetryOperation = require_retry_operation();
1785
+ exports.operation = function(options) {
1786
+ var timeouts = exports.timeouts(options);
1787
+ return new RetryOperation(timeouts, {
1788
+ forever: options && options.forever,
1789
+ unref: options && options.unref
1790
+ });
1791
+ };
1792
+ exports.timeouts = function(options) {
1793
+ if (options instanceof Array) {
1794
+ return [].concat(options);
1795
+ }
1796
+ var opts = {
1797
+ retries: 10,
1798
+ factor: 2,
1799
+ minTimeout: 1 * 1e3,
1800
+ maxTimeout: Infinity,
1801
+ randomize: false
1802
+ };
1803
+ for (var key in options) {
1804
+ opts[key] = options[key];
1805
+ }
1806
+ if (opts.minTimeout > opts.maxTimeout) {
1807
+ throw new Error("minTimeout is greater than maxTimeout");
1808
+ }
1809
+ var timeouts = [];
1810
+ for (var i = 0; i < opts.retries; i++) {
1811
+ timeouts.push(this.createTimeout(i, opts));
1812
+ }
1813
+ if (options && options.forever && !timeouts.length) {
1814
+ timeouts.push(this.createTimeout(i, opts));
1815
+ }
1816
+ timeouts.sort(function(a, b) {
1817
+ return a - b;
1818
+ });
1819
+ return timeouts;
1820
+ };
1821
+ exports.createTimeout = function(attempt, opts) {
1822
+ var random = opts.randomize ? Math.random() + 1 : 1;
1823
+ var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));
1824
+ timeout = Math.min(timeout, opts.maxTimeout);
1825
+ return timeout;
1826
+ };
1827
+ exports.wrap = function(obj, options, methods) {
1828
+ if (options instanceof Array) {
1829
+ methods = options;
1830
+ options = null;
1831
+ }
1832
+ if (!methods) {
1833
+ methods = [];
1834
+ for (var key in obj) {
1835
+ if (typeof obj[key] === "function") {
1836
+ methods.push(key);
1837
+ }
1838
+ }
1839
+ }
1840
+ for (var i = 0; i < methods.length; i++) {
1841
+ var method = methods[i];
1842
+ var original = obj[method];
1843
+ obj[method] = function retryWrapper() {
1844
+ var op = exports.operation(options);
1845
+ var args = Array.prototype.slice.call(arguments);
1846
+ var callback = args.pop();
1847
+ args.push(function(err) {
1848
+ if (op.retry(err)) {
1849
+ return;
1850
+ }
1851
+ if (err) {
1852
+ arguments[0] = op.mainError();
1853
+ }
1854
+ callback.apply(this, arguments);
1855
+ });
1856
+ op.attempt(function() {
1857
+ original.apply(obj, args);
1858
+ });
1859
+ };
1860
+ obj[method].options = options;
1861
+ }
1862
+ };
1863
+ }
1864
+ });
1865
+
1866
+ // ../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/index.js
1867
+ var require_retry2 = __commonJS({
1868
+ "../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/index.js"(exports, module) {
1869
+ module.exports = require_retry();
1870
+ }
1871
+ });
1872
+
1873
+ // ../../node_modules/.pnpm/async-retry@1.1.3/node_modules/async-retry/dist/index.js
1874
+ var require_dist3 = __commonJS({
1875
+ "../../node_modules/.pnpm/async-retry@1.1.3/node_modules/async-retry/dist/index.js"(exports, module) {
1876
+ "use strict";
1877
+ var retrier = require_retry2();
1878
+ module.exports = function(fn, opts) {
1879
+ opts = opts || {};
1880
+ return new Promise(function(resolve, reject) {
1881
+ var op = retrier.operation(opts);
1882
+ var bail = function bail2(err) {
1883
+ return reject(err || new Error("Aborted"));
1884
+ };
1885
+ var onError = function onError2(err) {
1886
+ if (err.bail) {
1887
+ return bail(err);
1888
+ }
1889
+ if (!op.retry(err)) {
1890
+ reject(op.mainError());
1891
+ } else if (opts.onRetry) {
1892
+ opts.onRetry(err);
1893
+ }
1894
+ };
1895
+ op.attempt(function(num) {
1896
+ var val = void 0;
1897
+ try {
1898
+ val = fn(bail, num);
1899
+ } catch (err) {
1900
+ return onError(err);
1901
+ }
1902
+ Promise.resolve(val).then(resolve, onError);
1903
+ });
1904
+ });
1905
+ };
1906
+ }
1907
+ });
1908
+
1909
+ // ../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js
1910
+ var require_is_docker = __commonJS({
1911
+ "../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js"(exports, module) {
1912
+ "use strict";
1913
+ var fs = __require("fs");
1914
+ var isDocker;
1915
+ function hasDockerEnv() {
1916
+ try {
1917
+ fs.statSync("/.dockerenv");
1918
+ return true;
1919
+ } catch (_) {
1920
+ return false;
1921
+ }
1922
+ }
1923
+ function hasDockerCGroup() {
1924
+ try {
1925
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
1926
+ } catch (_) {
1927
+ return false;
1928
+ }
1929
+ }
1930
+ module.exports = () => {
1931
+ if (isDocker === void 0) {
1932
+ isDocker = hasDockerEnv() || hasDockerCGroup();
1933
+ }
1934
+ return isDocker;
1935
+ };
1936
+ }
1937
+ });
1938
+
1939
+ // ../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js
1940
+ var require_is_wsl = __commonJS({
1941
+ "../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports, module) {
1942
+ "use strict";
1943
+ var os2 = __require("os");
1944
+ var fs = __require("fs");
1945
+ var isDocker = require_is_docker();
1946
+ var isWsl = () => {
1947
+ if (process.platform !== "linux") {
1948
+ return false;
1949
+ }
1950
+ if (os2.release().toLowerCase().includes("microsoft")) {
1951
+ if (isDocker()) {
1952
+ return false;
1953
+ }
1954
+ return true;
1955
+ }
1956
+ try {
1957
+ return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
1958
+ } catch (_) {
1959
+ return false;
1960
+ }
1961
+ };
1962
+ if (process.env.__IS_WSL_TEST__) {
1963
+ module.exports = isWsl;
1964
+ } else {
1965
+ module.exports = isWsl();
1966
+ }
1967
+ }
1968
+ });
1969
+
1970
+ // ../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js
1971
+ var require_define_lazy_prop = __commonJS({
1972
+ "../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js"(exports, module) {
1973
+ "use strict";
1974
+ module.exports = (object, propertyName, fn) => {
1975
+ const define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
1976
+ Object.defineProperty(object, propertyName, {
1977
+ configurable: true,
1978
+ enumerable: true,
1979
+ get() {
1980
+ const result = fn();
1981
+ define(result);
1982
+ return result;
1983
+ },
1984
+ set(value) {
1985
+ define(value);
1986
+ }
1987
+ });
1988
+ return object;
1989
+ };
1990
+ }
1991
+ });
1992
+
1993
+ // ../../node_modules/.pnpm/open@8.4.0/node_modules/open/index.js
1994
+ var require_open = __commonJS({
1995
+ "../../node_modules/.pnpm/open@8.4.0/node_modules/open/index.js"(exports, module) {
1996
+ var path = __require("path");
1997
+ var childProcess = __require("child_process");
1998
+ var { promises: fs, constants: fsConstants } = __require("fs");
1999
+ var isWsl = require_is_wsl();
2000
+ var isDocker = require_is_docker();
2001
+ var defineLazyProperty = require_define_lazy_prop();
2002
+ var localXdgOpenPath = path.join(__dirname, "xdg-open");
2003
+ var { platform, arch } = process;
2004
+ var getWslDrivesMountPoint = (() => {
2005
+ const defaultMountPoint = "/mnt/";
2006
+ let mountPoint;
2007
+ return async function() {
2008
+ if (mountPoint) {
2009
+ return mountPoint;
2010
+ }
2011
+ const configFilePath = "/etc/wsl.conf";
2012
+ let isConfigFileExists = false;
2013
+ try {
2014
+ await fs.access(configFilePath, fsConstants.F_OK);
2015
+ isConfigFileExists = true;
2016
+ } catch {
2017
+ }
2018
+ if (!isConfigFileExists) {
2019
+ return defaultMountPoint;
2020
+ }
2021
+ const configContent = await fs.readFile(configFilePath, { encoding: "utf8" });
2022
+ const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
2023
+ if (!configMountPoint) {
2024
+ return defaultMountPoint;
2025
+ }
2026
+ mountPoint = configMountPoint.groups.mountPoint.trim();
2027
+ mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
2028
+ return mountPoint;
2029
+ };
2030
+ })();
2031
+ var pTryEach = async (array, mapper) => {
2032
+ let latestError;
2033
+ for (const item of array) {
2034
+ try {
2035
+ return await mapper(item);
2036
+ } catch (error) {
2037
+ latestError = error;
2038
+ }
2039
+ }
2040
+ throw latestError;
2041
+ };
2042
+ var baseOpen = async (options) => {
2043
+ options = {
2044
+ wait: false,
2045
+ background: false,
2046
+ newInstance: false,
2047
+ allowNonzeroExitCode: false,
2048
+ ...options
2049
+ };
2050
+ if (Array.isArray(options.app)) {
2051
+ return pTryEach(options.app, (singleApp) => baseOpen({
2052
+ ...options,
2053
+ app: singleApp
2054
+ }));
2055
+ }
2056
+ let { name: app, arguments: appArguments = [] } = options.app || {};
2057
+ appArguments = [...appArguments];
2058
+ if (Array.isArray(app)) {
2059
+ return pTryEach(app, (appName) => baseOpen({
2060
+ ...options,
2061
+ app: {
2062
+ name: appName,
2063
+ arguments: appArguments
2064
+ }
2065
+ }));
2066
+ }
2067
+ let command;
2068
+ const cliArguments = [];
2069
+ const childProcessOptions = {};
2070
+ if (platform === "darwin") {
2071
+ command = "open";
2072
+ if (options.wait) {
2073
+ cliArguments.push("--wait-apps");
2074
+ }
2075
+ if (options.background) {
2076
+ cliArguments.push("--background");
2077
+ }
2078
+ if (options.newInstance) {
2079
+ cliArguments.push("--new");
2080
+ }
2081
+ if (app) {
2082
+ cliArguments.push("-a", app);
2083
+ }
2084
+ } else if (platform === "win32" || isWsl && !isDocker()) {
2085
+ const mountPoint = await getWslDrivesMountPoint();
2086
+ command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
2087
+ cliArguments.push(
2088
+ "-NoProfile",
2089
+ "-NonInteractive",
2090
+ "\u2013ExecutionPolicy",
2091
+ "Bypass",
2092
+ "-EncodedCommand"
2093
+ );
2094
+ if (!isWsl) {
2095
+ childProcessOptions.windowsVerbatimArguments = true;
2096
+ }
2097
+ const encodedArguments = ["Start"];
2098
+ if (options.wait) {
2099
+ encodedArguments.push("-Wait");
2100
+ }
2101
+ if (app) {
2102
+ encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList");
2103
+ if (options.target) {
2104
+ appArguments.unshift(options.target);
2105
+ }
2106
+ } else if (options.target) {
2107
+ encodedArguments.push(`"${options.target}"`);
2108
+ }
2109
+ if (appArguments.length > 0) {
2110
+ appArguments = appArguments.map((arg) => `"\`"${arg}\`""`);
2111
+ encodedArguments.push(appArguments.join(","));
2112
+ }
2113
+ options.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
2114
+ } else {
2115
+ if (app) {
2116
+ command = app;
2117
+ } else {
2118
+ const isBundled = !__dirname || __dirname === "/";
2119
+ let exeLocalXdgOpen = false;
2120
+ try {
2121
+ await fs.access(localXdgOpenPath, fsConstants.X_OK);
2122
+ exeLocalXdgOpen = true;
2123
+ } catch {
2124
+ }
2125
+ const useSystemXdgOpen = process.versions.electron || platform === "android" || isBundled || !exeLocalXdgOpen;
2126
+ command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
2127
+ }
2128
+ if (appArguments.length > 0) {
2129
+ cliArguments.push(...appArguments);
2130
+ }
2131
+ if (!options.wait) {
2132
+ childProcessOptions.stdio = "ignore";
2133
+ childProcessOptions.detached = true;
2134
+ }
2135
+ }
2136
+ if (options.target) {
2137
+ cliArguments.push(options.target);
2138
+ }
2139
+ if (platform === "darwin" && appArguments.length > 0) {
2140
+ cliArguments.push("--args", ...appArguments);
2141
+ }
2142
+ const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
2143
+ if (options.wait) {
2144
+ return new Promise((resolve, reject) => {
2145
+ subprocess.once("error", reject);
2146
+ subprocess.once("close", (exitCode) => {
2147
+ if (options.allowNonzeroExitCode && exitCode > 0) {
2148
+ reject(new Error(`Exited with code ${exitCode}`));
2149
+ return;
2150
+ }
2151
+ resolve(subprocess);
2152
+ });
2153
+ });
2154
+ }
2155
+ subprocess.unref();
2156
+ return subprocess;
2157
+ };
2158
+ var open2 = (target, options) => {
2159
+ if (typeof target !== "string") {
2160
+ throw new TypeError("Expected a `target`");
2161
+ }
2162
+ return baseOpen({
2163
+ ...options,
2164
+ target
2165
+ });
2166
+ };
2167
+ var openApp = (name, options) => {
2168
+ if (typeof name !== "string") {
2169
+ throw new TypeError("Expected a `name`");
2170
+ }
2171
+ const { arguments: appArguments = [] } = options || {};
2172
+ if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
2173
+ throw new TypeError("Expected `appArguments` as Array type");
2174
+ }
2175
+ return baseOpen({
2176
+ ...options,
2177
+ app: {
2178
+ name,
2179
+ arguments: appArguments
2180
+ }
2181
+ });
2182
+ };
2183
+ function detectArchBinary(binary) {
2184
+ if (typeof binary === "string" || Array.isArray(binary)) {
2185
+ return binary;
2186
+ }
2187
+ const { [arch]: archBinary } = binary;
2188
+ if (!archBinary) {
2189
+ throw new Error(`${arch} is not supported`);
2190
+ }
2191
+ return archBinary;
2192
+ }
2193
+ function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
2194
+ if (wsl && isWsl) {
2195
+ return detectArchBinary(wsl);
2196
+ }
2197
+ if (!platformBinary) {
2198
+ throw new Error(`${platform} is not supported`);
2199
+ }
2200
+ return detectArchBinary(platformBinary);
2201
+ }
2202
+ var apps = {};
2203
+ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
2204
+ darwin: "google chrome",
2205
+ win32: "chrome",
2206
+ linux: ["google-chrome", "google-chrome-stable", "chromium"]
2207
+ }, {
2208
+ wsl: {
2209
+ ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
2210
+ x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
2211
+ }
2212
+ }));
2213
+ defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
2214
+ darwin: "firefox",
2215
+ win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
2216
+ linux: "firefox"
2217
+ }, {
2218
+ wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
2219
+ }));
2220
+ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
2221
+ darwin: "microsoft edge",
2222
+ win32: "msedge",
2223
+ linux: ["microsoft-edge", "microsoft-edge-dev"]
2224
+ }, {
2225
+ wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
2226
+ }));
2227
+ open2.apps = apps;
2228
+ open2.openApp = openApp;
2229
+ module.exports = open2;
2230
+ }
2231
+ });
2232
+
2233
+ // src/util/config/files.ts
2234
+ var import_load_json_file = __toESM(require_load_json_file(), 1);
2235
+ var import_write_json_file = __toESM(require_write_json_file(), 1);
2236
+ var import_client = __toESM(require_dist2(), 1);
2237
+ import { join, basename, dirname } from "path";
2238
+ import { accessSync, constants } from "fs";
2239
+ var import_error_utils = __toESM(require_dist(), 1);
2240
+ var VERCEL_DIR2 = global_path_default();
2241
+ var CONFIG_FILE_PATH = join(VERCEL_DIR2, "config.json");
2242
+ var AUTH_CONFIG_FILE_PATH = join(VERCEL_DIR2, "auth.json");
2243
+ var readConfigFile = () => {
2244
+ const config = import_load_json_file.default.sync(CONFIG_FILE_PATH);
2245
+ return config;
2246
+ };
2247
+ var writeToConfigFile = (stuff) => {
2248
+ try {
2249
+ import_write_json_file.default.sync(CONFIG_FILE_PATH, stuff, { indent: 2 });
2250
+ } catch (err) {
2251
+ if ((0, import_error_utils.isErrnoException)(err)) {
2252
+ if ((0, import_error_utils.isErrnoException)(err) && err.code === "EPERM") {
2253
+ output_manager_default.error(
2254
+ `Not able to create ${highlight(
2255
+ CONFIG_FILE_PATH
2256
+ )} (operation not permitted).`
2257
+ );
2258
+ process.exit(1);
2259
+ } else if (err.code === "EBADF") {
2260
+ output_manager_default.error(
2261
+ `Not able to create ${highlight(
2262
+ CONFIG_FILE_PATH
2263
+ )} (bad file descriptor).`
2264
+ );
2265
+ process.exit(1);
2266
+ }
2267
+ }
2268
+ throw err;
2269
+ }
2270
+ };
2271
+ var readAuthConfigFile = () => {
2272
+ const config = import_load_json_file.default.sync(AUTH_CONFIG_FILE_PATH);
2273
+ return config;
2274
+ };
2275
+ var writeToAuthConfigFile = (authConfig) => {
2276
+ if (authConfig.skipWrite) {
2277
+ return;
2278
+ }
2279
+ try {
2280
+ return import_write_json_file.default.sync(AUTH_CONFIG_FILE_PATH, authConfig, {
2281
+ indent: 2,
2282
+ mode: 384
2283
+ });
2284
+ } catch (err) {
2285
+ if ((0, import_error_utils.isErrnoException)(err)) {
2286
+ if (err.code === "EPERM") {
2287
+ output_manager_default.error(
2288
+ `Not able to create ${highlight(
2289
+ AUTH_CONFIG_FILE_PATH
2290
+ )} (operation not permitted).`
2291
+ );
2292
+ process.exit(1);
2293
+ } else if (err.code === "EBADF") {
2294
+ output_manager_default.error(
2295
+ `Not able to create ${highlight(
2296
+ AUTH_CONFIG_FILE_PATH
2297
+ )} (bad file descriptor).`
2298
+ );
2299
+ process.exit(1);
2300
+ }
2301
+ }
2302
+ throw err;
2303
+ }
2304
+ };
2305
+ function getConfigFilePath() {
2306
+ return CONFIG_FILE_PATH;
2307
+ }
2308
+ function getAuthConfigFilePath() {
2309
+ return AUTH_CONFIG_FILE_PATH;
2310
+ }
2311
+ function readLocalConfig(prefix = process.cwd()) {
2312
+ let config = void 0;
2313
+ let target = "";
2314
+ try {
2315
+ target = getLocalPathConfig(prefix);
2316
+ } catch (err) {
2317
+ if (err instanceof NowError) {
2318
+ output_manager_default.error(err.message);
2319
+ process.exit(1);
2320
+ } else {
2321
+ throw err;
2322
+ }
2323
+ }
2324
+ if (!target) {
2325
+ return;
2326
+ }
2327
+ try {
2328
+ accessSync(target, constants.F_OK);
2329
+ config = import_load_json_file.default.sync(target);
2330
+ } catch (err) {
2331
+ if ((0, import_error_utils.isErrnoException)(err) && err.code === "ENOENT") {
2332
+ } else if ((0, import_error_utils.isError)(err) && err.name === "JSONError") {
2333
+ output_manager_default.error(err.message);
2334
+ process.exit(1);
2335
+ } else if ((0, import_error_utils.isErrnoException)(err)) {
2336
+ const code = err.code ? ` (${err.code})` : "";
2337
+ output_manager_default.error(`Failed to read config file: ${target}${code}`);
2338
+ process.exit(1);
2339
+ } else {
2340
+ output_manager_default.prettyError(err);
2341
+ process.exit(1);
2342
+ }
2343
+ }
2344
+ if (!config) {
2345
+ return;
2346
+ }
2347
+ const isCompiledConfig = basename(target) === "vercel.json" && basename(dirname(target)) === VERCEL_DIR;
2348
+ if (isCompiledConfig) {
2349
+ const workPath = dirname(dirname(target));
2350
+ let sourceFile = null;
2351
+ for (const ext of VERCEL_CONFIG_EXTENSIONS) {
2352
+ const configPath = join(workPath, `vercel.${ext}`);
2353
+ try {
2354
+ accessSync(configPath, constants.F_OK);
2355
+ sourceFile = basename(configPath);
2356
+ break;
2357
+ } catch {
2358
+ }
2359
+ }
2360
+ config[import_client.fileNameSymbol] = sourceFile || DEFAULT_VERCEL_CONFIG_FILENAME;
2361
+ } else {
2362
+ config[import_client.fileNameSymbol] = basename(target);
2363
+ }
2364
+ return config;
2365
+ }
2366
+
2367
+ // src/util/client.ts
2368
+ var import_chalk5 = __toESM(require_source(), 1);
2369
+
2370
+ // ../../node_modules/.pnpm/@inquirer+confirm@3.1.2/node_modules/@inquirer/confirm/dist/esm/index.mjs
2371
+ var esm_default4 = createPrompt((config, done) => {
2372
+ const { transformer = (answer) => answer ? "yes" : "no" } = config;
2373
+ const [status, setStatus] = useState("pending");
2374
+ const [value, setValue] = useState("");
2375
+ const theme = makeTheme(config.theme);
2376
+ const prefix = usePrefix({ theme });
2377
+ useKeypress((key, rl) => {
2378
+ if (isEnterKey(key)) {
2379
+ let answer = config.default !== false;
2380
+ if (/^(y|yes)/i.test(value))
2381
+ answer = true;
2382
+ else if (/^(n|no)/i.test(value))
2383
+ answer = false;
2384
+ setValue(transformer(answer));
2385
+ setStatus("done");
2386
+ done(answer);
2387
+ } else {
2388
+ setValue(rl.line);
2389
+ }
2390
+ });
2391
+ let formattedValue = value;
2392
+ let defaultValue = "";
2393
+ if (status === "done") {
2394
+ formattedValue = theme.style.answer(value);
2395
+ } else {
2396
+ defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
2397
+ }
2398
+ const message = theme.style.message(config.message);
2399
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
2400
+ });
2401
+
2402
+ // ../../node_modules/.pnpm/@inquirer+expand@2.1.2/node_modules/@inquirer/expand/dist/esm/index.mjs
2403
+ var import_chalk = __toESM(require_source2(), 1);
2404
+ var helpChoice = {
2405
+ key: "h",
2406
+ name: "Help, list all options",
2407
+ value: void 0
2408
+ };
2409
+ function getChoiceKey(choice, key) {
2410
+ if (key === "name") {
2411
+ if ("name" in choice)
2412
+ return choice.name;
2413
+ return choice.value;
2414
+ }
2415
+ if ("value" in choice)
2416
+ return choice.value;
2417
+ return choice.name;
2418
+ }
2419
+ var esm_default5 = createPrompt((config, done) => {
2420
+ const { choices, default: defaultKey = "h", expanded: defaultExpandState = false } = config;
2421
+ const [status, setStatus] = useState("pending");
2422
+ const [value, setValue] = useState("");
2423
+ const [expanded, setExpanded] = useState(defaultExpandState);
2424
+ const [errorMsg, setError] = useState(void 0);
2425
+ const theme = makeTheme(config.theme);
2426
+ const prefix = usePrefix({ theme });
2427
+ useKeypress((event, rl) => {
2428
+ if (isEnterKey(event)) {
2429
+ const answer = (value || defaultKey).toLowerCase();
2430
+ if (answer === "h" && !expanded) {
2431
+ setExpanded(true);
2432
+ } else {
2433
+ const selectedChoice = choices.find(({ key }) => key === answer);
2434
+ if (selectedChoice) {
2435
+ const finalValue = getChoiceKey(selectedChoice, "value");
2436
+ setValue(finalValue);
2437
+ setStatus("done");
2438
+ done(finalValue);
2439
+ } else if (value === "") {
2440
+ setError("Please input a value");
2441
+ } else {
2442
+ setError(`"${import_chalk.default.red(value)}" isn't an available option`);
2443
+ }
2444
+ }
2445
+ } else {
2446
+ setValue(rl.line);
2447
+ setError(void 0);
2448
+ }
2449
+ });
2450
+ const message = theme.style.message(config.message);
2451
+ if (status === "done") {
2452
+ return `${prefix} ${message} ${theme.style.answer(value)}`;
2453
+ }
2454
+ const allChoices = expanded ? choices : [...choices, helpChoice];
2455
+ let longChoices = "";
2456
+ let shortChoices = allChoices.map((choice) => {
2457
+ if (choice.key === defaultKey) {
2458
+ return choice.key.toUpperCase();
2459
+ }
2460
+ return choice.key;
2461
+ }).join("");
2462
+ shortChoices = ` ${theme.style.defaultAnswer(shortChoices)}`;
2463
+ if (expanded) {
2464
+ shortChoices = "";
2465
+ longChoices = allChoices.map((choice) => {
2466
+ const line = ` ${choice.key}) ${getChoiceKey(choice, "name")}`;
2467
+ if (choice.key === value.toLowerCase()) {
2468
+ return theme.style.highlight(line);
2469
+ }
2470
+ return line;
2471
+ }).join("\n");
2472
+ }
2473
+ let helpTip = "";
2474
+ const currentOption = allChoices.find(({ key }) => key === value.toLowerCase());
2475
+ if (currentOption) {
2476
+ helpTip = `${import_chalk.default.cyan(">>")} ${getChoiceKey(currentOption, "name")}`;
2477
+ }
2478
+ let error = "";
2479
+ if (errorMsg) {
2480
+ error = theme.style.error(errorMsg);
2481
+ }
2482
+ return [
2483
+ `${prefix} ${message}${shortChoices} ${value}`,
2484
+ [longChoices, helpTip, error].filter(Boolean).join("\n")
2485
+ ];
2486
+ });
2487
+
2488
+ // ../../node_modules/.pnpm/@inquirer+input@2.1.2/node_modules/@inquirer/input/dist/esm/index.mjs
2489
+ var esm_default6 = createPrompt((config, done) => {
2490
+ const { validate = () => true } = config;
2491
+ const theme = makeTheme(config.theme);
2492
+ const [status, setStatus] = useState("pending");
2493
+ const [defaultValue = "", setDefaultValue] = useState(config.default);
2494
+ const [errorMsg, setError] = useState(void 0);
2495
+ const [value, setValue] = useState("");
2496
+ const isLoading = status === "loading";
2497
+ const prefix = usePrefix({ isLoading, theme });
2498
+ useKeypress(async (key, rl) => {
2499
+ if (status !== "pending") {
2500
+ return;
2501
+ }
2502
+ if (isEnterKey(key)) {
2503
+ const answer = value || defaultValue;
2504
+ setStatus("loading");
2505
+ const isValid = await validate(answer);
2506
+ if (isValid === true) {
2507
+ setValue(answer);
2508
+ setStatus("done");
2509
+ done(answer);
2510
+ } else {
2511
+ rl.write(value);
2512
+ setError(isValid || "You must provide a valid value");
2513
+ setStatus("pending");
2514
+ }
2515
+ } else if (isBackspaceKey(key) && !value) {
2516
+ setDefaultValue(void 0);
2517
+ } else if (key.name === "tab" && !value) {
2518
+ setDefaultValue(void 0);
2519
+ rl.clearLine(0);
2520
+ rl.write(defaultValue);
2521
+ setValue(defaultValue);
2522
+ } else {
2523
+ setValue(rl.line);
2524
+ setError(void 0);
2525
+ }
2526
+ });
2527
+ const message = theme.style.message(config.message);
2528
+ let formattedValue = value;
2529
+ if (typeof config.transformer === "function") {
2530
+ formattedValue = config.transformer(value, { isFinal: status === "done" });
2531
+ } else if (status === "done") {
2532
+ formattedValue = theme.style.answer(value);
2533
+ }
2534
+ let defaultStr;
2535
+ if (defaultValue && status !== "done" && !value) {
2536
+ defaultStr = theme.style.defaultAnswer(defaultValue);
2537
+ }
2538
+ let error = "";
2539
+ if (errorMsg) {
2540
+ error = theme.style.error(errorMsg);
2541
+ }
2542
+ return [
2543
+ [prefix, message, defaultStr, formattedValue].filter((v) => v !== void 0).join(" "),
2544
+ error
2545
+ ];
2546
+ });
2547
+
2548
+ // ../../node_modules/.pnpm/@inquirer+password@2.1.2/node_modules/@inquirer/password/dist/esm/index.mjs
2549
+ var import_ansi_escapes = __toESM(require_ansi_escapes(), 1);
2550
+ var esm_default7 = createPrompt((config, done) => {
2551
+ const { validate = () => true } = config;
2552
+ const theme = makeTheme(config.theme);
2553
+ const [status, setStatus] = useState("pending");
2554
+ const [errorMsg, setError] = useState(void 0);
2555
+ const [value, setValue] = useState("");
2556
+ const isLoading = status === "loading";
2557
+ const prefix = usePrefix({ isLoading, theme });
2558
+ useKeypress(async (key, rl) => {
2559
+ if (status !== "pending") {
2560
+ return;
2561
+ }
2562
+ if (isEnterKey(key)) {
2563
+ const answer = value;
2564
+ setStatus("loading");
2565
+ const isValid = await validate(answer);
2566
+ if (isValid === true) {
2567
+ setValue(answer);
2568
+ setStatus("done");
2569
+ done(answer);
2570
+ } else {
2571
+ rl.write(value);
2572
+ setError(isValid || "You must provide a valid value");
2573
+ setStatus("pending");
2574
+ }
2575
+ } else {
2576
+ setValue(rl.line);
2577
+ setError(void 0);
2578
+ }
2579
+ });
2580
+ const message = theme.style.message(config.message);
2581
+ let formattedValue = "";
2582
+ let helpTip;
2583
+ if (config.mask) {
2584
+ const maskChar = typeof config.mask === "string" ? config.mask : "*";
2585
+ formattedValue = maskChar.repeat(value.length);
2586
+ } else if (status !== "done") {
2587
+ helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes.default.cursorHide}`;
2588
+ }
2589
+ if (status === "done") {
2590
+ formattedValue = theme.style.answer(formattedValue);
2591
+ }
2592
+ let error = "";
2593
+ if (errorMsg) {
2594
+ error = theme.style.error(errorMsg);
2595
+ }
2596
+ return [[prefix, message, formattedValue, helpTip].filter(Boolean).join(" "), error];
2597
+ });
2598
+
2599
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/key.mjs
2600
+ var isEnterKey2 = (key) => key.name === "enter" || key.name === "return";
2601
+
2602
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/errors.mjs
2603
+ var AbortPromptError = class extends Error {
2604
+ constructor(options) {
2605
+ super();
2606
+ __publicField(this, "name", "AbortPromptError");
2607
+ __publicField(this, "message", "Prompt was aborted");
2608
+ this.cause = options?.cause;
2609
+ }
2610
+ };
2611
+ var CancelPromptError = class extends Error {
2612
+ constructor() {
2613
+ super(...arguments);
2614
+ __publicField(this, "name", "CancelPromptError");
2615
+ __publicField(this, "message", "Prompt was canceled");
2616
+ }
2617
+ };
2618
+ var ExitPromptError = class extends Error {
2619
+ constructor() {
2620
+ super(...arguments);
2621
+ __publicField(this, "name", "ExitPromptError");
2622
+ }
2623
+ };
2624
+ var HookError = class extends Error {
2625
+ constructor() {
2626
+ super(...arguments);
2627
+ __publicField(this, "name", "HookError");
2628
+ }
2629
+ };
2630
+ var ValidationError = class extends Error {
2631
+ constructor() {
2632
+ super(...arguments);
2633
+ __publicField(this, "name", "ValidationError");
2634
+ }
2635
+ };
2636
+
2637
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/use-prefix.mjs
2638
+ import { AsyncResource as AsyncResource2 } from "async_hooks";
2639
+
2640
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs
2641
+ import { AsyncLocalStorage, AsyncResource } from "async_hooks";
2642
+ var hookStorage = new AsyncLocalStorage();
2643
+ function createStore(rl) {
2644
+ const store = {
2645
+ rl,
2646
+ hooks: [],
2647
+ hooksCleanup: [],
2648
+ hooksEffect: [],
2649
+ index: 0,
2650
+ handleChange() {
2651
+ }
2652
+ };
2653
+ return store;
2654
+ }
2655
+ function withHooks(rl, cb) {
2656
+ const store = createStore(rl);
2657
+ return hookStorage.run(store, () => {
2658
+ function cycle(render) {
2659
+ store.handleChange = () => {
2660
+ store.index = 0;
2661
+ render();
2662
+ };
2663
+ store.handleChange();
2664
+ }
2665
+ return cb(cycle);
2666
+ });
2667
+ }
2668
+ function getStore() {
2669
+ const store = hookStorage.getStore();
2670
+ if (!store) {
2671
+ throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
2672
+ }
2673
+ return store;
2674
+ }
2675
+ function readline() {
2676
+ return getStore().rl;
2677
+ }
2678
+ function withUpdates(fn) {
2679
+ const wrapped = (...args) => {
2680
+ const store = getStore();
2681
+ let shouldUpdate = false;
2682
+ const oldHandleChange = store.handleChange;
2683
+ store.handleChange = () => {
2684
+ shouldUpdate = true;
2685
+ };
2686
+ const returnValue = fn(...args);
2687
+ if (shouldUpdate) {
2688
+ oldHandleChange();
2689
+ }
2690
+ store.handleChange = oldHandleChange;
2691
+ return returnValue;
2692
+ };
2693
+ return AsyncResource.bind(wrapped);
2694
+ }
2695
+ function withPointer(cb) {
2696
+ const store = getStore();
2697
+ const { index } = store;
2698
+ const pointer = {
2699
+ get() {
2700
+ return store.hooks[index];
2701
+ },
2702
+ set(value) {
2703
+ store.hooks[index] = value;
2704
+ },
2705
+ initialized: index in store.hooks
2706
+ };
2707
+ const returnValue = cb(pointer);
2708
+ store.index++;
2709
+ return returnValue;
2710
+ }
2711
+ function handleChange() {
2712
+ getStore().handleChange();
2713
+ }
2714
+ var effectScheduler = {
2715
+ queue(cb) {
2716
+ const store = getStore();
2717
+ const { index } = store;
2718
+ store.hooksEffect.push(() => {
2719
+ store.hooksCleanup[index]?.();
2720
+ const cleanFn = cb(readline());
2721
+ if (cleanFn != null && typeof cleanFn !== "function") {
2722
+ throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
2723
+ }
2724
+ store.hooksCleanup[index] = cleanFn;
2725
+ });
2726
+ },
2727
+ run() {
2728
+ const store = getStore();
2729
+ withUpdates(() => {
2730
+ store.hooksEffect.forEach((effect) => {
2731
+ effect();
2732
+ });
2733
+ store.hooksEffect.length = 0;
2734
+ })();
2735
+ },
2736
+ clearAll() {
2737
+ const store = getStore();
2738
+ store.hooksCleanup.forEach((cleanFn) => {
2739
+ cleanFn?.();
2740
+ });
2741
+ store.hooksEffect.length = 0;
2742
+ store.hooksCleanup.length = 0;
2743
+ }
2744
+ };
2745
+
2746
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/use-state.mjs
2747
+ function useState2(defaultValue) {
2748
+ return withPointer((pointer) => {
2749
+ const setFn = (newValue) => {
2750
+ if (pointer.get() !== newValue) {
2751
+ pointer.set(newValue);
2752
+ handleChange();
2753
+ }
2754
+ };
2755
+ if (pointer.initialized) {
2756
+ return [pointer.get(), setFn];
2757
+ }
2758
+ const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
2759
+ pointer.set(value);
2760
+ return [value, setFn];
2761
+ });
2762
+ }
2763
+
2764
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/use-effect.mjs
2765
+ function useEffect(cb, depArray) {
2766
+ withPointer((pointer) => {
2767
+ const oldDeps = pointer.get();
2768
+ const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
2769
+ if (hasChanged) {
2770
+ effectScheduler.queue(cb);
2771
+ }
2772
+ pointer.set(depArray);
2773
+ });
2774
+ }
2775
+
2776
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/theme.mjs
2777
+ var import_yoctocolors_cjs = __toESM(require_yoctocolors_cjs(), 1);
2778
+ var defaultTheme = {
2779
+ prefix: {
2780
+ idle: import_yoctocolors_cjs.default.blue("?"),
2781
+ // TODO: use figure
2782
+ done: import_yoctocolors_cjs.default.green(esm_default.tick)
2783
+ },
2784
+ spinner: {
2785
+ interval: 80,
2786
+ frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"].map((frame) => import_yoctocolors_cjs.default.yellow(frame))
2787
+ },
2788
+ style: {
2789
+ answer: import_yoctocolors_cjs.default.cyan,
2790
+ message: import_yoctocolors_cjs.default.bold,
2791
+ error: (text) => import_yoctocolors_cjs.default.red(`> ${text}`),
2792
+ defaultAnswer: (text) => import_yoctocolors_cjs.default.dim(`(${text})`),
2793
+ help: import_yoctocolors_cjs.default.dim,
2794
+ highlight: import_yoctocolors_cjs.default.cyan,
2795
+ key: (text) => import_yoctocolors_cjs.default.cyan(import_yoctocolors_cjs.default.bold(`<${text}>`))
2796
+ }
2797
+ };
2798
+
2799
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/make-theme.mjs
2800
+ function isPlainObject(value) {
2801
+ if (typeof value !== "object" || value === null)
2802
+ return false;
2803
+ let proto = value;
2804
+ while (Object.getPrototypeOf(proto) !== null) {
2805
+ proto = Object.getPrototypeOf(proto);
2806
+ }
2807
+ return Object.getPrototypeOf(value) === proto;
2808
+ }
2809
+ function deepMerge(...objects) {
2810
+ const output = {};
2811
+ for (const obj of objects) {
2812
+ for (const [key, value] of Object.entries(obj)) {
2813
+ const prevValue = output[key];
2814
+ output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
2815
+ }
2816
+ }
2817
+ return output;
2818
+ }
2819
+ function makeTheme2(...themes) {
2820
+ const themesToMerge = [
2821
+ defaultTheme,
2822
+ ...themes.filter((theme) => theme != null)
2823
+ ];
2824
+ return deepMerge(...themesToMerge);
2825
+ }
2826
+
2827
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/use-prefix.mjs
2828
+ function usePrefix2({ status = "idle", theme }) {
2829
+ const [showLoader, setShowLoader] = useState2(false);
2830
+ const [tick, setTick] = useState2(0);
2831
+ const { prefix, spinner } = makeTheme2(theme);
2832
+ useEffect(() => {
2833
+ if (status === "loading") {
2834
+ let tickInterval;
2835
+ let inc = -1;
2836
+ const delayTimeout = setTimeout(AsyncResource2.bind(() => {
2837
+ setShowLoader(true);
2838
+ tickInterval = setInterval(AsyncResource2.bind(() => {
2839
+ inc = inc + 1;
2840
+ setTick(inc % spinner.frames.length);
2841
+ }), spinner.interval);
2842
+ }), 300);
2843
+ return () => {
2844
+ clearTimeout(delayTimeout);
2845
+ clearInterval(tickInterval);
2846
+ };
2847
+ } else {
2848
+ setShowLoader(false);
2849
+ }
2850
+ }, [status]);
2851
+ if (showLoader) {
2852
+ return spinner.frames[tick];
2853
+ }
2854
+ const iconName = status === "loading" ? "idle" : status;
2855
+ return typeof prefix === "string" ? prefix : prefix[iconName];
2856
+ }
2857
+
2858
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/use-memo.mjs
2859
+ function useMemo(fn, dependencies) {
2860
+ return withPointer((pointer) => {
2861
+ const prev = pointer.get();
2862
+ if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
2863
+ const value = fn();
2864
+ pointer.set({ value, dependencies });
2865
+ return value;
2866
+ }
2867
+ return prev.value;
2868
+ });
2869
+ }
2870
+
2871
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/use-ref.mjs
2872
+ function useRef(val) {
2873
+ return useState2({ current: val })[0];
2874
+ }
2875
+
2876
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/use-keypress.mjs
2877
+ function useKeypress2(userHandler) {
2878
+ const signal = useRef(userHandler);
2879
+ signal.current = userHandler;
2880
+ useEffect((rl) => {
2881
+ let ignore = false;
2882
+ const handler = withUpdates((_input, event) => {
2883
+ if (ignore)
2884
+ return;
2885
+ void signal.current(event, rl);
2886
+ });
2887
+ rl.input.on("keypress", handler);
2888
+ return () => {
2889
+ ignore = true;
2890
+ rl.input.removeListener("keypress", handler);
2891
+ };
2892
+ }, []);
2893
+ }
2894
+
2895
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/utils.mjs
2896
+ var import_cli_width = __toESM(require_cli_width(), 1);
2897
+ var import_wrap_ansi = __toESM(require_wrap_ansi(), 1);
2898
+ function breakLines(content, width) {
2899
+ return content.split("\n").flatMap((line) => (0, import_wrap_ansi.default)(line, width, { trim: false, hard: true }).split("\n").map((str) => str.trimEnd())).join("\n");
2900
+ }
2901
+ function readlineWidth() {
2902
+ return (0, import_cli_width.default)({ defaultWidth: 80, output: readline().output });
2903
+ }
2904
+
2905
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.mjs
2906
+ function split(content, width) {
2907
+ return breakLines(content, width).split("\n");
2908
+ }
2909
+ function rotate(count, items) {
2910
+ const max = items.length;
2911
+ const offset = (count % max + max) % max;
2912
+ return [...items.slice(offset), ...items.slice(0, offset)];
2913
+ }
2914
+ function lines({ items, width, renderItem, active, position: requested, pageSize }) {
2915
+ const layouts = items.map((item, index) => ({
2916
+ item,
2917
+ index,
2918
+ isActive: index === active
2919
+ }));
2920
+ const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
2921
+ const renderItemAt = (index) => layoutsInPage[index] == null ? [] : split(renderItem(layoutsInPage[index]), width);
2922
+ const pageBuffer = Array.from({ length: pageSize });
2923
+ const activeItem = renderItemAt(requested).slice(0, pageSize);
2924
+ const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
2925
+ pageBuffer.splice(position, activeItem.length, ...activeItem);
2926
+ let bufferPointer = position + activeItem.length;
2927
+ let layoutPointer = requested + 1;
2928
+ while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
2929
+ for (const line of renderItemAt(layoutPointer)) {
2930
+ pageBuffer[bufferPointer++] = line;
2931
+ if (bufferPointer >= pageSize)
2932
+ break;
2933
+ }
2934
+ layoutPointer++;
2935
+ }
2936
+ bufferPointer = position - 1;
2937
+ layoutPointer = requested - 1;
2938
+ while (bufferPointer >= 0 && layoutPointer >= 0) {
2939
+ for (const line of renderItemAt(layoutPointer).reverse()) {
2940
+ pageBuffer[bufferPointer--] = line;
2941
+ if (bufferPointer < 0)
2942
+ break;
2943
+ }
2944
+ layoutPointer--;
2945
+ }
2946
+ return pageBuffer.filter((line) => typeof line === "string");
2947
+ }
2948
+
2949
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/pagination/position.mjs
2950
+ function finite({ active, pageSize, total }) {
2951
+ const middle = Math.floor(pageSize / 2);
2952
+ if (total <= pageSize || active < middle)
2953
+ return active;
2954
+ if (active >= total - middle)
2955
+ return active + pageSize - total;
2956
+ return middle;
2957
+ }
2958
+ function infinite({ active, lastActive, total, pageSize, pointer }) {
2959
+ if (total <= pageSize)
2960
+ return active;
2961
+ if (lastActive < active && active - lastActive < pageSize) {
2962
+ return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
2963
+ }
2964
+ return pointer;
2965
+ }
2966
+
2967
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.mjs
2968
+ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
2969
+ const state = useRef({ position: 0, lastActive: 0 });
2970
+ const position = loop ? infinite({
2971
+ active,
2972
+ lastActive: state.current.lastActive,
2973
+ total: items.length,
2974
+ pageSize,
2975
+ pointer: state.current.position
2976
+ }) : finite({
2977
+ active,
2978
+ total: items.length,
2979
+ pageSize
2980
+ });
2981
+ state.current.position = position;
2982
+ state.current.lastActive = active;
2983
+ return lines({
2984
+ items,
2985
+ width: readlineWidth(),
2986
+ renderItem,
2987
+ active,
2988
+ position,
2989
+ pageSize
2990
+ }).join("\n");
2991
+ }
2992
+
2993
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs
2994
+ var import_mute_stream = __toESM(require_lib(), 1);
2995
+ import * as readline2 from "readline";
2996
+ import { AsyncResource as AsyncResource3 } from "async_hooks";
2997
+
2998
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/screen-manager.mjs
2999
+ var import_strip_ansi = __toESM(require_strip_ansi(), 1);
3000
+ var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
3001
+ var height = (content) => content.split("\n").length;
3002
+ var lastLine = (content) => content.split("\n").pop() ?? "";
3003
+ function cursorDown(n) {
3004
+ return n > 0 ? import_ansi_escapes2.default.cursorDown(n) : "";
3005
+ }
3006
+ var ScreenManager = class {
3007
+ constructor(rl) {
3008
+ __publicField(this, "rl");
3009
+ // These variables are keeping information to allow correct prompt re-rendering
3010
+ __publicField(this, "height", 0);
3011
+ __publicField(this, "extraLinesUnderPrompt", 0);
3012
+ __publicField(this, "cursorPos");
3013
+ this.rl = rl;
3014
+ this.rl = rl;
3015
+ this.cursorPos = rl.getCursorPos();
3016
+ }
3017
+ write(content) {
3018
+ this.rl.output.unmute();
3019
+ this.rl.output.write(content);
3020
+ this.rl.output.mute();
3021
+ }
3022
+ render(content, bottomContent = "") {
3023
+ const promptLine = lastLine(content);
3024
+ const rawPromptLine = (0, import_strip_ansi.default)(promptLine);
3025
+ let prompt = rawPromptLine;
3026
+ if (this.rl.line.length > 0) {
3027
+ prompt = prompt.slice(0, -this.rl.line.length);
3028
+ }
3029
+ this.rl.setPrompt(prompt);
3030
+ this.cursorPos = this.rl.getCursorPos();
3031
+ const width = readlineWidth();
3032
+ content = breakLines(content, width);
3033
+ bottomContent = breakLines(bottomContent, width);
3034
+ if (rawPromptLine.length % width === 0) {
3035
+ content += "\n";
3036
+ }
3037
+ let output = content + (bottomContent ? "\n" + bottomContent : "");
3038
+ const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
3039
+ const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
3040
+ if (bottomContentHeight > 0)
3041
+ output += import_ansi_escapes2.default.cursorUp(bottomContentHeight);
3042
+ output += import_ansi_escapes2.default.cursorTo(this.cursorPos.cols);
3043
+ this.write(cursorDown(this.extraLinesUnderPrompt) + import_ansi_escapes2.default.eraseLines(this.height) + output);
3044
+ this.extraLinesUnderPrompt = bottomContentHeight;
3045
+ this.height = height(output);
3046
+ }
3047
+ checkCursorPos() {
3048
+ const cursorPos = this.rl.getCursorPos();
3049
+ if (cursorPos.cols !== this.cursorPos.cols) {
3050
+ this.write(import_ansi_escapes2.default.cursorTo(cursorPos.cols));
3051
+ this.cursorPos = cursorPos;
3052
+ }
3053
+ }
3054
+ done({ clearContent }) {
3055
+ this.rl.setPrompt("");
3056
+ let output = cursorDown(this.extraLinesUnderPrompt);
3057
+ output += clearContent ? import_ansi_escapes2.default.eraseLines(this.height) : "\n";
3058
+ output += import_ansi_escapes2.default.cursorShow;
3059
+ this.write(output);
3060
+ this.rl.close();
3061
+ }
3062
+ };
3063
+
3064
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.mjs
3065
+ var PromisePolyfill = class extends Promise {
3066
+ // Available starting from Node 22
3067
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
3068
+ static withResolver() {
3069
+ let resolve;
3070
+ let reject;
3071
+ const promise = new Promise((res, rej) => {
3072
+ resolve = res;
3073
+ reject = rej;
3074
+ });
3075
+ return { promise, resolve, reject };
3076
+ }
3077
+ };
3078
+
3079
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs
3080
+ function createPrompt2(view) {
3081
+ const prompt = (config, context = {}) => {
3082
+ const { input = process.stdin, signal } = context;
3083
+ const cleanups = /* @__PURE__ */ new Set();
3084
+ const output = new import_mute_stream.default();
3085
+ output.pipe(context.output ?? process.stdout);
3086
+ const rl = readline2.createInterface({
3087
+ terminal: true,
3088
+ input,
3089
+ output
3090
+ });
3091
+ const screen = new ScreenManager(rl);
3092
+ const { promise, resolve, reject } = PromisePolyfill.withResolver();
3093
+ const cancel = () => reject(new CancelPromptError());
3094
+ if (signal) {
3095
+ const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
3096
+ if (signal.aborted) {
3097
+ abort();
3098
+ return Object.assign(promise, { cancel });
3099
+ }
3100
+ signal.addEventListener("abort", abort);
3101
+ cleanups.add(() => signal.removeEventListener("abort", abort));
3102
+ }
3103
+ cleanups.add(onExit((code, signal2) => {
3104
+ reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
3105
+ }));
3106
+ const checkCursorPos = () => screen.checkCursorPos();
3107
+ rl.input.on("keypress", checkCursorPos);
3108
+ cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
3109
+ return withHooks(rl, (cycle) => {
3110
+ const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
3111
+ rl.on("close", hooksCleanup);
3112
+ cleanups.add(() => rl.removeListener("close", hooksCleanup));
3113
+ cycle(() => {
3114
+ try {
3115
+ const nextView = view(config, (value) => {
3116
+ setImmediate(() => resolve(value));
3117
+ });
3118
+ const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
3119
+ screen.render(content, bottomContent);
3120
+ effectScheduler.run();
3121
+ } catch (error) {
3122
+ reject(error);
3123
+ }
3124
+ });
3125
+ return Object.assign(promise.then((answer) => {
3126
+ effectScheduler.clearAll();
3127
+ return answer;
3128
+ }, (error) => {
3129
+ effectScheduler.clearAll();
3130
+ throw error;
3131
+ }).finally(() => {
3132
+ cleanups.forEach((cleanup) => cleanup());
3133
+ screen.done({ clearContent: Boolean(context?.clearPromptOnDone) });
3134
+ output.end();
3135
+ }).then(() => promise), { cancel });
3136
+ });
3137
+ };
3138
+ return prompt;
3139
+ }
3140
+
3141
+ // ../../node_modules/.pnpm/@inquirer+core@9.2.1/node_modules/@inquirer/core/dist/esm/lib/Separator.mjs
3142
+ var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
3143
+ var Separator = class {
3144
+ constructor(separator) {
3145
+ __publicField(this, "separator", import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line)));
3146
+ __publicField(this, "type", "separator");
3147
+ if (separator) {
3148
+ this.separator = separator;
3149
+ }
3150
+ }
3151
+ static isSeparator(choice) {
3152
+ return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
3153
+ }
3154
+ };
3155
+
3156
+ // ../../node_modules/.pnpm/@inquirer+search@2.0.1/node_modules/@inquirer/search/dist/esm/index.mjs
3157
+ var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
3158
+ var searchTheme = {
3159
+ icon: { cursor: esm_default.pointer },
3160
+ style: {
3161
+ disabled: (text) => import_yoctocolors_cjs3.default.dim(`- ${text}`),
3162
+ searchTerm: (text) => import_yoctocolors_cjs3.default.cyan(text),
3163
+ description: (text) => import_yoctocolors_cjs3.default.cyan(text)
3164
+ },
3165
+ helpMode: "auto"
3166
+ };
3167
+ function isSelectable(item) {
3168
+ return !Separator.isSeparator(item) && !item.disabled;
3169
+ }
3170
+ function normalizeChoices(choices) {
3171
+ return choices.map((choice) => {
3172
+ if (Separator.isSeparator(choice))
3173
+ return choice;
3174
+ if (typeof choice === "string") {
3175
+ return {
3176
+ value: choice,
3177
+ name: choice,
3178
+ short: choice,
3179
+ disabled: false
3180
+ };
3181
+ }
3182
+ const name = choice.name ?? String(choice.value);
3183
+ return {
3184
+ value: choice.value,
3185
+ name,
3186
+ description: choice.description,
3187
+ short: choice.short ?? name,
3188
+ disabled: choice.disabled ?? false
3189
+ };
3190
+ });
3191
+ }
3192
+ var esm_default8 = createPrompt2((config, done) => {
3193
+ const { pageSize = 7, validate = () => true } = config;
3194
+ const theme = makeTheme2(searchTheme, config.theme);
3195
+ const firstRender = useRef(true);
3196
+ const [status, setStatus] = useState2("loading");
3197
+ const [searchTerm, setSearchTerm] = useState2("");
3198
+ const [searchResults, setSearchResults] = useState2([]);
3199
+ const [searchError, setSearchError] = useState2();
3200
+ const prefix = usePrefix2({ status, theme });
3201
+ const bounds = useMemo(() => {
3202
+ const first = searchResults.findIndex(isSelectable);
3203
+ const last = searchResults.findLastIndex(isSelectable);
3204
+ return { first, last };
3205
+ }, [searchResults]);
3206
+ const [active = bounds.first, setActive] = useState2();
3207
+ useEffect(() => {
3208
+ const controller = new AbortController();
3209
+ setStatus("loading");
3210
+ setSearchError(void 0);
3211
+ const fetchResults = async () => {
3212
+ try {
3213
+ const results = await config.source(searchTerm || void 0, {
3214
+ signal: controller.signal
3215
+ });
3216
+ if (!controller.signal.aborted) {
3217
+ setActive(void 0);
3218
+ setSearchError(void 0);
3219
+ setSearchResults(normalizeChoices(results));
3220
+ setStatus("idle");
3221
+ }
3222
+ } catch (error2) {
3223
+ if (!controller.signal.aborted && error2 instanceof Error) {
3224
+ setSearchError(error2.message);
3225
+ }
3226
+ }
3227
+ };
3228
+ void fetchResults();
3229
+ return () => {
3230
+ controller.abort();
3231
+ };
3232
+ }, [searchTerm]);
3233
+ const selectedChoice = searchResults[active];
3234
+ useKeypress2(async (key, rl) => {
3235
+ if (isEnterKey2(key)) {
3236
+ if (selectedChoice) {
3237
+ setStatus("loading");
3238
+ const isValid = await validate(selectedChoice.value);
3239
+ setStatus("idle");
3240
+ if (isValid === true) {
3241
+ setStatus("done");
3242
+ done(selectedChoice.value);
3243
+ } else if (selectedChoice.name === searchTerm) {
3244
+ setSearchError(isValid || "You must provide a valid value");
3245
+ } else {
3246
+ rl.write(selectedChoice.name);
3247
+ setSearchTerm(selectedChoice.name);
3248
+ }
3249
+ } else {
3250
+ rl.write(searchTerm);
3251
+ }
3252
+ } else if (key.name === "tab" && selectedChoice) {
3253
+ rl.clearLine(0);
3254
+ rl.write(selectedChoice.name);
3255
+ setSearchTerm(selectedChoice.name);
3256
+ } else if (status !== "loading" && (key.name === "up" || key.name === "down")) {
3257
+ rl.clearLine(0);
3258
+ if (key.name === "up" && active !== bounds.first || key.name === "down" && active !== bounds.last) {
3259
+ const offset = key.name === "up" ? -1 : 1;
3260
+ let next = active;
3261
+ do {
3262
+ next = (next + offset + searchResults.length) % searchResults.length;
3263
+ } while (!isSelectable(searchResults[next]));
3264
+ setActive(next);
3265
+ }
3266
+ } else {
3267
+ setSearchTerm(rl.line);
3268
+ }
3269
+ });
3270
+ const message = theme.style.message(config.message, status);
3271
+ if (active > 0) {
3272
+ firstRender.current = false;
3273
+ }
3274
+ let helpTip = "";
3275
+ if (searchResults.length > 1 && (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current)) {
3276
+ helpTip = searchResults.length > pageSize ? `
3277
+ ${theme.style.help("(Use arrow keys to reveal more choices)")}` : `
3278
+ ${theme.style.help("(Use arrow keys)")}`;
3279
+ }
3280
+ const page = usePagination({
3281
+ items: searchResults,
3282
+ active,
3283
+ renderItem({ item, isActive }) {
3284
+ if (Separator.isSeparator(item)) {
3285
+ return ` ${item.separator}`;
3286
+ }
3287
+ if (item.disabled) {
3288
+ const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
3289
+ return theme.style.disabled(`${item.name} ${disabledLabel}`);
3290
+ }
3291
+ const color = isActive ? theme.style.highlight : (x) => x;
3292
+ const cursor = isActive ? theme.icon.cursor : ` `;
3293
+ return color(`${cursor} ${item.name}`);
3294
+ },
3295
+ pageSize,
3296
+ loop: false
3297
+ });
3298
+ let error;
3299
+ if (searchError) {
3300
+ error = theme.style.error(searchError);
3301
+ } else if (searchResults.length === 0 && searchTerm !== "" && status === "idle") {
3302
+ error = theme.style.error("No results found");
3303
+ }
3304
+ let searchStr;
3305
+ if (status === "done" && selectedChoice) {
3306
+ const answer = selectedChoice.short ?? selectedChoice.name;
3307
+ return `${prefix} ${message} ${theme.style.answer(answer)}`;
3308
+ } else {
3309
+ searchStr = theme.style.searchTerm(searchTerm);
3310
+ }
3311
+ const choiceDescription = selectedChoice?.description ? `
3312
+ ${theme.style.description(selectedChoice.description)}` : ``;
3313
+ return [
3314
+ [prefix, message, searchStr].filter(Boolean).join(" "),
3315
+ `${error ?? page}${helpTip}${choiceDescription}`
3316
+ ];
3317
+ });
3318
+
3319
+ // src/util/client.ts
3320
+ var import_async_retry = __toESM(require_dist3(), 1);
3321
+ var import_node_fetch2 = __toESM(require_lib2(), 1);
3322
+ import { EventEmitter } from "events";
3323
+ import { URL as URL2 } from "url";
3324
+
3325
+ // src/util/ua.ts
3326
+ init_pkg();
3327
+ import os from "os";
3328
+ var ua_default = `${pkg_default.name} ${pkg_default.version} node-${process.version} ${os.platform()} (${os.arch()})`;
3329
+
3330
+ // src/util/response-error.ts
3331
+ async function responseError(res, fallbackMessage = null, parsedBody = {}) {
3332
+ let bodyError;
3333
+ if (!res.ok) {
3334
+ let body;
3335
+ try {
3336
+ body = await res.json();
3337
+ } catch (_err) {
3338
+ body = parsedBody;
3339
+ }
3340
+ bodyError = body.error || body.err || body;
3341
+ }
3342
+ const msg = bodyError?.message || fallbackMessage || "Response Error";
3343
+ return new APIError(msg, res, bodyError);
3344
+ }
3345
+
3346
+ // src/util/print-indications.ts
3347
+ var import_chalk2 = __toESM(require_source(), 1);
3348
+ function printIndications(res) {
3349
+ const indications = /* @__PURE__ */ new Set(["warning", "notice", "tip"]);
3350
+ const regex = /^x-(?:vercel|now)-(warning|notice|tip)-(.*)$/;
3351
+ for (const [name, payload] of res.headers) {
3352
+ const match = name.match(regex);
3353
+ if (match) {
3354
+ const [, type, identifier] = match;
3355
+ const action = res.headers.get(`x-vercel-action-${identifier}`);
3356
+ const link = res.headers.get(`x-vercel-link-${identifier}`);
3357
+ if (indications.has(type)) {
3358
+ const newline = "\n";
3359
+ const message = prependEmoji(import_chalk2.default.dim(payload), emoji(type)) + newline;
3360
+ let finalLink = "";
3361
+ if (link) {
3362
+ finalLink = import_chalk2.default.dim(`${action || "Learn More"}: ${link_default(link)}`) + newline;
3363
+ }
3364
+ output_manager_default.print(message + finalLink);
3365
+ }
3366
+ }
3367
+ }
3368
+ }
3369
+
3370
+ // src/util/login/reauthenticate.ts
3371
+ var import_chalk4 = __toESM(require_source(), 1);
3372
+
3373
+ // src/commands/login/future.ts
3374
+ var import_chalk3 = __toESM(require_source(), 1);
3375
+ var open = __toESM(require_open(), 1);
3376
+ var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
3377
+ import readline3 from "readline";
3378
+ import { KNOWN_AGENTS } from "@vercel/detect-agent";
3379
+
3380
+ // src/util/login/update-current-team-after-login.ts
3381
+ async function updateCurrentTeamAfterLogin(client, ssoTeamId) {
3382
+ if (ssoTeamId) {
3383
+ client.config.currentTeam = ssoTeamId;
3384
+ } else {
3385
+ let user = null;
3386
+ try {
3387
+ user = await getUser(client);
3388
+ } catch (_err) {
3389
+ output_manager_default.error("Failed to fetch the logged in user. Please try again.");
3390
+ return 1;
3391
+ }
3392
+ if (user.version === "northstar" && user.defaultTeamId) {
3393
+ client.config.currentTeam = user.defaultTeamId;
3394
+ } else {
3395
+ delete client.config.currentTeam;
3396
+ }
3397
+ }
3398
+ }
3399
+
3400
+ // src/util/oauth.ts
3401
+ var import_node_fetch = __toESM(require_lib2(), 1);
3402
+ import { hostname } from "os";
3403
+ var VERCEL_ISSUER = new URL("https://vercel.com");
3404
+ var VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
3405
+ var userAgent = `${hostname()} @ ${ua_default}`;
3406
+ var _as;
3407
+ async function as() {
3408
+ if (!_as) {
3409
+ const discoveryResponse = await discoveryEndpointRequest(VERCEL_ISSUER);
3410
+ const [discoveryResponseError, as2] = await processDiscoveryEndpointResponse(discoveryResponse);
3411
+ if (discoveryResponseError) {
3412
+ throw discoveryResponseError;
3413
+ }
3414
+ _as = as2;
3415
+ }
3416
+ return _as;
3417
+ }
3418
+ async function discoveryEndpointRequest(issuer) {
3419
+ return await (0, import_node_fetch.default)(new URL(".well-known/openid-configuration", issuer), {
3420
+ headers: { "Content-Type": "application/json", "user-agent": userAgent }
3421
+ });
3422
+ }
3423
+ async function processDiscoveryEndpointResponse(response) {
3424
+ const json = await response.json();
3425
+ if (!response.ok) {
3426
+ return [new Error("Discovery endpoint request failed")];
3427
+ }
3428
+ if (typeof json !== "object" || json === null || !canParseURL(json.issuer) || !canParseURL(json.device_authorization_endpoint) || !canParseURL(json.token_endpoint) || !canParseURL(json.revocation_endpoint) || !canParseURL(json.jwks_uri) || !canParseURL(json.introspection_endpoint)) {
3429
+ return [new TypeError("Invalid discovery response")];
3430
+ }
3431
+ const issuer = new URL(json.issuer);
3432
+ if (issuer.href !== VERCEL_ISSUER.href) {
3433
+ return [new Error("Issuer mismatch")];
3434
+ }
3435
+ return [
3436
+ null,
3437
+ {
3438
+ issuer,
3439
+ device_authorization_endpoint: new URL(
3440
+ json.device_authorization_endpoint
3441
+ ),
3442
+ token_endpoint: new URL(json.token_endpoint),
3443
+ revocation_endpoint: new URL(json.revocation_endpoint),
3444
+ jwks_uri: new URL(json.jwks_uri),
3445
+ introspection_endpoint: new URL(json.introspection_endpoint)
3446
+ }
3447
+ ];
3448
+ }
3449
+ async function deviceAuthorizationRequest() {
3450
+ return await (0, import_node_fetch.default)((await as()).device_authorization_endpoint, {
3451
+ method: "POST",
3452
+ headers: {
3453
+ "Content-Type": "application/x-www-form-urlencoded",
3454
+ "user-agent": userAgent
3455
+ },
3456
+ body: new URLSearchParams({
3457
+ client_id: VERCEL_CLI_CLIENT_ID,
3458
+ scope: "openid offline_access"
3459
+ })
3460
+ });
3461
+ }
3462
+ async function processDeviceAuthorizationResponse(response) {
3463
+ const json = await response.json();
3464
+ if (!response.ok) {
3465
+ return [new OAuthError("Device authorization request failed", json)];
3466
+ }
3467
+ if (typeof json !== "object" || json === null)
3468
+ return [new TypeError("Expected response to be an object")];
3469
+ if (!("device_code" in json) || typeof json.device_code !== "string")
3470
+ return [new TypeError("Expected `device_code` to be a string")];
3471
+ if (!("user_code" in json) || typeof json.user_code !== "string")
3472
+ return [new TypeError("Expected `user_code` to be a string")];
3473
+ if (!("verification_uri" in json) || typeof json.verification_uri !== "string" || !canParseURL(json.verification_uri)) {
3474
+ return [new TypeError("Expected `verification_uri` to be a string")];
3475
+ }
3476
+ if (!("verification_uri_complete" in json) || typeof json.verification_uri_complete !== "string" || !canParseURL(json.verification_uri_complete)) {
3477
+ return [
3478
+ new TypeError("Expected `verification_uri_complete` to be a string")
3479
+ ];
3480
+ }
3481
+ if (!("expires_in" in json) || typeof json.expires_in !== "number")
3482
+ return [new TypeError("Expected `expires_in` to be a number")];
3483
+ if (!("interval" in json) || typeof json.interval !== "number")
3484
+ return [new TypeError("Expected `interval` to be a number")];
3485
+ return [
3486
+ null,
3487
+ {
3488
+ device_code: json.device_code,
3489
+ user_code: json.user_code,
3490
+ verification_uri: json.verification_uri,
3491
+ verification_uri_complete: json.verification_uri_complete,
3492
+ expiresAt: Date.now() + json.expires_in * 1e3,
3493
+ interval: json.interval
3494
+ }
3495
+ ];
3496
+ }
3497
+ async function deviceAccessTokenRequest(options) {
3498
+ try {
3499
+ return [
3500
+ null,
3501
+ await (0, import_node_fetch.default)((await as()).token_endpoint, {
3502
+ method: "POST",
3503
+ headers: {
3504
+ "Content-Type": "application/x-www-form-urlencoded",
3505
+ "user-agent": userAgent
3506
+ },
3507
+ body: new URLSearchParams({
3508
+ client_id: VERCEL_CLI_CLIENT_ID,
3509
+ grant_type: "urn:ietf:params:oauth:grant-type:device_code",
3510
+ ...options
3511
+ }),
3512
+ // TODO: Drop `node-fetch` and just use `signal`
3513
+ timeout: 10 * 1e3,
3514
+ // @ts-expect-error: Signal is part of `fetch` spec, should drop `node-fetch`
3515
+ signal: AbortSignal.timeout(10 * 1e3)
3516
+ })
3517
+ ];
3518
+ } catch (error) {
3519
+ if (error instanceof Error)
3520
+ return [error];
3521
+ return [
3522
+ new Error("An unknown error occurred. See the logs for details.", {
3523
+ cause: error
3524
+ })
3525
+ ];
3526
+ }
3527
+ }
3528
+ async function processTokenResponse(response) {
3529
+ const json = await response.json();
3530
+ if (!response.ok) {
3531
+ return [new OAuthError("Device access token request failed", json)];
3532
+ }
3533
+ if (typeof json !== "object" || json === null)
3534
+ return [new TypeError("Expected response to be an object")];
3535
+ if (!("access_token" in json) || typeof json.access_token !== "string")
3536
+ return [new TypeError("Expected `access_token` to be a string")];
3537
+ if (!("token_type" in json) || json.token_type !== "Bearer")
3538
+ return [new TypeError('Expected `token_type` to be "Bearer"')];
3539
+ if (!("expires_in" in json) || typeof json.expires_in !== "number")
3540
+ return [new TypeError("Expected `expires_in` to be a number")];
3541
+ if ("refresh_token" in json && (typeof json.refresh_token !== "string" || !json.refresh_token))
3542
+ return [new TypeError("Expected `refresh_token` to be a string")];
3543
+ if ("scope" in json && typeof json.scope !== "string")
3544
+ return [new TypeError("Expected `scope` to be a string")];
3545
+ return [null, json];
3546
+ }
3547
+ async function revocationRequest(options) {
3548
+ return await (0, import_node_fetch.default)((await as()).revocation_endpoint, {
3549
+ method: "POST",
3550
+ headers: {
3551
+ "Content-Type": "application/x-www-form-urlencoded",
3552
+ "user-agent": userAgent
3553
+ },
3554
+ body: new URLSearchParams({ ...options, client_id: VERCEL_CLI_CLIENT_ID })
3555
+ });
3556
+ }
3557
+ async function processRevocationResponse(response) {
3558
+ if (response.ok)
3559
+ return [null, null];
3560
+ const json = await response.json();
3561
+ return [new OAuthError("Revocation request failed", json)];
3562
+ }
3563
+ async function refreshTokenRequest(options) {
3564
+ return await (0, import_node_fetch.default)((await as()).token_endpoint, {
3565
+ method: "POST",
3566
+ headers: {
3567
+ "Content-Type": "application/x-www-form-urlencoded",
3568
+ "user-agent": userAgent
3569
+ },
3570
+ body: new URLSearchParams({
3571
+ client_id: VERCEL_CLI_CLIENT_ID,
3572
+ grant_type: "refresh_token",
3573
+ ...options
3574
+ })
3575
+ });
3576
+ }
3577
+ function processOAuthErrorResponse(json) {
3578
+ if (typeof json !== "object" || json === null)
3579
+ return new TypeError("Expected response to be an object");
3580
+ if (!("error" in json) || typeof json.error !== "string")
3581
+ return new TypeError("Expected `error` to be a string");
3582
+ if ("error_description" in json && typeof json.error_description !== "string")
3583
+ return new TypeError("Expected `error_description` to be a string");
3584
+ if ("error_uri" in json && typeof json.error_uri !== "string")
3585
+ return new TypeError("Expected `error_uri` to be a string");
3586
+ return json;
3587
+ }
3588
+ var OAuthError = class extends Error {
3589
+ constructor(message, response) {
3590
+ var __super = (...args) => {
3591
+ super(...args);
3592
+ };
3593
+ const error = processOAuthErrorResponse(response);
3594
+ if (error instanceof TypeError) {
3595
+ const message2 = `Unexpected server response: ${JSON.stringify(response)}`;
3596
+ __super(message2);
3597
+ this.cause = new Error(message2, { cause: error });
3598
+ this.code = "server_error";
3599
+ return;
3600
+ }
3601
+ let cause = error.error;
3602
+ if (error.error_description)
3603
+ cause += `: ${error.error_description}`;
3604
+ if (error.error_uri)
3605
+ cause += ` (${error.error_uri})`;
3606
+ __super(message, { cause });
3607
+ this.cause = new Error(cause);
3608
+ this.code = error.error;
3609
+ }
3610
+ };
3611
+ function isOAuthError(error) {
3612
+ return error instanceof OAuthError;
3613
+ }
3614
+ function canParseURL(url) {
3615
+ try {
3616
+ return !!new URL(url);
3617
+ } catch {
3618
+ return false;
3619
+ }
3620
+ }
3621
+
3622
+ // src/commands/login/future.ts
3623
+ async function performDeviceCodeFlow(client, options) {
3624
+ const deviceAuthorizationResponse = await deviceAuthorizationRequest();
3625
+ output_manager_default.debug(
3626
+ `'Device Authorization response:', ${await deviceAuthorizationResponse.clone().text()}`
3627
+ );
3628
+ const [deviceAuthorizationError, deviceAuthorization] = await processDeviceAuthorizationResponse(deviceAuthorizationResponse);
3629
+ if (deviceAuthorizationError) {
3630
+ printError(deviceAuthorizationError);
3631
+ return null;
3632
+ }
3633
+ const { device_code, user_code, verification_uri, expiresAt, interval } = deviceAuthorization;
3634
+ let { verification_uri_complete } = deviceAuthorization;
3635
+ if (options?.teamId) {
3636
+ const url = new URL(verification_uri_complete);
3637
+ url.searchParams.set("team_id", options.teamId);
3638
+ verification_uri_complete = url.toString();
3639
+ }
3640
+ const isCursorAgent = client.agentName === KNOWN_AGENTS.CURSOR || client.agentName === KNOWN_AGENTS.CURSOR_CLI;
3641
+ const shouldSkipBrowser = process.env.CI && !isCursorAgent;
3642
+ output_manager_default.log(
3643
+ `
3644
+ Visit ${import_chalk3.default.bold(
3645
+ output_manager_default.link(
3646
+ verification_uri.replace("https://", ""),
3647
+ verification_uri_complete,
3648
+ { color: false, fallback: () => verification_uri_complete }
3649
+ )
3650
+ )}${output_manager_default.supportsHyperlink ? ` and enter ${import_chalk3.default.bold(user_code)}` : ""}
3651
+ `
3652
+ );
3653
+ if (!shouldSkipBrowser) {
3654
+ try {
3655
+ const browserProcess = await open.default(verification_uri_complete);
3656
+ browserProcess.on("error", (error) => {
3657
+ output_manager_default.debug(`Failed to open browser: ${error}`);
3658
+ });
3659
+ } catch (error) {
3660
+ output_manager_default.debug(`Failed to open browser: ${error}`);
3661
+ if (client.isAgent && client.nonInteractive) {
3662
+ output_manager_default.log(
3663
+ `
3664
+ ${import_chalk3.default.yellow("\u26A0")} ${import_chalk3.default.bold("Browser could not be opened automatically.")}
3665
+ `
3666
+ );
3667
+ output_manager_default.log(
3668
+ `Please ask the user to manually visit the URL above and complete the authentication process.
3669
+ `
3670
+ );
3671
+ }
3672
+ }
3673
+ }
3674
+ const rl = readline3.createInterface({
3675
+ input: process.stdin,
3676
+ output: process.stdout
3677
+ }).on("SIGINT", () => {
3678
+ process.exit(0);
3679
+ });
3680
+ output_manager_default.spinner("Waiting for authentication...");
3681
+ let intervalMs = interval * 1e3;
3682
+ let result = null;
3683
+ let flowError = new Error(
3684
+ "Timed out waiting for authentication. Please try again."
3685
+ );
3686
+ async function pollForToken() {
3687
+ while (Date.now() < expiresAt) {
3688
+ const [tokenResponseError, tokenResponse] = await deviceAccessTokenRequest({ device_code });
3689
+ if (tokenResponseError) {
3690
+ if (tokenResponseError.message.includes("timeout")) {
3691
+ intervalMs *= 2;
3692
+ output_manager_default.debug(
3693
+ `Connection timeout. Slowing down, polling every ${intervalMs / 1e3}s...`
3694
+ );
3695
+ await wait(intervalMs);
3696
+ continue;
3697
+ }
3698
+ return tokenResponseError;
3699
+ }
3700
+ output_manager_default.debug(
3701
+ `'Device Access Token response:', ${await tokenResponse.clone().text()}`
3702
+ );
3703
+ const [tokensError, tokens] = await processTokenResponse(tokenResponse);
3704
+ if (isOAuthError(tokensError)) {
3705
+ const { code } = tokensError;
3706
+ switch (code) {
3707
+ case "authorization_pending":
3708
+ await wait(intervalMs);
3709
+ continue;
3710
+ case "slow_down":
3711
+ intervalMs += 5 * 1e3;
3712
+ output_manager_default.debug(
3713
+ `Authorization server requests to slow down. Polling every ${intervalMs / 1e3}s...`
3714
+ );
3715
+ await wait(intervalMs);
3716
+ continue;
3717
+ default:
3718
+ return tokensError.cause;
3719
+ }
3720
+ }
3721
+ if (tokensError)
3722
+ return tokensError;
3723
+ output_manager_default.print((0, import_ansi_escapes3.eraseLines)(2));
3724
+ result = {
3725
+ access_token: tokens.access_token,
3726
+ expires_in: tokens.expires_in,
3727
+ refresh_token: tokens.refresh_token
3728
+ };
3729
+ return;
3730
+ }
3731
+ }
3732
+ flowError = await pollForToken();
3733
+ output_manager_default.stopSpinner();
3734
+ rl.close();
3735
+ if (flowError) {
3736
+ printError(flowError);
3737
+ return null;
3738
+ }
3739
+ return result;
3740
+ }
3741
+ async function login(client, telemetry) {
3742
+ const tokens = await performDeviceCodeFlow(client);
3743
+ if (!tokens) {
3744
+ telemetry.trackState("error");
3745
+ return 1;
3746
+ }
3747
+ const isInitialLogin = !client.authConfig.token;
3748
+ client.updateAuthConfig({
3749
+ token: tokens.access_token,
3750
+ expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in,
3751
+ refreshToken: tokens.refresh_token
3752
+ });
3753
+ client.updateConfig({ currentTeam: void 0 });
3754
+ if (isInitialLogin) {
3755
+ await updateCurrentTeamAfterLogin(client);
3756
+ }
3757
+ client.writeToAuthConfigFile();
3758
+ client.writeToConfigFile();
3759
+ output_manager_default.debug(`Saved credentials in "${humanizePath(global_path_default())}"`);
3760
+ output_manager_default.print(`
3761
+ ${import_chalk3.default.cyan("Congratulations!")} You are now signed in.
3762
+
3763
+ To deploy something, run ${getCommandName()}.
3764
+
3765
+ ${emoji("tip")} To deploy every commit automatically,
3766
+ connect a Git Repository (${import_chalk3.default.bold(output_manager_default.link("vercel.link/git", "https://vercel.link/git", { color: false }))}).
3767
+ `);
3768
+ telemetry.trackState("success");
3769
+ return 0;
3770
+ }
3771
+ async function wait(intervalMs) {
3772
+ await new Promise((resolve) => setTimeout(resolve, intervalMs));
3773
+ }
3774
+
3775
+ // src/util/login/reauthenticate.ts
3776
+ async function reauthenticate(client, error) {
3777
+ if (error.teamId && error.enforced) {
3778
+ output_manager_default.log(
3779
+ `You must re-authenticate with SAML to use ${(0, import_chalk4.bold)(error.scope)} scope.`
3780
+ );
3781
+ } else {
3782
+ output_manager_default.log(`You must re-authenticate to use ${(0, import_chalk4.bold)(error.scope)} scope.`);
3783
+ }
3784
+ const tokens = await performDeviceCodeFlow(client, {
3785
+ teamId: error.teamId || void 0
3786
+ });
3787
+ if (!tokens) {
3788
+ return 1;
3789
+ }
3790
+ client.updateAuthConfig({
3791
+ token: tokens.access_token,
3792
+ expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in,
3793
+ refreshToken: tokens.refresh_token
3794
+ });
3795
+ client.writeToAuthConfigFile();
3796
+ output_manager_default.success(`Authentication complete for ${(0, import_chalk4.bold)(error.scope)} scope.`);
3797
+ return { token: tokens.access_token, email: "" };
3798
+ }
3799
+
3800
+ // src/util/promise.ts
3801
+ function sharedPromise(fn) {
3802
+ let promise = null;
3803
+ return function(...args) {
3804
+ if (!promise) {
3805
+ promise = fn.apply(this, args);
3806
+ promise.finally(() => {
3807
+ promise = null;
3808
+ });
3809
+ }
3810
+ return promise;
3811
+ };
3812
+ }
3813
+
3814
+ // src/util/client.ts
3815
+ var import_error_utils2 = __toESM(require_dist(), 1);
3816
+
3817
+ // src/util/sleep.ts
3818
+ function sleep(ms) {
3819
+ return new Promise((resolve) => {
3820
+ setTimeout(resolve, ms);
3821
+ });
3822
+ }
3823
+
3824
+ // src/util/client.ts
3825
+ var isSAMLError = (v) => {
3826
+ return v && v.saml;
3827
+ };
3828
+ var isJSONObject = (v) => {
3829
+ return v && typeof v == "object" && v.constructor === Object;
3830
+ };
3831
+ function isValidAccessToken(authConfig) {
3832
+ if (!authConfig.token)
3833
+ return false;
3834
+ if (typeof authConfig.expiresAt !== "number")
3835
+ return true;
3836
+ const nowInSeconds = Math.floor(Date.now() / 1e3);
3837
+ return authConfig.expiresAt >= nowInSeconds;
3838
+ }
3839
+ function hasRefreshToken(authConfig) {
3840
+ return "refreshToken" in authConfig;
3841
+ }
3842
+ var Client = class extends EventEmitter {
3843
+ constructor(opts) {
3844
+ super();
3845
+ /** Track if we've already logged the token source debug message */
3846
+ this._loggedTokenSource = false;
3847
+ this.reauthenticate = sharedPromise(async function(error) {
3848
+ const result = await reauthenticate(this, error);
3849
+ if (typeof result === "number") {
3850
+ if (error instanceof APIError) {
3851
+ output_manager_default.prettyError(error);
3852
+ } else {
3853
+ output_manager_default.error(
3854
+ `Failed to re-authenticate for ${(0, import_chalk5.bold)(error.scope)} scope`
3855
+ );
3856
+ }
3857
+ throw error;
3858
+ }
3859
+ });
3860
+ this._onRetry = (error) => {
3861
+ output_manager_default.debug(`Retrying: ${error}
3862
+ ${error.stack}`);
3863
+ };
3864
+ this.agent = opts.agent;
3865
+ this.argv = opts.argv;
3866
+ this.apiUrl = opts.apiUrl;
3867
+ this.authConfig = opts.authConfig;
3868
+ this.stdin = opts.stdin;
3869
+ this.stdout = opts.stdout;
3870
+ this.stderr = opts.stderr;
3871
+ this.config = opts.config;
3872
+ this.localConfig = opts.localConfig;
3873
+ this.localConfigPath = opts.localConfigPath;
3874
+ this.requestIdCounter = 1;
3875
+ this.telemetryEventStore = opts.telemetryEventStore;
3876
+ this.isAgent = opts.isAgent ?? false;
3877
+ this.agentName = opts.agentName;
3878
+ this.nonInteractive = opts.nonInteractive ?? this.isAgent;
3879
+ this.dangerouslySkipPermissions = opts.dangerouslySkipPermissions ?? false;
3880
+ const theme = {
3881
+ prefix: (0, import_chalk5.gray)("?"),
3882
+ style: { answer: import_chalk5.gray }
3883
+ };
3884
+ this.input = {
3885
+ text: (opts2) => esm_default6({ theme, ...opts2 }, { input: this.stdin, output: this.stderr }),
3886
+ password: (opts2) => esm_default7(
3887
+ { theme, ...opts2 },
3888
+ { input: this.stdin, output: this.stderr }
3889
+ ),
3890
+ checkbox: (opts2) => esm_default2(
3891
+ { theme, ...opts2 },
3892
+ { input: this.stdin, output: this.stderr }
3893
+ ),
3894
+ expand: (opts2) => esm_default5({ theme, ...opts2 }, { input: this.stdin, output: this.stderr }),
3895
+ confirm: (message, default_value) => esm_default4(
3896
+ { theme, message, default: default_value },
3897
+ { input: this.stdin, output: this.stderr }
3898
+ ),
3899
+ select: (opts2) => esm_default3(
3900
+ { theme, ...opts2 },
3901
+ { input: this.stdin, output: this.stderr }
3902
+ ),
3903
+ search: (opts2) => esm_default8(
3904
+ { theme, ...opts2 },
3905
+ { input: this.stdin, output: this.stderr }
3906
+ )
3907
+ };
3908
+ }
3909
+ retry(fn, { retries = 3, maxTimeout = Infinity } = {}) {
3910
+ return (0, import_async_retry.default)(fn, {
3911
+ retries,
3912
+ maxTimeout,
3913
+ onRetry: this._onRetry
3914
+ });
3915
+ }
3916
+ /**
3917
+ * This method silently tries to refresh the access_token if it is expired.
3918
+ *
3919
+ * If the refresh_token is also expired, it will not attempt to refresh it.
3920
+ * If there is any error during the refresh process, it will not throw an error.
3921
+ */
3922
+ async ensureAuthorized() {
3923
+ const { authConfig } = this;
3924
+ if (isValidAccessToken(authConfig)) {
3925
+ if (!this._loggedTokenSource) {
3926
+ if (authConfig.tokenSource === "flag") {
3927
+ output_manager_default.debug(
3928
+ "Using token from `--token` argument, skipping token refresh."
3929
+ );
3930
+ } else if (authConfig.tokenSource === "env") {
3931
+ output_manager_default.debug(
3932
+ "Using token from VERCEL_TOKEN environment variable, skipping token refresh."
3933
+ );
3934
+ } else {
3935
+ output_manager_default.debug("Valid access token, skipping token refresh.");
3936
+ }
3937
+ this._loggedTokenSource = true;
3938
+ }
3939
+ return;
3940
+ }
3941
+ if (!hasRefreshToken(authConfig)) {
3942
+ output_manager_default.debug("No refresh token found, emptying auth config.");
3943
+ this.emptyAuthConfig();
3944
+ this.writeToAuthConfigFile();
3945
+ return;
3946
+ }
3947
+ const tokenResponse = await refreshTokenRequest({
3948
+ refresh_token: authConfig.refreshToken
3949
+ });
3950
+ const [tokensError, tokens] = await processTokenResponse(tokenResponse);
3951
+ if (tokensError) {
3952
+ output_manager_default.debug("Error refreshing token, emptying auth config.");
3953
+ this.emptyAuthConfig();
3954
+ this.writeToAuthConfigFile();
3955
+ return;
3956
+ }
3957
+ this.updateAuthConfig({
3958
+ token: tokens.access_token,
3959
+ expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in
3960
+ });
3961
+ if (tokens.refresh_token) {
3962
+ this.updateAuthConfig({ refreshToken: tokens.refresh_token });
3963
+ }
3964
+ this.writeToAuthConfigFile();
3965
+ this.writeToConfigFile();
3966
+ output_manager_default.debug("Tokens refreshed successfully.");
3967
+ }
3968
+ updateConfig(config) {
3969
+ this.config = { ...this.config, ...config };
3970
+ }
3971
+ writeToConfigFile() {
3972
+ writeToConfigFile(this.config);
3973
+ }
3974
+ updateAuthConfig(authConfig) {
3975
+ this.authConfig = { ...this.authConfig, ...authConfig };
3976
+ }
3977
+ emptyAuthConfig() {
3978
+ this.authConfig = {};
3979
+ }
3980
+ writeToAuthConfigFile() {
3981
+ writeToAuthConfigFile(this.authConfig);
3982
+ }
3983
+ /**
3984
+ * Confirms DELETE operations with the user.
3985
+ *
3986
+ * - DELETE operations always require confirmation (unless --dangerously-skip-permissions is used)
3987
+ * - When running under an AI agent with --dangerously-skip-permissions,
3988
+ * a warning is displayed for visibility
3989
+ *
3990
+ * @returns true if the operation should proceed, false if canceled
3991
+ */
3992
+ async confirmMutatingOperation(url, method) {
3993
+ const normalizedMethod = (method || "GET").toUpperCase();
3994
+ const isDelete = normalizedMethod === "DELETE";
3995
+ if (!isDelete) {
3996
+ return true;
3997
+ }
3998
+ if (this.isAgent && this.dangerouslySkipPermissions) {
3999
+ const agentInfo = this.agentName ? ` (${this.agentName})` : "";
4000
+ output_manager_default.print("\n");
4001
+ output_manager_default.print(
4002
+ (0, import_chalk5.bgRed)((0, import_chalk5.white)((0, import_chalk5.bold)(" \u26A0 WARNING "))) + (0, import_chalk5.red)((0, import_chalk5.bold)(" AGENT MODE - DELETE CONFIRMATION BYPASSED\n"))
4003
+ );
4004
+ output_manager_default.print(
4005
+ (0, import_chalk5.yellow)(
4006
+ ` An AI agent${agentInfo} is executing a ${(0, import_chalk5.bold)("DELETE")} request with --dangerously-skip-permissions flag.
4007
+ `
4008
+ )
4009
+ );
4010
+ output_manager_default.print((0, import_chalk5.yellow)(` This operation will delete data: ${(0, import_chalk5.bold)(url)}
4011
+ `));
4012
+ output_manager_default.print(
4013
+ (0, import_chalk5.yellow)(
4014
+ ` The --dangerously-skip-permissions flag has bypassed the confirmation prompt.
4015
+
4016
+ `
4017
+ )
4018
+ );
4019
+ }
4020
+ if (this.dangerouslySkipPermissions) {
4021
+ return true;
4022
+ }
4023
+ if (!this.stdin.isTTY) {
4024
+ output_manager_default.error(
4025
+ `DELETE operations require confirmation. Use ${(0, import_chalk5.bold)("--dangerously-skip-permissions")} to skip confirmation in non-interactive mode.`
4026
+ );
4027
+ return false;
4028
+ }
4029
+ const message = `You are about to perform a ${(0, import_chalk5.red)((0, import_chalk5.bold)("DELETE"))} operation on:
4030
+ ${(0, import_chalk5.bold)(url)}
4031
+
4032
+ Are you sure you want to proceed?`;
4033
+ output_manager_default.print("\n");
4034
+ const confirmed = await this.input.confirm(message, false);
4035
+ output_manager_default.print("\n");
4036
+ if (!confirmed) {
4037
+ output_manager_default.log("Operation canceled by user.");
4038
+ }
4039
+ return confirmed;
4040
+ }
4041
+ async _fetch(_url, opts = {}) {
4042
+ const url = new URL2(_url, this.apiUrl);
4043
+ if (opts.accountId || opts.useCurrentTeam !== false) {
4044
+ if (opts.accountId) {
4045
+ if (opts.accountId.startsWith("team_")) {
4046
+ url.searchParams.set("teamId", opts.accountId);
4047
+ } else {
4048
+ url.searchParams.delete("teamId");
4049
+ }
4050
+ } else if (opts.useCurrentTeam !== false && this.config.currentTeam) {
4051
+ url.searchParams.set("teamId", this.config.currentTeam);
4052
+ }
4053
+ }
4054
+ const headers = new import_node_fetch2.Headers(opts.headers);
4055
+ headers.set("user-agent", ua_default);
4056
+ if (this.agentName) {
4057
+ headers.set("x-ai-agent", this.agentName);
4058
+ }
4059
+ await this.ensureAuthorized();
4060
+ if (this.authConfig.token) {
4061
+ headers.set("authorization", `Bearer ${this.authConfig.token}`);
4062
+ }
4063
+ let body;
4064
+ if (isJSONObject(opts.body)) {
4065
+ body = JSON.stringify(opts.body);
4066
+ headers.set("content-type", "application/json; charset=utf-8");
4067
+ } else {
4068
+ body = opts.body;
4069
+ }
4070
+ const requestId = this.requestIdCounter++;
4071
+ return output_manager_default.time(
4072
+ (res) => {
4073
+ if (res) {
4074
+ return `#${requestId} \u2190 ${res.status} ${res.statusText}: ${res.headers.get("x-vercel-id")}`;
4075
+ } else {
4076
+ return `#${requestId} \u2192 ${opts.method || "GET"} ${url.href}`;
4077
+ }
4078
+ },
4079
+ (0, import_node_fetch2.default)(url, { agent: this.agent, ...opts, headers, body })
4080
+ );
4081
+ }
4082
+ fetch(url, opts = {}) {
4083
+ return this.retry(async (bail) => {
4084
+ const res = await this._fetch(url, opts);
4085
+ printIndications(res);
4086
+ if (!res.ok) {
4087
+ const error = await responseError(res);
4088
+ if (isSAMLError(error) && error.teamId) {
4089
+ try {
4090
+ await this.reauthenticate(error);
4091
+ } catch (reauthError) {
4092
+ return bail((0, import_error_utils2.normalizeError)(reauthError));
4093
+ }
4094
+ } else if (typeof error.retryAfterMs === "number") {
4095
+ const randomSkewMs = 3e4 * Math.random();
4096
+ await sleep(error.retryAfterMs + randomSkewMs);
4097
+ } else if (res.status >= 400 && res.status < 500) {
4098
+ return bail(error);
4099
+ }
4100
+ throw error;
4101
+ }
4102
+ if (opts.json === false) {
4103
+ return res;
4104
+ }
4105
+ const contentType = res.headers.get("content-type");
4106
+ if (!contentType) {
4107
+ return null;
4108
+ }
4109
+ return contentType.includes("application/json") ? res.json() : res;
4110
+ }, opts.retry);
4111
+ }
4112
+ async *fetchPaginated(url, opts) {
4113
+ const endpoint = typeof url === "string" ? new URL2(url, this.apiUrl) : new URL2(url.href);
4114
+ if (!endpoint.searchParams.has("limit")) {
4115
+ endpoint.searchParams.set("limit", "100");
4116
+ }
4117
+ let next;
4118
+ do {
4119
+ if (next) {
4120
+ await sleep(100);
4121
+ endpoint.searchParams.set("until", String(next));
4122
+ }
4123
+ const res = await this.fetch(
4124
+ endpoint.href,
4125
+ opts
4126
+ );
4127
+ yield res;
4128
+ next = res.pagination?.next;
4129
+ } while (next);
4130
+ }
4131
+ get cwd() {
4132
+ return process.cwd();
4133
+ }
4134
+ set cwd(v) {
4135
+ process.chdir(v);
4136
+ }
4137
+ };
4138
+
4139
+ export {
4140
+ require_dist3 as require_dist,
4141
+ ua_default,
4142
+ printIndications,
4143
+ require_open,
4144
+ revocationRequest,
4145
+ processRevocationResponse,
4146
+ login,
4147
+ readConfigFile,
4148
+ writeToConfigFile,
4149
+ readAuthConfigFile,
4150
+ writeToAuthConfigFile,
4151
+ getConfigFilePath,
4152
+ getAuthConfigFilePath,
4153
+ readLocalConfig,
4154
+ sleep,
4155
+ isJSONObject,
4156
+ Client
4157
+ };
4158
+ /*! Bundled license information:
4159
+
4160
+ imurmurhash/imurmurhash.js:
4161
+ (**
4162
+ * @preserve
4163
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
4164
+ *
4165
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
4166
+ * @see http://github.com/homebrewing/brauhaus-diff
4167
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
4168
+ * @see http://github.com/garycourt/murmurhash-js
4169
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
4170
+ * @see http://sites.google.com/site/murmurhash/
4171
+ *)
4172
+ */