@meridianlabs/log-viewer 0.3.281 → 0.3.283

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.
Files changed (199) hide show
  1. package/lib/{AnsiDisplayRich-302CIkEj.js → AnsiDisplayRich-Dpc1-E4A.js} +31 -34
  2. package/lib/AnsiDisplayRich-Dpc1-E4A.js.map +1 -0
  3. package/lib/{AsciinemaPlayerImpl-BG5NPs0z.js → AsciinemaPlayerImpl-CTd51CWg.js} +13 -13
  4. package/lib/{AsciinemaPlayerImpl-BG5NPs0z.js.map → AsciinemaPlayerImpl-CTd51CWg.js.map} +1 -1
  5. package/lib/ToolButton-BGW3G4cu.js +374 -0
  6. package/lib/ToolButton-BGW3G4cu.js.map +1 -0
  7. package/lib/e2e/csp/csp.spec.d.ts +2 -0
  8. package/lib/e2e/csp/csp.spec.d.ts.map +1 -0
  9. package/lib/e2e/csp/cspLogs.d.ts +10 -0
  10. package/lib/e2e/csp/cspLogs.d.ts.map +1 -0
  11. package/lib/e2e/csp/media.d.ts +3 -0
  12. package/lib/e2e/csp/media.d.ts.map +1 -0
  13. package/lib/e2e/expandable-panel-nested-toggles.spec.d.ts +2 -0
  14. package/lib/e2e/expandable-panel-nested-toggles.spec.d.ts.map +1 -0
  15. package/lib/e2e/fixtures/app.d.ts +12 -1
  16. package/lib/e2e/fixtures/app.d.ts.map +1 -1
  17. package/lib/e2e/fixtures/log-list-scenario.d.ts +3 -0
  18. package/lib/e2e/fixtures/log-list-scenario.d.ts.map +1 -1
  19. package/lib/e2e/message-selection.spec.d.ts +2 -0
  20. package/lib/e2e/message-selection.spec.d.ts.map +1 -0
  21. package/lib/index.js +35261 -34931
  22. package/lib/index.js.map +1 -1
  23. package/lib/{markdownPipeline-C_z-iU9a.js → markdownPipeline-bhdCQvtQ.js} +280 -306
  24. package/lib/markdownPipeline-bhdCQvtQ.js.map +1 -0
  25. package/lib/{prismHighlighter-D-PZtkPX.js → prismHighlighter-7qrXrStR.js} +1 -2
  26. package/lib/{prismHighlighter-D-PZtkPX.js.map → prismHighlighter-7qrXrStR.js.map} +1 -1
  27. package/lib/src/app/App.d.ts.map +1 -1
  28. package/lib/src/app/AppProviders.d.ts +10 -0
  29. package/lib/src/app/AppProviders.d.ts.map +1 -0
  30. package/lib/src/app/log-list/LogsPanel.d.ts.map +1 -1
  31. package/lib/src/app/log-list/ViewerOptionsButton.d.ts +1 -0
  32. package/lib/src/app/log-list/ViewerOptionsButton.d.ts.map +1 -1
  33. package/lib/src/app/log-list/ViewerOptionsPopover.d.ts +1 -0
  34. package/lib/src/app/log-list/ViewerOptionsPopover.d.ts.map +1 -1
  35. package/lib/src/app/log-list/grid/columns/hooks.d.ts.map +1 -1
  36. package/lib/src/app/log-view/error/TaskErrorPanel.d.ts.map +1 -1
  37. package/lib/src/app/log-view/tabs/InfoTab.d.ts +1 -1
  38. package/lib/src/app/log-view/tabs/JsonTab.d.ts.map +1 -1
  39. package/lib/src/app/log-view/tabs/ModelsTab.d.ts +1 -1
  40. package/lib/src/app/log-view/tabs/SamplesTab.d.ts.map +1 -1
  41. package/lib/src/app/log-view/tabs/timeline/HistoryList.d.ts.map +1 -1
  42. package/lib/src/app/log-view/tabs/timeline/TimelineChart.d.ts.map +1 -1
  43. package/lib/src/app/log-view/tabs/timeline/TimelineTab.d.ts +1 -1
  44. package/lib/src/app/log-view/tabs/timeline/TimelineTab.d.ts.map +1 -1
  45. package/lib/src/app/log-view/title-view/CollapsedTitleBar.d.ts.map +1 -1
  46. package/lib/src/app/log-view/title-view/EditAnnotationsDialog.d.ts +22 -0
  47. package/lib/src/app/log-view/title-view/EditAnnotationsDialog.d.ts.map +1 -0
  48. package/lib/src/app/log-view/title-view/EditMetadataDialog.d.ts +3 -3
  49. package/lib/src/app/log-view/title-view/EditMetadataDialog.d.ts.map +1 -1
  50. package/lib/src/app/log-view/title-view/EditTagsDialog.d.ts.map +1 -1
  51. package/lib/src/app/log-view/title-view/RunningStatusPanel.d.ts.map +1 -1
  52. package/lib/src/app/log-view/title-view/ScoreGrid.d.ts.map +1 -1
  53. package/lib/src/app/log-view/title-view/StatusPanel.d.ts +2 -1
  54. package/lib/src/app/log-view/title-view/StatusPanel.d.ts.map +1 -1
  55. package/lib/src/app/log-view/title-view/renderEditDialog.d.ts +12 -0
  56. package/lib/src/app/log-view/title-view/renderEditDialog.d.ts.map +1 -0
  57. package/lib/src/app/navbar/ApplicationNavbar.d.ts +3 -0
  58. package/lib/src/app/navbar/ApplicationNavbar.d.ts.map +1 -1
  59. package/lib/src/app/navbar/Navbar.d.ts.map +1 -1
  60. package/lib/src/app/navbar/NavbarButton.d.ts +2 -1
  61. package/lib/src/app/navbar/NavbarButton.d.ts.map +1 -1
  62. package/lib/src/app/navbar/ViewSegmentedControl.d.ts.map +1 -1
  63. package/lib/src/app/plan/DetailStep.d.ts +2 -1
  64. package/lib/src/app/plan/DetailStep.d.ts.map +1 -1
  65. package/lib/src/app/plan/ScorerDetailView.d.ts.map +1 -1
  66. package/lib/src/app/plan/SolverDetailView.d.ts.map +1 -1
  67. package/lib/src/app/routing/url.d.ts +8 -3
  68. package/lib/src/app/routing/url.d.ts.map +1 -1
  69. package/lib/src/app/samples/InlineSampleDisplay.d.ts.map +1 -1
  70. package/lib/src/app/samples/SampleDisplay.d.ts.map +1 -1
  71. package/lib/src/app/samples/SampleRetriedErrors.d.ts.map +1 -1
  72. package/lib/src/app/samples/SamplesTools.d.ts.map +1 -1
  73. package/lib/src/app/samples/error/SampleErrorView.d.ts.map +1 -1
  74. package/lib/src/app/samples/event/SampleEventView.d.ts.map +1 -1
  75. package/lib/src/app/samples/header-v2/ScorePanel.d.ts.map +1 -1
  76. package/lib/src/app/samples/list/samplesView.d.ts +1 -1
  77. package/lib/src/app/samples/print/SamplePrintView.d.ts +3 -1
  78. package/lib/src/app/samples/print/SamplePrintView.d.ts.map +1 -1
  79. package/lib/src/app/samples/retry-display/RetryAttemptCard.d.ts.map +1 -1
  80. package/lib/src/app/samples/retry-display/RetryTerminalAnchor.d.ts.map +1 -1
  81. package/lib/src/app/samples/sample-tools/SelectScorer.d.ts.map +1 -1
  82. package/lib/src/app/samples/sample-tools/sample-filter/SampleFilter.d.ts.map +1 -1
  83. package/lib/src/app/samples/scans/ScansSidebarPanel.d.ts.map +1 -1
  84. package/lib/src/app/samples/status/status.d.ts.map +1 -1
  85. package/lib/src/app/samples/transcript/TranscriptPanel.d.ts +4 -2
  86. package/lib/src/app/samples/transcript/TranscriptPanel.d.ts.map +1 -1
  87. package/lib/src/app/samples/transcript/search/SearchScoutUnavailable.d.ts.map +1 -1
  88. package/lib/src/app/samples/useEvidenceSelection.d.ts +56 -0
  89. package/lib/src/app/samples/useEvidenceSelection.d.ts.map +1 -0
  90. package/lib/src/app/samples-panel/SamplesPanel.d.ts.map +1 -1
  91. package/lib/src/app/server/useUserInfo.d.ts +12 -0
  92. package/lib/src/app/server/useUserInfo.d.ts.map +1 -0
  93. package/lib/src/app/shared/ColumnSelectorPopover.d.ts.map +1 -1
  94. package/lib/src/app/shared/contentTrust.d.ts +1 -5
  95. package/lib/src/app/shared/contentTrust.d.ts.map +1 -1
  96. package/lib/src/app/shared/data-grid/DataGrid.d.ts +1 -2
  97. package/lib/src/app/shared/data-grid/DataGrid.d.ts.map +1 -1
  98. package/lib/src/app/types.d.ts +2 -2
  99. package/lib/src/app/types.d.ts.map +1 -1
  100. package/lib/src/app_config/LogLocationGate.d.ts +6 -5
  101. package/lib/src/app_config/LogLocationGate.d.ts.map +1 -1
  102. package/lib/src/app_config/appConfig.d.ts +1 -2
  103. package/lib/src/app_config/appConfig.d.ts.map +1 -1
  104. package/lib/src/app_config/logLocationTrust.d.ts +5 -4
  105. package/lib/src/app_config/logLocationTrust.d.ts.map +1 -1
  106. package/lib/src/app_config/resolveBackend.d.ts +3 -3
  107. package/lib/src/app_config/resolveBackend.d.ts.map +1 -1
  108. package/lib/src/client/api/client-api.d.ts.map +1 -1
  109. package/lib/src/client/api/shared/api-shared.d.ts.map +1 -1
  110. package/lib/src/client/api/testClientApi.d.ts +2 -1
  111. package/lib/src/client/api/testClientApi.d.ts.map +1 -1
  112. package/lib/src/client/api/types.d.ts +2 -5
  113. package/lib/src/client/api/types.d.ts.map +1 -1
  114. package/lib/src/client/api/vscode/testExtensionHost.d.ts +28 -0
  115. package/lib/src/client/api/vscode/testExtensionHost.d.ts.map +1 -0
  116. package/lib/src/client/database/schema.d.ts.map +1 -1
  117. package/lib/src/client/json-parse.worker.d.ts +2 -0
  118. package/lib/src/client/json-parse.worker.d.ts.map +1 -0
  119. package/lib/src/client/jsonParseWorker.d.ts +2 -0
  120. package/lib/src/client/jsonParseWorker.d.ts.map +1 -0
  121. package/lib/src/client/remote/{zstd-worker.d.ts → decompression-worker.d.ts} +15 -8
  122. package/lib/src/client/remote/decompression-worker.d.ts.map +1 -0
  123. package/lib/src/client/remote/decompression.d.ts.map +1 -1
  124. package/lib/src/client/remote/decompression.worker.d.ts +2 -0
  125. package/lib/src/client/remote/decompression.worker.d.ts.map +1 -0
  126. package/lib/src/client/remote/inflate.d.ts +11 -0
  127. package/lib/src/client/remote/inflate.d.ts.map +1 -0
  128. package/lib/src/client/remote/zstd-decoder.d.ts.map +1 -1
  129. package/lib/src/client/utils/derive.d.ts.map +1 -1
  130. package/lib/src/components/DownloadLogButton.d.ts.map +1 -1
  131. package/lib/src/components/LinkButton.d.ts +2 -1
  132. package/lib/src/components/LinkButton.d.ts.map +1 -1
  133. package/lib/src/components/MessageBand.d.ts.map +1 -1
  134. package/lib/src/index.d.ts +0 -9
  135. package/lib/src/index.d.ts.map +1 -1
  136. package/lib/src/log_data/databaseInstance.d.ts +7 -0
  137. package/lib/src/log_data/databaseInstance.d.ts.map +1 -1
  138. package/lib/src/log_data/databaseListings.d.ts +3 -1
  139. package/lib/src/log_data/databaseListings.d.ts.map +1 -1
  140. package/lib/src/log_data/fetchEngine.d.ts +4 -0
  141. package/lib/src/log_data/fetchEngine.d.ts.map +1 -1
  142. package/lib/src/log_data/imperativeLogData.d.ts +1 -1
  143. package/lib/src/log_data/index.d.ts +3 -1
  144. package/lib/src/log_data/index.d.ts.map +1 -1
  145. package/lib/src/log_data/runningSampleQuery.d.ts +4 -1
  146. package/lib/src/log_data/runningSampleQuery.d.ts.map +1 -1
  147. package/lib/src/log_data/samplesListing.d.ts +1 -2
  148. package/lib/src/log_data/samplesListing.d.ts.map +1 -1
  149. package/lib/src/log_data/testFixtures.d.ts +1 -1
  150. package/lib/src/log_data/testFixtures.d.ts.map +1 -1
  151. package/lib/src/log_data/useFetchEngineStatus.d.ts +5 -1
  152. package/lib/src/log_data/useFetchEngineStatus.d.ts.map +1 -1
  153. package/lib/src/log_data/useLogsSync.d.ts +7 -1
  154. package/lib/src/log_data/useLogsSync.d.ts.map +1 -1
  155. package/lib/src/main.d.ts +0 -1
  156. package/lib/src/main.d.ts.map +1 -1
  157. package/lib/src/scoring/headline.d.ts.map +1 -1
  158. package/lib/src/state/hooks.d.ts.map +1 -1
  159. package/lib/src/state/sampleSlice.d.ts +6 -6
  160. package/lib/src/state/sampleSlice.d.ts.map +1 -1
  161. package/lib/src/test/mswServer.d.ts +9 -0
  162. package/lib/src/test/mswServer.d.ts.map +1 -0
  163. package/lib/src/test/nodeWorker.d.ts +2 -0
  164. package/lib/src/test/nodeWorker.d.ts.map +1 -0
  165. package/lib/src/test/testApp.d.ts +36 -0
  166. package/lib/src/test/testApp.d.ts.map +1 -0
  167. package/lib/styles/index.css +12649 -12533
  168. package/package.json +19 -19
  169. package/lib/AnsiDisplayRich-302CIkEj.js.map +0 -1
  170. package/lib/ToolButton-BmBvTvKO.js +0 -124
  171. package/lib/ToolButton-BmBvTvKO.js.map +0 -1
  172. package/lib/markdownPipeline-C_z-iU9a.js.map +0 -1
  173. package/lib/src/app/appearance/colors.d.ts +0 -10
  174. package/lib/src/app/appearance/colors.d.ts.map +0 -1
  175. package/lib/src/app/appearance/icons.d.ts +0 -148
  176. package/lib/src/app/appearance/icons.d.ts.map +0 -1
  177. package/lib/src/app/log-view/title-view/ProvenanceFields.d.ts +0 -11
  178. package/lib/src/app/log-view/title-view/ProvenanceFields.d.ts.map +0 -1
  179. package/lib/src/app/samples/error/FlatSampleErrorView.d.ts +0 -10
  180. package/lib/src/app/samples/error/FlatSampleErrorView.d.ts.map +0 -1
  181. package/lib/src/app/samples/sampleDataAdapter.d.ts +0 -7
  182. package/lib/src/app/samples/sampleDataAdapter.d.ts.map +0 -1
  183. package/lib/src/app/samples/transcript/types.d.ts +0 -9
  184. package/lib/src/app/samples/transcript/types.d.ts.map +0 -1
  185. package/lib/src/app/shared/openInNewTab.d.ts +0 -13
  186. package/lib/src/app/shared/openInNewTab.d.ts.map +0 -1
  187. package/lib/src/client/database/utils.d.ts +0 -3
  188. package/lib/src/client/database/utils.d.ts.map +0 -1
  189. package/lib/src/client/remote/zstd-worker-code.d.ts +0 -20
  190. package/lib/src/client/remote/zstd-worker-code.d.ts.map +0 -1
  191. package/lib/src/client/remote/zstd-worker.d.ts.map +0 -1
  192. package/lib/src/components/CodePanel.d.ts +0 -8
  193. package/lib/src/components/CodePanel.d.ts.map +0 -1
  194. package/lib/src/test/nodeBlobWorker.d.ts +0 -2
  195. package/lib/src/test/nodeBlobWorker.d.ts.map +0 -1
  196. package/lib/src/utils/debugging.d.ts +0 -3
  197. package/lib/src/utils/debugging.d.ts.map +0 -1
  198. package/lib/src-s8Cexy_j.js +0 -9977
  199. package/lib/src-s8Cexy_j.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as __require, t as __commonJSMin } from "./rolldown-runtime-B-lAHAz2.js";
