keycloakify 11.6.2 → 11.7.0

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 (69) hide show
  1. package/bin/{735.index.js → 288.index.js} +226 -360
  2. package/bin/313.index.js +377 -0
  3. package/bin/{174.index.js → 33.index.js} +37 -2
  4. package/bin/{840.index.js → 355.index.js} +348 -97
  5. package/bin/363.index.js +153 -144
  6. package/bin/453.index.js +5 -41
  7. package/bin/{503.index.js → 678.index.js} +577 -53
  8. package/bin/{921.index.js → 780.index.js} +54 -45
  9. package/bin/880.index.js +206 -21
  10. package/bin/9.index.js +850 -0
  11. package/bin/{525.index.js → 911.index.js} +1302 -2
  12. package/bin/930.index.js +3 -4
  13. package/bin/{153.index.js → 947.index.js} +22 -797
  14. package/bin/main.js +6 -6
  15. package/bin/shared/initializeSpa/index.d.ts +1 -0
  16. package/bin/shared/initializeSpa/initializeSpa.d.ts +9 -0
  17. package/bin/tools/getInstalledModuleDirPath.d.ts +0 -1
  18. package/bin/tools/isRootPath.d.ts +1 -0
  19. package/bin/tools/listInstalledModules.d.ts +0 -1
  20. package/package.json +22 -44
  21. package/src/bin/eject-page.ts +7 -81
  22. package/src/bin/initialize-account-theme/initialize-account-theme.ts +15 -14
  23. package/src/bin/initialize-admin-theme.ts +17 -124
  24. package/src/bin/initialize-email-theme.ts +10 -34
  25. package/src/bin/keycloakify/generateResources/generateResources.ts +49 -21
  26. package/src/bin/own.ts +1 -2
  27. package/src/bin/shared/{addSyncExtensionsToPostinstallScript.ts → initializeSpa/addSyncExtensionsToPostinstallScript.ts} +2 -2
  28. package/src/bin/shared/initializeSpa/index.ts +1 -0
  29. package/src/bin/shared/initializeSpa/initializeSpa.ts +149 -0
  30. package/src/bin/sync-extensions/extensionModuleMeta.ts +0 -1
  31. package/src/bin/tools/getInstalledModuleDirPath.ts +24 -22
  32. package/src/bin/tools/isRootPath.ts +22 -0
  33. package/src/bin/tools/listInstalledModules.ts +2 -4
  34. package/src/bin/tsconfig.json +1 -1
  35. package/bin/375.index.js +0 -4089
  36. package/bin/490.index.js +0 -1108
  37. package/bin/568.index.js +0 -1867
  38. package/bin/743.index.js +0 -69
  39. package/bin/initialize-account-theme/copyBoilerplate.d.ts +0 -4
  40. package/bin/initialize-account-theme/initializeAccountTheme_multiPage.d.ts +0 -3
  41. package/bin/initialize-account-theme/initializeAccountTheme_singlePage.d.ts +0 -11
  42. package/bin/shared/getLatestsSemVersionedTag.d.ts +0 -15
  43. package/bin/shared/promptKeycloakVersion.d.ts +0 -10
  44. package/bin/tools/OptionalIfCanBeUndefined.d.ts +0 -14
  45. package/bin/tools/crc32.d.ts +0 -9
  46. package/bin/tools/deflate.d.ts +0 -24
  47. package/bin/tools/octokit-addons/getLatestsSemVersionedTag.d.ts +0 -15
  48. package/bin/tools/octokit-addons/listTags.d.ts +0 -13
  49. package/bin/tools/tee.d.ts +0 -3
  50. package/bin/tools/trimIndent.d.ts +0 -5
  51. package/src/bin/initialize-account-theme/copyBoilerplate.ts +0 -32
  52. package/src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts +0 -21
  53. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +0 -142
  54. package/src/bin/initialize-account-theme/src/single-page/KcContext.ts +0 -7
  55. package/src/bin/initialize-account-theme/src/single-page/KcPage.tsx +0 -11
  56. package/src/bin/shared/getLatestsSemVersionedTag.ts +0 -201
  57. package/src/bin/shared/promptKeycloakVersion.ts +0 -72
  58. package/src/bin/tools/OptionalIfCanBeUndefined.ts +0 -12
  59. package/src/bin/tools/crc32.ts +0 -73
  60. package/src/bin/tools/deflate.ts +0 -61
  61. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +0 -47
  62. package/src/bin/tools/octokit-addons/listTags.ts +0 -60
  63. package/src/bin/tools/tee.ts +0 -39
  64. package/src/bin/tools/trimIndent.ts +0 -49
  65. /package/bin/shared/{addSyncExtensionsToPostinstallScript.d.ts → initializeSpa/addSyncExtensionsToPostinstallScript.d.ts} +0 -0
  66. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcContext.ts +0 -0
  67. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPage.tsx +0 -0
  68. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPageStory.tsx +0 -0
  69. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/i18n.ts +0 -0
@@ -1,5 +1,5 @@
1
- exports.id = 525;
2
- exports.ids = [525];
1
+ exports.id = 911;
2
+ exports.ids = [911];
3
3
  exports.modules = {
4
4
 
5
5
  /***/ 91573:
@@ -10432,6 +10432,124 @@ try {throw new Error(); } catch (e) {ret.lastLineError = e;}
10432
10432
  module.exports = ret;
10433
10433
 
10434
10434
 
10435
+ /***/ }),
10436
+
10437
+ /***/ 34024:
10438
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10439
+
10440
+ var Buffer = (__webpack_require__(14300).Buffer);
10441
+
10442
+ var CRC_TABLE = [
10443
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
10444
+ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
10445
+ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
10446
+ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
10447
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
10448
+ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
10449
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
10450
+ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
10451
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
10452
+ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
10453
+ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
10454
+ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
10455
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
10456
+ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
10457
+ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
10458
+ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
10459
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
10460
+ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
10461
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
10462
+ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
10463
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
10464
+ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
10465
+ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
10466
+ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
10467
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
10468
+ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
10469
+ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
10470
+ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
10471
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
10472
+ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
10473
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
10474
+ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
10475
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
10476
+ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
10477
+ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
10478
+ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
10479
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
10480
+ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
10481
+ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
10482
+ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
10483
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
10484
+ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
10485
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
10486
+ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
10487
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
10488
+ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
10489
+ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
10490
+ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
10491
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
10492
+ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
10493
+ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
10494
+ 0x2d02ef8d
10495
+ ];
10496
+
10497
+ if (typeof Int32Array !== 'undefined') {
10498
+ CRC_TABLE = new Int32Array(CRC_TABLE);
10499
+ }
10500
+
10501
+ function ensureBuffer(input) {
10502
+ if (Buffer.isBuffer(input)) {
10503
+ return input;
10504
+ }
10505
+
10506
+ var hasNewBufferAPI =
10507
+ typeof Buffer.alloc === "function" &&
10508
+ typeof Buffer.from === "function";
10509
+
10510
+ if (typeof input === "number") {
10511
+ return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input);
10512
+ }
10513
+ else if (typeof input === "string") {
10514
+ return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input);
10515
+ }
10516
+ else {
10517
+ throw new Error("input must be buffer, number, or string, received " +
10518
+ typeof input);
10519
+ }
10520
+ }
10521
+
10522
+ function bufferizeInt(num) {
10523
+ var tmp = ensureBuffer(4);
10524
+ tmp.writeInt32BE(num, 0);
10525
+ return tmp;
10526
+ }
10527
+
10528
+ function _crc32(buf, previous) {
10529
+ buf = ensureBuffer(buf);
10530
+ if (Buffer.isBuffer(previous)) {
10531
+ previous = previous.readUInt32BE(0);
10532
+ }
10533
+ var crc = ~~previous ^ -1;
10534
+ for (var n = 0; n < buf.length; n++) {
10535
+ crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8);
10536
+ }
10537
+ return (crc ^ -1);
10538
+ }
10539
+
10540
+ function crc32() {
10541
+ return bufferizeInt(_crc32.apply(null, arguments));
10542
+ }
10543
+ crc32.signed = function () {
10544
+ return _crc32.apply(null, arguments);
10545
+ };
10546
+ crc32.unsigned = function () {
10547
+ return _crc32.apply(null, arguments) >>> 0;
10548
+ };
10549
+
10550
+ module.exports = crc32;
10551
+
10552
+
10435
10553
  /***/ }),
