bejamas 0.0.0-canary.0f00bcf
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/dist/generate-mdx-DHm_37lA.js +574 -0
- package/dist/generate-mdx-DHm_37lA.js.map +1 -0
- package/dist/index.js +10897 -0
- package/dist/index.js.map +1 -0
- package/dist/spinner-B-Vrcyil.js +3229 -0
- package/dist/spinner-B-Vrcyil.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["BUILTIN_REGISTRIES: z.infer<typeof registryConfigSchema>","cwd","cwd","cwd","type: ProjectInfo","config: z.infer<typeof rawConfigSchema>","errors: Record<string, boolean>","options","ERRORS.MISSING_DIR_OR_EMPTY_PROJECT","spinner","ERRORS.UNSUPPORTED_FRAMEWORK","ERRORS.TAILWIND_NOT_CONFIGURED","ERRORS.IMPORT_ALIAS_MISSING","context: RegistryContext","fs","process","path","cwd","detect","options","pkg","require","__tinyexec_cr","$","h","n","z","o","i","a","c","u","N","qt","It","zt","fe","me","he","de","x","a","lines","remove","l","i","c","$","init","run","count","clear","strip","prompt","figures","aborted","delimiter","EventEmitter","action","style","n","entriesToDisplay","wrap","date","meridiem","day","hours","month","year","number","cursor","options","noop","onExit","prompts","override","question","answer","prompts$1","platform","text","os","require$$0$1","tty","hasFlag","posix","isexe","checkStat","path","sync","checkMode","u","o","checkPathExt","exports","win32","require$$1$2","isWindows","getNotFoundError","getPathInfo","join","which","whichSync","link","cwd","options","options","objectToString","textEncoder","expression","process","options","addDefaultValue","lines","figures","identity","options","isexe","sync","fs","options","i","path","checkStat","isexe","sync","fs","path","options","u","o","isexe","options","path","path","which","i","resolve","pathKey","options","path","cwd","resolveCommand","path","fs","readShebang","path","isWin","parse","options","cp","spawn","options","spawnSync","options","platform","execFileCallback","path","process","path","cwd","execPath","options","options","normalizeSignal","number","context","isConnected","options","sendMessage","throwOnDisconnect","sendMessage","getCancelSignal","context","options","path","cwd","correctEncoding","cwd","path","process","crossSpawn","options","lines","process","path","cwd","options","options","#t","#n","#s","#e","#i","#r","asyncIterator","getStreamContents","init","noop","getStreamContents","options","noop","getStreamContents","options","noop","getStreamContents","options","textDecoder","lines","cwd","milliseconds","count","milliseconds","options","add","seconds","prettyMs","isNodeStream","isPlainObj","isReadableStream","isWritableStream","options","isPlainObj","isWritableStream","isNodeReadableStream","isNodeWritableStream","isNodeStream","process","options","isNodeStream","options","optionName","addProperties","value","options","addProperties","stripFinalNewline","stripFinalNewlineFunction","LF","Buffer","Buffer","textEncoder","identityGenerator","generators","options","options","lines","stripFinalNewline","path","options","options","getOneMessage","getEachMessage","process","getCancelSignal","sendMessage","getOneMessage","getEachMessage","options","PassThrough","options","Buffer","PassThroughStream","#streams","#onFinished","#unpipeEvent","#ended","#aborted","#streamPromises","aborted","increment","options","lines","stripFinalNewline","stripFinalNewline","lines","getStream","lines","lines","isVerbose","context","isNodeStream","promises","readable","writable","duplex","options","spawn","context","options","mapArguments","boundOptions","setBoundExeca","options","options","options","template: keyof typeof TEMPLATES","projectName: string","prompts","spinner","os","cwd","options","ERRORS.MISSING_DIR_OR_EMPTY_PROJECT","fs","dirname","resolve","existsSync","baseUrl: string","paths: Record<string, string[] | string>","probe: string | null","i","cwd","mapped: string","uiAbs: string | null","cssAbs: string | null","outResolved: string | null","relative","prompts","err: any","forwarded: string[]","i","pkg","URL","isVerbose","action","createRequire"],"sources":["../src/utils/errors.ts","../src/registry/constants.ts","../src/utils/resolve-import.ts","../src/utils/get-config.ts","../src/utils/get-package-info.ts","../src/utils/get-project-info.ts","../src/preflights/preflight-init.ts","../src/registry/context.ts","../../../node_modules/@antfu/ni/node_modules/package-manager-detector/dist/constants.mjs","../../../node_modules/@antfu/ni/node_modules/package-manager-detector/dist/detect.mjs","../../../node_modules/@antfu/ni/node_modules/tinyexec/dist/main.js","../../../node_modules/@antfu/ni/dist/shared/ni.b-W1u-ew.mjs","../src/utils/get-package-manager.ts","../src/registry/errors.ts","../src/utils/handle-error.ts","../../../node_modules/is-plain-obj/index.js","../../../node_modules/execa/lib/arguments/file-url.js","../../../node_modules/execa/lib/methods/parameters.js","../../../node_modules/execa/lib/utils/uint-array.js","../../../node_modules/execa/lib/methods/template.js","../../../node_modules/execa/lib/utils/standard-stream.js","../../../node_modules/execa/lib/arguments/specific.js","../../../node_modules/execa/lib/verbose/values.js","../../../node_modules/execa/lib/arguments/escape.js","../../../node_modules/figures/index.js","../../../node_modules/yoctocolors/base.js","../../../node_modules/execa/lib/verbose/default.js","../../../node_modules/execa/lib/verbose/custom.js","../../../node_modules/execa/lib/verbose/log.js","../../../node_modules/execa/lib/verbose/start.js","../../../node_modules/execa/lib/verbose/info.js","../../../node_modules/execa/lib/return/duration.js","../../../node_modules/execa/lib/arguments/command.js","../../../node_modules/isexe/windows.js","../../../node_modules/isexe/mode.js","../../../node_modules/isexe/index.js","../../../node_modules/which/which.js","../../../node_modules/path-key/index.js","../../../node_modules/cross-spawn/lib/util/resolveCommand.js","../../../node_modules/cross-spawn/lib/util/escape.js","../../../node_modules/shebang-regex/index.js","../../../node_modules/shebang-command/index.js","../../../node_modules/cross-spawn/lib/util/readShebang.js","../../../node_modules/cross-spawn/lib/parse.js","../../../node_modules/cross-spawn/lib/enoent.js","../../../node_modules/cross-spawn/index.js","../../../node_modules/npm-run-path/node_modules/path-key/index.js","../../../node_modules/unicorn-magic/node.js","../../../node_modules/npm-run-path/index.js","../../../node_modules/execa/lib/return/final-error.js","../../../node_modules/human-signals/build/src/realtime.js","../../../node_modules/human-signals/build/src/core.js","../../../node_modules/human-signals/build/src/signals.js","../../../node_modules/human-signals/build/src/main.js","../../../node_modules/execa/lib/terminate/signal.js","../../../node_modules/execa/lib/terminate/kill.js","../../../node_modules/execa/lib/utils/abort-signal.js","../../../node_modules/execa/lib/terminate/cancel.js","../../../node_modules/execa/lib/ipc/validation.js","../../../node_modules/execa/lib/utils/deferred.js","../../../node_modules/execa/lib/arguments/fd-options.js","../../../node_modules/execa/lib/utils/max-listeners.js","../../../node_modules/execa/lib/ipc/reference.js","../../../node_modules/execa/lib/ipc/incoming.js","../../../node_modules/execa/lib/ipc/forward.js","../../../node_modules/execa/lib/ipc/strict.js","../../../node_modules/execa/lib/ipc/outgoing.js","../../../node_modules/execa/lib/ipc/send.js","../../../node_modules/execa/lib/ipc/graceful.js","../../../node_modules/execa/lib/terminate/graceful.js","../../../node_modules/execa/lib/terminate/timeout.js","../../../node_modules/execa/lib/methods/node.js","../../../node_modules/execa/lib/ipc/ipc-input.js","../../../node_modules/execa/lib/arguments/encoding-option.js","../../../node_modules/execa/lib/arguments/cwd.js","../../../node_modules/execa/lib/arguments/options.js","../../../node_modules/execa/lib/arguments/shell.js","../../../node_modules/strip-final-newline/index.js","../../../node_modules/is-stream/index.js","../../../node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js","../../../node_modules/get-stream/source/stream.js","../../../node_modules/get-stream/source/contents.js","../../../node_modules/get-stream/source/utils.js","../../../node_modules/get-stream/source/array.js","../../../node_modules/get-stream/source/array-buffer.js","../../../node_modules/get-stream/source/string.js","../../../node_modules/execa/lib/io/max-buffer.js","../../../node_modules/execa/lib/return/message.js","../../../node_modules/execa/lib/return/result.js","../../../node_modules/parse-ms/index.js","../../../node_modules/pretty-ms/index.js","../../../node_modules/execa/lib/verbose/error.js","../../../node_modules/execa/lib/verbose/complete.js","../../../node_modules/execa/lib/return/reject.js","../../../node_modules/execa/lib/stdio/type.js","../../../node_modules/execa/lib/transform/object-mode.js","../../../node_modules/execa/lib/transform/normalize.js","../../../node_modules/execa/lib/stdio/direction.js","../../../node_modules/execa/lib/ipc/array.js","../../../node_modules/execa/lib/stdio/stdio-option.js","../../../node_modules/execa/lib/stdio/native.js","../../../node_modules/execa/lib/stdio/input-option.js","../../../node_modules/execa/lib/stdio/duplicate.js","../../../node_modules/execa/lib/stdio/handle.js","../../../node_modules/execa/lib/stdio/handle-sync.js","../../../node_modules/execa/lib/io/strip-newline.js","../../../node_modules/execa/lib/transform/split.js","../../../node_modules/execa/lib/transform/validate.js","../../../node_modules/execa/lib/transform/encoding-transform.js","../../../node_modules/execa/lib/transform/run-async.js","../../../node_modules/execa/lib/transform/run-sync.js","../../../node_modules/execa/lib/transform/generator.js","../../../node_modules/execa/lib/io/input-sync.js","../../../node_modules/execa/lib/verbose/output.js","../../../node_modules/execa/lib/io/output-sync.js","../../../node_modules/execa/lib/resolve/all-sync.js","../../../node_modules/execa/lib/resolve/exit-async.js","../../../node_modules/execa/lib/resolve/exit-sync.js","../../../node_modules/execa/lib/methods/main-sync.js","../../../node_modules/execa/lib/ipc/get-one.js","../../../node_modules/execa/lib/ipc/get-each.js","../../../node_modules/execa/lib/ipc/methods.js","../../../node_modules/execa/lib/return/early-error.js","../../../node_modules/execa/lib/stdio/handle-async.js","../../../node_modules/@sindresorhus/merge-streams/index.js","../../../node_modules/execa/lib/io/pipeline.js","../../../node_modules/execa/lib/io/output-async.js","../../../node_modules/execa/lib/terminate/cleanup.js","../../../node_modules/execa/lib/pipe/pipe-arguments.js","../../../node_modules/execa/lib/pipe/throw.js","../../../node_modules/execa/lib/pipe/sequence.js","../../../node_modules/execa/lib/pipe/streaming.js","../../../node_modules/execa/lib/pipe/abort.js","../../../node_modules/execa/lib/pipe/setup.js","../../../node_modules/execa/lib/io/iterate.js","../../../node_modules/execa/lib/io/contents.js","../../../node_modules/execa/lib/resolve/wait-stream.js","../../../node_modules/execa/lib/resolve/stdio.js","../../../node_modules/execa/lib/resolve/all-async.js","../../../node_modules/execa/lib/verbose/ipc.js","../../../node_modules/execa/lib/ipc/buffer-messages.js","../../../node_modules/execa/lib/resolve/wait-subprocess.js","../../../node_modules/execa/lib/convert/concurrent.js","../../../node_modules/execa/lib/convert/shared.js","../../../node_modules/execa/lib/convert/readable.js","../../../node_modules/execa/lib/convert/writable.js","../../../node_modules/execa/lib/convert/duplex.js","../../../node_modules/execa/lib/convert/iterable.js","../../../node_modules/execa/lib/convert/add.js","../../../node_modules/execa/lib/methods/promise.js","../../../node_modules/execa/lib/methods/main-async.js","../../../node_modules/execa/lib/methods/bind.js","../../../node_modules/execa/lib/methods/create.js","../../../node_modules/execa/lib/methods/command.js","../../../node_modules/execa/lib/methods/script.js","../../../node_modules/execa/index.js","../src/utils/create-project.ts","../src/commands/init.ts","../src/commands/docs.ts","../src/commands/add.ts","../src/index.ts"],"sourcesContent":["export const MISSING_DIR_OR_EMPTY_PROJECT = \"1\"\nexport const EXISTING_CONFIG = \"2\"\nexport const MISSING_CONFIG = \"3\"\nexport const FAILED_CONFIG_READ = \"4\"\nexport const TAILWIND_NOT_CONFIGURED = \"5\"\nexport const IMPORT_ALIAS_MISSING = \"6\"\nexport const UNSUPPORTED_FRAMEWORK = \"7\"\nexport const COMPONENT_URL_NOT_FOUND = \"8\"\nexport const COMPONENT_URL_UNAUTHORIZED = \"9\"\nexport const COMPONENT_URL_FORBIDDEN = \"10\"\nexport const COMPONENT_URL_BAD_REQUEST = \"11\"\nexport const COMPONENT_URL_INTERNAL_SERVER_ERROR = \"12\"\nexport const BUILD_MISSING_REGISTRY_FILE = \"13\"","import { registryConfigSchema } from \"shadcn/schema\"\nimport { z } from \"zod\"\n\nexport const REGISTRY_URL =\n process.env.REGISTRY_URL ?? \"http://localhost:4321/r\"\n\nexport const FALLBACK_STYLE = \"new-york-v4\"\n\nexport const BASE_COLORS = [\n {\n name: \"neutral\",\n label: \"Neutral\",\n },\n {\n name: \"gray\",\n label: \"Gray\",\n },\n {\n name: \"zinc\",\n label: \"Zinc\",\n },\n {\n name: \"stone\",\n label: \"Stone\",\n },\n {\n name: \"slate\",\n label: \"Slate\",\n },\n] as const\n\n// Built-in registries that are always available and cannot be overridden\nexport const BUILTIN_REGISTRIES: z.infer<typeof registryConfigSchema> = {\n \"@bejamas\": `${REGISTRY_URL}/{name}.json`,\n}\n\nexport const BUILTIN_MODULES = new Set([\n [\n // Node.js built-in modules\n // From https://github.com/sindresorhus/builtin-modules.\n \"node:assert\",\n \"assert\",\n \"node:assert/strict\",\n \"assert/strict\",\n \"node:async_hooks\",\n \"async_hooks\",\n \"node:buffer\",\n \"buffer\",\n \"node:child_process\",\n \"child_process\",\n \"node:cluster\",\n \"cluster\",\n \"node:console\",\n \"console\",\n \"node:constants\",\n \"constants\",\n \"node:crypto\",\n \"crypto\",\n \"node:dgram\",\n \"dgram\",\n \"node:diagnostics_channel\",\n \"diagnostics_channel\",\n \"node:dns\",\n \"dns\",\n \"node:dns/promises\",\n \"dns/promises\",\n \"node:domain\",\n \"domain\",\n \"node:events\",\n \"events\",\n \"node:fs\",\n \"fs\",\n \"node:fs/promises\",\n \"fs/promises\",\n \"node:http\",\n \"http\",\n \"node:http2\",\n \"http2\",\n \"node:https\",\n \"https\",\n \"node:inspector\",\n \"inspector\",\n \"node:inspector/promises\",\n \"inspector/promises\",\n \"node:module\",\n \"module\",\n \"node:net\",\n \"net\",\n \"node:os\",\n \"os\",\n \"node:path\",\n \"path\",\n \"node:path/posix\",\n \"path/posix\",\n \"node:path/win32\",\n \"path/win32\",\n \"node:perf_hooks\",\n \"perf_hooks\",\n \"node:process\",\n \"process\",\n \"node:querystring\",\n \"querystring\",\n \"node:quic\",\n \"node:readline\",\n \"readline\",\n \"node:readline/promises\",\n \"readline/promises\",\n \"node:repl\",\n \"repl\",\n \"node:sea\",\n \"node:sqlite\",\n \"node:stream\",\n \"stream\",\n \"node:stream/consumers\",\n \"stream/consumers\",\n \"node:stream/promises\",\n \"stream/promises\",\n \"node:stream/web\",\n \"stream/web\",\n \"node:string_decoder\",\n \"string_decoder\",\n \"node:test\",\n \"node:test/reporters\",\n \"node:timers\",\n \"timers\",\n \"node:timers/promises\",\n \"timers/promises\",\n \"node:tls\",\n \"tls\",\n \"node:trace_events\",\n \"trace_events\",\n \"node:tty\",\n \"tty\",\n \"node:url\",\n \"url\",\n \"node:util\",\n \"util\",\n \"node:util/types\",\n \"util/types\",\n \"node:v8\",\n \"v8\",\n \"node:vm\",\n \"vm\",\n \"node:wasi\",\n \"wasi\",\n \"node:worker_threads\",\n \"worker_threads\",\n \"node:zlib\",\n \"zlib\",\n\n // Bun built-in modules.\n \"bun\",\n \"bun:test\",\n \"bun:sqlite\",\n \"bun:ffi\",\n \"bun:jsc\",\n \"bun:internal\",\n ],\n])\n\nexport const DEPRECATED_COMPONENTS = [\n {\n name: \"toast\",\n deprecatedBy: \"sonner\",\n message:\n \"The toast component is deprecated. Use the sonner component instead.\",\n },\n {\n name: \"toaster\",\n deprecatedBy: \"sonner\",\n message:\n \"The toaster component is deprecated. Use the sonner component instead.\",\n },\n]","import { createMatchPath, type ConfigLoaderSuccessResult } from \"tsconfig-paths\"\n\nexport async function resolveImport(\n importPath: string,\n config: Pick<ConfigLoaderSuccessResult, \"absoluteBaseUrl\" | \"paths\">\n) {\n return createMatchPath(config.absoluteBaseUrl, config.paths)(\n importPath,\n undefined,\n () => true,\n [\".ts\", \".tsx\", \".jsx\", \".js\", \".css\"]\n )\n}","import path from \"path\";\nimport { BUILTIN_REGISTRIES } from \"@/src/registry/constants\";\nimport {\n configSchema,\n rawConfigSchema,\n workspaceConfigSchema,\n} from \"shadcn/schema\";\nimport { getProjectInfo } from \"@/src/utils/get-project-info\";\nimport { highlighter } from \"@/src/utils/highlighter\";\nimport { resolveImport } from \"@/src/utils/resolve-import\";\nimport { cosmiconfig } from \"cosmiconfig\";\nimport fg from \"fast-glob\";\nimport { loadConfig } from \"tsconfig-paths\";\nimport { z } from \"zod\";\n\nexport const DEFAULT_STYLE = \"default\";\nexport const DEFAULT_COMPONENTS = \"@/components\";\nexport const DEFAULT_UTILS = \"@/lib/utils\";\nexport const DEFAULT_TAILWIND_CSS = \"app/globals.css\";\nexport const DEFAULT_TAILWIND_CONFIG = \"tailwind.config.js\";\nexport const DEFAULT_TAILWIND_BASE_COLOR = \"slate\";\n\n// TODO: Figure out if we want to support all cosmiconfig formats.\n// A simple components.json file would be nice.\nexport const explorer = cosmiconfig(\"components\", {\n searchPlaces: [\"components.json\"],\n});\n\nexport type Config = z.infer<typeof configSchema>;\n\nexport async function getConfig(cwd: string) {\n const config = await getRawConfig(cwd);\n\n if (!config) {\n return null;\n }\n\n // Set default icon library if not provided.\n if (!config.iconLibrary) {\n config.iconLibrary = config.style === \"new-york\" ? \"radix\" : \"lucide\";\n }\n\n return await resolveConfigPaths(cwd, config);\n}\n\nexport async function resolveConfigPaths(\n cwd: string,\n config: z.infer<typeof rawConfigSchema>,\n) {\n // Merge built-in registries with user registries\n config.registries = {\n ...BUILTIN_REGISTRIES,\n ...(config.registries || {}),\n };\n\n // Read tsconfig.json.\n const tsConfig = await loadConfig(cwd);\n\n if (tsConfig.resultType === \"failed\") {\n throw new Error(\n `Failed to load ${config.tsx ? \"tsconfig\" : \"jsconfig\"}.json. ${\n tsConfig.message ?? \"\"\n }`.trim(),\n );\n }\n\n return configSchema.parse({\n ...config,\n resolvedPaths: {\n cwd,\n tailwindConfig: config.tailwind.config\n ? path.resolve(cwd, config.tailwind.config)\n : \"\",\n tailwindCss: path.resolve(cwd, config.tailwind.css),\n utils: await resolveImport(config.aliases[\"utils\"], tsConfig),\n components: await resolveImport(config.aliases[\"components\"], tsConfig),\n ui: config.aliases[\"ui\"]\n ? await resolveImport(config.aliases[\"ui\"], tsConfig)\n : path.resolve(\n (await resolveImport(config.aliases[\"components\"], tsConfig)) ??\n cwd,\n \"ui\",\n ),\n // TODO: Make this configurable.\n // For now, we assume the lib and hooks directories are one level up from the components directory.\n lib: config.aliases[\"lib\"]\n ? await resolveImport(config.aliases[\"lib\"], tsConfig)\n : path.resolve(\n (await resolveImport(config.aliases[\"utils\"], tsConfig)) ?? cwd,\n \"..\",\n ),\n hooks: config.aliases[\"hooks\"]\n ? await resolveImport(config.aliases[\"hooks\"], tsConfig)\n : path.resolve(\n (await resolveImport(config.aliases[\"components\"], tsConfig)) ??\n cwd,\n \"..\",\n \"hooks\",\n ),\n },\n });\n}\n\nexport async function getRawConfig(\n cwd: string,\n): Promise<z.infer<typeof rawConfigSchema> | null> {\n try {\n const configResult = await explorer.search(cwd);\n\n if (!configResult) {\n return null;\n }\n\n const config = rawConfigSchema.parse(configResult.config);\n\n // Check if user is trying to override built-in registries\n if (config.registries) {\n for (const registryName of Object.keys(config.registries)) {\n if (registryName in BUILTIN_REGISTRIES) {\n throw new Error(\n `\"${registryName}\" is a built-in registry and cannot be overridden.`,\n );\n }\n }\n }\n\n return config;\n } catch (error) {\n const componentPath = `${cwd}/components.json`;\n if (error instanceof Error && error.message.includes(\"reserved registry\")) {\n throw error;\n }\n throw new Error(\n `Invalid configuration found in ${highlighter.info(componentPath)}.`,\n );\n }\n}\n\n// Note: we can check for -workspace.yaml or \"workspace\" in package.json.\n// Since cwd is not necessarily the root of the project.\n// We'll instead check if ui aliases resolve to a different root.\nexport async function getWorkspaceConfig(config: Config) {\n let resolvedAliases: any = {};\n\n for (const key of Object.keys(config.aliases)) {\n if (!isAliasKey(key, config)) {\n continue;\n }\n\n const resolvedPath = config.resolvedPaths[key];\n const packageRoot = await findPackageRoot(\n config.resolvedPaths.cwd,\n resolvedPath,\n );\n\n if (!packageRoot) {\n resolvedAliases[key] = config;\n continue;\n }\n\n resolvedAliases[key] = await getConfig(packageRoot);\n }\n\n const result = workspaceConfigSchema.safeParse(resolvedAliases);\n if (!result.success) {\n return null;\n }\n\n return result.data;\n}\n\nexport async function findPackageRoot(cwd: string, resolvedPath: string) {\n const commonRoot = findCommonRoot(cwd, resolvedPath);\n const relativePath = path.relative(commonRoot, resolvedPath);\n\n const packageRoots = await fg.glob(\"**/package.json\", {\n cwd: commonRoot,\n deep: 3,\n ignore: [\"**/node_modules/**\", \"**/dist/**\", \"**/build/**\", \"**/public/**\"],\n });\n\n const matchingPackageRoot = packageRoots\n .map((pkgPath) => path.dirname(pkgPath))\n .find((pkgDir) => relativePath.startsWith(pkgDir));\n\n return matchingPackageRoot\n ? path.join(commonRoot, matchingPackageRoot)\n : null;\n}\n\nfunction isAliasKey(\n key: string,\n config: Config,\n): key is keyof Config[\"aliases\"] {\n return Object.keys(config.resolvedPaths)\n .filter((key) => key !== \"utils\")\n .includes(key);\n}\n\nexport function findCommonRoot(cwd: string, resolvedPath: string) {\n const parts1 = cwd.split(path.sep);\n const parts2 = resolvedPath.split(path.sep);\n const commonParts = [];\n\n for (let i = 0; i < Math.min(parts1.length, parts2.length); i++) {\n if (parts1[i] !== parts2[i]) {\n break;\n }\n commonParts.push(parts1[i]);\n }\n\n return commonParts.join(path.sep);\n}\n\n// TODO: Cache this call.\nexport async function getTargetStyleFromConfig(cwd: string, fallback: string) {\n const projectInfo = await getProjectInfo(cwd);\n return projectInfo?.tailwindVersion === \"v4\" ? \"new-york-v4\" : fallback;\n}\n\ntype DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\n\n/**\n * Creates a config object with sensible defaults.\n * Useful for universal registry items that bypass framework detection.\n *\n * @param partial - Partial config values to override defaults\n * @returns A complete Config object\n */\nexport function createConfig(partial?: DeepPartial<Config>): Config {\n const defaultConfig: Config = {\n resolvedPaths: {\n cwd: process.cwd(),\n tailwindConfig: \"\",\n tailwindCss: \"\",\n utils: \"\",\n components: \"\",\n ui: \"\",\n lib: \"\",\n hooks: \"\",\n },\n style: \"\",\n tailwind: {\n config: \"\",\n css: \"\",\n baseColor: \"\",\n cssVariables: false,\n },\n rsc: false,\n tsx: true,\n aliases: {\n components: \"\",\n utils: \"\",\n },\n registries: {\n ...BUILTIN_REGISTRIES,\n },\n };\n\n // Deep merge the partial config with defaults\n if (partial) {\n return {\n ...defaultConfig,\n ...partial,\n resolvedPaths: {\n ...defaultConfig.resolvedPaths,\n ...(partial.resolvedPaths || {}),\n },\n tailwind: {\n ...defaultConfig.tailwind,\n ...(partial.tailwind || {}),\n },\n aliases: {\n ...defaultConfig.aliases,\n ...(partial.aliases || {}),\n },\n registries: {\n ...defaultConfig.registries,\n ...(partial.registries || {}),\n },\n };\n }\n\n return defaultConfig;\n}\n","import path from \"path\"\nimport fs from \"fs-extra\"\nimport { type PackageJson } from \"type-fest\"\n\nexport function getPackageInfo(\n cwd: string = \"\",\n shouldThrow: boolean = true\n): PackageJson | null {\n const packageJsonPath = path.join(cwd, \"package.json\")\n\n return fs.readJSONSync(packageJsonPath, {\n throws: shouldThrow,\n }) as PackageJson\n}","import path from \"path\";\nimport { rawConfigSchema } from \"shadcn/schema\";\nimport { Config, getConfig, resolveConfigPaths } from \"@/src/utils/get-config\";\nimport { getPackageInfo } from \"@/src/utils/get-package-info\";\nimport fg from \"fast-glob\";\nimport fs from \"fs-extra\";\nimport { loadConfig } from \"tsconfig-paths\";\nimport { z } from \"zod\";\n\nexport type TailwindVersion = \"v3\" | \"v4\" | null;\n\nexport type ProjectInfo = {\n isAstro: boolean;\n tailwindConfigFile: string | null;\n tailwindCssFile: string | null;\n tailwindVersion: TailwindVersion;\n aliasPrefix: string | null;\n};\n\nconst PROJECT_SHARED_IGNORE = [\n \"**/node_modules/**\",\n \".astro\",\n \"public\",\n \"dist\",\n \"build\",\n];\n\nconst TS_CONFIG_SCHEMA = z.object({\n compilerOptions: z.object({\n paths: z.record(z.string().or(z.array(z.string()))),\n }),\n});\n\nexport async function getProjectInfo(cwd: string): Promise<ProjectInfo | null> {\n const [\n configFiles,\n tailwindConfigFile,\n tailwindCssFile,\n tailwindVersion,\n aliasPrefix,\n packageJson,\n ] = await Promise.all([\n fg.glob(\n \"**/{next,vite,astro,app}.config.*|gatsby-config.*|composer.json|react-router.config.*\",\n {\n cwd,\n deep: 3,\n ignore: PROJECT_SHARED_IGNORE,\n },\n ),\n getTailwindConfigFile(cwd),\n getTailwindCssFile(cwd),\n getTailwindVersion(cwd),\n getTsConfigAliasPrefix(cwd),\n getPackageInfo(cwd, false),\n ]);\n\n const type: ProjectInfo = {\n isAstro: false,\n tailwindConfigFile,\n tailwindCssFile,\n tailwindVersion,\n aliasPrefix,\n };\n\n // Astro.\n if (configFiles.find((file) => file.startsWith(\"astro.config.\"))?.length) {\n type.isAstro = true;\n return type;\n }\n\n return type;\n}\n\nexport async function getTailwindVersion(\n cwd: string,\n): Promise<ProjectInfo[\"tailwindVersion\"]> {\n const [packageInfo, config] = await Promise.all([\n getPackageInfo(cwd, false),\n getConfig(cwd),\n ]);\n\n // If the config file is empty, we can assume that it's a v4 project.\n if (config?.tailwind?.config === \"\") {\n return \"v4\";\n }\n\n if (\n !packageInfo?.dependencies?.tailwindcss &&\n !packageInfo?.devDependencies?.tailwindcss\n ) {\n return null;\n }\n\n if (\n /^(?:\\^|~)?3(?:\\.\\d+)*(?:-.*)?$/.test(\n packageInfo?.dependencies?.tailwindcss ||\n packageInfo?.devDependencies?.tailwindcss ||\n \"\",\n )\n ) {\n return \"v3\";\n }\n\n return \"v4\";\n}\n\nexport async function getTailwindCssFile(cwd: string) {\n const [files, tailwindVersion] = await Promise.all([\n fg.glob([\"**/*.css\", \"**/*.scss\"], {\n cwd,\n deep: 5,\n ignore: PROJECT_SHARED_IGNORE,\n }),\n getTailwindVersion(cwd),\n ]);\n\n if (!files.length) {\n return null;\n }\n\n const needle =\n tailwindVersion === \"v4\" ? `@import \"tailwindcss\"` : \"@tailwind base\";\n for (const file of files) {\n const contents = await fs.readFile(path.resolve(cwd, file), \"utf8\");\n if (\n contents.includes(`@import \"tailwindcss\"`) ||\n contents.includes(`@import 'tailwindcss'`) ||\n contents.includes(`@tailwind base`)\n ) {\n return file;\n }\n }\n\n return null;\n}\n\nexport async function getTailwindConfigFile(cwd: string) {\n const files = await fg.glob(\"tailwind.config.*\", {\n cwd,\n deep: 3,\n ignore: PROJECT_SHARED_IGNORE,\n });\n\n if (!files.length) {\n return null;\n }\n\n return files[0];\n}\n\nexport async function getTsConfigAliasPrefix(cwd: string) {\n const tsConfig = await loadConfig(cwd);\n\n if (\n tsConfig?.resultType === \"failed\" ||\n !Object.entries(tsConfig?.paths).length\n ) {\n return null;\n }\n\n // This assume that the first alias is the prefix.\n for (const [alias, paths] of Object.entries(tsConfig.paths)) {\n if (\n paths.includes(\"./*\") ||\n paths.includes(\"./src/*\") ||\n paths.includes(\"./app/*\") ||\n paths.includes(\"./resources/js/*\") // Laravel.\n ) {\n return alias.replace(/\\/\\*$/, \"\") ?? null;\n }\n }\n\n // Use the first alias as the prefix.\n return Object.keys(tsConfig?.paths)?.[0].replace(/\\/\\*$/, \"\") ?? null;\n}\n\nexport async function isTypeScriptProject(cwd: string) {\n const files = await fg.glob(\"tsconfig.*\", {\n cwd,\n deep: 1,\n ignore: PROJECT_SHARED_IGNORE,\n });\n\n return files.length > 0;\n}\n\nexport async function getTsConfig(cwd: string) {\n for (const fallback of [\n \"tsconfig.json\",\n \"tsconfig.web.json\",\n \"tsconfig.app.json\",\n ]) {\n const filePath = path.resolve(cwd, fallback);\n if (!(await fs.pathExists(filePath))) {\n continue;\n }\n\n // We can't use fs.readJSON because it doesn't support comments.\n const contents = await fs.readFile(filePath, \"utf8\");\n const cleanedContents = contents.replace(/\\/\\*\\s*\\*\\//g, \"\");\n const result = TS_CONFIG_SCHEMA.safeParse(JSON.parse(cleanedContents));\n\n if (result.error) {\n continue;\n }\n\n return result.data;\n }\n\n return null;\n}\n\nexport async function getProjectConfig(\n cwd: string,\n defaultProjectInfo: ProjectInfo | null = null,\n): Promise<Config | null> {\n // Check for existing component config.\n const [existingConfig, projectInfo] = await Promise.all([\n getConfig(cwd),\n !defaultProjectInfo\n ? getProjectInfo(cwd)\n : Promise.resolve(defaultProjectInfo),\n ]);\n\n if (existingConfig) {\n return existingConfig;\n }\n\n if (\n !projectInfo ||\n !projectInfo.tailwindCssFile ||\n (projectInfo.tailwindVersion === \"v3\" && !projectInfo.tailwindConfigFile)\n ) {\n return null;\n }\n\n const config: z.infer<typeof rawConfigSchema> = {\n $schema: \"https://ui.shadcn.com/schema.json\",\n style: \"new-york\",\n tailwind: {\n config: projectInfo.tailwindConfigFile ?? \"\",\n baseColor: \"zinc\",\n css: projectInfo.tailwindCssFile,\n cssVariables: true,\n prefix: \"\",\n },\n iconLibrary: \"lucide\",\n aliases: {\n components: `${projectInfo.aliasPrefix}/components`,\n ui: `${projectInfo.aliasPrefix}/components/ui`,\n lib: `${projectInfo.aliasPrefix}/lib`,\n utils: `${projectInfo.aliasPrefix}/lib/utils`,\n },\n };\n\n return await resolveConfigPaths(cwd, config);\n}\n\nexport async function getProjectTailwindVersionFromConfig(config: {\n resolvedPaths: Pick<Config[\"resolvedPaths\"], \"cwd\">;\n}): Promise<TailwindVersion> {\n if (!config.resolvedPaths?.cwd) {\n return \"v3\";\n }\n\n const projectInfo = await getProjectInfo(config.resolvedPaths.cwd);\n\n if (!projectInfo?.tailwindVersion) {\n return null;\n }\n\n return projectInfo.tailwindVersion;\n}\n","import path from \"path\";\nimport { initOptionsSchema } from \"@/src/commands/init\";\nimport * as ERRORS from \"@/src/utils/errors\";\nimport { getProjectInfo } from \"@/src/utils/get-project-info\";\nimport { highlighter } from \"@/src/utils/highlighter\";\nimport { logger } from \"@/src/utils/logger\";\nimport { spinner } from \"@/src/utils/spinner\";\nimport fs from \"fs-extra\";\nimport { z } from \"zod\";\n\nexport async function preFlightInit(\n options: z.infer<typeof initOptionsSchema>\n) {\n const errors: Record<string, boolean> = {};\n\n // Ensure target directory exists.\n // Check for empty project. We assume if no package.json exists, the project is empty.\n if (\n !fs.existsSync(options.cwd) ||\n !fs.existsSync(path.resolve(options.cwd, \"package.json\"))\n ) {\n errors[ERRORS.MISSING_DIR_OR_EMPTY_PROJECT] = true;\n return {\n errors,\n projectInfo: null,\n };\n }\n\n const projectSpinner = spinner(`Preflight checks.`, {\n silent: options.silent,\n }).start();\n\n if (\n fs.existsSync(path.resolve(options.cwd, \"components.json\")) &&\n !options.force\n ) {\n projectSpinner?.fail();\n logger.break();\n logger.error(\n `A ${highlighter.info(\n \"components.json\"\n )} file already exists at ${highlighter.info(\n options.cwd\n )}.\\nTo start over, remove the ${highlighter.info(\n \"components.json\"\n )} file and run ${highlighter.info(\"init\")} again.`\n );\n logger.break();\n process.exit(1);\n }\n\n projectSpinner?.succeed();\n\n const frameworkSpinner = spinner(`Verifying framework.`, {\n silent: options.silent,\n }).start();\n const projectInfo = await getProjectInfo(options.cwd);\n\n if (!projectInfo || !projectInfo.isAstro) {\n errors[ERRORS.UNSUPPORTED_FRAMEWORK] = true;\n frameworkSpinner?.fail();\n logger.break();\n if (projectInfo?.framework.links.installation) {\n logger.error(\n `We could not detect a supported framework at ${highlighter.info(\n options.cwd\n )}.\\n` +\n `Visit ${highlighter.info(\n projectInfo?.framework.links.installation\n )} to manually configure your project.\\nOnce configured, you can use the cli to add components.`\n );\n }\n logger.break();\n process.exit(1);\n }\n frameworkSpinner?.succeed(\n `Verifying framework. Found ${highlighter.info(\n projectInfo.isAstro ? \"Astro\" : \"Unknown\"\n )}.`\n );\n\n let tailwindSpinnerMessage = \"Validating Tailwind CSS.\";\n\n if (projectInfo.tailwindVersion === \"v4\") {\n tailwindSpinnerMessage = `Validating Tailwind CSS config. Found ${highlighter.info(\n \"v4\"\n )}.`;\n }\n\n const tailwindSpinner = spinner(tailwindSpinnerMessage, {\n silent: options.silent,\n }).start();\n if (\n projectInfo.tailwindVersion === \"v3\" &&\n (!projectInfo?.tailwindConfigFile || !projectInfo?.tailwindCssFile)\n ) {\n errors[ERRORS.TAILWIND_NOT_CONFIGURED] = true;\n tailwindSpinner?.fail();\n } else if (\n projectInfo.tailwindVersion === \"v4\" &&\n !projectInfo?.tailwindCssFile\n ) {\n errors[ERRORS.TAILWIND_NOT_CONFIGURED] = true;\n tailwindSpinner?.fail();\n } else if (!projectInfo.tailwindVersion) {\n errors[ERRORS.TAILWIND_NOT_CONFIGURED] = true;\n tailwindSpinner?.fail();\n } else {\n tailwindSpinner?.succeed();\n }\n\n const tsConfigSpinner = spinner(`Validating import alias.`, {\n silent: options.silent,\n }).start();\n if (!projectInfo?.aliasPrefix) {\n errors[ERRORS.IMPORT_ALIAS_MISSING] = true;\n tsConfigSpinner?.fail();\n } else {\n tsConfigSpinner?.succeed();\n }\n\n if (Object.keys(errors).length > 0) {\n if (errors[ERRORS.TAILWIND_NOT_CONFIGURED]) {\n logger.break();\n logger.error(\n `No Tailwind CSS configuration found at ${highlighter.info(\n options.cwd\n )}.`\n );\n logger.error(\n `It is likely you do not have Tailwind CSS installed or have an invalid configuration.`\n );\n logger.error(`Install Tailwind CSS then try again.`);\n if (projectInfo?.framework.links.tailwind) {\n logger.error(\n `Visit ${highlighter.info(\n projectInfo?.framework.links.tailwind\n )} to get started.`\n );\n }\n }\n\n if (errors[ERRORS.IMPORT_ALIAS_MISSING]) {\n logger.break();\n logger.error(`No import alias found in your tsconfig.json file.`);\n if (projectInfo?.framework.links.installation) {\n logger.error(\n `Visit ${highlighter.info(\n projectInfo?.framework.links.installation\n )} to learn how to set an import alias.`\n );\n }\n }\n\n logger.break();\n process.exit(1);\n }\n\n return {\n errors,\n projectInfo,\n };\n}\n","interface RegistryContext {\n headers: Record<string, Record<string, string>>\n}\n\nlet context: RegistryContext = {\n headers: {},\n}\n\nexport function setRegistryHeaders(\n headers: Record<string, Record<string, string>>\n) {\n // Merge new headers with existing ones to preserve headers for nested dependencies\n context.headers = { ...context.headers, ...headers }\n}\n\nexport function getRegistryHeadersFromContext(\n url: string\n): Record<string, string> {\n return context.headers[url] || {}\n}\n\nexport function clearRegistryContext() {\n context.headers = {}\n}","const AGENTS = [\n \"npm\",\n \"yarn\",\n \"yarn@berry\",\n \"pnpm\",\n \"pnpm@6\",\n \"bun\",\n \"deno\"\n];\nconst LOCKS = {\n \"bun.lock\": \"bun\",\n \"bun.lockb\": \"bun\",\n \"deno.lock\": \"deno\",\n \"pnpm-lock.yaml\": \"pnpm\",\n \"pnpm-workspace.yaml\": \"pnpm\",\n \"yarn.lock\": \"yarn\",\n \"package-lock.json\": \"npm\",\n \"npm-shrinkwrap.json\": \"npm\"\n};\nconst INSTALL_METADATA = {\n \"node_modules/.deno/\": \"deno\",\n \"node_modules/.pnpm/\": \"pnpm\",\n \"node_modules/.yarn-state.yml\": \"yarn\",\n // yarn v2+ (node-modules)\n \"node_modules/.yarn_integrity\": \"yarn\",\n // yarn v1\n \"node_modules/.package-lock.json\": \"npm\",\n \".pnp.cjs\": \"yarn\",\n // yarn v3+ (pnp)\n \".pnp.js\": \"yarn\",\n // yarn v2 (pnp)\n \"bun.lock\": \"bun\",\n \"bun.lockb\": \"bun\"\n};\nconst INSTALL_PAGE = {\n \"bun\": \"https://bun.sh\",\n \"deno\": \"https://deno.com\",\n \"pnpm\": \"https://pnpm.io/installation\",\n \"pnpm@6\": \"https://pnpm.io/6.x/installation\",\n \"yarn\": \"https://classic.yarnpkg.com/en/docs/install\",\n \"yarn@berry\": \"https://yarnpkg.com/getting-started/install\",\n \"npm\": \"https://docs.npmjs.com/cli/configuring-npm/install\"\n};\n\nexport { AGENTS, INSTALL_METADATA, INSTALL_PAGE, LOCKS };\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { INSTALL_METADATA, LOCKS, AGENTS } from './constants.mjs';\n\nasync function pathExists(path2, type) {\n try {\n const stat = await fs.stat(path2);\n return type === \"file\" ? stat.isFile() : stat.isDirectory();\n } catch {\n return false;\n }\n}\nfunction getUserAgent() {\n const userAgent = process.env.npm_config_user_agent;\n if (!userAgent) {\n return null;\n }\n const name = userAgent.split(\"/\")[0];\n return AGENTS.includes(name) ? name : null;\n}\nfunction* lookup(cwd = process.cwd()) {\n let directory = path.resolve(cwd);\n const { root } = path.parse(directory);\n while (directory && directory !== root) {\n yield directory;\n directory = path.dirname(directory);\n }\n}\nasync function parsePackageJson(filepath, onUnknown) {\n return !filepath || !pathExists(filepath, \"file\") ? null : await handlePackageManager(filepath, onUnknown);\n}\nasync function detect(options = {}) {\n const {\n cwd,\n strategies = [\"lockfile\", \"packageManager-field\", \"devEngines-field\"],\n onUnknown\n } = options;\n let stopDir;\n if (typeof options.stopDir === \"string\") {\n const resolved = path.resolve(options.stopDir);\n stopDir = (dir) => dir === resolved;\n } else {\n stopDir = options.stopDir;\n }\n for (const directory of lookup(cwd)) {\n for (const strategy of strategies) {\n switch (strategy) {\n case \"lockfile\": {\n for (const lock of Object.keys(LOCKS)) {\n if (await pathExists(path.join(directory, lock), \"file\")) {\n const name = LOCKS[lock];\n const result = await parsePackageJson(path.join(directory, \"package.json\"), onUnknown);\n if (result)\n return result;\n else\n return { name, agent: name };\n }\n }\n break;\n }\n case \"packageManager-field\":\n case \"devEngines-field\": {\n const result = await parsePackageJson(path.join(directory, \"package.json\"), onUnknown);\n if (result)\n return result;\n break;\n }\n case \"install-metadata\": {\n for (const metadata of Object.keys(INSTALL_METADATA)) {\n const fileOrDir = metadata.endsWith(\"/\") ? \"dir\" : \"file\";\n if (await pathExists(path.join(directory, metadata), fileOrDir)) {\n const name = INSTALL_METADATA[metadata];\n const agent = name === \"yarn\" ? isMetadataYarnClassic(metadata) ? \"yarn\" : \"yarn@berry\" : name;\n return { name, agent };\n }\n }\n break;\n }\n }\n }\n if (stopDir?.(directory))\n break;\n }\n return null;\n}\nfunction getNameAndVer(pkg) {\n const handelVer = (version) => version?.match(/\\d+(\\.\\d+){0,2}/)?.[0] ?? version;\n if (typeof pkg.packageManager === \"string\") {\n const [name, ver] = pkg.packageManager.replace(/^\\^/, \"\").split(\"@\");\n return { name, ver: handelVer(ver) };\n }\n if (typeof pkg.devEngines?.packageManager?.name === \"string\") {\n return {\n name: pkg.devEngines.packageManager.name,\n ver: handelVer(pkg.devEngines.packageManager.version)\n };\n }\n return void 0;\n}\nasync function handlePackageManager(filepath, onUnknown) {\n try {\n const pkg = JSON.parse(await fs.readFile(filepath, \"utf8\"));\n let agent;\n const nameAndVer = getNameAndVer(pkg);\n if (nameAndVer) {\n const name = nameAndVer.name;\n const ver = nameAndVer.ver;\n let version = ver;\n if (name === \"yarn\" && ver && Number.parseInt(ver) > 1) {\n agent = \"yarn@berry\";\n version = \"berry\";\n return { name, agent, version };\n } else if (name === \"pnpm\" && ver && Number.parseInt(ver) < 7) {\n agent = \"pnpm@6\";\n return { name, agent, version };\n } else if (AGENTS.includes(name)) {\n agent = name;\n return { name, agent, version };\n } else {\n return onUnknown?.(pkg.packageManager) ?? null;\n }\n }\n } catch {\n }\n return null;\n}\nfunction isMetadataYarnClassic(metadataPath) {\n return metadataPath.endsWith(\".yarn_integrity\");\n}\n\nexport { detect, getUserAgent };\n","import { createRequire as __tinyexec_cr } from \"node:module\";const require = __tinyexec_cr(import.meta.url);\nvar St = Object.create;\nvar $ = Object.defineProperty;\nvar kt = Object.getOwnPropertyDescriptor;\nvar Tt = Object.getOwnPropertyNames;\nvar At = Object.getPrototypeOf, Rt = Object.prototype.hasOwnProperty;\nvar h = /* @__PURE__ */ ((t) => typeof require < \"u\" ? require : typeof Proxy < \"u\" ? new Proxy(t, {\n get: (e, n) => (typeof require < \"u\" ? require : e)[n]\n}) : t)(function(t) {\n if (typeof require < \"u\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + t + '\" is not supported');\n});\nvar l = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);\nvar $t = (t, e, n, r) => {\n if (e && typeof e == \"object\" || typeof e == \"function\")\n for (let s of Tt(e))\n !Rt.call(t, s) && s !== n && $(t, s, { get: () => e[s], enumerable: !(r = kt(e, s)) || r.enumerable });\n return t;\n};\nvar Nt = (t, e, n) => (n = t != null ? St(At(t)) : {}, $t(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n e || !t || !t.__esModule ? $(n, \"default\", { value: t, enumerable: !0 }) : n,\n t\n));\n\n// node_modules/isexe/windows.js\nvar W = l((Se, H) => {\n \"use strict\";\n H.exports = z;\n z.sync = Wt;\n var j = h(\"fs\");\n function Ht(t, e) {\n var n = e.pathExt !== void 0 ? e.pathExt : process.env.PATHEXT;\n if (!n || (n = n.split(\";\"), n.indexOf(\"\") !== -1))\n return !0;\n for (var r = 0; r < n.length; r++) {\n var s = n[r].toLowerCase();\n if (s && t.substr(-s.length).toLowerCase() === s)\n return !0;\n }\n return !1;\n }\n function F(t, e, n) {\n return !t.isSymbolicLink() && !t.isFile() ? !1 : Ht(e, n);\n }\n function z(t, e, n) {\n j.stat(t, function(r, s) {\n n(r, r ? !1 : F(s, t, e));\n });\n }\n function Wt(t, e) {\n return F(j.statSync(t), t, e);\n }\n});\n\n// node_modules/isexe/mode.js\nvar X = l((ke, B) => {\n \"use strict\";\n B.exports = K;\n K.sync = Dt;\n var D = h(\"fs\");\n function K(t, e, n) {\n D.stat(t, function(r, s) {\n n(r, r ? !1 : M(s, e));\n });\n }\n function Dt(t, e) {\n return M(D.statSync(t), e);\n }\n function M(t, e) {\n return t.isFile() && Kt(t, e);\n }\n function Kt(t, e) {\n var n = t.mode, r = t.uid, s = t.gid, o = e.uid !== void 0 ? e.uid : process.getuid && process.getuid(), i = e.gid !== void 0 ? e.gid : process.getgid && process.getgid(), a = parseInt(\"100\", 8), c = parseInt(\"010\", 8), u = parseInt(\"001\", 8), f = a | c, p = n & u || n & c && s === i || n & a && r === o || n & f && o === 0;\n return p;\n }\n});\n\n// node_modules/isexe/index.js\nvar U = l((Ae, G) => {\n \"use strict\";\n var Te = h(\"fs\"), v;\n process.platform === \"win32\" || global.TESTING_WINDOWS ? v = W() : v = X();\n G.exports = y;\n y.sync = Mt;\n function y(t, e, n) {\n if (typeof e == \"function\" && (n = e, e = {}), !n) {\n if (typeof Promise != \"function\")\n throw new TypeError(\"callback not provided\");\n return new Promise(function(r, s) {\n y(t, e || {}, function(o, i) {\n o ? s(o) : r(i);\n });\n });\n }\n v(t, e || {}, function(r, s) {\n r && (r.code === \"EACCES\" || e && e.ignoreErrors) && (r = null, s = !1), n(r, s);\n });\n }\n function Mt(t, e) {\n try {\n return v.sync(t, e || {});\n } catch (n) {\n if (e && e.ignoreErrors || n.code === \"EACCES\")\n return !1;\n throw n;\n }\n }\n});\n\n// node_modules/which/which.js\nvar et = l((Re, tt) => {\n \"use strict\";\n var g = process.platform === \"win32\" || process.env.OSTYPE === \"cygwin\" || process.env.OSTYPE === \"msys\", Y = h(\"path\"), Bt = g ? \";\" : \":\", V = U(), J = (t) => Object.assign(new Error(`not found: ${t}`), { code: \"ENOENT\" }), Q = (t, e) => {\n let n = e.colon || Bt, r = t.match(/\\//) || g && t.match(/\\\\/) ? [\"\"] : [\n // windows always checks the cwd first\n ...g ? [process.cwd()] : [],\n ...(e.path || process.env.PATH || /* istanbul ignore next: very unusual */\n \"\").split(n)\n ], s = g ? e.pathExt || process.env.PATHEXT || \".EXE;.CMD;.BAT;.COM\" : \"\", o = g ? s.split(n) : [\"\"];\n return g && t.indexOf(\".\") !== -1 && o[0] !== \"\" && o.unshift(\"\"), {\n pathEnv: r,\n pathExt: o,\n pathExtExe: s\n };\n }, Z = (t, e, n) => {\n typeof e == \"function\" && (n = e, e = {}), e || (e = {});\n let { pathEnv: r, pathExt: s, pathExtExe: o } = Q(t, e), i = [], a = (u) => new Promise((f, p) => {\n if (u === r.length)\n return e.all && i.length ? f(i) : p(J(t));\n let d = r[u], w = /^\".*\"$/.test(d) ? d.slice(1, -1) : d, m = Y.join(w, t), b = !w && /^\\.[\\\\\\/]/.test(t) ? t.slice(0, 2) + m : m;\n f(c(b, u, 0));\n }), c = (u, f, p) => new Promise((d, w) => {\n if (p === s.length)\n return d(a(f + 1));\n let m = s[p];\n V(u + m, { pathExt: o }, (b, Ot) => {\n if (!b && Ot)\n if (e.all)\n i.push(u + m);\n else\n return d(u + m);\n return d(c(u, f, p + 1));\n });\n });\n return n ? a(0).then((u) => n(null, u), n) : a(0);\n }, Xt = (t, e) => {\n e = e || {};\n let { pathEnv: n, pathExt: r, pathExtExe: s } = Q(t, e), o = [];\n for (let i = 0; i < n.length; i++) {\n let a = n[i], c = /^\".*\"$/.test(a) ? a.slice(1, -1) : a, u = Y.join(c, t), f = !c && /^\\.[\\\\\\/]/.test(t) ? t.slice(0, 2) + u : u;\n for (let p = 0; p < r.length; p++) {\n let d = f + r[p];\n try {\n if (V.sync(d, { pathExt: s }))\n if (e.all)\n o.push(d);\n else\n return d;\n } catch {\n }\n }\n }\n if (e.all && o.length)\n return o;\n if (e.nothrow)\n return null;\n throw J(t);\n };\n tt.exports = Z;\n Z.sync = Xt;\n});\n\n// node_modules/path-key/index.js\nvar rt = l(($e, _) => {\n \"use strict\";\n var nt = (t = {}) => {\n let e = t.env || process.env;\n return (t.platform || process.platform) !== \"win32\" ? \"PATH\" : Object.keys(e).reverse().find((r) => r.toUpperCase() === \"PATH\") || \"Path\";\n };\n _.exports = nt;\n _.exports.default = nt;\n});\n\n// node_modules/cross-spawn/lib/util/resolveCommand.js\nvar ct = l((Ne, it) => {\n \"use strict\";\n var st = h(\"path\"), Gt = et(), Ut = rt();\n function ot(t, e) {\n let n = t.options.env || process.env, r = process.cwd(), s = t.options.cwd != null, o = s && process.chdir !== void 0 && !process.chdir.disabled;\n if (o)\n try {\n process.chdir(t.options.cwd);\n } catch {\n }\n let i;\n try {\n i = Gt.sync(t.command, {\n path: n[Ut({ env: n })],\n pathExt: e ? st.delimiter : void 0\n });\n } catch {\n } finally {\n o && process.chdir(r);\n }\n return i && (i = st.resolve(s ? t.options.cwd : \"\", i)), i;\n }\n function Yt(t) {\n return ot(t) || ot(t, !0);\n }\n it.exports = Yt;\n});\n\n// node_modules/cross-spawn/lib/util/escape.js\nvar ut = l((qe, P) => {\n \"use strict\";\n var C = /([()\\][%!^\"`<>&|;, *?])/g;\n function Vt(t) {\n return t = t.replace(C, \"^$1\"), t;\n }\n function Jt(t, e) {\n return t = `${t}`, t = t.replace(/(\\\\*)\"/g, '$1$1\\\\\"'), t = t.replace(/(\\\\*)$/, \"$1$1\"), t = `\"${t}\"`, t = t.replace(C, \"^$1\"), e && (t = t.replace(C, \"^$1\")), t;\n }\n P.exports.command = Vt;\n P.exports.argument = Jt;\n});\n\n// node_modules/shebang-regex/index.js\nvar lt = l((Ie, at) => {\n \"use strict\";\n at.exports = /^#!(.*)/;\n});\n\n// node_modules/shebang-command/index.js\nvar dt = l((Le, pt) => {\n \"use strict\";\n var Qt = lt();\n pt.exports = (t = \"\") => {\n let e = t.match(Qt);\n if (!e)\n return null;\n let [n, r] = e[0].replace(/#! ?/, \"\").split(\" \"), s = n.split(\"/\").pop();\n return s === \"env\" ? r : r ? `${s} ${r}` : s;\n };\n});\n\n// node_modules/cross-spawn/lib/util/readShebang.js\nvar ht = l((je, ft) => {\n \"use strict\";\n var O = h(\"fs\"), Zt = dt();\n function te(t) {\n let n = Buffer.alloc(150), r;\n try {\n r = O.openSync(t, \"r\"), O.readSync(r, n, 0, 150, 0), O.closeSync(r);\n } catch {\n }\n return Zt(n.toString());\n }\n ft.exports = te;\n});\n\n// node_modules/cross-spawn/lib/parse.js\nvar wt = l((Fe, Et) => {\n \"use strict\";\n var ee = h(\"path\"), mt = ct(), gt = ut(), ne = ht(), re = process.platform === \"win32\", se = /\\.(?:com|exe)$/i, oe = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n function ie(t) {\n t.file = mt(t);\n let e = t.file && ne(t.file);\n return e ? (t.args.unshift(t.file), t.command = e, mt(t)) : t.file;\n }\n function ce(t) {\n if (!re)\n return t;\n let e = ie(t), n = !se.test(e);\n if (t.options.forceShell || n) {\n let r = oe.test(e);\n t.command = ee.normalize(t.command), t.command = gt.command(t.command), t.args = t.args.map((o) => gt.argument(o, r));\n let s = [t.command].concat(t.args).join(\" \");\n t.args = [\"/d\", \"/s\", \"/c\", `\"${s}\"`], t.command = process.env.comspec || \"cmd.exe\", t.options.windowsVerbatimArguments = !0;\n }\n return t;\n }\n function ue(t, e, n) {\n e && !Array.isArray(e) && (n = e, e = null), e = e ? e.slice(0) : [], n = Object.assign({}, n);\n let r = {\n command: t,\n args: e,\n options: n,\n file: void 0,\n original: {\n command: t,\n args: e\n }\n };\n return n.shell ? r : ce(r);\n }\n Et.exports = ue;\n});\n\n// node_modules/cross-spawn/lib/enoent.js\nvar bt = l((ze, vt) => {\n \"use strict\";\n var S = process.platform === \"win32\";\n function k(t, e) {\n return Object.assign(new Error(`${e} ${t.command} ENOENT`), {\n code: \"ENOENT\",\n errno: \"ENOENT\",\n syscall: `${e} ${t.command}`,\n path: t.command,\n spawnargs: t.args\n });\n }\n function ae(t, e) {\n if (!S)\n return;\n let n = t.emit;\n t.emit = function(r, s) {\n if (r === \"exit\") {\n let o = xt(s, e, \"spawn\");\n if (o)\n return n.call(t, \"error\", o);\n }\n return n.apply(t, arguments);\n };\n }\n function xt(t, e) {\n return S && t === 1 && !e.file ? k(e.original, \"spawn\") : null;\n }\n function le(t, e) {\n return S && t === 1 && !e.file ? k(e.original, \"spawnSync\") : null;\n }\n vt.exports = {\n hookChildProcess: ae,\n verifyENOENT: xt,\n verifyENOENTSync: le,\n notFoundError: k\n };\n});\n\n// node_modules/cross-spawn/index.js\nvar Ct = l((He, E) => {\n \"use strict\";\n var yt = h(\"child_process\"), T = wt(), A = bt();\n function _t(t, e, n) {\n let r = T(t, e, n), s = yt.spawn(r.command, r.args, r.options);\n return A.hookChildProcess(s, r), s;\n }\n function pe(t, e, n) {\n let r = T(t, e, n), s = yt.spawnSync(r.command, r.args, r.options);\n return s.error = s.error || A.verifyENOENTSync(s.status, r), s;\n }\n E.exports = _t;\n E.exports.spawn = _t;\n E.exports.sync = pe;\n E.exports._parse = T;\n E.exports._enoent = A;\n});\n\n// src/main.ts\nimport { spawn as de } from \"child_process\";\nimport { normalize as fe } from \"path\";\nimport { cwd as he } from \"process\";\n\n// src/env.ts\nimport {\n delimiter as N,\n resolve as qt,\n dirname as It\n} from \"path\";\nvar Lt = /^path$/i, q = { key: \"PATH\", value: \"\" };\nfunction jt(t) {\n for (let e in t) {\n if (!Object.prototype.hasOwnProperty.call(t, e) || !Lt.test(e))\n continue;\n let n = t[e];\n return n ? { key: e, value: n } : q;\n }\n return q;\n}\nfunction Ft(t, e) {\n let n = e.value.split(N), r = t, s;\n do\n n.push(qt(r, \"node_modules\", \".bin\")), s = r, r = It(r);\n while (r !== s);\n return { key: e.key, value: n.join(N) };\n}\nfunction I(t, e) {\n let n = {\n ...process.env,\n ...e\n }, r = Ft(t, jt(n));\n return n[r.key] = r.value, n;\n}\n\n// src/stream.ts\nimport { PassThrough as zt } from \"stream\";\nvar L = (t) => {\n let e = t.length, n = new zt(), r = () => {\n --e === 0 && n.emit(\"end\");\n };\n for (let s of t)\n s.pipe(n, { end: !1 }), s.on(\"end\", r);\n return n;\n};\n\n// src/main.ts\nvar Pt = Nt(Ct(), 1);\nimport me from \"readline\";\n\n// src/non-zero-exit-error.ts\nvar x = class extends Error {\n result;\n output;\n get exitCode() {\n if (this.result.exitCode !== null)\n return this.result.exitCode;\n }\n constructor(e, n) {\n super(`Process exited with non-zero status (${e.exitCode})`), this.result = e, this.output = n;\n }\n};\n\n// src/main.ts\nvar ge = {\n timeout: void 0,\n persist: !1\n}, Ee = {\n windowsHide: !0\n};\nfunction we(t, e) {\n return {\n command: fe(t),\n args: e ?? []\n };\n}\nfunction xe(t) {\n let e = new AbortController();\n for (let n of t) {\n if (n.aborted)\n return e.abort(), n;\n let r = () => {\n e.abort(n.reason);\n };\n n.addEventListener(\"abort\", r, {\n signal: e.signal\n });\n }\n return e.signal;\n}\nvar R = class {\n _process;\n _aborted = !1;\n _options;\n _command;\n _args;\n _resolveClose;\n _processClosed;\n _thrownError;\n get process() {\n return this._process;\n }\n get pid() {\n return this._process?.pid;\n }\n get exitCode() {\n if (this._process && this._process.exitCode !== null)\n return this._process.exitCode;\n }\n constructor(e, n, r) {\n this._options = {\n ...ge,\n ...r\n }, this._command = e, this._args = n ?? [], this._processClosed = new Promise((s) => {\n this._resolveClose = s;\n });\n }\n kill(e) {\n return this._process?.kill(e) === !0;\n }\n get aborted() {\n return this._aborted;\n }\n get killed() {\n return this._process?.killed === !0;\n }\n pipe(e, n, r) {\n return be(e, n, {\n ...r,\n stdin: this\n });\n }\n async *[Symbol.asyncIterator]() {\n let e = this._process;\n if (!e)\n return;\n let n = [];\n this._streamErr && n.push(this._streamErr), this._streamOut && n.push(this._streamOut);\n let r = L(n), s = me.createInterface({\n input: r\n });\n for await (let o of s)\n yield o.toString();\n if (await this._processClosed, e.removeAllListeners(), this._thrownError)\n throw this._thrownError;\n if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0)\n throw new x(this);\n }\n async _waitForOutput() {\n let e = this._process;\n if (!e)\n throw new Error(\"No process was started\");\n let n = \"\", r = \"\";\n if (this._streamOut)\n for await (let o of this._streamOut)\n r += o.toString();\n if (this._streamErr)\n for await (let o of this._streamErr)\n n += o.toString();\n if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError)\n throw this._thrownError;\n let s = {\n stderr: n,\n stdout: r,\n exitCode: this.exitCode\n };\n if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0)\n throw new x(this, s);\n return s;\n }\n then(e, n) {\n return this._waitForOutput().then(e, n);\n }\n _streamOut;\n _streamErr;\n spawn() {\n let e = he(), n = this._options, r = {\n ...Ee,\n ...n.nodeOptions\n }, s = [];\n this._resetState(), n.timeout !== void 0 && s.push(AbortSignal.timeout(n.timeout)), n.signal !== void 0 && s.push(n.signal), n.persist === !0 && (r.detached = !0), s.length > 0 && (r.signal = xe(s)), r.env = I(e, r.env);\n let { command: o, args: i } = we(this._command, this._args), a = (0, Pt._parse)(o, i, r), c = de(\n a.command,\n a.args,\n a.options\n );\n if (c.stderr && (this._streamErr = c.stderr), c.stdout && (this._streamOut = c.stdout), this._process = c, c.once(\"error\", this._onError), c.once(\"close\", this._onClose), n.stdin !== void 0 && c.stdin && n.stdin.process) {\n let { stdout: u } = n.stdin.process;\n u && u.pipe(c.stdin);\n }\n }\n _resetState() {\n this._aborted = !1, this._processClosed = new Promise((e) => {\n this._resolveClose = e;\n }), this._thrownError = void 0;\n }\n _onError = (e) => {\n if (e.name === \"AbortError\" && (!(e.cause instanceof Error) || e.cause.name !== \"TimeoutError\")) {\n this._aborted = !0;\n return;\n }\n this._thrownError = e;\n };\n _onClose = () => {\n this._resolveClose && this._resolveClose();\n };\n}, ve = (t, e, n) => {\n let r = new R(t, e, n);\n return r.spawn(), r;\n}, be = ve;\nexport {\n R as ExecProcess,\n x as NonZeroExitError,\n be as exec,\n ve as x\n};\n","import path, { join, dirname, resolve } from 'node:path';\nimport process$1 from 'node:process';\nimport require$$0 from 'readline';\nimport require$$2 from 'events';\nimport c from 'ansis';\nimport { detect as detect$1, AGENTS } from 'package-manager-detector';\nimport { x } from 'tinyexec';\nimport fs, { promises, existsSync } from 'node:fs';\nimport { INSTALL_PAGE } from 'package-manager-detector/constants';\nimport require$$0$1 from 'os';\nimport require$$1 from 'tty';\nimport os from 'node:os';\nimport require$$0$2 from 'fs';\nimport require$$1$1 from 'fs/promises';\nimport require$$1$2 from 'path';\nimport { COMMANDS, constructCommand } from 'package-manager-detector/commands';\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar ini$1;\nvar hasRequiredIni;\n\nfunction requireIni () {\n\tif (hasRequiredIni) return ini$1;\n\thasRequiredIni = 1;\n\tconst { hasOwnProperty } = Object.prototype;\n\n\tconst encode = (obj, opt = {}) => {\n\t if (typeof opt === 'string') {\n\t opt = { section: opt };\n\t }\n\t opt.align = opt.align === true;\n\t opt.newline = opt.newline === true;\n\t opt.sort = opt.sort === true;\n\t opt.whitespace = opt.whitespace === true || opt.align === true;\n\t // The `typeof` check is required because accessing the `process` directly fails on browsers.\n\t /* istanbul ignore next */\n\t opt.platform = opt.platform || (typeof process !== 'undefined' && process.platform);\n\t opt.bracketedArray = opt.bracketedArray !== false;\n\n\t /* istanbul ignore next */\n\t const eol = opt.platform === 'win32' ? '\\r\\n' : '\\n';\n\t const separator = opt.whitespace ? ' = ' : '=';\n\t const children = [];\n\n\t const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);\n\n\t let padToChars = 0;\n\t // If aligning on the separator, then padToChars is determined as follows:\n\t // 1. Get the keys\n\t // 2. Exclude keys pointing to objects unless the value is null or an array\n\t // 3. Add `[]` to array keys\n\t // 4. Ensure non empty set of keys\n\t // 5. Reduce the set to the longest `safe` key\n\t // 6. Get the `safe` length\n\t if (opt.align) {\n\t padToChars = safe(\n\t (\n\t keys\n\t .filter(k => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== 'object')\n\t .map(k => Array.isArray(obj[k]) ? `${k}[]` : k)\n\t )\n\t .concat([''])\n\t .reduce((a, b) => safe(a).length >= safe(b).length ? a : b)\n\t ).length;\n\t }\n\n\t let out = '';\n\t const arraySuffix = opt.bracketedArray ? '[]' : '';\n\n\t for (const k of keys) {\n\t const val = obj[k];\n\t if (val && Array.isArray(val)) {\n\t for (const item of val) {\n\t out += safe(`${k}${arraySuffix}`).padEnd(padToChars, ' ') + separator + safe(item) + eol;\n\t }\n\t } else if (val && typeof val === 'object') {\n\t children.push(k);\n\t } else {\n\t out += safe(k).padEnd(padToChars, ' ') + separator + safe(val) + eol;\n\t }\n\t }\n\n\t if (opt.section && out.length) {\n\t out = '[' + safe(opt.section) + ']' + (opt.newline ? eol + eol : eol) + out;\n\t }\n\n\t for (const k of children) {\n\t const nk = splitSections(k, '.').join('\\\\.');\n\t const section = (opt.section ? opt.section + '.' : '') + nk;\n\t const child = encode(obj[k], {\n\t ...opt,\n\t section,\n\t });\n\t if (out.length && child.length) {\n\t out += eol;\n\t }\n\n\t out += child;\n\t }\n\n\t return out\n\t};\n\n\tfunction splitSections (str, separator) {\n\t var lastMatchIndex = 0;\n\t var lastSeparatorIndex = 0;\n\t var nextIndex = 0;\n\t var sections = [];\n\n\t do {\n\t nextIndex = str.indexOf(separator, lastMatchIndex);\n\n\t if (nextIndex !== -1) {\n\t lastMatchIndex = nextIndex + separator.length;\n\n\t if (nextIndex > 0 && str[nextIndex - 1] === '\\\\') {\n\t continue\n\t }\n\n\t sections.push(str.slice(lastSeparatorIndex, nextIndex));\n\t lastSeparatorIndex = nextIndex + separator.length;\n\t }\n\t } while (nextIndex !== -1)\n\n\t sections.push(str.slice(lastSeparatorIndex));\n\n\t return sections\n\t}\n\n\tconst decode = (str, opt = {}) => {\n\t opt.bracketedArray = opt.bracketedArray !== false;\n\t const out = Object.create(null);\n\t let p = out;\n\t let section = null;\n\t // section |key = value\n\t const re = /^\\[([^\\]]*)\\]\\s*$|^([^=]+)(=(.*))?$/i;\n\t const lines = str.split(/[\\r\\n]+/g);\n\t const duplicates = {};\n\n\t for (const line of lines) {\n\t if (!line || line.match(/^\\s*[;#]/) || line.match(/^\\s*$/)) {\n\t continue\n\t }\n\t const match = line.match(re);\n\t if (!match) {\n\t continue\n\t }\n\t if (match[1] !== undefined) {\n\t section = unsafe(match[1]);\n\t if (section === '__proto__') {\n\t // not allowed\n\t // keep parsing the section, but don't attach it.\n\t p = Object.create(null);\n\t continue\n\t }\n\t p = out[section] = out[section] || Object.create(null);\n\t continue\n\t }\n\t const keyRaw = unsafe(match[2]);\n\t let isArray;\n\t if (opt.bracketedArray) {\n\t isArray = keyRaw.length > 2 && keyRaw.slice(-2) === '[]';\n\t } else {\n\t duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;\n\t isArray = duplicates[keyRaw] > 1;\n\t }\n\t const key = isArray && keyRaw.endsWith('[]')\n\t ? keyRaw.slice(0, -2) : keyRaw;\n\n\t if (key === '__proto__') {\n\t continue\n\t }\n\t const valueRaw = match[3] ? unsafe(match[4]) : true;\n\t const value = valueRaw === 'true' ||\n\t valueRaw === 'false' ||\n\t valueRaw === 'null' ? JSON.parse(valueRaw)\n\t : valueRaw;\n\n\t // Convert keys with '[]' suffix to an array\n\t if (isArray) {\n\t if (!hasOwnProperty.call(p, key)) {\n\t p[key] = [];\n\t } else if (!Array.isArray(p[key])) {\n\t p[key] = [p[key]];\n\t }\n\t }\n\n\t // safeguard against resetting a previously defined\n\t // array by accidentally forgetting the brackets\n\t if (Array.isArray(p[key])) {\n\t p[key].push(value);\n\t } else {\n\t p[key] = value;\n\t }\n\t }\n\n\t // {a:{y:1},\"a.b\":{x:2}} --> {a:{y:1,b:{x:2}}}\n\t // use a filter to return the keys that have to be deleted.\n\t const remove = [];\n\t for (const k of Object.keys(out)) {\n\t if (!hasOwnProperty.call(out, k) ||\n\t typeof out[k] !== 'object' ||\n\t Array.isArray(out[k])) {\n\t continue\n\t }\n\n\t // see if the parent section is also an object.\n\t // if so, add it to that, and mark this one for deletion\n\t const parts = splitSections(k, '.');\n\t p = out;\n\t const l = parts.pop();\n\t const nl = l.replace(/\\\\\\./g, '.');\n\t for (const part of parts) {\n\t if (part === '__proto__') {\n\t continue\n\t }\n\t if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object') {\n\t p[part] = Object.create(null);\n\t }\n\t p = p[part];\n\t }\n\t if (p === out && nl === l) {\n\t continue\n\t }\n\n\t p[nl] = out[k];\n\t remove.push(k);\n\t }\n\t for (const del of remove) {\n\t delete out[del];\n\t }\n\n\t return out\n\t};\n\n\tconst isQuoted = val => {\n\t return (val.startsWith('\"') && val.endsWith('\"')) ||\n\t (val.startsWith(\"'\") && val.endsWith(\"'\"))\n\t};\n\n\tconst safe = val => {\n\t if (\n\t typeof val !== 'string' ||\n\t val.match(/[=\\r\\n]/) ||\n\t val.match(/^\\[/) ||\n\t (val.length > 1 && isQuoted(val)) ||\n\t val !== val.trim()\n\t ) {\n\t return JSON.stringify(val)\n\t }\n\t return val.split(';').join('\\\\;').split('#').join('\\\\#')\n\t};\n\n\tconst unsafe = val => {\n\t val = (val || '').trim();\n\t if (isQuoted(val)) {\n\t // remove the single quotes before calling JSON.parse\n\t if (val.charAt(0) === \"'\") {\n\t val = val.slice(1, -1);\n\t }\n\t try {\n\t val = JSON.parse(val);\n\t } catch {\n\t // ignore errors\n\t }\n\t } else {\n\t // walk the val to find the first not-escaped ; character\n\t let esc = false;\n\t let unesc = '';\n\t for (let i = 0, l = val.length; i < l; i++) {\n\t const c = val.charAt(i);\n\t if (esc) {\n\t if ('\\\\;#'.indexOf(c) !== -1) {\n\t unesc += c;\n\t } else {\n\t unesc += '\\\\' + c;\n\t }\n\n\t esc = false;\n\t } else if (';#'.indexOf(c) !== -1) {\n\t break\n\t } else if (c === '\\\\') {\n\t esc = true;\n\t } else {\n\t unesc += c;\n\t }\n\t }\n\t if (esc) {\n\t unesc += '\\\\';\n\t }\n\n\t return unesc.trim()\n\t }\n\t return val\n\t};\n\n\tini$1 = {\n\t parse: decode,\n\t decode,\n\t stringify: encode,\n\t encode,\n\t safe,\n\t unsafe,\n\t};\n\treturn ini$1;\n}\n\nvar iniExports = requireIni();\nconst ini = /*@__PURE__*/getDefaultExportFromCjs(iniExports);\n\nvar prompts$2 = {};\n\nvar kleur;\nvar hasRequiredKleur;\n\nfunction requireKleur () {\n\tif (hasRequiredKleur) return kleur;\n\thasRequiredKleur = 1;\n\n\tlet FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;\n\tif (typeof process !== 'undefined') {\n\t\t({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});\n\t\tisTTY = process.stdout && process.stdout.isTTY;\n\t}\n\n\tconst $ = {\n\t\tenabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && (\n\t\t\tFORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY\n\t\t),\n\n\t\t// modifiers\n\t\treset: init(0, 0),\n\t\tbold: init(1, 22),\n\t\tdim: init(2, 22),\n\t\titalic: init(3, 23),\n\t\tunderline: init(4, 24),\n\t\tinverse: init(7, 27),\n\t\thidden: init(8, 28),\n\t\tstrikethrough: init(9, 29),\n\n\t\t// colors\n\t\tblack: init(30, 39),\n\t\tred: init(31, 39),\n\t\tgreen: init(32, 39),\n\t\tyellow: init(33, 39),\n\t\tblue: init(34, 39),\n\t\tmagenta: init(35, 39),\n\t\tcyan: init(36, 39),\n\t\twhite: init(37, 39),\n\t\tgray: init(90, 39),\n\t\tgrey: init(90, 39),\n\n\t\t// background colors\n\t\tbgBlack: init(40, 49),\n\t\tbgRed: init(41, 49),\n\t\tbgGreen: init(42, 49),\n\t\tbgYellow: init(43, 49),\n\t\tbgBlue: init(44, 49),\n\t\tbgMagenta: init(45, 49),\n\t\tbgCyan: init(46, 49),\n\t\tbgWhite: init(47, 49)\n\t};\n\n\tfunction run(arr, str) {\n\t\tlet i=0, tmp, beg='', end='';\n\t\tfor (; i < arr.length; i++) {\n\t\t\ttmp = arr[i];\n\t\t\tbeg += tmp.open;\n\t\t\tend += tmp.close;\n\t\t\tif (!!~str.indexOf(tmp.close)) {\n\t\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t\t}\n\t\t}\n\t\treturn beg + str + end;\n\t}\n\n\tfunction chain(has, keys) {\n\t\tlet ctx = { has, keys };\n\n\t\tctx.reset = $.reset.bind(ctx);\n\t\tctx.bold = $.bold.bind(ctx);\n\t\tctx.dim = $.dim.bind(ctx);\n\t\tctx.italic = $.italic.bind(ctx);\n\t\tctx.underline = $.underline.bind(ctx);\n\t\tctx.inverse = $.inverse.bind(ctx);\n\t\tctx.hidden = $.hidden.bind(ctx);\n\t\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\t\tctx.black = $.black.bind(ctx);\n\t\tctx.red = $.red.bind(ctx);\n\t\tctx.green = $.green.bind(ctx);\n\t\tctx.yellow = $.yellow.bind(ctx);\n\t\tctx.blue = $.blue.bind(ctx);\n\t\tctx.magenta = $.magenta.bind(ctx);\n\t\tctx.cyan = $.cyan.bind(ctx);\n\t\tctx.white = $.white.bind(ctx);\n\t\tctx.gray = $.gray.bind(ctx);\n\t\tctx.grey = $.grey.bind(ctx);\n\n\t\tctx.bgBlack = $.bgBlack.bind(ctx);\n\t\tctx.bgRed = $.bgRed.bind(ctx);\n\t\tctx.bgGreen = $.bgGreen.bind(ctx);\n\t\tctx.bgYellow = $.bgYellow.bind(ctx);\n\t\tctx.bgBlue = $.bgBlue.bind(ctx);\n\t\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\t\tctx.bgCyan = $.bgCyan.bind(ctx);\n\t\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\t\treturn ctx;\n\t}\n\n\tfunction init(open, close) {\n\t\tlet blk = {\n\t\t\topen: `\\x1b[${open}m`,\n\t\t\tclose: `\\x1b[${close}m`,\n\t\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t\t};\n\t\treturn function (txt) {\n\t\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\t\t!!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t\t}\n\t\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t\t};\n\t}\n\n\tkleur = $;\n\treturn kleur;\n}\n\nvar action;\nvar hasRequiredAction;\n\nfunction requireAction () {\n\tif (hasRequiredAction) return action;\n\thasRequiredAction = 1;\n\n\taction = (key, isSelect) => {\n\t if (key.meta && key.name !== 'escape') return;\n\n\t if (key.ctrl) {\n\t if (key.name === 'a') return 'first';\n\t if (key.name === 'c') return 'abort';\n\t if (key.name === 'd') return 'abort';\n\t if (key.name === 'e') return 'last';\n\t if (key.name === 'g') return 'reset';\n\t if (key.name === 'n') return 'down';\n\t if (key.name === 'p') return 'up';\n\t // avoid any non-ascii characters\n\t return\n\t }\n\n\t if (isSelect) {\n\t if (key.name === 'j') return 'down';\n\t if (key.name === 'k') return 'up';\n\t }\n\n\t if (key.name === 'return') return 'submit';\n\t if (key.name === 'enter') return 'submit'; // ctrl + J\n\t if (key.name === 'backspace') return 'delete';\n\t if (key.name === 'delete') return 'deleteForward';\n\t if (key.name === 'abort') return 'abort';\n\t if (key.name === 'escape') return 'exit';\n\t // TODO: shift tab for prev\n\t if (key.name === 'tab') return 'next';\n\t if (key.name === 'pagedown') return 'nextPage';\n\t if (key.name === 'pageup') return 'prevPage';\n\t // TODO create home() in prompt types (e.g. TextPrompt)\n\t if (key.name === 'home') return 'home';\n\t // TODO create end() in prompt types (e.g. TextPrompt)\n\t if (key.name === 'end') return 'end';\n\n\t if (key.name === 'up') return 'up';\n\t if (key.name === 'down') return 'down';\n\t if (key.name === 'right') return 'right';\n\t if (key.name === 'left') return 'left';\n\n\t return false;\n\t};\n\treturn action;\n}\n\nvar strip;\nvar hasRequiredStrip;\n\nfunction requireStrip () {\n\tif (hasRequiredStrip) return strip;\n\thasRequiredStrip = 1;\n\n\tstrip = str => {\n\t const pattern = [\n\t '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n\t '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))'\n\t ].join('|');\n\n\t const RGX = new RegExp(pattern, 'g');\n\t return typeof str === 'string' ? str.replace(RGX, '') : str;\n\t};\n\treturn strip;\n}\n\nvar src;\nvar hasRequiredSrc;\n\nfunction requireSrc () {\n\tif (hasRequiredSrc) return src;\n\thasRequiredSrc = 1;\n\n\tconst ESC = '\\x1B';\n\tconst CSI = `${ESC}[`;\n\tconst beep = '\\u0007';\n\n\tconst cursor = {\n\t to(x, y) {\n\t if (!y) return `${CSI}${x + 1}G`;\n\t return `${CSI}${y + 1};${x + 1}H`;\n\t },\n\t move(x, y) {\n\t let ret = '';\n\n\t if (x < 0) ret += `${CSI}${-x}D`;\n\t else if (x > 0) ret += `${CSI}${x}C`;\n\n\t if (y < 0) ret += `${CSI}${-y}A`;\n\t else if (y > 0) ret += `${CSI}${y}B`;\n\n\t return ret;\n\t },\n\t up: (count = 1) => `${CSI}${count}A`,\n\t down: (count = 1) => `${CSI}${count}B`,\n\t forward: (count = 1) => `${CSI}${count}C`,\n\t backward: (count = 1) => `${CSI}${count}D`,\n\t nextLine: (count = 1) => `${CSI}E`.repeat(count),\n\t prevLine: (count = 1) => `${CSI}F`.repeat(count),\n\t left: `${CSI}G`,\n\t hide: `${CSI}?25l`,\n\t show: `${CSI}?25h`,\n\t save: `${ESC}7`,\n\t restore: `${ESC}8`\n\t};\n\n\tconst scroll = {\n\t up: (count = 1) => `${CSI}S`.repeat(count),\n\t down: (count = 1) => `${CSI}T`.repeat(count)\n\t};\n\n\tconst erase = {\n\t screen: `${CSI}2J`,\n\t up: (count = 1) => `${CSI}1J`.repeat(count),\n\t down: (count = 1) => `${CSI}J`.repeat(count),\n\t line: `${CSI}2K`,\n\t lineEnd: `${CSI}K`,\n\t lineStart: `${CSI}1K`,\n\t lines(count) {\n\t let clear = '';\n\t for (let i = 0; i < count; i++)\n\t clear += this.line + (i < count - 1 ? cursor.up() : '');\n\t if (count)\n\t clear += cursor.left;\n\t return clear;\n\t }\n\t};\n\n\tsrc = { cursor, scroll, erase, beep };\n\treturn src;\n}\n\nvar clear;\nvar hasRequiredClear;\n\nfunction requireClear () {\n\tif (hasRequiredClear) return clear;\n\thasRequiredClear = 1;\n\n\tconst strip = requireStrip();\n\tconst { erase, cursor } = requireSrc();\n\n\tconst width = str => [...strip(str)].length;\n\n\t/**\n\t * @param {string} prompt\n\t * @param {number} perLine\n\t */\n\tclear = function(prompt, perLine) {\n\t if (!perLine) return erase.line + cursor.to(0);\n\n\t let rows = 0;\n\t const lines = prompt.split(/\\r?\\n/);\n\t for (let line of lines) {\n\t rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);\n\t }\n\n\t return erase.lines(rows);\n\t};\n\treturn clear;\n}\n\nvar figures_1;\nvar hasRequiredFigures;\n\nfunction requireFigures () {\n\tif (hasRequiredFigures) return figures_1;\n\thasRequiredFigures = 1;\n\n\t const main = {\n\t arrowUp: '↑',\n\t arrowDown: '↓',\n\t arrowLeft: '←',\n\t arrowRight: '→',\n\t radioOn: '◉',\n\t radioOff: '◯',\n\t tick: '✔',\t\n\t cross: '✖',\t\n\t ellipsis: '…',\t\n\t pointerSmall: '›',\t\n\t line: '─',\t\n\t pointer: '❯'\t\n\t};\t\n\tconst win = {\n\t arrowUp: main.arrowUp,\n\t arrowDown: main.arrowDown,\n\t arrowLeft: main.arrowLeft,\n\t arrowRight: main.arrowRight,\n\t radioOn: '(*)',\n\t radioOff: '( )',\t\n\t tick: '√',\t\n\t cross: '×',\t\n\t ellipsis: '...',\t\n\t pointerSmall: '»',\t\n\t line: '─',\t\n\t pointer: '>'\t\n\t};\t\n\tconst figures = process.platform === 'win32' ? win : main;\t\n\n\t figures_1 = figures;\n\treturn figures_1;\n}\n\nvar style;\nvar hasRequiredStyle;\n\nfunction requireStyle () {\n\tif (hasRequiredStyle) return style;\n\thasRequiredStyle = 1;\n\n\tconst c = requireKleur();\n\tconst figures = requireFigures();\n\n\t// rendering user input.\n\tconst styles = Object.freeze({\n\t password: { scale: 1, render: input => '*'.repeat(input.length) },\n\t emoji: { scale: 2, render: input => '😃'.repeat(input.length) },\n\t invisible: { scale: 0, render: input => '' },\n\t default: { scale: 1, render: input => `${input}` }\n\t});\n\tconst render = type => styles[type] || styles.default;\n\n\t// icon to signalize a prompt.\n\tconst symbols = Object.freeze({\n\t aborted: c.red(figures.cross),\n\t done: c.green(figures.tick),\n\t exited: c.yellow(figures.cross),\n\t default: c.cyan('?')\n\t});\n\n\tconst symbol = (done, aborted, exited) =>\n\t aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default;\n\n\t// between the question and the user's input.\n\tconst delimiter = completing =>\n\t c.gray(completing ? figures.ellipsis : figures.pointerSmall);\n\n\tconst item = (expandable, expanded) =>\n\t c.gray(expandable ? (expanded ? figures.pointerSmall : '+') : figures.line);\n\n\tstyle = {\n\t styles,\n\t render,\n\t symbols,\n\t symbol,\n\t delimiter,\n\t item\n\t};\n\treturn style;\n}\n\nvar lines;\nvar hasRequiredLines;\n\nfunction requireLines () {\n\tif (hasRequiredLines) return lines;\n\thasRequiredLines = 1;\n\n\tconst strip = requireStrip();\n\n\t/**\n\t * @param {string} msg\n\t * @param {number} perLine\n\t */\n\tlines = function (msg, perLine) {\n\t let lines = String(strip(msg) || '').split(/\\r?\\n/);\n\n\t if (!perLine) return lines.length;\n\t return lines.map(l => Math.ceil(l.length / perLine))\n\t .reduce((a, b) => a + b);\n\t};\n\treturn lines;\n}\n\nvar wrap;\nvar hasRequiredWrap;\n\nfunction requireWrap () {\n\tif (hasRequiredWrap) return wrap;\n\thasRequiredWrap = 1;\n\n\t/**\n\t * @param {string} msg The message to wrap\n\t * @param {object} opts\n\t * @param {number|string} [opts.margin] Left margin\n\t * @param {number} opts.width Maximum characters per line including the margin\n\t */\n\twrap = (msg, opts = {}) => {\n\t const tab = Number.isSafeInteger(parseInt(opts.margin))\n\t ? new Array(parseInt(opts.margin)).fill(' ').join('')\n\t : (opts.margin || '');\n\n\t const width = opts.width;\n\n\t return (msg || '').split(/\\r?\\n/g)\n\t .map(line => line\n\t .split(/\\s+/g)\n\t .reduce((arr, w) => {\n\t if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width)\n\t arr[arr.length - 1] += ` ${w}`;\n\t else arr.push(`${tab}${w}`);\n\t return arr;\n\t }, [ tab ])\n\t .join('\\n'))\n\t .join('\\n');\n\t};\n\treturn wrap;\n}\n\nvar entriesToDisplay;\nvar hasRequiredEntriesToDisplay;\n\nfunction requireEntriesToDisplay () {\n\tif (hasRequiredEntriesToDisplay) return entriesToDisplay;\n\thasRequiredEntriesToDisplay = 1;\n\n\t/**\n\t * Determine what entries should be displayed on the screen, based on the\n\t * currently selected index and the maximum visible. Used in list-based\n\t * prompts like `select` and `multiselect`.\n\t *\n\t * @param {number} cursor the currently selected entry\n\t * @param {number} total the total entries available to display\n\t * @param {number} [maxVisible] the number of entries that can be displayed\n\t */\n\tentriesToDisplay = (cursor, total, maxVisible) => {\n\t maxVisible = maxVisible || total;\n\n\t let startIndex = Math.min(total- maxVisible, cursor - Math.floor(maxVisible / 2));\n\t if (startIndex < 0) startIndex = 0;\n\n\t let endIndex = Math.min(startIndex + maxVisible, total);\n\n\t return { startIndex, endIndex };\n\t};\n\treturn entriesToDisplay;\n}\n\nvar util;\nvar hasRequiredUtil;\n\nfunction requireUtil () {\n\tif (hasRequiredUtil) return util;\n\thasRequiredUtil = 1;\n\n\tutil = {\n\t action: requireAction(),\n\t clear: requireClear(),\n\t style: requireStyle(),\n\t strip: requireStrip(),\n\t figures: requireFigures(),\n\t lines: requireLines(),\n\t wrap: requireWrap(),\n\t entriesToDisplay: requireEntriesToDisplay()\n\t};\n\treturn util;\n}\n\nvar prompt;\nvar hasRequiredPrompt;\n\nfunction requirePrompt () {\n\tif (hasRequiredPrompt) return prompt;\n\thasRequiredPrompt = 1;\n\n\tconst readline = require$$0;\n\tconst { action } = requireUtil();\n\tconst EventEmitter = require$$2;\n\tconst { beep, cursor } = requireSrc();\n\tconst color = requireKleur();\n\n\t/**\n\t * Base prompt skeleton\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t */\n\tclass Prompt extends EventEmitter {\n\t constructor(opts={}) {\n\t super();\n\n\t this.firstRender = true;\n\t this.in = opts.stdin || process.stdin;\n\t this.out = opts.stdout || process.stdout;\n\t this.onRender = (opts.onRender || (() => void 0)).bind(this);\n\t const rl = readline.createInterface({ input:this.in, escapeCodeTimeout:50 });\n\t readline.emitKeypressEvents(this.in, rl);\n\n\t if (this.in.isTTY) this.in.setRawMode(true);\n\t const isSelect = [ 'SelectPrompt', 'MultiselectPrompt' ].indexOf(this.constructor.name) > -1;\n\t const keypress = (str, key) => {\n\t let a = action(key, isSelect);\n\t if (a === false) {\n\t this._ && this._(str, key);\n\t } else if (typeof this[a] === 'function') {\n\t this[a](key);\n\t } else {\n\t this.bell();\n\t }\n\t };\n\n\t this.close = () => {\n\t this.out.write(cursor.show);\n\t this.in.removeListener('keypress', keypress);\n\t if (this.in.isTTY) this.in.setRawMode(false);\n\t rl.close();\n\t this.emit(this.aborted ? 'abort' : this.exited ? 'exit' : 'submit', this.value);\n\t this.closed = true;\n\t };\n\n\t this.in.on('keypress', keypress);\n\t }\n\n\t fire() {\n\t this.emit('state', {\n\t value: this.value,\n\t aborted: !!this.aborted,\n\t exited: !!this.exited\n\t });\n\t }\n\n\t bell() {\n\t this.out.write(beep);\n\t }\n\n\t render() {\n\t this.onRender(color);\n\t if (this.firstRender) this.firstRender = false;\n\t }\n\t}\n\n\tprompt = Prompt;\n\treturn prompt;\n}\n\nvar text;\nvar hasRequiredText;\n\nfunction requireText () {\n\tif (hasRequiredText) return text;\n\thasRequiredText = 1;\n\tconst color = requireKleur();\n\tconst Prompt = requirePrompt();\n\tconst { erase, cursor } = requireSrc();\n\tconst { style, clear, lines, figures } = requireUtil();\n\n\t/**\n\t * TextPrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {String} [opts.style='default'] Render style\n\t * @param {String} [opts.initial] Default value\n\t * @param {Function} [opts.validate] Validate function\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t * @param {String} [opts.error] The invalid error label\n\t */\n\tclass TextPrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.transform = style.render(opts.style);\n\t this.scale = this.transform.scale;\n\t this.msg = opts.message;\n\t this.initial = opts.initial || ``;\n\t this.validator = opts.validate || (() => true);\n\t this.value = ``;\n\t this.errorMsg = opts.error || `Please Enter A Valid Value`;\n\t this.cursor = Number(!!this.initial);\n\t this.cursorOffset = 0;\n\t this.clear = clear(``, this.out.columns);\n\t this.render();\n\t }\n\n\t set value(v) {\n\t if (!v && this.initial) {\n\t this.placeholder = true;\n\t this.rendered = color.gray(this.transform.render(this.initial));\n\t } else {\n\t this.placeholder = false;\n\t this.rendered = this.transform.render(v);\n\t }\n\t this._value = v;\n\t this.fire();\n\t }\n\n\t get value() {\n\t return this._value;\n\t }\n\n\t reset() {\n\t this.value = ``;\n\t this.cursor = Number(!!this.initial);\n\t this.cursorOffset = 0;\n\t this.fire();\n\t this.render();\n\t }\n\n\t exit() {\n\t this.abort();\n\t }\n\n\t abort() {\n\t this.value = this.value || this.initial;\n\t this.done = this.aborted = true;\n\t this.error = false;\n\t this.red = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t async validate() {\n\t let valid = await this.validator(this.value);\n\t if (typeof valid === `string`) {\n\t this.errorMsg = valid;\n\t valid = false;\n\t }\n\t this.error = !valid;\n\t }\n\n\t async submit() {\n\t this.value = this.value || this.initial;\n\t this.cursorOffset = 0;\n\t this.cursor = this.rendered.length;\n\t await this.validate();\n\t if (this.error) {\n\t this.red = true;\n\t this.fire();\n\t this.render();\n\t return;\n\t }\n\t this.done = true;\n\t this.aborted = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t next() {\n\t if (!this.placeholder) return this.bell();\n\t this.value = this.initial;\n\t this.cursor = this.rendered.length;\n\t this.fire();\n\t this.render();\n\t }\n\n\t moveCursor(n) {\n\t if (this.placeholder) return;\n\t this.cursor = this.cursor+n;\n\t this.cursorOffset += n;\n\t }\n\n\t _(c, key) {\n\t let s1 = this.value.slice(0, this.cursor);\n\t let s2 = this.value.slice(this.cursor);\n\t this.value = `${s1}${c}${s2}`;\n\t this.red = false;\n\t this.cursor = this.placeholder ? 0 : s1.length+1;\n\t this.render();\n\t }\n\n\t delete() {\n\t if (this.isCursorAtStart()) return this.bell();\n\t let s1 = this.value.slice(0, this.cursor-1);\n\t let s2 = this.value.slice(this.cursor);\n\t this.value = `${s1}${s2}`;\n\t this.red = false;\n\t if (this.isCursorAtStart()) {\n\t this.cursorOffset = 0;\n\t } else {\n\t this.cursorOffset++;\n\t this.moveCursor(-1);\n\t }\n\t this.render();\n\t }\n\n\t deleteForward() {\n\t if(this.cursor*this.scale >= this.rendered.length || this.placeholder) return this.bell();\n\t let s1 = this.value.slice(0, this.cursor);\n\t let s2 = this.value.slice(this.cursor+1);\n\t this.value = `${s1}${s2}`;\n\t this.red = false;\n\t if (this.isCursorAtEnd()) {\n\t this.cursorOffset = 0;\n\t } else {\n\t this.cursorOffset++;\n\t }\n\t this.render();\n\t }\n\n\t first() {\n\t this.cursor = 0;\n\t this.render();\n\t }\n\n\t last() {\n\t this.cursor = this.value.length;\n\t this.render();\n\t }\n\n\t left() {\n\t if (this.cursor <= 0 || this.placeholder) return this.bell();\n\t this.moveCursor(-1);\n\t this.render();\n\t }\n\n\t right() {\n\t if (this.cursor*this.scale >= this.rendered.length || this.placeholder) return this.bell();\n\t this.moveCursor(1);\n\t this.render();\n\t }\n\n\t isCursorAtStart() {\n\t return this.cursor === 0 || (this.placeholder && this.cursor === 1);\n\t }\n\n\t isCursorAtEnd() {\n\t return this.cursor === this.rendered.length || (this.placeholder && this.cursor === this.rendered.length + 1)\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (!this.firstRender) {\n\t if (this.outputError)\n\t this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n\t this.out.write(clear(this.outputText, this.out.columns));\n\t }\n\t super.render();\n\t this.outputError = '';\n\n\t this.outputText = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(this.done),\n\t this.red ? color.red(this.rendered) : this.rendered\n\t ].join(` `);\n\n\t if (this.error) {\n\t this.outputError += this.errorMsg.split(`\\n`)\n\t .reduce((a, l, i) => a + `\\n${i ? ' ' : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n\t }\n\n\t this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));\n\t }\n\t}\n\n\ttext = TextPrompt;\n\treturn text;\n}\n\nvar select;\nvar hasRequiredSelect;\n\nfunction requireSelect () {\n\tif (hasRequiredSelect) return select;\n\thasRequiredSelect = 1;\n\n\tconst color = requireKleur();\n\tconst Prompt = requirePrompt();\n\tconst { style, clear, figures, wrap, entriesToDisplay } = requireUtil();\n\tconst { cursor } = requireSrc();\n\n\t/**\n\t * SelectPrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {Array} opts.choices Array of choice objects\n\t * @param {String} [opts.hint] Hint to display\n\t * @param {Number} [opts.initial] Index of default value\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n\t */\n\tclass SelectPrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.msg = opts.message;\n\t this.hint = opts.hint || '- Use arrow-keys. Return to submit.';\n\t this.warn = opts.warn || '- This option is disabled';\n\t this.cursor = opts.initial || 0;\n\t this.choices = opts.choices.map((ch, idx) => {\n\t if (typeof ch === 'string')\n\t ch = {title: ch, value: idx};\n\t return {\n\t title: ch && (ch.title || ch.value || ch),\n\t value: ch && (ch.value === undefined ? idx : ch.value),\n\t description: ch && ch.description,\n\t selected: ch && ch.selected,\n\t disabled: ch && ch.disabled\n\t };\n\t });\n\t this.optionsPerPage = opts.optionsPerPage || 10;\n\t this.value = (this.choices[this.cursor] || {}).value;\n\t this.clear = clear('', this.out.columns);\n\t this.render();\n\t }\n\n\t moveCursor(n) {\n\t this.cursor = n;\n\t this.value = this.choices[n].value;\n\t this.fire();\n\t }\n\n\t reset() {\n\t this.moveCursor(0);\n\t this.fire();\n\t this.render();\n\t }\n\n\t exit() {\n\t this.abort();\n\t }\n\n\t abort() {\n\t this.done = this.aborted = true;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t submit() {\n\t if (!this.selection.disabled) {\n\t this.done = true;\n\t this.aborted = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t } else\n\t this.bell();\n\t }\n\n\t first() {\n\t this.moveCursor(0);\n\t this.render();\n\t }\n\n\t last() {\n\t this.moveCursor(this.choices.length - 1);\n\t this.render();\n\t }\n\n\t up() {\n\t if (this.cursor === 0) {\n\t this.moveCursor(this.choices.length - 1);\n\t } else {\n\t this.moveCursor(this.cursor - 1);\n\t }\n\t this.render();\n\t }\n\n\t down() {\n\t if (this.cursor === this.choices.length - 1) {\n\t this.moveCursor(0);\n\t } else {\n\t this.moveCursor(this.cursor + 1);\n\t }\n\t this.render();\n\t }\n\n\t next() {\n\t this.moveCursor((this.cursor + 1) % this.choices.length);\n\t this.render();\n\t }\n\n\t _(c, key) {\n\t if (c === ' ') return this.submit();\n\t }\n\n\t get selection() {\n\t return this.choices[this.cursor];\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (this.firstRender) this.out.write(cursor.hide);\n\t else this.out.write(clear(this.outputText, this.out.columns));\n\t super.render();\n\n\t let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);\n\n\t // Print prompt\n\t this.outputText = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(false),\n\t this.done ? this.selection.title : this.selection.disabled\n\t ? color.yellow(this.warn) : color.gray(this.hint)\n\t ].join(' ');\n\n\t // Print choices\n\t if (!this.done) {\n\t this.outputText += '\\n';\n\t for (let i = startIndex; i < endIndex; i++) {\n\t let title, prefix, desc = '', v = this.choices[i];\n\n\t // Determine whether to display \"more choices\" indicators\n\t if (i === startIndex && startIndex > 0) {\n\t prefix = figures.arrowUp;\n\t } else if (i === endIndex - 1 && endIndex < this.choices.length) {\n\t prefix = figures.arrowDown;\n\t } else {\n\t prefix = ' ';\n\t }\n\n\t if (v.disabled) {\n\t title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n\t prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + ' ' : ' ') + prefix;\n\t } else {\n\t title = this.cursor === i ? color.cyan().underline(v.title) : v.title;\n\t prefix = (this.cursor === i ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n\t if (v.description && this.cursor === i) {\n\t desc = ` - ${v.description}`;\n\t if (prefix.length + title.length + desc.length >= this.out.columns\n\t || v.description.split(/\\r?\\n/).length > 1) {\n\t desc = '\\n' + wrap(v.description, { margin: 3, width: this.out.columns });\n\t }\n\t }\n\t }\n\n\t this.outputText += `${prefix} ${title}${color.gray(desc)}\\n`;\n\t }\n\t }\n\n\t this.out.write(this.outputText);\n\t }\n\t}\n\n\tselect = SelectPrompt;\n\treturn select;\n}\n\nvar toggle;\nvar hasRequiredToggle;\n\nfunction requireToggle () {\n\tif (hasRequiredToggle) return toggle;\n\thasRequiredToggle = 1;\n\tconst color = requireKleur();\n\tconst Prompt = requirePrompt();\n\tconst { style, clear } = requireUtil();\n\tconst { cursor, erase } = requireSrc();\n\n\t/**\n\t * TogglePrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {Boolean} [opts.initial=false] Default value\n\t * @param {String} [opts.active='no'] Active label\n\t * @param {String} [opts.inactive='off'] Inactive label\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t */\n\tclass TogglePrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.msg = opts.message;\n\t this.value = !!opts.initial;\n\t this.active = opts.active || 'on';\n\t this.inactive = opts.inactive || 'off';\n\t this.initialValue = this.value;\n\t this.render();\n\t }\n\n\t reset() {\n\t this.value = this.initialValue;\n\t this.fire();\n\t this.render();\n\t }\n\n\t exit() {\n\t this.abort();\n\t }\n\n\t abort() {\n\t this.done = this.aborted = true;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t submit() {\n\t this.done = true;\n\t this.aborted = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t deactivate() {\n\t if (this.value === false) return this.bell();\n\t this.value = false;\n\t this.render();\n\t }\n\n\t activate() {\n\t if (this.value === true) return this.bell();\n\t this.value = true;\n\t this.render();\n\t }\n\n\t delete() {\n\t this.deactivate();\n\t }\n\t left() {\n\t this.deactivate();\n\t }\n\t right() {\n\t this.activate();\n\t }\n\t down() {\n\t this.deactivate();\n\t }\n\t up() {\n\t this.activate();\n\t }\n\n\t next() {\n\t this.value = !this.value;\n\t this.fire();\n\t this.render();\n\t }\n\n\t _(c, key) {\n\t if (c === ' ') {\n\t this.value = !this.value;\n\t } else if (c === '1') {\n\t this.value = true;\n\t } else if (c === '0') {\n\t this.value = false;\n\t } else return this.bell();\n\t this.render();\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (this.firstRender) this.out.write(cursor.hide);\n\t else this.out.write(clear(this.outputText, this.out.columns));\n\t super.render();\n\n\t this.outputText = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(this.done),\n\t this.value ? this.inactive : color.cyan().underline(this.inactive),\n\t color.gray('/'),\n\t this.value ? color.cyan().underline(this.active) : this.active\n\t ].join(' ');\n\n\t this.out.write(erase.line + cursor.to(0) + this.outputText);\n\t }\n\t}\n\n\ttoggle = TogglePrompt;\n\treturn toggle;\n}\n\nvar datepart;\nvar hasRequiredDatepart;\n\nfunction requireDatepart () {\n\tif (hasRequiredDatepart) return datepart;\n\thasRequiredDatepart = 1;\n\n\tclass DatePart {\n\t constructor({token, date, parts, locales}) {\n\t this.token = token;\n\t this.date = date || new Date();\n\t this.parts = parts || [this];\n\t this.locales = locales || {};\n\t }\n\n\t up() {}\n\n\t down() {}\n\n\t next() {\n\t const currentIdx = this.parts.indexOf(this);\n\t return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n\t }\n\n\t setTo(val) {}\n\n\t prev() {\n\t let parts = [].concat(this.parts).reverse();\n\t const currentIdx = parts.indexOf(this);\n\t return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n\t }\n\n\t toString() {\n\t return String(this.date);\n\t }\n\t}\n\n\tdatepart = DatePart;\n\treturn datepart;\n}\n\nvar meridiem;\nvar hasRequiredMeridiem;\n\nfunction requireMeridiem () {\n\tif (hasRequiredMeridiem) return meridiem;\n\thasRequiredMeridiem = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tclass Meridiem extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setHours((this.date.getHours() + 12) % 24);\n\t }\n\n\t down() {\n\t this.up();\n\t }\n\n\t toString() {\n\t let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';\n\t return /\\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n\t }\n\t}\n\n\tmeridiem = Meridiem;\n\treturn meridiem;\n}\n\nvar day;\nvar hasRequiredDay;\n\nfunction requireDay () {\n\tif (hasRequiredDay) return day;\n\thasRequiredDay = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tconst pos = n => {\n\t n = n % 10;\n\t return n === 1 ? 'st'\n\t : n === 2 ? 'nd'\n\t : n === 3 ? 'rd'\n\t : 'th';\n\t};\n\n\tclass Day extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setDate(this.date.getDate() + 1);\n\t }\n\n\t down() {\n\t this.date.setDate(this.date.getDate() - 1);\n\t }\n\n\t setTo(val) {\n\t this.date.setDate(parseInt(val.substr(-2)));\n\t }\n\n\t toString() {\n\t let date = this.date.getDate();\n\t let day = this.date.getDay();\n\t return this.token === 'DD' ? String(date).padStart(2, '0')\n\t : this.token === 'Do' ? date + pos(date)\n\t : this.token === 'd' ? day + 1\n\t : this.token === 'ddd' ? this.locales.weekdaysShort[day]\n\t : this.token === 'dddd' ? this.locales.weekdays[day]\n\t : date;\n\t }\n\t}\n\n\tday = Day;\n\treturn day;\n}\n\nvar hours;\nvar hasRequiredHours;\n\nfunction requireHours () {\n\tif (hasRequiredHours) return hours;\n\thasRequiredHours = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tclass Hours extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setHours(this.date.getHours() + 1);\n\t }\n\n\t down() {\n\t this.date.setHours(this.date.getHours() - 1);\n\t }\n\n\t setTo(val) {\n\t this.date.setHours(parseInt(val.substr(-2)));\n\t }\n\n\t toString() {\n\t let hours = this.date.getHours();\n\t if (/h/.test(this.token))\n\t hours = (hours % 12) || 12;\n\t return this.token.length > 1 ? String(hours).padStart(2, '0') : hours;\n\t }\n\t}\n\n\thours = Hours;\n\treturn hours;\n}\n\nvar milliseconds;\nvar hasRequiredMilliseconds;\n\nfunction requireMilliseconds () {\n\tif (hasRequiredMilliseconds) return milliseconds;\n\thasRequiredMilliseconds = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tclass Milliseconds extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setMilliseconds(this.date.getMilliseconds() + 1);\n\t }\n\n\t down() {\n\t this.date.setMilliseconds(this.date.getMilliseconds() - 1);\n\t }\n\n\t setTo(val) {\n\t this.date.setMilliseconds(parseInt(val.substr(-(this.token.length))));\n\t }\n\n\t toString() {\n\t return String(this.date.getMilliseconds()).padStart(4, '0')\n\t .substr(0, this.token.length);\n\t }\n\t}\n\n\tmilliseconds = Milliseconds;\n\treturn milliseconds;\n}\n\nvar minutes;\nvar hasRequiredMinutes;\n\nfunction requireMinutes () {\n\tif (hasRequiredMinutes) return minutes;\n\thasRequiredMinutes = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tclass Minutes extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setMinutes(this.date.getMinutes() + 1);\n\t }\n\n\t down() {\n\t this.date.setMinutes(this.date.getMinutes() - 1);\n\t }\n\n\t setTo(val) {\n\t this.date.setMinutes(parseInt(val.substr(-2)));\n\t }\n\n\t toString() {\n\t let m = this.date.getMinutes();\n\t return this.token.length > 1 ? String(m).padStart(2, '0') : m;\n\t }\n\t}\n\n\tminutes = Minutes;\n\treturn minutes;\n}\n\nvar month;\nvar hasRequiredMonth;\n\nfunction requireMonth () {\n\tif (hasRequiredMonth) return month;\n\thasRequiredMonth = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tclass Month extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setMonth(this.date.getMonth() + 1);\n\t }\n\n\t down() {\n\t this.date.setMonth(this.date.getMonth() - 1);\n\t }\n\n\t setTo(val) {\n\t val = parseInt(val.substr(-2)) - 1;\n\t this.date.setMonth(val < 0 ? 0 : val);\n\t }\n\n\t toString() {\n\t let month = this.date.getMonth();\n\t let tl = this.token.length;\n\t return tl === 2 ? String(month + 1).padStart(2, '0')\n\t : tl === 3 ? this.locales.monthsShort[month]\n\t : tl === 4 ? this.locales.months[month]\n\t : String(month + 1);\n\t }\n\t}\n\n\tmonth = Month;\n\treturn month;\n}\n\nvar seconds;\nvar hasRequiredSeconds;\n\nfunction requireSeconds () {\n\tif (hasRequiredSeconds) return seconds;\n\thasRequiredSeconds = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tclass Seconds extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setSeconds(this.date.getSeconds() + 1);\n\t }\n\n\t down() {\n\t this.date.setSeconds(this.date.getSeconds() - 1);\n\t }\n\n\t setTo(val) {\n\t this.date.setSeconds(parseInt(val.substr(-2)));\n\t }\n\n\t toString() {\n\t let s = this.date.getSeconds();\n\t return this.token.length > 1 ? String(s).padStart(2, '0') : s;\n\t }\n\t}\n\n\tseconds = Seconds;\n\treturn seconds;\n}\n\nvar year;\nvar hasRequiredYear;\n\nfunction requireYear () {\n\tif (hasRequiredYear) return year;\n\thasRequiredYear = 1;\n\n\tconst DatePart = requireDatepart();\n\n\tclass Year extends DatePart {\n\t constructor(opts={}) {\n\t super(opts);\n\t }\n\n\t up() {\n\t this.date.setFullYear(this.date.getFullYear() + 1);\n\t }\n\n\t down() {\n\t this.date.setFullYear(this.date.getFullYear() - 1);\n\t }\n\n\t setTo(val) {\n\t this.date.setFullYear(val.substr(-4));\n\t }\n\n\t toString() {\n\t let year = String(this.date.getFullYear()).padStart(4, '0');\n\t return this.token.length === 2 ? year.substr(-2) : year;\n\t }\n\t}\n\n\tyear = Year;\n\treturn year;\n}\n\nvar dateparts;\nvar hasRequiredDateparts;\n\nfunction requireDateparts () {\n\tif (hasRequiredDateparts) return dateparts;\n\thasRequiredDateparts = 1;\n\n\tdateparts = {\n\t DatePart: requireDatepart(),\n\t Meridiem: requireMeridiem(),\n\t Day: requireDay(),\n\t Hours: requireHours(),\n\t Milliseconds: requireMilliseconds(),\n\t Minutes: requireMinutes(),\n\t Month: requireMonth(),\n\t Seconds: requireSeconds(),\n\t Year: requireYear(),\n\t};\n\treturn dateparts;\n}\n\nvar date;\nvar hasRequiredDate;\n\nfunction requireDate () {\n\tif (hasRequiredDate) return date;\n\thasRequiredDate = 1;\n\n\tconst color = requireKleur();\n\tconst Prompt = requirePrompt();\n\tconst { style, clear, figures } = requireUtil();\n\tconst { erase, cursor } = requireSrc();\n\tconst { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = requireDateparts();\n\n\tconst regex = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\n\tconst regexGroups = {\n\t 1: ({token}) => token.replace(/\\\\(.)/g, '$1'),\n\t 2: (opts) => new Day(opts), // Day // TODO\n\t 3: (opts) => new Month(opts), // Month\n\t 4: (opts) => new Year(opts), // Year\n\t 5: (opts) => new Meridiem(opts), // AM/PM // TODO (special)\n\t 6: (opts) => new Hours(opts), // Hours\n\t 7: (opts) => new Minutes(opts), // Minutes\n\t 8: (opts) => new Seconds(opts), // Seconds\n\t 9: (opts) => new Milliseconds(opts), // Fractional seconds\n\t};\n\n\tconst dfltLocales = {\n\t months: 'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),\n\t monthsShort: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),\n\t weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),\n\t weekdaysShort: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(',')\n\t};\n\n\n\t/**\n\t * DatePrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {Number} [opts.initial] Index of default value\n\t * @param {String} [opts.mask] The format mask\n\t * @param {object} [opts.locales] The date locales\n\t * @param {String} [opts.error] The error message shown on invalid value\n\t * @param {Function} [opts.validate] Function to validate the submitted value\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t */\n\tclass DatePrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.msg = opts.message;\n\t this.cursor = 0;\n\t this.typed = '';\n\t this.locales = Object.assign(dfltLocales, opts.locales);\n\t this._date = opts.initial || new Date();\n\t this.errorMsg = opts.error || 'Please Enter A Valid Value';\n\t this.validator = opts.validate || (() => true);\n\t this.mask = opts.mask || 'YYYY-MM-DD HH:mm:ss';\n\t this.clear = clear('', this.out.columns);\n\t this.render();\n\t }\n\n\t get value() {\n\t return this.date\n\t }\n\n\t get date() {\n\t return this._date;\n\t }\n\n\t set date(date) {\n\t if (date) this._date.setTime(date.getTime());\n\t }\n\n\t set mask(mask) {\n\t let result;\n\t this.parts = [];\n\t while(result = regex.exec(mask)) {\n\t let match = result.shift();\n\t let idx = result.findIndex(gr => gr != null);\n\t this.parts.push(idx in regexGroups\n\t ? regexGroups[idx]({ token: result[idx] || match, date: this.date, parts: this.parts, locales: this.locales })\n\t : result[idx] || match);\n\t }\n\n\t let parts = this.parts.reduce((arr, i) => {\n\t if (typeof i === 'string' && typeof arr[arr.length - 1] === 'string')\n\t arr[arr.length - 1] += i;\n\t else arr.push(i);\n\t return arr;\n\t }, []);\n\n\t this.parts.splice(0);\n\t this.parts.push(...parts);\n\t this.reset();\n\t }\n\n\t moveCursor(n) {\n\t this.typed = '';\n\t this.cursor = n;\n\t this.fire();\n\t }\n\n\t reset() {\n\t this.moveCursor(this.parts.findIndex(p => p instanceof DatePart));\n\t this.fire();\n\t this.render();\n\t }\n\n\t exit() {\n\t this.abort();\n\t }\n\n\t abort() {\n\t this.done = this.aborted = true;\n\t this.error = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t async validate() {\n\t let valid = await this.validator(this.value);\n\t if (typeof valid === 'string') {\n\t this.errorMsg = valid;\n\t valid = false;\n\t }\n\t this.error = !valid;\n\t }\n\n\t async submit() {\n\t await this.validate();\n\t if (this.error) {\n\t this.color = 'red';\n\t this.fire();\n\t this.render();\n\t return;\n\t }\n\t this.done = true;\n\t this.aborted = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t up() {\n\t this.typed = '';\n\t this.parts[this.cursor].up();\n\t this.render();\n\t }\n\n\t down() {\n\t this.typed = '';\n\t this.parts[this.cursor].down();\n\t this.render();\n\t }\n\n\t left() {\n\t let prev = this.parts[this.cursor].prev();\n\t if (prev == null) return this.bell();\n\t this.moveCursor(this.parts.indexOf(prev));\n\t this.render();\n\t }\n\n\t right() {\n\t let next = this.parts[this.cursor].next();\n\t if (next == null) return this.bell();\n\t this.moveCursor(this.parts.indexOf(next));\n\t this.render();\n\t }\n\n\t next() {\n\t let next = this.parts[this.cursor].next();\n\t this.moveCursor(next\n\t ? this.parts.indexOf(next)\n\t : this.parts.findIndex((part) => part instanceof DatePart));\n\t this.render();\n\t }\n\n\t _(c) {\n\t if (/\\d/.test(c)) {\n\t this.typed += c;\n\t this.parts[this.cursor].setTo(this.typed);\n\t this.render();\n\t }\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (this.firstRender) this.out.write(cursor.hide);\n\t else this.out.write(clear(this.outputText, this.out.columns));\n\t super.render();\n\n\t // Print prompt\n\t this.outputText = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(false),\n\t this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), [])\n\t .join('')\n\t ].join(' ');\n\n\t // Print error\n\t if (this.error) {\n\t this.outputText += this.errorMsg.split('\\n').reduce(\n\t (a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n\t }\n\n\t this.out.write(erase.line + cursor.to(0) + this.outputText);\n\t }\n\t}\n\n\tdate = DatePrompt;\n\treturn date;\n}\n\nvar number;\nvar hasRequiredNumber;\n\nfunction requireNumber () {\n\tif (hasRequiredNumber) return number;\n\thasRequiredNumber = 1;\n\tconst color = requireKleur();\n\tconst Prompt = requirePrompt();\n\tconst { cursor, erase } = requireSrc();\n\tconst { style, figures, clear, lines } = requireUtil();\n\n\tconst isNumber = /[0-9]/;\n\tconst isDef = any => any !== undefined;\n\tconst round = (number, precision) => {\n\t let factor = Math.pow(10, precision);\n\t return Math.round(number * factor) / factor;\n\t};\n\n\t/**\n\t * NumberPrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {String} [opts.style='default'] Render style\n\t * @param {Number} [opts.initial] Default value\n\t * @param {Number} [opts.max=+Infinity] Max value\n\t * @param {Number} [opts.min=-Infinity] Min value\n\t * @param {Boolean} [opts.float=false] Parse input as floats\n\t * @param {Number} [opts.round=2] Round floats to x decimals\n\t * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n\t * @param {Function} [opts.validate] Validate function\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t * @param {String} [opts.error] The invalid error label\n\t */\n\tclass NumberPrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.transform = style.render(opts.style);\n\t this.msg = opts.message;\n\t this.initial = isDef(opts.initial) ? opts.initial : '';\n\t this.float = !!opts.float;\n\t this.round = opts.round || 2;\n\t this.inc = opts.increment || 1;\n\t this.min = isDef(opts.min) ? opts.min : -Infinity;\n\t this.max = isDef(opts.max) ? opts.max : Infinity;\n\t this.errorMsg = opts.error || `Please Enter A Valid Value`;\n\t this.validator = opts.validate || (() => true);\n\t this.color = `cyan`;\n\t this.value = ``;\n\t this.typed = ``;\n\t this.lastHit = 0;\n\t this.render();\n\t }\n\n\t set value(v) {\n\t if (!v && v !== 0) {\n\t this.placeholder = true;\n\t this.rendered = color.gray(this.transform.render(`${this.initial}`));\n\t this._value = ``;\n\t } else {\n\t this.placeholder = false;\n\t this.rendered = this.transform.render(`${round(v, this.round)}`);\n\t this._value = round(v, this.round);\n\t }\n\t this.fire();\n\t }\n\n\t get value() {\n\t return this._value;\n\t }\n\n\t parse(x) {\n\t return this.float ? parseFloat(x) : parseInt(x);\n\t }\n\n\t valid(c) {\n\t return c === `-` || c === `.` && this.float || isNumber.test(c)\n\t }\n\n\t reset() {\n\t this.typed = ``;\n\t this.value = ``;\n\t this.fire();\n\t this.render();\n\t }\n\n\t exit() {\n\t this.abort();\n\t }\n\n\t abort() {\n\t let x = this.value;\n\t this.value = x !== `` ? x : this.initial;\n\t this.done = this.aborted = true;\n\t this.error = false;\n\t this.fire();\n\t this.render();\n\t this.out.write(`\\n`);\n\t this.close();\n\t }\n\n\t async validate() {\n\t let valid = await this.validator(this.value);\n\t if (typeof valid === `string`) {\n\t this.errorMsg = valid;\n\t valid = false;\n\t }\n\t this.error = !valid;\n\t }\n\n\t async submit() {\n\t await this.validate();\n\t if (this.error) {\n\t this.color = `red`;\n\t this.fire();\n\t this.render();\n\t return;\n\t }\n\t let x = this.value;\n\t this.value = x !== `` ? x : this.initial;\n\t this.done = true;\n\t this.aborted = false;\n\t this.error = false;\n\t this.fire();\n\t this.render();\n\t this.out.write(`\\n`);\n\t this.close();\n\t }\n\n\t up() {\n\t this.typed = ``;\n\t if(this.value === '') {\n\t this.value = this.min - this.inc;\n\t }\n\t if (this.value >= this.max) return this.bell();\n\t this.value += this.inc;\n\t this.color = `cyan`;\n\t this.fire();\n\t this.render();\n\t }\n\n\t down() {\n\t this.typed = ``;\n\t if(this.value === '') {\n\t this.value = this.min + this.inc;\n\t }\n\t if (this.value <= this.min) return this.bell();\n\t this.value -= this.inc;\n\t this.color = `cyan`;\n\t this.fire();\n\t this.render();\n\t }\n\n\t delete() {\n\t let val = this.value.toString();\n\t if (val.length === 0) return this.bell();\n\t this.value = this.parse((val = val.slice(0, -1))) || ``;\n\t if (this.value !== '' && this.value < this.min) {\n\t this.value = this.min;\n\t }\n\t this.color = `cyan`;\n\t this.fire();\n\t this.render();\n\t }\n\n\t next() {\n\t this.value = this.initial;\n\t this.fire();\n\t this.render();\n\t }\n\n\t _(c, key) {\n\t if (!this.valid(c)) return this.bell();\n\n\t const now = Date.now();\n\t if (now - this.lastHit > 1000) this.typed = ``; // 1s elapsed\n\t this.typed += c;\n\t this.lastHit = now;\n\t this.color = `cyan`;\n\n\t if (c === `.`) return this.fire();\n\n\t this.value = Math.min(this.parse(this.typed), this.max);\n\t if (this.value > this.max) this.value = this.max;\n\t if (this.value < this.min) this.value = this.min;\n\t this.fire();\n\t this.render();\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (!this.firstRender) {\n\t if (this.outputError)\n\t this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n\t this.out.write(clear(this.outputText, this.out.columns));\n\t }\n\t super.render();\n\t this.outputError = '';\n\n\t // Print prompt\n\t this.outputText = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(this.done),\n\t !this.done || (!this.done && !this.placeholder)\n\t ? color[this.color]().underline(this.rendered) : this.rendered\n\t ].join(` `);\n\n\t // Print error\n\t if (this.error) {\n\t this.outputError += this.errorMsg.split(`\\n`)\n\t .reduce((a, l, i) => a + `\\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n\t }\n\n\t this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore);\n\t }\n\t}\n\n\tnumber = NumberPrompt;\n\treturn number;\n}\n\nvar multiselect;\nvar hasRequiredMultiselect;\n\nfunction requireMultiselect () {\n\tif (hasRequiredMultiselect) return multiselect;\n\thasRequiredMultiselect = 1;\n\n\tconst color = requireKleur();\n\tconst { cursor } = requireSrc();\n\tconst Prompt = requirePrompt();\n\tconst { clear, figures, style, wrap, entriesToDisplay } = requireUtil();\n\n\t/**\n\t * MultiselectPrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {Array} opts.choices Array of choice objects\n\t * @param {String} [opts.hint] Hint to display\n\t * @param {String} [opts.warn] Hint shown for disabled choices\n\t * @param {Number} [opts.max] Max choices\n\t * @param {Number} [opts.cursor=0] Cursor start position\n\t * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t */\n\tclass MultiselectPrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.msg = opts.message;\n\t this.cursor = opts.cursor || 0;\n\t this.scrollIndex = opts.cursor || 0;\n\t this.hint = opts.hint || '';\n\t this.warn = opts.warn || '- This option is disabled -';\n\t this.minSelected = opts.min;\n\t this.showMinError = false;\n\t this.maxChoices = opts.max;\n\t this.instructions = opts.instructions;\n\t this.optionsPerPage = opts.optionsPerPage || 10;\n\t this.value = opts.choices.map((ch, idx) => {\n\t if (typeof ch === 'string')\n\t ch = {title: ch, value: idx};\n\t return {\n\t title: ch && (ch.title || ch.value || ch),\n\t description: ch && ch.description,\n\t value: ch && (ch.value === undefined ? idx : ch.value),\n\t selected: ch && ch.selected,\n\t disabled: ch && ch.disabled\n\t };\n\t });\n\t this.clear = clear('', this.out.columns);\n\t if (!opts.overrideRender) {\n\t this.render();\n\t }\n\t }\n\n\t reset() {\n\t this.value.map(v => !v.selected);\n\t this.cursor = 0;\n\t this.fire();\n\t this.render();\n\t }\n\n\t selected() {\n\t return this.value.filter(v => v.selected);\n\t }\n\n\t exit() {\n\t this.abort();\n\t }\n\n\t abort() {\n\t this.done = this.aborted = true;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t submit() {\n\t const selected = this.value\n\t .filter(e => e.selected);\n\t if (this.minSelected && selected.length < this.minSelected) {\n\t this.showMinError = true;\n\t this.render();\n\t } else {\n\t this.done = true;\n\t this.aborted = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\t }\n\n\t first() {\n\t this.cursor = 0;\n\t this.render();\n\t }\n\n\t last() {\n\t this.cursor = this.value.length - 1;\n\t this.render();\n\t }\n\t next() {\n\t this.cursor = (this.cursor + 1) % this.value.length;\n\t this.render();\n\t }\n\n\t up() {\n\t if (this.cursor === 0) {\n\t this.cursor = this.value.length - 1;\n\t } else {\n\t this.cursor--;\n\t }\n\t this.render();\n\t }\n\n\t down() {\n\t if (this.cursor === this.value.length - 1) {\n\t this.cursor = 0;\n\t } else {\n\t this.cursor++;\n\t }\n\t this.render();\n\t }\n\n\t left() {\n\t this.value[this.cursor].selected = false;\n\t this.render();\n\t }\n\n\t right() {\n\t if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n\t this.value[this.cursor].selected = true;\n\t this.render();\n\t }\n\n\t handleSpaceToggle() {\n\t const v = this.value[this.cursor];\n\n\t if (v.selected) {\n\t v.selected = false;\n\t this.render();\n\t } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n\t return this.bell();\n\t } else {\n\t v.selected = true;\n\t this.render();\n\t }\n\t }\n\n\t toggleAll() {\n\t if (this.maxChoices !== undefined || this.value[this.cursor].disabled) {\n\t return this.bell();\n\t }\n\n\t const newSelected = !this.value[this.cursor].selected;\n\t this.value.filter(v => !v.disabled).forEach(v => v.selected = newSelected);\n\t this.render();\n\t }\n\n\t _(c, key) {\n\t if (c === ' ') {\n\t this.handleSpaceToggle();\n\t } else if (c === 'a') {\n\t this.toggleAll();\n\t } else {\n\t return this.bell();\n\t }\n\t }\n\n\t renderInstructions() {\n\t if (this.instructions === undefined || this.instructions) {\n\t if (typeof this.instructions === 'string') {\n\t return this.instructions;\n\t }\n\t return '\\nInstructions:\\n'\n\t + ` ${figures.arrowUp}/${figures.arrowDown}: Highlight option\\n`\n\t + ` ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\\n`\n\t + (this.maxChoices === undefined ? ` a: Toggle all\\n` : '')\n\t + ` enter/return: Complete answer`;\n\t }\n\t return '';\n\t }\n\n\t renderOption(cursor, v, i, arrowIndicator) {\n\t const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + arrowIndicator + ' ';\n\t let title, desc;\n\n\t if (v.disabled) {\n\t title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n\t } else {\n\t title = cursor === i ? color.cyan().underline(v.title) : v.title;\n\t if (cursor === i && v.description) {\n\t desc = ` - ${v.description}`;\n\t if (prefix.length + title.length + desc.length >= this.out.columns\n\t || v.description.split(/\\r?\\n/).length > 1) {\n\t desc = '\\n' + wrap(v.description, { margin: prefix.length, width: this.out.columns });\n\t }\n\t }\n\t }\n\n\t return prefix + title + color.gray(desc || '');\n\t }\n\n\t // shared with autocompleteMultiselect\n\t paginateOptions(options) {\n\t if (options.length === 0) {\n\t return color.red('No matches for this query.');\n\t }\n\n\t let { startIndex, endIndex } = entriesToDisplay(this.cursor, options.length, this.optionsPerPage);\n\t let prefix, styledOptions = [];\n\n\t for (let i = startIndex; i < endIndex; i++) {\n\t if (i === startIndex && startIndex > 0) {\n\t prefix = figures.arrowUp;\n\t } else if (i === endIndex - 1 && endIndex < options.length) {\n\t prefix = figures.arrowDown;\n\t } else {\n\t prefix = ' ';\n\t }\n\t styledOptions.push(this.renderOption(this.cursor, options[i], i, prefix));\n\t }\n\n\t return '\\n' + styledOptions.join('\\n');\n\t }\n\n\t // shared with autocomleteMultiselect\n\t renderOptions(options) {\n\t if (!this.done) {\n\t return this.paginateOptions(options);\n\t }\n\t return '';\n\t }\n\n\t renderDoneOrInstructions() {\n\t if (this.done) {\n\t return this.value\n\t .filter(e => e.selected)\n\t .map(v => v.title)\n\t .join(', ');\n\t }\n\n\t const output = [color.gray(this.hint), this.renderInstructions()];\n\n\t if (this.value[this.cursor].disabled) {\n\t output.push(color.yellow(this.warn));\n\t }\n\t return output.join(' ');\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (this.firstRender) this.out.write(cursor.hide);\n\t super.render();\n\n\t // print prompt\n\t let prompt = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(false),\n\t this.renderDoneOrInstructions()\n\t ].join(' ');\n\t if (this.showMinError) {\n\t prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n\t this.showMinError = false;\n\t }\n\t prompt += this.renderOptions(this.value);\n\n\t this.out.write(this.clear + prompt);\n\t this.clear = clear(prompt, this.out.columns);\n\t }\n\t}\n\n\tmultiselect = MultiselectPrompt;\n\treturn multiselect;\n}\n\nvar autocomplete;\nvar hasRequiredAutocomplete;\n\nfunction requireAutocomplete () {\n\tif (hasRequiredAutocomplete) return autocomplete;\n\thasRequiredAutocomplete = 1;\n\n\tconst color = requireKleur();\n\tconst Prompt = requirePrompt();\n\tconst { erase, cursor } = requireSrc();\n\tconst { style, clear, figures, wrap, entriesToDisplay } = requireUtil();\n\n\tconst getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);\n\tconst getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);\n\tconst getIndex = (arr, valOrTitle) => {\n\t const index = arr.findIndex(el => el.value === valOrTitle || el.title === valOrTitle);\n\t return index > -1 ? index : undefined;\n\t};\n\n\t/**\n\t * TextPrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {Array} opts.choices Array of auto-complete choices objects\n\t * @param {Function} [opts.suggest] Filter function. Defaults to sort by title\n\t * @param {Number} [opts.limit=10] Max number of results to show\n\t * @param {Number} [opts.cursor=0] Cursor start position\n\t * @param {String} [opts.style='default'] Render style\n\t * @param {String} [opts.fallback] Fallback message - initial to default value\n\t * @param {String} [opts.initial] Index of the default value\n\t * @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t * @param {String} [opts.noMatches] The no matches found label\n\t */\n\tclass AutocompletePrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.msg = opts.message;\n\t this.suggest = opts.suggest;\n\t this.choices = opts.choices;\n\t this.initial = typeof opts.initial === 'number'\n\t ? opts.initial\n\t : getIndex(opts.choices, opts.initial);\n\t this.select = this.initial || opts.cursor || 0;\n\t this.i18n = { noMatches: opts.noMatches || 'no matches found' };\n\t this.fallback = opts.fallback || this.initial;\n\t this.clearFirst = opts.clearFirst || false;\n\t this.suggestions = [];\n\t this.input = '';\n\t this.limit = opts.limit || 10;\n\t this.cursor = 0;\n\t this.transform = style.render(opts.style);\n\t this.scale = this.transform.scale;\n\t this.render = this.render.bind(this);\n\t this.complete = this.complete.bind(this);\n\t this.clear = clear('', this.out.columns);\n\t this.complete(this.render);\n\t this.render();\n\t }\n\n\t set fallback(fb) {\n\t this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;\n\t }\n\n\t get fallback() {\n\t let choice;\n\t if (typeof this._fb === 'number')\n\t choice = this.choices[this._fb];\n\t else if (typeof this._fb === 'string')\n\t choice = { title: this._fb };\n\t return choice || this._fb || { title: this.i18n.noMatches };\n\t }\n\n\t moveSelect(i) {\n\t this.select = i;\n\t if (this.suggestions.length > 0)\n\t this.value = getVal(this.suggestions, i);\n\t else this.value = this.fallback.value;\n\t this.fire();\n\t }\n\n\t async complete(cb) {\n\t const p = (this.completing = this.suggest(this.input, this.choices));\n\t const suggestions = await p;\n\n\t if (this.completing !== p) return;\n\t this.suggestions = suggestions\n\t .map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description }));\n\t this.completing = false;\n\t const l = Math.max(suggestions.length - 1, 0);\n\t this.moveSelect(Math.min(l, this.select));\n\n\t cb && cb();\n\t }\n\n\t reset() {\n\t this.input = '';\n\t this.complete(() => {\n\t this.moveSelect(this.initial !== void 0 ? this.initial : 0);\n\t this.render();\n\t });\n\t this.render();\n\t }\n\n\t exit() {\n\t if (this.clearFirst && this.input.length > 0) {\n\t this.reset();\n\t } else {\n\t this.done = this.exited = true; \n\t this.aborted = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\t }\n\n\t abort() {\n\t this.done = this.aborted = true;\n\t this.exited = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t submit() {\n\t this.done = true;\n\t this.aborted = this.exited = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t _(c, key) {\n\t let s1 = this.input.slice(0, this.cursor);\n\t let s2 = this.input.slice(this.cursor);\n\t this.input = `${s1}${c}${s2}`;\n\t this.cursor = s1.length+1;\n\t this.complete(this.render);\n\t this.render();\n\t }\n\n\t delete() {\n\t if (this.cursor === 0) return this.bell();\n\t let s1 = this.input.slice(0, this.cursor-1);\n\t let s2 = this.input.slice(this.cursor);\n\t this.input = `${s1}${s2}`;\n\t this.complete(this.render);\n\t this.cursor = this.cursor-1;\n\t this.render();\n\t }\n\n\t deleteForward() {\n\t if(this.cursor*this.scale >= this.rendered.length) return this.bell();\n\t let s1 = this.input.slice(0, this.cursor);\n\t let s2 = this.input.slice(this.cursor+1);\n\t this.input = `${s1}${s2}`;\n\t this.complete(this.render);\n\t this.render();\n\t }\n\n\t first() {\n\t this.moveSelect(0);\n\t this.render();\n\t }\n\n\t last() {\n\t this.moveSelect(this.suggestions.length - 1);\n\t this.render();\n\t }\n\n\t up() {\n\t if (this.select === 0) {\n\t this.moveSelect(this.suggestions.length - 1);\n\t } else {\n\t this.moveSelect(this.select - 1);\n\t }\n\t this.render();\n\t }\n\n\t down() {\n\t if (this.select === this.suggestions.length - 1) {\n\t this.moveSelect(0);\n\t } else {\n\t this.moveSelect(this.select + 1);\n\t }\n\t this.render();\n\t }\n\n\t next() {\n\t if (this.select === this.suggestions.length - 1) {\n\t this.moveSelect(0);\n\t } else this.moveSelect(this.select + 1);\n\t this.render();\n\t }\n\n\t nextPage() {\n\t this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));\n\t this.render();\n\t }\n\n\t prevPage() {\n\t this.moveSelect(Math.max(this.select - this.limit, 0));\n\t this.render();\n\t }\n\n\t left() {\n\t if (this.cursor <= 0) return this.bell();\n\t this.cursor = this.cursor-1;\n\t this.render();\n\t }\n\n\t right() {\n\t if (this.cursor*this.scale >= this.rendered.length) return this.bell();\n\t this.cursor = this.cursor+1;\n\t this.render();\n\t }\n\n\t renderOption(v, hovered, isStart, isEnd) {\n\t let desc;\n\t let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : ' ';\n\t let title = hovered ? color.cyan().underline(v.title) : v.title;\n\t prefix = (hovered ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n\t if (v.description) {\n\t desc = ` - ${v.description}`;\n\t if (prefix.length + title.length + desc.length >= this.out.columns\n\t || v.description.split(/\\r?\\n/).length > 1) {\n\t desc = '\\n' + wrap(v.description, { margin: 3, width: this.out.columns });\n\t }\n\t }\n\t return prefix + ' ' + title + color.gray(desc || '');\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (this.firstRender) this.out.write(cursor.hide);\n\t else this.out.write(clear(this.outputText, this.out.columns));\n\t super.render();\n\n\t let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);\n\n\t this.outputText = [\n\t style.symbol(this.done, this.aborted, this.exited),\n\t color.bold(this.msg),\n\t style.delimiter(this.completing),\n\t this.done && this.suggestions[this.select]\n\t ? this.suggestions[this.select].title\n\t : this.rendered = this.transform.render(this.input)\n\t ].join(' ');\n\n\t if (!this.done) {\n\t const suggestions = this.suggestions\n\t .slice(startIndex, endIndex)\n\t .map((item, i) => this.renderOption(item,\n\t this.select === i + startIndex,\n\t i === 0 && startIndex > 0,\n\t i + startIndex === endIndex - 1 && endIndex < this.choices.length))\n\t .join('\\n');\n\t this.outputText += `\\n` + (suggestions || color.gray(this.fallback.title));\n\t }\n\n\t this.out.write(erase.line + cursor.to(0) + this.outputText);\n\t }\n\t}\n\n\tautocomplete = AutocompletePrompt;\n\treturn autocomplete;\n}\n\nvar autocompleteMultiselect;\nvar hasRequiredAutocompleteMultiselect;\n\nfunction requireAutocompleteMultiselect () {\n\tif (hasRequiredAutocompleteMultiselect) return autocompleteMultiselect;\n\thasRequiredAutocompleteMultiselect = 1;\n\n\tconst color = requireKleur();\n\tconst { cursor } = requireSrc();\n\tconst MultiselectPrompt = requireMultiselect();\n\tconst { clear, style, figures } = requireUtil();\n\t/**\n\t * MultiselectPrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {Array} opts.choices Array of choice objects\n\t * @param {String} [opts.hint] Hint to display\n\t * @param {String} [opts.warn] Hint shown for disabled choices\n\t * @param {Number} [opts.max] Max choices\n\t * @param {Number} [opts.cursor=0] Cursor start position\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t */\n\tclass AutocompleteMultiselectPrompt extends MultiselectPrompt {\n\t constructor(opts={}) {\n\t opts.overrideRender = true;\n\t super(opts);\n\t this.inputValue = '';\n\t this.clear = clear('', this.out.columns);\n\t this.filteredOptions = this.value;\n\t this.render();\n\t }\n\n\t last() {\n\t this.cursor = this.filteredOptions.length - 1;\n\t this.render();\n\t }\n\t next() {\n\t this.cursor = (this.cursor + 1) % this.filteredOptions.length;\n\t this.render();\n\t }\n\n\t up() {\n\t if (this.cursor === 0) {\n\t this.cursor = this.filteredOptions.length - 1;\n\t } else {\n\t this.cursor--;\n\t }\n\t this.render();\n\t }\n\n\t down() {\n\t if (this.cursor === this.filteredOptions.length - 1) {\n\t this.cursor = 0;\n\t } else {\n\t this.cursor++;\n\t }\n\t this.render();\n\t }\n\n\t left() {\n\t this.filteredOptions[this.cursor].selected = false;\n\t this.render();\n\t }\n\n\t right() {\n\t if (this.value.filter(e => e.selected).length >= this.maxChoices) return this.bell();\n\t this.filteredOptions[this.cursor].selected = true;\n\t this.render();\n\t }\n\n\t delete() {\n\t if (this.inputValue.length) {\n\t this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1);\n\t this.updateFilteredOptions();\n\t }\n\t }\n\n\t updateFilteredOptions() {\n\t const currentHighlight = this.filteredOptions[this.cursor];\n\t this.filteredOptions = this.value\n\t .filter(v => {\n\t if (this.inputValue) {\n\t if (typeof v.title === 'string') {\n\t if (v.title.toLowerCase().includes(this.inputValue.toLowerCase())) {\n\t return true;\n\t }\n\t }\n\t if (typeof v.value === 'string') {\n\t if (v.value.toLowerCase().includes(this.inputValue.toLowerCase())) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\t return true;\n\t });\n\t const newHighlightIndex = this.filteredOptions.findIndex(v => v === currentHighlight);\n\t this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex;\n\t this.render();\n\t }\n\n\t handleSpaceToggle() {\n\t const v = this.filteredOptions[this.cursor];\n\n\t if (v.selected) {\n\t v.selected = false;\n\t this.render();\n\t } else if (v.disabled || this.value.filter(e => e.selected).length >= this.maxChoices) {\n\t return this.bell();\n\t } else {\n\t v.selected = true;\n\t this.render();\n\t }\n\t }\n\n\t handleInputChange(c) {\n\t this.inputValue = this.inputValue + c;\n\t this.updateFilteredOptions();\n\t }\n\n\t _(c, key) {\n\t if (c === ' ') {\n\t this.handleSpaceToggle();\n\t } else {\n\t this.handleInputChange(c);\n\t }\n\t }\n\n\t renderInstructions() {\n\t if (this.instructions === undefined || this.instructions) {\n\t if (typeof this.instructions === 'string') {\n\t return this.instructions;\n\t }\n\t return `\nInstructions:\n ${figures.arrowUp}/${figures.arrowDown}: Highlight option\n ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`;\n\t }\n\t return '';\n\t }\n\n\t renderCurrentInput() {\n\t return `\nFiltered results for: ${this.inputValue ? this.inputValue : color.gray('Enter something to filter')}\\n`;\n\t }\n\n\t renderOption(cursor, v, i, arrowIndicator) {\n\t const prefix = (v.selected ? color.green(figures.radioOn) : figures.radioOff) + ' ' + arrowIndicator + ' ';\n\t let title;\n\t if (v.disabled) title = cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n\t else title = cursor === i ? color.cyan().underline(v.title) : v.title;\n\t return prefix + title;\n\t }\n\n\t renderDoneOrInstructions() {\n\t if (this.done) {\n\t return this.value\n\t .filter(e => e.selected)\n\t .map(v => v.title)\n\t .join(', ');\n\t }\n\n\t const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];\n\n\t if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {\n\t output.push(color.yellow(this.warn));\n\t }\n\t return output.join(' ');\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (this.firstRender) this.out.write(cursor.hide);\n\t super.render();\n\n\t // print prompt\n\n\t let prompt = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(false),\n\t this.renderDoneOrInstructions()\n\t ].join(' ');\n\n\t if (this.showMinError) {\n\t prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);\n\t this.showMinError = false;\n\t }\n\t prompt += this.renderOptions(this.filteredOptions);\n\n\t this.out.write(this.clear + prompt);\n\t this.clear = clear(prompt, this.out.columns);\n\t }\n\t}\n\n\tautocompleteMultiselect = AutocompleteMultiselectPrompt;\n\treturn autocompleteMultiselect;\n}\n\nvar confirm;\nvar hasRequiredConfirm;\n\nfunction requireConfirm () {\n\tif (hasRequiredConfirm) return confirm;\n\thasRequiredConfirm = 1;\n\tconst color = requireKleur();\n\tconst Prompt = requirePrompt();\n\tconst { style, clear } = requireUtil();\n\tconst { erase, cursor } = requireSrc();\n\n\t/**\n\t * ConfirmPrompt Base Element\n\t * @param {Object} opts Options\n\t * @param {String} opts.message Message\n\t * @param {Boolean} [opts.initial] Default value (true/false)\n\t * @param {Stream} [opts.stdin] The Readable stream to listen to\n\t * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n\t * @param {String} [opts.yes] The \"Yes\" label\n\t * @param {String} [opts.yesOption] The \"Yes\" option when choosing between yes/no\n\t * @param {String} [opts.no] The \"No\" label\n\t * @param {String} [opts.noOption] The \"No\" option when choosing between yes/no\n\t */\n\tclass ConfirmPrompt extends Prompt {\n\t constructor(opts={}) {\n\t super(opts);\n\t this.msg = opts.message;\n\t this.value = opts.initial;\n\t this.initialValue = !!opts.initial;\n\t this.yesMsg = opts.yes || 'yes';\n\t this.yesOption = opts.yesOption || '(Y/n)';\n\t this.noMsg = opts.no || 'no';\n\t this.noOption = opts.noOption || '(y/N)';\n\t this.render();\n\t }\n\n\t reset() {\n\t this.value = this.initialValue;\n\t this.fire();\n\t this.render();\n\t }\n\n\t exit() {\n\t this.abort();\n\t }\n\n\t abort() {\n\t this.done = this.aborted = true;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t submit() {\n\t this.value = this.value || false;\n\t this.done = true;\n\t this.aborted = false;\n\t this.fire();\n\t this.render();\n\t this.out.write('\\n');\n\t this.close();\n\t }\n\n\t _(c, key) {\n\t if (c.toLowerCase() === 'y') {\n\t this.value = true;\n\t return this.submit();\n\t }\n\t if (c.toLowerCase() === 'n') {\n\t this.value = false;\n\t return this.submit();\n\t }\n\t return this.bell();\n\t }\n\n\t render() {\n\t if (this.closed) return;\n\t if (this.firstRender) this.out.write(cursor.hide);\n\t else this.out.write(clear(this.outputText, this.out.columns));\n\t super.render();\n\n\t this.outputText = [\n\t style.symbol(this.done, this.aborted),\n\t color.bold(this.msg),\n\t style.delimiter(this.done),\n\t this.done ? (this.value ? this.yesMsg : this.noMsg)\n\t : color.gray(this.initialValue ? this.yesOption : this.noOption)\n\t ].join(' ');\n\n\t this.out.write(erase.line + cursor.to(0) + this.outputText);\n\t }\n\t}\n\n\tconfirm = ConfirmPrompt;\n\treturn confirm;\n}\n\nvar elements;\nvar hasRequiredElements;\n\nfunction requireElements () {\n\tif (hasRequiredElements) return elements;\n\thasRequiredElements = 1;\n\n\telements = {\n\t TextPrompt: requireText(),\n\t SelectPrompt: requireSelect(),\n\t TogglePrompt: requireToggle(),\n\t DatePrompt: requireDate(),\n\t NumberPrompt: requireNumber(),\n\t MultiselectPrompt: requireMultiselect(),\n\t AutocompletePrompt: requireAutocomplete(),\n\t AutocompleteMultiselectPrompt: requireAutocompleteMultiselect(),\n\t ConfirmPrompt: requireConfirm()\n\t};\n\treturn elements;\n}\n\nvar hasRequiredPrompts$1;\n\nfunction requirePrompts$1 () {\n\tif (hasRequiredPrompts$1) return prompts$2;\n\thasRequiredPrompts$1 = 1;\n\t(function (exports) {\n\t\tconst $ = exports;\n\t\tconst el = requireElements();\n\t\tconst noop = v => v;\n\n\t\tfunction toPrompt(type, args, opts={}) {\n\t\t return new Promise((res, rej) => {\n\t\t const p = new el[type](args);\n\t\t const onAbort = opts.onAbort || noop;\n\t\t const onSubmit = opts.onSubmit || noop;\n\t\t const onExit = opts.onExit || noop;\n\t\t p.on('state', args.onState || noop);\n\t\t p.on('submit', x => res(onSubmit(x)));\n\t\t p.on('exit', x => res(onExit(x)));\n\t\t p.on('abort', x => rej(onAbort(x)));\n\t\t });\n\t\t}\n\n\t\t/**\n\t\t * Text prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {string} [args.initial] Default string value\n\t\t * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {function} [args.validate] Function to validate user input\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.text = args => toPrompt('TextPrompt', args);\n\n\t\t/**\n\t\t * Password prompt with masked input\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {string} [args.initial] Default string value\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {function} [args.validate] Function to validate user input\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.password = args => {\n\t\t args.style = 'password';\n\t\t return $.text(args);\n\t\t};\n\n\t\t/**\n\t\t * Prompt where input is invisible, like sudo\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {string} [args.initial] Default string value\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {function} [args.validate] Function to validate user input\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.invisible = args => {\n\t\t args.style = 'invisible';\n\t\t return $.text(args);\n\t\t};\n\n\t\t/**\n\t\t * Number prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {number} args.initial Default number value\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {number} [args.max] Max value\n\t\t * @param {number} [args.min] Min value\n\t\t * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t\t * @param {Boolean} [opts.float=false] Parse input as floats\n\t\t * @param {Number} [opts.round=2] Round floats to x decimals\n\t\t * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n\t\t * @param {function} [args.validate] Function to validate user input\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.number = args => toPrompt('NumberPrompt', args);\n\n\t\t/**\n\t\t * Date prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {number} args.initial Default number value\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {number} [args.max] Max value\n\t\t * @param {number} [args.min] Min value\n\t\t * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t\t * @param {Boolean} [opts.float=false] Parse input as floats\n\t\t * @param {Number} [opts.round=2] Round floats to x decimals\n\t\t * @param {Number} [opts.increment=1] Number to increment by when using arrow-keys\n\t\t * @param {function} [args.validate] Function to validate user input\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.date = args => toPrompt('DatePrompt', args);\n\n\t\t/**\n\t\t * Classic yes/no prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {boolean} [args.initial=false] Default value\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.confirm = args => toPrompt('ConfirmPrompt', args);\n\n\t\t/**\n\t\t * List prompt, split intput string by `seperator`\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {string} [args.initial] Default string value\n\t\t * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t\t * @param {string} [args.separator] String separator\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input, in form of an `Array`\n\t\t */\n\t\t$.list = args => {\n\t\t const sep = args.separator || ',';\n\t\t return toPrompt('TextPrompt', args, {\n\t\t onSubmit: str => str.split(sep).map(s => s.trim())\n\t\t });\n\t\t};\n\n\t\t/**\n\t\t * Toggle/switch prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {boolean} [args.initial=false] Default value\n\t\t * @param {string} [args.active=\"on\"] Text for `active` state\n\t\t * @param {string} [args.inactive=\"off\"] Text for `inactive` state\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.toggle = args => toPrompt('TogglePrompt', args);\n\n\t\t/**\n\t\t * Interactive select prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {Array} args.choices Array of choices objects `[{ title, value }, ...]`\n\t\t * @param {number} [args.initial] Index of default value\n\t\t * @param {String} [args.hint] Hint to display\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.select = args => toPrompt('SelectPrompt', args);\n\n\t\t/**\n\t\t * Interactive multi-select / autocompleteMultiselect prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {Array} args.choices Array of choices objects `[{ title, value, [selected] }, ...]`\n\t\t * @param {number} [args.max] Max select\n\t\t * @param {string} [args.hint] Hint to display user\n\t\t * @param {Number} [args.cursor=0] Cursor start position\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.multiselect = args => {\n\t\t args.choices = [].concat(args.choices || []);\n\t\t const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n\t\t return toPrompt('MultiselectPrompt', args, {\n\t\t onAbort: toSelected,\n\t\t onSubmit: toSelected\n\t\t });\n\t\t};\n\n\t\t$.autocompleteMultiselect = args => {\n\t\t args.choices = [].concat(args.choices || []);\n\t\t const toSelected = items => items.filter(item => item.selected).map(item => item.value);\n\t\t return toPrompt('AutocompleteMultiselectPrompt', args, {\n\t\t onAbort: toSelected,\n\t\t onSubmit: toSelected\n\t\t });\n\t\t};\n\n\t\tconst byTitle = (input, choices) => Promise.resolve(\n\t\t choices.filter(item => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase())\n\t\t);\n\n\t\t/**\n\t\t * Interactive auto-complete prompt\n\t\t * @param {string} args.message Prompt message to display\n\t\t * @param {Array} args.choices Array of auto-complete choices objects `[{ title, value }, ...]`\n\t\t * @param {Function} [args.suggest] Function to filter results based on user input. Defaults to sort by `title`\n\t\t * @param {number} [args.limit=10] Max number of results to show\n\t\t * @param {string} [args.style=\"default\"] Render style ('default', 'password', 'invisible')\n\t\t * @param {String} [args.initial] Index of the default value\n\t\t * @param {boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input\n\t\t * @param {String} [args.fallback] Fallback message - defaults to initial value\n\t\t * @param {function} [args.onState] On state change callback\n\t\t * @param {Stream} [args.stdin] The Readable stream to listen to\n\t\t * @param {Stream} [args.stdout] The Writable stream to write readline data to\n\t\t * @returns {Promise} Promise with user input\n\t\t */\n\t\t$.autocomplete = args => {\n\t\t args.suggest = args.suggest || byTitle;\n\t\t args.choices = [].concat(args.choices || []);\n\t\t return toPrompt('AutocompletePrompt', args);\n\t\t}; \n\t} (prompts$2));\n\treturn prompts$2;\n}\n\nvar lib$1;\nvar hasRequiredLib$1;\n\nfunction requireLib$1 () {\n\tif (hasRequiredLib$1) return lib$1;\n\thasRequiredLib$1 = 1;\n\n\tconst prompts = requirePrompts$1();\n\n\tconst passOn = ['suggest', 'format', 'onState', 'validate', 'onRender', 'type'];\n\tconst noop = () => {};\n\n\t/**\n\t * Prompt for a series of questions\n\t * @param {Array|Object} questions Single question object or Array of question objects\n\t * @param {Function} [onSubmit] Callback function called on prompt submit\n\t * @param {Function} [onCancel] Callback function called on cancel/abort\n\t * @returns {Object} Object with values from user input\n\t */\n\tasync function prompt(questions=[], { onSubmit=noop, onCancel=noop }={}) {\n\t const answers = {};\n\t const override = prompt._override || {};\n\t questions = [].concat(questions);\n\t let answer, question, quit, name, type, lastPrompt;\n\n\t const getFormattedAnswer = async (question, answer, skipValidation = false) => {\n\t if (!skipValidation && question.validate && question.validate(answer) !== true) {\n\t return;\n\t }\n\t return question.format ? await question.format(answer, answers) : answer\n\t };\n\n\t for (question of questions) {\n\t ({ name, type } = question);\n\n\t // evaluate type first and skip if type is a falsy value\n\t if (typeof type === 'function') {\n\t type = await type(answer, { ...answers }, question);\n\t question['type'] = type;\n\t }\n\t if (!type) continue;\n\n\t // if property is a function, invoke it unless it's a special function\n\t for (let key in question) {\n\t if (passOn.includes(key)) continue;\n\t let value = question[key];\n\t question[key] = typeof value === 'function' ? await value(answer, { ...answers }, lastPrompt) : value;\n\t }\n\n\t lastPrompt = question;\n\n\t if (typeof question.message !== 'string') {\n\t throw new Error('prompt message is required');\n\t }\n\n\t // update vars in case they changed\n\t ({ name, type } = question);\n\n\t if (prompts[type] === void 0) {\n\t throw new Error(`prompt type (${type}) is not defined`);\n\t }\n\n\t if (override[question.name] !== undefined) {\n\t answer = await getFormattedAnswer(question, override[question.name]);\n\t if (answer !== undefined) {\n\t answers[name] = answer;\n\t continue;\n\t }\n\t }\n\n\t try {\n\t // Get the injected answer if there is one or prompt the user\n\t answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question);\n\t answers[name] = answer = await getFormattedAnswer(question, answer, true);\n\t quit = await onSubmit(question, answer, answers);\n\t } catch (err) {\n\t quit = !(await onCancel(question, answers));\n\t }\n\n\t if (quit) return answers;\n\t }\n\n\t return answers;\n\t}\n\n\tfunction getInjectedAnswer(injected, deafultValue) {\n\t const answer = injected.shift();\n\t if (answer instanceof Error) {\n\t throw answer;\n\t }\n\n\t return (answer === undefined) ? deafultValue : answer;\n\t}\n\n\tfunction inject(answers) {\n\t prompt._injected = (prompt._injected || []).concat(answers);\n\t}\n\n\tfunction override(answers) {\n\t prompt._override = Object.assign({}, answers);\n\t}\n\n\tlib$1 = Object.assign(prompt, { prompt, prompts, inject, override });\n\treturn lib$1;\n}\n\nvar prompts$1;\nvar hasRequiredPrompts;\n\nfunction requirePrompts () {\n\tif (hasRequiredPrompts) return prompts$1;\n\thasRequiredPrompts = 1;\n\tprompts$1 = requireLib$1();\n\treturn prompts$1;\n}\n\nvar promptsExports = requirePrompts();\nconst prompts = /*@__PURE__*/getDefaultExportFromCjs(promptsExports);\n\n/* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */\n\nconst isBrowser = globalThis.window?.document !== undefined;\n\nglobalThis.process?.versions?.node !== undefined;\n\nglobalThis.process?.versions?.bun !== undefined;\n\nglobalThis.Deno?.version?.deno !== undefined;\n\nglobalThis.process?.versions?.electron !== undefined;\n\nglobalThis.navigator?.userAgent?.includes('jsdom') === true;\n\ntypeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;\n\ntypeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;\n\ntypeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;\n\ntypeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;\n\n// Note: I'm intentionally not DRYing up the other variables to keep them \"lazy\".\nconst platform = globalThis.navigator?.userAgentData?.platform;\n\nplatform === 'macOS'\n\t|| globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.\n\t|| globalThis.navigator?.userAgent?.includes(' Mac ') === true\n\t|| globalThis.process?.platform === 'darwin';\n\nplatform === 'Windows'\n\t|| globalThis.navigator?.platform === 'Win32'\n\t|| globalThis.process?.platform === 'win32';\n\nplatform === 'Linux'\n\t|| globalThis.navigator?.platform?.startsWith('Linux') === true\n\t|| globalThis.navigator?.userAgent?.includes(' Linux ') === true\n\t|| globalThis.process?.platform === 'linux';\n\nplatform === 'Android'\n\t|| globalThis.navigator?.platform === 'Android'\n\t|| globalThis.navigator?.userAgent?.includes(' Android ') === true\n\t|| globalThis.process?.platform === 'android';\n\nconst OSC = '\\u001B]';\nconst BEL = '\\u0007';\nconst SEP = ';';\n\n!isBrowser && process$1.env.TERM_PROGRAM === 'Apple_Terminal';\n!isBrowser && process$1.platform === 'win32';\n\nisBrowser ? () => {\n\tthrow new Error('`process.cwd()` only works in Node.js, not the browser.');\n} : process$1.cwd;\n\nconst link = (text, url) => [\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\turl,\n\tBEL,\n\ttext,\n\tOSC,\n\t'8',\n\tSEP,\n\tSEP,\n\tBEL,\n].join('');\n\nvar hasFlag;\nvar hasRequiredHasFlag;\n\nfunction requireHasFlag () {\n\tif (hasRequiredHasFlag) return hasFlag;\n\thasRequiredHasFlag = 1;\n\n\thasFlag = (flag, argv = process.argv) => {\n\t\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\t\tconst position = argv.indexOf(prefix + flag);\n\t\tconst terminatorPosition = argv.indexOf('--');\n\t\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n\t};\n\treturn hasFlag;\n}\n\nvar supportsColor_1;\nvar hasRequiredSupportsColor;\n\nfunction requireSupportsColor () {\n\tif (hasRequiredSupportsColor) return supportsColor_1;\n\thasRequiredSupportsColor = 1;\n\tconst os = require$$0$1;\n\tconst tty = require$$1;\n\tconst hasFlag = requireHasFlag();\n\n\tconst {env} = process;\n\n\tlet forceColor;\n\tif (hasFlag('no-color') ||\n\t\thasFlag('no-colors') ||\n\t\thasFlag('color=false') ||\n\t\thasFlag('color=never')) {\n\t\tforceColor = 0;\n\t} else if (hasFlag('color') ||\n\t\thasFlag('colors') ||\n\t\thasFlag('color=true') ||\n\t\thasFlag('color=always')) {\n\t\tforceColor = 1;\n\t}\n\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\tforceColor = 1;\n\t\t} else if (env.FORCE_COLOR === 'false') {\n\t\t\tforceColor = 0;\n\t\t} else {\n\t\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t\t}\n\t}\n\n\tfunction translateLevel(level) {\n\t\tif (level === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn {\n\t\t\tlevel,\n\t\t\thasBasic: true,\n\t\t\thas256: level >= 2,\n\t\t\thas16m: level >= 3\n\t\t};\n\t}\n\n\tfunction supportsColor(haveStream, streamIsTTY) {\n\t\tif (forceColor === 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (hasFlag('color=16m') ||\n\t\t\thasFlag('color=full') ||\n\t\t\thasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\n\t\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst min = forceColor || 0;\n\n\t\tif (env.TERM === 'dumb') {\n\t\t\treturn min;\n\t\t}\n\n\t\tif (process.platform === 'win32') {\n\t\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\t\tconst osRelease = os.release().split('.');\n\t\t\tif (\n\t\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\t\tNumber(osRelease[2]) >= 10586\n\t\t\t) {\n\t\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t\t}\n\n\t\t\treturn 1;\n\t\t}\n\n\t\tif ('CI' in env) {\n\t\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\treturn min;\n\t\t}\n\n\t\tif ('TEAMCITY_VERSION' in env) {\n\t\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t\t}\n\n\t\tif (env.COLORTERM === 'truecolor') {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif ('TERM_PROGRAM' in env) {\n\t\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\t\tswitch (env.TERM_PROGRAM) {\n\t\t\t\tcase 'iTerm.app':\n\t\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t\tcase 'Apple_Terminal':\n\t\t\t\t\treturn 2;\n\t\t\t\t// No default\n\t\t\t}\n\t\t}\n\n\t\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\t\treturn 2;\n\t\t}\n\n\t\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif ('COLORTERM' in env) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tfunction getSupportLevel(stream) {\n\t\tconst level = supportsColor(stream, stream && stream.isTTY);\n\t\treturn translateLevel(level);\n\t}\n\n\tsupportsColor_1 = {\n\t\tsupportsColor: getSupportLevel,\n\t\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\t\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n\t};\n\treturn supportsColor_1;\n}\n\nvar supportsHyperlinks$1;\nvar hasRequiredSupportsHyperlinks;\n\nfunction requireSupportsHyperlinks () {\n\tif (hasRequiredSupportsHyperlinks) return supportsHyperlinks$1;\n\thasRequiredSupportsHyperlinks = 1;\n\tconst supportsColor = requireSupportsColor();\n\tconst hasFlag = requireHasFlag();\n\n\t/**\n\t@param {string} versionString\n\t@returns {{ major: number, minor: number, patch: number }}\n\t*/\n\tfunction parseVersion(versionString) {\n\t\tif (/^\\d{3,4}$/.test(versionString)) {\n\t\t\t// Env var doesn't always use dots. example: 4601 => 46.1.0\n\t\t\tconst m = /(\\d{1,2})(\\d{2})/.exec(versionString) || [];\n\t\t\treturn {\n\t\t\t\tmajor: 0,\n\t\t\t\tminor: parseInt(m[1], 10),\n\t\t\t\tpatch: parseInt(m[2], 10)\n\t\t\t};\n\t\t}\n\n\t\tconst versions = (versionString || '').split('.').map(n => parseInt(n, 10));\n\t\treturn {\n\t\t\tmajor: versions[0],\n\t\t\tminor: versions[1],\n\t\t\tpatch: versions[2]\n\t\t};\n\t}\n\n\t/**\n\t@param {{ isTTY?: boolean | undefined }} stream\n\t@returns {boolean}\n\t*/\n\t// eslint-disable-next-line complexity\n\tfunction supportsHyperlink(stream) {\n\t\tconst {\n\t\t\tCI,\n\t\t\tFORCE_HYPERLINK,\n\t\t\tNETLIFY,\n\t\t\tTEAMCITY_VERSION,\n\t\t\tTERM_PROGRAM,\n\t\t\tTERM_PROGRAM_VERSION,\n\t\t\tVTE_VERSION,\n\t\t\tTERM,\n\t\t} = process.env;\n\n\t\tif (FORCE_HYPERLINK) {\n\t\t\treturn !(FORCE_HYPERLINK.length > 0 && parseInt(FORCE_HYPERLINK, 10) === 0);\n\t\t}\n\n\t\tif (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Netlify does not run a TTY, it does not need `supportsColor` check\n\t\tif (NETLIFY) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If they specify no colors, they probably don't want hyperlinks.\n\t\tif (!supportsColor.supportsColor(stream)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (stream && !stream.isTTY) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Windows Terminal\n\t\tif ('WT_SESSION' in process.env) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (process.platform === 'win32') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (CI) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (TEAMCITY_VERSION) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (TERM_PROGRAM) {\n\t\t\tconst version = parseVersion(TERM_PROGRAM_VERSION || '');\n\n\t\t\tswitch (TERM_PROGRAM) {\n\t\t\t\tcase 'iTerm.app':\n\t\t\t\t\tif (version.major === 3) {\n\t\t\t\t\t\treturn version.minor >= 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn version.major > 3;\n\t\t\t\tcase 'WezTerm':\n\t\t\t\t\treturn version.major >= 20200620;\n\t\t\t\tcase 'vscode':\n\t\t\t\t\t// eslint-disable-next-line no-mixed-operators\n\t\t\t\t\treturn version.major > 1 || version.major === 1 && version.minor >= 72;\n\t\t\t\tcase 'ghostty':\n\t\t\t\t\treturn true;\n\t\t\t\t// No default\n\t\t\t}\n\t\t}\n\n\t\tif (VTE_VERSION) {\n\t\t\t// 0.50.0 was supposed to support hyperlinks, but throws a segfault\n\t\t\tif (VTE_VERSION === '0.50.0') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst version = parseVersion(VTE_VERSION);\n\t\t\treturn version.major > 0 || version.minor >= 50;\n\t\t}\n\n\t\tswitch (TERM) {\n\t\t\tcase 'alacritty':\n\t\t\t\t// Support added in v0.11 (2022-10-13)\n\t\t\t\treturn true;\n\t\t\t// No default\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tsupportsHyperlinks$1 = {\n\t\tsupportsHyperlink,\n\t\tstdout: supportsHyperlink(process.stdout),\n\t\tstderr: supportsHyperlink(process.stderr)\n\t};\n\treturn supportsHyperlinks$1;\n}\n\nvar supportsHyperlinksExports = /*@__PURE__*/ requireSupportsHyperlinks();\nconst supportsHyperlinks = /*@__PURE__*/getDefaultExportFromCjs(supportsHyperlinksExports);\n\nfunction terminalLink(text, url, {target = 'stdout', ...options} = {}) {\n\tif (!supportsHyperlinks[target]) {\n\t\t// If the fallback has been explicitly disabled, don't modify the text itself.\n\t\tif (options.fallback === false) {\n\t\t\treturn text;\n\t\t}\n\n\t\treturn typeof options.fallback === 'function' ? options.fallback(text, url) : `${text} (\\u200B${url}\\u200B)`;\n\t}\n\n\treturn link(text, url);\n}\n\nterminalLink.isSupported = supportsHyperlinks.stdout;\nterminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, {target: 'stderr', ...options});\nterminalLink.stderr.isSupported = supportsHyperlinks.stderr;\n\nvar cjs = {};\n\nvar posix = {};\n\nvar hasRequiredPosix;\n\nfunction requirePosix () {\n\tif (hasRequiredPosix) return posix;\n\thasRequiredPosix = 1;\n\t/**\n\t * This is the Posix implementation of isexe, which uses the file\n\t * mode and uid/gid values.\n\t *\n\t * @module\n\t */\n\tObject.defineProperty(posix, \"__esModule\", { value: true });\n\tposix.sync = posix.isexe = void 0;\n\tconst fs_1 = require$$0$2;\n\tconst promises_1 = require$$1$1;\n\t/**\n\t * Determine whether a path is executable according to the mode and\n\t * current (or specified) user and group IDs.\n\t */\n\tconst isexe = async (path, options = {}) => {\n\t const { ignoreErrors = false } = options;\n\t try {\n\t return checkStat(await (0, promises_1.stat)(path), options);\n\t }\n\t catch (e) {\n\t const er = e;\n\t if (ignoreErrors || er.code === 'EACCES')\n\t return false;\n\t throw er;\n\t }\n\t};\n\tposix.isexe = isexe;\n\t/**\n\t * Synchronously determine whether a path is executable according to\n\t * the mode and current (or specified) user and group IDs.\n\t */\n\tconst sync = (path, options = {}) => {\n\t const { ignoreErrors = false } = options;\n\t try {\n\t return checkStat((0, fs_1.statSync)(path), options);\n\t }\n\t catch (e) {\n\t const er = e;\n\t if (ignoreErrors || er.code === 'EACCES')\n\t return false;\n\t throw er;\n\t }\n\t};\n\tposix.sync = sync;\n\tconst checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);\n\tconst checkMode = (stat, options) => {\n\t const myUid = options.uid ?? process.getuid?.();\n\t const myGroups = options.groups ?? process.getgroups?.() ?? [];\n\t const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];\n\t if (myUid === undefined || myGid === undefined) {\n\t throw new Error('cannot get uid or gid');\n\t }\n\t const groups = new Set([myGid, ...myGroups]);\n\t const mod = stat.mode;\n\t const uid = stat.uid;\n\t const gid = stat.gid;\n\t const u = parseInt('100', 8);\n\t const g = parseInt('010', 8);\n\t const o = parseInt('001', 8);\n\t const ug = u | g;\n\t return !!(mod & o ||\n\t (mod & g && groups.has(gid)) ||\n\t (mod & u && uid === myUid) ||\n\t (mod & ug && myUid === 0));\n\t};\n\t\n\treturn posix;\n}\n\nvar win32 = {};\n\nvar hasRequiredWin32;\n\nfunction requireWin32 () {\n\tif (hasRequiredWin32) return win32;\n\thasRequiredWin32 = 1;\n\t/**\n\t * This is the Windows implementation of isexe, which uses the file\n\t * extension and PATHEXT setting.\n\t *\n\t * @module\n\t */\n\tObject.defineProperty(win32, \"__esModule\", { value: true });\n\twin32.sync = win32.isexe = void 0;\n\tconst fs_1 = require$$0$2;\n\tconst promises_1 = require$$1$1;\n\t/**\n\t * Determine whether a path is executable based on the file extension\n\t * and PATHEXT environment variable (or specified pathExt option)\n\t */\n\tconst isexe = async (path, options = {}) => {\n\t const { ignoreErrors = false } = options;\n\t try {\n\t return checkStat(await (0, promises_1.stat)(path), path, options);\n\t }\n\t catch (e) {\n\t const er = e;\n\t if (ignoreErrors || er.code === 'EACCES')\n\t return false;\n\t throw er;\n\t }\n\t};\n\twin32.isexe = isexe;\n\t/**\n\t * Synchronously determine whether a path is executable based on the file\n\t * extension and PATHEXT environment variable (or specified pathExt option)\n\t */\n\tconst sync = (path, options = {}) => {\n\t const { ignoreErrors = false } = options;\n\t try {\n\t return checkStat((0, fs_1.statSync)(path), path, options);\n\t }\n\t catch (e) {\n\t const er = e;\n\t if (ignoreErrors || er.code === 'EACCES')\n\t return false;\n\t throw er;\n\t }\n\t};\n\twin32.sync = sync;\n\tconst checkPathExt = (path, options) => {\n\t const { pathExt = process.env.PATHEXT || '' } = options;\n\t const peSplit = pathExt.split(';');\n\t if (peSplit.indexOf('') !== -1) {\n\t return true;\n\t }\n\t for (let i = 0; i < peSplit.length; i++) {\n\t const p = peSplit[i].toLowerCase();\n\t const ext = path.substring(path.length - p.length).toLowerCase();\n\t if (p && ext === p) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t};\n\tconst checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);\n\t\n\treturn win32;\n}\n\nvar options = {};\n\nvar hasRequiredOptions;\n\nfunction requireOptions () {\n\tif (hasRequiredOptions) return options;\n\thasRequiredOptions = 1;\n\tObject.defineProperty(options, \"__esModule\", { value: true });\n\t\n\treturn options;\n}\n\nvar hasRequiredCjs;\n\nfunction requireCjs () {\n\tif (hasRequiredCjs) return cjs;\n\thasRequiredCjs = 1;\n\t(function (exports) {\n\t\tvar __createBinding = (cjs && cjs.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n\t\t if (k2 === undefined) k2 = k;\n\t\t var desc = Object.getOwnPropertyDescriptor(m, k);\n\t\t if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n\t\t desc = { enumerable: true, get: function() { return m[k]; } };\n\t\t }\n\t\t Object.defineProperty(o, k2, desc);\n\t\t}) : (function(o, m, k, k2) {\n\t\t if (k2 === undefined) k2 = k;\n\t\t o[k2] = m[k];\n\t\t}));\n\t\tvar __setModuleDefault = (cjs && cjs.__setModuleDefault) || (Object.create ? (function(o, v) {\n\t\t Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n\t\t}) : function(o, v) {\n\t\t o[\"default\"] = v;\n\t\t});\n\t\tvar __importStar = (cjs && cjs.__importStar) || function (mod) {\n\t\t if (mod && mod.__esModule) return mod;\n\t\t var result = {};\n\t\t if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\t\t __setModuleDefault(result, mod);\n\t\t return result;\n\t\t};\n\t\tvar __exportStar = (cjs && cjs.__exportStar) || function(m, exports) {\n\t\t for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n\t\t};\n\t\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\t\texports.sync = exports.isexe = exports.posix = exports.win32 = void 0;\n\t\tconst posix = __importStar(requirePosix());\n\t\texports.posix = posix;\n\t\tconst win32 = __importStar(requireWin32());\n\t\texports.win32 = win32;\n\t\t__exportStar(requireOptions(), exports);\n\t\tconst platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;\n\t\tconst impl = platform === 'win32' ? win32 : posix;\n\t\t/**\n\t\t * Determine whether a path is executable on the current platform.\n\t\t */\n\t\texports.isexe = impl.isexe;\n\t\t/**\n\t\t * Synchronously determine whether a path is executable on the\n\t\t * current platform.\n\t\t */\n\t\texports.sync = impl.sync;\n\t\t\n\t} (cjs));\n\treturn cjs;\n}\n\nvar lib;\nvar hasRequiredLib;\n\nfunction requireLib () {\n\tif (hasRequiredLib) return lib;\n\thasRequiredLib = 1;\n\tconst { isexe, sync: isexeSync } = requireCjs();\n\tconst { join, delimiter, sep, posix } = require$$1$2;\n\n\tconst isWindows = process.platform === 'win32';\n\n\t// used to check for slashed in commands passed in. always checks for the posix\n\t// seperator on all platforms, and checks for the current separator when not on\n\t// a posix platform. don't use the isWindows check for this since that is mocked\n\t// in tests but we still need the code to actually work when called. that is also\n\t// why it is ignored from coverage.\n\t/* istanbul ignore next */\n\tconst rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\\\)/g, '\\\\$1'));\n\tconst rRel = new RegExp(`^\\\\.${rSlash.source}`);\n\n\tconst getNotFoundError = (cmd) =>\n\t Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' });\n\n\tconst getPathInfo = (cmd, {\n\t path: optPath = process.env.PATH,\n\t pathExt: optPathExt = process.env.PATHEXT,\n\t delimiter: optDelimiter = delimiter,\n\t}) => {\n\t // If it has a slash, then we don't bother searching the pathenv.\n\t // just check the file itself, and that's it.\n\t const pathEnv = cmd.match(rSlash) ? [''] : [\n\t // windows always checks the cwd first\n\t ...(isWindows ? [process.cwd()] : []),\n\t ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter),\n\t ];\n\n\t if (isWindows) {\n\t const pathExtExe = optPathExt ||\n\t ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter);\n\t const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);\n\t if (cmd.includes('.') && pathExt[0] !== '') {\n\t pathExt.unshift('');\n\t }\n\t return { pathEnv, pathExt, pathExtExe }\n\t }\n\n\t return { pathEnv, pathExt: [''] }\n\t};\n\n\tconst getPathPart = (raw, cmd) => {\n\t const pathPart = /^\".*\"$/.test(raw) ? raw.slice(1, -1) : raw;\n\t const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : '';\n\t return prefix + join(pathPart, cmd)\n\t};\n\n\tconst which = async (cmd, opt = {}) => {\n\t const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);\n\t const found = [];\n\n\t for (const envPart of pathEnv) {\n\t const p = getPathPart(envPart, cmd);\n\n\t for (const ext of pathExt) {\n\t const withExt = p + ext;\n\t const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });\n\t if (is) {\n\t if (!opt.all) {\n\t return withExt\n\t }\n\t found.push(withExt);\n\t }\n\t }\n\t }\n\n\t if (opt.all && found.length) {\n\t return found\n\t }\n\n\t if (opt.nothrow) {\n\t return null\n\t }\n\n\t throw getNotFoundError(cmd)\n\t};\n\n\tconst whichSync = (cmd, opt = {}) => {\n\t const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);\n\t const found = [];\n\n\t for (const pathEnvPart of pathEnv) {\n\t const p = getPathPart(pathEnvPart, cmd);\n\n\t for (const ext of pathExt) {\n\t const withExt = p + ext;\n\t const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true });\n\t if (is) {\n\t if (!opt.all) {\n\t return withExt\n\t }\n\t found.push(withExt);\n\t }\n\t }\n\t }\n\n\t if (opt.all && found.length) {\n\t return found\n\t }\n\n\t if (opt.nothrow) {\n\t return null\n\t }\n\n\t throw getNotFoundError(cmd)\n\t};\n\n\tlib = which;\n\twhich.sync = whichSync;\n\treturn lib;\n}\n\nvar libExports = requireLib();\nconst which = /*@__PURE__*/getDefaultExportFromCjs(libExports);\n\nconst CLI_TEMP_DIR = join(os.tmpdir(), \"antfu-ni\");\nfunction remove(arr, v) {\n const index = arr.indexOf(v);\n if (index >= 0)\n arr.splice(index, 1);\n return arr;\n}\nfunction exclude(arr, ...v) {\n return arr.slice().filter((item) => !v.includes(item));\n}\nfunction cmdExists(cmd) {\n return which.sync(cmd, { nothrow: true }) !== null;\n}\nlet counter = 0;\nasync function openTemp() {\n if (!existsSync(CLI_TEMP_DIR))\n await promises.mkdir(CLI_TEMP_DIR, { recursive: true });\n const competitivePath = join(CLI_TEMP_DIR, `.${process$1.pid}.${counter}`);\n counter += 1;\n return promises.open(competitivePath, \"wx\").then((fd) => ({\n fd,\n path: competitivePath,\n cleanup() {\n fd.close().then(() => {\n if (existsSync(competitivePath))\n promises.unlink(competitivePath);\n });\n }\n })).catch((error) => {\n if (error && error.code === \"EEXIST\")\n return openTemp();\n else\n return void 0;\n });\n}\nasync function writeFileSafe(path, data = \"\") {\n const temp = await openTemp();\n if (temp) {\n promises.writeFile(temp.path, data).then(() => {\n const directory = dirname(path);\n if (!existsSync(directory))\n promises.mkdir(directory, { recursive: true });\n return promises.rename(temp.path, path).then(() => true).catch(() => false);\n }).catch(() => false).finally(temp.cleanup);\n }\n return false;\n}\nfunction limitText(text, maxWidth) {\n if (text.length <= maxWidth)\n return text;\n return `${text.slice(0, maxWidth)}${c.dim(\"\\u2026\")}`;\n}\nfunction formatPackageWithUrl(pkg, url, limits = 80) {\n return url ? terminalLink(\n pkg,\n url,\n {\n fallback: (_, url2) => pkg.length + url2.length > limits ? pkg : pkg + c.dim` - ${url2}`\n }\n ) : pkg;\n}\n\nasync function detect({ autoInstall, programmatic, cwd } = {}) {\n const {\n name,\n agent,\n version\n } = await detect$1({\n cwd,\n onUnknown: (packageManager) => {\n if (!programmatic) {\n console.warn(\"[ni] Unknown packageManager:\", packageManager);\n }\n return void 0;\n }\n }) || {};\n if (name && !cmdExists(name) && !programmatic) {\n if (!autoInstall) {\n console.warn(`[ni] Detected ${name} but it doesn't seem to be installed.\n`);\n if (process$1.env.CI)\n process$1.exit(1);\n const link = terminalLink(name, INSTALL_PAGE[name]);\n const { tryInstall } = await prompts({\n name: \"tryInstall\",\n type: \"confirm\",\n message: `Would you like to globally install ${link}?`\n });\n if (!tryInstall)\n process$1.exit(1);\n }\n await x(\n \"npm\",\n [\"i\", \"-g\", `${name}${version ? `@${version}` : \"\"}`],\n {\n nodeOptions: {\n stdio: \"inherit\",\n cwd\n },\n throwOnError: true\n }\n );\n }\n return agent;\n}\n\nconst customRcPath = process$1.env.NI_CONFIG_FILE;\nconst home = process$1.platform === \"win32\" ? process$1.env.USERPROFILE : process$1.env.HOME;\nconst defaultRcPath = path.join(home || \"~/\", \".nirc\");\nconst rcPath = customRcPath || defaultRcPath;\nconst defaultConfig = {\n defaultAgent: \"prompt\",\n globalAgent: \"npm\"\n};\nlet config;\nasync function getConfig() {\n if (!config) {\n config = Object.assign(\n {},\n defaultConfig,\n fs.existsSync(rcPath) ? ini.parse(fs.readFileSync(rcPath, \"utf-8\")) : null\n );\n if (process$1.env.NI_DEFAULT_AGENT)\n config.defaultAgent = process$1.env.NI_DEFAULT_AGENT;\n if (process$1.env.NI_GLOBAL_AGENT)\n config.globalAgent = process$1.env.NI_GLOBAL_AGENT;\n const agent = await detect({ programmatic: true });\n if (agent)\n config.defaultAgent = agent;\n }\n return config;\n}\nasync function getDefaultAgent(programmatic) {\n const { defaultAgent } = await getConfig();\n if (defaultAgent === \"prompt\" && (programmatic || process$1.env.CI))\n return \"npm\";\n return defaultAgent;\n}\nasync function getGlobalAgent() {\n const { globalAgent } = await getConfig();\n return globalAgent;\n}\n\nclass UnsupportedCommand extends Error {\n constructor({ agent, command }) {\n super(`Command \"${command}\" is not support by agent \"${agent}\"`);\n }\n}\nfunction getCommand(agent, command, args = []) {\n if (!COMMANDS[agent])\n throw new Error(`Unsupported agent \"${agent}\"`);\n if (!COMMANDS[agent][command])\n throw new UnsupportedCommand({ agent, command });\n return constructCommand(COMMANDS[agent][command], args);\n}\nconst parseNi = (agent, args, ctx) => {\n if (agent === \"bun\")\n args = args.map((i) => i === \"-D\" ? \"-d\" : i);\n if (agent === \"npm\")\n args = args.map((i) => i === \"-P\" ? \"--omit=dev\" : i);\n if (args.includes(\"-P\"))\n args = args.map((i) => i === \"-P\" ? \"--production\" : i);\n if (args.includes(\"-g\"))\n return getCommand(agent, \"global\", exclude(args, \"-g\"));\n if (args.includes(\"--frozen-if-present\")) {\n args = exclude(args, \"--frozen-if-present\");\n return getCommand(agent, ctx?.hasLock ? \"frozen\" : \"install\", args);\n }\n if (args.includes(\"--frozen\"))\n return getCommand(agent, \"frozen\", exclude(args, \"--frozen\"));\n if (args.length === 0 || args.every((i) => i.startsWith(\"-\")))\n return getCommand(agent, \"install\", args);\n return getCommand(agent, \"add\", args);\n};\nconst parseNr = (agent, args) => {\n if (args.length === 0)\n args.push(\"start\");\n let hasIfPresent = false;\n if (args.includes(\"--if-present\")) {\n args = exclude(args, \"--if-present\");\n hasIfPresent = true;\n }\n const cmd = getCommand(agent, \"run\", args);\n if (!cmd)\n return cmd;\n if (hasIfPresent)\n cmd.args.splice(1, 0, \"--if-present\");\n return cmd;\n};\nconst parseNup = (agent, args) => {\n if (args.includes(\"-i\"))\n return getCommand(agent, \"upgrade-interactive\", exclude(args, \"-i\"));\n return getCommand(agent, \"upgrade\", args);\n};\nconst parseNun = (agent, args) => {\n if (args.includes(\"-g\"))\n return getCommand(agent, \"global_uninstall\", exclude(args, \"-g\"));\n return getCommand(agent, \"uninstall\", args);\n};\nconst parseNlx = (agent, args) => {\n return getCommand(agent, \"execute\", args);\n};\nconst parseNa = (agent, args) => {\n return getCommand(agent, \"agent\", args);\n};\nfunction serializeCommand(command) {\n if (!command)\n return void 0;\n if (command.args.length === 0)\n return command.command;\n return `${command.command} ${command.args.map((i) => i.includes(\" \") ? `\"${i}\"` : i).join(\" \")}`;\n}\n\nconst version = \"25.0.0\";\n\nconst DEFAULT_ENVIRONMENT_OPTIONS = {\n autoInstall: false\n};\nfunction getEnvironmentOptions() {\n return {\n ...DEFAULT_ENVIRONMENT_OPTIONS,\n autoInstall: process$1.env.NI_AUTO_INSTALL === \"true\"\n };\n}\n\nconst DEBUG_SIGN = \"?\";\nasync function runCli(fn, options = {}) {\n options = {\n ...getEnvironmentOptions(),\n ...options\n };\n const {\n args = process$1.argv.slice(2).filter(Boolean)\n } = options;\n try {\n await run(fn, args, options);\n } catch (error) {\n if (error instanceof UnsupportedCommand && !options.programmatic)\n console.log(c.red(`\\u2717 ${error.message}`));\n if (!options.programmatic)\n process$1.exit(1);\n throw error;\n }\n}\nasync function getCliCommand(fn, args, options = {}, cwd = options.cwd ?? process$1.cwd()) {\n const isGlobal = args.includes(\"-g\");\n if (isGlobal)\n return await fn(await getGlobalAgent(), args);\n let agent = await detect({ ...options, cwd }) || await getDefaultAgent(options.programmatic);\n if (agent === \"prompt\") {\n agent = (await prompts({\n name: \"agent\",\n type: \"select\",\n message: \"Choose the agent\",\n choices: AGENTS.filter((i) => !i.includes(\"@\")).map((value) => ({ title: value, value }))\n })).agent;\n if (!agent)\n return;\n }\n return await fn(agent, args, {\n programmatic: options.programmatic,\n hasLock: Boolean(agent),\n cwd\n });\n}\nasync function run(fn, args, options = {}) {\n const {\n detectVolta = true\n } = options;\n const debug = args.includes(DEBUG_SIGN);\n if (debug)\n remove(args, DEBUG_SIGN);\n let cwd = options.cwd ?? process$1.cwd();\n if (args[0] === \"-C\") {\n cwd = resolve(cwd, args[1]);\n args.splice(0, 2);\n }\n if (args.length === 1 && (args[0]?.toLowerCase() === \"-v\" || args[0] === \"--version\")) {\n const getCmd = (a) => AGENTS.includes(a) ? getCommand(a, \"agent\", [\"-v\"]) : { command: a, args: [\"-v\"] };\n const xVersionOptions = {\n nodeOptions: {\n cwd\n },\n throwOnError: true\n };\n const getV = (a) => {\n const { command: command2, args: args2 } = getCmd(a);\n return x(command2, args2, xVersionOptions).then((e) => e.stdout).then((e) => e.startsWith(\"v\") ? e : `v${e}`);\n };\n const globalAgentPromise = getGlobalAgent();\n const globalAgentVersionPromise = globalAgentPromise.then(getV);\n const agentPromise = detect({ ...options, cwd }).then((a) => a || \"\");\n const agentVersionPromise = agentPromise.then((a) => a && getV(a));\n const nodeVersionPromise = getV(\"node\");\n console.log(`@antfu/ni ${c.cyan`v${version}`}`);\n console.log(`node ${c.green(await nodeVersionPromise)}`);\n const [agent, agentVersion] = await Promise.all([agentPromise, agentVersionPromise]);\n if (agent)\n console.log(`${agent.padEnd(10)} ${c.blue(agentVersion)}`);\n else\n console.log(\"agent no lock file\");\n const [globalAgent, globalAgentVersion] = await Promise.all([globalAgentPromise, globalAgentVersionPromise]);\n console.log(`${`${globalAgent} -g`.padEnd(10)} ${c.blue(globalAgentVersion)}`);\n return;\n }\n if (args.length === 1 && [\"-h\", \"--help\"].includes(args[0])) {\n const dash = c.dim(\"-\");\n console.log(c.green.bold(\"@antfu/ni\") + c.dim` use the right package manager v${version}\\n`);\n console.log(`ni ${dash} install`);\n console.log(`nr ${dash} run`);\n console.log(`nlx ${dash} execute`);\n console.log(`nup ${dash} upgrade`);\n console.log(`nun ${dash} uninstall`);\n console.log(`nci ${dash} clean install`);\n console.log(`na ${dash} agent alias`);\n console.log(`ni -v ${dash} show used agent`);\n console.log(`ni -i ${dash} interactive package management`);\n console.log(c.yellow(\"\\ncheck https://github.com/antfu/ni for more documentation.\"));\n return;\n }\n const command = await getCliCommand(fn, args, options, cwd);\n if (!command)\n return;\n if (detectVolta && cmdExists(\"volta\")) {\n command.args = [\"run\", command.command, ...command.args];\n command.command = \"volta\";\n }\n if (debug) {\n const commandStr = [command.command, ...command.args].join(\" \");\n console.log(commandStr);\n return;\n }\n await x(\n command.command,\n command.args,\n {\n nodeOptions: {\n stdio: \"inherit\",\n cwd\n },\n throwOnError: true\n }\n );\n}\n\nexport { CLI_TEMP_DIR as C, UnsupportedCommand as U, getDefaultAgent as a, getGlobalAgent as b, getCommand as c, detect as d, parseNr as e, parseNup as f, getConfig as g, parseNun as h, parseNlx as i, parseNa as j, getCliCommand as k, run as l, remove as m, exclude as n, cmdExists as o, parseNi as p, limitText as q, runCli as r, serializeCommand as s, formatPackageWithUrl as t, prompts as u, writeFileSafe as w };\n","import { detect } from \"@antfu/ni\"\n\nexport async function getPackageManager(\n targetDir: string,\n { withFallback }: { withFallback?: boolean } = {\n withFallback: false,\n }\n): Promise<\"yarn\" | \"pnpm\" | \"bun\" | \"npm\" | \"deno\"> {\n const packageManager = await detect({ programmatic: true, cwd: targetDir })\n\n if (packageManager === \"yarn@berry\") return \"yarn\"\n if (packageManager === \"pnpm@6\") return \"pnpm\"\n if (packageManager === \"bun\") return \"bun\"\n if (packageManager === \"deno\") return \"deno\"\n if (!withFallback) {\n return packageManager ?? \"npm\"\n }\n\n // Fallback to user agent if not detected.\n const userAgent = process.env.npm_config_user_agent || \"\"\n\n if (userAgent.startsWith(\"yarn\")) {\n return \"yarn\"\n }\n\n if (userAgent.startsWith(\"pnpm\")) {\n return \"pnpm\"\n }\n\n if (userAgent.startsWith(\"bun\")) {\n return \"bun\"\n }\n\n return \"npm\"\n}\n\nexport async function getPackageRunner(cwd: string) {\n const packageManager = await getPackageManager(cwd)\n\n if (packageManager === \"pnpm\") return \"pnpm dlx\"\n\n if (packageManager === \"bun\") return \"bunx\"\n\n return \"npx\"\n}","import { z } from \"zod\"\n\n// Error codes for programmatic error handling\nexport const RegistryErrorCode = {\n // Network errors\n NETWORK_ERROR: \"NETWORK_ERROR\",\n NOT_FOUND: \"NOT_FOUND\",\n UNAUTHORIZED: \"UNAUTHORIZED\",\n FORBIDDEN: \"FORBIDDEN\",\n FETCH_ERROR: \"FETCH_ERROR\",\n\n // Configuration errors\n NOT_CONFIGURED: \"NOT_CONFIGURED\",\n INVALID_CONFIG: \"INVALID_CONFIG\",\n MISSING_ENV_VARS: \"MISSING_ENV_VARS\",\n\n // File system errors\n LOCAL_FILE_ERROR: \"LOCAL_FILE_ERROR\",\n\n // Parsing errors\n PARSE_ERROR: \"PARSE_ERROR\",\n VALIDATION_ERROR: \"VALIDATION_ERROR\",\n\n // Generic errors\n UNKNOWN_ERROR: \"UNKNOWN_ERROR\",\n} as const\n\nexport type RegistryErrorCode =\n (typeof RegistryErrorCode)[keyof typeof RegistryErrorCode]\n\nexport class RegistryError extends Error {\n public readonly code: RegistryErrorCode\n public readonly statusCode?: number\n public readonly context?: Record<string, unknown>\n public readonly suggestion?: string\n public readonly timestamp: Date\n public readonly cause?: unknown\n\n constructor(\n message: string,\n options: {\n code?: RegistryErrorCode\n statusCode?: number\n cause?: unknown\n context?: Record<string, unknown>\n suggestion?: string\n } = {}\n ) {\n super(message)\n this.name = \"RegistryError\"\n this.code = options.code || RegistryErrorCode.UNKNOWN_ERROR\n this.statusCode = options.statusCode\n this.cause = options.cause\n this.context = options.context\n this.suggestion = options.suggestion\n this.timestamp = new Date()\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor)\n }\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n statusCode: this.statusCode,\n context: this.context,\n suggestion: this.suggestion,\n timestamp: this.timestamp,\n stack: this.stack,\n }\n }\n}\n\nexport class RegistryNotFoundError extends RegistryError {\n constructor(public readonly url: string, cause?: unknown) {\n const message = `The item at ${url} was not found. It may not exist at the registry.`\n\n super(message, {\n code: RegistryErrorCode.NOT_FOUND,\n statusCode: 404,\n cause,\n context: { url },\n suggestion:\n \"Check if the item name is correct and the registry URL is accessible.\",\n })\n this.name = \"RegistryNotFoundError\"\n }\n}\n\nexport class RegistryUnauthorizedError extends RegistryError {\n constructor(public readonly url: string, cause?: unknown) {\n const message = `You are not authorized to access the item at ${url}. If this is a remote registry, you may need to authenticate.`\n\n super(message, {\n code: RegistryErrorCode.UNAUTHORIZED,\n statusCode: 401,\n cause,\n context: { url },\n suggestion:\n \"Check your authentication credentials and environment variables.\",\n })\n this.name = \"RegistryUnauthorizedError\"\n }\n}\n\nexport class RegistryForbiddenError extends RegistryError {\n constructor(public readonly url: string, cause?: unknown) {\n const message = `You are not authorized to access the item at ${url}. If this is a remote registry, you may need to authenticate.`\n\n super(message, {\n code: RegistryErrorCode.FORBIDDEN,\n statusCode: 403,\n cause,\n context: { url },\n suggestion:\n \"Check your authentication credentials and environment variables.\",\n })\n this.name = \"RegistryForbiddenError\"\n }\n}\n\nexport class RegistryFetchError extends RegistryError {\n constructor(\n public readonly url: string,\n statusCode?: number,\n public readonly responseBody?: string,\n cause?: unknown\n ) {\n // Use the error detail from the server if available\n const baseMessage = statusCode\n ? `Failed to fetch from registry (${statusCode}): ${url}`\n : `Failed to fetch from registry: ${url}`\n\n const message =\n typeof cause === \"string\" && cause\n ? `${baseMessage} - ${cause}`\n : baseMessage\n\n let suggestion = \"Check your network connection and try again.\"\n if (statusCode === 404) {\n suggestion =\n \"The requested resource was not found. Check the URL or item name.\"\n } else if (statusCode === 500) {\n suggestion = \"The registry server encountered an error. Try again later.\"\n } else if (statusCode && statusCode >= 400 && statusCode < 500) {\n suggestion = \"There was a client error. Check your request parameters.\"\n }\n\n super(message, {\n code: RegistryErrorCode.FETCH_ERROR,\n statusCode,\n cause,\n context: { url, responseBody },\n suggestion,\n })\n this.name = \"RegistryFetchError\"\n }\n}\n\nexport class RegistryNotConfiguredError extends RegistryError {\n constructor(public readonly registryName: string | null) {\n const message = registryName\n ? `Unknown registry \"${registryName}\". Make sure it is defined in components.json as follows:\n{\n \"registries\": {\n \"${registryName}\": \"[URL_TO_REGISTRY]\"\n }\n}`\n : `Unknown registry. Make sure it is defined in components.json under \"registries\".`\n\n super(message, {\n code: RegistryErrorCode.NOT_CONFIGURED,\n context: { registryName },\n suggestion:\n \"Add the registry configuration to your components.json file. Consult the registry documentation for the correct format.\",\n })\n this.name = \"RegistryNotConfiguredError\"\n }\n}\n\nexport class RegistryLocalFileError extends RegistryError {\n constructor(public readonly filePath: string, cause?: unknown) {\n super(`Failed to read local registry file: ${filePath}`, {\n code: RegistryErrorCode.LOCAL_FILE_ERROR,\n cause,\n context: { filePath },\n suggestion: \"Check if the file exists and you have read permissions.\",\n })\n this.name = \"RegistryLocalFileError\"\n }\n}\n\nexport class RegistryParseError extends RegistryError {\n public readonly parseError: unknown\n\n constructor(public readonly item: string, parseError: unknown) {\n let message = `Failed to parse registry item: ${item}`\n\n if (parseError instanceof z.ZodError) {\n message = `Failed to parse registry item: ${item}\\n${parseError.errors\n .map((e) => ` - ${e.path.join(\".\")}: ${e.message}`)\n .join(\"\\n\")}`\n }\n\n super(message, {\n code: RegistryErrorCode.PARSE_ERROR,\n cause: parseError,\n context: { item },\n suggestion:\n \"The registry item may be corrupted or have an invalid format. Please make sure it returns a valid JSON object. See https://ui.shadcn.com/schema/registry-item.json.\",\n })\n\n this.parseError = parseError\n this.name = \"RegistryParseError\"\n }\n}\n\nexport class RegistryMissingEnvironmentVariablesError extends RegistryError {\n constructor(\n public readonly registryName: string,\n public readonly missingVars: string[]\n ) {\n const message =\n `Registry \"${registryName}\" requires the following environment variables:\\n\\n` +\n missingVars.map((v) => ` • ${v}`).join(\"\\n\")\n\n super(message, {\n code: RegistryErrorCode.MISSING_ENV_VARS,\n context: { registryName, missingVars },\n suggestion:\n \"Set the required environment variables to your .env or .env.local file.\",\n })\n this.name = \"RegistryMissingEnvironmentVariablesError\"\n }\n}\n\nexport class RegistryInvalidNamespaceError extends RegistryError {\n constructor(public readonly name: string) {\n const message = `Invalid registry namespace: \"${name}\". Registry names must start with @ (e.g., @shadcn, @v0).`\n\n super(message, {\n code: RegistryErrorCode.VALIDATION_ERROR,\n context: { name },\n suggestion:\n \"Use a valid registry name starting with @ or provide a direct URL to the registry.\",\n })\n this.name = \"RegistryInvalidNamespaceError\"\n }\n}\n\nexport class ConfigMissingError extends RegistryError {\n constructor(public readonly cwd: string) {\n const message = `No components.json found in ${cwd} or parent directories.`\n\n super(message, {\n code: RegistryErrorCode.NOT_CONFIGURED,\n context: { cwd },\n suggestion:\n \"Run 'npx shadcn@latest init' to create a components.json file, or check that you're in the correct directory.\",\n })\n this.name = \"ConfigMissingError\"\n }\n}\n\nexport class ConfigParseError extends RegistryError {\n constructor(public readonly cwd: string, parseError: unknown) {\n let message = `Invalid components.json configuration in ${cwd}.`\n\n if (parseError instanceof z.ZodError) {\n message = `Invalid components.json configuration in ${cwd}:\\n${parseError.errors\n .map((e) => ` - ${e.path.join(\".\")}: ${e.message}`)\n .join(\"\\n\")}`\n }\n\n super(message, {\n code: RegistryErrorCode.INVALID_CONFIG,\n cause: parseError,\n context: { cwd },\n suggestion:\n \"Check your components.json file for syntax errors or invalid configuration. Run 'npx shadcn@latest init' to regenerate a valid configuration.\",\n })\n this.name = \"ConfigParseError\"\n }\n}","import { RegistryError } from \"@/src/registry/errors\"\nimport { highlighter } from \"@/src/utils/highlighter\"\nimport { logger } from \"@/src/utils/logger\"\nimport { z } from \"zod\"\n\nexport function handleError(error: unknown) {\n logger.break()\n logger.error(\n `Something went wrong. Please check the error below for more details.`\n )\n logger.error(`If the problem persists, please open an issue on GitHub.`)\n logger.error(\"\")\n if (typeof error === \"string\") {\n logger.error(error)\n logger.break()\n process.exit(1)\n }\n\n if (error instanceof RegistryError) {\n if (error.message) {\n logger.error(error.cause ? \"Error:\" : \"Message:\")\n logger.error(error.message)\n }\n\n if (error.cause) {\n logger.error(\"\\nMessage:\")\n logger.error(error.cause)\n }\n\n if (error.suggestion) {\n logger.error(\"\\nSuggestion:\")\n logger.error(error.suggestion)\n }\n logger.break()\n process.exit(1)\n }\n\n if (error instanceof z.ZodError) {\n logger.error(\"Validation failed:\")\n for (const [key, value] of Object.entries(error.flatten().fieldErrors)) {\n logger.error(`- ${highlighter.info(key)}: ${value}`)\n }\n logger.break()\n process.exit(1)\n }\n\n if (error instanceof Error) {\n logger.error(error.message)\n logger.break()\n process.exit(1)\n }\n\n logger.break()\n process.exit(1)\n}","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","import {fileURLToPath} from 'node:url';\n\n// Allow some arguments/options to be either a file path string or a file URL\nexport const safeNormalizeFileUrl = (file, name) => {\n\tconst fileString = normalizeFileUrl(normalizeDenoExecPath(file));\n\n\tif (typeof fileString !== 'string') {\n\t\tthrow new TypeError(`${name} must be a string or a file URL: ${fileString}.`);\n\t}\n\n\treturn fileString;\n};\n\n// In Deno node:process execPath is a special object, not just a string:\n// https://github.com/denoland/deno/blob/f460188e583f00144000aa0d8ade08218d47c3c1/ext/node/polyfills/process.ts#L344\nconst normalizeDenoExecPath = file => isDenoExecPath(file)\n\t? file.toString()\n\t: file;\n\nexport const isDenoExecPath = file => typeof file !== 'string'\n\t&& file\n\t&& Object.getPrototypeOf(file) === String.prototype;\n\n// Same but also allows other values, e.g. `boolean` for the `shell` option\nexport const normalizeFileUrl = file => file instanceof URL ? fileURLToPath(file) : file;\n","import isPlainObject from 'is-plain-obj';\nimport {safeNormalizeFileUrl} from '../arguments/file-url.js';\n\n// The command `arguments` and `options` are both optional.\n// This also does basic validation on them and on the command file.\nexport const normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {\n\tconst filePath = safeNormalizeFileUrl(rawFile, 'First argument');\n\tconst [commandArguments, options] = isPlainObject(rawArguments)\n\t\t? [[], rawArguments]\n\t\t: [rawArguments, rawOptions];\n\n\tif (!Array.isArray(commandArguments)) {\n\t\tthrow new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);\n\t}\n\n\tif (commandArguments.some(commandArgument => typeof commandArgument === 'object' && commandArgument !== null)) {\n\t\tthrow new TypeError(`Second argument must be an array of strings: ${commandArguments}`);\n\t}\n\n\tconst normalizedArguments = commandArguments.map(String);\n\tconst nullByteArgument = normalizedArguments.find(normalizedArgument => normalizedArgument.includes('\\0'));\n\tif (nullByteArgument !== undefined) {\n\t\tthrow new TypeError(`Arguments cannot contain null bytes (\"\\\\0\"): ${nullByteArgument}`);\n\t}\n\n\tif (!isPlainObject(options)) {\n\t\tthrow new TypeError(`Last argument must be an options object: ${options}`);\n\t}\n\n\treturn [filePath, normalizedArguments, options];\n};\n","import {StringDecoder} from 'node:string_decoder';\n\nconst {toString: objectToString} = Object.prototype;\n\nexport const isArrayBuffer = value => objectToString.call(value) === '[object ArrayBuffer]';\n\n// Is either Uint8Array or Buffer\nexport const isUint8Array = value => objectToString.call(value) === '[object Uint8Array]';\n\nexport const bufferToUint8Array = buffer => new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n\nconst textEncoder = new TextEncoder();\nconst stringToUint8Array = string => textEncoder.encode(string);\n\nconst textDecoder = new TextDecoder();\nexport const uint8ArrayToString = uint8Array => textDecoder.decode(uint8Array);\n\nexport const joinToString = (uint8ArraysOrStrings, encoding) => {\n\tconst strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);\n\treturn strings.join('');\n};\n\nconst uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {\n\tif (encoding === 'utf8' && uint8ArraysOrStrings.every(uint8ArrayOrString => typeof uint8ArrayOrString === 'string')) {\n\t\treturn uint8ArraysOrStrings;\n\t}\n\n\tconst decoder = new StringDecoder(encoding);\n\tconst strings = uint8ArraysOrStrings\n\t\t.map(uint8ArrayOrString => typeof uint8ArrayOrString === 'string'\n\t\t\t? stringToUint8Array(uint8ArrayOrString)\n\t\t\t: uint8ArrayOrString)\n\t\t.map(uint8Array => decoder.write(uint8Array));\n\tconst finalString = decoder.end();\n\treturn finalString === '' ? strings : [...strings, finalString];\n};\n\nexport const joinToUint8Array = uint8ArraysOrStrings => {\n\tif (uint8ArraysOrStrings.length === 1 && isUint8Array(uint8ArraysOrStrings[0])) {\n\t\treturn uint8ArraysOrStrings[0];\n\t}\n\n\treturn concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings));\n};\n\nconst stringsToUint8Arrays = uint8ArraysOrStrings => uint8ArraysOrStrings.map(uint8ArrayOrString => typeof uint8ArrayOrString === 'string'\n\t? stringToUint8Array(uint8ArrayOrString)\n\t: uint8ArrayOrString);\n\nexport const concatUint8Arrays = uint8Arrays => {\n\tconst result = new Uint8Array(getJoinLength(uint8Arrays));\n\n\tlet index = 0;\n\tfor (const uint8Array of uint8Arrays) {\n\t\tresult.set(uint8Array, index);\n\t\tindex += uint8Array.length;\n\t}\n\n\treturn result;\n};\n\nconst getJoinLength = uint8Arrays => {\n\tlet joinLength = 0;\n\tfor (const uint8Array of uint8Arrays) {\n\t\tjoinLength += uint8Array.length;\n\t}\n\n\treturn joinLength;\n};\n","import {ChildProcess} from 'node:child_process';\nimport isPlainObject from 'is-plain-obj';\nimport {isUint8Array, uint8ArrayToString} from '../utils/uint-array.js';\n\n// Check whether the template string syntax is being used\nexport const isTemplateString = templates => Array.isArray(templates) && Array.isArray(templates.raw);\n\n// Convert execa`file ...commandArguments` to execa(file, commandArguments)\nexport const parseTemplates = (templates, expressions) => {\n\tlet tokens = [];\n\n\tfor (const [index, template] of templates.entries()) {\n\t\ttokens = parseTemplate({\n\t\t\ttemplates,\n\t\t\texpressions,\n\t\t\ttokens,\n\t\t\tindex,\n\t\t\ttemplate,\n\t\t});\n\t}\n\n\tif (tokens.length === 0) {\n\t\tthrow new TypeError('Template script must not be empty');\n\t}\n\n\tconst [file, ...commandArguments] = tokens;\n\treturn [file, commandArguments, {}];\n};\n\nconst parseTemplate = ({templates, expressions, tokens, index, template}) => {\n\tif (template === undefined) {\n\t\tthrow new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`);\n\t}\n\n\tconst {nextTokens, leadingWhitespaces, trailingWhitespaces} = splitByWhitespaces(template, templates.raw[index]);\n\tconst newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces);\n\n\tif (index === expressions.length) {\n\t\treturn newTokens;\n\t}\n\n\tconst expression = expressions[index];\n\tconst expressionTokens = Array.isArray(expression)\n\t\t? expression.map(expression => parseExpression(expression))\n\t\t: [parseExpression(expression)];\n\treturn concatTokens(newTokens, expressionTokens, trailingWhitespaces);\n};\n\n// Like `string.split(/[ \\t\\r\\n]+/)` except newlines and tabs are:\n// - ignored when input as a backslash sequence like: `echo foo\\n bar`\n// - not ignored when input directly\n// The only way to distinguish those in JavaScript is to use a tagged template and compare:\n// - the first array argument, which does not escape backslash sequences\n// - its `raw` property, which escapes them\nconst splitByWhitespaces = (template, rawTemplate) => {\n\tif (rawTemplate.length === 0) {\n\t\treturn {nextTokens: [], leadingWhitespaces: false, trailingWhitespaces: false};\n\t}\n\n\tconst nextTokens = [];\n\tlet templateStart = 0;\n\tconst leadingWhitespaces = DELIMITERS.has(rawTemplate[0]);\n\n\tfor (\n\t\tlet templateIndex = 0, rawIndex = 0;\n\t\ttemplateIndex < template.length;\n\t\ttemplateIndex += 1, rawIndex += 1\n\t) {\n\t\tconst rawCharacter = rawTemplate[rawIndex];\n\t\tif (DELIMITERS.has(rawCharacter)) {\n\t\t\tif (templateStart !== templateIndex) {\n\t\t\t\tnextTokens.push(template.slice(templateStart, templateIndex));\n\t\t\t}\n\n\t\t\ttemplateStart = templateIndex + 1;\n\t\t} else if (rawCharacter === '\\\\') {\n\t\t\tconst nextRawCharacter = rawTemplate[rawIndex + 1];\n\t\t\tif (nextRawCharacter === '\\n') {\n\t\t\t\t// Handles escaped newlines in templates\n\t\t\t\ttemplateIndex -= 1;\n\t\t\t\trawIndex += 1;\n\t\t\t} else if (nextRawCharacter === 'u' && rawTemplate[rawIndex + 2] === '{') {\n\t\t\t\trawIndex = rawTemplate.indexOf('}', rawIndex + 3);\n\t\t\t} else {\n\t\t\t\trawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst trailingWhitespaces = templateStart === template.length;\n\tif (!trailingWhitespaces) {\n\t\tnextTokens.push(template.slice(templateStart));\n\t}\n\n\treturn {nextTokens, leadingWhitespaces, trailingWhitespaces};\n};\n\nconst DELIMITERS = new Set([' ', '\\t', '\\r', '\\n']);\n\n// Number of characters in backslash escape sequences: \\0 \\xXX or \\uXXXX\n// \\cX is allowed in RegExps but not in strings\n// Octal sequences are not allowed in strict mode\nconst ESCAPE_LENGTH = {x: 3, u: 5};\n\nconst concatTokens = (tokens, nextTokens, isSeparated) => isSeparated\n\t|| tokens.length === 0\n\t|| nextTokens.length === 0\n\t? [...tokens, ...nextTokens]\n\t: [\n\t\t...tokens.slice(0, -1),\n\t\t`${tokens.at(-1)}${nextTokens[0]}`,\n\t\t...nextTokens.slice(1),\n\t];\n\n// Handle `${expression}` inside the template string syntax\nconst parseExpression = expression => {\n\tconst typeOfExpression = typeof expression;\n\n\tif (typeOfExpression === 'string') {\n\t\treturn expression;\n\t}\n\n\tif (typeOfExpression === 'number') {\n\t\treturn String(expression);\n\t}\n\n\tif (isPlainObject(expression) && ('stdout' in expression || 'isMaxBuffer' in expression)) {\n\t\treturn getSubprocessResult(expression);\n\t}\n\n\tif (expression instanceof ChildProcess || Object.prototype.toString.call(expression) === '[object Promise]') {\n\t\t// eslint-disable-next-line no-template-curly-in-string\n\t\tthrow new TypeError('Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.');\n\t}\n\n\tthrow new TypeError(`Unexpected \"${typeOfExpression}\" in template expression`);\n};\n\nconst getSubprocessResult = ({stdout}) => {\n\tif (typeof stdout === 'string') {\n\t\treturn stdout;\n\t}\n\n\tif (isUint8Array(stdout)) {\n\t\treturn uint8ArrayToString(stdout);\n\t}\n\n\tif (stdout === undefined) {\n\t\tthrow new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\\' \"stdout\" option.');\n\t}\n\n\tthrow new TypeError(`Unexpected \"${typeof stdout}\" stdout in template expression`);\n};\n","import process from 'node:process';\n\nexport const isStandardStream = stream => STANDARD_STREAMS.includes(stream);\nexport const STANDARD_STREAMS = [process.stdin, process.stdout, process.stderr];\nexport const STANDARD_STREAMS_ALIASES = ['stdin', 'stdout', 'stderr'];\nexport const getStreamName = fdNumber => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;\n","import {debuglog} from 'node:util';\nimport isPlainObject from 'is-plain-obj';\nimport {STANDARD_STREAMS_ALIASES} from '../utils/standard-stream.js';\n\n// Some options can have different values for `stdout`/`stderr`/`fd3`.\n// This normalizes those to array of values.\n// For example, `{verbose: {stdout: 'none', stderr: 'full'}}` becomes `{verbose: ['none', 'none', 'full']}`\nexport const normalizeFdSpecificOptions = options => {\n\tconst optionsCopy = {...options};\n\n\tfor (const optionName of FD_SPECIFIC_OPTIONS) {\n\t\toptionsCopy[optionName] = normalizeFdSpecificOption(options, optionName);\n\t}\n\n\treturn optionsCopy;\n};\n\nexport const normalizeFdSpecificOption = (options, optionName) => {\n\tconst optionBaseArray = Array.from({length: getStdioLength(options) + 1});\n\tconst optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);\n\treturn addDefaultValue(optionArray, optionName);\n};\n\nconst getStdioLength = ({stdio}) => Array.isArray(stdio)\n\t? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length)\n\t: STANDARD_STREAMS_ALIASES.length;\n\nconst normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue)\n\t? normalizeOptionObject(optionValue, optionArray, optionName)\n\t: optionArray.fill(optionValue);\n\nconst normalizeOptionObject = (optionValue, optionArray, optionName) => {\n\tfor (const fdName of Object.keys(optionValue).sort(compareFdName)) {\n\t\tfor (const fdNumber of parseFdName(fdName, optionName, optionArray)) {\n\t\t\toptionArray[fdNumber] = optionValue[fdName];\n\t\t}\n\t}\n\n\treturn optionArray;\n};\n\n// Ensure priority order when setting both `stdout`/`stderr`, `fd1`/`fd2`, and `all`\nconst compareFdName = (fdNameA, fdNameB) => getFdNameOrder(fdNameA) < getFdNameOrder(fdNameB) ? 1 : -1;\n\nconst getFdNameOrder = fdName => {\n\tif (fdName === 'stdout' || fdName === 'stderr') {\n\t\treturn 0;\n\t}\n\n\treturn fdName === 'all' ? 2 : 1;\n};\n\nconst parseFdName = (fdName, optionName, optionArray) => {\n\tif (fdName === 'ipc') {\n\t\treturn [optionArray.length - 1];\n\t}\n\n\tconst fdNumber = parseFd(fdName);\n\tif (fdNumber === undefined || fdNumber === 0) {\n\t\tthrow new TypeError(`\"${optionName}.${fdName}\" is invalid.\nIt must be \"${optionName}.stdout\", \"${optionName}.stderr\", \"${optionName}.all\", \"${optionName}.ipc\", or \"${optionName}.fd3\", \"${optionName}.fd4\" (and so on).`);\n\t}\n\n\tif (fdNumber >= optionArray.length) {\n\t\tthrow new TypeError(`\"${optionName}.${fdName}\" is invalid: that file descriptor does not exist.\nPlease set the \"stdio\" option to ensure that file descriptor exists.`);\n\t}\n\n\treturn fdNumber === 'all' ? [1, 2] : [fdNumber];\n};\n\n// Use the same syntax for fd-specific options and the `from`/`to` options\nexport const parseFd = fdName => {\n\tif (fdName === 'all') {\n\t\treturn fdName;\n\t}\n\n\tif (STANDARD_STREAMS_ALIASES.includes(fdName)) {\n\t\treturn STANDARD_STREAMS_ALIASES.indexOf(fdName);\n\t}\n\n\tconst regexpResult = FD_REGEXP.exec(fdName);\n\tif (regexpResult !== null) {\n\t\treturn Number(regexpResult[1]);\n\t}\n};\n\nconst FD_REGEXP = /^fd(\\d+)$/;\n\nconst addDefaultValue = (optionArray, optionName) => optionArray.map(optionValue => optionValue === undefined\n\t? DEFAULT_OPTIONS[optionName]\n\t: optionValue);\n\n// Default value for the `verbose` option\nconst verboseDefault = debuglog('execa').enabled ? 'full' : 'none';\n\nconst DEFAULT_OPTIONS = {\n\tlines: false,\n\tbuffer: true,\n\tmaxBuffer: 1000 * 1000 * 100,\n\tverbose: verboseDefault,\n\tstripFinalNewline: true,\n};\n\n// List of options which can have different values for `stdout`/`stderr`\nexport const FD_SPECIFIC_OPTIONS = ['lines', 'buffer', 'maxBuffer', 'verbose', 'stripFinalNewline'];\n\n// Retrieve fd-specific option\nexport const getFdSpecificValue = (optionArray, fdNumber) => fdNumber === 'ipc'\n\t? optionArray.at(-1)\n\t: optionArray[fdNumber];\n","import {getFdSpecificValue} from '../arguments/specific.js';\n\n// The `verbose` option can have different values for `stdout`/`stderr`\nexport const isVerbose = ({verbose}, fdNumber) => getFdVerbose(verbose, fdNumber) !== 'none';\n\n// Whether IPC and output and logged\nexport const isFullVerbose = ({verbose}, fdNumber) => !['none', 'short'].includes(getFdVerbose(verbose, fdNumber));\n\n// The `verbose` option can be a function to customize logging\nexport const getVerboseFunction = ({verbose}, fdNumber) => {\n\tconst fdVerbose = getFdVerbose(verbose, fdNumber);\n\treturn isVerboseFunction(fdVerbose) ? fdVerbose : undefined;\n};\n\n// When using `verbose: {stdout, stderr, fd3, ipc}`:\n// - `verbose.stdout|stderr|fd3` is used for 'output'\n// - `verbose.ipc` is only used for 'ipc'\n// - highest `verbose.*` value is used for 'command', 'error' and 'duration'\nconst getFdVerbose = (verbose, fdNumber) => fdNumber === undefined\n\t? getFdGenericVerbose(verbose)\n\t: getFdSpecificValue(verbose, fdNumber);\n\n// When using `verbose: {stdout, stderr, fd3, ipc}` and logging is not specific to a file descriptor.\n// We then use the highest `verbose.*` value, using the following order:\n// - function > 'full' > 'short' > 'none'\n// - if several functions are defined: stdout > stderr > fd3 > ipc\nconst getFdGenericVerbose = verbose => verbose.find(fdVerbose => isVerboseFunction(fdVerbose))\n\t?? VERBOSE_VALUES.findLast(fdVerbose => verbose.includes(fdVerbose));\n\n// Whether the `verbose` option is customized using a function\nexport const isVerboseFunction = fdVerbose => typeof fdVerbose === 'function';\n\nexport const VERBOSE_VALUES = ['none', 'short', 'full'];\n","import {platform} from 'node:process';\nimport {stripVTControlCharacters} from 'node:util';\n\n// Compute `result.command` and `result.escapedCommand`\nexport const joinCommand = (filePath, rawArguments) => {\n\tconst fileAndArguments = [filePath, ...rawArguments];\n\tconst command = fileAndArguments.join(' ');\n\tconst escapedCommand = fileAndArguments\n\t\t.map(fileAndArgument => quoteString(escapeControlCharacters(fileAndArgument)))\n\t\t.join(' ');\n\treturn {command, escapedCommand};\n};\n\n// Remove ANSI sequences and escape control characters and newlines\nexport const escapeLines = lines => stripVTControlCharacters(lines)\n\t.split('\\n')\n\t.map(line => escapeControlCharacters(line))\n\t.join('\\n');\n\nconst escapeControlCharacters = line => line.replaceAll(SPECIAL_CHAR_REGEXP, character => escapeControlCharacter(character));\n\nconst escapeControlCharacter = character => {\n\tconst commonEscape = COMMON_ESCAPES[character];\n\tif (commonEscape !== undefined) {\n\t\treturn commonEscape;\n\t}\n\n\tconst codepoint = character.codePointAt(0);\n\tconst codepointHex = codepoint.toString(16);\n\treturn codepoint <= ASTRAL_START\n\t\t? `\\\\u${codepointHex.padStart(4, '0')}`\n\t\t: `\\\\U${codepointHex}`;\n};\n\n// Characters that would create issues when printed are escaped using the \\u or \\U notation.\n// Those include control characters and newlines.\n// The \\u and \\U notation is Bash specific, but there is no way to do this in a shell-agnostic way.\n// Some shells do not even have a way to print those characters in an escaped fashion.\n// Therefore, we prioritize printing those safely, instead of allowing those to be copy-pasted.\n// List of Unicode character categories: https://www.fileformat.info/info/unicode/category/index.htm\nconst getSpecialCharRegExp = () => {\n\ttry {\n\t\t// This throws when using Node.js without ICU support.\n\t\t// When using a RegExp literal, this would throw at parsing-time, instead of runtime.\n\t\t// eslint-disable-next-line prefer-regex-literals\n\t\treturn new RegExp('\\\\p{Separator}|\\\\p{Other}', 'gu');\n\t} catch {\n\t\t// Similar to the above RegExp, but works even when Node.js has been built without ICU support.\n\t\t// Unlike the above RegExp, it only covers whitespaces and C0/C1 control characters.\n\t\t// It does not cover some edge cases, such as Unicode reserved characters.\n\t\t// See https://github.com/sindresorhus/execa/issues/1143\n\t\t// eslint-disable-next-line no-control-regex\n\t\treturn /[\\s\\u0000-\\u001F\\u007F-\\u009F\\u00AD]/g;\n\t}\n};\n\nconst SPECIAL_CHAR_REGEXP = getSpecialCharRegExp();\n\n// Accepted by $'...' in Bash.\n// Exclude \\a \\e \\v which are accepted in Bash but not in JavaScript (except \\v) and JSON.\nconst COMMON_ESCAPES = {\n\t' ': ' ',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t',\n};\n\n// Up until that codepoint, \\u notation can be used instead of \\U\nconst ASTRAL_START = 65_535;\n\n// Some characters are shell-specific, i.e. need to be escaped when the command is copy-pasted then run.\n// Escaping is shell-specific. We cannot know which shell is used: `process.platform` detection is not enough.\n// For example, Windows users could be using `cmd.exe`, Powershell or Bash for Windows which all use different escaping.\n// We use '...' on Unix, which is POSIX shell compliant and escape all characters but ' so this is fairly safe.\n// On Windows, we assume cmd.exe is used and escape with \"...\", which also works with Powershell.\nconst quoteString = escapedArgument => {\n\tif (NO_ESCAPE_REGEXP.test(escapedArgument)) {\n\t\treturn escapedArgument;\n\t}\n\n\treturn platform === 'win32'\n\t\t? `\"${escapedArgument.replaceAll('\"', '\"\"')}\"`\n\t\t: `'${escapedArgument.replaceAll('\\'', '\\'\\\\\\'\\'')}'`;\n};\n\nconst NO_ESCAPE_REGEXP = /^[\\w./-]+$/;\n","import isUnicodeSupported from 'is-unicode-supported';\n\nconst common = {\n\tcircleQuestionMark: '(?)',\n\tquestionMarkPrefix: '(?)',\n\tsquare: '█',\n\tsquareDarkShade: '▓',\n\tsquareMediumShade: '▒',\n\tsquareLightShade: '░',\n\tsquareTop: '▀',\n\tsquareBottom: '▄',\n\tsquareLeft: '▌',\n\tsquareRight: '▐',\n\tsquareCenter: '■',\n\tbullet: '●',\n\tdot: '․',\n\tellipsis: '…',\n\tpointerSmall: '›',\n\ttriangleUp: '▲',\n\ttriangleUpSmall: '▴',\n\ttriangleDown: '▼',\n\ttriangleDownSmall: '▾',\n\ttriangleLeftSmall: '◂',\n\ttriangleRightSmall: '▸',\n\thome: '⌂',\n\theart: '♥',\n\tmusicNote: '♪',\n\tmusicNoteBeamed: '♫',\n\tarrowUp: '↑',\n\tarrowDown: '↓',\n\tarrowLeft: '←',\n\tarrowRight: '→',\n\tarrowLeftRight: '↔',\n\tarrowUpDown: '↕',\n\talmostEqual: '≈',\n\tnotEqual: '≠',\n\tlessOrEqual: '≤',\n\tgreaterOrEqual: '≥',\n\tidentical: '≡',\n\tinfinity: '∞',\n\tsubscriptZero: '₀',\n\tsubscriptOne: '₁',\n\tsubscriptTwo: '₂',\n\tsubscriptThree: '₃',\n\tsubscriptFour: '₄',\n\tsubscriptFive: '₅',\n\tsubscriptSix: '₆',\n\tsubscriptSeven: '₇',\n\tsubscriptEight: '₈',\n\tsubscriptNine: '₉',\n\toneHalf: '½',\n\toneThird: '⅓',\n\toneQuarter: '¼',\n\toneFifth: '⅕',\n\toneSixth: '⅙',\n\toneEighth: '⅛',\n\ttwoThirds: '⅔',\n\ttwoFifths: '⅖',\n\tthreeQuarters: '¾',\n\tthreeFifths: '⅗',\n\tthreeEighths: '⅜',\n\tfourFifths: '⅘',\n\tfiveSixths: '⅚',\n\tfiveEighths: '⅝',\n\tsevenEighths: '⅞',\n\tline: '─',\n\tlineBold: '━',\n\tlineDouble: '═',\n\tlineDashed0: '┄',\n\tlineDashed1: '┅',\n\tlineDashed2: '┈',\n\tlineDashed3: '┉',\n\tlineDashed4: '╌',\n\tlineDashed5: '╍',\n\tlineDashed6: '╴',\n\tlineDashed7: '╶',\n\tlineDashed8: '╸',\n\tlineDashed9: '╺',\n\tlineDashed10: '╼',\n\tlineDashed11: '╾',\n\tlineDashed12: '−',\n\tlineDashed13: '–',\n\tlineDashed14: '‐',\n\tlineDashed15: '⁃',\n\tlineVertical: '│',\n\tlineVerticalBold: '┃',\n\tlineVerticalDouble: '║',\n\tlineVerticalDashed0: '┆',\n\tlineVerticalDashed1: '┇',\n\tlineVerticalDashed2: '┊',\n\tlineVerticalDashed3: '┋',\n\tlineVerticalDashed4: '╎',\n\tlineVerticalDashed5: '╏',\n\tlineVerticalDashed6: '╵',\n\tlineVerticalDashed7: '╷',\n\tlineVerticalDashed8: '╹',\n\tlineVerticalDashed9: '╻',\n\tlineVerticalDashed10: '╽',\n\tlineVerticalDashed11: '╿',\n\tlineDownLeft: '┐',\n\tlineDownLeftArc: '╮',\n\tlineDownBoldLeftBold: '┓',\n\tlineDownBoldLeft: '┒',\n\tlineDownLeftBold: '┑',\n\tlineDownDoubleLeftDouble: '╗',\n\tlineDownDoubleLeft: '╖',\n\tlineDownLeftDouble: '╕',\n\tlineDownRight: '┌',\n\tlineDownRightArc: '╭',\n\tlineDownBoldRightBold: '┏',\n\tlineDownBoldRight: '┎',\n\tlineDownRightBold: '┍',\n\tlineDownDoubleRightDouble: '╔',\n\tlineDownDoubleRight: '╓',\n\tlineDownRightDouble: '╒',\n\tlineUpLeft: '┘',\n\tlineUpLeftArc: '╯',\n\tlineUpBoldLeftBold: '┛',\n\tlineUpBoldLeft: '┚',\n\tlineUpLeftBold: '┙',\n\tlineUpDoubleLeftDouble: '╝',\n\tlineUpDoubleLeft: '╜',\n\tlineUpLeftDouble: '╛',\n\tlineUpRight: '└',\n\tlineUpRightArc: '╰',\n\tlineUpBoldRightBold: '┗',\n\tlineUpBoldRight: '┖',\n\tlineUpRightBold: '┕',\n\tlineUpDoubleRightDouble: '╚',\n\tlineUpDoubleRight: '╙',\n\tlineUpRightDouble: '╘',\n\tlineUpDownLeft: '┤',\n\tlineUpBoldDownBoldLeftBold: '┫',\n\tlineUpBoldDownBoldLeft: '┨',\n\tlineUpDownLeftBold: '┥',\n\tlineUpBoldDownLeftBold: '┩',\n\tlineUpDownBoldLeftBold: '┪',\n\tlineUpDownBoldLeft: '┧',\n\tlineUpBoldDownLeft: '┦',\n\tlineUpDoubleDownDoubleLeftDouble: '╣',\n\tlineUpDoubleDownDoubleLeft: '╢',\n\tlineUpDownLeftDouble: '╡',\n\tlineUpDownRight: '├',\n\tlineUpBoldDownBoldRightBold: '┣',\n\tlineUpBoldDownBoldRight: '┠',\n\tlineUpDownRightBold: '┝',\n\tlineUpBoldDownRightBold: '┡',\n\tlineUpDownBoldRightBold: '┢',\n\tlineUpDownBoldRight: '┟',\n\tlineUpBoldDownRight: '┞',\n\tlineUpDoubleDownDoubleRightDouble: '╠',\n\tlineUpDoubleDownDoubleRight: '╟',\n\tlineUpDownRightDouble: '╞',\n\tlineDownLeftRight: '┬',\n\tlineDownBoldLeftBoldRightBold: '┳',\n\tlineDownLeftBoldRightBold: '┯',\n\tlineDownBoldLeftRight: '┰',\n\tlineDownBoldLeftBoldRight: '┱',\n\tlineDownBoldLeftRightBold: '┲',\n\tlineDownLeftRightBold: '┮',\n\tlineDownLeftBoldRight: '┭',\n\tlineDownDoubleLeftDoubleRightDouble: '╦',\n\tlineDownDoubleLeftRight: '╥',\n\tlineDownLeftDoubleRightDouble: '╤',\n\tlineUpLeftRight: '┴',\n\tlineUpBoldLeftBoldRightBold: '┻',\n\tlineUpLeftBoldRightBold: '┷',\n\tlineUpBoldLeftRight: '┸',\n\tlineUpBoldLeftBoldRight: '┹',\n\tlineUpBoldLeftRightBold: '┺',\n\tlineUpLeftRightBold: '┶',\n\tlineUpLeftBoldRight: '┵',\n\tlineUpDoubleLeftDoubleRightDouble: '╩',\n\tlineUpDoubleLeftRight: '╨',\n\tlineUpLeftDoubleRightDouble: '╧',\n\tlineUpDownLeftRight: '┼',\n\tlineUpBoldDownBoldLeftBoldRightBold: '╋',\n\tlineUpDownBoldLeftBoldRightBold: '╈',\n\tlineUpBoldDownLeftBoldRightBold: '╇',\n\tlineUpBoldDownBoldLeftRightBold: '╊',\n\tlineUpBoldDownBoldLeftBoldRight: '╉',\n\tlineUpBoldDownLeftRight: '╀',\n\tlineUpDownBoldLeftRight: '╁',\n\tlineUpDownLeftBoldRight: '┽',\n\tlineUpDownLeftRightBold: '┾',\n\tlineUpBoldDownBoldLeftRight: '╂',\n\tlineUpDownLeftBoldRightBold: '┿',\n\tlineUpBoldDownLeftBoldRight: '╃',\n\tlineUpBoldDownLeftRightBold: '╄',\n\tlineUpDownBoldLeftBoldRight: '╅',\n\tlineUpDownBoldLeftRightBold: '╆',\n\tlineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',\n\tlineUpDoubleDownDoubleLeftRight: '╫',\n\tlineUpDownLeftDoubleRightDouble: '╪',\n\tlineCross: '╳',\n\tlineBackslash: '╲',\n\tlineSlash: '╱',\n};\n\nconst specialMainSymbols = {\n\ttick: '✔',\n\tinfo: 'ℹ',\n\twarning: '⚠',\n\tcross: '✘',\n\tsquareSmall: '◻',\n\tsquareSmallFilled: '◼',\n\tcircle: '◯',\n\tcircleFilled: '◉',\n\tcircleDotted: '◌',\n\tcircleDouble: '◎',\n\tcircleCircle: 'ⓞ',\n\tcircleCross: 'ⓧ',\n\tcirclePipe: 'Ⓘ',\n\tradioOn: '◉',\n\tradioOff: '◯',\n\tcheckboxOn: '☒',\n\tcheckboxOff: '☐',\n\tcheckboxCircleOn: 'ⓧ',\n\tcheckboxCircleOff: 'Ⓘ',\n\tpointer: '❯',\n\ttriangleUpOutline: '△',\n\ttriangleLeft: '◀',\n\ttriangleRight: '▶',\n\tlozenge: '◆',\n\tlozengeOutline: '◇',\n\thamburger: '☰',\n\tsmiley: '㋡',\n\tmustache: '෴',\n\tstar: '★',\n\tplay: '▶',\n\tnodejs: '⬢',\n\toneSeventh: '⅐',\n\toneNinth: '⅑',\n\toneTenth: '⅒',\n};\n\nconst specialFallbackSymbols = {\n\ttick: '√',\n\tinfo: 'i',\n\twarning: '‼',\n\tcross: '×',\n\tsquareSmall: '□',\n\tsquareSmallFilled: '■',\n\tcircle: '( )',\n\tcircleFilled: '(*)',\n\tcircleDotted: '( )',\n\tcircleDouble: '( )',\n\tcircleCircle: '(○)',\n\tcircleCross: '(×)',\n\tcirclePipe: '(│)',\n\tradioOn: '(*)',\n\tradioOff: '( )',\n\tcheckboxOn: '[×]',\n\tcheckboxOff: '[ ]',\n\tcheckboxCircleOn: '(×)',\n\tcheckboxCircleOff: '( )',\n\tpointer: '>',\n\ttriangleUpOutline: '∆',\n\ttriangleLeft: '◄',\n\ttriangleRight: '►',\n\tlozenge: '♦',\n\tlozengeOutline: '◊',\n\thamburger: '≡',\n\tsmiley: '☺',\n\tmustache: '┌─┐',\n\tstar: '✶',\n\tplay: '►',\n\tnodejs: '♦',\n\toneSeventh: '1/7',\n\toneNinth: '1/9',\n\toneTenth: '1/10',\n};\n\nexport const mainSymbols = {...common, ...specialMainSymbols};\nexport const fallbackSymbols = {...common, ...specialFallbackSymbols};\n\nconst shouldUseMain = isUnicodeSupported();\nconst figures = shouldUseMain ? mainSymbols : fallbackSymbols;\nexport default figures;\n\nconst replacements = Object.entries(specialMainSymbols);\n\n// On terminals which do not support Unicode symbols, substitute them to other symbols\nexport const replaceSymbols = (string, {useFallback = !shouldUseMain} = {}) => {\n\tif (useFallback) {\n\t\tfor (const [key, mainSymbol] of replacements) {\n\t\t\tstring = string.replaceAll(mainSymbol, fallbackSymbols[key]);\n\t\t}\n\t}\n\n\treturn string;\n};\n","import tty from 'node:tty';\n\n// eslint-disable-next-line no-warning-comments\n// TODO: Use a better method when it's added to Node.js (https://github.com/nodejs/node/pull/40240)\n// Lots of optionals here to support Deno.\nconst hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;\n\nconst format = (open, close) => {\n\tif (!hasColors) {\n\t\treturn input => input;\n\t}\n\n\tconst openCode = `\\u001B[${open}m`;\n\tconst closeCode = `\\u001B[${close}m`;\n\n\treturn input => {\n\t\tconst string = input + ''; // eslint-disable-line no-implicit-coercion -- This is faster.\n\t\tlet index = string.indexOf(closeCode);\n\n\t\tif (index === -1) {\n\t\t\t// Note: Intentionally not using string interpolation for performance reasons.\n\t\t\treturn openCode + string + closeCode;\n\t\t}\n\n\t\t// Handle nested colors.\n\n\t\t// We could have done this, but it's too slow (as of Node.js 22).\n\t\t// return openCode + string.replaceAll(closeCode, (close === 22 ? closeCode : '') + openCode) + closeCode;\n\n\t\tlet result = openCode;\n\t\tlet lastIndex = 0;\n\n\t\t// SGR 22 resets both bold (1) and dim (2). When we encounter a nested\n\t\t// close for styles that use 22, we need to re-open the outer style.\n\t\tconst reopenOnNestedClose = close === 22;\n\t\tconst replaceCode = (reopenOnNestedClose ? closeCode : '') + openCode;\n\n\t\twhile (index !== -1) {\n\t\t\tresult += string.slice(lastIndex, index) + replaceCode;\n\t\t\tlastIndex = index + closeCode.length;\n\t\t\tindex = string.indexOf(closeCode, lastIndex);\n\t\t}\n\n\t\tresult += string.slice(lastIndex) + closeCode;\n\n\t\treturn result;\n\t};\n};\n\nexport const reset = format(0, 0);\nexport const bold = format(1, 22);\nexport const dim = format(2, 22);\nexport const italic = format(3, 23);\nexport const underline = format(4, 24);\nexport const overline = format(53, 55);\nexport const inverse = format(7, 27);\nexport const hidden = format(8, 28);\nexport const strikethrough = format(9, 29);\n\nexport const black = format(30, 39);\nexport const red = format(31, 39);\nexport const green = format(32, 39);\nexport const yellow = format(33, 39);\nexport const blue = format(34, 39);\nexport const magenta = format(35, 39);\nexport const cyan = format(36, 39);\nexport const white = format(37, 39);\nexport const gray = format(90, 39);\n\nexport const bgBlack = format(40, 49);\nexport const bgRed = format(41, 49);\nexport const bgGreen = format(42, 49);\nexport const bgYellow = format(43, 49);\nexport const bgBlue = format(44, 49);\nexport const bgMagenta = format(45, 49);\nexport const bgCyan = format(46, 49);\nexport const bgWhite = format(47, 49);\nexport const bgGray = format(100, 49);\n\nexport const redBright = format(91, 39);\nexport const greenBright = format(92, 39);\nexport const yellowBright = format(93, 39);\nexport const blueBright = format(94, 39);\nexport const magentaBright = format(95, 39);\nexport const cyanBright = format(96, 39);\nexport const whiteBright = format(97, 39);\n\nexport const bgRedBright = format(101, 49);\nexport const bgGreenBright = format(102, 49);\nexport const bgYellowBright = format(103, 49);\nexport const bgBlueBright = format(104, 49);\nexport const bgMagentaBright = format(105, 49);\nexport const bgCyanBright = format(106, 49);\nexport const bgWhiteBright = format(107, 49);\n","import figures from 'figures';\nimport {\n\tgray,\n\tbold,\n\tredBright,\n\tyellowBright,\n} from 'yoctocolors';\n\n// Default when `verbose` is not a function\nexport const defaultVerboseFunction = ({\n\ttype,\n\tmessage,\n\ttimestamp,\n\tpiped,\n\tcommandId,\n\tresult: {failed = false} = {},\n\toptions: {reject = true},\n}) => {\n\tconst timestampString = serializeTimestamp(timestamp);\n\tconst icon = ICONS[type]({failed, reject, piped});\n\tconst color = COLORS[type]({reject});\n\treturn `${gray(`[${timestampString}]`)} ${gray(`[${commandId}]`)} ${color(icon)} ${color(message)}`;\n};\n\n// Prepending the timestamp allows debugging the slow paths of a subprocess\nconst serializeTimestamp = timestamp => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;\n\nconst padField = (field, padding) => String(field).padStart(padding, '0');\n\nconst getFinalIcon = ({failed, reject}) => {\n\tif (!failed) {\n\t\treturn figures.tick;\n\t}\n\n\treturn reject ? figures.cross : figures.warning;\n};\n\nconst ICONS = {\n\tcommand: ({piped}) => piped ? '|' : '$',\n\toutput: () => ' ',\n\tipc: () => '*',\n\terror: getFinalIcon,\n\tduration: getFinalIcon,\n};\n\nconst identity = string => string;\n\nconst COLORS = {\n\tcommand: () => bold,\n\toutput: () => identity,\n\tipc: () => identity,\n\terror: ({reject}) => reject ? redBright : yellowBright,\n\tduration: () => gray,\n};\n","import {getVerboseFunction} from './values.js';\n\n// Apply the `verbose` function on each line\nexport const applyVerboseOnLines = (printedLines, verboseInfo, fdNumber) => {\n\tconst verboseFunction = getVerboseFunction(verboseInfo, fdNumber);\n\treturn printedLines\n\t\t.map(({verboseLine, verboseObject}) => applyVerboseFunction(verboseLine, verboseObject, verboseFunction))\n\t\t.filter(printedLine => printedLine !== undefined)\n\t\t.map(printedLine => appendNewline(printedLine))\n\t\t.join('');\n};\n\nconst applyVerboseFunction = (verboseLine, verboseObject, verboseFunction) => {\n\tif (verboseFunction === undefined) {\n\t\treturn verboseLine;\n\t}\n\n\tconst printedLine = verboseFunction(verboseLine, verboseObject);\n\tif (typeof printedLine === 'string') {\n\t\treturn printedLine;\n\t}\n};\n\nconst appendNewline = printedLine => printedLine.endsWith('\\n')\n\t? printedLine\n\t: `${printedLine}\\n`;\n","import {inspect} from 'node:util';\nimport {escapeLines} from '../arguments/escape.js';\nimport {defaultVerboseFunction} from './default.js';\nimport {applyVerboseOnLines} from './custom.js';\n\n// This prints on stderr.\n// If the subprocess prints on stdout and is using `stdout: 'inherit'`,\n// there is a chance both writes will compete (introducing a race condition).\n// This means their respective order is not deterministic.\n// In particular, this means the verbose command lines might be after the start of the subprocess output.\n// Using synchronous I/O does not solve this problem.\n// However, this only seems to happen when the stdout/stderr target\n// (e.g. a terminal) is being written to by many subprocesses at once, which is unlikely in real scenarios.\nexport const verboseLog = ({type, verboseMessage, fdNumber, verboseInfo, result}) => {\n\tconst verboseObject = getVerboseObject({type, result, verboseInfo});\n\tconst printedLines = getPrintedLines(verboseMessage, verboseObject);\n\tconst finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);\n\tif (finalLines !== '') {\n\t\tconsole.warn(finalLines.slice(0, -1));\n\t}\n};\n\nconst getVerboseObject = ({\n\ttype,\n\tresult,\n\tverboseInfo: {escapedCommand, commandId, rawOptions: {piped = false, ...options}},\n}) => ({\n\ttype,\n\tescapedCommand,\n\tcommandId: `${commandId}`,\n\ttimestamp: new Date(),\n\tpiped,\n\tresult,\n\toptions,\n});\n\nconst getPrintedLines = (verboseMessage, verboseObject) => verboseMessage\n\t.split('\\n')\n\t.map(message => getPrintedLine({...verboseObject, message}));\n\nconst getPrintedLine = verboseObject => {\n\tconst verboseLine = defaultVerboseFunction(verboseObject);\n\treturn {verboseLine, verboseObject};\n};\n\n// Serialize any type to a line string, for logging\nexport const serializeVerboseMessage = message => {\n\tconst messageString = typeof message === 'string' ? message : inspect(message);\n\tconst escapedMessage = escapeLines(messageString);\n\treturn escapedMessage.replaceAll('\\t', ' '.repeat(TAB_SIZE));\n};\n\n// Same as `util.inspect()`\nconst TAB_SIZE = 2;\n","import {isVerbose} from './values.js';\nimport {verboseLog} from './log.js';\n\n// When `verbose` is `short|full|custom`, print each command\nexport const logCommand = (escapedCommand, verboseInfo) => {\n\tif (!isVerbose(verboseInfo)) {\n\t\treturn;\n\t}\n\n\tverboseLog({\n\t\ttype: 'command',\n\t\tverboseMessage: escapedCommand,\n\t\tverboseInfo,\n\t});\n};\n","import {isVerbose, VERBOSE_VALUES, isVerboseFunction} from './values.js';\n\n// Information computed before spawning, used by the `verbose` option\nexport const getVerboseInfo = (verbose, escapedCommand, rawOptions) => {\n\tvalidateVerbose(verbose);\n\tconst commandId = getCommandId(verbose);\n\treturn {\n\t\tverbose,\n\t\tescapedCommand,\n\t\tcommandId,\n\t\trawOptions,\n\t};\n};\n\nconst getCommandId = verbose => isVerbose({verbose}) ? COMMAND_ID++ : undefined;\n\n// Prepending the `pid` is useful when multiple commands print their output at the same time.\n// However, we cannot use the real PID since this is not available with `child_process.spawnSync()`.\n// Also, we cannot use the real PID if we want to print it before `child_process.spawn()` is run.\n// As a pro, it is shorter than a normal PID and never re-uses the same id.\n// As a con, it cannot be used to send signals.\nlet COMMAND_ID = 0n;\n\nconst validateVerbose = verbose => {\n\tfor (const fdVerbose of verbose) {\n\t\tif (fdVerbose === false) {\n\t\t\tthrow new TypeError('The \"verbose: false\" option was renamed to \"verbose: \\'none\\'\".');\n\t\t}\n\n\t\tif (fdVerbose === true) {\n\t\t\tthrow new TypeError('The \"verbose: true\" option was renamed to \"verbose: \\'short\\'\".');\n\t\t}\n\n\t\tif (!VERBOSE_VALUES.includes(fdVerbose) && !isVerboseFunction(fdVerbose)) {\n\t\t\tconst allowedValues = VERBOSE_VALUES.map(allowedValue => `'${allowedValue}'`).join(', ');\n\t\t\tthrow new TypeError(`The \"verbose\" option must not be ${fdVerbose}. Allowed values are: ${allowedValues} or a function.`);\n\t\t}\n\t}\n};\n","import {hrtime} from 'node:process';\n\n// Start counting time before spawning the subprocess\nexport const getStartTime = () => hrtime.bigint();\n\n// Compute duration after the subprocess ended.\n// Printed by the `verbose` option.\nexport const getDurationMs = startTime => Number(hrtime.bigint() - startTime) / 1e6;\n","import {logCommand} from '../verbose/start.js';\nimport {getVerboseInfo} from '../verbose/info.js';\nimport {getStartTime} from '../return/duration.js';\nimport {joinCommand} from './escape.js';\nimport {normalizeFdSpecificOption} from './specific.js';\n\n// Compute `result.command`, `result.escapedCommand` and `verbose`-related information\nexport const handleCommand = (filePath, rawArguments, rawOptions) => {\n\tconst startTime = getStartTime();\n\tconst {command, escapedCommand} = joinCommand(filePath, rawArguments);\n\tconst verbose = normalizeFdSpecificOption(rawOptions, 'verbose');\n\tconst verboseInfo = getVerboseInfo(verbose, escapedCommand, {...rawOptions});\n\tlogCommand(escapedCommand, verboseInfo);\n\treturn {\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\tverboseInfo,\n\t};\n};\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n","var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n","'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n","'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input\n // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(?=(\\\\+?)?)\\1\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(?=(\\\\+?)?)\\1$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n","'use strict';\nmodule.exports = /^#!(.*)/;\n","'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n","'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n","'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n","'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed);\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n","'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n","export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n","import {promisify} from 'node:util';\nimport {execFile as execFileCallback, execFileSync as execFileSyncOriginal} from 'node:child_process';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nconst execFileOriginal = promisify(execFileCallback);\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport function rootDirectory(pathInput) {\n\treturn path.parse(toPath(pathInput)).root;\n}\n\nexport function traversePathUp(startPath) {\n\treturn {\n\t\t* [Symbol.iterator]() {\n\t\t\tlet currentPath = path.resolve(toPath(startPath));\n\t\t\tlet previousPath;\n\n\t\t\twhile (previousPath !== currentPath) {\n\t\t\t\tyield currentPath;\n\t\t\t\tpreviousPath = currentPath;\n\t\t\t\tcurrentPath = path.resolve(currentPath, '..');\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;\n\nexport async function execFile(file, arguments_, options = {}) {\n\treturn execFileOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\t...options,\n\t});\n}\n\nexport function execFileSync(file, arguments_ = [], options = {}) {\n\treturn execFileSyncOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\tencoding: 'utf8',\n\t\tstdio: 'pipe',\n\t\t...options,\n\t});\n}\n\nexport * from './default.js';\n","import process from 'node:process';\nimport path from 'node:path';\nimport pathKey from 'path-key';\nimport {toPath, traversePathUp} from 'unicorn-magic';\n\nexport const npmRunPath = ({\n\tcwd = process.cwd(),\n\tpath: pathOption = process.env[pathKey()],\n\tpreferLocal = true,\n\texecPath = process.execPath,\n\taddExecPath = true,\n} = {}) => {\n\tconst cwdPath = path.resolve(toPath(cwd));\n\tconst result = [];\n\tconst pathParts = pathOption.split(path.delimiter);\n\n\tif (preferLocal) {\n\t\tapplyPreferLocal(result, pathParts, cwdPath);\n\t}\n\n\tif (addExecPath) {\n\t\tapplyExecPath(result, pathParts, execPath, cwdPath);\n\t}\n\n\treturn pathOption === '' || pathOption === path.delimiter\n\t\t? `${result.join(path.delimiter)}${pathOption}`\n\t\t: [...result, pathOption].join(path.delimiter);\n};\n\nconst applyPreferLocal = (result, pathParts, cwdPath) => {\n\tfor (const directory of traversePathUp(cwdPath)) {\n\t\tconst pathPart = path.join(directory, 'node_modules/.bin');\n\t\tif (!pathParts.includes(pathPart)) {\n\t\t\tresult.push(pathPart);\n\t\t}\n\t}\n};\n\n// Ensure the running `node` binary is used\nconst applyExecPath = (result, pathParts, execPath, cwdPath) => {\n\tconst pathPart = path.resolve(cwdPath, toPath(execPath), '..');\n\tif (!pathParts.includes(pathPart)) {\n\t\tresult.push(pathPart);\n\t}\n};\n\nexport const npmRunPathEnv = ({env = process.env, ...options} = {}) => {\n\tenv = {...env};\n\n\tconst pathName = pathKey({env});\n\toptions.path = env[pathName];\n\tenv[pathName] = npmRunPath(options);\n\n\treturn env;\n};\n","// When the subprocess fails, this is the error instance being returned.\n// If another error instance is being thrown, it is kept as `error.cause`.\nexport const getFinalError = (originalError, message, isSync) => {\n\tconst ErrorClass = isSync ? ExecaSyncError : ExecaError;\n\tconst options = originalError instanceof DiscardedError ? {} : {cause: originalError};\n\treturn new ErrorClass(message, options);\n};\n\n// Indicates that the error is used only to interrupt control flow, but not in the return value\nexport class DiscardedError extends Error {}\n\n// Proper way to set `error.name`: it should be inherited and non-enumerable\nconst setErrorName = (ErrorClass, value) => {\n\tObject.defineProperty(ErrorClass.prototype, 'name', {\n\t\tvalue,\n\t\twritable: true,\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t});\n\tObject.defineProperty(ErrorClass.prototype, execaErrorSymbol, {\n\t\tvalue: true,\n\t\twritable: false,\n\t\tenumerable: false,\n\t\tconfigurable: false,\n\t});\n};\n\n// Unlike `instanceof`, this works across realms\nexport const isExecaError = error => isErrorInstance(error) && execaErrorSymbol in error;\n\nconst execaErrorSymbol = Symbol('isExecaError');\n\nexport const isErrorInstance = value => Object.prototype.toString.call(value) === '[object Error]';\n\n// We use two different Error classes for async/sync methods since they have slightly different shape and types\nexport class ExecaError extends Error {}\nsetErrorName(ExecaError, ExecaError.name);\n\nexport class ExecaSyncError extends Error {}\nsetErrorName(ExecaSyncError, ExecaSyncError.name);\n","\nexport const getRealtimeSignals=()=>{\nconst length=SIGRTMAX-SIGRTMIN+1;\nreturn Array.from({length},getRealtimeSignal)\n};\n\nconst getRealtimeSignal=(value,index)=>({\nname:`SIGRT${index+1}`,\nnumber:SIGRTMIN+index,\naction:\"terminate\",\ndescription:\"Application-specific signal (realtime)\",\nstandard:\"posix\"\n});\n\nconst SIGRTMIN=34;\nexport const SIGRTMAX=64;","\n\nexport const SIGNALS=[\n{\nname:\"SIGHUP\",\nnumber:1,\naction:\"terminate\",\ndescription:\"Terminal closed\",\nstandard:\"posix\"\n},\n{\nname:\"SIGINT\",\nnumber:2,\naction:\"terminate\",\ndescription:\"User interruption with CTRL-C\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGQUIT\",\nnumber:3,\naction:\"core\",\ndescription:\"User interruption with CTRL-\\\\\",\nstandard:\"posix\"\n},\n{\nname:\"SIGILL\",\nnumber:4,\naction:\"core\",\ndescription:\"Invalid machine instruction\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGTRAP\",\nnumber:5,\naction:\"core\",\ndescription:\"Debugger breakpoint\",\nstandard:\"posix\"\n},\n{\nname:\"SIGABRT\",\nnumber:6,\naction:\"core\",\ndescription:\"Aborted\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGIOT\",\nnumber:6,\naction:\"core\",\ndescription:\"Aborted\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGBUS\",\nnumber:7,\naction:\"core\",\ndescription:\n\"Bus error due to misaligned, non-existing address or paging error\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGEMT\",\nnumber:7,\naction:\"terminate\",\ndescription:\"Command should be emulated but is not implemented\",\nstandard:\"other\"\n},\n{\nname:\"SIGFPE\",\nnumber:8,\naction:\"core\",\ndescription:\"Floating point arithmetic error\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGKILL\",\nnumber:9,\naction:\"terminate\",\ndescription:\"Forced termination\",\nstandard:\"posix\",\nforced:true\n},\n{\nname:\"SIGUSR1\",\nnumber:10,\naction:\"terminate\",\ndescription:\"Application-specific signal\",\nstandard:\"posix\"\n},\n{\nname:\"SIGSEGV\",\nnumber:11,\naction:\"core\",\ndescription:\"Segmentation fault\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGUSR2\",\nnumber:12,\naction:\"terminate\",\ndescription:\"Application-specific signal\",\nstandard:\"posix\"\n},\n{\nname:\"SIGPIPE\",\nnumber:13,\naction:\"terminate\",\ndescription:\"Broken pipe or socket\",\nstandard:\"posix\"\n},\n{\nname:\"SIGALRM\",\nnumber:14,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"posix\"\n},\n{\nname:\"SIGTERM\",\nnumber:15,\naction:\"terminate\",\ndescription:\"Termination\",\nstandard:\"ansi\"\n},\n{\nname:\"SIGSTKFLT\",\nnumber:16,\naction:\"terminate\",\ndescription:\"Stack is empty or overflowed\",\nstandard:\"other\"\n},\n{\nname:\"SIGCHLD\",\nnumber:17,\naction:\"ignore\",\ndescription:\"Child process terminated, paused or unpaused\",\nstandard:\"posix\"\n},\n{\nname:\"SIGCLD\",\nnumber:17,\naction:\"ignore\",\ndescription:\"Child process terminated, paused or unpaused\",\nstandard:\"other\"\n},\n{\nname:\"SIGCONT\",\nnumber:18,\naction:\"unpause\",\ndescription:\"Unpaused\",\nstandard:\"posix\",\nforced:true\n},\n{\nname:\"SIGSTOP\",\nnumber:19,\naction:\"pause\",\ndescription:\"Paused\",\nstandard:\"posix\",\nforced:true\n},\n{\nname:\"SIGTSTP\",\nnumber:20,\naction:\"pause\",\ndescription:\"Paused using CTRL-Z or \\\"suspend\\\"\",\nstandard:\"posix\"\n},\n{\nname:\"SIGTTIN\",\nnumber:21,\naction:\"pause\",\ndescription:\"Background process cannot read terminal input\",\nstandard:\"posix\"\n},\n{\nname:\"SIGBREAK\",\nnumber:21,\naction:\"terminate\",\ndescription:\"User interruption with CTRL-BREAK\",\nstandard:\"other\"\n},\n{\nname:\"SIGTTOU\",\nnumber:22,\naction:\"pause\",\ndescription:\"Background process cannot write to terminal output\",\nstandard:\"posix\"\n},\n{\nname:\"SIGURG\",\nnumber:23,\naction:\"ignore\",\ndescription:\"Socket received out-of-band data\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGXCPU\",\nnumber:24,\naction:\"core\",\ndescription:\"Process timed out\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGXFSZ\",\nnumber:25,\naction:\"core\",\ndescription:\"File too big\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGVTALRM\",\nnumber:26,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGPROF\",\nnumber:27,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGWINCH\",\nnumber:28,\naction:\"ignore\",\ndescription:\"Terminal window size changed\",\nstandard:\"bsd\"\n},\n{\nname:\"SIGIO\",\nnumber:29,\naction:\"terminate\",\ndescription:\"I/O is available\",\nstandard:\"other\"\n},\n{\nname:\"SIGPOLL\",\nnumber:29,\naction:\"terminate\",\ndescription:\"Watched event\",\nstandard:\"other\"\n},\n{\nname:\"SIGINFO\",\nnumber:29,\naction:\"ignore\",\ndescription:\"Request for process information\",\nstandard:\"other\"\n},\n{\nname:\"SIGPWR\",\nnumber:30,\naction:\"terminate\",\ndescription:\"Device running out of power\",\nstandard:\"systemv\"\n},\n{\nname:\"SIGSYS\",\nnumber:31,\naction:\"core\",\ndescription:\"Invalid system call\",\nstandard:\"other\"\n},\n{\nname:\"SIGUNUSED\",\nnumber:31,\naction:\"terminate\",\ndescription:\"Invalid system call\",\nstandard:\"other\"\n}];","import{constants}from\"node:os\";\n\nimport{SIGNALS}from\"./core.js\";\nimport{getRealtimeSignals}from\"./realtime.js\";\n\n\n\nexport const getSignals=()=>{\nconst realtimeSignals=getRealtimeSignals();\nconst signals=[...SIGNALS,...realtimeSignals].map(normalizeSignal);\nreturn signals\n};\n\n\n\n\n\n\n\nconst normalizeSignal=({\nname,\nnumber:defaultNumber,\ndescription,\naction,\nforced=false,\nstandard\n})=>{\nconst{\nsignals:{[name]:constantSignal}\n}=constants;\nconst supported=constantSignal!==undefined;\nconst number=supported?constantSignal:defaultNumber;\nreturn{name,number,description,supported,action,forced,standard}\n};","import{constants}from\"node:os\";\n\nimport{SIGRTMAX}from\"./realtime.js\";\nimport{getSignals}from\"./signals.js\";\n\n\n\nconst getSignalsByName=()=>{\nconst signals=getSignals();\nreturn Object.fromEntries(signals.map(getSignalByName))\n};\n\nconst getSignalByName=({\nname,\nnumber,\ndescription,\nsupported,\naction,\nforced,\nstandard\n})=>[name,{name,number,description,supported,action,forced,standard}];\n\nexport const signalsByName=getSignalsByName();\n\n\n\n\nconst getSignalsByNumber=()=>{\nconst signals=getSignals();\nconst length=SIGRTMAX+1;\nconst signalsA=Array.from({length},(value,number)=>\ngetSignalByNumber(number,signals)\n);\nreturn Object.assign({},...signalsA)\n};\n\nconst getSignalByNumber=(number,signals)=>{\nconst signal=findSignalByNumber(number,signals);\n\nif(signal===undefined){\nreturn{}\n}\n\nconst{name,description,supported,action,forced,standard}=signal;\nreturn{\n[number]:{\nname,\nnumber,\ndescription,\nsupported,\naction,\nforced,\nstandard\n}\n}\n};\n\n\n\nconst findSignalByNumber=(number,signals)=>{\nconst signal=signals.find(({name})=>constants.signals[name]===number);\n\nif(signal!==undefined){\nreturn signal\n}\n\nreturn signals.find((signalA)=>signalA.number===number)\n};\n\nexport const signalsByNumber=getSignalsByNumber();","import {constants} from 'node:os';\nimport {signalsByName} from 'human-signals';\n\n// Normalize signals for comparison purpose.\n// Also validate the signal exists.\nexport const normalizeKillSignal = killSignal => {\n\tconst optionName = 'option `killSignal`';\n\tif (killSignal === 0) {\n\t\tthrow new TypeError(`Invalid ${optionName}: 0 cannot be used.`);\n\t}\n\n\treturn normalizeSignal(killSignal, optionName);\n};\n\nexport const normalizeSignalArgument = signal => signal === 0\n\t? signal\n\t: normalizeSignal(signal, '`subprocess.kill()`\\'s argument');\n\nconst normalizeSignal = (signalNameOrInteger, optionName) => {\n\tif (Number.isInteger(signalNameOrInteger)) {\n\t\treturn normalizeSignalInteger(signalNameOrInteger, optionName);\n\t}\n\n\tif (typeof signalNameOrInteger === 'string') {\n\t\treturn normalizeSignalName(signalNameOrInteger, optionName);\n\t}\n\n\tthrow new TypeError(`Invalid ${optionName} ${String(signalNameOrInteger)}: it must be a string or an integer.\\n${getAvailableSignals()}`);\n};\n\nconst normalizeSignalInteger = (signalInteger, optionName) => {\n\tif (signalsIntegerToName.has(signalInteger)) {\n\t\treturn signalsIntegerToName.get(signalInteger);\n\t}\n\n\tthrow new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist.\\n${getAvailableSignals()}`);\n};\n\nconst getSignalsIntegerToName = () => new Map(Object.entries(constants.signals)\n\t.reverse()\n\t.map(([signalName, signalInteger]) => [signalInteger, signalName]));\n\nconst signalsIntegerToName = getSignalsIntegerToName();\n\nconst normalizeSignalName = (signalName, optionName) => {\n\tif (signalName in constants.signals) {\n\t\treturn signalName;\n\t}\n\n\tif (signalName.toUpperCase() in constants.signals) {\n\t\tthrow new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`);\n\t}\n\n\tthrow new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist.\\n${getAvailableSignals()}`);\n};\n\nconst getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}.\nAvailable signal numbers: ${getAvailableSignalIntegers()}.`;\n\nconst getAvailableSignalNames = () => Object.keys(constants.signals)\n\t.sort()\n\t.map(signalName => `'${signalName}'`)\n\t.join(', ');\n\nconst getAvailableSignalIntegers = () => [...new Set(Object.values(constants.signals)\n\t.sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))]\n\t.join(', ');\n\n// Human-friendly description of a signal\nexport const getSignalDescription = signal => signalsByName[signal].description;\n","import {setTimeout} from 'node:timers/promises';\nimport {isErrorInstance} from '../return/final-error.js';\nimport {normalizeSignalArgument} from './signal.js';\n\n// Normalize the `forceKillAfterDelay` option\nexport const normalizeForceKillAfterDelay = forceKillAfterDelay => {\n\tif (forceKillAfterDelay === false) {\n\t\treturn forceKillAfterDelay;\n\t}\n\n\tif (forceKillAfterDelay === true) {\n\t\treturn DEFAULT_FORCE_KILL_TIMEOUT;\n\t}\n\n\tif (!Number.isFinite(forceKillAfterDelay) || forceKillAfterDelay < 0) {\n\t\tthrow new TypeError(`Expected the \\`forceKillAfterDelay\\` option to be a non-negative integer, got \\`${forceKillAfterDelay}\\` (${typeof forceKillAfterDelay})`);\n\t}\n\n\treturn forceKillAfterDelay;\n};\n\nconst DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;\n\n// Monkey-patches `subprocess.kill()` to add `forceKillAfterDelay` behavior and `.kill(error)`\nexport const subprocessKill = (\n\t{kill, options: {forceKillAfterDelay, killSignal}, onInternalError, context, controller},\n\tsignalOrError,\n\terrorArgument,\n) => {\n\tconst {signal, error} = parseKillArguments(signalOrError, errorArgument, killSignal);\n\temitKillError(error, onInternalError);\n\tconst killResult = kill(signal);\n\tsetKillTimeout({\n\t\tkill,\n\t\tsignal,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t\tkillResult,\n\t\tcontext,\n\t\tcontroller,\n\t});\n\treturn killResult;\n};\n\nconst parseKillArguments = (signalOrError, errorArgument, killSignal) => {\n\tconst [signal = killSignal, error] = isErrorInstance(signalOrError)\n\t\t? [undefined, signalOrError]\n\t\t: [signalOrError, errorArgument];\n\n\tif (typeof signal !== 'string' && !Number.isInteger(signal)) {\n\t\tthrow new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(signal)}`);\n\t}\n\n\tif (error !== undefined && !isErrorInstance(error)) {\n\t\tthrow new TypeError(`The second argument is optional. If specified, it must be an error instance: ${error}`);\n\t}\n\n\treturn {signal: normalizeSignalArgument(signal), error};\n};\n\n// Fails right away when calling `subprocess.kill(error)`.\n// Does not wait for actual signal termination.\n// Uses a deferred promise instead of the `error` event on the subprocess, as this is less intrusive.\nconst emitKillError = (error, onInternalError) => {\n\tif (error !== undefined) {\n\t\tonInternalError.reject(error);\n\t}\n};\n\nconst setKillTimeout = async ({kill, signal, forceKillAfterDelay, killSignal, killResult, context, controller}) => {\n\tif (signal === killSignal && killResult) {\n\t\tkillOnTimeout({\n\t\t\tkill,\n\t\t\tforceKillAfterDelay,\n\t\t\tcontext,\n\t\t\tcontrollerSignal: controller.signal,\n\t\t});\n\t}\n};\n\n// Forcefully terminate a subprocess after a timeout\nexport const killOnTimeout = async ({kill, forceKillAfterDelay, context, controllerSignal}) => {\n\tif (forceKillAfterDelay === false) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait setTimeout(forceKillAfterDelay, undefined, {signal: controllerSignal});\n\t\tif (kill('SIGKILL')) {\n\t\t\tcontext.isForcefullyTerminated ??= true;\n\t\t}\n\t} catch {}\n};\n","import {once} from 'node:events';\n\n// Combines `util.aborted()` and `events.addAbortListener()`: promise-based and cleaned up with a stop signal\nexport const onAbortedSignal = async (mainSignal, stopSignal) => {\n\tif (!mainSignal.aborted) {\n\t\tawait once(mainSignal, 'abort', {signal: stopSignal});\n\t}\n};\n","import {onAbortedSignal} from '../utils/abort-signal.js';\n\n// Validate the `cancelSignal` option\nexport const validateCancelSignal = ({cancelSignal}) => {\n\tif (cancelSignal !== undefined && Object.prototype.toString.call(cancelSignal) !== '[object AbortSignal]') {\n\t\tthrow new Error(`The \\`cancelSignal\\` option must be an AbortSignal: ${String(cancelSignal)}`);\n\t}\n};\n\n// Terminate the subprocess when aborting the `cancelSignal` option and `gracefulSignal` is `false`\nexport const throwOnCancel = ({subprocess, cancelSignal, gracefulCancel, context, controller}) => cancelSignal === undefined || gracefulCancel\n\t? []\n\t: [terminateOnCancel(subprocess, cancelSignal, context, controller)];\n\nconst terminateOnCancel = async (subprocess, cancelSignal, context, {signal}) => {\n\tawait onAbortedSignal(cancelSignal, signal);\n\tcontext.terminationReason ??= 'cancel';\n\tsubprocess.kill();\n\tthrow cancelSignal.reason;\n};\n","// Validate the IPC channel is connected before receiving/sending messages\nexport const validateIpcMethod = ({methodName, isSubprocess, ipc, isConnected}) => {\n\tvalidateIpcOption(methodName, isSubprocess, ipc);\n\tvalidateConnection(methodName, isSubprocess, isConnected);\n};\n\n// Better error message when forgetting to set `ipc: true` and using the IPC methods\nconst validateIpcOption = (methodName, isSubprocess, ipc) => {\n\tif (!ipc) {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)} can only be used if the \\`ipc\\` option is \\`true\\`.`);\n\t}\n};\n\n// Better error message when one process does not send/receive messages once the other process has disconnected.\n// This also makes it clear that any buffered messages are lost once either process has disconnected.\n// Also when aborting `cancelSignal` after disconnecting the IPC.\nexport const validateConnection = (methodName, isSubprocess, isConnected) => {\n\tif (!isConnected) {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} has already exited or disconnected.`);\n\t}\n};\n\n// When `getOneMessage()` could not complete due to an early disconnection\nexport const throwOnEarlyDisconnect = isSubprocess => {\n\tthrow new Error(`${getMethodName('getOneMessage', isSubprocess)} could not complete: the ${getOtherProcessName(isSubprocess)} exited or disconnected.`);\n};\n\n// When both processes use `sendMessage()` with `strict` at the same time\nexport const throwOnStrictDeadlockError = isSubprocess => {\n\tthrow new Error(`${getMethodName('sendMessage', isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${getMethodName('getOneMessage', isSubprocess)},\n\t${getMethodName('sendMessage', isSubprocess, 'message, {strict: true}')},\n]);`);\n};\n\n// When the other process used `strict` but the current process had I/O error calling `sendMessage()` for the response\nexport const getStrictResponseError = (error, isSubprocess) => new Error(`${getMethodName('sendMessage', isSubprocess)} failed when sending an acknowledgment response to the ${getOtherProcessName(isSubprocess)}.`, {cause: error});\n\n// When using `strict` but the other process was not listening for messages\nexport const throwOnMissingStrict = isSubprocess => {\n\tthrow new Error(`${getMethodName('sendMessage', isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is not listening to incoming messages.`);\n};\n\n// When using `strict` but the other process disconnected before receiving the message\nexport const throwOnStrictDisconnect = isSubprocess => {\n\tthrow new Error(`${getMethodName('sendMessage', isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} exited without listening to incoming messages.`);\n};\n\n// When the current process disconnects while the subprocess is listening to `cancelSignal`\nexport const getAbortDisconnectError = () => new Error(`\\`cancelSignal\\` aborted: the ${getOtherProcessName(true)} disconnected.`);\n\n// When the subprocess uses `cancelSignal` but not the current process\nexport const throwOnMissingParent = () => {\n\tthrow new Error('`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.');\n};\n\n// EPIPE can happen when sending a message to a subprocess that is closing but has not disconnected yet\nexport const handleEpipeError = ({error, methodName, isSubprocess}) => {\n\tif (error.code === 'EPIPE') {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} is disconnecting.`, {cause: error});\n\t}\n};\n\n// Better error message when sending messages which cannot be serialized.\n// Works with both `serialization: 'advanced'` and `serialization: 'json'`.\nexport const handleSerializationError = ({error, methodName, isSubprocess, message}) => {\n\tif (isSerializationError(error)) {\n\t\tthrow new Error(`${getMethodName(methodName, isSubprocess)}'s argument type is invalid: the message cannot be serialized: ${String(message)}.`, {cause: error});\n\t}\n};\n\nconst isSerializationError = ({code, message}) => SERIALIZATION_ERROR_CODES.has(code)\n\t|| SERIALIZATION_ERROR_MESSAGES.some(serializationErrorMessage => message.includes(serializationErrorMessage));\n\n// `error.code` set by Node.js when it failed to serialize the message\nconst SERIALIZATION_ERROR_CODES = new Set([\n\t// Message is `undefined`\n\t'ERR_MISSING_ARGS',\n\t// Message is a function, a bigint, a symbol\n\t'ERR_INVALID_ARG_TYPE',\n]);\n\n// `error.message` set by Node.js when it failed to serialize the message\nconst SERIALIZATION_ERROR_MESSAGES = [\n\t// Message is a promise or a proxy, with `serialization: 'advanced'`\n\t'could not be cloned',\n\t// Message has cycles, with `serialization: 'json'`\n\t'circular structure',\n\t// Message has cycles inside toJSON(), with `serialization: 'json'`\n\t'call stack size exceeded',\n];\n\nconst getMethodName = (methodName, isSubprocess, parameters = '') => methodName === 'cancelSignal'\n\t? '`cancelSignal`\\'s `controller.abort()`'\n\t: `${getNamespaceName(isSubprocess)}${methodName}(${parameters})`;\n\nconst getNamespaceName = isSubprocess => isSubprocess ? '' : 'subprocess.';\n\nconst getOtherProcessName = isSubprocess => isSubprocess ? 'parent process' : 'subprocess';\n\n// When any error arises, we disconnect the IPC.\n// Otherwise, it is likely that one of the processes will stop sending/receiving messages.\n// This would leave the other process hanging.\nexport const disconnect = anyProcess => {\n\tif (anyProcess.connected) {\n\t\tanyProcess.disconnect();\n\t}\n};\n","export const createDeferred = () => {\n\tconst methods = {};\n\tconst promise = new Promise((resolve, reject) => {\n\t\tObject.assign(methods, {resolve, reject});\n\t});\n\treturn Object.assign(promise, methods);\n};\n","import {parseFd} from './specific.js';\n\n// Retrieve stream targeted by the `to` option\nexport const getToStream = (destination, to = 'stdin') => {\n\tconst isWritable = true;\n\tconst {options, fileDescriptors} = SUBPROCESS_OPTIONS.get(destination);\n\tconst fdNumber = getFdNumber(fileDescriptors, to, isWritable);\n\tconst destinationStream = destination.stdio[fdNumber];\n\n\tif (destinationStream === null) {\n\t\tthrow new TypeError(getInvalidStdioOptionMessage(fdNumber, to, options, isWritable));\n\t}\n\n\treturn destinationStream;\n};\n\n// Retrieve stream targeted by the `from` option\nexport const getFromStream = (source, from = 'stdout') => {\n\tconst isWritable = false;\n\tconst {options, fileDescriptors} = SUBPROCESS_OPTIONS.get(source);\n\tconst fdNumber = getFdNumber(fileDescriptors, from, isWritable);\n\tconst sourceStream = fdNumber === 'all' ? source.all : source.stdio[fdNumber];\n\n\tif (sourceStream === null || sourceStream === undefined) {\n\t\tthrow new TypeError(getInvalidStdioOptionMessage(fdNumber, from, options, isWritable));\n\t}\n\n\treturn sourceStream;\n};\n\n// Keeps track of the options passed to each Execa call\nexport const SUBPROCESS_OPTIONS = new WeakMap();\n\nconst getFdNumber = (fileDescriptors, fdName, isWritable) => {\n\tconst fdNumber = parseFdNumber(fdName, isWritable);\n\tvalidateFdNumber(fdNumber, fdName, isWritable, fileDescriptors);\n\treturn fdNumber;\n};\n\nconst parseFdNumber = (fdName, isWritable) => {\n\tconst fdNumber = parseFd(fdName);\n\tif (fdNumber !== undefined) {\n\t\treturn fdNumber;\n\t}\n\n\tconst {validOptions, defaultValue} = isWritable\n\t\t? {validOptions: '\"stdin\"', defaultValue: 'stdin'}\n\t\t: {validOptions: '\"stdout\", \"stderr\", \"all\"', defaultValue: 'stdout'};\n\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be \"${fdName}\".\nIt must be ${validOptions} or \"fd3\", \"fd4\" (and so on).\nIt is optional and defaults to \"${defaultValue}\".`);\n};\n\nconst validateFdNumber = (fdNumber, fdName, isWritable, fileDescriptors) => {\n\tconst fileDescriptor = fileDescriptors[getUsedDescriptor(fdNumber)];\n\tif (fileDescriptor === undefined) {\n\t\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be ${fdName}. That file descriptor does not exist.\nPlease set the \"stdio\" option to ensure that file descriptor exists.`);\n\t}\n\n\tif (fileDescriptor.direction === 'input' && !isWritable) {\n\t\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be ${fdName}. It must be a readable stream, not writable.`);\n\t}\n\n\tif (fileDescriptor.direction !== 'input' && isWritable) {\n\t\tthrow new TypeError(`\"${getOptionName(isWritable)}\" must not be ${fdName}. It must be a writable stream, not readable.`);\n\t}\n};\n\nconst getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) => {\n\tif (fdNumber === 'all' && !options.all) {\n\t\treturn 'The \"all\" option must be true to use \"from: \\'all\\'\".';\n\t}\n\n\tconst {optionName, optionValue} = getInvalidStdioOption(fdNumber, options);\n\treturn `The \"${optionName}: ${serializeOptionValue(optionValue)}\" option is incompatible with using \"${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}\".\nPlease set this option with \"pipe\" instead.`;\n};\n\nconst getInvalidStdioOption = (fdNumber, {stdin, stdout, stderr, stdio}) => {\n\tconst usedDescriptor = getUsedDescriptor(fdNumber);\n\n\tif (usedDescriptor === 0 && stdin !== undefined) {\n\t\treturn {optionName: 'stdin', optionValue: stdin};\n\t}\n\n\tif (usedDescriptor === 1 && stdout !== undefined) {\n\t\treturn {optionName: 'stdout', optionValue: stdout};\n\t}\n\n\tif (usedDescriptor === 2 && stderr !== undefined) {\n\t\treturn {optionName: 'stderr', optionValue: stderr};\n\t}\n\n\treturn {optionName: `stdio[${usedDescriptor}]`, optionValue: stdio[usedDescriptor]};\n};\n\nconst getUsedDescriptor = fdNumber => fdNumber === 'all' ? 1 : fdNumber;\n\nconst getOptionName = isWritable => isWritable ? 'to' : 'from';\n\nexport const serializeOptionValue = value => {\n\tif (typeof value === 'string') {\n\t\treturn `'${value}'`;\n\t}\n\n\treturn typeof value === 'number' ? `${value}` : 'Stream';\n};\n","import {addAbortListener} from 'node:events';\n\n// Temporarily increase the maximum number of listeners on an eventEmitter\nexport const incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => {\n\tconst maxListeners = eventEmitter.getMaxListeners();\n\tif (maxListeners === 0 || maxListeners === Number.POSITIVE_INFINITY) {\n\t\treturn;\n\t}\n\n\teventEmitter.setMaxListeners(maxListeners + maxListenersIncrement);\n\taddAbortListener(signal, () => {\n\t\teventEmitter.setMaxListeners(eventEmitter.getMaxListeners() - maxListenersIncrement);\n\t});\n};\n","// By default, Node.js keeps the subprocess alive while it has a `message` or `disconnect` listener.\n// We replicate the same logic for the events that we proxy.\n// This ensures the subprocess is kept alive while `getOneMessage()` and `getEachMessage()` are ongoing.\n// This is not a problem with `sendMessage()` since Node.js handles that method automatically.\n// We do not use `anyProcess.channel.ref()` since this would prevent the automatic `.channel.refCounted()` Node.js is doing.\n// We keep a reference to `anyProcess.channel` since it might be `null` while `getOneMessage()` or `getEachMessage()` is still processing debounced messages.\n// See https://github.com/nodejs/node/blob/2aaeaa863c35befa2ebaa98fb7737ec84df4d8e9/lib/internal/child_process.js#L547\nexport const addReference = (channel, reference) => {\n\tif (reference) {\n\t\taddReferenceCount(channel);\n\t}\n};\n\nconst addReferenceCount = channel => {\n\tchannel.refCounted();\n};\n\nexport const removeReference = (channel, reference) => {\n\tif (reference) {\n\t\tremoveReferenceCount(channel);\n\t}\n};\n\nconst removeReferenceCount = channel => {\n\tchannel.unrefCounted();\n};\n\n// To proxy events, we setup some global listeners on the `message` and `disconnect` events.\n// Those should not keep the subprocess alive, so we remove the automatic counting that Node.js is doing.\n// See https://github.com/nodejs/node/blob/1b965270a9c273d4cf70e8808e9d28b9ada7844f/lib/child_process.js#L180\nexport const undoAddedReferences = (channel, isSubprocess) => {\n\tif (isSubprocess) {\n\t\tremoveReferenceCount(channel);\n\t\tremoveReferenceCount(channel);\n\t}\n};\n\n// Reverse it during `disconnect`\nexport const redoAddedReferences = (channel, isSubprocess) => {\n\tif (isSubprocess) {\n\t\taddReferenceCount(channel);\n\t\taddReferenceCount(channel);\n\t}\n};\n","import {once} from 'node:events';\nimport {scheduler} from 'node:timers/promises';\nimport {waitForOutgoingMessages} from './outgoing.js';\nimport {redoAddedReferences} from './reference.js';\nimport {handleStrictRequest, handleStrictResponse} from './strict.js';\nimport {handleAbort, abortOnDisconnect} from './graceful.js';\n\n// By default, Node.js buffers `message` events.\n// - Buffering happens when there is a `message` event is emitted but there is no handler.\n// - As soon as a `message` event handler is set, all buffered `message` events are emitted, emptying the buffer.\n// - This happens both in the current process and the subprocess.\n// - See https://github.com/nodejs/node/blob/501546e8f37059cd577041e23941b640d0d4d406/lib/internal/child_process.js#L719\n// This is helpful. Notably, this allows sending messages to a subprocess that's still initializing.\n// However, it has several problems.\n// - This works with `events.on()` but not `events.once()` since all buffered messages are emitted at once.\n// For example, users cannot call `await getOneMessage()`/`getEachMessage()` multiple times in a row.\n// - When a user intentionally starts listening to `message` at a specific point in time, past `message` events are replayed, which might be unexpected.\n// - Buffering is unlimited, which might lead to an out-of-memory crash.\n// - This does not work well with multiple consumers.\n// For example, Execa consumes events with both `result.ipcOutput` and manual IPC calls like `getOneMessage()`.\n// Since `result.ipcOutput` reads all incoming messages, no buffering happens for manual IPC calls.\n// - Forgetting to setup a `message` listener, or setting it up too late, is a programming mistake.\n// The default behavior does not allow users to realize they made that mistake.\n// To solve those problems, instead of buffering messages, we debounce them.\n// The `message` event so it is emitted at most once per macrotask.\nexport const onMessage = async ({anyProcess, channel, isSubprocess, ipcEmitter}, wrappedMessage) => {\n\tif (handleStrictResponse(wrappedMessage) || handleAbort(wrappedMessage)) {\n\t\treturn;\n\t}\n\n\tif (!INCOMING_MESSAGES.has(anyProcess)) {\n\t\tINCOMING_MESSAGES.set(anyProcess, []);\n\t}\n\n\tconst incomingMessages = INCOMING_MESSAGES.get(anyProcess);\n\tincomingMessages.push(wrappedMessage);\n\n\tif (incomingMessages.length > 1) {\n\t\treturn;\n\t}\n\n\twhile (incomingMessages.length > 0) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait waitForOutgoingMessages(anyProcess, ipcEmitter, wrappedMessage);\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait scheduler.yield();\n\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst message = await handleStrictRequest({\n\t\t\twrappedMessage: incomingMessages[0],\n\t\t\tanyProcess,\n\t\t\tchannel,\n\t\t\tisSubprocess,\n\t\t\tipcEmitter,\n\t\t});\n\n\t\tincomingMessages.shift();\n\t\tipcEmitter.emit('message', message);\n\t\tipcEmitter.emit('message:done');\n\t}\n};\n\n// If the `message` event is currently debounced, the `disconnect` event must wait for it\nexport const onDisconnect = async ({anyProcess, channel, isSubprocess, ipcEmitter, boundOnMessage}) => {\n\tabortOnDisconnect();\n\n\tconst incomingMessages = INCOMING_MESSAGES.get(anyProcess);\n\twhile (incomingMessages?.length > 0) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait once(ipcEmitter, 'message:done');\n\t}\n\n\tanyProcess.removeListener('message', boundOnMessage);\n\tredoAddedReferences(channel, isSubprocess);\n\tipcEmitter.connected = false;\n\tipcEmitter.emit('disconnect');\n};\n\nconst INCOMING_MESSAGES = new WeakMap();\n","import {EventEmitter} from 'node:events';\nimport {onMessage, onDisconnect} from './incoming.js';\nimport {undoAddedReferences} from './reference.js';\n\n// Forward the `message` and `disconnect` events from the process and subprocess to a proxy emitter.\n// This prevents the `error` event from stopping IPC.\n// This also allows debouncing the `message` event.\nexport const getIpcEmitter = (anyProcess, channel, isSubprocess) => {\n\tif (IPC_EMITTERS.has(anyProcess)) {\n\t\treturn IPC_EMITTERS.get(anyProcess);\n\t}\n\n\t// Use an `EventEmitter`, like the `process` that is being proxied\n\t// eslint-disable-next-line unicorn/prefer-event-target\n\tconst ipcEmitter = new EventEmitter();\n\tipcEmitter.connected = true;\n\tIPC_EMITTERS.set(anyProcess, ipcEmitter);\n\tforwardEvents({\n\t\tipcEmitter,\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t});\n\treturn ipcEmitter;\n};\n\nconst IPC_EMITTERS = new WeakMap();\n\n// The `message` and `disconnect` events are buffered in the subprocess until the first listener is setup.\n// However, unbuffering happens after one tick, so this give enough time for the caller to setup the listener on the proxy emitter first.\n// See https://github.com/nodejs/node/blob/2aaeaa863c35befa2ebaa98fb7737ec84df4d8e9/lib/internal/child_process.js#L721\nconst forwardEvents = ({ipcEmitter, anyProcess, channel, isSubprocess}) => {\n\tconst boundOnMessage = onMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tipcEmitter,\n\t});\n\tanyProcess.on('message', boundOnMessage);\n\tanyProcess.once('disconnect', onDisconnect.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tipcEmitter,\n\t\tboundOnMessage,\n\t}));\n\tundoAddedReferences(channel, isSubprocess);\n};\n\n// Check whether there might still be some `message` events to receive\nexport const isConnected = anyProcess => {\n\tconst ipcEmitter = IPC_EMITTERS.get(anyProcess);\n\treturn ipcEmitter === undefined\n\t\t? anyProcess.channel !== null\n\t\t: ipcEmitter.connected;\n};\n","import {once} from 'node:events';\nimport {createDeferred} from '../utils/deferred.js';\nimport {incrementMaxListeners} from '../utils/max-listeners.js';\nimport {sendMessage} from './send.js';\nimport {throwOnMissingStrict, throwOnStrictDisconnect, throwOnStrictDeadlockError} from './validation.js';\nimport {getIpcEmitter} from './forward.js';\nimport {hasMessageListeners} from './outgoing.js';\n\n// When using the `strict` option, wrap the message with metadata during `sendMessage()`\nexport const handleSendStrict = ({anyProcess, channel, isSubprocess, message, strict}) => {\n\tif (!strict) {\n\t\treturn message;\n\t}\n\n\tconst ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);\n\tconst hasListeners = hasMessageListeners(anyProcess, ipcEmitter);\n\treturn {\n\t\tid: count++,\n\t\ttype: REQUEST_TYPE,\n\t\tmessage,\n\t\thasListeners,\n\t};\n};\n\nlet count = 0n;\n\n// Handles when both processes are calling `sendMessage()` with `strict` at the same time.\n// If neither process is listening, this would create a deadlock. We detect it and throw.\nexport const validateStrictDeadlock = (outgoingMessages, wrappedMessage) => {\n\tif (wrappedMessage?.type !== REQUEST_TYPE || wrappedMessage.hasListeners) {\n\t\treturn;\n\t}\n\n\tfor (const {id} of outgoingMessages) {\n\t\tif (id !== undefined) {\n\t\t\tSTRICT_RESPONSES[id].resolve({isDeadlock: true, hasListeners: false});\n\t\t}\n\t}\n};\n\n// The other process then sends the acknowledgment back as a response\nexport const handleStrictRequest = async ({wrappedMessage, anyProcess, channel, isSubprocess, ipcEmitter}) => {\n\tif (wrappedMessage?.type !== REQUEST_TYPE || !anyProcess.connected) {\n\t\treturn wrappedMessage;\n\t}\n\n\tconst {id, message} = wrappedMessage;\n\tconst response = {id, type: RESPONSE_TYPE, message: hasMessageListeners(anyProcess, ipcEmitter)};\n\n\ttry {\n\t\tawait sendMessage({\n\t\t\tanyProcess,\n\t\t\tchannel,\n\t\t\tisSubprocess,\n\t\t\tipc: true,\n\t\t}, response);\n\t} catch (error) {\n\t\tipcEmitter.emit('strict:error', error);\n\t}\n\n\treturn message;\n};\n\n// Reception of the acknowledgment response\nexport const handleStrictResponse = wrappedMessage => {\n\tif (wrappedMessage?.type !== RESPONSE_TYPE) {\n\t\treturn false;\n\t}\n\n\tconst {id, message: hasListeners} = wrappedMessage;\n\tSTRICT_RESPONSES[id]?.resolve({isDeadlock: false, hasListeners});\n\treturn true;\n};\n\n// Wait for the other process to receive the message from `sendMessage()`\nexport const waitForStrictResponse = async (wrappedMessage, anyProcess, isSubprocess) => {\n\tif (wrappedMessage?.type !== REQUEST_TYPE) {\n\t\treturn;\n\t}\n\n\tconst deferred = createDeferred();\n\tSTRICT_RESPONSES[wrappedMessage.id] = deferred;\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tconst {isDeadlock, hasListeners} = await Promise.race([\n\t\t\tdeferred,\n\t\t\tthrowOnDisconnect(anyProcess, isSubprocess, controller),\n\t\t]);\n\n\t\tif (isDeadlock) {\n\t\t\tthrowOnStrictDeadlockError(isSubprocess);\n\t\t}\n\n\t\tif (!hasListeners) {\n\t\t\tthrowOnMissingStrict(isSubprocess);\n\t\t}\n\t} finally {\n\t\tcontroller.abort();\n\t\tdelete STRICT_RESPONSES[wrappedMessage.id];\n\t}\n};\n\nconst STRICT_RESPONSES = {};\n\nconst throwOnDisconnect = async (anyProcess, isSubprocess, {signal}) => {\n\tincrementMaxListeners(anyProcess, 1, signal);\n\tawait once(anyProcess, 'disconnect', {signal});\n\tthrowOnStrictDisconnect(isSubprocess);\n};\n\nconst REQUEST_TYPE = 'execa:ipc:request';\nconst RESPONSE_TYPE = 'execa:ipc:response';\n","import {createDeferred} from '../utils/deferred.js';\nimport {getFdSpecificValue} from '../arguments/specific.js';\nimport {SUBPROCESS_OPTIONS} from '../arguments/fd-options.js';\nimport {validateStrictDeadlock} from './strict.js';\n\n// When `sendMessage()` is ongoing, any `message` being received waits before being emitted.\n// This allows calling one or multiple `await sendMessage()` followed by `await getOneMessage()`/`await getEachMessage()`.\n// Without running into a race condition when the other process sends a response too fast, before the current process set up a listener.\nexport const startSendMessage = (anyProcess, wrappedMessage, strict) => {\n\tif (!OUTGOING_MESSAGES.has(anyProcess)) {\n\t\tOUTGOING_MESSAGES.set(anyProcess, new Set());\n\t}\n\n\tconst outgoingMessages = OUTGOING_MESSAGES.get(anyProcess);\n\tconst onMessageSent = createDeferred();\n\tconst id = strict ? wrappedMessage.id : undefined;\n\tconst outgoingMessage = {onMessageSent, id};\n\toutgoingMessages.add(outgoingMessage);\n\treturn {outgoingMessages, outgoingMessage};\n};\n\nexport const endSendMessage = ({outgoingMessages, outgoingMessage}) => {\n\toutgoingMessages.delete(outgoingMessage);\n\toutgoingMessage.onMessageSent.resolve();\n};\n\n// Await while `sendMessage()` is ongoing, unless there is already a `message` listener\nexport const waitForOutgoingMessages = async (anyProcess, ipcEmitter, wrappedMessage) => {\n\twhile (!hasMessageListeners(anyProcess, ipcEmitter) && OUTGOING_MESSAGES.get(anyProcess)?.size > 0) {\n\t\tconst outgoingMessages = [...OUTGOING_MESSAGES.get(anyProcess)];\n\t\tvalidateStrictDeadlock(outgoingMessages, wrappedMessage);\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tawait Promise.all(outgoingMessages.map(({onMessageSent}) => onMessageSent));\n\t}\n};\n\nconst OUTGOING_MESSAGES = new WeakMap();\n\n// Whether any `message` listener is setup\nexport const hasMessageListeners = (anyProcess, ipcEmitter) => ipcEmitter.listenerCount('message') > getMinListenerCount(anyProcess);\n\n// When `buffer` is `false`, we set up a `message` listener that should be ignored.\n// That listener is only meant to intercept `strict` acknowledgement responses.\nconst getMinListenerCount = anyProcess => SUBPROCESS_OPTIONS.has(anyProcess)\n\t&& !getFdSpecificValue(SUBPROCESS_OPTIONS.get(anyProcess).options.buffer, 'ipc')\n\t? 1\n\t: 0;\n","import {promisify} from 'node:util';\nimport {\n\tvalidateIpcMethod,\n\thandleEpipeError,\n\thandleSerializationError,\n\tdisconnect,\n} from './validation.js';\nimport {startSendMessage, endSendMessage} from './outgoing.js';\nimport {handleSendStrict, waitForStrictResponse} from './strict.js';\n\n// Like `[sub]process.send()` but promise-based.\n// We do not `await subprocess` during `.sendMessage()` nor `.getOneMessage()` since those methods are transient.\n// Users would still need to `await subprocess` after the method is done.\n// Also, this would prevent `unhandledRejection` event from being emitted, making it silent.\nexport const sendMessage = ({anyProcess, channel, isSubprocess, ipc}, message, {strict = false} = {}) => {\n\tconst methodName = 'sendMessage';\n\tvalidateIpcMethod({\n\t\tmethodName,\n\t\tisSubprocess,\n\t\tipc,\n\t\tisConnected: anyProcess.connected,\n\t});\n\n\treturn sendMessageAsync({\n\t\tanyProcess,\n\t\tchannel,\n\t\tmethodName,\n\t\tisSubprocess,\n\t\tmessage,\n\t\tstrict,\n\t});\n};\n\nconst sendMessageAsync = async ({anyProcess, channel, methodName, isSubprocess, message, strict}) => {\n\tconst wrappedMessage = handleSendStrict({\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tmessage,\n\t\tstrict,\n\t});\n\tconst outgoingMessagesState = startSendMessage(anyProcess, wrappedMessage, strict);\n\ttry {\n\t\tawait sendOneMessage({\n\t\t\tanyProcess,\n\t\t\tmethodName,\n\t\t\tisSubprocess,\n\t\t\twrappedMessage,\n\t\t\tmessage,\n\t\t});\n\t} catch (error) {\n\t\tdisconnect(anyProcess);\n\t\tthrow error;\n\t} finally {\n\t\tendSendMessage(outgoingMessagesState);\n\t}\n};\n\n// Used internally by `cancelSignal`\nexport const sendOneMessage = async ({anyProcess, methodName, isSubprocess, wrappedMessage, message}) => {\n\tconst sendMethod = getSendMethod(anyProcess);\n\n\ttry {\n\t\tawait Promise.all([\n\t\t\twaitForStrictResponse(wrappedMessage, anyProcess, isSubprocess),\n\t\t\tsendMethod(wrappedMessage),\n\t\t]);\n\t} catch (error) {\n\t\thandleEpipeError({error, methodName, isSubprocess});\n\t\thandleSerializationError({\n\t\t\terror,\n\t\t\tmethodName,\n\t\t\tisSubprocess,\n\t\t\tmessage,\n\t\t});\n\t\tthrow error;\n\t}\n};\n\n// [sub]process.send() promisified, memoized\nconst getSendMethod = anyProcess => {\n\tif (PROCESS_SEND_METHODS.has(anyProcess)) {\n\t\treturn PROCESS_SEND_METHODS.get(anyProcess);\n\t}\n\n\tconst sendMethod = promisify(anyProcess.send.bind(anyProcess));\n\tPROCESS_SEND_METHODS.set(anyProcess, sendMethod);\n\treturn sendMethod;\n};\n\nconst PROCESS_SEND_METHODS = new WeakMap();\n","import {scheduler} from 'node:timers/promises';\nimport {sendOneMessage} from './send.js';\nimport {getIpcEmitter} from './forward.js';\nimport {validateConnection, getAbortDisconnectError, throwOnMissingParent} from './validation.js';\n\n// Send an IPC message so the subprocess performs a graceful termination\nexport const sendAbort = (subprocess, message) => {\n\tconst methodName = 'cancelSignal';\n\tvalidateConnection(methodName, false, subprocess.connected);\n\treturn sendOneMessage({\n\t\tanyProcess: subprocess,\n\t\tmethodName,\n\t\tisSubprocess: false,\n\t\twrappedMessage: {type: GRACEFUL_CANCEL_TYPE, message},\n\t\tmessage,\n\t});\n};\n\n// When the signal is being used, start listening for incoming messages.\n// Unbuffering messages takes one microtask to complete, so this must be async.\nexport const getCancelSignal = async ({anyProcess, channel, isSubprocess, ipc}) => {\n\tawait startIpc({\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tipc,\n\t});\n\treturn cancelController.signal;\n};\n\nconst startIpc = async ({anyProcess, channel, isSubprocess, ipc}) => {\n\tif (cancelListening) {\n\t\treturn;\n\t}\n\n\tcancelListening = true;\n\n\tif (!ipc) {\n\t\tthrowOnMissingParent();\n\t\treturn;\n\t}\n\n\tif (channel === null) {\n\t\tabortOnDisconnect();\n\t\treturn;\n\t}\n\n\tgetIpcEmitter(anyProcess, channel, isSubprocess);\n\tawait scheduler.yield();\n};\n\nlet cancelListening = false;\n\n// Reception of IPC message to perform a graceful termination\nexport const handleAbort = wrappedMessage => {\n\tif (wrappedMessage?.type !== GRACEFUL_CANCEL_TYPE) {\n\t\treturn false;\n\t}\n\n\tcancelController.abort(wrappedMessage.message);\n\treturn true;\n};\n\nconst GRACEFUL_CANCEL_TYPE = 'execa:ipc:cancel';\n\n// When the current process disconnects early, the subprocess `cancelSignal` is aborted.\n// Otherwise, the signal would never be able to be aborted later on.\nexport const abortOnDisconnect = () => {\n\tcancelController.abort(getAbortDisconnectError());\n};\n\nconst cancelController = new AbortController();\n","import {onAbortedSignal} from '../utils/abort-signal.js';\nimport {sendAbort} from '../ipc/graceful.js';\nimport {killOnTimeout} from './kill.js';\n\n// Validate the `gracefulCancel` option\nexport const validateGracefulCancel = ({gracefulCancel, cancelSignal, ipc, serialization}) => {\n\tif (!gracefulCancel) {\n\t\treturn;\n\t}\n\n\tif (cancelSignal === undefined) {\n\t\tthrow new Error('The `cancelSignal` option must be defined when setting the `gracefulCancel` option.');\n\t}\n\n\tif (!ipc) {\n\t\tthrow new Error('The `ipc` option cannot be false when setting the `gracefulCancel` option.');\n\t}\n\n\tif (serialization === 'json') {\n\t\tthrow new Error('The `serialization` option cannot be \\'json\\' when setting the `gracefulCancel` option.');\n\t}\n};\n\n// Send abort reason to the subprocess when aborting the `cancelSignal` option and `gracefulCancel` is `true`\nexport const throwOnGracefulCancel = ({\n\tsubprocess,\n\tcancelSignal,\n\tgracefulCancel,\n\tforceKillAfterDelay,\n\tcontext,\n\tcontroller,\n}) => gracefulCancel\n\t? [sendOnAbort({\n\t\tsubprocess,\n\t\tcancelSignal,\n\t\tforceKillAfterDelay,\n\t\tcontext,\n\t\tcontroller,\n\t})]\n\t: [];\n\nconst sendOnAbort = async ({subprocess, cancelSignal, forceKillAfterDelay, context, controller: {signal}}) => {\n\tawait onAbortedSignal(cancelSignal, signal);\n\tconst reason = getReason(cancelSignal);\n\tawait sendAbort(subprocess, reason);\n\tkillOnTimeout({\n\t\tkill: subprocess.kill,\n\t\tforceKillAfterDelay,\n\t\tcontext,\n\t\tcontrollerSignal: signal,\n\t});\n\tcontext.terminationReason ??= 'gracefulCancel';\n\tthrow cancelSignal.reason;\n};\n\n// The default `reason` is a DOMException, which is not serializable with V8\n// See https://github.com/nodejs/node/issues/53225\nconst getReason = ({reason}) => {\n\tif (!(reason instanceof DOMException)) {\n\t\treturn reason;\n\t}\n\n\tconst error = new Error(reason.message);\n\tObject.defineProperty(error, 'stack', {\n\t\tvalue: reason.stack,\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t\twritable: true,\n\t});\n\treturn error;\n};\n","import {setTimeout} from 'node:timers/promises';\nimport {DiscardedError} from '../return/final-error.js';\n\n// Validate `timeout` option\nexport const validateTimeout = ({timeout}) => {\n\tif (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) {\n\t\tthrow new TypeError(`Expected the \\`timeout\\` option to be a non-negative integer, got \\`${timeout}\\` (${typeof timeout})`);\n\t}\n};\n\n// Fails when the `timeout` option is exceeded\nexport const throwOnTimeout = (subprocess, timeout, context, controller) => timeout === 0 || timeout === undefined\n\t? []\n\t: [killAfterTimeout(subprocess, timeout, context, controller)];\n\nconst killAfterTimeout = async (subprocess, timeout, context, {signal}) => {\n\tawait setTimeout(timeout, undefined, {signal});\n\tcontext.terminationReason ??= 'timeout';\n\tsubprocess.kill();\n\tthrow new DiscardedError();\n};\n","import {execPath, execArgv} from 'node:process';\nimport path from 'node:path';\nimport {safeNormalizeFileUrl} from '../arguments/file-url.js';\n\n// `execaNode()` is a shortcut for `execa(..., {node: true})`\nexport const mapNode = ({options}) => {\n\tif (options.node === false) {\n\t\tthrow new TypeError('The \"node\" option cannot be false with `execaNode()`.');\n\t}\n\n\treturn {options: {...options, node: true}};\n};\n\n// Applies the `node: true` option, and the related `nodePath`/`nodeOptions` options.\n// Modifies the file commands/arguments to ensure the same Node binary and flags are re-used.\n// Also adds `ipc: true` and `shell: false`.\nexport const handleNodeOption = (file, commandArguments, {\n\tnode: shouldHandleNode = false,\n\tnodePath = execPath,\n\tnodeOptions = execArgv.filter(nodeOption => !nodeOption.startsWith('--inspect')),\n\tcwd,\n\texecPath: formerNodePath,\n\t...options\n}) => {\n\tif (formerNodePath !== undefined) {\n\t\tthrow new TypeError('The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.');\n\t}\n\n\tconst normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The \"nodePath\" option');\n\tconst resolvedNodePath = path.resolve(cwd, normalizedNodePath);\n\tconst newOptions = {\n\t\t...options,\n\t\tnodePath: resolvedNodePath,\n\t\tnode: shouldHandleNode,\n\t\tcwd,\n\t};\n\n\tif (!shouldHandleNode) {\n\t\treturn [file, commandArguments, newOptions];\n\t}\n\n\tif (path.basename(file, '.exe') === 'node') {\n\t\tthrow new TypeError('When the \"node\" option is true, the first argument does not need to be \"node\".');\n\t}\n\n\treturn [\n\t\tresolvedNodePath,\n\t\t[...nodeOptions, file, ...commandArguments],\n\t\t{ipc: true, ...newOptions, shell: false},\n\t];\n};\n","import {serialize} from 'node:v8';\n\n// Validate the `ipcInput` option\nexport const validateIpcInputOption = ({ipcInput, ipc, serialization}) => {\n\tif (ipcInput === undefined) {\n\t\treturn;\n\t}\n\n\tif (!ipc) {\n\t\tthrow new Error('The `ipcInput` option cannot be set unless the `ipc` option is `true`.');\n\t}\n\n\tvalidateIpcInput[serialization](ipcInput);\n};\n\nconst validateAdvancedInput = ipcInput => {\n\ttry {\n\t\tserialize(ipcInput);\n\t} catch (error) {\n\t\tthrow new Error('The `ipcInput` option is not serializable with a structured clone.', {cause: error});\n\t}\n};\n\nconst validateJsonInput = ipcInput => {\n\ttry {\n\t\tJSON.stringify(ipcInput);\n\t} catch (error) {\n\t\tthrow new Error('The `ipcInput` option is not serializable with JSON.', {cause: error});\n\t}\n};\n\nconst validateIpcInput = {\n\tadvanced: validateAdvancedInput,\n\tjson: validateJsonInput,\n};\n\n// When the `ipcInput` option is set, it is sent as an initial IPC message to the subprocess\nexport const sendIpcInput = async (subprocess, ipcInput) => {\n\tif (ipcInput === undefined) {\n\t\treturn;\n\t}\n\n\tawait subprocess.sendMessage(ipcInput);\n};\n","// Validate `encoding` option\nexport const validateEncoding = ({encoding}) => {\n\tif (ENCODINGS.has(encoding)) {\n\t\treturn;\n\t}\n\n\tconst correctEncoding = getCorrectEncoding(encoding);\n\tif (correctEncoding !== undefined) {\n\t\tthrow new TypeError(`Invalid option \\`encoding: ${serializeEncoding(encoding)}\\`.\nPlease rename it to ${serializeEncoding(correctEncoding)}.`);\n\t}\n\n\tconst correctEncodings = [...ENCODINGS].map(correctEncoding => serializeEncoding(correctEncoding)).join(', ');\n\tthrow new TypeError(`Invalid option \\`encoding: ${serializeEncoding(encoding)}\\`.\nPlease rename it to one of: ${correctEncodings}.`);\n};\n\nconst TEXT_ENCODINGS = new Set(['utf8', 'utf16le']);\nexport const BINARY_ENCODINGS = new Set(['buffer', 'hex', 'base64', 'base64url', 'latin1', 'ascii']);\nconst ENCODINGS = new Set([...TEXT_ENCODINGS, ...BINARY_ENCODINGS]);\n\nconst getCorrectEncoding = encoding => {\n\tif (encoding === null) {\n\t\treturn 'buffer';\n\t}\n\n\tif (typeof encoding !== 'string') {\n\t\treturn;\n\t}\n\n\tconst lowerEncoding = encoding.toLowerCase();\n\tif (lowerEncoding in ENCODING_ALIASES) {\n\t\treturn ENCODING_ALIASES[lowerEncoding];\n\t}\n\n\tif (ENCODINGS.has(lowerEncoding)) {\n\t\treturn lowerEncoding;\n\t}\n};\n\nconst ENCODING_ALIASES = {\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case\n\t'utf-8': 'utf8',\n\t'utf-16le': 'utf16le',\n\t'ucs-2': 'utf16le',\n\tucs2: 'utf16le',\n\tbinary: 'latin1',\n};\n\nconst serializeEncoding = encoding => typeof encoding === 'string' ? `\"${encoding}\"` : String(encoding);\n","import {statSync} from 'node:fs';\nimport path from 'node:path';\nimport process from 'node:process';\nimport {safeNormalizeFileUrl} from './file-url.js';\n\n// Normalize `cwd` option\nexport const normalizeCwd = (cwd = getDefaultCwd()) => {\n\tconst cwdString = safeNormalizeFileUrl(cwd, 'The \"cwd\" option');\n\treturn path.resolve(cwdString);\n};\n\nconst getDefaultCwd = () => {\n\ttry {\n\t\treturn process.cwd();\n\t} catch (error) {\n\t\terror.message = `The current directory does not exist.\\n${error.message}`;\n\t\tthrow error;\n\t}\n};\n\n// When `cwd` option has an invalid value, provide with a better error message\nexport const fixCwdError = (originalMessage, cwd) => {\n\tif (cwd === getDefaultCwd()) {\n\t\treturn originalMessage;\n\t}\n\n\tlet cwdStat;\n\ttry {\n\t\tcwdStat = statSync(cwd);\n\t} catch (error) {\n\t\treturn `The \"cwd\" option is invalid: ${cwd}.\\n${error.message}\\n${originalMessage}`;\n\t}\n\n\tif (!cwdStat.isDirectory()) {\n\t\treturn `The \"cwd\" option is not a directory: ${cwd}.\\n${originalMessage}`;\n\t}\n\n\treturn originalMessage;\n};\n","import path from 'node:path';\nimport process from 'node:process';\nimport crossSpawn from 'cross-spawn';\nimport {npmRunPathEnv} from 'npm-run-path';\nimport {normalizeForceKillAfterDelay} from '../terminate/kill.js';\nimport {normalizeKillSignal} from '../terminate/signal.js';\nimport {validateCancelSignal} from '../terminate/cancel.js';\nimport {validateGracefulCancel} from '../terminate/graceful.js';\nimport {validateTimeout} from '../terminate/timeout.js';\nimport {handleNodeOption} from '../methods/node.js';\nimport {validateIpcInputOption} from '../ipc/ipc-input.js';\nimport {validateEncoding, BINARY_ENCODINGS} from './encoding-option.js';\nimport {normalizeCwd} from './cwd.js';\nimport {normalizeFileUrl} from './file-url.js';\nimport {normalizeFdSpecificOptions} from './specific.js';\n\n// Normalize the options object, and sometimes also the file paths and arguments.\n// Applies default values, validate allowed options, normalize them.\nexport const normalizeOptions = (filePath, rawArguments, rawOptions) => {\n\trawOptions.cwd = normalizeCwd(rawOptions.cwd);\n\tconst [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);\n\n\tconst {command: file, args: commandArguments, options: initialOptions} = crossSpawn._parse(processedFile, processedArguments, processedOptions);\n\n\tconst fdOptions = normalizeFdSpecificOptions(initialOptions);\n\tconst options = addDefaultOptions(fdOptions);\n\tvalidateTimeout(options);\n\tvalidateEncoding(options);\n\tvalidateIpcInputOption(options);\n\tvalidateCancelSignal(options);\n\tvalidateGracefulCancel(options);\n\toptions.shell = normalizeFileUrl(options.shell);\n\toptions.env = getEnv(options);\n\toptions.killSignal = normalizeKillSignal(options.killSignal);\n\toptions.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);\n\toptions.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);\n\n\tif (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {\n\t\t// #116\n\t\tcommandArguments.unshift('/q');\n\t}\n\n\treturn {file, commandArguments, options};\n};\n\nconst addDefaultOptions = ({\n\textendEnv = true,\n\tpreferLocal = false,\n\tcwd,\n\tlocalDir: localDirectory = cwd,\n\tencoding = 'utf8',\n\treject = true,\n\tcleanup = true,\n\tall = false,\n\twindowsHide = true,\n\tkillSignal = 'SIGTERM',\n\tforceKillAfterDelay = true,\n\tgracefulCancel = false,\n\tipcInput,\n\tipc = ipcInput !== undefined || gracefulCancel,\n\tserialization = 'advanced',\n\t...options\n}) => ({\n\t...options,\n\textendEnv,\n\tpreferLocal,\n\tcwd,\n\tlocalDirectory,\n\tencoding,\n\treject,\n\tcleanup,\n\tall,\n\twindowsHide,\n\tkillSignal,\n\tforceKillAfterDelay,\n\tgracefulCancel,\n\tipcInput,\n\tipc,\n\tserialization,\n});\n\nconst getEnv = ({env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath}) => {\n\tconst env = extendEnv ? {...process.env, ...envOption} : envOption;\n\n\tif (preferLocal || node) {\n\t\treturn npmRunPathEnv({\n\t\t\tenv,\n\t\t\tcwd: localDirectory,\n\t\t\texecPath: nodePath,\n\t\t\tpreferLocal,\n\t\t\taddExecPath: node,\n\t\t});\n\t}\n\n\treturn env;\n};\n","// When the `shell` option is set, any command argument is concatenated as a single string by Node.js:\n// https://github.com/nodejs/node/blob/e38ce27f3ca0a65f68a31cedd984cddb927d4002/lib/child_process.js#L614-L624\n// However, since Node 24, it also prints a deprecation warning.\n// To avoid this warning, we perform that same operation before calling `node:child_process`.\n// Shells only understand strings, which is why Node.js performs that concatenation.\n// However, we rely on users splitting command arguments as an array.\n// For example, this allows us to easily detect which arguments are passed.\n// So we do want users to pass array of arguments even with `shell: true`, but we also want to avoid any warning.\nexport const concatenateShell = (file, commandArguments, options) => options.shell && commandArguments.length > 0\n\t? [[file, ...commandArguments].join(' '), [], options]\n\t: [file, commandArguments, options];\n","export default function stripFinalNewline(input) {\n\tif (typeof input === 'string') {\n\t\treturn stripFinalNewlineString(input);\n\t}\n\n\tif (!(ArrayBuffer.isView(input) && input.BYTES_PER_ELEMENT === 1)) {\n\t\tthrow new Error('Input must be a string or a Uint8Array');\n\t}\n\n\treturn stripFinalNewlineBinary(input);\n}\n\nconst stripFinalNewlineString = input =>\n\tinput.at(-1) === LF\n\t\t? input.slice(0, input.at(-2) === CR ? -2 : -1)\n\t\t: input;\n\nconst stripFinalNewlineBinary = input =>\n\tinput.at(-1) === LF_BINARY\n\t\t? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1)\n\t\t: input;\n\nconst LF = '\\n';\nconst LF_BINARY = LF.codePointAt(0);\nconst CR = '\\r';\nconst CR_BINARY = CR.codePointAt(0);\n","export function isStream(stream, {checkOpen = true} = {}) {\n\treturn stream !== null\n\t\t&& typeof stream === 'object'\n\t\t&& (stream.writable || stream.readable || !checkOpen || (stream.writable === undefined && stream.readable === undefined))\n\t\t&& typeof stream.pipe === 'function';\n}\n\nexport function isWritableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.writable || !checkOpen)\n\t\t&& typeof stream.write === 'function'\n\t\t&& typeof stream.end === 'function'\n\t\t&& typeof stream.writable === 'boolean'\n\t\t&& typeof stream.writableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isReadableStream(stream, {checkOpen = true} = {}) {\n\treturn isStream(stream, {checkOpen})\n\t\t&& (stream.readable || !checkOpen)\n\t\t&& typeof stream.read === 'function'\n\t\t&& typeof stream.readable === 'boolean'\n\t\t&& typeof stream.readableObjectMode === 'boolean'\n\t\t&& typeof stream.destroy === 'function'\n\t\t&& typeof stream.destroyed === 'boolean';\n}\n\nexport function isDuplexStream(stream, options) {\n\treturn isWritableStream(stream, options)\n\t\t&& isReadableStream(stream, options);\n}\n\nexport function isTransformStream(stream, options) {\n\treturn isDuplexStream(stream, options)\n\t\t&& typeof stream._transform === 'function';\n}\n","const a = Object.getPrototypeOf(\n Object.getPrototypeOf(\n /* istanbul ignore next */\n async function* () {\n }\n ).prototype\n);\nclass c {\n #t;\n #n;\n #r = !1;\n #e = void 0;\n constructor(e, t) {\n this.#t = e, this.#n = t;\n }\n next() {\n const e = () => this.#s();\n return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e;\n }\n return(e) {\n const t = () => this.#i(e);\n return this.#e ? this.#e.then(t, t) : t();\n }\n async #s() {\n if (this.#r)\n return {\n done: !0,\n value: void 0\n };\n let e;\n try {\n e = await this.#t.read();\n } catch (t) {\n throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t;\n }\n return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e;\n }\n async #i(e) {\n if (this.#r)\n return {\n done: !0,\n value: e\n };\n if (this.#r = !0, !this.#n) {\n const t = this.#t.cancel(e);\n return this.#t.releaseLock(), await t, {\n done: !0,\n value: e\n };\n }\n return this.#t.releaseLock(), {\n done: !0,\n value: e\n };\n }\n}\nconst n = Symbol();\nfunction i() {\n return this[n].next();\n}\nObject.defineProperty(i, \"name\", { value: \"next\" });\nfunction o(r) {\n return this[n].return(r);\n}\nObject.defineProperty(o, \"name\", { value: \"return\" });\nconst u = Object.create(a, {\n next: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: i\n },\n return: {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: o\n }\n});\nfunction h({ preventCancel: r = !1 } = {}) {\n const e = this.getReader(), t = new c(\n e,\n r\n ), s = Object.create(u);\n return s[n] = t, s;\n}\nexport {\n h as asyncIterator\n};\n","import {isReadableStream} from 'is-stream';\nimport {asyncIterator} from '@sec-ant/readable-stream/ponyfill';\n\nexport const getAsyncIterable = stream => {\n\tif (isReadableStream(stream, {checkOpen: false}) && nodeImports.on !== undefined) {\n\t\treturn getStreamIterable(stream);\n\t}\n\n\tif (typeof stream?.[Symbol.asyncIterator] === 'function') {\n\t\treturn stream;\n\t}\n\n\t// `ReadableStream[Symbol.asyncIterator]` support is missing in multiple browsers, so we ponyfill it\n\tif (toString.call(stream) === '[object ReadableStream]') {\n\t\treturn asyncIterator.call(stream);\n\t}\n\n\tthrow new TypeError('The first argument must be a Readable, a ReadableStream, or an async iterable.');\n};\n\nconst {toString} = Object.prototype;\n\n// The default iterable for Node.js streams does not allow for multiple readers at once, so we re-implement it\nconst getStreamIterable = async function * (stream) {\n\tconst controller = new AbortController();\n\tconst state = {};\n\thandleStreamEnd(stream, controller, state);\n\n\ttry {\n\t\tfor await (const [chunk] of nodeImports.on(stream, 'data', {signal: controller.signal})) {\n\t\t\tyield chunk;\n\t\t}\n\t} catch (error) {\n\t\t// Stream failure, for example due to `stream.destroy(error)`\n\t\tif (state.error !== undefined) {\n\t\t\tthrow state.error;\n\t\t// `error` event directly emitted on stream\n\t\t} else if (!controller.signal.aborted) {\n\t\t\tthrow error;\n\t\t// Otherwise, stream completed successfully\n\t\t}\n\t\t// The `finally` block also runs when the caller throws, for example due to the `maxBuffer` option\n\t} finally {\n\t\tstream.destroy();\n\t}\n};\n\nconst handleStreamEnd = async (stream, controller, state) => {\n\ttry {\n\t\tawait nodeImports.finished(stream, {\n\t\t\tcleanup: true,\n\t\t\treadable: true,\n\t\t\twritable: false,\n\t\t\terror: false,\n\t\t});\n\t} catch (error) {\n\t\tstate.error = error;\n\t} finally {\n\t\tcontroller.abort();\n\t}\n};\n\n// Loaded by the Node entrypoint, but not by the browser one.\n// This prevents using dynamic imports.\nexport const nodeImports = {};\n","import {getAsyncIterable} from './stream.js';\n\nexport const getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => {\n\tconst asyncIterable = getAsyncIterable(stream);\n\n\tconst state = init();\n\tstate.length = 0;\n\n\ttry {\n\t\tfor await (const chunk of asyncIterable) {\n\t\t\tconst chunkType = getChunkType(chunk);\n\t\t\tconst convertedChunk = convertChunk[chunkType](chunk, state);\n\t\t\tappendChunk({\n\t\t\t\tconvertedChunk,\n\t\t\t\tstate,\n\t\t\t\tgetSize,\n\t\t\t\ttruncateChunk,\n\t\t\t\taddChunk,\n\t\t\t\tmaxBuffer,\n\t\t\t});\n\t\t}\n\n\t\tappendFinalChunk({\n\t\t\tstate,\n\t\t\tconvertChunk,\n\t\t\tgetSize,\n\t\t\ttruncateChunk,\n\t\t\taddChunk,\n\t\t\tgetFinalChunk,\n\t\t\tmaxBuffer,\n\t\t});\n\t\treturn finalize(state);\n\t} catch (error) {\n\t\tconst normalizedError = typeof error === 'object' && error !== null ? error : new Error(error);\n\t\tnormalizedError.bufferedData = finalize(state);\n\t\tthrow normalizedError;\n\t}\n};\n\nconst appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => {\n\tconst convertedChunk = getFinalChunk(state);\n\tif (convertedChunk !== undefined) {\n\t\tappendChunk({\n\t\t\tconvertedChunk,\n\t\t\tstate,\n\t\t\tgetSize,\n\t\t\ttruncateChunk,\n\t\t\taddChunk,\n\t\t\tmaxBuffer,\n\t\t});\n\t}\n};\n\nconst appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => {\n\tconst chunkSize = getSize(convertedChunk);\n\tconst newLength = state.length + chunkSize;\n\n\tif (newLength <= maxBuffer) {\n\t\taddNewChunk(convertedChunk, state, addChunk, newLength);\n\t\treturn;\n\t}\n\n\tconst truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);\n\n\tif (truncatedChunk !== undefined) {\n\t\taddNewChunk(truncatedChunk, state, addChunk, maxBuffer);\n\t}\n\n\tthrow new MaxBufferError();\n};\n\nconst addNewChunk = (convertedChunk, state, addChunk, newLength) => {\n\tstate.contents = addChunk(convertedChunk, state, newLength);\n\tstate.length = newLength;\n};\n\nconst getChunkType = chunk => {\n\tconst typeOfChunk = typeof chunk;\n\n\tif (typeOfChunk === 'string') {\n\t\treturn 'string';\n\t}\n\n\tif (typeOfChunk !== 'object' || chunk === null) {\n\t\treturn 'others';\n\t}\n\n\tif (globalThis.Buffer?.isBuffer(chunk)) {\n\t\treturn 'buffer';\n\t}\n\n\tconst prototypeName = objectToString.call(chunk);\n\n\tif (prototypeName === '[object ArrayBuffer]') {\n\t\treturn 'arrayBuffer';\n\t}\n\n\tif (prototypeName === '[object DataView]') {\n\t\treturn 'dataView';\n\t}\n\n\tif (\n\t\tNumber.isInteger(chunk.byteLength)\n\t\t&& Number.isInteger(chunk.byteOffset)\n\t\t&& objectToString.call(chunk.buffer) === '[object ArrayBuffer]'\n\t) {\n\t\treturn 'typedArray';\n\t}\n\n\treturn 'others';\n};\n\nconst {toString: objectToString} = Object.prototype;\n\nexport class MaxBufferError extends Error {\n\tname = 'MaxBufferError';\n\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t}\n}\n","export const identity = value => value;\n\nexport const noop = () => undefined;\n\nexport const getContentsProperty = ({contents}) => contents;\n\nexport const throwObjectStream = chunk => {\n\tthrow new Error(`Streams in object mode are not supported: ${String(chunk)}`);\n};\n\nexport const getLengthProperty = convertedChunk => convertedChunk.length;\n","import {getStreamContents} from './contents.js';\nimport {identity, noop, getContentsProperty} from './utils.js';\n\nexport async function getStreamAsArray(stream, options) {\n\treturn getStreamContents(stream, arrayMethods, options);\n}\n\nconst initArray = () => ({contents: []});\n\nconst increment = () => 1;\n\nconst addArrayChunk = (convertedChunk, {contents}) => {\n\tcontents.push(convertedChunk);\n\treturn contents;\n};\n\nconst arrayMethods = {\n\tinit: initArray,\n\tconvertChunk: {\n\t\tstring: identity,\n\t\tbuffer: identity,\n\t\tarrayBuffer: identity,\n\t\tdataView: identity,\n\t\ttypedArray: identity,\n\t\tothers: identity,\n\t},\n\tgetSize: increment,\n\ttruncateChunk: noop,\n\taddChunk: addArrayChunk,\n\tgetFinalChunk: noop,\n\tfinalize: getContentsProperty,\n};\n","import {getStreamContents} from './contents.js';\nimport {noop, throwObjectStream, getLengthProperty} from './utils.js';\n\nexport async function getStreamAsArrayBuffer(stream, options) {\n\treturn getStreamContents(stream, arrayBufferMethods, options);\n}\n\nconst initArrayBuffer = () => ({contents: new ArrayBuffer(0)});\n\nconst useTextEncoder = chunk => textEncoder.encode(chunk);\nconst textEncoder = new TextEncoder();\n\nconst useUint8Array = chunk => new Uint8Array(chunk);\n\nconst useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n\nconst truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);\n\n// `contents` is an increasingly growing `Uint8Array`.\nconst addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => {\n\tconst newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);\n\tnew Uint8Array(newContents).set(convertedChunk, previousLength);\n\treturn newContents;\n};\n\n// Without `ArrayBuffer.resize()`, `contents` size is always a power of 2.\n// This means its last bytes are zeroes (not stream data), which need to be\n// trimmed at the end with `ArrayBuffer.slice()`.\nconst resizeArrayBufferSlow = (contents, length) => {\n\tif (length <= contents.byteLength) {\n\t\treturn contents;\n\t}\n\n\tconst arrayBuffer = new ArrayBuffer(getNewContentsLength(length));\n\tnew Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);\n\treturn arrayBuffer;\n};\n\n// With `ArrayBuffer.resize()`, `contents` size matches exactly the size of\n// the stream data. It does not include extraneous zeroes to trim at the end.\n// The underlying `ArrayBuffer` does allocate a number of bytes that is a power\n// of 2, but those bytes are only visible after calling `ArrayBuffer.resize()`.\nconst resizeArrayBuffer = (contents, length) => {\n\tif (length <= contents.maxByteLength) {\n\t\tcontents.resize(length);\n\t\treturn contents;\n\t}\n\n\tconst arrayBuffer = new ArrayBuffer(length, {maxByteLength: getNewContentsLength(length)});\n\tnew Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);\n\treturn arrayBuffer;\n};\n\n// Retrieve the closest `length` that is both >= and a power of 2\nconst getNewContentsLength = length => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));\n\nconst SCALE_FACTOR = 2;\n\nconst finalizeArrayBuffer = ({contents, length}) => hasArrayBufferResize() ? contents : contents.slice(0, length);\n\n// `ArrayBuffer.slice()` is slow. When `ArrayBuffer.resize()` is available\n// (Node >=20.0.0, Safari >=16.4 and Chrome), we can use it instead.\n// eslint-disable-next-line no-warning-comments\n// TODO: remove after dropping support for Node 20.\n// eslint-disable-next-line no-warning-comments\n// TODO: use `ArrayBuffer.transferToFixedLength()` instead once it is available\nconst hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype;\n\nconst arrayBufferMethods = {\n\tinit: initArrayBuffer,\n\tconvertChunk: {\n\t\tstring: useTextEncoder,\n\t\tbuffer: useUint8Array,\n\t\tarrayBuffer: useUint8Array,\n\t\tdataView: useUint8ArrayWithOffset,\n\t\ttypedArray: useUint8ArrayWithOffset,\n\t\tothers: throwObjectStream,\n\t},\n\tgetSize: getLengthProperty,\n\ttruncateChunk: truncateArrayBufferChunk,\n\taddChunk: addArrayBufferChunk,\n\tgetFinalChunk: noop,\n\tfinalize: finalizeArrayBuffer,\n};\n","import {getStreamContents} from './contents.js';\nimport {\n\tidentity,\n\tgetContentsProperty,\n\tthrowObjectStream,\n\tgetLengthProperty,\n} from './utils.js';\n\nexport async function getStreamAsString(stream, options) {\n\treturn getStreamContents(stream, stringMethods, options);\n}\n\nconst initString = () => ({contents: '', textDecoder: new TextDecoder()});\n\nconst useTextDecoder = (chunk, {textDecoder}) => textDecoder.decode(chunk, {stream: true});\n\nconst addStringChunk = (convertedChunk, {contents}) => contents + convertedChunk;\n\nconst truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);\n\nconst getFinalStringChunk = ({textDecoder}) => {\n\tconst finalChunk = textDecoder.decode();\n\treturn finalChunk === '' ? undefined : finalChunk;\n};\n\nconst stringMethods = {\n\tinit: initString,\n\tconvertChunk: {\n\t\tstring: identity,\n\t\tbuffer: useTextDecoder,\n\t\tarrayBuffer: useTextDecoder,\n\t\tdataView: useTextDecoder,\n\t\ttypedArray: useTextDecoder,\n\t\tothers: throwObjectStream,\n\t},\n\tgetSize: getLengthProperty,\n\ttruncateChunk: truncateStringChunk,\n\taddChunk: addStringChunk,\n\tgetFinalChunk: getFinalStringChunk,\n\tfinalize: getContentsProperty,\n};\n","import {MaxBufferError} from 'get-stream';\nimport {getStreamName} from '../utils/standard-stream.js';\nimport {getFdSpecificValue} from '../arguments/specific.js';\n\n// When the `maxBuffer` option is hit, a MaxBufferError is thrown.\n// The stream is aborted, then specific information is kept for the error message.\nexport const handleMaxBuffer = ({error, stream, readableObjectMode, lines, encoding, fdNumber}) => {\n\tif (!(error instanceof MaxBufferError)) {\n\t\tthrow error;\n\t}\n\n\tif (fdNumber === 'all') {\n\t\treturn error;\n\t}\n\n\tconst unit = getMaxBufferUnit(readableObjectMode, lines, encoding);\n\terror.maxBufferInfo = {fdNumber, unit};\n\tstream.destroy();\n\tthrow error;\n};\n\nconst getMaxBufferUnit = (readableObjectMode, lines, encoding) => {\n\tif (readableObjectMode) {\n\t\treturn 'objects';\n\t}\n\n\tif (lines) {\n\t\treturn 'lines';\n\t}\n\n\tif (encoding === 'buffer') {\n\t\treturn 'bytes';\n\t}\n\n\treturn 'characters';\n};\n\n// Check the `maxBuffer` option with `result.ipcOutput`\nexport const checkIpcMaxBuffer = (subprocess, ipcOutput, maxBuffer) => {\n\tif (ipcOutput.length !== maxBuffer) {\n\t\treturn;\n\t}\n\n\tconst error = new MaxBufferError();\n\terror.maxBufferInfo = {fdNumber: 'ipc'};\n\tthrow error;\n};\n\n// Error message when `maxBuffer` is hit\nexport const getMaxBufferMessage = (error, maxBuffer) => {\n\tconst {streamName, threshold, unit} = getMaxBufferInfo(error, maxBuffer);\n\treturn `Command's ${streamName} was larger than ${threshold} ${unit}`;\n};\n\nconst getMaxBufferInfo = (error, maxBuffer) => {\n\tif (error?.maxBufferInfo === undefined) {\n\t\treturn {streamName: 'output', threshold: maxBuffer[1], unit: 'bytes'};\n\t}\n\n\tconst {maxBufferInfo: {fdNumber, unit}} = error;\n\tdelete error.maxBufferInfo;\n\n\tconst threshold = getFdSpecificValue(maxBuffer, fdNumber);\n\tif (fdNumber === 'ipc') {\n\t\treturn {streamName: 'IPC output', threshold, unit: 'messages'};\n\t}\n\n\treturn {streamName: getStreamName(fdNumber), threshold, unit};\n};\n\n// The only way to apply `maxBuffer` with `spawnSync()` is to use the native `maxBuffer` option Node.js provides.\n// However, this has multiple limitations, and cannot behave the exact same way as the async behavior.\n// When the `maxBuffer` is hit, a `ENOBUFS` error is thrown.\nexport const isMaxBufferSync = (resultError, output, maxBuffer) => resultError?.code === 'ENOBUFS'\n\t&& output !== null\n\t&& output.some(result => result !== null && result.length > getMaxBufferSync(maxBuffer));\n\n// When `maxBuffer` is hit, ensure the result is truncated\nexport const truncateMaxBufferSync = (result, isMaxBuffer, maxBuffer) => {\n\tif (!isMaxBuffer) {\n\t\treturn result;\n\t}\n\n\tconst maxBufferValue = getMaxBufferSync(maxBuffer);\n\treturn result.length > maxBufferValue ? result.slice(0, maxBufferValue) : result;\n};\n\n// `spawnSync()` does not allow differentiating `maxBuffer` per file descriptor, so we always use `stdout`\nexport const getMaxBufferSync = ([, stdoutMaxBuffer]) => stdoutMaxBuffer;\n","import {inspect} from 'node:util';\nimport stripFinalNewline from 'strip-final-newline';\nimport {isUint8Array, uint8ArrayToString} from '../utils/uint-array.js';\nimport {fixCwdError} from '../arguments/cwd.js';\nimport {escapeLines} from '../arguments/escape.js';\nimport {getMaxBufferMessage} from '../io/max-buffer.js';\nimport {getSignalDescription} from '../terminate/signal.js';\nimport {DiscardedError, isExecaError} from './final-error.js';\n\n// Computes `error.message`, `error.shortMessage` and `error.originalMessage`\nexport const createMessages = ({\n\tstdio,\n\tall,\n\tipcOutput,\n\toriginalError,\n\tsignal,\n\tsignalDescription,\n\texitCode,\n\tescapedCommand,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\tforceKillAfterDelay,\n\tkillSignal,\n\tmaxBuffer,\n\ttimeout,\n\tcwd,\n}) => {\n\tconst errorCode = originalError?.code;\n\tconst prefix = getErrorPrefix({\n\t\toriginalError,\n\t\ttimedOut,\n\t\ttimeout,\n\t\tisMaxBuffer,\n\t\tmaxBuffer,\n\t\terrorCode,\n\t\tsignal,\n\t\tsignalDescription,\n\t\texitCode,\n\t\tisCanceled,\n\t\tisGracefullyCanceled,\n\t\tisForcefullyTerminated,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t});\n\tconst originalMessage = getOriginalMessage(originalError, cwd);\n\tconst suffix = originalMessage === undefined ? '' : `\\n${originalMessage}`;\n\tconst shortMessage = `${prefix}: ${escapedCommand}${suffix}`;\n\tconst messageStdio = all === undefined ? [stdio[2], stdio[1]] : [all];\n\tconst message = [\n\t\tshortMessage,\n\t\t...messageStdio,\n\t\t...stdio.slice(3),\n\t\tipcOutput.map(ipcMessage => serializeIpcMessage(ipcMessage)).join('\\n'),\n\t]\n\t\t.map(messagePart => escapeLines(stripFinalNewline(serializeMessagePart(messagePart))))\n\t\t.filter(Boolean)\n\t\t.join('\\n\\n');\n\treturn {originalMessage, shortMessage, message};\n};\n\nconst getErrorPrefix = ({\n\toriginalError,\n\ttimedOut,\n\ttimeout,\n\tisMaxBuffer,\n\tmaxBuffer,\n\terrorCode,\n\tsignal,\n\tsignalDescription,\n\texitCode,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisForcefullyTerminated,\n\tforceKillAfterDelay,\n\tkillSignal,\n}) => {\n\tconst forcefulSuffix = getForcefulSuffix(isForcefullyTerminated, forceKillAfterDelay);\n\n\tif (timedOut) {\n\t\treturn `Command timed out after ${timeout} milliseconds${forcefulSuffix}`;\n\t}\n\n\tif (isGracefullyCanceled) {\n\t\tif (signal === undefined) {\n\t\t\treturn `Command was gracefully canceled with exit code ${exitCode}`;\n\t\t}\n\n\t\treturn isForcefullyTerminated\n\t\t\t? `Command was gracefully canceled${forcefulSuffix}`\n\t\t\t: `Command was gracefully canceled with ${signal} (${signalDescription})`;\n\t}\n\n\tif (isCanceled) {\n\t\treturn `Command was canceled${forcefulSuffix}`;\n\t}\n\n\tif (isMaxBuffer) {\n\t\treturn `${getMaxBufferMessage(originalError, maxBuffer)}${forcefulSuffix}`;\n\t}\n\n\tif (errorCode !== undefined) {\n\t\treturn `Command failed with ${errorCode}${forcefulSuffix}`;\n\t}\n\n\tif (isForcefullyTerminated) {\n\t\treturn `Command was killed with ${killSignal} (${getSignalDescription(killSignal)})${forcefulSuffix}`;\n\t}\n\n\tif (signal !== undefined) {\n\t\treturn `Command was killed with ${signal} (${signalDescription})`;\n\t}\n\n\tif (exitCode !== undefined) {\n\t\treturn `Command failed with exit code ${exitCode}`;\n\t}\n\n\treturn 'Command failed';\n};\n\nconst getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated\n\t? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds`\n\t: '';\n\nconst getOriginalMessage = (originalError, cwd) => {\n\tif (originalError instanceof DiscardedError) {\n\t\treturn;\n\t}\n\n\tconst originalMessage = isExecaError(originalError)\n\t\t? originalError.originalMessage\n\t\t: String(originalError?.message ?? originalError);\n\tconst escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));\n\treturn escapedOriginalMessage === '' ? undefined : escapedOriginalMessage;\n};\n\nconst serializeIpcMessage = ipcMessage => typeof ipcMessage === 'string'\n\t? ipcMessage\n\t: inspect(ipcMessage);\n\nconst serializeMessagePart = messagePart => Array.isArray(messagePart)\n\t? messagePart.map(messageItem => stripFinalNewline(serializeMessageItem(messageItem))).filter(Boolean).join('\\n')\n\t: serializeMessageItem(messagePart);\n\nconst serializeMessageItem = messageItem => {\n\tif (typeof messageItem === 'string') {\n\t\treturn messageItem;\n\t}\n\n\tif (isUint8Array(messageItem)) {\n\t\treturn uint8ArrayToString(messageItem);\n\t}\n\n\treturn '';\n};\n","import {getSignalDescription} from '../terminate/signal.js';\nimport {getDurationMs} from './duration.js';\nimport {getFinalError} from './final-error.js';\nimport {createMessages} from './message.js';\n\n// Object returned on subprocess success\nexport const makeSuccessResult = ({\n\tcommand,\n\tescapedCommand,\n\tstdio,\n\tall,\n\tipcOutput,\n\toptions: {cwd},\n\tstartTime,\n}) => omitUndefinedProperties({\n\tcommand,\n\tescapedCommand,\n\tcwd,\n\tdurationMs: getDurationMs(startTime),\n\tfailed: false,\n\ttimedOut: false,\n\tisCanceled: false,\n\tisGracefullyCanceled: false,\n\tisTerminated: false,\n\tisMaxBuffer: false,\n\tisForcefullyTerminated: false,\n\texitCode: 0,\n\tstdout: stdio[1],\n\tstderr: stdio[2],\n\tall,\n\tstdio,\n\tipcOutput,\n\tpipedFrom: [],\n});\n\n// Object returned on subprocess failure before spawning\nexport const makeEarlyError = ({\n\terror,\n\tcommand,\n\tescapedCommand,\n\tfileDescriptors,\n\toptions,\n\tstartTime,\n\tisSync,\n}) => makeError({\n\terror,\n\tcommand,\n\tescapedCommand,\n\tstartTime,\n\ttimedOut: false,\n\tisCanceled: false,\n\tisGracefullyCanceled: false,\n\tisMaxBuffer: false,\n\tisForcefullyTerminated: false,\n\tstdio: Array.from({length: fileDescriptors.length}),\n\tipcOutput: [],\n\toptions,\n\tisSync,\n});\n\n// Object returned on subprocess failure\nexport const makeError = ({\n\terror: originalError,\n\tcommand,\n\tescapedCommand,\n\tstartTime,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\texitCode: rawExitCode,\n\tsignal: rawSignal,\n\tstdio,\n\tall,\n\tipcOutput,\n\toptions: {\n\t\ttimeoutDuration,\n\t\ttimeout = timeoutDuration,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t\tcwd,\n\t\tmaxBuffer,\n\t},\n\tisSync,\n}) => {\n\tconst {exitCode, signal, signalDescription} = normalizeExitPayload(rawExitCode, rawSignal);\n\tconst {originalMessage, shortMessage, message} = createMessages({\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\toriginalError,\n\t\tsignal,\n\t\tsignalDescription,\n\t\texitCode,\n\t\tescapedCommand,\n\t\ttimedOut,\n\t\tisCanceled,\n\t\tisGracefullyCanceled,\n\t\tisMaxBuffer,\n\t\tisForcefullyTerminated,\n\t\tforceKillAfterDelay,\n\t\tkillSignal,\n\t\tmaxBuffer,\n\t\ttimeout,\n\t\tcwd,\n\t});\n\tconst error = getFinalError(originalError, message, isSync);\n\tObject.assign(error, getErrorProperties({\n\t\terror,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\ttimedOut,\n\t\tisCanceled,\n\t\tisGracefullyCanceled,\n\t\tisMaxBuffer,\n\t\tisForcefullyTerminated,\n\t\texitCode,\n\t\tsignal,\n\t\tsignalDescription,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\tcwd,\n\t\toriginalMessage,\n\t\tshortMessage,\n\t}));\n\treturn error;\n};\n\nconst getErrorProperties = ({\n\terror,\n\tcommand,\n\tescapedCommand,\n\tstartTime,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\texitCode,\n\tsignal,\n\tsignalDescription,\n\tstdio,\n\tall,\n\tipcOutput,\n\tcwd,\n\toriginalMessage,\n\tshortMessage,\n}) => omitUndefinedProperties({\n\tshortMessage,\n\toriginalMessage,\n\tcommand,\n\tescapedCommand,\n\tcwd,\n\tdurationMs: getDurationMs(startTime),\n\tfailed: true,\n\ttimedOut,\n\tisCanceled,\n\tisGracefullyCanceled,\n\tisTerminated: signal !== undefined,\n\tisMaxBuffer,\n\tisForcefullyTerminated,\n\texitCode,\n\tsignal,\n\tsignalDescription,\n\tcode: error.cause?.code,\n\tstdout: stdio[1],\n\tstderr: stdio[2],\n\tall,\n\tstdio,\n\tipcOutput,\n\tpipedFrom: [],\n});\n\nconst omitUndefinedProperties = result => Object.fromEntries(Object.entries(result).filter(([, value]) => value !== undefined));\n\n// `signal` and `exitCode` emitted on `subprocess.on('exit')` event can be `null`.\n// We normalize them to `undefined`\nconst normalizeExitPayload = (rawExitCode, rawSignal) => {\n\tconst exitCode = rawExitCode === null ? undefined : rawExitCode;\n\tconst signal = rawSignal === null ? undefined : rawSignal;\n\tconst signalDescription = signal === undefined ? undefined : getSignalDescription(rawSignal);\n\treturn {exitCode, signal, signalDescription};\n};\n","const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;\n\nfunction parseNumber(milliseconds) {\n\treturn {\n\t\tdays: Math.trunc(milliseconds / 86_400_000),\n\t\thours: Math.trunc(milliseconds / 3_600_000 % 24),\n\t\tminutes: Math.trunc(milliseconds / 60_000 % 60),\n\t\tseconds: Math.trunc(milliseconds / 1000 % 60),\n\t\tmilliseconds: Math.trunc(milliseconds % 1000),\n\t\tmicroseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000),\n\t\tnanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000),\n\t};\n}\n\nfunction parseBigint(milliseconds) {\n\treturn {\n\t\tdays: milliseconds / 86_400_000n,\n\t\thours: milliseconds / 3_600_000n % 24n,\n\t\tminutes: milliseconds / 60_000n % 60n,\n\t\tseconds: milliseconds / 1000n % 60n,\n\t\tmilliseconds: milliseconds % 1000n,\n\t\tmicroseconds: 0n,\n\t\tnanoseconds: 0n,\n\t};\n}\n\nexport default function parseMilliseconds(milliseconds) {\n\tswitch (typeof milliseconds) {\n\t\tcase 'number': {\n\t\t\tif (Number.isFinite(milliseconds)) {\n\t\t\t\treturn parseNumber(milliseconds);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'bigint': {\n\t\t\treturn parseBigint(milliseconds);\n\t\t}\n\n\t\t// No default\n\t}\n\n\tthrow new TypeError('Expected a finite number or bigint');\n}\n","import parseMilliseconds from 'parse-ms';\n\nconst isZero = value => value === 0 || value === 0n;\nconst pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`;\n\nconst SECOND_ROUNDING_EPSILON = 0.000_000_1;\nconst ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;\n\nexport default function prettyMilliseconds(milliseconds, options) {\n\tconst isBigInt = typeof milliseconds === 'bigint';\n\tif (!isBigInt && !Number.isFinite(milliseconds)) {\n\t\tthrow new TypeError('Expected a finite number or bigint');\n\t}\n\n\toptions = {...options};\n\n\tconst sign = milliseconds < 0 ? '-' : '';\n\tmilliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support.\n\n\tif (options.colonNotation) {\n\t\toptions.compact = false;\n\t\toptions.formatSubMilliseconds = false;\n\t\toptions.separateMilliseconds = false;\n\t\toptions.verbose = false;\n\t}\n\n\tif (options.compact) {\n\t\toptions.unitCount = 1;\n\t\toptions.secondsDecimalDigits = 0;\n\t\toptions.millisecondsDecimalDigits = 0;\n\t}\n\n\tlet result = [];\n\n\tconst floorDecimals = (value, decimalDigits) => {\n\t\tconst flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);\n\t\tconst flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits);\n\t\treturn flooredValue.toFixed(decimalDigits);\n\t};\n\n\tconst add = (value, long, short, valueString) => {\n\t\tif (\n\t\t\t(result.length === 0 || !options.colonNotation)\n\t\t\t&& isZero(value)\n\t\t\t&& !(options.colonNotation && short === 'm')) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalueString ??= String(value);\n\t\tif (options.colonNotation) {\n\t\t\tconst wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;\n\t\t\tconst minLength = result.length > 0 ? 2 : 1;\n\t\t\tvalueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;\n\t\t} else {\n\t\t\tvalueString += options.verbose ? ' ' + pluralize(long, value) : short;\n\t\t}\n\n\t\tresult.push(valueString);\n\t};\n\n\tconst parsed = parseMilliseconds(milliseconds);\n\tconst days = BigInt(parsed.days);\n\n\tif (options.hideYearAndDays) {\n\t\tadd((BigInt(days) * 24n) + BigInt(parsed.hours), 'hour', 'h');\n\t} else {\n\t\tif (options.hideYear) {\n\t\t\tadd(days, 'day', 'd');\n\t\t} else {\n\t\t\tadd(days / 365n, 'year', 'y');\n\t\t\tadd(days % 365n, 'day', 'd');\n\t\t}\n\n\t\tadd(Number(parsed.hours), 'hour', 'h');\n\t}\n\n\tadd(Number(parsed.minutes), 'minute', 'm');\n\n\tif (!options.hideSeconds) {\n\t\tif (\n\t\t\toptions.separateMilliseconds\n\t\t\t|| options.formatSubMilliseconds\n\t\t\t|| (!options.colonNotation && milliseconds < 1000 && !options.subSecondsAsDecimals)\n\t\t) {\n\t\t\tconst seconds = Number(parsed.seconds);\n\t\t\tconst milliseconds = Number(parsed.milliseconds);\n\t\t\tconst microseconds = Number(parsed.microseconds);\n\t\t\tconst nanoseconds = Number(parsed.nanoseconds);\n\n\t\t\tadd(seconds, 'second', 's');\n\n\t\t\tif (options.formatSubMilliseconds) {\n\t\t\t\tadd(milliseconds, 'millisecond', 'ms');\n\t\t\t\tadd(microseconds, 'microsecond', 'µs');\n\t\t\t\tadd(nanoseconds, 'nanosecond', 'ns');\n\t\t\t} else {\n\t\t\t\tconst millisecondsAndBelow\n\t\t\t\t\t= milliseconds\n\t\t\t\t\t+ (microseconds / 1000)\n\t\t\t\t\t+ (nanoseconds / 1e6);\n\n\t\t\t\tconst millisecondsDecimalDigits\n\t\t\t\t\t= typeof options.millisecondsDecimalDigits === 'number'\n\t\t\t\t\t\t? options.millisecondsDecimalDigits\n\t\t\t\t\t\t: 0;\n\n\t\t\t\tconst roundedMilliseconds = millisecondsAndBelow >= 1\n\t\t\t\t\t? Math.round(millisecondsAndBelow)\n\t\t\t\t\t: Math.ceil(millisecondsAndBelow);\n\n\t\t\t\tconst millisecondsString = millisecondsDecimalDigits\n\t\t\t\t\t? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)\n\t\t\t\t\t: roundedMilliseconds;\n\n\t\t\t\tadd(\n\t\t\t\t\tNumber.parseFloat(millisecondsString),\n\t\t\t\t\t'millisecond',\n\t\t\t\t\t'ms',\n\t\t\t\t\tmillisecondsString,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst seconds = (\n\t\t\t\t(isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds)\n\t\t\t\t/ 1000\n\t\t\t) % 60;\n\t\t\tconst secondsDecimalDigits\n\t\t\t\t= typeof options.secondsDecimalDigits === 'number'\n\t\t\t\t\t? options.secondsDecimalDigits\n\t\t\t\t\t: 1;\n\t\t\tconst secondsFixed = floorDecimals(seconds, secondsDecimalDigits);\n\t\t\tconst secondsString = options.keepDecimalsOnWholeSeconds\n\t\t\t\t? secondsFixed\n\t\t\t\t: secondsFixed.replace(/\\.0+$/, '');\n\t\t\tadd(Number.parseFloat(secondsString), 'second', 's', secondsString);\n\t\t}\n\t}\n\n\tif (result.length === 0) {\n\t\treturn sign + '0' + (options.verbose ? ' milliseconds' : 'ms');\n\t}\n\n\tconst separator = options.colonNotation ? ':' : ' ';\n\tif (typeof options.unitCount === 'number') {\n\t\tresult = result.slice(0, Math.max(options.unitCount, 1));\n\t}\n\n\treturn sign + result.join(separator);\n}\n","import {verboseLog} from './log.js';\n\n// When `verbose` is `short|full|custom`, print each command's error when it fails\nexport const logError = (result, verboseInfo) => {\n\tif (result.failed) {\n\t\tverboseLog({\n\t\t\ttype: 'error',\n\t\t\tverboseMessage: result.shortMessage,\n\t\t\tverboseInfo,\n\t\t\tresult,\n\t\t});\n\t}\n};\n","import prettyMs from 'pretty-ms';\nimport {isVerbose} from './values.js';\nimport {verboseLog} from './log.js';\nimport {logError} from './error.js';\n\n// When `verbose` is `short|full|custom`, print each command's completion, duration and error\nexport const logResult = (result, verboseInfo) => {\n\tif (!isVerbose(verboseInfo)) {\n\t\treturn;\n\t}\n\n\tlogError(result, verboseInfo);\n\tlogDuration(result, verboseInfo);\n};\n\nconst logDuration = (result, verboseInfo) => {\n\tconst verboseMessage = `(done in ${prettyMs(result.durationMs)})`;\n\tverboseLog({\n\t\ttype: 'duration',\n\t\tverboseMessage,\n\t\tverboseInfo,\n\t\tresult,\n\t});\n};\n","import {logResult} from '../verbose/complete.js';\n\n// Applies the `reject` option.\n// Also print the final log line with `verbose`.\nexport const handleResult = (result, verboseInfo, {reject}) => {\n\tlogResult(result, verboseInfo);\n\n\tif (result.failed && reject) {\n\t\tthrow result;\n\t}\n\n\treturn result;\n};\n","import {isStream as isNodeStream, isDuplexStream} from 'is-stream';\nimport isPlainObj from 'is-plain-obj';\nimport {isUint8Array} from '../utils/uint-array.js';\n\n// The `stdin`/`stdout`/`stderr` option can be of many types. This detects it.\nexport const getStdioItemType = (value, optionName) => {\n\tif (isAsyncGenerator(value)) {\n\t\treturn 'asyncGenerator';\n\t}\n\n\tif (isSyncGenerator(value)) {\n\t\treturn 'generator';\n\t}\n\n\tif (isUrl(value)) {\n\t\treturn 'fileUrl';\n\t}\n\n\tif (isFilePathObject(value)) {\n\t\treturn 'filePath';\n\t}\n\n\tif (isWebStream(value)) {\n\t\treturn 'webStream';\n\t}\n\n\tif (isNodeStream(value, {checkOpen: false})) {\n\t\treturn 'native';\n\t}\n\n\tif (isUint8Array(value)) {\n\t\treturn 'uint8Array';\n\t}\n\n\tif (isAsyncIterableObject(value)) {\n\t\treturn 'asyncIterable';\n\t}\n\n\tif (isIterableObject(value)) {\n\t\treturn 'iterable';\n\t}\n\n\tif (isTransformStream(value)) {\n\t\treturn getTransformStreamType({transform: value}, optionName);\n\t}\n\n\tif (isTransformOptions(value)) {\n\t\treturn getTransformObjectType(value, optionName);\n\t}\n\n\treturn 'native';\n};\n\nconst getTransformObjectType = (value, optionName) => {\n\tif (isDuplexStream(value.transform, {checkOpen: false})) {\n\t\treturn getDuplexType(value, optionName);\n\t}\n\n\tif (isTransformStream(value.transform)) {\n\t\treturn getTransformStreamType(value, optionName);\n\t}\n\n\treturn getGeneratorObjectType(value, optionName);\n};\n\nconst getDuplexType = (value, optionName) => {\n\tvalidateNonGeneratorType(value, optionName, 'Duplex stream');\n\treturn 'duplex';\n};\n\nconst getTransformStreamType = (value, optionName) => {\n\tvalidateNonGeneratorType(value, optionName, 'web TransformStream');\n\treturn 'webTransform';\n};\n\nconst validateNonGeneratorType = ({final, binary, objectMode}, optionName, typeName) => {\n\tcheckUndefinedOption(final, `${optionName}.final`, typeName);\n\tcheckUndefinedOption(binary, `${optionName}.binary`, typeName);\n\tcheckBooleanOption(objectMode, `${optionName}.objectMode`);\n};\n\nconst checkUndefinedOption = (value, optionName, typeName) => {\n\tif (value !== undefined) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option can only be defined when using a generator, not a ${typeName}.`);\n\t}\n};\n\nconst getGeneratorObjectType = ({transform, final, binary, objectMode}, optionName) => {\n\tif (transform !== undefined && !isGenerator(transform)) {\n\t\tthrow new TypeError(`The \\`${optionName}.transform\\` option must be a generator, a Duplex stream or a web TransformStream.`);\n\t}\n\n\tif (isDuplexStream(final, {checkOpen: false})) {\n\t\tthrow new TypeError(`The \\`${optionName}.final\\` option must not be a Duplex stream.`);\n\t}\n\n\tif (isTransformStream(final)) {\n\t\tthrow new TypeError(`The \\`${optionName}.final\\` option must not be a web TransformStream.`);\n\t}\n\n\tif (final !== undefined && !isGenerator(final)) {\n\t\tthrow new TypeError(`The \\`${optionName}.final\\` option must be a generator.`);\n\t}\n\n\tcheckBooleanOption(binary, `${optionName}.binary`);\n\tcheckBooleanOption(objectMode, `${optionName}.objectMode`);\n\n\treturn isAsyncGenerator(transform) || isAsyncGenerator(final) ? 'asyncGenerator' : 'generator';\n};\n\nconst checkBooleanOption = (value, optionName) => {\n\tif (value !== undefined && typeof value !== 'boolean') {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option must use a boolean.`);\n\t}\n};\n\nconst isGenerator = value => isAsyncGenerator(value) || isSyncGenerator(value);\nexport const isAsyncGenerator = value => Object.prototype.toString.call(value) === '[object AsyncGeneratorFunction]';\nconst isSyncGenerator = value => Object.prototype.toString.call(value) === '[object GeneratorFunction]';\nconst isTransformOptions = value => isPlainObj(value)\n\t&& (value.transform !== undefined || value.final !== undefined);\n\nexport const isUrl = value => Object.prototype.toString.call(value) === '[object URL]';\nexport const isRegularUrl = value => isUrl(value) && value.protocol !== 'file:';\n\nconst isFilePathObject = value => isPlainObj(value)\n\t&& Object.keys(value).length > 0\n\t&& Object.keys(value).every(key => FILE_PATH_KEYS.has(key))\n\t&& isFilePathString(value.file);\nconst FILE_PATH_KEYS = new Set(['file', 'append']);\nexport const isFilePathString = file => typeof file === 'string';\n\nexport const isUnknownStdioString = (type, value) => type === 'native'\n\t&& typeof value === 'string'\n\t&& !KNOWN_STDIO_STRINGS.has(value);\nconst KNOWN_STDIO_STRINGS = new Set(['ipc', 'ignore', 'inherit', 'overlapped', 'pipe']);\n\nconst isReadableStream = value => Object.prototype.toString.call(value) === '[object ReadableStream]';\nexport const isWritableStream = value => Object.prototype.toString.call(value) === '[object WritableStream]';\nconst isWebStream = value => isReadableStream(value) || isWritableStream(value);\nconst isTransformStream = value => isReadableStream(value?.readable) && isWritableStream(value?.writable);\n\nconst isAsyncIterableObject = value => isObject(value) && typeof value[Symbol.asyncIterator] === 'function';\nconst isIterableObject = value => isObject(value) && typeof value[Symbol.iterator] === 'function';\nconst isObject = value => typeof value === 'object' && value !== null;\n\n// Types which modify `subprocess.std*`\nexport const TRANSFORM_TYPES = new Set(['generator', 'asyncGenerator', 'duplex', 'webTransform']);\n// Types which write to a file or a file descriptor\nexport const FILE_TYPES = new Set(['fileUrl', 'filePath', 'fileNumber']);\n// When two file descriptors of this type share the same target, we need to do some special logic\nexport const SPECIAL_DUPLICATE_TYPES_SYNC = new Set(['fileUrl', 'filePath']);\nexport const SPECIAL_DUPLICATE_TYPES = new Set([...SPECIAL_DUPLICATE_TYPES_SYNC, 'webStream', 'nodeStream']);\n// Do not allow two file descriptors of this type sharing the same target\nexport const FORBID_DUPLICATE_TYPES = new Set(['webTransform', 'duplex']);\n\n// Convert types to human-friendly strings for error messages\nexport const TYPE_TO_MESSAGE = {\n\tgenerator: 'a generator',\n\tasyncGenerator: 'an async generator',\n\tfileUrl: 'a file URL',\n\tfilePath: 'a file path string',\n\tfileNumber: 'a file descriptor number',\n\twebStream: 'a web stream',\n\tnodeStream: 'a Node.js stream',\n\twebTransform: 'a web TransformStream',\n\tduplex: 'a Duplex stream',\n\tnative: 'any value',\n\titerable: 'an iterable',\n\tasyncIterable: 'an async iterable',\n\tstring: 'a string',\n\tuint8Array: 'a Uint8Array',\n};\n","import {TRANSFORM_TYPES} from '../stdio/type.js';\n\n/*\nRetrieve the `objectMode`s of a single transform.\n`objectMode` determines the return value's type, i.e. the `readableObjectMode`.\nThe chunk argument's type is based on the previous generator's return value, i.e. the `writableObjectMode` is based on the previous `readableObjectMode`.\nThe last input's generator is read by `subprocess.stdin` which:\n- should not be in `objectMode` for performance reasons.\n- can only be strings, Buffers and Uint8Arrays.\nTherefore its `readableObjectMode` must be `false`.\nThe same applies to the first output's generator's `writableObjectMode`.\n*/\nexport const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === 'output'\n\t? getOutputObjectModes(objectMode, index, newTransforms)\n\t: getInputObjectModes(objectMode, index, newTransforms);\n\nconst getOutputObjectModes = (objectMode, index, newTransforms) => {\n\tconst writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;\n\tconst readableObjectMode = objectMode ?? writableObjectMode;\n\treturn {writableObjectMode, readableObjectMode};\n};\n\nconst getInputObjectModes = (objectMode, index, newTransforms) => {\n\tconst writableObjectMode = index === 0\n\t\t? objectMode === true\n\t\t: newTransforms[index - 1].value.readableObjectMode;\n\tconst readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode);\n\treturn {writableObjectMode, readableObjectMode};\n};\n\n// Retrieve the `objectMode` of a file descriptor, e.g. `stdout` or `stderr`\nexport const getFdObjectMode = (stdioItems, direction) => {\n\tconst lastTransform = stdioItems.findLast(({type}) => TRANSFORM_TYPES.has(type));\n\tif (lastTransform === undefined) {\n\t\treturn false;\n\t}\n\n\treturn direction === 'input'\n\t\t? lastTransform.value.writableObjectMode\n\t\t: lastTransform.value.readableObjectMode;\n};\n","import isPlainObj from 'is-plain-obj';\nimport {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {getTransformObjectModes} from './object-mode.js';\n\n// Transforms generators/duplex/TransformStream can have multiple shapes.\n// This normalizes it and applies default values.\nexport const normalizeTransforms = (stdioItems, optionName, direction, options) => [\n\t...stdioItems.filter(({type}) => !TRANSFORM_TYPES.has(type)),\n\t...getTransforms(stdioItems, optionName, direction, options),\n];\n\nconst getTransforms = (stdioItems, optionName, direction, {encoding}) => {\n\tconst transforms = stdioItems.filter(({type}) => TRANSFORM_TYPES.has(type));\n\tconst newTransforms = Array.from({length: transforms.length});\n\n\tfor (const [index, stdioItem] of Object.entries(transforms)) {\n\t\tnewTransforms[index] = normalizeTransform({\n\t\t\tstdioItem,\n\t\t\tindex: Number(index),\n\t\t\tnewTransforms,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t\tencoding,\n\t\t});\n\t}\n\n\treturn sortTransforms(newTransforms, direction);\n};\n\nconst normalizeTransform = ({stdioItem, stdioItem: {type}, index, newTransforms, optionName, direction, encoding}) => {\n\tif (type === 'duplex') {\n\t\treturn normalizeDuplex({stdioItem, optionName});\n\t}\n\n\tif (type === 'webTransform') {\n\t\treturn normalizeTransformStream({\n\t\t\tstdioItem,\n\t\t\tindex,\n\t\t\tnewTransforms,\n\t\t\tdirection,\n\t\t});\n\t}\n\n\treturn normalizeGenerator({\n\t\tstdioItem,\n\t\tindex,\n\t\tnewTransforms,\n\t\tdirection,\n\t\tencoding,\n\t});\n};\n\nconst normalizeDuplex = ({\n\tstdioItem,\n\tstdioItem: {\n\t\tvalue: {\n\t\t\ttransform,\n\t\t\ttransform: {writableObjectMode, readableObjectMode},\n\t\t\tobjectMode = readableObjectMode,\n\t\t},\n\t},\n\toptionName,\n}) => {\n\tif (objectMode && !readableObjectMode) {\n\t\tthrow new TypeError(`The \\`${optionName}.objectMode\\` option can only be \\`true\\` if \\`new Duplex({objectMode: true})\\` is used.`);\n\t}\n\n\tif (!objectMode && readableObjectMode) {\n\t\tthrow new TypeError(`The \\`${optionName}.objectMode\\` option cannot be \\`false\\` if \\`new Duplex({objectMode: true})\\` is used.`);\n\t}\n\n\treturn {\n\t\t...stdioItem,\n\t\tvalue: {transform, writableObjectMode, readableObjectMode},\n\t};\n};\n\nconst normalizeTransformStream = ({stdioItem, stdioItem: {value}, index, newTransforms, direction}) => {\n\tconst {transform, objectMode} = isPlainObj(value) ? value : {transform: value};\n\tconst {writableObjectMode, readableObjectMode} = getTransformObjectModes(objectMode, index, newTransforms, direction);\n\treturn ({\n\t\t...stdioItem,\n\t\tvalue: {transform, writableObjectMode, readableObjectMode},\n\t});\n};\n\nconst normalizeGenerator = ({stdioItem, stdioItem: {value}, index, newTransforms, direction, encoding}) => {\n\tconst {\n\t\ttransform,\n\t\tfinal,\n\t\tbinary: binaryOption = false,\n\t\tpreserveNewlines = false,\n\t\tobjectMode,\n\t} = isPlainObj(value) ? value : {transform: value};\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst {writableObjectMode, readableObjectMode} = getTransformObjectModes(objectMode, index, newTransforms, direction);\n\treturn {\n\t\t...stdioItem,\n\t\tvalue: {\n\t\t\ttransform,\n\t\t\tfinal,\n\t\t\tbinary,\n\t\t\tpreserveNewlines,\n\t\t\twritableObjectMode,\n\t\t\treadableObjectMode,\n\t\t},\n\t};\n};\n\nconst sortTransforms = (newTransforms, direction) => direction === 'input' ? newTransforms.reverse() : newTransforms;\n","import process from 'node:process';\nimport {\n\tisStream as isNodeStream,\n\tisReadableStream as isNodeReadableStream,\n\tisWritableStream as isNodeWritableStream,\n} from 'is-stream';\nimport {isWritableStream} from './type.js';\n\n// For `stdio[fdNumber]` beyond stdin/stdout/stderr, we need to guess whether the value passed is intended for inputs or outputs.\n// This allows us to know whether to pipe _into_ or _from_ the stream.\n// When `stdio[fdNumber]` is a single value, this guess is fairly straightforward.\n// However, when it is an array instead, we also need to make sure the different values are not incompatible with each other.\nexport const getStreamDirection = (stdioItems, fdNumber, optionName) => {\n\tconst directions = stdioItems.map(stdioItem => getStdioItemDirection(stdioItem, fdNumber));\n\n\tif (directions.includes('input') && directions.includes('output')) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option must not be an array of both readable and writable values.`);\n\t}\n\n\treturn directions.find(Boolean) ?? DEFAULT_DIRECTION;\n};\n\nconst getStdioItemDirection = ({type, value}, fdNumber) => KNOWN_DIRECTIONS[fdNumber] ?? guessStreamDirection[type](value);\n\n// `stdin`/`stdout`/`stderr` have a known direction\nconst KNOWN_DIRECTIONS = ['input', 'output', 'output'];\n\nconst anyDirection = () => undefined;\nconst alwaysInput = () => 'input';\n\n// `string` can only be added through the `input` option, i.e. does not need to be handled here\nconst guessStreamDirection = {\n\tgenerator: anyDirection,\n\tasyncGenerator: anyDirection,\n\tfileUrl: anyDirection,\n\tfilePath: anyDirection,\n\titerable: alwaysInput,\n\tasyncIterable: alwaysInput,\n\tuint8Array: alwaysInput,\n\twebStream: value => isWritableStream(value) ? 'output' : 'input',\n\tnodeStream(value) {\n\t\tif (!isNodeReadableStream(value, {checkOpen: false})) {\n\t\t\treturn 'output';\n\t\t}\n\n\t\treturn isNodeWritableStream(value, {checkOpen: false}) ? undefined : 'input';\n\t},\n\twebTransform: anyDirection,\n\tduplex: anyDirection,\n\tnative(value) {\n\t\tconst standardStreamDirection = getStandardStreamDirection(value);\n\t\tif (standardStreamDirection !== undefined) {\n\t\t\treturn standardStreamDirection;\n\t\t}\n\n\t\tif (isNodeStream(value, {checkOpen: false})) {\n\t\t\treturn guessStreamDirection.nodeStream(value);\n\t\t}\n\t},\n};\n\nconst getStandardStreamDirection = value => {\n\tif ([0, process.stdin].includes(value)) {\n\t\treturn 'input';\n\t}\n\n\tif ([1, 2, process.stdout, process.stderr].includes(value)) {\n\t\treturn 'output';\n\t}\n};\n\n// When ambiguous, we initially keep the direction as `undefined`.\n// This allows arrays of `stdio` values to resolve the ambiguity.\n// For example, `stdio[3]: DuplexStream` is ambiguous, but `stdio[3]: [DuplexStream, WritableStream]` is not.\n// When the ambiguity remains, we default to `output` since it is the most common use case for additional file descriptors.\nconst DEFAULT_DIRECTION = 'output';\n","// The `ipc` option adds an `ipc` item to the `stdio` option\nexport const normalizeIpcStdioArray = (stdioArray, ipc) => ipc && !stdioArray.includes('ipc')\n\t? [...stdioArray, 'ipc']\n\t: stdioArray;\n","import {STANDARD_STREAMS_ALIASES} from '../utils/standard-stream.js';\nimport {normalizeIpcStdioArray} from '../ipc/array.js';\nimport {isFullVerbose} from '../verbose/values.js';\n\n// Add support for `stdin`/`stdout`/`stderr` as an alias for `stdio`.\n// Also normalize the `stdio` option.\nexport const normalizeStdioOption = ({stdio, ipc, buffer, ...options}, verboseInfo, isSync) => {\n\tconst stdioArray = getStdioArray(stdio, options).map((stdioOption, fdNumber) => addDefaultValue(stdioOption, fdNumber));\n\treturn isSync\n\t\t? normalizeStdioSync(stdioArray, buffer, verboseInfo)\n\t\t: normalizeIpcStdioArray(stdioArray, ipc);\n};\n\nconst getStdioArray = (stdio, options) => {\n\tif (stdio === undefined) {\n\t\treturn STANDARD_STREAMS_ALIASES.map(alias => options[alias]);\n\t}\n\n\tif (hasAlias(options)) {\n\t\tthrow new Error(`It's not possible to provide \\`stdio\\` in combination with one of ${STANDARD_STREAMS_ALIASES.map(alias => `\\`${alias}\\``).join(', ')}`);\n\t}\n\n\tif (typeof stdio === 'string') {\n\t\treturn [stdio, stdio, stdio];\n\t}\n\n\tif (!Array.isArray(stdio)) {\n\t\tthrow new TypeError(`Expected \\`stdio\\` to be of type \\`string\\` or \\`Array\\`, got \\`${typeof stdio}\\``);\n\t}\n\n\tconst length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length);\n\treturn Array.from({length}, (_, fdNumber) => stdio[fdNumber]);\n};\n\nconst hasAlias = options => STANDARD_STREAMS_ALIASES.some(alias => options[alias] !== undefined);\n\nconst addDefaultValue = (stdioOption, fdNumber) => {\n\tif (Array.isArray(stdioOption)) {\n\t\treturn stdioOption.map(item => addDefaultValue(item, fdNumber));\n\t}\n\n\tif (stdioOption === null || stdioOption === undefined) {\n\t\treturn fdNumber >= STANDARD_STREAMS_ALIASES.length ? 'ignore' : 'pipe';\n\t}\n\n\treturn stdioOption;\n};\n\n// Using `buffer: false` with synchronous methods implies `stdout`/`stderr`: `ignore`.\n// Unless the output is needed, e.g. due to `verbose: 'full'` or to redirecting to a file.\nconst normalizeStdioSync = (stdioArray, buffer, verboseInfo) => stdioArray.map((stdioOption, fdNumber) =>\n\t!buffer[fdNumber]\n\t&& fdNumber !== 0\n\t&& !isFullVerbose(verboseInfo, fdNumber)\n\t&& isOutputPipeOnly(stdioOption)\n\t\t? 'ignore'\n\t\t: stdioOption);\n\nconst isOutputPipeOnly = stdioOption => stdioOption === 'pipe'\n\t|| (Array.isArray(stdioOption) && stdioOption.every(item => item === 'pipe'));\n","import {readFileSync} from 'node:fs';\nimport tty from 'node:tty';\nimport {isStream as isNodeStream} from 'is-stream';\nimport {STANDARD_STREAMS} from '../utils/standard-stream.js';\nimport {bufferToUint8Array} from '../utils/uint-array.js';\nimport {serializeOptionValue} from '../arguments/fd-options.js';\n\n// When we use multiple `stdio` values for the same streams, we pass 'pipe' to `child_process.spawn()`.\n// We then emulate the piping done by core Node.js.\n// To do so, we transform the following values:\n// - Node.js streams are marked as `type: nodeStream`\n// - 'inherit' becomes `process.stdin|stdout|stderr`\n// - any file descriptor integer becomes `process.stdio[fdNumber]`\n// All of the above transformations tell Execa to perform manual piping.\nexport const handleNativeStream = ({stdioItem, stdioItem: {type}, isStdioArray, fdNumber, direction, isSync}) => {\n\tif (!isStdioArray || type !== 'native') {\n\t\treturn stdioItem;\n\t}\n\n\treturn isSync\n\t\t? handleNativeStreamSync({stdioItem, fdNumber, direction})\n\t\t: handleNativeStreamAsync({stdioItem, fdNumber});\n};\n\n// Synchronous methods use a different logic.\n// 'inherit', file descriptors and process.std* are handled by readFileSync()/writeFileSync().\nconst handleNativeStreamSync = ({stdioItem, stdioItem: {value, optionName}, fdNumber, direction}) => {\n\tconst targetFd = getTargetFd({\n\t\tvalue,\n\t\toptionName,\n\t\tfdNumber,\n\t\tdirection,\n\t});\n\tif (targetFd !== undefined) {\n\t\treturn targetFd;\n\t}\n\n\tif (isNodeStream(value, {checkOpen: false})) {\n\t\tthrow new TypeError(`The \\`${optionName}: Stream\\` option cannot both be an array and include a stream with synchronous methods.`);\n\t}\n\n\treturn stdioItem;\n};\n\nconst getTargetFd = ({value, optionName, fdNumber, direction}) => {\n\tconst targetFdNumber = getTargetFdNumber(value, fdNumber);\n\tif (targetFdNumber === undefined) {\n\t\treturn;\n\t}\n\n\tif (direction === 'output') {\n\t\treturn {type: 'fileNumber', value: targetFdNumber, optionName};\n\t}\n\n\tif (tty.isatty(targetFdNumber)) {\n\t\tthrow new TypeError(`The \\`${optionName}: ${serializeOptionValue(value)}\\` option is invalid: it cannot be a TTY with synchronous methods.`);\n\t}\n\n\treturn {type: 'uint8Array', value: bufferToUint8Array(readFileSync(targetFdNumber)), optionName};\n};\n\nconst getTargetFdNumber = (value, fdNumber) => {\n\tif (value === 'inherit') {\n\t\treturn fdNumber;\n\t}\n\n\tif (typeof value === 'number') {\n\t\treturn value;\n\t}\n\n\tconst standardStreamIndex = STANDARD_STREAMS.indexOf(value);\n\tif (standardStreamIndex !== -1) {\n\t\treturn standardStreamIndex;\n\t}\n};\n\nconst handleNativeStreamAsync = ({stdioItem, stdioItem: {value, optionName}, fdNumber}) => {\n\tif (value === 'inherit') {\n\t\treturn {type: 'nodeStream', value: getStandardStream(fdNumber, value, optionName), optionName};\n\t}\n\n\tif (typeof value === 'number') {\n\t\treturn {type: 'nodeStream', value: getStandardStream(value, value, optionName), optionName};\n\t}\n\n\tif (isNodeStream(value, {checkOpen: false})) {\n\t\treturn {type: 'nodeStream', value, optionName};\n\t}\n\n\treturn stdioItem;\n};\n\n// Node.js does not allow to easily retrieve file descriptors beyond stdin/stdout/stderr as streams.\n// - `fs.createReadStream()`/`fs.createWriteStream()` with the `fd` option do not work with character devices that use blocking reads/writes (such as interactive TTYs).\n// - Using a TCP `Socket` would work but be rather complex to implement.\n// Since this is an edge case, we simply throw an error message.\n// See https://github.com/sindresorhus/execa/pull/643#discussion_r1435905707\nconst getStandardStream = (fdNumber, value, optionName) => {\n\tconst standardStream = STANDARD_STREAMS[fdNumber];\n\n\tif (standardStream === undefined) {\n\t\tthrow new TypeError(`The \\`${optionName}: ${value}\\` option is invalid: no such standard stream.`);\n\t}\n\n\treturn standardStream;\n};\n","import {isReadableStream} from 'is-stream';\nimport {isUint8Array} from '../utils/uint-array.js';\nimport {isUrl, isFilePathString} from './type.js';\n\n// Append the `stdin` option with the `input` and `inputFile` options\nexport const handleInputOptions = ({input, inputFile}, fdNumber) => fdNumber === 0\n\t? [\n\t\t...handleInputOption(input),\n\t\t...handleInputFileOption(inputFile),\n\t]\n\t: [];\n\nconst handleInputOption = input => input === undefined ? [] : [{\n\ttype: getInputType(input),\n\tvalue: input,\n\toptionName: 'input',\n}];\n\nconst getInputType = input => {\n\tif (isReadableStream(input, {checkOpen: false})) {\n\t\treturn 'nodeStream';\n\t}\n\n\tif (typeof input === 'string') {\n\t\treturn 'string';\n\t}\n\n\tif (isUint8Array(input)) {\n\t\treturn 'uint8Array';\n\t}\n\n\tthrow new Error('The `input` option must be a string, a Uint8Array or a Node.js Readable stream.');\n};\n\nconst handleInputFileOption = inputFile => inputFile === undefined ? [] : [{\n\t...getInputFileType(inputFile),\n\toptionName: 'inputFile',\n}];\n\nconst getInputFileType = inputFile => {\n\tif (isUrl(inputFile)) {\n\t\treturn {type: 'fileUrl', value: inputFile};\n\t}\n\n\tif (isFilePathString(inputFile)) {\n\t\treturn {type: 'filePath', value: {file: inputFile}};\n\t}\n\n\tthrow new Error('The `inputFile` option must be a file path string or a file URL.');\n};\n","import {\n\tSPECIAL_DUPLICATE_TYPES_SYNC,\n\tSPECIAL_DUPLICATE_TYPES,\n\tFORBID_DUPLICATE_TYPES,\n\tTYPE_TO_MESSAGE,\n} from './type.js';\n\n// Duplicates in the same file descriptor is most likely an error.\n// However, this can be useful with generators.\nexport const filterDuplicates = stdioItems => stdioItems.filter((stdioItemOne, indexOne) =>\n\tstdioItems.every((stdioItemTwo, indexTwo) => stdioItemOne.value !== stdioItemTwo.value\n\t\t|| indexOne >= indexTwo\n\t\t|| stdioItemOne.type === 'generator'\n\t\t|| stdioItemOne.type === 'asyncGenerator'));\n\n// Check if two file descriptors are sharing the same target.\n// For example `{stdout: {file: './output.txt'}, stderr: {file: './output.txt'}}`.\nexport const getDuplicateStream = ({stdioItem: {type, value, optionName}, direction, fileDescriptors, isSync}) => {\n\tconst otherStdioItems = getOtherStdioItems(fileDescriptors, type);\n\tif (otherStdioItems.length === 0) {\n\t\treturn;\n\t}\n\n\tif (isSync) {\n\t\tvalidateDuplicateStreamSync({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t});\n\t\treturn;\n\t}\n\n\tif (SPECIAL_DUPLICATE_TYPES.has(type)) {\n\t\treturn getDuplicateStreamInstance({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t});\n\t}\n\n\tif (FORBID_DUPLICATE_TYPES.has(type)) {\n\t\tvalidateDuplicateTransform({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t});\n\t}\n};\n\n// Values shared by multiple file descriptors\nconst getOtherStdioItems = (fileDescriptors, type) => fileDescriptors\n\t.flatMap(({direction, stdioItems}) => stdioItems\n\t\t.filter(stdioItem => stdioItem.type === type)\n\t\t.map((stdioItem => ({...stdioItem, direction}))));\n\n// With `execaSync()`, do not allow setting a file path both in input and output\nconst validateDuplicateStreamSync = ({otherStdioItems, type, value, optionName, direction}) => {\n\tif (SPECIAL_DUPLICATE_TYPES_SYNC.has(type)) {\n\t\tgetDuplicateStreamInstance({\n\t\t\totherStdioItems,\n\t\t\ttype,\n\t\t\tvalue,\n\t\t\toptionName,\n\t\t\tdirection,\n\t\t});\n\t}\n};\n\n// When two file descriptors share the file or stream, we need to re-use the same underlying stream.\n// Otherwise, the stream would be closed twice when piping ends.\n// This is only an issue with output file descriptors.\n// This is not a problem with generator functions since those create a new instance for each file descriptor.\n// We also forbid input and output file descriptors sharing the same file or stream, since that does not make sense.\nconst getDuplicateStreamInstance = ({otherStdioItems, type, value, optionName, direction}) => {\n\tconst duplicateStdioItems = otherStdioItems.filter(stdioItem => hasSameValue(stdioItem, value));\n\tif (duplicateStdioItems.length === 0) {\n\t\treturn;\n\t}\n\n\tconst differentStdioItem = duplicateStdioItems.find(stdioItem => stdioItem.direction !== direction);\n\tthrowOnDuplicateStream(differentStdioItem, optionName, type);\n\n\treturn direction === 'output' ? duplicateStdioItems[0].stream : undefined;\n};\n\nconst hasSameValue = ({type, value}, secondValue) => {\n\tif (type === 'filePath') {\n\t\treturn value.file === secondValue.file;\n\t}\n\n\tif (type === 'fileUrl') {\n\t\treturn value.href === secondValue.href;\n\t}\n\n\treturn value === secondValue;\n};\n\n// We do not allow two file descriptors to share the same Duplex or TransformStream.\n// This is because those are set directly to `subprocess.std*`.\n// For example, this could result in `subprocess.stdout` and `subprocess.stderr` being the same value.\n// This means reading from either would get data from both stdout and stderr.\nconst validateDuplicateTransform = ({otherStdioItems, type, value, optionName}) => {\n\tconst duplicateStdioItem = otherStdioItems.find(({value: {transform}}) => transform === value.transform);\n\tthrowOnDuplicateStream(duplicateStdioItem, optionName, type);\n};\n\nconst throwOnDuplicateStream = (stdioItem, optionName, type) => {\n\tif (stdioItem !== undefined) {\n\t\tthrow new TypeError(`The \\`${stdioItem.optionName}\\` and \\`${optionName}\\` options must not target ${TYPE_TO_MESSAGE[type]} that is the same.`);\n\t}\n};\n","import {getStreamName, isStandardStream} from '../utils/standard-stream.js';\nimport {normalizeTransforms} from '../transform/normalize.js';\nimport {getFdObjectMode} from '../transform/object-mode.js';\nimport {\n\tgetStdioItemType,\n\tisRegularUrl,\n\tisUnknownStdioString,\n\tFILE_TYPES,\n} from './type.js';\nimport {getStreamDirection} from './direction.js';\nimport {normalizeStdioOption} from './stdio-option.js';\nimport {handleNativeStream} from './native.js';\nimport {handleInputOptions} from './input-option.js';\nimport {filterDuplicates, getDuplicateStream} from './duplicate.js';\n\n// Handle `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, before spawning, in async/sync mode\n// They are converted into an array of `fileDescriptors`.\n// Each `fileDescriptor` is normalized, validated and contains all information necessary for further handling.\nexport const handleStdio = (addProperties, options, verboseInfo, isSync) => {\n\tconst stdio = normalizeStdioOption(options, verboseInfo, isSync);\n\tconst initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({\n\t\tstdioOption,\n\t\tfdNumber,\n\t\toptions,\n\t\tisSync,\n\t}));\n\tconst fileDescriptors = getFinalFileDescriptors({\n\t\tinitialFileDescriptors,\n\t\taddProperties,\n\t\toptions,\n\t\tisSync,\n\t});\n\toptions.stdio = fileDescriptors.map(({stdioItems}) => forwardStdio(stdioItems));\n\treturn fileDescriptors;\n};\n\nconst getFileDescriptor = ({stdioOption, fdNumber, options, isSync}) => {\n\tconst optionName = getStreamName(fdNumber);\n\tconst {stdioItems: initialStdioItems, isStdioArray} = initializeStdioItems({\n\t\tstdioOption,\n\t\tfdNumber,\n\t\toptions,\n\t\toptionName,\n\t});\n\tconst direction = getStreamDirection(initialStdioItems, fdNumber, optionName);\n\tconst stdioItems = initialStdioItems.map(stdioItem => handleNativeStream({\n\t\tstdioItem,\n\t\tisStdioArray,\n\t\tfdNumber,\n\t\tdirection,\n\t\tisSync,\n\t}));\n\tconst normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options);\n\tconst objectMode = getFdObjectMode(normalizedStdioItems, direction);\n\tvalidateFileObjectMode(normalizedStdioItems, objectMode);\n\treturn {direction, objectMode, stdioItems: normalizedStdioItems};\n};\n\n// We make sure passing an array with a single item behaves the same as passing that item without an array.\n// This is what users would expect.\n// For example, `stdout: ['ignore']` behaves the same as `stdout: 'ignore'`.\nconst initializeStdioItems = ({stdioOption, fdNumber, options, optionName}) => {\n\tconst values = Array.isArray(stdioOption) ? stdioOption : [stdioOption];\n\tconst initialStdioItems = [\n\t\t...values.map(value => initializeStdioItem(value, optionName)),\n\t\t...handleInputOptions(options, fdNumber),\n\t];\n\n\tconst stdioItems = filterDuplicates(initialStdioItems);\n\tconst isStdioArray = stdioItems.length > 1;\n\tvalidateStdioArray(stdioItems, isStdioArray, optionName);\n\tvalidateStreams(stdioItems);\n\treturn {stdioItems, isStdioArray};\n};\n\nconst initializeStdioItem = (value, optionName) => ({\n\ttype: getStdioItemType(value, optionName),\n\tvalue,\n\toptionName,\n});\n\nconst validateStdioArray = (stdioItems, isStdioArray, optionName) => {\n\tif (stdioItems.length === 0) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option must not be an empty array.`);\n\t}\n\n\tif (!isStdioArray) {\n\t\treturn;\n\t}\n\n\tfor (const {value, optionName} of stdioItems) {\n\t\tif (INVALID_STDIO_ARRAY_OPTIONS.has(value)) {\n\t\t\tthrow new Error(`The \\`${optionName}\\` option must not include \\`${value}\\`.`);\n\t\t}\n\t}\n};\n\n// Using those `stdio` values together with others for the same stream does not make sense, so we make it fail.\n// However, we do allow it if the array has a single item.\nconst INVALID_STDIO_ARRAY_OPTIONS = new Set(['ignore', 'ipc']);\n\nconst validateStreams = stdioItems => {\n\tfor (const stdioItem of stdioItems) {\n\t\tvalidateFileStdio(stdioItem);\n\t}\n};\n\nconst validateFileStdio = ({type, value, optionName}) => {\n\tif (isRegularUrl(value)) {\n\t\tthrow new TypeError(`The \\`${optionName}: URL\\` option must use the \\`file:\\` scheme.\nFor example, you can use the \\`pathToFileURL()\\` method of the \\`url\\` core module.`);\n\t}\n\n\tif (isUnknownStdioString(type, value)) {\n\t\tthrow new TypeError(`The \\`${optionName}: { file: '...' }\\` option must be used instead of \\`${optionName}: '...'\\`.`);\n\t}\n};\n\nconst validateFileObjectMode = (stdioItems, objectMode) => {\n\tif (!objectMode) {\n\t\treturn;\n\t}\n\n\tconst fileStdioItem = stdioItems.find(({type}) => FILE_TYPES.has(type));\n\tif (fileStdioItem !== undefined) {\n\t\tthrow new TypeError(`The \\`${fileStdioItem.optionName}\\` option cannot use both files and transforms in objectMode.`);\n\t}\n};\n\n// Some `stdio` values require Execa to create streams.\n// For example, file paths create file read/write streams.\n// Those transformations are specified in `addProperties`, which is both direction-specific and type-specific.\nconst getFinalFileDescriptors = ({initialFileDescriptors, addProperties, options, isSync}) => {\n\tconst fileDescriptors = [];\n\n\ttry {\n\t\tfor (const fileDescriptor of initialFileDescriptors) {\n\t\t\tfileDescriptors.push(getFinalFileDescriptor({\n\t\t\t\tfileDescriptor,\n\t\t\t\tfileDescriptors,\n\t\t\t\taddProperties,\n\t\t\t\toptions,\n\t\t\t\tisSync,\n\t\t\t}));\n\t\t}\n\n\t\treturn fileDescriptors;\n\t} catch (error) {\n\t\tcleanupCustomStreams(fileDescriptors);\n\t\tthrow error;\n\t}\n};\n\nconst getFinalFileDescriptor = ({\n\tfileDescriptor: {direction, objectMode, stdioItems},\n\tfileDescriptors,\n\taddProperties,\n\toptions,\n\tisSync,\n}) => {\n\tconst finalStdioItems = stdioItems.map(stdioItem => addStreamProperties({\n\t\tstdioItem,\n\t\taddProperties,\n\t\tdirection,\n\t\toptions,\n\t\tfileDescriptors,\n\t\tisSync,\n\t}));\n\treturn {direction, objectMode, stdioItems: finalStdioItems};\n};\n\nconst addStreamProperties = ({stdioItem, addProperties, direction, options, fileDescriptors, isSync}) => {\n\tconst duplicateStream = getDuplicateStream({\n\t\tstdioItem,\n\t\tdirection,\n\t\tfileDescriptors,\n\t\tisSync,\n\t});\n\n\tif (duplicateStream !== undefined) {\n\t\treturn {...stdioItem, stream: duplicateStream};\n\t}\n\n\treturn {\n\t\t...stdioItem,\n\t\t...addProperties[direction][stdioItem.type](stdioItem, options),\n\t};\n};\n\n// The stream error handling is performed by the piping logic above, which cannot be performed before subprocess spawning.\n// If the subprocess spawning fails (e.g. due to an invalid command), the streams need to be manually destroyed.\n// We need to create those streams before subprocess spawning, in case their creation fails, e.g. when passing an invalid generator as argument.\n// Like this, an exception would be thrown, which would prevent spawning a subprocess.\nexport const cleanupCustomStreams = fileDescriptors => {\n\tfor (const {stdioItems} of fileDescriptors) {\n\t\tfor (const {stream} of stdioItems) {\n\t\t\tif (stream !== undefined && !isStandardStream(stream)) {\n\t\t\t\tstream.destroy();\n\t\t\t}\n\t\t}\n\t}\n};\n\n// When the `std*: Iterable | WebStream | URL | filePath`, `input` or `inputFile` option is used, we pipe to `subprocess.std*`.\n// When the `std*: Array` option is used, we emulate some of the native values ('inherit', Node.js stream and file descriptor integer). To do so, we also need to pipe to `subprocess.std*`.\n// Therefore the `std*` options must be either `pipe` or `overlapped`. Other values do not set `subprocess.std*`.\nconst forwardStdio = stdioItems => {\n\tif (stdioItems.length > 1) {\n\t\treturn stdioItems.some(({value}) => value === 'overlapped') ? 'overlapped' : 'pipe';\n\t}\n\n\tconst [{type, value}] = stdioItems;\n\treturn type === 'native' ? value : 'pipe';\n};\n","import {readFileSync} from 'node:fs';\nimport {bufferToUint8Array} from '../utils/uint-array.js';\nimport {handleStdio} from './handle.js';\nimport {TYPE_TO_MESSAGE} from './type.js';\n\n// Normalize `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, before spawning, in sync mode\nexport const handleStdioSync = (options, verboseInfo) => handleStdio(addPropertiesSync, options, verboseInfo, true);\n\nconst forbiddenIfSync = ({type, optionName}) => {\n\tthrowInvalidSyncValue(optionName, TYPE_TO_MESSAGE[type]);\n};\n\nconst forbiddenNativeIfSync = ({optionName, value}) => {\n\tif (value === 'ipc' || value === 'overlapped') {\n\t\tthrowInvalidSyncValue(optionName, `\"${value}\"`);\n\t}\n\n\treturn {};\n};\n\nconst throwInvalidSyncValue = (optionName, value) => {\n\tthrow new TypeError(`The \\`${optionName}\\` option cannot be ${value} with synchronous methods.`);\n};\n\n// Create streams used internally for redirecting when using specific values for the `std*` options, in sync mode.\n// For example, `stdin: {file}` reads the file synchronously, then passes it as the `input` option.\nconst addProperties = {\n\tgenerator() {},\n\tasyncGenerator: forbiddenIfSync,\n\twebStream: forbiddenIfSync,\n\tnodeStream: forbiddenIfSync,\n\twebTransform: forbiddenIfSync,\n\tduplex: forbiddenIfSync,\n\tasyncIterable: forbiddenIfSync,\n\tnative: forbiddenNativeIfSync,\n};\n\nconst addPropertiesSync = {\n\tinput: {\n\t\t...addProperties,\n\t\tfileUrl: ({value}) => ({contents: [bufferToUint8Array(readFileSync(value))]}),\n\t\tfilePath: ({value: {file}}) => ({contents: [bufferToUint8Array(readFileSync(file))]}),\n\t\tfileNumber: forbiddenIfSync,\n\t\titerable: ({value}) => ({contents: [...value]}),\n\t\tstring: ({value}) => ({contents: [value]}),\n\t\tuint8Array: ({value}) => ({contents: [value]}),\n\t},\n\toutput: {\n\t\t...addProperties,\n\t\tfileUrl: ({value}) => ({path: value}),\n\t\tfilePath: ({value: {file, append}}) => ({path: file, append}),\n\t\tfileNumber: ({value}) => ({path: value}),\n\t\titerable: forbiddenIfSync,\n\t\tstring: forbiddenIfSync,\n\t\tuint8Array: forbiddenIfSync,\n\t},\n};\n","import stripFinalNewlineFunction from 'strip-final-newline';\n\n// Apply `stripFinalNewline` option, which applies to `result.stdout|stderr|all|stdio[*]`.\n// If the `lines` option is used, it is applied on each line, but using a different function.\nexport const stripNewline = (value, {stripFinalNewline}, fdNumber) => getStripFinalNewline(stripFinalNewline, fdNumber) && value !== undefined && !Array.isArray(value)\n\t? stripFinalNewlineFunction(value)\n\t: value;\n\n// Retrieve `stripFinalNewline` option value, including with `subprocess.all`\nexport const getStripFinalNewline = (stripFinalNewline, fdNumber) => fdNumber === 'all'\n\t? stripFinalNewline[1] || stripFinalNewline[2]\n\t: stripFinalNewline[fdNumber];\n","// Split chunks line-wise for generators passed to the `std*` options\nexport const getSplitLinesGenerator = (binary, preserveNewlines, skipped, state) => binary || skipped\n\t? undefined\n\t: initializeSplitLines(preserveNewlines, state);\n\n// Same but for synchronous methods\nexport const splitLinesSync = (chunk, preserveNewlines, objectMode) => objectMode\n\t? chunk.flatMap(item => splitLinesItemSync(item, preserveNewlines))\n\t: splitLinesItemSync(chunk, preserveNewlines);\n\nconst splitLinesItemSync = (chunk, preserveNewlines) => {\n\tconst {transform, final} = initializeSplitLines(preserveNewlines, {});\n\treturn [...transform(chunk), ...final()];\n};\n\nconst initializeSplitLines = (preserveNewlines, state) => {\n\tstate.previousChunks = '';\n\treturn {\n\t\ttransform: splitGenerator.bind(undefined, state, preserveNewlines),\n\t\tfinal: linesFinal.bind(undefined, state),\n\t};\n};\n\n// This imperative logic is much faster than using `String.split()` and uses very low memory.\nconst splitGenerator = function * (state, preserveNewlines, chunk) {\n\tif (typeof chunk !== 'string') {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tlet {previousChunks} = state;\n\tlet start = -1;\n\n\tfor (let end = 0; end < chunk.length; end += 1) {\n\t\tif (chunk[end] === '\\n') {\n\t\t\tconst newlineLength = getNewlineLength(chunk, end, preserveNewlines, state);\n\t\t\tlet line = chunk.slice(start + 1, end + 1 - newlineLength);\n\n\t\t\tif (previousChunks.length > 0) {\n\t\t\t\tline = concatString(previousChunks, line);\n\t\t\t\tpreviousChunks = '';\n\t\t\t}\n\n\t\t\tyield line;\n\t\t\tstart = end;\n\t\t}\n\t}\n\n\tif (start !== chunk.length - 1) {\n\t\tpreviousChunks = concatString(previousChunks, chunk.slice(start + 1));\n\t}\n\n\tstate.previousChunks = previousChunks;\n};\n\nconst getNewlineLength = (chunk, end, preserveNewlines, state) => {\n\tif (preserveNewlines) {\n\t\treturn 0;\n\t}\n\n\tstate.isWindowsNewline = end !== 0 && chunk[end - 1] === '\\r';\n\treturn state.isWindowsNewline ? 2 : 1;\n};\n\nconst linesFinal = function * ({previousChunks}) {\n\tif (previousChunks.length > 0) {\n\t\tyield previousChunks;\n\t}\n};\n\n// Unless `preserveNewlines: true` is used, we strip the newline of each line.\n// This re-adds them after the user `transform` code has run.\nexport const getAppendNewlineGenerator = ({binary, preserveNewlines, readableObjectMode, state}) => binary || preserveNewlines || readableObjectMode\n\t? undefined\n\t: {transform: appendNewlineGenerator.bind(undefined, state)};\n\nconst appendNewlineGenerator = function * ({isWindowsNewline = false}, chunk) {\n\tconst {unixNewline, windowsNewline, LF, concatBytes} = typeof chunk === 'string' ? linesStringInfo : linesUint8ArrayInfo;\n\n\tif (chunk.at(-1) === LF) {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tconst newline = isWindowsNewline ? windowsNewline : unixNewline;\n\tyield concatBytes(chunk, newline);\n};\n\nconst concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;\n\nconst linesStringInfo = {\n\twindowsNewline: '\\r\\n',\n\tunixNewline: '\\n',\n\tLF: '\\n',\n\tconcatBytes: concatString,\n};\n\nconst concatUint8Array = (firstChunk, secondChunk) => {\n\tconst chunk = new Uint8Array(firstChunk.length + secondChunk.length);\n\tchunk.set(firstChunk, 0);\n\tchunk.set(secondChunk, firstChunk.length);\n\treturn chunk;\n};\n\nconst linesUint8ArrayInfo = {\n\twindowsNewline: new Uint8Array([0x0D, 0x0A]),\n\tunixNewline: new Uint8Array([0x0A]),\n\tLF: 0x0A,\n\tconcatBytes: concatUint8Array,\n};\n","import {Buffer} from 'node:buffer';\nimport {isUint8Array} from '../utils/uint-array.js';\n\n// Validate the type of chunk argument passed to transform generators\nexport const getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode\n\t? undefined\n\t: validateStringTransformInput.bind(undefined, optionName);\n\nconst validateStringTransformInput = function * (optionName, chunk) {\n\tif (typeof chunk !== 'string' && !isUint8Array(chunk) && !Buffer.isBuffer(chunk)) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option's transform must use \"objectMode: true\" to receive as input: ${typeof chunk}.`);\n\t}\n\n\tyield chunk;\n};\n\n// Validate the type of the value returned by transform generators\nexport const getValidateTransformReturn = (readableObjectMode, optionName) => readableObjectMode\n\t? validateObjectTransformReturn.bind(undefined, optionName)\n\t: validateStringTransformReturn.bind(undefined, optionName);\n\nconst validateObjectTransformReturn = function * (optionName, chunk) {\n\tvalidateEmptyReturn(optionName, chunk);\n\tyield chunk;\n};\n\nconst validateStringTransformReturn = function * (optionName, chunk) {\n\tvalidateEmptyReturn(optionName, chunk);\n\n\tif (typeof chunk !== 'string' && !isUint8Array(chunk)) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option's function must yield a string or an Uint8Array, not ${typeof chunk}.`);\n\t}\n\n\tyield chunk;\n};\n\nconst validateEmptyReturn = (optionName, chunk) => {\n\tif (chunk === null || chunk === undefined) {\n\t\tthrow new TypeError(`The \\`${optionName}\\` option's function must not call \\`yield ${chunk}\\`.\nInstead, \\`yield\\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`);\n\t}\n};\n","import {Buffer} from 'node:buffer';\nimport {StringDecoder} from 'node:string_decoder';\nimport {isUint8Array, bufferToUint8Array} from '../utils/uint-array.js';\n\n/*\nWhen using binary encodings, add an internal generator that converts chunks from `Buffer` to `string` or `Uint8Array`.\nChunks might be Buffer, Uint8Array or strings since:\n- `subprocess.stdout|stderr` emits Buffers\n- `subprocess.stdin.write()` accepts Buffer, Uint8Array or string\n- Previous generators might return Uint8Array or string\n\nHowever, those are converted to Buffer:\n- on writes: `Duplex.writable` `decodeStrings: true` default option\n- on reads: `Duplex.readable` `readableEncoding: null` default option\n*/\nexport const getEncodingTransformGenerator = (binary, encoding, skipped) => {\n\tif (skipped) {\n\t\treturn;\n\t}\n\n\tif (binary) {\n\t\treturn {transform: encodingUint8ArrayGenerator.bind(undefined, new TextEncoder())};\n\t}\n\n\tconst stringDecoder = new StringDecoder(encoding);\n\treturn {\n\t\ttransform: encodingStringGenerator.bind(undefined, stringDecoder),\n\t\tfinal: encodingStringFinal.bind(undefined, stringDecoder),\n\t};\n};\n\nconst encodingUint8ArrayGenerator = function * (textEncoder, chunk) {\n\tif (Buffer.isBuffer(chunk)) {\n\t\tyield bufferToUint8Array(chunk);\n\t} else if (typeof chunk === 'string') {\n\t\tyield textEncoder.encode(chunk);\n\t} else {\n\t\tyield chunk;\n\t}\n};\n\nconst encodingStringGenerator = function * (stringDecoder, chunk) {\n\tyield isUint8Array(chunk) ? stringDecoder.write(chunk) : chunk;\n};\n\nconst encodingStringFinal = function * (stringDecoder) {\n\tconst lastChunk = stringDecoder.end();\n\tif (lastChunk !== '') {\n\t\tyield lastChunk;\n\t}\n};\n","import {callbackify} from 'node:util';\n\n// Applies a series of generator functions asynchronously\nexport const pushChunks = callbackify(async (getChunks, state, getChunksArguments, transformStream) => {\n\tstate.currentIterable = getChunks(...getChunksArguments);\n\n\ttry {\n\t\tfor await (const chunk of state.currentIterable) {\n\t\t\ttransformStream.push(chunk);\n\t\t}\n\t} finally {\n\t\tdelete state.currentIterable;\n\t}\n});\n\n// For each new chunk, apply each `transform()` method\nexport const transformChunk = async function * (chunk, generators, index) {\n\tif (index === generators.length) {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tconst {transform = identityGenerator} = generators[index];\n\tfor await (const transformedChunk of transform(chunk)) {\n\t\tyield * transformChunk(transformedChunk, generators, index + 1);\n\t}\n};\n\n// At the end, apply each `final()` method, followed by the `transform()` method of the next transforms\nexport const finalChunks = async function * (generators) {\n\tfor (const [index, {final}] of Object.entries(generators)) {\n\t\tyield * generatorFinalChunks(final, Number(index), generators);\n\t}\n};\n\nconst generatorFinalChunks = async function * (final, index, generators) {\n\tif (final === undefined) {\n\t\treturn;\n\t}\n\n\tfor await (const finalChunk of final()) {\n\t\tyield * transformChunk(finalChunk, generators, index + 1);\n\t}\n};\n\n// Cancel any ongoing async generator when the Transform is destroyed, e.g. when the subprocess errors\nexport const destroyTransform = callbackify(async ({currentIterable}, error) => {\n\tif (currentIterable !== undefined) {\n\t\tawait (error ? currentIterable.throw(error) : currentIterable.return());\n\t\treturn;\n\t}\n\n\tif (error) {\n\t\tthrow error;\n\t}\n});\n\nconst identityGenerator = function * (chunk) {\n\tyield chunk;\n};\n","// Duplicate the code from `run-async.js` but as synchronous functions\nexport const pushChunksSync = (getChunksSync, getChunksArguments, transformStream, done) => {\n\ttry {\n\t\tfor (const chunk of getChunksSync(...getChunksArguments)) {\n\t\t\ttransformStream.push(chunk);\n\t\t}\n\n\t\tdone();\n\t} catch (error) {\n\t\tdone(error);\n\t}\n};\n\n// Run synchronous generators with `execaSync()`\nexport const runTransformSync = (generators, chunks) => [\n\t...chunks.flatMap(chunk => [...transformChunkSync(chunk, generators, 0)]),\n\t...finalChunksSync(generators),\n];\n\nexport const transformChunkSync = function * (chunk, generators, index) {\n\tif (index === generators.length) {\n\t\tyield chunk;\n\t\treturn;\n\t}\n\n\tconst {transform = identityGenerator} = generators[index];\n\tfor (const transformedChunk of transform(chunk)) {\n\t\tyield * transformChunkSync(transformedChunk, generators, index + 1);\n\t}\n};\n\nexport const finalChunksSync = function * (generators) {\n\tfor (const [index, {final}] of Object.entries(generators)) {\n\t\tyield * generatorFinalChunksSync(final, Number(index), generators);\n\t}\n};\n\nconst generatorFinalChunksSync = function * (final, index, generators) {\n\tif (final === undefined) {\n\t\treturn;\n\t}\n\n\tfor (const finalChunk of final()) {\n\t\tyield * transformChunkSync(finalChunk, generators, index + 1);\n\t}\n};\n\nconst identityGenerator = function * (chunk) {\n\tyield chunk;\n};\n","import {Transform, getDefaultHighWaterMark} from 'node:stream';\nimport {isAsyncGenerator} from '../stdio/type.js';\nimport {getSplitLinesGenerator, getAppendNewlineGenerator} from './split.js';\nimport {getValidateTransformInput, getValidateTransformReturn} from './validate.js';\nimport {getEncodingTransformGenerator} from './encoding-transform.js';\nimport {\n\tpushChunks,\n\ttransformChunk,\n\tfinalChunks,\n\tdestroyTransform,\n} from './run-async.js';\nimport {\n\tpushChunksSync,\n\ttransformChunkSync,\n\tfinalChunksSync,\n\trunTransformSync,\n} from './run-sync.js';\n\n/*\nGenerators can be used to transform/filter standard streams.\n\nGenerators have a simple syntax, yet allows all of the following:\n- Sharing `state` between chunks\n- Flushing logic, by using a `final` function\n- Asynchronous logic\n- Emitting multiple chunks from a single source chunk, even if spaced in time, by using multiple `yield`\n- Filtering, by using no `yield`\n\nTherefore, there is no need to allow Node.js or web transform streams.\n\nThe `highWaterMark` is kept as the default value, since this is what `subprocess.std*` uses.\n\nChunks are currently processed serially. We could add a `concurrency` option to parallelize in the future.\n\nTransform an array of generator functions into a `Transform` stream.\n`Duplex.from(generator)` cannot be used because it does not allow setting the `objectMode` and `highWaterMark`.\n*/\nexport const generatorToStream = ({\n\tvalue,\n\tvalue: {transform, final, writableObjectMode, readableObjectMode},\n\toptionName,\n}, {encoding}) => {\n\tconst state = {};\n\tconst generators = addInternalGenerators(value, encoding, optionName);\n\n\tconst transformAsync = isAsyncGenerator(transform);\n\tconst finalAsync = isAsyncGenerator(final);\n\tconst transformMethod = transformAsync\n\t\t? pushChunks.bind(undefined, transformChunk, state)\n\t\t: pushChunksSync.bind(undefined, transformChunkSync);\n\tconst finalMethod = transformAsync || finalAsync\n\t\t? pushChunks.bind(undefined, finalChunks, state)\n\t\t: pushChunksSync.bind(undefined, finalChunksSync);\n\tconst destroyMethod = transformAsync || finalAsync\n\t\t? destroyTransform.bind(undefined, state)\n\t\t: undefined;\n\n\tconst stream = new Transform({\n\t\twritableObjectMode,\n\t\twritableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),\n\t\treadableObjectMode,\n\t\treadableHighWaterMark: getDefaultHighWaterMark(readableObjectMode),\n\t\ttransform(chunk, encoding, done) {\n\t\t\ttransformMethod([chunk, generators, 0], this, done);\n\t\t},\n\t\tflush(done) {\n\t\t\tfinalMethod([generators], this, done);\n\t\t},\n\t\tdestroy: destroyMethod,\n\t});\n\treturn {stream};\n};\n\n// Applies transform generators in sync mode\nexport const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {\n\tconst generators = stdioItems.filter(({type}) => type === 'generator');\n\tconst reversedGenerators = isInput ? generators.reverse() : generators;\n\n\tfor (const {value, optionName} of reversedGenerators) {\n\t\tconst generators = addInternalGenerators(value, encoding, optionName);\n\t\tchunks = runTransformSync(generators, chunks);\n\t}\n\n\treturn chunks;\n};\n\n// Generators used internally to convert the chunk type, validate it, and split into lines\nconst addInternalGenerators = (\n\t{transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines},\n\tencoding,\n\toptionName,\n) => {\n\tconst state = {};\n\treturn [\n\t\t{transform: getValidateTransformInput(writableObjectMode, optionName)},\n\t\tgetEncodingTransformGenerator(binary, encoding, writableObjectMode),\n\t\tgetSplitLinesGenerator(binary, preserveNewlines, writableObjectMode, state),\n\t\t{transform, final},\n\t\t{transform: getValidateTransformReturn(readableObjectMode, optionName)},\n\t\tgetAppendNewlineGenerator({\n\t\t\tbinary,\n\t\t\tpreserveNewlines,\n\t\t\treadableObjectMode,\n\t\t\tstate,\n\t\t}),\n\t].filter(Boolean);\n};\n","import {runGeneratorsSync} from '../transform/generator.js';\nimport {joinToUint8Array, isUint8Array} from '../utils/uint-array.js';\nimport {TYPE_TO_MESSAGE} from '../stdio/type.js';\n\n// Apply `stdin`/`input`/`inputFile` options, before spawning, in sync mode, by converting it to the `input` option\nexport const addInputOptionsSync = (fileDescriptors, options) => {\n\tfor (const fdNumber of getInputFdNumbers(fileDescriptors)) {\n\t\taddInputOptionSync(fileDescriptors, fdNumber, options);\n\t}\n};\n\nconst getInputFdNumbers = fileDescriptors => new Set(Object.entries(fileDescriptors)\n\t.filter(([, {direction}]) => direction === 'input')\n\t.map(([fdNumber]) => Number(fdNumber)));\n\nconst addInputOptionSync = (fileDescriptors, fdNumber, options) => {\n\tconst {stdioItems} = fileDescriptors[fdNumber];\n\tconst allStdioItems = stdioItems.filter(({contents}) => contents !== undefined);\n\tif (allStdioItems.length === 0) {\n\t\treturn;\n\t}\n\n\tif (fdNumber !== 0) {\n\t\tconst [{type, optionName}] = allStdioItems;\n\t\tthrow new TypeError(`Only the \\`stdin\\` option, not \\`${optionName}\\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);\n\t}\n\n\tconst allContents = allStdioItems.map(({contents}) => contents);\n\tconst transformedContents = allContents.map(contents => applySingleInputGeneratorsSync(contents, stdioItems));\n\toptions.input = joinToUint8Array(transformedContents);\n};\n\nconst applySingleInputGeneratorsSync = (contents, stdioItems) => {\n\tconst newContents = runGeneratorsSync(contents, stdioItems, 'utf8', true);\n\tvalidateSerializable(newContents);\n\treturn joinToUint8Array(newContents);\n};\n\nconst validateSerializable = newContents => {\n\tconst invalidItem = newContents.find(item => typeof item !== 'string' && !isUint8Array(item));\n\tif (invalidItem !== undefined) {\n\t\tthrow new TypeError(`The \\`stdin\\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${invalidItem}.`);\n\t}\n};\n","import {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {verboseLog, serializeVerboseMessage} from './log.js';\nimport {isFullVerbose} from './values.js';\n\n// `ignore` opts-out of `verbose` for a specific stream.\n// `ipc` cannot use piping.\n// `inherit` would result in double printing.\n// They can also lead to double printing when passing file descriptor integers or `process.std*`.\n// This only leaves with `pipe` and `overlapped`.\nexport const shouldLogOutput = ({stdioItems, encoding, verboseInfo, fdNumber}) => fdNumber !== 'all'\n\t&& isFullVerbose(verboseInfo, fdNumber)\n\t&& !BINARY_ENCODINGS.has(encoding)\n\t&& fdUsesVerbose(fdNumber)\n\t&& (stdioItems.some(({type, value}) => type === 'native' && PIPED_STDIO_VALUES.has(value))\n\t|| stdioItems.every(({type}) => TRANSFORM_TYPES.has(type)));\n\n// Printing input streams would be confusing.\n// Files and streams can produce big outputs, which we don't want to print.\n// We could print `stdio[3+]` but it often is redirected to files and streams, with the same issue.\n// So we only print stdout and stderr.\nconst fdUsesVerbose = fdNumber => fdNumber === 1 || fdNumber === 2;\n\nconst PIPED_STDIO_VALUES = new Set(['pipe', 'overlapped']);\n\n// `verbose: 'full'` printing logic with async methods\nexport const logLines = async (linesIterable, stream, fdNumber, verboseInfo) => {\n\tfor await (const line of linesIterable) {\n\t\tif (!isPipingStream(stream)) {\n\t\t\tlogLine(line, fdNumber, verboseInfo);\n\t\t}\n\t}\n};\n\n// `verbose: 'full'` printing logic with sync methods\nexport const logLinesSync = (linesArray, fdNumber, verboseInfo) => {\n\tfor (const line of linesArray) {\n\t\tlogLine(line, fdNumber, verboseInfo);\n\t}\n};\n\n// When `subprocess.stdout|stderr.pipe()` is called, `verbose` becomes a noop.\n// This prevents the following problems:\n// - `.pipe()` achieves the same result as using `stdout: 'inherit'`, `stdout: stream`, etc. which also make `verbose` a noop.\n// For example, `subprocess.stdout.pipe(process.stdin)` would print each line twice.\n// - When chaining subprocesses with `subprocess.pipe(otherSubprocess)`, only the last one should print its output.\n// Detecting whether `.pipe()` is impossible without monkey-patching it, so we use the following undocumented property.\n// This is not a critical behavior since changes of the following property would only make `verbose` more verbose.\nconst isPipingStream = stream => stream._readableState.pipes.length > 0;\n\n// When `verbose` is `full`, print stdout|stderr\nconst logLine = (line, fdNumber, verboseInfo) => {\n\tconst verboseMessage = serializeVerboseMessage(line);\n\tverboseLog({\n\t\ttype: 'output',\n\t\tverboseMessage,\n\t\tfdNumber,\n\t\tverboseInfo,\n\t});\n};\n","import {writeFileSync, appendFileSync} from 'node:fs';\nimport {shouldLogOutput, logLinesSync} from '../verbose/output.js';\nimport {runGeneratorsSync} from '../transform/generator.js';\nimport {splitLinesSync} from '../transform/split.js';\nimport {joinToString, joinToUint8Array, bufferToUint8Array} from '../utils/uint-array.js';\nimport {FILE_TYPES} from '../stdio/type.js';\nimport {truncateMaxBufferSync} from './max-buffer.js';\n\n// Apply `stdout`/`stderr` options, after spawning, in sync mode\nexport const transformOutputSync = ({fileDescriptors, syncResult: {output}, options, isMaxBuffer, verboseInfo}) => {\n\tif (output === null) {\n\t\treturn {output: Array.from({length: 3})};\n\t}\n\n\tconst state = {};\n\tconst outputFiles = new Set([]);\n\tconst transformedOutput = output.map((result, fdNumber) =>\n\t\ttransformOutputResultSync({\n\t\t\tresult,\n\t\t\tfileDescriptors,\n\t\t\tfdNumber,\n\t\t\tstate,\n\t\t\toutputFiles,\n\t\t\tisMaxBuffer,\n\t\t\tverboseInfo,\n\t\t}, options));\n\treturn {output: transformedOutput, ...state};\n};\n\nconst transformOutputResultSync = (\n\t{result, fileDescriptors, fdNumber, state, outputFiles, isMaxBuffer, verboseInfo},\n\t{buffer, encoding, lines, stripFinalNewline, maxBuffer},\n) => {\n\tif (result === null) {\n\t\treturn;\n\t}\n\n\tconst truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer);\n\tconst uint8ArrayResult = bufferToUint8Array(truncatedResult);\n\tconst {stdioItems, objectMode} = fileDescriptors[fdNumber];\n\tconst chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state);\n\tconst {serializedResult, finalResult = serializedResult} = serializeChunks({\n\t\tchunks,\n\t\tobjectMode,\n\t\tencoding,\n\t\tlines,\n\t\tstripFinalNewline,\n\t\tfdNumber,\n\t});\n\n\tlogOutputSync({\n\t\tserializedResult,\n\t\tfdNumber,\n\t\tstate,\n\t\tverboseInfo,\n\t\tencoding,\n\t\tstdioItems,\n\t\tobjectMode,\n\t});\n\n\tconst returnedResult = buffer[fdNumber] ? finalResult : undefined;\n\n\ttry {\n\t\tif (state.error === undefined) {\n\t\t\twriteToFiles(serializedResult, stdioItems, outputFiles);\n\t\t}\n\n\t\treturn returnedResult;\n\t} catch (error) {\n\t\tstate.error = error;\n\t\treturn returnedResult;\n\t}\n};\n\n// Applies transform generators to `stdout`/`stderr`\nconst runOutputGeneratorsSync = (chunks, stdioItems, encoding, state) => {\n\ttry {\n\t\treturn runGeneratorsSync(chunks, stdioItems, encoding, false);\n\t} catch (error) {\n\t\tstate.error = error;\n\t\treturn chunks;\n\t}\n};\n\n// The contents is converted to three stages:\n// - serializedResult: used when the target is a file path/URL or a file descriptor (including 'inherit')\n// - finalResult/returnedResult: returned as `result.std*`\nconst serializeChunks = ({chunks, objectMode, encoding, lines, stripFinalNewline, fdNumber}) => {\n\tif (objectMode) {\n\t\treturn {serializedResult: chunks};\n\t}\n\n\tif (encoding === 'buffer') {\n\t\treturn {serializedResult: joinToUint8Array(chunks)};\n\t}\n\n\tconst serializedResult = joinToString(chunks, encoding);\n\tif (lines[fdNumber]) {\n\t\treturn {serializedResult, finalResult: splitLinesSync(serializedResult, !stripFinalNewline[fdNumber], objectMode)};\n\t}\n\n\treturn {serializedResult};\n};\n\nconst logOutputSync = ({serializedResult, fdNumber, state, verboseInfo, encoding, stdioItems, objectMode}) => {\n\tif (!shouldLogOutput({\n\t\tstdioItems,\n\t\tencoding,\n\t\tverboseInfo,\n\t\tfdNumber,\n\t})) {\n\t\treturn;\n\t}\n\n\tconst linesArray = splitLinesSync(serializedResult, false, objectMode);\n\n\ttry {\n\t\tlogLinesSync(linesArray, fdNumber, verboseInfo);\n\t} catch (error) {\n\t\tstate.error ??= error;\n\t}\n};\n\n// When the `std*` target is a file path/URL or a file descriptor\nconst writeToFiles = (serializedResult, stdioItems, outputFiles) => {\n\tfor (const {path, append} of stdioItems.filter(({type}) => FILE_TYPES.has(type))) {\n\t\tconst pathString = typeof path === 'string' ? path : path.toString();\n\t\tif (append || outputFiles.has(pathString)) {\n\t\t\tappendFileSync(path, serializedResult);\n\t\t} else {\n\t\t\toutputFiles.add(pathString);\n\t\t\twriteFileSync(path, serializedResult);\n\t\t}\n\t}\n};\n","import {isUint8Array, concatUint8Arrays} from '../utils/uint-array.js';\nimport {stripNewline} from '../io/strip-newline.js';\n\n// Retrieve `result.all` with synchronous methods\nexport const getAllSync = ([, stdout, stderr], options) => {\n\tif (!options.all) {\n\t\treturn;\n\t}\n\n\tif (stdout === undefined) {\n\t\treturn stderr;\n\t}\n\n\tif (stderr === undefined) {\n\t\treturn stdout;\n\t}\n\n\tif (Array.isArray(stdout)) {\n\t\treturn Array.isArray(stderr)\n\t\t\t? [...stdout, ...stderr]\n\t\t\t: [...stdout, stripNewline(stderr, options, 'all')];\n\t}\n\n\tif (Array.isArray(stderr)) {\n\t\treturn [stripNewline(stdout, options, 'all'), ...stderr];\n\t}\n\n\tif (isUint8Array(stdout) && isUint8Array(stderr)) {\n\t\treturn concatUint8Arrays([stdout, stderr]);\n\t}\n\n\treturn `${stdout}${stderr}`;\n};\n","import {once} from 'node:events';\nimport {DiscardedError} from '../return/final-error.js';\n\n// If `error` is emitted before `spawn`, `exit` will never be emitted.\n// However, `error` might be emitted after `spawn`.\n// In that case, `exit` will still be emitted.\n// Since the `exit` event contains the signal name, we want to make sure we are listening for it.\n// This function also takes into account the following unlikely cases:\n// - `exit` being emitted in the same microtask as `spawn`\n// - `error` being emitted multiple times\nexport const waitForExit = async (subprocess, context) => {\n\tconst [exitCode, signal] = await waitForExitOrError(subprocess);\n\tcontext.isForcefullyTerminated ??= false;\n\treturn [exitCode, signal];\n};\n\nconst waitForExitOrError = async subprocess => {\n\tconst [spawnPayload, exitPayload] = await Promise.allSettled([\n\t\tonce(subprocess, 'spawn'),\n\t\tonce(subprocess, 'exit'),\n\t]);\n\n\tif (spawnPayload.status === 'rejected') {\n\t\treturn [];\n\t}\n\n\treturn exitPayload.status === 'rejected'\n\t\t? waitForSubprocessExit(subprocess)\n\t\t: exitPayload.value;\n};\n\nconst waitForSubprocessExit = async subprocess => {\n\ttry {\n\t\treturn await once(subprocess, 'exit');\n\t} catch {\n\t\treturn waitForSubprocessExit(subprocess);\n\t}\n};\n\n// Retrieve the final exit code and|or signal name\nexport const waitForSuccessfulExit = async exitPromise => {\n\tconst [exitCode, signal] = await exitPromise;\n\n\tif (!isSubprocessErrorExit(exitCode, signal) && isFailedExit(exitCode, signal)) {\n\t\tthrow new DiscardedError();\n\t}\n\n\treturn [exitCode, signal];\n};\n\n// When the subprocess fails due to an `error` event\nconst isSubprocessErrorExit = (exitCode, signal) => exitCode === undefined && signal === undefined;\n// When the subprocess fails due to a non-0 exit code or to a signal termination\nexport const isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null;\n","import {DiscardedError} from '../return/final-error.js';\nimport {isMaxBufferSync} from '../io/max-buffer.js';\nimport {isFailedExit} from './exit-async.js';\n\n// Retrieve exit code, signal name and error information, with synchronous methods\nexport const getExitResultSync = ({error, status: exitCode, signal, output}, {maxBuffer}) => {\n\tconst resultError = getResultError(error, exitCode, signal);\n\tconst timedOut = resultError?.code === 'ETIMEDOUT';\n\tconst isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer);\n\treturn {\n\t\tresultError,\n\t\texitCode,\n\t\tsignal,\n\t\ttimedOut,\n\t\tisMaxBuffer,\n\t};\n};\n\nconst getResultError = (error, exitCode, signal) => {\n\tif (error !== undefined) {\n\t\treturn error;\n\t}\n\n\treturn isFailedExit(exitCode, signal) ? new DiscardedError() : undefined;\n};\n","import {spawnSync} from 'node:child_process';\nimport {handleCommand} from '../arguments/command.js';\nimport {normalizeOptions} from '../arguments/options.js';\nimport {concatenateShell} from '../arguments/shell.js';\nimport {makeError, makeEarlyError, makeSuccessResult} from '../return/result.js';\nimport {handleResult} from '../return/reject.js';\nimport {handleStdioSync} from '../stdio/handle-sync.js';\nimport {stripNewline} from '../io/strip-newline.js';\nimport {addInputOptionsSync} from '../io/input-sync.js';\nimport {transformOutputSync} from '../io/output-sync.js';\nimport {getMaxBufferSync} from '../io/max-buffer.js';\nimport {getAllSync} from '../resolve/all-sync.js';\nimport {getExitResultSync} from '../resolve/exit-sync.js';\n\n// Main shared logic for all sync methods: `execaSync()`, `$.sync()`\nexport const execaCoreSync = (rawFile, rawArguments, rawOptions) => {\n\tconst {file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors} = handleSyncArguments(rawFile, rawArguments, rawOptions);\n\tconst result = spawnSubprocessSync({\n\t\tfile,\n\t\tcommandArguments,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tverboseInfo,\n\t\tfileDescriptors,\n\t\tstartTime,\n\t});\n\treturn handleResult(result, verboseInfo, options);\n};\n\n// Compute arguments to pass to `child_process.spawnSync()`\nconst handleSyncArguments = (rawFile, rawArguments, rawOptions) => {\n\tconst {command, escapedCommand, startTime, verboseInfo} = handleCommand(rawFile, rawArguments, rawOptions);\n\tconst syncOptions = normalizeSyncOptions(rawOptions);\n\tconst {file, commandArguments, options} = normalizeOptions(rawFile, rawArguments, syncOptions);\n\tvalidateSyncOptions(options);\n\tconst fileDescriptors = handleStdioSync(options, verboseInfo);\n\treturn {\n\t\tfile,\n\t\tcommandArguments,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\toptions,\n\t\tfileDescriptors,\n\t};\n};\n\n// Options normalization logic specific to sync methods\nconst normalizeSyncOptions = options => options.node && !options.ipc ? {...options, ipc: false} : options;\n\n// Options validation logic specific to sync methods\nconst validateSyncOptions = ({ipc, ipcInput, detached, cancelSignal}) => {\n\tif (ipcInput) {\n\t\tthrowInvalidSyncOption('ipcInput');\n\t}\n\n\tif (ipc) {\n\t\tthrowInvalidSyncOption('ipc: true');\n\t}\n\n\tif (detached) {\n\t\tthrowInvalidSyncOption('detached: true');\n\t}\n\n\tif (cancelSignal) {\n\t\tthrowInvalidSyncOption('cancelSignal');\n\t}\n};\n\nconst throwInvalidSyncOption = value => {\n\tthrow new TypeError(`The \"${value}\" option cannot be used with synchronous methods.`);\n};\n\nconst spawnSubprocessSync = ({file, commandArguments, options, command, escapedCommand, verboseInfo, fileDescriptors, startTime}) => {\n\tconst syncResult = runSubprocessSync({\n\t\tfile,\n\t\tcommandArguments,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tfileDescriptors,\n\t\tstartTime,\n\t});\n\tif (syncResult.failed) {\n\t\treturn syncResult;\n\t}\n\n\tconst {resultError, exitCode, signal, timedOut, isMaxBuffer} = getExitResultSync(syncResult, options);\n\tconst {output, error = resultError} = transformOutputSync({\n\t\tfileDescriptors,\n\t\tsyncResult,\n\t\toptions,\n\t\tisMaxBuffer,\n\t\tverboseInfo,\n\t});\n\tconst stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber));\n\tconst all = stripNewline(getAllSync(output, options), options, 'all');\n\treturn getSyncResult({\n\t\terror,\n\t\texitCode,\n\t\tsignal,\n\t\ttimedOut,\n\t\tisMaxBuffer,\n\t\tstdio,\n\t\tall,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t});\n};\n\nconst runSubprocessSync = ({file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime}) => {\n\ttry {\n\t\taddInputOptionsSync(fileDescriptors, options);\n\t\tconst normalizedOptions = normalizeSpawnSyncOptions(options);\n\t\treturn spawnSync(...concatenateShell(file, commandArguments, normalizedOptions));\n\t} catch (error) {\n\t\treturn makeEarlyError({\n\t\t\terror,\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\tfileDescriptors,\n\t\t\toptions,\n\t\t\tstartTime,\n\t\t\tisSync: true,\n\t\t});\n\t}\n};\n\n// The `encoding` option is handled by Execa, not by `child_process.spawnSync()`\nconst normalizeSpawnSyncOptions = ({encoding, maxBuffer, ...options}) => ({...options, encoding: 'buffer', maxBuffer: getMaxBufferSync(maxBuffer)});\n\nconst getSyncResult = ({error, exitCode, signal, timedOut, isMaxBuffer, stdio, all, options, command, escapedCommand, startTime}) => error === undefined\n\t? makeSuccessResult({\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput: [],\n\t\toptions,\n\t\tstartTime,\n\t})\n\t: makeError({\n\t\terror,\n\t\tcommand,\n\t\tescapedCommand,\n\t\ttimedOut,\n\t\tisCanceled: false,\n\t\tisGracefullyCanceled: false,\n\t\tisMaxBuffer,\n\t\tisForcefullyTerminated: false,\n\t\texitCode,\n\t\tsignal,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput: [],\n\t\toptions,\n\t\tstartTime,\n\t\tisSync: true,\n\t});\n","import {once, on} from 'node:events';\nimport {\n\tvalidateIpcMethod,\n\tthrowOnEarlyDisconnect,\n\tdisconnect,\n\tgetStrictResponseError,\n} from './validation.js';\nimport {getIpcEmitter, isConnected} from './forward.js';\nimport {addReference, removeReference} from './reference.js';\n\n// Like `[sub]process.once('message')` but promise-based\nexport const getOneMessage = ({anyProcess, channel, isSubprocess, ipc}, {reference = true, filter} = {}) => {\n\tvalidateIpcMethod({\n\t\tmethodName: 'getOneMessage',\n\t\tisSubprocess,\n\t\tipc,\n\t\tisConnected: isConnected(anyProcess),\n\t});\n\n\treturn getOneMessageAsync({\n\t\tanyProcess,\n\t\tchannel,\n\t\tisSubprocess,\n\t\tfilter,\n\t\treference,\n\t});\n};\n\nconst getOneMessageAsync = async ({anyProcess, channel, isSubprocess, filter, reference}) => {\n\taddReference(channel, reference);\n\tconst ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);\n\tconst controller = new AbortController();\n\ttry {\n\t\treturn await Promise.race([\n\t\t\tgetMessage(ipcEmitter, filter, controller),\n\t\t\tthrowOnDisconnect(ipcEmitter, isSubprocess, controller),\n\t\t\tthrowOnStrictError(ipcEmitter, isSubprocess, controller),\n\t\t]);\n\t} catch (error) {\n\t\tdisconnect(anyProcess);\n\t\tthrow error;\n\t} finally {\n\t\tcontroller.abort();\n\t\tremoveReference(channel, reference);\n\t}\n};\n\nconst getMessage = async (ipcEmitter, filter, {signal}) => {\n\tif (filter === undefined) {\n\t\tconst [message] = await once(ipcEmitter, 'message', {signal});\n\t\treturn message;\n\t}\n\n\tfor await (const [message] of on(ipcEmitter, 'message', {signal})) {\n\t\tif (filter(message)) {\n\t\t\treturn message;\n\t\t}\n\t}\n};\n\nconst throwOnDisconnect = async (ipcEmitter, isSubprocess, {signal}) => {\n\tawait once(ipcEmitter, 'disconnect', {signal});\n\tthrowOnEarlyDisconnect(isSubprocess);\n};\n\nconst throwOnStrictError = async (ipcEmitter, isSubprocess, {signal}) => {\n\tconst [error] = await once(ipcEmitter, 'strict:error', {signal});\n\tthrow getStrictResponseError(error, isSubprocess);\n};\n","import {once, on} from 'node:events';\nimport {validateIpcMethod, disconnect, getStrictResponseError} from './validation.js';\nimport {getIpcEmitter, isConnected} from './forward.js';\nimport {addReference, removeReference} from './reference.js';\n\n// Like `[sub]process.on('message')` but promise-based\nexport const getEachMessage = ({anyProcess, channel, isSubprocess, ipc}, {reference = true} = {}) => loopOnMessages({\n\tanyProcess,\n\tchannel,\n\tisSubprocess,\n\tipc,\n\tshouldAwait: !isSubprocess,\n\treference,\n});\n\n// Same but used internally\nexport const loopOnMessages = ({anyProcess, channel, isSubprocess, ipc, shouldAwait, reference}) => {\n\tvalidateIpcMethod({\n\t\tmethodName: 'getEachMessage',\n\t\tisSubprocess,\n\t\tipc,\n\t\tisConnected: isConnected(anyProcess),\n\t});\n\n\taddReference(channel, reference);\n\tconst ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess);\n\tconst controller = new AbortController();\n\tconst state = {};\n\tstopOnDisconnect(anyProcess, ipcEmitter, controller);\n\tabortOnStrictError({\n\t\tipcEmitter,\n\t\tisSubprocess,\n\t\tcontroller,\n\t\tstate,\n\t});\n\treturn iterateOnMessages({\n\t\tanyProcess,\n\t\tchannel,\n\t\tipcEmitter,\n\t\tisSubprocess,\n\t\tshouldAwait,\n\t\tcontroller,\n\t\tstate,\n\t\treference,\n\t});\n};\n\nconst stopOnDisconnect = async (anyProcess, ipcEmitter, controller) => {\n\ttry {\n\t\tawait once(ipcEmitter, 'disconnect', {signal: controller.signal});\n\t\tcontroller.abort();\n\t} catch {}\n};\n\nconst abortOnStrictError = async ({ipcEmitter, isSubprocess, controller, state}) => {\n\ttry {\n\t\tconst [error] = await once(ipcEmitter, 'strict:error', {signal: controller.signal});\n\t\tstate.error = getStrictResponseError(error, isSubprocess);\n\t\tcontroller.abort();\n\t} catch {}\n};\n\nconst iterateOnMessages = async function * ({anyProcess, channel, ipcEmitter, isSubprocess, shouldAwait, controller, state, reference}) {\n\ttry {\n\t\tfor await (const [message] of on(ipcEmitter, 'message', {signal: controller.signal})) {\n\t\t\tthrowIfStrictError(state);\n\t\t\tyield message;\n\t\t}\n\t} catch {\n\t\tthrowIfStrictError(state);\n\t} finally {\n\t\tcontroller.abort();\n\t\tremoveReference(channel, reference);\n\n\t\tif (!isSubprocess) {\n\t\t\tdisconnect(anyProcess);\n\t\t}\n\n\t\tif (shouldAwait) {\n\t\t\tawait anyProcess;\n\t\t}\n\t}\n};\n\nconst throwIfStrictError = ({error}) => {\n\tif (error) {\n\t\tthrow error;\n\t}\n};\n","import process from 'node:process';\nimport {sendMessage} from './send.js';\nimport {getOneMessage} from './get-one.js';\nimport {getEachMessage} from './get-each.js';\nimport {getCancelSignal} from './graceful.js';\n\n// Add promise-based IPC methods in current process\nexport const addIpcMethods = (subprocess, {ipc}) => {\n\tObject.assign(subprocess, getIpcMethods(subprocess, false, ipc));\n};\n\n// Get promise-based IPC in the subprocess\nexport const getIpcExport = () => {\n\tconst anyProcess = process;\n\tconst isSubprocess = true;\n\tconst ipc = process.channel !== undefined;\n\n\treturn {\n\t\t...getIpcMethods(anyProcess, isSubprocess, ipc),\n\t\tgetCancelSignal: getCancelSignal.bind(undefined, {\n\t\t\tanyProcess,\n\t\t\tchannel: anyProcess.channel,\n\t\t\tisSubprocess,\n\t\t\tipc,\n\t\t}),\n\t};\n};\n\n// Retrieve the `ipc` shared by both the current process and the subprocess\nconst getIpcMethods = (anyProcess, isSubprocess, ipc) => ({\n\tsendMessage: sendMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel: anyProcess.channel,\n\t\tisSubprocess,\n\t\tipc,\n\t}),\n\tgetOneMessage: getOneMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel: anyProcess.channel,\n\t\tisSubprocess,\n\t\tipc,\n\t}),\n\tgetEachMessage: getEachMessage.bind(undefined, {\n\t\tanyProcess,\n\t\tchannel: anyProcess.channel,\n\t\tisSubprocess,\n\t\tipc,\n\t}),\n});\n","import {ChildProcess} from 'node:child_process';\nimport {\n\tPassThrough,\n\tReadable,\n\tWritable,\n\tDuplex,\n} from 'node:stream';\nimport {cleanupCustomStreams} from '../stdio/handle.js';\nimport {makeEarlyError} from './result.js';\nimport {handleResult} from './reject.js';\n\n// When the subprocess fails to spawn.\n// We ensure the returned error is always both a promise and a subprocess.\nexport const handleEarlyError = ({error, command, escapedCommand, fileDescriptors, options, startTime, verboseInfo}) => {\n\tcleanupCustomStreams(fileDescriptors);\n\n\tconst subprocess = new ChildProcess();\n\tcreateDummyStreams(subprocess, fileDescriptors);\n\tObject.assign(subprocess, {readable, writable, duplex});\n\n\tconst earlyError = makeEarlyError({\n\t\terror,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tfileDescriptors,\n\t\toptions,\n\t\tstartTime,\n\t\tisSync: false,\n\t});\n\tconst promise = handleDummyPromise(earlyError, verboseInfo, options);\n\treturn {subprocess, promise};\n};\n\nconst createDummyStreams = (subprocess, fileDescriptors) => {\n\tconst stdin = createDummyStream();\n\tconst stdout = createDummyStream();\n\tconst stderr = createDummyStream();\n\tconst extraStdio = Array.from({length: fileDescriptors.length - 3}, createDummyStream);\n\tconst all = createDummyStream();\n\tconst stdio = [stdin, stdout, stderr, ...extraStdio];\n\tObject.assign(subprocess, {\n\t\tstdin,\n\t\tstdout,\n\t\tstderr,\n\t\tall,\n\t\tstdio,\n\t});\n};\n\nconst createDummyStream = () => {\n\tconst stream = new PassThrough();\n\tstream.end();\n\treturn stream;\n};\n\nconst readable = () => new Readable({read() {}});\nconst writable = () => new Writable({write() {}});\nconst duplex = () => new Duplex({read() {}, write() {}});\n\nconst handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options);\n","import {createReadStream, createWriteStream} from 'node:fs';\nimport {Buffer} from 'node:buffer';\nimport {Readable, Writable, Duplex} from 'node:stream';\nimport {generatorToStream} from '../transform/generator.js';\nimport {handleStdio} from './handle.js';\nimport {TYPE_TO_MESSAGE} from './type.js';\n\n// Handle `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, before spawning, in async mode\nexport const handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false);\n\nconst forbiddenIfAsync = ({type, optionName}) => {\n\tthrow new TypeError(`The \\`${optionName}\\` option cannot be ${TYPE_TO_MESSAGE[type]}.`);\n};\n\n// Create streams used internally for piping when using specific values for the `std*` options, in async mode.\n// For example, `stdout: {file}` creates a file stream, which is piped from/to.\nconst addProperties = {\n\tfileNumber: forbiddenIfAsync,\n\tgenerator: generatorToStream,\n\tasyncGenerator: generatorToStream,\n\tnodeStream: ({value}) => ({stream: value}),\n\twebTransform({value: {transform, writableObjectMode, readableObjectMode}}) {\n\t\tconst objectMode = writableObjectMode || readableObjectMode;\n\t\tconst stream = Duplex.fromWeb(transform, {objectMode});\n\t\treturn {stream};\n\t},\n\tduplex: ({value: {transform}}) => ({stream: transform}),\n\tnative() {},\n};\n\nconst addPropertiesAsync = {\n\tinput: {\n\t\t...addProperties,\n\t\tfileUrl: ({value}) => ({stream: createReadStream(value)}),\n\t\tfilePath: ({value: {file}}) => ({stream: createReadStream(file)}),\n\t\twebStream: ({value}) => ({stream: Readable.fromWeb(value)}),\n\t\titerable: ({value}) => ({stream: Readable.from(value)}),\n\t\tasyncIterable: ({value}) => ({stream: Readable.from(value)}),\n\t\tstring: ({value}) => ({stream: Readable.from(value)}),\n\t\tuint8Array: ({value}) => ({stream: Readable.from(Buffer.from(value))}),\n\t},\n\toutput: {\n\t\t...addProperties,\n\t\tfileUrl: ({value}) => ({stream: createWriteStream(value)}),\n\t\tfilePath: ({value: {file, append}}) => ({stream: createWriteStream(file, append ? {flags: 'a'} : {})}),\n\t\twebStream: ({value}) => ({stream: Writable.fromWeb(value)}),\n\t\titerable: forbiddenIfAsync,\n\t\tasyncIterable: forbiddenIfAsync,\n\t\tstring: forbiddenIfAsync,\n\t\tuint8Array: forbiddenIfAsync,\n\t},\n};\n","import {on, once} from 'node:events';\nimport {PassThrough as PassThroughStream, getDefaultHighWaterMark} from 'node:stream';\nimport {finished} from 'node:stream/promises';\n\nexport default function mergeStreams(streams) {\n\tif (!Array.isArray(streams)) {\n\t\tthrow new TypeError(`Expected an array, got \\`${typeof streams}\\`.`);\n\t}\n\n\tfor (const stream of streams) {\n\t\tvalidateStream(stream);\n\t}\n\n\tconst objectMode = streams.some(({readableObjectMode}) => readableObjectMode);\n\tconst highWaterMark = getHighWaterMark(streams, objectMode);\n\tconst passThroughStream = new MergedStream({\n\t\tobjectMode,\n\t\twritableHighWaterMark: highWaterMark,\n\t\treadableHighWaterMark: highWaterMark,\n\t});\n\n\tfor (const stream of streams) {\n\t\tpassThroughStream.add(stream);\n\t}\n\n\treturn passThroughStream;\n}\n\nconst getHighWaterMark = (streams, objectMode) => {\n\tif (streams.length === 0) {\n\t\treturn getDefaultHighWaterMark(objectMode);\n\t}\n\n\tconst highWaterMarks = streams\n\t\t.filter(({readableObjectMode}) => readableObjectMode === objectMode)\n\t\t.map(({readableHighWaterMark}) => readableHighWaterMark);\n\treturn Math.max(...highWaterMarks);\n};\n\nclass MergedStream extends PassThroughStream {\n\t#streams = new Set([]);\n\t#ended = new Set([]);\n\t#aborted = new Set([]);\n\t#onFinished;\n\t#unpipeEvent = Symbol('unpipe');\n\t#streamPromises = new WeakMap();\n\n\tadd(stream) {\n\t\tvalidateStream(stream);\n\n\t\tif (this.#streams.has(stream)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#streams.add(stream);\n\n\t\tthis.#onFinished ??= onMergedStreamFinished(this, this.#streams, this.#unpipeEvent);\n\t\tconst streamPromise = endWhenStreamsDone({\n\t\t\tpassThroughStream: this,\n\t\t\tstream,\n\t\t\tstreams: this.#streams,\n\t\t\tended: this.#ended,\n\t\t\taborted: this.#aborted,\n\t\t\tonFinished: this.#onFinished,\n\t\t\tunpipeEvent: this.#unpipeEvent,\n\t\t});\n\t\tthis.#streamPromises.set(stream, streamPromise);\n\n\t\tstream.pipe(this, {end: false});\n\t}\n\n\tasync remove(stream) {\n\t\tvalidateStream(stream);\n\n\t\tif (!this.#streams.has(stream)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst streamPromise = this.#streamPromises.get(stream);\n\t\tif (streamPromise === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.#streamPromises.delete(stream);\n\n\t\tstream.unpipe(this);\n\t\tawait streamPromise;\n\t\treturn true;\n\t}\n}\n\nconst onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) => {\n\tupdateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT);\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tonMergedStreamEnd(passThroughStream, controller),\n\t\t\tonInputStreamsUnpipe(passThroughStream, streams, unpipeEvent, controller),\n\t\t]);\n\t} finally {\n\t\tcontroller.abort();\n\t\tupdateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT);\n\t}\n};\n\nconst onMergedStreamEnd = async (passThroughStream, {signal}) => {\n\ttry {\n\t\tawait finished(passThroughStream, {signal, cleanup: true});\n\t} catch (error) {\n\t\terrorOrAbortStream(passThroughStream, error);\n\t\tthrow error;\n\t}\n};\n\nconst onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, {signal}) => {\n\tfor await (const [unpipedStream] of on(passThroughStream, 'unpipe', {signal})) {\n\t\tif (streams.has(unpipedStream)) {\n\t\t\tunpipedStream.emit(unpipeEvent);\n\t\t}\n\t}\n};\n\nconst validateStream = stream => {\n\tif (typeof stream?.pipe !== 'function') {\n\t\tthrow new TypeError(`Expected a readable stream, got: \\`${typeof stream}\\`.`);\n\t}\n};\n\nconst endWhenStreamsDone = async ({passThroughStream, stream, streams, ended, aborted, onFinished, unpipeEvent}) => {\n\tupdateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM);\n\tconst controller = new AbortController();\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tafterMergedStreamFinished(onFinished, stream, controller),\n\t\t\tonInputStreamEnd({\n\t\t\t\tpassThroughStream,\n\t\t\t\tstream,\n\t\t\t\tstreams,\n\t\t\t\tended,\n\t\t\t\taborted,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t\tonInputStreamUnpipe({\n\t\t\t\tstream,\n\t\t\t\tstreams,\n\t\t\t\tended,\n\t\t\t\taborted,\n\t\t\t\tunpipeEvent,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tcontroller.abort();\n\t\tupdateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM);\n\t}\n\n\tif (streams.size > 0 && streams.size === ended.size + aborted.size) {\n\t\tif (ended.size === 0 && aborted.size > 0) {\n\t\t\tabortStream(passThroughStream);\n\t\t} else {\n\t\t\tendStream(passThroughStream);\n\t\t}\n\t}\n};\n\nconst afterMergedStreamFinished = async (onFinished, stream, {signal}) => {\n\ttry {\n\t\tawait onFinished;\n\t\tif (!signal.aborted) {\n\t\t\tabortStream(stream);\n\t\t}\n\t} catch (error) {\n\t\tif (!signal.aborted) {\n\t\t\terrorOrAbortStream(stream, error);\n\t\t}\n\t}\n};\n\nconst onInputStreamEnd = async ({passThroughStream, stream, streams, ended, aborted, controller: {signal}}) => {\n\ttry {\n\t\tawait finished(stream, {\n\t\t\tsignal,\n\t\t\tcleanup: true,\n\t\t\treadable: true,\n\t\t\twritable: false,\n\t\t});\n\t\tif (streams.has(stream)) {\n\t\t\tended.add(stream);\n\t\t}\n\t} catch (error) {\n\t\tif (signal.aborted || !streams.has(stream)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isAbortError(error)) {\n\t\t\taborted.add(stream);\n\t\t} else {\n\t\t\terrorStream(passThroughStream, error);\n\t\t}\n\t}\n};\n\nconst onInputStreamUnpipe = async ({stream, streams, ended, aborted, unpipeEvent, controller: {signal}}) => {\n\tawait once(stream, unpipeEvent, {signal});\n\n\tif (!stream.readable) {\n\t\treturn once(signal, 'abort', {signal});\n\t}\n\n\tstreams.delete(stream);\n\tended.delete(stream);\n\taborted.delete(stream);\n};\n\nconst endStream = stream => {\n\tif (stream.writable) {\n\t\tstream.end();\n\t}\n};\n\nconst errorOrAbortStream = (stream, error) => {\n\tif (isAbortError(error)) {\n\t\tabortStream(stream);\n\t} else {\n\t\terrorStream(stream, error);\n\t}\n};\n\n// This is the error thrown by `finished()` on `stream.destroy()`\nconst isAbortError = error => error?.code === 'ERR_STREAM_PREMATURE_CLOSE';\n\nconst abortStream = stream => {\n\tif (stream.readable || stream.writable) {\n\t\tstream.destroy();\n\t}\n};\n\n// `stream.destroy(error)` crashes the process with `uncaughtException` if no `error` event listener exists on `stream`.\n// We take care of error handling on user behalf, so we do not want this to happen.\nconst errorStream = (stream, error) => {\n\tif (!stream.destroyed) {\n\t\tstream.once('error', noop);\n\t\tstream.destroy(error);\n\t}\n};\n\nconst noop = () => {};\n\nconst updateMaxListeners = (passThroughStream, increment) => {\n\tconst maxListeners = passThroughStream.getMaxListeners();\n\tif (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) {\n\t\tpassThroughStream.setMaxListeners(maxListeners + increment);\n\t}\n};\n\n// Number of times `passThroughStream.on()` is called regardless of streams:\n// - once due to `finished(passThroughStream)`\n// - once due to `on(passThroughStream)`\nconst PASSTHROUGH_LISTENERS_COUNT = 2;\n\n// Number of times `passThroughStream.on()` is called per stream:\n// - once due to `stream.pipe(passThroughStream)`\nconst PASSTHROUGH_LISTENERS_PER_STREAM = 1;\n","import {finished} from 'node:stream/promises';\nimport {isStandardStream} from '../utils/standard-stream.js';\n\n// Similar to `Stream.pipeline(source, destination)`, but does not destroy standard streams\nexport const pipeStreams = (source, destination) => {\n\tsource.pipe(destination);\n\tonSourceFinish(source, destination);\n\tonDestinationFinish(source, destination);\n};\n\n// `source.pipe(destination)` makes `destination` end when `source` ends.\n// But it does not propagate aborts or errors. This function does it.\nconst onSourceFinish = async (source, destination) => {\n\tif (isStandardStream(source) || isStandardStream(destination)) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait finished(source, {cleanup: true, readable: true, writable: false});\n\t} catch {}\n\n\tendDestinationStream(destination);\n};\n\nexport const endDestinationStream = destination => {\n\tif (destination.writable) {\n\t\tdestination.end();\n\t}\n};\n\n// We do the same thing in the other direction as well.\nconst onDestinationFinish = async (source, destination) => {\n\tif (isStandardStream(source) || isStandardStream(destination)) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait finished(destination, {cleanup: true, readable: false, writable: true});\n\t} catch {}\n\n\tabortSourceStream(source);\n};\n\nexport const abortSourceStream = source => {\n\tif (source.readable) {\n\t\tsource.destroy();\n\t}\n};\n","import mergeStreams from '@sindresorhus/merge-streams';\nimport {isStandardStream} from '../utils/standard-stream.js';\nimport {incrementMaxListeners} from '../utils/max-listeners.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {pipeStreams} from './pipeline.js';\n\n// Handle `input`, `inputFile`, `stdin`, `stdout` and `stderr` options, after spawning, in async mode\n// When multiple input streams are used, we merge them to ensure the output stream ends only once each input stream has ended\nexport const pipeOutputAsync = (subprocess, fileDescriptors, controller) => {\n\tconst pipeGroups = new Map();\n\n\tfor (const [fdNumber, {stdioItems, direction}] of Object.entries(fileDescriptors)) {\n\t\tfor (const {stream} of stdioItems.filter(({type}) => TRANSFORM_TYPES.has(type))) {\n\t\t\tpipeTransform(subprocess, stream, direction, fdNumber);\n\t\t}\n\n\t\tfor (const {stream} of stdioItems.filter(({type}) => !TRANSFORM_TYPES.has(type))) {\n\t\t\tpipeStdioItem({\n\t\t\t\tsubprocess,\n\t\t\t\tstream,\n\t\t\t\tdirection,\n\t\t\t\tfdNumber,\n\t\t\t\tpipeGroups,\n\t\t\t\tcontroller,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const [outputStream, inputStreams] of pipeGroups.entries()) {\n\t\tconst inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams);\n\t\tpipeStreams(inputStream, outputStream);\n\t}\n};\n\n// When using transforms, `subprocess.stdin|stdout|stderr|stdio` is directly mutated\nconst pipeTransform = (subprocess, stream, direction, fdNumber) => {\n\tif (direction === 'output') {\n\t\tpipeStreams(subprocess.stdio[fdNumber], stream);\n\t} else {\n\t\tpipeStreams(stream, subprocess.stdio[fdNumber]);\n\t}\n\n\tconst streamProperty = SUBPROCESS_STREAM_PROPERTIES[fdNumber];\n\tif (streamProperty !== undefined) {\n\t\tsubprocess[streamProperty] = stream;\n\t}\n\n\tsubprocess.stdio[fdNumber] = stream;\n};\n\nconst SUBPROCESS_STREAM_PROPERTIES = ['stdin', 'stdout', 'stderr'];\n\n// Most `std*` option values involve piping `subprocess.std*` to a stream.\n// The stream is either passed by the user or created internally.\nconst pipeStdioItem = ({subprocess, stream, direction, fdNumber, pipeGroups, controller}) => {\n\tif (stream === undefined) {\n\t\treturn;\n\t}\n\n\tsetStandardStreamMaxListeners(stream, controller);\n\n\tconst [inputStream, outputStream] = direction === 'output'\n\t\t? [stream, subprocess.stdio[fdNumber]]\n\t\t: [subprocess.stdio[fdNumber], stream];\n\tconst outputStreams = pipeGroups.get(inputStream) ?? [];\n\tpipeGroups.set(inputStream, [...outputStreams, outputStream]);\n};\n\n// Multiple subprocesses might be piping from/to `process.std*` at the same time.\n// This is not necessarily an error and should not print a `maxListeners` warning.\nconst setStandardStreamMaxListeners = (stream, {signal}) => {\n\tif (isStandardStream(stream)) {\n\t\tincrementMaxListeners(stream, MAX_LISTENERS_INCREMENT, signal);\n\t}\n};\n\n// `source.pipe(destination)` adds at most 1 listener for each event.\n// If `stdin` option is an array, the values might be combined with `merge-streams`.\n// That library also listens for `source` end, which adds 1 more listener.\nconst MAX_LISTENERS_INCREMENT = 2;\n","import {addAbortListener} from 'node:events';\nimport {onExit} from 'signal-exit';\n\n// If the `cleanup` option is used, call `subprocess.kill()` when the parent process exits\nexport const cleanupOnExit = (subprocess, {cleanup, detached}, {signal}) => {\n\tif (!cleanup || detached) {\n\t\treturn;\n\t}\n\n\tconst removeExitHandler = onExit(() => {\n\t\tsubprocess.kill();\n\t});\n\taddAbortListener(signal, () => {\n\t\tremoveExitHandler();\n\t});\n};\n","import {normalizeParameters} from '../methods/parameters.js';\nimport {getStartTime} from '../return/duration.js';\nimport {SUBPROCESS_OPTIONS, getToStream, getFromStream} from '../arguments/fd-options.js';\nimport {isDenoExecPath} from '../arguments/file-url.js';\n\n// Normalize and validate arguments passed to `source.pipe(destination)`\nexport const normalizePipeArguments = ({source, sourcePromise, boundOptions, createNested}, ...pipeArguments) => {\n\tconst startTime = getStartTime();\n\tconst {\n\t\tdestination,\n\t\tdestinationStream,\n\t\tdestinationError,\n\t\tfrom,\n\t\tunpipeSignal,\n\t} = getDestinationStream(boundOptions, createNested, pipeArguments);\n\tconst {sourceStream, sourceError} = getSourceStream(source, from);\n\tconst {options: sourceOptions, fileDescriptors} = SUBPROCESS_OPTIONS.get(source);\n\treturn {\n\t\tsourcePromise,\n\t\tsourceStream,\n\t\tsourceOptions,\n\t\tsourceError,\n\t\tdestination,\n\t\tdestinationStream,\n\t\tdestinationError,\n\t\tunpipeSignal,\n\t\tfileDescriptors,\n\t\tstartTime,\n\t};\n};\n\nconst getDestinationStream = (boundOptions, createNested, pipeArguments) => {\n\ttry {\n\t\tconst {\n\t\t\tdestination,\n\t\t\tpipeOptions: {from, to, unpipeSignal} = {},\n\t\t} = getDestination(boundOptions, createNested, ...pipeArguments);\n\t\tconst destinationStream = getToStream(destination, to);\n\t\treturn {\n\t\t\tdestination,\n\t\t\tdestinationStream,\n\t\t\tfrom,\n\t\t\tunpipeSignal,\n\t\t};\n\t} catch (error) {\n\t\treturn {destinationError: error};\n\t}\n};\n\n// Piping subprocesses can use three syntaxes:\n// - source.pipe('command', commandArguments, pipeOptionsOrDestinationOptions)\n// - source.pipe`command commandArgument` or source.pipe(pipeOptionsOrDestinationOptions)`command commandArgument`\n// - source.pipe(execa(...), pipeOptions)\nconst getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {\n\tif (Array.isArray(firstArgument)) {\n\t\tconst destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);\n\t\treturn {destination, pipeOptions: boundOptions};\n\t}\n\n\tif (typeof firstArgument === 'string' || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {\n\t\tif (Object.keys(boundOptions).length > 0) {\n\t\t\tthrow new TypeError('Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).');\n\t\t}\n\n\t\tconst [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);\n\t\tconst destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);\n\t\treturn {destination, pipeOptions: rawOptions};\n\t}\n\n\tif (SUBPROCESS_OPTIONS.has(firstArgument)) {\n\t\tif (Object.keys(boundOptions).length > 0) {\n\t\t\tthrow new TypeError('Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).');\n\t\t}\n\n\t\treturn {destination: firstArgument, pipeOptions: pipeArguments[0]};\n\t}\n\n\tthrow new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${firstArgument}`);\n};\n\n// Force `stdin: 'pipe'` with the destination subprocess\nconst mapDestinationArguments = ({options}) => ({options: {...options, stdin: 'pipe', piped: true}});\n\nconst getSourceStream = (source, from) => {\n\ttry {\n\t\tconst sourceStream = getFromStream(source, from);\n\t\treturn {sourceStream};\n\t} catch (error) {\n\t\treturn {sourceError: error};\n\t}\n};\n","import {makeEarlyError} from '../return/result.js';\nimport {abortSourceStream, endDestinationStream} from '../io/pipeline.js';\n\n// When passing invalid arguments to `source.pipe()`, throw asynchronously.\n// We also abort both subprocesses.\nexport const handlePipeArgumentsError = ({\n\tsourceStream,\n\tsourceError,\n\tdestinationStream,\n\tdestinationError,\n\tfileDescriptors,\n\tsourceOptions,\n\tstartTime,\n}) => {\n\tconst error = getPipeArgumentsError({\n\t\tsourceStream,\n\t\tsourceError,\n\t\tdestinationStream,\n\t\tdestinationError,\n\t});\n\tif (error !== undefined) {\n\t\tthrow createNonCommandError({\n\t\t\terror,\n\t\t\tfileDescriptors,\n\t\t\tsourceOptions,\n\t\t\tstartTime,\n\t\t});\n\t}\n};\n\nconst getPipeArgumentsError = ({sourceStream, sourceError, destinationStream, destinationError}) => {\n\tif (sourceError !== undefined && destinationError !== undefined) {\n\t\treturn destinationError;\n\t}\n\n\tif (destinationError !== undefined) {\n\t\tabortSourceStream(sourceStream);\n\t\treturn destinationError;\n\t}\n\n\tif (sourceError !== undefined) {\n\t\tendDestinationStream(destinationStream);\n\t\treturn sourceError;\n\t}\n};\n\n// Specific error return value when passing invalid arguments to `subprocess.pipe()` or when using `unpipeSignal`\nexport const createNonCommandError = ({error, fileDescriptors, sourceOptions, startTime}) => makeEarlyError({\n\terror,\n\tcommand: PIPE_COMMAND_MESSAGE,\n\tescapedCommand: PIPE_COMMAND_MESSAGE,\n\tfileDescriptors,\n\toptions: sourceOptions,\n\tstartTime,\n\tisSync: false,\n});\n\nconst PIPE_COMMAND_MESSAGE = 'source.pipe(destination)';\n","// Like Bash, we await both subprocesses. This is unlike some other shells which only await the destination subprocess.\n// Like Bash with the `pipefail` option, if either subprocess fails, the whole pipe fails.\n// Like Bash, if both subprocesses fail, we return the failure of the destination.\n// This ensures both subprocesses' errors are present, using `error.pipedFrom`.\nexport const waitForBothSubprocesses = async subprocessPromises => {\n\tconst [\n\t\t{status: sourceStatus, reason: sourceReason, value: sourceResult = sourceReason},\n\t\t{status: destinationStatus, reason: destinationReason, value: destinationResult = destinationReason},\n\t] = await subprocessPromises;\n\n\tif (!destinationResult.pipedFrom.includes(sourceResult)) {\n\t\tdestinationResult.pipedFrom.push(sourceResult);\n\t}\n\n\tif (destinationStatus === 'rejected') {\n\t\tthrow destinationResult;\n\t}\n\n\tif (sourceStatus === 'rejected') {\n\t\tthrow sourceResult;\n\t}\n\n\treturn destinationResult;\n};\n","import {finished} from 'node:stream/promises';\nimport mergeStreams from '@sindresorhus/merge-streams';\nimport {incrementMaxListeners} from '../utils/max-listeners.js';\nimport {pipeStreams} from '../io/pipeline.js';\n\n// The piping behavior is like Bash.\n// In particular, when one subprocess exits, the other is not terminated by a signal.\n// Instead, its stdout (for the source) or stdin (for the destination) closes.\n// If the subprocess uses it, it will make it error with SIGPIPE or EPIPE (for the source) or end (for the destination).\n// If it does not use it, it will continue running.\n// This allows for subprocesses to gracefully exit and lower the coupling between subprocesses.\nexport const pipeSubprocessStream = (sourceStream, destinationStream, maxListenersController) => {\n\tconst mergedStream = MERGED_STREAMS.has(destinationStream)\n\t\t? pipeMoreSubprocessStream(sourceStream, destinationStream)\n\t\t: pipeFirstSubprocessStream(sourceStream, destinationStream);\n\tincrementMaxListeners(sourceStream, SOURCE_LISTENERS_PER_PIPE, maxListenersController.signal);\n\tincrementMaxListeners(destinationStream, DESTINATION_LISTENERS_PER_PIPE, maxListenersController.signal);\n\tcleanupMergedStreamsMap(destinationStream);\n\treturn mergedStream;\n};\n\n// We use `merge-streams` to allow for multiple sources to pipe to the same destination.\nconst pipeFirstSubprocessStream = (sourceStream, destinationStream) => {\n\tconst mergedStream = mergeStreams([sourceStream]);\n\tpipeStreams(mergedStream, destinationStream);\n\tMERGED_STREAMS.set(destinationStream, mergedStream);\n\treturn mergedStream;\n};\n\nconst pipeMoreSubprocessStream = (sourceStream, destinationStream) => {\n\tconst mergedStream = MERGED_STREAMS.get(destinationStream);\n\tmergedStream.add(sourceStream);\n\treturn mergedStream;\n};\n\nconst cleanupMergedStreamsMap = async destinationStream => {\n\ttry {\n\t\tawait finished(destinationStream, {cleanup: true, readable: false, writable: true});\n\t} catch {}\n\n\tMERGED_STREAMS.delete(destinationStream);\n};\n\nconst MERGED_STREAMS = new WeakMap();\n\n// Number of listeners set up on `sourceStream` by each `sourceStream.pipe(destinationStream)`\n// Those are added by `merge-streams`\nconst SOURCE_LISTENERS_PER_PIPE = 2;\n// Number of listeners set up on `destinationStream` by each `sourceStream.pipe(destinationStream)`\n// Those are added by `finished()` in `cleanupMergedStreamsMap()`\nconst DESTINATION_LISTENERS_PER_PIPE = 1;\n","import {aborted} from 'node:util';\nimport {createNonCommandError} from './throw.js';\n\n// When passing an `unpipeSignal` option, abort piping when the signal is aborted.\n// However, do not terminate the subprocesses.\nexport const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === undefined\n\t? []\n\t: [unpipeOnSignalAbort(unpipeSignal, unpipeContext)];\n\nconst unpipeOnSignalAbort = async (unpipeSignal, {sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime}) => {\n\tawait aborted(unpipeSignal, sourceStream);\n\tawait mergedStream.remove(sourceStream);\n\tconst error = new Error('Pipe canceled by `unpipeSignal` option.');\n\tthrow createNonCommandError({\n\t\terror,\n\t\tfileDescriptors,\n\t\tsourceOptions,\n\t\tstartTime,\n\t});\n};\n","import isPlainObject from 'is-plain-obj';\nimport {normalizePipeArguments} from './pipe-arguments.js';\nimport {handlePipeArgumentsError} from './throw.js';\nimport {waitForBothSubprocesses} from './sequence.js';\nimport {pipeSubprocessStream} from './streaming.js';\nimport {unpipeOnAbort} from './abort.js';\n\n// Pipe a subprocess' `stdout`/`stderr`/`stdio` into another subprocess' `stdin`\nexport const pipeToSubprocess = (sourceInfo, ...pipeArguments) => {\n\tif (isPlainObject(pipeArguments[0])) {\n\t\treturn pipeToSubprocess.bind(undefined, {\n\t\t\t...sourceInfo,\n\t\t\tboundOptions: {...sourceInfo.boundOptions, ...pipeArguments[0]},\n\t\t});\n\t}\n\n\tconst {destination, ...normalizedInfo} = normalizePipeArguments(sourceInfo, ...pipeArguments);\n\tconst promise = handlePipePromise({...normalizedInfo, destination});\n\tpromise.pipe = pipeToSubprocess.bind(undefined, {\n\t\t...sourceInfo,\n\t\tsource: destination,\n\t\tsourcePromise: promise,\n\t\tboundOptions: {},\n\t});\n\treturn promise;\n};\n\n// Asynchronous logic when piping subprocesses\nconst handlePipePromise = async ({\n\tsourcePromise,\n\tsourceStream,\n\tsourceOptions,\n\tsourceError,\n\tdestination,\n\tdestinationStream,\n\tdestinationError,\n\tunpipeSignal,\n\tfileDescriptors,\n\tstartTime,\n}) => {\n\tconst subprocessPromises = getSubprocessPromises(sourcePromise, destination);\n\thandlePipeArgumentsError({\n\t\tsourceStream,\n\t\tsourceError,\n\t\tdestinationStream,\n\t\tdestinationError,\n\t\tfileDescriptors,\n\t\tsourceOptions,\n\t\tstartTime,\n\t});\n\tconst maxListenersController = new AbortController();\n\ttry {\n\t\tconst mergedStream = pipeSubprocessStream(sourceStream, destinationStream, maxListenersController);\n\t\treturn await Promise.race([\n\t\t\twaitForBothSubprocesses(subprocessPromises),\n\t\t\t...unpipeOnAbort(unpipeSignal, {\n\t\t\t\tsourceStream,\n\t\t\t\tmergedStream,\n\t\t\t\tsourceOptions,\n\t\t\t\tfileDescriptors,\n\t\t\t\tstartTime,\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tmaxListenersController.abort();\n\t}\n};\n\n// `.pipe()` awaits the subprocess promises.\n// When invalid arguments are passed to `.pipe()`, we throw an error, which prevents awaiting them.\n// We need to ensure this does not create unhandled rejections.\nconst getSubprocessPromises = (sourcePromise, destination) => Promise.allSettled([sourcePromise, destination]);\n","import {on} from 'node:events';\nimport {getDefaultHighWaterMark} from 'node:stream';\nimport {getEncodingTransformGenerator} from '../transform/encoding-transform.js';\nimport {getSplitLinesGenerator} from '../transform/split.js';\nimport {transformChunkSync, finalChunksSync} from '../transform/run-sync.js';\n\n// Iterate over lines of `subprocess.stdout`, used by `subprocess.readable|duplex|iterable()`\nexport const iterateOnSubprocessStream = ({subprocessStdout, subprocess, binary, shouldEncode, encoding, preserveNewlines}) => {\n\tconst controller = new AbortController();\n\tstopReadingOnExit(subprocess, controller);\n\treturn iterateOnStream({\n\t\tstream: subprocessStdout,\n\t\tcontroller,\n\t\tbinary,\n\t\tshouldEncode: !subprocessStdout.readableObjectMode && shouldEncode,\n\t\tencoding,\n\t\tshouldSplit: !subprocessStdout.readableObjectMode,\n\t\tpreserveNewlines,\n\t});\n};\n\nconst stopReadingOnExit = async (subprocess, controller) => {\n\ttry {\n\t\tawait subprocess;\n\t} catch {} finally {\n\t\tcontroller.abort();\n\t}\n};\n\n// Iterate over lines of `subprocess.stdout`, used by `result.stdout` and the `verbose: 'full'` option.\n// Applies the `lines` and `encoding` options.\nexport const iterateForResult = ({stream, onStreamEnd, lines, encoding, stripFinalNewline, allMixed}) => {\n\tconst controller = new AbortController();\n\tstopReadingOnStreamEnd(onStreamEnd, controller, stream);\n\tconst objectMode = stream.readableObjectMode && !allMixed;\n\treturn iterateOnStream({\n\t\tstream,\n\t\tcontroller,\n\t\tbinary: encoding === 'buffer',\n\t\tshouldEncode: !objectMode,\n\t\tencoding,\n\t\tshouldSplit: !objectMode && lines,\n\t\tpreserveNewlines: !stripFinalNewline,\n\t});\n};\n\nconst stopReadingOnStreamEnd = async (onStreamEnd, controller, stream) => {\n\ttry {\n\t\tawait onStreamEnd;\n\t} catch {\n\t\tstream.destroy();\n\t} finally {\n\t\tcontroller.abort();\n\t}\n};\n\nconst iterateOnStream = ({stream, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines}) => {\n\tconst onStdoutChunk = on(stream, 'data', {\n\t\tsignal: controller.signal,\n\t\thighWaterMark: HIGH_WATER_MARK,\n\t\t// Backward compatibility with older name for this option\n\t\t// See https://github.com/nodejs/node/pull/52080#discussion_r1525227861\n\t\t// @todo Remove after removing support for Node 21\n\t\thighWatermark: HIGH_WATER_MARK,\n\t});\n\treturn iterateOnData({\n\t\tonStdoutChunk,\n\t\tcontroller,\n\t\tbinary,\n\t\tshouldEncode,\n\t\tencoding,\n\t\tshouldSplit,\n\t\tpreserveNewlines,\n\t});\n};\n\nexport const DEFAULT_OBJECT_HIGH_WATER_MARK = getDefaultHighWaterMark(true);\n\n// The `highWaterMark` of `events.on()` is measured in number of events, not in bytes.\n// Not knowing the average amount of bytes per `data` event, we use the same heuristic as streams in objectMode, since they have the same issue.\n// Therefore, we use the value of `getDefaultHighWaterMark(true)`.\n// Note: this option does not exist on Node 18, but this is ok since the logic works without it. It just consumes more memory.\nconst HIGH_WATER_MARK = DEFAULT_OBJECT_HIGH_WATER_MARK;\n\nconst iterateOnData = async function * ({onStdoutChunk, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines}) {\n\tconst generators = getGenerators({\n\t\tbinary,\n\t\tshouldEncode,\n\t\tencoding,\n\t\tshouldSplit,\n\t\tpreserveNewlines,\n\t});\n\n\ttry {\n\t\tfor await (const [chunk] of onStdoutChunk) {\n\t\t\tyield * transformChunkSync(chunk, generators, 0);\n\t\t}\n\t} catch (error) {\n\t\tif (!controller.signal.aborted) {\n\t\t\tthrow error;\n\t\t}\n\t} finally {\n\t\tyield * finalChunksSync(generators);\n\t}\n};\n\nconst getGenerators = ({binary, shouldEncode, encoding, shouldSplit, preserveNewlines}) => [\n\tgetEncodingTransformGenerator(binary, encoding, !shouldEncode),\n\tgetSplitLinesGenerator(binary, preserveNewlines, !shouldSplit, {}),\n].filter(Boolean);\n","import {setImmediate} from 'node:timers/promises';\nimport getStream, {getStreamAsArrayBuffer, getStreamAsArray} from 'get-stream';\nimport {isArrayBuffer} from '../utils/uint-array.js';\nimport {shouldLogOutput, logLines} from '../verbose/output.js';\nimport {iterateForResult} from './iterate.js';\nimport {handleMaxBuffer} from './max-buffer.js';\nimport {getStripFinalNewline} from './strip-newline.js';\n\n// Retrieve `result.stdout|stderr|all|stdio[*]`\nexport const getStreamOutput = async ({stream, onStreamEnd, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo}) => {\n\tconst logPromise = logOutputAsync({\n\t\tstream,\n\t\tonStreamEnd,\n\t\tfdNumber,\n\t\tencoding,\n\t\tallMixed,\n\t\tverboseInfo,\n\t\tstreamInfo,\n\t});\n\n\tif (!buffer) {\n\t\tawait Promise.all([resumeStream(stream), logPromise]);\n\t\treturn;\n\t}\n\n\tconst stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline, fdNumber);\n\tconst iterable = iterateForResult({\n\t\tstream,\n\t\tonStreamEnd,\n\t\tlines,\n\t\tencoding,\n\t\tstripFinalNewline: stripFinalNewlineValue,\n\t\tallMixed,\n\t});\n\tconst [output] = await Promise.all([\n\t\tgetStreamContents({\n\t\t\tstream,\n\t\t\titerable,\n\t\t\tfdNumber,\n\t\t\tencoding,\n\t\t\tmaxBuffer,\n\t\t\tlines,\n\t\t}),\n\t\tlogPromise,\n\t]);\n\treturn output;\n};\n\nconst logOutputAsync = async ({stream, onStreamEnd, fdNumber, encoding, allMixed, verboseInfo, streamInfo: {fileDescriptors}}) => {\n\tif (!shouldLogOutput({\n\t\tstdioItems: fileDescriptors[fdNumber]?.stdioItems,\n\t\tencoding,\n\t\tverboseInfo,\n\t\tfdNumber,\n\t})) {\n\t\treturn;\n\t}\n\n\tconst linesIterable = iterateForResult({\n\t\tstream,\n\t\tonStreamEnd,\n\t\tlines: true,\n\t\tencoding,\n\t\tstripFinalNewline: true,\n\t\tallMixed,\n\t});\n\tawait logLines(linesIterable, stream, fdNumber, verboseInfo);\n};\n\n// When using `buffer: false`, users need to read `subprocess.stdout|stderr|all` right away\n// See https://github.com/sindresorhus/execa/issues/730 and https://github.com/sindresorhus/execa/pull/729#discussion_r1465496310\nconst resumeStream = async stream => {\n\tawait setImmediate();\n\tif (stream.readableFlowing === null) {\n\t\tstream.resume();\n\t}\n};\n\nconst getStreamContents = async ({stream, stream: {readableObjectMode}, iterable, fdNumber, encoding, maxBuffer, lines}) => {\n\ttry {\n\t\tif (readableObjectMode || lines) {\n\t\t\treturn await getStreamAsArray(iterable, {maxBuffer});\n\t\t}\n\n\t\tif (encoding === 'buffer') {\n\t\t\treturn new Uint8Array(await getStreamAsArrayBuffer(iterable, {maxBuffer}));\n\t\t}\n\n\t\treturn await getStream(iterable, {maxBuffer});\n\t} catch (error) {\n\t\treturn handleBufferedData(handleMaxBuffer({\n\t\t\terror,\n\t\t\tstream,\n\t\t\treadableObjectMode,\n\t\t\tlines,\n\t\t\tencoding,\n\t\t\tfdNumber,\n\t\t}));\n\t}\n};\n\n// On failure, `result.stdout|stderr|all` should contain the currently buffered stream\n// They are automatically closed and flushed by Node.js when the subprocess exits\n// When `buffer` is `false`, `streamPromise` is `undefined` and there is no buffered data to retrieve\nexport const getBufferedData = async streamPromise => {\n\ttry {\n\t\treturn await streamPromise;\n\t} catch (error) {\n\t\treturn handleBufferedData(error);\n\t}\n};\n\n// Ensure we are returning Uint8Arrays when using `encoding: 'buffer'`\nconst handleBufferedData = ({bufferedData}) => isArrayBuffer(bufferedData)\n\t? new Uint8Array(bufferedData)\n\t: bufferedData;\n","import {finished} from 'node:stream/promises';\n\n// Wraps `finished(stream)` to handle the following case:\n// - When the subprocess exits, Node.js automatically calls `subprocess.stdin.destroy()`, which we need to ignore.\n// - However, we still need to throw if `subprocess.stdin.destroy()` is called before subprocess exit.\nexport const waitForStream = async (stream, fdNumber, streamInfo, {isSameDirection, stopOnExit = false} = {}) => {\n\tconst state = handleStdinDestroy(stream, streamInfo);\n\tconst abortController = new AbortController();\n\ttry {\n\t\tawait Promise.race([\n\t\t\t...(stopOnExit ? [streamInfo.exitPromise] : []),\n\t\t\tfinished(stream, {cleanup: true, signal: abortController.signal}),\n\t\t]);\n\t} catch (error) {\n\t\tif (!state.stdinCleanedUp) {\n\t\t\thandleStreamError(error, fdNumber, streamInfo, isSameDirection);\n\t\t}\n\t} finally {\n\t\tabortController.abort();\n\t}\n};\n\n// If `subprocess.stdin` is destroyed before being fully written to, it is considered aborted and should throw an error.\n// This can happen for example when user called `subprocess.stdin.destroy()` before `subprocess.stdin.end()`.\n// However, Node.js calls `subprocess.stdin.destroy()` on exit for cleanup purposes.\n// https://github.com/nodejs/node/blob/0b4cdb4b42956cbd7019058e409e06700a199e11/lib/internal/child_process.js#L278\n// This is normal and should not throw an error.\n// Therefore, we need to differentiate between both situations to know whether to throw an error.\n// Unfortunately, events (`close`, `error`, `end`, `exit`) cannot be used because `.destroy()` can take an arbitrary amount of time.\n// For example, `stdin: 'pipe'` is implemented as a TCP socket, and its `.destroy()` method waits for TCP disconnection.\n// Therefore `.destroy()` might end before or after subprocess exit, based on OS speed and load.\n// The only way to detect this is to spy on `subprocess.stdin._destroy()` by wrapping it.\n// If `subprocess.exitCode` or `subprocess.signalCode` is set, it means `.destroy()` is being called by Node.js itself.\nconst handleStdinDestroy = (stream, {originalStreams: [originalStdin], subprocess}) => {\n\tconst state = {stdinCleanedUp: false};\n\tif (stream === originalStdin) {\n\t\tspyOnStdinDestroy(stream, subprocess, state);\n\t}\n\n\treturn state;\n};\n\nconst spyOnStdinDestroy = (subprocessStdin, subprocess, state) => {\n\tconst {_destroy} = subprocessStdin;\n\tsubprocessStdin._destroy = (...destroyArguments) => {\n\t\tsetStdinCleanedUp(subprocess, state);\n\t\t_destroy.call(subprocessStdin, ...destroyArguments);\n\t};\n};\n\nconst setStdinCleanedUp = ({exitCode, signalCode}, state) => {\n\tif (exitCode !== null || signalCode !== null) {\n\t\tstate.stdinCleanedUp = true;\n\t}\n};\n\n// We ignore EPIPEs on writable streams and aborts on readable streams since those can happen normally.\n// When one stream errors, the error is propagated to the other streams on the same file descriptor.\n// Those other streams might have a different direction due to the above.\n// When this happens, the direction of both the initial stream and the others should then be taken into account.\n// Therefore, we keep track of whether a stream error is currently propagating.\nconst handleStreamError = (error, fdNumber, streamInfo, isSameDirection) => {\n\tif (!shouldIgnoreStreamError(error, fdNumber, streamInfo, isSameDirection)) {\n\t\tthrow error;\n\t}\n};\n\nconst shouldIgnoreStreamError = (error, fdNumber, streamInfo, isSameDirection = true) => {\n\tif (streamInfo.propagating) {\n\t\treturn isStreamEpipe(error) || isStreamAbort(error);\n\t}\n\n\tstreamInfo.propagating = true;\n\treturn isInputFileDescriptor(streamInfo, fdNumber) === isSameDirection\n\t\t? isStreamEpipe(error)\n\t\t: isStreamAbort(error);\n};\n\n// Unfortunately, we cannot use the stream's class or properties to know whether it is readable or writable.\n// For example, `subprocess.stdin` is technically a Duplex, but can only be used as a writable.\n// Therefore, we need to use the file descriptor's direction (`stdin` is input, `stdout` is output, etc.).\n// However, while `subprocess.std*` and transforms follow that direction, any stream passed the `std*` option has the opposite direction.\n// For example, `subprocess.stdin` is a writable, but the `stdin` option is a readable.\nexport const isInputFileDescriptor = ({fileDescriptors}, fdNumber) => fdNumber !== 'all' && fileDescriptors[fdNumber].direction === 'input';\n\n// When `stream.destroy()` is called without an `error` argument, stream is aborted.\n// This is the only way to abort a readable stream, which can be useful in some instances.\n// Therefore, we ignore this error on readable streams.\nexport const isStreamAbort = error => error?.code === 'ERR_STREAM_PREMATURE_CLOSE';\n\n// When `stream.write()` is called but the underlying source has been closed, `EPIPE` is emitted.\n// When piping subprocesses, the source subprocess usually decides when to stop piping.\n// However, there are some instances when the destination does instead, such as `... | head -n1`.\n// It notifies the source by using `EPIPE`.\n// Therefore, we ignore this error on writable streams.\nconst isStreamEpipe = error => error?.code === 'EPIPE';\n","import {getStreamOutput} from '../io/contents.js';\nimport {waitForStream, isInputFileDescriptor} from './wait-stream.js';\n\n// Read the contents of `subprocess.std*` and|or wait for its completion\nexport const waitForStdioStreams = ({subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline, verboseInfo, streamInfo}) => subprocess.stdio.map((stream, fdNumber) => waitForSubprocessStream({\n\tstream,\n\tfdNumber,\n\tencoding,\n\tbuffer: buffer[fdNumber],\n\tmaxBuffer: maxBuffer[fdNumber],\n\tlines: lines[fdNumber],\n\tallMixed: false,\n\tstripFinalNewline,\n\tverboseInfo,\n\tstreamInfo,\n}));\n\n// Read the contents of `subprocess.std*` or `subprocess.all` and|or wait for its completion\nexport const waitForSubprocessStream = async ({stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo}) => {\n\tif (!stream) {\n\t\treturn;\n\t}\n\n\tconst onStreamEnd = waitForStream(stream, fdNumber, streamInfo);\n\tif (isInputFileDescriptor(streamInfo, fdNumber)) {\n\t\tawait onStreamEnd;\n\t\treturn;\n\t}\n\n\tconst [output] = await Promise.all([\n\t\tgetStreamOutput({\n\t\t\tstream,\n\t\t\tonStreamEnd,\n\t\t\tfdNumber,\n\t\t\tencoding,\n\t\t\tbuffer,\n\t\t\tmaxBuffer,\n\t\t\tlines,\n\t\t\tallMixed,\n\t\t\tstripFinalNewline,\n\t\t\tverboseInfo,\n\t\t\tstreamInfo,\n\t\t}),\n\t\tonStreamEnd,\n\t]);\n\treturn output;\n};\n","import mergeStreams from '@sindresorhus/merge-streams';\nimport {waitForSubprocessStream} from './stdio.js';\n\n// `all` interleaves `stdout` and `stderr`\nexport const makeAllStream = ({stdout, stderr}, {all}) => all && (stdout || stderr)\n\t? mergeStreams([stdout, stderr].filter(Boolean))\n\t: undefined;\n\n// Read the contents of `subprocess.all` and|or wait for its completion\nexport const waitForAllStream = ({subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline, verboseInfo, streamInfo}) => waitForSubprocessStream({\n\t...getAllStream(subprocess, buffer),\n\tfdNumber: 'all',\n\tencoding,\n\tmaxBuffer: maxBuffer[1] + maxBuffer[2],\n\tlines: lines[1] || lines[2],\n\tallMixed: getAllMixed(subprocess),\n\tstripFinalNewline,\n\tverboseInfo,\n\tstreamInfo,\n});\n\nconst getAllStream = ({stdout, stderr, all}, [, bufferStdout, bufferStderr]) => {\n\tconst buffer = bufferStdout || bufferStderr;\n\tif (!buffer) {\n\t\treturn {stream: all, buffer};\n\t}\n\n\tif (!bufferStdout) {\n\t\treturn {stream: stderr, buffer};\n\t}\n\n\tif (!bufferStderr) {\n\t\treturn {stream: stdout, buffer};\n\t}\n\n\treturn {stream: all, buffer};\n};\n\n// When `subprocess.stdout` is in objectMode but not `subprocess.stderr` (or the opposite), we need to use both:\n// - `getStreamAsArray()` for the chunks in objectMode, to return as an array without changing each chunk\n// - `getStreamAsArrayBuffer()` or `getStream()` for the chunks not in objectMode, to convert them from Buffers to string or Uint8Array\n// We do this by emulating the Buffer -> string|Uint8Array conversion performed by `get-stream` with our own, which is identical.\nconst getAllMixed = ({all, stdout, stderr}) => all\n\t&& stdout\n\t&& stderr\n\t&& stdout.readableObjectMode !== stderr.readableObjectMode;\n","import {verboseLog, serializeVerboseMessage} from './log.js';\nimport {isFullVerbose} from './values.js';\n\n// When `verbose` is `'full'`, print IPC messages from the subprocess\nexport const shouldLogIpc = verboseInfo => isFullVerbose(verboseInfo, 'ipc');\n\nexport const logIpcOutput = (message, verboseInfo) => {\n\tconst verboseMessage = serializeVerboseMessage(message);\n\tverboseLog({\n\t\ttype: 'ipc',\n\t\tverboseMessage,\n\t\tfdNumber: 'ipc',\n\t\tverboseInfo,\n\t});\n};\n","import {checkIpcMaxBuffer} from '../io/max-buffer.js';\nimport {shouldLogIpc, logIpcOutput} from '../verbose/ipc.js';\nimport {getFdSpecificValue} from '../arguments/specific.js';\nimport {loopOnMessages} from './get-each.js';\n\n// Iterate through IPC messages sent by the subprocess\nexport const waitForIpcOutput = async ({\n\tsubprocess,\n\tbuffer: bufferArray,\n\tmaxBuffer: maxBufferArray,\n\tipc,\n\tipcOutput,\n\tverboseInfo,\n}) => {\n\tif (!ipc) {\n\t\treturn ipcOutput;\n\t}\n\n\tconst isVerbose = shouldLogIpc(verboseInfo);\n\tconst buffer = getFdSpecificValue(bufferArray, 'ipc');\n\tconst maxBuffer = getFdSpecificValue(maxBufferArray, 'ipc');\n\n\tfor await (const message of loopOnMessages({\n\t\tanyProcess: subprocess,\n\t\tchannel: subprocess.channel,\n\t\tisSubprocess: false,\n\t\tipc,\n\t\tshouldAwait: false,\n\t\treference: true,\n\t})) {\n\t\tif (buffer) {\n\t\t\tcheckIpcMaxBuffer(subprocess, ipcOutput, maxBuffer);\n\t\t\tipcOutput.push(message);\n\t\t}\n\n\t\tif (isVerbose) {\n\t\t\tlogIpcOutput(message, verboseInfo);\n\t\t}\n\t}\n\n\treturn ipcOutput;\n};\n\nexport const getBufferedIpcOutput = async (ipcOutputPromise, ipcOutput) => {\n\tawait Promise.allSettled([ipcOutputPromise]);\n\treturn ipcOutput;\n};\n","import {once} from 'node:events';\nimport {isStream as isNodeStream} from 'is-stream';\nimport {throwOnTimeout} from '../terminate/timeout.js';\nimport {throwOnCancel} from '../terminate/cancel.js';\nimport {throwOnGracefulCancel} from '../terminate/graceful.js';\nimport {isStandardStream} from '../utils/standard-stream.js';\nimport {TRANSFORM_TYPES} from '../stdio/type.js';\nimport {getBufferedData} from '../io/contents.js';\nimport {waitForIpcOutput, getBufferedIpcOutput} from '../ipc/buffer-messages.js';\nimport {sendIpcInput} from '../ipc/ipc-input.js';\nimport {waitForAllStream} from './all-async.js';\nimport {waitForStdioStreams} from './stdio.js';\nimport {waitForExit, waitForSuccessfulExit} from './exit-async.js';\nimport {waitForStream} from './wait-stream.js';\n\n// Retrieve result of subprocess: exit code, signal, error, streams (stdout/stderr/all)\nexport const waitForSubprocessResult = async ({\n\tsubprocess,\n\toptions: {\n\t\tencoding,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tlines,\n\t\ttimeoutDuration: timeout,\n\t\tcancelSignal,\n\t\tgracefulCancel,\n\t\tforceKillAfterDelay,\n\t\tstripFinalNewline,\n\t\tipc,\n\t\tipcInput,\n\t},\n\tcontext,\n\tverboseInfo,\n\tfileDescriptors,\n\toriginalStreams,\n\tonInternalError,\n\tcontroller,\n}) => {\n\tconst exitPromise = waitForExit(subprocess, context);\n\tconst streamInfo = {\n\t\toriginalStreams,\n\t\tfileDescriptors,\n\t\tsubprocess,\n\t\texitPromise,\n\t\tpropagating: false,\n\t};\n\n\tconst stdioPromises = waitForStdioStreams({\n\t\tsubprocess,\n\t\tencoding,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tlines,\n\t\tstripFinalNewline,\n\t\tverboseInfo,\n\t\tstreamInfo,\n\t});\n\tconst allPromise = waitForAllStream({\n\t\tsubprocess,\n\t\tencoding,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tlines,\n\t\tstripFinalNewline,\n\t\tverboseInfo,\n\t\tstreamInfo,\n\t});\n\tconst ipcOutput = [];\n\tconst ipcOutputPromise = waitForIpcOutput({\n\t\tsubprocess,\n\t\tbuffer,\n\t\tmaxBuffer,\n\t\tipc,\n\t\tipcOutput,\n\t\tverboseInfo,\n\t});\n\tconst originalPromises = waitForOriginalStreams(originalStreams, subprocess, streamInfo);\n\tconst customStreamsEndPromises = waitForCustomStreamsEnd(fileDescriptors, streamInfo);\n\n\ttry {\n\t\treturn await Promise.race([\n\t\t\tPromise.all([\n\t\t\t\t{},\n\t\t\t\twaitForSuccessfulExit(exitPromise),\n\t\t\t\tPromise.all(stdioPromises),\n\t\t\t\tallPromise,\n\t\t\t\tipcOutputPromise,\n\t\t\t\tsendIpcInput(subprocess, ipcInput),\n\t\t\t\t...originalPromises,\n\t\t\t\t...customStreamsEndPromises,\n\t\t\t]),\n\t\t\tonInternalError,\n\t\t\tthrowOnSubprocessError(subprocess, controller),\n\t\t\t...throwOnTimeout(subprocess, timeout, context, controller),\n\t\t\t...throwOnCancel({\n\t\t\t\tsubprocess,\n\t\t\t\tcancelSignal,\n\t\t\t\tgracefulCancel,\n\t\t\t\tcontext,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t\t...throwOnGracefulCancel({\n\t\t\t\tsubprocess,\n\t\t\t\tcancelSignal,\n\t\t\t\tgracefulCancel,\n\t\t\t\tforceKillAfterDelay,\n\t\t\t\tcontext,\n\t\t\t\tcontroller,\n\t\t\t}),\n\t\t]);\n\t} catch (error) {\n\t\tcontext.terminationReason ??= 'other';\n\t\treturn Promise.all([\n\t\t\t{error},\n\t\t\texitPromise,\n\t\t\tPromise.all(stdioPromises.map(stdioPromise => getBufferedData(stdioPromise))),\n\t\t\tgetBufferedData(allPromise),\n\t\t\tgetBufferedIpcOutput(ipcOutputPromise, ipcOutput),\n\t\t\tPromise.allSettled(originalPromises),\n\t\t\tPromise.allSettled(customStreamsEndPromises),\n\t\t]);\n\t}\n};\n\n// Transforms replace `subprocess.std*`, which means they are not exposed to users.\n// However, we still want to wait for their completion.\nconst waitForOriginalStreams = (originalStreams, subprocess, streamInfo) =>\n\toriginalStreams.map((stream, fdNumber) => stream === subprocess.stdio[fdNumber]\n\t\t? undefined\n\t\t: waitForStream(stream, fdNumber, streamInfo));\n\n// Some `stdin`/`stdout`/`stderr` options create a stream, e.g. when passing a file path.\n// The `.pipe()` method automatically ends that stream when `subprocess` ends.\n// This makes sure we wait for the completion of those streams, in order to catch any error.\nconst waitForCustomStreamsEnd = (fileDescriptors, streamInfo) => fileDescriptors.flatMap(({stdioItems}, fdNumber) => stdioItems\n\t.filter(({value, stream = value}) => isNodeStream(stream, {checkOpen: false}) && !isStandardStream(stream))\n\t.map(({type, value, stream = value}) => waitForStream(stream, fdNumber, streamInfo, {\n\t\tisSameDirection: TRANSFORM_TYPES.has(type),\n\t\tstopOnExit: type === 'native',\n\t})));\n\n// Fails when the subprocess emits an `error` event\nconst throwOnSubprocessError = async (subprocess, {signal}) => {\n\tconst [error] = await once(subprocess, 'error', {signal});\n\tthrow error;\n};\n","import {createDeferred} from '../utils/deferred.js';\n\n// When using multiple `.readable()`/`.writable()`/`.duplex()`, `final` and `destroy` should wait for other streams\nexport const initializeConcurrentStreams = () => ({\n\treadableDestroy: new WeakMap(),\n\twritableFinal: new WeakMap(),\n\twritableDestroy: new WeakMap(),\n});\n\n// Each file descriptor + `waitName` has its own array of promises.\n// Each promise is a single `.readable()`/`.writable()`/`.duplex()` call.\nexport const addConcurrentStream = (concurrentStreams, stream, waitName) => {\n\tconst weakMap = concurrentStreams[waitName];\n\tif (!weakMap.has(stream)) {\n\t\tweakMap.set(stream, []);\n\t}\n\n\tconst promises = weakMap.get(stream);\n\tconst promise = createDeferred();\n\tpromises.push(promise);\n\tconst resolve = promise.resolve.bind(promise);\n\treturn {resolve, promises};\n};\n\n// Wait for other streams, but stop waiting when subprocess ends\nexport const waitForConcurrentStreams = async ({resolve, promises}, subprocess) => {\n\tresolve();\n\tconst [isSubprocessExit] = await Promise.race([\n\t\tPromise.allSettled([true, subprocess]),\n\t\tPromise.all([false, ...promises]),\n\t]);\n\treturn !isSubprocessExit;\n};\n","import {finished} from 'node:stream/promises';\nimport {isStreamAbort} from '../resolve/wait-stream.js';\n\nexport const safeWaitForSubprocessStdin = async subprocessStdin => {\n\tif (subprocessStdin === undefined) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait waitForSubprocessStdin(subprocessStdin);\n\t} catch {}\n};\n\nexport const safeWaitForSubprocessStdout = async subprocessStdout => {\n\tif (subprocessStdout === undefined) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait waitForSubprocessStdout(subprocessStdout);\n\t} catch {}\n};\n\nexport const waitForSubprocessStdin = async subprocessStdin => {\n\tawait finished(subprocessStdin, {cleanup: true, readable: false, writable: true});\n};\n\nexport const waitForSubprocessStdout = async subprocessStdout => {\n\tawait finished(subprocessStdout, {cleanup: true, readable: true, writable: false});\n};\n\n// When `readable` or `writable` aborts/errors, awaits the subprocess, for the reason mentioned above\nexport const waitForSubprocess = async (subprocess, error) => {\n\tawait subprocess;\n\tif (error) {\n\t\tthrow error;\n\t}\n};\n\nexport const destroyOtherStream = (stream, isOpen, error) => {\n\tif (error && !isStreamAbort(error)) {\n\t\tstream.destroy(error);\n\t} else if (isOpen) {\n\t\tstream.destroy();\n\t}\n};\n","import {Readable} from 'node:stream';\nimport {callbackify} from 'node:util';\nimport {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {getFromStream} from '../arguments/fd-options.js';\nimport {iterateOnSubprocessStream, DEFAULT_OBJECT_HIGH_WATER_MARK} from '../io/iterate.js';\nimport {createDeferred} from '../utils/deferred.js';\nimport {addConcurrentStream, waitForConcurrentStreams} from './concurrent.js';\nimport {\n\tsafeWaitForSubprocessStdin,\n\twaitForSubprocessStdout,\n\twaitForSubprocess,\n\tdestroyOtherStream,\n} from './shared.js';\n\n// Create a `Readable` stream that forwards from `stdout` and awaits the subprocess\nexport const createReadable = ({subprocess, concurrentStreams, encoding}, {from, binary: binaryOption = true, preserveNewlines = true} = {}) => {\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst {subprocessStdout, waitReadableDestroy} = getSubprocessStdout(subprocess, from, concurrentStreams);\n\tconst {readableEncoding, readableObjectMode, readableHighWaterMark} = getReadableOptions(subprocessStdout, binary);\n\tconst {read, onStdoutDataDone} = getReadableMethods({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\tconst readable = new Readable({\n\t\tread,\n\t\tdestroy: callbackify(onReadableDestroy.bind(undefined, {subprocessStdout, subprocess, waitReadableDestroy})),\n\t\thighWaterMark: readableHighWaterMark,\n\t\tobjectMode: readableObjectMode,\n\t\tencoding: readableEncoding,\n\t});\n\tonStdoutFinished({\n\t\tsubprocessStdout,\n\t\tonStdoutDataDone,\n\t\treadable,\n\t\tsubprocess,\n\t});\n\treturn readable;\n};\n\n// Retrieve `stdout` (or other stream depending on `from`)\nexport const getSubprocessStdout = (subprocess, from, concurrentStreams) => {\n\tconst subprocessStdout = getFromStream(subprocess, from);\n\tconst waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, 'readableDestroy');\n\treturn {subprocessStdout, waitReadableDestroy};\n};\n\nexport const getReadableOptions = ({readableEncoding, readableObjectMode, readableHighWaterMark}, binary) => binary\n\t? {readableEncoding, readableObjectMode, readableHighWaterMark}\n\t: {readableEncoding, readableObjectMode: true, readableHighWaterMark: DEFAULT_OBJECT_HIGH_WATER_MARK};\n\nexport const getReadableMethods = ({subprocessStdout, subprocess, binary, encoding, preserveNewlines}) => {\n\tconst onStdoutDataDone = createDeferred();\n\tconst onStdoutData = iterateOnSubprocessStream({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tshouldEncode: !binary,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\n\treturn {\n\t\tread() {\n\t\t\tonRead(this, onStdoutData, onStdoutDataDone);\n\t\t},\n\t\tonStdoutDataDone,\n\t};\n};\n\n// Forwards data from `stdout` to `readable`\nconst onRead = async (readable, onStdoutData, onStdoutDataDone) => {\n\ttry {\n\t\tconst {value, done} = await onStdoutData.next();\n\t\tif (done) {\n\t\t\tonStdoutDataDone.resolve();\n\t\t} else {\n\t\t\treadable.push(value);\n\t\t}\n\t} catch {}\n};\n\n// When `subprocess.stdout` ends/aborts/errors, do the same on `readable`.\n// Await the subprocess, for the same reason as above.\nexport const onStdoutFinished = async ({subprocessStdout, onStdoutDataDone, readable, subprocess, subprocessStdin}) => {\n\ttry {\n\t\tawait waitForSubprocessStdout(subprocessStdout);\n\t\tawait subprocess;\n\t\tawait safeWaitForSubprocessStdin(subprocessStdin);\n\t\tawait onStdoutDataDone;\n\n\t\tif (readable.readable) {\n\t\t\treadable.push(null);\n\t\t}\n\t} catch (error) {\n\t\tawait safeWaitForSubprocessStdin(subprocessStdin);\n\t\tdestroyOtherReadable(readable, error);\n\t}\n};\n\n// When `readable` aborts/errors, do the same on `subprocess.stdout`\nexport const onReadableDestroy = async ({subprocessStdout, subprocess, waitReadableDestroy}, error) => {\n\tif (await waitForConcurrentStreams(waitReadableDestroy, subprocess)) {\n\t\tdestroyOtherReadable(subprocessStdout, error);\n\t\tawait waitForSubprocess(subprocess, error);\n\t}\n};\n\nconst destroyOtherReadable = (stream, error) => {\n\tdestroyOtherStream(stream, stream.readable, error);\n};\n","import {Writable} from 'node:stream';\nimport {callbackify} from 'node:util';\nimport {getToStream} from '../arguments/fd-options.js';\nimport {addConcurrentStream, waitForConcurrentStreams} from './concurrent.js';\nimport {\n\tsafeWaitForSubprocessStdout,\n\twaitForSubprocessStdin,\n\twaitForSubprocess,\n\tdestroyOtherStream,\n} from './shared.js';\n\n// Create a `Writable` stream that forwards to `stdin` and awaits the subprocess\nexport const createWritable = ({subprocess, concurrentStreams}, {to} = {}) => {\n\tconst {subprocessStdin, waitWritableFinal, waitWritableDestroy} = getSubprocessStdin(subprocess, to, concurrentStreams);\n\tconst writable = new Writable({\n\t\t...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),\n\t\tdestroy: callbackify(onWritableDestroy.bind(undefined, {\n\t\t\tsubprocessStdin,\n\t\t\tsubprocess,\n\t\t\twaitWritableFinal,\n\t\t\twaitWritableDestroy,\n\t\t})),\n\t\thighWaterMark: subprocessStdin.writableHighWaterMark,\n\t\tobjectMode: subprocessStdin.writableObjectMode,\n\t});\n\tonStdinFinished(subprocessStdin, writable);\n\treturn writable;\n};\n\n// Retrieve `stdin` (or other stream depending on `to`)\nexport const getSubprocessStdin = (subprocess, to, concurrentStreams) => {\n\tconst subprocessStdin = getToStream(subprocess, to);\n\tconst waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, 'writableFinal');\n\tconst waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, 'writableDestroy');\n\treturn {subprocessStdin, waitWritableFinal, waitWritableDestroy};\n};\n\nexport const getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({\n\twrite: onWrite.bind(undefined, subprocessStdin),\n\tfinal: callbackify(onWritableFinal.bind(undefined, subprocessStdin, subprocess, waitWritableFinal)),\n});\n\n// Forwards data from `writable` to `stdin`\nconst onWrite = (subprocessStdin, chunk, encoding, done) => {\n\tif (subprocessStdin.write(chunk, encoding)) {\n\t\tdone();\n\t} else {\n\t\tsubprocessStdin.once('drain', done);\n\t}\n};\n\n// Ensures that the writable `final` and readable `end` events awaits the subprocess.\n// Like this, any subprocess failure is propagated as a stream `error` event, instead of being lost.\n// The user does not need to `await` the subprocess anymore, but now needs to await the stream completion or error.\n// When multiple writables are targeting the same stream, they wait for each other, unless the subprocess ends first.\nconst onWritableFinal = async (subprocessStdin, subprocess, waitWritableFinal) => {\n\tif (await waitForConcurrentStreams(waitWritableFinal, subprocess)) {\n\t\tif (subprocessStdin.writable) {\n\t\t\tsubprocessStdin.end();\n\t\t}\n\n\t\tawait subprocess;\n\t}\n};\n\n// When `subprocess.stdin` ends/aborts/errors, do the same on `writable`.\nexport const onStdinFinished = async (subprocessStdin, writable, subprocessStdout) => {\n\ttry {\n\t\tawait waitForSubprocessStdin(subprocessStdin);\n\t\tif (writable.writable) {\n\t\t\twritable.end();\n\t\t}\n\t} catch (error) {\n\t\tawait safeWaitForSubprocessStdout(subprocessStdout);\n\t\tdestroyOtherWritable(writable, error);\n\t}\n};\n\n// When `writable` aborts/errors, do the same on `subprocess.stdin`\nexport const onWritableDestroy = async ({subprocessStdin, subprocess, waitWritableFinal, waitWritableDestroy}, error) => {\n\tawait waitForConcurrentStreams(waitWritableFinal, subprocess);\n\tif (await waitForConcurrentStreams(waitWritableDestroy, subprocess)) {\n\t\tdestroyOtherWritable(subprocessStdin, error);\n\t\tawait waitForSubprocess(subprocess, error);\n\t}\n};\n\nconst destroyOtherWritable = (stream, error) => {\n\tdestroyOtherStream(stream, stream.writable, error);\n};\n","import {Duplex} from 'node:stream';\nimport {callbackify} from 'node:util';\nimport {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {\n\tgetSubprocessStdout,\n\tgetReadableOptions,\n\tgetReadableMethods,\n\tonStdoutFinished,\n\tonReadableDestroy,\n} from './readable.js';\nimport {\n\tgetSubprocessStdin,\n\tgetWritableMethods,\n\tonStdinFinished,\n\tonWritableDestroy,\n} from './writable.js';\n\n// Create a `Duplex` stream combining both `subprocess.readable()` and `subprocess.writable()`\nexport const createDuplex = ({subprocess, concurrentStreams, encoding}, {from, to, binary: binaryOption = true, preserveNewlines = true} = {}) => {\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst {subprocessStdout, waitReadableDestroy} = getSubprocessStdout(subprocess, from, concurrentStreams);\n\tconst {subprocessStdin, waitWritableFinal, waitWritableDestroy} = getSubprocessStdin(subprocess, to, concurrentStreams);\n\tconst {readableEncoding, readableObjectMode, readableHighWaterMark} = getReadableOptions(subprocessStdout, binary);\n\tconst {read, onStdoutDataDone} = getReadableMethods({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\tconst duplex = new Duplex({\n\t\tread,\n\t\t...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),\n\t\tdestroy: callbackify(onDuplexDestroy.bind(undefined, {\n\t\t\tsubprocessStdout,\n\t\t\tsubprocessStdin,\n\t\t\tsubprocess,\n\t\t\twaitReadableDestroy,\n\t\t\twaitWritableFinal,\n\t\t\twaitWritableDestroy,\n\t\t})),\n\t\treadableHighWaterMark,\n\t\twritableHighWaterMark: subprocessStdin.writableHighWaterMark,\n\t\treadableObjectMode,\n\t\twritableObjectMode: subprocessStdin.writableObjectMode,\n\t\tencoding: readableEncoding,\n\t});\n\tonStdoutFinished({\n\t\tsubprocessStdout,\n\t\tonStdoutDataDone,\n\t\treadable: duplex,\n\t\tsubprocess,\n\t\tsubprocessStdin,\n\t});\n\tonStdinFinished(subprocessStdin, duplex, subprocessStdout);\n\treturn duplex;\n};\n\nconst onDuplexDestroy = async ({subprocessStdout, subprocessStdin, subprocess, waitReadableDestroy, waitWritableFinal, waitWritableDestroy}, error) => {\n\tawait Promise.all([\n\t\tonReadableDestroy({subprocessStdout, subprocess, waitReadableDestroy}, error),\n\t\tonWritableDestroy({\n\t\t\tsubprocessStdin,\n\t\t\tsubprocess,\n\t\t\twaitWritableFinal,\n\t\t\twaitWritableDestroy,\n\t\t}, error),\n\t]);\n};\n","import {BINARY_ENCODINGS} from '../arguments/encoding-option.js';\nimport {getFromStream} from '../arguments/fd-options.js';\nimport {iterateOnSubprocessStream} from '../io/iterate.js';\n\n// Convert the subprocess to an async iterable\nexport const createIterable = (subprocess, encoding, {\n\tfrom,\n\tbinary: binaryOption = false,\n\tpreserveNewlines = false,\n} = {}) => {\n\tconst binary = binaryOption || BINARY_ENCODINGS.has(encoding);\n\tconst subprocessStdout = getFromStream(subprocess, from);\n\tconst onStdoutData = iterateOnSubprocessStream({\n\t\tsubprocessStdout,\n\t\tsubprocess,\n\t\tbinary,\n\t\tshouldEncode: true,\n\t\tencoding,\n\t\tpreserveNewlines,\n\t});\n\treturn iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);\n};\n\nconst iterateOnStdoutData = async function * (onStdoutData, subprocessStdout, subprocess) {\n\ttry {\n\t\tyield * onStdoutData;\n\t} finally {\n\t\tif (subprocessStdout.readable) {\n\t\t\tsubprocessStdout.destroy();\n\t\t}\n\n\t\tawait subprocess;\n\t}\n};\n","import {initializeConcurrentStreams} from './concurrent.js';\nimport {createReadable} from './readable.js';\nimport {createWritable} from './writable.js';\nimport {createDuplex} from './duplex.js';\nimport {createIterable} from './iterable.js';\n\n// Add methods to convert the subprocess to a stream or iterable\nexport const addConvertedStreams = (subprocess, {encoding}) => {\n\tconst concurrentStreams = initializeConcurrentStreams();\n\tsubprocess.readable = createReadable.bind(undefined, {subprocess, concurrentStreams, encoding});\n\tsubprocess.writable = createWritable.bind(undefined, {subprocess, concurrentStreams});\n\tsubprocess.duplex = createDuplex.bind(undefined, {subprocess, concurrentStreams, encoding});\n\tsubprocess.iterable = createIterable.bind(undefined, subprocess, encoding);\n\tsubprocess[Symbol.asyncIterator] = createIterable.bind(undefined, subprocess, encoding, {});\n};\n","// The return value is a mixin of `subprocess` and `Promise`\nexport const mergePromise = (subprocess, promise) => {\n\tfor (const [property, descriptor] of descriptors) {\n\t\tconst value = descriptor.value.bind(promise);\n\t\tReflect.defineProperty(subprocess, property, {...descriptor, value});\n\t}\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\nconst nativePromisePrototype = (async () => {})().constructor.prototype;\n\nconst descriptors = ['then', 'catch', 'finally'].map(property => [\n\tproperty,\n\tReflect.getOwnPropertyDescriptor(nativePromisePrototype, property),\n]);\n","import {setMaxListeners} from 'node:events';\nimport {spawn} from 'node:child_process';\nimport {MaxBufferError} from 'get-stream';\nimport {handleCommand} from '../arguments/command.js';\nimport {normalizeOptions} from '../arguments/options.js';\nimport {SUBPROCESS_OPTIONS} from '../arguments/fd-options.js';\nimport {concatenateShell} from '../arguments/shell.js';\nimport {addIpcMethods} from '../ipc/methods.js';\nimport {makeError, makeSuccessResult} from '../return/result.js';\nimport {handleResult} from '../return/reject.js';\nimport {handleEarlyError} from '../return/early-error.js';\nimport {handleStdioAsync} from '../stdio/handle-async.js';\nimport {stripNewline} from '../io/strip-newline.js';\nimport {pipeOutputAsync} from '../io/output-async.js';\nimport {subprocessKill} from '../terminate/kill.js';\nimport {cleanupOnExit} from '../terminate/cleanup.js';\nimport {pipeToSubprocess} from '../pipe/setup.js';\nimport {makeAllStream} from '../resolve/all-async.js';\nimport {waitForSubprocessResult} from '../resolve/wait-subprocess.js';\nimport {addConvertedStreams} from '../convert/add.js';\nimport {createDeferred} from '../utils/deferred.js';\nimport {mergePromise} from './promise.js';\n\n// Main shared logic for all async methods: `execa()`, `$`, `execaNode()`\nexport const execaCoreAsync = (rawFile, rawArguments, rawOptions, createNested) => {\n\tconst {file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors} = handleAsyncArguments(rawFile, rawArguments, rawOptions);\n\tconst {subprocess, promise} = spawnSubprocessAsync({\n\t\tfile,\n\t\tcommandArguments,\n\t\toptions,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tfileDescriptors,\n\t});\n\tsubprocess.pipe = pipeToSubprocess.bind(undefined, {\n\t\tsource: subprocess,\n\t\tsourcePromise: promise,\n\t\tboundOptions: {},\n\t\tcreateNested,\n\t});\n\tmergePromise(subprocess, promise);\n\tSUBPROCESS_OPTIONS.set(subprocess, {options, fileDescriptors});\n\treturn subprocess;\n};\n\n// Compute arguments to pass to `child_process.spawn()`\nconst handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {\n\tconst {command, escapedCommand, startTime, verboseInfo} = handleCommand(rawFile, rawArguments, rawOptions);\n\tconst {file, commandArguments, options: normalizedOptions} = normalizeOptions(rawFile, rawArguments, rawOptions);\n\tconst options = handleAsyncOptions(normalizedOptions);\n\tconst fileDescriptors = handleStdioAsync(options, verboseInfo);\n\treturn {\n\t\tfile,\n\t\tcommandArguments,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\toptions,\n\t\tfileDescriptors,\n\t};\n};\n\n// Options normalization logic specific to async methods.\n// Prevent passing the `timeout` option directly to `child_process.spawn()`.\nconst handleAsyncOptions = ({timeout, signal, ...options}) => {\n\tif (signal !== undefined) {\n\t\tthrow new TypeError('The \"signal\" option has been renamed to \"cancelSignal\" instead.');\n\t}\n\n\treturn {...options, timeoutDuration: timeout};\n};\n\nconst spawnSubprocessAsync = ({file, commandArguments, options, startTime, verboseInfo, command, escapedCommand, fileDescriptors}) => {\n\tlet subprocess;\n\ttry {\n\t\tsubprocess = spawn(...concatenateShell(file, commandArguments, options));\n\t} catch (error) {\n\t\treturn handleEarlyError({\n\t\t\terror,\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\tfileDescriptors,\n\t\t\toptions,\n\t\t\tstartTime,\n\t\t\tverboseInfo,\n\t\t});\n\t}\n\n\tconst controller = new AbortController();\n\tsetMaxListeners(Number.POSITIVE_INFINITY, controller.signal);\n\n\tconst originalStreams = [...subprocess.stdio];\n\tpipeOutputAsync(subprocess, fileDescriptors, controller);\n\tcleanupOnExit(subprocess, options, controller);\n\n\tconst context = {};\n\tconst onInternalError = createDeferred();\n\tsubprocess.kill = subprocessKill.bind(undefined, {\n\t\tkill: subprocess.kill.bind(subprocess),\n\t\toptions,\n\t\tonInternalError,\n\t\tcontext,\n\t\tcontroller,\n\t});\n\tsubprocess.all = makeAllStream(subprocess, options);\n\taddConvertedStreams(subprocess, options);\n\taddIpcMethods(subprocess, options);\n\n\tconst promise = handlePromise({\n\t\tsubprocess,\n\t\toptions,\n\t\tstartTime,\n\t\tverboseInfo,\n\t\tfileDescriptors,\n\t\toriginalStreams,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tcontext,\n\t\tonInternalError,\n\t\tcontroller,\n\t});\n\treturn {subprocess, promise};\n};\n\n// Asynchronous logic, as opposed to the previous logic which can be run synchronously, i.e. can be returned to user right away\nconst handlePromise = async ({subprocess, options, startTime, verboseInfo, fileDescriptors, originalStreams, command, escapedCommand, context, onInternalError, controller}) => {\n\tconst [\n\t\terrorInfo,\n\t\t[exitCode, signal],\n\t\tstdioResults,\n\t\tallResult,\n\t\tipcOutput,\n\t] = await waitForSubprocessResult({\n\t\tsubprocess,\n\t\toptions,\n\t\tcontext,\n\t\tverboseInfo,\n\t\tfileDescriptors,\n\t\toriginalStreams,\n\t\tonInternalError,\n\t\tcontroller,\n\t});\n\tcontroller.abort();\n\tonInternalError.resolve();\n\n\tconst stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber));\n\tconst all = stripNewline(allResult, options, 'all');\n\tconst result = getAsyncResult({\n\t\terrorInfo,\n\t\texitCode,\n\t\tsignal,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\tcontext,\n\t\toptions,\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstartTime,\n\t});\n\treturn handleResult(result, verboseInfo, options);\n};\n\nconst getAsyncResult = ({errorInfo, exitCode, signal, stdio, all, ipcOutput, context, options, command, escapedCommand, startTime}) => 'error' in errorInfo\n\t? makeError({\n\t\terror: errorInfo.error,\n\t\tcommand,\n\t\tescapedCommand,\n\t\ttimedOut: context.terminationReason === 'timeout',\n\t\tisCanceled: context.terminationReason === 'cancel' || context.terminationReason === 'gracefulCancel',\n\t\tisGracefullyCanceled: context.terminationReason === 'gracefulCancel',\n\t\tisMaxBuffer: errorInfo.error instanceof MaxBufferError,\n\t\tisForcefullyTerminated: context.isForcefullyTerminated,\n\t\texitCode,\n\t\tsignal,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\toptions,\n\t\tstartTime,\n\t\tisSync: false,\n\t})\n\t: makeSuccessResult({\n\t\tcommand,\n\t\tescapedCommand,\n\t\tstdio,\n\t\tall,\n\t\tipcOutput,\n\t\toptions,\n\t\tstartTime,\n\t});\n","import isPlainObject from 'is-plain-obj';\nimport {FD_SPECIFIC_OPTIONS} from '../arguments/specific.js';\n\n// Deep merge specific options like `env`. Shallow merge the other ones.\nexport const mergeOptions = (boundOptions, options) => {\n\tconst newOptions = Object.fromEntries(\n\t\tObject.entries(options).map(([optionName, optionValue]) => [\n\t\t\toptionName,\n\t\t\tmergeOption(optionName, boundOptions[optionName], optionValue),\n\t\t]),\n\t);\n\treturn {...boundOptions, ...newOptions};\n};\n\nconst mergeOption = (optionName, boundOptionValue, optionValue) => {\n\tif (DEEP_OPTIONS.has(optionName) && isPlainObject(boundOptionValue) && isPlainObject(optionValue)) {\n\t\treturn {...boundOptionValue, ...optionValue};\n\t}\n\n\treturn optionValue;\n};\n\nconst DEEP_OPTIONS = new Set(['env', ...FD_SPECIFIC_OPTIONS]);\n","import isPlainObject from 'is-plain-obj';\nimport {normalizeParameters} from './parameters.js';\nimport {isTemplateString, parseTemplates} from './template.js';\nimport {execaCoreSync} from './main-sync.js';\nimport {execaCoreAsync} from './main-async.js';\nimport {mergeOptions} from './bind.js';\n\n// Wraps every exported methods to provide the following features:\n// - template string syntax: execa`command argument`\n// - options binding: boundExeca = execa(options)\n// - optional argument/options: execa(file), execa(file, args), execa(file, options), execa(file, args, options)\n// `mapArguments()` and `setBoundExeca()` allows for method-specific logic.\nexport const createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => {\n\tconst createNested = (mapArguments, boundOptions, setBoundExeca) => createExeca(mapArguments, boundOptions, deepOptions, setBoundExeca);\n\tconst boundExeca = (...execaArguments) => callBoundExeca({\n\t\tmapArguments,\n\t\tdeepOptions,\n\t\tboundOptions,\n\t\tsetBoundExeca,\n\t\tcreateNested,\n\t}, ...execaArguments);\n\n\tif (setBoundExeca !== undefined) {\n\t\tsetBoundExeca(boundExeca, createNested, boundOptions);\n\t}\n\n\treturn boundExeca;\n};\n\nconst callBoundExeca = ({mapArguments, deepOptions = {}, boundOptions = {}, setBoundExeca, createNested}, firstArgument, ...nextArguments) => {\n\tif (isPlainObject(firstArgument)) {\n\t\treturn createNested(mapArguments, mergeOptions(boundOptions, firstArgument), setBoundExeca);\n\t}\n\n\tconst {file, commandArguments, options, isSync} = parseArguments({\n\t\tmapArguments,\n\t\tfirstArgument,\n\t\tnextArguments,\n\t\tdeepOptions,\n\t\tboundOptions,\n\t});\n\treturn isSync\n\t\t? execaCoreSync(file, commandArguments, options)\n\t\t: execaCoreAsync(file, commandArguments, options, createNested);\n};\n\nconst parseArguments = ({mapArguments, firstArgument, nextArguments, deepOptions, boundOptions}) => {\n\tconst callArguments = isTemplateString(firstArgument)\n\t\t? parseTemplates(firstArgument, nextArguments)\n\t\t: [firstArgument, ...nextArguments];\n\tconst [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments);\n\tconst mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions);\n\tconst {\n\t\tfile = initialFile,\n\t\tcommandArguments = initialArguments,\n\t\toptions = mergedOptions,\n\t\tisSync = false,\n\t} = mapArguments({file: initialFile, commandArguments: initialArguments, options: mergedOptions});\n\treturn {\n\t\tfile,\n\t\tcommandArguments,\n\t\toptions,\n\t\tisSync,\n\t};\n};\n","// Main logic for `execaCommand()`\nexport const mapCommandAsync = ({file, commandArguments}) => parseCommand(file, commandArguments);\n\n// Main logic for `execaCommandSync()`\nexport const mapCommandSync = ({file, commandArguments}) => ({...parseCommand(file, commandArguments), isSync: true});\n\n// Convert `execaCommand(command)` into `execa(file, ...commandArguments)`\nconst parseCommand = (command, unusedArguments) => {\n\tif (unusedArguments.length > 0) {\n\t\tthrow new TypeError(`The command and its arguments must be passed as a single string: ${command} ${unusedArguments}.`);\n\t}\n\n\tconst [file, ...commandArguments] = parseCommandString(command);\n\treturn {file, commandArguments};\n};\n\n// Convert `command` string into an array of file or arguments to pass to $`${...fileOrCommandArguments}`\nexport const parseCommandString = command => {\n\tif (typeof command !== 'string') {\n\t\tthrow new TypeError(`The command must be a string: ${String(command)}.`);\n\t}\n\n\tconst trimmedCommand = command.trim();\n\tif (trimmedCommand === '') {\n\t\treturn [];\n\t}\n\n\tconst tokens = [];\n\tfor (const token of trimmedCommand.split(SPACES_REGEXP)) {\n\t\t// Allow spaces to be escaped by a backslash if not meant as a delimiter\n\t\tconst previousToken = tokens.at(-1);\n\t\tif (previousToken && previousToken.endsWith('\\\\')) {\n\t\t\t// Merge previous token with current one\n\t\t\ttokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;\n\t\t} else {\n\t\t\ttokens.push(token);\n\t\t}\n\t}\n\n\treturn tokens;\n};\n\nconst SPACES_REGEXP = / +/g;\n","// Sets `$.sync` and `$.s`\nexport const setScriptSync = (boundExeca, createNested, boundOptions) => {\n\tboundExeca.sync = createNested(mapScriptSync, boundOptions);\n\tboundExeca.s = boundExeca.sync;\n};\n\n// Main logic for `$`\nexport const mapScriptAsync = ({options}) => getScriptOptions(options);\n\n// Main logic for `$.sync`\nconst mapScriptSync = ({options}) => ({...getScriptOptions(options), isSync: true});\n\n// `$` is like `execa` but with script-friendly options: `{stdin: 'inherit', preferLocal: true}`\nconst getScriptOptions = options => ({options: {...getScriptStdinOption(options), ...options}});\n\nconst getScriptStdinOption = ({input, inputFile, stdio}) => input === undefined && inputFile === undefined && stdio === undefined\n\t? {stdin: 'inherit'}\n\t: {};\n\n// When using $(...).pipe(...), most script-friendly options should apply to both commands.\n// However, some options (like `stdin: 'inherit'`) would create issues with piping, i.e. cannot be deep.\nexport const deepScriptOptions = {preferLocal: true};\n","import {createExeca} from './lib/methods/create.js';\nimport {mapCommandAsync, mapCommandSync} from './lib/methods/command.js';\nimport {mapNode} from './lib/methods/node.js';\nimport {mapScriptAsync, setScriptSync, deepScriptOptions} from './lib/methods/script.js';\nimport {getIpcExport} from './lib/ipc/methods.js';\n\nexport {parseCommandString} from './lib/methods/command.js';\nexport {ExecaError, ExecaSyncError} from './lib/return/final-error.js';\n\nexport const execa = createExeca(() => ({}));\nexport const execaSync = createExeca(() => ({isSync: true}));\nexport const execaCommand = createExeca(mapCommandAsync);\nexport const execaCommandSync = createExeca(mapCommandSync);\nexport const execaNode = createExeca(mapNode);\nexport const $ = createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);\n\nconst {\n\tsendMessage,\n\tgetOneMessage,\n\tgetEachMessage,\n\tgetCancelSignal,\n} = getIpcExport();\nexport {\n\tsendMessage,\n\tgetOneMessage,\n\tgetEachMessage,\n\tgetCancelSignal,\n};\n","import os from \"os\";\nimport path from \"path\";\nimport { initOptionsSchema } from \"@/src/commands/init\";\n// import { fetchRegistry } from \"@/src/registry/fetcher\"\nimport { getPackageManager } from \"@/src/utils/get-package-manager\";\nimport { getPackageRunner } from \"@/src/utils/get-package-manager\";\nimport { handleError } from \"@/src/utils/handle-error\";\nimport { highlighter } from \"@/src/utils/highlighter\";\nimport { logger } from \"@/src/utils/logger\";\nimport { spinner } from \"@/src/utils/spinner\";\nimport { execa } from \"execa\";\nimport fs from \"fs-extra\";\nimport prompts from \"prompts\";\nimport { z } from \"zod\";\n\nconst MONOREPO_TEMPLATE_URL =\n \"https://codeload.github.com/bejamas/ui/tar.gz/main\";\n\nexport const TEMPLATES = {\n astro: \"astro\",\n \"astro-monorepo\": \"astro-monorepo\",\n \"astro-with-component-docs-monorepo\": \"astro-with-component-docs-monorepo\",\n} as const;\n\nexport async function createProject(\n options: Pick<\n z.infer<typeof initOptionsSchema>,\n \"cwd\" | \"force\" | \"srcDir\" | \"components\" | \"template\"\n >,\n) {\n options = {\n srcDir: false,\n ...options,\n };\n\n let template: keyof typeof TEMPLATES =\n options.template && TEMPLATES[options.template as keyof typeof TEMPLATES]\n ? (options.template as keyof typeof TEMPLATES)\n : \"astro\";\n let projectName: string =\n template === TEMPLATES.astro ? \"my-app\" : \"my-monorepo\";\n let astroVersion = \"latest\";\n\n const isRemoteComponent =\n options.components?.length === 1 &&\n !!options.components[0].match(/\\/chat\\/b\\//);\n\n // if (options.components && isRemoteComponent) {\n // try {\n // const [result] = await fetchRegistry(options.components)\n // const { meta } = z\n // .object({\n // meta: z.object({\n // astroVersion: z.string(),\n // }),\n // })\n // .parse(result)\n // astroVersion = meta.astroVersion\n\n // // Force template to astro for remote components.\n // template = TEMPLATES.astro\n // } catch (error) {\n // logger.break()\n // handleError(error)\n // }\n // }\n\n if (!options.force) {\n const { type, name } = await prompts([\n {\n type: options.template || isRemoteComponent ? null : \"select\",\n name: \"type\",\n message: `The path ${highlighter.info(\n options.cwd,\n )} does not contain a package.json file.\\n Would you like to start a new project?`,\n choices: [\n { title: \"Astro\", value: \"astro\" },\n { title: \"Astro (Monorepo)\", value: \"astro-monorepo\" },\n {\n title: \"Astro with Component Docs (Monorepo)\",\n value: \"astro-with-component-docs-monorepo\",\n },\n ],\n initial: 0,\n },\n {\n type: \"text\",\n name: \"name\",\n message: \"What is your project named?\",\n initial: projectName,\n format: (value: string) => value.trim(),\n validate: (value: string) =>\n value.length > 128\n ? `Name should be less than 128 characters.`\n : true,\n },\n ]);\n\n template = type ?? template;\n projectName = name;\n }\n\n const packageManager = await getPackageManager(options.cwd, {\n withFallback: true,\n });\n\n const projectPath = `${options.cwd}/${projectName}`;\n\n // Check if path is writable.\n try {\n await fs.access(options.cwd, fs.constants.W_OK);\n } catch (error) {\n logger.break();\n logger.error(`The path ${highlighter.info(options.cwd)} is not writable.`);\n logger.error(\n `It is likely you do not have write permissions for this folder or the path ${highlighter.info(\n options.cwd,\n )} does not exist.`,\n );\n logger.break();\n process.exit(1);\n }\n\n if (fs.existsSync(path.resolve(options.cwd, projectName, \"package.json\"))) {\n logger.break();\n logger.error(\n `A project with the name ${highlighter.info(projectName)} already exists.`,\n );\n logger.error(`Please choose a different name and try again.`);\n logger.break();\n process.exit(1);\n }\n\n if (template === TEMPLATES.astro) {\n await createAstroProject(projectPath, {\n version: astroVersion,\n cwd: options.cwd,\n packageManager,\n srcDir: !!options.srcDir,\n });\n }\n\n if (template === TEMPLATES[\"astro-monorepo\"]) {\n await createMonorepoProject(projectPath, {\n packageManager,\n });\n }\n\n return {\n projectPath,\n projectName,\n template,\n };\n}\n\nasync function createAstroProject(\n projectPath: string,\n options: {\n version: string;\n cwd: string;\n packageManager: string;\n srcDir: boolean;\n },\n) {\n const createSpinner = spinner(\n `Creating a new Astro project. This may take a few minutes.`,\n ).start();\n\n const args = [\"--yes\", \"--install\", \"--skip-houston\"];\n\n try {\n const runner = await getPackageRunner(options.cwd);\n await execa(\n runner,\n [`create-astro@${options.version}`, projectPath, ...args],\n {\n cwd: options.cwd,\n },\n );\n\n // Add Tailwind integration to the new Astro project\n await execa(runner, [\"astro\", \"add\", \"tailwind\", \"--yes\"], {\n cwd: path.resolve(options.cwd, projectPath),\n });\n } catch (error) {\n logger.break();\n logger.error(\n `Something went wrong creating a new Astro project. Please try again.`,\n );\n process.exit(1);\n }\n\n createSpinner?.succeed(\"Creating a new Astro project.\");\n}\n\nasync function createMonorepoProject(\n projectPath: string,\n options: {\n packageManager: string;\n },\n) {\n const createSpinner = spinner(\n `Creating a new Astro monorepo. This may take a few minutes.`,\n ).start();\n\n try {\n // Get the template.\n const templatePath = path.join(\n os.tmpdir(),\n `bejamas-template-${Date.now()}`,\n );\n await fs.ensureDir(templatePath);\n const response = await fetch(MONOREPO_TEMPLATE_URL);\n if (!response.ok) {\n throw new Error(`Failed to download template: ${response.statusText}`);\n }\n\n // Write the tar file\n const tarPath = path.resolve(templatePath, \"template.tar.gz\");\n await fs.writeFile(tarPath, Buffer.from(await response.arrayBuffer()));\n await execa(\"tar\", [\n \"-xzf\",\n tarPath,\n \"-C\",\n templatePath,\n \"--strip-components=2\",\n \"ui-main/templates/monorepo-next\",\n ]);\n const extractedPath = path.resolve(templatePath, \"monorepo-next\");\n await fs.move(extractedPath, projectPath);\n await fs.remove(templatePath);\n\n // Run install.\n await execa(options.packageManager, [\"install\"], {\n cwd: projectPath,\n });\n\n // Try git init.\n const cwd = process.cwd();\n await execa(\"git\", [\"--version\"], { cwd: projectPath });\n await execa(\"git\", [\"init\"], { cwd: projectPath });\n await execa(\"git\", [\"add\", \"-A\"], { cwd: projectPath });\n await execa(\"git\", [\"commit\", \"-m\", \"Initial commit\"], {\n cwd: projectPath,\n });\n // await execa(\"cd\", [cwd])\n\n createSpinner?.succeed(\"Creating a new Astro monorepo.\");\n } catch (error) {\n createSpinner?.fail(\"Something went wrong creating a new Astro monorepo.\");\n handleError(error);\n }\n}\n","import { promises as fs } from \"fs\";\nimport path from \"path\";\nimport { preFlightInit } from \"@/src/preflights/preflight-init\";\nimport {\n getRegistryBaseColors,\n getRegistryItems,\n getRegistryStyles,\n} from \"@/src/registry/api\";\nimport { buildUrlAndHeadersForRegistryItem } from \"@/src/registry/builder\";\nimport { configWithDefaults } from \"@/src/registry/config\";\nimport { BASE_COLORS, BUILTIN_REGISTRIES } from \"@/src/registry/constants\";\nimport { clearRegistryContext } from \"@/src/registry/context\";\nimport { rawConfigSchema } from \"@/src/schema\";\nimport { addComponents } from \"@/src/utils/add-components\";\nimport { TEMPLATES, createProject } from \"@/src/utils/create-project\";\n// import { loadEnvFiles } from \"@/src/utils/env-loader\"\nimport * as ERRORS from \"@/src/utils/errors\";\n// import {\n// FILE_BACKUP_SUFFIX,\n// createFileBackup,\n// deleteFileBackup,\n// restoreFileBackup,\n// } from \"@/src/utils/file-helper\"\nimport {\n DEFAULT_COMPONENTS,\n DEFAULT_TAILWIND_CONFIG,\n DEFAULT_TAILWIND_CSS,\n DEFAULT_UTILS,\n getConfig,\n resolveConfigPaths,\n type Config,\n} from \"@/src/utils/get-config\";\nimport {\n getProjectConfig,\n getProjectInfo,\n getProjectTailwindVersionFromConfig,\n} from \"@/src/utils/get-project-info\";\nimport { handleError } from \"@/src/utils/handle-error\";\nimport { highlighter } from \"@/src/utils/highlighter\";\nimport { logger } from \"@/src/utils/logger\";\nimport { Command } from \"commander\";\nimport { z } from \"zod\";\n\n// process.on(\"exit\", (code) => {\n// const filePath = path.resolve(process.cwd(), \"components.json\")\n\n// // Delete backup if successful.\n// if (code === 0) {\n// return deleteFileBackup(filePath)\n// }\n\n// // Restore backup if error.\n// return restoreFileBackup(filePath)\n// })\n\nexport const initOptionsSchema = z.object({\n cwd: z.string(),\n components: z.array(z.string()).optional(),\n yes: z.boolean(),\n defaults: z.boolean(),\n force: z.boolean(),\n silent: z.boolean(),\n isNewProject: z.boolean(),\n srcDir: z.boolean().optional(),\n cssVariables: z.boolean(),\n template: z\n .string()\n .optional()\n .refine(\n (val) => {\n if (val) {\n return TEMPLATES[val as keyof typeof TEMPLATES];\n }\n return true;\n },\n {\n message: \"Invalid template. Please use 'next' or 'next-monorepo'.\",\n },\n ),\n baseColor: z\n .string()\n .optional()\n .refine(\n (val) => {\n if (val) {\n return BASE_COLORS.find((color) => color.name === val);\n }\n\n return true;\n },\n {\n message: `Invalid base color. Please use '${BASE_COLORS.map(\n (color) => color.name,\n ).join(\"', '\")}'`,\n },\n ),\n baseStyle: z.boolean(),\n});\n\nexport const init = new Command()\n .name(\"init\")\n .description(\"initialize your project and install dependencies\")\n .argument(\"[components...]\", \"names, url or local path to component\")\n .option(\n \"-t, --template <template>\",\n \"the template to use. (next, next-monorepo)\",\n )\n .option(\n \"-b, --base-color <base-color>\",\n \"the base color to use. (neutral, gray, zinc, stone, slate)\",\n undefined,\n )\n .option(\"-y, --yes\", \"skip confirmation prompt.\", true)\n .option(\"-d, --defaults,\", \"use default configuration.\", false)\n .option(\"-f, --force\", \"force overwrite of existing configuration.\", false)\n .option(\n \"-c, --cwd <cwd>\",\n \"the working directory. defaults to the current directory.\",\n process.cwd(),\n )\n .option(\"-s, --silent\", \"mute output.\", false)\n .option(\n \"--src-dir\",\n \"use the src directory when creating a new project.\",\n false,\n )\n .option(\n \"--no-src-dir\",\n \"do not use the src directory when creating a new project.\",\n )\n .option(\"--css-variables\", \"use css variables for theming.\", true)\n .option(\"--no-css-variables\", \"do not use css variables for theming.\")\n .option(\"--no-base-style\", \"do not install the base shadcn style.\")\n .action(async (_components, opts) => {\n try {\n const cwd = path.resolve(opts.cwd);\n const projectInfo = await getProjectInfo(cwd);\n\n const isAstro = Boolean(projectInfo?.isAstro);\n const hasTailwind = Boolean(\n projectInfo &&\n (projectInfo.tailwindVersion ||\n projectInfo.tailwindConfigFile ||\n projectInfo.tailwindCssFile),\n );\n\n logger.log(\"\");\n\n await runInit(opts);\n\n logger.log(\n `${highlighter.success(\n \"Success!\",\n )} Project initialization completed.\\nYou may now add components.`,\n );\n\n // We need when runninng with custom cwd.\n deleteFileBackup(path.resolve(options.cwd, \"components.json\"));\n logger.break();\n } catch (error) {\n logger.break();\n handleError(error);\n } finally {\n clearRegistryContext();\n }\n });\n\nexport async function runInit(\n options: z.infer<typeof initOptionsSchema> & {\n skipPreflight?: boolean;\n },\n) {\n let projectInfo;\n let newProjectTemplate;\n if (!options.skipPreflight) {\n const preflight = await preFlightInit(options);\n if (preflight.errors[ERRORS.MISSING_DIR_OR_EMPTY_PROJECT]) {\n const { projectPath, template } = await createProject(options);\n if (!projectPath) {\n process.exit(1);\n }\n options.cwd = projectPath;\n options.isNewProject = true;\n newProjectTemplate = template;\n }\n projectInfo = preflight.projectInfo;\n } else {\n projectInfo = await getProjectInfo(options.cwd);\n }\n\n console.log({ option, newProjectTemplate });\n\n if (newProjectTemplate === \"astro-monorepo\") {\n options.cwd = path.resolve(options.cwd, \"apps/web\");\n return await getConfig(options.cwd);\n }\n\n const projectConfig = await getProjectConfig(options.cwd, projectInfo);\n\n console.log(\"projectConfig\", projectConfig);\n\n let config = projectConfig\n ? await promptForMinimalConfig(projectConfig, options)\n : await promptForConfig(await getConfig(options.cwd));\n\n if (!options.yes) {\n const { proceed } = await prompts({\n type: \"confirm\",\n name: \"proceed\",\n message: `Write configuration to ${highlighter.info(\n \"components.json\",\n )}. Proceed?`,\n initial: true,\n });\n\n if (!proceed) {\n process.exit(0);\n }\n }\n\n // Prepare the list of components to be added.\n const components = [\n // \"index\" is the default shadcn style.\n // Why index? Because when style is true, we read style from components.json and fetch that.\n // i.e new-york from components.json then fetch /styles/new-york/index.\n // TODO: Fix this so that we can extend any style i.e --style=new-york.\n ...(options.baseStyle ? [\"index\"] : []),\n ...(options.components ?? []),\n ];\n\n // Ensure registries are configured for the components we're about to add.\n const fullConfigForRegistry = await resolveConfigPaths(options.cwd, config);\n const { config: configWithRegistries } = await ensureRegistriesInConfig(\n components,\n fullConfigForRegistry,\n {\n silent: true,\n },\n );\n\n // Update config with any new registries found.\n if (configWithRegistries.registries) {\n config.registries = configWithRegistries.registries;\n }\n\n const componentSpinner = spinner(`Writing components.json.`).start();\n const targetPath = path.resolve(options.cwd, \"components.json\");\n const backupPath = `${targetPath}${FILE_BACKUP_SUFFIX}`;\n\n // Merge with backup config if it exists and not using --force\n if (!options.force && fsExtra.existsSync(backupPath)) {\n const existingConfig = await fsExtra.readJson(backupPath);\n\n // Move registries at the end of the config.\n const { registries, ...merged } = deepmerge(existingConfig, config);\n config = { ...merged, registries };\n }\n\n // Make sure to filter out built-in registries.\n // TODO: fix this in ensureRegistriesInConfig.\n config.registries = Object.fromEntries(\n Object.entries(config.registries || {}).filter(\n ([key]) => !Object.keys(BUILTIN_REGISTRIES).includes(key),\n ),\n );\n\n // Write components.json.\n await fs.writeFile(\n targetPath,\n `${JSON.stringify(config, null, 2)}\\n`,\n \"utf8\",\n );\n componentSpinner.succeed();\n\n // // Add components.\n // const fullConfig = await resolveConfigPaths(options.cwd, config)\n // await addComponents(components, fullConfig, {\n // // Init will always overwrite files.\n // overwrite: true,\n // silent: options.silent,\n // baseStyle: options.baseStyle,\n // isNewProject:\n // options.isNewProject || projectInfo?.framework.name === \"next-app\",\n // })\n\n // // If a new project is using src dir, let's update the tailwind content config.\n // // TODO: Handle this per framework.\n // if (options.isNewProject && options.srcDir) {\n // await updateTailwindContent(\n // [\"./src/**/*.{js,ts,jsx,tsx,mdx}\"],\n // fullConfig,\n // {\n // silent: options.silent,\n // }\n // )\n // }\n\n return fullConfig;\n}\n","import { Command } from \"commander\";\nimport { dirname, resolve, isAbsolute, relative } from \"node:path\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { logger } from \"@/src/utils/logger\";\nimport prompts from \"prompts\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nfunction readTsConfig(projectRoot: string): any | null {\n try {\n const tsconfigPath = resolve(projectRoot, \"tsconfig.json\");\n if (!existsSync(tsconfigPath)) return null;\n const raw = readFileSync(tsconfigPath, \"utf-8\");\n return JSON.parse(raw);\n } catch {\n return null;\n }\n}\n\nfunction resolveAliasPathUsingTsConfig(\n inputPath: string,\n projectRoot: string,\n): string | null {\n const cfg = readTsConfig(projectRoot);\n if (!cfg || !cfg.compilerOptions) return null;\n const baseUrl: string = cfg.compilerOptions.baseUrl || \".\";\n const paths: Record<string, string[] | string> =\n cfg.compilerOptions.paths || {};\n for (const [key, values] of Object.entries(paths)) {\n const pattern = key.replace(/\\*/g, \"(.*)\");\n const re = new RegExp(`^${pattern}$`);\n const match = inputPath.match(re);\n if (!match) continue;\n const wildcard = match[1] || \"\";\n const first = Array.isArray(values) ? values[0] : values;\n if (!first) continue;\n const target = String(first).replace(/\\*/g, wildcard);\n return resolve(projectRoot, baseUrl, target);\n }\n return null;\n}\n\nasync function generateDocs({\n cwd,\n outDir,\n verbose,\n}: {\n cwd?: string;\n outDir?: string;\n verbose?: boolean;\n}) {\n const DEBUG =\n process.env.BEJAMAS_DEBUG === \"1\" ||\n process.env.BEJAMAS_DEBUG === \"true\" ||\n verbose;\n\n try {\n const shellCwd = process.cwd();\n\n // Probe for components.json up the directory tree starting from shell CWD\n let projectRoot = shellCwd;\n let probe: string | null = shellCwd;\n for (let i = 0; i < 6 && probe; i += 1) {\n const candidate = resolve(probe, \"components.json\");\n if (existsSync(candidate)) {\n projectRoot = probe;\n try {\n const raw = readFileSync(candidate, \"utf-8\");\n const config = JSON.parse(raw);\n // If UI root not provided via CLI, try to infer from aliases.ui first\n if (!cwd && !process.env.BEJAMAS_UI_ROOT && config?.aliases?.ui) {\n const mapped: string = String(config.aliases.ui);\n let uiAbs: string | null = null;\n if (\n mapped.startsWith(\"./\") ||\n mapped.startsWith(\"../\") ||\n isAbsolute(mapped)\n ) {\n uiAbs = resolve(projectRoot, mapped);\n } else {\n uiAbs = resolveAliasPathUsingTsConfig(mapped, projectRoot);\n }\n if (!uiAbs && mapped.startsWith(\"@/\")) {\n uiAbs = resolve(projectRoot, \"src\", mapped.slice(2));\n }\n if (uiAbs) {\n process.env.BEJAMAS_UI_ROOT = uiAbs;\n }\n }\n // Fallback: infer UI root from tailwind.css\n if (!cwd && !process.env.BEJAMAS_UI_ROOT && config?.tailwind?.css) {\n const cssRaw = String(config.tailwind.css);\n let cssAbs: string | null = null;\n if (\n cssRaw.startsWith(\"./\") ||\n cssRaw.startsWith(\"../\") ||\n isAbsolute(cssRaw)\n ) {\n cssAbs = resolve(projectRoot, cssRaw);\n } else {\n cssAbs = resolveAliasPathUsingTsConfig(cssRaw, projectRoot);\n }\n if (!cssAbs && cssRaw.startsWith(\"@/\")) {\n cssAbs = resolve(projectRoot, \"src\", cssRaw.slice(2));\n }\n if (cssAbs) {\n const uiRootFromCss = resolve(cssAbs, \"..\", \"..\", \"..\");\n process.env.BEJAMAS_UI_ROOT = uiRootFromCss;\n }\n }\n // If out dir not provided via CLI, try to infer from aliases.docs\n if (!outDir && config?.aliases?.docs) {\n const mapped: string = String(config.aliases.docs);\n let outResolved: string | null = null;\n if (\n mapped.startsWith(\"./\") ||\n mapped.startsWith(\"../\") ||\n isAbsolute(mapped)\n ) {\n outResolved = mapped;\n } else {\n const abs = resolveAliasPathUsingTsConfig(mapped, projectRoot);\n if (abs) outResolved = relative(projectRoot, abs);\n }\n if (!outResolved && mapped.startsWith(\"@/\")) {\n outResolved = mapped.replace(/^@\\//, \"src/\");\n }\n // As a last resort, use the mapped value as-is so we do not prompt for output\n const finalOut = outResolved ?? mapped;\n if (finalOut && !process.env.BEJAMAS_DOCS_OUT_DIR) {\n process.env.BEJAMAS_DOCS_OUT_DIR = finalOut;\n process.env.BEJAMAS_DOCS_CWD = projectRoot;\n }\n }\n } catch {}\n break;\n }\n const parent = resolve(probe, \"..\");\n probe = parent === probe ? null : parent;\n }\n\n // Defaults if not already set from components.json\n if (!process.env.BEJAMAS_DOCS_CWD) {\n process.env.BEJAMAS_DOCS_CWD = shellCwd;\n }\n if (!process.env.BEJAMAS_UI_ROOT) {\n // Ask user for @bejamas/ui root when not inferred\n const defaultGuess = (() => {\n // Try local monorepo style packages/ui\n let current = shellCwd;\n for (let i = 0; i < 6; i += 1) {\n const cand = resolve(current, \"packages/ui/package.json\");\n if (existsSync(cand)) {\n const abs = resolve(current, \"packages/ui\");\n const rel = relative(shellCwd, abs);\n return rel || abs;\n }\n const parent = resolve(current, \"..\");\n if (parent === current) break;\n current = parent;\n }\n // Try installed node_modules fallback\n const nm = resolve(shellCwd, \"node_modules/@bejamas/ui/package.json\");\n if (existsSync(nm)) {\n const abs = resolve(shellCwd, \"node_modules/@bejamas/ui\");\n const rel = relative(shellCwd, abs);\n return rel || abs;\n }\n // Last resort: suggest a common local path\n return \"packages/ui\";\n })();\n const { uiRoot } = await prompts({\n type: \"text\",\n name: \"uiRoot\",\n message: \"Path to @bejamas/ui package root:\",\n initial: defaultGuess,\n validate: (val: string) => {\n const p = resolve(shellCwd, val);\n return existsSync(resolve(p, \"package.json\"))\n ? true\n : `No package.json found in ${p}`;\n },\n });\n if (!uiRoot) {\n logger.error(\"@bejamas/ui root is required to generate docs.\");\n process.exit(1);\n }\n process.env.BEJAMAS_UI_ROOT = resolve(shellCwd, uiRoot);\n }\n\n // CLI overrides take precedence\n if (cwd && cwd.length) {\n process.env.BEJAMAS_UI_ROOT = resolve(cwd);\n }\n if (outDir && outDir.length) {\n // Pass through exactly as provided; the generator will resolve against BEJAMAS_DOCS_CWD if needed.\n process.env.BEJAMAS_DOCS_OUT_DIR = outDir;\n }\n\n // If output dir still not defined, prompt the user\n if (!process.env.BEJAMAS_DOCS_OUT_DIR) {\n const { out } = await prompts({\n type: \"text\",\n name: \"out\",\n message: \"Where should we output docs (relative to project root)?\",\n initial: \"src/content/docs/components\",\n });\n if (!out) {\n logger.error(\"An output directory is required to generate docs.\");\n process.exit(1);\n }\n process.env.BEJAMAS_DOCS_OUT_DIR = out;\n process.env.BEJAMAS_DOCS_CWD = process.env.BEJAMAS_DOCS_CWD || shellCwd;\n }\n // Ensure the generator does not auto-run upon import; we'll invoke it explicitly\n process.env.BEJAMAS_SKIP_AUTO_RUN = \"1\";\n logger.info(`Generating docs...`);\n if (DEBUG) {\n logger.info(`Generator entry: @/src/docs/generate-mdx/index`);\n if (process.env.BEJAMAS_UI_ROOT)\n logger.info(`UI root: ${process.env.BEJAMAS_UI_ROOT}`);\n if (process.env.BEJAMAS_DOCS_CWD)\n logger.info(`Docs CWD: ${process.env.BEJAMAS_DOCS_CWD}`);\n if (process.env.BEJAMAS_DOCS_OUT_DIR)\n logger.info(`Docs out: ${process.env.BEJAMAS_DOCS_OUT_DIR}`);\n }\n const mod = await import(\"@/src/docs/generate-mdx/index\");\n if (typeof mod.runDocsGenerator === \"function\") {\n await mod.runDocsGenerator();\n } else {\n throw new Error(\n \"Failed to load docs generator. Export 'runDocsGenerator' not found.\",\n );\n }\n } catch (err: any) {\n logger.error(err?.message || String(err));\n process.exit(1);\n }\n}\n\nexport const docs = new Command()\n .name(\"docs:build\")\n .alias(\"docs\")\n .description(\"generate docs from @bejamas/ui components\")\n .option(\"-c, --cwd <cwd>\", \"path to UI working directory\")\n .option(\"-o, --out <outDir>\", \"output directory for generated MDX files\")\n .action(async (opts) => {\n await generateDocs({\n cwd: opts.cwd,\n outDir: opts.out,\n verbose: Boolean(opts.verbose),\n });\n });\n","import { Command } from \"commander\";\nimport { execSync } from \"node:child_process\";\nimport { URL } from \"node:url\";\nimport { logger } from \"@/src/utils/logger\";\nimport { getPackageRunner } from \"@/src/utils/get-package-manager\";\n\nfunction shellQuote(arg: string): string {\n if (arg === \"\") return \"''\";\n if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(arg)) return arg;\n return `'${arg.replace(/'/g, `'\\\\''`)}'`;\n}\n\nfunction extractOptionsForShadcn(rawArgv: string[]): string[] {\n const addIndex = rawArgv.findIndex((arg) => arg === \"add\");\n if (addIndex === -1) return [];\n const rest = rawArgv.slice(addIndex + 1);\n const forwarded: string[] = [];\n for (let i = 0; i < rest.length; i += 1) {\n const token = rest[i];\n if (token === \"--\") {\n forwarded.push(\"--\", ...rest.slice(i + 1));\n break;\n }\n if (token.startsWith(\"-\")) {\n if (token === \"-v\" || token === \"--verbose\") continue;\n forwarded.push(token);\n const next = rest[i + 1];\n if (next && !next.startsWith(\"-\")) {\n forwarded.push(next);\n i += 1;\n }\n continue;\n }\n // Non-option token => likely a package name, skip\n }\n return forwarded;\n}\n\nasync function addComponents(\n packages: string[],\n forwardedOptions: string[],\n isVerbose: boolean,\n) {\n if (!packages || packages.length === 0) {\n logger.info(\"Usage: bejamas add [...packages]\");\n process.exit(1);\n }\n\n for (const pkg of packages) {\n const packageName = String(pkg || \"\").trim();\n if (!packageName) continue;\n logger.info(`Adding ${packageName} component...`);\n\n const url = new URL(`r/${packageName}.json`, \"http://localhost:4321\");\n\n const extra = forwardedOptions.map((t) => shellQuote(t)).join(\" \");\n const runner = await getPackageRunner(process.cwd());\n const isNpx = runner === \"npx\";\n const cmd = `${runner} ${isNpx ? \"-y \" : \"\"}shadcn@latest add ${url.toString()}${\n extra ? ` ${extra}` : \"\"\n }`;\n if (isVerbose) {\n logger.info(`[bejamas-ui] ${cmd}`);\n }\n execSync(cmd, { stdio: \"inherit\" });\n }\n}\n\nexport const add = new Command()\n .name(\"add\")\n .description(\"Add components via shadcn@latest using registry URLs\")\n .argument(\"[components...]\", \"Component package names to add\")\n .option(\"-y, --yes\", \"skip confirmation prompt.\", false)\n .option(\"-o, --overwrite\", \"overwrite existing files.\", false)\n .option(\n \"-c, --cwd <cwd>\",\n \"the working directory. defaults to the current directory.\",\n process.cwd(),\n )\n .option(\"-a, --all\", \"add all available components\", false)\n .option(\"-p, --path <path>\", \"the path to add the component to.\")\n .option(\"-s, --silent\", \"mute output.\", false)\n .option(\n \"--src-dir\",\n \"use the src directory when creating a new project.\",\n false,\n )\n .option(\n \"--no-src-dir\",\n \"do not use the src directory when creating a new project.\",\n )\n // .option(\"--css-variables\", \"use css variables for theming.\", true)\n // .option(\"--no-css-variables\", \"do not use css variables for theming.\")\n .action(async function action(packages: string[], _opts, cmd) {\n const root = cmd?.parent;\n const verbose = Boolean(root?.opts?.().verbose);\n const rawArgv = process.argv.slice(2);\n const forwardedOptions = extractOptionsForShadcn(rawArgv);\n await addComponents(packages || [], forwardedOptions, verbose);\n });\n","#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport { createRequire } from \"module\";\nimport { init } from \"@/src/commands/init\";\nimport { docs } from \"@/src/commands/docs\";\nimport { add } from \"@/src/commands/add\";\n\nconst require = createRequire(import.meta.url);\nconst pkg = require(\"../package.json\");\n\nconst program = new Command()\n .name(\"bejamas\")\n .description(\"bejamas/ui cli\")\n .configureHelp({\n helpWidth: Math.min(100, process.stdout.columns || 100),\n })\n .version(pkg.version, \"-v, --version\", \"output the version number\");\n\nprogram.addCommand(init);\nprogram.addCommand(add);\nprogram.addCommand(docs);\n\nprogram.parse(process.argv);\n\nexport default program;\n"],"x_google_ignoreList":[8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,+BAA+B;AAI5C,MAAa,0BAA0B;AACvC,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;;;;ACHrC,MAAa,eACX,QAAQ,IAAI,gBAAgB;AAI9B,MAAa,cAAc;CACzB;EACE,MAAM;EACN,OAAO;EACR;CACD;EACE,MAAM;EACN,OAAO;EACR;CACD;EACE,MAAM;EACN,OAAO;EACR;CACD;EACE,MAAM;EACN,OAAO;EACR;CACD;EACE,MAAM;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,QAAM;CACnB,QAAO,WAAS;CAChB,QAAO;CACP,aAAY;CACZ,UAAS;CACR;AAED,MAAM,WAAS;AACf,MAAa,WAAS;;;;ACbtB,MAAa,UAAQ;CACrB;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aACA;EACA,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACT,QAAO;EACN;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACT,QAAO;EACN;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACT,QAAO;EACN;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO;EACP,aAAY;EACZ,UAAS;EACR;CACD;EACA,MAAK;EACL,QAAO;EACP,QAAO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