@offckb/cli 0.4.7 → 0.4.9-canary-2b6b3af.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.
- package/README.md +40 -0
- package/build/index.js +1558 -207
- package/package.json +1 -6
package/build/index.js
CHANGED
|
@@ -235,16 +235,23 @@ exports.defaultSettings = {
|
|
|
235
235
|
transactionsPath: path.resolve(exports.dataPath, 'mainnet/transactions'),
|
|
236
236
|
},
|
|
237
237
|
tools: {
|
|
238
|
+
rootFolder: path.resolve(exports.dataPath, 'tools'),
|
|
238
239
|
ckbDebugger: {
|
|
239
240
|
minVersion: '0.200.0',
|
|
240
241
|
},
|
|
242
|
+
ckbTui: {
|
|
243
|
+
version: 'v0.1.3',
|
|
244
|
+
},
|
|
241
245
|
},
|
|
242
246
|
};
|
|
243
247
|
function readSettings() {
|
|
244
248
|
try {
|
|
245
249
|
if (fs.existsSync(exports.configPath)) {
|
|
246
250
|
const data = fs.readFileSync(exports.configPath, 'utf8');
|
|
247
|
-
|
|
251
|
+
const parsed = JSON.parse(data);
|
|
252
|
+
validateSettings(parsed);
|
|
253
|
+
// Deep-clone defaults before merging to prevent mutation of the shared default
|
|
254
|
+
return deepMerge(deepClone(exports.defaultSettings), parsed);
|
|
248
255
|
}
|
|
249
256
|
else {
|
|
250
257
|
return exports.defaultSettings;
|
|
@@ -274,10 +281,26 @@ function getCKBBinaryPath(version) {
|
|
|
274
281
|
const binaryName = platform === 'win32' ? 'ckb.exe' : 'ckb';
|
|
275
282
|
return path.join(getCKBBinaryInstallPath(version), binaryName);
|
|
276
283
|
}
|
|
284
|
+
function deepClone(obj) {
|
|
285
|
+
if (obj === null || typeof obj !== 'object') {
|
|
286
|
+
return obj;
|
|
287
|
+
}
|
|
288
|
+
if (Array.isArray(obj)) {
|
|
289
|
+
return obj.map(deepClone);
|
|
290
|
+
}
|
|
291
|
+
const clone = {};
|
|
292
|
+
for (const key in obj) {
|
|
293
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
294
|
+
clone[key] = deepClone(obj[key]);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return clone;
|
|
298
|
+
}
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
277
300
|
function deepMerge(target, source) {
|
|
278
301
|
for (const key in source) {
|
|
279
|
-
if (source[key] && typeof source[key] === 'object') {
|
|
280
|
-
if (!target[key]) {
|
|
302
|
+
if (source[key] !== null && typeof source[key] === 'object' && !Array.isArray(source[key])) {
|
|
303
|
+
if (!target[key] || typeof target[key] !== 'object') {
|
|
281
304
|
target[key] = {};
|
|
282
305
|
}
|
|
283
306
|
deepMerge(target[key], source[key]);
|
|
@@ -288,6 +311,29 @@ function deepMerge(target, source) {
|
|
|
288
311
|
}
|
|
289
312
|
return target;
|
|
290
313
|
}
|
|
314
|
+
function validateSettings(raw) {
|
|
315
|
+
if (!raw || typeof raw !== 'object') {
|
|
316
|
+
throw new Error('Settings must be a JSON object');
|
|
317
|
+
}
|
|
318
|
+
const obj = raw;
|
|
319
|
+
if (obj.tools && typeof obj.tools === 'object') {
|
|
320
|
+
const tools = obj.tools;
|
|
321
|
+
if (tools.rootFolder !== undefined && typeof tools.rootFolder !== 'string') {
|
|
322
|
+
throw new Error('tools.rootFolder must be a string path');
|
|
323
|
+
}
|
|
324
|
+
if (tools.ckbTui && typeof tools.ckbTui === 'object') {
|
|
325
|
+
const ckbTui = tools.ckbTui;
|
|
326
|
+
if (ckbTui.version !== undefined && typeof ckbTui.version !== 'string') {
|
|
327
|
+
throw new Error('tools.ckbTui.version must be a string');
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (obj.proxy !== undefined && obj.proxy !== null) {
|
|
332
|
+
if (typeof obj.proxy !== 'object') {
|
|
333
|
+
throw new Error('proxy must be an object');
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
291
337
|
|
|
292
338
|
|
|
293
339
|
/***/ }),
|
|
@@ -316,6 +362,7 @@ const deposit_1 = __nccwpck_require__(48598);
|
|
|
316
362
|
const deploy_1 = __nccwpck_require__(79617);
|
|
317
363
|
const transfer_1 = __nccwpck_require__(40265);
|
|
318
364
|
const balance_1 = __nccwpck_require__(77640);
|
|
365
|
+
const udt_1 = __nccwpck_require__(50703);
|
|
319
366
|
const create_1 = __nccwpck_require__(51534);
|
|
320
367
|
const config_1 = __nccwpck_require__(93004);
|
|
321
368
|
const devnet_config_1 = __nccwpck_require__(10015);
|
|
@@ -325,20 +372,34 @@ const transfer_all_1 = __nccwpck_require__(92039);
|
|
|
325
372
|
const gen_1 = __nccwpck_require__(750);
|
|
326
373
|
const ckb_debugger_1 = __nccwpck_require__(14815);
|
|
327
374
|
const logger_1 = __nccwpck_require__(65370);
|
|
375
|
+
const status_1 = __nccwpck_require__(71420);
|
|
376
|
+
const validator_1 = __nccwpck_require__(39534);
|
|
328
377
|
const version = (__nccwpck_require__(8330)/* .version */ .rE);
|
|
329
378
|
const description = (__nccwpck_require__(8330)/* .description */ .h_);
|
|
330
379
|
// fix windows terminal encoding of simplified chinese text
|
|
331
380
|
(0, encoding_1.setUTF8EncodingForWindows)();
|
|
332
381
|
const program = new commander_1.Command();
|
|
333
382
|
program.name('offckb').description(description).version(version).enablePositionalOptions();
|
|
334
|
-
program
|
|
383
|
+
program.option('--json', 'Output logs in JSON format for agent/programmatic consumption');
|
|
384
|
+
program.hook('preAction', (thisCommand) => {
|
|
385
|
+
const opts = thisCommand.opts();
|
|
386
|
+
if (opts.json) {
|
|
387
|
+
logger_1.logger.setJsonMode(true);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
const nodeCommand = program
|
|
335
391
|
.command('node [CKB-Version]')
|
|
336
392
|
.description('Use the CKB to start devnet')
|
|
337
393
|
.option('--network <network>', 'Specify the network to deploy to', 'devnet')
|
|
338
394
|
.option('-b, --binary-path <binaryPath>', 'Specify the CKB binary path to use, only for devnet, when set, will ignore version and network')
|
|
395
|
+
.option('--daemon', 'Run the node in the background as a daemon (devnet only)')
|
|
339
396
|
.action((version, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
340
|
-
return (0, node_1.startNode)({ version, network: options.network, binaryPath: options.binaryPath });
|
|
397
|
+
return (0, node_1.startNode)({ version, network: options.network, binaryPath: options.binaryPath, daemon: options.daemon });
|
|
341
398
|
}));
|
|
399
|
+
nodeCommand
|
|
400
|
+
.command('stop')
|
|
401
|
+
.description('Stop the running CKB devnet daemon')
|
|
402
|
+
.action(() => __awaiter(void 0, void 0, void 0, function* () { return (0, node_1.stopNode)(); }));
|
|
342
403
|
program
|
|
343
404
|
.command('create [project-name]')
|
|
344
405
|
.description('Create a new CKB Smart Contract project in JavaScript.')
|
|
@@ -412,13 +473,15 @@ program
|
|
|
412
473
|
return (0, deposit_1.deposit)(toAddress, amountInCKB, options);
|
|
413
474
|
}));
|
|
414
475
|
program
|
|
415
|
-
.command('transfer [toAddress] [
|
|
416
|
-
.description('Transfer CKB tokens to address, only devnet and testnet')
|
|
476
|
+
.command('transfer [toAddress] [amount]')
|
|
477
|
+
.description('Transfer CKB or UDT tokens to address, only devnet and testnet')
|
|
417
478
|
.option('--network <network>', 'Specify the network to transfer to', 'devnet')
|
|
418
|
-
.option('--privkey <privkey>', 'Specify the private key to transfer
|
|
479
|
+
.option('--privkey <privkey>', 'Specify the private key to transfer')
|
|
480
|
+
.addOption(new commander_1.Option('--udt-kind <kind>', 'Specify the UDT kind').choices(['sudt', 'xudt']).default('sudt'))
|
|
481
|
+
.option('--udt-type-args <typeArgs>', 'Specify the UDT type script args to transfer UDT')
|
|
419
482
|
.option('-r, --proxy-rpc', 'Use Proxy RPC to connect to blockchain')
|
|
420
|
-
.action((toAddress,
|
|
421
|
-
return (0, transfer_1.transfer)(toAddress,
|
|
483
|
+
.action((toAddress, amount, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
484
|
+
return (0, transfer_1.transfer)(toAddress, amount, options);
|
|
422
485
|
}));
|
|
423
486
|
program
|
|
424
487
|
.command('transfer-all [toAddress]')
|
|
@@ -431,11 +494,36 @@ program
|
|
|
431
494
|
}));
|
|
432
495
|
program
|
|
433
496
|
.command('balance [toAddress]')
|
|
434
|
-
.description('Check account balance, only devnet and testnet')
|
|
497
|
+
.description('Check account balance (CKB + detected SUDT/xUDT), only devnet and testnet')
|
|
435
498
|
.option('--network <network>', 'Specify the network to check', 'devnet')
|
|
499
|
+
.addOption(new commander_1.Option('--udt-kind <kind>', 'Filter by UDT kind').choices(['sudt', 'xudt']))
|
|
500
|
+
.option('--udt-type-args <typeArgs>', 'Filter by UDT type script args')
|
|
501
|
+
.option('--no-udt', 'Skip UDT balance scan')
|
|
436
502
|
.action((toAddress, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
437
503
|
return (0, balance_1.balanceOf)(toAddress, options);
|
|
438
504
|
}));
|
|
505
|
+
const udtCommand = program.command('udt').description('UDT token commands');
|
|
506
|
+
udtCommand
|
|
507
|
+
.command('issue <amount>')
|
|
508
|
+
.description('Issue new UDT tokens, only devnet and testnet')
|
|
509
|
+
.option('--network <network>', 'Specify the network', 'devnet')
|
|
510
|
+
.addOption(new commander_1.Option('--udt-kind <kind>', 'Specify the UDT kind').choices(['sudt', 'xudt']).default('sudt'))
|
|
511
|
+
.option('--type-args <typeArgs>', 'Specify the UDT type script args (xudt only; defaults to signer lock hash)')
|
|
512
|
+
.option('--to <toAddress>', 'Specify the receiver address (defaults to signer)')
|
|
513
|
+
.option('--privkey <privkey>', 'Specify the private key to issue UDT')
|
|
514
|
+
.action((amount, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
515
|
+
return (0, udt_1.udtIssue)(amount, options);
|
|
516
|
+
}));
|
|
517
|
+
udtCommand
|
|
518
|
+
.command('destroy <amount>')
|
|
519
|
+
.description('Destroy UDT tokens, only devnet and testnet')
|
|
520
|
+
.option('--network <network>', 'Specify the network', 'devnet')
|
|
521
|
+
.addOption(new commander_1.Option('--udt-kind <kind>', 'Specify the UDT kind').choices(['sudt', 'xudt']).default('sudt'))
|
|
522
|
+
.requiredOption('--type-args <typeArgs>', 'Specify the UDT type script args')
|
|
523
|
+
.option('--privkey <privkey>', 'Specify the private key to destroy UDT')
|
|
524
|
+
.action((amount, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
525
|
+
return (0, udt_1.udtDestroy)(amount, options);
|
|
526
|
+
}));
|
|
439
527
|
program
|
|
440
528
|
.command('debugger')
|
|
441
529
|
.description('Port of the raw CKB Standalone Debugger')
|
|
@@ -445,6 +533,14 @@ program
|
|
|
445
533
|
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
446
534
|
return ckb_debugger_1.CKBDebugger.runWithArgs(process.argv.slice(2));
|
|
447
535
|
}));
|
|
536
|
+
program
|
|
537
|
+
.command('status')
|
|
538
|
+
.description('Show ckb-tui status interface')
|
|
539
|
+
.option('--network <network>', 'Specify the network whose node status to monitor', 'devnet')
|
|
540
|
+
.action((option) => __awaiter(void 0, void 0, void 0, function* () {
|
|
541
|
+
(0, validator_1.validateNetworkOpt)(option.network);
|
|
542
|
+
return yield (0, status_1.status)({ network: option.network });
|
|
543
|
+
}));
|
|
448
544
|
program
|
|
449
545
|
.command('config <action> [item] [value]')
|
|
450
546
|
.description('do a configuration action')
|
|
@@ -534,11 +630,31 @@ function balanceOf(address_1) {
|
|
|
534
630
|
const network = opt.network;
|
|
535
631
|
(0, validator_1.validateNetworkOpt)(network);
|
|
536
632
|
const ckb = new ckb_1.CKB({ network });
|
|
537
|
-
const balanceInCKB = yield
|
|
538
|
-
|
|
633
|
+
const [balanceInCKB, udtBalances] = yield Promise.all([
|
|
634
|
+
ckb.balance(address),
|
|
635
|
+
opt.udt !== false ? ckb.detectUdtBalances(address) : Promise.resolve([]),
|
|
636
|
+
]);
|
|
637
|
+
logger_1.logger.info(`CKB: ${balanceInCKB}`);
|
|
638
|
+
const filtered = filterUdtBalances(udtBalances, opt);
|
|
639
|
+
if (filtered.length > 0) {
|
|
640
|
+
logger_1.logger.info('UDT:');
|
|
641
|
+
for (const udt of filtered) {
|
|
642
|
+
logger_1.logger.info(` ${udt.kind} (args=${udt.args}): ${udt.balance}`);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
539
645
|
process.exit(0);
|
|
540
646
|
});
|
|
541
647
|
}
|
|
648
|
+
function filterUdtBalances(balances, opt) {
|
|
649
|
+
if (!opt.udtKind && !opt.udtTypeArgs) {
|
|
650
|
+
return balances;
|
|
651
|
+
}
|
|
652
|
+
return balances.filter((udt) => {
|
|
653
|
+
const kindMatch = opt.udtKind ? udt.kind === opt.udtKind : true;
|
|
654
|
+
const argsMatch = opt.udtTypeArgs ? udt.args === opt.udtTypeArgs : true;
|
|
655
|
+
return kindMatch && argsMatch;
|
|
656
|
+
});
|
|
657
|
+
}
|
|
542
658
|
|
|
543
659
|
|
|
544
660
|
/***/ }),
|
|
@@ -1400,6 +1516,39 @@ function devnetConfig() {
|
|
|
1400
1516
|
|
|
1401
1517
|
"use strict";
|
|
1402
1518
|
|
|
1519
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1520
|
+
if (k2 === undefined) k2 = k;
|
|
1521
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1522
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1523
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1524
|
+
}
|
|
1525
|
+
Object.defineProperty(o, k2, desc);
|
|
1526
|
+
}) : (function(o, m, k, k2) {
|
|
1527
|
+
if (k2 === undefined) k2 = k;
|
|
1528
|
+
o[k2] = m[k];
|
|
1529
|
+
}));
|
|
1530
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1531
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1532
|
+
}) : function(o, v) {
|
|
1533
|
+
o["default"] = v;
|
|
1534
|
+
});
|
|
1535
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
1536
|
+
var ownKeys = function(o) {
|
|
1537
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
1538
|
+
var ar = [];
|
|
1539
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
1540
|
+
return ar;
|
|
1541
|
+
};
|
|
1542
|
+
return ownKeys(o);
|
|
1543
|
+
};
|
|
1544
|
+
return function (mod) {
|
|
1545
|
+
if (mod && mod.__esModule) return mod;
|
|
1546
|
+
var result = {};
|
|
1547
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
1548
|
+
__setModuleDefault(result, mod);
|
|
1549
|
+
return result;
|
|
1550
|
+
};
|
|
1551
|
+
})();
|
|
1403
1552
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1404
1553
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1405
1554
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -1412,9 +1561,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
1412
1561
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1413
1562
|
exports.startNode = startNode;
|
|
1414
1563
|
exports.nodeDevnet = nodeDevnet;
|
|
1564
|
+
exports.stopNode = stopNode;
|
|
1415
1565
|
exports.nodeTestnet = nodeTestnet;
|
|
1416
1566
|
exports.nodeMainnet = nodeMainnet;
|
|
1417
1567
|
const child_process_1 = __nccwpck_require__(35317);
|
|
1568
|
+
const fs = __importStar(__nccwpck_require__(79896));
|
|
1569
|
+
const path = __importStar(__nccwpck_require__(16928));
|
|
1418
1570
|
const init_chain_1 = __nccwpck_require__(1360);
|
|
1419
1571
|
const install_1 = __nccwpck_require__(65611);
|
|
1420
1572
|
const setting_1 = __nccwpck_require__(25546);
|
|
@@ -1422,13 +1574,20 @@ const encoding_1 = __nccwpck_require__(6851);
|
|
|
1422
1574
|
const rpc_proxy_1 = __nccwpck_require__(46589);
|
|
1423
1575
|
const base_1 = __nccwpck_require__(69951);
|
|
1424
1576
|
const logger_1 = __nccwpck_require__(65370);
|
|
1425
|
-
|
|
1577
|
+
const DAEMON_LOG_DIR = 'logs';
|
|
1578
|
+
const DAEMON_LOG_FILE = 'daemon.log';
|
|
1579
|
+
const DAEMON_PID_FILE = 'daemon.pid';
|
|
1580
|
+
const DAEMON_CHILD_ENV = 'OFFCKB_DAEMON_CHILD';
|
|
1581
|
+
function startNode({ version, network = base_1.Network.devnet, binaryPath, daemon }) {
|
|
1426
1582
|
if (binaryPath && network !== base_1.Network.devnet) {
|
|
1427
1583
|
logger_1.logger.warn('Custom binaryPath is only supported for devnet. The provided binaryPath will be ignored.');
|
|
1428
1584
|
}
|
|
1585
|
+
if (daemon && network !== base_1.Network.devnet) {
|
|
1586
|
+
logger_1.logger.warn('Daemon mode is only supported for devnet. The daemon flag will be ignored.');
|
|
1587
|
+
}
|
|
1429
1588
|
switch (network) {
|
|
1430
1589
|
case base_1.Network.devnet:
|
|
1431
|
-
return nodeDevnet({ version, binaryPath });
|
|
1590
|
+
return nodeDevnet({ version, binaryPath, daemon });
|
|
1432
1591
|
case base_1.Network.testnet:
|
|
1433
1592
|
return nodeTestnet();
|
|
1434
1593
|
case base_1.Network.mainnet:
|
|
@@ -1438,8 +1597,11 @@ function startNode({ version, network = base_1.Network.devnet, binaryPath }) {
|
|
|
1438
1597
|
}
|
|
1439
1598
|
}
|
|
1440
1599
|
function nodeDevnet(_a) {
|
|
1441
|
-
return __awaiter(this, arguments, void 0, function* ({ version, binaryPath }) {
|
|
1600
|
+
return __awaiter(this, arguments, void 0, function* ({ version, binaryPath, daemon }) {
|
|
1442
1601
|
var _b, _c;
|
|
1602
|
+
if (daemon) {
|
|
1603
|
+
return startDaemon();
|
|
1604
|
+
}
|
|
1443
1605
|
const settings = (0, setting_1.readSettings)();
|
|
1444
1606
|
const ckbVersion = version || settings.bins.defaultCKBVersion;
|
|
1445
1607
|
let ckbBinPath = '';
|
|
@@ -1494,6 +1656,314 @@ function nodeDevnet(_a) {
|
|
|
1494
1656
|
}
|
|
1495
1657
|
});
|
|
1496
1658
|
}
|
|
1659
|
+
function resolveDaemonPaths() {
|
|
1660
|
+
const settings = (0, setting_1.readSettings)();
|
|
1661
|
+
const logDir = path.join(settings.devnet.dataPath, DAEMON_LOG_DIR);
|
|
1662
|
+
const logFile = path.join(logDir, DAEMON_LOG_FILE);
|
|
1663
|
+
const pidFile = path.join(logDir, DAEMON_PID_FILE);
|
|
1664
|
+
return { logDir, logFile, pidFile };
|
|
1665
|
+
}
|
|
1666
|
+
function readPidFile(pidFile) {
|
|
1667
|
+
var _a, _b;
|
|
1668
|
+
let raw;
|
|
1669
|
+
try {
|
|
1670
|
+
raw = fs.readFileSync(pidFile, 'utf8').trim();
|
|
1671
|
+
}
|
|
1672
|
+
catch (error) {
|
|
1673
|
+
// Treat a missing or unreadable PID file as "no daemon".
|
|
1674
|
+
return null;
|
|
1675
|
+
}
|
|
1676
|
+
if (!raw) {
|
|
1677
|
+
return null;
|
|
1678
|
+
}
|
|
1679
|
+
// Backward compatibility: plain integer PID written by older versions.
|
|
1680
|
+
const plainPid = Number(raw);
|
|
1681
|
+
if (Number.isInteger(plainPid) && plainPid > 0) {
|
|
1682
|
+
return { pid: plainPid, scriptPath: (_a = resolveCliEntry()) !== null && _a !== void 0 ? _a : '', startedAt: new Date(0).toISOString() };
|
|
1683
|
+
}
|
|
1684
|
+
try {
|
|
1685
|
+
const parsed = JSON.parse(raw);
|
|
1686
|
+
const pid = Number(parsed.pid);
|
|
1687
|
+
if (Number.isInteger(pid) && pid > 0 && typeof parsed.scriptPath === 'string') {
|
|
1688
|
+
return {
|
|
1689
|
+
pid,
|
|
1690
|
+
scriptPath: parsed.scriptPath,
|
|
1691
|
+
startedAt: (_b = parsed.startedAt) !== null && _b !== void 0 ? _b : new Date(0).toISOString(),
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
catch (_c) {
|
|
1696
|
+
// fall through to sentinel below
|
|
1697
|
+
}
|
|
1698
|
+
// Content exists but is neither a valid plain PID nor valid metadata.
|
|
1699
|
+
// Return a sentinel so stopNode can report an invalid PID and clean up.
|
|
1700
|
+
return { pid: NaN, scriptPath: '', startedAt: new Date(0).toISOString() };
|
|
1701
|
+
}
|
|
1702
|
+
function writePidFile(pidFile, metadata) {
|
|
1703
|
+
fs.writeFileSync(pidFile, JSON.stringify(metadata, null, 2));
|
|
1704
|
+
}
|
|
1705
|
+
function resolveCliEntry() {
|
|
1706
|
+
var _a;
|
|
1707
|
+
// In priority order. process.argv[1] is the most reliable for a Node CLI.
|
|
1708
|
+
// OFFCKB_CLI_PATH is an escape hatch for packaged/npx/weird environments.
|
|
1709
|
+
// require.main?.filename is a final fallback when argv is unavailable.
|
|
1710
|
+
const candidates = [process.env.OFFCKB_CLI_PATH, process.argv[1], (_a = require.main) === null || _a === void 0 ? void 0 : _a.filename].filter((c) => typeof c === 'string' && c.length > 0);
|
|
1711
|
+
for (const candidate of candidates) {
|
|
1712
|
+
try {
|
|
1713
|
+
const resolved = path.resolve(candidate);
|
|
1714
|
+
const stats = fs.statSync(resolved);
|
|
1715
|
+
if (stats.isFile()) {
|
|
1716
|
+
return resolved;
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
catch (_b) {
|
|
1720
|
+
// Candidate is missing or not a file; try the next one.
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
return null;
|
|
1724
|
+
}
|
|
1725
|
+
function isProcessAlive(pid) {
|
|
1726
|
+
try {
|
|
1727
|
+
process.kill(pid, 0);
|
|
1728
|
+
return true;
|
|
1729
|
+
}
|
|
1730
|
+
catch (_a) {
|
|
1731
|
+
return false;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
function cleanupPidFile(pidFile) {
|
|
1735
|
+
try {
|
|
1736
|
+
fs.unlinkSync(pidFile);
|
|
1737
|
+
}
|
|
1738
|
+
catch (error) {
|
|
1739
|
+
logger_1.logger.warn(`Failed to remove PID file ${pidFile}:`, error);
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
function waitForProcessExit(pid, timeoutMs) {
|
|
1743
|
+
const start = Date.now();
|
|
1744
|
+
return new Promise((resolve) => {
|
|
1745
|
+
const check = () => {
|
|
1746
|
+
if (!isProcessAlive(pid)) {
|
|
1747
|
+
resolve(true);
|
|
1748
|
+
return;
|
|
1749
|
+
}
|
|
1750
|
+
if (Date.now() - start >= timeoutMs) {
|
|
1751
|
+
resolve(false);
|
|
1752
|
+
return;
|
|
1753
|
+
}
|
|
1754
|
+
setTimeout(check, 100);
|
|
1755
|
+
};
|
|
1756
|
+
check();
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
function getProcessCommandLine(pid) {
|
|
1760
|
+
return new Promise((resolve) => {
|
|
1761
|
+
if (process.platform === 'win32') {
|
|
1762
|
+
(0, child_process_1.exec)(`wmic process where ProcessId=${pid} get CommandLine /format:list`, (error, stdout) => {
|
|
1763
|
+
if (error) {
|
|
1764
|
+
resolve(null);
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
const match = stdout.match(/CommandLine=(.+)/);
|
|
1768
|
+
resolve(match ? match[1].trim() : null);
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1771
|
+
else {
|
|
1772
|
+
(0, child_process_1.exec)(`ps -p ${pid} -o args=`, (error, stdout) => {
|
|
1773
|
+
if (error) {
|
|
1774
|
+
resolve(null);
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
resolve(stdout.trim());
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
function verifyDaemonIdentity(pid, metadata) {
|
|
1783
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1784
|
+
const cmdline = yield getProcessCommandLine(pid);
|
|
1785
|
+
if (!cmdline) {
|
|
1786
|
+
return false;
|
|
1787
|
+
}
|
|
1788
|
+
// The daemon child re-runs the same CLI entry point, so its command line
|
|
1789
|
+
// should reference the same script and should be a Node process.
|
|
1790
|
+
const scriptName = path.basename(metadata.scriptPath);
|
|
1791
|
+
const scriptDir = path.dirname(metadata.scriptPath);
|
|
1792
|
+
const looksLikeNode = cmdline.includes('node') || cmdline.includes('nodejs');
|
|
1793
|
+
const looksLikeOurScript = cmdline.includes(metadata.scriptPath) || (scriptName !== '' && cmdline.includes(scriptName));
|
|
1794
|
+
const looksLikeOffckb = cmdline.includes('offckb') || scriptDir.includes('offckb');
|
|
1795
|
+
return looksLikeNode && (looksLikeOurScript || looksLikeOffckb);
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
function terminateProcess(pid, signal) {
|
|
1799
|
+
return new Promise((resolve, reject) => {
|
|
1800
|
+
if (process.platform === 'win32') {
|
|
1801
|
+
// Windows has no POSIX signals and process.kill(pid) only terminates the
|
|
1802
|
+
// single process. Use taskkill to terminate the whole tree.
|
|
1803
|
+
// /T kills the process and all child processes.
|
|
1804
|
+
// /F forces termination when SIGKILL is requested.
|
|
1805
|
+
const args = signal === 'SIGKILL' ? ['/T', '/F', '/PID', String(pid)] : ['/T', '/PID', String(pid)];
|
|
1806
|
+
const taskkill = (0, child_process_1.spawn)('taskkill', args, { stdio: 'ignore' });
|
|
1807
|
+
taskkill.on('error', reject);
|
|
1808
|
+
taskkill.on('exit', () => {
|
|
1809
|
+
// taskkill may return non-zero if the process is already gone, which
|
|
1810
|
+
// is acceptable for our purposes.
|
|
1811
|
+
resolve();
|
|
1812
|
+
});
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1815
|
+
// On POSIX, detached: true makes the child a session/process group leader.
|
|
1816
|
+
// A negative pid sends the signal to the entire process group, ensuring
|
|
1817
|
+
// the CKB node, miner and RPC proxy all receive it.
|
|
1818
|
+
try {
|
|
1819
|
+
process.kill(-pid, signal);
|
|
1820
|
+
resolve();
|
|
1821
|
+
}
|
|
1822
|
+
catch (error) {
|
|
1823
|
+
reject(error);
|
|
1824
|
+
}
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
function startDaemon() {
|
|
1828
|
+
const { logDir, logFile, pidFile } = resolveDaemonPaths();
|
|
1829
|
+
// Prevent duplicate daemon starts. If a daemon is already running, refuse
|
|
1830
|
+
// to overwrite its PID file.
|
|
1831
|
+
const existing = readPidFile(pidFile);
|
|
1832
|
+
if (existing && isProcessAlive(existing.pid)) {
|
|
1833
|
+
logger_1.logger.error(`A CKB devnet daemon is already running (PID ${existing.pid}). Stop it first with: offckb node stop`);
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
if (existing && !isProcessAlive(existing.pid)) {
|
|
1837
|
+
// Stale PID file from a crashed daemon; clean it up before starting anew.
|
|
1838
|
+
cleanupPidFile(pidFile);
|
|
1839
|
+
}
|
|
1840
|
+
let out;
|
|
1841
|
+
let err;
|
|
1842
|
+
try {
|
|
1843
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
1844
|
+
out = fs.openSync(logFile, 'a');
|
|
1845
|
+
err = fs.openSync(logFile, 'a');
|
|
1846
|
+
}
|
|
1847
|
+
catch (error) {
|
|
1848
|
+
logger_1.logger.error(`Failed to prepare daemon log directory or log file at ${logFile}:`, error);
|
|
1849
|
+
return;
|
|
1850
|
+
}
|
|
1851
|
+
const scriptPath = resolveCliEntry();
|
|
1852
|
+
if (!scriptPath) {
|
|
1853
|
+
logger_1.logger.error('Unable to determine the CLI entry point for daemon mode. Set OFFCKB_CLI_PATH to the offckb script.');
|
|
1854
|
+
closeFileDescriptors(out, err);
|
|
1855
|
+
return;
|
|
1856
|
+
}
|
|
1857
|
+
const childArgs = process.argv.slice(2).filter((arg) => arg !== '--daemon');
|
|
1858
|
+
const childEnv = Object.assign(Object.assign({}, process.env), { [DAEMON_CHILD_ENV]: '1' });
|
|
1859
|
+
let child;
|
|
1860
|
+
try {
|
|
1861
|
+
child = (0, child_process_1.spawn)(process.execPath, [scriptPath, ...childArgs], {
|
|
1862
|
+
detached: true,
|
|
1863
|
+
stdio: ['ignore', out, err],
|
|
1864
|
+
env: childEnv,
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
catch (error) {
|
|
1868
|
+
logger_1.logger.error('Failed to spawn daemon process:', error);
|
|
1869
|
+
closeFileDescriptors(out, err);
|
|
1870
|
+
return;
|
|
1871
|
+
}
|
|
1872
|
+
if (!child.pid) {
|
|
1873
|
+
logger_1.logger.error('Failed to spawn daemon process: no PID returned.');
|
|
1874
|
+
closeFileDescriptors(out, err);
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1877
|
+
child.unref();
|
|
1878
|
+
child.on('error', (error) => {
|
|
1879
|
+
logger_1.logger.error('Daemon child process failed to start:', error);
|
|
1880
|
+
cleanupPidFile(pidFile);
|
|
1881
|
+
});
|
|
1882
|
+
const metadata = {
|
|
1883
|
+
pid: child.pid,
|
|
1884
|
+
scriptPath,
|
|
1885
|
+
startedAt: new Date().toISOString(),
|
|
1886
|
+
};
|
|
1887
|
+
writePidFile(pidFile, metadata);
|
|
1888
|
+
// File descriptors are now owned by the spawned child; close our copies.
|
|
1889
|
+
closeFileDescriptors(out, err);
|
|
1890
|
+
logger_1.logger.success(`CKB devnet daemon started with PID ${child.pid}.`);
|
|
1891
|
+
logger_1.logger.info(`Logs: ${logFile}`);
|
|
1892
|
+
logger_1.logger.info(`PID file: ${pidFile}`);
|
|
1893
|
+
logger_1.logger.info('Stop the daemon with: offckb node stop');
|
|
1894
|
+
}
|
|
1895
|
+
function closeFileDescriptors(...fds) {
|
|
1896
|
+
for (const fd of fds) {
|
|
1897
|
+
if (fd === undefined)
|
|
1898
|
+
continue;
|
|
1899
|
+
try {
|
|
1900
|
+
fs.closeSync(fd);
|
|
1901
|
+
}
|
|
1902
|
+
catch (_a) {
|
|
1903
|
+
// ignore
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
function stopNode() {
|
|
1908
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1909
|
+
const { pidFile } = resolveDaemonPaths();
|
|
1910
|
+
const metadata = readPidFile(pidFile);
|
|
1911
|
+
if (!metadata) {
|
|
1912
|
+
logger_1.logger.warn(`No daemon PID file found at ${pidFile}. Is the devnet daemon running?`);
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1915
|
+
const pid = metadata.pid;
|
|
1916
|
+
if (!Number.isInteger(pid) || pid <= 0) {
|
|
1917
|
+
logger_1.logger.error(`Invalid PID in ${pidFile}: ${pid}`);
|
|
1918
|
+
cleanupPidFile(pidFile);
|
|
1919
|
+
return;
|
|
1920
|
+
}
|
|
1921
|
+
if (!isProcessAlive(pid)) {
|
|
1922
|
+
logger_1.logger.warn(`Daemon process ${pid} is not running.`);
|
|
1923
|
+
cleanupPidFile(pidFile);
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1926
|
+
const identityOk = yield verifyDaemonIdentity(pid, metadata);
|
|
1927
|
+
if (!identityOk) {
|
|
1928
|
+
logger_1.logger.error(`Process ${pid} does not appear to be the offckb daemon. Refusing to send signals to avoid killing an unrelated process. ` +
|
|
1929
|
+
`If you are sure this is the daemon, stop it manually and remove ${pidFile}.`);
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
logger_1.logger.info(`Stopping CKB devnet daemon (PID ${pid})...`);
|
|
1933
|
+
try {
|
|
1934
|
+
yield terminateProcess(pid, 'SIGTERM');
|
|
1935
|
+
}
|
|
1936
|
+
catch (error) {
|
|
1937
|
+
const err = error;
|
|
1938
|
+
if (err.code === 'ESRCH') {
|
|
1939
|
+
logger_1.logger.warn(`Daemon process ${pid} is not running.`);
|
|
1940
|
+
cleanupPidFile(pidFile);
|
|
1941
|
+
return;
|
|
1942
|
+
}
|
|
1943
|
+
if (err.code === 'EPERM') {
|
|
1944
|
+
logger_1.logger.error(`Permission denied when sending SIGTERM to daemon process ${pid}.`);
|
|
1945
|
+
}
|
|
1946
|
+
else {
|
|
1947
|
+
logger_1.logger.error(`Failed to send SIGTERM to daemon process ${pid}:`, error);
|
|
1948
|
+
}
|
|
1949
|
+
// Still try to clean up the PID file so the user can recover.
|
|
1950
|
+
cleanupPidFile(pidFile);
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
const exited = yield waitForProcessExit(pid, 5000);
|
|
1954
|
+
if (!exited) {
|
|
1955
|
+
logger_1.logger.warn(`Daemon process ${pid} did not exit gracefully, sending SIGKILL...`);
|
|
1956
|
+
try {
|
|
1957
|
+
yield terminateProcess(pid, 'SIGKILL');
|
|
1958
|
+
}
|
|
1959
|
+
catch (error) {
|
|
1960
|
+
logger_1.logger.error(`Failed to send SIGKILL to daemon process ${pid}:`, error);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
cleanupPidFile(pidFile);
|
|
1964
|
+
logger_1.logger.success('CKB devnet daemon stopped.');
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1497
1967
|
function nodeTestnet() {
|
|
1498
1968
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1499
1969
|
// todo: maybe we can actually start a node for testnet later
|
|
@@ -1518,6 +1988,130 @@ function nodeMainnet() {
|
|
|
1518
1988
|
}
|
|
1519
1989
|
|
|
1520
1990
|
|
|
1991
|
+
/***/ }),
|
|
1992
|
+
|
|
1993
|
+
/***/ 71420:
|
|
1994
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
1995
|
+
|
|
1996
|
+
"use strict";
|
|
1997
|
+
|
|
1998
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1999
|
+
if (k2 === undefined) k2 = k;
|
|
2000
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2001
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2002
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2003
|
+
}
|
|
2004
|
+
Object.defineProperty(o, k2, desc);
|
|
2005
|
+
}) : (function(o, m, k, k2) {
|
|
2006
|
+
if (k2 === undefined) k2 = k;
|
|
2007
|
+
o[k2] = m[k];
|
|
2008
|
+
}));
|
|
2009
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2010
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2011
|
+
}) : function(o, v) {
|
|
2012
|
+
o["default"] = v;
|
|
2013
|
+
});
|
|
2014
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
2015
|
+
var ownKeys = function(o) {
|
|
2016
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
2017
|
+
var ar = [];
|
|
2018
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
2019
|
+
return ar;
|
|
2020
|
+
};
|
|
2021
|
+
return ownKeys(o);
|
|
2022
|
+
};
|
|
2023
|
+
return function (mod) {
|
|
2024
|
+
if (mod && mod.__esModule) return mod;
|
|
2025
|
+
var result = {};
|
|
2026
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
2027
|
+
__setModuleDefault(result, mod);
|
|
2028
|
+
return result;
|
|
2029
|
+
};
|
|
2030
|
+
})();
|
|
2031
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2032
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2033
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2034
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2035
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2036
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2037
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2038
|
+
});
|
|
2039
|
+
};
|
|
2040
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2041
|
+
exports.status = status;
|
|
2042
|
+
const setting_1 = __nccwpck_require__(25546);
|
|
2043
|
+
const ckb_tui_1 = __nccwpck_require__(7020);
|
|
2044
|
+
const base_1 = __nccwpck_require__(69951);
|
|
2045
|
+
const logger_1 = __nccwpck_require__(65370);
|
|
2046
|
+
const net = __importStar(__nccwpck_require__(69278));
|
|
2047
|
+
const NETWORK_SETTINGS_KEY = {
|
|
2048
|
+
[base_1.Network.devnet]: 'devnet',
|
|
2049
|
+
[base_1.Network.testnet]: 'testnet',
|
|
2050
|
+
[base_1.Network.mainnet]: 'mainnet',
|
|
2051
|
+
};
|
|
2052
|
+
function status(_a) {
|
|
2053
|
+
return __awaiter(this, arguments, void 0, function* ({ network }) {
|
|
2054
|
+
var _b;
|
|
2055
|
+
// ckb-tui is an interactive terminal UI. Running it without a TTY
|
|
2056
|
+
// (pipe, redirect, CI) would hang or produce garbage output.
|
|
2057
|
+
if (!process.stdout.isTTY || !process.stdin.isTTY) {
|
|
2058
|
+
logger_1.logger.error('The status command requires an interactive terminal (TTY). ' +
|
|
2059
|
+
'It cannot be used in pipes, redirects, or non-interactive environments like CI.');
|
|
2060
|
+
process.exit(1);
|
|
2061
|
+
}
|
|
2062
|
+
const settings = (0, setting_1.readSettings)();
|
|
2063
|
+
const networkKey = NETWORK_SETTINGS_KEY[network];
|
|
2064
|
+
const port = settings[networkKey].rpcProxyPort;
|
|
2065
|
+
const url = `http://127.0.0.1:${port}`;
|
|
2066
|
+
const isListening = yield isRPCPortListening(port);
|
|
2067
|
+
if (!isListening) {
|
|
2068
|
+
logger_1.logger.error(`RPC port ${port} is not listening. Please make sure the ${network} node is running and Proxy RPC is enabled.`);
|
|
2069
|
+
return;
|
|
2070
|
+
}
|
|
2071
|
+
const result = ckb_tui_1.CKBTui.run(['-r', url]);
|
|
2072
|
+
// Propagate ckb-tui exit code so scripts can detect TUI failure
|
|
2073
|
+
if (result.status !== 0) {
|
|
2074
|
+
process.exitCode = (_b = result.status) !== null && _b !== void 0 ? _b : 1;
|
|
2075
|
+
}
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
function isRPCPortListening(port) {
|
|
2079
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2080
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) {
|
|
2081
|
+
return false;
|
|
2082
|
+
}
|
|
2083
|
+
const client = new net.Socket();
|
|
2084
|
+
return new Promise((resolve) => {
|
|
2085
|
+
let settled = false;
|
|
2086
|
+
const TIMEOUT_MS = 2000;
|
|
2087
|
+
const timeout = setTimeout(() => {
|
|
2088
|
+
if (!settled) {
|
|
2089
|
+
settled = true;
|
|
2090
|
+
client.destroy();
|
|
2091
|
+
resolve(false);
|
|
2092
|
+
}
|
|
2093
|
+
}, TIMEOUT_MS);
|
|
2094
|
+
client.once('error', () => {
|
|
2095
|
+
if (!settled) {
|
|
2096
|
+
settled = true;
|
|
2097
|
+
clearTimeout(timeout);
|
|
2098
|
+
resolve(false);
|
|
2099
|
+
}
|
|
2100
|
+
});
|
|
2101
|
+
client.once('connect', () => {
|
|
2102
|
+
if (!settled) {
|
|
2103
|
+
settled = true;
|
|
2104
|
+
clearTimeout(timeout);
|
|
2105
|
+
client.end();
|
|
2106
|
+
resolve(true);
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
client.connect(port, '127.0.0.1');
|
|
2110
|
+
});
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
|
|
1521
2115
|
/***/ }),
|
|
1522
2116
|
|
|
1523
2117
|
/***/ 86198:
|
|
@@ -1829,9 +2423,9 @@ const ckb_1 = __nccwpck_require__(83748);
|
|
|
1829
2423
|
const base_1 = __nccwpck_require__(69951);
|
|
1830
2424
|
const link_1 = __nccwpck_require__(27814);
|
|
1831
2425
|
const validator_1 = __nccwpck_require__(39534);
|
|
1832
|
-
|
|
1833
|
-
function
|
|
1834
|
-
|
|
2426
|
+
function transfer(toAddress_1, amount_1) {
|
|
2427
|
+
return __awaiter(this, arguments, void 0, function* (toAddress, amount, opt = { network: base_1.Network.devnet }) {
|
|
2428
|
+
var _a;
|
|
1835
2429
|
const network = opt.network;
|
|
1836
2430
|
(0, validator_1.validateNetworkOpt)(network);
|
|
1837
2431
|
if (opt.privkey == null) {
|
|
@@ -1839,16 +2433,89 @@ function transfer(toAddress_1, amountInCKB_1) {
|
|
|
1839
2433
|
}
|
|
1840
2434
|
const privateKey = opt.privkey;
|
|
1841
2435
|
const ckb = new ckb_1.CKB({ network });
|
|
2436
|
+
if (opt.udtTypeArgs) {
|
|
2437
|
+
const kind = (_a = opt.udtKind) !== null && _a !== void 0 ? _a : 'sudt';
|
|
2438
|
+
(0, validator_1.validateUdtKind)(kind);
|
|
2439
|
+
const udtTypeArgs = (0, validator_1.validateUdtTypeArgs)(kind, opt.udtTypeArgs);
|
|
2440
|
+
const udtType = yield ckb.buildUdtTypeScript(kind, udtTypeArgs);
|
|
2441
|
+
const txHash = yield ckb.udtTransfer({
|
|
2442
|
+
toAddress,
|
|
2443
|
+
amount,
|
|
2444
|
+
privateKey,
|
|
2445
|
+
udtType,
|
|
2446
|
+
kind,
|
|
2447
|
+
});
|
|
2448
|
+
(0, link_1.logTxSuccess)(network, txHash, 'transfer UDT');
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
1842
2451
|
const txHash = yield ckb.transfer({
|
|
1843
2452
|
toAddress,
|
|
1844
|
-
amountInCKB,
|
|
2453
|
+
amountInCKB: amount,
|
|
1845
2454
|
privateKey,
|
|
1846
2455
|
});
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
2456
|
+
(0, link_1.logTxSuccess)(network, txHash, 'transfer');
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
/***/ }),
|
|
2462
|
+
|
|
2463
|
+
/***/ 50703:
|
|
2464
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
2465
|
+
|
|
2466
|
+
"use strict";
|
|
2467
|
+
|
|
2468
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2469
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2470
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2471
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2472
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2473
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2474
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2475
|
+
});
|
|
2476
|
+
};
|
|
2477
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2478
|
+
exports.udtIssue = udtIssue;
|
|
2479
|
+
exports.udtDestroy = udtDestroy;
|
|
2480
|
+
const ckb_1 = __nccwpck_require__(83748);
|
|
2481
|
+
const base_1 = __nccwpck_require__(69951);
|
|
2482
|
+
const link_1 = __nccwpck_require__(27814);
|
|
2483
|
+
const validator_1 = __nccwpck_require__(39534);
|
|
2484
|
+
function udtIssue(amount_1) {
|
|
2485
|
+
return __awaiter(this, arguments, void 0, function* (amount, opt = { network: base_1.Network.devnet, udtKind: 'sudt', privkey: '' }) {
|
|
2486
|
+
const network = opt.network;
|
|
2487
|
+
(0, validator_1.validateNetworkOpt)(network);
|
|
2488
|
+
(0, validator_1.validateUdtKind)(opt.udtKind);
|
|
2489
|
+
if (!opt.privkey) {
|
|
2490
|
+
throw new Error('--privkey is required!');
|
|
1850
2491
|
}
|
|
1851
|
-
|
|
2492
|
+
const ckb = new ckb_1.CKB({ network });
|
|
2493
|
+
const txHash = yield ckb.udtIssue({
|
|
2494
|
+
privateKey: opt.privkey,
|
|
2495
|
+
kind: opt.udtKind,
|
|
2496
|
+
amount,
|
|
2497
|
+
typeArgs: opt.typeArgs ? (0, validator_1.validateUdtTypeArgs)(opt.udtKind, opt.typeArgs) : undefined,
|
|
2498
|
+
toAddress: opt.to,
|
|
2499
|
+
});
|
|
2500
|
+
(0, link_1.logTxSuccess)(network, txHash, 'issued UDT');
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
function udtDestroy(amount_1) {
|
|
2504
|
+
return __awaiter(this, arguments, void 0, function* (amount, opt = { network: base_1.Network.devnet, udtKind: 'sudt', typeArgs: '', privkey: '' }) {
|
|
2505
|
+
const network = opt.network;
|
|
2506
|
+
(0, validator_1.validateNetworkOpt)(network);
|
|
2507
|
+
(0, validator_1.validateUdtKind)(opt.udtKind);
|
|
2508
|
+
if (!opt.privkey) {
|
|
2509
|
+
throw new Error('--privkey is required!');
|
|
2510
|
+
}
|
|
2511
|
+
const ckb = new ckb_1.CKB({ network });
|
|
2512
|
+
const txHash = yield ckb.udtDestroy({
|
|
2513
|
+
privateKey: opt.privkey,
|
|
2514
|
+
kind: opt.udtKind,
|
|
2515
|
+
amount,
|
|
2516
|
+
typeArgs: (0, validator_1.validateUdtTypeArgs)(opt.udtKind, opt.typeArgs),
|
|
2517
|
+
});
|
|
2518
|
+
(0, link_1.logTxSuccess)(network, txHash, 'destroyed UDT');
|
|
1852
2519
|
});
|
|
1853
2520
|
}
|
|
1854
2521
|
|
|
@@ -2935,7 +3602,7 @@ const path = __importStar(__nccwpck_require__(16928));
|
|
|
2935
3602
|
const semver_1 = __importDefault(__nccwpck_require__(89939));
|
|
2936
3603
|
const os_1 = __importDefault(__nccwpck_require__(70857));
|
|
2937
3604
|
const adm_zip_1 = __importDefault(__nccwpck_require__(83746));
|
|
2938
|
-
const tar = __importStar(__nccwpck_require__(
|
|
3605
|
+
const tar = __importStar(__nccwpck_require__(80228));
|
|
2939
3606
|
const request_1 = __nccwpck_require__(65897);
|
|
2940
3607
|
const setting_1 = __nccwpck_require__(25546);
|
|
2941
3608
|
const encoding_1 = __nccwpck_require__(6851);
|
|
@@ -3827,18 +4494,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
3827
4494
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3828
4495
|
});
|
|
3829
4496
|
};
|
|
4497
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
4498
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4499
|
+
var m = o[Symbol.asyncIterator], i;
|
|
4500
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
4501
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
4502
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
4503
|
+
};
|
|
3830
4504
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3831
4505
|
exports.CKB = exports.CKBProps = void 0;
|
|
3832
4506
|
const core_1 = __nccwpck_require__(39842);
|
|
3833
4507
|
const validator_1 = __nccwpck_require__(39534);
|
|
3834
4508
|
const network_1 = __nccwpck_require__(5370);
|
|
3835
4509
|
const private_1 = __nccwpck_require__(5835);
|
|
4510
|
+
const public_1 = __nccwpck_require__(84535);
|
|
3836
4511
|
const migration_1 = __nccwpck_require__(76679);
|
|
3837
4512
|
const base_1 = __nccwpck_require__(69951);
|
|
3838
4513
|
const logger_1 = __nccwpck_require__(65370);
|
|
4514
|
+
const DEFAULT_UDT_SCAN_MAX_CELLS = 1000;
|
|
4515
|
+
const DEFAULT_UDT_DESTROY_MAX_INPUT_CELLS = 100;
|
|
3839
4516
|
class CKBProps {
|
|
3840
4517
|
}
|
|
3841
4518
|
exports.CKBProps = CKBProps;
|
|
4519
|
+
function readUdtBalance(outputData) {
|
|
4520
|
+
try {
|
|
4521
|
+
return BigInt(core_1.ccc.udtBalanceFrom(outputData));
|
|
4522
|
+
}
|
|
4523
|
+
catch (_a) {
|
|
4524
|
+
return null;
|
|
4525
|
+
}
|
|
4526
|
+
}
|
|
3842
4527
|
class CKB {
|
|
3843
4528
|
constructor({ network = base_1.Network.devnet, feeRate = 1000, isEnableProxyRpc = true }) {
|
|
3844
4529
|
if (!(0, validator_1.isValidNetworkString)(network)) {
|
|
@@ -3972,6 +4657,286 @@ class CKB {
|
|
|
3972
4657
|
return txHash;
|
|
3973
4658
|
});
|
|
3974
4659
|
}
|
|
4660
|
+
getSystemScripts() {
|
|
4661
|
+
if (this.network === base_1.Network.mainnet) {
|
|
4662
|
+
return public_1.MAINNET_SYSTEM_SCRIPTS;
|
|
4663
|
+
}
|
|
4664
|
+
if (this.network === base_1.Network.testnet) {
|
|
4665
|
+
return public_1.TESTNET_SYSTEM_SCRIPTS;
|
|
4666
|
+
}
|
|
4667
|
+
const scripts = (0, private_1.getDevnetSystemScriptsFromListHashes)();
|
|
4668
|
+
if (!scripts) {
|
|
4669
|
+
throw new Error(`Failed to load devnet system scripts`);
|
|
4670
|
+
}
|
|
4671
|
+
return scripts;
|
|
4672
|
+
}
|
|
4673
|
+
buildUdtTypeScript(kind, args) {
|
|
4674
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4675
|
+
if (kind === 'xudt') {
|
|
4676
|
+
return core_1.ccc.Script.fromKnownScript(this.client, core_1.ccc.KnownScript.XUdt, args);
|
|
4677
|
+
}
|
|
4678
|
+
const scriptInfo = yield this.getUdtScriptInfo(kind);
|
|
4679
|
+
return core_1.ccc.Script.from({
|
|
4680
|
+
codeHash: scriptInfo.codeHash,
|
|
4681
|
+
hashType: scriptInfo.hashType,
|
|
4682
|
+
args,
|
|
4683
|
+
});
|
|
4684
|
+
});
|
|
4685
|
+
}
|
|
4686
|
+
getUdtScriptInfo(kind) {
|
|
4687
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4688
|
+
var _a;
|
|
4689
|
+
if (kind === 'xudt') {
|
|
4690
|
+
return this.client.getKnownScript(core_1.ccc.KnownScript.XUdt);
|
|
4691
|
+
}
|
|
4692
|
+
const systemScripts = this.getSystemScripts();
|
|
4693
|
+
const sudtScript = (_a = systemScripts.sudt) === null || _a === void 0 ? void 0 : _a.script;
|
|
4694
|
+
if (!sudtScript) {
|
|
4695
|
+
throw new Error(`SUDT script not found on ${this.network}`);
|
|
4696
|
+
}
|
|
4697
|
+
return sudtScript;
|
|
4698
|
+
});
|
|
4699
|
+
}
|
|
4700
|
+
detectUdtBalances(address_1) {
|
|
4701
|
+
return __awaiter(this, arguments, void 0, function* (address, { maxCells = DEFAULT_UDT_SCAN_MAX_CELLS } = {}) {
|
|
4702
|
+
const lock = (yield core_1.ccc.Address.fromString(address, this.client)).script;
|
|
4703
|
+
const sudtScriptInfo = yield this.getUdtScriptInfo('sudt').catch(() => null);
|
|
4704
|
+
const xudtScriptInfo = yield this.getUdtScriptInfo('xudt').catch(() => null);
|
|
4705
|
+
const balances = new Map();
|
|
4706
|
+
let scanned = 0;
|
|
4707
|
+
const scan = (scriptInfo, kind) => __awaiter(this, void 0, void 0, function* () {
|
|
4708
|
+
var _a, e_1, _b, _c;
|
|
4709
|
+
var _d, _e;
|
|
4710
|
+
try {
|
|
4711
|
+
for (var _f = true, _g = __asyncValues(this.client.findCells({
|
|
4712
|
+
script: {
|
|
4713
|
+
codeHash: scriptInfo.codeHash,
|
|
4714
|
+
hashType: scriptInfo.hashType,
|
|
4715
|
+
args: '0x',
|
|
4716
|
+
},
|
|
4717
|
+
scriptType: 'type',
|
|
4718
|
+
scriptSearchMode: 'prefix',
|
|
4719
|
+
filter: { script: lock },
|
|
4720
|
+
withData: true,
|
|
4721
|
+
}, 'asc')), _h; _h = yield _g.next(), _a = _h.done, !_a; _f = true) {
|
|
4722
|
+
_c = _h.value;
|
|
4723
|
+
_f = false;
|
|
4724
|
+
const cell = _c;
|
|
4725
|
+
if (scanned >= maxCells) {
|
|
4726
|
+
logger_1.logger.warn(`UDT balance scan stopped after ${maxCells} cells; balances may be incomplete`);
|
|
4727
|
+
break;
|
|
4728
|
+
}
|
|
4729
|
+
scanned++;
|
|
4730
|
+
const type = cell.cellOutput.type;
|
|
4731
|
+
if (!type) {
|
|
4732
|
+
continue;
|
|
4733
|
+
}
|
|
4734
|
+
const cellBalance = readUdtBalance(cell.outputData);
|
|
4735
|
+
if (cellBalance == null) {
|
|
4736
|
+
logger_1.logger.debug(`Skipping corrupted UDT cell ${(_d = cell.outPoint) === null || _d === void 0 ? void 0 : _d.txHash}:${(_e = cell.outPoint) === null || _e === void 0 ? void 0 : _e.index}`);
|
|
4737
|
+
continue;
|
|
4738
|
+
}
|
|
4739
|
+
const key = `${kind}:${type.codeHash}:${type.hashType}:${type.args}`;
|
|
4740
|
+
const entry = balances.get(key);
|
|
4741
|
+
if (entry) {
|
|
4742
|
+
entry.balance += cellBalance;
|
|
4743
|
+
}
|
|
4744
|
+
else {
|
|
4745
|
+
balances.set(key, {
|
|
4746
|
+
kind,
|
|
4747
|
+
codeHash: type.codeHash,
|
|
4748
|
+
hashType: String(type.hashType),
|
|
4749
|
+
args: type.args,
|
|
4750
|
+
balance: cellBalance,
|
|
4751
|
+
});
|
|
4752
|
+
}
|
|
4753
|
+
}
|
|
4754
|
+
}
|
|
4755
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4756
|
+
finally {
|
|
4757
|
+
try {
|
|
4758
|
+
if (!_f && !_a && (_b = _g.return)) yield _b.call(_g);
|
|
4759
|
+
}
|
|
4760
|
+
finally { if (e_1) throw e_1.error; }
|
|
4761
|
+
}
|
|
4762
|
+
});
|
|
4763
|
+
if (sudtScriptInfo) {
|
|
4764
|
+
yield scan(sudtScriptInfo, 'sudt');
|
|
4765
|
+
}
|
|
4766
|
+
if (xudtScriptInfo) {
|
|
4767
|
+
yield scan(xudtScriptInfo, 'xudt');
|
|
4768
|
+
}
|
|
4769
|
+
return Array.from(balances.values()).map((item) => (Object.assign(Object.assign({}, item), { balance: item.balance.toString() })));
|
|
4770
|
+
});
|
|
4771
|
+
}
|
|
4772
|
+
udtBalance(address_1, udtType_1) {
|
|
4773
|
+
return __awaiter(this, arguments, void 0, function* (address, udtType, { maxCells = DEFAULT_UDT_SCAN_MAX_CELLS } = {}) {
|
|
4774
|
+
var _a, e_2, _b, _c;
|
|
4775
|
+
const lock = (yield core_1.ccc.Address.fromString(address, this.client)).script;
|
|
4776
|
+
let balance = BigInt(0);
|
|
4777
|
+
let scanned = 0;
|
|
4778
|
+
try {
|
|
4779
|
+
for (var _d = true, _e = __asyncValues(this.client.findCellsByLock(lock, udtType, true)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
4780
|
+
_c = _f.value;
|
|
4781
|
+
_d = false;
|
|
4782
|
+
const cell = _c;
|
|
4783
|
+
scanned++;
|
|
4784
|
+
if (scanned > maxCells) {
|
|
4785
|
+
logger_1.logger.warn(`UDT balance scan stopped after ${maxCells} cells; balances may be incomplete`);
|
|
4786
|
+
break;
|
|
4787
|
+
}
|
|
4788
|
+
const cellBalance = readUdtBalance(cell.outputData);
|
|
4789
|
+
if (cellBalance != null) {
|
|
4790
|
+
balance += cellBalance;
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
4793
|
+
}
|
|
4794
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4795
|
+
finally {
|
|
4796
|
+
try {
|
|
4797
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
4798
|
+
}
|
|
4799
|
+
finally { if (e_2) throw e_2.error; }
|
|
4800
|
+
}
|
|
4801
|
+
return balance.toString();
|
|
4802
|
+
});
|
|
4803
|
+
}
|
|
4804
|
+
udtTransfer(_a) {
|
|
4805
|
+
return __awaiter(this, arguments, void 0, function* ({ privateKey, toAddress, amount, udtType, kind }) {
|
|
4806
|
+
const signer = this.buildSigner(privateKey);
|
|
4807
|
+
const to = yield core_1.ccc.Address.fromString(toAddress, this.client);
|
|
4808
|
+
const amountBigInt = (0, validator_1.validateUdtAmount)(amount);
|
|
4809
|
+
const outputsData = [core_1.ccc.hexFrom(core_1.ccc.numToBytes(amountBigInt, 16))];
|
|
4810
|
+
const tx = core_1.ccc.Transaction.from({
|
|
4811
|
+
outputs: [
|
|
4812
|
+
{
|
|
4813
|
+
lock: to.script,
|
|
4814
|
+
type: udtType,
|
|
4815
|
+
capacity: core_1.ccc.fixedPointFrom(0),
|
|
4816
|
+
},
|
|
4817
|
+
],
|
|
4818
|
+
outputsData,
|
|
4819
|
+
});
|
|
4820
|
+
const scriptInfo = yield this.getUdtScriptInfo(kind);
|
|
4821
|
+
tx.addCellDeps(scriptInfo.cellDeps.map((dep) => dep.cellDep));
|
|
4822
|
+
yield tx.completeInputsByUdt(signer, udtType);
|
|
4823
|
+
const inputsUdtBalance = yield tx.getInputsUdtBalance(this.client, udtType);
|
|
4824
|
+
const outputsUdtBalance = tx.getOutputsUdtBalance(udtType);
|
|
4825
|
+
const changeAmount = inputsUdtBalance - outputsUdtBalance;
|
|
4826
|
+
if (changeAmount > BigInt(0)) {
|
|
4827
|
+
const from = yield signer.getAddressObjSecp256k1();
|
|
4828
|
+
tx.outputs.push(core_1.ccc.CellOutput.from({
|
|
4829
|
+
lock: from.script,
|
|
4830
|
+
type: udtType,
|
|
4831
|
+
capacity: core_1.ccc.fixedPointFrom(0),
|
|
4832
|
+
}, core_1.ccc.hexFrom(core_1.ccc.numToBytes(changeAmount, 16))));
|
|
4833
|
+
tx.outputsData.push(core_1.ccc.hexFrom(core_1.ccc.numToBytes(changeAmount, 16)));
|
|
4834
|
+
}
|
|
4835
|
+
yield tx.completeFeeBy(signer, this.feeRate);
|
|
4836
|
+
const txHash = yield signer.sendTransaction(tx);
|
|
4837
|
+
return txHash;
|
|
4838
|
+
});
|
|
4839
|
+
}
|
|
4840
|
+
udtIssue(_a) {
|
|
4841
|
+
return __awaiter(this, arguments, void 0, function* ({ privateKey, kind, amount, typeArgs, toAddress }) {
|
|
4842
|
+
const signer = this.buildSigner(privateKey);
|
|
4843
|
+
const signerAddress = yield signer.getAddressObjSecp256k1();
|
|
4844
|
+
const to = toAddress ? yield core_1.ccc.Address.fromString(toAddress, this.client) : signerAddress;
|
|
4845
|
+
const amountBigInt = (0, validator_1.validateUdtAmount)(amount);
|
|
4846
|
+
let resolvedTypeArgs;
|
|
4847
|
+
if (kind === 'sudt') {
|
|
4848
|
+
if (typeArgs) {
|
|
4849
|
+
logger_1.logger.warn('SUDT type args are derived from the issuer lock hash; --type-args is ignored');
|
|
4850
|
+
}
|
|
4851
|
+
const issuerLockHash = signerAddress.script.hash();
|
|
4852
|
+
resolvedTypeArgs = ('0x' + issuerLockHash.slice(2, 42));
|
|
4853
|
+
}
|
|
4854
|
+
else {
|
|
4855
|
+
if (typeArgs) {
|
|
4856
|
+
resolvedTypeArgs = (0, validator_1.validateUdtTypeArgs)(kind, typeArgs);
|
|
4857
|
+
}
|
|
4858
|
+
else {
|
|
4859
|
+
const issuerLockHash = signerAddress.script.hash();
|
|
4860
|
+
resolvedTypeArgs = issuerLockHash;
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
const udtType = yield this.buildUdtTypeScript(kind, resolvedTypeArgs);
|
|
4864
|
+
const outputsData = [core_1.ccc.hexFrom(core_1.ccc.numToBytes(amountBigInt, 16))];
|
|
4865
|
+
const tx = core_1.ccc.Transaction.from({
|
|
4866
|
+
outputs: [
|
|
4867
|
+
{
|
|
4868
|
+
lock: to.script,
|
|
4869
|
+
type: udtType,
|
|
4870
|
+
capacity: core_1.ccc.fixedPointFrom(0),
|
|
4871
|
+
},
|
|
4872
|
+
],
|
|
4873
|
+
outputsData,
|
|
4874
|
+
});
|
|
4875
|
+
const scriptInfo = yield this.getUdtScriptInfo(kind);
|
|
4876
|
+
tx.addCellDeps(scriptInfo.cellDeps.map((dep) => dep.cellDep));
|
|
4877
|
+
yield tx.completeInputsByCapacity(signer);
|
|
4878
|
+
yield tx.completeFeeBy(signer, this.feeRate);
|
|
4879
|
+
const txHash = yield signer.sendTransaction(tx);
|
|
4880
|
+
return txHash;
|
|
4881
|
+
});
|
|
4882
|
+
}
|
|
4883
|
+
udtDestroy(_a) {
|
|
4884
|
+
return __awaiter(this, arguments, void 0, function* ({ privateKey, kind, typeArgs, amount }, { maxInputCells = DEFAULT_UDT_DESTROY_MAX_INPUT_CELLS } = {}) {
|
|
4885
|
+
var _b, e_3, _c, _d;
|
|
4886
|
+
const signer = this.buildSigner(privateKey);
|
|
4887
|
+
const from = yield signer.getAddressObjSecp256k1();
|
|
4888
|
+
const validatedTypeArgs = (0, validator_1.validateUdtTypeArgs)(kind, typeArgs);
|
|
4889
|
+
const udtType = yield this.buildUdtTypeScript(kind, validatedTypeArgs);
|
|
4890
|
+
const destroyAmount = (0, validator_1.validateUdtAmount)(amount);
|
|
4891
|
+
const cells = [];
|
|
4892
|
+
let totalBalance = BigInt(0);
|
|
4893
|
+
try {
|
|
4894
|
+
for (var _e = true, _f = __asyncValues(this.client.findCellsByLock(from.script, udtType, true)), _g; _g = yield _f.next(), _b = _g.done, !_b; _e = true) {
|
|
4895
|
+
_d = _g.value;
|
|
4896
|
+
_e = false;
|
|
4897
|
+
const cell = _d;
|
|
4898
|
+
if (cells.length >= maxInputCells) {
|
|
4899
|
+
throw new Error(`Too many UDT cells to destroy (limit: ${maxInputCells}); split into smaller operations`);
|
|
4900
|
+
}
|
|
4901
|
+
const cellBalance = readUdtBalance(cell.outputData);
|
|
4902
|
+
if (cellBalance == null) {
|
|
4903
|
+
continue;
|
|
4904
|
+
}
|
|
4905
|
+
cells.push(cell);
|
|
4906
|
+
totalBalance += cellBalance;
|
|
4907
|
+
}
|
|
4908
|
+
}
|
|
4909
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
4910
|
+
finally {
|
|
4911
|
+
try {
|
|
4912
|
+
if (!_e && !_b && (_c = _f.return)) yield _c.call(_f);
|
|
4913
|
+
}
|
|
4914
|
+
finally { if (e_3) throw e_3.error; }
|
|
4915
|
+
}
|
|
4916
|
+
if (totalBalance < destroyAmount) {
|
|
4917
|
+
throw new Error(`Insufficient UDT balance: ${totalBalance} < ${destroyAmount}`);
|
|
4918
|
+
}
|
|
4919
|
+
if (destroyAmount === totalBalance) {
|
|
4920
|
+
throw new Error('Destroying the entire UDT balance may be rejected by the UDT script. Leave at least 1 token or use a smaller amount.');
|
|
4921
|
+
}
|
|
4922
|
+
const tx = core_1.ccc.Transaction.from({});
|
|
4923
|
+
for (const cell of cells) {
|
|
4924
|
+
tx.addInput({ previousOutput: cell.outPoint });
|
|
4925
|
+
}
|
|
4926
|
+
const remaining = totalBalance - destroyAmount;
|
|
4927
|
+
tx.addOutput(core_1.ccc.CellOutput.from({
|
|
4928
|
+
lock: from.script,
|
|
4929
|
+
type: udtType,
|
|
4930
|
+
capacity: core_1.ccc.fixedPointFrom(0),
|
|
4931
|
+
}, core_1.ccc.hexFrom(core_1.ccc.numToBytes(remaining, 16))), core_1.ccc.hexFrom(core_1.ccc.numToBytes(remaining, 16)));
|
|
4932
|
+
const scriptInfo = yield this.getUdtScriptInfo(kind);
|
|
4933
|
+
tx.addCellDeps(scriptInfo.cellDeps.map((dep) => dep.cellDep));
|
|
4934
|
+
yield tx.completeInputsByCapacity(signer);
|
|
4935
|
+
yield tx.completeFeeBy(signer, this.feeRate);
|
|
4936
|
+
const txHash = yield signer.sendTransaction(tx);
|
|
4937
|
+
return txHash;
|
|
4938
|
+
});
|
|
4939
|
+
}
|
|
3975
4940
|
deployScript(scriptBinBytes, privateKey) {
|
|
3976
4941
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3977
4942
|
const signer = this.buildSigner(privateKey);
|
|
@@ -5103,222 +6068,530 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
5103
6068
|
return result;
|
|
5104
6069
|
};
|
|
5105
6070
|
})();
|
|
5106
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5107
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5108
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5109
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5110
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5111
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
5112
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5113
|
-
});
|
|
6071
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6072
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6073
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6074
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6075
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6076
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
6077
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6078
|
+
});
|
|
6079
|
+
};
|
|
6080
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6081
|
+
exports.CKBDebugger = void 0;
|
|
6082
|
+
const child_process_1 = __nccwpck_require__(35317);
|
|
6083
|
+
const path = __importStar(__nccwpck_require__(16928));
|
|
6084
|
+
const setting_1 = __nccwpck_require__(25546);
|
|
6085
|
+
const ckb_debugger_wasm_1 = __nccwpck_require__(52948);
|
|
6086
|
+
const logger_1 = __nccwpck_require__(65370);
|
|
6087
|
+
class CKBDebugger {
|
|
6088
|
+
static getWasmDebugger() {
|
|
6089
|
+
if (!this.wasmDebugger) {
|
|
6090
|
+
const wasmPath = path.join(__dirname, 'ckb-debugger.wasm');
|
|
6091
|
+
this.wasmDebugger = new ckb_debugger_wasm_1.CkbDebuggerWasi({
|
|
6092
|
+
wasmPath,
|
|
6093
|
+
captureOutput: false, // Use stdio directly since custom capture doesn't work with WASI
|
|
6094
|
+
});
|
|
6095
|
+
}
|
|
6096
|
+
return this.wasmDebugger;
|
|
6097
|
+
}
|
|
6098
|
+
/**
|
|
6099
|
+
* Check if we're in a recursive call to avoid infinite loops
|
|
6100
|
+
* This happens when ckb-debugger binary points to offckb CLI
|
|
6101
|
+
*/
|
|
6102
|
+
static isRecursiveCall() {
|
|
6103
|
+
// Check if we're already running as a ckb-debugger process
|
|
6104
|
+
if (process.argv[1] && process.argv[1].includes('ckb-debugger')) {
|
|
6105
|
+
logger_1.logger.debug('Detected ckb-debugger process, using WASM to avoid recursion');
|
|
6106
|
+
return true;
|
|
6107
|
+
}
|
|
6108
|
+
// Check if we're running the debugger command (which could be called from ckb-debugger binary)
|
|
6109
|
+
if (process.argv.includes('debugger')) {
|
|
6110
|
+
logger_1.logger.debug('Detected debugger command, using WASM to avoid recursion');
|
|
6111
|
+
return true;
|
|
6112
|
+
}
|
|
6113
|
+
return false;
|
|
6114
|
+
}
|
|
6115
|
+
static shouldUseWasm() {
|
|
6116
|
+
if (this.isRecursiveCall()) {
|
|
6117
|
+
return true;
|
|
6118
|
+
}
|
|
6119
|
+
if (this.isBinaryInstalled() && this.isBinaryVersionValid()) {
|
|
6120
|
+
logger_1.logger.debug('Using native ckb-debugger (better performance)');
|
|
6121
|
+
return false;
|
|
6122
|
+
}
|
|
6123
|
+
else {
|
|
6124
|
+
logger_1.logger.debug('Native ckb-debugger not available, falling back to WASM version');
|
|
6125
|
+
return true;
|
|
6126
|
+
}
|
|
6127
|
+
}
|
|
6128
|
+
static execute(args) {
|
|
6129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6130
|
+
if (this.shouldUseWasm()) {
|
|
6131
|
+
try {
|
|
6132
|
+
const result = yield this.getWasmDebugger().run(args);
|
|
6133
|
+
if (result.exitCode !== 0) {
|
|
6134
|
+
process.exit(result.exitCode);
|
|
6135
|
+
}
|
|
6136
|
+
}
|
|
6137
|
+
catch (error) {
|
|
6138
|
+
logger_1.logger.error('WASM debugger execution failed:', error);
|
|
6139
|
+
process.exit(1);
|
|
6140
|
+
}
|
|
6141
|
+
}
|
|
6142
|
+
else {
|
|
6143
|
+
const command = `ckb-debugger ${args.join(' ')}`;
|
|
6144
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
6145
|
+
}
|
|
6146
|
+
});
|
|
6147
|
+
}
|
|
6148
|
+
static runRaw(options) {
|
|
6149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6150
|
+
const args = options.split(' ').filter((arg) => arg.trim());
|
|
6151
|
+
yield this.execute(args);
|
|
6152
|
+
});
|
|
6153
|
+
}
|
|
6154
|
+
static runTxCellScript(_a) {
|
|
6155
|
+
return __awaiter(this, arguments, void 0, function* ({ fullTxJsonFilePath, cellIndex, cellType, scriptGroupType }) {
|
|
6156
|
+
const args = [
|
|
6157
|
+
'--tx-file',
|
|
6158
|
+
fullTxJsonFilePath,
|
|
6159
|
+
'--cell-index',
|
|
6160
|
+
cellIndex.toString(),
|
|
6161
|
+
'--cell-type',
|
|
6162
|
+
cellType,
|
|
6163
|
+
'--script-group-type',
|
|
6164
|
+
scriptGroupType,
|
|
6165
|
+
];
|
|
6166
|
+
yield this.execute(args);
|
|
6167
|
+
});
|
|
6168
|
+
}
|
|
6169
|
+
static isBinaryInstalled() {
|
|
6170
|
+
const result = (0, child_process_1.spawnSync)('ckb-debugger', ['--version'], { stdio: 'ignore' });
|
|
6171
|
+
return result.status === 0;
|
|
6172
|
+
}
|
|
6173
|
+
static isBinaryVersionValid() {
|
|
6174
|
+
const result = (0, child_process_1.spawnSync)('ckb-debugger', ['--version']);
|
|
6175
|
+
if (result.status !== 0) {
|
|
6176
|
+
return false;
|
|
6177
|
+
}
|
|
6178
|
+
try {
|
|
6179
|
+
const version = result.stdout.toString().split(' ')[1];
|
|
6180
|
+
const settings = (0, setting_1.readSettings)();
|
|
6181
|
+
if (version < settings.tools.ckbDebugger.minVersion) {
|
|
6182
|
+
return false;
|
|
6183
|
+
}
|
|
6184
|
+
return true;
|
|
6185
|
+
}
|
|
6186
|
+
catch (error) {
|
|
6187
|
+
return false;
|
|
6188
|
+
}
|
|
6189
|
+
}
|
|
6190
|
+
static installCKBDebuggerBinary() {
|
|
6191
|
+
const command = `cargo install --git https://github.com/nervosnetwork/ckb-standalone-debugger ckb-debugger`;
|
|
6192
|
+
try {
|
|
6193
|
+
logger_1.logger.info('Installing ckb-debugger...');
|
|
6194
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
6195
|
+
logger_1.logger.info('ckb-debugger installed successfully. You can uninstall it by running: cargo uninstall ckb-debugger');
|
|
6196
|
+
}
|
|
6197
|
+
catch (error) {
|
|
6198
|
+
logger_1.logger.error('Failed to install ckb-debugger:', error);
|
|
6199
|
+
process.exit(1);
|
|
6200
|
+
}
|
|
6201
|
+
}
|
|
6202
|
+
/**
|
|
6203
|
+
* Create a ckb-debugger fallback binary that points to offckb debugger
|
|
6204
|
+
* This creates a shell script that calls: offckb debugger [args]
|
|
6205
|
+
* Purpose: Reduce user friction by providing a placeholder when native binary is not available
|
|
6206
|
+
* Users can install the real ckb-debugger binary for better performance if needed
|
|
6207
|
+
*/
|
|
6208
|
+
static createCkbDebuggerFallback() {
|
|
6209
|
+
const fs = __nccwpck_require__(79896);
|
|
6210
|
+
const { spawnSync } = __nccwpck_require__(35317);
|
|
6211
|
+
const isWindows = process.platform === 'win32';
|
|
6212
|
+
const binName = isWindows ? 'ckb-debugger.cmd' : 'ckb-debugger';
|
|
6213
|
+
// Find the offckb binary location
|
|
6214
|
+
let offckbPath;
|
|
6215
|
+
if (isWindows) {
|
|
6216
|
+
const result = spawnSync('where', ['offckb'], { encoding: 'utf8' });
|
|
6217
|
+
offckbPath = result.stdout.trim().split('\n')[0];
|
|
6218
|
+
}
|
|
6219
|
+
else {
|
|
6220
|
+
const result = spawnSync('which', ['offckb'], { encoding: 'utf8' });
|
|
6221
|
+
offckbPath = result.stdout.trim();
|
|
6222
|
+
}
|
|
6223
|
+
if (!offckbPath) {
|
|
6224
|
+
logger_1.logger.error('❌ Could not find offckb binary. Please ensure offckb is installed and in your PATH.');
|
|
6225
|
+
process.exit(1);
|
|
6226
|
+
}
|
|
6227
|
+
// Get the directory where offckb is located
|
|
6228
|
+
const offckbDir = path.dirname(offckbPath);
|
|
6229
|
+
const targetPath = path.join(offckbDir, binName);
|
|
6230
|
+
// Create the binary content
|
|
6231
|
+
let binContent;
|
|
6232
|
+
if (isWindows) {
|
|
6233
|
+
// Windows batch file
|
|
6234
|
+
binContent = `@echo off
|
|
6235
|
+
offckb debugger %*`;
|
|
6236
|
+
}
|
|
6237
|
+
else {
|
|
6238
|
+
// Unix shell script
|
|
6239
|
+
binContent = `#!/bin/sh
|
|
6240
|
+
exec offckb debugger "$@"`;
|
|
6241
|
+
}
|
|
6242
|
+
try {
|
|
6243
|
+
// Ensure directory exists
|
|
6244
|
+
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
|
|
6245
|
+
// Write the binary
|
|
6246
|
+
fs.writeFileSync(targetPath, binContent);
|
|
6247
|
+
// Make executable on Unix systems
|
|
6248
|
+
if (!isWindows) {
|
|
6249
|
+
fs.chmodSync(targetPath, '755');
|
|
6250
|
+
}
|
|
6251
|
+
logger_1.logger.info(`✅ Created ckb-debugger fallback at: ${targetPath}`);
|
|
6252
|
+
logger_1.logger.info(` This fallback uses WASM and calls: offckb debugger [args]`);
|
|
6253
|
+
logger_1.logger.info(` For better performance, install the real binary: cargo install --git https://github.com/nervosnetwork/ckb-standalone-debugger ckb-debugger`);
|
|
6254
|
+
logger_1.logger.info(` To uninstall the fallback binary: rm ${targetPath}`);
|
|
6255
|
+
}
|
|
6256
|
+
catch (error) {
|
|
6257
|
+
logger_1.logger.error(`❌ Failed to create ckb-debugger fallback: ${error.message}`);
|
|
6258
|
+
logger_1.logger.error(` Make sure you have write permissions to: ${path.dirname(targetPath)}`);
|
|
6259
|
+
process.exit(1);
|
|
6260
|
+
}
|
|
6261
|
+
}
|
|
6262
|
+
// Additional convenience methods that work with both native binary CLI and WASM
|
|
6263
|
+
static runWithArgs(args) {
|
|
6264
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6265
|
+
yield this.execute(args);
|
|
6266
|
+
});
|
|
6267
|
+
}
|
|
6268
|
+
static version() {
|
|
6269
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6270
|
+
if (this.shouldUseWasm()) {
|
|
6271
|
+
const result = yield this.getWasmDebugger().run(['--version']);
|
|
6272
|
+
return result;
|
|
6273
|
+
}
|
|
6274
|
+
else {
|
|
6275
|
+
const result = (0, child_process_1.spawnSync)('ckb-debugger', ['--version'], { encoding: 'utf8' });
|
|
6276
|
+
return {
|
|
6277
|
+
exitCode: result.status || 0,
|
|
6278
|
+
output: result.stdout,
|
|
6279
|
+
error: result.stderr,
|
|
6280
|
+
};
|
|
6281
|
+
}
|
|
6282
|
+
});
|
|
6283
|
+
}
|
|
6284
|
+
}
|
|
6285
|
+
exports.CKBDebugger = CKBDebugger;
|
|
6286
|
+
CKBDebugger.wasmDebugger = null;
|
|
6287
|
+
|
|
6288
|
+
|
|
6289
|
+
/***/ }),
|
|
6290
|
+
|
|
6291
|
+
/***/ 7020:
|
|
6292
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
6293
|
+
|
|
6294
|
+
"use strict";
|
|
6295
|
+
|
|
6296
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6297
|
+
if (k2 === undefined) k2 = k;
|
|
6298
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6299
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6300
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6301
|
+
}
|
|
6302
|
+
Object.defineProperty(o, k2, desc);
|
|
6303
|
+
}) : (function(o, m, k, k2) {
|
|
6304
|
+
if (k2 === undefined) k2 = k;
|
|
6305
|
+
o[k2] = m[k];
|
|
6306
|
+
}));
|
|
6307
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
6308
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6309
|
+
}) : function(o, v) {
|
|
6310
|
+
o["default"] = v;
|
|
6311
|
+
});
|
|
6312
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
6313
|
+
var ownKeys = function(o) {
|
|
6314
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
6315
|
+
var ar = [];
|
|
6316
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
6317
|
+
return ar;
|
|
6318
|
+
};
|
|
6319
|
+
return ownKeys(o);
|
|
6320
|
+
};
|
|
6321
|
+
return function (mod) {
|
|
6322
|
+
if (mod && mod.__esModule) return mod;
|
|
6323
|
+
var result = {};
|
|
6324
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6325
|
+
__setModuleDefault(result, mod);
|
|
6326
|
+
return result;
|
|
6327
|
+
};
|
|
6328
|
+
})();
|
|
6329
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6330
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5114
6331
|
};
|
|
5115
6332
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5116
|
-
exports.
|
|
6333
|
+
exports.CKBTui = void 0;
|
|
5117
6334
|
const child_process_1 = __nccwpck_require__(35317);
|
|
5118
6335
|
const path = __importStar(__nccwpck_require__(16928));
|
|
6336
|
+
const fs = __importStar(__nccwpck_require__(79896));
|
|
6337
|
+
const os = __importStar(__nccwpck_require__(70857));
|
|
6338
|
+
const crypto = __importStar(__nccwpck_require__(76982));
|
|
6339
|
+
const adm_zip_1 = __importDefault(__nccwpck_require__(83746));
|
|
5119
6340
|
const setting_1 = __nccwpck_require__(25546);
|
|
5120
|
-
const ckb_debugger_wasm_1 = __nccwpck_require__(52948);
|
|
5121
6341
|
const logger_1 = __nccwpck_require__(65370);
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
6342
|
+
const fs_1 = __nccwpck_require__(37293);
|
|
6343
|
+
const DOWNLOAD_TIMEOUT_MS = 120000;
|
|
6344
|
+
const EXTRACT_TIMEOUT_MS = 60000;
|
|
6345
|
+
// Strict semver regex: v<major>.<minor>.<patch> (no leading zeros on digits)
|
|
6346
|
+
const STRICT_VERSION_REGEX = /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
6347
|
+
class CKBTui {
|
|
6348
|
+
/**
|
|
6349
|
+
* Pure lookup — returns the expected binary path without triggering any
|
|
6350
|
+
* download or installation side effects. May return null if not yet computed.
|
|
6351
|
+
*/
|
|
6352
|
+
static getBinaryPath() {
|
|
6353
|
+
if (!this.binaryPath) {
|
|
6354
|
+
const settings = (0, setting_1.readSettings)();
|
|
6355
|
+
const binDir = this.resolveAndValidateBinDir(settings.tools.rootFolder);
|
|
6356
|
+
const binaryName = process.platform === 'win32' ? 'ckb-tui.exe' : 'ckb-tui';
|
|
6357
|
+
this.binaryPath = path.join(binDir, binaryName);
|
|
5130
6358
|
}
|
|
5131
|
-
return this.
|
|
6359
|
+
return this.binaryPath;
|
|
5132
6360
|
}
|
|
5133
6361
|
/**
|
|
5134
|
-
*
|
|
5135
|
-
*
|
|
6362
|
+
* Returns the binary path, downloading and installing if the binary
|
|
6363
|
+
* does not already exist.
|
|
5136
6364
|
*/
|
|
5137
|
-
static
|
|
5138
|
-
|
|
5139
|
-
if (
|
|
5140
|
-
|
|
5141
|
-
return true;
|
|
6365
|
+
static ensureInstalled() {
|
|
6366
|
+
const binaryPath = this.getBinaryPath();
|
|
6367
|
+
if (binaryPath && fs.existsSync(binaryPath)) {
|
|
6368
|
+
return binaryPath;
|
|
5142
6369
|
}
|
|
5143
|
-
//
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
}
|
|
5148
|
-
return false;
|
|
6370
|
+
// Reset and re-install
|
|
6371
|
+
this.binaryPath = null;
|
|
6372
|
+
this.installSync();
|
|
6373
|
+
return this.binaryPath;
|
|
5149
6374
|
}
|
|
5150
|
-
static
|
|
5151
|
-
|
|
5152
|
-
|
|
6375
|
+
static isInstalled() {
|
|
6376
|
+
try {
|
|
6377
|
+
const binPath = this.getBinaryPath();
|
|
6378
|
+
return binPath !== null && fs.existsSync(binPath);
|
|
5153
6379
|
}
|
|
5154
|
-
|
|
5155
|
-
logger_1.logger.debug('Using native ckb-debugger (better performance)');
|
|
6380
|
+
catch (_a) {
|
|
5156
6381
|
return false;
|
|
5157
6382
|
}
|
|
5158
|
-
else {
|
|
5159
|
-
logger_1.logger.debug('Native ckb-debugger not available, falling back to WASM version');
|
|
5160
|
-
return true;
|
|
5161
|
-
}
|
|
5162
|
-
}
|
|
5163
|
-
static execute(args) {
|
|
5164
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5165
|
-
if (this.shouldUseWasm()) {
|
|
5166
|
-
try {
|
|
5167
|
-
const result = yield this.getWasmDebugger().run(args);
|
|
5168
|
-
if (result.exitCode !== 0) {
|
|
5169
|
-
process.exit(result.exitCode);
|
|
5170
|
-
}
|
|
5171
|
-
}
|
|
5172
|
-
catch (error) {
|
|
5173
|
-
logger_1.logger.error('WASM debugger execution failed:', error);
|
|
5174
|
-
process.exit(1);
|
|
5175
|
-
}
|
|
5176
|
-
}
|
|
5177
|
-
else {
|
|
5178
|
-
const command = `ckb-debugger ${args.join(' ')}`;
|
|
5179
|
-
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
5180
|
-
}
|
|
5181
|
-
});
|
|
5182
6383
|
}
|
|
5183
|
-
static
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
yield this.execute(args);
|
|
5187
|
-
});
|
|
6384
|
+
static run(args = []) {
|
|
6385
|
+
const binaryPath = this.ensureInstalled();
|
|
6386
|
+
return (0, child_process_1.spawnSync)(binaryPath, args, { stdio: 'inherit' });
|
|
5188
6387
|
}
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
}
|
|
6388
|
+
// --- private helpers ---
|
|
6389
|
+
/**
|
|
6390
|
+
* Resolve and validate that the configured rootFolder is under the
|
|
6391
|
+
* OffCKB data directory. Rejects paths that resolve outside.
|
|
6392
|
+
*/
|
|
6393
|
+
static resolveAndValidateBinDir(configuredRoot) {
|
|
6394
|
+
const resolved = path.resolve(configuredRoot);
|
|
6395
|
+
const resolvedData = path.resolve(setting_1.dataPath);
|
|
6396
|
+
// Require the resolved path to be within the resolved data directory
|
|
6397
|
+
const relative = path.relative(resolvedData, resolved);
|
|
6398
|
+
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
6399
|
+
throw new Error(`tools.rootFolder ("${configuredRoot}") resolves outside the OffCKB data directory ` +
|
|
6400
|
+
`("${resolvedData}"). For security, tool binaries must be stored under the data path.`);
|
|
6401
|
+
}
|
|
6402
|
+
return resolved;
|
|
5203
6403
|
}
|
|
5204
|
-
static
|
|
5205
|
-
|
|
5206
|
-
|
|
6404
|
+
static validateVersion(version) {
|
|
6405
|
+
if (!STRICT_VERSION_REGEX.test(version)) {
|
|
6406
|
+
throw new Error(`Invalid version format: "${version}". Expected format: vX.Y.Z (e.g., v0.1.3)`);
|
|
6407
|
+
}
|
|
5207
6408
|
}
|
|
5208
|
-
static
|
|
5209
|
-
const
|
|
5210
|
-
|
|
5211
|
-
|
|
6409
|
+
static getAssetName() {
|
|
6410
|
+
const platform = process.platform;
|
|
6411
|
+
const arch = process.arch;
|
|
6412
|
+
if (platform === 'darwin') {
|
|
6413
|
+
if (arch !== 'arm64') {
|
|
6414
|
+
throw new Error(`Unsupported architecture for macOS: ${arch}. Only Apple Silicon (arm64) is supported.`);
|
|
6415
|
+
}
|
|
6416
|
+
return 'ckb-tui-with-node-macos-aarch64.tar.gz';
|
|
5212
6417
|
}
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
if (version < settings.tools.ckbDebugger.minVersion) {
|
|
5217
|
-
return false;
|
|
6418
|
+
else if (platform === 'linux') {
|
|
6419
|
+
if (arch !== 'x64') {
|
|
6420
|
+
throw new Error(`Unsupported architecture for Linux: ${arch}. Only x86_64 is supported.`);
|
|
5218
6421
|
}
|
|
5219
|
-
return
|
|
6422
|
+
return 'ckb-tui-with-node-linux-amd64.tar.gz';
|
|
5220
6423
|
}
|
|
5221
|
-
|
|
5222
|
-
|
|
6424
|
+
else if (platform === 'win32') {
|
|
6425
|
+
if (arch !== 'x64') {
|
|
6426
|
+
throw new Error(`Unsupported architecture for Windows: ${arch}. Only x86_64 is supported.`);
|
|
6427
|
+
}
|
|
6428
|
+
return 'ckb-tui-with-node-windows-amd64.zip';
|
|
5223
6429
|
}
|
|
6430
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
5224
6431
|
}
|
|
5225
|
-
|
|
5226
|
-
|
|
6432
|
+
/**
|
|
6433
|
+
* Synchronously download and install the ckb-tui binary.
|
|
6434
|
+
* Uses spawnSync with array arguments (no shell interpolation) for security.
|
|
6435
|
+
*/
|
|
6436
|
+
static installSync() {
|
|
6437
|
+
const settings = (0, setting_1.readSettings)();
|
|
6438
|
+
const version = settings.tools.ckbTui.version;
|
|
6439
|
+
this.validateVersion(version);
|
|
6440
|
+
const assetName = this.getAssetName();
|
|
6441
|
+
const binDir = this.resolveAndValidateBinDir(settings.tools.rootFolder);
|
|
6442
|
+
const binaryName = process.platform === 'win32' ? 'ckb-tui.exe' : 'ckb-tui';
|
|
6443
|
+
this.binaryPath = path.join(binDir, binaryName);
|
|
6444
|
+
const downloadUrl = `https://github.com/Officeyutong/ckb-tui/releases/download/${version}/${assetName}`;
|
|
6445
|
+
// Ensure the target directory exists
|
|
6446
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
6447
|
+
// Use a temp directory for atomic download & extraction
|
|
6448
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'offckb-ckb-tui-'));
|
|
6449
|
+
const archivePath = path.join(tempDir, assetName);
|
|
5227
6450
|
try {
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
6451
|
+
// 1. Download
|
|
6452
|
+
logger_1.logger.info(`Downloading ckb-tui from ${downloadUrl}...`);
|
|
6453
|
+
const curlResult = (0, child_process_1.spawnSync)('curl', ['-fsSL', '--max-time', '300', '-o', archivePath, downloadUrl], {
|
|
6454
|
+
stdio: 'inherit',
|
|
6455
|
+
timeout: DOWNLOAD_TIMEOUT_MS,
|
|
6456
|
+
});
|
|
6457
|
+
if (curlResult.error) {
|
|
6458
|
+
throw new Error(`Failed to download ckb-tui: ${curlResult.error.message}`);
|
|
6459
|
+
}
|
|
6460
|
+
if (curlResult.status !== 0) {
|
|
6461
|
+
throw new Error(`curl exited with code ${curlResult.status}`);
|
|
6462
|
+
}
|
|
6463
|
+
// 2. Verify checksum (best-effort: warns if checksum file is unavailable)
|
|
6464
|
+
this.verifyChecksum(version, assetName, archivePath);
|
|
6465
|
+
// 3. Extract to temp directory
|
|
6466
|
+
logger_1.logger.info('Extracting...');
|
|
6467
|
+
const extractDir = path.join(tempDir, 'extracted');
|
|
6468
|
+
fs.mkdirSync(extractDir, { recursive: true });
|
|
6469
|
+
this.extractArchive(archivePath, extractDir);
|
|
6470
|
+
// 4. Locate the extracted binary
|
|
6471
|
+
const extractedBinary = (0, fs_1.findFileInFolder)(extractDir, binaryName);
|
|
6472
|
+
if (!extractedBinary) {
|
|
6473
|
+
throw new Error(`ckb-tui binary ("${binaryName}") was not found after extraction.`);
|
|
6474
|
+
}
|
|
6475
|
+
// 5. Atomically move to the final location
|
|
6476
|
+
fs.renameSync(extractedBinary, this.binaryPath);
|
|
6477
|
+
// 6. Make executable on Unix
|
|
6478
|
+
if (process.platform !== 'win32') {
|
|
6479
|
+
fs.chmodSync(this.binaryPath, 0o755);
|
|
6480
|
+
}
|
|
6481
|
+
logger_1.logger.info('ckb-tui installed successfully.');
|
|
5231
6482
|
}
|
|
5232
6483
|
catch (error) {
|
|
5233
|
-
|
|
5234
|
-
|
|
6484
|
+
// Reset cached path on failure so a subsequent call retries
|
|
6485
|
+
this.binaryPath = null;
|
|
6486
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
6487
|
+
logger_1.logger.error('Failed to download/install ckb-tui:', message, '\nPlease check your network connectivity, verify that the specified version exists in the releases, ' +
|
|
6488
|
+
'and ensure you have sufficient file system permissions.');
|
|
6489
|
+
throw error;
|
|
6490
|
+
}
|
|
6491
|
+
finally {
|
|
6492
|
+
// Clean up the temp directory
|
|
6493
|
+
try {
|
|
6494
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
6495
|
+
}
|
|
6496
|
+
catch (_a) {
|
|
6497
|
+
// Best-effort cleanup — temp dir will be cleaned by the OS eventually
|
|
6498
|
+
}
|
|
5235
6499
|
}
|
|
5236
6500
|
}
|
|
5237
6501
|
/**
|
|
5238
|
-
*
|
|
5239
|
-
*
|
|
5240
|
-
*
|
|
5241
|
-
*
|
|
6502
|
+
* Best-effort SHA-256 checksum verification.
|
|
6503
|
+
* Downloads the checksum file published alongside the release asset and
|
|
6504
|
+
* verifies the downloaded archive. Logs a warning (but does not fail) if
|
|
6505
|
+
* the checksum file is unavailable — this maintains compatibility while
|
|
6506
|
+
* the upstream project adopts checksum publishing.
|
|
5242
6507
|
*/
|
|
5243
|
-
static
|
|
5244
|
-
const
|
|
5245
|
-
const
|
|
5246
|
-
const
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
if (
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
else {
|
|
5255
|
-
const result = spawnSync('which', ['offckb'], { encoding: 'utf8' });
|
|
5256
|
-
offckbPath = result.stdout.trim();
|
|
5257
|
-
}
|
|
5258
|
-
if (!offckbPath) {
|
|
5259
|
-
logger_1.logger.error('❌ Could not find offckb binary. Please ensure offckb is installed and in your PATH.');
|
|
5260
|
-
process.exit(1);
|
|
5261
|
-
}
|
|
5262
|
-
// Get the directory where offckb is located
|
|
5263
|
-
const offckbDir = path.dirname(offckbPath);
|
|
5264
|
-
const targetPath = path.join(offckbDir, binName);
|
|
5265
|
-
// Create the binary content
|
|
5266
|
-
let binContent;
|
|
5267
|
-
if (isWindows) {
|
|
5268
|
-
// Windows batch file
|
|
5269
|
-
binContent = `@echo off
|
|
5270
|
-
offckb debugger %*`;
|
|
5271
|
-
}
|
|
5272
|
-
else {
|
|
5273
|
-
// Unix shell script
|
|
5274
|
-
binContent = `#!/bin/sh
|
|
5275
|
-
exec offckb debugger "$@"`;
|
|
6508
|
+
static verifyChecksum(version, assetName, archivePath) {
|
|
6509
|
+
const checksumUrl = `https://github.com/Officeyutong/ckb-tui/releases/download/${version}/checksums-sha256.txt`;
|
|
6510
|
+
const checksumPath = path.join(path.dirname(archivePath), 'checksums-sha256.txt');
|
|
6511
|
+
const fetchResult = (0, child_process_1.spawnSync)('curl', ['-fsSL', '--max-time', '30', '-o', checksumPath, checksumUrl], {
|
|
6512
|
+
stdio: 'pipe',
|
|
6513
|
+
timeout: 30000,
|
|
6514
|
+
});
|
|
6515
|
+
if (fetchResult.status !== 0) {
|
|
6516
|
+
logger_1.logger.warn(`SHA-256 checksum file not available for version ${version}. ` +
|
|
6517
|
+
'Skipping integrity verification. Consider asking the upstream maintainer to publish checksum files.');
|
|
6518
|
+
return;
|
|
5276
6519
|
}
|
|
5277
6520
|
try {
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
if (!isWindows) {
|
|
5284
|
-
fs.chmodSync(targetPath, '755');
|
|
6521
|
+
const checksumContent = fs.readFileSync(checksumPath, 'utf8');
|
|
6522
|
+
const expectedHash = this.parseChecksumFile(checksumContent, assetName);
|
|
6523
|
+
if (!expectedHash) {
|
|
6524
|
+
logger_1.logger.warn(`Checksum entry for "${assetName}" not found in checksums file. Skipping verification.`);
|
|
6525
|
+
return;
|
|
5285
6526
|
}
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
6527
|
+
const actualHash = crypto.createHash('sha256').update(fs.readFileSync(archivePath)).digest('hex');
|
|
6528
|
+
if (actualHash !== expectedHash) {
|
|
6529
|
+
throw new Error(`SHA-256 checksum mismatch for ${assetName}.\n` +
|
|
6530
|
+
`Expected: ${expectedHash}\nActual: ${actualHash}\n` +
|
|
6531
|
+
'The downloaded file may be corrupted or tampered with.');
|
|
6532
|
+
}
|
|
6533
|
+
logger_1.logger.info('SHA-256 checksum verified successfully.');
|
|
5290
6534
|
}
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
6535
|
+
finally {
|
|
6536
|
+
try {
|
|
6537
|
+
fs.unlinkSync(checksumPath);
|
|
6538
|
+
}
|
|
6539
|
+
catch (_a) {
|
|
6540
|
+
// Best effort
|
|
6541
|
+
}
|
|
5295
6542
|
}
|
|
5296
6543
|
}
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
6544
|
+
/**
|
|
6545
|
+
* Parse a standard SHA-256 checksum file (format: "<hash> <filename>" per line)
|
|
6546
|
+
* and return the hex hash for the given asset name, or null if not found.
|
|
6547
|
+
*/
|
|
6548
|
+
static parseChecksumFile(content, assetName) {
|
|
6549
|
+
for (const line of content.split('\n')) {
|
|
6550
|
+
const trimmed = line.trim();
|
|
6551
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
6552
|
+
continue;
|
|
6553
|
+
const match = trimmed.match(/^([0-9a-fA-F]{64})\s+[*]?(.+)$/);
|
|
6554
|
+
if (match && match[2] === assetName) {
|
|
6555
|
+
return match[1].toLowerCase();
|
|
6556
|
+
}
|
|
6557
|
+
}
|
|
6558
|
+
return null;
|
|
5302
6559
|
}
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
6560
|
+
/**
|
|
6561
|
+
* Extract a downloaded archive to the given directory.
|
|
6562
|
+
* Uses AdmZip for .zip files (Node-native, no shell) and spawnSync with array
|
|
6563
|
+
* arguments for .tar.gz (no shell interpolation).
|
|
6564
|
+
*/
|
|
6565
|
+
static extractArchive(archivePath, extractDir) {
|
|
6566
|
+
if (archivePath.endsWith('.tar.gz')) {
|
|
6567
|
+
const result = (0, child_process_1.spawnSync)('tar', ['-xzf', archivePath, '-C', extractDir], {
|
|
6568
|
+
stdio: 'inherit',
|
|
6569
|
+
timeout: EXTRACT_TIMEOUT_MS,
|
|
6570
|
+
});
|
|
6571
|
+
if (result.error) {
|
|
6572
|
+
throw new Error(`tar extraction failed: ${result.error.message}`);
|
|
5308
6573
|
}
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
return {
|
|
5312
|
-
exitCode: result.status || 0,
|
|
5313
|
-
output: result.stdout,
|
|
5314
|
-
error: result.stderr,
|
|
5315
|
-
};
|
|
6574
|
+
if (result.status !== 0) {
|
|
6575
|
+
throw new Error(`tar exited with code ${result.status}`);
|
|
5316
6576
|
}
|
|
5317
|
-
}
|
|
6577
|
+
}
|
|
6578
|
+
else if (archivePath.endsWith('.zip')) {
|
|
6579
|
+
try {
|
|
6580
|
+
const zip = new adm_zip_1.default(archivePath);
|
|
6581
|
+
zip.extractAllTo(extractDir, true);
|
|
6582
|
+
}
|
|
6583
|
+
catch (error) {
|
|
6584
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
6585
|
+
throw new Error(`ZIP extraction failed: ${message}`);
|
|
6586
|
+
}
|
|
6587
|
+
}
|
|
6588
|
+
else {
|
|
6589
|
+
throw new Error(`Unsupported archive format: ${path.extname(archivePath)}`);
|
|
6590
|
+
}
|
|
5318
6591
|
}
|
|
5319
6592
|
}
|
|
5320
|
-
exports.
|
|
5321
|
-
|
|
6593
|
+
exports.CKBTui = CKBTui;
|
|
6594
|
+
CKBTui.binaryPath = null;
|
|
5322
6595
|
|
|
5323
6596
|
|
|
5324
6597
|
/***/ }),
|
|
@@ -7749,15 +9022,25 @@ function getSubfolders(folderPath) {
|
|
|
7749
9022
|
/***/ }),
|
|
7750
9023
|
|
|
7751
9024
|
/***/ 27814:
|
|
7752
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
9025
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
7753
9026
|
|
|
7754
9027
|
"use strict";
|
|
7755
9028
|
|
|
7756
9029
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7757
9030
|
exports.buildTestnetTxLink = buildTestnetTxLink;
|
|
9031
|
+
exports.logTxSuccess = logTxSuccess;
|
|
9032
|
+
const logger_1 = __nccwpck_require__(65370);
|
|
7758
9033
|
function buildTestnetTxLink(txHash) {
|
|
7759
9034
|
return `https://pudge.explorer.nervos.org/transaction/${txHash}`;
|
|
7760
9035
|
}
|
|
9036
|
+
function logTxSuccess(network, txHash, action) {
|
|
9037
|
+
if (network === 'testnet') {
|
|
9038
|
+
logger_1.logger.info(`Successfully ${action}, check ${buildTestnetTxLink(txHash)} for details.`);
|
|
9039
|
+
}
|
|
9040
|
+
else {
|
|
9041
|
+
logger_1.logger.info(`Successfully ${action}, txHash:`, txHash);
|
|
9042
|
+
}
|
|
9043
|
+
}
|
|
7761
9044
|
|
|
7762
9045
|
|
|
7763
9046
|
/***/ }),
|
|
@@ -7819,6 +9102,7 @@ class UnifiedLogger {
|
|
|
7819
9102
|
constructor(options = {}) {
|
|
7820
9103
|
this.enableColors = options.enableColors !== false;
|
|
7821
9104
|
this.showLevel = options.showLevel !== false;
|
|
9105
|
+
this.jsonMode = options.jsonMode === true;
|
|
7822
9106
|
// Create Winston logger with custom format and levels
|
|
7823
9107
|
this.logger = winston_1.default.createLogger({
|
|
7824
9108
|
level: options.level || node_process_1.default.env.LOG_LEVEL || 'info',
|
|
@@ -7832,17 +9116,33 @@ class UnifiedLogger {
|
|
|
7832
9116
|
format: winston_1.default.format.combine(winston_1.default.format.timestamp(), winston_1.default.format.errors({ stack: true }), winston_1.default.format.printf(({ level, message, timestamp }) => {
|
|
7833
9117
|
return this.formatMessage(level, message, timestamp);
|
|
7834
9118
|
})),
|
|
7835
|
-
transports: [
|
|
9119
|
+
transports: options.transports || [
|
|
7836
9120
|
new winston_1.default.transports.Console({
|
|
7837
9121
|
stderrLevels: ['error', 'warn'],
|
|
7838
9122
|
}),
|
|
7839
9123
|
],
|
|
7840
9124
|
});
|
|
7841
9125
|
}
|
|
9126
|
+
/**
|
|
9127
|
+
* Toggle JSON output mode. When enabled, every log line is emitted as a
|
|
9128
|
+
* structured JSON object, which is easier for agents and scripts to parse.
|
|
9129
|
+
*/
|
|
9130
|
+
setJsonMode(enabled) {
|
|
9131
|
+
this.jsonMode = enabled;
|
|
9132
|
+
}
|
|
7842
9133
|
/**
|
|
7843
9134
|
* Format the message with appropriate colors and structure
|
|
7844
9135
|
*/
|
|
7845
|
-
formatMessage(level, message,
|
|
9136
|
+
formatMessage(level, message, timestamp) {
|
|
9137
|
+
// Agent-friendly JSON output: one JSON object per log line
|
|
9138
|
+
if (this.jsonMode) {
|
|
9139
|
+
const normalizedMessage = Array.isArray(message) ? message.join('\n') : String(message);
|
|
9140
|
+
return JSON.stringify({
|
|
9141
|
+
level,
|
|
9142
|
+
message: normalizedMessage,
|
|
9143
|
+
timestamp,
|
|
9144
|
+
});
|
|
9145
|
+
}
|
|
7846
9146
|
// If showLevel is false, return just the message
|
|
7847
9147
|
if (!this.showLevel) {
|
|
7848
9148
|
if (Array.isArray(message)) {
|
|
@@ -7925,6 +9225,12 @@ class UnifiedLogger {
|
|
|
7925
9225
|
* Log a message with the specified level
|
|
7926
9226
|
*/
|
|
7927
9227
|
log(level, message) {
|
|
9228
|
+
// In JSON mode, emit multi-line messages as a single structured log entry
|
|
9229
|
+
// so agents can parse one complete JSON object per line.
|
|
9230
|
+
if (this.jsonMode && Array.isArray(message)) {
|
|
9231
|
+
this.logger.log(level, message.join('\n'));
|
|
9232
|
+
return;
|
|
9233
|
+
}
|
|
7928
9234
|
if (Array.isArray(message)) {
|
|
7929
9235
|
message.forEach((line) => this.logger.log(level, line));
|
|
7930
9236
|
}
|
|
@@ -8091,6 +9397,11 @@ exports.isValidNetworkString = isValidNetworkString;
|
|
|
8091
9397
|
exports.validateNetworkOpt = validateNetworkOpt;
|
|
8092
9398
|
exports.isValidVersion = isValidVersion;
|
|
8093
9399
|
exports.normalizePrivKey = normalizePrivKey;
|
|
9400
|
+
exports.isValidUdtKind = isValidUdtKind;
|
|
9401
|
+
exports.validateUdtKind = validateUdtKind;
|
|
9402
|
+
exports.validateUdtAmount = validateUdtAmount;
|
|
9403
|
+
exports.validateHexString = validateHexString;
|
|
9404
|
+
exports.validateUdtTypeArgs = validateUdtTypeArgs;
|
|
8094
9405
|
const path_1 = __importDefault(__nccwpck_require__(16928));
|
|
8095
9406
|
const fs_1 = __importDefault(__nccwpck_require__(79896));
|
|
8096
9407
|
const base_1 = __nccwpck_require__(69951);
|
|
@@ -8179,6 +9490,46 @@ function normalizePrivKey(privKey) {
|
|
|
8179
9490
|
// Return the formally strictly padded ckb format `0x` string
|
|
8180
9491
|
return '0x' + key;
|
|
8181
9492
|
}
|
|
9493
|
+
function isValidUdtKind(kind) {
|
|
9494
|
+
return kind === 'sudt' || kind === 'xudt';
|
|
9495
|
+
}
|
|
9496
|
+
function validateUdtKind(kind) {
|
|
9497
|
+
if (!kind) {
|
|
9498
|
+
throw new Error('UDT kind is required');
|
|
9499
|
+
}
|
|
9500
|
+
if (!isValidUdtKind(kind)) {
|
|
9501
|
+
throw new Error(`invalid UDT kind "${kind}", must be "sudt" or "xudt"`);
|
|
9502
|
+
}
|
|
9503
|
+
}
|
|
9504
|
+
const U128_MAX = (BigInt(1) << BigInt(128)) - BigInt(1);
|
|
9505
|
+
function validateUdtAmount(amount) {
|
|
9506
|
+
if (!/^\d+$/.test(amount)) {
|
|
9507
|
+
throw new Error(`invalid UDT amount "${amount}", must be a non-negative decimal integer`);
|
|
9508
|
+
}
|
|
9509
|
+
const value = BigInt(amount);
|
|
9510
|
+
if (value > U128_MAX) {
|
|
9511
|
+
throw new Error(`UDT amount exceeds 128-bit max: ${amount}`);
|
|
9512
|
+
}
|
|
9513
|
+
return value;
|
|
9514
|
+
}
|
|
9515
|
+
const HEX_REGEX = /^0x[0-9a-fA-F]*$/;
|
|
9516
|
+
function validateHexString(value, name) {
|
|
9517
|
+
if (!value || !HEX_REGEX.test(value)) {
|
|
9518
|
+
throw new Error(`invalid ${name} "${value}", must be a hex string starting with 0x`);
|
|
9519
|
+
}
|
|
9520
|
+
return value;
|
|
9521
|
+
}
|
|
9522
|
+
function validateUdtTypeArgs(kind, typeArgs) {
|
|
9523
|
+
const hex = validateHexString(typeArgs, 'type args');
|
|
9524
|
+
const byteLength = (hex.length - 2) / 2;
|
|
9525
|
+
if (kind === 'sudt' && byteLength !== 20) {
|
|
9526
|
+
throw new Error(`invalid SUDT type args length: expected 20 bytes, got ${byteLength}`);
|
|
9527
|
+
}
|
|
9528
|
+
if (kind === 'xudt' && byteLength !== 32) {
|
|
9529
|
+
throw new Error(`invalid xUDT type args length: expected 32 bytes, got ${byteLength}`);
|
|
9530
|
+
}
|
|
9531
|
+
return hex;
|
|
9532
|
+
}
|
|
8182
9533
|
|
|
8183
9534
|
|
|
8184
9535
|
/***/ }),
|
|
@@ -125977,13 +127328,13 @@ if (process.platform === 'linux') {
|
|
|
125977
127328
|
|
|
125978
127329
|
/***/ }),
|
|
125979
127330
|
|
|
125980
|
-
/***/
|
|
127331
|
+
/***/ 80228:
|
|
125981
127332
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
125982
127333
|
|
|
125983
127334
|
"use strict";
|
|
125984
|
-
var d=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var We=d(C=>{"use strict";var yo=C&&C.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(C,"__esModule",{value:!0});C.Minipass=C.isWritable=C.isReadable=C.isStream=void 0;var Br=typeof process=="object"&&process?process:{stdout:null,stderr:null},es=__nccwpck_require__(78474),xr=yo(__nccwpck_require__(57075)),Eo=__nccwpck_require__(46193),bo=s=>!!s&&typeof s=="object"&&(s instanceof Wt||s instanceof xr.default||(0,C.isReadable)(s)||(0,C.isWritable)(s));C.isStream=bo;var So=s=>!!s&&typeof s=="object"&&s instanceof es.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==xr.default.Writable.prototype.pipe;C.isReadable=So;var go=s=>!!s&&typeof s=="object"&&s instanceof es.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function";C.isWritable=go;var le=Symbol("EOF"),ue=Symbol("maybeEmitEnd"),_e=Symbol("emittedEnd"),zt=Symbol("emittingEnd"),ft=Symbol("emittedError"),kt=Symbol("closed"),zr=Symbol("read"),jt=Symbol("flush"),kr=Symbol("flushChunk"),K=Symbol("encoding"),Ue=Symbol("decoder"),R=Symbol("flowing"),dt=Symbol("paused"),qe=Symbol("resume"),O=Symbol("buffer"),I=Symbol("pipes"),v=Symbol("bufferLength"),Ki=Symbol("bufferPush"),xt=Symbol("bufferShift"),N=Symbol("objectMode"),y=Symbol("destroyed"),Vi=Symbol("error"),$i=Symbol("emitData"),jr=Symbol("emitEnd"),Xi=Symbol("emitEnd2"),J=Symbol("async"),Qi=Symbol("abort"),Ut=Symbol("aborted"),mt=Symbol("signal"),Pe=Symbol("dataListeners"),k=Symbol("discarded"),pt=s=>Promise.resolve().then(s),Ro=s=>s(),Oo=s=>s==="end"||s==="finish"||s==="prefinish",vo=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,To=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),qt=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[qe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ji=class extends qt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>this.dest.emit("error",r),e.on("error",this.proxyErrors)}},Do=s=>!!s.objectMode,Po=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",Wt=class extends es.EventEmitter{[R]=!1;[dt]=!1;[I]=[];[O]=[];[N];[K];[J];[Ue];[le]=!1;[_e]=!1;[zt]=!1;[kt]=!1;[ft]=null;[v]=0;[y]=!1;[mt];[Ut]=!1;[Pe]=0;[k]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Do(t)?(this[N]=!0,this[K]=null):Po(t)?(this[K]=t.encoding,this[N]=!1):(this[N]=!1,this[K]=null),this[J]=!!t.async,this[Ue]=this[K]?new Eo.StringDecoder(this[K]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[O]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[I]});let{signal:i}=t;i&&(this[mt]=i,i.aborted?this[Qi]():i.addEventListener("abort",()=>this[Qi]()))}get bufferLength(){return this[v]}get encoding(){return this[K]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[N]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[J]}set async(e){this[J]=this[J]||!!e}[Qi](){this[Ut]=!0,this.emit("abort",this[mt]?.reason),this.destroy(this[mt]?.reason)}get aborted(){return this[Ut]}set aborted(e){}write(e,t,i){if(this[Ut])return!1;if(this[le])throw new Error("write after end");if(this[y])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[J]?pt:Ro;if(!this[N]&&!Buffer.isBuffer(e)){if(To(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(vo(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[R]&&this[v]!==0&&this[jt](!0),this[R]?this.emit("data",e):this[Ki](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[R]):e.length?(typeof e=="string"&&!(t===this[K]&&!this[Ue]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[K]&&(e=this[Ue].write(e)),this[R]&&this[v]!==0&&this[jt](!0),this[R]?this.emit("data",e):this[Ki](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[R]):(this[v]!==0&&this.emit("readable"),i&&r(i),this[R])}read(e){if(this[y])return null;if(this[k]=!1,this[v]===0||e===0||e&&e>this[v])return this[ue](),null;this[N]&&(e=null),this[O].length>1&&!this[N]&&(this[O]=[this[K]?this[O].join(""):Buffer.concat(this[O],this[v])]);let t=this[zr](e||null,this[O][0]);return this[ue](),t}[zr](e,t){if(this[N])this[xt]();else{let i=t;e===i.length||e===null?this[xt]():typeof i=="string"?(this[O][0]=i.slice(e),t=i.slice(0,e),this[v]-=e):(this[O][0]=i.subarray(e),t=i.subarray(0,e),this[v]-=e)}return this.emit("data",t),!this[O].length&&!this[le]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[le]=!0,this.writable=!1,(this[R]||!this[dt])&&this[ue](),this}[qe](){this[y]||(!this[Pe]&&!this[I].length&&(this[k]=!0),this[dt]=!1,this[R]=!0,this.emit("resume"),this[O].length?this[jt]():this[le]?this[ue]():this.emit("drain"))}resume(){return this[qe]()}pause(){this[R]=!1,this[dt]=!0,this[k]=!1}get destroyed(){return this[y]}get flowing(){return this[R]}get paused(){return this[dt]}[Ki](e){this[N]?this[v]+=1:this[v]+=e.length,this[O].push(e)}[xt](){return this[N]?this[v]-=1:this[v]-=this[O][0].length,this[O].shift()}[jt](e=!1){do;while(this[kr](this[xt]())&&this[O].length);!e&&!this[O].length&&!this[le]&&this.emit("drain")}[kr](e){return this.emit("data",e),this[R]}pipe(e,t){if(this[y])return e;this[k]=!1;let i=this[_e];return t=t||{},e===Br.stdout||e===Br.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[I].push(t.proxyErrors?new Ji(this,e,t):new qt(this,e,t)),this[J]?pt(()=>this[qe]()):this[qe]()),e}unpipe(e){let t=this[I].find(i=>i.dest===e);t&&(this[I].length===1?(this[R]&&this[Pe]===0&&(this[R]=!1),this[I]=[]):this[I].splice(this[I].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[k]=!1,this[Pe]++,!this[I].length&&!this[R]&&this[qe]();else if(e==="readable"&&this[v]!==0)super.emit("readable");else if(Oo(e)&&this[_e])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ft]){let r=t;this[J]?pt(()=>r.call(this,this[ft])):r.call(this,this[ft])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Pe]=this.listeners("data").length,this[Pe]===0&&!this[k]&&!this[I].length&&(this[R]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Pe]=0,!this[k]&&!this[I].length&&(this[R]=!1)),t}get emittedEnd(){return this[_e]}[ue](){!this[zt]&&!this[_e]&&!this[y]&&this[O].length===0&&this[le]&&(this[zt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[kt]&&this.emit("close"),this[zt]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==y&&this[y])return!1;if(e==="data")return!this[N]&&!i?!1:this[J]?(pt(()=>this[$i](i)),!0):this[$i](i);if(e==="end")return this[jr]();if(e==="close"){if(this[kt]=!0,!this[_e]&&!this[y])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[ft]=i,super.emit(Vi,i);let n=!this[mt]||this.listeners("error").length?super.emit("error",i):!1;return this[ue](),n}else if(e==="resume"){let n=super.emit("resume");return this[ue](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let r=super.emit(e,...t);return this[ue](),r}[$i](e){for(let i of this[I])i.dest.write(e)===!1&&this.pause();let t=this[k]?!1:super.emit("data",e);return this[ue](),t}[jr](){return this[_e]?!1:(this[_e]=!0,this.readable=!1,this[J]?(pt(()=>this[Xi]()),!0):this[Xi]())}[Xi](){if(this[Ue]){let t=this[Ue].end();if(t){for(let i of this[I])i.dest.write(t);this[k]||super.emit("data",t)}}for(let t of this[I])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[N]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[N]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[K]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(y,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[k]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[le])return t();let n,o,a=c=>{this.off("data",h),this.off("end",l),this.off(y,u),t(),o(c)},h=c=>{this.off("error",a),this.off("end",l),this.off(y,u),this.pause(),n({value:c,done:!!this[le]})},l=()=>{this.off("error",a),this.off("data",h),this.off(y,u),t(),n({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((c,E)=>{o=E,n=c,this.once(y,u),this.once("error",a),this.once("end",l),this.once("data",h)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[k]=!1;let e=!1,t=()=>(this.pause(),this.off(Vi,t),this.off(y,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(Vi,t),this.once(y,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[y])return e?this.emit("error",e):this.emit(y),this;this[y]=!0,this[k]=!0,this[O].length=0,this[v]=0;let t=this;return typeof t.close=="function"&&!this[kt]&&t.close(),e?this.emit("error",e):this.emit(y),this}static get isStream(){return C.isStream}};C.Minipass=Wt});var Ke=d(W=>{"use strict";var Ur=W&&W.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(W,"__esModule",{value:!0});W.WriteStreamSync=W.WriteStream=W.ReadStreamSync=W.ReadStream=void 0;var No=Ur(__nccwpck_require__(24434)),B=Ur(__nccwpck_require__(79896)),Mo=We(),Lo=B.default.writev,ye=Symbol("_autoClose"),$=Symbol("_close"),_t=Symbol("_ended"),p=Symbol("_fd"),ts=Symbol("_finished"),fe=Symbol("_flags"),is=Symbol("_flush"),os=Symbol("_handleChunk"),as=Symbol("_makeBuf"),yt=Symbol("_mode"),Ht=Symbol("_needDrain"),Ge=Symbol("_onerror"),Ye=Symbol("_onopen"),ss=Symbol("_onread"),He=Symbol("_onwrite"),Ee=Symbol("_open"),V=Symbol("_path"),we=Symbol("_pos"),ee=Symbol("_queue"),Ze=Symbol("_read"),rs=Symbol("_readSize"),ce=Symbol("_reading"),wt=Symbol("_remain"),ns=Symbol("_size"),Zt=Symbol("_write"),Ne=Symbol("_writing"),Gt=Symbol("_defaultFlag"),Me=Symbol("_errored"),Yt=class extends Mo.Minipass{[Me]=!1;[p];[V];[rs];[ce]=!1;[ns];[wt];[ye];constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Me]=!1,this[p]=typeof t.fd=="number"?t.fd:void 0,this[V]=e,this[rs]=t.readSize||16*1024*1024,this[ce]=!1,this[ns]=typeof t.size=="number"?t.size:1/0,this[wt]=this[ns],this[ye]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[p]=="number"?this[Ze]():this[Ee]()}get fd(){return this[p]}get path(){return this[V]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ee](){B.default.open(this[V],"r",(e,t)=>this[Ye](e,t))}[Ye](e,t){e?this[Ge](e):(this[p]=t,this.emit("open",t),this[Ze]())}[as](){return Buffer.allocUnsafe(Math.min(this[rs],this[wt]))}[Ze](){if(!this[ce]){this[ce]=!0;let e=this[as]();if(e.length===0)return process.nextTick(()=>this[ss](null,0,e));B.default.read(this[p],e,0,e.length,null,(t,i,r)=>this[ss](t,i,r))}}[ss](e,t,i){this[ce]=!1,e?this[Ge](e):this[os](t,i)&&this[Ze]()}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,B.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ge](e){this[ce]=!0,this[$](),this.emit("error",e)}[os](e,t){let i=!1;return this[wt]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[wt]<=0)&&(i=!1,this[$](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[p]=="number"&&this[Ze](),!1;case"error":return this[Me]?!1:(this[Me]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};W.ReadStream=Yt;var hs=class extends Yt{[Ee](){let e=!0;try{this[Ye](null,B.default.openSync(this[V],"r")),e=!1}finally{e&&this[$]()}}[Ze](){let e=!0;try{if(!this[ce]){this[ce]=!0;do{let t=this[as](),i=t.length===0?0:B.default.readSync(this[p],t,0,t.length,null);if(!this[os](i,t))break}while(!0);this[ce]=!1}e=!1}finally{e&&this[$]()}}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,B.default.closeSync(e),this.emit("close")}}};W.ReadStreamSync=hs;var Kt=class extends No.default{readable=!1;writable=!0;[Me]=!1;[Ne]=!1;[_t]=!1;[ee]=[];[Ht]=!1;[V];[yt];[ye];[p];[Gt];[fe];[ts]=!1;[we];constructor(e,t){t=t||{},super(t),this[V]=e,this[p]=typeof t.fd=="number"?t.fd:void 0,this[yt]=t.mode===void 0?438:t.mode,this[we]=typeof t.start=="number"?t.start:void 0,this[ye]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[we]!==void 0?"r+":"w";this[Gt]=t.flags===void 0,this[fe]=t.flags===void 0?i:t.flags,this[p]===void 0&&this[Ee]()}emit(e,...t){if(e==="error"){if(this[Me])return!1;this[Me]=!0}return super.emit(e,...t)}get fd(){return this[p]}get path(){return this[V]}[Ge](e){this[$](),this[Ne]=!0,this.emit("error",e)}[Ee](){B.default.open(this[V],this[fe],this[yt],(e,t)=>this[Ye](e,t))}[Ye](e,t){this[Gt]&&this[fe]==="r+"&&e&&e.code==="ENOENT"?(this[fe]="w",this[Ee]()):e?this[Ge](e):(this[p]=t,this.emit("open",t),this[Ne]||this[is]())}end(e,t){return e&&this.write(e,t),this[_t]=!0,!this[Ne]&&!this[ee].length&&typeof this[p]=="number"&&this[He](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[_t]?(this.emit("error",new Error("write() after end()")),!1):this[p]===void 0||this[Ne]||this[ee].length?(this[ee].push(e),this[Ht]=!0,!1):(this[Ne]=!0,this[Zt](e),!0)}[Zt](e){B.default.write(this[p],e,0,e.length,this[we],(t,i)=>this[He](t,i))}[He](e,t){e?this[Ge](e):(this[we]!==void 0&&typeof t=="number"&&(this[we]+=t),this[ee].length?this[is]():(this[Ne]=!1,this[_t]&&!this[ts]?(this[ts]=!0,this[$](),this.emit("finish")):this[Ht]&&(this[Ht]=!1,this.emit("drain"))))}[is](){if(this[ee].length===0)this[_t]&&this[He](null,0);else if(this[ee].length===1)this[Zt](this[ee].pop());else{let e=this[ee];this[ee]=[],Lo(this[p],e,this[we],(t,i)=>this[He](t,i))}}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,B.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};W.WriteStream=Kt;var ls=class extends Kt{[Ee](){let e;if(this[Gt]&&this[fe]==="r+")try{e=B.default.openSync(this[V],this[fe],this[yt])}catch(t){if(t?.code==="ENOENT")return this[fe]="w",this[Ee]();throw t}else e=B.default.openSync(this[V],this[fe],this[yt]);this[Ye](null,e)}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,B.default.closeSync(e),this.emit("close")}}[Zt](e){let t=!0;try{this[He](null,B.default.writeSync(this[p],e,0,e.length,this[we])),t=!1}finally{if(t)try{this[$]()}catch{}}}};W.WriteStreamSync=ls});var Vt=d(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.dealias=b.isNoFile=b.isFile=b.isAsync=b.isSync=b.isAsyncNoFile=b.isSyncNoFile=b.isAsyncFile=b.isSyncFile=void 0;var Ao=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),Io=s=>!!s.sync&&!!s.file;b.isSyncFile=Io;var Co=s=>!s.sync&&!!s.file;b.isAsyncFile=Co;var Fo=s=>!!s.sync&&!s.file;b.isSyncNoFile=Fo;var Bo=s=>!s.sync&&!s.file;b.isAsyncNoFile=Bo;var zo=s=>!!s.sync;b.isSync=zo;var ko=s=>!s.sync;b.isAsync=ko;var jo=s=>!!s.file;b.isFile=jo;var xo=s=>!s.file;b.isNoFile=xo;var Uo=s=>{let e=Ao.get(s);return e||s},qo=(s={})=>{if(!s)return{};let e={};for(let[t,i]of Object.entries(s)){let r=Uo(t);e[r]=i}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e};b.dealias=qo});var Ve=d($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.makeCommand=void 0;var Et=Vt(),Wo=(s,e,t,i,r)=>Object.assign((n=[],o,a)=>{Array.isArray(n)&&(o=n,n={}),typeof o=="function"&&(a=o,o=void 0),o?o=Array.from(o):o=[];let h=(0,Et.dealias)(n);if(r?.(h,o),(0,Et.isSyncFile)(h)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return s(h,o)}else if((0,Et.isAsyncFile)(h)){let l=e(h,o),u=a||void 0;return u?l.then(()=>u(),u):l}else if((0,Et.isSyncNoFile)(h)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return t(h,o)}else if((0,Et.isAsyncNoFile)(h)){if(typeof a=="function")throw new TypeError("callback only supported with file option");return i(h,o)}else throw new Error("impossible options??")},{syncFile:s,asyncFile:e,syncNoFile:t,asyncNoFile:i,validate:r});$t.makeCommand=Wo});var us=d($e=>{"use strict";var Ho=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty($e,"__esModule",{value:!0});$e.constants=void 0;var Zo=Ho(__nccwpck_require__(43106)),Go=Zo.default.constants||{ZLIB_VERNUM:4736};$e.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Go))});var vs=d(f=>{"use strict";var Yo=f&&f.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Ko=f&&f.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Vo=f&&f.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Yo(t,e,i[r]);return Ko(t,e),t}})(),$o=f&&f.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(f,"__esModule",{value:!0});f.ZstdDecompress=f.ZstdCompress=f.BrotliDecompress=f.BrotliCompress=f.Unzip=f.InflateRaw=f.DeflateRaw=f.Gunzip=f.Gzip=f.Inflate=f.Deflate=f.Zlib=f.ZlibError=f.constants=void 0;var ds=$o(__nccwpck_require__(42613)),Le=__nccwpck_require__(20181),Xo=We(),qr=Vo(__nccwpck_require__(43106)),te=us(),Qo=us();Object.defineProperty(f,"constants",{enumerable:!0,get:function(){return Qo.constants}});var Jo=Le.Buffer.concat,Wr=Object.getOwnPropertyDescriptor(Le.Buffer,"concat"),ea=s=>s,cs=Wr?.writable===!0||Wr?.set!==void 0?s=>{Le.Buffer.concat=s?ea:Jo}:s=>{},Ae=Symbol("_superWrite"),Ie=class extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};f.ZlibError=Ie;var fs=Symbol("flushFlag"),bt=class extends Xo.Minipass{#e=!1;#i=!1;#s;#n;#r;#t;#o;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#n=e.finishFlush??0,this.#r=e.fullFlushFlag??0,typeof qr[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#t=new qr[t](e)}catch(i){throw new Ie(i,this.constructor)}this.#o=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#o(new Ie(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,ds.default)(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#r),this.write(Object.assign(Le.Buffer.alloc(0),{[fs]:e})))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Ae](e){return super.write(e)}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=Le.Buffer.from(e,t)),this.#e)return;(0,ds.default)(this.#t,"zlib binding closed");let r=this.#t._handle,n=r.close;r.close=()=>{};let o=this.#t.close;this.#t.close=()=>{},cs(!0);let a;try{let l=typeof e[fs]=="number"?e[fs]:this.#s;a=this.#t._processChunk(e,l),cs(!1)}catch(l){cs(!1),this.#o(new Ie(l,this.write))}finally{this.#t&&(this.#t._handle=r,r.close=n,this.#t.close=o,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",l=>this.#o(new Ie(l,this.write)));let h;if(a)if(Array.isArray(a)&&a.length>0){let l=a[0];h=this[Ae](Le.Buffer.from(l));for(let u=1;u<a.length;u++)h=this[Ae](a[u])}else h=this[Ae](Le.Buffer.from(a));return i&&i(),h}},ie=class extends bt{#e;#i;constructor(e,t){e=e||{},e.flush=e.flush||te.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||te.constants.Z_FINISH,e.fullFlushFlag=te.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#i=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#i!==t){this.flush(te.constants.Z_SYNC_FLUSH),(0,ds.default)(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(r,n)=>{typeof r=="function"&&(n=r,r=this.flushFlag),this.flush(r),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#i=t)}}}};f.Zlib=ie;var ms=class extends ie{constructor(e){super(e,"Deflate")}};f.Deflate=ms;var ps=class extends ie{constructor(e){super(e,"Inflate")}};f.Inflate=ps;var _s=class extends ie{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Ae](e){return this.#e?(this.#e=!1,e[9]=255,super[Ae](e)):super[Ae](e)}};f.Gzip=_s;var ws=class extends ie{constructor(e){super(e,"Gunzip")}};f.Gunzip=ws;var ys=class extends ie{constructor(e){super(e,"DeflateRaw")}};f.DeflateRaw=ys;var Es=class extends ie{constructor(e){super(e,"InflateRaw")}};f.InflateRaw=Es;var bs=class extends ie{constructor(e){super(e,"Unzip")}};f.Unzip=bs;var Xt=class extends bt{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||te.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=te.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},Ss=class extends Xt{constructor(e){super(e,"BrotliCompress")}};f.BrotliCompress=Ss;var gs=class extends Xt{constructor(e){super(e,"BrotliDecompress")}};f.BrotliDecompress=gs;var Qt=class extends bt{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||te.constants.ZSTD_e_end,e.fullFlushFlag=te.constants.ZSTD_e_flush,super(e,t)}},Rs=class extends Qt{constructor(e){super(e,"ZstdCompress")}};f.ZstdCompress=Rs;var Os=class extends Qt{constructor(e){super(e,"ZstdDecompress")}};f.ZstdDecompress=Os});var Gr=d(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.parse=Xe.encode=void 0;var ta=(s,e)=>{if(Number.isSafeInteger(s))s<0?sa(s,e):ia(s,e);else throw Error("cannot encode number outside of javascript safe integer range");return e};Xe.encode=ta;var ia=(s,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=s&255,s=Math.floor(s/256)},sa=(s,e)=>{e[0]=255;var t=!1;s=s*-1;for(var i=e.length;i>1;i--){var r=s&255;s=Math.floor(s/256),t?e[i-1]=Hr(r):r===0?e[i-1]=0:(t=!0,e[i-1]=Zr(r))}},ra=s=>{let e=s[0],t=e===128?oa(s.subarray(1,s.length)):e===255?na(s):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t};Xe.parse=ra;var na=s=>{for(var e=s.length,t=0,i=!1,r=e-1;r>-1;r--){var n=Number(s[r]),o;i?o=Hr(n):n===0?o=n:(i=!0,o=Zr(n)),o!==0&&(t-=o*Math.pow(256,e-r-1))}return t},oa=s=>{for(var e=s.length,t=0,i=e-1;i>-1;i--){var r=Number(s[i]);r!==0&&(t+=r*Math.pow(256,e-i-1))}return t},Hr=s=>(255^s)&255,Zr=s=>(255^s)+1&255});var Ts=d(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.code=j.name=j.isName=j.isCode=void 0;var aa=s=>j.name.has(s);j.isCode=aa;var ha=s=>j.code.has(s);j.isName=ha;j.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);j.code=new Map(Array.from(j.name).map(s=>[s[1],s[0]]))});var Je=d(se=>{"use strict";var la=se&&se.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),ua=se&&se.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Yr=se&&se.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&la(t,e,i[r]);return ua(t,e),t}})();Object.defineProperty(se,"__esModule",{value:!0});se.Header=void 0;var Qe=__nccwpck_require__(76760),Kr=Yr(Gr()),St=Yr(Ts()),Ns=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,r){Buffer.isBuffer(e)?this.decode(e,t||0,i,r):e&&this.#i(e)}decode(e,t,i,r){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=i?.path??Ce(e,t,100),this.mode=i?.mode??r?.mode??be(e,t+100,8),this.uid=i?.uid??r?.uid??be(e,t+108,8),this.gid=i?.gid??r?.gid??be(e,t+116,8),this.size=i?.size??r?.size??be(e,t+124,12),this.mtime=i?.mtime??r?.mtime??Ds(e,t+136,12),this.cksum=be(e,t+148,12),r&&this.#i(r,!0),i&&this.#i(i);let n=Ce(e,t+156,1);if(St.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Ce(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=i?.uname??r?.uname??Ce(e,t+265,32),this.gname=i?.gname??r?.gname??Ce(e,t+297,32),this.devmaj=i?.devmaj??r?.devmaj??be(e,t+329,8)??0,this.devmin=i?.devmin??r?.devmin??be(e,t+337,8)??0,e[t+475]!==0){let a=Ce(e,t+345,155);this.path=a+"/"+this.path}else{let a=Ce(e,t+345,130);a&&(this.path=a+"/"+this.path),this.atime=i?.atime??r?.atime??Ds(e,t+476,12),this.ctime=i?.ctime??r?.ctime??Ds(e,t+488,12)}let o=256;for(let a=t;a<t+148;a++)o+=e[a];for(let a=t+156;a<t+512;a++)o+=e[a];this.cksumValid=o===this.cksum,this.cksum===void 0&&o===256&&(this.nullBlock=!0)}#i(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,r])=>!(r==null||i==="path"&&t||i==="linkpath"&&t||i==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=ca(this.path||"",i),n=r[0],o=r[1];this.needPax=!!r[2],this.needPax=Fe(e,t,100,n)||this.needPax,this.needPax=Se(e,t+100,8,this.mode)||this.needPax,this.needPax=Se(e,t+108,8,this.uid)||this.needPax,this.needPax=Se(e,t+116,8,this.gid)||this.needPax,this.needPax=Se(e,t+124,12,this.size)||this.needPax,this.needPax=Ps(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#e.charCodeAt(0),this.needPax=Fe(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=Fe(e,t+265,32,this.uname)||this.needPax,this.needPax=Fe(e,t+297,32,this.gname)||this.needPax,this.needPax=Se(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Se(e,t+337,8,this.devmin)||this.needPax,this.needPax=Fe(e,t+345,i,o)||this.needPax,e[t+475]!==0?this.needPax=Fe(e,t+345,155,o)||this.needPax:(this.needPax=Fe(e,t+345,130,o)||this.needPax,this.needPax=Ps(e,t+476,12,this.atime)||this.needPax,this.needPax=Ps(e,t+488,12,this.ctime)||this.needPax);let a=256;for(let h=t;h<t+148;h++)a+=e[h];for(let h=t+156;h<t+512;h++)a+=e[h];return this.cksum=a,Se(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:St.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(St.code.get(e));if(St.isCode(t)||t==="Unsupported")this.#e=t;else if(St.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};se.Header=Ns;var ca=(s,e)=>{let i=s,r="",n,o=Qe.posix.parse(s).root||".";if(Buffer.byteLength(i)<100)n=[i,r,!1];else{r=Qe.posix.dirname(i),i=Qe.posix.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(r)<=e?n=[i,r,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(r)<=e?n=[i.slice(0,99),r,!0]:(i=Qe.posix.join(Qe.posix.basename(r),i),r=Qe.posix.dirname(r));while(r!==o&&n===void 0);n||(n=[s.slice(0,99),"",!0])}return n},Ce=(s,e,t)=>s.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),Ds=(s,e,t)=>fa(be(s,e,t)),fa=s=>s===void 0?void 0:new Date(s*1e3),be=(s,e,t)=>Number(s[e])&128?Kr.parse(s.subarray(e,e+t)):ma(s,e,t),da=s=>isNaN(s)?void 0:s,ma=(s,e,t)=>da(parseInt(s.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),pa={12:8589934591,8:2097151},Se=(s,e,t,i)=>i===void 0?!1:i>pa[t]||i<0?(Kr.encode(i,s.subarray(e,e+t)),!0):(_a(s,e,t,i),!1),_a=(s,e,t,i)=>s.write(wa(i,t),e,t,"ascii"),wa=(s,e)=>ya(Math.floor(s).toString(8),e),ya=(s,e)=>(s.length===e-1?s:new Array(e-s.length-1).join("0")+s+" ")+"\0",Ps=(s,e,t,i)=>i===void 0?!1:Se(s,e,t,i.getTime()/1e3),Ea=new Array(156).join("\0"),Fe=(s,e,t,i)=>i===void 0?!1:(s.write(i+Ea,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t)});var ei=d(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.Pax=void 0;var ba=__nccwpck_require__(76760),Sa=Je(),Ms=class s{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)r[n]=0;new Sa.Header({path:("PaxHeader/"+(0,ba.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(e,512,t,"utf8");for(let n=t+512;n<r.length;n++)r[n]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===void 0)return"";let t=this[e],i=t instanceof Date?t.getTime()/1e3:t,r=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+i+`
|
|
125985
|
-
`,n=Buffer.byteLength(r),o=Math.floor(Math.log(n)/Math.log(10))+1;return n+o>=Math.pow(10,o)&&(o+=1),o+n+r}static parse(e,t,i=!1){return new s(
|
|
125986
|
-
`).reduce(Oa,Object.create(null)),Oa=(s,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return s;e=e.slice((t+" ").length);let i=e.split("="),r=i.shift();if(!r)return s;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=i.join("=");return s[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(o)*1e3):/^[0-9]+$/.test(o)?+o:o,s}});var et=d(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.normalizeWindowsPath=void 0;var va=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;ti.normalizeWindowsPath=va!=="win32"?s=>s:s=>s&&s.replace(/\\/g,"/")});var ri=d(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.ReadEntry=void 0;var Ta=We(),ii=et(),Ls=class extends Ta.Minipass{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,ii.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,ii.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),i&&this.#e(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,r-t),this.ignore?!0:i>=t?super.write(e):super.write(e.subarray(0,i))}#e(e,t=!1){e.path&&(e.path=(0,ii.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,ii.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,r])=>!(r==null||i==="path"&&t))))}};si.ReadEntry=Ls});var oi=d(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.warnMethod=void 0;var Da=(s,e,t,i={})=>{s.file&&(i.file=s.file),s.cwd&&(i.cwd=s.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!s.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),s.emit("warn",e,t,i)):t instanceof Error?s.emit("error",Object.assign(t,i)):s.emit("error",Object.assign(new Error(`${e}: ${t}`),i))};ni.warnMethod=Da});var mi=d(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.Parser=void 0;var Pa=__nccwpck_require__(24434),As=vs(),Vr=Je(),$r=ei(),Na=ri(),Ma=oi(),La=1024*1024,zs=Buffer.from([31,139]),ks=Buffer.from([40,181,47,253]),Aa=Math.max(zs.length,ks.length),H=Symbol("state"),Be=Symbol("writeEntry"),de=Symbol("readEntry"),Is=Symbol("nextEntry"),Xr=Symbol("processEntry"),re=Symbol("extendedHeader"),gt=Symbol("globalExtendedHeader"),ge=Symbol("meta"),Qr=Symbol("emitMeta"),_=Symbol("buffer"),me=Symbol("queue"),Re=Symbol("ended"),Cs=Symbol("emittedEnd"),ze=Symbol("emit"),S=Symbol("unzip"),ai=Symbol("consumeChunk"),hi=Symbol("consumeChunkSub"),Fs=Symbol("consumeBody"),Jr=Symbol("consumeMeta"),en=Symbol("consumeHeader"),Rt=Symbol("consuming"),Bs=Symbol("bufferConcat"),li=Symbol("maybeEnd"),tt=Symbol("writing"),Oe=Symbol("aborted"),ui=Symbol("onDone"),ke=Symbol("sawValidEntry"),ci=Symbol("sawNullBlock"),fi=Symbol("sawEOF"),tn=Symbol("closeStream"),Ia=()=>!0,js=class extends Pa.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[me]=[];[_];[de];[Be];[H]="begin";[ge]="";[re];[gt];[Re]=!1;[S];[Oe]=!1;[ke];[ci]=!1;[fi]=!1;[tt]=!1;[Rt]=!1;[Cs]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(ui,()=>{(this[H]==="begin"||this[ke]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(ui,e.ondone):this.on(ui,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||La,this.filter=typeof e.filter=="function"?e.filter:Ia;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[tn]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){(0,Ma.warnMethod)(this,e,t,i)}[en](e,t){this[ke]===void 0&&(this[ke]=!1);let i;try{i=new Vr.Header(e,t,this[re],this[gt])}catch(r){return this.warn("TAR_ENTRY_INVALID",r)}if(i.nullBlock)this[ci]?(this[fi]=!0,this[H]==="begin"&&(this[H]="header"),this[ze]("eof")):(this[ci]=!0,this[ze]("nullBlock"));else if(this[ci]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let r=i.type;if(/^(Symbolic)?Link$/.test(r)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(r)&&!/^(Global)?ExtendedHeader$/.test(r)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[Be]=new Na.ReadEntry(i,this[re],this[gt]);if(!this[ke])if(n.remain){let o=()=>{n.invalid||(this[ke]=!0)};n.on("end",o)}else this[ke]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[ze]("ignoredEntry",n),this[H]="ignore",n.resume()):n.size>0&&(this[ge]="",n.on("data",o=>this[ge]+=o),this[H]="meta"):(this[re]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[ze]("ignoredEntry",n),this[H]=n.remain?"ignore":"header",n.resume()):(n.remain?this[H]="body":(this[H]="header",n.end()),this[de]?this[me].push(n):(this[me].push(n),this[Is]())))}}}[tn](){queueMicrotask(()=>this.emit("close"))}[Xr](e){let t=!0;if(!e)this[de]=void 0,t=!1;else if(Array.isArray(e)){let[i,...r]=e;this.emit(i,...r)}else this[de]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[Is]()),t=!1);return t}[Is](){do;while(this[Xr](this[me].shift()));if(!this[me].length){let e=this[de];!e||e.flowing||e.size===e.remain?this[tt]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[Fs](e,t){let i=this[Be];if(!i)throw new Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=e.length&&t===0?e:e.subarray(t,t+r);return i.write(n),i.blockRemain||(this[H]="header",this[Be]=void 0,i.end()),n.length}[Jr](e,t){let i=this[Be],r=this[Fs](e,t);return!this[Be]&&i&&this[Qr](i),r}[ze](e,t,i){!this[me].length&&!this[de]?this.emit(e,t,i):this[me].push([e,t,i])}[Qr](e){switch(this[ze]("meta",this[ge]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[re]=$r.Pax.parse(this[ge],this[re],!1);break;case"GlobalExtendedHeader":this[gt]=$r.Pax.parse(this[ge],this[gt],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[re]??Object.create(null);this[re]=t,t.path=this[ge].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[re]||Object.create(null);this[re]=t,t.linkpath=this[ge].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Oe]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Oe])return i?.(),!1;if((this[S]===void 0||this.brotli===void 0&&this[S]===!1)&&e){if(this[_]&&(e=Buffer.concat([this[_],e]),this[_]=void 0),e.length<Aa)return this[_]=e,i?.(),!0;for(let h=0;this[S]===void 0&&h<zs.length;h++)e[h]!==zs[h]&&(this[S]=!1);let o=!1;if(this[S]===!1&&this.zstd!==!1){o=!0;for(let h=0;h<ks.length;h++)if(e[h]!==ks[h]){o=!1;break}}let a=this.brotli===void 0&&!o;if(this[S]===!1&&a)if(e.length<512)if(this[Re])this.brotli=!0;else return this[_]=e,i?.(),!0;else try{new Vr.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[S]===void 0||this[S]===!1&&(this.brotli||o)){let h=this[Re];this[Re]=!1,this[S]=this[S]===void 0?new As.Unzip({}):o?new As.ZstdDecompress({}):new As.BrotliDecompress({}),this[S].on("data",u=>this[ai](u)),this[S].on("error",u=>this.abort(u)),this[S].on("end",()=>{this[Re]=!0,this[ai]()}),this[tt]=!0;let l=!!this[S][h?"end":"write"](e);return this[tt]=!1,i?.(),l}}this[tt]=!0,this[S]?this[S].write(e):this[ai](e),this[tt]=!1;let n=this[me].length?!1:this[de]?this[de].flowing:!0;return!n&&!this[me].length&&this[de]?.once("drain",()=>this.emit("drain")),i?.(),n}[Bs](e){e&&!this[Oe]&&(this[_]=this[_]?Buffer.concat([this[_],e]):e)}[li](){if(this[Re]&&!this[Cs]&&!this[Oe]&&!this[Rt]){this[Cs]=!0;let e=this[Be];if(e&&e.blockRemain){let t=this[_]?this[_].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[_]&&e.write(this[_]),e.end()}this[ze](ui)}}[ai](e){if(this[Rt]&&e)this[Bs](e);else if(!e&&!this[_])this[li]();else if(e){if(this[Rt]=!0,this[_]){this[Bs](e);let t=this[_];this[_]=void 0,this[hi](t)}else this[hi](e);for(;this[_]&&this[_]?.length>=512&&!this[Oe]&&!this[fi];){let t=this[_];this[_]=void 0,this[hi](t)}this[Rt]=!1}(!this[_]||this[Re])&&this[li]()}[hi](e){let t=0,i=e.length;for(;t+512<=i&&!this[Oe]&&!this[fi];)switch(this[H]){case"begin":case"header":this[en](e,t),t+=512;break;case"ignore":case"body":t+=this[Fs](e,t);break;case"meta":t+=this[Jr](e,t);break;default:throw new Error("invalid state: "+this[H])}t<i&&(this[_]?this[_]=Buffer.concat([e.subarray(t),this[_]]):this[_]=e.subarray(t))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[Oe]||(this[S]?(e&&this[S].write(e),this[S].end()):(this[Re]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[li]())),this}};di.Parser=js});var _i=d(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.stripTrailingSlashes=void 0;var Ca=s=>{let e=s.length-1,t=-1;for(;e>-1&&s.charAt(e)==="/";)t=e,e--;return t===-1?s:s.slice(0,t)};pi.stripTrailingSlashes=Ca});var st=d(F=>{"use strict";var Fa=F&&F.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Ba=F&&F.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),za=F&&F.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Fa(t,e,i[r]);return Ba(t,e),t}})(),ka=F&&F.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(F,"__esModule",{value:!0});F.list=F.filesFilter=void 0;var ja=za(Ke()),it=ka(__nccwpck_require__(73024)),sn=__nccwpck_require__(16928),xa=Ve(),wi=mi(),xs=_i(),Ua=s=>{let e=s.onReadEntry;s.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},qa=(s,e)=>{let t=new Map(e.map(n=>[(0,xs.stripTrailingSlashes)(n),!0])),i=s.filter,r=(n,o="")=>{let a=o||(0,sn.parse)(n).root||".",h;if(n===a)h=!1;else{let l=t.get(n);l!==void 0?h=l:h=r((0,sn.dirname)(n),a)}return t.set(n,h),h};s.filter=i?(n,o)=>i(n,o)&&r((0,xs.stripTrailingSlashes)(n)):n=>r((0,xs.stripTrailingSlashes)(n))};F.filesFilter=qa;var Wa=s=>{let e=new wi.Parser(s),t=s.file,i;try{i=it.default.openSync(t,"r");let r=it.default.fstatSync(i),n=s.maxReadSize||16*1024*1024;if(r.size<n){let o=Buffer.allocUnsafe(r.size),a=it.default.readSync(i,o,0,r.size,0);e.end(a===o.byteLength?o:o.subarray(0,a))}else{let o=0,a=Buffer.allocUnsafe(n);for(;o<r.size;){let h=it.default.readSync(i,a,0,n,o);if(h===0)break;o+=h,e.write(a.subarray(0,h))}e.end()}}finally{if(typeof i=="number")try{it.default.closeSync(i)}catch{}}},Ha=(s,e)=>{let t=new wi.Parser(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,a)=>{t.on("error",a),t.on("end",o),it.default.stat(r,(h,l)=>{if(h)a(h);else{let u=new ja.ReadStream(r,{readSize:i,size:l.size});u.on("error",a),u.pipe(t)}})})};F.list=(0,xa.makeCommand)(Wa,Ha,s=>new wi.Parser(s),s=>new wi.Parser(s),(s,e)=>{e?.length&&(0,F.filesFilter)(s,e),s.noResume||Ua(s)})});var rn=d(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.modeFix=void 0;var Za=(s,e,t)=>(s&=4095,t&&(s=(s|384)&-19),e&&(s&256&&(s|=64),s&32&&(s|=8),s&4&&(s|=1)),s);yi.modeFix=Za});var Us=d(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.stripAbsolutePath=void 0;var Ga=__nccwpck_require__(76760),{isAbsolute:Ya,parse:nn}=Ga.win32,Ka=s=>{let e="",t=nn(s);for(;Ya(s)||t.root;){let i=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":t.root;s=s.slice(i.length),e+=i,t=nn(s)}return[e,s]};Ei.stripAbsolutePath=Ka});var Ws=d(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.decode=rt.encode=void 0;var bi=["|","<",">","?",":"],qs=bi.map(s=>String.fromCharCode(61440+s.charCodeAt(0))),Va=new Map(bi.map((s,e)=>[s,qs[e]])),$a=new Map(qs.map((s,e)=>[s,bi[e]])),Xa=s=>bi.reduce((e,t)=>e.split(t).join(Va.get(t)),s);rt.encode=Xa;var Qa=s=>qs.reduce((e,t)=>e.split(t).join($a.get(t)),s);rt.decode=Qa});var er=d(M=>{"use strict";var Ja=M&&M.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),eh=M&&M.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),th=M&&M.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Ja(t,e,i[r]);return eh(t,e),t}})(),cn=M&&M.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(M,"__esModule",{value:!0});M.WriteEntryTar=M.WriteEntrySync=M.WriteEntry=void 0;var oe=cn(__nccwpck_require__(79896)),fn=We(),on=cn(__nccwpck_require__(16928)),dn=Je(),mn=rn(),ne=et(),pn=Vt(),_n=ei(),wn=Us(),ih=_i(),yn=oi(),sh=th(Ws()),En=(s,e)=>e?(s=(0,ne.normalizeWindowsPath)(s).replace(/^\.(\/|$)/,""),(0,ih.stripTrailingSlashes)(e)+"/"+s):(0,ne.normalizeWindowsPath)(s),rh=16*1024*1024,an=Symbol("process"),hn=Symbol("file"),ln=Symbol("directory"),Zs=Symbol("symlink"),un=Symbol("hardlink"),Ot=Symbol("header"),Si=Symbol("read"),Gs=Symbol("lstat"),gi=Symbol("onlstat"),Ys=Symbol("onread"),Ks=Symbol("onreadlink"),Vs=Symbol("openfile"),$s=Symbol("onopenfile"),ve=Symbol("close"),Ri=Symbol("mode"),Xs=Symbol("awaitDrain"),Hs=Symbol("ondrain"),ae=Symbol("prefix"),Oi=class extends fn.Minipass{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let i=(0,pn.dealias)(t);super(),this.path=(0,ne.normalizeWindowsPath)(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||rh,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=(0,ne.normalizeWindowsPath)(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?(0,ne.normalizeWindowsPath)(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[o,a]=(0,wn.stripAbsolutePath)(this.path);o&&typeof a=="string"&&(this.path=a,r=o)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=sh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=(0,ne.normalizeWindowsPath)(i.absolute||on.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[gi](n):this[Gs]()}warn(e,t,i={}){return(0,yn.warnMethod)(this,e,t,i)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[Gs](){oe.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[gi](t)})}[gi](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=nh(e),this.emit("stat",e),this[an]()}[an](){switch(this.type){case"File":return this[hn]();case"Directory":return this[ln]();case"SymbolicLink":return this[Zs]();default:return this.end()}}[Ri](e){return(0,mn.modeFix)(e,this.type==="Directory",this.portable)}[ae](e){return En(e,this.prefix)}[Ot](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new dn.Header({path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,mode:this[Ri](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new _n.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[ln](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Ot](),this.end()}[Zs](){oe.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Ks](t)})}[Ks](e){this.linkpath=(0,ne.normalizeWindowsPath)(e),this[Ot](),this.end()}[un](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,ne.normalizeWindowsPath)(on.default.relative(this.cwd,e)),this.stat.size=0,this[Ot](),this.end()}[hn](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[un](t);this.linkCache.set(e,this.absolute)}if(this[Ot](),this.stat.size===0)return this.end();this[Vs]()}[Vs](){oe.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[$s](t)})}[$s](e){if(this.fd=e,this.#e)return this[ve]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Si]()}[Si](){let{fd:e,buf:t,offset:i,length:r,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");oe.default.read(e,t,i,r,n,(o,a)=>{if(o)return this[ve](()=>this.emit("error",o));this[Ys](a)})}[ve](e=()=>{}){this.fd!==void 0&&oe.default.close(this.fd,e)}[Ys](e){if(e<=0&&this.remain>0){let r=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(e>this.remain){let r=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let r=e;r<this.length&&e<this.blockRemain;r++)this.buf[r+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[Hs]():this[Xs](()=>this[Hs]())}[Xs](e){this.once("drain",e)}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let r=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",r)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[Hs](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[ve](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[Si]()}};M.WriteEntry=Oi;var Qs=class extends Oi{sync=!0;[Gs](){this[gi](oe.default.lstatSync(this.absolute))}[Zs](){this[Ks](oe.default.readlinkSync(this.absolute))}[Vs](){this[$s](oe.default.openSync(this.absolute,"r"))}[Si](){let e=!0;try{let{fd:t,buf:i,offset:r,length:n,pos:o}=this;if(t===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let a=oe.default.readSync(t,i,r,n,o);this[Ys](a),e=!1}finally{if(e)try{this[ve](()=>{})}catch{}}}[Xs](e){e()}[ve](e=()=>{}){this.fd!==void 0&&oe.default.closeSync(this.fd),e()}};M.WriteEntrySync=Qs;var Js=class extends fn.Minipass{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,i={}){return(0,yn.warnMethod)(this,e,t,i)}constructor(e,t={}){let i=(0,pn.dealias)(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:r}=e;if(r==="Unsupported")throw new Error("writing entry that should be ignored");this.type=r,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=(0,ne.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[Ri](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,ne.normalizeWindowsPath)(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[a,h]=(0,wn.stripAbsolutePath)(this.path);a&&typeof h=="string"&&(this.path=h,n=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new dn.Header({path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new _n.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw new Error("failed to encode header");super.write(o),e.pipe(this)}[ae](e){return En(e,this.prefix)}[Ri](e){return(0,mn.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,i){typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}};M.WriteEntryTar=Js;var nh=s=>s.isFile()?"File":s.isDirectory()?"Directory":s.isSymbolicLink()?"SymbolicLink":"Unsupported"});var bn=d(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.Node=ot.Yallist=void 0;var tr=class s{tail;head;length=0;static create(e=[]){return new s(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,i=e.length;t<i;t++)ah(this,e[t]);return this.length}unshift(...e){for(var t=0,i=e.length;t<i;t++)hh(this,e[t]);return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let i=this.head,r=0;i;r++)e.call(t,i.value,r,this),i=i.next}forEachReverse(e,t){t=t||this;for(let i=this.tail,r=this.length-1;i;r--)e.call(t,i.value,r,this),i=i.prev}get(e){let t=0,i=this.head;for(;i&&t<e;t++)i=i.next;if(t===e&&i)return i.value}getReverse(e){let t=0,i=this.tail;for(;i&&t<e;t++)i=i.prev;if(t===e&&i)return i.value}map(e,t){t=t||this;let i=new s;for(let r=this.head;r;)i.push(e.call(t,r.value,this)),r=r.next;return i}mapReverse(e,t){t=t||this;var i=new s;for(let r=this.tail;r;)i.push(e.call(t,r.value,this)),r=r.prev;return i}reduce(e,t){let i,r=this.head;if(arguments.length>1)i=t;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=e(i,r.value,n),r=r.next;return i}reduceReverse(e,t){let i,r=this.tail;if(arguments.length>1)i=t;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;r;n--)i=e(i,r.value,n),r=r.prev;return i}toArray(){let e=new Array(this.length);for(let t=0,i=this.head;i;t++)e[t]=i.value,i=i.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,i=this.tail;i;t++)e[t]=i.value,i=i.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new s;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.head,n=0;for(n=0;r&&n<e;n++)r=r.next;for(;r&&n<t;n++,r=r.next)i.push(r.value);return i}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new s;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.length,n=this.tail;for(;n&&r>t;r--)n=n.prev;for(;n&&r>e;r--,n=n.prev)i.push(n.value);return i}splice(e,t=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let r=this.head;for(let o=0;r&&o<e;o++)r=r.next;let n=[];for(let o=0;r&&o<t;o++)n.push(r.value),r=this.removeNode(r);r?r!==this.tail&&(r=r.prev):r=this.tail;for(let o of i)r=oh(this,r,o);return n}reverse(){let e=this.head,t=this.tail;for(let i=e;i;i=i.prev){let r=i.prev;i.prev=i.next,i.next=r}return this.head=t,this.tail=e,this}};ot.Yallist=tr;function oh(s,e,t){let i=e,r=e?e.next:s.head,n=new nt(t,i,r,s);return n.next===void 0&&(s.tail=n),n.prev===void 0&&(s.head=n),s.length++,n}function ah(s,e){s.tail=new nt(e,s.tail,void 0,s),s.head||(s.head=s.tail),s.length++}function hh(s,e){s.head=new nt(e,void 0,s.head,s),s.tail||(s.tail=s.head),s.length++}var nt=class{list;next;prev;value;constructor(e,t,i,r){this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}};ot.Node=nt});var Ai=d(L=>{"use strict";var lh=L&&L.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),uh=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ch=L&&L.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&lh(t,e,i[r]);return uh(t,e),t}})(),vn=L&&L.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(L,"__esModule",{value:!0});L.PackSync=L.Pack=L.PackJob=void 0;var Mi=vn(__nccwpck_require__(79896)),hr=er(),Dt=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}};L.PackJob=Dt;var fh=We(),ir=ch(vs()),dh=bn(),mh=ri(),ph=oi(),Sn=Buffer.alloc(1024),vi=Symbol("onStat"),vt=Symbol("ended"),X=Symbol("queue"),je=Symbol("current"),xe=Symbol("process"),Tt=Symbol("processing"),sr=Symbol("processJob"),Q=Symbol("jobs"),rr=Symbol("jobDone"),Ti=Symbol("addFSEntry"),gn=Symbol("addTarEntry"),lr=Symbol("stat"),ur=Symbol("readdir"),Di=Symbol("onreaddir"),Pi=Symbol("pipe"),Rn=Symbol("entry"),nr=Symbol("entryOpt"),Ni=Symbol("writeEntryClass"),Tn=Symbol("write"),or=Symbol("ondrain"),On=vn(__nccwpck_require__(16928)),ar=et(),Li=class extends fh.Minipass{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Ni];onWriteEntry;[X];[Q]=0;[Tt]=!1;[vt]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(0,ar.normalizeWindowsPath)(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[Ni]=hr.WriteEntry,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new ir.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new ir.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new ir.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",i=>super.write(i)),t.on("end",()=>super.end()),t.on("drain",()=>this[or]()),this.on("resume",()=>t.resume())}else this.on("drain",this[or]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[X]=new dh.Yallist,this[Q]=0,this.jobs=Number(e.jobs)||4,this[Tt]=!1,this[vt]=!1}[Tn](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&this.add(e),this[vt]=!0,this[xe](),i&&i(),this}write(e){if(this[vt])throw new Error("write after end");return e instanceof mh.ReadEntry?this[gn](e):this[Ti](e),this.flowing}[gn](e){let t=(0,ar.normalizeWindowsPath)(On.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Dt(e.path,t);i.entry=new hr.WriteEntryTar(e,this[nr](i)),i.entry.on("end",()=>this[rr](i)),this[Q]+=1,this[X].push(i)}this[xe]()}[Ti](e){let t=(0,ar.normalizeWindowsPath)(On.default.resolve(this.cwd,e));this[X].push(new Dt(e,t)),this[xe]()}[lr](e){e.pending=!0,this[Q]+=1;let t=this.follow?"stat":"lstat";Mi.default[t](e.absolute,(i,r)=>{e.pending=!1,this[Q]-=1,i?this.emit("error",i):this[vi](e,r)})}[vi](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)?t.isFile()&&t.nlink>1&&e===this[je]&&!this.linkCache.get(`${t.dev}:${t.ino}`)&&!this.sync&&this[sr](e):e.ignore=!0,this[xe]()}[ur](e){e.pending=!0,this[Q]+=1,Mi.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[Q]-=1,t)return this.emit("error",t);this[Di](e,i)})}[Di](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[xe]()}[xe](){if(!this[Tt]){this[Tt]=!0;for(let e=this[X].head;e&&this[Q]<this.jobs;e=e.next)if(this[sr](e.value),e.value.ignore){let t=e.next;this[X].removeNode(e),e.next=t}this[Tt]=!1,this[vt]&&!this[X].length&&this[Q]===0&&(this.zip?this.zip.end(Sn):(super.write(Sn),super.end()))}}get[je](){return this[X]&&this[X].head&&this[X].head.value}[rr](e){this[X].shift(),this[Q]-=1,this[xe]()}[sr](e){if(!e.pending){if(e.entry){e===this[je]&&!e.piped&&this[Pi](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[vi](e,t):this[lr](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[Di](e,t):this[ur](e),!e.readdir)return}if(e.entry=this[Rn](e),!e.entry){e.ignore=!0;return}e===this[je]&&!e.piped&&this[Pi](e)}}}[nr](e){return{onwarn:(t,i,r)=>this.warn(t,i,r),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[Rn](e){this[Q]+=1;try{return new this[Ni](e.path,this[nr](e)).on("end",()=>this[rr](e)).on("error",i=>this.emit("error",i))}catch(t){this.emit("error",t)}}[or](){this[je]&&this[je].entry&&this[je].entry.resume()}[Pi](e){e.piped=!0,e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ti](o+r)});let t=e.entry,i=this.zip;if(!t)throw new Error("cannot pipe without source");i?t.on("data",r=>{i.write(r)||t.pause()}):t.on("data",r=>{super.write(r)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){(0,ph.warnMethod)(this,e,t,i)}};L.Pack=Li;var cr=class extends Li{sync=!0;constructor(e){super(e),this[Ni]=hr.WriteEntrySync}pause(){}resume(){}[lr](e){let t=this.follow?"statSync":"lstatSync";this[vi](e,Mi.default[t](e.absolute))}[ur](e){this[Di](e,Mi.default.readdirSync(e.absolute))}[Pi](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ti](o+r)}),!t)throw new Error("Cannot pipe without source");i?t.on("data",r=>{i.write(r)}):t.on("data",r=>{super[Tn](r)})}};L.PackSync=cr});var fr=d(at=>{"use strict";var _h=at&&at.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(at,"__esModule",{value:!0});at.create=void 0;var Dn=Ke(),Pn=_h(__nccwpck_require__(76760)),Nn=st(),wh=Ve(),Ii=Ai(),yh=(s,e)=>{let t=new Ii.PackSync(s),i=new Dn.WriteStreamSync(s.file,{mode:s.mode||438});t.pipe(i),Mn(t,e)},Eh=(s,e)=>{let t=new Ii.Pack(s),i=new Dn.WriteStream(s.file,{mode:s.mode||438});t.pipe(i);let r=new Promise((n,o)=>{i.on("error",o),i.on("close",n),t.on("error",o)});return Ln(t,e),r},Mn=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,Nn.list)({file:Pn.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},Ln=async(s,e)=>{for(let t=0;t<e.length;t++){let i=String(e[t]);i.charAt(0)==="@"?await(0,Nn.list)({file:Pn.default.resolve(String(s.cwd),i.slice(1)),noResume:!0,onReadEntry:r=>{s.add(r)}}):s.add(i)}s.end()},bh=(s,e)=>{let t=new Ii.PackSync(s);return Mn(t,e),t},Sh=(s,e)=>{let t=new Ii.Pack(s);return Ln(t,e),t};at.create=(0,wh.makeCommand)(yh,Eh,bh,Sh,(s,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var Cn=d(ht=>{"use strict";var gh=ht&&ht.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ht,"__esModule",{value:!0});ht.getWriteFlag=void 0;var An=gh(__nccwpck_require__(79896)),Rh=process.env.__FAKE_PLATFORM__||process.platform,Oh=Rh==="win32",{O_CREAT:vh,O_TRUNC:Th,O_WRONLY:Dh}=An.default.constants,In=Number(process.env.__FAKE_FS_O_FILENAME__)||An.default.constants.UV_FS_O_FILEMAP||0,Ph=Oh&&!!In,Nh=512*1024,Mh=In|Th|vh|Dh;ht.getWriteFlag=Ph?s=>s<Nh?Mh:"w":()=>"w"});var Bn=d(he=>{"use strict";var Fn=he&&he.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(he,"__esModule",{value:!0});he.chownrSync=he.chownr=void 0;var Fi=Fn(__nccwpck_require__(73024)),Pt=Fn(__nccwpck_require__(76760)),dr=(s,e,t)=>{try{return Fi.default.lchownSync(s,e,t)}catch(i){if(i?.code!=="ENOENT")throw i}},Ci=(s,e,t,i)=>{Fi.default.lchown(s,e,t,r=>{i(r&&r?.code!=="ENOENT"?r:null)})},Lh=(s,e,t,i,r)=>{if(e.isDirectory())(0,he.chownr)(Pt.default.resolve(s,e.name),t,i,n=>{if(n)return r(n);let o=Pt.default.resolve(s,e.name);Ci(o,t,i,r)});else{let n=Pt.default.resolve(s,e.name);Ci(n,t,i,r)}},Ah=(s,e,t,i)=>{Fi.default.readdir(s,{withFileTypes:!0},(r,n)=>{if(r){if(r.code==="ENOENT")return i();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return i(r)}if(r||!n.length)return Ci(s,e,t,i);let o=n.length,a=null,h=l=>{if(!a){if(l)return i(a=l);if(--o===0)return Ci(s,e,t,i)}};for(let l of n)Lh(s,l,e,t,h)})};he.chownr=Ah;var Ih=(s,e,t,i)=>{e.isDirectory()&&(0,he.chownrSync)(Pt.default.resolve(s,e.name),t,i),dr(Pt.default.resolve(s,e.name),t,i)},Ch=(s,e,t)=>{let i;try{i=Fi.default.readdirSync(s,{withFileTypes:!0})}catch(r){let n=r;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return dr(s,e,t);throw n}for(let r of i)Ih(s,r,e,t);return dr(s,e,t)};he.chownrSync=Ch});var zn=d(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.CwdError=void 0;var mr=class extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}};Bi.CwdError=mr});var _r=d(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.SymlinkError=void 0;var pr=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}};zi.SymlinkError=pr});var qn=d(Te=>{"use strict";var yr=Te&&Te.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Te,"__esModule",{value:!0});Te.mkdirSync=Te.mkdir=void 0;var kn=Bn(),x=yr(__nccwpck_require__(73024)),Fh=yr(__nccwpck_require__(51455)),ki=yr(__nccwpck_require__(76760)),jn=zn(),pe=et(),xn=_r(),Bh=(s,e)=>{x.default.stat(s,(t,i)=>{(t||!i.isDirectory())&&(t=new jn.CwdError(s,t?.code||"ENOTDIR")),e(t)})},zh=(s,e,t)=>{s=(0,pe.normalizeWindowsPath)(s);let i=e.umask??18,r=e.mode|448,n=(r&i)!==0,o=e.uid,a=e.gid,h=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),l=e.preserve,u=e.unlink,c=(0,pe.normalizeWindowsPath)(e.cwd),E=(w,P)=>{w?t(w):P&&h?(0,kn.chownr)(P,o,a,Cr=>E(Cr)):n?x.default.chmod(s,r,t):t()};if(s===c)return Bh(s,E);if(l)return Fh.default.mkdir(s,{mode:r,recursive:!0}).then(w=>E(null,w??void 0),E);let A=(0,pe.normalizeWindowsPath)(ki.default.relative(c,s)).split("/");wr(c,A,r,u,c,void 0,E)};Te.mkdir=zh;var wr=(s,e,t,i,r,n,o)=>{if(!e.length)return o(null,n);let a=e.shift(),h=(0,pe.normalizeWindowsPath)(ki.default.resolve(s+"/"+a));x.default.mkdir(h,t,Un(h,e,t,i,r,n,o))},Un=(s,e,t,i,r,n,o)=>a=>{a?x.default.lstat(s,(h,l)=>{if(h)h.path=h.path&&(0,pe.normalizeWindowsPath)(h.path),o(h);else if(l.isDirectory())wr(s,e,t,i,r,n,o);else if(i)x.default.unlink(s,u=>{if(u)return o(u);x.default.mkdir(s,t,Un(s,e,t,i,r,n,o))});else{if(l.isSymbolicLink())return o(new xn.SymlinkError(s,s+"/"+e.join("/")));o(a)}}):(n=n||s,wr(s,e,t,i,r,n,o))},kh=s=>{let e=!1,t;try{e=x.default.statSync(s).isDirectory()}catch(i){t=i?.code}finally{if(!e)throw new jn.CwdError(s,t??"ENOTDIR")}},jh=(s,e)=>{s=(0,pe.normalizeWindowsPath)(s);let t=e.umask??18,i=e.mode|448,r=(i&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),h=e.preserve,l=e.unlink,u=(0,pe.normalizeWindowsPath)(e.cwd),c=w=>{w&&a&&(0,kn.chownrSync)(w,n,o),r&&x.default.chmodSync(s,i)};if(s===u)return kh(u),c();if(h)return c(x.default.mkdirSync(s,{mode:i,recursive:!0})??void 0);let D=(0,pe.normalizeWindowsPath)(ki.default.relative(u,s)).split("/"),A;for(let w=D.shift(),P=u;w&&(P+="/"+w);w=D.shift()){P=(0,pe.normalizeWindowsPath)(ki.default.resolve(P));try{x.default.mkdirSync(P,i),A=A||P}catch{let Fr=x.default.lstatSync(P);if(Fr.isDirectory())continue;if(l){x.default.unlinkSync(P),x.default.mkdirSync(P,i),A=A||P;continue}else if(Fr.isSymbolicLink())return new xn.SymlinkError(P,P+"/"+D.join("/"))}}return c(A)};Te.mkdirSync=jh});var Hn=d(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.normalizeUnicode=void 0;var Er=Object.create(null),Wn=1e4,lt=new Set,xh=s=>{lt.has(s)?lt.delete(s):Er[s]=s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),lt.add(s);let e=Er[s],t=lt.size-Wn;if(t>Wn/10){for(let i of lt)if(lt.delete(i),delete Er[i],--t<=0)break}return e};ji.normalizeUnicode=xh});var Gn=d(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.PathReservations=void 0;var Zn=__nccwpck_require__(76760),Uh=Hn(),qh=_i(),Wh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Hh=Wh==="win32",Zh=s=>s.split("/").slice(0,-1).reduce((t,i)=>{let r=t[t.length-1];return r!==void 0&&(i=(0,Zn.join)(r,i)),t.push(i||"/"),t},[]),br=class{#e=new Map;#i=new Map;#s=new Set;reserve(e,t){e=Hh?["win32 parallelization disabled"]:e.map(r=>(0,qh.stripTrailingSlashes)((0,Zn.join)((0,Uh.normalizeUnicode)(r))));let i=new Set(e.map(r=>Zh(r)).reduce((r,n)=>r.concat(n)));this.#i.set(t,{dirs:i,paths:e});for(let r of e){let n=this.#e.get(r);n?n.push(t):this.#e.set(r,[t])}for(let r of i){let n=this.#e.get(r);if(!n)this.#e.set(r,[new Set([t])]);else{let o=n[n.length-1];o instanceof Set?o.add(t):n.push(new Set([t]))}}return this.#r(t)}#n(e){let t=this.#i.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(i=>this.#e.get(i)),dirs:[...t.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:t,dirs:i}=this.#n(e);return t.every(r=>r&&r[0]===e)&&i.every(r=>r&&r[0]instanceof Set&&r[0].has(e))}#r(e){return this.#s.has(e)||!this.check(e)?!1:(this.#s.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#s.has(e))return!1;let t=this.#i.get(e);if(!t)throw new Error("invalid reservation");let{paths:i,dirs:r}=t,n=new Set;for(let o of i){let a=this.#e.get(o);if(!a||a?.[0]!==e)continue;let h=a[1];if(!h){this.#e.delete(o);continue}if(a.shift(),typeof h=="function")n.add(h);else for(let l of h)n.add(l)}for(let o of r){let a=this.#e.get(o),h=a?.[0];if(!(!a||!(h instanceof Set)))if(h.size===1&&a.length===1){this.#e.delete(o);continue}else if(h.size===1){a.shift();let l=a[0];typeof l=="function"&&n.add(l)}else h.delete(e)}return this.#s.delete(e),n.forEach(o=>this.#r(o)),!0}};xi.PathReservations=br});var Yn=d(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.umask=void 0;var Gh=()=>process.umask();Ui.umask=Gh});var Lr=d(z=>{"use strict";var Yh=z&&z.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Kh=z&&z.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),so=z&&z.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Yh(t,e,i[r]);return Kh(t,e),t}})(),Mr=z&&z.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(z,"__esModule",{value:!0});z.UnpackSync=z.Unpack=void 0;var Vh=so(Ke()),$h=Mr(__nccwpck_require__(34589)),ro=__nccwpck_require__(77598),m=Mr(__nccwpck_require__(73024)),g=Mr(__nccwpck_require__(76760)),no=Cn(),oo=qn(),U=et(),Xh=mi(),Qh=Us(),Kn=so(Ws()),Jh=Gn(),ao=_r(),el=Yn(),Vn=Symbol("onEntry"),Or=Symbol("checkFs"),$n=Symbol("checkFs2"),vr=Symbol("isReusable"),Z=Symbol("makeFs"),Tr=Symbol("file"),Dr=Symbol("directory"),Wi=Symbol("link"),Xn=Symbol("symlink"),Qn=Symbol("hardlink"),Mt=Symbol("ensureNoSymlink"),Jn=Symbol("unsupported"),eo=Symbol("checkPath"),Sr=Symbol("stripAbsolutePath"),De=Symbol("mkdir"),T=Symbol("onError"),qi=Symbol("pending"),to=Symbol("pend"),ut=Symbol("unpend"),gr=Symbol("ended"),Rr=Symbol("maybeClose"),Pr=Symbol("skip"),Lt=Symbol("doChown"),At=Symbol("uid"),It=Symbol("gid"),Ct=Symbol("checkedCwd"),tl=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Ft=tl==="win32",il=1024,sl=(s,e)=>{if(!Ft)return m.default.unlink(s,e);let t=s+".DELETE."+(0,ro.randomBytes)(16).toString("hex");m.default.rename(s,t,i=>{if(i)return e(i);m.default.unlink(t,e)})},rl=s=>{if(!Ft)return m.default.unlinkSync(s);let e=s+".DELETE."+(0,ro.randomBytes)(16).toString("hex");m.default.renameSync(s,e),m.default.unlinkSync(e)},io=(s,e,t)=>s!==void 0&&s===s>>>0?s:e!==void 0&&e===e>>>0?e:t,Hi=class extends Xh.Parser{[gr]=!1;[Ct]=!1;[qi]=0;reservations=new Jh.PathReservations;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[gr]=!0,this[Rr]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:il,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Ft,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,U.normalizeWindowsPath)(g.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:(0,el.umask)():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Vn](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[Rr](){this[gr]&&this[qi]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Sr](e,t){let i=e[t],{type:r}=e;if(!i||this.preservePaths)return!0;let[n,o]=(0,Qh.stripAbsolutePath)(i),a=o.replace(/\\/g,"/").split("/");if(a.includes("..")||Ft&&/^[a-z]:\.\.$/i.test(a[0]??"")){if(t==="path"||r==="Link")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:i}),!1;{let h=g.default.posix.dirname(e.path),l=g.default.posix.normalize(g.default.posix.join(h,a.join("/")));if(l.startsWith("../")||l==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:i}),!1}}return n&&(e[t]=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${t}`,{entry:e,[t]:i})),!0}[eo](e){let t=(0,U.normalizeWindowsPath)(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if(e.type==="Link"){let r=(0,U.normalizeWindowsPath)(String(e.linkpath)).split("/");if(r.length>=this.strip)e.linkpath=r.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[Sr](e,"path")||!this[Sr](e,"linkpath"))return!1;if(g.default.isAbsolute(e.path)?e.absolute=(0,U.normalizeWindowsPath)(g.default.resolve(e.path)):e.absolute=(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,U.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=g.default.win32.parse(String(e.absolute));e.absolute=r+Kn.encode(String(e.absolute).slice(r.length));let{root:n}=g.default.win32.parse(e.path);e.path=n+Kn.encode(e.path.slice(n.length))}return!0}[Vn](e){if(!this[eo](e))return e.resume();switch($h.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Or](e);default:return this[Jn](e)}}[T](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ut](),t.resume())}[De](e,t,i){(0,oo.mkdir)((0,U.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},i)}[Lt](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[At](e){return io(this.uid,e.uid,this.processUid)}[It](e){return io(this.gid,e.gid,this.processGid)}[Tr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=new Vh.WriteStream(String(e.absolute),{flags:(0,no.getWriteFlag)(e.size),mode:i,autoClose:!1});r.on("error",h=>{r.fd&&m.default.close(r.fd,()=>{}),r.write=()=>!0,this[T](h,e),t()});let n=1,o=h=>{if(h){r.fd&&m.default.close(r.fd,()=>{}),this[T](h,e),t();return}--n===0&&r.fd!==void 0&&m.default.close(r.fd,l=>{l?this[T](l,e):this[ut](),t()})};r.on("finish",()=>{let h=String(e.absolute),l=r.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let u=e.atime||new Date,c=e.mtime;m.default.futimes(l,u,c,E=>E?m.default.utimes(h,u,c,D=>o(D&&E)):o())}if(typeof l=="number"&&this[Lt](e)){n++;let u=this[At](e),c=this[It](e);typeof u=="number"&&typeof c=="number"&&m.default.fchown(l,u,c,E=>E?m.default.chown(h,u,c,D=>o(D&&E)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",h=>{this[T](h,e),t()}),e.pipe(a)),a.pipe(r)}[Dr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[De](String(e.absolute),i,r=>{if(r){this[T](r,e),t();return}let n=1,o=()=>{--n===0&&(t(),this[ut](),e.resume())};e.mtime&&!this.noMtime&&(n++,m.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,o)),this[Lt](e)&&(n++,m.default.chown(String(e.absolute),Number(this[At](e)),Number(this[It](e)),o)),o()})}[Jn](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Xn](e,t){let i=(0,U.normalizeWindowsPath)(g.default.relative(this.cwd,g.default.resolve(g.default.dirname(String(e.absolute)),String(e.linkpath)))).split("/");this[Mt](e,this.cwd,i,()=>this[Wi](e,String(e.linkpath),"symlink",t),r=>{this[T](r,e),t()})}[Qn](e,t){let i=(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,String(e.linkpath))),r=(0,U.normalizeWindowsPath)(String(e.linkpath)).split("/");this[Mt](e,this.cwd,r,()=>this[Wi](e,i,"link",t),n=>{this[T](n,e),t()})}[Mt](e,t,i,r,n){let o=i.shift();if(this.preservePaths||o===void 0)return r();let a=g.default.resolve(t,o);m.default.lstat(a,(h,l)=>{if(h)return r();if(l?.isSymbolicLink())return n(new ao.SymlinkError(a,g.default.resolve(a,i.join("/"))));this[Mt](e,a,i,r,n)})}[to](){this[qi]++}[ut](){this[qi]--,this[Rr]()}[Pr](e){this[ut](),e.resume()}[vr](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Ft}[Or](e){this[to]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[$n](e,i))}[$n](e,t){let i=a=>{t(a)},r=()=>{this[De](this.cwd,this.dmode,a=>{if(a){this[T](a,e),i();return}this[Ct]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(a!==this.cwd)return this[De](a,this.dmode,h=>{if(h){this[T](h,e),i();return}o()})}o()},o=()=>{m.default.lstat(String(e.absolute),(a,h)=>{if(h&&(this.keep||this.newer&&h.mtime>(e.mtime??h.mtime))){this[Pr](e),i();return}if(a||this[vr](e,h))return this[Z](null,e,i);if(h.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(h.mode&4095)!==e.mode,u=c=>this[Z](c??null,e,i);return l?m.default.chmod(String(e.absolute),Number(e.mode),u):u()}if(e.absolute!==this.cwd)return m.default.rmdir(String(e.absolute),l=>this[Z](l??null,e,i))}if(e.absolute===this.cwd)return this[Z](null,e,i);sl(String(e.absolute),l=>this[Z](l??null,e,i))})};this[Ct]?n():r()}[Z](e,t,i){if(e){this[T](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Tr](t,i);case"Link":return this[Qn](t,i);case"SymbolicLink":return this[Xn](t,i);case"Directory":case"GNUDumpDir":return this[Dr](t,i)}}[Wi](e,t,i,r){m.default[i](t,String(e.absolute),n=>{n?this[T](n,e):(this[ut](),e.resume()),r()})}};z.Unpack=Hi;var Nt=s=>{try{return[null,s()]}catch(e){return[e,null]}},Nr=class extends Hi{sync=!0;[Z](e,t){return super[Z](e,t,()=>{})}[Or](e){if(!this[Ct]){let n=this[De](this.cwd,this.dmode);if(n)return this[T](n,e);this[Ct]=!0}if(e.absolute!==this.cwd){let n=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(n!==this.cwd){let o=this[De](n,this.dmode);if(o)return this[T](o,e)}}let[t,i]=Nt(()=>m.default.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[Pr](e);if(t||this[vr](e,i))return this[Z](null,e);if(i.isDirectory()){if(e.type==="Directory"){let o=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[a]=o?Nt(()=>{m.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[Z](a,e)}let[n]=Nt(()=>m.default.rmdirSync(String(e.absolute)));this[Z](n,e)}let[r]=e.absolute===this.cwd?[]:Nt(()=>rl(String(e.absolute)));this[Z](r,e)}[Tr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=a=>{let h;try{m.default.closeSync(n)}catch(l){h=l}(a||h)&&this[T](a||h,e),t()},n;try{n=m.default.openSync(String(e.absolute),(0,no.getWriteFlag)(e.size),i)}catch(a){return r(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[T](a,e)),e.pipe(o)),o.on("data",a=>{try{m.default.writeSync(n,a,0,a.length)}catch(h){r(h)}}),o.on("end",()=>{let a=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,l=e.mtime;try{m.default.futimesSync(n,h,l)}catch(u){try{m.default.utimesSync(String(e.absolute),h,l)}catch{a=u}}}if(this[Lt](e)){let h=this[At](e),l=this[It](e);try{m.default.fchownSync(n,Number(h),Number(l))}catch(u){try{m.default.chownSync(String(e.absolute),Number(h),Number(l))}catch{a=a||u}}}r(a)})}[Dr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,r=this[De](String(e.absolute),i);if(r){this[T](r,e),t();return}if(e.mtime&&!this.noMtime)try{m.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[Lt](e))try{m.default.chownSync(String(e.absolute),Number(this[At](e)),Number(this[It](e)))}catch{}t(),e.resume()}[De](e,t){try{return(0,oo.mkdirSync)((0,U.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(i){return i}}[Mt](e,t,i,r,n){if(this.preservePaths||!i.length)return r();let o=t;for(let a of i){o=g.default.resolve(o,a);let[h,l]=Nt(()=>m.default.lstatSync(o));if(h)return r();if(l.isSymbolicLink())return n(new ao.SymlinkError(o,g.default.resolve(t,i.join("/"))))}r()}[Wi](e,t,i,r){let n=`${i}Sync`;try{m.default[n](t,String(e.absolute)),r(),e.resume()}catch(o){return this[T](o,e)}}};z.UnpackSync=Nr});var Ar=d(G=>{"use strict";var nl=G&&G.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),ol=G&&G.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),al=G&&G.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&nl(t,e,i[r]);return ol(t,e),t}})(),hl=G&&G.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(G,"__esModule",{value:!0});G.extract=void 0;var ho=al(Ke()),lo=hl(__nccwpck_require__(73024)),ll=st(),ul=Ve(),Zi=Lr(),cl=s=>{let e=new Zi.UnpackSync(s),t=s.file,i=lo.default.statSync(t),r=s.maxReadSize||16*1024*1024;new ho.ReadStreamSync(t,{readSize:r,size:i.size}).pipe(e)},fl=(s,e)=>{let t=new Zi.Unpack(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,a)=>{t.on("error",a),t.on("close",o),lo.default.stat(r,(h,l)=>{if(h)a(h);else{let u=new ho.ReadStream(r,{readSize:i,size:l.size});u.on("error",a),u.pipe(t)}})})};G.extract=(0,ul.makeCommand)(cl,fl,s=>new Zi.UnpackSync(s),s=>new Zi.Unpack(s),(s,e)=>{e?.length&&(0,ll.filesFilter)(s,e)})});var Gi=d(ct=>{"use strict";var uo=ct&&ct.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ct,"__esModule",{value:!0});ct.replace=void 0;var co=Ke(),q=uo(__nccwpck_require__(73024)),fo=uo(__nccwpck_require__(76760)),mo=Je(),po=st(),dl=Ve(),ml=Vt(),_o=Ai(),pl=(s,e)=>{let t=new _o.PackSync(s),i=!0,r,n;try{try{r=q.default.openSync(s.file,"r+")}catch(h){if(h?.code==="ENOENT")r=q.default.openSync(s.file,"w+");else throw h}let o=q.default.fstatSync(r),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let u=0,c=0;u<512;u+=c){if(c=q.default.readSync(r,a,u,a.length-u,n+u),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!c)break e}let h=new mo.Header(a);if(!h.cksumValid)break;let l=512*Math.ceil((h.size||0)/512);if(n+l+512>o.size)break;n+=l,s.mtimeCache&&h.mtime&&s.mtimeCache.set(String(h.path),h.mtime)}i=!1,_l(s,t,n,r,e)}finally{if(i)try{q.default.closeSync(r)}catch{}}},_l=(s,e,t,i,r)=>{let n=new co.WriteStreamSync(s.file,{fd:i,start:t});e.pipe(n),yl(e,r)},wl=(s,e)=>{e=Array.from(e);let t=new _o.Pack(s),i=(n,o,a)=>{let h=(D,A)=>{D?q.default.close(n,w=>a(D)):a(null,A)},l=0;if(o===0)return h(null,0);let u=0,c=Buffer.alloc(512),E=(D,A)=>{if(D||typeof A>"u")return h(D);if(u+=A,u<512&&A)return q.default.read(n,c,u,c.length-u,l+u,E);if(l===0&&c[0]===31&&c[1]===139)return h(new Error("cannot append to compressed archives"));if(u<512)return h(null,l);let w=new mo.Header(c);if(!w.cksumValid)return h(null,l);let P=512*Math.ceil((w.size??0)/512);if(l+P+512>o||(l+=P+512,l>=o))return h(null,l);s.mtimeCache&&w.mtime&&s.mtimeCache.set(String(w.path),w.mtime),u=0,q.default.read(n,c,0,512,l,E)};q.default.read(n,c,0,512,l,E)};return new Promise((n,o)=>{t.on("error",o);let a="r+",h=(l,u)=>{if(l&&l.code==="ENOENT"&&a==="r+")return a="w+",q.default.open(s.file,a,h);if(l||!u)return o(l);q.default.fstat(u,(c,E)=>{if(c)return q.default.close(u,()=>o(c));i(u,E.size,(D,A)=>{if(D)return o(D);let w=new co.WriteStream(s.file,{fd:u,start:A});t.pipe(w),w.on("error",o),w.on("close",n),El(t,e)})})};q.default.open(s.file,a,h)})},yl=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,po.list)({file:fo.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},El=async(s,e)=>{for(let t=0;t<e.length;t++){let i=String(e[t]);i.charAt(0)==="@"?await(0,po.list)({file:fo.default.resolve(String(s.cwd),i.slice(1)),noResume:!0,onReadEntry:r=>s.add(r)}):s.add(i)}s.end()};ct.replace=(0,dl.makeCommand)(pl,wl,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(s,e)=>{if(!(0,ml.isFile)(s))throw new TypeError("file is required");if(s.gzip||s.brotli||s.zstd||s.file.endsWith(".br")||s.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var Ir=d(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.update=void 0;var bl=Ve(),Bt=Gi();Yi.update=(0,bl.makeCommand)(Bt.replace.syncFile,Bt.replace.asyncFile,Bt.replace.syncNoFile,Bt.replace.asyncNoFile,(s,e=[])=>{Bt.replace.validate?.(s,e),Sl(s)});var Sl=s=>{let e=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=e?(t,i)=>e(t,i)&&!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0)):(t,i)=>!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0))}});var wo=exports&&exports.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),gl=exports&&exports.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Y=exports&&exports.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&wo(e,s,t)},Rl=exports&&exports.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&wo(t,e,i[r]);return gl(t,e),t}})();Object.defineProperty(exports, "__esModule", ({value:!0}));exports.u=exports.types=exports.r=exports.t=exports.x=exports.c=void 0;Y(fr(),exports);var Ol=fr();Object.defineProperty(exports, "c", ({enumerable:!0,get:function(){return Ol.create}}));Y(Ar(),exports);var vl=Ar();Object.defineProperty(exports, "x", ({enumerable:!0,get:function(){return vl.extract}}));Y(Je(),exports);Y(st(),exports);var Tl=st();Object.defineProperty(exports, "t", ({enumerable:!0,get:function(){return Tl.list}}));Y(Ai(),exports);Y(mi(),exports);Y(ei(),exports);Y(ri(),exports);Y(Gi(),exports);var Dl=Gi();Object.defineProperty(exports, "r", ({enumerable:!0,get:function(){return Dl.replace}}));exports.types=Rl(Ts());Y(Lr(),exports);Y(Ir(),exports);var Pl=Ir();Object.defineProperty(exports, "u", ({enumerable:!0,get:function(){return Pl.update}}));Y(er(),exports);
|
|
127335
|
+
var d=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var We=d(F=>{"use strict";var Ro=F&&F.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(F,"__esModule",{value:!0});F.Minipass=F.isWritable=F.isReadable=F.isStream=void 0;var Br=typeof process=="object"&&process?process:{stdout:null,stderr:null},is=__nccwpck_require__(78474),jr=Ro(__nccwpck_require__(57075)),vo=__nccwpck_require__(46193),To=s=>!!s&&typeof s=="object"&&(s instanceof Zt||s instanceof jr.default||(0,F.isReadable)(s)||(0,F.isWritable)(s));F.isStream=To;var Do=s=>!!s&&typeof s=="object"&&s instanceof is.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==jr.default.Writable.prototype.pipe;F.isReadable=Do;var Po=s=>!!s&&typeof s=="object"&&s instanceof is.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function";F.isWritable=Po;var le=Symbol("EOF"),ue=Symbol("maybeEmitEnd"),_e=Symbol("emittedEnd"),xt=Symbol("emittingEnd"),dt=Symbol("emittedError"),jt=Symbol("closed"),zr=Symbol("read"),Ut=Symbol("flush"),kr=Symbol("flushChunk"),K=Symbol("encoding"),Ue=Symbol("decoder"),O=Symbol("flowing"),mt=Symbol("paused"),qe=Symbol("resume"),R=Symbol("buffer"),I=Symbol("pipes"),v=Symbol("bufferLength"),$i=Symbol("bufferPush"),qt=Symbol("bufferShift"),N=Symbol("objectMode"),y=Symbol("destroyed"),Xi=Symbol("error"),Qi=Symbol("emitData"),xr=Symbol("emitEnd"),Ji=Symbol("emitEnd2"),J=Symbol("async"),es=Symbol("abort"),Wt=Symbol("aborted"),pt=Symbol("signal"),Ne=Symbol("dataListeners"),x=Symbol("discarded"),_t=s=>Promise.resolve().then(s),No=s=>s(),Mo=s=>s==="end"||s==="finish"||s==="prefinish",Lo=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,Ao=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Ht=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[qe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ts=class extends Ht{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>this.dest.emit("error",r),e.on("error",this.proxyErrors)}},Io=s=>!!s.objectMode,Fo=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",Zt=class extends is.EventEmitter{[O]=!1;[mt]=!1;[I]=[];[R]=[];[N];[K];[J];[Ue];[le]=!1;[_e]=!1;[xt]=!1;[jt]=!1;[dt]=null;[v]=0;[y]=!1;[pt];[Wt]=!1;[Ne]=0;[x]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Io(t)?(this[N]=!0,this[K]=null):Fo(t)?(this[K]=t.encoding,this[N]=!1):(this[N]=!1,this[K]=null),this[J]=!!t.async,this[Ue]=this[K]?new vo.StringDecoder(this[K]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[R]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[I]});let{signal:i}=t;i&&(this[pt]=i,i.aborted?this[es]():i.addEventListener("abort",()=>this[es]()))}get bufferLength(){return this[v]}get encoding(){return this[K]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[N]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[J]}set async(e){this[J]=this[J]||!!e}[es](){this[Wt]=!0,this.emit("abort",this[pt]?.reason),this.destroy(this[pt]?.reason)}get aborted(){return this[Wt]}set aborted(e){}write(e,t,i){if(this[Wt])return!1;if(this[le])throw new Error("write after end");if(this[y])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[J]?_t:No;if(!this[N]&&!Buffer.isBuffer(e)){if(Ao(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Lo(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[O]&&this[v]!==0&&this[Ut](!0),this[O]?this.emit("data",e):this[$i](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[O]):e.length?(typeof e=="string"&&!(t===this[K]&&!this[Ue]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[K]&&(e=this[Ue].write(e)),this[O]&&this[v]!==0&&this[Ut](!0),this[O]?this.emit("data",e):this[$i](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[O]):(this[v]!==0&&this.emit("readable"),i&&r(i),this[O])}read(e){if(this[y])return null;if(this[x]=!1,this[v]===0||e===0||e&&e>this[v])return this[ue](),null;this[N]&&(e=null),this[R].length>1&&!this[N]&&(this[R]=[this[K]?this[R].join(""):Buffer.concat(this[R],this[v])]);let t=this[zr](e||null,this[R][0]);return this[ue](),t}[zr](e,t){if(this[N])this[qt]();else{let i=t;e===i.length||e===null?this[qt]():typeof i=="string"?(this[R][0]=i.slice(e),t=i.slice(0,e),this[v]-=e):(this[R][0]=i.subarray(e),t=i.subarray(0,e),this[v]-=e)}return this.emit("data",t),!this[R].length&&!this[le]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[le]=!0,this.writable=!1,(this[O]||!this[mt])&&this[ue](),this}[qe](){this[y]||(!this[Ne]&&!this[I].length&&(this[x]=!0),this[mt]=!1,this[O]=!0,this.emit("resume"),this[R].length?this[Ut]():this[le]?this[ue]():this.emit("drain"))}resume(){return this[qe]()}pause(){this[O]=!1,this[mt]=!0,this[x]=!1}get destroyed(){return this[y]}get flowing(){return this[O]}get paused(){return this[mt]}[$i](e){this[N]?this[v]+=1:this[v]+=e.length,this[R].push(e)}[qt](){return this[N]?this[v]-=1:this[v]-=this[R][0].length,this[R].shift()}[Ut](e=!1){do;while(this[kr](this[qt]())&&this[R].length);!e&&!this[R].length&&!this[le]&&this.emit("drain")}[kr](e){return this.emit("data",e),this[O]}pipe(e,t){if(this[y])return e;this[x]=!1;let i=this[_e];return t=t||{},e===Br.stdout||e===Br.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[I].push(t.proxyErrors?new ts(this,e,t):new Ht(this,e,t)),this[J]?_t(()=>this[qe]()):this[qe]()),e}unpipe(e){let t=this[I].find(i=>i.dest===e);t&&(this[I].length===1?(this[O]&&this[Ne]===0&&(this[O]=!1),this[I]=[]):this[I].splice(this[I].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[x]=!1,this[Ne]++,!this[I].length&&!this[O]&&this[qe]();else if(e==="readable"&&this[v]!==0)super.emit("readable");else if(Mo(e)&&this[_e])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[dt]){let r=t;this[J]?_t(()=>r.call(this,this[dt])):r.call(this,this[dt])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Ne]=this.listeners("data").length,this[Ne]===0&&!this[x]&&!this[I].length&&(this[O]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ne]=0,!this[x]&&!this[I].length&&(this[O]=!1)),t}get emittedEnd(){return this[_e]}[ue](){!this[xt]&&!this[_e]&&!this[y]&&this[R].length===0&&this[le]&&(this[xt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[jt]&&this.emit("close"),this[xt]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==y&&this[y])return!1;if(e==="data")return!this[N]&&!i?!1:this[J]?(_t(()=>this[Qi](i)),!0):this[Qi](i);if(e==="end")return this[xr]();if(e==="close"){if(this[jt]=!0,!this[_e]&&!this[y])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[dt]=i,super.emit(Xi,i);let n=!this[pt]||this.listeners("error").length?super.emit("error",i):!1;return this[ue](),n}else if(e==="resume"){let n=super.emit("resume");return this[ue](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let r=super.emit(e,...t);return this[ue](),r}[Qi](e){for(let i of this[I])i.dest.write(e)===!1&&this.pause();let t=this[x]?!1:super.emit("data",e);return this[ue](),t}[xr](){return this[_e]?!1:(this[_e]=!0,this.readable=!1,this[J]?(_t(()=>this[Ji]()),!0):this[Ji]())}[Ji](){if(this[Ue]){let t=this[Ue].end();if(t){for(let i of this[I])i.dest.write(t);this[x]||super.emit("data",t)}}for(let t of this[I])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[N]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[N]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[K]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(y,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[x]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[le])return t();let n,o,h=c=>{this.off("data",a),this.off("end",l),this.off(y,u),t(),o(c)},a=c=>{this.off("error",h),this.off("end",l),this.off(y,u),this.pause(),n({value:c,done:!!this[le]})},l=()=>{this.off("error",h),this.off("data",a),this.off(y,u),t(),n({done:!0,value:void 0})},u=()=>h(new Error("stream destroyed"));return new Promise((c,E)=>{o=E,n=c,this.once(y,u),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[x]=!1;let e=!1,t=()=>(this.pause(),this.off(Xi,t),this.off(y,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(Xi,t),this.once(y,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[y])return e?this.emit("error",e):this.emit(y),this;this[y]=!0,this[x]=!0,this[R].length=0,this[v]=0;let t=this;return typeof t.close=="function"&&!this[jt]&&t.close(),e?this.emit("error",e):this.emit(y),this}static get isStream(){return F.isStream}};F.Minipass=Zt});var Ke=d(W=>{"use strict";var Ur=W&&W.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(W,"__esModule",{value:!0});W.WriteStreamSync=W.WriteStream=W.ReadStreamSync=W.ReadStream=void 0;var Co=Ur(__nccwpck_require__(24434)),z=Ur(__nccwpck_require__(79896)),Bo=We(),zo=z.default.writev,ye=Symbol("_autoClose"),$=Symbol("_close"),wt=Symbol("_ended"),p=Symbol("_fd"),ss=Symbol("_finished"),fe=Symbol("_flags"),rs=Symbol("_flush"),hs=Symbol("_handleChunk"),ls=Symbol("_makeBuf"),Et=Symbol("_mode"),Gt=Symbol("_needDrain"),Ge=Symbol("_onerror"),Ye=Symbol("_onopen"),ns=Symbol("_onread"),He=Symbol("_onwrite"),Ee=Symbol("_open"),V=Symbol("_path"),we=Symbol("_pos"),ee=Symbol("_queue"),Ze=Symbol("_read"),os=Symbol("_readSize"),ce=Symbol("_reading"),yt=Symbol("_remain"),as=Symbol("_size"),Yt=Symbol("_write"),Me=Symbol("_writing"),Kt=Symbol("_defaultFlag"),Le=Symbol("_errored"),Vt=class extends Bo.Minipass{[Le]=!1;[p];[V];[os];[ce]=!1;[as];[yt];[ye];constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Le]=!1,this[p]=typeof t.fd=="number"?t.fd:void 0,this[V]=e,this[os]=t.readSize||16*1024*1024,this[ce]=!1,this[as]=typeof t.size=="number"?t.size:1/0,this[yt]=this[as],this[ye]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[p]=="number"?this[Ze]():this[Ee]()}get fd(){return this[p]}get path(){return this[V]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ee](){z.default.open(this[V],"r",(e,t)=>this[Ye](e,t))}[Ye](e,t){e?this[Ge](e):(this[p]=t,this.emit("open",t),this[Ze]())}[ls](){return Buffer.allocUnsafe(Math.min(this[os],this[yt]))}[Ze](){if(!this[ce]){this[ce]=!0;let e=this[ls]();if(e.length===0)return process.nextTick(()=>this[ns](null,0,e));z.default.read(this[p],e,0,e.length,null,(t,i,r)=>this[ns](t,i,r))}}[ns](e,t,i){this[ce]=!1,e?this[Ge](e):this[hs](t,i)&&this[Ze]()}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ge](e){this[ce]=!0,this[$](),this.emit("error",e)}[hs](e,t){let i=!1;return this[yt]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[yt]<=0)&&(i=!1,this[$](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[p]=="number"&&this[Ze](),!1;case"error":return this[Le]?!1:(this[Le]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};W.ReadStream=Vt;var us=class extends Vt{[Ee](){let e=!0;try{this[Ye](null,z.default.openSync(this[V],"r")),e=!1}finally{e&&this[$]()}}[Ze](){let e=!0;try{if(!this[ce]){this[ce]=!0;do{let t=this[ls](),i=t.length===0?0:z.default.readSync(this[p],t,0,t.length,null);if(!this[hs](i,t))break}while(!0);this[ce]=!1}e=!1}finally{e&&this[$]()}}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.closeSync(e),this.emit("close")}}};W.ReadStreamSync=us;var $t=class extends Co.default{readable=!1;writable=!0;[Le]=!1;[Me]=!1;[wt]=!1;[ee]=[];[Gt]=!1;[V];[Et];[ye];[p];[Kt];[fe];[ss]=!1;[we];constructor(e,t){t=t||{},super(t),this[V]=e,this[p]=typeof t.fd=="number"?t.fd:void 0,this[Et]=t.mode===void 0?438:t.mode,this[we]=typeof t.start=="number"?t.start:void 0,this[ye]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[we]!==void 0?"r+":"w";this[Kt]=t.flags===void 0,this[fe]=t.flags===void 0?i:t.flags,this[p]===void 0&&this[Ee]()}emit(e,...t){if(e==="error"){if(this[Le])return!1;this[Le]=!0}return super.emit(e,...t)}get fd(){return this[p]}get path(){return this[V]}[Ge](e){this[$](),this[Me]=!0,this.emit("error",e)}[Ee](){z.default.open(this[V],this[fe],this[Et],(e,t)=>this[Ye](e,t))}[Ye](e,t){this[Kt]&&this[fe]==="r+"&&e&&e.code==="ENOENT"?(this[fe]="w",this[Ee]()):e?this[Ge](e):(this[p]=t,this.emit("open",t),this[Me]||this[rs]())}end(e,t){return e&&this.write(e,t),this[wt]=!0,!this[Me]&&!this[ee].length&&typeof this[p]=="number"&&this[He](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[wt]?(this.emit("error",new Error("write() after end()")),!1):this[p]===void 0||this[Me]||this[ee].length?(this[ee].push(e),this[Gt]=!0,!1):(this[Me]=!0,this[Yt](e),!0)}[Yt](e){z.default.write(this[p],e,0,e.length,this[we],(t,i)=>this[He](t,i))}[He](e,t){e?this[Ge](e):(this[we]!==void 0&&typeof t=="number"&&(this[we]+=t),this[ee].length?this[rs]():(this[Me]=!1,this[wt]&&!this[ss]?(this[ss]=!0,this[$](),this.emit("finish")):this[Gt]&&(this[Gt]=!1,this.emit("drain"))))}[rs](){if(this[ee].length===0)this[wt]&&this[He](null,0);else if(this[ee].length===1)this[Yt](this[ee].pop());else{let e=this[ee];this[ee]=[],zo(this[p],e,this[we],(t,i)=>this[He](t,i))}}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};W.WriteStream=$t;var cs=class extends $t{[Ee](){let e;if(this[Kt]&&this[fe]==="r+")try{e=z.default.openSync(this[V],this[fe],this[Et])}catch(t){if(t?.code==="ENOENT")return this[fe]="w",this[Ee]();throw t}else e=z.default.openSync(this[V],this[fe],this[Et]);this[Ye](null,e)}[$](){if(this[ye]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.closeSync(e),this.emit("close")}}[Yt](e){let t=!0;try{this[He](null,z.default.writeSync(this[p],e,0,e.length,this[we])),t=!1}finally{if(t)try{this[$]()}catch{}}}};W.WriteStreamSync=cs});var Xt=d(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.dealias=b.isNoFile=b.isFile=b.isAsync=b.isSync=b.isAsyncNoFile=b.isSyncNoFile=b.isAsyncFile=b.isSyncFile=void 0;var ko=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),xo=s=>!!s.sync&&!!s.file;b.isSyncFile=xo;var jo=s=>!s.sync&&!!s.file;b.isAsyncFile=jo;var Uo=s=>!!s.sync&&!s.file;b.isSyncNoFile=Uo;var qo=s=>!s.sync&&!s.file;b.isAsyncNoFile=qo;var Wo=s=>!!s.sync;b.isSync=Wo;var Ho=s=>!s.sync;b.isAsync=Ho;var Zo=s=>!!s.file;b.isFile=Zo;var Go=s=>!s.file;b.isNoFile=Go;var Yo=s=>{let e=ko.get(s);return e||s},Ko=(s={})=>{if(!s)return{};let e={};for(let[t,i]of Object.entries(s)){let r=Yo(t);e[r]=i}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e};b.dealias=Ko});var Ve=d(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.makeCommand=void 0;var bt=Xt(),Vo=(s,e,t,i,r)=>Object.assign((n=[],o,h)=>{Array.isArray(n)&&(o=n,n={}),typeof o=="function"&&(h=o,o=void 0),o=o?Array.from(o):[];let a=(0,bt.dealias)(n);if(r?.(a,o),(0,bt.isSyncFile)(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return s(a,o)}else if((0,bt.isAsyncFile)(a)){let l=e(a,o);return h?l.then(()=>h(),h):l}else if((0,bt.isSyncNoFile)(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return t(a,o)}else if((0,bt.isAsyncNoFile)(a)){if(typeof h=="function")throw new TypeError("callback only supported with file option");return i(a,o)}throw new Error("impossible options??")},{syncFile:s,asyncFile:e,syncNoFile:t,asyncNoFile:i,validate:r});Qt.makeCommand=Vo});var fs=d($e=>{"use strict";var $o=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty($e,"__esModule",{value:!0});$e.constants=void 0;var Xo=$o(__nccwpck_require__(43106)),Qo=Xo.default.constants||{ZLIB_VERNUM:4736};$e.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Qo))});var Ds=d(f=>{"use strict";var Jo=f&&f.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),ea=f&&f.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ta=f&&f.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Jo(t,e,i[r]);return ea(t,e),t}})(),ia=f&&f.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(f,"__esModule",{value:!0});f.ZstdDecompress=f.ZstdCompress=f.BrotliDecompress=f.BrotliCompress=f.Unzip=f.InflateRaw=f.DeflateRaw=f.Gunzip=f.Gzip=f.Inflate=f.Deflate=f.Zlib=f.ZlibError=f.constants=void 0;var ps=ia(__nccwpck_require__(42613)),Ae=__nccwpck_require__(20181),sa=We(),qr=ta(__nccwpck_require__(43106)),te=fs(),ra=fs();Object.defineProperty(f,"constants",{enumerable:!0,get:function(){return ra.constants}});var na=Ae.Buffer.concat,Wr=Object.getOwnPropertyDescriptor(Ae.Buffer,"concat"),oa=s=>s,ds=Wr?.writable===!0||Wr?.set!==void 0?s=>{Ae.Buffer.concat=s?oa:na}:s=>{},Ie=Symbol("_superWrite"),Fe=class extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};f.ZlibError=Fe;var ms=Symbol("flushFlag"),St=class extends sa.Minipass{#e=!1;#i=!1;#s;#n;#r;#t;#o;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#n=e.finishFlush??0,this.#r=e.fullFlushFlag??0,typeof qr[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#t=new qr[t](e)}catch(i){throw new Fe(i,this.constructor)}this.#o=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#o(new Fe(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,ps.default)(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#r),this.write(Object.assign(Ae.Buffer.alloc(0),{[ms]:e})))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Ie](e){return super.write(e)}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=Ae.Buffer.from(e,t)),this.#e)return;(0,ps.default)(this.#t,"zlib binding closed");let r=this.#t._handle,n=r.close;r.close=()=>{};let o=this.#t.close;this.#t.close=()=>{},ds(!0);let h;try{let l=typeof e[ms]=="number"?e[ms]:this.#s;h=this.#t._processChunk(e,l),ds(!1)}catch(l){ds(!1),this.#o(new Fe(l,this.write))}finally{this.#t&&(this.#t._handle=r,r.close=n,this.#t.close=o,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",l=>this.#o(new Fe(l,this.write)));let a;if(h)if(Array.isArray(h)&&h.length>0){let l=h[0];a=this[Ie](Ae.Buffer.from(l));for(let u=1;u<h.length;u++)a=this[Ie](h[u])}else a=this[Ie](Ae.Buffer.from(h));return i&&i(),a}},ie=class extends St{#e;#i;constructor(e,t){e=e||{},e.flush=e.flush||te.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||te.constants.Z_FINISH,e.fullFlushFlag=te.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#i=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#i!==t){this.flush(te.constants.Z_SYNC_FLUSH),(0,ps.default)(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(r,n)=>{typeof r=="function"&&(n=r,r=this.flushFlag),this.flush(r),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#i=t)}}}};f.Zlib=ie;var _s=class extends ie{constructor(e){super(e,"Deflate")}};f.Deflate=_s;var ws=class extends ie{constructor(e){super(e,"Inflate")}};f.Inflate=ws;var ys=class extends ie{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Ie](e){return this.#e?(this.#e=!1,e[9]=255,super[Ie](e)):super[Ie](e)}};f.Gzip=ys;var Es=class extends ie{constructor(e){super(e,"Gunzip")}};f.Gunzip=Es;var bs=class extends ie{constructor(e){super(e,"DeflateRaw")}};f.DeflateRaw=bs;var Ss=class extends ie{constructor(e){super(e,"InflateRaw")}};f.InflateRaw=Ss;var gs=class extends ie{constructor(e){super(e,"Unzip")}};f.Unzip=gs;var Jt=class extends St{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||te.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=te.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},Os=class extends Jt{constructor(e){super(e,"BrotliCompress")}};f.BrotliCompress=Os;var Rs=class extends Jt{constructor(e){super(e,"BrotliDecompress")}};f.BrotliDecompress=Rs;var ei=class extends St{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||te.constants.ZSTD_e_end,e.fullFlushFlag=te.constants.ZSTD_e_flush,super(e,t)}},vs=class extends ei{constructor(e){super(e,"ZstdCompress")}};f.ZstdCompress=vs;var Ts=class extends ei{constructor(e){super(e,"ZstdDecompress")}};f.ZstdDecompress=Ts});var Gr=d(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.parse=Xe.encode=void 0;var aa=(s,e)=>{if(Number.isSafeInteger(s))s<0?la(s,e):ha(s,e);else throw Error("cannot encode number outside of javascript safe integer range");return e};Xe.encode=aa;var ha=(s,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=s&255,s=Math.floor(s/256)},la=(s,e)=>{e[0]=255;var t=!1;s=s*-1;for(var i=e.length;i>1;i--){var r=s&255;s=Math.floor(s/256),t?e[i-1]=Hr(r):r===0?e[i-1]=0:(t=!0,e[i-1]=Zr(r))}},ua=s=>{let e=s[0],t=e===128?fa(s.subarray(1,s.length)):e===255?ca(s):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t};Xe.parse=ua;var ca=s=>{for(var e=s.length,t=0,i=!1,r=e-1;r>-1;r--){var n=Number(s[r]),o;i?o=Hr(n):n===0?o=n:(i=!0,o=Zr(n)),o!==0&&(t-=o*Math.pow(256,e-r-1))}return t},fa=s=>{for(var e=s.length,t=0,i=e-1;i>-1;i--){var r=Number(s[i]);r!==0&&(t+=r*Math.pow(256,e-i-1))}return t},Hr=s=>(255^s)&255,Zr=s=>(255^s)+1&255});var Ps=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.code=C.name=C.normalFsTypes=C.isName=C.isCode=void 0;var da=s=>C.name.has(s);C.isCode=da;var ma=s=>C.code.has(s);C.isName=ma;C.normalFsTypes=new Set(["0","","1","2","3","4","5","6","7","D"]);C.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);C.code=new Map(Array.from(C.name).map(s=>[s[1],s[0]]))});var et=d(se=>{"use strict";var pa=se&&se.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),_a=se&&se.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Yr=se&&se.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&pa(t,e,i[r]);return _a(t,e),t}})();Object.defineProperty(se,"__esModule",{value:!0});se.Header=void 0;var Qe=__nccwpck_require__(76760),Kr=Yr(Gr()),Je=Yr(Ps()),Ls=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,r){Buffer.isBuffer(e)?this.decode(e,t||0,i,r):e&&this.#i(e)}decode(e,t,i,r){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");let n=Ce(e,t+156,1),o=Je.normalFsTypes.has(n),h=o?i:void 0,a=o?r:void 0;if(this.path=h?.path??Ce(e,t,100),this.mode=h?.mode??a?.mode??be(e,t+100,8),this.uid=h?.uid??a?.uid??be(e,t+108,8),this.gid=h?.gid??a?.gid??be(e,t+116,8),this.size=h?.size??a?.size??be(e,t+124,12),this.mtime=h?.mtime??a?.mtime??Ns(e,t+136,12),this.cksum=be(e,t+148,12),a&&this.#i(a,!0),h&&this.#i(h),Je.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Ce(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=h?.uname??a?.uname??Ce(e,t+265,32),this.gname=h?.gname??a?.gname??Ce(e,t+297,32),this.devmaj=h?.devmaj??a?.devmaj??be(e,t+329,8)??0,this.devmin=h?.devmin??a?.devmin??be(e,t+337,8)??0,e[t+475]!==0){let u=Ce(e,t+345,155);this.path=u+"/"+this.path}else{let u=Ce(e,t+345,130);u&&(this.path=u+"/"+this.path),this.atime=i?.atime??r?.atime??Ns(e,t+476,12),this.ctime=i?.ctime??r?.ctime??Ns(e,t+488,12)}let l=256;for(let u=t;u<t+148;u++)l+=e[u];for(let u=t+156;u<t+512;u++)l+=e[u];this.cksumValid=l===this.cksum,this.cksum===void 0&&l===256&&(this.nullBlock=!0)}#i(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,r])=>!(r==null||i==="path"&&t||i==="linkpath"&&t||i==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=wa(this.path||"",i),n=r[0],o=r[1];this.needPax=!!r[2],this.needPax=Be(e,t,100,n)||this.needPax,this.needPax=Se(e,t+100,8,this.mode)||this.needPax,this.needPax=Se(e,t+108,8,this.uid)||this.needPax,this.needPax=Se(e,t+116,8,this.gid)||this.needPax,this.needPax=Se(e,t+124,12,this.size)||this.needPax,this.needPax=Ms(e,t+136,12,this.mtime)||this.needPax,e[t+156]=Number(this.#e.codePointAt(0)),this.needPax=Be(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=Be(e,t+265,32,this.uname)||this.needPax,this.needPax=Be(e,t+297,32,this.gname)||this.needPax,this.needPax=Se(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Se(e,t+337,8,this.devmin)||this.needPax,this.needPax=Be(e,t+345,i,o)||this.needPax,e[t+475]!==0?this.needPax=Be(e,t+345,155,o)||this.needPax:(this.needPax=Be(e,t+345,130,o)||this.needPax,this.needPax=Ms(e,t+476,12,this.atime)||this.needPax,this.needPax=Ms(e,t+488,12,this.ctime)||this.needPax);let h=256;for(let a=t;a<t+148;a++)h+=e[a];for(let a=t+156;a<t+512;a++)h+=e[a];return this.cksum=h,Se(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Je.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Je.code.get(e));if(Je.isCode(t)||t==="Unsupported")this.#e=t;else if(Je.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};se.Header=Ls;var wa=(s,e)=>{let i=s,r="",n,o=Qe.posix.parse(s).root||".";if(Buffer.byteLength(i)<100)n=[i,r,!1];else{r=Qe.posix.dirname(i),i=Qe.posix.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(r)<=e?n=[i,r,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(r)<=e?n=[i.slice(0,99),r,!0]:(i=Qe.posix.join(Qe.posix.basename(r),i),r=Qe.posix.dirname(r));while(r!==o&&n===void 0);n||(n=[s.slice(0,99),"",!0])}return n},Ce=(s,e,t)=>s.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),Ns=(s,e,t)=>ya(be(s,e,t)),ya=s=>s===void 0?void 0:new Date(s*1e3),be=(s,e,t)=>Number(s[e])&128?Kr.parse(s.subarray(e,e+t)):ba(s,e,t),Ea=s=>isNaN(s)?void 0:s,ba=(s,e,t)=>Ea(parseInt(s.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),Sa={12:8589934591,8:2097151},Se=(s,e,t,i)=>i===void 0?!1:i>Sa[t]||i<0?(Kr.encode(i,s.subarray(e,e+t)),!0):(ga(s,e,t,i),!1),ga=(s,e,t,i)=>s.write(Oa(i,t),e,t,"ascii"),Oa=(s,e)=>Ra(Math.floor(s).toString(8),e),Ra=(s,e)=>(s.length===e-1?s:new Array(e-s.length-1).join("0")+s+" ")+"\0",Ms=(s,e,t,i)=>i===void 0?!1:Se(s,e,t,i.getTime()/1e3),va=new Array(156).join("\0"),Be=(s,e,t,i)=>i===void 0?!1:(s.write(i+va,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t)});var ii=d(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.Pax=void 0;var Ta=__nccwpck_require__(76760),Da=et(),As=class s{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)r[n]=0;new Da.Header({path:("PaxHeader/"+(0,Ta.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(e,512,t,"utf8");for(let n=t+512;n<r.length;n++)r[n]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===void 0)return"";let t=this[e],i=t instanceof Date?t.getTime()/1e3:t,r=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+i+`
|
|
127336
|
+
`,n=Buffer.byteLength(r),o=Math.floor(Math.log(n)/Math.log(10))+1;return n+o>=Math.pow(10,o)&&(o+=1),o+n+r}static parse(e,t,i=!1){return new s(Pa(Na(e),t),i)}};ti.Pax=As;var Pa=(s,e)=>e?Object.assign({},e,s):s,Na=s=>s.replace(/\n$/,"").split(`
|
|
127337
|
+
`).reduce(Ma,Object.create(null)),Ma=(s,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return s;e=e.slice((t+" ").length);let i=e.split("="),r=i.shift();if(!r)return s;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=i.join("=");return s[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(o)*1e3):/^[0-9]+$/.test(o)?+o:o,s}});var tt=d(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.normalizeWindowsPath=void 0;var La=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;si.normalizeWindowsPath=La!=="win32"?s=>s:s=>s&&s.replaceAll(/\\/g,"/")});var Fs=d(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.ReadEntry=void 0;var Aa=We(),ri=tt(),Is=class extends Aa.Minipass{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,ri.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,ri.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),i&&this.#e(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,r-t),this.ignore?!0:i>=t?super.write(e):super.write(e.subarray(0,i))}#e(e,t=!1){e.path&&(e.path=(0,ri.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,ri.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,r])=>!(r==null||i==="path"&&t))))}};ni.ReadEntry=Is});var ai=d(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.warnMethod=void 0;var Ia=(s,e,t,i={})=>{s.file&&(i.file=s.file),s.cwd&&(i.cwd=s.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!s.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),s.emit("warn",e,t,i)):t instanceof Error?s.emit("error",Object.assign(t,i)):s.emit("error",Object.assign(new Error(`${e}: ${t}`),i))};oi.warnMethod=Ia});var pi=d(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.Parser=void 0;var Fa=__nccwpck_require__(24434),Cs=Ds(),Vr=et(),$r=ii(),Ca=Fs(),Ba=ai(),za=1024*1024,js=Buffer.from([31,139]),Us=Buffer.from([40,181,47,253]),ka=Math.max(js.length,Us.length),H=Symbol("state"),ze=Symbol("writeEntry"),de=Symbol("readEntry"),Bs=Symbol("nextEntry"),Xr=Symbol("processEntry"),re=Symbol("extendedHeader"),gt=Symbol("globalExtendedHeader"),ge=Symbol("meta"),Qr=Symbol("emitMeta"),_=Symbol("buffer"),me=Symbol("queue"),Oe=Symbol("ended"),zs=Symbol("emittedEnd"),ke=Symbol("emit"),S=Symbol("unzip"),hi=Symbol("consumeChunk"),li=Symbol("consumeChunkSub"),ks=Symbol("consumeBody"),Jr=Symbol("consumeMeta"),en=Symbol("consumeHeader"),Ot=Symbol("consuming"),xs=Symbol("bufferConcat"),ui=Symbol("maybeEnd"),it=Symbol("writing"),Re=Symbol("aborted"),ci=Symbol("onDone"),xe=Symbol("sawValidEntry"),fi=Symbol("sawNullBlock"),di=Symbol("sawEOF"),tn=Symbol("closeStream"),xa=()=>!0,qs=class extends Fa.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[me]=[];[_];[de];[ze];[H]="begin";[ge]="";[re];[gt];[Oe]=!1;[S];[Re]=!1;[xe];[fi]=!1;[di]=!1;[it]=!1;[Ot]=!1;[zs]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(ci,()=>{(this[H]==="begin"||this[xe]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(ci,e.ondone):this.on(ci,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||za,this.filter=typeof e.filter=="function"?e.filter:xa;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[tn]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){(0,Ba.warnMethod)(this,e,t,i)}[en](e,t){this[xe]===void 0&&(this[xe]=!1);let i;try{i=new Vr.Header(e,t,this[re],this[gt])}catch(r){return this.warn("TAR_ENTRY_INVALID",r)}if(i.nullBlock)this[fi]?(this[di]=!0,this[H]==="begin"&&(this[H]="header"),this[ke]("eof")):(this[fi]=!0,this[ke]("nullBlock"));else if(this[fi]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let r=i.type;if(/^(Symbolic)?Link$/.test(r)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(r)&&!/^(Global)?ExtendedHeader$/.test(r)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[ze]=new Ca.ReadEntry(i,this[re],this[gt]);if(!this[xe])if(n.remain){let o=()=>{n.invalid||(this[xe]=!0)};n.on("end",o)}else this[xe]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[ke]("ignoredEntry",n),this[H]="ignore",n.resume()):n.size>0&&(this[ge]="",n.on("data",o=>this[ge]+=o),this[H]="meta"):(this[re]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[ke]("ignoredEntry",n),this[H]=n.remain?"ignore":"header",n.resume()):(n.remain?this[H]="body":(this[H]="header",n.end()),this[de]?this[me].push(n):(this[me].push(n),this[Bs]())))}}}[tn](){queueMicrotask(()=>this.emit("close"))}[Xr](e){let t=!0;if(!e)this[de]=void 0,t=!1;else if(Array.isArray(e)){let[i,...r]=e;this.emit(i,...r)}else this[de]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[Bs]()),t=!1);return t}[Bs](){do;while(this[Xr](this[me].shift()));if(this[me].length===0){let e=this[de];!e||e.flowing||e.size===e.remain?this[it]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[ks](e,t){let i=this[ze];if(!i)throw new Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=e.length&&t===0?e:e.subarray(t,t+r);return i.write(n),i.blockRemain||(this[H]="header",this[ze]=void 0,i.end()),n.length}[Jr](e,t){let i=this[ze],r=this[ks](e,t);return!this[ze]&&i&&this[Qr](i),r}[ke](e,t,i){this[me].length===0&&!this[de]?this.emit(e,t,i):this[me].push([e,t,i])}[Qr](e){switch(this[ke]("meta",this[ge]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[re]=$r.Pax.parse(this[ge],this[re],!1);break;case"GlobalExtendedHeader":this[gt]=$r.Pax.parse(this[ge],this[gt],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[re]??Object.create(null);this[re]=t,t.path=this[ge].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[re]||Object.create(null);this[re]=t,t.linkpath=this[ge].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Re]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Re])return i?.(),!1;if((this[S]===void 0||this.brotli===void 0&&this[S]===!1)&&e){if(this[_]&&(e=Buffer.concat([this[_],e]),this[_]=void 0),e.length<ka)return this[_]=e,i?.(),!0;for(let a=0;this[S]===void 0&&a<js.length;a++)e[a]!==js[a]&&(this[S]=!1);let o=!1;if(this[S]===!1&&this.zstd!==!1){o=!0;for(let a=0;a<Us.length;a++)if(e[a]!==Us[a]){o=!1;break}}let h=this.brotli===void 0&&!o;if(this[S]===!1&&h)if(e.length<512)if(this[Oe])this.brotli=!0;else return this[_]=e,i?.(),!0;else try{new Vr.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[S]===void 0||this[S]===!1&&(this.brotli||o)){let a=this[Oe];this[Oe]=!1,this[S]=this[S]===void 0?new Cs.Unzip({}):o?new Cs.ZstdDecompress({}):new Cs.BrotliDecompress({}),this[S].on("data",u=>this[hi](u)),this[S].on("error",u=>this.abort(u)),this[S].on("end",()=>{this[Oe]=!0,this[hi]()}),this[it]=!0;let l=!!this[S][a?"end":"write"](e);return this[it]=!1,i?.(),l}}this[it]=!0,this[S]?this[S].write(e):this[hi](e),this[it]=!1;let n=this[me].length>0?!1:this[de]?this[de].flowing:!0;return!n&&this[me].length===0&&this[de]?.once("drain",()=>this.emit("drain")),i?.(),n}[xs](e){e&&!this[Re]&&(this[_]=this[_]?Buffer.concat([this[_],e]):e)}[ui](){if(this[Oe]&&!this[zs]&&!this[Re]&&!this[Ot]){this[zs]=!0;let e=this[ze];if(e&&e.blockRemain){let t=this[_]?this[_].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[_]&&e.write(this[_]),e.end()}this[ke](ci)}}[hi](e){if(this[Ot]&&e)this[xs](e);else if(!e&&!this[_])this[ui]();else if(e){if(this[Ot]=!0,this[_]){this[xs](e);let t=this[_];this[_]=void 0,this[li](t)}else this[li](e);for(;this[_]&&this[_]?.length>=512&&!this[Re]&&!this[di];){let t=this[_];this[_]=void 0,this[li](t)}this[Ot]=!1}(!this[_]||this[Oe])&&this[ui]()}[li](e){let t=0,i=e.length;for(;t+512<=i&&!this[Re]&&!this[di];)switch(this[H]){case"begin":case"header":this[en](e,t),t+=512;break;case"ignore":case"body":t+=this[ks](e,t);break;case"meta":t+=this[Jr](e,t);break;default:throw new Error("invalid state: "+this[H])}t<i&&(this[_]=this[_]?Buffer.concat([e.subarray(t),this[_]]):e.subarray(t))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[Re]||(this[S]?(e&&this[S].write(e),this[S].end()):(this[Oe]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[ui]())),this}};mi.Parser=qs});var wi=d(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.stripTrailingSlashes=void 0;var ja=s=>{let e=s.length-1,t=-1;for(;e>-1&&s.charAt(e)==="/";)t=e,e--;return t===-1?s:s.slice(0,t)};_i.stripTrailingSlashes=ja});var rt=d(B=>{"use strict";var Ua=B&&B.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),qa=B&&B.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Wa=B&&B.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Ua(t,e,i[r]);return qa(t,e),t}})(),Ha=B&&B.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(B,"__esModule",{value:!0});B.list=B.filesFilter=void 0;var Za=Wa(Ke()),st=Ha(__nccwpck_require__(73024)),sn=__nccwpck_require__(16928),Ga=Ve(),yi=pi(),Ws=wi(),Ya=s=>{let e=s.onReadEntry;s.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},Ka=(s,e)=>{let t=new Map(e.map(n=>[(0,Ws.stripTrailingSlashes)(n),!0])),i=s.filter,r=(n,o="")=>{let h=o||(0,sn.parse)(n).root||".",a;if(n===h)a=!1;else{let l=t.get(n);a=l!==void 0?l:r((0,sn.dirname)(n),h)}return t.set(n,a),a};s.filter=i?(n,o)=>i(n,o)&&r((0,Ws.stripTrailingSlashes)(n)):n=>r((0,Ws.stripTrailingSlashes)(n))};B.filesFilter=Ka;var Va=s=>{let e=new yi.Parser(s),t=s.file,i;try{i=st.default.openSync(t,"r");let r=st.default.fstatSync(i),n=s.maxReadSize||16*1024*1024;if(r.size<n){let o=Buffer.allocUnsafe(r.size),h=st.default.readSync(i,o,0,r.size,0);e.end(h===o.byteLength?o:o.subarray(0,h))}else{let o=0,h=Buffer.allocUnsafe(n);for(;o<r.size;){let a=st.default.readSync(i,h,0,n,o);if(a===0)break;o+=a,e.write(h.subarray(0,a))}e.end()}}finally{if(typeof i=="number")try{st.default.closeSync(i)}catch{}}},$a=(s,e)=>{let t=new yi.Parser(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,h)=>{t.on("error",h),t.on("end",o),st.default.stat(r,(a,l)=>{if(a)h(a);else{let u=new Za.ReadStream(r,{readSize:i,size:l.size});u.on("error",h),u.pipe(t)}})})};B.list=(0,Ga.makeCommand)(Va,$a,s=>new yi.Parser(s),s=>new yi.Parser(s),(s,e)=>{e?.length&&(0,B.filesFilter)(s,e),s.noResume||Ya(s)})});var rn=d(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.modeFix=void 0;var Xa=(s,e,t)=>(s&=4095,t&&(s=(s|384)&-19),e&&(s&256&&(s|=64),s&32&&(s|=8),s&4&&(s|=1)),s);Ei.modeFix=Xa});var Hs=d(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.stripAbsolutePath=void 0;var Qa=__nccwpck_require__(76760),{isAbsolute:Ja,parse:nn}=Qa.win32,eh=s=>{let e="",t=nn(s);for(;Ja(s)||t.root;){let i=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":t.root;s=s.slice(i.length),e+=i,t=nn(s)}return[e,s]};bi.stripAbsolutePath=eh});var Gs=d(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.decode=nt.encode=void 0;var Si=["|","<",">","?",":"],Zs=Si.map(s=>String.fromCodePoint(61440+Number(s.codePointAt(0)))),th=new Map(Si.map((s,e)=>[s,Zs[e]])),ih=new Map(Zs.map((s,e)=>[s,Si[e]])),sh=s=>Si.reduce((e,t)=>e.split(t).join(th.get(t)),s);nt.encode=sh;var rh=s=>Zs.reduce((e,t)=>e.split(t).join(ih.get(t)),s);nt.decode=rh});var sr=d(M=>{"use strict";var nh=M&&M.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),oh=M&&M.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ah=M&&M.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&nh(t,e,i[r]);return oh(t,e),t}})(),cn=M&&M.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(M,"__esModule",{value:!0});M.WriteEntryTar=M.WriteEntrySync=M.WriteEntry=void 0;var oe=cn(__nccwpck_require__(79896)),fn=We(),on=cn(__nccwpck_require__(16928)),dn=et(),mn=rn(),ne=tt(),pn=Xt(),_n=ii(),wn=Hs(),hh=wi(),yn=ai(),lh=ah(Gs()),En=(s,e)=>e?(s=(0,ne.normalizeWindowsPath)(s).replace(/^\.(\/|$)/,""),(0,hh.stripTrailingSlashes)(e)+"/"+s):(0,ne.normalizeWindowsPath)(s),uh=16*1024*1024,an=Symbol("process"),hn=Symbol("file"),ln=Symbol("directory"),Ks=Symbol("symlink"),un=Symbol("hardlink"),Rt=Symbol("header"),gi=Symbol("read"),Vs=Symbol("lstat"),Oi=Symbol("onlstat"),$s=Symbol("onread"),Xs=Symbol("onreadlink"),Qs=Symbol("openfile"),Js=Symbol("onopenfile"),ve=Symbol("close"),Ri=Symbol("mode"),er=Symbol("awaitDrain"),Ys=Symbol("ondrain"),ae=Symbol("prefix"),vi=class extends fn.Minipass{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let i=(0,pn.dealias)(t);super(),this.path=(0,ne.normalizeWindowsPath)(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||uh,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=(0,ne.normalizeWindowsPath)(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?(0,ne.normalizeWindowsPath)(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[o,h]=(0,wn.stripAbsolutePath)(this.path);o&&typeof h=="string"&&(this.path=h,r=o)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=lh.decode(this.path.replaceAll(/\\/g,"/")),e=e.replaceAll(/\\/g,"/")),this.absolute=(0,ne.normalizeWindowsPath)(i.absolute||on.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[Oi](n):this[Vs]()}warn(e,t,i={}){return(0,yn.warnMethod)(this,e,t,i)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[Vs](){oe.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Oi](t)})}[Oi](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=ch(e),this.emit("stat",e),this[an]()}[an](){switch(this.type){case"File":return this[hn]();case"Directory":return this[ln]();case"SymbolicLink":return this[Ks]();default:return this.end()}}[Ri](e){return(0,mn.modeFix)(e,this.type==="Directory",this.portable)}[ae](e){return En(e,this.prefix)}[Rt](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new dn.Header({path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,mode:this[Ri](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new _n.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[ln](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Rt](),this.end()}[Ks](){oe.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Xs](t)})}[Xs](e){this.linkpath=(0,ne.normalizeWindowsPath)(e),this[Rt](),this.end()}[un](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,ne.normalizeWindowsPath)(on.default.relative(this.cwd,e)),this.stat.size=0,this[Rt](),this.end()}[hn](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[un](t);this.linkCache.set(e,this.absolute)}if(this[Rt](),this.stat.size===0)return this.end();this[Qs]()}[Qs](){oe.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[Js](t)})}[Js](e){if(this.fd=e,this.#e)return this[ve]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[gi]()}[gi](){let{fd:e,buf:t,offset:i,length:r,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");oe.default.read(e,t,i,r,n,(o,h)=>{if(o)return this[ve](()=>this.emit("error",o));this[$s](h)})}[ve](e=()=>{}){this.fd!==void 0&&oe.default.close(this.fd,e)}[$s](e){if(e<=0&&this.remain>0){let r=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(e>this.remain){let r=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let r=e;r<this.length&&e<this.blockRemain;r++)this.buf[r+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[Ys]():this[er](()=>this[Ys]())}[er](e){this.once("drain",e)}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let r=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",r)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[Ys](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[ve](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[gi]()}};M.WriteEntry=vi;var tr=class extends vi{sync=!0;[Vs](){this[Oi](oe.default.lstatSync(this.absolute))}[Ks](){this[Xs](oe.default.readlinkSync(this.absolute))}[Qs](){this[Js](oe.default.openSync(this.absolute,"r"))}[gi](){let e=!0;try{let{fd:t,buf:i,offset:r,length:n,pos:o}=this;if(t===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let h=oe.default.readSync(t,i,r,n,o);this[$s](h),e=!1}finally{if(e)try{this[ve](()=>{})}catch{}}}[er](e){e()}[ve](e=()=>{}){this.fd!==void 0&&oe.default.closeSync(this.fd),e()}};M.WriteEntrySync=tr;var ir=class extends fn.Minipass{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,i={}){return(0,yn.warnMethod)(this,e,t,i)}constructor(e,t={}){let i=(0,pn.dealias)(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:r}=e;if(r==="Unsupported")throw new Error("writing entry that should be ignored");this.type=r,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=(0,ne.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[Ri](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,ne.normalizeWindowsPath)(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[h,a]=(0,wn.stripAbsolutePath)(this.path);h&&typeof a=="string"&&(this.path=a,n=h)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new dn.Header({path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new _n.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[ae](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[ae](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw new Error("failed to encode header");super.write(o),e.pipe(this)}[ae](e){return En(e,this.prefix)}[Ri](e){return(0,mn.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,i){typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}};M.WriteEntryTar=ir;var ch=s=>s.isFile()?"File":s.isDirectory()?"Directory":s.isSymbolicLink()?"SymbolicLink":"Unsupported"});var bn=d(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.Node=at.Yallist=void 0;var rr=class s{tail;head;length=0;static create(e=[]){return new s(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,i=e.length;t<i;t++)dh(this,e[t]);return this.length}unshift(...e){for(var t=0,i=e.length;t<i;t++)mh(this,e[t]);return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let i=this.head,r=0;i;r++)e.call(t,i.value,r,this),i=i.next}forEachReverse(e,t){t=t||this;for(let i=this.tail,r=this.length-1;i;r--)e.call(t,i.value,r,this),i=i.prev}get(e){let t=0,i=this.head;for(;i&&t<e;t++)i=i.next;if(t===e&&i)return i.value}getReverse(e){let t=0,i=this.tail;for(;i&&t<e;t++)i=i.prev;if(t===e&&i)return i.value}map(e,t){t=t||this;let i=new s;for(let r=this.head;r;)i.push(e.call(t,r.value,this)),r=r.next;return i}mapReverse(e,t){t=t||this;var i=new s;for(let r=this.tail;r;)i.push(e.call(t,r.value,this)),r=r.prev;return i}reduce(e,t){let i,r=this.head;if(arguments.length>1)i=t;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=e(i,r.value,n),r=r.next;return i}reduceReverse(e,t){let i,r=this.tail;if(arguments.length>1)i=t;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;r;n--)i=e(i,r.value,n),r=r.prev;return i}toArray(){let e=new Array(this.length);for(let t=0,i=this.head;i;t++)e[t]=i.value,i=i.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,i=this.tail;i;t++)e[t]=i.value,i=i.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new s;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.head,n=0;for(n=0;r&&n<e;n++)r=r.next;for(;r&&n<t;n++,r=r.next)i.push(r.value);return i}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new s;if(t<e||t<0)return i;e<0&&(e=0),t>this.length&&(t=this.length);let r=this.length,n=this.tail;for(;n&&r>t;r--)n=n.prev;for(;n&&r>e;r--,n=n.prev)i.push(n.value);return i}splice(e,t=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let r=this.head;for(let o=0;r&&o<e;o++)r=r.next;let n=[];for(let o=0;r&&o<t;o++)n.push(r.value),r=this.removeNode(r);r?r!==this.tail&&(r=r.prev):r=this.tail;for(let o of i)r=fh(this,r,o);return n}reverse(){let e=this.head,t=this.tail;for(let i=e;i;i=i.prev){let r=i.prev;i.prev=i.next,i.next=r}return this.head=t,this.tail=e,this}};at.Yallist=rr;function fh(s,e,t){let i=e,r=e?e.next:s.head,n=new ot(t,i,r,s);return n.next===void 0&&(s.tail=n),n.prev===void 0&&(s.head=n),s.length++,n}function dh(s,e){s.tail=new ot(e,s.tail,void 0,s),s.head||(s.head=s.tail),s.length++}function mh(s,e){s.head=new ot(e,void 0,s.head,s),s.tail||(s.tail=s.head),s.length++}var ot=class{list;next;prev;value;constructor(e,t,i,r){this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}};at.Node=ot});var Fi=d(L=>{"use strict";var ph=L&&L.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),_h=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),wh=L&&L.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&ph(t,e,i[r]);return _h(t,e),t}})(),vn=L&&L.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(L,"__esModule",{value:!0});L.PackSync=L.Pack=L.PackJob=void 0;var Ai=vn(__nccwpck_require__(79896)),ur=sr(),Pt=class{path;absolute;entry;stat;readdir;pending=!1;pendingLink=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}};L.PackJob=Pt;var yh=We(),nr=wh(Ds()),Eh=bn(),bh=ai(),Sn=Buffer.alloc(1024),Di=Symbol("onStat"),vt=Symbol("ended"),X=Symbol("queue"),Tt=Symbol("pendingLinks"),Te=Symbol("current"),je=Symbol("process"),Dt=Symbol("processing"),Ti=Symbol("processJob"),Q=Symbol("jobs"),or=Symbol("jobDone"),Pi=Symbol("addFSEntry"),gn=Symbol("addTarEntry"),cr=Symbol("stat"),fr=Symbol("readdir"),Ni=Symbol("onreaddir"),Mi=Symbol("pipe"),On=Symbol("entry"),ar=Symbol("entryOpt"),Li=Symbol("writeEntryClass"),Tn=Symbol("write"),hr=Symbol("ondrain"),Rn=vn(__nccwpck_require__(16928)),lr=tt(),Ii=class extends yh.Minipass{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Li];onWriteEntry;[X];[Tt]=new Map;[Q]=0;[Dt]=!1;[vt]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(0,lr.normalizeWindowsPath)(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[Li]=ur.WriteEntry,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new nr.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new nr.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new nr.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",i=>super.write(i)),t.on("end",()=>super.end()),t.on("drain",()=>this[hr]()),this.on("resume",()=>t.resume())}else this.on("drain",this[hr]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[X]=new Eh.Yallist,this[Q]=0,this.jobs=Number(e.jobs)||4,this[Dt]=!1,this[vt]=!1}[Tn](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&this.add(e),this[vt]=!0,this[je](),i&&i(),this}write(e){if(this[vt])throw new Error("write after end");return typeof e=="string"?this[Pi](e):this[gn](e),this.flowing}[gn](e){let t=(0,lr.normalizeWindowsPath)(Rn.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Pt(e.path,t);i.entry=new ur.WriteEntryTar(e,this[ar](i)),i.entry.on("end",()=>this[or](i)),this[Q]+=1,this[X].push(i)}this[je]()}[Pi](e){let t=(0,lr.normalizeWindowsPath)(Rn.default.resolve(this.cwd,e));this[X].push(new Pt(e,t)),this[je]()}[cr](e){e.pending=!0,this[Q]+=1;let t=this.follow?"stat":"lstat";Ai.default[t](e.absolute,(i,r)=>{e.pending=!1,this[Q]-=1,i?this.emit("error",i):this[Di](e,r)})}[Di](e,t){if(this.statCache.set(e.absolute,t),e.stat=t,!this.filter(e.path,t))e.ignore=!0;else if(t.isFile()&&t.nlink>1&&!this.linkCache.get(`${t.dev}:${t.ino}`)&&!this.sync)if(e===this[Te])this[Ti](e);else{let i=`${t.dev}:${t.ino}`,r=this[Tt].get(i);r?r.push(e):this[Tt].set(i,[e]),e.pendingLink=!0,e.pending=!0}this[je]()}[fr](e){e.pending=!0,this[Q]+=1,Ai.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[Q]-=1,t)return this.emit("error",t);this[Ni](e,i)})}[Ni](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[je]()}[je](){if(!this[Dt]){this[Dt]=!0;for(let e=this[X].head;e&&this[Q]<this.jobs;e=e.next)if(this[Ti](e.value),e.value.ignore){let t=e.next;this[X].removeNode(e),e.next=t}this[Dt]=!1,this[vt]&&this[X].length===0&&this[Q]===0&&(this.zip?this.zip.end(Sn):(super.write(Sn),super.end()))}}get[Te](){return this[X]&&this[X].head&&this[X].head.value}[or](e){this[X].shift(),this[Q]-=1;let{stat:t}=e;if(t&&t.isFile()&&t.nlink>1){let i=`${t.dev}:${t.ino}`,r=this[Tt].get(i);if(r){this[Tt].delete(i);for(let n of r)n.pending=!1,this[Ti](n)}}this[je]()}[Ti](e){if(e.pending&&e.pendingLink&&e===this[Te]&&(e.pending=!1,e.pendingLink=!1),!e.pending){if(e.entry){e===this[Te]&&!e.piped&&this[Mi](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[Di](e,t):this[cr](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[Ni](e,t):this[fr](e),!e.readdir)return}if(e.entry=this[On](e),!e.entry){e.ignore=!0;return}e===this[Te]&&!e.piped&&this[Mi](e)}}}[ar](e){return{onwarn:(t,i,r)=>this.warn(t,i,r),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[On](e){this[Q]+=1;try{return new this[Li](e.path,this[ar](e)).on("end",()=>this[or](e)).on("error",i=>this.emit("error",i))}catch(t){this.emit("error",t)}}[hr](){this[Te]&&this[Te].entry&&this[Te].entry.resume()}[Mi](e){e.piped=!0,e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Pi](o+r)});let t=e.entry,i=this.zip;if(!t)throw new Error("cannot pipe without source");i?t.on("data",r=>{i.write(r)||t.pause()}):t.on("data",r=>{super.write(r)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){(0,bh.warnMethod)(this,e,t,i)}};L.Pack=Ii;var dr=class extends Ii{sync=!0;constructor(e){super(e),this[Li]=ur.WriteEntrySync}pause(){}resume(){}[cr](e){let t=this.follow?"statSync":"lstatSync";this[Di](e,Ai.default[t](e.absolute))}[fr](e){this[Ni](e,Ai.default.readdirSync(e.absolute))}[Mi](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Pi](o+r)}),!t)throw new Error("Cannot pipe without source");i?t.on("data",r=>{i.write(r)}):t.on("data",r=>{super[Tn](r)})}};L.PackSync=dr});var mr=d(ht=>{"use strict";var Sh=ht&&ht.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ht,"__esModule",{value:!0});ht.create=void 0;var Dn=Ke(),Pn=Sh(__nccwpck_require__(76760)),Nn=rt(),gh=Ve(),Ci=Fi(),Oh=(s,e)=>{let t=new Ci.PackSync(s),i=new Dn.WriteStreamSync(s.file,{mode:s.mode||438});t.pipe(i),Mn(t,e)},Rh=(s,e)=>{let t=new Ci.Pack(s),i=new Dn.WriteStream(s.file,{mode:s.mode||438});t.pipe(i);let r=new Promise((n,o)=>{i.on("error",o),i.on("close",n),t.on("error",o)});return Ln(t,e).catch(n=>t.emit("error",n)),r},Mn=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,Nn.list)({file:Pn.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},Ln=async(s,e)=>{for(let t of e)t.charAt(0)==="@"?await(0,Nn.list)({file:Pn.default.resolve(String(s.cwd),t.slice(1)),noResume:!0,onReadEntry:i=>{s.add(i)}}):s.add(t);s.end()},vh=(s,e)=>{let t=new Ci.PackSync(s);return Mn(t,e),t},Th=(s,e)=>{let t=new Ci.Pack(s);return Ln(t,e).catch(i=>t.emit("error",i)),t};ht.create=(0,gh.makeCommand)(Oh,Rh,vh,Th,(s,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var jn=d(lt=>{"use strict";var Dh=lt&<.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(lt,"__esModule",{value:!0});lt.getWriteFlag=void 0;var Fn=Dh(__nccwpck_require__(79896)),Ph=process.env.__FAKE_PLATFORM__||process.platform,Cn=Ph==="win32",{O_CREAT:Bn,O_NOFOLLOW:An,O_TRUNC:zn,O_WRONLY:kn}=Fn.default.constants,xn=Number(process.env.__FAKE_FS_O_FILENAME__)||Fn.default.constants.UV_FS_O_FILEMAP||0,Nh=Cn&&!!xn,Mh=512*1024,Lh=xn|zn|Bn|kn,In=!Cn&&typeof An=="number"?An|zn|Bn|kn:null;lt.getWriteFlag=In!==null?()=>In:Nh?s=>s<Mh?Lh:"w":()=>"w"});var qn=d(he=>{"use strict";var Un=he&&he.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(he,"__esModule",{value:!0});he.chownrSync=he.chownr=void 0;var zi=Un(__nccwpck_require__(73024)),Nt=Un(__nccwpck_require__(76760)),pr=(s,e,t)=>{try{return zi.default.lchownSync(s,e,t)}catch(i){if(i?.code!=="ENOENT")throw i}},Bi=(s,e,t,i)=>{zi.default.lchown(s,e,t,r=>{i(r&&r?.code!=="ENOENT"?r:null)})},Ah=(s,e,t,i,r)=>{if(e.isDirectory())(0,he.chownr)(Nt.default.resolve(s,e.name),t,i,n=>{if(n)return r(n);let o=Nt.default.resolve(s,e.name);Bi(o,t,i,r)});else{let n=Nt.default.resolve(s,e.name);Bi(n,t,i,r)}},Ih=(s,e,t,i)=>{zi.default.readdir(s,{withFileTypes:!0},(r,n)=>{if(r){if(r.code==="ENOENT")return i();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return i(r)}if(r||!n.length)return Bi(s,e,t,i);let o=n.length,h=null,a=l=>{if(!h){if(l)return i(h=l);if(--o===0)return Bi(s,e,t,i)}};for(let l of n)Ah(s,l,e,t,a)})};he.chownr=Ih;var Fh=(s,e,t,i)=>{e.isDirectory()&&(0,he.chownrSync)(Nt.default.resolve(s,e.name),t,i),pr(Nt.default.resolve(s,e.name),t,i)},Ch=(s,e,t)=>{let i;try{i=zi.default.readdirSync(s,{withFileTypes:!0})}catch(r){let n=r;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return pr(s,e,t);throw n}for(let r of i)Fh(s,r,e,t);return pr(s,e,t)};he.chownrSync=Ch});var Wn=d(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.CwdError=void 0;var _r=class extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}};ki.CwdError=_r});var yr=d(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.SymlinkError=void 0;var wr=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}};xi.SymlinkError=wr});var Kn=d(De=>{"use strict";var br=De&&De.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(De,"__esModule",{value:!0});De.mkdirSync=De.mkdir=void 0;var Hn=qn(),j=br(__nccwpck_require__(73024)),Bh=br(__nccwpck_require__(51455)),ji=br(__nccwpck_require__(76760)),Zn=Wn(),pe=tt(),Gn=yr(),zh=(s,e)=>{j.default.stat(s,(t,i)=>{(t||!i.isDirectory())&&(t=new Zn.CwdError(s,t?.code||"ENOTDIR")),e(t)})},kh=(s,e,t)=>{s=(0,pe.normalizeWindowsPath)(s);let i=e.umask??18,r=e.mode|448,n=(r&i)!==0,o=e.uid,h=e.gid,a=typeof o=="number"&&typeof h=="number"&&(o!==e.processUid||h!==e.processGid),l=e.preserve,u=e.unlink,c=(0,pe.normalizeWindowsPath)(e.cwd),E=(w,P)=>{w?t(w):P&&a?(0,Hn.chownr)(P,o,h,kt=>E(kt)):n?j.default.chmod(s,r,t):t()};if(s===c)return zh(s,E);if(l)return Bh.default.mkdir(s,{mode:r,recursive:!0}).then(w=>E(null,w??void 0),E);let A=(0,pe.normalizeWindowsPath)(ji.default.relative(c,s)).split("/");Er(c,A,r,u,c,void 0,E)};De.mkdir=kh;var Er=(s,e,t,i,r,n,o)=>{if(e.length===0)return o(null,n);let h=e.shift(),a=(0,pe.normalizeWindowsPath)(ji.default.resolve(s+"/"+h));j.default.mkdir(a,t,Yn(a,e,t,i,r,n,o))},Yn=(s,e,t,i,r,n,o)=>h=>{h?j.default.lstat(s,(a,l)=>{if(a)a.path=a.path&&(0,pe.normalizeWindowsPath)(a.path),o(a);else if(l.isDirectory())Er(s,e,t,i,r,n,o);else if(i)j.default.unlink(s,u=>{if(u)return o(u);j.default.mkdir(s,t,Yn(s,e,t,i,r,n,o))});else{if(l.isSymbolicLink())return o(new Gn.SymlinkError(s,s+"/"+e.join("/")));o(h)}}):(n=n||s,Er(s,e,t,i,r,n,o))},xh=s=>{let e=!1,t;try{e=j.default.statSync(s).isDirectory()}catch(i){t=i?.code}finally{if(!e)throw new Zn.CwdError(s,t??"ENOTDIR")}},jh=(s,e)=>{s=(0,pe.normalizeWindowsPath)(s);let t=e.umask??18,i=e.mode|448,r=(i&t)!==0,n=e.uid,o=e.gid,h=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),a=e.preserve,l=e.unlink,u=(0,pe.normalizeWindowsPath)(e.cwd),c=w=>{w&&h&&(0,Hn.chownrSync)(w,n,o),r&&j.default.chmodSync(s,i)};if(s===u)return xh(u),c();if(a)return c(j.default.mkdirSync(s,{mode:i,recursive:!0})??void 0);let D=(0,pe.normalizeWindowsPath)(ji.default.relative(u,s)).split("/"),A;for(let w=D.shift(),P=u;w&&(P+="/"+w);w=D.shift()){P=(0,pe.normalizeWindowsPath)(ji.default.resolve(P));try{j.default.mkdirSync(P,i),A=A||P}catch{let kt=j.default.lstatSync(P);if(kt.isDirectory())continue;if(l){j.default.unlinkSync(P),j.default.mkdirSync(P,i),A=A||P;continue}else if(kt.isSymbolicLink())return new Gn.SymlinkError(P,P+"/"+D.join("/"))}}return c(A)};De.mkdirSync=jh});var $n=d(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.normalizeUnicode=void 0;var Sr=Object.create(null),Vn=1e4,ut=new Set,Uh=s=>{ut.has(s)?ut.delete(s):Sr[s]=s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),ut.add(s);let e=Sr[s],t=ut.size-Vn;if(t>Vn/10){for(let i of ut)if(ut.delete(i),delete Sr[i],--t<=0)break}return e};Ui.normalizeUnicode=Uh});var Qn=d(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.PathReservations=void 0;var Xn=__nccwpck_require__(76760),qh=$n(),Wh=wi(),Hh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Zh=Hh==="win32",Gh=s=>s.split("/").slice(0,-1).reduce((t,i)=>{let r=t.at(-1);return r!==void 0&&(i=(0,Xn.join)(r,i)),t.push(i||"/"),t},[]),gr=class{#e=new Map;#i=new Map;#s=new Set;reserve(e,t){e=Zh?["win32 parallelization disabled"]:e.map(r=>(0,Wh.stripTrailingSlashes)((0,Xn.join)((0,qh.normalizeUnicode)(r))));let i=new Set(e.map(r=>Gh(r)).reduce((r,n)=>r.concat(n)));this.#i.set(t,{dirs:i,paths:e});for(let r of e){let n=this.#e.get(r);n?n.push(t):this.#e.set(r,[t])}for(let r of i){let n=this.#e.get(r);if(!n)this.#e.set(r,[new Set([t])]);else{let o=n.at(-1);o instanceof Set?o.add(t):n.push(new Set([t]))}}return this.#r(t)}#n(e){let t=this.#i.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(i=>this.#e.get(i)),dirs:[...t.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:t,dirs:i}=this.#n(e);return t.every(r=>r&&r[0]===e)&&i.every(r=>r&&r[0]instanceof Set&&r[0].has(e))}#r(e){return this.#s.has(e)||!this.check(e)?!1:(this.#s.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#s.has(e))return!1;let t=this.#i.get(e);if(!t)throw new Error("invalid reservation");let{paths:i,dirs:r}=t,n=new Set;for(let o of i){let h=this.#e.get(o);if(!h||h?.[0]!==e)continue;let a=h[1];if(!a){this.#e.delete(o);continue}if(h.shift(),typeof a=="function")n.add(a);else for(let l of a)n.add(l)}for(let o of r){let h=this.#e.get(o),a=h?.[0];if(!(!h||!(a instanceof Set)))if(a.size===1&&h.length===1){this.#e.delete(o);continue}else if(a.size===1){h.shift();let l=h[0];typeof l=="function"&&n.add(l)}else a.delete(e)}return this.#s.delete(e),n.forEach(o=>this.#r(o)),!0}};qi.PathReservations=gr});var Jn=d(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.umask=void 0;var Yh=()=>process.umask();Wi.umask=Yh});var Ir=d(k=>{"use strict";var Kh=k&&k.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Vh=k&&k.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),lo=k&&k.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Kh(t,e,i[r]);return Vh(t,e),t}})(),Ar=k&&k.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(k,"__esModule",{value:!0});k.UnpackSync=k.Unpack=void 0;var $h=lo(Ke()),Xh=Ar(__nccwpck_require__(34589)),uo=__nccwpck_require__(77598),m=Ar(__nccwpck_require__(73024)),g=Ar(__nccwpck_require__(76760)),co=jn(),fo=Kn(),U=tt(),Qh=pi(),Jh=Hs(),eo=lo(Gs()),el=Qn(),mo=yr(),tl=Jn(),to=Symbol("onEntry"),Tr=Symbol("checkFs"),io=Symbol("checkFs2"),Dr=Symbol("isReusable"),Z=Symbol("makeFs"),Pr=Symbol("file"),Nr=Symbol("directory"),Zi=Symbol("link"),so=Symbol("symlink"),ro=Symbol("hardlink"),Lt=Symbol("ensureNoSymlink"),no=Symbol("unsupported"),oo=Symbol("checkPath"),Or=Symbol("stripAbsolutePath"),Pe=Symbol("mkdir"),T=Symbol("onError"),Hi=Symbol("pending"),ao=Symbol("pend"),ct=Symbol("unpend"),Rr=Symbol("ended"),vr=Symbol("maybeClose"),Mr=Symbol("skip"),At=Symbol("doChown"),It=Symbol("uid"),Ft=Symbol("gid"),Ct=Symbol("checkedCwd"),il=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Bt=il==="win32",sl=1024,rl=(s,e)=>{if(!Bt)return m.default.unlink(s,e);let t=s+".DELETE."+(0,uo.randomBytes)(16).toString("hex");m.default.rename(s,t,i=>{if(i)return e(i);m.default.unlink(t,e)})},nl=s=>{if(!Bt)return m.default.unlinkSync(s);let e=s+".DELETE."+(0,uo.randomBytes)(16).toString("hex");m.default.renameSync(s,e),m.default.unlinkSync(e)},ho=(s,e,t)=>s!==void 0&&s===s>>>0?s:e!==void 0&&e===e>>>0?e:t,Gi=class extends Qh.Parser{[Rr]=!1;[Ct]=!1;[Hi]=0;reservations=new el.PathReservations;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[Rr]=!0,this[vr]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=e.preserveOwner===void 0&&typeof e.uid!="number"?!!(process.getuid&&process.getuid()===0):!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:sl,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Bt,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,U.normalizeWindowsPath)(g.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:(0,tl.umask)():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[to](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[vr](){this[Rr]&&this[Hi]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Or](e,t){let i=e[t],{type:r}=e;if(!i||this.preservePaths)return!0;let[n,o]=(0,Jh.stripAbsolutePath)(i),h=o.replaceAll(/\\/g,"/").split("/");if(h.includes("..")||Bt&&/^[a-z]:\.\.$/i.test(h[0]??"")){if(t==="path"||r==="Link")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:i}),!1;let a=g.default.posix.dirname(e.path),l=g.default.posix.normalize(g.default.posix.join(a,h.join("/")));if(l.startsWith("../")||l==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:i}),!1}return n&&(e[t]=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${t}`,{entry:e,[t]:i})),!0}[oo](e){let t=(0,U.normalizeWindowsPath)(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if(e.type==="Link"){let r=(0,U.normalizeWindowsPath)(String(e.linkpath)).split("/");if(r.length>=this.strip)e.linkpath=r.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[Or](e,"path")||!this[Or](e,"linkpath"))return!1;if(e.absolute=g.default.isAbsolute(e.path)?(0,U.normalizeWindowsPath)(g.default.resolve(e.path)):(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,U.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=g.default.win32.parse(String(e.absolute));e.absolute=r+eo.encode(String(e.absolute).slice(r.length));let{root:n}=g.default.win32.parse(e.path);e.path=n+eo.encode(e.path.slice(n.length))}return!0}[to](e){if(!this[oo](e))return e.resume();switch(Xh.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Tr](e);default:return this[no](e)}}[T](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ct](),t.resume())}[Pe](e,t,i){(0,fo.mkdir)((0,U.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},i)}[At](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[It](e){return ho(this.uid,e.uid,this.processUid)}[Ft](e){return ho(this.gid,e.gid,this.processGid)}[Pr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=new $h.WriteStream(String(e.absolute),{flags:(0,co.getWriteFlag)(e.size),mode:i,autoClose:!1});r.on("error",a=>{r.fd&&m.default.close(r.fd,()=>{}),r.write=()=>!0,this[T](a,e),t()});let n=1,o=a=>{if(a){r.fd&&m.default.close(r.fd,()=>{}),this[T](a,e),t();return}--n===0&&r.fd!==void 0&&m.default.close(r.fd,l=>{l?this[T](l,e):this[ct](),t()})};r.on("finish",()=>{let a=String(e.absolute),l=r.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let u=e.atime||new Date,c=e.mtime;m.default.futimes(l,u,c,E=>E?m.default.utimes(a,u,c,D=>o(D&&E)):o())}if(typeof l=="number"&&this[At](e)){n++;let u=this[It](e),c=this[Ft](e);typeof u=="number"&&typeof c=="number"&&m.default.fchown(l,u,c,E=>E?m.default.chown(a,u,c,D=>o(D&&E)):o())}o()});let h=this.transform&&this.transform(e)||e;h!==e&&(h.on("error",a=>{this[T](a,e),t()}),e.pipe(h)),h.pipe(r)}[Nr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Pe](String(e.absolute),i,r=>{if(r){this[T](r,e),t();return}let n=1,o=()=>{--n===0&&(t(),this[ct](),e.resume())};e.mtime&&!this.noMtime&&(n++,m.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,o)),this[At](e)&&(n++,m.default.chown(String(e.absolute),Number(this[It](e)),Number(this[Ft](e)),o)),o()})}[no](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[so](e,t){let i=(0,U.normalizeWindowsPath)(g.default.relative(this.cwd,g.default.resolve(g.default.dirname(String(e.absolute)),String(e.linkpath)))).split("/");this[Lt](e,this.cwd,i,()=>this[Zi](e,String(e.linkpath),"symlink",t),r=>{this[T](r,e),t()})}[ro](e,t){let i=(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,String(e.linkpath))),r=(0,U.normalizeWindowsPath)(String(e.linkpath)).split("/");this[Lt](e,this.cwd,r,()=>this[Zi](e,i,"link",t),n=>{this[T](n,e),t()})}[Lt](e,t,i,r,n){let o=i.shift();if(this.preservePaths||o===void 0)return r();let h=g.default.resolve(t,o);m.default.lstat(h,(a,l)=>{if(a)return r();if(l?.isSymbolicLink())return n(new mo.SymlinkError(h,g.default.resolve(h,i.join("/"))));this[Lt](e,h,i,r,n)})}[ao](){this[Hi]++}[ct](){this[Hi]--,this[vr]()}[Mr](e){this[ct](),e.resume()}[Dr](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Bt}[Tr](e){this[ao]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[io](e,i))}[io](e,t){let i=h=>{t(h)},r=()=>{this[Pe](this.cwd,this.dmode,h=>{if(h){this[T](h,e),i();return}this[Ct]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let h=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(h!==this.cwd)return this[Pe](h,this.dmode,a=>{if(a){this[T](a,e),i();return}o()})}o()},o=()=>{m.default.lstat(String(e.absolute),(h,a)=>{if(a&&(this.keep||this.newer&&a.mtime>(e.mtime??a.mtime))){this[Mr](e),i();return}if(h||this[Dr](e,a))return this[Z](null,e,i);if(a.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(a.mode&4095)!==e.mode,u=c=>this[Z](c??null,e,i);return l?m.default.chmod(String(e.absolute),Number(e.mode),u):u()}if(e.absolute!==this.cwd)return m.default.rmdir(String(e.absolute),l=>this[Z](l??null,e,i))}if(e.absolute===this.cwd)return this[Z](null,e,i);rl(String(e.absolute),l=>this[Z](l??null,e,i))})};this[Ct]?n():r()}[Z](e,t,i){if(e){this[T](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Pr](t,i);case"Link":return this[ro](t,i);case"SymbolicLink":return this[so](t,i);case"Directory":case"GNUDumpDir":return this[Nr](t,i)}}[Zi](e,t,i,r){m.default[i](t,String(e.absolute),n=>{n?this[T](n,e):(this[ct](),e.resume()),r()})}};k.Unpack=Gi;var Mt=s=>{try{return[null,s()]}catch(e){return[e,null]}},Lr=class extends Gi{sync=!0;[Z](e,t){return super[Z](e,t,()=>{})}[Tr](e){if(!this[Ct]){let n=this[Pe](this.cwd,this.dmode);if(n)return this[T](n,e);this[Ct]=!0}if(e.absolute!==this.cwd){let n=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(n!==this.cwd){let o=this[Pe](n,this.dmode);if(o)return this[T](o,e)}}let[t,i]=Mt(()=>m.default.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[Mr](e);if(t||this[Dr](e,i))return this[Z](null,e);if(i.isDirectory()){if(e.type==="Directory"){let o=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[h]=o?Mt(()=>{m.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[Z](h,e)}let[n]=Mt(()=>m.default.rmdirSync(String(e.absolute)));this[Z](n,e)}let[r]=e.absolute===this.cwd?[]:Mt(()=>nl(String(e.absolute)));this[Z](r,e)}[Pr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=h=>{let a;try{m.default.closeSync(n)}catch(l){a=l}(h||a)&&this[T](h||a,e),t()},n;try{n=m.default.openSync(String(e.absolute),(0,co.getWriteFlag)(e.size),i)}catch(h){return r(h)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",h=>this[T](h,e)),e.pipe(o)),o.on("data",h=>{try{m.default.writeSync(n,h,0,h.length)}catch(a){r(a)}}),o.on("end",()=>{let h=null;if(e.mtime&&!this.noMtime){let a=e.atime||new Date,l=e.mtime;try{m.default.futimesSync(n,a,l)}catch(u){try{m.default.utimesSync(String(e.absolute),a,l)}catch{h=u}}}if(this[At](e)){let a=this[It](e),l=this[Ft](e);try{m.default.fchownSync(n,Number(a),Number(l))}catch(u){try{m.default.chownSync(String(e.absolute),Number(a),Number(l))}catch{h=h||u}}}r(h)})}[Nr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,r=this[Pe](String(e.absolute),i);if(r){this[T](r,e),t();return}if(e.mtime&&!this.noMtime)try{m.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[At](e))try{m.default.chownSync(String(e.absolute),Number(this[It](e)),Number(this[Ft](e)))}catch{}t(),e.resume()}[Pe](e,t){try{return(0,fo.mkdirSync)((0,U.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(i){return i}}[Lt](e,t,i,r,n){if(this.preservePaths||i.length===0)return r();let o=t;for(let h of i){o=g.default.resolve(o,h);let[a,l]=Mt(()=>m.default.lstatSync(o));if(a)return r();if(l.isSymbolicLink())return n(new mo.SymlinkError(o,g.default.resolve(t,i.join("/"))))}r()}[Zi](e,t,i,r){let n=`${i}Sync`;try{m.default[n](t,String(e.absolute)),r(),e.resume()}catch(o){return this[T](o,e)}}};k.UnpackSync=Lr});var Fr=d(G=>{"use strict";var ol=G&&G.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),al=G&&G.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),hl=G&&G.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&ol(t,e,i[r]);return al(t,e),t}})(),ll=G&&G.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(G,"__esModule",{value:!0});G.extract=void 0;var po=hl(Ke()),_o=ll(__nccwpck_require__(73024)),ul=rt(),cl=Ve(),Yi=Ir(),fl=s=>{let e=new Yi.UnpackSync(s),t=s.file,i=_o.default.statSync(t),r=s.maxReadSize||16*1024*1024;new po.ReadStreamSync(t,{readSize:r,size:i.size}).pipe(e)},dl=(s,e)=>{let t=new Yi.Unpack(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,h)=>{t.on("error",h),t.on("close",o),_o.default.stat(r,(a,l)=>{if(a)h(a);else{let u=new po.ReadStream(r,{readSize:i,size:l.size});u.on("error",h),u.pipe(t)}})})};G.extract=(0,cl.makeCommand)(fl,dl,s=>new Yi.UnpackSync(s),s=>new Yi.Unpack(s),(s,e)=>{e?.length&&(0,ul.filesFilter)(s,e)})});var Ki=d(ft=>{"use strict";var wo=ft&&ft.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ft,"__esModule",{value:!0});ft.replace=void 0;var yo=Ke(),q=wo(__nccwpck_require__(73024)),Eo=wo(__nccwpck_require__(76760)),bo=et(),So=rt(),ml=Ve(),pl=Xt(),go=Fi(),_l=(s,e)=>{let t=new go.PackSync(s),i=!0,r,n;try{try{r=q.default.openSync(s.file,"r+")}catch(a){if(a?.code==="ENOENT")r=q.default.openSync(s.file,"w+");else throw a}let o=q.default.fstatSync(r),h=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let u=0,c=0;u<512;u+=c){if(c=q.default.readSync(r,h,u,h.length-u,n+u),n===0&&h[0]===31&&h[1]===139)throw new Error("cannot append to compressed archives");if(!c)break e}let a=new bo.Header(h);if(!a.cksumValid)break;let l=512*Math.ceil((a.size||0)/512);if(n+l+512>o.size)break;n+=l,s.mtimeCache&&a.mtime&&s.mtimeCache.set(String(a.path),a.mtime)}i=!1,wl(s,t,n,r,e)}finally{if(i)try{q.default.closeSync(r)}catch{}}},wl=(s,e,t,i,r)=>{let n=new yo.WriteStreamSync(s.file,{fd:i,start:t});e.pipe(n),El(e,r)},yl=(s,e)=>{e=Array.from(e);let t=new go.Pack(s),i=(n,o,h)=>{let a=(D,A)=>{D?q.default.close(n,w=>h(D)):h(null,A)},l=0;if(o===0)return a(null,0);let u=0,c=Buffer.alloc(512),E=(D,A)=>{if(D||A===void 0)return a(D);if(u+=A,u<512&&A)return q.default.read(n,c,u,c.length-u,l+u,E);if(l===0&&c[0]===31&&c[1]===139)return a(new Error("cannot append to compressed archives"));if(u<512)return a(null,l);let w=new bo.Header(c);if(!w.cksumValid)return a(null,l);let P=512*Math.ceil((w.size??0)/512);if(l+P+512>o||(l+=P+512,l>=o))return a(null,l);s.mtimeCache&&w.mtime&&s.mtimeCache.set(String(w.path),w.mtime),u=0,q.default.read(n,c,0,512,l,E)};q.default.read(n,c,0,512,l,E)};return new Promise((n,o)=>{t.on("error",o);let h="r+",a=(l,u)=>{if(l&&l.code==="ENOENT"&&h==="r+")return h="w+",q.default.open(s.file,h,a);if(l||!u)return o(l);q.default.fstat(u,(c,E)=>{if(c)return q.default.close(u,()=>o(c));i(u,E.size,(D,A)=>{if(D)return o(D);let w=new yo.WriteStream(s.file,{fd:u,start:A});t.pipe(w),w.on("error",o),w.on("close",n),bl(t,e)})})};q.default.open(s.file,h,a)})},El=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,So.list)({file:Eo.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},bl=async(s,e)=>{for(let t of e)t.charAt(0)==="@"?await(0,So.list)({file:Eo.default.resolve(String(s.cwd),t.slice(1)),noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t);s.end()};ft.replace=(0,ml.makeCommand)(_l,yl,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(s,e)=>{if(!(0,pl.isFile)(s))throw new TypeError("file is required");if(s.gzip||s.brotli||s.zstd||s.file.endsWith(".br")||s.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var Cr=d(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.update=void 0;var Sl=Ve(),zt=Ki();Vi.update=(0,Sl.makeCommand)(zt.replace.syncFile,zt.replace.asyncFile,zt.replace.syncNoFile,zt.replace.asyncNoFile,(s,e=[])=>{zt.replace.validate?.(s,e),gl(s)});var gl=s=>{let e=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=e?(t,i)=>e(t,i)&&!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0)):(t,i)=>!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0))}});var Oo=exports&&exports.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Ol=exports&&exports.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Y=exports&&exports.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Oo(e,s,t)},Rl=exports&&exports.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r<i.length;r++)i[r]!=="default"&&Oo(t,e,i[r]);return Ol(t,e),t}})();Object.defineProperty(exports, "__esModule", ({value:!0}));exports.u=exports.types=exports.r=exports.t=exports.x=exports.c=void 0;Y(mr(),exports);var vl=mr();Object.defineProperty(exports, "c", ({enumerable:!0,get:function(){return vl.create}}));Y(Fr(),exports);var Tl=Fr();Object.defineProperty(exports, "x", ({enumerable:!0,get:function(){return Tl.extract}}));Y(et(),exports);Y(rt(),exports);var Dl=rt();Object.defineProperty(exports, "t", ({enumerable:!0,get:function(){return Dl.list}}));Y(Fi(),exports);Y(pi(),exports);Y(ii(),exports);Y(Fs(),exports);Y(Ki(),exports);var Pl=Ki();Object.defineProperty(exports, "r", ({enumerable:!0,get:function(){return Pl.replace}}));exports.types=Rl(Ps());Y(Ir(),exports);Y(Cr(),exports);var Nl=Cr();Object.defineProperty(exports, "u", ({enumerable:!0,get:function(){return Nl.update}}));Y(sr(),exports);
|
|
125987
127338
|
//# sourceMappingURL=index.min.js.map
|
|
125988
127339
|
|
|
125989
127340
|
|
|
@@ -128150,7 +129501,7 @@ module.exports = {"version":"3.17.0"};
|
|
|
128150
129501
|
/***/ ((module) => {
|
|
128151
129502
|
|
|
128152
129503
|
"use strict";
|
|
128153
|
-
module.exports = /*#__PURE__*/JSON.parse('{"rE":"0.4.
|
|
129504
|
+
module.exports = /*#__PURE__*/JSON.parse('{"rE":"0.4.9-canary-2b6b3af.0","h_":"ckb development network for your first try"}');
|
|
128154
129505
|
|
|
128155
129506
|
/***/ })
|
|
128156
129507
|
|