@wp-playground/cli 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/blueprints.phar +0 -0
- package/cli.cjs +1 -1
- package/cli.js +1 -1
- package/index.cjs +1 -1
- package/index.js +1 -1
- package/mounts-B-Qdcyyt.js +124 -0
- package/mounts-B-Qdcyyt.js.map +1 -0
- package/mounts-D7bhhGq3.cjs +15 -0
- package/mounts-D7bhhGq3.cjs.map +1 -0
- package/{mount.d.ts → mounts.d.ts} +10 -1
- package/package.json +11 -11
- package/run-cli-B5BfXxxJ.cjs +24 -0
- package/run-cli-B5BfXxxJ.cjs.map +1 -0
- package/run-cli-W9VNXESj.js +586 -0
- package/run-cli-W9VNXESj.js.map +1 -0
- package/run-cli.d.ts +3 -1
- package/v2.d.ts +45 -0
- package/worker-thread-CYvRK9UX.js +130 -0
- package/worker-thread-CYvRK9UX.js.map +1 -0
- package/worker-thread.cjs +2 -2
- package/worker-thread.cjs.map +1 -1
- package/worker-thread.d.ts +2 -1
- package/worker-thread.js +50 -49
- package/worker-thread.js.map +1 -1
- package/cli-auto-mount.d.ts +0 -19
- package/index-CddYZc1x.js +0 -5
- package/index-CddYZc1x.js.map +0 -1
- package/index-CyPmrjJv.cjs +0 -2
- package/index-CyPmrjJv.cjs.map +0 -1
- package/run-cli-Bon3Rz_F.cjs +0 -43
- package/run-cli-Bon3Rz_F.cjs.map +0 -1
- package/run-cli-DyJ6_Vj8.js +0 -8449
- package/run-cli-DyJ6_Vj8.js.map +0 -1
- package/worker-thread-CQBM_bGk.js +0 -171
- package/worker-thread-CQBM_bGk.js.map +0 -1
package/run-cli-DyJ6_Vj8.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-cli-DyJ6_Vj8.js","sources":["../../../../packages/playground/cli/src/cli-auto-mount.ts","../../../../packages/playground/cli/src/download.ts","../../../../packages/playground/cli/src/server.ts","../../../../packages/playground/cli/src/load-balancer.ts","../../../../packages/playground/cli/src/is-valid-wordpress-slug.ts","../../../../packages/playground/cli/src/mount.ts","../../../../packages/playground/cli/src/reportable-error.ts","../../../../packages/playground/storage/src/lib/github.ts","../../../../isomorphic-git/src/errors/BaseError.js","../../../../node_modules/crc-32/crc32.js","../../../../node_modules/base64-js/index.js","../../../../node_modules/ieee754/index.js","../../../../node_modules/buffer/index.js","../../../../isomorphic-git/src/errors/ObjectTypeError.js","../../../../packages/playground/storage/src/lib/git-sparse-checkout.ts","../../../../packages/php-wasm/node-polyfills/src/lib/current-js-runtime.ts","../../../../packages/php-wasm/node-polyfills/src/lib/blob.ts","../../../../packages/php-wasm/node-polyfills/src/lib/custom-event.ts","../../../../packages/php-wasm/stream-compression/src/utils/concat-uint8-array.ts","../../../../packages/php-wasm/stream-compression/src/utils/concat-bytes.ts","../../../../packages/php-wasm/stream-compression/src/utils/collect-bytes.ts","../../../../packages/php-wasm/stream-compression/src/utils/streamed-file.ts","../../../../packages/php-wasm/stream-compression/src/utils/iterable-stream-polyfill.ts","../../../../packages/php-wasm/stream-compression/src/zip/decode-remote-zip.ts","../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/deflate.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/inflate.js","../../../../node_modules/@zip.js/zip.js/lib/core/constants.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/stream-adapter.js","../../../../node_modules/@zip.js/zip.js/lib/core/configuration.js","../../../../node_modules/@zip.js/zip.js/lib/core/util/mime-type.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/crc32.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/crc32-stream.js","../../../../node_modules/@zip.js/zip.js/lib/core/util/encode-text.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/sjcl.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/common-crypto.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/aes-crypto-stream.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/zip-crypto-stream.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/zip-entry-stream.js","../../../../node_modules/@zip.js/zip.js/lib/core/streams/codec-stream.js","../../../../node_modules/@zip.js/zip.js/lib/core/codec-worker.js","../../../../node_modules/@zip.js/zip.js/lib/core/codec-pool.js","../../../../node_modules/@zip.js/zip.js/lib/z-worker-inline.js","../../../../node_modules/@zip.js/zip.js/lib/core/io.js","../../../../node_modules/@zip.js/zip.js/lib/core/util/cp437-decode.js","../../../../node_modules/@zip.js/zip.js/lib/core/util/decode-text.js","../../../../node_modules/@zip.js/zip.js/lib/core/zip-entry.js","../../../../node_modules/@zip.js/zip.js/lib/core/zip-reader.js","../../../../node_modules/@zip.js/zip.js/lib/zip-fs.js","../../../../node_modules/@zip.js/zip.js/index.js","../../../../packages/playground/storage/src/lib/filesystems.ts","../../../../packages/playground/cli/src/resolve-blueprint.ts","../../../../packages/playground/cli/src/run-cli.ts"],"sourcesContent":["import { basename, join } from 'path';\nimport type {\n\tBlueprintDeclaration,\n\tStepDefinition,\n} from '@wp-playground/blueprints';\nimport fs from 'fs';\nimport type { RunCLIArgs } from './run-cli';\nimport type { Mount } from './mount';\n\nexport function expandAutoMounts(args: RunCLIArgs): RunCLIArgs {\n\tconst path = process.cwd();\n\n\tconst mount = [...(args.mount || [])];\n\tconst mountBeforeInstall = [...(args.mountBeforeInstall || [])];\n\n\tif (isPluginDirectory(path)) {\n\t\tconst pluginName = basename(path);\n\t\tmount.push({\n\t\t\thostPath: path,\n\t\t\tvfsPath: `/wordpress/wp-content/plugins/${pluginName}`,\n\t\t});\n\t} else if (isThemeDirectory(path)) {\n\t\tconst themeName = basename(path);\n\t\tmount.push({\n\t\t\thostPath: path,\n\t\t\tvfsPath: `/wordpress/wp-content/themes/${themeName}`,\n\t\t});\n\t} else if (containsWpContentDirectories(path)) {\n\t\tmount.push(...wpContentMounts(path));\n\t} else if (containsFullWordPressInstallation(path)) {\n\t\t/**\n\t\t * We don't want Playground and WordPress to modify the OS filesystem on their own\n\t\t * by creating files like wp-config.php or wp-content/db.php.\n\t\t * To ensure WordPress can write to the /wordpress/ and /wordpress/wp-content/ directories,\n\t\t * we leave these directories as MEMFS nodes and mount individual files\n\t\t * and directories into them instead of mounting the entire directory as a NODEFS node.\n\t\t */\n\t\tconst files = fs.readdirSync(path);\n\t\tconst mounts: Mount[] = [];\n\t\tfor (const file of files) {\n\t\t\tif (file.startsWith('wp-content')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmounts.push({\n\t\t\t\thostPath: `${path}/${file}`,\n\t\t\t\tvfsPath: `/wordpress/${file}`,\n\t\t\t});\n\t\t}\n\t\tmountBeforeInstall.push(\n\t\t\t...mounts,\n\t\t\t...wpContentMounts(join(path, 'wp-content'))\n\t\t);\n\t} else {\n\t\t/**\n\t\t * By default, mount the current working directory as the Playground root.\n\t\t * This allows users to run and PHP or HTML files using the Playground CLI.\n\t\t */\n\t\tmount.push({ hostPath: path, vfsPath: '/wordpress' });\n\t}\n\n\tconst blueprint = (args.blueprint as BlueprintDeclaration) || {};\n\tblueprint.steps = [...(blueprint.steps || []), ...getSteps(path)];\n\n\t/**\n\t * If Playground is mounting a full WordPress directory,\n\t * it doesn't need to setup WordPress.\n\t */\n\tconst skipWordPressSetup =\n\t\targs.skipWordPressSetup || containsFullWordPressInstallation(path);\n\n\treturn {\n\t\t...args,\n\t\tblueprint,\n\t\tmount,\n\t\tmountBeforeInstall,\n\t\tskipWordPressSetup,\n\t} as RunCLIArgs;\n}\n\nexport function containsFullWordPressInstallation(path: string): boolean {\n\tconst files = fs.readdirSync(path);\n\treturn (\n\t\tfiles.includes('wp-admin') &&\n\t\tfiles.includes('wp-includes') &&\n\t\tfiles.includes('wp-content')\n\t);\n}\n\nexport function containsWpContentDirectories(path: string): boolean {\n\tconst files = fs.readdirSync(path);\n\treturn (\n\t\tfiles.includes('themes') ||\n\t\tfiles.includes('plugins') ||\n\t\tfiles.includes('mu-plugins') ||\n\t\tfiles.includes('uploads')\n\t);\n}\n\nexport function isThemeDirectory(path: string): boolean {\n\tconst files = fs.readdirSync(path);\n\tif (!files.includes('style.css')) {\n\t\treturn false;\n\t}\n\tconst styleCssContent = fs.readFileSync(join(path, 'style.css'), 'utf8');\n\tconst themeNameRegex = /^(?:[ \\t]*<\\?php)?[ \\t/*#@]*Theme Name:(.*)$/im;\n\treturn !!themeNameRegex.exec(styleCssContent);\n}\n\nexport function isPluginDirectory(path: string): boolean {\n\tconst files = fs.readdirSync(path);\n\tconst pluginNameRegex = /^(?:[ \\t]*<\\?php)?[ \\t/*#@]*Plugin Name:(.*)$/im;\n\tconst pluginNameMatch = files\n\t\t.filter((file) => file.endsWith('.php'))\n\t\t.find((file) => {\n\t\t\tconst fileContent = fs.readFileSync(join(path, file), 'utf8');\n\t\t\treturn !!pluginNameRegex.exec(fileContent);\n\t\t});\n\treturn !!pluginNameMatch;\n}\n\n/**\n * Returns a list of files and directories in the wp-content directory\n * to be mounted individually.\n *\n * This is needed because WordPress needs to be able to write to the\n * wp-content directory without Playground modifying the OS filesystem.\n *\n * See expandAutoMounts for more details.\n */\nexport function wpContentMounts(wpContentDir: string): Mount[] {\n\tconst files = fs.readdirSync(wpContentDir);\n\treturn (\n\t\tfiles\n\t\t\t/**\n\t\t\t * index.php is added by WordPress automatically and\n\t\t\t * can't be mounted from the current working directory\n\t\t\t * because it already exists.\n\t\t\t *\n\t\t\t * Because index.php should be empty, it's safe to not include it.\n\t\t\t */\n\t\t\t.filter((file) => !file.startsWith('index.php'))\n\t\t\t.map((file) => ({\n\t\t\t\thostPath: `${wpContentDir}/${file}`,\n\t\t\t\tvfsPath: `/wordpress/wp-content/${file}`,\n\t\t\t}))\n\t);\n}\n\nexport function getSteps(path: string): StepDefinition[] {\n\tif (isPluginDirectory(path)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tstep: 'activatePlugin',\n\t\t\t\tpluginPath: `/wordpress/wp-content/plugins/${basename(path)}`,\n\t\t\t},\n\t\t];\n\t} else if (isThemeDirectory(path)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tstep: 'activateTheme',\n\t\t\t\tthemeFolderName: basename(path),\n\t\t\t},\n\t\t];\n\t} else if (\n\t\tcontainsWpContentDirectories(path) ||\n\t\tcontainsFullWordPressInstallation(path)\n\t) {\n\t\t/**\n\t\t * Playground needs to ensure there is an active theme.\n\t\t * Otherwise when WordPress loads it will show a white screen.\n\t\t */\n\t\treturn [\n\t\t\t{\n\t\t\t\tstep: 'runPHP',\n\t\t\t\tcode: `<?php\n\t\t\t\t\trequire_once '/wordpress/wp-load.php';\n\t\t\t\t\t$theme = wp_get_theme();\n\t\t\t\t\tif (!$theme->exists()) {\n\t\t\t\t\t\t$themes = wp_get_themes();\n\t\t\t\t\t\tif (count($themes) > 0) {\n\t\t\t\t\t\t\t$themeName = array_keys($themes)[0];\n\t\t\t\t\t\t\tswitch_theme($themeName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t`,\n\t\t\t},\n\t\t];\n\t}\n\treturn [];\n}\n","import type { EmscriptenDownloadMonitor } from '@php-wasm/progress';\nimport fs from 'fs-extra';\nimport os from 'os';\nimport path, { basename } from 'path';\n\nexport const CACHE_FOLDER = path.join(os.homedir(), '.wordpress-playground');\n\nexport async function fetchSqliteIntegration(\n\tmonitor: EmscriptenDownloadMonitor\n) {\n\tconst sqliteZip = await cachedDownload(\n\t\t'https://github.com/WordPress/sqlite-database-integration/archive/refs/heads/develop.zip',\n\t\t'sqlite.zip',\n\t\tmonitor\n\t);\n\treturn sqliteZip;\n}\n\n// @TODO: Support HTTP cache, invalidate the local file if the remote file has\n// changed\nexport async function cachedDownload(\n\tremoteUrl: string,\n\tcacheKey: string,\n\tmonitor: EmscriptenDownloadMonitor\n) {\n\tconst artifactPath = path.join(CACHE_FOLDER, cacheKey);\n\tif (!fs.existsSync(artifactPath)) {\n\t\tfs.ensureDirSync(CACHE_FOLDER);\n\t\tawait downloadTo(remoteUrl, artifactPath, monitor);\n\t}\n\treturn readAsFile(artifactPath);\n}\n\nasync function downloadTo(\n\tremoteUrl: string,\n\tlocalPath: string,\n\tmonitor: EmscriptenDownloadMonitor\n) {\n\tconst response = await monitor.monitorFetch(fetch(remoteUrl));\n\tconst reader = response.body!.getReader();\n\tconst tmpPath = `${localPath}.partial`;\n\tconst writer = fs.createWriteStream(tmpPath);\n\twhile (true) {\n\t\tconst { done, value } = await reader.read();\n\t\tif (value) {\n\t\t\twriter.write(value);\n\t\t}\n\t\tif (done) {\n\t\t\tbreak;\n\t\t}\n\t}\n\twriter.close();\n\tif (!writer.closed) {\n\t\tawait new Promise((resolve, reject) => {\n\t\t\twriter.on('finish', () => {\n\t\t\t\tfs.renameSync(tmpPath, localPath);\n\t\t\t\tresolve(null);\n\t\t\t});\n\t\t\twriter.on('error', (err: any) => {\n\t\t\t\tfs.removeSync(tmpPath);\n\t\t\t\treject(err);\n\t\t\t});\n\t\t});\n\t}\n}\n\nexport function readAsFile(path: string, fileName?: string): File {\n\treturn new File([fs.readFileSync(path)], fileName ?? basename(path));\n}\n","import type { PHPRequest, PHPResponse } from '@php-wasm/universal';\nimport type { Request } from 'express';\nimport express from 'express';\nimport type { IncomingMessage, Server, ServerResponse } from 'http';\nimport type { AddressInfo } from 'net';\nimport type { RunCLIServer } from './run-cli';\n\nexport interface ServerOptions {\n\tport: number;\n\tonBind: (server: Server, port: number) => Promise<RunCLIServer>;\n\thandleRequest: (request: PHPRequest) => Promise<PHPResponse>;\n}\n\nexport async function startServer(\n\toptions: ServerOptions\n): Promise<RunCLIServer> {\n\tconst app = express();\n\n\tconst server = await new Promise<\n\t\tServer<typeof IncomingMessage, typeof ServerResponse>\n\t>((resolve, reject) => {\n\t\tconst server = app.listen(options.port, () => {\n\t\t\tconst address = server.address();\n\t\t\tif (address === null || typeof address === 'string') {\n\t\t\t\treject(new Error('Server address is not available'));\n\t\t\t} else {\n\t\t\t\tresolve(server);\n\t\t\t}\n\t\t});\n\t});\n\n\tapp.use('/', async (req, res) => {\n\t\tconst phpResponse = await options.handleRequest({\n\t\t\turl: req.url,\n\t\t\theaders: parseHeaders(req),\n\t\t\tmethod: req.method as any,\n\t\t\tbody: await bufferRequestBody(req),\n\t\t});\n\n\t\tres.statusCode = phpResponse.httpStatusCode;\n\t\tfor (const key in phpResponse.headers) {\n\t\t\tres.setHeader(key, phpResponse.headers[key]);\n\t\t}\n\t\tres.end(phpResponse.bytes);\n\t});\n\n\tconst address = server.address();\n\tconst port = (address! as AddressInfo).port;\n\treturn await options.onBind(server, port);\n}\n\nconst bufferRequestBody = async (req: Request): Promise<Uint8Array> =>\n\tawait new Promise((resolve) => {\n\t\tconst body: Uint8Array[] = [];\n\t\treq.on('data', (chunk) => {\n\t\t\tbody.push(chunk);\n\t\t});\n\t\treq.on('end', () => {\n\t\t\tresolve(new Uint8Array(Buffer.concat(body)));\n\t\t});\n\t});\n\nconst parseHeaders = (req: Request): Record<string, string> => {\n\tconst requestHeaders: Record<string, string> = {};\n\tif (req.rawHeaders && req.rawHeaders.length) {\n\t\tfor (let i = 0; i < req.rawHeaders.length; i += 2) {\n\t\t\trequestHeaders[req.rawHeaders[i].toLowerCase()] =\n\t\t\t\treq.rawHeaders[i + 1];\n\t\t}\n\t}\n\treturn requestHeaders;\n};\n","import type { PHPRequest, PHPResponse, RemoteAPI } from '@php-wasm/universal';\nimport type { PlaygroundCliWorker } from './worker-thread';\n\n// TODO: Let's merge worker management into PHPProcessManager\n// when we can have multiple workers in both CLI and web.\n// ¡ATTENTION!:Please don't expand upon this as an independent abstraction.\n\n// TODO: Could we just spawn a worker using the factory function to PHPProcessManager?\ntype WorkerLoad = {\n\tworker: RemoteAPI<PlaygroundCliWorker>;\n\tactiveRequests: Set<Promise<PHPResponse>>;\n};\nexport class LoadBalancer {\n\tworkerLoads: WorkerLoad[] = [];\n\n\tconstructor(\n\t\t// NOTE: We require a worker to start so that a load balancer\n\t\t// may not exist without being able to service requests.\n\t\t// Playground CLI initialization, as of 2025-06-11, requires that\n\t\t// an initial worker is booted alone and initialized via Blueprint\n\t\t// before additional workers are created based on the initialized worker.\n\t\tinitialWorker: RemoteAPI<PlaygroundCliWorker>\n\t) {\n\t\tthis.addWorker(initialWorker);\n\t}\n\n\taddWorker(worker: RemoteAPI<PlaygroundCliWorker>) {\n\t\tthis.workerLoads.push({\n\t\t\tworker,\n\t\t\tactiveRequests: new Set(),\n\t\t});\n\t}\n\n\tasync handleRequest(request: PHPRequest) {\n\t\tlet smallestWorkerLoad = this.workerLoads[0];\n\n\t\t// TODO: Is there any way for us to track CPU load so we could avoid\n\t\t// picking a worker that is under heavy load despite few requests?\n\t\t// Possibly this: https://nodejs.org/api/worker_threads.html#workerperformance\n\t\t// Though we probably don't need to worry about it.\n\t\tfor (let i = 1; i < this.workerLoads.length; i++) {\n\t\t\tconst workerLoad = this.workerLoads[i];\n\t\t\tif (\n\t\t\t\tworkerLoad.activeRequests.size <\n\t\t\t\tsmallestWorkerLoad.activeRequests.size\n\t\t\t) {\n\t\t\t\tsmallestWorkerLoad = workerLoad;\n\t\t\t}\n\t\t}\n\n\t\t// TODO: Add trace facility to Playground CLI to observe internals like request routing.\n\n\t\tconst promiseForResponse = smallestWorkerLoad.worker.request(request);\n\t\tsmallestWorkerLoad.activeRequests.add(promiseForResponse);\n\n\t\t// Add URL to promise for use while debugging\n\t\t(promiseForResponse as any).url = request.url;\n\n\t\treturn promiseForResponse.finally(() => {\n\t\t\tsmallestWorkerLoad.activeRequests.delete(promiseForResponse);\n\t\t});\n\t}\n}\n","/**\n * Checks if the given version string is a valid WordPress version.\n *\n * The Regex is based on the releases on https://wordpress.org/download/releases/#betas\n * The version string can be one of the following formats:\n * - \"latest\"\n * - \"trunk\"\n * - \"nightly\"\n * - \"x.y\" (x and y are integers) e.g. \"6.2\"\n * - \"x.y.z\" (x, y and z are integers) e.g. \"6.2.1\"\n * - \"x.y.z-betaN\" (N is an integer) e.g. \"6.2.1-beta1\"\n * - \"x.y.z-RCN\" (N is an integer) e.g. \"6.2-RC1\"\n *\n * @param version The version string to check.\n * @returns A boolean value indicating whether the version string is a valid WordPress version.\n */\nexport function isValidWordPressSlug(version: string): boolean {\n\tconst versionPattern =\n\t\t/^latest$|^trunk$|^nightly$|^(?:(\\d+)\\.(\\d+)(?:\\.(\\d+))?)((?:-beta(?:\\d+)?)|(?:-RC(?:\\d+)?))?$/;\n\treturn versionPattern.test(version);\n}\n","import { existsSync } from 'fs';\nimport path from 'path';\nimport { createNodeFsMountHandler } from '@php-wasm/node';\nimport type { PHP } from '@php-wasm/universal';\n\nexport interface Mount {\n\thostPath: string;\n\tvfsPath: string;\n}\n\n/**\n * Parse an array of mount argument strings where the host path and VFS path\n * are separated by a colon.\n *\n * Example:\n * parseMountWithDelimiterArguments( [ '/host/path:/vfs/path', '/host/path:/vfs/path' ] )\n * // returns:\n * [\n * { hostPath: '/host/path', vfsPath: '/vfs/path' },\n * { hostPath: '/host/path', vfsPath: '/vfs/path' }\n * ]\n *\n * @param mounts - An array of mount argument strings separated by a colon.\n * @returns An array of Mount objects.\n */\nexport function parseMountWithDelimiterArguments(mounts: string[]): Mount[] {\n\tconst parsedMounts = [];\n\tfor (const mount of mounts) {\n\t\tconst mountParts = mount.split(':');\n\t\tif (mountParts.length !== 2) {\n\t\t\tthrow new Error(`Invalid mount format: ${mount}.\n\t\t\t\tExpected format: /host/path:/vfs/path.\n\t\t\t\tIf your path contains a colon, e.g. C:\\\\myplugin, use the --mount-dir option instead.\n\t\t\t\tExample: --mount-dir C:\\\\my-plugin /wordpress/wp-content/plugins/my-plugin`);\n\t\t}\n\t\tconst [hostPath, vfsPath] = mountParts;\n\t\tif (!existsSync(hostPath)) {\n\t\t\tthrow new Error(`Host path does not exist: ${hostPath}`);\n\t\t}\n\t\tparsedMounts.push({ hostPath, vfsPath });\n\t}\n\treturn parsedMounts;\n}\n\n/**\n * Parse an array of mount argument strings where each odd array element is a host path\n * and each even element is the VFS path.\n * e.g. [ '/host/path', '/vfs/path', '/host/path2', '/vfs/path2' ]\n *\n * The result will be an array of Mount objects for each host path the\n * following element is it's VFS path.\n * e.g. [\n * { hostPath: '/host/path', vfsPath: '/vfs/path' },\n * { hostPath: '/host/path2', vfsPath: '/vfs/path2' }\n * ]\n *\n * @param mounts - An array of paths\n * @returns An array of Mount objects.\n */\nexport function parseMountDirArguments(mounts: string[]): Mount[] {\n\tif (mounts.length % 2 !== 0) {\n\t\tthrow new Error('Invalid mount format. Expected: /host/path /vfs/path');\n\t}\n\n\tconst parsedMounts = [];\n\tfor (let i = 0; i < mounts.length; i += 2) {\n\t\tconst source = mounts[i];\n\t\tconst vfsPath = mounts[i + 1];\n\t\tif (!existsSync(source)) {\n\t\t\tthrow new Error(`Host path does not exist: ${source}`);\n\t\t}\n\t\tparsedMounts.push({\n\t\t\thostPath: path.resolve(process.cwd(), source),\n\t\t\tvfsPath,\n\t\t});\n\t}\n\treturn parsedMounts;\n}\n\nexport function mountResources(php: PHP, mounts: Mount[]) {\n\tfor (const mount of mounts) {\n\t\tphp.mkdir(mount.vfsPath);\n\t\tphp.mount(mount.vfsPath, createNodeFsMountHandler(mount.hostPath));\n\t}\n}\n","/**\n * Specialized error class for CLI errors that should be reported to the user\n * as text messages. Any error of this type thrown in the CLI call stack will\n * be printed as a regular text, not a stack trace, and will cause the process\n * to exit with a non-zero exit code.\n */\nimport { logger } from '@php-wasm/logger';\n\nexport class ReportableError extends Error {\n\tpublic isReportableInCLI = true;\n\n\tconstructor(message: string, options?: ErrorOptions) {\n\t\tsuper(message, {\n\t\t\t...options,\n\t\t\tcause: {\n\t\t\t\tisReportableInCLI: true,\n\t\t\t},\n\t\t});\n\t\tthis.isReportableInCLI = true;\n\t}\n\n\tstatic getReportableCause(error: unknown): Error | null {\n\t\tlet iterations = 0;\n\t\tconst maxIterations = 15;\n\n\t\tconst errorStack = [error];\n\t\twhile (errorStack.length > 0 && iterations < maxIterations) {\n\t\t\tconst subError = errorStack.pop();\n\t\t\tif (!(subError instanceof Error)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ((subError as any).isReportableInCLI) {\n\t\t\t\treturn subError;\n\t\t\t}\n\t\t\tif (Array.isArray(subError.cause)) {\n\t\t\t\terrorStack.push(...subError.cause);\n\t\t\t} else {\n\t\t\t\terrorStack.push(subError.cause);\n\t\t\t}\n\t\t\titerations++;\n\t\t\tif (iterations >= maxIterations) {\n\t\t\t\tlogger.warn(\n\t\t\t\t\t'Recursion limit exceeded while checking if error is reportable'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n}\n","import { Semaphore } from '@php-wasm/util';\nimport { Octokit } from 'octokit';\nimport type { Changeset } from './changeset';\n\nexport type GithubClient = ReturnType<typeof createClient>;\n\nexport function createClient(githubToken: string): Octokit {\n\tconst octokit = new Octokit({\n\t\tauth: githubToken,\n\t});\n\treturn octokit;\n}\n\nexport type Files = Record<string, Uint8Array>;\nexport function filesListToObject(files: any[], root = '') {\n\tif (root.length && !root.endsWith('/')) {\n\t\troot += '/';\n\t}\n\tconst result: Files = {};\n\tfor (const file of files) {\n\t\tif (file.path.startsWith(root)) {\n\t\t\tresult[file.path.substring(root.length)] = file.content;\n\t\t}\n\t}\n\treturn result;\n}\n\nexport interface GetFilesProgress {\n\tfoundFiles: number;\n\tdownloadedFiles: number;\n}\nexport interface GetFilesOptions {\n\tonProgress?: ({ foundFiles, downloadedFiles }: GetFilesProgress) => void;\n\tprogress?: GetFilesProgress;\n}\nexport async function getFilesFromDirectory(\n\toctokit: GithubClient,\n\towner: string,\n\trepo: string,\n\tref: string,\n\tpath: string,\n\toptions: GetFilesOptions = {}\n) {\n\tif (!options.progress) {\n\t\toptions.progress = {\n\t\t\tfoundFiles: 0,\n\t\t\tdownloadedFiles: 0,\n\t\t};\n\t}\n\tconst { onProgress } = options;\n\tconst filePromises: Promise<any>[] = [];\n\tconst directoryPromises: Promise<any>[] = [];\n\n\t// Fetch the content of the directory\n\tconst { data: content } = await octokit.rest.repos.getContent({\n\t\towner,\n\t\trepo,\n\t\tpath,\n\t\tref,\n\t});\n\tif (!Array.isArray(content)) {\n\t\tthrow new Error(\n\t\t\t`Expected the list of files to be an array, but got ${typeof content}`\n\t\t);\n\t}\n\n\tfor (const item of content) {\n\t\tif (item.type === 'file') {\n\t\t\t++options.progress.foundFiles;\n\t\t\tonProgress?.(options.progress);\n\t\t\tfilePromises.push(\n\t\t\t\tgetFileContent(octokit, owner, repo, ref, item).then((file) => {\n\t\t\t\t\t++options.progress!.downloadedFiles;\n\t\t\t\t\tonProgress?.(options.progress!);\n\t\t\t\t\treturn file;\n\t\t\t\t})\n\t\t\t);\n\t\t} else if (item.type === 'dir') {\n\t\t\tdirectoryPromises.push(\n\t\t\t\tgetFilesFromDirectory(\n\t\t\t\t\toctokit,\n\t\t\t\t\towner,\n\t\t\t\t\trepo,\n\t\t\t\t\tref,\n\t\t\t\t\titem.path,\n\t\t\t\t\toptions\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tconst files = await Promise.all(filePromises);\n\tconst filesInDirs = (await Promise.all(directoryPromises)).flatMap(\n\t\t(dir) => dir\n\t);\n\treturn [...files, ...filesInDirs];\n}\n\nconst semaphore = new Semaphore({ concurrency: 15 });\nasync function getFileContent(\n\toctokit: GithubClient,\n\towner: string,\n\trepo: string,\n\tref: string,\n\titem: { path: string; name: string }\n) {\n\tconst release = await semaphore.acquire();\n\ttry {\n\t\tconst { data: fileContent } = await octokit.rest.repos.getContent({\n\t\t\towner,\n\t\t\trepo,\n\t\t\tref,\n\t\t\tpath: item.path,\n\t\t});\n\t\tif (!('content' in fileContent)) {\n\t\t\tthrow new Error(`No content found for ${item.path}`);\n\t\t}\n\t\treturn {\n\t\t\tname: item.name,\n\t\t\tpath: item.path,\n\t\t\tcontent: base64ToUint8Array(fileContent.content),\n\t\t};\n\t} finally {\n\t\trelease();\n\t}\n}\n\nfunction base64ToUint8Array(base64: string) {\n\tconst binaryString = window.atob(base64); // This will convert base64 to binary string\n\tconst len = binaryString.length;\n\tconst bytes = new Uint8Array(len);\n\tfor (let i = 0; i < len; i++) {\n\t\tbytes[i] = binaryString.charCodeAt(i);\n\t}\n\treturn bytes;\n}\n\n/**\n * Usage:\n * > await getArtifact('wordpress', 'wordpress-develop', 5511, 'build.yml')\n *\n * To get the first artifact produced by the \"build.yml\" workflow running\n * as a part of the PR 5511\n *\n * @returns\n */\nexport async function getArtifact(\n\toctokit: GithubClient,\n\towner: string,\n\trepo: string,\n\tpull_number: number,\n\tworkflow_id: string\n) {\n\tconst { data: pullRequest } = await octokit.rest.pulls.get({\n\t\towner,\n\t\trepo,\n\t\tpull_number,\n\t});\n\tconst workflowRuns = await octokit.rest.actions.listWorkflowRuns({\n\t\towner,\n\t\trepo,\n\t\tbranch: pullRequest.head.ref,\n\t\tworkflow_id,\n\t});\n\tconst runId = workflowRuns.data.workflow_runs[0]?.id;\n\tconst artifacts = await octokit.rest.actions.listWorkflowRunArtifacts({\n\t\towner,\n\t\trepo,\n\t\trun_id: runId,\n\t});\n\n\tconst artifact = await octokit.rest.actions.downloadArtifact({\n\t\towner,\n\t\trepo,\n\t\tartifact_id: artifacts.data.artifacts[0].id,\n\t\tarchive_format: 'zip',\n\t});\n\treturn artifact.data;\n}\n\nexport async function mayPush(octokit: Octokit, owner: string, repo: string) {\n\tconst { data: repository, headers } = await octokit.request(\n\t\t'GET /repos/{owner}/{repo}',\n\t\t{\n\t\t\towner,\n\t\t\trepo,\n\t\t}\n\t);\n\tif (!headers['x-oauth-scopes'] || !repository.permissions?.push) {\n\t\treturn false;\n\t}\n\n\t// @TODO Find a way to bubble up the following error earlier than on the\n\t// first push attempt:\n\t// \"organization has enabled OAuth App access restrictions\"\n\treturn true;\n}\n\nexport async function createOrUpdateBranch(\n\toctokit: Octokit,\n\towner: string,\n\trepo: string,\n\tbranch: string,\n\tnewHead: string\n) {\n\tconst branchExists = await octokit\n\t\t.request('GET /repos/{owner}/{repo}/branches/{branch}', {\n\t\t\towner,\n\t\t\trepo,\n\t\t\tbranch,\n\t\t})\n\t\t.then(\n\t\t\t() => true,\n\t\t\t() => false\n\t\t);\n\n\tif (branchExists) {\n\t\tawait octokit.request('PATCH /repos/{owner}/{repo}/git/refs/{ref}', {\n\t\t\towner,\n\t\t\trepo,\n\t\t\tsha: newHead,\n\t\t\tref: `heads/${branch}`,\n\t\t});\n\t} else {\n\t\tawait octokit.request('POST /repos/{owner}/{repo}/git/refs', {\n\t\t\towner,\n\t\t\trepo,\n\t\t\tsha: newHead,\n\t\t\tref: `refs/heads/${branch}`,\n\t\t});\n\t}\n}\n\n/**\n * @param octokit\n * @param owner\n * @param repo\n * @returns The owner of the forked repository\n */\nexport async function fork(octokit: Octokit, owner: string, repo: string) {\n\tconst user = await octokit.request('GET /user');\n\tconst forks = await octokit.request('GET /repos/{owner}/{repo}/forks', {\n\t\towner,\n\t\trepo,\n\t});\n\tconst hasFork = forks.data.find(\n\t\t(fork: any) => fork.owner && fork.owner.login === user.data.login\n\t);\n\n\tif (!hasFork) {\n\t\tawait octokit.request('POST /repos/{owner}/{repo}/forks', {\n\t\t\towner,\n\t\t\trepo,\n\t\t});\n\t}\n\n\treturn user.data.login;\n}\n\nexport async function createCommit(\n\toctokit: Octokit,\n\towner: string,\n\trepo: string,\n\tmessage: string,\n\tparentSha: string,\n\ttreeSha: string\n): Promise<string> {\n\tconst {\n\t\tdata: { sha },\n\t} = await octokit.request('POST /repos/{owner}/{repo}/git/commits', {\n\t\towner,\n\t\trepo,\n\t\tmessage,\n\t\ttree: treeSha,\n\t\tparents: [parentSha],\n\t});\n\n\treturn sha;\n}\n\nexport async function createTree(\n\toctokit: Octokit,\n\towner: string,\n\trepo: string,\n\tparentSha: string,\n\tchangeset: Changeset\n) {\n\tconst tree = await createTreeNodes(\n\t\toctokit,\n\t\towner,\n\t\trepo,\n\t\tparentSha,\n\t\tchangeset\n\t);\n\tif (tree.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\tdata: { sha: newTreeSha },\n\t} = await octokit.request('POST /repos/{owner}/{repo}/git/trees', {\n\t\towner,\n\t\trepo,\n\t\tbase_tree: parentSha,\n\t\ttree,\n\t});\n\treturn newTreeSha;\n}\n\nexport type GitHubTreeNode = {\n\tpath: string;\n\tmode: '100644';\n} & (\n\t| {\n\t\t\tsha: string | null;\n\t }\n\t| {\n\t\t\tcontent: string;\n\t }\n);\nexport async function createTreeNodes(\n\toctokit: Octokit,\n\towner: string,\n\trepo: string,\n\tparentSha: string,\n\tchangeset: Changeset\n): Promise<GitHubTreeNode[]> {\n\tconst blobsPromises = [];\n\tfor (const [path, content] of changeset.create) {\n\t\tblobsPromises.push(createTreeNode(octokit, owner, repo, path, content));\n\t}\n\tfor (const [path, content] of changeset.update) {\n\t\tblobsPromises.push(createTreeNode(octokit, owner, repo, path, content));\n\t}\n\tfor (const path of changeset.delete) {\n\t\tblobsPromises.push(deleteFile(octokit, owner, repo, parentSha, path));\n\t}\n\treturn Promise.all(blobsPromises).then(\n\t\t(blobs) => blobs.filter((blob) => !!blob) as GitHubTreeNode[]\n\t);\n}\n\nconst blobSemaphore = new Semaphore({ concurrency: 10 });\nexport async function createTreeNode(\n\toctokit: Octokit,\n\towner: string,\n\trepo: string,\n\tpath: string,\n\tcontent: string | Uint8Array\n): Promise<GitHubTreeNode> {\n\tconst release = await blobSemaphore.acquire();\n\ttry {\n\t\tif (ArrayBuffer.isView(content)) {\n\t\t\ttry {\n\t\t\t\t// Attempt to decode the byteArray as a UTF-8 string\n\t\t\t\tconst stringContent = new TextDecoder('utf-8', {\n\t\t\t\t\tfatal: true,\n\t\t\t\t}).decode(content);\n\t\t\t\treturn {\n\t\t\t\t\tpath,\n\t\t\t\t\tcontent: stringContent,\n\t\t\t\t\tmode: '100644',\n\t\t\t\t};\n\t\t\t} catch {\n\t\t\t\t// If an error occurs, the byteArray is not valid UTF-8 and we must\n\t\t\t\t// create a blob first\n\t\t\t\tconst {\n\t\t\t\t\tdata: { sha },\n\t\t\t\t} = await octokit.rest.git.createBlob({\n\t\t\t\t\towner,\n\t\t\t\t\trepo,\n\t\t\t\t\tencoding: 'base64',\n\t\t\t\t\tcontent: uint8ArrayToBase64(content),\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\tpath,\n\t\t\t\t\tsha,\n\t\t\t\t\tmode: '100644',\n\t\t\t\t};\n\t\t\t}\n\t\t} else {\n\t\t\t// Content is a string\n\t\t\treturn {\n\t\t\t\tpath,\n\t\t\t\tcontent,\n\t\t\t\tmode: '100644',\n\t\t\t};\n\t\t}\n\t} finally {\n\t\trelease();\n\t}\n}\n\nexport async function deleteFile(\n\toctokit: Octokit,\n\towner: string,\n\trepo: string,\n\tparentSha: string,\n\tpath: string\n): Promise<GitHubTreeNode | undefined> {\n\tconst release = await blobSemaphore.acquire();\n\ttry {\n\t\t// Deleting a non-existent file from a tree leads to an\n\t\t// \"GitRPC::BadObjectState\" error, so we only attempt to delete the file if\n\t\t// it exists.\n\t\tawait octokit.request('HEAD /repos/{owner}/{repo}/contents/:path', {\n\t\t\towner,\n\t\t\trepo,\n\t\t\tref: parentSha,\n\t\t\tpath,\n\t\t});\n\n\t\treturn {\n\t\t\tpath,\n\t\t\tmode: '100644',\n\t\t\tsha: null,\n\t\t};\n\t} catch {\n\t\t// Pass\n\t\treturn undefined;\n\t} finally {\n\t\trelease();\n\t}\n}\n\nfunction uint8ArrayToBase64(bytes: Uint8Array) {\n\tconst binary = [];\n\tconst len = bytes.byteLength;\n\tfor (let i = 0; i < len; i++) {\n\t\tbinary.push(String.fromCharCode(bytes[i]));\n\t}\n\treturn window.btoa(binary.join(''));\n}\n","export class BaseError extends Error {\n constructor(message) {\n super(message)\n // Setting this here allows TS to infer that all git errors have a `caller` property and\n // that its type is string.\n this.caller = ''\n }\n\n toJSON() {\n // Error objects aren't normally serializable. So we do something about that.\n return {\n code: this.code,\n data: this.data,\n caller: this.caller,\n message: this.message,\n stack: this.stack,\n }\n }\n\n fromJSON(json) {\n const e = new BaseError(json.message)\n e.code = json.code\n e.data = json.data\n e.caller = json.caller\n e.stack = json.stack\n return e\n }\n\n get isIsomorphicGitError() {\n return true\n }\n}\n","/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*exported CRC32 */\nvar CRC32;\n(function (factory) {\n\t/*jshint ignore:start */\n\t/*eslint-disable */\n\tif(typeof DO_NOT_EXPORT_CRC === 'undefined') {\n\t\tif('object' === typeof exports) {\n\t\t\tfactory(exports);\n\t\t} else if ('function' === typeof define && define.amd) {\n\t\t\tdefine(function () {\n\t\t\t\tvar module = {};\n\t\t\t\tfactory(module);\n\t\t\t\treturn module;\n\t\t\t});\n\t\t} else {\n\t\t\tfactory(CRC32 = {});\n\t\t}\n\t} else {\n\t\tfactory(CRC32 = {});\n\t}\n\t/*eslint-enable */\n\t/*jshint ignore:end */\n}(function(CRC32) {\nCRC32.version = '1.2.2';\n/*global Int32Array */\nfunction signed_crc_table() {\n\tvar c = 0, table = new Array(256);\n\n\tfor(var n =0; n != 256; ++n){\n\t\tc = n;\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\ttable[n] = c;\n\t}\n\n\treturn typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;\n}\n\nvar T0 = signed_crc_table();\nfunction slice_by_16_tables(T) {\n\tvar c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ;\n\n\tfor(n = 0; n != 256; ++n) table[n] = T[n];\n\tfor(n = 0; n != 256; ++n) {\n\t\tv = T[n];\n\t\tfor(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF];\n\t}\n\tvar out = [];\n\tfor(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);\n\treturn out;\n}\nvar TT = slice_by_16_tables(T0);\nvar T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];\nvar T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];\nvar Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];\nfunction crc32_bstr(bstr, seed) {\n\tvar C = seed ^ -1;\n\tfor(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_buf(B, seed) {\n\tvar C = seed ^ -1, L = B.length - 15, i = 0;\n\tfor(; i < L;) C =\n\t\tTf[B[i++] ^ (C & 255)] ^\n\t\tTe[B[i++] ^ ((C >> 8) & 255)] ^\n\t\tTd[B[i++] ^ ((C >> 16) & 255)] ^\n\t\tTc[B[i++] ^ (C >>> 24)] ^\n\t\tTb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^\n\t\tT7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^\n\t\tT3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];\n\tL += 15;\n\twhile(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_str(str, seed) {\n\tvar C = seed ^ -1;\n\tfor(var i = 0, L = str.length, c = 0, d = 0; i < L;) {\n\t\tc = str.charCodeAt(i++);\n\t\tif(c < 0x80) {\n\t\t\tC = (C>>>8) ^ T0[(C^c)&0xFF];\n\t\t} else if(c < 0x800) {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t} else if(c >= 0xD800 && c < 0xE000) {\n\t\t\tc = (c&1023)+64; d = str.charCodeAt(i++)&1023;\n\t\t\tC = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF];\n\t\t} else {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t}\n\t}\n\treturn ~C;\n}\nCRC32.table = T0;\n// $FlowIgnore\nCRC32.bstr = crc32_bstr;\n// $FlowIgnore\nCRC32.buf = crc32_buf;\n// $FlowIgnore\nCRC32.str = crc32_str;\n}));\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","import { BaseError } from './BaseError.js'\n\nexport class ObjectTypeError extends BaseError {\n /**\n * @param {string} oid\n * @param {'blob'|'commit'|'tag'|'tree'} actual\n * @param {'blob'|'commit'|'tag'|'tree'} expected\n * @param {string} [filepath]\n */\n constructor(oid, actual, expected, filepath) {\n super(\n `Object ${oid} ${\n filepath ? `at ${filepath}` : ''\n }was anticipated to be a ${expected} but it is a ${actual}.`\n )\n this.code = this.name = ObjectTypeError.code\n this.data = { oid, actual, expected, filepath }\n }\n}\n/** @type {'ObjectTypeError'} */\nObjectTypeError.code = 'ObjectTypeError'\n","/*\n * Import internal data parsers and structures from isomorphic-git. These\n * exports are not available in the npm version of isomorphic-git, which is why\n * we use one from the git repository.\n *\n * This file heavily relies on isomorphic-git internals to parse Git data formats\n * such as PACK, trees, deltas, etc.\n */\nimport './isomorphic-git.d.ts';\nimport { GitPktLine } from 'isomorphic-git/src/models/GitPktLine.js';\nimport { GitTree } from 'isomorphic-git/src/models/GitTree.js';\nimport { GitAnnotatedTag } from 'isomorphic-git/src/models/GitAnnotatedTag.js';\nimport { GitCommit } from 'isomorphic-git/src/models/GitCommit.js';\nimport { GitPackIndex } from 'isomorphic-git/src/models/GitPackIndex.js';\nimport { collect } from 'isomorphic-git/src/internal-apis.js';\nimport { parseUploadPackResponse } from 'isomorphic-git/src/wire/parseUploadPackResponse.js';\nimport { ObjectTypeError } from 'isomorphic-git/src/errors/ObjectTypeError.js';\nimport { Buffer } from 'buffer';\n\n/**\n * A polyfill for the Buffer class. We need it because isomorphic-git uses it internally.\n * The isomorphic-git version released via npm shipes a Buffer implementation, but we're\n * using a version cloned from the git repository which assumes a global Buffer is available.\n */\nif (typeof window !== 'undefined') {\n\twindow.Buffer = Buffer;\n}\n\n/**\n * Downloads specific files from a git repository.\n * It uses the git protocol over HTTP to fetch the files. It only uses\n * three HTTP requests regardless of the number of paths requested.\n *\n * @param repoUrl The URL of the git repository.\n * @param fullyQualifiedBranchName The full name of the branch to fetch from (e.g., 'refs/heads/main').\n * @param filesPaths An array of all the file paths to fetch from the repository. Does **not** accept\n * patterns, wildcards, directory paths. All files must be explicitly listed.\n * @returns A record where keys are file paths and values are the retrieved file contents.\n */\nexport async function sparseCheckout(\n\trepoUrl: string,\n\tcommitHash: string,\n\tfilesPaths: string[]\n) {\n\tconst treesIdx = await fetchWithoutBlobs(repoUrl, commitHash);\n\tconst objects = await resolveObjects(treesIdx, commitHash, filesPaths);\n\n\tconst blobsIdx = await fetchObjects(\n\t\trepoUrl,\n\t\tfilesPaths.map((path) => objects[path].oid)\n\t);\n\n\tconst fetchedPaths: Record<string, any> = {};\n\tawait Promise.all(\n\t\tfilesPaths.map(async (path) => {\n\t\t\tfetchedPaths[path] = await extractGitObjectFromIdx(\n\t\t\t\tblobsIdx,\n\t\t\t\tobjects[path].oid\n\t\t\t);\n\t\t})\n\t);\n\treturn fetchedPaths;\n}\n\nexport type GitFileTreeFile = {\n\tname: string;\n\ttype: 'file';\n};\nexport type GitFileTreeFolder = {\n\tname: string;\n\ttype: 'folder';\n\tchildren: GitFileTree[];\n};\nexport type GitFileTree = GitFileTreeFile | GitFileTreeFolder;\n\nexport type GitRef = {\n\tvalue: string;\n\ttype?: 'branch' | 'commit' | 'refname' | 'infer';\n};\n\n/**\n * Lists all files in a git repository.\n *\n * See https://git-scm.com/book/en/v2/Git-Internals-Git-Objects for more information.\n *\n * @param repoUrl The URL of the git repository.\n * @param commitHash The commit hash to fetch from.\n * @returns A list of all files in the repository.\n */\nexport async function listGitFiles(\n\trepoUrl: string,\n\tcommitHash: string\n): Promise<GitFileTree[]> {\n\tconst treesIdx = await fetchWithoutBlobs(repoUrl, commitHash);\n\tconst rootTree = await resolveAllObjects(treesIdx, commitHash);\n\tif (!rootTree?.object) {\n\t\treturn [];\n\t}\n\n\treturn gitTreeToFileTree(rootTree);\n}\n\n/**\n * Resolves a ref description, e.g. a branch name, to a commit hash.\n *\n * @param repoUrl The URL of the git repository.\n * @param ref The branch name or commit hash.\n * @returns The commit hash.\n */\nexport async function resolveCommitHash(repoUrl: string, ref: GitRef) {\n\tif (ref.type === 'infer' || ref.type === undefined) {\n\t\tif (['', 'HEAD'].includes(ref.value)) {\n\t\t\tref = {\n\t\t\t\tvalue: ref.value,\n\t\t\t\ttype: 'refname',\n\t\t\t};\n\t\t} else if (typeof ref.value === 'string' && ref.value.length === 40) {\n\t\t\tref = {\n\t\t\t\tvalue: ref.value,\n\t\t\t\ttype: 'commit',\n\t\t\t};\n\t\t}\n\t}\n\tif (ref.type === 'branch') {\n\t\tref = {\n\t\t\tvalue: `refs/heads/${ref.value}`,\n\t\t\ttype: 'refname',\n\t\t};\n\t}\n\tswitch (ref.type) {\n\t\tcase 'commit':\n\t\t\treturn ref.value;\n\t\tcase 'refname': {\n\t\t\tconst refs = await listGitRefs(repoUrl, ref.value);\n\t\t\tif (!(ref.value in refs)) {\n\t\t\t\tthrow new Error(`Branch ${ref.value} not found`);\n\t\t\t}\n\t\t\treturn refs[ref.value];\n\t\t}\n\t\tdefault:\n\t\t\tthrow new Error(`Invalid ref type: ${ref.type}`);\n\t}\n}\n\nfunction gitTreeToFileTree(tree: GitTree): GitFileTree[] {\n\treturn tree.object\n\t\t.map((branch) => {\n\t\t\tif (branch.type === 'blob') {\n\t\t\t\treturn {\n\t\t\t\t\tname: branch.path,\n\t\t\t\t\ttype: 'file',\n\t\t\t\t} as GitFileTreeFile;\n\t\t\t} else if (branch.type === 'tree' && branch.object) {\n\t\t\t\treturn {\n\t\t\t\t\tname: branch.path,\n\t\t\t\t\ttype: 'folder',\n\t\t\t\t\tchildren: gitTreeToFileTree(branch as any as GitTree),\n\t\t\t\t} as GitFileTreeFolder;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t})\n\t\t.filter((entry) => !!entry?.name) as GitFileTree[];\n}\n\n/**\n * Retrieves a list of refs from a git repository.\n *\n * See https://git-scm.com/book/en/v2/Git-Internals-Git-References for more information.\n *\n * @param repoUrl The URL of the git repository. For example: https://github.com/WordPress/gutenberg.git\n * @param fullyQualifiedBranchPrefix The prefix of the refs to fetch. For example: refs/heads/my-feature-branch\n * @returns A map of refs to their corresponding commit hashes.\n */\nexport async function listGitRefs(\n\trepoUrl: string,\n\tfullyQualifiedBranchPrefix: string\n) {\n\tconst packbuffer = Buffer.from(\n\t\tawait collect([\n\t\t\tGitPktLine.encode(`command=ls-refs\\n`),\n\t\t\tGitPktLine.encode(`agent=git/2.37.3\\n`),\n\t\t\tGitPktLine.encode(`object-format=sha1\\n`),\n\t\t\tGitPktLine.delim(),\n\t\t\tGitPktLine.encode(`peel\\n`),\n\t\t\tGitPktLine.encode(`ref-prefix ${fullyQualifiedBranchPrefix}\\n`),\n\t\t\tGitPktLine.flush(),\n\t\t])\n\t);\n\n\tconst response = await fetch(repoUrl + '/git-upload-pack', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\tAccept: 'application/x-git-upload-pack-advertisement',\n\t\t\t'content-type': 'application/x-git-upload-pack-request',\n\t\t\t'Content-Length': `${packbuffer.length}`,\n\t\t\t'Git-Protocol': 'version=2',\n\t\t},\n\t\tbody: packbuffer,\n\t});\n\n\tconst refs: Record<string, string> = {};\n\tfor await (const line of parseGitResponseLines(response)) {\n\t\tconst spaceAt = line.indexOf(' ');\n\t\tconst ref = line.slice(0, spaceAt);\n\t\tconst name = line.slice(spaceAt + 1, line.length - 1);\n\t\trefs[name] = ref;\n\t}\n\treturn refs;\n}\n\nasync function fetchWithoutBlobs(repoUrl: string, commitHash: string) {\n\tconst packbuffer = Buffer.from(\n\t\tawait collect([\n\t\t\tGitPktLine.encode(\n\t\t\t\t`want ${commitHash} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/2.37.3 filter \\n`\n\t\t\t),\n\t\t\tGitPktLine.encode(`filter blob:none\\n`),\n\t\t\tGitPktLine.encode(`shallow ${commitHash}\\n`),\n\t\t\tGitPktLine.encode(`deepen 1\\n`),\n\t\t\tGitPktLine.flush(),\n\t\t\tGitPktLine.encode(`done\\n`),\n\t\t\tGitPktLine.encode(`done\\n`),\n\t\t])\n\t);\n\n\tconst response = await fetch(repoUrl + '/git-upload-pack', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\tAccept: 'application/x-git-upload-pack-advertisement',\n\t\t\t'content-type': 'application/x-git-upload-pack-request',\n\t\t\t'Content-Length': `${packbuffer.length}`,\n\t\t},\n\t\tbody: packbuffer,\n\t});\n\n\tconst iterator = streamToIterator(response.body!);\n\tconst parsed = await parseUploadPackResponse(iterator);\n\tconst packfile = Buffer.from(await collect(parsed.packfile));\n\tconst idx = await GitPackIndex.fromPack({\n\t\tpack: packfile,\n\t});\n\tconst originalRead = idx.read as any;\n\tidx.read = async function ({ oid, ...rest }: { oid: string }) {\n\t\tconst result = await originalRead.call(this, { oid, ...rest });\n\t\tresult.oid = oid;\n\t\treturn result;\n\t};\n\treturn idx;\n}\n\nasync function resolveAllObjects(idx: GitPackIndex, commitHash: string) {\n\tconst commit = await idx.read({\n\t\toid: commitHash,\n\t});\n\treadObject(commit);\n\n\tconst rootItem = await idx.read({ oid: commit.object.tree });\n\tconst items = [rootItem];\n\twhile (items.length > 0) {\n\t\tconst tree = items.pop();\n\t\tconst readItem = await idx.read({ oid: tree.oid });\n\t\treadObject(readItem);\n\t\ttree.object = readItem.object;\n\t\tif (readItem.type === 'tree') {\n\t\t\tfor (const subitem of readItem.object) {\n\t\t\t\tif (subitem.type === 'tree') {\n\t\t\t\t\titems.push(subitem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn rootItem;\n}\n\nasync function resolveObjects(\n\tidx: GitPackIndex,\n\tcommitHash: string,\n\tpaths: string[]\n) {\n\tconst commit = await idx.read({\n\t\toid: commitHash,\n\t});\n\treadObject(commit);\n\n\tconst rootTree = await idx.read({ oid: commit.object.tree });\n\treadObject(rootTree);\n\n\t// Resolve refs to fetch\n\tconst resolvedOids: Record<string, any> = {};\n\tfor (const path of paths) {\n\t\tlet currentObject = rootTree;\n\t\tconst segments = path.split('/');\n\t\tfor (const segment of segments) {\n\t\t\tif (currentObject.type !== 'tree') {\n\t\t\t\tthrow new Error(`Path not found in the repo: ${path}`);\n\t\t\t}\n\n\t\t\tlet found = false;\n\t\t\tfor (const item of currentObject.object) {\n\t\t\t\tif (item.path === segment) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcurrentObject = await idx.read({ oid: item.oid });\n\t\t\t\t\t\treadObject(currentObject);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tcurrentObject = item;\n\t\t\t\t\t}\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\tthrow new Error(`Path not found in the repo: ${path}`);\n\t\t\t}\n\t\t}\n\t\tresolvedOids[path] = currentObject;\n\t}\n\treturn resolvedOids;\n}\n\n// Request oid for each resolvedRef\nasync function fetchObjects(url: string, objectHashes: string[]) {\n\tconst packbuffer = Buffer.from(\n\t\tawait collect([\n\t\t\t...objectHashes.map((objectHash) =>\n\t\t\t\tGitPktLine.encode(\n\t\t\t\t\t`want ${objectHash} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/2.37.3 \\n`\n\t\t\t\t)\n\t\t\t),\n\t\t\tGitPktLine.flush(),\n\t\t\tGitPktLine.encode(`done\\n`),\n\t\t])\n\t);\n\n\tconst response = await fetch(url + '/git-upload-pack', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\tAccept: 'application/x-git-upload-pack-advertisement',\n\t\t\t'content-type': 'application/x-git-upload-pack-request',\n\t\t\t'Content-Length': `${packbuffer.length}`,\n\t\t},\n\t\tbody: packbuffer,\n\t});\n\n\tconst iterator = streamToIterator(response.body!);\n\tconst parsed = await parseUploadPackResponse(iterator);\n\tconst packfile = Buffer.from(await collect(parsed.packfile));\n\treturn await GitPackIndex.fromPack({\n\t\tpack: packfile,\n\t});\n}\n\nasync function extractGitObjectFromIdx(idx: GitPackIndex, objectHash: string) {\n\tconst tree = await idx.read({ oid: objectHash });\n\treadObject(tree);\n\n\tif (tree.type === 'blob') {\n\t\treturn tree.object;\n\t}\n\n\tconst files: Record<string, any> = {};\n\tfor (const { path, oid, type } of tree.object) {\n\t\tif (type === 'blob') {\n\t\t\tconst object = await idx.read({ oid });\n\t\t\treadObject(object);\n\t\t\tfiles[path] = object.object;\n\t\t} else if (type === 'tree') {\n\t\t\tfiles[path] = await extractGitObjectFromIdx(idx, oid);\n\t\t}\n\t}\n\treturn files;\n}\n\nfunction readObject(result: any) {\n\tif (!(result.object instanceof Buffer)) {\n\t\treturn;\n\t}\n\tswitch (result.type) {\n\t\tcase 'commit':\n\t\t\tresult.object = GitCommit.from(result.object).parse();\n\t\t\tbreak;\n\t\tcase 'tree':\n\t\t\tresult.object = (GitTree.from(result.object) as any).entries();\n\t\t\tbreak;\n\t\tcase 'blob':\n\t\t\tresult.object = new Uint8Array(result.object);\n\t\t\tresult.format = 'content';\n\t\t\tbreak;\n\t\tcase 'tag':\n\t\t\tresult.object = GitAnnotatedTag.from(result.object).parse();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new ObjectTypeError(\n\t\t\t\tresult.oid,\n\t\t\t\tresult.type,\n\t\t\t\t'blob|commit|tag|tree'\n\t\t\t);\n\t}\n}\n\nasync function* parseGitResponseLines(response: Response) {\n\tconst text = await response.text();\n\tlet at = 0;\n\n\twhile (at <= text.length) {\n\t\tconst lineLength = parseInt(text.substring(at, at + 4), 16);\n\t\tif (lineLength === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tconst line = text.substring(at + 4, at + lineLength);\n\t\tyield line;\n\t\tat += lineLength;\n\t}\n}\n\nfunction streamToIterator(stream: any) {\n\t// Use native async iteration if it's available.\n\tif (stream[Symbol.asyncIterator]) {\n\t\treturn stream;\n\t}\n\tconst reader = stream.getReader();\n\treturn {\n\t\tnext() {\n\t\t\treturn reader.read();\n\t\t},\n\t\treturn() {\n\t\t\treader.releaseLock();\n\t\t\treturn {};\n\t\t},\n\t\t[Symbol.asyncIterator]() {\n\t\t\treturn this;\n\t\t},\n\t};\n}\n","export const currentJsRuntime = (function () {\n\tif (typeof process !== 'undefined' && process.release?.name === 'node') {\n\t\treturn 'NODE';\n\t} else if (typeof window !== 'undefined') {\n\t\treturn 'WEB';\n\t} else if (\n\t\t// @ts-ignore\n\t\ttypeof WorkerGlobalScope !== 'undefined' &&\n\t\t// @ts-ignore\n\t\tself instanceof (WorkerGlobalScope as any)\n\t) {\n\t\treturn 'WORKER';\n\t} else {\n\t\treturn 'NODE';\n\t}\n})();\n","import { currentJsRuntime } from './current-js-runtime';\n\n// Without this check, the polyfills below would also be applied\n// in web browsers. Unfortunately, Safari doesn't sypport BYOB streams\n// and doesn't support the polyfill provided here. Let's only apply\n// those polyfills in Node.js environments.\nif (currentJsRuntime === 'NODE') {\n\t/**\n\t * WordPress Playground heavily realies on the File class. This module\n\t * polyfill the File class for the different environments where\n\t * WordPress Playground may run.\n\t */\n\tif (typeof File === 'undefined') {\n\t\t/**\n\t\t * Polyfill the File class that isn't shipped in Node.js version 18.\n\t\t *\n\t\t * Blob conveniently provides a lot of the same methods as File, we\n\t\t * just need to implement a few File-specific properties.\n\t\t */\n\t\tclass File extends Blob {\n\t\t\treadonly name: string;\n\t\t\treadonly lastModified: number;\n\t\t\treadonly lastModifiedDate: Date;\n\t\t\twebkitRelativePath: any;\n\t\t\tconstructor(\n\t\t\t\tsources: BlobPart[],\n\t\t\t\tfileName: string,\n\t\t\t\toptions?: FilePropertyBag\n\t\t\t) {\n\t\t\t\tsuper(sources);\n\t\t\t\t/*\n\t\t\t\t * Compute a valid last modified date as that's what the\n\t\t\t\t * browsers do:\n\t\t\t\t *\n\t\t\t\t * ```\n\t\t\t\t * > new File([], '').lastModifiedDate\n\t\t\t\t * Sat Dec 16 2023 10:07:53 GMT+0100 (czas środkowoeuropejski standardowy)\n\t\t\t\t *\n\t\t\t\t * > new File([], '', { lastModified: NaN }).lastModifiedDate\n\t\t\t\t * Thu Jan 01 1970 01:00:00 GMT+0100 (czas środkowoeuropejski standardowy)\n\t\t\t\t *\n\t\t\t\t * > new File([], '', { lastModified: 'string' }).lastModifiedDate\n\t\t\t\t * Thu Jan 01 1970 01:00:00 GMT+0100 (czas środkowoeuropejski standardowy)\n\t\t\t\t *\n\t\t\t\t * > new File([], '', { lastModified: {} }).lastModifiedDate\n\t\t\t\t * Thu Jan 01 1970 01:00:00 GMT+0100 (czas środkowoeuropejski standardowy)\n\t\t\t\t * ```\n\t\t\t\t */\n\t\t\t\tlet date;\n\t\t\t\tif (options?.lastModified) {\n\t\t\t\t\tdate = new Date();\n\t\t\t\t}\n\t\t\t\tif (!date || isNaN(date.getFullYear())) {\n\t\t\t\t\tdate = new Date();\n\t\t\t\t}\n\t\t\t\tthis.lastModifiedDate = date;\n\t\t\t\tthis.lastModified = date.getMilliseconds();\n\t\t\t\tthis.name = fileName || '';\n\t\t\t}\n\t\t}\n\t\tglobal.File = File;\n\t}\n\n\t// eslint-disable-next-line no-inner-declarations\n\tfunction asPromise<T>(obj: FileReader) {\n\t\treturn new Promise<T>(function (resolve, reject) {\n\t\t\tobj.onload = obj.onerror = function (event: Event) {\n\t\t\t\tobj.onload = obj.onerror = null;\n\n\t\t\t\tif (event.type === 'load') {\n\t\t\t\t\tresolve(obj.result as T);\n\t\t\t\t} else {\n\t\t\t\t\treject(new Error('Failed to read the blob/file'));\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\n\t/**\n\t * File is a subclass of Blob. Let's polyfill the following Blob\n\t * methods that are missing in JSDOM:\n\t *\n\t * – Blob.text()\n\t * – Blob.stream()\n\t * – Blob.arrayBuffer()\n\t *\n\t * See the related JSDom issue:\n\t *\n\t * – [Implement Blob.stream, Blob.text and Blob.arrayBuffer](https://github.com/jsdom/jsdom/issues/2555).\n\t *\n\t * @source `blob-polyfill` npm package.\n\t * * By Eli Grey, https://eligrey.com\n\t * * By Jimmy Wärting, https://github.com/jimmywarting\n\t */\n\tif (typeof Blob.prototype.arrayBuffer === 'undefined') {\n\t\tBlob.prototype.arrayBuffer = function arrayBuffer() {\n\t\t\tconst reader = new FileReader();\n\t\t\treader.readAsArrayBuffer(this);\n\t\t\treturn asPromise<Uint8Array>(reader);\n\t\t};\n\t}\n\n\tif (typeof Blob.prototype.text === 'undefined') {\n\t\tBlob.prototype.text = function text() {\n\t\t\tconst reader = new FileReader();\n\t\t\treader.readAsText(this);\n\t\t\treturn asPromise<string>(reader);\n\t\t};\n\t}\n\n\t/**\n\t * Detects if BYOB (Bring Your Own Buffer) streams are supported\n\t * in the current environment.\n\t *\n\t * BYOB is a new feature in the Streams API that allows reading\n\t * an arbitrary number of bytes from a stream. It's not supported\n\t * in older versions of Node.js.\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader\n\t */\n\t// eslint-disable-next-line no-inner-declarations\n\tfunction isByobSupported() {\n\t\tconst inputBytes = new Uint8Array([1, 2, 3, 4]);\n\t\tconst file = new File([inputBytes], 'test');\n\t\tconst stream = file.stream();\n\t\ttry {\n\t\t\t// This throws on older versions of node:\n\t\t\tstream.getReader({ mode: 'byob' });\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Polyfill the stream() method if it either doesn't exist,\n\t * or is an older version shipped with e.g. Node.js 18 where\n\t * BYOB streams seem to be unsupported.\n\t */\n\tif (typeof Blob.prototype.stream === 'undefined' || !isByobSupported()) {\n\t\tBlob.prototype.stream = function () {\n\t\t\tlet position = 0;\n\t\t\t// eslint-disable-next-line\n\t\t\tconst blob = this;\n\t\t\treturn new ReadableStream({\n\t\t\t\ttype: 'bytes',\n\t\t\t\t// 0.5 MB seems like a reasonable chunk size, let's adjust\n\t\t\t\t// this if needed.\n\t\t\t\tautoAllocateChunkSize: 512 * 1024,\n\n\t\t\t\tasync pull(controller) {\n\t\t\t\t\tconst view = controller.byobRequest!.view;\n\n\t\t\t\t\t// Read the next chunk of data:\n\t\t\t\t\tconst chunk = blob.slice(\n\t\t\t\t\t\tposition,\n\t\t\t\t\t\tposition + view!.byteLength\n\t\t\t\t\t);\n\t\t\t\t\tconst buffer = await chunk.arrayBuffer();\n\t\t\t\t\tconst uint8array = new Uint8Array(buffer);\n\n\t\t\t\t\t// Emit that chunk:\n\t\t\t\t\tnew Uint8Array(view!.buffer).set(uint8array);\n\t\t\t\t\tconst bytesRead = uint8array.byteLength;\n\t\t\t\t\tcontroller.byobRequest!.respond(bytesRead);\n\n\t\t\t\t\t// Bump the position and close this stream once\n\t\t\t\t\t// we've read the entire blob.\n\t\t\t\t\tposition += bytesRead;\n\t\t\t\t\tif (position >= blob.size) {\n\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t});\n\t\t};\n\t}\n}\n\nexport default {};\n","import { currentJsRuntime } from './current-js-runtime';\n\nif (currentJsRuntime === 'NODE' && typeof CustomEvent === 'undefined') {\n\tclass CustomEvent<T = any> extends Event {\n\t\treadonly detail: T;\n\t\tconstructor(\n\t\t\tname: string,\n\t\t\toptions: {\n\t\t\t\tdetail?: T;\n\t\t\t\tbubbles?: boolean;\n\t\t\t\tcancellable?: boolean;\n\t\t\t\tcomposed?: boolean;\n\t\t\t} = {}\n\t\t) {\n\t\t\tsuper(name, options);\n\t\t\t/*\n\t\t\t * The bang symbol (`!`) here is a lie to make TypeScript happy.\n\t\t\t *\n\t\t\t * Without the bang TS has the following complaint:\n\t\t\t *\n\t\t\t * > T | undefined is not assignable to type T\n\t\t\t *\n\t\t\t * In reality, it's absolutely fine for T (or `options.detail`)\n\t\t\t * to be undefined. However, the CustomEvent interface shipped\n\t\t\t * with TypeScript doesn't think so and marks `this.details` as\n\t\t\t * a required property.\n\t\t\t *\n\t\t\t * This little and harmless trick silences that error.\n\t\t\t */\n\t\t\tthis.detail = options.detail!;\n\t\t}\n\t\tinitCustomEvent(): void {}\n\t}\n\tglobalThis.CustomEvent = CustomEvent;\n}\n","/**\n * Concatenates multiple Uint8Arrays into a single Uint8Array.\n *\n * @param arrays The arrays to concatenate.\n * @returns A new Uint8Array containing the contents of all the arrays.\n */\nexport function concatUint8Array(...arrays: Uint8Array[]) {\n\tconst result = new Uint8Array(\n\t\tarrays.reduce((sum, array) => sum + array.length, 0)\n\t);\n\tlet offset = 0;\n\tfor (const array of arrays) {\n\t\tresult.set(array, offset);\n\t\toffset += array.length;\n\t}\n\treturn result;\n}\n","import { concatUint8Array } from './concat-uint8-array';\n\n/**\n * Concatenates the contents of the stream into a single Uint8Array.\n *\n * @param totalBytes Optional. The number of bytes to concatenate. Used to\n * \t\t\t\t pre-allocate the buffer. If not provided, the buffer will\n * \t\t\t\t be dynamically resized as needed.\n * @returns A stream that will emit a single UInt8Array entry before closing.\n */\nexport function concatBytes(totalBytes?: number) {\n\tif (totalBytes === undefined) {\n\t\tlet acc = new Uint8Array();\n\t\treturn new TransformStream<Uint8Array, Uint8Array>({\n\t\t\ttransform(chunk) {\n\t\t\t\tacc = concatUint8Array(acc, chunk);\n\t\t\t},\n\n\t\t\tflush(controller) {\n\t\t\t\tcontroller.enqueue(acc);\n\t\t\t},\n\t\t});\n\t} else {\n\t\tconst buffer = new ArrayBuffer(totalBytes || 0);\n\t\tlet offset = 0;\n\t\treturn new TransformStream<Uint8Array, Uint8Array>({\n\t\t\ttransform(chunk) {\n\t\t\t\tconst view = new Uint8Array(buffer);\n\t\t\t\tview.set(chunk, offset);\n\t\t\t\toffset += chunk.byteLength;\n\t\t\t},\n\n\t\t\tflush(controller) {\n\t\t\t\tcontroller.enqueue(new Uint8Array(buffer));\n\t\t\t},\n\t\t});\n\t}\n}\n","import { concatBytes } from './concat-bytes';\nimport { limitBytes } from './limit-bytes';\n\n/**\n * Collects the contents of the entire stream into a single Uint8Array.\n *\n * @param stream The stream to collect.\n * @param bytes Optional. The number of bytes to read from the stream.\n * @returns The string contents of the stream.\n */\nexport async function collectBytes(\n\tstream: ReadableStream<Uint8Array>,\n\tbytes?: number\n) {\n\tif (bytes !== undefined) {\n\t\tstream = limitBytes(stream, bytes);\n\t}\n\n\treturn await stream\n\t\t.pipeThrough(concatBytes(bytes))\n\t\t.getReader()\n\t\t.read()\n\t\t.then(({ value }) => value!);\n}\n","import { collectBytes } from './collect-bytes';\n\n/**\n * Represents a file that is streamed and not fully\n * loaded into memory.\n */\nexport class StreamedFile extends File {\n\treadonly filesize: number | undefined;\n\n\tprivate readableStream: ReadableStream<Uint8Array>;\n\n\t/**\n\t * Creates a new StreamedFile instance.\n\t *\n\t * @param readableStream The readable stream containing the file data.\n\t * @param name The name of the file.\n\t * @param options An object containing options such as the MIME type and file size.\n\t */\n\tconstructor(\n\t\treadableStream: ReadableStream<Uint8Array>,\n\t\tname: string,\n\t\toptions?: { type?: string; filesize?: number }\n\t) {\n\t\tsuper([], name, { type: options?.type });\n\t\tthis.readableStream = readableStream;\n\t\tthis.filesize = options?.filesize;\n\t}\n\n\t/**\n\t * Overrides the slice() method of the File class.\n\t *\n\t * @returns A Blob representing a portion of the file.\n\t */\n\toverride slice(): Blob {\n\t\tthrow new Error('slice() is not possible on a StreamedFile');\n\t}\n\n\t/**\n\t * Returns the readable stream associated with the file.\n\t *\n\t * @returns The readable stream.\n\t */\n\toverride stream() {\n\t\treturn this.readableStream;\n\t}\n\n\t/**\n\t * Loads the file data into memory and then returns it as a string.\n\t *\n\t * @returns File data as text.\n\t */\n\toverride async text() {\n\t\treturn new TextDecoder().decode(await this.arrayBuffer());\n\t}\n\n\t/**\n\t * Loads the file data into memory and then returns it as an ArrayBuffer.\n\t *\n\t * @returns File data as an ArrayBuffer.\n\t */\n\toverride async arrayBuffer() {\n\t\treturn await collectBytes(this.stream());\n\t}\n}\n","/**\n * Polyfill for ReadableStream[Symbol.asyncIterator]\n * This enables the use of for-await-of loops with ReadableStreams\n *\n * @example\n * ```ts\n * for await (const entry of stream) {\n * \t // ...\n * }\n * ```\n */\n// @ts-ignore\nif (!ReadableStream.prototype[Symbol.asyncIterator]) {\n\t// @ts-ignore\n\tReadableStream.prototype[Symbol.asyncIterator] = async function* () {\n\t\tconst reader = this.getReader();\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tyield value;\n\t\t\t}\n\t\t} finally {\n\t\t\treader.releaseLock();\n\t\t}\n\t};\n\t// @ts-ignore\n\tReadableStream.prototype.iterate =\n\t\t// @ts-ignore\n\t\tReadableStream.prototype[Symbol.asyncIterator];\n}\n\nexport type IterableReadableStream<R> = ReadableStream<R> & AsyncIterable<R>;\n","import { Semaphore } from '@php-wasm/util';\nimport { filterStream } from '../utils/filter-stream';\nimport { concatUint8Array } from '../utils/concat-uint8-array';\nimport { collectBytes } from '../utils/collect-bytes';\nimport {\n\treadCentralDirectoryEntry,\n\treadFileEntry,\n\tdecodeZip,\n} from './decode-zip';\nimport type { CentralDirectoryEntry, FileEntry } from './types';\nimport { SIGNATURE_CENTRAL_DIRECTORY_END } from './types';\nimport type { IterableReadableStream } from '../utils/iterable-stream-polyfill';\n\nconst CENTRAL_DIRECTORY_END_SCAN_CHUNK_SIZE = 110 * 1024;\nconst BATCH_DOWNLOAD_OF_FILES_IF_CLOSER_THAN = 10 * 1024;\nconst PREFER_RANGES_IF_FILE_LARGER_THAN = 1024 * 1024 * 1;\nconst fetchSemaphore = new Semaphore({ concurrency: 10 });\n\nconst DEFAULT_PREDICATE = () => true;\n\n/**\n * Streams the contents of a remote zip file.\n *\n * If the zip is large and the predicate is filtering the zip contents,\n * only the matching files will be downloaded using the Range header\n * (if supported by the server).\n *\n * @param url The URL of the zip file.\n * @param predicate Optional. A function that returns true if the file should be downloaded.\n * @returns A stream of zip entries.\n */\nexport async function decodeRemoteZip(\n\turl: string,\n\tpredicate: (\n\t\tdirEntry: CentralDirectoryEntry | FileEntry\n\t) => boolean = DEFAULT_PREDICATE\n) {\n\tif (predicate === DEFAULT_PREDICATE) {\n\t\t// If we're not filtering the zip contents, let's just\n\t\t// grab the entire zip.\n\t\tconst response = await fetch(url);\n\t\treturn decodeZip(response.body!);\n\t}\n\n\tconst contentLength = await fetchContentLength(url);\n\tif (contentLength <= PREFER_RANGES_IF_FILE_LARGER_THAN) {\n\t\t// If the zip is small enough, let's just grab it.\n\t\tconst response = await fetch(url);\n\t\treturn decodeZip(response.body!);\n\t}\n\n\t// Ensure ranges query support:\n\t// Fetch one byte\n\tconst response = await fetch(url, {\n\t\theaders: {\n\t\t\t// 0-0 looks weird, doesn't it?\n\t\t\t// The Range header is inclusive so it's actually\n\t\t\t// a valid header asking for the first byte.\n\t\t\tRange: 'bytes=0-0',\n\t\t\t'Accept-Encoding': 'none',\n\t\t},\n\t});\n\n\t// Fork the stream so that we can reuse it in case\n\t// the Range header is unsupported and we're now streaming\n\t// the entire file\n\tconst [peekStream, responseStream] = response.body!.tee();\n\n\t// Read from the forked stream and close it.\n\tconst peekReader = peekStream.getReader();\n\tconst { value: peekBytes } = await peekReader.read();\n\tconst { done: peekDone } = await peekReader.read();\n\tpeekReader.releaseLock();\n\tpeekStream.cancel();\n\n\t// Confirm our Range query worked as intended:\n\tconst rangesSupported = peekBytes?.length === 1 && peekDone;\n\tif (!rangesSupported) {\n\t\t// Uh-oh, we're actually streaming the entire file.\n\t\t// Let's reuse the forked stream as our response stream.\n\t\treturn decodeZip(responseStream);\n\t}\n\n\t// We're good, let's clean up the other branch of the response stream.\n\tresponseStream.cancel();\n\tconst source = await createFetchSource(url, contentLength);\n\treturn streamCentralDirectoryEntries(source)\n\t\t.pipeThrough(filterStream(predicate))\n\t\t.pipeThrough(partitionNearbyEntries())\n\t\t.pipeThrough(\n\t\t\tfetchPartitionedEntries(source)\n\t\t) as IterableReadableStream<FileEntry>;\n}\n\n/**\n * Streams the central directory entries of a zip file.\n *\n * @param source\n * @returns\n */\nfunction streamCentralDirectoryEntries(source: BytesSource) {\n\tlet centralDirectoryStream: ReadableStream<Uint8Array>;\n\n\treturn new ReadableStream<CentralDirectoryEntry>({\n\t\tasync start() {\n\t\t\tcentralDirectoryStream = await streamCentralDirectoryBytes(source);\n\t\t},\n\t\tasync pull(controller) {\n\t\t\tconst entry = await readCentralDirectoryEntry(\n\t\t\t\tcentralDirectoryStream\n\t\t\t);\n\t\t\tif (!entry) {\n\t\t\t\tcontroller.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcontroller.enqueue(entry);\n\t\t},\n\t});\n}\n\n/**\n * Streams the central directory bytes of a zip file.\n *\n * @param source\n * @returns\n */\nasync function streamCentralDirectoryBytes(source: BytesSource) {\n\tconst chunkSize = CENTRAL_DIRECTORY_END_SCAN_CHUNK_SIZE;\n\tlet centralDirectory: Uint8Array = new Uint8Array();\n\n\tlet chunkStart = source.length;\n\tdo {\n\t\tchunkStart = Math.max(0, chunkStart - chunkSize);\n\t\tconst chunkEnd = Math.min(\n\t\t\tchunkStart + chunkSize - 1,\n\t\t\tsource.length - 1\n\t\t);\n\t\tconst bytes = await collectBytes(\n\t\t\tawait source.streamBytes(chunkStart, chunkEnd)\n\t\t);\n\t\tcentralDirectory = concatUint8Array(bytes!, centralDirectory);\n\n\t\t// Scan the buffer for the signature\n\t\tconst view = new DataView(bytes!.buffer);\n\t\tfor (let i = view.byteLength - 4; i >= 0; i--) {\n\t\t\tif (view.getUint32(i, true) !== SIGNATURE_CENTRAL_DIRECTORY_END) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Confirm we have enough data to read the offset and the\n\t\t\t// length of the central directory.\n\t\t\tconst centralDirectoryLengthAt = i + 12;\n\t\t\tconst centralDirectoryOffsetAt = centralDirectoryLengthAt + 4;\n\t\t\tif (centralDirectory.byteLength < centralDirectoryOffsetAt + 4) {\n\t\t\t\tthrow new Error('Central directory not found');\n\t\t\t}\n\n\t\t\t// Read where the central directory starts\n\t\t\tconst dirStart = view.getUint32(centralDirectoryOffsetAt, true);\n\t\t\tif (dirStart < chunkStart) {\n\t\t\t\t// We're missing some bytes, let's grab them\n\t\t\t\tconst missingBytes = await collectBytes(\n\t\t\t\t\tawait source.streamBytes(dirStart, chunkStart - 1)\n\t\t\t\t);\n\t\t\t\tcentralDirectory = concatUint8Array(\n\t\t\t\t\tmissingBytes!,\n\t\t\t\t\tcentralDirectory\n\t\t\t\t);\n\t\t\t} else if (dirStart > chunkStart) {\n\t\t\t\t// We've read too many bytes, let's trim them\n\t\t\t\tcentralDirectory = centralDirectory.slice(\n\t\t\t\t\tdirStart - chunkStart\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn new Blob([centralDirectory]).stream();\n\t\t}\n\t} while (chunkStart >= 0);\n\n\tthrow new Error('Central directory not found');\n}\n\n/**\n * Partitions files that are no further apart in the zip\n * archive than BATCH_DOWNLOAD_OF_FILES_IF_CLOSER_THAN.\n * It may download some extra files living within the gaps\n * between the partitions.\n */\nfunction partitionNearbyEntries() {\n\tlet lastFileEndsAt = 0;\n\tlet currentChunk: CentralDirectoryEntry[] = [];\n\treturn new TransformStream<CentralDirectoryEntry, CentralDirectoryEntry[]>({\n\t\ttransform(zipEntry, controller) {\n\t\t\t// Byte distance too large, flush and start a new chunk\n\t\t\tif (\n\t\t\t\tzipEntry.firstByteAt >\n\t\t\t\tlastFileEndsAt + BATCH_DOWNLOAD_OF_FILES_IF_CLOSER_THAN\n\t\t\t) {\n\t\t\t\tcontroller.enqueue(currentChunk);\n\t\t\t\tcurrentChunk = [];\n\t\t\t}\n\t\t\tlastFileEndsAt = zipEntry.lastByteAt;\n\t\t\tcurrentChunk.push(zipEntry);\n\t\t},\n\t\tflush(controller) {\n\t\t\tcontroller.enqueue(currentChunk);\n\t\t},\n\t});\n}\n\n/**\n * Fetches a chunk of files from the zip archive.\n *\n * If any extra files are present in the received\n * bytes stream, they are filtered out.\n */\nfunction fetchPartitionedEntries(\n\tsource: BytesSource\n): ReadableWritablePair<FileEntry, CentralDirectoryEntry[]> {\n\t/**\n\t * This function implements a ReadableStream and a WritableStream\n\t * instead of a TransformStream. This is intentional.\n\t *\n\t * In TransformStream, the `transform` function may return a\n\t * promise. The next call to `transform` will be delayed until\n\t * the promise resolves. This is a problem for us because we\n\t * want to issue many fetch() requests in parallel.\n\t *\n\t * The only way to do that seems to be creating separate ReadableStream\n\t * and WritableStream implementations.\n\t */\n\tlet isWritableClosed = false;\n\tlet requestsInProgress = 0;\n\tlet readableController: ReadableStreamDefaultController<FileEntry>;\n\tconst byteStreams: Array<\n\t\t[CentralDirectoryEntry[], ReadableStream<Uint8Array>]\n\t> = [];\n\t/**\n\t * Receives chunks of CentralDirectoryEntries, and fetches\n\t * the corresponding byte ranges from the remote zip file.\n\t */\n\tconst writable = new WritableStream<CentralDirectoryEntry[]>({\n\t\twrite(zipEntries, controller) {\n\t\t\tif (!zipEntries.length) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t++requestsInProgress;\n\t\t\t// If the write() method returns a promise, the next\n\t\t\t// call will be delayed until the promise resolves.\n\t\t\t// Let's not return the promise, then.\n\t\t\t// This will effectively issue many requests in parallel.\n\t\t\trequestChunkRange(source, zipEntries)\n\t\t\t\t.then((byteStream) => {\n\t\t\t\t\tbyteStreams.push([zipEntries, byteStream]);\n\t\t\t\t})\n\t\t\t\t.catch((e) => {\n\t\t\t\t\tcontroller.error(e);\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\t--requestsInProgress;\n\t\t\t\t});\n\t\t},\n\t\tabort() {\n\t\t\tisWritableClosed = true;\n\t\t\treadableController.close();\n\t\t},\n\t\tasync close() {\n\t\t\tisWritableClosed = true;\n\t\t},\n\t});\n\t/**\n\t * Decodes zipped bytes into FileEntry objects.\n\t */\n\tconst readable = new ReadableStream<FileEntry>({\n\t\tstart(controller) {\n\t\t\treadableController = controller;\n\t\t},\n\t\tasync pull(controller) {\n\t\t\twhile (true) {\n\t\t\t\tconst allChunksProcessed =\n\t\t\t\t\tisWritableClosed &&\n\t\t\t\t\t!byteStreams.length &&\n\t\t\t\t\trequestsInProgress === 0;\n\t\t\t\tif (allChunksProcessed) {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// There's no bytes available, but the writable\n\t\t\t\t// stream is still open or there are still requests\n\t\t\t\t// in progress. Let's wait for more bytes.\n\t\t\t\tconst waitingForMoreBytes = !byteStreams.length;\n\t\t\t\tif (waitingForMoreBytes) {\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 50));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst [requestedPaths, stream] = byteStreams[0];\n\t\t\t\tconst file = await readFileEntry(stream);\n\t\t\t\t// The stream is exhausted, let's remove it from the queue\n\t\t\t\t// and try the next one.\n\t\t\t\tconst streamExhausted = !file;\n\t\t\t\tif (streamExhausted) {\n\t\t\t\t\tbyteStreams.shift();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// There may be some extra files between the ones we're\n\t\t\t\t// interested in. Let's filter out any files that got\n\t\t\t\t// intertwined in the byte stream.\n\t\t\t\tconst isOneOfRequestedPaths = requestedPaths.find(\n\t\t\t\t\t(entry) => entry.path === file.path\n\t\t\t\t);\n\t\t\t\tif (!isOneOfRequestedPaths) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Finally! We've got a file we're interested in.\n\t\t\t\tcontroller.enqueue(file);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t});\n\n\treturn {\n\t\treadable,\n\t\twritable,\n\t};\n}\n\n/**\n * Requests a chunk of bytes from the bytes source.\n *\n * @param source\n * @param zipEntries\n */\nasync function requestChunkRange(\n\tsource: BytesSource,\n\tzipEntries: CentralDirectoryEntry[]\n) {\n\tconst release = await fetchSemaphore.acquire();\n\ttry {\n\t\tconst lastZipEntry = zipEntries[zipEntries.length - 1];\n\t\tconst substream = await source.streamBytes(\n\t\t\tzipEntries[0].firstByteAt,\n\t\t\tlastZipEntry.lastByteAt\n\t\t);\n\t\treturn substream;\n\t} finally {\n\t\trelease();\n\t}\n}\n\n/**\n * Fetches the Content-Length header from a remote URL.\n */\nasync function fetchContentLength(url: string) {\n\treturn await fetch(url, { method: 'HEAD' })\n\t\t.then((response) => response.headers.get('Content-Length'))\n\t\t.then((contentLength) => {\n\t\t\tif (!contentLength) {\n\t\t\t\tthrow new Error('Content-Length header is missing');\n\t\t\t}\n\n\t\t\tconst parsedLength = parseInt(contentLength, 10);\n\t\t\tif (isNaN(parsedLength) || parsedLength < 0) {\n\t\t\t\tthrow new Error('Content-Length header is invalid');\n\t\t\t}\n\t\t\treturn parsedLength;\n\t\t});\n}\n\n/**\n * Private and experimental API: Range-based data sources.\n *\n * The idea is that if we can read arbitrary byte ranges from\n * a file, we can retrieve a specific subset of a zip file.\n */\ntype BytesSource = {\n\tlength: number;\n\tstreamBytes: (\n\t\tstart: number,\n\t\tend: number\n\t) => Promise<ReadableStream<Uint8Array>>;\n};\n\n/**\n * Creates a BytesSource enabling fetching ranges of bytes\n * from a remote URL.\n */\nasync function createFetchSource(\n\turl: string,\n\tcontentLength?: number\n): Promise<BytesSource> {\n\tif (contentLength === undefined) {\n\t\tcontentLength = await fetchContentLength(url);\n\t}\n\n\treturn {\n\t\tlength: contentLength,\n\t\tstreamBytes: async (from: number, to: number) =>\n\t\t\tawait fetch(url, {\n\t\t\t\theaders: {\n\t\t\t\t\t// The Range header is inclusive, so we need to subtract 1\n\t\t\t\t\tRange: `bytes=${from}-${to - 1}`,\n\t\t\t\t\t'Accept-Encoding': 'none',\n\t\t\t\t},\n\t\t\t}).then((response) => response.body!),\n\t};\n}\n","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.\n * JZlib is based on zlib-1.1.3, so all credit should go authors\n * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)\n * and contributors of zlib.\n */\n\n// deno-lint-ignore-file no-this-alias prefer-const\n\n// Global\n\nconst MAX_BITS = 15;\nconst D_CODES = 30;\nconst BL_CODES = 19;\n\nconst LENGTH_CODES = 29;\nconst LITERALS = 256;\nconst L_CODES = (LITERALS + 1 + LENGTH_CODES);\nconst HEAP_SIZE = (2 * L_CODES + 1);\n\nconst END_BLOCK = 256;\n\n// Bit length codes must not exceed MAX_BL_BITS bits\nconst MAX_BL_BITS = 7;\n\n// repeat previous bit length 3-6 times (2 bits of repeat count)\nconst REP_3_6 = 16;\n\n// repeat a zero length 3-10 times (3 bits of repeat count)\nconst REPZ_3_10 = 17;\n\n// repeat a zero length 11-138 times (7 bits of repeat count)\nconst REPZ_11_138 = 18;\n\n// The lengths of the bit length codes are sent in order of decreasing\n// probability, to avoid transmitting the lengths for unused bit\n// length codes.\n\nconst Buf_size = 8 * 2;\n\n// JZlib version : \"1.0.2\"\nconst Z_DEFAULT_COMPRESSION = -1;\n\n// compression strategy\nconst Z_FILTERED = 1;\nconst Z_HUFFMAN_ONLY = 2;\nconst Z_DEFAULT_STRATEGY = 0;\n\nconst Z_NO_FLUSH = 0;\nconst Z_PARTIAL_FLUSH = 1;\nconst Z_FULL_FLUSH = 3;\nconst Z_FINISH = 4;\n\nconst Z_OK = 0;\nconst Z_STREAM_END = 1;\nconst Z_NEED_DICT = 2;\nconst Z_STREAM_ERROR = -2;\nconst Z_DATA_ERROR = -3;\nconst Z_BUF_ERROR = -5;\n\n// Tree\n\nfunction extractArray(array) {\n\treturn flatArray(array.map(([length, value]) => (new Array(length)).fill(value, 0, length)));\n}\n\nfunction flatArray(array) {\n\treturn array.reduce((a, b) => a.concat(Array.isArray(b) ? flatArray(b) : b), []);\n}\n\n// see definition of array dist_code below\nconst _dist_code = [0, 1, 2, 3].concat(...extractArray([\n\t[2, 4], [2, 5], [4, 6], [4, 7], [8, 8], [8, 9], [16, 10], [16, 11], [32, 12], [32, 13], [64, 14], [64, 15], [2, 0], [1, 16],\n\t[1, 17], [2, 18], [2, 19], [4, 20], [4, 21], [8, 22], [8, 23], [16, 24], [16, 25], [32, 26], [32, 27], [64, 28], [64, 29]\n]));\n\nfunction Tree() {\n\tconst that = this;\n\n\t// dyn_tree; // the dynamic tree\n\t// max_code; // largest code with non zero frequency\n\t// stat_desc; // the corresponding static tree\n\n\t// Compute the optimal bit lengths for a tree and update the total bit\n\t// length\n\t// for the current block.\n\t// IN assertion: the fields freq and dad are set, heap[heap_max] and\n\t// above are the tree nodes sorted by increasing frequency.\n\t// OUT assertions: the field len is set to the optimal bit length, the\n\t// array bl_count contains the frequencies for each bit length.\n\t// The length opt_len is updated; static_len is also updated if stree is\n\t// not null.\n\tfunction gen_bitlen(s) {\n\t\tconst tree = that.dyn_tree;\n\t\tconst stree = that.stat_desc.static_tree;\n\t\tconst extra = that.stat_desc.extra_bits;\n\t\tconst base = that.stat_desc.extra_base;\n\t\tconst max_length = that.stat_desc.max_length;\n\t\tlet h; // heap index\n\t\tlet n, m; // iterate over the tree elements\n\t\tlet bits; // bit length\n\t\tlet xbits; // extra bits\n\t\tlet f; // frequency\n\t\tlet overflow = 0; // number of elements with bit length too large\n\n\t\tfor (bits = 0; bits <= MAX_BITS; bits++)\n\t\t\ts.bl_count[bits] = 0;\n\n\t\t// In a first pass, compute the optimal bit lengths (which may\n\t\t// overflow in the case of the bit length tree).\n\t\ttree[s.heap[s.heap_max] * 2 + 1] = 0; // root of the heap\n\n\t\tfor (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t\t\tn = s.heap[h];\n\t\t\tbits = tree[tree[n * 2 + 1] * 2 + 1] + 1;\n\t\t\tif (bits > max_length) {\n\t\t\t\tbits = max_length;\n\t\t\t\toverflow++;\n\t\t\t}\n\t\t\ttree[n * 2 + 1] = bits;\n\t\t\t// We overwrite tree[n*2+1] which is no longer needed\n\n\t\t\tif (n > that.max_code)\n\t\t\t\tcontinue; // not a leaf node\n\n\t\t\ts.bl_count[bits]++;\n\t\t\txbits = 0;\n\t\t\tif (n >= base)\n\t\t\t\txbits = extra[n - base];\n\t\t\tf = tree[n * 2];\n\t\t\ts.opt_len += f * (bits + xbits);\n\t\t\tif (stree)\n\t\t\t\ts.static_len += f * (stree[n * 2 + 1] + xbits);\n\t\t}\n\t\tif (overflow === 0)\n\t\t\treturn;\n\n\t\t// This happens for example on obj2 and pic of the Calgary corpus\n\t\t// Find the first bit length which could increase:\n\t\tdo {\n\t\t\tbits = max_length - 1;\n\t\t\twhile (s.bl_count[bits] === 0)\n\t\t\t\tbits--;\n\t\t\ts.bl_count[bits]--; // move one leaf down the tree\n\t\t\ts.bl_count[bits + 1] += 2; // move one overflow item as its brother\n\t\t\ts.bl_count[max_length]--;\n\t\t\t// The brother of the overflow item also moves one step up,\n\t\t\t// but this does not affect bl_count[max_length]\n\t\t\toverflow -= 2;\n\t\t} while (overflow > 0);\n\n\t\tfor (bits = max_length; bits !== 0; bits--) {\n\t\t\tn = s.bl_count[bits];\n\t\t\twhile (n !== 0) {\n\t\t\t\tm = s.heap[--h];\n\t\t\t\tif (m > that.max_code)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (tree[m * 2 + 1] != bits) {\n\t\t\t\t\ts.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];\n\t\t\t\t\ttree[m * 2 + 1] = bits;\n\t\t\t\t}\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reverse the first len bits of a code, using straightforward code (a\n\t// faster\n\t// method would use a table)\n\t// IN assertion: 1 <= len <= 15\n\tfunction bi_reverse(code, // the value to invert\n\t\tlen // its bit length\n\t) {\n\t\tlet res = 0;\n\t\tdo {\n\t\t\tres |= code & 1;\n\t\t\tcode >>>= 1;\n\t\t\tres <<= 1;\n\t\t} while (--len > 0);\n\t\treturn res >>> 1;\n\t}\n\n\t// Generate the codes for a given tree and bit counts (which need not be\n\t// optimal).\n\t// IN assertion: the array bl_count contains the bit length statistics for\n\t// the given tree and the field len is set for all tree elements.\n\t// OUT assertion: the field code is set for all tree elements of non\n\t// zero code length.\n\tfunction gen_codes(tree, // the tree to decorate\n\t\tmax_code, // largest code with non zero frequency\n\t\tbl_count // number of codes at each bit length\n\t) {\n\t\tconst next_code = []; // next code value for each\n\t\t// bit length\n\t\tlet code = 0; // running code value\n\t\tlet bits; // bit index\n\t\tlet n; // code index\n\t\tlet len;\n\n\t\t// The distribution counts are first used to generate the code values\n\t\t// without bit reversal.\n\t\tfor (bits = 1; bits <= MAX_BITS; bits++) {\n\t\t\tnext_code[bits] = code = ((code + bl_count[bits - 1]) << 1);\n\t\t}\n\n\t\t// Check that the bit counts in bl_count are consistent. The last code\n\t\t// must be all ones.\n\t\t// Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t\t// \"inconsistent bit counts\");\n\t\t// Tracev((stderr,\"gen_codes: max_code %d \", max_code));\n\n\t\tfor (n = 0; n <= max_code; n++) {\n\t\t\tlen = tree[n * 2 + 1];\n\t\t\tif (len === 0)\n\t\t\t\tcontinue;\n\t\t\t// Now reverse the bits\n\t\t\ttree[n * 2] = bi_reverse(next_code[len]++, len);\n\t\t}\n\t}\n\n\t// Construct one Huffman tree and assigns the code bit strings and lengths.\n\t// Update the total bit length for the current block.\n\t// IN assertion: the field freq is set for all tree elements.\n\t// OUT assertions: the fields len and code are set to the optimal bit length\n\t// and corresponding code. The length opt_len is updated; static_len is\n\t// also updated if stree is not null. The field max_code is set.\n\tthat.build_tree = function (s) {\n\t\tconst tree = that.dyn_tree;\n\t\tconst stree = that.stat_desc.static_tree;\n\t\tconst elems = that.stat_desc.elems;\n\t\tlet n, m; // iterate over heap elements\n\t\tlet max_code = -1; // largest code with non zero frequency\n\t\tlet node; // new node being created\n\n\t\t// Construct the initial heap, with least frequent element in\n\t\t// heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n\t\t// heap[0] is not used.\n\t\ts.heap_len = 0;\n\t\ts.heap_max = HEAP_SIZE;\n\n\t\tfor (n = 0; n < elems; n++) {\n\t\t\tif (tree[n * 2] !== 0) {\n\t\t\t\ts.heap[++s.heap_len] = max_code = n;\n\t\t\t\ts.depth[n] = 0;\n\t\t\t} else {\n\t\t\t\ttree[n * 2 + 1] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// The pkzip format requires that at least one distance code exists,\n\t\t// and that at least one bit should be sent even if there is only one\n\t\t// possible code. So to avoid special checks later on we force at least\n\t\t// two codes of non zero frequency.\n\t\twhile (s.heap_len < 2) {\n\t\t\tnode = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n\t\t\ttree[node * 2] = 1;\n\t\t\ts.depth[node] = 0;\n\t\t\ts.opt_len--;\n\t\t\tif (stree)\n\t\t\t\ts.static_len -= stree[node * 2 + 1];\n\t\t\t// node is 0 or 1 so it does not have extra bits\n\t\t}\n\t\tthat.max_code = max_code;\n\n\t\t// The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n\t\t// establish sub-heaps of increasing lengths:\n\n\t\tfor (n = Math.floor(s.heap_len / 2); n >= 1; n--)\n\t\t\ts.pqdownheap(tree, n);\n\n\t\t// Construct the Huffman tree by repeatedly combining the least two\n\t\t// frequent nodes.\n\n\t\tnode = elems; // next internal node of the tree\n\t\tdo {\n\t\t\t// n = node of least frequency\n\t\t\tn = s.heap[1];\n\t\t\ts.heap[1] = s.heap[s.heap_len--];\n\t\t\ts.pqdownheap(tree, 1);\n\t\t\tm = s.heap[1]; // m = node of next least frequency\n\n\t\t\ts.heap[--s.heap_max] = n; // keep the nodes sorted by frequency\n\t\t\ts.heap[--s.heap_max] = m;\n\n\t\t\t// Create a new node father of n and m\n\t\t\ttree[node * 2] = (tree[n * 2] + tree[m * 2]);\n\t\t\ts.depth[node] = Math.max(s.depth[n], s.depth[m]) + 1;\n\t\t\ttree[n * 2 + 1] = tree[m * 2 + 1] = node;\n\n\t\t\t// and insert the new node in the heap\n\t\t\ts.heap[1] = node++;\n\t\t\ts.pqdownheap(tree, 1);\n\t\t} while (s.heap_len >= 2);\n\n\t\ts.heap[--s.heap_max] = s.heap[1];\n\n\t\t// At this point, the fields freq and dad are set. We can now\n\t\t// generate the bit lengths.\n\n\t\tgen_bitlen(s);\n\n\t\t// The field len is now set, we can generate the bit codes\n\t\tgen_codes(tree, that.max_code, s.bl_count);\n\t};\n\n}\n\nTree._length_code = [0, 1, 2, 3, 4, 5, 6, 7].concat(...extractArray([\n\t[2, 8], [2, 9], [2, 10], [2, 11], [4, 12], [4, 13], [4, 14], [4, 15], [8, 16], [8, 17], [8, 18], [8, 19],\n\t[16, 20], [16, 21], [16, 22], [16, 23], [32, 24], [32, 25], [32, 26], [31, 27], [1, 28]]));\n\nTree.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0];\n\nTree.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384,\n\t24576];\n\n// Mapping from a distance to a distance code. dist is the distance - 1 and\n// must not have side effects. _dist_code[256] and _dist_code[257] are never\n// used.\nTree.d_code = function (dist) {\n\treturn ((dist) < 256 ? _dist_code[dist] : _dist_code[256 + ((dist) >>> 7)]);\n};\n\n// extra bits for each length code\nTree.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0];\n\n// extra bits for each distance code\nTree.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];\n\n// extra bits for each bit length code\nTree.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];\n\nTree.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n\n// StaticTree\n\nfunction StaticTree(static_tree, extra_bits, extra_base, elems, max_length) {\n\tconst that = this;\n\tthat.static_tree = static_tree;\n\tthat.extra_bits = extra_bits;\n\tthat.extra_base = extra_base;\n\tthat.elems = elems;\n\tthat.max_length = max_length;\n}\n\nconst static_ltree2_first_part = [12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82,\n\t210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86,\n\t214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81,\n\t209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85,\n\t213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 19, 275, 147, 403, 83, 339, 211, 467, 51, 307,\n\t179, 435, 115, 371, 243, 499, 11, 267, 139, 395, 75, 331, 203, 459, 43, 299, 171, 427, 107, 363, 235, 491, 27, 283, 155, 411, 91, 347, 219, 475,\n\t59, 315, 187, 443, 123, 379, 251, 507, 7, 263, 135, 391, 71, 327, 199, 455, 39, 295, 167, 423, 103, 359, 231, 487, 23, 279, 151, 407, 87, 343, 215,\n\t471, 55, 311, 183, 439, 119, 375, 247, 503, 15, 271, 143, 399, 79, 335, 207, 463, 47, 303, 175, 431, 111, 367, 239, 495, 31, 287, 159, 415, 95,\n\t351, 223, 479, 63, 319, 191, 447, 127, 383, 255, 511, 0, 64, 32, 96, 16, 80, 48, 112, 8, 72, 40, 104, 24, 88, 56, 120, 4, 68, 36, 100, 20, 84, 52,\n\t116, 3, 131, 67, 195, 35, 163, 99, 227];\nconst static_ltree2_second_part = extractArray([[144, 8], [112, 9], [24, 7], [8, 8]]);\nStaticTree.static_ltree = flatArray(static_ltree2_first_part.map((value, index) => [value, static_ltree2_second_part[index]]));\n\nconst static_dtree_first_part = [0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23];\nconst static_dtree_second_part = extractArray([[30, 5]]);\nStaticTree.static_dtree = flatArray(static_dtree_first_part.map((value, index) => [value, static_dtree_second_part[index]]));\n\nStaticTree.static_l_desc = new StaticTree(StaticTree.static_ltree, Tree.extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\nStaticTree.static_d_desc = new StaticTree(StaticTree.static_dtree, Tree.extra_dbits, 0, D_CODES, MAX_BITS);\n\nStaticTree.static_bl_desc = new StaticTree(null, Tree.extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n// Deflate\n\nconst MAX_MEM_LEVEL = 9;\nconst DEF_MEM_LEVEL = 8;\n\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\tconst that = this;\n\tthat.good_length = good_length;\n\tthat.max_lazy = max_lazy;\n\tthat.nice_length = nice_length;\n\tthat.max_chain = max_chain;\n\tthat.func = func;\n}\n\nconst STORED = 0;\nconst FAST = 1;\nconst SLOW = 2;\nconst config_table = [\n\tnew Config(0, 0, 0, 0, STORED),\n\tnew Config(4, 4, 8, 4, FAST),\n\tnew Config(4, 5, 16, 8, FAST),\n\tnew Config(4, 6, 32, 32, FAST),\n\tnew Config(4, 4, 16, 16, SLOW),\n\tnew Config(8, 16, 32, 32, SLOW),\n\tnew Config(8, 16, 128, 128, SLOW),\n\tnew Config(8, 32, 128, 256, SLOW),\n\tnew Config(32, 128, 258, 1024, SLOW),\n\tnew Config(32, 258, 258, 4096, SLOW)\n];\n\nconst z_errmsg = [\"need dictionary\", // Z_NEED_DICT\n\t// 2\n\t\"stream end\", // Z_STREAM_END 1\n\t\"\", // Z_OK 0\n\t\"\", // Z_ERRNO (-1)\n\t\"stream error\", // Z_STREAM_ERROR (-2)\n\t\"data error\", // Z_DATA_ERROR (-3)\n\t\"\", // Z_MEM_ERROR (-4)\n\t\"buffer error\", // Z_BUF_ERROR (-5)\n\t\"\",// Z_VERSION_ERROR (-6)\n\t\"\"];\n\n// block not completed, need more input or more output\nconst NeedMore = 0;\n\n// block flush performed\nconst BlockDone = 1;\n\n// finish started, need only more output at next deflate\nconst FinishStarted = 2;\n\n// finish done, accept no more input or output\nconst FinishDone = 3;\n\n// preset dictionary flag in zlib header\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42;\nconst BUSY_STATE = 113;\nconst FINISH_STATE = 666;\n\n// The deflate compression method\nconst Z_DEFLATED = 8;\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nfunction smaller(tree, n, m, depth) {\n\tconst tn2 = tree[n * 2];\n\tconst tm2 = tree[m * 2];\n\treturn (tn2 < tm2 || (tn2 == tm2 && depth[n] <= depth[m]));\n}\n\nfunction Deflate() {\n\n\tconst that = this;\n\tlet strm; // pointer back to this zlib stream\n\tlet status; // as the name implies\n\t// pending_buf; // output still pending\n\tlet pending_buf_size; // size of pending_buf\n\t// pending_out; // next pending byte to output to the stream\n\t// pending; // nb of bytes in the pending buffer\n\n\t// dist_buf; // buffer for distances\n\t// lc_buf; // buffer for literals or lengths\n\t// To simplify the code, dist_buf and lc_buf have the same number of elements.\n\t// To use different lengths, an extra flag array would be necessary.\n\n\tlet last_flush; // value of flush param for previous deflate call\n\n\tlet w_size; // LZ77 win size (32K by default)\n\tlet w_bits; // log2(w_size) (8..16)\n\tlet w_mask; // w_size - 1\n\n\tlet win;\n\t// Sliding win. Input bytes are read into the second half of the win,\n\t// and move to the first half later to keep a dictionary of at least wSize\n\t// bytes. With this organization, matches are limited to a distance of\n\t// wSize-MAX_MATCH bytes, but this ensures that IO is always\n\t// performed with a length multiple of the block size. Also, it limits\n\t// the win size to 64K, which is quite useful on MSDOS.\n\t// To do: use the user input buffer as sliding win.\n\n\tlet window_size;\n\t// Actual size of win: 2*wSize, except when the user input buffer\n\t// is directly used as sliding win.\n\n\tlet prev;\n\t// Link to older string with same hash index. To limit the size of this\n\t// array to 64K, this link is maintained only for the last 32K strings.\n\t// An index in this array is thus a win index modulo 32K.\n\n\tlet head; // Heads of the hash chains or NIL.\n\n\tlet ins_h; // hash index of string to be inserted\n\tlet hash_size; // number of elements in hash table\n\tlet hash_bits; // log2(hash_size)\n\tlet hash_mask; // hash_size-1\n\n\t// Number of bits by which ins_h must be shifted at each input\n\t// step. It must be such that after MIN_MATCH steps, the oldest\n\t// byte no longer takes part in the hash key, that is:\n\t// hash_shift * MIN_MATCH >= hash_bits\n\tlet hash_shift;\n\n\t// Window position at the beginning of the current output block. Gets\n\t// negative when the win is moved backwards.\n\n\tlet block_start;\n\n\tlet match_length; // length of best match\n\tlet prev_match; // previous match\n\tlet match_available; // set if previous match exists\n\tlet strstart; // start of string to insert\n\tlet match_start; // start of matching string\n\tlet lookahead; // number of valid bytes ahead in win\n\n\t// Length of the best match at previous step. Matches not greater than this\n\t// are discarded. This is used in the lazy match evaluation.\n\tlet prev_length;\n\n\t// To speed up deflation, hash chains are never searched beyond this\n\t// length. A higher limit improves compression ratio but degrades the speed.\n\tlet max_chain_length;\n\n\t// Attempt to find a better match only when the current match is strictly\n\t// smaller than this value. This mechanism is used only for compression\n\t// levels >= 4.\n\tlet max_lazy_match;\n\n\t// Insert new strings in the hash table only if the match length is not\n\t// greater than this length. This saves time but degrades compression.\n\t// max_insert_length is used only for compression levels <= 3.\n\n\tlet level; // compression level (1..9)\n\tlet strategy; // favor or force Huffman coding\n\n\t// Use a faster search when the previous match is longer than this\n\tlet good_match;\n\n\t// Stop searching when current match exceeds this\n\tlet nice_match;\n\n\tlet dyn_ltree; // literal and length tree\n\tlet dyn_dtree; // distance tree\n\tlet bl_tree; // Huffman tree for bit lengths\n\n\tconst l_desc = new Tree(); // desc for literal tree\n\tconst d_desc = new Tree(); // desc for distance tree\n\tconst bl_desc = new Tree(); // desc for bit length tree\n\n\t// that.heap_len; // number of elements in the heap\n\t// that.heap_max; // element of largest frequency\n\t// The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n\t// The same heap array is used to build all trees.\n\n\t// Depth of each subtree used as tie breaker for trees of equal frequency\n\tthat.depth = [];\n\n\t// Size of match buffer for literals/lengths. There are 4 reasons for\n\t// limiting lit_bufsize to 64K:\n\t// - frequencies can be kept in 16 bit counters\n\t// - if compression is not successful for the first block, all input\n\t// data is still in the win so we can still emit a stored block even\n\t// when input comes from standard input. (This can also be done for\n\t// all blocks if lit_bufsize is not greater than 32K.)\n\t// - if compression is not successful for a file smaller than 64K, we can\n\t// even emit a stored file instead of a stored block (saving 5 bytes).\n\t// This is applicable only for zip (not gzip or zlib).\n\t// - creating new Huffman trees less frequently may not provide fast\n\t// adaptation to changes in the input data statistics. (Take for\n\t// example a binary file with poorly compressible code followed by\n\t// a highly compressible string table.) Smaller buffer sizes give\n\t// fast adaptation but have of course the overhead of transmitting\n\t// trees more frequently.\n\t// - I can't count above 4\n\tlet lit_bufsize;\n\n\tlet last_lit; // running index in dist_buf and lc_buf\n\n\t// that.opt_len; // bit length of current block with optimal trees\n\t// that.static_len; // bit length of current block with static trees\n\tlet matches; // number of string matches in current block\n\tlet last_eob_len; // bit length of EOB code for last block\n\n\t// Output buffer. bits are inserted starting at the bottom (least\n\t// significant bits).\n\tlet bi_buf;\n\n\t// Number of valid bits in bi_buf. All bits above the last valid bit\n\t// are always zero.\n\tlet bi_valid;\n\n\t// number of codes at each bit length for an optimal tree\n\tthat.bl_count = [];\n\n\t// heap used to build the Huffman trees\n\tthat.heap = [];\n\n\tdyn_ltree = [];\n\tdyn_dtree = [];\n\tbl_tree = [];\n\n\tfunction lm_init() {\n\t\twindow_size = 2 * w_size;\n\n\t\thead[hash_size - 1] = 0;\n\t\tfor (let i = 0; i < hash_size - 1; i++) {\n\t\t\thead[i] = 0;\n\t\t}\n\n\t\t// Set the default configuration parameters:\n\t\tmax_lazy_match = config_table[level].max_lazy;\n\t\tgood_match = config_table[level].good_length;\n\t\tnice_match = config_table[level].nice_length;\n\t\tmax_chain_length = config_table[level].max_chain;\n\n\t\tstrstart = 0;\n\t\tblock_start = 0;\n\t\tlookahead = 0;\n\t\tmatch_length = prev_length = MIN_MATCH - 1;\n\t\tmatch_available = 0;\n\t\tins_h = 0;\n\t}\n\n\tfunction init_block() {\n\t\tlet i;\n\t\t// Initialize the trees.\n\t\tfor (i = 0; i < L_CODES; i++)\n\t\t\tdyn_ltree[i * 2] = 0;\n\t\tfor (i = 0; i < D_CODES; i++)\n\t\t\tdyn_dtree[i * 2] = 0;\n\t\tfor (i = 0; i < BL_CODES; i++)\n\t\t\tbl_tree[i * 2] = 0;\n\n\t\tdyn_ltree[END_BLOCK * 2] = 1;\n\t\tthat.opt_len = that.static_len = 0;\n\t\tlast_lit = matches = 0;\n\t}\n\n\t// Initialize the tree data structures for a new zlib stream.\n\tfunction tr_init() {\n\n\t\tl_desc.dyn_tree = dyn_ltree;\n\t\tl_desc.stat_desc = StaticTree.static_l_desc;\n\n\t\td_desc.dyn_tree = dyn_dtree;\n\t\td_desc.stat_desc = StaticTree.static_d_desc;\n\n\t\tbl_desc.dyn_tree = bl_tree;\n\t\tbl_desc.stat_desc = StaticTree.static_bl_desc;\n\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t\tlast_eob_len = 8; // enough lookahead for inflate\n\n\t\t// Initialize the first block of the first file:\n\t\tinit_block();\n\t}\n\n\t// Restore the heap property by moving down the tree starting at node k,\n\t// exchanging a node with the smallest of its two sons if necessary,\n\t// stopping\n\t// when the heap property is re-established (each father smaller than its\n\t// two sons).\n\tthat.pqdownheap = function (tree, // the tree to restore\n\t\tk // node to move down\n\t) {\n\t\tconst heap = that.heap;\n\t\tconst v = heap[k];\n\t\tlet j = k << 1; // left son of k\n\t\twhile (j <= that.heap_len) {\n\t\t\t// Set j to the smallest of the two sons:\n\t\t\tif (j < that.heap_len && smaller(tree, heap[j + 1], heap[j], that.depth)) {\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t// Exit if v is smaller than both sons\n\t\t\tif (smaller(tree, v, heap[j], that.depth))\n\t\t\t\tbreak;\n\n\t\t\t// Exchange v with the smallest son\n\t\t\theap[k] = heap[j];\n\t\t\tk = j;\n\t\t\t// And continue down the tree, setting j to the left son of k\n\t\t\tj <<= 1;\n\t\t}\n\t\theap[k] = v;\n\t};\n\n\t// Scan a literal or distance tree to determine the frequencies of the codes\n\t// in the bit length tree.\n\tfunction scan_tree(tree,// the tree to be scanned\n\t\tmax_code // and its largest code of non zero frequency\n\t) {\n\t\tlet prevlen = -1; // last emitted length\n\t\tlet curlen; // length of current code\n\t\tlet nextlen = tree[0 * 2 + 1]; // length of next code\n\t\tlet count = 0; // repeat count of the current code\n\t\tlet max_count = 7; // max repeat count\n\t\tlet min_count = 4; // min repeat count\n\n\t\tif (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t}\n\t\ttree[(max_code + 1) * 2 + 1] = 0xffff; // guard\n\n\t\tfor (let n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t\tcontinue;\n\t\t\t} else if (count < min_count) {\n\t\t\t\tbl_tree[curlen * 2] += count;\n\t\t\t} else if (curlen !== 0) {\n\t\t\t\tif (curlen != prevlen)\n\t\t\t\t\tbl_tree[curlen * 2]++;\n\t\t\t\tbl_tree[REP_3_6 * 2]++;\n\t\t\t} else if (count <= 10) {\n\t\t\t\tbl_tree[REPZ_3_10 * 2]++;\n\t\t\t} else {\n\t\t\t\tbl_tree[REPZ_11_138 * 2]++;\n\t\t\t}\n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n\t\t\tif (nextlen === 0) {\n\t\t\t\tmax_count = 138;\n\t\t\t\tmin_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t\tmax_count = 6;\n\t\t\t\tmin_count = 3;\n\t\t\t} else {\n\t\t\t\tmax_count = 7;\n\t\t\t\tmin_count = 4;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Construct the Huffman tree for the bit lengths and return the index in\n\t// bl_order of the last bit length code to send.\n\tfunction build_bl_tree() {\n\t\tlet max_blindex; // index of last bit length code of non zero freq\n\n\t\t// Determine the bit length frequencies for literal and distance trees\n\t\tscan_tree(dyn_ltree, l_desc.max_code);\n\t\tscan_tree(dyn_dtree, d_desc.max_code);\n\n\t\t// Build the bit length tree:\n\t\tbl_desc.build_tree(that);\n\t\t// opt_len now includes the length of the tree representations, except\n\t\t// the lengths of the bit lengths codes and the 5+5+4 bits for the\n\t\t// counts.\n\n\t\t// Determine the number of bit length codes to send. The pkzip format\n\t\t// requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t// 3 but the actual value used is 4.)\n\t\tfor (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0)\n\t\t\t\tbreak;\n\t\t}\n\t\t// Update opt_len to include the bit length tree and counts\n\t\tthat.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\n\t\treturn max_blindex;\n\t}\n\n\t// Output a byte on the stream.\n\t// IN assertion: there is enough room in pending_buf.\n\tfunction put_byte(p) {\n\t\tthat.pending_buf[that.pending++] = p;\n\t}\n\n\tfunction put_short(w) {\n\t\tput_byte(w & 0xff);\n\t\tput_byte((w >>> 8) & 0xff);\n\t}\n\n\tfunction putShortMSB(b) {\n\t\tput_byte((b >> 8) & 0xff);\n\t\tput_byte((b & 0xff) & 0xff);\n\t}\n\n\tfunction send_bits(value, length) {\n\t\tlet val;\n\t\tconst len = length;\n\t\tif (bi_valid > Buf_size - len) {\n\t\t\tval = value;\n\t\t\t// bi_buf |= (val << bi_valid);\n\t\t\tbi_buf |= ((val << bi_valid) & 0xffff);\n\t\t\tput_short(bi_buf);\n\t\t\tbi_buf = val >>> (Buf_size - bi_valid);\n\t\t\tbi_valid += len - Buf_size;\n\t\t} else {\n\t\t\t// bi_buf |= (value) << bi_valid;\n\t\t\tbi_buf |= (((value) << bi_valid) & 0xffff);\n\t\t\tbi_valid += len;\n\t\t}\n\t}\n\n\tfunction send_code(c, tree) {\n\t\tconst c2 = c * 2;\n\t\tsend_bits(tree[c2] & 0xffff, tree[c2 + 1] & 0xffff);\n\t}\n\n\t// Send a literal or distance tree in compressed form, using the codes in\n\t// bl_tree.\n\tfunction send_tree(tree,// the tree to be sent\n\t\tmax_code // and its largest code of non zero frequency\n\t) {\n\t\tlet n; // iterates over all tree elements\n\t\tlet prevlen = -1; // last emitted length\n\t\tlet curlen; // length of current code\n\t\tlet nextlen = tree[0 * 2 + 1]; // length of next code\n\t\tlet count = 0; // repeat count of the current code\n\t\tlet max_count = 7; // max repeat count\n\t\tlet min_count = 4; // min repeat count\n\n\t\tif (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t}\n\n\t\tfor (n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t\tcontinue;\n\t\t\t} else if (count < min_count) {\n\t\t\t\tdo {\n\t\t\t\t\tsend_code(curlen, bl_tree);\n\t\t\t\t} while (--count !== 0);\n\t\t\t} else if (curlen !== 0) {\n\t\t\t\tif (curlen != prevlen) {\n\t\t\t\t\tsend_code(curlen, bl_tree);\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\t\t\t\tsend_code(REP_3_6, bl_tree);\n\t\t\t\tsend_bits(count - 3, 2);\n\t\t\t} else if (count <= 10) {\n\t\t\t\tsend_code(REPZ_3_10, bl_tree);\n\t\t\t\tsend_bits(count - 3, 3);\n\t\t\t} else {\n\t\t\t\tsend_code(REPZ_11_138, bl_tree);\n\t\t\t\tsend_bits(count - 11, 7);\n\t\t\t}\n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n\t\t\tif (nextlen === 0) {\n\t\t\t\tmax_count = 138;\n\t\t\t\tmin_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t\tmax_count = 6;\n\t\t\t\tmin_count = 3;\n\t\t\t} else {\n\t\t\t\tmax_count = 7;\n\t\t\t\tmin_count = 4;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Send the header for a block using dynamic Huffman trees: the counts, the\n\t// lengths of the bit length codes, the literal tree and the distance tree.\n\t// IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n\tfunction send_all_trees(lcodes, dcodes, blcodes) {\n\t\tlet rank; // index in bl_order\n\n\t\tsend_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt\n\t\tsend_bits(dcodes - 1, 5);\n\t\tsend_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt\n\t\tfor (rank = 0; rank < blcodes; rank++) {\n\t\t\tsend_bits(bl_tree[Tree.bl_order[rank] * 2 + 1], 3);\n\t\t}\n\t\tsend_tree(dyn_ltree, lcodes - 1); // literal tree\n\t\tsend_tree(dyn_dtree, dcodes - 1); // distance tree\n\t}\n\n\t// Flush the bit buffer, keeping at most 7 bits in it.\n\tfunction bi_flush() {\n\t\tif (bi_valid == 16) {\n\t\t\tput_short(bi_buf);\n\t\t\tbi_buf = 0;\n\t\t\tbi_valid = 0;\n\t\t} else if (bi_valid >= 8) {\n\t\t\tput_byte(bi_buf & 0xff);\n\t\t\tbi_buf >>>= 8;\n\t\t\tbi_valid -= 8;\n\t\t}\n\t}\n\n\t// Send one empty static block to give enough lookahead for inflate.\n\t// This takes 10 bits, of which 7 may remain in the bit buffer.\n\t// The current inflate code requires 9 bits of lookahead. If the\n\t// last two codes for the previous block (real code plus EOB) were coded\n\t// on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode\n\t// the last real code. In this case we send two empty static blocks instead\n\t// of one. (There are no problems if the previous block is stored or fixed.)\n\t// To simplify the code, we assume the worst case of last real code encoded\n\t// on one bit only.\n\tfunction _tr_align() {\n\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\n\t\tbi_flush();\n\n\t\t// Of the 10 bits for the empty block, we have already sent\n\t\t// (10 - bi_valid) bits. The lookahead for the last real code (before\n\t\t// the EOB of the previous block) was thus at least one plus the length\n\t\t// of the EOB plus what we have just sent of the empty static block.\n\t\tif (1 + last_eob_len + 10 - bi_valid < 9) {\n\t\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\t\t\tbi_flush();\n\t\t}\n\t\tlast_eob_len = 7;\n\t}\n\n\t// Save the match info and tally the frequency counts. Return true if\n\t// the current block must be flushed.\n\tfunction _tr_tally(dist, // distance of matched string\n\t\tlc // match length-MIN_MATCH or unmatched char (if dist==0)\n\t) {\n\t\tlet out_length, in_length, dcode;\n\t\tthat.dist_buf[last_lit] = dist;\n\t\tthat.lc_buf[last_lit] = lc & 0xff;\n\t\tlast_lit++;\n\n\t\tif (dist === 0) {\n\t\t\t// lc is the unmatched char\n\t\t\tdyn_ltree[lc * 2]++;\n\t\t} else {\n\t\t\tmatches++;\n\t\t\t// Here, lc is the match length - MIN_MATCH\n\t\t\tdist--; // dist = match distance - 1\n\t\t\tdyn_ltree[(Tree._length_code[lc] + LITERALS + 1) * 2]++;\n\t\t\tdyn_dtree[Tree.d_code(dist) * 2]++;\n\t\t}\n\n\t\tif ((last_lit & 0x1fff) === 0 && level > 2) {\n\t\t\t// Compute an upper bound for the compressed length\n\t\t\tout_length = last_lit * 8;\n\t\t\tin_length = strstart - block_start;\n\t\t\tfor (dcode = 0; dcode < D_CODES; dcode++) {\n\t\t\t\tout_length += dyn_dtree[dcode * 2] * (5 + Tree.extra_dbits[dcode]);\n\t\t\t}\n\t\t\tout_length >>>= 3;\n\t\t\tif ((matches < Math.floor(last_lit / 2)) && out_length < Math.floor(in_length / 2))\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn (last_lit == lit_bufsize - 1);\n\t\t// We avoid equality with lit_bufsize because of wraparound at 64K\n\t\t// on 16 bit machines and because stored blocks are restricted to\n\t\t// 64K-1 bytes.\n\t}\n\n\t// Send the block data compressed using the given Huffman trees\n\tfunction compress_block(ltree, dtree) {\n\t\tlet dist; // distance of matched string\n\t\tlet lc; // match length or unmatched char (if dist === 0)\n\t\tlet lx = 0; // running index in dist_buf and lc_buf\n\t\tlet code; // the code to send\n\t\tlet extra; // number of extra bits to send\n\n\t\tif (last_lit !== 0) {\n\t\t\tdo {\n\t\t\t\tdist = that.dist_buf[lx];\n\t\t\t\tlc = that.lc_buf[lx];\n\t\t\t\tlx++;\n\n\t\t\t\tif (dist === 0) {\n\t\t\t\t\tsend_code(lc, ltree); // send a literal byte\n\t\t\t\t} else {\n\t\t\t\t\t// Here, lc is the match length - MIN_MATCH\n\t\t\t\t\tcode = Tree._length_code[lc];\n\n\t\t\t\t\tsend_code(code + LITERALS + 1, ltree); // send the length\n\t\t\t\t\t// code\n\t\t\t\t\textra = Tree.extra_lbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tlc -= Tree.base_length[code];\n\t\t\t\t\t\tsend_bits(lc, extra); // send the extra length bits\n\t\t\t\t\t}\n\t\t\t\t\tdist--; // dist is now the match distance - 1\n\t\t\t\t\tcode = Tree.d_code(dist);\n\n\t\t\t\t\tsend_code(code, dtree); // send the distance code\n\t\t\t\t\textra = Tree.extra_dbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tdist -= Tree.base_dist[code];\n\t\t\t\t\t\tsend_bits(dist, extra); // send the extra distance bits\n\t\t\t\t\t}\n\t\t\t\t} // literal or match pair ?\n\t\t\t} while (lx < last_lit);\n\t\t}\n\n\t\tsend_code(END_BLOCK, ltree);\n\t\tlast_eob_len = ltree[END_BLOCK * 2 + 1];\n\t}\n\n\t// Flush the bit buffer and align the output on a byte boundary\n\tfunction bi_windup() {\n\t\tif (bi_valid > 8) {\n\t\t\tput_short(bi_buf);\n\t\t} else if (bi_valid > 0) {\n\t\t\tput_byte(bi_buf & 0xff);\n\t\t}\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t}\n\n\t// Copy a stored block, storing first the length and its\n\t// one's complement if requested.\n\tfunction copy_block(buf, // the input data\n\t\tlen, // its length\n\t\theader // true if block header must be written\n\t) {\n\t\tbi_windup(); // align on byte boundary\n\t\tlast_eob_len = 8; // enough lookahead for inflate\n\n\t\tif (header) {\n\t\t\tput_short(len);\n\t\t\tput_short(~len);\n\t\t}\n\n\t\tthat.pending_buf.set(win.subarray(buf, buf + len), that.pending);\n\t\tthat.pending += len;\n\t}\n\n\t// Send a stored block\n\tfunction _tr_stored_block(buf, // input block\n\t\tstored_len, // length of input block\n\t\teof // true if this is the last block for a file\n\t) {\n\t\tsend_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3); // send block type\n\t\tcopy_block(buf, stored_len, true); // with header\n\t}\n\n\t// Determine the best encoding for the current block: dynamic trees, static\n\t// trees or store, and output the encoded block to the zip file.\n\tfunction _tr_flush_block(buf, // input block, or NULL if too old\n\t\tstored_len, // length of input block\n\t\teof // true if this is the last block for a file\n\t) {\n\t\tlet opt_lenb, static_lenb;// opt_len and static_len in bytes\n\t\tlet max_blindex = 0; // index of last bit length code of non zero freq\n\n\t\t// Build the Huffman trees unless a stored block is forced\n\t\tif (level > 0) {\n\t\t\t// Construct the literal and distance trees\n\t\t\tl_desc.build_tree(that);\n\n\t\t\td_desc.build_tree(that);\n\n\t\t\t// At this point, opt_len and static_len are the total bit lengths\n\t\t\t// of\n\t\t\t// the compressed block data, excluding the tree representations.\n\n\t\t\t// Build the bit length tree for the above two trees, and get the\n\t\t\t// index\n\t\t\t// in bl_order of the last bit length code to send.\n\t\t\tmax_blindex = build_bl_tree();\n\n\t\t\t// Determine the best encoding. Compute first the block length in\n\t\t\t// bytes\n\t\t\topt_lenb = (that.opt_len + 3 + 7) >>> 3;\n\t\t\tstatic_lenb = (that.static_len + 3 + 7) >>> 3;\n\n\t\t\tif (static_lenb <= opt_lenb)\n\t\t\t\topt_lenb = static_lenb;\n\t\t} else {\n\t\t\topt_lenb = static_lenb = stored_len + 5; // force a stored block\n\t\t}\n\n\t\tif ((stored_len + 4 <= opt_lenb) && buf != -1) {\n\t\t\t// 4: two words for the lengths\n\t\t\t// The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t\t\t// Otherwise we can't have processed more than WSIZE input bytes\n\t\t\t// since\n\t\t\t// the last block flush, because compression would have been\n\t\t\t// successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t\t\t// transform a block into a stored block.\n\t\t\t_tr_stored_block(buf, stored_len, eof);\n\t\t} else if (static_lenb == opt_lenb) {\n\t\t\tsend_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3);\n\t\t\tcompress_block(StaticTree.static_ltree, StaticTree.static_dtree);\n\t\t} else {\n\t\t\tsend_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3);\n\t\t\tsend_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);\n\t\t\tcompress_block(dyn_ltree, dyn_dtree);\n\t\t}\n\n\t\t// The above check is made mod 2^32, for files larger than 512 MB\n\t\t// and uLong implemented on 32 bits.\n\n\t\tinit_block();\n\n\t\tif (eof) {\n\t\t\tbi_windup();\n\t\t}\n\t}\n\n\tfunction flush_block_only(eof) {\n\t\t_tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof);\n\t\tblock_start = strstart;\n\t\tstrm.flush_pending();\n\t}\n\n\t// Fill the win when the lookahead becomes insufficient.\n\t// Updates strstart and lookahead.\n\t//\n\t// IN assertion: lookahead < MIN_LOOKAHEAD\n\t// OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n\t// At least one byte has been read, or avail_in === 0; reads are\n\t// performed for at least two bytes (required for the zip translate_eol\n\t// option -- not supported here).\n\tfunction fill_window() {\n\t\tlet n, m;\n\t\tlet p;\n\t\tlet more; // Amount of free space at the end of the win.\n\n\t\tdo {\n\t\t\tmore = (window_size - lookahead - strstart);\n\n\t\t\t// Deal with !@#$% 64K limit:\n\t\t\tif (more === 0 && strstart === 0 && lookahead === 0) {\n\t\t\t\tmore = w_size;\n\t\t\t} else if (more == -1) {\n\t\t\t\t// Very unlikely, but possible on 16 bit machine if strstart ==\n\t\t\t\t// 0\n\t\t\t\t// and lookahead == 1 (input done one byte at time)\n\t\t\t\tmore--;\n\n\t\t\t\t// If the win is almost full and there is insufficient\n\t\t\t\t// lookahead,\n\t\t\t\t// move the upper half to the lower one to make room in the\n\t\t\t\t// upper half.\n\t\t\t} else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) {\n\t\t\t\twin.set(win.subarray(w_size, w_size + w_size), 0);\n\n\t\t\t\tmatch_start -= w_size;\n\t\t\t\tstrstart -= w_size; // we now have strstart >= MAX_DIST\n\t\t\t\tblock_start -= w_size;\n\n\t\t\t\t// Slide the hash table (could be avoided with 32 bit values\n\t\t\t\t// at the expense of memory usage). We slide even when level ==\n\t\t\t\t// 0\n\t\t\t\t// to keep the hash table consistent if we switch back to level\n\t\t\t\t// > 0\n\t\t\t\t// later. (Using level 0 permanently is not an optimal usage of\n\t\t\t\t// zlib, so we don't care about this pathological case.)\n\n\t\t\t\tn = hash_size;\n\t\t\t\tp = n;\n\t\t\t\tdo {\n\t\t\t\t\tm = (head[--p] & 0xffff);\n\t\t\t\t\thead[p] = (m >= w_size ? m - w_size : 0);\n\t\t\t\t} while (--n !== 0);\n\n\t\t\t\tn = w_size;\n\t\t\t\tp = n;\n\t\t\t\tdo {\n\t\t\t\t\tm = (prev[--p] & 0xffff);\n\t\t\t\t\tprev[p] = (m >= w_size ? m - w_size : 0);\n\t\t\t\t\t// If n is not on any hash chain, prev[n] is garbage but\n\t\t\t\t\t// its value will never be used.\n\t\t\t\t} while (--n !== 0);\n\t\t\t\tmore += w_size;\n\t\t\t}\n\n\t\t\tif (strm.avail_in === 0)\n\t\t\t\treturn;\n\n\t\t\t// If there was no sliding:\n\t\t\t// strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t\t\t// more == window_size - lookahead - strstart\n\t\t\t// => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t\t\t// => more >= window_size - 2*WSIZE + 2\n\t\t\t// In the BIG_MEM or MMAP case (not yet supported),\n\t\t\t// window_size == input_size + MIN_LOOKAHEAD &&\n\t\t\t// strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t\t\t// Otherwise, window_size == 2*WSIZE so more >= 2.\n\t\t\t// If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n\n\t\t\tn = strm.read_buf(win, strstart + lookahead, more);\n\t\t\tlookahead += n;\n\n\t\t\t// Initialize the hash value now that we have some input:\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = win[strstart] & 0xff;\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t}\n\t\t\t// If the whole input has less than MIN_MATCH bytes, ins_h is\n\t\t\t// garbage,\n\t\t\t// but this is not important since only literal bytes will be\n\t\t\t// emitted.\n\t\t} while (lookahead < MIN_LOOKAHEAD && strm.avail_in !== 0);\n\t}\n\n\t// Copy without compression as much as possible from the input stream,\n\t// return\n\t// the current block state.\n\t// This function does not insert new strings in the dictionary since\n\t// uncompressible data is probably not useful. This function is used\n\t// only for the level=0 compression option.\n\t// NOTE: this function should be optimized to avoid extra copying from\n\t// win to pending_buf.\n\tfunction deflate_stored(flush) {\n\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n\t\tlet max_block_size = 0xffff;\n\t\tlet max_start;\n\n\t\tif (max_block_size > pending_buf_size - 5) {\n\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t}\n\n\t\t// Copy as much as possible from input to output:\n\t\twhile (true) {\n\t\t\t// Fill the win as much as possible:\n\t\t\tif (lookahead <= 1) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n\t\t\t\t\treturn NeedMore;\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\tstrstart += lookahead;\n\t\t\tlookahead = 0;\n\n\t\t\t// Emit a stored block if pending_buf will be full:\n\t\t\tmax_start = block_start + max_block_size;\n\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t\tlookahead = (strstart - max_start);\n\t\t\t\tstrstart = max_start;\n\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\n\t\t\t}\n\n\t\t\t// Flush if we may have to slide, otherwise block_start may become\n\t\t\t// negative and the data will be gone:\n\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t}\n\n\t\tflush_block_only(flush == Z_FINISH);\n\t\tif (strm.avail_out === 0)\n\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\tfunction longest_match(cur_match) {\n\t\tlet chain_length = max_chain_length; // max hash chain length\n\t\tlet scan = strstart; // current string\n\t\tlet match; // matched string\n\t\tlet len; // length of current match\n\t\tlet best_len = prev_length; // best match length so far\n\t\tconst limit = strstart > (w_size - MIN_LOOKAHEAD) ? strstart - (w_size - MIN_LOOKAHEAD) : 0;\n\t\tlet _nice_match = nice_match;\n\n\t\t// Stop when cur_match becomes <= limit. To simplify the code,\n\t\t// we prevent matches with the string of win index 0.\n\n\t\tconst wmask = w_mask;\n\n\t\tconst strend = strstart + MAX_MATCH;\n\t\tlet scan_end1 = win[scan + best_len - 1];\n\t\tlet scan_end = win[scan + best_len];\n\n\t\t// The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of\n\t\t// 16.\n\t\t// It is easy to get rid of this optimization if necessary.\n\n\t\t// Do not waste too much time if we already have a good match:\n\t\tif (prev_length >= good_match) {\n\t\t\tchain_length >>= 2;\n\t\t}\n\n\t\t// Do not look for matches beyond the end of the input. This is\n\t\t// necessary\n\t\t// to make deflate deterministic.\n\t\tif (_nice_match > lookahead)\n\t\t\t_nice_match = lookahead;\n\n\t\tdo {\n\t\t\tmatch = cur_match;\n\n\t\t\t// Skip to next match if the match length cannot increase\n\t\t\t// or if the match length is less than 2:\n\t\t\tif (win[match + best_len] != scan_end || win[match + best_len - 1] != scan_end1 || win[match] != win[scan]\n\t\t\t\t|| win[++match] != win[scan + 1])\n\t\t\t\tcontinue;\n\n\t\t\t// The check at best_len-1 can be removed because it will be made\n\t\t\t// again later. (This heuristic is not always a win.)\n\t\t\t// It is not necessary to compare scan[2] and match[2] since they\n\t\t\t// are always equal when the other bytes match, given that\n\t\t\t// the hash keys are equal and that HASH_BITS >= 8.\n\t\t\tscan += 2;\n\t\t\tmatch++;\n\n\t\t\t// We check for insufficient lookahead only every 8th comparison;\n\t\t\t// the 256th check will be made at strstart+258.\n\t\t\tdo {\n\t\t\t\t// empty block\n\t\t\t} while (win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]\n\t\t\t&& win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]\n\t\t\t&& win[++scan] == win[++match] && win[++scan] == win[++match] && scan < strend);\n\n\t\t\tlen = MAX_MATCH - (strend - scan);\n\t\t\tscan = strend - MAX_MATCH;\n\n\t\t\tif (len > best_len) {\n\t\t\t\tmatch_start = cur_match;\n\t\t\t\tbest_len = len;\n\t\t\t\tif (len >= _nice_match)\n\t\t\t\t\tbreak;\n\t\t\t\tscan_end1 = win[scan + best_len - 1];\n\t\t\t\tscan_end = win[scan + best_len];\n\t\t\t}\n\n\t\t} while ((cur_match = (prev[cur_match & wmask] & 0xffff)) > limit && --chain_length !== 0);\n\n\t\tif (best_len <= lookahead)\n\t\t\treturn best_len;\n\t\treturn lookahead;\n\t}\n\n\t// Compress as much as possible from the input stream, return the current\n\t// block state.\n\t// This function does not perform lazy evaluation of matches and inserts\n\t// new strings in the dictionary only for unmatched strings or for short\n\t// matches. It is used only for the fast compression options.\n\tfunction deflate_fast(flush) {\n\t\t// short hash_head = 0; // head of the hash chain\n\t\tlet hash_head = 0; // head of the hash chain\n\t\tlet bflush; // set if current block must be flushed\n\n\t\twhile (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\t// Insert the string win[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\thead[ins_h] = strstart;\n\t\t\t}\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\n\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of win index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t}\n\t\t\t\t// longest_match() sets match_start\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\n\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\thead[ins_h] = strstart;\n\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = win[strstart] & 0xff;\n\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t\t// not\n\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte\n\n\t\t\t\tbflush = _tr_tally(0, win[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (bflush) {\n\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t}\n\n\t\tflush_block_only(flush == Z_FINISH);\n\t\tif (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH)\n\t\t\t\treturn FinishStarted;\n\t\t\telse\n\t\t\t\treturn NeedMore;\n\t\t}\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\t// Same as above, but achieves better compression. We use a lazy\n\t// evaluation for matches: a match is finally adopted only if there is\n\t// no better match at the next win position.\n\tfunction deflate_slow(flush) {\n\t\t// short hash_head = 0; // head of hash chain\n\t\tlet hash_head = 0; // head of hash chain\n\t\tlet bflush; // set if current block must be flushed\n\t\tlet max_insert;\n\n\t\t// Process the input block.\n\t\twhile (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\t// Insert the string win[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\thead[ins_h] = strstart;\n\t\t\t}\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n\n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of win index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\n\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t}\n\t\t\t\t// longest_match() sets match_start\n\n\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n\t\t\t\t// Do not insert strings in hash table beyond this.\n\n\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n\t\t\t\t// Insert in hash table all strings up to the end of the match.\n\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n\t\t\t\t// enough lookahead, the last two strings are not inserted in\n\t\t\t\t// the hash table.\n\t\t\t\tlookahead -= prev_length - 1;\n\t\t\t\tprev_length -= 2;\n\t\t\t\tdo {\n\t\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t\t}\n\t\t\t\t} while (--prev_length !== 0);\n\t\t\t\tmatch_available = 0;\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\tstrstart++;\n\n\t\t\t\tif (bflush) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t} else if (match_available !== 0) {\n\n\t\t\t\t// If there was no match at the previous position, output a\n\t\t\t\t// single literal. If there was a match but the current match\n\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n\t\t\t\tbflush = _tr_tally(0, win[strstart - 1] & 0xff);\n\n\t\t\t\tif (bflush) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t}\n\t\t\t\tstrstart++;\n\t\t\t\tlookahead--;\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t} else {\n\t\t\t\t// There is no previous match to compare with, wait for\n\t\t\t\t// the next step to decide.\n\n\t\t\t\tmatch_available = 1;\n\t\t\t\tstrstart++;\n\t\t\t\tlookahead--;\n\t\t\t}\n\t\t}\n\n\t\tif (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, win[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t}\n\t\tflush_block_only(flush == Z_FINISH);\n\n\t\tif (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH)\n\t\t\t\treturn FinishStarted;\n\t\t\telse\n\t\t\t\treturn NeedMore;\n\t\t}\n\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\tfunction deflateReset(strm) {\n\t\tstrm.total_in = strm.total_out = 0;\n\t\tstrm.msg = null; //\n\n\t\tthat.pending = 0;\n\t\tthat.pending_out = 0;\n\n\t\tstatus = BUSY_STATE;\n\n\t\tlast_flush = Z_NO_FLUSH;\n\n\t\ttr_init();\n\t\tlm_init();\n\t\treturn Z_OK;\n\t}\n\n\tthat.deflateInit = function (strm, _level, bits, _method, memLevel, _strategy) {\n\t\tif (!_method)\n\t\t\t_method = Z_DEFLATED;\n\t\tif (!memLevel)\n\t\t\tmemLevel = DEF_MEM_LEVEL;\n\t\tif (!_strategy)\n\t\t\t_strategy = Z_DEFAULT_STRATEGY;\n\n\t\t// byte[] my_version=ZLIB_VERSION;\n\n\t\t//\n\t\t// if (!version || version[0] != my_version[0]\n\t\t// || stream_size != sizeof(z_stream)) {\n\t\t// return Z_VERSION_ERROR;\n\t\t// }\n\n\t\tstrm.msg = null;\n\n\t\tif (_level == Z_DEFAULT_COMPRESSION)\n\t\t\t_level = 6;\n\n\t\tif (memLevel < 1 || memLevel > MAX_MEM_LEVEL || _method != Z_DEFLATED || bits < 9 || bits > 15 || _level < 0 || _level > 9 || _strategy < 0\n\t\t\t|| _strategy > Z_HUFFMAN_ONLY) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tstrm.dstate = that;\n\n\t\tw_bits = bits;\n\t\tw_size = 1 << w_bits;\n\t\tw_mask = w_size - 1;\n\n\t\thash_bits = memLevel + 7;\n\t\thash_size = 1 << hash_bits;\n\t\thash_mask = hash_size - 1;\n\t\thash_shift = Math.floor((hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n\t\twin = new Uint8Array(w_size * 2);\n\t\tprev = [];\n\t\thead = [];\n\n\t\tlit_bufsize = 1 << (memLevel + 6); // 16K elements by default\n\n\t\tthat.pending_buf = new Uint8Array(lit_bufsize * 4);\n\t\tpending_buf_size = lit_bufsize * 4;\n\n\t\tthat.dist_buf = new Uint16Array(lit_bufsize);\n\t\tthat.lc_buf = new Uint8Array(lit_bufsize);\n\n\t\tlevel = _level;\n\n\t\tstrategy = _strategy;\n\n\t\treturn deflateReset(strm);\n\t};\n\n\tthat.deflateEnd = function () {\n\t\tif (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\t// Deallocate in reverse order of allocations:\n\t\tthat.lc_buf = null;\n\t\tthat.dist_buf = null;\n\t\tthat.pending_buf = null;\n\t\thead = null;\n\t\tprev = null;\n\t\twin = null;\n\t\t// free\n\t\tthat.dstate = null;\n\t\treturn status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;\n\t};\n\n\tthat.deflateParams = function (strm, _level, _strategy) {\n\t\tlet err = Z_OK;\n\n\t\tif (_level == Z_DEFAULT_COMPRESSION) {\n\t\t\t_level = 6;\n\t\t}\n\t\tif (_level < 0 || _level > 9 || _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tif (config_table[level].func != config_table[_level].func && strm.total_in !== 0) {\n\t\t\t// Flush the last buffer:\n\t\t\terr = strm.deflate(Z_PARTIAL_FLUSH);\n\t\t}\n\n\t\tif (level != _level) {\n\t\t\tlevel = _level;\n\t\t\tmax_lazy_match = config_table[level].max_lazy;\n\t\t\tgood_match = config_table[level].good_length;\n\t\t\tnice_match = config_table[level].nice_length;\n\t\t\tmax_chain_length = config_table[level].max_chain;\n\t\t}\n\t\tstrategy = _strategy;\n\t\treturn err;\n\t};\n\n\tthat.deflateSetDictionary = function (_strm, dictionary, dictLength) {\n\t\tlet length = dictLength;\n\t\tlet n, index = 0;\n\n\t\tif (!dictionary || status != INIT_STATE)\n\t\t\treturn Z_STREAM_ERROR;\n\n\t\tif (length < MIN_MATCH)\n\t\t\treturn Z_OK;\n\t\tif (length > w_size - MIN_LOOKAHEAD) {\n\t\t\tlength = w_size - MIN_LOOKAHEAD;\n\t\t\tindex = dictLength - length; // use the tail of the dictionary\n\t\t}\n\t\twin.set(dictionary.subarray(index, index + length), 0);\n\n\t\tstrstart = length;\n\t\tblock_start = length;\n\n\t\t// Insert all strings in the hash table (except for the last two bytes).\n\t\t// s->lookahead stays null, so s->ins_h will be recomputed at the next\n\t\t// call of fill_window.\n\n\t\tins_h = win[0] & 0xff;\n\t\tins_h = (((ins_h) << hash_shift) ^ (win[1] & 0xff)) & hash_mask;\n\n\t\tfor (n = 0; n <= length - MIN_MATCH; n++) {\n\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(n) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\tprev[n & w_mask] = head[ins_h];\n\t\t\thead[ins_h] = n;\n\t\t}\n\t\treturn Z_OK;\n\t};\n\n\tthat.deflate = function (_strm, flush) {\n\t\tlet i, header, level_flags, old_flush, bstate;\n\n\t\tif (flush > Z_FINISH || flush < 0) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tif (!_strm.next_out || (!_strm.next_in && _strm.avail_in !== 0) || (status == FINISH_STATE && flush != Z_FINISH)) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_STREAM_ERROR)];\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\tif (_strm.avail_out === 0) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\tstrm = _strm; // just in case\n\t\told_flush = last_flush;\n\t\tlast_flush = flush;\n\n\t\t// Write the zlib header\n\t\tif (status == INIT_STATE) {\n\t\t\theader = (Z_DEFLATED + ((w_bits - 8) << 4)) << 8;\n\t\t\tlevel_flags = ((level - 1) & 0xff) >> 1;\n\n\t\t\tif (level_flags > 3)\n\t\t\t\tlevel_flags = 3;\n\t\t\theader |= (level_flags << 6);\n\t\t\tif (strstart !== 0)\n\t\t\t\theader |= PRESET_DICT;\n\t\t\theader += 31 - (header % 31);\n\n\t\t\tstatus = BUSY_STATE;\n\t\t\tputShortMSB(header);\n\t\t}\n\n\t\t// Flush as much pending output as possible\n\t\tif (that.pending !== 0) {\n\t\t\tstrm.flush_pending();\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t// console.log(\" avail_out==0\");\n\t\t\t\t// Since avail_out is 0, deflate will be called again with\n\t\t\t\t// more output space, but possibly with both pending and\n\t\t\t\t// avail_in equal to zero. There won't be anything to do,\n\t\t\t\t// but this is not an error situation so make sure we\n\t\t\t\t// return OK instead of BUF_ERROR at next call of deflate:\n\t\t\t\tlast_flush = -1;\n\t\t\t\treturn Z_OK;\n\t\t\t}\n\n\t\t\t// Make sure there is something to do and avoid duplicate\n\t\t\t// consecutive\n\t\t\t// flushes. For repeated and useless calls with Z_FINISH, we keep\n\t\t\t// returning Z_STREAM_END instead of Z_BUFF_ERROR.\n\t\t} else if (strm.avail_in === 0 && flush <= old_flush && flush != Z_FINISH) {\n\t\t\tstrm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\t// User must not provide more input after the first FINISH:\n\t\tif (status == FINISH_STATE && strm.avail_in !== 0) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\t// Start a new block or continue the current one.\n\t\tif (strm.avail_in !== 0 || lookahead !== 0 || (flush != Z_NO_FLUSH && status != FINISH_STATE)) {\n\t\t\tbstate = -1;\n\t\t\tswitch (config_table[level].func) {\n\t\t\t\tcase STORED:\n\t\t\t\t\tbstate = deflate_stored(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FAST:\n\t\t\t\t\tbstate = deflate_fast(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SLOW:\n\t\t\t\t\tbstate = deflate_slow(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\n\t\t\tif (bstate == FinishStarted || bstate == FinishDone) {\n\t\t\t\tstatus = FINISH_STATE;\n\t\t\t}\n\t\t\tif (bstate == NeedMore || bstate == FinishStarted) {\n\t\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t\tlast_flush = -1; // avoid BUF_ERROR next call, see above\n\t\t\t\t}\n\t\t\t\treturn Z_OK;\n\t\t\t\t// If flush != Z_NO_FLUSH && avail_out === 0, the next call\n\t\t\t\t// of deflate should use the same flush parameter to make sure\n\t\t\t\t// that the flush is complete. So we don't have to output an\n\t\t\t\t// empty block here, this will be done at next call. This also\n\t\t\t\t// ensures that for a very small output buffer, we emit at most\n\t\t\t\t// one empty block.\n\t\t\t}\n\n\t\t\tif (bstate == BlockDone) {\n\t\t\t\tif (flush == Z_PARTIAL_FLUSH) {\n\t\t\t\t\t_tr_align();\n\t\t\t\t} else { // FULL_FLUSH or SYNC_FLUSH\n\t\t\t\t\t_tr_stored_block(0, 0, false);\n\t\t\t\t\t// For a full flush, this empty block will be recognized\n\t\t\t\t\t// as a special marker by inflate_sync().\n\t\t\t\t\tif (flush == Z_FULL_FLUSH) {\n\t\t\t\t\t\t// state.head[s.hash_size-1]=0;\n\t\t\t\t\t\tfor (i = 0; i < hash_size/*-1*/; i++)\n\t\t\t\t\t\t\t// forget history\n\t\t\t\t\t\t\thead[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstrm.flush_pending();\n\t\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t\tlast_flush = -1; // avoid BUF_ERROR at next call, see above\n\t\t\t\t\treturn Z_OK;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (flush != Z_FINISH)\n\t\t\treturn Z_OK;\n\t\treturn Z_STREAM_END;\n\t};\n}\n\n// ZStream\n\nfunction ZStream() {\n\tconst that = this;\n\tthat.next_in_index = 0;\n\tthat.next_out_index = 0;\n\t// that.next_in; // next input byte\n\tthat.avail_in = 0; // number of bytes available at next_in\n\tthat.total_in = 0; // total nb of input bytes read so far\n\t// that.next_out; // next output byte should be put there\n\tthat.avail_out = 0; // remaining free space at next_out\n\tthat.total_out = 0; // total nb of bytes output so far\n\t// that.msg;\n\t// that.dstate;\n}\n\nZStream.prototype = {\n\tdeflateInit(level, bits) {\n\t\tconst that = this;\n\t\tthat.dstate = new Deflate();\n\t\tif (!bits)\n\t\t\tbits = MAX_BITS;\n\t\treturn that.dstate.deflateInit(that, level, bits);\n\t},\n\n\tdeflate(flush) {\n\t\tconst that = this;\n\t\tif (!that.dstate) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\treturn that.dstate.deflate(that, flush);\n\t},\n\n\tdeflateEnd() {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst ret = that.dstate.deflateEnd();\n\t\tthat.dstate = null;\n\t\treturn ret;\n\t},\n\n\tdeflateParams(level, strategy) {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.dstate.deflateParams(that, level, strategy);\n\t},\n\n\tdeflateSetDictionary(dictionary, dictLength) {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.dstate.deflateSetDictionary(that, dictionary, dictLength);\n\t},\n\n\t// Read a new buffer from the current input stream, update the\n\t// total number of bytes read. All deflate() input goes through\n\t// this function so some applications may wish to modify it to avoid\n\t// allocating a large strm->next_in buffer and copying from it.\n\t// (See also flush_pending()).\n\tread_buf(buf, start, size) {\n\t\tconst that = this;\n\t\tlet len = that.avail_in;\n\t\tif (len > size)\n\t\t\tlen = size;\n\t\tif (len === 0)\n\t\t\treturn 0;\n\t\tthat.avail_in -= len;\n\t\tbuf.set(that.next_in.subarray(that.next_in_index, that.next_in_index + len), start);\n\t\tthat.next_in_index += len;\n\t\tthat.total_in += len;\n\t\treturn len;\n\t},\n\n\t// Flush as much pending output as possible. All deflate() output goes\n\t// through this function so some applications may wish to modify it\n\t// to avoid allocating a large strm->next_out buffer and copying into it.\n\t// (See also read_buf()).\n\tflush_pending() {\n\t\tconst that = this;\n\t\tlet len = that.dstate.pending;\n\n\t\tif (len > that.avail_out)\n\t\t\tlen = that.avail_out;\n\t\tif (len === 0)\n\t\t\treturn;\n\n\t\t// if (that.dstate.pending_buf.length <= that.dstate.pending_out || that.next_out.length <= that.next_out_index\n\t\t// || that.dstate.pending_buf.length < (that.dstate.pending_out + len) || that.next_out.length < (that.next_out_index +\n\t\t// len)) {\n\t\t// console.log(that.dstate.pending_buf.length + \", \" + that.dstate.pending_out + \", \" + that.next_out.length + \", \" +\n\t\t// that.next_out_index + \", \" + len);\n\t\t// console.log(\"avail_out=\" + that.avail_out);\n\t\t// }\n\n\t\tthat.next_out.set(that.dstate.pending_buf.subarray(that.dstate.pending_out, that.dstate.pending_out + len), that.next_out_index);\n\n\t\tthat.next_out_index += len;\n\t\tthat.dstate.pending_out += len;\n\t\tthat.total_out += len;\n\t\tthat.avail_out -= len;\n\t\tthat.dstate.pending -= len;\n\t\tif (that.dstate.pending === 0) {\n\t\t\tthat.dstate.pending_out = 0;\n\t\t}\n\t}\n};\n\n// Deflate\n\nfunction ZipDeflate(options) {\n\tconst that = this;\n\tconst z = new ZStream();\n\tconst bufsize = getMaximumCompressedSize(options && options.chunkSize ? options.chunkSize : 64 * 1024);\n\tconst flush = Z_NO_FLUSH;\n\tconst buf = new Uint8Array(bufsize);\n\tlet level = options ? options.level : Z_DEFAULT_COMPRESSION;\n\tif (typeof level == \"undefined\")\n\t\tlevel = Z_DEFAULT_COMPRESSION;\n\tz.deflateInit(level);\n\tz.next_out = buf;\n\n\tthat.append = function (data, onprogress) {\n\t\tlet err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;\n\t\tconst buffers = [];\n\t\tif (!data.length)\n\t\t\treturn;\n\t\tz.next_in_index = 0;\n\t\tz.next_in = data;\n\t\tz.avail_in = data.length;\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\terr = z.deflate(flush);\n\t\t\tif (err != Z_OK)\n\t\t\t\tthrow new Error(\"deflating: \" + z.msg);\n\t\t\tif (z.next_out_index)\n\t\t\t\tif (z.next_out_index == bufsize)\n\t\t\t\t\tbuffers.push(new Uint8Array(buf));\n\t\t\t\telse\n\t\t\t\t\tbuffers.push(buf.subarray(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t\tif (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {\n\t\t\t\tonprogress(z.next_in_index);\n\t\t\t\tlastIndex = z.next_in_index;\n\t\t\t}\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tif (buffers.length > 1) {\n\t\t\tarray = new Uint8Array(bufferSize);\n\t\t\tbuffers.forEach(function (chunk) {\n\t\t\t\tarray.set(chunk, bufferIndex);\n\t\t\t\tbufferIndex += chunk.length;\n\t\t\t});\n\t\t} else {\n\t\t\tarray = buffers[0] ? new Uint8Array(buffers[0]) : new Uint8Array();\n\t\t}\n\t\treturn array;\n\t};\n\tthat.flush = function () {\n\t\tlet err, array, bufferIndex = 0, bufferSize = 0;\n\t\tconst buffers = [];\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\terr = z.deflate(Z_FINISH);\n\t\t\tif (err != Z_STREAM_END && err != Z_OK)\n\t\t\t\tthrow new Error(\"deflating: \" + z.msg);\n\t\t\tif (bufsize - z.avail_out > 0)\n\t\t\t\tbuffers.push(buf.slice(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tz.deflateEnd();\n\t\tarray = new Uint8Array(bufferSize);\n\t\tbuffers.forEach(function (chunk) {\n\t\t\tarray.set(chunk, bufferIndex);\n\t\t\tbufferIndex += chunk.length;\n\t\t});\n\t\treturn array;\n\t};\n}\n\nfunction getMaximumCompressedSize(uncompressedSize) {\n\treturn uncompressedSize + (5 * (Math.floor(uncompressedSize / 16383) + 1));\n}\n\nexport {\n\tZipDeflate as Deflate\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.\n * JZlib is based on zlib-1.1.3, so all credit should go authors\n * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)\n * and contributors of zlib.\n */\n\n// deno-lint-ignore-file no-this-alias prefer-const\n\n// Global\n\nconst MAX_BITS = 15;\n\nconst Z_OK = 0;\nconst Z_STREAM_END = 1;\nconst Z_NEED_DICT = 2;\nconst Z_STREAM_ERROR = -2;\nconst Z_DATA_ERROR = -3;\nconst Z_MEM_ERROR = -4;\nconst Z_BUF_ERROR = -5;\n\nconst inflate_mask = [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff,\n\t0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff];\n\nconst MANY = 1440;\n\n// JZlib version : \"1.0.2\"\nconst Z_NO_FLUSH = 0;\nconst Z_FINISH = 4;\n\n// InfTree\nconst fixed_bl = 9;\nconst fixed_bd = 5;\n\nconst fixed_tl = [96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0,\n\t0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40,\n\t0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13,\n\t0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60,\n\t0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7,\n\t35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8,\n\t26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80,\n\t7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0,\n\t8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0,\n\t8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97,\n\t0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210,\n\t81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117,\n\t0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154,\n\t84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83,\n\t0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230,\n\t80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139,\n\t0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174,\n\t0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111,\n\t0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9,\n\t193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8,\n\t120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8,\n\t227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8,\n\t92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9,\n\t249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8,\n\t130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9,\n\t181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8,\n\t102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9,\n\t221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0,\n\t8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9,\n\t147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8,\n\t85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9,\n\t235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8,\n\t141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9,\n\t167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8,\n\t107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9,\n\t207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8,\n\t127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255];\nconst fixed_td = [80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5,\n\t8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5,\n\t24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577];\n\n// Tables for deflate from PKZIP's appnote.txt.\nconst cplens = [ // Copy lengths for literal codes 257..285\n\t3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];\n\n// see note #13 above about 258\nconst cplext = [ // Extra bits for literal codes 257..285\n\t0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112 // 112==invalid\n];\n\nconst cpdist = [ // Copy offsets for distance codes 0..29\n\t1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];\n\nconst cpdext = [ // Extra bits for distance codes\n\t0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];\n\n// If BMAX needs to be larger than 16, then h and x[] should be uLong.\nconst BMAX = 15; // maximum bit length of any code\n\nfunction InfTree() {\n\tconst that = this;\n\n\tlet hn; // hufts used in space\n\tlet v; // work area for huft_build\n\tlet c; // bit length count table\n\tlet r; // table entry for structure assignment\n\tlet u; // table stack\n\tlet x; // bit offsets, then code stack\n\n\tfunction huft_build(b, // code lengths in bits (all assumed <=\n\t\t// BMAX)\n\t\tbindex, n, // number of codes (assumed <= 288)\n\t\ts, // number of simple-valued codes (0..s-1)\n\t\td, // list of base values for non-simple codes\n\t\te, // list of extra bits for non-simple codes\n\t\tt, // result: starting table\n\t\tm, // maximum lookup bits, returns actual\n\t\thp,// space for trees\n\t\thn,// hufts used in space\n\t\tv // working area: values in order of bit length\n\t) {\n\t\t// Given a list of code lengths and a maximum table size, make a set of\n\t\t// tables to decode that set of codes. Return Z_OK on success,\n\t\t// Z_BUF_ERROR\n\t\t// if the given code set is incomplete (the tables are still built in\n\t\t// this\n\t\t// case), Z_DATA_ERROR if the input is invalid (an over-subscribed set\n\t\t// of\n\t\t// lengths), or Z_MEM_ERROR if not enough memory.\n\n\t\tlet a; // counter for codes of length k\n\t\tlet f; // i repeats in table every f entries\n\t\tlet g; // maximum code length\n\t\tlet h; // table level\n\t\tlet i; // counter, current code\n\t\tlet j; // counter\n\t\tlet k; // number of bits in current code\n\t\tlet l; // bits per table (returned in m)\n\t\tlet mask; // (1 << w) - 1, to avoid cc -O bug on HP\n\t\tlet p; // pointer into c[], b[], or v[]\n\t\tlet q; // points to current table\n\t\tlet w; // bits before this table == (l * h)\n\t\tlet xp; // pointer into x\n\t\tlet y; // number of dummy codes added\n\t\tlet z; // number of entries in current table\n\n\t\t// Generate counts for each bit length\n\n\t\tp = 0;\n\t\ti = n;\n\t\tdo {\n\t\t\tc[b[bindex + p]]++;\n\t\t\tp++;\n\t\t\ti--; // assume all entries <= BMAX\n\t\t} while (i !== 0);\n\n\t\tif (c[0] == n) { // null input--all zero length codes\n\t\t\tt[0] = -1;\n\t\t\tm[0] = 0;\n\t\t\treturn Z_OK;\n\t\t}\n\n\t\t// Find minimum and maximum length, bound *m by those\n\t\tl = m[0];\n\t\tfor (j = 1; j <= BMAX; j++)\n\t\t\tif (c[j] !== 0)\n\t\t\t\tbreak;\n\t\tk = j; // minimum code length\n\t\tif (l < j) {\n\t\t\tl = j;\n\t\t}\n\t\tfor (i = BMAX; i !== 0; i--) {\n\t\t\tif (c[i] !== 0)\n\t\t\t\tbreak;\n\t\t}\n\t\tg = i; // maximum code length\n\t\tif (l > i) {\n\t\t\tl = i;\n\t\t}\n\t\tm[0] = l;\n\n\t\t// Adjust last length count to fill out codes, if needed\n\t\tfor (y = 1 << j; j < i; j++, y <<= 1) {\n\t\t\tif ((y -= c[j]) < 0) {\n\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t}\n\t\t}\n\t\tif ((y -= c[i]) < 0) {\n\t\t\treturn Z_DATA_ERROR;\n\t\t}\n\t\tc[i] += y;\n\n\t\t// Generate starting offsets into the value table for each length\n\t\tx[1] = j = 0;\n\t\tp = 1;\n\t\txp = 2;\n\t\twhile (--i !== 0) { // note that i == g from above\n\t\t\tx[xp] = (j += c[p]);\n\t\t\txp++;\n\t\t\tp++;\n\t\t}\n\n\t\t// Make a table of values in order of bit lengths\n\t\ti = 0;\n\t\tp = 0;\n\t\tdo {\n\t\t\tif ((j = b[bindex + p]) !== 0) {\n\t\t\t\tv[x[j]++] = i;\n\t\t\t}\n\t\t\tp++;\n\t\t} while (++i < n);\n\t\tn = x[g]; // set n to length of v\n\n\t\t// Generate the Huffman codes and for each, make the table entries\n\t\tx[0] = i = 0; // first Huffman code is zero\n\t\tp = 0; // grab values in bit order\n\t\th = -1; // no tables yet--level -1\n\t\tw = -l; // bits decoded == (l * h)\n\t\tu[0] = 0; // just to keep compilers happy\n\t\tq = 0; // ditto\n\t\tz = 0; // ditto\n\n\t\t// go through the bit lengths (k already is bits in shortest code)\n\t\tfor (; k <= g; k++) {\n\t\t\ta = c[k];\n\t\t\twhile (a-- !== 0) {\n\t\t\t\t// here i is the Huffman code of length k bits for value *p\n\t\t\t\t// make tables up to required level\n\t\t\t\twhile (k > w + l) {\n\t\t\t\t\th++;\n\t\t\t\t\tw += l; // previous table always l bits\n\t\t\t\t\t// compute minimum size table less than or equal to l bits\n\t\t\t\t\tz = g - w;\n\t\t\t\t\tz = (z > l) ? l : z; // table size upper limit\n\t\t\t\t\tif ((f = 1 << (j = k - w)) > a + 1) { // try a k-w bit table\n\t\t\t\t\t\t// too few codes for\n\t\t\t\t\t\t// k-w bit table\n\t\t\t\t\t\tf -= a + 1; // deduct codes from patterns left\n\t\t\t\t\t\txp = k;\n\t\t\t\t\t\tif (j < z) {\n\t\t\t\t\t\t\twhile (++j < z) { // try smaller tables up to z bits\n\t\t\t\t\t\t\t\tif ((f <<= 1) <= c[++xp])\n\t\t\t\t\t\t\t\t\tbreak; // enough codes to use up j bits\n\t\t\t\t\t\t\t\tf -= c[xp]; // else deduct codes from patterns\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tz = 1 << j; // table entries for j-bit table\n\n\t\t\t\t\t// allocate new table\n\t\t\t\t\tif (hn[0] + z > MANY) { // (note: doesn't matter for fixed)\n\t\t\t\t\t\treturn Z_DATA_ERROR; // overflow of MANY\n\t\t\t\t\t}\n\t\t\t\t\tu[h] = q = /* hp+ */hn[0]; // DEBUG\n\t\t\t\t\thn[0] += z;\n\n\t\t\t\t\t// connect to last table, if there is one\n\t\t\t\t\tif (h !== 0) {\n\t\t\t\t\t\tx[h] = i; // save pattern for backing up\n\t\t\t\t\t\tr[0] = /* (byte) */j; // bits in this table\n\t\t\t\t\t\tr[1] = /* (byte) */l; // bits to dump before this table\n\t\t\t\t\t\tj = i >>> (w - l);\n\t\t\t\t\t\tr[2] = /* (int) */(q - u[h - 1] - j); // offset to this table\n\t\t\t\t\t\thp.set(r, (u[h - 1] + j) * 3);\n\t\t\t\t\t\t// to\n\t\t\t\t\t\t// last\n\t\t\t\t\t\t// table\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt[0] = q; // first table is returned result\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set up table entry in r\n\t\t\t\tr[1] = /* (byte) */(k - w);\n\t\t\t\tif (p >= n) {\n\t\t\t\t\tr[0] = 128 + 64; // out of values--invalid code\n\t\t\t\t} else if (v[p] < s) {\n\t\t\t\t\tr[0] = /* (byte) */(v[p] < 256 ? 0 : 32 + 64); // 256 is\n\t\t\t\t\t// end-of-block\n\t\t\t\t\tr[2] = v[p++]; // simple code is just the value\n\t\t\t\t} else {\n\t\t\t\t\tr[0] = /* (byte) */(e[v[p] - s] + 16 + 64); // non-simple--look\n\t\t\t\t\t// up in lists\n\t\t\t\t\tr[2] = d[v[p++] - s];\n\t\t\t\t}\n\n\t\t\t\t// fill code-like entries with r\n\t\t\t\tf = 1 << (k - w);\n\t\t\t\tfor (j = i >>> w; j < z; j += f) {\n\t\t\t\t\thp.set(r, (q + j) * 3);\n\t\t\t\t}\n\n\t\t\t\t// backwards increment the k-bit code i\n\t\t\t\tfor (j = 1 << (k - 1); (i & j) !== 0; j >>>= 1) {\n\t\t\t\t\ti ^= j;\n\t\t\t\t}\n\t\t\t\ti ^= j;\n\n\t\t\t\t// backup over finished tables\n\t\t\t\tmask = (1 << w) - 1; // needed on HP, cc -O bug\n\t\t\t\twhile ((i & mask) != x[h]) {\n\t\t\t\t\th--; // don't need to update q\n\t\t\t\t\tw -= l;\n\t\t\t\t\tmask = (1 << w) - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Return Z_BUF_ERROR if we were given an incomplete table\n\t\treturn y !== 0 && g != 1 ? Z_BUF_ERROR : Z_OK;\n\t}\n\n\tfunction initWorkArea(vsize) {\n\t\tlet i;\n\t\tif (!hn) {\n\t\t\thn = []; // []; //new Array(1);\n\t\t\tv = []; // new Array(vsize);\n\t\t\tc = new Int32Array(BMAX + 1); // new Array(BMAX + 1);\n\t\t\tr = []; // new Array(3);\n\t\t\tu = new Int32Array(BMAX); // new Array(BMAX);\n\t\t\tx = new Int32Array(BMAX + 1); // new Array(BMAX + 1);\n\t\t}\n\t\tif (v.length < vsize) {\n\t\t\tv = []; // new Array(vsize);\n\t\t}\n\t\tfor (i = 0; i < vsize; i++) {\n\t\t\tv[i] = 0;\n\t\t}\n\t\tfor (i = 0; i < BMAX + 1; i++) {\n\t\t\tc[i] = 0;\n\t\t}\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\tr[i] = 0;\n\t\t}\n\t\t// for(int i=0; i<BMAX; i++){u[i]=0;}\n\t\tu.set(c.subarray(0, BMAX), 0);\n\t\t// for(int i=0; i<BMAX+1; i++){x[i]=0;}\n\t\tx.set(c.subarray(0, BMAX + 1), 0);\n\t}\n\n\tthat.inflate_trees_bits = function (c, // 19 code lengths\n\t\tbb, // bits tree desired/actual depth\n\t\ttb, // bits tree result\n\t\thp, // space for trees\n\t\tz // for messages\n\t) {\n\t\tlet result;\n\t\tinitWorkArea(19);\n\t\thn[0] = 0;\n\t\tresult = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v);\n\n\t\tif (result == Z_DATA_ERROR) {\n\t\t\tz.msg = \"oversubscribed dynamic bit lengths tree\";\n\t\t} else if (result == Z_BUF_ERROR || bb[0] === 0) {\n\t\t\tz.msg = \"incomplete dynamic bit lengths tree\";\n\t\t\tresult = Z_DATA_ERROR;\n\t\t}\n\t\treturn result;\n\t};\n\n\tthat.inflate_trees_dynamic = function (nl, // number of literal/length codes\n\t\tnd, // number of distance codes\n\t\tc, // that many (total) code lengths\n\t\tbl, // literal desired/actual bit depth\n\t\tbd, // distance desired/actual bit depth\n\t\ttl, // literal/length tree result\n\t\ttd, // distance tree result\n\t\thp, // space for trees\n\t\tz // for messages\n\t) {\n\t\tlet result;\n\n\t\t// build literal/length tree\n\t\tinitWorkArea(288);\n\t\thn[0] = 0;\n\t\tresult = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v);\n\t\tif (result != Z_OK || bl[0] === 0) {\n\t\t\tif (result == Z_DATA_ERROR) {\n\t\t\t\tz.msg = \"oversubscribed literal/length tree\";\n\t\t\t} else if (result != Z_MEM_ERROR) {\n\t\t\t\tz.msg = \"incomplete literal/length tree\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t// build distance tree\n\t\tinitWorkArea(288);\n\t\tresult = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v);\n\n\t\tif (result != Z_OK || (bd[0] === 0 && nl > 257)) {\n\t\t\tif (result == Z_DATA_ERROR) {\n\t\t\t\tz.msg = \"oversubscribed distance tree\";\n\t\t\t} else if (result == Z_BUF_ERROR) {\n\t\t\t\tz.msg = \"incomplete distance tree\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t} else if (result != Z_MEM_ERROR) {\n\t\t\t\tz.msg = \"empty distance tree with lengths\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\treturn Z_OK;\n\t};\n\n}\n\nInfTree.inflate_trees_fixed = function (bl, // literal desired/actual bit depth\n\tbd, // distance desired/actual bit depth\n\ttl,// literal/length tree result\n\ttd// distance tree result\n) {\n\tbl[0] = fixed_bl;\n\tbd[0] = fixed_bd;\n\ttl[0] = fixed_tl;\n\ttd[0] = fixed_td;\n\treturn Z_OK;\n};\n\n// InfCodes\n\n// waiting for \"i:\"=input,\n// \"o:\"=output,\n// \"x:\"=nothing\nconst START = 0; // x: set up for LEN\nconst LEN = 1; // i: get length/literal/eob next\nconst LENEXT = 2; // i: getting length extra (have base)\nconst DIST = 3; // i: get distance next\nconst DISTEXT = 4;// i: getting distance extra\nconst COPY = 5; // o: copying bytes in win, waiting\n// for space\nconst LIT = 6; // o: got literal, waiting for output\n// space\nconst WASH = 7; // o: got eob, possibly still output\n// waiting\nconst END = 8; // x: got eob and all data flushed\nconst BADCODE = 9;// x: got error\n\nfunction InfCodes() {\n\tconst that = this;\n\n\tlet mode; // current inflate_codes mode\n\n\t// mode dependent information\n\tlet len = 0;\n\n\tlet tree; // pointer into tree\n\tlet tree_index = 0;\n\tlet need = 0; // bits needed\n\n\tlet lit = 0;\n\n\t// if EXT or COPY, where and how much\n\tlet get = 0; // bits to get for extra\n\tlet dist = 0; // distance back to copy from\n\n\tlet lbits = 0; // ltree bits decoded per branch\n\tlet dbits = 0; // dtree bits decoder per branch\n\tlet ltree; // literal/length/eob tree\n\tlet ltree_index = 0; // literal/length/eob tree\n\tlet dtree; // distance tree\n\tlet dtree_index = 0; // distance tree\n\n\t// Called with number of bytes left to write in win at least 258\n\t// (the maximum string length) and number of input bytes available\n\t// at least ten. The ten bytes are six bytes for the longest length/\n\t// distance pair plus four bytes for overloading the bit buffer.\n\n\tfunction inflate_fast(bl, bd, tl, tl_index, td, td_index, s, z) {\n\t\tlet t; // temporary pointer\n\t\tlet tp; // temporary pointer\n\t\tlet tp_index; // temporary pointer\n\t\tlet e; // extra bits or operation\n\t\tlet b; // bit buffer\n\t\tlet k; // bits in bit buffer\n\t\tlet p; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\t\tlet ml; // mask for literal/length tree\n\t\tlet md; // mask for distance tree\n\t\tlet c; // bytes to copy\n\t\tlet d; // distance back to copy from\n\t\tlet r; // copy source pointer\n\n\t\tlet tp_index_t_3; // (tp_index+t)*3\n\n\t\t// load input, output, bit values\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = s.bitb;\n\t\tk = s.bitk;\n\t\tq = s.write;\n\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t// initialize masks\n\t\tml = inflate_mask[bl];\n\t\tmd = inflate_mask[bd];\n\n\t\t// do until not enough input or output space for fast loop\n\t\tdo { // assume called with m >= 258 && n >= 10\n\t\t\t// get literal/length code\n\t\t\twhile (k < (20)) { // max bits for literal/length code\n\t\t\t\tn--;\n\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\tk += 8;\n\t\t\t}\n\n\t\t\tt = b & ml;\n\t\t\ttp = tl;\n\t\t\ttp_index = tl_index;\n\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\tif ((e = tp[tp_index_t_3]) === 0) {\n\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\ts.win[q++] = /* (byte) */tp[tp_index_t_3 + 2];\n\t\t\t\tm--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdo {\n\n\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\tif ((e & 16) !== 0) {\n\t\t\t\t\te &= 15;\n\t\t\t\t\tc = tp[tp_index_t_3 + 2] + (/* (int) */b & inflate_mask[e]);\n\n\t\t\t\t\tb >>= e;\n\t\t\t\t\tk -= e;\n\n\t\t\t\t\t// decode distance base of block to copy\n\t\t\t\t\twhile (k < (15)) { // max bits for distance code\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tt = b & md;\n\t\t\t\t\ttp = td;\n\t\t\t\t\ttp_index = td_index;\n\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\te = tp[tp_index_t_3];\n\n\t\t\t\t\tdo {\n\n\t\t\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\t\t\tif ((e & 16) !== 0) {\n\t\t\t\t\t\t\t// get extra bits to add to distance base\n\t\t\t\t\t\t\te &= 15;\n\t\t\t\t\t\t\twhile (k < (e)) { // get extra bits (up to 13)\n\t\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\td = tp[tp_index_t_3 + 2] + (b & inflate_mask[e]);\n\n\t\t\t\t\t\t\tb >>= (e);\n\t\t\t\t\t\t\tk -= (e);\n\n\t\t\t\t\t\t\t// do the copy\n\t\t\t\t\t\t\tm -= c;\n\t\t\t\t\t\t\tif (q >= d) { // offset before dest\n\t\t\t\t\t\t\t\t// just copy\n\t\t\t\t\t\t\t\tr = q - d;\n\t\t\t\t\t\t\t\tif (q - r > 0 && 2 > (q - r)) {\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++]; // minimum\n\t\t\t\t\t\t\t\t\t// count is\n\t\t\t\t\t\t\t\t\t// three,\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++]; // so unroll\n\t\t\t\t\t\t\t\t\t// loop a\n\t\t\t\t\t\t\t\t\t// little\n\t\t\t\t\t\t\t\t\tc -= 2;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + 2), q);\n\t\t\t\t\t\t\t\t\tq += 2;\n\t\t\t\t\t\t\t\t\tr += 2;\n\t\t\t\t\t\t\t\t\tc -= 2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else { // else offset after destination\n\t\t\t\t\t\t\t\tr = q - d;\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\tr += s.end; // force pointer in win\n\t\t\t\t\t\t\t\t} while (r < 0); // covers invalid distances\n\t\t\t\t\t\t\t\te = s.end - r;\n\t\t\t\t\t\t\t\tif (c > e) { // if source crosses,\n\t\t\t\t\t\t\t\t\tc -= e; // wrapped copy\n\t\t\t\t\t\t\t\t\tif (q - r > 0 && e > (q - r)) {\n\t\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++];\n\t\t\t\t\t\t\t\t\t\t} while (--e !== 0);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + e), q);\n\t\t\t\t\t\t\t\t\t\tq += e;\n\t\t\t\t\t\t\t\t\t\tr += e;\n\t\t\t\t\t\t\t\t\t\te = 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tr = 0; // copy rest from start of win\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// copy all or what's left\n\t\t\t\t\t\t\tif (q - r > 0 && c > (q - r)) {\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++];\n\t\t\t\t\t\t\t\t} while (--c !== 0);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + c), q);\n\t\t\t\t\t\t\t\tq += c;\n\t\t\t\t\t\t\t\tr += c;\n\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if ((e & 64) === 0) {\n\t\t\t\t\t\t\tt += tp[tp_index_t_3 + 2];\n\t\t\t\t\t\t\tt += (b & inflate_mask[e]);\n\t\t\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\t\t\te = tp[tp_index_t_3];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tz.msg = \"invalid distance code\";\n\n\t\t\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\t\t\tn += c;\n\t\t\t\t\t\t\tp -= c;\n\t\t\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\n\t\t\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t\t\t} while (true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ((e & 64) === 0) {\n\t\t\t\t\tt += tp[tp_index_t_3 + 2];\n\t\t\t\t\tt += (b & inflate_mask[e]);\n\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\tif ((e = tp[tp_index_t_3]) === 0) {\n\n\t\t\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\t\t\ts.win[q++] = /* (byte) */tp[tp_index_t_3 + 2];\n\t\t\t\t\t\tm--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if ((e & 32) !== 0) {\n\n\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\tn += c;\n\t\t\t\t\tp -= c;\n\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\n\t\t\t\t\treturn Z_STREAM_END;\n\t\t\t\t} else {\n\t\t\t\t\tz.msg = \"invalid literal/length code\";\n\n\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\tn += c;\n\t\t\t\t\tp -= c;\n\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\n\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t} while (true);\n\t\t} while (m >= 258 && n >= 10);\n\n\t\t// not enough input or output--restore pointers and return\n\t\tc = z.avail_in - n;\n\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\tn += c;\n\t\tp -= c;\n\t\tk -= c << 3;\n\n\t\ts.bitb = b;\n\t\ts.bitk = k;\n\t\tz.avail_in = n;\n\t\tz.total_in += p - z.next_in_index;\n\t\tz.next_in_index = p;\n\t\ts.write = q;\n\n\t\treturn Z_OK;\n\t}\n\n\tthat.init = function (bl, bd, tl, tl_index, td, td_index) {\n\t\tmode = START;\n\t\tlbits = /* (byte) */bl;\n\t\tdbits = /* (byte) */bd;\n\t\tltree = tl;\n\t\tltree_index = tl_index;\n\t\tdtree = td;\n\t\tdtree_index = td_index;\n\t\ttree = null;\n\t};\n\n\tthat.proc = function (s, z, r) {\n\t\tlet j; // temporary storage\n\t\tlet tindex; // temporary pointer\n\t\tlet e; // extra bits or operation\n\t\tlet b = 0; // bit buffer\n\t\tlet k = 0; // bits in bit buffer\n\t\tlet p = 0; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\t\tlet f; // pointer to copy strings from\n\n\t\t// copy input/output information to locals (UPDATE macro restores)\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = s.bitb;\n\t\tk = s.bitk;\n\t\tq = s.write;\n\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t// process input and output based on current state\n\t\twhile (true) {\n\t\t\tswitch (mode) {\n\t\t\t\t// waiting for \"i:\"=input, \"o:\"=output, \"x:\"=nothing\n\t\t\t\tcase START: // x: set up for LEN\n\t\t\t\t\tif (m >= 258 && n >= 10) {\n\n\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\tr = inflate_fast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, s, z);\n\n\t\t\t\t\t\tp = z.next_in_index;\n\t\t\t\t\t\tn = z.avail_in;\n\t\t\t\t\t\tb = s.bitb;\n\t\t\t\t\t\tk = s.bitk;\n\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\tif (r != Z_OK) {\n\t\t\t\t\t\t\tmode = r == Z_STREAM_END ? WASH : BADCODE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tneed = lbits;\n\t\t\t\t\ttree = ltree;\n\t\t\t\t\ttree_index = ltree_index;\n\n\t\t\t\t\tmode = LEN;\n\t\t\t\t/* falls through */\n\t\t\t\tcase LEN: // i: get length/literal/eob next\n\t\t\t\t\tj = need;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttindex = (tree_index + (b & inflate_mask[j])) * 3;\n\n\t\t\t\t\tb >>>= (tree[tindex + 1]);\n\t\t\t\t\tk -= (tree[tindex + 1]);\n\n\t\t\t\t\te = tree[tindex];\n\n\t\t\t\t\tif (e === 0) { // literal\n\t\t\t\t\t\tlit = tree[tindex + 2];\n\t\t\t\t\t\tmode = LIT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 16) !== 0) { // length\n\t\t\t\t\t\tget = e & 15;\n\t\t\t\t\t\tlen = tree[tindex + 2];\n\t\t\t\t\t\tmode = LENEXT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 64) === 0) { // next table\n\t\t\t\t\t\tneed = e;\n\t\t\t\t\t\ttree_index = tindex / 3 + tree[tindex + 2];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 32) !== 0) { // end of block\n\t\t\t\t\t\tmode = WASH;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = BADCODE; // invalid code\n\t\t\t\t\tz.msg = \"invalid literal/length code\";\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase LENEXT: // i: getting length extra (have base)\n\t\t\t\t\tj = get;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tlen += (b & inflate_mask[j]);\n\n\t\t\t\t\tb >>= j;\n\t\t\t\t\tk -= j;\n\n\t\t\t\t\tneed = dbits;\n\t\t\t\t\ttree = dtree;\n\t\t\t\t\ttree_index = dtree_index;\n\t\t\t\t\tmode = DIST;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DIST: // i: get distance next\n\t\t\t\t\tj = need;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttindex = (tree_index + (b & inflate_mask[j])) * 3;\n\n\t\t\t\t\tb >>= tree[tindex + 1];\n\t\t\t\t\tk -= tree[tindex + 1];\n\n\t\t\t\t\te = (tree[tindex]);\n\t\t\t\t\tif ((e & 16) !== 0) { // distance\n\t\t\t\t\t\tget = e & 15;\n\t\t\t\t\t\tdist = tree[tindex + 2];\n\t\t\t\t\t\tmode = DISTEXT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 64) === 0) { // next table\n\t\t\t\t\t\tneed = e;\n\t\t\t\t\t\ttree_index = tindex / 3 + tree[tindex + 2];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = BADCODE; // invalid code\n\t\t\t\t\tz.msg = \"invalid distance code\";\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase DISTEXT: // i: getting distance extra\n\t\t\t\t\tj = get;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tdist += (b & inflate_mask[j]);\n\n\t\t\t\t\tb >>= j;\n\t\t\t\t\tk -= j;\n\n\t\t\t\t\tmode = COPY;\n\t\t\t\t/* falls through */\n\t\t\t\tcase COPY: // o: copying bytes in win, waiting for space\n\t\t\t\t\tf = q - dist;\n\t\t\t\t\twhile (f < 0) { // modulo win size-\"while\" instead\n\t\t\t\t\t\tf += s.end; // of \"if\" handles invalid distances\n\t\t\t\t\t}\n\t\t\t\t\twhile (len !== 0) {\n\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ts.win[q++] = s.win[f++];\n\t\t\t\t\t\tm--;\n\n\t\t\t\t\t\tif (f == s.end)\n\t\t\t\t\t\t\tf = 0;\n\t\t\t\t\t\tlen--;\n\t\t\t\t\t}\n\t\t\t\t\tmode = START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIT: // o: got literal, waiting for output space\n\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\n\t\t\t\t\ts.win[q++] = /* (byte) */lit;\n\t\t\t\t\tm--;\n\n\t\t\t\t\tmode = START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase WASH: // o: got eob, possibly more output\n\t\t\t\t\tif (k > 7) { // return unused byte, if any\n\t\t\t\t\t\tk -= 8;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t\tp--; // can always return one\n\t\t\t\t\t}\n\n\t\t\t\t\ts.write = q;\n\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\tq = s.write;\n\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\tif (s.read != s.write) {\n\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tmode = END;\n\t\t\t\t/* falls through */\n\t\t\t\tcase END:\n\t\t\t\t\tr = Z_STREAM_END;\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase BADCODE: // x: got error\n\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tdefault:\n\t\t\t\t\tr = Z_STREAM_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.free = function () {\n\t\t// ZFREE(z, c);\n\t};\n\n}\n\n// InfBlocks\n\n// Table for deflate from PKZIP's appnote.txt.\nconst border = [ // Order of the bit length code lengths\n\t16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n\nconst TYPE = 0; // get type bits (3, including end bit)\nconst LENS = 1; // get lengths for stored\nconst STORED = 2;// processing stored block\nconst TABLE = 3; // get table lengths\nconst BTREE = 4; // get bit lengths tree for a dynamic\n// block\nconst DTREE = 5; // get length, distance trees for a\n// dynamic block\nconst CODES = 6; // processing fixed or dynamic block\nconst DRY = 7; // output remaining win bytes\nconst DONELOCKS = 8; // finished last block, done\nconst BADBLOCKS = 9; // ot a data error--stuck here\n\nfunction InfBlocks(z, w) {\n\tconst that = this;\n\n\tlet mode = TYPE; // current inflate_block mode\n\n\tlet left = 0; // if STORED, bytes left to copy\n\n\tlet table = 0; // table lengths (14 bits)\n\tlet index = 0; // index into blens (or border)\n\tlet blens; // bit lengths of codes\n\tconst bb = [0]; // bit length tree depth\n\tconst tb = [0]; // bit length decoding tree\n\n\tconst codes = new InfCodes(); // if CODES, current state\n\n\tlet last = 0; // true if this block is the last block\n\n\tlet hufts = new Int32Array(MANY * 3); // single malloc for tree space\n\tconst check = 0; // check on output\n\tconst inftree = new InfTree();\n\n\tthat.bitk = 0; // bits in bit buffer\n\tthat.bitb = 0; // bit buffer\n\tthat.win = new Uint8Array(w); // sliding win\n\tthat.end = w; // one byte after sliding win\n\tthat.read = 0; // win read pointer\n\tthat.write = 0; // win write pointer\n\n\tthat.reset = function (z, c) {\n\t\tif (c)\n\t\t\tc[0] = check;\n\t\t// if (mode == BTREE || mode == DTREE) {\n\t\t// }\n\t\tif (mode == CODES) {\n\t\t\tcodes.free(z);\n\t\t}\n\t\tmode = TYPE;\n\t\tthat.bitk = 0;\n\t\tthat.bitb = 0;\n\t\tthat.read = that.write = 0;\n\t};\n\n\tthat.reset(z, null);\n\n\t// copy as much as possible from the sliding win to the output area\n\tthat.inflate_flush = function (z, r) {\n\t\tlet n;\n\t\tlet p;\n\t\tlet q;\n\n\t\t// local copies of source and destination pointers\n\t\tp = z.next_out_index;\n\t\tq = that.read;\n\n\t\t// compute number of bytes to copy as far as end of win\n\t\tn = /* (int) */((q <= that.write ? that.write : that.end) - q);\n\t\tif (n > z.avail_out)\n\t\t\tn = z.avail_out;\n\t\tif (n !== 0 && r == Z_BUF_ERROR)\n\t\t\tr = Z_OK;\n\n\t\t// update counters\n\t\tz.avail_out -= n;\n\t\tz.total_out += n;\n\n\t\t// copy as far as end of win\n\t\tz.next_out.set(that.win.subarray(q, q + n), p);\n\t\tp += n;\n\t\tq += n;\n\n\t\t// see if more to copy at beginning of win\n\t\tif (q == that.end) {\n\t\t\t// wrap pointers\n\t\t\tq = 0;\n\t\t\tif (that.write == that.end)\n\t\t\t\tthat.write = 0;\n\n\t\t\t// compute bytes to copy\n\t\t\tn = that.write - q;\n\t\t\tif (n > z.avail_out)\n\t\t\t\tn = z.avail_out;\n\t\t\tif (n !== 0 && r == Z_BUF_ERROR)\n\t\t\t\tr = Z_OK;\n\n\t\t\t// update counters\n\t\t\tz.avail_out -= n;\n\t\t\tz.total_out += n;\n\n\t\t\t// copy\n\t\t\tz.next_out.set(that.win.subarray(q, q + n), p);\n\t\t\tp += n;\n\t\t\tq += n;\n\t\t}\n\n\t\t// update pointers\n\t\tz.next_out_index = p;\n\t\tthat.read = q;\n\n\t\t// done\n\t\treturn r;\n\t};\n\n\tthat.proc = function (z, r) {\n\t\tlet t; // temporary storage\n\t\tlet b; // bit buffer\n\t\tlet k; // bits in bit buffer\n\t\tlet p; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\n\t\tlet i;\n\n\t\t// copy input/output information to locals (UPDATE macro restores)\n\t\t// {\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = that.bitb;\n\t\tk = that.bitk;\n\t\t// }\n\t\t// {\n\t\tq = that.write;\n\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t// }\n\n\t\t// process input based on current state\n\t\t// DEBUG dtree\n\t\twhile (true) {\n\t\t\tlet bl, bd, tl, td, bl_, bd_, tl_, td_;\n\t\t\tswitch (mode) {\n\t\t\t\tcase TYPE:\n\n\t\t\t\t\twhile (k < (3)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\t\t\t\t\tt = /* (int) */(b & 7);\n\t\t\t\t\tlast = t & 1;\n\n\t\t\t\t\tswitch (t >>> 1) {\n\t\t\t\t\t\tcase 0: // stored\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tt = k & 7; // go to byte boundary\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tmode = LENS; // get length of stored block\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // fixed\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tbl = []; // new Array(1);\n\t\t\t\t\t\t\tbd = []; // new Array(1);\n\t\t\t\t\t\t\ttl = [[]]; // new Array(1);\n\t\t\t\t\t\t\ttd = [[]]; // new Array(1);\n\n\t\t\t\t\t\t\tInfTree.inflate_trees_fixed(bl, bd, tl, td);\n\t\t\t\t\t\t\tcodes.init(bl[0], bd[0], tl[0], 0, td[0], 0);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\tmode = CODES;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // dynamic\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\tmode = TABLE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3: // illegal\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t\tz.msg = \"invalid block type\";\n\t\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LENS:\n\n\t\t\t\t\twhile (k < (32)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((((~b) >>> 16) & 0xffff) != (b & 0xffff)) {\n\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\tz.msg = \"invalid stored block lengths\";\n\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tleft = (b & 0xffff);\n\t\t\t\t\tb = k = 0; // dump bits\n\t\t\t\t\tmode = left !== 0 ? STORED : (last !== 0 ? DRY : TYPE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase STORED:\n\t\t\t\t\tif (n === 0) {\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\tif (q == that.end && that.read !== 0) {\n\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\tr = that.inflate_flush(z, r);\n\t\t\t\t\t\t\tq = that.write;\n\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t\tif (q == that.end && that.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\n\t\t\t\t\tt = left;\n\t\t\t\t\tif (t > n)\n\t\t\t\t\t\tt = n;\n\t\t\t\t\tif (t > m)\n\t\t\t\t\t\tt = m;\n\t\t\t\t\tthat.win.set(z.read_buf(p, t), q);\n\t\t\t\t\tp += t;\n\t\t\t\t\tn -= t;\n\t\t\t\t\tq += t;\n\t\t\t\t\tm -= t;\n\t\t\t\t\tif ((left -= t) !== 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tmode = last !== 0 ? DRY : TYPE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TABLE:\n\n\t\t\t\t\twhile (k < (14)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttable = t = (b & 0x3fff);\n\t\t\t\t\tif ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) {\n\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\tz.msg = \"too many length or distance symbols\";\n\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tt = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);\n\t\t\t\t\tif (!blens || blens.length < t) {\n\t\t\t\t\t\tblens = []; // new Array(t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (i = 0; i < t; i++) {\n\t\t\t\t\t\t\tblens[i] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// {\n\t\t\t\t\tb >>>= (14);\n\t\t\t\t\tk -= (14);\n\t\t\t\t\t// }\n\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tmode = BTREE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase BTREE:\n\t\t\t\t\twhile (index < 4 + (table >>> 10)) {\n\t\t\t\t\t\twhile (k < (3)) {\n\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tblens[border[index++]] = b & 7;\n\n\t\t\t\t\t\t// {\n\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t// }\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (index < 19) {\n\t\t\t\t\t\tblens[border[index++]] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbb[0] = 7;\n\t\t\t\t\tt = inftree.inflate_trees_bits(blens, bb, tb, hufts, z);\n\t\t\t\t\tif (t != Z_OK) {\n\t\t\t\t\t\tr = t;\n\t\t\t\t\t\tif (r == Z_DATA_ERROR) {\n\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tmode = DTREE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DTREE:\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tt = table;\n\t\t\t\t\t\tif (index >= 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet j, c;\n\n\t\t\t\t\t\tt = bb[0];\n\n\t\t\t\t\t\twhile (k < (t)) {\n\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if (tb[0] == -1) {\n\t\t\t\t\t\t// System.err.println(\"null...\");\n\t\t\t\t\t\t// }\n\n\t\t\t\t\t\tt = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 1];\n\t\t\t\t\t\tc = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 2];\n\n\t\t\t\t\t\tif (c < 16) {\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\t\t\t\t\t\t\tblens[index++] = c;\n\t\t\t\t\t\t} else { // c == 16..18\n\t\t\t\t\t\t\ti = c == 18 ? 7 : c - 14;\n\t\t\t\t\t\t\tj = c == 18 ? 11 : 3;\n\n\t\t\t\t\t\t\twhile (k < (t + i)) {\n\t\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\n\t\t\t\t\t\t\tj += (b & inflate_mask[i]);\n\n\t\t\t\t\t\t\tb >>>= (i);\n\t\t\t\t\t\t\tk -= (i);\n\n\t\t\t\t\t\t\ti = index;\n\t\t\t\t\t\t\tt = table;\n\t\t\t\t\t\t\tif (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) {\n\t\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t\t\tz.msg = \"invalid bit length repeat\";\n\t\t\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tc = c == 16 ? blens[i - 1] : 0;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tblens[i++] = c;\n\t\t\t\t\t\t\t} while (--j !== 0);\n\t\t\t\t\t\t\tindex = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttb[0] = -1;\n\t\t\t\t\t// {\n\t\t\t\t\tbl_ = []; // new Array(1);\n\t\t\t\t\tbd_ = []; // new Array(1);\n\t\t\t\t\ttl_ = []; // new Array(1);\n\t\t\t\t\ttd_ = []; // new Array(1);\n\t\t\t\t\tbl_[0] = 9; // must be <= 9 for lookahead assumptions\n\t\t\t\t\tbd_[0] = 6; // must be <= 9 for lookahead assumptions\n\n\t\t\t\t\tt = table;\n\t\t\t\t\tt = inftree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), blens, bl_, bd_, tl_, td_, hufts, z);\n\n\t\t\t\t\tif (t != Z_OK) {\n\t\t\t\t\t\tif (t == Z_DATA_ERROR) {\n\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tr = t;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tcodes.init(bl_[0], bd_[0], hufts, tl_[0], hufts, td_[0]);\n\t\t\t\t\t// }\n\t\t\t\t\tmode = CODES;\n\t\t\t\t/* falls through */\n\t\t\t\tcase CODES:\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\n\t\t\t\t\tif ((r = codes.proc(that, z, r)) != Z_STREAM_END) {\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\t\t\t\t\tcodes.free(z);\n\n\t\t\t\t\tp = z.next_in_index;\n\t\t\t\t\tn = z.avail_in;\n\t\t\t\t\tb = that.bitb;\n\t\t\t\t\tk = that.bitk;\n\t\t\t\t\tq = that.write;\n\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\n\t\t\t\t\tif (last === 0) {\n\t\t\t\t\t\tmode = TYPE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = DRY;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DRY:\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\tr = that.inflate_flush(z, r);\n\t\t\t\t\tq = that.write;\n\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\tif (that.read != that.write) {\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tmode = DONELOCKS;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DONELOCKS:\n\t\t\t\t\tr = Z_STREAM_END;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\tcase BADBLOCKS:\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\n\t\t\t\tdefault:\n\t\t\t\t\tr = Z_STREAM_ERROR;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.free = function (z) {\n\t\tthat.reset(z, null);\n\t\tthat.win = null;\n\t\thufts = null;\n\t\t// ZFREE(z, s);\n\t};\n\n\tthat.set_dictionary = function (d, start, n) {\n\t\tthat.win.set(d.subarray(start, start + n), 0);\n\t\tthat.read = that.write = n;\n\t};\n\n\t// Returns true if inflate is currently at the end of a block generated\n\t// by Z_SYNC_FLUSH or Z_FULL_FLUSH.\n\tthat.sync_point = function () {\n\t\treturn mode == LENS ? 1 : 0;\n\t};\n\n}\n\n// Inflate\n\n// preset dictionary flag in zlib header\nconst PRESET_DICT = 0x20;\n\nconst Z_DEFLATED = 8;\n\nconst METHOD = 0; // waiting for method byte\nconst FLAG = 1; // waiting for flag byte\nconst DICT4 = 2; // four dictionary check bytes to go\nconst DICT3 = 3; // three dictionary check bytes to go\nconst DICT2 = 4; // two dictionary check bytes to go\nconst DICT1 = 5; // one dictionary check byte to go\nconst DICT0 = 6; // waiting for inflateSetDictionary\nconst BLOCKS = 7; // decompressing blocks\nconst DONE = 12; // finished check, done\nconst BAD = 13; // got an error--stay here\n\nconst mark = [0, 0, 0xff, 0xff];\n\nfunction Inflate() {\n\tconst that = this;\n\n\tthat.mode = 0; // current inflate mode\n\n\t// mode dependent information\n\tthat.method = 0; // if FLAGS, method byte\n\n\t// if CHECK, check values to compare\n\tthat.was = [0]; // new Array(1); // computed check value\n\tthat.need = 0; // stream check value\n\n\t// if BAD, inflateSync's marker bytes count\n\tthat.marker = 0;\n\n\t// mode independent information\n\tthat.wbits = 0; // log2(win size) (8..15, defaults to 15)\n\n\t// this.blocks; // current inflate_blocks state\n\n\tfunction inflateReset(z) {\n\t\tif (!z || !z.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\n\t\tz.total_in = z.total_out = 0;\n\t\tz.msg = null;\n\t\tz.istate.mode = BLOCKS;\n\t\tz.istate.blocks.reset(z, null);\n\t\treturn Z_OK;\n\t}\n\n\tthat.inflateEnd = function (z) {\n\t\tif (that.blocks)\n\t\t\tthat.blocks.free(z);\n\t\tthat.blocks = null;\n\t\t// ZFREE(z, z->state);\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflateInit = function (z, w) {\n\t\tz.msg = null;\n\t\tthat.blocks = null;\n\n\t\t// set win size\n\t\tif (w < 8 || w > 15) {\n\t\t\tthat.inflateEnd(z);\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\tthat.wbits = w;\n\n\t\tz.istate.blocks = new InfBlocks(z, 1 << w);\n\n\t\t// reset state\n\t\tinflateReset(z);\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflate = function (z, f) {\n\t\tlet r;\n\t\tlet b;\n\n\t\tif (!z || !z.istate || !z.next_in)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tf = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;\n\t\tr = Z_BUF_ERROR;\n\t\twhile (true) {\n\t\t\tswitch (istate.mode) {\n\t\t\t\tcase METHOD:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tif (((istate.method = z.read_byte(z.next_in_index++)) & 0xf) != Z_DEFLATED) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"unknown compression method\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((istate.method >> 4) + 8 > istate.wbits) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"invalid win size\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tistate.mode = FLAG;\n\t\t\t\t/* falls through */\n\t\t\t\tcase FLAG:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tb = (z.read_byte(z.next_in_index++)) & 0xff;\n\n\t\t\t\t\tif ((((istate.method << 8) + b) % 31) !== 0) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"incorrect header check\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((b & PRESET_DICT) === 0) {\n\t\t\t\t\t\tistate.mode = BLOCKS;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tistate.mode = DICT4;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT4:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need = ((z.read_byte(z.next_in_index++) & 0xff) << 24) & 0xff000000;\n\t\t\t\t\tistate.mode = DICT3;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT3:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += ((z.read_byte(z.next_in_index++) & 0xff) << 16) & 0xff0000;\n\t\t\t\t\tistate.mode = DICT2;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT2:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += ((z.read_byte(z.next_in_index++) & 0xff) << 8) & 0xff00;\n\t\t\t\t\tistate.mode = DICT1;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT1:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += (z.read_byte(z.next_in_index++) & 0xff);\n\t\t\t\t\tistate.mode = DICT0;\n\t\t\t\t\treturn Z_NEED_DICT;\n\t\t\t\tcase DICT0:\n\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\tz.msg = \"need dictionary\";\n\t\t\t\t\tistate.marker = 0; // can try inflateSync\n\t\t\t\t\treturn Z_STREAM_ERROR;\n\t\t\t\tcase BLOCKS:\n\n\t\t\t\t\tr = istate.blocks.proc(z, r);\n\t\t\t\t\tif (r == Z_DATA_ERROR) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tistate.marker = 0; // can try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (r == Z_OK) {\n\t\t\t\t\t\tr = f;\n\t\t\t\t\t}\n\t\t\t\t\tif (r != Z_STREAM_END) {\n\t\t\t\t\t\treturn r;\n\t\t\t\t\t}\n\t\t\t\t\tr = f;\n\t\t\t\t\tistate.blocks.reset(z, istate.was);\n\t\t\t\t\tistate.mode = DONE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DONE:\n\t\t\t\t\tz.avail_in = 0;\n\t\t\t\t\treturn Z_STREAM_END;\n\t\t\t\tcase BAD:\n\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Z_STREAM_ERROR;\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.inflateSetDictionary = function (z, dictionary, dictLength) {\n\t\tlet index = 0, length = dictLength;\n\t\tif (!z || !z.istate || z.istate.mode != DICT0)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tif (length >= (1 << istate.wbits)) {\n\t\t\tlength = (1 << istate.wbits) - 1;\n\t\t\tindex = dictLength - length;\n\t\t}\n\t\tistate.blocks.set_dictionary(dictionary, index, length);\n\t\tistate.mode = BLOCKS;\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflateSync = function (z) {\n\t\tlet n; // number of bytes to look at\n\t\tlet p; // pointer to bytes\n\t\tlet m; // number of marker bytes found in a row\n\t\tlet r, w; // temporaries to save total_in and total_out\n\n\t\t// set up\n\t\tif (!z || !z.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tif (istate.mode != BAD) {\n\t\t\tistate.mode = BAD;\n\t\t\tistate.marker = 0;\n\t\t}\n\t\tif ((n = z.avail_in) === 0)\n\t\t\treturn Z_BUF_ERROR;\n\t\tp = z.next_in_index;\n\t\tm = istate.marker;\n\n\t\t// search\n\t\twhile (n !== 0 && m < 4) {\n\t\t\tif (z.read_byte(p) == mark[m]) {\n\t\t\t\tm++;\n\t\t\t} else if (z.read_byte(p) !== 0) {\n\t\t\t\tm = 0;\n\t\t\t} else {\n\t\t\t\tm = 4 - m;\n\t\t\t}\n\t\t\tp++;\n\t\t\tn--;\n\t\t}\n\n\t\t// restore\n\t\tz.total_in += p - z.next_in_index;\n\t\tz.next_in_index = p;\n\t\tz.avail_in = n;\n\t\tistate.marker = m;\n\n\t\t// return no joy or set up to restart on a new block\n\t\tif (m != 4) {\n\t\t\treturn Z_DATA_ERROR;\n\t\t}\n\t\tr = z.total_in;\n\t\tw = z.total_out;\n\t\tinflateReset(z);\n\t\tz.total_in = r;\n\t\tz.total_out = w;\n\t\tistate.mode = BLOCKS;\n\t\treturn Z_OK;\n\t};\n\n\t// Returns true if inflate is currently at the end of a block generated\n\t// by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP\n\t// implementation to provide an additional safety check. PPP uses\n\t// Z_SYNC_FLUSH\n\t// but removes the length bytes of the resulting empty stored block. When\n\t// decompressing, PPP checks that at the end of input packet, inflate is\n\t// waiting for these length bytes.\n\tthat.inflateSyncPoint = function (z) {\n\t\tif (!z || !z.istate || !z.istate.blocks)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn z.istate.blocks.sync_point();\n\t};\n}\n\n// ZStream\n\nfunction ZStream() {\n}\n\nZStream.prototype = {\n\tinflateInit(bits) {\n\t\tconst that = this;\n\t\tthat.istate = new Inflate();\n\t\tif (!bits)\n\t\t\tbits = MAX_BITS;\n\t\treturn that.istate.inflateInit(that, bits);\n\t},\n\n\tinflate(f) {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflate(that, f);\n\t},\n\n\tinflateEnd() {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst ret = that.istate.inflateEnd(that);\n\t\tthat.istate = null;\n\t\treturn ret;\n\t},\n\n\tinflateSync() {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflateSync(that);\n\t},\n\tinflateSetDictionary(dictionary, dictLength) {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflateSetDictionary(that, dictionary, dictLength);\n\t},\n\tread_byte(start) {\n\t\tconst that = this;\n\t\treturn that.next_in[start];\n\t},\n\tread_buf(start, size) {\n\t\tconst that = this;\n\t\treturn that.next_in.subarray(start, start + size);\n\t}\n};\n\n// Inflater\n\nfunction ZipInflate(options) {\n\tconst that = this;\n\tconst z = new ZStream();\n\tconst bufsize = options && options.chunkSize ? Math.floor(options.chunkSize * 2) : 128 * 1024;\n\tconst flush = Z_NO_FLUSH;\n\tconst buf = new Uint8Array(bufsize);\n\tlet nomoreinput = false;\n\n\tz.inflateInit();\n\tz.next_out = buf;\n\n\tthat.append = function (data, onprogress) {\n\t\tconst buffers = [];\n\t\tlet err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;\n\t\tif (data.length === 0)\n\t\t\treturn;\n\t\tz.next_in_index = 0;\n\t\tz.next_in = data;\n\t\tz.avail_in = data.length;\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\tif ((z.avail_in === 0) && (!nomoreinput)) { // if buffer is empty and more input is available, refill it\n\t\t\t\tz.next_in_index = 0;\n\t\t\t\tnomoreinput = true;\n\t\t\t}\n\t\t\terr = z.inflate(flush);\n\t\t\tif (nomoreinput && (err === Z_BUF_ERROR)) {\n\t\t\t\tif (z.avail_in !== 0)\n\t\t\t\t\tthrow new Error(\"inflating: bad input\");\n\t\t\t} else if (err !== Z_OK && err !== Z_STREAM_END)\n\t\t\t\tthrow new Error(\"inflating: \" + z.msg);\n\t\t\tif ((nomoreinput || err === Z_STREAM_END) && (z.avail_in === data.length))\n\t\t\t\tthrow new Error(\"inflating: bad input\");\n\t\t\tif (z.next_out_index)\n\t\t\t\tif (z.next_out_index === bufsize)\n\t\t\t\t\tbuffers.push(new Uint8Array(buf));\n\t\t\t\telse\n\t\t\t\t\tbuffers.push(buf.subarray(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t\tif (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {\n\t\t\t\tonprogress(z.next_in_index);\n\t\t\t\tlastIndex = z.next_in_index;\n\t\t\t}\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tif (buffers.length > 1) {\n\t\t\tarray = new Uint8Array(bufferSize);\n\t\t\tbuffers.forEach(function (chunk) {\n\t\t\t\tarray.set(chunk, bufferIndex);\n\t\t\t\tbufferIndex += chunk.length;\n\t\t\t});\n\t\t} else {\n\t\t\tarray = buffers[0] ? new Uint8Array(buffers[0]) : new Uint8Array();\n\t\t}\n\t\treturn array;\n\t};\n\tthat.flush = function () {\n\t\tz.inflateEnd();\n\t};\n}\n\nexport {\n\tZipInflate as Inflate\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst MAX_32_BITS = 0xffffffff;\nconst MAX_16_BITS = 0xffff;\nconst COMPRESSION_METHOD_DEFLATE = 0x08;\nconst COMPRESSION_METHOD_STORE = 0x00;\nconst COMPRESSION_METHOD_AES = 0x63;\n\nconst LOCAL_FILE_HEADER_SIGNATURE = 0x04034b50;\nconst SPLIT_ZIP_FILE_SIGNATURE = 0x08074b50;\nconst DATA_DESCRIPTOR_RECORD_SIGNATURE = SPLIT_ZIP_FILE_SIGNATURE;\nconst CENTRAL_FILE_HEADER_SIGNATURE = 0x02014b50;\nconst END_OF_CENTRAL_DIR_SIGNATURE = 0x06054b50;\nconst ZIP64_END_OF_CENTRAL_DIR_SIGNATURE = 0x06064b50;\nconst ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE = 0x07064b50;\nconst END_OF_CENTRAL_DIR_LENGTH = 22;\nconst ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH = 20;\nconst ZIP64_END_OF_CENTRAL_DIR_LENGTH = 56;\nconst ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH = END_OF_CENTRAL_DIR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LENGTH;\n\nconst EXTRAFIELD_TYPE_ZIP64 = 0x0001;\nconst EXTRAFIELD_TYPE_AES = 0x9901;\nconst EXTRAFIELD_TYPE_NTFS = 0x000a;\nconst EXTRAFIELD_TYPE_NTFS_TAG1 = 0x0001;\nconst EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP = 0x5455;\nconst EXTRAFIELD_TYPE_UNICODE_PATH = 0x7075;\nconst EXTRAFIELD_TYPE_UNICODE_COMMENT = 0x6375;\nconst EXTRAFIELD_TYPE_USDZ = 0x1986;\n\nconst BITFLAG_ENCRYPTED = 0x01;\nconst BITFLAG_LEVEL = 0x06;\nconst BITFLAG_DATA_DESCRIPTOR = 0x0008;\nconst BITFLAG_LANG_ENCODING_FLAG = 0x0800;\nconst FILE_ATTR_MSDOS_DIR_MASK = 0x10;\nconst FILE_ATTR_UNIX_DIR_MASK = 0x4000;\nconst FILE_ATTR_UNIX_EXECUTABLE_MASK = 0o111;\nconst FILE_ATTR_UNIX_DEFAULT_MASK = 0o644;\n\nconst VERSION_DEFLATE = 0x14;\nconst VERSION_ZIP64 = 0x2D;\nconst VERSION_AES = 0x33;\n\nconst DIRECTORY_SIGNATURE = \"/\";\n\nconst MAX_DATE = new Date(2107, 11, 31);\nconst MIN_DATE = new Date(1980, 0, 1);\n\nconst UNDEFINED_VALUE = undefined;\nconst UNDEFINED_TYPE = \"undefined\";\nconst FUNCTION_TYPE = \"function\";\n\nexport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tSPLIT_ZIP_FILE_SIGNATURE,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tDATA_DESCRIPTOR_RECORD_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEXTRAFIELD_TYPE_UNICODE_PATH,\n\tEXTRAFIELD_TYPE_UNICODE_COMMENT,\n\tEXTRAFIELD_TYPE_USDZ,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_LEVEL,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tFILE_ATTR_UNIX_DIR_MASK,\n\tFILE_ATTR_UNIX_EXECUTABLE_MASK,\n\tFILE_ATTR_UNIX_DEFAULT_MASK,\n\tVERSION_DEFLATE,\n\tVERSION_ZIP64,\n\tVERSION_AES,\n\tDIRECTORY_SIGNATURE,\n\tMIN_DATE,\n\tMAX_DATE,\n\tUNDEFINED_VALUE,\n\tUNDEFINED_TYPE,\n\tFUNCTION_TYPE\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TransformStream */\n\nexport {\n\tStreamAdapter\n};\n\nclass StreamAdapter {\n\n\tconstructor(Codec) {\n\t\treturn class extends TransformStream {\n\t\t\tconstructor(_format, options) {\n\t\t\t\tconst codec = new Codec(options);\n\t\t\t\tsuper({\n\t\t\t\t\ttransform(chunk, controller) {\n\t\t\t\t\t\tcontroller.enqueue(codec.append(chunk));\n\t\t\t\t\t},\n\t\t\t\t\tflush(controller) {\n\t\t\t\t\t\tconst chunk = codec.flush();\n\t\t\t\t\t\tif (chunk) {\n\t\t\t\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t}\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global navigator, CompressionStream, DecompressionStream */\n\nimport {\n\tUNDEFINED_VALUE,\n\tUNDEFINED_TYPE\n} from \"./constants.js\";\nimport { StreamAdapter } from \"./streams/stream-adapter.js\";\n\nconst MINIMUM_CHUNK_SIZE = 64;\nlet maxWorkers = 2;\ntry {\n\tif (typeof navigator != UNDEFINED_TYPE && navigator.hardwareConcurrency) {\n\t\tmaxWorkers = navigator.hardwareConcurrency;\n\t}\n\t// eslint-disable-next-line no-unused-vars\n} catch (_) {\n\t// ignored\n}\nconst DEFAULT_CONFIGURATION = {\n\tchunkSize: 512 * 1024,\n\tmaxWorkers,\n\tterminateWorkerTimeout: 5000,\n\tuseWebWorkers: true,\n\tuseCompressionStream: true,\n\tworkerScripts: UNDEFINED_VALUE,\n\tCompressionStreamNative: typeof CompressionStream != UNDEFINED_TYPE && CompressionStream,\n\tDecompressionStreamNative: typeof DecompressionStream != UNDEFINED_TYPE && DecompressionStream\n};\n\nconst config = Object.assign({}, DEFAULT_CONFIGURATION);\n\nexport {\n\tconfigure,\n\tgetConfiguration,\n\tgetChunkSize\n};\n\nfunction getConfiguration() {\n\treturn config;\n}\n\nfunction getChunkSize(config) {\n\treturn Math.max(config.chunkSize, MINIMUM_CHUNK_SIZE);\n}\n\nfunction configure(configuration) {\n\tconst {\n\t\tbaseURL,\n\t\tchunkSize,\n\t\tmaxWorkers,\n\t\tterminateWorkerTimeout,\n\t\tuseCompressionStream,\n\t\tuseWebWorkers,\n\t\tDeflate,\n\t\tInflate,\n\t\tCompressionStream,\n\t\tDecompressionStream,\n\t\tworkerScripts\n\t} = configuration;\n\tsetIfDefined(\"baseURL\", baseURL);\n\tsetIfDefined(\"chunkSize\", chunkSize);\n\tsetIfDefined(\"maxWorkers\", maxWorkers);\n\tsetIfDefined(\"terminateWorkerTimeout\", terminateWorkerTimeout);\n\tsetIfDefined(\"useCompressionStream\", useCompressionStream);\n\tsetIfDefined(\"useWebWorkers\", useWebWorkers);\n\tif (Deflate) {\n\t\tconfig.CompressionStream = new StreamAdapter(Deflate);\n\t}\n\tif (Inflate) {\n\t\tconfig.DecompressionStream = new StreamAdapter(Inflate);\n\t}\n\tsetIfDefined(\"CompressionStream\", CompressionStream);\n\tsetIfDefined(\"DecompressionStream\", DecompressionStream);\n\tif (workerScripts !== UNDEFINED_VALUE) {\n\t\tconst { deflate, inflate } = workerScripts;\n\t\tif (deflate || inflate) {\n\t\t\tif (!config.workerScripts) {\n\t\t\t\tconfig.workerScripts = {};\n\t\t\t}\n\t\t}\n\t\tif (deflate) {\n\t\t\tif (!Array.isArray(deflate)) {\n\t\t\t\tthrow new Error(\"workerScripts.deflate must be an array\");\n\t\t\t}\n\t\t\tconfig.workerScripts.deflate = deflate;\n\t\t}\n\t\tif (inflate) {\n\t\t\tif (!Array.isArray(inflate)) {\n\t\t\t\tthrow new Error(\"workerScripts.inflate must be an array\");\n\t\t\t}\n\t\t\tconfig.workerScripts.inflate = inflate;\n\t\t}\n\t}\n}\n\nfunction setIfDefined(propertyName, propertyValue) {\n\tif (propertyValue !== UNDEFINED_VALUE) {\n\t\tconfig[propertyName] = propertyValue;\n\t}\n}\n","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport { getMimeType as getDefaultMimeType } from \"./default-mime-type.js\";\n\nconst table = {\n\t\"application\": {\n\t\t\"andrew-inset\": \"ez\",\n\t\t\"annodex\": \"anx\",\n\t\t\"atom+xml\": \"atom\",\n\t\t\"atomcat+xml\": \"atomcat\",\n\t\t\"atomserv+xml\": \"atomsrv\",\n\t\t\"bbolin\": \"lin\",\n\t\t\"cu-seeme\": \"cu\",\n\t\t\"davmount+xml\": \"davmount\",\n\t\t\"dsptype\": \"tsp\",\n\t\t\"ecmascript\": [\n\t\t\t\"es\",\n\t\t\t\"ecma\"\n\t\t],\n\t\t\"futuresplash\": \"spl\",\n\t\t\"hta\": \"hta\",\n\t\t\"java-archive\": \"jar\",\n\t\t\"java-serialized-object\": \"ser\",\n\t\t\"java-vm\": \"class\",\n\t\t\"m3g\": \"m3g\",\n\t\t\"mac-binhex40\": \"hqx\",\n\t\t\"mathematica\": [\n\t\t\t\"nb\",\n\t\t\t\"ma\",\n\t\t\t\"mb\"\n\t\t],\n\t\t\"msaccess\": \"mdb\",\n\t\t\"msword\": [\n\t\t\t\"doc\",\n\t\t\t\"dot\",\n\t\t\t\"wiz\"\n\t\t],\n\t\t\"mxf\": \"mxf\",\n\t\t\"oda\": \"oda\",\n\t\t\"ogg\": \"ogx\",\n\t\t\"pdf\": \"pdf\",\n\t\t\"pgp-keys\": \"key\",\n\t\t\"pgp-signature\": [\n\t\t\t\"asc\",\n\t\t\t\"sig\"\n\t\t],\n\t\t\"pics-rules\": \"prf\",\n\t\t\"postscript\": [\n\t\t\t\"ps\",\n\t\t\t\"ai\",\n\t\t\t\"eps\",\n\t\t\t\"epsi\",\n\t\t\t\"epsf\",\n\t\t\t\"eps2\",\n\t\t\t\"eps3\"\n\t\t],\n\t\t\"rar\": \"rar\",\n\t\t\"rdf+xml\": \"rdf\",\n\t\t\"rss+xml\": \"rss\",\n\t\t\"rtf\": \"rtf\",\n\t\t\"xhtml+xml\": [\n\t\t\t\"xhtml\",\n\t\t\t\"xht\"\n\t\t],\n\t\t\"xml\": [\n\t\t\t\"xml\",\n\t\t\t\"xsl\",\n\t\t\t\"xsd\",\n\t\t\t\"xpdl\"\n\t\t],\n\t\t\"xspf+xml\": \"xspf\",\n\t\t\"zip\": \"zip\",\n\t\t\"vnd.android.package-archive\": \"apk\",\n\t\t\"vnd.cinderella\": \"cdy\",\n\t\t\"vnd.google-earth.kml+xml\": \"kml\",\n\t\t\"vnd.google-earth.kmz\": \"kmz\",\n\t\t\"vnd.mozilla.xul+xml\": \"xul\",\n\t\t\"vnd.ms-excel\": [\n\t\t\t\"xls\",\n\t\t\t\"xlb\",\n\t\t\t\"xlt\",\n\t\t\t\"xlm\",\n\t\t\t\"xla\",\n\t\t\t\"xlc\",\n\t\t\t\"xlw\"\n\t\t],\n\t\t\"vnd.ms-pki.seccat\": \"cat\",\n\t\t\"vnd.ms-pki.stl\": \"stl\",\n\t\t\"vnd.ms-powerpoint\": [\n\t\t\t\"ppt\",\n\t\t\t\"pps\",\n\t\t\t\"pot\",\n\t\t\t\"ppa\",\n\t\t\t\"pwz\"\n\t\t],\n\t\t\"vnd.oasis.opendocument.chart\": \"odc\",\n\t\t\"vnd.oasis.opendocument.database\": \"odb\",\n\t\t\"vnd.oasis.opendocument.formula\": \"odf\",\n\t\t\"vnd.oasis.opendocument.graphics\": \"odg\",\n\t\t\"vnd.oasis.opendocument.graphics-template\": \"otg\",\n\t\t\"vnd.oasis.opendocument.image\": \"odi\",\n\t\t\"vnd.oasis.opendocument.presentation\": \"odp\",\n\t\t\"vnd.oasis.opendocument.presentation-template\": \"otp\",\n\t\t\"vnd.oasis.opendocument.spreadsheet\": \"ods\",\n\t\t\"vnd.oasis.opendocument.spreadsheet-template\": \"ots\",\n\t\t\"vnd.oasis.opendocument.text\": \"odt\",\n\t\t\"vnd.oasis.opendocument.text-master\": [\n\t\t\t\"odm\",\n\t\t\t\"otm\"\n\t\t],\n\t\t\"vnd.oasis.opendocument.text-template\": \"ott\",\n\t\t\"vnd.oasis.opendocument.text-web\": \"oth\",\n\t\t\"vnd.openxmlformats-officedocument.spreadsheetml.sheet\": \"xlsx\",\n\t\t\"vnd.openxmlformats-officedocument.spreadsheetml.template\": \"xltx\",\n\t\t\"vnd.openxmlformats-officedocument.presentationml.presentation\": \"pptx\",\n\t\t\"vnd.openxmlformats-officedocument.presentationml.slideshow\": \"ppsx\",\n\t\t\"vnd.openxmlformats-officedocument.presentationml.template\": \"potx\",\n\t\t\"vnd.openxmlformats-officedocument.wordprocessingml.document\": \"docx\",\n\t\t\"vnd.openxmlformats-officedocument.wordprocessingml.template\": \"dotx\",\n\t\t\"vnd.smaf\": \"mmf\",\n\t\t\"vnd.stardivision.calc\": \"sdc\",\n\t\t\"vnd.stardivision.chart\": \"sds\",\n\t\t\"vnd.stardivision.draw\": \"sda\",\n\t\t\"vnd.stardivision.impress\": \"sdd\",\n\t\t\"vnd.stardivision.math\": [\n\t\t\t\"sdf\",\n\t\t\t\"smf\"\n\t\t],\n\t\t\"vnd.stardivision.writer\": [\n\t\t\t\"sdw\",\n\t\t\t\"vor\"\n\t\t],\n\t\t\"vnd.stardivision.writer-global\": \"sgl\",\n\t\t\"vnd.sun.xml.calc\": \"sxc\",\n\t\t\"vnd.sun.xml.calc.template\": \"stc\",\n\t\t\"vnd.sun.xml.draw\": \"sxd\",\n\t\t\"vnd.sun.xml.draw.template\": \"std\",\n\t\t\"vnd.sun.xml.impress\": \"sxi\",\n\t\t\"vnd.sun.xml.impress.template\": \"sti\",\n\t\t\"vnd.sun.xml.math\": \"sxm\",\n\t\t\"vnd.sun.xml.writer\": \"sxw\",\n\t\t\"vnd.sun.xml.writer.global\": \"sxg\",\n\t\t\"vnd.sun.xml.writer.template\": \"stw\",\n\t\t\"vnd.symbian.install\": [\n\t\t\t\"sis\",\n\t\t\t\"sisx\"\n\t\t],\n\t\t\"vnd.visio\": [\n\t\t\t\"vsd\",\n\t\t\t\"vst\",\n\t\t\t\"vss\",\n\t\t\t\"vsw\",\n\t\t\t\"vsdx\",\n\t\t\t\"vssx\",\n\t\t\t\"vstx\",\n\t\t\t\"vssm\",\n\t\t\t\"vstm\"\n\t\t],\n\t\t\"vnd.wap.wbxml\": \"wbxml\",\n\t\t\"vnd.wap.wmlc\": \"wmlc\",\n\t\t\"vnd.wap.wmlscriptc\": \"wmlsc\",\n\t\t\"vnd.wordperfect\": \"wpd\",\n\t\t\"vnd.wordperfect5.1\": \"wp5\",\n\t\t\"x-123\": \"wk\",\n\t\t\"x-7z-compressed\": \"7z\",\n\t\t\"x-abiword\": \"abw\",\n\t\t\"x-apple-diskimage\": \"dmg\",\n\t\t\"x-bcpio\": \"bcpio\",\n\t\t\"x-bittorrent\": \"torrent\",\n\t\t\"x-cbr\": [\n\t\t\t\"cbr\",\n\t\t\t\"cba\",\n\t\t\t\"cbt\",\n\t\t\t\"cb7\"\n\t\t],\n\t\t\"x-cbz\": \"cbz\",\n\t\t\"x-cdf\": [\n\t\t\t\"cdf\",\n\t\t\t\"cda\"\n\t\t],\n\t\t\"x-cdlink\": \"vcd\",\n\t\t\"x-chess-pgn\": \"pgn\",\n\t\t\"x-cpio\": \"cpio\",\n\t\t\"x-csh\": \"csh\",\n\t\t\"x-director\": [\n\t\t\t\"dir\",\n\t\t\t\"dxr\",\n\t\t\t\"cst\",\n\t\t\t\"cct\",\n\t\t\t\"cxt\",\n\t\t\t\"w3d\",\n\t\t\t\"fgd\",\n\t\t\t\"swa\"\n\t\t],\n\t\t\"x-dms\": \"dms\",\n\t\t\"x-doom\": \"wad\",\n\t\t\"x-dvi\": \"dvi\",\n\t\t\"x-httpd-eruby\": \"rhtml\",\n\t\t\"x-font\": \"pcf.Z\",\n\t\t\"x-freemind\": \"mm\",\n\t\t\"x-gnumeric\": \"gnumeric\",\n\t\t\"x-go-sgf\": \"sgf\",\n\t\t\"x-graphing-calculator\": \"gcf\",\n\t\t\"x-gtar\": [\n\t\t\t\"gtar\",\n\t\t\t\"taz\"\n\t\t],\n\t\t\"x-hdf\": \"hdf\",\n\t\t\"x-httpd-php\": [\n\t\t\t\"phtml\",\n\t\t\t\"pht\",\n\t\t\t\"php\"\n\t\t],\n\t\t\"x-httpd-php-source\": \"phps\",\n\t\t\"x-httpd-php3\": \"php3\",\n\t\t\"x-httpd-php3-preprocessed\": \"php3p\",\n\t\t\"x-httpd-php4\": \"php4\",\n\t\t\"x-httpd-php5\": \"php5\",\n\t\t\"x-ica\": \"ica\",\n\t\t\"x-info\": \"info\",\n\t\t\"x-internet-signup\": [\n\t\t\t\"ins\",\n\t\t\t\"isp\"\n\t\t],\n\t\t\"x-iphone\": \"iii\",\n\t\t\"x-iso9660-image\": \"iso\",\n\t\t\"x-java-jnlp-file\": \"jnlp\",\n\t\t\"x-jmol\": \"jmz\",\n\t\t\"x-killustrator\": \"kil\",\n\t\t\"x-latex\": \"latex\",\n\t\t\"x-lyx\": \"lyx\",\n\t\t\"x-lzx\": \"lzx\",\n\t\t\"x-maker\": [\n\t\t\t\"frm\",\n\t\t\t\"fb\",\n\t\t\t\"fbdoc\"\n\t\t],\n\t\t\"x-ms-wmd\": \"wmd\",\n\t\t\"x-msdos-program\": [\n\t\t\t\"com\",\n\t\t\t\"exe\",\n\t\t\t\"bat\",\n\t\t\t\"dll\"\n\t\t],\n\t\t\"x-netcdf\": [\n\t\t\t\"nc\"\n\t\t],\n\t\t\"x-ns-proxy-autoconfig\": [\n\t\t\t\"pac\",\n\t\t\t\"dat\"\n\t\t],\n\t\t\"x-nwc\": \"nwc\",\n\t\t\"x-object\": \"o\",\n\t\t\"x-oz-application\": \"oza\",\n\t\t\"x-pkcs7-certreqresp\": \"p7r\",\n\t\t\"x-python-code\": [\n\t\t\t\"pyc\",\n\t\t\t\"pyo\"\n\t\t],\n\t\t\"x-qgis\": [\n\t\t\t\"qgs\",\n\t\t\t\"shp\",\n\t\t\t\"shx\"\n\t\t],\n\t\t\"x-quicktimeplayer\": \"qtl\",\n\t\t\"x-redhat-package-manager\": [\n\t\t\t\"rpm\",\n\t\t\t\"rpa\"\n\t\t],\n\t\t\"x-ruby\": \"rb\",\n\t\t\"x-sh\": \"sh\",\n\t\t\"x-shar\": \"shar\",\n\t\t\"x-shockwave-flash\": [\n\t\t\t\"swf\",\n\t\t\t\"swfl\"\n\t\t],\n\t\t\"x-silverlight\": \"scr\",\n\t\t\"x-stuffit\": \"sit\",\n\t\t\"x-sv4cpio\": \"sv4cpio\",\n\t\t\"x-sv4crc\": \"sv4crc\",\n\t\t\"x-tar\": \"tar\",\n\t\t\"x-tex-gf\": \"gf\",\n\t\t\"x-tex-pk\": \"pk\",\n\t\t\"x-texinfo\": [\n\t\t\t\"texinfo\",\n\t\t\t\"texi\"\n\t\t],\n\t\t\"x-trash\": [\n\t\t\t\"~\",\n\t\t\t\"%\",\n\t\t\t\"bak\",\n\t\t\t\"old\",\n\t\t\t\"sik\"\n\t\t],\n\t\t\"x-ustar\": \"ustar\",\n\t\t\"x-wais-source\": \"src\",\n\t\t\"x-wingz\": \"wz\",\n\t\t\"x-x509-ca-cert\": [\n\t\t\t\"crt\",\n\t\t\t\"der\",\n\t\t\t\"cer\"\n\t\t],\n\t\t\"x-xcf\": \"xcf\",\n\t\t\"x-xfig\": \"fig\",\n\t\t\"x-xpinstall\": \"xpi\",\n\t\t\"applixware\": \"aw\",\n\t\t\"atomsvc+xml\": \"atomsvc\",\n\t\t\"ccxml+xml\": \"ccxml\",\n\t\t\"cdmi-capability\": \"cdmia\",\n\t\t\"cdmi-container\": \"cdmic\",\n\t\t\"cdmi-domain\": \"cdmid\",\n\t\t\"cdmi-object\": \"cdmio\",\n\t\t\"cdmi-queue\": \"cdmiq\",\n\t\t\"docbook+xml\": \"dbk\",\n\t\t\"dssc+der\": \"dssc\",\n\t\t\"dssc+xml\": \"xdssc\",\n\t\t\"emma+xml\": \"emma\",\n\t\t\"epub+zip\": \"epub\",\n\t\t\"exi\": \"exi\",\n\t\t\"font-tdpfr\": \"pfr\",\n\t\t\"gml+xml\": \"gml\",\n\t\t\"gpx+xml\": \"gpx\",\n\t\t\"gxf\": \"gxf\",\n\t\t\"hyperstudio\": \"stk\",\n\t\t\"inkml+xml\": [\n\t\t\t\"ink\",\n\t\t\t\"inkml\"\n\t\t],\n\t\t\"ipfix\": \"ipfix\",\n\t\t\"jsonml+json\": \"jsonml\",\n\t\t\"lost+xml\": \"lostxml\",\n\t\t\"mads+xml\": \"mads\",\n\t\t\"marc\": \"mrc\",\n\t\t\"marcxml+xml\": \"mrcx\",\n\t\t\"mathml+xml\": [\n\t\t\t\"mathml\",\n\t\t\t\"mml\"\n\t\t],\n\t\t\"mbox\": \"mbox\",\n\t\t\"mediaservercontrol+xml\": \"mscml\",\n\t\t\"metalink+xml\": \"metalink\",\n\t\t\"metalink4+xml\": \"meta4\",\n\t\t\"mets+xml\": \"mets\",\n\t\t\"mods+xml\": \"mods\",\n\t\t\"mp21\": [\n\t\t\t\"m21\",\n\t\t\t\"mp21\"\n\t\t],\n\t\t\"mp4\": \"mp4s\",\n\t\t\"oebps-package+xml\": \"opf\",\n\t\t\"omdoc+xml\": \"omdoc\",\n\t\t\"onenote\": [\n\t\t\t\"onetoc\",\n\t\t\t\"onetoc2\",\n\t\t\t\"onetmp\",\n\t\t\t\"onepkg\"\n\t\t],\n\t\t\"oxps\": \"oxps\",\n\t\t\"patch-ops-error+xml\": \"xer\",\n\t\t\"pgp-encrypted\": \"pgp\",\n\t\t\"pkcs10\": \"p10\",\n\t\t\"pkcs7-mime\": [\n\t\t\t\"p7m\",\n\t\t\t\"p7c\"\n\t\t],\n\t\t\"pkcs7-signature\": \"p7s\",\n\t\t\"pkcs8\": \"p8\",\n\t\t\"pkix-attr-cert\": \"ac\",\n\t\t\"pkix-crl\": \"crl\",\n\t\t\"pkix-pkipath\": \"pkipath\",\n\t\t\"pkixcmp\": \"pki\",\n\t\t\"pls+xml\": \"pls\",\n\t\t\"prs.cww\": \"cww\",\n\t\t\"pskc+xml\": \"pskcxml\",\n\t\t\"reginfo+xml\": \"rif\",\n\t\t\"relax-ng-compact-syntax\": \"rnc\",\n\t\t\"resource-lists+xml\": \"rl\",\n\t\t\"resource-lists-diff+xml\": \"rld\",\n\t\t\"rls-services+xml\": \"rs\",\n\t\t\"rpki-ghostbusters\": \"gbr\",\n\t\t\"rpki-manifest\": \"mft\",\n\t\t\"rpki-roa\": \"roa\",\n\t\t\"rsd+xml\": \"rsd\",\n\t\t\"sbml+xml\": \"sbml\",\n\t\t\"scvp-cv-request\": \"scq\",\n\t\t\"scvp-cv-response\": \"scs\",\n\t\t\"scvp-vp-request\": \"spq\",\n\t\t\"scvp-vp-response\": \"spp\",\n\t\t\"sdp\": \"sdp\",\n\t\t\"set-payment-initiation\": \"setpay\",\n\t\t\"set-registration-initiation\": \"setreg\",\n\t\t\"shf+xml\": \"shf\",\n\t\t\"sparql-query\": \"rq\",\n\t\t\"sparql-results+xml\": \"srx\",\n\t\t\"srgs\": \"gram\",\n\t\t\"srgs+xml\": \"grxml\",\n\t\t\"sru+xml\": \"sru\",\n\t\t\"ssdl+xml\": \"ssdl\",\n\t\t\"ssml+xml\": \"ssml\",\n\t\t\"tei+xml\": [\n\t\t\t\"tei\",\n\t\t\t\"teicorpus\"\n\t\t],\n\t\t\"thraud+xml\": \"tfi\",\n\t\t\"timestamped-data\": \"tsd\",\n\t\t\"vnd.3gpp.pic-bw-large\": \"plb\",\n\t\t\"vnd.3gpp.pic-bw-small\": \"psb\",\n\t\t\"vnd.3gpp.pic-bw-var\": \"pvb\",\n\t\t\"vnd.3gpp2.tcap\": \"tcap\",\n\t\t\"vnd.3m.post-it-notes\": \"pwn\",\n\t\t\"vnd.accpac.simply.aso\": \"aso\",\n\t\t\"vnd.accpac.simply.imp\": \"imp\",\n\t\t\"vnd.acucobol\": \"acu\",\n\t\t\"vnd.acucorp\": [\n\t\t\t\"atc\",\n\t\t\t\"acutc\"\n\t\t],\n\t\t\"vnd.adobe.air-application-installer-package+zip\": \"air\",\n\t\t\"vnd.adobe.formscentral.fcdt\": \"fcdt\",\n\t\t\"vnd.adobe.fxp\": [\n\t\t\t\"fxp\",\n\t\t\t\"fxpl\"\n\t\t],\n\t\t\"vnd.adobe.xdp+xml\": \"xdp\",\n\t\t\"vnd.adobe.xfdf\": \"xfdf\",\n\t\t\"vnd.ahead.space\": \"ahead\",\n\t\t\"vnd.airzip.filesecure.azf\": \"azf\",\n\t\t\"vnd.airzip.filesecure.azs\": \"azs\",\n\t\t\"vnd.amazon.ebook\": \"azw\",\n\t\t\"vnd.americandynamics.acc\": \"acc\",\n\t\t\"vnd.amiga.ami\": \"ami\",\n\t\t\"vnd.anser-web-certificate-issue-initiation\": \"cii\",\n\t\t\"vnd.anser-web-funds-transfer-initiation\": \"fti\",\n\t\t\"vnd.antix.game-component\": \"atx\",\n\t\t\"vnd.apple.installer+xml\": \"mpkg\",\n\t\t\"vnd.apple.mpegurl\": \"m3u8\",\n\t\t\"vnd.aristanetworks.swi\": \"swi\",\n\t\t\"vnd.astraea-software.iota\": \"iota\",\n\t\t\"vnd.audiograph\": \"aep\",\n\t\t\"vnd.blueice.multipass\": \"mpm\",\n\t\t\"vnd.bmi\": \"bmi\",\n\t\t\"vnd.businessobjects\": \"rep\",\n\t\t\"vnd.chemdraw+xml\": \"cdxml\",\n\t\t\"vnd.chipnuts.karaoke-mmd\": \"mmd\",\n\t\t\"vnd.claymore\": \"cla\",\n\t\t\"vnd.cloanto.rp9\": \"rp9\",\n\t\t\"vnd.clonk.c4group\": [\n\t\t\t\"c4g\",\n\t\t\t\"c4d\",\n\t\t\t\"c4f\",\n\t\t\t\"c4p\",\n\t\t\t\"c4u\"\n\t\t],\n\t\t\"vnd.cluetrust.cartomobile-config\": \"c11amc\",\n\t\t\"vnd.cluetrust.cartomobile-config-pkg\": \"c11amz\",\n\t\t\"vnd.commonspace\": \"csp\",\n\t\t\"vnd.contact.cmsg\": \"cdbcmsg\",\n\t\t\"vnd.cosmocaller\": \"cmc\",\n\t\t\"vnd.crick.clicker\": \"clkx\",\n\t\t\"vnd.crick.clicker.keyboard\": \"clkk\",\n\t\t\"vnd.crick.clicker.palette\": \"clkp\",\n\t\t\"vnd.crick.clicker.template\": \"clkt\",\n\t\t\"vnd.crick.clicker.wordbank\": \"clkw\",\n\t\t\"vnd.criticaltools.wbs+xml\": \"wbs\",\n\t\t\"vnd.ctc-posml\": \"pml\",\n\t\t\"vnd.cups-ppd\": \"ppd\",\n\t\t\"vnd.curl.car\": \"car\",\n\t\t\"vnd.curl.pcurl\": \"pcurl\",\n\t\t\"vnd.dart\": \"dart\",\n\t\t\"vnd.data-vision.rdz\": \"rdz\",\n\t\t\"vnd.dece.data\": [\n\t\t\t\"uvf\",\n\t\t\t\"uvvf\",\n\t\t\t\"uvd\",\n\t\t\t\"uvvd\"\n\t\t],\n\t\t\"vnd.dece.ttml+xml\": [\n\t\t\t\"uvt\",\n\t\t\t\"uvvt\"\n\t\t],\n\t\t\"vnd.dece.unspecified\": [\n\t\t\t\"uvx\",\n\t\t\t\"uvvx\"\n\t\t],\n\t\t\"vnd.dece.zip\": [\n\t\t\t\"uvz\",\n\t\t\t\"uvvz\"\n\t\t],\n\t\t\"vnd.denovo.fcselayout-link\": \"fe_launch\",\n\t\t\"vnd.dna\": \"dna\",\n\t\t\"vnd.dolby.mlp\": \"mlp\",\n\t\t\"vnd.dpgraph\": \"dpg\",\n\t\t\"vnd.dreamfactory\": \"dfac\",\n\t\t\"vnd.ds-keypoint\": \"kpxx\",\n\t\t\"vnd.dvb.ait\": \"ait\",\n\t\t\"vnd.dvb.service\": \"svc\",\n\t\t\"vnd.dynageo\": \"geo\",\n\t\t\"vnd.ecowin.chart\": \"mag\",\n\t\t\"vnd.enliven\": \"nml\",\n\t\t\"vnd.epson.esf\": \"esf\",\n\t\t\"vnd.epson.msf\": \"msf\",\n\t\t\"vnd.epson.quickanime\": \"qam\",\n\t\t\"vnd.epson.salt\": \"slt\",\n\t\t\"vnd.epson.ssf\": \"ssf\",\n\t\t\"vnd.eszigno3+xml\": [\n\t\t\t\"es3\",\n\t\t\t\"et3\"\n\t\t],\n\t\t\"vnd.ezpix-album\": \"ez2\",\n\t\t\"vnd.ezpix-package\": \"ez3\",\n\t\t\"vnd.fdf\": \"fdf\",\n\t\t\"vnd.fdsn.mseed\": \"mseed\",\n\t\t\"vnd.fdsn.seed\": [\n\t\t\t\"seed\",\n\t\t\t\"dataless\"\n\t\t],\n\t\t\"vnd.flographit\": \"gph\",\n\t\t\"vnd.fluxtime.clip\": \"ftc\",\n\t\t\"vnd.framemaker\": [\n\t\t\t\"fm\",\n\t\t\t\"frame\",\n\t\t\t\"maker\",\n\t\t\t\"book\"\n\t\t],\n\t\t\"vnd.frogans.fnc\": \"fnc\",\n\t\t\"vnd.frogans.ltf\": \"ltf\",\n\t\t\"vnd.fsc.weblaunch\": \"fsc\",\n\t\t\"vnd.fujitsu.oasys\": \"oas\",\n\t\t\"vnd.fujitsu.oasys2\": \"oa2\",\n\t\t\"vnd.fujitsu.oasys3\": \"oa3\",\n\t\t\"vnd.fujitsu.oasysgp\": \"fg5\",\n\t\t\"vnd.fujitsu.oasysprs\": \"bh2\",\n\t\t\"vnd.fujixerox.ddd\": \"ddd\",\n\t\t\"vnd.fujixerox.docuworks\": \"xdw\",\n\t\t\"vnd.fujixerox.docuworks.binder\": \"xbd\",\n\t\t\"vnd.fuzzysheet\": \"fzs\",\n\t\t\"vnd.genomatix.tuxedo\": \"txd\",\n\t\t\"vnd.geogebra.file\": \"ggb\",\n\t\t\"vnd.geogebra.tool\": \"ggt\",\n\t\t\"vnd.geometry-explorer\": [\n\t\t\t\"gex\",\n\t\t\t\"gre\"\n\t\t],\n\t\t\"vnd.geonext\": \"gxt\",\n\t\t\"vnd.geoplan\": \"g2w\",\n\t\t\"vnd.geospace\": \"g3w\",\n\t\t\"vnd.gmx\": \"gmx\",\n\t\t\"vnd.grafeq\": [\n\t\t\t\"gqf\",\n\t\t\t\"gqs\"\n\t\t],\n\t\t\"vnd.groove-account\": \"gac\",\n\t\t\"vnd.groove-help\": \"ghf\",\n\t\t\"vnd.groove-identity-message\": \"gim\",\n\t\t\"vnd.groove-injector\": \"grv\",\n\t\t\"vnd.groove-tool-message\": \"gtm\",\n\t\t\"vnd.groove-tool-template\": \"tpl\",\n\t\t\"vnd.groove-vcard\": \"vcg\",\n\t\t\"vnd.hal+xml\": \"hal\",\n\t\t\"vnd.handheld-entertainment+xml\": \"zmm\",\n\t\t\"vnd.hbci\": \"hbci\",\n\t\t\"vnd.hhe.lesson-player\": \"les\",\n\t\t\"vnd.hp-hpgl\": \"hpgl\",\n\t\t\"vnd.hp-hpid\": \"hpid\",\n\t\t\"vnd.hp-hps\": \"hps\",\n\t\t\"vnd.hp-jlyt\": \"jlt\",\n\t\t\"vnd.hp-pcl\": \"pcl\",\n\t\t\"vnd.hp-pclxl\": \"pclxl\",\n\t\t\"vnd.hydrostatix.sof-data\": \"sfd-hdstx\",\n\t\t\"vnd.ibm.minipay\": \"mpy\",\n\t\t\"vnd.ibm.modcap\": [\n\t\t\t\"afp\",\n\t\t\t\"listafp\",\n\t\t\t\"list3820\"\n\t\t],\n\t\t\"vnd.ibm.rights-management\": \"irm\",\n\t\t\"vnd.ibm.secure-container\": \"sc\",\n\t\t\"vnd.iccprofile\": [\n\t\t\t\"icc\",\n\t\t\t\"icm\"\n\t\t],\n\t\t\"vnd.igloader\": \"igl\",\n\t\t\"vnd.immervision-ivp\": \"ivp\",\n\t\t\"vnd.immervision-ivu\": \"ivu\",\n\t\t\"vnd.insors.igm\": \"igm\",\n\t\t\"vnd.intercon.formnet\": [\n\t\t\t\"xpw\",\n\t\t\t\"xpx\"\n\t\t],\n\t\t\"vnd.intergeo\": \"i2g\",\n\t\t\"vnd.intu.qbo\": \"qbo\",\n\t\t\"vnd.intu.qfx\": \"qfx\",\n\t\t\"vnd.ipunplugged.rcprofile\": \"rcprofile\",\n\t\t\"vnd.irepository.package+xml\": \"irp\",\n\t\t\"vnd.is-xpr\": \"xpr\",\n\t\t\"vnd.isac.fcs\": \"fcs\",\n\t\t\"vnd.jam\": \"jam\",\n\t\t\"vnd.jcp.javame.midlet-rms\": \"rms\",\n\t\t\"vnd.jisp\": \"jisp\",\n\t\t\"vnd.joost.joda-archive\": \"joda\",\n\t\t\"vnd.kahootz\": [\n\t\t\t\"ktz\",\n\t\t\t\"ktr\"\n\t\t],\n\t\t\"vnd.kde.karbon\": \"karbon\",\n\t\t\"vnd.kde.kchart\": \"chrt\",\n\t\t\"vnd.kde.kformula\": \"kfo\",\n\t\t\"vnd.kde.kivio\": \"flw\",\n\t\t\"vnd.kde.kontour\": \"kon\",\n\t\t\"vnd.kde.kpresenter\": [\n\t\t\t\"kpr\",\n\t\t\t\"kpt\"\n\t\t],\n\t\t\"vnd.kde.kspread\": \"ksp\",\n\t\t\"vnd.kde.kword\": [\n\t\t\t\"kwd\",\n\t\t\t\"kwt\"\n\t\t],\n\t\t\"vnd.kenameaapp\": \"htke\",\n\t\t\"vnd.kidspiration\": \"kia\",\n\t\t\"vnd.kinar\": [\n\t\t\t\"kne\",\n\t\t\t\"knp\"\n\t\t],\n\t\t\"vnd.koan\": [\n\t\t\t\"skp\",\n\t\t\t\"skd\",\n\t\t\t\"skt\",\n\t\t\t\"skm\"\n\t\t],\n\t\t\"vnd.kodak-descriptor\": \"sse\",\n\t\t\"vnd.las.las+xml\": \"lasxml\",\n\t\t\"vnd.llamagraphics.life-balance.desktop\": \"lbd\",\n\t\t\"vnd.llamagraphics.life-balance.exchange+xml\": \"lbe\",\n\t\t\"vnd.lotus-1-2-3\": \"123\",\n\t\t\"vnd.lotus-approach\": \"apr\",\n\t\t\"vnd.lotus-freelance\": \"pre\",\n\t\t\"vnd.lotus-notes\": \"nsf\",\n\t\t\"vnd.lotus-organizer\": \"org\",\n\t\t\"vnd.lotus-screencam\": \"scm\",\n\t\t\"vnd.lotus-wordpro\": \"lwp\",\n\t\t\"vnd.macports.portpkg\": \"portpkg\",\n\t\t\"vnd.mcd\": \"mcd\",\n\t\t\"vnd.medcalcdata\": \"mc1\",\n\t\t\"vnd.mediastation.cdkey\": \"cdkey\",\n\t\t\"vnd.mfer\": \"mwf\",\n\t\t\"vnd.mfmp\": \"mfm\",\n\t\t\"vnd.micrografx.flo\": \"flo\",\n\t\t\"vnd.micrografx.igx\": \"igx\",\n\t\t\"vnd.mif\": \"mif\",\n\t\t\"vnd.mobius.daf\": \"daf\",\n\t\t\"vnd.mobius.dis\": \"dis\",\n\t\t\"vnd.mobius.mbk\": \"mbk\",\n\t\t\"vnd.mobius.mqy\": \"mqy\",\n\t\t\"vnd.mobius.msl\": \"msl\",\n\t\t\"vnd.mobius.plc\": \"plc\",\n\t\t\"vnd.mobius.txf\": \"txf\",\n\t\t\"vnd.mophun.application\": \"mpn\",\n\t\t\"vnd.mophun.certificate\": \"mpc\",\n\t\t\"vnd.ms-artgalry\": \"cil\",\n\t\t\"vnd.ms-cab-compressed\": \"cab\",\n\t\t\"vnd.ms-excel.addin.macroenabled.12\": \"xlam\",\n\t\t\"vnd.ms-excel.sheet.binary.macroenabled.12\": \"xlsb\",\n\t\t\"vnd.ms-excel.sheet.macroenabled.12\": \"xlsm\",\n\t\t\"vnd.ms-excel.template.macroenabled.12\": \"xltm\",\n\t\t\"vnd.ms-fontobject\": \"eot\",\n\t\t\"vnd.ms-htmlhelp\": \"chm\",\n\t\t\"vnd.ms-ims\": \"ims\",\n\t\t\"vnd.ms-lrm\": \"lrm\",\n\t\t\"vnd.ms-officetheme\": \"thmx\",\n\t\t\"vnd.ms-powerpoint.addin.macroenabled.12\": \"ppam\",\n\t\t\"vnd.ms-powerpoint.presentation.macroenabled.12\": \"pptm\",\n\t\t\"vnd.ms-powerpoint.slide.macroenabled.12\": \"sldm\",\n\t\t\"vnd.ms-powerpoint.slideshow.macroenabled.12\": \"ppsm\",\n\t\t\"vnd.ms-powerpoint.template.macroenabled.12\": \"potm\",\n\t\t\"vnd.ms-project\": [\n\t\t\t\"mpp\",\n\t\t\t\"mpt\"\n\t\t],\n\t\t\"vnd.ms-word.document.macroenabled.12\": \"docm\",\n\t\t\"vnd.ms-word.template.macroenabled.12\": \"dotm\",\n\t\t\"vnd.ms-works\": [\n\t\t\t\"wps\",\n\t\t\t\"wks\",\n\t\t\t\"wcm\",\n\t\t\t\"wdb\"\n\t\t],\n\t\t\"vnd.ms-wpl\": \"wpl\",\n\t\t\"vnd.ms-xpsdocument\": \"xps\",\n\t\t\"vnd.mseq\": \"mseq\",\n\t\t\"vnd.musician\": \"mus\",\n\t\t\"vnd.muvee.style\": \"msty\",\n\t\t\"vnd.mynfc\": \"taglet\",\n\t\t\"vnd.neurolanguage.nlu\": \"nlu\",\n\t\t\"vnd.nitf\": [\n\t\t\t\"ntf\",\n\t\t\t\"nitf\"\n\t\t],\n\t\t\"vnd.noblenet-directory\": \"nnd\",\n\t\t\"vnd.noblenet-sealer\": \"nns\",\n\t\t\"vnd.noblenet-web\": \"nnw\",\n\t\t\"vnd.nokia.n-gage.data\": \"ngdat\",\n\t\t\"vnd.nokia.n-gage.symbian.install\": \"n-gage\",\n\t\t\"vnd.nokia.radio-preset\": \"rpst\",\n\t\t\"vnd.nokia.radio-presets\": \"rpss\",\n\t\t\"vnd.novadigm.edm\": \"edm\",\n\t\t\"vnd.novadigm.edx\": \"edx\",\n\t\t\"vnd.novadigm.ext\": \"ext\",\n\t\t\"vnd.oasis.opendocument.chart-template\": \"otc\",\n\t\t\"vnd.oasis.opendocument.formula-template\": \"odft\",\n\t\t\"vnd.oasis.opendocument.image-template\": \"oti\",\n\t\t\"vnd.olpc-sugar\": \"xo\",\n\t\t\"vnd.oma.dd2+xml\": \"dd2\",\n\t\t\"vnd.openofficeorg.extension\": \"oxt\",\n\t\t\"vnd.openxmlformats-officedocument.presentationml.slide\": \"sldx\",\n\t\t\"vnd.osgeo.mapguide.package\": \"mgp\",\n\t\t\"vnd.osgi.dp\": \"dp\",\n\t\t\"vnd.osgi.subsystem\": \"esa\",\n\t\t\"vnd.palm\": [\n\t\t\t\"pdb\",\n\t\t\t\"pqa\",\n\t\t\t\"oprc\"\n\t\t],\n\t\t\"vnd.pawaafile\": \"paw\",\n\t\t\"vnd.pg.format\": \"str\",\n\t\t\"vnd.pg.osasli\": \"ei6\",\n\t\t\"vnd.picsel\": \"efif\",\n\t\t\"vnd.pmi.widget\": \"wg\",\n\t\t\"vnd.pocketlearn\": \"plf\",\n\t\t\"vnd.powerbuilder6\": \"pbd\",\n\t\t\"vnd.previewsystems.box\": \"box\",\n\t\t\"vnd.proteus.magazine\": \"mgz\",\n\t\t\"vnd.publishare-delta-tree\": \"qps\",\n\t\t\"vnd.pvi.ptid1\": \"ptid\",\n\t\t\"vnd.quark.quarkxpress\": [\n\t\t\t\"qxd\",\n\t\t\t\"qxt\",\n\t\t\t\"qwd\",\n\t\t\t\"qwt\",\n\t\t\t\"qxl\",\n\t\t\t\"qxb\"\n\t\t],\n\t\t\"vnd.realvnc.bed\": \"bed\",\n\t\t\"vnd.recordare.musicxml\": \"mxl\",\n\t\t\"vnd.recordare.musicxml+xml\": \"musicxml\",\n\t\t\"vnd.rig.cryptonote\": \"cryptonote\",\n\t\t\"vnd.rn-realmedia\": \"rm\",\n\t\t\"vnd.rn-realmedia-vbr\": \"rmvb\",\n\t\t\"vnd.route66.link66+xml\": \"link66\",\n\t\t\"vnd.sailingtracker.track\": \"st\",\n\t\t\"vnd.seemail\": \"see\",\n\t\t\"vnd.sema\": \"sema\",\n\t\t\"vnd.semd\": \"semd\",\n\t\t\"vnd.semf\": \"semf\",\n\t\t\"vnd.shana.informed.formdata\": \"ifm\",\n\t\t\"vnd.shana.informed.formtemplate\": \"itp\",\n\t\t\"vnd.shana.informed.interchange\": \"iif\",\n\t\t\"vnd.shana.informed.package\": \"ipk\",\n\t\t\"vnd.simtech-mindmapper\": [\n\t\t\t\"twd\",\n\t\t\t\"twds\"\n\t\t],\n\t\t\"vnd.smart.teacher\": \"teacher\",\n\t\t\"vnd.solent.sdkm+xml\": [\n\t\t\t\"sdkm\",\n\t\t\t\"sdkd\"\n\t\t],\n\t\t\"vnd.spotfire.dxp\": \"dxp\",\n\t\t\"vnd.spotfire.sfs\": \"sfs\",\n\t\t\"vnd.stepmania.package\": \"smzip\",\n\t\t\"vnd.stepmania.stepchart\": \"sm\",\n\t\t\"vnd.sus-calendar\": [\n\t\t\t\"sus\",\n\t\t\t\"susp\"\n\t\t],\n\t\t\"vnd.svd\": \"svd\",\n\t\t\"vnd.syncml+xml\": \"xsm\",\n\t\t\"vnd.syncml.dm+wbxml\": \"bdm\",\n\t\t\"vnd.syncml.dm+xml\": \"xdm\",\n\t\t\"vnd.tao.intent-module-archive\": \"tao\",\n\t\t\"vnd.tcpdump.pcap\": [\n\t\t\t\"pcap\",\n\t\t\t\"cap\",\n\t\t\t\"dmp\"\n\t\t],\n\t\t\"vnd.tmobile-livetv\": \"tmo\",\n\t\t\"vnd.trid.tpt\": \"tpt\",\n\t\t\"vnd.triscape.mxs\": \"mxs\",\n\t\t\"vnd.trueapp\": \"tra\",\n\t\t\"vnd.ufdl\": [\n\t\t\t\"ufd\",\n\t\t\t\"ufdl\"\n\t\t],\n\t\t\"vnd.uiq.theme\": \"utz\",\n\t\t\"vnd.umajin\": \"umj\",\n\t\t\"vnd.unity\": \"unityweb\",\n\t\t\"vnd.uoml+xml\": \"uoml\",\n\t\t\"vnd.vcx\": \"vcx\",\n\t\t\"vnd.visionary\": \"vis\",\n\t\t\"vnd.vsf\": \"vsf\",\n\t\t\"vnd.webturbo\": \"wtb\",\n\t\t\"vnd.wolfram.player\": \"nbp\",\n\t\t\"vnd.wqd\": \"wqd\",\n\t\t\"vnd.wt.stf\": \"stf\",\n\t\t\"vnd.xara\": \"xar\",\n\t\t\"vnd.xfdl\": \"xfdl\",\n\t\t\"vnd.yamaha.hv-dic\": \"hvd\",\n\t\t\"vnd.yamaha.hv-script\": \"hvs\",\n\t\t\"vnd.yamaha.hv-voice\": \"hvp\",\n\t\t\"vnd.yamaha.openscoreformat\": \"osf\",\n\t\t\"vnd.yamaha.openscoreformat.osfpvg+xml\": \"osfpvg\",\n\t\t\"vnd.yamaha.smaf-audio\": \"saf\",\n\t\t\"vnd.yamaha.smaf-phrase\": \"spf\",\n\t\t\"vnd.yellowriver-custom-menu\": \"cmp\",\n\t\t\"vnd.zul\": [\n\t\t\t\"zir\",\n\t\t\t\"zirz\"\n\t\t],\n\t\t\"vnd.zzazz.deck+xml\": \"zaz\",\n\t\t\"voicexml+xml\": \"vxml\",\n\t\t\"widget\": \"wgt\",\n\t\t\"winhlp\": \"hlp\",\n\t\t\"wsdl+xml\": \"wsdl\",\n\t\t\"wspolicy+xml\": \"wspolicy\",\n\t\t\"x-ace-compressed\": \"ace\",\n\t\t\"x-authorware-bin\": [\n\t\t\t\"aab\",\n\t\t\t\"x32\",\n\t\t\t\"u32\",\n\t\t\t\"vox\"\n\t\t],\n\t\t\"x-authorware-map\": \"aam\",\n\t\t\"x-authorware-seg\": \"aas\",\n\t\t\"x-blorb\": [\n\t\t\t\"blb\",\n\t\t\t\"blorb\"\n\t\t],\n\t\t\"x-bzip\": \"bz\",\n\t\t\"x-bzip2\": [\n\t\t\t\"bz2\",\n\t\t\t\"boz\"\n\t\t],\n\t\t\"x-cfs-compressed\": \"cfs\",\n\t\t\"x-chat\": \"chat\",\n\t\t\"x-conference\": \"nsc\",\n\t\t\"x-dgc-compressed\": \"dgc\",\n\t\t\"x-dtbncx+xml\": \"ncx\",\n\t\t\"x-dtbook+xml\": \"dtb\",\n\t\t\"x-dtbresource+xml\": \"res\",\n\t\t\"x-eva\": \"eva\",\n\t\t\"x-font-bdf\": \"bdf\",\n\t\t\"x-font-ghostscript\": \"gsf\",\n\t\t\"x-font-linux-psf\": \"psf\",\n\t\t\"x-font-pcf\": \"pcf\",\n\t\t\"x-font-snf\": \"snf\",\n\t\t\"x-font-ttf\": [\n\t\t\t\"ttf\",\n\t\t\t\"ttc\"\n\t\t],\n\t\t\"x-font-type1\": [\n\t\t\t\"pfa\",\n\t\t\t\"pfb\",\n\t\t\t\"pfm\",\n\t\t\t\"afm\"\n\t\t],\n\t\t\"x-freearc\": \"arc\",\n\t\t\"x-gca-compressed\": \"gca\",\n\t\t\"x-glulx\": \"ulx\",\n\t\t\"x-gramps-xml\": \"gramps\",\n\t\t\"x-install-instructions\": \"install\",\n\t\t\"x-lzh-compressed\": [\n\t\t\t\"lzh\",\n\t\t\t\"lha\"\n\t\t],\n\t\t\"x-mie\": \"mie\",\n\t\t\"x-mobipocket-ebook\": [\n\t\t\t\"prc\",\n\t\t\t\"mobi\"\n\t\t],\n\t\t\"x-ms-application\": \"application\",\n\t\t\"x-ms-shortcut\": \"lnk\",\n\t\t\"x-ms-xbap\": \"xbap\",\n\t\t\"x-msbinder\": \"obd\",\n\t\t\"x-mscardfile\": \"crd\",\n\t\t\"x-msclip\": \"clp\",\n\t\t\"application/x-ms-installer\": \"msi\",\n\t\t\"x-msmediaview\": [\n\t\t\t\"mvb\",\n\t\t\t\"m13\",\n\t\t\t\"m14\"\n\t\t],\n\t\t\"x-msmetafile\": [\n\t\t\t\"wmf\",\n\t\t\t\"wmz\",\n\t\t\t\"emf\",\n\t\t\t\"emz\"\n\t\t],\n\t\t\"x-msmoney\": \"mny\",\n\t\t\"x-mspublisher\": \"pub\",\n\t\t\"x-msschedule\": \"scd\",\n\t\t\"x-msterminal\": \"trm\",\n\t\t\"x-mswrite\": \"wri\",\n\t\t\"x-nzb\": \"nzb\",\n\t\t\"x-pkcs12\": [\n\t\t\t\"p12\",\n\t\t\t\"pfx\"\n\t\t],\n\t\t\"x-pkcs7-certificates\": [\n\t\t\t\"p7b\",\n\t\t\t\"spc\"\n\t\t],\n\t\t\"x-research-info-systems\": \"ris\",\n\t\t\"x-silverlight-app\": \"xap\",\n\t\t\"x-sql\": \"sql\",\n\t\t\"x-stuffitx\": \"sitx\",\n\t\t\"x-subrip\": \"srt\",\n\t\t\"x-t3vm-image\": \"t3\",\n\t\t\"x-tex-tfm\": \"tfm\",\n\t\t\"x-tgif\": \"obj\",\n\t\t\"x-xliff+xml\": \"xlf\",\n\t\t\"x-xz\": \"xz\",\n\t\t\"x-zmachine\": [\n\t\t\t\"z1\",\n\t\t\t\"z2\",\n\t\t\t\"z3\",\n\t\t\t\"z4\",\n\t\t\t\"z5\",\n\t\t\t\"z6\",\n\t\t\t\"z7\",\n\t\t\t\"z8\"\n\t\t],\n\t\t\"xaml+xml\": \"xaml\",\n\t\t\"xcap-diff+xml\": \"xdf\",\n\t\t\"xenc+xml\": \"xenc\",\n\t\t\"xml-dtd\": \"dtd\",\n\t\t\"xop+xml\": \"xop\",\n\t\t\"xproc+xml\": \"xpl\",\n\t\t\"xslt+xml\": \"xslt\",\n\t\t\"xv+xml\": [\n\t\t\t\"mxml\",\n\t\t\t\"xhvml\",\n\t\t\t\"xvml\",\n\t\t\t\"xvm\"\n\t\t],\n\t\t\"yang\": \"yang\",\n\t\t\"yin+xml\": \"yin\",\n\t\t\"envoy\": \"evy\",\n\t\t\"fractals\": \"fif\",\n\t\t\"internet-property-stream\": \"acx\",\n\t\t\"olescript\": \"axs\",\n\t\t\"vnd.ms-outlook\": \"msg\",\n\t\t\"vnd.ms-pkicertstore\": \"sst\",\n\t\t\"x-compress\": \"z\",\n\t\t\"x-perfmon\": [\n\t\t\t\"pma\",\n\t\t\t\"pmc\",\n\t\t\t\"pmr\",\n\t\t\t\"pmw\"\n\t\t],\n\t\t\"ynd.ms-pkipko\": \"pko\",\n\t\t\"gzip\": [\n\t\t\t\"gz\",\n\t\t\t\"tgz\"\n\t\t],\n\t\t\"smil+xml\": [\n\t\t\t\"smi\",\n\t\t\t\"smil\"\n\t\t],\n\t\t\"vnd.debian.binary-package\": [\n\t\t\t\"deb\",\n\t\t\t\"udeb\"\n\t\t],\n\t\t\"vnd.hzn-3d-crossword\": \"x3d\",\n\t\t\"vnd.sqlite3\": [\n\t\t\t\"db\",\n\t\t\t\"sqlite\",\n\t\t\t\"sqlite3\",\n\t\t\t\"db-wal\",\n\t\t\t\"sqlite-wal\",\n\t\t\t\"db-shm\",\n\t\t\t\"sqlite-shm\"\n\t\t],\n\t\t\"vnd.wap.sic\": \"sic\",\n\t\t\"vnd.wap.slc\": \"slc\",\n\t\t\"x-krita\": [\n\t\t\t\"kra\",\n\t\t\t\"krz\"\n\t\t],\n\t\t\"x-perl\": [\n\t\t\t\"pm\",\n\t\t\t\"pl\"\n\t\t],\n\t\t\"yaml\": [\n\t\t\t\"yaml\",\n\t\t\t\"yml\"\n\t\t]\n\t},\n\t\"audio\": {\n\t\t\"amr\": \"amr\",\n\t\t\"amr-wb\": \"awb\",\n\t\t\"annodex\": \"axa\",\n\t\t\"basic\": [\n\t\t\t\"au\",\n\t\t\t\"snd\"\n\t\t],\n\t\t\"flac\": \"flac\",\n\t\t\"midi\": [\n\t\t\t\"mid\",\n\t\t\t\"midi\",\n\t\t\t\"kar\",\n\t\t\t\"rmi\"\n\t\t],\n\t\t\"mpeg\": [\n\t\t\t\"mpga\",\n\t\t\t\"mpega\",\n\t\t\t\"mp3\",\n\t\t\t\"m4a\",\n\t\t\t\"mp2a\",\n\t\t\t\"m2a\",\n\t\t\t\"m3a\"\n\t\t],\n\t\t\"mpegurl\": \"m3u\",\n\t\t\"ogg\": [\n\t\t\t\"oga\",\n\t\t\t\"ogg\",\n\t\t\t\"spx\"\n\t\t],\n\t\t\"prs.sid\": \"sid\",\n\t\t\"x-aiff\": \"aifc\",\n\t\t\"x-gsm\": \"gsm\",\n\t\t\"x-ms-wma\": \"wma\",\n\t\t\"x-ms-wax\": \"wax\",\n\t\t\"x-pn-realaudio\": \"ram\",\n\t\t\"x-realaudio\": \"ra\",\n\t\t\"x-sd2\": \"sd2\",\n\t\t\"adpcm\": \"adp\",\n\t\t\"mp4\": \"mp4a\",\n\t\t\"s3m\": \"s3m\",\n\t\t\"silk\": \"sil\",\n\t\t\"vnd.dece.audio\": [\n\t\t\t\"uva\",\n\t\t\t\"uvva\"\n\t\t],\n\t\t\"vnd.digital-winds\": \"eol\",\n\t\t\"vnd.dra\": \"dra\",\n\t\t\"vnd.dts\": \"dts\",\n\t\t\"vnd.dts.hd\": \"dtshd\",\n\t\t\"vnd.lucent.voice\": \"lvp\",\n\t\t\"vnd.ms-playready.media.pya\": \"pya\",\n\t\t\"vnd.nuera.ecelp4800\": \"ecelp4800\",\n\t\t\"vnd.nuera.ecelp7470\": \"ecelp7470\",\n\t\t\"vnd.nuera.ecelp9600\": \"ecelp9600\",\n\t\t\"vnd.rip\": \"rip\",\n\t\t\"webm\": \"weba\",\n\t\t\"x-caf\": \"caf\",\n\t\t\"x-matroska\": \"mka\",\n\t\t\"x-pn-realaudio-plugin\": \"rmp\",\n\t\t\"xm\": \"xm\",\n\t\t\"aac\": \"aac\",\n\t\t\"aiff\": [\n\t\t\t\"aiff\",\n\t\t\t\"aif\",\n\t\t\t\"aff\"\n\t\t],\n\t\t\"opus\": \"opus\",\n\t\t\"wav\": \"wav\"\n\t},\n\t\"chemical\": {\n\t\t\"x-alchemy\": \"alc\",\n\t\t\"x-cache\": [\n\t\t\t\"cac\",\n\t\t\t\"cache\"\n\t\t],\n\t\t\"x-cache-csf\": \"csf\",\n\t\t\"x-cactvs-binary\": [\n\t\t\t\"cbin\",\n\t\t\t\"cascii\",\n\t\t\t\"ctab\"\n\t\t],\n\t\t\"x-cdx\": \"cdx\",\n\t\t\"x-chem3d\": \"c3d\",\n\t\t\"x-cif\": \"cif\",\n\t\t\"x-cmdf\": \"cmdf\",\n\t\t\"x-cml\": \"cml\",\n\t\t\"x-compass\": \"cpa\",\n\t\t\"x-crossfire\": \"bsd\",\n\t\t\"x-csml\": [\n\t\t\t\"csml\",\n\t\t\t\"csm\"\n\t\t],\n\t\t\"x-ctx\": \"ctx\",\n\t\t\"x-cxf\": [\n\t\t\t\"cxf\",\n\t\t\t\"cef\"\n\t\t],\n\t\t\"x-embl-dl-nucleotide\": [\n\t\t\t\"emb\",\n\t\t\t\"embl\"\n\t\t],\n\t\t\"x-gamess-input\": [\n\t\t\t\"inp\",\n\t\t\t\"gam\",\n\t\t\t\"gamin\"\n\t\t],\n\t\t\"x-gaussian-checkpoint\": [\n\t\t\t\"fch\",\n\t\t\t\"fchk\"\n\t\t],\n\t\t\"x-gaussian-cube\": \"cub\",\n\t\t\"x-gaussian-input\": [\n\t\t\t\"gau\",\n\t\t\t\"gjc\",\n\t\t\t\"gjf\"\n\t\t],\n\t\t\"x-gaussian-log\": \"gal\",\n\t\t\"x-gcg8-sequence\": \"gcg\",\n\t\t\"x-genbank\": \"gen\",\n\t\t\"x-hin\": \"hin\",\n\t\t\"x-isostar\": [\n\t\t\t\"istr\",\n\t\t\t\"ist\"\n\t\t],\n\t\t\"x-jcamp-dx\": [\n\t\t\t\"jdx\",\n\t\t\t\"dx\"\n\t\t],\n\t\t\"x-kinemage\": \"kin\",\n\t\t\"x-macmolecule\": \"mcm\",\n\t\t\"x-macromodel-input\": \"mmod\",\n\t\t\"x-mdl-molfile\": \"mol\",\n\t\t\"x-mdl-rdfile\": \"rd\",\n\t\t\"x-mdl-rxnfile\": \"rxn\",\n\t\t\"x-mdl-sdfile\": \"sd\",\n\t\t\"x-mdl-tgf\": \"tgf\",\n\t\t\"x-mmcif\": \"mcif\",\n\t\t\"x-mol2\": \"mol2\",\n\t\t\"x-molconn-Z\": \"b\",\n\t\t\"x-mopac-graph\": \"gpt\",\n\t\t\"x-mopac-input\": [\n\t\t\t\"mop\",\n\t\t\t\"mopcrt\",\n\t\t\t\"zmt\"\n\t\t],\n\t\t\"x-mopac-out\": \"moo\",\n\t\t\"x-ncbi-asn1\": \"asn\",\n\t\t\"x-ncbi-asn1-ascii\": [\n\t\t\t\"prt\",\n\t\t\t\"ent\"\n\t\t],\n\t\t\"x-ncbi-asn1-binary\": \"val\",\n\t\t\"x-rosdal\": \"ros\",\n\t\t\"x-swissprot\": \"sw\",\n\t\t\"x-vamas-iso14976\": \"vms\",\n\t\t\"x-vmd\": \"vmd\",\n\t\t\"x-xtel\": \"xtel\",\n\t\t\"x-xyz\": \"xyz\"\n\t},\n\t\"font\": {\n\t\t\"otf\": \"otf\",\n\t\t\"woff\": \"woff\",\n\t\t\"woff2\": \"woff2\"\n\t},\n\t\"image\": {\n\t\t\"gif\": \"gif\",\n\t\t\"ief\": \"ief\",\n\t\t\"jpeg\": [\n\t\t\t\"jpeg\",\n\t\t\t\"jpg\",\n\t\t\t\"jpe\",\n\t\t\t\"jfif\",\n\t\t\t\"jfif-tbnl\",\n\t\t\t\"jif\"\n\t\t],\n\t\t\"pcx\": \"pcx\",\n\t\t\"png\": \"png\",\n\t\t\"svg+xml\": [\n\t\t\t\"svg\",\n\t\t\t\"svgz\"\n\t\t],\n\t\t\"tiff\": [\n\t\t\t\"tiff\",\n\t\t\t\"tif\"\n\t\t],\n\t\t\"vnd.djvu\": [\n\t\t\t\"djvu\",\n\t\t\t\"djv\"\n\t\t],\n\t\t\"vnd.wap.wbmp\": \"wbmp\",\n\t\t\"x-canon-cr2\": \"cr2\",\n\t\t\"x-canon-crw\": \"crw\",\n\t\t\"x-cmu-raster\": \"ras\",\n\t\t\"x-coreldraw\": \"cdr\",\n\t\t\"x-coreldrawpattern\": \"pat\",\n\t\t\"x-coreldrawtemplate\": \"cdt\",\n\t\t\"x-corelphotopaint\": \"cpt\",\n\t\t\"x-epson-erf\": \"erf\",\n\t\t\"x-icon\": \"ico\",\n\t\t\"x-jg\": \"art\",\n\t\t\"x-jng\": \"jng\",\n\t\t\"x-nikon-nef\": \"nef\",\n\t\t\"x-olympus-orf\": \"orf\",\n\t\t\"x-portable-anymap\": \"pnm\",\n\t\t\"x-portable-bitmap\": \"pbm\",\n\t\t\"x-portable-graymap\": \"pgm\",\n\t\t\"x-portable-pixmap\": \"ppm\",\n\t\t\"x-rgb\": \"rgb\",\n\t\t\"x-xbitmap\": \"xbm\",\n\t\t\"x-xpixmap\": \"xpm\",\n\t\t\"x-xwindowdump\": \"xwd\",\n\t\t\"bmp\": \"bmp\",\n\t\t\"cgm\": \"cgm\",\n\t\t\"g3fax\": \"g3\",\n\t\t\"ktx\": \"ktx\",\n\t\t\"prs.btif\": \"btif\",\n\t\t\"sgi\": \"sgi\",\n\t\t\"vnd.dece.graphic\": [\n\t\t\t\"uvi\",\n\t\t\t\"uvvi\",\n\t\t\t\"uvg\",\n\t\t\t\"uvvg\"\n\t\t],\n\t\t\"vnd.dwg\": \"dwg\",\n\t\t\"vnd.dxf\": \"dxf\",\n\t\t\"vnd.fastbidsheet\": \"fbs\",\n\t\t\"vnd.fpx\": \"fpx\",\n\t\t\"vnd.fst\": \"fst\",\n\t\t\"vnd.fujixerox.edmics-mmr\": \"mmr\",\n\t\t\"vnd.fujixerox.edmics-rlc\": \"rlc\",\n\t\t\"vnd.ms-modi\": \"mdi\",\n\t\t\"vnd.ms-photo\": \"wdp\",\n\t\t\"vnd.net-fpx\": \"npx\",\n\t\t\"vnd.xiff\": \"xif\",\n\t\t\"webp\": \"webp\",\n\t\t\"x-3ds\": \"3ds\",\n\t\t\"x-cmx\": \"cmx\",\n\t\t\"x-freehand\": [\n\t\t\t\"fh\",\n\t\t\t\"fhc\",\n\t\t\t\"fh4\",\n\t\t\t\"fh5\",\n\t\t\t\"fh7\"\n\t\t],\n\t\t\"x-pict\": [\n\t\t\t\"pic\",\n\t\t\t\"pct\"\n\t\t],\n\t\t\"x-tga\": \"tga\",\n\t\t\"cis-cod\": \"cod\",\n\t\t\"avif\": \"avifs\",\n\t\t\"heic\": [\n\t\t\t\"heif\",\n\t\t\t\"heic\"\n\t\t],\n\t\t\"pjpeg\": [\n\t\t\t\"pjpg\"\n\t\t],\n\t\t\"vnd.adobe.photoshop\": \"psd\",\n\t\t\"x-adobe-dng\": \"dng\",\n\t\t\"x-fuji-raf\": \"raf\",\n\t\t\"x-icns\": \"icns\",\n\t\t\"x-kodak-dcr\": \"dcr\",\n\t\t\"x-kodak-k25\": \"k25\",\n\t\t\"x-kodak-kdc\": \"kdc\",\n\t\t\"x-minolta-mrw\": \"mrw\",\n\t\t\"x-panasonic-raw\": [\n\t\t\t\"raw\",\n\t\t\t\"rw2\",\n\t\t\t\"rwl\"\n\t\t],\n\t\t\"x-pentax-pef\": [\n\t\t\t\"pef\",\n\t\t\t\"ptx\"\n\t\t],\n\t\t\"x-sigma-x3f\": \"x3f\",\n\t\t\"x-sony-arw\": \"arw\",\n\t\t\"x-sony-sr2\": \"sr2\",\n\t\t\"x-sony-srf\": \"srf\"\n\t},\n\t\"message\": {\n\t\t\"rfc822\": [\n\t\t\t\"eml\",\n\t\t\t\"mime\",\n\t\t\t\"mht\",\n\t\t\t\"mhtml\",\n\t\t\t\"nws\"\n\t\t]\n\t},\n\t\"model\": {\n\t\t\"iges\": [\n\t\t\t\"igs\",\n\t\t\t\"iges\"\n\t\t],\n\t\t\"mesh\": [\n\t\t\t\"msh\",\n\t\t\t\"mesh\",\n\t\t\t\"silo\"\n\t\t],\n\t\t\"vrml\": [\n\t\t\t\"wrl\",\n\t\t\t\"vrml\"\n\t\t],\n\t\t\"x3d+vrml\": [\n\t\t\t\"x3dv\",\n\t\t\t\"x3dvz\"\n\t\t],\n\t\t\"x3d+xml\": \"x3dz\",\n\t\t\"x3d+binary\": [\n\t\t\t\"x3db\",\n\t\t\t\"x3dbz\"\n\t\t],\n\t\t\"vnd.collada+xml\": \"dae\",\n\t\t\"vnd.dwf\": \"dwf\",\n\t\t\"vnd.gdl\": \"gdl\",\n\t\t\"vnd.gtw\": \"gtw\",\n\t\t\"vnd.mts\": \"mts\",\n\t\t\"vnd.usdz+zip\": \"usdz\",\n\t\t\"vnd.vtu\": \"vtu\"\n\t},\n\t\"text\": {\n\t\t\"cache-manifest\": [\n\t\t\t\"manifest\",\n\t\t\t\"appcache\"\n\t\t],\n\t\t\"calendar\": [\n\t\t\t\"ics\",\n\t\t\t\"icz\",\n\t\t\t\"ifb\"\n\t\t],\n\t\t\"css\": \"css\",\n\t\t\"csv\": \"csv\",\n\t\t\"h323\": \"323\",\n\t\t\"html\": [\n\t\t\t\"html\",\n\t\t\t\"htm\",\n\t\t\t\"shtml\",\n\t\t\t\"stm\"\n\t\t],\n\t\t\"iuls\": \"uls\",\n\t\t\"plain\": [\n\t\t\t\"txt\",\n\t\t\t\"text\",\n\t\t\t\"brf\",\n\t\t\t\"conf\",\n\t\t\t\"def\",\n\t\t\t\"list\",\n\t\t\t\"log\",\n\t\t\t\"in\",\n\t\t\t\"bas\",\n\t\t\t\"diff\",\n\t\t\t\"ksh\"\n\t\t],\n\t\t\"richtext\": \"rtx\",\n\t\t\"scriptlet\": [\n\t\t\t\"sct\",\n\t\t\t\"wsc\"\n\t\t],\n\t\t\"texmacs\": \"tm\",\n\t\t\"tab-separated-values\": \"tsv\",\n\t\t\"vnd.sun.j2me.app-descriptor\": \"jad\",\n\t\t\"vnd.wap.wml\": \"wml\",\n\t\t\"vnd.wap.wmlscript\": \"wmls\",\n\t\t\"x-bibtex\": \"bib\",\n\t\t\"x-boo\": \"boo\",\n\t\t\"x-c++hdr\": [\n\t\t\t\"h++\",\n\t\t\t\"hpp\",\n\t\t\t\"hxx\",\n\t\t\t\"hh\"\n\t\t],\n\t\t\"x-c++src\": [\n\t\t\t\"c++\",\n\t\t\t\"cpp\",\n\t\t\t\"cxx\",\n\t\t\t\"cc\"\n\t\t],\n\t\t\"x-component\": \"htc\",\n\t\t\"x-dsrc\": \"d\",\n\t\t\"x-diff\": \"patch\",\n\t\t\"x-haskell\": \"hs\",\n\t\t\"x-java\": \"java\",\n\t\t\"x-literate-haskell\": \"lhs\",\n\t\t\"x-moc\": \"moc\",\n\t\t\"x-pascal\": [\n\t\t\t\"p\",\n\t\t\t\"pas\",\n\t\t\t\"pp\",\n\t\t\t\"inc\"\n\t\t],\n\t\t\"x-pcs-gcd\": \"gcd\",\n\t\t\"x-python\": \"py\",\n\t\t\"x-scala\": \"scala\",\n\t\t\"x-setext\": \"etx\",\n\t\t\"x-tcl\": [\n\t\t\t\"tcl\",\n\t\t\t\"tk\"\n\t\t],\n\t\t\"x-tex\": [\n\t\t\t\"tex\",\n\t\t\t\"ltx\",\n\t\t\t\"sty\",\n\t\t\t\"cls\"\n\t\t],\n\t\t\"x-vcalendar\": \"vcs\",\n\t\t\"x-vcard\": \"vcf\",\n\t\t\"n3\": \"n3\",\n\t\t\"prs.lines.tag\": \"dsc\",\n\t\t\"sgml\": [\n\t\t\t\"sgml\",\n\t\t\t\"sgm\"\n\t\t],\n\t\t\"troff\": [\n\t\t\t\"t\",\n\t\t\t\"tr\",\n\t\t\t\"roff\",\n\t\t\t\"man\",\n\t\t\t\"me\",\n\t\t\t\"ms\"\n\t\t],\n\t\t\"turtle\": \"ttl\",\n\t\t\"uri-list\": [\n\t\t\t\"uri\",\n\t\t\t\"uris\",\n\t\t\t\"urls\"\n\t\t],\n\t\t\"vcard\": \"vcard\",\n\t\t\"vnd.curl\": \"curl\",\n\t\t\"vnd.curl.dcurl\": \"dcurl\",\n\t\t\"vnd.curl.scurl\": \"scurl\",\n\t\t\"vnd.curl.mcurl\": \"mcurl\",\n\t\t\"vnd.dvb.subtitle\": \"sub\",\n\t\t\"vnd.fly\": \"fly\",\n\t\t\"vnd.fmi.flexstor\": \"flx\",\n\t\t\"vnd.graphviz\": \"gv\",\n\t\t\"vnd.in3d.3dml\": \"3dml\",\n\t\t\"vnd.in3d.spot\": \"spot\",\n\t\t\"x-asm\": [\n\t\t\t\"s\",\n\t\t\t\"asm\"\n\t\t],\n\t\t\"x-c\": [\n\t\t\t\"c\",\n\t\t\t\"h\",\n\t\t\t\"dic\"\n\t\t],\n\t\t\"x-fortran\": [\n\t\t\t\"f\",\n\t\t\t\"for\",\n\t\t\t\"f77\",\n\t\t\t\"f90\"\n\t\t],\n\t\t\"x-opml\": \"opml\",\n\t\t\"x-nfo\": \"nfo\",\n\t\t\"x-sfv\": \"sfv\",\n\t\t\"x-uuencode\": \"uu\",\n\t\t\"webviewhtml\": \"htt\",\n\t\t\"javascript\": \"js\",\n\t\t\"json\": \"json\",\n\t\t\"markdown\": [\n\t\t\t\"md\",\n\t\t\t\"markdown\",\n\t\t\t\"mdown\",\n\t\t\t\"markdn\"\n\t\t],\n\t\t\"vnd.wap.si\": \"si\",\n\t\t\"vnd.wap.sl\": \"sl\"\n\t},\n\t\"video\": {\n\t\t\"avif\": \"avif\",\n\t\t\"3gpp\": \"3gp\",\n\t\t\"annodex\": \"axv\",\n\t\t\"dl\": \"dl\",\n\t\t\"dv\": [\n\t\t\t\"dif\",\n\t\t\t\"dv\"\n\t\t],\n\t\t\"fli\": \"fli\",\n\t\t\"gl\": \"gl\",\n\t\t\"mpeg\": [\n\t\t\t\"mpeg\",\n\t\t\t\"mpg\",\n\t\t\t\"mpe\",\n\t\t\t\"m1v\",\n\t\t\t\"m2v\",\n\t\t\t\"mp2\",\n\t\t\t\"mpa\",\n\t\t\t\"mpv2\"\n\t\t],\n\t\t\"mp4\": [\n\t\t\t\"mp4\",\n\t\t\t\"mp4v\",\n\t\t\t\"mpg4\"\n\t\t],\n\t\t\"quicktime\": [\n\t\t\t\"qt\",\n\t\t\t\"mov\"\n\t\t],\n\t\t\"ogg\": \"ogv\",\n\t\t\"vnd.mpegurl\": [\n\t\t\t\"mxu\",\n\t\t\t\"m4u\"\n\t\t],\n\t\t\"x-flv\": \"flv\",\n\t\t\"x-la-asf\": [\n\t\t\t\"lsf\",\n\t\t\t\"lsx\"\n\t\t],\n\t\t\"x-mng\": \"mng\",\n\t\t\"x-ms-asf\": [\n\t\t\t\"asf\",\n\t\t\t\"asx\",\n\t\t\t\"asr\"\n\t\t],\n\t\t\"x-ms-wm\": \"wm\",\n\t\t\"x-ms-wmv\": \"wmv\",\n\t\t\"x-ms-wmx\": \"wmx\",\n\t\t\"x-ms-wvx\": \"wvx\",\n\t\t\"x-msvideo\": \"avi\",\n\t\t\"x-sgi-movie\": \"movie\",\n\t\t\"x-matroska\": [\n\t\t\t\"mpv\",\n\t\t\t\"mkv\",\n\t\t\t\"mk3d\",\n\t\t\t\"mks\"\n\t\t],\n\t\t\"3gpp2\": \"3g2\",\n\t\t\"h261\": \"h261\",\n\t\t\"h263\": \"h263\",\n\t\t\"h264\": \"h264\",\n\t\t\"jpeg\": \"jpgv\",\n\t\t\"jpm\": [\n\t\t\t\"jpm\",\n\t\t\t\"jpgm\"\n\t\t],\n\t\t\"mj2\": [\n\t\t\t\"mj2\",\n\t\t\t\"mjp2\"\n\t\t],\n\t\t\"vnd.dece.hd\": [\n\t\t\t\"uvh\",\n\t\t\t\"uvvh\"\n\t\t],\n\t\t\"vnd.dece.mobile\": [\n\t\t\t\"uvm\",\n\t\t\t\"uvvm\"\n\t\t],\n\t\t\"vnd.dece.pd\": [\n\t\t\t\"uvp\",\n\t\t\t\"uvvp\"\n\t\t],\n\t\t\"vnd.dece.sd\": [\n\t\t\t\"uvs\",\n\t\t\t\"uvvs\"\n\t\t],\n\t\t\"vnd.dece.video\": [\n\t\t\t\"uvv\",\n\t\t\t\"uvvv\"\n\t\t],\n\t\t\"vnd.dvb.file\": \"dvb\",\n\t\t\"vnd.fvt\": \"fvt\",\n\t\t\"vnd.ms-playready.media.pyv\": \"pyv\",\n\t\t\"vnd.uvvu.mp4\": [\n\t\t\t\"uvu\",\n\t\t\t\"uvvu\"\n\t\t],\n\t\t\"vnd.vivo\": \"viv\",\n\t\t\"webm\": \"webm\",\n\t\t\"x-f4v\": \"f4v\",\n\t\t\"x-m4v\": \"m4v\",\n\t\t\"x-ms-vob\": \"vob\",\n\t\t\"x-smv\": \"smv\",\n\t\t\"mp2t\": \"ts\"\n\t},\n\t\"x-conference\": {\n\t\t\"x-cooltalk\": \"ice\"\n\t},\n\t\"x-world\": {\n\t\t\"x-vrml\": [\n\t\t\t\"vrm\",\n\t\t\t\"flr\",\n\t\t\t\"wrz\",\n\t\t\t\"xaf\",\n\t\t\t\"xof\"\n\t\t]\n\t}\n};\n\nconst mimeTypes = (() => {\n\tconst mimeTypes = {};\n\tfor (const type of Object.keys(table)) {\n\t\tfor (const subtype of Object.keys(table[type])) {\n\t\t\tconst value = table[type][subtype];\n\t\t\tif (typeof value == \"string\") {\n\t\t\t\tmimeTypes[value] = type + \"/\" + subtype;\n\t\t\t} else {\n\t\t\t\tfor (let indexMimeType = 0; indexMimeType < value.length; indexMimeType++) {\n\t\t\t\t\tmimeTypes[value[indexMimeType]] = type + \"/\" + subtype;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn mimeTypes;\n})();\n\nexport {\n\tmimeTypes,\n\tgetMimeType\n};\n\nfunction getMimeType(filename) {\n\treturn filename && mimeTypes[filename.split(\".\").pop().toLowerCase()] || getDefaultMimeType();\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst table = [];\nfor (let i = 0; i < 256; i++) {\n\tlet t = i;\n\tfor (let j = 0; j < 8; j++) {\n\t\tif (t & 1) {\n\t\t\tt = (t >>> 1) ^ 0xEDB88320;\n\t\t} else {\n\t\t\tt = t >>> 1;\n\t\t}\n\t}\n\ttable[i] = t;\n}\n\nclass Crc32 {\n\n\tconstructor(crc) {\n\t\tthis.crc = crc || -1;\n\t}\n\n\tappend(data) {\n\t\tlet crc = this.crc | 0;\n\t\tfor (let offset = 0, length = data.length | 0; offset < length; offset++) {\n\t\t\tcrc = (crc >>> 8) ^ table[(crc ^ data[offset]) & 0xFF];\n\t\t}\n\t\tthis.crc = crc;\n\t}\n\n\tget() {\n\t\treturn ~this.crc;\n\t}\n}\n\nexport {\n\tCrc32\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TransformStream */\n\nimport { Crc32 } from \"./codecs/crc32.js\";\n\nclass Crc32Stream extends TransformStream {\n\n\tconstructor() {\n\t\t// deno-lint-ignore prefer-const\n\t\tlet stream;\n\t\tconst crc32 = new Crc32();\n\t\tsuper({\n\t\t\ttransform(chunk, controller) {\n\t\t\t\tcrc32.append(chunk);\n\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t},\n\t\t\tflush() {\n\t\t\t\tconst value = new Uint8Array(4);\n\t\t\t\tconst dataView = new DataView(value.buffer);\n\t\t\t\tdataView.setUint32(0, crc32.get());\n\t\t\t\tstream.value = value;\n\t\t\t}\n\t\t});\n\t\tstream = this;\n\t}\n}\n\nexport {\n\tCrc32Stream\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TextEncoder */\n\nimport { UNDEFINED_TYPE } from \"../constants.js\";\n\nexport {\n\tencodeText\n};\n\nfunction encodeText(value) {\n\t// deno-lint-ignore valid-typeof\n\tif (typeof TextEncoder == UNDEFINED_TYPE) {\n\t\tvalue = unescape(encodeURIComponent(value));\n\t\tconst result = new Uint8Array(value.length);\n\t\tfor (let i = 0; i < result.length; i++) {\n\t\t\tresult[i] = value.charCodeAt(i);\n\t\t}\n\t\treturn result;\n\t} else {\n\t\treturn new TextEncoder().encode(value);\n\t}\n}","// Derived from https://github.com/xqdoo00o/jszip/blob/master/lib/sjcl.js and https://github.com/bitwiseshiftleft/sjcl\n\n// deno-lint-ignore-file no-this-alias\n\n/*\n * SJCL is open. You can use, modify and redistribute it under a BSD\n * license or under the GNU GPL, version 2.0.\n */\n\n/** @fileOverview Javascript cryptography implementation.\n *\n * Crush to remove comments, shorten variable names and\n * generally reduce transmission size.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */\n\n/** @fileOverview Arrays of bits, encoded as arrays of Numbers.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/**\n * Arrays of bits, encoded as arrays of Numbers.\n * @namespace\n * @description\n * <p>\n * These objects are the currency accepted by SJCL's crypto functions.\n * </p>\n *\n * <p>\n * Most of our crypto primitives operate on arrays of 4-byte words internally,\n * but many of them can take arguments that are not a multiple of 4 bytes.\n * This library encodes arrays of bits (whose size need not be a multiple of 8\n * bits) as arrays of 32-bit words. The bits are packed, big-endian, into an\n * array of words, 32 bits at a time. Since the words are double-precision\n * floating point numbers, they fit some extra data. We use this (in a private,\n * possibly-changing manner) to encode the number of bits actually present\n * in the last word of the array.\n * </p>\n *\n * <p>\n * Because bitwise ops clear this out-of-band data, these arrays can be passed\n * to ciphers like AES which want arrays of words.\n * </p>\n */\nconst bitArray = {\n\t/**\n\t * Concatenate two bit arrays.\n\t * @param {bitArray} a1 The first array.\n\t * @param {bitArray} a2 The second array.\n\t * @return {bitArray} The concatenation of a1 and a2.\n\t */\n\tconcat(a1, a2) {\n\t\tif (a1.length === 0 || a2.length === 0) {\n\t\t\treturn a1.concat(a2);\n\t\t}\n\n\t\tconst last = a1[a1.length - 1], shift = bitArray.getPartial(last);\n\t\tif (shift === 32) {\n\t\t\treturn a1.concat(a2);\n\t\t} else {\n\t\t\treturn bitArray._shiftRight(a2, shift, last | 0, a1.slice(0, a1.length - 1));\n\t\t}\n\t},\n\n\t/**\n\t * Find the length of an array of bits.\n\t * @param {bitArray} a The array.\n\t * @return {Number} The length of a, in bits.\n\t */\n\tbitLength(a) {\n\t\tconst l = a.length;\n\t\tif (l === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst x = a[l - 1];\n\t\treturn (l - 1) * 32 + bitArray.getPartial(x);\n\t},\n\n\t/**\n\t * Truncate an array.\n\t * @param {bitArray} a The array.\n\t * @param {Number} len The length to truncate to, in bits.\n\t * @return {bitArray} A new array, truncated to len bits.\n\t */\n\tclamp(a, len) {\n\t\tif (a.length * 32 < len) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a.slice(0, Math.ceil(len / 32));\n\t\tconst l = a.length;\n\t\tlen = len & 31;\n\t\tif (l > 0 && len) {\n\t\t\ta[l - 1] = bitArray.partial(len, a[l - 1] & 0x80000000 >> (len - 1), 1);\n\t\t}\n\t\treturn a;\n\t},\n\n\t/**\n\t * Make a partial word for a bit array.\n\t * @param {Number} len The number of bits in the word.\n\t * @param {Number} x The bits.\n\t * @param {Number} [_end=0] Pass 1 if x has already been shifted to the high side.\n\t * @return {Number} The partial word.\n\t */\n\tpartial(len, x, _end) {\n\t\tif (len === 32) {\n\t\t\treturn x;\n\t\t}\n\t\treturn (_end ? x | 0 : x << (32 - len)) + len * 0x10000000000;\n\t},\n\n\t/**\n\t * Get the number of bits used by a partial word.\n\t * @param {Number} x The partial word.\n\t * @return {Number} The number of bits used by the partial word.\n\t */\n\tgetPartial(x) {\n\t\treturn Math.round(x / 0x10000000000) || 32;\n\t},\n\n\t/** Shift an array right.\n\t * @param {bitArray} a The array to shift.\n\t * @param {Number} shift The number of bits to shift.\n\t * @param {Number} [carry=0] A byte to carry in\n\t * @param {bitArray} [out=[]] An array to prepend to the output.\n\t * @private\n\t */\n\t_shiftRight(a, shift, carry, out) {\n\t\tif (out === undefined) {\n\t\t\tout = [];\n\t\t}\n\n\t\tfor (; shift >= 32; shift -= 32) {\n\t\t\tout.push(carry);\n\t\t\tcarry = 0;\n\t\t}\n\t\tif (shift === 0) {\n\t\t\treturn out.concat(a);\n\t\t}\n\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tout.push(carry | a[i] >>> shift);\n\t\t\tcarry = a[i] << (32 - shift);\n\t\t}\n\t\tconst last2 = a.length ? a[a.length - 1] : 0;\n\t\tconst shift2 = bitArray.getPartial(last2);\n\t\tout.push(bitArray.partial(shift + shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(), 1));\n\t\treturn out;\n\t}\n};\n\n/** @fileOverview Bit array codec implementations.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/**\n * Arrays of bytes\n * @namespace\n */\nconst codec = {\n\tbytes: {\n\t\t/** Convert from a bitArray to an array of bytes. */\n\t\tfromBits(arr) {\n\t\t\tconst bl = bitArray.bitLength(arr);\n\t\t\tconst byteLength = bl / 8;\n\t\t\tconst out = new Uint8Array(byteLength);\n\t\t\tlet tmp;\n\t\t\tfor (let i = 0; i < byteLength; i++) {\n\t\t\t\tif ((i & 3) === 0) {\n\t\t\t\t\ttmp = arr[i / 4];\n\t\t\t\t}\n\t\t\t\tout[i] = tmp >>> 24;\n\t\t\t\ttmp <<= 8;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t\t/** Convert from an array of bytes to a bitArray. */\n\t\ttoBits(bytes) {\n\t\t\tconst out = [];\n\t\t\tlet i;\n\t\t\tlet tmp = 0;\n\t\t\tfor (i = 0; i < bytes.length; i++) {\n\t\t\t\ttmp = tmp << 8 | bytes[i];\n\t\t\t\tif ((i & 3) === 3) {\n\t\t\t\t\tout.push(tmp);\n\t\t\t\t\ttmp = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i & 3) {\n\t\t\t\tout.push(bitArray.partial(8 * (i & 3), tmp));\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t}\n};\n\nconst hash = {};\n\n/**\n * Context for a SHA-1 operation in progress.\n * @constructor\n */\nhash.sha1 = class {\n\tconstructor(hash) {\n\t\tconst sha1 = this;\n\t\t/**\n\t\t * The hash's block size, in bits.\n\t\t * @constant\n\t\t */\n\t\tsha1.blockSize = 512;\n\t\t/**\n\t\t * The SHA-1 initialization vector.\n\t\t * @private\n\t\t */\n\t\tsha1._init = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0];\n\t\t/**\n\t\t * The SHA-1 hash key.\n\t\t * @private\n\t\t */\n\t\tsha1._key = [0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6];\n\t\tif (hash) {\n\t\t\tsha1._h = hash._h.slice(0);\n\t\t\tsha1._buffer = hash._buffer.slice(0);\n\t\t\tsha1._length = hash._length;\n\t\t} else {\n\t\t\tsha1.reset();\n\t\t}\n\t}\n\n\t/**\n\t * Reset the hash state.\n\t * @return this\n\t */\n\treset() {\n\t\tconst sha1 = this;\n\t\tsha1._h = sha1._init.slice(0);\n\t\tsha1._buffer = [];\n\t\tsha1._length = 0;\n\t\treturn sha1;\n\t}\n\n\t/**\n\t * Input several words to the hash.\n\t * @param {bitArray|String} data the data to hash.\n\t * @return this\n\t */\n\tupdate(data) {\n\t\tconst sha1 = this;\n\t\tif (typeof data === \"string\") {\n\t\t\tdata = codec.utf8String.toBits(data);\n\t\t}\n\t\tconst b = sha1._buffer = bitArray.concat(sha1._buffer, data);\n\t\tconst ol = sha1._length;\n\t\tconst nl = sha1._length = ol + bitArray.bitLength(data);\n\t\tif (nl > 9007199254740991) {\n\t\t\tthrow new Error(\"Cannot hash more than 2^53 - 1 bits\");\n\t\t}\n\t\tconst c = new Uint32Array(b);\n\t\tlet j = 0;\n\t\tfor (let i = sha1.blockSize + ol - ((sha1.blockSize + ol) & (sha1.blockSize - 1)); i <= nl;\n\t\t\ti += sha1.blockSize) {\n\t\t\tsha1._block(c.subarray(16 * j, 16 * (j + 1)));\n\t\t\tj += 1;\n\t\t}\n\t\tb.splice(0, 16 * j);\n\t\treturn sha1;\n\t}\n\n\t/**\n\t * Complete hashing and output the hash value.\n\t * @return {bitArray} The hash value, an array of 5 big-endian words. TODO\n\t */\n\tfinalize() {\n\t\tconst sha1 = this;\n\t\tlet b = sha1._buffer;\n\t\tconst h = sha1._h;\n\n\t\t// Round out and push the buffer\n\t\tb = bitArray.concat(b, [bitArray.partial(1, 1)]);\n\t\t// Round out the buffer to a multiple of 16 words, less the 2 length words.\n\t\tfor (let i = b.length + 2; i & 15; i++) {\n\t\t\tb.push(0);\n\t\t}\n\n\t\t// append the length\n\t\tb.push(Math.floor(sha1._length / 0x100000000));\n\t\tb.push(sha1._length | 0);\n\n\t\twhile (b.length) {\n\t\t\tsha1._block(b.splice(0, 16));\n\t\t}\n\n\t\tsha1.reset();\n\t\treturn h;\n\t}\n\n\t/**\n\t * The SHA-1 logical functions f(0), f(1), ..., f(79).\n\t * @private\n\t */\n\t_f(t, b, c, d) {\n\t\tif (t <= 19) {\n\t\t\treturn (b & c) | (~b & d);\n\t\t} else if (t <= 39) {\n\t\t\treturn b ^ c ^ d;\n\t\t} else if (t <= 59) {\n\t\t\treturn (b & c) | (b & d) | (c & d);\n\t\t} else if (t <= 79) {\n\t\t\treturn b ^ c ^ d;\n\t\t}\n\t}\n\n\t/**\n\t * Circular left-shift operator.\n\t * @private\n\t */\n\t_S(n, x) {\n\t\treturn (x << n) | (x >>> 32 - n);\n\t}\n\n\t/**\n\t * Perform one cycle of SHA-1.\n\t * @param {Uint32Array|bitArray} words one block of words.\n\t * @private\n\t */\n\t_block(words) {\n\t\tconst sha1 = this;\n\t\tconst h = sha1._h;\n\t\t// When words is passed to _block, it has 16 elements. SHA1 _block\n\t\t// function extends words with new elements (at the end there are 80 elements). \n\t\t// The problem is that if we use Uint32Array instead of Array, \n\t\t// the length of Uint32Array cannot be changed. Thus, we replace words with a \n\t\t// normal Array here.\n\t\tconst w = Array(80); // do not use Uint32Array here as the instantiation is slower\n\t\tfor (let j = 0; j < 16; j++) {\n\t\t\tw[j] = words[j];\n\t\t}\n\n\t\tlet a = h[0];\n\t\tlet b = h[1];\n\t\tlet c = h[2];\n\t\tlet d = h[3];\n\t\tlet e = h[4];\n\n\t\tfor (let t = 0; t <= 79; t++) {\n\t\t\tif (t >= 16) {\n\t\t\t\tw[t] = sha1._S(1, w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16]);\n\t\t\t}\n\t\t\tconst tmp = (sha1._S(5, a) + sha1._f(t, b, c, d) + e + w[t] +\n\t\t\t\tsha1._key[Math.floor(t / 20)]) | 0;\n\t\t\te = d;\n\t\t\td = c;\n\t\t\tc = sha1._S(30, b);\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\n\t\th[0] = (h[0] + a) | 0;\n\t\th[1] = (h[1] + b) | 0;\n\t\th[2] = (h[2] + c) | 0;\n\t\th[3] = (h[3] + d) | 0;\n\t\th[4] = (h[4] + e) | 0;\n\t}\n};\n\n/** @fileOverview Low-level AES implementation.\n *\n * This file contains a low-level implementation of AES, optimized for\n * size and for efficiency on several browsers. It is based on\n * OpenSSL's aes_core.c, a public-domain implementation by Vincent\n * Rijmen, Antoon Bosselaers and Paulo Barreto.\n *\n * An older version of this implementation is available in the public\n * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh,\n * Stanford University 2008-2010 and BSD-licensed for liability\n * reasons.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\nconst cipher = {};\n\n/**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @constructor\n * @param {Array} key The key as an array of 4, 6 or 8 words.\n */\ncipher.aes = class {\n\tconstructor(key) {\n\t\t/**\n\t\t * The expanded S-box and inverse S-box tables. These will be computed\n\t\t * on the client so that we don't have to send them down the wire.\n\t\t *\n\t\t * There are two tables, _tables[0] is for encryption and\n\t\t * _tables[1] is for decryption.\n\t\t *\n\t\t * The first 4 sub-tables are the expanded S-box with MixColumns. The\n\t\t * last (_tables[01][4]) is the S-box itself.\n\t\t *\n\t\t * @private\n\t\t */\n\t\tconst aes = this;\n\t\taes._tables = [[[], [], [], [], []], [[], [], [], [], []]];\n\n\t\tif (!aes._tables[0][0][0]) {\n\t\t\taes._precompute();\n\t\t}\n\n\t\tconst sbox = aes._tables[0][4];\n\t\tconst decTable = aes._tables[1];\n\t\tconst keyLen = key.length;\n\n\t\tlet i, encKey, decKey, rcon = 1;\n\n\t\tif (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n\t\t\tthrow new Error(\"invalid aes key size\");\n\t\t}\n\n\t\taes._key = [encKey = key.slice(0), decKey = []];\n\n\t\t// schedule encryption keys\n\t\tfor (i = keyLen; i < 4 * keyLen + 28; i++) {\n\t\t\tlet tmp = encKey[i - 1];\n\n\t\t\t// apply sbox\n\t\t\tif (i % keyLen === 0 || (keyLen === 8 && i % keyLen === 4)) {\n\t\t\t\ttmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];\n\n\t\t\t\t// shift rows and add rcon\n\t\t\t\tif (i % keyLen === 0) {\n\t\t\t\t\ttmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n\t\t\t\t\trcon = rcon << 1 ^ (rcon >> 7) * 283;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tencKey[i] = encKey[i - keyLen] ^ tmp;\n\t\t}\n\n\t\t// schedule decryption keys\n\t\tfor (let j = 0; i; j++, i--) {\n\t\t\tconst tmp = encKey[j & 3 ? i : i - 4];\n\t\t\tif (i <= 4 || j < 4) {\n\t\t\t\tdecKey[j] = tmp;\n\t\t\t} else {\n\t\t\t\tdecKey[j] = decTable[0][sbox[tmp >>> 24]] ^\n\t\t\t\t\tdecTable[1][sbox[tmp >> 16 & 255]] ^\n\t\t\t\t\tdecTable[2][sbox[tmp >> 8 & 255]] ^\n\t\t\t\t\tdecTable[3][sbox[tmp & 255]];\n\t\t\t}\n\t\t}\n\t}\n\t// public\n\t/* Something like this might appear here eventually\n\tname: \"AES\",\n\tblockSize: 4,\n\tkeySizes: [4,6,8],\n\t*/\n\n\t/**\n\t * Encrypt an array of 4 big-endian words.\n\t * @param {Array} data The plaintext.\n\t * @return {Array} The ciphertext.\n\t */\n\tencrypt(data) {\n\t\treturn this._crypt(data, 0);\n\t}\n\n\t/**\n\t * Decrypt an array of 4 big-endian words.\n\t * @param {Array} data The ciphertext.\n\t * @return {Array} The plaintext.\n\t */\n\tdecrypt(data) {\n\t\treturn this._crypt(data, 1);\n\t}\n\n\t/**\n\t * Expand the S-box tables.\n\t *\n\t * @private\n\t */\n\t_precompute() {\n\t\tconst encTable = this._tables[0];\n\t\tconst decTable = this._tables[1];\n\t\tconst sbox = encTable[4];\n\t\tconst sboxInv = decTable[4];\n\t\tconst d = [];\n\t\tconst th = [];\n\t\tlet xInv, x2, x4, x8;\n\n\t\t// Compute double and third tables\n\t\tfor (let i = 0; i < 256; i++) {\n\t\t\tth[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n\t\t}\n\n\t\tfor (let x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n\t\t\t// Compute sbox\n\t\t\tlet s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n\t\t\ts = s >> 8 ^ s & 255 ^ 99;\n\t\t\tsbox[x] = s;\n\t\t\tsboxInv[s] = x;\n\n\t\t\t// Compute MixColumns\n\t\t\tx8 = d[x4 = d[x2 = d[x]]];\n\t\t\tlet tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n\t\t\tlet tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n\t\t\tfor (let i = 0; i < 4; i++) {\n\t\t\t\tencTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n\t\t\t\tdecTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n\t\t\t}\n\t\t}\n\n\t\t// Compactify. Considerable speedup on Firefox.\n\t\tfor (let i = 0; i < 5; i++) {\n\t\t\tencTable[i] = encTable[i].slice(0);\n\t\t\tdecTable[i] = decTable[i].slice(0);\n\t\t}\n\t}\n\n\t/**\n\t * Encryption and decryption core.\n\t * @param {Array} input Four words to be encrypted or decrypted.\n\t * @param dir The direction, 0 for encrypt and 1 for decrypt.\n\t * @return {Array} The four encrypted or decrypted words.\n\t * @private\n\t */\n\t_crypt(input, dir) {\n\t\tif (input.length !== 4) {\n\t\t\tthrow new Error(\"invalid aes block size\");\n\t\t}\n\n\t\tconst key = this._key[dir];\n\n\t\tconst nInnerRounds = key.length / 4 - 2;\n\t\tconst out = [0, 0, 0, 0];\n\t\tconst table = this._tables[dir];\n\n\t\t// load up the tables\n\t\tconst t0 = table[0];\n\t\tconst t1 = table[1];\n\t\tconst t2 = table[2];\n\t\tconst t3 = table[3];\n\t\tconst sbox = table[4];\n\n\t\t// state variables a,b,c,d are loaded with pre-whitened data\n\t\tlet a = input[0] ^ key[0];\n\t\tlet b = input[dir ? 3 : 1] ^ key[1];\n\t\tlet c = input[2] ^ key[2];\n\t\tlet d = input[dir ? 1 : 3] ^ key[3];\n\t\tlet kIndex = 4;\n\t\tlet a2, b2, c2;\n\n\t\t// Inner rounds. Cribbed from OpenSSL.\n\t\tfor (let i = 0; i < nInnerRounds; i++) {\n\t\t\ta2 = t0[a >>> 24] ^ t1[b >> 16 & 255] ^ t2[c >> 8 & 255] ^ t3[d & 255] ^ key[kIndex];\n\t\t\tb2 = t0[b >>> 24] ^ t1[c >> 16 & 255] ^ t2[d >> 8 & 255] ^ t3[a & 255] ^ key[kIndex + 1];\n\t\t\tc2 = t0[c >>> 24] ^ t1[d >> 16 & 255] ^ t2[a >> 8 & 255] ^ t3[b & 255] ^ key[kIndex + 2];\n\t\t\td = t0[d >>> 24] ^ t1[a >> 16 & 255] ^ t2[b >> 8 & 255] ^ t3[c & 255] ^ key[kIndex + 3];\n\t\t\tkIndex += 4;\n\t\t\ta = a2; b = b2; c = c2;\n\t\t}\n\n\t\t// Last round.\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tout[dir ? 3 & -i : i] =\n\t\t\t\tsbox[a >>> 24] << 24 ^\n\t\t\t\tsbox[b >> 16 & 255] << 16 ^\n\t\t\t\tsbox[c >> 8 & 255] << 8 ^\n\t\t\t\tsbox[d & 255] ^\n\t\t\t\tkey[kIndex++];\n\t\t\ta2 = a; a = b; b = c; c = d; d = a2;\n\t\t}\n\n\t\treturn out;\n\t}\n};\n\n/**\n * Random values\n * @namespace\n */\nconst random = {\n\t/** \n\t * Generate random words with pure js, cryptographically not as strong & safe as native implementation.\n\t * @param {TypedArray} typedArray The array to fill.\n\t * @return {TypedArray} The random values.\n\t */\n\tgetRandomValues(typedArray) {\n\t\tconst words = new Uint32Array(typedArray.buffer);\n\t\tconst r = (m_w) => {\n\t\t\tlet m_z = 0x3ade68b1;\n\t\t\tconst mask = 0xffffffff;\n\t\t\treturn function () {\n\t\t\t\tm_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\n\t\t\t\tm_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\n\t\t\t\tconst result = ((((m_z << 0x10) + m_w) & mask) / 0x100000000) + .5;\n\t\t\t\treturn result * (Math.random() > .5 ? 1 : -1);\n\t\t\t};\n\t\t};\n\t\tfor (let i = 0, rcache; i < typedArray.length; i += 4) {\n\t\t\tconst _r = r((rcache || Math.random()) * 0x100000000);\n\t\t\trcache = _r() * 0x3ade67b7;\n\t\t\twords[i / 4] = (_r() * 0x100000000) | 0;\n\t\t}\n\t\treturn typedArray;\n\t}\n};\n\n/** @fileOverview CTR mode implementation.\n *\n * Special thanks to Roy Nicholson for pointing out a bug in our\n * implementation.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/** Brian Gladman's CTR Mode.\n* @constructor\n* @param {Object} _prf The aes instance to generate key.\n* @param {bitArray} _iv The iv for ctr mode, it must be 128 bits.\n*/\n\nconst mode = {};\n\n/**\n * Brian Gladman's CTR Mode.\n * @namespace\n */\nmode.ctrGladman = class {\n\tconstructor(prf, iv) {\n\t\tthis._prf = prf;\n\t\tthis._initIv = iv;\n\t\tthis._iv = iv;\n\t}\n\n\treset() {\n\t\tthis._iv = this._initIv;\n\t}\n\n\t/** Input some data to calculate.\n\t * @param {bitArray} data the data to process, it must be intergral multiple of 128 bits unless it's the last.\n\t */\n\tupdate(data) {\n\t\treturn this.calculate(this._prf, data, this._iv);\n\t}\n\n\tincWord(word) {\n\t\tif (((word >> 24) & 0xff) === 0xff) { //overflow\n\t\t\tlet b1 = (word >> 16) & 0xff;\n\t\t\tlet b2 = (word >> 8) & 0xff;\n\t\t\tlet b3 = word & 0xff;\n\n\t\t\tif (b1 === 0xff) { // overflow b1 \n\t\t\t\tb1 = 0;\n\t\t\t\tif (b2 === 0xff) {\n\t\t\t\t\tb2 = 0;\n\t\t\t\t\tif (b3 === 0xff) {\n\t\t\t\t\t\tb3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t++b3;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t++b2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t++b1;\n\t\t\t}\n\n\t\t\tword = 0;\n\t\t\tword += (b1 << 16);\n\t\t\tword += (b2 << 8);\n\t\t\tword += b3;\n\t\t} else {\n\t\t\tword += (0x01 << 24);\n\t\t}\n\t\treturn word;\n\t}\n\n\tincCounter(counter) {\n\t\tif ((counter[0] = this.incWord(counter[0])) === 0) {\n\t\t\t// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n\t\t\tcounter[1] = this.incWord(counter[1]);\n\t\t}\n\t}\n\n\tcalculate(prf, data, iv) {\n\t\tlet l;\n\t\tif (!(l = data.length)) {\n\t\t\treturn [];\n\t\t}\n\t\tconst bl = bitArray.bitLength(data);\n\t\tfor (let i = 0; i < l; i += 4) {\n\t\t\tthis.incCounter(iv);\n\t\t\tconst e = prf.encrypt(iv);\n\t\t\tdata[i] ^= e[0];\n\t\t\tdata[i + 1] ^= e[1];\n\t\t\tdata[i + 2] ^= e[2];\n\t\t\tdata[i + 3] ^= e[3];\n\t\t}\n\t\treturn bitArray.clamp(data, bl);\n\t}\n};\n\nconst misc = {\n\timportKey(password) {\n\t\treturn new misc.hmacSha1(codec.bytes.toBits(password));\n\t},\n\tpbkdf2(prf, salt, count, length) {\n\t\tcount = count || 10000;\n\t\tif (length < 0 || count < 0) {\n\t\t\tthrow new Error(\"invalid params to pbkdf2\");\n\t\t}\n\t\tconst byteLength = ((length >> 5) + 1) << 2;\n\t\tlet u, ui, i, j, k;\n\t\tconst arrayBuffer = new ArrayBuffer(byteLength);\n\t\tconst out = new DataView(arrayBuffer);\n\t\tlet outLength = 0;\n\t\tconst b = bitArray;\n\t\tsalt = codec.bytes.toBits(salt);\n\t\tfor (k = 1; outLength < (byteLength || 1); k++) {\n\t\t\tu = ui = prf.encrypt(b.concat(salt, [k]));\n\t\t\tfor (i = 1; i < count; i++) {\n\t\t\t\tui = prf.encrypt(ui);\n\t\t\t\tfor (j = 0; j < ui.length; j++) {\n\t\t\t\t\tu[j] ^= ui[j];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; outLength < (byteLength || 1) && i < u.length; i++) {\n\t\t\t\tout.setInt32(outLength, u[i]);\n\t\t\t\toutLength += 4;\n\t\t\t}\n\t\t}\n\t\treturn arrayBuffer.slice(0, length / 8);\n\t}\n};\n\n/** @fileOverview HMAC implementation.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/** HMAC with the specified hash function.\n * @constructor\n * @param {bitArray} key the key for HMAC.\n * @param {Object} [Hash=hash.sha1] The hash function to use.\n */\nmisc.hmacSha1 = class {\n\n\tconstructor(key) {\n\t\tconst hmac = this;\n\t\tconst Hash = hmac._hash = hash.sha1;\n\t\tconst exKey = [[], []];\n\t\thmac._baseHash = [new Hash(), new Hash()];\n\t\tconst bs = hmac._baseHash[0].blockSize / 32;\n\n\t\tif (key.length > bs) {\n\t\t\tkey = new Hash().update(key).finalize();\n\t\t}\n\n\t\tfor (let i = 0; i < bs; i++) {\n\t\t\texKey[0][i] = key[i] ^ 0x36363636;\n\t\t\texKey[1][i] = key[i] ^ 0x5C5C5C5C;\n\t\t}\n\n\t\thmac._baseHash[0].update(exKey[0]);\n\t\thmac._baseHash[1].update(exKey[1]);\n\t\thmac._resultHash = new Hash(hmac._baseHash[0]);\n\t}\n\treset() {\n\t\tconst hmac = this;\n\t\thmac._resultHash = new hmac._hash(hmac._baseHash[0]);\n\t\thmac._updated = false;\n\t}\n\n\tupdate(data) {\n\t\tconst hmac = this;\n\t\thmac._updated = true;\n\t\thmac._resultHash.update(data);\n\t}\n\n\tdigest() {\n\t\tconst hmac = this;\n\t\tconst w = hmac._resultHash.finalize();\n\t\tconst result = new (hmac._hash)(hmac._baseHash[1]).update(w).finalize();\n\n\t\thmac.reset();\n\n\t\treturn result;\n\t}\n\n\tencrypt(data) {\n\t\tif (!this._updated) {\n\t\t\tthis.update(data);\n\t\t\treturn this.digest(data);\n\t\t} else {\n\t\t\tthrow new Error(\"encrypt on already updated hmac called!\");\n\t\t}\n\t}\n};\n\nexport {\n\tcipher,\n\tcodec,\n\tmisc,\n\tmode,\n\trandom\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global crypto */\n\nimport { FUNCTION_TYPE, UNDEFINED_TYPE } from \"../constants.js\";\nimport {\n\trandom\n} from \"./codecs/sjcl.js\";\n\nconst GET_RANDOM_VALUES_SUPPORTED = typeof crypto != UNDEFINED_TYPE && typeof crypto.getRandomValues == FUNCTION_TYPE;\n\nconst ERR_INVALID_PASSWORD = \"Invalid password\";\nconst ERR_INVALID_SIGNATURE = \"Invalid signature\";\nconst ERR_ABORT_CHECK_PASSWORD = \"zipjs-abort-check-password\";\n\nexport {\n\tgetRandomValues,\n\tERR_INVALID_PASSWORD,\n\tERR_INVALID_SIGNATURE,\n\tERR_ABORT_CHECK_PASSWORD\n};\n\nfunction getRandomValues(array) {\n\tif (GET_RANDOM_VALUES_SUPPORTED) {\n\t\treturn crypto.getRandomValues(array);\n\t} else {\n\t\treturn random.getRandomValues(array);\n\t}\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global crypto, TransformStream */\n// deno-lint-ignore-file no-this-alias\n\nimport { UNDEFINED_VALUE, UNDEFINED_TYPE, FUNCTION_TYPE } from \"../constants.js\";\nimport { encodeText } from \"./../util/encode-text.js\";\nimport {\n\tcipher,\n\tcodec,\n\tmisc,\n\tmode\n} from \"./codecs/sjcl.js\";\nimport {\n\tERR_INVALID_PASSWORD,\n\tERR_INVALID_SIGNATURE,\n\tERR_ABORT_CHECK_PASSWORD,\n\tgetRandomValues\n} from \"./common-crypto.js\";\n\nconst BLOCK_LENGTH = 16;\nconst RAW_FORMAT = \"raw\";\nconst PBKDF2_ALGORITHM = { name: \"PBKDF2\" };\nconst HASH_ALGORITHM = { name: \"HMAC\" };\nconst HASH_FUNCTION = \"SHA-1\";\nconst BASE_KEY_ALGORITHM = Object.assign({ hash: HASH_ALGORITHM }, PBKDF2_ALGORITHM);\nconst DERIVED_BITS_ALGORITHM = Object.assign({ iterations: 1000, hash: { name: HASH_FUNCTION } }, PBKDF2_ALGORITHM);\nconst DERIVED_BITS_USAGE = [\"deriveBits\"];\nconst SALT_LENGTH = [8, 12, 16];\nconst KEY_LENGTH = [16, 24, 32];\nconst SIGNATURE_LENGTH = 10;\nconst COUNTER_DEFAULT_VALUE = [0, 0, 0, 0];\n// deno-lint-ignore valid-typeof\nconst CRYPTO_API_SUPPORTED = typeof crypto != UNDEFINED_TYPE;\nconst subtle = CRYPTO_API_SUPPORTED && crypto.subtle;\nconst SUBTLE_API_SUPPORTED = CRYPTO_API_SUPPORTED && typeof subtle != UNDEFINED_TYPE;\nconst codecBytes = codec.bytes;\nconst Aes = cipher.aes;\nconst CtrGladman = mode.ctrGladman;\nconst HmacSha1 = misc.hmacSha1;\n\nlet IMPORT_KEY_SUPPORTED = CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof subtle.importKey == FUNCTION_TYPE;\nlet DERIVE_BITS_SUPPORTED = CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof subtle.deriveBits == FUNCTION_TYPE;\n\nclass AESDecryptionStream extends TransformStream {\n\n\tconstructor({ password, rawPassword, signed, encryptionStrength, checkPasswordOnly }) {\n\t\tsuper({\n\t\t\tstart() {\n\t\t\t\tObject.assign(this, {\n\t\t\t\t\tready: new Promise(resolve => this.resolveReady = resolve),\n\t\t\t\t\tpassword: encodePassword(password, rawPassword),\n\t\t\t\t\tsigned,\n\t\t\t\t\tstrength: encryptionStrength - 1,\n\t\t\t\t\tpending: new Uint8Array()\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync transform(chunk, controller) {\n\t\t\t\tconst aesCrypto = this;\n\t\t\t\tconst {\n\t\t\t\t\tpassword,\n\t\t\t\t\tstrength,\n\t\t\t\t\tresolveReady,\n\t\t\t\t\tready\n\t\t\t\t} = aesCrypto;\n\t\t\t\tif (password) {\n\t\t\t\t\tawait createDecryptionKeys(aesCrypto, strength, password, subarray(chunk, 0, SALT_LENGTH[strength] + 2));\n\t\t\t\t\tchunk = subarray(chunk, SALT_LENGTH[strength] + 2);\n\t\t\t\t\tif (checkPasswordOnly) {\n\t\t\t\t\t\tcontroller.error(new Error(ERR_ABORT_CHECK_PASSWORD));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolveReady();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tawait ready;\n\t\t\t\t}\n\t\t\t\tconst output = new Uint8Array(chunk.length - SIGNATURE_LENGTH - ((chunk.length - SIGNATURE_LENGTH) % BLOCK_LENGTH));\n\t\t\t\tcontroller.enqueue(append(aesCrypto, chunk, output, 0, SIGNATURE_LENGTH, true));\n\t\t\t},\n\t\t\tasync flush(controller) {\n\t\t\t\tconst {\n\t\t\t\t\tsigned,\n\t\t\t\t\tctr,\n\t\t\t\t\thmac,\n\t\t\t\t\tpending,\n\t\t\t\t\tready\n\t\t\t\t} = this;\n\t\t\t\tif (hmac && ctr) {\n\t\t\t\t\tawait ready;\n\t\t\t\t\tconst chunkToDecrypt = subarray(pending, 0, pending.length - SIGNATURE_LENGTH);\n\t\t\t\t\tconst originalSignature = subarray(pending, pending.length - SIGNATURE_LENGTH);\n\t\t\t\t\tlet decryptedChunkArray = new Uint8Array();\n\t\t\t\t\tif (chunkToDecrypt.length) {\n\t\t\t\t\t\tconst encryptedChunk = toBits(codecBytes, chunkToDecrypt);\n\t\t\t\t\t\thmac.update(encryptedChunk);\n\t\t\t\t\t\tconst decryptedChunk = ctr.update(encryptedChunk);\n\t\t\t\t\t\tdecryptedChunkArray = fromBits(codecBytes, decryptedChunk);\n\t\t\t\t\t}\n\t\t\t\t\tif (signed) {\n\t\t\t\t\t\tconst signature = subarray(fromBits(codecBytes, hmac.digest()), 0, SIGNATURE_LENGTH);\n\t\t\t\t\t\tfor (let indexSignature = 0; indexSignature < SIGNATURE_LENGTH; indexSignature++) {\n\t\t\t\t\t\t\tif (signature[indexSignature] != originalSignature[indexSignature]) {\n\t\t\t\t\t\t\t\tthrow new Error(ERR_INVALID_SIGNATURE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontroller.enqueue(decryptedChunkArray);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass AESEncryptionStream extends TransformStream {\n\n\tconstructor({ password, rawPassword, encryptionStrength }) {\n\t\t// deno-lint-ignore prefer-const\n\t\tlet stream;\n\t\tsuper({\n\t\t\tstart() {\n\t\t\t\tObject.assign(this, {\n\t\t\t\t\tready: new Promise(resolve => this.resolveReady = resolve),\n\t\t\t\t\tpassword: encodePassword(password, rawPassword),\n\t\t\t\t\tstrength: encryptionStrength - 1,\n\t\t\t\t\tpending: new Uint8Array()\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync transform(chunk, controller) {\n\t\t\t\tconst aesCrypto = this;\n\t\t\t\tconst {\n\t\t\t\t\tpassword,\n\t\t\t\t\tstrength,\n\t\t\t\t\tresolveReady,\n\t\t\t\t\tready\n\t\t\t\t} = aesCrypto;\n\t\t\t\tlet preamble = new Uint8Array();\n\t\t\t\tif (password) {\n\t\t\t\t\tpreamble = await createEncryptionKeys(aesCrypto, strength, password);\n\t\t\t\t\tresolveReady();\n\t\t\t\t} else {\n\t\t\t\t\tawait ready;\n\t\t\t\t}\n\t\t\t\tconst output = new Uint8Array(preamble.length + chunk.length - (chunk.length % BLOCK_LENGTH));\n\t\t\t\toutput.set(preamble, 0);\n\t\t\t\tcontroller.enqueue(append(aesCrypto, chunk, output, preamble.length, 0));\n\t\t\t},\n\t\t\tasync flush(controller) {\n\t\t\t\tconst {\n\t\t\t\t\tctr,\n\t\t\t\t\thmac,\n\t\t\t\t\tpending,\n\t\t\t\t\tready\n\t\t\t\t} = this;\n\t\t\t\tif (hmac && ctr) {\n\t\t\t\t\tawait ready;\n\t\t\t\t\tlet encryptedChunkArray = new Uint8Array();\n\t\t\t\t\tif (pending.length) {\n\t\t\t\t\t\tconst encryptedChunk = ctr.update(toBits(codecBytes, pending));\n\t\t\t\t\t\thmac.update(encryptedChunk);\n\t\t\t\t\t\tencryptedChunkArray = fromBits(codecBytes, encryptedChunk);\n\t\t\t\t\t}\n\t\t\t\t\tstream.signature = fromBits(codecBytes, hmac.digest()).slice(0, SIGNATURE_LENGTH);\n\t\t\t\t\tcontroller.enqueue(concat(encryptedChunkArray, stream.signature));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tstream = this;\n\t}\n}\n\nexport {\n\tAESDecryptionStream,\n\tAESEncryptionStream,\n\tERR_INVALID_PASSWORD\n};\n\nfunction append(aesCrypto, input, output, paddingStart, paddingEnd, verifySignature) {\n\tconst {\n\t\tctr,\n\t\thmac,\n\t\tpending\n\t} = aesCrypto;\n\tconst inputLength = input.length - paddingEnd;\n\tif (pending.length) {\n\t\tinput = concat(pending, input);\n\t\toutput = expand(output, inputLength - (inputLength % BLOCK_LENGTH));\n\t}\n\tlet offset;\n\tfor (offset = 0; offset <= inputLength - BLOCK_LENGTH; offset += BLOCK_LENGTH) {\n\t\tconst inputChunk = toBits(codecBytes, subarray(input, offset, offset + BLOCK_LENGTH));\n\t\tif (verifySignature) {\n\t\t\thmac.update(inputChunk);\n\t\t}\n\t\tconst outputChunk = ctr.update(inputChunk);\n\t\tif (!verifySignature) {\n\t\t\thmac.update(outputChunk);\n\t\t}\n\t\toutput.set(fromBits(codecBytes, outputChunk), offset + paddingStart);\n\t}\n\taesCrypto.pending = subarray(input, offset);\n\treturn output;\n}\n\nasync function createDecryptionKeys(decrypt, strength, password, preamble) {\n\tconst passwordVerificationKey = await createKeys(decrypt, strength, password, subarray(preamble, 0, SALT_LENGTH[strength]));\n\tconst passwordVerification = subarray(preamble, SALT_LENGTH[strength]);\n\tif (passwordVerificationKey[0] != passwordVerification[0] || passwordVerificationKey[1] != passwordVerification[1]) {\n\t\tthrow new Error(ERR_INVALID_PASSWORD);\n\t}\n}\n\nasync function createEncryptionKeys(encrypt, strength, password) {\n\tconst salt = getRandomValues(new Uint8Array(SALT_LENGTH[strength]));\n\tconst passwordVerification = await createKeys(encrypt, strength, password, salt);\n\treturn concat(salt, passwordVerification);\n}\n\nasync function createKeys(aesCrypto, strength, password, salt) {\n\taesCrypto.password = null;\n\tconst baseKey = await importKey(RAW_FORMAT, password, BASE_KEY_ALGORITHM, false, DERIVED_BITS_USAGE);\n\tconst derivedBits = await deriveBits(Object.assign({ salt }, DERIVED_BITS_ALGORITHM), baseKey, 8 * ((KEY_LENGTH[strength] * 2) + 2));\n\tconst compositeKey = new Uint8Array(derivedBits);\n\tconst key = toBits(codecBytes, subarray(compositeKey, 0, KEY_LENGTH[strength]));\n\tconst authentication = toBits(codecBytes, subarray(compositeKey, KEY_LENGTH[strength], KEY_LENGTH[strength] * 2));\n\tconst passwordVerification = subarray(compositeKey, KEY_LENGTH[strength] * 2);\n\tObject.assign(aesCrypto, {\n\t\tkeys: {\n\t\t\tkey,\n\t\t\tauthentication,\n\t\t\tpasswordVerification\n\t\t},\n\t\tctr: new CtrGladman(new Aes(key), Array.from(COUNTER_DEFAULT_VALUE)),\n\t\thmac: new HmacSha1(authentication)\n\t});\n\treturn passwordVerification;\n}\n\nasync function importKey(format, password, algorithm, extractable, keyUsages) {\n\tif (IMPORT_KEY_SUPPORTED) {\n\t\ttry {\n\t\t\treturn await subtle.importKey(format, password, algorithm, extractable, keyUsages);\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t} catch (_) {\n\t\t\tIMPORT_KEY_SUPPORTED = false;\n\t\t\treturn misc.importKey(password);\n\t\t}\n\t} else {\n\t\treturn misc.importKey(password);\n\t}\n}\n\nasync function deriveBits(algorithm, baseKey, length) {\n\tif (DERIVE_BITS_SUPPORTED) {\n\t\ttry {\n\t\t\treturn await subtle.deriveBits(algorithm, baseKey, length);\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t} catch (_) {\n\t\t\tDERIVE_BITS_SUPPORTED = false;\n\t\t\treturn misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length);\n\t\t}\n\t} else {\n\t\treturn misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length);\n\t}\n}\n\nfunction encodePassword(password, rawPassword) {\n\tif (rawPassword === UNDEFINED_VALUE) {\n\t\treturn encodeText(password);\n\t} else {\n\t\treturn rawPassword;\n\t}\n}\n\nfunction concat(leftArray, rightArray) {\n\tlet array = leftArray;\n\tif (leftArray.length + rightArray.length) {\n\t\tarray = new Uint8Array(leftArray.length + rightArray.length);\n\t\tarray.set(leftArray, 0);\n\t\tarray.set(rightArray, leftArray.length);\n\t}\n\treturn array;\n}\n\nfunction expand(inputArray, length) {\n\tif (length && length > inputArray.length) {\n\t\tconst array = inputArray;\n\t\tinputArray = new Uint8Array(length);\n\t\tinputArray.set(array, 0);\n\t}\n\treturn inputArray;\n}\n\nfunction subarray(array, begin, end) {\n\treturn array.subarray(begin, end);\n}\n\nfunction fromBits(codecBytes, chunk) {\n\treturn codecBytes.fromBits(chunk);\n}\nfunction toBits(codecBytes, chunk) {\n\treturn codecBytes.toBits(chunk);\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TransformStream */\n// deno-lint-ignore-file no-this-alias\n\nimport { Crc32 } from \"./codecs/crc32.js\";\nimport {\n\tERR_INVALID_PASSWORD,\n\tERR_ABORT_CHECK_PASSWORD,\n\tgetRandomValues\n} from \"./common-crypto.js\";\n\nconst HEADER_LENGTH = 12;\n\nclass ZipCryptoDecryptionStream extends TransformStream {\n\n\tconstructor({ password, passwordVerification, checkPasswordOnly }) {\n\t\tsuper({\n\t\t\tstart() {\n\t\t\t\tObject.assign(this, {\n\t\t\t\t\tpassword,\n\t\t\t\t\tpasswordVerification\n\t\t\t\t});\n\t\t\t\tcreateKeys(this, password);\n\t\t\t},\n\t\t\ttransform(chunk, controller) {\n\t\t\t\tconst zipCrypto = this;\n\t\t\t\tif (zipCrypto.password) {\n\t\t\t\t\tconst decryptedHeader = decrypt(zipCrypto, chunk.subarray(0, HEADER_LENGTH));\n\t\t\t\t\tzipCrypto.password = null;\n\t\t\t\t\tif (decryptedHeader[HEADER_LENGTH - 1] != zipCrypto.passwordVerification) {\n\t\t\t\t\t\tthrow new Error(ERR_INVALID_PASSWORD);\n\t\t\t\t\t}\n\t\t\t\t\tchunk = chunk.subarray(HEADER_LENGTH);\n\t\t\t\t}\n\t\t\t\tif (checkPasswordOnly) {\n\t\t\t\t\tcontroller.error(new Error(ERR_ABORT_CHECK_PASSWORD));\n\t\t\t\t} else {\n\t\t\t\t\tcontroller.enqueue(decrypt(zipCrypto, chunk));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass ZipCryptoEncryptionStream extends TransformStream {\n\n\tconstructor({ password, passwordVerification }) {\n\t\tsuper({\n\t\t\tstart() {\n\t\t\t\tObject.assign(this, {\n\t\t\t\t\tpassword,\n\t\t\t\t\tpasswordVerification\n\t\t\t\t});\n\t\t\t\tcreateKeys(this, password);\n\t\t\t},\n\t\t\ttransform(chunk, controller) {\n\t\t\t\tconst zipCrypto = this;\n\t\t\t\tlet output;\n\t\t\t\tlet offset;\n\t\t\t\tif (zipCrypto.password) {\n\t\t\t\t\tzipCrypto.password = null;\n\t\t\t\t\tconst header = getRandomValues(new Uint8Array(HEADER_LENGTH));\n\t\t\t\t\theader[HEADER_LENGTH - 1] = zipCrypto.passwordVerification;\n\t\t\t\t\toutput = new Uint8Array(chunk.length + header.length);\n\t\t\t\t\toutput.set(encrypt(zipCrypto, header), 0);\n\t\t\t\t\toffset = HEADER_LENGTH;\n\t\t\t\t} else {\n\t\t\t\t\toutput = new Uint8Array(chunk.length);\n\t\t\t\t\toffset = 0;\n\t\t\t\t}\n\t\t\t\toutput.set(encrypt(zipCrypto, chunk), offset);\n\t\t\t\tcontroller.enqueue(output);\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport {\n\tZipCryptoDecryptionStream,\n\tZipCryptoEncryptionStream,\n\tERR_INVALID_PASSWORD\n};\n\nfunction decrypt(target, input) {\n\tconst output = new Uint8Array(input.length);\n\tfor (let index = 0; index < input.length; index++) {\n\t\toutput[index] = getByte(target) ^ input[index];\n\t\tupdateKeys(target, output[index]);\n\t}\n\treturn output;\n}\n\nfunction encrypt(target, input) {\n\tconst output = new Uint8Array(input.length);\n\tfor (let index = 0; index < input.length; index++) {\n\t\toutput[index] = getByte(target) ^ input[index];\n\t\tupdateKeys(target, input[index]);\n\t}\n\treturn output;\n}\n\nfunction createKeys(target, password) {\n\tconst keys = [0x12345678, 0x23456789, 0x34567890];\n\tObject.assign(target, {\n\t\tkeys,\n\t\tcrcKey0: new Crc32(keys[0]),\n\t\tcrcKey2: new Crc32(keys[2]),\n\t});\n\tfor (let index = 0; index < password.length; index++) {\n\t\tupdateKeys(target, password.charCodeAt(index));\n\t}\n}\n\nfunction updateKeys(target, byte) {\n\tlet [key0, key1, key2] = target.keys;\n\ttarget.crcKey0.append([byte]);\n\tkey0 = ~target.crcKey0.get();\n\tkey1 = getInt32(Math.imul(getInt32(key1 + getInt8(key0)), 134775813) + 1);\n\ttarget.crcKey2.append([key1 >>> 24]);\n\tkey2 = ~target.crcKey2.get();\n\ttarget.keys = [key0, key1, key2];\n}\n\nfunction getByte(target) {\n\tconst temp = target.keys[2] | 2;\n\treturn getInt8(Math.imul(temp, (temp ^ 1)) >>> 8);\n}\n\nfunction getInt8(number) {\n\treturn number & 0xFF;\n}\n\nfunction getInt32(number) {\n\treturn number & 0xFFFFFFFF;\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TransformStream */\n// deno-lint-ignore-file no-this-alias\n\nimport { Crc32Stream } from \"./crc32-stream.js\";\nimport {\n\tAESEncryptionStream,\n\tAESDecryptionStream\n} from \"./aes-crypto-stream.js\";\nimport {\n\tZipCryptoEncryptionStream,\n\tZipCryptoDecryptionStream\n} from \"./zip-crypto-stream.js\";\nimport {\n\tERR_INVALID_PASSWORD,\n\tERR_INVALID_SIGNATURE,\n\tERR_ABORT_CHECK_PASSWORD\n} from \"./common-crypto.js\";\n\nconst COMPRESSION_FORMAT = \"deflate-raw\";\n\nclass DeflateStream extends TransformStream {\n\n\tconstructor(options, { chunkSize, CompressionStream, CompressionStreamNative }) {\n\t\tsuper({});\n\t\tconst { compressed, encrypted, useCompressionStream, zipCrypto, signed, level } = options;\n\t\tconst stream = this;\n\t\tlet crc32Stream, encryptionStream;\n\t\tlet readable = filterEmptyChunks(super.readable);\n\t\tif ((!encrypted || zipCrypto) && signed) {\n\t\t\tcrc32Stream = new Crc32Stream();\n\t\t\treadable = pipeThrough(readable, crc32Stream);\n\t\t}\n\t\tif (compressed) {\n\t\t\treadable = pipeThroughCommpressionStream(readable, useCompressionStream, { level, chunkSize }, CompressionStreamNative, CompressionStream);\n\t\t}\n\t\tif (encrypted) {\n\t\t\tif (zipCrypto) {\n\t\t\t\treadable = pipeThrough(readable, new ZipCryptoEncryptionStream(options));\n\t\t\t} else {\n\t\t\t\tencryptionStream = new AESEncryptionStream(options);\n\t\t\t\treadable = pipeThrough(readable, encryptionStream);\n\t\t\t}\n\t\t}\n\t\tsetReadable(stream, readable, () => {\n\t\t\tlet signature;\n\t\t\tif (encrypted && !zipCrypto) {\n\t\t\t\tsignature = encryptionStream.signature;\n\t\t\t}\n\t\t\tif ((!encrypted || zipCrypto) && signed) {\n\t\t\t\tsignature = new DataView(crc32Stream.value.buffer).getUint32(0);\n\t\t\t}\n\t\t\tstream.signature = signature;\n\t\t});\n\t}\n}\n\nclass InflateStream extends TransformStream {\n\n\tconstructor(options, { chunkSize, DecompressionStream, DecompressionStreamNative }) {\n\t\tsuper({});\n\t\tconst { zipCrypto, encrypted, signed, signature, compressed, useCompressionStream } = options;\n\t\tlet crc32Stream, decryptionStream;\n\t\tlet readable = filterEmptyChunks(super.readable);\n\t\tif (encrypted) {\n\t\t\tif (zipCrypto) {\n\t\t\t\treadable = pipeThrough(readable, new ZipCryptoDecryptionStream(options));\n\t\t\t} else {\n\t\t\t\tdecryptionStream = new AESDecryptionStream(options);\n\t\t\t\treadable = pipeThrough(readable, decryptionStream);\n\t\t\t}\n\t\t}\n\t\tif (compressed) {\n\t\t\treadable = pipeThroughCommpressionStream(readable, useCompressionStream, { chunkSize }, DecompressionStreamNative, DecompressionStream);\n\t\t}\n\t\tif ((!encrypted || zipCrypto) && signed) {\n\t\t\tcrc32Stream = new Crc32Stream();\n\t\t\treadable = pipeThrough(readable, crc32Stream);\n\t\t}\n\t\tsetReadable(this, readable, () => {\n\t\t\tif ((!encrypted || zipCrypto) && signed) {\n\t\t\t\tconst dataViewSignature = new DataView(crc32Stream.value.buffer);\n\t\t\t\tif (signature != dataViewSignature.getUint32(0, false)) {\n\t\t\t\t\tthrow new Error(ERR_INVALID_SIGNATURE);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport {\n\tDeflateStream,\n\tInflateStream,\n\tERR_INVALID_PASSWORD,\n\tERR_INVALID_SIGNATURE,\n\tERR_ABORT_CHECK_PASSWORD\n};\n\nfunction filterEmptyChunks(readable) {\n\treturn pipeThrough(readable, new TransformStream({\n\t\ttransform(chunk, controller) {\n\t\t\tif (chunk && chunk.length) {\n\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t}\n\t\t}\n\t}));\n}\n\nfunction setReadable(stream, readable, flush) {\n\treadable = pipeThrough(readable, new TransformStream({ flush }));\n\tObject.defineProperty(stream, \"readable\", {\n\t\tget() {\n\t\t\treturn readable;\n\t\t}\n\t});\n}\n\nfunction pipeThroughCommpressionStream(readable, useCompressionStream, options, CodecStreamNative, CodecStream) {\n\ttry {\n\t\tconst CompressionStream = useCompressionStream && CodecStreamNative ? CodecStreamNative : CodecStream;\n\t\treadable = pipeThrough(readable, new CompressionStream(COMPRESSION_FORMAT, options));\n\t\t// eslint-disable-next-line no-unused-vars\n\t} catch (_) {\n\t\tif (useCompressionStream) {\n\t\t\ttry {\n\t\t\t\treadable = pipeThrough(readable, new CodecStream(COMPRESSION_FORMAT, options));\n\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t} catch (_) {\n\t\t\t\treturn readable;\n\t\t\t}\n\t\t} else {\n\t\t\treturn readable;\n\t\t}\n\t}\n\treturn readable;\n}\n\nfunction pipeThrough(readable, transformStream) {\n\treturn readable.pipeThrough(transformStream);\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.\n * JZlib is based on zlib-1.1.3, so all credit should go authors\n * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)\n * and contributors of zlib.\n */\n\n/* global TransformStream */\n// deno-lint-ignore-file no-this-alias\n\nimport {\n\tERR_INVALID_PASSWORD,\n\tERR_INVALID_SIGNATURE,\n\tERR_ABORT_CHECK_PASSWORD,\n\tInflateStream,\n\tDeflateStream\n} from \"./zip-entry-stream.js\";\n\nconst MESSAGE_EVENT_TYPE = \"message\";\nconst MESSAGE_START = \"start\";\nconst MESSAGE_PULL = \"pull\";\nconst MESSAGE_DATA = \"data\";\nconst MESSAGE_ACK_DATA = \"ack\";\nconst MESSAGE_CLOSE = \"close\";\nconst CODEC_DEFLATE = \"deflate\";\nconst CODEC_INFLATE = \"inflate\";\n\nexport {\n\tCODEC_DEFLATE,\n\tCODEC_INFLATE,\n\tMESSAGE_EVENT_TYPE,\n\tMESSAGE_START,\n\tMESSAGE_PULL,\n\tMESSAGE_DATA,\n\tMESSAGE_ACK_DATA,\n\tMESSAGE_CLOSE,\n\tERR_INVALID_PASSWORD,\n\tERR_INVALID_SIGNATURE,\n\tERR_ABORT_CHECK_PASSWORD,\n\tCodecStream,\n\tChunkStream\n};\n\nclass CodecStream extends TransformStream {\n\n\tconstructor(options, config) {\n\t\tsuper({});\n\t\tconst codec = this;\n\t\tconst { codecType } = options;\n\t\tlet Stream;\n\t\tif (codecType.startsWith(CODEC_DEFLATE)) {\n\t\t\tStream = DeflateStream;\n\t\t} else if (codecType.startsWith(CODEC_INFLATE)) {\n\t\t\tStream = InflateStream;\n\t\t}\n\t\tlet outputSize = 0;\n\t\tlet inputSize = 0;\n\t\tconst stream = new Stream(options, config);\n\t\tconst readable = super.readable;\n\t\tconst inputSizeStream = new TransformStream({\n\t\t\ttransform(chunk, controller) {\n\t\t\t\tif (chunk && chunk.length) {\n\t\t\t\t\tinputSize += chunk.length;\n\t\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\t}\n\t\t\t},\n\t\t\tflush() {\n\t\t\t\tObject.assign(codec, {\n\t\t\t\t\tinputSize\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tconst outputSizeStream = new TransformStream({\n\t\t\ttransform(chunk, controller) {\n\t\t\t\tif (chunk && chunk.length) {\n\t\t\t\t\toutputSize += chunk.length;\n\t\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\t}\n\t\t\t},\n\t\t\tflush() {\n\t\t\t\tconst { signature } = stream;\n\t\t\t\tObject.assign(codec, {\n\t\t\t\t\tsignature,\n\t\t\t\t\toutputSize,\n\t\t\t\t\tinputSize\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(codec, \"readable\", {\n\t\t\tget() {\n\t\t\t\treturn readable.pipeThrough(inputSizeStream).pipeThrough(stream).pipeThrough(outputSizeStream);\n\t\t\t}\n\t\t});\n\t}\n}\n\nclass ChunkStream extends TransformStream {\n\n\tconstructor(chunkSize) {\n\t\tlet pendingChunk;\n\t\tsuper({\n\t\t\ttransform,\n\t\t\tflush(controller) {\n\t\t\t\tif (pendingChunk && pendingChunk.length) {\n\t\t\t\t\tcontroller.enqueue(pendingChunk);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfunction transform(chunk, controller) {\n\t\t\tif (pendingChunk) {\n\t\t\t\tconst newChunk = new Uint8Array(pendingChunk.length + chunk.length);\n\t\t\t\tnewChunk.set(pendingChunk);\n\t\t\t\tnewChunk.set(chunk, pendingChunk.length);\n\t\t\t\tchunk = newChunk;\n\t\t\t\tpendingChunk = null;\n\t\t\t}\n\t\t\tif (chunk.length > chunkSize) {\n\t\t\t\tcontroller.enqueue(chunk.slice(0, chunkSize));\n\t\t\t\ttransform(chunk.slice(chunkSize), controller);\n\t\t\t} else {\n\t\t\t\tpendingChunk = chunk;\n\t\t\t}\n\t\t}\n\t}\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global Worker, URL, TransformStream, WritableStream */\n\nimport {\n\tUNDEFINED_TYPE,\n\tFUNCTION_TYPE\n} from \"./constants.js\";\nimport {\n\tCodecStream,\n\tChunkStream,\n\tMESSAGE_EVENT_TYPE,\n\tMESSAGE_START,\n\tMESSAGE_PULL,\n\tMESSAGE_DATA,\n\tMESSAGE_ACK_DATA,\n\tMESSAGE_CLOSE\n} from \"./streams/codec-stream.js\";\n\n// deno-lint-ignore valid-typeof\nlet WEB_WORKERS_SUPPORTED = typeof Worker != UNDEFINED_TYPE;\n\nexport {\n\tCodecWorker\n};\n\nclass CodecWorker {\n\n\tconstructor(workerData, { readable, writable }, { options, config, streamOptions, useWebWorkers, transferStreams, scripts }, onTaskFinished) {\n\t\tconst { signal } = streamOptions;\n\t\tObject.assign(workerData, {\n\t\t\tbusy: true,\n\t\t\treadable: readable\n\t\t\t\t.pipeThrough(new ChunkStream(config.chunkSize))\n\t\t\t\t.pipeThrough(new ProgressWatcherStream(readable, streamOptions), { signal }),\n\t\t\twritable,\n\t\t\toptions: Object.assign({}, options),\n\t\t\tscripts,\n\t\t\ttransferStreams,\n\t\t\tterminate() {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst { worker, busy } = workerData;\n\t\t\t\t\tif (worker) {\n\t\t\t\t\t\tif (busy) {\n\t\t\t\t\t\t\tworkerData.resolveTerminated = resolve;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tworker.terminate();\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tworkerData.interface = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\tonTaskFinished() {\n\t\t\t\tconst { resolveTerminated } = workerData;\n\t\t\t\tif (resolveTerminated) {\n\t\t\t\t\tworkerData.resolveTerminated = null;\n\t\t\t\t\tworkerData.terminated = true;\n\t\t\t\t\tworkerData.worker.terminate();\n\t\t\t\t\tresolveTerminated();\n\t\t\t\t}\n\t\t\t\tworkerData.busy = false;\n\t\t\t\tonTaskFinished(workerData);\n\t\t\t}\n\t\t});\n\t\treturn (useWebWorkers && WEB_WORKERS_SUPPORTED ? createWebWorkerInterface : createWorkerInterface)(workerData, config);\n\t}\n}\n\nclass ProgressWatcherStream extends TransformStream {\n\n\tconstructor(readableSource, { onstart, onprogress, size, onend }) {\n\t\tlet chunkOffset = 0;\n\t\tsuper({\n\t\t\tasync start() {\n\t\t\t\tif (onstart) {\n\t\t\t\t\tawait callHandler(onstart, size);\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync transform(chunk, controller) {\n\t\t\t\tchunkOffset += chunk.length;\n\t\t\t\tif (onprogress) {\n\t\t\t\t\tawait callHandler(onprogress, chunkOffset, size);\n\t\t\t\t}\n\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t},\n\t\t\tasync flush() {\n\t\t\t\treadableSource.size = chunkOffset;\n\t\t\t\tif (onend) {\n\t\t\t\t\tawait callHandler(onend, chunkOffset);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nasync function callHandler(handler, ...parameters) {\n\ttry {\n\t\tawait handler(...parameters);\n\t\t// eslint-disable-next-line no-unused-vars\n\t} catch (_) {\n\t\t// ignored\n\t}\n}\n\nfunction createWorkerInterface(workerData, config) {\n\treturn {\n\t\trun: () => runWorker(workerData, config)\n\t};\n}\n\nfunction createWebWorkerInterface(workerData, config) {\n\tconst { baseURL, chunkSize } = config;\n\tif (!workerData.interface) {\n\t\tlet worker;\n\t\ttry {\n\t\t\tworker = getWebWorker(workerData.scripts[0], baseURL, workerData);\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t} catch (_) {\n\t\t\tWEB_WORKERS_SUPPORTED = false;\n\t\t\treturn createWorkerInterface(workerData, config);\n\t\t}\n\t\tObject.assign(workerData, {\n\t\t\tworker,\n\t\t\tinterface: {\n\t\t\t\trun: () => runWebWorker(workerData, { chunkSize })\n\t\t\t}\n\t\t});\n\t}\n\treturn workerData.interface;\n}\n\nasync function runWorker({ options, readable, writable, onTaskFinished }, config) {\n\ttry {\n\t\tconst codecStream = new CodecStream(options, config);\n\t\tawait readable.pipeThrough(codecStream).pipeTo(writable, { preventClose: true, preventAbort: true });\n\t\tconst {\n\t\t\tsignature,\n\t\t\tinputSize,\n\t\t\toutputSize\n\t\t} = codecStream;\n\t\treturn {\n\t\t\tsignature,\n\t\t\tinputSize,\n\t\t\toutputSize\n\t\t};\n\t} finally {\n\t\tonTaskFinished();\n\t}\n}\n\nasync function runWebWorker(workerData, config) {\n\tlet resolveResult, rejectResult;\n\tconst result = new Promise((resolve, reject) => {\n\t\tresolveResult = resolve;\n\t\trejectResult = reject;\n\t});\n\tObject.assign(workerData, {\n\t\treader: null,\n\t\twriter: null,\n\t\tresolveResult,\n\t\trejectResult,\n\t\tresult\n\t});\n\tconst { readable, options, scripts } = workerData;\n\tconst { writable, closed } = watchClosedStream(workerData.writable);\n\tconst streamsTransferred = sendMessage({\n\t\ttype: MESSAGE_START,\n\t\tscripts: scripts.slice(1),\n\t\toptions,\n\t\tconfig,\n\t\treadable,\n\t\twritable\n\t}, workerData);\n\tif (!streamsTransferred) {\n\t\tObject.assign(workerData, {\n\t\t\treader: readable.getReader(),\n\t\t\twriter: writable.getWriter()\n\t\t});\n\t}\n\tconst resultValue = await result;\n\tif (!streamsTransferred) {\n\t\tawait writable.getWriter().close();\n\t}\n\tawait closed;\n\treturn resultValue;\n}\n\nfunction watchClosedStream(writableSource) {\n\tlet resolveStreamClosed;\n\tconst closed = new Promise(resolve => resolveStreamClosed = resolve);\n\tconst writable = new WritableStream({\n\t\tasync write(chunk) {\n\t\t\tconst writer = writableSource.getWriter();\n\t\t\tawait writer.ready;\n\t\t\tawait writer.write(chunk);\n\t\t\twriter.releaseLock();\n\t\t},\n\t\tclose() {\n\t\t\tresolveStreamClosed();\n\t\t},\n\t\tabort(reason) {\n\t\t\tconst writer = writableSource.getWriter();\n\t\t\treturn writer.abort(reason);\n\t\t}\n\t});\n\treturn { writable, closed };\n}\n\nlet classicWorkersSupported = true;\nlet transferStreamsSupported = true;\n\nfunction getWebWorker(url, baseURL, workerData) {\n\tconst workerOptions = { type: \"module\" };\n\tlet scriptUrl, worker;\n\t// deno-lint-ignore valid-typeof\n\tif (typeof url == FUNCTION_TYPE) {\n\t\turl = url();\n\t}\n\ttry {\n\t\tscriptUrl = new URL(url, baseURL);\n\t\t// eslint-disable-next-line no-unused-vars\n\t} catch (_) {\n\t\tscriptUrl = url;\n\t}\n\tif (classicWorkersSupported) {\n\t\ttry {\n\t\t\tworker = new Worker(scriptUrl);\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t} catch (_) {\n\t\t\tclassicWorkersSupported = false;\n\t\t\tworker = new Worker(scriptUrl, workerOptions);\n\t\t}\n\t} else {\n\t\tworker = new Worker(scriptUrl, workerOptions);\n\t}\n\tworker.addEventListener(MESSAGE_EVENT_TYPE, event => onMessage(event, workerData));\n\treturn worker;\n}\n\nfunction sendMessage(message, { worker, writer, onTaskFinished, transferStreams }) {\n\ttry {\n\t\tconst { value, readable, writable } = message;\n\t\tconst transferables = [];\n\t\tif (value) {\n\t\t\tif (value.byteLength < value.buffer.byteLength) {\n\t\t\t\tmessage.value = value.buffer.slice(0, value.byteLength);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmessage.value = value.buffer;\n\t\t\t}\n\t\t\ttransferables.push(message.value);\n\t\t}\n\t\tif (transferStreams && transferStreamsSupported) {\n\t\t\tif (readable) {\n\t\t\t\ttransferables.push(readable);\n\t\t\t}\n\t\t\tif (writable) {\n\t\t\t\ttransferables.push(writable);\n\t\t\t}\n\t\t} else {\n\t\t\tmessage.readable = message.writable = null;\n\t\t}\n\t\tif (transferables.length) {\n\t\t\ttry {\n\t\t\t\tworker.postMessage(message, transferables);\n\t\t\t\treturn true;\n\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t} catch (_) {\n\t\t\t\ttransferStreamsSupported = false;\n\t\t\t\tmessage.readable = message.writable = null;\n\t\t\t\tworker.postMessage(message);\n\t\t\t}\n\t\t} else {\n\t\t\tworker.postMessage(message);\n\t\t}\n\t} catch (error) {\n\t\tif (writer) {\n\t\t\twriter.releaseLock();\n\t\t}\n\t\tonTaskFinished();\n\t\tthrow error;\n\t}\n}\n\nasync function onMessage({ data }, workerData) {\n\tconst { type, value, messageId, result, error } = data;\n\tconst { reader, writer, resolveResult, rejectResult, onTaskFinished } = workerData;\n\ttry {\n\t\tif (error) {\n\t\t\tconst { message, stack, code, name } = error;\n\t\t\tconst responseError = new Error(message);\n\t\t\tObject.assign(responseError, { stack, code, name });\n\t\t\tclose(responseError);\n\t\t} else {\n\t\t\tif (type == MESSAGE_PULL) {\n\t\t\t\tconst { value, done } = await reader.read();\n\t\t\t\tsendMessage({ type: MESSAGE_DATA, value, done, messageId }, workerData);\n\t\t\t}\n\t\t\tif (type == MESSAGE_DATA) {\n\t\t\t\tawait writer.ready;\n\t\t\t\tawait writer.write(new Uint8Array(value));\n\t\t\t\tsendMessage({ type: MESSAGE_ACK_DATA, messageId }, workerData);\n\t\t\t}\n\t\t\tif (type == MESSAGE_CLOSE) {\n\t\t\t\tclose(null, result);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tsendMessage({ type: MESSAGE_CLOSE, messageId }, workerData);\n\t\tclose(error);\n\t}\n\n\tfunction close(error, result) {\n\t\tif (error) {\n\t\t\trejectResult(error);\n\t\t} else {\n\t\t\tresolveResult(result);\n\t\t}\n\t\tif (writer) {\n\t\t\twriter.releaseLock();\n\t\t}\n\t\tonTaskFinished();\n\t}\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global setTimeout, clearTimeout */\n\nimport { UNDEFINED_VALUE } from \"./constants.js\";\nimport {\n\tCODEC_INFLATE,\n\tCODEC_DEFLATE,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD,\n\tERR_ABORT_CHECK_PASSWORD\n} from \"./streams/codec-stream.js\";\nimport { CodecWorker } from \"./codec-worker.js\";\n\nlet pool = [];\nconst pendingRequests = [];\n\nexport {\n\trunWorker,\n\tterminateWorkers,\n\tCODEC_DEFLATE,\n\tCODEC_INFLATE,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD,\n\tERR_ABORT_CHECK_PASSWORD\n};\n\nlet indexWorker = 0;\n\nasync function runWorker(stream, workerOptions) {\n\tconst { options, config } = workerOptions;\n\tconst { transferStreams, useWebWorkers, useCompressionStream, codecType, compressed, signed, encrypted } = options;\n\tconst { workerScripts, maxWorkers } = config;\n\tworkerOptions.transferStreams = transferStreams || transferStreams === UNDEFINED_VALUE;\n\tconst streamCopy = !compressed && !signed && !encrypted && !workerOptions.transferStreams;\n\tworkerOptions.useWebWorkers = !streamCopy && (useWebWorkers || (useWebWorkers === UNDEFINED_VALUE && config.useWebWorkers));\n\tworkerOptions.scripts = workerOptions.useWebWorkers && workerScripts ? workerScripts[codecType] : [];\n\toptions.useCompressionStream = useCompressionStream || (useCompressionStream === UNDEFINED_VALUE && config.useCompressionStream);\n\treturn (await getWorker()).run();\n\n\t// deno-lint-ignore require-await\n\tasync function getWorker() {\n\t\tconst workerData = pool.find(workerData => !workerData.busy);\n\t\tif (workerData) {\n\t\t\tclearTerminateTimeout(workerData);\n\t\t\treturn new CodecWorker(workerData, stream, workerOptions, onTaskFinished);\n\t\t} else if (pool.length < maxWorkers) {\n\t\t\tconst workerData = { indexWorker };\n\t\t\tindexWorker++;\n\t\t\tpool.push(workerData);\n\t\t\treturn new CodecWorker(workerData, stream, workerOptions, onTaskFinished);\n\t\t} else {\n\t\t\treturn new Promise(resolve => pendingRequests.push({ resolve, stream, workerOptions }));\n\t\t}\n\t}\n\n\tfunction onTaskFinished(workerData) {\n\t\tif (pendingRequests.length) {\n\t\t\tconst [{ resolve, stream, workerOptions }] = pendingRequests.splice(0, 1);\n\t\t\tresolve(new CodecWorker(workerData, stream, workerOptions, onTaskFinished));\n\t\t} else if (workerData.worker) {\n\t\t\tclearTerminateTimeout(workerData);\n\t\t\tterminateWorker(workerData, workerOptions);\n\t\t} else {\n\t\t\tpool = pool.filter(data => data != workerData);\n\t\t}\n\t}\n}\n\nfunction terminateWorker(workerData, workerOptions) {\n\tconst { config } = workerOptions;\n\tconst { terminateWorkerTimeout } = config;\n\tif (Number.isFinite(terminateWorkerTimeout) && terminateWorkerTimeout >= 0) {\n\t\tif (workerData.terminated) {\n\t\t\tworkerData.terminated = false;\n\t\t} else {\n\t\t\tworkerData.terminateTimeout = setTimeout(async () => {\n\t\t\t\tpool = pool.filter(data => data != workerData);\n\t\t\t\ttry {\n\t\t\t\t\tawait workerData.terminate();\n\t\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t\t} catch (_) {\n\t\t\t\t\t// ignored\n\t\t\t\t}\n\t\t\t}, terminateWorkerTimeout);\n\t\t}\n\t}\n}\n\nfunction clearTerminateTimeout(workerData) {\n\tconst { terminateTimeout } = workerData;\n\tif (terminateTimeout) {\n\t\tclearTimeout(terminateTimeout);\n\t\tworkerData.terminateTimeout = null;\n\t}\n}\n\nasync function terminateWorkers() {\n\tawait Promise.allSettled(pool.map(workerData => {\n\t\tclearTerminateTimeout(workerData);\n\t\treturn workerData.terminate();\n\t}));\n}","function e(e,t={}){const n='const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v=\"undefined\",S=\"function\";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,r.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s<e.length;s++)r.push(n|e[s]>>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={bytes:{p(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},m(e){const t=[];let n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],3&~n||(t.push(r),r=0);return 3&n&&t.push(_.h(8*(3&n),r)),t}}},P=class{constructor(e){const t=this;t.blockSize=512,t.k=[1732584193,4023233417,2562383102,271733878,3285377520],t.v=[1518500249,1859775393,2400959708,3395469782],e?(t.S=e.S.slice(0),t.C=e.C.slice(0),t.A=e.A):t.reset()}reset(){const e=this;return e.S=e.k.slice(0),e.C=[],e.A=0,e}update(e){const t=this;\"string\"==typeof e&&(e=I._.m(e));const n=t.C=_.concat(t.C,e),r=t.A,i=t.A=r+_.l(e);if(i>9007199254740991)throw new s(\"Cannot hash more than 2^53 - 1 bits\");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.I(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}P(){const e=this;let t=e.C;const n=e.S;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e.A/4294967296)),t.push(0|e.A);t.length;)e.I(t.splice(0,16));return e.reset(),n}D(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}V(e,t){return t<<e|t>>>32-e}I(t){const n=this,s=n.S,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.V(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.V(5,o)+n.D(e,c,f,a)+l+i[e]+n.v[r.floor(e/20)]|0;l=a,a=f,f=n.V(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;i<e.length;i+=4){const e=n(4294967296*(s||r.random()));s=987654071*e(),t[i/4]=4294967296*e()|0}return e}},V={importKey:e=>new V.R(I.bytes.m(e)),B(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s(\"invalid params to pbkdf2\");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.bytes.m(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;a<c.length;a++)o[a]^=c[a];for(f=0;(i||1)>d&&f<o.length;f++)h.setInt32(d,o[f]),d+=4}return w.slice(0,r/8)},R:class{constructor(e){const t=this,n=t.M=P,r=[[],[]];t.U=[new n,new n];const s=t.U[0].blockSize/32;e.length>s&&(e=(new n).update(e).P());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.U[0].update(r[0]),t.U[1].update(r[1]),t.K=new n(t.U[0])}reset(){const e=this;e.K=new e.M(e.U[0]),e.N=!1}update(e){this.N=!0,this.K.update(e)}digest(){const e=this,t=e.K.P(),n=new e.M(e.U[1]).update(t).P();return e.reset(),n}encrypt(e){if(this.N)throw new s(\"encrypt on already updated hmac called!\");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B=\"Invalid password\",E=\"Invalid signature\",M=\"zipjs-abort-check-password\";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:\"PBKDF2\"},O=t.assign({hash:{name:\"HMAC\"}},N),T=t.assign({iterations:1e3,hash:{name:\"SHA-1\"}},N),W=[\"deriveBits\"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.bytes,X=class{constructor(e){const t=this;t.O=[[[],[],[],[],[]],[[],[],[],[],[]]],t.O[0][0][0]||t.T();const n=t.O[0][4],r=t.O[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s(\"invalid aes key size\");for(t.v=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.W(e,0)}decrypt(e){return this.W(e,1)}T(){const e=this.O[0],t=this.O[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}W(e,t){if(4!==e.length)throw new s(\"invalid aes block size\");const n=this.v[t],r=n.length/4-2,i=[0,0,0,0],o=this.O[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.j=e,this.H=t,this.L=t}reset(){this.L=this.H}update(e){return this.F(this.j,e,this.L)}q(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}G(e){0===(e[0]=this.q(e[0]))&&(e[1]=this.q(e[1]))}F(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.G(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.R;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:ie(e,n),signed:r,X:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:o,J:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Y:n,Z:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:ie(e,n),X:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:s,J:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Y:t,Z:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Y:c,Z:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey(\"raw\",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.B(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.B(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,$:u,passwordVerification:w},Y:new Y(new X(l),e.from(F)),Z:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new w).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ce(e,t,n){return e.subarray(t,n)}function fe(e,t){return e.p(t)}function ae(e,t){return e.m(t)}class le extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=we(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(B);e=e.subarray(12)}r?t.error(new s(M)):t.enqueue(we(n,e))}})}}class ue extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=U(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(he(n,t),0),s=12}else r=new i(e.length),s=0;r.set(he(n,e),s),t.enqueue(r)}})}}function we(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,n[r]);return n}function he(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,t[r]);return n}function de(e,n){const r=[305419896,591751049,878082192];t.assign(e,{keys:r,ee:new x(r[0]),te:new x(r[2])});for(let t=0;t<n.length;t++)pe(e,n.charCodeAt(t))}function pe(e,t){let[n,s,i]=e.keys;e.ee.append([t]),n=~e.ee.get(),s=be(r.imul(be(s+me(n)),134775813)+1),e.te.append([s>>>24]),i=~e.te.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge=\"deflate-raw\";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,\"readable\",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae=\"data\",_e=\"close\";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith(\"deflate\")?i=ke:s.startsWith(\"inflate\")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,\"readable\",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:\"pull\",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s(\"Unknown error\")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener(\"message\",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if(\"start\"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if(\"ack\"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=-2;function Te(t){return We(t.map((([t,n])=>new e(t).fill(n,0,t))))}function We(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?We(n):n)),[])}const je=[0,1,2,3].concat(...Te([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function He(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.ne=n=>{const s=e.re,i=e.ie.se,o=e.ie.oe;let c,f,a,l=-1;for(n.ce=0,n.fe=573,c=0;o>c;c++)0!==s[2*c]?(n.ae[++n.ce]=l=c,n.le[c]=0):s[2*c+1]=0;for(;2>n.ce;)a=n.ae[++n.ce]=2>l?++l:0,s[2*a]=1,n.le[a]=0,n.ue--,i&&(n.we-=i[2*a+1]);for(e.he=l,c=r.floor(n.ce/2);c>=1;c--)n.de(s,c);a=o;do{c=n.ae[1],n.ae[1]=n.ae[n.ce--],n.de(s,1),f=n.ae[1],n.ae[--n.fe]=c,n.ae[--n.fe]=f,s[2*a]=s[2*c]+s[2*f],n.le[a]=r.max(n.le[c],n.le[f])+1,s[2*c+1]=s[2*f+1]=a,n.ae[1]=a++,n.de(s,1)}while(n.ce>=2);n.ae[--n.fe]=n.ae[1],(t=>{const n=e.re,r=e.ie.se,s=e.ie.pe,i=e.ie.ye,o=e.ie.me;let c,f,a,l,u,w,h=0;for(l=0;15>=l;l++)t.be[l]=0;for(n[2*t.ae[t.fe]+1]=0,c=t.fe+1;573>c;c++)f=t.ae[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.he||(t.be[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.ue+=w*(l+u),r&&(t.we+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.be[l];)l--;t.be[l]--,t.be[l+1]+=2,t.be[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.be[l];0!==f;)a=t.ae[--c],a>e.he||(n[2*a+1]!=l&&(t.ue+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;15>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.he,n.be)}}function Le(e,t,n,r,s){const i=this;i.se=e,i.pe=t,i.ye=n,i.oe=r,i.me=s}He.ge=[0,1,2,3,4,5,6,7].concat(...Te([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),He.ke=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],He.ve=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],He.Se=e=>256>e?je[e]:je[256+(e>>>7)],He.ze=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],He.Ce=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],He.xe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],He.Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Fe=Te([[144,8],[112,9],[24,7],[8,8]]);Le._e=We([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Fe[t]])));const qe=Te([[30,5]]);function Ge(e,t,n,r,s){const i=this;i.Ie=e,i.Pe=t,i.De=n,i.Ve=r,i.Re=s}Le.Be=We([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,qe[t]]))),Le.Ee=new Le(Le._e,He.ze,257,286,15),Le.Me=new Le(Le.Be,He.Ce,0,30,15),Le.Ue=new Le(null,He.xe,0,19,7);const Je=[new Ge(0,0,0,0,0),new Ge(4,4,8,4,1),new Ge(4,5,16,8,1),new Ge(4,6,32,32,1),new Ge(4,4,16,16,2),new Ge(8,16,32,32,2),new Ge(8,16,128,128,2),new Ge(8,32,128,256,2),new Ge(32,128,258,1024,2),new Ge(32,258,258,4096,2)],Qe=[\"need dictionary\",\"stream end\",\"\",\"\",\"stream error\",\"data error\",\"\",\"buffer error\",\"\",\"\"],Xe=113,Ye=666,Ze=262;function $e(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function et(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new He,N=new He,O=new He;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.ue=e.we=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++i<o&&n==s||(c>i?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ke[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<<F&65535,Q(L),L=n>>>16-F,F+=r-16):(L|=e<<F&65535,F+=r)}function Y(e,t){const n=2*e;X(65535&t[n],65535&t[n+1])}function Z(e,t){let n,r,s=-1,i=e[1],o=0,c=7,f=4;for(0===i&&(c=138,f=3),n=0;t>=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Ne[W]=t,e.Oe[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(He.ge[n]+256+1)]++,M[2*He.Se(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+He.Ce[o]);if(s>>>=3,j<r.floor(W/2)&&s<r.floor(i/2))return!0}return W==T-1}function te(t,n){let r,s,i,o,c=0;if(0!==W)do{r=e.Ne[c],s=e.Oe[c],c++,0===r?Y(s,t):(i=He.ge[s],Y(i+256+1,t),o=He.ze[i],0!==o&&(s-=He.ke[i],X(s,o)),r--,i=He.Se(r),Y(i,n),o=He.Ce[i],0!==o&&(r-=He.ve[i],X(r,o)))}while(W>c);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ke.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.ne(e),N.ne(e),o=(()=>{let t;for(G(E,K.he),G(M,N.he),O.ne(e),t=18;t>=3&&0===U[2*He.Ae[t]+1];t--);return e.ue+=14+3*(t+1),t})(),s=e.ue+3+7>>>3,i=e.we+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(Le._e,Le.Be)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*He.Ae[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.he+1,N.he+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.Te()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-Ze){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.We)return;e=t.je(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<<g^255&u[C+1])&b)}while(Ze>A&&0!==t.We)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-Ze?C-(f-Ze):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.le=[],e.be=[],e.ae=[],E=[],M=[],U=[],e.de=(t,n)=>{const r=e.ae,s=r[n];let i=n<<1;for(;i<=e.ce&&(i<e.ce&&$e(t,r[i+1],r[i],e.le)&&i++,!$e(t,s,r[i],e.le));)r[n]=r[i],n=i,i<<=1;r[n]=s},e.He=(t,S,x,W,j,G)=>(W||(W=8),j||(j=8),G||(G=0),t.Le=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?Oe:(t.Fe=e,a=x,f=1<<a,l=f-1,m=j+7,y=1<<m,b=y-1,g=r.floor((m+3-1)/3),u=new i(2*f),h=[],d=[],T=1<<j+6,e.Ke=new i(4*T),s=4*T,e.Ne=new o(T),e.Oe=new i(T),D=S,V=G,(t=>(t.qe=t.Ge=0,t.Le=null,e.pending=0,e.Je=0,n=Xe,c=0,K.re=E,K.ie=Le.Ee,N.re=M,N.ie=Le.Me,O.re=U,O.ie=Le.Ue,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Je[D].Pe,R=Je[D].Ie,B=Je[D].De,I=Je[D].Ve,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Qe=()=>42!=n&&n!=Xe&&n!=Ye?Oe:(e.Oe=null,e.Ne=null,e.Ke=null,d=null,h=null,u=null,e.Fe=null,n==Xe?-3:0),e.Xe=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?Oe:(Je[D].Re!=Je[t].Re&&0!==e.qe&&(r=e.Ye(1)),D!=t&&(D=t,P=Je[D].Pe,R=Je[D].Ie,B=Je[D].De,I=Je[D].Ve),V=n,r)},e.Ze=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return Oe;if(3>i)return 0;for(i>f-Ze&&(i=f-Ze,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<<g^255&u[1])&b,s=0;i-3>=s;s++)p=(p<<g^255&u[s+2])&b,h[s&l]=d[p],d[p]=s;return 0},e.Ye=(r,i)=>{let o,w,m,I,R;if(i>4||0>i)return Oe;if(!r.$e||!r.et&&0!==r.We||n==Ye&&4!=i)return r.Le=Qe[4],Oe;if(0===r.tt)return r.Le=Qe[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Xe,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.Te(),0===t.tt)return c=-1,0}else if(0===t.We&&I>=i&&4!=i)return t.Le=Qe[7],-5;if(n==Ye&&0!==t.We)return r.Le=Qe[7],-5;if(0!==t.We||0!==A||0!=i&&n!=Ye){switch(R=-1,Je[D].Re){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.tt))return 0;if(C-k>=f-Ze&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C),0===r||(C-r&65535)>f-Ze||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<<g^255&u[C+1])&b;else{v--;do{C++,p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C}while(0!=--v);C++}if(n&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 2:R=(e=>{let n,r,s=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C),_=v,S=x,v=2,0!==s&&P>_&&f-Ze>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.tt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C)}while(0!=--_);if(z=0,v=2,C++,n&&(se(!1),0===t.tt))return 0}}return 0!==z&&(n=ee(0,255&u[C-1]),z=0),se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i)}if(2!=R&&3!=R||(n=Ye),0==R||2==R)return 0===t.tt&&(c=-1),0;if(1==R){if(1==i)X(2,3),Y(256,Le._e),$(),9>1+H+10-F&&(X(2,3),Y(256,Le._e),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.Te(),0===t.tt)return c=-1,0}}return 4!=i?0:1}}function tt(){const e=this;e.nt=0,e.rt=0,e.We=0,e.qe=0,e.tt=0,e.Ge=0}function nt(e){const t=new tt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.He(f),t.$e=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,o=t.Ye(0),0!=o)throw new s(\"deflating: \"+t.Le);t.rt&&(t.rt==n?w.push(new i(c)):w.push(c.subarray(0,t.rt))),u+=t.rt,r&&t.nt>0&&t.nt!=a&&(r(t.nt),a=t.nt)}while(t.We>0||0===t.tt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.rt=0,t.tt=n,e=t.Ye(4),1!=e&&0!=e)throw new s(\"deflating: \"+t.Le);n-t.tt>0&&a.push(c.slice(0,t.rt)),f+=t.rt}while(t.We>0||0===t.tt);return t.Qe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}tt.prototype={He(e,t){const n=this;return n.Fe=new et,t||(t=15),n.Fe.He(n,e,t)},Ye(e){const t=this;return t.Fe?t.Fe.Ye(t,e):Oe},Qe(){const e=this;if(!e.Fe)return Oe;const t=e.Fe.Qe();return e.Fe=null,t},Xe(e,t){const n=this;return n.Fe?n.Fe.Xe(n,e,t):Oe},Ze(e,t){const n=this;return n.Fe?n.Fe.Ze(n,e,t):Oe},je(e,t,n){const r=this;let s=r.We;return s>n&&(s=n),0===s?0:(r.We-=s,e.set(r.et.subarray(r.nt,r.nt+s),t),r.nt+=s,r.qe+=s,s)},Te(){const e=this;let t=e.Fe.pending;t>e.tt&&(t=e.tt),0!==t&&(e.$e.set(e.Fe.Ke.subarray(e.Fe.Je,e.Fe.Je+t),e.rt),e.rt+=t,e.Fe.Je+=t,e.Ge+=t,e.tt-=t,e.Fe.pending-=t,0===e.Fe.pending&&(e.Fe.Je=0))}};const rt=-2,st=-3,it=-5,ot=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ct=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ft=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],at=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],ut=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],wt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ht(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,0;for(S=u[0],k=1;15>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=15;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<<k;g>k;k++,I<<=1)if(0>(I-=n[k]))return st;if(0>(I-=n[g]))return st;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g<o);for(o=i[m],i[0]=g=0,C=0,b=-1,A=-S,s[0]=0,x=0,P=0;m>=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++k<P&&(y<<=1)>n[++_];)y-=n[_];if(P=1<<k,h[0]+P>1440)return st;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]<c?(r[0]=256>d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<<v-A,k=g>>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<<v-1;g&k;k>>>=1)g^=k;for(g^=k,z=(1<<A)-1;(g&z)!=i[b];)b--,A-=S,z=(1<<A)-1}return 0!==I&&1!=m?it:0}function c(o){let c;for(e||(e=[],t=[],n=new f(16),r=[],s=new f(15),i=new f(16)),t.length<o&&(t=[]),c=0;o>c;c++)t[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,15),0),i.set(n.subarray(0,16),0)}this.st=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==st?f.Le=\"oversubscribed dynamic bit lengths tree\":a!=it&&0!==r[0]||(f.Le=\"incomplete dynamic bit lengths tree\",a=st),a},this.it=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,at,lt,a,i,u,e,t),0!=h||0===i[0]?(h==st?w.Le=\"oversubscribed literal/length tree\":-4!=h&&(w.Le=\"incomplete literal/length tree\",h=st),h):(c(288),h=o(s,n,r,0,ut,wt,l,f,u,e,t),0!=h||0===f[0]&&n>257?(h==st?w.Le=\"oversubscribed distance tree\":h==it?(w.Le=\"incomplete distance tree\",h=st):-4!=h&&(w.Le=\"empty distance tree with lengths\",h=st),h):0)}}function dt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.nt,p=c.We,w=o.ot,h=o.ct,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=ot[e],g=ot[t];do{for(;20>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;if(f=w&b,a=n,l=r,z=3*(l+f),0!==(u=a[z]))for(;;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ot[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;for(f=w&g,a=s,l=i,z=3*(l+f),u=a[z];;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;if(v=a[z+2]+(w&ot[u]),w>>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--u);else o.lt.set(o.lt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.lt[y++]=o.lt[S++],o.lt[y++]=o.lt[S++],k-=2):(o.lt.set(o.lt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--k);else o.lt.set(o.lt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Le=\"invalid distance code\",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,st;f+=a[z+2],f+=w&ot[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,1):(c.Le=\"invalid literal/length code\",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,st);if(f+=a[z+2],f+=w&ot[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,0}e.init=(e,i,o,c,f,a)=>{t=0,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ut=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.nt,v=y.We,x=e.ot,A=e.ct,S=e.write,z=S<e.read?e.read-S-1:e.end-S;;)switch(t){case 0:if(z>=258&&v>=10&&(e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.nt,v=y.We,x=e.ot,A=e.ct,S=e.write,z=S<e.read?e.read-S-1:e.end-S,0!=m)){t=1==m?7:9;break}c=u,n=r,o=h,t=1;case 1:for(b=c;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=6;break}if(16&k){a=15&k,i=n[g+2],t=2;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=7;break}return t=9,y.Le=\"invalid literal/length code\",m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 2:for(b=a;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}i+=x&ot[b],x>>=b,A-=b,c=w,n=s,o=d,t=3;case 3:for(b=c;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=4;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=9,y.Le=\"invalid distance code\",m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 4:for(b=a;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}l+=x&ot[b],x>>=b,A-=b,t=5;case 5:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);e.lt[S++]=e.lt[C++],z--,C==e.end&&(C=0),i--}t=0;break;case 6:if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,e.lt[S++]=f,z--,t=0;break;case 7:if(A>7&&(A-=8,v++,_--),e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,e.read!=e.write)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);t=8;case 8:return m=1,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 9:return m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);default:return m=rt,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m)}},e.ht=()=>{}}ht.dt=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ct,r[0]=ft,0);const pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function yt(e,t){const n=this;let r,s=0,o=0,c=0,a=0;const l=[0],u=[0],w=new dt;let h=0,d=new f(4320);const p=new ht;n.ct=0,n.ot=0,n.lt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==s&&w.ht(e),s=0,n.ct=0,n.ot=0,n.read=n.write=0},n.reset(e,null),n.wt=(e,t)=>{let r,s,i;return s=e.rt,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.tt&&(r=e.tt),0!==r&&t==it&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.tt&&(r=e.tt),0!==r&&t==it&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r),e.rt=s,n.read=i,t},n.ut=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g<n.read?n.read-g-1:n.end-g;;){let S,z,C,x,A,_,I,P;switch(s){case 0:for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}switch(i=7&f,h=1&i,i>>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=1;break;case 1:S=[],z=[],C=[[]],x=[[]],ht.dt(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=6;break;case 2:f>>>=3,y-=3,s=3;break;case 3:return f>>>=3,y-=3,s=9,e.Le=\"invalid block type\",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}break;case 1:for(;32>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if((~f>>>16&65535)!=(65535&f))return s=9,e.Le=\"invalid stored block lengths\",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);o=65535&f,f=y=0,s=0!==o?2:0!==h?7:0;break;case 2:if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k&&(n.write=g,t=n.wt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k)))return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(t=0,i=o,i>b&&(i=b),i>k&&(i=k),n.lt.set(e.je(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?7:0;break;case 3:for(;14>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(c=i=16383&f,(31&i)>29||(i>>5&31)>29)return s=9,e.Le=\"too many length or distance symbols\",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.length<i)r=[];else for(v=0;i>v;v++)r[v]=0;f>>>=14,y-=14,a=0,s=4;case 4:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}r[pt[a++]]=7&f,f>>>=3,y-=3}for(;19>a;)r[pt[a++]]=0;if(l[0]=7,i=p.st(r,l,u,d,e),0!=i)return(t=i)==st&&(r=null,s=9),n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);a=0,s=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(i=d[3*(u[0]+(f&ot[i]))+1],w=d[3*(u[0]+(f&ot[i]))+2],16>w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(f>>>=i,y-=i,o+=f&ot[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=9,e.Le=\"invalid bit length repeat\",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.it(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),0!=i)return i==st&&(r=null,s=9),t=i,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=6;case 6:if(n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,1!=(t=w.ut(n,e,t)))return n.wt(e,t);if(t=0,w.ht(e),m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g<n.read?n.read-g-1:n.end-g,0===h){s=0;break}s=7;case 7:if(n.write=g,t=n.wt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,n.read!=n.write)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);s=8;case 8:return t=1,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);case 9:return t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);default:return t=rt,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}}},n.ht=e=>{n.reset(e,null),n.lt=null,d=null},n.yt=(e,t,r)=>{n.lt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.bt=()=>1==s?1:0}const mt=13,bt=[0,0,255,255];function gt(){const e=this;function t(e){return e&&e.gt?(e.qe=e.Ge=0,e.Le=null,e.gt.mode=7,e.gt.kt.reset(e,null),0):rt}e.mode=0,e.method=0,e.vt=[0],e.St=0,e.marker=0,e.zt=0,e.Ct=t=>(e.kt&&e.kt.ht(t),e.kt=null,0),e.xt=(n,r)=>(n.Le=null,e.kt=null,8>r||r>15?(e.Ct(n),rt):(e.zt=r,n.gt.kt=new yt(n,1<<r),t(n),0)),e.At=(e,t)=>{let n,r;if(!e||!e.gt||!e.et)return rt;const s=e.gt;for(t=4==t?it:0,n=it;;)switch(s.mode){case 0:if(0===e.We)return n;if(n=t,e.We--,e.qe++,8!=(15&(s.method=e.ft(e.nt++)))){s.mode=mt,e.Le=\"unknown compression method\",s.marker=5;break}if(8+(s.method>>4)>s.zt){s.mode=mt,e.Le=\"invalid win size\",s.marker=5;break}s.mode=1;case 1:if(0===e.We)return n;if(n=t,e.We--,e.qe++,r=255&e.ft(e.nt++),((s.method<<8)+r)%31!=0){s.mode=mt,e.Le=\"incorrect header check\",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St=(255&e.ft(e.nt++))<<24&4278190080,s.mode=3;case 3:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<16&16711680,s.mode=4;case 4:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<8&65280,s.mode=5;case 5:return 0===e.We?n:(n=t,e.We--,e.qe++,s.St+=255&e.ft(e.nt++),s.mode=6,2);case 6:return s.mode=mt,e.Le=\"need dictionary\",s.marker=0,rt;case 7:if(n=s.kt.ut(e,n),n==st){s.mode=mt,s.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,s.kt.reset(e,s.vt),s.mode=12;case 12:return e.We=0,1;case mt:return st;default:return rt}},e._t=(e,t,n)=>{let r=0,s=n;if(!e||!e.gt||6!=e.gt.mode)return rt;const i=e.gt;return s<1<<i.zt||(s=(1<<i.zt)-1,r=n-s),i.kt.yt(t,r,s),i.mode=7,0},e.It=e=>{let n,r,s,i,o;if(!e||!e.gt)return rt;const c=e.gt;if(c.mode!=mt&&(c.mode=mt,c.marker=0),0===(n=e.We))return it;for(r=e.nt,s=c.marker;0!==n&&4>s;)e.ft(r)==bt[s]?s++:s=0!==e.ft(r)?0:4-s,r++,n--;return e.qe+=r-e.nt,e.nt=r,e.We=n,c.marker=s,4!=s?st:(i=e.qe,o=e.Ge,t(e),e.qe=i,e.Ge=o,c.mode=7,0)},e.Pt=e=>e&&e.gt&&e.gt.kt?e.gt.kt.bt():rt}function kt(){}function vt(e){const t=new kt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.xt(),t.$e=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,0!==t.We||c||(t.nt=0,c=!0),a=t.At(0),c&&a===it){if(0!==t.We)throw new s(\"inflating: bad input\")}else if(0!==a&&1!==a)throw new s(\"inflating: \"+t.Le);if((c||1===a)&&t.We===e.length)throw new s(\"inflating: bad input\");t.rt&&(t.rt===n?f.push(new i(o)):f.push(o.subarray(0,t.rt))),h+=t.rt,r&&t.nt>0&&t.nt!=u&&(r(t.nt),u=t.nt)}while(t.We>0||0===t.tt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.Ct()}}kt.prototype={xt(e){const t=this;return t.gt=new gt,e||(e=15),t.gt.xt(t,e)},At(e){const t=this;return t.gt?t.gt.At(t,e):rt},Ct(){const e=this;if(!e.gt)return rt;const t=e.gt.Ct(e);return e.gt=null,t},It(){const e=this;return e.gt?e.gt.It(e):rt},_t(e,t){const n=this;return n.gt?n.gt._t(n,e,t):rt},ft(e){return this.et[e]},je(e,t){return this.et.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=nt,self.Inflate=vt};\\n',r=()=>t.useDataURI?\"data:text/javascript,\"+encodeURIComponent(n):URL.createObjectURL(new Blob([n],{type:\"text/javascript\"}));e({workerScripts:{inflate:[r],deflate:[r]}})}export{e as configureWebWorker};\n","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global Blob, atob, btoa, XMLHttpRequest, URL, fetch, ReadableStream, WritableStream, FileReader, TransformStream, Response */\n// deno-lint-ignore-file no-this-alias\n\nimport {\n\tUNDEFINED_VALUE,\n\tFUNCTION_TYPE,\n\tEND_OF_CENTRAL_DIR_LENGTH\n} from \"./constants.js\";\nimport { getConfiguration } from \"./configuration.js\";\n\nconst ERR_HTTP_STATUS = \"HTTP error \";\nconst ERR_HTTP_RANGE = \"HTTP Range not supported\";\nconst ERR_ITERATOR_COMPLETED_TOO_SOON = \"Writer iterator completed too soon\";\n\nconst CONTENT_TYPE_TEXT_PLAIN = \"text/plain\";\nconst HTTP_HEADER_CONTENT_LENGTH = \"Content-Length\";\nconst HTTP_HEADER_CONTENT_RANGE = \"Content-Range\";\nconst HTTP_HEADER_ACCEPT_RANGES = \"Accept-Ranges\";\nconst HTTP_HEADER_RANGE = \"Range\";\nconst HTTP_HEADER_CONTENT_TYPE = \"Content-Type\";\nconst HTTP_METHOD_HEAD = \"HEAD\";\nconst HTTP_METHOD_GET = \"GET\";\nconst HTTP_RANGE_UNIT = \"bytes\";\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst PROPERTY_NAME_WRITABLE = \"writable\";\n\nclass Stream {\n\n\tconstructor() {\n\t\tthis.size = 0;\n\t}\n\n\tinit() {\n\t\tthis.initialized = true;\n\t}\n}\n\nclass Reader extends Stream {\n\n\tget readable() {\n\t\tconst reader = this;\n\t\tconst { chunkSize = DEFAULT_CHUNK_SIZE } = reader;\n\t\tconst readable = new ReadableStream({\n\t\t\tstart() {\n\t\t\t\tthis.chunkOffset = 0;\n\t\t\t},\n\t\t\tasync pull(controller) {\n\t\t\t\tconst { offset = 0, size, diskNumberStart } = readable;\n\t\t\t\tconst { chunkOffset } = this;\n\t\t\t\tcontroller.enqueue(await readUint8Array(reader, offset + chunkOffset, Math.min(chunkSize, size - chunkOffset), diskNumberStart));\n\t\t\t\tif (chunkOffset + chunkSize > size) {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t} else {\n\t\t\t\t\tthis.chunkOffset += chunkSize;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn readable;\n\t}\n}\n\nclass Writer extends Stream {\n\n\tconstructor() {\n\t\tsuper();\n\t\tconst writer = this;\n\t\tconst writable = new WritableStream({\n\t\t\twrite(chunk) {\n\t\t\t\treturn writer.writeUint8Array(chunk);\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(writer, PROPERTY_NAME_WRITABLE, {\n\t\t\tget() {\n\t\t\t\treturn writable;\n\t\t\t}\n\t\t});\n\t}\n\n\twriteUint8Array() {\n\t\t// abstract\n\t}\n}\n\nclass Data64URIReader extends Reader {\n\n\tconstructor(dataURI) {\n\t\tsuper();\n\t\tlet dataEnd = dataURI.length;\n\t\twhile (dataURI.charAt(dataEnd - 1) == \"=\") {\n\t\t\tdataEnd--;\n\t\t}\n\t\tconst dataStart = dataURI.indexOf(\",\") + 1;\n\t\tObject.assign(this, {\n\t\t\tdataURI,\n\t\t\tdataStart,\n\t\t\tsize: Math.floor((dataEnd - dataStart) * 0.75)\n\t\t});\n\t}\n\n\treadUint8Array(offset, length) {\n\t\tconst {\n\t\t\tdataStart,\n\t\t\tdataURI\n\t\t} = this;\n\t\tconst dataArray = new Uint8Array(length);\n\t\tconst start = Math.floor(offset / 3) * 4;\n\t\tconst bytes = atob(dataURI.substring(start + dataStart, Math.ceil((offset + length) / 3) * 4 + dataStart));\n\t\tconst delta = offset - Math.floor(start / 4) * 3;\n\t\tfor (let indexByte = delta; indexByte < delta + length; indexByte++) {\n\t\t\tdataArray[indexByte - delta] = bytes.charCodeAt(indexByte);\n\t\t}\n\t\treturn dataArray;\n\t}\n}\n\nclass Data64URIWriter extends Writer {\n\n\tconstructor(contentType) {\n\t\tsuper();\n\t\tObject.assign(this, {\n\t\t\tdata: \"data:\" + (contentType || \"\") + \";base64,\",\n\t\t\tpending: []\n\t\t});\n\t}\n\n\twriteUint8Array(array) {\n\t\tconst writer = this;\n\t\tlet indexArray = 0;\n\t\tlet dataString = writer.pending;\n\t\tconst delta = writer.pending.length;\n\t\twriter.pending = \"\";\n\t\tfor (indexArray = 0; indexArray < (Math.floor((delta + array.length) / 3) * 3) - delta; indexArray++) {\n\t\t\tdataString += String.fromCharCode(array[indexArray]);\n\t\t}\n\t\tfor (; indexArray < array.length; indexArray++) {\n\t\t\twriter.pending += String.fromCharCode(array[indexArray]);\n\t\t}\n\t\tif (dataString.length > 2) {\n\t\t\twriter.data += btoa(dataString);\n\t\t} else {\n\t\t\twriter.pending = dataString;\n\t\t}\n\t}\n\n\tgetData() {\n\t\treturn this.data + btoa(this.pending);\n\t}\n}\n\nclass BlobReader extends Reader {\n\n\tconstructor(blob) {\n\t\tsuper();\n\t\tObject.assign(this, {\n\t\t\tblob,\n\t\t\tsize: blob.size\n\t\t});\n\t}\n\n\tasync readUint8Array(offset, length) {\n\t\tconst reader = this;\n\t\tconst offsetEnd = offset + length;\n\t\tconst blob = offset || offsetEnd < reader.size ? reader.blob.slice(offset, offsetEnd) : reader.blob;\n\t\tlet arrayBuffer = await blob.arrayBuffer();\n\t\tif (arrayBuffer.byteLength > length) {\n\t\t\tarrayBuffer = arrayBuffer.slice(offset, offsetEnd);\n\t\t}\n\t\treturn new Uint8Array(arrayBuffer);\n\t}\n}\n\nclass BlobWriter extends Stream {\n\n\tconstructor(contentType) {\n\t\tsuper();\n\t\tconst writer = this;\n\t\tconst transformStream = new TransformStream();\n\t\tconst headers = [];\n\t\tif (contentType) {\n\t\t\theaders.push([HTTP_HEADER_CONTENT_TYPE, contentType]);\n\t\t}\n\t\tObject.defineProperty(writer, PROPERTY_NAME_WRITABLE, {\n\t\t\tget() {\n\t\t\t\treturn transformStream.writable;\n\t\t\t}\n\t\t});\n\t\twriter.blob = new Response(transformStream.readable, { headers }).blob();\n\t}\n\n\tgetData() {\n\t\treturn this.blob;\n\t}\n}\n\nclass TextReader extends BlobReader {\n\n\tconstructor(text) {\n\t\tsuper(new Blob([text], { type: CONTENT_TYPE_TEXT_PLAIN }));\n\t}\n}\n\nclass TextWriter extends BlobWriter {\n\n\tconstructor(encoding) {\n\t\tsuper(encoding);\n\t\tObject.assign(this, {\n\t\t\tencoding,\n\t\t\tutf8: !encoding || encoding.toLowerCase() == \"utf-8\"\n\t\t});\n\t}\n\n\tasync getData() {\n\t\tconst {\n\t\t\tencoding,\n\t\t\tutf8\n\t\t} = this;\n\t\tconst blob = await super.getData();\n\t\tif (blob.text && utf8) {\n\t\t\treturn blob.text();\n\t\t} else {\n\t\t\tconst reader = new FileReader();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tObject.assign(reader, {\n\t\t\t\t\tonload: ({ target }) => resolve(target.result),\n\t\t\t\t\tonerror: () => reject(reader.error)\n\t\t\t\t});\n\t\t\t\treader.readAsText(blob, encoding);\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass FetchReader extends Reader {\n\n\tconstructor(url, options) {\n\t\tsuper();\n\t\tcreateHttpReader(this, url, options);\n\t}\n\n\tasync init() {\n\t\tawait initHttpReader(this, sendFetchRequest, getFetchRequestData);\n\t\tsuper.init();\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn readUint8ArrayHttpReader(this, index, length, sendFetchRequest, getFetchRequestData);\n\t}\n}\n\nclass XHRReader extends Reader {\n\n\tconstructor(url, options) {\n\t\tsuper();\n\t\tcreateHttpReader(this, url, options);\n\t}\n\n\tasync init() {\n\t\tawait initHttpReader(this, sendXMLHttpRequest, getXMLHttpRequestData);\n\t\tsuper.init();\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn readUint8ArrayHttpReader(this, index, length, sendXMLHttpRequest, getXMLHttpRequestData);\n\t}\n}\n\nfunction createHttpReader(httpReader, url, options) {\n\tconst {\n\t\tpreventHeadRequest,\n\t\tuseRangeHeader,\n\t\tforceRangeRequests,\n\t\tcombineSizeEocd\n\t} = options;\n\toptions = Object.assign({}, options);\n\tdelete options.preventHeadRequest;\n\tdelete options.useRangeHeader;\n\tdelete options.forceRangeRequests;\n\tdelete options.combineSizeEocd;\n\tdelete options.useXHR;\n\tObject.assign(httpReader, {\n\t\turl,\n\t\toptions,\n\t\tpreventHeadRequest,\n\t\tuseRangeHeader,\n\t\tforceRangeRequests,\n\t\tcombineSizeEocd\n\t});\n}\n\nasync function initHttpReader(httpReader, sendRequest, getRequestData) {\n\tconst {\n\t\turl,\n\t\tpreventHeadRequest,\n\t\tuseRangeHeader,\n\t\tforceRangeRequests,\n\t\tcombineSizeEocd\n\t} = httpReader;\n\tif (isHttpFamily(url) && (useRangeHeader || forceRangeRequests) && (typeof preventHeadRequest == \"undefined\" || preventHeadRequest)) {\n\t\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, combineSizeEocd ? -END_OF_CENTRAL_DIR_LENGTH : undefined));\n\t\tif (!forceRangeRequests && response.headers.get(HTTP_HEADER_ACCEPT_RANGES) != HTTP_RANGE_UNIT) {\n\t\t\tthrow new Error(ERR_HTTP_RANGE);\n\t\t} else {\n\t\t\tif (combineSizeEocd) {\n\t\t\t\thttpReader.eocdCache = new Uint8Array(await response.arrayBuffer());\n\t\t\t}\n\t\t\tlet contentSize;\n\t\t\tconst contentRangeHeader = response.headers.get(HTTP_HEADER_CONTENT_RANGE);\n\t\t\tif (contentRangeHeader) {\n\t\t\t\tconst splitHeader = contentRangeHeader.trim().split(/\\s*\\/\\s*/);\n\t\t\t\tif (splitHeader.length) {\n\t\t\t\t\tconst headerValue = splitHeader[1];\n\t\t\t\t\tif (headerValue && headerValue != \"*\") {\n\t\t\t\t\t\tcontentSize = Number(headerValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (contentSize === UNDEFINED_VALUE) {\n\t\t\t\tawait getContentLength(httpReader, sendRequest, getRequestData);\n\t\t\t} else {\n\t\t\t\thttpReader.size = contentSize;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tawait getContentLength(httpReader, sendRequest, getRequestData);\n\t}\n}\n\nasync function readUint8ArrayHttpReader(httpReader, index, length, sendRequest, getRequestData) {\n\tconst {\n\t\tuseRangeHeader,\n\t\tforceRangeRequests,\n\t\teocdCache,\n\t\tsize,\n\t\toptions\n\t} = httpReader;\n\tif (useRangeHeader || forceRangeRequests) {\n\t\tif (eocdCache && index == size - END_OF_CENTRAL_DIR_LENGTH && length == END_OF_CENTRAL_DIR_LENGTH) {\n\t\t\treturn eocdCache;\n\t\t}\n\t\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, index, length));\n\t\tif (response.status != 206) {\n\t\t\tthrow new Error(ERR_HTTP_RANGE);\n\t\t}\n\t\treturn new Uint8Array(await response.arrayBuffer());\n\t} else {\n\t\tconst { data } = httpReader;\n\t\tif (!data) {\n\t\t\tawait getRequestData(httpReader, options);\n\t\t}\n\t\treturn new Uint8Array(httpReader.data.subarray(index, index + length));\n\t}\n}\n\nfunction getRangeHeaders(httpReader, index = 0, length = 1) {\n\treturn Object.assign({}, getHeaders(httpReader), { [HTTP_HEADER_RANGE]: HTTP_RANGE_UNIT + \"=\" + (index < 0 ? index : index + \"-\" + (index + length - 1)) });\n}\n\nfunction getHeaders({ options }) {\n\tconst { headers } = options;\n\tif (headers) {\n\t\tif (Symbol.iterator in headers) {\n\t\t\treturn Object.fromEntries(headers);\n\t\t} else {\n\t\t\treturn headers;\n\t\t}\n\t}\n}\n\nasync function getFetchRequestData(httpReader) {\n\tawait getRequestData(httpReader, sendFetchRequest);\n}\n\nasync function getXMLHttpRequestData(httpReader) {\n\tawait getRequestData(httpReader, sendXMLHttpRequest);\n}\n\nasync function getRequestData(httpReader, sendRequest) {\n\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getHeaders(httpReader));\n\thttpReader.data = new Uint8Array(await response.arrayBuffer());\n\tif (!httpReader.size) {\n\t\thttpReader.size = httpReader.data.length;\n\t}\n}\n\nasync function getContentLength(httpReader, sendRequest, getRequestData) {\n\tif (httpReader.preventHeadRequest) {\n\t\tawait getRequestData(httpReader, httpReader.options);\n\t} else {\n\t\tconst response = await sendRequest(HTTP_METHOD_HEAD, httpReader, getHeaders(httpReader));\n\t\tconst contentLength = response.headers.get(HTTP_HEADER_CONTENT_LENGTH);\n\t\tif (contentLength) {\n\t\t\thttpReader.size = Number(contentLength);\n\t\t} else {\n\t\t\tawait getRequestData(httpReader, httpReader.options);\n\t\t}\n\t}\n}\n\nasync function sendFetchRequest(method, { options, url }, headers) {\n\tconst response = await fetch(url, Object.assign({}, options, { method, headers }));\n\tif (response.status < 400) {\n\t\treturn response;\n\t} else {\n\t\tthrow response.status == 416 ? new Error(ERR_HTTP_RANGE) : new Error(ERR_HTTP_STATUS + (response.statusText || response.status));\n\t}\n}\n\nfunction sendXMLHttpRequest(method, { url }, headers) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\trequest.addEventListener(\"load\", () => {\n\t\t\tif (request.status < 400) {\n\t\t\t\tconst headers = [];\n\t\t\t\trequest.getAllResponseHeaders().trim().split(/[\\r\\n]+/).forEach(header => {\n\t\t\t\t\tconst splitHeader = header.trim().split(/\\s*:\\s*/);\n\t\t\t\t\tsplitHeader[0] = splitHeader[0].trim().replace(/^[a-z]|-[a-z]/g, value => value.toUpperCase());\n\t\t\t\t\theaders.push(splitHeader);\n\t\t\t\t});\n\t\t\t\tresolve({\n\t\t\t\t\tstatus: request.status,\n\t\t\t\t\tarrayBuffer: () => request.response,\n\t\t\t\t\theaders: new Map(headers)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treject(request.status == 416 ? new Error(ERR_HTTP_RANGE) : new Error(ERR_HTTP_STATUS + (request.statusText || request.status)));\n\t\t\t}\n\t\t}, false);\n\t\trequest.addEventListener(\"error\", event => reject(event.detail ? event.detail.error : new Error(\"Network error\")), false);\n\t\trequest.open(method, url);\n\t\tif (headers) {\n\t\t\tfor (const entry of Object.entries(headers)) {\n\t\t\t\trequest.setRequestHeader(entry[0], entry[1]);\n\t\t\t}\n\t\t}\n\t\trequest.responseType = \"arraybuffer\";\n\t\trequest.send();\n\t});\n}\n\nclass HttpReader extends Reader {\n\n\tconstructor(url, options = {}) {\n\t\tsuper();\n\t\tObject.assign(this, {\n\t\t\turl,\n\t\t\treader: options.useXHR ? new XHRReader(url, options) : new FetchReader(url, options)\n\t\t});\n\t}\n\n\tset size(value) {\n\t\t// ignored\n\t}\n\n\tget size() {\n\t\treturn this.reader.size;\n\t}\n\n\tasync init() {\n\t\tawait this.reader.init();\n\t\tsuper.init();\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn this.reader.readUint8Array(index, length);\n\t}\n}\n\nclass HttpRangeReader extends HttpReader {\n\n\tconstructor(url, options = {}) {\n\t\toptions.useRangeHeader = true;\n\t\tsuper(url, options);\n\t}\n}\n\n\nclass Uint8ArrayReader extends Reader {\n\n\tconstructor(array) {\n\t\tsuper();\n\t\tObject.assign(this, {\n\t\t\tarray,\n\t\t\tsize: array.length\n\t\t});\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn this.array.slice(index, index + length);\n\t}\n}\n\nclass Uint8ArrayWriter extends Writer {\n\n\tinit(initSize = 0) {\n\t\tObject.assign(this, {\n\t\t\toffset: 0,\n\t\t\tarray: new Uint8Array(initSize)\n\t\t});\n\t\tsuper.init();\n\t}\n\n\twriteUint8Array(array) {\n\t\tconst writer = this;\n\t\tif (writer.offset + array.length > writer.array.length) {\n\t\t\tconst previousArray = writer.array;\n\t\t\twriter.array = new Uint8Array(previousArray.length + array.length);\n\t\t\twriter.array.set(previousArray);\n\t\t}\n\t\twriter.array.set(array, writer.offset);\n\t\twriter.offset += array.length;\n\t}\n\n\tgetData() {\n\t\treturn this.array;\n\t}\n}\n\nclass SplitDataReader extends Reader {\n\n\tconstructor(readers) {\n\t\tsuper();\n\t\tthis.readers = readers;\n\t}\n\n\tasync init() {\n\t\tconst reader = this;\n\t\tconst { readers } = reader;\n\t\treader.lastDiskNumber = 0;\n\t\treader.lastDiskOffset = 0;\n\t\tawait Promise.all(readers.map(async (diskReader, indexDiskReader) => {\n\t\t\tawait diskReader.init();\n\t\t\tif (indexDiskReader != readers.length - 1) {\n\t\t\t\treader.lastDiskOffset += diskReader.size;\n\t\t\t}\n\t\t\treader.size += diskReader.size;\n\t\t}));\n\t\tsuper.init();\n\t}\n\n\tasync readUint8Array(offset, length, diskNumber = 0) {\n\t\tconst reader = this;\n\t\tconst { readers } = this;\n\t\tlet result;\n\t\tlet currentDiskNumber = diskNumber;\n\t\tif (currentDiskNumber == -1) {\n\t\t\tcurrentDiskNumber = readers.length - 1;\n\t\t}\n\t\tlet currentReaderOffset = offset;\n\t\twhile (currentReaderOffset >= readers[currentDiskNumber].size) {\n\t\t\tcurrentReaderOffset -= readers[currentDiskNumber].size;\n\t\t\tcurrentDiskNumber++;\n\t\t}\n\t\tconst currentReader = readers[currentDiskNumber];\n\t\tconst currentReaderSize = currentReader.size;\n\t\tif (currentReaderOffset + length <= currentReaderSize) {\n\t\t\tresult = await readUint8Array(currentReader, currentReaderOffset, length);\n\t\t} else {\n\t\t\tconst chunkLength = currentReaderSize - currentReaderOffset;\n\t\t\tresult = new Uint8Array(length);\n\t\t\tresult.set(await readUint8Array(currentReader, currentReaderOffset, chunkLength));\n\t\t\tresult.set(await reader.readUint8Array(offset + chunkLength, length - chunkLength, diskNumber), chunkLength);\n\t\t}\n\t\treader.lastDiskNumber = Math.max(currentDiskNumber, reader.lastDiskNumber);\n\t\treturn result;\n\t}\n}\n\nclass SplitDataWriter extends Stream {\n\n\tconstructor(writerGenerator, maxSize = 4294967295) {\n\t\tsuper();\n\t\tconst writer = this;\n\t\tObject.assign(writer, {\n\t\t\tdiskNumber: 0,\n\t\t\tdiskOffset: 0,\n\t\t\tsize: 0,\n\t\t\tmaxSize,\n\t\t\tavailableSize: maxSize\n\t\t});\n\t\tlet diskSourceWriter, diskWritable, diskWriter;\n\t\tconst writable = new WritableStream({\n\t\t\tasync write(chunk) {\n\t\t\t\tconst { availableSize } = writer;\n\t\t\t\tif (!diskWriter) {\n\t\t\t\t\tconst { value, done } = await writerGenerator.next();\n\t\t\t\t\tif (done && !value) {\n\t\t\t\t\t\tthrow new Error(ERR_ITERATOR_COMPLETED_TOO_SOON);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdiskSourceWriter = value;\n\t\t\t\t\t\tdiskSourceWriter.size = 0;\n\t\t\t\t\t\tif (diskSourceWriter.maxSize) {\n\t\t\t\t\t\t\twriter.maxSize = diskSourceWriter.maxSize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twriter.availableSize = writer.maxSize;\n\t\t\t\t\t\tawait initStream(diskSourceWriter);\n\t\t\t\t\t\tdiskWritable = value.writable;\n\t\t\t\t\t\tdiskWriter = diskWritable.getWriter();\n\t\t\t\t\t}\n\t\t\t\t\tawait this.write(chunk);\n\t\t\t\t} else if (chunk.length >= availableSize) {\n\t\t\t\t\tawait writeChunk(chunk.slice(0, availableSize));\n\t\t\t\t\tawait closeDisk();\n\t\t\t\t\twriter.diskOffset += diskSourceWriter.size;\n\t\t\t\t\twriter.diskNumber++;\n\t\t\t\t\tdiskWriter = null;\n\t\t\t\t\tawait this.write(chunk.slice(availableSize));\n\t\t\t\t} else {\n\t\t\t\t\tawait writeChunk(chunk);\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync close() {\n\t\t\t\tawait diskWriter.ready;\n\t\t\t\tawait closeDisk();\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(writer, PROPERTY_NAME_WRITABLE, {\n\t\t\tget() {\n\t\t\t\treturn writable;\n\t\t\t}\n\t\t});\n\n\t\tasync function writeChunk(chunk) {\n\t\t\tconst chunkLength = chunk.length;\n\t\t\tif (chunkLength) {\n\t\t\t\tawait diskWriter.ready;\n\t\t\t\tawait diskWriter.write(chunk);\n\t\t\t\tdiskSourceWriter.size += chunkLength;\n\t\t\t\twriter.size += chunkLength;\n\t\t\t\twriter.availableSize -= chunkLength;\n\t\t\t}\n\t\t}\n\n\t\tasync function closeDisk() {\n\t\t\tdiskWritable.size = diskSourceWriter.size;\n\t\t\tawait diskWriter.close();\n\t\t}\n\t}\n}\n\nfunction isHttpFamily(url) {\n\tconst { baseURL } = getConfiguration();\n\tconst { protocol } = new URL(url, baseURL);\n\treturn protocol == \"http:\" || protocol == \"https:\";\n}\n\nasync function initStream(stream, initSize) {\n\tif (stream.init && !stream.initialized) {\n\t\tawait stream.init(initSize);\n\t} else {\n\t\treturn Promise.resolve();\n\t}\n}\n\nfunction initReader(reader) {\n\tif (Array.isArray(reader)) {\n\t\treader = new SplitDataReader(reader);\n\t}\n\tif (reader instanceof ReadableStream) {\n\t\treader = {\n\t\t\treadable: reader\n\t\t};\n\t}\n\treturn reader;\n}\n\nfunction initWriter(writer) {\n\tif (writer.writable === UNDEFINED_VALUE && typeof writer.next == FUNCTION_TYPE) {\n\t\twriter = new SplitDataWriter(writer);\n\t}\n\tif (writer instanceof WritableStream) {\n\t\twriter = {\n\t\t\twritable: writer\n\t\t};\n\t}\n\tconst { writable } = writer;\n\tif (writable.size === UNDEFINED_VALUE) {\n\t\twritable.size = 0;\n\t}\n\tif (!(writer instanceof SplitDataWriter)) {\n\t\tObject.assign(writer, {\n\t\t\tdiskNumber: 0,\n\t\t\tdiskOffset: 0,\n\t\t\tavailableSize: Infinity,\n\t\t\tmaxSize: Infinity\n\t\t});\n\t}\n\treturn writer;\n}\n\nfunction readUint8Array(reader, offset, size, diskNumber) {\n\treturn reader.readUint8Array(offset, size, diskNumber);\n}\n\nconst SplitZipReader = SplitDataReader;\nconst SplitZipWriter = SplitDataWriter;\n\nexport {\n\tinitStream,\n\tinitReader,\n\tinitWriter,\n\treadUint8Array,\n\tReader,\n\tWriter,\n\tTextReader,\n\tTextWriter,\n\tData64URIReader,\n\tData64URIWriter,\n\tBlobReader,\n\tBlobWriter,\n\tUint8ArrayReader,\n\tUint8ArrayWriter,\n\tHttpReader,\n\tHttpRangeReader,\n\tSplitZipReader,\n\tSplitZipWriter,\n\tSplitDataReader,\n\tSplitDataWriter,\n\tERR_HTTP_RANGE,\n\tERR_ITERATOR_COMPLETED_TOO_SOON\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TextDecoder */\n\nconst CP437 = \"\\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ \".split(\"\");\nconst VALID_CP437 = CP437.length == 256;\n\nexport {\n\tdecodeCP437\n};\n\nfunction decodeCP437(stringValue) {\n\tif (VALID_CP437) {\n\t\tlet result = \"\";\n\t\tfor (let indexCharacter = 0; indexCharacter < stringValue.length; indexCharacter++) {\n\t\t\tresult += CP437[stringValue[indexCharacter]];\n\t\t}\n\t\treturn result;\n\t} else {\n\t\treturn new TextDecoder().decode(stringValue);\n\t}\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TextDecoder */\n\nimport { decodeCP437 } from \"./cp437-decode.js\";\n\nexport {\n\tdecodeText\n};\n\nfunction decodeText(value, encoding) {\n\tif (encoding && encoding.trim().toLowerCase() == \"cp437\") {\n\t\treturn decodeCP437(value);\n\t} else {\n\t\treturn new TextDecoder(encoding).decode(value);\n\t}\n}","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst PROPERTY_NAME_FILENAME = \"filename\";\nconst PROPERTY_NAME_RAW_FILENAME = \"rawFilename\";\nconst PROPERTY_NAME_COMMENT = \"comment\";\nconst PROPERTY_NAME_RAW_COMMENT = \"rawComment\";\nconst PROPERTY_NAME_UNCOMPPRESSED_SIZE = \"uncompressedSize\";\nconst PROPERTY_NAME_COMPPRESSED_SIZE = \"compressedSize\";\nconst PROPERTY_NAME_OFFSET = \"offset\";\nconst PROPERTY_NAME_DISK_NUMBER_START = \"diskNumberStart\";\nconst PROPERTY_NAME_LAST_MODIFICATION_DATE = \"lastModDate\";\nconst PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE = \"rawLastModDate\";\nconst PROPERTY_NAME_LAST_ACCESS_DATE = \"lastAccessDate\";\nconst PROPERTY_NAME_RAW_LAST_ACCESS_DATE = \"rawLastAccessDate\";\nconst PROPERTY_NAME_CREATION_DATE = \"creationDate\";\nconst PROPERTY_NAME_RAW_CREATION_DATE = \"rawCreationDate\";\nconst PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE = \"internalFileAttribute\";\nconst PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES = \"internalFileAttributes\";\nconst PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = \"externalFileAttribute\";\nconst PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES = \"externalFileAttributes\";\nconst PROPERTY_NAME_MS_DOS_COMPATIBLE = \"msDosCompatible\";\nconst PROPERTY_NAME_ZIP64 = \"zip64\";\nconst PROPERTY_NAME_ENCRYPTED = \"encrypted\";\nconst PROPERTY_NAME_VERSION = \"version\";\nconst PROPERTY_NAME_VERSION_MADE_BY = \"versionMadeBy\";\nconst PROPERTY_NAME_ZIPCRYPTO = \"zipCrypto\";\nconst PROPERTY_NAME_DIRECTORY = \"directory\";\nconst PROPERTY_NAME_EXECUTABLE = \"executable\";\n\nconst PROPERTY_NAMES = [\n\tPROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, PROPERTY_NAME_COMPPRESSED_SIZE, PROPERTY_NAME_UNCOMPPRESSED_SIZE,\n\tPROPERTY_NAME_LAST_MODIFICATION_DATE, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT,\n\tPROPERTY_NAME_LAST_ACCESS_DATE, PROPERTY_NAME_CREATION_DATE, PROPERTY_NAME_OFFSET, PROPERTY_NAME_DISK_NUMBER_START,\n\tPROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, PROPERTY_NAME_DIRECTORY, PROPERTY_NAME_EXECUTABLE, \"bitFlag\", \"signature\", \"filenameUTF8\", \"commentUTF8\", \"compressionMethod\", \"extraField\", \"rawExtraField\", \"extraFieldZip64\", \"extraFieldUnicodePath\", \"extraFieldUnicodeComment\", \"extraFieldAES\", \"extraFieldNTFS\", \"extraFieldExtendedTimestamp\"];\n\nclass Entry {\n\n\tconstructor(data) {\n\t\tPROPERTY_NAMES.forEach(name => this[name] = data[name]);\n\t}\n\n}\n\nexport {\n\tPROPERTY_NAME_FILENAME,\n\tPROPERTY_NAME_RAW_FILENAME,\n\tPROPERTY_NAME_COMMENT,\n\tPROPERTY_NAME_RAW_COMMENT,\n\tPROPERTY_NAME_UNCOMPPRESSED_SIZE,\n\tPROPERTY_NAME_COMPPRESSED_SIZE,\n\tPROPERTY_NAME_OFFSET,\n\tPROPERTY_NAME_DISK_NUMBER_START,\n\tPROPERTY_NAME_LAST_MODIFICATION_DATE,\n\tPROPERTY_NAME_RAW_LAST_MODIFICATION_DATE,\n\tPROPERTY_NAME_LAST_ACCESS_DATE,\n\tPROPERTY_NAME_RAW_LAST_ACCESS_DATE,\n\tPROPERTY_NAME_CREATION_DATE,\n\tPROPERTY_NAME_RAW_CREATION_DATE,\n\tPROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE,\n\tPROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES,\n\tPROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE,\n\tPROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES,\n\tPROPERTY_NAME_MS_DOS_COMPATIBLE,\n\tPROPERTY_NAME_ZIP64,\n\tPROPERTY_NAME_ENCRYPTED,\n\tPROPERTY_NAME_VERSION,\n\tPROPERTY_NAME_VERSION_MADE_BY,\n\tPROPERTY_NAME_ZIPCRYPTO,\n\tPROPERTY_NAME_DIRECTORY,\n\tPROPERTY_NAME_EXECUTABLE,\n\tEntry\n};","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global Response, WritableStream, ReadableStream, TransformStream */\n// deno-lint-ignore-file no-this-alias\n\nimport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tSPLIT_ZIP_FILE_SIGNATURE,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_UNICODE_PATH,\n\tEXTRAFIELD_TYPE_UNICODE_COMMENT,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEXTRAFIELD_TYPE_USDZ,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LENGTH,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_LEVEL,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tFILE_ATTR_UNIX_DIR_MASK,\n\tFILE_ATTR_UNIX_EXECUTABLE_MASK,\n\tDIRECTORY_SIGNATURE,\n\tUNDEFINED_VALUE\n} from \"./constants.js\";\nimport {\n\tgetConfiguration,\n\tgetChunkSize\n} from \"./configuration.js\";\nimport {\n\trunWorker,\n\tCODEC_INFLATE,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD,\n\tERR_ABORT_CHECK_PASSWORD\n} from \"./codec-pool.js\";\nimport {\n\tinitStream,\n\tinitReader,\n\tinitWriter,\n\treadUint8Array,\n\tBlobReader\n} from \"./io.js\";\nimport { decodeText } from \"./util/decode-text.js\";\nimport { Crc32 } from \"./streams/codecs/crc32.js\";\nimport {\n\tPROPERTY_NAME_RAW_FILENAME,\n\tPROPERTY_NAME_FILENAME,\n\tPROPERTY_NAME_RAW_COMMENT,\n\tPROPERTY_NAME_COMMENT,\n\tPROPERTY_NAME_UNCOMPPRESSED_SIZE,\n\tPROPERTY_NAME_COMPPRESSED_SIZE,\n\tPROPERTY_NAME_OFFSET,\n\tPROPERTY_NAME_DISK_NUMBER_START,\n\tPROPERTY_NAME_LAST_MODIFICATION_DATE,\n\tPROPERTY_NAME_RAW_LAST_MODIFICATION_DATE,\n\tPROPERTY_NAME_LAST_ACCESS_DATE,\n\tPROPERTY_NAME_RAW_LAST_ACCESS_DATE,\n\tPROPERTY_NAME_CREATION_DATE,\n\tPROPERTY_NAME_RAW_CREATION_DATE,\n\tEntry\n} from \"./zip-entry.js\";\n\nconst ERR_BAD_FORMAT = \"File format is not recognized\";\nconst ERR_EOCDR_NOT_FOUND = \"End of central directory not found\";\nconst ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND = \"End of Zip64 central directory locator not found\";\nconst ERR_CENTRAL_DIRECTORY_NOT_FOUND = \"Central directory header not found\";\nconst ERR_LOCAL_FILE_HEADER_NOT_FOUND = \"Local file header not found\";\nconst ERR_EXTRAFIELD_ZIP64_NOT_FOUND = \"Zip64 extra field not found\";\nconst ERR_ENCRYPTED = \"File contains encrypted entry\";\nconst ERR_UNSUPPORTED_ENCRYPTION = \"Encryption method not supported\";\nconst ERR_UNSUPPORTED_COMPRESSION = \"Compression method not supported\";\nconst ERR_SPLIT_ZIP_FILE = \"Split zip file\";\nconst CHARSET_UTF8 = \"utf-8\";\nconst CHARSET_CP437 = \"cp437\";\nconst ZIP64_PROPERTIES = [\n\t[PROPERTY_NAME_UNCOMPPRESSED_SIZE, MAX_32_BITS],\n\t[PROPERTY_NAME_COMPPRESSED_SIZE, MAX_32_BITS],\n\t[PROPERTY_NAME_OFFSET, MAX_32_BITS],\n\t[PROPERTY_NAME_DISK_NUMBER_START, MAX_16_BITS]\n];\nconst ZIP64_EXTRACTION = {\n\t[MAX_16_BITS]: {\n\t\tgetValue: getUint32,\n\t\tbytes: 4\n\t},\n\t[MAX_32_BITS]: {\n\t\tgetValue: getBigUint64,\n\t\tbytes: 8\n\t}\n};\n\nclass ZipReader {\n\n\tconstructor(reader, options = {}) {\n\t\tObject.assign(this, {\n\t\t\treader: initReader(reader),\n\t\t\toptions,\n\t\t\tconfig: getConfiguration()\n\t\t});\n\t}\n\n\tasync* getEntriesGenerator(options = {}) {\n\t\tconst zipReader = this;\n\t\tlet { reader } = zipReader;\n\t\tconst { config } = zipReader;\n\t\tawait initStream(reader);\n\t\tif (reader.size === UNDEFINED_VALUE || !reader.readUint8Array) {\n\t\t\treader = new BlobReader(await new Response(reader.readable).blob());\n\t\t\tawait initStream(reader);\n\t\t}\n\t\tif (reader.size < END_OF_CENTRAL_DIR_LENGTH) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\treader.chunkSize = getChunkSize(config);\n\t\tconst endOfDirectoryInfo = await seekSignature(reader, END_OF_CENTRAL_DIR_SIGNATURE, reader.size, END_OF_CENTRAL_DIR_LENGTH, MAX_16_BITS * 16);\n\t\tif (!endOfDirectoryInfo) {\n\t\t\tconst signatureArray = await readUint8Array(reader, 0, 4);\n\t\t\tconst signatureView = getDataView(signatureArray);\n\t\t\tif (getUint32(signatureView) == SPLIT_ZIP_FILE_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_SPLIT_ZIP_FILE);\n\t\t\t} else {\n\t\t\t\tthrow new Error(ERR_EOCDR_NOT_FOUND);\n\t\t\t}\n\t\t}\n\t\tconst endOfDirectoryView = getDataView(endOfDirectoryInfo);\n\t\tlet directoryDataLength = getUint32(endOfDirectoryView, 12);\n\t\tlet directoryDataOffset = getUint32(endOfDirectoryView, 16);\n\t\tconst commentOffset = endOfDirectoryInfo.offset;\n\t\tconst commentLength = getUint16(endOfDirectoryView, 20);\n\t\tconst appendedDataOffset = commentOffset + END_OF_CENTRAL_DIR_LENGTH + commentLength;\n\t\tlet lastDiskNumber = getUint16(endOfDirectoryView, 4);\n\t\tconst expectedLastDiskNumber = reader.lastDiskNumber || 0;\n\t\tlet diskNumber = getUint16(endOfDirectoryView, 6);\n\t\tlet filesLength = getUint16(endOfDirectoryView, 8);\n\t\tlet prependedDataLength = 0;\n\t\tlet startOffset = 0;\n\t\tif (directoryDataOffset == MAX_32_BITS || directoryDataLength == MAX_32_BITS || filesLength == MAX_16_BITS || diskNumber == MAX_16_BITS) {\n\t\t\tconst endOfDirectoryLocatorArray = await readUint8Array(reader, endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH);\n\t\t\tconst endOfDirectoryLocatorView = getDataView(endOfDirectoryLocatorArray);\n\t\t\tif (getUint32(endOfDirectoryLocatorView, 0) == ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE) {\n\t\t\t\tdirectoryDataOffset = getBigUint64(endOfDirectoryLocatorView, 8);\n\t\t\t\tlet endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH, -1);\n\t\t\t\tlet endOfDirectoryView = getDataView(endOfDirectoryArray);\n\t\t\t\tconst expectedDirectoryDataOffset = endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH - ZIP64_END_OF_CENTRAL_DIR_LENGTH;\n\t\t\t\tif (getUint32(endOfDirectoryView, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {\n\t\t\t\t\tconst originalDirectoryDataOffset = directoryDataOffset;\n\t\t\t\t\tdirectoryDataOffset = expectedDirectoryDataOffset;\n\t\t\t\t\tprependedDataLength = directoryDataOffset - originalDirectoryDataOffset;\n\t\t\t\t\tendOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH, -1);\n\t\t\t\t\tendOfDirectoryView = getDataView(endOfDirectoryArray);\n\t\t\t\t}\n\t\t\t\tif (getUint32(endOfDirectoryView, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) {\n\t\t\t\t\tthrow new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);\n\t\t\t\t}\n\t\t\t\tif (lastDiskNumber == MAX_16_BITS) {\n\t\t\t\t\tlastDiskNumber = getUint32(endOfDirectoryView, 16);\n\t\t\t\t}\n\t\t\t\tif (diskNumber == MAX_16_BITS) {\n\t\t\t\t\tdiskNumber = getUint32(endOfDirectoryView, 20);\n\t\t\t\t}\n\t\t\t\tif (filesLength == MAX_16_BITS) {\n\t\t\t\t\tfilesLength = getBigUint64(endOfDirectoryView, 32);\n\t\t\t\t}\n\t\t\t\tif (directoryDataLength == MAX_32_BITS) {\n\t\t\t\t\tdirectoryDataLength = getBigUint64(endOfDirectoryView, 40);\n\t\t\t\t}\n\t\t\t\tdirectoryDataOffset -= directoryDataLength;\n\t\t\t}\n\t\t}\n\t\tif (directoryDataOffset >= reader.size) {\n\t\t\tprependedDataLength = reader.size - directoryDataOffset - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;\n\t\t\tdirectoryDataOffset = reader.size - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;\n\t\t}\n\t\tif (expectedLastDiskNumber != lastDiskNumber) {\n\t\t\tthrow new Error(ERR_SPLIT_ZIP_FILE);\n\t\t}\n\t\tif (directoryDataOffset < 0) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tlet offset = 0;\n\t\tlet directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength, diskNumber);\n\t\tlet directoryView = getDataView(directoryArray);\n\t\tif (directoryDataLength) {\n\t\t\tconst expectedDirectoryDataOffset = endOfDirectoryInfo.offset - directoryDataLength;\n\t\t\tif (getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {\n\t\t\t\tconst originalDirectoryDataOffset = directoryDataOffset;\n\t\t\t\tdirectoryDataOffset = expectedDirectoryDataOffset;\n\t\t\t\tprependedDataLength += directoryDataOffset - originalDirectoryDataOffset;\n\t\t\t\tdirectoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength, diskNumber);\n\t\t\t\tdirectoryView = getDataView(directoryArray);\n\t\t\t}\n\t\t}\n\t\tconst expectedDirectoryDataLength = endOfDirectoryInfo.offset - directoryDataOffset - (reader.lastDiskOffset || 0);\n\t\tif (directoryDataLength != expectedDirectoryDataLength && expectedDirectoryDataLength >= 0) {\n\t\t\tdirectoryDataLength = expectedDirectoryDataLength;\n\t\t\tdirectoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength, diskNumber);\n\t\t\tdirectoryView = getDataView(directoryArray);\n\t\t}\n\t\tif (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tconst filenameEncoding = getOptionValue(zipReader, options, \"filenameEncoding\");\n\t\tconst commentEncoding = getOptionValue(zipReader, options, \"commentEncoding\");\n\t\tfor (let indexFile = 0; indexFile < filesLength; indexFile++) {\n\t\t\tconst fileEntry = new ZipEntry(reader, config, zipReader.options);\n\t\t\tif (getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_CENTRAL_DIRECTORY_NOT_FOUND);\n\t\t\t}\n\t\t\treadCommonHeader(fileEntry, directoryView, offset + 6);\n\t\t\tconst languageEncodingFlag = Boolean(fileEntry.bitFlag.languageEncodingFlag);\n\t\t\tconst filenameOffset = offset + 46;\n\t\t\tconst extraFieldOffset = filenameOffset + fileEntry.filenameLength;\n\t\t\tconst commentOffset = extraFieldOffset + fileEntry.extraFieldLength;\n\t\t\tconst versionMadeBy = getUint16(directoryView, offset + 4);\n\t\t\tconst msDosCompatible = versionMadeBy >> 8 == 0;\n\t\t\tconst unixCompatible = versionMadeBy >> 8 == 3;\n\t\t\tconst rawFilename = directoryArray.subarray(filenameOffset, extraFieldOffset);\n\t\t\tconst commentLength = getUint16(directoryView, offset + 32);\n\t\t\tconst endOffset = commentOffset + commentLength;\n\t\t\tconst rawComment = directoryArray.subarray(commentOffset, endOffset);\n\t\t\tconst filenameUTF8 = languageEncodingFlag;\n\t\t\tconst commentUTF8 = languageEncodingFlag;\n\t\t\tconst externalFileAttributes = getUint32(directoryView, offset + 38);\n\t\t\tconst directory =\n\t\t\t\t(msDosCompatible && ((getUint8(directoryView, offset + 38) & FILE_ATTR_MSDOS_DIR_MASK) == FILE_ATTR_MSDOS_DIR_MASK)) ||\n\t\t\t\t(unixCompatible && (((externalFileAttributes >> 16) & FILE_ATTR_UNIX_DIR_MASK) == FILE_ATTR_UNIX_DIR_MASK)) ||\n\t\t\t\t(rawFilename.length && rawFilename[rawFilename.length - 1] == DIRECTORY_SIGNATURE.charCodeAt(0));\n\t\t\tconst executable = (unixCompatible && (((externalFileAttributes >> 16) & FILE_ATTR_UNIX_EXECUTABLE_MASK) == FILE_ATTR_UNIX_EXECUTABLE_MASK));\n\t\t\tconst offsetFileEntry = getUint32(directoryView, offset + 42) + prependedDataLength;\n\t\t\tObject.assign(fileEntry, {\n\t\t\t\tversionMadeBy,\n\t\t\t\tmsDosCompatible,\n\t\t\t\tcompressedSize: 0,\n\t\t\t\tuncompressedSize: 0,\n\t\t\t\tcommentLength,\n\t\t\t\tdirectory,\n\t\t\t\toffset: offsetFileEntry,\n\t\t\t\tdiskNumberStart: getUint16(directoryView, offset + 34),\n\t\t\t\tinternalFileAttributes: getUint16(directoryView, offset + 36),\n\t\t\t\texternalFileAttributes,\n\t\t\t\trawFilename,\n\t\t\t\tfilenameUTF8,\n\t\t\t\tcommentUTF8,\n\t\t\t\trawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset),\n\t\t\t\texecutable\n\t\t\t});\n\t\t\tfileEntry.internalFileAttribute = fileEntry.internalFileAttributes;\n\t\t\tfileEntry.externalFileAttribute = fileEntry.externalFileAttributes;\n\t\t\tconst decode = getOptionValue(zipReader, options, \"decodeText\") || decodeText;\n\t\t\tconst rawFilenameEncoding = filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437;\n\t\t\tconst rawCommentEncoding = commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437;\n\t\t\tlet filename = decode(rawFilename, rawFilenameEncoding);\n\t\t\tif (filename === UNDEFINED_VALUE) {\n\t\t\t\tfilename = decodeText(rawFilename, rawFilenameEncoding);\n\t\t\t}\n\t\t\tlet comment = decode(rawComment, rawCommentEncoding);\n\t\t\tif (comment === UNDEFINED_VALUE) {\n\t\t\t\tcomment = decodeText(rawComment, rawCommentEncoding);\n\t\t\t}\n\t\t\tObject.assign(fileEntry, {\n\t\t\t\trawComment,\n\t\t\t\tfilename,\n\t\t\t\tcomment,\n\t\t\t\tdirectory: directory || filename.endsWith(DIRECTORY_SIGNATURE)\n\t\t\t});\n\t\t\tstartOffset = Math.max(offsetFileEntry, startOffset);\n\t\t\treadCommonFooter(fileEntry, fileEntry, directoryView, offset + 6);\n\t\t\tfileEntry.zipCrypto = fileEntry.encrypted && !fileEntry.extraFieldAES;\n\t\t\tconst entry = new Entry(fileEntry);\n\t\t\tentry.getData = (writer, options) => fileEntry.getData(writer, entry, options);\n\t\t\toffset = endOffset;\n\t\t\tconst { onprogress } = options;\n\t\t\tif (onprogress) {\n\t\t\t\ttry {\n\t\t\t\t\tawait onprogress(indexFile + 1, filesLength, new Entry(fileEntry));\n\t\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t\t} catch (_) {\n\t\t\t\t\t// ignored\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield entry;\n\t\t}\n\t\tconst extractPrependedData = getOptionValue(zipReader, options, \"extractPrependedData\");\n\t\tconst extractAppendedData = getOptionValue(zipReader, options, \"extractAppendedData\");\n\t\tif (extractPrependedData) {\n\t\t\tzipReader.prependedData = startOffset > 0 ? await readUint8Array(reader, 0, startOffset) : new Uint8Array();\n\t\t}\n\t\tzipReader.comment = commentLength ? await readUint8Array(reader, commentOffset + END_OF_CENTRAL_DIR_LENGTH, commentLength) : new Uint8Array();\n\t\tif (extractAppendedData) {\n\t\t\tzipReader.appendedData = appendedDataOffset < reader.size ? await readUint8Array(reader, appendedDataOffset, reader.size - appendedDataOffset) : new Uint8Array();\n\t\t}\n\t\treturn true;\n\t}\n\n\tasync getEntries(options = {}) {\n\t\tconst entries = [];\n\t\tfor await (const entry of this.getEntriesGenerator(options)) {\n\t\t\tentries.push(entry);\n\t\t}\n\t\treturn entries;\n\t}\n\n\tasync close() {\n\t}\n}\n\nclass ZipReaderStream {\n\n\tconstructor(options = {}) {\n\t\tconst { readable, writable } = new TransformStream();\n\t\tconst gen = new ZipReader(readable, options).getEntriesGenerator();\n\t\tthis.readable = new ReadableStream({\n\t\t\tasync pull(controller) {\n\t\t\t\tconst { done, value } = await gen.next();\n\t\t\t\tif (done)\n\t\t\t\t\treturn controller.close();\n\t\t\t\tconst chunk = {\n\t\t\t\t\t...value,\n\t\t\t\t\treadable: (function () {\n\t\t\t\t\t\tconst { readable, writable } = new TransformStream();\n\t\t\t\t\t\tif (value.getData) {\n\t\t\t\t\t\t\tvalue.getData(writable);\n\t\t\t\t\t\t\treturn readable;\n\t\t\t\t\t\t}\n\t\t\t\t\t})()\n\t\t\t\t};\n\t\t\t\tdelete chunk.getData;\n\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t}\n\t\t});\n\t\tthis.writable = writable;\n\t}\n}\n\nexport {\n\tZipReader,\n\tZipReaderStream,\n\tERR_BAD_FORMAT,\n\tERR_EOCDR_NOT_FOUND,\n\tERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,\n\tERR_CENTRAL_DIRECTORY_NOT_FOUND,\n\tERR_LOCAL_FILE_HEADER_NOT_FOUND,\n\tERR_EXTRAFIELD_ZIP64_NOT_FOUND,\n\tERR_ENCRYPTED,\n\tERR_UNSUPPORTED_ENCRYPTION,\n\tERR_UNSUPPORTED_COMPRESSION,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD,\n\tERR_SPLIT_ZIP_FILE\n};\n\nclass ZipEntry {\n\n\tconstructor(reader, config, options) {\n\t\tObject.assign(this, {\n\t\t\treader,\n\t\t\tconfig,\n\t\t\toptions\n\t\t});\n\t}\n\n\tasync getData(writer, fileEntry, options = {}) {\n\t\tconst zipEntry = this;\n\t\tconst {\n\t\t\treader,\n\t\t\toffset,\n\t\t\tdiskNumberStart,\n\t\t\textraFieldAES,\n\t\t\tcompressionMethod,\n\t\t\tconfig,\n\t\t\tbitFlag,\n\t\t\tsignature,\n\t\t\trawLastModDate,\n\t\t\tuncompressedSize,\n\t\t\tcompressedSize\n\t\t} = zipEntry;\n\t\tconst localDirectory = fileEntry.localDirectory = {};\n\t\tconst dataArray = await readUint8Array(reader, offset, 30, diskNumberStart);\n\t\tconst dataView = getDataView(dataArray);\n\t\tlet password = getOptionValue(zipEntry, options, \"password\");\n\t\tlet rawPassword = getOptionValue(zipEntry, options, \"rawPassword\");\n\t\tconst passThrough = getOptionValue(zipEntry, options, \"passThrough\");\n\t\tpassword = password && password.length && password;\n\t\trawPassword = rawPassword && rawPassword.length && rawPassword;\n\t\tif (extraFieldAES) {\n\t\t\tif (extraFieldAES.originalCompressionMethod != COMPRESSION_METHOD_AES) {\n\t\t\t\tthrow new Error(ERR_UNSUPPORTED_COMPRESSION);\n\t\t\t}\n\t\t}\n\t\tif ((compressionMethod != COMPRESSION_METHOD_STORE && compressionMethod != COMPRESSION_METHOD_DEFLATE) && !passThrough) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_COMPRESSION);\n\t\t}\n\t\tif (getUint32(dataView, 0) != LOCAL_FILE_HEADER_SIGNATURE) {\n\t\t\tthrow new Error(ERR_LOCAL_FILE_HEADER_NOT_FOUND);\n\t\t}\n\t\treadCommonHeader(localDirectory, dataView, 4);\n\t\tlocalDirectory.rawExtraField = localDirectory.extraFieldLength ?\n\t\t\tawait readUint8Array(reader, offset + 30 + localDirectory.filenameLength, localDirectory.extraFieldLength, diskNumberStart) :\n\t\t\tnew Uint8Array();\n\t\treadCommonFooter(zipEntry, localDirectory, dataView, 4, true);\n\t\tObject.assign(fileEntry, {\n\t\t\tlastAccessDate: localDirectory.lastAccessDate,\n\t\t\tcreationDate: localDirectory.creationDate\n\t\t});\n\t\tconst encrypted = zipEntry.encrypted && localDirectory.encrypted && !passThrough;\n\t\tconst zipCrypto = encrypted && !extraFieldAES;\n\t\tif (!passThrough) {\n\t\t\tfileEntry.zipCrypto = zipCrypto;\n\t\t}\n\t\tif (encrypted) {\n\t\t\tif (!zipCrypto && extraFieldAES.strength === UNDEFINED_VALUE) {\n\t\t\t\tthrow new Error(ERR_UNSUPPORTED_ENCRYPTION);\n\t\t\t} else if (!password && !rawPassword) {\n\t\t\t\tthrow new Error(ERR_ENCRYPTED);\n\t\t\t}\n\t\t}\n\t\tconst dataOffset = offset + 30 + localDirectory.filenameLength + localDirectory.extraFieldLength;\n\t\tconst size = compressedSize;\n\t\tconst readable = reader.readable;\n\t\tObject.assign(readable, {\n\t\t\tdiskNumberStart,\n\t\t\toffset: dataOffset,\n\t\t\tsize\n\t\t});\n\t\tconst signal = getOptionValue(zipEntry, options, \"signal\");\n\t\tconst checkPasswordOnly = getOptionValue(zipEntry, options, \"checkPasswordOnly\");\n\t\tif (checkPasswordOnly) {\n\t\t\twriter = new WritableStream();\n\t\t}\n\t\twriter = initWriter(writer);\n\t\tawait initStream(writer, passThrough ? compressedSize : uncompressedSize);\n\t\tconst { writable } = writer;\n\t\tconst { onstart, onprogress, onend } = options;\n\t\tconst workerOptions = {\n\t\t\toptions: {\n\t\t\t\tcodecType: CODEC_INFLATE,\n\t\t\t\tpassword,\n\t\t\t\trawPassword,\n\t\t\t\tzipCrypto,\n\t\t\t\tencryptionStrength: extraFieldAES && extraFieldAES.strength,\n\t\t\t\tsigned: getOptionValue(zipEntry, options, \"checkSignature\") && !passThrough,\n\t\t\t\tpasswordVerification: zipCrypto && (bitFlag.dataDescriptor ? ((rawLastModDate >>> 8) & 0xFF) : ((signature >>> 24) & 0xFF)),\n\t\t\t\tsignature,\n\t\t\t\tcompressed: compressionMethod != 0 && !passThrough,\n\t\t\t\tencrypted: zipEntry.encrypted && !passThrough,\n\t\t\t\tuseWebWorkers: getOptionValue(zipEntry, options, \"useWebWorkers\"),\n\t\t\t\tuseCompressionStream: getOptionValue(zipEntry, options, \"useCompressionStream\"),\n\t\t\t\ttransferStreams: getOptionValue(zipEntry, options, \"transferStreams\"),\n\t\t\t\tcheckPasswordOnly\n\t\t\t},\n\t\t\tconfig,\n\t\t\tstreamOptions: { signal, size, onstart, onprogress, onend }\n\t\t};\n\t\tlet outputSize = 0;\n\t\ttry {\n\t\t\t({ outputSize } = (await runWorker({ readable, writable }, workerOptions)));\n\t\t} catch (error) {\n\t\t\tif (!checkPasswordOnly || error.message != ERR_ABORT_CHECK_PASSWORD) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} finally {\n\t\t\tconst preventClose = getOptionValue(zipEntry, options, \"preventClose\");\n\t\t\twritable.size += outputSize;\n\t\t\tif (!preventClose && !writable.locked) {\n\t\t\t\tawait writable.getWriter().close();\n\t\t\t}\n\t\t}\n\t\treturn checkPasswordOnly ? UNDEFINED_VALUE : writer.getData ? writer.getData() : writable;\n\t}\n}\n\nfunction readCommonHeader(directory, dataView, offset) {\n\tconst rawBitFlag = directory.rawBitFlag = getUint16(dataView, offset + 2);\n\tconst encrypted = (rawBitFlag & BITFLAG_ENCRYPTED) == BITFLAG_ENCRYPTED;\n\tconst rawLastModDate = getUint32(dataView, offset + 6);\n\tObject.assign(directory, {\n\t\tencrypted,\n\t\tversion: getUint16(dataView, offset),\n\t\tbitFlag: {\n\t\t\tlevel: (rawBitFlag & BITFLAG_LEVEL) >> 1,\n\t\t\tdataDescriptor: (rawBitFlag & BITFLAG_DATA_DESCRIPTOR) == BITFLAG_DATA_DESCRIPTOR,\n\t\t\tlanguageEncodingFlag: (rawBitFlag & BITFLAG_LANG_ENCODING_FLAG) == BITFLAG_LANG_ENCODING_FLAG\n\t\t},\n\t\trawLastModDate,\n\t\tlastModDate: getDate(rawLastModDate),\n\t\tfilenameLength: getUint16(dataView, offset + 22),\n\t\textraFieldLength: getUint16(dataView, offset + 24)\n\t});\n}\n\nfunction readCommonFooter(fileEntry, directory, dataView, offset, localDirectory) {\n\tconst { rawExtraField } = directory;\n\tconst extraField = directory.extraField = new Map();\n\tconst rawExtraFieldView = getDataView(new Uint8Array(rawExtraField));\n\tlet offsetExtraField = 0;\n\ttry {\n\t\twhile (offsetExtraField < rawExtraField.length) {\n\t\t\tconst type = getUint16(rawExtraFieldView, offsetExtraField);\n\t\t\tconst size = getUint16(rawExtraFieldView, offsetExtraField + 2);\n\t\t\textraField.set(type, {\n\t\t\t\ttype,\n\t\t\t\tdata: rawExtraField.slice(offsetExtraField + 4, offsetExtraField + 4 + size)\n\t\t\t});\n\t\t\toffsetExtraField += 4 + size;\n\t\t}\n\t\t// eslint-disable-next-line no-unused-vars\n\t} catch (_) {\n\t\t// ignored\n\t}\n\tconst compressionMethod = getUint16(dataView, offset + 4);\n\tObject.assign(directory, {\n\t\tsignature: getUint32(dataView, offset + 10),\n\t\tuncompressedSize: getUint32(dataView, offset + 18),\n\t\tcompressedSize: getUint32(dataView, offset + 14)\n\t});\n\tconst extraFieldZip64 = extraField.get(EXTRAFIELD_TYPE_ZIP64);\n\tif (extraFieldZip64) {\n\t\treadExtraFieldZip64(extraFieldZip64, directory);\n\t\tdirectory.extraFieldZip64 = extraFieldZip64;\n\t}\n\tconst extraFieldUnicodePath = extraField.get(EXTRAFIELD_TYPE_UNICODE_PATH);\n\tif (extraFieldUnicodePath) {\n\t\treadExtraFieldUnicode(extraFieldUnicodePath, PROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, directory, fileEntry);\n\t\tdirectory.extraFieldUnicodePath = extraFieldUnicodePath;\n\t}\n\tconst extraFieldUnicodeComment = extraField.get(EXTRAFIELD_TYPE_UNICODE_COMMENT);\n\tif (extraFieldUnicodeComment) {\n\t\treadExtraFieldUnicode(extraFieldUnicodeComment, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT, directory, fileEntry);\n\t\tdirectory.extraFieldUnicodeComment = extraFieldUnicodeComment;\n\t}\n\tconst extraFieldAES = extraField.get(EXTRAFIELD_TYPE_AES);\n\tif (extraFieldAES) {\n\t\treadExtraFieldAES(extraFieldAES, directory, compressionMethod);\n\t\tdirectory.extraFieldAES = extraFieldAES;\n\t} else {\n\t\tdirectory.compressionMethod = compressionMethod;\n\t}\n\tconst extraFieldNTFS = extraField.get(EXTRAFIELD_TYPE_NTFS);\n\tif (extraFieldNTFS) {\n\t\treadExtraFieldNTFS(extraFieldNTFS, directory);\n\t\tdirectory.extraFieldNTFS = extraFieldNTFS;\n\t}\n\tconst extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);\n\tif (extraFieldExtendedTimestamp) {\n\t\treadExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory, localDirectory);\n\t\tdirectory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;\n\t}\n\tconst extraFieldUSDZ = extraField.get(EXTRAFIELD_TYPE_USDZ);\n\tif (extraFieldUSDZ) {\n\t\tdirectory.extraFieldUSDZ = extraFieldUSDZ;\n\t}\n}\n\nfunction readExtraFieldZip64(extraFieldZip64, directory) {\n\tdirectory.zip64 = true;\n\tconst extraFieldView = getDataView(extraFieldZip64.data);\n\tconst missingProperties = ZIP64_PROPERTIES.filter(([propertyName, max]) => directory[propertyName] == max);\n\tfor (let indexMissingProperty = 0, offset = 0; indexMissingProperty < missingProperties.length; indexMissingProperty++) {\n\t\tconst [propertyName, max] = missingProperties[indexMissingProperty];\n\t\tif (directory[propertyName] == max) {\n\t\t\tconst extraction = ZIP64_EXTRACTION[max];\n\t\t\tdirectory[propertyName] = extraFieldZip64[propertyName] = extraction.getValue(extraFieldView, offset);\n\t\t\toffset += extraction.bytes;\n\t\t} else if (extraFieldZip64[propertyName]) {\n\t\t\tthrow new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);\n\t\t}\n\t}\n}\n\nfunction readExtraFieldUnicode(extraFieldUnicode, propertyName, rawPropertyName, directory, fileEntry) {\n\tconst extraFieldView = getDataView(extraFieldUnicode.data);\n\tconst crc32 = new Crc32();\n\tcrc32.append(fileEntry[rawPropertyName]);\n\tconst dataViewSignature = getDataView(new Uint8Array(4));\n\tdataViewSignature.setUint32(0, crc32.get(), true);\n\tconst signature = getUint32(extraFieldView, 1);\n\tObject.assign(extraFieldUnicode, {\n\t\tversion: getUint8(extraFieldView, 0),\n\t\t[propertyName]: decodeText(extraFieldUnicode.data.subarray(5)),\n\t\tvalid: !fileEntry.bitFlag.languageEncodingFlag && signature == getUint32(dataViewSignature, 0)\n\t});\n\tif (extraFieldUnicode.valid) {\n\t\tdirectory[propertyName] = extraFieldUnicode[propertyName];\n\t\tdirectory[propertyName + \"UTF8\"] = true;\n\t}\n}\n\nfunction readExtraFieldAES(extraFieldAES, directory, compressionMethod) {\n\tconst extraFieldView = getDataView(extraFieldAES.data);\n\tconst strength = getUint8(extraFieldView, 4);\n\tObject.assign(extraFieldAES, {\n\t\tvendorVersion: getUint8(extraFieldView, 0),\n\t\tvendorId: getUint8(extraFieldView, 2),\n\t\tstrength,\n\t\toriginalCompressionMethod: compressionMethod,\n\t\tcompressionMethod: getUint16(extraFieldView, 5)\n\t});\n\tdirectory.compressionMethod = extraFieldAES.compressionMethod;\n}\n\nfunction readExtraFieldNTFS(extraFieldNTFS, directory) {\n\tconst extraFieldView = getDataView(extraFieldNTFS.data);\n\tlet offsetExtraField = 4;\n\tlet tag1Data;\n\ttry {\n\t\twhile (offsetExtraField < extraFieldNTFS.data.length && !tag1Data) {\n\t\t\tconst tagValue = getUint16(extraFieldView, offsetExtraField);\n\t\t\tconst attributeSize = getUint16(extraFieldView, offsetExtraField + 2);\n\t\t\tif (tagValue == EXTRAFIELD_TYPE_NTFS_TAG1) {\n\t\t\t\ttag1Data = extraFieldNTFS.data.slice(offsetExtraField + 4, offsetExtraField + 4 + attributeSize);\n\t\t\t}\n\t\t\toffsetExtraField += 4 + attributeSize;\n\t\t}\n\t\t// eslint-disable-next-line no-unused-vars\n\t} catch (_) {\n\t\t// ignored\n\t}\n\ttry {\n\t\tif (tag1Data && tag1Data.length == 24) {\n\t\t\tconst tag1View = getDataView(tag1Data);\n\t\t\tconst rawLastModDate = tag1View.getBigUint64(0, true);\n\t\t\tconst rawLastAccessDate = tag1View.getBigUint64(8, true);\n\t\t\tconst rawCreationDate = tag1View.getBigUint64(16, true);\n\t\t\tObject.assign(extraFieldNTFS, {\n\t\t\t\trawLastModDate,\n\t\t\t\trawLastAccessDate,\n\t\t\t\trawCreationDate\n\t\t\t});\n\t\t\tconst lastModDate = getDateNTFS(rawLastModDate);\n\t\t\tconst lastAccessDate = getDateNTFS(rawLastAccessDate);\n\t\t\tconst creationDate = getDateNTFS(rawCreationDate);\n\t\t\tconst extraFieldData = { lastModDate, lastAccessDate, creationDate };\n\t\t\tObject.assign(extraFieldNTFS, extraFieldData);\n\t\t\tObject.assign(directory, extraFieldData);\n\t\t}\n\t\t// eslint-disable-next-line no-unused-vars\n\t} catch (_) {\n\t\t// ignored\n\t}\n}\n\nfunction readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory, localDirectory) {\n\tconst extraFieldView = getDataView(extraFieldExtendedTimestamp.data);\n\tconst flags = getUint8(extraFieldView, 0);\n\tconst timeProperties = [];\n\tconst timeRawProperties = [];\n\tif (localDirectory) {\n\t\tif ((flags & 0x1) == 0x1) {\n\t\t\ttimeProperties.push(PROPERTY_NAME_LAST_MODIFICATION_DATE);\n\t\t\ttimeRawProperties.push(PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE);\n\t\t}\n\t\tif ((flags & 0x2) == 0x2) {\n\t\t\ttimeProperties.push(PROPERTY_NAME_LAST_ACCESS_DATE);\n\t\t\ttimeRawProperties.push(PROPERTY_NAME_RAW_LAST_ACCESS_DATE);\n\t\t}\n\t\tif ((flags & 0x4) == 0x4) {\n\t\t\ttimeProperties.push(PROPERTY_NAME_CREATION_DATE);\n\t\t\ttimeRawProperties.push(PROPERTY_NAME_RAW_CREATION_DATE);\n\t\t}\n\t} else if (extraFieldExtendedTimestamp.data.length >= 5) {\n\t\ttimeProperties.push(PROPERTY_NAME_LAST_MODIFICATION_DATE);\n\t\ttimeRawProperties.push(PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE);\n\t}\n\tlet offset = 1;\n\ttimeProperties.forEach((propertyName, indexProperty) => {\n\t\tif (extraFieldExtendedTimestamp.data.length >= offset + 4) {\n\t\t\tconst time = getUint32(extraFieldView, offset);\n\t\t\tdirectory[propertyName] = extraFieldExtendedTimestamp[propertyName] = new Date(time * 1000);\n\t\t\tconst rawPropertyName = timeRawProperties[indexProperty];\n\t\t\textraFieldExtendedTimestamp[rawPropertyName] = time;\n\t\t}\n\t\toffset += 4;\n\t});\n}\n\nasync function seekSignature(reader, signature, startOffset, minimumBytes, maximumLength) {\n\tconst signatureArray = new Uint8Array(4);\n\tconst signatureView = getDataView(signatureArray);\n\tsetUint32(signatureView, 0, signature);\n\tconst maximumBytes = minimumBytes + maximumLength;\n\treturn (await seek(minimumBytes)) || await seek(Math.min(maximumBytes, startOffset));\n\n\tasync function seek(length) {\n\t\tconst offset = startOffset - length;\n\t\tconst bytes = await readUint8Array(reader, offset, length);\n\t\tfor (let indexByte = bytes.length - minimumBytes; indexByte >= 0; indexByte--) {\n\t\t\tif (bytes[indexByte] == signatureArray[0] && bytes[indexByte + 1] == signatureArray[1] &&\n\t\t\t\tbytes[indexByte + 2] == signatureArray[2] && bytes[indexByte + 3] == signatureArray[3]) {\n\t\t\t\treturn {\n\t\t\t\t\toffset: offset + indexByte,\n\t\t\t\t\tbuffer: bytes.slice(indexByte, indexByte + minimumBytes).buffer\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getOptionValue(zipReader, options, name) {\n\treturn options[name] === UNDEFINED_VALUE ? zipReader.options[name] : options[name];\n}\n\nfunction getDate(timeRaw) {\n\tconst date = (timeRaw & 0xffff0000) >> 16, time = timeRaw & 0x0000ffff;\n\ttry {\n\t\treturn new Date(1980 + ((date & 0xFE00) >> 9), ((date & 0x01E0) >> 5) - 1, date & 0x001F, (time & 0xF800) >> 11, (time & 0x07E0) >> 5, (time & 0x001F) * 2, 0);\n\t\t// eslint-disable-next-line no-unused-vars\n\t} catch (_) {\n\t\t// ignored\n\t}\n}\n\nfunction getDateNTFS(timeRaw) {\n\treturn new Date((Number((timeRaw / BigInt(10000)) - BigInt(11644473600000))));\n}\n\nfunction getUint8(view, offset) {\n\treturn view.getUint8(offset);\n}\n\nfunction getUint16(view, offset) {\n\treturn view.getUint16(offset, true);\n}\n\nfunction getUint32(view, offset) {\n\treturn view.getUint32(offset, true);\n}\n\nfunction getBigUint64(view, offset) {\n\treturn Number(view.getBigUint64(offset, true));\n}\n\nfunction setUint32(view, offset, value) {\n\tview.setUint32(offset, value, true);\n}\n\nfunction getDataView(array) {\n\treturn new DataView(array.buffer);\n}\n","/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport { configure } from \"./core/configuration.js\";\nimport { configureWebWorker } from \"./z-worker-inline.js\";\nimport { getMimeType } from \"./core/util/default-mime-type.js\";\nimport { initShimAsyncCodec } from \"./core/util/stream-codec-shim.js\";\nimport { terminateWorkers } from \"./core/codec-pool.js\";\n\nlet baseURL;\ntry {\n\tbaseURL = import.meta.url;\n\t// eslint-disable-next-line no-unused-vars\n} catch (_) {\n\t// ignored\n}\nconfigure({ baseURL });\nconfigureWebWorker(configure);\n\nexport * from \"./core/io.js\";\nexport * from \"./core/zip-reader.js\";\nexport * from \"./core/zip-writer.js\";\nexport * from \"./core/zip-fs-core.js\";\nexport {\n\tconfigure,\n\tgetMimeType,\n\tinitShimAsyncCodec,\n\tterminateWorkers\n};\n","/// <reference types=\"./index.d.ts\" />\n\n/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport { Deflate } from \"./lib/core/streams/codecs/deflate.js\";\nimport { Inflate } from \"./lib/core/streams/codecs/inflate.js\";\nimport { configure } from \"./lib/core/configuration.js\";\nimport { getMimeType } from \"./lib/core/util/mime-type.js\";\nimport { terminateWorkers } from \"./lib/core/codec-pool.js\";\n\nconfigure({ Deflate, Inflate });\n\nexport {\n\tfs,\n\tconfigure,\n\tinitShimAsyncCodec,\n\tZipReader,\n\tZipWriter,\n\tZipReaderStream,\n\tZipWriterStream,\n\tReader,\n\tWriter,\n\tTextReader,\n\tTextWriter,\n\tData64URIReader,\n\tData64URIWriter,\n\tBlobReader,\n\tBlobWriter,\n\tHttpReader,\n\tHttpRangeReader,\n\tUint8ArrayWriter,\n\tUint8ArrayReader,\n\tSplitZipReader,\n\tSplitZipWriter,\n\tSplitDataReader,\n\tSplitDataWriter,\n\tERR_HTTP_RANGE,\n\tERR_BAD_FORMAT,\n\tERR_EOCDR_NOT_FOUND,\n\tERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,\n\tERR_CENTRAL_DIRECTORY_NOT_FOUND,\n\tERR_LOCAL_FILE_HEADER_NOT_FOUND,\n\tERR_EXTRAFIELD_ZIP64_NOT_FOUND,\n\tERR_ENCRYPTED,\n\tERR_UNSUPPORTED_ENCRYPTION,\n\tERR_UNSUPPORTED_COMPRESSION,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD,\n\tERR_DUPLICATED_NAME,\n\tERR_INVALID_COMMENT,\n\tERR_INVALID_ENTRY_NAME,\n\tERR_INVALID_ENTRY_COMMENT,\n\tERR_INVALID_VERSION,\n\tERR_INVALID_EXTRAFIELD_TYPE,\n\tERR_INVALID_EXTRAFIELD_DATA,\n\tERR_INVALID_ENCRYPTION_STRENGTH,\n\tERR_UNSUPPORTED_FORMAT,\n\tERR_UNDEFINED_UNCOMPRESSED_SIZE,\n\tERR_SPLIT_ZIP_FILE,\n\tERR_ITERATOR_COMPLETED_TOO_SOON\n} from \"./lib/zip-fs.js\";\nexport { getMimeType, terminateWorkers };\n","import { StreamedFile } from '@php-wasm/stream-compression';\nimport type { FileTree } from '@php-wasm/universal';\nimport { normalizePath } from '@php-wasm/util';\nimport type { Entry } from '@zip.js/zip.js';\nimport { ZipReader, BlobWriter, BlobReader } from '@zip.js/zip.js';\n\nexport interface Filesystem {\n\tread(path: string): Promise<StreamedFile>;\n}\n\nexport class InMemoryFilesystem implements Filesystem {\n\tprivate fileTree: FileTree;\n\n\tconstructor(fileTree: FileTree) {\n\t\tthis.fileTree = fileTree;\n\t}\n\n\tasync read(path: string): Promise<StreamedFile> {\n\t\tlet content = this.getEntryAtPath(path);\n\t\tif (typeof content === 'string') {\n\t\t\tcontent = new TextEncoder().encode(content);\n\t\t} else if (!(content instanceof Uint8Array)) {\n\t\t\tthrow new Error(`Unsupported content type: ${typeof content}`);\n\t\t}\n\t\tconst stream = new ReadableStream({\n\t\t\tstart(controller) {\n\t\t\t\tcontroller.enqueue(content);\n\t\t\t\tcontroller.close();\n\t\t\t},\n\t\t});\n\t\treturn new StreamedFile(stream, path, {\n\t\t\tfilesize: content.byteLength,\n\t\t});\n\t}\n\n\tprivate getEntryAtPath(path: string): Uint8Array | string | FileTree {\n\t\tlet remainingPath = path.replace(/^\\//, '');\n\t\tlet currentSubtree = this.fileTree;\n\t\twhile (remainingPath) {\n\t\t\tif (currentSubtree[remainingPath]) {\n\t\t\t\treturn currentSubtree[remainingPath];\n\t\t\t}\n\t\t\tconst segments = remainingPath.split('/');\n\t\t\tconst nextSegment = segments.shift();\n\t\t\tif (!nextSegment || !currentSubtree[nextSegment]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrentSubtree = currentSubtree[nextSegment] as FileTree;\n\t\t\tremainingPath = segments.join('/');\n\t\t}\n\t\tthrow new Error(`File not found at ${path}`);\n\t}\n}\n\nexport class ZipFilesystem implements Filesystem {\n\tprivate entries: Map<string, Entry> = new Map();\n\tprivate zipReader: ZipReader<BlobReader>;\n\n\tstatic fromStream(stream: ReadableStream<Uint8Array>): ZipFilesystem {\n\t\tconst zipReader = new ZipReader(\n\t\t\tnew BlobReader(new StreamedFile(stream, 'archive.zip'))\n\t\t);\n\t\treturn new ZipFilesystem(zipReader);\n\t}\n\n\tstatic fromArrayBuffer(arrayBuffer: ArrayBuffer): ZipFilesystem {\n\t\tconst zipReader = new ZipReader(\n\t\t\tnew BlobReader(new Blob([arrayBuffer]))\n\t\t);\n\t\treturn new ZipFilesystem(zipReader);\n\t}\n\n\tconstructor(zipReader: ZipReader<BlobReader>) {\n\t\tthis.zipReader = zipReader;\n\t}\n\n\tasync read(relativePath: string): Promise<StreamedFile> {\n\t\tconst entry = await this.getEntry(relativePath);\n\t\tconst blob = await entry.getData!(new BlobWriter());\n\t\treturn new StreamedFile(blob.stream(), relativePath, {\n\t\t\tfilesize: entry.uncompressedSize,\n\t\t});\n\t}\n\n\tprivate async getEntry(relativePath: string): Promise<Entry> {\n\t\tconst entries = await this.getEntries();\n\t\tconst entry = entries.get(relativePath.replace(/^\\//, ''));\n\t\tif (!entry) {\n\t\t\tthrow new Error(`File ${relativePath} not found in the zip.`);\n\t\t}\n\t\treturn entry;\n\t}\n\n\tprivate async getEntries(): Promise<Map<string, Entry>> {\n\t\tif (this.entries.size === 0) {\n\t\t\tconst entries = await this.zipReader.getEntries();\n\t\t\tfor (const entry of entries) {\n\t\t\t\tthis.entries.set(entry.filename, entry);\n\t\t\t}\n\t\t}\n\t\treturn this.entries;\n\t}\n}\n\n/**\n * A Filesystem implementation that cascades through multiple filesystems\n * and returns the first successful result.\n *\n * This is useful for creating a layered approach to file resolution,\n * such as checking a local cache before fetching from a remote source.\n */\nexport class OverlayFilesystem implements Filesystem {\n\tprivate filesystems: Filesystem[];\n\n\t/**\n\t * Creates a new OverlayFilesystem.\n\t *\n\t * @param filesystems An array of Filesystem instances to cascade through.\n\t * The order determines the priority - earlier filesystems\n\t * are checked first.\n\t */\n\tconstructor(filesystems: Filesystem[]) {\n\t\tif (!filesystems.length) {\n\t\t\tthrow new Error(\n\t\t\t\t'OverlayFilesystem requires at least one filesystem'\n\t\t\t);\n\t\t}\n\t\tthis.filesystems = filesystems;\n\t}\n\n\t/**\n\t * Reads a file by trying each filesystem in order until one succeeds.\n\t *\n\t * @param path The path to the file to read.\n\t * @returns A Promise that resolves to a StreamedFile from the first\n\t * filesystem that successfully resolves the path.\n\t * @throws Error if all filesystems fail to resolve the path.\n\t */\n\tasync read(path: string): Promise<StreamedFile> {\n\t\tconst errors: Error[] = [];\n\n\t\t// Try each filesystem in order\n\t\tfor (const filesystem of this.filesystems) {\n\t\t\ttry {\n\t\t\t\treturn await filesystem.read(path);\n\t\t\t} catch (error) {\n\t\t\t\t// Collect the error and continue to the next filesystem\n\t\t\t\terrors.push(\n\t\t\t\t\terror instanceof Error ? error : new Error(String(error))\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we get here, all filesystems failed\n\t\tconst errorMessages = errors.map((e) => e.message).join('; ');\n\t\tthrow new Error(\n\t\t\t`Failed to read ${path} from any filesystem: ${errorMessages}`,\n\t\t\t{ cause: errors }\n\t\t);\n\t}\n}\n\nexport interface FetchFilesystemOptions {\n\tcorsProxy?: string;\n\tbaseUrl: string;\n}\n\n/**\n * A Filesystem implementation that fetches files from URLs.\n * It can optionally use a CORS proxy and resolve paths relative to a base URL.\n */\nexport class FetchFilesystem implements Filesystem {\n\tprivate baseUrl = '';\n\tprivate options: FetchFilesystemOptions;\n\tprivate isDataUrl: boolean;\n\n\tconstructor(options: FetchFilesystemOptions) {\n\t\tthis.options = options;\n\t\tthis.isDataUrl = options.baseUrl.startsWith('data:');\n\t\tif (this.isDataUrl) {\n\t\t\treturn;\n\t\t}\n\t\t// Ensure the base URL ends with a slash\n\t\tconst url = new URL('./', options.baseUrl);\n\t\tif (url.protocol !== 'http:' && url.protocol !== 'https:') {\n\t\t\tthrow new Error(\n\t\t\t\t'Unsupported protocol: ' +\n\t\t\t\t\turl.protocol +\n\t\t\t\t\t'. Only HTTP and HTTPS are supported.'\n\t\t\t);\n\t\t}\n\t\tthis.baseUrl = url.origin + url.pathname;\n\t}\n\n\tasync read(path: string): Promise<StreamedFile> {\n\t\tif (this.isDataUrl) {\n\t\t\tthrow new Error(\n\t\t\t\t'FetchFilesystem cannot fetch files from data URLs'\n\t\t\t);\n\t\t}\n\n\t\t// Make sure there's no .. segments in the path\n\t\tpath = normalizePath(path);\n\t\t// Prevent escaping the base URL\n\t\tconst cleanPath = path.replace(/^\\//, '');\n\n\t\t// Resolve path to a URL\n\t\tconst url = new URL(cleanPath, this.baseUrl).toString();\n\t\tif (!url.startsWith(this.baseUrl)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Refused to read a file outside of the base URL: ${url}`\n\t\t\t);\n\t\t}\n\n\t\t// Apply CORS proxy if configured\n\t\tconst finalUrl = this.options.corsProxy\n\t\t\t? `${this.options.corsProxy}${encodeURIComponent(url)}`\n\t\t\t: url;\n\n\t\t// Fetch the file\n\t\tconst response = await fetch(finalUrl);\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to fetch file at ${path}: ${response.statusText}`\n\t\t\t);\n\t\t}\n\n\t\t// Get the content length if available\n\t\tconst filesize = response.headers.get('content-length')\n\t\t\t? parseInt(response.headers.get('content-length')!, 10)\n\t\t\t: undefined;\n\n\t\t// Return as a StreamedFile\n\t\treturn new StreamedFile(response.body!, path, { filesize });\n\t}\n}\n\n/**\n * A Filesystem implementation that uses the \"fs\" and \"path\" modules from Node.js\n * to read files from the local file system.\n *\n * This is only available in a local environment.\n */\nexport class NodeJsFilesystem implements Filesystem {\n\tprivate fs: any;\n\tprivate path: any;\n\tprivate root: string;\n\n\tconstructor(root: string) {\n\t\tthis.root = root;\n\t}\n\n\tprivate async ensureNodeModules() {\n\t\tif (!this.fs || !this.path) {\n\t\t\ttry {\n\t\t\t\tthis.fs = await import('fs');\n\t\t\t\tthis.path = await import('path');\n\t\t\t} catch {\n\t\t\t\tthis.fs = require('fs');\n\t\t\t\tthis.path = require('path');\n\t\t\t}\n\t\t\tthis.root = this.path.resolve(this.root) + this.path.sep;\n\t\t}\n\t}\n\n\tasync read(filePath: string): Promise<StreamedFile> {\n\t\tawait this.ensureNodeModules();\n\n\t\tfilePath = this.path.resolve(\n\t\t\tthis.root,\n\t\t\tthis.path.normalize(filePath.replace(/^\\//, ''))\n\t\t);\n\t\tif (!filePath.startsWith(this.root)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Refused to read a file outside of the root directory: ${filePath}`\n\t\t\t);\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst fullPath = this.path.resolve(filePath);\n\t\t\tconst stream = this.fs.createReadStream(fullPath);\n\n\t\t\tstream.on('error', (err: any) => {\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read file at ${filePath}: ${err.message}`\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tthis.fs.stat(fullPath, (err: any, stats: any) => {\n\t\t\t\tif (err) {\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Failed to read file at ${filePath}: ${err.message}`\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tnew StreamedFile(\n\t\t\t\t\t\t\tnodeStreamToReadableStream(stream),\n\t\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfilesize: stats.size,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\nfunction nodeStreamToReadableStream(stream: any): ReadableStream {\n\tconst readableStream = new ReadableStream({\n\t\tstart(controller) {\n\t\t\tstream.on('data', (chunk: Buffer) => controller.enqueue(chunk));\n\t\t\tstream.on('end', () => controller.close());\n\t\t},\n\t});\n\treturn readableStream;\n}\n","import fs from 'fs';\nimport path from 'path';\nimport {\n\tZipFilesystem,\n\tNodeJsFilesystem,\n\tOverlayFilesystem,\n\tInMemoryFilesystem,\n} from '@wp-playground/storage';\nimport { resolveRemoteBlueprint } from '@wp-playground/blueprints';\nimport { ReportableError } from './reportable-error';\n\ntype ResolveBlueprintOptions = {\n\tsourceString: string | undefined;\n\tblueprintMayReadAdjacentFiles: boolean;\n};\n\n/**\n * Resolves a blueprint from a URL or a local path.\n *\n * @TODO: Extract the common Blueprint resolution logic between CLI and\n * the website into a single, isomorphic resolveBlueprint() function.\n * Still retain the CLI-specific bits in the CLI package.\n *\n * @param sourceString - The source string to resolve the blueprint from.\n * @param blueprintMayReadAdjacentFiles - Whether the blueprint may read adjacent files.\n * @returns The resolved blueprint.\n */\nexport async function resolveBlueprint({\n\tsourceString,\n\tblueprintMayReadAdjacentFiles,\n}: ResolveBlueprintOptions) {\n\tif (!sourceString) {\n\t\treturn undefined;\n\t}\n\n\tif (\n\t\tsourceString.startsWith('http://') ||\n\t\tsourceString.startsWith('https://')\n\t) {\n\t\treturn await resolveRemoteBlueprint(sourceString);\n\t}\n\n\t// If the sourceString does not refer to a remote blueprint, try to\n\t// resolve it from a local filesystem.\n\n\tlet blueprintPath = path.resolve(process.cwd(), sourceString);\n\tif (!fs.existsSync(blueprintPath)) {\n\t\tthrow new Error(`Blueprint file does not exist: ${blueprintPath}`);\n\t}\n\n\tconst stat = fs.statSync(blueprintPath);\n\tif (stat.isDirectory()) {\n\t\tblueprintPath = path.join(blueprintPath, 'blueprint.json');\n\t}\n\n\tif (!stat.isFile() && stat.isSymbolicLink()) {\n\t\tthrow new Error(\n\t\t\t`Blueprint path is neither a file nor a directory: ${blueprintPath}`\n\t\t);\n\t}\n\n\tconst extension = path.extname(blueprintPath);\n\tswitch (extension) {\n\t\tcase '.zip':\n\t\t\treturn ZipFilesystem.fromArrayBuffer(\n\t\t\t\tfs.readFileSync(blueprintPath)\n\t\t\t);\n\t\tcase '.json': {\n\t\t\tconst blueprintText = fs.readFileSync(blueprintPath, 'utf-8');\n\t\t\ttry {\n\t\t\t\tJSON.parse(blueprintText);\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Blueprint file at ${blueprintPath} is not a valid JSON file`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst contextPath = path.dirname(blueprintPath);\n\t\t\tconst nodeJsFilesystem = new NodeJsFilesystem(contextPath);\n\t\t\treturn new OverlayFilesystem([\n\t\t\t\tnew InMemoryFilesystem({\n\t\t\t\t\t'blueprint.json': blueprintText,\n\t\t\t\t}),\n\t\t\t\t/**\n\t\t\t\t * Wrap the NodeJS filesystem to prevent access to local files\n\t\t\t\t * unless the user explicitly allowed it.\n\t\t\t\t */\n\t\t\t\t{\n\t\t\t\t\tread(path) {\n\t\t\t\t\t\tif (!blueprintMayReadAdjacentFiles) {\n\t\t\t\t\t\t\tthrow new ReportableError(\n\t\t\t\t\t\t\t\t`Error: Blueprint contained tried to read a local file at path \"${path}\" (via a resource of type \"bundled\"). ` +\n\t\t\t\t\t\t\t\t\t`Playground restricts access to local resources by default as a security measure. \\n\\n` +\n\t\t\t\t\t\t\t\t\t`You can allow this Blueprint to read files from the same parent directory by explicitly adding the ` +\n\t\t\t\t\t\t\t\t\t`--blueprint-may-read-adjacent-files option to your command.`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn nodeJsFilesystem.read(path);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t`Unsupported blueprint file extension: ${extension}. Only .zip and .json files are supported.`\n\t\t\t);\n\t}\n}\n","import { errorLogPath, logger } from '@php-wasm/logger';\nimport { EmscriptenDownloadMonitor, ProgressTracker } from '@php-wasm/progress';\nimport type {\n\tPHPRequest,\n\tRemoteAPI,\n\tSupportedPHPVersion,\n} from '@php-wasm/universal';\nimport {\n\tPHPResponse,\n\tconsumeAPI,\n\texposeAPI,\n\texposeSyncAPI,\n} from '@php-wasm/universal';\nimport type {\n\tBlueprintBundle,\n\tBlueprintDeclaration,\n} from '@wp-playground/blueprints';\nimport {\n\tcompileBlueprint,\n\tisBlueprintBundle,\n\trunBlueprintSteps,\n} from '@wp-playground/blueprints';\nimport {\n\tRecommendedPHPVersion,\n\tunzipFile,\n\tzipDirectory,\n} from '@wp-playground/common';\nimport fs from 'fs';\nimport type { Server } from 'http';\nimport path from 'path';\nimport { Worker, MessageChannel } from 'worker_threads';\n// @ts-ignore\nimport { resolveWordPressRelease } from '@wp-playground/wordpress';\nimport { expandAutoMounts } from './cli-auto-mount';\nimport {\n\tCACHE_FOLDER,\n\tcachedDownload,\n\tfetchSqliteIntegration,\n\treadAsFile,\n} from './download';\nimport { startServer } from './server';\nimport type { Mount, PlaygroundCliWorker } from './worker-thread';\n// @ts-ignore\nimport importedWorkerUrlString from './worker-thread?worker&url';\n// @ts-ignore\nimport { FileLockManagerForNode } from '@php-wasm/node';\nimport { LoadBalancer } from './load-balancer';\n/* eslint-disable no-console */\nimport { SupportedPHPVersions } from '@php-wasm/universal';\nimport { cpus } from 'os';\nimport { jspi } from 'wasm-feature-detect';\nimport type { MessagePort as NodeMessagePort } from 'worker_threads';\nimport yargs from 'yargs';\nimport { isValidWordPressSlug } from './is-valid-wordpress-slug';\nimport {\n\tparseMountDirArguments,\n\tparseMountWithDelimiterArguments,\n} from './mount';\nimport { ReportableError } from './reportable-error';\nimport { resolveBlueprint } from './resolve-blueprint';\n\nexport async function parseOptionsAndRunCLI() {\n\t/**\n\t * @TODO This looks similar to Query API args https://wordpress.github.io/wordpress-playground/developers/apis/query-api/\n\t * Perhaps the two could be handled by the same code?\n\t */\n\tconst yargsObject = yargs(process.argv.slice(2))\n\t\t.usage('Usage: wp-playground <command> [options]')\n\t\t.positional('command', {\n\t\t\tdescribe: 'Command to run',\n\t\t\tchoices: ['server', 'run-blueprint', 'build-snapshot'] as const,\n\t\t\tdemandOption: true,\n\t\t})\n\t\t.option('outfile', {\n\t\t\tdescribe: 'When building, write to this output file.',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'wordpress.zip',\n\t\t})\n\t\t.option('port', {\n\t\t\tdescribe: 'Port to listen on when serving.',\n\t\t\ttype: 'number',\n\t\t\tdefault: 9400,\n\t\t})\n\t\t.option('php', {\n\t\t\tdescribe: 'PHP version to use.',\n\t\t\ttype: 'string',\n\t\t\tdefault: RecommendedPHPVersion,\n\t\t\tchoices: SupportedPHPVersions,\n\t\t})\n\t\t.option('wp', {\n\t\t\tdescribe: 'WordPress version to use.',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'latest',\n\t\t})\n\t\t// @TODO: Support read-only mounts, e.g. via WORKERFS, a custom\n\t\t// ReadOnlyNODEFS, or by copying the files into MEMFS\n\t\t.option('mount', {\n\t\t\tdescribe:\n\t\t\t\t'Mount a directory to the PHP runtime (can be used multiple times). Format: /host/path:/vfs/path',\n\t\t\ttype: 'array',\n\t\t\tstring: true,\n\t\t\tcoerce: parseMountWithDelimiterArguments,\n\t\t})\n\t\t.option('mount-before-install', {\n\t\t\tdescribe:\n\t\t\t\t'Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: /host/path:/vfs/path',\n\t\t\ttype: 'array',\n\t\t\tstring: true,\n\t\t\tcoerce: parseMountWithDelimiterArguments,\n\t\t})\n\t\t.option('mount-dir', {\n\t\t\tdescribe:\n\t\t\t\t'Mount a directory to the PHP runtime (can be used multiple times). Format: \"/host/path\" \"/vfs/path\"',\n\t\t\ttype: 'array',\n\t\t\tnargs: 2,\n\t\t\tarray: true,\n\t\t\t// coerce: parseMountDirArguments,\n\t\t})\n\t\t.option('mount-dir-before-install', {\n\t\t\tdescribe:\n\t\t\t\t'Mount a directory before WordPress installation (can be used multiple times). Format: \"/host/path\" \"/vfs/path\"',\n\t\t\ttype: 'string',\n\t\t\tnargs: 2,\n\t\t\tarray: true,\n\t\t\tcoerce: parseMountDirArguments,\n\t\t})\n\t\t.option('login', {\n\t\t\tdescribe: 'Should log the user in',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('blueprint', {\n\t\t\tdescribe: 'Blueprint to execute.',\n\t\t\ttype: 'string',\n\t\t})\n\t\t.option('blueprint-may-read-adjacent-files', {\n\t\t\tdescribe:\n\t\t\t\t'Consent flag: Allow \"bundled\" resources in a local blueprint to read files in the same directory as the blueprint file.',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('skip-wordpress-setup', {\n\t\t\tdescribe:\n\t\t\t\t'Do not download, unzip, and install WordPress. Useful for mounting a pre-configured WordPress directory at /wordpress.',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('skip-sqlite-setup', {\n\t\t\tdescribe:\n\t\t\t\t'Skip the SQLite integration plugin setup to allow the WordPress site to use MySQL.',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('quiet', {\n\t\t\tdescribe: 'Do not output logs and progress messages.',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('debug', {\n\t\t\tdescribe:\n\t\t\t\t'Print PHP error log content if an error occurs during Playground boot.',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('auto-mount', {\n\t\t\tdescribe: `Automatically mount the current working directory. You can mount a WordPress directory, a plugin directory, a theme directory, a wp-content directory, or any directory containing PHP and HTML files.`,\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('follow-symlinks', {\n\t\t\tdescribe:\n\t\t\t\t'Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted directories. \\nWarning: Following symlinks will expose files outside mounted directories to Playground and could be a security risk.',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t.option('experimentalTrace', {\n\t\t\tdescribe:\n\t\t\t\t'Print detailed messages about system behavior to the console. Useful for troubleshooting.',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\t// Hide this option because we want to replace with a more general log-level flag.\n\t\t\thidden: true,\n\t\t})\n\t\t.option('internal-cookie-store', {\n\t\t\tdescribe:\n\t\t\t\t'Enable internal cookie handling. When enabled, Playground will manage cookies internally using ' +\n\t\t\t\t'an HttpCookieStore that persists cookies across requests. When disabled, cookies are handled ' +\n\t\t\t\t'externally (e.g., by a browser in Node.js environments).',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t})\n\t\t// TODO: Should we make this a hidden flag?\n\t\t.option('experimentalMultiWorker', {\n\t\t\tdescribe:\n\t\t\t\t'Enable experimental multi-worker support which requires JSPI ' +\n\t\t\t\t'and a /wordpress directory backed by a real filesystem. ' +\n\t\t\t\t'Pass a positive number to specify the number of workers to use. ' +\n\t\t\t\t'Otherwise, default to the number of CPUs minus 1.',\n\t\t\ttype: 'number',\n\t\t\tcoerce: (value?: number) => value ?? cpus().length - 1,\n\t\t})\n\t\t.showHelpOnFail(false)\n\t\t.check(async (args) => {\n\t\t\tif (args.wp !== undefined && !isValidWordPressSlug(args.wp)) {\n\t\t\t\ttry {\n\t\t\t\t\t// Check if is valid URL\n\t\t\t\t\tnew URL(args.wp);\n\t\t\t\t} catch {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Unrecognized WordPress version. Please use \"latest\", a URL, or a numeric version such as \"6.2\", \"6.0.1\", \"6.2-beta1\", or \"6.2-RC1\"'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (args.experimentalMultiWorker !== undefined) {\n\t\t\t\tif (args.experimentalMultiWorker <= 1) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'The --experimentalMultiWorker flag must be a positive integer greater than 1.'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst isMountingWordPressDir = (mount: Mount) =>\n\t\t\t\t\tmount.vfsPath === '/wordpress';\n\t\t\t\tif (\n\t\t\t\t\t!args.mount?.some(isMountingWordPressDir) &&\n\t\t\t\t\t!(args['mountBeforeInstall'] as any)?.some(\n\t\t\t\t\t\tisMountingWordPressDir\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Please mount a real filesystem directory as the /wordpress directory before using the --experimentalMultiWorker flag.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\n\tyargsObject.wrap(yargsObject.terminalWidth());\n\tconst args = await yargsObject.argv;\n\n\tconst command = args._[0] as string;\n\n\tif (!['run-blueprint', 'server', 'build-snapshot'].includes(command)) {\n\t\tyargsObject.showHelp();\n\t\tprocess.exit(1);\n\t}\n\n\tconst cliArgs = {\n\t\t...args,\n\t\tcommand,\n\t\tblueprint: await resolveBlueprint({\n\t\t\tsourceString: args.blueprint,\n\t\t\tblueprintMayReadAdjacentFiles: args.blueprintMayReadAdjacentFiles,\n\t\t}),\n\t\tmount: [...(args.mount || []), ...(args.mountDir || [])],\n\t\tmountBeforeInstall: [\n\t\t\t...(args.mountBeforeInstall || []),\n\t\t\t...(args.mountDirBeforeInstall || []),\n\t\t],\n\t} as RunCLIArgs;\n\n\ttry {\n\t\treturn runCLI(cliArgs);\n\t} catch (e) {\n\t\tconst reportableCause = ReportableError.getReportableCause(e);\n\t\tif (reportableCause) {\n\t\t\tconsole.log('');\n\t\t\tconsole.log(reportableCause.message);\n\t\t\tprocess.exit(1);\n\t\t} else {\n\t\t\tthrow e;\n\t\t}\n\t}\n}\n\nexport interface RunCLIArgs {\n\tblueprint?: BlueprintDeclaration | BlueprintBundle;\n\tcommand: 'server' | 'run-blueprint' | 'build-snapshot';\n\tdebug?: boolean;\n\tlogin?: boolean;\n\tmount?: Mount[];\n\tmountBeforeInstall?: Mount[];\n\toutfile?: string;\n\tphp?: SupportedPHPVersion;\n\tport?: number;\n\tquiet?: boolean;\n\tskipWordPressSetup?: boolean;\n\tskipSqliteSetup?: boolean;\n\twp?: string;\n\tautoMount?: boolean;\n\tfollowSymlinks?: boolean;\n\texperimentalMultiWorker?: number;\n\texperimentalTrace?: boolean;\n\tinternalCookieStore?: boolean;\n}\n\nexport interface RunCLIServer extends AsyncDisposable {\n\tplayground: RemoteAPI<PlaygroundCliWorker>;\n\tserver: Server;\n\t[Symbol.asyncDispose](): Promise<void>;\n}\n\nexport async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {\n\tlet loadBalancer: LoadBalancer;\n\tlet playground: RemoteAPI<PlaygroundCliWorker>;\n\n\tconst playgroundsToCleanUp: {\n\t\tplayground: RemoteAPI<PlaygroundCliWorker>;\n\t\tworker: Worker;\n\t}[] = [];\n\n\t/**\n\t * Expand auto-mounts to include the necessary mounts and steps\n\t * when running in auto-mount mode.\n\t */\n\tif (args.autoMount) {\n\t\targs = expandAutoMounts(args);\n\t}\n\n\t/**\n\t * TODO: This exact feature will be provided in the PHP Blueprints library.\n\t * Let's use it when it ships. Let's also use it in the web Playground\n\t * app.\n\t */\n\tasync function zipSite(outfile: string) {\n\t\tawait playground.run({\n\t\t\tcode: `<?php\n\t\t\t$zip = new ZipArchive();\n\t\t\tif(false === $zip->open('/tmp/build.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE)) {\n\t\t\t\tthrow new Exception('Failed to create ZIP');\n\t\t\t}\n\t\t\t$files = new RecursiveIteratorIterator(\n\t\t\t\tnew RecursiveDirectoryIterator('/wordpress')\n\t\t\t);\n\t\t\tforeach ($files as $file) {\n\t\t\t\techo $file . PHP_EOL;\n\t\t\t\tif (!$file->isFile()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$zip->addFile($file->getPathname(), $file->getPathname());\n\t\t\t}\n\t\t\t$zip->close();\n\n\t\t`,\n\t\t});\n\t\tconst zip = await playground.readFileAsBuffer('/tmp/build.zip');\n\t\tfs.writeFileSync(outfile, zip);\n\t}\n\n\tasync function compileInputBlueprint() {\n\t\t/**\n\t\t * @TODO This looks similar to the resolveBlueprint() call in the website package:\n\t\t * \t https://github.com/WordPress/wordpress-playground/blob/ce586059e5885d185376184fdd2f52335cca32b0/packages/playground/website/src/main.tsx#L41\n\t\t *\n\t\t * \t\t Also the Blueprint Builder tool does something similar.\n\t\t * Perhaps all these cases could be handled by the same function?\n\t\t */\n\t\tconst blueprint: BlueprintDeclaration | BlueprintBundle =\n\t\t\tisBlueprintBundle(args.blueprint)\n\t\t\t\t? args.blueprint\n\t\t\t\t: {\n\t\t\t\t\t\tlogin: args.login,\n\t\t\t\t\t\t...args.blueprint,\n\t\t\t\t\t\tpreferredVersions: {\n\t\t\t\t\t\t\tphp:\n\t\t\t\t\t\t\t\targs.php ??\n\t\t\t\t\t\t\t\targs?.blueprint?.preferredVersions?.php ??\n\t\t\t\t\t\t\t\tRecommendedPHPVersion,\n\t\t\t\t\t\t\twp:\n\t\t\t\t\t\t\t\targs.wp ??\n\t\t\t\t\t\t\t\targs?.blueprint?.preferredVersions?.wp ??\n\t\t\t\t\t\t\t\t'latest',\n\t\t\t\t\t\t\t...(args.blueprint?.preferredVersions || {}),\n\t\t\t\t\t\t},\n\t\t\t\t };\n\n\t\tconst tracker = new ProgressTracker();\n\t\tlet lastCaption = '';\n\t\tlet progressReached100 = false;\n\t\ttracker.addEventListener('progress', (e: any) => {\n\t\t\tif (progressReached100) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprogressReached100 = e.detail.progress === 100;\n\n\t\t\t// Use floor() so we don't report 100% until truly there.\n\t\t\tconst progressInteger = Math.floor(e.detail.progress);\n\t\t\tlastCaption =\n\t\t\t\te.detail.caption || lastCaption || 'Running the Blueprint';\n\t\t\tconst message = `${lastCaption.trim()} – ${progressInteger}%`;\n\t\t\tif (!args.quiet) {\n\t\t\t\twriteProgressUpdate(\n\t\t\t\t\tprocess.stdout,\n\t\t\t\t\tmessage,\n\t\t\t\t\tprogressReached100\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t\treturn await compileBlueprint(blueprint as BlueprintDeclaration, {\n\t\t\tprogress: tracker,\n\t\t});\n\t}\n\n\tlet lastProgressMessage = '';\n\tfunction writeProgressUpdate(\n\t\twriteStream: NodeJS.WriteStream,\n\t\tmessage: string,\n\t\tfinalUpdate: boolean\n\t) {\n\t\tif (message === lastProgressMessage) {\n\t\t\t// Avoid repeating the same message\n\t\t\treturn;\n\t\t}\n\t\tlastProgressMessage = message;\n\n\t\tif (writeStream.isTTY) {\n\t\t\t// Overwrite previous progress updates in-place for a quieter UX.\n\t\t\twriteStream.cursorTo(0);\n\t\t\twriteStream.write(message);\n\t\t\twriteStream.clearLine(1);\n\n\t\t\tif (finalUpdate) {\n\t\t\t\twriteStream.write('\\n');\n\t\t\t}\n\t\t} else {\n\t\t\t// Fall back to writing one line per progress update\n\t\t\twriteStream.write(`${message}\\n`);\n\t\t}\n\t}\n\n\t/**\n\t * Spawns a new Worker Thread.\n\t *\n\t * @param workerUrl The absolute URL of the worker script.\n\t * @returns The spawned Worker Thread.\n\t */\n\tasync function spawnPHPWorkerThread(workerUrl: URL) {\n\t\tconst worker = new Worker(workerUrl);\n\n\t\treturn new Promise<{ worker: Worker; phpPort: NodeMessagePort }>(\n\t\t\t(resolve, reject) => {\n\t\t\t\tworker.once('message', function (message: any) {\n\t\t\t\t\t// Let the worker confirm it has initialized.\n\t\t\t\t\t// We could use the 'online' event to detect start of JS execution,\n\t\t\t\t\t// but that would miss initialization errors.\n\t\t\t\t\tif (message.command === 'worker-script-initialized') {\n\t\t\t\t\t\tresolve({ worker, phpPort: message.phpPort });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tworker.once('error', function (e: Error) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t\tconst error = new Error(\n\t\t\t\t\t\t`Worker failed to load at ${workerUrl}. ${\n\t\t\t\t\t\t\te.message ? `Original error: ${e.message}` : ''\n\t\t\t\t\t\t}`\n\t\t\t\t\t);\n\t\t\t\t\t(error as any).filename = workerUrl;\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction spawnWorkerThreads(\n\t\tcount: number\n\t): Promise<{ worker: Worker; phpPort: NodeMessagePort }[]> {\n\t\tconst moduleWorkerUrl = new URL(\n\t\t\timportedWorkerUrlString,\n\t\t\timport.meta.url\n\t\t);\n\n\t\tconst promises = [];\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tpromises.push(spawnPHPWorkerThread(moduleWorkerUrl));\n\t\t}\n\t\treturn Promise.all(promises);\n\t}\n\n\tif (args.quiet) {\n\t\t// @ts-ignore\n\t\tlogger.handlers = [];\n\t}\n\n\tconst compiledBlueprint = await compileInputBlueprint();\n\n\t// Declare file lock manager outside scope of startServer\n\t// so we can look at it when debugging request handling.\n\tconst nativeFlockSync = await import('fs-ext')\n\t\t.then((m) => m.flockSync)\n\t\t.catch(() => {\n\t\t\tlogger.warn(\n\t\t\t\t'The fs-ext package is not installed. ' +\n\t\t\t\t\t'Internal file locking will not be integrated with ' +\n\t\t\t\t\t'host OS file locking.'\n\t\t\t);\n\t\t\treturn undefined;\n\t\t});\n\tconst fileLockManager = new FileLockManagerForNode(nativeFlockSync);\n\n\t/**\n\t * Expose the file lock manager API on a MessagePort and return it.\n\t *\n\t * @see comlink-sync.ts\n\t * @see phpwasm-emscripten-library-file-locking-for-node.js\n\t */\n\tasync function exposeFileLockManager() {\n\t\tconst { port1, port2 } = new MessageChannel();\n\t\tif (await jspi()) {\n\t\t\t/**\n\t\t\t * When JSPI is available, the worker thread expects an asynchronous API.\n\t\t\t *\n\t\t\t * @see worker-thread.ts\n\t\t\t * @see comlink-sync.ts\n\t\t\t * @see phpwasm-emscripten-library-file-locking-for-node.js\n\t\t\t */\n\t\t\texposeAPI(fileLockManager, null, port1);\n\t\t} else {\n\t\t\t/**\n\t\t\t * When JSPI is not available, the worker thread expects a synchronous API.\n\t\t\t *\n\t\t\t * @see worker-thread.ts\n\t\t\t * @see comlink-sync.ts\n\t\t\t * @see phpwasm-emscripten-library-file-locking-for-node.js\n\t\t\t */\n\t\t\tawait exposeSyncAPI(fileLockManager, port1);\n\t\t}\n\t\treturn port2;\n\t}\n\n\tlet wordPressReady = false;\n\n\tlogger.log('Starting a PHP server...');\n\n\treturn startServer({\n\t\tport: args['port'] as number,\n\t\tonBind: async (server: Server, port: number): Promise<RunCLIServer> => {\n\t\t\tconst absoluteUrl = `http://127.0.0.1:${port}`;\n\n\t\t\t// Kick off worker threads now to save time later.\n\t\t\t// There is no need to wait for other async processes to complete.\n\t\t\tconst totalWorkerCount = args.experimentalMultiWorker ?? 1;\n\t\t\tconst promisedWorkers = spawnWorkerThreads(totalWorkerCount);\n\n\t\t\tlogger.log(`Setting up WordPress ${args.wp}`);\n\t\t\tlet wpDetails: any = undefined;\n\t\t\t// @TODO: Rename to FetchProgressMonitor. There's nothing Emscripten\n\t\t\t// about that class anymore.\n\t\t\tconst monitor = new EmscriptenDownloadMonitor();\n\t\t\tif (!args.skipWordPressSetup) {\n\t\t\t\tlet progressReached100 = false;\n\t\t\t\tmonitor.addEventListener('progress', ((\n\t\t\t\t\te: CustomEvent<ProgressEvent & { finished: boolean }>\n\t\t\t\t) => {\n\t\t\t\t\tif (progressReached100) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// @TODO Every progress bar will want percentages. The\n\t\t\t\t\t// download monitor should just provide that.\n\t\t\t\t\tconst { loaded, total } = e.detail;\n\t\t\t\t\t// Use floor() so we don't report 100% until truly there.\n\t\t\t\t\tconst percentProgress = Math.floor(\n\t\t\t\t\t\tMath.min(100, (100 * loaded) / total)\n\t\t\t\t\t);\n\t\t\t\t\tprogressReached100 = percentProgress === 100;\n\n\t\t\t\t\tif (!args.quiet) {\n\t\t\t\t\t\twriteProgressUpdate(\n\t\t\t\t\t\t\tprocess.stdout,\n\t\t\t\t\t\t\t`Downloading WordPress ${percentProgress}%...`,\n\t\t\t\t\t\t\tprogressReached100\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}) as any);\n\n\t\t\t\twpDetails = await resolveWordPressRelease(args.wp);\n\t\t\t\tlogger.log(\n\t\t\t\t\t`Resolved WordPress release URL: ${wpDetails?.releaseUrl}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst preinstalledWpContentPath =\n\t\t\t\twpDetails &&\n\t\t\t\tpath.join(\n\t\t\t\t\tCACHE_FOLDER,\n\t\t\t\t\t`prebuilt-wp-content-for-wp-${wpDetails.version}.zip`\n\t\t\t\t);\n\t\t\tconst wordPressZip = !wpDetails\n\t\t\t\t? undefined\n\t\t\t\t: fs.existsSync(preinstalledWpContentPath)\n\t\t\t\t? readAsFile(preinstalledWpContentPath)\n\t\t\t\t: await cachedDownload(\n\t\t\t\t\t\twpDetails.releaseUrl,\n\t\t\t\t\t\t`${wpDetails.version}.zip`,\n\t\t\t\t\t\tmonitor\n\t\t\t\t );\n\n\t\t\tlogger.log(`Fetching SQLite integration plugin...`);\n\t\t\tconst sqliteIntegrationPluginZip = args.skipSqliteSetup\n\t\t\t\t? undefined\n\t\t\t\t: await fetchSqliteIntegration(monitor);\n\n\t\t\tconst followSymlinks = args.followSymlinks === true;\n\t\t\tconst trace = args.experimentalTrace === true;\n\t\t\ttry {\n\t\t\t\tconst mountsBeforeWpInstall = args.mountBeforeInstall || [];\n\t\t\t\tconst mountsAfterWpInstall = args.mount || [];\n\n\t\t\t\tconst [initialWorker, ...additionalWorkers] =\n\t\t\t\t\tawait promisedWorkers;\n\n\t\t\t\tplayground = consumeAPI<PlaygroundCliWorker>(\n\t\t\t\t\tinitialWorker.phpPort\n\t\t\t\t);\n\t\t\t\tplaygroundsToCleanUp.push({\n\t\t\t\t\tplayground,\n\t\t\t\t\tworker: initialWorker.worker,\n\t\t\t\t});\n\n\t\t\t\t// Comlink communication proxy\n\t\t\t\tawait playground.isConnected();\n\n\t\t\t\tconst fileLockManagerPort = await exposeFileLockManager();\n\n\t\t\t\tlogger.log(`Booting WordPress...`);\n\n\t\t\t\t// Each additional worker needs a separate process ID space\n\t\t\t\t// for file locking to work properly because locks are associated\n\t\t\t\t// with individual processes. To accommodate this, we split the safe\n\t\t\t\t// integers into a range for each worker.\n\t\t\t\tconst processIdSpaceLength = Math.floor(\n\t\t\t\t\tNumber.MAX_SAFE_INTEGER / totalWorkerCount\n\t\t\t\t);\n\n\t\t\t\tawait playground.useFileLockManager(fileLockManagerPort);\n\t\t\t\tawait playground.boot({\n\t\t\t\t\tphpVersion: compiledBlueprint.versions.php,\n\t\t\t\t\twpVersion: compiledBlueprint.versions.wp,\n\t\t\t\t\tabsoluteUrl,\n\t\t\t\t\tmountsBeforeWpInstall,\n\t\t\t\t\tmountsAfterWpInstall,\n\t\t\t\t\twordPressZip:\n\t\t\t\t\t\twordPressZip && (await wordPressZip!.arrayBuffer()),\n\t\t\t\t\tsqliteIntegrationPluginZip:\n\t\t\t\t\t\tawait sqliteIntegrationPluginZip!.arrayBuffer(),\n\t\t\t\t\tfirstProcessId: 0,\n\t\t\t\t\tprocessIdSpaceLength,\n\t\t\t\t\tfollowSymlinks,\n\t\t\t\t\ttrace,\n\t\t\t\t\tinternalCookieStore: args.internalCookieStore,\n\t\t\t\t});\n\n\t\t\t\tif (\n\t\t\t\t\twpDetails &&\n\t\t\t\t\t!args.mountBeforeInstall &&\n\t\t\t\t\t!fs.existsSync(preinstalledWpContentPath)\n\t\t\t\t) {\n\t\t\t\t\tlogger.log(\n\t\t\t\t\t\t`Caching preinstalled WordPress for the next boot...`\n\t\t\t\t\t);\n\t\t\t\t\tfs.writeFileSync(\n\t\t\t\t\t\tpreinstalledWpContentPath,\n\t\t\t\t\t\tawait zipDirectory(playground, '/wordpress')\n\t\t\t\t\t);\n\t\t\t\t\tlogger.log(`Cached!`);\n\t\t\t\t}\n\n\t\t\t\tloadBalancer = new LoadBalancer(playground);\n\n\t\t\t\tawait playground.isReady();\n\t\t\t\twordPressReady = true;\n\t\t\t\tlogger.log(`Booted!`);\n\n\t\t\t\tif (compiledBlueprint) {\n\t\t\t\t\tlogger.log(`Running the Blueprint...`);\n\t\t\t\t\tawait runBlueprintSteps(compiledBlueprint, playground);\n\t\t\t\t\tlogger.log(`Finished running the blueprint`);\n\t\t\t\t}\n\n\t\t\t\tif (args.command === 'build-snapshot') {\n\t\t\t\t\tawait zipSite(args.outfile as string);\n\t\t\t\t\tlogger.log(`WordPress exported to ${args.outfile}`);\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t} else if (args.command === 'run-blueprint') {\n\t\t\t\t\tlogger.log(`Blueprint executed`);\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\targs.experimentalMultiWorker &&\n\t\t\t\t\targs.experimentalMultiWorker > 1\n\t\t\t\t) {\n\t\t\t\t\tlogger.log(`Preparing additional workers...`);\n\n\t\t\t\t\t// Save /internal directory from initial worker so we can replicate it\n\t\t\t\t\t// in each additional worker.\n\t\t\t\t\tconst internalZip = await zipDirectory(\n\t\t\t\t\t\tplayground,\n\t\t\t\t\t\t'/internal'\n\t\t\t\t\t);\n\n\t\t\t\t\t// Boot additional workers\n\t\t\t\t\tconst initialWorkerProcessIdSpace = processIdSpaceLength;\n\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\tadditionalWorkers.map(async (worker, index) => {\n\t\t\t\t\t\t\tconst additionalPlayground =\n\t\t\t\t\t\t\t\tconsumeAPI<PlaygroundCliWorker>(worker.phpPort);\n\t\t\t\t\t\t\tplaygroundsToCleanUp.push({\n\t\t\t\t\t\t\t\tplayground: additionalPlayground,\n\t\t\t\t\t\t\t\tworker: worker.worker,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tawait additionalPlayground.isConnected();\n\n\t\t\t\t\t\t\tconst firstProcessId =\n\t\t\t\t\t\t\t\tinitialWorkerProcessIdSpace +\n\t\t\t\t\t\t\t\tindex * processIdSpaceLength;\n\n\t\t\t\t\t\t\tconst fileLockManagerPort =\n\t\t\t\t\t\t\t\tawait exposeFileLockManager();\n\t\t\t\t\t\t\tawait additionalPlayground.useFileLockManager(\n\t\t\t\t\t\t\t\tfileLockManagerPort\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tawait additionalPlayground.boot({\n\t\t\t\t\t\t\t\tphpVersion: compiledBlueprint.versions.php,\n\t\t\t\t\t\t\t\tabsoluteUrl,\n\t\t\t\t\t\t\t\tmountsBeforeWpInstall,\n\t\t\t\t\t\t\t\tmountsAfterWpInstall,\n\t\t\t\t\t\t\t\t// Skip WordPress zip because we share the /wordpress directory\n\t\t\t\t\t\t\t\t// populated by the initial worker.\n\t\t\t\t\t\t\t\twordPressZip: undefined,\n\t\t\t\t\t\t\t\t// Skip SQLite integration plugin for now because we\n\t\t\t\t\t\t\t\t// will copy it from primary's `/internal` directory.\n\t\t\t\t\t\t\t\tsqliteIntegrationPluginZip: undefined,\n\t\t\t\t\t\t\t\tdataSqlPath:\n\t\t\t\t\t\t\t\t\t'/wordpress/wp-content/database/.ht.sqlite',\n\t\t\t\t\t\t\t\tfirstProcessId,\n\t\t\t\t\t\t\t\tprocessIdSpaceLength,\n\t\t\t\t\t\t\t\tfollowSymlinks,\n\t\t\t\t\t\t\t\ttrace,\n\t\t\t\t\t\t\t\tinternalCookieStore: args.internalCookieStore,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tawait additionalPlayground.isReady();\n\n\t\t\t\t\t\t\t// Replicate the Blueprint-initialized /internal directory\n\t\t\t\t\t\t\tawait additionalPlayground.writeFile(\n\t\t\t\t\t\t\t\t'/tmp/internal.zip',\n\t\t\t\t\t\t\t\tinternalZip\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tawait unzipFile(\n\t\t\t\t\t\t\t\tadditionalPlayground,\n\t\t\t\t\t\t\t\t'/tmp/internal.zip',\n\t\t\t\t\t\t\t\t'/internal'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tawait additionalPlayground.unlink(\n\t\t\t\t\t\t\t\t'/tmp/internal.zip'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tloadBalancer.addWorker(additionalPlayground);\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\n\t\t\t\t\tlogger.log(`Ready!`);\n\t\t\t\t}\n\n\t\t\t\tlogger.log(`WordPress is running on ${absoluteUrl}`);\n\n\t\t\t\treturn {\n\t\t\t\t\tplayground,\n\t\t\t\t\tserver,\n\t\t\t\t\t[Symbol.asyncDispose]: async function disposeCLI() {\n\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\tplaygroundsToCleanUp.map(\n\t\t\t\t\t\t\t\tasync ({ playground, worker }) => {\n\t\t\t\t\t\t\t\t\tawait playground.dispose();\n\t\t\t\t\t\t\t\t\tawait worker.terminate();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tawait new Promise((resolve) => server.close(resolve));\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\tif (!args.debug) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tconst phpLogs = await playground.readFileAsText(errorLogPath);\n\t\t\t\tthrow new Error(phpLogs, { cause: error });\n\t\t\t}\n\t\t},\n\t\tasync handleRequest(request: PHPRequest) {\n\t\t\tif (!wordPressReady) {\n\t\t\t\treturn PHPResponse.forHttpCode(\n\t\t\t\t\t502,\n\t\t\t\t\t'WordPress is not ready yet'\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn await loadBalancer.handleRequest(request);\n\t\t},\n\t});\n}\n"],"names":["expandAutoMounts","args","path","mount","mountBeforeInstall","isPluginDirectory","pluginName","basename","isThemeDirectory","themeName","containsWpContentDirectories","wpContentMounts","containsFullWordPressInstallation","files","fs","mounts","file","join","blueprint","getSteps","skipWordPressSetup","styleCssContent","pluginNameRegex","fileContent","wpContentDir","CACHE_FOLDER","os","fetchSqliteIntegration","monitor","cachedDownload","remoteUrl","cacheKey","artifactPath","downloadTo","readAsFile","localPath","reader","tmpPath","writer","done","value","resolve","reject","err","fileName","startServer","options","app","express","server","address","req","res","phpResponse","parseHeaders","bufferRequestBody","key","port","body","chunk","requestHeaders","i","LoadBalancer","initialWorker","worker","request","smallestWorkerLoad","workerLoad","promiseForResponse","isValidWordPressSlug","version","parseMountWithDelimiterArguments","parsedMounts","mountParts","hostPath","vfsPath","existsSync","parseMountDirArguments","source","ReportableError","message","error","iterations","maxIterations","errorStack","subError","logger","Semaphore","BaseError","json","factory","exports","CRC32","signed_crc_table","c","table","n","T0","slice_by_16_tables","T","v","out","TT","T1","T2","T3","T4","T5","T6","T7","T8","T9","Ta","Tb","Tc","Td","Te","Tf","crc32_bstr","bstr","seed","C","L","crc32_buf","B","crc32_str","str","d","base64Js","byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","code","len","getLens","b64","validLen","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","extraBytes","parts","maxChunkLength","len2","ieee754","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","s","rt","base64","require$$0","require$$1","customInspectSymbol","Buffer","SlowBuffer","K_MAX_LENGTH","typedArraySupport","proto","createBuffer","length","buf","arg","encodingOrOffset","allocUnsafe","from","fromString","fromArrayView","isInstance","fromArrayBuffer","valueOf","b","fromObject","assertSize","size","alloc","fill","encoding","checked","string","actual","fromArrayLike","array","arrayView","copy","byteOffset","obj","numberIsNaN","a","x","y","list","pos","mustMatch","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","max","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","indexSize","arrLength","valLength","read","foundIndex","found","j","hexWrite","remaining","strLen","parsed","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","ret","hexSliceLookupTable","bytes","newBuf","checkOffset","ext","noAssert","mul","checkInt","min","maxBytes","limit","sub","checkIEEE754","writeFloat","littleEndian","writeDouble","targetStart","INVALID_BASE64_RE","base64clean","units","leadSurrogate","byteArray","hi","lo","src","dst","type","alphabet","i16","ObjectTypeError","oid","expected","filepath","currentJsRuntime","asPromise","event","isByobSupported","inputBytes","stream","File","sources","date","position","blob","controller","view","uint8array","bytesRead","CustomEvent","name","concatUint8Array","arrays","result","sum","concatBytes","totalBytes","acc","collectBytes","StreamedFile","readableStream","MAX_BITS","D_CODES","BL_CODES","LENGTH_CODES","LITERALS","L_CODES","HEAP_SIZE","END_BLOCK","MAX_BL_BITS","REP_3_6","REPZ_3_10","REPZ_11_138","Buf_size","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_DEFAULT_STRATEGY","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_BUF_ERROR","extractArray","flatArray","_dist_code","Tree","that","gen_bitlen","tree","stree","extra","base","max_length","h","bits","xbits","f","overflow","bi_reverse","gen_codes","max_code","bl_count","next_code","elems","node","dist","StaticTree","static_tree","extra_bits","extra_base","static_ltree2_first_part","static_ltree2_second_part","index","static_dtree_first_part","static_dtree_second_part","MAX_MEM_LEVEL","DEF_MEM_LEVEL","Config","good_length","max_lazy","nice_length","max_chain","func","STORED","FAST","SLOW","config_table","z_errmsg","NeedMore","BlockDone","FinishStarted","FinishDone","PRESET_DICT","INIT_STATE","BUSY_STATE","FINISH_STATE","Z_DEFLATED","STORED_BLOCK","STATIC_TREES","DYN_TREES","MIN_MATCH","MAX_MATCH","MIN_LOOKAHEAD","smaller","depth","tn2","tm2","Deflate","strm","status","pending_buf_size","last_flush","w_size","w_bits","w_mask","win","window_size","prev","head","ins_h","hash_size","hash_bits","hash_mask","hash_shift","block_start","match_length","prev_match","match_available","strstart","match_start","lookahead","prev_length","max_chain_length","max_lazy_match","level","strategy","good_match","nice_match","dyn_ltree","dyn_dtree","bl_tree","l_desc","d_desc","bl_desc","lit_bufsize","last_lit","matches","last_eob_len","bi_buf","bi_valid","lm_init","init_block","tr_init","k","heap","scan_tree","prevlen","curlen","nextlen","count","max_count","min_count","build_bl_tree","max_blindex","put_byte","p","put_short","w","putShortMSB","send_bits","send_code","c2","send_tree","send_all_trees","lcodes","dcodes","blcodes","rank","bi_flush","_tr_align","_tr_tally","lc","out_length","in_length","dcode","compress_block","ltree","dtree","lx","bi_windup","copy_block","header","_tr_stored_block","stored_len","eof","_tr_flush_block","opt_lenb","static_lenb","flush_block_only","fill_window","more","deflate_stored","flush","max_block_size","max_start","longest_match","cur_match","chain_length","scan","match","best_len","_nice_match","wmask","strend","scan_end1","scan_end","deflate_fast","hash_head","bflush","deflate_slow","max_insert","deflateReset","_level","_method","memLevel","_strategy","_strm","dictionary","dictLength","level_flags","old_flush","bstate","ZStream","ZipDeflate","z","bufsize","getMaximumCompressedSize","data","onprogress","lastIndex","bufferIndex","bufferSize","buffers","uncompressedSize","Z_MEM_ERROR","inflate_mask","MANY","fixed_bl","fixed_bd","fixed_tl","fixed_td","cplens","cplext","cpdist","cpdext","BMAX","InfTree","hn","r","u","huft_build","bindex","t","hp","g","l","mask","q","xp","initWorkArea","vsize","bb","tb","nl","nd","bl","bd","tl","td","START","LEN","LENEXT","DIST","DISTEXT","COPY","LIT","WASH","END","BADCODE","InfCodes","mode","tree_index","need","lit","get","lbits","dbits","ltree_index","dtree_index","inflate_fast","tl_index","td_index","tp","tp_index","ml","md","tp_index_t_3","tindex","border","TYPE","LENS","TABLE","BTREE","DTREE","CODES","DRY","DONELOCKS","BADBLOCKS","InfBlocks","left","blens","codes","last","hufts","check","inftree","bl_","bd_","tl_","td_","METHOD","FLAG","DICT4","DICT3","DICT2","DICT1","DICT0","BLOCKS","DONE","BAD","mark","Inflate","inflateReset","istate","ZipInflate","nomoreinput","MAX_32_BITS","MAX_16_BITS","COMPRESSION_METHOD_DEFLATE","COMPRESSION_METHOD_STORE","COMPRESSION_METHOD_AES","LOCAL_FILE_HEADER_SIGNATURE","SPLIT_ZIP_FILE_SIGNATURE","CENTRAL_FILE_HEADER_SIGNATURE","END_OF_CENTRAL_DIR_SIGNATURE","ZIP64_END_OF_CENTRAL_DIR_SIGNATURE","ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE","END_OF_CENTRAL_DIR_LENGTH","ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH","ZIP64_END_OF_CENTRAL_DIR_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","BITFLAG_ENCRYPTED","BITFLAG_LEVEL","BITFLAG_DATA_DESCRIPTOR","BITFLAG_LANG_ENCODING_FLAG","FILE_ATTR_MSDOS_DIR_MASK","FILE_ATTR_UNIX_DIR_MASK","FILE_ATTR_UNIX_EXECUTABLE_MASK","DIRECTORY_SIGNATURE","UNDEFINED_VALUE","UNDEFINED_TYPE","FUNCTION_TYPE","StreamAdapter","Codec","_format","codec","MINIMUM_CHUNK_SIZE","maxWorkers","DEFAULT_CONFIGURATION","config","getConfiguration","getChunkSize","configure","configuration","baseURL","chunkSize","terminateWorkerTimeout","useCompressionStream","useWebWorkers","CompressionStream","DecompressionStream","workerScripts","setIfDefined","deflate","inflate","propertyName","propertyValue","mimeTypes","subtype","indexMimeType","Crc32","crc","Crc32Stream","crc32","encodeText","bitArray","a1","a2","shift","_end","carry","last2","shift2","hash","sha1","ol","words","cipher","aes","sbox","decTable","keyLen","encKey","decKey","rcon","encTable","sboxInv","th","xInv","x2","x4","x8","tDec","tEnc","input","nInnerRounds","t0","t1","t2","t3","kIndex","b2","random","typedArray","m_w","m_z","rcache","_r","prf","iv","word","b1","b3","counter","misc","password","salt","ui","arrayBuffer","outLength","hmac","Hash","exKey","bs","GET_RANDOM_VALUES_SUPPORTED","ERR_INVALID_PASSWORD","ERR_INVALID_SIGNATURE","ERR_ABORT_CHECK_PASSWORD","getRandomValues","BLOCK_LENGTH","RAW_FORMAT","PBKDF2_ALGORITHM","HASH_ALGORITHM","HASH_FUNCTION","BASE_KEY_ALGORITHM","DERIVED_BITS_ALGORITHM","DERIVED_BITS_USAGE","SALT_LENGTH","KEY_LENGTH","SIGNATURE_LENGTH","COUNTER_DEFAULT_VALUE","CRYPTO_API_SUPPORTED","subtle","SUBTLE_API_SUPPORTED","codecBytes","Aes","CtrGladman","HmacSha1","IMPORT_KEY_SUPPORTED","DERIVE_BITS_SUPPORTED","AESDecryptionStream","rawPassword","signed","encryptionStrength","checkPasswordOnly","encodePassword","aesCrypto","strength","resolveReady","ready","createDecryptionKeys","subarray","append","ctr","pending","chunkToDecrypt","originalSignature","decryptedChunkArray","encryptedChunk","toBits","decryptedChunk","fromBits","signature","indexSignature","AESEncryptionStream","preamble","createEncryptionKeys","encryptedChunkArray","concat","paddingStart","paddingEnd","verifySignature","inputLength","expand","inputChunk","outputChunk","decrypt","passwordVerificationKey","createKeys","passwordVerification","encrypt","baseKey","importKey","derivedBits","deriveBits","compositeKey","authentication","format","algorithm","extractable","keyUsages","leftArray","rightArray","inputArray","begin","HEADER_LENGTH","ZipCryptoDecryptionStream","zipCrypto","decryptedHeader","ZipCryptoEncryptionStream","getByte","updateKeys","keys","byte","key0","key1","key2","getInt32","getInt8","temp","number","COMPRESSION_FORMAT","DeflateStream","CompressionStreamNative","compressed","encrypted","crc32Stream","encryptionStream","readable","filterEmptyChunks","pipeThrough","pipeThroughCommpressionStream","setReadable","InflateStream","DecompressionStreamNative","decryptionStream","dataViewSignature","CodecStreamNative","CodecStream","transformStream","MESSAGE_EVENT_TYPE","MESSAGE_START","MESSAGE_PULL","MESSAGE_DATA","MESSAGE_ACK_DATA","MESSAGE_CLOSE","CODEC_DEFLATE","CODEC_INFLATE","codecType","Stream","outputSize","inputSize","inputSizeStream","outputSizeStream","ChunkStream","pendingChunk","transform","newChunk","WEB_WORKERS_SUPPORTED","CodecWorker","workerData","writable","streamOptions","transferStreams","scripts","onTaskFinished","signal","ProgressWatcherStream","busy","resolveTerminated","createWebWorkerInterface","createWorkerInterface","readableSource","onstart","onend","chunkOffset","callHandler","handler","parameters","runWorker","getWebWorker","runWebWorker","codecStream","resolveResult","rejectResult","closed","watchClosedStream","streamsTransferred","sendMessage","resultValue","writableSource","resolveStreamClosed","reason","classicWorkersSupported","transferStreamsSupported","url","workerOptions","scriptUrl","onMessage","transferables","messageId","stack","responseError","close","pool","pendingRequests","indexWorker","streamCopy","getWorker","clearTerminateTimeout","terminateWorker","terminateTimeout","ERR_ITERATOR_COMPLETED_TOO_SOON","HTTP_HEADER_CONTENT_TYPE","DEFAULT_CHUNK_SIZE","PROPERTY_NAME_WRITABLE","Reader","diskNumberStart","readUint8Array","BlobReader","offsetEnd","BlobWriter","contentType","headers","SplitDataReader","readers","diskReader","indexDiskReader","diskNumber","currentDiskNumber","currentReaderOffset","currentReader","currentReaderSize","chunkLength","SplitDataWriter","writerGenerator","maxSize","diskSourceWriter","diskWritable","diskWriter","availableSize","writeChunk","closeDisk","initStream","initSize","initReader","initWriter","CP437","VALID_CP437","decodeCP437","stringValue","indexCharacter","decodeText","PROPERTY_NAME_FILENAME","PROPERTY_NAME_RAW_FILENAME","PROPERTY_NAME_COMMENT","PROPERTY_NAME_RAW_COMMENT","PROPERTY_NAME_UNCOMPPRESSED_SIZE","PROPERTY_NAME_COMPPRESSED_SIZE","PROPERTY_NAME_OFFSET","PROPERTY_NAME_DISK_NUMBER_START","PROPERTY_NAME_LAST_MODIFICATION_DATE","PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE","PROPERTY_NAME_LAST_ACCESS_DATE","PROPERTY_NAME_RAW_LAST_ACCESS_DATE","PROPERTY_NAME_CREATION_DATE","PROPERTY_NAME_RAW_CREATION_DATE","PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE","PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES","PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE","PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES","PROPERTY_NAME_MS_DOS_COMPATIBLE","PROPERTY_NAME_ZIP64","PROPERTY_NAME_ENCRYPTED","PROPERTY_NAME_VERSION","PROPERTY_NAME_VERSION_MADE_BY","PROPERTY_NAME_ZIPCRYPTO","PROPERTY_NAME_DIRECTORY","PROPERTY_NAME_EXECUTABLE","PROPERTY_NAMES","Entry","ERR_BAD_FORMAT","ERR_EOCDR_NOT_FOUND","ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND","ERR_CENTRAL_DIRECTORY_NOT_FOUND","ERR_LOCAL_FILE_HEADER_NOT_FOUND","ERR_EXTRAFIELD_ZIP64_NOT_FOUND","ERR_ENCRYPTED","ERR_UNSUPPORTED_ENCRYPTION","ERR_UNSUPPORTED_COMPRESSION","ERR_SPLIT_ZIP_FILE","CHARSET_UTF8","CHARSET_CP437","ZIP64_PROPERTIES","ZIP64_EXTRACTION","getUint32","getBigUint64","ZipReader","zipReader","endOfDirectoryInfo","seekSignature","signatureArray","signatureView","getDataView","endOfDirectoryView","directoryDataLength","directoryDataOffset","commentOffset","commentLength","getUint16","appendedDataOffset","lastDiskNumber","expectedLastDiskNumber","filesLength","prependedDataLength","startOffset","endOfDirectoryLocatorArray","endOfDirectoryLocatorView","endOfDirectoryArray","expectedDirectoryDataOffset","originalDirectoryDataOffset","directoryArray","directoryView","expectedDirectoryDataLength","filenameEncoding","getOptionValue","commentEncoding","indexFile","fileEntry","ZipEntry","readCommonHeader","languageEncodingFlag","filenameOffset","extraFieldOffset","versionMadeBy","msDosCompatible","unixCompatible","rawFilename","endOffset","rawComment","filenameUTF8","commentUTF8","externalFileAttributes","directory","getUint8","executable","offsetFileEntry","decode","rawFilenameEncoding","rawCommentEncoding","filename","comment","readCommonFooter","entry","extractPrependedData","extractAppendedData","entries","zipEntry","extraFieldAES","compressionMethod","bitFlag","rawLastModDate","compressedSize","localDirectory","dataArray","dataView","passThrough","dataOffset","preventClose","rawBitFlag","getDate","rawExtraField","extraField","rawExtraFieldView","offsetExtraField","extraFieldZip64","readExtraFieldZip64","extraFieldUnicodePath","readExtraFieldUnicode","extraFieldUnicodeComment","readExtraFieldAES","extraFieldNTFS","readExtraFieldNTFS","extraFieldExtendedTimestamp","readExtraFieldExtendedTimestamp","extraFieldUSDZ","extraFieldView","missingProperties","indexMissingProperty","extraction","extraFieldUnicode","rawPropertyName","tag1Data","tagValue","attributeSize","tag1View","rawLastAccessDate","rawCreationDate","lastModDate","getDateNTFS","lastAccessDate","creationDate","extraFieldData","flags","timeProperties","timeRawProperties","indexProperty","time","minimumBytes","maximumLength","setUint32","maximumBytes","seek","indexByte","timeRaw","configureWebWorker","InMemoryFilesystem","fileTree","content","remainingPath","currentSubtree","segments","nextSegment","ZipFilesystem","relativePath","OverlayFilesystem","filesystems","errors","filesystem","errorMessages","NodeJsFilesystem","root","filePath","fullPath","stats","nodeStreamToReadableStream","resolveBlueprint","sourceString","blueprintMayReadAdjacentFiles","resolveRemoteBlueprint","blueprintPath","stat","extension","blueprintText","contextPath","nodeJsFilesystem","parseOptionsAndRunCLI","yargsObject","yargs","RecommendedPHPVersion","SupportedPHPVersions","cpus","isMountingWordPressDir","command","cliArgs","runCLI","reportableCause","loadBalancer","playground","playgroundsToCleanUp","zipSite","outfile","zip","compileInputBlueprint","isBlueprintBundle","tracker","ProgressTracker","lastCaption","progressReached100","progressInteger","writeProgressUpdate","compileBlueprint","lastProgressMessage","writeStream","finalUpdate","spawnPHPWorkerThread","workerUrl","Worker","spawnWorkerThreads","moduleWorkerUrl","importedWorkerUrlString","promises","compiledBlueprint","nativeFlockSync","fileLockManager","FileLockManagerForNode","exposeFileLockManager","port1","port2","MessageChannel","jspi","exposeAPI","exposeSyncAPI","wordPressReady","absoluteUrl","totalWorkerCount","promisedWorkers","wpDetails","EmscriptenDownloadMonitor","loaded","total","percentProgress","resolveWordPressRelease","preinstalledWpContentPath","wordPressZip","sqliteIntegrationPluginZip","followSymlinks","trace","mountsBeforeWpInstall","mountsAfterWpInstall","additionalWorkers","consumeAPI","fileLockManagerPort","processIdSpaceLength","zipDirectory","runBlueprintSteps","internalZip","initialWorkerProcessIdSpace","additionalPlayground","firstProcessId","unzipFile","phpLogs","errorLogPath","PHPResponse"],"mappings":";;;;;;;;;;;;;;;;AASO,SAASA,GAAiBC,GAA8B;AACxD,QAAAC,IAAO,QAAQ,IAAI,GAEnBC,IAAQ,CAAC,GAAIF,EAAK,SAAS,CAAA,CAAG,GAC9BG,IAAqB,CAAC,GAAIH,EAAK,sBAAsB,CAAA,CAAG;AAE1D,MAAAI,GAAkBH,CAAI,GAAG;AACtB,UAAAI,IAAaC,GAASL,CAAI;AAChC,IAAAC,EAAM,KAAK;AAAA,MACV,UAAUD;AAAA,MACV,SAAS,iCAAiCI,CAAU;AAAA,IAAA,CACpD;AAAA,EAAA,WACSE,GAAiBN,CAAI,GAAG;AAC5B,UAAAO,IAAYF,GAASL,CAAI;AAC/B,IAAAC,EAAM,KAAK;AAAA,MACV,UAAUD;AAAA,MACV,SAAS,gCAAgCO,CAAS;AAAA,IAAA,CAClD;AAAA,EAAA,WACSC,GAA6BR,CAAI;AAC3C,IAAAC,EAAM,KAAK,GAAGQ,GAAgBT,CAAI,CAAC;AAAA,WACzBU,GAAkCV,CAAI,GAAG;AAQ7C,UAAAW,IAAQC,GAAG,YAAYZ,CAAI,GAC3Ba,IAAkB,CAAC;AACzB,eAAWC,KAAQH;AACd,MAAAG,EAAK,WAAW,YAAY,KAGhCD,EAAO,KAAK;AAAA,QACX,UAAU,GAAGb,CAAI,IAAIc,CAAI;AAAA,QACzB,SAAS,cAAcA,CAAI;AAAA,MAAA,CAC3B;AAEiB,IAAAZ,EAAA;AAAA,MAClB,GAAGW;AAAA,MACH,GAAGJ,GAAgBM,GAAKf,GAAM,YAAY,CAAC;AAAA,IAC5C;AAAA,EAAA;AAMA,IAAAC,EAAM,KAAK,EAAE,UAAUD,GAAM,SAAS,cAAc;AAG/C,QAAAgB,IAAajB,EAAK,aAAsC,CAAC;AACrD,EAAAiB,EAAA,QA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