nekos 1.2.0 → 1.2.1

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.
Files changed (3) hide show
  1. package/index.cjs +2347 -33
  2. package/index.js +3 -11
  3. package/package.json +3 -1
package/index.cjs CHANGED
@@ -4,6 +4,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __glob = (map) => (path2) => {
8
+ var fn = map[path2];
9
+ if (fn) return fn();
10
+ throw new Error("Module not found in bundle: " + path2);
11
+ };
12
+ var __esm = (fn, res) => function __init() {
13
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
+ };
7
15
  var __commonJS = (cb, mod) => function __require() {
8
16
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
17
  };
@@ -17,23 +25,2332 @@ var __copyProps = (to, from, except, desc) => {
17
25
  if (!__hasOwnProp.call(to, key) && key !== except)
18
26
  __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
27
  }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ return to;
29
+ };
30
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
+ // If the importer is in node compatibility mode or this is not an ESM
32
+ // file that has been converted to a CommonJS file using a Babel-
33
+ // compatible transform (i.e. "__esModule" has not been set), then set
34
+ // "default" to the CommonJS "module.exports" for node compatibility.
35
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
36
+ mod
37
+ ));
38
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
+
40
+ // node_modules/@randplus/color/src/rgb.js
41
+ var require_rgb = __commonJS({
42
+ "node_modules/@randplus/color/src/rgb.js"(exports2, module2) {
43
+ function rgb() {
44
+ const r = Math.floor(Math.random() * 256);
45
+ const g = Math.floor(Math.random() * 256);
46
+ const b = Math.floor(Math.random() * 256);
47
+ return [r, g, b];
48
+ }
49
+ module2.exports = rgb;
50
+ }
51
+ });
52
+
53
+ // node_modules/@randplus/color/src/hex.js
54
+ var require_hex = __commonJS({
55
+ "node_modules/@randplus/color/src/hex.js"(exports2, module2) {
56
+ function hex2(prefix = "") {
57
+ if (typeof prefix !== "string") throw new Error("prefix must be string.");
58
+ const [r, g, b] = require_rgb()();
59
+ return prefix + r.toString(16).padStart(2, "0") + g.toString(16).padStart(2, "0") + b.toString(16).padStart(2, "0");
60
+ }
61
+ module2.exports = hex2;
62
+ }
63
+ });
64
+
65
+ // node_modules/@randplus/color/src/conv/chex.js
66
+ var require_chex = __commonJS({
67
+ "node_modules/@randplus/color/src/conv/chex.js"(exports2, module2) {
68
+ function convHex(options = {}) {
69
+ if (typeof options !== "object") throw new Error("options must be object.");
70
+ return require_hex()(options.prefix);
71
+ }
72
+ module2.exports = convHex;
73
+ }
74
+ });
75
+
76
+ // node_modules/@randplus/color/src/conv/crgb.js
77
+ var require_crgb = __commonJS({
78
+ "node_modules/@randplus/color/src/conv/crgb.js"(exports2, module2) {
79
+ function convRgb(options = {}) {
80
+ if (typeof options !== "object") throw new Error("options must be object.");
81
+ return require_rgb()();
82
+ }
83
+ module2.exports = convRgb;
84
+ }
85
+ });
86
+
87
+ // node_modules/universalify/index.js
88
+ var require_universalify = __commonJS({
89
+ "node_modules/universalify/index.js"(exports2) {
90
+ "use strict";
91
+ exports2.fromCallback = function(fn) {
92
+ return Object.defineProperty(function(...args) {
93
+ if (typeof args[args.length - 1] === "function") fn.apply(this, args);
94
+ else {
95
+ return new Promise((resolve, reject) => {
96
+ args.push((err, res) => err != null ? reject(err) : resolve(res));
97
+ fn.apply(this, args);
98
+ });
99
+ }
100
+ }, "name", { value: fn.name });
101
+ };
102
+ exports2.fromPromise = function(fn) {
103
+ return Object.defineProperty(function(...args) {
104
+ const cb = args[args.length - 1];
105
+ if (typeof cb !== "function") return fn.apply(this, args);
106
+ else {
107
+ args.pop();
108
+ fn.apply(this, args).then((r) => cb(null, r), cb);
109
+ }
110
+ }, "name", { value: fn.name });
111
+ };
112
+ }
113
+ });
114
+
115
+ // node_modules/graceful-fs/polyfills.js
116
+ var require_polyfills = __commonJS({
117
+ "node_modules/graceful-fs/polyfills.js"(exports2, module2) {
118
+ var constants = require("constants");
119
+ var origCwd = process.cwd;
120
+ var cwd = null;
121
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
122
+ process.cwd = function() {
123
+ if (!cwd)
124
+ cwd = origCwd.call(process);
125
+ return cwd;
126
+ };
127
+ try {
128
+ process.cwd();
129
+ } catch (er) {
130
+ }
131
+ if (typeof process.chdir === "function") {
132
+ chdir = process.chdir;
133
+ process.chdir = function(d) {
134
+ cwd = null;
135
+ chdir.call(process, d);
136
+ };
137
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
138
+ }
139
+ var chdir;
140
+ module2.exports = patch;
141
+ function patch(fs2) {
142
+ if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
143
+ patchLchmod(fs2);
144
+ }
145
+ if (!fs2.lutimes) {
146
+ patchLutimes(fs2);
147
+ }
148
+ fs2.chown = chownFix(fs2.chown);
149
+ fs2.fchown = chownFix(fs2.fchown);
150
+ fs2.lchown = chownFix(fs2.lchown);
151
+ fs2.chmod = chmodFix(fs2.chmod);
152
+ fs2.fchmod = chmodFix(fs2.fchmod);
153
+ fs2.lchmod = chmodFix(fs2.lchmod);
154
+ fs2.chownSync = chownFixSync(fs2.chownSync);
155
+ fs2.fchownSync = chownFixSync(fs2.fchownSync);
156
+ fs2.lchownSync = chownFixSync(fs2.lchownSync);
157
+ fs2.chmodSync = chmodFixSync(fs2.chmodSync);
158
+ fs2.fchmodSync = chmodFixSync(fs2.fchmodSync);
159
+ fs2.lchmodSync = chmodFixSync(fs2.lchmodSync);
160
+ fs2.stat = statFix(fs2.stat);
161
+ fs2.fstat = statFix(fs2.fstat);
162
+ fs2.lstat = statFix(fs2.lstat);
163
+ fs2.statSync = statFixSync(fs2.statSync);
164
+ fs2.fstatSync = statFixSync(fs2.fstatSync);
165
+ fs2.lstatSync = statFixSync(fs2.lstatSync);
166
+ if (fs2.chmod && !fs2.lchmod) {
167
+ fs2.lchmod = function(path2, mode, cb) {
168
+ if (cb) process.nextTick(cb);
169
+ };
170
+ fs2.lchmodSync = function() {
171
+ };
172
+ }
173
+ if (fs2.chown && !fs2.lchown) {
174
+ fs2.lchown = function(path2, uid, gid, cb) {
175
+ if (cb) process.nextTick(cb);
176
+ };
177
+ fs2.lchownSync = function() {
178
+ };
179
+ }
180
+ if (platform === "win32") {
181
+ fs2.rename = typeof fs2.rename !== "function" ? fs2.rename : (function(fs$rename) {
182
+ function rename(from, to, cb) {
183
+ var start = Date.now();
184
+ var backoff = 0;
185
+ fs$rename(from, to, function CB(er) {
186
+ if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
187
+ setTimeout(function() {
188
+ fs2.stat(to, function(stater, st) {
189
+ if (stater && stater.code === "ENOENT")
190
+ fs$rename(from, to, CB);
191
+ else
192
+ cb(er);
193
+ });
194
+ }, backoff);
195
+ if (backoff < 100)
196
+ backoff += 10;
197
+ return;
198
+ }
199
+ if (cb) cb(er);
200
+ });
201
+ }
202
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
203
+ return rename;
204
+ })(fs2.rename);
205
+ }
206
+ fs2.read = typeof fs2.read !== "function" ? fs2.read : (function(fs$read) {
207
+ function read(fd, buffer, offset, length, position, callback_) {
208
+ var callback;
209
+ if (callback_ && typeof callback_ === "function") {
210
+ var eagCounter = 0;
211
+ callback = function(er, _, __) {
212
+ if (er && er.code === "EAGAIN" && eagCounter < 10) {
213
+ eagCounter++;
214
+ return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
215
+ }
216
+ callback_.apply(this, arguments);
217
+ };
218
+ }
219
+ return fs$read.call(fs2, fd, buffer, offset, length, position, callback);
220
+ }
221
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
222
+ return read;
223
+ })(fs2.read);
224
+ fs2.readSync = typeof fs2.readSync !== "function" ? fs2.readSync : /* @__PURE__ */ (function(fs$readSync) {
225
+ return function(fd, buffer, offset, length, position) {
226
+ var eagCounter = 0;
227
+ while (true) {
228
+ try {
229
+ return fs$readSync.call(fs2, fd, buffer, offset, length, position);
230
+ } catch (er) {
231
+ if (er.code === "EAGAIN" && eagCounter < 10) {
232
+ eagCounter++;
233
+ continue;
234
+ }
235
+ throw er;
236
+ }
237
+ }
238
+ };
239
+ })(fs2.readSync);
240
+ function patchLchmod(fs3) {
241
+ fs3.lchmod = function(path2, mode, callback) {
242
+ fs3.open(
243
+ path2,
244
+ constants.O_WRONLY | constants.O_SYMLINK,
245
+ mode,
246
+ function(err, fd) {
247
+ if (err) {
248
+ if (callback) callback(err);
249
+ return;
250
+ }
251
+ fs3.fchmod(fd, mode, function(err2) {
252
+ fs3.close(fd, function(err22) {
253
+ if (callback) callback(err2 || err22);
254
+ });
255
+ });
256
+ }
257
+ );
258
+ };
259
+ fs3.lchmodSync = function(path2, mode) {
260
+ var fd = fs3.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode);
261
+ var threw = true;
262
+ var ret;
263
+ try {
264
+ ret = fs3.fchmodSync(fd, mode);
265
+ threw = false;
266
+ } finally {
267
+ if (threw) {
268
+ try {
269
+ fs3.closeSync(fd);
270
+ } catch (er) {
271
+ }
272
+ } else {
273
+ fs3.closeSync(fd);
274
+ }
275
+ }
276
+ return ret;
277
+ };
278
+ }
279
+ function patchLutimes(fs3) {
280
+ if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) {
281
+ fs3.lutimes = function(path2, at, mt, cb) {
282
+ fs3.open(path2, constants.O_SYMLINK, function(er, fd) {
283
+ if (er) {
284
+ if (cb) cb(er);
285
+ return;
286
+ }
287
+ fs3.futimes(fd, at, mt, function(er2) {
288
+ fs3.close(fd, function(er22) {
289
+ if (cb) cb(er2 || er22);
290
+ });
291
+ });
292
+ });
293
+ };
294
+ fs3.lutimesSync = function(path2, at, mt) {
295
+ var fd = fs3.openSync(path2, constants.O_SYMLINK);
296
+ var ret;
297
+ var threw = true;
298
+ try {
299
+ ret = fs3.futimesSync(fd, at, mt);
300
+ threw = false;
301
+ } finally {
302
+ if (threw) {
303
+ try {
304
+ fs3.closeSync(fd);
305
+ } catch (er) {
306
+ }
307
+ } else {
308
+ fs3.closeSync(fd);
309
+ }
310
+ }
311
+ return ret;
312
+ };
313
+ } else if (fs3.futimes) {
314
+ fs3.lutimes = function(_a, _b, _c, cb) {
315
+ if (cb) process.nextTick(cb);
316
+ };
317
+ fs3.lutimesSync = function() {
318
+ };
319
+ }
320
+ }
321
+ function chmodFix(orig) {
322
+ if (!orig) return orig;
323
+ return function(target, mode, cb) {
324
+ return orig.call(fs2, target, mode, function(er) {
325
+ if (chownErOk(er)) er = null;
326
+ if (cb) cb.apply(this, arguments);
327
+ });
328
+ };
329
+ }
330
+ function chmodFixSync(orig) {
331
+ if (!orig) return orig;
332
+ return function(target, mode) {
333
+ try {
334
+ return orig.call(fs2, target, mode);
335
+ } catch (er) {
336
+ if (!chownErOk(er)) throw er;
337
+ }
338
+ };
339
+ }
340
+ function chownFix(orig) {
341
+ if (!orig) return orig;
342
+ return function(target, uid, gid, cb) {
343
+ return orig.call(fs2, target, uid, gid, function(er) {
344
+ if (chownErOk(er)) er = null;
345
+ if (cb) cb.apply(this, arguments);
346
+ });
347
+ };
348
+ }
349
+ function chownFixSync(orig) {
350
+ if (!orig) return orig;
351
+ return function(target, uid, gid) {
352
+ try {
353
+ return orig.call(fs2, target, uid, gid);
354
+ } catch (er) {
355
+ if (!chownErOk(er)) throw er;
356
+ }
357
+ };
358
+ }
359
+ function statFix(orig) {
360
+ if (!orig) return orig;
361
+ return function(target, options, cb) {
362
+ if (typeof options === "function") {
363
+ cb = options;
364
+ options = null;
365
+ }
366
+ function callback(er, stats) {
367
+ if (stats) {
368
+ if (stats.uid < 0) stats.uid += 4294967296;
369
+ if (stats.gid < 0) stats.gid += 4294967296;
370
+ }
371
+ if (cb) cb.apply(this, arguments);
372
+ }
373
+ return options ? orig.call(fs2, target, options, callback) : orig.call(fs2, target, callback);
374
+ };
375
+ }
376
+ function statFixSync(orig) {
377
+ if (!orig) return orig;
378
+ return function(target, options) {
379
+ var stats = options ? orig.call(fs2, target, options) : orig.call(fs2, target);
380
+ if (stats) {
381
+ if (stats.uid < 0) stats.uid += 4294967296;
382
+ if (stats.gid < 0) stats.gid += 4294967296;
383
+ }
384
+ return stats;
385
+ };
386
+ }
387
+ function chownErOk(er) {
388
+ if (!er)
389
+ return true;
390
+ if (er.code === "ENOSYS")
391
+ return true;
392
+ var nonroot = !process.getuid || process.getuid() !== 0;
393
+ if (nonroot) {
394
+ if (er.code === "EINVAL" || er.code === "EPERM")
395
+ return true;
396
+ }
397
+ return false;
398
+ }
399
+ }
400
+ }
401
+ });
402
+
403
+ // node_modules/graceful-fs/legacy-streams.js
404
+ var require_legacy_streams = __commonJS({
405
+ "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
406
+ var Stream = require("stream").Stream;
407
+ module2.exports = legacy;
408
+ function legacy(fs2) {
409
+ return {
410
+ ReadStream,
411
+ WriteStream
412
+ };
413
+ function ReadStream(path2, options) {
414
+ if (!(this instanceof ReadStream)) return new ReadStream(path2, options);
415
+ Stream.call(this);
416
+ var self2 = this;
417
+ this.path = path2;
418
+ this.fd = null;
419
+ this.readable = true;
420
+ this.paused = false;
421
+ this.flags = "r";
422
+ this.mode = 438;
423
+ this.bufferSize = 64 * 1024;
424
+ options = options || {};
425
+ var keys = Object.keys(options);
426
+ for (var index = 0, length = keys.length; index < length; index++) {
427
+ var key = keys[index];
428
+ this[key] = options[key];
429
+ }
430
+ if (this.encoding) this.setEncoding(this.encoding);
431
+ if (this.start !== void 0) {
432
+ if ("number" !== typeof this.start) {
433
+ throw TypeError("start must be a Number");
434
+ }
435
+ if (this.end === void 0) {
436
+ this.end = Infinity;
437
+ } else if ("number" !== typeof this.end) {
438
+ throw TypeError("end must be a Number");
439
+ }
440
+ if (this.start > this.end) {
441
+ throw new Error("start must be <= end");
442
+ }
443
+ this.pos = this.start;
444
+ }
445
+ if (this.fd !== null) {
446
+ process.nextTick(function() {
447
+ self2._read();
448
+ });
449
+ return;
450
+ }
451
+ fs2.open(this.path, this.flags, this.mode, function(err, fd) {
452
+ if (err) {
453
+ self2.emit("error", err);
454
+ self2.readable = false;
455
+ return;
456
+ }
457
+ self2.fd = fd;
458
+ self2.emit("open", fd);
459
+ self2._read();
460
+ });
461
+ }
462
+ function WriteStream(path2, options) {
463
+ if (!(this instanceof WriteStream)) return new WriteStream(path2, options);
464
+ Stream.call(this);
465
+ this.path = path2;
466
+ this.fd = null;
467
+ this.writable = true;
468
+ this.flags = "w";
469
+ this.encoding = "binary";
470
+ this.mode = 438;
471
+ this.bytesWritten = 0;
472
+ options = options || {};
473
+ var keys = Object.keys(options);
474
+ for (var index = 0, length = keys.length; index < length; index++) {
475
+ var key = keys[index];
476
+ this[key] = options[key];
477
+ }
478
+ if (this.start !== void 0) {
479
+ if ("number" !== typeof this.start) {
480
+ throw TypeError("start must be a Number");
481
+ }
482
+ if (this.start < 0) {
483
+ throw new Error("start must be >= zero");
484
+ }
485
+ this.pos = this.start;
486
+ }
487
+ this.busy = false;
488
+ this._queue = [];
489
+ if (this.fd === null) {
490
+ this._open = fs2.open;
491
+ this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
492
+ this.flush();
493
+ }
494
+ }
495
+ }
496
+ }
497
+ });
498
+
499
+ // node_modules/graceful-fs/clone.js
500
+ var require_clone = __commonJS({
501
+ "node_modules/graceful-fs/clone.js"(exports2, module2) {
502
+ "use strict";
503
+ module2.exports = clone;
504
+ var getPrototypeOf = Object.getPrototypeOf || function(obj) {
505
+ return obj.__proto__;
506
+ };
507
+ function clone(obj) {
508
+ if (obj === null || typeof obj !== "object")
509
+ return obj;
510
+ if (obj instanceof Object)
511
+ var copy = { __proto__: getPrototypeOf(obj) };
512
+ else
513
+ var copy = /* @__PURE__ */ Object.create(null);
514
+ Object.getOwnPropertyNames(obj).forEach(function(key) {
515
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
516
+ });
517
+ return copy;
518
+ }
519
+ }
520
+ });
521
+
522
+ // node_modules/graceful-fs/graceful-fs.js
523
+ var require_graceful_fs = __commonJS({
524
+ "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
525
+ var fs2 = require("fs");
526
+ var polyfills = require_polyfills();
527
+ var legacy = require_legacy_streams();
528
+ var clone = require_clone();
529
+ var util = require("util");
530
+ var gracefulQueue;
531
+ var previousSymbol;
532
+ if (typeof Symbol === "function" && typeof Symbol.for === "function") {
533
+ gracefulQueue = Symbol.for("graceful-fs.queue");
534
+ previousSymbol = Symbol.for("graceful-fs.previous");
535
+ } else {
536
+ gracefulQueue = "___graceful-fs.queue";
537
+ previousSymbol = "___graceful-fs.previous";
538
+ }
539
+ function noop() {
540
+ }
541
+ function publishQueue(context, queue2) {
542
+ Object.defineProperty(context, gracefulQueue, {
543
+ get: function() {
544
+ return queue2;
545
+ }
546
+ });
547
+ }
548
+ var debug = noop;
549
+ if (util.debuglog)
550
+ debug = util.debuglog("gfs4");
551
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
552
+ debug = function() {
553
+ var m = util.format.apply(util, arguments);
554
+ m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
555
+ console.error(m);
556
+ };
557
+ if (!fs2[gracefulQueue]) {
558
+ queue = global[gracefulQueue] || [];
559
+ publishQueue(fs2, queue);
560
+ fs2.close = (function(fs$close) {
561
+ function close(fd, cb) {
562
+ return fs$close.call(fs2, fd, function(err) {
563
+ if (!err) {
564
+ resetQueue();
565
+ }
566
+ if (typeof cb === "function")
567
+ cb.apply(this, arguments);
568
+ });
569
+ }
570
+ Object.defineProperty(close, previousSymbol, {
571
+ value: fs$close
572
+ });
573
+ return close;
574
+ })(fs2.close);
575
+ fs2.closeSync = (function(fs$closeSync) {
576
+ function closeSync(fd) {
577
+ fs$closeSync.apply(fs2, arguments);
578
+ resetQueue();
579
+ }
580
+ Object.defineProperty(closeSync, previousSymbol, {
581
+ value: fs$closeSync
582
+ });
583
+ return closeSync;
584
+ })(fs2.closeSync);
585
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
586
+ process.on("exit", function() {
587
+ debug(fs2[gracefulQueue]);
588
+ require("assert").equal(fs2[gracefulQueue].length, 0);
589
+ });
590
+ }
591
+ }
592
+ var queue;
593
+ if (!global[gracefulQueue]) {
594
+ publishQueue(global, fs2[gracefulQueue]);
595
+ }
596
+ module2.exports = patch(clone(fs2));
597
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched) {
598
+ module2.exports = patch(fs2);
599
+ fs2.__patched = true;
600
+ }
601
+ function patch(fs3) {
602
+ polyfills(fs3);
603
+ fs3.gracefulify = patch;
604
+ fs3.createReadStream = createReadStream;
605
+ fs3.createWriteStream = createWriteStream;
606
+ var fs$readFile = fs3.readFile;
607
+ fs3.readFile = readFile;
608
+ function readFile(path2, options, cb) {
609
+ if (typeof options === "function")
610
+ cb = options, options = null;
611
+ return go$readFile(path2, options, cb);
612
+ function go$readFile(path3, options2, cb2, startTime) {
613
+ return fs$readFile(path3, options2, function(err) {
614
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
615
+ enqueue([go$readFile, [path3, options2, cb2], err, startTime || Date.now(), Date.now()]);
616
+ else {
617
+ if (typeof cb2 === "function")
618
+ cb2.apply(this, arguments);
619
+ }
620
+ });
621
+ }
622
+ }
623
+ var fs$writeFile = fs3.writeFile;
624
+ fs3.writeFile = writeFile;
625
+ function writeFile(path2, data, options, cb) {
626
+ if (typeof options === "function")
627
+ cb = options, options = null;
628
+ return go$writeFile(path2, data, options, cb);
629
+ function go$writeFile(path3, data2, options2, cb2, startTime) {
630
+ return fs$writeFile(path3, data2, options2, function(err) {
631
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
632
+ enqueue([go$writeFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
633
+ else {
634
+ if (typeof cb2 === "function")
635
+ cb2.apply(this, arguments);
636
+ }
637
+ });
638
+ }
639
+ }
640
+ var fs$appendFile = fs3.appendFile;
641
+ if (fs$appendFile)
642
+ fs3.appendFile = appendFile;
643
+ function appendFile(path2, data, options, cb) {
644
+ if (typeof options === "function")
645
+ cb = options, options = null;
646
+ return go$appendFile(path2, data, options, cb);
647
+ function go$appendFile(path3, data2, options2, cb2, startTime) {
648
+ return fs$appendFile(path3, data2, options2, function(err) {
649
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
650
+ enqueue([go$appendFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
651
+ else {
652
+ if (typeof cb2 === "function")
653
+ cb2.apply(this, arguments);
654
+ }
655
+ });
656
+ }
657
+ }
658
+ var fs$copyFile = fs3.copyFile;
659
+ if (fs$copyFile)
660
+ fs3.copyFile = copyFile;
661
+ function copyFile(src, dest, flags, cb) {
662
+ if (typeof flags === "function") {
663
+ cb = flags;
664
+ flags = 0;
665
+ }
666
+ return go$copyFile(src, dest, flags, cb);
667
+ function go$copyFile(src2, dest2, flags2, cb2, startTime) {
668
+ return fs$copyFile(src2, dest2, flags2, function(err) {
669
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
670
+ enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
671
+ else {
672
+ if (typeof cb2 === "function")
673
+ cb2.apply(this, arguments);
674
+ }
675
+ });
676
+ }
677
+ }
678
+ var fs$readdir = fs3.readdir;
679
+ fs3.readdir = readdir;
680
+ var noReaddirOptionVersions = /^v[0-5]\./;
681
+ function readdir(path2, options, cb) {
682
+ if (typeof options === "function")
683
+ cb = options, options = null;
684
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path3, options2, cb2, startTime) {
685
+ return fs$readdir(path3, fs$readdirCallback(
686
+ path3,
687
+ options2,
688
+ cb2,
689
+ startTime
690
+ ));
691
+ } : function go$readdir2(path3, options2, cb2, startTime) {
692
+ return fs$readdir(path3, options2, fs$readdirCallback(
693
+ path3,
694
+ options2,
695
+ cb2,
696
+ startTime
697
+ ));
698
+ };
699
+ return go$readdir(path2, options, cb);
700
+ function fs$readdirCallback(path3, options2, cb2, startTime) {
701
+ return function(err, files) {
702
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
703
+ enqueue([
704
+ go$readdir,
705
+ [path3, options2, cb2],
706
+ err,
707
+ startTime || Date.now(),
708
+ Date.now()
709
+ ]);
710
+ else {
711
+ if (files && files.sort)
712
+ files.sort();
713
+ if (typeof cb2 === "function")
714
+ cb2.call(this, err, files);
715
+ }
716
+ };
717
+ }
718
+ }
719
+ if (process.version.substr(0, 4) === "v0.8") {
720
+ var legStreams = legacy(fs3);
721
+ ReadStream = legStreams.ReadStream;
722
+ WriteStream = legStreams.WriteStream;
723
+ }
724
+ var fs$ReadStream = fs3.ReadStream;
725
+ if (fs$ReadStream) {
726
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype);
727
+ ReadStream.prototype.open = ReadStream$open;
728
+ }
729
+ var fs$WriteStream = fs3.WriteStream;
730
+ if (fs$WriteStream) {
731
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype);
732
+ WriteStream.prototype.open = WriteStream$open;
733
+ }
734
+ Object.defineProperty(fs3, "ReadStream", {
735
+ get: function() {
736
+ return ReadStream;
737
+ },
738
+ set: function(val) {
739
+ ReadStream = val;
740
+ },
741
+ enumerable: true,
742
+ configurable: true
743
+ });
744
+ Object.defineProperty(fs3, "WriteStream", {
745
+ get: function() {
746
+ return WriteStream;
747
+ },
748
+ set: function(val) {
749
+ WriteStream = val;
750
+ },
751
+ enumerable: true,
752
+ configurable: true
753
+ });
754
+ var FileReadStream = ReadStream;
755
+ Object.defineProperty(fs3, "FileReadStream", {
756
+ get: function() {
757
+ return FileReadStream;
758
+ },
759
+ set: function(val) {
760
+ FileReadStream = val;
761
+ },
762
+ enumerable: true,
763
+ configurable: true
764
+ });
765
+ var FileWriteStream = WriteStream;
766
+ Object.defineProperty(fs3, "FileWriteStream", {
767
+ get: function() {
768
+ return FileWriteStream;
769
+ },
770
+ set: function(val) {
771
+ FileWriteStream = val;
772
+ },
773
+ enumerable: true,
774
+ configurable: true
775
+ });
776
+ function ReadStream(path2, options) {
777
+ if (this instanceof ReadStream)
778
+ return fs$ReadStream.apply(this, arguments), this;
779
+ else
780
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
781
+ }
782
+ function ReadStream$open() {
783
+ var that = this;
784
+ open(that.path, that.flags, that.mode, function(err, fd) {
785
+ if (err) {
786
+ if (that.autoClose)
787
+ that.destroy();
788
+ that.emit("error", err);
789
+ } else {
790
+ that.fd = fd;
791
+ that.emit("open", fd);
792
+ that.read();
793
+ }
794
+ });
795
+ }
796
+ function WriteStream(path2, options) {
797
+ if (this instanceof WriteStream)
798
+ return fs$WriteStream.apply(this, arguments), this;
799
+ else
800
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
801
+ }
802
+ function WriteStream$open() {
803
+ var that = this;
804
+ open(that.path, that.flags, that.mode, function(err, fd) {
805
+ if (err) {
806
+ that.destroy();
807
+ that.emit("error", err);
808
+ } else {
809
+ that.fd = fd;
810
+ that.emit("open", fd);
811
+ }
812
+ });
813
+ }
814
+ function createReadStream(path2, options) {
815
+ return new fs3.ReadStream(path2, options);
816
+ }
817
+ function createWriteStream(path2, options) {
818
+ return new fs3.WriteStream(path2, options);
819
+ }
820
+ var fs$open = fs3.open;
821
+ fs3.open = open;
822
+ function open(path2, flags, mode, cb) {
823
+ if (typeof mode === "function")
824
+ cb = mode, mode = null;
825
+ return go$open(path2, flags, mode, cb);
826
+ function go$open(path3, flags2, mode2, cb2, startTime) {
827
+ return fs$open(path3, flags2, mode2, function(err, fd) {
828
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
829
+ enqueue([go$open, [path3, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
830
+ else {
831
+ if (typeof cb2 === "function")
832
+ cb2.apply(this, arguments);
833
+ }
834
+ });
835
+ }
836
+ }
837
+ return fs3;
838
+ }
839
+ function enqueue(elem) {
840
+ debug("ENQUEUE", elem[0].name, elem[1]);
841
+ fs2[gracefulQueue].push(elem);
842
+ retry();
843
+ }
844
+ var retryTimer;
845
+ function resetQueue() {
846
+ var now = Date.now();
847
+ for (var i = 0; i < fs2[gracefulQueue].length; ++i) {
848
+ if (fs2[gracefulQueue][i].length > 2) {
849
+ fs2[gracefulQueue][i][3] = now;
850
+ fs2[gracefulQueue][i][4] = now;
851
+ }
852
+ }
853
+ retry();
854
+ }
855
+ function retry() {
856
+ clearTimeout(retryTimer);
857
+ retryTimer = void 0;
858
+ if (fs2[gracefulQueue].length === 0)
859
+ return;
860
+ var elem = fs2[gracefulQueue].shift();
861
+ var fn = elem[0];
862
+ var args = elem[1];
863
+ var err = elem[2];
864
+ var startTime = elem[3];
865
+ var lastTime = elem[4];
866
+ if (startTime === void 0) {
867
+ debug("RETRY", fn.name, args);
868
+ fn.apply(null, args);
869
+ } else if (Date.now() - startTime >= 6e4) {
870
+ debug("TIMEOUT", fn.name, args);
871
+ var cb = args.pop();
872
+ if (typeof cb === "function")
873
+ cb.call(null, err);
874
+ } else {
875
+ var sinceAttempt = Date.now() - lastTime;
876
+ var sinceStart = Math.max(lastTime - startTime, 1);
877
+ var desiredDelay = Math.min(sinceStart * 1.2, 100);
878
+ if (sinceAttempt >= desiredDelay) {
879
+ debug("RETRY", fn.name, args);
880
+ fn.apply(null, args.concat([startTime]));
881
+ } else {
882
+ fs2[gracefulQueue].push(elem);
883
+ }
884
+ }
885
+ if (retryTimer === void 0) {
886
+ retryTimer = setTimeout(retry, 0);
887
+ }
888
+ }
889
+ }
890
+ });
891
+
892
+ // node_modules/fs-extra/lib/fs/index.js
893
+ var require_fs = __commonJS({
894
+ "node_modules/fs-extra/lib/fs/index.js"(exports2) {
895
+ "use strict";
896
+ var u = require_universalify().fromCallback;
897
+ var fs2 = require_graceful_fs();
898
+ var api = [
899
+ "access",
900
+ "appendFile",
901
+ "chmod",
902
+ "chown",
903
+ "close",
904
+ "copyFile",
905
+ "cp",
906
+ "fchmod",
907
+ "fchown",
908
+ "fdatasync",
909
+ "fstat",
910
+ "fsync",
911
+ "ftruncate",
912
+ "futimes",
913
+ "glob",
914
+ "lchmod",
915
+ "lchown",
916
+ "lutimes",
917
+ "link",
918
+ "lstat",
919
+ "mkdir",
920
+ "mkdtemp",
921
+ "open",
922
+ "opendir",
923
+ "readdir",
924
+ "readFile",
925
+ "readlink",
926
+ "realpath",
927
+ "rename",
928
+ "rm",
929
+ "rmdir",
930
+ "stat",
931
+ "statfs",
932
+ "symlink",
933
+ "truncate",
934
+ "unlink",
935
+ "utimes",
936
+ "writeFile"
937
+ ].filter((key) => {
938
+ return typeof fs2[key] === "function";
939
+ });
940
+ Object.assign(exports2, fs2);
941
+ api.forEach((method) => {
942
+ exports2[method] = u(fs2[method]);
943
+ });
944
+ exports2.exists = function(filename, callback) {
945
+ if (typeof callback === "function") {
946
+ return fs2.exists(filename, callback);
947
+ }
948
+ return new Promise((resolve) => {
949
+ return fs2.exists(filename, resolve);
950
+ });
951
+ };
952
+ exports2.read = function(fd, buffer, offset, length, position, callback) {
953
+ if (typeof callback === "function") {
954
+ return fs2.read(fd, buffer, offset, length, position, callback);
955
+ }
956
+ return new Promise((resolve, reject) => {
957
+ fs2.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
958
+ if (err) return reject(err);
959
+ resolve({ bytesRead, buffer: buffer2 });
960
+ });
961
+ });
962
+ };
963
+ exports2.write = function(fd, buffer, ...args) {
964
+ if (typeof args[args.length - 1] === "function") {
965
+ return fs2.write(fd, buffer, ...args);
966
+ }
967
+ return new Promise((resolve, reject) => {
968
+ fs2.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
969
+ if (err) return reject(err);
970
+ resolve({ bytesWritten, buffer: buffer2 });
971
+ });
972
+ });
973
+ };
974
+ exports2.readv = function(fd, buffers, ...args) {
975
+ if (typeof args[args.length - 1] === "function") {
976
+ return fs2.readv(fd, buffers, ...args);
977
+ }
978
+ return new Promise((resolve, reject) => {
979
+ fs2.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
980
+ if (err) return reject(err);
981
+ resolve({ bytesRead, buffers: buffers2 });
982
+ });
983
+ });
984
+ };
985
+ exports2.writev = function(fd, buffers, ...args) {
986
+ if (typeof args[args.length - 1] === "function") {
987
+ return fs2.writev(fd, buffers, ...args);
988
+ }
989
+ return new Promise((resolve, reject) => {
990
+ fs2.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
991
+ if (err) return reject(err);
992
+ resolve({ bytesWritten, buffers: buffers2 });
993
+ });
994
+ });
995
+ };
996
+ if (typeof fs2.realpath.native === "function") {
997
+ exports2.realpath.native = u(fs2.realpath.native);
998
+ } else {
999
+ process.emitWarning(
1000
+ "fs.realpath.native is not a function. Is fs being monkey-patched?",
1001
+ "Warning",
1002
+ "fs-extra-WARN0003"
1003
+ );
1004
+ }
1005
+ }
1006
+ });
1007
+
1008
+ // node_modules/fs-extra/lib/mkdirs/utils.js
1009
+ var require_utils = __commonJS({
1010
+ "node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
1011
+ "use strict";
1012
+ var path2 = require("path");
1013
+ module2.exports.checkPath = function checkPath(pth) {
1014
+ if (process.platform === "win32") {
1015
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path2.parse(pth).root, ""));
1016
+ if (pathHasInvalidWinCharacters) {
1017
+ const error = new Error(`Path contains invalid characters: ${pth}`);
1018
+ error.code = "EINVAL";
1019
+ throw error;
1020
+ }
1021
+ }
1022
+ };
1023
+ }
1024
+ });
1025
+
1026
+ // node_modules/fs-extra/lib/mkdirs/make-dir.js
1027
+ var require_make_dir = __commonJS({
1028
+ "node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
1029
+ "use strict";
1030
+ var fs2 = require_fs();
1031
+ var { checkPath } = require_utils();
1032
+ var getMode = (options) => {
1033
+ const defaults = { mode: 511 };
1034
+ if (typeof options === "number") return options;
1035
+ return { ...defaults, ...options }.mode;
1036
+ };
1037
+ module2.exports.makeDir = async (dir, options) => {
1038
+ checkPath(dir);
1039
+ return fs2.mkdir(dir, {
1040
+ mode: getMode(options),
1041
+ recursive: true
1042
+ });
1043
+ };
1044
+ module2.exports.makeDirSync = (dir, options) => {
1045
+ checkPath(dir);
1046
+ return fs2.mkdirSync(dir, {
1047
+ mode: getMode(options),
1048
+ recursive: true
1049
+ });
1050
+ };
1051
+ }
1052
+ });
1053
+
1054
+ // node_modules/fs-extra/lib/mkdirs/index.js
1055
+ var require_mkdirs = __commonJS({
1056
+ "node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) {
1057
+ "use strict";
1058
+ var u = require_universalify().fromPromise;
1059
+ var { makeDir: _makeDir, makeDirSync } = require_make_dir();
1060
+ var makeDir = u(_makeDir);
1061
+ module2.exports = {
1062
+ mkdirs: makeDir,
1063
+ mkdirsSync: makeDirSync,
1064
+ // alias
1065
+ mkdirp: makeDir,
1066
+ mkdirpSync: makeDirSync,
1067
+ ensureDir: makeDir,
1068
+ ensureDirSync: makeDirSync
1069
+ };
1070
+ }
1071
+ });
1072
+
1073
+ // node_modules/fs-extra/lib/path-exists/index.js
1074
+ var require_path_exists = __commonJS({
1075
+ "node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
1076
+ "use strict";
1077
+ var u = require_universalify().fromPromise;
1078
+ var fs2 = require_fs();
1079
+ function pathExists(path2) {
1080
+ return fs2.access(path2).then(() => true).catch(() => false);
1081
+ }
1082
+ module2.exports = {
1083
+ pathExists: u(pathExists),
1084
+ pathExistsSync: fs2.existsSync
1085
+ };
1086
+ }
1087
+ });
1088
+
1089
+ // node_modules/fs-extra/lib/util/utimes.js
1090
+ var require_utimes = __commonJS({
1091
+ "node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
1092
+ "use strict";
1093
+ var fs2 = require_fs();
1094
+ var u = require_universalify().fromPromise;
1095
+ async function utimesMillis(path2, atime, mtime) {
1096
+ const fd = await fs2.open(path2, "r+");
1097
+ let closeErr = null;
1098
+ try {
1099
+ await fs2.futimes(fd, atime, mtime);
1100
+ } finally {
1101
+ try {
1102
+ await fs2.close(fd);
1103
+ } catch (e) {
1104
+ closeErr = e;
1105
+ }
1106
+ }
1107
+ if (closeErr) {
1108
+ throw closeErr;
1109
+ }
1110
+ }
1111
+ function utimesMillisSync(path2, atime, mtime) {
1112
+ const fd = fs2.openSync(path2, "r+");
1113
+ fs2.futimesSync(fd, atime, mtime);
1114
+ return fs2.closeSync(fd);
1115
+ }
1116
+ module2.exports = {
1117
+ utimesMillis: u(utimesMillis),
1118
+ utimesMillisSync
1119
+ };
1120
+ }
1121
+ });
1122
+
1123
+ // node_modules/fs-extra/lib/util/stat.js
1124
+ var require_stat = __commonJS({
1125
+ "node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
1126
+ "use strict";
1127
+ var fs2 = require_fs();
1128
+ var path2 = require("path");
1129
+ var u = require_universalify().fromPromise;
1130
+ function getStats(src, dest, opts) {
1131
+ const statFunc = opts.dereference ? (file) => fs2.stat(file, { bigint: true }) : (file) => fs2.lstat(file, { bigint: true });
1132
+ return Promise.all([
1133
+ statFunc(src),
1134
+ statFunc(dest).catch((err) => {
1135
+ if (err.code === "ENOENT") return null;
1136
+ throw err;
1137
+ })
1138
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
1139
+ }
1140
+ function getStatsSync(src, dest, opts) {
1141
+ let destStat;
1142
+ const statFunc = opts.dereference ? (file) => fs2.statSync(file, { bigint: true }) : (file) => fs2.lstatSync(file, { bigint: true });
1143
+ const srcStat = statFunc(src);
1144
+ try {
1145
+ destStat = statFunc(dest);
1146
+ } catch (err) {
1147
+ if (err.code === "ENOENT") return { srcStat, destStat: null };
1148
+ throw err;
1149
+ }
1150
+ return { srcStat, destStat };
1151
+ }
1152
+ async function checkPaths(src, dest, funcName, opts) {
1153
+ const { srcStat, destStat } = await getStats(src, dest, opts);
1154
+ if (destStat) {
1155
+ if (areIdentical(srcStat, destStat)) {
1156
+ const srcBaseName = path2.basename(src);
1157
+ const destBaseName = path2.basename(dest);
1158
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1159
+ return { srcStat, destStat, isChangingCase: true };
1160
+ }
1161
+ throw new Error("Source and destination must not be the same.");
1162
+ }
1163
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1164
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1165
+ }
1166
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1167
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1168
+ }
1169
+ }
1170
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1171
+ throw new Error(errMsg(src, dest, funcName));
1172
+ }
1173
+ return { srcStat, destStat };
1174
+ }
1175
+ function checkPathsSync(src, dest, funcName, opts) {
1176
+ const { srcStat, destStat } = getStatsSync(src, dest, opts);
1177
+ if (destStat) {
1178
+ if (areIdentical(srcStat, destStat)) {
1179
+ const srcBaseName = path2.basename(src);
1180
+ const destBaseName = path2.basename(dest);
1181
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1182
+ return { srcStat, destStat, isChangingCase: true };
1183
+ }
1184
+ throw new Error("Source and destination must not be the same.");
1185
+ }
1186
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1187
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1188
+ }
1189
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1190
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1191
+ }
1192
+ }
1193
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1194
+ throw new Error(errMsg(src, dest, funcName));
1195
+ }
1196
+ return { srcStat, destStat };
1197
+ }
1198
+ async function checkParentPaths(src, srcStat, dest, funcName) {
1199
+ const srcParent = path2.resolve(path2.dirname(src));
1200
+ const destParent = path2.resolve(path2.dirname(dest));
1201
+ if (destParent === srcParent || destParent === path2.parse(destParent).root) return;
1202
+ let destStat;
1203
+ try {
1204
+ destStat = await fs2.stat(destParent, { bigint: true });
1205
+ } catch (err) {
1206
+ if (err.code === "ENOENT") return;
1207
+ throw err;
1208
+ }
1209
+ if (areIdentical(srcStat, destStat)) {
1210
+ throw new Error(errMsg(src, dest, funcName));
1211
+ }
1212
+ return checkParentPaths(src, srcStat, destParent, funcName);
1213
+ }
1214
+ function checkParentPathsSync(src, srcStat, dest, funcName) {
1215
+ const srcParent = path2.resolve(path2.dirname(src));
1216
+ const destParent = path2.resolve(path2.dirname(dest));
1217
+ if (destParent === srcParent || destParent === path2.parse(destParent).root) return;
1218
+ let destStat;
1219
+ try {
1220
+ destStat = fs2.statSync(destParent, { bigint: true });
1221
+ } catch (err) {
1222
+ if (err.code === "ENOENT") return;
1223
+ throw err;
1224
+ }
1225
+ if (areIdentical(srcStat, destStat)) {
1226
+ throw new Error(errMsg(src, dest, funcName));
1227
+ }
1228
+ return checkParentPathsSync(src, srcStat, destParent, funcName);
1229
+ }
1230
+ function areIdentical(srcStat, destStat) {
1231
+ return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1232
+ }
1233
+ function isSrcSubdir(src, dest) {
1234
+ const srcArr = path2.resolve(src).split(path2.sep).filter((i) => i);
1235
+ const destArr = path2.resolve(dest).split(path2.sep).filter((i) => i);
1236
+ return srcArr.every((cur, i) => destArr[i] === cur);
1237
+ }
1238
+ function errMsg(src, dest, funcName) {
1239
+ return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
1240
+ }
1241
+ module2.exports = {
1242
+ // checkPaths
1243
+ checkPaths: u(checkPaths),
1244
+ checkPathsSync,
1245
+ // checkParent
1246
+ checkParentPaths: u(checkParentPaths),
1247
+ checkParentPathsSync,
1248
+ // Misc
1249
+ isSrcSubdir,
1250
+ areIdentical
1251
+ };
1252
+ }
1253
+ });
1254
+
1255
+ // node_modules/fs-extra/lib/copy/copy.js
1256
+ var require_copy = __commonJS({
1257
+ "node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
1258
+ "use strict";
1259
+ var fs2 = require_fs();
1260
+ var path2 = require("path");
1261
+ var { mkdirs } = require_mkdirs();
1262
+ var { pathExists } = require_path_exists();
1263
+ var { utimesMillis } = require_utimes();
1264
+ var stat = require_stat();
1265
+ async function copy(src, dest, opts = {}) {
1266
+ if (typeof opts === "function") {
1267
+ opts = { filter: opts };
1268
+ }
1269
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1270
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1271
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1272
+ process.emitWarning(
1273
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1274
+ "Warning",
1275
+ "fs-extra-WARN0001"
1276
+ );
1277
+ }
1278
+ const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
1279
+ await stat.checkParentPaths(src, srcStat, dest, "copy");
1280
+ const include = await runFilter(src, dest, opts);
1281
+ if (!include) return;
1282
+ const destParent = path2.dirname(dest);
1283
+ const dirExists = await pathExists(destParent);
1284
+ if (!dirExists) {
1285
+ await mkdirs(destParent);
1286
+ }
1287
+ await getStatsAndPerformCopy(destStat, src, dest, opts);
1288
+ }
1289
+ async function runFilter(src, dest, opts) {
1290
+ if (!opts.filter) return true;
1291
+ return opts.filter(src, dest);
1292
+ }
1293
+ async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1294
+ const statFn = opts.dereference ? fs2.stat : fs2.lstat;
1295
+ const srcStat = await statFn(src);
1296
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1297
+ if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1298
+ if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1299
+ if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1300
+ if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1301
+ throw new Error(`Unknown file: ${src}`);
1302
+ }
1303
+ async function onFile(srcStat, destStat, src, dest, opts) {
1304
+ if (!destStat) return copyFile(srcStat, src, dest, opts);
1305
+ if (opts.overwrite) {
1306
+ await fs2.unlink(dest);
1307
+ return copyFile(srcStat, src, dest, opts);
1308
+ }
1309
+ if (opts.errorOnExist) {
1310
+ throw new Error(`'${dest}' already exists`);
1311
+ }
1312
+ }
1313
+ async function copyFile(srcStat, src, dest, opts) {
1314
+ await fs2.copyFile(src, dest);
1315
+ if (opts.preserveTimestamps) {
1316
+ if (fileIsNotWritable(srcStat.mode)) {
1317
+ await makeFileWritable(dest, srcStat.mode);
1318
+ }
1319
+ const updatedSrcStat = await fs2.stat(src);
1320
+ await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1321
+ }
1322
+ return fs2.chmod(dest, srcStat.mode);
1323
+ }
1324
+ function fileIsNotWritable(srcMode) {
1325
+ return (srcMode & 128) === 0;
1326
+ }
1327
+ function makeFileWritable(dest, srcMode) {
1328
+ return fs2.chmod(dest, srcMode | 128);
1329
+ }
1330
+ async function onDir(srcStat, destStat, src, dest, opts) {
1331
+ if (!destStat) {
1332
+ await fs2.mkdir(dest);
1333
+ }
1334
+ const promises = [];
1335
+ for await (const item of await fs2.opendir(src)) {
1336
+ const srcItem = path2.join(src, item.name);
1337
+ const destItem = path2.join(dest, item.name);
1338
+ promises.push(
1339
+ runFilter(srcItem, destItem, opts).then((include) => {
1340
+ if (include) {
1341
+ return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => {
1342
+ return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
1343
+ });
1344
+ }
1345
+ })
1346
+ );
1347
+ }
1348
+ await Promise.all(promises);
1349
+ if (!destStat) {
1350
+ await fs2.chmod(dest, srcStat.mode);
1351
+ }
1352
+ }
1353
+ async function onLink(destStat, src, dest, opts) {
1354
+ let resolvedSrc = await fs2.readlink(src);
1355
+ if (opts.dereference) {
1356
+ resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
1357
+ }
1358
+ if (!destStat) {
1359
+ return fs2.symlink(resolvedSrc, dest);
1360
+ }
1361
+ let resolvedDest = null;
1362
+ try {
1363
+ resolvedDest = await fs2.readlink(dest);
1364
+ } catch (e) {
1365
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs2.symlink(resolvedSrc, dest);
1366
+ throw e;
1367
+ }
1368
+ if (opts.dereference) {
1369
+ resolvedDest = path2.resolve(process.cwd(), resolvedDest);
1370
+ }
1371
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1372
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1373
+ }
1374
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1375
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1376
+ }
1377
+ await fs2.unlink(dest);
1378
+ return fs2.symlink(resolvedSrc, dest);
1379
+ }
1380
+ module2.exports = copy;
1381
+ }
1382
+ });
1383
+
1384
+ // node_modules/fs-extra/lib/copy/copy-sync.js
1385
+ var require_copy_sync = __commonJS({
1386
+ "node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
1387
+ "use strict";
1388
+ var fs2 = require_graceful_fs();
1389
+ var path2 = require("path");
1390
+ var mkdirsSync = require_mkdirs().mkdirsSync;
1391
+ var utimesMillisSync = require_utimes().utimesMillisSync;
1392
+ var stat = require_stat();
1393
+ function copySync(src, dest, opts) {
1394
+ if (typeof opts === "function") {
1395
+ opts = { filter: opts };
1396
+ }
1397
+ opts = opts || {};
1398
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1399
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1400
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1401
+ process.emitWarning(
1402
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1403
+ "Warning",
1404
+ "fs-extra-WARN0002"
1405
+ );
1406
+ }
1407
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1408
+ stat.checkParentPathsSync(src, srcStat, dest, "copy");
1409
+ if (opts.filter && !opts.filter(src, dest)) return;
1410
+ const destParent = path2.dirname(dest);
1411
+ if (!fs2.existsSync(destParent)) mkdirsSync(destParent);
1412
+ return getStats(destStat, src, dest, opts);
1413
+ }
1414
+ function getStats(destStat, src, dest, opts) {
1415
+ const statSync = opts.dereference ? fs2.statSync : fs2.lstatSync;
1416
+ const srcStat = statSync(src);
1417
+ if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1418
+ else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
1419
+ else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
1420
+ else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
1421
+ else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1422
+ throw new Error(`Unknown file: ${src}`);
1423
+ }
1424
+ function onFile(srcStat, destStat, src, dest, opts) {
1425
+ if (!destStat) return copyFile(srcStat, src, dest, opts);
1426
+ return mayCopyFile(srcStat, src, dest, opts);
1427
+ }
1428
+ function mayCopyFile(srcStat, src, dest, opts) {
1429
+ if (opts.overwrite) {
1430
+ fs2.unlinkSync(dest);
1431
+ return copyFile(srcStat, src, dest, opts);
1432
+ } else if (opts.errorOnExist) {
1433
+ throw new Error(`'${dest}' already exists`);
1434
+ }
1435
+ }
1436
+ function copyFile(srcStat, src, dest, opts) {
1437
+ fs2.copyFileSync(src, dest);
1438
+ if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
1439
+ return setDestMode(dest, srcStat.mode);
1440
+ }
1441
+ function handleTimestamps(srcMode, src, dest) {
1442
+ if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
1443
+ return setDestTimestamps(src, dest);
1444
+ }
1445
+ function fileIsNotWritable(srcMode) {
1446
+ return (srcMode & 128) === 0;
1447
+ }
1448
+ function makeFileWritable(dest, srcMode) {
1449
+ return setDestMode(dest, srcMode | 128);
1450
+ }
1451
+ function setDestMode(dest, srcMode) {
1452
+ return fs2.chmodSync(dest, srcMode);
1453
+ }
1454
+ function setDestTimestamps(src, dest) {
1455
+ const updatedSrcStat = fs2.statSync(src);
1456
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1457
+ }
1458
+ function onDir(srcStat, destStat, src, dest, opts) {
1459
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
1460
+ return copyDir(src, dest, opts);
1461
+ }
1462
+ function mkDirAndCopy(srcMode, src, dest, opts) {
1463
+ fs2.mkdirSync(dest);
1464
+ copyDir(src, dest, opts);
1465
+ return setDestMode(dest, srcMode);
1466
+ }
1467
+ function copyDir(src, dest, opts) {
1468
+ const dir = fs2.opendirSync(src);
1469
+ try {
1470
+ let dirent;
1471
+ while ((dirent = dir.readSync()) !== null) {
1472
+ copyDirItem(dirent.name, src, dest, opts);
1473
+ }
1474
+ } finally {
1475
+ dir.closeSync();
1476
+ }
1477
+ }
1478
+ function copyDirItem(item, src, dest, opts) {
1479
+ const srcItem = path2.join(src, item);
1480
+ const destItem = path2.join(dest, item);
1481
+ if (opts.filter && !opts.filter(srcItem, destItem)) return;
1482
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1483
+ return getStats(destStat, srcItem, destItem, opts);
1484
+ }
1485
+ function onLink(destStat, src, dest, opts) {
1486
+ let resolvedSrc = fs2.readlinkSync(src);
1487
+ if (opts.dereference) {
1488
+ resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
1489
+ }
1490
+ if (!destStat) {
1491
+ return fs2.symlinkSync(resolvedSrc, dest);
1492
+ } else {
1493
+ let resolvedDest;
1494
+ try {
1495
+ resolvedDest = fs2.readlinkSync(dest);
1496
+ } catch (err) {
1497
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs2.symlinkSync(resolvedSrc, dest);
1498
+ throw err;
1499
+ }
1500
+ if (opts.dereference) {
1501
+ resolvedDest = path2.resolve(process.cwd(), resolvedDest);
1502
+ }
1503
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1504
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1505
+ }
1506
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1507
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1508
+ }
1509
+ return copyLink(resolvedSrc, dest);
1510
+ }
1511
+ }
1512
+ function copyLink(resolvedSrc, dest) {
1513
+ fs2.unlinkSync(dest);
1514
+ return fs2.symlinkSync(resolvedSrc, dest);
1515
+ }
1516
+ module2.exports = copySync;
1517
+ }
1518
+ });
1519
+
1520
+ // node_modules/fs-extra/lib/copy/index.js
1521
+ var require_copy2 = __commonJS({
1522
+ "node_modules/fs-extra/lib/copy/index.js"(exports2, module2) {
1523
+ "use strict";
1524
+ var u = require_universalify().fromPromise;
1525
+ module2.exports = {
1526
+ copy: u(require_copy()),
1527
+ copySync: require_copy_sync()
1528
+ };
1529
+ }
1530
+ });
1531
+
1532
+ // node_modules/fs-extra/lib/remove/index.js
1533
+ var require_remove = __commonJS({
1534
+ "node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
1535
+ "use strict";
1536
+ var fs2 = require_graceful_fs();
1537
+ var u = require_universalify().fromCallback;
1538
+ function remove(path2, callback) {
1539
+ fs2.rm(path2, { recursive: true, force: true }, callback);
1540
+ }
1541
+ function removeSync(path2) {
1542
+ fs2.rmSync(path2, { recursive: true, force: true });
1543
+ }
1544
+ module2.exports = {
1545
+ remove: u(remove),
1546
+ removeSync
1547
+ };
1548
+ }
1549
+ });
1550
+
1551
+ // node_modules/fs-extra/lib/empty/index.js
1552
+ var require_empty = __commonJS({
1553
+ "node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
1554
+ "use strict";
1555
+ var u = require_universalify().fromPromise;
1556
+ var fs2 = require_fs();
1557
+ var path2 = require("path");
1558
+ var mkdir = require_mkdirs();
1559
+ var remove = require_remove();
1560
+ var emptyDir = u(async function emptyDir2(dir) {
1561
+ let items;
1562
+ try {
1563
+ items = await fs2.readdir(dir);
1564
+ } catch {
1565
+ return mkdir.mkdirs(dir);
1566
+ }
1567
+ return Promise.all(items.map((item) => remove.remove(path2.join(dir, item))));
1568
+ });
1569
+ function emptyDirSync(dir) {
1570
+ let items;
1571
+ try {
1572
+ items = fs2.readdirSync(dir);
1573
+ } catch {
1574
+ return mkdir.mkdirsSync(dir);
1575
+ }
1576
+ items.forEach((item) => {
1577
+ item = path2.join(dir, item);
1578
+ remove.removeSync(item);
1579
+ });
1580
+ }
1581
+ module2.exports = {
1582
+ emptyDirSync,
1583
+ emptydirSync: emptyDirSync,
1584
+ emptyDir,
1585
+ emptydir: emptyDir
1586
+ };
1587
+ }
1588
+ });
1589
+
1590
+ // node_modules/fs-extra/lib/ensure/file.js
1591
+ var require_file = __commonJS({
1592
+ "node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
1593
+ "use strict";
1594
+ var u = require_universalify().fromPromise;
1595
+ var path2 = require("path");
1596
+ var fs2 = require_fs();
1597
+ var mkdir = require_mkdirs();
1598
+ async function createFile(file) {
1599
+ let stats;
1600
+ try {
1601
+ stats = await fs2.stat(file);
1602
+ } catch {
1603
+ }
1604
+ if (stats && stats.isFile()) return;
1605
+ const dir = path2.dirname(file);
1606
+ let dirStats = null;
1607
+ try {
1608
+ dirStats = await fs2.stat(dir);
1609
+ } catch (err) {
1610
+ if (err.code === "ENOENT") {
1611
+ await mkdir.mkdirs(dir);
1612
+ await fs2.writeFile(file, "");
1613
+ return;
1614
+ } else {
1615
+ throw err;
1616
+ }
1617
+ }
1618
+ if (dirStats.isDirectory()) {
1619
+ await fs2.writeFile(file, "");
1620
+ } else {
1621
+ await fs2.readdir(dir);
1622
+ }
1623
+ }
1624
+ function createFileSync(file) {
1625
+ let stats;
1626
+ try {
1627
+ stats = fs2.statSync(file);
1628
+ } catch {
1629
+ }
1630
+ if (stats && stats.isFile()) return;
1631
+ const dir = path2.dirname(file);
1632
+ try {
1633
+ if (!fs2.statSync(dir).isDirectory()) {
1634
+ fs2.readdirSync(dir);
1635
+ }
1636
+ } catch (err) {
1637
+ if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
1638
+ else throw err;
1639
+ }
1640
+ fs2.writeFileSync(file, "");
1641
+ }
1642
+ module2.exports = {
1643
+ createFile: u(createFile),
1644
+ createFileSync
1645
+ };
1646
+ }
1647
+ });
1648
+
1649
+ // node_modules/fs-extra/lib/ensure/link.js
1650
+ var require_link = __commonJS({
1651
+ "node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
1652
+ "use strict";
1653
+ var u = require_universalify().fromPromise;
1654
+ var path2 = require("path");
1655
+ var fs2 = require_fs();
1656
+ var mkdir = require_mkdirs();
1657
+ var { pathExists } = require_path_exists();
1658
+ var { areIdentical } = require_stat();
1659
+ async function createLink(srcpath, dstpath) {
1660
+ let dstStat;
1661
+ try {
1662
+ dstStat = await fs2.lstat(dstpath);
1663
+ } catch {
1664
+ }
1665
+ let srcStat;
1666
+ try {
1667
+ srcStat = await fs2.lstat(srcpath);
1668
+ } catch (err) {
1669
+ err.message = err.message.replace("lstat", "ensureLink");
1670
+ throw err;
1671
+ }
1672
+ if (dstStat && areIdentical(srcStat, dstStat)) return;
1673
+ const dir = path2.dirname(dstpath);
1674
+ const dirExists = await pathExists(dir);
1675
+ if (!dirExists) {
1676
+ await mkdir.mkdirs(dir);
1677
+ }
1678
+ await fs2.link(srcpath, dstpath);
1679
+ }
1680
+ function createLinkSync(srcpath, dstpath) {
1681
+ let dstStat;
1682
+ try {
1683
+ dstStat = fs2.lstatSync(dstpath);
1684
+ } catch {
1685
+ }
1686
+ try {
1687
+ const srcStat = fs2.lstatSync(srcpath);
1688
+ if (dstStat && areIdentical(srcStat, dstStat)) return;
1689
+ } catch (err) {
1690
+ err.message = err.message.replace("lstat", "ensureLink");
1691
+ throw err;
1692
+ }
1693
+ const dir = path2.dirname(dstpath);
1694
+ const dirExists = fs2.existsSync(dir);
1695
+ if (dirExists) return fs2.linkSync(srcpath, dstpath);
1696
+ mkdir.mkdirsSync(dir);
1697
+ return fs2.linkSync(srcpath, dstpath);
1698
+ }
1699
+ module2.exports = {
1700
+ createLink: u(createLink),
1701
+ createLinkSync
1702
+ };
1703
+ }
1704
+ });
1705
+
1706
+ // node_modules/fs-extra/lib/ensure/symlink-paths.js
1707
+ var require_symlink_paths = __commonJS({
1708
+ "node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
1709
+ "use strict";
1710
+ var path2 = require("path");
1711
+ var fs2 = require_fs();
1712
+ var { pathExists } = require_path_exists();
1713
+ var u = require_universalify().fromPromise;
1714
+ async function symlinkPaths(srcpath, dstpath) {
1715
+ if (path2.isAbsolute(srcpath)) {
1716
+ try {
1717
+ await fs2.lstat(srcpath);
1718
+ } catch (err) {
1719
+ err.message = err.message.replace("lstat", "ensureSymlink");
1720
+ throw err;
1721
+ }
1722
+ return {
1723
+ toCwd: srcpath,
1724
+ toDst: srcpath
1725
+ };
1726
+ }
1727
+ const dstdir = path2.dirname(dstpath);
1728
+ const relativeToDst = path2.join(dstdir, srcpath);
1729
+ const exists = await pathExists(relativeToDst);
1730
+ if (exists) {
1731
+ return {
1732
+ toCwd: relativeToDst,
1733
+ toDst: srcpath
1734
+ };
1735
+ }
1736
+ try {
1737
+ await fs2.lstat(srcpath);
1738
+ } catch (err) {
1739
+ err.message = err.message.replace("lstat", "ensureSymlink");
1740
+ throw err;
1741
+ }
1742
+ return {
1743
+ toCwd: srcpath,
1744
+ toDst: path2.relative(dstdir, srcpath)
1745
+ };
1746
+ }
1747
+ function symlinkPathsSync(srcpath, dstpath) {
1748
+ if (path2.isAbsolute(srcpath)) {
1749
+ const exists2 = fs2.existsSync(srcpath);
1750
+ if (!exists2) throw new Error("absolute srcpath does not exist");
1751
+ return {
1752
+ toCwd: srcpath,
1753
+ toDst: srcpath
1754
+ };
1755
+ }
1756
+ const dstdir = path2.dirname(dstpath);
1757
+ const relativeToDst = path2.join(dstdir, srcpath);
1758
+ const exists = fs2.existsSync(relativeToDst);
1759
+ if (exists) {
1760
+ return {
1761
+ toCwd: relativeToDst,
1762
+ toDst: srcpath
1763
+ };
1764
+ }
1765
+ const srcExists = fs2.existsSync(srcpath);
1766
+ if (!srcExists) throw new Error("relative srcpath does not exist");
1767
+ return {
1768
+ toCwd: srcpath,
1769
+ toDst: path2.relative(dstdir, srcpath)
1770
+ };
1771
+ }
1772
+ module2.exports = {
1773
+ symlinkPaths: u(symlinkPaths),
1774
+ symlinkPathsSync
1775
+ };
1776
+ }
1777
+ });
1778
+
1779
+ // node_modules/fs-extra/lib/ensure/symlink-type.js
1780
+ var require_symlink_type = __commonJS({
1781
+ "node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
1782
+ "use strict";
1783
+ var fs2 = require_fs();
1784
+ var u = require_universalify().fromPromise;
1785
+ async function symlinkType(srcpath, type) {
1786
+ if (type) return type;
1787
+ let stats;
1788
+ try {
1789
+ stats = await fs2.lstat(srcpath);
1790
+ } catch {
1791
+ return "file";
1792
+ }
1793
+ return stats && stats.isDirectory() ? "dir" : "file";
1794
+ }
1795
+ function symlinkTypeSync(srcpath, type) {
1796
+ if (type) return type;
1797
+ let stats;
1798
+ try {
1799
+ stats = fs2.lstatSync(srcpath);
1800
+ } catch {
1801
+ return "file";
1802
+ }
1803
+ return stats && stats.isDirectory() ? "dir" : "file";
1804
+ }
1805
+ module2.exports = {
1806
+ symlinkType: u(symlinkType),
1807
+ symlinkTypeSync
1808
+ };
1809
+ }
1810
+ });
1811
+
1812
+ // node_modules/fs-extra/lib/ensure/symlink.js
1813
+ var require_symlink = __commonJS({
1814
+ "node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
1815
+ "use strict";
1816
+ var u = require_universalify().fromPromise;
1817
+ var path2 = require("path");
1818
+ var fs2 = require_fs();
1819
+ var { mkdirs, mkdirsSync } = require_mkdirs();
1820
+ var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1821
+ var { symlinkType, symlinkTypeSync } = require_symlink_type();
1822
+ var { pathExists } = require_path_exists();
1823
+ var { areIdentical } = require_stat();
1824
+ async function createSymlink(srcpath, dstpath, type) {
1825
+ let stats;
1826
+ try {
1827
+ stats = await fs2.lstat(dstpath);
1828
+ } catch {
1829
+ }
1830
+ if (stats && stats.isSymbolicLink()) {
1831
+ const [srcStat, dstStat] = await Promise.all([
1832
+ fs2.stat(srcpath),
1833
+ fs2.stat(dstpath)
1834
+ ]);
1835
+ if (areIdentical(srcStat, dstStat)) return;
1836
+ }
1837
+ const relative = await symlinkPaths(srcpath, dstpath);
1838
+ srcpath = relative.toDst;
1839
+ const toType = await symlinkType(relative.toCwd, type);
1840
+ const dir = path2.dirname(dstpath);
1841
+ if (!await pathExists(dir)) {
1842
+ await mkdirs(dir);
1843
+ }
1844
+ return fs2.symlink(srcpath, dstpath, toType);
1845
+ }
1846
+ function createSymlinkSync(srcpath, dstpath, type) {
1847
+ let stats;
1848
+ try {
1849
+ stats = fs2.lstatSync(dstpath);
1850
+ } catch {
1851
+ }
1852
+ if (stats && stats.isSymbolicLink()) {
1853
+ const srcStat = fs2.statSync(srcpath);
1854
+ const dstStat = fs2.statSync(dstpath);
1855
+ if (areIdentical(srcStat, dstStat)) return;
1856
+ }
1857
+ const relative = symlinkPathsSync(srcpath, dstpath);
1858
+ srcpath = relative.toDst;
1859
+ type = symlinkTypeSync(relative.toCwd, type);
1860
+ const dir = path2.dirname(dstpath);
1861
+ const exists = fs2.existsSync(dir);
1862
+ if (exists) return fs2.symlinkSync(srcpath, dstpath, type);
1863
+ mkdirsSync(dir);
1864
+ return fs2.symlinkSync(srcpath, dstpath, type);
1865
+ }
1866
+ module2.exports = {
1867
+ createSymlink: u(createSymlink),
1868
+ createSymlinkSync
1869
+ };
1870
+ }
1871
+ });
1872
+
1873
+ // node_modules/fs-extra/lib/ensure/index.js
1874
+ var require_ensure = __commonJS({
1875
+ "node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) {
1876
+ "use strict";
1877
+ var { createFile, createFileSync } = require_file();
1878
+ var { createLink, createLinkSync } = require_link();
1879
+ var { createSymlink, createSymlinkSync } = require_symlink();
1880
+ module2.exports = {
1881
+ // file
1882
+ createFile,
1883
+ createFileSync,
1884
+ ensureFile: createFile,
1885
+ ensureFileSync: createFileSync,
1886
+ // link
1887
+ createLink,
1888
+ createLinkSync,
1889
+ ensureLink: createLink,
1890
+ ensureLinkSync: createLinkSync,
1891
+ // symlink
1892
+ createSymlink,
1893
+ createSymlinkSync,
1894
+ ensureSymlink: createSymlink,
1895
+ ensureSymlinkSync: createSymlinkSync
1896
+ };
1897
+ }
1898
+ });
1899
+
1900
+ // node_modules/jsonfile/utils.js
1901
+ var require_utils2 = __commonJS({
1902
+ "node_modules/jsonfile/utils.js"(exports2, module2) {
1903
+ function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
1904
+ const EOF = finalEOL ? EOL : "";
1905
+ const str = JSON.stringify(obj, replacer, spaces);
1906
+ return str.replace(/\n/g, EOL) + EOF;
1907
+ }
1908
+ function stripBom(content) {
1909
+ if (Buffer.isBuffer(content)) content = content.toString("utf8");
1910
+ return content.replace(/^\uFEFF/, "");
1911
+ }
1912
+ module2.exports = { stringify, stripBom };
1913
+ }
1914
+ });
1915
+
1916
+ // node_modules/jsonfile/index.js
1917
+ var require_jsonfile = __commonJS({
1918
+ "node_modules/jsonfile/index.js"(exports2, module2) {
1919
+ var _fs;
1920
+ try {
1921
+ _fs = require_graceful_fs();
1922
+ } catch (_) {
1923
+ _fs = require("fs");
1924
+ }
1925
+ var universalify = require_universalify();
1926
+ var { stringify, stripBom } = require_utils2();
1927
+ async function _readFile(file, options = {}) {
1928
+ if (typeof options === "string") {
1929
+ options = { encoding: options };
1930
+ }
1931
+ const fs2 = options.fs || _fs;
1932
+ const shouldThrow = "throws" in options ? options.throws : true;
1933
+ let data = await universalify.fromCallback(fs2.readFile)(file, options);
1934
+ data = stripBom(data);
1935
+ let obj;
1936
+ try {
1937
+ obj = JSON.parse(data, options ? options.reviver : null);
1938
+ } catch (err) {
1939
+ if (shouldThrow) {
1940
+ err.message = `${file}: ${err.message}`;
1941
+ throw err;
1942
+ } else {
1943
+ return null;
1944
+ }
1945
+ }
1946
+ return obj;
1947
+ }
1948
+ var readFile = universalify.fromPromise(_readFile);
1949
+ function readFileSync(file, options = {}) {
1950
+ if (typeof options === "string") {
1951
+ options = { encoding: options };
1952
+ }
1953
+ const fs2 = options.fs || _fs;
1954
+ const shouldThrow = "throws" in options ? options.throws : true;
1955
+ try {
1956
+ let content = fs2.readFileSync(file, options);
1957
+ content = stripBom(content);
1958
+ return JSON.parse(content, options.reviver);
1959
+ } catch (err) {
1960
+ if (shouldThrow) {
1961
+ err.message = `${file}: ${err.message}`;
1962
+ throw err;
1963
+ } else {
1964
+ return null;
1965
+ }
1966
+ }
1967
+ }
1968
+ async function _writeFile(file, obj, options = {}) {
1969
+ const fs2 = options.fs || _fs;
1970
+ const str = stringify(obj, options);
1971
+ await universalify.fromCallback(fs2.writeFile)(file, str, options);
1972
+ }
1973
+ var writeFile = universalify.fromPromise(_writeFile);
1974
+ function writeFileSync(file, obj, options = {}) {
1975
+ const fs2 = options.fs || _fs;
1976
+ const str = stringify(obj, options);
1977
+ return fs2.writeFileSync(file, str, options);
1978
+ }
1979
+ module2.exports = {
1980
+ readFile,
1981
+ readFileSync,
1982
+ writeFile,
1983
+ writeFileSync
1984
+ };
1985
+ }
1986
+ });
1987
+
1988
+ // node_modules/fs-extra/lib/json/jsonfile.js
1989
+ var require_jsonfile2 = __commonJS({
1990
+ "node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) {
1991
+ "use strict";
1992
+ var jsonFile = require_jsonfile();
1993
+ module2.exports = {
1994
+ // jsonfile exports
1995
+ readJson: jsonFile.readFile,
1996
+ readJsonSync: jsonFile.readFileSync,
1997
+ writeJson: jsonFile.writeFile,
1998
+ writeJsonSync: jsonFile.writeFileSync
1999
+ };
2000
+ }
2001
+ });
2002
+
2003
+ // node_modules/fs-extra/lib/output-file/index.js
2004
+ var require_output_file = __commonJS({
2005
+ "node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
2006
+ "use strict";
2007
+ var u = require_universalify().fromPromise;
2008
+ var fs2 = require_fs();
2009
+ var path2 = require("path");
2010
+ var mkdir = require_mkdirs();
2011
+ var pathExists = require_path_exists().pathExists;
2012
+ async function outputFile(file, data, encoding = "utf-8") {
2013
+ const dir = path2.dirname(file);
2014
+ if (!await pathExists(dir)) {
2015
+ await mkdir.mkdirs(dir);
2016
+ }
2017
+ return fs2.writeFile(file, data, encoding);
2018
+ }
2019
+ function outputFileSync(file, ...args) {
2020
+ const dir = path2.dirname(file);
2021
+ if (!fs2.existsSync(dir)) {
2022
+ mkdir.mkdirsSync(dir);
2023
+ }
2024
+ fs2.writeFileSync(file, ...args);
2025
+ }
2026
+ module2.exports = {
2027
+ outputFile: u(outputFile),
2028
+ outputFileSync
2029
+ };
2030
+ }
2031
+ });
2032
+
2033
+ // node_modules/fs-extra/lib/json/output-json.js
2034
+ var require_output_json = __commonJS({
2035
+ "node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) {
2036
+ "use strict";
2037
+ var { stringify } = require_utils2();
2038
+ var { outputFile } = require_output_file();
2039
+ async function outputJson(file, data, options = {}) {
2040
+ const str = stringify(data, options);
2041
+ await outputFile(file, str, options);
2042
+ }
2043
+ module2.exports = outputJson;
2044
+ }
2045
+ });
2046
+
2047
+ // node_modules/fs-extra/lib/json/output-json-sync.js
2048
+ var require_output_json_sync = __commonJS({
2049
+ "node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) {
2050
+ "use strict";
2051
+ var { stringify } = require_utils2();
2052
+ var { outputFileSync } = require_output_file();
2053
+ function outputJsonSync(file, data, options) {
2054
+ const str = stringify(data, options);
2055
+ outputFileSync(file, str, options);
2056
+ }
2057
+ module2.exports = outputJsonSync;
2058
+ }
2059
+ });
2060
+
2061
+ // node_modules/fs-extra/lib/json/index.js
2062
+ var require_json = __commonJS({
2063
+ "node_modules/fs-extra/lib/json/index.js"(exports2, module2) {
2064
+ "use strict";
2065
+ var u = require_universalify().fromPromise;
2066
+ var jsonFile = require_jsonfile2();
2067
+ jsonFile.outputJson = u(require_output_json());
2068
+ jsonFile.outputJsonSync = require_output_json_sync();
2069
+ jsonFile.outputJSON = jsonFile.outputJson;
2070
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync;
2071
+ jsonFile.writeJSON = jsonFile.writeJson;
2072
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync;
2073
+ jsonFile.readJSON = jsonFile.readJson;
2074
+ jsonFile.readJSONSync = jsonFile.readJsonSync;
2075
+ module2.exports = jsonFile;
2076
+ }
2077
+ });
2078
+
2079
+ // node_modules/fs-extra/lib/move/move.js
2080
+ var require_move = __commonJS({
2081
+ "node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
2082
+ "use strict";
2083
+ var fs2 = require_fs();
2084
+ var path2 = require("path");
2085
+ var { copy } = require_copy2();
2086
+ var { remove } = require_remove();
2087
+ var { mkdirp } = require_mkdirs();
2088
+ var { pathExists } = require_path_exists();
2089
+ var stat = require_stat();
2090
+ async function move(src, dest, opts = {}) {
2091
+ const overwrite = opts.overwrite || opts.clobber || false;
2092
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2093
+ await stat.checkParentPaths(src, srcStat, dest, "move");
2094
+ const destParent = path2.dirname(dest);
2095
+ const parsedParentPath = path2.parse(destParent);
2096
+ if (parsedParentPath.root !== destParent) {
2097
+ await mkdirp(destParent);
2098
+ }
2099
+ return doRename(src, dest, overwrite, isChangingCase);
2100
+ }
2101
+ async function doRename(src, dest, overwrite, isChangingCase) {
2102
+ if (!isChangingCase) {
2103
+ if (overwrite) {
2104
+ await remove(dest);
2105
+ } else if (await pathExists(dest)) {
2106
+ throw new Error("dest already exists.");
2107
+ }
2108
+ }
2109
+ try {
2110
+ await fs2.rename(src, dest);
2111
+ } catch (err) {
2112
+ if (err.code !== "EXDEV") {
2113
+ throw err;
2114
+ }
2115
+ await moveAcrossDevice(src, dest, overwrite);
2116
+ }
2117
+ }
2118
+ async function moveAcrossDevice(src, dest, overwrite) {
2119
+ const opts = {
2120
+ overwrite,
2121
+ errorOnExist: true,
2122
+ preserveTimestamps: true
2123
+ };
2124
+ await copy(src, dest, opts);
2125
+ return remove(src);
2126
+ }
2127
+ module2.exports = move;
2128
+ }
2129
+ });
2130
+
2131
+ // node_modules/fs-extra/lib/move/move-sync.js
2132
+ var require_move_sync = __commonJS({
2133
+ "node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
2134
+ "use strict";
2135
+ var fs2 = require_graceful_fs();
2136
+ var path2 = require("path");
2137
+ var copySync = require_copy2().copySync;
2138
+ var removeSync = require_remove().removeSync;
2139
+ var mkdirpSync = require_mkdirs().mkdirpSync;
2140
+ var stat = require_stat();
2141
+ function moveSync(src, dest, opts) {
2142
+ opts = opts || {};
2143
+ const overwrite = opts.overwrite || opts.clobber || false;
2144
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2145
+ stat.checkParentPathsSync(src, srcStat, dest, "move");
2146
+ if (!isParentRoot(dest)) mkdirpSync(path2.dirname(dest));
2147
+ return doRename(src, dest, overwrite, isChangingCase);
2148
+ }
2149
+ function isParentRoot(dest) {
2150
+ const parent = path2.dirname(dest);
2151
+ const parsedPath = path2.parse(parent);
2152
+ return parsedPath.root === parent;
2153
+ }
2154
+ function doRename(src, dest, overwrite, isChangingCase) {
2155
+ if (isChangingCase) return rename(src, dest, overwrite);
2156
+ if (overwrite) {
2157
+ removeSync(dest);
2158
+ return rename(src, dest, overwrite);
2159
+ }
2160
+ if (fs2.existsSync(dest)) throw new Error("dest already exists.");
2161
+ return rename(src, dest, overwrite);
2162
+ }
2163
+ function rename(src, dest, overwrite) {
2164
+ try {
2165
+ fs2.renameSync(src, dest);
2166
+ } catch (err) {
2167
+ if (err.code !== "EXDEV") throw err;
2168
+ return moveAcrossDevice(src, dest, overwrite);
2169
+ }
2170
+ }
2171
+ function moveAcrossDevice(src, dest, overwrite) {
2172
+ const opts = {
2173
+ overwrite,
2174
+ errorOnExist: true,
2175
+ preserveTimestamps: true
2176
+ };
2177
+ copySync(src, dest, opts);
2178
+ return removeSync(src);
2179
+ }
2180
+ module2.exports = moveSync;
2181
+ }
2182
+ });
2183
+
2184
+ // node_modules/fs-extra/lib/move/index.js
2185
+ var require_move2 = __commonJS({
2186
+ "node_modules/fs-extra/lib/move/index.js"(exports2, module2) {
2187
+ "use strict";
2188
+ var u = require_universalify().fromPromise;
2189
+ module2.exports = {
2190
+ move: u(require_move()),
2191
+ moveSync: require_move_sync()
2192
+ };
2193
+ }
2194
+ });
2195
+
2196
+ // node_modules/fs-extra/lib/index.js
2197
+ var require_lib = __commonJS({
2198
+ "node_modules/fs-extra/lib/index.js"(exports2, module2) {
2199
+ "use strict";
2200
+ module2.exports = {
2201
+ // Export promiseified graceful-fs:
2202
+ ...require_fs(),
2203
+ // Export extra methods:
2204
+ ...require_copy2(),
2205
+ ...require_empty(),
2206
+ ...require_ensure(),
2207
+ ...require_json(),
2208
+ ...require_mkdirs(),
2209
+ ...require_move2(),
2210
+ ...require_output_file(),
2211
+ ...require_path_exists(),
2212
+ ...require_remove()
2213
+ };
2214
+ }
2215
+ });
2216
+
2217
+ // node_modules/color-name-lib/index.js
2218
+ var require_color_name_lib = __commonJS({
2219
+ "node_modules/color-name-lib/index.js"(exports2, module2) {
2220
+ var fs2 = require_lib();
2221
+ var path2 = require("path");
2222
+ var colorDataCache = {};
2223
+ function toRgb(color) {
2224
+ if (typeof color === "string") {
2225
+ const hex2 = color.startsWith("#") ? color.slice(1) : color;
2226
+ if (hex2.length !== 6 || !/^[0-9A-Fa-f]{6}$/.test(hex2)) {
2227
+ throw new Error(`Invalid color format: ${color}`);
2228
+ }
2229
+ const bigint = parseInt(hex2, 16);
2230
+ return {
2231
+ r: bigint >> 16 & 255,
2232
+ g: bigint >> 8 & 255,
2233
+ b: bigint & 255
2234
+ };
2235
+ }
2236
+ if (Array.isArray(color) && color.length === 3 && color.every((c) => Number.isInteger(c) && c >= 0 && c <= 255)) {
2237
+ return { r: color[0], g: color[1], b: color[2] };
2238
+ }
2239
+ if (typeof color === "object" && color !== null && Number.isInteger(color.r) && color.r >= 0 && color.r <= 255 && Number.isInteger(color.g) && color.g >= 0 && color.g <= 255 && Number.isInteger(color.b) && color.b >= 0 && color.b <= 255) {
2240
+ return color;
2241
+ }
2242
+ throw new Error(`Invalid color format: ${color}`);
2243
+ }
2244
+ function colorDistance(color1, color2) {
2245
+ const rMean = (color1.r + color2.r) / 2;
2246
+ const rDiff = color1.r - color2.r;
2247
+ const gDiff = color1.g - color2.g;
2248
+ const bDiff = color1.b - color2.b;
2249
+ return Math.sqrt(
2250
+ (2 + rMean / 256) * rDiff ** 2 + 4 * gDiff ** 2 + (2 + (255 - rMean) / 256) * bDiff ** 2
2251
+ );
2252
+ }
2253
+ function getClosestColor(color, language) {
2254
+ if (!colorDataCache[language]) {
2255
+ const filePath = path2.join(__dirname, `./data/${language}.json`);
2256
+ if (!fs2.existsSync(filePath)) {
2257
+ throw new Error(`Language data file not found: ${language}.json`);
2258
+ }
2259
+ colorDataCache[language] = fs2.readJsonSync(filePath);
2260
+ }
2261
+ const colors = colorDataCache[language];
2262
+ const targetColor = toRgb(color);
2263
+ let closestColor = null;
2264
+ let minDistance = Infinity;
2265
+ for (const [colorHex, colorName] of Object.entries(colors)) {
2266
+ const currentColor = toRgb(colorHex);
2267
+ const distance = colorDistance(targetColor, currentColor);
2268
+ if (distance < minDistance) {
2269
+ minDistance = distance;
2270
+ closestColor = colorName;
2271
+ }
2272
+ }
2273
+ return closestColor;
2274
+ }
2275
+ function name(color, language = "en") {
2276
+ if (!color) throw new Error("Color input is required.");
2277
+ const supportedLanguages = ["en", "ja", "cn"];
2278
+ if (!supportedLanguages.includes(language)) {
2279
+ throw new Error(`Unsupported language: ${language}`);
2280
+ }
2281
+ return getClosestColor(color, language);
2282
+ }
2283
+ module2.exports = name;
2284
+ }
2285
+ });
2286
+
2287
+ // node_modules/@randplus/color/src/word.js
2288
+ var require_word = __commonJS({
2289
+ "node_modules/@randplus/color/src/word.js"(exports2, module2) {
2290
+ var colorName = require_color_name_lib();
2291
+ function word(language = "en") {
2292
+ const langList = ["en", "ja", "cn"];
2293
+ if (!langList.includes(language)) throw new Error("invalid language.");
2294
+ const color = require_hex()();
2295
+ return colorName(color, language);
2296
+ }
2297
+ module2.exports = word;
2298
+ }
2299
+ });
2300
+
2301
+ // node_modules/@randplus/color/src/conv/cword.js
2302
+ var require_cword = __commonJS({
2303
+ "node_modules/@randplus/color/src/conv/cword.js"(exports2, module2) {
2304
+ function convWord(options = {}) {
2305
+ if (typeof options !== "object") throw new Error("options must be object.");
2306
+ return require_word()(options.language);
2307
+ }
2308
+ module2.exports = convWord;
2309
+ }
2310
+ });
2311
+
2312
+ // require("./src/conv/c*") in node_modules/@randplus/color/index.js
2313
+ var globRequire_src_conv_c;
2314
+ var init_ = __esm({
2315
+ 'require("./src/conv/c*") in node_modules/@randplus/color/index.js'() {
2316
+ globRequire_src_conv_c = __glob({
2317
+ "./src/conv/chex.js": () => require_chex(),
2318
+ "./src/conv/crgb.js": () => require_crgb(),
2319
+ "./src/conv/cword.js": () => require_cword()
2320
+ });
2321
+ }
2322
+ });
2323
+
2324
+ // node_modules/@randplus/color/index.js
2325
+ var require_color = __commonJS({
2326
+ "node_modules/@randplus/color/index.js"(exports2, module2) {
2327
+ init_();
2328
+ function color(format = "hex", options = {}) {
2329
+ const type = ["hex", "rgb", "word"];
2330
+ if (!type.includes(format)) throw new Error("invalid format.");
2331
+ const content = `\`color()\` is deprecated. Please use \`color.${format}()\` instead.`;
2332
+ process.emitWarning(
2333
+ content,
2334
+ {
2335
+ code: "DeprecationWarning",
2336
+ detail: "This function may be deleted in the future."
2337
+ }
2338
+ );
2339
+ if (typeof options !== "object") throw new Error("options must be object.");
2340
+ return globRequire_src_conv_c(`./src/conv/c${format}`)(options);
2341
+ }
2342
+ module2.exports = color;
2343
+ module2.exports.hex = require_hex();
2344
+ module2.exports.rgb = require_rgb();
2345
+ module2.exports.word = require_word();
2346
+ }
2347
+ });
31
2348
 
