@innei/pretty-logger-core 0.3.3 → 0.3.4

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/index.js CHANGED
@@ -1,422 +1,304 @@
1
- "use strict";
1
+ //#region rolldown:runtime
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
8
+ var __commonJS = (cb, mod) => function() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
10
  };
12
11
  var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
+ key = keys[i];
14
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
29
25
 
30
- // index.ts
31
- var core_exports = {};
32
- __export(core_exports, {
33
- BasicReporter: () => BasicReporter,
34
- BrowserReporter: () => BrowserReporter,
35
- Consola: () => Consola,
36
- FancyReporter: () => FancyReporter,
37
- FileReporter: () => FileReporter,
38
- LEVEL_COLOR_MAP: () => LEVEL_COLOR_MAP,
39
- LogLevels: () => LogLevels,
40
- LogTypes: () => LogTypes,
41
- LoggerReporter: () => LoggerReporter,
42
- SubscriberReporter: () => SubscriberReporter,
43
- TYPE_COLOR_MAP: () => TYPE_COLOR_MAP,
44
- consola: () => consola,
45
- createConsola: () => createConsola2,
46
- createLoggerConsola: () => createLoggerConsola,
47
- wrapperSubscribers: () => wrapperSubscribers
48
- });
49
- module.exports = __toCommonJS(core_exports);
26
+ //#endregion
27
+ const std_env = __toESM(require("std-env"));
28
+ const defu = __toESM(require("defu"));
29
+ const node_util = __toESM(require("node:util"));
30
+ const node_path = __toESM(require("node:path"));
31
+ const node_tty = __toESM(require("node:tty"));
32
+ const node_fs = __toESM(require("node:fs"));
33
+ const cron = __toESM(require("cron"));
34
+ const picocolors = __toESM(require("picocolors"));
35
+ const node_events = __toESM(require("node:events"));
50
36
 