2
- import { a as clsx, i as useComponentIcons, n as AnsiDisplay_module_default, t as ToolButton } from "./ToolButton-BmBvTvKO.js";
2
+ import { n as AnsiDisplay_module_default, o as clsx, t as ToolButton } from "./ToolButton-BGW3G4cu.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { useState } from "react";
@@ -1205,12 +1205,11 @@ var AnsiDisplayRich_module_default = {
1205
1205
  //#endregion
1206
1206
  //#region ../../packages/react/src/components/AnsiDisplayRich.tsx
1207
1207
  var RichANSIDisplay = (t0) => {
1208
- const $ = c(18);
1208
+ const $ = c(16);
1209
1209
  const { output, style, className } = t0;
1210
- const icons = useComponentIcons();
1211
1210
  const [showRaw, setShowRaw] = useState(false);
1212
1211
  let t1;
1213
- if ($[0] !== className || $[1] !== icons.code || $[2] !== output || $[3] !== showRaw || $[4] !== style) {
1212
+ if ($[0] !== className || $[1] !== output || $[2] !== showRaw || $[3] !== style) {
1214
1213
  const ansiOutput = new import_ansi_output.ANSIOutput();
1215
1214
  ansiOutput.processOutput(output);
1216
1215
  const getUniformBackgroundColor = () => {
@@ -1242,45 +1241,44 @@ var RichANSIDisplay = (t0) => {
1242
1241
  const backgroundStyle = uniformBackgroundColor ? computeForegroundBackgroundColor(kBackground, uniformBackgroundColor) : {};
1243
1242
  const firstOutputIndex = ansiOutput.outputLines.findIndex(_temp);
1244
1243
  let t2;
1245
- if ($[6] !== className) {
1244
+ if ($[5] !== className) {
1246
1245
  t2 = clsx(AnsiDisplay_module_default.ansiDisplayContainer, AnsiDisplayRich_module_default.container, className);
1247
- $[6] = className;
1248
- $[7] = t2;
1249
- } else t2 = $[7];
1246
+ $[5] = className;
1247
+ $[6] = t2;
1248
+ } else t2 = $[6];
1250
1249
  let t3;
1251
- if ($[8] !== style) {
1250
+ if ($[7] !== style) {
1252
1251
  t3 = { ...style };
1253
- $[8] = style;
1254
- $[9] = t3;
1255
- } else t3 = $[9];
1252
+ $[7] = style;
1253
+ $[8] = t3;
1254
+ } else t3 = $[8];
1256
1255
  let t4;
1257
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
1256
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
1258
1257
  t4 = clsx(AnsiDisplayRich_module_default.toggle, "text-size-smallest");
1259
- $[10] = t4;
1260
- } else t4 = $[10];
1258
+ $[9] = t4;
1259
+ } else t4 = $[9];
1261
1260
  let t5;
1262
- if ($[11] !== showRaw) {
1261
+ if ($[10] !== showRaw) {
1263
1262
  t5 = () => setShowRaw(!showRaw);
1264
- $[11] = showRaw;
1265
- $[12] = t5;
1266
- } else t5 = $[12];
1263
+ $[10] = showRaw;
1264
+ $[11] = t5;
1265
+ } else t5 = $[11];
1267
1266
  const t6 = showRaw ? "Show rendered output" : "Show raw output";
1268
1267
  let t7;
1269
- if ($[13] !== icons.code || $[14] !== showRaw || $[15] !== t5 || $[16] !== t6) {
1268
+ if ($[12] !== showRaw || $[13] !== t5 || $[14] !== t6) {
1270
1269
  t7 = /*#__PURE__*/ jsx(ToolButton, {
1271
1270
  className: t4,
1272
- icon: icons.code,
1271
+ icon: "code",
1273
1272
  label: "",
1274
1273
  latched: showRaw,
1275
1274
  onClick: t5,
1276
1275
  title: t6
1277
1276
  });
1278
- $[13] = icons.code;
1279
- $[14] = showRaw;
1280
- $[15] = t5;
1281
- $[16] = t6;
1282
- $[17] = t7;
1283
- } else t7 = $[17];
1277
+ $[12] = showRaw;
1278
+ $[13] = t5;
1279
+ $[14] = t6;
1280
+ $[15] = t7;
1281
+ } else t7 = $[15];
1284
1282
  t1 = /*#__PURE__*/ jsxs("div", {
1285
1283
  className: t2,
1286
1284
  style: t3,
@@ -1294,12 +1292,11 @@ var RichANSIDisplay = (t0) => {
1294
1292
  })]
1295
1293
  });
1296
1294
  $[0] = className;
1297
- $[1] = icons.code;
1298
- $[2] = output;
1299
- $[3] = showRaw;
1300
- $[4] = style;
1301
- $[5] = t1;
1302
- } else t1 = $[5];
1295
+ $[1] = output;
1296
+ $[2] = showRaw;
1297
+ $[3] = style;
1298
+ $[4] = t1;
1299
+ } else t1 = $[4];
1303
1300
  return t1;
1304
1301
  };
1305
1302
  var kForeground = 0;
