opencommit 3.2.10 → 3.2.11
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/README.md +16 -0
- package/out/cli.cjs +1609 -696
- package/package.json +1 -1
package/out/cli.cjs
CHANGED
|
@@ -161,6 +161,843 @@ var require_picocolors = __commonJS({
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
+
// node_modules/@clack/core/dist/index.mjs
|
|
165
|
+
function q3({ onlyFirst: t2 = false } = {}) {
|
|
166
|
+
const u3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
167
|
+
return new RegExp(u3, t2 ? void 0 : "g");
|
|
168
|
+
}
|
|
169
|
+
function S3(t2) {
|
|
170
|
+
if (typeof t2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``);
|
|
171
|
+
return t2.replace(q3(), "");
|
|
172
|
+
}
|
|
173
|
+
function j2(t2) {
|
|
174
|
+
return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
|
|
175
|
+
}
|
|
176
|
+
function A2(t2, u3 = {}) {
|
|
177
|
+
if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = S3(t2), t2.length === 0)) return 0;
|
|
178
|
+
t2 = t2.replace(DD2(), " ");
|
|
179
|
+
const F5 = u3.ambiguousIsNarrow ? 1 : 2;
|
|
180
|
+
let e3 = 0;
|
|
181
|
+
for (const s2 of t2) {
|
|
182
|
+
const C5 = s2.codePointAt(0);
|
|
183
|
+
if (C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879) continue;
|
|
184
|
+
switch (Q2.eastAsianWidth(s2)) {
|
|
185
|
+
case "F":
|
|
186
|
+
case "W":
|
|
187
|
+
e3 += 2;
|
|
188
|
+
break;
|
|
189
|
+
case "A":
|
|
190
|
+
e3 += F5;
|
|
191
|
+
break;
|
|
192
|
+
default:
|
|
193
|
+
e3 += 1;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return e3;
|
|
197
|
+
}
|
|
198
|
+
function tD2() {
|
|
199
|
+
const t2 = /* @__PURE__ */ new Map();
|
|
200
|
+
for (const [u3, F5] of Object.entries(r)) {
|
|
201
|
+
for (const [e3, s2] of Object.entries(F5)) r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]);
|
|
202
|
+
Object.defineProperty(r, u3, { value: F5, enumerable: false });
|
|
203
|
+
}
|
|
204
|
+
return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F5, e3) => u3 === F5 && F5 === e3 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
|
|
205
|
+
const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
|
|
206
|
+
if (!F5) return [0, 0, 0];
|
|
207
|
+
let [e3] = F5;
|
|
208
|
+
e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join(""));
|
|
209
|
+
const s2 = Number.parseInt(e3, 16);
|
|
210
|
+
return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
|
|
211
|
+
}, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
|
|
212
|
+
if (u3 < 8) return 30 + u3;
|
|
213
|
+
if (u3 < 16) return 90 + (u3 - 8);
|
|
214
|
+
let F5, e3, s2;
|
|
215
|
+
if (u3 >= 232) F5 = ((u3 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5;
|
|
216
|
+
else {
|
|
217
|
+
u3 -= 16;
|
|
218
|
+
const i3 = u3 % 36;
|
|
219
|
+
F5 = Math.floor(u3 / 36) / 5, e3 = Math.floor(i3 / 6) / 5, s2 = i3 % 6 / 5;
|
|
220
|
+
}
|
|
221
|
+
const C5 = Math.max(F5, e3, s2) * 2;
|
|
222
|
+
if (C5 === 0) return 30;
|
|
223
|
+
let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5));
|
|
224
|
+
return C5 === 2 && (D5 += 60), D5;
|
|
225
|
+
}, enumerable: false }, rgbToAnsi: { value: (u3, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F5, e3)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
|
|
226
|
+
}
|
|
227
|
+
function R4(t2, u3, F5) {
|
|
228
|
+
return String(t2).normalize().replace(/\r\n/g, `
|
|
229
|
+
`).split(`
|
|
230
|
+
`).map((e3) => ED2(e3, u3, F5)).join(`
|
|
231
|
+
`);
|
|
232
|
+
}
|
|
233
|
+
function aD2(t2, u3) {
|
|
234
|
+
if (t2 === u3) return;
|
|
235
|
+
const F5 = t2.split(`
|
|
236
|
+
`), e3 = u3.split(`
|
|
237
|
+
`), s2 = [];
|
|
238
|
+
for (let C5 = 0; C5 < Math.max(F5.length, e3.length); C5++) F5[C5] !== e3[C5] && s2.push(C5);
|
|
239
|
+
return s2;
|
|
240
|
+
}
|
|
241
|
+
function hD2(t2) {
|
|
242
|
+
return t2 === V4;
|
|
243
|
+
}
|
|
244
|
+
function v3(t2, u3) {
|
|
245
|
+
t2.isTTY && t2.setRawMode(u3);
|
|
246
|
+
}
|
|
247
|
+
function WD({ input: t2 = import_node_process.stdin, output: u3 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) {
|
|
248
|
+
const s2 = f.createInterface({ input: t2, output: u3, prompt: "", tabSize: 1 });
|
|
249
|
+
f.emitKeypressEvents(t2, s2), t2.isTTY && t2.setRawMode(true);
|
|
250
|
+
const C5 = (D5, { name: i3 }) => {
|
|
251
|
+
if (String(D5) === "" && process.exit(0), !F5) return;
|
|
252
|
+
let n2 = i3 === "return" ? 0 : -1, E4 = i3 === "return" ? -1 : 0;
|
|
253
|
+
f.moveCursor(u3, n2, E4, () => {
|
|
254
|
+
f.clearLine(u3, 1, () => {
|
|
255
|
+
t2.once("keypress", C5);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
return e3 && process.stdout.write(import_sisteransi.cursor.hide), t2.once("keypress", C5), () => {
|
|
260
|
+
t2.off("keypress", C5), e3 && process.stdout.write(import_sisteransi.cursor.show), t2.isTTY && !PD && t2.setRawMode(false), s2.terminal = false, s2.close();
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
var import_sisteransi, import_node_process, f, import_node_readline, import_node_tty, import_picocolors, M3, J3, Q2, X2, DD2, m3, T4, P2, W3, r, uD2, FD2, eD2, g2, sD2, b4, O3, CD2, I3, w4, N3, L4, iD2, y3, rD2, ED2, oD2, nD2, a, V4, z3, lD2, x3, xD2, BD2, cD2, G4, AD2, pD2, fD2, K3, gD2, vD, dD2, Y2, mD2, bD2, wD2, Z3, yD, $D, kD, H3, _D, SD, jD, MD, TD, PD;
|
|
264
|
+
var init_dist = __esm({
|
|
265
|
+
"node_modules/@clack/core/dist/index.mjs"() {
|
|
266
|
+
import_sisteransi = __toESM(require_src(), 1);
|
|
267
|
+
import_node_process = require("node:process");
|
|
268
|
+
f = __toESM(require("node:readline"), 1);
|
|
269
|
+
import_node_readline = __toESM(require("node:readline"), 1);
|
|
270
|
+
import_node_tty = require("node:tty");
|
|
271
|
+
import_picocolors = __toESM(require_picocolors(), 1);
|
|
272
|
+
M3 = { exports: {} };
|
|
273
|
+
(function(t2) {
|
|
274
|
+
var u3 = {};
|
|
275
|
+
t2.exports = u3, u3.eastAsianWidth = function(e3) {
|
|
276
|
+
var s2 = e3.charCodeAt(0), C5 = e3.length == 2 ? e3.charCodeAt(1) : 0, D5 = s2;
|
|
277
|
+
return 55296 <= s2 && s2 <= 56319 && 56320 <= C5 && C5 <= 57343 && (s2 &= 1023, C5 &= 1023, D5 = s2 << 10 | C5, D5 += 65536), D5 == 12288 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 ? "F" : D5 == 8361 || 65377 <= D5 && D5 <= 65470 || 65474 <= D5 && D5 <= 65479 || 65482 <= D5 && D5 <= 65487 || 65490 <= D5 && D5 <= 65495 || 65498 <= D5 && D5 <= 65500 || 65512 <= D5 && D5 <= 65518 ? "H" : 4352 <= D5 && D5 <= 4447 || 4515 <= D5 && D5 <= 4519 || 4602 <= D5 && D5 <= 4607 || 9001 <= D5 && D5 <= 9002 || 11904 <= D5 && D5 <= 11929 || 11931 <= D5 && D5 <= 12019 || 12032 <= D5 && D5 <= 12245 || 12272 <= D5 && D5 <= 12283 || 12289 <= D5 && D5 <= 12350 || 12353 <= D5 && D5 <= 12438 || 12441 <= D5 && D5 <= 12543 || 12549 <= D5 && D5 <= 12589 || 12593 <= D5 && D5 <= 12686 || 12688 <= D5 && D5 <= 12730 || 12736 <= D5 && D5 <= 12771 || 12784 <= D5 && D5 <= 12830 || 12832 <= D5 && D5 <= 12871 || 12880 <= D5 && D5 <= 13054 || 13056 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42124 || 42128 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 55216 <= D5 && D5 <= 55238 || 55243 <= D5 && D5 <= 55291 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65106 || 65108 <= D5 && D5 <= 65126 || 65128 <= D5 && D5 <= 65131 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127490 || 127504 <= D5 && D5 <= 127546 || 127552 <= D5 && D5 <= 127560 || 127568 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 194367 || 177984 <= D5 && D5 <= 196605 || 196608 <= D5 && D5 <= 262141 ? "W" : 32 <= D5 && D5 <= 126 || 162 <= D5 && D5 <= 163 || 165 <= D5 && D5 <= 166 || D5 == 172 || D5 == 175 || 10214 <= D5 && D5 <= 10221 || 10629 <= D5 && D5 <= 10630 ? "Na" : D5 == 161 || D5 == 164 || 167 <= D5 && D5 <= 168 || D5 == 170 || 173 <= D5 && D5 <= 174 || 176 <= D5 && D5 <= 180 || 182 <= D5 && D5 <= 186 || 188 <= D5 && D5 <= 191 || D5 == 198 || D5 == 208 || 215 <= D5 && D5 <= 216 || 222 <= D5 && D5 <= 225 || D5 == 230 || 232 <= D5 && D5 <= 234 || 236 <= D5 && D5 <= 237 || D5 == 240 || 242 <= D5 && D5 <= 243 || 247 <= D5 && D5 <= 250 || D5 == 252 || D5 == 254 || D5 == 257 || D5 == 273 || D5 == 275 || D5 == 283 || 294 <= D5 && D5 <= 295 || D5 == 299 || 305 <= D5 && D5 <= 307 || D5 == 312 || 319 <= D5 && D5 <= 322 || D5 == 324 || 328 <= D5 && D5 <= 331 || D5 == 333 || 338 <= D5 && D5 <= 339 || 358 <= D5 && D5 <= 359 || D5 == 363 || D5 == 462 || D5 == 464 || D5 == 466 || D5 == 468 || D5 == 470 || D5 == 472 || D5 == 474 || D5 == 476 || D5 == 593 || D5 == 609 || D5 == 708 || D5 == 711 || 713 <= D5 && D5 <= 715 || D5 == 717 || D5 == 720 || 728 <= D5 && D5 <= 731 || D5 == 733 || D5 == 735 || 768 <= D5 && D5 <= 879 || 913 <= D5 && D5 <= 929 || 931 <= D5 && D5 <= 937 || 945 <= D5 && D5 <= 961 || 963 <= D5 && D5 <= 969 || D5 == 1025 || 1040 <= D5 && D5 <= 1103 || D5 == 1105 || D5 == 8208 || 8211 <= D5 && D5 <= 8214 || 8216 <= D5 && D5 <= 8217 || 8220 <= D5 && D5 <= 8221 || 8224 <= D5 && D5 <= 8226 || 8228 <= D5 && D5 <= 8231 || D5 == 8240 || 8242 <= D5 && D5 <= 8243 || D5 == 8245 || D5 == 8251 || D5 == 8254 || D5 == 8308 || D5 == 8319 || 8321 <= D5 && D5 <= 8324 || D5 == 8364 || D5 == 8451 || D5 == 8453 || D5 == 8457 || D5 == 8467 || D5 == 8470 || 8481 <= D5 && D5 <= 8482 || D5 == 8486 || D5 == 8491 || 8531 <= D5 && D5 <= 8532 || 8539 <= D5 && D5 <= 8542 || 8544 <= D5 && D5 <= 8555 || 8560 <= D5 && D5 <= 8569 || D5 == 8585 || 8592 <= D5 && D5 <= 8601 || 8632 <= D5 && D5 <= 8633 || D5 == 8658 || D5 == 8660 || D5 == 8679 || D5 == 8704 || 8706 <= D5 && D5 <= 8707 || 8711 <= D5 && D5 <= 8712 || D5 == 8715 || D5 == 8719 || D5 == 8721 || D5 == 8725 || D5 == 8730 || 8733 <= D5 && D5 <= 8736 || D5 == 8739 || D5 == 8741 || 8743 <= D5 && D5 <= 8748 || D5 == 8750 || 8756 <= D5 && D5 <= 8759 || 8764 <= D5 && D5 <= 8765 || D5 == 8776 || D5 == 8780 || D5 == 8786 || 8800 <= D5 && D5 <= 8801 || 8804 <= D5 && D5 <= 8807 || 8810 <= D5 && D5 <= 8811 || 8814 <= D5 && D5 <= 8815 || 8834 <= D5 && D5 <= 8835 || 8838 <= D5 && D5 <= 8839 || D5 == 8853 || D5 == 8857 || D5 == 8869 || D5 == 8895 || D5 == 8978 || 9312 <= D5 && D5 <= 9449 || 9451 <= D5 && D5 <= 9547 || 9552 <= D5 && D5 <= 9587 || 9600 <= D5 && D5 <= 9615 || 9618 <= D5 && D5 <= 9621 || 9632 <= D5 && D5 <= 9633 || 9635 <= D5 && D5 <= 9641 || 9650 <= D5 && D5 <= 9651 || 9654 <= D5 && D5 <= 9655 || 9660 <= D5 && D5 <= 9661 || 9664 <= D5 && D5 <= 9665 || 9670 <= D5 && D5 <= 9672 || D5 == 9675 || 9678 <= D5 && D5 <= 9681 || 9698 <= D5 && D5 <= 9701 || D5 == 9711 || 9733 <= D5 && D5 <= 9734 || D5 == 9737 || 9742 <= D5 && D5 <= 9743 || 9748 <= D5 && D5 <= 9749 || D5 == 9756 || D5 == 9758 || D5 == 9792 || D5 == 9794 || 9824 <= D5 && D5 <= 9825 || 9827 <= D5 && D5 <= 9829 || 9831 <= D5 && D5 <= 9834 || 9836 <= D5 && D5 <= 9837 || D5 == 9839 || 9886 <= D5 && D5 <= 9887 || 9918 <= D5 && D5 <= 9919 || 9924 <= D5 && D5 <= 9933 || 9935 <= D5 && D5 <= 9953 || D5 == 9955 || 9960 <= D5 && D5 <= 9983 || D5 == 10045 || D5 == 10071 || 10102 <= D5 && D5 <= 10111 || 11093 <= D5 && D5 <= 11097 || 12872 <= D5 && D5 <= 12879 || 57344 <= D5 && D5 <= 63743 || 65024 <= D5 && D5 <= 65039 || D5 == 65533 || 127232 <= D5 && D5 <= 127242 || 127248 <= D5 && D5 <= 127277 || 127280 <= D5 && D5 <= 127337 || 127344 <= D5 && D5 <= 127386 || 917760 <= D5 && D5 <= 917999 || 983040 <= D5 && D5 <= 1048573 || 1048576 <= D5 && D5 <= 1114109 ? "A" : "N";
|
|
278
|
+
}, u3.characterLength = function(e3) {
|
|
279
|
+
var s2 = this.eastAsianWidth(e3);
|
|
280
|
+
return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
|
|
281
|
+
};
|
|
282
|
+
function F5(e3) {
|
|
283
|
+
return e3.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
284
|
+
}
|
|
285
|
+
u3.length = function(e3) {
|
|
286
|
+
for (var s2 = F5(e3), C5 = 0, D5 = 0; D5 < s2.length; D5++) C5 = C5 + this.characterLength(s2[D5]);
|
|
287
|
+
return C5;
|
|
288
|
+
}, u3.slice = function(e3, s2, C5) {
|
|
289
|
+
textLen = u3.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5);
|
|
290
|
+
for (var D5 = "", i3 = 0, n2 = F5(e3), E4 = 0; E4 < n2.length; E4++) {
|
|
291
|
+
var h4 = n2[E4], o3 = u3.length(h4);
|
|
292
|
+
if (i3 >= s2 - (o3 == 2 ? 1 : 0)) if (i3 + o3 <= C5) D5 += h4;
|
|
293
|
+
else break;
|
|
294
|
+
i3 += o3;
|
|
295
|
+
}
|
|
296
|
+
return D5;
|
|
297
|
+
};
|
|
298
|
+
})(M3);
|
|
299
|
+
J3 = M3.exports;
|
|
300
|
+
Q2 = j2(J3);
|
|
301
|
+
X2 = function() {
|
|
302
|
+
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;
|
|
303
|
+
};
|
|
304
|
+
DD2 = j2(X2);
|
|
305
|
+
m3 = 10;
|
|
306
|
+
T4 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`;
|
|
307
|
+
P2 = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`;
|
|
308
|
+
W3 = (t2 = 0) => (u3, F5, e3) => `\x1B[${38 + t2};2;${u3};${F5};${e3}m`;
|
|
309
|
+
r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
310
|
+
Object.keys(r.modifier);
|
|
311
|
+
uD2 = Object.keys(r.color);
|
|
312
|
+
FD2 = Object.keys(r.bgColor);
|
|
313
|
+
[...uD2, ...FD2];
|
|
314
|
+
eD2 = tD2();
|
|
315
|
+
g2 = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
316
|
+
sD2 = 39;
|
|
317
|
+
b4 = "\x07";
|
|
318
|
+
O3 = "[";
|
|
319
|
+
CD2 = "]";
|
|
320
|
+
I3 = "m";
|
|
321
|
+
w4 = `${CD2}8;;`;
|
|
322
|
+
N3 = (t2) => `${g2.values().next().value}${O3}${t2}${I3}`;
|
|
323
|
+
L4 = (t2) => `${g2.values().next().value}${w4}${t2}${b4}`;
|
|
324
|
+
iD2 = (t2) => t2.split(" ").map((u3) => A2(u3));
|
|
325
|
+
y3 = (t2, u3, F5) => {
|
|
326
|
+
const e3 = [...u3];
|
|
327
|
+
let s2 = false, C5 = false, D5 = A2(S3(t2[t2.length - 1]));
|
|
328
|
+
for (const [i3, n2] of e3.entries()) {
|
|
329
|
+
const E4 = A2(n2);
|
|
330
|
+
if (D5 + E4 <= F5 ? t2[t2.length - 1] += n2 : (t2.push(n2), D5 = 0), g2.has(n2) && (s2 = true, C5 = e3.slice(i3 + 1).join("").startsWith(w4)), s2) {
|
|
331
|
+
C5 ? n2 === b4 && (s2 = false, C5 = false) : n2 === I3 && (s2 = false);
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
D5 += E4, D5 === F5 && i3 < e3.length - 1 && (t2.push(""), D5 = 0);
|
|
335
|
+
}
|
|
336
|
+
!D5 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
|
|
337
|
+
};
|
|
338
|
+
rD2 = (t2) => {
|
|
339
|
+
const u3 = t2.split(" ");
|
|
340
|
+
let F5 = u3.length;
|
|
341
|
+
for (; F5 > 0 && !(A2(u3[F5 - 1]) > 0); ) F5--;
|
|
342
|
+
return F5 === u3.length ? t2 : u3.slice(0, F5).join(" ") + u3.slice(F5).join("");
|
|
343
|
+
};
|
|
344
|
+
ED2 = (t2, u3, F5 = {}) => {
|
|
345
|
+
if (F5.trim !== false && t2.trim() === "") return "";
|
|
346
|
+
let e3 = "", s2, C5;
|
|
347
|
+
const D5 = iD2(t2);
|
|
348
|
+
let i3 = [""];
|
|
349
|
+
for (const [E4, h4] of t2.split(" ").entries()) {
|
|
350
|
+
F5.trim !== false && (i3[i3.length - 1] = i3[i3.length - 1].trimStart());
|
|
351
|
+
let o3 = A2(i3[i3.length - 1]);
|
|
352
|
+
if (E4 !== 0 && (o3 >= u3 && (F5.wordWrap === false || F5.trim === false) && (i3.push(""), o3 = 0), (o3 > 0 || F5.trim === false) && (i3[i3.length - 1] += " ", o3++)), F5.hard && D5[E4] > u3) {
|
|
353
|
+
const B3 = u3 - o3, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u3);
|
|
354
|
+
Math.floor((D5[E4] - 1) / u3) < p4 && i3.push(""), y3(i3, h4, u3);
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
if (o3 + D5[E4] > u3 && o3 > 0 && D5[E4] > 0) {
|
|
358
|
+
if (F5.wordWrap === false && o3 < u3) {
|
|
359
|
+
y3(i3, h4, u3);
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
i3.push("");
|
|
363
|
+
}
|
|
364
|
+
if (o3 + D5[E4] > u3 && F5.wordWrap === false) {
|
|
365
|
+
y3(i3, h4, u3);
|
|
366
|
+
continue;
|
|
367
|
+
}
|
|
368
|
+
i3[i3.length - 1] += h4;
|
|
369
|
+
}
|
|
370
|
+
F5.trim !== false && (i3 = i3.map((E4) => rD2(E4)));
|
|
371
|
+
const n2 = [...i3.join(`
|
|
372
|
+
`)];
|
|
373
|
+
for (const [E4, h4] of n2.entries()) {
|
|
374
|
+
if (e3 += h4, g2.has(h4)) {
|
|
375
|
+
const { groups: B3 } = new RegExp(`(?:\\${O3}(?<code>\\d+)m|\\${w4}(?<uri>.*)${b4})`).exec(n2.slice(E4).join("")) || { groups: {} };
|
|
376
|
+
if (B3.code !== void 0) {
|
|
377
|
+
const p4 = Number.parseFloat(B3.code);
|
|
378
|
+
s2 = p4 === sD2 ? void 0 : p4;
|
|
379
|
+
} else B3.uri !== void 0 && (C5 = B3.uri.length === 0 ? void 0 : B3.uri);
|
|
380
|
+
}
|
|
381
|
+
const o3 = eD2.codes.get(Number(s2));
|
|
382
|
+
n2[E4 + 1] === `
|
|
383
|
+
` ? (C5 && (e3 += L4("")), s2 && o3 && (e3 += N3(o3))) : h4 === `
|
|
384
|
+
` && (s2 && o3 && (e3 += N3(s2)), C5 && (e3 += L4(C5)));
|
|
385
|
+
}
|
|
386
|
+
return e3;
|
|
387
|
+
};
|
|
388
|
+
oD2 = Object.defineProperty;
|
|
389
|
+
nD2 = (t2, u3, F5) => u3 in t2 ? oD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
390
|
+
a = (t2, u3, F5) => (nD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
391
|
+
V4 = Symbol("clack:cancel");
|
|
392
|
+
z3 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
|
|
393
|
+
lD2 = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
|
|
394
|
+
x3 = class {
|
|
395
|
+
constructor({ render: u3, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) {
|
|
396
|
+
a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u3.bind(this), this._track = C5, this.input = F5, this.output = e3;
|
|
397
|
+
}
|
|
398
|
+
prompt() {
|
|
399
|
+
const u3 = new import_node_tty.WriteStream(0);
|
|
400
|
+
return u3._write = (F5, e3, s2) => {
|
|
401
|
+
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
|
|
402
|
+
}, this.input.pipe(u3), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u3, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.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), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => {
|
|
403
|
+
this.once("submit", () => {
|
|
404
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(this.value);
|
|
405
|
+
}), this.once("cancel", () => {
|
|
406
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(V4);
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
on(u3, F5) {
|
|
411
|
+
const e3 = this.subscribers.get(u3) ?? [];
|
|
412
|
+
e3.push({ cb: F5 }), this.subscribers.set(u3, e3);
|
|
413
|
+
}
|
|
414
|
+
once(u3, F5) {
|
|
415
|
+
const e3 = this.subscribers.get(u3) ?? [];
|
|
416
|
+
e3.push({ cb: F5, once: true }), this.subscribers.set(u3, e3);
|
|
417
|
+
}
|
|
418
|
+
emit(u3, ...F5) {
|
|
419
|
+
const e3 = this.subscribers.get(u3) ?? [], s2 = [];
|
|
420
|
+
for (const C5 of e3) C5.cb(...F5), C5.once && s2.push(() => e3.splice(e3.indexOf(C5), 1));
|
|
421
|
+
for (const C5 of s2) C5();
|
|
422
|
+
}
|
|
423
|
+
unsubscribe() {
|
|
424
|
+
this.subscribers.clear();
|
|
425
|
+
}
|
|
426
|
+
onKeypress(u3, F5) {
|
|
427
|
+
if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F5?.name === "return") {
|
|
428
|
+
if (this.opts.validate) {
|
|
429
|
+
const e3 = this.opts.validate(this.value);
|
|
430
|
+
e3 && (this.error = e3, this.state = "error", this.rl.write(this.value));
|
|
431
|
+
}
|
|
432
|
+
this.state !== "error" && (this.state = "submit");
|
|
433
|
+
}
|
|
434
|
+
u3 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
435
|
+
}
|
|
436
|
+
close() {
|
|
437
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
438
|
+
`), v3(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
439
|
+
}
|
|
440
|
+
restoreCursor() {
|
|
441
|
+
const u3 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
442
|
+
`).length - 1;
|
|
443
|
+
this.output.write(import_sisteransi.cursor.move(-999, u3 * -1));
|
|
444
|
+
}
|
|
445
|
+
render() {
|
|
446
|
+
const u3 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
447
|
+
if (u3 !== this._prevFrame) {
|
|
448
|
+
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
449
|
+
else {
|
|
450
|
+
const F5 = aD2(this._prevFrame, u3);
|
|
451
|
+
if (this.restoreCursor(), F5 && F5?.length === 1) {
|
|
452
|
+
const e3 = F5[0];
|
|
453
|
+
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.lines(1));
|
|
454
|
+
const s2 = u3.split(`
|
|
455
|
+
`);
|
|
456
|
+
this.output.write(s2[e3]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1));
|
|
457
|
+
return;
|
|
458
|
+
} else if (F5 && F5?.length > 1) {
|
|
459
|
+
const e3 = F5[0];
|
|
460
|
+
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.down());
|
|
461
|
+
const s2 = u3.split(`
|
|
462
|
+
`).slice(e3);
|
|
463
|
+
this.output.write(s2.join(`
|
|
464
|
+
`)), this._prevFrame = u3;
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
this.output.write(import_sisteransi.erase.down());
|
|
468
|
+
}
|
|
469
|
+
this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
xD2 = class extends x3 {
|
|
474
|
+
get cursor() {
|
|
475
|
+
return this.value ? 0 : 1;
|
|
476
|
+
}
|
|
477
|
+
get _value() {
|
|
478
|
+
return this.cursor === 0;
|
|
479
|
+
}
|
|
480
|
+
constructor(u3) {
|
|
481
|
+
super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
|
|
482
|
+
this.value = this._value;
|
|
483
|
+
}), this.on("confirm", (F5) => {
|
|
484
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F5, this.state = "submit", this.close();
|
|
485
|
+
}), this.on("cursor", () => {
|
|
486
|
+
this.value = !this.value;
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
BD2 = Object.defineProperty;
|
|
491
|
+
cD2 = (t2, u3, F5) => u3 in t2 ? BD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
492
|
+
G4 = (t2, u3, F5) => (cD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
493
|
+
AD2 = class extends x3 {
|
|
494
|
+
constructor(u3) {
|
|
495
|
+
super(u3, false), G4(this, "options"), G4(this, "cursor", 0);
|
|
496
|
+
const { options: F5 } = u3;
|
|
497
|
+
this.options = Object.entries(F5).flatMap(([e3, s2]) => [{ value: e3, group: true, label: e3 }, ...s2.map((C5) => ({ ...C5, group: e3 }))]), this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e3 }) => e3 === u3.cursorAt), 0), this.on("cursor", (e3) => {
|
|
498
|
+
switch (e3) {
|
|
499
|
+
case "left":
|
|
500
|
+
case "up":
|
|
501
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
502
|
+
break;
|
|
503
|
+
case "down":
|
|
504
|
+
case "right":
|
|
505
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
506
|
+
break;
|
|
507
|
+
case "space":
|
|
508
|
+
this.toggleValue();
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
getGroupItems(u3) {
|
|
514
|
+
return this.options.filter((F5) => F5.group === u3);
|
|
515
|
+
}
|
|
516
|
+
isGroupSelected(u3) {
|
|
517
|
+
return this.getGroupItems(u3).every((F5) => this.value.includes(F5.value));
|
|
518
|
+
}
|
|
519
|
+
toggleValue() {
|
|
520
|
+
const u3 = this.options[this.cursor];
|
|
521
|
+
if (u3.group === true) {
|
|
522
|
+
const F5 = u3.value, e3 = this.getGroupItems(F5);
|
|
523
|
+
this.isGroupSelected(F5) ? this.value = this.value.filter((s2) => e3.findIndex((C5) => C5.value === s2) === -1) : this.value = [...this.value, ...e3.map((s2) => s2.value)], this.value = Array.from(new Set(this.value));
|
|
524
|
+
} else {
|
|
525
|
+
const F5 = this.value.includes(u3.value);
|
|
526
|
+
this.value = F5 ? this.value.filter((e3) => e3 !== u3.value) : [...this.value, u3.value];
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
pD2 = Object.defineProperty;
|
|
531
|
+
fD2 = (t2, u3, F5) => u3 in t2 ? pD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
532
|
+
K3 = (t2, u3, F5) => (fD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
533
|
+
gD2 = class extends x3 {
|
|
534
|
+
constructor(u3) {
|
|
535
|
+
super(u3, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u3.cursorAt), 0), this.on("key", (F5) => {
|
|
536
|
+
F5 === "a" && this.toggleAll();
|
|
537
|
+
}), this.on("cursor", (F5) => {
|
|
538
|
+
switch (F5) {
|
|
539
|
+
case "left":
|
|
540
|
+
case "up":
|
|
541
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
542
|
+
break;
|
|
543
|
+
case "down":
|
|
544
|
+
case "right":
|
|
545
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
546
|
+
break;
|
|
547
|
+
case "space":
|
|
548
|
+
this.toggleValue();
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
get _value() {
|
|
554
|
+
return this.options[this.cursor].value;
|
|
555
|
+
}
|
|
556
|
+
toggleAll() {
|
|
557
|
+
const u3 = this.value.length === this.options.length;
|
|
558
|
+
this.value = u3 ? [] : this.options.map((F5) => F5.value);
|
|
559
|
+
}
|
|
560
|
+
toggleValue() {
|
|
561
|
+
const u3 = this.value.includes(this._value);
|
|
562
|
+
this.value = u3 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value];
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
vD = Object.defineProperty;
|
|
566
|
+
dD2 = (t2, u3, F5) => u3 in t2 ? vD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
567
|
+
Y2 = (t2, u3, F5) => (dD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
568
|
+
mD2 = class extends x3 {
|
|
569
|
+
constructor({ mask: u3, ...F5 }) {
|
|
570
|
+
super(F5), Y2(this, "valueWithCursor", ""), Y2(this, "_mask", "\u2022"), this._mask = u3 ?? "\u2022", this.on("finalize", () => {
|
|
571
|
+
this.valueWithCursor = this.masked;
|
|
572
|
+
}), this.on("value", () => {
|
|
573
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
574
|
+
else {
|
|
575
|
+
const e3 = this.masked.slice(0, this.cursor), s2 = this.masked.slice(this.cursor);
|
|
576
|
+
this.valueWithCursor = `${e3}${import_picocolors.default.inverse(s2[0])}${s2.slice(1)}`;
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
get cursor() {
|
|
581
|
+
return this._cursor;
|
|
582
|
+
}
|
|
583
|
+
get masked() {
|
|
584
|
+
return this.value.replaceAll(/./g, this._mask);
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
bD2 = Object.defineProperty;
|
|
588
|
+
wD2 = (t2, u3, F5) => u3 in t2 ? bD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
589
|
+
Z3 = (t2, u3, F5) => (wD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
590
|
+
yD = class extends x3 {
|
|
591
|
+
constructor(u3) {
|
|
592
|
+
super(u3, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => {
|
|
593
|
+
switch (F5) {
|
|
594
|
+
case "left":
|
|
595
|
+
case "up":
|
|
596
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
597
|
+
break;
|
|
598
|
+
case "down":
|
|
599
|
+
case "right":
|
|
600
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
601
|
+
break;
|
|
602
|
+
}
|
|
603
|
+
this.changeValue();
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
get _value() {
|
|
607
|
+
return this.options[this.cursor];
|
|
608
|
+
}
|
|
609
|
+
changeValue() {
|
|
610
|
+
this.value = this._value.value;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
$D = Object.defineProperty;
|
|
614
|
+
kD = (t2, u3, F5) => u3 in t2 ? $D(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
615
|
+
H3 = (t2, u3, F5) => (kD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
616
|
+
_D = class extends x3 {
|
|
617
|
+
constructor(u3) {
|
|
618
|
+
super(u3, false), H3(this, "options"), H3(this, "cursor", 0), this.options = u3.options;
|
|
619
|
+
const F5 = this.options.map(({ value: [e3] }) => e3?.toLowerCase());
|
|
620
|
+
this.cursor = Math.max(F5.indexOf(u3.initialValue), 0), this.on("key", (e3) => {
|
|
621
|
+
if (!F5.includes(e3)) return;
|
|
622
|
+
const s2 = this.options.find(({ value: [C5] }) => C5?.toLowerCase() === e3);
|
|
623
|
+
s2 && (this.value = s2.value, this.state = "submit", this.emit("submit"));
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
SD = Object.defineProperty;
|
|
628
|
+
jD = (t2, u3, F5) => u3 in t2 ? SD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
629
|
+
MD = (t2, u3, F5) => (jD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
630
|
+
TD = class extends x3 {
|
|
631
|
+
constructor(u3) {
|
|
632
|
+
super(u3), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
|
|
633
|
+
this.value || (this.value = u3.defaultValue), this.valueWithCursor = this.value;
|
|
634
|
+
}), this.on("value", () => {
|
|
635
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
636
|
+
else {
|
|
637
|
+
const F5 = this.value.slice(0, this.cursor), e3 = this.value.slice(this.cursor);
|
|
638
|
+
this.valueWithCursor = `${F5}${import_picocolors.default.inverse(e3[0])}${e3.slice(1)}`;
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
get cursor() {
|
|
643
|
+
return this._cursor;
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
PD = globalThis.process.platform.startsWith("win");
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
// node_modules/@clack/prompts/dist/index.mjs
|
|
651
|
+
var dist_exports = {};
|
|
652
|
+
__export(dist_exports, {
|
|
653
|
+
cancel: () => ne,
|
|
654
|
+
confirm: () => Q3,
|
|
655
|
+
group: () => $e,
|
|
656
|
+
groupMultiselect: () => se,
|
|
657
|
+
intro: () => ae,
|
|
658
|
+
isCancel: () => hD2,
|
|
659
|
+
log: () => g3,
|
|
660
|
+
multiselect: () => re,
|
|
661
|
+
note: () => ie,
|
|
662
|
+
outro: () => ce,
|
|
663
|
+
password: () => Y3,
|
|
664
|
+
select: () => ee,
|
|
665
|
+
selectKey: () => te,
|
|
666
|
+
spinner: () => le,
|
|
667
|
+
text: () => J4
|
|
668
|
+
});
|
|
669
|
+
function N4() {
|
|
670
|
+
return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
671
|
+
}
|
|
672
|
+
function ue() {
|
|
673
|
+
const r3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
674
|
+
return new RegExp(r3, "g");
|
|
675
|
+
}
|
|
676
|
+
var import_node_process2, import_picocolors2, import_sisteransi2, p2, u, W4, D3, F3, f2, L5, a2, o, w5, S4, _5, y4, A3, q4, R5, G5, H4, K4, U5, Z4, z4, X3, h2, J4, Y3, Q3, ee, te, re, se, b5, ie, ne, ae, ce, g3, C3, le, $e;
|
|
677
|
+
var init_dist2 = __esm({
|
|
678
|
+
"node_modules/@clack/prompts/dist/index.mjs"() {
|
|
679
|
+
init_dist();
|
|
680
|
+
init_dist();
|
|
681
|
+
import_node_process2 = __toESM(require("node:process"), 1);
|
|
682
|
+
import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
683
|
+
import_sisteransi2 = __toESM(require_src(), 1);
|
|
684
|
+
p2 = N4();
|
|
685
|
+
u = (r3, n2) => p2 ? r3 : n2;
|
|
686
|
+
W4 = u("\u25C6", "*");
|
|
687
|
+
D3 = u("\u25A0", "x");
|
|
688
|
+
F3 = u("\u25B2", "x");
|
|
689
|
+
f2 = u("\u25C7", "o");
|
|
690
|
+
L5 = u("\u250C", "T");
|
|
691
|
+
a2 = u("\u2502", "|");
|
|
692
|
+
o = u("\u2514", "\u2014");
|
|
693
|
+
w5 = u("\u25CF", ">");
|
|
694
|
+
S4 = u("\u25CB", " ");
|
|
695
|
+
_5 = u("\u25FB", "[\u2022]");
|
|
696
|
+
y4 = u("\u25FC", "[+]");
|
|
697
|
+
A3 = u("\u25FB", "[ ]");
|
|
698
|
+
q4 = u("\u25AA", "\u2022");
|
|
699
|
+
R5 = u("\u2500", "-");
|
|
700
|
+
G5 = u("\u256E", "+");
|
|
701
|
+
H4 = u("\u251C", "+");
|
|
702
|
+
K4 = u("\u256F", "+");
|
|
703
|
+
U5 = u("\u25CF", "\u2022");
|
|
704
|
+
Z4 = u("\u25C6", "*");
|
|
705
|
+
z4 = u("\u25B2", "!");
|
|
706
|
+
X3 = u("\u25A0", "x");
|
|
707
|
+
h2 = (r3) => {
|
|
708
|
+
switch (r3) {
|
|
709
|
+
case "initial":
|
|
710
|
+
case "active":
|
|
711
|
+
return import_picocolors2.default.cyan(W4);
|
|
712
|
+
case "cancel":
|
|
713
|
+
return import_picocolors2.default.red(D3);
|
|
714
|
+
case "error":
|
|
715
|
+
return import_picocolors2.default.yellow(F3);
|
|
716
|
+
case "submit":
|
|
717
|
+
return import_picocolors2.default.green(f2);
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
J4 = (r3) => new TD({ validate: r3.validate, placeholder: r3.placeholder, defaultValue: r3.defaultValue, initialValue: r3.initialValue, render() {
|
|
721
|
+
const n2 = `${import_picocolors2.default.gray(a2)}
|
|
722
|
+
${h2(this.state)} ${r3.message}
|
|
723
|
+
`, s2 = r3.placeholder ? import_picocolors2.default.inverse(r3.placeholder[0]) + import_picocolors2.default.dim(r3.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t2 = this.value ? this.valueWithCursor : s2;
|
|
724
|
+
switch (this.state) {
|
|
725
|
+
case "error":
|
|
726
|
+
return `${n2.trim()}
|
|
727
|
+
${import_picocolors2.default.yellow(a2)} ${t2}
|
|
728
|
+
${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(this.error)}
|
|
729
|
+
`;
|
|
730
|
+
case "submit":
|
|
731
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r3.placeholder)}`;
|
|
732
|
+
case "cancel":
|
|
733
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
734
|
+
` + import_picocolors2.default.gray(a2) : ""}`;
|
|
735
|
+
default:
|
|
736
|
+
return `${n2}${import_picocolors2.default.cyan(a2)} ${t2}
|
|
737
|
+
${import_picocolors2.default.cyan(o)}
|
|
738
|
+
`;
|
|
739
|
+
}
|
|
740
|
+
} }).prompt();
|
|
741
|
+
Y3 = (r3) => new mD2({ validate: r3.validate, mask: r3.mask ?? q4, render() {
|
|
742
|
+
const n2 = `${import_picocolors2.default.gray(a2)}
|
|
743
|
+
${h2(this.state)} ${r3.message}
|
|
744
|
+
`, s2 = this.valueWithCursor, t2 = this.masked;
|
|
745
|
+
switch (this.state) {
|
|
746
|
+
case "error":
|
|
747
|
+
return `${n2.trim()}
|
|
748
|
+
${import_picocolors2.default.yellow(a2)} ${t2}
|
|
749
|
+
${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(this.error)}
|
|
750
|
+
`;
|
|
751
|
+
case "submit":
|
|
752
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(t2)}`;
|
|
753
|
+
case "cancel":
|
|
754
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(t2 ?? ""))}${t2 ? `
|
|
755
|
+
` + import_picocolors2.default.gray(a2) : ""}`;
|
|
756
|
+
default:
|
|
757
|
+
return `${n2}${import_picocolors2.default.cyan(a2)} ${s2}
|
|
758
|
+
${import_picocolors2.default.cyan(o)}
|
|
759
|
+
`;
|
|
760
|
+
}
|
|
761
|
+
} }).prompt();
|
|
762
|
+
Q3 = (r3) => {
|
|
763
|
+
const n2 = r3.active ?? "Yes", s2 = r3.inactive ?? "No";
|
|
764
|
+
return new xD2({ active: n2, inactive: s2, initialValue: r3.initialValue ?? true, render() {
|
|
765
|
+
const t2 = `${import_picocolors2.default.gray(a2)}
|
|
766
|
+
${h2(this.state)} ${r3.message}
|
|
767
|
+
`, i3 = this.value ? n2 : s2;
|
|
768
|
+
switch (this.state) {
|
|
769
|
+
case "submit":
|
|
770
|
+
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(i3)}`;
|
|
771
|
+
case "cancel":
|
|
772
|
+
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}
|
|
773
|
+
${import_picocolors2.default.gray(a2)}`;
|
|
774
|
+
default:
|
|
775
|
+
return `${t2}${import_picocolors2.default.cyan(a2)} ${this.value ? `${import_picocolors2.default.green(w5)} ${n2}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(n2)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(s2)}` : `${import_picocolors2.default.green(w5)} ${s2}`}
|
|
776
|
+
${import_picocolors2.default.cyan(o)}
|
|
777
|
+
`;
|
|
778
|
+
}
|
|
779
|
+
} }).prompt();
|
|
780
|
+
};
|
|
781
|
+
ee = (r3) => {
|
|
782
|
+
const n2 = (s2, t2) => {
|
|
783
|
+
const i3 = s2.label ?? String(s2.value);
|
|
784
|
+
return t2 === "active" ? `${import_picocolors2.default.green(w5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(i3)}`;
|
|
785
|
+
};
|
|
786
|
+
return new yD({ options: r3.options, initialValue: r3.initialValue, render() {
|
|
787
|
+
const s2 = `${import_picocolors2.default.gray(a2)}
|
|
788
|
+
${h2(this.state)} ${r3.message}
|
|
789
|
+
`;
|
|
790
|
+
switch (this.state) {
|
|
791
|
+
case "submit":
|
|
792
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "selected")}`;
|
|
793
|
+
case "cancel":
|
|
794
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "cancelled")}
|
|
795
|
+
${import_picocolors2.default.gray(a2)}`;
|
|
796
|
+
default:
|
|
797
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(`
|
|
798
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
799
|
+
${import_picocolors2.default.cyan(o)}
|
|
800
|
+
`;
|
|
801
|
+
}
|
|
802
|
+
} }).prompt();
|
|
803
|
+
};
|
|
804
|
+
te = (r3) => {
|
|
805
|
+
const n2 = (s2, t2 = "inactive") => {
|
|
806
|
+
const i3 = s2.label ?? String(s2.value);
|
|
807
|
+
return t2 === "selected" ? `${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : t2 === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${s2.value} `))} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${s2.value} `)))} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}`;
|
|
808
|
+
};
|
|
809
|
+
return new _D({ options: r3.options, initialValue: r3.initialValue, render() {
|
|
810
|
+
const s2 = `${import_picocolors2.default.gray(a2)}
|
|
811
|
+
${h2(this.state)} ${r3.message}
|
|
812
|
+
`;
|
|
813
|
+
switch (this.state) {
|
|
814
|
+
case "submit":
|
|
815
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options.find((t2) => t2.value === this.value), "selected")}`;
|
|
816
|
+
case "cancel":
|
|
817
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[0], "cancelled")}
|
|
818
|
+
${import_picocolors2.default.gray(a2)}`;
|
|
819
|
+
default:
|
|
820
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(`
|
|
821
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
822
|
+
${import_picocolors2.default.cyan(o)}
|
|
823
|
+
`;
|
|
824
|
+
}
|
|
825
|
+
} }).prompt();
|
|
826
|
+
};
|
|
827
|
+
re = (r3) => {
|
|
828
|
+
const n2 = (s2, t2) => {
|
|
829
|
+
const i3 = s2.label ?? String(s2.value);
|
|
830
|
+
return t2 === "active" ? `${import_picocolors2.default.cyan(_5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : t2 === "active-selected" ? `${import_picocolors2.default.green(y4)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors2.default.dim(i3)}` : `${import_picocolors2.default.dim(A3)} ${import_picocolors2.default.dim(i3)}`;
|
|
831
|
+
};
|
|
832
|
+
return new gD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) {
|
|
833
|
+
if (this.required && s2.length === 0) return `Please select at least one option.
|
|
834
|
+
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
835
|
+
}, render() {
|
|
836
|
+
let s2 = `${import_picocolors2.default.gray(a2)}
|
|
837
|
+
${h2(this.state)} ${r3.message}
|
|
838
|
+
`;
|
|
839
|
+
switch (this.state) {
|
|
840
|
+
case "submit":
|
|
841
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
|
|
842
|
+
case "cancel": {
|
|
843
|
+
const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
844
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${t2.trim() ? `${t2}
|
|
845
|
+
${import_picocolors2.default.gray(a2)}` : ""}`;
|
|
846
|
+
}
|
|
847
|
+
case "error": {
|
|
848
|
+
const t2 = this.error.split(`
|
|
849
|
+
`).map((i3, c4) => c4 === 0 ? `${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(i3)}` : ` ${i3}`).join(`
|
|
850
|
+
`);
|
|
851
|
+
return s2 + import_picocolors2.default.yellow(a2) + " " + this.options.map((i3, c4) => {
|
|
852
|
+
const l3 = this.value.includes(i3.value), $6 = c4 === this.cursor;
|
|
853
|
+
return $6 && l3 ? n2(i3, "active-selected") : l3 ? n2(i3, "selected") : n2(i3, $6 ? "active" : "inactive");
|
|
854
|
+
}).join(`
|
|
855
|
+
${import_picocolors2.default.yellow(a2)} `) + `
|
|
856
|
+
` + t2 + `
|
|
857
|
+
`;
|
|
858
|
+
}
|
|
859
|
+
default:
|
|
860
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => {
|
|
861
|
+
const c4 = this.value.includes(t2.value), l3 = i3 === this.cursor;
|
|
862
|
+
return l3 && c4 ? n2(t2, "active-selected") : c4 ? n2(t2, "selected") : n2(t2, l3 ? "active" : "inactive");
|
|
863
|
+
}).join(`
|
|
864
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
865
|
+
${import_picocolors2.default.cyan(o)}
|
|
866
|
+
`;
|
|
867
|
+
}
|
|
868
|
+
} }).prompt();
|
|
869
|
+
};
|
|
870
|
+
se = (r3) => {
|
|
871
|
+
const n2 = (s2, t2, i3 = []) => {
|
|
872
|
+
const c4 = s2.label ?? String(s2.value), l3 = typeof s2.group == "string", $6 = l3 && (i3[i3.indexOf(s2) + 1] ?? { group: true }), v5 = l3 && $6.group === true, m5 = l3 ? `${v5 ? o : a2} ` : "";
|
|
873
|
+
return t2 === "active" ? `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.cyan(_5)} ${c4} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "group-active" ? `${m5}${import_picocolors2.default.cyan(_5)} ${import_picocolors2.default.dim(c4)}` : t2 === "group-active-selected" ? `${m5}${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(c4)}` : t2 === "selected" ? `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(c4)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(c4))}` : t2 === "active-selected" ? `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.green(y4)} ${c4} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors2.default.dim(c4)}` : `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.dim(A3)} ${import_picocolors2.default.dim(c4)}`;
|
|
874
|
+
};
|
|
875
|
+
return new AD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) {
|
|
876
|
+
if (this.required && s2.length === 0) return `Please select at least one option.
|
|
877
|
+
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
878
|
+
}, render() {
|
|
879
|
+
let s2 = `${import_picocolors2.default.gray(a2)}
|
|
880
|
+
${h2(this.state)} ${r3.message}
|
|
881
|
+
`;
|
|
882
|
+
switch (this.state) {
|
|
883
|
+
case "submit":
|
|
884
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors2.default.dim(", "))}`;
|
|
885
|
+
case "cancel": {
|
|
886
|
+
const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
887
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${t2.trim() ? `${t2}
|
|
888
|
+
${import_picocolors2.default.gray(a2)}` : ""}`;
|
|
889
|
+
}
|
|
890
|
+
case "error": {
|
|
891
|
+
const t2 = this.error.split(`
|
|
892
|
+
`).map((i3, c4) => c4 === 0 ? `${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(i3)}` : ` ${i3}`).join(`
|
|
893
|
+
`);
|
|
894
|
+
return `${s2}${import_picocolors2.default.yellow(a2)} ${this.options.map((i3, c4, l3) => {
|
|
895
|
+
const $6 = this.value.includes(i3.value) || i3.group === true && this.isGroupSelected(`${i3.value}`), v5 = c4 === this.cursor;
|
|
896
|
+
return !v5 && typeof i3.group == "string" && this.options[this.cursor].value === i3.group ? n2(i3, $6 ? "group-active-selected" : "group-active", l3) : v5 && $6 ? n2(i3, "active-selected", l3) : $6 ? n2(i3, "selected", l3) : n2(i3, v5 ? "active" : "inactive", l3);
|
|
897
|
+
}).join(`
|
|
898
|
+
${import_picocolors2.default.yellow(a2)} `)}
|
|
899
|
+
${t2}
|
|
900
|
+
`;
|
|
901
|
+
}
|
|
902
|
+
default:
|
|
903
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3, c4) => {
|
|
904
|
+
const l3 = this.value.includes(t2.value) || t2.group === true && this.isGroupSelected(`${t2.value}`), $6 = i3 === this.cursor;
|
|
905
|
+
return !$6 && typeof t2.group == "string" && this.options[this.cursor].value === t2.group ? n2(t2, l3 ? "group-active-selected" : "group-active", c4) : $6 && l3 ? n2(t2, "active-selected", c4) : l3 ? n2(t2, "selected", c4) : n2(t2, $6 ? "active" : "inactive", c4);
|
|
906
|
+
}).join(`
|
|
907
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
908
|
+
${import_picocolors2.default.cyan(o)}
|
|
909
|
+
`;
|
|
910
|
+
}
|
|
911
|
+
} }).prompt();
|
|
912
|
+
};
|
|
913
|
+
b5 = (r3) => r3.replace(ue(), "");
|
|
914
|
+
ie = (r3 = "", n2 = "") => {
|
|
915
|
+
const s2 = `
|
|
916
|
+
${r3}
|
|
917
|
+
`.split(`
|
|
918
|
+
`), t2 = Math.max(s2.reduce((c4, l3) => (l3 = b5(l3), l3.length > c4 ? l3.length : c4), 0), b5(n2).length) + 2, i3 = s2.map((c4) => `${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(c4)}${" ".repeat(t2 - b5(c4).length)}${import_picocolors2.default.gray(a2)}`).join(`
|
|
919
|
+
`);
|
|
920
|
+
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
921
|
+
${import_picocolors2.default.green(f2)} ${import_picocolors2.default.reset(n2)} ${import_picocolors2.default.gray(R5.repeat(Math.max(t2 - n2.length - 1, 1)) + G5)}
|
|
922
|
+
${i3}
|
|
923
|
+
${import_picocolors2.default.gray(H4 + R5.repeat(t2 + 2) + K4)}
|
|
924
|
+
`);
|
|
925
|
+
};
|
|
926
|
+
ne = (r3 = "") => {
|
|
927
|
+
process.stdout.write(`${import_picocolors2.default.gray(o)} ${import_picocolors2.default.red(r3)}
|
|
928
|
+
|
|
929
|
+
`);
|
|
930
|
+
};
|
|
931
|
+
ae = (r3 = "") => {
|
|
932
|
+
process.stdout.write(`${import_picocolors2.default.gray(L5)} ${r3}
|
|
933
|
+
`);
|
|
934
|
+
};
|
|
935
|
+
ce = (r3 = "") => {
|
|
936
|
+
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
937
|
+
${import_picocolors2.default.gray(o)} ${r3}
|
|
938
|
+
|
|
939
|
+
`);
|
|
940
|
+
};
|
|
941
|
+
g3 = { message: (r3 = "", { symbol: n2 = import_picocolors2.default.gray(a2) } = {}) => {
|
|
942
|
+
const s2 = [`${import_picocolors2.default.gray(a2)}`];
|
|
943
|
+
if (r3) {
|
|
944
|
+
const [t2, ...i3] = r3.split(`
|
|
945
|
+
`);
|
|
946
|
+
s2.push(`${n2} ${t2}`, ...i3.map((c4) => `${import_picocolors2.default.gray(a2)} ${c4}`));
|
|
947
|
+
}
|
|
948
|
+
process.stdout.write(`${s2.join(`
|
|
949
|
+
`)}
|
|
950
|
+
`);
|
|
951
|
+
}, info: (r3) => {
|
|
952
|
+
g3.message(r3, { symbol: import_picocolors2.default.blue(U5) });
|
|
953
|
+
}, success: (r3) => {
|
|
954
|
+
g3.message(r3, { symbol: import_picocolors2.default.green(Z4) });
|
|
955
|
+
}, step: (r3) => {
|
|
956
|
+
g3.message(r3, { symbol: import_picocolors2.default.green(f2) });
|
|
957
|
+
}, warn: (r3) => {
|
|
958
|
+
g3.message(r3, { symbol: import_picocolors2.default.yellow(z4) });
|
|
959
|
+
}, warning: (r3) => {
|
|
960
|
+
g3.warn(r3);
|
|
961
|
+
}, error: (r3) => {
|
|
962
|
+
g3.message(r3, { symbol: import_picocolors2.default.red(X3) });
|
|
963
|
+
} };
|
|
964
|
+
C3 = p2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"];
|
|
965
|
+
le = () => {
|
|
966
|
+
let r3, n2;
|
|
967
|
+
const s2 = p2 ? 80 : 120;
|
|
968
|
+
return { start(t2 = "") {
|
|
969
|
+
t2 = t2.replace(/\.?\.?\.$/, ""), r3 = WD(), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
970
|
+
${import_picocolors2.default.magenta("\u25CB")} ${t2}
|
|
971
|
+
`);
|
|
972
|
+
let i3 = 0, c4 = 0;
|
|
973
|
+
n2 = setInterval(() => {
|
|
974
|
+
let l3 = C3[i3];
|
|
975
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors2.default.magenta(l3)} ${t2}${Math.floor(c4) >= 1 ? ".".repeat(Math.floor(c4)).slice(0, 3) : ""}
|
|
976
|
+
`), i3 = i3 === C3.length - 1 ? 0 : i3 + 1, c4 = c4 === C3.length ? 0 : c4 + 0.125;
|
|
977
|
+
}, s2);
|
|
978
|
+
}, stop(t2 = "") {
|
|
979
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n2), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
980
|
+
${import_picocolors2.default.green(f2)} ${t2}
|
|
981
|
+
`), r3();
|
|
982
|
+
} };
|
|
983
|
+
};
|
|
984
|
+
$e = async (r3, n2) => {
|
|
985
|
+
const s2 = {}, t2 = Object.keys(r3);
|
|
986
|
+
for (const i3 of t2) {
|
|
987
|
+
const c4 = r3[i3], l3 = await c4({ results: s2 })?.catch(($6) => {
|
|
988
|
+
throw $6;
|
|
989
|
+
});
|
|
990
|
+
if (typeof n2?.onCancel == "function" && hD2(l3)) {
|
|
991
|
+
s2[i3] = "canceled", n2.onCancel({ results: s2 });
|
|
992
|
+
continue;
|
|
993
|
+
}
|
|
994
|
+
s2[i3] = l3;
|
|
995
|
+
}
|
|
996
|
+
return s2;
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
|
|
164
1001
|
// node_modules/isexe/windows.js
|
|
165
1002
|
var require_windows = __commonJS({
|
|
166
1003
|
"node_modules/isexe/windows.js"(exports2, module2) {
|
|
@@ -225,10 +1062,10 @@ var require_mode = __commonJS({
|
|
|
225
1062
|
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
226
1063
|
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
227
1064
|
var u3 = parseInt("100", 8);
|
|
228
|
-
var
|
|
1065
|
+
var g5 = parseInt("010", 8);
|
|
229
1066
|
var o3 = parseInt("001", 8);
|
|
230
|
-
var ug = u3 |
|
|
231
|
-
var ret = mod & o3 || mod &
|
|
1067
|
+
var ug = u3 | g5;
|
|
1068
|
+
var ret = mod & o3 || mod & g5 && gid === myGid || mod & u3 && uid === myUid || mod & ug && myUid === 0;
|
|
232
1069
|
return ret;
|
|
233
1070
|
}
|
|
234
1071
|
}
|
|
@@ -6390,13 +7227,13 @@ function p3(e3, t2, r3) {
|
|
|
6390
7227
|
function m4(e3) {
|
|
6391
7228
|
f3(e3, void 0, o2);
|
|
6392
7229
|
}
|
|
6393
|
-
function
|
|
7230
|
+
function g4(e3, t2, r3) {
|
|
6394
7231
|
if ("function" != typeof e3) throw new TypeError("Argument is not a function");
|
|
6395
7232
|
return Function.prototype.apply.call(e3, t2, r3);
|
|
6396
7233
|
}
|
|
6397
7234
|
function w6(e3, t2, r3) {
|
|
6398
7235
|
try {
|
|
6399
|
-
return c3(
|
|
7236
|
+
return c3(g4(e3, t2, r3));
|
|
6400
7237
|
} catch (e4) {
|
|
6401
7238
|
return d6(e4);
|
|
6402
7239
|
}
|
|
@@ -6450,7 +7287,7 @@ function $5(e3, t2, r3) {
|
|
|
6450
7287
|
function M4(e3, t2, r3) {
|
|
6451
7288
|
if (void 0 === e3) throw new TypeError(`${t2} is required in '${r3}'.`);
|
|
6452
7289
|
}
|
|
6453
|
-
function
|
|
7290
|
+
function Y4(e3) {
|
|
6454
7291
|
return Number(e3);
|
|
6455
7292
|
}
|
|
6456
7293
|
function Q4(e3) {
|
|
@@ -6465,7 +7302,7 @@ function N5(e3, t2) {
|
|
|
6465
7302
|
}(o3), o3 < 0 || o3 > r3) throw new TypeError(`${t2} is outside the accepted range of 0 to ${r3}, inclusive`);
|
|
6466
7303
|
return z5(o3) && 0 !== o3 ? o3 : 0;
|
|
6467
7304
|
}
|
|
6468
|
-
function
|
|
7305
|
+
function H5(e3) {
|
|
6469
7306
|
if (!r2(e3)) return false;
|
|
6470
7307
|
if ("function" != typeof e3.getReader) return false;
|
|
6471
7308
|
try {
|
|
@@ -6489,7 +7326,7 @@ function V5(e3, t2) {
|
|
|
6489
7326
|
function U6(e3, t2) {
|
|
6490
7327
|
e3._reader._readRequests.push(t2);
|
|
6491
7328
|
}
|
|
6492
|
-
function
|
|
7329
|
+
function G6(e3, t2, r3) {
|
|
6493
7330
|
const o3 = e3._reader._readRequests.shift();
|
|
6494
7331
|
r3 ? o3._closeSteps() : o3._chunkSteps(t2);
|
|
6495
7332
|
}
|
|
@@ -6516,12 +7353,12 @@ function oe(e3) {
|
|
|
6516
7353
|
if (!r2(e3)) return false;
|
|
6517
7354
|
if (!Object.prototype.hasOwnProperty.call(e3, "_asyncIteratorImpl")) return false;
|
|
6518
7355
|
try {
|
|
6519
|
-
return e3._asyncIteratorImpl instanceof
|
|
7356
|
+
return e3._asyncIteratorImpl instanceof te2;
|
|
6520
7357
|
} catch (e4) {
|
|
6521
7358
|
return false;
|
|
6522
7359
|
}
|
|
6523
7360
|
}
|
|
6524
|
-
function
|
|
7361
|
+
function ne2(e3) {
|
|
6525
7362
|
return new TypeError(`ReadableStreamAsyncIterator.${e3} can only be used on a ReadableSteamAsyncIterator`);
|
|
6526
7363
|
}
|
|
6527
7364
|
function ie2(e3, t2, r3, o3, n2) {
|
|
@@ -6535,7 +7372,7 @@ function le2(e3) {
|
|
|
6535
7372
|
}(e3.buffer, e3.byteOffset, e3.byteOffset + e3.byteLength);
|
|
6536
7373
|
return new Uint8Array(t2);
|
|
6537
7374
|
}
|
|
6538
|
-
function
|
|
7375
|
+
function se2(e3) {
|
|
6539
7376
|
const t2 = e3._queue.shift();
|
|
6540
7377
|
return e3._queueTotalSize -= t2.size, e3._queueTotalSize < 0 && (e3._queueTotalSize = 0), t2.value;
|
|
6541
7378
|
}
|
|
@@ -6576,7 +7413,7 @@ function _e(e3, t2) {
|
|
|
6576
7413
|
let r3 = false;
|
|
6577
7414
|
"closed" === e3._state && (r3 = true);
|
|
6578
7415
|
const o3 = pe(t2);
|
|
6579
|
-
"default" === t2.readerType ?
|
|
7416
|
+
"default" === t2.readerType ? G6(e3, o3, r3) : function(e4, t3, r4) {
|
|
6580
7417
|
const o4 = e4._reader._readIntoRequests.shift();
|
|
6581
7418
|
r4 ? o4._closeSteps(t3) : o4._chunkSteps(t3);
|
|
6582
7419
|
}(e3, o3, r3);
|
|
@@ -6705,7 +7542,7 @@ function Ie(e3, t2) {
|
|
|
6705
7542
|
function De(e3) {
|
|
6706
7543
|
return new TypeError(`ReadableStreamBYOBReader.prototype.${e3} can only be used on a ReadableStreamBYOBReader`);
|
|
6707
7544
|
}
|
|
6708
|
-
function $
|
|
7545
|
+
function $e2(e3, t2) {
|
|
6709
7546
|
const { highWaterMark: r3 } = e3;
|
|
6710
7547
|
if (void 0 === r3) return t2;
|
|
6711
7548
|
if (ae2(r3) || r3 < 0) throw new RangeError("Invalid highWaterMark");
|
|
@@ -6718,10 +7555,10 @@ function Me(e3) {
|
|
|
6718
7555
|
function Ye(e3, t2) {
|
|
6719
7556
|
F4(e3, t2);
|
|
6720
7557
|
const r3 = null == e3 ? void 0 : e3.highWaterMark, o3 = null == e3 ? void 0 : e3.size;
|
|
6721
|
-
return { highWaterMark: void 0 === r3 ? void 0 :
|
|
7558
|
+
return { highWaterMark: void 0 === r3 ? void 0 : Y4(r3), size: void 0 === o3 ? void 0 : Qe(o3, `${t2} has member 'size' that`) };
|
|
6722
7559
|
}
|
|
6723
7560
|
function Qe(e3, t2) {
|
|
6724
|
-
return I4(e3, t2), (t3) =>
|
|
7561
|
+
return I4(e3, t2), (t3) => Y4(e3(t3));
|
|
6725
7562
|
}
|
|
6726
7563
|
function Ne(e3, t2, r3) {
|
|
6727
7564
|
return I4(e3, r3), (r4) => w6(e3, t2, [r4]);
|
|
@@ -6730,7 +7567,7 @@ function He(e3, t2, r3) {
|
|
|
6730
7567
|
return I4(e3, r3), () => w6(e3, t2, []);
|
|
6731
7568
|
}
|
|
6732
7569
|
function xe(e3, t2, r3) {
|
|
6733
|
-
return I4(e3, r3), (r4) =>
|
|
7570
|
+
return I4(e3, r3), (r4) => g4(e3, t2, [r4]);
|
|
6734
7571
|
}
|
|
6735
7572
|
function Ve(e3, t2, r3) {
|
|
6736
7573
|
return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]);
|
|
@@ -6829,7 +7666,7 @@ function dt(e3) {
|
|
|
6829
7666
|
const t3 = e4._controlledWritableStream;
|
|
6830
7667
|
(function(e5) {
|
|
6831
7668
|
e5._inFlightCloseRequest = e5._closeRequest, e5._closeRequest = void 0;
|
|
6832
|
-
})(t3),
|
|
7669
|
+
})(t3), se2(e4);
|
|
6833
7670
|
const r4 = e4._closeAlgorithm();
|
|
6834
7671
|
ut(e4), b6(r4, () => (function(e5) {
|
|
6835
7672
|
e5._inFlightCloseRequest._resolve(void 0), e5._inFlightCloseRequest = void 0, "erroring" === e5._state && (e5._storedError = void 0, void 0 !== e5._pendingAbortRequest && (e5._pendingAbortRequest._resolve(), e5._pendingAbortRequest = void 0)), e5._state = "closed";
|
|
@@ -6848,7 +7685,7 @@ function dt(e3) {
|
|
|
6848
7685
|
e5._inFlightWriteRequest._resolve(void 0), e5._inFlightWriteRequest = void 0;
|
|
6849
7686
|
}(r4);
|
|
6850
7687
|
const t4 = r4._state;
|
|
6851
|
-
if (
|
|
7688
|
+
if (se2(e4), !rt(r4) && "writable" === t4) {
|
|
6852
7689
|
const t5 = bt(e4);
|
|
6853
7690
|
nt(r4, t5);
|
|
6854
7691
|
}
|
|
@@ -6914,9 +7751,9 @@ function Et(e3) {
|
|
|
6914
7751
|
function kt(e3, t2, r3, o3, n2, a4) {
|
|
6915
7752
|
const i3 = e3.getReader(), l3 = t2.getWriter();
|
|
6916
7753
|
Vt(e3) && (e3._disturbed = true);
|
|
6917
|
-
let s2, _7,
|
|
7754
|
+
let s2, _7, g5, w7 = false, S6 = false, v5 = "readable", R7 = "writable", T6 = false, q6 = false;
|
|
6918
7755
|
const C5 = u2((e4) => {
|
|
6919
|
-
|
|
7756
|
+
g5 = e4;
|
|
6920
7757
|
});
|
|
6921
7758
|
let E4 = Promise.resolve(void 0);
|
|
6922
7759
|
return u2((P4, W6) => {
|
|
@@ -6945,7 +7782,7 @@ function kt(e3, t2, r3, o3, n2, a4) {
|
|
|
6945
7782
|
if (void 0 !== a4 && (k7 = () => {
|
|
6946
7783
|
const e4 = void 0 !== a4.reason ? a4.reason : new Wt("Aborted", "AbortError"), t3 = [];
|
|
6947
7784
|
o3 || t3.push(() => "writable" === R7 ? l3.abort(e4) : c3(void 0)), n2 || t3.push(() => "readable" === v5 ? i3.cancel(e4) : c3(void 0)), z6(() => Promise.all(t3.map((e5) => e5())), true, e4);
|
|
6948
|
-
}, a4.aborted ? k7() : a4.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true,
|
|
7785
|
+
}, a4.aborted ? k7() : a4.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true, g5()), "errored" === v5) A5(s2);
|
|
6949
7786
|
else if ("erroring" === R7 || "errored" === R7) j4(_7);
|
|
6950
7787
|
else if ("closed" === v5) B3();
|
|
6951
7788
|
else if (T6 || "closed" === R7) {
|
|
@@ -6975,7 +7812,7 @@ function kt(e3, t2, r3, o3, n2, a4) {
|
|
|
6975
7812
|
w7 || (b6(i3.closed, B3, A5), b6(l3.closed, function() {
|
|
6976
7813
|
return S6 || (R7 = "closed"), null;
|
|
6977
7814
|
}, j4)), q6 ? O5() : y5(() => {
|
|
6978
|
-
q6 = true,
|
|
7815
|
+
q6 = true, g5(), O5();
|
|
6979
7816
|
});
|
|
6980
7817
|
});
|
|
6981
7818
|
}
|
|
@@ -6994,7 +7831,7 @@ function Ot(e3, t2) {
|
|
|
6994
7831
|
function y6(e5) {
|
|
6995
7832
|
_6(e5.closed, (t4) => (e5 !== i3 || (o3.error(t4), n2.error(t4), h4 && p4 || a4(void 0)), null));
|
|
6996
7833
|
}
|
|
6997
|
-
function
|
|
7834
|
+
function g5() {
|
|
6998
7835
|
l3 && (i3.releaseLock(), i3 = e4.getReader(), y6(i3), l3 = false), b6(i3.read(), (e5) => {
|
|
6999
7836
|
var t4, r4;
|
|
7000
7837
|
if (d7 = false, f4 = false, e5.done) return h4 || o3.close(), p4 || n2.close(), null === (t4 = o3.byobRequest) || void 0 === t4 || t4.respond(0), null === (r4 = n2.byobRequest) || void 0 === r4 || r4.respond(0), h4 && p4 || a4(void 0), null;
|
|
@@ -7038,13 +7875,13 @@ function Ot(e3, t2) {
|
|
|
7038
7875
|
if (s2) return d7 = true, c3(void 0);
|
|
7039
7876
|
s2 = true;
|
|
7040
7877
|
const e5 = o3.byobRequest;
|
|
7041
|
-
return null === e5 ?
|
|
7878
|
+
return null === e5 ? g5() : w7(e5.view, false), c3(void 0);
|
|
7042
7879
|
}
|
|
7043
7880
|
function v5() {
|
|
7044
7881
|
if (s2) return f4 = true, c3(void 0);
|
|
7045
7882
|
s2 = true;
|
|
7046
7883
|
const e5 = n2.byobRequest;
|
|
7047
|
-
return null === e5 ?
|
|
7884
|
+
return null === e5 ? g5() : w7(e5.view, true), c3(void 0);
|
|
7048
7885
|
}
|
|
7049
7886
|
function R7(e5) {
|
|
7050
7887
|
if (h4 = true, t3 = e5, p4) {
|
|
@@ -7086,7 +7923,7 @@ function Ot(e3, t2) {
|
|
|
7086
7923
|
}
|
|
7087
7924
|
return p4;
|
|
7088
7925
|
}
|
|
7089
|
-
function
|
|
7926
|
+
function g5(e5) {
|
|
7090
7927
|
if (h4 = true, n2 = e5, f4) {
|
|
7091
7928
|
const e6 = [o3, n2], t4 = r3.cancel(e6);
|
|
7092
7929
|
l3(t4);
|
|
@@ -7097,7 +7934,7 @@ function Ot(e3, t2) {
|
|
|
7097
7934
|
a4 = e5;
|
|
7098
7935
|
}, pull: m5, cancel: y6 }), S6 = new ReadableStream3({ start(e5) {
|
|
7099
7936
|
i3 = e5;
|
|
7100
|
-
}, pull: m5, cancel:
|
|
7937
|
+
}, pull: m5, cancel: g5 });
|
|
7101
7938
|
return _6(r3.closed, (e5) => (a4.error(e5), i3.error(e5), f4 && h4 || l3(void 0), null)), [w7, S6];
|
|
7102
7939
|
}(e3);
|
|
7103
7940
|
}
|
|
@@ -7150,7 +7987,7 @@ function Mt(e3, t2, r3) {
|
|
|
7150
7987
|
return I4(e3, r3), (r4) => w6(e3, t2, [r4]);
|
|
7151
7988
|
}
|
|
7152
7989
|
function Yt(e3, t2, r3) {
|
|
7153
|
-
return I4(e3, r3), (r4) =>
|
|
7990
|
+
return I4(e3, r3), (r4) => g4(e3, t2, [r4]);
|
|
7154
7991
|
}
|
|
7155
7992
|
function Qt(e3, t2) {
|
|
7156
7993
|
if ("bytes" !== (e3 = `${e3}`)) throw new TypeError(`${t2} '${e3}' is not a valid enumeration value for ReadableStreamType`);
|
|
@@ -7178,7 +8015,7 @@ function xt(e3, t2) {
|
|
|
7178
8015
|
F4(e3, t2);
|
|
7179
8016
|
const r3 = null == e3 ? void 0 : e3.readable;
|
|
7180
8017
|
M4(r3, "readable", "ReadableWritablePair"), function(e4, t3) {
|
|
7181
|
-
if (!
|
|
8018
|
+
if (!H5(e4)) throw new TypeError(`${t3} is not a ReadableStream.`);
|
|
7182
8019
|
}(r3, `${t2} has member 'readable' that`);
|
|
7183
8020
|
const o3 = null == e3 ? void 0 : e3.writable;
|
|
7184
8021
|
return M4(o3, "writable", "ReadableWritablePair"), function(e4, t3) {
|
|
@@ -7225,7 +8062,7 @@ function Kt(e3) {
|
|
|
7225
8062
|
function Zt(e3, t2) {
|
|
7226
8063
|
F4(e3, t2);
|
|
7227
8064
|
const r3 = null == e3 ? void 0 : e3.highWaterMark;
|
|
7228
|
-
return M4(r3, "highWaterMark", "QueuingStrategyInit"), { highWaterMark:
|
|
8065
|
+
return M4(r3, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: Y4(r3) };
|
|
7229
8066
|
}
|
|
7230
8067
|
function tr(e3) {
|
|
7231
8068
|
return new TypeError(`ByteLengthQueuingStrategy.prototype.${e3} can only be used on a ByteLengthQueuingStrategy`);
|
|
@@ -7243,7 +8080,7 @@ function ir(e3, t2, r3) {
|
|
|
7243
8080
|
return I4(e3, r3), (r4) => w6(e3, t2, [r4]);
|
|
7244
8081
|
}
|
|
7245
8082
|
function lr(e3, t2, r3) {
|
|
7246
|
-
return I4(e3, r3), (r4) =>
|
|
8083
|
+
return I4(e3, r3), (r4) => g4(e3, t2, [r4]);
|
|
7247
8084
|
}
|
|
7248
8085
|
function sr(e3, t2, r3) {
|
|
7249
8086
|
return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]);
|
|
@@ -7333,7 +8170,7 @@ function qr(e3) {
|
|
|
7333
8170
|
function Cr(e3) {
|
|
7334
8171
|
"erroring" === e3._writableState && qr(e3);
|
|
7335
8172
|
}
|
|
7336
|
-
var e2, o2, a3, i2, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader,
|
|
8173
|
+
var e2, o2, a3, i2, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader, te2, re2, ae2, ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamBYOBReader, Ue, WritableStream, WritableStreamDefaultWriter, lt, WritableStreamDefaultController, Pt, Wt, ReadableStreamDefaultController, ReadableStream3, er, ByteLengthQueuingStrategy, or, CountQueuingStrategy, TransformStream2, TransformStreamDefaultController;
|
|
7337
8174
|
var init_ponyfill = __esm({
|
|
7338
8175
|
"node_modules/formdata-node/node_modules/web-streams-polyfill/dist/ponyfill.mjs"() {
|
|
7339
8176
|
e2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol : (e3) => `Symbol(${e3})`;
|
|
@@ -7423,7 +8260,7 @@ var init_ponyfill = __esm({
|
|
|
7423
8260
|
}
|
|
7424
8261
|
};
|
|
7425
8262
|
Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamDefaultReader.prototype.cancel, "cancel"), n(ReadableStreamDefaultReader.prototype.read, "read"), n(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, e2.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true });
|
|
7426
|
-
|
|
8263
|
+
te2 = class {
|
|
7427
8264
|
constructor(e3, t2) {
|
|
7428
8265
|
this._ongoingPromise = void 0, this._isFinished = false, this._reader = e3, this._preventCancel = t2;
|
|
7429
8266
|
}
|
|
@@ -7459,9 +8296,9 @@ var init_ponyfill = __esm({
|
|
|
7459
8296
|
}
|
|
7460
8297
|
};
|
|
7461
8298
|
re2 = { next() {
|
|
7462
|
-
return oe(this) ? this._asyncIteratorImpl.next() : d6(
|
|
8299
|
+
return oe(this) ? this._asyncIteratorImpl.next() : d6(ne2("next"));
|
|
7463
8300
|
}, return(e3) {
|
|
7464
|
-
return oe(this) ? this._asyncIteratorImpl.return(e3) : d6(
|
|
8301
|
+
return oe(this) ? this._asyncIteratorImpl.return(e3) : d6(ne2("return"));
|
|
7465
8302
|
} };
|
|
7466
8303
|
"symbol" == typeof e2.asyncIterator && Object.defineProperty(re2, e2.asyncIterator, { value() {
|
|
7467
8304
|
return this;
|
|
@@ -7572,7 +8409,7 @@ var init_ponyfill = __esm({
|
|
|
7572
8409
|
}(e4), 0 === X4(r3)) me(e4, i3, n2, a4);
|
|
7573
8410
|
else {
|
|
7574
8411
|
e4._pendingPullIntos.length > 0 && Ce(e4);
|
|
7575
|
-
|
|
8412
|
+
G6(r3, new Uint8Array(i3, n2, a4), false);
|
|
7576
8413
|
}
|
|
7577
8414
|
else Le(r3) ? (me(e4, i3, n2, a4), Te(e4)) : me(e4, i3, n2, a4);
|
|
7578
8415
|
be(e4);
|
|
@@ -7700,7 +8537,7 @@ var init_ponyfill = __esm({
|
|
|
7700
8537
|
const u3 = r5();
|
|
7701
8538
|
b6(c3(u3), () => (t4._started = true, dt(t4), null), (r6) => (t4._started = true, Ze(e5, r6), null));
|
|
7702
8539
|
}(e4, n3, a5, i3, l3, s2, r4, o4);
|
|
7703
|
-
}(this, o3, $
|
|
8540
|
+
}(this, o3, $e2(r3, 1), a4);
|
|
7704
8541
|
}
|
|
7705
8542
|
get locked() {
|
|
7706
8543
|
if (!Ge(this)) throw _t("locked");
|
|
@@ -7871,7 +8708,7 @@ var init_ponyfill = __esm({
|
|
|
7871
8708
|
return function(e4, t2) {
|
|
7872
8709
|
if (!Ft(e4)) return;
|
|
7873
8710
|
const r3 = e4._controlledReadableStream;
|
|
7874
|
-
if (Ut(r3) && X4(r3) > 0)
|
|
8711
|
+
if (Ut(r3) && X4(r3) > 0) G6(r3, t2, false);
|
|
7875
8712
|
else {
|
|
7876
8713
|
let r4;
|
|
7877
8714
|
try {
|
|
@@ -7900,7 +8737,7 @@ var init_ponyfill = __esm({
|
|
|
7900
8737
|
[q5](e3) {
|
|
7901
8738
|
const t2 = this._controlledReadableStream;
|
|
7902
8739
|
if (this._queue.length > 0) {
|
|
7903
|
-
const r3 =
|
|
8740
|
+
const r3 = se2(this);
|
|
7904
8741
|
this._closeRequested && 0 === this._queue.length ? (jt(this), Xt(t2)) : At(this), e3._chunkSteps(r3);
|
|
7905
8742
|
} else U6(t2, e3), At(this);
|
|
7906
8743
|
}
|
|
@@ -7919,10 +8756,10 @@ var init_ponyfill = __esm({
|
|
|
7919
8756
|
var n2;
|
|
7920
8757
|
if ((n2 = this)._state = "readable", n2._reader = void 0, n2._storedError = void 0, n2._disturbed = false, "bytes" === o3.type) {
|
|
7921
8758
|
if (void 0 !== r3.size) throw new RangeError("The strategy for a byte stream cannot have a size function");
|
|
7922
|
-
Oe(this, o3, $
|
|
8759
|
+
Oe(this, o3, $e2(r3, 0));
|
|
7923
8760
|
} else {
|
|
7924
8761
|
const e4 = Me(r3);
|
|
7925
|
-
It(this, o3, $
|
|
8762
|
+
It(this, o3, $e2(r3, 1), e4);
|
|
7926
8763
|
}
|
|
7927
8764
|
}
|
|
7928
8765
|
get locked() {
|
|
@@ -7943,7 +8780,7 @@ var init_ponyfill = __esm({
|
|
|
7943
8780
|
}(this);
|
|
7944
8781
|
}
|
|
7945
8782
|
pipeThrough(e3, t2 = {}) {
|
|
7946
|
-
if (!
|
|
8783
|
+
if (!H5(this)) throw Kt("pipeThrough");
|
|
7947
8784
|
$5(e3, 1, "pipeThrough");
|
|
7948
8785
|
const r3 = xt(e3, "First parameter"), o3 = Ht(t2, "Second parameter");
|
|
7949
8786
|
if (this.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
|
|
@@ -7951,7 +8788,7 @@ var init_ponyfill = __esm({
|
|
|
7951
8788
|
return m4(kt(this, r3.writable, o3.preventClose, o3.preventAbort, o3.preventCancel, o3.signal)), r3.readable;
|
|
7952
8789
|
}
|
|
7953
8790
|
pipeTo(e3, t2 = {}) {
|
|
7954
|
-
if (!
|
|
8791
|
+
if (!H5(this)) return d6(Kt("pipeTo"));
|
|
7955
8792
|
if (void 0 === e3) return d6("Parameter 1 is required in 'pipeTo'.");
|
|
7956
8793
|
if (!x4(e3)) return d6(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
|
|
7957
8794
|
let r3;
|
|
@@ -7963,14 +8800,14 @@ var init_ponyfill = __esm({
|
|
|
7963
8800
|
return this.locked ? d6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : e3.locked ? d6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : kt(this, e3, r3.preventClose, r3.preventAbort, r3.preventCancel, r3.signal);
|
|
7964
8801
|
}
|
|
7965
8802
|
tee() {
|
|
7966
|
-
if (!
|
|
8803
|
+
if (!H5(this)) throw Kt("tee");
|
|
7967
8804
|
if (this.locked) throw new TypeError("Cannot tee a stream that already has a reader");
|
|
7968
8805
|
return Ot(this);
|
|
7969
8806
|
}
|
|
7970
8807
|
values(e3) {
|
|
7971
|
-
if (!
|
|
8808
|
+
if (!H5(this)) throw Kt("values");
|
|
7972
8809
|
return function(e4, t2) {
|
|
7973
|
-
const r3 = e4.getReader(), o3 = new
|
|
8810
|
+
const r3 = e4.getReader(), o3 = new te2(r3, t2), n2 = Object.create(re2);
|
|
7974
8811
|
return n2._asyncIteratorImpl = o3, n2;
|
|
7975
8812
|
}(this, function(e4, t2) {
|
|
7976
8813
|
F4(e4, t2);
|
|
@@ -8022,7 +8859,7 @@ var init_ponyfill = __esm({
|
|
|
8022
8859
|
}(e3, "First parameter");
|
|
8023
8860
|
if (void 0 !== a4.readableType) throw new RangeError("Invalid readableType specified");
|
|
8024
8861
|
if (void 0 !== a4.writableType) throw new RangeError("Invalid writableType specified");
|
|
8025
|
-
const i3 = $
|
|
8862
|
+
const i3 = $e2(n2, 0), l3 = Me(n2), s2 = $e2(o3, 1), f4 = Me(o3);
|
|
8026
8863
|
let b7;
|
|
8027
8864
|
!function(e4, t3, r4, o4, n3, a5) {
|
|
8028
8865
|
function i4() {
|
|
@@ -47084,8 +47921,8 @@ var $ = (t2, { onFlag: n2, onArgument: r3 }) => {
|
|
|
47084
47921
|
const a4 = N(i3);
|
|
47085
47922
|
if (a4) {
|
|
47086
47923
|
if (o3(), !n2) continue;
|
|
47087
|
-
const [l3, f4,
|
|
47088
|
-
if (
|
|
47924
|
+
const [l3, f4, g5] = a4;
|
|
47925
|
+
if (g5) for (let c4 = 0; c4 < l3.length; c4 += 1) {
|
|
47089
47926
|
o3();
|
|
47090
47927
|
const u3 = c4 === l3.length - 1;
|
|
47091
47928
|
e3 = n2(l3[c4], u3 ? f4 : void 0, [s2, c4 + 1, u3]);
|
|
@@ -47111,9 +47948,9 @@ var E = (t2, n2) => {
|
|
|
47111
47948
|
var U = (t2, n2 = process.argv.slice(2), { ignore: r3 } = {}) => {
|
|
47112
47949
|
const e3 = [], o3 = K(t2), s2 = {}, i3 = [];
|
|
47113
47950
|
return i3[F] = [], $(n2, { onFlag(a4, l3, f4) {
|
|
47114
|
-
const
|
|
47115
|
-
if (!r3?.(
|
|
47116
|
-
if (
|
|
47951
|
+
const g5 = w(o3, a4);
|
|
47952
|
+
if (!r3?.(g5 ? V : k, a4, l3)) {
|
|
47953
|
+
if (g5) {
|
|
47117
47954
|
const [c4, u3] = o3[a4], y6 = d(u3, l3), p4 = (P4, A5) => {
|
|
47118
47955
|
e3.push(f4), A5 && e3.push(A5), c4.push(m(u3, P4 || ""));
|
|
47119
47956
|
};
|
|
@@ -47628,9 +48465,9 @@ function x2(t2, e3, r3, n2) {
|
|
|
47628
48465
|
if (o3 && l3.flags.help === true) return u3(), process.exit(0);
|
|
47629
48466
|
if (e3.parameters) {
|
|
47630
48467
|
let { parameters: c4 } = e3, m5 = l3._;
|
|
47631
|
-
const
|
|
47632
|
-
if (
|
|
47633
|
-
c4 = c4.slice(0,
|
|
48468
|
+
const g5 = c4.indexOf("--"), v5 = c4.slice(g5 + 1), h4 = /* @__PURE__ */ Object.create(null);
|
|
48469
|
+
if (g5 > -1 && v5.length > 0) {
|
|
48470
|
+
c4 = c4.slice(0, g5);
|
|
47634
48471
|
const E4 = l3._["--"];
|
|
47635
48472
|
m5 = m5.slice(0, -E4.length || void 0), b3(h4, w3(c4), m5, u3), b3(h4, w3(v5), E4, u3);
|
|
47636
48473
|
} else b3(h4, w3(c4), m5, u3);
|
|
@@ -47672,7 +48509,7 @@ function G3(t2, e3) {
|
|
|
47672
48509
|
// package.json
|
|
47673
48510
|
var package_default = {
|
|
47674
48511
|
name: "opencommit",
|
|
47675
|
-
version: "3.2.
|
|
48512
|
+
version: "3.2.11",
|
|
47676
48513
|
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
|
47677
48514
|
keywords: [
|
|
47678
48515
|
"git",
|
|
@@ -47783,607 +48620,8 @@ var package_default = {
|
|
|
47783
48620
|
}
|
|
47784
48621
|
};
|
|
47785
48622
|
|
|
47786
|
-
//
|
|
47787
|
-
|
|
47788
|
-
var import_node_process = require("node:process");
|
|
47789
|
-
var f = __toESM(require("node:readline"), 1);
|
|
47790
|
-
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
47791
|
-
var import_node_tty = require("node:tty");
|
|
47792
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
47793
|
-
function q3({ onlyFirst: t2 = false } = {}) {
|
|
47794
|
-
const u3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
47795
|
-
return new RegExp(u3, t2 ? void 0 : "g");
|
|
47796
|
-
}
|
|
47797
|
-
function S3(t2) {
|
|
47798
|
-
if (typeof t2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``);
|
|
47799
|
-
return t2.replace(q3(), "");
|
|
47800
|
-
}
|
|
47801
|
-
function j2(t2) {
|
|
47802
|
-
return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
|
|
47803
|
-
}
|
|
47804
|
-
var M3 = { exports: {} };
|
|
47805
|
-
(function(t2) {
|
|
47806
|
-
var u3 = {};
|
|
47807
|
-
t2.exports = u3, u3.eastAsianWidth = function(e3) {
|
|
47808
|
-
var s2 = e3.charCodeAt(0), C5 = e3.length == 2 ? e3.charCodeAt(1) : 0, D5 = s2;
|
|
47809
|
-
return 55296 <= s2 && s2 <= 56319 && 56320 <= C5 && C5 <= 57343 && (s2 &= 1023, C5 &= 1023, D5 = s2 << 10 | C5, D5 += 65536), D5 == 12288 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 ? "F" : D5 == 8361 || 65377 <= D5 && D5 <= 65470 || 65474 <= D5 && D5 <= 65479 || 65482 <= D5 && D5 <= 65487 || 65490 <= D5 && D5 <= 65495 || 65498 <= D5 && D5 <= 65500 || 65512 <= D5 && D5 <= 65518 ? "H" : 4352 <= D5 && D5 <= 4447 || 4515 <= D5 && D5 <= 4519 || 4602 <= D5 && D5 <= 4607 || 9001 <= D5 && D5 <= 9002 || 11904 <= D5 && D5 <= 11929 || 11931 <= D5 && D5 <= 12019 || 12032 <= D5 && D5 <= 12245 || 12272 <= D5 && D5 <= 12283 || 12289 <= D5 && D5 <= 12350 || 12353 <= D5 && D5 <= 12438 || 12441 <= D5 && D5 <= 12543 || 12549 <= D5 && D5 <= 12589 || 12593 <= D5 && D5 <= 12686 || 12688 <= D5 && D5 <= 12730 || 12736 <= D5 && D5 <= 12771 || 12784 <= D5 && D5 <= 12830 || 12832 <= D5 && D5 <= 12871 || 12880 <= D5 && D5 <= 13054 || 13056 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42124 || 42128 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 55216 <= D5 && D5 <= 55238 || 55243 <= D5 && D5 <= 55291 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65106 || 65108 <= D5 && D5 <= 65126 || 65128 <= D5 && D5 <= 65131 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127490 || 127504 <= D5 && D5 <= 127546 || 127552 <= D5 && D5 <= 127560 || 127568 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 194367 || 177984 <= D5 && D5 <= 196605 || 196608 <= D5 && D5 <= 262141 ? "W" : 32 <= D5 && D5 <= 126 || 162 <= D5 && D5 <= 163 || 165 <= D5 && D5 <= 166 || D5 == 172 || D5 == 175 || 10214 <= D5 && D5 <= 10221 || 10629 <= D5 && D5 <= 10630 ? "Na" : D5 == 161 || D5 == 164 || 167 <= D5 && D5 <= 168 || D5 == 170 || 173 <= D5 && D5 <= 174 || 176 <= D5 && D5 <= 180 || 182 <= D5 && D5 <= 186 || 188 <= D5 && D5 <= 191 || D5 == 198 || D5 == 208 || 215 <= D5 && D5 <= 216 || 222 <= D5 && D5 <= 225 || D5 == 230 || 232 <= D5 && D5 <= 234 || 236 <= D5 && D5 <= 237 || D5 == 240 || 242 <= D5 && D5 <= 243 || 247 <= D5 && D5 <= 250 || D5 == 252 || D5 == 254 || D5 == 257 || D5 == 273 || D5 == 275 || D5 == 283 || 294 <= D5 && D5 <= 295 || D5 == 299 || 305 <= D5 && D5 <= 307 || D5 == 312 || 319 <= D5 && D5 <= 322 || D5 == 324 || 328 <= D5 && D5 <= 331 || D5 == 333 || 338 <= D5 && D5 <= 339 || 358 <= D5 && D5 <= 359 || D5 == 363 || D5 == 462 || D5 == 464 || D5 == 466 || D5 == 468 || D5 == 470 || D5 == 472 || D5 == 474 || D5 == 476 || D5 == 593 || D5 == 609 || D5 == 708 || D5 == 711 || 713 <= D5 && D5 <= 715 || D5 == 717 || D5 == 720 || 728 <= D5 && D5 <= 731 || D5 == 733 || D5 == 735 || 768 <= D5 && D5 <= 879 || 913 <= D5 && D5 <= 929 || 931 <= D5 && D5 <= 937 || 945 <= D5 && D5 <= 961 || 963 <= D5 && D5 <= 969 || D5 == 1025 || 1040 <= D5 && D5 <= 1103 || D5 == 1105 || D5 == 8208 || 8211 <= D5 && D5 <= 8214 || 8216 <= D5 && D5 <= 8217 || 8220 <= D5 && D5 <= 8221 || 8224 <= D5 && D5 <= 8226 || 8228 <= D5 && D5 <= 8231 || D5 == 8240 || 8242 <= D5 && D5 <= 8243 || D5 == 8245 || D5 == 8251 || D5 == 8254 || D5 == 8308 || D5 == 8319 || 8321 <= D5 && D5 <= 8324 || D5 == 8364 || D5 == 8451 || D5 == 8453 || D5 == 8457 || D5 == 8467 || D5 == 8470 || 8481 <= D5 && D5 <= 8482 || D5 == 8486 || D5 == 8491 || 8531 <= D5 && D5 <= 8532 || 8539 <= D5 && D5 <= 8542 || 8544 <= D5 && D5 <= 8555 || 8560 <= D5 && D5 <= 8569 || D5 == 8585 || 8592 <= D5 && D5 <= 8601 || 8632 <= D5 && D5 <= 8633 || D5 == 8658 || D5 == 8660 || D5 == 8679 || D5 == 8704 || 8706 <= D5 && D5 <= 8707 || 8711 <= D5 && D5 <= 8712 || D5 == 8715 || D5 == 8719 || D5 == 8721 || D5 == 8725 || D5 == 8730 || 8733 <= D5 && D5 <= 8736 || D5 == 8739 || D5 == 8741 || 8743 <= D5 && D5 <= 8748 || D5 == 8750 || 8756 <= D5 && D5 <= 8759 || 8764 <= D5 && D5 <= 8765 || D5 == 8776 || D5 == 8780 || D5 == 8786 || 8800 <= D5 && D5 <= 8801 || 8804 <= D5 && D5 <= 8807 || 8810 <= D5 && D5 <= 8811 || 8814 <= D5 && D5 <= 8815 || 8834 <= D5 && D5 <= 8835 || 8838 <= D5 && D5 <= 8839 || D5 == 8853 || D5 == 8857 || D5 == 8869 || D5 == 8895 || D5 == 8978 || 9312 <= D5 && D5 <= 9449 || 9451 <= D5 && D5 <= 9547 || 9552 <= D5 && D5 <= 9587 || 9600 <= D5 && D5 <= 9615 || 9618 <= D5 && D5 <= 9621 || 9632 <= D5 && D5 <= 9633 || 9635 <= D5 && D5 <= 9641 || 9650 <= D5 && D5 <= 9651 || 9654 <= D5 && D5 <= 9655 || 9660 <= D5 && D5 <= 9661 || 9664 <= D5 && D5 <= 9665 || 9670 <= D5 && D5 <= 9672 || D5 == 9675 || 9678 <= D5 && D5 <= 9681 || 9698 <= D5 && D5 <= 9701 || D5 == 9711 || 9733 <= D5 && D5 <= 9734 || D5 == 9737 || 9742 <= D5 && D5 <= 9743 || 9748 <= D5 && D5 <= 9749 || D5 == 9756 || D5 == 9758 || D5 == 9792 || D5 == 9794 || 9824 <= D5 && D5 <= 9825 || 9827 <= D5 && D5 <= 9829 || 9831 <= D5 && D5 <= 9834 || 9836 <= D5 && D5 <= 9837 || D5 == 9839 || 9886 <= D5 && D5 <= 9887 || 9918 <= D5 && D5 <= 9919 || 9924 <= D5 && D5 <= 9933 || 9935 <= D5 && D5 <= 9953 || D5 == 9955 || 9960 <= D5 && D5 <= 9983 || D5 == 10045 || D5 == 10071 || 10102 <= D5 && D5 <= 10111 || 11093 <= D5 && D5 <= 11097 || 12872 <= D5 && D5 <= 12879 || 57344 <= D5 && D5 <= 63743 || 65024 <= D5 && D5 <= 65039 || D5 == 65533 || 127232 <= D5 && D5 <= 127242 || 127248 <= D5 && D5 <= 127277 || 127280 <= D5 && D5 <= 127337 || 127344 <= D5 && D5 <= 127386 || 917760 <= D5 && D5 <= 917999 || 983040 <= D5 && D5 <= 1048573 || 1048576 <= D5 && D5 <= 1114109 ? "A" : "N";
|
|
47810
|
-
}, u3.characterLength = function(e3) {
|
|
47811
|
-
var s2 = this.eastAsianWidth(e3);
|
|
47812
|
-
return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
|
|
47813
|
-
};
|
|
47814
|
-
function F5(e3) {
|
|
47815
|
-
return e3.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
47816
|
-
}
|
|
47817
|
-
u3.length = function(e3) {
|
|
47818
|
-
for (var s2 = F5(e3), C5 = 0, D5 = 0; D5 < s2.length; D5++) C5 = C5 + this.characterLength(s2[D5]);
|
|
47819
|
-
return C5;
|
|
47820
|
-
}, u3.slice = function(e3, s2, C5) {
|
|
47821
|
-
textLen = u3.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5);
|
|
47822
|
-
for (var D5 = "", i3 = 0, n2 = F5(e3), E4 = 0; E4 < n2.length; E4++) {
|
|
47823
|
-
var h4 = n2[E4], o3 = u3.length(h4);
|
|
47824
|
-
if (i3 >= s2 - (o3 == 2 ? 1 : 0)) if (i3 + o3 <= C5) D5 += h4;
|
|
47825
|
-
else break;
|
|
47826
|
-
i3 += o3;
|
|
47827
|
-
}
|
|
47828
|
-
return D5;
|
|
47829
|
-
};
|
|
47830
|
-
})(M3);
|
|
47831
|
-
var J3 = M3.exports;
|
|
47832
|
-
var Q2 = j2(J3);
|
|
47833
|
-
var X2 = function() {
|
|
47834
|
-
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;
|
|
47835
|
-
};
|
|
47836
|
-
var DD2 = j2(X2);
|
|
47837
|
-
function A2(t2, u3 = {}) {
|
|
47838
|
-
if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = S3(t2), t2.length === 0)) return 0;
|
|
47839
|
-
t2 = t2.replace(DD2(), " ");
|
|
47840
|
-
const F5 = u3.ambiguousIsNarrow ? 1 : 2;
|
|
47841
|
-
let e3 = 0;
|
|
47842
|
-
for (const s2 of t2) {
|
|
47843
|
-
const C5 = s2.codePointAt(0);
|
|
47844
|
-
if (C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879) continue;
|
|
47845
|
-
switch (Q2.eastAsianWidth(s2)) {
|
|
47846
|
-
case "F":
|
|
47847
|
-
case "W":
|
|
47848
|
-
e3 += 2;
|
|
47849
|
-
break;
|
|
47850
|
-
case "A":
|
|
47851
|
-
e3 += F5;
|
|
47852
|
-
break;
|
|
47853
|
-
default:
|
|
47854
|
-
e3 += 1;
|
|
47855
|
-
}
|
|
47856
|
-
}
|
|
47857
|
-
return e3;
|
|
47858
|
-
}
|
|
47859
|
-
var m3 = 10;
|
|
47860
|
-
var T4 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`;
|
|
47861
|
-
var P2 = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`;
|
|
47862
|
-
var W3 = (t2 = 0) => (u3, F5, e3) => `\x1B[${38 + t2};2;${u3};${F5};${e3}m`;
|
|
47863
|
-
var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
47864
|
-
Object.keys(r.modifier);
|
|
47865
|
-
var uD2 = Object.keys(r.color);
|
|
47866
|
-
var FD2 = Object.keys(r.bgColor);
|
|
47867
|
-
[...uD2, ...FD2];
|
|
47868
|
-
function tD2() {
|
|
47869
|
-
const t2 = /* @__PURE__ */ new Map();
|
|
47870
|
-
for (const [u3, F5] of Object.entries(r)) {
|
|
47871
|
-
for (const [e3, s2] of Object.entries(F5)) r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]);
|
|
47872
|
-
Object.defineProperty(r, u3, { value: F5, enumerable: false });
|
|
47873
|
-
}
|
|
47874
|
-
return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F5, e3) => u3 === F5 && F5 === e3 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
|
|
47875
|
-
const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
|
|
47876
|
-
if (!F5) return [0, 0, 0];
|
|
47877
|
-
let [e3] = F5;
|
|
47878
|
-
e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join(""));
|
|
47879
|
-
const s2 = Number.parseInt(e3, 16);
|
|
47880
|
-
return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
|
|
47881
|
-
}, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
|
|
47882
|
-
if (u3 < 8) return 30 + u3;
|
|
47883
|
-
if (u3 < 16) return 90 + (u3 - 8);
|
|
47884
|
-
let F5, e3, s2;
|
|
47885
|
-
if (u3 >= 232) F5 = ((u3 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5;
|
|
47886
|
-
else {
|
|
47887
|
-
u3 -= 16;
|
|
47888
|
-
const i3 = u3 % 36;
|
|
47889
|
-
F5 = Math.floor(u3 / 36) / 5, e3 = Math.floor(i3 / 6) / 5, s2 = i3 % 6 / 5;
|
|
47890
|
-
}
|
|
47891
|
-
const C5 = Math.max(F5, e3, s2) * 2;
|
|
47892
|
-
if (C5 === 0) return 30;
|
|
47893
|
-
let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5));
|
|
47894
|
-
return C5 === 2 && (D5 += 60), D5;
|
|
47895
|
-
}, enumerable: false }, rgbToAnsi: { value: (u3, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F5, e3)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
|
|
47896
|
-
}
|
|
47897
|
-
var eD2 = tD2();
|
|
47898
|
-
var g2 = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
47899
|
-
var sD2 = 39;
|
|
47900
|
-
var b4 = "\x07";
|
|
47901
|
-
var O3 = "[";
|
|
47902
|
-
var CD2 = "]";
|
|
47903
|
-
var I3 = "m";
|
|
47904
|
-
var w4 = `${CD2}8;;`;
|
|
47905
|
-
var N3 = (t2) => `${g2.values().next().value}${O3}${t2}${I3}`;
|
|
47906
|
-
var L4 = (t2) => `${g2.values().next().value}${w4}${t2}${b4}`;
|
|
47907
|
-
var iD2 = (t2) => t2.split(" ").map((u3) => A2(u3));
|
|
47908
|
-
var y3 = (t2, u3, F5) => {
|
|
47909
|
-
const e3 = [...u3];
|
|
47910
|
-
let s2 = false, C5 = false, D5 = A2(S3(t2[t2.length - 1]));
|
|
47911
|
-
for (const [i3, n2] of e3.entries()) {
|
|
47912
|
-
const E4 = A2(n2);
|
|
47913
|
-
if (D5 + E4 <= F5 ? t2[t2.length - 1] += n2 : (t2.push(n2), D5 = 0), g2.has(n2) && (s2 = true, C5 = e3.slice(i3 + 1).join("").startsWith(w4)), s2) {
|
|
47914
|
-
C5 ? n2 === b4 && (s2 = false, C5 = false) : n2 === I3 && (s2 = false);
|
|
47915
|
-
continue;
|
|
47916
|
-
}
|
|
47917
|
-
D5 += E4, D5 === F5 && i3 < e3.length - 1 && (t2.push(""), D5 = 0);
|
|
47918
|
-
}
|
|
47919
|
-
!D5 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
|
|
47920
|
-
};
|
|
47921
|
-
var rD2 = (t2) => {
|
|
47922
|
-
const u3 = t2.split(" ");
|
|
47923
|
-
let F5 = u3.length;
|
|
47924
|
-
for (; F5 > 0 && !(A2(u3[F5 - 1]) > 0); ) F5--;
|
|
47925
|
-
return F5 === u3.length ? t2 : u3.slice(0, F5).join(" ") + u3.slice(F5).join("");
|
|
47926
|
-
};
|
|
47927
|
-
var ED2 = (t2, u3, F5 = {}) => {
|
|
47928
|
-
if (F5.trim !== false && t2.trim() === "") return "";
|
|
47929
|
-
let e3 = "", s2, C5;
|
|
47930
|
-
const D5 = iD2(t2);
|
|
47931
|
-
let i3 = [""];
|
|
47932
|
-
for (const [E4, h4] of t2.split(" ").entries()) {
|
|
47933
|
-
F5.trim !== false && (i3[i3.length - 1] = i3[i3.length - 1].trimStart());
|
|
47934
|
-
let o3 = A2(i3[i3.length - 1]);
|
|
47935
|
-
if (E4 !== 0 && (o3 >= u3 && (F5.wordWrap === false || F5.trim === false) && (i3.push(""), o3 = 0), (o3 > 0 || F5.trim === false) && (i3[i3.length - 1] += " ", o3++)), F5.hard && D5[E4] > u3) {
|
|
47936
|
-
const B3 = u3 - o3, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u3);
|
|
47937
|
-
Math.floor((D5[E4] - 1) / u3) < p4 && i3.push(""), y3(i3, h4, u3);
|
|
47938
|
-
continue;
|
|
47939
|
-
}
|
|
47940
|
-
if (o3 + D5[E4] > u3 && o3 > 0 && D5[E4] > 0) {
|
|
47941
|
-
if (F5.wordWrap === false && o3 < u3) {
|
|
47942
|
-
y3(i3, h4, u3);
|
|
47943
|
-
continue;
|
|
47944
|
-
}
|
|
47945
|
-
i3.push("");
|
|
47946
|
-
}
|
|
47947
|
-
if (o3 + D5[E4] > u3 && F5.wordWrap === false) {
|
|
47948
|
-
y3(i3, h4, u3);
|
|
47949
|
-
continue;
|
|
47950
|
-
}
|
|
47951
|
-
i3[i3.length - 1] += h4;
|
|
47952
|
-
}
|
|
47953
|
-
F5.trim !== false && (i3 = i3.map((E4) => rD2(E4)));
|
|
47954
|
-
const n2 = [...i3.join(`
|
|
47955
|
-
`)];
|
|
47956
|
-
for (const [E4, h4] of n2.entries()) {
|
|
47957
|
-
if (e3 += h4, g2.has(h4)) {
|
|
47958
|
-
const { groups: B3 } = new RegExp(`(?:\\${O3}(?<code>\\d+)m|\\${w4}(?<uri>.*)${b4})`).exec(n2.slice(E4).join("")) || { groups: {} };
|
|
47959
|
-
if (B3.code !== void 0) {
|
|
47960
|
-
const p4 = Number.parseFloat(B3.code);
|
|
47961
|
-
s2 = p4 === sD2 ? void 0 : p4;
|
|
47962
|
-
} else B3.uri !== void 0 && (C5 = B3.uri.length === 0 ? void 0 : B3.uri);
|
|
47963
|
-
}
|
|
47964
|
-
const o3 = eD2.codes.get(Number(s2));
|
|
47965
|
-
n2[E4 + 1] === `
|
|
47966
|
-
` ? (C5 && (e3 += L4("")), s2 && o3 && (e3 += N3(o3))) : h4 === `
|
|
47967
|
-
` && (s2 && o3 && (e3 += N3(s2)), C5 && (e3 += L4(C5)));
|
|
47968
|
-
}
|
|
47969
|
-
return e3;
|
|
47970
|
-
};
|
|
47971
|
-
function R4(t2, u3, F5) {
|
|
47972
|
-
return String(t2).normalize().replace(/\r\n/g, `
|
|
47973
|
-
`).split(`
|
|
47974
|
-
`).map((e3) => ED2(e3, u3, F5)).join(`
|
|
47975
|
-
`);
|
|
47976
|
-
}
|
|
47977
|
-
var oD2 = Object.defineProperty;
|
|
47978
|
-
var nD2 = (t2, u3, F5) => u3 in t2 ? oD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
47979
|
-
var a = (t2, u3, F5) => (nD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
47980
|
-
function aD2(t2, u3) {
|
|
47981
|
-
if (t2 === u3) return;
|
|
47982
|
-
const F5 = t2.split(`
|
|
47983
|
-
`), e3 = u3.split(`
|
|
47984
|
-
`), s2 = [];
|
|
47985
|
-
for (let C5 = 0; C5 < Math.max(F5.length, e3.length); C5++) F5[C5] !== e3[C5] && s2.push(C5);
|
|
47986
|
-
return s2;
|
|
47987
|
-
}
|
|
47988
|
-
var V4 = Symbol("clack:cancel");
|
|
47989
|
-
function hD2(t2) {
|
|
47990
|
-
return t2 === V4;
|
|
47991
|
-
}
|
|
47992
|
-
function v3(t2, u3) {
|
|
47993
|
-
t2.isTTY && t2.setRawMode(u3);
|
|
47994
|
-
}
|
|
47995
|
-
var z3 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
|
|
47996
|
-
var lD2 = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
|
|
47997
|
-
var x3 = class {
|
|
47998
|
-
constructor({ render: u3, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) {
|
|
47999
|
-
a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u3.bind(this), this._track = C5, this.input = F5, this.output = e3;
|
|
48000
|
-
}
|
|
48001
|
-
prompt() {
|
|
48002
|
-
const u3 = new import_node_tty.WriteStream(0);
|
|
48003
|
-
return u3._write = (F5, e3, s2) => {
|
|
48004
|
-
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
|
|
48005
|
-
}, this.input.pipe(u3), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u3, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.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), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => {
|
|
48006
|
-
this.once("submit", () => {
|
|
48007
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(this.value);
|
|
48008
|
-
}), this.once("cancel", () => {
|
|
48009
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(V4);
|
|
48010
|
-
});
|
|
48011
|
-
});
|
|
48012
|
-
}
|
|
48013
|
-
on(u3, F5) {
|
|
48014
|
-
const e3 = this.subscribers.get(u3) ?? [];
|
|
48015
|
-
e3.push({ cb: F5 }), this.subscribers.set(u3, e3);
|
|
48016
|
-
}
|
|
48017
|
-
once(u3, F5) {
|
|
48018
|
-
const e3 = this.subscribers.get(u3) ?? [];
|
|
48019
|
-
e3.push({ cb: F5, once: true }), this.subscribers.set(u3, e3);
|
|
48020
|
-
}
|
|
48021
|
-
emit(u3, ...F5) {
|
|
48022
|
-
const e3 = this.subscribers.get(u3) ?? [], s2 = [];
|
|
48023
|
-
for (const C5 of e3) C5.cb(...F5), C5.once && s2.push(() => e3.splice(e3.indexOf(C5), 1));
|
|
48024
|
-
for (const C5 of s2) C5();
|
|
48025
|
-
}
|
|
48026
|
-
unsubscribe() {
|
|
48027
|
-
this.subscribers.clear();
|
|
48028
|
-
}
|
|
48029
|
-
onKeypress(u3, F5) {
|
|
48030
|
-
if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F5?.name === "return") {
|
|
48031
|
-
if (this.opts.validate) {
|
|
48032
|
-
const e3 = this.opts.validate(this.value);
|
|
48033
|
-
e3 && (this.error = e3, this.state = "error", this.rl.write(this.value));
|
|
48034
|
-
}
|
|
48035
|
-
this.state !== "error" && (this.state = "submit");
|
|
48036
|
-
}
|
|
48037
|
-
u3 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
48038
|
-
}
|
|
48039
|
-
close() {
|
|
48040
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
48041
|
-
`), v3(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
48042
|
-
}
|
|
48043
|
-
restoreCursor() {
|
|
48044
|
-
const u3 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
48045
|
-
`).length - 1;
|
|
48046
|
-
this.output.write(import_sisteransi.cursor.move(-999, u3 * -1));
|
|
48047
|
-
}
|
|
48048
|
-
render() {
|
|
48049
|
-
const u3 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
48050
|
-
if (u3 !== this._prevFrame) {
|
|
48051
|
-
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
48052
|
-
else {
|
|
48053
|
-
const F5 = aD2(this._prevFrame, u3);
|
|
48054
|
-
if (this.restoreCursor(), F5 && F5?.length === 1) {
|
|
48055
|
-
const e3 = F5[0];
|
|
48056
|
-
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.lines(1));
|
|
48057
|
-
const s2 = u3.split(`
|
|
48058
|
-
`);
|
|
48059
|
-
this.output.write(s2[e3]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1));
|
|
48060
|
-
return;
|
|
48061
|
-
} else if (F5 && F5?.length > 1) {
|
|
48062
|
-
const e3 = F5[0];
|
|
48063
|
-
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.down());
|
|
48064
|
-
const s2 = u3.split(`
|
|
48065
|
-
`).slice(e3);
|
|
48066
|
-
this.output.write(s2.join(`
|
|
48067
|
-
`)), this._prevFrame = u3;
|
|
48068
|
-
return;
|
|
48069
|
-
}
|
|
48070
|
-
this.output.write(import_sisteransi.erase.down());
|
|
48071
|
-
}
|
|
48072
|
-
this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
|
|
48073
|
-
}
|
|
48074
|
-
}
|
|
48075
|
-
};
|
|
48076
|
-
var xD2 = class extends x3 {
|
|
48077
|
-
get cursor() {
|
|
48078
|
-
return this.value ? 0 : 1;
|
|
48079
|
-
}
|
|
48080
|
-
get _value() {
|
|
48081
|
-
return this.cursor === 0;
|
|
48082
|
-
}
|
|
48083
|
-
constructor(u3) {
|
|
48084
|
-
super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
|
|
48085
|
-
this.value = this._value;
|
|
48086
|
-
}), this.on("confirm", (F5) => {
|
|
48087
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F5, this.state = "submit", this.close();
|
|
48088
|
-
}), this.on("cursor", () => {
|
|
48089
|
-
this.value = !this.value;
|
|
48090
|
-
});
|
|
48091
|
-
}
|
|
48092
|
-
};
|
|
48093
|
-
var pD2 = Object.defineProperty;
|
|
48094
|
-
var fD2 = (t2, u3, F5) => u3 in t2 ? pD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
48095
|
-
var K3 = (t2, u3, F5) => (fD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
48096
|
-
var gD2 = class extends x3 {
|
|
48097
|
-
constructor(u3) {
|
|
48098
|
-
super(u3, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u3.cursorAt), 0), this.on("key", (F5) => {
|
|
48099
|
-
F5 === "a" && this.toggleAll();
|
|
48100
|
-
}), this.on("cursor", (F5) => {
|
|
48101
|
-
switch (F5) {
|
|
48102
|
-
case "left":
|
|
48103
|
-
case "up":
|
|
48104
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
48105
|
-
break;
|
|
48106
|
-
case "down":
|
|
48107
|
-
case "right":
|
|
48108
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
48109
|
-
break;
|
|
48110
|
-
case "space":
|
|
48111
|
-
this.toggleValue();
|
|
48112
|
-
break;
|
|
48113
|
-
}
|
|
48114
|
-
});
|
|
48115
|
-
}
|
|
48116
|
-
get _value() {
|
|
48117
|
-
return this.options[this.cursor].value;
|
|
48118
|
-
}
|
|
48119
|
-
toggleAll() {
|
|
48120
|
-
const u3 = this.value.length === this.options.length;
|
|
48121
|
-
this.value = u3 ? [] : this.options.map((F5) => F5.value);
|
|
48122
|
-
}
|
|
48123
|
-
toggleValue() {
|
|
48124
|
-
const u3 = this.value.includes(this._value);
|
|
48125
|
-
this.value = u3 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value];
|
|
48126
|
-
}
|
|
48127
|
-
};
|
|
48128
|
-
var bD2 = Object.defineProperty;
|
|
48129
|
-
var wD2 = (t2, u3, F5) => u3 in t2 ? bD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
48130
|
-
var Z3 = (t2, u3, F5) => (wD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
48131
|
-
var yD = class extends x3 {
|
|
48132
|
-
constructor(u3) {
|
|
48133
|
-
super(u3, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => {
|
|
48134
|
-
switch (F5) {
|
|
48135
|
-
case "left":
|
|
48136
|
-
case "up":
|
|
48137
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
48138
|
-
break;
|
|
48139
|
-
case "down":
|
|
48140
|
-
case "right":
|
|
48141
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
48142
|
-
break;
|
|
48143
|
-
}
|
|
48144
|
-
this.changeValue();
|
|
48145
|
-
});
|
|
48146
|
-
}
|
|
48147
|
-
get _value() {
|
|
48148
|
-
return this.options[this.cursor];
|
|
48149
|
-
}
|
|
48150
|
-
changeValue() {
|
|
48151
|
-
this.value = this._value.value;
|
|
48152
|
-
}
|
|
48153
|
-
};
|
|
48154
|
-
var SD = Object.defineProperty;
|
|
48155
|
-
var jD = (t2, u3, F5) => u3 in t2 ? SD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
48156
|
-
var MD = (t2, u3, F5) => (jD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
48157
|
-
var TD = class extends x3 {
|
|
48158
|
-
constructor(u3) {
|
|
48159
|
-
super(u3), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
|
|
48160
|
-
this.value || (this.value = u3.defaultValue), this.valueWithCursor = this.value;
|
|
48161
|
-
}), this.on("value", () => {
|
|
48162
|
-
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
48163
|
-
else {
|
|
48164
|
-
const F5 = this.value.slice(0, this.cursor), e3 = this.value.slice(this.cursor);
|
|
48165
|
-
this.valueWithCursor = `${F5}${import_picocolors.default.inverse(e3[0])}${e3.slice(1)}`;
|
|
48166
|
-
}
|
|
48167
|
-
});
|
|
48168
|
-
}
|
|
48169
|
-
get cursor() {
|
|
48170
|
-
return this._cursor;
|
|
48171
|
-
}
|
|
48172
|
-
};
|
|
48173
|
-
var PD = globalThis.process.platform.startsWith("win");
|
|
48174
|
-
function WD({ input: t2 = import_node_process.stdin, output: u3 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) {
|
|
48175
|
-
const s2 = f.createInterface({ input: t2, output: u3, prompt: "", tabSize: 1 });
|
|
48176
|
-
f.emitKeypressEvents(t2, s2), t2.isTTY && t2.setRawMode(true);
|
|
48177
|
-
const C5 = (D5, { name: i3 }) => {
|
|
48178
|
-
if (String(D5) === "" && process.exit(0), !F5) return;
|
|
48179
|
-
let n2 = i3 === "return" ? 0 : -1, E4 = i3 === "return" ? -1 : 0;
|
|
48180
|
-
f.moveCursor(u3, n2, E4, () => {
|
|
48181
|
-
f.clearLine(u3, 1, () => {
|
|
48182
|
-
t2.once("keypress", C5);
|
|
48183
|
-
});
|
|
48184
|
-
});
|
|
48185
|
-
};
|
|
48186
|
-
return e3 && process.stdout.write(import_sisteransi.cursor.hide), t2.once("keypress", C5), () => {
|
|
48187
|
-
t2.off("keypress", C5), e3 && process.stdout.write(import_sisteransi.cursor.show), t2.isTTY && !PD && t2.setRawMode(false), s2.terminal = false, s2.close();
|
|
48188
|
-
};
|
|
48189
|
-
}
|
|
48190
|
-
|
|
48191
|
-
// node_modules/@clack/prompts/dist/index.mjs
|
|
48192
|
-
var import_node_process2 = __toESM(require("node:process"), 1);
|
|
48193
|
-
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
48194
|
-
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
48195
|
-
function N4() {
|
|
48196
|
-
return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
48197
|
-
}
|
|
48198
|
-
var p2 = N4();
|
|
48199
|
-
var u = (r3, n2) => p2 ? r3 : n2;
|
|
48200
|
-
var W4 = u("\u25C6", "*");
|
|
48201
|
-
var D3 = u("\u25A0", "x");
|
|
48202
|
-
var F3 = u("\u25B2", "x");
|
|
48203
|
-
var f2 = u("\u25C7", "o");
|
|
48204
|
-
var L5 = u("\u250C", "T");
|
|
48205
|
-
var a2 = u("\u2502", "|");
|
|
48206
|
-
var o = u("\u2514", "\u2014");
|
|
48207
|
-
var w5 = u("\u25CF", ">");
|
|
48208
|
-
var S4 = u("\u25CB", " ");
|
|
48209
|
-
var _5 = u("\u25FB", "[\u2022]");
|
|
48210
|
-
var y4 = u("\u25FC", "[+]");
|
|
48211
|
-
var A3 = u("\u25FB", "[ ]");
|
|
48212
|
-
var q4 = u("\u25AA", "\u2022");
|
|
48213
|
-
var R5 = u("\u2500", "-");
|
|
48214
|
-
var G4 = u("\u256E", "+");
|
|
48215
|
-
var H3 = u("\u251C", "+");
|
|
48216
|
-
var K4 = u("\u256F", "+");
|
|
48217
|
-
var U5 = u("\u25CF", "\u2022");
|
|
48218
|
-
var Z4 = u("\u25C6", "*");
|
|
48219
|
-
var z4 = u("\u25B2", "!");
|
|
48220
|
-
var X3 = u("\u25A0", "x");
|
|
48221
|
-
var h2 = (r3) => {
|
|
48222
|
-
switch (r3) {
|
|
48223
|
-
case "initial":
|
|
48224
|
-
case "active":
|
|
48225
|
-
return import_picocolors2.default.cyan(W4);
|
|
48226
|
-
case "cancel":
|
|
48227
|
-
return import_picocolors2.default.red(D3);
|
|
48228
|
-
case "error":
|
|
48229
|
-
return import_picocolors2.default.yellow(F3);
|
|
48230
|
-
case "submit":
|
|
48231
|
-
return import_picocolors2.default.green(f2);
|
|
48232
|
-
}
|
|
48233
|
-
};
|
|
48234
|
-
var J4 = (r3) => new TD({ validate: r3.validate, placeholder: r3.placeholder, defaultValue: r3.defaultValue, initialValue: r3.initialValue, render() {
|
|
48235
|
-
const n2 = `${import_picocolors2.default.gray(a2)}
|
|
48236
|
-
${h2(this.state)} ${r3.message}
|
|
48237
|
-
`, s2 = r3.placeholder ? import_picocolors2.default.inverse(r3.placeholder[0]) + import_picocolors2.default.dim(r3.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t2 = this.value ? this.valueWithCursor : s2;
|
|
48238
|
-
switch (this.state) {
|
|
48239
|
-
case "error":
|
|
48240
|
-
return `${n2.trim()}
|
|
48241
|
-
${import_picocolors2.default.yellow(a2)} ${t2}
|
|
48242
|
-
${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(this.error)}
|
|
48243
|
-
`;
|
|
48244
|
-
case "submit":
|
|
48245
|
-
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r3.placeholder)}`;
|
|
48246
|
-
case "cancel":
|
|
48247
|
-
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
48248
|
-
` + import_picocolors2.default.gray(a2) : ""}`;
|
|
48249
|
-
default:
|
|
48250
|
-
return `${n2}${import_picocolors2.default.cyan(a2)} ${t2}
|
|
48251
|
-
${import_picocolors2.default.cyan(o)}
|
|
48252
|
-
`;
|
|
48253
|
-
}
|
|
48254
|
-
} }).prompt();
|
|
48255
|
-
var Q3 = (r3) => {
|
|
48256
|
-
const n2 = r3.active ?? "Yes", s2 = r3.inactive ?? "No";
|
|
48257
|
-
return new xD2({ active: n2, inactive: s2, initialValue: r3.initialValue ?? true, render() {
|
|
48258
|
-
const t2 = `${import_picocolors2.default.gray(a2)}
|
|
48259
|
-
${h2(this.state)} ${r3.message}
|
|
48260
|
-
`, i3 = this.value ? n2 : s2;
|
|
48261
|
-
switch (this.state) {
|
|
48262
|
-
case "submit":
|
|
48263
|
-
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(i3)}`;
|
|
48264
|
-
case "cancel":
|
|
48265
|
-
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}
|
|
48266
|
-
${import_picocolors2.default.gray(a2)}`;
|
|
48267
|
-
default:
|
|
48268
|
-
return `${t2}${import_picocolors2.default.cyan(a2)} ${this.value ? `${import_picocolors2.default.green(w5)} ${n2}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(n2)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(s2)}` : `${import_picocolors2.default.green(w5)} ${s2}`}
|
|
48269
|
-
${import_picocolors2.default.cyan(o)}
|
|
48270
|
-
`;
|
|
48271
|
-
}
|
|
48272
|
-
} }).prompt();
|
|
48273
|
-
};
|
|
48274
|
-
var ee = (r3) => {
|
|
48275
|
-
const n2 = (s2, t2) => {
|
|
48276
|
-
const i3 = s2.label ?? String(s2.value);
|
|
48277
|
-
return t2 === "active" ? `${import_picocolors2.default.green(w5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(i3)}`;
|
|
48278
|
-
};
|
|
48279
|
-
return new yD({ options: r3.options, initialValue: r3.initialValue, render() {
|
|
48280
|
-
const s2 = `${import_picocolors2.default.gray(a2)}
|
|
48281
|
-
${h2(this.state)} ${r3.message}
|
|
48282
|
-
`;
|
|
48283
|
-
switch (this.state) {
|
|
48284
|
-
case "submit":
|
|
48285
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "selected")}`;
|
|
48286
|
-
case "cancel":
|
|
48287
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "cancelled")}
|
|
48288
|
-
${import_picocolors2.default.gray(a2)}`;
|
|
48289
|
-
default:
|
|
48290
|
-
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(`
|
|
48291
|
-
${import_picocolors2.default.cyan(a2)} `)}
|
|
48292
|
-
${import_picocolors2.default.cyan(o)}
|
|
48293
|
-
`;
|
|
48294
|
-
}
|
|
48295
|
-
} }).prompt();
|
|
48296
|
-
};
|
|
48297
|
-
var re = (r3) => {
|
|
48298
|
-
const n2 = (s2, t2) => {
|
|
48299
|
-
const i3 = s2.label ?? String(s2.value);
|
|
48300
|
-
return t2 === "active" ? `${import_picocolors2.default.cyan(_5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : t2 === "active-selected" ? `${import_picocolors2.default.green(y4)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors2.default.dim(i3)}` : `${import_picocolors2.default.dim(A3)} ${import_picocolors2.default.dim(i3)}`;
|
|
48301
|
-
};
|
|
48302
|
-
return new gD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) {
|
|
48303
|
-
if (this.required && s2.length === 0) return `Please select at least one option.
|
|
48304
|
-
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
48305
|
-
}, render() {
|
|
48306
|
-
let s2 = `${import_picocolors2.default.gray(a2)}
|
|
48307
|
-
${h2(this.state)} ${r3.message}
|
|
48308
|
-
`;
|
|
48309
|
-
switch (this.state) {
|
|
48310
|
-
case "submit":
|
|
48311
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
|
|
48312
|
-
case "cancel": {
|
|
48313
|
-
const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
48314
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${t2.trim() ? `${t2}
|
|
48315
|
-
${import_picocolors2.default.gray(a2)}` : ""}`;
|
|
48316
|
-
}
|
|
48317
|
-
case "error": {
|
|
48318
|
-
const t2 = this.error.split(`
|
|
48319
|
-
`).map((i3, c4) => c4 === 0 ? `${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(i3)}` : ` ${i3}`).join(`
|
|
48320
|
-
`);
|
|
48321
|
-
return s2 + import_picocolors2.default.yellow(a2) + " " + this.options.map((i3, c4) => {
|
|
48322
|
-
const l3 = this.value.includes(i3.value), $6 = c4 === this.cursor;
|
|
48323
|
-
return $6 && l3 ? n2(i3, "active-selected") : l3 ? n2(i3, "selected") : n2(i3, $6 ? "active" : "inactive");
|
|
48324
|
-
}).join(`
|
|
48325
|
-
${import_picocolors2.default.yellow(a2)} `) + `
|
|
48326
|
-
` + t2 + `
|
|
48327
|
-
`;
|
|
48328
|
-
}
|
|
48329
|
-
default:
|
|
48330
|
-
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => {
|
|
48331
|
-
const c4 = this.value.includes(t2.value), l3 = i3 === this.cursor;
|
|
48332
|
-
return l3 && c4 ? n2(t2, "active-selected") : c4 ? n2(t2, "selected") : n2(t2, l3 ? "active" : "inactive");
|
|
48333
|
-
}).join(`
|
|
48334
|
-
${import_picocolors2.default.cyan(a2)} `)}
|
|
48335
|
-
${import_picocolors2.default.cyan(o)}
|
|
48336
|
-
`;
|
|
48337
|
-
}
|
|
48338
|
-
} }).prompt();
|
|
48339
|
-
};
|
|
48340
|
-
var b5 = (r3) => r3.replace(ue(), "");
|
|
48341
|
-
var ie = (r3 = "", n2 = "") => {
|
|
48342
|
-
const s2 = `
|
|
48343
|
-
${r3}
|
|
48344
|
-
`.split(`
|
|
48345
|
-
`), t2 = Math.max(s2.reduce((c4, l3) => (l3 = b5(l3), l3.length > c4 ? l3.length : c4), 0), b5(n2).length) + 2, i3 = s2.map((c4) => `${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(c4)}${" ".repeat(t2 - b5(c4).length)}${import_picocolors2.default.gray(a2)}`).join(`
|
|
48346
|
-
`);
|
|
48347
|
-
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48348
|
-
${import_picocolors2.default.green(f2)} ${import_picocolors2.default.reset(n2)} ${import_picocolors2.default.gray(R5.repeat(Math.max(t2 - n2.length - 1, 1)) + G4)}
|
|
48349
|
-
${i3}
|
|
48350
|
-
${import_picocolors2.default.gray(H3 + R5.repeat(t2 + 2) + K4)}
|
|
48351
|
-
`);
|
|
48352
|
-
};
|
|
48353
|
-
var ae = (r3 = "") => {
|
|
48354
|
-
process.stdout.write(`${import_picocolors2.default.gray(L5)} ${r3}
|
|
48355
|
-
`);
|
|
48356
|
-
};
|
|
48357
|
-
var ce = (r3 = "") => {
|
|
48358
|
-
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48359
|
-
${import_picocolors2.default.gray(o)} ${r3}
|
|
48360
|
-
|
|
48361
|
-
`);
|
|
48362
|
-
};
|
|
48363
|
-
var C3 = p2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"];
|
|
48364
|
-
var le = () => {
|
|
48365
|
-
let r3, n2;
|
|
48366
|
-
const s2 = p2 ? 80 : 120;
|
|
48367
|
-
return { start(t2 = "") {
|
|
48368
|
-
t2 = t2.replace(/\.?\.?\.$/, ""), r3 = WD(), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48369
|
-
${import_picocolors2.default.magenta("\u25CB")} ${t2}
|
|
48370
|
-
`);
|
|
48371
|
-
let i3 = 0, c4 = 0;
|
|
48372
|
-
n2 = setInterval(() => {
|
|
48373
|
-
let l3 = C3[i3];
|
|
48374
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors2.default.magenta(l3)} ${t2}${Math.floor(c4) >= 1 ? ".".repeat(Math.floor(c4)).slice(0, 3) : ""}
|
|
48375
|
-
`), i3 = i3 === C3.length - 1 ? 0 : i3 + 1, c4 = c4 === C3.length ? 0 : c4 + 0.125;
|
|
48376
|
-
}, s2);
|
|
48377
|
-
}, stop(t2 = "") {
|
|
48378
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n2), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48379
|
-
${import_picocolors2.default.green(f2)} ${t2}
|
|
48380
|
-
`), r3();
|
|
48381
|
-
} };
|
|
48382
|
-
};
|
|
48383
|
-
function ue() {
|
|
48384
|
-
const r3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
48385
|
-
return new RegExp(r3, "g");
|
|
48386
|
-
}
|
|
48623
|
+
// src/commands/commit.ts
|
|
48624
|
+
init_dist2();
|
|
48387
48625
|
|
|
48388
48626
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
48389
48627
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -50016,7 +50254,11 @@ function create$(options) {
|
|
|
50016
50254
|
}
|
|
50017
50255
|
var $4 = create$();
|
|
50018
50256
|
|
|
50257
|
+
// src/generateCommitMessageFromGitDiff.ts
|
|
50258
|
+
init_dist2();
|
|
50259
|
+
|
|
50019
50260
|
// src/commands/config.ts
|
|
50261
|
+
init_dist2();
|
|
50020
50262
|
var dotenv = __toESM(require_main(), 1);
|
|
50021
50263
|
var import_fs = require("fs");
|
|
50022
50264
|
var import_ini = __toESM(require_ini(), 1);
|
|
@@ -50294,26 +50536,26 @@ function getI18nLocal(value) {
|
|
|
50294
50536
|
}
|
|
50295
50537
|
|
|
50296
50538
|
// src/commands/config.ts
|
|
50297
|
-
var CONFIG_KEYS = /* @__PURE__ */ ((
|
|
50298
|
-
|
|
50299
|
-
|
|
50300
|
-
|
|
50301
|
-
|
|
50302
|
-
|
|
50303
|
-
|
|
50304
|
-
|
|
50305
|
-
|
|
50306
|
-
|
|
50307
|
-
|
|
50308
|
-
|
|
50309
|
-
|
|
50310
|
-
|
|
50311
|
-
|
|
50312
|
-
|
|
50313
|
-
|
|
50314
|
-
|
|
50315
|
-
|
|
50316
|
-
return
|
|
50539
|
+
var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS3) => {
|
|
50540
|
+
CONFIG_KEYS3["OCO_API_KEY"] = "OCO_API_KEY";
|
|
50541
|
+
CONFIG_KEYS3["OCO_TOKENS_MAX_INPUT"] = "OCO_TOKENS_MAX_INPUT";
|
|
50542
|
+
CONFIG_KEYS3["OCO_TOKENS_MAX_OUTPUT"] = "OCO_TOKENS_MAX_OUTPUT";
|
|
50543
|
+
CONFIG_KEYS3["OCO_DESCRIPTION"] = "OCO_DESCRIPTION";
|
|
50544
|
+
CONFIG_KEYS3["OCO_EMOJI"] = "OCO_EMOJI";
|
|
50545
|
+
CONFIG_KEYS3["OCO_MODEL"] = "OCO_MODEL";
|
|
50546
|
+
CONFIG_KEYS3["OCO_LANGUAGE"] = "OCO_LANGUAGE";
|
|
50547
|
+
CONFIG_KEYS3["OCO_WHY"] = "OCO_WHY";
|
|
50548
|
+
CONFIG_KEYS3["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER";
|
|
50549
|
+
CONFIG_KEYS3["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE";
|
|
50550
|
+
CONFIG_KEYS3["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER";
|
|
50551
|
+
CONFIG_KEYS3["OCO_ONE_LINE_COMMIT"] = "OCO_ONE_LINE_COMMIT";
|
|
50552
|
+
CONFIG_KEYS3["OCO_TEST_MOCK_TYPE"] = "OCO_TEST_MOCK_TYPE";
|
|
50553
|
+
CONFIG_KEYS3["OCO_API_URL"] = "OCO_API_URL";
|
|
50554
|
+
CONFIG_KEYS3["OCO_API_CUSTOM_HEADERS"] = "OCO_API_CUSTOM_HEADERS";
|
|
50555
|
+
CONFIG_KEYS3["OCO_OMIT_SCOPE"] = "OCO_OMIT_SCOPE";
|
|
50556
|
+
CONFIG_KEYS3["OCO_GITPUSH"] = "OCO_GITPUSH";
|
|
50557
|
+
CONFIG_KEYS3["OCO_HOOK_AUTO_UNCOMMENT"] = "OCO_HOOK_AUTO_UNCOMMENT";
|
|
50558
|
+
return CONFIG_KEYS3;
|
|
50317
50559
|
})(CONFIG_KEYS || {});
|
|
50318
50560
|
var MODEL_LIST = {
|
|
50319
50561
|
openai: [
|
|
@@ -50345,10 +50587,11 @@ var MODEL_LIST = {
|
|
|
50345
50587
|
"gpt-4o-mini-2024-07-18"
|
|
50346
50588
|
],
|
|
50347
50589
|
anthropic: [
|
|
50348
|
-
"claude-
|
|
50349
|
-
"claude-
|
|
50350
|
-
"claude-3-sonnet-
|
|
50351
|
-
"claude-3-
|
|
50590
|
+
"claude-sonnet-4-20250514",
|
|
50591
|
+
"claude-opus-4-20250514",
|
|
50592
|
+
"claude-3-7-sonnet-20250219",
|
|
50593
|
+
"claude-3-5-sonnet-20241022",
|
|
50594
|
+
"claude-3-5-haiku-20241022"
|
|
50352
50595
|
],
|
|
50353
50596
|
gemini: [
|
|
50354
50597
|
"gemini-1.5-flash",
|
|
@@ -51082,6 +51325,31 @@ var OCO_AI_PROVIDER_ENUM = /* @__PURE__ */ ((OCO_AI_PROVIDER_ENUM2) => {
|
|
|
51082
51325
|
OCO_AI_PROVIDER_ENUM2["OPENROUTER"] = "openrouter";
|
|
51083
51326
|
return OCO_AI_PROVIDER_ENUM2;
|
|
51084
51327
|
})(OCO_AI_PROVIDER_ENUM || {});
|
|
51328
|
+
var PROVIDER_API_KEY_URLS = {
|
|
51329
|
+
["openai" /* OPENAI */]: "https://platform.openai.com/api-keys",
|
|
51330
|
+
["anthropic" /* ANTHROPIC */]: "https://console.anthropic.com/settings/keys",
|
|
51331
|
+
["gemini" /* GEMINI */]: "https://aistudio.google.com/app/apikey",
|
|
51332
|
+
["groq" /* GROQ */]: "https://console.groq.com/keys",
|
|
51333
|
+
["mistral" /* MISTRAL */]: "https://console.mistral.ai/api-keys/",
|
|
51334
|
+
["deepseek" /* DEEPSEEK */]: "https://platform.deepseek.com/api_keys",
|
|
51335
|
+
["openrouter" /* OPENROUTER */]: "https://openrouter.ai/keys",
|
|
51336
|
+
["aimlapi" /* AIMLAPI */]: "https://aimlapi.com/app/keys",
|
|
51337
|
+
["azure" /* AZURE */]: "https://portal.azure.com/",
|
|
51338
|
+
["ollama" /* OLLAMA */]: null,
|
|
51339
|
+
["mlx" /* MLX */]: null,
|
|
51340
|
+
["flowise" /* FLOWISE */]: null,
|
|
51341
|
+
["test" /* TEST */]: null
|
|
51342
|
+
};
|
|
51343
|
+
var RECOMMENDED_MODELS = {
|
|
51344
|
+
["openai" /* OPENAI */]: "gpt-4o-mini",
|
|
51345
|
+
["anthropic" /* ANTHROPIC */]: "claude-sonnet-4-20250514",
|
|
51346
|
+
["gemini" /* GEMINI */]: "gemini-1.5-flash",
|
|
51347
|
+
["groq" /* GROQ */]: "llama3-70b-8192",
|
|
51348
|
+
["mistral" /* MISTRAL */]: "mistral-small-latest",
|
|
51349
|
+
["deepseek" /* DEEPSEEK */]: "deepseek-chat",
|
|
51350
|
+
["openrouter" /* OPENROUTER */]: "openai/gpt-4o-mini",
|
|
51351
|
+
["aimlapi" /* AIMLAPI */]: "gpt-4o-mini"
|
|
51352
|
+
};
|
|
51085
51353
|
var defaultConfigPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
|
|
51086
51354
|
var defaultEnvPath = (0, import_path.resolve)(process.cwd(), ".env");
|
|
51087
51355
|
var OCO_PROMPT_MODULE_ENUM = /* @__PURE__ */ ((OCO_PROMPT_MODULE_ENUM2) => {
|
|
@@ -51433,6 +51701,12 @@ var configCommand = G3(
|
|
|
51433
51701
|
}
|
|
51434
51702
|
);
|
|
51435
51703
|
|
|
51704
|
+
// src/prompts.ts
|
|
51705
|
+
init_dist2();
|
|
51706
|
+
|
|
51707
|
+
// src/modules/commitlint/config.ts
|
|
51708
|
+
init_dist2();
|
|
51709
|
+
|
|
51436
51710
|
// node_modules/@anthropic-ai/sdk/version.mjs
|
|
51437
51711
|
var VERSION = "0.19.2";
|
|
51438
51712
|
|
|
@@ -53637,6 +53911,9 @@ var { AnthropicError: AnthropicError2, APIError: APIError2, APIConnectionError:
|
|
|
53637
53911
|
})(Anthropic || (Anthropic = {}));
|
|
53638
53912
|
var sdk_default = Anthropic;
|
|
53639
53913
|
|
|
53914
|
+
// src/engine/anthropic.ts
|
|
53915
|
+
init_dist2();
|
|
53916
|
+
|
|
53640
53917
|
// node_modules/axios/lib/helpers/bind.js
|
|
53641
53918
|
function bind(fn, thisArg) {
|
|
53642
53919
|
return function wrap() {
|
|
@@ -56946,6 +57223,49 @@ var {
|
|
|
56946
57223
|
mergeConfig: mergeConfig2
|
|
56947
57224
|
} = axios_default;
|
|
56948
57225
|
|
|
57226
|
+
// src/utils/errors.ts
|
|
57227
|
+
var ModelNotFoundError = class extends Error {
|
|
57228
|
+
constructor(modelName, provider, statusCode = 404) {
|
|
57229
|
+
super(`Model '${modelName}' not found for provider '${provider}'`);
|
|
57230
|
+
this.name = "ModelNotFoundError";
|
|
57231
|
+
this.modelName = modelName;
|
|
57232
|
+
this.provider = provider;
|
|
57233
|
+
this.statusCode = statusCode;
|
|
57234
|
+
}
|
|
57235
|
+
};
|
|
57236
|
+
function isModelNotFoundError(error) {
|
|
57237
|
+
if (error instanceof ModelNotFoundError) {
|
|
57238
|
+
return true;
|
|
57239
|
+
}
|
|
57240
|
+
if (error instanceof Error) {
|
|
57241
|
+
const message = error.message.toLowerCase();
|
|
57242
|
+
if (message.includes("model") && (message.includes("not found") || message.includes("does not exist") || message.includes("invalid model"))) {
|
|
57243
|
+
return true;
|
|
57244
|
+
}
|
|
57245
|
+
if (message.includes("model") && (message.includes("not found") || message.includes("invalid"))) {
|
|
57246
|
+
return true;
|
|
57247
|
+
}
|
|
57248
|
+
if ("status" in error && error.status === 404 && message.includes("model")) {
|
|
57249
|
+
return true;
|
|
57250
|
+
}
|
|
57251
|
+
if ("response" in error) {
|
|
57252
|
+
const response = error.response;
|
|
57253
|
+
if (response?.status === 404) {
|
|
57254
|
+
return true;
|
|
57255
|
+
}
|
|
57256
|
+
}
|
|
57257
|
+
}
|
|
57258
|
+
return false;
|
|
57259
|
+
}
|
|
57260
|
+
function getSuggestedModels(provider, failedModel) {
|
|
57261
|
+
const providerKey = provider.toLowerCase();
|
|
57262
|
+
const models = MODEL_LIST[providerKey];
|
|
57263
|
+
if (!models || !Array.isArray(models)) {
|
|
57264
|
+
return [];
|
|
57265
|
+
}
|
|
57266
|
+
return models.filter((m5) => m5 !== failedModel).slice(0, 5);
|
|
57267
|
+
}
|
|
57268
|
+
|
|
56949
57269
|
// src/utils/removeContentTags.ts
|
|
56950
57270
|
function removeContentTags(content, tag) {
|
|
56951
57271
|
if (!content || typeof content !== "string") {
|
|
@@ -57023,6 +57343,12 @@ var AnthropicEngine = class {
|
|
|
57023
57343
|
return removeContentTags(content, "think");
|
|
57024
57344
|
} catch (error) {
|
|
57025
57345
|
const err = error;
|
|
57346
|
+
if (err.message?.toLowerCase().includes("model") && (err.message?.toLowerCase().includes("not found") || err.message?.toLowerCase().includes("does not exist") || err.message?.toLowerCase().includes("invalid"))) {
|
|
57347
|
+
throw new ModelNotFoundError(this.config.model, "anthropic", 404);
|
|
57348
|
+
}
|
|
57349
|
+
if ("status" in error && error.status === 404) {
|
|
57350
|
+
throw new ModelNotFoundError(this.config.model, "anthropic", 404);
|
|
57351
|
+
}
|
|
57026
57352
|
ce(`${source_default.red("\u2716")} ${err?.message || err}`);
|
|
57027
57353
|
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
57028
57354
|
const anthropicAiError = error.response.data.error;
|
|
@@ -57031,6 +57357,9 @@ var AnthropicEngine = class {
|
|
|
57031
57357
|
"For help look into README https://github.com/di-sukharev/opencommit#setup"
|
|
57032
57358
|
);
|
|
57033
57359
|
}
|
|
57360
|
+
if (axios_default.isAxiosError(error) && error.response?.status === 404) {
|
|
57361
|
+
throw new ModelNotFoundError(this.config.model, "anthropic", 404);
|
|
57362
|
+
}
|
|
57034
57363
|
throw err;
|
|
57035
57364
|
}
|
|
57036
57365
|
};
|
|
@@ -57180,12 +57509,12 @@ function __await(v5) {
|
|
|
57180
57509
|
}
|
|
57181
57510
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
57182
57511
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
57183
|
-
var
|
|
57512
|
+
var g5 = generator.apply(thisArg, _arguments || []), i3, q6 = [];
|
|
57184
57513
|
return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
|
|
57185
57514
|
return this;
|
|
57186
57515
|
}, i3;
|
|
57187
57516
|
function verb(n2) {
|
|
57188
|
-
if (
|
|
57517
|
+
if (g5[n2]) i3[n2] = function(v5) {
|
|
57189
57518
|
return new Promise(function(a4, b7) {
|
|
57190
57519
|
q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5);
|
|
57191
57520
|
});
|
|
@@ -57193,7 +57522,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
57193
57522
|
}
|
|
57194
57523
|
function resume(n2, v5) {
|
|
57195
57524
|
try {
|
|
57196
|
-
step(
|
|
57525
|
+
step(g5[n2](v5));
|
|
57197
57526
|
} catch (e3) {
|
|
57198
57527
|
settle2(q6[0][3], e3);
|
|
57199
57528
|
}
|
|
@@ -60847,6 +61176,7 @@ var OpenAIClient = class {
|
|
|
60847
61176
|
};
|
|
60848
61177
|
|
|
60849
61178
|
// src/engine/azure.ts
|
|
61179
|
+
init_dist2();
|
|
60850
61180
|
var AzureEngine = class {
|
|
60851
61181
|
constructor(config7) {
|
|
60852
61182
|
this.generateCommitMessage = async (messages) => {
|
|
@@ -61227,12 +61557,12 @@ function __await2(v5) {
|
|
|
61227
61557
|
}
|
|
61228
61558
|
function __asyncGenerator2(thisArg, _arguments, generator) {
|
|
61229
61559
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
61230
|
-
var
|
|
61560
|
+
var g5 = generator.apply(thisArg, _arguments || []), i3, q6 = [];
|
|
61231
61561
|
return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
|
|
61232
61562
|
return this;
|
|
61233
61563
|
}, i3;
|
|
61234
61564
|
function verb(n2) {
|
|
61235
|
-
if (
|
|
61565
|
+
if (g5[n2]) i3[n2] = function(v5) {
|
|
61236
61566
|
return new Promise(function(a4, b7) {
|
|
61237
61567
|
q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5);
|
|
61238
61568
|
});
|
|
@@ -61240,7 +61570,7 @@ function __asyncGenerator2(thisArg, _arguments, generator) {
|
|
|
61240
61570
|
}
|
|
61241
61571
|
function resume(n2, v5) {
|
|
61242
61572
|
try {
|
|
61243
|
-
step(
|
|
61573
|
+
step(g5[n2](v5));
|
|
61244
61574
|
} catch (e3) {
|
|
61245
61575
|
settle2(q6[0][3], e3);
|
|
61246
61576
|
}
|
|
@@ -61773,10 +62103,16 @@ var GeminiEngine = class {
|
|
|
61773
62103
|
return removeContentTags(content, "think");
|
|
61774
62104
|
} catch (error) {
|
|
61775
62105
|
const err = error;
|
|
62106
|
+
if (err.message?.toLowerCase().includes("model") && (err.message?.toLowerCase().includes("not found") || err.message?.toLowerCase().includes("does not exist") || err.message?.toLowerCase().includes("invalid"))) {
|
|
62107
|
+
throw new ModelNotFoundError(this.config.model, "gemini", 404);
|
|
62108
|
+
}
|
|
61776
62109
|
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
61777
62110
|
const geminiError = error.response.data.error;
|
|
61778
62111
|
if (geminiError) throw new Error(geminiError?.message);
|
|
61779
62112
|
}
|
|
62113
|
+
if (axios_default.isAxiosError(error) && error.response?.status === 404) {
|
|
62114
|
+
throw new ModelNotFoundError(this.config.model, "gemini", 404);
|
|
62115
|
+
}
|
|
61780
62116
|
throw err;
|
|
61781
62117
|
}
|
|
61782
62118
|
}
|
|
@@ -61812,6 +62148,12 @@ var OllamaEngine = class {
|
|
|
61812
62148
|
return removeContentTags(content, "think");
|
|
61813
62149
|
} catch (err) {
|
|
61814
62150
|
const message = err.response?.data?.error ?? err.message;
|
|
62151
|
+
if (message?.toLowerCase().includes("model") && (message?.toLowerCase().includes("not found") || message?.toLowerCase().includes("does not exist") || message?.toLowerCase().includes("pull"))) {
|
|
62152
|
+
throw new ModelNotFoundError(this.config.model, "ollama", 404);
|
|
62153
|
+
}
|
|
62154
|
+
if (err.response?.status === 404) {
|
|
62155
|
+
throw new ModelNotFoundError(this.config.model, "ollama", 404);
|
|
62156
|
+
}
|
|
61815
62157
|
throw new Error(`Ollama provider error: ${message}`);
|
|
61816
62158
|
}
|
|
61817
62159
|
}
|
|
@@ -66542,10 +66884,19 @@ var OpenAiEngine = class {
|
|
|
66542
66884
|
return removeContentTags(content, "think");
|
|
66543
66885
|
} catch (error) {
|
|
66544
66886
|
const err = error;
|
|
66887
|
+
if (err.message?.toLowerCase().includes("model") && (err.message?.toLowerCase().includes("not found") || err.message?.toLowerCase().includes("does not exist") || err.message?.toLowerCase().includes("invalid"))) {
|
|
66888
|
+
throw new ModelNotFoundError(this.config.model, "openai", 404);
|
|
66889
|
+
}
|
|
66890
|
+
if ("status" in error && error.status === 404) {
|
|
66891
|
+
throw new ModelNotFoundError(this.config.model, "openai", 404);
|
|
66892
|
+
}
|
|
66545
66893
|
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
66546
66894
|
const openAiError = error.response.data.error;
|
|
66547
66895
|
if (openAiError) throw new Error(openAiError.message);
|
|
66548
66896
|
}
|
|
66897
|
+
if (axios_default.isAxiosError(error) && error.response?.status === 404) {
|
|
66898
|
+
throw new ModelNotFoundError(this.config.model, "openai", 404);
|
|
66899
|
+
}
|
|
66549
66900
|
throw err;
|
|
66550
66901
|
}
|
|
66551
66902
|
};
|
|
@@ -66833,6 +67184,7 @@ var computeHash = async (content, algorithm = "sha256") => {
|
|
|
66833
67184
|
};
|
|
66834
67185
|
|
|
66835
67186
|
// src/modules/commitlint/prompts.ts
|
|
67187
|
+
init_dist2();
|
|
66836
67188
|
var import_types = __toESM(require_lib5(), 1);
|
|
66837
67189
|
var config2 = getConfig();
|
|
66838
67190
|
var translation = i18n[config2.OCO_LANGUAGE || "en"];
|
|
@@ -67340,8 +67692,77 @@ var GenerateCommitMessageErrorEnum = ((GenerateCommitMessageErrorEnum2) => {
|
|
|
67340
67692
|
GenerateCommitMessageErrorEnum2["outputTokensTooHigh"] = `Token limit exceeded, OCO_TOKENS_MAX_OUTPUT must not be much higher than the default ${500 /* DEFAULT_MAX_TOKENS_OUTPUT */} tokens.`;
|
|
67341
67693
|
return GenerateCommitMessageErrorEnum2;
|
|
67342
67694
|
})(GenerateCommitMessageErrorEnum || {});
|
|
67695
|
+
async function handleModelNotFoundError(error, provider, currentModel) {
|
|
67696
|
+
console.log(
|
|
67697
|
+
source_default.red(`
|
|
67698
|
+
\u2716 Model '${currentModel}' not found
|
|
67699
|
+
`)
|
|
67700
|
+
);
|
|
67701
|
+
const suggestedModels = getSuggestedModels(provider, currentModel);
|
|
67702
|
+
const recommended = RECOMMENDED_MODELS[provider];
|
|
67703
|
+
if (suggestedModels.length === 0) {
|
|
67704
|
+
console.log(
|
|
67705
|
+
source_default.yellow(
|
|
67706
|
+
`No alternative models available. Run 'oco setup' to configure a different model.`
|
|
67707
|
+
)
|
|
67708
|
+
);
|
|
67709
|
+
return null;
|
|
67710
|
+
}
|
|
67711
|
+
const options = [];
|
|
67712
|
+
if (recommended && suggestedModels.includes(recommended)) {
|
|
67713
|
+
options.push({
|
|
67714
|
+
value: recommended,
|
|
67715
|
+
label: `${recommended} (Recommended)`
|
|
67716
|
+
});
|
|
67717
|
+
}
|
|
67718
|
+
suggestedModels.filter((m5) => m5 !== recommended).forEach((model) => {
|
|
67719
|
+
options.push({ value: model, label: model });
|
|
67720
|
+
});
|
|
67721
|
+
options.push({ value: "__custom__", label: "Enter custom model..." });
|
|
67722
|
+
const selection = await ee({
|
|
67723
|
+
message: "Select an alternative model:",
|
|
67724
|
+
options
|
|
67725
|
+
});
|
|
67726
|
+
if (hD2(selection)) {
|
|
67727
|
+
return null;
|
|
67728
|
+
}
|
|
67729
|
+
let newModel;
|
|
67730
|
+
if (selection === "__custom__") {
|
|
67731
|
+
const { text } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
|
|
67732
|
+
const customModel = await text({
|
|
67733
|
+
message: "Enter model name:",
|
|
67734
|
+
validate: (value) => {
|
|
67735
|
+
if (!value || value.trim().length === 0) {
|
|
67736
|
+
return "Model name is required";
|
|
67737
|
+
}
|
|
67738
|
+
return void 0;
|
|
67739
|
+
}
|
|
67740
|
+
});
|
|
67741
|
+
if (hD2(customModel)) {
|
|
67742
|
+
return null;
|
|
67743
|
+
}
|
|
67744
|
+
newModel = customModel;
|
|
67745
|
+
} else {
|
|
67746
|
+
newModel = selection;
|
|
67747
|
+
}
|
|
67748
|
+
const saveAsDefault = await Q3({
|
|
67749
|
+
message: "Save as default model?"
|
|
67750
|
+
});
|
|
67751
|
+
if (!hD2(saveAsDefault) && saveAsDefault) {
|
|
67752
|
+
const existingConfig = getGlobalConfig();
|
|
67753
|
+
setGlobalConfig({
|
|
67754
|
+
...existingConfig,
|
|
67755
|
+
OCO_MODEL: newModel
|
|
67756
|
+
});
|
|
67757
|
+
console.log(source_default.green("\u2714") + " Model saved as default\n");
|
|
67758
|
+
}
|
|
67759
|
+
return newModel;
|
|
67760
|
+
}
|
|
67343
67761
|
var ADJUSTMENT_FACTOR = 20;
|
|
67344
|
-
var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false, context = "") => {
|
|
67762
|
+
var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false, context = "", retryWithModel) => {
|
|
67763
|
+
const currentConfig = getConfig();
|
|
67764
|
+
const provider = currentConfig.OCO_AI_PROVIDER || "openai";
|
|
67765
|
+
const currentModel = retryWithModel || currentConfig.OCO_MODEL;
|
|
67345
67766
|
try {
|
|
67346
67767
|
const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(
|
|
67347
67768
|
fullGitMojiSpec,
|
|
@@ -67375,6 +67796,28 @@ var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false, context
|
|
|
67375
67796
|
throw new Error("EMPTY_MESSAGE" /* emptyMessage */);
|
|
67376
67797
|
return commitMessage;
|
|
67377
67798
|
} catch (error) {
|
|
67799
|
+
if (isModelNotFoundError(error)) {
|
|
67800
|
+
const newModel = await handleModelNotFoundError(
|
|
67801
|
+
error,
|
|
67802
|
+
provider,
|
|
67803
|
+
currentModel
|
|
67804
|
+
);
|
|
67805
|
+
if (newModel) {
|
|
67806
|
+
console.log(source_default.cyan(`Retrying with ${newModel}...
|
|
67807
|
+
`));
|
|
67808
|
+
const existingConfig = getGlobalConfig();
|
|
67809
|
+
setGlobalConfig({
|
|
67810
|
+
...existingConfig,
|
|
67811
|
+
OCO_MODEL: newModel
|
|
67812
|
+
});
|
|
67813
|
+
return generateCommitMessageByDiff(
|
|
67814
|
+
diff,
|
|
67815
|
+
fullGitMojiSpec,
|
|
67816
|
+
context,
|
|
67817
|
+
newModel
|
|
67818
|
+
);
|
|
67819
|
+
}
|
|
67820
|
+
}
|
|
67378
67821
|
throw error;
|
|
67379
67822
|
}
|
|
67380
67823
|
};
|
|
@@ -67465,6 +67908,7 @@ function delay3(ms) {
|
|
|
67465
67908
|
var import_fs3 = require("fs");
|
|
67466
67909
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
67467
67910
|
var import_path4 = require("path");
|
|
67911
|
+
init_dist2();
|
|
67468
67912
|
var assertGitRepo = async () => {
|
|
67469
67913
|
try {
|
|
67470
67914
|
await execa("git", ["rev-parse"]);
|
|
@@ -67782,6 +68226,7 @@ ${stagedFiles.map((file) => ` ${file}`).join("\n")}`
|
|
|
67782
68226
|
}
|
|
67783
68227
|
|
|
67784
68228
|
// src/commands/commitlint.ts
|
|
68229
|
+
init_dist2();
|
|
67785
68230
|
var commitlintConfigCommand = G3(
|
|
67786
68231
|
{
|
|
67787
68232
|
name: "commitlint" /* commitlint */,
|
|
@@ -67811,6 +68256,7 @@ var commitlintConfigCommand = G3(
|
|
|
67811
68256
|
);
|
|
67812
68257
|
|
|
67813
68258
|
// src/commands/githook.ts
|
|
68259
|
+
init_dist2();
|
|
67814
68260
|
var import_fs4 = require("fs");
|
|
67815
68261
|
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
67816
68262
|
var import_path5 = __toESM(require("path"), 1);
|
|
@@ -67894,6 +68340,7 @@ var hookCommand = G3(
|
|
|
67894
68340
|
|
|
67895
68341
|
// src/commands/prepare-commit-msg-hook.ts
|
|
67896
68342
|
var import_promises4 = __toESM(require("fs/promises"), 1);
|
|
68343
|
+
init_dist2();
|
|
67897
68344
|
var [messageFilePath, commitSource] = process.argv.slice(2);
|
|
67898
68345
|
var prepareCommitMessageHook = async (isStageAllFlag = false) => {
|
|
67899
68346
|
try {
|
|
@@ -67946,7 +68393,462 @@ ${fileContent.toString()}`;
|
|
|
67946
68393
|
}
|
|
67947
68394
|
};
|
|
67948
68395
|
|
|
68396
|
+
// src/commands/setup.ts
|
|
68397
|
+
init_dist2();
|
|
68398
|
+
|
|
68399
|
+
// src/utils/modelCache.ts
|
|
68400
|
+
var import_fs5 = require("fs");
|
|
68401
|
+
var import_os2 = require("os");
|
|
68402
|
+
var import_path6 = require("path");
|
|
68403
|
+
var MODEL_CACHE_PATH = (0, import_path6.join)((0, import_os2.homedir)(), ".opencommit-models.json");
|
|
68404
|
+
var CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
68405
|
+
function readCache() {
|
|
68406
|
+
try {
|
|
68407
|
+
if (!(0, import_fs5.existsSync)(MODEL_CACHE_PATH)) {
|
|
68408
|
+
return null;
|
|
68409
|
+
}
|
|
68410
|
+
const data = (0, import_fs5.readFileSync)(MODEL_CACHE_PATH, "utf8");
|
|
68411
|
+
return JSON.parse(data);
|
|
68412
|
+
} catch {
|
|
68413
|
+
return null;
|
|
68414
|
+
}
|
|
68415
|
+
}
|
|
68416
|
+
function writeCache(models) {
|
|
68417
|
+
try {
|
|
68418
|
+
const cache = {
|
|
68419
|
+
timestamp: Date.now(),
|
|
68420
|
+
models
|
|
68421
|
+
};
|
|
68422
|
+
(0, import_fs5.writeFileSync)(MODEL_CACHE_PATH, JSON.stringify(cache, null, 2), "utf8");
|
|
68423
|
+
} catch {
|
|
68424
|
+
}
|
|
68425
|
+
}
|
|
68426
|
+
function isCacheValid(cache) {
|
|
68427
|
+
if (!cache) return false;
|
|
68428
|
+
return Date.now() - cache.timestamp < CACHE_TTL_MS;
|
|
68429
|
+
}
|
|
68430
|
+
async function fetchOpenAIModels(apiKey) {
|
|
68431
|
+
try {
|
|
68432
|
+
const response = await fetch("https://api.openai.com/v1/models", {
|
|
68433
|
+
headers: {
|
|
68434
|
+
Authorization: `Bearer ${apiKey}`
|
|
68435
|
+
}
|
|
68436
|
+
});
|
|
68437
|
+
if (!response.ok) {
|
|
68438
|
+
return MODEL_LIST.openai;
|
|
68439
|
+
}
|
|
68440
|
+
const data = await response.json();
|
|
68441
|
+
const models = data.data.map((m5) => m5.id).filter(
|
|
68442
|
+
(id) => id.startsWith("gpt-") || id.startsWith("o1") || id.startsWith("o3") || id.startsWith("o4")
|
|
68443
|
+
).sort();
|
|
68444
|
+
return models.length > 0 ? models : MODEL_LIST.openai;
|
|
68445
|
+
} catch {
|
|
68446
|
+
return MODEL_LIST.openai;
|
|
68447
|
+
}
|
|
68448
|
+
}
|
|
68449
|
+
async function fetchOllamaModels(baseUrl = "http://localhost:11434") {
|
|
68450
|
+
try {
|
|
68451
|
+
const response = await fetch(`${baseUrl}/api/tags`);
|
|
68452
|
+
if (!response.ok) {
|
|
68453
|
+
return [];
|
|
68454
|
+
}
|
|
68455
|
+
const data = await response.json();
|
|
68456
|
+
return data.models?.map((m5) => m5.name) || [];
|
|
68457
|
+
} catch {
|
|
68458
|
+
return [];
|
|
68459
|
+
}
|
|
68460
|
+
}
|
|
68461
|
+
async function fetchModelsForProvider(provider, apiKey, baseUrl) {
|
|
68462
|
+
const cache = readCache();
|
|
68463
|
+
if (isCacheValid(cache) && cache.models[provider]) {
|
|
68464
|
+
return cache.models[provider];
|
|
68465
|
+
}
|
|
68466
|
+
let models = [];
|
|
68467
|
+
switch (provider.toLowerCase()) {
|
|
68468
|
+
case "openai" /* OPENAI */:
|
|
68469
|
+
if (apiKey) {
|
|
68470
|
+
models = await fetchOpenAIModels(apiKey);
|
|
68471
|
+
} else {
|
|
68472
|
+
models = MODEL_LIST.openai;
|
|
68473
|
+
}
|
|
68474
|
+
break;
|
|
68475
|
+
case "ollama" /* OLLAMA */:
|
|
68476
|
+
models = await fetchOllamaModels(baseUrl);
|
|
68477
|
+
break;
|
|
68478
|
+
case "anthropic" /* ANTHROPIC */:
|
|
68479
|
+
models = MODEL_LIST.anthropic;
|
|
68480
|
+
break;
|
|
68481
|
+
case "gemini" /* GEMINI */:
|
|
68482
|
+
models = MODEL_LIST.gemini;
|
|
68483
|
+
break;
|
|
68484
|
+
case "groq" /* GROQ */:
|
|
68485
|
+
models = MODEL_LIST.groq;
|
|
68486
|
+
break;
|
|
68487
|
+
case "mistral" /* MISTRAL */:
|
|
68488
|
+
models = MODEL_LIST.mistral;
|
|
68489
|
+
break;
|
|
68490
|
+
case "deepseek" /* DEEPSEEK */:
|
|
68491
|
+
models = MODEL_LIST.deepseek;
|
|
68492
|
+
break;
|
|
68493
|
+
case "aimlapi" /* AIMLAPI */:
|
|
68494
|
+
models = MODEL_LIST.aimlapi;
|
|
68495
|
+
break;
|
|
68496
|
+
case "openrouter" /* OPENROUTER */:
|
|
68497
|
+
models = MODEL_LIST.openrouter;
|
|
68498
|
+
break;
|
|
68499
|
+
default:
|
|
68500
|
+
models = MODEL_LIST.openai;
|
|
68501
|
+
}
|
|
68502
|
+
const existingCache = cache?.models || {};
|
|
68503
|
+
existingCache[provider] = models;
|
|
68504
|
+
writeCache(existingCache);
|
|
68505
|
+
return models;
|
|
68506
|
+
}
|
|
68507
|
+
|
|
68508
|
+
// src/commands/setup.ts
|
|
68509
|
+
var PROVIDER_DISPLAY_NAMES = {
|
|
68510
|
+
["openai" /* OPENAI */]: "OpenAI (GPT-4o, GPT-4)",
|
|
68511
|
+
["anthropic" /* ANTHROPIC */]: "Anthropic (Claude Sonnet, Opus)",
|
|
68512
|
+
["ollama" /* OLLAMA */]: "Ollama (Free, runs locally)",
|
|
68513
|
+
["gemini" /* GEMINI */]: "Google Gemini",
|
|
68514
|
+
["groq" /* GROQ */]: "Groq (Fast inference, free tier)",
|
|
68515
|
+
["mistral" /* MISTRAL */]: "Mistral AI",
|
|
68516
|
+
["deepseek" /* DEEPSEEK */]: "DeepSeek",
|
|
68517
|
+
["openrouter" /* OPENROUTER */]: "OpenRouter (Multiple providers)",
|
|
68518
|
+
["aimlapi" /* AIMLAPI */]: "AI/ML API",
|
|
68519
|
+
["azure" /* AZURE */]: "Azure OpenAI",
|
|
68520
|
+
["mlx" /* MLX */]: "MLX (Apple Silicon, local)"
|
|
68521
|
+
};
|
|
68522
|
+
var PRIMARY_PROVIDERS = [
|
|
68523
|
+
"openai" /* OPENAI */,
|
|
68524
|
+
"anthropic" /* ANTHROPIC */,
|
|
68525
|
+
"ollama" /* OLLAMA */
|
|
68526
|
+
];
|
|
68527
|
+
var OTHER_PROVIDERS = [
|
|
68528
|
+
"gemini" /* GEMINI */,
|
|
68529
|
+
"groq" /* GROQ */,
|
|
68530
|
+
"mistral" /* MISTRAL */,
|
|
68531
|
+
"deepseek" /* DEEPSEEK */,
|
|
68532
|
+
"openrouter" /* OPENROUTER */,
|
|
68533
|
+
"aimlapi" /* AIMLAPI */,
|
|
68534
|
+
"azure" /* AZURE */,
|
|
68535
|
+
"mlx" /* MLX */
|
|
68536
|
+
];
|
|
68537
|
+
var NO_API_KEY_PROVIDERS = [
|
|
68538
|
+
"ollama" /* OLLAMA */,
|
|
68539
|
+
"mlx" /* MLX */
|
|
68540
|
+
];
|
|
68541
|
+
async function selectProvider() {
|
|
68542
|
+
const primaryOptions = PRIMARY_PROVIDERS.map((provider) => ({
|
|
68543
|
+
value: provider,
|
|
68544
|
+
label: PROVIDER_DISPLAY_NAMES[provider] || provider
|
|
68545
|
+
}));
|
|
68546
|
+
primaryOptions.push({
|
|
68547
|
+
value: "other",
|
|
68548
|
+
label: "Other providers..."
|
|
68549
|
+
});
|
|
68550
|
+
const selection = await ee({
|
|
68551
|
+
message: "Select your AI provider:",
|
|
68552
|
+
options: primaryOptions
|
|
68553
|
+
});
|
|
68554
|
+
if (hD2(selection)) return selection;
|
|
68555
|
+
if (selection === "other") {
|
|
68556
|
+
const otherOptions = OTHER_PROVIDERS.map((provider) => ({
|
|
68557
|
+
value: provider,
|
|
68558
|
+
label: PROVIDER_DISPLAY_NAMES[provider] || provider
|
|
68559
|
+
}));
|
|
68560
|
+
return await ee({
|
|
68561
|
+
message: "Select provider:",
|
|
68562
|
+
options: otherOptions
|
|
68563
|
+
});
|
|
68564
|
+
}
|
|
68565
|
+
return selection;
|
|
68566
|
+
}
|
|
68567
|
+
async function getApiKey(provider) {
|
|
68568
|
+
const url2 = PROVIDER_API_KEY_URLS[provider];
|
|
68569
|
+
let message = `Enter your ${provider} API key:`;
|
|
68570
|
+
if (url2) {
|
|
68571
|
+
message = `Enter your API key:
|
|
68572
|
+
${source_default.dim(` Get your key at: ${url2}`)}`;
|
|
68573
|
+
}
|
|
68574
|
+
return await J4({
|
|
68575
|
+
message,
|
|
68576
|
+
placeholder: "sk-...",
|
|
68577
|
+
validate: (value) => {
|
|
68578
|
+
if (!value || value.trim().length === 0) {
|
|
68579
|
+
return "API key is required";
|
|
68580
|
+
}
|
|
68581
|
+
return void 0;
|
|
68582
|
+
}
|
|
68583
|
+
});
|
|
68584
|
+
}
|
|
68585
|
+
async function selectModel(provider, apiKey) {
|
|
68586
|
+
const loadingSpinner = le();
|
|
68587
|
+
loadingSpinner.start("Fetching available models...");
|
|
68588
|
+
let models = [];
|
|
68589
|
+
try {
|
|
68590
|
+
models = await fetchModelsForProvider(provider, apiKey);
|
|
68591
|
+
} catch {
|
|
68592
|
+
const providerKey = provider.toLowerCase();
|
|
68593
|
+
models = MODEL_LIST[providerKey] || [];
|
|
68594
|
+
}
|
|
68595
|
+
loadingSpinner.stop("Models loaded");
|
|
68596
|
+
if (models.length === 0) {
|
|
68597
|
+
if (NO_API_KEY_PROVIDERS.includes(provider)) {
|
|
68598
|
+
return await J4({
|
|
68599
|
+
message: "Enter model name (e.g., llama3:8b, mistral):",
|
|
68600
|
+
placeholder: "llama3:8b",
|
|
68601
|
+
validate: (value) => {
|
|
68602
|
+
if (!value || value.trim().length === 0) {
|
|
68603
|
+
return "Model name is required";
|
|
68604
|
+
}
|
|
68605
|
+
return void 0;
|
|
68606
|
+
}
|
|
68607
|
+
});
|
|
68608
|
+
}
|
|
68609
|
+
const providerKey = provider.toLowerCase();
|
|
68610
|
+
return MODEL_LIST[providerKey]?.[0] || "gpt-4o-mini";
|
|
68611
|
+
}
|
|
68612
|
+
const recommended = RECOMMENDED_MODELS[provider];
|
|
68613
|
+
const options = [];
|
|
68614
|
+
if (recommended && models.includes(recommended)) {
|
|
68615
|
+
options.push({
|
|
68616
|
+
value: recommended,
|
|
68617
|
+
label: `${recommended} (Recommended)`
|
|
68618
|
+
});
|
|
68619
|
+
}
|
|
68620
|
+
const otherModels = models.filter((m5) => m5 !== recommended).slice(0, 10);
|
|
68621
|
+
otherModels.forEach((model) => {
|
|
68622
|
+
options.push({ value: model, label: model });
|
|
68623
|
+
});
|
|
68624
|
+
if (models.length > 11) {
|
|
68625
|
+
options.push({ value: "__show_all__", label: "Show all models..." });
|
|
68626
|
+
}
|
|
68627
|
+
options.push({ value: "__custom__", label: "Enter custom model..." });
|
|
68628
|
+
const selection = await ee({
|
|
68629
|
+
message: "Select a model:",
|
|
68630
|
+
options
|
|
68631
|
+
});
|
|
68632
|
+
if (hD2(selection)) return selection;
|
|
68633
|
+
if (selection === "__show_all__") {
|
|
68634
|
+
const allOptions = models.map((model) => ({
|
|
68635
|
+
value: model,
|
|
68636
|
+
label: model === recommended ? `${model} (Recommended)` : model
|
|
68637
|
+
}));
|
|
68638
|
+
return await ee({
|
|
68639
|
+
message: "Select a model:",
|
|
68640
|
+
options: allOptions
|
|
68641
|
+
});
|
|
68642
|
+
}
|
|
68643
|
+
if (selection === "__custom__") {
|
|
68644
|
+
return await J4({
|
|
68645
|
+
message: "Enter model name:",
|
|
68646
|
+
validate: (value) => {
|
|
68647
|
+
if (!value || value.trim().length === 0) {
|
|
68648
|
+
return "Model name is required";
|
|
68649
|
+
}
|
|
68650
|
+
return void 0;
|
|
68651
|
+
}
|
|
68652
|
+
});
|
|
68653
|
+
}
|
|
68654
|
+
return selection;
|
|
68655
|
+
}
|
|
68656
|
+
async function setupOllama() {
|
|
68657
|
+
console.log(source_default.cyan("\n Ollama - Free Local AI\n"));
|
|
68658
|
+
console.log(source_default.dim(" Setup steps:"));
|
|
68659
|
+
console.log(source_default.dim(" 1. Install: https://ollama.ai/download"));
|
|
68660
|
+
console.log(source_default.dim(" 2. Pull a model: ollama pull llama3:8b"));
|
|
68661
|
+
console.log(source_default.dim(" 3. Start server: ollama serve\n"));
|
|
68662
|
+
const loadingSpinner = le();
|
|
68663
|
+
loadingSpinner.start("Checking for local Ollama installation...");
|
|
68664
|
+
const defaultUrl = "http://localhost:11434";
|
|
68665
|
+
let ollamaModels = [];
|
|
68666
|
+
try {
|
|
68667
|
+
ollamaModels = await fetchOllamaModels(defaultUrl);
|
|
68668
|
+
if (ollamaModels.length > 0) {
|
|
68669
|
+
loadingSpinner.stop(
|
|
68670
|
+
`${source_default.green("\u2714")} Found ${ollamaModels.length} local model(s)`
|
|
68671
|
+
);
|
|
68672
|
+
} else {
|
|
68673
|
+
loadingSpinner.stop(
|
|
68674
|
+
source_default.yellow(
|
|
68675
|
+
"Ollama is running but no models found. Pull a model first: ollama pull llama3:8b"
|
|
68676
|
+
)
|
|
68677
|
+
);
|
|
68678
|
+
}
|
|
68679
|
+
} catch {
|
|
68680
|
+
loadingSpinner.stop(
|
|
68681
|
+
source_default.yellow(
|
|
68682
|
+
"Could not connect to Ollama. Make sure it is running: ollama serve"
|
|
68683
|
+
)
|
|
68684
|
+
);
|
|
68685
|
+
}
|
|
68686
|
+
let model;
|
|
68687
|
+
if (ollamaModels.length > 0) {
|
|
68688
|
+
model = await ee({
|
|
68689
|
+
message: "Select a model:",
|
|
68690
|
+
options: [
|
|
68691
|
+
...ollamaModels.map((m5) => ({ value: m5, label: m5 })),
|
|
68692
|
+
{ value: "__custom__", label: "Enter custom model name..." }
|
|
68693
|
+
]
|
|
68694
|
+
});
|
|
68695
|
+
if (hD2(model)) return null;
|
|
68696
|
+
if (model === "__custom__") {
|
|
68697
|
+
model = await J4({
|
|
68698
|
+
message: "Enter model name (e.g., llama3:8b, mistral):",
|
|
68699
|
+
placeholder: "llama3:8b"
|
|
68700
|
+
});
|
|
68701
|
+
}
|
|
68702
|
+
} else {
|
|
68703
|
+
model = await J4({
|
|
68704
|
+
message: "Enter model name (e.g., llama3:8b, mistral):",
|
|
68705
|
+
placeholder: "llama3:8b",
|
|
68706
|
+
validate: (value) => {
|
|
68707
|
+
if (!value || value.trim().length === 0) {
|
|
68708
|
+
return "Model name is required";
|
|
68709
|
+
}
|
|
68710
|
+
return void 0;
|
|
68711
|
+
}
|
|
68712
|
+
});
|
|
68713
|
+
}
|
|
68714
|
+
if (hD2(model)) return null;
|
|
68715
|
+
const apiUrl = await J4({
|
|
68716
|
+
message: "Ollama URL (press Enter for default):",
|
|
68717
|
+
placeholder: defaultUrl,
|
|
68718
|
+
defaultValue: defaultUrl
|
|
68719
|
+
});
|
|
68720
|
+
if (hD2(apiUrl)) return null;
|
|
68721
|
+
return {
|
|
68722
|
+
provider: "ollama" /* OLLAMA */,
|
|
68723
|
+
model,
|
|
68724
|
+
apiUrl: apiUrl || defaultUrl
|
|
68725
|
+
};
|
|
68726
|
+
}
|
|
68727
|
+
async function runSetup() {
|
|
68728
|
+
ae(source_default.bgCyan(" Welcome to OpenCommit! "));
|
|
68729
|
+
const provider = await selectProvider();
|
|
68730
|
+
if (hD2(provider)) {
|
|
68731
|
+
ce("Setup cancelled");
|
|
68732
|
+
return false;
|
|
68733
|
+
}
|
|
68734
|
+
let config7 = {};
|
|
68735
|
+
if (provider === "ollama" /* OLLAMA */) {
|
|
68736
|
+
const ollamaConfig = await setupOllama();
|
|
68737
|
+
if (!ollamaConfig) {
|
|
68738
|
+
ce("Setup cancelled");
|
|
68739
|
+
return false;
|
|
68740
|
+
}
|
|
68741
|
+
config7 = {
|
|
68742
|
+
OCO_AI_PROVIDER: ollamaConfig.provider,
|
|
68743
|
+
OCO_MODEL: ollamaConfig.model,
|
|
68744
|
+
OCO_API_URL: ollamaConfig.apiUrl,
|
|
68745
|
+
OCO_API_KEY: "ollama"
|
|
68746
|
+
// Placeholder
|
|
68747
|
+
};
|
|
68748
|
+
} else if (provider === "mlx" /* MLX */) {
|
|
68749
|
+
console.log(source_default.cyan("\n MLX - Apple Silicon Local AI\n"));
|
|
68750
|
+
console.log(source_default.dim(" MLX runs locally on Apple Silicon Macs."));
|
|
68751
|
+
console.log(source_default.dim(" No API key required.\n"));
|
|
68752
|
+
const model = await J4({
|
|
68753
|
+
message: "Enter model name:",
|
|
68754
|
+
placeholder: "mlx-community/Llama-3-8B-Instruct-4bit"
|
|
68755
|
+
});
|
|
68756
|
+
if (hD2(model)) {
|
|
68757
|
+
ce("Setup cancelled");
|
|
68758
|
+
return false;
|
|
68759
|
+
}
|
|
68760
|
+
config7 = {
|
|
68761
|
+
OCO_AI_PROVIDER: "mlx" /* MLX */,
|
|
68762
|
+
OCO_MODEL: model,
|
|
68763
|
+
OCO_API_KEY: "mlx"
|
|
68764
|
+
// Placeholder
|
|
68765
|
+
};
|
|
68766
|
+
} else {
|
|
68767
|
+
const apiKey = await getApiKey(provider);
|
|
68768
|
+
if (hD2(apiKey)) {
|
|
68769
|
+
ce("Setup cancelled");
|
|
68770
|
+
return false;
|
|
68771
|
+
}
|
|
68772
|
+
const model = await selectModel(provider, apiKey);
|
|
68773
|
+
if (hD2(model)) {
|
|
68774
|
+
ce("Setup cancelled");
|
|
68775
|
+
return false;
|
|
68776
|
+
}
|
|
68777
|
+
config7 = {
|
|
68778
|
+
OCO_AI_PROVIDER: provider,
|
|
68779
|
+
OCO_API_KEY: apiKey,
|
|
68780
|
+
OCO_MODEL: model
|
|
68781
|
+
};
|
|
68782
|
+
}
|
|
68783
|
+
const existingConfig = getIsGlobalConfigFileExist() ? getGlobalConfig() : DEFAULT_CONFIG;
|
|
68784
|
+
const newConfig = {
|
|
68785
|
+
...existingConfig,
|
|
68786
|
+
...config7
|
|
68787
|
+
};
|
|
68788
|
+
setGlobalConfig(newConfig);
|
|
68789
|
+
ce(
|
|
68790
|
+
`${source_default.green("\u2714")} Configuration saved to ~/.opencommit
|
|
68791
|
+
|
|
68792
|
+
Run ${source_default.cyan("oco")} to generate commit messages!`
|
|
68793
|
+
);
|
|
68794
|
+
return true;
|
|
68795
|
+
}
|
|
68796
|
+
function isFirstRun() {
|
|
68797
|
+
if (!getIsGlobalConfigFileExist()) {
|
|
68798
|
+
return true;
|
|
68799
|
+
}
|
|
68800
|
+
const config7 = getConfig();
|
|
68801
|
+
const provider = config7.OCO_AI_PROVIDER || "openai" /* OPENAI */;
|
|
68802
|
+
if (NO_API_KEY_PROVIDERS.includes(provider)) {
|
|
68803
|
+
return !config7.OCO_MODEL;
|
|
68804
|
+
}
|
|
68805
|
+
return !config7.OCO_API_KEY;
|
|
68806
|
+
}
|
|
68807
|
+
async function promptForMissingApiKey() {
|
|
68808
|
+
const config7 = getConfig();
|
|
68809
|
+
const provider = config7.OCO_AI_PROVIDER || "openai" /* OPENAI */;
|
|
68810
|
+
if (NO_API_KEY_PROVIDERS.includes(provider)) {
|
|
68811
|
+
return true;
|
|
68812
|
+
}
|
|
68813
|
+
if (config7.OCO_API_KEY) {
|
|
68814
|
+
return true;
|
|
68815
|
+
}
|
|
68816
|
+
console.log(
|
|
68817
|
+
source_default.yellow(
|
|
68818
|
+
`
|
|
68819
|
+
API key missing for ${provider}. Let's set it up.
|
|
68820
|
+
`
|
|
68821
|
+
)
|
|
68822
|
+
);
|
|
68823
|
+
const apiKey = await getApiKey(provider);
|
|
68824
|
+
if (hD2(apiKey)) {
|
|
68825
|
+
return false;
|
|
68826
|
+
}
|
|
68827
|
+
const existingConfig = getGlobalConfig();
|
|
68828
|
+
setGlobalConfig({
|
|
68829
|
+
...existingConfig,
|
|
68830
|
+
OCO_API_KEY: apiKey
|
|
68831
|
+
});
|
|
68832
|
+
console.log(source_default.green("\u2714") + " API key saved\n");
|
|
68833
|
+
return true;
|
|
68834
|
+
}
|
|
68835
|
+
var setupCommand = G3(
|
|
68836
|
+
{
|
|
68837
|
+
name: "setup" /* setup */,
|
|
68838
|
+
help: {
|
|
68839
|
+
description: "Interactive setup wizard for OpenCommit"
|
|
68840
|
+
}
|
|
68841
|
+
},
|
|
68842
|
+
async () => {
|
|
68843
|
+
await runSetup();
|
|
68844
|
+
}
|
|
68845
|
+
);
|
|
68846
|
+
|
|
68847
|
+
// src/utils/checkIsLatestVersion.ts
|
|
68848
|
+
init_dist2();
|
|
68849
|
+
|
|
67949
68850
|
// src/version.ts
|
|
68851
|
+
init_dist2();
|
|
67950
68852
|
var getOpenCommitLatestVersion = async () => {
|
|
67951
68853
|
try {
|
|
67952
68854
|
const { stdout } = await execa("npm", ["view", "opencommit", "version"]);
|
|
@@ -67977,9 +68879,9 @@ Current version: ${currentVersion}. Latest version: ${latestVersion}.
|
|
|
67977
68879
|
};
|
|
67978
68880
|
|
|
67979
68881
|
// src/migrations/_run.ts
|
|
67980
|
-
var
|
|
67981
|
-
var
|
|
67982
|
-
var
|
|
68882
|
+
var import_fs6 = __toESM(require("fs"), 1);
|
|
68883
|
+
var import_os3 = require("os");
|
|
68884
|
+
var import_path7 = require("path");
|
|
67983
68885
|
|
|
67984
68886
|
// src/migrations/00_use_single_api_key_and_url.ts
|
|
67985
68887
|
function use_single_api_key_and_url_default() {
|
|
@@ -68070,18 +68972,19 @@ var migrations = [
|
|
|
68070
68972
|
];
|
|
68071
68973
|
|
|
68072
68974
|
// src/migrations/_run.ts
|
|
68073
|
-
|
|
68975
|
+
init_dist2();
|
|
68976
|
+
var migrationsFile = (0, import_path7.join)((0, import_os3.homedir)(), ".opencommit_migrations");
|
|
68074
68977
|
var getCompletedMigrations = () => {
|
|
68075
|
-
if (!
|
|
68978
|
+
if (!import_fs6.default.existsSync(migrationsFile)) {
|
|
68076
68979
|
return [];
|
|
68077
68980
|
}
|
|
68078
|
-
const data =
|
|
68981
|
+
const data = import_fs6.default.readFileSync(migrationsFile, "utf-8");
|
|
68079
68982
|
return data ? JSON.parse(data) : [];
|
|
68080
68983
|
};
|
|
68081
68984
|
var saveCompletedMigration = (migrationName) => {
|
|
68082
68985
|
const completedMigrations = getCompletedMigrations();
|
|
68083
68986
|
completedMigrations.push(migrationName);
|
|
68084
|
-
|
|
68987
|
+
import_fs6.default.writeFileSync(
|
|
68085
68988
|
migrationsFile,
|
|
68086
68989
|
JSON.stringify(completedMigrations, null, 2)
|
|
68087
68990
|
);
|
|
@@ -68133,7 +69036,7 @@ Z2(
|
|
|
68133
69036
|
{
|
|
68134
69037
|
version: package_default.version,
|
|
68135
69038
|
name: "opencommit",
|
|
68136
|
-
commands: [configCommand, hookCommand, commitlintConfigCommand],
|
|
69039
|
+
commands: [configCommand, hookCommand, commitlintConfigCommand, setupCommand],
|
|
68137
69040
|
flags: {
|
|
68138
69041
|
fgm: {
|
|
68139
69042
|
type: Boolean,
|
|
@@ -68162,6 +69065,16 @@ Z2(
|
|
|
68162
69065
|
if (await isHookCalled()) {
|
|
68163
69066
|
prepareCommitMessageHook();
|
|
68164
69067
|
} else {
|
|
69068
|
+
if (isFirstRun()) {
|
|
69069
|
+
const setupComplete = await runSetup();
|
|
69070
|
+
if (!setupComplete) {
|
|
69071
|
+
process.exit(1);
|
|
69072
|
+
}
|
|
69073
|
+
}
|
|
69074
|
+
const hasApiKey = await promptForMissingApiKey();
|
|
69075
|
+
if (!hasApiKey) {
|
|
69076
|
+
process.exit(1);
|
|
69077
|
+
}
|
|
68165
69078
|
commit(extraArgs, flags.context, false, flags.fgm, flags.yes);
|
|
68166
69079
|
}
|
|
68167
69080
|
},
|