@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/consola/consola.ts +15 -15
- package/consola/constants.ts +0 -1
- package/consola/index.ts +3 -3
- package/consola/reporters/basic.ts +2 -2
- package/consola/reporters/browser.ts +1 -0
- package/consola/reporters/fancy.ts +8 -8
- package/consola/reporters/file.ts +7 -6
- package/consola/reporters/logger.ts +4 -4
- package/consola/reporters/subscriber.ts +4 -5
- package/consola/shared.ts +3 -4
- package/consola/utils/string.ts +6 -1
- package/consola/utils.ts +3 -3
- package/consola.instance.ts +3 -3
- package/dist/index.d.mts +153 -137
- package/dist/index.d.ts +153 -137
- package/dist/index.js +821 -1064
- package/dist/index.mjs +817 -1022
- package/index.ts +1 -1
- package/package.json +7 -7
- package/tool.util.ts +7 -16
- package/{tsup.config.ts → tsdown.config.ts} +1 -1
package/dist/index.js
CHANGED
|
@@ -1,422 +1,304 @@
|
|
|
1
|
-
|
|
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
|
|
9
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region consola/utils/log.ts
|
|
131
73
|
function isPlainObject(obj) {
|
|
132
|
-
|
|
74
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
133
75
|
}
|
|
134
76
|
function isLogObj(arg) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
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
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
-
|
|
310
|
+
function createConsola$1(options = {}) {
|
|
311
|
+
return new Consola(options);
|
|
430
312
|
}
|
|
431
313
|
|
|
432
|
-
|
|
433
|
-
|
|
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
|
-
|
|
439
|
-
|
|
440
|
-
|
|
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
|
-
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region consola/utils/stream.ts
|
|
444
324
|
function writeStream(data, stream) {
|
|
445
|
-
|
|
446
|
-
|
|
325
|
+
const write = stream.__write || stream.write;
|
|
326
|
+
return write.call(stream, data);
|
|
447
327
|
}
|
|
448
328
|
|
|
449
|
-
|
|
450
|
-
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region consola/reporters/basic.ts
|
|
331
|
+
const bracket = (x) => x ? `[${x}]` : "";
|
|
451
332
|
var BasicReporter = class {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
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
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
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
|
-
|
|
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
|
-
|
|
393
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
521
394
|
}
|
|
522
395
|
function isWide(x) {
|
|
523
|
-
|
|
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
|
-
|
|
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
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
return 1;
|
|
405
|
+
validate(codePoint);
|
|
406
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
|
|
407
|
+
return 1;
|
|
536
408
|
}
|
|
537
|
-
|
|
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
|
|
541
|
-
|
|
542
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
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
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
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
|
-
|
|
458
|
+
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
590
459
|
}
|
|
591
460
|
function clearBleed(index, string, open, close, replace) {
|
|
592
|
-
|
|
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
|
-
|
|
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
|
-
|
|
467
|
+
return filterEmpty(`\u001B[${open}m`, `\u001B[${close}m`, replace);
|
|
599
468
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
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
|
-
|
|
513
|
+
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
645
514
|
}
|
|
646
|
-
|
|
647
|
-
function getColor(color, fallback = "reset") {
|
|
648
|
-
|
|
515
|
+
const colors = createColors();
|
|
516
|
+
function getColor$1(color, fallback = "reset") {
|
|
517
|
+
return colors[color] || colors[fallback];
|
|
649
518
|
}
|
|
650
519
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
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
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
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
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
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
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
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
|
-
|
|
641
|
+
//#endregion
|
|
642
|
+
//#region consola/utils/tester.ts
|
|
805
643
|
function isUnicodeSupported() {
|
|
806
|
-
|
|
807
|
-
|
|
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
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
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
|
-
|
|
824
|
-
|
|
825
|
-
|
|
657
|
+
const LEVEL_COLOR_MAP = {
|
|
658
|
+
0: "red",
|
|
659
|
+
1: "yellow"
|
|
826
660
|
};
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
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
|
|
843
|
-
|
|
844
|
-
|
|
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
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
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
|
-
|
|
715
|
+
return str.replaceAll(/`([^`]+)`/g, (_, m) => colors.cyan(m)).replaceAll(/\s+_([^_]+)_\s+/g, (_, m) => ` ${colors.underline(m)} `);
|
|
906
716
|
}
|
|
907
|
-
function
|
|
908
|
-
|
|
717
|
+
function getColor(color = "white") {
|
|
718
|
+
return colors[color] || colors.white;
|
|
909
719
|
}
|
|
910
720
|
function getBgColor(color = "bgWhite") {
|
|
911
|
-
|
|
721
|
+
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
|
|
912
722
|
}
|
|
913
723
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
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
|
-
|
|
934
|
-
|
|
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
|
-
|
|
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
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
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
|
-
|
|
965
|
-
|
|
966
|
-
var import_std_env2 = require("std-env");
|
|
761
|
+
//#endregion
|
|
762
|
+
//#region consola/reporters/logger.ts
|
|
967
763
|
var LoggerReporter = class extends FancyReporter {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
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
|
-
|
|
784
|
+
//#endregion
|
|
785
|
+
//#region consola/reporters/file.ts
|
|
989
786
|
var FileReporter = class extends LoggerReporter {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
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
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
}
|
|
1074
|
-
var
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
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
|
-
|
|
1083
|
-
var SubscriberReporter = _SubscriberReporter;
|
|
859
|
+
SubscriberReporter.subscriber = new node_events.default();
|
|
1084
860
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
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
|
-
|
|
875
|
+
//#endregion
|
|
876
|
+
//#region consola/reporters/browser.ts
|
|
1106
877
|
var BrowserReporter = class {
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
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
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
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
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
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;
|