@@ -1428,4 +1425,4 @@ function _temp2(outputRun) {
1428
1425
  //#endregion
1429
1426
  export { RichANSIDisplay as default };
1430
1427
 
1431
- //# sourceMappingURL=AnsiDisplayRich-302CIkEj.js.map
1428
+ //# sourceMappingURL=AnsiDisplayRich-Dpc1-E4A.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnsiDisplayRich-Dpc1-E4A.js","names":["exports","ANSIColor","ANSIOutput","ANSIStyle","clsx","useState","ansiStyles","styles","ToolButton","RichANSIDisplay","kForeground","kBackground","OutputRun","computeCSSProperties","outputRun","format","computeStyles","computeForegroundBackgroundColor","foregroundColor","backgroundColor","cssProperties","forEach","style","Bold","fontWeight","Dim","Italic","fontStyle","Underlined","textDecorationLine","textDecorationStyle","SlowBlink","animation","RapidBlink","Hidden","visibility","CrossedOut","DoubleUnderlined","colorType","color","undefined","Black","Red","Green","Yellow","Blue","Magenta","Cyan","White","BrightBlack","BrightRed","BrightGreen","BrightYellow","BrightBlue","BrightMagenta","BrightCyan","BrightWhite","background","_c","ANSIOutput","ansiStyles","styles","ANSIStyle","ANSIColor"],"sources":["../../../node_modules/.pnpm/ansi-output@0.0.9/node_modules/ansi-output/dist/ansi-output.js","../../../packages/react/src/components/AnsiDisplayRich.module.css","../../../packages/react/src/components/AnsiDisplayRich.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (C) 2023 Brian Lambert. All rights reserved.\n *--------------------------------------------------------------------------------------------*/\n(function (factory) {\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n var v = factory(require, exports);\n if (v !== undefined) module.exports = v;\n }\n else if (typeof define === \"function\" && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.ANSIOutput = exports.ANSIColor = exports.ANSIFont = exports.ANSIStyle = void 0;\n //#region Exports\n /**\n * The counter used to generate identifiers.\n */\n let counter = 0;\n /**\n * Generates an identifier.\n * @returns The identifier.\n */\n const generateId = () => {\n return `${++counter}`.padStart(16, '0');\n };\n /**\n * ANSIStyle enumeration.\n */\n var ANSIStyle;\n (function (ANSIStyle) {\n ANSIStyle[\"Bold\"] = \"ansiBold\";\n ANSIStyle[\"Dim\"] = \"ansiDim\";\n ANSIStyle[\"Italic\"] = \"ansiItalic\";\n ANSIStyle[\"Underlined\"] = \"ansiUnderlined\";\n ANSIStyle[\"SlowBlink\"] = \"ansiSlowBlink\";\n ANSIStyle[\"RapidBlink\"] = \"ansiRapidBlink\";\n ANSIStyle[\"Hidden\"] = \"ansiHidden\";\n ANSIStyle[\"CrossedOut\"] = \"ansiCrossedOut\";\n ANSIStyle[\"Fraktur\"] = \"ansiFraktur\";\n ANSIStyle[\"DoubleUnderlined\"] = \"ansiDoubleUnderlined\";\n ANSIStyle[\"Framed\"] = \"ansiFramed\";\n ANSIStyle[\"Encircled\"] = \"ansiEncircled\";\n ANSIStyle[\"Overlined\"] = \"ansiOverlined\";\n ANSIStyle[\"Superscript\"] = \"ansiSuperscript\";\n ANSIStyle[\"Subscript\"] = \"ansiSubscript\";\n })(ANSIStyle || (exports.ANSIStyle = ANSIStyle = {}));\n /**\n * ANSIFont enumeration.\n */\n var ANSIFont;\n (function (ANSIFont) {\n ANSIFont[\"AlternativeFont1\"] = \"ansiAlternativeFont1\";\n ANSIFont[\"AlternativeFont2\"] = \"ansiAlternativeFont2\";\n ANSIFont[\"AlternativeFont3\"] = \"ansiAlternativeFont3\";\n ANSIFont[\"AlternativeFont4\"] = \"ansiAlternativeFont4\";\n ANSIFont[\"AlternativeFont5\"] = \"ansiAlternativeFont5\";\n ANSIFont[\"AlternativeFont6\"] = \"ansiAlternativeFont6\";\n ANSIFont[\"AlternativeFont7\"] = \"ansiAlternativeFont7\";\n ANSIFont[\"AlternativeFont8\"] = \"ansiAlternativeFont8\";\n ANSIFont[\"AlternativeFont9\"] = \"ansiAlternativeFont9\";\n })(ANSIFont || (exports.ANSIFont = ANSIFont = {}));\n /**\n * SGRColor enumeration.\n */\n var ANSIColor;\n (function (ANSIColor) {\n ANSIColor[\"Black\"] = \"ansiBlack\";\n ANSIColor[\"Red\"] = \"ansiRed\";\n ANSIColor[\"Green\"] = \"ansiGreen\";\n ANSIColor[\"Yellow\"] = \"ansiYellow\";\n ANSIColor[\"Blue\"] = \"ansiBlue\";\n ANSIColor[\"Magenta\"] = \"ansiMagenta\";\n ANSIColor[\"Cyan\"] = \"ansiCyan\";\n ANSIColor[\"White\"] = \"ansiWhite\";\n ANSIColor[\"BrightBlack\"] = \"ansiBrightBlack\";\n ANSIColor[\"BrightRed\"] = \"ansiBrightRed\";\n ANSIColor[\"BrightGreen\"] = \"ansiBrightGreen\";\n ANSIColor[\"BrightYellow\"] = \"ansiBrightYellow\";\n ANSIColor[\"BrightBlue\"] = \"ansiBrightBlue\";\n ANSIColor[\"BrightMagenta\"] = \"ansiBrightMagenta\";\n ANSIColor[\"BrightCyan\"] = \"ansiBrightCyan\";\n ANSIColor[\"BrightWhite\"] = \"ansiBrightWhite\";\n })(ANSIColor || (exports.ANSIColor = ANSIColor = {}));\n /**\n * ANSIOutput class.\n */\n class ANSIOutput {\n //#region Private Properties\n /**\n * Gets or sets the parser state.\n */\n _parserState = ParserState.BufferingOutput;\n /**\n * Gets or sets the control sequence that's being parsed.\n */\n _controlSequence = '';\n /**\n * Gets or sets the SGR state.\n */\n _sgrState = undefined;\n /**\n * Gets or sets the current set of output lines.\n */\n _outputLines = [];\n /**\n * Gets or sets the output line.\n */\n _outputLine = 0;\n /**\n * Gets or sets the output column.\n */\n _outputColumn = 0;\n /**\n * Gets or sets the buffer.\n */\n _buffer = '';\n /**\n * Gets or sets a value which indicates whether there is a pending newline.\n */\n _pendingNewline = false;\n //#endregion Private Properties\n //#region Public Properties\n /**\n * Gets the output lines.\n */\n get outputLines() {\n this.flushBuffer();\n return this._outputLines;\n }\n //#endregion Public Properties\n //#region Public Static Methods\n /**\n * Processes output and returns the ANSIOutput lines of the output.\n * @param output The output to process.\n * @returns The ANSIOutput lines of the output.\n */\n static processOutput(output) {\n const ansiOutput = new ANSIOutput();\n ansiOutput.processOutput(output);\n return ansiOutput.outputLines;\n }\n //#endregion Public Static Methods\n //#region Public Methods\n /**\n * Processes output.\n * @param output The output to process.\n */\n processOutput(output) {\n // For now, dump output to the console for tracing.\n // TODO@softwarenerd - Use DI to get logging into ANSIOutput.\n // let loggingOutput = output;\n // loggingOutput = loggingOutput.replaceAll('\\n', '[LF]');\n // loggingOutput = loggingOutput.replaceAll('\\r', '[CR]');\n // loggingOutput = loggingOutput.replaceAll('\\x9B', 'CSI');\n // loggingOutput = loggingOutput.replaceAll('\\x1b', 'ESC');\n // loggingOutput = loggingOutput.replaceAll('\\x9B', 'CSI');\n // console.log(`ANSIOutput: Processing Output: \"${loggingOutput}\"`);\n // Enumerate the characters in the output.\n for (let i = 0; i < output.length; i++) {\n // If there is a pending newline, process it.\n if (this._pendingNewline) {\n // Flush the buffer.\n this.flushBuffer();\n // Adjust the output line and output column.\n this._outputLine++;\n this._outputColumn = 0;\n // Clear the pending newline flag.\n this._pendingNewline = false;\n }\n // Get the character.\n const char = output.charAt(i);\n // Parse the character.\n if (this._parserState === ParserState.BufferingOutput) {\n // Check for the start of an control sequence (or CSI). This can be \\x1b[ or \\x9b.\n if (char === '\\x1b') {\n // Flush the buffer.\n this.flushBuffer();\n // Enter the control sequence started state.\n this._parserState = ParserState.ControlSequenceStarted;\n }\n else if (char === '\\x9b') {\n // Flush the buffer.\n this.flushBuffer();\n // Enter the parsing control sequence state.\n this._parserState = ParserState.ParsingControlSequence;\n }\n else {\n // Process the character.\n this.processCharacter(char);\n }\n }\n else if (this._parserState === ParserState.ControlSequenceStarted) {\n // Check for CSI.\n if (char === '[') {\n // Enter the parsing control sequence state.\n this._parserState = ParserState.ParsingControlSequence;\n }\n else {\n // We encountered an ESC that is not part of a CSI. Ignore the ESC, go back to\n // the buffering output state.\n this._parserState = ParserState.BufferingOutput;\n // Process the character.\n this.processCharacter(char);\n }\n }\n else if (this._parserState === ParserState.ParsingControlSequence) {\n // Append the character to the control sequence.\n this._controlSequence += char;\n // If this character ends the control sequence, process it.\n if (char.match(/^[A-Za-z]$/)) {\n this.processControlSequence();\n }\n }\n }\n // Flush the buffer at the end of the output.\n this.flushBuffer();\n }\n //#endregion Public Methods\n //#region Private Methods\n /**\n * Flushes the buffer to the output line.\n */\n flushBuffer() {\n // Ensure that we have sufficient output lines in the output lines array.\n for (let i = this._outputLines.length; i < this._outputLine + 1; i++) {\n this._outputLines.push(new OutputLine());\n }\n // If the buffer isn't empty, flush it.\n if (this._buffer) {\n // Get the output line.\n const outputLine = this._outputLines[this._outputLine];\n // Insert the buffer into the output line.\n outputLine.insert(this._buffer, this._outputColumn, this._sgrState);\n // Adjust the output column and empty the buffer.\n this._outputColumn += this._buffer.length;\n this._buffer = '';\n }\n }\n /**\n * Processes a character.\n * @param char The character.\n */\n processCharacter(char) {\n // Handle special characters. Otherwise, buffer the character.\n switch (char) {\n // LF sets the pending newline flag.\n case '\\n':\n this._pendingNewline = true;\n break;\n // CR flushes the buffer and sets the output column to 0.\n case '\\r':\n this.flushBuffer();\n this._outputColumn = 0;\n break;\n // Buffer the character.\n default:\n this._buffer += char;\n break;\n }\n }\n /**\n * Processes a control sequence.\n */\n processControlSequence() {\n // Process SGR control sequence.\n switch (this._controlSequence.charAt(this._controlSequence.length - 1)) {\n // CUU (Cursor Up).\n case 'A':\n this.processCUU();\n break;\n // CUD (Cursor Down).\n case 'B':\n this.processCUD();\n break;\n // CUF (Cursor Forward).\n case 'C':\n this.processCUF();\n break;\n // CUB (Cursor Backward).\n case 'D':\n this.processCUB();\n break;\n // CUP (Cursor Position).\n case 'H':\n this.processCUP();\n break;\n // ED (Erase in Display).\n case 'J':\n this.processED();\n break;\n // EL (Erase in Line).\n case 'K':\n this.processEL();\n break;\n // SGR (Select Graphic Rendition).\n case 'm':\n this.processSGR();\n break;\n // Unsupported control sequence.\n default:\n // console.log(`Unsupported control sequence: CSI${this._controlSequence}`);\n break;\n }\n // Clear the control sequence and go back to the buffering output state.\n this._controlSequence = '';\n this._parserState = ParserState.BufferingOutput;\n }\n /**\n * Processes a CUU (Cursor Up) control sequence.\n */\n processCUU() {\n // Match the control sequence.\n const match = this._controlSequence.match(/^([0-9]*)A$/);\n if (match) {\n this._outputLine = Math.max(this._outputLine - rangeParam(match[1], 1, 1), 0);\n }\n }\n /**\n * Processes a CUD (Cursor Down) control sequence.\n */\n processCUD() {\n // Match the control sequence.\n const match = this._controlSequence.match(/^([0-9]*)B$/);\n if (match) {\n this._outputLine = this._outputLine + rangeParam(match[1], 1, 1);\n }\n }\n /**\n * Processes a CUF (Cursor Forward) control sequence.\n */\n processCUF() {\n // Match the control sequence.\n const match = this._controlSequence.match(/^([0-9]*)C$/);\n if (match) {\n this._outputColumn = this._outputColumn + rangeParam(match[1], 1, 1);\n }\n }\n /**\n * Processes a CUB (Cursor Backward) control sequence.\n */\n processCUB() {\n // Match the control sequence.\n const match = this._controlSequence.match(/^([0-9]*)D$/);\n if (match) {\n this._outputColumn = Math.max(this._outputColumn - rangeParam(match[1], 1, 1), 0);\n }\n }\n /**\n * Processes a CUP (Cursor Position) control sequence.\n */\n processCUP() {\n // Match the control sequence.\n const match = this._controlSequence.match(/^([0-9]*)(?:;?([0-9]*))H$/);\n if (match) {\n this._outputLine = rangeParam(match[1], 1, 1) - 1;\n this._outputColumn = rangeParam(match[2], 1, 1) - 1;\n }\n }\n /**\n * Processes an ED (Erase in Display) control sequence.\n */\n processED() {\n // Match the control sequence.\n const match = this._controlSequence.match(/^([0-9]*)J$/);\n if (match) {\n // Process the parameter.\n switch (getParam(match[1], 0)) {\n // Clear from cursor to the end of the screen.\n case 0:\n this._outputLines[this._outputLine].clearToEndOfLine(this._outputColumn);\n for (let i = this._outputLine + 1; i < this._outputLines.length; i++) {\n this._outputLines[i].clearEntireLine();\n }\n break;\n // Clear from cursor to the beginning of the screen.\n case 1:\n this._outputLines[this._outputLine].clearToBeginningOfLine(this._outputColumn);\n for (let i = 0; i < this._outputLine; i++) {\n this._outputLines[i].clearEntireLine();\n }\n break;\n // Clear the entire screen.\n case 2:\n for (let i = 0; i < this._outputLines.length; i++) {\n this._outputLines[i].clearEntireLine();\n }\n break;\n }\n }\n }\n /**\n * Processes an EL (Erase in Line) control sequence.\n */\n processEL() {\n // Match the control sequence.\n const match = this._controlSequence.match(/^([0-9]*)K$/);\n if (match) {\n // Get the output line.\n const outputLine = this._outputLines[this._outputLine];\n // Process the parameter.\n switch (getParam(match[1], 0)) {\n // Clear from cursor to the end of the line.\n case 0:\n outputLine.clearToEndOfLine(this._outputColumn);\n break;\n // Clear from cursor to the beginning of the line.\n case 1:\n outputLine.clearToBeginningOfLine(this._outputColumn);\n break;\n // Clear the entire line.\n case 2:\n outputLine.clearEntireLine();\n break;\n }\n }\n }\n /**\n * Processes an SGR (Select Graphic Rendition) control sequence.\n */\n processSGR() {\n // Create the working SGR state.\n const sgrState = this._sgrState ? this._sgrState.copy() : new SGRState();\n // Parse the SGR parameters.\n const sgrParams = this._controlSequence\n // Remove ending character.\n .slice(0, -1)\n // Split the SGR parameters.\n .split(';')\n // Parse the parameters. An empty parameter is a reset. (As an\n // exampple, CSI31;m does not produce red output.)\n .map(sgrParam => sgrParam === '' ? SGRParam.Reset : parseInt(sgrParam, 10));\n // Process the SGR parameters.\n for (let index = 0; index < sgrParams.length; index++) {\n // Get the SGR parameter.\n const sgrParam = sgrParams[index];\n /**\n * Process SetForeground, SetBackground, or SetUnderline. Contrary to information you\n * will find on the web, these parameters can be combined with other parameters. As an\n * example:\n *\n * For the 256-color palette:\n * console.log('\\x1b[31;38;5;196mThis will be red\\x1b[m');\n * console.log('\\x1b[31;38;5;20mThis will be blue\\x1b[m')\n *\n * For RGB:\n * console.log('\\x1b[31;38;2;255;0;0mThis will be red\\x1b[m');\n * console.log('\\x1b[31;38;2;0;0;255mThis will be blue\\x1b[m');\n */\n const processSetColor = () => {\n // If there isn't an SGRColorParam in the parameters, return undefined to indicate\n // that we did not process the set color.\n if (index + 1 === sgrParams.length) {\n return undefined;\n }\n // Advance to the next parameter and process the SGRColorParam,\n // which should be next.\n switch (sgrParams[++index]) {\n // SGRColorParam.Color256 is an indexed color.\n case SGRParamColor.Color256: {\n // If there isn't an indexed color parameter, return undefined to indicate\n // that we did not process the set color.\n if (index + 1 === sgrParams.length) {\n return undefined;\n }\n // Get the color index.\n const colorIndex = sgrParams[++index];\n // Process the color index. The first 16 indexes map to normal ANSIColors.\n switch (colorIndex) {\n case SGRParamIndexedColor.Black:\n return ANSIColor.Black;\n case SGRParamIndexedColor.Red:\n return ANSIColor.Red;\n case SGRParamIndexedColor.Green:\n return ANSIColor.Green;\n case SGRParamIndexedColor.Yellow:\n return ANSIColor.Yellow;\n case SGRParamIndexedColor.Blue:\n return ANSIColor.Blue;\n case SGRParamIndexedColor.Magenta:\n return ANSIColor.Magenta;\n case SGRParamIndexedColor.Cyan:\n return ANSIColor.Cyan;\n case SGRParamIndexedColor.White:\n return ANSIColor.White;\n case SGRParamIndexedColor.BrightBlack:\n return ANSIColor.BrightBlack;\n case SGRParamIndexedColor.BrightRed:\n return ANSIColor.BrightRed;\n case SGRParamIndexedColor.BrightGreen:\n return ANSIColor.BrightGreen;\n case SGRParamIndexedColor.BrightYellow:\n return ANSIColor.BrightYellow;\n case SGRParamIndexedColor.BrightBlue:\n return ANSIColor.BrightBlue;\n case SGRParamIndexedColor.BrightMagenta:\n return ANSIColor.BrightMagenta;\n case SGRParamIndexedColor.BrightCyan:\n return ANSIColor.BrightCyan;\n case SGRParamIndexedColor.BrightWhite:\n return ANSIColor.BrightWhite;\n // Process other color indexes.\n default:\n // Sanity check that the color index is an integer.\n if (colorIndex % 1 !== 0) {\n return undefined;\n }\n // Process the color index as RGB or grayscale.\n if (colorIndex >= 16 && colorIndex <= 231) {\n // Convert the color index to one of 216 RGB colors.\n let colorNumber = colorIndex - 16;\n let blue = colorNumber % 6;\n colorNumber = (colorNumber - blue) / 6;\n let green = colorNumber % 6;\n colorNumber = (colorNumber - green) / 6;\n let red = colorNumber;\n // Map red, green, and blue from 0-5 to 0-255.\n blue = Math.round(blue * 255 / 5);\n green = Math.round(green * 255 / 5);\n red = Math.round(red * 255 / 5);\n // Return the RGB color.\n return '#' +\n twoDigitHex(red) +\n twoDigitHex(green) +\n twoDigitHex(blue);\n }\n else if (colorIndex >= 232 && colorIndex <= 255) {\n // Calculate the grayscale value.\n const rgb = Math.round((colorIndex - 232) / 23 * 255);\n const grayscale = twoDigitHex(rgb);\n // Return the RGB color.\n return '#' + grayscale + grayscale + grayscale;\n }\n else {\n // Wonky!\n return undefined;\n }\n }\n }\n // SGRParamColor.ColorRGB is an r;g;b color.\n case SGRParamColor.ColorRGB: {\n // The r;g;b components are optional.\n const rgb = [0, 0, 0];\n for (let i = 0; i < 3 && index + 1 < sgrParams.length; i++) {\n rgb[i] = sgrParams[++index];\n }\n // Return the RGB color.\n return '#' +\n twoDigitHex(rgb[0]) +\n twoDigitHex(rgb[1]) +\n twoDigitHex(rgb[2]);\n }\n }\n // The set color was not regognized.\n return undefined;\n };\n // Process the SGR parameter.\n switch (sgrParam) {\n case SGRParam.Reset:\n sgrState.reset();\n break;\n case SGRParam.Bold:\n sgrState.setStyle(ANSIStyle.Bold);\n break;\n case SGRParam.Dim:\n sgrState.setStyle(ANSIStyle.Dim);\n break;\n case SGRParam.Italic:\n sgrState.setStyle(ANSIStyle.Italic);\n break;\n case SGRParam.Underlined:\n sgrState.setStyle(ANSIStyle.Underlined, ANSIStyle.DoubleUnderlined);\n break;\n case SGRParam.SlowBlink:\n sgrState.setStyle(ANSIStyle.SlowBlink, ANSIStyle.RapidBlink);\n break;\n case SGRParam.RapidBlink:\n sgrState.setStyle(ANSIStyle.RapidBlink, ANSIStyle.SlowBlink);\n break;\n case SGRParam.Reversed:\n sgrState.setReversed(true);\n break;\n case SGRParam.Hidden:\n sgrState.setStyle(ANSIStyle.Hidden);\n break;\n case SGRParam.CrossedOut:\n sgrState.setStyle(ANSIStyle.CrossedOut);\n break;\n case SGRParam.PrimaryFont:\n sgrState.setFont();\n break;\n case SGRParam.AlternativeFont1:\n sgrState.setFont(ANSIFont.AlternativeFont1);\n break;\n case SGRParam.AlternativeFont2:\n sgrState.setFont(ANSIFont.AlternativeFont2);\n break;\n case SGRParam.AlternativeFont3:\n sgrState.setFont(ANSIFont.AlternativeFont3);\n break;\n case SGRParam.AlternativeFont4:\n sgrState.setFont(ANSIFont.AlternativeFont4);\n break;\n case SGRParam.AlternativeFont5:\n sgrState.setFont(ANSIFont.AlternativeFont5);\n break;\n case SGRParam.AlternativeFont6:\n sgrState.setFont(ANSIFont.AlternativeFont6);\n break;\n case SGRParam.AlternativeFont7:\n sgrState.setFont(ANSIFont.AlternativeFont7);\n break;\n case SGRParam.AlternativeFont8:\n sgrState.setFont(ANSIFont.AlternativeFont8);\n break;\n case SGRParam.AlternativeFont9:\n sgrState.setFont(ANSIFont.AlternativeFont9);\n break;\n case SGRParam.Fraktur:\n sgrState.setStyle(ANSIStyle.Fraktur);\n break;\n case SGRParam.DoubleUnderlined:\n sgrState.setStyle(ANSIStyle.DoubleUnderlined, ANSIStyle.Underlined);\n break;\n case SGRParam.NormalIntensity:\n sgrState.deleteStyles(ANSIStyle.Bold, ANSIStyle.Dim);\n break;\n case SGRParam.NotItalicNotFraktur:\n sgrState.deleteStyles(ANSIStyle.Italic, ANSIStyle.Fraktur);\n break;\n case SGRParam.NotUnderlined:\n sgrState.deleteStyles(ANSIStyle.Underlined, ANSIStyle.DoubleUnderlined);\n break;\n case SGRParam.NotBlinking:\n sgrState.deleteStyles(ANSIStyle.SlowBlink, ANSIStyle.RapidBlink);\n break;\n case SGRParam.ProportionalSpacing:\n // Do nothing.\n break;\n case SGRParam.NotReversed:\n sgrState.setReversed(false);\n break;\n case SGRParam.Reveal:\n sgrState.deleteStyles(ANSIStyle.Hidden);\n break;\n case SGRParam.NotCrossedOut:\n sgrState.deleteStyles(ANSIStyle.CrossedOut);\n break;\n case SGRParam.ForegroundBlack:\n sgrState.setForegroundColor(ANSIColor.Black);\n break;\n case SGRParam.ForegroundRed:\n sgrState.setForegroundColor(ANSIColor.Red);\n break;\n case SGRParam.ForegroundGreen:\n sgrState.setForegroundColor(ANSIColor.Green);\n break;\n case SGRParam.ForegroundYellow:\n sgrState.setForegroundColor(ANSIColor.Yellow);\n break;\n case SGRParam.ForegroundBlue:\n sgrState.setForegroundColor(ANSIColor.Blue);\n break;\n case SGRParam.ForegroundMagenta:\n sgrState.setForegroundColor(ANSIColor.Magenta);\n break;\n case SGRParam.ForegroundCyan:\n sgrState.setForegroundColor(ANSIColor.Cyan);\n break;\n case SGRParam.ForegroundWhite:\n sgrState.setForegroundColor(ANSIColor.White);\n break;\n case SGRParam.SetForeground: {\n const foregroundColor = processSetColor();\n if (foregroundColor) {\n sgrState.setForegroundColor(foregroundColor);\n }\n break;\n }\n case SGRParam.DefaultForeground:\n sgrState.setForegroundColor();\n break;\n case SGRParam.BackgroundBlack:\n sgrState.setBackgroundColor(ANSIColor.Black);\n break;\n case SGRParam.BackgroundRed:\n sgrState.setBackgroundColor(ANSIColor.Red);\n break;\n case SGRParam.BackgroundGreen:\n sgrState.setBackgroundColor(ANSIColor.Green);\n break;\n case SGRParam.BackgroundYellow:\n sgrState.setBackgroundColor(ANSIColor.Yellow);\n break;\n case SGRParam.BackgroundBlue:\n sgrState.setBackgroundColor(ANSIColor.Blue);\n break;\n case SGRParam.BackgroundMagenta:\n sgrState.setBackgroundColor(ANSIColor.Magenta);\n break;\n case SGRParam.BackgroundCyan:\n sgrState.setBackgroundColor(ANSIColor.Cyan);\n break;\n case SGRParam.BackgroundWhite:\n sgrState.setBackgroundColor(ANSIColor.White);\n break;\n case SGRParam.SetBackground: {\n const backgroundColor = processSetColor();\n if (backgroundColor) {\n sgrState.setBackgroundColor(backgroundColor);\n }\n break;\n }\n case SGRParam.DefaultBackground:\n sgrState.setBackgroundColor();\n break;\n case SGRParam.ForegroundBrightBlack:\n sgrState.setForegroundColor(ANSIColor.BrightBlack);\n break;\n case SGRParam.ForegroundBrightRed:\n sgrState.setForegroundColor(ANSIColor.BrightRed);\n break;\n case SGRParam.ForegroundBrightGreen:\n sgrState.setForegroundColor(ANSIColor.BrightGreen);\n break;\n case SGRParam.ForegroundBrightYellow:\n sgrState.setForegroundColor(ANSIColor.BrightYellow);\n break;\n case SGRParam.ForegroundBrightBlue:\n sgrState.setForegroundColor(ANSIColor.BrightBlue);\n break;\n case SGRParam.ForegroundBrightMagenta:\n sgrState.setForegroundColor(ANSIColor.BrightMagenta);\n break;\n case SGRParam.ForegroundBrightCyan:\n sgrState.setForegroundColor(ANSIColor.BrightCyan);\n break;\n case SGRParam.ForegroundBrightWhite:\n sgrState.setForegroundColor(ANSIColor.BrightWhite);\n break;\n case SGRParam.BackgroundBrightBlack:\n sgrState.setBackgroundColor(ANSIColor.BrightBlack);\n break;\n case SGRParam.BackgroundBrightRed:\n sgrState.setBackgroundColor(ANSIColor.BrightRed);\n break;\n case SGRParam.BackgroundBrightGreen:\n sgrState.setBackgroundColor(ANSIColor.BrightGreen);\n break;\n case SGRParam.BackgroundBrightYellow:\n sgrState.setBackgroundColor(ANSIColor.BrightYellow);\n break;\n case SGRParam.BackgroundBrightBlue:\n sgrState.setBackgroundColor(ANSIColor.BrightBlue);\n break;\n case SGRParam.BackgroundBrightMagenta:\n sgrState.setBackgroundColor(ANSIColor.BrightMagenta);\n break;\n case SGRParam.BackgroundBrightCyan:\n sgrState.setBackgroundColor(ANSIColor.BrightCyan);\n break;\n case SGRParam.BackgroundBrightWhite:\n sgrState.setBackgroundColor(ANSIColor.BrightWhite);\n break;\n // Unexpected SGR parameter.\n default:\n // console.log(` Unexpected SGR parameter: ${sgrParam}`);\n break;\n }\n }\n // Detect changes in SGR state.\n if (!SGRState.equivalent(sgrState, this._sgrState)) {\n this._sgrState = sgrState;\n }\n }\n }\n exports.ANSIOutput = ANSIOutput;\n //#endregion Exports\n //#region Private Enumerations\n /**\n * SGRParam enumeration.\n */\n var SGRParam;\n (function (SGRParam) {\n SGRParam[SGRParam[\"Reset\"] = 0] = \"Reset\";\n SGRParam[SGRParam[\"Bold\"] = 1] = \"Bold\";\n SGRParam[SGRParam[\"Dim\"] = 2] = \"Dim\";\n SGRParam[SGRParam[\"Italic\"] = 3] = \"Italic\";\n SGRParam[SGRParam[\"Underlined\"] = 4] = \"Underlined\";\n SGRParam[SGRParam[\"SlowBlink\"] = 5] = \"SlowBlink\";\n SGRParam[SGRParam[\"RapidBlink\"] = 6] = \"RapidBlink\";\n SGRParam[SGRParam[\"Reversed\"] = 7] = \"Reversed\";\n SGRParam[SGRParam[\"Hidden\"] = 8] = \"Hidden\";\n SGRParam[SGRParam[\"CrossedOut\"] = 9] = \"CrossedOut\";\n SGRParam[SGRParam[\"PrimaryFont\"] = 10] = \"PrimaryFont\";\n SGRParam[SGRParam[\"AlternativeFont1\"] = 11] = \"AlternativeFont1\";\n SGRParam[SGRParam[\"AlternativeFont2\"] = 12] = \"AlternativeFont2\";\n SGRParam[SGRParam[\"AlternativeFont3\"] = 13] = \"AlternativeFont3\";\n SGRParam[SGRParam[\"AlternativeFont4\"] = 14] = \"AlternativeFont4\";\n SGRParam[SGRParam[\"AlternativeFont5\"] = 15] = \"AlternativeFont5\";\n SGRParam[SGRParam[\"AlternativeFont6\"] = 16] = \"AlternativeFont6\";\n SGRParam[SGRParam[\"AlternativeFont7\"] = 17] = \"AlternativeFont7\";\n SGRParam[SGRParam[\"AlternativeFont8\"] = 18] = \"AlternativeFont8\";\n SGRParam[SGRParam[\"AlternativeFont9\"] = 19] = \"AlternativeFont9\";\n SGRParam[SGRParam[\"Fraktur\"] = 20] = \"Fraktur\";\n SGRParam[SGRParam[\"DoubleUnderlined\"] = 21] = \"DoubleUnderlined\";\n SGRParam[SGRParam[\"NormalIntensity\"] = 22] = \"NormalIntensity\";\n SGRParam[SGRParam[\"NotItalicNotFraktur\"] = 23] = \"NotItalicNotFraktur\";\n SGRParam[SGRParam[\"NotUnderlined\"] = 24] = \"NotUnderlined\";\n SGRParam[SGRParam[\"NotBlinking\"] = 25] = \"NotBlinking\";\n SGRParam[SGRParam[\"ProportionalSpacing\"] = 26] = \"ProportionalSpacing\";\n SGRParam[SGRParam[\"NotReversed\"] = 27] = \"NotReversed\";\n SGRParam[SGRParam[\"Reveal\"] = 28] = \"Reveal\";\n SGRParam[SGRParam[\"NotCrossedOut\"] = 29] = \"NotCrossedOut\";\n SGRParam[SGRParam[\"ForegroundBlack\"] = 30] = \"ForegroundBlack\";\n SGRParam[SGRParam[\"ForegroundRed\"] = 31] = \"ForegroundRed\";\n SGRParam[SGRParam[\"ForegroundGreen\"] = 32] = \"ForegroundGreen\";\n SGRParam[SGRParam[\"ForegroundYellow\"] = 33] = \"ForegroundYellow\";\n SGRParam[SGRParam[\"ForegroundBlue\"] = 34] = \"ForegroundBlue\";\n SGRParam[SGRParam[\"ForegroundMagenta\"] = 35] = \"ForegroundMagenta\";\n SGRParam[SGRParam[\"ForegroundCyan\"] = 36] = \"ForegroundCyan\";\n SGRParam[SGRParam[\"ForegroundWhite\"] = 37] = \"ForegroundWhite\";\n SGRParam[SGRParam[\"SetForeground\"] = 38] = \"SetForeground\";\n SGRParam[SGRParam[\"DefaultForeground\"] = 39] = \"DefaultForeground\";\n SGRParam[SGRParam[\"BackgroundBlack\"] = 40] = \"BackgroundBlack\";\n SGRParam[SGRParam[\"BackgroundRed\"] = 41] = \"BackgroundRed\";\n SGRParam[SGRParam[\"BackgroundGreen\"] = 42] = \"BackgroundGreen\";\n SGRParam[SGRParam[\"BackgroundYellow\"] = 43] = \"BackgroundYellow\";\n SGRParam[SGRParam[\"BackgroundBlue\"] = 44] = \"BackgroundBlue\";\n SGRParam[SGRParam[\"BackgroundMagenta\"] = 45] = \"BackgroundMagenta\";\n SGRParam[SGRParam[\"BackgroundCyan\"] = 46] = \"BackgroundCyan\";\n SGRParam[SGRParam[\"BackgroundWhite\"] = 47] = \"BackgroundWhite\";\n SGRParam[SGRParam[\"SetBackground\"] = 48] = \"SetBackground\";\n SGRParam[SGRParam[\"DefaultBackground\"] = 49] = \"DefaultBackground\";\n SGRParam[SGRParam[\"DisableProportionalSpacing\"] = 50] = \"DisableProportionalSpacing\";\n SGRParam[SGRParam[\"Framed\"] = 51] = \"Framed\";\n SGRParam[SGRParam[\"Encircled\"] = 52] = \"Encircled\";\n SGRParam[SGRParam[\"Overlined\"] = 53] = \"Overlined\";\n SGRParam[SGRParam[\"NotFramedNotEncircled\"] = 54] = \"NotFramedNotEncircled\";\n SGRParam[SGRParam[\"NotOverlined\"] = 55] = \"NotOverlined\";\n // 56 unsupported\n // 57 unsupported\n SGRParam[SGRParam[\"SetUnderline\"] = 58] = \"SetUnderline\";\n SGRParam[SGRParam[\"DefaultUnderline\"] = 59] = \"DefaultUnderline\";\n SGRParam[SGRParam[\"IdeogramUnderlineOrRightSideLine\"] = 60] = \"IdeogramUnderlineOrRightSideLine\";\n SGRParam[SGRParam[\"IdeogramDoubleUnderlineOrDoubleRightSideLine\"] = 61] = \"IdeogramDoubleUnderlineOrDoubleRightSideLine\";\n SGRParam[SGRParam[\"IdeogramOverlineOrLeftSideLine\"] = 62] = \"IdeogramOverlineOrLeftSideLine\";\n SGRParam[SGRParam[\"IdeogramDoubleOverlineOrDoubleLeftSideLine\"] = 63] = \"IdeogramDoubleOverlineOrDoubleLeftSideLine\";\n SGRParam[SGRParam[\"IdeogramStressMarking\"] = 64] = \"IdeogramStressMarking\";\n SGRParam[SGRParam[\"NoIdeogramAttributes\"] = 65] = \"NoIdeogramAttributes\";\n // 66 unsupported\n // 67 unsupported\n // 68 unsupported\n // 69 unsupported\n // 70 unsupported\n // 71 unsupported\n // 72 unsupported\n SGRParam[SGRParam[\"Superscript\"] = 73] = \"Superscript\";\n SGRParam[SGRParam[\"Subscript\"] = 74] = \"Subscript\";\n SGRParam[SGRParam[\"NotSuperscriptNotSubscript\"] = 75] = \"NotSuperscriptNotSubscript\";\n // 76 unsupported\n // 77 unsupported\n // 78 unsupported\n // 79 unsupported\n // 80 unsupported\n // 81 unsupported\n // 82 unsupported\n // 83 unsupported\n // 84 unsupported\n // 85 unsupported\n // 86 unsupported\n // 87 unsupported\n // 88 unsupported\n // 89 unsupported\n SGRParam[SGRParam[\"ForegroundBrightBlack\"] = 90] = \"ForegroundBrightBlack\";\n SGRParam[SGRParam[\"ForegroundBrightRed\"] = 91] = \"ForegroundBrightRed\";\n SGRParam[SGRParam[\"ForegroundBrightGreen\"] = 92] = \"ForegroundBrightGreen\";\n SGRParam[SGRParam[\"ForegroundBrightYellow\"] = 93] = \"ForegroundBrightYellow\";\n SGRParam[SGRParam[\"ForegroundBrightBlue\"] = 94] = \"ForegroundBrightBlue\";\n SGRParam[SGRParam[\"ForegroundBrightMagenta\"] = 95] = \"ForegroundBrightMagenta\";\n SGRParam[SGRParam[\"ForegroundBrightCyan\"] = 96] = \"ForegroundBrightCyan\";\n SGRParam[SGRParam[\"ForegroundBrightWhite\"] = 97] = \"ForegroundBrightWhite\";\n // 98 unsupported\n // 99 unsupported\n SGRParam[SGRParam[\"BackgroundBrightBlack\"] = 100] = \"BackgroundBrightBlack\";\n SGRParam[SGRParam[\"BackgroundBrightRed\"] = 101] = \"BackgroundBrightRed\";\n SGRParam[SGRParam[\"BackgroundBrightGreen\"] = 102] = \"BackgroundBrightGreen\";\n SGRParam[SGRParam[\"BackgroundBrightYellow\"] = 103] = \"BackgroundBrightYellow\";\n SGRParam[SGRParam[\"BackgroundBrightBlue\"] = 104] = \"BackgroundBrightBlue\";\n SGRParam[SGRParam[\"BackgroundBrightMagenta\"] = 105] = \"BackgroundBrightMagenta\";\n SGRParam[SGRParam[\"BackgroundBrightCyan\"] = 106] = \"BackgroundBrightCyan\";\n SGRParam[SGRParam[\"BackgroundBrightWhite\"] = 107] = \"BackgroundBrightWhite\";\n })(SGRParam || (SGRParam = {}));\n /**\n * SGRParamColor enumeration.\n */\n var SGRParamColor;\n (function (SGRParamColor) {\n SGRParamColor[SGRParamColor[\"Color256\"] = 5] = \"Color256\";\n SGRParamColor[SGRParamColor[\"ColorRGB\"] = 2] = \"ColorRGB\";\n })(SGRParamColor || (SGRParamColor = {}));\n /**\n * SGRParamIndexedColor enumeration.\n */\n var SGRParamIndexedColor;\n (function (SGRParamIndexedColor) {\n SGRParamIndexedColor[SGRParamIndexedColor[\"Black\"] = 0] = \"Black\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"Red\"] = 1] = \"Red\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"Green\"] = 2] = \"Green\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"Yellow\"] = 3] = \"Yellow\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"Blue\"] = 4] = \"Blue\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"Magenta\"] = 5] = \"Magenta\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"Cyan\"] = 6] = \"Cyan\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"White\"] = 7] = \"White\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightBlack\"] = 8] = \"BrightBlack\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightRed\"] = 9] = \"BrightRed\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightGreen\"] = 10] = \"BrightGreen\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightYellow\"] = 11] = \"BrightYellow\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightBlue\"] = 12] = \"BrightBlue\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightMagenta\"] = 13] = \"BrightMagenta\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightCyan\"] = 14] = \"BrightCyan\";\n SGRParamIndexedColor[SGRParamIndexedColor[\"BrightWhite\"] = 15] = \"BrightWhite\";\n })(SGRParamIndexedColor || (SGRParamIndexedColor = {}));\n /**\n * ParserState enumeration.\n */\n var ParserState;\n (function (ParserState) {\n ParserState[ParserState[\"BufferingOutput\"] = 0] = \"BufferingOutput\";\n ParserState[ParserState[\"ControlSequenceStarted\"] = 1] = \"ControlSequenceStarted\";\n ParserState[ParserState[\"ParsingControlSequence\"] = 2] = \"ParsingControlSequence\";\n })(ParserState || (ParserState = {}));\n //#endregion Private Enumerations\n //#region Private Classes\n /**\n * SGRState class.\n */\n class SGRState {\n //#region Private Properties.\n /**\n * Gets or sets the styles.\n */\n _styles;\n /**\n * Gets or sets the foreground color.\n */\n _foregroundColor;\n /**\n * Gets or sets the background color.\n */\n _backgroundColor;\n /**\n * Gets or sets the underlined color.\n */\n _underlinedColor;\n /**\n * Gets or sets a value which indicates whether the foreground and background colors are\n * reversed.\n */\n _reversed;\n /**\n * Gets or sets the font.\n */\n _font;\n //#endregion Private Properties.\n //#region Public Methods\n /**\n * Resets the SGRState.\n */\n reset() {\n this._styles = undefined;\n this._foregroundColor = undefined;\n this._backgroundColor = undefined;\n this._underlinedColor = undefined;\n this._reversed = undefined;\n this._font = undefined;\n }\n /**\n * Creates a copy of the SGRState.\n * @returns The copy of the SGRState.\n */\n copy() {\n const copy = new SGRState();\n if (this._styles && this._styles.size) {\n const styles = new Set();\n this._styles.forEach(style => styles.add(style));\n copy._styles = styles;\n }\n copy._foregroundColor = this._foregroundColor;\n copy._backgroundColor = this._backgroundColor;\n copy._underlinedColor = this._underlinedColor;\n copy._reversed = this._reversed;\n copy._font = this._font;\n return copy;\n }\n /**\n * Sets a style.\n * @param style The style to set.\n * @param stylesToDelete The styles to delete.\n */\n setStyle(style, ...stylesToDelete) {\n if (this._styles) {\n for (const style of stylesToDelete) {\n this._styles.delete(style);\n }\n }\n else {\n this._styles = new Set();\n }\n // Set the style.\n this._styles.add(style);\n }\n /**\n * Deletes styles.\n * @param stylesToDelete The styles to delete.\n */\n deleteStyles(...stylesToDelete) {\n if (this._styles) {\n for (const style of stylesToDelete) {\n this._styles.delete(style);\n }\n if (!this._styles.size) {\n this._styles = undefined;\n }\n }\n }\n /**\n * Sets the foreground color.\n * @param color The foreground color.\n */\n setForegroundColor(color) {\n if (!this._reversed) {\n this._foregroundColor = color;\n }\n else {\n this._backgroundColor = color;\n }\n }\n /**\n * Sets the background color.\n * @param color The background color.\n */\n setBackgroundColor(color) {\n if (!this._reversed) {\n this._backgroundColor = color;\n }\n else {\n this._foregroundColor = color;\n }\n }\n /**\n * Sets reversed.\n * @param reversed A value which indicates whether the foreground and background colors are\n * reversed.\n */\n setReversed(reversed) {\n if (reversed) {\n if (!this._reversed) {\n this._reversed = true;\n this.reverseForegroundAndBackgroundColors();\n }\n }\n else {\n if (this._reversed) {\n this._reversed = undefined;\n this.reverseForegroundAndBackgroundColors();\n }\n }\n }\n /**\n * Sets the font.\n * @param font The font.\n */\n setFont(font) {\n // Set the font.\n this._font = font;\n }\n /**\n *\n * @param left\n * @param right\n * @returns\n */\n static equivalent(left, right) {\n const setReplacer = (_, value) => value instanceof Set ? !value.size ? undefined : [...value] : value;\n return left === right ||\n JSON.stringify(left, setReplacer) === JSON.stringify(right, setReplacer);\n }\n //#endregion Public Methods\n //#region ANSIFormat Implementation\n /**\n * Gets the styles.\n */\n get styles() {\n return !this._styles ? undefined : [...this._styles];\n }\n /**\n * Gets the foreground color.\n */\n get foregroundColor() {\n // When a background color is set and a foreground color is not set,\n // and the background color is one of the standard colors, return a\n // contrasting foreground color.\n if (this._backgroundColor && !this._foregroundColor) {\n switch (this._backgroundColor) {\n case ANSIColor.Black:\n case ANSIColor.BrightBlack:\n case ANSIColor.Red:\n case ANSIColor.BrightRed:\n return ANSIColor.White;\n case ANSIColor.Green:\n case ANSIColor.BrightGreen:\n case ANSIColor.Yellow:\n case ANSIColor.BrightYellow:\n case ANSIColor.Blue:\n case ANSIColor.BrightBlue:\n case ANSIColor.Magenta:\n case ANSIColor.BrightMagenta:\n case ANSIColor.Cyan:\n case ANSIColor.BrightCyan:\n case ANSIColor.White:\n case ANSIColor.BrightWhite:\n return ANSIColor.Black;\n }\n }\n // Return the foreground color.\n return this._foregroundColor;\n }\n /**\n * Gets the background color.\n */\n get backgroundColor() {\n return this._backgroundColor;\n }\n /**\n * Gets the underlined color.\n */\n get underlinedColor() {\n return this._underlinedColor;\n }\n /**\n * Gets the font.\n */\n get font() {\n return this._font;\n }\n //#endregion ANSIFormat Implementation\n //#region Private Methods\n /**\n * Reverses the foreground and background colors.\n */\n reverseForegroundAndBackgroundColors() {\n const foregroundColor = this._foregroundColor;\n this._foregroundColor = this._backgroundColor;\n this._backgroundColor = foregroundColor;\n }\n }\n /**\n * OutputLine class.\n */\n class OutputLine {\n //#region Private Properties\n /**\n * Gets the identifier.\n */\n _id = generateId();\n /**\n * Gets or sets the output runs.\n */\n _outputRuns = [];\n /**\n * Gets or sets the total length.\n */\n _totalLength = 0;\n //#endregion Private Properties\n //#region Public Methods\n /**\n * Clears the entire output line.\n */\n clearEntireLine() {\n // If there are output runs, replace them all with an empty output run.\n if (this._totalLength) {\n this._outputRuns = [new OutputRun(' '.repeat(this._totalLength))];\n }\n }\n /**\n * Clears to the end of the output line.\n * @param column The column at which to clear from.\n */\n clearToEndOfLine(column) {\n // Sanity check the column.\n column = Math.max(column, 0);\n // If there's nothing to clear, return.\n if (column >= this._totalLength) {\n return;\n }\n // If the column is 0, clear the entire line and return.\n if (column === 0) {\n this.clearEntireLine();\n return;\n }\n // Find the left output run that is impacted.\n let leftOffset = 0;\n let leftOutputRun;\n let leftOutputRunIndex = undefined;\n for (let index = 0; index < this._outputRuns.length; index++) {\n // Get the output run.\n const outputRun = this._outputRuns[index];\n // If the column intersects with this output run, the left output run has been found.\n if (column < leftOffset + outputRun.text.length) {\n leftOutputRun = outputRun;\n leftOutputRunIndex = index;\n break;\n }\n // Adjust the left output run offset.\n leftOffset += outputRun.text.length;\n }\n // If the left output run wasn't found, there's an egregious bug in this code. Just return\n // in this case. (There's a bit of a TypeScript failure here. It doesn't detect that both\n // leftOutputRun and leftOutputRunIndex will both be undefined if one of them is undefined.)\n if (leftOutputRun === undefined || leftOutputRunIndex === undefined) {\n return;\n }\n // Get the left text length.\n const leftTextLength = column - leftOffset;\n // Build the new output runs.\n const erasureText = ' '.repeat(this._totalLength - column);\n const outputRuns = [];\n if (!leftTextLength) {\n // The left output run and all subsequent output runs are being erased.\n outputRuns.push(new OutputRun(erasureText));\n }\n else {\n // Some of the left output run is not being erased.\n const leftText = leftOutputRun.text.slice(0, leftTextLength);\n outputRuns.push(new OutputRun(leftText, leftOutputRun.sgrState));\n outputRuns.push(new OutputRun(erasureText));\n }\n // Splice the new output runs in.\n this.outputRuns.splice(leftOutputRunIndex, this._outputRuns.length - leftOutputRunIndex, ...outputRuns);\n }\n /**\n * Clears to the beginning of the output line.\n * @param column The column at which to clear from.\n */\n clearToBeginningOfLine(column) {\n // Sanity check the column.\n column = Math.max(column, 0);\n // If there's nothing to clear, return.\n if (column === 0) {\n return;\n }\n // If the column is beyond the output runs, clear the entire line and return.\n if (column >= this._totalLength) {\n this.clearEntireLine();\n return;\n }\n // Find the right output run that is impacted.\n let rightOffset = 0;\n let rightOutputRun;\n let rightOutputRunIndex = undefined;\n for (let index = this._outputRuns.length - 1; index >= 0; index--) {\n // Get the output run.\n const outputRun = this._outputRuns[index];\n // If the column intersects with this output run, the right output run has been found.\n if (column >= rightOffset - outputRun.text.length) {\n rightOutputRun = outputRun;\n rightOutputRunIndex = index;\n break;\n }\n // Adjust the right output run offset.\n rightOffset -= outputRun.text.length;\n }\n // If the right output run wasn't found, there's an egregious bug in this code. Just return\n // in this case.\n if (rightOutputRun === undefined || rightOutputRunIndex === undefined) {\n return;\n }\n // Get the right text length.\n const rightTextLength = rightOffset - column;\n // Build the new output runs.\n const erasureText = ' '.repeat(column);\n const outputRuns = [new OutputRun(erasureText)];\n if (rightTextLength) {\n const rightOutputRunText = rightOutputRun.text.slice(-rightTextLength);\n outputRuns.push(new OutputRun(rightOutputRunText, rightOutputRun.sgrState));\n }\n // Splice the new output runs in.\n this.outputRuns.splice(0, this._outputRuns.length - rightOutputRunIndex, ...outputRuns);\n }\n /**\n * Inserts text into the output line.\n * @param text The text to insert.\n * @param column The column at which to insert the text.\n * @param sgrState The SGR state.\n */\n insert(text, column, sgrState) {\n // Sanity check the text length.\n if (!text.length) {\n return;\n }\n // Inserting text at the end of the output line.\n if (column === this._totalLength) {\n // Adjust the total length.\n this._totalLength += text.length;\n // When possible, append the text being inserted to the last output run.\n if (this._outputRuns.length) {\n const lastOutputRun = this._outputRuns[this._outputRuns.length - 1];\n if (SGRState.equivalent(lastOutputRun.sgrState, sgrState)) {\n lastOutputRun.appendText(text);\n return;\n }\n }\n // Append an output run for the text being inserted.\n this._outputRuns.push(new OutputRun(text, sgrState));\n return;\n }\n // Inserting text past the end of the output line.\n if (column > this._totalLength) {\n // Create the spacer we need to insert.\n const spacer = ' '.repeat(column - this._totalLength);\n // Adjust the total length.\n this._totalLength += spacer.length + text.length;\n // When possible, append the spacer and the text being inserted to the last output run.\n if (!sgrState && this._outputRuns.length) {\n const lastOutputRun = this._outputRuns[this._outputRuns.length - 1];\n if (!lastOutputRun.sgrState) {\n lastOutputRun.appendText(spacer);\n lastOutputRun.appendText(text);\n return;\n }\n }\n if (!sgrState) {\n this._outputRuns.push(new OutputRun(spacer + text));\n }\n else {\n // Append a neutral output run for the spacer and an output run for the text being\n // inserted. The spacer must be neutral because text for it has not been set using any\n // SGR state.\n this._outputRuns.push(new OutputRun(spacer));\n this._outputRuns.push(new OutputRun(text, sgrState));\n }\n }\n // Find the left output run that is impacted by the insertion.\n let leftOffset = 0;\n let leftOutputRunIndex = undefined;\n for (let index = 0; index < this._outputRuns.length; index++) {\n // Get the output run.\n const outputRun = this._outputRuns[index];\n // If the column intersects with this output run, the left output run has been found.\n if (column < leftOffset + outputRun.text.length) {\n leftOutputRunIndex = index;\n break;\n }\n // Adjust the left output run offset.\n leftOffset += outputRun.text.length;\n }\n // If the left output run wasn't found, there's an egregious bug in this code. Append a new\n // output run for the text so it's not lost and return.\n if (leftOutputRunIndex === undefined) {\n this._outputRuns.push(new OutputRun(text, sgrState));\n return;\n }\n // If a right output run is not impacted, perform the insertion over the left output run.\n if (column + text.length >= this._totalLength) {\n // Get the left text length.\n const leftTextLength = column - leftOffset;\n // Build the new output runs.\n const outputRuns = [];\n if (!leftTextLength) {\n // The left output run is being completely overwritten so just add a new output run.\n outputRuns.push(new OutputRun(text, sgrState));\n }\n else {\n // Some of the left output run is not being overwritten.\n const leftOutputRun = this._outputRuns[leftOutputRunIndex];\n const leftText = leftOutputRun.text.slice(0, leftTextLength);\n if (SGRState.equivalent(leftOutputRun.sgrState, sgrState)) {\n // The left output run and the text being inserted have equivalent SGR states so\n // they can be combined into one output run.\n outputRuns.push(new OutputRun(leftText + text, sgrState));\n }\n else {\n // The left output run and the text being inserted do not have have equivalent\n // SGR states so two output runs are required.\n outputRuns.push(new OutputRun(leftText, leftOutputRun.sgrState));\n outputRuns.push(new OutputRun(text, sgrState));\n }\n }\n // Splice the new output runs in, adjust the total length, and complete the insertion.\n this.outputRuns.splice(leftOutputRunIndex, 1, ...outputRuns);\n this._totalLength = leftOffset + leftTextLength + text.length;\n return;\n }\n // Find the right output run that is impacted by the insertion.\n let rightOffset = this._totalLength;\n let rightOutputRunIndex = undefined;\n for (let index = this._outputRuns.length - 1; index >= 0; index--) {\n // Get the output run.\n const outputRun = this._outputRuns[index];\n // If the column plus the text width intersects with this output run, the right output\n // run has been found.\n if (column + text.length > rightOffset - outputRun.text.length) {\n rightOutputRunIndex = index;\n break;\n }\n // Adjust the right output run offset.\n rightOffset -= outputRun.text.length;\n }\n // If the right output run wasn't found, there's an egregious bug in this code. Append a new\n // output run for the text so it's not lost and return.\n if (rightOutputRunIndex === undefined) {\n this._outputRuns.push(new OutputRun(text, sgrState));\n return;\n }\n // The output runs.\n const outputRuns = [];\n // Add the left output run, if needed.\n const leftOutputRunTextLength = column - leftOffset;\n if (leftOutputRunTextLength) {\n const leftOutputRun = this._outputRuns[leftOutputRunIndex];\n const leftOutputRunText = leftOutputRun.text.slice(0, leftOutputRunTextLength);\n outputRuns.push(new OutputRun(leftOutputRunText, leftOutputRun.sgrState));\n }\n // Add the new output run.\n outputRuns.push(new OutputRun(text, sgrState));\n // Add the right output run, if needed.\n const rightOutputRunTextLength = rightOffset - (column + text.length);\n if (rightOutputRunTextLength) {\n const rightOutputRun = this._outputRuns[rightOutputRunIndex];\n const rightOutputRunText = rightOutputRun.text.slice(-rightOutputRunTextLength);\n outputRuns.push(new OutputRun(rightOutputRunText, rightOutputRun.sgrState));\n }\n // Splice the new output runs into the output runs,\n this._outputRuns.splice(leftOutputRunIndex, (rightOutputRunIndex - leftOutputRunIndex) + 1, ...outputRuns);\n // Optimize the output runs.\n if (this._outputRuns.length > 1) {\n this._outputRuns = OutputRun.optimizeOutputRuns(this._outputRuns);\n }\n // Recalculate the total length.\n this._totalLength = this._outputRuns.reduce((totalLength, outputRun) => totalLength + outputRun.text.length, 0);\n }\n //#endregion Public Methods\n //#region ANSIOutputLine Implementation\n /**\n * Gets the identifier.\n */\n get id() {\n return this._id;\n }\n /**\n * Gets the output runs.\n */\n get outputRuns() {\n return this._outputRuns;\n }\n }\n /**\n * OutputRun class.\n */\n class OutputRun {\n //#region Private Properties\n /**\n * Gets the identifier.\n */\n _id = generateId();\n /**\n * Gets the SGR state.\n */\n _sgrState;\n /**\n * Gets or sets the text.\n */\n _text;\n //#endregion Private Properties\n //#region Public Properties\n get sgrState() {\n return this._sgrState;\n }\n //#endregion Public Properties\n //#region Constructor\n /**\n * Constructor.\n * @param text The text.\n * @param sgrState The SGR state.\n */\n constructor(text, sgrState) {\n this._sgrState = sgrState;\n this._text = text;\n }\n //#endregion Constructor\n //#region Public Methods\n /**\n * Optimizes a an array of output runs by combining adjacent output runs with equivalent SGR\n * states.\n * @param outputRunsIn The output runs to optimize.\n * @returns The optimized output runs.\n */\n static optimizeOutputRuns(outputRunsIn) {\n // Build the optimized output runs by combining adjacent output runs with equivalent\n // SGR states.\n const outputRunsOut = [outputRunsIn[0]];\n for (let i = 1, o = 0; i < outputRunsIn.length; i++) {\n const outputRun = outputRunsIn[i];\n if (SGRState.equivalent(outputRunsOut[o].sgrState, outputRun.sgrState)) {\n outputRunsOut[o]._text += outputRun.text;\n }\n else {\n outputRunsOut[++o] = outputRun;\n }\n }\n // Return the optimized output runs.\n return outputRunsOut;\n }\n /**\n * Appends text to the end of the output run.\n * @param text The text to append.\n */\n appendText(text) {\n this._text += text;\n }\n //#endregion Public Methods\n //#region ANSIOutputRun Implementation\n /**\n * Gets the identifier.\n */\n get id() {\n return this._id;\n }\n /**\n * Gets the format.\n */\n get format() {\n return this._sgrState;\n }\n /**\n * Gets the text.\n */\n get text() {\n return this._text;\n }\n }\n //#endregion Private Classes\n //#region Helper Functions\n /**\n * Gets and ranges a parameter value.\n * @param value The value.\n * @param defaultValue The default value.\n * @param minValue The minimum value.\n * @returns The ranged parameter value.\n */\n const rangeParam = (value, defaultValue, minValue) => {\n const param = getParam(value, defaultValue);\n return Math.max(param, minValue);\n };\n /**\n * Gets a parameter value.\n * @param value The value.\n * @param defaultValue The default value.\n * @returns The parameter value.\n */\n const getParam = (value, defaultValue) => {\n const param = parseInt(value);\n return Number.isNaN(param) ? defaultValue : param;\n };\n /**\n * Converts a number to a two-digit hex string representing the value.\n * @param value The value.\n * @returns A two digit hex string representing the value.\n */\n const twoDigitHex = (value) => {\n // Return the value in hex format.\n const hex = Math.max(Math.min(255, value), 0).toString(16);\n return hex.length === 2 ? hex : '0' + hex;\n };\n});\n//#endregion Helper Functions\n",".container:hover .toggle {\n opacity: 1;\n}\n\n.toggle {\n position: absolute;\n top: 0.25rem;\n right: 0.25rem;\n z-index: 10;\n opacity: 0.7;\n transition: opacity 0.2s;\n padding: 0 0.2rem;\n background-color: var(--bs-body-bg);\n}\n","// The rich (colored) terminal renderer, loaded on demand by ANSIDisplay so\n// ansi-output is never fetched or run for untrusted content.\nimport { ANSIColor, ANSIOutput, ANSIOutputRun, ANSIStyle } from \"ansi-output\";\nimport clsx from \"clsx\";\nimport { FC, useState } from \"react\";\n\nimport type { ANSIDisplayProps } from \"./AnsiDisplay\";\nimport ansiStyles from \"./AnsiDisplay.module.css\";\nimport styles from \"./AnsiDisplayRich.module.css\";\nimport { ToolButton } from \"./ToolButton\";\n\nconst RichANSIDisplay: FC<ANSIDisplayProps> = ({\n output,\n style,\n className,\n}) => {\n const [showRaw, setShowRaw] = useState(false);\n const ansiOutput = new ANSIOutput();\n ansiOutput.processOutput(output);\n\n // Check if more than 80% of lines share the same background color\n const getUniformBackgroundColor = (): string | undefined => {\n const backgroundColorCounts = new Map<string, number>();\n let totalLinesWithBackground = 0;\n\n // Count background colors across all lines\n for (const line of ansiOutput.outputLines) {\n let lineBackgroundColor: string | undefined = undefined;\n\n // Get the background color for this line (from any run that has one)\n for (const run of line.outputRuns) {\n if (run.format?.backgroundColor) {\n lineBackgroundColor = run.format.backgroundColor;\n break;\n }\n }\n\n if (lineBackgroundColor) {\n totalLinesWithBackground++;\n backgroundColorCounts.set(\n lineBackgroundColor,\n (backgroundColorCounts.get(lineBackgroundColor) || 0) + 1\n );\n }\n }\n\n // Return undefined if no lines have backgrounds\n if (totalLinesWithBackground === 0) {\n return undefined;\n }\n\n // Compute percentages for each background color\n const backgroundColorPercentages = new Map<string, number>();\n for (const [color, count] of backgroundColorCounts.entries()) {\n backgroundColorPercentages.set(color, count / totalLinesWithBackground);\n }\n\n // Find the color with the highest percentage\n let dominantColor: string | undefined = undefined;\n let maxPercentage = 0;\n\n for (const [color, percentage] of backgroundColorPercentages.entries()) {\n if (percentage > maxPercentage) {\n maxPercentage = percentage;\n dominantColor = color;\n }\n }\n\n // Return the color if it appears in more than 80% of lines\n return maxPercentage > 0.8 ? dominantColor : undefined;\n };\n\n const uniformBackgroundColor = getUniformBackgroundColor();\n const backgroundStyle = uniformBackgroundColor\n ? computeForegroundBackgroundColor(kBackground, uniformBackgroundColor)\n : {};\n\n const firstOutputIndex = ansiOutput.outputLines.findIndex(\n (line) => line.outputRuns.length > 0\n );\n return (\n <div\n className={clsx(\n ansiStyles.ansiDisplayContainer,\n styles.container,\n className\n )}\n style={{ ...style }}\n >\n <ToolButton\n className={clsx(styles.toggle, \"text-size-smallest\")}\n icon=\"code\"\n label=\"\"\n latched={showRaw}\n onClick={() => setShowRaw(!showRaw)}\n title={showRaw ? \"Show rendered output\" : \"Show raw output\"}\n />\n {showRaw ? (\n <pre\n className={clsx(ansiStyles.ansiDisplay, ansiStyles.ansiDisplayRaw)}\n >\n {output}\n </pre>\n ) : (\n <div className={clsx(ansiStyles.ansiDisplay)} style={backgroundStyle}>\n {ansiOutput.outputLines.map((line, index) => {\n return (\n <div key={index}>\n {!line.outputRuns.length ? (\n // Blank lines keep their height once output has started.\n firstOutputIndex !== -1 && index > firstOutputIndex ? (\n <br />\n ) : null\n ) : (\n line.outputRuns.map((outputRun) => (\n <OutputRun key={outputRun.id} run={outputRun} />\n ))\n )}\n </div>\n );\n })}\n </div>\n )}\n </div>\n );\n};\n\nconst kForeground = 0;\nconst kBackground = 1;\n\ninterface OutputRunProps {\n run: ANSIOutputRun;\n}\n\nconst OutputRun: FC<OutputRunProps> = ({ run }) => {\n // Render.\n return <span style={computeCSSProperties(run)}>{run.text}</span>;\n};\n\nconst computeCSSProperties = (outputRun: ANSIOutputRun) => {\n return !outputRun.format\n ? {}\n : {\n ...computeStyles(outputRun.format.styles || []),\n ...computeForegroundBackgroundColor(\n kForeground,\n outputRun.format.foregroundColor\n ),\n ...computeForegroundBackgroundColor(\n kBackground,\n outputRun.format.backgroundColor\n ),\n };\n};\n\nconst computeStyles = (styles: ANSIStyle[]) => {\n let cssProperties = {};\n styles.forEach((style) => {\n switch (style) {\n // Bold.\n case ANSIStyle.Bold:\n cssProperties = { ...cssProperties, ...{ fontWeight: \"bold\" } };\n break;\n\n // Dim.\n case ANSIStyle.Dim:\n cssProperties = { ...cssProperties, ...{ fontWeight: \"lighter\" } };\n break;\n\n // Italic.\n case ANSIStyle.Italic:\n cssProperties = { ...cssProperties, ...{ fontStyle: \"italic\" } };\n break;\n\n // Underlined.\n case ANSIStyle.Underlined:\n cssProperties = {\n ...cssProperties,\n ...{\n textDecorationLine: \"underline\",\n textDecorationStyle: \"solid\",\n },\n };\n break;\n\n // Slow blink.\n case ANSIStyle.SlowBlink:\n cssProperties = {\n ...cssProperties,\n ...{ animation: \"ansi-display-run-blink 1s linear infinite\" },\n };\n break;\n\n // Rapid blink.\n case ANSIStyle.RapidBlink:\n cssProperties = {\n ...cssProperties,\n ...{ animation: \"ansi-display-run-blink 0.5s linear infinite\" },\n };\n break;\n\n // Hidden.\n case ANSIStyle.Hidden:\n cssProperties = { ...cssProperties, ...{ visibility: \"hidden\" } };\n break;\n\n // CrossedOut.\n case ANSIStyle.CrossedOut:\n cssProperties = {\n ...cssProperties,\n ...{\n textDecorationLine: \"line-through\",\n textDecorationStyle: \"solid\",\n },\n };\n break;\n\n // TODO Fraktur\n\n // DoubleUnderlined.\n case ANSIStyle.DoubleUnderlined:\n cssProperties = {\n ...cssProperties,\n ...{\n textDecorationLine: \"underline\",\n textDecorationStyle: \"double\",\n },\n };\n break;\n\n // TODO Framed\n // TODO Encircled\n // TODO Overlined\n // TODO Superscript\n // TODO Subscript\n }\n });\n\n return cssProperties;\n};\n\nconst computeForegroundBackgroundColor = (\n colorType: number,\n color?: string\n) => {\n switch (color) {\n // Undefined.\n case undefined:\n return {};\n\n // One of the standard colors.\n case ANSIColor.Black:\n case ANSIColor.Red:\n case ANSIColor.Green:\n case ANSIColor.Yellow:\n case ANSIColor.Blue:\n case ANSIColor.Magenta:\n case ANSIColor.Cyan:\n case ANSIColor.White:\n case ANSIColor.BrightBlack:\n case ANSIColor.BrightRed:\n case ANSIColor.BrightGreen:\n case ANSIColor.BrightYellow:\n case ANSIColor.BrightBlue:\n case ANSIColor.BrightMagenta:\n case ANSIColor.BrightCyan:\n case ANSIColor.BrightWhite:\n if (colorType === kForeground) {\n return { color: `var(--${color})` };\n } else {\n return { background: `var(--${color})` };\n }\n\n // TODO@softwarenerd - This isn't hooked up.\n default:\n if (colorType === kForeground) {\n return { color: color };\n } else {\n return { background: color };\n }\n }\n};\n\nexport default RichANSIDisplay;\n"],"ignoreList":[0],"mappings":";;;;;;;;CAGA,CAAC,SAAU,SAAS;EAChB,IAAI,OAAO,WAAW,YAAY,OAAO,O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d,GAAGA;IAEDS,oBAAoB;IACpBC,qBAAqB;GAEzB;EAQJ;CACF,CAAA;CAEA,OAAOV;AACT;AAEA,IAAMH,oCACJqB,WACAC,UAAAA;CAEA,QAAQA,OAAR;EAEE,KAAKC,KAAAA,GACH,OAAO,CAAC;EAGV,KAAKvC,mBAAAA,UAAUwC;EACf,KAAKxC,mBAAAA,UAAUyC;EACf,KAAKzC,mBAAAA,UAAU0C;EACf,KAAK1C,mBAAAA,UAAU2C;EACf,KAAK3C,mBAAAA,UAAU4C;EACf,KAAK5C,mBAAAA,UAAU6C;EACf,KAAK7C,mBAAAA,UAAU8C;EACf,KAAK9C,mBAAAA,UAAU+C;EACf,KAAK/C,mBAAAA,UAAUgD;EACf,KAAKhD,mBAAAA,UAAUiD;EACf,KAAKjD,mBAAAA,UAAUkD;EACf,KAAKlD,mBAAAA,UAAUmD;EACf,KAAKnD,mBAAAA,UAAUoD;EACf,KAAKpD,mBAAAA,UAAUqD;EACf,KAAKrD,mBAAAA,UAAUsD;EACf,KAAKtD,mBAAAA,UAAUuD,aACb,IAAIlB,cAAc5B,aAChB,OAAO,EAAE6B,OAAO,SAASA,MAAM,GAAG;OAElC,OAAO,EAAEkB,YAAY,SAASlB,MAAM,GAAG;EAI3C,SACE,IAAID,cAAc5B,aAChB,OAAO,EAAS6B,MAAM;OAEtB,OAAO,EAAEkB,YAAYlB,MAAM;CAEjC;AACF"}
@@ -6618,19 +6618,19 @@ function create(src, elem, opts = {}) {
6618
6618
  //#region ../../packages/react/src/components/AsciinemaPlayerImpl.tsx
6619
6619
  var AsciinemaPlayerImpl = (t0) => {
6620
6620
  const $ = c(18);
6621
- const { id, rows, cols, inputUrl, outputUrl, timingUrl, fit, speed, autoPlay, loop, theme, idleTimeLimit: t1, style } = t0;
6621
+ const { id, rows, cols, input, output, timing, fit, speed, autoPlay, loop, theme, idleTimeLimit: t1, style } = t0;
6622
6622
  const idleTimeLimit = t1 === void 0 ? 2 : t1;
6623
6623
  const playerContainerRef = useRef(null);
6624
6624
  let t2;
6625
6625
  let t3;
6626
- if ($[0] !== autoPlay || $[1] !== cols || $[2] !== fit || $[3] !== idleTimeLimit || $[4] !== inputUrl || $[5] !== loop || $[6] !== outputUrl || $[7] !== rows || $[8] !== speed || $[9] !== theme || $[10] !== timingUrl) {
6626
+ if ($[0] !== autoPlay || $[1] !== cols || $[2] !== fit || $[3] !== idleTimeLimit || $[4] !== input || $[5] !== loop || $[6] !== output || $[7] !== rows || $[8] !== speed || $[9] !== theme || $[10] !== timing) {
6627
6627
  t2 = () => {
6628
6628
  if (!playerContainerRef.current) return;
6629
6629
  const player = create({
6630
- url: [
6631
- timingUrl,
6632
- outputUrl,
6633
- inputUrl
6630
+ data: () => [
6631
+ new Response(timing),
6632
+ new Response(output),
6633
+ new Response(input)
6634
6634
  ],
6635
6635
  parser: "typescript"
6636
6636
  }, playerContainerRef.current, {
@@ -6649,9 +6649,9 @@ var AsciinemaPlayerImpl = (t0) => {
6649
6649
  };
6650
6650
  };
6651
6651
  t3 = [
6652
- timingUrl,
6653
- outputUrl,
6654
- inputUrl,
6652
+ timing,
6653
+ output,
6654
+ input,
6655
6655
  rows,
6656
6656
  cols,
6657
6657
  autoPlay,
@@ -6665,13 +6665,13 @@ var AsciinemaPlayerImpl = (t0) => {
6665
6665
  $[1] = cols;
6666
6666
  $[2] = fit;
6667
6667
  $[3] = idleTimeLimit;
6668
- $[4] = inputUrl;
6668
+ $[4] = input;
6669
6669
  $[5] = loop;
6670
- $[6] = outputUrl;
6670
+ $[6] = output;
6671
6671
  $[7] = rows;
6672
6672
  $[8] = speed;
6673
6673
  $[9] = theme;
6674
- $[10] = timingUrl;
6674
+ $[10] = timing;
6675
6675
  $[11] = t2;
6676
6676
  $[12] = t3;
6677
6677
  } else {
@@ -6702,4 +6702,4 @@ var AsciinemaPlayerImpl = (t0) => {
6702
6702
  //#endregion
6703
6703
  export { AsciinemaPlayerImpl as default };
6704
6704
 
6705
- //# sourceMappingURL=AsciinemaPlayerImpl-BG5NPs0z.js.map
6705
+ //# sourceMappingURL=AsciinemaPlayerImpl-CTd51CWg.js.map