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AAU,cAAE,SAAwB,oBAAoB,EAAQ,GACxE,aAAa,uBAAuB,EAAQ,EAAU,EAAe,EAAY,EACrF,CACA,SAAS,WAAW,GAChB,aAAa,EACjB,CACA,eAAe,SAAS,GACpB,IAAI,EACJ,GAAoB,oBAAT,MAAwB,aAAkB,KACjD,EAAS,IAAI,WAAW,QAEvB,GAAI,aAAkB,aAAgB,GAAU,EAAO,QAAU,EAAO,kBAAkB,YAC3F,EAAS,IAAI,kBAAkB,QAE9B,GAAI,oBAAoB,IAAW,oBAAoB,EAAO,QAC/D,EAAS,IAAI,kBAAkB,QAE9B,GAAsB,iBAAX,EAAqB,CACjC,MAAM,QAAY,MAAM,GACxB,IAAK,EAAI,GACL,MAAM,IAAI,MAAM,uBAAuB,cAAmB,EAAI,WAAW,EAAI,cAEjF,MAAM,QAAa,EAAI,OACvB,EAAS,IAAI,WAAW,EAC5B,KACK,IAAgC,mBAArB,EAAO,WAAmD,mBAAhB,EAAO,KAI7D,MAAM,IAAI,MAAM,2BAHhB,EAAS,CAIb,CACA,MAAM,QAAoB,EAAO,YACjC,GAAI,EAAc,OAAO,iBACrB,MAAM,IAAI,MAAM,yBAAyB,8DAE7C,aAAa,yBAAyB,EAAQ,EAClD,CAEA,eAAe,MAAM,GACjB,MAAM,IAAE,EAAG,QAAE,SAAkB,SAAS,GACxC,MAAO,CACH,MACA,QAAS,OAAO,YAAY,EAAQ,IAAI,GAAK,CAAC,EAAE,KAAM,KAE9D,CACA,SAAS,UACL,WACJ,QAES,kBAAmB,WAAY,gBAAiB,SAAU,QAAS,WAAY,MAAO","file":"/npm/unzipit@2.1.1/dist/unzipit.module.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/unzipit@2.1.1/dist/unzipit.module.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/* unzipit@2.1.1, license MIT */\nvar _a, _b;\nfunction readBlobAsArrayBuffer(blob) {\n    if (blob.arrayBuffer) {\n        return blob.arrayBuffer();\n    }\n    return new Promise((resolve, reject) => {\n        const reader = new FileReader();\n        reader.addEventListener('loadend', () => {\n            resolve(reader.result);\n        });\n        reader.addEventListener('error', reject);\n        reader.readAsArrayBuffer(blob);\n    });\n}\nfunction isBlob(v) {\n    return typeof Blob !== 'undefined' && v instanceof Blob;\n}\nfunction isSharedArrayBuffer(b) {\n    return typeof SharedArrayBuffer !== 'undefined' && b instanceof SharedArrayBuffer;\n}\nconst isNode = (typeof process !== 'undefined') &&\n    !!(process === null || process === void 0 ? void 0 : process.versions) &&\n    (typeof ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== 'undefined') &&\n    (typeof ((_b = process === null || process === void 0 ? void 0 : process.versions) === null || _b === void 0 ? void 0 : _b.electron) === 'undefined');\nfunction isTypedArraySameAsArrayBuffer(typedArray) {\n    return typedArray.byteOffset === 0 && typedArray.byteLength === typedArray.buffer.byteLength;\n}\n\nclass ArrayBufferReader {\n    constructor(arrayBufferOrView) {\n        this.typedArray = (arrayBufferOrView instanceof ArrayBuffer || isSharedArrayBuffer(arrayBufferOrView))\n            ? new Uint8Array(arrayBufferOrView)\n            : new Uint8Array(arrayBufferOrView.buffer, arrayBufferOrView.byteOffset, arrayBufferOrView.byteLength);\n    }\n    async getLength() {\n        return this.typedArray.byteLength;\n    }\n    async read(offset, length) {\n        // Cast is necessary: backing buffer may be SharedArrayBuffer (ArrayBufferLike),\n        // but callers need Uint8Array<ArrayBuffer>. The data is read-only view so this is safe.\n        return new Uint8Array(this.typedArray.buffer, this.typedArray.byteOffset + offset, length);\n    }\n}\n\nclass BlobReader {\n    constructor(blob) {\n        this.blob = blob;\n    }\n    async getLength() {\n        return this.blob.size;\n    }\n    async read(offset, length) {\n        const blob = this.blob.slice(offset, offset + length);\n        const arrayBuffer = await readBlobAsArrayBuffer(blob);\n        return new Uint8Array(arrayBuffer);\n    }\n    async readStream(offset, length) {\n        return this.blob.slice(offset, offset + length).stream();\n    }\n    async sliceAsBlob(offset, length, type = '') {\n        return this.blob.slice(offset, offset + length, type);\n    }\n}\n\nclass HTTPRangeReader {\n    constructor(url) {\n        this.url = url;\n    }\n    async getLength() {\n        if (this.length === undefined) {\n            const req = await fetch(this.url, { method: 'HEAD' });\n            if (!req.ok) {\n                throw new Error(`failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);\n            }\n            this.length = parseInt(req.headers.get('content-length'));\n            if (Number.isNaN(this.length)) {\n                throw Error('could not get length');\n            }\n        }\n        return this.length;\n    }\n    async read(offset, size) {\n        if (size === 0) {\n            return new Uint8Array(0);\n        }\n        const req = await fetch(this.url, {\n            headers: {\n                Range: `bytes=${offset}-${offset + size - 1}`,\n            },\n        });\n        if (!req.ok) {\n            throw new Error(`failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size}: ${req.statusText}`);\n        }\n        const buffer = await req.arrayBuffer();\n        return new Uint8Array(buffer);\n    }\n    async readStream(offset, size) {\n        if (size === 0) {\n            return new Blob([]).stream();\n        }\n        const req = await fetch(this.url, {\n            headers: {\n                Range: `bytes=${offset}-${offset + size - 1}`,\n            },\n        });\n        if (!req.ok) {\n            throw new Error(`failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size}: ${req.statusText}`);\n        }\n        // A server that ignores Range sends the whole file with a 200.\n        // Streaming that would silently produce the wrong bytes.\n        if (req.status !== 206) {\n            throw new Error(`server did not honor range request for ${this.url}, status: ${req.status}`);\n        }\n        return req.body;\n    }\n}\n\n/* global DecompressionStream */\n// Streaming building blocks shared by ZipEntry.stream(), the non-worker\n// blob()/arrayBuffer() paths, and the worker. Everything here is a pipeline\n// of streams so memory use is bounded by a few chunks in flight, not by the\n// size of the entry.\n// How much to ask a Reader for per `read` call when it has no `readStream`.\nconst kReadSize = 1024 * 1024;\n// Largest piece handed to the DecompressionStream in one write. Deflate can\n// expand about 1000:1 and a DecompressionStream may emit all the output for a\n// write before backpressure can stop it, so this bounds the burst from a\n// malicious zip to roughly 64MB.\nconst kMaxInflateInputSize = 64 * 1024;\n// Returns a chunk that owns its own (non-shared) ArrayBuffer. Readers like\n// ArrayBufferReader return views into the user's buffer. We don't want to\n// hand those to a consumer who might transfer/detach them, and\n// DecompressionStream does not accept views on a SharedArrayBuffer.\nfunction ownChunk(chunk) {\n    return isTypedArraySameAsArrayBuffer(chunk) && !isSharedArrayBuffer(chunk.buffer)\n        ? chunk\n        : chunk.slice();\n}\n// A stream of `length` bytes starting at `offset` from a Reader that only\n// supports `read`. Nothing is read until the consumer pulls.\nfunction readerToStream(reader, offset, length) {\n    let pos = 0;\n    return new ReadableStream({\n        async pull(controller) {\n            if (pos >= length) {\n                controller.close();\n                return;\n            }\n            const size = Math.min(kReadSize, length - pos);\n            const data = await reader.read(offset + pos, size);\n            if (data.byteLength !== size) {\n                throw new Error(`short read: expected ${size} bytes at offset ${offset + pos}, got ${data.byteLength}`);\n            }\n            pos += size;\n            controller.enqueue(ownChunk(data));\n        },\n    }, { highWaterMark: 0 });\n}\nasync function readAsStream(reader, offset, length) {\n    return reader.readStream\n        ? await reader.readStream(offset, length)\n        : readerToStream(reader, offset, length);\n}\nfunction sourceToStream(src) {\n    if (isBlob(src)) {\n        return src.stream();\n    }\n    return new ReadableStream({\n        start(controller) {\n            controller.enqueue(ownChunk(src));\n            controller.close();\n        },\n    });\n}\n// Splits chunks into views of at most `maxSize` bytes (no copying).\nfunction splitChunks(maxSize) {\n    return new TransformStream({\n        transform(chunk, controller) {\n            for (let offset = 0; offset < chunk.byteLength; offset += maxSize) {\n                controller.enqueue(chunk.subarray(offset, offset + maxSize));\n            }\n        },\n    });\n}\n// Errors the stream as soon as more than `expected` bytes pass through, and\n// at the end if fewer did. The declared size is metadata from the zip and\n// must be verified.\nfunction limitSize(expected) {\n    let seen = 0;\n    return new TransformStream({\n        transform(chunk, controller) {\n            seen += chunk.byteLength;\n            if (seen > expected) {\n                throw new Error(`decompressed size exceeds limit: ${seen} > ${expected}`);\n            }\n            controller.enqueue(chunk);\n        },\n        flush() {\n            if (seen !== expected) {\n                throw new Error(`decompressed size mismatch. declared: ${expected}, actual: ${seen}`);\n            }\n        },\n    });\n}\n// Re-chunks the stream so every chunk is exactly `chunkSize` bytes except the last.\nfunction reChunk(chunkSize) {\n    let buf;\n    let used = 0;\n    return new TransformStream({\n        transform(chunk, controller) {\n            let offset = 0;\n            while (offset < chunk.byteLength) {\n                if (!buf) {\n                    buf = new Uint8Array(chunkSize);\n                    used = 0;\n                }\n                const n = Math.min(chunkSize - used, chunk.byteLength - offset);\n                buf.set(chunk.subarray(offset, offset + n), used);\n                used += n;\n                offset += n;\n                if (used === chunkSize) {\n                    controller.enqueue(buf);\n                    buf = undefined;\n                }\n            }\n        },\n        flush(controller) {\n            if (buf) {\n                controller.enqueue(buf.slice(0, used));\n            }\n        },\n    });\n}\n// Takes a stream of the entry's raw (possibly deflated) bytes and returns a\n// stream of its uncompressed bytes, verified against `uncompressedSize`.\nfunction inflateRawStream(src, uncompressedSize, decompress, chunkSize) {\n    let stream = src;\n    if (decompress) {\n        stream = stream\n            .pipeThrough(splitChunks(kMaxInflateInputSize))\n            .pipeThrough(new DecompressionStream('deflate-raw'));\n    }\n    stream = stream.pipeThrough(limitSize(uncompressedSize));\n    if (chunkSize) {\n        stream = stream.pipeThrough(reChunk(chunkSize));\n    }\n    return stream;\n}\n// Reads the whole stream into a single ArrayBuffer. `size` is the exact\n// expected size (enforced by inflateRawStream) so we allocate once and copy\n// each chunk in, rather than collecting chunks and concatenating them which\n// would need twice the memory.\nasync function streamToArrayBuffer(stream, size) {\n    const result = new Uint8Array(size);\n    let offset = 0;\n    const reader = stream.getReader();\n    for (;;) {\n        const { done, value } = await reader.read();\n        if (done) {\n            break;\n        }\n        if (offset + value.byteLength > size) {\n            // should not happen: inflateRawStream enforces the size.\n            throw new Error(`decompressed size exceeds limit: ${offset + value.byteLength} > ${size}`);\n        }\n        result.set(value, offset);\n        offset += value.byteLength;\n    }\n    return result.buffer;\n}\n// Collects the stream into a Blob without holding it in the JS heap. The\n// browser stores the data in its blob storage, which may page it to disk.\nasync function streamToBlob(stream, type) {\n    // Chrome rejects Response.blob() with \"TypeError: Failed to fetch\" instead\n    // of the stream's error, so remember the real error to rethrow it.\n    let streamError;\n    const reader = stream.getReader();\n    const tapped = new ReadableStream({\n        async pull(controller) {\n            try {\n                const { done, value } = await reader.read();\n                if (done) {\n                    controller.close();\n                }\n                else {\n                    controller.enqueue(value);\n                }\n            }\n            catch (e) {\n                streamError = e;\n                throw e;\n            }\n        },\n        cancel(reason) {\n            return reader.cancel(reason);\n        },\n    }, { highWaterMark: 0 });\n    try {\n        const blob = await new Response(tapped).blob();\n        // slice does not copy, it just makes a new Blob with the requested type\n        return blob.slice(0, blob.size, type);\n    }\n    catch (e) {\n        throw streamError !== null && streamError !== void 0 ? streamError : e;\n    }\n}\n// Inflates an in-memory or Blob source to an ArrayBuffer (no type) or a Blob\n// (type). Used by the worker and by the local fallback when workers fail.\nasync function inflateToResult(src, uncompressedSize, type) {\n    const stream = inflateRawStream(sourceToStream(src), uncompressedSize, true);\n    return type\n        ? await streamToBlob(stream, type)\n        : await streamToArrayBuffer(stream, uncompressedSize);\n}\n\nconst config = {\n    numWorkers: 1,\n    workerURL: '',\n    useWorkers: false,\n};\nlet nextId = 0;\n// Requests are put on a queue.\n// We don't send the request to the worker until the worker\n// is finished. This probably adds a small amount of latency\n// but the issue is imagine you have 2 workers. You give worker\n// A x seconds of work to do and worker B y seconds of work to\n// do. You don't know which will finish first. If you give\n// the worker with more work to do the request then you'll\n// waste time.\n// note: we can't check `workers.length` for deciding if\n// we've reached `config.numWorkers` because creation the worker\n// is async which means other requests to make workers might\n// come in before a worker gets added to `workers`\nlet numWorkers = 0;\nlet canUseWorkers = true; // gets set to false if we can't start a worker\nconst workers = [];\nconst availableWorkers = [];\nconst waitingForWorkerQueue = [];\nconst currentlyProcessingIdToRequestMap = new Map();\nfunction handleResult(e) {\n    makeWorkerAvailable(e.target);\n    const { id, error, data } = e.data;\n    const request = currentlyProcessingIdToRequestMap.get(id);\n    currentlyProcessingIdToRequestMap.delete(id);\n    if (error) {\n        // The worker can only structured-clone the error as a string, so wrap it\n        // back into an Error to match the rejection type of the non-worker path.\n        request.reject(new Error(error));\n        return;\n    }\n    // Verify that the decompressed size matches the declared uncompressedSize\n    // Treat declared size as authoritative metadata that must be verified.\n    const expected = request.uncompressedSize;\n    const actual = data instanceof ArrayBuffer ? data.byteLength : data === null || data === void 0 ? void 0 : data.size;\n    if (typeof expected === 'number' && typeof actual === 'number' && expected !== actual) {\n        request.reject(new Error(`decompressed size mismatch. declared: ${expected}, actual: ${actual}`));\n        return;\n    }\n    request.resolve(data);\n}\n// Because Firefox uses non-standard onerror to signal an error.\nfunction startWorker(url) {\n    return new Promise((resolve, reject) => {\n        const worker = new Worker(url);\n        worker.onmessage = (e) => {\n            if (e.data === 'start') {\n                worker.onerror = null;\n                worker.onmessage = null;\n                resolve(worker);\n            }\n            else {\n                reject(new Error(`unexpected message: ${e.data}`));\n            }\n        };\n        worker.onerror = reject;\n    });\n}\nconst workerHelper = (function () {\n    if (isNode) {\n        return {\n            async createWorker(url) {\n                const moduleId = 'node:worker_threads';\n                const { Worker } = await import(moduleId);\n                return new Worker(url);\n            },\n            addEventListener(worker, fn) {\n                var _a;\n                (_a = worker.on) === null || _a === void 0 ? void 0 : _a.call(worker, 'message', (data) => {\n                    fn({ target: worker, data });\n                });\n            },\n            async terminate(worker) {\n                var _a;\n                await ((_a = worker.terminate) === null || _a === void 0 ? void 0 : _a.call(worker));\n            },\n        };\n    }\n    else {\n        return {\n            async createWorker(url) {\n                // I don't understand this security issue\n                // Apparently there is some iframe setting or http header\n                // that prevents cross domain workers. But, I can manually\n                // download the text and do it. I reported this to Chrome\n                // and they said it was fine so ¯\\_(ツ)_/¯\n                try {\n                    const worker = await startWorker(url);\n                    return worker;\n                }\n                catch (_e) {\n                    console.warn('could not load worker:', url);\n                }\n                let text;\n                try {\n                    const req = await fetch(url, { mode: 'cors' });\n                    if (!req.ok) {\n                        throw new Error(`could not load: ${url}`);\n                    }\n                    text = await req.text();\n                    url = URL.createObjectURL(new Blob([text], { type: 'application/javascript' }));\n                    const worker = await startWorker(url);\n                    config.workerURL = url; // this is a hack. What's a better way to structure this code?\n                    return worker;\n                }\n                catch (_e) {\n                    console.warn('could not load worker via fetch:', url);\n                }\n                if (text !== undefined) {\n                    try {\n                        url = `data:application/javascript;base64,${btoa(text)}`;\n                        const worker = await startWorker(url);\n                        config.workerURL = url;\n                        return worker;\n                    }\n                    catch (_e) {\n                        console.warn('could not load worker via dataURI');\n                    }\n                }\n                console.warn('workers will not be used');\n                throw new Error('can not start workers');\n            },\n            addEventListener(worker, fn) {\n                var _a;\n                // The browser delivers a MessageEvent whose `target` is the worker\n                // and whose `data` is the InflateResultMessage, matching WorkerResultEvent.\n                (_a = worker.addEventListener) === null || _a === void 0 ? void 0 : _a.call(worker, 'message', fn);\n            },\n            async terminate(worker) {\n                var _a;\n                await ((_a = worker.terminate) === null || _a === void 0 ? void 0 : _a.call(worker));\n            },\n        };\n    }\n}());\nfunction makeWorkerAvailable(worker) {\n    availableWorkers.push(worker);\n    processWaitingForWorkerQueue();\n}\nasync function getAvailableWorker() {\n    if (availableWorkers.length === 0 && numWorkers < config.numWorkers) {\n        ++numWorkers; // see comment at numWorkers declaration\n        try {\n            const worker = await workerHelper.createWorker(config.workerURL);\n            workers.push(worker);\n            availableWorkers.push(worker);\n            workerHelper.addEventListener(worker, handleResult);\n        }\n        catch (_e) {\n            // set this global out-of-band (needs refactor)\n            canUseWorkers = false;\n        }\n    }\n    return availableWorkers.pop();\n}\nasync function processWaitingForWorkerQueue() {\n    var _a;\n    if (waitingForWorkerQueue.length === 0) {\n        return;\n    }\n    if (config.useWorkers && canUseWorkers) {\n        const worker = await getAvailableWorker();\n        // canUseWorkers might have been set out-of-band (need refactor)\n        if (canUseWorkers) {\n            if (worker) {\n                if (waitingForWorkerQueue.length === 0) {\n                    // the queue might be empty while we awaited for a worker.\n                    makeWorkerAvailable(worker);\n                    return;\n                }\n                const { id, src, uncompressedSize, type, resolve, reject } = waitingForWorkerQueue.shift();\n                currentlyProcessingIdToRequestMap.set(id, { id, src, uncompressedSize, type, resolve, reject });\n                const transferables = [];\n                // NOTE: Originally I thought you could transfer an ArrayBuffer.\n                // The code on this side is often using views into the entire file\n                // which means if we transferred we'd lose the entire file. That sucks\n                // because it means there's an expensive copy to send the uncompressed\n                // data to the worker.\n                //\n                // Also originally I thought we could send a Blob but we'd need to refactor\n                // the code in unzipit/readEntryData as currently it reads the uncompressed\n                // bytes.\n                //\n                //if (!isBlob(src) && !isSharedArrayBuffer(src)) {\n                //  transferables.push(src);\n                //}\n                (_a = worker.postMessage) === null || _a === void 0 ? void 0 : _a.call(worker, {\n                    type: 'inflate',\n                    data: {\n                        id,\n                        type,\n                        src,\n                        uncompressedSize,\n                    },\n                }, transferables);\n            }\n            return;\n        }\n    }\n    // inflate locally\n    // We loop here because what happens if many requests happen at once\n    // the first N requests will try to async make a worker. Other requests\n    // will then be on the queue. But if we fail to make workers then there\n    // are pending requests.\n    while (waitingForWorkerQueue.length) {\n        const { src, uncompressedSize, type, resolve, reject } = waitingForWorkerQueue.shift();\n        try {\n            resolve(await inflateToResult(src, uncompressedSize, type));\n        }\n        catch (e) {\n            reject(e);\n        }\n    }\n}\n// True if inflating should go through the worker queue. When false, callers\n// stream the entry directly (see inflate-stream.ts) and skip the queue.\nfunction shouldUseWorkers() {\n    return config.useWorkers && canUseWorkers;\n}\nfunction setOptions$1(options) {\n    config.workerURL = options.workerURL || config.workerURL;\n    // there's no reason to set the workerURL if you're not going to use workers\n    if (options.workerURL) {\n        config.useWorkers = true;\n    }\n    config.useWorkers = options.useWorkers !== undefined ? options.useWorkers : config.useWorkers;\n    config.numWorkers = options.numWorkers || config.numWorkers;\n}\n// It has to take non-zero time to put a large typed array in a Blob since the very\n// next instruction you could change the contents of the array. So, if you're reading\n// the zip file for images/video/audio then all you want is a Blob on which to get a URL.\n// so that operation of putting the data in a Blob should happen in the worker.\n//\n// Conversely if you want the data itself then you want an ArrayBuffer immediately\n// since the worker can transfer its ArrayBuffer zero copy.\n//\n// @param {Uint8Array|Blob} src\n// @param {number} uncompressedSize\n// @param {string} [type] falsy or mimeType string (eg: 'image/png')\n// @returns {ArrayBuffer|Blob} ArrayBuffer if type is falsy or Blob otherwise.\nfunction inflateRawAsync(src, uncompressedSize, type) {\n    return new Promise((resolve, reject) => {\n        // note: there is potential an expensive copy here. In order for the data\n        // to make it into the worker we need to copy the data to the worker unless\n        // it's a Blob or a SharedArrayBuffer.\n        //\n        // Solutions:\n        //\n        // 1. A minor enhancement, if `uncompressedSize` is small don't call the worker.\n        //\n        //    might be a win period as their is overhead calling the worker\n        //\n        // 2. Move the entire library to the worker\n        //\n        //    Good, Maybe faster if you pass a URL, Blob, or SharedArrayBuffer? Not sure about that\n        //    as those are also easy to transfer. Still slow if you pass an ArrayBuffer\n        //    as the ArrayBuffer has to be copied to the worker.\n        //\n        // I guess benchmarking is really the only thing to try.\n        waitingForWorkerQueue.push({ src, uncompressedSize, type, resolve, reject, id: nextId++ });\n        processWaitingForWorkerQueue();\n    });\n}\nfunction clearArray(arr) {\n    arr.splice(0, arr.length);\n}\nasync function cleanup$1() {\n    for (const worker of workers) {\n        await workerHelper.terminate(worker);\n    }\n    clearArray(workers);\n    clearArray(availableWorkers);\n    clearArray(waitingForWorkerQueue);\n    currentlyProcessingIdToRequestMap.clear();\n    numWorkers = 0;\n    canUseWorkers = true;\n}\n\nfunction dosDateTimeToDate(date, time) {\n    const day = date & 0x1f; // 1-31\n    const month = (date >> 5 & 0xf) - 1; // 1-12, 0-11\n    const year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108\n    const millisecond = 0;\n    const second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)\n    const minute = time >> 5 & 0x3f; // 0-59\n    const hour = time >> 11 & 0x1f; // 0-23\n    return new Date(year, month, day, hour, minute, second, millisecond);\n}\nclass ZipEntry {\n    constructor(reader, rawEntry) {\n        this._reader = reader;\n        this._rawEntry = rawEntry;\n        this.name = rawEntry.name;\n        this.nameBytes = rawEntry.nameBytes;\n        this.size = rawEntry.uncompressedSize;\n        this.compressedSize = rawEntry.compressedSize;\n        this.comment = rawEntry.comment;\n        this.commentBytes = rawEntry.commentBytes;\n        this.compressionMethod = rawEntry.compressionMethod;\n        this.lastModDate = dosDateTimeToDate(rawEntry.lastModFileDate, rawEntry.lastModFileTime);\n        this.isDirectory = rawEntry.uncompressedSize === 0 && rawEntry.name.endsWith('/');\n        this.encrypted = !!(rawEntry.generalPurposeBitFlag & 0x1);\n        this.externalFileAttributes = rawEntry.externalFileAttributes;\n        this.versionMadeBy = rawEntry.versionMadeBy;\n    }\n    // returns a promise that returns a Blob for this entry\n    async blob(type = 'application/octet-stream') {\n        return await readEntryDataAsBlob(this._reader, this._rawEntry, type);\n    }\n    // returns a promise that returns a ReadableStream of this entry's uncompressed bytes.\n    // Data is read and decompressed only as the stream is consumed so memory use\n    // does not depend on the size of the entry. The stream errors if the data does\n    // not match the size declared in the zip. Since that can only be known at the end,\n    // treat the data as unverified until the stream closes without error.\n    async stream(options = {}) {\n        const { chunkSize } = options;\n        if (chunkSize !== undefined && !(Number.isSafeInteger(chunkSize) && chunkSize > 0)) {\n            throw new Error(`chunkSize must be a positive integer: ${chunkSize}`);\n        }\n        return await readEntryDataAsStream(this._reader, this._rawEntry, chunkSize);\n    }\n    // returns a promise that returns an ArrayBuffer for this entry\n    async arrayBuffer() {\n        return await readEntryDataAsArrayBuffer(this._reader, this._rawEntry);\n    }\n    // returns text, assumes the text is valid utf8. If you want more options decode arrayBuffer yourself\n    async text() {\n        const buffer = await this.arrayBuffer();\n        return decodeBuffer(new Uint8Array(buffer));\n    }\n    // returns text with JSON.parse called on it. If you want more options decode arrayBuffer yourself\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    async json() {\n        const text = await this.text();\n        return JSON.parse(text);\n    }\n}\nconst EOCDR_WITHOUT_COMMENT_SIZE = 22;\nconst MAX_COMMENT_SIZE = 0xffff; // 2-byte size\nconst EOCDR_SIGNATURE = 0x06054b50;\nconst ZIP64_EOCDR_SIGNATURE = 0x06064b50;\nasync function readAs(reader, offset, length) {\n    return await reader.read(offset, length);\n}\n// The point of this function is we want to be able to pass the data\n// to a worker as fast as possible so when decompressing if the data\n// is already a blob and we can get a blob then get a blob.\n//\n// I'm not sure what a better way to refactor this is. We've got examples\n// of multiple readers. Ideally, for every type of reader we could ask\n// it, \"give me a type that is zero copy both locally and when sent to a worker\".\n//\n// The problem is the worker would also have to know the how to handle this\n// opaque type. I suppose the correct solution is to register different\n// reader handlers in the worker so BlobReader would register some\n// `handleZeroCopyType<BlobReader>`. At the moment I don't feel like\n// refactoring. As it is you just pass in an instance of the reader\n// but instead you'd have to register the reader and some how get the\n// source for the `handleZeroCopyType` handler function into the worker.\n// That sounds like a huge PITA, requiring you to put the implementation\n// in a separate file so the worker can load it or some other workaround\n// hack.\n//\n// For now this hack works even if it's not generic.\nasync function readAsBlobOrTypedArray(reader, offset, length, type) {\n    if (reader.sliceAsBlob) {\n        return await reader.sliceAsBlob(offset, length, type);\n    }\n    return await reader.read(offset, length);\n}\nconst crc = {\n    unsigned() {\n        return 0;\n    },\n};\nfunction getUint16LE(uint8View, offset) {\n    return uint8View[offset] +\n        uint8View[offset + 1] * 0x100;\n}\nfunction getUint32LE(uint8View, offset) {\n    return uint8View[offset] +\n        uint8View[offset + 1] * 0x100 +\n        uint8View[offset + 2] * 0x10000 +\n        uint8View[offset + 3] * 0x1000000;\n}\nfunction getUint64LE(uint8View, offset) {\n    return getUint32LE(uint8View, offset) +\n        getUint32LE(uint8View, offset + 4) * 0x100000000;\n}\n// const decodeCP437 = (function() {\n//   const cp437 = '\\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';\n//\n//   return function(uint8view) {\n//     return Array.from(uint8view).map(v => cp437[v]).join('');\n//   };\n// }());\nconst utf8Decoder = new TextDecoder();\nfunction decodeBuffer(uint8View, _isUTF8) {\n    if (isSharedArrayBuffer(uint8View.buffer)) {\n        uint8View = new Uint8Array(uint8View);\n    }\n    return utf8Decoder.decode(uint8View);\n    /*\n    AFAICT the UTF8 flat is not set so it's 100% up to the user\n    to self decode if their file is not utf8 filenames\n    return isUTF8\n        ? utf8Decoder.decode(uint8View)\n        : decodeCP437(uint8View);\n    */\n}\nasync function findEndOfCentralDirector(reader, totalLength) {\n    const size = Math.min(EOCDR_WITHOUT_COMMENT_SIZE + MAX_COMMENT_SIZE, totalLength);\n    const readStart = totalLength - size;\n    const data = await readAs(reader, readStart, size);\n    for (let i = size - EOCDR_WITHOUT_COMMENT_SIZE; i >= 0; --i) {\n        if (getUint32LE(data, i) !== EOCDR_SIGNATURE) {\n            continue;\n        }\n        // 0 - End of central directory signature\n        const eocdr = new Uint8Array(data.buffer, data.byteOffset + i, data.byteLength - i);\n        // 4 - Number of this disk\n        const diskNumber = getUint16LE(eocdr, 4);\n        if (diskNumber !== 0) {\n            throw new Error(`multi-volume zip files are not supported. This is volume: ${diskNumber}`);\n        }\n        // 6 - Disk where central directory starts\n        // 8 - Number of central directory records on this disk\n        // 10 - Total number of central directory records\n        const entryCount = getUint16LE(eocdr, 10);\n        // 12 - Size of central directory (bytes)\n        const centralDirectorySize = getUint32LE(eocdr, 12);\n        // 16 - Offset of start of central directory, relative to start of archive\n        const centralDirectoryOffset = getUint32LE(eocdr, 16);\n        // 20 - Comment length\n        const commentLength = getUint16LE(eocdr, 20);\n        const expectedCommentLength = eocdr.length - EOCDR_WITHOUT_COMMENT_SIZE;\n        if (commentLength !== expectedCommentLength) {\n            throw new Error(`invalid comment length. expected: ${expectedCommentLength}, actual: ${commentLength}`);\n        }\n        // 22 - Comment\n        // the encoding is always cp437.\n        const commentBytes = new Uint8Array(eocdr.buffer, eocdr.byteOffset + 22, commentLength);\n        const comment = decodeBuffer(commentBytes);\n        if (entryCount === 0xffff || centralDirectoryOffset === 0xffffffff) {\n            return await readZip64CentralDirectory(reader, readStart + i, comment, commentBytes);\n        }\n        else {\n            return await readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);\n        }\n    }\n    throw new Error('could not find end of central directory. maybe not zip file');\n}\nconst END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE = 0x07064b50;\nasync function readZip64CentralDirectory(reader, offset, comment, commentBytes) {\n    // ZIP64 Zip64 end of central directory locator\n    const zip64EocdlOffset = offset - 20;\n    const eocdl = await readAs(reader, zip64EocdlOffset, 20);\n    // 0 - zip64 end of central dir locator signature\n    if (getUint32LE(eocdl, 0) !== END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE) {\n        throw new Error('invalid zip64 end of central directory locator signature');\n    }\n    // 4 - number of the disk with the start of the zip64 end of central directory\n    // 8 - relative offset of the zip64 end of central directory record\n    const zip64EocdrOffset = getUint64LE(eocdl, 8);\n    // 16 - total number of disks\n    // ZIP64 end of central directory record\n    const zip64Eocdr = await readAs(reader, zip64EocdrOffset, 56);\n    // 0 - zip64 end of central dir signature                           4 bytes  (0x06064b50)\n    if (getUint32LE(zip64Eocdr, 0) !== ZIP64_EOCDR_SIGNATURE) {\n        throw new Error('invalid zip64 end of central directory record signature');\n    }\n    // 4 - size of zip64 end of central directory record                8 bytes\n    // 12 - version made by                                             2 bytes\n    // 14 - version needed to extract                                   2 bytes\n    // 16 - number of this disk                                         4 bytes\n    // 20 - number of the disk with the start of the central directory  4 bytes\n    // 24 - total number of entries in the central directory on this disk         8 bytes\n    // 32 - total number of entries in the central directory            8 bytes\n    const entryCount = getUint64LE(zip64Eocdr, 32);\n    // 40 - size of the central directory                               8 bytes\n    const centralDirectorySize = getUint64LE(zip64Eocdr, 40);\n    // 48 - offset of start of central directory with respect to the starting disk number     8 bytes\n    const centralDirectoryOffset = getUint64LE(zip64Eocdr, 48);\n    // 56 - zip64 extensible data sector                                (variable size)\n    return readEntries(reader, centralDirectoryOffset, centralDirectorySize, entryCount, comment, commentBytes);\n}\nconst CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE = 0x02014b50;\nasync function readEntries(reader, centralDirectoryOffset, centralDirectorySize, rawEntryCount, comment, commentBytes) {\n    let readEntryCursor = 0;\n    const allEntriesBuffer = await readAs(reader, centralDirectoryOffset, centralDirectorySize);\n    const rawEntries = [];\n    for (let e = 0; e < rawEntryCount; ++e) {\n        const buffer = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + 46);\n        // 0 - Central directory file header signature\n        const signature = getUint32LE(buffer, 0);\n        if (signature !== CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE) {\n            throw new Error(`invalid central directory file header signature: 0x${signature.toString(16)}`);\n        }\n        const rawEntry = {\n            // 4 - Version made by\n            versionMadeBy: getUint16LE(buffer, 4),\n            // 6 - Version needed to extract (minimum)\n            versionNeededToExtract: getUint16LE(buffer, 6),\n            // 8 - General purpose bit flag\n            generalPurposeBitFlag: getUint16LE(buffer, 8),\n            // 10 - Compression method\n            compressionMethod: getUint16LE(buffer, 10),\n            // 12 - File last modification time\n            lastModFileTime: getUint16LE(buffer, 12),\n            // 14 - File last modification date\n            lastModFileDate: getUint16LE(buffer, 14),\n            // 16 - CRC-32\n            crc32: getUint32LE(buffer, 16),\n            // 20 - Compressed size\n            compressedSize: getUint32LE(buffer, 20),\n            // 24 - Uncompressed size\n            uncompressedSize: getUint32LE(buffer, 24),\n            // 28 - File name length (n)\n            fileNameLength: getUint16LE(buffer, 28),\n            // 30 - Extra field length (m)\n            extraFieldLength: getUint16LE(buffer, 30),\n            // 32 - File comment length (k)\n            fileCommentLength: getUint16LE(buffer, 32),\n            // 34 - Disk number where file starts\n            // 36 - Internal file attributes\n            internalFileAttributes: getUint16LE(buffer, 36),\n            // 38 - External file attributes\n            externalFileAttributes: getUint32LE(buffer, 38),\n            // 42 - Relative offset of local file header\n            relativeOffsetOfLocalHeader: getUint32LE(buffer, 42),\n        };\n        if (rawEntry.generalPurposeBitFlag & 0x40) {\n            throw new Error('strong encryption is not supported');\n        }\n        readEntryCursor += 46;\n        const data = allEntriesBuffer.subarray(readEntryCursor, readEntryCursor + rawEntry.fileNameLength + rawEntry.extraFieldLength + rawEntry.fileCommentLength);\n        // 46 - File name\n        (rawEntry.generalPurposeBitFlag & 0x800) !== 0;\n        rawEntry.nameBytes = data.slice(0, rawEntry.fileNameLength);\n        rawEntry.name = decodeBuffer(rawEntry.nameBytes);\n        // 46+n - Extra field\n        const fileCommentStart = rawEntry.fileNameLength + rawEntry.extraFieldLength;\n        const extraFieldBuffer = data.slice(rawEntry.fileNameLength, fileCommentStart);\n        rawEntry.extraFields = [];\n        let i = 0;\n        while (i < extraFieldBuffer.length - 3) {\n            const headerId = getUint16LE(extraFieldBuffer, i + 0);\n            const dataSize = getUint16LE(extraFieldBuffer, i + 2);\n            const dataStart = i + 4;\n            const dataEnd = dataStart + dataSize;\n            if (dataEnd > extraFieldBuffer.length) {\n                throw new Error('extra field length exceeds extra field buffer size');\n            }\n            rawEntry.extraFields.push({\n                id: headerId,\n                data: extraFieldBuffer.slice(dataStart, dataEnd),\n            });\n            i = dataEnd;\n        }\n        // 46+n+m - File comment\n        rawEntry.commentBytes = data.slice(fileCommentStart, fileCommentStart + rawEntry.fileCommentLength);\n        rawEntry.comment = decodeBuffer(rawEntry.commentBytes);\n        readEntryCursor += data.length;\n        if (rawEntry.uncompressedSize === 0xffffffff ||\n            rawEntry.compressedSize === 0xffffffff ||\n            rawEntry.relativeOffsetOfLocalHeader === 0xffffffff) {\n            // ZIP64 format\n            // find the Zip64 Extended Information Extra Field\n            const zip64ExtraField = rawEntry.extraFields.find(e => e.id === 0x0001);\n            if (!zip64ExtraField) {\n                throw new Error('expected zip64 extended information extra field');\n            }\n            const zip64EiefBuffer = zip64ExtraField.data;\n            let index = 0;\n            // 0 - Original Size          8 bytes\n            if (rawEntry.uncompressedSize === 0xffffffff) {\n                if (index + 8 > zip64EiefBuffer.length) {\n                    throw new Error('zip64 extended information extra field does not include uncompressed size');\n                }\n                rawEntry.uncompressedSize = getUint64LE(zip64EiefBuffer, index);\n                index += 8;\n            }\n            // 8 - Compressed Size        8 bytes\n            if (rawEntry.compressedSize === 0xffffffff) {\n                if (index + 8 > zip64EiefBuffer.length) {\n                    throw new Error('zip64 extended information extra field does not include compressed size');\n                }\n                rawEntry.compressedSize = getUint64LE(zip64EiefBuffer, index);\n                index += 8;\n            }\n            // 16 - Relative Header Offset 8 bytes\n            if (rawEntry.relativeOffsetOfLocalHeader === 0xffffffff) {\n                if (index + 8 > zip64EiefBuffer.length) {\n                    throw new Error('zip64 extended information extra field does not include relative header offset');\n                }\n                rawEntry.relativeOffsetOfLocalHeader = getUint64LE(zip64EiefBuffer, index);\n                index += 8;\n            }\n            // 24 - Disk Start Number      4 bytes\n        }\n        // check for Info-ZIP Unicode Path Extra Field (0x7075)\n        // see https://github.com/thejoshwolfe/yauzl/issues/33\n        const nameField = rawEntry.extraFields.find(e => e.id === 0x7075 &&\n            e.data.length >= 6 && // too short to be meaningful\n            e.data[0] === 1 && // Version       1 byte      version of this extra field, currently 1\n            getUint32LE(e.data, 1), crc.unsigned()); // NameCRC32     4 bytes     File Name Field CRC32 Checksum\n        // > If the CRC check fails, this UTF-8 Path Extra Field should be\n        // > ignored and the File Name field in the header should be used instead.\n        if (nameField) {\n            // UnicodeName Variable UTF-8 version of the entry File Name\n            rawEntry.fileName = decodeBuffer(nameField.data.slice(5));\n        }\n        // validate file size\n        if (rawEntry.compressionMethod === 0) {\n            let expectedCompressedSize = rawEntry.uncompressedSize;\n            if ((rawEntry.generalPurposeBitFlag & 0x1) !== 0) {\n                // traditional encryption prefixes the file data with a header\n                expectedCompressedSize += 12;\n            }\n            if (rawEntry.compressedSize !== expectedCompressedSize) {\n                throw new Error(`compressed size mismatch for stored file: ${rawEntry.compressedSize} != ${expectedCompressedSize}`);\n            }\n        }\n        rawEntries.push(rawEntry);\n    }\n    const zip = {\n        comment,\n        commentBytes,\n    };\n    return {\n        zip,\n        entries: rawEntries.map(e => new ZipEntry(reader, e)),\n    };\n}\nasync function readEntryDataHeader(reader, rawEntry) {\n    if (rawEntry.generalPurposeBitFlag & 0x1) {\n        throw new Error('encrypted entries not supported');\n    }\n    const buffer = await readAs(reader, rawEntry.relativeOffsetOfLocalHeader, 30);\n    // note: maybe this should be passed in or cached on entry\n    // as it's async so there will be at least one tick (not sure about that)\n    const totalLength = await reader.getLength();\n    // 0 - Local file header signature = 0x04034b50\n    const signature = getUint32LE(buffer, 0);\n    if (signature !== 0x04034b50) {\n        throw new Error(`invalid local file header signature: 0x${signature.toString(16)}`);\n    }\n    // all this should be redundant\n    // 4 - Version needed to extract (minimum)\n    // 6 - General purpose bit flag\n    // 8 - Compression method\n    // 10 - File last modification time\n    // 12 - File last modification date\n    // 14 - CRC-32\n    // 18 - Compressed size\n    // 22 - Uncompressed size\n    // 26 - File name length (n)\n    const fileNameLength = getUint16LE(buffer, 26);\n    // 28 - Extra field length (m)\n    const extraFieldLength = getUint16LE(buffer, 28);\n    // 30 - File name\n    // 30+n - Extra field\n    const localFileHeaderEnd = rawEntry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;\n    let decompress;\n    if (rawEntry.compressionMethod === 0) {\n        // 0 - The file is stored (no compression)\n        decompress = false;\n    }\n    else if (rawEntry.compressionMethod === 8) {\n        // 8 - The file is Deflated\n        decompress = true;\n    }\n    else {\n        throw new Error(`unsupported compression method: ${rawEntry.compressionMethod}`);\n    }\n    const fileDataStart = localFileHeaderEnd;\n    const fileDataEnd = fileDataStart + rawEntry.compressedSize;\n    if (rawEntry.compressedSize !== 0) {\n        // bounds check now, because the read streams will probably not complain loud enough.\n        // since we're dealing with an unsigned offset plus an unsigned size,\n        // we only have 1 thing to check for.\n        if (fileDataEnd > totalLength) {\n            throw new Error(`file data overflows file bounds: ${fileDataStart} +  ${rawEntry.compressedSize}  > ${totalLength}`);\n        }\n    }\n    return {\n        decompress,\n        fileDataStart,\n    };\n}\nasync function readEntryDataAsArrayBuffer(reader, rawEntry) {\n    const { decompress, fileDataStart } = await readEntryDataHeader(reader, rawEntry);\n    if (!decompress) {\n        const dataView = await readAs(reader, fileDataStart, rawEntry.compressedSize);\n        // make copy?\n        //\n        // 1. The source is a Blob/file. In this case we'll get back TypedArray we can just hand to the user\n        // 2. The source is a TypedArray. In this case we'll get back TypedArray that is a view into a larger buffer\n        //    but because ultimately this is used to return an ArrayBuffer to `someEntry.arrayBuffer()`\n        //    we need to return copy since we need the `ArrayBuffer`, not the TypedArray to exactly match the data.\n        //    Note: We could add another API function `bytes()` or something that returned a `Uint8Array`\n        //    instead of an `ArrayBuffer`. This would let us skip a copy here. But this case only happens for uncompressed\n        //    data. That seems like a rare enough case that adding a new API is not worth it? Or is it? A zip of jpegs or mp3s\n        //    might not be compressed. For now that's a TBD.\n        return isTypedArraySameAsArrayBuffer(dataView) ? dataView.buffer : dataView.slice().buffer;\n    }\n    if (!shouldUseWorkers()) {\n        const stream = await inflateEntryDataStream(reader, rawEntry, fileDataStart, true);\n        return await streamToArrayBuffer(stream, rawEntry.uncompressedSize);\n    }\n    // see comment in readEntryDateAsBlob\n    const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);\n    const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize);\n    return result;\n}\nasync function readEntryDataAsBlob(reader, rawEntry, type) {\n    const { decompress, fileDataStart } = await readEntryDataHeader(reader, rawEntry);\n    if (!decompress) {\n        const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize, type);\n        if (isBlob(typedArrayOrBlob)) {\n            return typedArrayOrBlob;\n        }\n        return new Blob([typedArrayOrBlob], { type });\n    }\n    if (!shouldUseWorkers()) {\n        // Stream into a Blob so the inflated data never needs to fit in the JS heap.\n        const stream = await inflateEntryDataStream(reader, rawEntry, fileDataStart, true);\n        return await streamToBlob(stream, type);\n    }\n    // Here's the issue with this mess (should refactor?)\n    // if the source is a blob then we really want to pass a blob to inflateRawAsync to avoid a large\n    // copy if we're going to a worker.\n    const typedArrayOrBlob = await readAsBlobOrTypedArray(reader, fileDataStart, rawEntry.compressedSize);\n    const result = await inflateRawAsync(typedArrayOrBlob, rawEntry.uncompressedSize, type);\n    return result;\n}\nasync function inflateEntryDataStream(reader, rawEntry, fileDataStart, decompress, chunkSize) {\n    const src = await readAsStream(reader, fileDataStart, rawEntry.compressedSize);\n    return inflateRawStream(src, rawEntry.uncompressedSize, decompress, chunkSize);\n}\nasync function readEntryDataAsStream(reader, rawEntry, chunkSize) {\n    const { decompress, fileDataStart } = await readEntryDataHeader(reader, rawEntry);\n    return await inflateEntryDataStream(reader, rawEntry, fileDataStart, decompress, chunkSize);\n}\nfunction setOptions(options) {\n    setOptions$1(options);\n}\nasync function unzipRaw(source) {\n    let reader;\n    if (typeof Blob !== 'undefined' && source instanceof Blob) {\n        reader = new BlobReader(source);\n    }\n    else if (source instanceof ArrayBuffer || (source && source.buffer && source.buffer instanceof ArrayBuffer)) {\n        reader = new ArrayBufferReader(source);\n    }\n    else if (isSharedArrayBuffer(source) || isSharedArrayBuffer(source.buffer)) {\n        reader = new ArrayBufferReader(source);\n    }\n    else if (typeof source === 'string') {\n        const req = await fetch(source);\n        if (!req.ok) {\n            throw new Error(`failed http request ${source}, status: ${req.status}: ${req.statusText}`);\n        }\n        const blob = await req.blob();\n        reader = new BlobReader(blob);\n    }\n    else if (typeof source.getLength === 'function' && typeof source.read === 'function') {\n        reader = source;\n    }\n    else {\n        throw new Error('unsupported source type');\n    }\n    const totalLength = await reader.getLength();\n    if (totalLength > Number.MAX_SAFE_INTEGER) {\n        throw new Error(`file too large. size: ${totalLength}. Only file sizes up 4503599627370496 bytes are supported`);\n    }\n    return await findEndOfCentralDirector(reader, totalLength);\n}\n// If the names are not utf8 you should use unzipitRaw\nasync function unzip(source) {\n    const { zip, entries } = await unzipRaw(source);\n    return {\n        zip,\n        entries: Object.fromEntries(entries.map(v => [v.name, v])),\n    };\n}\nfunction cleanup() {\n    cleanup$1();\n}\n\nexport { ArrayBufferReader, BlobReader, HTTPRangeReader, ZipEntry, cleanup, setOptions, unzip, unzipRaw };\n"]}