@learnosity/lib-qti-converter 0.16.0 → 0.16.2
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/package.json +10 -10
- package/packages/cli/dist/{batchProcessors-C7czhqX0.js → batchProcessors-BGdELwug.js} +75 -102
- package/packages/cli/dist/batchProcessors-BGdELwug.js.map +1 -0
- package/packages/cli/dist/batchWorker.js +2 -3
- package/packages/cli/dist/{configOutput-FwkFyQmk.js → configOutput-DYPwNQf7.js} +5 -9
- package/packages/cli/dist/{configOutput-FwkFyQmk.js.map → configOutput-DYPwNQf7.js.map} +1 -1
- package/packages/cli/dist/{create-prompt-dWckcotJ.js → create-prompt-C3XKo-s3.js} +95 -71
- package/packages/cli/dist/create-prompt-C3XKo-s3.js.map +1 -0
- package/packages/cli/dist/{dist-DXDR2peT.js → dist-D7b9-VIt.js} +8 -11
- package/packages/cli/dist/dist-D7b9-VIt.js.map +1 -0
- package/packages/cli/dist/{learnosityToQti-D4ddrXaz.js → learnosityToQti-CN6KKSmF.js} +5 -6
- package/packages/cli/dist/{learnosityToQti-D4ddrXaz.js.map → learnosityToQti-CN6KKSmF.js.map} +1 -1
- package/packages/cli/dist/{learnosityToQtiPackage-Bwzm-uLX.js → learnosityToQtiPackage-CMOQRiCV.js} +29 -21
- package/packages/cli/dist/learnosityToQtiPackage-CMOQRiCV.js.map +1 -0
- package/packages/cli/dist/main.js +22 -29
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/{nodeFileAccess-BhCoGDOi.js → nodeFileAccess-_jRCd340.js} +6 -10
- package/packages/cli/dist/{nodeFileAccess-BhCoGDOi.js.map → nodeFileAccess-_jRCd340.js.map} +1 -1
- package/packages/cli/dist/pathUtils-I2bRHUwu.js +2922 -0
- package/packages/cli/dist/pathUtils-I2bRHUwu.js.map +1 -0
- package/packages/cli/dist/{qtiPackageToLearnosity-CX9htPId.js → qtiPackageToLearnosity-JRb3TTyC.js} +7 -8
- package/packages/cli/dist/{qtiPackageToLearnosity-CX9htPId.js.map → qtiPackageToLearnosity-JRb3TTyC.js.map} +1 -1
- package/packages/cli/dist/{qtiToLearnosity-JQYOkNbM.js → qtiToLearnosity-C-jQYKqR.js} +6 -7
- package/packages/cli/dist/{qtiToLearnosity-JQYOkNbM.js.map → qtiToLearnosity-C-jQYKqR.js.map} +1 -1
- package/packages/cli/dist/{resolveOptions-BuNN2KMA.js → resolveOptions-ikupjaRQ.js} +322 -359
- package/packages/cli/dist/resolveOptions-ikupjaRQ.js.map +1 -0
- package/packages/cli/dist/{rolldown-runtime-DktXgydw.js → rolldown-runtime-BuRBZLzk.js} +13 -12
- package/packages/cli/dist/{table-DsKq-B4-.js → table-6SiZD7aK.js} +9944 -2294
- package/packages/cli/dist/table-6SiZD7aK.js.map +1 -0
- package/packages/core/dist/index.d.ts +8 -58
- package/packages/core/dist/index.js +9923 -2267
- package/packages/core/dist/node.d.ts +10 -80
- package/packages/core/dist/node.js +9951 -2311
- package/packages/cli/dist/batchProcessors-C7czhqX0.js.map +0 -1
- package/packages/cli/dist/create-prompt-dWckcotJ.js.map +0 -1
- package/packages/cli/dist/dist-DXDR2peT.js.map +0 -1
- package/packages/cli/dist/learnosityToQtiPackage-Bwzm-uLX.js.map +0 -1
- package/packages/cli/dist/pathUtils-D_VsVde8.js +0 -2272
- package/packages/cli/dist/pathUtils-D_VsVde8.js.map +0 -1
- package/packages/cli/dist/resolveOptions-BuNN2KMA.js.map +0 -1
- package/packages/cli/dist/table-DsKq-B4-.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveOptions-ikupjaRQ.js","names":["Table","process","process","spinners","process","process","process","stdinDiscarder","cliSpinners","logSymbols.success","logSymbols.error","logSymbols.warning","logSymbols.info","input","select"],"sources":["../../core/src/conversions.ts","../src/io/readInput.ts","../src/io/writeOutput.ts","../src/ux/resolvedOptions.ts","../../../node_modules/.pnpm/mimic-function@5.0.1/node_modules/mimic-function/index.js","../../../node_modules/.pnpm/onetime@7.0.0/node_modules/onetime/index.js","../../../node_modules/.pnpm/restore-cursor@5.1.0/node_modules/restore-cursor/index.js","../../../node_modules/.pnpm/cli-cursor@5.0.0/node_modules/cli-cursor/index.js","../../../node_modules/.pnpm/cli-spinners@3.4.0/node_modules/cli-spinners/spinners.json","../../../node_modules/.pnpm/cli-spinners@3.4.0/node_modules/cli-spinners/index.js","../../../node_modules/.pnpm/yoctocolors@2.2.0/node_modules/yoctocolors/base.js","../../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.pnpm/log-symbols@7.0.1/node_modules/log-symbols/symbols.js","../../../node_modules/.pnpm/is-interactive@2.0.0/node_modules/is-interactive/index.js","../../../node_modules/.pnpm/stdin-discarder@0.3.2/node_modules/stdin-discarder/index.js","../../../node_modules/.pnpm/ora@10.0.0/node_modules/ora/index.js","../src/ux/progress.ts","../src/options/resolveOptions.ts"],"sourcesContent":["/**\n * Browser-safe, in-memory conversion entry points (no filesystem access).\n *\n * Disk/ZIP-based conversions (`convertQtiPackageToLearnosity`,\n * `convertLearnosityToQtiPackage`) live in `conversions.node.ts` and are exposed\n * from `@learnosity/converter-core/node`.\n */\n\nimport type { Diagnostic, ConversionOptions, ConversionResult } from './types.js';\nimport type { LearnosityItemJson } from './qti-to-learnosity/types.js';\nimport { parseLearnosityItem } from './learnosity-model/parseLearnosityItem.js';\nimport { mapLearnosityToAst } from './learnosity-mapper/mapLearnosityToAst.js';\nimport { serializeAssessmentItem } from './qti-serializer/serializeAssessmentItem.js';\nimport { convertQtiAssessmentItemToLearnosity } from './qti-to-learnosity/convertQtiToLearnosity.js';\nimport { transformForwardAssetUrlsInXml } from './learnosity-mapper/forwardAssetUrlTransform.js';\n\n/**\n * Convert QTI XML to Learnosity JSON.\n *\n * Pure/in-memory: passage and LOM lookups only happen if a `fileAccess`\n * implementation is supplied in `opts` (Node callers can inject `nodeFileAccess`\n * from `@learnosity/converter-core/node`).\n *\n * @param input - QTI XML string\n * @param opts - Conversion options\n * @returns Learnosity JSON and diagnostics\n */\nexport function convertQtiToLearnosity(\n input: string,\n opts: ConversionOptions\n): Promise<ConversionResult<LearnosityItemJson | undefined>> {\n const result = convertQtiAssessmentItemToLearnosity(input, {\n qtiVersion: opts.qtiVersion,\n inputPath: opts.inputPath,\n // Thread the input path through as `sourceFile` so the single-item\n // `--item-reference-source sourceFilename` mode derives the reference\n // from the filename (the package path already passes `sourceFile`).\n sourceFile: opts.inputPath,\n organisationId: opts.organisationId,\n mediaVault: opts.mediaVault,\n customAssetUrl: opts.customAssetUrl,\n preserveAssetFilenames: opts.preserveAssetFilenames ?? false,\n itemReferenceSource: opts.itemReferenceSource,\n splitCsvTags: opts.splitCsvTags,\n fileAccess: opts.fileAccess,\n });\n\n return Promise.resolve({\n output: result.item,\n diagnostics: result.diagnostics,\n });\n}\n\n/**\n * Convert Learnosity JSON to QTI XML\n * @param input - Learnosity JSON object\n * @param opts - Conversion options\n * @returns QTI XML string and diagnostics\n */\nexport function convertLearnosityToQti(\n input: unknown,\n opts: ConversionOptions\n): Promise<ConversionResult<string>> {\n const allDiagnostics: Diagnostic[] = [];\n\n // Step 1: Parse Learnosity Item\n const parseResult = parseLearnosityItem(input);\n\n allDiagnostics.push(...parseResult.diagnostics);\n\n if (!parseResult.model) {\n // Parsing failed, return empty output\n return Promise.resolve({\n output: '',\n diagnostics: allDiagnostics,\n });\n }\n\n // Check for sharedpassage features (not supported in standalone item conversion)\n const hasSharedpassage = parseResult.model.features.some((f) => f.type === 'sharedpassage');\n\n if (hasSharedpassage) {\n allDiagnostics.push({\n level: 'warning',\n code: 'QTI_STIMULUS_INLINED_STANDALONE',\n message:\n 'Item contains sharedpassage features, but standalone item conversion does not support stimulus resources. Use learnosity-to-qti-package command to convert as a package with proper stimulus resources.',\n file: 'features',\n });\n }\n\n // Step 2: Map to QTI AST\n const mapResult = mapLearnosityToAst(parseResult.model);\n\n allDiagnostics.push(...mapResult.diagnostics);\n\n if (!mapResult.ast) {\n // Mapping failed, return empty output\n return Promise.resolve({\n output: '',\n diagnostics: allDiagnostics,\n });\n }\n\n // Step 3: Serialize to XML\n const serializeResult = serializeAssessmentItem(mapResult.ast, {\n pretty: true,\n version: opts.qtiVersion,\n });\n\n allDiagnostics.push(...serializeResult.diagnostics);\n\n if (!serializeResult.xml) {\n // Serialization failed, return empty output\n return Promise.resolve({\n output: '',\n diagnostics: allDiagnostics,\n });\n }\n\n // Check if there are any error-level diagnostics\n const hasErrors = allDiagnostics.some((d) => d.level === 'error');\n\n if (hasErrors) {\n // Don't emit output if there are errors\n return Promise.resolve({\n output: '',\n diagnostics: allDiagnostics,\n });\n }\n\n // Rewrite asset reference prefixes (images/audio/video) to the package\n // convention (`./assets/<filename>`) or a caller-supplied customAssetUrl.\n const output = transformForwardAssetUrlsInXml(serializeResult.xml, opts.customAssetUrl);\n\n return Promise.resolve({\n output,\n diagnostics: allDiagnostics,\n });\n}\n","import { readFile, stat } from 'fs/promises';\nimport { createInterface } from 'readline';\n\n/**\n * Read input from file or stdin\n * @param inputPath - File path or '-' for stdin\n * @returns Input content as string\n */\nexport async function readInput(inputPath: string): Promise<string> {\n if (inputPath === '-') {\n return readStdin();\n }\n\n // Check if path is a directory\n try {\n const stats = await stat(inputPath);\n\n if (stats.isDirectory()) {\n throw new Error(\n `Input path is a directory: ${inputPath}\\n` +\n `\\n` +\n `To convert a directory of Learnosity items, use:\\n` +\n ` lrn-converter learnosity-to-qti-package --in ${inputPath} --out <output-path>\\n` +\n `\\n` +\n `Or use the short alias:\\n` +\n ` lcon learnosity-to-qti-package --in ${inputPath} --out <output-path>`\n );\n }\n } catch (error) {\n // If stat fails, let readFile handle the error\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw error;\n }\n }\n\n return readFile(inputPath, 'utf-8');\n}\n\n/**\n * Read from stdin\n */\nasync function readStdin(): Promise<string> {\n const chunks: string[] = [];\n const rl = createInterface({\n input: process.stdin,\n crlfDelay: Infinity,\n });\n\n for await (const line of rl) {\n chunks.push(line);\n }\n\n return chunks.join('\\n');\n}\n\n/**\n * Parse JSON input safely\n * @param input - String that might be JSON\n * @returns Parsed object or throws\n */\nexport function parseJsonInput(input: string): unknown {\n try {\n return JSON.parse(input);\n } catch (error) {\n throw new Error(`Failed to parse JSON input: ${error instanceof Error ? error.message : 'unknown error'}`);\n }\n}\n","import { writeFile, mkdir } from 'fs/promises';\nimport { dirname } from 'path';\n\n/**\n * Write output to file or stdout\n * @param outputPath - File path or '-' for stdout\n * @param content - Content to write\n * @param pretty - Pretty-print JSON if applicable\n */\nexport async function writeOutput(outputPath: string, content: string | unknown, pretty: boolean = false): Promise<void> {\n let output: string;\n\n if (typeof content === 'string') {\n output = content;\n } else {\n output = JSON.stringify(content, null, pretty ? 2 : 0);\n }\n\n if (outputPath === '-') {\n process.stdout.write(output);\n if (!output.endsWith('\\n')) {\n process.stdout.write('\\n');\n }\n } else {\n await mkdir(dirname(outputPath), { recursive: true });\n await writeFile(outputPath, output, 'utf-8');\n }\n}\n","import boxen from 'boxen';\nimport chalk from 'chalk';\nimport Table from 'cli-table3';\nimport type { ResolvedOptions, ResolvedOptionsWithSources } from '../options/types.js';\n\n/**\n * Display resolved options in a box\n */\nexport function showResolvedOptions(\n options: ResolvedOptions,\n withSources?: ResolvedOptionsWithSources,\n quiet = false\n): void {\n // Don't show options if quiet mode is enabled\n if (quiet) {\n return;\n }\n\n const lines: string[] = [];\n\n lines.push(chalk.bold('Resolved Options'));\n lines.push('');\n lines.push(`${chalk.dim('Input:')} ${options.inputPath}`);\n lines.push(`${chalk.dim('Output:')} ${options.outputPath}`);\n lines.push(`${chalk.dim('QTI Version:')} ${options.qtiVersion}`);\n lines.push(`${chalk.dim('Output Format:')} ${options.outputFormat}`);\n lines.push(`${chalk.dim('Diagnostics:')} ${options.diagnostics}`);\n lines.push(`${chalk.dim('Pretty:')} ${options.pretty}`);\n lines.push(`${chalk.dim('Verbose:')} ${options.verbose}`);\n if (options.organisationId !== undefined) {\n lines.push(`${chalk.dim('Organisation ID:')} ${options.organisationId}`);\n }\n if (options.mediaVault !== undefined) {\n lines.push(`${chalk.dim('Media Vault:')} ${options.mediaVault}`);\n }\n if (options.customAssetUrl !== undefined) {\n lines.push(`${chalk.dim('Custom Asset URL:')} ${options.customAssetUrl}`);\n }\n lines.push(`${chalk.dim('Preserve Asset Filenames:')} ${options.preserveAssetFilenames}`);\n lines.push(`${chalk.dim('Config:')} ${options.configPath ?? 'none'}`);\n\n const box = boxen(lines.join('\\n'), {\n padding: 1,\n margin: { top: 0, bottom: 1, left: 0, right: 0 },\n borderStyle: 'round',\n borderColor: 'blue',\n });\n\n console.log(box);\n\n // If verbose, show source table\n if (options.verbose && withSources) {\n showOptionSources(withSources);\n }\n}\n\n/**\n * Display option sources table (verbose mode)\n */\nfunction showOptionSources(withSources: ResolvedOptionsWithSources): void {\n const table = new Table({\n head: [chalk.bold('Option'), chalk.bold('Value'), chalk.bold('Source')],\n style: {\n head: [],\n border: [],\n },\n });\n\n table.push(\n ['qtiVersion', withSources.qtiVersion.value, formatSource(withSources.qtiVersion.source)],\n [\n 'outputFormat',\n withSources.outputFormat.value,\n formatSource(withSources.outputFormat.source),\n ],\n [\n 'diagnostics',\n withSources.diagnostics.value,\n formatSource(withSources.diagnostics.source),\n ],\n ['verbose', String(withSources.verbose.value), formatSource(withSources.verbose.source)],\n ['pretty', String(withSources.pretty.value), formatSource(withSources.pretty.source)]\n );\n\n // Add organisationId if present\n if (withSources.organisationId) {\n table.push([\n 'organisationId',\n String(withSources.organisationId.value),\n formatSource(withSources.organisationId.source),\n ]);\n }\n\n // Add mediaVault if present\n if (withSources.mediaVault) {\n table.push([\n 'mediaVault',\n String(withSources.mediaVault.value),\n formatSource(withSources.mediaVault.source),\n ]);\n }\n\n // Add customAssetUrl if present\n if (withSources.customAssetUrl) {\n table.push([\n 'customAssetUrl',\n String(withSources.customAssetUrl.value),\n formatSource(withSources.customAssetUrl.source),\n ]);\n }\n\n if (withSources.preserveAssetFilenames) {\n table.push([\n 'preserveAssetFilenames',\n String(withSources.preserveAssetFilenames.value),\n formatSource(withSources.preserveAssetFilenames.source),\n ]);\n }\n\n console.log(chalk.dim('Option Sources:'));\n console.log(table.toString());\n console.log();\n}\n\n/**\n * Format source with color\n */\nfunction formatSource(source: string): string {\n switch (source) {\n case 'cli':\n return chalk.cyan('CLI');\n case 'config':\n return chalk.green('Config');\n case 'default':\n return chalk.dim('Default');\n default:\n return source;\n }\n}\n","const copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\t// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.\n\tif (property === 'arguments' || property === 'caller') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable\n\t\t&& toDescriptor.enumerable === fromDescriptor.enumerable\n\t\t&& toDescriptor.configurable === fromDescriptor.configurable\n\t\t&& (toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tconst {writable, enumerable, configurable} = toStringDescriptor; // We destructue to avoid a potential `get` descriptor.\n\tObject.defineProperty(to, 'toString', {value: newToString, writable, enumerable, configurable});\n};\n\nexport default function mimicFunction(to, from, {ignoreNonConfigurable = false} = {}) {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n}\n","import mimicFunction from 'mimic-function';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = undefined;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n","import process from 'node:process';\nimport onetime from 'onetime';\nimport {onExit} from 'signal-exit';\n\nconst terminal = process.stderr.isTTY\n\t? process.stderr\n\t: (process.stdout.isTTY ? process.stdout : undefined);\n\nconst restoreCursor = terminal ? onetime(() => {\n\tonExit(() => {\n\t\tterminal.write('\\u001B[?25h');\n\t}, {alwaysLast: true});\n}) : () => {};\n\nexport default restoreCursor;\n","import process from 'node:process';\nimport restoreCursor from 'restore-cursor';\n\nlet isHidden = false;\n\nconst cliCursor = {};\n\ncliCursor.show = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\tisHidden = false;\n\twritableStream.write('\\u001B[?25h');\n};\n\ncliCursor.hide = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\trestoreCursor();\n\tisHidden = true;\n\twritableStream.write('\\u001B[?25l');\n};\n\ncliCursor.toggle = (force, writableStream) => {\n\tif (force !== undefined) {\n\t\tisHidden = force;\n\t}\n\n\tif (isHidden) {\n\t\tcliCursor.show(writableStream);\n\t} else {\n\t\tcliCursor.hide(writableStream);\n\t}\n};\n\nexport default cliCursor;\n","","import spinners from './spinners.json' with {type: 'json'};\n\nexport default spinners;\n\nconst spinnersList = Object.keys(spinners);\n\nexport function randomSpinner() {\n\tconst randomIndex = Math.floor(Math.random() * spinnersList.length);\n\tconst spinnerName = spinnersList[randomIndex];\n\treturn spinners[spinnerName];\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);\n// Extended underline styles (`SGR 4:x` sub-parameters).\nexport const underlineDouble = format('4:2', 24);\nexport const underlineCurly = format('4:3', 24);\nexport const underlineDotted = format('4:4', 24);\nexport const underlineDashed = format('4:5', 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\n// Underline color (`SGR 58`/`59`). It has no basic 16-color form, so the palette index is used.\nexport const underlineBlack = format('58;5;0', 59);\nexport const underlineRed = format('58;5;1', 59);\nexport const underlineGreen = format('58;5;2', 59);\nexport const underlineYellow = format('58;5;3', 59);\nexport const underlineBlue = format('58;5;4', 59);\nexport const underlineMagenta = format('58;5;5', 59);\nexport const underlineCyan = format('58;5;6', 59);\nexport const underlineWhite = format('58;5;7', 59);\nexport const underlineGray = format('58;5;8', 59);\n\nexport const underlineRedBright = format('58;5;9', 59);\nexport const underlineGreenBright = format('58;5;10', 59);\nexport const underlineYellowBright = format('58;5;11', 59);\nexport const underlineBlueBright = format('58;5;12', 59);\nexport const underlineMagentaBright = format('58;5;13', 59);\nexport const underlineCyanBright = format('58;5;14', 59);\nexport const underlineWhiteBright = format('58;5;15', 59);\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tconst {env} = process;\n\tconst {TERM, TERM_PROGRAM} = env;\n\n\tif (process.platform !== 'win32') {\n\t\treturn TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| TERM_PROGRAM === 'vscode'\n\t\t|| TERM === 'xterm-256color'\n\t\t|| TERM === 'alacritty'\n\t\t|| TERM === 'rxvt-unicode'\n\t\t|| TERM === 'rxvt-unicode-256color'\n\t\t|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import {\n\tblue,\n\tgreen,\n\tyellow,\n\tred,\n} from 'yoctocolors';\nimport isUnicodeSupported from 'is-unicode-supported';\n\nconst _isUnicodeSupported = isUnicodeSupported();\n\nexport const info = blue(_isUnicodeSupported ? 'ℹ' : 'i');\nexport const success = green(_isUnicodeSupported ? '✔' : '√');\nexport const warning = yellow(_isUnicodeSupported ? '⚠' : '‼');\nexport const error = red(_isUnicodeSupported ? '✖' : '×');\n","export default function isInteractive({stream = process.stdout} = {}) {\n\treturn Boolean(\n\t\tstream && stream.isTTY &&\n\t\tprocess.env.TERM !== 'dumb' &&\n\t\t!('CI' in process.env)\n\t);\n}\n","import process from 'node:process';\n\nconst ASCII_ETX_CODE = 0x03; // Ctrl+C\n\nclass StdinDiscarder {\n\t#activeCount = 0;\n\t#stdin;\n\t#stdinWasPaused = false;\n\t#stdinWasRaw = false;\n\t#handleInputBound = chunk => {\n\t\tif (!chunk?.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst code = typeof chunk === 'string' ? chunk.codePointAt(0) : chunk[0];\n\t\tif (code === ASCII_ETX_CODE) {\n\t\t\t// Always re-signal the process. Emitting `SIGINT` directly breaks normal Ctrl+C termination when libraries install listeners for cleanup.\n\t\t\tprocess.kill(process.pid, 'SIGINT');\n\t\t}\n\t};\n\n\tstart() {\n\t\tthis.#activeCount++;\n\t\tif (this.#activeCount === 1) {\n\t\t\tthis.#realStart();\n\t\t}\n\t}\n\n\tstop() {\n\t\tif (this.#activeCount === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (--this.#activeCount === 0) {\n\t\t\tthis.#realStop();\n\t\t}\n\t}\n\n\t#realStart() {\n\t\tconst {stdin} = process;\n\n\t\tif (process.platform === 'win32' || !stdin?.isTTY || typeof stdin.setRawMode !== 'function') {\n\t\t\tthis.#stdin = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#stdin = stdin;\n\t\tthis.#stdinWasPaused = stdin.isPaused();\n\t\tthis.#stdinWasRaw = Boolean(stdin.isRaw);\n\n\t\tstdin.setRawMode(true);\n\t\tstdin.prependListener('data', this.#handleInputBound);\n\n\t\tif (this.#stdinWasPaused) {\n\t\t\tstdin.resume();\n\t\t}\n\t}\n\n\t#realStop() {\n\t\tif (!this.#stdin) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst stdin = this.#stdin;\n\n\t\tstdin.off('data', this.#handleInputBound);\n\n\t\tif (stdin.isTTY) {\n\t\t\tstdin.setRawMode?.(this.#stdinWasRaw);\n\t\t}\n\n\t\tif (this.#stdinWasPaused) {\n\t\t\tstdin.pause();\n\t\t}\n\n\t\tthis.#stdin = undefined;\n\t\tthis.#stdinWasPaused = false;\n\t\tthis.#stdinWasRaw = false;\n\t}\n}\n\nconst stdinDiscarder = new StdinDiscarder();\n\nexport default Object.freeze(stdinDiscarder);\n","import process from 'node:process';\nimport {stripVTControlCharacters} from 'node:util';\nimport chalk from 'chalk';\nimport cliCursor from 'cli-cursor';\nimport cliSpinners from 'cli-spinners';\nimport logSymbols from 'log-symbols';\nimport stringWidth from 'string-width';\nimport isInteractive from 'is-interactive';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport stdinDiscarder from 'stdin-discarder';\n\n// Constants\n// Rendering waits for a newline when external output leaves its line unfinished.\nconst SYNCHRONIZED_OUTPUT_ENABLE = '\\u{1B}[?2026h';\nconst SYNCHRONIZED_OUTPUT_DISABLE = '\\u{1B}[?2026l';\nconst TRUNCATION_MESSAGE = '... (content truncated to fit terminal)';\nconst STYLE_RESET = '\\u{1B}[0m';\nconst TAB_STOP = 8; // Terminals advance a tab to the next multiple of this\n\n// Grapheme clusters, so that emoji and combining marks are measured the way a terminal measures them\nconst segmenter = new Intl.Segmenter();\n\n// The segmenter joins a carriage return and a line feed into one grapheme, so they are split out first\nconst controlCharacter = /(?<control>[\\t\\n\\r])/v;\n\n// eslint-disable-next-line regexp/no-obscure-range -- the range is exactly printable ASCII\nconst printableAscii = /^[ -~]+$/v;\n\n// The cells a tab covers from the given column, stopping on the last cell of the row\nconst tabStopWidth = (column, columns) => {\n\tconst nextStop = (Math.floor(column / TAB_STOP) * TAB_STOP) + TAB_STOP;\n\treturn Math.max(0, Math.min(nextStop, columns - 1) - column);\n};\n\n/*\nLay out text the way a terminal shows it. Returns its rows, and the text with tabs expanded and escape sequences removed, to lay out again after a resize.\n\nA line feed starts a new row at its start, because a terminal device writes it as a carriage return and a line feed, even in raw mode. A carriage return goes back to the start of the row without erasing it. A row only ends when a grapheme no longer fits.\n*/\nconst layOut = (text, columns) => {\n\tconst rows = [];\n\tlet cells;\n\tlet column;\n\tlet expandedText = '';\n\n\tconst startRow = () => {\n\t\tcells = [];\n\t\tcolumn = 0;\n\t\trows.push(cells);\n\t};\n\n\tconst writeGrapheme = (grapheme, width) => {\n\t\t// A grapheme without width, such as a bell, takes no cell\n\t\tif (width === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (column + width > columns) {\n\t\t\tstartRow();\n\t\t}\n\n\t\t// A wide grapheme also covers the cells after it\n\t\tcells[column++] = grapheme;\n\t\tfor (let index = 1; index < width; index++) {\n\t\t\tcells[column++] = '';\n\t\t}\n\t};\n\n\t// A tab moves the cursor without erasing what it passes over\n\tconst writeTab = () => {\n\t\tconst end = column + tabStopWidth(column, columns);\n\t\texpandedText += ' '.repeat(end - column);\n\t\tfor (; column < end; column++) {\n\t\t\tcells[column] ??= ' ';\n\t\t}\n\t};\n\n\tstartRow();\n\n\tfor (const part of stripVTControlCharacters(text).split(controlCharacter)) {\n\t\tif (part === '\\t') {\n\t\t\twriteTab();\n\t\t\tcontinue;\n\t\t}\n\n\t\texpandedText += part;\n\n\t\tif (part === '\\n') {\n\t\t\tstartRow();\n\t\t} else if (part === '\\r') {\n\t\t\tcolumn = 0;\n\t\t} else if (printableAscii.test(part)) {\n\t\t\t// Printable ASCII is one cell per character, so it skips the segmenter\n\t\t\tfor (const character of part) {\n\t\t\t\twriteGrapheme(character, 1);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const {segment} of segmenter.segment(part)) {\n\t\t\t\twriteGrapheme(segment, stringWidth(segment));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {rows, expandedText};\n};\n\nconst rowCount = (text, columns) => layOut(text, columns).rows.length;\n\nconst formatAffix = (value, separator, isPlaceBefore) => {\n\tconst resolved = typeof value === 'function' ? value() : value;\n\tif (typeof resolved === 'string' && resolved !== '') {\n\t\treturn isPlaceBefore ? (separator + resolved) : (resolved + separator);\n\t}\n\n\treturn '';\n};\n\n// Global state for concurrent spinner detection\nconst activeHooksPerStream = new Map(); // Stream → ora instance\nconst originalWritesPerStream = new Map(); // Stream → the real `write` before any spinner hooked it\n\nconst validColors = new Set(['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'gray']);\n\nclass Ora {\n\t#linesToClear = 0;\n\t#frameIndex = -1;\n\t#lastFrameTime = 0;\n\t#renderedFrame;\n\t#renderedColumns;\n\t#options;\n\t#spinner;\n\t#stream;\n\t#id;\n\t#hookedStreams = new Set();\n\t#isInternalWrite = false;\n\t#drainHandler;\n\t#hasUnfinishedLine = false;\n\t#isDiscardingStdin = false;\n\t#color;\n\n\tconstructor(options) {\n\t\tif (typeof options === 'string') {\n\t\t\toptions = {\n\t\t\t\ttext: options,\n\t\t\t};\n\t\t}\n\n\t\tthis.#options = {\n\t\t\tcolor: 'cyan',\n\t\t\tstream: process.stderr,\n\t\t\tdiscardStdin: true,\n\t\t\thideCursor: true,\n\t\t\t...options,\n\t\t};\n\n\t\t// Public\n\t\tthis.color = this.#options.color;\n\n\t\t// Spreading options over the defaults can set `stream` to `undefined`\n\t\tthis.#stream = this.#options.stream ?? process.stderr;\n\n\t\t// Normalize isEnabled and isSilent into options\n\t\tif (typeof this.#options.isEnabled !== 'boolean') {\n\t\t\tthis.#options.isEnabled = isInteractive({stream: this.#stream});\n\t\t}\n\n\t\tif (typeof this.#options.isSilent !== 'boolean') {\n\t\t\tthis.#options.isSilent = false;\n\t\t}\n\n\t\tif (this.#options.interval !== undefined && !(Number.isSafeInteger(this.#options.interval) && this.#options.interval > 0)) {\n\t\t\tthrow new Error('The `interval` option must be a positive integer');\n\t\t}\n\n\t\t// Set *after* `this.#stream`.\n\t\t// Store original interval before spinner setter clears it\n\t\tconst userInterval = this.#options.interval;\n\t\t// It's important that these use the public setters.\n\t\tthis.spinner = this.#options.spinner;\n\t\tthis.#options.interval = userInterval;\n\t\tthis.text = this.#options.text;\n\t\tthis.prefixText = this.#options.prefixText;\n\t\tthis.suffixText = this.#options.suffixText;\n\t\tthis.indent = this.#options.indent;\n\n\t\tif (process.env.NODE_ENV !== 'test') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._stream = this.#stream;\n\t\tthis._isEnabled = this.#options.isEnabled;\n\n\t\tObject.defineProperties(this, {\n\t\t\t_linesToClear: {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#linesToClear;\n\t\t\t\t},\n\t\t\t\tset(newValue) {\n\t\t\t\t\tthis.#linesToClear = newValue;\n\t\t\t\t},\n\t\t\t},\n\t\t\t_frameIndex: {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#frameIndex;\n\t\t\t\t},\n\t\t\t},\n\t\t\t_renderedFrame: {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#renderedFrame;\n\t\t\t\t},\n\t\t\t},\n\t\t\t_renderedColumns: {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#renderedColumns;\n\t\t\t\t},\n\t\t\t},\n\t\t\t_lineCount: {\n\t\t\t\tget() {\n\t\t\t\t\t// The line `frame()` builds, without calling a function affix, so reading this has no side effect\n\t\t\t\t\tconst {prefixText, suffixText} = this.#options;\n\t\t\t\t\tconst line = this.#buildOutputLine(\n\t\t\t\t\t\t'-',\n\t\t\t\t\t\tthis.#options.text,\n\t\t\t\t\t\ttypeof prefixText === 'function' ? '' : prefixText,\n\t\t\t\t\t\ttypeof suffixText === 'function' ? '' : suffixText,\n\t\t\t\t\t);\n\t\t\t\t\tconst fullText = ' '.repeat(this.#options.indent) + line;\n\t\t\t\t\treturn rowCount(fullText, this.#columns);\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n\n\t// Helper to execute writes while preventing hook recursion\n\t#internalWrite(fn) {\n\t\tthis.#isInternalWrite = true;\n\t\ttry {\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tthis.#isInternalWrite = false;\n\t\t}\n\t}\n\n\t/*\n\tHelper to render if still spinning. A timer or drain render has no caller to handle an error, such as a throwing `prefixText` function or a broken stream, and the render after an external write must not throw at the program's own write, so the spinner stops itself instead. The frame stays counted for `stop()` to erase.\n\t*/\n\t#tryRender() {\n\t\tif (!this.isSpinning) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis.render();\n\t\t} catch {\n\t\t\tthis.#release();\n\t\t\tthis.#showCursor();\n\t\t}\n\t}\n\n\t// The stream may be what failed, so showing the cursor is best effort\n\t#showCursor() {\n\t\tif (!this.#options.hideCursor) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tcliCursor.show(this.#stream);\n\t\t} catch {}\n\t}\n\n\t#stringifyChunk(chunk, encoding) {\n\t\tif (chunk === undefined || chunk === null) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (typeof chunk === 'string') {\n\t\t\treturn chunk;\n\t\t}\n\n\t\t/* eslint-disable n/prefer-global/buffer -- the global Buffer is the class the stream hands over */\n\t\tif (Buffer.isBuffer(chunk) || ArrayBuffer.isView(chunk)) {\n\t\t\tconst normalizedEncoding = (typeof encoding === 'string' && encoding && encoding !== 'buffer') ? encoding : 'utf8';\n\t\t\treturn Buffer.from(chunk).toString(normalizedEncoding);\n\t\t}\n\t\t/* eslint-enable n/prefer-global/buffer -- see above */\n\n\t\treturn String(chunk);\n\t}\n\n\t// Deferral lasts until a newline, without a timeout; unfinished lines are neither erased nor retained for replay.\n\t// Give back the timer, the stream hooks and stdin, without writing to the stream, which may have failed\n\t#release() {\n\t\tclearInterval(this.#id);\n\t\tthis.#id = undefined;\n\t\tthis.#frameIndex = -1;\n\t\tthis.#lastFrameTime = 0;\n\n\t\tthis.#uninstallHook();\n\n\t\t// Clean up drain handler if it exists\n\t\tif (this.#drainHandler) {\n\t\t\tthis.#stream.removeListener('drain', this.#drainHandler);\n\t\t\tthis.#drainHandler = undefined;\n\t\t}\n\n\t\t// The unfinished-line state belongs to this run, so a later run starts fresh\n\t\tthis.#hasUnfinishedLine = false;\n\n\t\tif (!this.#isDiscardingStdin) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#isDiscardingStdin = false;\n\t\tstdinDiscarder.stop();\n\t}\n\n\t// Helper to build complete line with symbol, text, prefix, and suffix\n\t#buildOutputLine(symbol, text, prefixText, suffixText) {\n\t\t// Each part is only separated from what comes before it when there is something there, so nothing leaves a double space\n\t\tconst hasSymbol = symbol !== '';\n\t\tconst hasText = typeof text === 'string' && text !== '';\n\t\tconst fullPrefixText = formatAffix(prefixText, (hasSymbol || hasText) ? ' ' : '', false);\n\t\tconst separatorText = hasSymbol ? ' ' : '';\n\t\tconst fullText = (typeof text === 'string') ? separatorText + text : '';\n\t\t// An empty text still gets the separator after the symbol, so the suffix does not add another\n\t\tconst doesBodyEndWithSeparator = hasSymbol && text === '';\n\t\tconst fullSuffixText = formatAffix(suffixText, doesBodyEndWithSeparator ? '' : ' ', true);\n\t\treturn fullPrefixText + symbol + fullText + fullSuffixText;\n\t}\n\n\t#startRenderTimer() {\n\t\tclearInterval(this.#id);\n\t\tthis.#id = setInterval(this.#tryRender.bind(this), this.interval);\n\t}\n\n\t// A terminal can report `0` columns, for example while its window is minimized, which would put every character on a row of its own\n\tget #columns() {\n\t\treturn this.#stream.columns || 80;\n\t}\n\n\tget #canMoveCursor() {\n\t\treturn Boolean(this.#stream.isTTY)\n\t\t\t&& typeof this.#stream.cursorTo === 'function'\n\t\t\t&& typeof this.#stream.moveCursor === 'function'\n\t\t\t&& typeof this.#stream.clearLine === 'function';\n\t}\n\n\t// Erase the frame that is currently on screen, if the stream can move the cursor\n\t#clearDisplay() {\n\t\tif (!this.#canMoveCursor || this.#linesToClear === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Reflow varies by terminal, so resizing must never increase the recorded erase count and risk clearing preceding output\n\t\tconst columns = this.#columns;\n\t\tif (this.#renderedFrame !== undefined && this.#renderedColumns !== columns) {\n\t\t\tthis.#linesToClear = Math.min(this.#linesToClear, rowCount(this.#renderedFrame, columns));\n\t\t}\n\n\t\t// Protect cursor control methods (cursorTo, moveCursor, clearLine) which internally call stream.write\n\t\ttry {\n\t\t\tthis.#eraseRows(this.#linesToClear);\n\t\t} finally {\n\t\t\t// Forget the frame even if the erase failed, so a later call does not retry the same rows\n\t\t\tthis.#linesToClear = 0;\n\t\t\tthis.#renderedFrame = undefined;\n\t\t}\n\t}\n\n\t// Erase the given number of rows, ending on the row the cursor is on\n\t#eraseRows(count) {\n\t\tthis.#internalWrite(() => {\n\t\t\tthis.#stream.cursorTo(0);\n\n\t\t\tfor (let index = 0; index < count; index++) {\n\t\t\t\tif (index > 0) {\n\t\t\t\t\tthis.#stream.moveCursor(0, -1);\n\t\t\t\t}\n\n\t\t\t\tthis.#stream.clearLine(1);\n\t\t\t}\n\t\t});\n\t}\n\n\t// Helper to hook a single stream\n\t#hookStream(stream) {\n\t\tif (!stream || this.#hookedStreams.has(stream) || !stream.isTTY || typeof stream.write !== 'function') {\n\t\t\treturn;\n\t\t}\n\n\t\t// Detect concurrent spinners\n\t\tif (activeHooksPerStream.has(stream)) {\n\t\t\tconsole.warn('[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.');\n\t\t}\n\n\t\t// Concurrent spinners are unsupported, but the real `write` is restored whichever one stops last\n\t\tif (!originalWritesPerStream.has(stream)) {\n\t\t\toriginalWritesPerStream.set(stream, stream.write);\n\t\t}\n\n\t\tconst originalWrite = stream.write;\n\t\tthis.#hookedStreams.add(stream);\n\t\tactiveHooksPerStream.set(stream, this);\n\t\tstream.write = (chunk, encoding, callback) => this.#hookedWrite(stream, originalWrite, chunk, encoding, callback);\n\t}\n\n\t/**\n\tIntercept stream writes while spinner is active to handle external writes cleanly without visual corruption.\n\tHooks process stdio streams and the active spinner stream so console.log(), console.error(), and direct writes stay tidy.\n\t*/\n\t#installHook() {\n\t\tif (!this.isEnabled || this.#hookedStreams.size > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst streamsToHook = new Set([this.#stream, process.stdout, process.stderr]);\n\n\t\tfor (const stream of streamsToHook) {\n\t\t\tthis.#hookStream(stream);\n\t\t}\n\t}\n\n\t#uninstallHook() {\n\t\tfor (const stream of this.#hookedStreams) {\n\t\t\tif (activeHooksPerStream.get(stream) === this) {\n\t\t\t\tactiveHooksPerStream.delete(stream);\n\t\t\t}\n\n\t\t\t// Another spinner may still be running, in which case its hook has to stay in place\n\t\t\tif (activeHooksPerStream.has(stream)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst originalWrite = originalWritesPerStream.get(stream);\n\t\t\tif (originalWrite === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tstream.write = originalWrite;\n\t\t\toriginalWritesPerStream.delete(stream);\n\t\t}\n\n\t\tthis.#hookedStreams.clear();\n\t}\n\n\t// eslint-disable-next-line max-params -- Need stream and originalWrite for multi-stream support\n\t#hookedWrite(stream, originalWrite, chunk, encoding, callback) {\n\t\t// Handle both write(chunk, encoding, callback) and write(chunk, callback) signatures\n\t\tif (typeof encoding === 'function') {\n\t\t\tcallback = encoding;\n\t\t\tencoding = undefined;\n\t\t}\n\n\t\t// Pass through our own internal writes (spinner rendering, cursor control)\n\t\tif (this.#isInternalWrite) {\n\t\t\treturn originalWrite.call(stream, chunk, encoding, callback);\n\t\t}\n\n\t\t// External write detected - erase the frame, write content, re-render if appropriate\n\t\tthis.#clearDisplay();\n\n\t\t// Ignore styling codes when checking for a completed line; a carriage return does not finish it\n\t\t// Decode only to detect the newline. Replaying decoded chunks would corrupt UTF-8 characters split across buffer writes.\n\t\tconst chunkString = stripVTControlCharacters(this.#stringifyChunk(chunk, encoding));\n\t\tif (chunkString !== '') {\n\t\t\tthis.#hasUnfinishedLine = !chunkString.endsWith('\\n');\n\t\t}\n\n\t\tconst writeResult = originalWrite.call(stream, chunk, encoding, callback);\n\n\t\t// Re-render below completed output if still spinning. The write already went through, so a failed render stops the spinner instead of throwing at the program's own write.\n\t\tthis.#tryRender();\n\n\t\treturn writeResult;\n\t}\n\n\tget indent() {\n\t\treturn this.#options.indent;\n\t}\n\n\tset indent(indent = 0) {\n\t\tif (!(indent >= 0 && Number.isSafeInteger(indent))) {\n\t\t\tthrow new Error('The `indent` option must be an integer from 0 and up');\n\t\t}\n\n\t\tthis.#options.indent = indent;\n\t}\n\n\tget interval() {\n\t\treturn this.#options.interval ?? this.#spinner.interval ?? 100;\n\t}\n\n\tget spinner() {\n\t\treturn this.#spinner;\n\t}\n\n\tset spinner(spinner) {\n\t\t// `typeof null === 'object'`, so it has to be excluded here to reach the built-in name check\n\t\tif (typeof spinner === 'object' && spinner !== null) {\n\t\t\tif (!Array.isArray(spinner.frames) || spinner.frames.length === 0 || spinner.frames.some(frame => typeof frame !== 'string')) {\n\t\t\t\tthrow new Error('The given spinner must have a non-empty `frames` array of strings');\n\t\t\t}\n\n\t\t\tif (spinner.interval !== undefined && !(Number.isSafeInteger(spinner.interval) && spinner.interval > 0)) {\n\t\t\t\tthrow new Error('`spinner.interval` must be a positive integer if provided');\n\t\t\t}\n\n\t\t\tthis.#spinner = spinner;\n\t\t} else if (spinner !== undefined && (spinner === 'default' || !Object.hasOwn(cliSpinners, spinner))) {\n\t\t\t// The name is checked before the terminal is, so a wrong name throws on every terminal\n\t\t\tthrow new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);\n\t\t} else if (isUnicodeSupported()) {\n\t\t\t// Set the named spinner, or the default one\n\t\t\tthis.#spinner = cliSpinners[spinner ?? 'dots'];\n\t\t} else {\n\t\t\tthis.#spinner = cliSpinners.line;\n\t\t}\n\n\t\t// Only touch the state once the new spinner is known to be valid\n\t\tthis.#frameIndex = -1;\n\t\tthis.#options.interval = undefined;\n\n\t\t// The render interval comes from the spinner, so the timer has to pick up the new one\n\t\tif (!this.isSpinning) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#startRenderTimer();\n\t\t// The new interval can be long, so don't wait for the first tick to show it\n\t\tthis.render();\n\t}\n\n\tget text() {\n\t\treturn this.#options.text;\n\t}\n\n\tset text(value = '') {\n\t\tthis.#options.text = value;\n\t}\n\n\tget prefixText() {\n\t\treturn this.#options.prefixText;\n\t}\n\n\tset prefixText(value = '') {\n\t\tthis.#options.prefixText = value;\n\t}\n\n\tget suffixText() {\n\t\treturn this.#options.suffixText;\n\t}\n\n\tset suffixText(value = '') {\n\t\tthis.#options.suffixText = value;\n\t}\n\n\tget isSpinning() {\n\t\treturn this.#id !== undefined;\n\t}\n\n\tget color() {\n\t\treturn this.#color;\n\t}\n\n\tset color(value) {\n\t\tif (value !== undefined && value !== false && !validColors.has(value)) {\n\t\t\tthrow new Error('The `color` option must be a valid color or `false` to disable');\n\t\t}\n\n\t\tthis.#color = value;\n\t}\n\n\tget isEnabled() {\n\t\treturn this.#options.isEnabled && !this.#options.isSilent;\n\t}\n\n\tset isEnabled(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isEnabled` option must be a boolean');\n\t\t}\n\n\t\tthis.#options.isEnabled = value;\n\t}\n\n\tget isSilent() {\n\t\treturn this.#options.isSilent;\n\t}\n\n\tset isSilent(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isSilent` option must be a boolean');\n\t\t}\n\n\t\tthis.#options.isSilent = value;\n\t}\n\n\tframe() {\n\t\t// Only advance frame if enough time has passed (throttle to interval)\n\t\tconst now = Date.now();\n\t\tif (this.#frameIndex === -1 || now - this.#lastFrameTime >= this.interval) {\n\t\t\tthis.#frameIndex = (this.#frameIndex + 1) % this.#spinner.frames.length;\n\t\t\tthis.#lastFrameTime = now;\n\t\t}\n\n\t\tconst {frames} = this.#spinner;\n\t\tlet frame = frames[this.#frameIndex];\n\n\t\tif (this.#color) {\n\t\t\tframe = chalk[this.#color](frame);\n\t\t}\n\n\t\tconst line = this.#buildOutputLine(frame, this.text, this.#options.prefixText, this.#options.suffixText);\n\n\t\treturn ' '.repeat(this.#options.indent) + line;\n\t}\n\n\tclear() {\n\t\tif (!this.isEnabled) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.#clearDisplay();\n\n\t\treturn this;\n\t}\n\n\t/*\n\tA stream without the readline cursor methods, such as a CI log stream that reports a TTY, gets the frame written where the cursor is. External writes are only kept out of the frame while the spinner runs, since that is when the streams are hooked.\n\t*/\n\trender() {\n\t\t// Leave unfinished external output untouched until a newline, including after a resize\n\t\t// Do not add a timeout or reclaim the line: resized rows cannot be counted reliably, and replay would duplicate rows already in scrollback.\n\t\tif (!this.isEnabled || this.#drainHandler || this.#hasUnfinishedLine) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Build the frame before writing anything, so a throwing `prefixText` or `suffixText` function leaves the screen as it was\n\t\tlet frameContent = this.frame();\n\t\tconst useSynchronizedOutput = this.#stream.isTTY;\n\t\tlet shouldDisableSynchronizedOutput = false;\n\n\t\ttry {\n\t\t\tif (useSynchronizedOutput) {\n\t\t\t\tthis.#internalWrite(() => this.#stream.write(SYNCHRONIZED_OUTPUT_ENABLE));\n\t\t\t\tshouldDisableSynchronizedOutput = true;\n\t\t\t}\n\n\t\t\t// Erasing the previous frame leaves the cursor at the start of a row, otherwise it is moved there\n\t\t\tif (this.#linesToClear > 0) {\n\t\t\t\tthis.#clearDisplay();\n\t\t\t} else if (this.#canMoveCursor) {\n\t\t\t\tthis.#internalWrite(() => this.#stream.cursorTo(0));\n\t\t\t}\n\n\t\t\tconst columns = this.#columns;\n\t\t\tlet layout = layOut(frameContent, columns);\n\n\t\t\t// If content would exceed viewport height, truncate it to prevent garbage\n\t\t\t/*\n\t\t\tThe frame stays above the last row, because a frame that scrolls cannot be erased. A terminal cannot report its cursor row, so this bounds the frame by the screen, and earlier output can still scroll into the scrollback.\n\t\t\t*/\n\t\t\tconst maxRows = this.#stream.rows > 1 ? this.#stream.rows - 1 : undefined;\n\t\t\tif (layout.rows.length > maxRows) {\n\t\t\t\t// The message replaces the last rows, and is shortened until it fits\n\t\t\t\tlet message = TRUNCATION_MESSAGE;\n\t\t\t\twhile (message.length > 1 && rowCount(message, columns) > maxRows) {\n\t\t\t\t\tmessage = message.slice(0, -1);\n\t\t\t\t}\n\n\t\t\t\t// Whole lines are kept as they are, so they keep their colors. The line that does not fit is cut to the rows that are left, and that part is plain.\n\t\t\t\tlet rowBudget = maxRows - rowCount(message, columns);\n\t\t\t\tconst keptLines = [];\n\t\t\t\tfor (const line of frameContent.split('\\n')) {\n\t\t\t\t\tconst lineRows = layOut(line, columns).rows;\n\t\t\t\t\tif (lineRows.length > rowBudget) {\n\t\t\t\t\t\tkeptLines.push(...lineRows.slice(0, rowBudget).map(cells => cells.join('')));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tkeptLines.push(line);\n\t\t\t\t\trowBudget -= lineRows.length;\n\t\t\t\t}\n\n\t\t\t\t// A style that a dropped line would have closed must not color the message\n\t\t\t\tframeContent = [...keptLines, STYLE_RESET + message].join('\\n');\n\t\t\t\tlayout = layOut(frameContent, columns);\n\t\t\t}\n\n\t\t\tconst canContinue = this.#internalWrite(() => this.#stream.write(frameContent));\n\n\t\t\t// Handle backpressure - pause rendering if stream buffer is full\n\t\t\tif (canContinue === false && this.#stream.isTTY) {\n\t\t\t\tthis.#drainHandler = () => {\n\t\t\t\t\tthis.#drainHandler = undefined;\n\t\t\t\t\tthis.#tryRender();\n\t\t\t\t};\n\n\t\t\t\tthis.#stream.once('drain', this.#drainHandler);\n\t\t\t}\n\n\t\t\tthis.#linesToClear = layout.rows.length;\n\t\t\tthis.#renderedFrame = layout.expandedText;\n\t\t\tthis.#renderedColumns = columns;\n\t\t} finally {\n\t\t\tif (shouldDisableSynchronizedOutput) {\n\t\t\t\tthis.#internalWrite(() => this.#stream.write(SYNCHRONIZED_OUTPUT_DISABLE));\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tstart(text) {\n\t\tif (text !== undefined) {\n\t\t\tthis.text = text;\n\t\t}\n\n\t\t// A call while spinning or silent only updates the text, even if output was disabled while spinning\n\t\tif (this.isSpinning || this.isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!this.isEnabled) {\n\t\t\tconst symbol = this.text ? '-' : '';\n\t\t\tconst line = ' '.repeat(this.#options.indent) + this.#buildOutputLine(symbol, this.text, this.#options.prefixText, this.#options.suffixText);\n\n\t\t\tif (line.trim() !== '') {\n\t\t\t\tthis.#internalWrite(() => this.#stream.write(line + '\\n'));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.#options.hideCursor) {\n\t\t\tcliCursor.hide(this.#stream);\n\t\t}\n\n\t\tif (this.#options.discardStdin && process.stdin.isTTY) {\n\t\t\tstdinDiscarder.start();\n\t\t\tthis.#isDiscardingStdin = true;\n\t\t}\n\n\t\tthis.#installHook();\n\n\t\ttry {\n\t\t\tthis.render();\n\t\t} catch (error) {\n\t\t\t// Undo the hooks, stdin and the hidden cursor before the error reaches the caller\n\t\t\tthis.#release();\n\t\t\tthis.#showCursor();\n\t\t\tthrow error;\n\t\t}\n\n\t\tthis.#startRenderTimer();\n\n\t\treturn this;\n\t}\n\n\tstop() {\n\t\t// Use the state from `start()`, as `isEnabled` and `isSilent` can change while spinning\n\t\tconst wasSpinning = this.isSpinning;\n\n\t\tthis.#release();\n\n\t\t// Erase the frame as best effort since the stream may have failed\n\t\ttry {\n\t\t\tthis.#clearDisplay();\n\t\t} catch {}\n\n\t\tif (wasSpinning) {\n\t\t\tthis.#showCursor();\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsucceed(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.success, text});\n\t}\n\n\tfail(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.error, text});\n\t}\n\n\twarn(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.warning, text});\n\t}\n\n\tinfo(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.info, text});\n\t}\n\n\tstopAndPersist(options) {\n\t\t// Start on a new row instead of continuing an unfinished external line\n\t\tconst hasUnfinishedLine = this.#hasUnfinishedLine;\n\t\tthis.stop();\n\n\t\tif (this.isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// `options` is optional, so `null` has to behave like `undefined`\n\t\tconst symbolText = String(options?.symbol ?? ' ');\n\t\t// The `log-symbols` colors are resolved for stdout, so they are stripped when this stream cannot render color\n\t\tconst renderedSymbol = (this.isEnabled && this.#stream.isTTY) ? symbolText : stripVTControlCharacters(symbolText);\n\t\tconst text = options?.text ?? this.text;\n\t\tconst prefixText = options?.prefixText ?? this.#options.prefixText;\n\t\tconst suffixText = options?.suffixText ?? this.#options.suffixText;\n\n\t\t// The indent is part of the content, so the cursor is left at the start of the line\n\t\tconst textToWrite = (hasUnfinishedLine ? '\\n' : '') + ' '.repeat(this.#options.indent) + this.#buildOutputLine(renderedSymbol, text, prefixText, suffixText) + '\\n';\n\n\t\tthis.#internalWrite(() => this.#stream.write(textToWrite));\n\n\t\treturn this;\n\t}\n}\n\nexport default function ora(options) {\n\treturn new Ora(options);\n}\n\nexport async function oraPromise(action, options) {\n\tconst isActionFunction = typeof action === 'function';\n\tconst isActionPromise = typeof action?.then === 'function';\n\n\tif (!isActionFunction && !isActionPromise) {\n\t\tthrow new TypeError('Parameter `action` must be a Function or a Promise');\n\t}\n\n\tconst {\n\t\tsuccessText,\n\t\tfailText,\n\t\tsuccessSymbol,\n\t\tfailSymbol,\n\t} = options ?? {};\n\n\tconst spinner = ora(options).start();\n\tconst resolveText = (value, argument) => typeof value === 'function' ? value(argument) : value;\n\n\tlet result;\n\ttry {\n\t\tresult = await (isActionFunction ? action(spinner) : action);\n\t} catch (error) {\n\t\tlet text;\n\t\ttry {\n\t\t\ttext = resolveText(failText, error);\n\t\t} catch {\n\t\t\t// The original error is more useful to the caller than the one from `failText`\n\t\t}\n\n\t\ttry {\n\t\t\tspinner.stopAndPersist({symbol: failSymbol ?? logSymbols.error, text});\n\t\t} catch {\n\t\t\t// The original error is more useful to the caller than a stream error from the persist\n\t\t}\n\n\t\tthrow error;\n\t}\n\n\t// Resolve `successText` outside the `try` above, so that a throw is not reported as a failure\n\tlet text;\n\ttry {\n\t\ttext = resolveText(successText, result);\n\t} catch (error) {\n\t\tspinner.stop();\n\t\tthrow error;\n\t}\n\n\ttry {\n\t\tspinner.stopAndPersist({symbol: successSymbol ?? logSymbols.success, text});\n\t} catch {\n\t\t// The action already succeeded, so a stream error from the persist must not discard the result\n\t}\n\n\treturn result;\n}\n\nexport {default as spinners} from 'cli-spinners';\n","import ora, { Ora } from 'ora';\nimport chalk from 'chalk';\n\n/**\n * Progress tracker for conversion stages\n */\nexport class ProgressTracker {\n private spinner: Ora | null = null;\n private startTime = 0;\n private verbose: boolean;\n\n constructor(verbose: boolean) {\n this.verbose = verbose;\n }\n\n /**\n * Start a new stage\n */\n startStage(message: string): void {\n this.startTime = Date.now();\n this.spinner = ora(message).start();\n }\n\n /**\n * Update the current stage message\n */\n updateStage(message: string): void {\n if (this.spinner) {\n this.spinner.text = message;\n }\n }\n\n /**\n * Complete the current stage successfully\n */\n succeedStage(message?: string): void {\n if (this.spinner) {\n const elapsed = this.getElapsed();\n const suffix = this.verbose ? chalk.dim(` (${elapsed})`) : '';\n\n this.spinner.succeed((message ?? this.spinner.text) + suffix);\n this.spinner = null;\n }\n }\n\n /**\n * Fail the current stage\n */\n failStage(message?: string): void {\n if (this.spinner) {\n this.spinner.fail(message);\n this.spinner = null;\n }\n }\n\n /**\n * Get elapsed time since stage start\n */\n private getElapsed(): string {\n const elapsed = Date.now() - this.startTime;\n\n if (elapsed < 1000) {\n return `${elapsed}ms`;\n }\n\n return `${(elapsed / 1000).toFixed(2)}s`;\n }\n\n /**\n * Clear the spinner without marking success/failure\n */\n clear(): void {\n if (this.spinner) {\n this.spinner.stop();\n this.spinner = null;\n }\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { input, select } from '@inquirer/prompts';\nimport type {\n QtiVersion,\n OutputFormat,\n DiagnosticsOutput,\n Diagnostic,\n} from '@learnosity/converter-core';\nimport type {\n CliOptions,\n ConfigOptions,\n ResolvedOptions,\n ResolvedOptionsWithSources,\n ResolvedOptionWithSource,\n} from './types.js';\nimport { expandTilde } from '../utils/pathUtils.js';\n\n/**\n * Resolve a single option with precedence and source tracking\n */\nfunction resolveOption<T>(\n cliValue: T | undefined,\n configValue: T | undefined,\n defaultValue: T\n): ResolvedOptionWithSource<T> {\n if (cliValue !== undefined) {\n return { value: cliValue, source: 'cli' };\n }\n if (configValue !== undefined) {\n return { value: configValue, source: 'config' };\n }\n\n return { value: defaultValue, source: 'default' };\n}\n\n/**\n * Resolve all options with precedence: CLI > config > defaults\n */\nexport async function resolveOptions(\n cliOpts: CliOptions,\n config: ConfigOptions | null,\n isPackageCommand: boolean,\n configPath: string | null\n): Promise<{\n options: ResolvedOptions;\n diagnostics: Diagnostic[];\n withSources: ResolvedOptionsWithSources;\n}> {\n const diagnostics: Diagnostic[] = [];\n const interactive = cliOpts.interactive ?? false;\n\n // Input path\n let inputPath = cliOpts.in;\n\n if (!inputPath && interactive) {\n inputPath = await input({\n message: 'Input path (or \"-\" for stdin):',\n default: '-',\n });\n }\n if (!inputPath) {\n throw new Error('Input path is required. Use --in <path> or --interactive.');\n }\n // Expand tilde to home directory (skip for stdin)\n if (inputPath !== '-') {\n inputPath = expandTilde(inputPath);\n }\n\n // Output path\n let outputPath = cliOpts.out;\n\n if (!outputPath && interactive) {\n const defaultOut = config?.output ?? '-';\n\n outputPath = await input({\n message: 'Output path (or \"-\" for stdout):',\n default: defaultOut,\n });\n }\n if (!outputPath) {\n throw new Error('Output path is required. Use --out <path> or --interactive.');\n }\n // Expand tilde to home directory (skip for stdout)\n if (outputPath !== '-') {\n outputPath = expandTilde(outputPath);\n }\n\n // QTI version\n const qtiVersionResolved = resolveOption<QtiVersion>(\n cliOpts.qtiVersion,\n config?.qtiVersion,\n '2.2'\n );\n let qtiVersion = qtiVersionResolved.value;\n\n if (interactive && !cliOpts.qtiVersion && !config?.qtiVersion) {\n qtiVersion = (await select({\n message: 'QTI version:',\n choices: [\n { value: '2.2', name: '2.2 (default)' },\n { value: '2.1', name: '2.1' },\n ],\n default: '2.2',\n })) as QtiVersion;\n qtiVersionResolved.value = qtiVersion;\n qtiVersionResolved.source = 'cli';\n }\n\n // Verbose\n const verboseResolved = resolveOption(cliOpts.verbose, config?.verbose, false);\n\n // Pretty\n const prettyResolved = resolveOption(cliOpts.pretty, config?.pretty, false);\n\n // Organisation ID (TASK 030) - check both aliases\n // Note: Commander.js does NOT convert underscores to camelCase, so we need to check both\n let cliOrgId = (cliOpts as any).organisation_id ?? (cliOpts as any).org_id;\n\n // Interactive prompt for organisation ID\n if (interactive && !cliOrgId && !config?.organisationId) {\n const orgIdInput = await input({\n message: 'Organisation ID (optional, for Learnosity CDN asset URLs):',\n default: '',\n });\n\n if (orgIdInput && orgIdInput.trim() !== '') {\n const parsed = parseInt(orgIdInput.trim(), 10);\n\n if (!isNaN(parsed)) {\n cliOrgId = parsed;\n }\n }\n }\n\n const organisationId = cliOrgId ?? config?.organisationId;\n const organisationIdSource =\n cliOrgId !== undefined\n ? 'cli'\n : config?.organisationId !== undefined\n ? 'config'\n : undefined;\n\n // Output format (with derived defaults)\n let outputFormatDefault: OutputFormat;\n\n if (outputPath === '-') {\n outputFormatDefault = 'stdout';\n } else {\n outputFormatDefault = isPackageCommand ? 'zip' : 'dir';\n }\n\n const outputFormatResolved = resolveOption<OutputFormat>(\n cliOpts.outputFormat,\n config?.outputFormat,\n outputFormatDefault\n );\n\n // Diagnostics (with derived defaults)\n let diagnosticsDefault: DiagnosticsOutput;\n\n if (outputPath === '-') {\n diagnosticsDefault = 'stderr';\n } else {\n diagnosticsDefault = 'file';\n }\n\n // Handle --diagnostics option: can be a mode OR a file path\n let cliDiagnostics: DiagnosticsOutput | undefined;\n let diagnosticsPath: string | undefined;\n\n if (\n cliOpts.diagnostics === 'stderr' ||\n cliOpts.diagnostics === 'file' ||\n cliOpts.diagnostics === 'both' ||\n cliOpts.diagnostics === 'none'\n ) {\n cliDiagnostics = cliOpts.diagnostics as DiagnosticsOutput;\n } else if (cliOpts.diagnostics) {\n // It's a file path, so use 'file' mode and store the path\n cliDiagnostics = 'file';\n diagnosticsPath = cliOpts.diagnostics;\n }\n\n const diagnosticsResolved = resolveOption<DiagnosticsOutput>(\n cliDiagnostics,\n config?.diagnostics,\n diagnosticsDefault\n );\n\n // Media vault option\n // Note: Commander.js keeps the flag name as-is, so --mediavault becomes mediavault, not mediaVault\n const cliMediaVault = (cliOpts as any).mediavault;\n const mediaVault = cliMediaVault ?? config?.mediaVault ?? false;\n const mediaVaultSource =\n cliMediaVault !== undefined\n ? 'cli'\n : config?.mediaVault !== undefined\n ? 'config'\n : 'default';\n\n // Custom asset URL option\n const cliCustomAssetUrl = (cliOpts as any).customAssetUrl;\n const customAssetUrl = cliCustomAssetUrl ?? config?.customAssetUrl;\n const customAssetUrlSource =\n cliCustomAssetUrl !== undefined\n ? 'cli'\n : config?.customAssetUrl !== undefined\n ? 'config'\n : undefined;\n\n // Preserve original asset basenames only when explicitly requested.\n const preserveAssetFilenames =\n cliOpts.preserveAssetFilenames ?? config?.preserveAssetFilenames ?? false;\n const preserveAssetFilenamesSource =\n cliOpts.preserveAssetFilenames !== undefined\n ? 'cli'\n : config?.preserveAssetFilenames !== undefined\n ? 'config'\n : 'default';\n\n // Item reference source option\n const cliItemReferenceSource = cliOpts.itemReferenceSource;\n const itemReferenceSource =\n cliItemReferenceSource ?? config?.itemReferenceSource ?? 'itemIdentifier';\n const itemReferenceSourceSource =\n cliItemReferenceSource !== undefined\n ? 'cli'\n : config?.itemReferenceSource !== undefined\n ? 'config'\n : 'default';\n\n // Item filename source option (defaults to itemReferenceSource)\n const cliItemFilenameSource = cliOpts.itemFilenameSource;\n const itemFilenameSource = cliItemFilenameSource ?? config?.itemFilenameSource;\n const itemFilenameSourceSource =\n cliItemFilenameSource !== undefined\n ? 'cli'\n : config?.itemFilenameSource !== undefined\n ? 'config'\n : undefined;\n\n // Truncate tags option\n const cliTruncateTags = (cliOpts as any).truncateTags;\n const truncateTags = cliTruncateTags ?? config?.truncateTags ?? false;\n const truncateTagsSource =\n cliTruncateTags !== undefined\n ? 'cli'\n : config?.truncateTags !== undefined\n ? 'config'\n : 'default';\n\n // Split CSV tags option (default: true). Commander's `--no-split-csv-tags`\n // sets `splitCsvTags` to `false`; because that negated flag is always present\n // on the parsed options, only treat an explicit `false` as a CLI signal so\n // the usual CLI > config > default precedence still holds.\n const cliSplitCsvTags = (cliOpts as any).splitCsvTags === false ? false : undefined;\n const splitCsvTags = cliSplitCsvTags ?? config?.splitCsvTags ?? true;\n const splitCsvTagsSource =\n cliSplitCsvTags !== undefined\n ? 'cli'\n : config?.splitCsvTags !== undefined\n ? 'config'\n : 'default';\n\n const withSources: ResolvedOptionsWithSources = {\n inputPath: { value: inputPath, source: 'cli' },\n outputPath: { value: outputPath, source: 'cli' },\n qtiVersion: qtiVersionResolved,\n outputFormat: outputFormatResolved,\n diagnostics: diagnosticsResolved,\n diagnosticsPath,\n verbose: verboseResolved,\n pretty: prettyResolved,\n configPath,\n organisationId:\n organisationId !== undefined && organisationIdSource\n ? { value: organisationId, source: organisationIdSource }\n : undefined,\n mediaVault: { value: mediaVault, source: mediaVaultSource },\n customAssetUrl:\n customAssetUrl !== undefined && customAssetUrlSource\n ? { value: customAssetUrl, source: customAssetUrlSource }\n : undefined,\n preserveAssetFilenames: {\n value: preserveAssetFilenames,\n source: preserveAssetFilenamesSource,\n },\n itemReferenceSource: {\n value: itemReferenceSource as any,\n source: itemReferenceSourceSource,\n },\n itemFilenameSource:\n itemFilenameSource !== undefined && itemFilenameSourceSource\n ? { value: itemFilenameSource as any, source: itemFilenameSourceSource }\n : undefined,\n truncateTags: { value: truncateTags, source: truncateTagsSource },\n splitCsvTags: { value: splitCsvTags, source: splitCsvTagsSource },\n };\n\n const options: ResolvedOptions = {\n inputPath,\n outputPath,\n qtiVersion: qtiVersionResolved.value,\n outputFormat: outputFormatResolved.value,\n diagnostics: diagnosticsResolved.value,\n diagnosticsPath,\n verbose: verboseResolved.value,\n pretty: prettyResolved.value,\n configPath,\n organisationId, // TASK 030\n mediaVault,\n customAssetUrl,\n preserveAssetFilenames,\n itemReferenceSource: itemReferenceSource as any,\n itemFilenameSource: itemFilenameSource as any,\n truncateTags,\n splitCsvTags,\n };\n\n return { options, diagnostics, withSources };\n}\n"],"ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,uBACZ,OACA,MACyD;CACzD,MAAM,SAAS,qCAAqC,OAAO;EACvD,YAAY,KAAK;EACjB,WAAW,KAAK;EAIhB,YAAY,KAAK;EACjB,gBAAgB,KAAK;EACrB,YAAY,KAAK;EACjB,gBAAgB,KAAK;EACrB,wBAAwB,KAAK,0BAA0B;EACvD,qBAAqB,KAAK;EAC1B,cAAc,KAAK;EACnB,YAAY,KAAK;CACrB,CAAC;CAED,OAAO,QAAQ,QAAQ;EACnB,QAAQ,OAAO;EACf,aAA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Ac,qBAAqB;GACnC,aAAa,oBAAoB;GACjC;GACA,SAAS,gBAAgB;GACzB,QAAQ,eAAe;GACvB;GACA;GACA;GACA;GACA;GACqB;GACD;GACpB;GACA;EAGW;EAAG;EAAa;CAAY;AAC/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -7,22 +7,24 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10
|
-
var __exportAll = (all,
|
|
11
|
-
let target = {};
|
|
10
|
+
var __exportAll = (all, flags) => {
|
|
11
|
+
let target = Object.setPrototypeOf({}, null);
|
|
12
12
|
for (var name in all) __defProp(target, name, {
|
|
13
13
|
get: all[name],
|
|
14
14
|
enumerable: true
|
|
15
15
|
});
|
|
16
|
-
if (!
|
|
17
|
-
return target;
|
|
16
|
+
if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
18
18
|
};
|
|
19
19
|
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
21
|
-
key
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
22
|
+
desc = __getOwnPropDesc(from, key);
|
|
23
|
+
__defProp(to, key, {
|
|
24
|
+
get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
|
|
25
|
+
enumerable: !desc || desc.enumerable
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
return to;
|
|
28
30
|
};
|
|
@@ -31,5 +33,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
33
|
enumerable: true
|
|
32
34
|
}) : target, mod));
|
|
33
35
|
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
34
|
-
//#endregion
|
|
35
36
|
export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
|