10436
10554
 
10437
10555
  /***/ 83491:
@@ -18134,6 +18252,309 @@ function createError(err, code, props) {
18134
18252
  module.exports = createError;
18135
18253
 
18136
18254
 
18255
+ /***/ }),
18256
+
18257
+ /***/ 65010:
18258
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
18259
+
18260
+ var fs = __webpack_require__(57147);
18261
+ var util = __webpack_require__(73837);
18262
+ var stream = __webpack_require__(12781);
18263
+ var Readable = stream.Readable;
18264
+ var Writable = stream.Writable;
18265
+ var PassThrough = stream.PassThrough;
18266
+ var Pend = __webpack_require__(54833);
18267
+ var EventEmitter = (__webpack_require__(82361).EventEmitter);
18268
+
18269
+ exports.createFromBuffer = createFromBuffer;
18270
+ exports.createFromFd = createFromFd;
18271
+ exports.BufferSlicer = BufferSlicer;
18272
+ exports.FdSlicer = FdSlicer;
18273
+
18274
+ util.inherits(FdSlicer, EventEmitter);
18275
+ function FdSlicer(fd, options) {
18276
+ options = options || {};
18277
+ EventEmitter.call(this);
18278
+
18279
+ this.fd = fd;
18280
+ this.pend = new Pend();
18281
+ this.pend.max = 1;
18282
+ this.refCount = 0;
18283
+ this.autoClose = !!options.autoClose;
18284
+ }
18285
+
18286
+ FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
18287
+ var self = this;
18288
+ self.pend.go(function(cb) {
18289
+ fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
18290
+ cb();
18291
+ callback(err, bytesRead, buffer);
18292
+ });
18293
+ });
18294
+ };
18295
+
18296
+ FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
18297
+ var self = this;
18298
+ self.pend.go(function(cb) {
18299
+ fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
18300
+ cb();
18301
+ callback(err, written, buffer);
18302
+ });
18303
+ });
18304
+ };
18305
+
18306
+ FdSlicer.prototype.createReadStream = function(options) {
18307
+ return new ReadStream(this, options);
18308
+ };
18309
+
18310
+ FdSlicer.prototype.createWriteStream = function(options) {
18311
+ return new WriteStream(this, options);
18312
+ };
18313
+
18314
+ FdSlicer.prototype.ref = function() {
18315
+ this.refCount += 1;
18316
+ };
18317
+
18318
+ FdSlicer.prototype.unref = function() {
18319
+ var self = this;
18320
+ self.refCount -= 1;
18321
+
18322
+ if (self.refCount > 0) return;
18323
+ if (self.refCount < 0) throw new Error("invalid unref");
18324
+
18325
+ if (self.autoClose) {
18326
+ fs.close(self.fd, onCloseDone);
18327
+ }
18328
+
18329
+ function onCloseDone(err) {
18330
+ if (err) {
18331
+ self.emit('error', err);
18332
+ } else {
18333
+ self.emit('close');
18334
+ }
18335
+ }
18336
+ };
18337
+
18338
+ util.inherits(ReadStream, Readable);
18339
+ function ReadStream(context, options) {
18340
+ options = options || {};
18341
+ Readable.call(this, options);
18342
+
18343
+ this.context = context;
18344
+ this.context.ref();
18345
+
18346
+ this.start = options.start || 0;
18347
+ this.endOffset = options.end;
18348
+ this.pos = this.start;
18349
+ this.destroyed = false;
18350
+ }
18351
+
18352
+ ReadStream.prototype._read = function(n) {
18353
+ var self = this;
18354
+ if (self.destroyed) return;
18355
+
18356
+ var toRead = Math.min(self._readableState.highWaterMark, n);
18357
+ if (self.endOffset != null) {
18358
+ toRead = Math.min(toRead, self.endOffset - self.pos);
18359
+ }
18360
+ if (toRead <= 0) {
18361
+ self.destroyed = true;
18362
+ self.push(null);
18363
+ self.context.unref();
18364
+ return;
18365
+ }
18366
+ self.context.pend.go(function(cb) {
18367
+ if (self.destroyed) return cb();
18368
+ var buffer = Buffer.allocUnsafe ? Buffer.allocUnsafe(toRead) : new Buffer(toRead);
18369
+ fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
18370
+ if (err) {
18371
+ self.destroy(err);
18372
+ } else if (bytesRead === 0) {
18373
+ self.destroyed = true;
18374
+ self.push(null);
18375
+ self.context.unref();
18376
+ } else {
18377
+ self.pos += bytesRead;
18378
+ self.push(buffer.slice(0, bytesRead));
18379
+ }
18380
+ cb();
18381
+ });
18382
+ });
18383
+ };
18384
+
18385
+ ReadStream.prototype.destroy = function(err) {
18386
+ if (this.destroyed) return;
18387
+ err = err || new Error("stream destroyed");
18388
+ this.destroyed = true;
18389
+ this.emit('error', err);
18390
+ this.context.unref();
18391
+ };
18392
+
18393
+ util.inherits(WriteStream, Writable);
18394
+ function WriteStream(context, options) {
18395
+ options = options || {};
18396
+ Writable.call(this, options);
18397
+
18398
+ this.context = context;
18399
+ this.context.ref();
18400
+
18401
+ this.start = options.start || 0;
18402
+ this.endOffset = (options.end == null) ? Infinity : +options.end;
18403
+ this.bytesWritten = 0;
18404
+ this.pos = this.start;
18405
+ this.destroyed = false;
18406
+
18407
+ this.on('finish', this.destroy.bind(this));
18408
+ }
18409
+
18410
+ WriteStream.prototype._write = function(buffer, encoding, callback) {
18411
+ var self = this;
18412
+ if (self.destroyed) return;
18413
+
18414
+ if (self.pos + buffer.length > self.endOffset) {
18415
+ var err = new Error("maximum file length exceeded");
18416
+ err.code = 'ETOOBIG';
18417
+ self.destroy();
18418
+ callback(err);
18419
+ return;
18420
+ }
18421
+ self.context.pend.go(function(cb) {
18422
+ if (self.destroyed) return cb();
18423
+ fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
18424
+ if (err) {
18425
+ self.destroy();
18426
+ cb();
18427
+ callback(err);
18428
+ } else {
18429
+ self.bytesWritten += bytes;
18430
+ self.pos += bytes;
18431
+ self.emit('progress');
18432
+ cb();
18433
+ callback();
18434
+ }
18435
+ });
18436
+ });
18437
+ };
18438
+
18439
+ WriteStream.prototype.destroy = function() {
18440
+ if (this.destroyed) return;
18441
+ this.destroyed = true;
18442
+ this.context.unref();
18443
+ };
18444
+
18445
+ util.inherits(BufferSlicer, EventEmitter);
18446
+ function BufferSlicer(buffer, options) {
18447
+ EventEmitter.call(this);
18448
+
18449
+ options = options || {};
18450
+ this.refCount = 0;
18451
+ this.buffer = buffer;
18452
+ this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;
18453
+ }
18454
+
18455
+ BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
18456
+ var end = position + length;
18457
+ var delta = end - this.buffer.length;
18458
+ var written = (delta > 0) ? delta : length;
18459
+ this.buffer.copy(buffer, offset, position, end);
18460
+ setImmediate(function() {
18461
+ callback(null, written);
18462
+ });
18463
+ };
18464
+
18465
+ BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) {
18466
+ buffer.copy(this.buffer, position, offset, offset + length);
18467
+ setImmediate(function() {
18468
+ callback(null, length, buffer);
18469
+ });
18470
+ };
18471
+
18472
+ BufferSlicer.prototype.createReadStream = function(options) {
18473
+ options = options || {};
18474
+ var readStream = new PassThrough(options);
18475
+ readStream.destroyed = false;
18476
+ readStream.start = options.start || 0;
18477
+ readStream.endOffset = options.end;
18478
+ // by the time this function returns, we'll be done.
18479
+ readStream.pos = readStream.endOffset || this.buffer.length;
18480
+
18481
+ // respect the maxChunkSize option to slice up the chunk into smaller pieces.
18482
+ var entireSlice = this.buffer.slice(readStream.start, readStream.pos);
18483
+ var offset = 0;
18484
+ while (true) {
18485
+ var nextOffset = offset + this.maxChunkSize;
18486
+ if (nextOffset >= entireSlice.length) {
18487
+ // last chunk
18488
+ if (offset < entireSlice.length) {
18489
+ readStream.write(entireSlice.slice(offset, entireSlice.length));
18490
+ }
18491
+ break;
18492
+ }
18493
+ readStream.write(entireSlice.slice(offset, nextOffset));
18494
+ offset = nextOffset;
18495
+ }
18496
+
18497
+ readStream.end();
18498
+ readStream.destroy = function() {
18499
+ readStream.destroyed = true;
18500
+ };
18501
+ return readStream;
18502
+ };
18503
+
18504
+ BufferSlicer.prototype.createWriteStream = function(options) {
18505
+ var bufferSlicer = this;
18506
+ options = options || {};
18507
+ var writeStream = new Writable(options);
18508
+ writeStream.start = options.start || 0;
18509
+ writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end;
18510
+ writeStream.bytesWritten = 0;
18511
+ writeStream.pos = writeStream.start;
18512
+ writeStream.destroyed = false;
18513
+ writeStream._write = function(buffer, encoding, callback) {
18514
+ if (writeStream.destroyed) return;
18515
+
18516
+ var end = writeStream.pos + buffer.length;
18517
+ if (end > writeStream.endOffset) {
18518
+ var err = new Error("maximum file length exceeded");
18519
+ err.code = 'ETOOBIG';
18520
+ writeStream.destroyed = true;
18521
+ callback(err);
18522
+ return;
18523
+ }
18524
+ buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length);
18525
+
18526
+ writeStream.bytesWritten += buffer.length;
18527
+ writeStream.pos = end;
18528
+ writeStream.emit('progress');
18529
+ callback();
18530
+ };
18531
+ writeStream.destroy = function() {
18532
+ writeStream.destroyed = true;
18533
+ };
18534
+ return writeStream;
18535
+ };
18536
+
18537
+ BufferSlicer.prototype.ref = function() {
18538
+ this.refCount += 1;
18539
+ };
18540
+
18541
+ BufferSlicer.prototype.unref = function() {
18542
+ this.refCount -= 1;
18543
+
18544
+ if (this.refCount < 0) {
18545
+ throw new Error("invalid unref");
18546
+ }
18547
+ };
18548
+
18549
+ function createFromBuffer(buffer, options) {
18550
+ return new BufferSlicer(buffer, options);
18551
+ }
18552
+
18553
+ function createFromFd(fd, options) {
18554
+ return new FdSlicer(fd, options);
18555
+ }
18556
+
18557
+
18137
18558
  /***/ }),
