ccusage 18.0.2 → 18.0.3
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/{data-loader-DpmcwQJo.js → data-loader-DcHYMoHv.js} +1977 -85
- package/dist/data-loader.js +2 -2
- package/dist/{debug-CCOfmDX-.js → debug-B95zJbM3.js} +2 -2
- package/dist/debug.js +3 -3
- package/dist/index.js +89 -1980
- package/dist/{logger-CZDKWAOd.js → logger-CKyYzFzc.js} +1 -1
- package/dist/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as object, C as boolean, F as string, M as parse$2, P as safeParse, R as union, S as array, _ as requestIdSchema, a as createDailyDate, b as versionSchema, c as createSessionId, f as isoTimestampSchema, g as projectPathSchema, h as monthlyDateSchema, i as createBucket, j as optional, k as number, l as createWeeklyDate, m as modelNameSchema, o as createMonthlyDate, p as messageIdSchema, r as activityDateSchema, s as createProjectPath, u as dailyDateSchema, v as sessionIdSchema, x as weeklyDateSchema, z as getTotalTokens } from "./_types-BFL_bTNX.js";
|
|
2
|
-
import { n as logger } from "./logger-
|
|
2
|
+
import { n as logger } from "./logger-CKyYzFzc.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as nativeFs from "node:fs";
|
|
5
5
|
import b, { createReadStream } from "node:fs";
|
|
@@ -97,7 +97,7 @@ const inspectError = (fn) => (result) => {
|
|
|
97
97
|
return isPromise(result) ? result.then(apply) : apply(result);
|
|
98
98
|
};
|
|
99
99
|
const isResult = (result) => "object" == typeof result && null !== result && "type" in result && ("Success" === result.type && "value" in result || "Failure" === result.type && "error" in result);
|
|
100
|
-
const map = (fn) => (result) => {
|
|
100
|
+
const map$1 = (fn) => (result) => {
|
|
101
101
|
const apply = (r) => {
|
|
102
102
|
if (isFailure(r)) return r;
|
|
103
103
|
return succeed(fn(r.value));
|
|
@@ -267,10 +267,10 @@ var l = class {
|
|
|
267
267
|
};
|
|
268
268
|
const w = n((s, t, r) => {
|
|
269
269
|
const i = [];
|
|
270
|
-
for (const p in s) {
|
|
271
|
-
if (!Object.hasOwn(s, p)) continue;
|
|
272
|
-
const e = path.join(t, p);
|
|
273
|
-
let o = s[p];
|
|
270
|
+
for (const p$1 in s) {
|
|
271
|
+
if (!Object.hasOwn(s, p$1)) continue;
|
|
272
|
+
const e = path.join(t, p$1);
|
|
273
|
+
let o = s[p$1];
|
|
274
274
|
if (typeof o == "function") {
|
|
275
275
|
const g = Object.assign(Object.create(r), { filePath: e }), h = o(g);
|
|
276
276
|
if (h instanceof l) {
|
|
@@ -290,12 +290,12 @@ n(async (s, t) => {
|
|
|
290
290
|
filter: t?.templateFilter
|
|
291
291
|
});
|
|
292
292
|
else if (typeof s == "object") {
|
|
293
|
-
const p = {
|
|
293
|
+
const p$1 = {
|
|
294
294
|
fixturePath: i,
|
|
295
295
|
getPath: n((...e) => path.join(i, ...e), "getPath"),
|
|
296
296
|
symlink: n((e, o) => new l(e, o), "symlink")
|
|
297
297
|
};
|
|
298
|
-
await Promise.all(w(s, i, p).map(async (e) => {
|
|
298
|
+
await Promise.all(w(s, i, p$1).map(async (e) => {
|
|
299
299
|
e instanceof f$1 ? await a.mkdir(e.path, { recursive: !0 }) : e instanceof l ? (await a.mkdir(path.dirname(e.path), { recursive: !0 }), await a.symlink(e.target, e.path, e.type)) : e instanceof y && (await a.mkdir(path.dirname(e.path), { recursive: !0 }), await a.writeFile(e.path, e.content));
|
|
300
300
|
}));
|
|
301
301
|
}
|
|
@@ -540,7 +540,7 @@ const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) =>
|
|
|
540
540
|
}
|
|
541
541
|
callback$1(entries, directoryPath, currentDepth);
|
|
542
542
|
};
|
|
543
|
-
function build(isSynchronous) {
|
|
543
|
+
function build$8(isSynchronous) {
|
|
544
544
|
return isSynchronous ? walkSync : walkAsync;
|
|
545
545
|
}
|
|
546
546
|
var Queue = class {
|
|
@@ -622,7 +622,7 @@ var Walker = class {
|
|
|
622
622
|
this.getArray = build$4(options);
|
|
623
623
|
this.groupFiles = build$3(options);
|
|
624
624
|
this.resolveSymlink = build$2(options, this.isSynchronous);
|
|
625
|
-
this.walkDirectory = build(this.isSynchronous);
|
|
625
|
+
this.walkDirectory = build$8(this.isSynchronous);
|
|
626
626
|
}
|
|
627
627
|
start() {
|
|
628
628
|
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
|
|
@@ -965,7 +965,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
965
965
|
}
|
|
966
966
|
};
|
|
967
967
|
}));
|
|
968
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
968
|
+
var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
969
969
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
970
970
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
971
971
|
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
@@ -1012,7 +1012,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1012
1012
|
};
|
|
1013
1013
|
}));
|
|
1014
1014
|
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1015
|
-
const utils$
|
|
1015
|
+
const utils$5 = require_utils$1();
|
|
1016
1016
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
1017
1017
|
const isPathSeparator = (code) => {
|
|
1018
1018
|
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
@@ -1225,8 +1225,8 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1225
1225
|
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
1226
1226
|
}
|
|
1227
1227
|
if (opts.unescape === true) {
|
|
1228
|
-
if (glob$1) glob$1 = utils$
|
|
1229
|
-
if (base && backslashes === true) base = utils$
|
|
1228
|
+
if (glob$1) glob$1 = utils$5.removeBackslashes(glob$1);
|
|
1229
|
+
if (base && backslashes === true) base = utils$5.removeBackslashes(base);
|
|
1230
1230
|
}
|
|
1231
1231
|
const state = {
|
|
1232
1232
|
prefix,
|
|
@@ -1282,7 +1282,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1282
1282
|
}));
|
|
1283
1283
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1284
1284
|
const constants$1 = require_constants();
|
|
1285
|
-
const utils$
|
|
1285
|
+
const utils$4 = require_utils$1();
|
|
1286
1286
|
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants$1;
|
|
1287
1287
|
const expandRange = (args, options) => {
|
|
1288
1288
|
if (typeof options.expandRange === "function") return options.expandRange(...args, options);
|
|
@@ -1291,7 +1291,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1291
1291
|
try {
|
|
1292
1292
|
new RegExp(value);
|
|
1293
1293
|
} catch (ex) {
|
|
1294
|
-
return args.map((v$1) => utils$
|
|
1294
|
+
return args.map((v$1) => utils$4.escapeRegex(v$1)).join("..");
|
|
1295
1295
|
}
|
|
1296
1296
|
return value;
|
|
1297
1297
|
};
|
|
@@ -1340,7 +1340,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1340
1340
|
globstar: false,
|
|
1341
1341
|
tokens
|
|
1342
1342
|
};
|
|
1343
|
-
input = utils$
|
|
1343
|
+
input = utils$4.removePrefix(input, state);
|
|
1344
1344
|
len = input.length;
|
|
1345
1345
|
const extglobs = [];
|
|
1346
1346
|
const braces = [];
|
|
@@ -1474,7 +1474,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1474
1474
|
state.output = input;
|
|
1475
1475
|
return state;
|
|
1476
1476
|
}
|
|
1477
|
-
state.output = utils$
|
|
1477
|
+
state.output = utils$4.wrapOutput(output, state, options);
|
|
1478
1478
|
return state;
|
|
1479
1479
|
}
|
|
1480
1480
|
while (!eos()) {
|
|
@@ -1536,7 +1536,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1536
1536
|
continue;
|
|
1537
1537
|
}
|
|
1538
1538
|
if (state.quotes === 1 && value !== "\"") {
|
|
1539
|
-
value = utils$
|
|
1539
|
+
value = utils$4.escapeRegex(value);
|
|
1540
1540
|
prev.value += value;
|
|
1541
1541
|
append({ value });
|
|
1542
1542
|
continue;
|
|
@@ -1606,8 +1606,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1606
1606
|
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
|
|
1607
1607
|
prev.value += value;
|
|
1608
1608
|
append({ value });
|
|
1609
|
-
if (opts.literalBrackets === false || utils$
|
|
1610
|
-
const escaped = utils$
|
|
1609
|
+
if (opts.literalBrackets === false || utils$4.hasRegexChars(prevValue)) continue;
|
|
1610
|
+
const escaped = utils$4.escapeRegex(prev.value);
|
|
1611
1611
|
state.output = state.output.slice(0, -prev.value.length);
|
|
1612
1612
|
if (opts.literalBrackets === true) {
|
|
1613
1613
|
state.output += escaped;
|
|
@@ -1975,17 +1975,17 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
while (state.brackets > 0) {
|
|
1977
1977
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1978
|
-
state.output = utils$
|
|
1978
|
+
state.output = utils$4.escapeLast(state.output, "[");
|
|
1979
1979
|
decrement("brackets");
|
|
1980
1980
|
}
|
|
1981
1981
|
while (state.parens > 0) {
|
|
1982
1982
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
|
|
1983
|
-
state.output = utils$
|
|
1983
|
+
state.output = utils$4.escapeLast(state.output, "(");
|
|
1984
1984
|
decrement("parens");
|
|
1985
1985
|
}
|
|
1986
1986
|
while (state.braces > 0) {
|
|
1987
1987
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
|
|
1988
|
-
state.output = utils$
|
|
1988
|
+
state.output = utils$4.escapeLast(state.output, "{");
|
|
1989
1989
|
decrement("braces");
|
|
1990
1990
|
}
|
|
1991
1991
|
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
|
|
@@ -2041,7 +2041,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
2043
2043
|
};
|
|
2044
|
-
let source = create(utils$
|
|
2044
|
+
let source = create(utils$4.removePrefix(input, state));
|
|
2045
2045
|
if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL$1}?`;
|
|
2046
2046
|
return source;
|
|
2047
2047
|
};
|
|
@@ -2050,7 +2050,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2050
2050
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2051
2051
|
const scan = require_scan();
|
|
2052
2052
|
const parse = require_parse();
|
|
2053
|
-
const utils$
|
|
2053
|
+
const utils$3 = require_utils$1();
|
|
2054
2054
|
const constants = require_constants();
|
|
2055
2055
|
const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
2056
2056
|
const picomatch$2 = (glob$1, options, returnState = false) => {
|
|
@@ -2069,9 +2069,9 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2069
2069
|
if (glob$1 === "" || typeof glob$1 !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
|
|
2070
2070
|
const opts = options || {};
|
|
2071
2071
|
const posix$1 = opts.windows;
|
|
2072
|
-
const regex = isState ? picomatch$2.compileRe(glob$1, options) : picomatch$2.makeRe(glob$1, options, false, true);
|
|
2073
|
-
const state = regex.state;
|
|
2074
|
-
delete regex.state;
|
|
2072
|
+
const regex$1 = isState ? picomatch$2.compileRe(glob$1, options) : picomatch$2.makeRe(glob$1, options, false, true);
|
|
2073
|
+
const state = regex$1.state;
|
|
2074
|
+
delete regex$1.state;
|
|
2075
2075
|
let isIgnored = () => false;
|
|
2076
2076
|
if (opts.ignore) {
|
|
2077
2077
|
const ignoreOpts = {
|
|
@@ -2083,14 +2083,14 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2083
2083
|
isIgnored = picomatch$2(opts.ignore, ignoreOpts, returnState);
|
|
2084
2084
|
}
|
|
2085
2085
|
const matcher = (input, returnObject = false) => {
|
|
2086
|
-
const { isMatch, match, output } = picomatch$2.test(input, regex, options, {
|
|
2086
|
+
const { isMatch, match, output } = picomatch$2.test(input, regex$1, options, {
|
|
2087
2087
|
glob: glob$1,
|
|
2088
2088
|
posix: posix$1
|
|
2089
2089
|
});
|
|
2090
2090
|
const result = {
|
|
2091
2091
|
glob: glob$1,
|
|
2092
2092
|
state,
|
|
2093
|
-
regex,
|
|
2093
|
+
regex: regex$1,
|
|
2094
2094
|
posix: posix$1,
|
|
2095
2095
|
input,
|
|
2096
2096
|
output,
|
|
@@ -2113,22 +2113,22 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2113
2113
|
if (returnState) matcher.state = state;
|
|
2114
2114
|
return matcher;
|
|
2115
2115
|
};
|
|
2116
|
-
picomatch$2.test = (input, regex, options, { glob: glob$1, posix: posix$1 } = {}) => {
|
|
2116
|
+
picomatch$2.test = (input, regex$1, options, { glob: glob$1, posix: posix$1 } = {}) => {
|
|
2117
2117
|
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
|
|
2118
2118
|
if (input === "") return {
|
|
2119
2119
|
isMatch: false,
|
|
2120
2120
|
output: ""
|
|
2121
2121
|
};
|
|
2122
2122
|
const opts = options || {};
|
|
2123
|
-
const format = opts.format || (posix$1 ? utils$
|
|
2123
|
+
const format = opts.format || (posix$1 ? utils$3.toPosixSlashes : null);
|
|
2124
2124
|
let match = input === glob$1;
|
|
2125
2125
|
let output = match && format ? format(input) : input;
|
|
2126
2126
|
if (match === false) {
|
|
2127
2127
|
output = format ? format(input) : input;
|
|
2128
2128
|
match = output === glob$1;
|
|
2129
2129
|
}
|
|
2130
|
-
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch$2.matchBase(input, regex, options, posix$1);
|
|
2131
|
-
else match = regex.exec(output);
|
|
2130
|
+
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch$2.matchBase(input, regex$1, options, posix$1);
|
|
2131
|
+
else match = regex$1.exec(output);
|
|
2132
2132
|
return {
|
|
2133
2133
|
isMatch: Boolean(match),
|
|
2134
2134
|
match,
|
|
@@ -2136,11 +2136,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2136
2136
|
};
|
|
2137
2137
|
};
|
|
2138
2138
|
picomatch$2.matchBase = (input, glob$1, options) => {
|
|
2139
|
-
return (glob$1 instanceof RegExp ? glob$1 : picomatch$2.makeRe(glob$1, options)).test(utils$
|
|
2139
|
+
return (glob$1 instanceof RegExp ? glob$1 : picomatch$2.makeRe(glob$1, options)).test(utils$3.basename(input));
|
|
2140
2140
|
};
|
|
2141
2141
|
picomatch$2.isMatch = (str, patterns, options) => picomatch$2(patterns, options)(str);
|
|
2142
2142
|
picomatch$2.parse = (pattern, options) => {
|
|
2143
|
-
if (Array.isArray(pattern)) return pattern.map((p) => picomatch$2.parse(p, options));
|
|
2143
|
+
if (Array.isArray(pattern)) return pattern.map((p$1) => picomatch$2.parse(p$1, options));
|
|
2144
2144
|
return parse(pattern, {
|
|
2145
2145
|
...options,
|
|
2146
2146
|
fastpaths: false
|
|
@@ -2154,9 +2154,9 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2154
2154
|
const append = opts.contains ? "" : "$";
|
|
2155
2155
|
let source = `${prepend}(?:${state.output})${append}`;
|
|
2156
2156
|
if (state && state.negated === true) source = `^(?!${source}).*$`;
|
|
2157
|
-
const regex = picomatch$2.toRegex(source, options);
|
|
2158
|
-
if (returnState === true) regex.state = state;
|
|
2159
|
-
return regex;
|
|
2157
|
+
const regex$1 = picomatch$2.toRegex(source, options);
|
|
2158
|
+
if (returnState === true) regex$1.state = state;
|
|
2159
|
+
return regex$1;
|
|
2160
2160
|
};
|
|
2161
2161
|
picomatch$2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
2162
2162
|
if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
|
|
@@ -2182,11 +2182,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2182
2182
|
}));
|
|
2183
2183
|
var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2184
2184
|
const pico = require_picomatch$1();
|
|
2185
|
-
const utils = require_utils();
|
|
2185
|
+
const utils$2 = require_utils$1();
|
|
2186
2186
|
function picomatch$1(glob$1, options, returnState = false) {
|
|
2187
2187
|
if (options && (options.windows === null || options.windows === void 0)) options = {
|
|
2188
2188
|
...options,
|
|
2189
|
-
windows: utils.isWindows()
|
|
2189
|
+
windows: utils$2.isWindows()
|
|
2190
2190
|
};
|
|
2191
2191
|
return pico(glob$1, options, returnState);
|
|
2192
2192
|
}
|
|
@@ -2232,32 +2232,32 @@ function getPartialMatcher(patterns, options = {}) {
|
|
|
2232
2232
|
}
|
|
2233
2233
|
/* node:coverage ignore next 2 */
|
|
2234
2234
|
const WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
|
|
2235
|
-
const isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
|
|
2235
|
+
const isRoot = isWin ? (p$1) => WIN32_ROOT_DIR.test(p$1) : (p$1) => p$1 === "/";
|
|
2236
2236
|
function buildFormat(cwd, root, absolute) {
|
|
2237
2237
|
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
2238
2238
|
if (absolute) {
|
|
2239
2239
|
const start = isRoot(cwd) ? cwd.length : cwd.length + 1;
|
|
2240
|
-
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
|
|
2240
|
+
return (p$1, isDir) => p$1.slice(start, isDir ? -1 : void 0) || ".";
|
|
2241
2241
|
}
|
|
2242
2242
|
const prefix = root.slice(cwd.length + 1);
|
|
2243
|
-
if (prefix) return (p, isDir) => {
|
|
2244
|
-
if (p === ".") return prefix;
|
|
2245
|
-
const result = `${prefix}/${p}`;
|
|
2243
|
+
if (prefix) return (p$1, isDir) => {
|
|
2244
|
+
if (p$1 === ".") return prefix;
|
|
2245
|
+
const result = `${prefix}/${p$1}`;
|
|
2246
2246
|
return isDir ? result.slice(0, -1) : result;
|
|
2247
2247
|
};
|
|
2248
|
-
return (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
|
|
2248
|
+
return (p$1, isDir) => isDir && p$1 !== "." ? p$1.slice(0, -1) : p$1;
|
|
2249
2249
|
}
|
|
2250
|
-
if (absolute) return (p) => posix.relative(cwd, p) || ".";
|
|
2251
|
-
return (p) => posix.relative(cwd, `${root}/${p}`) || ".";
|
|
2250
|
+
if (absolute) return (p$1) => posix.relative(cwd, p$1) || ".";
|
|
2251
|
+
return (p$1) => posix.relative(cwd, `${root}/${p$1}`) || ".";
|
|
2252
2252
|
}
|
|
2253
2253
|
function buildRelative(cwd, root) {
|
|
2254
2254
|
if (root.startsWith(`${cwd}/`)) {
|
|
2255
2255
|
const prefix = root.slice(cwd.length + 1);
|
|
2256
|
-
return (p) => `${prefix}/${p}`;
|
|
2256
|
+
return (p$1) => `${prefix}/${p$1}`;
|
|
2257
2257
|
}
|
|
2258
|
-
return (p) => {
|
|
2259
|
-
const result = posix.relative(cwd, `${root}/${p}`);
|
|
2260
|
-
if (p.endsWith("/") && result !== "") return `${result}/`;
|
|
2258
|
+
return (p$1) => {
|
|
2259
|
+
const result = posix.relative(cwd, `${root}/${p$1}`);
|
|
2260
|
+
if (p$1.endsWith("/") && result !== "") return `${result}/`;
|
|
2261
2261
|
return result || ".";
|
|
2262
2262
|
};
|
|
2263
2263
|
}
|
|
@@ -2400,20 +2400,20 @@ function getCrawler(patterns, inputOptions = {}) {
|
|
|
2400
2400
|
const format = buildFormat(cwd, props.root, options.absolute);
|
|
2401
2401
|
const formatExclude = options.absolute ? format : buildFormat(cwd, props.root, true);
|
|
2402
2402
|
const fdirOptions = {
|
|
2403
|
-
filters: [options.debug ? (p, isDirectory$1) => {
|
|
2404
|
-
const path$1 = format(p, isDirectory$1);
|
|
2403
|
+
filters: [options.debug ? (p$1, isDirectory$1) => {
|
|
2404
|
+
const path$1 = format(p$1, isDirectory$1);
|
|
2405
2405
|
const matches = matcher(path$1);
|
|
2406
2406
|
if (matches) log(`matched ${path$1}`);
|
|
2407
2407
|
return matches;
|
|
2408
|
-
} : (p, isDirectory$1) => matcher(format(p, isDirectory$1))],
|
|
2409
|
-
exclude: options.debug ? (_, p) => {
|
|
2410
|
-
const relativePath = formatExclude(p, true);
|
|
2408
|
+
} : (p$1, isDirectory$1) => matcher(format(p$1, isDirectory$1))],
|
|
2409
|
+
exclude: options.debug ? (_, p$1) => {
|
|
2410
|
+
const relativePath = formatExclude(p$1, true);
|
|
2411
2411
|
const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
2412
|
-
if (skipped) log(`skipped ${p}`);
|
|
2413
|
-
else log(`crawling ${p}`);
|
|
2412
|
+
if (skipped) log(`skipped ${p$1}`);
|
|
2413
|
+
else log(`crawling ${p$1}`);
|
|
2414
2414
|
return skipped;
|
|
2415
|
-
} : (_, p) => {
|
|
2416
|
-
const relativePath = formatExclude(p, true);
|
|
2415
|
+
} : (_, p$1) => {
|
|
2416
|
+
const relativePath = formatExclude(p$1, true);
|
|
2417
2417
|
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
2418
2418
|
},
|
|
2419
2419
|
fs: options.fs ? {
|
|
@@ -2458,15 +2458,15 @@ async function glob(patternsOrOptions, options) {
|
|
|
2458
2458
|
return formatPaths(await crawler.withPromise(), relative$1);
|
|
2459
2459
|
}
|
|
2460
2460
|
const homeDirectory = F.homedir();
|
|
2461
|
-
const { env } = process;
|
|
2462
|
-
const xdgData = env.XDG_DATA_HOME || (homeDirectory ? path.join(homeDirectory, ".local", "share") : void 0);
|
|
2463
|
-
const xdgConfig = env.XDG_CONFIG_HOME || (homeDirectory ? path.join(homeDirectory, ".config") : void 0);
|
|
2464
|
-
env.XDG_STATE_HOME || homeDirectory && path.join(homeDirectory, ".local", "state");
|
|
2465
|
-
env.XDG_CACHE_HOME || homeDirectory && path.join(homeDirectory, ".cache");
|
|
2466
|
-
env.XDG_RUNTIME_DIR;
|
|
2467
|
-
const xdgDataDirectories = (env.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":");
|
|
2461
|
+
const { env: env$2 } = process;
|
|
2462
|
+
const xdgData = env$2.XDG_DATA_HOME || (homeDirectory ? path.join(homeDirectory, ".local", "share") : void 0);
|
|
2463
|
+
const xdgConfig = env$2.XDG_CONFIG_HOME || (homeDirectory ? path.join(homeDirectory, ".config") : void 0);
|
|
2464
|
+
env$2.XDG_STATE_HOME || homeDirectory && path.join(homeDirectory, ".local", "state");
|
|
2465
|
+
env$2.XDG_CACHE_HOME || homeDirectory && path.join(homeDirectory, ".cache");
|
|
2466
|
+
env$2.XDG_RUNTIME_DIR;
|
|
2467
|
+
const xdgDataDirectories = (env$2.XDG_DATA_DIRS || "/usr/local/share/:/usr/share/").split(":");
|
|
2468
2468
|
if (xdgData) xdgDataDirectories.unshift(xdgData);
|
|
2469
|
-
const xdgConfigDirectories = (env.XDG_CONFIG_DIRS || "/etc/xdg").split(":");
|
|
2469
|
+
const xdgConfigDirectories = (env$2.XDG_CONFIG_DIRS || "/etc/xdg").split(":");
|
|
2470
2470
|
if (xdgConfig) xdgConfigDirectories.unshift(xdgConfig);
|
|
2471
2471
|
const DEFAULT_RECENT_DAYS = 3;
|
|
2472
2472
|
const BLOCKS_WARNING_THRESHOLD = .8;
|
|
@@ -2654,9 +2654,1655 @@ async function getFileModifiedTime(filePath) {
|
|
|
2654
2654
|
return pipe(try_({
|
|
2655
2655
|
try: stat(filePath),
|
|
2656
2656
|
catch: (error) => error
|
|
2657
|
-
}), map((stats) => stats.mtime.getTime()), unwrap(0));
|
|
2657
|
+
}), map$1((stats) => stats.mtime.getTime()), unwrap(0));
|
|
2658
2658
|
}
|
|
2659
|
-
|
|
2659
|
+
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2660
|
+
let messages = [];
|
|
2661
|
+
let level = 0;
|
|
2662
|
+
const debug$3 = (msg, min) => {
|
|
2663
|
+
if (level >= min) messages.push(msg);
|
|
2664
|
+
};
|
|
2665
|
+
debug$3.WARN = 1;
|
|
2666
|
+
debug$3.INFO = 2;
|
|
2667
|
+
debug$3.DEBUG = 3;
|
|
2668
|
+
debug$3.reset = () => {
|
|
2669
|
+
messages = [];
|
|
2670
|
+
};
|
|
2671
|
+
debug$3.setDebugLevel = (v$1) => {
|
|
2672
|
+
level = v$1;
|
|
2673
|
+
};
|
|
2674
|
+
debug$3.warn = (msg) => debug$3(msg, debug$3.WARN);
|
|
2675
|
+
debug$3.info = (msg) => debug$3(msg, debug$3.INFO);
|
|
2676
|
+
debug$3.debug = (msg) => debug$3(msg, debug$3.DEBUG);
|
|
2677
|
+
debug$3.debugMessages = () => messages;
|
|
2678
|
+
module.exports = debug$3;
|
|
2679
|
+
}));
|
|
2680
|
+
var require_ansi_regex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2681
|
+
module.exports = ({ onlyFirst = false } = {}) => {
|
|
2682
|
+
const pattern = ["[\\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("|");
|
|
2683
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
2684
|
+
};
|
|
2685
|
+
}));
|
|
2686
|
+
var require_strip_ansi = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2687
|
+
const ansiRegex$1 = require_ansi_regex();
|
|
2688
|
+
module.exports = (string$1) => typeof string$1 === "string" ? string$1.replace(ansiRegex$1(), "") : string$1;
|
|
2689
|
+
}));
|
|
2690
|
+
var require_is_fullwidth_code_point = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2691
|
+
const isFullwidthCodePoint$1 = (codePoint) => {
|
|
2692
|
+
if (Number.isNaN(codePoint)) return false;
|
|
2693
|
+
if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) return true;
|
|
2694
|
+
return false;
|
|
2695
|
+
};
|
|
2696
|
+
module.exports = isFullwidthCodePoint$1;
|
|
2697
|
+
module.exports.default = isFullwidthCodePoint$1;
|
|
2698
|
+
}));
|
|
2699
|
+
var require_emoji_regex$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2700
|
+
module.exports = function() {
|
|
2701
|
+
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
2702
|
+
};
|
|
2703
|
+
}));
|
|
2704
|
+
var require_string_width = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2705
|
+
const stripAnsi$1 = require_strip_ansi();
|
|
2706
|
+
const isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
2707
|
+
const emojiRegex$1 = require_emoji_regex$1();
|
|
2708
|
+
const stringWidth$2 = (string$1) => {
|
|
2709
|
+
if (typeof string$1 !== "string" || string$1.length === 0) return 0;
|
|
2710
|
+
string$1 = stripAnsi$1(string$1);
|
|
2711
|
+
if (string$1.length === 0) return 0;
|
|
2712
|
+
string$1 = string$1.replace(emojiRegex$1(), " ");
|
|
2713
|
+
let width = 0;
|
|
2714
|
+
for (let i = 0; i < string$1.length; i++) {
|
|
2715
|
+
const code = string$1.codePointAt(i);
|
|
2716
|
+
if (code <= 31 || code >= 127 && code <= 159) continue;
|
|
2717
|
+
if (code >= 768 && code <= 879) continue;
|
|
2718
|
+
if (code > 65535) i++;
|
|
2719
|
+
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
2720
|
+
}
|
|
2721
|
+
return width;
|
|
2722
|
+
};
|
|
2723
|
+
module.exports = stringWidth$2;
|
|
2724
|
+
module.exports.default = stringWidth$2;
|
|
2725
|
+
}));
|
|
2726
|
+
var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2727
|
+
const stringWidth$1 = require_string_width();
|
|
2728
|
+
function codeRegex(capture) {
|
|
2729
|
+
return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
|
|
2730
|
+
}
|
|
2731
|
+
function strlen(str) {
|
|
2732
|
+
let code = codeRegex();
|
|
2733
|
+
return ("" + str).replace(code, "").split("\n").reduce(function(memo, s) {
|
|
2734
|
+
return stringWidth$1(s) > memo ? stringWidth$1(s) : memo;
|
|
2735
|
+
}, 0);
|
|
2736
|
+
}
|
|
2737
|
+
function repeat(str, times) {
|
|
2738
|
+
return Array(times + 1).join(str);
|
|
2739
|
+
}
|
|
2740
|
+
function pad(str, len, pad$1, dir) {
|
|
2741
|
+
let length = strlen(str);
|
|
2742
|
+
if (len + 1 >= length) {
|
|
2743
|
+
let padlen = len - length;
|
|
2744
|
+
switch (dir) {
|
|
2745
|
+
case "right":
|
|
2746
|
+
str = repeat(pad$1, padlen) + str;
|
|
2747
|
+
break;
|
|
2748
|
+
case "center": {
|
|
2749
|
+
let right = Math.ceil(padlen / 2);
|
|
2750
|
+
str = repeat(pad$1, padlen - right) + str + repeat(pad$1, right);
|
|
2751
|
+
break;
|
|
2752
|
+
}
|
|
2753
|
+
default:
|
|
2754
|
+
str = str + repeat(pad$1, padlen);
|
|
2755
|
+
break;
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
return str;
|
|
2759
|
+
}
|
|
2760
|
+
let codeCache = {};
|
|
2761
|
+
function addToCodeCache(name, on, off) {
|
|
2762
|
+
on = "\x1B[" + on + "m";
|
|
2763
|
+
off = "\x1B[" + off + "m";
|
|
2764
|
+
codeCache[on] = {
|
|
2765
|
+
set: name,
|
|
2766
|
+
to: true
|
|
2767
|
+
};
|
|
2768
|
+
codeCache[off] = {
|
|
2769
|
+
set: name,
|
|
2770
|
+
to: false
|
|
2771
|
+
};
|
|
2772
|
+
codeCache[name] = {
|
|
2773
|
+
on,
|
|
2774
|
+
off
|
|
2775
|
+
};
|
|
2776
|
+
}
|
|
2777
|
+
addToCodeCache("bold", 1, 22);
|
|
2778
|
+
addToCodeCache("italics", 3, 23);
|
|
2779
|
+
addToCodeCache("underline", 4, 24);
|
|
2780
|
+
addToCodeCache("inverse", 7, 27);
|
|
2781
|
+
addToCodeCache("strikethrough", 9, 29);
|
|
2782
|
+
function updateState(state, controlChars) {
|
|
2783
|
+
let controlCode = controlChars[1] ? parseInt(controlChars[1].split(";")[0]) : 0;
|
|
2784
|
+
if (controlCode >= 30 && controlCode <= 39 || controlCode >= 90 && controlCode <= 97) {
|
|
2785
|
+
state.lastForegroundAdded = controlChars[0];
|
|
2786
|
+
return;
|
|
2787
|
+
}
|
|
2788
|
+
if (controlCode >= 40 && controlCode <= 49 || controlCode >= 100 && controlCode <= 107) {
|
|
2789
|
+
state.lastBackgroundAdded = controlChars[0];
|
|
2790
|
+
return;
|
|
2791
|
+
}
|
|
2792
|
+
if (controlCode === 0) {
|
|
2793
|
+
for (let i in state)
|
|
2794
|
+
/* istanbul ignore else */
|
|
2795
|
+
if (Object.prototype.hasOwnProperty.call(state, i)) delete state[i];
|
|
2796
|
+
return;
|
|
2797
|
+
}
|
|
2798
|
+
let info$1 = codeCache[controlChars[0]];
|
|
2799
|
+
if (info$1) state[info$1.set] = info$1.to;
|
|
2800
|
+
}
|
|
2801
|
+
function readState(line) {
|
|
2802
|
+
let code = codeRegex(true);
|
|
2803
|
+
let controlChars = code.exec(line);
|
|
2804
|
+
let state = {};
|
|
2805
|
+
while (controlChars !== null) {
|
|
2806
|
+
updateState(state, controlChars);
|
|
2807
|
+
controlChars = code.exec(line);
|
|
2808
|
+
}
|
|
2809
|
+
return state;
|
|
2810
|
+
}
|
|
2811
|
+
function unwindState(state, ret) {
|
|
2812
|
+
let lastBackgroundAdded = state.lastBackgroundAdded;
|
|
2813
|
+
let lastForegroundAdded = state.lastForegroundAdded;
|
|
2814
|
+
delete state.lastBackgroundAdded;
|
|
2815
|
+
delete state.lastForegroundAdded;
|
|
2816
|
+
Object.keys(state).forEach(function(key) {
|
|
2817
|
+
if (state[key]) ret += codeCache[key].off;
|
|
2818
|
+
});
|
|
2819
|
+
if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") ret += "\x1B[49m";
|
|
2820
|
+
if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") ret += "\x1B[39m";
|
|
2821
|
+
return ret;
|
|
2822
|
+
}
|
|
2823
|
+
function rewindState(state, ret) {
|
|
2824
|
+
let lastBackgroundAdded = state.lastBackgroundAdded;
|
|
2825
|
+
let lastForegroundAdded = state.lastForegroundAdded;
|
|
2826
|
+
delete state.lastBackgroundAdded;
|
|
2827
|
+
delete state.lastForegroundAdded;
|
|
2828
|
+
Object.keys(state).forEach(function(key) {
|
|
2829
|
+
if (state[key]) ret = codeCache[key].on + ret;
|
|
2830
|
+
});
|
|
2831
|
+
if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") ret = lastBackgroundAdded + ret;
|
|
2832
|
+
if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") ret = lastForegroundAdded + ret;
|
|
2833
|
+
return ret;
|
|
2834
|
+
}
|
|
2835
|
+
function truncateWidth(str, desiredLength) {
|
|
2836
|
+
if (str.length === strlen(str)) return str.substr(0, desiredLength);
|
|
2837
|
+
while (strlen(str) > desiredLength) str = str.slice(0, -1);
|
|
2838
|
+
return str;
|
|
2839
|
+
}
|
|
2840
|
+
function truncateWidthWithAnsi(str, desiredLength) {
|
|
2841
|
+
let code = codeRegex(true);
|
|
2842
|
+
let split = str.split(codeRegex());
|
|
2843
|
+
let splitIndex = 0;
|
|
2844
|
+
let retLen = 0;
|
|
2845
|
+
let ret = "";
|
|
2846
|
+
let myArray;
|
|
2847
|
+
let state = {};
|
|
2848
|
+
while (retLen < desiredLength) {
|
|
2849
|
+
myArray = code.exec(str);
|
|
2850
|
+
let toAdd = split[splitIndex];
|
|
2851
|
+
splitIndex++;
|
|
2852
|
+
if (retLen + strlen(toAdd) > desiredLength) toAdd = truncateWidth(toAdd, desiredLength - retLen);
|
|
2853
|
+
ret += toAdd;
|
|
2854
|
+
retLen += strlen(toAdd);
|
|
2855
|
+
if (retLen < desiredLength) {
|
|
2856
|
+
if (!myArray) break;
|
|
2857
|
+
ret += myArray[0];
|
|
2858
|
+
updateState(state, myArray);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
return unwindState(state, ret);
|
|
2862
|
+
}
|
|
2863
|
+
function truncate(str, desiredLength, truncateChar) {
|
|
2864
|
+
truncateChar = truncateChar || "…";
|
|
2865
|
+
if (strlen(str) <= desiredLength) return str;
|
|
2866
|
+
desiredLength -= strlen(truncateChar);
|
|
2867
|
+
let ret = truncateWidthWithAnsi(str, desiredLength);
|
|
2868
|
+
ret += truncateChar;
|
|
2869
|
+
const hrefTag = "\x1B]8;;\x07";
|
|
2870
|
+
if (str.includes(hrefTag) && !ret.includes(hrefTag)) ret += hrefTag;
|
|
2871
|
+
return ret;
|
|
2872
|
+
}
|
|
2873
|
+
function defaultOptions() {
|
|
2874
|
+
return {
|
|
2875
|
+
chars: {
|
|
2876
|
+
top: "─",
|
|
2877
|
+
"top-mid": "┬",
|
|
2878
|
+
"top-left": "┌",
|
|
2879
|
+
"top-right": "┐",
|
|
2880
|
+
bottom: "─",
|
|
2881
|
+
"bottom-mid": "┴",
|
|
2882
|
+
"bottom-left": "└",
|
|
2883
|
+
"bottom-right": "┘",
|
|
2884
|
+
left: "│",
|
|
2885
|
+
"left-mid": "├",
|
|
2886
|
+
mid: "─",
|
|
2887
|
+
"mid-mid": "┼",
|
|
2888
|
+
right: "│",
|
|
2889
|
+
"right-mid": "┤",
|
|
2890
|
+
middle: "│"
|
|
2891
|
+
},
|
|
2892
|
+
truncate: "…",
|
|
2893
|
+
colWidths: [],
|
|
2894
|
+
rowHeights: [],
|
|
2895
|
+
colAligns: [],
|
|
2896
|
+
rowAligns: [],
|
|
2897
|
+
style: {
|
|
2898
|
+
"padding-left": 1,
|
|
2899
|
+
"padding-right": 1,
|
|
2900
|
+
head: ["red"],
|
|
2901
|
+
border: ["grey"],
|
|
2902
|
+
compact: false
|
|
2903
|
+
},
|
|
2904
|
+
head: []
|
|
2905
|
+
};
|
|
2906
|
+
}
|
|
2907
|
+
function mergeOptions(options, defaults) {
|
|
2908
|
+
options = options || {};
|
|
2909
|
+
defaults = defaults || defaultOptions();
|
|
2910
|
+
let ret = Object.assign({}, defaults, options);
|
|
2911
|
+
ret.chars = Object.assign({}, defaults.chars, options.chars);
|
|
2912
|
+
ret.style = Object.assign({}, defaults.style, options.style);
|
|
2913
|
+
return ret;
|
|
2914
|
+
}
|
|
2915
|
+
function wordWrap(maxLength, input) {
|
|
2916
|
+
let lines = [];
|
|
2917
|
+
let split = input.split(/(\s+)/g);
|
|
2918
|
+
let line = [];
|
|
2919
|
+
let lineLength = 0;
|
|
2920
|
+
let whitespace;
|
|
2921
|
+
for (let i = 0; i < split.length; i += 2) {
|
|
2922
|
+
let word = split[i];
|
|
2923
|
+
let newLength = lineLength + strlen(word);
|
|
2924
|
+
if (lineLength > 0 && whitespace) newLength += whitespace.length;
|
|
2925
|
+
if (newLength > maxLength) {
|
|
2926
|
+
if (lineLength !== 0) lines.push(line.join(""));
|
|
2927
|
+
line = [word];
|
|
2928
|
+
lineLength = strlen(word);
|
|
2929
|
+
} else {
|
|
2930
|
+
line.push(whitespace || "", word);
|
|
2931
|
+
lineLength = newLength;
|
|
2932
|
+
}
|
|
2933
|
+
whitespace = split[i + 1];
|
|
2934
|
+
}
|
|
2935
|
+
if (lineLength) lines.push(line.join(""));
|
|
2936
|
+
return lines;
|
|
2937
|
+
}
|
|
2938
|
+
function textWrap(maxLength, input) {
|
|
2939
|
+
let lines = [];
|
|
2940
|
+
let line = "";
|
|
2941
|
+
function pushLine(str, ws) {
|
|
2942
|
+
if (line.length && ws) line += ws;
|
|
2943
|
+
line += str;
|
|
2944
|
+
while (line.length > maxLength) {
|
|
2945
|
+
lines.push(line.slice(0, maxLength));
|
|
2946
|
+
line = line.slice(maxLength);
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
let split = input.split(/(\s+)/g);
|
|
2950
|
+
for (let i = 0; i < split.length; i += 2) pushLine(split[i], i && split[i - 1]);
|
|
2951
|
+
if (line.length) lines.push(line);
|
|
2952
|
+
return lines;
|
|
2953
|
+
}
|
|
2954
|
+
function multiLineWordWrap(maxLength, input, wrapOnWordBoundary = true) {
|
|
2955
|
+
let output = [];
|
|
2956
|
+
input = input.split("\n");
|
|
2957
|
+
const handler = wrapOnWordBoundary ? wordWrap : textWrap;
|
|
2958
|
+
for (let i = 0; i < input.length; i++) output.push.apply(output, handler(maxLength, input[i]));
|
|
2959
|
+
return output;
|
|
2960
|
+
}
|
|
2961
|
+
function colorizeLines(input) {
|
|
2962
|
+
let state = {};
|
|
2963
|
+
let output = [];
|
|
2964
|
+
for (let i = 0; i < input.length; i++) {
|
|
2965
|
+
let line = rewindState(state, input[i]);
|
|
2966
|
+
state = readState(line);
|
|
2967
|
+
let temp = Object.assign({}, state);
|
|
2968
|
+
output.push(unwindState(temp, line));
|
|
2969
|
+
}
|
|
2970
|
+
return output;
|
|
2971
|
+
}
|
|
2972
|
+
function hyperlink(url, text) {
|
|
2973
|
+
const OSC = "\x1B]";
|
|
2974
|
+
const BEL = "\x07";
|
|
2975
|
+
const SEP = ";";
|
|
2976
|
+
return [
|
|
2977
|
+
OSC,
|
|
2978
|
+
"8",
|
|
2979
|
+
SEP,
|
|
2980
|
+
SEP,
|
|
2981
|
+
url || text,
|
|
2982
|
+
BEL,
|
|
2983
|
+
text,
|
|
2984
|
+
OSC,
|
|
2985
|
+
"8",
|
|
2986
|
+
SEP,
|
|
2987
|
+
SEP,
|
|
2988
|
+
BEL
|
|
2989
|
+
].join("");
|
|
2990
|
+
}
|
|
2991
|
+
module.exports = {
|
|
2992
|
+
strlen,
|
|
2993
|
+
repeat,
|
|
2994
|
+
pad,
|
|
2995
|
+
truncate,
|
|
2996
|
+
mergeOptions,
|
|
2997
|
+
wordWrap: multiLineWordWrap,
|
|
2998
|
+
colorizeLines,
|
|
2999
|
+
hyperlink
|
|
3000
|
+
};
|
|
3001
|
+
}));
|
|
3002
|
+
var require_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3003
|
+
var styles$1 = {};
|
|
3004
|
+
module["exports"] = styles$1;
|
|
3005
|
+
var codes = {
|
|
3006
|
+
reset: [0, 0],
|
|
3007
|
+
bold: [1, 22],
|
|
3008
|
+
dim: [2, 22],
|
|
3009
|
+
italic: [3, 23],
|
|
3010
|
+
underline: [4, 24],
|
|
3011
|
+
inverse: [7, 27],
|
|
3012
|
+
hidden: [8, 28],
|
|
3013
|
+
strikethrough: [9, 29],
|
|
3014
|
+
black: [30, 39],
|
|
3015
|
+
red: [31, 39],
|
|
3016
|
+
green: [32, 39],
|
|
3017
|
+
yellow: [33, 39],
|
|
3018
|
+
blue: [34, 39],
|
|
3019
|
+
magenta: [35, 39],
|
|
3020
|
+
cyan: [36, 39],
|
|
3021
|
+
white: [37, 39],
|
|
3022
|
+
gray: [90, 39],
|
|
3023
|
+
grey: [90, 39],
|
|
3024
|
+
brightRed: [91, 39],
|
|
3025
|
+
brightGreen: [92, 39],
|
|
3026
|
+
brightYellow: [93, 39],
|
|
3027
|
+
brightBlue: [94, 39],
|
|
3028
|
+
brightMagenta: [95, 39],
|
|
3029
|
+
brightCyan: [96, 39],
|
|
3030
|
+
brightWhite: [97, 39],
|
|
3031
|
+
bgBlack: [40, 49],
|
|
3032
|
+
bgRed: [41, 49],
|
|
3033
|
+
bgGreen: [42, 49],
|
|
3034
|
+
bgYellow: [43, 49],
|
|
3035
|
+
bgBlue: [44, 49],
|
|
3036
|
+
bgMagenta: [45, 49],
|
|
3037
|
+
bgCyan: [46, 49],
|
|
3038
|
+
bgWhite: [47, 49],
|
|
3039
|
+
bgGray: [100, 49],
|
|
3040
|
+
bgGrey: [100, 49],
|
|
3041
|
+
bgBrightRed: [101, 49],
|
|
3042
|
+
bgBrightGreen: [102, 49],
|
|
3043
|
+
bgBrightYellow: [103, 49],
|
|
3044
|
+
bgBrightBlue: [104, 49],
|
|
3045
|
+
bgBrightMagenta: [105, 49],
|
|
3046
|
+
bgBrightCyan: [106, 49],
|
|
3047
|
+
bgBrightWhite: [107, 49],
|
|
3048
|
+
blackBG: [40, 49],
|
|
3049
|
+
redBG: [41, 49],
|
|
3050
|
+
greenBG: [42, 49],
|
|
3051
|
+
yellowBG: [43, 49],
|
|
3052
|
+
blueBG: [44, 49],
|
|
3053
|
+
magentaBG: [45, 49],
|
|
3054
|
+
cyanBG: [46, 49],
|
|
3055
|
+
whiteBG: [47, 49]
|
|
3056
|
+
};
|
|
3057
|
+
Object.keys(codes).forEach(function(key) {
|
|
3058
|
+
var val = codes[key];
|
|
3059
|
+
var style = styles$1[key] = [];
|
|
3060
|
+
style.open = "\x1B[" + val[0] + "m";
|
|
3061
|
+
style.close = "\x1B[" + val[1] + "m";
|
|
3062
|
+
});
|
|
3063
|
+
}));
|
|
3064
|
+
var require_has_flag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3065
|
+
module.exports = function(flag, argv$1) {
|
|
3066
|
+
argv$1 = argv$1 || process.argv;
|
|
3067
|
+
var terminatorPos = argv$1.indexOf("--");
|
|
3068
|
+
var prefix = /^-{1,2}/.test(flag) ? "" : "--";
|
|
3069
|
+
var pos = argv$1.indexOf(prefix + flag);
|
|
3070
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
3071
|
+
};
|
|
3072
|
+
}));
|
|
3073
|
+
var require_supports_colors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3074
|
+
var os = __require$1("node:os");
|
|
3075
|
+
var hasFlag = require_has_flag();
|
|
3076
|
+
var env$1 = process.env;
|
|
3077
|
+
var forceColor = void 0;
|
|
3078
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) forceColor = false;
|
|
3079
|
+
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) forceColor = true;
|
|
3080
|
+
if ("FORCE_COLOR" in env$1) forceColor = env$1.FORCE_COLOR.length === 0 || parseInt(env$1.FORCE_COLOR, 10) !== 0;
|
|
3081
|
+
function translateLevel(level$1) {
|
|
3082
|
+
if (level$1 === 0) return false;
|
|
3083
|
+
return {
|
|
3084
|
+
level: level$1,
|
|
3085
|
+
hasBasic: true,
|
|
3086
|
+
has256: level$1 >= 2,
|
|
3087
|
+
has16m: level$1 >= 3
|
|
3088
|
+
};
|
|
3089
|
+
}
|
|
3090
|
+
function supportsColor(stream) {
|
|
3091
|
+
if (forceColor === false) return 0;
|
|
3092
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
3093
|
+
if (hasFlag("color=256")) return 2;
|
|
3094
|
+
if (stream && !stream.isTTY && forceColor !== true) return 0;
|
|
3095
|
+
var min = forceColor ? 1 : 0;
|
|
3096
|
+
if (process.platform === "win32") {
|
|
3097
|
+
var osRelease = os.release().split(".");
|
|
3098
|
+
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
3099
|
+
return 1;
|
|
3100
|
+
}
|
|
3101
|
+
if ("CI" in env$1) {
|
|
3102
|
+
if ([
|
|
3103
|
+
"TRAVIS",
|
|
3104
|
+
"CIRCLECI",
|
|
3105
|
+
"APPVEYOR",
|
|
3106
|
+
"GITLAB_CI"
|
|
3107
|
+
].some(function(sign) {
|
|
3108
|
+
return sign in env$1;
|
|
3109
|
+
}) || env$1.CI_NAME === "codeship") return 1;
|
|
3110
|
+
return min;
|
|
3111
|
+
}
|
|
3112
|
+
if ("TEAMCITY_VERSION" in env$1) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env$1.TEAMCITY_VERSION) ? 1 : 0;
|
|
3113
|
+
if ("TERM_PROGRAM" in env$1) {
|
|
3114
|
+
var version = parseInt((env$1.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
3115
|
+
switch (env$1.TERM_PROGRAM) {
|
|
3116
|
+
case "iTerm.app": return version >= 3 ? 3 : 2;
|
|
3117
|
+
case "Hyper": return 3;
|
|
3118
|
+
case "Apple_Terminal": return 2;
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
if (/-256(color)?$/i.test(env$1.TERM)) return 2;
|
|
3122
|
+
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env$1.TERM)) return 1;
|
|
3123
|
+
if ("COLORTERM" in env$1) return 1;
|
|
3124
|
+
if (env$1.TERM === "dumb") return min;
|
|
3125
|
+
return min;
|
|
3126
|
+
}
|
|
3127
|
+
function getSupportLevel(stream) {
|
|
3128
|
+
return translateLevel(supportsColor(stream));
|
|
3129
|
+
}
|
|
3130
|
+
module.exports = {
|
|
3131
|
+
supportsColor: getSupportLevel,
|
|
3132
|
+
stdout: getSupportLevel(process.stdout),
|
|
3133
|
+
stderr: getSupportLevel(process.stderr)
|
|
3134
|
+
};
|
|
3135
|
+
}));
|
|
3136
|
+
var require_trap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3137
|
+
module["exports"] = function runTheTrap(text, options) {
|
|
3138
|
+
var result = "";
|
|
3139
|
+
text = text || "Run the trap, drop the bass";
|
|
3140
|
+
text = text.split("");
|
|
3141
|
+
var trap = {
|
|
3142
|
+
a: [
|
|
3143
|
+
"@",
|
|
3144
|
+
"Ą",
|
|
3145
|
+
"Ⱥ",
|
|
3146
|
+
"Ʌ",
|
|
3147
|
+
"Δ",
|
|
3148
|
+
"Λ",
|
|
3149
|
+
"Д"
|
|
3150
|
+
],
|
|
3151
|
+
b: [
|
|
3152
|
+
"ß",
|
|
3153
|
+
"Ɓ",
|
|
3154
|
+
"Ƀ",
|
|
3155
|
+
"ɮ",
|
|
3156
|
+
"β",
|
|
3157
|
+
"฿"
|
|
3158
|
+
],
|
|
3159
|
+
c: [
|
|
3160
|
+
"©",
|
|
3161
|
+
"Ȼ",
|
|
3162
|
+
"Ͼ"
|
|
3163
|
+
],
|
|
3164
|
+
d: [
|
|
3165
|
+
"Ð",
|
|
3166
|
+
"Ɗ",
|
|
3167
|
+
"Ԁ",
|
|
3168
|
+
"ԁ",
|
|
3169
|
+
"Ԃ",
|
|
3170
|
+
"ԃ"
|
|
3171
|
+
],
|
|
3172
|
+
e: [
|
|
3173
|
+
"Ë",
|
|
3174
|
+
"ĕ",
|
|
3175
|
+
"Ǝ",
|
|
3176
|
+
"ɘ",
|
|
3177
|
+
"Σ",
|
|
3178
|
+
"ξ",
|
|
3179
|
+
"Ҽ",
|
|
3180
|
+
"੬"
|
|
3181
|
+
],
|
|
3182
|
+
f: ["Ӻ"],
|
|
3183
|
+
g: ["ɢ"],
|
|
3184
|
+
h: [
|
|
3185
|
+
"Ħ",
|
|
3186
|
+
"ƕ",
|
|
3187
|
+
"Ң",
|
|
3188
|
+
"Һ",
|
|
3189
|
+
"Ӈ",
|
|
3190
|
+
"Ԋ"
|
|
3191
|
+
],
|
|
3192
|
+
i: ["༏"],
|
|
3193
|
+
j: ["Ĵ"],
|
|
3194
|
+
k: [
|
|
3195
|
+
"ĸ",
|
|
3196
|
+
"Ҡ",
|
|
3197
|
+
"Ӄ",
|
|
3198
|
+
"Ԟ"
|
|
3199
|
+
],
|
|
3200
|
+
l: ["Ĺ"],
|
|
3201
|
+
m: [
|
|
3202
|
+
"ʍ",
|
|
3203
|
+
"Ӎ",
|
|
3204
|
+
"ӎ",
|
|
3205
|
+
"Ԡ",
|
|
3206
|
+
"ԡ",
|
|
3207
|
+
"൩"
|
|
3208
|
+
],
|
|
3209
|
+
n: [
|
|
3210
|
+
"Ñ",
|
|
3211
|
+
"ŋ",
|
|
3212
|
+
"Ɲ",
|
|
3213
|
+
"Ͷ",
|
|
3214
|
+
"Π",
|
|
3215
|
+
"Ҋ"
|
|
3216
|
+
],
|
|
3217
|
+
o: [
|
|
3218
|
+
"Ø",
|
|
3219
|
+
"õ",
|
|
3220
|
+
"ø",
|
|
3221
|
+
"Ǿ",
|
|
3222
|
+
"ʘ",
|
|
3223
|
+
"Ѻ",
|
|
3224
|
+
"ם",
|
|
3225
|
+
"",
|
|
3226
|
+
"๏"
|
|
3227
|
+
],
|
|
3228
|
+
p: ["Ƿ", "Ҏ"],
|
|
3229
|
+
q: ["্"],
|
|
3230
|
+
r: [
|
|
3231
|
+
"®",
|
|
3232
|
+
"Ʀ",
|
|
3233
|
+
"Ȑ",
|
|
3234
|
+
"Ɍ",
|
|
3235
|
+
"ʀ",
|
|
3236
|
+
"Я"
|
|
3237
|
+
],
|
|
3238
|
+
s: [
|
|
3239
|
+
"§",
|
|
3240
|
+
"Ϟ",
|
|
3241
|
+
"ϟ",
|
|
3242
|
+
"Ϩ"
|
|
3243
|
+
],
|
|
3244
|
+
t: [
|
|
3245
|
+
"Ł",
|
|
3246
|
+
"Ŧ",
|
|
3247
|
+
"ͳ"
|
|
3248
|
+
],
|
|
3249
|
+
u: ["Ʊ", "Ս"],
|
|
3250
|
+
v: ["ט"],
|
|
3251
|
+
w: [
|
|
3252
|
+
"Ш",
|
|
3253
|
+
"Ѡ",
|
|
3254
|
+
"Ѽ",
|
|
3255
|
+
"൰"
|
|
3256
|
+
],
|
|
3257
|
+
x: [
|
|
3258
|
+
"Ҳ",
|
|
3259
|
+
"Ӿ",
|
|
3260
|
+
"Ӽ",
|
|
3261
|
+
"ӽ"
|
|
3262
|
+
],
|
|
3263
|
+
y: [
|
|
3264
|
+
"¥",
|
|
3265
|
+
"Ұ",
|
|
3266
|
+
"Ӌ"
|
|
3267
|
+
],
|
|
3268
|
+
z: ["Ƶ", "ɀ"]
|
|
3269
|
+
};
|
|
3270
|
+
text.forEach(function(c) {
|
|
3271
|
+
c = c.toLowerCase();
|
|
3272
|
+
var chars = trap[c] || [" "];
|
|
3273
|
+
var rand = Math.floor(Math.random() * chars.length);
|
|
3274
|
+
if (typeof trap[c] !== "undefined") result += trap[c][rand];
|
|
3275
|
+
else result += c;
|
|
3276
|
+
});
|
|
3277
|
+
return result;
|
|
3278
|
+
};
|
|
3279
|
+
}));
|
|
3280
|
+
var require_zalgo = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3281
|
+
module["exports"] = function zalgo(text, options) {
|
|
3282
|
+
text = text || " he is here ";
|
|
3283
|
+
var soul = {
|
|
3284
|
+
"up": [
|
|
3285
|
+
"̍",
|
|
3286
|
+
"̎",
|
|
3287
|
+
"̄",
|
|
3288
|
+
"̅",
|
|
3289
|
+
"̿",
|
|
3290
|
+
"̑",
|
|
3291
|
+
"̆",
|
|
3292
|
+
"̐",
|
|
3293
|
+
"͒",
|
|
3294
|
+
"͗",
|
|
3295
|
+
"͑",
|
|
3296
|
+
"̇",
|
|
3297
|
+
"̈",
|
|
3298
|
+
"̊",
|
|
3299
|
+
"͂",
|
|
3300
|
+
"̓",
|
|
3301
|
+
"̈",
|
|
3302
|
+
"͊",
|
|
3303
|
+
"͋",
|
|
3304
|
+
"͌",
|
|
3305
|
+
"̃",
|
|
3306
|
+
"̂",
|
|
3307
|
+
"̌",
|
|
3308
|
+
"͐",
|
|
3309
|
+
"̀",
|
|
3310
|
+
"́",
|
|
3311
|
+
"̋",
|
|
3312
|
+
"̏",
|
|
3313
|
+
"̒",
|
|
3314
|
+
"̓",
|
|
3315
|
+
"̔",
|
|
3316
|
+
"̽",
|
|
3317
|
+
"̉",
|
|
3318
|
+
"ͣ",
|
|
3319
|
+
"ͤ",
|
|
3320
|
+
"ͥ",
|
|
3321
|
+
"ͦ",
|
|
3322
|
+
"ͧ",
|
|
3323
|
+
"ͨ",
|
|
3324
|
+
"ͩ",
|
|
3325
|
+
"ͪ",
|
|
3326
|
+
"ͫ",
|
|
3327
|
+
"ͬ",
|
|
3328
|
+
"ͭ",
|
|
3329
|
+
"ͮ",
|
|
3330
|
+
"ͯ",
|
|
3331
|
+
"̾",
|
|
3332
|
+
"͛",
|
|
3333
|
+
"͆",
|
|
3334
|
+
"̚"
|
|
3335
|
+
],
|
|
3336
|
+
"down": [
|
|
3337
|
+
"̖",
|
|
3338
|
+
"̗",
|
|
3339
|
+
"̘",
|
|
3340
|
+
"̙",
|
|
3341
|
+
"̜",
|
|
3342
|
+
"̝",
|
|
3343
|
+
"̞",
|
|
3344
|
+
"̟",
|
|
3345
|
+
"̠",
|
|
3346
|
+
"̤",
|
|
3347
|
+
"̥",
|
|
3348
|
+
"̦",
|
|
3349
|
+
"̩",
|
|
3350
|
+
"̪",
|
|
3351
|
+
"̫",
|
|
3352
|
+
"̬",
|
|
3353
|
+
"̭",
|
|
3354
|
+
"̮",
|
|
3355
|
+
"̯",
|
|
3356
|
+
"̰",
|
|
3357
|
+
"̱",
|
|
3358
|
+
"̲",
|
|
3359
|
+
"̳",
|
|
3360
|
+
"̹",
|
|
3361
|
+
"̺",
|
|
3362
|
+
"̻",
|
|
3363
|
+
"̼",
|
|
3364
|
+
"ͅ",
|
|
3365
|
+
"͇",
|
|
3366
|
+
"͈",
|
|
3367
|
+
"͉",
|
|
3368
|
+
"͍",
|
|
3369
|
+
"͎",
|
|
3370
|
+
"͓",
|
|
3371
|
+
"͔",
|
|
3372
|
+
"͕",
|
|
3373
|
+
"͖",
|
|
3374
|
+
"͙",
|
|
3375
|
+
"͚",
|
|
3376
|
+
"̣"
|
|
3377
|
+
],
|
|
3378
|
+
"mid": [
|
|
3379
|
+
"̕",
|
|
3380
|
+
"̛",
|
|
3381
|
+
"̀",
|
|
3382
|
+
"́",
|
|
3383
|
+
"͘",
|
|
3384
|
+
"̡",
|
|
3385
|
+
"̢",
|
|
3386
|
+
"̧",
|
|
3387
|
+
"̨",
|
|
3388
|
+
"̴",
|
|
3389
|
+
"̵",
|
|
3390
|
+
"̶",
|
|
3391
|
+
"͜",
|
|
3392
|
+
"͝",
|
|
3393
|
+
"͞",
|
|
3394
|
+
"͟",
|
|
3395
|
+
"͠",
|
|
3396
|
+
"͢",
|
|
3397
|
+
"̸",
|
|
3398
|
+
"̷",
|
|
3399
|
+
"͡",
|
|
3400
|
+
" ҉"
|
|
3401
|
+
]
|
|
3402
|
+
};
|
|
3403
|
+
var all = [].concat(soul.up, soul.down, soul.mid);
|
|
3404
|
+
function randomNumber(range) {
|
|
3405
|
+
return Math.floor(Math.random() * range);
|
|
3406
|
+
}
|
|
3407
|
+
function isChar(character) {
|
|
3408
|
+
var bool = false;
|
|
3409
|
+
all.filter(function(i) {
|
|
3410
|
+
bool = i === character;
|
|
3411
|
+
});
|
|
3412
|
+
return bool;
|
|
3413
|
+
}
|
|
3414
|
+
function heComes(text$1, options$1) {
|
|
3415
|
+
var result = "";
|
|
3416
|
+
var counts;
|
|
3417
|
+
var l$1;
|
|
3418
|
+
options$1 = options$1 || {};
|
|
3419
|
+
options$1["up"] = typeof options$1["up"] !== "undefined" ? options$1["up"] : true;
|
|
3420
|
+
options$1["mid"] = typeof options$1["mid"] !== "undefined" ? options$1["mid"] : true;
|
|
3421
|
+
options$1["down"] = typeof options$1["down"] !== "undefined" ? options$1["down"] : true;
|
|
3422
|
+
options$1["size"] = typeof options$1["size"] !== "undefined" ? options$1["size"] : "maxi";
|
|
3423
|
+
text$1 = text$1.split("");
|
|
3424
|
+
for (l$1 in text$1) {
|
|
3425
|
+
if (isChar(l$1)) continue;
|
|
3426
|
+
result = result + text$1[l$1];
|
|
3427
|
+
counts = {
|
|
3428
|
+
"up": 0,
|
|
3429
|
+
"down": 0,
|
|
3430
|
+
"mid": 0
|
|
3431
|
+
};
|
|
3432
|
+
switch (options$1.size) {
|
|
3433
|
+
case "mini":
|
|
3434
|
+
counts.up = randomNumber(8);
|
|
3435
|
+
counts.mid = randomNumber(2);
|
|
3436
|
+
counts.down = randomNumber(8);
|
|
3437
|
+
break;
|
|
3438
|
+
case "maxi":
|
|
3439
|
+
counts.up = randomNumber(16) + 3;
|
|
3440
|
+
counts.mid = randomNumber(4) + 1;
|
|
3441
|
+
counts.down = randomNumber(64) + 3;
|
|
3442
|
+
break;
|
|
3443
|
+
default:
|
|
3444
|
+
counts.up = randomNumber(8) + 1;
|
|
3445
|
+
counts.mid = randomNumber(6) / 2;
|
|
3446
|
+
counts.down = randomNumber(8) + 1;
|
|
3447
|
+
break;
|
|
3448
|
+
}
|
|
3449
|
+
var arr = [
|
|
3450
|
+
"up",
|
|
3451
|
+
"mid",
|
|
3452
|
+
"down"
|
|
3453
|
+
];
|
|
3454
|
+
for (var d$1 in arr) {
|
|
3455
|
+
var index = arr[d$1];
|
|
3456
|
+
for (var i = 0; i <= counts[index]; i++) if (options$1[index]) result = result + soul[index][randomNumber(soul[index].length)];
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
return result;
|
|
3460
|
+
}
|
|
3461
|
+
return heComes(text, options);
|
|
3462
|
+
};
|
|
3463
|
+
}));
|
|
3464
|
+
var require_america = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3465
|
+
module["exports"] = function(colors$2) {
|
|
3466
|
+
return function(letter, i, exploded) {
|
|
3467
|
+
if (letter === " ") return letter;
|
|
3468
|
+
switch (i % 3) {
|
|
3469
|
+
case 0: return colors$2.red(letter);
|
|
3470
|
+
case 1: return colors$2.white(letter);
|
|
3471
|
+
case 2: return colors$2.blue(letter);
|
|
3472
|
+
}
|
|
3473
|
+
};
|
|
3474
|
+
};
|
|
3475
|
+
}));
|
|
3476
|
+
var require_zebra = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3477
|
+
module["exports"] = function(colors$2) {
|
|
3478
|
+
return function(letter, i, exploded) {
|
|
3479
|
+
return i % 2 === 0 ? letter : colors$2.inverse(letter);
|
|
3480
|
+
};
|
|
3481
|
+
};
|
|
3482
|
+
}));
|
|
3483
|
+
var require_rainbow = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3484
|
+
module["exports"] = function(colors$2) {
|
|
3485
|
+
var rainbowColors = [
|
|
3486
|
+
"red",
|
|
3487
|
+
"yellow",
|
|
3488
|
+
"green",
|
|
3489
|
+
"blue",
|
|
3490
|
+
"magenta"
|
|
3491
|
+
];
|
|
3492
|
+
return function(letter, i, exploded) {
|
|
3493
|
+
if (letter === " ") return letter;
|
|
3494
|
+
else return colors$2[rainbowColors[i++ % rainbowColors.length]](letter);
|
|
3495
|
+
};
|
|
3496
|
+
};
|
|
3497
|
+
}));
|
|
3498
|
+
var require_random = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3499
|
+
module["exports"] = function(colors$2) {
|
|
3500
|
+
var available = [
|
|
3501
|
+
"underline",
|
|
3502
|
+
"inverse",
|
|
3503
|
+
"grey",
|
|
3504
|
+
"yellow",
|
|
3505
|
+
"red",
|
|
3506
|
+
"green",
|
|
3507
|
+
"blue",
|
|
3508
|
+
"white",
|
|
3509
|
+
"cyan",
|
|
3510
|
+
"magenta",
|
|
3511
|
+
"brightYellow",
|
|
3512
|
+
"brightRed",
|
|
3513
|
+
"brightGreen",
|
|
3514
|
+
"brightBlue",
|
|
3515
|
+
"brightWhite",
|
|
3516
|
+
"brightCyan",
|
|
3517
|
+
"brightMagenta"
|
|
3518
|
+
];
|
|
3519
|
+
return function(letter, i, exploded) {
|
|
3520
|
+
return letter === " " ? letter : colors$2[available[Math.round(Math.random() * (available.length - 2))]](letter);
|
|
3521
|
+
};
|
|
3522
|
+
};
|
|
3523
|
+
}));
|
|
3524
|
+
var require_colors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3525
|
+
var colors$1 = {};
|
|
3526
|
+
module["exports"] = colors$1;
|
|
3527
|
+
colors$1.themes = {};
|
|
3528
|
+
var util = __require$1("node:util");
|
|
3529
|
+
var ansiStyles = colors$1.styles = require_styles();
|
|
3530
|
+
var defineProps = Object.defineProperties;
|
|
3531
|
+
var newLineRegex = /* @__PURE__ */ new RegExp(/[\r\n]+/g);
|
|
3532
|
+
colors$1.supportsColor = require_supports_colors().supportsColor;
|
|
3533
|
+
if (typeof colors$1.enabled === "undefined") colors$1.enabled = colors$1.supportsColor() !== false;
|
|
3534
|
+
colors$1.enable = function() {
|
|
3535
|
+
colors$1.enabled = true;
|
|
3536
|
+
};
|
|
3537
|
+
colors$1.disable = function() {
|
|
3538
|
+
colors$1.enabled = false;
|
|
3539
|
+
};
|
|
3540
|
+
colors$1.stripColors = colors$1.strip = function(str) {
|
|
3541
|
+
return ("" + str).replace(/\x1B\[\d+m/g, "");
|
|
3542
|
+
};
|
|
3543
|
+
colors$1.stylize = function stylize(str, style) {
|
|
3544
|
+
if (!colors$1.enabled) return str + "";
|
|
3545
|
+
var styleMap = ansiStyles[style];
|
|
3546
|
+
if (!styleMap && style in colors$1) return colors$1[style](str);
|
|
3547
|
+
return styleMap.open + str + styleMap.close;
|
|
3548
|
+
};
|
|
3549
|
+
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
3550
|
+
var escapeStringRegexp = function(str) {
|
|
3551
|
+
if (typeof str !== "string") throw new TypeError("Expected a string");
|
|
3552
|
+
return str.replace(matchOperatorsRe, "\\$&");
|
|
3553
|
+
};
|
|
3554
|
+
function build(_styles) {
|
|
3555
|
+
var builder = function builder$1() {
|
|
3556
|
+
return applyStyle.apply(builder$1, arguments);
|
|
3557
|
+
};
|
|
3558
|
+
builder._styles = _styles;
|
|
3559
|
+
builder.__proto__ = proto;
|
|
3560
|
+
return builder;
|
|
3561
|
+
}
|
|
3562
|
+
var styles = (function() {
|
|
3563
|
+
var ret = {};
|
|
3564
|
+
ansiStyles.grey = ansiStyles.gray;
|
|
3565
|
+
Object.keys(ansiStyles).forEach(function(key) {
|
|
3566
|
+
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
|
|
3567
|
+
ret[key] = { get: function() {
|
|
3568
|
+
return build(this._styles.concat(key));
|
|
3569
|
+
} };
|
|
3570
|
+
});
|
|
3571
|
+
return ret;
|
|
3572
|
+
})();
|
|
3573
|
+
var proto = defineProps(function colors$2() {}, styles);
|
|
3574
|
+
function applyStyle() {
|
|
3575
|
+
var str = Array.prototype.slice.call(arguments).map(function(arg) {
|
|
3576
|
+
if (arg != null && arg.constructor === String) return arg;
|
|
3577
|
+
else return util.inspect(arg);
|
|
3578
|
+
}).join(" ");
|
|
3579
|
+
if (!colors$1.enabled || !str) return str;
|
|
3580
|
+
var newLinesPresent = str.indexOf("\n") != -1;
|
|
3581
|
+
var nestedStyles = this._styles;
|
|
3582
|
+
var i = nestedStyles.length;
|
|
3583
|
+
while (i--) {
|
|
3584
|
+
var code = ansiStyles[nestedStyles[i]];
|
|
3585
|
+
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
|
3586
|
+
if (newLinesPresent) str = str.replace(newLineRegex, function(match) {
|
|
3587
|
+
return code.close + match + code.open;
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
return str;
|
|
3591
|
+
}
|
|
3592
|
+
colors$1.setTheme = function(theme) {
|
|
3593
|
+
if (typeof theme === "string") {
|
|
3594
|
+
console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");
|
|
3595
|
+
return;
|
|
3596
|
+
}
|
|
3597
|
+
for (var style in theme) (function(style$1) {
|
|
3598
|
+
colors$1[style$1] = function(str) {
|
|
3599
|
+
if (typeof theme[style$1] === "object") {
|
|
3600
|
+
var out = str;
|
|
3601
|
+
for (var i in theme[style$1]) out = colors$1[theme[style$1][i]](out);
|
|
3602
|
+
return out;
|
|
3603
|
+
}
|
|
3604
|
+
return colors$1[theme[style$1]](str);
|
|
3605
|
+
};
|
|
3606
|
+
})(style);
|
|
3607
|
+
};
|
|
3608
|
+
function init() {
|
|
3609
|
+
var ret = {};
|
|
3610
|
+
Object.keys(styles).forEach(function(name) {
|
|
3611
|
+
ret[name] = { get: function() {
|
|
3612
|
+
return build([name]);
|
|
3613
|
+
} };
|
|
3614
|
+
});
|
|
3615
|
+
return ret;
|
|
3616
|
+
}
|
|
3617
|
+
var sequencer = function sequencer$1(map$2, str) {
|
|
3618
|
+
var exploded = str.split("");
|
|
3619
|
+
exploded = exploded.map(map$2);
|
|
3620
|
+
return exploded.join("");
|
|
3621
|
+
};
|
|
3622
|
+
colors$1.trap = require_trap();
|
|
3623
|
+
colors$1.zalgo = require_zalgo();
|
|
3624
|
+
colors$1.maps = {};
|
|
3625
|
+
colors$1.maps.america = require_america()(colors$1);
|
|
3626
|
+
colors$1.maps.zebra = require_zebra()(colors$1);
|
|
3627
|
+
colors$1.maps.rainbow = require_rainbow()(colors$1);
|
|
3628
|
+
colors$1.maps.random = require_random()(colors$1);
|
|
3629
|
+
for (var map in colors$1.maps) (function(map$2) {
|
|
3630
|
+
colors$1[map$2] = function(str) {
|
|
3631
|
+
return sequencer(colors$1.maps[map$2], str);
|
|
3632
|
+
};
|
|
3633
|
+
})(map);
|
|
3634
|
+
defineProps(colors$1, init());
|
|
3635
|
+
}));
|
|
3636
|
+
var require_safe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3637
|
+
module["exports"] = require_colors();
|
|
3638
|
+
}));
|
|
3639
|
+
var require_cell = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3640
|
+
const { info, debug: debug$2 } = require_debug();
|
|
3641
|
+
const utils$1 = require_utils();
|
|
3642
|
+
var Cell$1 = class Cell$1 {
|
|
3643
|
+
constructor(options) {
|
|
3644
|
+
this.setOptions(options);
|
|
3645
|
+
this.x = null;
|
|
3646
|
+
this.y = null;
|
|
3647
|
+
}
|
|
3648
|
+
setOptions(options) {
|
|
3649
|
+
if ([
|
|
3650
|
+
"boolean",
|
|
3651
|
+
"number",
|
|
3652
|
+
"bigint",
|
|
3653
|
+
"string"
|
|
3654
|
+
].indexOf(typeof options) !== -1) options = { content: "" + options };
|
|
3655
|
+
options = options || {};
|
|
3656
|
+
this.options = options;
|
|
3657
|
+
let content = options.content;
|
|
3658
|
+
if ([
|
|
3659
|
+
"boolean",
|
|
3660
|
+
"number",
|
|
3661
|
+
"bigint",
|
|
3662
|
+
"string"
|
|
3663
|
+
].indexOf(typeof content) !== -1) this.content = String(content);
|
|
3664
|
+
else if (!content) this.content = this.options.href || "";
|
|
3665
|
+
else throw new Error("Content needs to be a primitive, got: " + typeof content);
|
|
3666
|
+
this.colSpan = options.colSpan || 1;
|
|
3667
|
+
this.rowSpan = options.rowSpan || 1;
|
|
3668
|
+
if (this.options.href) Object.defineProperty(this, "href", { get() {
|
|
3669
|
+
return this.options.href;
|
|
3670
|
+
} });
|
|
3671
|
+
}
|
|
3672
|
+
mergeTableOptions(tableOptions, cells) {
|
|
3673
|
+
this.cells = cells;
|
|
3674
|
+
let optionsChars = this.options.chars || {};
|
|
3675
|
+
let tableChars = tableOptions.chars;
|
|
3676
|
+
let chars = this.chars = {};
|
|
3677
|
+
CHAR_NAMES.forEach(function(name) {
|
|
3678
|
+
setOption(optionsChars, tableChars, name, chars);
|
|
3679
|
+
});
|
|
3680
|
+
this.truncate = this.options.truncate || tableOptions.truncate;
|
|
3681
|
+
let style = this.options.style = this.options.style || {};
|
|
3682
|
+
let tableStyle = tableOptions.style;
|
|
3683
|
+
setOption(style, tableStyle, "padding-left", this);
|
|
3684
|
+
setOption(style, tableStyle, "padding-right", this);
|
|
3685
|
+
this.head = style.head || tableStyle.head;
|
|
3686
|
+
this.border = style.border || tableStyle.border;
|
|
3687
|
+
this.fixedWidth = tableOptions.colWidths[this.x];
|
|
3688
|
+
this.lines = this.computeLines(tableOptions);
|
|
3689
|
+
this.desiredWidth = utils$1.strlen(this.content) + this.paddingLeft + this.paddingRight;
|
|
3690
|
+
this.desiredHeight = this.lines.length;
|
|
3691
|
+
}
|
|
3692
|
+
computeLines(tableOptions) {
|
|
3693
|
+
const tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap;
|
|
3694
|
+
const { wordWrap: wordWrap$1 = tableWordWrap } = this.options;
|
|
3695
|
+
if (this.fixedWidth && wordWrap$1) {
|
|
3696
|
+
this.fixedWidth -= this.paddingLeft + this.paddingRight;
|
|
3697
|
+
if (this.colSpan) {
|
|
3698
|
+
let i = 1;
|
|
3699
|
+
while (i < this.colSpan) {
|
|
3700
|
+
this.fixedWidth += tableOptions.colWidths[this.x + i];
|
|
3701
|
+
i++;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
const { wrapOnWordBoundary: tableWrapOnWordBoundary = true } = tableOptions;
|
|
3705
|
+
const { wrapOnWordBoundary = tableWrapOnWordBoundary } = this.options;
|
|
3706
|
+
return this.wrapLines(utils$1.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary));
|
|
3707
|
+
}
|
|
3708
|
+
return this.wrapLines(this.content.split("\n"));
|
|
3709
|
+
}
|
|
3710
|
+
wrapLines(computedLines) {
|
|
3711
|
+
const lines = utils$1.colorizeLines(computedLines);
|
|
3712
|
+
if (this.href) return lines.map((line) => utils$1.hyperlink(this.href, line));
|
|
3713
|
+
return lines;
|
|
3714
|
+
}
|
|
3715
|
+
init(tableOptions) {
|
|
3716
|
+
let x = this.x;
|
|
3717
|
+
let y$1 = this.y;
|
|
3718
|
+
this.widths = tableOptions.colWidths.slice(x, x + this.colSpan);
|
|
3719
|
+
this.heights = tableOptions.rowHeights.slice(y$1, y$1 + this.rowSpan);
|
|
3720
|
+
this.width = this.widths.reduce(sumPlusOne, -1);
|
|
3721
|
+
this.height = this.heights.reduce(sumPlusOne, -1);
|
|
3722
|
+
this.hAlign = this.options.hAlign || tableOptions.colAligns[x];
|
|
3723
|
+
this.vAlign = this.options.vAlign || tableOptions.rowAligns[y$1];
|
|
3724
|
+
this.drawRight = x + this.colSpan == tableOptions.colWidths.length;
|
|
3725
|
+
}
|
|
3726
|
+
draw(lineNum, spanningCell) {
|
|
3727
|
+
if (lineNum == "top") return this.drawTop(this.drawRight);
|
|
3728
|
+
if (lineNum == "bottom") return this.drawBottom(this.drawRight);
|
|
3729
|
+
let content = utils$1.truncate(this.content, 10, this.truncate);
|
|
3730
|
+
if (!lineNum) info(`${this.y}-${this.x}: ${this.rowSpan - lineNum}x${this.colSpan} Cell ${content}`);
|
|
3731
|
+
let padLen = Math.max(this.height - this.lines.length, 0);
|
|
3732
|
+
let padTop;
|
|
3733
|
+
switch (this.vAlign) {
|
|
3734
|
+
case "center":
|
|
3735
|
+
padTop = Math.ceil(padLen / 2);
|
|
3736
|
+
break;
|
|
3737
|
+
case "bottom":
|
|
3738
|
+
padTop = padLen;
|
|
3739
|
+
break;
|
|
3740
|
+
default: padTop = 0;
|
|
3741
|
+
}
|
|
3742
|
+
if (lineNum < padTop || lineNum >= padTop + this.lines.length) return this.drawEmpty(this.drawRight, spanningCell);
|
|
3743
|
+
let forceTruncation = this.lines.length > this.height && lineNum + 1 >= this.height;
|
|
3744
|
+
return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation, spanningCell);
|
|
3745
|
+
}
|
|
3746
|
+
drawTop(drawRight) {
|
|
3747
|
+
let content = [];
|
|
3748
|
+
if (this.cells) this.widths.forEach(function(width, index) {
|
|
3749
|
+
content.push(this._topLeftChar(index));
|
|
3750
|
+
content.push(utils$1.repeat(this.chars[this.y == 0 ? "top" : "mid"], width));
|
|
3751
|
+
}, this);
|
|
3752
|
+
else {
|
|
3753
|
+
content.push(this._topLeftChar(0));
|
|
3754
|
+
content.push(utils$1.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width));
|
|
3755
|
+
}
|
|
3756
|
+
if (drawRight) content.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]);
|
|
3757
|
+
return this.wrapWithStyleColors("border", content.join(""));
|
|
3758
|
+
}
|
|
3759
|
+
_topLeftChar(offset) {
|
|
3760
|
+
let x = this.x + offset;
|
|
3761
|
+
let leftChar;
|
|
3762
|
+
if (this.y == 0) leftChar = x == 0 ? "topLeft" : offset == 0 ? "topMid" : "top";
|
|
3763
|
+
else if (x == 0) leftChar = "leftMid";
|
|
3764
|
+
else {
|
|
3765
|
+
leftChar = offset == 0 ? "midMid" : "bottomMid";
|
|
3766
|
+
if (this.cells) {
|
|
3767
|
+
if (this.cells[this.y - 1][x] instanceof Cell$1.ColSpanCell) leftChar = offset == 0 ? "topMid" : "mid";
|
|
3768
|
+
if (offset == 0) {
|
|
3769
|
+
let i = 1;
|
|
3770
|
+
while (this.cells[this.y][x - i] instanceof Cell$1.ColSpanCell) i++;
|
|
3771
|
+
if (this.cells[this.y][x - i] instanceof Cell$1.RowSpanCell) leftChar = "leftMid";
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
return this.chars[leftChar];
|
|
3776
|
+
}
|
|
3777
|
+
wrapWithStyleColors(styleProperty, content) {
|
|
3778
|
+
if (this[styleProperty] && this[styleProperty].length) try {
|
|
3779
|
+
let colors$2 = require_safe();
|
|
3780
|
+
for (let i = this[styleProperty].length - 1; i >= 0; i--) colors$2 = colors$2[this[styleProperty][i]];
|
|
3781
|
+
return colors$2(content);
|
|
3782
|
+
} catch (e) {
|
|
3783
|
+
return content;
|
|
3784
|
+
}
|
|
3785
|
+
else return content;
|
|
3786
|
+
}
|
|
3787
|
+
drawLine(lineNum, drawRight, forceTruncationSymbol, spanningCell) {
|
|
3788
|
+
let left = this.chars[this.x == 0 ? "left" : "middle"];
|
|
3789
|
+
if (this.x && spanningCell && this.cells) {
|
|
3790
|
+
let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
|
|
3791
|
+
while (cellLeft instanceof ColSpanCell$1) cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
|
|
3792
|
+
if (!(cellLeft instanceof RowSpanCell$1)) left = this.chars["rightMid"];
|
|
3793
|
+
}
|
|
3794
|
+
let leftPadding = utils$1.repeat(" ", this.paddingLeft);
|
|
3795
|
+
let right = drawRight ? this.chars["right"] : "";
|
|
3796
|
+
let rightPadding = utils$1.repeat(" ", this.paddingRight);
|
|
3797
|
+
let line = this.lines[lineNum];
|
|
3798
|
+
let len = this.width - (this.paddingLeft + this.paddingRight);
|
|
3799
|
+
if (forceTruncationSymbol) line += this.truncate || "…";
|
|
3800
|
+
let content = utils$1.truncate(line, len, this.truncate);
|
|
3801
|
+
content = utils$1.pad(content, len, " ", this.hAlign);
|
|
3802
|
+
content = leftPadding + content + rightPadding;
|
|
3803
|
+
return this.stylizeLine(left, content, right);
|
|
3804
|
+
}
|
|
3805
|
+
stylizeLine(left, content, right) {
|
|
3806
|
+
left = this.wrapWithStyleColors("border", left);
|
|
3807
|
+
right = this.wrapWithStyleColors("border", right);
|
|
3808
|
+
if (this.y === 0) content = this.wrapWithStyleColors("head", content);
|
|
3809
|
+
return left + content + right;
|
|
3810
|
+
}
|
|
3811
|
+
drawBottom(drawRight) {
|
|
3812
|
+
let left = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"];
|
|
3813
|
+
let content = utils$1.repeat(this.chars.bottom, this.width);
|
|
3814
|
+
let right = drawRight ? this.chars["bottomRight"] : "";
|
|
3815
|
+
return this.wrapWithStyleColors("border", left + content + right);
|
|
3816
|
+
}
|
|
3817
|
+
drawEmpty(drawRight, spanningCell) {
|
|
3818
|
+
let left = this.chars[this.x == 0 ? "left" : "middle"];
|
|
3819
|
+
if (this.x && spanningCell && this.cells) {
|
|
3820
|
+
let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
|
|
3821
|
+
while (cellLeft instanceof ColSpanCell$1) cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
|
|
3822
|
+
if (!(cellLeft instanceof RowSpanCell$1)) left = this.chars["rightMid"];
|
|
3823
|
+
}
|
|
3824
|
+
let right = drawRight ? this.chars["right"] : "";
|
|
3825
|
+
let content = utils$1.repeat(" ", this.width);
|
|
3826
|
+
return this.stylizeLine(left, content, right);
|
|
3827
|
+
}
|
|
3828
|
+
};
|
|
3829
|
+
var ColSpanCell$1 = class {
|
|
3830
|
+
constructor() {}
|
|
3831
|
+
draw(lineNum) {
|
|
3832
|
+
if (typeof lineNum === "number") debug$2(`${this.y}-${this.x}: 1x1 ColSpanCell`);
|
|
3833
|
+
return "";
|
|
3834
|
+
}
|
|
3835
|
+
init() {}
|
|
3836
|
+
mergeTableOptions() {}
|
|
3837
|
+
};
|
|
3838
|
+
var RowSpanCell$1 = class {
|
|
3839
|
+
constructor(originalCell) {
|
|
3840
|
+
this.originalCell = originalCell;
|
|
3841
|
+
}
|
|
3842
|
+
init(tableOptions) {
|
|
3843
|
+
let y$1 = this.y;
|
|
3844
|
+
let originalY = this.originalCell.y;
|
|
3845
|
+
this.cellOffset = y$1 - originalY;
|
|
3846
|
+
this.offset = findDimension(tableOptions.rowHeights, originalY, this.cellOffset);
|
|
3847
|
+
}
|
|
3848
|
+
draw(lineNum) {
|
|
3849
|
+
if (lineNum == "top") return this.originalCell.draw(this.offset, this.cellOffset);
|
|
3850
|
+
if (lineNum == "bottom") return this.originalCell.draw("bottom");
|
|
3851
|
+
debug$2(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`);
|
|
3852
|
+
return this.originalCell.draw(this.offset + 1 + lineNum);
|
|
3853
|
+
}
|
|
3854
|
+
mergeTableOptions() {}
|
|
3855
|
+
};
|
|
3856
|
+
function firstDefined(...args) {
|
|
3857
|
+
return args.filter((v$1) => v$1 !== void 0 && v$1 !== null).shift();
|
|
3858
|
+
}
|
|
3859
|
+
function setOption(objA, objB, nameB, targetObj) {
|
|
3860
|
+
let nameA = nameB.split("-");
|
|
3861
|
+
if (nameA.length > 1) {
|
|
3862
|
+
nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);
|
|
3863
|
+
nameA = nameA.join("");
|
|
3864
|
+
targetObj[nameA] = firstDefined(objA[nameA], objA[nameB], objB[nameA], objB[nameB]);
|
|
3865
|
+
} else targetObj[nameB] = firstDefined(objA[nameB], objB[nameB]);
|
|
3866
|
+
}
|
|
3867
|
+
function findDimension(dimensionTable, startingIndex, span) {
|
|
3868
|
+
let ret = dimensionTable[startingIndex];
|
|
3869
|
+
for (let i = 1; i < span; i++) ret += 1 + dimensionTable[startingIndex + i];
|
|
3870
|
+
return ret;
|
|
3871
|
+
}
|
|
3872
|
+
function sumPlusOne(a$1, b$1) {
|
|
3873
|
+
return a$1 + b$1 + 1;
|
|
3874
|
+
}
|
|
3875
|
+
let CHAR_NAMES = [
|
|
3876
|
+
"top",
|
|
3877
|
+
"top-mid",
|
|
3878
|
+
"top-left",
|
|
3879
|
+
"top-right",
|
|
3880
|
+
"bottom",
|
|
3881
|
+
"bottom-mid",
|
|
3882
|
+
"bottom-left",
|
|
3883
|
+
"bottom-right",
|
|
3884
|
+
"left",
|
|
3885
|
+
"left-mid",
|
|
3886
|
+
"mid",
|
|
3887
|
+
"mid-mid",
|
|
3888
|
+
"right",
|
|
3889
|
+
"right-mid",
|
|
3890
|
+
"middle"
|
|
3891
|
+
];
|
|
3892
|
+
module.exports = Cell$1;
|
|
3893
|
+
module.exports.ColSpanCell = ColSpanCell$1;
|
|
3894
|
+
module.exports.RowSpanCell = RowSpanCell$1;
|
|
3895
|
+
}));
|
|
3896
|
+
var require_layout_manager = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3897
|
+
const { warn, debug: debug$1 } = require_debug();
|
|
3898
|
+
const Cell = require_cell();
|
|
3899
|
+
const { ColSpanCell, RowSpanCell } = Cell;
|
|
3900
|
+
(function() {
|
|
3901
|
+
function next(alloc, col) {
|
|
3902
|
+
if (alloc[col] > 0) return next(alloc, col + 1);
|
|
3903
|
+
return col;
|
|
3904
|
+
}
|
|
3905
|
+
function layoutTable(table) {
|
|
3906
|
+
let alloc = {};
|
|
3907
|
+
table.forEach(function(row, rowIndex) {
|
|
3908
|
+
let col = 0;
|
|
3909
|
+
row.forEach(function(cell) {
|
|
3910
|
+
cell.y = rowIndex;
|
|
3911
|
+
cell.x = rowIndex ? next(alloc, col) : col;
|
|
3912
|
+
const rowSpan = cell.rowSpan || 1;
|
|
3913
|
+
const colSpan = cell.colSpan || 1;
|
|
3914
|
+
if (rowSpan > 1) for (let cs = 0; cs < colSpan; cs++) alloc[cell.x + cs] = rowSpan;
|
|
3915
|
+
col = cell.x + colSpan;
|
|
3916
|
+
});
|
|
3917
|
+
Object.keys(alloc).forEach((idx) => {
|
|
3918
|
+
alloc[idx]--;
|
|
3919
|
+
if (alloc[idx] < 1) delete alloc[idx];
|
|
3920
|
+
});
|
|
3921
|
+
});
|
|
3922
|
+
}
|
|
3923
|
+
function maxWidth(table) {
|
|
3924
|
+
let mw = 0;
|
|
3925
|
+
table.forEach(function(row) {
|
|
3926
|
+
row.forEach(function(cell) {
|
|
3927
|
+
mw = Math.max(mw, cell.x + (cell.colSpan || 1));
|
|
3928
|
+
});
|
|
3929
|
+
});
|
|
3930
|
+
return mw;
|
|
3931
|
+
}
|
|
3932
|
+
function maxHeight(table) {
|
|
3933
|
+
return table.length;
|
|
3934
|
+
}
|
|
3935
|
+
function cellsConflict(cell1, cell2) {
|
|
3936
|
+
let yMin1 = cell1.y;
|
|
3937
|
+
let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
|
|
3938
|
+
let yMin2 = cell2.y;
|
|
3939
|
+
let yConflict = !(yMin1 > cell2.y - 1 + (cell2.rowSpan || 1) || yMin2 > yMax1);
|
|
3940
|
+
let xMin1 = cell1.x;
|
|
3941
|
+
let xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
|
|
3942
|
+
let xMin2 = cell2.x;
|
|
3943
|
+
let xConflict = !(xMin1 > cell2.x - 1 + (cell2.colSpan || 1) || xMin2 > xMax1);
|
|
3944
|
+
return yConflict && xConflict;
|
|
3945
|
+
}
|
|
3946
|
+
function conflictExists(rows, x, y$1) {
|
|
3947
|
+
let i_max = Math.min(rows.length - 1, y$1);
|
|
3948
|
+
let cell = {
|
|
3949
|
+
x,
|
|
3950
|
+
y: y$1
|
|
3951
|
+
};
|
|
3952
|
+
for (let i = 0; i <= i_max; i++) {
|
|
3953
|
+
let row = rows[i];
|
|
3954
|
+
for (let j$1 = 0; j$1 < row.length; j$1++) if (cellsConflict(cell, row[j$1])) return true;
|
|
3955
|
+
}
|
|
3956
|
+
return false;
|
|
3957
|
+
}
|
|
3958
|
+
function allBlank(rows, y$1, xMin, xMax) {
|
|
3959
|
+
for (let x = xMin; x < xMax; x++) if (conflictExists(rows, x, y$1)) return false;
|
|
3960
|
+
return true;
|
|
3961
|
+
}
|
|
3962
|
+
function addRowSpanCells(table) {
|
|
3963
|
+
table.forEach(function(row, rowIndex) {
|
|
3964
|
+
row.forEach(function(cell) {
|
|
3965
|
+
for (let i = 1; i < cell.rowSpan; i++) {
|
|
3966
|
+
let rowSpanCell = new RowSpanCell(cell);
|
|
3967
|
+
rowSpanCell.x = cell.x;
|
|
3968
|
+
rowSpanCell.y = cell.y + i;
|
|
3969
|
+
rowSpanCell.colSpan = cell.colSpan;
|
|
3970
|
+
insertCell(rowSpanCell, table[rowIndex + i]);
|
|
3971
|
+
}
|
|
3972
|
+
});
|
|
3973
|
+
});
|
|
3974
|
+
}
|
|
3975
|
+
function addColSpanCells(cellRows) {
|
|
3976
|
+
for (let rowIndex = cellRows.length - 1; rowIndex >= 0; rowIndex--) {
|
|
3977
|
+
let cellColumns = cellRows[rowIndex];
|
|
3978
|
+
for (let columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) {
|
|
3979
|
+
let cell = cellColumns[columnIndex];
|
|
3980
|
+
for (let k$1 = 1; k$1 < cell.colSpan; k$1++) {
|
|
3981
|
+
let colSpanCell = new ColSpanCell();
|
|
3982
|
+
colSpanCell.x = cell.x + k$1;
|
|
3983
|
+
colSpanCell.y = cell.y;
|
|
3984
|
+
cellColumns.splice(columnIndex + 1, 0, colSpanCell);
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
}
|
|
3988
|
+
}
|
|
3989
|
+
function insertCell(cell, row) {
|
|
3990
|
+
let x = 0;
|
|
3991
|
+
while (x < row.length && row[x].x < cell.x) x++;
|
|
3992
|
+
row.splice(x, 0, cell);
|
|
3993
|
+
}
|
|
3994
|
+
function fillInTable(table) {
|
|
3995
|
+
let h_max = maxHeight(table);
|
|
3996
|
+
let w_max = maxWidth(table);
|
|
3997
|
+
debug$1(`Max rows: ${h_max}; Max cols: ${w_max}`);
|
|
3998
|
+
for (let y$1 = 0; y$1 < h_max; y$1++) for (let x = 0; x < w_max; x++) if (!conflictExists(table, x, y$1)) {
|
|
3999
|
+
let opts = {
|
|
4000
|
+
x,
|
|
4001
|
+
y: y$1,
|
|
4002
|
+
colSpan: 1,
|
|
4003
|
+
rowSpan: 1
|
|
4004
|
+
};
|
|
4005
|
+
x++;
|
|
4006
|
+
while (x < w_max && !conflictExists(table, x, y$1)) {
|
|
4007
|
+
opts.colSpan++;
|
|
4008
|
+
x++;
|
|
4009
|
+
}
|
|
4010
|
+
let y2 = y$1 + 1;
|
|
4011
|
+
while (y2 < h_max && allBlank(table, y2, opts.x, opts.x + opts.colSpan)) {
|
|
4012
|
+
opts.rowSpan++;
|
|
4013
|
+
y2++;
|
|
4014
|
+
}
|
|
4015
|
+
let cell = new Cell(opts);
|
|
4016
|
+
cell.x = opts.x;
|
|
4017
|
+
cell.y = opts.y;
|
|
4018
|
+
warn(`Missing cell at ${cell.y}-${cell.x}.`);
|
|
4019
|
+
insertCell(cell, table[y$1]);
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
function generateCells(rows) {
|
|
4023
|
+
return rows.map(function(row) {
|
|
4024
|
+
if (!Array.isArray(row)) {
|
|
4025
|
+
let key = Object.keys(row)[0];
|
|
4026
|
+
row = row[key];
|
|
4027
|
+
if (Array.isArray(row)) {
|
|
4028
|
+
row = row.slice();
|
|
4029
|
+
row.unshift(key);
|
|
4030
|
+
} else row = [key, row];
|
|
4031
|
+
}
|
|
4032
|
+
return row.map(function(cell) {
|
|
4033
|
+
return new Cell(cell);
|
|
4034
|
+
});
|
|
4035
|
+
});
|
|
4036
|
+
}
|
|
4037
|
+
function makeTableLayout(rows) {
|
|
4038
|
+
let cellRows = generateCells(rows);
|
|
4039
|
+
layoutTable(cellRows);
|
|
4040
|
+
fillInTable(cellRows);
|
|
4041
|
+
addRowSpanCells(cellRows);
|
|
4042
|
+
addColSpanCells(cellRows);
|
|
4043
|
+
return cellRows;
|
|
4044
|
+
}
|
|
4045
|
+
module.exports = {
|
|
4046
|
+
makeTableLayout,
|
|
4047
|
+
layoutTable,
|
|
4048
|
+
addRowSpanCells,
|
|
4049
|
+
maxWidth,
|
|
4050
|
+
fillInTable,
|
|
4051
|
+
computeWidths: makeComputeWidths("colSpan", "desiredWidth", "x", 1),
|
|
4052
|
+
computeHeights: makeComputeWidths("rowSpan", "desiredHeight", "y", 1)
|
|
4053
|
+
};
|
|
4054
|
+
})();
|
|
4055
|
+
function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {
|
|
4056
|
+
return function(vals, table) {
|
|
4057
|
+
let result = [];
|
|
4058
|
+
let spanners = [];
|
|
4059
|
+
let auto = {};
|
|
4060
|
+
table.forEach(function(row) {
|
|
4061
|
+
row.forEach(function(cell) {
|
|
4062
|
+
if ((cell[colSpan] || 1) > 1) spanners.push(cell);
|
|
4063
|
+
else result[cell[x]] = Math.max(result[cell[x]] || 0, cell[desiredWidth] || 0, forcedMin);
|
|
4064
|
+
});
|
|
4065
|
+
});
|
|
4066
|
+
vals.forEach(function(val, index) {
|
|
4067
|
+
if (typeof val === "number") result[index] = val;
|
|
4068
|
+
});
|
|
4069
|
+
for (let k$1 = spanners.length - 1; k$1 >= 0; k$1--) {
|
|
4070
|
+
let cell = spanners[k$1];
|
|
4071
|
+
let span = cell[colSpan];
|
|
4072
|
+
let col = cell[x];
|
|
4073
|
+
let existingWidth = result[col];
|
|
4074
|
+
let editableCols = typeof vals[col] === "number" ? 0 : 1;
|
|
4075
|
+
if (typeof existingWidth === "number") for (let i = 1; i < span; i++) {
|
|
4076
|
+
existingWidth += 1 + result[col + i];
|
|
4077
|
+
if (typeof vals[col + i] !== "number") editableCols++;
|
|
4078
|
+
}
|
|
4079
|
+
else {
|
|
4080
|
+
existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1;
|
|
4081
|
+
if (!auto[col] || auto[col] < existingWidth) auto[col] = existingWidth;
|
|
4082
|
+
}
|
|
4083
|
+
if (cell[desiredWidth] > existingWidth) {
|
|
4084
|
+
let i = 0;
|
|
4085
|
+
while (editableCols > 0 && cell[desiredWidth] > existingWidth) {
|
|
4086
|
+
if (typeof vals[col + i] !== "number") {
|
|
4087
|
+
let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);
|
|
4088
|
+
existingWidth += dif;
|
|
4089
|
+
result[col + i] += dif;
|
|
4090
|
+
editableCols--;
|
|
4091
|
+
}
|
|
4092
|
+
i++;
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
Object.assign(vals, result, auto);
|
|
4097
|
+
for (let j$1 = 0; j$1 < vals.length; j$1++) vals[j$1] = Math.max(forcedMin, vals[j$1] || 0);
|
|
4098
|
+
};
|
|
4099
|
+
}
|
|
4100
|
+
}));
|
|
4101
|
+
var require_table = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4102
|
+
const debug = require_debug();
|
|
4103
|
+
const utils = require_utils();
|
|
4104
|
+
const tableLayout = require_layout_manager();
|
|
4105
|
+
var Table$1 = class extends Array {
|
|
4106
|
+
constructor(opts) {
|
|
4107
|
+
super();
|
|
4108
|
+
const options = utils.mergeOptions(opts);
|
|
4109
|
+
Object.defineProperty(this, "options", {
|
|
4110
|
+
value: options,
|
|
4111
|
+
enumerable: options.debug
|
|
4112
|
+
});
|
|
4113
|
+
if (options.debug) {
|
|
4114
|
+
switch (typeof options.debug) {
|
|
4115
|
+
case "boolean":
|
|
4116
|
+
debug.setDebugLevel(debug.WARN);
|
|
4117
|
+
break;
|
|
4118
|
+
case "number":
|
|
4119
|
+
debug.setDebugLevel(options.debug);
|
|
4120
|
+
break;
|
|
4121
|
+
case "string":
|
|
4122
|
+
debug.setDebugLevel(parseInt(options.debug, 10));
|
|
4123
|
+
break;
|
|
4124
|
+
default:
|
|
4125
|
+
debug.setDebugLevel(debug.WARN);
|
|
4126
|
+
debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options.debug}`);
|
|
4127
|
+
}
|
|
4128
|
+
Object.defineProperty(this, "messages", { get() {
|
|
4129
|
+
return debug.debugMessages();
|
|
4130
|
+
} });
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
toString() {
|
|
4134
|
+
let array$1 = this;
|
|
4135
|
+
let headersPresent = this.options.head && this.options.head.length;
|
|
4136
|
+
if (headersPresent) {
|
|
4137
|
+
array$1 = [this.options.head];
|
|
4138
|
+
if (this.length) array$1.push.apply(array$1, this);
|
|
4139
|
+
} else this.options.style.head = [];
|
|
4140
|
+
let cells = tableLayout.makeTableLayout(array$1);
|
|
4141
|
+
cells.forEach(function(row) {
|
|
4142
|
+
row.forEach(function(cell) {
|
|
4143
|
+
cell.mergeTableOptions(this.options, cells);
|
|
4144
|
+
}, this);
|
|
4145
|
+
}, this);
|
|
4146
|
+
tableLayout.computeWidths(this.options.colWidths, cells);
|
|
4147
|
+
tableLayout.computeHeights(this.options.rowHeights, cells);
|
|
4148
|
+
cells.forEach(function(row) {
|
|
4149
|
+
row.forEach(function(cell) {
|
|
4150
|
+
cell.init(this.options);
|
|
4151
|
+
}, this);
|
|
4152
|
+
}, this);
|
|
4153
|
+
let result = [];
|
|
4154
|
+
for (let rowIndex = 0; rowIndex < cells.length; rowIndex++) {
|
|
4155
|
+
let row = cells[rowIndex];
|
|
4156
|
+
let heightOfRow = this.options.rowHeights[rowIndex];
|
|
4157
|
+
if (rowIndex === 0 || !this.options.style.compact || rowIndex == 1 && headersPresent) doDraw(row, "top", result);
|
|
4158
|
+
for (let lineNum = 0; lineNum < heightOfRow; lineNum++) doDraw(row, lineNum, result);
|
|
4159
|
+
if (rowIndex + 1 == cells.length) doDraw(row, "bottom", result);
|
|
4160
|
+
}
|
|
4161
|
+
return result.join("\n");
|
|
4162
|
+
}
|
|
4163
|
+
get width() {
|
|
4164
|
+
return this.toString().split("\n")[0].length;
|
|
4165
|
+
}
|
|
4166
|
+
};
|
|
4167
|
+
Table$1.reset = () => debug.reset();
|
|
4168
|
+
function doDraw(row, lineNum, result) {
|
|
4169
|
+
let line = [];
|
|
4170
|
+
row.forEach(function(cell) {
|
|
4171
|
+
line.push(cell.draw(lineNum));
|
|
4172
|
+
});
|
|
4173
|
+
let str = line.join("");
|
|
4174
|
+
if (str.length) result.push(str);
|
|
4175
|
+
}
|
|
4176
|
+
module.exports = Table$1;
|
|
4177
|
+
}));
|
|
4178
|
+
var require_cli_table3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4179
|
+
module.exports = require_table();
|
|
4180
|
+
}));
|
|
4181
|
+
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4182
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
4183
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
4184
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
4185
|
+
let string$1 = "" + input, index = string$1.indexOf(close, open.length);
|
|
4186
|
+
return ~index ? open + replaceClose(string$1, close, replace, index) + close : open + string$1 + close;
|
|
4187
|
+
};
|
|
4188
|
+
let replaceClose = (string$1, close, replace, index) => {
|
|
4189
|
+
let result = "", cursor = 0;
|
|
4190
|
+
do {
|
|
4191
|
+
result += string$1.substring(cursor, index) + replace;
|
|
4192
|
+
cursor = index + close.length;
|
|
4193
|
+
index = string$1.indexOf(close, cursor);
|
|
4194
|
+
} while (~index);
|
|
4195
|
+
return result + string$1.substring(cursor);
|
|
4196
|
+
};
|
|
4197
|
+
let createColors = (enabled = isColorSupported) => {
|
|
4198
|
+
let f$2 = enabled ? formatter : () => String;
|
|
4199
|
+
return {
|
|
4200
|
+
isColorSupported: enabled,
|
|
4201
|
+
reset: f$2("\x1B[0m", "\x1B[0m"),
|
|
4202
|
+
bold: f$2("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
4203
|
+
dim: f$2("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
4204
|
+
italic: f$2("\x1B[3m", "\x1B[23m"),
|
|
4205
|
+
underline: f$2("\x1B[4m", "\x1B[24m"),
|
|
4206
|
+
inverse: f$2("\x1B[7m", "\x1B[27m"),
|
|
4207
|
+
hidden: f$2("\x1B[8m", "\x1B[28m"),
|
|
4208
|
+
strikethrough: f$2("\x1B[9m", "\x1B[29m"),
|
|
4209
|
+
black: f$2("\x1B[30m", "\x1B[39m"),
|
|
4210
|
+
red: f$2("\x1B[31m", "\x1B[39m"),
|
|
4211
|
+
green: f$2("\x1B[32m", "\x1B[39m"),
|
|
4212
|
+
yellow: f$2("\x1B[33m", "\x1B[39m"),
|
|
4213
|
+
blue: f$2("\x1B[34m", "\x1B[39m"),
|
|
4214
|
+
magenta: f$2("\x1B[35m", "\x1B[39m"),
|
|
4215
|
+
cyan: f$2("\x1B[36m", "\x1B[39m"),
|
|
4216
|
+
white: f$2("\x1B[37m", "\x1B[39m"),
|
|
4217
|
+
gray: f$2("\x1B[90m", "\x1B[39m"),
|
|
4218
|
+
bgBlack: f$2("\x1B[40m", "\x1B[49m"),
|
|
4219
|
+
bgRed: f$2("\x1B[41m", "\x1B[49m"),
|
|
4220
|
+
bgGreen: f$2("\x1B[42m", "\x1B[49m"),
|
|
4221
|
+
bgYellow: f$2("\x1B[43m", "\x1B[49m"),
|
|
4222
|
+
bgBlue: f$2("\x1B[44m", "\x1B[49m"),
|
|
4223
|
+
bgMagenta: f$2("\x1B[45m", "\x1B[49m"),
|
|
4224
|
+
bgCyan: f$2("\x1B[46m", "\x1B[49m"),
|
|
4225
|
+
bgWhite: f$2("\x1B[47m", "\x1B[49m"),
|
|
4226
|
+
blackBright: f$2("\x1B[90m", "\x1B[39m"),
|
|
4227
|
+
redBright: f$2("\x1B[91m", "\x1B[39m"),
|
|
4228
|
+
greenBright: f$2("\x1B[92m", "\x1B[39m"),
|
|
4229
|
+
yellowBright: f$2("\x1B[93m", "\x1B[39m"),
|
|
4230
|
+
blueBright: f$2("\x1B[94m", "\x1B[39m"),
|
|
4231
|
+
magentaBright: f$2("\x1B[95m", "\x1B[39m"),
|
|
4232
|
+
cyanBright: f$2("\x1B[96m", "\x1B[39m"),
|
|
4233
|
+
whiteBright: f$2("\x1B[97m", "\x1B[39m"),
|
|
4234
|
+
bgBlackBright: f$2("\x1B[100m", "\x1B[49m"),
|
|
4235
|
+
bgRedBright: f$2("\x1B[101m", "\x1B[49m"),
|
|
4236
|
+
bgGreenBright: f$2("\x1B[102m", "\x1B[49m"),
|
|
4237
|
+
bgYellowBright: f$2("\x1B[103m", "\x1B[49m"),
|
|
4238
|
+
bgBlueBright: f$2("\x1B[104m", "\x1B[49m"),
|
|
4239
|
+
bgMagentaBright: f$2("\x1B[105m", "\x1B[49m"),
|
|
4240
|
+
bgCyanBright: f$2("\x1B[106m", "\x1B[49m"),
|
|
4241
|
+
bgWhiteBright: f$2("\x1B[107m", "\x1B[49m")
|
|
4242
|
+
};
|
|
4243
|
+
};
|
|
4244
|
+
module.exports = createColors();
|
|
4245
|
+
module.exports.createColors = createColors;
|
|
4246
|
+
}));
|
|
4247
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
4248
|
+
return new RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`, onlyFirst ? void 0 : "g");
|
|
4249
|
+
}
|
|
4250
|
+
const regex = ansiRegex();
|
|
4251
|
+
function stripAnsi(string$1) {
|
|
4252
|
+
if (typeof string$1 !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string$1}\``);
|
|
4253
|
+
return string$1.replace(regex, "");
|
|
4254
|
+
}
|
|
4255
|
+
function isAmbiguous(x) {
|
|
4256
|
+
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;
|
|
4257
|
+
}
|
|
4258
|
+
function isFullWidth(x) {
|
|
4259
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
4260
|
+
}
|
|
4261
|
+
function isWide(x) {
|
|
4262
|
+
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 <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || 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 <= 128728 || 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 <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
4263
|
+
}
|
|
4264
|
+
function validate(codePoint) {
|
|
4265
|
+
if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
4266
|
+
}
|
|
4267
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
4268
|
+
validate(codePoint);
|
|
4269
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
|
|
4270
|
+
return 1;
|
|
4271
|
+
}
|
|
4272
|
+
var import_emoji_regex = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4273
|
+
module.exports = () => {
|
|
4274
|
+
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-\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-\uDED8\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\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\uDD3C-\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-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\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\uDE70]|\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\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;
|
|
4275
|
+
};
|
|
4276
|
+
})))(), 1);
|
|
4277
|
+
const segmenter = new Intl.Segmenter();
|
|
4278
|
+
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
4279
|
+
function stringWidth(string$1, options = {}) {
|
|
4280
|
+
if (typeof string$1 !== "string" || string$1.length === 0) return 0;
|
|
4281
|
+
const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
|
|
4282
|
+
if (!countAnsiEscapeCodes) string$1 = stripAnsi(string$1);
|
|
4283
|
+
if (string$1.length === 0) return 0;
|
|
4284
|
+
let width = 0;
|
|
4285
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
4286
|
+
for (const { segment: character } of segmenter.segment(string$1)) {
|
|
4287
|
+
const codePoint = character.codePointAt(0);
|
|
4288
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
|
|
4289
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
|
|
4290
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
|
|
4291
|
+
if (codePoint >= 55296 && codePoint <= 57343) continue;
|
|
4292
|
+
if (codePoint >= 65024 && codePoint <= 65039) continue;
|
|
4293
|
+
if (defaultIgnorableCodePointRegex.test(character)) continue;
|
|
4294
|
+
if ((0, import_emoji_regex.default)().test(character)) {
|
|
4295
|
+
width += 2;
|
|
4296
|
+
continue;
|
|
4297
|
+
}
|
|
4298
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
4299
|
+
}
|
|
4300
|
+
return width;
|
|
4301
|
+
}
|
|
4302
|
+
var import_cli_table3 = /* @__PURE__ */ __toESM(require_cli_table3(), 1);
|
|
4303
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
4304
|
+
const DEFAULT_LOCALE$1 = "en-CA";
|
|
4305
|
+
function createDatePartsFormatter(timezone, locale) {
|
|
2660
4306
|
return new Intl.DateTimeFormat(locale, {
|
|
2661
4307
|
year: "numeric",
|
|
2662
4308
|
month: "2-digit",
|
|
@@ -2664,7 +4310,258 @@ function createDateFormatter(timezone, locale) {
|
|
|
2664
4310
|
timeZone: timezone
|
|
2665
4311
|
});
|
|
2666
4312
|
}
|
|
2667
|
-
function
|
|
4313
|
+
function formatDateCompact(dateStr, timezone, locale) {
|
|
4314
|
+
const date = /^\d{4}-\d{2}-\d{2}$/.test(dateStr) ? timezone != null ? /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`) : /* @__PURE__ */ new Date(`${dateStr}T00:00:00`) : new Date(dateStr);
|
|
4315
|
+
const parts = createDatePartsFormatter(timezone, locale ?? DEFAULT_LOCALE$1).formatToParts(date);
|
|
4316
|
+
return `${parts.find((p$1) => p$1.type === "year")?.value ?? ""}\n${parts.find((p$1) => p$1.type === "month")?.value ?? ""}-${parts.find((p$1) => p$1.type === "day")?.value ?? ""}`;
|
|
4317
|
+
}
|
|
4318
|
+
var ResponsiveTable = class {
|
|
4319
|
+
head;
|
|
4320
|
+
rows = [];
|
|
4321
|
+
colAligns;
|
|
4322
|
+
style;
|
|
4323
|
+
dateFormatter;
|
|
4324
|
+
compactHead;
|
|
4325
|
+
compactColAligns;
|
|
4326
|
+
compactThreshold;
|
|
4327
|
+
compactMode = false;
|
|
4328
|
+
forceCompact;
|
|
4329
|
+
logger;
|
|
4330
|
+
constructor(options) {
|
|
4331
|
+
this.head = options.head;
|
|
4332
|
+
this.colAligns = options.colAligns ?? Array.from({ length: this.head.length }, () => "left");
|
|
4333
|
+
this.style = options.style;
|
|
4334
|
+
this.dateFormatter = options.dateFormatter;
|
|
4335
|
+
this.compactHead = options.compactHead;
|
|
4336
|
+
this.compactColAligns = options.compactColAligns;
|
|
4337
|
+
this.compactThreshold = options.compactThreshold ?? 100;
|
|
4338
|
+
this.forceCompact = options.forceCompact ?? false;
|
|
4339
|
+
this.logger = options.logger ?? console.warn;
|
|
4340
|
+
}
|
|
4341
|
+
push(row) {
|
|
4342
|
+
this.rows.push(row);
|
|
4343
|
+
}
|
|
4344
|
+
filterRowToCompact(row, compactIndices) {
|
|
4345
|
+
return compactIndices.map((index) => row[index] ?? "");
|
|
4346
|
+
}
|
|
4347
|
+
getCurrentTableConfig() {
|
|
4348
|
+
if (this.compactMode && this.compactHead != null && this.compactColAligns != null) return {
|
|
4349
|
+
head: this.compactHead,
|
|
4350
|
+
colAligns: this.compactColAligns
|
|
4351
|
+
};
|
|
4352
|
+
return {
|
|
4353
|
+
head: this.head,
|
|
4354
|
+
colAligns: this.colAligns
|
|
4355
|
+
};
|
|
4356
|
+
}
|
|
4357
|
+
getCompactIndices() {
|
|
4358
|
+
if (this.compactHead == null || !this.compactMode) return Array.from({ length: this.head.length }, (_, i) => i);
|
|
4359
|
+
return this.compactHead.map((compactHeader) => {
|
|
4360
|
+
const index = this.head.indexOf(compactHeader);
|
|
4361
|
+
if (index < 0) {
|
|
4362
|
+
this.logger(`Warning: Compact header "${compactHeader}" not found in table headers [${this.head.join(", ")}]. Using first column as fallback.`);
|
|
4363
|
+
return 0;
|
|
4364
|
+
}
|
|
4365
|
+
return index;
|
|
4366
|
+
});
|
|
4367
|
+
}
|
|
4368
|
+
isCompactMode() {
|
|
4369
|
+
return this.compactMode;
|
|
4370
|
+
}
|
|
4371
|
+
toString() {
|
|
4372
|
+
const terminalWidth = Number.parseInt(process$1.env.COLUMNS ?? "", 10) || process$1.stdout.columns || 120;
|
|
4373
|
+
this.compactMode = this.forceCompact || terminalWidth < this.compactThreshold && this.compactHead != null;
|
|
4374
|
+
const { head, colAligns } = this.getCurrentTableConfig();
|
|
4375
|
+
const compactIndices = this.getCompactIndices();
|
|
4376
|
+
const dataRows = this.rows.filter((row) => !this.isSeparatorRow(row));
|
|
4377
|
+
const processedDataRows = this.compactMode ? dataRows.map((row) => this.filterRowToCompact(row, compactIndices)) : dataRows;
|
|
4378
|
+
const allRows = [head.map(String), ...processedDataRows.map((row) => row.map((cell) => {
|
|
4379
|
+
if (typeof cell === "object" && cell != null && "content" in cell) return String(cell.content);
|
|
4380
|
+
return String(cell ?? "");
|
|
4381
|
+
}))];
|
|
4382
|
+
const contentWidths = head.map((_, colIndex) => {
|
|
4383
|
+
return Math.max(...allRows.map((row) => stringWidth(String(row[colIndex] ?? ""))));
|
|
4384
|
+
});
|
|
4385
|
+
const tableOverhead = 3 * head.length + 1;
|
|
4386
|
+
const availableWidth = terminalWidth - tableOverhead;
|
|
4387
|
+
const columnWidths = contentWidths.map((width, index) => {
|
|
4388
|
+
if (colAligns[index] === "right") return Math.max(width + 3, 11);
|
|
4389
|
+
else if (index === 1) return Math.max(width + 2, 15);
|
|
4390
|
+
return Math.max(width + 2, 10);
|
|
4391
|
+
});
|
|
4392
|
+
if (columnWidths.reduce((sum, width) => sum + width, 0) + tableOverhead > terminalWidth) {
|
|
4393
|
+
const scaleFactor = availableWidth / columnWidths.reduce((sum, width) => sum + width, 0);
|
|
4394
|
+
const adjustedWidths = columnWidths.map((width, index) => {
|
|
4395
|
+
const align = colAligns[index];
|
|
4396
|
+
let adjustedWidth = Math.floor(width * scaleFactor);
|
|
4397
|
+
if (align === "right") adjustedWidth = Math.max(adjustedWidth, 10);
|
|
4398
|
+
else if (index === 0) adjustedWidth = Math.max(adjustedWidth, 10);
|
|
4399
|
+
else if (index === 1) adjustedWidth = Math.max(adjustedWidth, 12);
|
|
4400
|
+
else adjustedWidth = Math.max(adjustedWidth, 8);
|
|
4401
|
+
return adjustedWidth;
|
|
4402
|
+
});
|
|
4403
|
+
const table = new import_cli_table3.default({
|
|
4404
|
+
head,
|
|
4405
|
+
style: this.style,
|
|
4406
|
+
colAligns,
|
|
4407
|
+
colWidths: adjustedWidths,
|
|
4408
|
+
wordWrap: true,
|
|
4409
|
+
wrapOnWordBoundary: true
|
|
4410
|
+
});
|
|
4411
|
+
for (const row of this.rows) if (this.isSeparatorRow(row)) continue;
|
|
4412
|
+
else {
|
|
4413
|
+
let processedRow = row.map((cell, index) => {
|
|
4414
|
+
if (index === 0 && this.dateFormatter != null && typeof cell === "string" && this.isDateString(cell)) return this.dateFormatter(cell);
|
|
4415
|
+
return cell;
|
|
4416
|
+
});
|
|
4417
|
+
if (this.compactMode) processedRow = this.filterRowToCompact(processedRow, compactIndices);
|
|
4418
|
+
table.push(processedRow);
|
|
4419
|
+
}
|
|
4420
|
+
return table.toString();
|
|
4421
|
+
} else {
|
|
4422
|
+
const table = new import_cli_table3.default({
|
|
4423
|
+
head,
|
|
4424
|
+
style: this.style,
|
|
4425
|
+
colAligns,
|
|
4426
|
+
colWidths: columnWidths,
|
|
4427
|
+
wordWrap: true,
|
|
4428
|
+
wrapOnWordBoundary: true
|
|
4429
|
+
});
|
|
4430
|
+
for (const row of this.rows) if (this.isSeparatorRow(row)) continue;
|
|
4431
|
+
else {
|
|
4432
|
+
const processedRow = this.compactMode ? this.filterRowToCompact(row, compactIndices) : row;
|
|
4433
|
+
table.push(processedRow);
|
|
4434
|
+
}
|
|
4435
|
+
return table.toString();
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4438
|
+
isSeparatorRow(row) {
|
|
4439
|
+
return row.every((cell) => {
|
|
4440
|
+
if (typeof cell === "object" && cell != null && "content" in cell) return cell.content === "" || /^─+$/.test(cell.content);
|
|
4441
|
+
return typeof cell === "string" && (cell === "" || /^─+$/.test(cell));
|
|
4442
|
+
});
|
|
4443
|
+
}
|
|
4444
|
+
isDateString(text) {
|
|
4445
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(text);
|
|
4446
|
+
}
|
|
4447
|
+
};
|
|
4448
|
+
function formatNumber(num) {
|
|
4449
|
+
return num.toLocaleString("en-US");
|
|
4450
|
+
}
|
|
4451
|
+
function formatCurrency(amount) {
|
|
4452
|
+
return `$${amount.toFixed(2)}`;
|
|
4453
|
+
}
|
|
4454
|
+
function formatModelName(modelName) {
|
|
4455
|
+
const piMatch = modelName.match(/^\[pi\] (.+)$/);
|
|
4456
|
+
if (piMatch?.[1] != null) return `[pi] ${formatModelName(piMatch[1])}`;
|
|
4457
|
+
const anthropicMatch = modelName.match(/^anthropic\/claude-(\w+)-([\d.]+)$/);
|
|
4458
|
+
if (anthropicMatch != null) return `${anthropicMatch[1]}-${anthropicMatch[2]}`;
|
|
4459
|
+
const match = modelName.match(/^claude-(\w+)-([\d-]+)-(\d{8})$/);
|
|
4460
|
+
if (match != null) return `${match[1]}-${match[2]}`;
|
|
4461
|
+
const noDateMatch = modelName.match(/^claude-(\w+)-([\d-]+)$/);
|
|
4462
|
+
if (noDateMatch != null) return `${noDateMatch[1]}-${noDateMatch[2]}`;
|
|
4463
|
+
return modelName;
|
|
4464
|
+
}
|
|
4465
|
+
function formatModelsDisplayMultiline(models) {
|
|
4466
|
+
return uniq(models.map(formatModelName)).sort().map((model) => `- ${model}`).join("\n");
|
|
4467
|
+
}
|
|
4468
|
+
function pushBreakdownRows(table, breakdowns, extraColumns = 1, trailingColumns = 0) {
|
|
4469
|
+
for (const breakdown of breakdowns) {
|
|
4470
|
+
const row = [` └─ ${formatModelName(breakdown.modelName)}`];
|
|
4471
|
+
for (let i = 0; i < extraColumns; i++) row.push("");
|
|
4472
|
+
const totalTokens = breakdown.inputTokens + breakdown.outputTokens + breakdown.cacheCreationTokens + breakdown.cacheReadTokens;
|
|
4473
|
+
row.push(import_picocolors.default.gray(formatNumber(breakdown.inputTokens)), import_picocolors.default.gray(formatNumber(breakdown.outputTokens)), import_picocolors.default.gray(formatNumber(breakdown.cacheCreationTokens)), import_picocolors.default.gray(formatNumber(breakdown.cacheReadTokens)), import_picocolors.default.gray(formatNumber(totalTokens)), import_picocolors.default.gray(formatCurrency(breakdown.cost)));
|
|
4474
|
+
for (let i = 0; i < trailingColumns; i++) row.push("");
|
|
4475
|
+
table.push(row);
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4478
|
+
function createUsageReportTable(config) {
|
|
4479
|
+
const baseHeaders = [
|
|
4480
|
+
config.firstColumnName,
|
|
4481
|
+
"Models",
|
|
4482
|
+
"Input",
|
|
4483
|
+
"Output",
|
|
4484
|
+
"Cache Create",
|
|
4485
|
+
"Cache Read",
|
|
4486
|
+
"Total Tokens",
|
|
4487
|
+
"Cost (USD)"
|
|
4488
|
+
];
|
|
4489
|
+
const baseAligns = [
|
|
4490
|
+
"left",
|
|
4491
|
+
"left",
|
|
4492
|
+
"right",
|
|
4493
|
+
"right",
|
|
4494
|
+
"right",
|
|
4495
|
+
"right",
|
|
4496
|
+
"right",
|
|
4497
|
+
"right"
|
|
4498
|
+
];
|
|
4499
|
+
const compactHeaders = [
|
|
4500
|
+
config.firstColumnName,
|
|
4501
|
+
"Models",
|
|
4502
|
+
"Input",
|
|
4503
|
+
"Output",
|
|
4504
|
+
"Cost (USD)"
|
|
4505
|
+
];
|
|
4506
|
+
const compactAligns = [
|
|
4507
|
+
"left",
|
|
4508
|
+
"left",
|
|
4509
|
+
"right",
|
|
4510
|
+
"right",
|
|
4511
|
+
"right"
|
|
4512
|
+
];
|
|
4513
|
+
if (config.includeLastActivity ?? false) {
|
|
4514
|
+
baseHeaders.push("Last Activity");
|
|
4515
|
+
baseAligns.push("left");
|
|
4516
|
+
compactHeaders.push("Last Activity");
|
|
4517
|
+
compactAligns.push("left");
|
|
4518
|
+
}
|
|
4519
|
+
return new ResponsiveTable({
|
|
4520
|
+
head: baseHeaders,
|
|
4521
|
+
style: { head: ["cyan"] },
|
|
4522
|
+
colAligns: baseAligns,
|
|
4523
|
+
dateFormatter: config.dateFormatter,
|
|
4524
|
+
compactHead: compactHeaders,
|
|
4525
|
+
compactColAligns: compactAligns,
|
|
4526
|
+
compactThreshold: 100,
|
|
4527
|
+
forceCompact: config.forceCompact
|
|
4528
|
+
});
|
|
4529
|
+
}
|
|
4530
|
+
function formatUsageDataRow(firstColumnValue, data, lastActivity) {
|
|
4531
|
+
const totalTokens = data.inputTokens + data.outputTokens + data.cacheCreationTokens + data.cacheReadTokens;
|
|
4532
|
+
const row = [
|
|
4533
|
+
firstColumnValue,
|
|
4534
|
+
data.modelsUsed != null ? formatModelsDisplayMultiline(data.modelsUsed) : "",
|
|
4535
|
+
formatNumber(data.inputTokens),
|
|
4536
|
+
formatNumber(data.outputTokens),
|
|
4537
|
+
formatNumber(data.cacheCreationTokens),
|
|
4538
|
+
formatNumber(data.cacheReadTokens),
|
|
4539
|
+
formatNumber(totalTokens),
|
|
4540
|
+
formatCurrency(data.totalCost)
|
|
4541
|
+
];
|
|
4542
|
+
if (lastActivity !== void 0) row.push(lastActivity);
|
|
4543
|
+
return row;
|
|
4544
|
+
}
|
|
4545
|
+
function formatTotalsRow(totals, includeLastActivity = false) {
|
|
4546
|
+
const totalTokens = totals.inputTokens + totals.outputTokens + totals.cacheCreationTokens + totals.cacheReadTokens;
|
|
4547
|
+
const row = [
|
|
4548
|
+
import_picocolors.default.yellow("Total"),
|
|
4549
|
+
"",
|
|
4550
|
+
import_picocolors.default.yellow(formatNumber(totals.inputTokens)),
|
|
4551
|
+
import_picocolors.default.yellow(formatNumber(totals.outputTokens)),
|
|
4552
|
+
import_picocolors.default.yellow(formatNumber(totals.cacheCreationTokens)),
|
|
4553
|
+
import_picocolors.default.yellow(formatNumber(totals.cacheReadTokens)),
|
|
4554
|
+
import_picocolors.default.yellow(formatNumber(totalTokens)),
|
|
4555
|
+
import_picocolors.default.yellow(formatCurrency(totals.totalCost))
|
|
4556
|
+
];
|
|
4557
|
+
if (includeLastActivity) row.push("");
|
|
4558
|
+
return row;
|
|
4559
|
+
}
|
|
4560
|
+
function addEmptySeparatorRow(table, columnCount) {
|
|
4561
|
+
const emptyRow = Array.from({ length: columnCount }, () => "");
|
|
4562
|
+
table.push(emptyRow);
|
|
4563
|
+
}
|
|
4564
|
+
function createDateFormatter(timezone, locale) {
|
|
2668
4565
|
return new Intl.DateTimeFormat(locale, {
|
|
2669
4566
|
year: "numeric",
|
|
2670
4567
|
month: "2-digit",
|
|
@@ -2676,11 +4573,6 @@ function formatDate(dateStr, timezone, locale) {
|
|
|
2676
4573
|
const date = new Date(dateStr);
|
|
2677
4574
|
return createDateFormatter(timezone, locale ?? DEFAULT_LOCALE).format(date);
|
|
2678
4575
|
}
|
|
2679
|
-
function formatDateCompact(dateStr, timezone, locale) {
|
|
2680
|
-
const date = safeParse(dailyDateSchema, dateStr).success ? timezone != null ? /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`) : /* @__PURE__ */ new Date(`${dateStr}T00:00:00`) : new Date(dateStr);
|
|
2681
|
-
const parts = createDatePartsFormatter(timezone, locale).formatToParts(date);
|
|
2682
|
-
return `${parts.find((p) => p.type === "year")?.value ?? ""}\n${parts.find((p) => p.type === "month")?.value ?? ""}-${parts.find((p) => p.type === "day")?.value ?? ""}`;
|
|
2683
|
-
}
|
|
2684
4576
|
function sortByDate(items, getDate, order = "desc") {
|
|
2685
4577
|
const sorted = sort(items);
|
|
2686
4578
|
switch (order) {
|
|
@@ -2802,7 +4694,7 @@ var LiteLLMPricingFetcher = class {
|
|
|
2802
4694
|
}), andThen(async (response) => try_({
|
|
2803
4695
|
try: response.json(),
|
|
2804
4696
|
catch: (error) => new Error("Failed to parse pricing data", { cause: error })
|
|
2805
|
-
})), map((data) => {
|
|
4697
|
+
})), map$1((data) => {
|
|
2806
4698
|
const pricing = /* @__PURE__ */ new Map();
|
|
2807
4699
|
for (const [modelName, modelData] of Object.entries(data)) {
|
|
2808
4700
|
if (typeof modelData !== "object" || modelData == null) continue;
|
|
@@ -2827,7 +4719,7 @@ var LiteLLMPricingFetcher = class {
|
|
|
2827
4719
|
return Array.from(candidates);
|
|
2828
4720
|
}
|
|
2829
4721
|
async getModelPricing(modelName) {
|
|
2830
|
-
return pipe(this.ensurePricingLoaded(), map((pricing) => {
|
|
4722
|
+
return pipe(this.ensurePricingLoaded(), map$1((pricing) => {
|
|
2831
4723
|
for (const candidate of this.createMatchingCandidates(modelName)) {
|
|
2832
4724
|
const direct = pricing.get(candidate);
|
|
2833
4725
|
if (direct != null) return direct;
|
|
@@ -2841,7 +4733,7 @@ var LiteLLMPricingFetcher = class {
|
|
|
2841
4733
|
}));
|
|
2842
4734
|
}
|
|
2843
4735
|
async getModelContextLimit(modelName) {
|
|
2844
|
-
return pipe(this.getModelPricing(modelName), map((pricing) => pricing?.max_input_tokens ?? null));
|
|
4736
|
+
return pipe(this.getModelPricing(modelName), map$1((pricing) => pricing?.max_input_tokens ?? null));
|
|
2845
4737
|
}
|
|
2846
4738
|
calculateCostFromPricing(tokens, pricing) {
|
|
2847
4739
|
const calculateTieredCost = (totalTokens, basePrice, tieredPrice, threshold = DEFAULT_TIERED_THRESHOLD) => {
|
|
@@ -3413,7 +5305,7 @@ function getClaudePaths() {
|
|
|
3413
5305
|
const normalizedPaths = /* @__PURE__ */ new Set();
|
|
3414
5306
|
const envPaths = (process$1.env[CLAUDE_CONFIG_DIR_ENV] ?? "").trim();
|
|
3415
5307
|
if (envPaths !== "") {
|
|
3416
|
-
const envPathList = envPaths.split(",").map((p) => p.trim()).filter((p) => p !== "");
|
|
5308
|
+
const envPathList = envPaths.split(",").map((p$1) => p$1.trim()).filter((p$1) => p$1 !== "");
|
|
3417
5309
|
for (const envPath of envPathList) {
|
|
3418
5310
|
const normalizedPath = path.resolve(envPath);
|
|
3419
5311
|
if (isDirectorySync(normalizedPath)) {
|
|
@@ -3863,7 +5755,7 @@ async function loadWeeklyUsageData(options) {
|
|
|
3863
5755
|
async function loadSessionUsageById(sessionId, options) {
|
|
3864
5756
|
try {
|
|
3865
5757
|
var _usingCtx4 = _usingCtx();
|
|
3866
|
-
const jsonlFiles = await glob(getClaudePaths().map((p) => path.join(p, "projects", "**", `${sessionId}.jsonl`).replace(/\\/g, "/")));
|
|
5758
|
+
const jsonlFiles = await glob(getClaudePaths().map((p$1) => path.join(p$1, "projects", "**", `${sessionId}.jsonl`).replace(/\\/g, "/")));
|
|
3867
5759
|
if (jsonlFiles.length === 0) return null;
|
|
3868
5760
|
const file = jsonlFiles[0];
|
|
3869
5761
|
if (file == null) return null;
|
|
@@ -4034,4 +5926,4 @@ async function loadSessionBlockData(options) {
|
|
|
4034
5926
|
_usingCtx6.d();
|
|
4035
5927
|
}
|
|
4036
5928
|
}
|
|
4037
|
-
export {
|
|
5929
|
+
export { DEFAULT_RECENT_DAYS as $, PricingFetcher as A, pushBreakdownRows as B, transcriptUsageSchema as C, calculateBurnRate as D, DEFAULT_SESSION_DURATION_HOURS as E, formatDateCompact as F, BLOCKS_COMPACT_WIDTH_THRESHOLD as G, getFileModifiedTime as H, formatModelsDisplayMultiline as I, CLAUDE_PROJECTS_DIR_NAME as J, BLOCKS_DEFAULT_TERMINAL_WIDTH as K, formatNumber as L, addEmptySeparatorRow as M, createUsageReportTable as N, filterRecentBlocks as O, formatCurrency as P, DEFAULT_LOCALE as Q, formatTotalsRow as R, transcriptMessageSchema as S, weeklyUsageSchema as T, unreachable as U, require_picocolors as V, _usingCtx as W, DEBUG_MATCH_THRESHOLD_PERCENT as X, CONFIG_FILE_NAME as Y, DEFAULT_CONTEXT_USAGE_THRESHOLDS as Z, loadWeeklyUsageData as _, dailyUsageSchema as a, try_ as at, sessionUsageSchema as b, getEarliestTimestamp as c, inspectError as ct, loadBucketUsageData as d, isSuccess as dt, DEFAULT_REFRESH_INTERVAL_SECONDS as et, loadDailyUsageData as f, isFailure as ft, loadSessionUsageById as g, loadSessionData as h, createUniqueHash as i, unwrap as it, ResponsiveTable as j, projectBlockUsage as k, getUsageLimitResetTime as l, inspect as lt, loadSessionBlockData as m, __toESM as mt, calculateContextTokens as n, WEEK_DAYS as nt, extractProjectFromPath as o, pipe as ot, loadMonthlyUsageData as p, toArray as pt, BLOCKS_WARNING_THRESHOLD as q, calculateCostForEntry as r, glob as rt, getClaudePaths as s, map$1 as st, bucketUsageSchema as t, USAGE_DATA_GLOB_PATTERN as tt, globUsageFiles as u, succeed as ut, modelBreakdownSchema as v, usageDataSchema as w, sortFilesByTimestamp as x, monthlyUsageSchema as y, formatUsageDataRow as z };
|