51
- // consola.instance.ts
52
- var import_std_env3 = require("std-env");
53
-
54
- // consola/index.ts
55
- var import_std_env = require("std-env");
56
-
57
- // consola/consola.ts
58
- var import_defu = require("defu");
59
-
60
- // consola/constants.ts
61
- var LogLevels = {
62
- silent: Number.NEGATIVE_INFINITY,
63
- fatal: 0,
64
- error: 0,
65
- warn: 1,
66
- log: 2,
67
- info: 3,
68
- success: 3,
69
- fail: 3,
70
- ready: 3,
71
- start: 3,
72
- box: 3,
73
- debug: 4,
74
- trace: 5,
75
- verbose: Number.POSITIVE_INFINITY
37
+ //#region consola/constants.ts
38
+ const LogLevels = {
39
+ silent: Number.NEGATIVE_INFINITY,
40
+ fatal: 0,
41
+ error: 0,
42
+ warn: 1,
43
+ log: 2,
44
+ info: 3,
45
+ success: 3,
46
+ fail: 3,
47
+ ready: 3,
48
+ start: 3,
49
+ box: 3,
50
+ debug: 4,
51
+ trace: 5,
52
+ verbose: Number.POSITIVE_INFINITY
76
53
  };
77
- var LogTypes = {
78
- // Silent
79
- silent: {
80
- level: -1
81
- },
82
- // Level 0
83
- fatal: {
84
- level: LogLevels.fatal
85
- },
86
- error: {
87
- level: LogLevels.error
88
- },
89
- // Level 1
90
- warn: {
91
- level: LogLevels.warn
92
- },
93
- // Level 2
94
- log: {
95
- level: LogLevels.log
96
- },
97
- // Level 3
98
- info: {
99
- level: LogLevels.info
100
- },
101
- success: {
102
- level: LogLevels.success
103
- },
104
- fail: {
105
- level: LogLevels.fail
106
- },
107
- ready: {
108
- level: LogLevels.info
109
- },
110
- start: {
111
- level: LogLevels.info
112
- },
113
- box: {
114
- level: LogLevels.info
115
- },
116
- // Level 4
117
- debug: {
118
- level: LogLevels.debug
119
- },
120
- // Level 5
121
- trace: {
122
- level: LogLevels.trace
123
- },
124
- // Verbose
125
- verbose: {
126
- level: LogLevels.verbose
127
- }
54
+ const LogTypes = {
55
+ silent: { level: -1 },
56
+ fatal: { level: LogLevels.fatal },
57
+ error: { level: LogLevels.error },
58
+ warn: { level: LogLevels.warn },
59
+ log: { level: LogLevels.log },
60
+ info: { level: LogLevels.info },
61
+ success: { level: LogLevels.success },
62
+ fail: { level: LogLevels.fail },
63
+ ready: { level: LogLevels.info },
64
+ start: { level: LogLevels.info },
65
+ box: { level: LogLevels.info },
66
+ debug: { level: LogLevels.debug },
67
+ trace: { level: LogLevels.trace },
68
+ verbose: { level: LogLevels.verbose }
128
69
  };
129
70
 
130
- // consola/utils/log.ts
71
+ //#endregion
72
+ //#region consola/utils/log.ts
131
73
  function isPlainObject(obj) {
132
- return Object.prototype.toString.call(obj) === "[object Object]";
74
+ return Object.prototype.toString.call(obj) === "[object Object]";
133
75
  }
134
76
  function isLogObj(arg) {
135
- if (!isPlainObject(arg)) {
136
- return false;
137
- }
138
- if (!arg.message && !arg.args) {
139
- return false;
140
- }
141
- if (arg.stack) {
142
- return false;
143
- }
144
- return true;
77
+ if (!isPlainObject(arg)) return false;
78
+ if (!arg.message && !arg.args) return false;
79
+ if (arg.stack) return false;
80
+ return true;
145
81
  }
146
82
 
147
- // consola/consola.ts
148
- var paused = false;
149
- var queue = [];
150
- var Consola = class _Consola {
151
- constructor(options = {}) {
152
- const types = options.types || LogTypes;
153
- this.options = (0, import_defu.defu)(
154
- {
155
- ...options,
156
- defaults: { ...options.defaults },
157
- level: _normalizeLogLevel(options.level, types),
158
- reporters: [...options.reporters || []]
159
- },
160
- {
161
- types: LogTypes,
162
- throttle: 1e3,
163
- throttleMin: 5,
164
- formatOptions: {
165
- date: true,
166
- colors: false,
167
- compact: true
168
- }
169
- }
170
- );
171
- for (const type in types) {
172
- const defaults = {
173
- type,
174
- ...this.options.defaults,
175
- ...types[type]
176
- };
177
- this[type] = this._wrapLogFn(defaults);
178
- this[type].raw = this._wrapLogFn(
179
- defaults,
180
- true
181
- );
182
- }
183
- if (this.options.mockFn) {
184
- this.mockTypes();
185
- }
186
- this._lastLog = {};
187
- }
188
- get level() {
189
- return this.options.level;
190
- }
191
- set level(level) {
192
- this.options.level = _normalizeLogLevel(
193
- level,
194
- this.options.types,
195
- this.options.level
196
- );
197
- }
198
- create(options) {
199
- const instance = new _Consola({
200
- ...this.options,
201
- ...options
202
- });
203
- if (this._mockFn) {
204
- instance.mockTypes(this._mockFn);
205
- }
206
- return instance;
207
- }
208
- withDefaults(defaults) {
209
- return this.create({
210
- ...this.options,
211
- defaults: {
212
- ...this.options.defaults,
213
- ...defaults
214
- }
215
- });
216
- }
217
- withTag(tag) {
218
- return this.withDefaults({
219
- tag: this.options.defaults.tag ? `${this.options.defaults.tag}:${tag}` : tag
220
- });
221
- }
222
- addReporter(reporter) {
223
- this.options.reporters.push(reporter);
224
- return this;
225
- }
226
- removeReporter(reporter) {
227
- if (reporter) {
228
- const i = this.options.reporters.indexOf(reporter);
229
- if (i >= 0) {
230
- return this.options.reporters.splice(i, 1);
231
- }
232
- } else {
233
- this.options.reporters.splice(0);
234
- }
235
- return this;
236
- }
237
- setReporters(reporters) {
238
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
239
- return this;
240
- }
241
- wrapAll() {
242
- this.wrapConsole();
243
- this.wrapStd();
244
- }
245
- restoreAll() {
246
- this.restoreConsole();
247
- this.restoreStd();
248
- }
249
- wrapConsole() {
250
- for (const type in this.options.types) {
251
- if (!console[`__${type}`]) {
252
- ;
253
- console[`__${type}`] = console[type];
254
- }
255
- ;
256
- console[type] = this[type].raw;
257
- }
258
- }
259
- restoreConsole() {
260
- for (const type in this.options.types) {
261
- if (console[`__${type}`]) {
262
- ;
263
- console[type] = console[`__${type}`];
264
- delete console[`__${type}`];
265
- }
266
- }
267
- }
268
- wrapStd() {
269
- this._wrapStream(this.options.stdout, "log");
270
- this._wrapStream(this.options.stderr, "log");
271
- }
272
- _wrapStream(stream, type) {
273
- if (!stream) {
274
- return;
275
- }
276
- if (!stream.__write) {
277
- ;
278
- stream.__write = stream.write;
279
- }
280
- ;
281
- stream.write = (data) => {
282
- ;
283
- this[type].raw(String(data).trim());
284
- };
285
- }
286
- restoreStd() {
287
- this._restoreStream(this.options.stdout);
288
- this._restoreStream(this.options.stderr);
289
- }
290
- _restoreStream(stream) {
291
- if (!stream) {
292
- return;
293
- }
294
- if (stream.__write) {
295
- stream.write = stream.__write;
296
- delete stream.__write;
297
- }
298
- }
299
- pauseLogs() {
300
- paused = true;
301
- }
302
- resumeLogs() {
303
- paused = false;
304
- const _queue = queue.splice(0);
305
- for (const item of _queue) {
306
- item[0]._logFn(item[1], item[2]);
307
- }
308
- }
309
- mockTypes(mockFn) {
310
- const _mockFn = mockFn || this.options.mockFn;
311
- this._mockFn = _mockFn;
312
- if (typeof _mockFn !== "function") {
313
- return;
314
- }
315
- for (const type in this.options.types) {
316
- ;
317
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
318
- this[type].raw = this[type];
319
- }
320
- }
321
- _wrapLogFn(defaults, isRaw) {
322
- return (...args) => {
323
- if (paused) {
324
- queue.push([this, defaults, args, isRaw]);
325
- return;
326
- }
327
- return this._logFn(defaults, args, isRaw);
328
- };
329
- }
330
- _logFn(defaults, args, isRaw) {
331
- if ((defaults.level || 0) > this.level) {
332
- return false;
333
- }
334
- const logObj = {
335
- date: /* @__PURE__ */ new Date(),
336
- args: [],
337
- ...defaults,
338
- level: _normalizeLogLevel(defaults.level, this.options.types)
339
- };
340
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
341
- Object.assign(logObj, args[0]);
342
- } else {
343
- logObj.args = [...args];
344
- }
345
- if (logObj.message) {
346
- logObj.args.unshift(logObj.message);
347
- delete logObj.message;
348
- }
349
- if (logObj.additional) {
350
- if (!Array.isArray(logObj.additional)) {
351
- logObj.additional = logObj.additional.split("\n");
352
- }
353
- logObj.args.push(`
354
- ${logObj.additional.join("\n")}`);
355
- delete logObj.additional;
356
- }
357
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
358
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
359
- const resolveLog = (newLog = false) => {
360
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
361
- if (this._lastLog.object && repeated > 0) {
362
- const args2 = [...this._lastLog.object.args];
363
- if (repeated > 1) {
364
- args2.push(`(repeated ${repeated} times)`);
365
- }
366
- this._log({ ...this._lastLog.object, args: args2 });
367
- this._lastLog.count = 1;
368
- }
369
- if (newLog) {
370
- this._lastLog.object = logObj;
371
- this._log(logObj);
372
- }
373
- };
374
- clearTimeout(this._lastLog.timeout);
375
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
376
- this._lastLog.time = logObj.date;
377
- if (diffTime < this.options.throttle) {
378
- try {
379
- const serializedLog = JSON.stringify([
380
- logObj.type,
381
- logObj.tag,
382
- logObj.args
383
- ]);
384
- const isSameLog = this._lastLog.serialized === serializedLog;
385
- this._lastLog.serialized = serializedLog;
386
- if (isSameLog) {
387
- this._lastLog.count = (this._lastLog.count || 0) + 1;
388
- if (this._lastLog.count > this.options.throttleMin) {
389
- this._lastLog.timeout = setTimeout(
390
- resolveLog,
391
- this.options.throttle
392
- );
393
- return;
394
- }
395
- }
396
- } catch {
397
- }
398
- }
399
- resolveLog(true);
400
- }
401
- _log(logObj) {
402
- for (const reporter of this.options.reporters) {
403
- reporter.log(logObj, {
404
- options: this.options
405
- });
406
- }
407
- }
83
+ //#endregion
84
+ //#region consola/consola.ts
85
+ let paused = false;
86
+ const queue = [];
87
+ var Consola = class Consola {
88
+ constructor(options = {}) {
89
+ const types = options.types || LogTypes;
90
+ this.options = (0, defu.defu)({
91
+ ...options,
92
+ defaults: { ...options.defaults },
93
+ level: _normalizeLogLevel(options.level, types),
94
+ reporters: [...options.reporters || []]
95
+ }, {
96
+ types: LogTypes,
97
+ throttle: 1e3,
98
+ throttleMin: 5,
99
+ formatOptions: {
100
+ date: true,
101
+ colors: false,
102
+ compact: true
103
+ }
104
+ });
105
+ for (const type in types) {
106
+ const defaults = {
107
+ type,
108
+ ...this.options.defaults,
109
+ ...types[type]
110
+ };
111
+ this[type] = this._wrapLogFn(defaults);
112
+ this[type].raw = this._wrapLogFn(defaults, true);
113
+ }
114
+ if (this.options.mockFn) this.mockTypes();
115
+ this._lastLog = {};
116
+ }
117
+ get level() {
118
+ return this.options.level;
119
+ }
120
+ set level(level) {
121
+ this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
122
+ }
123
+ create(options) {
124
+ const instance = new Consola({
125
+ ...this.options,
126
+ ...options
127
+ });
128
+ if (this._mockFn) instance.mockTypes(this._mockFn);
129
+ return instance;
130
+ }
131
+ withDefaults(defaults) {
132
+ return this.create({
133
+ ...this.options,
134
+ defaults: {
135
+ ...this.options.defaults,
136
+ ...defaults
137
+ }
138
+ });
139
+ }
140
+ withTag(tag) {
141
+ return this.withDefaults({ tag: this.options.defaults.tag ? `${this.options.defaults.tag}:${tag}` : tag });
142
+ }
143
+ addReporter(reporter) {
144
+ this.options.reporters.push(reporter);
145
+ return this;
146
+ }
147
+ removeReporter(reporter) {
148
+ if (reporter) {
149
+ const i = this.options.reporters.indexOf(reporter);
150
+ if (i !== -1) return this.options.reporters.splice(i, 1);
151
+ } else this.options.reporters.splice(0);
152
+ return this;
153
+ }
154
+ setReporters(reporters) {
155
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
156
+ return this;
157
+ }
158
+ wrapAll() {
159
+ this.wrapConsole();
160
+ this.wrapStd();
161
+ }
162
+ restoreAll() {
163
+ this.restoreConsole();
164
+ this.restoreStd();
165
+ }
166
+ wrapConsole() {
167
+ for (const type in this.options.types) {
168
+ if (!console[`__${type}`]) console[`__${type}`] = console[type];
169
+ console[type] = this[type].raw;
170
+ }
171
+ }
172
+ restoreConsole() {
173
+ for (const type in this.options.types) if (console[`__${type}`]) {
174
+ console[type] = console[`__${type}`];
175
+ delete console[`__${type}`];
176
+ }
177
+ }
178
+ wrapStd() {
179
+ this._wrapStream(this.options.stdout, "log");
180
+ this._wrapStream(this.options.stderr, "log");
181
+ }
182
+ _wrapStream(stream, type) {
183
+ if (!stream) return;
184
+ if (!stream.__write) stream.__write = stream.write;
185
+ stream.write = (data) => {
186
+ this[type].raw(String(data).trim());
187
+ };
188
+ }
189
+ restoreStd() {
190
+ this._restoreStream(this.options.stdout);
191
+ this._restoreStream(this.options.stderr);
192
+ }
193
+ _restoreStream(stream) {
194
+ if (!stream) return;
195
+ if (stream.__write) {
196
+ stream.write = stream.__write;
197
+ delete stream.__write;
198
+ }
199
+ }
200
+ pauseLogs() {
201
+ paused = true;
202
+ }
203
+ resumeLogs() {
204
+ paused = false;
205
+ const _queue = queue.splice(0);
206
+ for (const item of _queue) item[0]._logFn(item[1], item[2]);
207
+ }
208
+ mockTypes(mockFn) {
209
+ const _mockFn = mockFn || this.options.mockFn;
210
+ this._mockFn = _mockFn;
211
+ if (typeof _mockFn !== "function") return;
212
+ for (const type in this.options.types) {
213
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
214
+ this[type].raw = this[type];
215
+ }
216
+ }
217
+ _wrapLogFn(defaults, isRaw) {
218
+ return (...args) => {
219
+ if (paused) {
220
+ queue.push([
221
+ this,
222
+ defaults,
223
+ args,
224
+ isRaw
225
+ ]);
226
+ return;
227
+ }
228
+ return this._logFn(defaults, args, isRaw);
229
+ };
230
+ }
231
+ _logFn(defaults, args, isRaw) {
232
+ if ((defaults.level || 0) > this.level) return false;
233
+ const logObj = {
234
+ date: new Date(),
235
+ args: [],
236
+ ...defaults,
237
+ level: _normalizeLogLevel(defaults.level, this.options.types)
238
+ };
239
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
240
+ else logObj.args = [...args];
241
+ if (logObj.message) {
242
+ logObj.args.unshift(logObj.message);
243
+ delete logObj.message;
244
+ }
245
+ if (logObj.additional) {
246
+ if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
247
+ logObj.args.push(`\n${logObj.additional.join("\n")}`);
248
+ delete logObj.additional;
249
+ }
250
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
251
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
252
+ /**
253
+ * @param newLog false if the throttle expired and
254
+ * we don't want to log a duplicate
255
+ */
256
+ const resolveLog = (newLog = false) => {
257
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
258
+ if (this._lastLog.object && repeated > 0) {
259
+ const args$1 = [...this._lastLog.object.args];
260
+ if (repeated > 1) args$1.push(`(repeated ${repeated} times)`);
261
+ this._log({
262
+ ...this._lastLog.object,
263
+ args: args$1
264
+ });
265
+ this._lastLog.count = 1;
266
+ }
267
+ if (newLog) {
268
+ this._lastLog.object = logObj;
269
+ this._log(logObj);
270
+ }
271
+ };
272
+ clearTimeout(this._lastLog.timeout);
273
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
274
+ this._lastLog.time = logObj.date;
275
+ if (diffTime < this.options.throttle) try {
276
+ const serializedLog = JSON.stringify([
277
+ logObj.type,
278
+ logObj.tag,
279
+ logObj.args
280
+ ]);
281
+ const isSameLog = this._lastLog.serialized === serializedLog;
282
+ this._lastLog.serialized = serializedLog;
283
+ if (isSameLog) {
284
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
285
+ if (this._lastLog.count > this.options.throttleMin) {
286
+ this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
287
+ return;
288
+ }
289
+ }
290
+ } catch {}
291
+ resolveLog(true);
292
+ }
293
+ _log(logObj) {
294
+ for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
295
+ }
408
296
  };
409
297
  function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
410
- if (input === void 0) {
411
- return defaultLevel;
412
- }
413
- if (typeof input === "number") {
414
- return input;
415
- }
416
- if (types[input] && types[input].level !== void 0) {
417
- return types[input].level;
418
- }
419
- return defaultLevel;
298
+ if (input === void 0) return defaultLevel;
299
+ if (typeof input === "number") return input;
300
+ if (types[input] && types[input].level !== void 0) return types[input].level;
301
+ return defaultLevel;
420
302
  }
421
303
  Consola.prototype.add = Consola.prototype.addReporter;
422
304
  Consola.prototype.remove = Consola.prototype.removeReporter;
@@ -425,751 +307,626 @@ Consola.prototype.withScope = Consola.prototype.withTag;
425
307
  Consola.prototype.mock = Consola.prototype.mockTypes;
426
308
  Consola.prototype.pause = Consola.prototype.pauseLogs;
427
309
  Consola.prototype.resume = Consola.prototype.resumeLogs;
428
- function createConsola(options = {}) {
429
- return new Consola(options);
310
+ function createConsola$1(options = {}) {
311
+ return new Consola(options);
430
312
  }
431
313
 
432
- // consola/reporters/basic.ts
433
- var import_node_util = require("util");
434
-
435
- // consola/utils/error.ts
436
- var import_node_path = require("path");
314
+ //#endregion
315
+ //#region consola/utils/error.ts
437
316
  function parseStack(stack) {
438
- const cwd = process.cwd() + import_node_path.sep;
439
- const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
440
- return lines;
317
+ const cwd = process.cwd() + node_path.sep;
318
+ const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
319
+ return lines;
441
320
  }
442
321
 
443
- // consola/utils/stream.ts
322
+ //#endregion
323
+ //#region consola/utils/stream.ts
444
324
  function writeStream(data, stream) {
445
- const write = stream.__write || stream.write;
446
- return write.call(stream, data);
325
+ const write = stream.__write || stream.write;
326
+ return write.call(stream, data);
447
327
  }
448
328
 
449
- // consola/reporters/basic.ts
450
- var bracket = (x) => x ? `[${x}]` : "";
329
+ //#endregion
330
+ //#region consola/reporters/basic.ts
331
+ const bracket = (x) => x ? `[${x}]` : "";
451
332
  var BasicReporter = class {
452
- formatStack(stack, opts) {
453
- return ` ${parseStack(stack).join("\n ")}`;
454
- }
455
- formatArgs(args, opts) {
456
- const _args = args.map((arg) => {
457
- if (arg && typeof arg.stack === "string") {
458
- return `${arg.message}
459
- ${this.formatStack(arg.stack, opts)}`;
460
- }
461
- return arg;
462
- });
463
- return (0, import_node_util.formatWithOptions)(opts, ..._args);
464
- }
465
- formatDate(date, opts) {
466
- return opts.date ? date.toLocaleTimeString() : "";
467
- }
468
- filterAndJoin(arr) {
469
- return arr.filter(Boolean).join(" ");
470
- }
471
- formatLogObj(logObj, opts) {
472
- const message = this.formatArgs(logObj.args, opts);
473
- if (logObj.type === "box") {
474
- return `
475
- ${[
476
- bracket(logObj.tag),
477
- logObj.title && logObj.title,
478
- ...message.split("\n")
479
- ].filter(Boolean).map((l) => ` > ${l}`).join("\n")}
480
- `;
481
- }
482
- return this.filterAndJoin([
483
- bracket(logObj.type),
484
- bracket(logObj.tag),
485
- message
486
- ]);
487
- }
488
- log(logObj, ctx) {
489
- const line = this.formatLogObj(logObj, {
490
- columns: ctx.options.stdout.columns || 0,
491
- ...ctx.options.formatOptions
492
- });
493
- return writeStream(
494
- `${line}
495
- `,
496
- logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
497
- );
498
- }
333
+ formatStack(stack, _opts) {
334
+ return ` ${parseStack(stack).join("\n ")}`;
335
+ }
336
+ formatArgs(args, opts) {
337
+ const _args = args.map((arg) => {
338
+ if (arg && typeof arg.stack === "string") return `${arg.message}\n${this.formatStack(arg.stack, opts)}`;
339
+ return arg;
340
+ });
341
+ return (0, node_util.formatWithOptions)(opts, ..._args);
342
+ }
343
+ formatDate(date, opts) {
344
+ return opts.date ? date.toLocaleTimeString() : "";
345
+ }
346
+ filterAndJoin(arr) {
347
+ return arr.filter(Boolean).join(" ");
348
+ }
349
+ formatLogObj(logObj, opts) {
350
+ const message = this.formatArgs(logObj.args, opts);
351
+ if (logObj.type === "box") return `\n${[
352
+ bracket(logObj.tag),
353
+ logObj.title && logObj.title,
354
+ ...message.split("\n")
355
+ ].filter(Boolean).map((l) => ` > ${l}`).join("\n")}\n`;
356
+ return this.filterAndJoin([
357
+ bracket(logObj.type),
358
+ bracket(logObj.tag),
359
+ message
360
+ ]);
361
+ }
362
+ log(logObj, ctx) {
363
+ const line = this.formatLogObj(logObj, {
364
+ columns: ctx.options.stdout.columns || 0,
365
+ ...ctx.options.formatOptions
366
+ });
367
+ return writeStream(`${line}\n`, logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
368
+ }
499
369
  };
500
370
 
501
- // ../../node_modules/.pnpm/@innei+string-width@7.1.1-fork.0/node_modules/@innei/string-width/dist/index.mjs
502
- function ansiRegex({ onlyFirst = false } = {}) {
503
- const pattern = [
504
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
505
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
506
- ].join("|");
507
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
371
+ //#endregion
372
+ //#region ../../node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js
373
+ function ansiRegex$1({ onlyFirst = false } = {}) {
374
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
375
+ const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
376
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
508
377
  }
509
- var regex = ansiRegex();
510
- function stripAnsi(string) {
511
- if (typeof string !== "string") {
512
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
513
- }
514
- return string.replace(regex, "");
378
+
379
+ //#endregion
380
+ //#region ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
381
+ const regex = ansiRegex$1();
382
+ function stripAnsi$1(string) {
383
+ if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
384
+ return string.replace(regex, "");
515
385
  }
386
+
387
+ //#endregion
388
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/lookup.js
516
389
  function isAmbiguous(x) {
517
- 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;
390
+ 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;
518
391
  }
519
392
  function isFullWidth(x) {
520
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
393
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
521
394
  }
522
395
  function isWide(x) {
523
- 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 >= 9800 && x <= 9811 || x === 9855 || 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 <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
396
+ return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
524
397
  }
398
+
399
+ //#endregion
400
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/index.js
525
401
  function validate(codePoint) {
526
- if (!Number.isSafeInteger(codePoint)) {
527
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
528
- }
402
+ if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
529
403
  }
530
404
  function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
531
- validate(codePoint);
532
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
533
- return 2;
534
- }
535
- return 1;
405
+ validate(codePoint);
406
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
407
+ return 1;
536
408
  }
537
- var emoji_regex_default = () => {
538
- 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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
539
- };
540
- var segmenter = new Intl.Segmenter();
541
- function stringWidth(string, options = {}) {
542
- if (typeof string !== "string" || string.length === 0) {
543
- return 0;
544
- }
545
- const {
546
- ambiguousIsNarrow = true,
547
- countAnsiEscapeCodes = false
548
- } = options;
549
- if (!countAnsiEscapeCodes) {
550
- string = stripAnsi(string);
551
- }
552
- if (string.length === 0) {
553
- return 0;
554
- }
555
- let width = 0;
556
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
557
- for (const { segment: character } of segmenter.segment(string)) {
558
- const codePoint = character.codePointAt(0);
559
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
560
- continue;
561
- }
562
- if (codePoint >= 768 && codePoint <= 879) {
563
- continue;
564
- }
565
- if (emoji_regex_default().test(character)) {
566
- width += 2;
567
- continue;
568
- }
569
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
570
- }
571
- return width;
409
+
410
+ //#endregion
411
+ //#region ../../node_modules/.pnpm/emoji-regex@10.4.0/node_modules/emoji-regex/index.js
412
+ var require_emoji_regex = __commonJS({ "../../node_modules/.pnpm/emoji-regex@10.4.0/node_modules/emoji-regex/index.js"(exports, module) {
413
+ module.exports = () => {
414
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
415
+ };
416
+ } });
417
+
418
+ //#endregion
419
+ //#region ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
420
+ var import_emoji_regex = __toESM(require_emoji_regex(), 1);
421
+ const segmenter = new Intl.Segmenter();
422
+ const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
423
+ function stringWidth$1(string, options = {}) {
424
+ if (typeof string !== "string" || string.length === 0) return 0;
425
+ const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
426
+ if (!countAnsiEscapeCodes) string = stripAnsi$1(string);
427
+ if (string.length === 0) return 0;
428
+ let width = 0;
429
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
430
+ for (const { segment: character } of segmenter.segment(string)) {
431
+ const codePoint = character.codePointAt(0);
432
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
433
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
434
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
435
+ if (codePoint >= 55296 && codePoint <= 57343) continue;
436
+ if (codePoint >= 65024 && codePoint <= 65039) continue;
437
+ if (defaultIgnorableCodePointRegex.test(character)) continue;
438
+ if ((0, import_emoji_regex.default)().test(character)) {
439
+ width += 2;
440
+ continue;
441
+ }
442
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
443
+ }
444
+ return width;
572
445
  }
573
446
 
574
- // consola/utils/color.ts
575
- var tty = __toESM(require("tty"));
576
- var {
577
- env = {},
578
- argv = [],
579
- platform = ""
580
- } = typeof process === "undefined" ? {} : process;
581
- var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
582
- var isForced = "FORCE_COLOR" in env || argv.includes("--color");
583
- var isWindows = platform === "win32";
584
- var isDumbTerminal = env.TERM === "dumb";
585
- var isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
586
- var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
587
- var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
447
+ //#endregion
448
+ //#region consola/utils/color.ts
449
+ const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
450
+ const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
451
+ const isForced = "FORCE_COLOR" in env || argv.includes("--color");
452
+ const isWindows = platform === "win32";
453
+ const isDumbTerminal = env.TERM === "dumb";
454
+ const isCompatibleTerminal = node_tty && node_tty.isatty && node_tty.isatty(1) && env.TERM && !isDumbTerminal;
455
+ const isCI$1 = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
456
+ const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI$1);
588
457
  function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
589
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
458
+ return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
590
459
  }
591
460
  function clearBleed(index, string, open, close, replace) {
592
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
461
+ return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
593
462
  }
594
463
  function filterEmpty(open, close, replace = open, at = open.length + 1) {
595
- return (string) => string || !(string === "" || string === void 0) ? clearBleed(`${string}`.indexOf(close, at), string, open, close, replace) : "";
464
+ return (string) => string || !(string === "" || string === void 0) ? clearBleed(`${string}`.indexOf(close, at), string, open, close, replace) : "";
596
465
  }
597
466
  function init(open, close, replace) {
598
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
467
+ return filterEmpty(`\u001B[${open}m`, `\u001B[${close}m`, replace);
599
468
  }
600
- var colorDefs = {
601
- reset: init(0, 0),
602
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
603
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
604
- italic: init(3, 23),
605
- underline: init(4, 24),
606
- inverse: init(7, 27),
607
- hidden: init(8, 28),
608
- strikethrough: init(9, 29),
609
- black: init(30, 39),
610
- red: init(31, 39),
611
- green: init(32, 39),
612
- yellow: init(33, 39),
613
- blue: init(34, 39),
614
- magenta: init(35, 39),
615
- cyan: init(36, 39),
616
- white: init(37, 39),
617
- gray: init(90, 39),
618
- bgBlack: init(40, 49),
619
- bgRed: init(41, 49),
620
- bgGreen: init(42, 49),
621
- bgYellow: init(43, 49),
622
- bgBlue: init(44, 49),
623
- bgMagenta: init(45, 49),
624
- bgCyan: init(46, 49),
625
- bgWhite: init(47, 49),
626
- blackBright: init(90, 39),
627
- redBright: init(91, 39),
628
- greenBright: init(92, 39),
629
- yellowBright: init(93, 39),
630
- blueBright: init(94, 39),
631
- magentaBright: init(95, 39),
632
- cyanBright: init(96, 39),
633
- whiteBright: init(97, 39),
634
- bgBlackBright: init(100, 49),
635
- bgRedBright: init(101, 49),
636
- bgGreenBright: init(102, 49),
637
- bgYellowBright: init(103, 49),
638
- bgBlueBright: init(104, 49),
639
- bgMagentaBright: init(105, 49),
640
- bgCyanBright: init(106, 49),
641
- bgWhiteBright: init(107, 49)
469
+ const colorDefs = {
470
+ reset: init(0, 0),
471
+ bold: init(1, 22, "\x1B[22m\x1B[1m"),
472
+ dim: init(2, 22, "\x1B[22m\x1B[2m"),
473
+ italic: init(3, 23),
474
+ underline: init(4, 24),
475
+ inverse: init(7, 27),
476
+ hidden: init(8, 28),
477
+ strikethrough: init(9, 29),
478
+ black: init(30, 39),
479
+ red: init(31, 39),
480
+ green: init(32, 39),
481
+ yellow: init(33, 39),
482
+ blue: init(34, 39),
483
+ magenta: init(35, 39),
484
+ cyan: init(36, 39),
485
+ white: init(37, 39),
486
+ gray: init(90, 39),
487
+ bgBlack: init(40, 49),
488
+ bgRed: init(41, 49),
489
+ bgGreen: init(42, 49),
490
+ bgYellow: init(43, 49),
491
+ bgBlue: init(44, 49),
492
+ bgMagenta: init(45, 49),
493
+ bgCyan: init(46, 49),
494
+ bgWhite: init(47, 49),
495
+ blackBright: init(90, 39),
496
+ redBright: init(91, 39),
497
+ greenBright: init(92, 39),
498
+ yellowBright: init(93, 39),
499
+ blueBright: init(94, 39),
500
+ magentaBright: init(95, 39),
501
+ cyanBright: init(96, 39),
502
+ whiteBright: init(97, 39),
503
+ bgBlackBright: init(100, 49),
504
+ bgRedBright: init(101, 49),
505
+ bgGreenBright: init(102, 49),
506
+ bgYellowBright: init(103, 49),
507
+ bgBlueBright: init(104, 49),
508
+ bgMagentaBright: init(105, 49),
509
+ bgCyanBright: init(106, 49),
510
+ bgWhiteBright: init(107, 49)
642
511
  };
643
512
  function createColors(useColor = isColorSupported) {
644
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
513
+ return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
645
514
  }
646
- var colors = createColors();
647
- function getColor(color, fallback = "reset") {
648
- return colors[color] || colors[fallback];
515
+ const colors = createColors();
516
+ function getColor$1(color, fallback = "reset") {
517
+ return colors[color] || colors[fallback];
649
518
  }
650
519
 
651
- // consola/utils/string.ts
652
- var ansiRegex2 = [
653
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
654
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
655
- ].join("|");
656
- function stripAnsi2(text) {
657
- return text.replace(new RegExp(ansiRegex2, "g"), "");
520
+ //#endregion
521
+ //#region consola/utils/string.ts
522
+ const ansiRegex = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
523
+ function stripAnsi(text) {
524
+ return text.replaceAll(new RegExp(ansiRegex, "g"), "");
658
525
  }
659
526
 
660
- // consola/utils/box.ts
661
- var boxStylePresets = {
662
- solid: {
663
- tl: "\u250C",
664
- tr: "\u2510",
665
- bl: "\u2514",
666
- br: "\u2518",
667
- h: "\u2500",
668
- v: "\u2502"
669
- },
670
- double: {
671
- tl: "\u2554",
672
- tr: "\u2557",
673
- bl: "\u255A",
674
- br: "\u255D",
675
- h: "\u2550",
676
- v: "\u2551"
677
- },
678
- doubleSingle: {
679
- tl: "\u2553",
680
- tr: "\u2556",
681
- bl: "\u2559",
682
- br: "\u255C",
683
- h: "\u2500",
684
- v: "\u2551"
685
- },
686
- doubleSingleRounded: {
687
- tl: "\u256D",
688
- tr: "\u256E",
689
- bl: "\u2570",
690
- br: "\u256F",
691
- h: "\u2500",
692
- v: "\u2551"
693
- },
694
- singleThick: {
695
- tl: "\u250F",
696
- tr: "\u2513",
697
- bl: "\u2517",
698
- br: "\u251B",
699
- h: "\u2501",
700
- v: "\u2503"
701
- },
702
- singleDouble: {
703
- tl: "\u2552",
704
- tr: "\u2555",
705
- bl: "\u2558",
706
- br: "\u255B",
707
- h: "\u2550",
708
- v: "\u2502"
709
- },
710
- singleDoubleRounded: {
711
- tl: "\u256D",
712
- tr: "\u256E",
713
- bl: "\u2570",
714
- br: "\u256F",
715
- h: "\u2550",
716
- v: "\u2502"
717
- },
718
- rounded: {
719
- tl: "\u256D",
720
- tr: "\u256E",
721
- bl: "\u2570",
722
- br: "\u256F",
723
- h: "\u2500",
724
- v: "\u2502"
725
- }
527
+ //#endregion
528
+ //#region consola/utils/box.ts
529
+ const boxStylePresets = {
530
+ solid: {
531
+ tl: "",
532
+ tr: "",
533
+ bl: "",
534
+ br: "",
535
+ h: "",
536
+ v: "│"
537
+ },
538
+ double: {
539
+ tl: "",
540
+ tr: "",
541
+ bl: "",
542
+ br: "",
543
+ h: "",
544
+ v: "║"
545
+ },
546
+ doubleSingle: {
547
+ tl: "",
548
+ tr: "",
549
+ bl: "",
550
+ br: "",
551
+ h: "",
552
+ v: "║"
553
+ },
554
+ doubleSingleRounded: {
555
+ tl: "",
556
+ tr: "",
557
+ bl: "",
558
+ br: "",
559
+ h: "",
560
+ v: "║"
561
+ },
562
+ singleThick: {
563
+ tl: "",
564
+ tr: "",
565
+ bl: "",
566
+ br: "",
567
+ h: "",
568
+ v: "┃"
569
+ },
570
+ singleDouble: {
571
+ tl: "",
572
+ tr: "",
573
+ bl: "",
574
+ br: "",
575
+ h: "",
576
+ v: "│"
577
+ },
578
+ singleDoubleRounded: {
579
+ tl: "",
580
+ tr: "",
581
+ bl: "",
582
+ br: "",
583
+ h: "",
584
+ v: "│"
585
+ },
586
+ rounded: {
587
+ tl: "",
588
+ tr: "",
589
+ bl: "",
590
+ br: "",
591
+ h: "",
592
+ v: "│"
593
+ }
726
594
  };
727
- var defaultStyle = {
728
- borderColor: "white",
729
- borderStyle: "rounded",
730
- valign: "center",
731
- padding: 2,
732
- marginLeft: 1,
733
- marginTop: 1,
734
- marginBottom: 1
595
+ const defaultStyle = {
596
+ borderColor: "white",
597
+ borderStyle: "rounded",
598
+ valign: "center",
599
+ padding: 2,
600
+ marginLeft: 1,
601
+ marginTop: 1,
602
+ marginBottom: 1
735
603
  };
736
604
  function box(text, _opts = {}) {
737
- const opts = {
738
- ..._opts,
739
- style: {
740
- ...defaultStyle,
741
- ..._opts.style
742
- }
743
- };
744
- const textLines = text.split("\n");
745
- const boxLines = [];
746
- const _color = getColor(opts.style.borderColor);
747
- const borderStyle = {
748
- ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
749
- };
750
- if (_color) {
751
- for (const key in borderStyle) {
752
- borderStyle[key] = _color(
753
- borderStyle[key]
754
- );
755
- }
756
- }
757
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
758
- const height = textLines.length + paddingOffset;
759
- const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
760
- const widthOffset = width + paddingOffset;
761
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
762
- if (opts.style.marginTop > 0) {
763
- boxLines.push("".repeat(opts.style.marginTop));
764
- }
765
- if (opts.title) {
766
- const left = borderStyle.h.repeat(
767
- Math.floor((width - stripAnsi2(opts.title).length) / 2)
768
- );
769
- const right = borderStyle.h.repeat(
770
- width - stripAnsi2(opts.title).length - stripAnsi2(left).length + paddingOffset
771
- );
772
- boxLines.push(
773
- `${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`
774
- );
775
- } else {
776
- boxLines.push(
777
- `${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
778
- );
779
- }
780
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
781
- for (let i = 0; i < height; i++) {
782
- if (i < valignOffset || i >= valignOffset + textLines.length) {
783
- boxLines.push(
784
- `${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
785
- );
786
- } else {
787
- const line = textLines[i - valignOffset];
788
- const left = " ".repeat(paddingOffset);
789
- const right = " ".repeat(width - stripAnsi2(line).length);
790
- boxLines.push(
791
- `${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
792
- );
793
- }
794
- }
795
- boxLines.push(
796
- `${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
797
- );
798
- if (opts.style.marginBottom > 0) {
799
- boxLines.push("".repeat(opts.style.marginBottom));
800
- }
801
- return boxLines.join("\n");
605
+ const opts = {
606
+ ..._opts,
607
+ style: {
608
+ ...defaultStyle,
609
+ ..._opts.style
610
+ }
611
+ };
612
+ const textLines = text.split("\n");
613
+ const boxLines = [];
614
+ const _color = getColor$1(opts.style.borderColor);
615
+ const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
616
+ if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
617
+ const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
618
+ const height = textLines.length + paddingOffset;
619
+ const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
620
+ const widthOffset = width + paddingOffset;
621
+ const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
622
+ if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
623
+ if (opts.title) {
624
+ const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
625
+ const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
626
+ boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
627
+ } else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
628
+ const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
629
+ for (let i = 0; i < height; i++) if (i < valignOffset || i >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
630
+ else {
631
+ const line = textLines[i - valignOffset];
632
+ const left = " ".repeat(paddingOffset);
633
+ const right = " ".repeat(width - stripAnsi(line).length);
634
+ boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
635
+ }
636
+ boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
637
+ if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
638
+ return boxLines.join("\n");
802
639
  }
803
640
 
804
- // consola/utils/tester.ts
641
+ //#endregion
642
+ //#region consola/utils/tester.ts
805
643
  function isUnicodeSupported() {
806
- if (process.platform !== "win32") {
807
- return process.env.TERM !== "linux";
808
- }
809
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
810
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
811
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
812
- process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
644
+ if (process.platform !== "win32") return process.env.TERM !== "linux";
645
+ return Boolean(process.env.WT_SESSION) || Boolean(process.env.TERMINUS_SUBLIME) || process.env.ConEmuTask === "{cmd::Cmder}" || process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
813
646
  }
814
647
 
815
- // consola/reporters/fancy.ts
816
- var TYPE_COLOR_MAP = {
817
- info: "cyan",
818
- fail: "red",
819
- success: "green",
820
- ready: "green",
821
- start: "magenta"
648
+ //#endregion
649
+ //#region consola/reporters/fancy.ts
650
+ const TYPE_COLOR_MAP = {
651
+ info: "cyan",
652
+ fail: "red",
653
+ success: "green",
654
+ ready: "green",
655
+ start: "magenta"
822
656
  };
823
- var LEVEL_COLOR_MAP = {
824
- 0: "red",
825
- 1: "yellow"
657
+ const LEVEL_COLOR_MAP = {
658
+ 0: "red",
659
+ 1: "yellow"
826
660
  };
827
- var unicode = isUnicodeSupported();
828
- var s = (c, fallback) => unicode ? c : fallback;
829
- var TYPE_ICONS = {
830
- error: s("\u2716", "\xD7"),
831
- fatal: s("\u2716", "\xD7"),
832
- ready: s("\u2714", "\u221A"),
833
- warn: s("\u26A0", "\u203C"),
834
- info: s("\u2139", "i"),
835
- success: s("\u2714", "\u221A"),
836
- debug: s("\u2699", "D"),
837
- trace: s("\u2192", "\u2192"),
838
- fail: s("\u2716", "\xD7"),
839
- start: s("\u25D0", "o"),
840
- log: ""
661
+ const unicode = isUnicodeSupported();
662
+ const s = (c, fallback) => unicode ? c : fallback;
663
+ const TYPE_ICONS = {
664
+ error: s("", "×"),
665
+ fatal: s("", "×"),
666
+ ready: s("", ""),
667
+ warn: s("", ""),
668
+ info: s("", "i"),
669
+ success: s("", ""),
670
+ debug: s("", "D"),
671
+ trace: s("", ""),
672
+ fail: s("", "×"),
673
+ start: s("", "o"),
674
+ log: ""
841
675
  };
842
- function stringWidth2(str) {
843
- if (!Intl.Segmenter) {
844
- return stripAnsi2(str).length;
845
- }
846
- return stringWidth(str);
676
+ function stringWidth(str) {
677
+ if (!Intl.Segmenter) return stripAnsi(str).length;
678
+ return stringWidth$1(str);
847
679
  }
848
680
  var FancyReporter = class extends BasicReporter {
849
- formatStack(stack) {
850
- return `
851
- ${parseStack(stack).map(
852
- (line) => ` ${line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)}`
853
- ).join("\n")}`;
854
- }
855
- formatType(logObj, isBadge, opts) {
856
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
857
- if (isBadge) {
858
- return getBgColor(typeColor)(
859
- colors.black(` ${logObj.type.toUpperCase()} `)
860
- );
861
- }
862
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
863
- return _type ? getColor2(typeColor)(_type) : "";
864
- }
865
- formatLogObj(logObj, opts) {
866
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
867
- "\n"
868
- );
869
- if (logObj.type === "box") {
870
- return box(
871
- characterFormat(
872
- message + (additional.length > 0 ? `
873
- ${additional.join("\n")}` : "")
874
- ),
875
- {
876
- title: logObj.title ? characterFormat(logObj.title) : void 0,
877
- style: logObj.style
878
- }
879
- );
880
- }
881
- const date = this.formatDate(logObj.date, opts);
882
- const coloredDate = date && colors.gray(date);
883
- const isBadge = logObj.badge ?? logObj.level < 2;
884
- const type = this.formatType(logObj, isBadge, opts);
885
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
886
- let line;
887
- const left = this.filterAndJoin([type, characterFormat(message)]);
888
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
889
- const space = (opts.columns || 0) - stringWidth2(left) - stringWidth2(right) - 2;
890
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
891
- line += characterFormat(
892
- additional.length > 0 ? `
893
- ${additional.join("\n")}` : ""
894
- );
895
- if (logObj.type === "trace") {
896
- const _err = new Error(`Trace: ${logObj.message}`);
897
- line += this.formatStack(_err.stack || "");
898
- }
899
- return isBadge ? `
900
- ${line}
901
- ` : line;
902
- }
681
+ formatStack(stack) {
682
+ return `\n${parseStack(stack).map((line) => ` ${line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)}`).join("\n")}`;
683
+ }
684
+ formatType(logObj, isBadge, _opts) {
685
+ const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
686
+ if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
687
+ const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
688
+ return _type ? getColor(typeColor)(_type) : "";
689
+ }
690
+ formatLogObj(logObj, opts) {
691
+ const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
692
+ if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? `\n${additional.join("\n")}` : "")), {
693
+ title: logObj.title ? characterFormat(logObj.title) : void 0,
694
+ style: logObj.style
695
+ });
696
+ const date = this.formatDate(logObj.date, opts);
697
+ const coloredDate = date && colors.gray(date);
698
+ const isBadge = logObj.badge ?? logObj.level < 2;
699
+ const type = this.formatType(logObj, isBadge, opts);
700
+ const tag = logObj.tag ? colors.gray(logObj.tag) : "";
701
+ let line;
702
+ const left = this.filterAndJoin([type, characterFormat(message)]);
703
+ const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
704
+ const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
705
+ line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
706
+ line += characterFormat(additional.length > 0 ? `\n${additional.join("\n")}` : "");
707
+ if (logObj.type === "trace") {
708
+ const _err = new Error(`Trace: ${logObj.message}`);
709
+ line += this.formatStack(_err.stack || "");
710
+ }
711
+ return isBadge ? `\n${line}\n` : line;
712
+ }
903
713
  };
904
714
  function characterFormat(str) {
905
- return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
715
+ return str.replaceAll(/`([^`]+)`/g, (_, m) => colors.cyan(m)).replaceAll(/\s+_([^_]+)_\s+/g, (_, m) => ` ${colors.underline(m)} `);
906
716
  }
907
- function getColor2(color = "white") {
908
- return colors[color] || colors.white;
717
+ function getColor(color = "white") {
718
+ return colors[color] || colors.white;
909
719
  }
910
720
  function getBgColor(color = "bgWhite") {
911
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
721
+ return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
912
722
  }
913
723
 
914
- // consola/index.ts
915
- function createConsola2(options = {}) {
916
- let level = _getDefaultLogLevel();
917
- if (process.env.CONSOLA_LEVEL) {
918
- level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
919
- }
920
- const consola2 = createConsola({
921
- level,
922
- defaults: { level },
923
- stdout: process.stdout,
924
- stderr: process.stderr,
925
- reporters: options.reporters || [
926
- options.fancy ?? !(import_std_env.isCI || import_std_env.isTest) ? new FancyReporter() : new BasicReporter()
927
- ],
928
- ...options
929
- });
930
- return consola2;
724
+ //#endregion
725
+ //#region consola/index.ts
726
+ function createConsola(options = {}) {
727
+ let level = _getDefaultLogLevel();
728
+ if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
729
+ const consola$1 = createConsola$1({
730
+ level,
731
+ defaults: { level },
732
+ stdout: process.stdout,
733
+ stderr: process.stderr,
734
+ reporters: options.reporters || [options.fancy ?? !(std_env.isCI || std_env.isTest) ? new FancyReporter() : new BasicReporter()],
735
+ ...options
736
+ });
737
+ return consola$1;
931
738
  }
932
739
  function _getDefaultLogLevel() {
933
- if (import_std_env.isDebug) {
934
- return LogLevels.debug;
935
- }
936
- if (import_std_env.isTest) {
937
- return LogLevels.warn;
938
- }
939
- return LogLevels.info;
740
+ if (std_env.isDebug) return LogLevels.debug;
741
+ if (std_env.isTest) return LogLevels.warn;
742
+ return LogLevels.info;
940
743
  }
941
- var consola = createConsola2();
942
-
943
- // consola/reporters/file.ts
944
- var import_fs = require("fs");
945
- var fs = __toESM(require("fs"));
946
- var import_path2 = require("path");
947
- var import_cron = require("cron");
744
+ const consola = createConsola();
948
745
 
949
- // tool.util.ts
950
- var import_path = __toESM(require("path"));
951
- var getShortTime = (date) => {
952
- return Intl.DateTimeFormat("en-US", {
953
- timeStyle: "medium",
954
- hour12: false
955
- }).format(date);
956
- };
957
- var getShortDate = (date) => {
958
- return Intl.DateTimeFormat("en-US", {
959
- dateStyle: "short"
960
- }).format(date).replace(/\//g, "-");
961
- };
962
- var getLogFilePath = (logDir, formatString) => import_path.default.resolve(logDir, formatString.replace(/%d/g, getShortDate(/* @__PURE__ */ new Date())));
746
+ //#endregion
747
+ //#region tool.util.ts
748
+ function getShortTime(date) {
749
+ return Intl.DateTimeFormat("en-US", {
750
+ timeStyle: "medium",
751
+ hour12: false
752
+ }).format(date);
753
+ }
754
+ function getShortDate(date) {
755
+ return Intl.DateTimeFormat("en-US", { dateStyle: "short" }).format(date).replaceAll("/", "-");
756
+ }
757
+ function getLogFilePath(logDir, formatString) {
758
+ return node_path.default.resolve(logDir, formatString.replaceAll("%d", getShortDate(new Date())));
759
+ }
963
760
 
964
- // consola/reporters/logger.ts
965
- var import_picocolors = __toESM(require("picocolors"));
966
- var import_std_env2 = require("std-env");
761
+ //#endregion
762
+ //#region consola/reporters/logger.ts
967
763
  var LoggerReporter = class extends FancyReporter {
968
- constructor() {
969
- super(...arguments);
970
- this.latestLogTime = Date.now();
971
- }
972
- formatDate(date, opts) {
973
- const isInVirtualTerminal = typeof opts.columns === "undefined";
974
- if (import_std_env2.isDevelopment) {
975
- const now = Date.now();
976
- const delta = now - this.latestLogTime;
977
- this.latestLogTime = now;
978
- return `+${delta | 0}ms ${super.formatDate(date, opts)}`;
979
- }
980
- return isInVirtualTerminal ? "" : super.formatDate(date, opts);
981
- }
982
- formatLogObj(logObj, opts) {
983
- const isInVirtualTerminal = typeof opts.columns === "undefined";
984
- return isInVirtualTerminal ? `${import_picocolors.default.gray(getShortTime(/* @__PURE__ */ new Date()))} ${super.formatLogObj(logObj, opts).replace(/^\n/, "")}`.trimEnd() : super.formatLogObj(logObj, opts);
985
- }
764
+ constructor(..._args) {
765
+ super(..._args);
766
+ this.latestLogTime = Date.now();
767
+ }
768
+ formatDate(date, opts) {
769
+ const isInVirtualTerminal = opts.columns === void 0;
770
+ if (std_env.isDevelopment) {
771
+ const now = Date.now();
772
+ const delta = now - this.latestLogTime;
773
+ this.latestLogTime = now;
774
+ return `+${delta | 0}ms ${super.formatDate(date, opts)}`;
775
+ }
776
+ return isInVirtualTerminal ? "" : super.formatDate(date, opts);
777
+ }
778
+ formatLogObj(logObj, opts) {
779
+ const isInVirtualTerminal = opts.columns === void 0;
780
+ return isInVirtualTerminal ? `${picocolors.default.gray(getShortTime(new Date()))} ${super.formatLogObj(logObj, opts).replace(/^\n/, "")}`.trimEnd() : super.formatLogObj(logObj, opts);
781
+ }
986
782
  };
987
783
 
988
- // consola/reporters/file.ts
784
+ //#endregion
785
+ //#region consola/reporters/file.ts
989
786
  var FileReporter = class extends LoggerReporter {
990
- constructor(configs) {
991
- super();
992
- this.configs = configs;
993
- this.refreshWriteStream();
994
- this.scheduleRefreshWriteStream();
995
- }
996
- scheduleRefreshWriteStream() {
997
- const { cron = "0 0 * * *" } = this.configs;
998
- const job = new import_cron.CronJob(cron, this.refreshWriteStream.bind(this));
999
- job.start();
1000
- this.__job = job;
1001
- }
1002
- teardown() {
1003
- this.__job?.stop();
1004
- this.stdoutStream?.end();
1005
- this.stderrStream?.end();
1006
- }
1007
- refreshWriteStream() {
1008
- const {
1009
- loggerDir,
1010
- stderrFileFormat = "error.log",
1011
- stdoutFileFormat = "stdout_%d.log"
1012
- } = this.configs;
1013
- const stdoutPath = getLogFilePath(loggerDir, stdoutFileFormat);
1014
- const stderrPath = getLogFilePath(loggerDir, stderrFileFormat);
1015
- createLoggerFileIfNotExist(stdoutPath);
1016
- createLoggerFileIfNotExist(stderrPath);
1017
- const options = {
1018
- encoding: "utf-8",
1019
- flags: "a+"
1020
- };
1021
- [this.stderrStream, this.stdoutStream].forEach((stream) => {
1022
- stream?.end();
1023
- });
1024
- this.stdoutStream = (0, import_fs.createWriteStream)(stdoutPath, options);
1025
- this.stderrStream = (0, import_fs.createWriteStream)(stderrPath, options);
1026
- [this.stderrStream, this.stdoutStream].forEach((stream) => {
1027
- writeStream(
1028
- "\n========================================================\n",
1029
- stream
1030
- );
1031
- });
1032
- }
1033
- log(logObj, ctx) {
1034
- if (!this.stdoutStream || !this.stderrStream) {
1035
- return;
1036
- }
1037
- const finalStdout = this.stdoutStream;
1038
- const finalStderr = this.stderrStream || this.stdoutStream;
1039
- const line = super.formatLogObj(logObj, {
1040
- ...ctx.options.formatOptions,
1041
- columns: void 0
1042
- });
1043
- if (this.configs.errWriteToStdout && logObj.level < 2) {
1044
- writeStream(`${line}
1045
- `, finalStdout);
1046
- }
1047
- return writeStream(
1048
- `${line}
1049
- `,
1050
- logObj.level < 2 ? finalStderr : finalStdout
1051
- );
1052
- }
1053
- };
1054
- var createLoggerFileIfNotExist = (path2) => {
1055
- const dirPath = (0, import_path2.dirname)(path2);
1056
- if (!fs.existsSync(dirPath)) {
1057
- fs.mkdirSync(dirPath, { recursive: true });
1058
- }
1059
- if (!fs.existsSync(path2)) {
1060
- fs.writeFileSync(path2, "", { flag: "wx" });
1061
- }
787
+ constructor(configs) {
788
+ super();
789
+ this.configs = configs;
790
+ this.refreshWriteStream();
791
+ this.scheduleRefreshWriteStream();
792
+ }
793
+ scheduleRefreshWriteStream() {
794
+ const { cron: cron$1 = "0 0 * * *" } = this.configs;
795
+ const job = new cron.CronJob(cron$1, this.refreshWriteStream.bind(this));
796
+ job.start();
797
+ this.__job = job;
798
+ }
799
+ teardown() {
800
+ this.__job?.stop();
801
+ this.stdoutStream?.end();
802
+ this.stderrStream?.end();
803
+ }
804
+ refreshWriteStream() {
805
+ const { loggerDir, stderrFileFormat = "error.log", stdoutFileFormat = "stdout_%d.log" } = this.configs;
806
+ const stdoutPath = getLogFilePath(loggerDir, stdoutFileFormat);
807
+ const stderrPath = getLogFilePath(loggerDir, stderrFileFormat);
808
+ createLoggerFileIfNotExist(stdoutPath);
809
+ createLoggerFileIfNotExist(stderrPath);
810
+ const options = {
811
+ encoding: "utf-8",
812
+ flags: "a+"
813
+ };
814
+ [this.stderrStream, this.stdoutStream].forEach((stream) => {
815
+ stream?.end();
816
+ });
817
+ this.stdoutStream = (0, node_fs.createWriteStream)(stdoutPath, options);
818
+ this.stderrStream = (0, node_fs.createWriteStream)(stderrPath, options);
819
+ [this.stderrStream, this.stdoutStream].forEach((stream) => {
820
+ writeStream("\n========================================================\n", stream);
821
+ });
822
+ }
823
+ log(logObj, ctx) {
824
+ if (!this.stdoutStream || !this.stderrStream) return;
825
+ const finalStdout = this.stdoutStream;
826
+ const finalStderr = this.stderrStream || this.stdoutStream;
827
+ const line = super.formatLogObj(logObj, {
828
+ ...ctx.options.formatOptions,
829
+ columns: void 0
830
+ });
831
+ if (this.configs.errWriteToStdout && logObj.level < 2) writeStream(`${line}\n`, finalStdout);
832
+ return writeStream(`${line}\n`, logObj.level < 2 ? finalStderr : finalStdout);
833
+ }
1062
834
  };
835
+ function createLoggerFileIfNotExist(path$1) {
836
+ const dirPath = (0, node_path.dirname)(path$1);
837
+ if (!node_fs.existsSync(dirPath)) node_fs.mkdirSync(dirPath, { recursive: true });
838
+ if (!node_fs.existsSync(path$1)) node_fs.writeFileSync(path$1, "", { flag: "wx" });
839
+ }
1063
840
 
1064
- // consola/reporters/subscriber.ts
1065
- var import_events = __toESM(require("events"));
1066
- var wrapperSubscribers = (consola2) => {
1067
- Object.assign(consola2, {
1068
- onData: (handler) => SubscriberReporter.subscriber.on("log", handler),
1069
- onStdOut: (handler) => SubscriberReporter.subscriber.on("stdout", handler),
1070
- onStdErr: (handler) => SubscriberReporter.subscriber.on("stderr", handler)
1071
- });
1072
- return consola2;
1073
- };
1074
- var _SubscriberReporter = class _SubscriberReporter extends LoggerReporter {
1075
- log(logObj, ctx) {
1076
- const line = super.formatLogObj(logObj, ctx);
1077
- const event = logObj.level < 2 ? "stderr" : "stdout";
1078
- _SubscriberReporter.subscriber.emit(event, line);
1079
- _SubscriberReporter.subscriber.emit("log", line);
1080
- }
841
+ //#endregion
842
+ //#region consola/reporters/subscriber.ts
843
+ function wrapperSubscribers(consola$1) {
844
+ Object.assign(consola$1, {
845
+ onData: (handler) => SubscriberReporter.subscriber.on("log", handler),
846
+ onStdOut: (handler) => SubscriberReporter.subscriber.on("stdout", handler),
847
+ onStdErr: (handler) => SubscriberReporter.subscriber.on("stderr", handler)
848
+ });
849
+ return consola$1;
850
+ }
851
+ var SubscriberReporter = class SubscriberReporter extends LoggerReporter {
852
+ log(logObj, ctx) {
853
+ const line = super.formatLogObj(logObj, ctx);
854
+ const event = logObj.level < 2 ? "stderr" : "stdout";
855
+ SubscriberReporter.subscriber.emit(event, line);
856
+ SubscriberReporter.subscriber.emit("log", line);
857
+ }
1081
858
  };
1082
- _SubscriberReporter.subscriber = new import_events.default();
1083
- var SubscriberReporter = _SubscriberReporter;
859
+ SubscriberReporter.subscriber = new node_events.default();
1084
860
 
1085
- // consola.instance.ts
1086
- var createLoggerConsola = (options) => {
1087
- const reporters = [
1088
- new FancyReporter(),
1089
- new SubscriberReporter()
1090
- ];
1091
- if (options?.writeToFile) {
1092
- reporters.push(new FileReporter(options.writeToFile));
1093
- }
1094
- const consola2 = createConsola2({
1095
- formatOptions: {
1096
- date: true
1097
- },
1098
- reporters,
1099
- level: import_std_env3.isDevelopment ? LogLevels.trace : LogLevels.info,
1100
- ...options
1101
- });
1102
- return wrapperSubscribers(consola2);
1103
- };
861
+ //#endregion
862
+ //#region consola.instance.ts
863
+ function createLoggerConsola(options) {
864
+ const reporters = [new FancyReporter(), new SubscriberReporter()];
865
+ if (options?.writeToFile) reporters.push(new FileReporter(options.writeToFile));
866
+ const consola$1 = createConsola({
867
+ formatOptions: { date: true },
868
+ reporters,
869
+ level: std_env.isDevelopment ? LogLevels.trace : LogLevels.info,
870
+ ...options
871
+ });
872
+ return wrapperSubscribers(consola$1);
873
+ }
1104
874
 
1105
- // consola/reporters/browser.ts
875
+ //#endregion
876
+ //#region consola/reporters/browser.ts
1106
877
  var BrowserReporter = class {
1107
- constructor(options) {
1108
- this.options = { ...options };
1109
- this.defaultColor = "#7f8c8d";
1110
- this.levelColorMap = {
1111
- 0: "#c0392b",
1112
- // Red
1113
- 1: "#f39c12",
1114
- // Yellow
1115
- 3: "#00BCD4"
1116
- // Cyan
1117
- };
1118
- this.typeColorMap = {
1119
- success: "#2ecc71"
1120
- // Green
1121
- };
1122
- }
1123
- _getLogFn(level) {
1124
- if (level < 1) {
1125
- return console.__error || console.error;
1126
- }
1127
- if (level === 1) {
1128
- return console.__warn || console.warn;
1129
- }
1130
- return console.__log || console.log;
1131
- }
1132
- log(logObj) {
1133
- const consoleLogFn = this._getLogFn(logObj.level);
1134
- const type = logObj.type === "log" ? "" : logObj.type;
1135
- const tag = logObj.tag || "";
1136
- const color = this.typeColorMap[logObj.type] || this.levelColorMap[logObj.level] || this.defaultColor;
1137
- const style = `
878
+ constructor(options) {
879
+ this.options = { ...options };
880
+ this.defaultColor = "#7f8c8d";
881
+ this.levelColorMap = {
882
+ 0: "#c0392b",
883
+ 1: "#f39c12",
884
+ 3: "#00BCD4"
885
+ };
886
+ this.typeColorMap = { success: "#2ecc71" };
887
+ }
888
+ _getLogFn(level) {
889
+ if (level < 1) return console.__error || console.error;
890
+ if (level === 1) return console.__warn || console.warn;
891
+ return console.__log || console.log;
892
+ }
893
+ log(logObj) {
894
+ const consoleLogFn = this._getLogFn(logObj.level);
895
+ const type = logObj.type === "log" ? "" : logObj.type;
896
+ const tag = logObj.tag || "";
897
+ const color = this.typeColorMap[logObj.type] || this.levelColorMap[logObj.level] || this.defaultColor;
898
+ const style = `
1138
899
  background: ${color};
1139
900
  border-radius: 0.5em;
1140
901
  color: white;
1141
902
  font-weight: bold;
1142
903
  padding: 2px 0.5em;
1143
904
  `;
1144
- const badge = `%c${[tag, type].filter(Boolean).join(":")}`;
1145
- if (typeof logObj.args[0] === "string") {
1146
- consoleLogFn(
1147
- `${badge}%c ${logObj.args[0]}`,
1148
- style,
1149
- // Empty string as style resets to default console style
1150
- "",
1151
- ...logObj.args.slice(1)
1152
- );
1153
- } else {
1154
- consoleLogFn(badge, style, ...logObj.args);
1155
- }
1156
- }
905
+ const badge = `%c${[tag, type].filter(Boolean).join(":")}`;
906
+ if (typeof logObj.args[0] === "string") consoleLogFn(
907
+ `${badge}%c ${logObj.args[0]}`,
908
+ style,
909
+ // Empty string as style resets to default console style
910
+ "",
911
+ ...logObj.args.slice(1)
912
+ );
913
+ else consoleLogFn(badge, style, ...logObj.args);
914
+ }
1157
915
  };
1158
- // Annotate the CommonJS export names for ESM import in node:
1159
- 0 && (module.exports = {
1160
- BasicReporter,
1161
- BrowserReporter,
1162
- Consola,
1163
- FancyReporter,
1164
- FileReporter,
1165
- LEVEL_COLOR_MAP,
1166
- LogLevels,
1167
- LogTypes,
1168
- LoggerReporter,
1169
- SubscriberReporter,
1170
- TYPE_COLOR_MAP,
1171
- consola,
1172
- createConsola,
1173
- createLoggerConsola,
1174
- wrapperSubscribers
1175
- });
916
+
917
+ //#endregion
918
+ exports.BasicReporter = BasicReporter;
919
+ exports.BrowserReporter = BrowserReporter;
920
+ exports.Consola = Consola;
921
+ exports.FancyReporter = FancyReporter;
922
+ exports.FileReporter = FileReporter;
923
+ exports.LEVEL_COLOR_MAP = LEVEL_COLOR_MAP;
924
+ exports.LogLevels = LogLevels;
925
+ exports.LogTypes = LogTypes;
926
+ exports.LoggerReporter = LoggerReporter;
927
+ exports.SubscriberReporter = SubscriberReporter;
928
+ exports.TYPE_COLOR_MAP = TYPE_COLOR_MAP;
929
+ exports.consola = consola;
930
+ exports.createConsola = createConsola;
931
+ exports.createLoggerConsola = createLoggerConsola;
932
+ exports.wrapperSubscribers = wrapperSubscribers;