18138
18559
 
18139
18560
  /***/ 61002:
@@ -27740,6 +28161,68 @@ class Minipass extends Stream {
27740
28161
  exports.Minipass = Minipass
27741
28162
 
27742
28163
 
28164
+ /***/ }),
28165
+
28166
+ /***/ 54833:
28167
+ /***/ ((module) => {
28168
+
28169
+ module.exports = Pend;
28170
+
28171
+ function Pend() {
28172
+ this.pending = 0;
28173
+ this.max = Infinity;
28174
+ this.listeners = [];
28175
+ this.waiting = [];
28176
+ this.error = null;
28177
+ }
28178
+
28179
+ Pend.prototype.go = function(fn) {
28180
+ if (this.pending < this.max) {
28181
+ pendGo(this, fn);
28182
+ } else {
28183
+ this.waiting.push(fn);
28184
+ }
28185
+ };
28186
+
28187
+ Pend.prototype.wait = function(cb) {
28188
+ if (this.pending === 0) {
28189
+ cb(this.error);
28190
+ } else {
28191
+ this.listeners.push(cb);
28192
+ }
28193
+ };
28194
+
28195
+ Pend.prototype.hold = function() {
28196
+ return pendHold(this);
28197
+ };
28198
+
28199
+ function pendHold(self) {
28200
+ self.pending += 1;
28201
+ var called = false;
28202
+ return onCb;
28203
+ function onCb(err) {
28204
+ if (called) throw new Error("callback called twice");
28205
+ called = true;
28206
+ self.error = self.error || err;
28207
+ self.pending -= 1;
28208
+ if (self.waiting.length > 0 && self.pending < self.max) {
28209
+ pendGo(self, self.waiting.shift());
28210
+ } else if (self.pending === 0) {
28211
+ var listeners = self.listeners;
28212
+ self.listeners = [];
28213
+ listeners.forEach(cbListener);
28214
+ }
28215
+ }
28216
+ function cbListener(listener) {
28217
+ listener(self.error);
28218
+ }
28219
+ }
28220
+
28221
+ function pendGo(self, fn) {
28222
+ fn(pendHold(self));
28223
+ }
28224
+
28225
+
27743
28226
  /***/ }),
