@prisma/migrate 6.6.0-dev.7 → 6.6.0-dev.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CLI.js +3 -3
- package/dist/Migrate.js +8 -6
- package/dist/SchemaEngine.js +5 -5
- package/dist/bin.js +47 -46
- package/dist/chunk-23DZXSTI.js +62 -0
- package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
- package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
- package/dist/chunk-33LPBNDX.js +1399 -0
- package/dist/{chunk-V3ZMNXZC.js → chunk-5LKIRKDL.js} +307 -382
- package/dist/{chunk-IR55GBON.js → chunk-5LTDMS3H.js} +18 -18
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-Q3ZLC44N.js → chunk-63X7FE2R.js} +57 -66
- package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
- package/dist/{chunk-N4XTKFY6.js → chunk-7RM467G7.js} +39 -38
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-A6PMXMMT.js → chunk-AUGZZ6RT.js} +105 -13
- package/dist/{chunk-G2XUUMKH.js → chunk-B4SUSDC2.js} +31 -39
- package/dist/{chunk-ZOEKRXDP.js → chunk-D2DGSPW6.js} +29 -55
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-HCBZB4XC.js → chunk-FFPSJTA6.js} +53 -52
- package/dist/{chunk-P6I3Y7KI.js → chunk-FITBCODR.js} +371 -530
- package/dist/{chunk-N3KYWSX2.js → chunk-FZGPSDP7.js} +55 -49
- package/dist/{chunk-MCWCB2AX.js → chunk-IINN7QUV.js} +170 -643
- package/dist/{chunk-3GHGKOL4.js → chunk-KJGJMCHL.js} +370 -529
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-MKK3GSDF.js → chunk-NIKXBMZL.js} +5 -5
- package/dist/{chunk-GG54LOYV.js → chunk-O6RQXRWU.js} +45 -44
- package/dist/{chunk-MATFO4ZW.js → chunk-OEWQACEH.js} +38 -39
- package/dist/{chunk-EGPJABTW.js → chunk-QVMYNWAN.js} +257 -103
- package/dist/{chunk-V5TUSOJX.js → chunk-SQKGZVG3.js} +45 -45
- package/dist/{chunk-CQZFVAXC.js → chunk-TN7JMNXD.js} +42 -41
- package/dist/chunk-URKH6SE2.js +479 -0
- package/dist/chunk-V6PVGSDJ.js +76 -0
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/{chunk-KS7IEA6Z.js → chunk-YGBJA7QJ.js} +50 -52
- package/dist/{chunk-WI2A2TQE.js → chunk-ZJ4IDCRR.js} +90 -91
- package/dist/chunk-ZLHWX5PJ.js +883 -0
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +4 -5
- package/dist/commands/DbExecute.js +9 -7
- package/dist/commands/DbPull.js +11 -10
- package/dist/commands/DbPush.js +10 -9
- package/dist/commands/DbSeed.js +4 -5
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +12 -11
- package/dist/commands/MigrateDev.js +14 -13
- package/dist/commands/MigrateDiff.js +12 -10
- package/dist/commands/MigrateReset.js +13 -12
- package/dist/commands/MigrateResolve.js +10 -9
- package/dist/commands/MigrateStatus.js +10 -9
- package/dist/index.js +50 -51
- package/dist/internals/src/Generator.d.ts +23 -5
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
- package/dist/internals/src/cli/directoryConfig.d.ts +7 -0
- package/dist/internals/src/cli/getSchema.d.ts +3 -28
- package/dist/internals/src/cli/hashes.d.ts +1 -2
- package/dist/internals/src/cli/schemaContext.d.ts +59 -0
- package/dist/internals/src/client/getClientEngineType.d.ts +1 -1
- package/dist/internals/src/convertCredentials.d.ts +1 -1
- package/dist/internals/src/engine-commands/getConfig.d.ts +1 -5
- package/dist/internals/src/engine-commands/getDmmf.d.ts +3 -6
- package/dist/internals/src/engine-commands/lintSchema.d.ts +1 -1
- package/dist/internals/src/errorReporting.d.ts +0 -1
- package/dist/internals/src/get-generators/getGenerators.d.ts +22 -9
- package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +1 -1
- package/dist/internals/src/index.d.ts +7 -7
- package/dist/internals/src/migrateTypes.d.ts +63 -0
- package/dist/internals/src/panic.d.ts +1 -4
- package/dist/internals/src/resolvePkg.d.ts +7 -0
- package/dist/internals/src/types.d.ts +1 -1
- package/dist/internals/src/utils/extractPreviewFeatures.d.ts +2 -2
- package/dist/internals/src/utils/getEnvPaths.d.ts +1 -1
- package/dist/internals/src/utils/parseEnvValue.d.ts +1 -1
- package/dist/internals/src/utils/schemaFileInput.d.ts +0 -4
- package/dist/internals/src/utils/toSchemasContainer.d.ts +2 -3
- package/dist/migrate/src/Migrate.d.ts +7 -5
- package/dist/migrate/src/SchemaEngine.d.ts +5 -9
- package/dist/migrate/src/index.d.ts +0 -1
- package/dist/migrate/src/types.d.ts +14 -10
- package/dist/migrate/src/utils/createMigration.d.ts +21 -0
- package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +4 -6
- package/dist/migrate/src/utils/introspectSql.d.ts +3 -2
- package/dist/migrate/src/utils/listMigrations.d.ts +9 -0
- package/dist/migrate/src/utils/printDatasources.d.ts +1 -1
- package/dist/migrate/src/utils/seed.d.ts +0 -2
- package/dist/migrate/src/views/handleViewsIO.d.ts +2 -2
- package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
- package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
- package/dist/types.js +1 -1
- package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
- package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
- package/dist/utils/byline.js +1 -1
- package/dist/utils/captureStdout.js +3 -3
- package/dist/utils/countModelsAndTypes.js +1 -1
- package/dist/utils/{getSchemaPathAndPrint.js → createMigration.js} +8 -8
- package/dist/utils/customColors.js +1 -1
- package/dist/utils/ensureDatabaseExists.js +7 -7
- package/dist/utils/errors.js +1 -1
- package/dist/utils/flagErrors.js +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +5 -5
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +5 -5
- package/dist/utils/isSchemaEmpty.js +1 -1
- package/dist/utils/listMigrations.js +25 -0
- package/dist/utils/now.js +1 -1
- package/dist/utils/printDatasource.js +1 -1
- package/dist/utils/printDatasources.js +5 -5
- package/dist/utils/printFiles.js +5 -5
- package/dist/utils/printIntrospectedSchema.js +1 -1
- package/dist/utils/printMigrationId.js +1 -1
- package/dist/utils/promptForMigrationName.js +3 -3
- package/dist/utils/removeSchemaFiles.js +1 -1
- package/dist/utils/replaceOrAddDatasource.js +1 -1
- package/dist/utils/replaceOrAddDatasource.test.js +1 -1
- package/dist/utils/saveSchemaFiles.js +1 -1
- package/dist/utils/seed.js +4 -7
- package/dist/utils/setupCockroach.js +3 -3
- package/dist/utils/setupMSSQL.js +1478 -707
- package/dist/utils/setupMongo.js +553 -552
- package/dist/utils/setupMysql.js +508 -563
- package/dist/utils/setupPostgres.js +3 -3
- package/dist/utils/spinner.js +4 -3
- package/dist/utils/test-handlePanic.js +1 -30
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +11 -11
- package/dist/chunk-GKDFIHM2.js +0 -45
- package/dist/chunk-J46BJQHT.js +0 -268
- package/dist/chunk-KOF4LGTS.js +0 -1817
- package/dist/chunk-YYPMC5FN.js +0 -1407
- package/dist/internals/src/get-generators/generatorResolvers/generatorResolvers.d.ts +0 -15
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.d.ts +0 -9
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.d.ts +0 -8
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.d.ts +0 -1
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.d.ts +0 -20
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.d.ts +0 -7
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.d.ts +0 -20
- package/dist/internals/src/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_IINN7QUV_exports = {};
|
|
30
|
+
__export(chunk_IINN7QUV_exports, {
|
|
31
31
|
createSpinner: () => createSpinner
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_IINN7QUV_exports);
|
|
34
|
+
var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
|
|
35
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
35
36
|
var import_node_process = __toESM(require("node:process"));
|
|
36
37
|
var import_node_process2 = __toESM(require("node:process"));
|
|
37
38
|
var import_node_os = __toESM(require("node:os"));
|
|
@@ -39,9 +40,7 @@ var import_node_tty = __toESM(require("node:tty"));
|
|
|
39
40
|
var import_node_process3 = __toESM(require("node:process"));
|
|
40
41
|
var import_node_process4 = __toESM(require("node:process"));
|
|
41
42
|
var import_node_process5 = __toESM(require("node:process"));
|
|
42
|
-
var
|
|
43
|
-
var import_node_process7 = __toESM(require("node:process"));
|
|
44
|
-
var require_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
43
|
+
var require_spinners = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
45
44
|
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json"(exports, module2) {
|
|
46
45
|
module2.exports = {
|
|
47
46
|
dots: {
|
|
@@ -1667,7 +1666,7 @@ var require_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1667
1666
|
};
|
|
1668
1667
|
}
|
|
1669
1668
|
});
|
|
1670
|
-
var require_cli_spinners = (0,
|
|
1669
|
+
var require_cli_spinners = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1671
1670
|
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js"(exports, module2) {
|
|
1672
1671
|
"use strict";
|
|
1673
1672
|
var spinners = Object.assign({}, require_spinners());
|
|
@@ -2160,374 +2159,12 @@ Object.defineProperties(createChalk.prototype, styles2);
|
|
|
2160
2159
|
var chalk = createChalk();
|
|
2161
2160
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
2162
2161
|
var source_default = chalk;
|
|
2163
|
-
var
|
|
2164
|
-
if (property === "length" || property === "prototype") {
|
|
2165
|
-
return;
|
|
2166
|
-
}
|
|
2167
|
-
if (property === "arguments" || property === "caller") {
|
|
2168
|
-
return;
|
|
2169
|
-
}
|
|
2170
|
-
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
2171
|
-
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
2172
|
-
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
2173
|
-
return;
|
|
2174
|
-
}
|
|
2175
|
-
Object.defineProperty(to, property, fromDescriptor);
|
|
2176
|
-
};
|
|
2177
|
-
var canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
2178
|
-
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
2179
|
-
};
|
|
2180
|
-
var changePrototype = (to, from) => {
|
|
2181
|
-
const fromPrototype = Object.getPrototypeOf(from);
|
|
2182
|
-
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
2183
|
-
return;
|
|
2184
|
-
}
|
|
2185
|
-
Object.setPrototypeOf(to, fromPrototype);
|
|
2186
|
-
};
|
|
2187
|
-
var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
2188
|
-
${fromBody}`;
|
|
2189
|
-
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
2190
|
-
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
2191
|
-
var changeToString = (to, from, name) => {
|
|
2192
|
-
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
2193
|
-
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
2194
|
-
Object.defineProperty(newToString, "name", toStringName);
|
|
2195
|
-
const { writable, enumerable, configurable } = toStringDescriptor;
|
|
2196
|
-
Object.defineProperty(to, "toString", { value: newToString, writable, enumerable, configurable });
|
|
2197
|
-
};
|
|
2198
|
-
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
2199
|
-
const { name } = to;
|
|
2200
|
-
for (const property of Reflect.ownKeys(from)) {
|
|
2201
|
-
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
2202
|
-
}
|
|
2203
|
-
changePrototype(to, from);
|
|
2204
|
-
changeToString(to, from, name);
|
|
2205
|
-
return to;
|
|
2206
|
-
}
|
|
2207
|
-
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
2208
|
-
var onetime = (function_, options = {}) => {
|
|
2209
|
-
if (typeof function_ !== "function") {
|
|
2210
|
-
throw new TypeError("Expected a function");
|
|
2211
|
-
}
|
|
2212
|
-
let returnValue;
|
|
2213
|
-
let callCount = 0;
|
|
2214
|
-
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
2215
|
-
const onetime2 = function(...arguments_) {
|
|
2216
|
-
calledFunctions.set(onetime2, ++callCount);
|
|
2217
|
-
if (callCount === 1) {
|
|
2218
|
-
returnValue = function_.apply(this, arguments_);
|
|
2219
|
-
function_ = void 0;
|
|
2220
|
-
} else if (options.throw === true) {
|
|
2221
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
2222
|
-
}
|
|
2223
|
-
return returnValue;
|
|
2224
|
-
};
|
|
2225
|
-
mimicFunction(onetime2, function_);
|
|
2226
|
-
calledFunctions.set(onetime2, callCount);
|
|
2227
|
-
return onetime2;
|
|
2228
|
-
};
|
|
2229
|
-
onetime.callCount = (function_) => {
|
|
2230
|
-
if (!calledFunctions.has(function_)) {
|
|
2231
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
2232
|
-
}
|
|
2233
|
-
return calledFunctions.get(function_);
|
|
2234
|
-
};
|
|
2235
|
-
var onetime_default = onetime;
|
|
2236
|
-
var signals = [];
|
|
2237
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
2238
|
-
if (process.platform !== "win32") {
|
|
2239
|
-
signals.push(
|
|
2240
|
-
"SIGALRM",
|
|
2241
|
-
"SIGABRT",
|
|
2242
|
-
"SIGVTALRM",
|
|
2243
|
-
"SIGXCPU",
|
|
2244
|
-
"SIGXFSZ",
|
|
2245
|
-
"SIGUSR2",
|
|
2246
|
-
"SIGTRAP",
|
|
2247
|
-
"SIGSYS",
|
|
2248
|
-
"SIGQUIT",
|
|
2249
|
-
"SIGIOT"
|
|
2250
|
-
// should detect profiler and enable/disable accordingly.
|
|
2251
|
-
// see #21
|
|
2252
|
-
// 'SIGPROF'
|
|
2253
|
-
);
|
|
2254
|
-
}
|
|
2255
|
-
if (process.platform === "linux") {
|
|
2256
|
-
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
2257
|
-
}
|
|
2258
|
-
var processOk = (process10) => !!process10 && typeof process10 === "object" && typeof process10.removeListener === "function" && typeof process10.emit === "function" && typeof process10.reallyExit === "function" && typeof process10.listeners === "function" && typeof process10.kill === "function" && typeof process10.pid === "number" && typeof process10.on === "function";
|
|
2259
|
-
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
2260
|
-
var global = globalThis;
|
|
2261
|
-
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
2262
|
-
var Emitter = class {
|
|
2263
|
-
constructor() {
|
|
2264
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "emitted", {
|
|
2265
|
-
afterExit: false,
|
|
2266
|
-
exit: false
|
|
2267
|
-
});
|
|
2268
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "listeners", {
|
|
2269
|
-
afterExit: [],
|
|
2270
|
-
exit: []
|
|
2271
|
-
});
|
|
2272
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "count", 0);
|
|
2273
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "id", Math.random());
|
|
2274
|
-
if (global[kExitEmitter]) {
|
|
2275
|
-
return global[kExitEmitter];
|
|
2276
|
-
}
|
|
2277
|
-
ObjectDefineProperty(global, kExitEmitter, {
|
|
2278
|
-
value: this,
|
|
2279
|
-
writable: false,
|
|
2280
|
-
enumerable: false,
|
|
2281
|
-
configurable: false
|
|
2282
|
-
});
|
|
2283
|
-
}
|
|
2284
|
-
on(ev, fn) {
|
|
2285
|
-
this.listeners[ev].push(fn);
|
|
2286
|
-
}
|
|
2287
|
-
removeListener(ev, fn) {
|
|
2288
|
-
const list = this.listeners[ev];
|
|
2289
|
-
const i = list.indexOf(fn);
|
|
2290
|
-
if (i === -1) {
|
|
2291
|
-
return;
|
|
2292
|
-
}
|
|
2293
|
-
if (i === 0 && list.length === 1) {
|
|
2294
|
-
list.length = 0;
|
|
2295
|
-
} else {
|
|
2296
|
-
list.splice(i, 1);
|
|
2297
|
-
}
|
|
2298
|
-
}
|
|
2299
|
-
emit(ev, code, signal) {
|
|
2300
|
-
if (this.emitted[ev]) {
|
|
2301
|
-
return false;
|
|
2302
|
-
}
|
|
2303
|
-
this.emitted[ev] = true;
|
|
2304
|
-
let ret = false;
|
|
2305
|
-
for (const fn of this.listeners[ev]) {
|
|
2306
|
-
ret = fn(code, signal) === true || ret;
|
|
2307
|
-
}
|
|
2308
|
-
if (ev === "exit") {
|
|
2309
|
-
ret = this.emit("afterExit", code, signal) || ret;
|
|
2310
|
-
}
|
|
2311
|
-
return ret;
|
|
2312
|
-
}
|
|
2313
|
-
};
|
|
2314
|
-
var SignalExitBase = class {
|
|
2315
|
-
};
|
|
2316
|
-
var signalExitWrap = (handler) => {
|
|
2317
|
-
return {
|
|
2318
|
-
onExit(cb, opts) {
|
|
2319
|
-
return handler.onExit(cb, opts);
|
|
2320
|
-
},
|
|
2321
|
-
load() {
|
|
2322
|
-
return handler.load();
|
|
2323
|
-
},
|
|
2324
|
-
unload() {
|
|
2325
|
-
return handler.unload();
|
|
2326
|
-
}
|
|
2327
|
-
};
|
|
2328
|
-
};
|
|
2329
|
-
var SignalExitFallback = class extends SignalExitBase {
|
|
2330
|
-
onExit() {
|
|
2331
|
-
return () => {
|
|
2332
|
-
};
|
|
2333
|
-
}
|
|
2334
|
-
load() {
|
|
2335
|
-
}
|
|
2336
|
-
unload() {
|
|
2337
|
-
}
|
|
2338
|
-
};
|
|
2339
|
-
var _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _SignalExit_instances, processReallyExit_fn, processEmit_fn;
|
|
2340
|
-
var SignalExit = class extends SignalExitBase {
|
|
2341
|
-
constructor(process10) {
|
|
2342
|
-
super();
|
|
2343
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _SignalExit_instances);
|
|
2344
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _hupSig, process3.platform === "win32" ? "SIGINT" : "SIGHUP");
|
|
2345
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _emitter, new Emitter());
|
|
2346
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _process);
|
|
2347
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _originalProcessEmit);
|
|
2348
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _originalProcessReallyExit);
|
|
2349
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _sigListeners, {});
|
|
2350
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _loaded, false);
|
|
2351
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _process, process10);
|
|
2352
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _sigListeners, {});
|
|
2353
|
-
for (const sig of signals) {
|
|
2354
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _sigListeners)[sig] = () => {
|
|
2355
|
-
const listeners = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).listeners(sig);
|
|
2356
|
-
let { count } = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter);
|
|
2357
|
-
const p = process10;
|
|
2358
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
2359
|
-
count += p.__signal_exit_emitter__.count;
|
|
2360
|
-
}
|
|
2361
|
-
if (listeners.length === count) {
|
|
2362
|
-
this.unload();
|
|
2363
|
-
const ret = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).emit("exit", null, sig);
|
|
2364
|
-
const s = sig === "SIGHUP" ? (0, import_chunk_WWAWV7DQ.__privateGet)(this, _hupSig) : sig;
|
|
2365
|
-
if (!ret)
|
|
2366
|
-
process10.kill(process10.pid, s);
|
|
2367
|
-
}
|
|
2368
|
-
};
|
|
2369
|
-
}
|
|
2370
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _originalProcessReallyExit, process10.reallyExit);
|
|
2371
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _originalProcessEmit, process10.emit);
|
|
2372
|
-
}
|
|
2373
|
-
onExit(cb, opts) {
|
|
2374
|
-
if (!processOk((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process))) {
|
|
2375
|
-
return () => {
|
|
2376
|
-
};
|
|
2377
|
-
}
|
|
2378
|
-
if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _loaded) === false) {
|
|
2379
|
-
this.load();
|
|
2380
|
-
}
|
|
2381
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
2382
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).on(ev, cb);
|
|
2383
|
-
return () => {
|
|
2384
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).removeListener(ev, cb);
|
|
2385
|
-
if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).listeners["exit"].length === 0 && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).listeners["afterExit"].length === 0) {
|
|
2386
|
-
this.unload();
|
|
2387
|
-
}
|
|
2388
|
-
};
|
|
2389
|
-
}
|
|
2390
|
-
load() {
|
|
2391
|
-
if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _loaded)) {
|
|
2392
|
-
return;
|
|
2393
|
-
}
|
|
2394
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _loaded, true);
|
|
2395
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).count += 1;
|
|
2396
|
-
for (const sig of signals) {
|
|
2397
|
-
try {
|
|
2398
|
-
const fn = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _sigListeners)[sig];
|
|
2399
|
-
if (fn)
|
|
2400
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).on(sig, fn);
|
|
2401
|
-
} catch (_) {
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).emit = (ev, ...a) => {
|
|
2405
|
-
return (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _SignalExit_instances, processEmit_fn).call(this, ev, ...a);
|
|
2406
|
-
};
|
|
2407
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).reallyExit = (code) => {
|
|
2408
|
-
return (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _SignalExit_instances, processReallyExit_fn).call(this, code);
|
|
2409
|
-
};
|
|
2410
|
-
}
|
|
2411
|
-
unload() {
|
|
2412
|
-
if (!(0, import_chunk_WWAWV7DQ.__privateGet)(this, _loaded)) {
|
|
2413
|
-
return;
|
|
2414
|
-
}
|
|
2415
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _loaded, false);
|
|
2416
|
-
signals.forEach((sig) => {
|
|
2417
|
-
const listener = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _sigListeners)[sig];
|
|
2418
|
-
if (!listener) {
|
|
2419
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
2420
|
-
}
|
|
2421
|
-
try {
|
|
2422
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).removeListener(sig, listener);
|
|
2423
|
-
} catch (_) {
|
|
2424
|
-
}
|
|
2425
|
-
});
|
|
2426
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).emit = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _originalProcessEmit);
|
|
2427
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).reallyExit = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _originalProcessReallyExit);
|
|
2428
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).count -= 1;
|
|
2429
|
-
}
|
|
2430
|
-
};
|
|
2431
|
-
_hupSig = /* @__PURE__ */ new WeakMap();
|
|
2432
|
-
_emitter = /* @__PURE__ */ new WeakMap();
|
|
2433
|
-
_process = /* @__PURE__ */ new WeakMap();
|
|
2434
|
-
_originalProcessEmit = /* @__PURE__ */ new WeakMap();
|
|
2435
|
-
_originalProcessReallyExit = /* @__PURE__ */ new WeakMap();
|
|
2436
|
-
_sigListeners = /* @__PURE__ */ new WeakMap();
|
|
2437
|
-
_loaded = /* @__PURE__ */ new WeakMap();
|
|
2438
|
-
_SignalExit_instances = /* @__PURE__ */ new WeakSet();
|
|
2439
|
-
processReallyExit_fn = function(code) {
|
|
2440
|
-
if (!processOk((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process))) {
|
|
2441
|
-
return 0;
|
|
2442
|
-
}
|
|
2443
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).exitCode = code || 0;
|
|
2444
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).emit("exit", (0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).exitCode, null);
|
|
2445
|
-
return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _originalProcessReallyExit).call((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process), (0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).exitCode);
|
|
2446
|
-
};
|
|
2447
|
-
processEmit_fn = function(ev, ...args) {
|
|
2448
|
-
const og = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _originalProcessEmit);
|
|
2449
|
-
if (ev === "exit" && processOk((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process))) {
|
|
2450
|
-
if (typeof args[0] === "number") {
|
|
2451
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).exitCode = args[0];
|
|
2452
|
-
}
|
|
2453
|
-
const ret = og.call((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process), ev, ...args);
|
|
2454
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).emit("exit", (0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).exitCode, null);
|
|
2455
|
-
return ret;
|
|
2456
|
-
} else {
|
|
2457
|
-
return og.call((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process), ev, ...args);
|
|
2458
|
-
}
|
|
2459
|
-
};
|
|
2460
|
-
var process3 = globalThis.process;
|
|
2461
|
-
var {
|
|
2462
|
-
/**
|
|
2463
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
2464
|
-
* exit, or running out of stuff to do.
|
|
2465
|
-
*
|
|
2466
|
-
* If the global process object is not suitable for instrumentation,
|
|
2467
|
-
* then this will be a no-op.
|
|
2468
|
-
*
|
|
2469
|
-
* Returns a function that may be used to unload signal-exit.
|
|
2470
|
-
*/
|
|
2471
|
-
onExit,
|
|
2472
|
-
/**
|
|
2473
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
2474
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
2475
|
-
* Mostly exposed for the benefit of testing.
|
|
2476
|
-
*
|
|
2477
|
-
* @internal
|
|
2478
|
-
*/
|
|
2479
|
-
load,
|
|
2480
|
-
/**
|
|
2481
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
2482
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
2483
|
-
* Mostly exposed for the benefit of testing.
|
|
2484
|
-
*
|
|
2485
|
-
* @internal
|
|
2486
|
-
*/
|
|
2487
|
-
unload
|
|
2488
|
-
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
|
|
2489
|
-
var terminal = import_node_process4.default.stderr.isTTY ? import_node_process4.default.stderr : import_node_process4.default.stdout.isTTY ? import_node_process4.default.stdout : void 0;
|
|
2490
|
-
var restoreCursor = terminal ? onetime_default(() => {
|
|
2491
|
-
onExit(() => {
|
|
2492
|
-
terminal.write("\x1B[?25h");
|
|
2493
|
-
}, { alwaysLast: true });
|
|
2494
|
-
}) : () => {
|
|
2495
|
-
};
|
|
2496
|
-
var restore_cursor_default = restoreCursor;
|
|
2497
|
-
var isHidden = false;
|
|
2498
|
-
var cliCursor = {};
|
|
2499
|
-
cliCursor.show = (writableStream = import_node_process3.default.stderr) => {
|
|
2500
|
-
if (!writableStream.isTTY) {
|
|
2501
|
-
return;
|
|
2502
|
-
}
|
|
2503
|
-
isHidden = false;
|
|
2504
|
-
writableStream.write("\x1B[?25h");
|
|
2505
|
-
};
|
|
2506
|
-
cliCursor.hide = (writableStream = import_node_process3.default.stderr) => {
|
|
2507
|
-
if (!writableStream.isTTY) {
|
|
2508
|
-
return;
|
|
2509
|
-
}
|
|
2510
|
-
restore_cursor_default();
|
|
2511
|
-
isHidden = true;
|
|
2512
|
-
writableStream.write("\x1B[?25l");
|
|
2513
|
-
};
|
|
2514
|
-
cliCursor.toggle = (force, writableStream) => {
|
|
2515
|
-
if (force !== void 0) {
|
|
2516
|
-
isHidden = force;
|
|
2517
|
-
}
|
|
2518
|
-
if (isHidden) {
|
|
2519
|
-
cliCursor.show(writableStream);
|
|
2520
|
-
} else {
|
|
2521
|
-
cliCursor.hide(writableStream);
|
|
2522
|
-
}
|
|
2523
|
-
};
|
|
2524
|
-
var cli_cursor_default = cliCursor;
|
|
2525
|
-
var import_cli_spinners = (0, import_chunk_WWAWV7DQ.__toESM)(require_cli_spinners(), 1);
|
|
2162
|
+
var import_cli_spinners = (0, import_chunk_2ESYSVXG.__toESM)(require_cli_spinners(), 1);
|
|
2526
2163
|
function isUnicodeSupported() {
|
|
2527
|
-
if (
|
|
2528
|
-
return
|
|
2164
|
+
if (import_node_process3.default.platform !== "win32") {
|
|
2165
|
+
return import_node_process3.default.env.TERM !== "linux";
|
|
2529
2166
|
}
|
|
2530
|
-
return Boolean(
|
|
2167
|
+
return Boolean(import_node_process3.default.env.CI) || Boolean(import_node_process3.default.env.WT_SESSION) || Boolean(import_node_process3.default.env.TERMINUS_SUBLIME) || import_node_process3.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process3.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process3.default.env.TERM_PROGRAM === "vscode" || import_node_process3.default.env.TERM === "xterm-256color" || import_node_process3.default.env.TERM === "alacritty" || import_node_process3.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2531
2168
|
}
|
|
2532
2169
|
var main = {
|
|
2533
2170
|
info: source_default.blue("\u2139"),
|
|
@@ -2543,348 +2180,283 @@ var fallback = {
|
|
|
2543
2180
|
};
|
|
2544
2181
|
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
2545
2182
|
var log_symbols_default = logSymbols;
|
|
2546
|
-
function ansiRegex({ onlyFirst = false } = {}) {
|
|
2547
|
-
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
2548
|
-
const pattern = [
|
|
2549
|
-
`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
|
|
2550
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
|
|
2551
|
-
].join("|");
|
|
2552
|
-
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
2553
|
-
}
|
|
2554
|
-
var regex = ansiRegex();
|
|
2555
|
-
function stripAnsi(string) {
|
|
2556
|
-
if (typeof string !== "string") {
|
|
2557
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
2558
|
-
}
|
|
2559
|
-
return string.replace(regex, "");
|
|
2560
|
-
}
|
|
2561
|
-
function isAmbiguous(x) {
|
|
2562
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
2563
|
-
}
|
|
2564
|
-
function isFullWidth(x) {
|
|
2565
|
-
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
2566
|
-
}
|
|
2567
|
-
function isWide(x) {
|
|
2568
|
-
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
2569
|
-
}
|
|
2570
|
-
function validate(codePoint) {
|
|
2571
|
-
if (!Number.isSafeInteger(codePoint)) {
|
|
2572
|
-
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
2576
|
-
validate(codePoint);
|
|
2577
|
-
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
2578
|
-
return 2;
|
|
2579
|
-
}
|
|
2580
|
-
return 1;
|
|
2581
|
-
}
|
|
2582
|
-
var emoji_regex_default = () => {
|
|
2583
|
-
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
2584
|
-
};
|
|
2585
|
-
var segmenter = new Intl.Segmenter();
|
|
2586
|
-
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
2587
|
-
function stringWidth(string, options = {}) {
|
|
2588
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
2589
|
-
return 0;
|
|
2590
|
-
}
|
|
2591
|
-
const {
|
|
2592
|
-
ambiguousIsNarrow = true,
|
|
2593
|
-
countAnsiEscapeCodes = false
|
|
2594
|
-
} = options;
|
|
2595
|
-
if (!countAnsiEscapeCodes) {
|
|
2596
|
-
string = stripAnsi(string);
|
|
2597
|
-
}
|
|
2598
|
-
if (string.length === 0) {
|
|
2599
|
-
return 0;
|
|
2600
|
-
}
|
|
2601
|
-
let width = 0;
|
|
2602
|
-
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
2603
|
-
for (const { segment: character } of segmenter.segment(string)) {
|
|
2604
|
-
const codePoint = character.codePointAt(0);
|
|
2605
|
-
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
2606
|
-
continue;
|
|
2607
|
-
}
|
|
2608
|
-
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
2609
|
-
continue;
|
|
2610
|
-
}
|
|
2611
|
-
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
2612
|
-
continue;
|
|
2613
|
-
}
|
|
2614
|
-
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
2615
|
-
continue;
|
|
2616
|
-
}
|
|
2617
|
-
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
2618
|
-
continue;
|
|
2619
|
-
}
|
|
2620
|
-
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
2621
|
-
continue;
|
|
2622
|
-
}
|
|
2623
|
-
if (emoji_regex_default().test(character)) {
|
|
2624
|
-
width += 2;
|
|
2625
|
-
continue;
|
|
2626
|
-
}
|
|
2627
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
2628
|
-
}
|
|
2629
|
-
return width;
|
|
2630
|
-
}
|
|
2631
2183
|
function isInteractive({ stream = process.stdout } = {}) {
|
|
2632
2184
|
return Boolean(
|
|
2633
2185
|
stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env)
|
|
2634
2186
|
);
|
|
2635
2187
|
}
|
|
2636
2188
|
function isUnicodeSupported2() {
|
|
2637
|
-
const { env: env2 } =
|
|
2189
|
+
const { env: env2 } = import_node_process4.default;
|
|
2638
2190
|
const { TERM, TERM_PROGRAM } = env2;
|
|
2639
|
-
if (
|
|
2191
|
+
if (import_node_process4.default.platform !== "win32") {
|
|
2640
2192
|
return TERM !== "linux";
|
|
2641
2193
|
}
|
|
2642
2194
|
return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2643
2195
|
}
|
|
2644
2196
|
var ASCII_ETX_CODE = 3;
|
|
2645
|
-
var _activeCount, _StdinDiscarder_instances, realStart_fn, realStop_fn, handleInput_fn;
|
|
2646
2197
|
var StdinDiscarder = class {
|
|
2647
|
-
|
|
2648
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _StdinDiscarder_instances);
|
|
2649
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _activeCount, 0);
|
|
2650
|
-
}
|
|
2198
|
+
#activeCount = 0;
|
|
2651
2199
|
start() {
|
|
2652
|
-
|
|
2653
|
-
if (
|
|
2654
|
-
|
|
2200
|
+
this.#activeCount++;
|
|
2201
|
+
if (this.#activeCount === 1) {
|
|
2202
|
+
this.#realStart();
|
|
2655
2203
|
}
|
|
2656
2204
|
}
|
|
2657
2205
|
stop() {
|
|
2658
|
-
if (
|
|
2206
|
+
if (this.#activeCount <= 0) {
|
|
2659
2207
|
throw new Error("`stop` called more times than `start`");
|
|
2660
2208
|
}
|
|
2661
|
-
|
|
2662
|
-
if (
|
|
2663
|
-
|
|
2209
|
+
this.#activeCount--;
|
|
2210
|
+
if (this.#activeCount === 0) {
|
|
2211
|
+
this.#realStop();
|
|
2664
2212
|
}
|
|
2665
2213
|
}
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
import_node_process7.default.stdin.setRawMode(true);
|
|
2674
|
-
import_node_process7.default.stdin.on("data", (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _StdinDiscarder_instances, handleInput_fn));
|
|
2675
|
-
import_node_process7.default.stdin.resume();
|
|
2676
|
-
};
|
|
2677
|
-
realStop_fn = function() {
|
|
2678
|
-
if (!import_node_process7.default.stdin.isTTY) {
|
|
2679
|
-
return;
|
|
2214
|
+
#realStart() {
|
|
2215
|
+
if (import_node_process5.default.platform === "win32" || !import_node_process5.default.stdin.isTTY) {
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
import_node_process5.default.stdin.setRawMode(true);
|
|
2219
|
+
import_node_process5.default.stdin.on("data", this.#handleInput);
|
|
2220
|
+
import_node_process5.default.stdin.resume();
|
|
2680
2221
|
}
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2222
|
+
#realStop() {
|
|
2223
|
+
if (!import_node_process5.default.stdin.isTTY) {
|
|
2224
|
+
return;
|
|
2225
|
+
}
|
|
2226
|
+
import_node_process5.default.stdin.off("data", this.#handleInput);
|
|
2227
|
+
import_node_process5.default.stdin.pause();
|
|
2228
|
+
import_node_process5.default.stdin.setRawMode(false);
|
|
2229
|
+
}
|
|
2230
|
+
#handleInput(chunk) {
|
|
2231
|
+
if (chunk[0] === ASCII_ETX_CODE) {
|
|
2232
|
+
import_node_process5.default.emit("SIGINT");
|
|
2233
|
+
}
|
|
2688
2234
|
}
|
|
2689
2235
|
};
|
|
2690
2236
|
var stdinDiscarder = new StdinDiscarder();
|
|
2691
2237
|
var stdin_discarder_default = stdinDiscarder;
|
|
2692
|
-
var import_cli_spinners2 = (0,
|
|
2693
|
-
var _linesToClear, _isDiscardingStdin, _lineCount, _frameIndex, _lastSpinnerFrameTime, _options, _spinner, _stream, _id, _initialInterval, _isEnabled, _isSilent, _indent, _text, _prefixText, _suffixText, _Ora_instances, getFullPrefixText_fn, getFullSuffixText_fn, updateLineCount_fn;
|
|
2238
|
+
var import_cli_spinners2 = (0, import_chunk_2ESYSVXG.__toESM)(require_cli_spinners(), 1);
|
|
2694
2239
|
var Ora = class {
|
|
2240
|
+
#linesToClear = 0;
|
|
2241
|
+
#isDiscardingStdin = false;
|
|
2242
|
+
#lineCount = 0;
|
|
2243
|
+
#frameIndex = -1;
|
|
2244
|
+
#lastSpinnerFrameTime = 0;
|
|
2245
|
+
#options;
|
|
2246
|
+
#spinner;
|
|
2247
|
+
#stream;
|
|
2248
|
+
#id;
|
|
2249
|
+
#initialInterval;
|
|
2250
|
+
#isEnabled;
|
|
2251
|
+
#isSilent;
|
|
2252
|
+
#indent;
|
|
2253
|
+
#text;
|
|
2254
|
+
#prefixText;
|
|
2255
|
+
#suffixText;
|
|
2256
|
+
color;
|
|
2695
2257
|
constructor(options) {
|
|
2696
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _Ora_instances);
|
|
2697
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _linesToClear, 0);
|
|
2698
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _isDiscardingStdin, false);
|
|
2699
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _lineCount, 0);
|
|
2700
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _frameIndex, -1);
|
|
2701
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _lastSpinnerFrameTime, 0);
|
|
2702
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _options);
|
|
2703
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _spinner);
|
|
2704
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _stream);
|
|
2705
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _id);
|
|
2706
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _initialInterval);
|
|
2707
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _isEnabled);
|
|
2708
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _isSilent);
|
|
2709
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _indent);
|
|
2710
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _text);
|
|
2711
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _prefixText);
|
|
2712
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _suffixText);
|
|
2713
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "color");
|
|
2714
2258
|
if (typeof options === "string") {
|
|
2715
2259
|
options = {
|
|
2716
2260
|
text: options
|
|
2717
2261
|
};
|
|
2718
2262
|
}
|
|
2719
|
-
|
|
2263
|
+
this.#options = {
|
|
2720
2264
|
color: "cyan",
|
|
2721
2265
|
stream: import_node_process.default.stderr,
|
|
2722
2266
|
discardStdin: true,
|
|
2723
2267
|
hideCursor: true,
|
|
2724
2268
|
...options
|
|
2725
|
-
}
|
|
2726
|
-
this.color =
|
|
2727
|
-
this.spinner =
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
this.text =
|
|
2733
|
-
this.prefixText =
|
|
2734
|
-
this.suffixText =
|
|
2735
|
-
this.indent =
|
|
2269
|
+
};
|
|
2270
|
+
this.color = this.#options.color;
|
|
2271
|
+
this.spinner = this.#options.spinner;
|
|
2272
|
+
this.#initialInterval = this.#options.interval;
|
|
2273
|
+
this.#stream = this.#options.stream;
|
|
2274
|
+
this.#isEnabled = typeof this.#options.isEnabled === "boolean" ? this.#options.isEnabled : isInteractive({ stream: this.#stream });
|
|
2275
|
+
this.#isSilent = typeof this.#options.isSilent === "boolean" ? this.#options.isSilent : false;
|
|
2276
|
+
this.text = this.#options.text;
|
|
2277
|
+
this.prefixText = this.#options.prefixText;
|
|
2278
|
+
this.suffixText = this.#options.suffixText;
|
|
2279
|
+
this.indent = this.#options.indent;
|
|
2736
2280
|
if (import_node_process.default.env.NODE_ENV === "test") {
|
|
2737
|
-
this._stream =
|
|
2738
|
-
this._isEnabled =
|
|
2281
|
+
this._stream = this.#stream;
|
|
2282
|
+
this._isEnabled = this.#isEnabled;
|
|
2739
2283
|
Object.defineProperty(this, "_linesToClear", {
|
|
2740
2284
|
get() {
|
|
2741
|
-
return
|
|
2285
|
+
return this.#linesToClear;
|
|
2742
2286
|
},
|
|
2743
2287
|
set(newValue) {
|
|
2744
|
-
|
|
2288
|
+
this.#linesToClear = newValue;
|
|
2745
2289
|
}
|
|
2746
2290
|
});
|
|
2747
2291
|
Object.defineProperty(this, "_frameIndex", {
|
|
2748
2292
|
get() {
|
|
2749
|
-
return
|
|
2293
|
+
return this.#frameIndex;
|
|
2750
2294
|
}
|
|
2751
2295
|
});
|
|
2752
2296
|
Object.defineProperty(this, "_lineCount", {
|
|
2753
2297
|
get() {
|
|
2754
|
-
return
|
|
2298
|
+
return this.#lineCount;
|
|
2755
2299
|
}
|
|
2756
2300
|
});
|
|
2757
2301
|
}
|
|
2758
2302
|
}
|
|
2759
2303
|
get indent() {
|
|
2760
|
-
return
|
|
2304
|
+
return this.#indent;
|
|
2761
2305
|
}
|
|
2762
2306
|
set indent(indent = 0) {
|
|
2763
2307
|
if (!(indent >= 0 && Number.isInteger(indent))) {
|
|
2764
2308
|
throw new Error("The `indent` option must be an integer from 0 and up");
|
|
2765
2309
|
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2310
|
+
this.#indent = indent;
|
|
2311
|
+
this.#updateLineCount();
|
|
2768
2312
|
}
|
|
2769
2313
|
get interval() {
|
|
2770
|
-
return
|
|
2314
|
+
return this.#initialInterval ?? this.#spinner.interval ?? 100;
|
|
2771
2315
|
}
|
|
2772
2316
|
get spinner() {
|
|
2773
|
-
return
|
|
2317
|
+
return this.#spinner;
|
|
2774
2318
|
}
|
|
2775
2319
|
set spinner(spinner) {
|
|
2776
|
-
|
|
2777
|
-
|
|
2320
|
+
this.#frameIndex = -1;
|
|
2321
|
+
this.#initialInterval = void 0;
|
|
2778
2322
|
if (typeof spinner === "object") {
|
|
2779
2323
|
if (spinner.frames === void 0) {
|
|
2780
2324
|
throw new Error("The given spinner must have a `frames` property");
|
|
2781
2325
|
}
|
|
2782
|
-
|
|
2326
|
+
this.#spinner = spinner;
|
|
2783
2327
|
} else if (!isUnicodeSupported2()) {
|
|
2784
|
-
|
|
2328
|
+
this.#spinner = import_cli_spinners.default.line;
|
|
2785
2329
|
} else if (spinner === void 0) {
|
|
2786
|
-
|
|
2330
|
+
this.#spinner = import_cli_spinners.default.dots;
|
|
2787
2331
|
} else if (spinner !== "default" && import_cli_spinners.default[spinner]) {
|
|
2788
|
-
|
|
2332
|
+
this.#spinner = import_cli_spinners.default[spinner];
|
|
2789
2333
|
} else {
|
|
2790
2334
|
throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);
|
|
2791
2335
|
}
|
|
2792
2336
|
}
|
|
2793
2337
|
get text() {
|
|
2794
|
-
return
|
|
2338
|
+
return this.#text;
|
|
2795
2339
|
}
|
|
2796
2340
|
set text(value = "") {
|
|
2797
|
-
|
|
2798
|
-
|
|
2341
|
+
this.#text = value;
|
|
2342
|
+
this.#updateLineCount();
|
|
2799
2343
|
}
|
|
2800
2344
|
get prefixText() {
|
|
2801
|
-
return
|
|
2345
|
+
return this.#prefixText;
|
|
2802
2346
|
}
|
|
2803
2347
|
set prefixText(value = "") {
|
|
2804
|
-
|
|
2805
|
-
|
|
2348
|
+
this.#prefixText = value;
|
|
2349
|
+
this.#updateLineCount();
|
|
2806
2350
|
}
|
|
2807
2351
|
get suffixText() {
|
|
2808
|
-
return
|
|
2352
|
+
return this.#suffixText;
|
|
2809
2353
|
}
|
|
2810
2354
|
set suffixText(value = "") {
|
|
2811
|
-
|
|
2812
|
-
|
|
2355
|
+
this.#suffixText = value;
|
|
2356
|
+
this.#updateLineCount();
|
|
2813
2357
|
}
|
|
2814
2358
|
get isSpinning() {
|
|
2815
|
-
return
|
|
2359
|
+
return this.#id !== void 0;
|
|
2360
|
+
}
|
|
2361
|
+
#getFullPrefixText(prefixText = this.#prefixText, postfix = " ") {
|
|
2362
|
+
if (typeof prefixText === "string" && prefixText !== "") {
|
|
2363
|
+
return prefixText + postfix;
|
|
2364
|
+
}
|
|
2365
|
+
if (typeof prefixText === "function") {
|
|
2366
|
+
return prefixText() + postfix;
|
|
2367
|
+
}
|
|
2368
|
+
return "";
|
|
2369
|
+
}
|
|
2370
|
+
#getFullSuffixText(suffixText = this.#suffixText, prefix = " ") {
|
|
2371
|
+
if (typeof suffixText === "string" && suffixText !== "") {
|
|
2372
|
+
return prefix + suffixText;
|
|
2373
|
+
}
|
|
2374
|
+
if (typeof suffixText === "function") {
|
|
2375
|
+
return prefix + suffixText();
|
|
2376
|
+
}
|
|
2377
|
+
return "";
|
|
2378
|
+
}
|
|
2379
|
+
#updateLineCount() {
|
|
2380
|
+
const columns = this.#stream.columns ?? 80;
|
|
2381
|
+
const fullPrefixText = this.#getFullPrefixText(this.#prefixText, "-");
|
|
2382
|
+
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, "-");
|
|
2383
|
+
const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText;
|
|
2384
|
+
this.#lineCount = 0;
|
|
2385
|
+
for (const line of (0, import_chunk_URKH6SE2.stripAnsi)(fullText).split("\n")) {
|
|
2386
|
+
this.#lineCount += Math.max(1, Math.ceil((0, import_chunk_URKH6SE2.stringWidth)(line, { countAnsiEscapeCodes: true }) / columns));
|
|
2387
|
+
}
|
|
2816
2388
|
}
|
|
2817
2389
|
get isEnabled() {
|
|
2818
|
-
return
|
|
2390
|
+
return this.#isEnabled && !this.#isSilent;
|
|
2819
2391
|
}
|
|
2820
2392
|
set isEnabled(value) {
|
|
2821
2393
|
if (typeof value !== "boolean") {
|
|
2822
2394
|
throw new TypeError("The `isEnabled` option must be a boolean");
|
|
2823
2395
|
}
|
|
2824
|
-
|
|
2396
|
+
this.#isEnabled = value;
|
|
2825
2397
|
}
|
|
2826
2398
|
get isSilent() {
|
|
2827
|
-
return
|
|
2399
|
+
return this.#isSilent;
|
|
2828
2400
|
}
|
|
2829
2401
|
set isSilent(value) {
|
|
2830
2402
|
if (typeof value !== "boolean") {
|
|
2831
2403
|
throw new TypeError("The `isSilent` option must be a boolean");
|
|
2832
2404
|
}
|
|
2833
|
-
|
|
2405
|
+
this.#isSilent = value;
|
|
2834
2406
|
}
|
|
2835
2407
|
frame() {
|
|
2836
2408
|
const now = Date.now();
|
|
2837
|
-
if (
|
|
2838
|
-
|
|
2839
|
-
|
|
2409
|
+
if (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {
|
|
2410
|
+
this.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;
|
|
2411
|
+
this.#lastSpinnerFrameTime = now;
|
|
2840
2412
|
}
|
|
2841
|
-
const { frames } =
|
|
2842
|
-
let frame = frames[
|
|
2413
|
+
const { frames } = this.#spinner;
|
|
2414
|
+
let frame = frames[this.#frameIndex];
|
|
2843
2415
|
if (this.color) {
|
|
2844
2416
|
frame = source_default[this.color](frame);
|
|
2845
2417
|
}
|
|
2846
|
-
const fullPrefixText = typeof
|
|
2418
|
+
const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : "";
|
|
2847
2419
|
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
2848
|
-
const fullSuffixText = typeof
|
|
2420
|
+
const fullSuffixText = typeof this.#suffixText === "string" && this.#suffixText !== "" ? " " + this.#suffixText : "";
|
|
2849
2421
|
return fullPrefixText + frame + fullText + fullSuffixText;
|
|
2850
2422
|
}
|
|
2851
2423
|
clear() {
|
|
2852
|
-
if (!
|
|
2424
|
+
if (!this.#isEnabled || !this.#stream.isTTY) {
|
|
2853
2425
|
return this;
|
|
2854
2426
|
}
|
|
2855
|
-
|
|
2856
|
-
for (let index = 0; index <
|
|
2427
|
+
this.#stream.cursorTo(0);
|
|
2428
|
+
for (let index = 0; index < this.#linesToClear; index++) {
|
|
2857
2429
|
if (index > 0) {
|
|
2858
|
-
|
|
2430
|
+
this.#stream.moveCursor(0, -1);
|
|
2859
2431
|
}
|
|
2860
|
-
|
|
2432
|
+
this.#stream.clearLine(1);
|
|
2861
2433
|
}
|
|
2862
|
-
if (
|
|
2863
|
-
|
|
2434
|
+
if (this.#indent || this.lastIndent !== this.#indent) {
|
|
2435
|
+
this.#stream.cursorTo(this.#indent);
|
|
2864
2436
|
}
|
|
2865
|
-
this.lastIndent =
|
|
2866
|
-
|
|
2437
|
+
this.lastIndent = this.#indent;
|
|
2438
|
+
this.#linesToClear = 0;
|
|
2867
2439
|
return this;
|
|
2868
2440
|
}
|
|
2869
2441
|
render() {
|
|
2870
|
-
if (
|
|
2442
|
+
if (this.#isSilent) {
|
|
2871
2443
|
return this;
|
|
2872
2444
|
}
|
|
2873
2445
|
this.clear();
|
|
2874
|
-
|
|
2875
|
-
|
|
2446
|
+
this.#stream.write(this.frame());
|
|
2447
|
+
this.#linesToClear = this.#lineCount;
|
|
2876
2448
|
return this;
|
|
2877
2449
|
}
|
|
2878
2450
|
start(text) {
|
|
2879
2451
|
if (text) {
|
|
2880
2452
|
this.text = text;
|
|
2881
2453
|
}
|
|
2882
|
-
if (
|
|
2454
|
+
if (this.#isSilent) {
|
|
2883
2455
|
return this;
|
|
2884
2456
|
}
|
|
2885
|
-
if (!
|
|
2457
|
+
if (!this.#isEnabled) {
|
|
2886
2458
|
if (this.text) {
|
|
2887
|
-
|
|
2459
|
+
this.#stream.write(`- ${this.text}
|
|
2888
2460
|
`);
|
|
2889
2461
|
}
|
|
2890
2462
|
return this;
|
|
@@ -2892,31 +2464,31 @@ var Ora = class {
|
|
|
2892
2464
|
if (this.isSpinning) {
|
|
2893
2465
|
return this;
|
|
2894
2466
|
}
|
|
2895
|
-
if (
|
|
2896
|
-
cli_cursor_default.hide(
|
|
2467
|
+
if (this.#options.hideCursor) {
|
|
2468
|
+
import_chunk_URKH6SE2.cli_cursor_default.hide(this.#stream);
|
|
2897
2469
|
}
|
|
2898
|
-
if (
|
|
2899
|
-
|
|
2470
|
+
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY) {
|
|
2471
|
+
this.#isDiscardingStdin = true;
|
|
2900
2472
|
stdin_discarder_default.start();
|
|
2901
2473
|
}
|
|
2902
2474
|
this.render();
|
|
2903
|
-
|
|
2475
|
+
this.#id = setInterval(this.render.bind(this), this.interval);
|
|
2904
2476
|
return this;
|
|
2905
2477
|
}
|
|
2906
2478
|
stop() {
|
|
2907
|
-
if (!
|
|
2479
|
+
if (!this.#isEnabled) {
|
|
2908
2480
|
return this;
|
|
2909
2481
|
}
|
|
2910
|
-
clearInterval(
|
|
2911
|
-
|
|
2912
|
-
|
|
2482
|
+
clearInterval(this.#id);
|
|
2483
|
+
this.#id = void 0;
|
|
2484
|
+
this.#frameIndex = 0;
|
|
2913
2485
|
this.clear();
|
|
2914
|
-
if (
|
|
2915
|
-
cli_cursor_default.show(
|
|
2486
|
+
if (this.#options.hideCursor) {
|
|
2487
|
+
import_chunk_URKH6SE2.cli_cursor_default.show(this.#stream);
|
|
2916
2488
|
}
|
|
2917
|
-
if (
|
|
2489
|
+
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY && this.#isDiscardingStdin) {
|
|
2918
2490
|
stdin_discarder_default.stop();
|
|
2919
|
-
|
|
2491
|
+
this.#isDiscardingStdin = false;
|
|
2920
2492
|
}
|
|
2921
2493
|
return this;
|
|
2922
2494
|
}
|
|
@@ -2933,68 +2505,23 @@ var Ora = class {
|
|
|
2933
2505
|
return this.stopAndPersist({ symbol: log_symbols_default.info, text });
|
|
2934
2506
|
}
|
|
2935
2507
|
stopAndPersist(options = {}) {
|
|
2936
|
-
if (
|
|
2508
|
+
if (this.#isSilent) {
|
|
2937
2509
|
return this;
|
|
2938
2510
|
}
|
|
2939
|
-
const prefixText = options.prefixText ??
|
|
2940
|
-
const fullPrefixText =
|
|
2511
|
+
const prefixText = options.prefixText ?? this.#prefixText;
|
|
2512
|
+
const fullPrefixText = this.#getFullPrefixText(prefixText, " ");
|
|
2941
2513
|
const symbolText = options.symbol ?? " ";
|
|
2942
2514
|
const text = options.text ?? this.text;
|
|
2943
2515
|
const separatorText = symbolText ? " " : "";
|
|
2944
2516
|
const fullText = typeof text === "string" ? separatorText + text : "";
|
|
2945
|
-
const suffixText = options.suffixText ??
|
|
2946
|
-
const fullSuffixText =
|
|
2517
|
+
const suffixText = options.suffixText ?? this.#suffixText;
|
|
2518
|
+
const fullSuffixText = this.#getFullSuffixText(suffixText, " ");
|
|
2947
2519
|
const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + "\n";
|
|
2948
2520
|
this.stop();
|
|
2949
|
-
|
|
2521
|
+
this.#stream.write(textToWrite);
|
|
2950
2522
|
return this;
|
|
2951
2523
|
}
|
|
2952
2524
|
};
|
|
2953
|
-
_linesToClear = /* @__PURE__ */ new WeakMap();
|
|
2954
|
-
_isDiscardingStdin = /* @__PURE__ */ new WeakMap();
|
|
2955
|
-
_lineCount = /* @__PURE__ */ new WeakMap();
|
|
2956
|
-
_frameIndex = /* @__PURE__ */ new WeakMap();
|
|
2957
|
-
_lastSpinnerFrameTime = /* @__PURE__ */ new WeakMap();
|
|
2958
|
-
_options = /* @__PURE__ */ new WeakMap();
|
|
2959
|
-
_spinner = /* @__PURE__ */ new WeakMap();
|
|
2960
|
-
_stream = /* @__PURE__ */ new WeakMap();
|
|
2961
|
-
_id = /* @__PURE__ */ new WeakMap();
|
|
2962
|
-
_initialInterval = /* @__PURE__ */ new WeakMap();
|
|
2963
|
-
_isEnabled = /* @__PURE__ */ new WeakMap();
|
|
2964
|
-
_isSilent = /* @__PURE__ */ new WeakMap();
|
|
2965
|
-
_indent = /* @__PURE__ */ new WeakMap();
|
|
2966
|
-
_text = /* @__PURE__ */ new WeakMap();
|
|
2967
|
-
_prefixText = /* @__PURE__ */ new WeakMap();
|
|
2968
|
-
_suffixText = /* @__PURE__ */ new WeakMap();
|
|
2969
|
-
_Ora_instances = /* @__PURE__ */ new WeakSet();
|
|
2970
|
-
getFullPrefixText_fn = function(prefixText = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prefixText), postfix = " ") {
|
|
2971
|
-
if (typeof prefixText === "string" && prefixText !== "") {
|
|
2972
|
-
return prefixText + postfix;
|
|
2973
|
-
}
|
|
2974
|
-
if (typeof prefixText === "function") {
|
|
2975
|
-
return prefixText() + postfix;
|
|
2976
|
-
}
|
|
2977
|
-
return "";
|
|
2978
|
-
};
|
|
2979
|
-
getFullSuffixText_fn = function(suffixText = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _suffixText), prefix = " ") {
|
|
2980
|
-
if (typeof suffixText === "string" && suffixText !== "") {
|
|
2981
|
-
return prefix + suffixText;
|
|
2982
|
-
}
|
|
2983
|
-
if (typeof suffixText === "function") {
|
|
2984
|
-
return prefix + suffixText();
|
|
2985
|
-
}
|
|
2986
|
-
return "";
|
|
2987
|
-
};
|
|
2988
|
-
updateLineCount_fn = function() {
|
|
2989
|
-
const columns = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _stream).columns ?? 80;
|
|
2990
|
-
const fullPrefixText = (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _Ora_instances, getFullPrefixText_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prefixText), "-");
|
|
2991
|
-
const fullSuffixText = (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _Ora_instances, getFullSuffixText_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _suffixText), "-");
|
|
2992
|
-
const fullText = " ".repeat((0, import_chunk_WWAWV7DQ.__privateGet)(this, _indent)) + fullPrefixText + "--" + (0, import_chunk_WWAWV7DQ.__privateGet)(this, _text) + "--" + fullSuffixText;
|
|
2993
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _lineCount, 0);
|
|
2994
|
-
for (const line of stripAnsi(fullText).split("\n")) {
|
|
2995
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _lineCount, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _lineCount) + Math.max(1, Math.ceil(stringWidth(line, { countAnsiEscapeCodes: true }) / columns)));
|
|
2996
|
-
}
|
|
2997
|
-
};
|
|
2998
2525
|
function ora(options) {
|
|
2999
2526
|
return new Ora(options);
|
|
3000
2527
|
}
|