@hot-updater/aws 0.21.7 → 0.21.9
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.
- package/dist/iac/index.cjs +159 -1326
- package/dist/iac/index.d.cts +1 -1
- package/dist/iac/index.d.ts +1 -1
- package/dist/iac/index.js +187 -1354
- package/package.json +6 -7
package/dist/iac/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { fromSSO } from "@aws-sdk/credential-providers";
|
|
3
|
-
import {
|
|
4
|
-
import g, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
5
|
-
import * as f$1 from "node:readline";
|
|
6
|
-
import M from "node:readline";
|
|
7
|
-
import tty, { WriteStream } from "node:tty";
|
|
8
|
-
import { ConfigBuilder, copyDirToTmp, createZip, getCwd, link, makeEnv, transformEnv, transformTemplate } from "@hot-updater/plugin-core";
|
|
3
|
+
import { ConfigBuilder, colors, copyDirToTmp, createZip, getCwd, link, makeEnv, p, transformEnv, transformTemplate } from "@hot-updater/cli-tools";
|
|
9
4
|
import { fileURLToPath } from "node:url";
|
|
10
5
|
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
11
6
|
import { StringDecoder } from "node:string_decoder";
|
|
7
|
+
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
8
|
+
import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
|
|
9
|
+
import tty from "node:tty";
|
|
12
10
|
import path from "node:path";
|
|
13
11
|
import path$1 from "path";
|
|
14
12
|
import fs from "fs";
|
|
@@ -44,7 +42,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
44
42
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$1 = 0, n$1 = keys.length, key; i$1 < n$1; i$1++) {
|
|
45
43
|
key = keys[i$1];
|
|
46
44
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
47
|
-
get: ((k
|
|
45
|
+
get: ((k) => from[k]).bind(null, key),
|
|
48
46
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
49
47
|
});
|
|
50
48
|
}
|
|
@@ -56,1169 +54,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
56
54
|
}) : target, mod));
|
|
57
55
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
58
56
|
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
61
|
-
var require_src = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js": ((exports, module) => {
|
|
62
|
-
const ESC = "\x1B";
|
|
63
|
-
const CSI = `${ESC}[`;
|
|
64
|
-
const beep = "\x07";
|
|
65
|
-
const cursor = {
|
|
66
|
-
to(x$1, y$1) {
|
|
67
|
-
if (!y$1) return `${CSI}${x$1 + 1}G`;
|
|
68
|
-
return `${CSI}${y$1 + 1};${x$1 + 1}H`;
|
|
69
|
-
},
|
|
70
|
-
move(x$1, y$1) {
|
|
71
|
-
let ret = "";
|
|
72
|
-
if (x$1 < 0) ret += `${CSI}${-x$1}D`;
|
|
73
|
-
else if (x$1 > 0) ret += `${CSI}${x$1}C`;
|
|
74
|
-
if (y$1 < 0) ret += `${CSI}${-y$1}A`;
|
|
75
|
-
else if (y$1 > 0) ret += `${CSI}${y$1}B`;
|
|
76
|
-
return ret;
|
|
77
|
-
},
|
|
78
|
-
up: (count$1 = 1) => `${CSI}${count$1}A`,
|
|
79
|
-
down: (count$1 = 1) => `${CSI}${count$1}B`,
|
|
80
|
-
forward: (count$1 = 1) => `${CSI}${count$1}C`,
|
|
81
|
-
backward: (count$1 = 1) => `${CSI}${count$1}D`,
|
|
82
|
-
nextLine: (count$1 = 1) => `${CSI}E`.repeat(count$1),
|
|
83
|
-
prevLine: (count$1 = 1) => `${CSI}F`.repeat(count$1),
|
|
84
|
-
left: `${CSI}G`,
|
|
85
|
-
hide: `${CSI}?25l`,
|
|
86
|
-
show: `${CSI}?25h`,
|
|
87
|
-
save: `${ESC}7`,
|
|
88
|
-
restore: `${ESC}8`
|
|
89
|
-
};
|
|
90
|
-
const scroll = {
|
|
91
|
-
up: (count$1 = 1) => `${CSI}S`.repeat(count$1),
|
|
92
|
-
down: (count$1 = 1) => `${CSI}T`.repeat(count$1)
|
|
93
|
-
};
|
|
94
|
-
const erase = {
|
|
95
|
-
screen: `${CSI}2J`,
|
|
96
|
-
up: (count$1 = 1) => `${CSI}1J`.repeat(count$1),
|
|
97
|
-
down: (count$1 = 1) => `${CSI}J`.repeat(count$1),
|
|
98
|
-
line: `${CSI}2K`,
|
|
99
|
-
lineEnd: `${CSI}K`,
|
|
100
|
-
lineStart: `${CSI}1K`,
|
|
101
|
-
lines(count$1) {
|
|
102
|
-
let clear = "";
|
|
103
|
-
for (let i$1 = 0; i$1 < count$1; i$1++) clear += this.line + (i$1 < count$1 - 1 ? cursor.up() : "");
|
|
104
|
-
if (count$1) clear += cursor.left;
|
|
105
|
-
return clear;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
module.exports = {
|
|
109
|
-
cursor,
|
|
110
|
-
scroll,
|
|
111
|
-
erase,
|
|
112
|
-
beep
|
|
113
|
-
};
|
|
114
|
-
}) });
|
|
115
|
-
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
118
|
-
var require_picocolors = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": ((exports, module) => {
|
|
119
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
120
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
121
|
-
let formatter = (open, close, replace = open) => (input) => {
|
|
122
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
123
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
124
|
-
};
|
|
125
|
-
let replaceClose = (string, close, replace, index) => {
|
|
126
|
-
let result = "", cursor$1 = 0;
|
|
127
|
-
do {
|
|
128
|
-
result += string.substring(cursor$1, index) + replace;
|
|
129
|
-
cursor$1 = index + close.length;
|
|
130
|
-
index = string.indexOf(close, cursor$1);
|
|
131
|
-
} while (~index);
|
|
132
|
-
return result + string.substring(cursor$1);
|
|
133
|
-
};
|
|
134
|
-
let createColors = (enabled = isColorSupported) => {
|
|
135
|
-
let f$2 = enabled ? formatter : () => String;
|
|
136
|
-
return {
|
|
137
|
-
isColorSupported: enabled,
|
|
138
|
-
reset: f$2("\x1B[0m", "\x1B[0m"),
|
|
139
|
-
bold: f$2("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
140
|
-
dim: f$2("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
141
|
-
italic: f$2("\x1B[3m", "\x1B[23m"),
|
|
142
|
-
underline: f$2("\x1B[4m", "\x1B[24m"),
|
|
143
|
-
inverse: f$2("\x1B[7m", "\x1B[27m"),
|
|
144
|
-
hidden: f$2("\x1B[8m", "\x1B[28m"),
|
|
145
|
-
strikethrough: f$2("\x1B[9m", "\x1B[29m"),
|
|
146
|
-
black: f$2("\x1B[30m", "\x1B[39m"),
|
|
147
|
-
red: f$2("\x1B[31m", "\x1B[39m"),
|
|
148
|
-
green: f$2("\x1B[32m", "\x1B[39m"),
|
|
149
|
-
yellow: f$2("\x1B[33m", "\x1B[39m"),
|
|
150
|
-
blue: f$2("\x1B[34m", "\x1B[39m"),
|
|
151
|
-
magenta: f$2("\x1B[35m", "\x1B[39m"),
|
|
152
|
-
cyan: f$2("\x1B[36m", "\x1B[39m"),
|
|
153
|
-
white: f$2("\x1B[37m", "\x1B[39m"),
|
|
154
|
-
gray: f$2("\x1B[90m", "\x1B[39m"),
|
|
155
|
-
bgBlack: f$2("\x1B[40m", "\x1B[49m"),
|
|
156
|
-
bgRed: f$2("\x1B[41m", "\x1B[49m"),
|
|
157
|
-
bgGreen: f$2("\x1B[42m", "\x1B[49m"),
|
|
158
|
-
bgYellow: f$2("\x1B[43m", "\x1B[49m"),
|
|
159
|
-
bgBlue: f$2("\x1B[44m", "\x1B[49m"),
|
|
160
|
-
bgMagenta: f$2("\x1B[45m", "\x1B[49m"),
|
|
161
|
-
bgCyan: f$2("\x1B[46m", "\x1B[49m"),
|
|
162
|
-
bgWhite: f$2("\x1B[47m", "\x1B[49m"),
|
|
163
|
-
blackBright: f$2("\x1B[90m", "\x1B[39m"),
|
|
164
|
-
redBright: f$2("\x1B[91m", "\x1B[39m"),
|
|
165
|
-
greenBright: f$2("\x1B[92m", "\x1B[39m"),
|
|
166
|
-
yellowBright: f$2("\x1B[93m", "\x1B[39m"),
|
|
167
|
-
blueBright: f$2("\x1B[94m", "\x1B[39m"),
|
|
168
|
-
magentaBright: f$2("\x1B[95m", "\x1B[39m"),
|
|
169
|
-
cyanBright: f$2("\x1B[96m", "\x1B[39m"),
|
|
170
|
-
whiteBright: f$2("\x1B[97m", "\x1B[39m"),
|
|
171
|
-
bgBlackBright: f$2("\x1B[100m", "\x1B[49m"),
|
|
172
|
-
bgRedBright: f$2("\x1B[101m", "\x1B[49m"),
|
|
173
|
-
bgGreenBright: f$2("\x1B[102m", "\x1B[49m"),
|
|
174
|
-
bgYellowBright: f$2("\x1B[103m", "\x1B[49m"),
|
|
175
|
-
bgBlueBright: f$2("\x1B[104m", "\x1B[49m"),
|
|
176
|
-
bgMagentaBright: f$2("\x1B[105m", "\x1B[49m"),
|
|
177
|
-
bgCyanBright: f$2("\x1B[106m", "\x1B[49m"),
|
|
178
|
-
bgWhiteBright: f$2("\x1B[107m", "\x1B[49m")
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
module.exports = createColors();
|
|
182
|
-
module.exports.createColors = createColors;
|
|
183
|
-
}) });
|
|
184
|
-
|
|
185
|
-
//#endregion
|
|
186
|
-
//#region ../../node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/dist/index.mjs
|
|
187
|
-
var import_src$1 = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
188
|
-
var import_picocolors$3 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
189
|
-
function J$1({ onlyFirst: t = !1 } = {}) {
|
|
190
|
-
const F$1 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
191
|
-
return new RegExp(F$1, t ? void 0 : "g");
|
|
192
|
-
}
|
|
193
|
-
const Q = J$1();
|
|
194
|
-
function T$1(t) {
|
|
195
|
-
if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
196
|
-
return t.replace(Q, "");
|
|
197
|
-
}
|
|
198
|
-
function O(t) {
|
|
199
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
200
|
-
}
|
|
201
|
-
var P$1 = { exports: {} };
|
|
202
|
-
(function(t) {
|
|
203
|
-
var u$2 = {};
|
|
204
|
-
t.exports = u$2, u$2.eastAsianWidth = function(e$1) {
|
|
205
|
-
var s = e$1.charCodeAt(0), i$1 = e$1.length == 2 ? e$1.charCodeAt(1) : 0, D$1 = s;
|
|
206
|
-
return 55296 <= s && s <= 56319 && 56320 <= i$1 && i$1 <= 57343 && (s &= 1023, i$1 &= 1023, D$1 = s << 10 | i$1, D$1 += 65536), D$1 == 12288 || 65281 <= D$1 && D$1 <= 65376 || 65504 <= D$1 && D$1 <= 65510 ? "F" : D$1 == 8361 || 65377 <= D$1 && D$1 <= 65470 || 65474 <= D$1 && D$1 <= 65479 || 65482 <= D$1 && D$1 <= 65487 || 65490 <= D$1 && D$1 <= 65495 || 65498 <= D$1 && D$1 <= 65500 || 65512 <= D$1 && D$1 <= 65518 ? "H" : 4352 <= D$1 && D$1 <= 4447 || 4515 <= D$1 && D$1 <= 4519 || 4602 <= D$1 && D$1 <= 4607 || 9001 <= D$1 && D$1 <= 9002 || 11904 <= D$1 && D$1 <= 11929 || 11931 <= D$1 && D$1 <= 12019 || 12032 <= D$1 && D$1 <= 12245 || 12272 <= D$1 && D$1 <= 12283 || 12289 <= D$1 && D$1 <= 12350 || 12353 <= D$1 && D$1 <= 12438 || 12441 <= D$1 && D$1 <= 12543 || 12549 <= D$1 && D$1 <= 12589 || 12593 <= D$1 && D$1 <= 12686 || 12688 <= D$1 && D$1 <= 12730 || 12736 <= D$1 && D$1 <= 12771 || 12784 <= D$1 && D$1 <= 12830 || 12832 <= D$1 && D$1 <= 12871 || 12880 <= D$1 && D$1 <= 13054 || 13056 <= D$1 && D$1 <= 19903 || 19968 <= D$1 && D$1 <= 42124 || 42128 <= D$1 && D$1 <= 42182 || 43360 <= D$1 && D$1 <= 43388 || 44032 <= D$1 && D$1 <= 55203 || 55216 <= D$1 && D$1 <= 55238 || 55243 <= D$1 && D$1 <= 55291 || 63744 <= D$1 && D$1 <= 64255 || 65040 <= D$1 && D$1 <= 65049 || 65072 <= D$1 && D$1 <= 65106 || 65108 <= D$1 && D$1 <= 65126 || 65128 <= D$1 && D$1 <= 65131 || 110592 <= D$1 && D$1 <= 110593 || 127488 <= D$1 && D$1 <= 127490 || 127504 <= D$1 && D$1 <= 127546 || 127552 <= D$1 && D$1 <= 127560 || 127568 <= D$1 && D$1 <= 127569 || 131072 <= D$1 && D$1 <= 194367 || 177984 <= D$1 && D$1 <= 196605 || 196608 <= D$1 && D$1 <= 262141 ? "W" : 32 <= D$1 && D$1 <= 126 || 162 <= D$1 && D$1 <= 163 || 165 <= D$1 && D$1 <= 166 || D$1 == 172 || D$1 == 175 || 10214 <= D$1 && D$1 <= 10221 || 10629 <= D$1 && D$1 <= 10630 ? "Na" : D$1 == 161 || D$1 == 164 || 167 <= D$1 && D$1 <= 168 || D$1 == 170 || 173 <= D$1 && D$1 <= 174 || 176 <= D$1 && D$1 <= 180 || 182 <= D$1 && D$1 <= 186 || 188 <= D$1 && D$1 <= 191 || D$1 == 198 || D$1 == 208 || 215 <= D$1 && D$1 <= 216 || 222 <= D$1 && D$1 <= 225 || D$1 == 230 || 232 <= D$1 && D$1 <= 234 || 236 <= D$1 && D$1 <= 237 || D$1 == 240 || 242 <= D$1 && D$1 <= 243 || 247 <= D$1 && D$1 <= 250 || D$1 == 252 || D$1 == 254 || D$1 == 257 || D$1 == 273 || D$1 == 275 || D$1 == 283 || 294 <= D$1 && D$1 <= 295 || D$1 == 299 || 305 <= D$1 && D$1 <= 307 || D$1 == 312 || 319 <= D$1 && D$1 <= 322 || D$1 == 324 || 328 <= D$1 && D$1 <= 331 || D$1 == 333 || 338 <= D$1 && D$1 <= 339 || 358 <= D$1 && D$1 <= 359 || D$1 == 363 || D$1 == 462 || D$1 == 464 || D$1 == 466 || D$1 == 468 || D$1 == 470 || D$1 == 472 || D$1 == 474 || D$1 == 476 || D$1 == 593 || D$1 == 609 || D$1 == 708 || D$1 == 711 || 713 <= D$1 && D$1 <= 715 || D$1 == 717 || D$1 == 720 || 728 <= D$1 && D$1 <= 731 || D$1 == 733 || D$1 == 735 || 768 <= D$1 && D$1 <= 879 || 913 <= D$1 && D$1 <= 929 || 931 <= D$1 && D$1 <= 937 || 945 <= D$1 && D$1 <= 961 || 963 <= D$1 && D$1 <= 969 || D$1 == 1025 || 1040 <= D$1 && D$1 <= 1103 || D$1 == 1105 || D$1 == 8208 || 8211 <= D$1 && D$1 <= 8214 || 8216 <= D$1 && D$1 <= 8217 || 8220 <= D$1 && D$1 <= 8221 || 8224 <= D$1 && D$1 <= 8226 || 8228 <= D$1 && D$1 <= 8231 || D$1 == 8240 || 8242 <= D$1 && D$1 <= 8243 || D$1 == 8245 || D$1 == 8251 || D$1 == 8254 || D$1 == 8308 || D$1 == 8319 || 8321 <= D$1 && D$1 <= 8324 || D$1 == 8364 || D$1 == 8451 || D$1 == 8453 || D$1 == 8457 || D$1 == 8467 || D$1 == 8470 || 8481 <= D$1 && D$1 <= 8482 || D$1 == 8486 || D$1 == 8491 || 8531 <= D$1 && D$1 <= 8532 || 8539 <= D$1 && D$1 <= 8542 || 8544 <= D$1 && D$1 <= 8555 || 8560 <= D$1 && D$1 <= 8569 || D$1 == 8585 || 8592 <= D$1 && D$1 <= 8601 || 8632 <= D$1 && D$1 <= 8633 || D$1 == 8658 || D$1 == 8660 || D$1 == 8679 || D$1 == 8704 || 8706 <= D$1 && D$1 <= 8707 || 8711 <= D$1 && D$1 <= 8712 || D$1 == 8715 || D$1 == 8719 || D$1 == 8721 || D$1 == 8725 || D$1 == 8730 || 8733 <= D$1 && D$1 <= 8736 || D$1 == 8739 || D$1 == 8741 || 8743 <= D$1 && D$1 <= 8748 || D$1 == 8750 || 8756 <= D$1 && D$1 <= 8759 || 8764 <= D$1 && D$1 <= 8765 || D$1 == 8776 || D$1 == 8780 || D$1 == 8786 || 8800 <= D$1 && D$1 <= 8801 || 8804 <= D$1 && D$1 <= 8807 || 8810 <= D$1 && D$1 <= 8811 || 8814 <= D$1 && D$1 <= 8815 || 8834 <= D$1 && D$1 <= 8835 || 8838 <= D$1 && D$1 <= 8839 || D$1 == 8853 || D$1 == 8857 || D$1 == 8869 || D$1 == 8895 || D$1 == 8978 || 9312 <= D$1 && D$1 <= 9449 || 9451 <= D$1 && D$1 <= 9547 || 9552 <= D$1 && D$1 <= 9587 || 9600 <= D$1 && D$1 <= 9615 || 9618 <= D$1 && D$1 <= 9621 || 9632 <= D$1 && D$1 <= 9633 || 9635 <= D$1 && D$1 <= 9641 || 9650 <= D$1 && D$1 <= 9651 || 9654 <= D$1 && D$1 <= 9655 || 9660 <= D$1 && D$1 <= 9661 || 9664 <= D$1 && D$1 <= 9665 || 9670 <= D$1 && D$1 <= 9672 || D$1 == 9675 || 9678 <= D$1 && D$1 <= 9681 || 9698 <= D$1 && D$1 <= 9701 || D$1 == 9711 || 9733 <= D$1 && D$1 <= 9734 || D$1 == 9737 || 9742 <= D$1 && D$1 <= 9743 || 9748 <= D$1 && D$1 <= 9749 || D$1 == 9756 || D$1 == 9758 || D$1 == 9792 || D$1 == 9794 || 9824 <= D$1 && D$1 <= 9825 || 9827 <= D$1 && D$1 <= 9829 || 9831 <= D$1 && D$1 <= 9834 || 9836 <= D$1 && D$1 <= 9837 || D$1 == 9839 || 9886 <= D$1 && D$1 <= 9887 || 9918 <= D$1 && D$1 <= 9919 || 9924 <= D$1 && D$1 <= 9933 || 9935 <= D$1 && D$1 <= 9953 || D$1 == 9955 || 9960 <= D$1 && D$1 <= 9983 || D$1 == 10045 || D$1 == 10071 || 10102 <= D$1 && D$1 <= 10111 || 11093 <= D$1 && D$1 <= 11097 || 12872 <= D$1 && D$1 <= 12879 || 57344 <= D$1 && D$1 <= 63743 || 65024 <= D$1 && D$1 <= 65039 || D$1 == 65533 || 127232 <= D$1 && D$1 <= 127242 || 127248 <= D$1 && D$1 <= 127277 || 127280 <= D$1 && D$1 <= 127337 || 127344 <= D$1 && D$1 <= 127386 || 917760 <= D$1 && D$1 <= 917999 || 983040 <= D$1 && D$1 <= 1048573 || 1048576 <= D$1 && D$1 <= 1114109 ? "A" : "N";
|
|
207
|
-
}, u$2.characterLength = function(e$1) {
|
|
208
|
-
var s = this.eastAsianWidth(e$1);
|
|
209
|
-
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
210
|
-
};
|
|
211
|
-
function F$1(e$1) {
|
|
212
|
-
return e$1.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
213
|
-
}
|
|
214
|
-
u$2.length = function(e$1) {
|
|
215
|
-
for (var s = F$1(e$1), i$1 = 0, D$1 = 0; D$1 < s.length; D$1++) i$1 = i$1 + this.characterLength(s[D$1]);
|
|
216
|
-
return i$1;
|
|
217
|
-
}, u$2.slice = function(e$1, s, i$1) {
|
|
218
|
-
textLen = u$2.length(e$1), s = s || 0, i$1 = i$1 || 1, s < 0 && (s = textLen + s), i$1 < 0 && (i$1 = textLen + i$1);
|
|
219
|
-
for (var D$1 = "", C$1 = 0, o$2 = F$1(e$1), E = 0; E < o$2.length; E++) {
|
|
220
|
-
var a$1 = o$2[E], n$1 = u$2.length(a$1);
|
|
221
|
-
if (C$1 >= s - (n$1 == 2 ? 1 : 0)) if (C$1 + n$1 <= i$1) D$1 += a$1;
|
|
222
|
-
else break;
|
|
223
|
-
C$1 += n$1;
|
|
224
|
-
}
|
|
225
|
-
return D$1;
|
|
226
|
-
};
|
|
227
|
-
})(P$1);
|
|
228
|
-
var X = P$1.exports;
|
|
229
|
-
const DD = O(X);
|
|
230
|
-
var uD = function() {
|
|
231
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
232
|
-
};
|
|
233
|
-
const FD = O(uD);
|
|
234
|
-
function A$1(t, u$2 = {}) {
|
|
235
|
-
if (typeof t != "string" || t.length === 0 || (u$2 = {
|
|
236
|
-
ambiguousIsNarrow: !0,
|
|
237
|
-
...u$2
|
|
238
|
-
}, t = T$1(t), t.length === 0)) return 0;
|
|
239
|
-
t = t.replace(FD(), " ");
|
|
240
|
-
const F$1 = u$2.ambiguousIsNarrow ? 1 : 2;
|
|
241
|
-
let e$1 = 0;
|
|
242
|
-
for (const s of t) {
|
|
243
|
-
const i$1 = s.codePointAt(0);
|
|
244
|
-
if (i$1 <= 31 || i$1 >= 127 && i$1 <= 159 || i$1 >= 768 && i$1 <= 879) continue;
|
|
245
|
-
switch (DD.eastAsianWidth(s)) {
|
|
246
|
-
case "F":
|
|
247
|
-
case "W":
|
|
248
|
-
e$1 += 2;
|
|
249
|
-
break;
|
|
250
|
-
case "A":
|
|
251
|
-
e$1 += F$1;
|
|
252
|
-
break;
|
|
253
|
-
default: e$1 += 1;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return e$1;
|
|
257
|
-
}
|
|
258
|
-
const m = 10, L$1 = (t = 0) => (u$2) => `\x1B[${u$2 + t}m`, N = (t = 0) => (u$2) => `\x1B[${38 + t};5;${u$2}m`, I = (t = 0) => (u$2, F$1, e$1) => `\x1B[${38 + t};2;${u$2};${F$1};${e$1}m`, r = {
|
|
259
|
-
modifier: {
|
|
260
|
-
reset: [0, 0],
|
|
261
|
-
bold: [1, 22],
|
|
262
|
-
dim: [2, 22],
|
|
263
|
-
italic: [3, 23],
|
|
264
|
-
underline: [4, 24],
|
|
265
|
-
overline: [53, 55],
|
|
266
|
-
inverse: [7, 27],
|
|
267
|
-
hidden: [8, 28],
|
|
268
|
-
strikethrough: [9, 29]
|
|
269
|
-
},
|
|
270
|
-
color: {
|
|
271
|
-
black: [30, 39],
|
|
272
|
-
red: [31, 39],
|
|
273
|
-
green: [32, 39],
|
|
274
|
-
yellow: [33, 39],
|
|
275
|
-
blue: [34, 39],
|
|
276
|
-
magenta: [35, 39],
|
|
277
|
-
cyan: [36, 39],
|
|
278
|
-
white: [37, 39],
|
|
279
|
-
blackBright: [90, 39],
|
|
280
|
-
gray: [90, 39],
|
|
281
|
-
grey: [90, 39],
|
|
282
|
-
redBright: [91, 39],
|
|
283
|
-
greenBright: [92, 39],
|
|
284
|
-
yellowBright: [93, 39],
|
|
285
|
-
blueBright: [94, 39],
|
|
286
|
-
magentaBright: [95, 39],
|
|
287
|
-
cyanBright: [96, 39],
|
|
288
|
-
whiteBright: [97, 39]
|
|
289
|
-
},
|
|
290
|
-
bgColor: {
|
|
291
|
-
bgBlack: [40, 49],
|
|
292
|
-
bgRed: [41, 49],
|
|
293
|
-
bgGreen: [42, 49],
|
|
294
|
-
bgYellow: [43, 49],
|
|
295
|
-
bgBlue: [44, 49],
|
|
296
|
-
bgMagenta: [45, 49],
|
|
297
|
-
bgCyan: [46, 49],
|
|
298
|
-
bgWhite: [47, 49],
|
|
299
|
-
bgBlackBright: [100, 49],
|
|
300
|
-
bgGray: [100, 49],
|
|
301
|
-
bgGrey: [100, 49],
|
|
302
|
-
bgRedBright: [101, 49],
|
|
303
|
-
bgGreenBright: [102, 49],
|
|
304
|
-
bgYellowBright: [103, 49],
|
|
305
|
-
bgBlueBright: [104, 49],
|
|
306
|
-
bgMagentaBright: [105, 49],
|
|
307
|
-
bgCyanBright: [106, 49],
|
|
308
|
-
bgWhiteBright: [107, 49]
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
Object.keys(r.modifier);
|
|
312
|
-
const tD = Object.keys(r.color), eD = Object.keys(r.bgColor);
|
|
313
|
-
[...tD, ...eD];
|
|
314
|
-
function sD() {
|
|
315
|
-
const t = /* @__PURE__ */ new Map();
|
|
316
|
-
for (const [u$2, F$1] of Object.entries(r)) {
|
|
317
|
-
for (const [e$1, s] of Object.entries(F$1)) r[e$1] = {
|
|
318
|
-
open: `\x1B[${s[0]}m`,
|
|
319
|
-
close: `\x1B[${s[1]}m`
|
|
320
|
-
}, F$1[e$1] = r[e$1], t.set(s[0], s[1]);
|
|
321
|
-
Object.defineProperty(r, u$2, {
|
|
322
|
-
value: F$1,
|
|
323
|
-
enumerable: !1
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
return Object.defineProperty(r, "codes", {
|
|
327
|
-
value: t,
|
|
328
|
-
enumerable: !1
|
|
329
|
-
}), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L$1(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L$1(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, {
|
|
330
|
-
rgbToAnsi256: {
|
|
331
|
-
value: (u$2, F$1, e$1) => u$2 === F$1 && F$1 === e$1 ? u$2 < 8 ? 16 : u$2 > 248 ? 231 : Math.round((u$2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u$2 / 255 * 5) + 6 * Math.round(F$1 / 255 * 5) + Math.round(e$1 / 255 * 5),
|
|
332
|
-
enumerable: !1
|
|
333
|
-
},
|
|
334
|
-
hexToRgb: {
|
|
335
|
-
value: (u$2) => {
|
|
336
|
-
const F$1 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u$2.toString(16));
|
|
337
|
-
if (!F$1) return [
|
|
338
|
-
0,
|
|
339
|
-
0,
|
|
340
|
-
0
|
|
341
|
-
];
|
|
342
|
-
let [e$1] = F$1;
|
|
343
|
-
e$1.length === 3 && (e$1 = [...e$1].map((i$1) => i$1 + i$1).join(""));
|
|
344
|
-
const s = Number.parseInt(e$1, 16);
|
|
345
|
-
return [
|
|
346
|
-
s >> 16 & 255,
|
|
347
|
-
s >> 8 & 255,
|
|
348
|
-
s & 255
|
|
349
|
-
];
|
|
350
|
-
},
|
|
351
|
-
enumerable: !1
|
|
352
|
-
},
|
|
353
|
-
hexToAnsi256: {
|
|
354
|
-
value: (u$2) => r.rgbToAnsi256(...r.hexToRgb(u$2)),
|
|
355
|
-
enumerable: !1
|
|
356
|
-
},
|
|
357
|
-
ansi256ToAnsi: {
|
|
358
|
-
value: (u$2) => {
|
|
359
|
-
if (u$2 < 8) return 30 + u$2;
|
|
360
|
-
if (u$2 < 16) return 90 + (u$2 - 8);
|
|
361
|
-
let F$1, e$1, s;
|
|
362
|
-
if (u$2 >= 232) F$1 = ((u$2 - 232) * 10 + 8) / 255, e$1 = F$1, s = F$1;
|
|
363
|
-
else {
|
|
364
|
-
u$2 -= 16;
|
|
365
|
-
const C$1 = u$2 % 36;
|
|
366
|
-
F$1 = Math.floor(u$2 / 36) / 5, e$1 = Math.floor(C$1 / 6) / 5, s = C$1 % 6 / 5;
|
|
367
|
-
}
|
|
368
|
-
const i$1 = Math.max(F$1, e$1, s) * 2;
|
|
369
|
-
if (i$1 === 0) return 30;
|
|
370
|
-
let D$1 = 30 + (Math.round(s) << 2 | Math.round(e$1) << 1 | Math.round(F$1));
|
|
371
|
-
return i$1 === 2 && (D$1 += 60), D$1;
|
|
372
|
-
},
|
|
373
|
-
enumerable: !1
|
|
374
|
-
},
|
|
375
|
-
rgbToAnsi: {
|
|
376
|
-
value: (u$2, F$1, e$1) => r.ansi256ToAnsi(r.rgbToAnsi256(u$2, F$1, e$1)),
|
|
377
|
-
enumerable: !1
|
|
378
|
-
},
|
|
379
|
-
hexToAnsi: {
|
|
380
|
-
value: (u$2) => r.ansi256ToAnsi(r.hexToAnsi256(u$2)),
|
|
381
|
-
enumerable: !1
|
|
382
|
-
}
|
|
383
|
-
}), r;
|
|
384
|
-
}
|
|
385
|
-
const iD = sD(), v = new Set(["\x1B", ""]), CD = 39, w$1 = "\x07", W$1 = "[", rD = "]", R = "m", y = `${rD}8;;`, V$1 = (t) => `${v.values().next().value}${W$1}${t}${R}`, z = (t) => `${v.values().next().value}${y}${t}${w$1}`, ED = (t) => t.split(" ").map((u$2) => A$1(u$2)), _$1 = (t, u$2, F$1) => {
|
|
386
|
-
const e$1 = [...u$2];
|
|
387
|
-
let s = !1, i$1 = !1, D$1 = A$1(T$1(t[t.length - 1]));
|
|
388
|
-
for (const [C$1, o$2] of e$1.entries()) {
|
|
389
|
-
const E = A$1(o$2);
|
|
390
|
-
if (D$1 + E <= F$1 ? t[t.length - 1] += o$2 : (t.push(o$2), D$1 = 0), v.has(o$2) && (s = !0, i$1 = e$1.slice(C$1 + 1).join("").startsWith(y)), s) {
|
|
391
|
-
i$1 ? o$2 === w$1 && (s = !1, i$1 = !1) : o$2 === R && (s = !1);
|
|
392
|
-
continue;
|
|
393
|
-
}
|
|
394
|
-
D$1 += E, D$1 === F$1 && C$1 < e$1.length - 1 && (t.push(""), D$1 = 0);
|
|
395
|
-
}
|
|
396
|
-
!D$1 && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
397
|
-
}, nD = (t) => {
|
|
398
|
-
const u$2 = t.split(" ");
|
|
399
|
-
let F$1 = u$2.length;
|
|
400
|
-
for (; F$1 > 0 && !(A$1(u$2[F$1 - 1]) > 0);) F$1--;
|
|
401
|
-
return F$1 === u$2.length ? t : u$2.slice(0, F$1).join(" ") + u$2.slice(F$1).join("");
|
|
402
|
-
}, oD = (t, u$2, F$1 = {}) => {
|
|
403
|
-
if (F$1.trim !== !1 && t.trim() === "") return "";
|
|
404
|
-
let e$1 = "", s, i$1;
|
|
405
|
-
const D$1 = ED(t);
|
|
406
|
-
let C$1 = [""];
|
|
407
|
-
for (const [E, a$1] of t.split(" ").entries()) {
|
|
408
|
-
F$1.trim !== !1 && (C$1[C$1.length - 1] = C$1[C$1.length - 1].trimStart());
|
|
409
|
-
let n$1 = A$1(C$1[C$1.length - 1]);
|
|
410
|
-
if (E !== 0 && (n$1 >= u$2 && (F$1.wordWrap === !1 || F$1.trim === !1) && (C$1.push(""), n$1 = 0), (n$1 > 0 || F$1.trim === !1) && (C$1[C$1.length - 1] += " ", n$1++)), F$1.hard && D$1[E] > u$2) {
|
|
411
|
-
const B$1 = u$2 - n$1, p$1 = 1 + Math.floor((D$1[E] - B$1 - 1) / u$2);
|
|
412
|
-
Math.floor((D$1[E] - 1) / u$2) < p$1 && C$1.push(""), _$1(C$1, a$1, u$2);
|
|
413
|
-
continue;
|
|
414
|
-
}
|
|
415
|
-
if (n$1 + D$1[E] > u$2 && n$1 > 0 && D$1[E] > 0) {
|
|
416
|
-
if (F$1.wordWrap === !1 && n$1 < u$2) {
|
|
417
|
-
_$1(C$1, a$1, u$2);
|
|
418
|
-
continue;
|
|
419
|
-
}
|
|
420
|
-
C$1.push("");
|
|
421
|
-
}
|
|
422
|
-
if (n$1 + D$1[E] > u$2 && F$1.wordWrap === !1) {
|
|
423
|
-
_$1(C$1, a$1, u$2);
|
|
424
|
-
continue;
|
|
425
|
-
}
|
|
426
|
-
C$1[C$1.length - 1] += a$1;
|
|
427
|
-
}
|
|
428
|
-
F$1.trim !== !1 && (C$1 = C$1.map((E) => nD(E)));
|
|
429
|
-
const o$2 = [...C$1.join(`
|
|
430
|
-
`)];
|
|
431
|
-
for (const [E, a$1] of o$2.entries()) {
|
|
432
|
-
if (e$1 += a$1, v.has(a$1)) {
|
|
433
|
-
const { groups: B$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`)).exec(o$2.slice(E).join("")) || { groups: {} };
|
|
434
|
-
if (B$1.code !== void 0) {
|
|
435
|
-
const p$1 = Number.parseFloat(B$1.code);
|
|
436
|
-
s = p$1 === CD ? void 0 : p$1;
|
|
437
|
-
} else B$1.uri !== void 0 && (i$1 = B$1.uri.length === 0 ? void 0 : B$1.uri);
|
|
438
|
-
}
|
|
439
|
-
const n$1 = iD.codes.get(Number(s));
|
|
440
|
-
o$2[E + 1] === `
|
|
441
|
-
` ? (i$1 && (e$1 += z("")), s && n$1 && (e$1 += V$1(n$1))) : a$1 === `
|
|
442
|
-
` && (s && n$1 && (e$1 += V$1(s)), i$1 && (e$1 += z(i$1)));
|
|
443
|
-
}
|
|
444
|
-
return e$1;
|
|
445
|
-
};
|
|
446
|
-
function G(t, u$2, F$1) {
|
|
447
|
-
return String(t).normalize().replace(/\r\n/g, `
|
|
448
|
-
`).split(`
|
|
449
|
-
`).map((e$1) => oD(e$1, u$2, F$1)).join(`
|
|
450
|
-
`);
|
|
451
|
-
}
|
|
452
|
-
const c$1 = {
|
|
453
|
-
actions: new Set([
|
|
454
|
-
"up",
|
|
455
|
-
"down",
|
|
456
|
-
"left",
|
|
457
|
-
"right",
|
|
458
|
-
"space",
|
|
459
|
-
"enter",
|
|
460
|
-
"cancel"
|
|
461
|
-
]),
|
|
462
|
-
aliases: new Map([
|
|
463
|
-
["k", "up"],
|
|
464
|
-
["j", "down"],
|
|
465
|
-
["h", "left"],
|
|
466
|
-
["l", "right"],
|
|
467
|
-
["", "cancel"],
|
|
468
|
-
["escape", "cancel"]
|
|
469
|
-
])
|
|
470
|
-
};
|
|
471
|
-
function k$1(t, u$2) {
|
|
472
|
-
if (typeof t == "string") return c$1.aliases.get(t) === u$2;
|
|
473
|
-
for (const F$1 of t) if (F$1 !== void 0 && k$1(F$1, u$2)) return !0;
|
|
474
|
-
return !1;
|
|
475
|
-
}
|
|
476
|
-
function lD(t, u$2) {
|
|
477
|
-
if (t === u$2) return;
|
|
478
|
-
const F$1 = t.split(`
|
|
479
|
-
`), e$1 = u$2.split(`
|
|
480
|
-
`), s = [];
|
|
481
|
-
for (let i$1 = 0; i$1 < Math.max(F$1.length, e$1.length); i$1++) F$1[i$1] !== e$1[i$1] && s.push(i$1);
|
|
482
|
-
return s;
|
|
483
|
-
}
|
|
484
|
-
const xD = globalThis.process.platform.startsWith("win"), S = Symbol("clack:cancel");
|
|
485
|
-
function BD(t) {
|
|
486
|
-
return t === S;
|
|
487
|
-
}
|
|
488
|
-
function d$1(t, u$2) {
|
|
489
|
-
const F$1 = t;
|
|
490
|
-
F$1.isTTY && F$1.setRawMode(u$2);
|
|
491
|
-
}
|
|
492
|
-
function cD({ input: t = stdin, output: u$2 = stdout, overwrite: F$1 = !0, hideCursor: e$1 = !0 } = {}) {
|
|
493
|
-
const s = f$1.createInterface({
|
|
494
|
-
input: t,
|
|
495
|
-
output: u$2,
|
|
496
|
-
prompt: "",
|
|
497
|
-
tabSize: 1
|
|
498
|
-
});
|
|
499
|
-
f$1.emitKeypressEvents(t, s), t.isTTY && t.setRawMode(!0);
|
|
500
|
-
const i$1 = (D$1, { name: C$1, sequence: o$2 }) => {
|
|
501
|
-
if (k$1([
|
|
502
|
-
String(D$1),
|
|
503
|
-
C$1,
|
|
504
|
-
o$2
|
|
505
|
-
], "cancel")) {
|
|
506
|
-
e$1 && u$2.write(import_src$1.cursor.show), process.exit(0);
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
if (!F$1) return;
|
|
510
|
-
const a$1 = C$1 === "return" ? 0 : -1, n$1 = C$1 === "return" ? -1 : 0;
|
|
511
|
-
f$1.moveCursor(u$2, a$1, n$1, () => {
|
|
512
|
-
f$1.clearLine(u$2, 1, () => {
|
|
513
|
-
t.once("keypress", i$1);
|
|
514
|
-
});
|
|
515
|
-
});
|
|
516
|
-
};
|
|
517
|
-
return e$1 && u$2.write(import_src$1.cursor.hide), t.once("keypress", i$1), () => {
|
|
518
|
-
t.off("keypress", i$1), e$1 && u$2.write(import_src$1.cursor.show), t.isTTY && !xD && t.setRawMode(!1), s.terminal = !1, s.close();
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
var AD = Object.defineProperty, pD = (t, u$2, F$1) => u$2 in t ? AD(t, u$2, {
|
|
522
|
-
enumerable: !0,
|
|
523
|
-
configurable: !0,
|
|
524
|
-
writable: !0,
|
|
525
|
-
value: F$1
|
|
526
|
-
}) : t[u$2] = F$1, h$1 = (t, u$2, F$1) => (pD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
527
|
-
var x = class {
|
|
528
|
-
constructor(u$2, F$1 = !0) {
|
|
529
|
-
h$1(this, "input"), h$1(this, "output"), h$1(this, "_abortSignal"), h$1(this, "rl"), h$1(this, "opts"), h$1(this, "_render"), h$1(this, "_track", !1), h$1(this, "_prevFrame", ""), h$1(this, "_subscribers", /* @__PURE__ */ new Map()), h$1(this, "_cursor", 0), h$1(this, "state", "initial"), h$1(this, "error", ""), h$1(this, "value");
|
|
530
|
-
const { input: e$1 = stdin, output: s = stdout, render: i$1, signal: D$1,...C$1 } = u$2;
|
|
531
|
-
this.opts = C$1, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i$1.bind(this), this._track = F$1, this._abortSignal = D$1, this.input = e$1, this.output = s;
|
|
532
|
-
}
|
|
533
|
-
unsubscribe() {
|
|
534
|
-
this._subscribers.clear();
|
|
535
|
-
}
|
|
536
|
-
setSubscriber(u$2, F$1) {
|
|
537
|
-
const e$1 = this._subscribers.get(u$2) ?? [];
|
|
538
|
-
e$1.push(F$1), this._subscribers.set(u$2, e$1);
|
|
539
|
-
}
|
|
540
|
-
on(u$2, F$1) {
|
|
541
|
-
this.setSubscriber(u$2, { cb: F$1 });
|
|
542
|
-
}
|
|
543
|
-
once(u$2, F$1) {
|
|
544
|
-
this.setSubscriber(u$2, {
|
|
545
|
-
cb: F$1,
|
|
546
|
-
once: !0
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
emit(u$2, ...F$1) {
|
|
550
|
-
const e$1 = this._subscribers.get(u$2) ?? [], s = [];
|
|
551
|
-
for (const i$1 of e$1) i$1.cb(...F$1), i$1.once && s.push(() => e$1.splice(e$1.indexOf(i$1), 1));
|
|
552
|
-
for (const i$1 of s) i$1();
|
|
553
|
-
}
|
|
554
|
-
prompt() {
|
|
555
|
-
return new Promise((u$2, F$1) => {
|
|
556
|
-
if (this._abortSignal) {
|
|
557
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u$2(S);
|
|
558
|
-
this._abortSignal.addEventListener("abort", () => {
|
|
559
|
-
this.state = "cancel", this.close();
|
|
560
|
-
}, { once: !0 });
|
|
561
|
-
}
|
|
562
|
-
const e$1 = new WriteStream(0);
|
|
563
|
-
e$1._write = (s, i$1, D$1) => {
|
|
564
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D$1();
|
|
565
|
-
}, this.input.pipe(e$1), this.rl = M.createInterface({
|
|
566
|
-
input: this.input,
|
|
567
|
-
output: e$1,
|
|
568
|
-
tabSize: 2,
|
|
569
|
-
prompt: "",
|
|
570
|
-
escapeCodeTimeout: 50
|
|
571
|
-
}), M.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d$1(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
572
|
-
this.output.write(import_src$1.cursor.show), this.output.off("resize", this.render), d$1(this.input, !1), u$2(this.value);
|
|
573
|
-
}), this.once("cancel", () => {
|
|
574
|
-
this.output.write(import_src$1.cursor.show), this.output.off("resize", this.render), d$1(this.input, !1), u$2(S);
|
|
575
|
-
});
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
onKeypress(u$2, F$1) {
|
|
579
|
-
if (this.state === "error" && (this.state = "active"), F$1?.name && (!this._track && c$1.aliases.has(F$1.name) && this.emit("cursor", c$1.aliases.get(F$1.name)), c$1.actions.has(F$1.name) && this.emit("cursor", F$1.name)), u$2 && (u$2.toLowerCase() === "y" || u$2.toLowerCase() === "n") && this.emit("confirm", u$2.toLowerCase() === "y"), u$2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$2 && this.emit("key", u$2.toLowerCase()), F$1?.name === "return") {
|
|
580
|
-
if (this.opts.validate) {
|
|
581
|
-
const e$1 = this.opts.validate(this.value);
|
|
582
|
-
e$1 && (this.error = e$1 instanceof Error ? e$1.message : e$1, this.state = "error", this.rl?.write(this.value));
|
|
583
|
-
}
|
|
584
|
-
this.state !== "error" && (this.state = "submit");
|
|
585
|
-
}
|
|
586
|
-
k$1([
|
|
587
|
-
u$2,
|
|
588
|
-
F$1?.name,
|
|
589
|
-
F$1?.sequence
|
|
590
|
-
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
591
|
-
}
|
|
592
|
-
close() {
|
|
593
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
594
|
-
`), d$1(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
595
|
-
}
|
|
596
|
-
restoreCursor() {
|
|
597
|
-
const u$2 = G(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
|
|
598
|
-
`).length - 1;
|
|
599
|
-
this.output.write(import_src$1.cursor.move(-999, u$2 * -1));
|
|
600
|
-
}
|
|
601
|
-
render() {
|
|
602
|
-
const u$2 = G(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
|
|
603
|
-
if (u$2 !== this._prevFrame) {
|
|
604
|
-
if (this.state === "initial") this.output.write(import_src$1.cursor.hide);
|
|
605
|
-
else {
|
|
606
|
-
const F$1 = lD(this._prevFrame, u$2);
|
|
607
|
-
if (this.restoreCursor(), F$1 && F$1?.length === 1) {
|
|
608
|
-
const e$1 = F$1[0];
|
|
609
|
-
this.output.write(import_src$1.cursor.move(0, e$1)), this.output.write(import_src$1.erase.lines(1));
|
|
610
|
-
const s = u$2.split(`
|
|
611
|
-
`);
|
|
612
|
-
this.output.write(s[e$1]), this._prevFrame = u$2, this.output.write(import_src$1.cursor.move(0, s.length - e$1 - 1));
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
if (F$1 && F$1?.length > 1) {
|
|
616
|
-
const e$1 = F$1[0];
|
|
617
|
-
this.output.write(import_src$1.cursor.move(0, e$1)), this.output.write(import_src$1.erase.down());
|
|
618
|
-
const s = u$2.split(`
|
|
619
|
-
`).slice(e$1);
|
|
620
|
-
this.output.write(s.join(`
|
|
621
|
-
`)), this._prevFrame = u$2;
|
|
622
|
-
return;
|
|
623
|
-
}
|
|
624
|
-
this.output.write(import_src$1.erase.down());
|
|
625
|
-
}
|
|
626
|
-
this.output.write(u$2), this.state === "initial" && (this.state = "active"), this._prevFrame = u$2;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
var fD = class extends x {
|
|
631
|
-
get cursor() {
|
|
632
|
-
return this.value ? 0 : 1;
|
|
633
|
-
}
|
|
634
|
-
get _value() {
|
|
635
|
-
return this.cursor === 0;
|
|
636
|
-
}
|
|
637
|
-
constructor(u$2) {
|
|
638
|
-
super(u$2, !1), this.value = !!u$2.initialValue, this.on("value", () => {
|
|
639
|
-
this.value = this._value;
|
|
640
|
-
}), this.on("confirm", (F$1) => {
|
|
641
|
-
this.output.write(import_src$1.cursor.move(0, -1)), this.value = F$1, this.state = "submit", this.close();
|
|
642
|
-
}), this.on("cursor", () => {
|
|
643
|
-
this.value = !this.value;
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
var gD = Object.defineProperty, vD = (t, u$2, F$1) => u$2 in t ? gD(t, u$2, {
|
|
648
|
-
enumerable: !0,
|
|
649
|
-
configurable: !0,
|
|
650
|
-
writable: !0,
|
|
651
|
-
value: F$1
|
|
652
|
-
}) : t[u$2] = F$1, K$1 = (t, u$2, F$1) => (vD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
653
|
-
let dD = class extends x {
|
|
654
|
-
constructor(u$2) {
|
|
655
|
-
super(u$2, !1), K$1(this, "options"), K$1(this, "cursor", 0);
|
|
656
|
-
const { options: F$1 } = u$2;
|
|
657
|
-
this.options = Object.entries(F$1).flatMap(([e$1, s]) => [{
|
|
658
|
-
value: e$1,
|
|
659
|
-
group: !0,
|
|
660
|
-
label: e$1
|
|
661
|
-
}, ...s.map((i$1) => ({
|
|
662
|
-
...i$1,
|
|
663
|
-
group: e$1
|
|
664
|
-
}))]), this.value = [...u$2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e$1 }) => e$1 === u$2.cursorAt), 0), this.on("cursor", (e$1) => {
|
|
665
|
-
switch (e$1) {
|
|
666
|
-
case "left":
|
|
667
|
-
case "up":
|
|
668
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
669
|
-
break;
|
|
670
|
-
case "down":
|
|
671
|
-
case "right":
|
|
672
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
673
|
-
break;
|
|
674
|
-
case "space":
|
|
675
|
-
this.toggleValue();
|
|
676
|
-
break;
|
|
677
|
-
}
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
getGroupItems(u$2) {
|
|
681
|
-
return this.options.filter((F$1) => F$1.group === u$2);
|
|
682
|
-
}
|
|
683
|
-
isGroupSelected(u$2) {
|
|
684
|
-
return this.getGroupItems(u$2).every((F$1) => this.value.includes(F$1.value));
|
|
685
|
-
}
|
|
686
|
-
toggleValue() {
|
|
687
|
-
const u$2 = this.options[this.cursor];
|
|
688
|
-
if (u$2.group === !0) {
|
|
689
|
-
const F$1 = u$2.value, e$1 = this.getGroupItems(F$1);
|
|
690
|
-
this.isGroupSelected(F$1) ? this.value = this.value.filter((s) => e$1.findIndex((i$1) => i$1.value === s) === -1) : this.value = [...this.value, ...e$1.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
691
|
-
} else this.value = this.value.includes(u$2.value) ? this.value.filter((e$1) => e$1 !== u$2.value) : [...this.value, u$2.value];
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
var bD = Object.defineProperty, mD = (t, u$2, F$1) => u$2 in t ? bD(t, u$2, {
|
|
695
|
-
enumerable: !0,
|
|
696
|
-
configurable: !0,
|
|
697
|
-
writable: !0,
|
|
698
|
-
value: F$1
|
|
699
|
-
}) : t[u$2] = F$1, Y$1 = (t, u$2, F$1) => (mD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
700
|
-
let wD = class extends x {
|
|
701
|
-
constructor(u$2) {
|
|
702
|
-
super(u$2, !1), Y$1(this, "options"), Y$1(this, "cursor", 0), this.options = u$2.options, this.value = [...u$2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F$1 }) => F$1 === u$2.cursorAt), 0), this.on("key", (F$1) => {
|
|
703
|
-
F$1 === "a" && this.toggleAll();
|
|
704
|
-
}), this.on("cursor", (F$1) => {
|
|
705
|
-
switch (F$1) {
|
|
706
|
-
case "left":
|
|
707
|
-
case "up":
|
|
708
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
709
|
-
break;
|
|
710
|
-
case "down":
|
|
711
|
-
case "right":
|
|
712
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
713
|
-
break;
|
|
714
|
-
case "space":
|
|
715
|
-
this.toggleValue();
|
|
716
|
-
break;
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
get _value() {
|
|
721
|
-
return this.options[this.cursor].value;
|
|
722
|
-
}
|
|
723
|
-
toggleAll() {
|
|
724
|
-
this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
|
|
725
|
-
}
|
|
726
|
-
toggleValue() {
|
|
727
|
-
this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
728
|
-
}
|
|
729
|
-
};
|
|
730
|
-
var yD = Object.defineProperty, _D = (t, u$2, F$1) => u$2 in t ? yD(t, u$2, {
|
|
731
|
-
enumerable: !0,
|
|
732
|
-
configurable: !0,
|
|
733
|
-
writable: !0,
|
|
734
|
-
value: F$1
|
|
735
|
-
}) : t[u$2] = F$1, Z = (t, u$2, F$1) => (_D(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
736
|
-
var kD = class extends x {
|
|
737
|
-
constructor({ mask: u$2,...F$1 }) {
|
|
738
|
-
super(F$1), Z(this, "valueWithCursor", ""), Z(this, "_mask", "•"), this._mask = u$2 ?? "•", this.on("finalize", () => {
|
|
739
|
-
this.valueWithCursor = this.masked;
|
|
740
|
-
}), this.on("value", () => {
|
|
741
|
-
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors$3.default.inverse(import_picocolors$3.default.hidden("_"))}`;
|
|
742
|
-
else {
|
|
743
|
-
const e$1 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
|
|
744
|
-
this.valueWithCursor = `${e$1}${import_picocolors$3.default.inverse(s[0])}${s.slice(1)}`;
|
|
745
|
-
}
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
get cursor() {
|
|
749
|
-
return this._cursor;
|
|
750
|
-
}
|
|
751
|
-
get masked() {
|
|
752
|
-
return this.value.replaceAll(/./g, this._mask);
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
var SD = Object.defineProperty, $D = (t, u$2, F$1) => u$2 in t ? SD(t, u$2, {
|
|
756
|
-
enumerable: !0,
|
|
757
|
-
configurable: !0,
|
|
758
|
-
writable: !0,
|
|
759
|
-
value: F$1
|
|
760
|
-
}) : t[u$2] = F$1, q$1 = (t, u$2, F$1) => ($D(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
761
|
-
var jD = class extends x {
|
|
762
|
-
constructor(u$2) {
|
|
763
|
-
super(u$2, !1), q$1(this, "options"), q$1(this, "cursor", 0), this.options = u$2.options, this.cursor = this.options.findIndex(({ value: F$1 }) => F$1 === u$2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F$1) => {
|
|
764
|
-
switch (F$1) {
|
|
765
|
-
case "left":
|
|
766
|
-
case "up":
|
|
767
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
768
|
-
break;
|
|
769
|
-
case "down":
|
|
770
|
-
case "right":
|
|
771
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
772
|
-
break;
|
|
773
|
-
}
|
|
774
|
-
this.changeValue();
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
get _value() {
|
|
778
|
-
return this.options[this.cursor];
|
|
779
|
-
}
|
|
780
|
-
changeValue() {
|
|
781
|
-
this.value = this._value.value;
|
|
782
|
-
}
|
|
783
|
-
};
|
|
784
|
-
var MD = Object.defineProperty, TD = (t, u$2, F$1) => u$2 in t ? MD(t, u$2, {
|
|
785
|
-
enumerable: !0,
|
|
786
|
-
configurable: !0,
|
|
787
|
-
writable: !0,
|
|
788
|
-
value: F$1
|
|
789
|
-
}) : t[u$2] = F$1, H = (t, u$2, F$1) => (TD(t, typeof u$2 != "symbol" ? u$2 + "" : u$2, F$1), F$1);
|
|
790
|
-
var OD = class extends x {
|
|
791
|
-
constructor(u$2) {
|
|
792
|
-
super(u$2, !1), H(this, "options"), H(this, "cursor", 0), this.options = u$2.options;
|
|
793
|
-
const F$1 = this.options.map(({ value: [e$1] }) => e$1?.toLowerCase());
|
|
794
|
-
this.cursor = Math.max(F$1.indexOf(u$2.initialValue), 0), this.on("key", (e$1) => {
|
|
795
|
-
if (!F$1.includes(e$1)) return;
|
|
796
|
-
const s = this.options.find(({ value: [i$1] }) => i$1?.toLowerCase() === e$1);
|
|
797
|
-
s && (this.value = s.value, this.state = "submit", this.emit("submit"));
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
var PD = class extends x {
|
|
802
|
-
get valueWithCursor() {
|
|
803
|
-
if (this.state === "submit") return this.value;
|
|
804
|
-
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
805
|
-
const u$2 = this.value.slice(0, this.cursor), [F$1, ...e$1] = this.value.slice(this.cursor);
|
|
806
|
-
return `${u$2}${import_picocolors$3.default.inverse(F$1)}${e$1.join("")}`;
|
|
807
|
-
}
|
|
808
|
-
get cursor() {
|
|
809
|
-
return this._cursor;
|
|
810
|
-
}
|
|
811
|
-
constructor(u$2) {
|
|
812
|
-
super(u$2), this.on("finalize", () => {
|
|
813
|
-
this.value || (this.value = u$2.defaultValue);
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
};
|
|
817
|
-
|
|
818
|
-
//#endregion
|
|
819
|
-
//#region ../../node_modules/.pnpm/@clack+prompts@0.10.0/node_modules/@clack/prompts/dist/index.mjs
|
|
820
|
-
var import_picocolors$2 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
821
|
-
var import_src = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
822
|
-
function ce() {
|
|
823
|
-
return g.platform !== "win32" ? g.env.TERM !== "linux" : !!g.env.CI || !!g.env.WT_SESSION || !!g.env.TERMINUS_SUBLIME || g.env.ConEmuTask === "{cmd::Cmder}" || g.env.TERM_PROGRAM === "Terminus-Sublime" || g.env.TERM_PROGRAM === "vscode" || g.env.TERM === "xterm-256color" || g.env.TERM === "alacritty" || g.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
824
|
-
}
|
|
825
|
-
const V = ce(), u$1 = (t, n$1) => V ? t : n$1, le = u$1("◆", "*"), L = u$1("■", "x"), W = u$1("▲", "x"), C = u$1("◇", "o"), ue = u$1("┌", "T"), o$1 = u$1("│", "|"), d = u$1("└", "—"), k = u$1("●", ">"), P = u$1("○", " "), A = u$1("◻", "[•]"), T = u$1("◼", "[+]"), F = u$1("◻", "[ ]"), $e = u$1("▪", "•"), _ = u$1("─", "-"), me = u$1("╮", "+"), de = u$1("├", "+"), pe = u$1("╯", "+"), q = u$1("●", "•"), D = u$1("◆", "*"), U = u$1("▲", "!"), K = u$1("■", "x"), w = (t) => {
|
|
826
|
-
switch (t) {
|
|
827
|
-
case "initial":
|
|
828
|
-
case "active": return import_picocolors$2.default.cyan(le);
|
|
829
|
-
case "cancel": return import_picocolors$2.default.red(L);
|
|
830
|
-
case "error": return import_picocolors$2.default.yellow(W);
|
|
831
|
-
case "submit": return import_picocolors$2.default.green(C);
|
|
832
|
-
}
|
|
833
|
-
}, B = (t) => {
|
|
834
|
-
const { cursor: n$1, options: s, style: r$1 } = t, i$1 = t.maxItems ?? Number.POSITIVE_INFINITY, a$1 = Math.max(process.stdout.rows - 4, 0), c$2 = Math.min(a$1, Math.max(i$1, 5));
|
|
835
|
-
let l$1 = 0;
|
|
836
|
-
n$1 >= l$1 + c$2 - 3 ? l$1 = Math.max(Math.min(n$1 - c$2 + 3, s.length - c$2), 0) : n$1 < l$1 + 2 && (l$1 = Math.max(n$1 - 2, 0));
|
|
837
|
-
const $$1 = c$2 < s.length && l$1 > 0, p$1 = c$2 < s.length && l$1 + c$2 < s.length;
|
|
838
|
-
return s.slice(l$1, l$1 + c$2).map((M$1, v$1, x$1) => {
|
|
839
|
-
const j = v$1 === 0 && $$1, E = v$1 === x$1.length - 1 && p$1;
|
|
840
|
-
return j || E ? import_picocolors$2.default.dim("...") : r$1(M$1, v$1 + l$1 === n$1);
|
|
841
|
-
});
|
|
842
|
-
}, he = (t) => new PD({
|
|
843
|
-
validate: t.validate,
|
|
844
|
-
placeholder: t.placeholder,
|
|
845
|
-
defaultValue: t.defaultValue,
|
|
846
|
-
initialValue: t.initialValue,
|
|
847
|
-
render() {
|
|
848
|
-
const n$1 = `${import_picocolors$2.default.gray(o$1)}
|
|
849
|
-
${w(this.state)} ${t.message}
|
|
850
|
-
`, s = t.placeholder ? import_picocolors$2.default.inverse(t.placeholder[0]) + import_picocolors$2.default.dim(t.placeholder.slice(1)) : import_picocolors$2.default.inverse(import_picocolors$2.default.hidden("_")), r$1 = this.value ? this.valueWithCursor : s;
|
|
851
|
-
switch (this.state) {
|
|
852
|
-
case "error": return `${n$1.trim()}
|
|
853
|
-
${import_picocolors$2.default.yellow(o$1)} ${r$1}
|
|
854
|
-
${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(this.error)}
|
|
855
|
-
`;
|
|
856
|
-
case "submit": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(this.value || t.placeholder)}`;
|
|
857
|
-
case "cancel": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
858
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
859
|
-
default: return `${n$1}${import_picocolors$2.default.cyan(o$1)} ${r$1}
|
|
860
|
-
${import_picocolors$2.default.cyan(d)}
|
|
861
|
-
`;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}).prompt(), ge = (t) => new kD({
|
|
865
|
-
validate: t.validate,
|
|
866
|
-
mask: t.mask ?? $e,
|
|
867
|
-
render() {
|
|
868
|
-
const n$1 = `${import_picocolors$2.default.gray(o$1)}
|
|
869
|
-
${w(this.state)} ${t.message}
|
|
870
|
-
`, s = this.valueWithCursor, r$1 = this.masked;
|
|
871
|
-
switch (this.state) {
|
|
872
|
-
case "error": return `${n$1.trim()}
|
|
873
|
-
${import_picocolors$2.default.yellow(o$1)} ${r$1}
|
|
874
|
-
${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(this.error)}
|
|
875
|
-
`;
|
|
876
|
-
case "submit": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(r$1)}`;
|
|
877
|
-
case "cancel": return `${n$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(r$1 ?? ""))}${r$1 ? `
|
|
878
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
879
|
-
default: return `${n$1}${import_picocolors$2.default.cyan(o$1)} ${s}
|
|
880
|
-
${import_picocolors$2.default.cyan(d)}
|
|
881
|
-
`;
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}).prompt(), ye = (t) => {
|
|
885
|
-
const n$1 = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
886
|
-
return new fD({
|
|
887
|
-
active: n$1,
|
|
888
|
-
inactive: s,
|
|
889
|
-
initialValue: t.initialValue ?? !0,
|
|
890
|
-
render() {
|
|
891
|
-
const r$1 = `${import_picocolors$2.default.gray(o$1)}
|
|
892
|
-
${w(this.state)} ${t.message}
|
|
893
|
-
`, i$1 = this.value ? n$1 : s;
|
|
894
|
-
switch (this.state) {
|
|
895
|
-
case "submit": return `${r$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(i$1)}`;
|
|
896
|
-
case "cancel": return `${r$1}${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}
|
|
897
|
-
${import_picocolors$2.default.gray(o$1)}`;
|
|
898
|
-
default: return `${r$1}${import_picocolors$2.default.cyan(o$1)} ${this.value ? `${import_picocolors$2.default.green(k)} ${n$1}` : `${import_picocolors$2.default.dim(P)} ${import_picocolors$2.default.dim(n$1)}`} ${import_picocolors$2.default.dim("/")} ${this.value ? `${import_picocolors$2.default.dim(P)} ${import_picocolors$2.default.dim(s)}` : `${import_picocolors$2.default.green(k)} ${s}`}
|
|
899
|
-
${import_picocolors$2.default.cyan(d)}
|
|
900
|
-
`;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}).prompt();
|
|
904
|
-
}, ve = (t) => {
|
|
905
|
-
const n$1 = (s, r$1) => {
|
|
906
|
-
const i$1 = s.label ?? String(s.value);
|
|
907
|
-
switch (r$1) {
|
|
908
|
-
case "selected": return `${import_picocolors$2.default.dim(i$1)}`;
|
|
909
|
-
case "active": return `${import_picocolors$2.default.green(k)} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}`;
|
|
910
|
-
case "cancelled": return `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}`;
|
|
911
|
-
default: return `${import_picocolors$2.default.dim(P)} ${import_picocolors$2.default.dim(i$1)}`;
|
|
912
|
-
}
|
|
913
|
-
};
|
|
914
|
-
return new jD({
|
|
915
|
-
options: t.options,
|
|
916
|
-
initialValue: t.initialValue,
|
|
917
|
-
render() {
|
|
918
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
919
|
-
${w(this.state)} ${t.message}
|
|
920
|
-
`;
|
|
921
|
-
switch (this.state) {
|
|
922
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options[this.cursor], "selected")}`;
|
|
923
|
-
case "cancel": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options[this.cursor], "cancelled")}
|
|
924
|
-
${import_picocolors$2.default.gray(o$1)}`;
|
|
925
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${B({
|
|
926
|
-
cursor: this.cursor,
|
|
927
|
-
options: this.options,
|
|
928
|
-
maxItems: t.maxItems,
|
|
929
|
-
style: (r$1, i$1) => n$1(r$1, i$1 ? "active" : "inactive")
|
|
930
|
-
}).join(`
|
|
931
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
932
|
-
${import_picocolors$2.default.cyan(d)}
|
|
933
|
-
`;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
}).prompt();
|
|
937
|
-
}, we = (t) => {
|
|
938
|
-
const n$1 = (s, r$1 = "inactive") => {
|
|
939
|
-
const i$1 = s.label ?? String(s.value);
|
|
940
|
-
return r$1 === "selected" ? `${import_picocolors$2.default.dim(i$1)}` : r$1 === "cancelled" ? `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}` : r$1 === "active" ? `${import_picocolors$2.default.bgCyan(import_picocolors$2.default.gray(` ${s.value} `))} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : `${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(` ${s.value} `)))} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}`;
|
|
941
|
-
};
|
|
942
|
-
return new OD({
|
|
943
|
-
options: t.options,
|
|
944
|
-
initialValue: t.initialValue,
|
|
945
|
-
render() {
|
|
946
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
947
|
-
${w(this.state)} ${t.message}
|
|
948
|
-
`;
|
|
949
|
-
switch (this.state) {
|
|
950
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options.find((r$1) => r$1.value === this.value) ?? t.options[0], "selected")}`;
|
|
951
|
-
case "cancel": return `${s}${import_picocolors$2.default.gray(o$1)} ${n$1(this.options[0], "cancelled")}
|
|
952
|
-
${import_picocolors$2.default.gray(o$1)}`;
|
|
953
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${this.options.map((r$1, i$1) => n$1(r$1, i$1 === this.cursor ? "active" : "inactive")).join(`
|
|
954
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
955
|
-
${import_picocolors$2.default.cyan(d)}
|
|
956
|
-
`;
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
}).prompt();
|
|
960
|
-
}, fe = (t) => {
|
|
961
|
-
const n$1 = (s, r$1) => {
|
|
962
|
-
const i$1 = s.label ?? String(s.value);
|
|
963
|
-
return r$1 === "active" ? `${import_picocolors$2.default.cyan(A)} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "selected" ? `${import_picocolors$2.default.green(T)} ${import_picocolors$2.default.dim(i$1)}` : r$1 === "cancelled" ? `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(i$1))}` : r$1 === "active-selected" ? `${import_picocolors$2.default.green(T)} ${i$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "submitted" ? `${import_picocolors$2.default.dim(i$1)}` : `${import_picocolors$2.default.dim(F)} ${import_picocolors$2.default.dim(i$1)}`;
|
|
964
|
-
};
|
|
965
|
-
return new wD({
|
|
966
|
-
options: t.options,
|
|
967
|
-
initialValues: t.initialValues,
|
|
968
|
-
required: t.required ?? !0,
|
|
969
|
-
cursorAt: t.cursorAt,
|
|
970
|
-
validate(s) {
|
|
971
|
-
if (this.required && s.length === 0) return `Please select at least one option.
|
|
972
|
-
${import_picocolors$2.default.reset(import_picocolors$2.default.dim(`Press ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" space ")))} to select, ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" enter ")))} to submit`))}`;
|
|
973
|
-
},
|
|
974
|
-
render() {
|
|
975
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
976
|
-
${w(this.state)} ${t.message}
|
|
977
|
-
`, r$1 = (i$1, a$1) => {
|
|
978
|
-
const c$2 = this.value.includes(i$1.value);
|
|
979
|
-
return a$1 && c$2 ? n$1(i$1, "active-selected") : c$2 ? n$1(i$1, "selected") : n$1(i$1, a$1 ? "active" : "inactive");
|
|
980
|
-
};
|
|
981
|
-
switch (this.state) {
|
|
982
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${this.options.filter(({ value: i$1 }) => this.value.includes(i$1)).map((i$1) => n$1(i$1, "submitted")).join(import_picocolors$2.default.dim(", ")) || import_picocolors$2.default.dim("none")}`;
|
|
983
|
-
case "cancel": {
|
|
984
|
-
const i$1 = this.options.filter(({ value: a$1 }) => this.value.includes(a$1)).map((a$1) => n$1(a$1, "cancelled")).join(import_picocolors$2.default.dim(", "));
|
|
985
|
-
return `${s}${import_picocolors$2.default.gray(o$1)} ${i$1.trim() ? `${i$1}
|
|
986
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
987
|
-
}
|
|
988
|
-
case "error": {
|
|
989
|
-
const i$1 = this.error.split(`
|
|
990
|
-
`).map((a$1, c$2) => c$2 === 0 ? `${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(a$1)}` : ` ${a$1}`).join(`
|
|
991
|
-
`);
|
|
992
|
-
return `${s + import_picocolors$2.default.yellow(o$1)} ${B({
|
|
993
|
-
options: this.options,
|
|
994
|
-
cursor: this.cursor,
|
|
995
|
-
maxItems: t.maxItems,
|
|
996
|
-
style: r$1
|
|
997
|
-
}).join(`
|
|
998
|
-
${import_picocolors$2.default.yellow(o$1)} `)}
|
|
999
|
-
${i$1}
|
|
1000
|
-
`;
|
|
1001
|
-
}
|
|
1002
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${B({
|
|
1003
|
-
options: this.options,
|
|
1004
|
-
cursor: this.cursor,
|
|
1005
|
-
maxItems: t.maxItems,
|
|
1006
|
-
style: r$1
|
|
1007
|
-
}).join(`
|
|
1008
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
1009
|
-
${import_picocolors$2.default.cyan(d)}
|
|
1010
|
-
`;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
}).prompt();
|
|
1014
|
-
}, be = (t) => {
|
|
1015
|
-
const n$1 = (s, r$1, i$1 = []) => {
|
|
1016
|
-
const a$1 = s.label ?? String(s.value), c$2 = typeof s.group == "string", l$1 = c$2 && (i$1[i$1.indexOf(s) + 1] ?? { group: !0 }), $$1 = c$2 && l$1.group === !0, p$1 = c$2 ? `${$$1 ? d : o$1} ` : "";
|
|
1017
|
-
return r$1 === "active" ? `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.cyan(A)} ${a$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "group-active" ? `${p$1}${import_picocolors$2.default.cyan(A)} ${import_picocolors$2.default.dim(a$1)}` : r$1 === "group-active-selected" ? `${p$1}${import_picocolors$2.default.green(T)} ${import_picocolors$2.default.dim(a$1)}` : r$1 === "selected" ? `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.green(T)} ${import_picocolors$2.default.dim(a$1)}` : r$1 === "cancelled" ? `${import_picocolors$2.default.strikethrough(import_picocolors$2.default.dim(a$1))}` : r$1 === "active-selected" ? `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.green(T)} ${a$1} ${s.hint ? import_picocolors$2.default.dim(`(${s.hint})`) : ""}` : r$1 === "submitted" ? `${import_picocolors$2.default.dim(a$1)}` : `${import_picocolors$2.default.dim(p$1)}${import_picocolors$2.default.dim(F)} ${import_picocolors$2.default.dim(a$1)}`;
|
|
1018
|
-
};
|
|
1019
|
-
return new dD({
|
|
1020
|
-
options: t.options,
|
|
1021
|
-
initialValues: t.initialValues,
|
|
1022
|
-
required: t.required ?? !0,
|
|
1023
|
-
cursorAt: t.cursorAt,
|
|
1024
|
-
validate(s) {
|
|
1025
|
-
if (this.required && s.length === 0) return `Please select at least one option.
|
|
1026
|
-
${import_picocolors$2.default.reset(import_picocolors$2.default.dim(`Press ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" space ")))} to select, ${import_picocolors$2.default.gray(import_picocolors$2.default.bgWhite(import_picocolors$2.default.inverse(" enter ")))} to submit`))}`;
|
|
1027
|
-
},
|
|
1028
|
-
render() {
|
|
1029
|
-
const s = `${import_picocolors$2.default.gray(o$1)}
|
|
1030
|
-
${w(this.state)} ${t.message}
|
|
1031
|
-
`;
|
|
1032
|
-
switch (this.state) {
|
|
1033
|
-
case "submit": return `${s}${import_picocolors$2.default.gray(o$1)} ${this.options.filter(({ value: r$1 }) => this.value.includes(r$1)).map((r$1) => n$1(r$1, "submitted")).join(import_picocolors$2.default.dim(", "))}`;
|
|
1034
|
-
case "cancel": {
|
|
1035
|
-
const r$1 = this.options.filter(({ value: i$1 }) => this.value.includes(i$1)).map((i$1) => n$1(i$1, "cancelled")).join(import_picocolors$2.default.dim(", "));
|
|
1036
|
-
return `${s}${import_picocolors$2.default.gray(o$1)} ${r$1.trim() ? `${r$1}
|
|
1037
|
-
${import_picocolors$2.default.gray(o$1)}` : ""}`;
|
|
1038
|
-
}
|
|
1039
|
-
case "error": {
|
|
1040
|
-
const r$1 = this.error.split(`
|
|
1041
|
-
`).map((i$1, a$1) => a$1 === 0 ? `${import_picocolors$2.default.yellow(d)} ${import_picocolors$2.default.yellow(i$1)}` : ` ${i$1}`).join(`
|
|
1042
|
-
`);
|
|
1043
|
-
return `${s}${import_picocolors$2.default.yellow(o$1)} ${this.options.map((i$1, a$1, c$2) => {
|
|
1044
|
-
const l$1 = this.value.includes(i$1.value) || i$1.group === !0 && this.isGroupSelected(`${i$1.value}`), $$1 = a$1 === this.cursor;
|
|
1045
|
-
return !$$1 && typeof i$1.group == "string" && this.options[this.cursor].value === i$1.group ? n$1(i$1, l$1 ? "group-active-selected" : "group-active", c$2) : $$1 && l$1 ? n$1(i$1, "active-selected", c$2) : l$1 ? n$1(i$1, "selected", c$2) : n$1(i$1, $$1 ? "active" : "inactive", c$2);
|
|
1046
|
-
}).join(`
|
|
1047
|
-
${import_picocolors$2.default.yellow(o$1)} `)}
|
|
1048
|
-
${r$1}
|
|
1049
|
-
`;
|
|
1050
|
-
}
|
|
1051
|
-
default: return `${s}${import_picocolors$2.default.cyan(o$1)} ${this.options.map((r$1, i$1, a$1) => {
|
|
1052
|
-
const c$2 = this.value.includes(r$1.value) || r$1.group === !0 && this.isGroupSelected(`${r$1.value}`), l$1 = i$1 === this.cursor;
|
|
1053
|
-
return !l$1 && typeof r$1.group == "string" && this.options[this.cursor].value === r$1.group ? n$1(r$1, c$2 ? "group-active-selected" : "group-active", a$1) : l$1 && c$2 ? n$1(r$1, "active-selected", a$1) : c$2 ? n$1(r$1, "selected", a$1) : n$1(r$1, l$1 ? "active" : "inactive", a$1);
|
|
1054
|
-
}).join(`
|
|
1055
|
-
${import_picocolors$2.default.cyan(o$1)} `)}
|
|
1056
|
-
${import_picocolors$2.default.cyan(d)}
|
|
1057
|
-
`;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
}).prompt();
|
|
1061
|
-
}, Me = (t = "", n$1 = "") => {
|
|
1062
|
-
const s = `
|
|
1063
|
-
${t}
|
|
1064
|
-
`.split(`
|
|
1065
|
-
`), r$1 = stripVTControlCharacters(n$1).length, i$1 = Math.max(s.reduce((c$2, l$1) => {
|
|
1066
|
-
const $$1 = stripVTControlCharacters(l$1);
|
|
1067
|
-
return $$1.length > c$2 ? $$1.length : c$2;
|
|
1068
|
-
}, 0), r$1) + 2, a$1 = s.map((c$2) => `${import_picocolors$2.default.gray(o$1)} ${import_picocolors$2.default.dim(c$2)}${" ".repeat(i$1 - stripVTControlCharacters(c$2).length)}${import_picocolors$2.default.gray(o$1)}`).join(`
|
|
1069
|
-
`);
|
|
1070
|
-
process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1071
|
-
${import_picocolors$2.default.green(C)} ${import_picocolors$2.default.reset(n$1)} ${import_picocolors$2.default.gray(_.repeat(Math.max(i$1 - r$1 - 1, 1)) + me)}
|
|
1072
|
-
${a$1}
|
|
1073
|
-
${import_picocolors$2.default.gray(de + _.repeat(i$1 + 2) + pe)}
|
|
1074
|
-
`);
|
|
1075
|
-
}, xe = (t = "") => {
|
|
1076
|
-
process.stdout.write(`${import_picocolors$2.default.gray(d)} ${import_picocolors$2.default.red(t)}
|
|
1077
|
-
|
|
1078
|
-
`);
|
|
1079
|
-
}, Ie = (t = "") => {
|
|
1080
|
-
process.stdout.write(`${import_picocolors$2.default.gray(ue)} ${t}
|
|
1081
|
-
`);
|
|
1082
|
-
}, Se = (t = "") => {
|
|
1083
|
-
process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1084
|
-
${import_picocolors$2.default.gray(d)} ${t}
|
|
1085
|
-
|
|
1086
|
-
`);
|
|
1087
|
-
}, f = {
|
|
1088
|
-
message: (t = "", { symbol: n$1 = import_picocolors$2.default.gray(o$1) } = {}) => {
|
|
1089
|
-
const s = [`${import_picocolors$2.default.gray(o$1)}`];
|
|
1090
|
-
if (t) {
|
|
1091
|
-
const [r$1, ...i$1] = t.split(`
|
|
1092
|
-
`);
|
|
1093
|
-
s.push(`${n$1} ${r$1}`, ...i$1.map((a$1) => `${import_picocolors$2.default.gray(o$1)} ${a$1}`));
|
|
1094
|
-
}
|
|
1095
|
-
process.stdout.write(`${s.join(`
|
|
1096
|
-
`)}
|
|
1097
|
-
`);
|
|
1098
|
-
},
|
|
1099
|
-
info: (t) => {
|
|
1100
|
-
f.message(t, { symbol: import_picocolors$2.default.blue(q) });
|
|
1101
|
-
},
|
|
1102
|
-
success: (t) => {
|
|
1103
|
-
f.message(t, { symbol: import_picocolors$2.default.green(D) });
|
|
1104
|
-
},
|
|
1105
|
-
step: (t) => {
|
|
1106
|
-
f.message(t, { symbol: import_picocolors$2.default.green(C) });
|
|
1107
|
-
},
|
|
1108
|
-
warn: (t) => {
|
|
1109
|
-
f.message(t, { symbol: import_picocolors$2.default.yellow(U) });
|
|
1110
|
-
},
|
|
1111
|
-
warning: (t) => {
|
|
1112
|
-
f.warn(t);
|
|
1113
|
-
},
|
|
1114
|
-
error: (t) => {
|
|
1115
|
-
f.message(t, { symbol: import_picocolors$2.default.red(K) });
|
|
1116
|
-
}
|
|
1117
|
-
}, J = `${import_picocolors$2.default.gray(o$1)} `, b = {
|
|
1118
|
-
message: async (t, { symbol: n$1 = import_picocolors$2.default.gray(o$1) } = {}) => {
|
|
1119
|
-
process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1120
|
-
${n$1} `);
|
|
1121
|
-
let s = 3;
|
|
1122
|
-
for await (let r$1 of t) {
|
|
1123
|
-
r$1 = r$1.replace(/\n/g, `
|
|
1124
|
-
${J}`), r$1.includes(`
|
|
1125
|
-
`) && (s = 3 + stripVTControlCharacters(r$1.slice(r$1.lastIndexOf(`
|
|
1126
|
-
`))).length);
|
|
1127
|
-
const i$1 = stripVTControlCharacters(r$1).length;
|
|
1128
|
-
s + i$1 < process.stdout.columns ? (s += i$1, process.stdout.write(r$1)) : (process.stdout.write(`
|
|
1129
|
-
${J}${r$1.trimStart()}`), s = 3 + stripVTControlCharacters(r$1.trimStart()).length);
|
|
1130
|
-
}
|
|
1131
|
-
process.stdout.write(`
|
|
1132
|
-
`);
|
|
1133
|
-
},
|
|
1134
|
-
info: (t) => b.message(t, { symbol: import_picocolors$2.default.blue(q) }),
|
|
1135
|
-
success: (t) => b.message(t, { symbol: import_picocolors$2.default.green(D) }),
|
|
1136
|
-
step: (t) => b.message(t, { symbol: import_picocolors$2.default.green(C) }),
|
|
1137
|
-
warn: (t) => b.message(t, { symbol: import_picocolors$2.default.yellow(U) }),
|
|
1138
|
-
warning: (t) => b.warn(t),
|
|
1139
|
-
error: (t) => b.message(t, { symbol: import_picocolors$2.default.red(K) })
|
|
1140
|
-
}, Y = ({ indicator: t = "dots" } = {}) => {
|
|
1141
|
-
const n$1 = V ? [
|
|
1142
|
-
"◒",
|
|
1143
|
-
"◐",
|
|
1144
|
-
"◓",
|
|
1145
|
-
"◑"
|
|
1146
|
-
] : [
|
|
1147
|
-
"•",
|
|
1148
|
-
"o",
|
|
1149
|
-
"O",
|
|
1150
|
-
"0"
|
|
1151
|
-
], s = V ? 80 : 120, r$1 = process.env.CI === "true";
|
|
1152
|
-
let i$1, a$1, c$2 = !1, l$1 = "", $$1, p$1 = performance.now();
|
|
1153
|
-
const M$1 = (m$1) => {
|
|
1154
|
-
c$2 && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
|
|
1155
|
-
}, v$1 = () => M$1(2), x$1 = () => M$1(1), j = () => {
|
|
1156
|
-
process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", x$1), process.on("SIGTERM", x$1), process.on("exit", M$1);
|
|
1157
|
-
}, E = () => {
|
|
1158
|
-
process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT", x$1), process.removeListener("SIGTERM", x$1), process.removeListener("exit", M$1);
|
|
1159
|
-
}, O$1 = () => {
|
|
1160
|
-
if ($$1 === void 0) return;
|
|
1161
|
-
r$1 && process.stdout.write(`
|
|
1162
|
-
`);
|
|
1163
|
-
const m$1 = $$1.split(`
|
|
1164
|
-
`);
|
|
1165
|
-
process.stdout.write(import_src.cursor.move(-999, m$1.length - 1)), process.stdout.write(import_src.erase.down(m$1.length));
|
|
1166
|
-
}, R$1 = (m$1) => m$1.replace(/\.+$/, ""), G$1 = (m$1) => {
|
|
1167
|
-
const h$2 = (performance.now() - m$1) / 1e3, y$1 = Math.floor(h$2 / 60), I$1 = Math.floor(h$2 % 60);
|
|
1168
|
-
return y$1 > 0 ? `[${y$1}m ${I$1}s]` : `[${I$1}s]`;
|
|
1169
|
-
}, H$1 = (m$1 = "") => {
|
|
1170
|
-
c$2 = !0, i$1 = cD(), l$1 = R$1(m$1), p$1 = performance.now(), process.stdout.write(`${import_picocolors$2.default.gray(o$1)}
|
|
1171
|
-
`);
|
|
1172
|
-
let h$2 = 0, y$1 = 0;
|
|
1173
|
-
j(), a$1 = setInterval(() => {
|
|
1174
|
-
if (r$1 && l$1 === $$1) return;
|
|
1175
|
-
O$1(), $$1 = l$1;
|
|
1176
|
-
const I$1 = import_picocolors$2.default.magenta(n$1[h$2]);
|
|
1177
|
-
if (r$1) process.stdout.write(`${I$1} ${l$1}...`);
|
|
1178
|
-
else if (t === "timer") process.stdout.write(`${I$1} ${l$1} ${G$1(p$1)}`);
|
|
1179
|
-
else {
|
|
1180
|
-
const z$1 = ".".repeat(Math.floor(y$1)).slice(0, 3);
|
|
1181
|
-
process.stdout.write(`${I$1} ${l$1}${z$1}`);
|
|
1182
|
-
}
|
|
1183
|
-
h$2 = h$2 + 1 < n$1.length ? h$2 + 1 : 0, y$1 = y$1 < n$1.length ? y$1 + .125 : 0;
|
|
1184
|
-
}, s);
|
|
1185
|
-
}, N$1 = (m$1 = "", h$2 = 0) => {
|
|
1186
|
-
c$2 = !1, clearInterval(a$1), O$1();
|
|
1187
|
-
const y$1 = h$2 === 0 ? import_picocolors$2.default.green(C) : h$2 === 1 ? import_picocolors$2.default.red(L) : import_picocolors$2.default.red(W);
|
|
1188
|
-
l$1 = R$1(m$1 ?? l$1), t === "timer" ? process.stdout.write(`${y$1} ${l$1} ${G$1(p$1)}
|
|
1189
|
-
`) : process.stdout.write(`${y$1} ${l$1}
|
|
1190
|
-
`), E(), i$1();
|
|
1191
|
-
};
|
|
1192
|
-
return {
|
|
1193
|
-
start: H$1,
|
|
1194
|
-
stop: N$1,
|
|
1195
|
-
message: (m$1 = "") => {
|
|
1196
|
-
l$1 = R$1(m$1 ?? l$1);
|
|
1197
|
-
}
|
|
1198
|
-
};
|
|
1199
|
-
}, Ce = async (t, n$1) => {
|
|
1200
|
-
const s = {}, r$1 = Object.keys(t);
|
|
1201
|
-
for (const i$1 of r$1) {
|
|
1202
|
-
const a$1 = t[i$1], c$2 = await a$1({ results: s })?.catch((l$1) => {
|
|
1203
|
-
throw l$1;
|
|
1204
|
-
});
|
|
1205
|
-
if (typeof n$1?.onCancel == "function" && BD(c$2)) {
|
|
1206
|
-
s[i$1] = "canceled", n$1.onCancel({ results: s });
|
|
1207
|
-
continue;
|
|
1208
|
-
}
|
|
1209
|
-
s[i$1] = c$2;
|
|
1210
|
-
}
|
|
1211
|
-
return s;
|
|
1212
|
-
}, Te = async (t) => {
|
|
1213
|
-
for (const n$1 of t) {
|
|
1214
|
-
if (n$1.enabled === !1) continue;
|
|
1215
|
-
const s = Y();
|
|
1216
|
-
s.start(n$1.title);
|
|
1217
|
-
const r$1 = await n$1.task(s.message);
|
|
1218
|
-
s.stop(r$1 || n$1.title);
|
|
1219
|
-
}
|
|
1220
|
-
};
|
|
1221
|
-
|
|
1222
57
|
//#endregion
|
|
1223
58
|
//#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
|
|
1224
59
|
function isPlainObject$1(value) {
|
|
@@ -1378,20 +213,20 @@ const parseExpression = (expression) => {
|
|
|
1378
213
|
if (expression instanceof ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");
|
|
1379
214
|
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
1380
215
|
};
|
|
1381
|
-
const getSubprocessResult = ({ stdout
|
|
1382
|
-
if (typeof stdout
|
|
1383
|
-
if (isUint8Array(stdout
|
|
1384
|
-
if (stdout
|
|
1385
|
-
throw new TypeError(`Unexpected "${typeof stdout
|
|
216
|
+
const getSubprocessResult = ({ stdout }) => {
|
|
217
|
+
if (typeof stdout === "string") return stdout;
|
|
218
|
+
if (isUint8Array(stdout)) return uint8ArrayToString(stdout);
|
|
219
|
+
if (stdout === void 0) throw new TypeError("Missing result.stdout in template expression. This is probably due to the previous subprocess' \"stdout\" option.");
|
|
220
|
+
throw new TypeError(`Unexpected "${typeof stdout}" stdout in template expression`);
|
|
1386
221
|
};
|
|
1387
222
|
|
|
1388
223
|
//#endregion
|
|
1389
224
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/standard-stream.js
|
|
1390
225
|
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
1391
226
|
const STANDARD_STREAMS = [
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
227
|
+
process$1.stdin,
|
|
228
|
+
process$1.stdout,
|
|
229
|
+
process$1.stderr
|
|
1395
230
|
];
|
|
1396
231
|
const STANDARD_STREAMS_ALIASES = [
|
|
1397
232
|
"stdin",
|
|
@@ -1516,10 +351,10 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
1516
351
|
//#endregion
|
|
1517
352
|
//#region ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
1518
353
|
function isUnicodeSupported() {
|
|
1519
|
-
const { env
|
|
1520
|
-
const { TERM, TERM_PROGRAM } = env
|
|
1521
|
-
if (
|
|
1522
|
-
return Boolean(env
|
|
354
|
+
const { env } = process$1;
|
|
355
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
356
|
+
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
357
|
+
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1523
358
|
}
|
|
1524
359
|
|
|
1525
360
|
//#endregion
|
|
@@ -2059,11 +894,11 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
|
|
|
2059
894
|
var gid = stat.gid;
|
|
2060
895
|
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
2061
896
|
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
2062
|
-
var u$
|
|
2063
|
-
var g
|
|
2064
|
-
var o$
|
|
2065
|
-
var ug = u$
|
|
2066
|
-
return mod & o$
|
|
897
|
+
var u$1 = parseInt("100", 8);
|
|
898
|
+
var g = parseInt("010", 8);
|
|
899
|
+
var o$1 = parseInt("001", 8);
|
|
900
|
+
var ug = u$1 | g;
|
|
901
|
+
return mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
|
|
2067
902
|
}
|
|
2068
903
|
}) });
|
|
2069
904
|
|
|
@@ -2202,7 +1037,7 @@ var require_resolveCommand = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
2202
1037
|
const which = require_which();
|
|
2203
1038
|
const getPathKey = require_path_key();
|
|
2204
1039
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
2205
|
-
const env
|
|
1040
|
+
const env = parsed.options.env || process.env;
|
|
2206
1041
|
const cwd = process.cwd();
|
|
2207
1042
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
2208
1043
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
@@ -2212,10 +1047,10 @@ var require_resolveCommand = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
|
|
|
2212
1047
|
let resolved;
|
|
2213
1048
|
try {
|
|
2214
1049
|
resolved = which.sync(parsed.command, {
|
|
2215
|
-
path: env
|
|
1050
|
+
path: env[getPathKey({ env })],
|
|
2216
1051
|
pathExt: withoutPathExt ? path$3.delimiter : void 0
|
|
2217
1052
|
});
|
|
2218
|
-
} catch (e
|
|
1053
|
+
} catch (e) {} finally {
|
|
2219
1054
|
if (shouldSwitchCwd) process.chdir(cwd);
|
|
2220
1055
|
}
|
|
2221
1056
|
if (resolved) resolved = path$3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
@@ -2281,7 +1116,7 @@ var require_readShebang = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
2281
1116
|
fd = fs$2.openSync(command, "r");
|
|
2282
1117
|
fs$2.readSync(fd, buffer, 0, size, 0);
|
|
2283
1118
|
fs$2.closeSync(fd);
|
|
2284
|
-
} catch (e
|
|
1119
|
+
} catch (e) {}
|
|
2285
1120
|
return shebangCommand(buffer.toString());
|
|
2286
1121
|
}
|
|
2287
1122
|
module.exports = readShebang$1;
|
|
@@ -2418,9 +1253,9 @@ var require_cross_spawn = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
2418
1253
|
//#region ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
2419
1254
|
var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
|
|
2420
1255
|
function pathKey(options = {}) {
|
|
2421
|
-
const { env
|
|
1256
|
+
const { env = process.env, platform: platform$1 = process.platform } = options;
|
|
2422
1257
|
if (platform$1 !== "win32") return "PATH";
|
|
2423
|
-
return Object.keys(env
|
|
1258
|
+
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
2424
1259
|
}
|
|
2425
1260
|
|
|
2426
1261
|
//#endregion
|
|
@@ -2444,7 +1279,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
2444
1279
|
|
|
2445
1280
|
//#endregion
|
|
2446
1281
|
//#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
2447
|
-
const npmRunPath = ({ cwd =
|
|
1282
|
+
const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
|
|
2448
1283
|
const cwdPath = path.resolve(toPath(cwd));
|
|
2449
1284
|
const result = [];
|
|
2450
1285
|
const pathParts = pathOption.split(path.delimiter);
|
|
@@ -2462,12 +1297,12 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
|
2462
1297
|
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
2463
1298
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
2464
1299
|
};
|
|
2465
|
-
const npmRunPathEnv = ({ env
|
|
2466
|
-
env
|
|
2467
|
-
const pathName = pathKey({ env
|
|
2468
|
-
options.path = env
|
|
2469
|
-
env
|
|
2470
|
-
return env
|
|
1300
|
+
const npmRunPathEnv = ({ env = process$1.env,...options } = {}) => {
|
|
1301
|
+
env = { ...env };
|
|
1302
|
+
const pathName = pathKey({ env });
|
|
1303
|
+
options.path = env[pathName];
|
|
1304
|
+
env[pathName] = npmRunPath(options);
|
|
1305
|
+
return env;
|
|
2471
1306
|
};
|
|
2472
1307
|
|
|
2473
1308
|
//#endregion
|
|
@@ -3071,15 +1906,15 @@ const getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) =>
|
|
|
3071
1906
|
return `The "${optionName}: ${serializeOptionValue(optionValue)}" option is incompatible with using "${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}".
|
|
3072
1907
|
Please set this option with "pipe" instead.`;
|
|
3073
1908
|
};
|
|
3074
|
-
const getInvalidStdioOption = (fdNumber, { stdin
|
|
1909
|
+
const getInvalidStdioOption = (fdNumber, { stdin, stdout, stderr, stdio }) => {
|
|
3075
1910
|
const usedDescriptor = getUsedDescriptor(fdNumber);
|
|
3076
|
-
if (usedDescriptor === 0 && stdin
|
|
1911
|
+
if (usedDescriptor === 0 && stdin !== void 0) return {
|
|
3077
1912
|
optionName: "stdin",
|
|
3078
|
-
optionValue: stdin
|
|
1913
|
+
optionValue: stdin
|
|
3079
1914
|
};
|
|
3080
|
-
if (usedDescriptor === 1 && stdout
|
|
1915
|
+
if (usedDescriptor === 1 && stdout !== void 0) return {
|
|
3081
1916
|
optionName: "stdout",
|
|
3082
|
-
optionValue: stdout
|
|
1917
|
+
optionValue: stdout
|
|
3083
1918
|
};
|
|
3084
1919
|
if (usedDescriptor === 2 && stderr !== void 0) return {
|
|
3085
1920
|
optionName: "stderr",
|
|
@@ -3597,7 +2432,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
|
3597
2432
|
};
|
|
3598
2433
|
const getDefaultCwd = () => {
|
|
3599
2434
|
try {
|
|
3600
|
-
return
|
|
2435
|
+
return process$1.cwd();
|
|
3601
2436
|
} catch (error) {
|
|
3602
2437
|
error.message = `The current directory does not exist.\n${error.message}`;
|
|
3603
2438
|
throw error;
|
|
@@ -3632,7 +2467,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
3632
2467
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
3633
2468
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
3634
2469
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
3635
|
-
if (
|
|
2470
|
+
if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
3636
2471
|
return {
|
|
3637
2472
|
file,
|
|
3638
2473
|
commandArguments,
|
|
@@ -3658,18 +2493,18 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
|
|
|
3658
2493
|
serialization
|
|
3659
2494
|
});
|
|
3660
2495
|
const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
3661
|
-
const env
|
|
3662
|
-
...
|
|
2496
|
+
const env = extendEnv ? {
|
|
2497
|
+
...process$1.env,
|
|
3663
2498
|
...envOption
|
|
3664
2499
|
} : envOption;
|
|
3665
2500
|
if (preferLocal || node) return npmRunPathEnv({
|
|
3666
|
-
env
|
|
2501
|
+
env,
|
|
3667
2502
|
cwd: localDirectory,
|
|
3668
2503
|
execPath: nodePath,
|
|
3669
2504
|
preferLocal,
|
|
3670
2505
|
addExecPath: node
|
|
3671
2506
|
});
|
|
3672
|
-
return env
|
|
2507
|
+
return env;
|
|
3673
2508
|
};
|
|
3674
2509
|
|
|
3675
2510
|
//#endregion
|
|
@@ -3712,15 +2547,15 @@ var c = class {
|
|
|
3712
2547
|
#n;
|
|
3713
2548
|
#r = !1;
|
|
3714
2549
|
#e = void 0;
|
|
3715
|
-
constructor(e
|
|
3716
|
-
this.#t = e
|
|
2550
|
+
constructor(e, t) {
|
|
2551
|
+
this.#t = e, this.#n = t;
|
|
3717
2552
|
}
|
|
3718
2553
|
next() {
|
|
3719
|
-
const e
|
|
3720
|
-
return this.#e = this.#e ? this.#e.then(e
|
|
2554
|
+
const e = () => this.#s();
|
|
2555
|
+
return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;
|
|
3721
2556
|
}
|
|
3722
|
-
return(e
|
|
3723
|
-
const t = () => this.#i(e
|
|
2557
|
+
return(e) {
|
|
2558
|
+
const t = () => this.#i(e);
|
|
3724
2559
|
return this.#e ? this.#e.then(t, t) : t();
|
|
3725
2560
|
}
|
|
3726
2561
|
async #s() {
|
|
@@ -3728,29 +2563,29 @@ var c = class {
|
|
|
3728
2563
|
done: !0,
|
|
3729
2564
|
value: void 0
|
|
3730
2565
|
};
|
|
3731
|
-
let e
|
|
2566
|
+
let e;
|
|
3732
2567
|
try {
|
|
3733
|
-
e
|
|
2568
|
+
e = await this.#t.read();
|
|
3734
2569
|
} catch (t) {
|
|
3735
2570
|
throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t;
|
|
3736
2571
|
}
|
|
3737
|
-
return e
|
|
2572
|
+
return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;
|
|
3738
2573
|
}
|
|
3739
|
-
async #i(e
|
|
2574
|
+
async #i(e) {
|
|
3740
2575
|
if (this.#r) return {
|
|
3741
2576
|
done: !0,
|
|
3742
|
-
value: e
|
|
2577
|
+
value: e
|
|
3743
2578
|
};
|
|
3744
2579
|
if (this.#r = !0, !this.#n) {
|
|
3745
|
-
const t = this.#t.cancel(e
|
|
2580
|
+
const t = this.#t.cancel(e);
|
|
3746
2581
|
return this.#t.releaseLock(), await t, {
|
|
3747
2582
|
done: !0,
|
|
3748
|
-
value: e
|
|
2583
|
+
value: e
|
|
3749
2584
|
};
|
|
3750
2585
|
}
|
|
3751
2586
|
return this.#t.releaseLock(), {
|
|
3752
2587
|
done: !0,
|
|
3753
|
-
value: e
|
|
2588
|
+
value: e
|
|
3754
2589
|
};
|
|
3755
2590
|
}
|
|
3756
2591
|
};
|
|
@@ -3759,8 +2594,8 @@ function i() {
|
|
|
3759
2594
|
return this[n].next();
|
|
3760
2595
|
}
|
|
3761
2596
|
Object.defineProperty(i, "name", { value: "next" });
|
|
3762
|
-
function o(r
|
|
3763
|
-
return this[n].return(r
|
|
2597
|
+
function o(r) {
|
|
2598
|
+
return this[n].return(r);
|
|
3764
2599
|
}
|
|
3765
2600
|
Object.defineProperty(o, "name", { value: "return" });
|
|
3766
2601
|
const u = Object.create(a, {
|
|
@@ -3777,8 +2612,8 @@ const u = Object.create(a, {
|
|
|
3777
2612
|
value: o
|
|
3778
2613
|
}
|
|
3779
2614
|
});
|
|
3780
|
-
function h({ preventCancel: r
|
|
3781
|
-
const t = new c(this.getReader(), r
|
|
2615
|
+
function h({ preventCancel: r = !1 } = {}) {
|
|
2616
|
+
const t = new c(this.getReader(), r), s = Object.create(u);
|
|
3782
2617
|
return s[n] = t, s;
|
|
3783
2618
|
}
|
|
3784
2619
|
|
|
@@ -4647,12 +3482,12 @@ const guessStreamDirection = {
|
|
|
4647
3482
|
}
|
|
4648
3483
|
};
|
|
4649
3484
|
const getStandardStreamDirection = (value) => {
|
|
4650
|
-
if ([0,
|
|
3485
|
+
if ([0, process$1.stdin].includes(value)) return "input";
|
|
4651
3486
|
if ([
|
|
4652
3487
|
1,
|
|
4653
3488
|
2,
|
|
4654
|
-
|
|
4655
|
-
|
|
3489
|
+
process$1.stdout,
|
|
3490
|
+
process$1.stderr
|
|
4656
3491
|
].includes(value)) return "output";
|
|
4657
3492
|
};
|
|
4658
3493
|
const DEFAULT_DIRECTION = "output";
|
|
@@ -4677,7 +3512,7 @@ const getStdioArray = (stdio, options) => {
|
|
|
4677
3512
|
];
|
|
4678
3513
|
if (!Array.isArray(stdio)) throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
4679
3514
|
const length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length);
|
|
4680
|
-
return Array.from({ length }, (_
|
|
3515
|
+
return Array.from({ length }, (_, fdNumber) => stdio[fdNumber]);
|
|
4681
3516
|
};
|
|
4682
3517
|
const hasAlias = (options) => STANDARD_STREAMS_ALIASES.some((alias) => options[alias] !== void 0);
|
|
4683
3518
|
const addDefaultValue = (stdioOption, fdNumber) => {
|
|
@@ -5410,14 +4245,14 @@ const writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
|
5410
4245
|
|
|
5411
4246
|
//#endregion
|
|
5412
4247
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/all-sync.js
|
|
5413
|
-
const getAllSync = ([, stdout
|
|
4248
|
+
const getAllSync = ([, stdout, stderr], options) => {
|
|
5414
4249
|
if (!options.all) return;
|
|
5415
|
-
if (stdout
|
|
5416
|
-
if (stderr === void 0) return stdout
|
|
5417
|
-
if (Array.isArray(stdout
|
|
5418
|
-
if (Array.isArray(stderr)) return [stripNewline(stdout
|
|
5419
|
-
if (isUint8Array(stdout
|
|
5420
|
-
return `${stdout
|
|
4250
|
+
if (stdout === void 0) return stderr;
|
|
4251
|
+
if (stderr === void 0) return stdout;
|
|
4252
|
+
if (Array.isArray(stdout)) return Array.isArray(stderr) ? [...stdout, ...stderr] : [...stdout, stripNewline(stderr, options, "all")];
|
|
4253
|
+
if (Array.isArray(stderr)) return [stripNewline(stdout, options, "all"), ...stderr];
|
|
4254
|
+
if (isUint8Array(stdout) && isUint8Array(stderr)) return concatUint8Arrays([stdout, stderr]);
|
|
4255
|
+
return `${stdout}${stderr}`;
|
|
5421
4256
|
};
|
|
5422
4257
|
|
|
5423
4258
|
//#endregion
|
|
@@ -5716,9 +4551,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
|
|
|
5716
4551
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
5717
4552
|
};
|
|
5718
4553
|
const getIpcExport = () => {
|
|
5719
|
-
const anyProcess =
|
|
4554
|
+
const anyProcess = process$1;
|
|
5720
4555
|
const isSubprocess = true;
|
|
5721
|
-
const ipc =
|
|
4556
|
+
const ipc = process$1.channel !== void 0;
|
|
5722
4557
|
return {
|
|
5723
4558
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
5724
4559
|
getCancelSignal: getCancelSignal$1.bind(void 0, {
|
|
@@ -5775,20 +4610,20 @@ const handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, opt
|
|
|
5775
4610
|
};
|
|
5776
4611
|
};
|
|
5777
4612
|
const createDummyStreams = (subprocess, fileDescriptors) => {
|
|
5778
|
-
const stdin
|
|
5779
|
-
const stdout
|
|
4613
|
+
const stdin = createDummyStream();
|
|
4614
|
+
const stdout = createDummyStream();
|
|
5780
4615
|
const stderr = createDummyStream();
|
|
5781
4616
|
const extraStdio = Array.from({ length: fileDescriptors.length - 3 }, createDummyStream);
|
|
5782
4617
|
const all = createDummyStream();
|
|
5783
4618
|
const stdio = [
|
|
5784
|
-
stdin
|
|
5785
|
-
stdout
|
|
4619
|
+
stdin,
|
|
4620
|
+
stdout,
|
|
5786
4621
|
stderr,
|
|
5787
4622
|
...extraStdio
|
|
5788
4623
|
];
|
|
5789
4624
|
Object.assign(subprocess, {
|
|
5790
|
-
stdin
|
|
5791
|
-
stdout
|
|
4625
|
+
stdin,
|
|
4626
|
+
stdout,
|
|
5792
4627
|
stderr,
|
|
5793
4628
|
all,
|
|
5794
4629
|
stdio
|
|
@@ -6127,7 +4962,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
|
|
|
6127
4962
|
|
|
6128
4963
|
//#endregion
|
|
6129
4964
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
6130
|
-
const processOk = (process$
|
|
4965
|
+
const processOk = (process$3) => !!process$3 && typeof process$3 === "object" && typeof process$3.removeListener === "function" && typeof process$3.emit === "function" && typeof process$3.reallyExit === "function" && typeof process$3.listeners === "function" && typeof process$3.kill === "function" && typeof process$3.pid === "number" && typeof process$3.on === "function";
|
|
6131
4966
|
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
6132
4967
|
const global$1 = globalThis;
|
|
6133
4968
|
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -6195,7 +5030,7 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
6195
5030
|
};
|
|
6196
5031
|
var SignalExit = class extends SignalExitBase {
|
|
6197
5032
|
/* c8 ignore start */
|
|
6198
|
-
#hupSig = process$
|
|
5033
|
+
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
6199
5034
|
/* c8 ignore stop */
|
|
6200
5035
|
#emitter = new Emitter();
|
|
6201
5036
|
#process;
|
|
@@ -6203,15 +5038,15 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6203
5038
|
#originalProcessReallyExit;
|
|
6204
5039
|
#sigListeners = {};
|
|
6205
5040
|
#loaded = false;
|
|
6206
|
-
constructor(process$
|
|
5041
|
+
constructor(process$3) {
|
|
6207
5042
|
super();
|
|
6208
|
-
this.#process = process$
|
|
5043
|
+
this.#process = process$3;
|
|
6209
5044
|
this.#sigListeners = {};
|
|
6210
5045
|
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
6211
5046
|
const listeners = this.#process.listeners(sig);
|
|
6212
5047
|
let { count: count$1 } = this.#emitter;
|
|
6213
5048
|
/* c8 ignore start */
|
|
6214
|
-
const p$1 = process$
|
|
5049
|
+
const p$1 = process$3;
|
|
6215
5050
|
if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
|
|
6216
5051
|
/* c8 ignore stop */
|
|
6217
5052
|
if (listeners.length === count$1) {
|
|
@@ -6219,11 +5054,11 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6219
5054
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
6220
5055
|
/* c8 ignore start */
|
|
6221
5056
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
6222
|
-
if (!ret) process$
|
|
5057
|
+
if (!ret) process$3.kill(process$3.pid, s);
|
|
6223
5058
|
}
|
|
6224
5059
|
};
|
|
6225
|
-
this.#originalProcessReallyExit = process$
|
|
6226
|
-
this.#originalProcessEmit = process$
|
|
5060
|
+
this.#originalProcessReallyExit = process$3.reallyExit;
|
|
5061
|
+
this.#originalProcessEmit = process$3.emit;
|
|
6227
5062
|
}
|
|
6228
5063
|
onExit(cb, opts) {
|
|
6229
5064
|
/* c8 ignore start */
|
|
@@ -6244,7 +5079,7 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6244
5079
|
for (const sig of signals) try {
|
|
6245
5080
|
const fn = this.#sigListeners[sig];
|
|
6246
5081
|
if (fn) this.#process.on(sig, fn);
|
|
6247
|
-
} catch (_
|
|
5082
|
+
} catch (_) {}
|
|
6248
5083
|
this.#process.emit = (ev, ...a$1) => {
|
|
6249
5084
|
return this.#processEmit(ev, ...a$1);
|
|
6250
5085
|
};
|
|
@@ -6262,7 +5097,7 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6262
5097
|
/* c8 ignore stop */
|
|
6263
5098
|
try {
|
|
6264
5099
|
this.#process.removeListener(sig, listener);
|
|
6265
|
-
} catch (_
|
|
5100
|
+
} catch (_) {}
|
|
6266
5101
|
/* c8 ignore stop */
|
|
6267
5102
|
});
|
|
6268
5103
|
this.#process.emit = this.#originalProcessEmit;
|
|
@@ -6290,8 +5125,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
6290
5125
|
} else return og.call(this.#process, ev, ...args);
|
|
6291
5126
|
}
|
|
6292
5127
|
};
|
|
6293
|
-
const process$
|
|
6294
|
-
const { onExit, load, unload } = signalExitWrap(processOk(process$
|
|
5128
|
+
const process$2 = globalThis.process;
|
|
5129
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
6295
5130
|
|
|
6296
5131
|
//#endregion
|
|
6297
5132
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/cleanup.js
|
|
@@ -6760,7 +5595,7 @@ const waitForSubprocessStream = async ({ stream, fdNumber, encoding, buffer, max
|
|
|
6760
5595
|
|
|
6761
5596
|
//#endregion
|
|
6762
5597
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/resolve/all-async.js
|
|
6763
|
-
const makeAllStream = ({ stdout
|
|
5598
|
+
const makeAllStream = ({ stdout, stderr }, { all }) => all && (stdout || stderr) ? mergeStreams([stdout, stderr].filter(Boolean)) : void 0;
|
|
6764
5599
|
const waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline: stripFinalNewline$1, verboseInfo, streamInfo }) => waitForSubprocessStream({
|
|
6765
5600
|
...getAllStream(subprocess, buffer),
|
|
6766
5601
|
fdNumber: "all",
|
|
@@ -6772,7 +5607,7 @@ const waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stri
|
|
|
6772
5607
|
verboseInfo,
|
|
6773
5608
|
streamInfo
|
|
6774
5609
|
});
|
|
6775
|
-
const getAllStream = ({ stdout
|
|
5610
|
+
const getAllStream = ({ stdout, stderr, all }, [, bufferStdout, bufferStderr]) => {
|
|
6776
5611
|
const buffer = bufferStdout || bufferStderr;
|
|
6777
5612
|
if (!buffer) return {
|
|
6778
5613
|
stream: all,
|
|
@@ -6783,7 +5618,7 @@ const getAllStream = ({ stdout: stdout$1, stderr, all }, [, bufferStdout, buffer
|
|
|
6783
5618
|
buffer
|
|
6784
5619
|
};
|
|
6785
5620
|
if (!bufferStderr) return {
|
|
6786
|
-
stream: stdout
|
|
5621
|
+
stream: stdout,
|
|
6787
5622
|
buffer
|
|
6788
5623
|
};
|
|
6789
5624
|
return {
|
|
@@ -6791,7 +5626,7 @@ const getAllStream = ({ stdout: stdout$1, stderr, all }, [, bufferStdout, buffer
|
|
|
6791
5626
|
buffer
|
|
6792
5627
|
};
|
|
6793
5628
|
};
|
|
6794
|
-
const getAllMixed = ({ all, stdout
|
|
5629
|
+
const getAllMixed = ({ all, stdout, stderr }) => all && stdout && stderr && stdout.readableObjectMode !== stderr.readableObjectMode;
|
|
6795
5630
|
|
|
6796
5631
|
//#endregion
|
|
6797
5632
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/verbose/ipc.js
|
|
@@ -7636,7 +6471,7 @@ var CloudFrontManager = class {
|
|
|
7636
6471
|
};
|
|
7637
6472
|
const keyGroupId = (await cloudfrontClient.createKeyGroup({ KeyGroupConfig: keyGroupConfig })).KeyGroup?.Id;
|
|
7638
6473
|
if (!keyGroupId) throw new Error("Failed to create Key Group");
|
|
7639
|
-
|
|
6474
|
+
p.log.success(`Created new Key Group: ${keyGroupConfig.Name}`);
|
|
7640
6475
|
return {
|
|
7641
6476
|
publicKeyId,
|
|
7642
6477
|
keyGroupId
|
|
@@ -7680,14 +6515,14 @@ var CloudFrontManager = class {
|
|
|
7680
6515
|
let selectedDistribution = null;
|
|
7681
6516
|
if (matchingDistributions.length === 1) selectedDistribution = matchingDistributions[0];
|
|
7682
6517
|
else if (matchingDistributions.length > 1) {
|
|
7683
|
-
const selectedDistributionStr = await
|
|
6518
|
+
const selectedDistributionStr = await p.select({
|
|
7684
6519
|
message: "Multiple CloudFront distributions found. Please select one to use:",
|
|
7685
6520
|
options: matchingDistributions.map((dist) => ({
|
|
7686
6521
|
value: JSON.stringify(dist),
|
|
7687
6522
|
label: `${dist.Id} (${dist.DomainName})`
|
|
7688
6523
|
}))
|
|
7689
6524
|
});
|
|
7690
|
-
if (
|
|
6525
|
+
if (p.isCancel(selectedDistributionStr)) process.exit(0);
|
|
7691
6526
|
selectedDistribution = JSON.parse(selectedDistributionStr);
|
|
7692
6527
|
}
|
|
7693
6528
|
const newOverrides = {
|
|
@@ -7816,7 +6651,7 @@ var CloudFrontManager = class {
|
|
|
7816
6651
|
}
|
|
7817
6652
|
};
|
|
7818
6653
|
if (selectedDistribution) {
|
|
7819
|
-
|
|
6654
|
+
p.log.success(`Existing CloudFront distribution selected. Distribution ID: ${selectedDistribution.Id}.`);
|
|
7820
6655
|
try {
|
|
7821
6656
|
const { DistributionConfig, ETag } = await cloudfrontClient.getDistributionConfig({ Id: selectedDistribution.Id });
|
|
7822
6657
|
const finalConfig = merge(DistributionConfig ?? {}, newOverrides);
|
|
@@ -7825,7 +6660,7 @@ var CloudFrontManager = class {
|
|
|
7825
6660
|
IfMatch: ETag,
|
|
7826
6661
|
DistributionConfig: finalConfig
|
|
7827
6662
|
});
|
|
7828
|
-
|
|
6663
|
+
p.log.success("CloudFront distribution updated with new Lambda function ARN.");
|
|
7829
6664
|
await cloudfrontClient.createInvalidation({
|
|
7830
6665
|
DistributionId: selectedDistribution.Id,
|
|
7831
6666
|
InvalidationBatch: {
|
|
@@ -7836,13 +6671,13 @@ var CloudFrontManager = class {
|
|
|
7836
6671
|
}
|
|
7837
6672
|
}
|
|
7838
6673
|
});
|
|
7839
|
-
|
|
6674
|
+
p.log.success("Cache invalidation request completed.");
|
|
7840
6675
|
return {
|
|
7841
6676
|
distributionId: selectedDistribution.Id,
|
|
7842
6677
|
distributionDomain: selectedDistribution.DomainName
|
|
7843
6678
|
};
|
|
7844
6679
|
} catch (err) {
|
|
7845
|
-
|
|
6680
|
+
p.log.error(`Failed to update CloudFront distribution: ${err instanceof Error ? err.message : String(err)}`);
|
|
7846
6681
|
throw err;
|
|
7847
6682
|
}
|
|
7848
6683
|
}
|
|
@@ -7990,9 +6825,9 @@ var CloudFrontManager = class {
|
|
|
7990
6825
|
if (!distResp.Distribution?.Id || !distResp.Distribution?.DomainName) throw new Error("Failed to create CloudFront distribution: No ID or DomainName returned");
|
|
7991
6826
|
const distributionId = distResp.Distribution.Id;
|
|
7992
6827
|
const distributionDomain = distResp.Distribution.DomainName;
|
|
7993
|
-
|
|
6828
|
+
p.log.success(`Created new CloudFront distribution. Distribution ID: ${distributionId}`);
|
|
7994
6829
|
let retryCount = 0;
|
|
7995
|
-
await
|
|
6830
|
+
await p.tasks([{
|
|
7996
6831
|
title: "Waiting for CloudFront distribution to complete...",
|
|
7997
6832
|
task: async (message) => {
|
|
7998
6833
|
while (retryCount < 600) try {
|
|
@@ -8002,7 +6837,7 @@ var CloudFrontManager = class {
|
|
|
8002
6837
|
if (retryCount++ >= 5) message(`CloudFront distribution is still in progress. This may take a few minutes. (${retryCount})`);
|
|
8003
6838
|
await delay(1e3);
|
|
8004
6839
|
}
|
|
8005
|
-
|
|
6840
|
+
p.log.error("CloudFront distribution deployment timed out.");
|
|
8006
6841
|
process.exit(1);
|
|
8007
6842
|
}
|
|
8008
6843
|
}]);
|
|
@@ -8011,7 +6846,7 @@ var CloudFrontManager = class {
|
|
|
8011
6846
|
distributionDomain
|
|
8012
6847
|
};
|
|
8013
6848
|
} catch (error) {
|
|
8014
|
-
|
|
6849
|
+
p.log.error(`CloudFront distribution creation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
8015
6850
|
throw error;
|
|
8016
6851
|
}
|
|
8017
6852
|
}
|
|
@@ -8062,11 +6897,11 @@ var IAMManager = class {
|
|
|
8062
6897
|
PolicyName: "HotUpdaterSSMAccess",
|
|
8063
6898
|
PolicyDocument: ssmPolicyDocument
|
|
8064
6899
|
});
|
|
8065
|
-
|
|
6900
|
+
p.log.info("Updated SSM access policy for existing IAM role");
|
|
8066
6901
|
} catch {
|
|
8067
|
-
|
|
6902
|
+
p.log.warn("Failed to update SSM policy, continuing anyway");
|
|
8068
6903
|
}
|
|
8069
|
-
|
|
6904
|
+
p.log.info(`Using existing IAM role: ${roleName} (${existingRole.Arn})`);
|
|
8070
6905
|
return existingRole.Arn;
|
|
8071
6906
|
}
|
|
8072
6907
|
} catch {
|
|
@@ -8078,7 +6913,7 @@ var IAMManager = class {
|
|
|
8078
6913
|
});
|
|
8079
6914
|
if (!createRoleResp.Role?.Arn) throw new Error("Failed to create IAM role: No ARN returned");
|
|
8080
6915
|
const lambdaRoleArn = createRoleResp.Role.Arn;
|
|
8081
|
-
|
|
6916
|
+
p.log.info(`Created IAM role: ${roleName} (${lambdaRoleArn})`);
|
|
8082
6917
|
await iamClient.attachRolePolicy({
|
|
8083
6918
|
RoleName: roleName,
|
|
8084
6919
|
PolicyArn: "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
@@ -8087,16 +6922,16 @@ var IAMManager = class {
|
|
|
8087
6922
|
RoleName: roleName,
|
|
8088
6923
|
PolicyArn: "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
|
|
8089
6924
|
});
|
|
8090
|
-
|
|
6925
|
+
p.log.info(`Attached managed policies to ${roleName}`);
|
|
8091
6926
|
await iamClient.putRolePolicy({
|
|
8092
6927
|
RoleName: roleName,
|
|
8093
6928
|
PolicyName: "HotUpdaterSSMAccess",
|
|
8094
6929
|
PolicyDocument: ssmPolicyDocument
|
|
8095
6930
|
});
|
|
8096
|
-
|
|
6931
|
+
p.log.info(`Added SSM access inline policy to ${roleName}`);
|
|
8097
6932
|
return lambdaRoleArn;
|
|
8098
6933
|
} catch (createError) {
|
|
8099
|
-
if (createError instanceof Error)
|
|
6934
|
+
if (createError instanceof Error) p.log.error(`Error setting up IAM role: ${createError.message}`);
|
|
8100
6935
|
process.exit(1);
|
|
8101
6936
|
}
|
|
8102
6937
|
}
|
|
@@ -8113,12 +6948,12 @@ var LambdaEdgeDeployer = class {
|
|
|
8113
6948
|
}
|
|
8114
6949
|
async deploy(lambdaRoleArn, config) {
|
|
8115
6950
|
const cwd = getCwd();
|
|
8116
|
-
const lambdaName = await
|
|
6951
|
+
const lambdaName = await p.text({
|
|
8117
6952
|
message: "Enter the name of the Lambda@Edge function",
|
|
8118
6953
|
defaultValue: "hot-updater-edge",
|
|
8119
6954
|
placeholder: "hot-updater-edge"
|
|
8120
6955
|
});
|
|
8121
|
-
if (
|
|
6956
|
+
if (p.isCancel(lambdaName)) process.exit(1);
|
|
8122
6957
|
const lambdaPath = __require.resolve("@hot-updater/aws/lambda");
|
|
8123
6958
|
const { tmpDir, removeTmpDir } = await copyDirToTmp(path$1.dirname(lambdaPath));
|
|
8124
6959
|
const indexPath = path$1.join(tmpDir, "index.cjs");
|
|
@@ -8137,7 +6972,7 @@ var LambdaEdgeDeployer = class {
|
|
|
8137
6972
|
version: null
|
|
8138
6973
|
};
|
|
8139
6974
|
const zipFilePath = path$1.join(cwd, `${lambdaName}.zip`);
|
|
8140
|
-
await
|
|
6975
|
+
await p.tasks([
|
|
8141
6976
|
{
|
|
8142
6977
|
title: "Compressing Lambda code to zip",
|
|
8143
6978
|
task: async () => {
|
|
@@ -8195,12 +7030,12 @@ var LambdaEdgeDeployer = class {
|
|
|
8195
7030
|
Timeout: 10
|
|
8196
7031
|
});
|
|
8197
7032
|
} catch (error$1) {
|
|
8198
|
-
|
|
7033
|
+
p.log.error(`Failed to update Lambda configuration: ${error$1 instanceof Error ? error$1.message : String(error$1)}`);
|
|
8199
7034
|
}
|
|
8200
7035
|
functionArn.arn = updateResp.FunctionArn || null;
|
|
8201
7036
|
functionArn.version = updateResp.Version || "1";
|
|
8202
7037
|
} else {
|
|
8203
|
-
if (error instanceof Error)
|
|
7038
|
+
if (error instanceof Error) p.log.error(`Failed to create or update Lambda function: ${error.message}`);
|
|
8204
7039
|
throw error;
|
|
8205
7040
|
}
|
|
8206
7041
|
return `Updated Lambda "${lambdaName}" function`;
|
|
@@ -8218,14 +7053,14 @@ var LambdaEdgeDeployer = class {
|
|
|
8218
7053
|
const resp = await lambdaClient.getFunctionConfiguration({ FunctionName: qualifiedName });
|
|
8219
7054
|
if (resp.State === "Active") return "Lambda function is now active";
|
|
8220
7055
|
if (resp.State === "Failed") throw new Error(`Lambda function is in a Failed state. Reason: ${resp.StateReason}`);
|
|
8221
|
-
await new Promise((r
|
|
7056
|
+
await new Promise((r) => setTimeout(r, 2e3));
|
|
8222
7057
|
}
|
|
8223
7058
|
}
|
|
8224
7059
|
}
|
|
8225
7060
|
]);
|
|
8226
7061
|
if (!functionArn.arn || !functionArn.version) throw new Error("Failed to create or update Lambda function");
|
|
8227
7062
|
if (!functionArn.arn.endsWith(`:${functionArn.version}`)) functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
|
|
8228
|
-
|
|
7063
|
+
p.log.info(`Using Lambda ARN: ${functionArn.arn}`);
|
|
8229
7064
|
return {
|
|
8230
7065
|
lambdaName,
|
|
8231
7066
|
functionArn: functionArn.arn
|
|
@@ -8235,7 +7070,6 @@ var LambdaEdgeDeployer = class {
|
|
|
8235
7070
|
|
|
8236
7071
|
//#endregion
|
|
8237
7072
|
//#region iac/migrations/migrator.ts
|
|
8238
|
-
var import_picocolors$1 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
8239
7073
|
/**
|
|
8240
7074
|
* S3Migration
|
|
8241
7075
|
* Base class that each migration script extends.
|
|
@@ -8286,7 +7120,7 @@ var S3Migration = class {
|
|
|
8286
7120
|
if (response.Body) return await response.Body.transformToString();
|
|
8287
7121
|
return null;
|
|
8288
7122
|
} catch (error) {
|
|
8289
|
-
console.error(
|
|
7123
|
+
console.error(colors.red(`Error reading file ${key}:`), error);
|
|
8290
7124
|
return null;
|
|
8291
7125
|
}
|
|
8292
7126
|
}
|
|
@@ -8294,8 +7128,8 @@ var S3Migration = class {
|
|
|
8294
7128
|
const content = await this.readFile(key);
|
|
8295
7129
|
if (content) try {
|
|
8296
7130
|
return JSON.parse(content);
|
|
8297
|
-
} catch (e
|
|
8298
|
-
console.error(
|
|
7131
|
+
} catch (e) {
|
|
7132
|
+
console.error(colors.red(`Error parsing JSON from ${key}:`), e);
|
|
8299
7133
|
}
|
|
8300
7134
|
return null;
|
|
8301
7135
|
}
|
|
@@ -8311,16 +7145,16 @@ var S3Migration = class {
|
|
|
8311
7145
|
async updateFile(key, content, { cacheControl } = {}) {
|
|
8312
7146
|
const normalizedKey = key.startsWith("/") ? key.substring(1) : key;
|
|
8313
7147
|
if (this.dryRun) {
|
|
8314
|
-
console.log(
|
|
7148
|
+
console.log(colors.yellow(`[DRY RUN] Updated ${colors.bold(normalizedKey)}`));
|
|
8315
7149
|
return;
|
|
8316
7150
|
}
|
|
8317
7151
|
if (await this.readFile(key) !== null) await this.backupFile(key);
|
|
8318
7152
|
await this.doUpdateFile(normalizedKey, content, { cacheControl });
|
|
8319
|
-
console.log(
|
|
7153
|
+
console.log(colors.green(`Updated ${colors.bold(normalizedKey)}`));
|
|
8320
7154
|
}
|
|
8321
7155
|
async moveFile(from, to) {
|
|
8322
7156
|
if (this.dryRun) {
|
|
8323
|
-
console.log(
|
|
7157
|
+
console.log(colors.yellow(`[DRY RUN] ${colors.bold(from)} -> ${colors.bold(to)}`));
|
|
8324
7158
|
return;
|
|
8325
7159
|
}
|
|
8326
7160
|
await this.backupFile(from);
|
|
@@ -8332,7 +7166,7 @@ var S3Migration = class {
|
|
|
8332
7166
|
});
|
|
8333
7167
|
await this.s3.send(copyCommand);
|
|
8334
7168
|
} catch (error) {
|
|
8335
|
-
console.error(
|
|
7169
|
+
console.error(colors.red(`Error copying file from ${from} to ${to}:`), error);
|
|
8336
7170
|
throw error;
|
|
8337
7171
|
}
|
|
8338
7172
|
try {
|
|
@@ -8342,13 +7176,13 @@ var S3Migration = class {
|
|
|
8342
7176
|
});
|
|
8343
7177
|
await this.s3.send(deleteCommand);
|
|
8344
7178
|
} catch (error) {
|
|
8345
|
-
if (error?.message?.includes("NoSuchKey")) console.warn(
|
|
7179
|
+
if (error?.message?.includes("NoSuchKey")) console.warn(colors.yellow(`Key ${from} not found during deletion, ignoring.`));
|
|
8346
7180
|
else {
|
|
8347
|
-
console.error(
|
|
7181
|
+
console.error(colors.red(`Error deleting file ${from}:`), error);
|
|
8348
7182
|
throw error;
|
|
8349
7183
|
}
|
|
8350
7184
|
}
|
|
8351
|
-
console.log(
|
|
7185
|
+
console.log(colors.green(`${colors.bold(from)} -> ${colors.bold(to)}`));
|
|
8352
7186
|
}
|
|
8353
7187
|
async deleteBackupFile(backupKey) {
|
|
8354
7188
|
if (this.dryRun) return;
|
|
@@ -8359,7 +7193,7 @@ var S3Migration = class {
|
|
|
8359
7193
|
});
|
|
8360
7194
|
await this.s3.send(deleteCommand);
|
|
8361
7195
|
} catch (error) {
|
|
8362
|
-
console.error(
|
|
7196
|
+
console.error(colors.red(`Error deleting backup file ${backupKey}:`), error);
|
|
8363
7197
|
}
|
|
8364
7198
|
}
|
|
8365
7199
|
async cleanupBackups() {
|
|
@@ -8368,15 +7202,15 @@ var S3Migration = class {
|
|
|
8368
7202
|
this.backupMapping.clear();
|
|
8369
7203
|
}
|
|
8370
7204
|
async rollback() {
|
|
8371
|
-
console.log(
|
|
7205
|
+
console.log(colors.magenta(`Starting rollback for migration ${this.name}...`));
|
|
8372
7206
|
for (const [originalKey, backupKey] of this.backupMapping.entries()) {
|
|
8373
7207
|
const backupContent = await this.readFile(backupKey);
|
|
8374
7208
|
if (backupContent !== null) {
|
|
8375
|
-
console.log(
|
|
7209
|
+
console.log(colors.blue(`Restoring backup for ${originalKey} from ${backupKey}`));
|
|
8376
7210
|
await this.doUpdateFile(originalKey, backupContent);
|
|
8377
|
-
} else console.error(
|
|
7211
|
+
} else console.error(colors.red(`Failed to read backup for ${originalKey} at ${backupKey}`));
|
|
8378
7212
|
}
|
|
8379
|
-
console.log(
|
|
7213
|
+
console.log(colors.green(`Rollback completed for migration ${this.name}.`));
|
|
8380
7214
|
}
|
|
8381
7215
|
};
|
|
8382
7216
|
/**
|
|
@@ -8406,7 +7240,7 @@ var S3Migrator = class {
|
|
|
8406
7240
|
try {
|
|
8407
7241
|
this.migrationRecords = JSON.parse(bodyContents);
|
|
8408
7242
|
} catch (jsonError) {
|
|
8409
|
-
console.error(
|
|
7243
|
+
console.error(colors.red("Failed to parse migration records JSON:"), jsonError);
|
|
8410
7244
|
this.migrationRecords = [];
|
|
8411
7245
|
}
|
|
8412
7246
|
}
|
|
@@ -8444,7 +7278,7 @@ var S3Migrator = class {
|
|
|
8444
7278
|
await this.loadMigrationRecords();
|
|
8445
7279
|
for (const migration of this.migrations) {
|
|
8446
7280
|
if (this.migrationRecords.some((record) => record.name === migration.name)) continue;
|
|
8447
|
-
console.log(
|
|
7281
|
+
console.log(colors.magenta(`Applying migration ${migration.name}...`));
|
|
8448
7282
|
migration.s3 = this.s3;
|
|
8449
7283
|
migration.bucketName = this.bucketName;
|
|
8450
7284
|
migration.dryRun = dryRun;
|
|
@@ -8455,17 +7289,17 @@ var S3Migrator = class {
|
|
|
8455
7289
|
name: migration.name,
|
|
8456
7290
|
appliedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8457
7291
|
});
|
|
8458
|
-
console.log(
|
|
7292
|
+
console.log(colors.green(`${colors.bold(migration.name)} applied successfully.`));
|
|
8459
7293
|
await migration.cleanupBackups();
|
|
8460
|
-
} else console.log(
|
|
7294
|
+
} else console.log(colors.yellow(`[DRY RUN] ${colors.bold(migration.name)} applied successfully`));
|
|
8461
7295
|
} catch (error) {
|
|
8462
|
-
console.error(
|
|
7296
|
+
console.error(colors.red(`Migration ${migration.name} failed. Initiating rollback...`), error);
|
|
8463
7297
|
await migration.rollback();
|
|
8464
7298
|
throw error;
|
|
8465
7299
|
}
|
|
8466
7300
|
}
|
|
8467
7301
|
await this.saveMigrationRecords(dryRun);
|
|
8468
|
-
if (!dryRun) console.log(
|
|
7302
|
+
if (!dryRun) console.log(colors.blue("All migrations applied."));
|
|
8469
7303
|
}
|
|
8470
7304
|
};
|
|
8471
7305
|
|
|
@@ -8585,7 +7419,7 @@ var S3Manager = class {
|
|
|
8585
7419
|
Bucket: bucketName,
|
|
8586
7420
|
...region === "us-east-1" ? {} : { CreateBucketConfiguration: { LocationConstraint: region } }
|
|
8587
7421
|
});
|
|
8588
|
-
|
|
7422
|
+
p.log.info(`Created S3 bucket: ${bucketName}`);
|
|
8589
7423
|
}
|
|
8590
7424
|
async runMigrations({ bucketName, region, migrations }) {
|
|
8591
7425
|
const migrator = new S3Migrator({
|
|
@@ -8599,12 +7433,12 @@ var S3Manager = class {
|
|
|
8599
7433
|
const { pending } = await migrator.list();
|
|
8600
7434
|
await migrator.migrate({ dryRun: true });
|
|
8601
7435
|
if (pending.length > 0) {
|
|
8602
|
-
|
|
8603
|
-
for (const m
|
|
7436
|
+
p.log.step("Pending migrations:");
|
|
7437
|
+
for (const m of pending) p.log.step(`- ${m.name}`);
|
|
8604
7438
|
}
|
|
8605
|
-
const confirm = await
|
|
8606
|
-
if (
|
|
8607
|
-
|
|
7439
|
+
const confirm = await p.confirm({ message: "Do you want to continue?" });
|
|
7440
|
+
if (p.isCancel(confirm) || !confirm) {
|
|
7441
|
+
p.log.info("Migration cancelled.");
|
|
8608
7442
|
process.exit(1);
|
|
8609
7443
|
}
|
|
8610
7444
|
await migrator.migrate({ dryRun: false });
|
|
@@ -8630,7 +7464,7 @@ var S3Manager = class {
|
|
|
8630
7464
|
Bucket: bucketName,
|
|
8631
7465
|
Policy: JSON.stringify(bucketPolicy)
|
|
8632
7466
|
});
|
|
8633
|
-
|
|
7467
|
+
p.log.success("S3 bucket policy updated to allow access from CloudFront distribution");
|
|
8634
7468
|
}
|
|
8635
7469
|
};
|
|
8636
7470
|
|
|
@@ -8674,7 +7508,7 @@ var SSMKeyPairManager = class {
|
|
|
8674
7508
|
const existing = await this.getParameter(parameterName);
|
|
8675
7509
|
if (existing) {
|
|
8676
7510
|
const keyPair$1 = JSON.parse(existing);
|
|
8677
|
-
|
|
7511
|
+
p.log.info("Using existing CloudFront key pair from SSM Parameter Store");
|
|
8678
7512
|
return keyPair$1;
|
|
8679
7513
|
}
|
|
8680
7514
|
const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", {
|
|
@@ -8694,7 +7528,7 @@ var SSMKeyPairManager = class {
|
|
|
8694
7528
|
privateKey
|
|
8695
7529
|
};
|
|
8696
7530
|
await this.putParameter(parameterName, JSON.stringify(keyPair));
|
|
8697
|
-
|
|
7531
|
+
p.log.success("Created and stored new CloudFront key pair in SSM Parameter Store");
|
|
8698
7532
|
return keyPair;
|
|
8699
7533
|
}
|
|
8700
7534
|
};
|
|
@@ -8757,7 +7591,6 @@ export default HotUpdater.wrap({
|
|
|
8757
7591
|
|
|
8758
7592
|
//#endregion
|
|
8759
7593
|
//#region iac/index.ts
|
|
8760
|
-
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
8761
7594
|
const checkIfAwsCliInstalled = async () => {
|
|
8762
7595
|
try {
|
|
8763
7596
|
await execa("aws", ["--version"]);
|
|
@@ -8768,11 +7601,11 @@ const checkIfAwsCliInstalled = async () => {
|
|
|
8768
7601
|
};
|
|
8769
7602
|
const runInit = async ({ build }) => {
|
|
8770
7603
|
if (!await checkIfAwsCliInstalled()) {
|
|
8771
|
-
|
|
7604
|
+
p.log.error(`AWS CLI is not installed. Please visit ${link("https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html")} for installation instructions`);
|
|
8772
7605
|
process.exit(1);
|
|
8773
7606
|
}
|
|
8774
7607
|
let credentials;
|
|
8775
|
-
const mode = await
|
|
7608
|
+
const mode = await p.select({
|
|
8776
7609
|
message: "Select the mode to login to AWS",
|
|
8777
7610
|
options: [{
|
|
8778
7611
|
label: "AWS Access Key ID & Secret Access Key (Recommend)",
|
|
@@ -8782,20 +7615,20 @@ const runInit = async ({ build }) => {
|
|
|
8782
7615
|
value: "sso"
|
|
8783
7616
|
}]
|
|
8784
7617
|
});
|
|
8785
|
-
if (
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
7618
|
+
if (p.isCancel(mode)) process.exit(1);
|
|
7619
|
+
p.log.message(colors.blue("The following permissions are required:"));
|
|
7620
|
+
p.log.message(`${colors.blue("AmazonS3FullAccess")}: Create and read S3 buckets`);
|
|
7621
|
+
p.log.message(`${colors.blue("AWSLambda_FullAccess")}: Create and update Lambda functions`);
|
|
7622
|
+
p.log.message(`${colors.blue("CloudFrontFullAccess")}: Create and update CloudFront distributions`);
|
|
7623
|
+
p.log.message(`${colors.blue("IAMFullAccess")}: Get or create IAM roles for Lambda@Edge`);
|
|
7624
|
+
p.log.message(`${colors.blue("AmazonSSMFullAccess")}: Access to SSM Parameters for storing CloudFront key pairs`);
|
|
8792
7625
|
if (mode === "sso") try {
|
|
8793
|
-
const profile = await
|
|
7626
|
+
const profile = await p.text({
|
|
8794
7627
|
message: "Enter the SSO profile name",
|
|
8795
7628
|
defaultValue: "default",
|
|
8796
7629
|
placeholder: "default"
|
|
8797
7630
|
});
|
|
8798
|
-
if (
|
|
7631
|
+
if (p.isCancel(profile)) process.exit(1);
|
|
8799
7632
|
await execa("aws", [
|
|
8800
7633
|
"sso",
|
|
8801
7634
|
"login",
|
|
@@ -8807,21 +7640,21 @@ const runInit = async ({ build }) => {
|
|
|
8807
7640
|
});
|
|
8808
7641
|
credentials = await fromSSO({ profile })();
|
|
8809
7642
|
} catch (error) {
|
|
8810
|
-
if (error instanceof ExecaError)
|
|
7643
|
+
if (error instanceof ExecaError) p.log.error(error.stdout || error.stderr || error.message);
|
|
8811
7644
|
process.exit(1);
|
|
8812
7645
|
}
|
|
8813
7646
|
else {
|
|
8814
|
-
const creds = await
|
|
8815
|
-
accessKeyId: () =>
|
|
7647
|
+
const creds = await p.group({
|
|
7648
|
+
accessKeyId: () => p.text({
|
|
8816
7649
|
message: "Enter your AWS Access Key ID",
|
|
8817
7650
|
validate: (value) => value ? void 0 : "Access Key ID is required"
|
|
8818
7651
|
}),
|
|
8819
|
-
secretAccessKey: () =>
|
|
7652
|
+
secretAccessKey: () => p.password({
|
|
8820
7653
|
message: "Enter your AWS Secret Access Key",
|
|
8821
7654
|
validate: (value) => value ? void 0 : "Secret Access Key is required"
|
|
8822
7655
|
})
|
|
8823
7656
|
});
|
|
8824
|
-
if (
|
|
7657
|
+
if (p.isCancel(creds)) process.exit(1);
|
|
8825
7658
|
credentials = {
|
|
8826
7659
|
accessKeyId: creds.accessKeyId,
|
|
8827
7660
|
secretAccessKey: creds.secretAccessKey
|
|
@@ -8830,18 +7663,18 @@ const runInit = async ({ build }) => {
|
|
|
8830
7663
|
const s3Manager = new S3Manager(credentials);
|
|
8831
7664
|
let availableBuckets = [];
|
|
8832
7665
|
try {
|
|
8833
|
-
await
|
|
7666
|
+
await p.tasks([{
|
|
8834
7667
|
title: "Checking S3 Buckets...",
|
|
8835
7668
|
task: async () => {
|
|
8836
7669
|
availableBuckets = await s3Manager.listBuckets();
|
|
8837
7670
|
}
|
|
8838
7671
|
}]);
|
|
8839
|
-
} catch (e
|
|
8840
|
-
if (e
|
|
8841
|
-
throw e
|
|
7672
|
+
} catch (e) {
|
|
7673
|
+
if (e instanceof Error) p.log.error(e.message);
|
|
7674
|
+
throw e;
|
|
8842
7675
|
}
|
|
8843
7676
|
const createKey = `create/${Math.random().toString(36).substring(2, 15)}`;
|
|
8844
|
-
let bucketName = await
|
|
7677
|
+
let bucketName = await p.select({
|
|
8845
7678
|
message: "S3 Bucket List",
|
|
8846
7679
|
options: [...availableBuckets.map((bucket) => ({
|
|
8847
7680
|
value: bucket.name,
|
|
@@ -8851,32 +7684,32 @@ const runInit = async ({ build }) => {
|
|
|
8851
7684
|
label: "Create New S3 Bucket"
|
|
8852
7685
|
}]
|
|
8853
7686
|
});
|
|
8854
|
-
if (
|
|
7687
|
+
if (p.isCancel(bucketName)) process.exit(1);
|
|
8855
7688
|
let bucketRegion = availableBuckets.find((bucket) => bucket.name === bucketName)?.region;
|
|
8856
7689
|
if (bucketName === createKey) {
|
|
8857
|
-
const name = await
|
|
7690
|
+
const name = await p.text({
|
|
8858
7691
|
message: "Enter the name of the new S3 Bucket",
|
|
8859
7692
|
defaultValue: "hot-updater-storage",
|
|
8860
7693
|
placeholder: "hot-updater-storage"
|
|
8861
7694
|
});
|
|
8862
|
-
if (
|
|
7695
|
+
if (p.isCancel(name)) process.exit(1);
|
|
8863
7696
|
bucketName = name;
|
|
8864
|
-
const selectedRegion = await
|
|
7697
|
+
const selectedRegion = await p.select({
|
|
8865
7698
|
message: "Enter AWS region for the S3 bucket",
|
|
8866
7699
|
options: Object.entries(regionLocationMap).map(([region, location]) => ({
|
|
8867
7700
|
label: `${region} (${location})`,
|
|
8868
7701
|
value: region
|
|
8869
7702
|
}))
|
|
8870
7703
|
});
|
|
8871
|
-
if (
|
|
7704
|
+
if (p.isCancel(selectedRegion)) process.exit(1);
|
|
8872
7705
|
bucketRegion = selectedRegion;
|
|
8873
7706
|
await s3Manager.createBucket(bucketName, bucketRegion);
|
|
8874
7707
|
}
|
|
8875
7708
|
if (!bucketRegion) {
|
|
8876
|
-
|
|
7709
|
+
p.log.error("Failed to get S3 bucket region");
|
|
8877
7710
|
process.exit(1);
|
|
8878
7711
|
}
|
|
8879
|
-
|
|
7712
|
+
p.log.info(`Selected S3 Bucket: ${bucketName} (${bucketRegion})`);
|
|
8880
7713
|
await s3Manager.runMigrations({
|
|
8881
7714
|
bucketName,
|
|
8882
7715
|
region: bucketRegion,
|
|
@@ -8922,12 +7755,12 @@ const runInit = async ({ build }) => {
|
|
|
8922
7755
|
...mode === "sso" && { HOT_UPDATER_S3_SESSION_TOKEN: credentials.sessionToken },
|
|
8923
7756
|
HOT_UPDATER_CLOUDFRONT_DISTRIBUTION_ID: distributionId
|
|
8924
7757
|
});
|
|
8925
|
-
|
|
8926
|
-
|
|
7758
|
+
p.log.success("Generated '.env.hotupdater' file with AWS settings.");
|
|
7759
|
+
p.log.success("Generated 'hot-updater.config.ts' file with AWS settings.");
|
|
8927
7760
|
const sourceUrl = `https://${distributionDomain}/api/check-update`;
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
7761
|
+
p.note(transformTemplate(SOURCE_TEMPLATE, { source: sourceUrl }));
|
|
7762
|
+
p.log.message(`Next step: ${link("https://hot-updater.dev/docs/managed/aws#step-4-changeenv-file-optional")}`);
|
|
7763
|
+
p.log.success("Done! 🎉");
|
|
8931
7764
|
};
|
|
8932
7765
|
|
|
8933
7766
|
//#endregion
|