27744
28227
 
27745
28228
  /***/ 50439:
@@ -32678,6 +33161,809 @@ try {
32678
33161
  } catch (er) {}
32679
33162
 
32680
33163
 
33164
+ /***/ }),
33165
+
33166
+ /***/ 78781:
33167
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
33168
+
33169
+ var fs = __webpack_require__(57147);
33170
+ var zlib = __webpack_require__(59796);
33171
+ var fd_slicer = __webpack_require__(65010);
33172
+ var crc32 = __webpack_require__(34024);
33173
+ var util = __webpack_require__(73837);
33174
+ var EventEmitter = (__webpack_require__(82361).EventEmitter);
33175
+ var Transform = (__webpack_require__(12781).Transform);
33176
+ var PassThrough = (__webpack_require__(12781).PassThrough);
33177
+ var Writable = (__webpack_require__(12781).Writable);
33178
+
33179
+ exports.open = open;
33180
+ exports.fromFd = fromFd;
33181
+ exports.fromBuffer = fromBuffer;
33182
+ exports.fromRandomAccessReader = fromRandomAccessReader;
33183
+ exports.dosDateTimeToDate = dosDateTimeToDate;
33184
+ exports.validateFileName = validateFileName;
33185
+ exports.ZipFile = ZipFile;
33186
+ exports.Entry = Entry;
33187
+ exports.RandomAccessReader = RandomAccessReader;
33188
+
33189
+ function open(path, options, callback) {
33190
+ if (typeof options === "function") {
33191
+ callback = options;
33192
+ options = null;
33193
+ }
33194
+ if (options == null) options = {};
33195
+ if (options.autoClose == null) options.autoClose = true;
33196
+ if (options.lazyEntries == null) options.lazyEntries = false;
33197
+ if (options.decodeStrings == null) options.decodeStrings = true;
33198
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
33199
+ if (options.strictFileNames == null) options.strictFileNames = false;
33200
+ if (callback == null) callback = defaultCallback;
33201
+ fs.open(path, "r", function(err, fd) {
33202
+ if (err) return callback(err);
33203
+ fromFd(fd, options, function(err, zipfile) {
33204
+ if (err) fs.close(fd, defaultCallback);
33205
+ callback(err, zipfile);
33206
+ });
33207
+ });
33208
+ }
33209
+
33210
+ function fromFd(fd, options, callback) {
33211
+ if (typeof options === "function") {
33212
+ callback = options;
33213
+ options = null;
33214
+ }
33215
+ if (options == null) options = {};
33216
+ if (options.autoClose == null) options.autoClose = false;
33217
+ if (options.lazyEntries == null) options.lazyEntries = false;
33218
+ if (options.decodeStrings == null) options.decodeStrings = true;
33219
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
33220
+ if (options.strictFileNames == null) options.strictFileNames = false;
33221
+ if (callback == null) callback = defaultCallback;
33222
+ fs.fstat(fd, function(err, stats) {
33223
+ if (err) return callback(err);
33224
+ var reader = fd_slicer.createFromFd(fd, {autoClose: true});
33225
+ fromRandomAccessReader(reader, stats.size, options, callback);
33226
+ });
33227
+ }
33228
+
33229
+ function fromBuffer(buffer, options, callback) {
33230
+ if (typeof options === "function") {
33231
+ callback = options;
33232
+ options = null;
33233
+ }
33234
+ if (options == null) options = {};
33235
+ options.autoClose = false;
33236
+ if (options.lazyEntries == null) options.lazyEntries = false;
33237
+ if (options.decodeStrings == null) options.decodeStrings = true;
33238
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
33239
+ if (options.strictFileNames == null) options.strictFileNames = false;
33240
+ // limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87
33241
+ var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000});
33242
+ fromRandomAccessReader(reader, buffer.length, options, callback);
33243
+ }
33244
+
33245
+ function fromRandomAccessReader(reader, totalSize, options, callback) {
33246
+ if (typeof options === "function") {
33247
+ callback = options;
33248
+ options = null;
33249
+ }
33250
+ if (options == null) options = {};
33251
+ if (options.autoClose == null) options.autoClose = true;
33252
+ if (options.lazyEntries == null) options.lazyEntries = false;
33253
+ if (options.decodeStrings == null) options.decodeStrings = true;
33254
+ var decodeStrings = !!options.decodeStrings;
33255
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
33256
+ if (options.strictFileNames == null) options.strictFileNames = false;
33257
+ if (callback == null) callback = defaultCallback;
33258
+ if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number");
33259
+ if (totalSize > Number.MAX_SAFE_INTEGER) {
33260
+ throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
33261
+ }
33262
+
33263
+ // the matching unref() call is in zipfile.close()
33264
+ reader.ref();
33265
+
33266
+ // eocdr means End of Central Directory Record.
33267
+ // search backwards for the eocdr signature.
33268
+ // the last field of the eocdr is a variable-length comment.
33269
+ // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it.
33270
+ // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment.
33271
+ // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment.
33272
+ var eocdrWithoutCommentSize = 22;
33273
+ var maxCommentSize = 0xffff; // 2-byte size
33274
+ var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize);
33275
+ var buffer = newBuffer(bufferSize);
33276
+ var bufferReadStart = totalSize - buffer.length;
33277
+ readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {
33278
+ if (err) return callback(err);
33279
+ for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {
33280
+ if (buffer.readUInt32LE(i) !== 0x06054b50) continue;
33281
+ // found eocdr
33282
+ var eocdrBuffer = buffer.slice(i);
33283
+
33284
+ // 0 - End of central directory signature = 0x06054b50
33285
+ // 4 - Number of this disk
33286
+ var diskNumber = eocdrBuffer.readUInt16LE(4);
33287
+ if (diskNumber !== 0) {
33288
+ return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
33289
+ }
33290
+ // 6 - Disk where central directory starts
33291
+ // 8 - Number of central directory records on this disk
33292
+ // 10 - Total number of central directory records
33293
+ var entryCount = eocdrBuffer.readUInt16LE(10);
33294
+ // 12 - Size of central directory (bytes)
33295
+ // 16 - Offset of start of central directory, relative to start of archive
33296
+ var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
33297
+ // 20 - Comment length
33298
+ var commentLength = eocdrBuffer.readUInt16LE(20);
33299
+ var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
33300
+ if (commentLength !== expectedCommentLength) {
33301
+ return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength));
33302
+ }
33303
+ // 22 - Comment
33304
+ // the encoding is always cp437.
33305
+ var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false)
33306
+ : eocdrBuffer.slice(22);
33307
+
33308
+ if (!(entryCount === 0xffff || centralDirectoryOffset === 0xffffffff)) {
33309
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
33310
+ }
33311
+
33312
+ // ZIP64 format
33313
+
33314
+ // ZIP64 Zip64 end of central directory locator
33315
+ var zip64EocdlBuffer = newBuffer(20);
33316
+ var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length;
33317
+ readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err) {
33318
+ if (err) return callback(err);
33319
+
33320
+ // 0 - zip64 end of central dir locator signature = 0x07064b50
33321
+ if (zip64EocdlBuffer.readUInt32LE(0) !== 0x07064b50) {
33322
+ return callback(new Error("invalid zip64 end of central directory locator signature"));
33323
+ }
33324
+ // 4 - number of the disk with the start of the zip64 end of central directory
33325
+ // 8 - relative offset of the zip64 end of central directory record
33326
+ var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
33327
+ // 16 - total number of disks
33328
+
33329
+ // ZIP64 end of central directory record
33330
+ var zip64EocdrBuffer = newBuffer(56);
33331
+ readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) {
33332
+ if (err) return callback(err);
33333
+
33334
+ // 0 - zip64 end of central dir signature 4 bytes (0x06064b50)
33335
+ if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) {
33336
+ return callback(new Error("invalid zip64 end of central directory record signature"));
33337
+ }
33338
+ // 4 - size of zip64 end of central directory record 8 bytes
33339
+ // 12 - version made by 2 bytes
33340
+ // 14 - version needed to extract 2 bytes
33341
+ // 16 - number of this disk 4 bytes
33342
+ // 20 - number of the disk with the start of the central directory 4 bytes
33343
+ // 24 - total number of entries in the central directory on this disk 8 bytes
33344
+ // 32 - total number of entries in the central directory 8 bytes
33345
+ entryCount = readUInt64LE(zip64EocdrBuffer, 32);
33346
+ // 40 - size of the central directory 8 bytes
33347
+ // 48 - offset of start of central directory with respect to the starting disk number 8 bytes
33348
+ centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
33349
+ // 56 - zip64 extensible data sector (variable size)
33350
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
33351
+ });
33352
+ });
33353
+ return;
33354
+ }
33355
+ callback(new Error("end of central directory record signature not found"));
33356
+ });
33357
+ }
33358
+
33359
+ util.inherits(ZipFile, EventEmitter);
33360
+ function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
33361
+ var self = this;
33362
+ EventEmitter.call(self);
33363
+ self.reader = reader;
33364
+ // forward close events
33365
+ self.reader.on("error", function(err) {
33366
+ // error closing the fd
33367
+ emitError(self, err);
33368
+ });
33369
+ self.reader.once("close", function() {
33370
+ self.emit("close");
33371
+ });
33372
+ self.readEntryCursor = centralDirectoryOffset;
33373
+ self.fileSize = fileSize;
33374
+ self.entryCount = entryCount;
33375
+ self.comment = comment;
33376
+ self.entriesRead = 0;
33377
+ self.autoClose = !!autoClose;
33378
+ self.lazyEntries = !!lazyEntries;
33379
+ self.decodeStrings = !!decodeStrings;
33380
+ self.validateEntrySizes = !!validateEntrySizes;
33381
+ self.strictFileNames = !!strictFileNames;
33382
+ self.isOpen = true;
33383
+ self.emittedError = false;
33384
+
33385
+ if (!self.lazyEntries) self._readEntry();
33386
+ }
33387
+ ZipFile.prototype.close = function() {
33388
+ if (!this.isOpen) return;
33389
+ this.isOpen = false;
33390
+ this.reader.unref();
33391
+ };
33392
+
33393
+ function emitErrorAndAutoClose(self, err) {
33394
+ if (self.autoClose) self.close();
33395
+ emitError(self, err);
33396
+ }
33397
+ function emitError(self, err) {
33398
+ if (self.emittedError) return;
33399
+ self.emittedError = true;
33400
+ self.emit("error", err);
33401
+ }
33402
+
33403
+ ZipFile.prototype.readEntry = function() {
33404
+ if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
33405
+ this._readEntry();
33406
+ };
33407
+ ZipFile.prototype._readEntry = function() {
33408
+ var self = this;
33409
+ if (self.entryCount === self.entriesRead) {
33410
+ // done with metadata
33411
+ setImmediate(function() {
33412
+ if (self.autoClose) self.close();
33413
+ if (self.emittedError) return;
33414
+ self.emit("end");
33415
+ });
33416
+ return;
33417
+ }
33418
+ if (self.emittedError) return;
33419
+ var buffer = newBuffer(46);
33420
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
33421
+ if (err) return emitErrorAndAutoClose(self, err);
33422
+ if (self.emittedError) return;
33423
+ var entry = new Entry();
33424
+ // 0 - Central directory file header signature
33425
+ var signature = buffer.readUInt32LE(0);
33426
+ if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
33427
+ // 4 - Version made by
33428
+ entry.versionMadeBy = buffer.readUInt16LE(4);
33429
+ // 6 - Version needed to extract (minimum)
33430
+ entry.versionNeededToExtract = buffer.readUInt16LE(6);
33431
+ // 8 - General purpose bit flag
33432
+ entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
33433
+ // 10 - Compression method
33434
+ entry.compressionMethod = buffer.readUInt16LE(10);
33435
+ // 12 - File last modification time
33436
+ entry.lastModFileTime = buffer.readUInt16LE(12);
33437
+ // 14 - File last modification date
33438
+ entry.lastModFileDate = buffer.readUInt16LE(14);
33439
+ // 16 - CRC-32
33440
+ entry.crc32 = buffer.readUInt32LE(16);
33441
+ // 20 - Compressed size
33442
+ entry.compressedSize = buffer.readUInt32LE(20);
33443
+ // 24 - Uncompressed size
33444
+ entry.uncompressedSize = buffer.readUInt32LE(24);
33445
+ // 28 - File name length (n)
33446
+ entry.fileNameLength = buffer.readUInt16LE(28);
33447
+ // 30 - Extra field length (m)
33448
+ entry.extraFieldLength = buffer.readUInt16LE(30);
33449
+ // 32 - File comment length (k)
33450
+ entry.fileCommentLength = buffer.readUInt16LE(32);
33451
+ // 34 - Disk number where file starts
33452
+ // 36 - Internal file attributes
33453
+ entry.internalFileAttributes = buffer.readUInt16LE(36);
33454
+ // 38 - External file attributes
33455
+ entry.externalFileAttributes = buffer.readUInt32LE(38);
33456
+ // 42 - Relative offset of local file header
33457
+ entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
33458
+
33459
+ if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
33460
+
33461
+ self.readEntryCursor += 46;
33462
+
33463
+ buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
33464
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
33465
+ if (err) return emitErrorAndAutoClose(self, err);
33466
+ if (self.emittedError) return;
33467
+ // 46 - File name
33468
+ var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0;
33469
+ entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8)
33470
+ : buffer.slice(0, entry.fileNameLength);
33471
+
33472
+ // 46+n - Extra field
33473
+ var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
33474
+ var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);
33475
+ entry.extraFields = [];
33476
+ var i = 0;
33477
+ while (i < extraFieldBuffer.length - 3) {
33478
+ var headerId = extraFieldBuffer.readUInt16LE(i + 0);
33479
+ var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
33480
+ var dataStart = i + 4;
33481
+ var dataEnd = dataStart + dataSize;
33482
+ if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size"));
33483
+ var dataBuffer = newBuffer(dataSize);
33484
+ extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd);
33485
+ entry.extraFields.push({
33486
+ id: headerId,
33487
+ data: dataBuffer,
33488
+ });
33489
+ i = dataEnd;
33490
+ }
33491
+
33492
+ // 46+n+m - File comment
33493
+ entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8)
33494
+ : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);
33495
+ // compatibility hack for https://github.com/thejoshwolfe/yauzl/issues/47
33496
+ entry.comment = entry.fileComment;
33497
+
33498
+ self.readEntryCursor += buffer.length;
33499
+ self.entriesRead += 1;
33500
+
33501
+ if (entry.uncompressedSize === 0xffffffff ||
33502
+ entry.compressedSize === 0xffffffff ||
33503
+ entry.relativeOffsetOfLocalHeader === 0xffffffff) {
33504
+ // ZIP64 format
33505
+ // find the Zip64 Extended Information Extra Field
33506
+ var zip64EiefBuffer = null;
33507
+ for (var i = 0; i < entry.extraFields.length; i++) {
33508
+ var extraField = entry.extraFields[i];
33509
+ if (extraField.id === 0x0001) {
33510
+ zip64EiefBuffer = extraField.data;
33511
+ break;
33512
+ }
33513
+ }
33514
+ if (zip64EiefBuffer == null) {
33515
+ return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field"));
33516
+ }
33517
+ var index = 0;
33518
+ // 0 - Original Size 8 bytes
33519
+ if (entry.uncompressedSize === 0xffffffff) {
33520
+ if (index + 8 > zip64EiefBuffer.length) {
33521
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
33522
+ }
33523
+ entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
33524
+ index += 8;
33525
+ }
33526
+ // 8 - Compressed Size 8 bytes
33527
+ if (entry.compressedSize === 0xffffffff) {
33528
+ if (index + 8 > zip64EiefBuffer.length) {
33529
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
33530
+ }
33531
+ entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
33532
+ index += 8;
33533
+ }
33534
+ // 16 - Relative Header Offset 8 bytes
33535
+ if (entry.relativeOffsetOfLocalHeader === 0xffffffff) {
33536
+ if (index + 8 > zip64EiefBuffer.length) {
33537
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
33538
+ }
33539
+ entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
33540
+ index += 8;
33541
+ }
33542
+ // 24 - Disk Start Number 4 bytes
33543
+ }
33544
+
33545
+ // check for Info-ZIP Unicode Path Extra Field (0x7075)
33546
+ // see https://github.com/thejoshwolfe/yauzl/issues/33
33547
+ if (self.decodeStrings) {
33548
+ for (var i = 0; i < entry.extraFields.length; i++) {
33549
+ var extraField = entry.extraFields[i];
33550
+ if (extraField.id === 0x7075) {
33551
+ if (extraField.data.length < 6) {
33552
+ // too short to be meaningful
33553
+ continue;
33554
+ }
33555
+ // Version 1 byte version of this extra field, currently 1
33556
+ if (extraField.data.readUInt8(0) !== 1) {
33557
+ // > Changes may not be backward compatible so this extra
33558
+ // > field should not be used if the version is not recognized.
33559
+ continue;
33560
+ }
33561
+ // NameCRC32 4 bytes File Name Field CRC32 Checksum
33562
+ var oldNameCrc32 = extraField.data.readUInt32LE(1);
33563
+ if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) {
33564
+ // > If the CRC check fails, this UTF-8 Path Extra Field should be
33565
+ // > ignored and the File Name field in the header should be used instead.
33566
+ continue;
33567
+ }
33568
+ // UnicodeName Variable UTF-8 version of the entry File Name
33569
+ entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true);
33570
+ break;
33571
+ }
33572
+ }
33573
+ }
33574
+
33575
+ // validate file size
33576
+ if (self.validateEntrySizes && entry.compressionMethod === 0) {
33577
+ var expectedCompressedSize = entry.uncompressedSize;
33578
+ if (entry.isEncrypted()) {
33579
+ // traditional encryption prefixes the file data with a header
33580
+ expectedCompressedSize += 12;
33581
+ }
33582
+ if (entry.compressedSize !== expectedCompressedSize) {
33583
+ var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
33584
+ return emitErrorAndAutoClose(self, new Error(msg));
33585
+ }
33586
+ }
33587
+
33588
+ if (self.decodeStrings) {
33589
+ if (!self.strictFileNames) {
33590
+ // allow backslash
33591
+ entry.fileName = entry.fileName.replace(/\\/g, "/");
33592
+ }
33593
+ var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions);
33594
+ if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));
33595
+ }
33596
+ self.emit("entry", entry);
33597
+
33598
+ if (!self.lazyEntries) self._readEntry();
33599
+ });
33600
+ });
33601
+ };
33602
+
33603
+ ZipFile.prototype.openReadStream = function(entry, options, callback) {
33604
+ var self = this;
33605
+ // parameter validation
33606
+ var relativeStart = 0;
33607
+ var relativeEnd = entry.compressedSize;
33608
+ if (callback == null) {
33609
+ callback = options;
33610
+ options = {};
33611
+ } else {
33612
+ // validate options that the caller has no excuse to get wrong
33613
+ if (options.decrypt != null) {
33614
+ if (!entry.isEncrypted()) {
33615
+ throw new Error("options.decrypt can only be specified for encrypted entries");
33616
+ }
33617
+ if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt);
33618
+ if (entry.isCompressed()) {
33619
+ if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false");
33620
+ }
33621
+ }
33622
+ if (options.decompress != null) {
33623
+ if (!entry.isCompressed()) {
33624
+ throw new Error("options.decompress can only be specified for compressed entries");
33625
+ }
33626
+ if (!(options.decompress === false || options.decompress === true)) {
33627
+ throw new Error("invalid options.decompress value: " + options.decompress);
33628
+ }
33629
+ }
33630
+ if (options.start != null || options.end != null) {
33631
+ if (entry.isCompressed() && options.decompress !== false) {
33632
+ throw new Error("start/end range not allowed for compressed entry without options.decompress === false");
33633
+ }
33634
+ if (entry.isEncrypted() && options.decrypt !== false) {
33635
+ throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false");
33636
+ }
33637
+ }
33638
+ if (options.start != null) {
33639
+ relativeStart = options.start;
33640
+ if (relativeStart < 0) throw new Error("options.start < 0");
33641
+ if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize");
33642
+ }
33643
+ if (options.end != null) {
33644
+ relativeEnd = options.end;
33645
+ if (relativeEnd < 0) throw new Error("options.end < 0");
33646
+ if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize");
33647
+ if (relativeEnd < relativeStart) throw new Error("options.end < options.start");
33648
+ }
33649
+ }
33650
+ // any further errors can either be caused by the zipfile,
33651
+ // or were introduced in a minor version of yauzl,
33652
+ // so should be passed to the client rather than thrown.
33653
+ if (!self.isOpen) return callback(new Error("closed"));
33654
+ if (entry.isEncrypted()) {
33655
+ if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false"));
33656
+ }
33657
+ // make sure we don't lose the fd before we open the actual read stream
33658
+ self.reader.ref();
33659
+ var buffer = newBuffer(30);
33660
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {
33661
+ try {
33662
+ if (err) return callback(err);
33663
+ // 0 - Local file header signature = 0x04034b50
33664
+ var signature = buffer.readUInt32LE(0);
33665
+ if (signature !== 0x04034b50) {
33666
+ return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
33667
+ }
33668
+ // all this should be redundant
33669
+ // 4 - Version needed to extract (minimum)
33670
+ // 6 - General purpose bit flag
33671
+ // 8 - Compression method
33672
+ // 10 - File last modification time
33673
+ // 12 - File last modification date
33674
+ // 14 - CRC-32
33675
+ // 18 - Compressed size
33676
+ // 22 - Uncompressed size
33677
+ // 26 - File name length (n)
33678
+ var fileNameLength = buffer.readUInt16LE(26);
33679
+ // 28 - Extra field length (m)
33680
+ var extraFieldLength = buffer.readUInt16LE(28);
33681
+ // 30 - File name
33682
+ // 30+n - Extra field
33683
+ var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;
33684
+ var decompress;
33685
+ if (entry.compressionMethod === 0) {
33686
+ // 0 - The file is stored (no compression)
33687
+ decompress = false;
33688
+ } else if (entry.compressionMethod === 8) {
33689
+ // 8 - The file is Deflated
33690
+ decompress = options.decompress != null ? options.decompress : true;
33691
+ } else {
33692
+ return callback(new Error("unsupported compression method: " + entry.compressionMethod));
33693
+ }
33694
+ var fileDataStart = localFileHeaderEnd;
33695
+ var fileDataEnd = fileDataStart + entry.compressedSize;
33696
+ if (entry.compressedSize !== 0) {
33697
+ // bounds check now, because the read streams will probably not complain loud enough.
33698
+ // since we're dealing with an unsigned offset plus an unsigned size,
33699
+ // we only have 1 thing to check for.
33700
+ if (fileDataEnd > self.fileSize) {
33701
+ return callback(new Error("file data overflows file bounds: " +
33702
+ fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
33703
+ }
33704
+ }
33705
+ var readStream = self.reader.createReadStream({
33706
+ start: fileDataStart + relativeStart,
33707
+ end: fileDataStart + relativeEnd,
33708
+ });
33709
+ var endpointStream = readStream;
33710
+ if (decompress) {
33711
+ var destroyed = false;
33712
+ var inflateFilter = zlib.createInflateRaw();
33713
+ readStream.on("error", function(err) {
33714
+ // setImmediate here because errors can be emitted during the first call to pipe()
33715
+ setImmediate(function() {
33716
+ if (!destroyed) inflateFilter.emit("error", err);
33717
+ });
33718
+ });
33719
+ readStream.pipe(inflateFilter);
33720
+
33721
+ if (self.validateEntrySizes) {
33722
+ endpointStream = new AssertByteCountStream(entry.uncompressedSize);
33723
+ inflateFilter.on("error", function(err) {
33724
+ // forward zlib errors to the client-visible stream
33725
+ setImmediate(function() {
33726
+ if (!destroyed) endpointStream.emit("error", err);
33727
+ });
33728
+ });
33729
+ inflateFilter.pipe(endpointStream);
33730
+ } else {
33731
+ // the zlib filter is the client-visible stream
33732
+ endpointStream = inflateFilter;
33733
+ }
33734
+ // this is part of yauzl's API, so implement this function on the client-visible stream
33735
+ endpointStream.destroy = function() {
33736
+ destroyed = true;
33737
+ if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);
33738
+ readStream.unpipe(inflateFilter);
33739
+ // TODO: the inflateFilter may cause a memory leak. see Issue #27.
33740
+ readStream.destroy();
33741
+ };
33742
+ }
33743
+ callback(null, endpointStream);
33744
+ } finally {
33745
+ self.reader.unref();
33746
+ }
33747
+ });
33748
+ };
33749
+
33750
+ function Entry() {
33751
+ }
33752
+ Entry.prototype.getLastModDate = function() {
33753
+ return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
33754
+ };
33755
+ Entry.prototype.isEncrypted = function() {
33756
+ return (this.generalPurposeBitFlag & 0x1) !== 0;
33757
+ };
33758
+ Entry.prototype.isCompressed = function() {
33759
+ return this.compressionMethod === 8;
33760
+ };
33761
+
33762
+ function dosDateTimeToDate(date, time) {
33763
+ var day = date & 0x1f; // 1-31
33764
+ var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11
33765
+ var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108
33766
+
33767
+ var millisecond = 0;
33768
+ var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)
33769
+ var minute = time >> 5 & 0x3f; // 0-59
33770
+ var hour = time >> 11 & 0x1f; // 0-23
33771
+
33772
+ return new Date(year, month, day, hour, minute, second, millisecond);
33773
+ }
33774
+
33775
+ function validateFileName(fileName) {
33776
+ if (fileName.indexOf("\\") !== -1) {
33777
+ return "invalid characters in fileName: " + fileName;
33778
+ }
33779
+ if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
33780
+ return "absolute path: " + fileName;
33781
+ }
33782
+ if (fileName.split("/").indexOf("..") !== -1) {
33783
+ return "invalid relative path: " + fileName;
33784
+ }
33785
+ // all good
33786
+ return null;
33787
+ }
33788
+
33789
+ function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
33790
+ if (length === 0) {
33791
+ // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file
33792
+ return setImmediate(function() { callback(null, newBuffer(0)); });
33793
+ }
33794
+ reader.read(buffer, offset, length, position, function(err, bytesRead) {
33795
+ if (err) return callback(err);
33796
+ if (bytesRead < length) {
33797
+ return callback(new Error("unexpected EOF"));
33798
+ }
33799
+ callback();
33800
+ });
33801
+ }
33802
+
33803
+ util.inherits(AssertByteCountStream, Transform);
33804
+ function AssertByteCountStream(byteCount) {
33805
+ Transform.call(this);
33806
+ this.actualByteCount = 0;
33807
+ this.expectedByteCount = byteCount;
33808
+ }
33809
+ AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
33810
+ this.actualByteCount += chunk.length;
33811
+ if (this.actualByteCount > this.expectedByteCount) {
33812
+ var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
33813
+ return cb(new Error(msg));
33814
+ }
33815
+ cb(null, chunk);
33816
+ };
33817
+ AssertByteCountStream.prototype._flush = function(cb) {
33818
+ if (this.actualByteCount < this.expectedByteCount) {
33819
+ var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
33820
+ return cb(new Error(msg));
33821
+ }
33822
+ cb();
33823
+ };
33824
+
33825
+ util.inherits(RandomAccessReader, EventEmitter);
33826
+ function RandomAccessReader() {
33827
+ EventEmitter.call(this);
33828
+ this.refCount = 0;
33829
+ }
33830
+ RandomAccessReader.prototype.ref = function() {
33831
+ this.refCount += 1;
33832
+ };
33833
+ RandomAccessReader.prototype.unref = function() {
33834
+ var self = this;
33835
+ self.refCount -= 1;
33836
+
33837
+ if (self.refCount > 0) return;
33838
+ if (self.refCount < 0) throw new Error("invalid unref");
33839
+
33840
+ self.close(onCloseDone);
33841
+
33842
+ function onCloseDone(err) {
33843
+ if (err) return self.emit('error', err);
33844
+ self.emit('close');
33845
+ }
33846
+ };
33847
+ RandomAccessReader.prototype.createReadStream = function(options) {
33848
+ var start = options.start;
33849
+ var end = options.end;
33850
+ if (start === end) {
33851
+ var emptyStream = new PassThrough();
33852
+ setImmediate(function() {
33853
+ emptyStream.end();
33854
+ });
33855
+ return emptyStream;
33856
+ }
33857
+ var stream = this._readStreamForRange(start, end);
33858
+
33859
+ var destroyed = false;
33860
+ var refUnrefFilter = new RefUnrefFilter(this);
33861
+ stream.on("error", function(err) {
33862
+ setImmediate(function() {
33863
+ if (!destroyed) refUnrefFilter.emit("error", err);
33864
+ });
33865
+ });
33866
+ refUnrefFilter.destroy = function() {
33867
+ stream.unpipe(refUnrefFilter);
33868
+ refUnrefFilter.unref();
33869
+ stream.destroy();
33870
+ };
33871
+
33872
+ var byteCounter = new AssertByteCountStream(end - start);
33873
+ refUnrefFilter.on("error", function(err) {
33874
+ setImmediate(function() {
33875
+ if (!destroyed) byteCounter.emit("error", err);
33876
+ });
33877
+ });
33878
+ byteCounter.destroy = function() {
33879
+ destroyed = true;
33880
+ refUnrefFilter.unpipe(byteCounter);
33881
+ refUnrefFilter.destroy();
33882
+ };
33883
+
33884
+ return stream.pipe(refUnrefFilter).pipe(byteCounter);
33885
+ };
33886
+ RandomAccessReader.prototype._readStreamForRange = function(start, end) {
33887
+ throw new Error("not implemented");
33888
+ };
33889
+ RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
33890
+ var readStream = this.createReadStream({start: position, end: position + length});
33891
+ var writeStream = new Writable();
33892
+ var written = 0;
33893
+ writeStream._write = function(chunk, encoding, cb) {
33894
+ chunk.copy(buffer, offset + written, 0, chunk.length);
33895
+ written += chunk.length;
33896
+ cb();
33897
+ };
33898
+ writeStream.on("finish", callback);
33899
+ readStream.on("error", function(error) {
33900
+ callback(error);
33901
+ });
33902
+ readStream.pipe(writeStream);
33903
+ };
33904
+ RandomAccessReader.prototype.close = function(callback) {
33905
+ setImmediate(callback);
33906
+ };
33907
+
33908
+ util.inherits(RefUnrefFilter, PassThrough);
33909
+ function RefUnrefFilter(context) {
33910
+ PassThrough.call(this);
33911
+ this.context = context;
33912
+ this.context.ref();
33913
+ this.unreffedYet = false;
33914
+ }
33915
+ RefUnrefFilter.prototype._flush = function(cb) {
33916
+ this.unref();
33917
+ cb();
33918
+ };
33919
+ RefUnrefFilter.prototype.unref = function(cb) {
33920
+ if (this.unreffedYet) return;
33921
+ this.unreffedYet = true;
33922
+ this.context.unref();
33923
+ };
33924
+
33925
+ var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';
33926
+ function decodeBuffer(buffer, start, end, isUtf8) {
33927
+ if (isUtf8) {
33928
+ return buffer.toString("utf8", start, end);
33929
+ } else {
33930
+ var result = "";
33931
+ for (var i = start; i < end; i++) {
33932
+ result += cp437[buffer[i]];
33933
+ }
33934
+ return result;
33935
+ }
33936
+ }
33937
+
33938
+ function readUInt64LE(buffer, offset) {
33939
+ // there is no native function for this, because we can't actually store 64-bit integers precisely.
33940
+ // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore.
33941
+ // but since 53 bits is a whole lot more than 32 bits, we do our best anyway.
33942
+ var lower32 = buffer.readUInt32LE(offset);
33943
+ var upper32 = buffer.readUInt32LE(offset + 4);
33944
+ // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers.
33945
+ return upper32 * 0x100000000 + lower32;
33946
+ // as long as we're bounds checking the result of this function against the total file size,
33947
+ // we'll catch any overflow errors, because we already made sure the total file size was within reason.
33948
+ }
33949
+
33950
+ // Node 10 deprecated new Buffer().
33951
+ var newBuffer;
33952
+ if (typeof Buffer.allocUnsafe === "function") {
33953
+ newBuffer = function(len) {
33954
+ return Buffer.allocUnsafe(len);
33955
+ };
33956
+ } else {
33957
+ newBuffer = function(len) {
33958
+ return new Buffer(len);
33959
+ };
33960
+ }
33961
+
33962
+ function defaultCallback(err) {
33963
+ if (err) throw err;
33964
+ }
33965
+
33966
+
32681
33967
  /***/ }),
32682
33968
 
32683
33969
  /***/ 39014:
@@ -41732,6 +43018,20 @@ class LRUCache {
41732
43018
  exports.LRUCache = LRUCache;
41733
43019
  //# sourceMappingURL=index.js.map
41734
43020
 
43021
+ /***/ }),
43022
+
43023
+ /***/ 16453:
43024
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
43025
+
43026
+ "use strict";
43027
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
43028
+ /* harmony export */ "is": () => (/* reexport safe */ _assert_mjs__WEBPACK_IMPORTED_MODULE_0__.is)
43029
+ /* harmony export */ });
43030
+ /* harmony import */ var _assert_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29041);
43031
+
43032
+ //# sourceMappingURL=is.mjs.map
43033
+
43034
+
41735
43035
  /***/ }),
41736
43036
 
41737
43037
  /***/ 51526: