{"version":3,"file":"index.cjs","sources":["../../../../packages/php-wasm/util/src/lib/sleep.ts","../../../../packages/php-wasm/util/src/lib/semaphore.ts","../../../../packages/php-wasm/util/src/lib/php-wasm-error.ts","../../../../packages/php-wasm/util/src/lib/paths.ts","../../../../packages/php-wasm/util/src/lib/event-emitter-polyfill.ts","../../../../packages/php-wasm/util/src/lib/split-shell-command.ts","../../../../packages/php-wasm/util/src/lib/writable-polyfill.ts","../../../../packages/php-wasm/util/src/lib/create-spawn-handler.ts","../../../../packages/php-wasm/util/src/lib/php-event.ts","../../../../packages/php-wasm/util/src/lib/spawn-handlers/sendmail.ts","../../../../packages/php-wasm/util/src/lib/random-string.ts","../../../../packages/php-wasm/util/src/lib/format-bytes.ts","../../../../packages/php-wasm/util/src/lib/random-filename.ts","../../../../packages/php-wasm/util/src/lib/base64.ts","../../../../packages/php-wasm/util/src/lib/php-vars.ts","../../../../packages/php-wasm/util/src/lib/sprintf.ts","../../../../packages/php-wasm/util/src/lib/index.ts"],"sourcesContent":["export const SleepFinished = Symbol('SleepFinished');\n\nexport function sleep(ms: number): Promise<typeof SleepFinished> {\n\treturn new Promise((resolve) => {\n\t\tsetTimeout(() => resolve(SleepFinished), ms);\n\t});\n}\n","import { SleepFinished, sleep } from './sleep';\n\nexport interface SemaphoreOptions {\n\t/**\n\t * The maximum number of concurrent locks.\n\t */\n\tconcurrency: number;\n\t/**\n\t * The maximum time to wait for a lock to become available.\n\t */\n\ttimeout?: number;\n}\n\nexport class AcquireTimeoutError extends Error {\n\tconstructor() {\n\t\tsuper('Acquiring lock timed out');\n\t}\n}\n\nexport default class Semaphore {\n\tprivate _running = 0;\n\tprivate concurrency: number;\n\tprivate timeout?: number;\n\tprivate queue: (() => void)[];\n\n\tconstructor({ concurrency, timeout }: SemaphoreOptions) {\n\t\tthis.concurrency = concurrency;\n\t\tthis.timeout = timeout;\n\t\tthis.queue = [];\n\t}\n\n\tget remaining(): number {\n\t\treturn this.concurrency - this.running;\n\t}\n\n\tget running(): number {\n\t\treturn this._running;\n\t}\n\n\tasync acquire(): Promise<() => void> {\n\t\t// Concurrency exhausted - wait in queue for other workers to finish:\n\t\tif (this._running >= this.concurrency) {\n\t\t\t// Create a promise and store its resolver in the queue.\n\t\t\tconst acquired = new Promise<void>((resolve) => {\n\t\t\t\tthis.queue.push(resolve);\n\t\t\t});\n\n\t\t\t// Wait until it is resolved by another worker or a timeout occurs.\n\t\t\tif (this.timeout !== undefined) {\n\t\t\t\t// Store the resolver for cleanup in case of timeout.\n\t\t\t\tconst resolve = this.queue.at(-1)!;\n\t\t\t\tconst result = await Promise.race([\n\t\t\t\t\tacquired,\n\t\t\t\t\tsleep(this.timeout),\n\t\t\t\t]);\n\t\t\t\tif (result === SleepFinished) {\n\t\t\t\t\t// Remove the resolver for the timed out worker from the queue.\n\t\t\t\t\tthis.queue.splice(this.queue.indexOf(resolve), 1);\n\t\t\t\t\tthrow new AcquireTimeoutError();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tawait acquired;\n\t\t\t}\n\t\t}\n\n\t\t// Acquire the lock:\n\t\tthis._running++;\n\t\tlet released = false;\n\n\t\t// Return a release function:\n\t\treturn () => {\n\t\t\tif (released) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treleased = true;\n\t\t\tthis._running--;\n\n\t\t\t// Release the first item in the queue (call its resolver):\n\t\t\tif (this.queue.length > 0) {\n\t\t\t\tthis.queue.shift()!();\n\t\t\t}\n\t\t};\n\t}\n\n\tasync run<T>(fn: () => T | Promise<T>): Promise<T> {\n\t\tconst release = await this.acquire();\n\t\ttry {\n\t\t\treturn await fn();\n\t\t} finally {\n\t\t\trelease();\n\t\t}\n\t}\n}\n","export class PhpWasmError extends Error {\n\tuserFriendlyMessage?: string;\n\tconstructor(message: string, userFriendlyMessage?: string) {\n\t\tsuper(message);\n\t\tthis.userFriendlyMessage = userFriendlyMessage ?? message;\n\t}\n}\n","/**\n * The functions in this module are mostly copied from the generated\n * Emscripten PHP module. This enables features like filesystem journaling,\n * which use some low-level Emscripten APIs and need access to the\n * same path helpers.\n */\n\n/**\n * Joins paths together.\n *\n * For example:\n *\n * > joinPaths('wordpress', 'wp-content')\n * 'wordpress/wp-content'\n *\n * Use this for all PHP paths and **do not** use path.join().\n * This is important because Emscripten paths are **always**\n * POSIX-style paths. Imagine joining paths on Windows:\n *\n * > path.join('wordpress', 'wp-content')\n * '\\\\wordpress\\\\wp-content'  // invalid in PHP.wasm\n *\n * See the path.join issue for more details:\n *\n * https://github.com/WordPress/playground-tools/issues/11#issuecomment-1579074763\n *\n * @param paths Paths segments to join\n * @returns A joined path\n */\nexport function joinPaths(...paths: string[]) {\n\tfunction hasTrailingSlash(p: string) {\n\t\treturn p.substring(p.length - 1) === '/';\n\t}\n\n\tlet path = paths.join('/');\n\tconst isAbsolute = path[0] === '/';\n\tconst trailingSlash = hasTrailingSlash(path);\n\tpath = normalizePath(path);\n\tif (!path && !isAbsolute) {\n\t\tpath = '.';\n\t}\n\tif (path && trailingSlash && !hasTrailingSlash(path)) {\n\t\tpath += '/';\n\t}\n\treturn path;\n}\n\n/**\n * Resolves a path and returns it only when it stays under a parent path.\n *\n * Absolute paths are checked as-is. Relative paths are resolved from the\n * parent path. The parent itself is not considered to be under the parent.\n * Paths containing null bytes are rejected before resolution.\n *\n * @param path The absolute or relative path to resolve.\n * @param parentPath The path the result must stay under.\n * @returns The normalized resolved path, or undefined when it is not a child.\n */\nexport function resolvePathUnder(path: string, parentPath: string) {\n\tif (path.includes('\\0') || parentPath.includes('\\0')) {\n\t\treturn undefined;\n\t}\n\tconst normalizedParentPath = normalizePath(parentPath);\n\tif (!normalizedParentPath) {\n\t\treturn undefined;\n\t}\n\tconst resolvedPath = normalizePath(\n\t\tpath.startsWith('/') ? path : joinPaths(normalizedParentPath, path)\n\t);\n\tif (\n\t\tresolvedPath === normalizedParentPath ||\n\t\t!isParentOf(normalizedParentPath, resolvedPath)\n\t) {\n\t\treturn undefined;\n\t}\n\treturn resolvedPath;\n}\n\n/**\n * Returns the directory name of a path.\n *\n * @param path\n * @returns\n */\nexport function dirname(path: string) {\n\tif (path === '/') {\n\t\treturn '/';\n\t}\n\n\tpath = normalizePath(path);\n\n\tconst lastSlash = path.lastIndexOf('/');\n\tif (lastSlash === -1) {\n\t\treturn '';\n\t} else if (lastSlash === 0) {\n\t\treturn '/';\n\t}\n\treturn path.substr(0, lastSlash);\n}\n\n/**\n * Returns the last portion of a path.\n *\n * @param path - The path to extract the basename from.\n * @returns The basename of the path.\n */\nexport function basename(path: string) {\n\tif (path === '/') {\n\t\treturn '/';\n\t}\n\n\tpath = normalizePath(path);\n\n\tconst lastSlash = path.lastIndexOf('/');\n\tif (lastSlash === -1) {\n\t\treturn path;\n\t}\n\treturn path.substr(lastSlash + 1);\n}\n\n/**\n * Normalizes a path.\n *\n * For example:\n *\n * > normalizePath('wordpress/wp-content/../')\n * 'wordpress'\n *\n * @param path\n * @returns\n */\nexport function normalizePath(path: string) {\n\tconst isAbsolute = path[0] === '/';\n\tpath = normalizePathsArray(\n\t\tpath.split('/').filter((p: any) => !!p),\n\t\t!isAbsolute\n\t).join('/');\n\treturn (isAbsolute ? '/' : '') + path.replace(/\\/$/, '');\n}\n\n/**\n * Normalizes paths.\n *\n * For example:\n *\n * > normalizePathsArray(['wordpress', 'wp-content', '..', '', '.',\n * 'wp-includes']) ['wordpress', 'wp-includes']\n *\n * @param parts parts of the path to normalize\n * @param allowAboveRoot allow paths above the root\n * @returns normalized paths\n */\nexport function normalizePathsArray(parts: string[], allowAboveRoot: boolean) {\n\tlet up = 0;\n\tfor (let i = parts.length - 1; i >= 0; i--) {\n\t\tconst last = parts[i];\n\t\tif (last === '.') {\n\t\t\tparts.splice(i, 1);\n\t\t} else if (last === '..') {\n\t\t\tparts.splice(i, 1);\n\t\t\tup++;\n\t\t} else if (up) {\n\t\t\tparts.splice(i, 1);\n\t\t\tup--;\n\t\t}\n\t}\n\tif (allowAboveRoot) {\n\t\tfor (; up; up--) {\n\t\t\tparts.unshift('..');\n\t\t}\n\t}\n\treturn parts;\n}\n\n/**\n * Checks if the given parent path is an ancestor of the given child path.\n *\n * @param parent The parent path to check.\n * @param child The child path to verify against the parent.\n * @returns Whether the `parent` path is an ancestor of the `child` path.\n */\nexport function isParentOf(parent: string, child: string) {\n\tif (parent === '/') {\n\t\treturn true;\n\t}\n\tparent = normalizePath(parent);\n\tchild = normalizePath(child);\n\treturn child.startsWith(parent + '/') || child === parent;\n}\n\n/**\n * Guarantees a path is absolute by prepending `/` if needed.\n *\n * Useful when working with user-provided paths that might be relative,\n * or when you need to normalize edge cases like empty strings.\n *\n * For example:\n *\n * > ensureAbsolutePath('wp-content/uploads')\n * '/wp-content/uploads'\n *\n * > ensureAbsolutePath('/already/absolute')\n * '/already/absolute'\n *\n * > ensureAbsolutePath('')\n * '/'\n *\n * @param path - The path to make absolute.\n * @returns An absolute, normalized path starting with `/`.\n */\nexport function ensureAbsolutePath(path: string) {\n\treturn joinPaths('/', normalizePath(path || '/'));\n}\n\n/**\n * Converts a native OS path to a POSIX-style path.\n *\n * Transformations:\n * 1. Backslashes → forward slashes\n * 2. Windows drive letter `C:\\` → `/C/` (colons are invalid in\n *    Emscripten VFS paths and cause ENOTDIR errno 28)\n *\n * On POSIX systems this is effectively a no-op.\n *\n * @see https://github.com/emscripten-core/emscripten/issues/17829\n */\nexport function toPosixPath(nativePath: string): string {\n\tlet result = nativePath.replaceAll('\\\\', '/');\n\t// Handle Windows drive letter: C:/ → /C/\n\tconst driveMatch = result.match(/^([A-Za-z]):\\//);\n\tif (driveMatch) {\n\t\tresult = '/' + driveMatch[1] + result.slice(2);\n\t}\n\treturn result;\n}\n","/**\n * Polyfills Node.js EventEmitter API. The main goal is to enable\n * using a child_process.spawn()-like API in both Node.js and the browser.\n *\n * @see https://nodejs.org/api/events.html#events_class_eventemitter\n */\ntype Listener = (...args: any[]) => any;\n\nexport class EventEmitterPolyfill {\n\tlisteners: Record<string, Listener[]> = {};\n\temit(eventName: string, data?: any) {\n\t\tif (this.listeners[eventName]) {\n\t\t\tthis.listeners[eventName].forEach(function (listener) {\n\t\t\t\tlistener(data);\n\t\t\t});\n\t\t}\n\t}\n\ton(eventName: string, listener: Listener) {\n\t\tif (!this.listeners[eventName]) {\n\t\t\tthis.listeners[eventName] = [];\n\t\t}\n\t\tthis.listeners[eventName].push(listener);\n\t}\n\tonce(eventName: string, listener: Listener) {\n\t\tconst wrappedListener = (...args: any[]) => {\n\t\t\tthis.off(eventName, wrappedListener);\n\t\t\tlistener(...args);\n\t\t};\n\t\tthis.on(eventName, wrappedListener);\n\t}\n\toff(eventName: string, listener: Listener) {\n\t\tif (this.listeners[eventName]) {\n\t\t\tthis.listeners[eventName] = this.listeners[eventName].filter(\n\t\t\t\t(l) => l !== listener\n\t\t\t);\n\t\t}\n\t}\n}\n","/**\n * Naive shell command parser.\n * Ensures that commands like `wp option set blogname \"My blog name\"` are split\n * into `['wp', 'option', 'set', 'blogname', 'My blog name']` instead of\n * `['wp', 'option', 'set', 'blogname', 'My', 'blog', 'name']`.\n *\n * @param command\n * @returns\n */\nexport function splitShellCommand(command: string) {\n\tconst MODE_UNQUOTED = 0;\n\tconst MODE_IN_QUOTE = 1;\n\n\tlet mode = MODE_UNQUOTED;\n\tlet quote = '';\n\n\tconst parts: string[] = [];\n\tlet currentPart = '';\n\tfor (let i = 0; i < command.length; i++) {\n\t\tconst char = command[i];\n\t\tif (char === '\\\\') {\n\t\t\t// Escaped quotes are treated as normal characters\n\t\t\t// This is a very naive approach to escaping, but it's good enough for\n\t\t\t// now. @TODO: Iterate on this later, perhaps using bun shell. @see https://github.com/WordPress/wordpress-playground/issues/1062\n\t\t\tif (command[i + 1] === '\"' || command[i + 1] === \"'\") {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tcurrentPart += command[i];\n\t\t} else if (mode === MODE_UNQUOTED) {\n\t\t\tif (char === '\"' || char === \"'\") {\n\t\t\t\tmode = MODE_IN_QUOTE;\n\t\t\t\tquote = char;\n\t\t\t} else if (char.match(/\\s/)) {\n\t\t\t\tif (currentPart.trim().length) {\n\t\t\t\t\tparts.push(currentPart.trim());\n\t\t\t\t}\n\t\t\t\tcurrentPart = char;\n\t\t\t} else if (parts.length && !currentPart) {\n\t\t\t\t// We just closed a quote to continue the same\n\t\t\t\t// argument with different escaping style, e.g.:\n\t\t\t\t// php -r 'require '\\''vendor/autoload.php'\\''\n\t\t\t\tcurrentPart = parts.pop()! + char;\n\t\t\t} else {\n\t\t\t\tcurrentPart += char;\n\t\t\t}\n\t\t} else if (mode === MODE_IN_QUOTE) {\n\t\t\tif (char === quote) {\n\t\t\t\tmode = MODE_UNQUOTED;\n\t\t\t\tquote = '';\n\t\t\t} else {\n\t\t\t\tcurrentPart += char;\n\t\t\t}\n\t\t}\n\t}\n\tif (currentPart) {\n\t\tparts.push(currentPart.trim());\n\t}\n\treturn parts;\n}\n","/**\n * Polyfills Node.js WritableStream API. The main goal is to enable\n * using a child_process.spawn()-like API in both Node.js and the browser.\n *\n * @see https://nodejs.org/api/stream.html#stream_writable_end_chunk_encoding_callback\n */\nimport { EventEmitterPolyfill } from './event-emitter-polyfill';\n\nexport interface WritableOptions {\n\thighWaterMark?: number;\n\tdecodeStrings?: boolean;\n\tdefaultEncoding?: BufferEncoding;\n\twrite: (chunk: any, encoding: BufferEncoding, cb: WriteCallback) => void;\n}\n\nexport type WriteCallback = (error?: Error | null) => void;\n\nexport class WritablePolyfill extends EventEmitterPolyfill {\n\tprivate buffer: Array<{\n\t\tchunk: any;\n\t\tencoding: BufferEncoding;\n\t\tcb: WriteCallback;\n\t}> = [];\n\tprivate writing = false;\n\tpublic ended = false;\n\tprivate length = 0;\n\tprivate highWaterMark: number;\n\tprivate decodeStrings: boolean;\n\tprivate defaultEncoding: BufferEncoding;\n\tprivate defer: (fn: () => void) => void;\n\tprivate _write: (\n\t\tchunk: any,\n\t\tencoding: BufferEncoding,\n\t\tcb: WriteCallback\n\t) => void;\n\n\tconstructor(opts: WritableOptions) {\n\t\tsuper();\n\t\tif (!opts.write) {\n\t\t\tthrow new Error('WritablePolyfill requires write option');\n\t\t}\n\t\tthis._write = opts.write;\n\t\tthis.highWaterMark = opts.highWaterMark ?? 16 * 1024;\n\t\tthis.decodeStrings = opts.decodeStrings ?? true;\n\t\tthis.defaultEncoding = opts.defaultEncoding ?? 'utf8';\n\t\t// queueMicrotask keeps browser support; fallback for older environments.\n\t\tthis.defer =\n\t\t\ttypeof queueMicrotask === 'function'\n\t\t\t\t? queueMicrotask\n\t\t\t\t: (fn) => setTimeout(fn, 0);\n\t}\n\n\twrite(\n\t\tchunk: any,\n\t\tencoding: BufferEncoding | WriteCallback = this.defaultEncoding,\n\t\tcb: WriteCallback = () => {}\n\t): boolean {\n\t\tif (typeof encoding === 'function') {\n\t\t\tcb = encoding as WriteCallback;\n\t\t\tencoding = this.defaultEncoding;\n\t\t}\n\n\t\tif (this.ended) {\n\t\t\tconst err = new Error('write after end');\n\t\t\t// We can't call this.defer() directly. If this.defer is\n\t\t\t// `queueMicrotask`, a `this.defer()` call will pass the\n\t\t\t// WritablePolyfill instance as `this` argument and cause\n\t\t\t// the browser to throw an error similar to \"Invalid\n\t\t\t// invocation\".\n\t\t\tconst defer = this.defer;\n\t\t\tdefer(() => cb(err));\n\t\t\tthis.emit('error', err);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.decodeStrings && typeof chunk === 'string') {\n\t\t\tif (\n\t\t\t\ttypeof Buffer !== 'undefined' &&\n\t\t\t\ttypeof (Buffer as any).from === 'function'\n\t\t\t) {\n\t\t\t\tchunk = Buffer.from(chunk, encoding as BufferEncoding);\n\t\t\t} else if (typeof TextEncoder !== 'undefined') {\n\t\t\t\tchunk = new TextEncoder().encode(chunk);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'String chunks are not supported in this environment: Buffer and TextEncoder are unavailable.'\n\t\t\t\t);\n\t\t\t}\n\t\t\tencoding = 'buffer' as BufferEncoding;\n\t\t}\n\n\t\tthis.length += chunk.length ?? 1;\n\t\tconst needDrain = this.length >= this.highWaterMark;\n\n\t\tthis.buffer.push({ chunk, encoding: encoding as BufferEncoding, cb });\n\n\t\tif (!this.writing) this._clearBuffer();\n\n\t\treturn !needDrain;\n\t}\n\n\tend(\n\t\tchunk?: any,\n\t\tencoding?: BufferEncoding | WriteCallback,\n\t\tcb?: WriteCallback\n\t): void {\n\t\tif (typeof chunk === 'function') {\n\t\t\tcb = chunk;\n\t\t\tchunk = undefined;\n\t\t} else if (typeof encoding === 'function') {\n\t\t\tcb = encoding as WriteCallback;\n\t\t\tencoding = undefined;\n\t\t}\n\n\t\tif (chunk !== undefined)\n\t\t\tthis.write(chunk, encoding as BufferEncoding, () => {});\n\t\tthis.ended = true;\n\t\tif (!this.writing) this._clearBuffer();\n\t\tif (cb) this.defer(cb);\n\t}\n\n\t// Stubs kept for API parity; add logic if you depend on corking.\n\tcork(): void {}\n\tuncork(): void {}\n\n\tsetDefaultEncoding(enc: BufferEncoding): this {\n\t\tthis.defaultEncoding = enc;\n\t\treturn this;\n\t}\n\n\tprivate _clearBuffer(): void {\n\t\tconst entry = this.buffer.shift();\n\t\tif (!entry) {\n\t\t\tif (this.ended) this.emit('finish');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.writing = true;\n\t\tthis._write(entry.chunk, entry.encoding, (err?: Error | null) => {\n\t\t\tthis.writing = false;\n\t\t\tthis.length -= entry.chunk.length ?? 1;\n\t\t\tif (err) this.emit('error', err);\n\t\t\tentry.cb(err);\n\n\t\t\tif (this.buffer.length) {\n\t\t\t\tthis._clearBuffer();\n\t\t\t} else {\n\t\t\t\tif (this.length < this.highWaterMark) this.emit('drain');\n\t\t\t\tif (this.ended) this.emit('finish');\n\t\t\t}\n\t\t});\n\t}\n}\n","import { EventEmitterPolyfill } from './event-emitter-polyfill';\nimport { splitShellCommand } from './split-shell-command';\nimport { WritablePolyfill, type WriteCallback } from './writable-polyfill';\n\ntype Listener = (...args: any[]) => any;\n\nexport interface ProcessOptions {\n\tcwd?: string;\n\tenv?: Record<string, string>;\n}\n\n/**\n * Usage:\n * ```ts\n * php.setSpawnHandler(\n *   createSpawnHandler(function (command, processApi) {\n *     console.log(processApi.flushStdin());\n *     processApi.stdout('/\\n/tmp\\n/home');\n *\t   processApi.exit(0);\n *   })\n * );\n * ```\n * @param program\n * @returns\n */\nexport function createSpawnHandler(\n\tprogram: (\n\t\tcommand: string[],\n\t\tprocessApi: ProcessApi,\n\t\toptions: ProcessOptions\n\t) => void | Promise<void>\n): any {\n\treturn function (\n\t\tcommand: string | string[],\n\t\targsArray: string[] = [],\n\t\toptions: ProcessOptions = {}\n\t) {\n\t\tconst childProcess = new ChildProcess();\n\t\tconst processApi = new ProcessApi(childProcess);\n\t\t// Give PHP a chance to register listeners\n\t\tsetTimeout(async () => {\n\t\t\tlet commandArray = [];\n\t\t\tif (argsArray.length) {\n\t\t\t\tcommandArray = [command as string, ...argsArray];\n\t\t\t} else if (typeof command === 'string') {\n\t\t\t\tcommandArray = splitShellCommand(command);\n\t\t\t} else if (Array.isArray(command)) {\n\t\t\t\tcommandArray = command;\n\t\t\t} else {\n\t\t\t\tthrow new Error('Invalid command ', command);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst promise = program(commandArray, processApi, options);\n\t\t\t\tif (\n\t\t\t\t\ttypeof promise !== 'object' ||\n\t\t\t\t\tpromise === null ||\n\t\t\t\t\t!('then' in promise)\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`The program callback passed to createSpawnHandler() did not return a promise. It indicates there's a bug in your code. ` +\n\t\t\t\t\t\t\t`The callback must return a promise. PHP cannot interact with program that synchronously exists at the end of the proc_open() ` +\n\t\t\t\t\t\t\t`call. All the streams would be closed already. Make sure to put an \"await new Promise(resolve => setTimeout(resolve, 1))` +\n\t\t\t\t\t\t\t`before calling processApi.exit(0) in your callback to let PHP catch up with the stdout data.`\n\t\t\t\t\t);\n\t\t\t\t} else if (processApi.exited) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`The program callback passed to createSpawnHandler() exited synchronously. It indicates there's a bug in your code. ` +\n\t\t\t\t\t\t\t`The callback must return a promise. PHP cannot interact with program that synchronously exists at the end of the proc_open() ` +\n\t\t\t\t\t\t\t`call. All the streams would be closed already. Make sure to put an \"await new Promise(resolve => setTimeout(resolve, 1))` +\n\t\t\t\t\t\t\t`before calling processApi.exit(0) in your callback to let PHP catch up with the stdout data.`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tchildProcess.emit('spawn', true);\n\t\t\t\tawait promise;\n\t\t\t} catch (e) {\n\t\t\t\tchildProcess.emit('error', e);\n\t\t\t\tif (\n\t\t\t\t\ttypeof e === 'object' &&\n\t\t\t\t\te !== null &&\n\t\t\t\t\t'message' in e &&\n\t\t\t\t\ttypeof e.message === 'string'\n\t\t\t\t) {\n\t\t\t\t\tprocessApi.stderr(e.message);\n\t\t\t\t}\n\t\t\t\tprocessApi.exit(1);\n\t\t\t}\n\t\t});\n\t\treturn childProcess;\n\t};\n}\n\nexport class ProcessApi extends EventEmitterPolyfill {\n\tpublic exited = false;\n\t/**\n\t * Keeps track of the data that was written to stdin before the\n\t * first listener was registered.\n\t */\n\tprivate stdinBuffer: Uint8Array[] | null = [];\n\tpublic childProcess: ChildProcess;\n\tconstructor(childProcess: ChildProcess) {\n\t\tsuper();\n\t\tthis.childProcess = childProcess;\n\t\tchildProcess.on('stdin', (data: Uint8Array) => {\n\t\t\tif (this.stdinBuffer) {\n\t\t\t\t// Need to clone the data buffer as it's reused by PHP\n\t\t\t\t// and the next data chunk will overwrite the previous one.\n\t\t\t\tthis.stdinBuffer.push(data.slice());\n\t\t\t} else {\n\t\t\t\tthis.emit('stdin', data);\n\t\t\t}\n\t\t});\n\t}\n\tstdinEnd() {\n\t\tif (!this.childProcess.stdin.ended) {\n\t\t\tthis.childProcess.stdin.end();\n\t\t}\n\t}\n\tstdout(data: string | ArrayBuffer) {\n\t\tthis.childProcess.stdout.write(data);\n\t}\n\tstdoutEnd() {\n\t\tif (!this.childProcess.stdout.ended) {\n\t\t\tthis.childProcess.stdout.end();\n\t\t}\n\t}\n\tstderr(data: string | ArrayBuffer) {\n\t\tthis.childProcess.stderr.write(data);\n\t}\n\tstderrEnd() {\n\t\tif (!this.childProcess.stderr.ended) {\n\t\t\tthis.childProcess.stderr.end();\n\t\t}\n\t}\n\tnotifySpawn() {\n\t\tthis.childProcess.emit('spawn', true);\n\t}\n\texit(code: number) {\n\t\tif (!this.exited) {\n\t\t\tthis.exited = true;\n\t\t\tthis.stdinEnd();\n\t\t\tthis.stdoutEnd();\n\t\t\tthis.stderrEnd();\n\t\t\tthis.childProcess.emit('exit', code);\n\t\t}\n\t}\n\toverride on(eventName: string, listener: Listener) {\n\t\tsuper.on(eventName, listener);\n\t\t/**\n\t\t * If it's the first stdin listener, flush all the data we've\n\t\t * buffered so far.\n\t\t */\n\t\tif (eventName === 'stdin' && this.stdinBuffer) {\n\t\t\tfor (let i = 0; i < this.stdinBuffer.length; i++) {\n\t\t\t\tthis.emit('stdin', this.stdinBuffer[i]);\n\t\t\t}\n\t\t\tthis.stdinBuffer = null;\n\t\t}\n\t}\n}\n\nlet lastPid = 9743;\nexport class ChildProcess extends EventEmitterPolyfill {\n\tstdout: WritablePolyfill;\n\tstderr: WritablePolyfill;\n\tstdin: WritablePolyfill;\n\tpid: number;\n\tconstructor(pid = lastPid++) {\n\t\tsuper();\n\t\tthis.pid = pid;\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tconst self = this;\n\t\tthis.stdout = new WritablePolyfill({\n\t\t\twrite(data: any, encoding: BufferEncoding, cb: WriteCallback) {\n\t\t\t\tself.stdout.emit('data', data);\n\t\t\t\tcb();\n\t\t\t},\n\t\t});\n\t\tthis.stderr = new WritablePolyfill({\n\t\t\twrite: (data: any, encoding: BufferEncoding, cb: WriteCallback) => {\n\t\t\t\tself.stderr.emit('data', data);\n\t\t\t\tcb();\n\t\t\t},\n\t\t});\n\t\tthis.stdin = new WritablePolyfill({\n\t\t\twrite: (data: any, encoding: BufferEncoding, cb: WriteCallback) => {\n\t\t\t\tself.emit('stdin', data);\n\t\t\t\tcb();\n\t\t\t},\n\t\t});\n\t}\n}\n","/**\n * Explicitly marks an event whose `stdin` ReadableStream needs an independent\n * branch per listener and must be transferred across worker boundaries. The\n * global symbol registry keeps the marker stable if this package is loaded\n * more than once in the same realm.\n */\nexport const phpEventStdinTransfer = Symbol.for(\n\t'@php-wasm/php-event-stdin-transfer'\n);\n\nexport type PHPEventWithStdinTransfer = {\n\ttype: string;\n\tstdin: ReadableStream<Uint8Array>;\n\t[phpEventStdinTransfer]: true;\n};\n","import { createSpawnHandler } from '../create-spawn-handler';\nimport {\n\tphpEventStdinTransfer,\n\ttype PHPEventWithStdinTransfer,\n} from '../php-event';\n\n/**\n * Limit captured sendmail stdin to 20 MB to match common email size limits.\n *\n * Gmail limits email attachments to 25 MB https://support.google.com/mail/answer/6584\n * Outlook limits email attachments to 20 MB https://support.microsoft.com/outlook/reduce-attachment-size-to-send-large-files-with-outlook\n */\nexport const SENDMAIL_CAPTURE_MAX_SIZE = 20 * 1024 * 1024;\n\n/**\n * Emitted when a sendmail null transport receives the first stdin bytes from\n * `mail()`, `popen()`, `proc_open()`, or any other spawn of a `sendmail` binary.\n */\nexport interface PHPSendmailSpawnedEvent extends PHPEventWithStdinTransfer {\n\ttype: 'sendmail.spawned';\n}\n\n/**\n * Creates a sendmail-compatible null transport for the given PHP instance.\n * Every message handed to sendmail – via mail(), proc_open(), etc. – is streamed\n * from stdin, dispatched as a `sendmail.spawned` event, and never delivered.\n * A listener that wants real delivery must relay the message itself.\n *\n * The captured payload is exposed as the raw bytes written to sendmail stdin.\n *\n * This stream does not apply backpressure to PHP. Each listener queues unread\n * chunks in JavaScript memory when it reads more slowly than PHP writes. The\n * source accepts at most SENDMAIL_CAPTURE_MAX_SIZE bytes. Cancelling the stream\n * stops delivery through that stream without terminating the sendmail process.\n */\nexport function sendmailSpawnHandler(php: {\n\tdispatchEvent: (event: PHPSendmailSpawnedEvent) => void;\n}) {\n\treturn createSpawnHandler(async function (commandArray, processApi) {\n\t\tlet totalLength = 0;\n\t\tlet dispatched = false;\n\t\tlet exceededMaxSize = false;\n\t\tlet streamCancelled = false;\n\t\tlet controller: ReadableStreamDefaultController<Uint8Array>;\n\t\t// Construct the stream before registering stdin. Event dispatch is synchronous,\n\t\t// and a listener may start reading as soon as the first chunk arrives.\n\t\tconst stdinStream = new ReadableStream<Uint8Array>({\n\t\t\tstart(streamController) {\n\t\t\t\tcontroller = streamController;\n\t\t\t},\n\t\t\tcancel() {\n\t\t\t\t// Cancellation only means no reader wants more bytes from this source. Keep\n\t\t\t\t// the null transport alive so PHP can finish writing and receive an exit code.\n\t\t\t\tstreamCancelled = true;\n\t\t\t},\n\t\t});\n\n\t\tprocessApi.on('stdin', (data: Uint8Array) => {\n\t\t\tif (!dispatched) {\n\t\t\t\t// Do not publish an email until sendmail receives actual message bytes. An\n\t\t\t\t// invocation that closes stdin immediately is a failed send, not an empty email.\n\t\t\t\tdispatched = true;\n\t\t\t\tphp.dispatchEvent({\n\t\t\t\t\ttype: 'sendmail.spawned',\n\t\t\t\t\tstdin: stdinStream,\n\t\t\t\t\t[phpEventStdinTransfer]: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\ttotalLength += data.length;\n\t\t\tif (totalLength > SENDMAIL_CAPTURE_MAX_SIZE) {\n\t\t\t\t// Fail the consumer now, but keep draining stdin. Exiting here would close\n\t\t\t\t// PHP's write end before the spawning code has finished with the process.\n\t\t\t\texceededMaxSize = true;\n\t\t\t\ttry {\n\t\t\t\t\tcontroller!.error(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`sendmail: Message size exceeds fixed maximum message size (${SENDMAIL_CAPTURE_MAX_SIZE})`\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} catch {\n\t\t\t\t\t// The consumer may have cancelled the stream.\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!streamCancelled) {\n\t\t\t\t// The PHP bridge reuses its input buffer for later chunks. A stream reader\n\t\t\t\t// may retain this one indefinitely, so it must receive an owned copy.\n\t\t\t\tcontroller!.enqueue(data.slice());\n\t\t\t}\n\t\t});\n\n\t\tconst stdin = processApi.childProcess\n\t\t\t.stdin as typeof processApi.childProcess.stdin & {\n\t\t\twritableEnded?: boolean;\n\t\t\twritableFinished?: boolean;\n\t\t};\n\t\t// proc_open() may write long after the spawn handler starts. Keep sendmail\n\t\t// alive until descriptor 0 closes or PHP will observe a truncated pipe.\n\t\tif (!(stdin.ended || stdin.writableEnded || stdin.writableFinished)) {\n\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\t// stdin can finish between the outer check and listener registration.\n\t\t\t\t// Recheck here or that race leaves the sendmail process waiting forever.\n\t\t\t\tif (\n\t\t\t\t\tstdin.ended ||\n\t\t\t\t\tstdin.writableEnded ||\n\t\t\t\t\tstdin.writableFinished\n\t\t\t\t) {\n\t\t\t\t\tresolve();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst finish = () => {\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\n\t\t\t\tstdin.once('finish', finish);\n\t\t\t});\n\t\t}\n\n\t\tif (exceededMaxSize) {\n\t\t\tprocessApi.stderr(\n\t\t\t\t`sendmail: Message size exceeds fixed maximum message size (${SENDMAIL_CAPTURE_MAX_SIZE})\\n`\n\t\t\t);\n\t\t\tprocessApi.exit(1);\n\t\t\treturn;\n\t\t}\n\n\t\tif (totalLength === 0) {\n\t\t\t// EX_TEMPFAIL is the sendmail-compatible result for an invocation that never\n\t\t\t// supplied a message. In particular, do not turn it into a successful no-op.\n\t\t\tprocessApi.stderr(\n\t\t\t\t'sendmail: fatal: No message bytes received over stdin\\n'\n\t\t\t);\n\t\t\tprocessApi.exit(75);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tcontroller!.close();\n\t\t} catch {\n\t\t\t// The consumer may have cancelled the stream.\n\t\t}\n\t\tprocessApi.exit(0);\n\t});\n}\n","export function randomString(\n\tlength = 36,\n\tspecialChars = '!@#$%^&*()_+=-[]/.,<>?'\n) {\n\tconst chars =\n\t\t'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' +\n\t\tspecialChars;\n\tlet result = '';\n\tfor (let i = length; i > 0; --i)\n\t\tresult += chars[Math.floor(Math.random() * chars.length)];\n\treturn result;\n}\n","/**\n * Formats a byte count for display in progress captions, e.g. \"17.9 MB\".\n */\nexport function formatBytes(bytes: number): string {\n\tif (bytes < 1024) {\n\t\treturn `${bytes} B`;\n\t}\n\tconst megabytes = bytes / 1024 / 1024;\n\tif (megabytes >= 1) {\n\t\treturn `${megabytes.toFixed(1)} MB`;\n\t}\n\tconst kilobytes = bytes / 1024;\n\treturn `${kilobytes.toFixed(0)} KB`;\n}\n","import { randomString } from './random-string';\n\nexport function randomFilename() {\n\treturn randomString(36, '-_');\n}\n","export function decodeBase64ToString(base64: string) {\n\treturn new TextDecoder().decode(decodeBase64ToUint8Array(base64));\n}\n\nexport function decodeBase64ToUint8Array(base64: string) {\n\tconst binaryString = atob(base64);\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\nexport function encodeStringAsBase64(str: string) {\n\treturn encodeUint8ArrayAsBase64(new TextEncoder().encode(str));\n}\n\nexport function encodeUint8ArrayAsBase64(bytes: Uint8Array) {\n\t/**\n\t * String.fromCharCode can only take up to 65536 arguments,\n\t * so we need to chunk the input into smaller pieces before converting it to a string.\n\t * Reference: https://bugs.webkit.org/show_bug.cgi?id=80797\n\t */\n\tconst chunkSize = 65536;\n\tconst chunks: string[] = [];\n\tfor (let i = 0; i < bytes.length; i += chunkSize) {\n\t\tchunks.push(String.fromCharCode(...bytes.subarray(i, i + chunkSize)));\n\t}\n\treturn btoa(chunks.join(''));\n}\n","import { encodeStringAsBase64 } from './base64';\n\nexport function phpVar(value: unknown): string {\n\treturn `json_decode(base64_decode('${encodeStringAsBase64(\n\t\tJSON.stringify(value)\n\t)}'), true)`;\n}\n\nexport function phpVars<T extends Record<string, unknown>>(\n\tvars: T\n): Record<keyof T, string> {\n\tconst result: Record<string, string> = {};\n\tfor (const key in vars) {\n\t\tresult[key] = phpVar(vars[key]);\n\t}\n\treturn result as Record<keyof T, string>;\n}\n","/**\n * Formats a string like sprintf().\n *\n * This function:\n * - Supports basic format specifiers: %s, %d, %f, %x, %%\n * - Supports bigint values\n *\n * The purpose of this function is for use in optional php-wasm tracing.\n * If we use printf-style formatting for trace messages, we let the trace\n * function decide whether to format and do not have to pay for formatting\n * unless tracing is enabled.\n */\nexport function sprintf(format: string, ...args: any[]): string {\n\tlet result = '';\n\tlet argIndex = 0;\n\n\tfor (let i = 0; i < format.length; i++) {\n\t\tif (format[i] === '%' && i + 1 < format.length) {\n\t\t\ti++;\n\t\t\tconst specifier = format[i];\n\n\t\t\tswitch (specifier) {\n\t\t\t\tcase 's': {\n\t\t\t\t\tconst arg = args[argIndex++];\n\t\t\t\t\tlet str;\n\t\t\t\t\tif (typeof arg === 'object') {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// If an object doesn't provide its own toString(),\n\t\t\t\t\t\t\t// try to represent it as JSON.\n\t\t\t\t\t\t\tstr = JSON.stringify(\n\t\t\t\t\t\t\t\targ,\n\t\t\t\t\t\t\t\t// Represent bigint values as strings in JSON.stringify().\n\t\t\t\t\t\t\t\t(key, value) => {\n\t\t\t\t\t\t\t\t\tif (typeof value === 'bigint') {\n\t\t\t\t\t\t\t\t\t\treturn `0x${value.toString(16)}`;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t2\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Ignore error and use default representation.\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstr = String(arg);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult += str;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'd': {\n\t\t\t\t\tconst arg = args[argIndex++];\n\t\t\t\t\tif (typeof arg === 'bigint') {\n\t\t\t\t\t\tresult += arg.toString();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult += Math.floor(Number(arg));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'f': {\n\t\t\t\t\tconst arg = args[argIndex++];\n\t\t\t\t\tif (typeof arg === 'bigint') {\n\t\t\t\t\t\tresult += Number(arg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult += Number(arg);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'x': {\n\t\t\t\t\tconst arg = args[argIndex++];\n\t\t\t\t\tif (typeof arg === 'bigint') {\n\t\t\t\t\t\tresult += arg.toString(16);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult += Math.floor(Number(arg)).toString(16);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase '%': {\n\t\t\t\t\tresult += '%';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tresult += '%' + specifier;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresult += format[i];\n\t\t}\n\t}\n\n\treturn result;\n}\n","import Semaphore, { AcquireTimeoutError } from './semaphore';\nexport { Semaphore, AcquireTimeoutError };\nexport { PhpWasmError } from './php-wasm-error';\nexport type { SemaphoreOptions } from './semaphore';\nexport {\n\tdirname,\n\tjoinPaths,\n\tbasename,\n\tnormalizePath,\n\tisParentOf,\n\tresolvePathUnder,\n\tensureAbsolutePath,\n\ttoPosixPath,\n} from './paths';\nexport { createSpawnHandler } from './create-spawn-handler';\nexport { phpEventStdinTransfer } from './php-event';\nexport type { PHPEventWithStdinTransfer } from './php-event';\nexport {\n\tsendmailSpawnHandler,\n\tSENDMAIL_CAPTURE_MAX_SIZE,\n} from './spawn-handlers/sendmail';\nexport type { PHPSendmailSpawnedEvent } from './spawn-handlers/sendmail';\nexport { randomString } from './random-string';\nexport { formatBytes } from './format-bytes';\nexport { randomFilename } from './random-filename';\nexport { splitShellCommand } from './split-shell-command';\nexport {\n\tdecodeBase64ToString,\n\tdecodeBase64ToUint8Array,\n\tencodeStringAsBase64,\n\tencodeUint8ArrayAsBase64,\n} from './base64';\nexport { WritablePolyfill, type WritableOptions } from './writable-polyfill';\nexport { EventEmitterPolyfill } from './event-emitter-polyfill';\nexport * from './php-vars';\n\nexport * from './sprintf';\n\nexport function concatUint8Arrays(arrays: Uint8Array[]): Uint8Array {\n\tlet totalLength = 0;\n\tarrays.forEach((a) => (totalLength += a.length));\n\tconst result = new Uint8Array(totalLength);\n\tlet offset = 0;\n\tarrays.forEach((a) => {\n\t\tresult.set(a, offset);\n\t\toffset += a.length;\n\t});\n\treturn result;\n}\n\nexport function concatArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer {\n\treturn concatUint8Arrays(buffers.map((b) => new Uint8Array(b)))\n\t\t.buffer as ArrayBuffer;\n}\n"],"names":["SleepFinished","sleep","ms","resolve","AcquireTimeoutError","Semaphore","concurrency","timeout","acquired","released","fn","release","PhpWasmError","message","userFriendlyMessage","joinPaths","paths","hasTrailingSlash","p","path","isAbsolute","trailingSlash","normalizePath","resolvePathUnder","parentPath","normalizedParentPath","resolvedPath","isParentOf","dirname","lastSlash","basename","normalizePathsArray","parts","allowAboveRoot","up","i","last","parent","child","ensureAbsolutePath","toPosixPath","nativePath","result","driveMatch","EventEmitterPolyfill","eventName","data","listener","wrappedListener","args","l","splitShellCommand","command","mode","quote","currentPart","char","WritablePolyfill","opts","chunk","encoding","cb","err","defer","needDrain","enc","entry","createSpawnHandler","program","argsArray","options","childProcess","ChildProcess","processApi","ProcessApi","commandArray","promise","e","code","lastPid","pid","self","phpEventStdinTransfer","SENDMAIL_CAPTURE_MAX_SIZE","sendmailSpawnHandler","php","totalLength","dispatched","exceededMaxSize","streamCancelled","controller","stdinStream","streamController","stdin","finish","randomString","length","specialChars","chars","formatBytes","bytes","megabytes","randomFilename","decodeBase64ToString","base64","decodeBase64ToUint8Array","binaryString","len","encodeStringAsBase64","str","encodeUint8ArrayAsBase64","chunks","phpVar","value","phpVars","vars","key","sprintf","format","argIndex","specifier","arg","concatUint8Arrays","arrays","a","offset","concatArrayBuffers","buffers","b"],"mappings":"gFAAO,MAAMA,EAAgB,OAAO,eAAe,EAE5C,SAASC,EAAMC,EAA2C,CAChE,OAAO,IAAI,QAASC,GAAY,CAC/B,WAAW,IAAMA,EAAQH,CAAa,EAAGE,CAAE,CAC5C,CAAC,CACF,CCOO,MAAME,UAA4B,KAAM,CAC9C,aAAc,CACb,MAAM,0BAA0B,CACjC,CACD,CAEA,MAAqBC,CAAU,CAM9B,YAAY,CAAE,YAAAC,EAAa,QAAAC,GAA6B,CALxD,KAAQ,SAAW,EAMlB,KAAK,YAAcD,EACnB,KAAK,QAAUC,EACf,KAAK,MAAQ,CAAA,CACd,CAEA,IAAI,WAAoB,CACvB,OAAO,KAAK,YAAc,KAAK,OAChC,CAEA,IAAI,SAAkB,CACrB,OAAO,KAAK,QACb,CAEA,MAAM,SAA+B,CAEpC,GAAI,KAAK,UAAY,KAAK,YAAa,CAEtC,MAAMC,EAAW,IAAI,QAAeL,GAAY,CAC/C,KAAK,MAAM,KAAKA,CAAO,CACxB,CAAC,EAGD,GAAI,KAAK,UAAY,OAAW,CAE/B,MAAMA,EAAU,KAAK,MAAM,GAAG,EAAE,EAKhC,GAJe,MAAM,QAAQ,KAAK,CACjCK,EACAP,EAAM,KAAK,OAAO,CAAA,CAClB,IACcD,EAEd,WAAK,MAAM,OAAO,KAAK,MAAM,QAAQG,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