{"version":3,"file":"renderDiffWithHighlighter.js","names":["DEFAULT_PLAIN_TEXT_OPTIONS: ForceDiffPlainTextOptions","code: RenderDiffFilesResult","deletionSpans: [0 | 1, string][]","additionSpans: [0 | 1, string][]","hastConfig: CodeToHastOptions<DiffsThemeNames>"],"sources":["../../src/utils/renderDiffWithHighlighter.ts"],"sourcesContent":["import { diffChars, diffWordsWithSpace } from 'diff';\n\nimport {\n  DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,\n  DEFAULT_THEMES,\n} from '../constants';\nimport type {\n  CodeToHastOptions,\n  DecorationItem,\n  DiffsHighlighter,\n  DiffsThemeNames,\n  FileContents,\n  FileDiffMetadata,\n  ForceDiffPlainTextOptions,\n  LineDiffTypes,\n  LineInfo,\n  RenderDiffFilesResult,\n  RenderDiffOptions,\n  SupportedLanguages,\n  ThemedDiffResult,\n} from '../types';\nimport { cleanLastNewline } from './cleanLastNewline';\nimport { createTransformerWithState } from './createTransformerWithState';\nimport { formatCSSVariablePrefix } from './formatCSSVariablePrefix';\nimport { getFiletypeFromFileName } from './getFiletypeFromFileName';\nimport { getHighlighterThemeStyles } from './getHighlighterThemeStyles';\nimport { getLineNodes } from './getLineNodes';\nimport { iterateOverDiff } from './iterateOverDiff';\nimport {\n  createDiffSpanDecoration,\n  pushOrJoinSpan,\n} from './parseDiffDecorations';\n\nconst DEFAULT_PLAIN_TEXT_OPTIONS: ForceDiffPlainTextOptions = {\n  forcePlainText: false,\n};\n\nexport function renderDiffWithHighlighter(\n  diff: FileDiffMetadata,\n  highlighter: DiffsHighlighter,\n  options: RenderDiffOptions,\n  {\n    forcePlainText,\n    startingLine,\n    totalLines,\n    expandedHunks,\n    collapsedContextThreshold = DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,\n  }: ForceDiffPlainTextOptions = DEFAULT_PLAIN_TEXT_OPTIONS\n): ThemedDiffResult {\n  if (forcePlainText) {\n    startingLine ??= 0;\n    totalLines ??= Infinity;\n  } else {\n    // If we aren't forcing plain text, then we intentionally do not support\n    // ranges for highlighting as that could break the syntax highlighting, we\n    // we override any values that may have been passed in.  Maybe one day we\n    // warn about this?\n    startingLine = 0;\n    totalLines = Infinity;\n  }\n  const isWindowedHighlight = startingLine > 0 || totalLines < Infinity;\n  const baseThemeType =\n    typeof options.theme === 'string'\n      ? highlighter.getTheme(options.theme).type\n      : undefined;\n  const themeStyles = getHighlighterThemeStyles({\n    theme: options.theme,\n    highlighter,\n  });\n\n  // If we have a large file and we are rendering the WHOLE plain diff ast,\n  // then we should remove the lineDiffType to make sure things render quickly.\n  // For highlighted ASTs or windowed highlights, we should just inherit the\n  // setting\n  const lineDiffType =\n    forcePlainText &&\n    !isWindowedHighlight &&\n    (diff.unifiedLineCount > 1000 || diff.splitLineCount > 1000)\n      ? 'none'\n      : options.lineDiffType;\n\n  const code: RenderDiffFilesResult = {\n    deletionLines: [],\n    additionLines: [],\n  };\n\n  const { maxLineDiffLength } = options;\n  const shouldGroupAll = !forcePlainText && !diff.isPartial;\n  const expandedHunksForIteration = forcePlainText ? expandedHunks : undefined;\n  const buckets = new Map<number, RenderBucket>();\n  function getBucketForHunk(hunkIndex: number) {\n    const index = shouldGroupAll ? 0 : hunkIndex;\n    const bucket = buckets.get(index) ?? createBucket();\n    buckets.set(index, bucket);\n    return bucket;\n  }\n\n  function appendContent(\n    lineContent: string,\n    lineIndex: number,\n    segments: HighlightSegment[],\n    contentWrapper: FakeArrayType\n  ) {\n    if (isWindowedHighlight) {\n      let segment = segments.at(-1);\n      if (\n        segment == null ||\n        segment.targetIndex + segment.count !== lineIndex\n      ) {\n        segment = {\n          targetIndex: lineIndex,\n          originalOffset: contentWrapper.length,\n          count: 0,\n        };\n        segments.push(segment);\n      }\n      segment.count++;\n    }\n    contentWrapper.push(lineContent);\n  }\n\n  iterateOverDiff({\n    diff,\n    diffStyle: 'both',\n    startingLine,\n    totalLines,\n    expandedHunks: isWindowedHighlight ? expandedHunksForIteration : true,\n    collapsedContextThreshold,\n    callback: ({ hunkIndex, additionLine, deletionLine, type }) => {\n      const bucket = getBucketForHunk(hunkIndex);\n      const splitLineIndex =\n        additionLine != null\n          ? additionLine.splitLineIndex\n          : deletionLine.splitLineIndex;\n\n      if (type === 'change' && additionLine != null && deletionLine != null) {\n        computeLineDiffDecorations({\n          additionLine: diff.additionLines[additionLine.lineIndex],\n          deletionLine: diff.deletionLines[deletionLine.lineIndex],\n          deletionLineIndex: bucket.deletionContent.length,\n          additionLineIndex: bucket.additionContent.length,\n          deletionDecorations: bucket.deletionDecorations,\n          additionDecorations: bucket.additionDecorations,\n          lineDiffType,\n          maxLineDiffLength,\n        });\n      }\n\n      if (deletionLine != null) {\n        appendContent(\n          diff.deletionLines[deletionLine.lineIndex],\n          deletionLine.lineIndex,\n          bucket.deletionSegments,\n          bucket.deletionContent\n        );\n        bucket.deletionInfo.push({\n          type: type === 'change' ? 'change-deletion' : type,\n          lineNumber: deletionLine.lineNumber,\n          altLineNumber:\n            type === 'change'\n              ? undefined\n              : (additionLine.lineNumber ?? undefined),\n          lineIndex: `${deletionLine.unifiedLineIndex},${splitLineIndex}`,\n        });\n      }\n\n      if (additionLine != null) {\n        appendContent(\n          diff.additionLines[additionLine.lineIndex],\n          additionLine.lineIndex,\n          bucket.additionSegments,\n          bucket.additionContent\n        );\n        bucket.additionInfo.push({\n          type: type === 'change' ? 'change-addition' : type,\n          lineNumber: additionLine.lineNumber,\n          altLineNumber:\n            type === 'change'\n              ? undefined\n              : (deletionLine.lineNumber ?? undefined),\n          lineIndex: `${additionLine.unifiedLineIndex},${splitLineIndex}`,\n        });\n      }\n    },\n  });\n\n  for (const bucket of buckets.values()) {\n    if (\n      bucket.deletionContent.length === 0 &&\n      bucket.additionContent.length === 0\n    ) {\n      continue;\n    }\n\n    const deletionFile = {\n      name: diff.prevName ?? diff.name,\n      contents: bucket.deletionContent.value,\n    };\n    const additionFile = {\n      name: diff.name,\n      contents: bucket.additionContent.value,\n    };\n    const { deletionLines, additionLines } = renderTwoFiles({\n      deletionFile,\n      deletionInfo: bucket.deletionInfo,\n      deletionDecorations: bucket.deletionDecorations,\n\n      additionFile,\n      additionInfo: bucket.additionInfo,\n      additionDecorations: bucket.additionDecorations,\n\n      highlighter,\n      options,\n      languageOverride: forcePlainText ? 'text' : diff.lang,\n    });\n\n    if (shouldGroupAll) {\n      code.deletionLines = deletionLines;\n      code.additionLines = additionLines;\n      continue;\n    }\n\n    if (bucket.deletionSegments.length > 0) {\n      for (const seg of bucket.deletionSegments) {\n        for (let i = 0; i < seg.count; i++) {\n          code.deletionLines[seg.targetIndex + i] =\n            deletionLines[seg.originalOffset + i];\n        }\n      }\n    } else {\n      code.deletionLines.push(...deletionLines);\n    }\n    if (bucket.additionSegments.length > 0) {\n      for (const seg of bucket.additionSegments) {\n        for (let i = 0; i < seg.count; i++) {\n          code.additionLines[seg.targetIndex + i] =\n            additionLines[seg.originalOffset + i];\n        }\n      }\n    } else {\n      code.additionLines.push(...additionLines);\n    }\n  }\n\n  return { code, themeStyles, baseThemeType };\n}\n\ninterface ProcessLineDiffProps {\n  deletionLine: string | undefined;\n  additionLine: string | undefined;\n  deletionLineIndex: number;\n  additionLineIndex: number;\n  deletionDecorations: DecorationItem[];\n  additionDecorations: DecorationItem[];\n  lineDiffType: LineDiffTypes;\n  maxLineDiffLength: number;\n}\n\nfunction computeLineDiffDecorations({\n  deletionLine,\n  additionLine,\n  deletionLineIndex,\n  additionLineIndex,\n  deletionDecorations,\n  additionDecorations,\n  lineDiffType,\n  maxLineDiffLength,\n}: ProcessLineDiffProps) {\n  if (deletionLine == null || additionLine == null || lineDiffType === 'none') {\n    return;\n  }\n  deletionLine = cleanLastNewline(deletionLine);\n  additionLine = cleanLastNewline(additionLine);\n  // If we have really long lines, we probably shouldn't compute diffs on them.\n  if (\n    deletionLine.length > maxLineDiffLength ||\n    additionLine.length > maxLineDiffLength\n  ) {\n    return;\n  }\n  // NOTE(amadeus): Because we visually trim trailing newlines when rendering,\n  // we also gotta make sure the diff parsing doesn't include the newline\n  // character that could be there...\n  const lineDiff =\n    lineDiffType === 'char'\n      ? diffChars(deletionLine, additionLine)\n      : diffWordsWithSpace(deletionLine, additionLine);\n  const deletionSpans: [0 | 1, string][] = [];\n  const additionSpans: [0 | 1, string][] = [];\n  const enableJoin = lineDiffType === 'word-alt';\n  const lastItem = lineDiff.at(-1);\n  for (const item of lineDiff) {\n    const isLastItem = item === lastItem;\n    if (!item.added && !item.removed) {\n      pushOrJoinSpan({\n        item,\n        arr: deletionSpans,\n        enableJoin,\n        isNeutral: true,\n        isLastItem,\n      });\n      pushOrJoinSpan({\n        item,\n        arr: additionSpans,\n        enableJoin,\n        isNeutral: true,\n        isLastItem,\n      });\n    } else if (item.removed) {\n      pushOrJoinSpan({ item, arr: deletionSpans, enableJoin, isLastItem });\n    } else {\n      pushOrJoinSpan({ item, arr: additionSpans, enableJoin, isLastItem });\n    }\n  }\n  let spanIndex = 0;\n  for (const span of deletionSpans) {\n    if (span[0] === 1) {\n      deletionDecorations.push(\n        createDiffSpanDecoration({\n          line: deletionLineIndex,\n          spanStart: spanIndex,\n          spanLength: span[1].length,\n        })\n      );\n    }\n    spanIndex += span[1].length;\n  }\n  spanIndex = 0;\n  for (const span of additionSpans) {\n    if (span[0] === 1) {\n      additionDecorations.push(\n        createDiffSpanDecoration({\n          line: additionLineIndex,\n          spanStart: spanIndex,\n          spanLength: span[1].length,\n        })\n      );\n    }\n    spanIndex += span[1].length;\n  }\n}\n\ninterface HighlightSegment {\n  // The where the highlighted region starts\n  originalOffset: number;\n  // Where to place the highlighted line in RenderDiffFilesResult\n  targetIndex: number;\n  // Number of highlighted lines\n  count: number;\n}\n\ninterface FakeArrayType {\n  push(value: string): void;\n  value: string;\n  length: number;\n}\n\ninterface RenderBucket {\n  deletionContent: FakeArrayType;\n  additionContent: FakeArrayType;\n  deletionInfo: (LineInfo | undefined)[];\n  additionInfo: (LineInfo | undefined)[];\n  deletionDecorations: DecorationItem[];\n  additionDecorations: DecorationItem[];\n  deletionSegments: HighlightSegment[];\n  additionSegments: HighlightSegment[];\n}\n\nfunction createBucket(): RenderBucket {\n  return {\n    deletionContent: {\n      push(value: string) {\n        this.value += value;\n        this.length++;\n      },\n      value: '',\n      length: 0,\n    },\n    additionContent: {\n      push(value: string) {\n        this.value += value;\n        this.length++;\n      },\n      value: '',\n      length: 0,\n    },\n    deletionInfo: [],\n    additionInfo: [],\n    deletionDecorations: [],\n    additionDecorations: [],\n    deletionSegments: [],\n    additionSegments: [],\n  };\n}\n\ninterface RenderTwoFilesProps {\n  deletionFile: FileContents;\n  additionFile: FileContents;\n  deletionInfo: (LineInfo | undefined)[];\n  additionInfo: (LineInfo | undefined)[];\n  deletionDecorations: DecorationItem[];\n  additionDecorations: DecorationItem[];\n  options: RenderDiffOptions;\n  highlighter: DiffsHighlighter;\n  languageOverride: SupportedLanguages | undefined;\n}\n\nfunction renderTwoFiles({\n  deletionFile,\n  additionFile,\n  deletionInfo,\n  additionInfo,\n  highlighter,\n  deletionDecorations,\n  additionDecorations,\n  languageOverride,\n  options: { theme: themeOrThemes = DEFAULT_THEMES, ...options },\n}: RenderTwoFilesProps): RenderDiffFilesResult {\n  const deletionLang =\n    languageOverride ?? getFiletypeFromFileName(deletionFile.name);\n  const additionLang =\n    languageOverride ?? getFiletypeFromFileName(additionFile.name);\n  const { state, transformers } = createTransformerWithState(\n    options.useTokenTransformer\n  );\n  const hastConfig: CodeToHastOptions<DiffsThemeNames> = (() => {\n    return typeof themeOrThemes === 'string'\n      ? {\n          ...options,\n          // language will be overwritten for each highlight\n          lang: 'text',\n          theme: themeOrThemes,\n          transformers,\n          decorations: undefined,\n          defaultColor: false,\n          cssVariablePrefix: formatCSSVariablePrefix('token'),\n        }\n      : {\n          ...options,\n          // language will be overwritten for each highlight\n          lang: 'text',\n          themes: themeOrThemes,\n          transformers,\n          decorations: undefined,\n          defaultColor: false,\n          cssVariablePrefix: formatCSSVariablePrefix('token'),\n        };\n  })();\n\n  const deletionLines = (() => {\n    if (deletionFile.contents === '') {\n      return [];\n    }\n    hastConfig.lang = deletionLang;\n    state.lineInfo = deletionInfo;\n    hastConfig.decorations = deletionDecorations;\n    return getLineNodes(\n      highlighter.codeToHast(\n        cleanLastNewline(deletionFile.contents),\n        hastConfig\n      )\n    );\n  })();\n  const additionLines = (() => {\n    if (additionFile.contents === '') {\n      return [];\n    }\n    hastConfig.lang = additionLang;\n    hastConfig.decorations = additionDecorations;\n    state.lineInfo = additionInfo;\n    return getLineNodes(\n      highlighter.codeToHast(\n        cleanLastNewline(additionFile.contents),\n        hastConfig\n      )\n    );\n  })();\n\n  return { deletionLines, additionLines };\n}\n"],"mappings":";;;;;;;;;;;;AAiCA,MAAMA,6BAAwD,EAC5D,gBAAgB,OACjB;AAED,SAAgB,0BACd,MACA,aACA,SACA,EACE,gBACA,cACA,YACA,eACA,4BAA4B,wCACC,4BACb;AAClB,KAAI,gBAAgB;AAClB,mBAAiB;AACjB,iBAAe;QACV;AAKL,iBAAe;AACf,eAAa;;CAEf,MAAM,sBAAsB,eAAe,KAAK,aAAa;CAC7D,MAAM,gBACJ,OAAO,QAAQ,UAAU,WACrB,YAAY,SAAS,QAAQ,MAAM,CAAC,OACpC;CACN,MAAM,cAAc,0BAA0B;EAC5C,OAAO,QAAQ;EACf;EACD,CAAC;CAMF,MAAM,eACJ,kBACA,CAAC,wBACA,KAAK,mBAAmB,OAAQ,KAAK,iBAAiB,OACnD,SACA,QAAQ;CAEd,MAAMC,OAA8B;EAClC,eAAe,EAAE;EACjB,eAAe,EAAE;EAClB;CAED,MAAM,EAAE,sBAAsB;CAC9B,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,KAAK;CAChD,MAAM,4BAA4B,iBAAiB,gBAAgB;CACnE,MAAM,0BAAU,IAAI,KAA2B;CAC/C,SAAS,iBAAiB,WAAmB;EAC3C,MAAM,QAAQ,iBAAiB,IAAI;EACnC,MAAM,SAAS,QAAQ,IAAI,MAAM,IAAI,cAAc;AACnD,UAAQ,IAAI,OAAO,OAAO;AAC1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