@learnosity/lib-qti-converter 0.16.0 → 0.16.1
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-BI6C89vy.js} +67 -94
- package/packages/cli/dist/batchProcessors-BI6C89vy.js.map +1 -0
- package/packages/cli/dist/batchWorker.js +2 -3
- package/packages/cli/dist/{configOutput-FwkFyQmk.js → configOutput-CJ-ryN3j.js} +5 -9
- package/packages/cli/dist/{configOutput-FwkFyQmk.js.map → configOutput-CJ-ryN3j.js.map} +1 -1
- package/packages/cli/dist/{create-prompt-dWckcotJ.js → create-prompt-m0MC0vT_.js} +38 -57
- package/packages/cli/dist/create-prompt-m0MC0vT_.js.map +1 -0
- package/packages/cli/dist/{dist-DXDR2peT.js → dist-8MaFD1oj.js} +6 -10
- package/packages/cli/dist/dist-8MaFD1oj.js.map +1 -0
- package/packages/cli/dist/{learnosityToQti-D4ddrXaz.js → learnosityToQti-BDf_faIV.js} +5 -6
- package/packages/cli/dist/{learnosityToQti-D4ddrXaz.js.map → learnosityToQti-BDf_faIV.js.map} +1 -1
- package/packages/cli/dist/{learnosityToQtiPackage-Bwzm-uLX.js → learnosityToQtiPackage-w-BXgsLt.js} +15 -14
- package/packages/cli/dist/learnosityToQtiPackage-w-BXgsLt.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-BBS4FAK7.js} +5 -9
- package/packages/cli/dist/{nodeFileAccess-BhCoGDOi.js.map → nodeFileAccess-BBS4FAK7.js.map} +1 -1
- package/packages/cli/dist/pathUtils-BUJJCvvp.js +2919 -0
- package/packages/cli/dist/pathUtils-BUJJCvvp.js.map +1 -0
- package/packages/cli/dist/{qtiPackageToLearnosity-CX9htPId.js → qtiPackageToLearnosity-C24effmB.js} +7 -8
- package/packages/cli/dist/{qtiPackageToLearnosity-CX9htPId.js.map → qtiPackageToLearnosity-C24effmB.js.map} +1 -1
- package/packages/cli/dist/{qtiToLearnosity-JQYOkNbM.js → qtiToLearnosity-BEOaukuf.js} +6 -7
- package/packages/cli/dist/{qtiToLearnosity-JQYOkNbM.js.map → qtiToLearnosity-BEOaukuf.js.map} +1 -1
- package/packages/cli/dist/{resolveOptions-BuNN2KMA.js → resolveOptions-l0Hpn8hY.js} +322 -359
- package/packages/cli/dist/resolveOptions-l0Hpn8hY.js.map +1 -0
- package/packages/cli/dist/{rolldown-runtime-DktXgydw.js → rolldown-runtime-BVN1G_yT.js} +5 -6
- package/packages/cli/dist/{table-DsKq-B4-.js → table-BkrwlSAQ.js} +9724 -2071
- package/packages/cli/dist/table-BkrwlSAQ.js.map +1 -0
- package/packages/core/dist/index.d.ts +8 -58
- package/packages/core/dist/index.js +9712 -2049
- package/packages/core/dist/node.d.ts +10 -80
- package/packages/core/dist/node.js +9731 -2084
- 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":"pathUtils-BUJJCvvp.js","names":["segmenter","cliBoxes","colorNames","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ESCAPES","applySgrToken","isFullWidth","process","cliBoxes"],"sources":["../../../node_modules/.pnpm/@inquirer+input@5.1.9_@types+node@26.6.6/node_modules/@inquirer/input/dist/index.js","../../../node_modules/.pnpm/ansi-regex@6.5.0/node_modules/ansi-regex/index.js","../../../node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js","../../../node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/lookup-data.js","../../../node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/utilities.js","../../../node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/lookup.js","../../../node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/index.js","../../../node_modules/.pnpm/string-width@8.3.0/node_modules/string-width/index.js","../../../node_modules/.pnpm/widest-line@6.0.0/node_modules/widest-line/index.js","../../../node_modules/.pnpm/cli-boxes@4.0.1/node_modules/cli-boxes/boxes.json","../../../node_modules/.pnpm/cli-boxes@4.0.1/node_modules/cli-boxes/index.js","../../../node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js","../../../node_modules/.pnpm/wrap-ansi@10.0.2/node_modules/wrap-ansi/index.js","../../../node_modules/.pnpm/is-fullwidth-code-point@5.1.0/node_modules/is-fullwidth-code-point/index.js","../../../node_modules/.pnpm/slice-ansi@9.0.1/node_modules/slice-ansi/tokenize-ansi.js","../../../node_modules/.pnpm/slice-ansi@9.0.1/node_modules/slice-ansi/index.js","../../../node_modules/.pnpm/boxen@9.0.0/node_modules/boxen/index.js","../src/ux/banner.ts","../src/options/schema.ts","../src/options/loadConfig.ts","../src/utils/pathUtils.ts"],"sourcesContent":["import { createPrompt, useState, useKeypress, useEffect, usePrefix, isBackspaceKey, isEnterKey, isTabKey, makeTheme, } from '@inquirer/core';\nconst inputTheme = {\n validationFailureMode: 'keep',\n};\nexport default createPrompt((config, done) => {\n const { prefill = 'tab' } = config;\n const theme = makeTheme(inputTheme, config.theme);\n const [status, setStatus] = useState('idle');\n // Coerce to string to handle runtime values that may be numbers despite TypeScript types\n // oxlint-disable-next-line typescript/no-unnecessary-type-conversion\n const [defaultValue, setDefaultValue] = useState(String(config.default ?? ''));\n const [errorMsg, setError] = useState();\n const [value, setValue] = useState('');\n const prefix = usePrefix({ status, theme });\n async function validate(value) {\n const { required, pattern, patternError = 'Invalid input' } = config;\n if (required && !value) {\n return 'You must provide a value';\n }\n if (pattern && !pattern.test(value)) {\n return patternError;\n }\n if (typeof config.validate === 'function') {\n return (await config.validate(value)) || 'You must provide a valid value';\n }\n return true;\n }\n useKeypress(async (key, rl) => {\n // Ignore keypress while our prompt is doing other processing.\n if (status !== 'idle') {\n return;\n }\n if (isEnterKey(key)) {\n const answer = value || defaultValue;\n setStatus('loading');\n const isValid = await validate(answer);\n if (isValid === true) {\n setValue(answer);\n setStatus('done');\n done(answer);\n }\n else {\n if (theme.validationFailureMode === 'clear') {\n setValue('');\n }\n else {\n // Reset the readline line value to the previous value. On line event, the value\n // get cleared, forcing the user to re-enter the value instead of fixing it.\n rl.write(value);\n }\n setError(isValid);\n setStatus('idle');\n }\n }\n else if (isBackspaceKey(key) && !value) {\n setDefaultValue('');\n }\n else if (isTabKey(key) && !value) {\n setDefaultValue('');\n rl.clearLine(0); // Remove the tab character.\n rl.write(defaultValue);\n setValue(defaultValue);\n }\n else {\n setValue(rl.line);\n setError(undefined);\n }\n });\n // If prefill is set to 'editable' cut out the default value and paste into current state and the user's cli buffer\n // They can edit the value immediately instead of needing to press 'tab'\n useEffect((rl) => {\n if (prefill === 'editable' && defaultValue) {\n rl.write(defaultValue);\n setValue(defaultValue);\n }\n }, []);\n const message = theme.style.message(config.message, status);\n let formattedValue = value;\n if (typeof config.transformer === 'function') {\n formattedValue = config.transformer(value, { isFinal: status === 'done' });\n }\n else if (status === 'done') {\n formattedValue = theme.style.answer(value);\n }\n let defaultStr;\n if (defaultValue && status !== 'done' && !value) {\n defaultStr = theme.style.defaultAnswer(defaultValue);\n }\n let error = '';\n if (errorMsg) {\n error = theme.style.error(errorMsg);\n }\n return [\n [prefix, message, defaultStr, formattedValue]\n .filter((v) => v !== undefined)\n .join(' '),\n error,\n ];\n});\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = String.raw`(?:\\u0007|\\u001B\\u005C|\\u009C)`;\n\n\t// OSC sequences only: ESC ] ... ST (or the C1 introducer 0x9d ... ST)\n\t// The payload stops at the first terminator character rather than scanning ahead for one, so an unterminated `ESC ]` cannot rescan the rest of the input. Terminals likewise abort a control string on an unexpected ESC. The payload also stops at 0x9d so an unterminated C1 OSC cannot swallow the next one.\n\tconst osc = String.raw`(?:(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C\\u009D]*${ST})`;\n\n\t// CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n\t// The final byte class is deliberately narrow, so that ESC followed by an arbitrary character is not read as a sequence. It must\n\t// not include the parameter digits though: when the real final byte is outside the class the engine backtracks and takes the last\n\t// parameter digit as the final byte instead, leaving the real one behind as visible text. `ESC [ 5 d` stripped to a bare `d`.\n\tconst csi = String.raw`[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[A-PR-TZcf-nq-uy=><~]`;\n\n\t// `= < >` are final bytes in the two byte VT52 escapes (`ESC >`) but parameter bytes in a CSI\n\t// (`ESC [ > 0 ; 276 ; 0 c`, the device attributes reply). Matching them as a final byte always\n\t// wins and leaves the rest of the reply behind as visible text, so the private parameter form is\n\t// matched first, where the `[` makes the two unambiguous.\n\tconst csiPrivate = String.raw`(?:\\u001B\\[|\\u009B)[<=>][0-9;:]*[A-PR-TZcf-nq-uy~]`;\n\n\tconst pattern = `${osc}|${csiPrivate}|${csi}`;\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Fast path: ANSI codes require ESC (7-bit) or CSI (8-bit) introducer\n\tif (!string.includes('\\u001B') && !string.includes('\\u009B')) {\n\t\treturn string;\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","// Generated by scripts/build.js\n\nexport const ambiguousMinimalCodePoint = 161;\nexport const ambiguousMaximumCodePoint = 1114109;\nexport const ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];\n\nexport const fullwidthMinimalCodePoint = 12288;\nexport const fullwidthMaximumCodePoint = 65510;\nexport const fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];\n\nexport const halfwidthMinimalCodePoint = 8361;\nexport const halfwidthMaximumCodePoint = 65518;\nexport const halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];\n\nexport const narrowMinimalCodePoint = 32;\nexport const narrowMaximumCodePoint = 10630;\nexport const narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];\n\nexport const wideMinimalCodePoint = 4352;\nexport const wideMaximumCodePoint = 262141;\nexport const wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101594, 101631, 101664, 101760, 101874, 101888, 102801, 102816, 102866, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110888, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110952, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127406, 127406, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128729, 128732, 128735, 128747, 128748, 128756, 128764, 128986, 128986, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129734, 129736, 129736, 129740, 129757, 129759, 129771, 129775, 129786, 131072, 196605, 196608, 262141];\n","/**\nBinary search on a sorted flat array of [start, end] pairs.\n\n@param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].\n@param {number} codePoint - The value to search for.\n@returns {boolean} Whether the value falls within any of the ranges.\n*/\nexport const isInRange = (ranges, codePoint) => {\n\tlet low = 0;\n\tlet high = Math.floor(ranges.length / 2) - 1;\n\twhile (low <= high) {\n\t\tconst mid = Math.floor((low + high) / 2);\n\t\tconst i = mid * 2;\n\t\tif (codePoint < ranges[i]) {\n\t\t\thigh = mid - 1;\n\t\t} else if (codePoint > ranges[i + 1]) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n","import {\n\tambiguousMinimalCodePoint,\n\tambiguousMaximumCodePoint,\n\tambiguousRanges,\n\n\tfullwidthMinimalCodePoint,\n\tfullwidthMaximumCodePoint,\n\tfullwidthRanges,\n\n\thalfwidthMinimalCodePoint,\n\thalfwidthMaximumCodePoint,\n\thalfwidthRanges,\n\n\tnarrowMinimalCodePoint,\n\tnarrowMaximumCodePoint,\n\tnarrowRanges,\n\n\twideMinimalCodePoint,\n\twideMaximumCodePoint,\n\twideRanges,\n} from './lookup-data.js';\nimport {isInRange} from './utilities.js';\n\nconst commonCjkCodePoint = 0x4E_00;\nconst [wideFastPathStart, wideFastPathEnd] = /* #__PURE__ */ findWideFastPathRange(wideRanges);\n\n// Use a hot-path range so common `isWide` calls can skip binary search.\n// The range containing U+4E00 covers common CJK ideographs;\n// fallback to the largest range for resilience to Unicode table changes.\nfunction findWideFastPathRange(ranges) {\n\tlet fastPathStart = ranges[0];\n\tlet fastPathEnd = ranges[1];\n\n\tfor (let index = 0; index < ranges.length; index += 2) {\n\t\tconst start = ranges[index];\n\t\tconst end = ranges[index + 1];\n\n\t\tif (\n\t\t\tcommonCjkCodePoint >= start\n\t\t\t&& commonCjkCodePoint <= end\n\t\t) {\n\t\t\treturn [start, end];\n\t\t}\n\n\t\tif ((end - start) > (fastPathEnd - fastPathStart)) {\n\t\t\tfastPathStart = start;\n\t\t\tfastPathEnd = end;\n\t\t}\n\t}\n\n\treturn [fastPathStart, fastPathEnd];\n}\n\nexport const isAmbiguous = codePoint => {\n\tif (\n\t\tcodePoint < ambiguousMinimalCodePoint\n\t\t|| codePoint > ambiguousMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(ambiguousRanges, codePoint);\n};\n\nexport const isFullwidth = codePoint => {\n\tif (\n\t\tcodePoint < fullwidthMinimalCodePoint\n\t\t|| codePoint > fullwidthMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(fullwidthRanges, codePoint);\n};\n\nconst isHalfwidth = codePoint => {\n\tif (\n\t\tcodePoint < halfwidthMinimalCodePoint\n\t\t|| codePoint > halfwidthMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(halfwidthRanges, codePoint);\n};\n\nconst isNarrow = codePoint => {\n\tif (\n\t\tcodePoint < narrowMinimalCodePoint\n\t\t|| codePoint > narrowMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(narrowRanges, codePoint);\n};\n\nexport const isWide = codePoint => {\n\tif (\n\t\tcodePoint >= wideFastPathStart\n\t\t&& codePoint <= wideFastPathEnd\n\t) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\tcodePoint < wideMinimalCodePoint\n\t\t|| codePoint > wideMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(wideRanges, codePoint);\n};\n\nexport function getCategory(codePoint) {\n\tif (isAmbiguous(codePoint)) {\n\t\treturn 'ambiguous';\n\t}\n\n\tif (isFullwidth(codePoint)) {\n\t\treturn 'fullwidth';\n\t}\n\n\tif (isHalfwidth(codePoint)) {\n\t\treturn 'halfwidth';\n\t}\n\n\tif (isNarrow(codePoint)) {\n\t\treturn 'narrow';\n\t}\n\n\tif (isWide(codePoint)) {\n\t\treturn 'wide';\n\t}\n\n\treturn 'neutral';\n}\n","import {getCategory, isAmbiguous, isFullwidth, isWide} from './lookup.js';\n\nfunction validate(codePoint) {\n\tif (!Number.isSafeInteger(codePoint)) {\n\t\tthrow new TypeError(`Expected a code point, got \\`${typeof codePoint}\\`.`);\n\t}\n}\n\nexport function eastAsianWidthType(codePoint) {\n\tvalidate(codePoint);\n\n\treturn getCategory(codePoint);\n}\n\nexport function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {\n\tvalidate(codePoint);\n\n\tif (\n\t\tisFullwidth(codePoint)\n\t\t|| isWide(codePoint)\n\t\t|| (ambiguousAsWide && isAmbiguous(codePoint))\n\t) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\n// Private exports for https://github.com/sindresorhus/is-fullwidth-code-point\nexport {\n\tisFullwidth as _isFullwidth,\n\t// TODO: Remove this in the next major version.\n\tisFullwidth as _isFullWidth,\n\tisWide as _isWide,\n} from './lookup.js';\n","import stripAnsi from 'strip-ansi';\nimport {eastAsianWidth} from 'get-east-asian-width';\n\n/**\nLogic:\n- Segment graphemes to match how terminals render clusters.\n- Width rules:\n\t1. Skip non-printing clusters (Default_Ignorable, Control, pure nonspacing/enclosing Mark, lone Surrogates). Tabs are ignored by design.\n\t2. RGI emoji clusters (\\p{RGI_Emoji}) are double-width.\n\t3. Minimally-qualified/unqualified emoji clusters (ZWJ sequences with 2+ Extended_Pictographic, or keycap sequences) are double-width.\n\t4. Hangul jamo collapse each standard modern Hangul L+V or L+V+T syllable piece to width 2.\n\t Unmatched repeated leading/vowel/trailing jamo stay additive because that matches how the terminals we target render them.\n\t5. Otherwise use East Asian Width of the cluster's first visible code point, and add widths for trailing spacing marks and Halfwidth/Fullwidth Forms within the same cluster (e.g., dakuten/handakuten/prolonged sound mark).\n*/\n\nconst segmenter = new Intl.Segmenter();\n\n// Matches a visible (printing) character. Used to find the base scalar of a cluster (skipping leading Prepend/Format/Marks) and to detect whole-cluster zero-width.\n// Intentionally a single negated class without a quantifier: a repeated pattern like `^(?:…|…)+$` backtracks exponentially on overlapping properties, and even `^[…]+$` overflows V8's backtrack stack (RangeError) on clusters with millions of marks.\nconst visibleCharacterRegex = /[^\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]/v;\nconst spacingMarkRegex = /\\p{Spacing_Mark}/v;\n\n// RGI emoji sequences\nconst rgiEmojiRegex = /^\\p{RGI_Emoji}$/v;\n\n// Detect minimally-qualified/unqualified emoji sequences (missing VS16 but still render as double-width)\nconst unqualifiedKeycapRegex = /^[\\d#*]\\u20E3$/;\nconst extendedPictographicRegex = /\\p{Extended_Pictographic}/gu;\n\nfunction isDoubleWidthNonRgiEmojiSequence(segment) {\n\t// Real emoji clusters are < 30 chars; guard against pathological input\n\tif (segment.length > 50) {\n\t\treturn false;\n\t}\n\n\tif (unqualifiedKeycapRegex.test(segment)) {\n\t\treturn true;\n\t}\n\n\t// ZWJ sequences with 2+ Extended_Pictographic\n\tif (segment.includes('\\u200D')) {\n\t\tconst pictographics = segment.match(extendedPictographicRegex);\n\t\treturn pictographics !== null && pictographics.length >= 2;\n\t}\n\n\treturn false;\n}\n\n// Returns the cluster starting at its first visible character, or `undefined` if the whole cluster is zero-width.\nfunction baseVisible(segment) {\n\tconst index = segment.search(visibleCharacterRegex);\n\treturn index === -1 ? undefined : segment.slice(index);\n}\n\nfunction isHangulLeadingJamo(codePoint) {\n\treturn (codePoint >= 0x11_00 && codePoint <= 0x11_5F)\n\t\t|| (codePoint >= 0xA9_60 && codePoint <= 0xA9_7C);\n}\n\nfunction isHangulVowelJamo(codePoint) {\n\treturn (codePoint >= 0x11_60 && codePoint <= 0x11_A7)\n\t\t|| (codePoint >= 0xD7_B0 && codePoint <= 0xD7_C6);\n}\n\nfunction isHangulTrailingJamo(codePoint) {\n\treturn (codePoint >= 0x11_A8 && codePoint <= 0x11_FF)\n\t\t|| (codePoint >= 0xD7_CB && codePoint <= 0xD7_FB);\n}\n\nfunction isHangulJamo(codePoint) {\n\treturn isHangulLeadingJamo(codePoint)\n\t\t|| isHangulVowelJamo(codePoint)\n\t\t|| isHangulTrailingJamo(codePoint);\n}\n\nfunction hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {\n\tconst codePoints = [];\n\n\tfor (const character of visibleSegment) {\n\t\tif (!visibleCharacterRegex.test(character)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tcodePoints.push(character.codePointAt(0));\n\t}\n\n\tif (codePoints.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tlet width = 0;\n\n\tfor (let index = 0; index < codePoints.length; index++) {\n\t\tconst codePoint = codePoints[index];\n\t\tif (!isHangulJamo(codePoint)) {\n\t\t\tif (width === 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Mixed cluster (e.g., L + precomposed syllable): use EAW for non-jamo remainder\n\t\t\tfor (let remaining = index; remaining < codePoints.length; remaining++) {\n\t\t\t\twidth += eastAsianWidth(codePoints[remaining], eastAsianWidthOptions);\n\t\t\t}\n\n\t\t\treturn width;\n\t\t}\n\n\t\t// Modern Hangul L+V(+T) shapes as one syllable block. Unmatched jamo stay additive:\n\t\t// U+1100 U+1100 U+1161 => U+1100 + (U+1100 U+1161) => 2 + 2.\n\t\tif (\n\t\t\tisHangulLeadingJamo(codePoint)\n\t\t\t&& isHangulVowelJamo(codePoints[index + 1])\n\t\t) {\n\t\t\twidth += 2;\n\t\t\tindex += isHangulTrailingJamo(codePoints[index + 2]) ? 2 : 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\twidth += eastAsianWidth(codePoint, eastAsianWidthOptions);\n\t}\n\n\treturn width;\n}\n\nfunction trailingWidth(visibleSegment, eastAsianWidthOptions) {\n\tlet extra = 0;\n\tlet first = true;\n\n\tfor (const character of visibleSegment) {\n\t\tif (first) {\n\t\t\tfirst = false;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tspacingMarkRegex.test(character)\n\t\t\t|| (character >= '\\uFF00' && character <= '\\uFFEF')\n\t\t) {\n\t\t\textra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);\n\t\t}\n\t}\n\n\treturn extra;\n}\n\nexport default function stringWidth(input, options = {}) {\n\tif (typeof input !== 'string' || input.length === 0) {\n\t\treturn 0;\n\t}\n\n\tconst {\n\t\tambiguousIsNarrow = true,\n\t\tcountAnsiEscapeCodes = false,\n\t} = options;\n\n\tlet string = input;\n\n\t// Avoid calling stripAnsi when there are no ANSI escape sequences (ESC = 0x1B, CSI = 0x9B)\n\tif (!countAnsiEscapeCodes && (string.includes('\\u001B') || string.includes('\\u009B'))) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\t// Fast path: printable ASCII (0x20–0x7E) needs no segmenter, regex, or EAW lookup — width equals length.\n\tif (/^[\\u0020-\\u007E]*$/.test(string)) {\n\t\treturn string.length;\n\t}\n\n\tlet width = 0;\n\tconst eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};\n\n\tfor (const {segment} of segmenter.segment(string)) {\n\t\t// Zero-width / non-printing clusters\n\t\tconst visibleSegment = baseVisible(segment);\n\t\tif (visibleSegment === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Emoji width logic\n\t\tif (rgiEmojiRegex.test(segment) || isDoubleWidthNonRgiEmojiSequence(segment)) {\n\t\t\twidth += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst hangulWidth = hangulClusterWidth(visibleSegment, eastAsianWidthOptions);\n\t\tif (hangulWidth !== undefined) {\n\t\t\twidth += hangulWidth;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Everything else: EAW of the cluster’s first visible scalar\n\t\tconst codePoint = visibleSegment.codePointAt(0);\n\t\twidth += eastAsianWidth(codePoint, eastAsianWidthOptions);\n\n\t\t// Add width for trailing spacing marks and Halfwidth/Fullwidth Forms (e.g., ゙, ゚, ー)\n\t\twidth += trailingWidth(visibleSegment, eastAsianWidthOptions);\n\t}\n\n\treturn width;\n}\n","import stringWidth from 'string-width';\n\nexport default function widestLine(string) {\n\tlet lineWidth = 0;\n\n\tfor (const line of string.split('\\n')) {\n\t\tlineWidth = Math.max(lineWidth, stringWidth(line));\n\t}\n\n\treturn lineWidth;\n}\n","","import cliBoxes from './boxes.json' with {type: 'json'};\n\nexport default cliBoxes;\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import stringWidth from 'string-width';\nimport ansiStyles from 'ansi-styles';\n\nconst ANSI_ESCAPE = '\\u001B';\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst C1_CSI = '\\u009B';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_SGR_RESET = 0;\nconst ANSI_SGR_RESET_FOREGROUND = 39;\nconst ANSI_SGR_RESET_BACKGROUND = 49;\nconst ANSI_SGR_RESET_UNDERLINE_COLOR = 59;\nconst ANSI_SGR_FOREGROUND_EXTENDED = 38;\nconst ANSI_SGR_BACKGROUND_EXTENDED = 48;\nconst ANSI_SGR_UNDERLINE_COLOR_EXTENDED = 58;\nconst ANSI_SGR_COLOR_MODE_RGB = 2;\nconst ANSI_SGR_COLOR_MODE_256 = 5;\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;`;\n// The first character of every sequence we recognize.\nconst ESCAPES = new Set([\n\tANSI_ESCAPE,\n\tC1_CSI,\n]);\nconst ESCAPE_CHARACTERS = [...ESCAPES].join('');\n\nconst CSI_INTRODUCER = `(?:${ANSI_ESCAPE}\\\\${ANSI_CSI}|${C1_CSI})`;\nconst CSI_PARAMETERS = '[0-?]*[ -/]*[@-~]';\nconst SGR_PARAMETERS = `(?<sgr>[0-9;:]*)${ANSI_SGR_TERMINATOR}`;\nconst OSC_STRING_TERMINATOR = `(?:${ANSI_ESCAPE_BELL}|${ANSI_ESCAPE}\\\\\\\\)`;\nconst OSC_STRING_PAYLOAD = String.raw`[^\\u0000-\\u001F\\u007F-\\u009F]*`;\n// A hyperlink is `OSC 8 ; parameters ; URI ST`, where `parameters` is a possibly empty list of `key=value` pairs joined by `:`.\nconst LINK_PARAMETERS = String.raw`8;(?<parameters>[^;\\u0000-\\u001F\\u007F-\\u009F]*);(?<uri>${OSC_STRING_PAYLOAD})${OSC_STRING_TERMINATOR}`;\nconst OSC_STRING = `${OSC_STRING_PAYLOAD}${OSC_STRING_TERMINATOR}`;\n\n// Supported boundary: semicolon-delimited SGR styling, colon-delimited RGB/indexed colors, and OSC 8 hyperlinks are tracked, while ordinary CSI sequences and other complete 7-bit OSC commands are preserved as opaque zero-width units. This is intentionally not a terminal emulator, so other colon-delimited SGR semantics, C0 bytes inside sequences, DCS/SOS/PM/APC control strings, cancellations, generic ESC sequences, and 8-bit control-string forms are unsupported. Newlines always delimit input lines before ANSI parsing.\nconst ANSI_ESCAPE_REGEX = new RegExp(\n\t`${CSI_INTRODUCER}(?:${SGR_PARAMETERS}|${CSI_PARAMETERS})`\n\t+ `|${ANSI_ESCAPE}\\\\${ANSI_OSC}(?:${LINK_PARAMETERS}|${OSC_STRING})`,\n\t'y',\n);\n\nconst ANSI_SGR_MODIFIER_CLOSE_CODES = new Set(ansiStyles.codes.values());\nANSI_SGR_MODIFIER_CLOSE_CODES.delete(ANSI_SGR_RESET);\n\nconst segmenter = new Intl.Segmenter();\n// Complete ANSI sequences have already been removed before measuring these strings. Avoid string-width's ANSI scan so malformed sequences are not rescanned.\nconst getStringWidth = string => stringWidth(string, {countAnsiEscapeCodes: true});\nconst TAB_SIZE = 8;\n\n// Finds the next character that could introduce a sequence, so plain text is skipped in one native step.\nconst ESCAPE_INTRODUCER_REGEX = new RegExp(`[${ESCAPE_CHARACTERS}]`, 'g');\n// The final pass only cares about sequences and row boundaries, so it skips everything else in one native step.\nconst ROW_BOUNDARY_REGEX = new RegExp(`[\\\\n${ESCAPE_CHARACTERS}]`, 'g');\n// Every printable ASCII character is its own grapheme cluster of width one, which lets the segmenter be skipped.\nconst ASCII_PRINTABLE_REGEX = /^[ -~]*$/;\n\nconst wrapAnsiCode = code => `${ANSI_ESCAPE}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url, parameters = '') => `${ANSI_ESCAPE}${ANSI_ESCAPE_LINK}${parameters};${url}${ANSI_ESCAPE_BELL}`;\n\n// Match a complete escape sequence starting at `index`, or return `undefined` when none starts there.\nconst matchAnsiEscape = (string, index) => {\n\tif (!ESCAPES.has(string[index])) {\n\t\treturn;\n\t}\n\n\tANSI_ESCAPE_REGEX.lastIndex = index;\n\treturn ANSI_ESCAPE_REGEX.exec(string) ?? undefined;\n};\n\n// Walk a string as alternating plain text runs and complete escape sequences.\n// A character that looks like an introducer but does not start a valid sequence stays plain text.\nconst forEachSegment = (string, onPlainText, onEscape = () => {}) => {\n\tlet plainStart = 0;\n\tlet index = 0;\n\n\twhile (index < string.length) {\n\t\tESCAPE_INTRODUCER_REGEX.lastIndex = index;\n\t\tconst introducer = ESCAPE_INTRODUCER_REGEX.exec(string);\n\n\t\tif (!introducer) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst escape = matchAnsiEscape(string, introducer.index);\n\n\t\tif (!escape) {\n\t\t\tindex = introducer.index + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (introducer.index > plainStart) {\n\t\t\tonPlainText(string.slice(plainStart, introducer.index));\n\t\t}\n\n\t\tonEscape(escape[0]);\n\t\tindex = introducer.index + escape[0].length;\n\t\tplainStart = index;\n\t}\n\n\tif (plainStart < string.length) {\n\t\tonPlainText(string.slice(plainStart));\n\t}\n};\n\n// The visible width of a string, ignoring escape sequences.\nconst getWidth = string => {\n\tlet plainText = '';\n\n\tforEachSegment(string, part => {\n\t\tplainText += part;\n\t});\n\n\treturn getStringWidth(plainText);\n};\n\n// Split a string into escape sequences, which are zero width and must never be split, and grapheme clusters.\n// The supported boundary is between grapheme clusters and ANSI sequences; ANSI inserted inside a cluster is treated as separate segments.\nconst getTokens = string => {\n\tconst tokens = [];\n\n\tforEachSegment(string, plainText => {\n\t\tif (ASCII_PRINTABLE_REGEX.test(plainText)) {\n\t\t\tfor (const character of plainText) {\n\t\t\t\ttokens.push({value: character, width: 1});\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const {segment} of segmenter.segment(plainText)) {\n\t\t\ttokens.push({value: segment, width: getStringWidth(segment)});\n\t\t}\n\t}, escape => {\n\t\ttokens.push({value: escape, width: 0});\n\t});\n\n\treturn tokens;\n};\n\n// Split on spaces, ignoring spaces that appear inside a recognized sequence.\nconst splitWords = string => {\n\tlet currentWord = {value: '', plainText: ''};\n\tconst words = [currentWord];\n\n\tforEachSegment(string, plainText => {\n\t\tconst parts = plainText.split(' ');\n\t\tcurrentWord.value += parts[0];\n\t\tcurrentWord.plainText += parts[0];\n\n\t\tfor (let index = 1; index < parts.length; index++) {\n\t\t\tcurrentWord = {value: parts[index], plainText: parts[index]};\n\t\t\twords.push(currentWord);\n\t\t}\n\t}, escape => {\n\t\tcurrentWord.value += escape;\n\t});\n\n\t// Measured once per word rather than per run, so a grapheme cluster split by an escape still counts once.\n\tfor (const word of words) {\n\t\tword.width = getStringWidth(word.plainText);\n\t}\n\n\treturn words;\n};\n\nconst getColonColorToken = parameter => {\n\tconst parts = parameter.split(':');\n\tconst code = Number.parseInt(parts[0], 10);\n\tconst mode = Number.parseInt(parts[1], 10);\n\n\tif (![ANSI_SGR_FOREGROUND_EXTENDED, ANSI_SGR_BACKGROUND_EXTENDED, ANSI_SGR_UNDERLINE_COLOR_EXTENDED].includes(code)) {\n\t\treturn;\n\t}\n\n\tif (mode === ANSI_SGR_COLOR_MODE_256 && parts.length === 3 && /^\\d+$/.test(parts[2])) {\n\t\treturn {code, open: parameter, hasArguments: true};\n\t}\n\n\tif (mode !== ANSI_SGR_COLOR_MODE_RGB) {\n\t\treturn;\n\t}\n\n\tconst components = parts.length === 6 ? parts.slice(3) : parts.slice(2);\n\tconst colorSpace = parts.length === 6 ? parts[2] : undefined;\n\tif (components.length === 3 && components.every(component => /^\\d+$/.test(component)) && (colorSpace === undefined || /^\\d*$/.test(colorSpace))) {\n\t\treturn {code, open: parameter, hasArguments: true};\n\t}\n};\n\nconst getSgrTokens = sgrParameters => {\n\tconst parameters = sgrParameters.split(';');\n\tconst sgrTokens = [];\n\n\tfor (let index = 0; index < parameters.length; index++) {\n\t\tconst parameter = parameters[index];\n\t\tif (parameter.includes(':')) {\n\t\t\tconst colonColorToken = getColonColorToken(parameter);\n\t\t\tif (colonColorToken) {\n\t\t\t\tsgrTokens.push(colonColorToken);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst code = parameter === '' ? ANSI_SGR_RESET : Number.parseInt(parameter, 10);\n\n\t\tif (!Number.isFinite(code)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (code === ANSI_SGR_FOREGROUND_EXTENDED || code === ANSI_SGR_BACKGROUND_EXTENDED || code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED) {\n\t\t\tif (index + 1 >= parameters.length) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst mode = Number.parseInt(parameters[index + 1], 10);\n\t\t\tconst colorIndex = Number.parseInt(parameters[index + 2], 10);\n\t\t\tif (mode === ANSI_SGR_COLOR_MODE_256 && Number.isFinite(colorIndex)) {\n\t\t\t\tsgrTokens.push({code, open: [code, mode, colorIndex].join(';'), hasArguments: true});\n\t\t\t\tindex += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst red = Number.parseInt(parameters[index + 2], 10);\n\t\t\tconst green = Number.parseInt(parameters[index + 3], 10);\n\t\t\tconst blue = Number.parseInt(parameters[index + 4], 10);\n\t\t\tif (mode === ANSI_SGR_COLOR_MODE_RGB && Number.isFinite(red) && Number.isFinite(green) && Number.isFinite(blue)) {\n\t\t\t\tsgrTokens.push({code, open: [code, mode, red, green, blue].join(';'), hasArguments: true});\n\t\t\t\tindex += 4;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tsgrTokens.push({code, open: String(code), hasArguments: false});\n\t}\n\n\treturn sgrTokens;\n};\n\nconst removeActiveStyle = (activeStyles, family) => {\n\tconst activeStyleIndex = activeStyles.findIndex(activeStyle => activeStyle.family === family);\n\n\tif (activeStyleIndex !== -1) {\n\t\tactiveStyles.splice(activeStyleIndex, 1);\n\t}\n};\n\nconst upsertActiveStyle = (activeStyles, nextActiveStyle) => {\n\tremoveActiveStyle(activeStyles, nextActiveStyle.family);\n\tactiveStyles.push(nextActiveStyle);\n};\n\nconst removeModifierStylesByClose = (activeStyles, closeCode) => {\n\tfor (let index = activeStyles.length - 1; index >= 0; index--) {\n\t\tconst activeStyle = activeStyles[index];\n\t\tif (activeStyle.family.startsWith('modifier-') && activeStyle.close === closeCode) {\n\t\t\tactiveStyles.splice(index, 1);\n\t\t}\n\t}\n};\n\nconst getColorStyle = sgrToken => {\n\tconst {code, open, hasArguments} = sgrToken;\n\tif ((code >= 30 && code <= 37) || (code >= 90 && code <= 97) || (code === ANSI_SGR_FOREGROUND_EXTENDED && hasArguments)) {\n\t\treturn {\n\t\t\tfamily: 'foreground',\n\t\t\topen,\n\t\t\tclose: ANSI_SGR_RESET_FOREGROUND,\n\t\t};\n\t}\n\n\tif ((code >= 40 && code <= 47) || (code >= 100 && code <= 107) || (code === ANSI_SGR_BACKGROUND_EXTENDED && hasArguments)) {\n\t\treturn {\n\t\t\tfamily: 'background',\n\t\t\topen,\n\t\t\tclose: ANSI_SGR_RESET_BACKGROUND,\n\t\t};\n\t}\n\n\tif (code === ANSI_SGR_UNDERLINE_COLOR_EXTENDED && hasArguments) {\n\t\treturn {\n\t\t\tfamily: 'underlineColor',\n\t\t\topen,\n\t\t\tclose: ANSI_SGR_RESET_UNDERLINE_COLOR,\n\t\t};\n\t}\n};\n\nconst applySgrResetCode = (code, activeStyles) => {\n\tif (code === ANSI_SGR_RESET) {\n\t\tactiveStyles.length = 0;\n\t\treturn true;\n\t}\n\n\tif (code === ANSI_SGR_RESET_FOREGROUND) {\n\t\tremoveActiveStyle(activeStyles, 'foreground');\n\t\treturn true;\n\t}\n\n\tif (code === ANSI_SGR_RESET_BACKGROUND) {\n\t\tremoveActiveStyle(activeStyles, 'background');\n\t\treturn true;\n\t}\n\n\tif (code === ANSI_SGR_RESET_UNDERLINE_COLOR) {\n\t\tremoveActiveStyle(activeStyles, 'underlineColor');\n\t\treturn true;\n\t}\n\n\tif (ANSI_SGR_MODIFIER_CLOSE_CODES.has(code)) {\n\t\tremoveModifierStylesByClose(activeStyles, code);\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nconst applySgrToken = (sgrToken, activeStyles) => {\n\tconst {code} = sgrToken;\n\n\tif (applySgrResetCode(code, activeStyles)) {\n\t\treturn;\n\t}\n\n\tconst colorStyle = getColorStyle(sgrToken);\n\tif (colorStyle) {\n\t\tupsertActiveStyle(activeStyles, colorStyle);\n\t\treturn;\n\t}\n\n\tconst close = ansiStyles.codes.get(code);\n\tif (close !== undefined && close !== ANSI_SGR_RESET) {\n\t\tupsertActiveStyle(activeStyles, {\n\t\t\tfamily: `modifier-${code}`,\n\t\t\topen: sgrToken.open,\n\t\t\tclose,\n\t\t});\n\t}\n};\n\nconst applySgrParameters = (sgrParameters, activeStyles) => {\n\tfor (const sgrToken of getSgrTokens(sgrParameters)) {\n\t\tapplySgrToken(sgrToken, activeStyles);\n\t}\n};\n\nconst applySgrResets = (sgrParameters, activeStyles) => {\n\tfor (const {code} of getSgrTokens(sgrParameters)) {\n\t\tapplySgrResetCode(code, activeStyles);\n\t}\n};\n\nconst applyLeadingSgrResets = (string, startIndex, activeStyles) => {\n\tlet index = startIndex;\n\n\twhile (index < string.length) {\n\t\tconst match = matchAnsiEscape(string, index);\n\t\tif (!match) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (match.groups.sgr !== undefined) {\n\t\t\tapplySgrResets(match.groups.sgr, activeStyles);\n\t\t}\n\n\t\tindex += match[0].length;\n\t}\n};\n\nconst getClosingSgrSequence = activeStyles => [...activeStyles].reverse().map(activeStyle => wrapAnsiCode(activeStyle.close)).join('');\nconst getOpeningSgrSequence = activeStyles => activeStyles.map(activeStyle => wrapAnsiCode(activeStyle.open)).join('');\n\n// Wrap a long word across multiple rows\n// ANSI escape codes do not count towards length\n// Takes the visible width of the last row and returns the width of the row the word ends on, so callers never have to measure the rows themselves.\nconst wrapWord = (rows, word, columns, rowWidth) => {\n\tconst tokens = getTokens(word);\n\n\tlet visible = rowWidth;\n\n\tfor (let index = 0; index < tokens.length; index++) {\n\t\tconst token = tokens[index];\n\n\t\t// Escape sequences and combining marks are zero width, so they always stay on the current row.\n\t\tif (token.width > 0 && visible > 0 && visible + token.width > columns) {\n\t\t\trows.push('');\n\t\t\tvisible = 0;\n\t\t}\n\n\t\trows[rows.length - 1] += token.value;\n\t\tvisible += token.width;\n\n\t\tif (visible === columns && index < tokens.length - 1) {\n\t\t\trows.push('');\n\t\t\tvisible = 0;\n\t\t}\n\t}\n\n\t// It's possible that the last row we copy over is only\n\t// ANSI escape characters, handle this edge-case\n\tif (!visible && rows.at(-1).length > 0 && rows.length > 1) {\n\t\trows[rows.length - 2] += rows.pop();\n\t}\n\n\t// The tokens are measured one by one, so a grapheme cluster that an escape sequence splits is counted once per part rather than once as a whole. Only the finished row tells the true width, and it is at most one row long to measure.\n\treturn getWidth(rows.at(-1));\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = string => {\n\tif (!string.includes(' ')) {\n\t\treturn string;\n\t}\n\n\tconst segments = [];\n\tforEachSegment(string, plainText => {\n\t\tsegments.push({value: plainText, isEscape: false});\n\t}, escape => {\n\t\tsegments.push({value: escape, isEscape: true});\n\t});\n\n\t// Drop the spaces that trail the last visible character, but keep the invisible sequences among them.\n\tfor (let index = segments.length - 1; index >= 0; index--) {\n\t\tconst segment = segments[index];\n\n\t\tif (segment.isEscape) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Scanned rather than matched with a regex, as a trailing-space pattern backtracks quadratically.\n\t\tlet end = segment.value.length;\n\t\twhile (end > 0 && segment.value[end - 1] === ' ') {\n\t\t\tend--;\n\t\t}\n\n\t\tsegment.value = segment.value.slice(0, end);\n\n\t\tif (getStringWidth(segment.value) > 0) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn segments.map(segment => segment.value).join('');\n};\n\nconst expandTabs = line => {\n\tif (!line.includes('\\t')) {\n\t\treturn line;\n\t}\n\n\tlet visible = 0;\n\tlet expandedLine = '';\n\tlet plainTextSinceTab = '';\n\n\tconst expandPlainText = plainText => {\n\t\tconst segments = plainText.split('\\t');\n\n\t\tfor (const [index, segment] of segments.entries()) {\n\t\t\texpandedLine += segment;\n\t\t\tplainTextSinceTab += segment;\n\n\t\t\tif (index < segments.length - 1) {\n\t\t\t\tvisible += getStringWidth(plainTextSinceTab);\n\t\t\t\tplainTextSinceTab = '';\n\t\t\t\tconst spaces = TAB_SIZE - (visible % TAB_SIZE);\n\t\t\t\texpandedLine += ' '.repeat(spaces);\n\t\t\t\tvisible += spaces;\n\t\t\t}\n\t\t}\n\t};\n\n\tforEachSegment(line, expandPlainText, escape => {\n\t\texpandedLine += escape;\n\t});\n\n\treturn expandedLine;\n};\n\n// Close the active styles and hyperlink before every row break and reopen them after, so each row stands on its own.\n// Only sequences and newlines matter here, so the string is scanned directly rather than split into grapheme clusters.\nconst restoreStylesAcrossRows = preString => {\n\tlet returnValue = '';\n\tlet activeHyperlink;\n\tconst activeStyles = [];\n\tlet index = 0;\n\tlet copiedIndex = 0;\n\n\twhile (index < preString.length) {\n\t\tROW_BOUNDARY_REGEX.lastIndex = index;\n\t\tconst boundary = ROW_BOUNDARY_REGEX.exec(preString);\n\n\t\tif (!boundary) {\n\t\t\tbreak;\n\t\t}\n\n\t\tindex = boundary.index;\n\n\t\tif (boundary[0] !== '\\n') {\n\t\t\tconst escape = matchAnsiEscape(preString, index);\n\n\t\t\tif (!escape) {\n\t\t\t\tindex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst {groups} = escape;\n\t\t\tif (groups.sgr !== undefined) {\n\t\t\t\tapplySgrParameters(groups.sgr, activeStyles);\n\t\t\t} else if (groups.uri !== undefined) {\n\t\t\t\tactiveHyperlink = groups.uri.length === 0 ? undefined : {parameters: groups.parameters, uri: groups.uri};\n\t\t\t}\n\n\t\t\tindex += escape[0].length;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Everything up to the row break is copied verbatim, sequences included.\n\t\treturnValue += preString.slice(copiedIndex, index);\n\n\t\t// An empty row never reopened anything, so there is nothing to close.\n\t\tif (index > copiedIndex) {\n\t\t\tif (activeHyperlink) {\n\t\t\t\treturnValue += wrapAnsiHyperlink('');\n\t\t\t}\n\n\t\t\treturnValue += getClosingSgrSequence(activeStyles);\n\t\t}\n\n\t\treturnValue += '\\n';\n\t\tindex++;\n\t\tcopiedIndex = index;\n\n\t\t// An empty row has nothing to style, so the styles stay closed until the next row with content. A trailing row break leaves no row at all.\n\t\tif (index < preString.length && preString[index] !== '\\n') {\n\t\t\tconst openingStyles = [...activeStyles];\n\t\t\tapplyLeadingSgrResets(preString, index, openingStyles);\n\t\t\treturnValue += getOpeningSgrSequence(openingStyles);\n\n\t\t\tif (activeHyperlink) {\n\t\t\t\treturnValue += wrapAnsiHyperlink(activeHyperlink.uri, activeHyperlink.parameters);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnValue + preString.slice(copiedIndex);\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode.\n//\n// 'hard' will never allow a string to take up more than columns characters.\n//\n// 'soft' allows long words to expand past the column length.\nconst exec = (string, columns, options = {}) => {\n\tif (options.trim !== false && string.trim() === '') {\n\t\treturn '';\n\t}\n\n\tconst words = splitWords(string);\n\tlet rows = [''];\n\t// Tracked as rows are built. Remeasuring the row for every word makes wrapping quadratic in the line length.\n\tlet rowLength = 0;\n\t// Words are only ever appended, so a row that already starts with content can never become trimmable again. Retrimming it for every word makes wrapping quadratic in the line length.\n\tlet trimmedRowIndex = -1;\n\n\tlet isFirstWord = true;\n\n\tfor (const word of words) {\n\t\tconst rowIndex = rows.length - 1;\n\n\t\tif (options.trim !== false && trimmedRowIndex !== rowIndex) {\n\t\t\tconst row = rows[rowIndex];\n\t\t\tconst trimmedRow = row.trimStart();\n\n\t\t\tif (trimmedRow.length !== row.length) {\n\t\t\t\trows[rowIndex] = trimmedRow;\n\t\t\t\trowLength = getWidth(trimmedRow);\n\t\t\t}\n\n\t\t\tif (trimmedRow.length > 0) {\n\t\t\t\ttrimmedRowIndex = rowIndex;\n\t\t\t}\n\t\t}\n\n\t\tif (isFirstWord) {\n\t\t\tisFirstWord = false;\n\t\t} else {\n\t\t\tif (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {\n\t\t\t\t// If we start with a new word but the current row length equals the length of the columns, add a new row\n\t\t\t\trows.push('');\n\t\t\t\trowLength = 0;\n\t\t\t}\n\n\t\t\tif (rowLength > 0 || options.trim === false) {\n\t\t\t\trows[rows.length - 1] += ' ';\n\t\t\t\trowLength++;\n\t\t\t}\n\t\t}\n\n\t\t// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n\t\tif (options.hard && options.wordWrap !== false && word.width > columns) {\n\t\t\tconst remainingColumns = columns - rowLength;\n\t\t\tconst breaksStartingThisLine = 1 + Math.floor((word.width - remainingColumns - 1) / columns);\n\t\t\tconst breaksStartingNextLine = Math.floor((word.width - 1) / columns);\n\t\t\tif (breaksStartingNextLine < breaksStartingThisLine) {\n\t\t\t\trows.push('');\n\t\t\t\trowLength = 0;\n\t\t\t}\n\n\t\t\trowLength = wrapWord(rows, word.value, columns, rowLength);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (rowLength + word.width > columns && rowLength > 0 && word.width > 0) {\n\t\t\tif (options.wordWrap === false && rowLength < columns) {\n\t\t\t\trowLength = wrapWord(rows, word.value, columns, rowLength);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trows.push('');\n\t\t\trowLength = 0;\n\t\t}\n\n\t\tif (rowLength + word.width > columns && options.wordWrap === false) {\n\t\t\trowLength = wrapWord(rows, word.value, columns, rowLength);\n\t\t\tcontinue;\n\t\t}\n\n\t\trows[rows.length - 1] += word.value;\n\t\trowLength += word.width;\n\t}\n\n\tif (options.trim !== false) {\n\t\trows = rows.map(row => stringVisibleTrimSpacesRight(row));\n\t}\n\n\treturn restoreStylesAcrossRows(rows.join('\\n'));\n};\n\n// Normalize the text, but not the sequences: a combining mark that follows a sequence composes with its last character and destroys it.\nconst normalizeText = string => {\n\tlet normalizedString = '';\n\n\tforEachSegment(string, plainText => {\n\t\tnormalizedString += plainText.normalize();\n\t}, escape => {\n\t\tnormalizedString += escape;\n\t});\n\n\treturn normalizedString;\n};\n\n// For each newline, invoke the method separately.\nexport default function wrapAnsi(string, columns, options) {\n\treturn normalizeText(String(string))\n\t\t.replaceAll('\\r\\n', '\\n')\n\t\t.split('\\n')\n\t\t.map(line => exec(expandTabs(line), columns, options))\n\t\t.join('\\n');\n}\n","import {\n\t_isFullWidth as isFullWidth,\n\t_isWide as isWide,\n} from 'get-east-asian-width';\n\nexport default function isFullwidthCodePoint(codePoint) {\n\tif (!Number.isInteger(codePoint)) {\n\t\treturn false;\n\t}\n\n\treturn isFullWidth(codePoint) || isWide(codePoint);\n}\n","import ansiStyles from 'ansi-styles';\nimport isFullwidthCodePoint from 'is-fullwidth-code-point';\n\nconst ESCAPE_CODE_POINT = 27;\nconst C1_DCS_CODE_POINT = 144;\nconst C1_SOS_CODE_POINT = 152;\nconst C1_CSI_CODE_POINT = 155;\nconst C1_ST_CODE_POINT = 156;\nconst C1_OSC_CODE_POINT = 157;\nconst C1_PM_CODE_POINT = 158;\nconst C1_APC_CODE_POINT = 159;\nconst ESCAPES = new Set([\n\tESCAPE_CODE_POINT,\n\tC1_DCS_CODE_POINT,\n\tC1_SOS_CODE_POINT,\n\tC1_CSI_CODE_POINT,\n\tC1_ST_CODE_POINT,\n\tC1_OSC_CODE_POINT,\n\tC1_PM_CODE_POINT,\n\tC1_APC_CODE_POINT,\n]);\n\nconst ESCAPE = '\\u001B';\nconst ANSI_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_DCS = 'P';\nconst ANSI_SOS = 'X';\nconst ANSI_PM = '^';\nconst ANSI_APC = '_';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_OSC_TERMINATOR = '\\\\';\nconst ANSI_STRING_TERMINATOR = `${ESCAPE}${ANSI_OSC_TERMINATOR}`;\nconst C1_OSC = '\\u009D';\nconst C1_STRING_TERMINATOR = '\\u009C';\nconst ANSI_HYPERLINK_ESC_PREFIX = `${ESCAPE}${ANSI_OSC}8;`;\nconst ANSI_HYPERLINK_C1_PREFIX = `${C1_OSC}8;`;\nconst ANSI_HYPERLINK_ESC_CLOSE = `${ANSI_HYPERLINK_ESC_PREFIX};`;\nconst ANSI_HYPERLINK_C1_CLOSE = `${ANSI_HYPERLINK_C1_PREFIX};`;\n\nconst CODE_POINT_0 = '0'.codePointAt(0);\nconst CODE_POINT_9 = '9'.codePointAt(0);\nconst CODE_POINT_SEMICOLON = ';'.codePointAt(0);\nconst CODE_POINT_COLON = ':'.codePointAt(0);\n// ECMA-48 CSI format: parameter bytes 0x30-0x3F, intermediates 0x20-0x2F, final 0x40-0x7E.\nconst CODE_POINT_CSI_PARAMETER_START = '0'.codePointAt(0);\nconst CODE_POINT_CSI_PARAMETER_END = '?'.codePointAt(0);\nconst CODE_POINT_CSI_INTERMEDIATE_START = ' '.codePointAt(0);\nconst CODE_POINT_CSI_INTERMEDIATE_END = '/'.codePointAt(0);\nconst CODE_POINT_CSI_FINAL_START = '@'.codePointAt(0);\nconst CODE_POINT_CSI_FINAL_END = '~'.codePointAt(0);\nconst REGIONAL_INDICATOR_SYMBOL_LETTER_A = 127_462;\nconst REGIONAL_INDICATOR_SYMBOL_LETTER_Z = 127_487;\nconst SGR_RESET_CODE = 0;\nconst SGR_EXTENDED_FOREGROUND_CODE = 38;\nconst SGR_DEFAULT_FOREGROUND_CODE = 39;\nconst SGR_EXTENDED_BACKGROUND_CODE = 48;\nconst SGR_DEFAULT_BACKGROUND_CODE = 49;\nconst SGR_COLOR_TYPE_ANSI_256 = 5;\nconst SGR_COLOR_TYPE_TRUECOLOR = 2;\nconst SGR_ANSI_256_FRAGMENT_LENGTH = 3;\nconst SGR_TRUECOLOR_FRAGMENT_LENGTH = 5;\nconst SGR_ANSI_256_LAST_PARAMETER_OFFSET = 2;\nconst SGR_TRUECOLOR_LAST_PARAMETER_OFFSET = 4;\nconst VARIATION_SELECTOR_16_CODE_POINT = 65_039;\nconst COMBINING_ENCLOSING_KEYCAP_CODE_POINT = 8419;\nconst EMOJI_PRESENTATION_GRAPHEME_REGEX = /\\p{Emoji_Presentation}/v;\nconst GRAPHEME_SEGMENTER = new Intl.Segmenter(undefined, {granularity: 'grapheme'});\n\nconst endCodeNumbers = new Set();\nfor (const [, end] of ansiStyles.codes) {\n\tendCodeNumbers.add(end);\n}\n\nfunction isSgrParameterCharacter(codePoint) {\n\treturn (\n\t\t(codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9)\n\t\t|| codePoint === CODE_POINT_SEMICOLON\n\t\t|| codePoint === CODE_POINT_COLON\n\t);\n}\n\nfunction isCsiParameterCharacter(codePoint) {\n\treturn codePoint >= CODE_POINT_CSI_PARAMETER_START && codePoint <= CODE_POINT_CSI_PARAMETER_END;\n}\n\nfunction isCsiIntermediateCharacter(codePoint) {\n\treturn codePoint >= CODE_POINT_CSI_INTERMEDIATE_START && codePoint <= CODE_POINT_CSI_INTERMEDIATE_END;\n}\n\nfunction isCsiFinalCharacter(codePoint) {\n\treturn codePoint >= CODE_POINT_CSI_FINAL_START && codePoint <= CODE_POINT_CSI_FINAL_END;\n}\n\nfunction isRegionalIndicatorCodePoint(codePoint) {\n\treturn codePoint >= REGIONAL_INDICATOR_SYMBOL_LETTER_A && codePoint <= REGIONAL_INDICATOR_SYMBOL_LETTER_Z;\n}\n\nfunction createControlParseResult(code, endIndex) {\n\treturn {\n\t\ttoken: {\n\t\t\ttype: 'control',\n\t\t\tcode,\n\t\t},\n\t\tendIndex,\n\t};\n}\n\nfunction isEmojiStyleGrapheme(grapheme) {\n\tif (EMOJI_PRESENTATION_GRAPHEME_REGEX.test(grapheme)) {\n\t\treturn true;\n\t}\n\n\tfor (const character of grapheme) {\n\t\tconst codePoint = character.codePointAt(0);\n\t\tif (\n\t\t\tcodePoint === VARIATION_SELECTOR_16_CODE_POINT\n\t\t\t|| codePoint === COMBINING_ENCLOSING_KEYCAP_CODE_POINT\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nfunction getGraphemeWidth(grapheme) {\n\tlet regionalIndicatorCount = 0;\n\tfor (const character of grapheme) {\n\t\tconst codePoint = character.codePointAt(0);\n\t\tif (isFullwidthCodePoint(codePoint)) {\n\t\t\treturn 2;\n\t\t}\n\n\t\tif (isRegionalIndicatorCodePoint(codePoint)) {\n\t\t\tregionalIndicatorCount++;\n\t\t}\n\t}\n\n\tif (regionalIndicatorCount >= 1) {\n\t\treturn 2;\n\t}\n\n\tif (isEmojiStyleGrapheme(grapheme)) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\nfunction getSgrPrefix(code) {\n\tif (code.startsWith('\\u009B')) {\n\t\treturn '\\u009B';\n\t}\n\n\treturn `${ESCAPE}${ANSI_CSI}`;\n}\n\nfunction createSgrCode(prefix, values) {\n\treturn `${prefix}${values.join(';')}${ANSI_SGR_TERMINATOR}`;\n}\n\nfunction getSgrFragments(code) {\n\tconst fragments = [];\n\tconst sgrPrefix = getSgrPrefix(code);\n\tlet parameterString;\n\n\tif (code.startsWith(`${ESCAPE}${ANSI_CSI}`)) {\n\t\tparameterString = code.slice(2, -1);\n\t} else if (code.startsWith('\\u009B')) {\n\t\tparameterString = code.slice(1, -1);\n\t} else {\n\t\treturn fragments;\n\t}\n\n\tconst rawCodes = parameterString.length === 0 ? [String(SGR_RESET_CODE)] : parameterString.split(';');\n\tlet index = 0;\n\twhile (index < rawCodes.length) {\n\t\tconst codeNumber = Number.parseInt(rawCodes[index], 10);\n\t\tif (Number.isNaN(codeNumber)) {\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (codeNumber === SGR_RESET_CODE) {\n\t\t\tfragments.push({type: 'reset'});\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (codeNumber === SGR_EXTENDED_FOREGROUND_CODE || codeNumber === SGR_EXTENDED_BACKGROUND_CODE) {\n\t\t\tconst colorType = Number.parseInt(rawCodes[index + 1], 10);\n\t\t\tif (colorType === SGR_COLOR_TYPE_ANSI_256 && index + SGR_ANSI_256_LAST_PARAMETER_OFFSET < rawCodes.length) {\n\t\t\t\tconst openCode = createSgrCode(sgrPrefix, rawCodes.slice(index, index + SGR_ANSI_256_FRAGMENT_LENGTH));\n\t\t\t\tfragments.push({\n\t\t\t\t\ttype: 'start',\n\t\t\t\t\tcode: openCode,\n\t\t\t\t\tendCode: ansiStyles.color.ansi(codeNumber === SGR_EXTENDED_FOREGROUND_CODE ? SGR_DEFAULT_FOREGROUND_CODE : SGR_DEFAULT_BACKGROUND_CODE),\n\t\t\t\t});\n\t\t\t\tindex += SGR_ANSI_256_FRAGMENT_LENGTH;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (colorType === SGR_COLOR_TYPE_TRUECOLOR && index + SGR_TRUECOLOR_LAST_PARAMETER_OFFSET < rawCodes.length) {\n\t\t\t\tconst openCode = createSgrCode(sgrPrefix, rawCodes.slice(index, index + SGR_TRUECOLOR_FRAGMENT_LENGTH));\n\t\t\t\tfragments.push({\n\t\t\t\t\ttype: 'start',\n\t\t\t\t\tcode: openCode,\n\t\t\t\t\tendCode: ansiStyles.color.ansi(codeNumber === SGR_EXTENDED_FOREGROUND_CODE ? SGR_DEFAULT_FOREGROUND_CODE : SGR_DEFAULT_BACKGROUND_CODE),\n\t\t\t\t});\n\t\t\t\tindex += SGR_TRUECOLOR_FRAGMENT_LENGTH;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst openCode = createSgrCode(sgrPrefix, [rawCodes[index]]);\n\t\t\tfragments.push({\n\t\t\t\ttype: 'start',\n\t\t\t\tcode: openCode,\n\t\t\t\tendCode: ansiStyles.color.ansi(codeNumber === SGR_EXTENDED_FOREGROUND_CODE ? SGR_DEFAULT_FOREGROUND_CODE : SGR_DEFAULT_BACKGROUND_CODE),\n\t\t\t});\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (endCodeNumbers.has(codeNumber)) {\n\t\t\tfragments.push({\n\t\t\t\ttype: 'end',\n\t\t\t\tendCode: ansiStyles.color.ansi(codeNumber),\n\t\t\t});\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst mappedEndCode = ansiStyles.codes.get(codeNumber);\n\t\tif (mappedEndCode !== undefined) {\n\t\t\tconst openCode = createSgrCode(sgrPrefix, [rawCodes[index]]);\n\t\t\tfragments.push({\n\t\t\t\ttype: 'start',\n\t\t\t\tcode: openCode,\n\t\t\t\tendCode: ansiStyles.color.ansi(mappedEndCode),\n\t\t\t});\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst openCode = createSgrCode(sgrPrefix, [rawCodes[index]]);\n\t\tfragments.push({\n\t\t\ttype: 'start',\n\t\t\tcode: openCode,\n\t\t\tendCode: ansiStyles.reset.open,\n\t\t});\n\t\tindex++;\n\t}\n\n\tif (fragments.length === 0) {\n\t\tfragments.push({type: 'reset'});\n\t}\n\n\treturn fragments;\n}\n\nfunction parseCsiCode(string, index) {\n\tconst escapeCodePoint = string.codePointAt(index);\n\tlet sequenceStartIndex;\n\n\tif (escapeCodePoint === ESCAPE_CODE_POINT) {\n\t\tif (string[index + 1] !== ANSI_CSI) {\n\t\t\treturn;\n\t\t}\n\n\t\tsequenceStartIndex = index + 2;\n\t} else if (escapeCodePoint === C1_CSI_CODE_POINT) {\n\t\tsequenceStartIndex = index + 1;\n\t} else {\n\t\treturn;\n\t}\n\n\tlet hasCanonicalSgrParameters = true;\n\tfor (let sequenceIndex = sequenceStartIndex; sequenceIndex < string.length; sequenceIndex++) {\n\t\tconst codePoint = string.codePointAt(sequenceIndex);\n\n\t\tif (isCsiFinalCharacter(codePoint)) {\n\t\t\tconst code = string.slice(index, sequenceIndex + 1);\n\t\t\tif (string[sequenceIndex] !== ANSI_SGR_TERMINATOR || !hasCanonicalSgrParameters) {\n\t\t\t\treturn createControlParseResult(code, sequenceIndex + 1);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttoken: {\n\t\t\t\t\ttype: 'sgr',\n\t\t\t\t\tcode,\n\t\t\t\t\tfragments: getSgrFragments(code),\n\t\t\t\t},\n\t\t\t\tendIndex: sequenceIndex + 1,\n\t\t\t};\n\t\t}\n\n\t\tif (isCsiParameterCharacter(codePoint)) {\n\t\t\tif (!isSgrParameterCharacter(codePoint)) {\n\t\t\t\thasCanonicalSgrParameters = false;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isCsiIntermediateCharacter(codePoint)) {\n\t\t\thasCanonicalSgrParameters = false;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst endIndex = sequenceIndex;\n\t\treturn createControlParseResult(string.slice(index, endIndex), endIndex);\n\t}\n\n\treturn createControlParseResult(string.slice(index), string.length);\n}\n\nfunction parseHyperlinkCode(string, index) {\n\tlet hyperlinkPrefix;\n\tlet hyperlinkClose;\n\tconst codePoint = string.codePointAt(index);\n\n\tif (\n\t\tcodePoint === ESCAPE_CODE_POINT\n\t\t&& string.startsWith(ANSI_HYPERLINK_ESC_PREFIX, index)\n\t) {\n\t\thyperlinkPrefix = ANSI_HYPERLINK_ESC_PREFIX;\n\t\thyperlinkClose = ANSI_HYPERLINK_ESC_CLOSE;\n\t} else if (\n\t\tcodePoint === C1_OSC_CODE_POINT\n\t\t&& string.startsWith(ANSI_HYPERLINK_C1_PREFIX, index)\n\t) {\n\t\thyperlinkPrefix = ANSI_HYPERLINK_C1_PREFIX;\n\t\thyperlinkClose = ANSI_HYPERLINK_C1_CLOSE;\n\t} else {\n\t\treturn;\n\t}\n\n\tconst uriStart = string.indexOf(';', index + hyperlinkPrefix.length);\n\tif (uriStart === -1) {\n\t\treturn createControlParseResult(string.slice(index), string.length);\n\t}\n\n\tfor (let sequenceIndex = uriStart + 1; sequenceIndex < string.length; sequenceIndex++) {\n\t\tconst character = string[sequenceIndex];\n\n\t\tif (character === ANSI_BELL) {\n\t\t\tconst code = string.slice(index, sequenceIndex + 1);\n\t\t\tconst action = sequenceIndex === uriStart + 1 ? 'close' : 'open';\n\t\t\treturn {\n\t\t\t\ttoken: {\n\t\t\t\t\ttype: 'hyperlink',\n\t\t\t\t\tcode,\n\t\t\t\t\taction,\n\t\t\t\t\tclosePrefix: hyperlinkClose,\n\t\t\t\t\tterminator: ANSI_BELL,\n\t\t\t\t},\n\t\t\t\tendIndex: sequenceIndex + 1,\n\t\t\t};\n\t\t}\n\n\t\tif (\n\t\t\tcharacter === ESCAPE\n\t\t\t&& string[sequenceIndex + 1] === ANSI_OSC_TERMINATOR\n\t\t) {\n\t\t\tconst code = string.slice(index, sequenceIndex + 2);\n\t\t\tconst action = sequenceIndex === uriStart + 1 ? 'close' : 'open';\n\t\t\treturn {\n\t\t\t\ttoken: {\n\t\t\t\t\ttype: 'hyperlink',\n\t\t\t\t\tcode,\n\t\t\t\t\taction,\n\t\t\t\t\tclosePrefix: hyperlinkClose,\n\t\t\t\t\tterminator: ANSI_STRING_TERMINATOR,\n\t\t\t\t},\n\t\t\t\tendIndex: sequenceIndex + 2,\n\t\t\t};\n\t\t}\n\n\t\tif (character === C1_STRING_TERMINATOR) {\n\t\t\tconst code = string.slice(index, sequenceIndex + 1);\n\t\t\tconst action = sequenceIndex === uriStart + 1 ? 'close' : 'open';\n\t\t\treturn {\n\t\t\t\ttoken: {\n\t\t\t\t\ttype: 'hyperlink',\n\t\t\t\t\tcode,\n\t\t\t\t\taction,\n\t\t\t\t\tclosePrefix: hyperlinkClose,\n\t\t\t\t\tterminator: C1_STRING_TERMINATOR,\n\t\t\t\t},\n\t\t\t\tendIndex: sequenceIndex + 1,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn createControlParseResult(string.slice(index), string.length);\n}\n\nfunction parseControlStringCode(string, index) {\n\tconst codePoint = string.codePointAt(index);\n\tlet sequenceStartIndex;\n\tlet supportsBellTerminator = false;\n\n\tswitch (codePoint) {\n\t\tcase ESCAPE_CODE_POINT: {\n\t\t\tconst command = string[index + 1];\n\t\t\tswitch (command) {\n\t\t\t\tcase ANSI_OSC: {\n\t\t\t\t\t// OSC accepts ST (ECMA-48) and BEL (xterm compatibility extension).\n\t\t\t\t\tsequenceStartIndex = index + 2;\n\t\t\t\t\tsupportsBellTerminator = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase ANSI_DCS:\n\t\t\t\tcase ANSI_SOS:\n\t\t\t\tcase ANSI_PM:\n\t\t\t\tcase ANSI_APC: {\n\t\t\t\t\tsequenceStartIndex = index + 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase ANSI_OSC_TERMINATOR: {\n\t\t\t\t\treturn createControlParseResult(ANSI_STRING_TERMINATOR, index + 2);\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase C1_OSC_CODE_POINT: {\n\t\t\tsequenceStartIndex = index + 1;\n\t\t\tsupportsBellTerminator = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase C1_DCS_CODE_POINT:\n\t\tcase C1_SOS_CODE_POINT:\n\t\tcase C1_PM_CODE_POINT:\n\t\tcase C1_APC_CODE_POINT: {\n\t\t\tsequenceStartIndex = index + 1;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase C1_ST_CODE_POINT: {\n\t\t\treturn createControlParseResult(C1_STRING_TERMINATOR, index + 1);\n\t\t}\n\n\t\tdefault: {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tfor (let sequenceIndex = sequenceStartIndex; sequenceIndex < string.length; sequenceIndex++) {\n\t\tif (supportsBellTerminator && string[sequenceIndex] === ANSI_BELL) {\n\t\t\treturn createControlParseResult(string.slice(index, sequenceIndex + 1), sequenceIndex + 1);\n\t\t}\n\n\t\tif (\n\t\t\tstring[sequenceIndex] === ESCAPE\n\t\t\t&& string[sequenceIndex + 1] === ANSI_OSC_TERMINATOR\n\t\t) {\n\t\t\treturn createControlParseResult(string.slice(index, sequenceIndex + 2), sequenceIndex + 2);\n\t\t}\n\n\t\tif (string[sequenceIndex] === C1_STRING_TERMINATOR) {\n\t\t\treturn createControlParseResult(string.slice(index, sequenceIndex + 1), sequenceIndex + 1);\n\t\t}\n\t}\n\n\treturn createControlParseResult(string.slice(index), string.length);\n}\n\nfunction parseAnsiCode(string, index) {\n\tconst codePoint = string.codePointAt(index);\n\tif (codePoint === ESCAPE_CODE_POINT || codePoint === C1_OSC_CODE_POINT) {\n\t\tconst hyperlinkCode = parseHyperlinkCode(string, index);\n\t\tif (hyperlinkCode) {\n\t\t\treturn hyperlinkCode;\n\t\t}\n\t}\n\n\tconst controlStringCode = parseControlStringCode(string, index);\n\tif (controlStringCode) {\n\t\treturn controlStringCode;\n\t}\n\n\treturn parseCsiCode(string, index);\n}\n\nfunction appendTrailingAnsiTokens(string, index, tokens) {\n\twhile (index < string.length) {\n\t\tconst nextCodePoint = string.codePointAt(index);\n\t\tif (!ESCAPES.has(nextCodePoint)) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst escapeCode = parseAnsiCode(string, index);\n\t\tif (!escapeCode) {\n\t\t\tbreak;\n\t\t}\n\n\t\ttokens.push(escapeCode.token);\n\t\tindex = escapeCode.endIndex;\n\t}\n\n\treturn index;\n}\n\nfunction parseCharacterTokenWithRawSegmentation(string, index, graphemeSegments) {\n\tconst segment = graphemeSegments.containing(index);\n\tif (!segment || segment.index !== index) {\n\t\treturn;\n\t}\n\n\treturn {\n\t\ttoken: {\n\t\t\ttype: 'character',\n\t\t\t// Intentionally preserve UAX29 behavior (GB3): CRLF is one grapheme cluster.\n\t\t\tvalue: segment.segment,\n\t\t\tvisibleWidth: getGraphemeWidth(segment.segment),\n\t\t\tisGraphemeContinuation: false,\n\t\t},\n\t\tendIndex: index + segment.segment.length,\n\t};\n}\n\nfunction collectVisibleCharacters(string) {\n\tconst visibleCharacters = [];\n\tlet index = 0;\n\n\twhile (index < string.length) {\n\t\tconst codePoint = string.codePointAt(index);\n\t\tif (ESCAPES.has(codePoint)) {\n\t\t\tconst code = parseAnsiCode(string, index);\n\t\t\tif (code) {\n\t\t\t\tindex = code.endIndex;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst value = String.fromCodePoint(codePoint);\n\t\tvisibleCharacters.push({\n\t\t\tvalue,\n\t\t\tvisibleWidth: 1,\n\t\t\tisGraphemeContinuation: false,\n\t\t});\n\t\tindex += value.length;\n\t}\n\n\treturn visibleCharacters;\n}\n\nfunction applyGraphemeMetadata(visibleCharacters) {\n\tif (visibleCharacters.length === 0) {\n\t\treturn;\n\t}\n\n\tconst visibleString = visibleCharacters.map(({value}) => value).join('');\n\tconst scalarOffsets = [];\n\tlet scalarOffset = 0;\n\n\tfor (const visibleCharacter of visibleCharacters) {\n\t\tscalarOffsets.push(scalarOffset);\n\t\tscalarOffset += visibleCharacter.value.length;\n\t}\n\n\tlet scalarIndex = 0;\n\tfor (const segment of GRAPHEME_SEGMENTER.segment(visibleString)) {\n\t\twhile (\n\t\t\tscalarIndex < visibleCharacters.length\n\t\t\t&& scalarOffsets[scalarIndex] < segment.index\n\t\t) {\n\t\t\tscalarIndex++;\n\t\t}\n\n\t\tlet graphemeIndex = scalarIndex;\n\t\tlet isFirstInGrapheme = true;\n\t\twhile (\n\t\t\tgraphemeIndex < visibleCharacters.length\n\t\t\t&& scalarOffsets[graphemeIndex] < segment.index + segment.segment.length\n\t\t) {\n\t\t\tvisibleCharacters[graphemeIndex].visibleWidth = isFirstInGrapheme ? getGraphemeWidth(segment.segment) : 0;\n\t\t\tvisibleCharacters[graphemeIndex].isGraphemeContinuation = !isFirstInGrapheme;\n\t\t\tisFirstInGrapheme = false;\n\t\t\tgraphemeIndex++;\n\t\t}\n\n\t\tscalarIndex = graphemeIndex;\n\t}\n}\n\nfunction tokenizeAnsiWithVisibleSegmentation(string, {endCharacter = Number.POSITIVE_INFINITY} = {}) {\n\tconst tokens = [];\n\tconst visibleCharacters = collectVisibleCharacters(string);\n\tapplyGraphemeMetadata(visibleCharacters);\n\n\tlet index = 0;\n\tlet visibleCharacterIndex = 0;\n\tlet visibleCount = 0;\n\twhile (index < string.length) {\n\t\tconst codePoint = string.codePointAt(index);\n\n\t\tif (ESCAPES.has(codePoint)) {\n\t\t\tconst code = parseAnsiCode(string, index);\n\t\t\tif (code) {\n\t\t\t\ttokens.push(code.token);\n\t\t\t\tindex = code.endIndex;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst value = String.fromCodePoint(codePoint);\n\t\tconst visibleCharacter = visibleCharacters[visibleCharacterIndex];\n\t\tlet visibleWidth = isFullwidthCodePoint(codePoint) ? 2 : value.length;\n\t\tif (visibleCharacter) {\n\t\t\tvisibleWidth = visibleCharacter.visibleWidth;\n\t\t}\n\n\t\tconst token = {\n\t\t\ttype: 'character',\n\t\t\tvalue,\n\t\t\tvisibleWidth,\n\t\t\tisGraphemeContinuation: visibleCharacter ? visibleCharacter.isGraphemeContinuation : false,\n\t\t};\n\n\t\ttokens.push(token);\n\t\tindex += value.length;\n\t\tvisibleCharacterIndex++;\n\t\tvisibleCount += token.visibleWidth;\n\n\t\tif (visibleCount >= endCharacter) {\n\t\t\tconst nextVisibleCharacter = visibleCharacters[visibleCharacterIndex];\n\t\t\tif (\n\t\t\t\t!nextVisibleCharacter\n\t\t\t\t|| !nextVisibleCharacter.isGraphemeContinuation\n\t\t\t) {\n\t\t\t\tindex = appendTrailingAnsiTokens(string, index, tokens);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn tokens;\n}\n\nfunction areValuesInSameGrapheme(leftValue, rightValue) {\n\tconst pair = `${leftValue}${rightValue}`;\n\tconst splitIndex = leftValue.length;\n\n\tfor (const segment of GRAPHEME_SEGMENTER.segment(pair)) {\n\t\tif (segment.index === splitIndex) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (segment.index > splitIndex) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction hasAnsiSplitContinuationAhead(string, startIndex, previousVisibleValue, graphemeSegments) {\n\tif (!previousVisibleValue) {\n\t\treturn false;\n\t}\n\n\tlet index = startIndex;\n\tlet hasAnsiCode = false;\n\twhile (index < string.length) {\n\t\tconst codePoint = string.codePointAt(index);\n\t\tif (ESCAPES.has(codePoint)) {\n\t\t\tconst code = parseAnsiCode(string, index);\n\t\t\tif (code) {\n\t\t\t\thasAnsiCode = true;\n\t\t\t\tindex = code.endIndex;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasAnsiCode) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst characterToken = parseCharacterTokenWithRawSegmentation(string, index, graphemeSegments);\n\t\tif (!characterToken) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn areValuesInSameGrapheme(previousVisibleValue, characterToken.token.value);\n\t}\n\n\treturn false;\n}\n\nexport default function tokenizeAnsi(string, {endCharacter = Number.POSITIVE_INFINITY} = {}) {\n\tconst tokens = [];\n\tconst graphemeSegments = GRAPHEME_SEGMENTER.segment(string);\n\n\tlet index = 0;\n\tlet visibleCount = 0;\n\tlet previousVisibleValue;\n\tlet hasAnsiSinceLastVisible = false;\n\twhile (index < string.length) {\n\t\tconst codePoint = string.codePointAt(index);\n\n\t\tif (ESCAPES.has(codePoint)) {\n\t\t\tconst code = parseAnsiCode(string, index);\n\t\t\tif (code) {\n\t\t\t\ttokens.push(code.token);\n\t\t\t\tindex = code.endIndex;\n\t\t\t\thasAnsiSinceLastVisible = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tconst characterToken = parseCharacterTokenWithRawSegmentation(string, index, graphemeSegments);\n\t\tif (!characterToken) {\n\t\t\treturn tokenizeAnsiWithVisibleSegmentation(string, {endCharacter});\n\t\t}\n\n\t\tif (\n\t\t\thasAnsiSinceLastVisible\n\t\t\t&& previousVisibleValue\n\t\t\t&& areValuesInSameGrapheme(previousVisibleValue, characterToken.token.value)\n\t\t) {\n\t\t\treturn tokenizeAnsiWithVisibleSegmentation(string, {endCharacter});\n\t\t}\n\n\t\ttokens.push(characterToken.token);\n\t\tindex = characterToken.endIndex;\n\t\tvisibleCount += characterToken.token.visibleWidth;\n\t\thasAnsiSinceLastVisible = false;\n\t\tpreviousVisibleValue = characterToken.token.value;\n\n\t\tif (visibleCount >= endCharacter) {\n\t\t\tif (hasAnsiSplitContinuationAhead(string, index, previousVisibleValue, graphemeSegments)) {\n\t\t\t\treturn tokenizeAnsiWithVisibleSegmentation(string, {endCharacter});\n\t\t\t}\n\n\t\t\tindex = appendTrailingAnsiTokens(string, index, tokens);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn tokens;\n}\n","import tokenizeAnsi from './tokenize-ansi.js';\n\nfunction applySgrFragments(activeStyles, fragments) {\n\tfor (const fragment of fragments) {\n\t\tswitch (fragment.type) {\n\t\t\tcase 'reset': {\n\t\t\t\tactiveStyles.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'end': {\n\t\t\t\tactiveStyles.delete(fragment.endCode);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'start': {\n\t\t\t\tactiveStyles.delete(fragment.endCode);\n\t\t\t\tactiveStyles.set(fragment.endCode, fragment.code);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn activeStyles;\n}\n\nfunction undoAnsiCodes(activeStyles) {\n\treturn [...activeStyles.keys()].toReversed().join('');\n}\n\nfunction closeHyperlink(hyperlinkToken) {\n\treturn `${hyperlinkToken.closePrefix}${hyperlinkToken.terminator}`;\n}\n\nfunction shouldIncludeSgrAfterEnd(token, activeStyles) {\n\tlet hasStartFragment = false;\n\tlet hasClosingEffect = false;\n\n\tfor (const fragment of token.fragments) {\n\t\tif (fragment.type === 'start') {\n\t\t\thasStartFragment = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (fragment.type === 'reset' && activeStyles.size > 0) {\n\t\t\thasClosingEffect = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (fragment.type === 'end' && activeStyles.has(fragment.endCode)) {\n\t\t\thasClosingEffect = true;\n\t\t}\n\t}\n\n\treturn hasClosingEffect && !hasStartFragment;\n}\n\nfunction hasSgrStartFragment(token) {\n\treturn token.fragments.some(fragment => fragment.type === 'start');\n}\n\nfunction discardPendingHyperlink(state) {\n\tif (\n\t\tstate.activeHyperlink\n\t\t&& !state.activeHyperlinkHasVisibleText\n\t\t&& state.activeHyperlinkOutputIndex !== undefined\n\t) {\n\t\tconst openCodeLength = state.activeHyperlink.code.length;\n\t\tstate.returnValue = state.returnValue.slice(0, state.activeHyperlinkOutputIndex) + state.returnValue.slice(state.activeHyperlinkOutputIndex + openCodeLength);\n\n\t\tif (\n\t\t\tstate.pendingSgrOutputIndex !== undefined\n\t\t\t&& state.pendingSgrOutputIndex > state.activeHyperlinkOutputIndex\n\t\t) {\n\t\t\tstate.pendingSgrOutputIndex -= openCodeLength;\n\t\t}\n\t}\n\n\tstate.activeHyperlink = undefined;\n\tstate.activeHyperlinkHasVisibleText = false;\n\tstate.activeHyperlinkOutputIndex = undefined;\n}\n\nfunction settleActiveHyperlink(state) {\n\tif (state.activeHyperlinkHasVisibleText) {\n\t\tstate.returnValue += closeHyperlink(state.activeHyperlink);\n\t} else {\n\t\tdiscardPendingHyperlink(state);\n\t}\n}\n\nfunction applySgrToken(state) {\n\tif (\n\t\tstate.isPastEnd\n\t\t&& !shouldIncludeSgrAfterEnd(state.token, state.activeStyles)\n\t) {\n\t\treturn;\n\t}\n\n\tif (\n\t\tstate.include\n\t\t&& hasSgrStartFragment(state.token)\n\t\t&& state.pendingSgrOutputIndex === undefined\n\t) {\n\t\tstate.pendingSgrOutputIndex = state.returnValue.length;\n\t\tstate.pendingSgrActiveStyles = new Map(state.activeStyles);\n\t}\n\n\tstate.activeStyles = applySgrFragments(state.activeStyles, state.token.fragments);\n\tif (state.include) {\n\t\tstate.returnValue += state.token.code;\n\t}\n}\n\nfunction applyHyperlinkToken(state) {\n\tif (\n\t\tstate.isPastEnd\n\t\t&& (\n\t\t\tstate.token.action !== 'close'\n\t\t\t|| !state.activeHyperlink\n\t\t)\n\t) {\n\t\treturn;\n\t}\n\n\tif (state.token.action === 'open') {\n\t\t// OSC 8 has no nesting: a new open replaces the active link, so settle the previous one first.\n\t\tif (state.activeHyperlink) {\n\t\t\tsettleActiveHyperlink(state);\n\t\t}\n\n\t\tstate.activeHyperlink = state.token;\n\t\tstate.activeHyperlinkHasVisibleText = false;\n\t\tstate.activeHyperlinkOutputIndex = undefined;\n\t\tif (state.include) {\n\t\t\tstate.activeHyperlinkOutputIndex = state.returnValue.length;\n\t\t}\n\t} else if (state.token.action === 'close') {\n\t\tif (\n\t\t\tstate.include\n\t\t\t&& state.activeHyperlink\n\t\t\t&& !state.activeHyperlinkHasVisibleText\n\t\t) {\n\t\t\tdiscardPendingHyperlink(state);\n\t\t\treturn;\n\t\t}\n\n\t\tstate.activeHyperlink = undefined;\n\t\tstate.activeHyperlinkHasVisibleText = false;\n\t\tstate.activeHyperlinkOutputIndex = undefined;\n\t}\n\n\tif (state.include) {\n\t\tstate.returnValue += state.token.code;\n\t}\n}\n\nfunction applyControlToken(state) {\n\tif (!state.isPastEnd && state.include) {\n\t\tstate.returnValue += state.token.code;\n\t}\n}\n\nfunction applyCharacterToken(state) {\n\tif (\n\t\t!state.include\n\t\t&& state.position >= state.start\n\t\t&& !state.token.isGraphemeContinuation\n\t) {\n\t\tstate.include = true;\n\t\tstate.returnValue = [...state.activeStyles.values()].join('');\n\t\tif (state.activeHyperlink) {\n\t\t\tstate.activeHyperlinkOutputIndex = state.returnValue.length;\n\t\t\tstate.returnValue += state.activeHyperlink.code;\n\t\t}\n\t}\n\n\tif (state.include) {\n\t\tstate.returnValue += state.token.value;\n\t\tstate.pendingSgrOutputIndex = undefined;\n\t\tstate.pendingSgrActiveStyles = undefined;\n\t\tif (state.activeHyperlink) {\n\t\t\tstate.activeHyperlinkHasVisibleText = true;\n\t\t}\n\t}\n\n\tstate.position += state.token.visibleWidth;\n}\n\nconst tokenHandlers = {\n\tsgr: applySgrToken,\n\thyperlink: applyHyperlinkToken,\n\tcontrol: applyControlToken,\n\tcharacter: applyCharacterToken,\n};\n\nfunction applyToken(state) {\n\ttokenHandlers[state.token.type]?.(state);\n}\n\nfunction createHasContinuationAheadMap(tokens) {\n\tconst hasContinuationAhead = Array.from({length: tokens.length}, () => false);\n\tlet nextCharacterIsContinuation = false;\n\n\tfor (let tokenIndex = tokens.length - 1; tokenIndex >= 0; tokenIndex--) {\n\t\tconst token = tokens[tokenIndex];\n\t\thasContinuationAhead[tokenIndex] = nextCharacterIsContinuation;\n\t\tif (token.type === 'character') {\n\t\t\tnextCharacterIsContinuation = Boolean(token.isGraphemeContinuation);\n\t\t}\n\t}\n\n\treturn hasContinuationAhead;\n}\n\nfunction isPastEndBoundary(token, position, end) {\n\tif (end === undefined) {\n\t\treturn false;\n\t}\n\n\tif (position >= end) {\n\t\treturn true;\n\t}\n\n\treturn token.type === 'character'\n\t\t&& !token.isGraphemeContinuation\n\t\t&& position + token.visibleWidth > end;\n}\n\nexport default function sliceAnsi(string, start, end) {\n\tconst tokens = tokenizeAnsi(string, {endCharacter: end});\n\tconst hasContinuationAhead = createHasContinuationAheadMap(tokens);\n\tconst state = {\n\t\tstart,\n\t\ttoken: undefined,\n\t\tisPastEnd: false,\n\t\tactiveStyles: new Map(),\n\t\tactiveHyperlink: undefined,\n\t\tactiveHyperlinkHasVisibleText: false,\n\t\tactiveHyperlinkOutputIndex: undefined,\n\t\tpendingSgrOutputIndex: undefined,\n\t\tpendingSgrActiveStyles: undefined,\n\t\tposition: 0,\n\t\treturnValue: '',\n\t\tinclude: false,\n\t};\n\n\tfor (const [tokenIndex, token] of tokens.entries()) {\n\t\tlet isPastEnd = isPastEndBoundary(token, state.position, end);\n\t\tif (\n\t\t\tisPastEnd\n\t\t\t&& token.type !== 'character'\n\t\t\t&& hasContinuationAhead[tokenIndex]\n\t\t) {\n\t\t\tisPastEnd = false;\n\t\t}\n\n\t\tif (\n\t\t\tisPastEnd\n\t\t\t&& token.type === 'character'\n\t\t\t&& !token.isGraphemeContinuation\n\t\t) {\n\t\t\tif (state.activeHyperlink && !state.activeHyperlinkHasVisibleText) {\n\t\t\t\tdiscardPendingHyperlink(state);\n\t\t\t}\n\n\t\t\tif (state.pendingSgrOutputIndex !== undefined) {\n\t\t\t\tstate.returnValue = state.returnValue.slice(0, state.pendingSgrOutputIndex);\n\t\t\t\tstate.activeStyles = state.pendingSgrActiveStyles;\n\t\t\t\tstate.pendingSgrOutputIndex = undefined;\n\t\t\t\tstate.pendingSgrActiveStyles = undefined;\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tstate.token = token;\n\t\tstate.isPastEnd = isPastEnd;\n\t\tapplyToken(state);\n\t}\n\n\tif (!state.include) {\n\t\treturn '';\n\t}\n\n\tif (state.activeHyperlink) {\n\t\tsettleActiveHyperlink(state);\n\t}\n\n\t// Disable active codes at the end\n\tstate.returnValue += undoAnsiCodes(state.activeStyles);\n\n\treturn state.returnValue;\n}\n","import process from 'node:process';\nimport stringWidth from 'string-width';\nimport chalk from 'chalk';\nimport widestLine from 'widest-line';\nimport cliBoxes from 'cli-boxes';\nimport wrapAnsi from 'wrap-ansi';\nimport sliceAnsi from 'slice-ansi';\n\nconst NEWLINE = '\\n';\nconst PAD = ' ';\nconst NONE = 'none';\n\n// A text or a label is drawn inside a box, so every control that moves the cursor would break it\nconst LINE_BREAKS = /\\r\\n|[\\n\\v\\f\\r]/gv;\n\n/*\nA text, a label and a border are drawn inside the box, so a control that moves the cursor would break it.\nA style escape and a hyperlink are drawn with the text they wrap, every other escape is dropped, a tab is drawn as a single space, which is not the column it moves the cursor to but keeps the row as wide as it is measured, and a backspace overtypes the character before it.\n*/\nconst STYLING_ESCAPE = /^(?:\\u{1B}\\[[0-9:;]*m|\\u{1B}\\]8;[^\\u{0}-\\u{1F};\\u{7F}]*;[^\\u{0}-\\u{1F}\\u{7F}]*(?:\\u{7}|\\u{1B}\\\\))$/v;\nconst CONTROL_ESCAPE = /(\\u{1B}\\].*?(?:\\u{7}|\\u{1B}\\\\|$)|\\u{1B}\\[[\\u{20}-\\u{3F}]*[\\u{40}-\\u{7E}]|\\u{1B}[^\\u{7}\\u{5B}\\u{5D}]?)/gsv;\n\nconst writeControls = text => {\n\t// Escapes are the odd entries of the split, so a whole OSC is handled before any styling escape inside it\n\tconst parts = text.split(CONTROL_ESCAPE);\n\tconst characters = [];\n\n\tfor (const [index, part] of parts.entries()) {\n\t\tif (index % 2 === 1) { // A styling escape is written as one piece, so a backspace can not cut it\n\t\t\tif (STYLING_ESCAPE.test(part)) {\n\t\t\t\tcharacters.push(part);\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const character of part.replaceAll('\\t', ' ')) {\n\t\t\tif (character === '\\u{8}') {\n\t\t\t\t// A backspace overtypes the character before it, and an escape sequence is not drawn as a character\n\t\t\t\tconst previousIndex = characters.findLastIndex(previousCharacter => !previousCharacter.startsWith('\\u{1B}'));\n\n\t\t\t\tif (previousIndex !== -1 && characters[previousIndex] !== NEWLINE) {\n\t\t\t\t\tcharacters.splice(previousIndex, 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharacters.push(character);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn characters.join('');\n};\n\nconst terminalColumns = () => process.stdout?.columns\n\t|| process.stderr?.columns\n\t|| Number(process.env.COLUMNS)\n\t|| 80;\n\n// A terminal has no height when the output is not a terminal, and there is nothing to fill then\nconst terminalRows = () => process.stdout?.rows\n\t|| process.stderr?.rows\n\t|| Number(process.env.LINES);\n\nconst getObject = detail => {\n\tconst object = typeof detail === 'number'\n\t\t? {\n\t\t\ttop: detail,\n\t\t\tright: detail * 3,\n\t\t\tbottom: detail,\n\t\t\tleft: detail * 3,\n\t\t}\n\t\t: {\n\t\t\ttop: 0,\n\t\t\tright: 0,\n\t\t\tbottom: 0,\n\t\t\tleft: 0,\n\t\t\t...detail,\n\t\t};\n\n\t// A side has to be a finite non-negative whole number of columns, anything else means no spacing\n\tfor (const side of ['top', 'right', 'bottom', 'left']) {\n\t\tconst value = Number(object[side]);\n\t\tobject[side] = Number.isFinite(value) ? Math.max(0, Math.floor(value)) : 0;\n\t}\n\n\treturn object;\n};\n\n// The width of the border is the width of the sides it draws, and a side that draws nothing is drawn as a space\nconst getBorderWidth = borderStyle => {\n\tif (borderStyle === NONE) {\n\t\treturn 0;\n\t}\n\n\tconst {left, right} = getBorderChars(borderStyle);\n\n\treturn stringWidth(left || PAD) + stringWidth(right || PAD);\n};\n\n// The top and the bottom are drawn on a row of their own, whether the sides are empty or not\nconst getBorderHeight = borderStyle => borderStyle === NONE ? 0 : 2;\n\n// A size has to be a finite positive number, anything else means it is not set. The size is the space inside the border, so it can not be below 1.\n// The corners of a bar can be wider than its sides, and a label is drawn between them\nconst getCornerWidths = borderStyle => {\n\tconst {topLeft, topRight, bottomLeft, bottomRight} = getBorderChars(borderStyle);\n\n\treturn {\n\t\ttop: stringWidth(topLeft) + stringWidth(topRight),\n\t\tbottom: stringWidth(bottomLeft) + stringWidth(bottomRight),\n\t};\n};\n\nconst sanitizeSize = (size, borderWidth, minimum = 1) => {\n\tconst value = Number(size);\n\n\treturn Number.isFinite(value) && value > 0 ? Math.max(minimum, value - borderWidth) : undefined;\n};\n\n// Wrapping trims the whitespace at the edges of a line, so a line that fits is kept as it is\nconst wrapLine = (line, width) => stringWidth(line) > width ? wrapAnsi(line, width, {hard: true}) : line;\n\nconst isValidSize = size => {\n\tconst value = Number(size);\n\n\treturn Number.isFinite(value) && value > 0;\n};\n\n// Pad every line to `width`, so that the text can be aligned in the box. A line that is wider than that is not padded, so a row that overflows the box does not widen the rows that fit.\nconst alignText = (text, alignment, width) => {\n\tif (alignment === 'left') {\n\t\treturn text;\n\t}\n\n\treturn text.split(NEWLINE).map(line => {\n\t\tconst padding = Math.max(0, width - stringWidth(line));\n\n\t\treturn PAD.repeat(alignment === 'right' ? padding : Math.floor(padding / 2)) + line;\n\t}).join(NEWLINE);\n};\n\nconst getBorderChars = borderStyle => {\n\tconst sides = [\n\t\t'topLeft',\n\t\t'topRight',\n\t\t'bottomRight',\n\t\t'bottomLeft',\n\t\t'left',\n\t\t'right',\n\t\t'top',\n\t\t'bottom',\n\t];\n\n\tlet characters;\n\n\t// Create empty border style\n\tif (borderStyle === NONE) {\n\t\tborderStyle = Object.fromEntries(sides.map(side => [side, '']));\n\t}\n\n\tif (typeof borderStyle === 'string') {\n\t\t// The style has to be an own property, or an inherited name like `constructor` would pass as a style\n\t\tcharacters = Object.hasOwn(cliBoxes, borderStyle) ? cliBoxes[borderStyle] : undefined;\n\n\t\tif (!characters) {\n\t\t\tthrow new TypeError(`Invalid border style: ${borderStyle}`);\n\t\t}\n\t} else {\n\t\t/*\n\t\tEnsure retro-compatibility: `vertical` and `horizontal` are the deprecated names of the sides.\n\t\tThe style is copied, because the object belongs to the caller.\n\t\t*/\n\t\tborderStyle = {\n\t\t\t...borderStyle,\n\t\t\tleft: borderStyle?.left ?? borderStyle?.vertical,\n\t\t\tright: borderStyle?.right ?? borderStyle?.vertical,\n\t\t\ttop: borderStyle?.top ?? borderStyle?.horizontal,\n\t\t\tbottom: borderStyle?.bottom ?? borderStyle?.horizontal,\n\t\t};\n\n\t\tfor (const side of sides) {\n\t\t\tif (borderStyle[side] === null || typeof borderStyle[side] !== 'string') {\n\t\t\t\tthrow new TypeError(`Invalid border style: ${side}`);\n\t\t\t}\n\t\t}\n\n\t\tcharacters = borderStyle;\n\t}\n\n\t// A side is drawn inside the box as well, and it is a single row, so it is written the way a label is\n\treturn Object.fromEntries(sides.map(side => [side, writeControls(characters[side].replaceAll(LINE_BREAKS, ' ')).toWellFormed()]));\n};\n\nconst makeLabel = (text, horizontal, alignment) => {\n\tlet label = '';\n\n\t// A bar character can be wider than one column, so the label is placed with the width of the bar, not with its length\n\tconst textWidth = stringWidth(text);\n\n\tswitch (alignment) {\n\t\tcase 'left': {\n\t\t\tlabel = text + sliceAnsi(horizontal, textWidth);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'right': {\n\t\t\tlabel = sliceAnsi(horizontal, textWidth) + text;\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault: {\n\t\t\tconst width = Math.max(0, stringWidth(horizontal) - textWidth);\n\n\t\t\tif (width % 2 === 1) { // This is needed in case the width is odd\n\t\t\t\thorizontal = sliceAnsi(horizontal, Math.floor(width / 2) + textWidth);\n\t\t\t\tlabel = sliceAnsi(horizontal, 1) + text + horizontal; // We reduce the left part of one column to avoid the bar to go beyond its limit\n\t\t\t} else {\n\t\t\t\thorizontal = sliceAnsi(horizontal, (width / 2) + textWidth);\n\t\t\t\tlabel = horizontal + text + horizontal;\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn label;\n};\n\nconst makeContentText = (text, {padding, width, textAlignment, height}) => {\n\tconst max = width - padding.left - padding.right;\n\n\t// The text is wrapped first, so that the alignment measures the rows that are drawn\n\tconst wrappedText = text.split(NEWLINE).map(line => wrapLine(line, max)).join(NEWLINE);\n\t// A character can be wider than the box, in which case the row overflows it and the other rows are not aligned to it\n\tconst textWidth = Math.min(max, widestLine(wrappedText));\n\tconst alignedText = alignText(wrappedText, textAlignment, textWidth);\n\t// The rows are aligned to the widest row, and the block of rows is aligned in the box\n\tlet offset = 0;\n\n\tif (textAlignment === 'right') {\n\t\toffset = max - textWidth;\n\t} else if (textAlignment === 'center') {\n\t\toffset = Math.floor((max - textWidth) / 2);\n\t}\n\n\tlet lines = alignedText.split(NEWLINE).map(line => PAD.repeat(offset) + line);\n\n\tconst paddingLeft = PAD.repeat(padding.left);\n\tconst paddingRight = PAD.repeat(padding.right);\n\n\tlines = lines.map(line => {\n\t\tconst newLine = paddingLeft + line + paddingRight;\n\n\t\treturn newLine + PAD.repeat(Math.max(0, width - stringWidth(newLine)));\n\t});\n\n\t// The padding rows are part of the height, so only the text is cropped\n\tif (height !== undefined && lines.length > Math.max(0, height - padding.top - padding.bottom)) {\n\t\tlines = lines.slice(0, height - padding.top - padding.bottom);\n\t}\n\n\tif (padding.top > 0) {\n\t\tlines = [...Array.from({length: padding.top}, () => PAD.repeat(width)), ...lines];\n\t}\n\n\tif (padding.bottom > 0) {\n\t\tlines = [...lines, ...Array.from({length: padding.bottom}, () => PAD.repeat(width))];\n\t}\n\n\tif (height !== undefined && lines.length < height) {\n\t\tlines = [...lines, ...Array.from({length: height - lines.length}, () => PAD.repeat(width))];\n\t}\n\n\treturn lines.join(NEWLINE);\n};\n\n/*\nFill a bar with the character of a side. The character can be wider than one column, or empty, in which case the bar is filled with spaces, so it is repeated and cut to the width of the bar.\n*/\nconst fillBar = (character, width) => {\n\tconst fill = character || PAD;\n\tconst count = Math.ceil(Math.max(0, width) / Math.max(1, stringWidth(fill)));\n\n\treturn sliceAnsi(fill.repeat(count), 0, Math.max(0, width));\n};\n\nconst boxContent = (content, contentWidth, options) => {\n\tconst colorizeBorder = border => {\n\t\tconst coloredBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;\n\n\t\tlet bgColoredBorder = coloredBorder;\n\t\tif (options.borderBackgroundColor !== undefined) {\n\t\t\tif (options.borderBackgroundColor === 'inherit') {\n\t\t\t\tif (options.backgroundColor) {\n\t\t\t\t\tbgColoredBorder = getBGColorFunction(options.backgroundColor)(coloredBorder);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbgColoredBorder = getBGColorFunction(options.borderBackgroundColor)(coloredBorder);\n\t\t\t}\n\t\t}\n\n\t\treturn options.dimBorder ? chalk.dim(bgColoredBorder) : bgColoredBorder;\n\t};\n\n\tconst colorizeContent = text => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(text) : text;\n\n\t// Styling already applied to the title takes precedence\n\tconst colorizeTitle = title => options.titleColor ? getColorFunction(options.titleColor)(title) : title;\n\n\tconst chars = getBorderChars(options.borderStyle);\n\tconst columns = terminalColumns();\n\tlet marginLeft = PAD.repeat(options.margin.left);\n\n\tif (options.float === 'center') {\n\t\tconst marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);\n\t\tmarginLeft = PAD.repeat(marginWidth);\n\t} else if (options.float === 'right') {\n\t\tconst marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);\n\t\tmarginLeft = PAD.repeat(marginWidth);\n\t}\n\n\tconst rows = [];\n\n\t// The rows have the width of the content plus the sides, and a style that draws a border draws a space for a side that is empty\n\tconst hasBorder = options.borderStyle !== NONE;\n\tconst left = hasBorder ? (chars.left || PAD) : '';\n\tconst right = hasBorder ? (chars.right || PAD) : '';\n\tconst rowWidth = contentWidth + stringWidth(left) + stringWidth(right);\n\t// A bar spans the width of a row, so it is filled to the width that is left between the corners, and the label is placed in the fill\n\tconst bar = (character, cornerStart, cornerEnd, label, alignment) => {\n\t\tconst width = Math.max(0, rowWidth - stringWidth(cornerStart) - stringWidth(cornerEnd));\n\t\tconst fill = fillBar(character, width);\n\t\tconst filled = label ? makeLabel(label, fill, alignment) : fill;\n\n\t\t// A character that is wider than one column does not fill the last column of an odd width, and a label can end in the middle of one\n\t\tconst padding = PAD.repeat(Math.max(0, width - stringWidth(filled)));\n\n\t\treturn sliceAnsi(filled + padding, 0, Math.max(0, width));\n\t};\n\n\tif (options.borderStyle !== NONE || options.title) {\n\t\tconst topBar = bar(chars.top, chars.topLeft, chars.topRight, options.title ? colorizeTitle(options.title) : '', options.titleAlignment);\n\n\t\trows.push(marginLeft + colorizeBorder(chars.topLeft + topBar + chars.topRight));\n\t}\n\n\t// A box of no rows has no content to draw\n\tconst lines = content === '' ? [] : content.split(NEWLINE);\n\n\tfor (const line of lines) {\n\t\t// A row is padded to the width of the box, which a row that is wider than it does not have to be\n\t\tconst padded = line + PAD.repeat(Math.max(0, contentWidth - stringWidth(line)));\n\n\t\trows.push(marginLeft + colorizeBorder(left) + colorizeContent(padded) + colorizeBorder(right));\n\t}\n\n\tif (options.borderStyle !== NONE || options.footer) {\n\t\tconst bottomBar = bar(chars.bottom, chars.bottomLeft, chars.bottomRight, options.footer ?? '', options.footerAlignment);\n\n\t\trows.push(marginLeft + colorizeBorder(chars.bottomLeft + bottomBar + chars.bottomRight));\n\t}\n\n\t// A margin is drawn as empty rows around the box\n\treturn NEWLINE.repeat(options.margin.top) + rows.join(NEWLINE) + NEWLINE.repeat(options.margin.bottom);\n};\n\nconst sanitizeOptions = options => {\n\t// If fullscreen is enabled, max-out unspecified width/height\n\tif (options.fullscreen && process?.stdout) {\n\t\tlet newDimensions = [terminalColumns(), terminalRows()];\n\n\t\tif (typeof options.fullscreen === 'function') {\n\t\t\tnewDimensions = options.fullscreen(...newDimensions);\n\t\t}\n\n\t\tif (!isValidSize(options.width)) {\n\t\t\toptions.width = newDimensions[0];\n\t\t}\n\n\t\tif (!isValidSize(options.height)) {\n\t\t\toptions.height = newDimensions[1];\n\t\t}\n\t}\n\n\tconst borderWidth = getBorderWidth(options.borderStyle);\n\n\toptions.width = sanitizeSize(options.width, borderWidth);\n\toptions.maxWidth = sanitizeSize(options.maxWidth, borderWidth);\n\t// A box can have no row for the text, it is still a box of the height that is given\n\toptions.height = sanitizeSize(options.height, getBorderHeight(options.borderStyle), 0);\n\n\treturn options;\n};\n\n// The spaces that are drawn around a label, which it shares with the corners of the bar\nconst labelFrame = borderStyle => borderStyle === NONE ? 0 : 2;\n\nconst formatLabel = (label, borderStyle) => borderStyle === NONE ? label : ` ${label} `;\n\n// Slice a label to the available space and pad it with spaces\nconst fitLabel = (label, width, borderStyle, cornerWidth) => {\n\tif (!label) {\n\t\treturn label;\n\t}\n\n\t// A label is a single line, so line breaks would break the box\n\tlabel = writeControls(label.replaceAll(LINE_BREAKS, ' ')).toWellFormed();\n\t// The label is drawn between the corners of the bar, with the spaces that `formatLabel` adds around it\n\tlabel = sliceAnsi(label, 0, Math.max(0, width + getBorderWidth(borderStyle) - cornerWidth - labelFrame(borderStyle)));\n\n\treturn label && formatLabel(label, borderStyle);\n};\n\nconst determineDimensions = (text, options) => {\n\toptions = sanitizeOptions(options);\n\tconst isWidthOverride = options.width !== undefined;\n\tconst columns = terminalColumns();\n\tconst borderWidth = getBorderWidth(options.borderStyle);\n\tconst cornerWidths = getCornerWidths(options.borderStyle);\n\tconst corners = Math.max(cornerWidths.top, cornerWidths.bottom);\n\tconst terminalWidth = columns - borderWidth;\n\t// The box grows with the content up to the terminal width and `maxWidth`\n\tconst maxContentWidth = Math.min(terminalWidth, options.maxWidth || terminalWidth);\n\t// A box that is floated is centered or pushed to the right of the terminal instead of being indented, so only a margin that is drawn takes columns from the content\n\tconst marginWidth = () => {\n\t\tswitch (options.float) {\n\t\t\tcase 'center': {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tcase 'right': {\n\t\t\t\treturn options.margin.right;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\treturn options.margin.left + options.margin.right;\n\t\t\t}\n\t\t}\n\t};\n\n\t// A width that is fixed brings its own size, so only the margin that is indented can push the box past the terminal then\n\tconst availableWidth = isWidthOverride\n\t\t? columns - borderWidth - (options.float === 'left' ? options.margin.left : 0)\n\t\t: terminalWidth - marginWidth();\n\n\t// The text is measured the way it is wrapped for the box, or the box can end up a column wider than the text\n\tconst maxTextWidth = Math.max(1, maxContentWidth - options.padding.left - options.padding.right);\n\tconst wrappedText = text.split(NEWLINE).map(line => wrapLine(line, maxTextWidth)).join(NEWLINE);\n\tconst widestText = widestLine(wrappedText);\n\tlet widest = Math.min(widestText + options.padding.left + options.padding.right, maxContentWidth);\n\n\t// If fixed width is provided, use it or content width as reference\n\toptions.width ||= widest;\n\n\t// The margin is shrunk whether it is on one side or both, otherwise the box would be pushed past the terminal\n\t// The content keeps one column, exactly like it does in `spaceForMargins`, or the margin can be left one column short\n\tif ((options.margin.left || options.margin.right) && Math.max(1, options.width) > availableWidth) {\n\t\t// Let's assume we have margins: left = 3, right = 5, in total = 8, and that the content keeps one column\n\t\tconst spaceForMargins = columns - Math.max(1, options.width) - borderWidth;\n\t\t// Let's assume we have space = 4\n\t\tconst multiplier = spaceForMargins / (options.margin.left + options.margin.right);\n\t\t// Here: multiplier = 4/8 = 0.5\n\t\toptions.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));\n\t\toptions.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));\n\t\t// Left: 3 * 0.5 = 1.5 -> 1\n\t\t// Right: 6 * 0.5 = 3\n\t}\n\n\t// The labels are fitted with the space that the margin leaves behind, so that a shrunk margin still fits them\n\tconst labelWidth = isWidthOverride ? options.width : Math.min(columns - borderWidth - marginWidth(), maxContentWidth);\n\toptions.title = fitLabel(options.title, labelWidth, options.borderStyle, cornerWidths.top);\n\toptions.footer = fitLabel(options.footer, labelWidth, options.borderStyle, cornerWidths.bottom);\n\n\t// A label is drawn on a row of the border, but on a row of its own when there is no border\n\tif (getBorderHeight(options.borderStyle) === 0 && options.height !== undefined) {\n\t\toptions.height = Math.max(0, options.height - (options.title ? 1 : 0) - (options.footer ? 1 : 0));\n\t}\n\n\tif (!isWidthOverride) {\n\t\t// If a label is larger than content, box adheres to label width, and the box keeps the room the corners of its bar need\n\t\tfor (const [label, cornerWidth] of [[options.title, cornerWidths.top], [options.footer, cornerWidths.bottom]]) {\n\t\t\tif (label) {\n\t\t\t\twidest = Math.max(widest, stringWidth(label) - borderWidth + cornerWidth);\n\t\t\t}\n\t\t}\n\n\t\t// Re-cap width considering the margins after shrinking, keeping at least one column for the content\n\t\toptions.width = Math.max(1, Math.min(widest, columns - borderWidth - marginWidth()));\n\t}\n\n\t// Prevent padding overflow\n\t// The box is at least as wide as the corners of its bars\n\toptions.width = Math.max(options.width, corners - borderWidth, 1);\n\n\tif (options.padding.left + options.padding.right >= options.width) {\n\t\toptions.padding.left = 0;\n\t\toptions.padding.right = 0;\n\t}\n\n\tif (options.height !== undefined && options.padding.top + options.padding.bottom >= options.height) {\n\t\toptions.padding.top = 0;\n\t\toptions.padding.bottom = 0;\n\t}\n\n\treturn options;\n};\n\nconst colorNames = new Set([\n\t'black',\n\t'red',\n\t'green',\n\t'yellow',\n\t'blue',\n\t'magenta',\n\t'cyan',\n\t'white',\n\t'gray',\n\t'grey',\n\t'blackBright',\n\t'redBright',\n\t'greenBright',\n\t'yellowBright',\n\t'blueBright',\n\t'magentaBright',\n\t'cyanBright',\n\t'whiteBright',\n]);\n\nconst isHex = color => /^#(?:[\\da-f]{3}){1,2}$/iv.test(color);\nconst isColorValid = color => typeof color === 'string' && (colorNames.has(color) || isHex(color));\nconst getColorFunction = color => isHex(color) ? chalk.hex(color) : chalk[color];\nconst getBGColorFunction = color => isHex(color) ? chalk.bgHex(color) : chalk[`bg${color[0].toUpperCase()}${color.slice(1)}`];\n\nexport default function boxen(text, options) {\n\t// Normalize the line breaks so that a carriage return, a vertical tab or a form feed can not move the cursor inside the box\n\t// A lone surrogate is written as a replacement character, which is one column wide, so it has to be measured as one\n\ttext = writeControls(text.replaceAll(LINE_BREAKS, '\\n')).toWellFormed();\n\n\toptions = {\n\t\tpadding: 0,\n\t\tdimBorder: false,\n\t\tfloat: 'left',\n\t\t...options,\n\t};\n\n\t// A nullish option, for example one that is explicitly `undefined`, means its default\n\toptions.borderStyle ??= 'single';\n\toptions.textAlignment ??= options.align ?? 'left'; // `align` is deprecated\n\toptions.titleAlignment ??= 'left';\n\toptions.footerAlignment ??= 'left';\n\n\tif (options.borderColor && !isColorValid(options.borderColor)) {\n\t\tthrow new Error(`${options.borderColor} is not a valid borderColor`);\n\t}\n\n\tif (options.titleColor && !isColorValid(options.titleColor)) {\n\t\tthrow new Error(`${options.titleColor} is not a valid titleColor`);\n\t}\n\n\tif (options.backgroundColor && !isColorValid(options.backgroundColor)) {\n\t\tthrow new Error(`${options.backgroundColor} is not a valid backgroundColor`);\n\t}\n\n\t// Option borderBackgroundColor defaults to 'inherit' if unspecified (not explicitly set to undefined)\n\tif (!('borderBackgroundColor' in options)) {\n\t\toptions.borderBackgroundColor = 'inherit';\n\t}\n\n\tif (options.borderBackgroundColor !== undefined && options.borderBackgroundColor !== 'inherit' && !isColorValid(options.borderBackgroundColor)) {\n\t\tthrow new Error(`${options.borderBackgroundColor} is not a valid borderBackgroundColor`);\n\t}\n\n\toptions.padding = getObject(options.padding);\n\toptions.margin = getObject(options.margin);\n\n\toptions = determineDimensions(text, options);\n\n\ttext = makeContentText(text, options);\n\n\t// A character that is wider than the space left for it widens the row it is on, so the border follows the widest row\n\treturn boxContent(text, Math.max(options.width, widestLine(text)), options);\n}\n\nexport {default as _borderStyles} from 'cli-boxes';\n","import boxen from 'boxen';\nimport chalk from 'chalk';\n\n/**\n * Display the tool banner\n */\nexport function showBanner(command: string, version: string, quiet = false): void {\n if (quiet) {\n return;\n }\n\n const banner = boxen(\n `${chalk.bold.cyan('QTI <-> Learnosity Converter')}\\n` + `${chalk.dim('Version:')} ${version}\\n` + `${chalk.dim('Command:')} ${command}`,\n {\n padding: 1,\n margin: 1,\n borderStyle: 'round',\n borderColor: 'cyan',\n }\n );\n\n console.log(banner);\n}\n","import type { ConfigOptions } from './types.js';\nimport type {\n Diagnostic,\n QtiVersion,\n OutputFormat,\n DiagnosticsOutput,\n ItemReferenceSource,\n ItemFilenameSource,\n} from '@learnosity/converter-core';\nimport { DiagnosticCode } from '@learnosity/converter-core';\n\nconst VALID_QTI_VERSIONS: QtiVersion[] = ['2.1', '2.2'];\nconst VALID_OUTPUT_FORMATS: OutputFormat[] = ['dir', 'zip', 'stdout'];\nconst VALID_DIAGNOSTICS_OUTPUTS: DiagnosticsOutput[] = ['stderr', 'file', 'both', 'none'];\nconst VALID_ITEM_REFERENCE_SOURCES: ItemReferenceSource[] = [\n 'itemIdentifier',\n 'qti',\n 'sourceFilename',\n 'uuid',\n];\nconst VALID_ITEM_FILENAME_SOURCES: ItemFilenameSource[] = [\n 'itemIdentifier',\n 'qti',\n 'sourceFilename',\n];\n\nconst KNOWN_CONFIG_KEYS = new Set([\n 'qtiVersion',\n 'outputFormat',\n 'diagnostics',\n 'pretty',\n 'verbose',\n 'output',\n 'organisationId',\n 'mediaVault',\n 'customAssetUrl',\n 'preserveAssetFilenames',\n 'itemReferenceSource',\n 'itemFilenameSource',\n 'truncateTags',\n 'splitCsvTags',\n]);\n\n/**\n * Validate config object and return diagnostics\n */\nexport function validateConfig(config: Record<string, unknown>): {\n valid: ConfigOptions;\n diagnostics: Diagnostic[];\n} {\n const diagnostics: Diagnostic[] = [];\n const valid: ConfigOptions = {};\n\n // Check for unknown keys\n for (const key of Object.keys(config)) {\n if (!KNOWN_CONFIG_KEYS.has(key)) {\n diagnostics.push({\n level: 'warning',\n code: DiagnosticCode.CONFIG_UNKNOWN_KEY,\n message: `Unknown config key: \"${key}\"`,\n file: '',\n context: { key },\n });\n }\n }\n\n // Validate qtiVersion\n if ('qtiVersion' in config) {\n if (\n typeof config.qtiVersion === 'string' &&\n VALID_QTI_VERSIONS.includes(config.qtiVersion as QtiVersion)\n ) {\n valid.qtiVersion = config.qtiVersion as QtiVersion;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid qtiVersion: \"${config.qtiVersion}\". Must be \"2.1\" or \"2.2\".`,\n file: 'qtiVersion',\n });\n }\n }\n\n // Validate outputFormat\n if ('outputFormat' in config) {\n if (\n typeof config.outputFormat === 'string' &&\n VALID_OUTPUT_FORMATS.includes(config.outputFormat as OutputFormat)\n ) {\n valid.outputFormat = config.outputFormat as OutputFormat;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid outputFormat: \"${config.outputFormat}\". Must be \"dir\", \"zip\", or \"stdout\".`,\n file: 'outputFormat',\n });\n }\n }\n\n // Validate diagnostics\n if ('diagnostics' in config) {\n if (\n typeof config.diagnostics === 'string' &&\n VALID_DIAGNOSTICS_OUTPUTS.includes(config.diagnostics as DiagnosticsOutput)\n ) {\n valid.diagnostics = config.diagnostics as DiagnosticsOutput;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid diagnostics: \"${config.diagnostics}\". Must be \"stderr\", \"file\", \"both\", or \"none\".`,\n file: 'diagnostics',\n });\n }\n }\n\n // Validate pretty\n if ('pretty' in config) {\n if (typeof config.pretty === 'boolean') {\n valid.pretty = config.pretty;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid pretty: \"${config.pretty}\". Must be boolean.`,\n file: 'pretty',\n });\n }\n }\n\n // Validate verbose\n if ('verbose' in config) {\n if (typeof config.verbose === 'boolean') {\n valid.verbose = config.verbose;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid verbose: \"${config.verbose}\". Must be boolean.`,\n file: 'verbose',\n });\n }\n }\n\n // Validate output\n if ('output' in config) {\n if (typeof config.output === 'string') {\n valid.output = config.output;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid output: \"${config.output}\". Must be string.`,\n file: 'output',\n });\n }\n }\n\n // Validate organisationId\n if ('organisationId' in config) {\n if (typeof config.organisationId === 'number' && Number.isInteger(config.organisationId)) {\n valid.organisationId = config.organisationId;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid organisationId: \"${config.organisationId}\". Must be an integer.`,\n file: 'organisationId',\n });\n }\n }\n\n // Validate mediaVault\n if ('mediaVault' in config) {\n if (typeof config.mediaVault === 'boolean') {\n valid.mediaVault = config.mediaVault;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid mediaVault: \"${config.mediaVault}\". Must be boolean.`,\n file: 'mediaVault',\n });\n }\n }\n\n // Validate customAssetUrl\n if ('customAssetUrl' in config) {\n if (typeof config.customAssetUrl === 'string') {\n valid.customAssetUrl = config.customAssetUrl;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid customAssetUrl: \"${config.customAssetUrl}\". Must be string.`,\n file: 'customAssetUrl',\n });\n }\n }\n\n // Validate preserveAssetFilenames\n if ('preserveAssetFilenames' in config) {\n if (typeof config.preserveAssetFilenames === 'boolean') {\n valid.preserveAssetFilenames = config.preserveAssetFilenames;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid preserveAssetFilenames: \"${String(config.preserveAssetFilenames)}\". Must be boolean.`,\n file: 'preserveAssetFilenames',\n });\n }\n }\n\n // Validate itemReferenceSource\n if ('itemReferenceSource' in config) {\n if (\n typeof config.itemReferenceSource === 'string' &&\n VALID_ITEM_REFERENCE_SOURCES.includes(config.itemReferenceSource as ItemReferenceSource)\n ) {\n valid.itemReferenceSource = config.itemReferenceSource as ItemReferenceSource;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid itemReferenceSource: \"${String(config.itemReferenceSource)}\". Must be \"itemIdentifier\", \"qti\", \"sourceFilename\", or \"uuid\".`,\n file: 'itemReferenceSource',\n });\n }\n }\n\n // Validate truncateTags\n if ('truncateTags' in config) {\n if (typeof config.truncateTags === 'boolean') {\n valid.truncateTags = config.truncateTags;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid truncateTags: \"${config.truncateTags}\". Must be boolean.`,\n file: 'truncateTags',\n });\n }\n }\n\n // Validate splitCsvTags\n if ('splitCsvTags' in config) {\n if (typeof config.splitCsvTags === 'boolean') {\n valid.splitCsvTags = config.splitCsvTags;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid splitCsvTags: \"${String(config.splitCsvTags)}\". Must be boolean.`,\n file: 'splitCsvTags',\n });\n }\n }\n\n // Validate itemFilenameSource\n if ('itemFilenameSource' in config) {\n if (\n typeof config.itemFilenameSource === 'string' &&\n VALID_ITEM_FILENAME_SOURCES.includes(config.itemFilenameSource as ItemFilenameSource)\n ) {\n valid.itemFilenameSource = config.itemFilenameSource as ItemFilenameSource;\n } else {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: `Invalid itemFilenameSource: \"${String(config.itemFilenameSource)}\". Must be \"itemIdentifier\", \"qti\", or \"sourceFilename\".`,\n file: 'itemFilenameSource',\n });\n }\n }\n\n return { valid, diagnostics };\n}\n","import { readFile, access } from 'fs/promises';\nimport { resolve } from 'path';\nimport type { ConfigOptions } from './types.js';\nimport type { Diagnostic } from '@learnosity/converter-core';\nimport { DiagnosticCode } from '@learnosity/converter-core';\nimport { validateConfig } from './schema.js';\n\nexport interface ConfigLoadResult {\n config: ConfigOptions | null;\n diagnostics: Diagnostic[];\n configPath: string | null;\n}\n\n/**\n * Load config from file path\n */\nexport async function loadConfigFromPath(configPath: string): Promise<ConfigLoadResult> {\n const diagnostics: Diagnostic[] = [];\n\n // configPath is the operator's own --config argument. Resolving it is the\n // intended behaviour: the CLI must be able to load a config from anywhere on\n // the machine the operator can already read.\n // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal, javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal\n const absolutePath = resolve(configPath);\n\n try {\n await access(absolutePath);\n } catch {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_FILE_NOT_FOUND,\n message: `Config file not found: ${absolutePath}`,\n file: '',\n context: { configPath: absolutePath },\n });\n\n return { config: null, diagnostics, configPath: null };\n }\n\n let content: string;\n\n try {\n content = await readFile(absolutePath, 'utf-8');\n } catch (error) {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_FILE_NOT_FOUND,\n message: `Failed to read config file: ${error instanceof Error ? error.message : 'unknown error'}`,\n file: '',\n context: { configPath: absolutePath },\n });\n\n return { config: null, diagnostics, configPath: null };\n }\n\n let parsed: unknown;\n\n try {\n parsed = JSON.parse(content);\n } catch (error) {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_FILE_INVALID_JSON,\n message: `Invalid JSON in config file: ${error instanceof Error ? error.message : 'unknown error'}`,\n file: '',\n context: { configPath: absolutePath },\n });\n\n return { config: null, diagnostics, configPath: null };\n }\n\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {\n diagnostics.push({\n level: 'error',\n code: DiagnosticCode.CONFIG_SCHEMA_INVALID,\n message: 'Config file must be a JSON object',\n file: '',\n context: { configPath: absolutePath },\n });\n\n return { config: null, diagnostics, configPath: null };\n }\n\n const { valid, diagnostics: validationDiagnostics } = validateConfig(\n parsed as Record<string, unknown>\n );\n\n diagnostics.push(...validationDiagnostics);\n\n // If there are errors, don't return config\n const hasErrors = diagnostics.some((d) => d.level === 'error');\n\n if (hasErrors) {\n return { config: null, diagnostics, configPath: null };\n }\n\n diagnostics.push({\n level: 'info',\n code: DiagnosticCode.CONFIG_LOADED,\n message: `Config loaded from ${absolutePath}`,\n file: '',\n context: { configPath: absolutePath },\n });\n\n return { config: valid, diagnostics, configPath: absolutePath };\n}\n\n/**\n * Load config with discovery (default path or explicit)\n */\nexport async function loadConfig(\n explicitPath?: string,\n noConfig?: boolean\n): Promise<ConfigLoadResult> {\n const diagnostics: Diagnostic[] = [];\n\n // If --no-config, return early\n if (noConfig) {\n diagnostics.push({\n level: 'info',\n code: DiagnosticCode.CONFIG_DISABLED,\n message: 'Config loading disabled via --no-config',\n file: '',\n });\n\n return { config: null, diagnostics, configPath: null };\n }\n\n // If explicit path provided, load it\n if (explicitPath) {\n return loadConfigFromPath(explicitPath);\n }\n\n // Try default path\n const defaultPath = resolve(process.cwd(), 'lrn-converter.config.json');\n\n try {\n await access(defaultPath);\n\n return loadConfigFromPath(defaultPath);\n } catch {\n // Default config doesn't exist, that's fine\n return { config: null, diagnostics: [], configPath: null };\n }\n}\n","import { homedir } from 'os';\n\n/**\n * Expand tilde (~) to home directory in paths.\n *\n * Handles:\n * - `~/path` → `/home/user/path`\n * - `~` → `/home/user`\n *\n * Does NOT handle `~username/path` syntax (returns unchanged).\n *\n * @param filePath - The file path that may contain a tilde\n * @returns The path with tilde expanded to home directory\n */\nexport function expandTilde(filePath: string): string {\n if (filePath.startsWith('~/')) {\n return filePath.replace('~', homedir());\n }\n if (filePath === '~') {\n return homedir();\n }\n\n return filePath;\n}\n\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"mappings":";;;;;;;AACA,MAAM,aAAa,EACf,uBAAuB,OAC3B;AACA,IAAA,eAAe,cAAc,QAAQ,SAAS;CAC1C,MAAM,EAAE,UAAU,UAAU;CAC5B,MAAM,QAAQ,UAAU,YAAY,OAAO,KAAK;CAChD,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAG3C,MAAM,CAAC,cAAc,mBAAmB,SAAS,OAAO,OAAO,WAAW,EAAE,CAAC;CAC7E,MAAM,CAAC,UAAU,YAAY,SAAS;CACtC,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CACrC,MAAM,SAAS,UAAU;EAAE;EAAQ;CAAM,CAAC;CAC1C,eAAe,SAAS,OAAO;EAC3B,MAAM,EAAE,UAAU,SAAS,eAAe,oBAAoB;EAC9D,IAAI,YAAY,CAAC,OACb,OAAO;EAEX,IAAI,WAAW,CAAC,QAAQ,KAAK,KAAK,GAC9B,OAAO;EAEX,IAAI,OAAO,OAAO,aAAa,YAC3B,OAAQ,MAAM,OAAO,SAAS,KAAK,KAAM;EAE7C,OAAO;CACX;CACA,YAAY,OAAO,KAAK,OAAO;EAE3B,IAAI,WAAW,QACX;EAEJ,IAAI,WAAW,GAAG,GAAG;GACjB,MAAM,SAAS,SAAS;GACxB,UAAU,SAAS;GACnB,MAAM,UAAU,MAAM,SAAS,MAAM;GACrC,IAAI,YAAY,MAAM;IAClB,SAAS,MAAM;IACf,UAAU,MAAM;IAChB,KAAK,MAAM;GACf,OACK;IACD,IAAI,MAAM,0BAA0B,SAChC,SAAS,EAAE;SAKX,GAAG,MAAM,KAAK;IA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O;GACP,MAAM,eAAe;GACrB,SAAS;GACT,MAAM;EACV,CAAC;EAED,OAAO;GAAE,QAAQ;GAAM;GAAa,YAAY;EAAK;CACzD;CAGA,IAAI,cACA,OAAO,mBAAmB,YAAY;CAI1C,MAAM,cAAc,QAAQ,QAAQ,IAAI,GAAG,2BAA2B;CAEtE,IAAI;EACA,MAAM,OAAO,WAAW;EAExB,OAAO,mBAAmB,WAAW;CACzC,QAAQ;EAEJ,OAAO;GAAE,QAAQ;GAAM,aAAa,CAAC;GAAG,YAAY;EAAK;CAC7D;AACJ;;;;;;;;;;;;;;AClIA,SAAgB,YAAY,UAA0B;CAClD,IAAI,SAAS,WAAW,IAAI,GACxB,OAAO,SAAS,QAAQ,KAAK,QAAQ,CAAC;CAE1C,IAAI,aAAa,KACb,OAAO,QAAQ;CAGnB,OAAO;AACX"}
|
package/packages/cli/dist/{qtiPackageToLearnosity-CX9htPId.js → qtiPackageToLearnosity-C24effmB.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as processBatchParallel, n as displayConfiguration, r as processBatch, t as configField } from "./configOutput-
|
|
1
|
+
import { i as loadPackageDirectory, l as convertQtiPackageToLearnosityBundle, n as processQtiPackageToLearnosity, o as writeLearnosityBundle } from "./batchProcessors-BI6C89vy.js";
|
|
2
|
+
import { t as nodeFileAccess } from "./nodeFileAccess-BBS4FAK7.js";
|
|
3
|
+
import { n as loadConfig, o as dist_default, r as showBanner, t as expandTilde } from "./pathUtils-BUJJCvvp.js";
|
|
4
|
+
import { o as writeDiagnostics, r as formatDiagnosticsTable } from "./table-BkrwlSAQ.js";
|
|
5
|
+
import { i as processBatchParallel, n as displayConfiguration, r as processBatch, t as configField } from "./configOutput-CJ-ryN3j.js";
|
|
6
6
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
7
|
-
|
|
7
|
+
// src/commands/qtiPackageToLearnosity.ts
|
|
8
8
|
/**
|
|
9
9
|
* Register qti-package-to-learnosity command
|
|
10
10
|
*/
|
|
@@ -360,7 +360,6 @@ async function executeBatchQtiPackageToLearnosity(opts) {
|
|
|
360
360
|
processPackage: (pkg, packageOutputPath, options) => processQtiPackageToLearnosity(pkg, packageOutputPath, options, quiet)
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
//#endregion
|
|
364
363
|
export { registerQtiPackageToLearnosityCommand };
|
|
365
364
|
|
|
366
|
-
//# sourceMappingURL=qtiPackageToLearnosity-
|
|
365
|
+
//# sourceMappingURL=qtiPackageToLearnosity-C24effmB.js.map
|