32
2349
  // node_modules/tinycolor2/cjs/tinycolor.js
33
2350
  var require_tinycolor = __commonJS({
34
2351
  "node_modules/tinycolor2/cjs/tinycolor.js"(exports2, module2) {
35
- (function(global, factory) {
36
- typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.tinycolor = factory());
2352
+ (function(global2, factory) {
2353
+ typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.tinycolor = factory());
37
2354
  })(exports2, (function() {
38
2355
  "use strict";
39
2356
  function _typeof(obj) {
@@ -455,22 +2772,22 @@ var require_tinycolor = __commonJS({
455
2772
  };
456
2773
  }
457
2774
  function rgbToHex(r, g, b, allow3Char) {
458
- var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
459
- if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
460
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
2775
+ var hex2 = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
2776
+ if (allow3Char && hex2[0].charAt(0) == hex2[0].charAt(1) && hex2[1].charAt(0) == hex2[1].charAt(1) && hex2[2].charAt(0) == hex2[2].charAt(1)) {
2777
+ return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0);
461
2778
  }
462
- return hex.join("");
2779
+ return hex2.join("");
463
2780
  }
464
2781
  function rgbaToHex(r, g, b, a, allow4Char) {
465
- var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
466
- if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
467
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
2782
+ var hex2 = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
2783
+ if (allow4Char && hex2[0].charAt(0) == hex2[0].charAt(1) && hex2[1].charAt(0) == hex2[1].charAt(1) && hex2[2].charAt(0) == hex2[2].charAt(1) && hex2[3].charAt(0) == hex2[3].charAt(1)) {
2784
+ return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0) + hex2[3].charAt(0);
468
2785
  }
469
- return hex.join("");
2786
+ return hex2.join("");
470
2787
  }
471
2788
  function rgbaToArgbHex(r, g, b, a) {
472
- var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
473
- return hex.join("");
2789
+ var hex2 = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
2790
+ return hex2.join("");
474
2791
  }
475
2792
  tinycolor.equals = function(color1, color2) {
476
2793
  if (!color1 || !color2) return false;
@@ -1310,6 +3627,7 @@ __export(index_exports, {
1310
3627
  module.exports = __toCommonJS(index_exports);
1311
3628
  var import_fs = __toESM(require("fs"), 1);
1312
3629
  var import_path = __toESM(require("path"), 1);
3630
+ var import_color = __toESM(require_color(), 1);
1313
3631
 
1314
3632
  // node_modules/chalk/source/vendor/ansi-styles/index.js
1315
3633
  var ANSI_BACKGROUND_OFFSET = 10;
@@ -1425,8 +3743,8 @@ function assembleStyles() {
1425
3743
  enumerable: false
1426
3744
  },
1427
3745
  hexToRgb: {
1428
- value(hex) {
1429
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
3746
+ value(hex2) {
3747
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex2.toString(16));
1430
3748
  if (!matches) {
1431
3749
  return [0, 0, 0];
1432
3750
  }
@@ -1446,7 +3764,7 @@ function assembleStyles() {
1446
3764
  enumerable: false
1447
3765
  },
1448
3766
  hexToAnsi256: {
1449
- value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
3767
+ value: (hex2) => styles.rgbToAnsi256(...styles.hexToRgb(hex2)),
1450
3768
  enumerable: false
1451
3769
  },
1452
3770
  ansi256ToAnsi: {
@@ -1488,7 +3806,7 @@ function assembleStyles() {
1488
3806
  enumerable: false
1489
3807
  },
1490
3808
  hexToAnsi: {
1491
- value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
3809
+ value: (hex2) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex2)),
1492
3810
  enumerable: false
1493
3811
  }
1494
3812
  });
@@ -1923,10 +4241,6 @@ gradient.rainbow = rainbow;
1923
4241
  gradient.pastel = pastel;
1924
4242
 
1925
4243
  // index.js
1926
- function getRandomHexColor() {
1927
- const randomColor = Math.floor(Math.random() * 16777216).toString(16);
1928
- return `#${randomColor.padStart(6, "0")}`;
1929
- }
1930
4244
  var aaDir = import_path.default.join(__dirname, "aa");
1931
4245
  function nekos(options = {}) {
1932
4246
  const { id } = options;
@@ -1966,13 +4280,13 @@ function nekos(options = {}) {
1966
4280
  if (upperCaseColor === "RAINBOW") {
1967
4281
  processedColors = rainbowColors;
1968
4282
  } else if (upperCaseColor === "RANDOM") {
1969
- processedColors = [getRandomHexColor()];
4283
+ processedColors = [(0, import_color.hex)("#")];
1970
4284
  } else {
1971
4285
  processedColors = [colors];
1972
4286
  }
1973
4287
  } else if (Array.isArray(colors)) {
1974
4288
  processedColors = colors.map(
1975
- (color) => typeof color === "string" && color.toUpperCase() === "RANDOM" ? getRandomHexColor() : color
4289
+ (color) => typeof color === "string" && color.toUpperCase() === "RANDOM" ? (0, import_color.hex)("#") : color
1976
4290
  );
1977
4291
  } else {
1978
4292
  processedColors = colors;