@nice-move/cli 0.11.5 → 0.11.6

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.
@@ -1,938 +0,0 @@
1
- export const id = "vendors-node_modules_log-update_index_js";
2
- export const ids = ["vendors-node_modules_log-update_index_js"];
3
- export const modules = {
4
-
5
- /***/ "../../node_modules/restore-cursor/node_modules/mimic-fn/index.js":
6
- /*!************************************************************************!*\
7
- !*** ../../node_modules/restore-cursor/node_modules/mimic-fn/index.js ***!
8
- \************************************************************************/
9
- /***/ ((module) => {
10
-
11
-
12
-
13
- const mimicFn = (to, from) => {
14
- for (const prop of Reflect.ownKeys(from)) {
15
- Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
16
- }
17
-
18
- return to;
19
- };
20
-
21
- module.exports = mimicFn;
22
- // TODO: Remove this for the next major release
23
- module.exports["default"] = mimicFn;
24
-
25
-
26
- /***/ }),
27
-
28
- /***/ "../../node_modules/restore-cursor/node_modules/onetime/index.js":
29
- /*!***********************************************************************!*\
30
- !*** ../../node_modules/restore-cursor/node_modules/onetime/index.js ***!
31
- \***********************************************************************/
32
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33
-
34
-
35
- const mimicFn = __webpack_require__(/*! mimic-fn */ "../../node_modules/restore-cursor/node_modules/mimic-fn/index.js");
36
-
37
- const calledFunctions = new WeakMap();
38
-
39
- const onetime = (function_, options = {}) => {
40
- if (typeof function_ !== 'function') {
41
- throw new TypeError('Expected a function');
42
- }
43
-
44
- let returnValue;
45
- let callCount = 0;
46
- const functionName = function_.displayName || function_.name || '<anonymous>';
47
-
48
- const onetime = function (...arguments_) {
49
- calledFunctions.set(onetime, ++callCount);
50
-
51
- if (callCount === 1) {
52
- returnValue = function_.apply(this, arguments_);
53
- function_ = null;
54
- } else if (options.throw === true) {
55
- throw new Error(`Function \`${functionName}\` can only be called once`);
56
- }
57
-
58
- return returnValue;
59
- };
60
-
61
- mimicFn(onetime, function_);
62
- calledFunctions.set(onetime, callCount);
63
-
64
- return onetime;
65
- };
66
-
67
- module.exports = onetime;
68
- // TODO: Remove this for the next major release
69
- module.exports["default"] = onetime;
70
-
71
- module.exports.callCount = function_ => {
72
- if (!calledFunctions.has(function_)) {
73
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
74
- }
75
-
76
- return calledFunctions.get(function_);
77
- };
78
-
79
-
80
- /***/ }),
81
-
82
- /***/ "../../node_modules/signal-exit/index.js":
83
- /*!***********************************************!*\
84
- !*** ../../node_modules/signal-exit/index.js ***!
85
- \***********************************************/
86
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
87
-
88
- // Note: since nyc uses this module to output coverage, any lines
89
- // that are in the direct sync flow of nyc's outputCoverage are
90
- // ignored, since we can never get coverage for them.
91
- // grab a reference to node's real process object right away
92
- var process = global.process
93
-
94
- const processOk = function (process) {
95
- return process &&
96
- typeof process === 'object' &&
97
- typeof process.removeListener === 'function' &&
98
- typeof process.emit === 'function' &&
99
- typeof process.reallyExit === 'function' &&
100
- typeof process.listeners === 'function' &&
101
- typeof process.kill === 'function' &&
102
- typeof process.pid === 'number' &&
103
- typeof process.on === 'function'
104
- }
105
-
106
- // some kind of non-node environment, just no-op
107
- /* istanbul ignore if */
108
- if (!processOk(process)) {
109
- module.exports = function () {
110
- return function () {}
111
- }
112
- } else {
113
- var assert = __webpack_require__(/*! assert */ "assert")
114
- var signals = __webpack_require__(/*! ./signals.js */ "../../node_modules/signal-exit/signals.js")
115
- var isWin = /^win/i.test(process.platform)
116
-
117
- var EE = __webpack_require__(/*! events */ "events")
118
- /* istanbul ignore if */
119
- if (typeof EE !== 'function') {
120
- EE = EE.EventEmitter
121
- }
122
-
123
- var emitter
124
- if (process.__signal_exit_emitter__) {
125
- emitter = process.__signal_exit_emitter__
126
- } else {
127
- emitter = process.__signal_exit_emitter__ = new EE()
128
- emitter.count = 0
129
- emitter.emitted = {}
130
- }
131
-
132
- // Because this emitter is a global, we have to check to see if a
133
- // previous version of this library failed to enable infinite listeners.
134
- // I know what you're about to say. But literally everything about
135
- // signal-exit is a compromise with evil. Get used to it.
136
- if (!emitter.infinite) {
137
- emitter.setMaxListeners(Infinity)
138
- emitter.infinite = true
139
- }
140
-
141
- module.exports = function (cb, opts) {
142
- /* istanbul ignore if */
143
- if (!processOk(global.process)) {
144
- return function () {}
145
- }
146
- assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
147
-
148
- if (loaded === false) {
149
- load()
150
- }
151
-
152
- var ev = 'exit'
153
- if (opts && opts.alwaysLast) {
154
- ev = 'afterexit'
155
- }
156
-
157
- var remove = function () {
158
- emitter.removeListener(ev, cb)
159
- if (emitter.listeners('exit').length === 0 &&
160
- emitter.listeners('afterexit').length === 0) {
161
- unload()
162
- }
163
- }
164
- emitter.on(ev, cb)
165
-
166
- return remove
167
- }
168
-
169
- var unload = function unload () {
170
- if (!loaded || !processOk(global.process)) {
171
- return
172
- }
173
- loaded = false
174
-
175
- signals.forEach(function (sig) {
176
- try {
177
- process.removeListener(sig, sigListeners[sig])
178
- } catch (er) {}
179
- })
180
- process.emit = originalProcessEmit
181
- process.reallyExit = originalProcessReallyExit
182
- emitter.count -= 1
183
- }
184
- module.exports.unload = unload
185
-
186
- var emit = function emit (event, code, signal) {
187
- /* istanbul ignore if */
188
- if (emitter.emitted[event]) {
189
- return
190
- }
191
- emitter.emitted[event] = true
192
- emitter.emit(event, code, signal)
193
- }
194
-
195
- // { <signal>: <listener fn>, ... }
196
- var sigListeners = {}
197
- signals.forEach(function (sig) {
198
- sigListeners[sig] = function listener () {
199
- /* istanbul ignore if */
200
- if (!processOk(global.process)) {
201
- return
202
- }
203
- // If there are no other listeners, an exit is coming!
204
- // Simplest way: remove us and then re-send the signal.
205
- // We know that this will kill the process, so we can
206
- // safely emit now.
207
- var listeners = process.listeners(sig)
208
- if (listeners.length === emitter.count) {
209
- unload()
210
- emit('exit', null, sig)
211
- /* istanbul ignore next */
212
- emit('afterexit', null, sig)
213
- /* istanbul ignore next */
214
- if (isWin && sig === 'SIGHUP') {
215
- // "SIGHUP" throws an `ENOSYS` error on Windows,
216
- // so use a supported signal instead
217
- sig = 'SIGINT'
218
- }
219
- /* istanbul ignore next */
220
- process.kill(process.pid, sig)
221
- }
222
- }
223
- })
224
-
225
- module.exports.signals = function () {
226
- return signals
227
- }
228
-
229
- var loaded = false
230
-
231
- var load = function load () {
232
- if (loaded || !processOk(global.process)) {
233
- return
234
- }
235
- loaded = true
236
-
237
- // This is the number of onSignalExit's that are in play.
238
- // It's important so that we can count the correct number of
239
- // listeners on signals, and don't wait for the other one to
240
- // handle it instead of us.
241
- emitter.count += 1
242
-
243
- signals = signals.filter(function (sig) {
244
- try {
245
- process.on(sig, sigListeners[sig])
246
- return true
247
- } catch (er) {
248
- return false
249
- }
250
- })
251
-
252
- process.emit = processEmit
253
- process.reallyExit = processReallyExit
254
- }
255
- module.exports.load = load
256
-
257
- var originalProcessReallyExit = process.reallyExit
258
- var processReallyExit = function processReallyExit (code) {
259
- /* istanbul ignore if */
260
- if (!processOk(global.process)) {
261
- return
262
- }
263
- process.exitCode = code || /* istanbul ignore next */ 0
264
- emit('exit', process.exitCode, null)
265
- /* istanbul ignore next */
266
- emit('afterexit', process.exitCode, null)
267
- /* istanbul ignore next */
268
- originalProcessReallyExit.call(process, process.exitCode)
269
- }
270
-
271
- var originalProcessEmit = process.emit
272
- var processEmit = function processEmit (ev, arg) {
273
- if (ev === 'exit' && processOk(global.process)) {
274
- /* istanbul ignore else */
275
- if (arg !== undefined) {
276
- process.exitCode = arg
277
- }
278
- var ret = originalProcessEmit.apply(this, arguments)
279
- /* istanbul ignore next */
280
- emit('exit', process.exitCode, null)
281
- /* istanbul ignore next */
282
- emit('afterexit', process.exitCode, null)
283
- /* istanbul ignore next */
284
- return ret
285
- } else {
286
- return originalProcessEmit.apply(this, arguments)
287
- }
288
- }
289
- }
290
-
291
-
292
- /***/ }),
293
-
294
- /***/ "../../node_modules/signal-exit/signals.js":
295
- /*!*************************************************!*\
296
- !*** ../../node_modules/signal-exit/signals.js ***!
297
- \*************************************************/
298
- /***/ ((module) => {
299
-
300
- // This is not the set of all possible signals.
301
- //
302
- // It IS, however, the set of all signals that trigger
303
- // an exit on either Linux or BSD systems. Linux is a
304
- // superset of the signal names supported on BSD, and
305
- // the unknown signals just fail to register, so we can
306
- // catch that easily enough.
307
- //
308
- // Don't bother with SIGKILL. It's uncatchable, which
309
- // means that we can't fire any callbacks anyway.
310
- //
311
- // If a user does happen to register a handler on a non-
312
- // fatal signal like SIGWINCH or something, and then
313
- // exit, it'll end up firing `process.emit('exit')`, so
314
- // the handler will be fired anyway.
315
- //
316
- // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
317
- // artificially, inherently leave the process in a
318
- // state from which it is not safe to try and enter JS
319
- // listeners.
320
- module.exports = [
321
- 'SIGABRT',
322
- 'SIGALRM',
323
- 'SIGHUP',
324
- 'SIGINT',
325
- 'SIGTERM'
326
- ]
327
-
328
- if (process.platform !== 'win32') {
329
- module.exports.push(
330
- 'SIGVTALRM',
331
- 'SIGXCPU',
332
- 'SIGXFSZ',
333
- 'SIGUSR2',
334
- 'SIGTRAP',
335
- 'SIGSYS',
336
- 'SIGQUIT',
337
- 'SIGIOT'
338
- // should detect profiler and enable/disable accordingly.
339
- // see #21
340
- // 'SIGPROF'
341
- )
342
- }
343
-
344
- if (process.platform === 'linux') {
345
- module.exports.push(
346
- 'SIGIO',
347
- 'SIGPOLL',
348
- 'SIGPWR',
349
- 'SIGSTKFLT',
350
- 'SIGUNUSED'
351
- )
352
- }
353
-
354
-
355
- /***/ }),
356
-
357
- /***/ "../../node_modules/cli-cursor/index.js":
358
- /*!**********************************************!*\
359
- !*** ../../node_modules/cli-cursor/index.js ***!
360
- \**********************************************/
361
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
362
-
363
- __webpack_require__.r(__webpack_exports__);
364
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
365
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
366
- /* harmony export */ });
367
- /* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ "node:process");
368
- /* harmony import */ var restore_cursor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! restore-cursor */ "../../node_modules/restore-cursor/index.js");
369
-
370
-
371
-
372
- let isHidden = false;
373
-
374
- const cliCursor = {};
375
-
376
- cliCursor.show = (writableStream = node_process__WEBPACK_IMPORTED_MODULE_0__.stderr) => {
377
- if (!writableStream.isTTY) {
378
- return;
379
- }
380
-
381
- isHidden = false;
382
- writableStream.write('\u001B[?25h');
383
- };
384
-
385
- cliCursor.hide = (writableStream = node_process__WEBPACK_IMPORTED_MODULE_0__.stderr) => {
386
- if (!writableStream.isTTY) {
387
- return;
388
- }
389
-
390
- (0,restore_cursor__WEBPACK_IMPORTED_MODULE_1__["default"])();
391
- isHidden = true;
392
- writableStream.write('\u001B[?25l');
393
- };
394
-
395
- cliCursor.toggle = (force, writableStream) => {
396
- if (force !== undefined) {
397
- isHidden = force;
398
- }
399
-
400
- if (isHidden) {
401
- cliCursor.show(writableStream);
402
- } else {
403
- cliCursor.hide(writableStream);
404
- }
405
- };
406
-
407
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cliCursor);
408
-
409
-
410
- /***/ }),
411
-
412
- /***/ "../../node_modules/log-update/index.js":
413
- /*!**********************************************!*\
414
- !*** ../../node_modules/log-update/index.js ***!
415
- \**********************************************/
416
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
417
-
418
- __webpack_require__.r(__webpack_exports__);
419
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
420
- /* harmony export */ createLogUpdate: () => (/* binding */ createLogUpdate),
421
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
422
- /* harmony export */ logUpdateStderr: () => (/* binding */ logUpdateStderr)
423
- /* harmony export */ });
424
- /* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ "node:process");
425
- /* harmony import */ var ansi_escapes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ansi-escapes */ "../../node_modules/log-update/node_modules/ansi-escapes/index.js");
426
- /* harmony import */ var cli_cursor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! cli-cursor */ "../../node_modules/cli-cursor/index.js");
427
- /* harmony import */ var wrap_ansi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! wrap-ansi */ "../../node_modules/wrap-ansi/index.js");
428
- /* harmony import */ var slice_ansi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! slice-ansi */ "../../node_modules/log-update/node_modules/slice-ansi/index.js");
429
- /* harmony import */ var strip_ansi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! strip-ansi */ "../../node_modules/strip-ansi/index.js");
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
- const defaultTerminalHeight = 24;
438
-
439
- const getWidth = stream => {
440
- const {columns} = stream;
441
-
442
- if (!columns) {
443
- return 80;
444
- }
445
-
446
- return columns;
447
- };
448
-
449
- const fitToTerminalHeight = (stream, text) => {
450
- const terminalHeight = stream.rows ?? defaultTerminalHeight;
451
- const lines = text.split('\n');
452
-
453
- const toRemove = lines.length - terminalHeight;
454
- if (toRemove <= 0) {
455
- return text;
456
- }
457
-
458
- return (0,slice_ansi__WEBPACK_IMPORTED_MODULE_4__["default"])(
459
- text,
460
- (0,strip_ansi__WEBPACK_IMPORTED_MODULE_5__["default"])(lines.slice(0, toRemove).join('\n')).length + 1,
461
- );
462
- };
463
-
464
- function createLogUpdate(stream, {showCursor = false} = {}) {
465
- let previousLineCount = 0;
466
- let previousWidth = getWidth(stream);
467
- let previousOutput = '';
468
-
469
- const render = (...arguments_) => {
470
- if (!showCursor) {
471
- cli_cursor__WEBPACK_IMPORTED_MODULE_2__["default"].hide();
472
- }
473
-
474
- let output = arguments_.join(' ') + '\n';
475
- output = fitToTerminalHeight(stream, output);
476
- const width = getWidth(stream);
477
- if (output === previousOutput && previousWidth === width) {
478
- return;
479
- }
480
-
481
- previousOutput = output;
482
- previousWidth = width;
483
- output = (0,wrap_ansi__WEBPACK_IMPORTED_MODULE_3__["default"])(output, width, {
484
- trim: false,
485
- hard: true,
486
- wordWrap: false,
487
- });
488
- stream.write(ansi_escapes__WEBPACK_IMPORTED_MODULE_1__["default"].eraseLines(previousLineCount) + output);
489
- previousLineCount = output.split('\n').length;
490
- };
491
-
492
- render.clear = () => {
493
- stream.write(ansi_escapes__WEBPACK_IMPORTED_MODULE_1__["default"].eraseLines(previousLineCount));
494
- previousOutput = '';
495
- previousWidth = getWidth(stream);
496
- previousLineCount = 0;
497
- };
498
-
499
- render.done = () => {
500
- previousOutput = '';
501
- previousWidth = getWidth(stream);
502
- previousLineCount = 0;
503
-
504
- if (!showCursor) {
505
- cli_cursor__WEBPACK_IMPORTED_MODULE_2__["default"].show();
506
- }
507
- };
508
-
509
- return render;
510
- }
511
-
512
- const logUpdate = createLogUpdate(node_process__WEBPACK_IMPORTED_MODULE_0__.stdout);
513
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (logUpdate);
514
-
515
- const logUpdateStderr = createLogUpdate(node_process__WEBPACK_IMPORTED_MODULE_0__.stderr);
516
-
517
-
518
- /***/ }),
519
-
520
- /***/ "../../node_modules/log-update/node_modules/ansi-escapes/index.js":
521
- /*!************************************************************************!*\
522
- !*** ../../node_modules/log-update/node_modules/ansi-escapes/index.js ***!
523
- \************************************************************************/
524
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
525
-
526
- __webpack_require__.r(__webpack_exports__);
527
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
528
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
529
- /* harmony export */ });
530
- /* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ "node:process");
531
-
532
-
533
- const ESC = '\u001B[';
534
- const OSC = '\u001B]';
535
- const BEL = '\u0007';
536
- const SEP = ';';
537
-
538
- /* global window */
539
- const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
540
-
541
- const isTerminalApp = !isBrowser && node_process__WEBPACK_IMPORTED_MODULE_0__.env.TERM_PROGRAM === 'Apple_Terminal';
542
- const isWindows = !isBrowser && node_process__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32';
543
- const cwdFunction = isBrowser ? () => {
544
- throw new Error('`process.cwd()` only works in Node.js, not the browser.');
545
- } : node_process__WEBPACK_IMPORTED_MODULE_0__.cwd;
546
-
547
- const ansiEscapes = {};
548
-
549
- ansiEscapes.cursorTo = (x, y) => {
550
- if (typeof x !== 'number') {
551
- throw new TypeError('The `x` argument is required');
552
- }
553
-
554
- if (typeof y !== 'number') {
555
- return ESC + (x + 1) + 'G';
556
- }
557
-
558
- return ESC + (y + 1) + SEP + (x + 1) + 'H';
559
- };
560
-
561
- ansiEscapes.cursorMove = (x, y) => {
562
- if (typeof x !== 'number') {
563
- throw new TypeError('The `x` argument is required');
564
- }
565
-
566
- let returnValue = '';
567
-
568
- if (x < 0) {
569
- returnValue += ESC + (-x) + 'D';
570
- } else if (x > 0) {
571
- returnValue += ESC + x + 'C';
572
- }
573
-
574
- if (y < 0) {
575
- returnValue += ESC + (-y) + 'A';
576
- } else if (y > 0) {
577
- returnValue += ESC + y + 'B';
578
- }
579
-
580
- return returnValue;
581
- };
582
-
583
- ansiEscapes.cursorUp = (count = 1) => ESC + count + 'A';
584
- ansiEscapes.cursorDown = (count = 1) => ESC + count + 'B';
585
- ansiEscapes.cursorForward = (count = 1) => ESC + count + 'C';
586
- ansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D';
587
-
588
- ansiEscapes.cursorLeft = ESC + 'G';
589
- ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's';
590
- ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u';
591
- ansiEscapes.cursorGetPosition = ESC + '6n';
592
- ansiEscapes.cursorNextLine = ESC + 'E';
593
- ansiEscapes.cursorPrevLine = ESC + 'F';
594
- ansiEscapes.cursorHide = ESC + '?25l';
595
- ansiEscapes.cursorShow = ESC + '?25h';
596
-
597
- ansiEscapes.eraseLines = count => {
598
- let clear = '';
599
-
600
- for (let i = 0; i < count; i++) {
601
- clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');
602
- }
603
-
604
- if (count) {
605
- clear += ansiEscapes.cursorLeft;
606
- }
607
-
608
- return clear;
609
- };
610
-
611
- ansiEscapes.eraseEndLine = ESC + 'K';
612
- ansiEscapes.eraseStartLine = ESC + '1K';
613
- ansiEscapes.eraseLine = ESC + '2K';
614
- ansiEscapes.eraseDown = ESC + 'J';
615
- ansiEscapes.eraseUp = ESC + '1J';
616
- ansiEscapes.eraseScreen = ESC + '2J';
617
- ansiEscapes.scrollUp = ESC + 'S';
618
- ansiEscapes.scrollDown = ESC + 'T';
619
-
620
- ansiEscapes.clearScreen = '\u001Bc';
621
-
622
- ansiEscapes.clearTerminal = isWindows
623
- ? `${ansiEscapes.eraseScreen}${ESC}0f`
624
- // 1. Erases the screen (Only done in case `2` is not supported)
625
- // 2. Erases the whole screen including scrollback buffer
626
- // 3. Moves cursor to the top-left position
627
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
628
- : `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
629
-
630
- ansiEscapes.enterAlternativeScreen = ESC + '?1049h';
631
- ansiEscapes.exitAlternativeScreen = ESC + '?1049l';
632
-
633
- ansiEscapes.beep = BEL;
634
-
635
- ansiEscapes.link = (text, url) => [
636
- OSC,
637
- '8',
638
- SEP,
639
- SEP,
640
- url,
641
- BEL,
642
- text,
643
- OSC,
644
- '8',
645
- SEP,
646
- SEP,
647
- BEL,
648
- ].join('');
649
-
650
- ansiEscapes.image = (buffer, options = {}) => {
651
- let returnValue = `${OSC}1337;File=inline=1`;
652
-
653
- if (options.width) {
654
- returnValue += `;width=${options.width}`;
655
- }
656
-
657
- if (options.height) {
658
- returnValue += `;height=${options.height}`;
659
- }
660
-
661
- if (options.preserveAspectRatio === false) {
662
- returnValue += ';preserveAspectRatio=0';
663
- }
664
-
665
- return returnValue + ':' + buffer.toString('base64') + BEL;
666
- };
667
-
668
- ansiEscapes.iTerm = {
669
- setCwd: (cwd = cwdFunction()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
670
-
671
- annotation(message, options = {}) {
672
- let returnValue = `${OSC}1337;`;
673
-
674
- const hasX = typeof options.x !== 'undefined';
675
- const hasY = typeof options.y !== 'undefined';
676
- if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== 'undefined')) {
677
- throw new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
678
- }
679
-
680
- message = message.replace(/\|/g, '');
681
-
682
- returnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
683
-
684
- if (options.length > 0) {
685
- returnValue += (
686
- hasX
687
- ? [message, options.length, options.x, options.y]
688
- : [options.length, message]
689
- ).join('|');
690
- } else {
691
- returnValue += message;
692
- }
693
-
694
- return returnValue + BEL;
695
- },
696
- };
697
-
698
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ansiEscapes);
699
-
700
-
701
- /***/ }),
702
-
703
- /***/ "../../node_modules/log-update/node_modules/is-fullwidth-code-point/index.js":
704
- /*!***********************************************************************************!*\
705
- !*** ../../node_modules/log-update/node_modules/is-fullwidth-code-point/index.js ***!
706
- \***********************************************************************************/
707
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
708
-
709
- __webpack_require__.r(__webpack_exports__);
710
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
711
- /* harmony export */ "default": () => (/* binding */ isFullwidthCodePoint)
712
- /* harmony export */ });
713
- /* harmony import */ var get_east_asian_width__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! get-east-asian-width */ "../../node_modules/get-east-asian-width/index.js");
714
-
715
-
716
- function isFullwidthCodePoint(codePoint) {
717
- if (!Number.isInteger(codePoint)) {
718
- return false;
719
- }
720
-
721
- return (0,get_east_asian_width__WEBPACK_IMPORTED_MODULE_0__.eastAsianWidth)(codePoint) === 2;
722
- }
723
-
724
-
725
- /***/ }),
726
-
727
- /***/ "../../node_modules/log-update/node_modules/slice-ansi/index.js":
728
- /*!**********************************************************************!*\
729
- !*** ../../node_modules/log-update/node_modules/slice-ansi/index.js ***!
730
- \**********************************************************************/
731
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
732
-
733
- __webpack_require__.r(__webpack_exports__);
734
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
735
- /* harmony export */ "default": () => (/* binding */ sliceAnsi)
736
- /* harmony export */ });
737
- /* harmony import */ var ansi_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ansi-styles */ "../../node_modules/ansi-styles/index.js");
738
- /* harmony import */ var is_fullwidth_code_point__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! is-fullwidth-code-point */ "../../node_modules/log-update/node_modules/is-fullwidth-code-point/index.js");
739
-
740
-
741
-
742
- // \x1b and \x9b
743
- const ESCAPES = new Set([27, 155]);
744
-
745
- const CODE_POINT_0 = '0'.codePointAt(0);
746
- const CODE_POINT_9 = '9'.codePointAt(0);
747
-
748
- const endCodesSet = new Set();
749
- const endCodesMap = new Map();
750
- for (const [start, end] of ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].codes) {
751
- endCodesSet.add(ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].color.ansi(end));
752
- endCodesMap.set(ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].color.ansi(start), ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].color.ansi(end));
753
- }
754
-
755
- function getEndCode(code) {
756
- if (endCodesSet.has(code)) {
757
- return code;
758
- }
759
-
760
- if (endCodesMap.has(code)) {
761
- return endCodesMap.get(code);
762
- }
763
-
764
- code = code.slice(2);
765
- if (code.includes(';')) {
766
- code = code[0] + '0';
767
- }
768
-
769
- const returnValue = ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].codes.get(Number.parseInt(code, 10));
770
- if (returnValue) {
771
- return ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].color.ansi(returnValue);
772
- }
773
-
774
- return ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].reset.open;
775
- }
776
-
777
- function findNumberIndex(string) {
778
- for (let index = 0; index < string.length; index++) {
779
- const codePoint = string.codePointAt(index);
780
- if (codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9) {
781
- return index;
782
- }
783
- }
784
-
785
- return -1;
786
- }
787
-
788
- function parseAnsiCode(string, offset) {
789
- string = string.slice(offset, offset + 19);
790
- const startIndex = findNumberIndex(string);
791
- if (startIndex !== -1) {
792
- let endIndex = string.indexOf('m', startIndex);
793
- if (endIndex === -1) {
794
- endIndex = string.length;
795
- }
796
-
797
- return string.slice(0, endIndex + 1);
798
- }
799
- }
800
-
801
- function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
802
- const returnValue = [];
803
-
804
- let index = 0;
805
- let visibleCount = 0;
806
- while (index < string.length) {
807
- const codePoint = string.codePointAt(index);
808
-
809
- if (ESCAPES.has(codePoint)) {
810
- const code = parseAnsiCode(string, index);
811
- if (code) {
812
- returnValue.push({
813
- type: 'ansi',
814
- code,
815
- endCode: getEndCode(code),
816
- });
817
- index += code.length;
818
- continue;
819
- }
820
- }
821
-
822
- const isFullWidth = (0,is_fullwidth_code_point__WEBPACK_IMPORTED_MODULE_1__["default"])(codePoint);
823
- const character = String.fromCodePoint(codePoint);
824
-
825
- returnValue.push({
826
- type: 'character',
827
- value: character,
828
- isFullWidth,
829
- });
830
-
831
- index += character.length;
832
- visibleCount += isFullWidth ? 2 : character.length;
833
-
834
- if (visibleCount >= endCharacter) {
835
- break;
836
- }
837
- }
838
-
839
- return returnValue;
840
- }
841
-
842
- function reduceAnsiCodes(codes) {
843
- let returnValue = [];
844
-
845
- for (const code of codes) {
846
- if (code.code === ansi_styles__WEBPACK_IMPORTED_MODULE_0__["default"].reset.open) {
847
- // Reset code, disable all codes
848
- returnValue = [];
849
- } else if (endCodesSet.has(code.code)) {
850
- // This is an end code, disable all matching start codes
851
- returnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.code);
852
- } else {
853
- // This is a start code. Disable all styles this "overrides", then enable it
854
- returnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.endCode);
855
- returnValue.push(code);
856
- }
857
- }
858
-
859
- return returnValue;
860
- }
861
-
862
- function undoAnsiCodes(codes) {
863
- const reduced = reduceAnsiCodes(codes);
864
- const endCodes = reduced.map(({endCode}) => endCode);
865
- return endCodes.reverse().join('');
866
- }
867
-
868
- function sliceAnsi(string, start, end) {
869
- const tokens = tokenize(string, end);
870
- let activeCodes = [];
871
- let position = 0;
872
- let returnValue = '';
873
- let include = false;
874
-
875
- for (const token of tokens) {
876
- if (end !== undefined && position >= end) {
877
- break;
878
- }
879
-
880
- if (token.type === 'ansi') {
881
- activeCodes.push(token);
882
- if (include) {
883
- returnValue += token.code;
884
- }
885
- } else {
886
- // Character
887
- if (!include && position >= start) {
888
- include = true;
889
- // Simplify active codes
890
- activeCodes = reduceAnsiCodes(activeCodes);
891
- returnValue = activeCodes.map(({code}) => code).join('');
892
- }
893
-
894
- if (include) {
895
- returnValue += token.value;
896
- }
897
-
898
- position += token.isFullWidth ? 2 : token.value.length;
899
- }
900
- }
901
-
902
- // Disable active codes at the end
903
- returnValue += undoAnsiCodes(activeCodes);
904
- return returnValue;
905
- }
906
-
907
-
908
- /***/ }),
909
-
910
- /***/ "../../node_modules/restore-cursor/index.js":
911
- /*!**************************************************!*\
912
- !*** ../../node_modules/restore-cursor/index.js ***!
913
- \**************************************************/
914
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
915
-
916
- __webpack_require__.r(__webpack_exports__);
917
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
918
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
919
- /* harmony export */ });
920
- /* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ "node:process");
921
- /* harmony import */ var onetime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! onetime */ "../../node_modules/restore-cursor/node_modules/onetime/index.js");
922
- /* harmony import */ var signal_exit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! signal-exit */ "../../node_modules/signal-exit/index.js");
923
-
924
-
925
-
926
-
927
- const restoreCursor = onetime__WEBPACK_IMPORTED_MODULE_1__(() => {
928
- signal_exit__WEBPACK_IMPORTED_MODULE_2__(() => {
929
- node_process__WEBPACK_IMPORTED_MODULE_0__.stderr.write('\u001B[?25h');
930
- }, {alwaysLast: true});
931
- });
932
-
933
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (restoreCursor);
934
-
935
-
936
- /***/ })
937
-
938
- };