linkque-cli-v2 1.6.5 → 1.6.7
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/dev/worker.js +16 -3
- package/linkquejs.js +1018 -634
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/anthropic-messages-GSYNBLMR.js +17 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{azure-openai-responses-HVAVRLTK.js → azure-openai-responses-NPKMM3LF.js} +7 -9
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-IATVK6CO.js → chunk-C2TN5LPS.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-Q2Y6LMNC.js → chunk-J4JCPZDI.js} +5 -7
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-4XAZNSEQ.js → chunk-JMBJJF7P.js} +18 -5
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{anthropic-messages-5DOLTIGP.js → chunk-KDHBKVSL.js} +14 -15
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-DNTEEBEH.js → chunk-SICWMO5Y.js} +1 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-Y3G4J3TB.js → chunk-XOLFZ4XS.js} +316 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-UTJ7DVT7.js → chunk-Y2STWI2J.js} +437 -68
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-YZLXAZFT.js → chunk-Z2A5GMVJ.js} +60 -10
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{dist-ZPLSQEAM.js → dist-TGBYXSBU.js} +27 -42
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-bsd-JGCLGHFY.js → getMachineId-bsd-NYGVHXGN.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-darwin-COHLFNXH.js → getMachineId-darwin-OPTJOAYC.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-linux-XV3Z5FQG.js → getMachineId-linux-5SQRYTUJ.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-unsupported-FCRKLIZL.js → getMachineId-unsupported-OJE7WPEH.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-win-A4WRNVV6.js → getMachineId-win-SLTTCNXU.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-OLT56CSV.js → google-generative-ai-KD7MXONK.js} +8 -10
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-4DBBJ7SR.js → google-vertex-TREYA472.js} +9 -11
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-OEBGEDLQ.js → mistral-conversations-C43A6QIS.js} +8 -10
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-codex-responses-3KOC6KHN.js → openai-codex-responses-GEFKSNVN.js} +10 -12
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-completions-HG6OJRL5.js → openai-completions-TAACO6T5.js} +13 -15
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-responses-F6V2PG3Y.js → openai-responses-4DDTXIGI.js} +12 -14
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-WGS5CC2J.js → otel-RUUFBBFE.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +217 -78
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +3 -3
- package/worker.js +380 -97
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-RYONFGPP.js +0 -317
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{pi-messages-DC4DVRAJ.js → pi-messages-7JN3W3BC.js} +4 -4
package/linkquejs.js
CHANGED
|
@@ -12135,7 +12135,7 @@ var require_dist = __commonJS({
|
|
|
12135
12135
|
});
|
|
12136
12136
|
|
|
12137
12137
|
// ../../node_modules/@zip.js/zip.js/lib/core/constants.js
|
|
12138
|
-
var MAX_32_BITS, MAX_16_BITS, MAX_8_BITS, COMPRESSION_METHOD_DEFLATE, COMPRESSION_METHOD_DEFLATE_64, COMPRESSION_METHOD_STORE, COMPRESSION_METHOD_AES, LOCAL_FILE_HEADER_SIGNATURE, SPLIT_ZIP_FILE_SIGNATURE, TEMPORARY_SPLIT_ZIP_FILE_SIGNATURE, DATA_DESCRIPTOR_RECORD_SIGNATURE, ARCHIVE_EXTRA_DATA_SIGNATURE, DIGITAL_SIGNATURE_RECORD_SIGNATURE, CENTRAL_FILE_HEADER_SIGNATURE, END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE, CENTRAL_FILE_HEADER_LENGTH, END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH, DATA_DESCRIPTOR_RECORD_LENGTH, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH, DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH, SPLIT_ZIP_FILE_SIGNATURE_LENGTH, EXTRAFIELD_TYPE_ZIP64, EXTRAFIELD_TYPE_AES, EXTRAFIELD_TYPE_NTFS, EXTRAFIELD_TYPE_NTFS_TAG1, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP, EXTRAFIELD_TYPE_UNICODE_PATH, EXTRAFIELD_TYPE_UNICODE_COMMENT, EXTRAFIELD_TYPE_USDZ, EXTRAFIELD_TYPE_INFOZIP, EXTRAFIELD_TYPE_UNIX, EXTRAFIELD_TYPE_UNIX_TYPE1, EXTRAFIELD_TYPE_PKWARE_UNIX, BITFLAG_ENCRYPTED, BITFLAG_LEVEL, BITFLAG_LEVEL_MAX_MASK, BITFLAG_LEVEL_FAST_MASK, BITFLAG_LEVEL_SUPER_FAST_MASK, BITFLAG_DATA_DESCRIPTOR, BITFLAG_COMPRESSED_PATCHED_DATA, BITFLAG_STRONG_ENCRYPTION, BITFLAG_LANG_ENCODING_FLAG, BITFLAG_MASKED_LOCAL_HEADERS, FILE_ATTR_MSDOS_DIR_MASK, FILE_ATTR_MSDOS_READONLY_MASK, FILE_ATTR_MSDOS_HIDDEN_MASK, FILE_ATTR_MSDOS_SYSTEM_MASK, FILE_ATTR_MSDOS_ARCHIVE_MASK, FILE_ATTR_UNIX_TYPE_MASK, FILE_ATTR_UNIX_TYPE_DIR, FILE_ATTR_UNIX_TYPE_SYMLINK, FILE_ATTR_UNIX_TYPE_FILE, FILE_ATTR_UNIX_EXECUTABLE_MASK, FILE_ATTR_UNIX_DEFAULT_MASK, FILE_ATTR_UNIX_SETUID_MASK, FILE_ATTR_UNIX_SETGID_MASK, FILE_ATTR_UNIX_STICKY_MASK, VERSION_STORE, VERSION_DEFLATE, VERSION_ZIP64, VERSION_AES, VERSION_MADE_BY_MSDOS, VERSION_MADE_BY_UNIX, DIRECTORY_SIGNATURE, HEADER_SIZE, HEADER_OFFSET_VERSION, HEADER_OFFSET_SIGNATURE, HEADER_OFFSET_COMPRESSED_SIZE, HEADER_OFFSET_UNCOMPRESSED_SIZE, HEADER_OFFSET_FILENAME_LENGTH, HEADER_OFFSET_EXTRAFIELD_LENGTH, LOCAL_HEADER_COMMON_OFFSET, MAX_DATE, MIN_DATE, UNDEFINED_VALUE, INFINITY_VALUE, UNDEFINED_TYPE, FUNCTION_TYPE, OBJECT_TYPE, STRING_TYPE, NUMBER_TYPE, BOOLEAN_TYPE, EMPTY_UINT8_ARRAY, SYMBOL_ASYNC_DISPOSE;
|
|
12138
|
+
var MAX_32_BITS, MAX_16_BITS, MAX_8_BITS, COMPRESSION_METHOD_DEFLATE, COMPRESSION_METHOD_DEFLATE_64, COMPRESSION_METHOD_STORE, COMPRESSION_METHOD_AES, LOCAL_FILE_HEADER_SIGNATURE, SPLIT_ZIP_FILE_SIGNATURE, TEMPORARY_SPLIT_ZIP_FILE_SIGNATURE, DATA_DESCRIPTOR_RECORD_SIGNATURE, ARCHIVE_EXTRA_DATA_SIGNATURE, DIGITAL_SIGNATURE_RECORD_SIGNATURE, CENTRAL_FILE_HEADER_SIGNATURE, END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE, CENTRAL_FILE_HEADER_LENGTH, END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH, DATA_DESCRIPTOR_RECORD_LENGTH, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH, DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH, SPLIT_ZIP_FILE_SIGNATURE_LENGTH, EXTRAFIELD_TYPE_ZIP64, EXTRAFIELD_TYPE_AES, EXTRAFIELD_TYPE_NTFS, EXTRAFIELD_TYPE_NTFS_TAG1, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP, EXTRAFIELD_TYPE_UNICODE_PATH, EXTRAFIELD_TYPE_UNICODE_COMMENT, EXTRAFIELD_TYPE_USDZ, EXTRAFIELD_TYPE_INFOZIP, EXTRAFIELD_TYPE_UNIX, EXTRAFIELD_TYPE_UNIX_TYPE1, EXTRAFIELD_TYPE_PKWARE_UNIX, BITFLAG_ENCRYPTED, BITFLAG_LEVEL, BITFLAG_LEVEL_MAX_MASK, BITFLAG_LEVEL_FAST_MASK, BITFLAG_LEVEL_SUPER_FAST_MASK, BITFLAG_DATA_DESCRIPTOR, BITFLAG_COMPRESSED_PATCHED_DATA, BITFLAG_STRONG_ENCRYPTION, BITFLAG_LANG_ENCODING_FLAG, BITFLAG_MASKED_LOCAL_HEADERS, FILE_ATTR_MSDOS_DIR_MASK, FILE_ATTR_MSDOS_READONLY_MASK, FILE_ATTR_MSDOS_HIDDEN_MASK, FILE_ATTR_MSDOS_SYSTEM_MASK, FILE_ATTR_MSDOS_ARCHIVE_MASK, FILE_ATTR_UNIX_TYPE_MASK, FILE_ATTR_UNIX_TYPE_DIR, FILE_ATTR_UNIX_TYPE_SYMLINK, FILE_ATTR_UNIX_TYPE_FILE, FILE_ATTR_UNIX_EXECUTABLE_MASK, FILE_ATTR_UNIX_DEFAULT_MASK, FILE_ATTR_UNIX_SETUID_MASK, FILE_ATTR_UNIX_SETGID_MASK, FILE_ATTR_UNIX_STICKY_MASK, VERSION_STORE, VERSION_DEFLATE, VERSION_ZIP64, VERSION_AES, VERSION_MADE_BY_MSDOS, VERSION_MADE_BY_UNIX, DIRECTORY_SIGNATURE, HEADER_SIZE, HEADER_OFFSET_VERSION, HEADER_OFFSET_SIGNATURE, HEADER_OFFSET_COMPRESSED_SIZE, HEADER_OFFSET_UNCOMPRESSED_SIZE, HEADER_OFFSET_FILENAME_LENGTH, HEADER_OFFSET_EXTRAFIELD_LENGTH, LOCAL_HEADER_COMMON_OFFSET, MAX_DATE, MIN_DATE, UNDEFINED_VALUE, INFINITY_VALUE, ERR_LOCAL_FILE_HEADER_NOT_FOUND, ERR_OVERLAPPING_ENTRY, ERR_EXTRAFIELD_ZIP64_NOT_FOUND, UNDEFINED_TYPE, FUNCTION_TYPE, OBJECT_TYPE, STRING_TYPE, NUMBER_TYPE, BOOLEAN_TYPE, EMPTY_UINT8_ARRAY, SYMBOL_ASYNC_DISPOSE;
|
|
12139
12139
|
var init_constants = __esm({
|
|
12140
12140
|
"../../node_modules/@zip.js/zip.js/lib/core/constants.js"() {
|
|
12141
12141
|
MAX_32_BITS = 4294967295;
|
|
@@ -12219,6 +12219,9 @@ var init_constants = __esm({
|
|
|
12219
12219
|
MIN_DATE = new Date(1980, 0, 1);
|
|
12220
12220
|
UNDEFINED_VALUE = void 0;
|
|
12221
12221
|
INFINITY_VALUE = Infinity;
|
|
12222
|
+
ERR_LOCAL_FILE_HEADER_NOT_FOUND = "Local file header not found";
|
|
12223
|
+
ERR_OVERLAPPING_ENTRY = "Overlapping entry found";
|
|
12224
|
+
ERR_EXTRAFIELD_ZIP64_NOT_FOUND = "Zip64 extra field not found";
|
|
12222
12225
|
UNDEFINED_TYPE = "undefined";
|
|
12223
12226
|
FUNCTION_TYPE = "function";
|
|
12224
12227
|
OBJECT_TYPE = "object";
|
|
@@ -12237,6 +12240,12 @@ function checkFunctionOption(value) {
|
|
|
12237
12240
|
}
|
|
12238
12241
|
return value;
|
|
12239
12242
|
}
|
|
12243
|
+
function checkReaderOptionsObject(readerOptions) {
|
|
12244
|
+
if (readerOptions && (typeof readerOptions != OBJECT_TYPE || Array.isArray(readerOptions))) {
|
|
12245
|
+
throw new Error(ERR_INVALID_READER_OPTIONS);
|
|
12246
|
+
}
|
|
12247
|
+
return readerOptions;
|
|
12248
|
+
}
|
|
12240
12249
|
function checkSignalOption(signal) {
|
|
12241
12250
|
if (signal && (typeof signal.addEventListener != FUNCTION_TYPE || typeof signal.aborted != BOOLEAN_TYPE)) {
|
|
12242
12251
|
throw new Error(ERR_INVALID_SIGNAL);
|
|
@@ -12272,7 +12281,7 @@ function checkIntegerOption(value, maxValue, errorMessage) {
|
|
|
12272
12281
|
function toNumber(value) {
|
|
12273
12282
|
return typeof value == STRING_TYPE && value.trim() ? Number(value) : value;
|
|
12274
12283
|
}
|
|
12275
|
-
var OPTION_FILENAME_ENCODING, OPTION_COMMENT_ENCODING, OPTION_DECODE_TEXT, OPTION_EXTRACT_PREPENDED_DATA, OPTION_EXTRACT_APPENDED_DATA, OPTION_PASSWORD, OPTION_RAW_PASSWORD, OPTION_PASS_THROUGH, OPTION_SIGNAL, OPTION_CHECK_PASSWORD_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY, OPTION_CHECK_AMBIGUITY, OPTION_CHECK_LOCAL_DIRECTORY, OPTION_CHECK_LOCAL_FILENAME, OPTION_CHECK_SIGNATURE, OPTION_CHECK_CRC32, OPTION_CHECK_AUTHENTICATION_CODE, OPTION_USE_WEB_WORKERS, OPTION_USE_COMPRESSION_STREAM,
|
|
12284
|
+
var OPTION_FILENAME_ENCODING, OPTION_COMMENT_ENCODING, OPTION_DECODE_TEXT, OPTION_EXTRACT_PREPENDED_DATA, OPTION_EXTRACT_APPENDED_DATA, OPTION_PASSWORD, OPTION_RAW_PASSWORD, OPTION_PASS_THROUGH, OPTION_SIGNAL, OPTION_CHECK_PASSWORD_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY, OPTION_CHECK_AMBIGUITY, OPTION_CHECK_LOCAL_DIRECTORY, OPTION_CHECK_LOCAL_FILENAME, OPTION_CHECK_SIGNATURE, OPTION_CHECK_CRC32, OPTION_CHECK_AUTHENTICATION_CODE, OPTION_USE_WEB_WORKERS, OPTION_USE_COMPRESSION_STREAM, OPTION_PREVENT_CLOSE, OPTION_ENCRYPTION_STRENGTH, OPTION_EXTENDED_TIMESTAMP, OPTION_NTFS_TIMESTAMP, OPTION_KEEP_ORDER, OPTION_LEVEL, OPTION_BUFFERED_WRITE, OPTION_CREATE_TEMP_STREAM, OPTION_DATA_DESCRIPTOR_SIGNATURE, OPTION_USE_UNICODE_FILE_NAMES, OPTION_DATA_DESCRIPTOR, OPTION_SUPPORT_ZIP64_SPLIT_FILE, OPTION_ENCODE_TEXT, OPTION_OFFSET, OPTION_USDZ, OPTION_UNIX_EXTRA_FIELD_TYPE, OPTION_LOCAL_EXTRA_FIELD, OPTION_CENTRAL_EXTRA_FIELD, OPTION_STRICTNESS, OPTION_FILENAME_VALIDATION, OPTION_NORMALIZE_FILENAME, OPTION_MAX_APPENDED_DATA_SIZE, OPTION_DECRYPT_CENTRAL_DIRECTORY, OPTION_SIGN_CENTRAL_DIRECTORY, OPTION_ENTRY, TEXT_TYPE_FILENAME, TEXT_TYPE_COMMENT, STRICTNESS_STRICT, STRICTNESS_BALANCED, STRICTNESS_TOLERANT, PASS_THROUGH_COMPRESSED, ERR_INVALID_FUNCTION_OPTION, ERR_INVALID_SIGNAL, ERR_INVALID_PASSWORD_TYPE, ERR_INVALID_PASS_THROUGH_VALUE, ERR_INVALID_READER_OPTIONS, ERR_ABORTED, ABORT_ERROR_NAME;
|
|
12276
12285
|
var init_options = __esm({
|
|
12277
12286
|
"../../node_modules/@zip.js/zip.js/lib/core/options.js"() {
|
|
12278
12287
|
init_constants();
|
|
@@ -12296,7 +12305,6 @@ var init_options = __esm({
|
|
|
12296
12305
|
OPTION_CHECK_AUTHENTICATION_CODE = "checkAuthenticationCode";
|
|
12297
12306
|
OPTION_USE_WEB_WORKERS = "useWebWorkers";
|
|
12298
12307
|
OPTION_USE_COMPRESSION_STREAM = "useCompressionStream";
|
|
12299
|
-
OPTION_TRANSFER_STREAMS = "transferStreams";
|
|
12300
12308
|
OPTION_PREVENT_CLOSE = "preventClose";
|
|
12301
12309
|
OPTION_ENCRYPTION_STRENGTH = "encryptionStrength";
|
|
12302
12310
|
OPTION_EXTENDED_TIMESTAMP = "extendedTimestamp";
|
|
@@ -12332,6 +12340,7 @@ var init_options = __esm({
|
|
|
12332
12340
|
ERR_INVALID_SIGNAL = "Invalid signal (must be an AbortSignal instance)";
|
|
12333
12341
|
ERR_INVALID_PASSWORD_TYPE = "Invalid password (password must be a string, rawPassword must be a Uint8Array)";
|
|
12334
12342
|
ERR_INVALID_PASS_THROUGH_VALUE = "Invalid passThrough option (must be a boolean or 'compressed')";
|
|
12343
|
+
ERR_INVALID_READER_OPTIONS = "Invalid readerOptions (must be an object)";
|
|
12335
12344
|
ERR_ABORTED = "The operation was aborted";
|
|
12336
12345
|
ABORT_ERROR_NAME = "AbortError";
|
|
12337
12346
|
}
|
|
@@ -12402,7 +12411,7 @@ var init_configuration = __esm({
|
|
|
12402
12411
|
"../../node_modules/@zip.js/zip.js/lib/core/configuration.js"() {
|
|
12403
12412
|
init_constants();
|
|
12404
12413
|
init_options();
|
|
12405
|
-
DEFAULT_CHUNK_SIZE =
|
|
12414
|
+
DEFAULT_CHUNK_SIZE = 256 * 1024;
|
|
12406
12415
|
MINIMUM_CHUNK_SIZE = 64;
|
|
12407
12416
|
MINIMUM_PROPERTY_VALUE = 1;
|
|
12408
12417
|
ERR_INVALID_MAX_WORKERS = "Invalid maxWorkers (must be an integer greater than 0)";
|
|
@@ -12425,7 +12434,6 @@ var init_configuration = __esm({
|
|
|
12425
12434
|
workerStartupTimeout: 5e3,
|
|
12426
12435
|
useWebWorkers: true,
|
|
12427
12436
|
useCompressionStream: true,
|
|
12428
|
-
transferStreams: true,
|
|
12429
12437
|
CompressionStream: typeof CompressionStream != UNDEFINED_TYPE && CompressionStream,
|
|
12430
12438
|
DecompressionStream: typeof DecompressionStream != UNDEFINED_TYPE && DecompressionStream
|
|
12431
12439
|
};
|
|
@@ -12437,8 +12445,7 @@ var init_configuration = __esm({
|
|
|
12437
12445
|
];
|
|
12438
12446
|
BOOLEAN_PROPERTY_NAMES = [
|
|
12439
12447
|
"useCompressionStream",
|
|
12440
|
-
"useWebWorkers"
|
|
12441
|
-
"transferStreams"
|
|
12448
|
+
"useWebWorkers"
|
|
12442
12449
|
];
|
|
12443
12450
|
NUMBER_PROPERTY_NAMES = [
|
|
12444
12451
|
"chunkSize",
|
|
@@ -13060,7 +13067,37 @@ function initAesCrypto(aesCrypto, password, rawPassword, encryptionStrength) {
|
|
|
13060
13067
|
ready: new Promise((resolve2) => aesCrypto.resolveReady = resolve2),
|
|
13061
13068
|
password: encodePassword(password, rawPassword),
|
|
13062
13069
|
strength: encryptionStrength - 1,
|
|
13063
|
-
pendingInput: EMPTY_UINT8_ARRAY
|
|
13070
|
+
pendingInput: EMPTY_UINT8_ARRAY,
|
|
13071
|
+
discarded: false
|
|
13072
|
+
});
|
|
13073
|
+
}
|
|
13074
|
+
function setDisposingReadable(stream, aesCrypto) {
|
|
13075
|
+
const reader = stream.readable.getReader();
|
|
13076
|
+
const readable = new ReadableStream({
|
|
13077
|
+
async pull(controller) {
|
|
13078
|
+
try {
|
|
13079
|
+
const { value, done } = await reader.read();
|
|
13080
|
+
if (done) {
|
|
13081
|
+
controller.close();
|
|
13082
|
+
} else {
|
|
13083
|
+
controller.enqueue(value);
|
|
13084
|
+
}
|
|
13085
|
+
} catch (error2) {
|
|
13086
|
+
disposeEngine(aesCrypto);
|
|
13087
|
+
reader.cancel(error2).catch(() => {
|
|
13088
|
+
});
|
|
13089
|
+
throw error2;
|
|
13090
|
+
}
|
|
13091
|
+
},
|
|
13092
|
+
cancel(reason) {
|
|
13093
|
+
disposeEngine(aesCrypto);
|
|
13094
|
+
return reader.cancel(reason);
|
|
13095
|
+
}
|
|
13096
|
+
});
|
|
13097
|
+
Object.defineProperty(stream, "readable", {
|
|
13098
|
+
get() {
|
|
13099
|
+
return readable;
|
|
13100
|
+
}
|
|
13064
13101
|
});
|
|
13065
13102
|
}
|
|
13066
13103
|
function append(aesCrypto, input, output, paddingStart, paddingEnd, decrypt2) {
|
|
@@ -13090,7 +13127,9 @@ async function createDecryptionKeys(decrypt2, strength, password, preamble) {
|
|
|
13090
13127
|
throw new Error(ERR_INVALID_PASSWORD);
|
|
13091
13128
|
}
|
|
13092
13129
|
}
|
|
13093
|
-
function disposeEngine(
|
|
13130
|
+
function disposeEngine(aesCrypto) {
|
|
13131
|
+
const { engine } = aesCrypto;
|
|
13132
|
+
aesCrypto.discarded = true;
|
|
13094
13133
|
if (engine && engine.dispose) {
|
|
13095
13134
|
engine.dispose();
|
|
13096
13135
|
}
|
|
@@ -13105,6 +13144,9 @@ async function createKeys(aesCrypto, strength, password, salt) {
|
|
|
13105
13144
|
const keyLength = KEY_LENGTH[strength];
|
|
13106
13145
|
const compositeKey = await deriveKey(password, salt, keyLength * 2 + PASSWORD_VERIFICATION_LENGTH);
|
|
13107
13146
|
aesCrypto.engine = createEngine2(subarray(compositeKey, 0, keyLength), subarray(compositeKey, keyLength, keyLength * 2));
|
|
13147
|
+
if (aesCrypto.discarded) {
|
|
13148
|
+
disposeEngine(aesCrypto);
|
|
13149
|
+
}
|
|
13108
13150
|
return subarray(compositeKey, keyLength * 2);
|
|
13109
13151
|
}
|
|
13110
13152
|
async function deriveKey(password, salt, length) {
|
|
@@ -13164,12 +13206,12 @@ var init_aes_crypto_stream = __esm({
|
|
|
13164
13206
|
createEngine2 = createEngine;
|
|
13165
13207
|
AESDecryptionStream = class extends TransformStream {
|
|
13166
13208
|
constructor({ password, rawPassword, encryptionStrength, checkPasswordOnly, checkAuthenticationCode = true }) {
|
|
13209
|
+
const aesCrypto = {};
|
|
13167
13210
|
super({
|
|
13168
13211
|
start() {
|
|
13169
|
-
initAesCrypto(
|
|
13212
|
+
initAesCrypto(aesCrypto, password, rawPassword, encryptionStrength);
|
|
13170
13213
|
},
|
|
13171
13214
|
async transform(chunk, controller) {
|
|
13172
|
-
const aesCrypto = this;
|
|
13173
13215
|
const {
|
|
13174
13216
|
password: password2,
|
|
13175
13217
|
strength,
|
|
@@ -13188,6 +13230,9 @@ var init_aes_crypto_stream = __esm({
|
|
|
13188
13230
|
} else {
|
|
13189
13231
|
await ready;
|
|
13190
13232
|
}
|
|
13233
|
+
if (aesCrypto.discarded) {
|
|
13234
|
+
return;
|
|
13235
|
+
}
|
|
13191
13236
|
const output = new Uint8Array(chunk.length - AUTHENTICATION_CODE_LENGTH - (chunk.length - AUTHENTICATION_CODE_LENGTH) % BLOCK_LENGTH2);
|
|
13192
13237
|
controller.enqueue(append(aesCrypto, chunk, output, 0, AUTHENTICATION_CODE_LENGTH, true));
|
|
13193
13238
|
},
|
|
@@ -13196,9 +13241,12 @@ var init_aes_crypto_stream = __esm({
|
|
|
13196
13241
|
engine,
|
|
13197
13242
|
pendingInput,
|
|
13198
13243
|
ready
|
|
13199
|
-
} =
|
|
13244
|
+
} = aesCrypto;
|
|
13200
13245
|
if (engine) {
|
|
13201
13246
|
await ready;
|
|
13247
|
+
if (aesCrypto.discarded) {
|
|
13248
|
+
return;
|
|
13249
|
+
}
|
|
13202
13250
|
const originalAuthenticationCode = subarray(pendingInput, pendingInput.length - AUTHENTICATION_CODE_LENGTH);
|
|
13203
13251
|
const decryptedChunkArray = new Uint8Array(subarray(pendingInput, 0, pendingInput.length - AUTHENTICATION_CODE_LENGTH));
|
|
13204
13252
|
engine.process(decryptedChunkArray, true);
|
|
@@ -13208,25 +13256,24 @@ var init_aes_crypto_stream = __esm({
|
|
|
13208
13256
|
invalidAuthenticationCode |= authenticationCode[indexByte] ^ originalAuthenticationCode[indexByte];
|
|
13209
13257
|
}
|
|
13210
13258
|
if (invalidAuthenticationCode && checkAuthenticationCode) {
|
|
13211
|
-
|
|
13259
|
+
controller.error(new Error(ERR_INVALID_AUTHENTICATION_CODE));
|
|
13260
|
+
return;
|
|
13212
13261
|
}
|
|
13213
13262
|
controller.enqueue(decryptedChunkArray);
|
|
13214
13263
|
}
|
|
13215
|
-
},
|
|
13216
|
-
cancel() {
|
|
13217
|
-
disposeEngine(this);
|
|
13218
13264
|
}
|
|
13219
13265
|
});
|
|
13266
|
+
setDisposingReadable(this, aesCrypto);
|
|
13220
13267
|
}
|
|
13221
13268
|
};
|
|
13222
13269
|
AESEncryptionStream = class extends TransformStream {
|
|
13223
13270
|
constructor({ password, rawPassword, encryptionStrength }) {
|
|
13271
|
+
const aesCrypto = {};
|
|
13224
13272
|
super({
|
|
13225
13273
|
start() {
|
|
13226
|
-
initAesCrypto(
|
|
13274
|
+
initAesCrypto(aesCrypto, password, rawPassword, encryptionStrength);
|
|
13227
13275
|
},
|
|
13228
13276
|
async transform(chunk, controller) {
|
|
13229
|
-
const aesCrypto = this;
|
|
13230
13277
|
const {
|
|
13231
13278
|
password: password2,
|
|
13232
13279
|
strength,
|
|
@@ -13240,6 +13287,9 @@ var init_aes_crypto_stream = __esm({
|
|
|
13240
13287
|
} else {
|
|
13241
13288
|
await ready;
|
|
13242
13289
|
}
|
|
13290
|
+
if (aesCrypto.discarded) {
|
|
13291
|
+
return;
|
|
13292
|
+
}
|
|
13243
13293
|
const output = new Uint8Array(preamble.length + chunk.length - chunk.length % BLOCK_LENGTH2);
|
|
13244
13294
|
output.set(preamble, 0);
|
|
13245
13295
|
controller.enqueue(append(aesCrypto, chunk, output, preamble.length, 0, false));
|
|
@@ -13249,19 +13299,20 @@ var init_aes_crypto_stream = __esm({
|
|
|
13249
13299
|
engine,
|
|
13250
13300
|
pendingInput,
|
|
13251
13301
|
ready
|
|
13252
|
-
} =
|
|
13302
|
+
} = aesCrypto;
|
|
13253
13303
|
if (engine) {
|
|
13254
13304
|
await ready;
|
|
13305
|
+
if (aesCrypto.discarded) {
|
|
13306
|
+
return;
|
|
13307
|
+
}
|
|
13255
13308
|
const encryptedChunkArray = new Uint8Array(pendingInput);
|
|
13256
13309
|
engine.process(encryptedChunkArray, false);
|
|
13257
13310
|
const authenticationCode = subarray(engine.digest(), 0, AUTHENTICATION_CODE_LENGTH);
|
|
13258
13311
|
controller.enqueue(concat(encryptedChunkArray, authenticationCode));
|
|
13259
13312
|
}
|
|
13260
|
-
},
|
|
13261
|
-
cancel() {
|
|
13262
|
-
disposeEngine(this);
|
|
13263
13313
|
}
|
|
13264
13314
|
});
|
|
13315
|
+
setDisposingReadable(this, aesCrypto);
|
|
13265
13316
|
}
|
|
13266
13317
|
};
|
|
13267
13318
|
}
|
|
@@ -13293,11 +13344,11 @@ function encrypt(target, input) {
|
|
|
13293
13344
|
return output;
|
|
13294
13345
|
}
|
|
13295
13346
|
function createKeys2(target, password, rawPassword) {
|
|
13296
|
-
const
|
|
13347
|
+
const cryptoKeys = [305419896, 591751049, 878082192];
|
|
13297
13348
|
Object.assign(target, {
|
|
13298
|
-
|
|
13299
|
-
crcKey0: new Crc32(
|
|
13300
|
-
crcKey2: new Crc32(
|
|
13349
|
+
cryptoKeys,
|
|
13350
|
+
crcKey0: new Crc32(cryptoKeys[0]),
|
|
13351
|
+
crcKey2: new Crc32(cryptoKeys[2])
|
|
13301
13352
|
});
|
|
13302
13353
|
if (rawPassword) {
|
|
13303
13354
|
for (let index = 0; index < rawPassword.length; index++) {
|
|
@@ -13310,16 +13361,16 @@ function createKeys2(target, password, rawPassword) {
|
|
|
13310
13361
|
}
|
|
13311
13362
|
}
|
|
13312
13363
|
function updateKeys(target, byte) {
|
|
13313
|
-
let [, key1] = target.
|
|
13364
|
+
let [, key1] = target.cryptoKeys;
|
|
13314
13365
|
target.crcKey0.append([byte]);
|
|
13315
13366
|
const key0 = ~target.crcKey0.get();
|
|
13316
13367
|
key1 = getInt32(Math.imul(getInt32(key1 + getInt8(key0)), 134775813) + 1);
|
|
13317
13368
|
target.crcKey2.append([key1 >>> 24]);
|
|
13318
13369
|
const key2 = ~target.crcKey2.get();
|
|
13319
|
-
target.
|
|
13370
|
+
target.cryptoKeys = [key0, key1, key2];
|
|
13320
13371
|
}
|
|
13321
13372
|
function getByte(target) {
|
|
13322
|
-
const temp = target.
|
|
13373
|
+
const temp = target.cryptoKeys[2] | 2;
|
|
13323
13374
|
return getInt8(Math.imul(temp, temp ^ 1) >>> 8);
|
|
13324
13375
|
}
|
|
13325
13376
|
function getInt8(number4) {
|
|
@@ -13397,11 +13448,17 @@ function toCompatibleReadable(readable) {
|
|
|
13397
13448
|
const reader = readable.getReader();
|
|
13398
13449
|
return new ReadableStream({
|
|
13399
13450
|
async pull(controller) {
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13451
|
+
try {
|
|
13452
|
+
const { value, done } = await reader.read();
|
|
13453
|
+
if (done) {
|
|
13454
|
+
controller.close();
|
|
13455
|
+
} else {
|
|
13456
|
+
controller.enqueue(value);
|
|
13457
|
+
}
|
|
13458
|
+
} catch (error2) {
|
|
13459
|
+
reader.cancel(error2).catch(() => {
|
|
13460
|
+
});
|
|
13461
|
+
throw error2;
|
|
13405
13462
|
}
|
|
13406
13463
|
},
|
|
13407
13464
|
cancel(reason) {
|
|
@@ -13483,54 +13540,30 @@ var init_codec_registry = __esm({
|
|
|
13483
13540
|
});
|
|
13484
13541
|
|
|
13485
13542
|
// ../../node_modules/@zip.js/zip.js/lib/core/streams/zip-entry-stream.js
|
|
13486
|
-
function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32) {
|
|
13543
|
+
function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32, sourceErrors) {
|
|
13487
13544
|
const writer = gzipStream.writable.getWriter();
|
|
13488
13545
|
const reader = gzipStream.readable.getReader();
|
|
13489
13546
|
const outputCrc32 = crc32 === UNDEFINED_VALUE ? new Crc32() : UNDEFINED_VALUE;
|
|
13490
13547
|
let outputLength = 0;
|
|
13491
|
-
let inputDone = false;
|
|
13492
13548
|
let trailerWritten = false;
|
|
13493
|
-
let
|
|
13494
|
-
let
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
trailerReady.catch(() => {
|
|
13502
|
-
});
|
|
13503
|
-
pump();
|
|
13504
|
-
return new ReadableStream({
|
|
13505
|
-
async pull(controller) {
|
|
13506
|
-
let result;
|
|
13507
|
-
try {
|
|
13508
|
-
result = await read();
|
|
13509
|
-
} catch (error2) {
|
|
13510
|
-
throw trailerWritten ? getTrailerError(error2) : error2;
|
|
13511
|
-
}
|
|
13512
|
-
const { value, done } = result;
|
|
13513
|
-
if (done) {
|
|
13514
|
-
controller.close();
|
|
13515
|
-
} else {
|
|
13516
|
-
outputLength += value.length;
|
|
13517
|
-
if (outputLength > outputSize) {
|
|
13518
|
-
const error2 = new Error(ERR_INVALID_UNCOMPRESSED_SIZE);
|
|
13519
|
-
rejectTrailerReady(error2);
|
|
13520
|
-
await cancel(reader, error2);
|
|
13521
|
-
throw error2;
|
|
13522
|
-
}
|
|
13523
|
-
if (outputCrc32) {
|
|
13524
|
-
outputCrc32.append(value);
|
|
13525
|
-
}
|
|
13526
|
-
controller.enqueue(value);
|
|
13527
|
-
}
|
|
13549
|
+
let settled = false;
|
|
13550
|
+
let resolvePull, controller;
|
|
13551
|
+
const output = new ReadableStream({
|
|
13552
|
+
start(streamController) {
|
|
13553
|
+
controller = streamController;
|
|
13554
|
+
},
|
|
13555
|
+
pull() {
|
|
13556
|
+
resumePump();
|
|
13528
13557
|
},
|
|
13529
13558
|
cancel(reason) {
|
|
13530
|
-
|
|
13559
|
+
settled = true;
|
|
13560
|
+
resumePump();
|
|
13531
13561
|
return reader.cancel(reason);
|
|
13532
13562
|
}
|
|
13533
13563
|
});
|
|
13564
|
+
pump();
|
|
13565
|
+
drain();
|
|
13566
|
+
return output;
|
|
13534
13567
|
async function pump() {
|
|
13535
13568
|
const inputReader = readable.getReader();
|
|
13536
13569
|
try {
|
|
@@ -13538,19 +13571,16 @@ function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, cr
|
|
|
13538
13571
|
header.set(GZIP_HEADER_BYTES);
|
|
13539
13572
|
await writer.write(header);
|
|
13540
13573
|
for (; ; ) {
|
|
13574
|
+
await outputCapacity();
|
|
13541
13575
|
await writer.ready;
|
|
13542
|
-
const { value, done } = await inputReader
|
|
13576
|
+
const { value, done } = await readSource(inputReader, sourceErrors);
|
|
13543
13577
|
if (done) {
|
|
13544
13578
|
break;
|
|
13545
13579
|
}
|
|
13546
13580
|
await writer.write(value);
|
|
13547
13581
|
}
|
|
13548
|
-
inputDone = true;
|
|
13549
13582
|
if (outputCrc32) {
|
|
13550
|
-
|
|
13551
|
-
armIdleCheck();
|
|
13552
|
-
}
|
|
13553
|
-
await trailerReady;
|
|
13583
|
+
await writer.write(new Uint8Array(0));
|
|
13554
13584
|
}
|
|
13555
13585
|
const trailer = new Uint8Array(GZIP_TRAILER_LENGTH);
|
|
13556
13586
|
const dataView = getDataView(trailer);
|
|
@@ -13564,50 +13594,64 @@ function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, cr
|
|
|
13564
13594
|
await cancel(inputReader, error2);
|
|
13565
13595
|
}
|
|
13566
13596
|
}
|
|
13567
|
-
function
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13597
|
+
async function drain() {
|
|
13598
|
+
try {
|
|
13599
|
+
for (; ; ) {
|
|
13600
|
+
const { value, done } = await read();
|
|
13601
|
+
if (done) {
|
|
13602
|
+
break;
|
|
13603
|
+
}
|
|
13604
|
+
outputLength += value.length;
|
|
13605
|
+
if (outputLength > outputSize) {
|
|
13606
|
+
throw new Error(ERR_INVALID_UNCOMPRESSED_SIZE);
|
|
13607
|
+
}
|
|
13608
|
+
if (outputCrc32) {
|
|
13609
|
+
outputCrc32.append(value);
|
|
13610
|
+
}
|
|
13611
|
+
controller.enqueue(value);
|
|
13612
|
+
}
|
|
13613
|
+
if (!settled) {
|
|
13614
|
+
settled = true;
|
|
13615
|
+
controller.close();
|
|
13616
|
+
}
|
|
13617
|
+
} catch (error2) {
|
|
13618
|
+
fail(error2);
|
|
13619
|
+
await cancel(reader, error2);
|
|
13574
13620
|
}
|
|
13575
|
-
return result;
|
|
13576
13621
|
}
|
|
13577
|
-
function
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
idleCheckArmed = true;
|
|
13583
|
-
const count = readCount;
|
|
13584
|
-
await nextTask();
|
|
13585
|
-
idleCheckArmed = false;
|
|
13586
|
-
if (readPending) {
|
|
13587
|
-
if (readCount == count) {
|
|
13588
|
-
resolveTrailerReady();
|
|
13589
|
-
} else {
|
|
13590
|
-
armIdleCheck();
|
|
13622
|
+
function read() {
|
|
13623
|
+
return reader.read().catch((error2) => {
|
|
13624
|
+
if (trailerWritten) {
|
|
13625
|
+
if (!outputCrc32) {
|
|
13626
|
+
throw mapError(error2, ERR_INVALID_CRC32);
|
|
13591
13627
|
}
|
|
13628
|
+
if (outputLength != outputSize) {
|
|
13629
|
+
throw mapError(error2, ERR_INVALID_UNCOMPRESSED_SIZE);
|
|
13630
|
+
}
|
|
13631
|
+
return { done: true };
|
|
13592
13632
|
}
|
|
13593
|
-
|
|
13633
|
+
throw mapCodecError(error2, sourceErrors);
|
|
13634
|
+
});
|
|
13594
13635
|
}
|
|
13595
|
-
function
|
|
13596
|
-
|
|
13597
|
-
|
|
13598
|
-
|
|
13636
|
+
function outputCapacity() {
|
|
13637
|
+
if (!settled && controller.desiredSize <= 0) {
|
|
13638
|
+
return new Promise((resolve2) => resolvePull = resolve2);
|
|
13639
|
+
}
|
|
13599
13640
|
}
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13603
|
-
|
|
13604
|
-
port2.onmessage = () => {
|
|
13605
|
-
port1.close();
|
|
13606
|
-
port2.close();
|
|
13641
|
+
function resumePump() {
|
|
13642
|
+
if (resolvePull) {
|
|
13643
|
+
const resolve2 = resolvePull;
|
|
13644
|
+
resolvePull = UNDEFINED_VALUE;
|
|
13607
13645
|
resolve2();
|
|
13608
|
-
}
|
|
13609
|
-
|
|
13610
|
-
|
|
13646
|
+
}
|
|
13647
|
+
}
|
|
13648
|
+
function fail(error2) {
|
|
13649
|
+
if (!settled) {
|
|
13650
|
+
settled = true;
|
|
13651
|
+
controller.error(error2);
|
|
13652
|
+
resumePump();
|
|
13653
|
+
}
|
|
13654
|
+
}
|
|
13611
13655
|
}
|
|
13612
13656
|
function supportsFormat(StreamClass, format) {
|
|
13613
13657
|
if (!StreamClass) {
|
|
@@ -13657,7 +13701,7 @@ function getGzipCodecStream(useCompressionStream, CodecStreamNative, CodecStream
|
|
|
13657
13701
|
return CodecStreamFallback;
|
|
13658
13702
|
}
|
|
13659
13703
|
}
|
|
13660
|
-
function pipeThroughCompressionStream(readable, useCompressionStream, options, CompressionStreamNative, CompressionStreamFallback) {
|
|
13704
|
+
function pipeThroughCompressionStream(readable, useCompressionStream, options, CompressionStreamNative, CompressionStreamFallback, sourceErrors) {
|
|
13661
13705
|
const Stream2 = useCompressionStream && CompressionStreamNative ? CompressionStreamNative : CompressionStreamFallback || CompressionStreamNative;
|
|
13662
13706
|
const format = options.deflate64 ? FORMAT_DEFLATE64_RAW : FORMAT_DEFLATE_RAW;
|
|
13663
13707
|
let codecStream;
|
|
@@ -13670,12 +13714,12 @@ function pipeThroughCompressionStream(readable, useCompressionStream, options, C
|
|
|
13670
13714
|
throw error2;
|
|
13671
13715
|
}
|
|
13672
13716
|
}
|
|
13673
|
-
return pipeThroughBackpressured(readable, codecStream);
|
|
13717
|
+
return pipeThroughBackpressured(readable, codecStream, sourceErrors);
|
|
13674
13718
|
}
|
|
13675
13719
|
function pipeThrough(readable, transformStream) {
|
|
13676
13720
|
return toCompatibleReadable(readable).pipeThrough(transformStream);
|
|
13677
13721
|
}
|
|
13678
|
-
function pipeThroughBackpressured(readable, transformStream) {
|
|
13722
|
+
function pipeThroughBackpressured(readable, transformStream, sourceErrors) {
|
|
13679
13723
|
const writer = transformStream.writable.getWriter();
|
|
13680
13724
|
const reader = readable.getReader();
|
|
13681
13725
|
pump();
|
|
@@ -13684,7 +13728,7 @@ function pipeThroughBackpressured(readable, transformStream) {
|
|
|
13684
13728
|
try {
|
|
13685
13729
|
for (; ; ) {
|
|
13686
13730
|
await writer.ready;
|
|
13687
|
-
const result = await reader
|
|
13731
|
+
const result = await readSource(reader, sourceErrors);
|
|
13688
13732
|
if (result.done) {
|
|
13689
13733
|
await writer.close();
|
|
13690
13734
|
break;
|
|
@@ -13709,26 +13753,44 @@ async function cancel(reader, error2) {
|
|
|
13709
13753
|
} catch {
|
|
13710
13754
|
}
|
|
13711
13755
|
}
|
|
13712
|
-
function
|
|
13756
|
+
function readSource(reader, sourceErrors) {
|
|
13757
|
+
const result = reader.read();
|
|
13758
|
+
return sourceErrors ? result.catch((error2) => {
|
|
13759
|
+
sourceErrors.add(error2);
|
|
13760
|
+
throw error2;
|
|
13761
|
+
}) : result;
|
|
13762
|
+
}
|
|
13763
|
+
function mapCodecError(error2, sourceErrors) {
|
|
13764
|
+
if (sourceErrors.has(error2)) {
|
|
13765
|
+
return error2;
|
|
13766
|
+
}
|
|
13767
|
+
return mapError(error2, isMemoryError(error2) ? ERR_CODEC_OUT_OF_MEMORY : ERR_INVALID_COMPRESSED_DATA);
|
|
13768
|
+
}
|
|
13769
|
+
function mapMemoryError(error2) {
|
|
13770
|
+
return isMemoryError(error2) ? mapError(error2, ERR_CODEC_OUT_OF_MEMORY) : error2;
|
|
13771
|
+
}
|
|
13772
|
+
function isMemoryError(error2) {
|
|
13773
|
+
return isErrorObject(error2) && error2.code == Z_MEM_ERROR_CODE;
|
|
13774
|
+
}
|
|
13775
|
+
function mapError(error2, message) {
|
|
13776
|
+
const mappedError = new Error(message);
|
|
13777
|
+
mappedError.cause = error2;
|
|
13778
|
+
return mappedError;
|
|
13779
|
+
}
|
|
13780
|
+
function mapInflateStreamError(readable, sourceErrors) {
|
|
13713
13781
|
const reader = readable.getReader();
|
|
13714
13782
|
return new ReadableStream({
|
|
13715
13783
|
async pull(controller) {
|
|
13716
|
-
let result;
|
|
13717
13784
|
try {
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13785
|
+
const { value, done } = await reader.read();
|
|
13786
|
+
if (done) {
|
|
13787
|
+
controller.close();
|
|
13788
|
+
} else {
|
|
13789
|
+
controller.enqueue(value);
|
|
13722
13790
|
}
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
throw
|
|
13726
|
-
}
|
|
13727
|
-
const { value, done } = result;
|
|
13728
|
-
if (done) {
|
|
13729
|
-
controller.close();
|
|
13730
|
-
} else {
|
|
13731
|
-
controller.enqueue(value);
|
|
13791
|
+
} catch (error2) {
|
|
13792
|
+
await cancel(reader, error2);
|
|
13793
|
+
throw mapCodecError(error2, sourceErrors);
|
|
13732
13794
|
}
|
|
13733
13795
|
},
|
|
13734
13796
|
cancel(reason) {
|
|
@@ -13736,7 +13798,7 @@ function mapInflateStreamError(readable) {
|
|
|
13736
13798
|
}
|
|
13737
13799
|
});
|
|
13738
13800
|
}
|
|
13739
|
-
var ERR_INVALID_UNCOMPRESSED_SIZE, ERR_INVALID_COMPRESSED_DATA, ERR_INVALID_CRC32, FORMAT_DEFLATE_RAW, FORMAT_DEFLATE64_RAW, FORMAT_GZIP, GZIP_HEADER_LENGTH, GZIP_TRAILER_LENGTH, GZIP_HEADER_BYTES, DeflateStream, GzipToRawDeflateStream, InflateStream, formatSupportByStream;
|
|
13801
|
+
var ERR_INVALID_UNCOMPRESSED_SIZE, ERR_INVALID_COMPRESSED_DATA, ERR_CODEC_OUT_OF_MEMORY, ERR_INVALID_CRC32, Z_MEM_ERROR_CODE, FORMAT_DEFLATE_RAW, FORMAT_DEFLATE64_RAW, FORMAT_GZIP, GZIP_HEADER_LENGTH, GZIP_TRAILER_LENGTH, GZIP_HEADER_BYTES, DeflateStream, GzipToRawDeflateStream, InflateStream, formatSupportByStream;
|
|
13740
13802
|
var init_zip_entry_stream = __esm({
|
|
13741
13803
|
"../../node_modules/@zip.js/zip.js/lib/core/streams/zip-entry-stream.js"() {
|
|
13742
13804
|
init_crc32();
|
|
@@ -13747,10 +13809,13 @@ var init_zip_entry_stream = __esm({
|
|
|
13747
13809
|
init_constants();
|
|
13748
13810
|
init_array();
|
|
13749
13811
|
init_compatible_streams();
|
|
13812
|
+
init_error();
|
|
13750
13813
|
init_codec_registry();
|
|
13751
13814
|
ERR_INVALID_UNCOMPRESSED_SIZE = "Invalid uncompressed size";
|
|
13752
13815
|
ERR_INVALID_COMPRESSED_DATA = "Invalid compressed data";
|
|
13816
|
+
ERR_CODEC_OUT_OF_MEMORY = "Codec out of memory";
|
|
13753
13817
|
ERR_INVALID_CRC32 = "Invalid CRC32";
|
|
13818
|
+
Z_MEM_ERROR_CODE = "Z_MEM_ERROR";
|
|
13754
13819
|
FORMAT_DEFLATE_RAW = "deflate-raw";
|
|
13755
13820
|
FORMAT_DEFLATE64_RAW = "deflate64-raw";
|
|
13756
13821
|
FORMAT_GZIP = "gzip";
|
|
@@ -13783,13 +13848,13 @@ var init_zip_entry_stream = __esm({
|
|
|
13783
13848
|
readable = pipeThroughCompressionStream(readable, useCompressionStream, { level, chunkSize }, CompressionStream2, CompressionStreamFallback);
|
|
13784
13849
|
} catch (error2) {
|
|
13785
13850
|
if (!useCompressionStream && CompressionStreamFallback) {
|
|
13786
|
-
throw error2;
|
|
13851
|
+
throw mapMemoryError(error2);
|
|
13787
13852
|
}
|
|
13788
13853
|
let gzipStream;
|
|
13789
13854
|
try {
|
|
13790
13855
|
gzipStream = new CompressionStream2(FORMAT_GZIP);
|
|
13791
13856
|
} catch {
|
|
13792
|
-
throw error2;
|
|
13857
|
+
throw mapMemoryError(error2);
|
|
13793
13858
|
}
|
|
13794
13859
|
readable = pipeThroughBackpressured(readable, gzipStream);
|
|
13795
13860
|
readable = pipeThrough(readable, new GzipToRawDeflateStream());
|
|
@@ -13866,11 +13931,12 @@ var init_zip_entry_stream = __esm({
|
|
|
13866
13931
|
}
|
|
13867
13932
|
}
|
|
13868
13933
|
if (compressed) {
|
|
13934
|
+
const sourceErrors = /* @__PURE__ */ new Set();
|
|
13869
13935
|
const codecStreams2 = format && getCodecStreams(format);
|
|
13936
|
+
let gzipStream;
|
|
13870
13937
|
if (codecStreams2) {
|
|
13871
|
-
readable = pipeThroughBackpressured(readable, createCodecStream(codecStreams2.DecompressionStream, format, { chunkSize, compressionMethod, rawBitFlag, uncompressedSize: outputSize }));
|
|
13938
|
+
readable = pipeThroughBackpressured(readable, createCodecStream(codecStreams2.DecompressionStream, format, { chunkSize, compressionMethod, rawBitFlag, uncompressedSize: outputSize }), sourceErrors);
|
|
13872
13939
|
} else {
|
|
13873
|
-
let gzipStream;
|
|
13874
13940
|
const GzipDecompressionStream = getGzipCodecStream(useCompressionStream, DecompressionStream2, DecompressionStreamFallback);
|
|
13875
13941
|
if (checkCrc32 && !deflate64 && crc32 !== UNDEFINED_VALUE && outputSize !== UNDEFINED_VALUE && GzipDecompressionStream) {
|
|
13876
13942
|
try {
|
|
@@ -13881,24 +13947,25 @@ var init_zip_entry_stream = __esm({
|
|
|
13881
13947
|
}
|
|
13882
13948
|
if (!gzipStream) {
|
|
13883
13949
|
try {
|
|
13884
|
-
readable = pipeThroughCompressionStream(readable, useCompressionStream, { chunkSize, deflate64 }, DecompressionStream2, DecompressionStreamFallback);
|
|
13950
|
+
readable = pipeThroughCompressionStream(readable, useCompressionStream, { chunkSize, deflate64 }, DecompressionStream2, DecompressionStreamFallback, sourceErrors);
|
|
13885
13951
|
} catch (error2) {
|
|
13886
13952
|
if (deflate64 || outputSize === UNDEFINED_VALUE || !useCompressionStream && DecompressionStreamFallback) {
|
|
13887
|
-
throw error2;
|
|
13953
|
+
throw mapMemoryError(error2);
|
|
13888
13954
|
}
|
|
13889
13955
|
try {
|
|
13890
13956
|
gzipStream = new DecompressionStream2(FORMAT_GZIP);
|
|
13891
13957
|
} catch {
|
|
13892
|
-
throw error2;
|
|
13958
|
+
throw mapMemoryError(error2);
|
|
13893
13959
|
}
|
|
13894
13960
|
}
|
|
13895
13961
|
}
|
|
13896
|
-
if (gzipStream) {
|
|
13897
|
-
gzipCrc32 = true;
|
|
13898
|
-
readable = pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32);
|
|
13899
|
-
}
|
|
13900
13962
|
}
|
|
13901
|
-
|
|
13963
|
+
if (gzipStream) {
|
|
13964
|
+
gzipCrc32 = true;
|
|
13965
|
+
readable = pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32, sourceErrors);
|
|
13966
|
+
} else {
|
|
13967
|
+
readable = mapInflateStreamError(readable, sourceErrors);
|
|
13968
|
+
}
|
|
13902
13969
|
}
|
|
13903
13970
|
if (checkCrc32 && !gzipCrc32) {
|
|
13904
13971
|
crc32Stream = new Crc32Stream();
|
|
@@ -13924,7 +13991,7 @@ var init_codec_stream = __esm({
|
|
|
13924
13991
|
"../../node_modules/@zip.js/zip.js/lib/core/streams/codec-stream.js"() {
|
|
13925
13992
|
init_constants();
|
|
13926
13993
|
init_zip_entry_stream();
|
|
13927
|
-
DEFAULT_CHUNK_SIZE2 =
|
|
13994
|
+
DEFAULT_CHUNK_SIZE2 = 256 * 1024;
|
|
13928
13995
|
MESSAGE_EVENT_TYPE = "message";
|
|
13929
13996
|
MESSAGE_START = "start";
|
|
13930
13997
|
MESSAGE_PULL = "pull";
|
|
@@ -14114,7 +14181,8 @@ async function runWorker({ options, readable, writable, onTaskFinished, workerOp
|
|
|
14114
14181
|
}
|
|
14115
14182
|
codecStream = new CodecStream(options, config3);
|
|
14116
14183
|
chunkStream = new ChunkStream(getChunkSize(config3));
|
|
14117
|
-
|
|
14184
|
+
const { signal } = workerOptions.streamOptions;
|
|
14185
|
+
await readable.pipeThrough(codecStream).pipeThrough(chunkStream).pipeTo(writable, { preventClose: true, preventAbort: true, signal });
|
|
14118
14186
|
const {
|
|
14119
14187
|
crc32,
|
|
14120
14188
|
inputSize,
|
|
@@ -14159,7 +14227,7 @@ var init_codec_worker = __esm({
|
|
|
14159
14227
|
};
|
|
14160
14228
|
CodecWorker = class {
|
|
14161
14229
|
constructor(workerData, { readable, writable }, workerOptions, onTaskFinished) {
|
|
14162
|
-
const { options, config: config3, streamOptions, useWebWorkers,
|
|
14230
|
+
const { options, config: config3, streamOptions, useWebWorkers, workerURI } = workerOptions;
|
|
14163
14231
|
let { createWorker } = workerOptions;
|
|
14164
14232
|
const { signal } = streamOptions;
|
|
14165
14233
|
if (createWorkerFailed) {
|
|
@@ -14174,7 +14242,6 @@ var init_codec_worker = __esm({
|
|
|
14174
14242
|
workerOptions,
|
|
14175
14243
|
workerURI,
|
|
14176
14244
|
createWorker,
|
|
14177
|
-
transferStreams,
|
|
14178
14245
|
terminate() {
|
|
14179
14246
|
return new Promise((resolve2) => {
|
|
14180
14247
|
const { worker, busy } = workerData;
|
|
@@ -14245,7 +14312,7 @@ var init_codec_worker = __esm({
|
|
|
14245
14312
|
// ../../node_modules/@zip.js/zip.js/lib/core/codec-pool.js
|
|
14246
14313
|
async function runWorker2(stream, workerOptions) {
|
|
14247
14314
|
const { options, config: config3 } = workerOptions;
|
|
14248
|
-
const {
|
|
14315
|
+
const { useWebWorkers, useCompressionStream, compressed, checkCrc32, computeCrc32, encrypted, format, codecURI } = options;
|
|
14249
14316
|
const { workerURI, createWorker, maxWorkers: maxWorkers2 } = config3;
|
|
14250
14317
|
if (format) {
|
|
14251
14318
|
if (codecURI) {
|
|
@@ -14253,7 +14320,6 @@ async function runWorker2(stream, workerOptions) {
|
|
|
14253
14320
|
}
|
|
14254
14321
|
await ensureCodecStreams(format, options.codecURI);
|
|
14255
14322
|
}
|
|
14256
|
-
workerOptions.transferStreams = !format && (transferStreams || transferStreams === UNDEFINED_VALUE && config3.transferStreams);
|
|
14257
14323
|
const streamCopy = !compressed && !checkCrc32 && !computeCrc32 && !encrypted;
|
|
14258
14324
|
const workerSupported = format === UNDEFINED_VALUE || Boolean(options.codecURI);
|
|
14259
14325
|
workerOptions.useWebWorkers = !streamCopy && workerSupported && (useWebWorkers || useWebWorkers === UNDEFINED_VALUE && config3.useWebWorkers);
|
|
@@ -14974,6 +15040,7 @@ __export(zip_reader_exports, {
|
|
|
14974
15040
|
ERR_AMBIGUOUS_ARCHIVE: () => ERR_AMBIGUOUS_ARCHIVE,
|
|
14975
15041
|
ERR_BAD_FORMAT: () => ERR_BAD_FORMAT,
|
|
14976
15042
|
ERR_CENTRAL_DIRECTORY_NOT_FOUND: () => ERR_CENTRAL_DIRECTORY_NOT_FOUND,
|
|
15043
|
+
ERR_CODEC_OUT_OF_MEMORY: () => ERR_CODEC_OUT_OF_MEMORY,
|
|
14977
15044
|
ERR_ENCRYPTED: () => ERR_ENCRYPTED,
|
|
14978
15045
|
ERR_ENCRYPTED_CENTRAL_DIRECTORY: () => ERR_ENCRYPTED_CENTRAL_DIRECTORY,
|
|
14979
15046
|
ERR_ENTRY_DATA_OUT_OF_BOUNDS: () => ERR_ENTRY_DATA_OUT_OF_BOUNDS,
|
|
@@ -15000,11 +15067,13 @@ __export(zip_reader_exports, {
|
|
|
15000
15067
|
WARNING_COMPRESSED_PATCHED_DATA: () => WARNING_COMPRESSED_PATCHED_DATA,
|
|
15001
15068
|
WARNING_DUPLICATE_FILENAME: () => WARNING_DUPLICATE_FILENAME,
|
|
15002
15069
|
WARNING_MALFORMED_EXTRA_FIELD: () => WARNING_MALFORMED_EXTRA_FIELD,
|
|
15070
|
+
WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET: () => WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET,
|
|
15003
15071
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG,
|
|
15004
15072
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD,
|
|
15005
15073
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES,
|
|
15006
15074
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME,
|
|
15007
15075
|
WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY: () => WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,
|
|
15076
|
+
WARNING_MISSING_ZIP64_EXTRA_FIELD: () => WARNING_MISSING_ZIP64_EXTRA_FIELD,
|
|
15008
15077
|
WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY: () => WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY,
|
|
15009
15078
|
WARNING_PREPENDED_CENTRAL_DIRECTORY: () => WARNING_PREPENDED_CENTRAL_DIRECTORY,
|
|
15010
15079
|
WARNING_PREPENDED_DATA: () => WARNING_PREPENDED_DATA,
|
|
@@ -15015,6 +15084,7 @@ __export(zip_reader_exports, {
|
|
|
15015
15084
|
WARNING_WRAPPED_ENTRIES_COUNT: () => WARNING_WRAPPED_ENTRIES_COUNT,
|
|
15016
15085
|
ZipReader: () => ZipReader,
|
|
15017
15086
|
ZipReaderStream: () => ZipReaderStream,
|
|
15087
|
+
getEntryDataDescriptorLength: () => getEntryDataDescriptorLength,
|
|
15018
15088
|
isZipFile: () => isZipFile
|
|
15019
15089
|
});
|
|
15020
15090
|
function createEntryStream(entry, pendingEntries2) {
|
|
@@ -15078,13 +15148,7 @@ async function isZipFile(reader, options = {}) {
|
|
|
15078
15148
|
return reader.size - appendedDataOffset <= maxAppendedDataSize;
|
|
15079
15149
|
}
|
|
15080
15150
|
function detectEncryptedCentralDirectory(directoryView) {
|
|
15081
|
-
|
|
15082
|
-
for (let offset = 0; offset < maxOffset; offset++) {
|
|
15083
|
-
if (getUint32(directoryView, offset) == ARCHIVE_EXTRA_DATA_SIGNATURE) {
|
|
15084
|
-
return true;
|
|
15085
|
-
}
|
|
15086
|
-
}
|
|
15087
|
-
return false;
|
|
15151
|
+
return directoryView.byteLength >= 4 && getUint32(directoryView, 0) == ARCHIVE_EXTRA_DATA_SIGNATURE;
|
|
15088
15152
|
}
|
|
15089
15153
|
function getWrappedFilesLength(directoryView, directoryArray, offset) {
|
|
15090
15154
|
let wrappedFilesLength = 0;
|
|
@@ -15094,6 +15158,79 @@ function getWrappedFilesLength(directoryView, directoryArray, offset) {
|
|
|
15094
15158
|
}
|
|
15095
15159
|
return wrappedFilesLength % (MAX_16_BITS + 1) ? 0 : wrappedFilesLength;
|
|
15096
15160
|
}
|
|
15161
|
+
function pointsAtDirectory(reader, offset) {
|
|
15162
|
+
return startsWithSignature(reader, offset, CENTRAL_FILE_HEADER_SIGNATURE);
|
|
15163
|
+
}
|
|
15164
|
+
async function startsWithSignature(reader, offset, signature) {
|
|
15165
|
+
if (offset < 0 || offset + 4 > reader.size) {
|
|
15166
|
+
return false;
|
|
15167
|
+
}
|
|
15168
|
+
const signatureArray = await readUint8Array(reader, offset, 4);
|
|
15169
|
+
return getUint32(getDataView(signatureArray), 0) == signature;
|
|
15170
|
+
}
|
|
15171
|
+
async function findDigitalSignatureRecordOffset(reader, endOffset) {
|
|
15172
|
+
const startOffset = Math.max(0, endOffset - (6 + MAX_16_BITS));
|
|
15173
|
+
const tailArray = await readUint8Array(reader, startOffset, endOffset - startOffset);
|
|
15174
|
+
const tailView = getDataView(tailArray);
|
|
15175
|
+
for (let indexByte = tailArray.length - 6; indexByte >= 0; indexByte--) {
|
|
15176
|
+
if (getUint32(tailView, indexByte) == DIGITAL_SIGNATURE_RECORD_SIGNATURE && indexByte + 6 + getUint16(tailView, indexByte + 4) == tailArray.length) {
|
|
15177
|
+
return startOffset + indexByte;
|
|
15178
|
+
}
|
|
15179
|
+
}
|
|
15180
|
+
}
|
|
15181
|
+
async function findZip64EndOfDirectoryOffset(reader, endOffset) {
|
|
15182
|
+
const startOffset = Math.max(0, endOffset - (ZIP64_END_OF_CENTRAL_DIR_LENGTH + MAX_16_BITS));
|
|
15183
|
+
const tailArray = await readUint8Array(reader, startOffset, endOffset - startOffset);
|
|
15184
|
+
const tailView = getDataView(tailArray);
|
|
15185
|
+
for (let indexByte = tailArray.length - ZIP64_END_OF_CENTRAL_DIR_LENGTH; indexByte >= 0; indexByte--) {
|
|
15186
|
+
if (getUint32(tailView, indexByte) == ZIP64_END_OF_CENTRAL_DIR_SIGNATURE && indexByte + 12 + Number(tailView.getBigUint64(indexByte + 4, true)) == tailArray.length) {
|
|
15187
|
+
return startOffset + indexByte;
|
|
15188
|
+
}
|
|
15189
|
+
}
|
|
15190
|
+
}
|
|
15191
|
+
async function probeLocalHeaders(reader, directoryArray, directoryView, offsetDelta) {
|
|
15192
|
+
let result = { localHeaderFound: false, shiftedLocalHeaderFound: false };
|
|
15193
|
+
let recordOffset = 0;
|
|
15194
|
+
while (recordOffset + CENTRAL_FILE_HEADER_LENGTH <= directoryArray.length && getUint32(directoryView, recordOffset) == CENTRAL_FILE_HEADER_SIGNATURE) {
|
|
15195
|
+
const localHeaderOffset = getLocalHeaderOffset(directoryArray, directoryView, recordOffset);
|
|
15196
|
+
if (localHeaderOffset !== UNDEFINED_VALUE) {
|
|
15197
|
+
const localHeaderFound = await startsWithSignature(reader, localHeaderOffset, LOCAL_FILE_HEADER_SIGNATURE);
|
|
15198
|
+
const shiftedLocalHeaderFound = await startsWithSignature(reader, localHeaderOffset + offsetDelta, LOCAL_FILE_HEADER_SIGNATURE);
|
|
15199
|
+
if (!recordOffset) {
|
|
15200
|
+
result = { localHeaderFound, shiftedLocalHeaderFound };
|
|
15201
|
+
}
|
|
15202
|
+
if (localHeaderFound != shiftedLocalHeaderFound) {
|
|
15203
|
+
return { localHeaderFound, shiftedLocalHeaderFound };
|
|
15204
|
+
}
|
|
15205
|
+
}
|
|
15206
|
+
recordOffset += CENTRAL_FILE_HEADER_LENGTH + getUint16(directoryView, recordOffset + 28) + getUint16(directoryView, recordOffset + 30) + getUint16(directoryView, recordOffset + 32);
|
|
15207
|
+
}
|
|
15208
|
+
return result;
|
|
15209
|
+
}
|
|
15210
|
+
function getLocalHeaderOffset(directoryArray, directoryView, recordOffset) {
|
|
15211
|
+
const localHeaderOffset = getUint32(directoryView, recordOffset + 42);
|
|
15212
|
+
if (localHeaderOffset != MAX_32_BITS) {
|
|
15213
|
+
return localHeaderOffset;
|
|
15214
|
+
}
|
|
15215
|
+
let offsetExtraField = recordOffset + CENTRAL_FILE_HEADER_LENGTH + getUint16(directoryView, recordOffset + 28);
|
|
15216
|
+
const endExtraField = Math.min(offsetExtraField + getUint16(directoryView, recordOffset + 30), directoryArray.length);
|
|
15217
|
+
while (offsetExtraField + 4 <= endExtraField) {
|
|
15218
|
+
const type = getUint16(directoryView, offsetExtraField);
|
|
15219
|
+
const size = getUint16(directoryView, offsetExtraField + 2);
|
|
15220
|
+
if (type == EXTRAFIELD_TYPE_ZIP64) {
|
|
15221
|
+
let offsetValue = offsetExtraField + 4;
|
|
15222
|
+
if (getUint32(directoryView, recordOffset + 24) == MAX_32_BITS) {
|
|
15223
|
+
offsetValue += 8;
|
|
15224
|
+
}
|
|
15225
|
+
if (getUint32(directoryView, recordOffset + 20) == MAX_32_BITS) {
|
|
15226
|
+
offsetValue += 8;
|
|
15227
|
+
}
|
|
15228
|
+
return offsetValue + 8 <= endExtraField ? getBigUint64(directoryView, offsetValue) : UNDEFINED_VALUE;
|
|
15229
|
+
}
|
|
15230
|
+
offsetExtraField += 4 + size;
|
|
15231
|
+
}
|
|
15232
|
+
return UNDEFINED_VALUE;
|
|
15233
|
+
}
|
|
15097
15234
|
function readDigitalSignature(signatureRecordArray) {
|
|
15098
15235
|
if (signatureRecordArray.length >= 6) {
|
|
15099
15236
|
const signatureRecordView = getDataView(signatureRecordArray);
|
|
@@ -15175,9 +15312,18 @@ function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory
|
|
|
15175
15312
|
uncompressedSize: getUint32(dataView, offset + HEADER_OFFSET_UNCOMPRESSED_SIZE)
|
|
15176
15313
|
});
|
|
15177
15314
|
const extraFieldZip64 = extraField.get(EXTRAFIELD_TYPE_ZIP64);
|
|
15315
|
+
let extraFieldZip64Missing;
|
|
15178
15316
|
if (extraFieldZip64) {
|
|
15179
|
-
readExtraFieldZip64(extraFieldZip64, directory)
|
|
15317
|
+
if (!readExtraFieldZip64(extraFieldZip64, directory, localDirectory)) {
|
|
15318
|
+
malformedExtraField = true;
|
|
15319
|
+
}
|
|
15180
15320
|
directory.extraFieldZip64 = extraFieldZip64;
|
|
15321
|
+
} else if (ZIP64_PROPERTIES.some(([propertyName, max]) => directory[propertyName] == max)) {
|
|
15322
|
+
if (localDirectory) {
|
|
15323
|
+
malformedExtraField = true;
|
|
15324
|
+
} else {
|
|
15325
|
+
extraFieldZip64Missing = true;
|
|
15326
|
+
}
|
|
15181
15327
|
}
|
|
15182
15328
|
const extraFieldUnicodePath = extraField.get(EXTRAFIELD_TYPE_UNICODE_PATH);
|
|
15183
15329
|
if (extraFieldUnicodePath) {
|
|
@@ -15190,10 +15336,13 @@ function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory
|
|
|
15190
15336
|
directory.extraFieldUnicodeComment = extraFieldUnicodeComment;
|
|
15191
15337
|
}
|
|
15192
15338
|
const extraFieldAES = extraField.get(EXTRAFIELD_TYPE_AES);
|
|
15193
|
-
if (extraFieldAES && extraFieldAES.data.length >= 7) {
|
|
15339
|
+
if (extraFieldAES && (compressionMethod == COMPRESSION_METHOD_AES || directory.encrypted) && extraFieldAES.data.length >= 7) {
|
|
15194
15340
|
readExtraFieldAES(extraFieldAES, directory, compressionMethod);
|
|
15195
15341
|
directory.extraFieldAES = extraFieldAES;
|
|
15196
15342
|
} else {
|
|
15343
|
+
if (extraFieldAES) {
|
|
15344
|
+
malformedExtraField = true;
|
|
15345
|
+
}
|
|
15197
15346
|
directory.compressionMethod = compressionMethod;
|
|
15198
15347
|
}
|
|
15199
15348
|
const extraFieldPkwareUnix = extraField.get(EXTRAFIELD_TYPE_PKWARE_UNIX);
|
|
@@ -15206,49 +15355,65 @@ function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory
|
|
|
15206
15355
|
readExtraFieldUnixDates(extraFieldUnixType1, directory);
|
|
15207
15356
|
directory.extraFieldUnixType1 = extraFieldUnixType1;
|
|
15208
15357
|
}
|
|
15358
|
+
const extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);
|
|
15359
|
+
if (extraFieldExtendedTimestamp) {
|
|
15360
|
+
readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory, localDirectory);
|
|
15361
|
+
directory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;
|
|
15362
|
+
}
|
|
15209
15363
|
const extraFieldNTFS = extraField.get(EXTRAFIELD_TYPE_NTFS);
|
|
15210
15364
|
if (extraFieldNTFS) {
|
|
15211
15365
|
readExtraFieldNTFS(extraFieldNTFS, directory);
|
|
15212
15366
|
directory.extraFieldNTFS = extraFieldNTFS;
|
|
15213
15367
|
}
|
|
15214
|
-
const
|
|
15368
|
+
const extraFieldInfoZip = extraField.get(EXTRAFIELD_TYPE_INFOZIP);
|
|
15215
15369
|
let unixIdsRead;
|
|
15370
|
+
if (extraFieldInfoZip) {
|
|
15371
|
+
unixIdsRead = readExtraFieldUnix(extraFieldInfoZip, directory, true);
|
|
15372
|
+
directory.extraFieldInfoZip = extraFieldInfoZip;
|
|
15373
|
+
}
|
|
15374
|
+
const extraFieldUnix = extraField.get(EXTRAFIELD_TYPE_UNIX);
|
|
15216
15375
|
if (extraFieldUnix) {
|
|
15217
|
-
|
|
15376
|
+
readExtraFieldUnix(extraFieldUnix, unixIdsRead ? {} : directory, false);
|
|
15218
15377
|
directory.extraFieldUnix = extraFieldUnix;
|
|
15219
15378
|
}
|
|
15220
|
-
if (!unixIdsRead) {
|
|
15221
|
-
const extraFieldInfoZip = extraField.get(EXTRAFIELD_TYPE_INFOZIP);
|
|
15222
|
-
if (extraFieldInfoZip) {
|
|
15223
|
-
readExtraFieldUnix(extraFieldInfoZip, directory, true);
|
|
15224
|
-
directory.extraFieldInfoZip = extraFieldInfoZip;
|
|
15225
|
-
}
|
|
15226
|
-
}
|
|
15227
|
-
const extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);
|
|
15228
|
-
if (extraFieldExtendedTimestamp) {
|
|
15229
|
-
readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory, localDirectory);
|
|
15230
|
-
directory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;
|
|
15231
|
-
}
|
|
15232
15379
|
const extraFieldUSDZ = extraField.get(EXTRAFIELD_TYPE_USDZ);
|
|
15233
15380
|
if (extraFieldUSDZ) {
|
|
15234
15381
|
directory.extraFieldUSDZ = extraFieldUSDZ;
|
|
15235
15382
|
}
|
|
15383
|
+
if (extraFieldZip64Missing) {
|
|
15384
|
+
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
15385
|
+
}
|
|
15236
15386
|
return malformedExtraField;
|
|
15237
15387
|
}
|
|
15238
|
-
function readExtraFieldZip64(extraFieldZip64, directory) {
|
|
15388
|
+
function readExtraFieldZip64(extraFieldZip64, directory, localDirectory) {
|
|
15239
15389
|
directory.zip64 = true;
|
|
15240
15390
|
const extraFieldView = getDataView(extraFieldZip64.data);
|
|
15241
15391
|
const missingProperties = ZIP64_PROPERTIES.filter(([propertyName, max]) => directory[propertyName] == max);
|
|
15242
15392
|
const requiredLength = missingProperties.reduce((length, [, max]) => length + ZIP64_EXTRACTION[max].bytes, 0);
|
|
15243
15393
|
if (extraFieldZip64.data.length < requiredLength) {
|
|
15394
|
+
if (localDirectory) {
|
|
15395
|
+
return false;
|
|
15396
|
+
}
|
|
15244
15397
|
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
15245
15398
|
}
|
|
15246
|
-
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15399
|
+
const values = [];
|
|
15400
|
+
try {
|
|
15401
|
+
for (let indexMissingProperty = 0, offset = 0; indexMissingProperty < missingProperties.length; indexMissingProperty++) {
|
|
15402
|
+
const [, max] = missingProperties[indexMissingProperty];
|
|
15403
|
+
const extraction = ZIP64_EXTRACTION[max];
|
|
15404
|
+
values.push(extraction.getValue(extraFieldView, offset));
|
|
15405
|
+
offset += extraction.bytes;
|
|
15406
|
+
}
|
|
15407
|
+
} catch (error2) {
|
|
15408
|
+
if (localDirectory) {
|
|
15409
|
+
return false;
|
|
15410
|
+
}
|
|
15411
|
+
throw error2;
|
|
15251
15412
|
}
|
|
15413
|
+
missingProperties.forEach(([propertyName], indexMissingProperty) => {
|
|
15414
|
+
directory[propertyName] = extraFieldZip64[propertyName] = values[indexMissingProperty];
|
|
15415
|
+
});
|
|
15416
|
+
return true;
|
|
15252
15417
|
}
|
|
15253
15418
|
function readExtraFieldUnicode(extraFieldUnicode, propertyName, rawPropertyName, directory, fileEntry) {
|
|
15254
15419
|
if (extraFieldUnicode.data.length < 5) {
|
|
@@ -15420,29 +15585,13 @@ async function detectOverlappingEntry({
|
|
|
15420
15585
|
}) {
|
|
15421
15586
|
let dataDescriptorLength = 0;
|
|
15422
15587
|
if (dataDescriptor) {
|
|
15423
|
-
|
|
15424
|
-
|
|
15425
|
-
|
|
15426
|
-
dataDescriptorLength = DATA_DESCRIPTOR_RECORD_LENGTH;
|
|
15427
|
-
}
|
|
15428
|
-
}
|
|
15429
|
-
if (dataDescriptorLength) {
|
|
15430
|
-
const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, dataDescriptorLength + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
|
|
15431
|
-
const dataDescriptorView = getDataView(dataDescriptorArray);
|
|
15432
|
-
let signature = dataDescriptorArray.length == dataDescriptorLength + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH && getUint32(dataDescriptorView, 0) == DATA_DESCRIPTOR_RECORD_SIGNATURE;
|
|
15433
|
-
if (signature) {
|
|
15434
|
-
const signedDataDescriptor = readDataDescriptor(dataDescriptorView, DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH, extraFieldZip64);
|
|
15435
|
-
const matchCrc32 = fileEntry.encrypted && !fileEntry.zipCrypto || signedDataDescriptor.crc32 == crc32;
|
|
15436
|
-
if (matchCrc32 && signedDataDescriptor.compressedSize == compressedSize && signedDataDescriptor.uncompressedSize == uncompressedSize) {
|
|
15437
|
-
dataDescriptorLength += DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH;
|
|
15438
|
-
} else {
|
|
15439
|
-
signature = false;
|
|
15440
|
-
}
|
|
15441
|
-
}
|
|
15442
|
-
if (dataDescriptorArray.length >= dataDescriptorLength) {
|
|
15443
|
-
const localDataDescriptor = readDataDescriptor(dataDescriptorView, signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0, extraFieldZip64);
|
|
15444
|
-
localDataDescriptor.signature = signature;
|
|
15588
|
+
const zip64 = Boolean(extraFieldZip64);
|
|
15589
|
+
const localDataDescriptor = await readLocalDataDescriptor(reader, dataOffset + compressedSize, { crc32, compressedSize, uncompressedSize, zip64 });
|
|
15590
|
+
if (localDataDescriptor) {
|
|
15445
15591
|
fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
|
|
15592
|
+
dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
|
|
15593
|
+
} else {
|
|
15594
|
+
dataDescriptorLength = getDataDescriptorLength(zip64, false);
|
|
15446
15595
|
}
|
|
15447
15596
|
}
|
|
15448
15597
|
const range = {
|
|
@@ -15503,18 +15652,43 @@ function mergeRanges(sortedRanges, pendingRanges) {
|
|
|
15503
15652
|
}
|
|
15504
15653
|
return mergedRanges;
|
|
15505
15654
|
}
|
|
15506
|
-
function
|
|
15655
|
+
async function readLocalDataDescriptor(reader, offset, { crc32, compressedSize, uncompressedSize, zip64 }) {
|
|
15656
|
+
const maxLength = DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH;
|
|
15657
|
+
const length = Math.min(maxLength, Math.max(0, reader.size - offset));
|
|
15658
|
+
const dataDescriptorArray = length ? await readUint8Array(reader, offset, length) : EMPTY_UINT8_ARRAY;
|
|
15659
|
+
const dataDescriptorView = getDataView(dataDescriptorArray);
|
|
15660
|
+
const candidates = [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]].map(([zip64Layout, signature]) => readDataDescriptor(dataDescriptorView, zip64Layout, signature)).filter((candidate) => candidate && candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize);
|
|
15661
|
+
return candidates.find((candidate) => candidate.crc32 == crc32) || candidates[0] || readDataDescriptor(dataDescriptorView, zip64, true) || readDataDescriptor(dataDescriptorView, zip64, false);
|
|
15662
|
+
}
|
|
15663
|
+
async function getEntryDataDescriptorLength(reader, offset, { crc32, compressedSize, uncompressedSize, extraFieldZip64 }) {
|
|
15664
|
+
const dataDescriptor = await readLocalDataDescriptor(reader, offset, { crc32, compressedSize, uncompressedSize, zip64: Boolean(extraFieldZip64) });
|
|
15665
|
+
if (dataDescriptor && dataDescriptor.compressedSize == compressedSize && dataDescriptor.uncompressedSize == uncompressedSize) {
|
|
15666
|
+
return getDataDescriptorLength(dataDescriptor.zip64, dataDescriptor.signature);
|
|
15667
|
+
}
|
|
15668
|
+
}
|
|
15669
|
+
function readDataDescriptor(dataDescriptorView, zip64, signature) {
|
|
15670
|
+
const offset = signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0;
|
|
15671
|
+
if (dataDescriptorView.byteLength < getDataDescriptorLength(zip64, signature) || signature && getUint32(dataDescriptorView, 0) != DATA_DESCRIPTOR_RECORD_SIGNATURE) {
|
|
15672
|
+
return UNDEFINED_VALUE;
|
|
15673
|
+
}
|
|
15507
15674
|
const crc32 = getUint32(dataDescriptorView, offset);
|
|
15508
15675
|
let compressedSize;
|
|
15509
15676
|
let uncompressedSize;
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
|
|
15513
|
-
|
|
15514
|
-
|
|
15515
|
-
|
|
15677
|
+
try {
|
|
15678
|
+
if (zip64) {
|
|
15679
|
+
compressedSize = getBigUint64(dataDescriptorView, offset + 4);
|
|
15680
|
+
uncompressedSize = getBigUint64(dataDescriptorView, offset + 12);
|
|
15681
|
+
} else {
|
|
15682
|
+
compressedSize = getUint32(dataDescriptorView, offset + 4);
|
|
15683
|
+
uncompressedSize = getUint32(dataDescriptorView, offset + 8);
|
|
15684
|
+
}
|
|
15685
|
+
} catch {
|
|
15686
|
+
return UNDEFINED_VALUE;
|
|
15516
15687
|
}
|
|
15517
|
-
return { crc32, compressedSize, uncompressedSize };
|
|
15688
|
+
return { signature, zip64, crc32, compressedSize, uncompressedSize };
|
|
15689
|
+
}
|
|
15690
|
+
function getDataDescriptorLength(zip64, signature) {
|
|
15691
|
+
return (zip64 ? DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH : DATA_DESCRIPTOR_RECORD_LENGTH) + (signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0);
|
|
15518
15692
|
}
|
|
15519
15693
|
function getDiskOffset(reader, diskNumber) {
|
|
15520
15694
|
return reader.getDiskOffset ? reader.getDiskOffset(diskNumber) : 0;
|
|
@@ -15609,7 +15783,7 @@ function getMaxAppendedDataSize(maxAppendedDataSize, strictness) {
|
|
|
15609
15783
|
async function findEndOfCentralDirectory(reader, rejectAmbiguous, maxAppendedDataSize) {
|
|
15610
15784
|
const { size } = reader;
|
|
15611
15785
|
const anchoredLength = Math.min(size, END_OF_CENTRAL_DIR_LENGTH + MAX_16_BITS);
|
|
15612
|
-
const remoteProbeBudget = {
|
|
15786
|
+
const remoteProbeBudget = { remaining: MAX_END_OF_CENTRAL_DIR_PROBES };
|
|
15613
15787
|
let endOfDirectoryInfo;
|
|
15614
15788
|
let plausibleEndOfDirectoryInfo;
|
|
15615
15789
|
let endOfDirectoryReachingEndCount = 0;
|
|
@@ -15696,8 +15870,8 @@ async function readSignature(reader, view, anchoredOffset, signatureOffset, size
|
|
|
15696
15870
|
if (signatureOffset >= anchoredOffset) {
|
|
15697
15871
|
return getUint32(view, signatureOffset - anchoredOffset);
|
|
15698
15872
|
}
|
|
15699
|
-
if (remoteProbeBudget.
|
|
15700
|
-
remoteProbeBudget.
|
|
15873
|
+
if (remoteProbeBudget.remaining > 0) {
|
|
15874
|
+
remoteProbeBudget.remaining--;
|
|
15701
15875
|
const signatureArray = await readUint8Array(reader, signatureOffset, 4);
|
|
15702
15876
|
return getUint32(getDataView(signatureArray), 0);
|
|
15703
15877
|
}
|
|
@@ -15720,6 +15894,13 @@ function validateLocalDirectory(zipEntry, localDirectory, rawLocalFilename, chec
|
|
|
15720
15894
|
reportAmbiguity(reject, warnings, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES);
|
|
15721
15895
|
}
|
|
15722
15896
|
}
|
|
15897
|
+
function validateDataDescriptor(zipEntry, localDirectory, warnings) {
|
|
15898
|
+
const { dataDescriptor } = localDirectory;
|
|
15899
|
+
const maskedLocalDirectory = zipEntry.decryptedDirectory && (localDirectory.rawBitFlag & BITFLAG_MASKED_LOCAL_HEADERS) == BITFLAG_MASKED_LOCAL_HEADERS;
|
|
15900
|
+
if (dataDescriptor && !maskedLocalDirectory && (zipEntry.crc32 !== UNDEFINED_VALUE && dataDescriptor.crc32 != zipEntry.crc32 || dataDescriptor.compressedSize != zipEntry.compressedSize || dataDescriptor.uncompressedSize != zipEntry.uncompressedSize)) {
|
|
15901
|
+
reportAmbiguity(!warnings, warnings, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES);
|
|
15902
|
+
}
|
|
15903
|
+
}
|
|
15723
15904
|
function reportAmbiguity(reject, warnings, reason) {
|
|
15724
15905
|
if (reject) {
|
|
15725
15906
|
throwAmbiguousArchive(reason);
|
|
@@ -15762,7 +15943,7 @@ function getBigUint64(view, offset) {
|
|
|
15762
15943
|
}
|
|
15763
15944
|
return Number(value);
|
|
15764
15945
|
}
|
|
15765
|
-
var ERR_BAD_FORMAT, ERR_EOCDR_NOT_FOUND, ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND, ERR_CENTRAL_DIRECTORY_NOT_FOUND,
|
|
15946
|
+
var ERR_BAD_FORMAT, ERR_EOCDR_NOT_FOUND, ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_ENCRYPTED, ERR_UNSUPPORTED_ENCRYPTION, ERR_SPLIT_ZIP_FILE, ERR_ENTRY_DATA_OUT_OF_BOUNDS, ERR_AMBIGUOUS_ARCHIVE, ERR_ENCRYPTED_CENTRAL_DIRECTORY, ERR_UNSAFE_FILENAME, ERR_INVALID_STRICTNESS, ERR_INVALID_FILENAME_VALIDATION, ERR_INVALID_MAX_APPENDED_DATA_SIZE, ERR_UNSUPPORTED_UINT64, WARNING_UNSORTED_CENTRAL_DIRECTORY, WARNING_UNKNOWN_VERSION, WARNING_COMPRESSED_PATCHED_DATA, WARNING_MALFORMED_EXTRA_FIELD, WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA, WARNING_WRAPPED_ENTRIES_COUNT, WARNING_APPENDED_DATA, WARNING_PREPENDED_DATA, WARNING_PREPENDED_CENTRAL_DIRECTORY, WARNING_TRAILING_CENTRAL_DIRECTORY_DATA, WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET, WARNING_MISSING_ZIP64_EXTRA_FIELD, WARNING_DUPLICATE_FILENAME, WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY, WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY, WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME, WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG, WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES, MAX_KNOWN_VERSION, DRIVE_LETTER_REGEXP, PARENT_DIRECTORY_REGEXP, CHARSET_UTF8, PROPERTY_NAME_UTF8_SUFFIX, CHARSET_CP437, BITFLAG_AMBIGUITY_MASK, VENDOR_VERSION_AE_1, ZIP64_PROPERTIES, ZIP64_EXTRACTION, MAX_SAFE_UINT64, MAX_END_OF_CENTRAL_DIR_PROBES, MAX_DEFLATE_EXPANSION_RATIO, CENTRAL_DIRECTORY_UNREACHABLE, CENTRAL_DIRECTORY_PLAUSIBLE, CENTRAL_DIRECTORY_REACHABLE, ZipReader, ZipReaderStream, ZipEntry;
|
|
15766
15947
|
var init_zip_reader = __esm({
|
|
15767
15948
|
"../../node_modules/@zip.js/zip.js/lib/core/zip-reader.js"() {
|
|
15768
15949
|
init_constants();
|
|
@@ -15782,12 +15963,9 @@ var init_zip_reader = __esm({
|
|
|
15782
15963
|
ERR_EOCDR_NOT_FOUND = "End of central directory not found";
|
|
15783
15964
|
ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND = "End of Zip64 central directory locator not found";
|
|
15784
15965
|
ERR_CENTRAL_DIRECTORY_NOT_FOUND = "Central directory header not found";
|
|
15785
|
-
ERR_LOCAL_FILE_HEADER_NOT_FOUND = "Local file header not found";
|
|
15786
|
-
ERR_EXTRAFIELD_ZIP64_NOT_FOUND = "Zip64 extra field not found";
|
|
15787
15966
|
ERR_ENCRYPTED = "File contains encrypted entry";
|
|
15788
15967
|
ERR_UNSUPPORTED_ENCRYPTION = "Encryption method not supported";
|
|
15789
15968
|
ERR_SPLIT_ZIP_FILE = "Split zip file";
|
|
15790
|
-
ERR_OVERLAPPING_ENTRY = "Overlapping entry found";
|
|
15791
15969
|
ERR_ENTRY_DATA_OUT_OF_BOUNDS = "Entry data out of bounds";
|
|
15792
15970
|
ERR_AMBIGUOUS_ARCHIVE = "Ambiguous archive";
|
|
15793
15971
|
ERR_ENCRYPTED_CENTRAL_DIRECTORY = "Encrypted central directory is not supported";
|
|
@@ -15806,6 +15984,8 @@ var init_zip_reader = __esm({
|
|
|
15806
15984
|
WARNING_PREPENDED_DATA = "prepended data";
|
|
15807
15985
|
WARNING_PREPENDED_CENTRAL_DIRECTORY = "prepended central directory";
|
|
15808
15986
|
WARNING_TRAILING_CENTRAL_DIRECTORY_DATA = "trailing central directory data";
|
|
15987
|
+
WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET = "mismatched central directory offset";
|
|
15988
|
+
WARNING_MISSING_ZIP64_EXTRA_FIELD = "missing zip64 extra field";
|
|
15809
15989
|
WARNING_DUPLICATE_FILENAME = "duplicate filename";
|
|
15810
15990
|
WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY = "mismatched zip64 end of central directory record";
|
|
15811
15991
|
WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY = "multiple end of central directory records";
|
|
@@ -15819,7 +15999,7 @@ var init_zip_reader = __esm({
|
|
|
15819
15999
|
CHARSET_UTF8 = "utf-8";
|
|
15820
16000
|
PROPERTY_NAME_UTF8_SUFFIX = "UTF8";
|
|
15821
16001
|
CHARSET_CP437 = "cp437";
|
|
15822
|
-
BITFLAG_AMBIGUITY_MASK = BITFLAG_ENCRYPTED | BITFLAG_DATA_DESCRIPTOR | BITFLAG_LANG_ENCODING_FLAG;
|
|
16002
|
+
BITFLAG_AMBIGUITY_MASK = BITFLAG_ENCRYPTED | BITFLAG_DATA_DESCRIPTOR | BITFLAG_STRONG_ENCRYPTION | BITFLAG_LANG_ENCODING_FLAG;
|
|
15823
16003
|
VENDOR_VERSION_AE_1 = 1;
|
|
15824
16004
|
ZIP64_PROPERTIES = [
|
|
15825
16005
|
[PROPERTY_NAME_UNCOMPRESSED_SIZE, MAX_32_BITS],
|
|
@@ -15847,8 +16027,9 @@ var init_zip_reader = __esm({
|
|
|
15847
16027
|
constructor(reader, options = {}) {
|
|
15848
16028
|
Object.assign(this, {
|
|
15849
16029
|
reader: new GenericReader(reader),
|
|
15850
|
-
options,
|
|
15851
|
-
readRanges: { indexes: /* @__PURE__ */ new Set(), sortedRanges: [], pendingRanges: [] }
|
|
16030
|
+
options: options || {},
|
|
16031
|
+
readRanges: { indexes: /* @__PURE__ */ new Set(), sortedRanges: [], pendingRanges: [] },
|
|
16032
|
+
entriesMissingZip64ExtraField: /* @__PURE__ */ new WeakSet()
|
|
15852
16033
|
});
|
|
15853
16034
|
}
|
|
15854
16035
|
async *getEntriesGenerator(options = {}) {
|
|
@@ -15915,15 +16096,21 @@ var init_zip_reader = __esm({
|
|
|
15915
16096
|
directoryDataOffset = getDiskOffset(reader, getUint32(endOfDirectoryLocatorView, 4)) + getBigUint64(endOfDirectoryLocatorView, 8);
|
|
15916
16097
|
let endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
|
|
15917
16098
|
let endOfDirectoryView2 = getDataView(endOfDirectoryArray);
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
16099
|
+
if (endOfDirectoryArray.length < ZIP64_END_OF_CENTRAL_DIR_LENGTH || getUint32(endOfDirectoryView2, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) {
|
|
16100
|
+
const locatorOffset = endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH;
|
|
16101
|
+
let expectedDirectoryDataOffset = locatorOffset - ZIP64_END_OF_CENTRAL_DIR_LENGTH;
|
|
16102
|
+
if (!await startsWithSignature(reader, expectedDirectoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE)) {
|
|
16103
|
+
expectedDirectoryDataOffset = await findZip64EndOfDirectoryOffset(reader, locatorOffset);
|
|
16104
|
+
}
|
|
16105
|
+
if (expectedDirectoryDataOffset !== UNDEFINED_VALUE && expectedDirectoryDataOffset >= 0 && directoryDataOffset != expectedDirectoryDataOffset) {
|
|
16106
|
+
const originalDirectoryDataOffset = directoryDataOffset;
|
|
16107
|
+
directoryDataOffset = expectedDirectoryDataOffset;
|
|
16108
|
+
if (directoryDataOffset > originalDirectoryDataOffset) {
|
|
16109
|
+
prependedDataLength = directoryDataOffset - originalDirectoryDataOffset;
|
|
16110
|
+
}
|
|
16111
|
+
endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
|
|
16112
|
+
endOfDirectoryView2 = getDataView(endOfDirectoryArray);
|
|
15924
16113
|
}
|
|
15925
|
-
endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
|
|
15926
|
-
endOfDirectoryView2 = getDataView(endOfDirectoryArray);
|
|
15927
16114
|
}
|
|
15928
16115
|
if (endOfDirectoryArray.length < ZIP64_END_OF_CENTRAL_DIR_LENGTH || getUint32(endOfDirectoryView2, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) {
|
|
15929
16116
|
throw new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);
|
|
@@ -15962,14 +16149,12 @@ var init_zip_reader = __esm({
|
|
|
15962
16149
|
reportAmbiguity(checkAmbiguity, warnings, WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY);
|
|
15963
16150
|
}
|
|
15964
16151
|
directoryDataOffset = getDiskOffset(reader, diskNumber) + getBigUint64(endOfDirectoryView2, 48) + prependedDataLength;
|
|
16152
|
+
} else if (directoryDataOffset == MAX_32_BITS || directoryDataLength == MAX_32_BITS || diskNumber == MAX_16_BITS) {
|
|
16153
|
+
throw new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);
|
|
15965
16154
|
}
|
|
15966
16155
|
}
|
|
15967
16156
|
let declaredDirectoryDataLength = directoryDataLength;
|
|
15968
16157
|
const centralDirectoryEndOffset = endOfDirectoryInfo.offset - (zip64EndOfDirectory ? zip64EndOfDirectoryLength + ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH : 0);
|
|
15969
|
-
if (directoryDataOffset >= reader.size) {
|
|
15970
|
-
prependedDataLength = reader.size - directoryDataOffset - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;
|
|
15971
|
-
directoryDataOffset = reader.size - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;
|
|
15972
|
-
}
|
|
15973
16158
|
if (expectedLastDiskNumber != lastDiskNumber) {
|
|
15974
16159
|
throw new Error(ERR_SPLIT_ZIP_FILE);
|
|
15975
16160
|
}
|
|
@@ -15977,31 +16162,54 @@ var init_zip_reader = __esm({
|
|
|
15977
16162
|
throw new Error(ERR_BAD_FORMAT);
|
|
15978
16163
|
}
|
|
15979
16164
|
let offset = 0;
|
|
15980
|
-
let directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);
|
|
16165
|
+
let directoryArray = directoryDataOffset < reader.size ? await readUint8Array(reader, directoryDataOffset, directoryDataLength) : EMPTY_UINT8_ARRAY;
|
|
15981
16166
|
let directoryView = getDataView(directoryArray);
|
|
15982
16167
|
if (directoryDataLength) {
|
|
15983
|
-
|
|
15984
|
-
throw new Error(ERR_BAD_FORMAT);
|
|
15985
|
-
}
|
|
15986
|
-
const expectedDirectoryDataOffset = centralDirectoryEndOffset - directoryDataLength;
|
|
16168
|
+
let expectedDirectoryDataOffset = centralDirectoryEndOffset - directoryDataLength;
|
|
15987
16169
|
if (directoryDataOffset != expectedDirectoryDataOffset && diskNumber == lastDiskNumber) {
|
|
15988
|
-
const storedPointsAtDirectory = getUint32(directoryView, offset) == CENTRAL_FILE_HEADER_SIGNATURE || Boolean(directoryEncryptionInfo && directoryEncryptionInfo.compressedSize) || detectEncryptedCentralDirectory(directoryView);
|
|
16170
|
+
const storedPointsAtDirectory = directoryArray.length >= 4 && (getUint32(directoryView, offset) == CENTRAL_FILE_HEADER_SIGNATURE || Boolean(directoryEncryptionInfo && directoryEncryptionInfo.compressedSize) || detectEncryptedCentralDirectory(directoryView));
|
|
16171
|
+
if (!storedPointsAtDirectory && expectedDirectoryDataOffset < 0) {
|
|
16172
|
+
throw new Error(ERR_BAD_FORMAT);
|
|
16173
|
+
}
|
|
15989
16174
|
let reconcile = !storedPointsAtDirectory;
|
|
15990
|
-
if (
|
|
15991
|
-
|
|
15992
|
-
|
|
16175
|
+
if (expectedDirectoryDataOffset >= 0 && expectedDirectoryDataOffset + 4 <= reader.size) {
|
|
16176
|
+
let expectedPointsAtDirectory = await pointsAtDirectory(reader, expectedDirectoryDataOffset);
|
|
16177
|
+
if (!expectedPointsAtDirectory) {
|
|
16178
|
+
const signatureRecordOffset = await findDigitalSignatureRecordOffset(reader, centralDirectoryEndOffset);
|
|
16179
|
+
const signedDirectoryDataOffset = signatureRecordOffset - directoryDataLength;
|
|
16180
|
+
if (signatureRecordOffset !== UNDEFINED_VALUE && signedDirectoryDataOffset >= 0 && await pointsAtDirectory(reader, signedDirectoryDataOffset)) {
|
|
16181
|
+
expectedDirectoryDataOffset = signedDirectoryDataOffset;
|
|
16182
|
+
expectedPointsAtDirectory = true;
|
|
16183
|
+
}
|
|
16184
|
+
}
|
|
16185
|
+
if (storedPointsAtDirectory) {
|
|
16186
|
+
reconcile = expectedPointsAtDirectory;
|
|
16187
|
+
}
|
|
15993
16188
|
}
|
|
15994
|
-
if (reconcile) {
|
|
16189
|
+
if (reconcile && expectedDirectoryDataOffset != directoryDataOffset) {
|
|
15995
16190
|
const originalDirectoryDataOffset = directoryDataOffset;
|
|
15996
16191
|
directoryDataOffset = expectedDirectoryDataOffset;
|
|
15997
|
-
if (directoryDataOffset > originalDirectoryDataOffset) {
|
|
15998
|
-
prependedDataLength += directoryDataOffset - originalDirectoryDataOffset;
|
|
15999
|
-
prependedCentralDirectory = storedPointsAtDirectory;
|
|
16000
|
-
}
|
|
16001
16192
|
directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);
|
|
16002
16193
|
directoryView = getDataView(directoryArray);
|
|
16194
|
+
const offsetDelta = directoryDataOffset - originalDirectoryDataOffset;
|
|
16195
|
+
const { localHeaderFound, shiftedLocalHeaderFound } = await probeLocalHeaders(reader, directoryArray, directoryView, offsetDelta);
|
|
16196
|
+
if (offsetDelta > 0 && !(localHeaderFound && !shiftedLocalHeaderFound)) {
|
|
16197
|
+
prependedDataLength += offsetDelta;
|
|
16198
|
+
prependedCentralDirectory = storedPointsAtDirectory;
|
|
16199
|
+
} else {
|
|
16200
|
+
reportAmbiguity(checkAmbiguity, warnings, WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET);
|
|
16201
|
+
if (offsetDelta < 0 && !localHeaderFound && shiftedLocalHeaderFound) {
|
|
16202
|
+
prependedDataLength += offsetDelta;
|
|
16203
|
+
}
|
|
16204
|
+
}
|
|
16003
16205
|
}
|
|
16004
16206
|
}
|
|
16207
|
+
if (directoryArray.length < 4) {
|
|
16208
|
+
throw new Error(ERR_BAD_FORMAT);
|
|
16209
|
+
}
|
|
16210
|
+
} else if (!filesLength && directoryDataOffset < centralDirectoryEndOffset && diskNumber == lastDiskNumber) {
|
|
16211
|
+
prependedDataLength += centralDirectoryEndOffset - directoryDataOffset;
|
|
16212
|
+
directoryDataOffset = centralDirectoryEndOffset;
|
|
16005
16213
|
}
|
|
16006
16214
|
const expectedDirectoryDataLength = centralDirectoryEndOffset - directoryDataOffset;
|
|
16007
16215
|
if (directoryDataLength != expectedDirectoryDataLength && expectedDirectoryDataLength >= 0 && diskNumber == lastDiskNumber) {
|
|
@@ -16032,7 +16240,7 @@ var init_zip_reader = __esm({
|
|
|
16032
16240
|
const commentEncoding = getOptionValue(zipReader, options, OPTION_COMMENT_ENCODING);
|
|
16033
16241
|
const filenames = /* @__PURE__ */ new Set();
|
|
16034
16242
|
let duplicateFilename;
|
|
16035
|
-
let previousEntryPosition = -
|
|
16243
|
+
let previousEntryPosition = -Infinity;
|
|
16036
16244
|
const recoverWrappedFilesLength = !checkAmbiguity && !zip64EndOfDirectory;
|
|
16037
16245
|
if (!filesLength && recoverWrappedFilesLength) {
|
|
16038
16246
|
filesLength = getWrappedFilesLength(directoryView, directoryArray, offset);
|
|
@@ -16040,8 +16248,10 @@ var init_zip_reader = __esm({
|
|
|
16040
16248
|
addWarning(warnings, WARNING_WRAPPED_ENTRIES_COUNT);
|
|
16041
16249
|
}
|
|
16042
16250
|
}
|
|
16251
|
+
const entryOptions = Object.assign({}, zipReader.options, options, { [OPTION_STRICTNESS]: strictness });
|
|
16252
|
+
delete entryOptions[OPTION_CHECK_AMBIGUITY];
|
|
16043
16253
|
for (let indexFile = 0; indexFile < filesLength; indexFile++) {
|
|
16044
|
-
const fileEntry = new ZipEntry(reader,
|
|
16254
|
+
const fileEntry = new ZipEntry(reader, entryOptions);
|
|
16045
16255
|
if (offset + CENTRAL_FILE_HEADER_LENGTH > directoryArray.length || getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE) {
|
|
16046
16256
|
if (indexFile == 0 && !decryptedDirectory && (zip64EndOfDirectoryVersion2 || detectEncryptedCentralDirectory(directoryView))) {
|
|
16047
16257
|
throw new Error(ERR_ENCRYPTED_CENTRAL_DIRECTORY);
|
|
@@ -16080,17 +16290,6 @@ var init_zip_reader = __esm({
|
|
|
16080
16290
|
if (filename === UNDEFINED_VALUE) {
|
|
16081
16291
|
filename = decodeText(rawFilename, rawFilenameEncoding);
|
|
16082
16292
|
}
|
|
16083
|
-
if (normalizeFilename) {
|
|
16084
|
-
const normalizedFilename = normalizeFilename(filename);
|
|
16085
|
-
if (normalizedFilename !== UNDEFINED_VALUE) {
|
|
16086
|
-
filename = normalizedFilename;
|
|
16087
|
-
}
|
|
16088
|
-
}
|
|
16089
|
-
if (isUnsafeFilename(filename, filenameValidation)) {
|
|
16090
|
-
const error2 = new Error(ERR_UNSAFE_FILENAME);
|
|
16091
|
-
error2.filename = filename;
|
|
16092
|
-
throw error2;
|
|
16093
|
-
}
|
|
16094
16293
|
let comment = decode2(rawComment, rawCommentEncoding, TEXT_TYPE_COMMENT);
|
|
16095
16294
|
if (comment === UNDEFINED_VALUE) {
|
|
16096
16295
|
comment = decodeText(rawComment, rawCommentEncoding);
|
|
@@ -16118,16 +16317,42 @@ var init_zip_reader = __esm({
|
|
|
16118
16317
|
filename,
|
|
16119
16318
|
comment
|
|
16120
16319
|
});
|
|
16121
|
-
|
|
16320
|
+
let malformedExtraField;
|
|
16321
|
+
try {
|
|
16322
|
+
malformedExtraField = readCommonFooter(fileEntry, fileEntry, directoryView, offset + 6);
|
|
16323
|
+
} catch (error2) {
|
|
16324
|
+
if (checkAmbiguity || error2.message != ERR_EXTRAFIELD_ZIP64_NOT_FOUND) {
|
|
16325
|
+
throw error2;
|
|
16326
|
+
}
|
|
16327
|
+
fileEntry.zip64ExtraFieldMissing = true;
|
|
16328
|
+
addWarning(warnings, WARNING_MISSING_ZIP64_EXTRA_FIELD, fileEntry.filename);
|
|
16329
|
+
}
|
|
16330
|
+
filename = fileEntry.filename;
|
|
16331
|
+
if (normalizeFilename) {
|
|
16332
|
+
const normalizedFilename = normalizeFilename(filename);
|
|
16333
|
+
if (normalizedFilename !== UNDEFINED_VALUE) {
|
|
16334
|
+
filename = fileEntry.filename = normalizedFilename;
|
|
16335
|
+
}
|
|
16336
|
+
}
|
|
16337
|
+
if (isUnsafeFilename(filename, filenameValidation)) {
|
|
16338
|
+
const error2 = new Error(ERR_UNSAFE_FILENAME);
|
|
16339
|
+
error2.filename = filename;
|
|
16340
|
+
throw error2;
|
|
16341
|
+
}
|
|
16342
|
+
if (malformedExtraField) {
|
|
16122
16343
|
addWarning(warnings, WARNING_MALFORMED_EXTRA_FIELD, filename);
|
|
16123
16344
|
}
|
|
16124
|
-
fileEntry.offset
|
|
16125
|
-
|
|
16126
|
-
|
|
16127
|
-
|
|
16128
|
-
|
|
16345
|
+
if (fileEntry.zip64ExtraFieldMissing && fileEntry.offset == MAX_32_BITS) {
|
|
16346
|
+
startOffset = 0;
|
|
16347
|
+
} else {
|
|
16348
|
+
fileEntry.offset += prependedDataLength;
|
|
16349
|
+
const entryPosition = getDiskOffset(reader, fileEntry.diskNumberStart) + fileEntry.offset;
|
|
16350
|
+
startOffset = Math.min(entryPosition, startOffset);
|
|
16351
|
+
if (entryPosition < previousEntryPosition) {
|
|
16352
|
+
addWarning(warnings, WARNING_UNSORTED_CENTRAL_DIRECTORY, filename);
|
|
16353
|
+
}
|
|
16354
|
+
previousEntryPosition = entryPosition;
|
|
16129
16355
|
}
|
|
16130
|
-
previousEntryPosition = entryPosition;
|
|
16131
16356
|
if ((fileEntry.version & MAX_8_BITS) > MAX_KNOWN_VERSION) {
|
|
16132
16357
|
addWarning(warnings, WARNING_UNKNOWN_VERSION, filename);
|
|
16133
16358
|
}
|
|
@@ -16147,9 +16372,10 @@ var init_zip_reader = __esm({
|
|
|
16147
16372
|
const sticky = Boolean(fileEntry.unixMode & FILE_ATTR_UNIX_STICKY_MASK);
|
|
16148
16373
|
const unixType = fileEntry.unixMode === UNDEFINED_VALUE ? unixExternalUpper : fileEntry.unixMode;
|
|
16149
16374
|
const symlink = (unixType & FILE_ATTR_UNIX_TYPE_MASK) == FILE_ATTR_UNIX_TYPE_SYMLINK;
|
|
16150
|
-
const executable = !symlink && (fileEntry.unixMode !== UNDEFINED_VALUE ? (fileEntry.unixMode & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0 : unixCompatible && (unixExternalUpper & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0);
|
|
16151
16375
|
const modeIsDir = fileEntry.unixMode !== UNDEFINED_VALUE && (fileEntry.unixMode & FILE_ATTR_UNIX_TYPE_MASK) == FILE_ATTR_UNIX_TYPE_DIR;
|
|
16152
16376
|
const upperIsDir = (unixExternalUpper & FILE_ATTR_UNIX_TYPE_MASK) == FILE_ATTR_UNIX_TYPE_DIR;
|
|
16377
|
+
const directory = modeIsDir || upperIsDir || msDosCompatible && msdosAttributes.directory || fileEntry.filename.endsWith(DIRECTORY_SIGNATURE);
|
|
16378
|
+
const executable = !symlink && !directory && (fileEntry.unixMode !== UNDEFINED_VALUE ? (fileEntry.unixMode & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0 : unixCompatible && (unixExternalUpper & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0);
|
|
16153
16379
|
Object.assign(fileEntry, {
|
|
16154
16380
|
setuid,
|
|
16155
16381
|
setgid,
|
|
@@ -16157,11 +16383,14 @@ var init_zip_reader = __esm({
|
|
|
16157
16383
|
symlink,
|
|
16158
16384
|
unixExternalUpper,
|
|
16159
16385
|
executable,
|
|
16160
|
-
directory
|
|
16386
|
+
directory,
|
|
16161
16387
|
zipCrypto: fileEntry.encrypted && !fileEntry.extraFieldAES
|
|
16162
16388
|
});
|
|
16163
16389
|
const entry = new Entry(fileEntry);
|
|
16164
|
-
|
|
16390
|
+
if (fileEntry.zip64ExtraFieldMissing) {
|
|
16391
|
+
zipReader.entriesMissingZip64ExtraField.add(entry);
|
|
16392
|
+
}
|
|
16393
|
+
entry.getData = (writer, options2) => fileEntry.getData(writer, entry, zipReader, options2);
|
|
16165
16394
|
entry.arrayBuffer = async (options2) => {
|
|
16166
16395
|
const writer = new TransformStream();
|
|
16167
16396
|
const arrayBufferPromise = streamToBlob(writer.readable).then((blob) => blob.arrayBuffer());
|
|
@@ -16170,7 +16399,7 @@ var init_zip_reader = __esm({
|
|
|
16170
16399
|
await fileEntry.getData(
|
|
16171
16400
|
writer,
|
|
16172
16401
|
entry,
|
|
16173
|
-
zipReader
|
|
16402
|
+
zipReader,
|
|
16174
16403
|
Object.assign({}, options2, { preventClose: false })
|
|
16175
16404
|
);
|
|
16176
16405
|
return arrayBufferPromise;
|
|
@@ -16214,10 +16443,10 @@ var init_zip_reader = __esm({
|
|
|
16214
16443
|
const extractPrependedData = getOptionValue(zipReader, options, OPTION_EXTRACT_PREPENDED_DATA);
|
|
16215
16444
|
const extractAppendedData = getOptionValue(zipReader, options, OPTION_EXTRACT_APPENDED_DATA);
|
|
16216
16445
|
const splitZipSignatureLength = (checkAmbiguity || extractPrependedData) && filesLength && startOffset == SPLIT_ZIP_FILE_SIGNATURE_LENGTH && await startsWithSplitZipMarker(reader) ? SPLIT_ZIP_FILE_SIGNATURE_LENGTH : 0;
|
|
16217
|
-
if (checkAmbiguity && (prependedDataLength || filesLength && startOffset > splitZipSignatureLength)) {
|
|
16446
|
+
if (checkAmbiguity && (prependedDataLength > 0 || filesLength && startOffset > splitZipSignatureLength)) {
|
|
16218
16447
|
throwAmbiguousArchive(WARNING_PREPENDED_DATA);
|
|
16219
16448
|
}
|
|
16220
|
-
if (prependedDataLength || filesLength && startOffset > SPLIT_ZIP_FILE_SIGNATURE_LENGTH) {
|
|
16449
|
+
if (prependedDataLength > 0 || filesLength && startOffset > SPLIT_ZIP_FILE_SIGNATURE_LENGTH) {
|
|
16221
16450
|
addWarning(warnings, WARNING_PREPENDED_DATA);
|
|
16222
16451
|
}
|
|
16223
16452
|
if (prependedCentralDirectory) {
|
|
@@ -16301,8 +16530,12 @@ var init_zip_reader = __esm({
|
|
|
16301
16530
|
options
|
|
16302
16531
|
});
|
|
16303
16532
|
}
|
|
16304
|
-
async getData(writer, fileEntry,
|
|
16533
|
+
async getData(writer, fileEntry, zipReader, options = {}) {
|
|
16305
16534
|
const zipEntry = this;
|
|
16535
|
+
const { readRanges, directoryOffset } = zipReader;
|
|
16536
|
+
if (zipEntry.zip64ExtraFieldMissing) {
|
|
16537
|
+
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
16538
|
+
}
|
|
16306
16539
|
const config3 = getConfiguration();
|
|
16307
16540
|
const {
|
|
16308
16541
|
reader,
|
|
@@ -16333,8 +16566,8 @@ var init_zip_reader = __esm({
|
|
|
16333
16566
|
const passThroughCompression = Boolean(passThrough);
|
|
16334
16567
|
const passThroughEncryption = passThrough === true;
|
|
16335
16568
|
checkPasswordOption(password, rawPassword);
|
|
16336
|
-
password = password && password.length
|
|
16337
|
-
rawPassword = rawPassword && rawPassword.length
|
|
16569
|
+
password = password && password.length ? password : UNDEFINED_VALUE;
|
|
16570
|
+
rawPassword = rawPassword && rawPassword.length ? rawPassword : UNDEFINED_VALUE;
|
|
16338
16571
|
if (extraFieldAES) {
|
|
16339
16572
|
if (extraFieldAES.originalCompressionMethod != COMPRESSION_METHOD_AES) {
|
|
16340
16573
|
throw new Error(ERR_UNSUPPORTED_COMPRESSION);
|
|
@@ -16373,10 +16606,10 @@ var init_zip_reader = __esm({
|
|
|
16373
16606
|
}
|
|
16374
16607
|
validateLocalDirectory(zipEntry, localDirectory, rawLocalFilename, checkLocalFilename, checkLocalDirectory ? UNDEFINED_VALUE : warnings);
|
|
16375
16608
|
const { lastAccessDate, creationDate, uid, gid } = localDirectory;
|
|
16376
|
-
if (lastAccessDate) {
|
|
16609
|
+
if (lastAccessDate && fileEntry.lastAccessDate === UNDEFINED_VALUE) {
|
|
16377
16610
|
fileEntry.lastAccessDate = lastAccessDate;
|
|
16378
16611
|
}
|
|
16379
|
-
if (creationDate) {
|
|
16612
|
+
if (creationDate && fileEntry.creationDate === UNDEFINED_VALUE) {
|
|
16380
16613
|
fileEntry.creationDate = creationDate;
|
|
16381
16614
|
}
|
|
16382
16615
|
if (uid !== UNDEFINED_VALUE && fileEntry.uid === UNDEFINED_VALUE) {
|
|
@@ -16386,12 +16619,12 @@ var init_zip_reader = __esm({
|
|
|
16386
16619
|
fileEntry.gid = gid;
|
|
16387
16620
|
}
|
|
16388
16621
|
const checkPasswordOnly = getOptionValue(zipEntry, options, OPTION_CHECK_PASSWORD_ONLY);
|
|
16389
|
-
const encrypted = zipEntry.encrypted &&
|
|
16622
|
+
const encrypted = zipEntry.encrypted && (!passThroughEncryption || checkPasswordOnly);
|
|
16390
16623
|
const zipCrypto = encrypted && !extraFieldAES;
|
|
16391
16624
|
if (!passThroughEncryption) {
|
|
16392
16625
|
fileEntry.zipCrypto = zipCrypto;
|
|
16393
16626
|
}
|
|
16394
|
-
if (encrypted && (
|
|
16627
|
+
if (encrypted && (zipEntry.rawBitFlag & BITFLAG_STRONG_ENCRYPTION) == BITFLAG_STRONG_ENCRYPTION) {
|
|
16395
16628
|
throw new Error(ERR_UNSUPPORTED_ENCRYPTION);
|
|
16396
16629
|
}
|
|
16397
16630
|
const registeredCodec = passThroughCompression ? UNDEFINED_VALUE : getRegisteredCodec(compressionMethod);
|
|
@@ -16405,7 +16638,7 @@ var init_zip_reader = __esm({
|
|
|
16405
16638
|
throw new Error(ERR_ENCRYPTED);
|
|
16406
16639
|
}
|
|
16407
16640
|
}
|
|
16408
|
-
if (dataOffset + compressedSize > reader.size) {
|
|
16641
|
+
if (dataOffset + compressedSize > Math.min(reader.size, directoryOffset)) {
|
|
16409
16642
|
throw new Error(ERR_ENTRY_DATA_OUT_OF_BOUNDS);
|
|
16410
16643
|
}
|
|
16411
16644
|
const size = compressedSize;
|
|
@@ -16442,7 +16675,6 @@ var init_zip_reader = __esm({
|
|
|
16442
16675
|
encrypted,
|
|
16443
16676
|
useWebWorkers: getOptionValue(zipEntry, options, OPTION_USE_WEB_WORKERS),
|
|
16444
16677
|
useCompressionStream,
|
|
16445
|
-
transferStreams: getOptionValue(zipEntry, options, OPTION_TRANSFER_STREAMS),
|
|
16446
16678
|
deflate64,
|
|
16447
16679
|
format: registeredCodec ? registeredCodec.format : UNDEFINED_VALUE,
|
|
16448
16680
|
codecURI: registeredCodec ? registeredCodec.codecURI : UNDEFINED_VALUE,
|
|
@@ -16467,6 +16699,7 @@ var init_zip_reader = __esm({
|
|
|
16467
16699
|
extraFieldZip64: extraFieldZip64 || localDirectory.extraFieldZip64,
|
|
16468
16700
|
readRanges
|
|
16469
16701
|
});
|
|
16702
|
+
validateDataDescriptor(zipEntry, localDirectory, checkLocalDirectory ? UNDEFINED_VALUE : warnings);
|
|
16470
16703
|
}
|
|
16471
16704
|
let writable, abortError, aborted2;
|
|
16472
16705
|
try {
|
|
@@ -16479,16 +16712,14 @@ var init_zip_reader = __esm({
|
|
|
16479
16712
|
({ writable } = writer);
|
|
16480
16713
|
const readable = toCompatibleReadable(reader.createReadable({ offset: dataOffset, size }));
|
|
16481
16714
|
const { outputSize: writtenSize } = await runWorker2({ readable, writable }, workerOptions);
|
|
16715
|
+
throwIfAborted(signal);
|
|
16482
16716
|
if (writtenSize != outputSize) {
|
|
16483
16717
|
throw Object.assign(new Error(ERR_INVALID_UNCOMPRESSED_SIZE), { outputSize: writtenSize });
|
|
16484
16718
|
}
|
|
16485
16719
|
writer.size += writtenSize;
|
|
16486
16720
|
}
|
|
16487
16721
|
} catch (error2) {
|
|
16488
|
-
|
|
16489
|
-
if (failedOutputSize !== UNDEFINED_VALUE) {
|
|
16490
|
-
writer.size += failedOutputSize;
|
|
16491
|
-
} else if (isErrorObject(error2) && error2.outputSize !== UNDEFINED_VALUE) {
|
|
16722
|
+
if (isErrorObject(error2) && error2.outputSize !== UNDEFINED_VALUE) {
|
|
16492
16723
|
writer.size += error2.outputSize;
|
|
16493
16724
|
}
|
|
16494
16725
|
if (!checkPasswordOnly || !isErrorObject(error2) || error2.message != ERR_ABORT_CHECK_PASSWORD) {
|
|
@@ -34527,7 +34758,12 @@ var OAuthTokensSchema = object({
|
|
|
34527
34758
|
token_type: string2(),
|
|
34528
34759
|
expires_in: coerce_exports.number().optional(),
|
|
34529
34760
|
scope: string2().optional(),
|
|
34530
|
-
refresh_token: string2().optional()
|
|
34761
|
+
refresh_token: string2().optional(),
|
|
34762
|
+
/**
|
|
34763
|
+
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
34764
|
+
* the client's `auth()` before it is stored and compared when it is read back.
|
|
34765
|
+
*/
|
|
34766
|
+
issuer: string2().optional().catch(void 0)
|
|
34531
34767
|
}).strip();
|
|
34532
34768
|
var OAuthErrorResponseSchema = object({
|
|
34533
34769
|
error: string2(),
|
|
@@ -34557,7 +34793,12 @@ var OAuthClientInformationSchema = object({
|
|
|
34557
34793
|
client_id: string2(),
|
|
34558
34794
|
client_secret: string2().optional(),
|
|
34559
34795
|
client_id_issued_at: number2().optional(),
|
|
34560
|
-
client_secret_expires_at: number2().optional()
|
|
34796
|
+
client_secret_expires_at: number2().optional(),
|
|
34797
|
+
/**
|
|
34798
|
+
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
34799
|
+
* the client's `auth()` before it is stored and compared when it is read back.
|
|
34800
|
+
*/
|
|
34801
|
+
issuer: string2().optional().catch(void 0)
|
|
34561
34802
|
}).strip();
|
|
34562
34803
|
var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
34563
34804
|
var OAuthClientRegistrationErrorSchema = object({
|
|
@@ -34664,6 +34905,10 @@ var OAUTH_ERRORS = {
|
|
|
34664
34905
|
[InvalidTargetError.errorCode]: InvalidTargetError
|
|
34665
34906
|
};
|
|
34666
34907
|
|
|
34908
|
+
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
|
|
34909
|
+
var TokenResponseSchema = OAuthTokensSchema.omit({ issuer: true });
|
|
34910
|
+
var RegistrationResponseSchema = OAuthClientInformationFullSchema.omit({ issuer: true });
|
|
34911
|
+
|
|
34667
34912
|
// ../linkque-agent-runtime/dist/esm/impl/mcp/alipay/argsMapper.js
|
|
34668
34913
|
var USER_ID = Symbol("\u7CFB\u7EDF\u53D8\u91CF\u7528\u6237\u6807\u8BC6");
|
|
34669
34914
|
|
|
@@ -35505,11 +35750,11 @@ var RUN_TABLE_COLUMNS = [
|
|
|
35505
35750
|
},
|
|
35506
35751
|
{
|
|
35507
35752
|
key: "lines",
|
|
35508
|
-
type: "
|
|
35753
|
+
type: "longtext",
|
|
35509
35754
|
required: false,
|
|
35510
35755
|
array: true,
|
|
35511
|
-
// 单条 SSE data 行可能承载完整 A2UI Config,使用
|
|
35512
|
-
size:
|
|
35756
|
+
// 单条 SSE data 行可能承载完整 A2UI Config,使用 longtext 数组避免 varchar 长度限制。
|
|
35757
|
+
size: 0,
|
|
35513
35758
|
default: null
|
|
35514
35759
|
},
|
|
35515
35760
|
{
|
|
@@ -37686,29 +37931,29 @@ t.fill(8, 0, 144), t.fill(9, 144, 256), t.fill(7, 256, 280), t.fill(8, 280, 288)
|
|
|
37686
37931
|
var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
37687
37932
|
var e = (t3) => t3({ workerURI: (t4) => {
|
|
37688
37933
|
const e3 = "text/javascript";
|
|
37689
|
-
let s4 = '!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";const{Array:t,Object:n,Number:e,Math:o,Error:s,Uint8Array:r,Uint16Array:c,Uint32Array:i,Int32Array:a,Map:f,DataView:u,Promise:w,TextEncoder:l,crypto:h,postMessage:p,TransformStream:d,ReadableStream:y,WritableStream:m,CompressionStream:S,DecompressionStream:g}=self,v=void 0,k="undefined",z="function",b=new r,C=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let n=t;for(let t=0;t<8;t++)n=1&n?n>>>1^3988292384:n>>>1;C[0][t]=n}for(let t=0;t<256;t++)for(let n=1;n<8;n++){const e=C[n-1][t];C[n][t]=e>>>8^C[0][255&e]}const[I,A,M,x,P,D,F,E]=C;class R{constructor(t){this.o=t||-1}append(t){let n=0|this.o;const e=0|t.length;let o=0;if(e>=8&&t.buffer){const s=new u(t.buffer,t.byteOffset,e),r=e-8;for(;o<=r;o+=8){const t=n^s.getInt32(o,!0),e=s.getInt32(o+4,!0);n=E[255&t]^F[t>>>8&255]^D[t>>>16&255]^P[t>>>24&255]^x[255&e]^M[e>>>8&255]^A[e>>>16&255]^I[e>>>24&255]}}for(;o<e;o++)n=n>>>8^I[255&(n^t[o])];this.o=n}get(){return~this.o}}class U extends d{constructor(){let t;const n=new R;super({transform(t,e){n.append(t),e.enqueue(t)},flush(){const e=new r(4);new u(e.buffer).setUint32(0,n.get()),t.value=e}}),t=this}}function B(t,n){const e=new r(t.length+n.length);return e.set(t),e.set(n,t.length),e}function V(t){return new u(t.buffer,t.byteOffset,t.byteLength)}const W=64,j=20,K=new r([128]),O=new r(1),T=new a([1732584193,4023233417,2562383102,271733878,3285377520]),H=new r(256),L=new a(256),N=new a(256),q=new a(256),G=new a(256);let J=!1;function Q(t,n){!function(){if(!J){let t=1,n=1;do{t=255&(t^t<<1^(128&t?27:0)),n=255&(n^n<<1),n=255&(n^n<<2),n=255&(n^n<<4),128&n&&(n^=9),H[t]=255&(n^(n<<1|n>>7)^(n<<2|n>>6)^(n<<3|n>>5)^(n<<4|n>>4)^99)}while(1!=t);H[0]=99;for(let t=0;t<256;t++){const n=H[t],e=$(n),o=e<<24|n<<16|n<<8|e^n;L[t]=o,N[t]=o>>>8|o<<24,q[t]=o>>>16|o<<16,G[t]=o>>>24|o<<8}J=!0}}();const e=new a(60),o=function(t,n){const e=t.length>>2,o=e+6,s=4*(o+1);let r=1;for(let o=0;o<e;o++)n[o]=t[4*o]<<24|t[4*o+1]<<16|t[4*o+2]<<8|t[4*o+3];for(let t=e;t<s;t++){let o=n[t-1];t%e==0?(o=Y(o<<8|o>>>24)^r<<24,r=$(r)):e>6&&t%e==4&&(o=Y(o)),n[t]=n[t-e]^o}return o}(t,e),s=new a(4),r=X(n);let c=0,i=0,f=0,w=0;return{process(t,n){n&&r.update(t,0,t.length),function(t){const n=new u(t.buffer,t.byteOffset,t.byteLength),e=t.length;let o=0;for(;o+16<=e;o+=16)l(),n.setInt32(o,n.getInt32(o)^s[0]),n.setInt32(o+4,n.getInt32(o+4)^s[1]),n.setInt32(o+8,n.getInt32(o+8)^s[2]),n.setInt32(o+12,n.getInt32(o+12)^s[3]);if(o<e){l();for(let n=0;o<e;o++,n++)t[o]^=s[n>>2]>>>24-8*(3&n)}}(t),n||r.update(t,0,t.length)},digest:()=>r.digest()};function l(){c=c+1|0,c||(i=i+1|0,i||(f=f+1|0,f||(w=w+1|0)));let t=Z(c)^e[0],n=Z(i)^e[1],r=Z(f)^e[2],a=Z(w)^e[3],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[4],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[5],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[6],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[7];t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[8],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[9],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[10],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[11],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[12],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[13],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[14],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[15],t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[16],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[17],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[18],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[19],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[20],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[21],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[22],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[23],t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[24],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[25],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[26],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[27],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[28],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[29],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[30],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[31],t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[32],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[33],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[34],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[35],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[36],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[37],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[38],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[39];let d=40;o>10&&(t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[40],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[41],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[42],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[43],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[44],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[45],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[46],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[47],d=48),o>12&&(t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[48],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[49],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[50],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[51],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[52],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[53],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[54],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[55],d=56),s[0]=(H[u>>>24]<<24|H[l>>>16&255]<<16|H[h>>>8&255]<<8|H[255&p])^e[d],s[1]=(H[l>>>24]<<24|H[h>>>16&255]<<16|H[p>>>8&255]<<8|H[255&u])^e[d+1],s[2]=(H[h>>>24]<<24|H[p>>>16&255]<<16|H[u>>>8&255]<<8|H[255&l])^e[d+2],s[3]=(H[p>>>24]<<24|H[u>>>16&255]<<16|H[l>>>8&255]<<8|H[255&h])^e[d+3]}}function X(t){const n=function(){const t=new a(T),n=new a(16),e=new r(W),s=new u(e.buffer),c=new r(8);let i=0,f=0;return{update:w,digest:function(){const n=8*f,e=o.floor(n/4294967296),s=n>>>0;for(w(K,0,1);56!=i;)w(O,0,1);c[0]=e>>>24,c[1]=e>>>16,c[2]=e>>>8,c[3]=e,c[4]=s>>>24,c[5]=s>>>16,c[6]=s>>>8,c[7]=s,w(c,0,8);const a=new r(j),l=new u(a.buffer);for(let n=0;n<t.length;n++)l.setInt32(4*n,t[n]);return t.set(T),i=0,f=0,a}};function w(t,n,o){const r=n+o;if(f+=o,i){for(;n<r&&i<W;)e[i++]=t[n++];i==W&&(l(s,0),i=0)}if(n+W<=r){const e=new u(t.buffer,t.byteOffset,t.byteLength);for(;n+W<=r;n+=W)l(e,n)}for(;n<r;)e[i++]=t[n++]}function l(e,o){for(let t=0;t<16;t++)n[t]=e.getInt32(o+4*t);let s,r=t[0],c=t[1],i=t[2],a=t[3],f=t[4];for(let t=0;t<15;t+=5)f=(r<<5|r>>>27)+((i^a)&c^a)+f+1518500249+n[t]|0,c=c<<30|c>>>2,a=(f<<5|f>>>27)+((c^i)&r^i)+a+1518500249+n[t+1]|0,r=r<<30|r>>>2,i=(a<<5|a>>>27)+((r^c)&f^c)+i+1518500249+n[t+2]|0,f=f<<30|f>>>2,c=(i<<5|i>>>27)+((f^r)&a^r)+c+1518500249+n[t+3]|0,a=a<<30|a>>>2,r=(c<<5|c>>>27)+((a^f)&i^f)+r+1518500249+n[t+4]|0,i=i<<30|i>>>2;f=(r<<5|r>>>27)+((i^a)&c^a)+f+1518500249+n[15]|0,c=c<<30|c>>>2,s=n[13]^n[8]^n[2]^n[0],s=s<<1|s>>>31,n[0]=s,a=(f<<5|f>>>27)+((c^i)&r^i)+a+1518500249+s|0,r=r<<30|r>>>2,s=n[14]^n[9]^n[3]^n[1],s=s<<1|s>>>31,n[1]=s,i=(a<<5|a>>>27)+((r^c)&f^c)+i+1518500249+s|0,f=f<<30|f>>>2,s=n[15]^n[10]^n[4]^n[2],s=s<<1|s>>>31,n[2]=s,c=(i<<5|i>>>27)+((f^r)&a^r)+c+1518500249+s|0,a=a<<30|a>>>2,s=n[0]^n[11]^n[5]^n[3],s=s<<1|s>>>31,n[3]=s,r=(c<<5|c>>>27)+((a^f)&i^f)+r+1518500249+s|0,i=i<<30|i>>>2;for(let t=20;t<40;t+=5)s=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],s=s<<1|s>>>31,n[15&t]=s,f=(r<<5|r>>>27)+(c^i^a)+f+1859775393+s|0,c=c<<30|c>>>2,s=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],s=s<<1|s>>>31,n[t+1&15]=s,a=(f<<5|f>>>27)+(r^c^i)+a+1859775393+s|0,r=r<<30|r>>>2,s=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],s=s<<1|s>>>31,n[t+2&15]=s,i=(a<<5|a>>>27)+(f^r^c)+i+1859775393+s|0,f=f<<30|f>>>2,s=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],s=s<<1|s>>>31,n[t+3&15]=s,c=(i<<5|i>>>27)+(a^f^r)+c+1859775393+s|0,a=a<<30|a>>>2,s=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],s=s<<1|s>>>31,n[t+4&15]=s,r=(c<<5|c>>>27)+(i^a^f)+r+1859775393+s|0,i=i<<30|i>>>2;for(let t=40;t<60;t+=5)s=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],s=s<<1|s>>>31,n[15&t]=s,f=(r<<5|r>>>27)+(c&i|(c|i)&a)+f+2400959708+s|0,c=c<<30|c>>>2,s=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],s=s<<1|s>>>31,n[t+1&15]=s,a=(f<<5|f>>>27)+(r&c|(r|c)&i)+a+2400959708+s|0,r=r<<30|r>>>2,s=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],s=s<<1|s>>>31,n[t+2&15]=s,i=(a<<5|a>>>27)+(f&r|(f|r)&c)+i+2400959708+s|0,f=f<<30|f>>>2,s=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],s=s<<1|s>>>31,n[t+3&15]=s,c=(i<<5|i>>>27)+(a&f|(a|f)&r)+c+2400959708+s|0,a=a<<30|a>>>2,s=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],s=s<<1|s>>>31,n[t+4&15]=s,r=(c<<5|c>>>27)+(i&a|(i|a)&f)+r+2400959708+s|0,i=i<<30|i>>>2;for(let t=60;t<80;t+=5)s=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],s=s<<1|s>>>31,n[15&t]=s,f=(r<<5|r>>>27)+(c^i^a)+f+3395469782+s|0,c=c<<30|c>>>2,s=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],s=s<<1|s>>>31,n[t+1&15]=s,a=(f<<5|f>>>27)+(r^c^i)+a+3395469782+s|0,r=r<<30|r>>>2,s=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],s=s<<1|s>>>31,n[t+2&15]=s,i=(a<<5|a>>>27)+(f^r^c)+i+3395469782+s|0,f=f<<30|f>>>2,s=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],s=s<<1|s>>>31,n[t+3&15]=s,c=(i<<5|i>>>27)+(a^f^r)+c+3395469782+s|0,a=a<<30|a>>>2,s=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],s=s<<1|s>>>31,n[t+4&15]=s,r=(c<<5|c>>>27)+(i^a^f)+r+3395469782+s|0,i=i<<30|i>>>2;t[0]=t[0]+r|0,t[1]=t[1]+c|0,t[2]=t[2]+i|0,t[3]=t[3]+a|0,t[4]=t[4]+f|0}}(),e=new r(W),s=new r(W);t.length>W&&(n.update(t,0,t.length),t=n.digest());for(let n=0;n<W;n++){const o=n<t.length?t[n]:0;e[n]=54^o,s[n]=92^o}return n.update(e,0,W),{update(t,e,o){n.update(t,e,o)},digest(){const t=n.digest();n.update(s,0,W),n.update(t,0,j);const o=n.digest();return n.update(e,0,W),o}}}function Y(t){return H[t>>>24]<<24|H[t>>>16&255]<<16|H[t>>>8&255]<<8|H[255&t]}function Z(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function $(t){return 255&(t<<1^27*(t>>7))}const _=typeof h!=k&&typeof h.getRandomValues==z,tt="Invalid password",nt="zipjs-abort-check-password";function et(t){if(_)return h.getRandomValues(t);throw new s("Crypto API not supported")}const ot={name:"PBKDF2"},st=n.assign({hash:{name:"HMAC"}},ot),rt=n.assign({iterations:1e3,hash:{name:"SHA-1"}},ot),ct=["deriveBits"],it=[8,12,16],at=[16,24,32],ft=10,ut=typeof h!=k,wt=ut&&h.subtle;let lt=ut&&typeof wt!=k&&typeof wt.importKey==z&&typeof wt.deriveBits==z,ht=Q;class pt extends d{constructor({password:t,rawPassword:n,encryptionStrength:e,checkPasswordOnly:o,checkAuthenticationCode:c=!0}){super({start(){yt(this,t,n,e)},async transform(t,n){const e=this,{password:c,strength:i,l:a,ready:f}=e;c?(await async function(t,n,e,o){const r=await gt(t,n,e,kt(o,0,it[n])),c=kt(o,it[n]);if(r[0]!=c[0]||r[1]!=c[1])throw St(t),new s(tt)}(e,i,c,kt(t,0,it[i]+2)),t=kt(t,it[i]+2),o?(St(e),n.error(new s(nt))):a()):await f;const u=new r(t.length-ft-(t.length-ft)%16);n.enqueue(mt(e,t,u,0,ft,!0))},async flush(t){const{h:n,m:e,ready:o}=this;if(n){await o;const i=kt(e,e.length-ft),a=new r(kt(e,0,e.length-ft));n.process(a,!0);const f=n.digest();let u=e.length<ft?1:0;for(let t=0;t<ft;t++)u|=f[t]^i[t];if(u&&c)throw new s("Invalid authentication code");t.enqueue(a)}},cancel(){St(this)}})}}class dt extends d{constructor({password:t,rawPassword:n,encryptionStrength:e}){super({start(){yt(this,t,n,e)},async transform(t,n){const e=this,{password:o,strength:s,l:c,ready:i}=e;let a=b;o?(a=await async function(t,n,e){const o=et(new r(it[n]));return B(o,await gt(t,n,e,o))}(e,s,o),c()):await i;const f=new r(a.length+t.length-t.length%16);f.set(a,0),n.enqueue(mt(e,t,f,a.length,0,!1))},async flush(t){const{h:n,m:e,ready:o}=this;if(n){await o;const s=new r(e);n.process(s,!1);const c=kt(n.digest(),0,ft);t.enqueue(B(s,c))}},cancel(){St(this)}})}}function yt(t,e,o,s){n.assign(t,{ready:new w(n=>t.l=n),password:vt(e,o),strength:s-1,m:b})}function mt(t,n,e,o,s,c){const{h:i,m:a}=t;a.length&&(n=B(a,n));const f=n.length-s,u=f-f%16;if(e=function(t,n){if(n&&n>t.length){const e=t;(t=new r(n)).set(e,0)}return t}(e,o+u),u){const t=kt(e,o,o+u);t.set(kt(n,0,u)),i.process(t,c)}return t.m=kt(n,u),e}function St({h:t}){t&&t.dispose&&t.dispose()}async function gt(t,e,s,c){t.password=null;const i=at[e],a=await async function(t,e,s){if(lt)try{const o=await wt.importKey("raw",t,st,!1,ct);return new r(await wt.deriveBits(n.assign({salt:e},rt),o,8*s))}catch{lt=!1}return function(t,n,e,s){const c=X(t),i=new r(s),a=new r(n.length+4),f=new u(a.buffer);a.set(n);for(let t=1,e=0;e<s;t++,e+=j){f.setUint32(n.length,t),c.update(a,0,a.length);let r=c.digest();const u=r.slice();for(let t=1;t<1e3;t++){c.update(r,0,j),r=c.digest();for(let t=0;t<j;t++)u[t]^=r[t]}i.set(u.subarray(0,o.min(j,s-e)),e)}return i}(t,e,0,s)}(s,c,2*i+2);return t.h=ht(kt(a,0,i),kt(a,i,2*i)),kt(a,2*i)}function vt(t,n){return n===v?function(t){if(typeof l==k){t=unescape(encodeURIComponent(t));const n=new r(t.length);for(let e=0;e<n.length;e++)n[e]=t.charCodeAt(e);return n}return(new l).encode(t)}(t):n}function kt(t,n,e){return t.subarray(n,e)}class zt extends d{constructor({password:t,rawPassword:n,passwordVerification:e,checkPasswordOnly:o}){super({start(){Ct(this,t,n,e)},transform(t,n){const e=this;if(e.password||e.rawPassword){const n=It(e,t.subarray(0,12));if(e.password=e.rawPassword=null,0!=(n[11]^e.passwordVerification))throw new s(tt);t=t.subarray(12)}o?n.error(new s(nt)):n.enqueue(It(e,t))}})}}class bt extends d{constructor({password:t,rawPassword:n,passwordVerification:e}){super({start(){Ct(this,t,n,e)},transform(t,n){const e=this;let o,s;if(e.password||e.rawPassword){e.password=e.rawPassword=null;const n=et(new r(12));n[11]=e.passwordVerification,o=new r(t.length+n.length),o.set(At(e,n),0),s=12}else o=new r(t.length),s=0;o.set(At(e,t),s),n.enqueue(o)}})}}function Ct(t,e,o,s){n.assign(t,{password:e,rawPassword:o,passwordVerification:s}),function(t,e,o){const s=[305419896,591751049,878082192];if(n.assign(t,{keys:s,S:new R(s[0]),v:new R(s[2])}),o)for(let n=0;n<o.length;n++)Mt(t,o[n]);else for(let n=0;n<e.length;n++)Mt(t,e.charCodeAt(n))}(t,e,o)}function It(t,n){const e=new r(n.length);for(let o=0;o<n.length;o++)e[o]=xt(t)^n[o],Mt(t,e[o]);return e}function At(t,n){const e=new r(n.length);for(let o=0;o<n.length;o++)e[o]=xt(t)^n[o],Mt(t,n[o]);return e}function Mt(t,n){let[,e]=t.keys;t.S.append([n]);const s=~t.S.get();e=Dt(o.imul(Dt(e+Pt(s)),134775813)+1),t.v.append([e>>>24]);const r=~t.v.get();t.keys=[s,e,r]}function xt(t){const n=2|t.keys[2];return Pt(o.imul(n,1^n)>>>8)}function Pt(t){return 255&t}function Dt(t){return 4294967295&t}function Ft(t){if(t instanceof y)return t;const n=t.getReader();return new y({async pull(t){const{value:e,done:o}=await n.read();o?t.close():t.enqueue(e)},cancel:t=>n.cancel(t)})}const Et=new f;function Rt(t){return Et.get(t)}const Ut="Invalid uncompressed size",Bt="Invalid CRC32",Vt="deflate-raw",Wt="gzip",jt=[31,139,8];class Kt extends d{constructor(t,{chunkSize:n,CompressionStreamFallback:e,CompressionStream:o}){super({});const{compressed:s,encrypted:r,useCompressionStream:c,zipCrypto:i,computeCrc32:a,level:f,deflate64:w,format:l,compressionMethod:h,inputSize:p}=t,d=this;let y,m,S,g=super.readable;const v=l&&Rt(l),k=qt(c,o,e),z=a&&s&&!w&&!v&&(!r||i)&&Boolean(k);if(r&&!i||!a||z||(y=new U,g=Jt(g,y)),s)if(v)g=Qt(g,Nt(v.CompressionStream,l,{level:f,chunkSize:n,compressionMethod:h,uncompressedSize:p}));else if(z)S=new Ot,g=Qt(g,new k(Wt,{level:f,chunkSize:n})),g=Jt(g,S);else try{g=Gt(g,c,{level:f,chunkSize:n},o,e)}catch(t){if(!c&&e)throw t;let n;try{n=new o(Wt)}catch{throw t}g=Qt(g,n),g=Jt(g,new Ot)}r&&(i?g=Jt(g,new bt(t)):(m=new dt(t),g=Jt(g,m))),Lt(d,g,()=>{r&&!i||!a||(d.crc32=z?S.crc32:new u(y.value.buffer).getUint32(0))})}}class Ot extends d{constructor(){let t,n=10,e=new r(0);super({transform(t,s){if(n){const e=o.min(n,t.length);if(n-=e,!(t=t.subarray(e)).length)return}const r=e.length+t.length;if(r<=8)return void(e=B(e,t));const c=r-8,i=o.min(c,e.length);s.enqueue(B(e.subarray(0,i),t.subarray(0,c-i))),e=B(e.subarray(i),t.subarray(c-i))},flush(){const n=V(e);t.crc32=n.getUint32(0,!0),t.uncompressedSize=n.getUint32(4,!0)}}),t=this}}class Tt extends d{constructor(t,{chunkSize:n,DecompressionStreamFallback:e,DecompressionStream:o}){super({});const{zipCrypto:c,encrypted:i,checkCrc32:a,crc32:f,compressed:l,useCompressionStream:h,deflate64:p,format:d,compressionMethod:m,rawBitFlag:S,outputSize:g}=t;let k,z,b,C=super.readable;if(i&&(c?C=Jt(C,new zt(t)):(z=new pt(t),C=Jt(C,z))),l){const t=d&&Rt(d);if(t)C=Qt(C,Nt(t.DecompressionStream,d,{chunkSize:n,compressionMethod:m,rawBitFlag:S,uncompressedSize:g}));else{let t;const c=qt(h,o,e);if(a&&!p&&f!==v&&g!==v&&c)try{t=new c(Wt,{chunkSize:n})}catch{t=v}if(!t)try{C=Gt(C,h,{chunkSize:n,deflate64:p},o,e)}catch(n){if(p||g===v||!h&&e)throw n;try{t=new o(Wt)}catch{throw n}}t&&(b=!0,C=function(t,n,e,o){const c=n.writable.getWriter(),i=n.readable.getReader(),a=o===v?new R:v;let f,u,l=0,h=!1,p=!1,d=!1,m=0,S=!1;const g=new w((t,n)=>{f=t,u=n});return g.catch(()=>{}),async function(){const n=t.getReader();try{const t=new r(10);for(t.set(jt),await c.write(t);;){await c.ready;const{value:t,done:e}=await n.read();if(e)break;await c.write(t)}h=!0,a&&(S&&z(),await g);const s=new r(8),i=V(s);i.setUint32(0,a?a.get():o,!0),i.setUint32(4,e,!0),p=!0,await c.write(s),await c.close()}catch(t){await Xt(c,t),await Yt(n,t)}}(),new y({async pull(t){let n;try{n=await function(){m++,S=!0;const t=i.read();return t.then(k,k),h&&a&&z(),t}()}catch(t){throw p?function(t){const n=new s(l==e?Bt:Ut);return n.cause=t,n}(t):t}const{value:o,done:r}=n;if(r)t.close();else{if(l+=o.length,l>e){const t=new s(Ut);throw u(t),await Yt(i,t),t}a&&a.append(o),t.enqueue(o)}},cancel:t=>(u(t),i.cancel(t))});function k(){S=!1}async function z(){if(!d){d=!0;const t=m;await new w(t=>{const{port1:n,port2:e}=new MessageChannel;e.onmessage=()=>{n.close(),e.close(),t()},n.postMessage(v)}),d=!1,S&&(m==t?f():z())}}}(C,t,g,f))}C=function(t){const n=t.getReader();return new y({async pull(t){let e;try{e=await n.read()}catch(t){if(t&&t.message)throw t;const n=new s("Invalid compressed data");throw n.cause=t,n}const{value:o,done:r}=e;r?t.close():t.enqueue(o)},cancel:t=>n.cancel(t)})}(C)}a&&!b&&(k=new U,C=Jt(C,k)),Lt(this,C,()=>{if(k){const t=new u(k.value.buffer).getUint32(0,!1);if(f!=t)throw new s(Bt)}})}}const Ht=new f;function Lt(t,e,o){e=Jt(e,new d({flush:o})),n.defineProperty(t,"readable",{get:()=>e})}function Nt(t,n,e){if(!t)throw new s("Compression method not supported");return new t(n,e)}function qt(t,n,e){return t&&n?n:e&&e.requiresModule?e:void 0}function Gt(t,n,e,o,s){const r=n&&o?o:s||o,c=e.deflate64?"deflate64-raw":Vt;let i;try{i=new r(c,e)}catch(t){if(!n||!s||r==s)throw t;i=new s(c,e)}return Qt(t,i)}function Jt(t,n){return Ft(t).pipeThrough(n)}function Qt(t,n){const e=n.writable.getWriter(),o=t.getReader();return async function(){try{for(;;){await e.ready;const t=await o.read();if(t.done){await e.close();break}await e.write(t.value)}}catch(t){await Xt(e,t),await Yt(o,t)}}(),n.readable}async function Xt(t,n){try{await t.abort(n)}catch{}}async function Yt(t,n){try{await t.cancel(n)}catch{}}const Zt="data",$t="deflate";class _t extends d{constructor(t,e){super({});const o=this,{codecType:r}=t;let c;r.startsWith($t)?c=Kt:r.startsWith("inflate")&&(c=Tt),o.outputSize=0;let i=0;const a=new c(t,e),f=super.readable,u=new d({transform(t,n){t&&t.length&&(i+=t.length,n.enqueue(t))},flush(){n.assign(o,{inputSize:i})}}),w=new d({transform(n,e){if(n&&n.length&&(e.enqueue(n),o.outputSize+=n.length,t.outputSize!==v&&o.outputSize>t.outputSize))throw new s(Ut)},flush(){const{crc32:t}=a;n.assign(o,{crc32:t,inputSize:i})}});n.defineProperty(o,"readable",{get:()=>f.pipeThrough(u).pipeThrough(a).pipeThrough(w)})}}class tn extends d{constructor(t){const o=[];let s=0,c=0;function i(){const n=new r(t);let e=0;for(;e<t;){const s=o[0],r=t-e;s.length<=r?(n.set(s,e),e+=s.length,o.shift()):(n.set(s.subarray(0,r),e),o[0]=s.subarray(r),e+=r)}return s-=t,n}(!e.isFinite(t)||t<1)&&(t=65536),super({transform(n,e){for(o.push(n),s+=n.length;s>t;)c+=t,e.enqueue(i())},flush(t){s&&(c+=s,t.enqueue(function(t,n){const e=new r(n);let o=0;for(const n of t)e.set(n,o),o+=n.length;return e}(o,s)))}}),n.defineProperty(this,"outputSize",{get:()=>c})}}let nn=2;try{typeof navigator!=k&&navigator.hardwareConcurrency&&(nn=navigator.hardwareConcurrency)}catch{}function en(t){return Boolean(t)&&"object"==typeof t}const on=new f,sn=new f,rn=function(){try{return structuredClone(new s)instanceof s}catch{return!1}}();let cn=0;async function an(t){let n,r,c;try{const{options:i,config:a}=t;if(i.format)try{await async function(t,n){!Et.has(t)&&n&&function(t,n){const{CompressionStream:e,DecompressionStream:o}=n;if(typeof e!=z&&typeof o!=z)throw new s("Invalid codec module");Et.set(t,{CompressionStream:e,DecompressionStream:o})}(t,await(import(n)))}(i.format,i.codecURI)}catch(t){if(en(t))try{t.codecImportFailed=!0}catch{}throw t}if(a.CompressionStream=self.CompressionStream,a.DecompressionStream=self.DecompressionStream,i.compressed&&!i.format)if(i.useCompressionStream){if(!function(t,n){if(!t)return!1;let e=Ht.get(t);e||(e=new f,Ht.set(t,e));let o=e.get(n);if(o===v){try{new t(n),o=!0}catch{o=!1}e.set(n,o)}return o}(i.codecType.startsWith($t)?a.CompressionStream:a.DecompressionStream,Vt))try{await self.initModule(t.config)}catch{}}else try{await self.initModule(t.config)}catch{i.useCompressionStream=!0}if(i.encrypted&&!i.zipCrypto)try{await self.initModule(t.config)}catch{}!a.CompressionStreamFallback&&a.CompressionStreamZlib&&(a.CompressionStreamFallback=a.CompressionStreamZlib),!a.DecompressionStreamFallback&&a.DecompressionStreamZlib&&(a.DecompressionStreamFallback=a.DecompressionStreamZlib);const u={highWaterMark:1},l=t.readable?Ft(t.readable):new y({async pull(t){const n=new w(t=>on.set(cn,t));fn({type:"pull",messageId:cn}),cn=(cn+1)%e.MAX_SAFE_INTEGER;const{value:o,done:s}=await n;t.enqueue(o),s&&t.close()}},u);c=t.writable?function(t){if(t instanceof m)return t;const n=t.getWriter();return new m({write:t=>n.write(t),close:()=>n.close(),abort:t=>n.abort(t)})}(t.writable):new m({async write(t){let n;const o=new w(t=>n=t);sn.set(cn,n),fn({type:Zt,value:t,messageId:cn}),cn=(cn+1)%e.MAX_SAFE_INTEGER,await o}},u),n=new _t(i,a),r=new tn(function(t){return s="string"==typeof(n=s=t.chunkSize)&&n.trim()?e(n):n,e.isInteger(s)&&s>=1?o.max(s,64):65536;var n,s}(a)),await l.pipeThrough(n).pipeThrough(r).pipeTo(c,{preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{crc32:h,inputSize:p,outputSize:d}=n;fn({type:"close",result:{crc32:h,inputSize:p,outputSize:d}})}catch(t){const n=r?r.outputSize:0;if(en(t))try{t.outputSize=n}catch{}if(c&&!c.locked)try{await c.getWriter().close()}catch{}un(t,n)}}function fn(t){const{value:n}=t;if(n)if(n.length)try{t.value=(e=n,e.byteOffset||e.byteLength!=e.buffer.byteLength?new r(e):e).buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t);var e}function un(t,n){const{message:e,stack:o,code:r,name:c,outputSize:i,cause:a,codecImportFailed:f}=function(t=new s("Unknown error")){return en(t)?t:new s(String(t))}(t),u={message:e,stack:o,code:r,name:c,outputSize:i===v?n:i};if(a&&(u.cause={name:a.name,message:a.message}),f&&(u.codecImportFailed=!0),rn)try{return void p({error:u,errorValue:{value:t}})}catch{}p({error:u})}addEventListener("message",({data:t})=>{const{type:n,messageId:e,value:o,done:s}=t;try{if("start"==n&&an(t),n==Zt){const t=on.get(e);on.delete(e),t({value:o||new r,done:s})}if("ack"==n){const t=sn.get(e);sn.delete(e),t()}}catch(t){un(t)}}),p({type:"ready"});const wn="deflate",ln="deflate-raw",hn="deflate64-raw",pn="gzip";let dn,yn,mn,Sn,gn;function vn(t,n,e={}){if(!dn){const t=new s("WASM module not loaded");throw t.cause=gn,t}const c="number"==typeof e.level?e.level:-1,i="number"==typeof e.outBuffer?e.outBuffer:65536,a="number"==typeof e.inBufferSize?e.inBufferSize:65536;return new d({start(){try{let e;if(this.C=yn(i),this.in=yn(a),this.inBufferSize=a,!this.C||!this.in)throw new s("allocation failed");if(t?(this.I=dn.deflate_process,this.A=dn.deflate_last_consumed,this.M=dn.deflate_end,this.P=dn.deflate_new(),e=n===pn?dn.deflate_init_gzip(this.P,c):n===ln?dn.deflate_init_raw(this.P,c):dn.deflate_init(this.P,c)):n===hn?(this.I=dn.inflate9_process,this.A=dn.inflate9_last_consumed,this.M=dn.inflate9_end,this.P=dn.inflate9_new(),e=dn.inflate9_init_raw(this.P)):(this.I=dn.inflate_process,this.A=dn.inflate_last_consumed,this.M=dn.inflate_end,this.P=dn.inflate_new(),e=n===ln?dn.inflate_init_raw(this.P):n===pn?dn.inflate_init_gzip(this.P):dn.inflate_init(this.P)),0!==e)throw new s("init failed:"+e)}catch(t){throw f(this),t}},transform(t,n){try{const e=t,c=new r(Sn.buffer),a=this.I,f=this.A,u=this.C;let w=0;for(;w<e.length;){const t=o.min(e.length-w,32768);if((!this.in||this.inBufferSize<t)&&(this.in&&mn&&(mn(this.in),this.in=0),this.in=yn(t),this.inBufferSize=t,!this.in))throw new s("allocation failed");c.set(e.subarray(w,w+t),this.in);const r=a(this.P,this.in,t,u,i,0),l=r>>24&255,h=128&l?l-256:l;if(h<0)throw new s("process error:"+h);const p=16777215&r;p&&n.enqueue(c.slice(u,u+p));const d=f(this.P);if(0===d&&0===p)break;w+=d}}catch(t){f(this),n.error(t)}},flush(t){try{const n=new r(Sn.buffer),e=this.I,o=this.C;for(;;){const r=e(this.P,0,0,o,i,4),c=r>>24&255,a=128&c?c-256:c;if(a<0)throw new s("process error:"+a);const f=16777215&r;if(f&&t.enqueue(n.slice(o,o+f)),1===c||0===f)break}}catch(n){t.error(n)}finally{const n=f(this);0!==n&&t.error(new s("end error:"+n))}},cancel(){f(this)}});function f(t){let n=0;return t.P&&t.M&&(n=t.M(t.P)),t.P=0,t.in&&mn&&mn(t.in),t.in=0,t.C&&mn&&mn(t.C),t.C=0,n}}class kn{constructor(t=wn,n){return vn(!0,t,n)}}class zn{constructor(t=wn,n){return vn(!1,t,n)}}kn.requiresModule=!0,zn.requiresModule=!0,kn.supportedFormats=[wn,ln,pn],zn.supportedFormats=[wn,ln,pn,hn];const bn=65536;let Cn,In;function An(t){return new r(t.memory.buffer)}let Mn=!1;!function(t={}){const{init:n,D:e}=t,o=t.CompressionStreamFallback||t.CompressionStreamZlib,s=t.DecompressionStreamFallback||t.DecompressionStreamZlib;e&&(ht=e||Q),self.initModule=async t=>{n&&await n(t),o&&(t.CompressionStreamFallback=o),s&&(t.DecompressionStreamFallback=s)}}({CompressionStreamFallback:kn,DecompressionStreamFallback:zn,D:function(t,n){const e=Cn;let o=e?function(t,n,e){In||(In=t.malloc(bn));const o=In?t.aes_hmac_new():0;if(o){const s=An(t);if(s.set(n,In),s.set(e,In+n.length),t.aes_hmac_init(o,In,n.length,In+n.length,e.length))return t.aes_hmac_end(o,0),0}return o}(e,t,n):0;if(!o)return Q(t,n);const s=In;return{process(t,n){for(let r=0;r<t.length;r+=bn){const c=t.subarray(r,r+bn),i=An(e);i.set(c,s),e.aes_hmac_process(o,s,c.length,n?1:0),c.set(i.subarray(s,s+c.length))}},digest:()=>(e.aes_hmac_end(o,s),o=0,An(e).slice(s,s+20)),dispose(){o&&(e.aes_hmac_end(o,0),o=0)}}},init:t=>async function(t,{baseURI:n}){if(!Mn)try{await async function(t,n){let e,o;try{try{o=new URL(t,n)}catch{}const s=await fetch(o);e=await s.arrayBuffer()}catch(n){if(!t.startsWith("data:application/wasm;base64,"))throw n;e=function(t){const n=t.split(",")[1],e=atob(n),o=e.length,s=new r(o);for(let t=0;t<o;++t)s[t]=e.charCodeAt(t);return s.buffer}(t)}const c=await WebAssembly.instantiate(e);var i;(function(t){if(dn=t,({malloc:yn,free:mn,memory:Sn}=dn),"function"!=typeof yn||"function"!=typeof mn||!Sn)throw dn=yn=mn=Sn=null,new s("Invalid WASM module")})(c.instance.exports),typeof(i=c.instance.exports).aes_hmac_new==z&&(Cn=i,In=0)}(t,n),Mn=!0}catch(t){throw function(t){gn=t}(t),t}}(t.wasmURI,t)})});\n';
|
|
37690
|
-
if ("string" == typeof
|
|
37691
|
-
const t5 = new Blob([
|
|
37934
|
+
let r2 = '!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";const{Array:t,Object:n,Number:e,Math:o,Error:r,Uint8Array:c,Uint16Array:s,Uint32Array:a,Int32Array:i,Map:f,DataView:u,Promise:w,TextEncoder:l,crypto:d,postMessage:p,TransformStream:h,ReadableStream:y,WritableStream:m,CompressionStream:S,DecompressionStream:g}=self,v=void 0,b="undefined",k="function",z=new c,C=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let n=t;for(let t=0;t<8;t++)n=1&n?n>>>1^3988292384:n>>>1;C[0][t]=n}for(let t=0;t<256;t++)for(let n=1;n<8;n++){const e=C[n-1][t];C[n][t]=e>>>8^C[0][255&e]}const[I,M,A,E,R,x,P,D]=C;class F{constructor(t){this.o=t||-1}append(t){let n=0|this.o;const e=0|t.length;let o=0;if(e>=8&&t.buffer){const r=new u(t.buffer,t.byteOffset,e),c=e-8;for(;o<=c;o+=8){const t=n^r.getInt32(o,!0),e=r.getInt32(o+4,!0);n=D[255&t]^P[t>>>8&255]^x[t>>>16&255]^R[t>>>24&255]^E[255&e]^A[e>>>8&255]^M[e>>>16&255]^I[e>>>24&255]}}for(;o<e;o++)n=n>>>8^I[255&(n^t[o])];this.o=n}get(){return~this.o}}class U extends h{constructor(){let t;const n=new F;super({transform(t,e){n.append(t),e.enqueue(t)},flush(){const e=new c(4);new u(e.buffer).setUint32(0,n.get()),t.value=e}}),t=this}}function B(t,n){const e=new c(t.length+n.length);return e.set(t),e.set(n,t.length),e}function W(t){return new u(t.buffer,t.byteOffset,t.byteLength)}const O=64,V=20,K=new c([128]),T=new c(1),_=new i([1732584193,4023233417,2562383102,271733878,3285377520]),j=new c(256),H=new i(256),L=new i(256),Z=new i(256),N=new i(256);let q=!1;function G(t,n){!function(){if(!q){let t=1,n=1;do{t=255&(t^t<<1^(128&t?27:0)),n=255&(n^n<<1),n=255&(n^n<<2),n=255&(n^n<<4),128&n&&(n^=9),j[t]=255&(n^(n<<1|n>>7)^(n<<2|n>>6)^(n<<3|n>>5)^(n<<4|n>>4)^99)}while(1!=t);j[0]=99;for(let t=0;t<256;t++){const n=j[t],e=Y(n),o=e<<24|n<<16|n<<8|e^n;H[t]=o,L[t]=o>>>8|o<<24,Z[t]=o>>>16|o<<16,N[t]=o>>>24|o<<8}q=!0}}();const e=new i(60),o=function(t,n){const e=t.length>>2,o=e+6,r=4*(o+1);let c=1;for(let o=0;o<e;o++)n[o]=t[4*o]<<24|t[4*o+1]<<16|t[4*o+2]<<8|t[4*o+3];for(let t=e;t<r;t++){let o=n[t-1];t%e==0?(o=Q(o<<8|o>>>24)^c<<24,c=Y(c)):e>6&&t%e==4&&(o=Q(o)),n[t]=n[t-e]^o}return o}(t,e),r=new i(4),c=J(n);let s=0,a=0,f=0,w=0;return{process(t,n){n&&c.update(t,0,t.length),function(t){const n=new u(t.buffer,t.byteOffset,t.byteLength),e=t.length;let o=0;for(;o+16<=e;o+=16)l(),n.setInt32(o,n.getInt32(o)^r[0]),n.setInt32(o+4,n.getInt32(o+4)^r[1]),n.setInt32(o+8,n.getInt32(o+8)^r[2]),n.setInt32(o+12,n.getInt32(o+12)^r[3]);if(o<e){l();for(let n=0;o<e;o++,n++)t[o]^=r[n>>2]>>>24-8*(3&n)}}(t),n||c.update(t,0,t.length)},digest:()=>c.digest()};function l(){s=s+1|0,s||(a=a+1|0,a||(f=f+1|0,f||(w=w+1|0)));let t=X(s)^e[0],n=X(a)^e[1],c=X(f)^e[2],i=X(w)^e[3],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[4],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[5],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[6],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[7];t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[8],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[9],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[10],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[11],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[12],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[13],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[14],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[15],t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[16],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[17],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[18],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[19],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[20],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[21],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[22],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[23],t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[24],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[25],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[26],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[27],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[28],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[29],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[30],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[31],t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[32],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[33],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[34],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[35],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[36],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[37],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[38],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[39];let h=40;o>10&&(t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[40],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[41],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[42],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[43],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[44],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[45],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[46],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[47],h=48),o>12&&(t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[48],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[49],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[50],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[51],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[52],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[53],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[54],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[55],h=56),r[0]=(j[u>>>24]<<24|j[l>>>16&255]<<16|j[d>>>8&255]<<8|j[255&p])^e[h],r[1]=(j[l>>>24]<<24|j[d>>>16&255]<<16|j[p>>>8&255]<<8|j[255&u])^e[h+1],r[2]=(j[d>>>24]<<24|j[p>>>16&255]<<16|j[u>>>8&255]<<8|j[255&l])^e[h+2],r[3]=(j[p>>>24]<<24|j[u>>>16&255]<<16|j[l>>>8&255]<<8|j[255&d])^e[h+3]}}function J(t){const n=function(){const t=new i(_),n=new i(16),e=new c(O),r=new u(e.buffer),s=new c(8);let a=0,f=0;return{update:w,digest:function(){const n=8*f,e=o.floor(n/4294967296),r=n>>>0;for(w(K,0,1);56!=a;)w(T,0,1);s[0]=e>>>24,s[1]=e>>>16,s[2]=e>>>8,s[3]=e,s[4]=r>>>24,s[5]=r>>>16,s[6]=r>>>8,s[7]=r,w(s,0,8);const i=new c(V),l=new u(i.buffer);for(let n=0;n<t.length;n++)l.setInt32(4*n,t[n]);return t.set(_),a=0,f=0,i}};function w(t,n,o){const c=n+o;if(f+=o,a){for(;n<c&&a<O;)e[a++]=t[n++];a==O&&(l(r,0),a=0)}if(n+O<=c){const e=new u(t.buffer,t.byteOffset,t.byteLength);for(;n+O<=c;n+=O)l(e,n)}for(;n<c;)e[a++]=t[n++]}function l(e,o){for(let t=0;t<16;t++)n[t]=e.getInt32(o+4*t);let r,c=t[0],s=t[1],a=t[2],i=t[3],f=t[4];for(let t=0;t<15;t+=5)f=(c<<5|c>>>27)+((a^i)&s^i)+f+1518500249+n[t]|0,s=s<<30|s>>>2,i=(f<<5|f>>>27)+((s^a)&c^a)+i+1518500249+n[t+1]|0,c=c<<30|c>>>2,a=(i<<5|i>>>27)+((c^s)&f^s)+a+1518500249+n[t+2]|0,f=f<<30|f>>>2,s=(a<<5|a>>>27)+((f^c)&i^c)+s+1518500249+n[t+3]|0,i=i<<30|i>>>2,c=(s<<5|s>>>27)+((i^f)&a^f)+c+1518500249+n[t+4]|0,a=a<<30|a>>>2;f=(c<<5|c>>>27)+((a^i)&s^i)+f+1518500249+n[15]|0,s=s<<30|s>>>2,r=n[13]^n[8]^n[2]^n[0],r=r<<1|r>>>31,n[0]=r,i=(f<<5|f>>>27)+((s^a)&c^a)+i+1518500249+r|0,c=c<<30|c>>>2,r=n[14]^n[9]^n[3]^n[1],r=r<<1|r>>>31,n[1]=r,a=(i<<5|i>>>27)+((c^s)&f^s)+a+1518500249+r|0,f=f<<30|f>>>2,r=n[15]^n[10]^n[4]^n[2],r=r<<1|r>>>31,n[2]=r,s=(a<<5|a>>>27)+((f^c)&i^c)+s+1518500249+r|0,i=i<<30|i>>>2,r=n[0]^n[11]^n[5]^n[3],r=r<<1|r>>>31,n[3]=r,c=(s<<5|s>>>27)+((i^f)&a^f)+c+1518500249+r|0,a=a<<30|a>>>2;for(let t=20;t<40;t+=5)r=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],r=r<<1|r>>>31,n[15&t]=r,f=(c<<5|c>>>27)+(s^a^i)+f+1859775393+r|0,s=s<<30|s>>>2,r=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],r=r<<1|r>>>31,n[t+1&15]=r,i=(f<<5|f>>>27)+(c^s^a)+i+1859775393+r|0,c=c<<30|c>>>2,r=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],r=r<<1|r>>>31,n[t+2&15]=r,a=(i<<5|i>>>27)+(f^c^s)+a+1859775393+r|0,f=f<<30|f>>>2,r=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],r=r<<1|r>>>31,n[t+3&15]=r,s=(a<<5|a>>>27)+(i^f^c)+s+1859775393+r|0,i=i<<30|i>>>2,r=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],r=r<<1|r>>>31,n[t+4&15]=r,c=(s<<5|s>>>27)+(a^i^f)+c+1859775393+r|0,a=a<<30|a>>>2;for(let t=40;t<60;t+=5)r=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],r=r<<1|r>>>31,n[15&t]=r,f=(c<<5|c>>>27)+(s&a|(s|a)&i)+f+2400959708+r|0,s=s<<30|s>>>2,r=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],r=r<<1|r>>>31,n[t+1&15]=r,i=(f<<5|f>>>27)+(c&s|(c|s)&a)+i+2400959708+r|0,c=c<<30|c>>>2,r=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],r=r<<1|r>>>31,n[t+2&15]=r,a=(i<<5|i>>>27)+(f&c|(f|c)&s)+a+2400959708+r|0,f=f<<30|f>>>2,r=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],r=r<<1|r>>>31,n[t+3&15]=r,s=(a<<5|a>>>27)+(i&f|(i|f)&c)+s+2400959708+r|0,i=i<<30|i>>>2,r=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],r=r<<1|r>>>31,n[t+4&15]=r,c=(s<<5|s>>>27)+(a&i|(a|i)&f)+c+2400959708+r|0,a=a<<30|a>>>2;for(let t=60;t<80;t+=5)r=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],r=r<<1|r>>>31,n[15&t]=r,f=(c<<5|c>>>27)+(s^a^i)+f+3395469782+r|0,s=s<<30|s>>>2,r=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],r=r<<1|r>>>31,n[t+1&15]=r,i=(f<<5|f>>>27)+(c^s^a)+i+3395469782+r|0,c=c<<30|c>>>2,r=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],r=r<<1|r>>>31,n[t+2&15]=r,a=(i<<5|i>>>27)+(f^c^s)+a+3395469782+r|0,f=f<<30|f>>>2,r=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],r=r<<1|r>>>31,n[t+3&15]=r,s=(a<<5|a>>>27)+(i^f^c)+s+3395469782+r|0,i=i<<30|i>>>2,r=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],r=r<<1|r>>>31,n[t+4&15]=r,c=(s<<5|s>>>27)+(a^i^f)+c+3395469782+r|0,a=a<<30|a>>>2;t[0]=t[0]+c|0,t[1]=t[1]+s|0,t[2]=t[2]+a|0,t[3]=t[3]+i|0,t[4]=t[4]+f|0}}(),e=new c(O),r=new c(O);t.length>O&&(n.update(t,0,t.length),t=n.digest());for(let n=0;n<O;n++){const o=n<t.length?t[n]:0;e[n]=54^o,r[n]=92^o}return n.update(e,0,O),{update(t,e,o){n.update(t,e,o)},digest(){const t=n.digest();n.update(r,0,O),n.update(t,0,V);const o=n.digest();return n.update(e,0,O),o}}}function Q(t){return j[t>>>24]<<24|j[t>>>16&255]<<16|j[t>>>8&255]<<8|j[255&t]}function X(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function Y(t){return 255&(t<<1^27*(t>>7))}const $=typeof d!=b&&typeof d.getRandomValues==k,tt="Invalid password",nt="zipjs-abort-check-password";function et(t){if($)return d.getRandomValues(t);throw new r("Crypto API not supported")}const ot={name:"PBKDF2"},rt=n.assign({hash:{name:"HMAC"}},ot),ct=n.assign({iterations:1e3,hash:{name:"SHA-1"}},ot),st=["deriveBits"],at=[8,12,16],it=[16,24,32],ft=10,ut=typeof d!=b,wt=ut&&d.subtle;let lt=ut&&typeof wt!=b&&typeof wt.importKey==k&&typeof wt.deriveBits==k,dt=G;class pt extends h{constructor({password:t,rawPassword:n,encryptionStrength:e,checkPasswordOnly:o,checkAuthenticationCode:s=!0}){const a={};super({start(){yt(a,t,n,e)},async transform(t,n){const{password:e,strength:s,l:i,ready:f}=a;if(e?(await async function(t,n,e,o){const c=await vt(t,n,e,kt(o,0,at[n])),s=kt(o,at[n]);if(c[0]!=s[0]||c[1]!=s[1])throw gt(t),new r(tt)}(a,s,e,kt(t,0,at[s]+2)),t=kt(t,at[s]+2),o?(gt(a),n.error(new r(nt))):i()):await f,a.h)return;const u=new c(t.length-ft-(t.length-ft)%16);n.enqueue(St(a,t,u,0,ft,!0))},async flush(t){const{m:n,S:e,ready:o}=a;if(n){if(await o,a.h)return;const i=kt(e,e.length-ft),f=new c(kt(e,0,e.length-ft));n.process(f,!0);const u=n.digest();let w=e.length<ft?1:0;for(let t=0;t<ft;t++)w|=u[t]^i[t];if(w&&s)return void t.error(new r("Invalid authentication code"));t.enqueue(f)}}}),mt(this,a)}}class ht extends h{constructor({password:t,rawPassword:n,encryptionStrength:e}){const o={};super({start(){yt(o,t,n,e)},async transform(t,n){const{password:e,strength:r,l:s,ready:a}=o;let i=z;if(e?(i=await async function(t,n,e){const o=et(new c(at[n]));return B(o,await vt(t,n,e,o))}(o,r,e),s()):await a,o.h)return;const f=new c(i.length+t.length-t.length%16);f.set(i,0),n.enqueue(St(o,t,f,i.length,0,!1))},async flush(t){const{m:n,S:e,ready:r}=o;if(n){if(await r,o.h)return;const s=new c(e);n.process(s,!1);const a=kt(n.digest(),0,ft);t.enqueue(B(s,a))}}}),mt(this,o)}}function yt(t,e,o,r){n.assign(t,{ready:new w(n=>t.l=n),password:bt(e,o),strength:r-1,S:z,h:!1})}function mt(t,e){const o=t.readable.getReader(),r=new y({async pull(t){try{const{value:n,done:e}=await o.read();e?t.close():t.enqueue(n)}catch(t){throw gt(e),o.cancel(t).catch(()=>{}),t}},cancel:t=>(gt(e),o.cancel(t))});n.defineProperty(t,"readable",{get:()=>r})}function St(t,n,e,o,r,s){const{m:a,S:i}=t;i.length&&(n=B(i,n));const f=n.length-r,u=f-f%16;if(e=function(t,n){if(n&&n>t.length){const e=t;(t=new c(n)).set(e,0)}return t}(e,o+u),u){const t=kt(e,o,o+u);t.set(kt(n,0,u)),a.process(t,s)}return t.S=kt(n,u),e}function gt(t){const{m:n}=t;t.h=!0,n&&n.dispose&&n.dispose()}async function vt(t,e,r,s){t.password=null;const a=it[e],i=await async function(t,e,r){if(lt)try{const o=await wt.importKey("raw",t,rt,!1,st);return new c(await wt.deriveBits(n.assign({salt:e},ct),o,8*r))}catch{lt=!1}return function(t,n,e,r){const s=J(t),a=new c(r),i=new c(n.length+4),f=new u(i.buffer);i.set(n);for(let t=1,e=0;e<r;t++,e+=V){f.setUint32(n.length,t),s.update(i,0,i.length);let c=s.digest();const u=c.slice();for(let t=1;t<1e3;t++){s.update(c,0,V),c=s.digest();for(let t=0;t<V;t++)u[t]^=c[t]}a.set(u.subarray(0,o.min(V,r-e)),e)}return a}(t,e,0,r)}(r,s,2*a+2);return t.m=dt(kt(i,0,a),kt(i,a,2*a)),t.h&>(t),kt(i,2*a)}function bt(t,n){return n===v?function(t){if(typeof l==b){t=unescape(encodeURIComponent(t));const n=new c(t.length);for(let e=0;e<n.length;e++)n[e]=t.charCodeAt(e);return n}return(new l).encode(t)}(t):n}function kt(t,n,e){return t.subarray(n,e)}class zt extends h{constructor({password:t,rawPassword:n,passwordVerification:e,checkPasswordOnly:o}){super({start(){It(this,t,n,e)},transform(t,n){const e=this;if(e.password||e.rawPassword){const n=Mt(e,t.subarray(0,12));if(e.password=e.rawPassword=null,0!=(n[11]^e.passwordVerification))throw new r(tt);t=t.subarray(12)}o?n.error(new r(nt)):n.enqueue(Mt(e,t))}})}}class Ct extends h{constructor({password:t,rawPassword:n,passwordVerification:e}){super({start(){It(this,t,n,e)},transform(t,n){const e=this;let o,r;if(e.password||e.rawPassword){e.password=e.rawPassword=null;const n=et(new c(12));n[11]=e.passwordVerification,o=new c(t.length+n.length),o.set(At(e,n),0),r=12}else o=new c(t.length),r=0;o.set(At(e,t),r),n.enqueue(o)}})}}function It(t,e,o,r){n.assign(t,{password:e,rawPassword:o,passwordVerification:r}),function(t,e,o){const r=[305419896,591751049,878082192];if(n.assign(t,{v:r,C:new F(r[0]),I:new F(r[2])}),o)for(let n=0;n<o.length;n++)Et(t,o[n]);else for(let n=0;n<e.length;n++)Et(t,e.charCodeAt(n))}(t,e,o)}function Mt(t,n){const e=new c(n.length);for(let o=0;o<n.length;o++)e[o]=Rt(t)^n[o],Et(t,e[o]);return e}function At(t,n){const e=new c(n.length);for(let o=0;o<n.length;o++)e[o]=Rt(t)^n[o],Et(t,n[o]);return e}function Et(t,n){let[,e]=t.v;t.C.append([n]);const r=~t.C.get();e=Pt(o.imul(Pt(e+xt(r)),134775813)+1),t.I.append([e>>>24]);const c=~t.I.get();t.v=[r,e,c]}function Rt(t){const n=2|t.v[2];return xt(o.imul(n,1^n)>>>8)}function xt(t){return 255&t}function Pt(t){return 4294967295&t}function Dt(t){return Boolean(t)&&"object"==typeof t}const Ft=new f;function Ut(t){return Ft.get(t)}const Bt="Invalid uncompressed size",Wt="Codec out of memory",Ot="Invalid CRC32",Vt="deflate-raw",Kt="gzip",Tt=[31,139,8];class _t extends h{constructor(t,{chunkSize:n,CompressionStreamFallback:e,CompressionStream:o}){super({});const{compressed:r,encrypted:c,useCompressionStream:s,zipCrypto:a,computeCrc32:i,level:f,deflate64:w,format:l,compressionMethod:d,inputSize:p}=t,h=this;let y,m,S,g=super.readable;const v=l&&Ut(l),b=qt(s,o,e),k=i&&r&&!w&&!v&&(!c||a)&&Boolean(b);if(c&&!a||!i||k||(y=new U,g=Jt(g,y)),r)if(v)g=Qt(g,Nt(v.CompressionStream,l,{level:f,chunkSize:n,compressionMethod:d,uncompressedSize:p}));else if(k)S=new jt,g=Qt(g,new b(Kt,{level:f,chunkSize:n})),g=Jt(g,S);else try{g=Gt(g,s,{level:f,chunkSize:n},o,e)}catch(t){if(!s&&e)throw nn(t);let n;try{n=new o(Kt)}catch{throw nn(t)}g=Qt(g,n),g=Jt(g,new jt)}c&&(a?g=Jt(g,new Ct(t)):(m=new ht(t),g=Jt(g,m))),Zt(h,g,()=>{c&&!a||!i||(h.crc32=k?S.crc32:new u(y.value.buffer).getUint32(0))})}}class jt extends h{constructor(){let t,n=10,e=new c(0);super({transform(t,r){if(n){const e=o.min(n,t.length);if(n-=e,!(t=t.subarray(e)).length)return}const c=e.length+t.length;if(c<=8)return void(e=B(e,t));const s=c-8,a=o.min(s,e.length);r.enqueue(B(e.subarray(0,a),t.subarray(0,s-a))),e=B(e.subarray(a),t.subarray(s-a))},flush(){const n=W(e);t.crc32=n.getUint32(0,!0),t.uncompressedSize=n.getUint32(4,!0)}}),t=this}}class Ht extends h{constructor(t,{chunkSize:n,DecompressionStreamFallback:e,DecompressionStream:o}){super({});const{zipCrypto:s,encrypted:a,checkCrc32:i,crc32:f,compressed:l,useCompressionStream:d,deflate64:p,format:h,compressionMethod:m,rawBitFlag:S,outputSize:g}=t;let b,k,z,C=super.readable;if(a&&(s?C=Jt(C,new zt(t)):(k=new pt(t),C=Jt(C,k))),l){const t=new Set,s=h&&Ut(h);let a;if(s)C=Qt(C,Nt(s.DecompressionStream,h,{chunkSize:n,compressionMethod:m,rawBitFlag:S,uncompressedSize:g}),t);else{const r=qt(d,o,e);if(i&&!p&&f!==v&&g!==v&&r)try{a=new r(Kt,{chunkSize:n})}catch{a=v}if(!a)try{C=Gt(C,d,{chunkSize:n,deflate64:p},o,e,t)}catch(t){if(p||g===v||!d&&e)throw nn(t);try{a=new o(Kt)}catch{throw nn(t)}}}a?(z=!0,C=function(t,n,e,o,s){const a=n.writable.getWriter(),i=n.readable.getReader(),f=o===v?new F:v;let u,l,d=0,p=!1,h=!1;const m=new y({start(t){l=t},pull(){b()},cancel:t=>(h=!0,b(),i.cancel(t))});return async function(){const n=t.getReader();try{const t=new c(10);for(t.set(Tt),await a.write(t);;){await g(),await a.ready;const{value:t,done:e}=await $t(n,s);if(e)break;await a.write(t)}f&&await a.write(new c(0));const r=new c(8),i=W(r);i.setUint32(0,f?f.get():o,!0),i.setUint32(4,e,!0),p=!0,await a.write(r),await a.close()}catch(t){await Xt(a,t),await Yt(n,t)}}(),async function(){try{for(;;){const{value:t,done:n}=await S();if(n)break;if(d+=t.length,d>e)throw new r(Bt);f&&f.append(t),l.enqueue(t)}h||(h=!0,l.close())}catch(t){!function(t){h||(h=!0,l.error(t),b())}(t),await Yt(i,t)}}(),m;function S(){return i.read().catch(t=>{if(p){if(!f)throw on(t,Ot);if(d!=e)throw on(t,Bt);return{done:!0}}throw tn(t,s)})}function g(){if(!h&&l.desiredSize<=0)return new w(t=>u=t)}function b(){if(u){const t=u;u=v,t()}}}(C,a,g,f,t)):C=function(t,n){const e=t.getReader();return new y({async pull(t){try{const{value:n,done:o}=await e.read();o?t.close():t.enqueue(n)}catch(t){throw await Yt(e,t),tn(t,n)}},cancel:t=>e.cancel(t)})}(C,t)}i&&!z&&(b=new U,C=Jt(C,b)),Zt(this,C,()=>{if(b){const t=new u(b.value.buffer).getUint32(0,!1);if(f!=t)throw new r(Ot)}})}}const Lt=new f;function Zt(t,e,o){e=Jt(e,new h({flush:o})),n.defineProperty(t,"readable",{get:()=>e})}function Nt(t,n,e){if(!t)throw new r("Compression method not supported");return new t(n,e)}function qt(t,n,e){return t&&n?n:e&&e.requiresModule?e:void 0}function Gt(t,n,e,o,r,c){const s=n&&o?o:r||o,a=e.deflate64?"deflate64-raw":Vt;let i;try{i=new s(a,e)}catch(t){if(!n||!r||s==r)throw t;i=new r(a,e)}return Qt(t,i,c)}function Jt(t,n){return function(t){if(t instanceof y)return t;const n=t.getReader();return new y({async pull(t){try{const{value:e,done:o}=await n.read();o?t.close():t.enqueue(e)}catch(t){throw n.cancel(t).catch(()=>{}),t}},cancel:t=>n.cancel(t)})}(t).pipeThrough(n)}function Qt(t,n,e){const o=n.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await o.ready;const t=await $t(r,e);if(t.done){await o.close();break}await o.write(t.value)}}catch(t){await Xt(o,t),await Yt(r,t)}}(),n.readable}async function Xt(t,n){try{await t.abort(n)}catch{}}async function Yt(t,n){try{await t.cancel(n)}catch{}}function $t(t,n){const e=t.read();return n?e.catch(t=>{throw n.add(t),t}):e}function tn(t,n){return n.has(t)?t:on(t,en(t)?Wt:"Invalid compressed data")}function nn(t){return en(t)?on(t,Wt):t}function en(t){return Dt(t)&&"Z_MEM_ERROR"==t.code}function on(t,n){const e=new r(n);return e.cause=t,e}const rn="data",cn="deflate";class sn extends h{constructor(t,e){super({});const o=this,{codecType:c}=t;let s;c.startsWith(cn)?s=_t:c.startsWith("inflate")&&(s=Ht),o.outputSize=0;let a=0;const i=new s(t,e),f=super.readable,u=new h({transform(t,n){t&&t.length&&(a+=t.length,n.enqueue(t))},flush(){n.assign(o,{inputSize:a})}}),w=new h({transform(n,e){if(n&&n.length&&(e.enqueue(n),o.outputSize+=n.length,t.outputSize!==v&&o.outputSize>t.outputSize))throw new r(Bt)},flush(){const{crc32:t}=i;n.assign(o,{crc32:t,inputSize:a})}});n.defineProperty(o,"readable",{get:()=>f.pipeThrough(u).pipeThrough(i).pipeThrough(w)})}}class an extends h{constructor(t){const o=[];let r=0,s=0;function a(){const n=new c(t);let e=0;for(;e<t;){const r=o[0],c=t-e;r.length<=c?(n.set(r,e),e+=r.length,o.shift()):(n.set(r.subarray(0,c),e),o[0]=r.subarray(c),e+=c)}return r-=t,n}(!e.isFinite(t)||t<1)&&(t=262144),super({transform(n,e){for(o.push(n),r+=n.length;r>t;)s+=t,e.enqueue(a())},flush(t){r&&(s+=r,t.enqueue(function(t,n){const e=new c(n);let o=0;for(const n of t)e.set(n,o),o+=n.length;return e}(o,r)))}}),n.defineProperty(this,"outputSize",{get:()=>s})}}let fn=2;try{typeof navigator!=b&&navigator.hardwareConcurrency&&(fn=navigator.hardwareConcurrency)}catch{}const un=new f,wn=new f,ln=function(){try{return structuredClone(new r)instanceof r}catch{return!1}}();let dn=0;async function pn(t){let n,c,s;try{const{options:a,config:i}=t;if(a.format)try{await async function(t,n){!Ft.has(t)&&n&&function(t,n){const{CompressionStream:e,DecompressionStream:o}=n;if(typeof e!=k&&typeof o!=k)throw new r("Invalid codec module");Ft.set(t,{CompressionStream:e,DecompressionStream:o})}(t,await(import(n)))}(a.format,a.codecURI)}catch(t){if(Dt(t))try{t.codecImportFailed=!0}catch{}throw t}if(i.CompressionStream=self.CompressionStream,i.DecompressionStream=self.DecompressionStream,a.compressed&&!a.format)if(a.useCompressionStream){if(!function(t,n){if(!t)return!1;let e=Lt.get(t);e||(e=new f,Lt.set(t,e));let o=e.get(n);if(o===v){try{new t(n),o=!0}catch{o=!1}e.set(n,o)}return o}(a.codecType.startsWith(cn)?i.CompressionStream:i.DecompressionStream,Vt))try{await self.initModule(t.config)}catch{}}else try{await self.initModule(t.config)}catch{a.useCompressionStream=!0}if(a.encrypted&&!a.zipCrypto)try{await self.initModule(t.config)}catch{}!i.CompressionStreamFallback&&i.CompressionStreamZlib&&(i.CompressionStreamFallback=i.CompressionStreamZlib),!i.DecompressionStreamFallback&&i.DecompressionStreamZlib&&(i.DecompressionStreamFallback=i.DecompressionStreamZlib);const u={highWaterMark:1},l=new y({async pull(t){const n=new w(t=>un.set(dn,t));hn({type:"pull",messageId:dn}),dn=(dn+1)%e.MAX_SAFE_INTEGER;const{value:o,done:r}=await n;t.enqueue(o),r&&t.close()}},u);s=new m({async write(t){let n;const o=new w(t=>n=t);wn.set(dn,n),hn({type:rn,value:t,messageId:dn}),dn=(dn+1)%e.MAX_SAFE_INTEGER,await o}},u),n=new sn(a,i),c=new an(function(t){return r="string"==typeof(n=r=t.chunkSize)&&n.trim()?e(n):n,e.isInteger(r)&&r>=1?o.max(r,64):262144;var n,r}(i)),await l.pipeThrough(n).pipeThrough(c).pipeTo(s,{preventClose:!0,preventAbort:!0}),await s.getWriter().close();const{crc32:d,inputSize:p,outputSize:h}=n;hn({type:"close",result:{crc32:d,inputSize:p,outputSize:h}})}catch(t){const n=c?c.outputSize:0;if(Dt(t))try{t.outputSize=n}catch{}if(s&&!s.locked)try{await s.getWriter().close()}catch{}yn(t,n)}}function hn(t){const{value:n}=t;if(n)if(n.length)try{t.value=(e=n,e.byteOffset||e.byteLength!=e.buffer.byteLength?new c(e):e).buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t);var e}function yn(t,n){const{message:e,stack:o,code:c,name:s,outputSize:a,cause:i,codecImportFailed:f}=function(t=new r("Unknown error")){return Dt(t)?t:new r(String(t))}(t),u={message:e,stack:o,code:c,name:s,outputSize:a===v?n:a};if(Dt(i)&&(u.cause={name:i.name,message:i.message,code:i.code}),f&&(u.codecImportFailed=!0),ln)try{return void p({error:u,errorValue:{value:t}})}catch{}p({error:u})}addEventListener("message",({data:t})=>{const{type:n,messageId:e,value:o,done:r}=t;try{if("start"==n&&pn(t),n==rn){const t=un.get(e);un.delete(e),t({value:o||new c,done:r})}if("ack"==n){const t=wn.get(e);wn.delete(e),t()}}catch(t){yn(t)}}),p({type:"ready"});const mn="deflate",Sn="deflate-raw",gn="deflate64-raw",vn="gzip",bn=[mn,Sn,vn],kn=[mn,Sn,vn,gn];let zn,Cn,In,Mn,An;function En(t,n){return-4===n&&(t.code="Z_MEM_ERROR"),t}function Rn(t,n,e={}){if(!(t?bn:kn).includes(n))throw new TypeError("Unsupported format: "+n);if(!zn){const t=new r("WASM module not loaded");throw t.cause=An,t}const s="number"==typeof e.level?e.level:-1,a="number"==typeof e.outBuffer?e.outBuffer:65536,i="number"==typeof e.inBufferSize?e.inBufferSize:65536,f={M:0,in:0,inBufferSize:0,A:0,R:!1};let u,l,d,p,h=!0,S=!1;return function(){try{let e;if(f.M=Cn(a),f.in=Cn(i),f.inBufferSize=i,!f.M||!f.in)throw En(new r("allocation failed"),-4);if(t?(f.P=zn.deflate_process,f.D=zn.deflate_last_consumed,f.F=zn.deflate_end,f.A=zn.deflate_new(),e=n===vn?zn.deflate_init_gzip(f.A,s):n===Sn?zn.deflate_init_raw(f.A,s):zn.deflate_init(f.A,s)):n===gn?(f.P=zn.inflate9_process,f.D=zn.inflate9_last_consumed,f.F=zn.inflate9_end,f.A=zn.inflate9_new(),e=zn.inflate9_init_raw(f.A)):(f.P=zn.inflate_process,f.D=zn.inflate_last_consumed,f.F=zn.inflate_end,f.A=zn.inflate_new(),e=n===Sn?zn.inflate_init_raw(f.A):n===vn?zn.inflate_init_gzip(f.A):zn.inflate_init(f.A)),0!==e)throw En(new r("init failed:"+e),e)}catch(t){throw b(f),t}}(),{readable:new y({start(t){u=t},pull(){h=!1,v()},cancel(t){S=!0,p=t,b(f),l.error(t),v()}},{highWaterMark:0}),writable:new m({start(t){l=t},async write(t){if(h&&await new w(t=>d=t),S)throw p;try{!function(t){const n=new c(Mn.buffer),e=f.P,s=f.D,i=f.M;let u=0;for(;u<t.length;){if(f.R)throw new r("trailing data after the end of the stream");const c=o.min(t.length-u,32768);if((!f.in||f.inBufferSize<c)&&(f.in&&In&&(In(f.in),f.in=0),f.in=Cn(c),f.inBufferSize=c,!f.in))throw En(new r("allocation failed"),-4);n.set(t.subarray(u,u+c),f.in);const w=e(f.A,f.in,c,i,a,0),l=w>>24&255,d=128&l?l-256:l;if(d<0)throw En(new r("process error:"+d),d);const p=16777215&w;p&&g(n.slice(i,i+p));const h=s(f.A);if(1===l)f.R=!0;else if(0===h&&0===p)break;u+=h}}(t)}catch(t){throw b(f),u.error(t),t}},close(){if(S)return;try{!function(){const t=new c(Mn.buffer),n=f.P,e=f.M;for(;;){const o=n(f.A,0,0,e,a,4),c=o>>24&255,s=128&c?c-256:c;if(s<0)throw En(new r("process error:"+s),s);const i=16777215&o;if(i&&g(t.slice(e,e+i)),1===c||0===i)break}}()}catch(t){throw b(f),u.error(t),t}const t=b(f);if(0!==t){const n=En(new r("end error:"+t),t);throw u.error(n),n}u.close()},abort(t){b(f),u.error(t)}},{highWaterMark:1})};function g(t){h=!0,u.enqueue(t)}function v(){if(d){const t=d;d=null,t()}}function b(t){let n=0;return t.A&&t.F&&(n=t.F(t.A)),t.A=0,t.in&&In&&In(t.in),t.in=0,t.M&&In&&In(t.M),t.M=0,n}}class xn{constructor(t=mn,n){return Rn(!0,t,n)}}class Pn{constructor(t=mn,n){return Rn(!1,t,n)}}xn.requiresModule=!0,Pn.requiresModule=!0,xn.supportedFormats=bn,Pn.supportedFormats=kn;const Dn=65536;let Fn,Un;function Bn(t){return new c(t.memory.buffer)}let Wn=!1;!function(t={}){const{init:n,U:e}=t,o=t.CompressionStreamFallback||t.CompressionStreamZlib,r=t.DecompressionStreamFallback||t.DecompressionStreamZlib;e&&(dt=e||G),self.initModule=async t=>{n&&await n(t),o&&(t.CompressionStreamFallback=o),r&&(t.DecompressionStreamFallback=r)}}({CompressionStreamFallback:xn,DecompressionStreamFallback:Pn,U:function(t,n){const e=Fn;let o=e?function(t,n,e){Un||(Un=t.malloc(Dn));const o=Un?t.aes_hmac_new():0;if(o){const r=Bn(t);if(r.set(n,Un),r.set(e,Un+n.length),t.aes_hmac_init(o,Un,n.length,Un+n.length,e.length))return t.aes_hmac_end(o,0),0}return o}(e,t,n):0;if(!o)return G(t,n);const r=Un;return{process(t,n){for(let c=0;c<t.length;c+=Dn){const s=t.subarray(c,c+Dn),a=Bn(e);a.set(s,r),e.aes_hmac_process(o,r,s.length,n?1:0),s.set(a.subarray(r,r+s.length))}},digest:()=>(e.aes_hmac_end(o,r),o=0,Bn(e).slice(r,r+20)),dispose(){o&&(e.aes_hmac_end(o,0),o=0)}}},init:t=>async function(t,{baseURI:n}){if(!Wn)try{await async function(t,n){let e,o;try{try{o=new URL(t,n)}catch{}const r=await fetch(o);e=await r.arrayBuffer()}catch(n){if(!t.startsWith("data:application/wasm;base64,"))throw n;e=function(t){const n=t.split(",")[1],e=atob(n),o=e.length,r=new c(o);for(let t=0;t<o;++t)r[t]=e.charCodeAt(t);return r.buffer}(t)}const s=await WebAssembly.instantiate(e);var a;(function(t){if(zn=t,({malloc:Cn,free:In,memory:Mn}=zn),"function"!=typeof Cn||"function"!=typeof In||!Mn)throw zn=Cn=In=Mn=null,new r("Invalid WASM module")})(s.instance.exports),typeof(a=s.instance.exports).aes_hmac_new==k&&(Fn=a,Un=0)}(t,n),Wn=!0}catch(t){throw function(t){An=t}(t),t}}(t.wasmURI,t)})});\n';
|
|
37935
|
+
if ("string" == typeof r2 && (r2 = new TextEncoder().encode(r2)), t4) {
|
|
37936
|
+
const t5 = new Blob([r2], { type: e3 });
|
|
37692
37937
|
return URL.createObjectURL(t5);
|
|
37693
37938
|
}
|
|
37694
37939
|
return "data:" + e3 + ";base64," + function(t5) {
|
|
37695
37940
|
let e4 = "";
|
|
37696
|
-
const
|
|
37697
|
-
let
|
|
37698
|
-
for (;
|
|
37699
|
-
const
|
|
37700
|
-
e4 += n[
|
|
37701
|
-
}
|
|
37702
|
-
const
|
|
37703
|
-
if (1 ===
|
|
37704
|
-
const
|
|
37705
|
-
e4 += n[
|
|
37706
|
-
} else if (2 ===
|
|
37707
|
-
const
|
|
37708
|
-
e4 += n[
|
|
37941
|
+
const r3 = t5.length;
|
|
37942
|
+
let o2 = 0;
|
|
37943
|
+
for (; o2 + 2 < r3; o2 += 3) {
|
|
37944
|
+
const r4 = t5[o2] << 16 | t5[o2 + 1] << 8 | t5[o2 + 2];
|
|
37945
|
+
e4 += n[r4 >> 18 & 63] + n[r4 >> 12 & 63] + n[r4 >> 6 & 63] + n[63 & r4];
|
|
37946
|
+
}
|
|
37947
|
+
const s4 = r3 - o2;
|
|
37948
|
+
if (1 === s4) {
|
|
37949
|
+
const r4 = t5[o2] << 16;
|
|
37950
|
+
e4 += n[r4 >> 18 & 63] + n[r4 >> 12 & 63] + "==";
|
|
37951
|
+
} else if (2 === s4) {
|
|
37952
|
+
const r4 = t5[o2] << 16 | t5[o2 + 1] << 8;
|
|
37953
|
+
e4 += n[r4 >> 18 & 63] + n[r4 >> 12 & 63] + n[r4 >> 6 & 63] + "=";
|
|
37709
37954
|
}
|
|
37710
37955
|
return e4;
|
|
37711
|
-
}(
|
|
37956
|
+
}(r2);
|
|
37712
37957
|
} });
|
|
37713
37958
|
|
|
37714
37959
|
// ../../node_modules/@zip.js/zip.js/lib/zip-core-base.js
|
|
@@ -37723,14 +37968,10 @@ init_codec_worker();
|
|
|
37723
37968
|
var MODULE_WORKER_OPTIONS = { type: "module" };
|
|
37724
37969
|
var ERROR_EVENT_TYPE = "error";
|
|
37725
37970
|
var MESSAGE_ERROR_EVENT_TYPE = "messageerror";
|
|
37971
|
+
var ABORT_EVENT_TYPE = "abort";
|
|
37726
37972
|
var webWorkerSource;
|
|
37727
37973
|
var webWorkerURI;
|
|
37728
37974
|
var webWorkerOptions;
|
|
37729
|
-
var transferStreamsSupported = true;
|
|
37730
|
-
try {
|
|
37731
|
-
transferStreamsSupported = typeof structuredClone == FUNCTION_TYPE && structuredClone(new DOMException("", "AbortError")).code !== UNDEFINED_VALUE;
|
|
37732
|
-
} catch {
|
|
37733
|
-
}
|
|
37734
37975
|
setWebWorkerBackend(createWebWorkerInterface);
|
|
37735
37976
|
function createWebWorkerInterface(workerData, config3) {
|
|
37736
37977
|
const { baseURI, chunkSize, workerStartupTimeout } = config3;
|
|
@@ -37811,14 +38052,11 @@ async function runWebWorker(workerData, config3) {
|
|
|
37811
38052
|
});
|
|
37812
38053
|
const { readable, options } = workerData;
|
|
37813
38054
|
const { writable, closed, abortPipe } = watchClosedStream(workerData.writable, workerData);
|
|
37814
|
-
let streamsTransferred;
|
|
37815
38055
|
try {
|
|
37816
|
-
|
|
38056
|
+
sendMessage({
|
|
37817
38057
|
type: MESSAGE_START,
|
|
37818
38058
|
options,
|
|
37819
|
-
config: config3
|
|
37820
|
-
readable,
|
|
37821
|
-
writable
|
|
38059
|
+
config: config3
|
|
37822
38060
|
}, workerData);
|
|
37823
38061
|
} catch (error2) {
|
|
37824
38062
|
abortPipe();
|
|
@@ -37829,12 +38067,10 @@ async function runWebWorker(workerData, config3) {
|
|
|
37829
38067
|
workerData.onTaskFinished();
|
|
37830
38068
|
throw error2;
|
|
37831
38069
|
}
|
|
37832
|
-
|
|
37833
|
-
|
|
37834
|
-
|
|
37835
|
-
|
|
37836
|
-
});
|
|
37837
|
-
}
|
|
38070
|
+
Object.assign(workerData, {
|
|
38071
|
+
reader: readable.getReader(),
|
|
38072
|
+
writer: writable.getWriter()
|
|
38073
|
+
});
|
|
37838
38074
|
const { workerStartupTimeout } = config3;
|
|
37839
38075
|
if (!workerData.workerAlive && Number.isFinite(workerStartupTimeout) && workerStartupTimeout >= 0) {
|
|
37840
38076
|
workerData.startupTimeout = setTimeout(() => onStartupTimeout(workerData), workerStartupTimeout);
|
|
@@ -37864,7 +38100,7 @@ async function runWebWorker(workerData, config3) {
|
|
|
37864
38100
|
throw reportedError;
|
|
37865
38101
|
}
|
|
37866
38102
|
async function closeWritable() {
|
|
37867
|
-
if (!
|
|
38103
|
+
if (!writable.locked) {
|
|
37868
38104
|
try {
|
|
37869
38105
|
await writable.getWriter().close();
|
|
37870
38106
|
} catch {
|
|
@@ -37887,6 +38123,13 @@ function watchClosedStream(writableSource, workerData) {
|
|
|
37887
38123
|
Object.assign(workerData, { destinationFailed: true, destinationError: error2 });
|
|
37888
38124
|
}
|
|
37889
38125
|
});
|
|
38126
|
+
const { signal } = workerData.workerOptions.streamOptions;
|
|
38127
|
+
if (signal) {
|
|
38128
|
+
const onAbort = () => abortController.abort(signal.reason);
|
|
38129
|
+
const removeAbortListener = () => signal.removeEventListener(ABORT_EVENT_TYPE, onAbort);
|
|
38130
|
+
signal.addEventListener(ABORT_EVENT_TYPE, onAbort);
|
|
38131
|
+
closed.then(removeAbortListener, removeAbortListener);
|
|
38132
|
+
}
|
|
37890
38133
|
return {
|
|
37891
38134
|
writable,
|
|
37892
38135
|
closed,
|
|
@@ -38037,31 +38280,14 @@ function onWorkerError(event, workerData) {
|
|
|
38037
38280
|
}
|
|
38038
38281
|
}
|
|
38039
38282
|
}
|
|
38040
|
-
function sendMessage(message, { worker, writer
|
|
38283
|
+
function sendMessage(message, { worker, writer }) {
|
|
38041
38284
|
try {
|
|
38042
|
-
const { value
|
|
38043
|
-
const transferables = [];
|
|
38285
|
+
const { value } = message;
|
|
38044
38286
|
if (value) {
|
|
38045
38287
|
message.value = toExactUint8Array(value);
|
|
38046
|
-
transferables.push(message.value.buffer);
|
|
38047
|
-
}
|
|
38048
|
-
if (transferStreams && transferStreamsSupported && workerAlive) {
|
|
38049
|
-
if (readable) {
|
|
38050
|
-
transferables.push(readable);
|
|
38051
|
-
}
|
|
38052
|
-
if (writable) {
|
|
38053
|
-
transferables.push(writable);
|
|
38054
|
-
}
|
|
38055
|
-
} else {
|
|
38056
|
-
message.readable = message.writable = null;
|
|
38057
|
-
}
|
|
38058
|
-
if (transferables.length) {
|
|
38059
38288
|
try {
|
|
38060
|
-
worker.postMessage(message,
|
|
38061
|
-
return true;
|
|
38289
|
+
worker.postMessage(message, [message.value.buffer]);
|
|
38062
38290
|
} catch {
|
|
38063
|
-
transferStreamsSupported = false;
|
|
38064
|
-
message.readable = message.writable = null;
|
|
38065
38291
|
worker.postMessage(message);
|
|
38066
38292
|
}
|
|
38067
38293
|
} else {
|
|
@@ -38135,9 +38361,6 @@ function getResponseError(errorData, errorValue) {
|
|
|
38135
38361
|
responseError = errorValue.value;
|
|
38136
38362
|
} else {
|
|
38137
38363
|
responseError = Object.assign(new Error(message), { stack, code, name });
|
|
38138
|
-
if (cause) {
|
|
38139
|
-
responseError.cause = Object.assign(new Error(cause.message), { name: cause.name });
|
|
38140
|
-
}
|
|
38141
38364
|
}
|
|
38142
38365
|
if (isErrorObject(responseError)) {
|
|
38143
38366
|
try {
|
|
@@ -38147,6 +38370,14 @@ function getResponseError(errorData, errorValue) {
|
|
|
38147
38370
|
if (codecImportFailed) {
|
|
38148
38371
|
responseError.codecImportFailed = true;
|
|
38149
38372
|
}
|
|
38373
|
+
if (cause) {
|
|
38374
|
+
if (!isErrorObject(responseError.cause)) {
|
|
38375
|
+
responseError.cause = Object.assign(new Error(cause.message), { name: cause.name });
|
|
38376
|
+
}
|
|
38377
|
+
if (cause.code !== UNDEFINED_VALUE && responseError.cause.code !== cause.code) {
|
|
38378
|
+
responseError.cause.code = cause.code;
|
|
38379
|
+
}
|
|
38380
|
+
}
|
|
38150
38381
|
if (errorValue) {
|
|
38151
38382
|
if (responseError.name !== name) {
|
|
38152
38383
|
responseError.name = name;
|
|
@@ -38259,128 +38490,8 @@ var ZipWriter = class {
|
|
|
38259
38490
|
prependZip(reader) {
|
|
38260
38491
|
return watchPromiseError(this, prependZipEntries(this, reader));
|
|
38261
38492
|
}
|
|
38262
|
-
appendZip(reader) {
|
|
38263
|
-
return watchPromiseError(this,
|
|
38264
|
-
}
|
|
38265
|
-
async appendZipEntries(reader) {
|
|
38266
|
-
const zipWriter = this;
|
|
38267
|
-
const { pendingAddFileCalls, filenames, fileEntries } = zipWriter;
|
|
38268
|
-
while (pendingAddFileCalls.size) {
|
|
38269
|
-
await Promise.allSettled(Array.from(pendingAddFileCalls));
|
|
38270
|
-
}
|
|
38271
|
-
let resolveAppendZip;
|
|
38272
|
-
const promiseAppendZip = new Promise((resolve2) => resolveAppendZip = resolve2);
|
|
38273
|
-
pendingAddFileCalls.add(promiseAppendZip);
|
|
38274
|
-
const appendedFilenames = [];
|
|
38275
|
-
let releaseLockWriter;
|
|
38276
|
-
try {
|
|
38277
|
-
reader = new GenericReader(reader);
|
|
38278
|
-
await initStream(reader);
|
|
38279
|
-
if (reader.size === UNDEFINED_VALUE || !reader.readUint8Array) {
|
|
38280
|
-
reader = new BlobReader(await streamToBlob(reader.readable));
|
|
38281
|
-
await initStream(reader);
|
|
38282
|
-
}
|
|
38283
|
-
const { ZipReader: ZipReader2 } = await Promise.resolve().then(() => (init_zip_reader(), zip_reader_exports));
|
|
38284
|
-
const zipReader = new ZipReader2(reader);
|
|
38285
|
-
const entries = await zipReader.getEntries();
|
|
38286
|
-
await zipReader.close();
|
|
38287
|
-
await initStream(zipWriter.writer);
|
|
38288
|
-
const { directoryOffset } = zipReader;
|
|
38289
|
-
entries.forEach(({ filename }) => {
|
|
38290
|
-
if (filenames.has(filename)) {
|
|
38291
|
-
throw new Error(ERR_DUPLICATED_NAME);
|
|
38292
|
-
}
|
|
38293
|
-
filenames.add(filename);
|
|
38294
|
-
appendedFilenames.push(filename);
|
|
38295
|
-
});
|
|
38296
|
-
zipWriter.writerLocked = true;
|
|
38297
|
-
const { lockWriter } = zipWriter;
|
|
38298
|
-
zipWriter.lockWriter = new Promise((resolve2) => releaseLockWriter = () => {
|
|
38299
|
-
zipWriter.writerLocked = false;
|
|
38300
|
-
resolve2();
|
|
38301
|
-
});
|
|
38302
|
-
await lockWriter;
|
|
38303
|
-
if (zipWriter.addSplitZipSignature) {
|
|
38304
|
-
delete zipWriter.addSplitZipSignature;
|
|
38305
|
-
if (!await startsWithSplitZipSignature2(reader)) {
|
|
38306
|
-
await writeData(zipWriter.writer, getSplitZipSignatureArray());
|
|
38307
|
-
zipWriter.offset += SPLIT_ZIP_FILE_SIGNATURE_LENGTH;
|
|
38308
|
-
}
|
|
38309
|
-
}
|
|
38310
|
-
const entryPositions = await copyZipData(zipWriter, reader, entries, directoryOffset);
|
|
38311
|
-
entries.forEach((entry) => {
|
|
38312
|
-
const {
|
|
38313
|
-
version: version3,
|
|
38314
|
-
rawLastModDate,
|
|
38315
|
-
rawFilename,
|
|
38316
|
-
bitFlag,
|
|
38317
|
-
encrypted,
|
|
38318
|
-
uncompressedSize,
|
|
38319
|
-
compressedSize,
|
|
38320
|
-
extraFieldZip64
|
|
38321
|
-
} = entry;
|
|
38322
|
-
let {
|
|
38323
|
-
compressionMethod,
|
|
38324
|
-
rawExtraField
|
|
38325
|
-
} = entry;
|
|
38326
|
-
const { level, languageEncodingFlag, dataDescriptor } = bitFlag;
|
|
38327
|
-
rawExtraField = removeExtraFieldZip64(rawExtraField || EMPTY_UINT8_ARRAY);
|
|
38328
|
-
if (entry.extraFieldAES) {
|
|
38329
|
-
compressionMethod = COMPRESSION_METHOD_AES;
|
|
38330
|
-
}
|
|
38331
|
-
const extraFieldLength = getLength(rawExtraField);
|
|
38332
|
-
const zip64UncompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.uncompressedSize !== UNDEFINED_VALUE;
|
|
38333
|
-
const zip64CompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.compressedSize !== UNDEFINED_VALUE;
|
|
38334
|
-
const bitFlagValue = getBitFlag(level, languageEncodingFlag, dataDescriptor, encrypted, compressionMethod) & ~BITFLAG_LEVEL | level << 1;
|
|
38335
|
-
const {
|
|
38336
|
-
headerArray,
|
|
38337
|
-
headerView
|
|
38338
|
-
} = getHeaderArrayData({
|
|
38339
|
-
version: version3,
|
|
38340
|
-
bitFlag: bitFlagValue,
|
|
38341
|
-
compressionMethod,
|
|
38342
|
-
uncompressedSize,
|
|
38343
|
-
compressedSize,
|
|
38344
|
-
rawLastModDate,
|
|
38345
|
-
rawFilename,
|
|
38346
|
-
zip64CompressedSize,
|
|
38347
|
-
zip64UncompressedSize,
|
|
38348
|
-
extraFieldLength
|
|
38349
|
-
});
|
|
38350
|
-
const { crc32 } = entry;
|
|
38351
|
-
if (crc32 !== UNDEFINED_VALUE) {
|
|
38352
|
-
setUint32(headerView, HEADER_OFFSET_SIGNATURE, crc32);
|
|
38353
|
-
}
|
|
38354
|
-
const { offset, diskNumberStart } = entryPositions.get(entry);
|
|
38355
|
-
Object.assign(entry, {
|
|
38356
|
-
zip64Enabled: true,
|
|
38357
|
-
zip64UncompressedSize,
|
|
38358
|
-
zip64CompressedSize,
|
|
38359
|
-
offset,
|
|
38360
|
-
diskNumberStart,
|
|
38361
|
-
zip64DiskNumberStart: false,
|
|
38362
|
-
rawExtraFieldZip64: EMPTY_UINT8_ARRAY,
|
|
38363
|
-
rawExtraFieldAES: EMPTY_UINT8_ARRAY,
|
|
38364
|
-
rawExtraFieldExtendedTimestamp: EMPTY_UINT8_ARRAY,
|
|
38365
|
-
rawExtraFieldNTFS: EMPTY_UINT8_ARRAY,
|
|
38366
|
-
rawExtraFieldUnix: EMPTY_UINT8_ARRAY,
|
|
38367
|
-
rawExtraField,
|
|
38368
|
-
rawCentralExtraField: EMPTY_UINT8_ARRAY,
|
|
38369
|
-
headerArray,
|
|
38370
|
-
headerView
|
|
38371
|
-
});
|
|
38372
|
-
fileEntries.set(entry.filename, entry);
|
|
38373
|
-
});
|
|
38374
|
-
} catch (error2) {
|
|
38375
|
-
appendedFilenames.forEach((filename) => filenames.delete(filename));
|
|
38376
|
-
throw error2;
|
|
38377
|
-
} finally {
|
|
38378
|
-
resolveAppendZip();
|
|
38379
|
-
pendingAddFileCalls.delete(promiseAppendZip);
|
|
38380
|
-
if (releaseLockWriter) {
|
|
38381
|
-
releaseLockWriter();
|
|
38382
|
-
}
|
|
38383
|
-
}
|
|
38493
|
+
appendZip(reader, options = {}) {
|
|
38494
|
+
return watchPromiseError(this, appendZipEntries(this, reader, options));
|
|
38384
38495
|
}
|
|
38385
38496
|
add(name = "", reader, options = {}) {
|
|
38386
38497
|
const zipWriter = this;
|
|
@@ -38470,11 +38581,147 @@ function watchPromiseError(zipWriter, promise) {
|
|
|
38470
38581
|
zipWriter.pendingErrors.push(watcher);
|
|
38471
38582
|
return watchedPromise;
|
|
38472
38583
|
}
|
|
38584
|
+
async function appendZipEntries(zipWriter, reader, options = {}) {
|
|
38585
|
+
const { pendingAddFileCalls, filenames, fileEntries } = zipWriter;
|
|
38586
|
+
const filter = checkFunctionOption(options.filter);
|
|
38587
|
+
const readerOptions = checkReaderOptionsObject(options.readerOptions);
|
|
38588
|
+
while (pendingAddFileCalls.size) {
|
|
38589
|
+
await Promise.allSettled(Array.from(pendingAddFileCalls));
|
|
38590
|
+
}
|
|
38591
|
+
let resolveAppendZip;
|
|
38592
|
+
const promiseAppendZip = new Promise((resolve2) => resolveAppendZip = resolve2);
|
|
38593
|
+
pendingAddFileCalls.add(promiseAppendZip);
|
|
38594
|
+
const appendedFilenames = [];
|
|
38595
|
+
let releaseLockWriter;
|
|
38596
|
+
try {
|
|
38597
|
+
reader = new GenericReader(reader);
|
|
38598
|
+
await initStream(reader);
|
|
38599
|
+
if (reader.size === UNDEFINED_VALUE || !reader.readUint8Array) {
|
|
38600
|
+
reader = new BlobReader(await streamToBlob(reader.readable));
|
|
38601
|
+
await initStream(reader);
|
|
38602
|
+
}
|
|
38603
|
+
const { ZipReader: ZipReader2, getEntryDataDescriptorLength: getEntryDataDescriptorLength2 } = await Promise.resolve().then(() => (init_zip_reader(), zip_reader_exports));
|
|
38604
|
+
const zipReader = new ZipReader2(reader, readerOptions);
|
|
38605
|
+
const keptEntries = [];
|
|
38606
|
+
let entries;
|
|
38607
|
+
try {
|
|
38608
|
+
entries = await zipReader.getEntries();
|
|
38609
|
+
for (const entry of entries) {
|
|
38610
|
+
if (!filter || await filter(entry, getExistingEntry(fileEntries, entry.filename))) {
|
|
38611
|
+
keptEntries.push(entry);
|
|
38612
|
+
}
|
|
38613
|
+
}
|
|
38614
|
+
} finally {
|
|
38615
|
+
await zipReader.close();
|
|
38616
|
+
}
|
|
38617
|
+
await initStream(zipWriter.writer);
|
|
38618
|
+
const { directoryOffset, entriesMissingZip64ExtraField } = zipReader;
|
|
38619
|
+
keptEntries.forEach((entry) => {
|
|
38620
|
+
const { filename } = entry;
|
|
38621
|
+
if (entriesMissingZip64ExtraField.has(entry)) {
|
|
38622
|
+
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
38623
|
+
}
|
|
38624
|
+
if (filenames.has(filename)) {
|
|
38625
|
+
throw new Error(ERR_DUPLICATED_NAME);
|
|
38626
|
+
}
|
|
38627
|
+
filenames.add(filename);
|
|
38628
|
+
appendedFilenames.push(filename);
|
|
38629
|
+
});
|
|
38630
|
+
zipWriter.writerLocked = true;
|
|
38631
|
+
const { lockWriter } = zipWriter;
|
|
38632
|
+
zipWriter.lockWriter = new Promise((resolve2) => releaseLockWriter = () => {
|
|
38633
|
+
zipWriter.writerLocked = false;
|
|
38634
|
+
resolve2();
|
|
38635
|
+
});
|
|
38636
|
+
await lockWriter;
|
|
38637
|
+
if (zipWriter.addSplitZipSignature) {
|
|
38638
|
+
delete zipWriter.addSplitZipSignature;
|
|
38639
|
+
if (filter || !await startsWithSplitZipSignature2(reader)) {
|
|
38640
|
+
await writeData(zipWriter.writer, getSplitZipSignatureArray());
|
|
38641
|
+
zipWriter.offset += SPLIT_ZIP_FILE_SIGNATURE_LENGTH;
|
|
38642
|
+
}
|
|
38643
|
+
}
|
|
38644
|
+
const entryPositions = await copyZipData(zipWriter, reader, entries, keptEntries, directoryOffset, Boolean(filter), getEntryDataDescriptorLength2);
|
|
38645
|
+
keptEntries.forEach((entry) => {
|
|
38646
|
+
const {
|
|
38647
|
+
version: version3,
|
|
38648
|
+
rawLastModDate,
|
|
38649
|
+
rawFilename,
|
|
38650
|
+
rawBitFlag,
|
|
38651
|
+
uncompressedSize,
|
|
38652
|
+
compressedSize,
|
|
38653
|
+
extraFieldZip64
|
|
38654
|
+
} = entry;
|
|
38655
|
+
let {
|
|
38656
|
+
compressionMethod,
|
|
38657
|
+
rawExtraField
|
|
38658
|
+
} = entry;
|
|
38659
|
+
rawExtraField = removeExtraFieldZip64(rawExtraField || EMPTY_UINT8_ARRAY);
|
|
38660
|
+
if (entry.extraFieldAES) {
|
|
38661
|
+
compressionMethod = COMPRESSION_METHOD_AES;
|
|
38662
|
+
}
|
|
38663
|
+
const extraFieldLength = getLength(rawExtraField);
|
|
38664
|
+
const zip64UncompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.uncompressedSize !== UNDEFINED_VALUE;
|
|
38665
|
+
const zip64CompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.compressedSize !== UNDEFINED_VALUE;
|
|
38666
|
+
const {
|
|
38667
|
+
headerArray,
|
|
38668
|
+
headerView
|
|
38669
|
+
} = getHeaderArrayData({
|
|
38670
|
+
version: version3,
|
|
38671
|
+
bitFlag: rawBitFlag,
|
|
38672
|
+
compressionMethod,
|
|
38673
|
+
uncompressedSize,
|
|
38674
|
+
compressedSize,
|
|
38675
|
+
rawLastModDate,
|
|
38676
|
+
rawFilename,
|
|
38677
|
+
zip64CompressedSize,
|
|
38678
|
+
zip64UncompressedSize,
|
|
38679
|
+
extraFieldLength
|
|
38680
|
+
});
|
|
38681
|
+
const { crc32 } = entry;
|
|
38682
|
+
if (crc32 !== UNDEFINED_VALUE) {
|
|
38683
|
+
setUint32(headerView, HEADER_OFFSET_SIGNATURE, crc32);
|
|
38684
|
+
}
|
|
38685
|
+
const { offset, diskNumberStart } = entryPositions.get(entry);
|
|
38686
|
+
fileEntries.set(entry.filename, Object.assign({}, entry, {
|
|
38687
|
+
zip64Enabled: true,
|
|
38688
|
+
zip64UncompressedSize,
|
|
38689
|
+
zip64CompressedSize,
|
|
38690
|
+
offset,
|
|
38691
|
+
diskNumberStart,
|
|
38692
|
+
zip64DiskNumberStart: false,
|
|
38693
|
+
rawExtraFieldZip64: EMPTY_UINT8_ARRAY,
|
|
38694
|
+
rawExtraFieldAES: EMPTY_UINT8_ARRAY,
|
|
38695
|
+
rawExtraFieldExtendedTimestamp: EMPTY_UINT8_ARRAY,
|
|
38696
|
+
rawExtraFieldNTFS: EMPTY_UINT8_ARRAY,
|
|
38697
|
+
rawExtraFieldUnix: EMPTY_UINT8_ARRAY,
|
|
38698
|
+
rawCentralExtraFieldUnix: EMPTY_UINT8_ARRAY,
|
|
38699
|
+
rawExtraField,
|
|
38700
|
+
rawCentralExtraField: EMPTY_UINT8_ARRAY,
|
|
38701
|
+
headerArray,
|
|
38702
|
+
headerView
|
|
38703
|
+
}));
|
|
38704
|
+
});
|
|
38705
|
+
} catch (error2) {
|
|
38706
|
+
appendedFilenames.forEach((filename) => filenames.delete(filename));
|
|
38707
|
+
throw error2;
|
|
38708
|
+
} finally {
|
|
38709
|
+
resolveAppendZip();
|
|
38710
|
+
pendingAddFileCalls.delete(promiseAppendZip);
|
|
38711
|
+
if (releaseLockWriter) {
|
|
38712
|
+
releaseLockWriter();
|
|
38713
|
+
}
|
|
38714
|
+
}
|
|
38715
|
+
}
|
|
38716
|
+
function getExistingEntry(fileEntries, filename) {
|
|
38717
|
+
const fileEntry = fileEntries.get(filename);
|
|
38718
|
+
return fileEntry ? new Entry(fileEntry) : UNDEFINED_VALUE;
|
|
38719
|
+
}
|
|
38473
38720
|
async function prependZipEntries(zipWriter, reader) {
|
|
38474
38721
|
if (zipWriter.filenames.size) {
|
|
38475
38722
|
throw new Error(ERR_ZIP_NOT_EMPTY);
|
|
38476
38723
|
}
|
|
38477
|
-
await
|
|
38724
|
+
await appendZipEntries(zipWriter, reader);
|
|
38478
38725
|
}
|
|
38479
38726
|
async function addFileEntry(zipWriter, name, reader, options) {
|
|
38480
38727
|
options = Object.assign({}, options);
|
|
@@ -38821,16 +39068,17 @@ function resolveMetadata(zipWriter, name, options) {
|
|
|
38821
39068
|
const passThrough = checkPassThroughOption(getOptionValue2(zipWriter, options, OPTION_PASS_THROUGH));
|
|
38822
39069
|
const passThroughCompression = Boolean(passThrough);
|
|
38823
39070
|
const passThroughEncryption = passThrough === true;
|
|
38824
|
-
|
|
38825
|
-
|
|
39071
|
+
let password = getOptionValue2(zipWriter, options, OPTION_PASSWORD);
|
|
39072
|
+
let rawPassword = getOptionValue2(zipWriter, options, OPTION_RAW_PASSWORD);
|
|
38826
39073
|
checkPasswordOption(password, rawPassword);
|
|
39074
|
+
password = password && password.length ? password : UNDEFINED_VALUE;
|
|
39075
|
+
rawPassword = rawPassword && rawPassword.length ? rawPassword : UNDEFINED_VALUE;
|
|
38827
39076
|
const encryptionStrength = getNumberOptionValue(zipWriter, options, OPTION_ENCRYPTION_STRENGTH, 3);
|
|
38828
39077
|
const zipCrypto = getOptionValue2(zipWriter, options, PROPERTY_NAME_ZIPCRYPTO);
|
|
38829
39078
|
const extendedTimestamp = getOptionValue2(zipWriter, options, OPTION_EXTENDED_TIMESTAMP, true);
|
|
38830
39079
|
const ntfsTimestamp = getOptionValue2(zipWriter, options, OPTION_NTFS_TIMESTAMP);
|
|
38831
39080
|
const keepOrder = getOptionValue2(zipWriter, options, OPTION_KEEP_ORDER, true);
|
|
38832
39081
|
const useWebWorkers = getOptionValue2(zipWriter, options, OPTION_USE_WEB_WORKERS);
|
|
38833
|
-
const transferStreams = getOptionValue2(zipWriter, options, OPTION_TRANSFER_STREAMS);
|
|
38834
39082
|
const bufferedWrite = getOptionValue2(zipWriter, options, OPTION_BUFFERED_WRITE);
|
|
38835
39083
|
const createTempStream = getFunctionOptionValue2(zipWriter, options, OPTION_CREATE_TEMP_STREAM);
|
|
38836
39084
|
const dataDescriptorSignature = getOptionValue2(zipWriter, options, OPTION_DATA_DESCRIPTOR_SIGNATURE, true);
|
|
@@ -38899,7 +39147,6 @@ function resolveMetadata(zipWriter, name, options) {
|
|
|
38899
39147
|
ntfsTimestamp,
|
|
38900
39148
|
keepOrder,
|
|
38901
39149
|
useWebWorkers,
|
|
38902
|
-
transferStreams,
|
|
38903
39150
|
bufferedWrite,
|
|
38904
39151
|
createTempStream,
|
|
38905
39152
|
dataDescriptorSignature,
|
|
@@ -38956,7 +39203,7 @@ async function resolveSizes(zipWriter, reader, { resolvedOptions: metadata }, op
|
|
|
38956
39203
|
if (reader) {
|
|
38957
39204
|
reader = new GenericReader(reader);
|
|
38958
39205
|
await initStream(reader);
|
|
38959
|
-
if (!reader.
|
|
39206
|
+
if (!reader.readUint8Array && !reader.readable) {
|
|
38960
39207
|
throw new Error(ERR_INVALID_READER);
|
|
38961
39208
|
}
|
|
38962
39209
|
({ size: contentSize } = reader);
|
|
@@ -39210,6 +39457,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39210
39457
|
extraFieldExtendedTimestampTime,
|
|
39211
39458
|
rawExtraFieldNTFS,
|
|
39212
39459
|
rawExtraFieldUnix,
|
|
39460
|
+
rawCentralExtraFieldUnix,
|
|
39213
39461
|
rawExtraFieldAES
|
|
39214
39462
|
} = headerInfo;
|
|
39215
39463
|
const { dataDescriptorArray } = dataDescriptorInfo;
|
|
@@ -39234,7 +39482,6 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39234
39482
|
rawExtraField,
|
|
39235
39483
|
rawCentralExtraField,
|
|
39236
39484
|
useWebWorkers,
|
|
39237
|
-
transferStreams,
|
|
39238
39485
|
onstart,
|
|
39239
39486
|
onprogress,
|
|
39240
39487
|
onend,
|
|
@@ -39276,6 +39523,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39276
39523
|
rawExtraFieldExtendedTimestamp,
|
|
39277
39524
|
rawExtraFieldNTFS,
|
|
39278
39525
|
rawExtraFieldUnix,
|
|
39526
|
+
rawCentralExtraFieldUnix,
|
|
39279
39527
|
rawExtraFieldAES,
|
|
39280
39528
|
rawExtraField,
|
|
39281
39529
|
rawCentralExtraField,
|
|
@@ -39322,7 +39570,6 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39322
39570
|
encrypted: encrypted && !passThroughEncryption,
|
|
39323
39571
|
useWebWorkers,
|
|
39324
39572
|
useCompressionStream,
|
|
39325
|
-
transferStreams,
|
|
39326
39573
|
format,
|
|
39327
39574
|
codecURI,
|
|
39328
39575
|
compressionMethod
|
|
@@ -39334,6 +39581,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39334
39581
|
const result = await runWorker2({ readable, writable }, workerOptions);
|
|
39335
39582
|
compressedSize = result.outputSize;
|
|
39336
39583
|
writer.size += compressedSize;
|
|
39584
|
+
throwIfAborted(signal);
|
|
39337
39585
|
if (!passThroughCompression) {
|
|
39338
39586
|
uncompressedSize = result.inputSize;
|
|
39339
39587
|
if (!encrypted || zipCrypto) {
|
|
@@ -39494,6 +39742,7 @@ function getHeaderInfo(options) {
|
|
|
39494
39742
|
rawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = EMPTY_UINT8_ARRAY;
|
|
39495
39743
|
}
|
|
39496
39744
|
let rawExtraFieldUnix;
|
|
39745
|
+
let rawCentralExtraFieldUnix;
|
|
39497
39746
|
try {
|
|
39498
39747
|
const { uid, gid, unixExtraFieldType } = options;
|
|
39499
39748
|
if (unixExtraFieldType == INFOZIP_EXTRA_FIELD_TYPE && (uid !== UNDEFINED_VALUE || gid !== UNDEFINED_VALUE)) {
|
|
@@ -39508,7 +39757,7 @@ function getHeaderInfo(options) {
|
|
|
39508
39757
|
extraFieldUnix.writeBytes(uidBytes);
|
|
39509
39758
|
extraFieldUnix.writeUint8(gidBytes.length);
|
|
39510
39759
|
extraFieldUnix.writeBytes(gidBytes);
|
|
39511
|
-
rawExtraFieldUnix = extraFieldUnix.array;
|
|
39760
|
+
rawExtraFieldUnix = rawCentralExtraFieldUnix = extraFieldUnix.array;
|
|
39512
39761
|
} else if (unixExtraFieldType == UNIX_EXTRA_FIELD_TYPE && (uid !== UNDEFINED_VALUE || gid !== UNDEFINED_VALUE)) {
|
|
39513
39762
|
const extraFieldUnix = createRecordWriter(8);
|
|
39514
39763
|
extraFieldUnix.writeUint16(EXTRAFIELD_TYPE_UNIX);
|
|
@@ -39516,11 +39765,15 @@ function getHeaderInfo(options) {
|
|
|
39516
39765
|
extraFieldUnix.writeUint16((uid === UNDEFINED_VALUE ? 0 : uid) & MAX_16_BITS);
|
|
39517
39766
|
extraFieldUnix.writeUint16((gid === UNDEFINED_VALUE ? 0 : gid) & MAX_16_BITS);
|
|
39518
39767
|
rawExtraFieldUnix = extraFieldUnix.array;
|
|
39768
|
+
const centralExtraFieldUnix = createRecordWriter(4);
|
|
39769
|
+
centralExtraFieldUnix.writeUint16(EXTRAFIELD_TYPE_UNIX);
|
|
39770
|
+
centralExtraFieldUnix.writeUint16(0);
|
|
39771
|
+
rawCentralExtraFieldUnix = centralExtraFieldUnix.array;
|
|
39519
39772
|
} else {
|
|
39520
|
-
rawExtraFieldUnix = EMPTY_UINT8_ARRAY;
|
|
39773
|
+
rawExtraFieldUnix = rawCentralExtraFieldUnix = EMPTY_UINT8_ARRAY;
|
|
39521
39774
|
}
|
|
39522
39775
|
} catch {
|
|
39523
|
-
rawExtraFieldUnix = EMPTY_UINT8_ARRAY;
|
|
39776
|
+
rawExtraFieldUnix = rawCentralExtraFieldUnix = EMPTY_UINT8_ARRAY;
|
|
39524
39777
|
}
|
|
39525
39778
|
if (compressionMethod === UNDEFINED_VALUE) {
|
|
39526
39779
|
compressionMethod = compressed ? COMPRESSION_METHOD_DEFLATE : COMPRESSION_METHOD_STORE;
|
|
@@ -39610,6 +39863,7 @@ function getHeaderInfo(options) {
|
|
|
39610
39863
|
rawExtraFieldExtendedTimestamp,
|
|
39611
39864
|
rawExtraFieldNTFS,
|
|
39612
39865
|
rawExtraFieldUnix,
|
|
39866
|
+
rawCentralExtraFieldUnix,
|
|
39613
39867
|
rawExtraFieldAES,
|
|
39614
39868
|
extraFieldLength
|
|
39615
39869
|
};
|
|
@@ -39776,7 +40030,7 @@ function createDirectoryRecords(files) {
|
|
|
39776
40030
|
rawExtraFieldAES,
|
|
39777
40031
|
rawComment,
|
|
39778
40032
|
rawExtraFieldNTFS,
|
|
39779
|
-
|
|
40033
|
+
rawCentralExtraFieldUnix,
|
|
39780
40034
|
rawExtraField,
|
|
39781
40035
|
rawCentralExtraField,
|
|
39782
40036
|
extraFieldExtendedTimestampFlag,
|
|
@@ -39838,7 +40092,7 @@ function createDirectoryRecords(files) {
|
|
|
39838
40092
|
rawExtraFieldZip64,
|
|
39839
40093
|
rawExtraFieldAES,
|
|
39840
40094
|
rawExtraFieldNTFS,
|
|
39841
|
-
|
|
40095
|
+
rawCentralExtraFieldUnix,
|
|
39842
40096
|
rawExtraFieldTimestamp,
|
|
39843
40097
|
rawExtraField,
|
|
39844
40098
|
rawCentralExtraField
|
|
@@ -39867,7 +40121,7 @@ async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
|
39867
40121
|
rawExtraFieldAES,
|
|
39868
40122
|
rawExtraFieldExtendedTimestamp,
|
|
39869
40123
|
rawExtraFieldNTFS,
|
|
39870
|
-
|
|
40124
|
+
rawCentralExtraFieldUnix,
|
|
39871
40125
|
rawExtraField,
|
|
39872
40126
|
rawCentralExtraField,
|
|
39873
40127
|
rawComment,
|
|
@@ -39884,7 +40138,7 @@ async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
|
39884
40138
|
uncompressedSize,
|
|
39885
40139
|
compressedSize
|
|
39886
40140
|
} = fileEntry;
|
|
39887
|
-
const extraFieldLength = getLength(rawExtraFieldZip64, rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS,
|
|
40141
|
+
const extraFieldLength = getLength(rawExtraFieldZip64, rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS, rawCentralExtraFieldUnix, rawExtraField, rawCentralExtraField);
|
|
39888
40142
|
const directoryRecordLength = CENTRAL_FILE_HEADER_LENGTH + getLength(rawFilename, rawComment) + extraFieldLength;
|
|
39889
40143
|
if (exceedsAvailableSize(writer, offset + directoryRecordLength - directoryDiskOffset)) {
|
|
39890
40144
|
await writeData(writer, directoryArray.slice(directoryDiskOffset, offset));
|
|
@@ -39920,7 +40174,7 @@ async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
|
39920
40174
|
directoryRecord.writeBytes(rawExtraFieldAES);
|
|
39921
40175
|
directoryRecord.writeBytes(rawExtraFieldExtendedTimestamp);
|
|
39922
40176
|
directoryRecord.writeBytes(rawExtraFieldNTFS);
|
|
39923
|
-
directoryRecord.writeBytes(
|
|
40177
|
+
directoryRecord.writeBytes(rawCentralExtraFieldUnix);
|
|
39924
40178
|
directoryRecord.writeBytes(rawExtraField);
|
|
39925
40179
|
directoryRecord.writeBytes(rawCentralExtraField);
|
|
39926
40180
|
directoryRecord.writeBytes(rawComment);
|
|
@@ -40094,25 +40348,62 @@ function removeExtraFieldZip64(rawExtraField) {
|
|
|
40094
40348
|
}
|
|
40095
40349
|
return rawExtraField;
|
|
40096
40350
|
}
|
|
40097
|
-
async function copyZipData(zipWriter, reader, entries, directoryOffset) {
|
|
40351
|
+
async function copyZipData(zipWriter, reader, entries, keptEntries, directoryOffset, compact, getEntryDataDescriptorLength2) {
|
|
40098
40352
|
const { writer } = zipWriter;
|
|
40099
40353
|
const entryPositions = /* @__PURE__ */ new Map();
|
|
40100
|
-
if (writer.closeDisk) {
|
|
40354
|
+
if (writer.closeDisk || compact) {
|
|
40101
40355
|
const sortedEntries = Array.from(entries).sort((firstEntry, secondEntry) => getSourceOffset(reader, firstEntry) - getSourceOffset(reader, secondEntry));
|
|
40102
|
-
|
|
40103
|
-
|
|
40104
|
-
|
|
40105
|
-
|
|
40106
|
-
|
|
40107
|
-
|
|
40108
|
-
|
|
40109
|
-
|
|
40110
|
-
|
|
40111
|
-
|
|
40112
|
-
|
|
40113
|
-
|
|
40356
|
+
const regionEnds = getRegionEnds(reader, sortedEntries, directoryOffset);
|
|
40357
|
+
const keptEntrySet = new Set(keptEntries);
|
|
40358
|
+
const localHeaderLengths = /* @__PURE__ */ new Map();
|
|
40359
|
+
for (let indexEntry = 0; indexEntry < sortedEntries.length; indexEntry++) {
|
|
40360
|
+
const entry = sortedEntries[indexEntry];
|
|
40361
|
+
if (keptEntrySet.has(entry)) {
|
|
40362
|
+
const sourceOffset = getSourceOffset(reader, entry);
|
|
40363
|
+
const localHeaderLength = await getLocalHeaderLength(reader, sourceOffset);
|
|
40364
|
+
if (localHeaderLength === UNDEFINED_VALUE) {
|
|
40365
|
+
throw new Error(ERR_LOCAL_FILE_HEADER_NOT_FOUND);
|
|
40366
|
+
}
|
|
40367
|
+
let entryEnd = sourceOffset + localHeaderLength + entry.compressedSize;
|
|
40368
|
+
if (entry.bitFlag.dataDescriptor) {
|
|
40369
|
+
const dataDescriptorLength = await getEntryDataDescriptorLength2(reader, entryEnd, entry);
|
|
40370
|
+
entryEnd = dataDescriptorLength === UNDEFINED_VALUE ? Math.max(entryEnd, regionEnds[indexEntry]) : entryEnd + dataDescriptorLength;
|
|
40371
|
+
}
|
|
40372
|
+
if (entryEnd > regionEnds[indexEntry]) {
|
|
40373
|
+
throw new Error(ERR_OVERLAPPING_ENTRY);
|
|
40374
|
+
}
|
|
40375
|
+
regionEnds[indexEntry] = entryEnd;
|
|
40376
|
+
localHeaderLengths.set(entry, localHeaderLength);
|
|
40377
|
+
}
|
|
40378
|
+
}
|
|
40379
|
+
let copiedOffset = 0;
|
|
40380
|
+
let lastPosition;
|
|
40381
|
+
for (let indexEntry = 0; indexEntry < sortedEntries.length; indexEntry++) {
|
|
40382
|
+
const entry = sortedEntries[indexEntry];
|
|
40383
|
+
if (keptEntrySet.has(entry)) {
|
|
40384
|
+
const sourceOffset = getSourceOffset(reader, entry);
|
|
40385
|
+
if (sourceOffset < copiedOffset) {
|
|
40386
|
+
entryPositions.set(entry, lastPosition);
|
|
40387
|
+
} else {
|
|
40388
|
+
if (!compact) {
|
|
40389
|
+
await copyData(zipWriter, reader, copiedOffset, sourceOffset - copiedOffset);
|
|
40390
|
+
}
|
|
40391
|
+
if (writer.closeDisk && exceedsAvailableSize(writer, localHeaderLengths.get(entry))) {
|
|
40392
|
+
await writer.closeDisk();
|
|
40393
|
+
}
|
|
40394
|
+
lastPosition = {
|
|
40395
|
+
offset: getSegmentOffset(zipWriter, writer),
|
|
40396
|
+
diskNumberStart: getDiskNumber(writer)
|
|
40397
|
+
};
|
|
40398
|
+
entryPositions.set(entry, lastPosition);
|
|
40399
|
+
await copyData(zipWriter, reader, sourceOffset, regionEnds[indexEntry] - sourceOffset);
|
|
40400
|
+
copiedOffset = regionEnds[indexEntry];
|
|
40401
|
+
}
|
|
40402
|
+
}
|
|
40403
|
+
}
|
|
40404
|
+
if (!compact) {
|
|
40405
|
+
await copyData(zipWriter, reader, copiedOffset, directoryOffset - copiedOffset);
|
|
40114
40406
|
}
|
|
40115
|
-
await copyData(zipWriter, reader, copiedLength, directoryOffset - copiedLength);
|
|
40116
40407
|
} else {
|
|
40117
40408
|
const baseOffset = zipWriter.offset;
|
|
40118
40409
|
await copyData(zipWriter, reader, 0, directoryOffset);
|
|
@@ -40123,6 +40414,19 @@ async function copyZipData(zipWriter, reader, entries, directoryOffset) {
|
|
|
40123
40414
|
}
|
|
40124
40415
|
return entryPositions;
|
|
40125
40416
|
}
|
|
40417
|
+
function getRegionEnds(reader, sortedEntries, directoryOffset) {
|
|
40418
|
+
const regionEnds = new Array(sortedEntries.length);
|
|
40419
|
+
let regionEnd = directoryOffset;
|
|
40420
|
+
for (let indexEntry = sortedEntries.length - 1; indexEntry >= 0; indexEntry--) {
|
|
40421
|
+
const sourceOffset = getSourceOffset(reader, sortedEntries[indexEntry]);
|
|
40422
|
+
const nextEntry = sortedEntries[indexEntry + 1];
|
|
40423
|
+
if (nextEntry && getSourceOffset(reader, nextEntry) > sourceOffset) {
|
|
40424
|
+
regionEnd = Math.min(getSourceOffset(reader, nextEntry), directoryOffset);
|
|
40425
|
+
}
|
|
40426
|
+
regionEnds[indexEntry] = regionEnd;
|
|
40427
|
+
}
|
|
40428
|
+
return regionEnds;
|
|
40429
|
+
}
|
|
40126
40430
|
async function copyData(zipWriter, reader, offset, size) {
|
|
40127
40431
|
if (size > 0) {
|
|
40128
40432
|
const { writer } = zipWriter;
|
|
@@ -40130,10 +40434,12 @@ async function copyData(zipWriter, reader, offset, size) {
|
|
|
40130
40434
|
try {
|
|
40131
40435
|
await flushBufferedData(createReadable(reader, { offset, size }), writer, UNDEFINED_VALUE, (chunkLength) => copiedLength += chunkLength);
|
|
40132
40436
|
} catch (error2) {
|
|
40133
|
-
|
|
40134
|
-
|
|
40135
|
-
|
|
40136
|
-
|
|
40437
|
+
if (copiedLength) {
|
|
40438
|
+
zipWriter.hasCorruptedEntries = true;
|
|
40439
|
+
try {
|
|
40440
|
+
error2.corruptedEntry = true;
|
|
40441
|
+
} catch {
|
|
40442
|
+
}
|
|
40137
40443
|
}
|
|
40138
40444
|
throw error2;
|
|
40139
40445
|
} finally {
|
|
@@ -40143,11 +40449,14 @@ async function copyData(zipWriter, reader, offset, size) {
|
|
|
40143
40449
|
}
|
|
40144
40450
|
}
|
|
40145
40451
|
async function getLocalHeaderLength(reader, offset) {
|
|
40146
|
-
const headerArray = await readUint8Array(reader, offset, HEADER_SIZE);
|
|
40452
|
+
const headerArray = offset >= 0 && offset + HEADER_SIZE <= reader.size ? await readUint8Array(reader, offset, HEADER_SIZE) : EMPTY_UINT8_ARRAY;
|
|
40147
40453
|
if (getLength(headerArray) < HEADER_SIZE) {
|
|
40148
|
-
return
|
|
40454
|
+
return UNDEFINED_VALUE;
|
|
40149
40455
|
}
|
|
40150
40456
|
const headerView = getDataView(headerArray);
|
|
40457
|
+
if (getUint322(headerView, 0) != LOCAL_FILE_HEADER_SIGNATURE) {
|
|
40458
|
+
return UNDEFINED_VALUE;
|
|
40459
|
+
}
|
|
40151
40460
|
return HEADER_SIZE + getUint162(headerView, HEADER_OFFSET_FILENAME_LENGTH + LOCAL_HEADER_COMMON_OFFSET) + getUint162(headerView, HEADER_OFFSET_EXTRAFIELD_LENGTH + LOCAL_HEADER_COMMON_OFFSET);
|
|
40152
40461
|
}
|
|
40153
40462
|
function getSourceOffset(reader, { offset, diskNumberStart }) {
|
|
@@ -40499,6 +40808,10 @@ var FORMAT_DEFLATE = "deflate";
|
|
|
40499
40808
|
var FORMAT_DEFLATE_RAW2 = "deflate-raw";
|
|
40500
40809
|
var FORMAT_DEFLATE64_RAW2 = "deflate64-raw";
|
|
40501
40810
|
var FORMAT_GZIP2 = "gzip";
|
|
40811
|
+
var Z_MEM_ERROR = -4;
|
|
40812
|
+
var Z_MEM_ERROR_CODE2 = "Z_MEM_ERROR";
|
|
40813
|
+
var COMPRESSION_FORMATS = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW2, FORMAT_GZIP2];
|
|
40814
|
+
var DECOMPRESSION_FORMATS = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW2, FORMAT_GZIP2, FORMAT_DEFLATE64_RAW2];
|
|
40502
40815
|
var wasm;
|
|
40503
40816
|
var malloc;
|
|
40504
40817
|
var free;
|
|
@@ -40515,7 +40828,16 @@ function setWasmExports(wasmAPI) {
|
|
|
40515
40828
|
function setInitError(error2) {
|
|
40516
40829
|
initError = error2;
|
|
40517
40830
|
}
|
|
40831
|
+
function setZlibCode(error2, result) {
|
|
40832
|
+
if (result === Z_MEM_ERROR) {
|
|
40833
|
+
error2.code = Z_MEM_ERROR_CODE2;
|
|
40834
|
+
}
|
|
40835
|
+
return error2;
|
|
40836
|
+
}
|
|
40518
40837
|
function _make(isCompress, type, options = {}) {
|
|
40838
|
+
if (!(isCompress ? COMPRESSION_FORMATS : DECOMPRESSION_FORMATS).includes(type)) {
|
|
40839
|
+
throw new TypeError("Unsupported format: " + type);
|
|
40840
|
+
}
|
|
40519
40841
|
if (!wasm) {
|
|
40520
40842
|
const error2 = new Error("WASM module not loaded");
|
|
40521
40843
|
error2.cause = initError;
|
|
@@ -40524,147 +40846,208 @@ function _make(isCompress, type, options = {}) {
|
|
|
40524
40846
|
const level = typeof options.level === "number" ? options.level : -1;
|
|
40525
40847
|
const outBufferSize = typeof options.outBuffer === "number" ? options.outBuffer : 64 * 1024;
|
|
40526
40848
|
const inBufferSize = typeof options.inBufferSize === "number" ? options.inBufferSize : 64 * 1024;
|
|
40527
|
-
|
|
40528
|
-
|
|
40849
|
+
const state = { out: 0, in: 0, inBufferSize: 0, streamHandle: 0, streamEnded: false };
|
|
40850
|
+
let readableController, writableController, resolveWrite, cancelReason;
|
|
40851
|
+
let backpressure = true;
|
|
40852
|
+
let cancelled = false;
|
|
40853
|
+
initStream2();
|
|
40854
|
+
const readable = new ReadableStream({
|
|
40855
|
+
start(controller) {
|
|
40856
|
+
readableController = controller;
|
|
40857
|
+
},
|
|
40858
|
+
pull() {
|
|
40859
|
+
backpressure = false;
|
|
40860
|
+
resumeWrite();
|
|
40861
|
+
},
|
|
40862
|
+
cancel(reason) {
|
|
40863
|
+
cancelled = true;
|
|
40864
|
+
cancelReason = reason;
|
|
40865
|
+
disposeStream(state);
|
|
40866
|
+
writableController.error(reason);
|
|
40867
|
+
resumeWrite();
|
|
40868
|
+
}
|
|
40869
|
+
}, { highWaterMark: 0 });
|
|
40870
|
+
const writable = new WritableStream({
|
|
40871
|
+
start(controller) {
|
|
40872
|
+
writableController = controller;
|
|
40873
|
+
},
|
|
40874
|
+
async write(chunk) {
|
|
40875
|
+
if (backpressure) {
|
|
40876
|
+
await new Promise((resolve2) => resolveWrite = resolve2);
|
|
40877
|
+
}
|
|
40878
|
+
if (cancelled) {
|
|
40879
|
+
throw cancelReason;
|
|
40880
|
+
}
|
|
40529
40881
|
try {
|
|
40530
|
-
|
|
40531
|
-
this.out = malloc(outBufferSize);
|
|
40532
|
-
this.in = malloc(inBufferSize);
|
|
40533
|
-
this.inBufferSize = inBufferSize;
|
|
40534
|
-
if (!this.out || !this.in) {
|
|
40535
|
-
throw new Error("allocation failed");
|
|
40536
|
-
}
|
|
40537
|
-
if (isCompress) {
|
|
40538
|
-
this._process = wasm.deflate_process;
|
|
40539
|
-
this._last_consumed = wasm.deflate_last_consumed;
|
|
40540
|
-
this._end = wasm.deflate_end;
|
|
40541
|
-
this.streamHandle = wasm.deflate_new();
|
|
40542
|
-
if (type === FORMAT_GZIP2) {
|
|
40543
|
-
result = wasm.deflate_init_gzip(this.streamHandle, level);
|
|
40544
|
-
} else if (type === FORMAT_DEFLATE_RAW2) {
|
|
40545
|
-
result = wasm.deflate_init_raw(this.streamHandle, level);
|
|
40546
|
-
} else {
|
|
40547
|
-
result = wasm.deflate_init(this.streamHandle, level);
|
|
40548
|
-
}
|
|
40549
|
-
} else {
|
|
40550
|
-
if (type === FORMAT_DEFLATE64_RAW2) {
|
|
40551
|
-
this._process = wasm.inflate9_process;
|
|
40552
|
-
this._last_consumed = wasm.inflate9_last_consumed;
|
|
40553
|
-
this._end = wasm.inflate9_end;
|
|
40554
|
-
this.streamHandle = wasm.inflate9_new();
|
|
40555
|
-
result = wasm.inflate9_init_raw(this.streamHandle);
|
|
40556
|
-
} else {
|
|
40557
|
-
this._process = wasm.inflate_process;
|
|
40558
|
-
this._last_consumed = wasm.inflate_last_consumed;
|
|
40559
|
-
this._end = wasm.inflate_end;
|
|
40560
|
-
this.streamHandle = wasm.inflate_new();
|
|
40561
|
-
if (type === FORMAT_DEFLATE_RAW2) {
|
|
40562
|
-
result = wasm.inflate_init_raw(this.streamHandle);
|
|
40563
|
-
} else if (type === FORMAT_GZIP2) {
|
|
40564
|
-
result = wasm.inflate_init_gzip(this.streamHandle);
|
|
40565
|
-
} else {
|
|
40566
|
-
result = wasm.inflate_init(this.streamHandle);
|
|
40567
|
-
}
|
|
40568
|
-
}
|
|
40569
|
-
}
|
|
40570
|
-
if (result !== 0) {
|
|
40571
|
-
throw new Error("init failed:" + result);
|
|
40572
|
-
}
|
|
40882
|
+
processChunk(chunk);
|
|
40573
40883
|
} catch (error2) {
|
|
40574
|
-
disposeStream(
|
|
40884
|
+
disposeStream(state);
|
|
40885
|
+
readableController.error(error2);
|
|
40575
40886
|
throw error2;
|
|
40576
40887
|
}
|
|
40577
40888
|
},
|
|
40578
|
-
|
|
40889
|
+
close() {
|
|
40890
|
+
if (cancelled) {
|
|
40891
|
+
return;
|
|
40892
|
+
}
|
|
40579
40893
|
try {
|
|
40580
|
-
|
|
40581
|
-
const heap = new Uint8Array(memory.buffer);
|
|
40582
|
-
const process2 = this._process;
|
|
40583
|
-
const last_consumed = this._last_consumed;
|
|
40584
|
-
const out = this.out;
|
|
40585
|
-
let offset = 0;
|
|
40586
|
-
while (offset < buffer2.length) {
|
|
40587
|
-
const toRead = Math.min(buffer2.length - offset, 32 * 1024);
|
|
40588
|
-
if (!this.in || this.inBufferSize < toRead) {
|
|
40589
|
-
if (this.in && free) {
|
|
40590
|
-
free(this.in);
|
|
40591
|
-
this.in = 0;
|
|
40592
|
-
}
|
|
40593
|
-
this.in = malloc(toRead);
|
|
40594
|
-
this.inBufferSize = toRead;
|
|
40595
|
-
if (!this.in) {
|
|
40596
|
-
throw new Error("allocation failed");
|
|
40597
|
-
}
|
|
40598
|
-
}
|
|
40599
|
-
heap.set(buffer2.subarray(offset, offset + toRead), this.in);
|
|
40600
|
-
const result = process2(this.streamHandle, this.in, toRead, out, outBufferSize, 0);
|
|
40601
|
-
const code = result >> 24 & 255;
|
|
40602
|
-
const signedCode = code & 128 ? code - 256 : code;
|
|
40603
|
-
if (signedCode < 0) {
|
|
40604
|
-
throw new Error("process error:" + signedCode);
|
|
40605
|
-
}
|
|
40606
|
-
const prod = result & 16777215;
|
|
40607
|
-
if (prod) {
|
|
40608
|
-
controller.enqueue(heap.slice(out, out + prod));
|
|
40609
|
-
}
|
|
40610
|
-
const consumed = last_consumed(this.streamHandle);
|
|
40611
|
-
if (consumed === 0 && prod === 0) {
|
|
40612
|
-
break;
|
|
40613
|
-
}
|
|
40614
|
-
offset += consumed;
|
|
40615
|
-
}
|
|
40894
|
+
flushStream();
|
|
40616
40895
|
} catch (error2) {
|
|
40617
|
-
disposeStream(
|
|
40618
|
-
|
|
40896
|
+
disposeStream(state);
|
|
40897
|
+
readableController.error(error2);
|
|
40898
|
+
throw error2;
|
|
40899
|
+
}
|
|
40900
|
+
const result = disposeStream(state);
|
|
40901
|
+
if (result !== 0) {
|
|
40902
|
+
const error2 = setZlibCode(new Error("end error:" + result), result);
|
|
40903
|
+
readableController.error(error2);
|
|
40904
|
+
throw error2;
|
|
40619
40905
|
}
|
|
40906
|
+
readableController.close();
|
|
40620
40907
|
},
|
|
40621
|
-
|
|
40622
|
-
|
|
40623
|
-
|
|
40624
|
-
|
|
40625
|
-
|
|
40626
|
-
|
|
40627
|
-
|
|
40628
|
-
|
|
40629
|
-
|
|
40630
|
-
|
|
40631
|
-
|
|
40632
|
-
|
|
40633
|
-
|
|
40634
|
-
|
|
40635
|
-
|
|
40636
|
-
|
|
40637
|
-
|
|
40638
|
-
|
|
40639
|
-
|
|
40908
|
+
abort(reason) {
|
|
40909
|
+
disposeStream(state);
|
|
40910
|
+
readableController.error(reason);
|
|
40911
|
+
}
|
|
40912
|
+
}, { highWaterMark: 1 });
|
|
40913
|
+
return { readable, writable };
|
|
40914
|
+
function initStream2() {
|
|
40915
|
+
try {
|
|
40916
|
+
let result;
|
|
40917
|
+
state.out = malloc(outBufferSize);
|
|
40918
|
+
state.in = malloc(inBufferSize);
|
|
40919
|
+
state.inBufferSize = inBufferSize;
|
|
40920
|
+
if (!state.out || !state.in) {
|
|
40921
|
+
throw setZlibCode(new Error("allocation failed"), Z_MEM_ERROR);
|
|
40922
|
+
}
|
|
40923
|
+
if (isCompress) {
|
|
40924
|
+
state._process = wasm.deflate_process;
|
|
40925
|
+
state._last_consumed = wasm.deflate_last_consumed;
|
|
40926
|
+
state._end = wasm.deflate_end;
|
|
40927
|
+
state.streamHandle = wasm.deflate_new();
|
|
40928
|
+
if (type === FORMAT_GZIP2) {
|
|
40929
|
+
result = wasm.deflate_init_gzip(state.streamHandle, level);
|
|
40930
|
+
} else if (type === FORMAT_DEFLATE_RAW2) {
|
|
40931
|
+
result = wasm.deflate_init_raw(state.streamHandle, level);
|
|
40932
|
+
} else {
|
|
40933
|
+
result = wasm.deflate_init(state.streamHandle, level);
|
|
40640
40934
|
}
|
|
40641
|
-
}
|
|
40642
|
-
|
|
40643
|
-
|
|
40644
|
-
|
|
40645
|
-
|
|
40646
|
-
|
|
40935
|
+
} else {
|
|
40936
|
+
if (type === FORMAT_DEFLATE64_RAW2) {
|
|
40937
|
+
state._process = wasm.inflate9_process;
|
|
40938
|
+
state._last_consumed = wasm.inflate9_last_consumed;
|
|
40939
|
+
state._end = wasm.inflate9_end;
|
|
40940
|
+
state.streamHandle = wasm.inflate9_new();
|
|
40941
|
+
result = wasm.inflate9_init_raw(state.streamHandle);
|
|
40942
|
+
} else {
|
|
40943
|
+
state._process = wasm.inflate_process;
|
|
40944
|
+
state._last_consumed = wasm.inflate_last_consumed;
|
|
40945
|
+
state._end = wasm.inflate_end;
|
|
40946
|
+
state.streamHandle = wasm.inflate_new();
|
|
40947
|
+
if (type === FORMAT_DEFLATE_RAW2) {
|
|
40948
|
+
result = wasm.inflate_init_raw(state.streamHandle);
|
|
40949
|
+
} else if (type === FORMAT_GZIP2) {
|
|
40950
|
+
result = wasm.inflate_init_gzip(state.streamHandle);
|
|
40951
|
+
} else {
|
|
40952
|
+
result = wasm.inflate_init(state.streamHandle);
|
|
40953
|
+
}
|
|
40647
40954
|
}
|
|
40648
40955
|
}
|
|
40649
|
-
|
|
40650
|
-
|
|
40651
|
-
|
|
40956
|
+
if (result !== 0) {
|
|
40957
|
+
throw setZlibCode(new Error("init failed:" + result), result);
|
|
40958
|
+
}
|
|
40959
|
+
} catch (error2) {
|
|
40960
|
+
disposeStream(state);
|
|
40961
|
+
throw error2;
|
|
40652
40962
|
}
|
|
40653
|
-
}
|
|
40654
|
-
function
|
|
40963
|
+
}
|
|
40964
|
+
function processChunk(chunk) {
|
|
40965
|
+
const heap = new Uint8Array(memory.buffer);
|
|
40966
|
+
const process2 = state._process;
|
|
40967
|
+
const last_consumed = state._last_consumed;
|
|
40968
|
+
const out = state.out;
|
|
40969
|
+
let offset = 0;
|
|
40970
|
+
while (offset < chunk.length) {
|
|
40971
|
+
if (state.streamEnded) {
|
|
40972
|
+
throw new Error("trailing data after the end of the stream");
|
|
40973
|
+
}
|
|
40974
|
+
const toRead = Math.min(chunk.length - offset, 32 * 1024);
|
|
40975
|
+
if (!state.in || state.inBufferSize < toRead) {
|
|
40976
|
+
if (state.in && free) {
|
|
40977
|
+
free(state.in);
|
|
40978
|
+
state.in = 0;
|
|
40979
|
+
}
|
|
40980
|
+
state.in = malloc(toRead);
|
|
40981
|
+
state.inBufferSize = toRead;
|
|
40982
|
+
if (!state.in) {
|
|
40983
|
+
throw setZlibCode(new Error("allocation failed"), Z_MEM_ERROR);
|
|
40984
|
+
}
|
|
40985
|
+
}
|
|
40986
|
+
heap.set(chunk.subarray(offset, offset + toRead), state.in);
|
|
40987
|
+
const result = process2(state.streamHandle, state.in, toRead, out, outBufferSize, 0);
|
|
40988
|
+
const code = result >> 24 & 255;
|
|
40989
|
+
const signedCode = code & 128 ? code - 256 : code;
|
|
40990
|
+
if (signedCode < 0) {
|
|
40991
|
+
throw setZlibCode(new Error("process error:" + signedCode), signedCode);
|
|
40992
|
+
}
|
|
40993
|
+
const prod = result & 16777215;
|
|
40994
|
+
if (prod) {
|
|
40995
|
+
enqueue(heap.slice(out, out + prod));
|
|
40996
|
+
}
|
|
40997
|
+
const consumed = last_consumed(state.streamHandle);
|
|
40998
|
+
if (code === 1) {
|
|
40999
|
+
state.streamEnded = true;
|
|
41000
|
+
} else if (consumed === 0 && prod === 0) {
|
|
41001
|
+
break;
|
|
41002
|
+
}
|
|
41003
|
+
offset += consumed;
|
|
41004
|
+
}
|
|
41005
|
+
}
|
|
41006
|
+
function flushStream() {
|
|
41007
|
+
const heap = new Uint8Array(memory.buffer);
|
|
41008
|
+
const process2 = state._process;
|
|
41009
|
+
const out = state.out;
|
|
41010
|
+
while (true) {
|
|
41011
|
+
const result = process2(state.streamHandle, 0, 0, out, outBufferSize, 4);
|
|
41012
|
+
const code = result >> 24 & 255;
|
|
41013
|
+
const signedCode = code & 128 ? code - 256 : code;
|
|
41014
|
+
if (signedCode < 0) {
|
|
41015
|
+
throw setZlibCode(new Error("process error:" + signedCode), signedCode);
|
|
41016
|
+
}
|
|
41017
|
+
const produced = result & 16777215;
|
|
41018
|
+
if (produced) {
|
|
41019
|
+
enqueue(heap.slice(out, out + produced));
|
|
41020
|
+
}
|
|
41021
|
+
if (code === 1 || produced === 0) {
|
|
41022
|
+
break;
|
|
41023
|
+
}
|
|
41024
|
+
}
|
|
41025
|
+
}
|
|
41026
|
+
function enqueue(chunk) {
|
|
41027
|
+
backpressure = true;
|
|
41028
|
+
readableController.enqueue(chunk);
|
|
41029
|
+
}
|
|
41030
|
+
function resumeWrite() {
|
|
41031
|
+
if (resolveWrite) {
|
|
41032
|
+
const resolve2 = resolveWrite;
|
|
41033
|
+
resolveWrite = null;
|
|
41034
|
+
resolve2();
|
|
41035
|
+
}
|
|
41036
|
+
}
|
|
41037
|
+
function disposeStream(state2) {
|
|
40655
41038
|
let endResult = 0;
|
|
40656
|
-
if (
|
|
40657
|
-
endResult =
|
|
41039
|
+
if (state2.streamHandle && state2._end) {
|
|
41040
|
+
endResult = state2._end(state2.streamHandle);
|
|
40658
41041
|
}
|
|
40659
|
-
|
|
40660
|
-
if (
|
|
40661
|
-
free(
|
|
41042
|
+
state2.streamHandle = 0;
|
|
41043
|
+
if (state2.in && free) {
|
|
41044
|
+
free(state2.in);
|
|
40662
41045
|
}
|
|
40663
|
-
|
|
40664
|
-
if (
|
|
40665
|
-
free(
|
|
41046
|
+
state2.in = 0;
|
|
41047
|
+
if (state2.out && free) {
|
|
41048
|
+
free(state2.out);
|
|
40666
41049
|
}
|
|
40667
|
-
|
|
41050
|
+
state2.out = 0;
|
|
40668
41051
|
return endResult;
|
|
40669
41052
|
}
|
|
40670
41053
|
}
|
|
@@ -40680,8 +41063,8 @@ var DecompressionStreamZlib = class {
|
|
|
40680
41063
|
};
|
|
40681
41064
|
CompressionStreamZlib.requiresModule = true;
|
|
40682
41065
|
DecompressionStreamZlib.requiresModule = true;
|
|
40683
|
-
CompressionStreamZlib.supportedFormats =
|
|
40684
|
-
DecompressionStreamZlib.supportedFormats =
|
|
41066
|
+
CompressionStreamZlib.supportedFormats = COMPRESSION_FORMATS;
|
|
41067
|
+
DecompressionStreamZlib.supportedFormats = DECOMPRESSION_FORMATS;
|
|
40685
41068
|
|
|
40686
41069
|
// ../../node_modules/@zip.js/zip.js/lib/core/streams/zlib-wasm/aes-hmac-sha1-wasm.js
|
|
40687
41070
|
init_constants();
|
|
@@ -40826,6 +41209,7 @@ init_constants();
|
|
|
40826
41209
|
init_array();
|
|
40827
41210
|
init_compatible_streams();
|
|
40828
41211
|
init_error();
|
|
41212
|
+
var EMPTY_RAW_PASSWORD = new Uint8Array(0);
|
|
40829
41213
|
|
|
40830
41214
|
// ../../node_modules/@zip.js/zip.js/lib/zip-fs-wasm.js
|
|
40831
41215
|
e(setDefaultConfiguration);
|