@openclaw/diffs 2026.9.4 → 2026.9.6

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 (1284) hide show
  1. package/README.md +2 -1
  2. package/assets/activity.svg +3 -0
  3. package/assets/icon.png +0 -0
  4. package/dist/{browser.runtime-DTKAejqd.js → .setup/browser.runtime-VjaO3wrj.mjs} +1 -1
  5. package/dist/assets/viewer-runtime.js +50 -56
  6. package/dist/index.js +44 -18
  7. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +117 -70
  8. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
  9. package/node_modules/@pierre/diffs/dist/components/CodeView.js +197 -65
  10. package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
  11. package/node_modules/@pierre/diffs/dist/components/File.d.ts +81 -29
  12. package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
  13. package/node_modules/@pierre/diffs/dist/components/File.js +244 -66
  14. package/node_modules/@pierre/diffs/dist/components/File.js.map +1 -1
  15. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +109 -57
  16. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
  17. package/node_modules/@pierre/diffs/dist/components/FileDiff.js +445 -112
  18. package/node_modules/@pierre/diffs/dist/components/FileDiff.js.map +1 -1
  19. package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts +1 -0
  20. package/node_modules/@pierre/diffs/dist/components/FileStream.d.ts.map +1 -1
  21. package/node_modules/@pierre/diffs/dist/components/FileStream.js +1 -1
  22. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts +3 -3
  23. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.d.ts.map +1 -1
  24. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js +4 -3
  25. package/node_modules/@pierre/diffs/dist/components/UnresolvedFile.js.map +1 -1
  26. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +18 -14
  27. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
  28. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +153 -62
  29. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
  30. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +17 -16
  31. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  32. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +197 -105
  33. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js.map +1 -1
  34. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts +1 -5
  35. package/node_modules/@pierre/diffs/dist/components/Virtualizer.d.ts.map +1 -1
  36. package/node_modules/@pierre/diffs/dist/components/Virtualizer.js.map +1 -1
  37. package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts +1 -2
  38. package/node_modules/@pierre/diffs/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
  39. package/node_modules/@pierre/diffs/dist/components/web-components.d.ts.map +1 -1
  40. package/node_modules/@pierre/diffs/dist/components/web-components.js +2 -1
  41. package/node_modules/@pierre/diffs/dist/components/web-components.js.map +1 -1
  42. package/node_modules/@pierre/diffs/dist/constants.d.ts +0 -1
  43. package/node_modules/@pierre/diffs/dist/constants.d.ts.map +1 -1
  44. package/node_modules/@pierre/diffs/dist/edit/index.d.ts +7 -4
  45. package/node_modules/@pierre/diffs/dist/edit/index.js +5 -1
  46. package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts +55 -0
  47. package/node_modules/@pierre/diffs/dist/editor/EditStateManager.d.ts.map +1 -0
  48. package/node_modules/@pierre/diffs/dist/editor/EditStateManager.js +135 -0
  49. package/node_modules/@pierre/diffs/dist/editor/EditStateManager.js.map +1 -0
  50. package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts +6 -0
  51. package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.d.ts.map +1 -0
  52. package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.js +16 -0
  53. package/node_modules/@pierre/diffs/dist/editor/cloneRetainedDiffSessionSnapshot.js.map +1 -0
  54. package/node_modules/@pierre/diffs/dist/editor/command.d.ts +2 -1
  55. package/node_modules/@pierre/diffs/dist/editor/command.d.ts.map +1 -1
  56. package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts +77 -0
  57. package/node_modules/@pierre/diffs/dist/editor/editPrediction.d.ts.map +1 -0
  58. package/node_modules/@pierre/diffs/dist/editor/editPrediction.js +365 -0
  59. package/node_modules/@pierre/diffs/dist/editor/editPrediction.js.map +1 -0
  60. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts +19 -41
  61. package/node_modules/@pierre/diffs/dist/editor/editStack.d.ts.map +1 -1
  62. package/node_modules/@pierre/diffs/dist/editor/editStack.js +67 -4
  63. package/node_modules/@pierre/diffs/dist/editor/editStack.js.map +1 -1
  64. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts +117 -32
  65. package/node_modules/@pierre/diffs/dist/editor/editor.d.ts.map +1 -1
  66. package/node_modules/@pierre/diffs/dist/editor/editor.js +1125 -396
  67. package/node_modules/@pierre/diffs/dist/editor/editor.js.map +1 -1
  68. package/node_modules/@pierre/diffs/dist/editor/editor2.js +1 -1
  69. package/node_modules/@pierre/diffs/dist/editor/editor2.js.map +1 -1
  70. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts +3 -4
  71. package/node_modules/@pierre/diffs/dist/editor/languages.d.ts.map +1 -1
  72. package/node_modules/@pierre/diffs/dist/editor/languages.js +1 -1
  73. package/node_modules/@pierre/diffs/dist/editor/languages.js.map +1 -1
  74. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts +3 -4
  75. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.d.ts.map +1 -1
  76. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js +18 -8
  77. package/node_modules/@pierre/diffs/dist/editor/lineAnnotations.js.map +1 -1
  78. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts +2 -3
  79. package/node_modules/@pierre/diffs/dist/editor/marker.d.ts.map +1 -1
  80. package/node_modules/@pierre/diffs/dist/editor/marker.js +5 -3
  81. package/node_modules/@pierre/diffs/dist/editor/marker.js.map +1 -1
  82. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts +2 -3
  83. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.d.ts.map +1 -1
  84. package/node_modules/@pierre/diffs/dist/editor/matchBrackets.js.map +1 -1
  85. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts +1 -2
  86. package/node_modules/@pierre/diffs/dist/editor/pieceTable.d.ts.map +1 -1
  87. package/node_modules/@pierre/diffs/dist/editor/pieceTable.js.map +1 -1
  88. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts +1 -5
  89. package/node_modules/@pierre/diffs/dist/editor/platform.d.ts.map +1 -1
  90. package/node_modules/@pierre/diffs/dist/editor/platform.js.map +1 -1
  91. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts +12 -12
  92. package/node_modules/@pierre/diffs/dist/editor/popover.d.ts.map +1 -1
  93. package/node_modules/@pierre/diffs/dist/editor/popover.js.map +1 -1
  94. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts +2 -3
  95. package/node_modules/@pierre/diffs/dist/editor/searchPanel.d.ts.map +1 -1
  96. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js +17 -13
  97. package/node_modules/@pierre/diffs/dist/editor/searchPanel.js.map +1 -1
  98. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts +32 -24
  99. package/node_modules/@pierre/diffs/dist/editor/selection.d.ts.map +1 -1
  100. package/node_modules/@pierre/diffs/dist/editor/selection.js +3 -3
  101. package/node_modules/@pierre/diffs/dist/editor/selection.js.map +1 -1
  102. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts +3 -4
  103. package/node_modules/@pierre/diffs/dist/editor/selectionAction.d.ts.map +1 -1
  104. package/node_modules/@pierre/diffs/dist/editor/selectionAction.js.map +1 -1
  105. package/node_modules/@pierre/diffs/dist/editor/sprite.d.ts.map +1 -1
  106. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts +11 -9
  107. package/node_modules/@pierre/diffs/dist/editor/textDocument.d.ts.map +1 -1
  108. package/node_modules/@pierre/diffs/dist/editor/textDocument.js +28 -5
  109. package/node_modules/@pierre/diffs/dist/editor/textDocument.js.map +1 -1
  110. package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts +14 -0
  111. package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.d.ts.map +1 -0
  112. package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.js +12 -0
  113. package/node_modules/@pierre/diffs/dist/editor/textDocumentChangeTransaction.js.map +1 -0
  114. package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts +5 -0
  115. package/node_modules/@pierre/diffs/dist/editor/textMeasure.d.ts.map +1 -1
  116. package/node_modules/@pierre/diffs/dist/editor/textMeasure.js +10 -0
  117. package/node_modules/@pierre/diffs/dist/editor/textMeasure.js.map +1 -1
  118. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts +2 -12
  119. package/node_modules/@pierre/diffs/dist/editor/tokenizer.d.ts.map +1 -1
  120. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js +8 -4
  121. package/node_modules/@pierre/diffs/dist/editor/tokenizer.js.map +1 -1
  122. package/node_modules/@pierre/diffs/dist/editor/types.d.ts +266 -0
  123. package/node_modules/@pierre/diffs/dist/editor/types.d.ts.map +1 -0
  124. package/node_modules/@pierre/diffs/dist/editor/types.js +0 -0
  125. package/node_modules/@pierre/diffs/dist/editor/utils.d.ts +2 -1
  126. package/node_modules/@pierre/diffs/dist/editor/utils.d.ts.map +1 -1
  127. package/node_modules/@pierre/diffs/dist/editor/utils.js +15 -8
  128. package/node_modules/@pierre/diffs/dist/editor/utils.js.map +1 -1
  129. package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts +0 -1
  130. package/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.d.ts.map +1 -1
  131. package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts +1 -0
  132. package/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.d.ts.map +1 -1
  133. package/node_modules/@pierre/diffs/dist/highlighter/languages/cleanUpResolvedLanguages.d.ts.map +1 -1
  134. package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts +1 -1
  135. package/node_modules/@pierre/diffs/dist/highlighter/languages/constants.d.ts.map +1 -1
  136. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts +1 -0
  137. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.d.ts.map +1 -1
  138. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts +1 -0
  139. package/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.d.ts.map +1 -1
  140. package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts +0 -1
  141. package/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.d.ts.map +1 -1
  142. package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts +0 -1
  143. package/node_modules/@pierre/diffs/dist/highlighter/languages/registerCustomLanguage.d.ts.map +1 -1
  144. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts +1 -0
  145. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.d.ts.map +1 -1
  146. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts +1 -0
  147. package/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.d.ts.map +1 -1
  148. package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts +7 -8
  149. package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.d.ts.map +1 -1
  150. package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.js +7 -3
  151. package/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.js.map +1 -1
  152. package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts +0 -1
  153. package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.d.ts.map +1 -1
  154. package/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.js +1 -1
  155. package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts +0 -1
  156. package/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.d.ts.map +1 -1
  157. package/node_modules/@pierre/diffs/dist/highlighter/themes/cleanUpResolvedThemes.d.ts.map +1 -1
  158. package/node_modules/@pierre/diffs/dist/highlighter/themes/constants.d.ts.map +1 -1
  159. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts +0 -1
  160. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.d.ts.map +1 -1
  161. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts +0 -1
  162. package/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.d.ts.map +1 -1
  163. package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts +0 -1
  164. package/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.d.ts.map +1 -1
  165. package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomCSSVariableTheme.d.ts.map +1 -1
  166. package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts +0 -1
  167. package/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.d.ts.map +1 -1
  168. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts +0 -1
  169. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.d.ts.map +1 -1
  170. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts +0 -1
  171. package/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.d.ts.map +1 -1
  172. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts +0 -1
  173. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolution.d.ts.map +1 -1
  174. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts +0 -1
  175. package/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.d.ts.map +1 -1
  176. package/node_modules/@pierre/diffs/dist/index.d.ts +9 -6
  177. package/node_modules/@pierre/diffs/dist/index.js +22 -21
  178. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts +2 -26
  179. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.d.ts.map +1 -1
  180. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js +8 -3
  181. package/node_modules/@pierre/diffs/dist/managers/InteractionManager.js.map +1 -1
  182. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts +1 -4
  183. package/node_modules/@pierre/diffs/dist/managers/ResizeManager.d.ts.map +1 -1
  184. package/node_modules/@pierre/diffs/dist/managers/ScrollSyncManager.d.ts.map +1 -1
  185. package/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.d.ts.map +1 -1
  186. package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts +0 -1
  187. package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_hast@3.0.4/node_modules/@types/hast/index.d.ts.map +1 -1
  188. package/node_modules/@pierre/diffs/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts.map +1 -1
  189. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts +45 -26
  190. package/node_modules/@pierre/diffs/dist/react/CodeView.d.ts.map +1 -1
  191. package/node_modules/@pierre/diffs/dist/react/CodeView.js +52 -45
  192. package/node_modules/@pierre/diffs/dist/react/CodeView.js.map +1 -1
  193. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts +8 -14
  194. package/node_modules/@pierre/diffs/dist/react/EditContext.d.ts.map +1 -1
  195. package/node_modules/@pierre/diffs/dist/react/EditContext.js +2 -9
  196. package/node_modules/@pierre/diffs/dist/react/EditContext.js.map +1 -1
  197. package/node_modules/@pierre/diffs/dist/react/File.d.ts +5 -23
  198. package/node_modules/@pierre/diffs/dist/react/File.d.ts.map +1 -1
  199. package/node_modules/@pierre/diffs/dist/react/File.js +19 -14
  200. package/node_modules/@pierre/diffs/dist/react/File.js.map +1 -1
  201. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts +5 -22
  202. package/node_modules/@pierre/diffs/dist/react/FileDiff.d.ts.map +1 -1
  203. package/node_modules/@pierre/diffs/dist/react/FileDiff.js +19 -14
  204. package/node_modules/@pierre/diffs/dist/react/FileDiff.js.map +1 -1
  205. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts +3 -23
  206. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.d.ts.map +1 -1
  207. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js +19 -22
  208. package/node_modules/@pierre/diffs/dist/react/MultiFileDiff.js.map +1 -1
  209. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts +2 -21
  210. package/node_modules/@pierre/diffs/dist/react/PatchDiff.d.ts.map +1 -1
  211. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js +19 -14
  212. package/node_modules/@pierre/diffs/dist/react/PatchDiff.js.map +1 -1
  213. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts +4 -21
  214. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.d.ts.map +1 -1
  215. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js +15 -14
  216. package/node_modules/@pierre/diffs/dist/react/UnresolvedFile.js.map +1 -1
  217. package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts +1 -9
  218. package/node_modules/@pierre/diffs/dist/react/Virtualizer.d.ts.map +1 -1
  219. package/node_modules/@pierre/diffs/dist/react/Virtualizer.js.map +1 -1
  220. package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts +2 -6
  221. package/node_modules/@pierre/diffs/dist/react/WorkerPoolContext.d.ts.map +1 -1
  222. package/node_modules/@pierre/diffs/dist/react/constants.d.ts +0 -1
  223. package/node_modules/@pierre/diffs/dist/react/constants.d.ts.map +1 -1
  224. package/node_modules/@pierre/diffs/dist/react/index.d.ts +8 -5
  225. package/node_modules/@pierre/diffs/dist/react/jsx.d.ts +1 -0
  226. package/node_modules/@pierre/diffs/dist/react/jsx.d.ts.map +1 -1
  227. package/node_modules/@pierre/diffs/dist/react/types.d.ts +47 -10
  228. package/node_modules/@pierre/diffs/dist/react/types.d.ts.map +1 -1
  229. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts +6 -0
  230. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.d.ts.map +1 -0
  231. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js +9 -0
  232. package/node_modules/@pierre/diffs/dist/react/utils/assignRef.js.map +1 -0
  233. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts +11 -24
  234. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.d.ts.map +1 -1
  235. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js +2 -2
  236. package/node_modules/@pierre/diffs/dist/react/utils/renderDiffChildren.js.map +1 -1
  237. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts +11 -21
  238. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.d.ts.map +1 -1
  239. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js +2 -2
  240. package/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js.map +1 -1
  241. package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts +0 -1
  242. package/node_modules/@pierre/diffs/dist/react/utils/templateRender.d.ts.map +1 -1
  243. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts +16 -20
  244. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.d.ts.map +1 -1
  245. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js +126 -22
  246. package/node_modules/@pierre/diffs/dist/react/utils/useFileDiffInstance.js.map +1 -1
  247. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts +11 -19
  248. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.d.ts.map +1 -1
  249. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js +88 -25
  250. package/node_modules/@pierre/diffs/dist/react/utils/useFileInstance.js.map +1 -1
  251. package/node_modules/@pierre/diffs/dist/react/utils/useStableCallback.d.ts.map +1 -1
  252. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts +1 -12
  253. package/node_modules/@pierre/diffs/dist/react/utils/useUnresolvedFileInstance.d.ts.map +1 -1
  254. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts +34 -24
  255. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  256. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +188 -118
  257. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
  258. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +28 -11
  259. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
  260. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +141 -67
  261. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
  262. package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts +5 -11
  263. package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.d.ts.map +1 -1
  264. package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.js +2 -2
  265. package/node_modules/@pierre/diffs/dist/renderers/UnresolvedFileHunksRenderer.js.map +1 -1
  266. package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts +0 -1
  267. package/node_modules/@pierre/diffs/dist/shiki-stream/stream.d.ts.map +1 -1
  268. package/node_modules/@pierre/diffs/dist/shiki-stream/stream.js.map +1 -1
  269. package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts +0 -1
  270. package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.d.ts.map +1 -1
  271. package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.js +2 -1
  272. package/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.js.map +1 -1
  273. package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts +0 -1
  274. package/node_modules/@pierre/diffs/dist/shiki-stream/types.d.ts.map +1 -1
  275. package/node_modules/@pierre/diffs/dist/sprite.d.ts.map +1 -1
  276. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts +1 -8
  277. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.d.ts.map +1 -1
  278. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js +8 -3
  279. package/node_modules/@pierre/diffs/dist/ssr/FileDiffReact.js.map +1 -1
  280. package/node_modules/@pierre/diffs/dist/ssr/index.d.ts +2 -2
  281. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts +19 -47
  282. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.d.ts.map +1 -1
  283. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js +1 -1
  284. package/node_modules/@pierre/diffs/dist/ssr/preloadDiffs.js.map +1 -1
  285. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts +5 -10
  286. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.d.ts.map +1 -1
  287. package/node_modules/@pierre/diffs/dist/ssr/preloadFile.js.map +1 -1
  288. package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts +3 -7
  289. package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.d.ts.map +1 -1
  290. package/node_modules/@pierre/diffs/dist/ssr/preloadPatchFile.js.map +1 -1
  291. package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts +0 -1
  292. package/node_modules/@pierre/diffs/dist/ssr/renderHTML.d.ts.map +1 -1
  293. package/node_modules/@pierre/diffs/dist/string-import.d.ts.map +1 -1
  294. package/node_modules/@pierre/diffs/dist/style.js +1 -1
  295. package/node_modules/@pierre/diffs/dist/style.js.map +1 -1
  296. package/node_modules/@pierre/diffs/dist/types.d.ts +13 -264
  297. package/node_modules/@pierre/diffs/dist/types.d.ts.map +1 -1
  298. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts +0 -1
  299. package/node_modules/@pierre/diffs/dist/utils/annotationHelpers.d.ts.map +1 -1
  300. package/node_modules/@pierre/diffs/dist/utils/appendItems.d.ts +5 -0
  301. package/node_modules/@pierre/diffs/dist/utils/appendItems.d.ts.map +1 -0
  302. package/node_modules/@pierre/diffs/dist/utils/appendItems.js +8 -0
  303. package/node_modules/@pierre/diffs/dist/utils/appendItems.js.map +1 -0
  304. package/node_modules/@pierre/diffs/dist/utils/applyLineTextWithNewline.d.ts.map +1 -1
  305. package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts +0 -1
  306. package/node_modules/@pierre/diffs/dist/utils/areDiffLineAnnotationsEqual.d.ts.map +1 -1
  307. package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts +0 -1
  308. package/node_modules/@pierre/diffs/dist/utils/areDiffRenderOptionsEqual.d.ts.map +1 -1
  309. package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts +0 -1
  310. package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.d.ts.map +1 -1
  311. package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.js +1 -1
  312. package/node_modules/@pierre/diffs/dist/utils/areDiffTargetsEqual.js.map +1 -1
  313. package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts +0 -1
  314. package/node_modules/@pierre/diffs/dist/utils/areFileRenderOptionsEqual.d.ts.map +1 -1
  315. package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts +6 -0
  316. package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.d.ts.map +1 -0
  317. package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.js +8 -0
  318. package/node_modules/@pierre/diffs/dist/utils/areFileTargetsEqual.js.map +1 -0
  319. package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts +0 -1
  320. package/node_modules/@pierre/diffs/dist/utils/areFilesEqual.d.ts.map +1 -1
  321. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts +0 -1
  322. package/node_modules/@pierre/diffs/dist/utils/areHunkDataEqual.d.ts.map +1 -1
  323. package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts +0 -1
  324. package/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.d.ts.map +1 -1
  325. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts +1 -2
  326. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.d.ts.map +1 -1
  327. package/node_modules/@pierre/diffs/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
  328. package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts +0 -1
  329. package/node_modules/@pierre/diffs/dist/utils/areMergeConflictActionsEqual.d.ts.map +1 -1
  330. package/node_modules/@pierre/diffs/dist/utils/areObjectsEqual.d.ts.map +1 -1
  331. package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts +4 -3
  332. package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.d.ts.map +1 -1
  333. package/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.js.map +1 -1
  334. package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts +0 -1
  335. package/node_modules/@pierre/diffs/dist/utils/arePrePropertiesEqual.d.ts.map +1 -1
  336. package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts +0 -1
  337. package/node_modules/@pierre/diffs/dist/utils/areRenderRangesEqual.d.ts.map +1 -1
  338. package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts +0 -1
  339. package/node_modules/@pierre/diffs/dist/utils/areSelectionPointsEqual.d.ts.map +1 -1
  340. package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts +0 -1
  341. package/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.d.ts.map +1 -1
  342. package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts +0 -1
  343. package/node_modules/@pierre/diffs/dist/utils/areThemesEqual.d.ts.map +1 -1
  344. package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts +0 -1
  345. package/node_modules/@pierre/diffs/dist/utils/areVirtualWindowSpecsEqual.d.ts.map +1 -1
  346. package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts +1 -0
  347. package/node_modules/@pierre/diffs/dist/utils/areWorkerStatsEqual.d.ts.map +1 -1
  348. package/node_modules/@pierre/diffs/dist/utils/awaitWithTimeout.d.ts.map +1 -1
  349. package/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.d.ts.map +1 -1
  350. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts +3 -3
  351. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.d.ts.map +1 -1
  352. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js +8 -5
  353. package/node_modules/@pierre/diffs/dist/utils/cloneFileDiffMetadata.js.map +1 -1
  354. package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.d.ts +6 -0
  355. package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.d.ts.map +1 -0
  356. package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.js +10 -0
  357. package/node_modules/@pierre/diffs/dist/utils/composeCacheKey.js.map +1 -0
  358. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts +1 -11
  359. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -1
  360. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.d.ts.map +1 -1
  361. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js +9 -8
  362. package/node_modules/@pierre/diffs/dist/utils/computeFileOffsets.js.map +1 -1
  363. package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts +0 -1
  364. package/node_modules/@pierre/diffs/dist/utils/computeVirtualFileMetrics.d.ts.map +1 -1
  365. package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts +0 -1
  366. package/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.d.ts.map +1 -1
  367. package/node_modules/@pierre/diffs/dist/utils/createAnnotationWrapperNode.d.ts.map +1 -1
  368. package/node_modules/@pierre/diffs/dist/utils/createCodeViewHeaderFooterHostElement.d.ts.map +1 -1
  369. package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts +0 -1
  370. package/node_modules/@pierre/diffs/dist/utils/createContentColumn.d.ts.map +1 -1
  371. package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts +0 -1
  372. package/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.d.ts.map +1 -1
  373. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts +1 -6
  374. package/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.d.ts.map +1 -1
  375. package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityContentNode.d.ts.map +1 -1
  376. package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts +0 -1
  377. package/node_modules/@pierre/diffs/dist/utils/createGutterUtilityElement.d.ts.map +1 -1
  378. package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts +0 -1
  379. package/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.d.ts.map +1 -1
  380. package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts +1 -11
  381. package/node_modules/@pierre/diffs/dist/utils/createPreElement.d.ts.map +1 -1
  382. package/node_modules/@pierre/diffs/dist/utils/createRowNodes.d.ts.map +1 -1
  383. package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts +1 -10
  384. package/node_modules/@pierre/diffs/dist/utils/createSeparator.d.ts.map +1 -1
  385. package/node_modules/@pierre/diffs/dist/utils/createSeparator.js +12 -10
  386. package/node_modules/@pierre/diffs/dist/utils/createSeparator.js.map +1 -1
  387. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts +0 -1
  388. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.d.ts.map +1 -1
  389. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js +2 -1
  390. package/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js.map +1 -1
  391. package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts +0 -1
  392. package/node_modules/@pierre/diffs/dist/utils/createStyleElement.d.ts.map +1 -1
  393. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts +0 -1
  394. package/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.d.ts.map +1 -1
  395. package/node_modules/@pierre/diffs/dist/utils/createUnsafeCSSStyleNode.d.ts.map +1 -1
  396. package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts +1 -9
  397. package/node_modules/@pierre/diffs/dist/utils/createWindowFromScrollPosition.d.ts.map +1 -1
  398. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts +0 -1
  399. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.d.ts.map +1 -1
  400. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js +5 -3
  401. package/node_modules/@pierre/diffs/dist/utils/cssWrappers.js.map +1 -1
  402. package/node_modules/@pierre/diffs/dist/utils/detachString.d.ts.map +1 -1
  403. package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts +0 -1
  404. package/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.d.ts.map +1 -1
  405. package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts +68 -0
  406. package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.d.ts.map +1 -0
  407. package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.js +64 -0
  408. package/node_modules/@pierre/diffs/dist/utils/editSessionAnnotations.js.map +1 -0
  409. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts +5 -4
  410. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.d.ts.map +1 -1
  411. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js +7 -5
  412. package/node_modules/@pierre/diffs/dist/utils/editSessionHunks.js.map +1 -1
  413. package/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.d.ts.map +1 -1
  414. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts +1 -5
  415. package/node_modules/@pierre/diffs/dist/utils/getDiffFileInput.d.ts.map +1 -1
  416. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts +1 -2
  417. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -1
  418. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js.map +1 -1
  419. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts +1 -2
  420. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.map +1 -1
  421. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js.map +1 -1
  422. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts +0 -1
  423. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.d.ts.map +1 -1
  424. package/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js.map +1 -1
  425. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts +1 -5
  426. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.d.ts.map +1 -1
  427. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js +1 -1
  428. package/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js.map +1 -1
  429. package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts +1 -6
  430. package/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.d.ts.map +1 -1
  431. package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts +0 -1
  432. package/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.d.ts.map +1 -1
  433. package/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.d.ts.map +1 -1
  434. package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts +0 -1
  435. package/node_modules/@pierre/diffs/dist/utils/getIconForType.d.ts.map +1 -1
  436. package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts +0 -1
  437. package/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.d.ts.map +1 -1
  438. package/node_modules/@pierre/diffs/dist/utils/getLineEndingType.d.ts.map +1 -1
  439. package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts +0 -1
  440. package/node_modules/@pierre/diffs/dist/utils/getLineNodes.d.ts.map +1 -1
  441. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts +1 -5
  442. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictActionSlotName.d.ts.map +1 -1
  443. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts +0 -1
  444. package/node_modules/@pierre/diffs/dist/utils/getMergeConflictLineTypes.d.ts.map +1 -1
  445. package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts +1 -7
  446. package/node_modules/@pierre/diffs/dist/utils/getOrCreateCodeNode.d.ts.map +1 -1
  447. package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts +0 -1
  448. package/node_modules/@pierre/diffs/dist/utils/getSingularPatch.d.ts.map +1 -1
  449. package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts +0 -1
  450. package/node_modules/@pierre/diffs/dist/utils/getThemes.d.ts.map +1 -1
  451. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts +0 -1
  452. package/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.d.ts.map +1 -1
  453. package/node_modules/@pierre/diffs/dist/utils/guardWebKitScrollDuringRebuild.d.ts.map +1 -1
  454. package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts +2 -12
  455. package/node_modules/@pierre/diffs/dist/utils/hast_utils.d.ts.map +1 -1
  456. package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts +1 -5
  457. package/node_modules/@pierre/diffs/dist/utils/hostTheme.d.ts.map +1 -1
  458. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts +0 -1
  459. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.d.ts.map +1 -1
  460. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js +2 -1
  461. package/node_modules/@pierre/diffs/dist/utils/hydratePartialDiff.js.map +1 -1
  462. package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts +0 -1
  463. package/node_modules/@pierre/diffs/dist/utils/includesFileAnnotations.d.ts.map +1 -1
  464. package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts +0 -1
  465. package/node_modules/@pierre/diffs/dist/utils/isDefaultRenderRange.d.ts.map +1 -1
  466. package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts +0 -1
  467. package/node_modules/@pierre/diffs/dist/utils/isDiffPlainText.d.ts.map +1 -1
  468. package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts +0 -1
  469. package/node_modules/@pierre/diffs/dist/utils/isFilePlainText.d.ts.map +1 -1
  470. package/node_modules/@pierre/diffs/dist/utils/isGutterUtilityPath.d.ts.map +1 -1
  471. package/node_modules/@pierre/diffs/dist/utils/isStyleNode.d.ts.map +1 -1
  472. package/node_modules/@pierre/diffs/dist/utils/isWorkerContext.d.ts.map +1 -1
  473. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts +1 -10
  474. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.d.ts.map +1 -1
  475. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js +5 -3
  476. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js.map +1 -1
  477. package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts +15 -0
  478. package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.d.ts.map +1 -0
  479. package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.js +17 -0
  480. package/node_modules/@pierre/diffs/dist/utils/lineAnnotationIdentity.js.map +1 -0
  481. package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts +0 -1
  482. package/node_modules/@pierre/diffs/dist/utils/normalizeDiffResolution.d.ts.map +1 -1
  483. package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts +2 -13
  484. package/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.d.ts.map +1 -1
  485. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts +2 -3
  486. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.d.ts.map +1 -1
  487. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +8 -7
  488. package/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js.map +1 -1
  489. package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts +0 -1
  490. package/node_modules/@pierre/diffs/dist/utils/parseLineType.d.ts.map +1 -1
  491. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts +0 -1
  492. package/node_modules/@pierre/diffs/dist/utils/parseMergeConflictDiffFromFile.d.ts.map +1 -1
  493. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts +6 -4
  494. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.d.ts.map +1 -1
  495. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +42 -14
  496. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js.map +1 -1
  497. package/node_modules/@pierre/diffs/dist/utils/platform.d.ts.map +1 -1
  498. package/node_modules/@pierre/diffs/dist/utils/prefersReducedMotion.d.ts.map +1 -1
  499. package/node_modules/@pierre/diffs/dist/utils/prerenderHTMLIfNecessary.d.ts.map +1 -1
  500. package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts +0 -1
  501. package/node_modules/@pierre/diffs/dist/utils/processLine.d.ts.map +1 -1
  502. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts +0 -1
  503. package/node_modules/@pierre/diffs/dist/utils/realignChangeContent.d.ts.map +1 -1
  504. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts +1 -8
  505. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.d.ts.map +1 -1
  506. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js +6 -5
  507. package/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js.map +1 -1
  508. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts +1 -11
  509. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.d.ts.map +1 -1
  510. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js +7 -4
  511. package/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js.map +1 -1
  512. package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts +0 -1
  513. package/node_modules/@pierre/diffs/dist/utils/resolveConflict.d.ts.map +1 -1
  514. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts +0 -1
  515. package/node_modules/@pierre/diffs/dist/utils/resolveRegion.d.ts.map +1 -1
  516. package/node_modules/@pierre/diffs/dist/utils/roundToDevicePixel.d.ts.map +1 -1
  517. package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.d.ts.map +1 -1
  518. package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js +2 -1
  519. package/node_modules/@pierre/diffs/dist/utils/scrollbarGutter.js.map +1 -1
  520. package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts +0 -1
  521. package/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.d.ts.map +1 -1
  522. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts +1 -11
  523. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.d.ts.map +1 -1
  524. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js +1 -3
  525. package/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js.map +1 -1
  526. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts +0 -1
  527. package/node_modules/@pierre/diffs/dist/utils/shouldUseTokenTransformer.d.ts.map +1 -1
  528. package/node_modules/@pierre/diffs/dist/utils/splitFileContents.d.ts.map +1 -1
  529. package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.d.ts.map +1 -1
  530. package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.js +3 -2
  531. package/node_modules/@pierre/diffs/dist/utils/trimPatchContext.js.map +1 -1
  532. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts +0 -1
  533. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.d.ts.map +1 -1
  534. package/node_modules/@pierre/diffs/dist/utils/updateDiffHunks.js +1 -1
  535. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts +10 -55
  536. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts.map +1 -1
  537. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js +1 -1
  538. package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts +0 -1
  539. package/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.d.ts.map +1 -1
  540. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts +6 -20
  541. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  542. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +52 -11
  543. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js.map +1 -1
  544. package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts +1 -5
  545. package/node_modules/@pierre/diffs/dist/worker/getOrCreateWorkerPoolSingleton.d.ts.map +1 -1
  546. package/node_modules/@pierre/diffs/dist/worker/types.d.ts +5 -1
  547. package/node_modules/@pierre/diffs/dist/worker/types.d.ts.map +1 -1
  548. package/node_modules/@pierre/diffs/dist/worker/worker-portable.d.ts +1 -1
  549. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js +125 -358
  550. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js.map +1 -1
  551. package/node_modules/@pierre/diffs/dist/worker/worker.d.ts +1 -1
  552. package/node_modules/@pierre/diffs/dist/worker/worker.js +28 -17
  553. package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
  554. package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/cjs/deserialize.js +12 -2
  555. package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/cjs/serialize.js +5 -1
  556. package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/esm/deserialize.js +12 -2
  557. package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/esm/serialize.js +5 -1
  558. package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/package.json +1 -1
  559. package/node_modules/@pierre/diffs/node_modules/@ungap/structured-clone/structured-json.js +1 -1
  560. package/node_modules/@pierre/diffs/package.json +12 -5
  561. package/node_modules/playwright-core/browsers.json +9 -32
  562. package/node_modules/playwright-core/lib/coreBundle.js +5402 -4419
  563. package/node_modules/playwright-core/lib/server/electron/loader.js +0 -2
  564. package/node_modules/playwright-core/lib/serverRegistry.js +1674 -7082
  565. package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +8 -297
  566. package/node_modules/playwright-core/lib/tools/cli-client/help.json +19 -6
  567. package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +1 -1
  568. package/node_modules/playwright-core/lib/tools/cli-client/output.js +9 -1
  569. package/node_modules/playwright-core/lib/tools/cli-client/program.js +17 -3
  570. package/node_modules/playwright-core/lib/tools/cli-client/registry.js +9 -5
  571. package/node_modules/playwright-core/lib/tools/cli-client/session.js +2 -1
  572. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +5 -0
  573. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +1 -1
  574. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +4 -11
  575. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +6 -2
  576. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +2 -0
  577. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  578. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +2 -0
  579. package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +6 -3
  580. package/node_modules/playwright-core/lib/tools/utils/extension.js +13 -2
  581. package/node_modules/playwright-core/lib/utilsBundle.js +1934 -7341
  582. package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +8 -297
  583. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  584. package/node_modules/playwright-core/lib/vite/{recorder/assets/codeMirrorModule-CwYYHbcZ.js → dashboard/assets/codeMirrorModule-CQ8RZGBm.js} +1 -1
  585. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  586. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  587. package/node_modules/playwright-core/lib/vite/dashboard/index.html +2 -2
  588. package/node_modules/playwright-core/lib/vite/htmlReport/report.css +1 -1
  589. package/node_modules/playwright-core/lib/vite/htmlReport/report.js +4 -4
  590. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CVQWJZAA.js +32 -0
  591. package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  592. package/node_modules/playwright-core/lib/vite/recorder/assets/index-hrlLqLtq.js +129 -0
  593. package/node_modules/playwright-core/lib/vite/recorder/index.html +2 -2
  594. package/node_modules/playwright-core/lib/vite/traceViewer/assets/{codeMirrorModule-rXmQmLUY.js → codeMirrorModule-BbkfBe3n.js} +1 -1
  595. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-Ds6CBOo0.js +182 -0
  596. package/node_modules/playwright-core/lib/vite/traceViewer/assets/{xtermModule-BuZfJS5v.js → xtermModule-DywYcAf8.js} +1 -1
  597. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.Bqk9acqE.css +1 -0
  598. package/node_modules/playwright-core/lib/vite/traceViewer/index.B4cLoZK3.js +1 -0
  599. package/node_modules/playwright-core/lib/vite/traceViewer/index.html +3 -3
  600. package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +3 -3
  601. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CU5KtEkS.js +5 -0
  602. package/node_modules/playwright-core/lib/vite/traceViewer/{uiMode.C7UW1sC9.css → uiMode.CyMfwkXJ.css} +1 -1
  603. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +4 -4
  604. package/node_modules/playwright-core/package.json +1 -1
  605. package/node_modules/playwright-core/types/protocol.d.ts +201 -398
  606. package/node_modules/playwright-core/types/types.d.ts +771 -327
  607. package/node_modules/typebox/build/compile/validator.d.mts +1 -1
  608. package/node_modules/typebox/build/compile/validator.mjs +1 -1
  609. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
  610. package/node_modules/typebox/build/format/iri.mjs +5 -1
  611. package/node_modules/typebox/build/guard/emit.mjs +2 -4
  612. package/node_modules/typebox/build/guard/guard.mjs +6 -18
  613. package/node_modules/typebox/build/guard/string.mjs +16 -24
  614. package/node_modules/typebox/build/schema/build.mjs +2 -2
  615. package/node_modules/typebox/build/schema/check.mjs +1 -1
  616. package/node_modules/typebox/build/schema/compile.d.mts +3 -2
  617. package/node_modules/typebox/build/schema/compile.mjs +8 -8
  618. package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
  619. package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
  620. package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
  621. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  622. package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
  623. package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
  624. package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
  625. package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
  626. package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
  627. package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
  628. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
  629. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
  630. package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
  631. package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
  632. package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
  633. package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
  634. package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
  635. package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
  636. package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
  637. package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
  638. package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
  639. package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
  640. package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
  641. package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
  642. package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
  643. package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
  644. package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
  645. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
  646. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
  647. package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
  648. package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
  649. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
  650. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
  651. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
  652. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
  653. package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
  654. package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
  655. package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
  656. package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
  657. package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
  658. package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
  659. package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
  660. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
  661. package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
  662. package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
  663. package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
  664. package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
  665. package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
  666. package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
  667. package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
  668. package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
  669. package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
  670. package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
  671. package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
  672. package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
  673. package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
  674. package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
  675. package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
  676. package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
  677. package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
  678. package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
  679. package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
  680. package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
  681. package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
  682. package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
  683. package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
  684. package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
  685. package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
  686. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
  687. package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
  688. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
  689. package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
  690. package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
  691. package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
  692. package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
  693. package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
  694. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
  695. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
  696. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
  697. package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
  698. package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
  699. package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
  700. package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
  701. package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
  702. package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
  703. package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
  704. package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
  705. package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
  706. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
  707. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
  708. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
  709. package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
  710. package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
  711. package/node_modules/typebox/build/schema/errors.d.mts +2 -2
  712. package/node_modules/typebox/build/schema/errors.mjs +8 -14
  713. package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
  714. package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
  715. package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
  716. package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
  717. package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
  718. package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
  719. package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
  720. package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
  721. package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
  722. package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
  723. package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
  724. package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
  725. package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
  726. package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
  727. package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
  728. package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
  729. package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
  730. package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
  731. package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
  732. package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
  733. package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
  734. package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
  735. package/node_modules/typebox/build/schema/parse.d.mts +1 -0
  736. package/node_modules/typebox/build/schema/parse.mjs +10 -5
  737. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
  738. package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
  739. package/node_modules/typebox/build/schema/schema.d.mts +2 -0
  740. package/node_modules/typebox/build/schema/schema.mjs +2 -0
  741. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
  742. package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
  743. package/node_modules/typebox/package.json +1 -1
  744. package/node_modules/typebox/readme.md +59 -89
  745. package/node_modules/zod/README.md +29 -2
  746. package/node_modules/zod/compile.cjs +96 -0
  747. package/node_modules/zod/compile.d.cts +1 -0
  748. package/node_modules/zod/compile.d.ts +1 -0
  749. package/node_modules/zod/compile.js +52 -0
  750. package/node_modules/zod/index.cjs +21 -2
  751. package/node_modules/zod/index.d.cts +1 -2
  752. package/node_modules/zod/index.d.ts +1 -2
  753. package/node_modules/zod/index.js +5 -2
  754. package/node_modules/zod/locales/index.cjs +19 -0
  755. package/node_modules/zod/mini/index.cjs +19 -0
  756. package/node_modules/zod/package.json +20 -8
  757. package/node_modules/zod/src/compile.ts +56 -0
  758. package/node_modules/zod/src/index.ts +5 -2
  759. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  760. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  761. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  762. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  763. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  764. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  765. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  766. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  767. package/node_modules/zod/src/v3/types.ts +5 -5
  768. package/node_modules/zod/src/v4/classic/checks.ts +1 -0
  769. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  770. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  771. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  772. package/node_modules/zod/src/v4/classic/external.ts +14 -9
  773. package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
  774. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  775. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  776. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  777. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  778. package/node_modules/zod/src/v4/classic/schemas.ts +640 -375
  779. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  780. package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
  781. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +186 -0
  782. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
  783. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  784. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  785. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  786. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
  787. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  788. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  789. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  790. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  791. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  792. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  793. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  794. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  795. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
  796. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
  797. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  798. package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
  799. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
  800. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  801. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  802. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  803. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  804. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  805. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  806. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  807. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
  808. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  809. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  810. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  811. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  812. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  813. package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
  814. package/node_modules/zod/src/v4/classic/tests/number.test.ts +85 -9
  815. package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
  816. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  817. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  818. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  819. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  820. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  821. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  822. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  823. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  824. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
  825. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  826. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  827. package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
  828. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  829. package/node_modules/zod/src/v4/classic/tests/string.test.ts +222 -6
  830. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  831. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
  832. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1812 -204
  833. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  834. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  835. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  836. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  837. package/node_modules/zod/src/v4/core/api.ts +87 -35
  838. package/node_modules/zod/src/v4/core/checks.ts +119 -146
  839. package/node_modules/zod/src/v4/core/compile.ts +2313 -0
  840. package/node_modules/zod/src/v4/core/core.ts +99 -22
  841. package/node_modules/zod/src/v4/core/doc.ts +17 -9
  842. package/node_modules/zod/src/v4/core/errors.ts +113 -25
  843. package/node_modules/zod/src/v4/core/index.ts +3 -0
  844. package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
  845. package/node_modules/zod/src/v4/core/json-schema-processors.ts +424 -156
  846. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  847. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  848. package/node_modules/zod/src/v4/core/parse.ts +164 -50
  849. package/node_modules/zod/src/v4/core/regexes.ts +42 -15
  850. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  851. package/node_modules/zod/src/v4/core/schemas.ts +1000 -538
  852. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  853. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  854. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  855. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  856. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  857. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  858. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  859. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  860. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  861. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  862. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  863. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  864. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  865. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  866. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  867. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  868. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  869. package/node_modules/zod/src/v4/core/to-json-schema.ts +283 -48
  870. package/node_modules/zod/src/v4/core/util.ts +454 -157
  871. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  872. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  873. package/node_modules/zod/src/v4/index.ts +3 -3
  874. package/node_modules/zod/src/v4/locales/ar.ts +5 -0
  875. package/node_modules/zod/src/v4/locales/az.ts +5 -0
  876. package/node_modules/zod/src/v4/locales/be.ts +12 -0
  877. package/node_modules/zod/src/v4/locales/bg.ts +5 -0
  878. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  879. package/node_modules/zod/src/v4/locales/ca.ts +5 -0
  880. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  881. package/node_modules/zod/src/v4/locales/cs.ts +5 -0
  882. package/node_modules/zod/src/v4/locales/da.ts +7 -2
  883. package/node_modules/zod/src/v4/locales/de.ts +5 -0
  884. package/node_modules/zod/src/v4/locales/el.ts +3 -0
  885. package/node_modules/zod/src/v4/locales/en.ts +17 -4
  886. package/node_modules/zod/src/v4/locales/eo.ts +5 -0
  887. package/node_modules/zod/src/v4/locales/es.ts +4 -0
  888. package/node_modules/zod/src/v4/locales/fa.ts +5 -0
  889. package/node_modules/zod/src/v4/locales/fi.ts +5 -0
  890. package/node_modules/zod/src/v4/locales/fr-CA.ts +5 -0
  891. package/node_modules/zod/src/v4/locales/fr.ts +21 -14
  892. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  893. package/node_modules/zod/src/v4/locales/he.ts +8 -1
  894. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  895. package/node_modules/zod/src/v4/locales/hr.ts +4 -0
  896. package/node_modules/zod/src/v4/locales/hu.ts +5 -0
  897. package/node_modules/zod/src/v4/locales/hy.ts +11 -0
  898. package/node_modules/zod/src/v4/locales/id.ts +5 -0
  899. package/node_modules/zod/src/v4/locales/index.ts +11 -0
  900. package/node_modules/zod/src/v4/locales/is.ts +5 -0
  901. package/node_modules/zod/src/v4/locales/it.ts +5 -0
  902. package/node_modules/zod/src/v4/locales/ja.ts +5 -0
  903. package/node_modules/zod/src/v4/locales/ka.ts +5 -0
  904. package/node_modules/zod/src/v4/locales/km.ts +5 -0
  905. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  906. package/node_modules/zod/src/v4/locales/ko.ts +5 -0
  907. package/node_modules/zod/src/v4/locales/lt.ts +4 -0
  908. package/node_modules/zod/src/v4/locales/mk.ts +5 -0
  909. package/node_modules/zod/src/v4/locales/ms.ts +5 -0
  910. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  911. package/node_modules/zod/src/v4/locales/nl.ts +5 -0
  912. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  913. package/node_modules/zod/src/v4/locales/no.ts +7 -2
  914. package/node_modules/zod/src/v4/locales/ota.ts +5 -0
  915. package/node_modules/zod/src/v4/locales/pl.ts +5 -0
  916. package/node_modules/zod/src/v4/locales/ps.ts +5 -0
  917. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  918. package/node_modules/zod/src/v4/locales/pt.ts +101 -58
  919. package/node_modules/zod/src/v4/locales/ro.ts +3 -0
  920. package/node_modules/zod/src/v4/locales/ru.ts +12 -0
  921. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  922. package/node_modules/zod/src/v4/locales/sl.ts +5 -0
  923. package/node_modules/zod/src/v4/locales/sv.ts +7 -2
  924. package/node_modules/zod/src/v4/locales/ta.ts +5 -0
  925. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  926. package/node_modules/zod/src/v4/locales/th.ts +5 -0
  927. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  928. package/node_modules/zod/src/v4/locales/tr.ts +5 -0
  929. package/node_modules/zod/src/v4/locales/uk.ts +5 -0
  930. package/node_modules/zod/src/v4/locales/ur.ts +5 -0
  931. package/node_modules/zod/src/v4/locales/uz.ts +3 -0
  932. package/node_modules/zod/src/v4/locales/vi.ts +5 -0
  933. package/node_modules/zod/src/v4/locales/yo.ts +5 -0
  934. package/node_modules/zod/src/v4/locales/zh-CN.ts +5 -0
  935. package/node_modules/zod/src/v4/locales/zh-TW.ts +5 -0
  936. package/node_modules/zod/src/v4/mini/checks.ts +1 -0
  937. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  938. package/node_modules/zod/src/v4/mini/external.ts +12 -1
  939. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  940. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  941. package/node_modules/zod/src/v4/mini/schemas.ts +167 -63
  942. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  943. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  944. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  945. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  946. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  947. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  948. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  949. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  950. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  951. package/node_modules/zod/src/v4/mini/tests/index.test.ts +158 -5
  952. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  953. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  954. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  955. package/node_modules/zod/src/v4/mini/tests/string.test.ts +44 -0
  956. package/node_modules/zod/v3/ZodError.cjs +41 -12
  957. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  958. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  959. package/node_modules/zod/v3/ZodError.js +22 -12
  960. package/node_modules/zod/v3/errors.cjs +19 -0
  961. package/node_modules/zod/v3/external.cjs +19 -0
  962. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  963. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  964. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  965. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  966. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  967. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  968. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  969. package/node_modules/zod/v3/index.cjs +19 -0
  970. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  971. package/node_modules/zod/v3/types.cjs +26 -5
  972. package/node_modules/zod/v3/types.js +7 -5
  973. package/node_modules/zod/v4/classic/checks.cjs +21 -1
  974. package/node_modules/zod/v4/classic/checks.d.cts +1 -1
  975. package/node_modules/zod/v4/classic/checks.d.ts +1 -1
  976. package/node_modules/zod/v4/classic/checks.js +1 -1
  977. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  978. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  979. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  980. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  981. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  982. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  983. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  984. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  985. package/node_modules/zod/v4/classic/errors.cjs +62 -34
  986. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  987. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  988. package/node_modules/zod/v4/classic/errors.js +43 -34
  989. package/node_modules/zod/v4/classic/external.cjs +51 -27
  990. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  991. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  992. package/node_modules/zod/v4/classic/external.js +5 -8
  993. package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
  994. package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
  995. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  996. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  997. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  998. package/node_modules/zod/v4/classic/in-out.js +36 -0
  999. package/node_modules/zod/v4/classic/index.cjs +21 -2
  1000. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  1001. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  1002. package/node_modules/zod/v4/classic/index.js +2 -2
  1003. package/node_modules/zod/v4/classic/iso.cjs +30 -22
  1004. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  1005. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  1006. package/node_modules/zod/v4/classic/iso.js +2 -17
  1007. package/node_modules/zod/v4/classic/parse.cjs +23 -1
  1008. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  1009. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  1010. package/node_modules/zod/v4/classic/parse.js +1 -0
  1011. package/node_modules/zod/v4/classic/schemas.cjs +591 -426
  1012. package/node_modules/zod/v4/classic/schemas.d.cts +68 -19
  1013. package/node_modules/zod/v4/classic/schemas.d.ts +68 -19
  1014. package/node_modules/zod/v4/classic/schemas.js +564 -424
  1015. package/node_modules/zod/v4/core/api.cjs +66 -24
  1016. package/node_modules/zod/v4/core/api.d.cts +22 -12
  1017. package/node_modules/zod/v4/core/api.d.ts +22 -12
  1018. package/node_modules/zod/v4/core/api.js +44 -24
  1019. package/node_modules/zod/v4/core/checks.cjs +88 -128
  1020. package/node_modules/zod/v4/core/checks.d.cts +29 -13
  1021. package/node_modules/zod/v4/core/checks.d.ts +29 -13
  1022. package/node_modules/zod/v4/core/checks.js +68 -127
  1023. package/node_modules/zod/v4/core/compile.cjs +1908 -0
  1024. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  1025. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  1026. package/node_modules/zod/v4/core/compile.js +1858 -0
  1027. package/node_modules/zod/v4/core/core.cjs +101 -19
  1028. package/node_modules/zod/v4/core/core.d.cts +16 -4
  1029. package/node_modules/zod/v4/core/core.d.ts +16 -4
  1030. package/node_modules/zod/v4/core/core.js +83 -20
  1031. package/node_modules/zod/v4/core/doc.cjs +31 -9
  1032. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  1033. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  1034. package/node_modules/zod/v4/core/doc.js +12 -9
  1035. package/node_modules/zod/v4/core/errors.cjs +126 -25
  1036. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  1037. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  1038. package/node_modules/zod/v4/core/errors.js +107 -25
  1039. package/node_modules/zod/v4/core/index.cjs +24 -1
  1040. package/node_modules/zod/v4/core/index.d.cts +3 -0
  1041. package/node_modules/zod/v4/core/index.d.ts +3 -0
  1042. package/node_modules/zod/v4/core/index.js +3 -0
  1043. package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
  1044. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  1045. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  1046. package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  1047. package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
  1048. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  1049. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  1050. package/node_modules/zod/v4/core/json-schema-processors.js +400 -158
  1051. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  1052. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  1053. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  1054. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  1055. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  1056. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  1057. package/node_modules/zod/v4/core/memoizer.js +311 -0
  1058. package/node_modules/zod/v4/core/parse.cjs +148 -46
  1059. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  1060. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  1061. package/node_modules/zod/v4/core/parse.js +127 -45
  1062. package/node_modules/zod/v4/core/regexes.cjs +54 -17
  1063. package/node_modules/zod/v4/core/regexes.d.cts +5 -0
  1064. package/node_modules/zod/v4/core/regexes.d.ts +5 -0
  1065. package/node_modules/zod/v4/core/regexes.js +32 -15
  1066. package/node_modules/zod/v4/core/registries.cjs +19 -0
  1067. package/node_modules/zod/v4/core/registries.js +2 -2
  1068. package/node_modules/zod/v4/core/schemas.cjs +785 -386
  1069. package/node_modules/zod/v4/core/schemas.d.cts +123 -34
  1070. package/node_modules/zod/v4/core/schemas.d.ts +123 -34
  1071. package/node_modules/zod/v4/core/schemas.js +753 -386
  1072. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  1073. package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
  1074. package/node_modules/zod/v4/core/to-json-schema.d.cts +45 -5
  1075. package/node_modules/zod/v4/core/to-json-schema.d.ts +45 -5
  1076. package/node_modules/zod/v4/core/to-json-schema.js +247 -44
  1077. package/node_modules/zod/v4/core/util.cjs +372 -157
  1078. package/node_modules/zod/v4/core/util.d.cts +79 -1
  1079. package/node_modules/zod/v4/core/util.d.ts +79 -1
  1080. package/node_modules/zod/v4/core/util.js +341 -156
  1081. package/node_modules/zod/v4/core/versions.cjs +21 -2
  1082. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  1083. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  1084. package/node_modules/zod/v4/core/versions.js +2 -2
  1085. package/node_modules/zod/v4/core/visit.cjs +214 -0
  1086. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  1087. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  1088. package/node_modules/zod/v4/core/visit.js +169 -0
  1089. package/node_modules/zod/v4/index.cjs +34 -5
  1090. package/node_modules/zod/v4/index.d.cts +2 -2
  1091. package/node_modules/zod/v4/index.d.ts +2 -2
  1092. package/node_modules/zod/v4/index.js +3 -2
  1093. package/node_modules/zod/v4/locales/ar.cjs +5 -0
  1094. package/node_modules/zod/v4/locales/ar.js +5 -0
  1095. package/node_modules/zod/v4/locales/az.cjs +5 -0
  1096. package/node_modules/zod/v4/locales/az.js +5 -0
  1097. package/node_modules/zod/v4/locales/be.cjs +12 -0
  1098. package/node_modules/zod/v4/locales/be.js +12 -0
  1099. package/node_modules/zod/v4/locales/bg.cjs +5 -0
  1100. package/node_modules/zod/v4/locales/bg.js +5 -0
  1101. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  1102. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  1103. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  1104. package/node_modules/zod/v4/locales/bn.js +113 -0
  1105. package/node_modules/zod/v4/locales/ca.cjs +5 -0
  1106. package/node_modules/zod/v4/locales/ca.js +5 -0
  1107. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  1108. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  1109. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  1110. package/node_modules/zod/v4/locales/ckb.js +133 -0
  1111. package/node_modules/zod/v4/locales/cs.cjs +5 -0
  1112. package/node_modules/zod/v4/locales/cs.js +5 -0
  1113. package/node_modules/zod/v4/locales/da.cjs +7 -2
  1114. package/node_modules/zod/v4/locales/da.js +7 -2
  1115. package/node_modules/zod/v4/locales/de.cjs +5 -0
  1116. package/node_modules/zod/v4/locales/de.js +5 -0
  1117. package/node_modules/zod/v4/locales/el.cjs +3 -0
  1118. package/node_modules/zod/v4/locales/el.js +3 -0
  1119. package/node_modules/zod/v4/locales/en.cjs +16 -4
  1120. package/node_modules/zod/v4/locales/en.js +16 -4
  1121. package/node_modules/zod/v4/locales/eo.cjs +5 -0
  1122. package/node_modules/zod/v4/locales/eo.js +5 -0
  1123. package/node_modules/zod/v4/locales/es.cjs +4 -0
  1124. package/node_modules/zod/v4/locales/es.js +4 -0
  1125. package/node_modules/zod/v4/locales/fa.cjs +5 -0
  1126. package/node_modules/zod/v4/locales/fa.js +5 -0
  1127. package/node_modules/zod/v4/locales/fi.cjs +5 -0
  1128. package/node_modules/zod/v4/locales/fi.js +5 -0
  1129. package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
  1130. package/node_modules/zod/v4/locales/fr-CA.js +5 -0
  1131. package/node_modules/zod/v4/locales/fr.cjs +18 -14
  1132. package/node_modules/zod/v4/locales/fr.js +18 -14
  1133. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  1134. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  1135. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  1136. package/node_modules/zod/v4/locales/gu.js +113 -0
  1137. package/node_modules/zod/v4/locales/he.cjs +7 -0
  1138. package/node_modules/zod/v4/locales/he.js +7 -0
  1139. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  1140. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  1141. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  1142. package/node_modules/zod/v4/locales/hi.js +111 -0
  1143. package/node_modules/zod/v4/locales/hr.cjs +4 -0
  1144. package/node_modules/zod/v4/locales/hr.js +4 -0
  1145. package/node_modules/zod/v4/locales/hu.cjs +5 -0
  1146. package/node_modules/zod/v4/locales/hu.js +5 -0
  1147. package/node_modules/zod/v4/locales/hy.cjs +11 -0
  1148. package/node_modules/zod/v4/locales/hy.js +11 -0
  1149. package/node_modules/zod/v4/locales/id.cjs +5 -0
  1150. package/node_modules/zod/v4/locales/id.js +5 -0
  1151. package/node_modules/zod/v4/locales/index.cjs +43 -2
  1152. package/node_modules/zod/v4/locales/index.d.cts +11 -0
  1153. package/node_modules/zod/v4/locales/index.d.ts +11 -0
  1154. package/node_modules/zod/v4/locales/index.js +11 -0
  1155. package/node_modules/zod/v4/locales/is.cjs +5 -0
  1156. package/node_modules/zod/v4/locales/is.js +5 -0
  1157. package/node_modules/zod/v4/locales/it.cjs +5 -0
  1158. package/node_modules/zod/v4/locales/it.js +5 -0
  1159. package/node_modules/zod/v4/locales/ja.cjs +5 -0
  1160. package/node_modules/zod/v4/locales/ja.js +5 -0
  1161. package/node_modules/zod/v4/locales/ka.cjs +5 -0
  1162. package/node_modules/zod/v4/locales/ka.js +5 -0
  1163. package/node_modules/zod/v4/locales/km.cjs +5 -0
  1164. package/node_modules/zod/v4/locales/km.js +5 -0
  1165. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  1166. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  1167. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  1168. package/node_modules/zod/v4/locales/kn.js +116 -0
  1169. package/node_modules/zod/v4/locales/ko.cjs +5 -0
  1170. package/node_modules/zod/v4/locales/ko.js +5 -0
  1171. package/node_modules/zod/v4/locales/lt.cjs +4 -0
  1172. package/node_modules/zod/v4/locales/lt.js +4 -0
  1173. package/node_modules/zod/v4/locales/mk.cjs +5 -0
  1174. package/node_modules/zod/v4/locales/mk.js +5 -0
  1175. package/node_modules/zod/v4/locales/ms.cjs +5 -0
  1176. package/node_modules/zod/v4/locales/ms.js +5 -0
  1177. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  1178. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  1179. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  1180. package/node_modules/zod/v4/locales/ne.js +111 -0
  1181. package/node_modules/zod/v4/locales/nl.cjs +5 -0
  1182. package/node_modules/zod/v4/locales/nl.js +5 -0
  1183. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  1184. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  1185. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  1186. package/node_modules/zod/v4/locales/nn.js +113 -0
  1187. package/node_modules/zod/v4/locales/no.cjs +7 -2
  1188. package/node_modules/zod/v4/locales/no.js +7 -2
  1189. package/node_modules/zod/v4/locales/ota.cjs +5 -0
  1190. package/node_modules/zod/v4/locales/ota.js +5 -0
  1191. package/node_modules/zod/v4/locales/pl.cjs +5 -0
  1192. package/node_modules/zod/v4/locales/pl.js +5 -0
  1193. package/node_modules/zod/v4/locales/ps.cjs +5 -0
  1194. package/node_modules/zod/v4/locales/ps.js +5 -0
  1195. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  1196. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  1197. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  1198. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  1199. package/node_modules/zod/v4/locales/pt.cjs +89 -55
  1200. package/node_modules/zod/v4/locales/pt.js +89 -55
  1201. package/node_modules/zod/v4/locales/ro.cjs +3 -0
  1202. package/node_modules/zod/v4/locales/ro.js +3 -0
  1203. package/node_modules/zod/v4/locales/ru.cjs +12 -0
  1204. package/node_modules/zod/v4/locales/ru.js +12 -0
  1205. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  1206. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  1207. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  1208. package/node_modules/zod/v4/locales/sk.js +116 -0
  1209. package/node_modules/zod/v4/locales/sl.cjs +5 -0
  1210. package/node_modules/zod/v4/locales/sl.js +5 -0
  1211. package/node_modules/zod/v4/locales/sv.cjs +7 -2
  1212. package/node_modules/zod/v4/locales/sv.js +7 -2
  1213. package/node_modules/zod/v4/locales/ta.cjs +5 -0
  1214. package/node_modules/zod/v4/locales/ta.js +5 -0
  1215. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  1216. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  1217. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  1218. package/node_modules/zod/v4/locales/tg.js +117 -0
  1219. package/node_modules/zod/v4/locales/th.cjs +5 -0
  1220. package/node_modules/zod/v4/locales/th.js +5 -0
  1221. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  1222. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  1223. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  1224. package/node_modules/zod/v4/locales/tk.js +107 -0
  1225. package/node_modules/zod/v4/locales/tr.cjs +5 -0
  1226. package/node_modules/zod/v4/locales/tr.js +5 -0
  1227. package/node_modules/zod/v4/locales/uk.cjs +5 -0
  1228. package/node_modules/zod/v4/locales/uk.js +5 -0
  1229. package/node_modules/zod/v4/locales/ur.cjs +5 -0
  1230. package/node_modules/zod/v4/locales/ur.js +5 -0
  1231. package/node_modules/zod/v4/locales/uz.cjs +3 -0
  1232. package/node_modules/zod/v4/locales/uz.js +3 -0
  1233. package/node_modules/zod/v4/locales/vi.cjs +5 -0
  1234. package/node_modules/zod/v4/locales/vi.js +5 -0
  1235. package/node_modules/zod/v4/locales/yo.cjs +5 -0
  1236. package/node_modules/zod/v4/locales/yo.js +5 -0
  1237. package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
  1238. package/node_modules/zod/v4/locales/zh-CN.js +5 -0
  1239. package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
  1240. package/node_modules/zod/v4/locales/zh-TW.js +5 -0
  1241. package/node_modules/zod/v4/mini/checks.cjs +21 -1
  1242. package/node_modules/zod/v4/mini/checks.d.cts +1 -1
  1243. package/node_modules/zod/v4/mini/checks.d.ts +1 -1
  1244. package/node_modules/zod/v4/mini/checks.js +1 -1
  1245. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  1246. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  1247. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  1248. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  1249. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  1250. package/node_modules/zod/v4/mini/external.cjs +33 -1
  1251. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  1252. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  1253. package/node_modules/zod/v4/mini/external.js +3 -1
  1254. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  1255. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  1256. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  1257. package/node_modules/zod/v4/mini/in-out.js +36 -0
  1258. package/node_modules/zod/v4/mini/index.cjs +19 -0
  1259. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  1260. package/node_modules/zod/v4/mini/parse.cjs +22 -1
  1261. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  1262. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  1263. package/node_modules/zod/v4/mini/parse.js +1 -1
  1264. package/node_modules/zod/v4/mini/schemas.cjs +117 -53
  1265. package/node_modules/zod/v4/mini/schemas.d.cts +49 -14
  1266. package/node_modules/zod/v4/mini/schemas.d.ts +49 -14
  1267. package/node_modules/zod/v4/mini/schemas.js +92 -51
  1268. package/node_modules/zod/v4-mini/index.cjs +19 -0
  1269. package/openclaw.plugin.json +19 -3
  1270. package/package.json +10 -8
  1271. package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts +0 -15
  1272. package/node_modules/@pierre/diffs/dist/editor/stateStorage.d.ts.map +0 -1
  1273. package/node_modules/@pierre/diffs/dist/editor/stateStorage.js +0 -65
  1274. package/node_modules/@pierre/diffs/dist/editor/stateStorage.js.map +0 -1
  1275. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +0 -11
  1276. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +0 -1
  1277. package/node_modules/playwright-core/lib/vite/recorder/assets/index-DYjdXIbE.js +0 -129
  1278. package/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +0 -1
  1279. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-B-dXF5JN.js +0 -181
  1280. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +0 -1
  1281. package/node_modules/playwright-core/lib/vite/traceViewer/index.KZ4wOW1K.js +0 -1
  1282. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Dzuouizj.js +0 -5
  1283. package/node_modules/zod/src/v4/core/config.ts +0 -15
  1284. /package/dist/{viewer-assets-D3qrnaxI.js → .setup/viewer-assets-D3qrnaxI.mjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"DiffHunksRenderer.js","names":["createDefaultAnnotationElement"],"sources":["../../src/renderers/DiffHunksRenderer.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement, Properties } from 'hast';\nimport { toHtml } from 'hast-util-to-html';\n\nimport {\n DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,\n DEFAULT_EXPANDED_REGION,\n DEFAULT_RENDER_RANGE,\n DEFAULT_THEMES,\n DEFAULT_TOKENIZE_MAX_LENGTH,\n} from '../constants';\nimport { areLanguagesAttached } from '../highlighter/languages/areLanguagesAttached';\nimport {\n getHighlighterIfLoaded,\n getSharedHighlighter,\n} from '../highlighter/shared_highlighter';\nimport { areThemesAttached } from '../highlighter/themes/areThemesAttached';\nimport type {\n AnnotationLineMap,\n AnnotationSpan,\n BaseCodeOptions,\n BaseDiffOptions,\n BaseDiffOptionsWithDefaults,\n CodeColumnType,\n CustomPreProperties,\n DiffLineAnnotation,\n DiffsHighlighter,\n DiffsTextDocument,\n ExpansionDirections,\n FileDiffMetadata,\n FileHeaderRenderMode,\n HighlightedToken,\n HunkData,\n HunkExpansionRegion,\n HunkSeparators,\n LineTypes,\n RenderDiffOptions,\n RenderDiffResult,\n RenderedDiffASTCache,\n RenderRange,\n SupportedLanguages,\n ThemedDiffResult,\n} from '../types';\nimport { applyLineTextWithNewline } from '../utils/applyLineTextWithNewline';\nimport { areDiffRenderOptionsEqual } from '../utils/areDiffRenderOptionsEqual';\nimport { areDiffTargetsEqual } from '../utils/areDiffTargetsEqual';\nimport { areRenderRangesEqual } from '../utils/areRenderRangesEqual';\nimport { cleanLastNewline } from '../utils/cleanLastNewline';\nimport { createAnnotationElement as createDefaultAnnotationElement } from '../utils/createAnnotationElement';\nimport { createContentColumn } from '../utils/createContentColumn';\nimport { createEmptyRowBuffer } from '../utils/createEmptyRowBuffer';\nimport { createFileHeaderElement } from '../utils/createFileHeaderElement';\nimport { createNoNewlineElement } from '../utils/createNoNewlineElement';\nimport { createPreElement } from '../utils/createPreElement';\nimport { createSeparator } from '../utils/createSeparator';\nimport {\n applySessionChangedLines,\n rebuildSessionHunks,\n remapExpandedHunksForRegionChange,\n type SessionRegionChange,\n} from '../utils/editSessionHunks';\nimport { getFiletypeFromFileName } from '../utils/getFiletypeFromFileName';\nimport { getHighlighterOptions } from '../utils/getHighlighterOptions';\nimport { getHunkSeparatorSlotName } from '../utils/getHunkSeparatorSlotName';\nimport { getLineAnnotationName } from '../utils/getLineAnnotationName';\nimport { getTotalLineCountFromHunks } from '../utils/getTotalLineCountFromHunks';\nimport {\n createGutterGap,\n createGutterItem,\n createGutterWrapper,\n createHastElement,\n} from '../utils/hast_utils';\nimport {\n FILE_ANNOTATION_HUNK_INDEX,\n FILE_ANNOTATION_LINE_INDEX,\n getFileAnnotations,\n shouldRenderFileAnnotations,\n} from '../utils/includesFileAnnotations';\nimport { isDefaultRenderRange } from '../utils/isDefaultRenderRange';\nimport { isDiffPlainText } from '../utils/isDiffPlainText';\nimport type { DiffLineMetadata } from '../utils/iterateOverDiff';\nimport { iterateOverDiff } from '../utils/iterateOverDiff';\nimport { renderDiffWithHighlighter } from '../utils/renderDiffWithHighlighter';\nimport {\n recomputeDiffHunksForEdit,\n recomputeEmptyDocumentDiff,\n recomputeTopAlignedAdditionDiff,\n shouldTopAlignAdditionRecompute,\n updateDiffHunks,\n} from '../utils/updateDiffHunks';\nimport { getTrailingContextRangeSize } from '../utils/virtualDiffLayout';\nimport type { WorkerPoolManager } from '../worker';\n\ninterface PushLineWithAnnotation {\n diffStyle: 'unified' | 'split';\n type: 'context' | 'context-expanded' | 'change';\n\n deletionLine?: ElementContent;\n additionLine?: ElementContent;\n\n unifiedSpan?: AnnotationSpan;\n deletionSpan?: AnnotationSpan;\n additionSpan?: AnnotationSpan;\n\n createAnnotationElement(span: AnnotationSpan): HASTElement;\n context: ProcessContext;\n}\n\ninterface GetRenderOptionsReturn {\n options: RenderDiffOptions;\n forceHighlight: boolean;\n}\n\ninterface PushSeparatorProps {\n hunkIndex: number;\n collapsedLines: number | 'unknown';\n rangeSize: number;\n hunkSpecs: string | undefined;\n isFirstHunk: boolean;\n isLastHunk: boolean;\n isExpandable: boolean;\n}\n\ninterface ProcessContext {\n rowCount: number;\n expansionLineCount: number;\n hunkSeparators: HunkSeparators;\n unifiedContentAST: ElementContent[];\n deletionsContentAST: ElementContent[];\n additionsContentAST: ElementContent[];\n unifiedGutterAST: HASTElement;\n deletionsGutterAST: HASTElement;\n additionsGutterAST: HASTElement;\n hunkData: HunkData[];\n pushToGutter(type: CodeColumnType, element: HASTElement): void;\n incrementRowCount(count?: number): void;\n}\n\nexport interface DiffHunksRendererOptions extends BaseDiffOptions {\n headerRenderMode?: FileHeaderRenderMode;\n}\n\nexport interface DiffHunksRendererOptionsWithDefaults extends Omit<\n BaseDiffOptionsWithDefaults,\n 'themeType'\n> {\n headerRenderMode: FileHeaderRenderMode;\n}\n\nexport interface UnifiedLineDecorationProps {\n type: 'context' | 'context-expanded' | 'change';\n lineType: LineTypes;\n additionLineIndex: number | undefined;\n deletionLineIndex: number | undefined;\n}\n\nexport interface SplitLineDecorationProps {\n side: 'deletions' | 'additions';\n type: 'context' | 'context-expanded' | 'change';\n lineIndex: number | undefined;\n}\n\nexport interface LineDecoration {\n gutterLineType: LineTypes;\n gutterProperties?: Properties;\n contentProperties?: Properties;\n}\n\ninterface PendingSplitContext {\n size: number;\n side: 'additions' | 'deletions' | undefined;\n increment(): void;\n flush(): void;\n}\n\nexport interface RenderedLineContext {\n type: 'context' | 'context-expanded' | 'change';\n hunkIndex: number;\n lineIndex: number;\n unifiedLineIndex: number;\n splitLineIndex: number;\n deletionLine?: DiffLineMetadata;\n additionLine?: DiffLineMetadata;\n}\n\nexport interface InjectedRow {\n content: HASTElement;\n gutter: HASTElement;\n}\n\nexport interface SplitInjectedRow {\n deletion: InjectedRow | undefined;\n addition: InjectedRow | undefined;\n}\n\nexport interface UnifiedInjectedRowPlacement {\n before?: InjectedRow[];\n after?: InjectedRow[];\n}\n\nexport interface SplitInjectedRowPlacement {\n before?: SplitInjectedRow[];\n after?: SplitInjectedRow[];\n}\n\nexport interface HunksRenderResult {\n unifiedGutterAST: ElementContent[] | undefined;\n unifiedContentAST: ElementContent[] | undefined;\n deletionsGutterAST: ElementContent[] | undefined;\n deletionsContentAST: ElementContent[] | undefined;\n additionsGutterAST: ElementContent[] | undefined;\n additionsContentAST: ElementContent[] | undefined;\n hunkData: HunkData[];\n css: string;\n preNode: HASTElement;\n headerElement: HASTElement | undefined;\n totalLines: number;\n themeStyles: string;\n baseThemeType: 'light' | 'dark' | undefined;\n rowCount: number;\n bufferBefore: number;\n bufferAfter: number;\n}\n\nlet instanceId = -1;\n\nexport class DiffHunksRenderer<LAnnotation = undefined> {\n readonly __id: string = `diff-hunks-renderer:${++instanceId}`;\n\n private highlighter: DiffsHighlighter | undefined;\n private diff: FileDiffMetadata | undefined;\n\n private expandedHunks = new Map<number, HunkExpansionRegion>();\n\n private deletionAnnotations: AnnotationLineMap<LAnnotation> = {};\n private additionAnnotations: AnnotationLineMap<LAnnotation> = {};\n\n private computedLang: SupportedLanguages = 'text';\n private renderCache: RenderedDiffASTCache | undefined;\n\n // Edit-session state: while active, hunk updates go through the frozen\n // region skeleton (editSessionHunks) instead of the full recompute, and\n // rendering stays on the main thread with editor-compatible token markup —\n // the editor's caret/selection mapping needs the token transformer, and\n // the pool's global options are not guaranteed to produce it. The pool\n // keeps serving every surface without a session.\n private editSessionActive = false;\n\n constructor(\n public options: DiffHunksRendererOptions = { theme: DEFAULT_THEMES },\n private onRenderUpdate?: () => unknown,\n private workerManager?: WorkerPoolManager | undefined\n ) {\n if (workerManager?.isWorkingPool() !== true) {\n this.highlighter = areThemesAttached(options.theme ?? DEFAULT_THEMES)\n ? getHighlighterIfLoaded()\n : undefined;\n }\n }\n\n public cleanUp(): void {\n this.recycle();\n this.expandedHunks.clear();\n this.workerManager = undefined;\n this.onRenderUpdate = undefined;\n }\n\n public recycle(): void {\n this.highlighter = undefined;\n this.diff = undefined;\n this.clearRenderCache();\n this.additionAnnotations = {};\n this.deletionAnnotations = {};\n this.workerManager?.cleanUpTasks(this);\n // Session hunks and the metadata dirty marker survive recycle in the\n // shared FileDiffMetadata; the renderer-local state re-seeds on the next\n // attach (beginEditSession).\n this.endEditSession();\n }\n\n /**\n * Enter edit-session mode: hunk updates preserve the current region\n * skeleton instead of recomputing hunks, and rendering happens locally\n * with the token transformer forced on (worker-pool requests/results are\n * suspended for this renderer). An empty additions document gets one row so\n * the editor has a line for its caret. Called on every editor attach,\n * including a re-attach after recycle.\n */\n public beginEditSession(): void {\n this.editSessionActive = true;\n const diff = this.diffCache;\n if (diff != null && !diff.isPartial && diff.additionLines.length === 0) {\n Object.assign(\n diff,\n recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions)\n );\n this.markEditSessionPass(diff);\n this.clearRenderCache();\n }\n }\n\n /** Leave edit-session mode. The exit recompute is the host's concern. */\n public endEditSession(): void {\n this.editSessionActive = false;\n }\n\n /**\n * Ensures that the DOM is compatible with editor render updates\n */\n public editorRenderReady(): boolean {\n return (\n this.renderCache?.options.useTokenTransformer === true &&\n this.renderCache.highlighted &&\n this.renderCache.result != null\n );\n }\n\n /**\n * Re-highlights the current diff in the background and swaps the fresh\n * result in (with a re-render) once it completes. Needed after an edit\n * session's exit recompute: session passes plain-fill shifted lines in the\n * cached result, and the recompute mutates the diff in place (same object,\n * same cacheKey), so identity/cacheKey checks would otherwise treat the\n * stale highlight as current forever. The current result — content-correct,\n * mostly highlighted — keeps rendering until the fresh one lands, so no\n * interim paint drops highlighting.\n */\n public refreshHighlightedResult(): Promise<void> {\n const { renderCache } = this;\n if (\n renderCache == null ||\n isDiffPlainText(renderCache.diff) ||\n isDiffMassive(renderCache.diff, this.getTokenizeMaxLength())\n ) {\n return Promise.resolve();\n }\n const { diff } = renderCache;\n const { workerManager } = this;\n // The pool's diff cache is keyed by cacheKey, so a worker refresh needs\n // one; a keyless diff uses the local highlighter fallback below instead.\n if (\n !this.editSessionActive &&\n workerManager?.isWorkingPool() === true &&\n diff.cacheKey != null\n ) {\n workerManager.evictDiffFromCache(diff.cacheKey);\n return workerManager\n .primeDiffHighlightCache(diff)\n .then(() => {\n this.applyRefreshedResult(\n diff,\n workerManager.getDiffResultCache(diff)\n );\n })\n .catch((error: unknown) => this.onHighlightError(error));\n }\n return this.asyncHighlight(diff)\n .then((fresh) => this.applyRefreshedResult(diff, fresh))\n .catch((error: unknown) => this.onHighlightError(error));\n }\n\n // Installs a freshly highlighted result for the same diff, unless the\n // renderer moved on while the highlight ran (new diff, options change, or\n // a new edit session whose passes the fresh result wouldn't reflect).\n private applyRefreshedResult(\n diff: FileDiffMetadata,\n fresh: RenderDiffResult | undefined\n ): void {\n if (\n fresh == null ||\n this.renderCache == null ||\n this.renderCache.diff !== diff ||\n this.editSessionActive\n ) {\n return;\n }\n const { options } = this.getRenderOptions(diff);\n if (!areDiffRenderOptionsEqual(options, fresh.options)) {\n return;\n }\n this.renderCache = {\n diff,\n options: fresh.options,\n highlighted: true,\n result: fresh.result,\n renderRange: undefined,\n };\n this.onRenderUpdate?.();\n }\n\n public get diffCache(): FileDiffMetadata | undefined {\n return this.renderCache?.diff ?? this.diff;\n }\n\n public clearRenderCache(): void {\n const renderCache = this.renderCache;\n this.renderCache = undefined;\n if (\n renderCache != null &&\n renderCache.isDirty === true &&\n renderCache.diff.cacheKey != null\n ) {\n // The render cache has been updated by the host, let's purge it\n // from the worker manager cache.\n this.workerManager?.evictDiffFromCache(renderCache.diff.cacheKey);\n }\n }\n\n public setOptions(options: DiffHunksRendererOptions): void {\n this.options = options;\n }\n\n public mergeOptions(options: Partial<DiffHunksRendererOptions>): void {\n this.options = { ...this.options, ...options };\n }\n\n public expandHunk(\n index: number,\n direction: ExpansionDirections,\n expansionLineCount: number = this.getOptionsWithDefaults()\n .expansionLineCount\n ): void {\n const region = {\n ...(this.expandedHunks.get(index) ?? {\n fromStart: 0,\n fromEnd: 0,\n }),\n };\n if (direction === 'up' || direction === 'both') {\n region.fromStart += expansionLineCount;\n }\n if (direction === 'down' || direction === 'both') {\n region.fromEnd += expansionLineCount;\n }\n // NOTE(amadeus): If our render cache is not highlighted, we need to clear\n // it, otherwise we won't have the correct AST lines. Clearing is safe\n // mid-edit-session even though the dirty cache carries live edits: both\n // session hunk-update paths keep diff.additionLines current every pass,\n // so the rebuilt AST reproduces the live document.\n if (this.renderCache?.highlighted !== true) {\n this.clearRenderCache();\n }\n this.expandedHunks.set(index, region);\n }\n\n public getExpandedHunk(hunkIndex: number): HunkExpansionRegion {\n return this.expandedHunks.get(hunkIndex) ?? DEFAULT_EXPANDED_REGION;\n }\n\n public getExpandedHunksMap(): Map<number, HunkExpansionRegion> {\n return this.expandedHunks;\n }\n\n /** Replace the whole expansion map (session-exit expansion remapping). */\n public setExpandedHunksMap(\n expandedHunks: Map<number, HunkExpansionRegion>\n ): void {\n this.expandedHunks = expandedHunks;\n }\n\n public setLineAnnotations(\n lineAnnotations: DiffLineAnnotation<LAnnotation>[]\n ): void {\n this.additionAnnotations = {};\n this.deletionAnnotations = {};\n for (const annotation of lineAnnotations) {\n const map = ((): AnnotationLineMap<LAnnotation> => {\n switch (annotation.side) {\n case 'deletions':\n return this.deletionAnnotations;\n case 'additions':\n return this.additionAnnotations;\n }\n })();\n const arr = map[annotation.lineNumber] ?? [];\n map[annotation.lineNumber] = arr;\n arr.push(annotation);\n }\n }\n\n /**\n * Returns true when a session-mode pass changed the region skeleton itself\n * (a gap edit synthesized or merged regions), which changes the rendered\n * row set without a line-count change — the host must escalate to a full\n * re-render instead of its cheap refresh path.\n */\n public updateRenderCache(\n dirtyLines: Map<number, Array<HighlightedToken>>,\n themeType: 'dark' | 'light',\n lineCountChangeInFlight = false\n ): boolean {\n if (this.renderCache == null) {\n return false;\n }\n const { result, diff } = this.renderCache;\n if (result == null) {\n return false;\n }\n if (diff.isPartial) {\n throw new Error('Could not update render cache for partial diff');\n }\n\n const hastLines = result.code.additionLines;\n const changedAdditionLines: number[] = [];\n const previousAdditionLines = new Map<number, string>();\n for (const [line, tokens] of dirtyLines) {\n const prev = hastLines[line] as HASTElement | undefined;\n const prevProps = prev?.properties ?? {};\n const lineText = tokens.map((a) => a[2]).join('');\n const canSyncDiffLine = line < diff.additionLines.length;\n const prevLine = canSyncDiffLine ? (diff.additionLines[line] ?? '') : '';\n const prevText = cleanLastNewline(prevLine);\n // The host text document can expose one extra trailing empty line when\n // the file ends with a newline. Deferred tokenization must not grow\n // additionLines from that mismatch or hunk trailing context desyncs.\n if (canSyncDiffLine) {\n diff.additionLines[line] = applyLineTextWithNewline(prevLine, lineText);\n if (prevText !== lineText) {\n changedAdditionLines.push(line);\n previousAdditionLines.set(line, prevLine);\n }\n }\n hastLines[line] = {\n type: 'element',\n tagName: 'div',\n properties: {\n 'data-line': prevProps['data-line'] ?? line + 1,\n 'data-line-index': prevProps['data-line-index'] ?? line,\n 'data-line-type': prevProps['data-line-type'] ?? 'context',\n },\n children: tokens.map(([char, fg, text]) => {\n if (char === 0 && fg === '') {\n if (text === '') {\n return {\n type: 'element',\n tagName: 'br',\n properties: {},\n children: [],\n };\n }\n return { type: 'text', value: text };\n }\n return {\n type: 'element',\n tagName: 'span',\n properties: {\n 'data-char': char,\n style: `color:${fg};`,\n },\n children: [{ type: 'text', value: text }],\n };\n }),\n };\n }\n\n let regionsChanged = false;\n if (changedAdditionLines.length > 0) {\n if (this.editSessionActive && !diff.isPartial) {\n // On a line-count pass the tokenizer emits shifted-but-unedited lines\n // as dirty and the writes above land at stale indexes, so hunk work\n // must wait for the authoritative applyDocumentChange in this same\n // pass. Otherwise (including deferred background passes, which carry\n // genuine changes and are never followed by applyDocumentChange) the\n // explicit changed indexes are current.\n if (!lineCountChangeInFlight) {\n if (\n diff.additionLines.length <= 1 &&\n diff.additionLines.join('') === ''\n ) {\n Object.assign(\n diff,\n recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions)\n );\n this.markEditSessionPass(diff);\n regionsChanged = true;\n } else if (\n shouldTopAlignAdditionRecompute(diff, diff.additionLines)\n ) {\n Object.assign(\n diff,\n recomputeTopAlignedAdditionDiff(\n diff,\n diff.additionLines,\n this.options.parseDiffOptions\n )\n );\n this.markEditSessionPass(diff);\n regionsChanged = true;\n } else {\n const change = applySessionChangedLines(\n diff,\n changedAdditionLines,\n this.options.parseDiffOptions,\n previousAdditionLines\n );\n this.applyExpansionRemap(change);\n regionsChanged = change != null;\n }\n }\n } else {\n Object.assign(\n diff,\n updateDiffHunks(\n diff,\n changedAdditionLines,\n this.options.parseDiffOptions\n )\n );\n }\n }\n\n result.baseThemeType = themeType;\n this.renderCache.isDirty = true;\n return regionsChanged;\n }\n\n private applyExpansionRemap(change: SessionRegionChange | undefined): void {\n if (change != null) {\n this.expandedHunks = remapExpandedHunksForRegionChange(\n this.expandedHunks,\n change\n );\n }\n }\n\n // Normally triggered by the host when the document line count changes.\n public applyDocumentChange(textDocument: DiffsTextDocument): void {\n if (this.renderCache == null) {\n return;\n }\n const { diff, result } = this.renderCache;\n if (result == null) {\n return;\n }\n if (diff.isPartial) {\n throw new Error('Could not apply document change for partial diff');\n }\n\n // updateRenderCache may already have extended diff.additionLines for the\n // same edit pass, so never bail out purely on matching lengths here.\n // Read line-by-line from the editor document instead of materializing the\n // entire text. This preserves blank documents and the final editable empty\n // row after a trailing line break.\n const { additionLines: previousAdditionLines } = diff;\n diff.additionLines = getEditorDocumentLines(\n textDocument,\n previousAdditionLines\n );\n result.code.additionLines = realignAdditionHastLines(\n previousAdditionLines,\n diff.additionLines,\n result.code.additionLines,\n textDocument\n );\n // An empty document splits into zero addition lines, which would recompute\n // to a diff with no editable rows and leave the attached host with no\n // line element for its caret (the additions column vanishes in split;\n // unified shows only deletions). Keep one empty editable line instead.\n if (diff.additionLines.length <= 1 && diff.additionLines.join('') === '') {\n Object.assign(\n diff,\n recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions)\n );\n result.code.additionLines[0] = createPlainAdditionLineElement(\n 0,\n textDocument.getLineText(0)\n );\n this.markEditSessionPass(diff);\n } else if (this.editSessionActive) {\n this.applySessionDocumentChange(diff);\n } else {\n Object.assign(\n diff,\n recomputeDiffHunksForEdit(diff, this.options.parseDiffOptions)\n );\n }\n\n this.renderCache.isDirty = true;\n }\n\n // Session-mode counterpart of the line-count recompute: derive canonical\n // old/current pairing and rebuild the old-side region skeleton from it.\n private applySessionDocumentChange(diff: FileDiffMetadata): void {\n const { parseDiffOptions } = this.options;\n const rawLines = diff.additionLines;\n if (shouldTopAlignAdditionRecompute(diff, rawLines)) {\n Object.assign(\n diff,\n recomputeTopAlignedAdditionDiff(diff, rawLines, parseDiffOptions)\n );\n this.markEditSessionPass(diff);\n return;\n }\n this.applyExpansionRemap(rebuildSessionHunks(diff, parseDiffOptions));\n }\n\n // Records a session pass that replaced hunks wholesale (empty-document or\n // top-aligned shims).\n private markEditSessionPass(diff: FileDiffMetadata): void {\n if (!this.editSessionActive) {\n return;\n }\n diff.editSessionDirty = true;\n }\n\n protected getUnifiedLineDecoration({\n lineType,\n }: UnifiedLineDecorationProps): LineDecoration {\n return {\n gutterLineType: lineType,\n contentProperties: {\n 'data-line-type': lineType,\n },\n };\n }\n\n protected getSplitLineDecoration({\n side,\n type,\n }: SplitLineDecorationProps): LineDecoration {\n const lineType: LineTypes =\n type === 'change'\n ? side === 'deletions'\n ? 'change-deletion'\n : 'change-addition'\n : type;\n return {\n gutterLineType: lineType,\n contentProperties: {\n 'data-line-type': lineType,\n },\n };\n }\n\n private createAnnotationElement = (span: AnnotationSpan): HASTElement => {\n return createDefaultAnnotationElement(span);\n };\n\n // Unified hook returns extra rows that render before/after the current line.\n declare protected getUnifiedInjectedRowsForLine?: (\n ctx: RenderedLineContext\n ) => UnifiedInjectedRowPlacement | undefined;\n\n // Split hook returns extra rows per side before/after the current line.\n declare protected getSplitInjectedRowsForLine?: (\n ctx: RenderedLineContext\n ) => SplitInjectedRowPlacement | undefined;\n\n protected getOptionsWithDefaults(): DiffHunksRendererOptionsWithDefaults {\n const {\n diffIndicators = 'bars',\n diffStyle = 'split',\n disableBackground = false,\n disableFileHeader = false,\n disableLineNumbers = false,\n disableVirtualizationBuffers = false,\n collapsed = false,\n expandUnchanged = false,\n collapsedContextThreshold = DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,\n expansionLineCount = 100,\n hunkSeparators = 'line-info',\n lineDiffType = 'word-alt',\n maxLineDiffLength = 1000,\n overflow = 'scroll',\n stickyHeader = false,\n theme = DEFAULT_THEMES,\n headerRenderMode = 'default',\n tokenizeMaxLineLength = 1000,\n tokenizeMaxLength = DEFAULT_TOKENIZE_MAX_LENGTH,\n useTokenTransformer = false,\n useCSSClasses = false,\n } = this.options;\n return {\n diffIndicators,\n diffStyle,\n disableBackground,\n disableFileHeader,\n disableLineNumbers,\n disableVirtualizationBuffers,\n collapsed,\n expandUnchanged,\n collapsedContextThreshold,\n expansionLineCount,\n hunkSeparators,\n lineDiffType,\n maxLineDiffLength,\n overflow,\n stickyHeader,\n theme: this.workerManager?.getDiffRenderOptions().theme ?? theme,\n headerRenderMode,\n tokenizeMaxLineLength,\n tokenizeMaxLength,\n useTokenTransformer,\n useCSSClasses,\n };\n }\n\n public async initializeHighlighter(): Promise<DiffsHighlighter> {\n this.highlighter = await getSharedHighlighter(\n getHighlighterOptions(this.computedLang, {\n theme: this.getLocalHighlightTheme(),\n preferredHighlighter:\n this.workerManager?.getPreferredHighlighter() ??\n this.options.preferredHighlighter,\n })\n );\n return this.highlighter;\n }\n\n public hydrate(diff: FileDiffMetadata | undefined): void {\n if (diff == null) {\n return;\n }\n this.diff = diff;\n const { options } = this.getRenderOptions(diff);\n const massiveDiff = isDiffMassive(diff, this.getTokenizeMaxLength());\n let cache = this.workerManager?.getDiffResultCache(diff);\n if (cache != null && !areDiffRenderOptionsEqual(options, cache.options)) {\n cache = undefined;\n }\n this.renderCache ??= {\n diff,\n highlighted: !massiveDiff && !isDiffPlainText(diff),\n options,\n result: massiveDiff ? undefined : cache?.result,\n renderRange: undefined,\n };\n if (\n !this.editSessionActive &&\n this.workerManager?.isWorkingPool() === true\n ) {\n if (this.renderCache.result == null && !massiveDiff) {\n // We should only kick off a preload of the AST if we have a WorkerPool\n this.workerManager.highlightDiffAST(this, this.diff);\n }\n }\n // Lets attempt to get the highlighter/languages ready immediately\n else if (this.highlighter == null) {\n this.computedLang = diff.lang ?? getFiletypeFromFileName(diff.name);\n void this.initializeHighlighter();\n }\n }\n\n private getLocalHighlightTheme(): RenderDiffOptions['theme'] {\n return (\n this.workerManager?.getDiffRenderOptions().theme ??\n this.options.theme ??\n DEFAULT_THEMES\n );\n }\n\n public getEffectiveCodeOptions(): Pick<\n BaseCodeOptions,\n 'theme' | 'tokenizeMaxLineLength'\n > {\n const poolOptions =\n this.workerManager?.isWorkingPool() === true\n ? this.workerManager.getDiffRenderOptions()\n : undefined;\n return {\n theme: this.getLocalHighlightTheme(),\n tokenizeMaxLineLength:\n poolOptions?.tokenizeMaxLineLength ??\n this.options.tokenizeMaxLineLength,\n };\n }\n\n private getRenderOptions(diff: FileDiffMetadata): GetRenderOptionsReturn {\n const options: RenderDiffOptions = (() => {\n if (this.workerManager?.isWorkingPool() === true) {\n const poolOptions = this.workerManager.getDiffRenderOptions();\n // Active edit sessions require `useTokenTransformer: true`\n if (\n this.editSessionActive &&\n poolOptions.useTokenTransformer !== true\n ) {\n return { ...poolOptions, useTokenTransformer: true };\n }\n return poolOptions;\n }\n const { theme, tokenizeMaxLineLength, lineDiffType, maxLineDiffLength } =\n this.getOptionsWithDefaults();\n return {\n theme,\n useTokenTransformer:\n this.editSessionActive || this.options.useTokenTransformer === true,\n tokenizeMaxLineLength,\n lineDiffType,\n maxLineDiffLength,\n };\n })();\n this.getOptionsWithDefaults();\n const { renderCache } = this;\n if (renderCache?.result == null) {\n return { options, forceHighlight: true };\n }\n if (\n !areDiffTargetsEqual(diff, renderCache.diff) ||\n !areDiffRenderOptionsEqual(options, renderCache.options)\n ) {\n return { options, forceHighlight: true };\n }\n return { options, forceHighlight: false };\n }\n\n public renderDiff(\n diff: FileDiffMetadata | undefined = this.renderCache?.diff,\n renderRange: RenderRange = DEFAULT_RENDER_RANGE\n ): HunksRenderResult | undefined {\n if (diff == null) {\n return undefined;\n }\n const { expandUnchanged, collapsedContextThreshold } =\n this.getOptionsWithDefaults();\n let { options, forceHighlight } = this.getRenderOptions(diff);\n const cache = this.getMatchingWorkerResultCache(diff, options);\n if (cache != null && !this.hasHighlightedRenderCache(diff, options)) {\n this.renderCache = {\n diff,\n highlighted: true,\n renderRange: undefined,\n ...cache,\n };\n forceHighlight = false;\n }\n this.renderCache ??= {\n diff,\n highlighted: false,\n options,\n result: undefined,\n renderRange: undefined,\n };\n const hasContent =\n diff.additionLines.length > 0 || diff.deletionLines.length > 0;\n const forcePlainText =\n !hasContent ||\n isDiffPlainText(diff) ||\n isDiffMassive(diff, this.getTokenizeMaxLength());\n const newContent = !areDiffTargetsEqual(diff, this.renderCache.diff);\n const newRenderRange = !areRenderRangesEqual(\n this.renderCache.renderRange,\n renderRange\n );\n if (\n !this.editSessionActive &&\n this.workerManager?.isWorkingPool() === true\n ) {\n // An already-highlighted view is waiting on a fresh highlight for the\n // same diff. Returning no result keeps the host's current content in\n // place instead of downgrading it to a plain AST; the pending\n // highlight's completion will re-render. A different diff or a\n // sub-range window still paints plain — the current content cannot\n // serve those.\n const highlightPending =\n this.renderCache.result == null &&\n this.renderCache.highlighted &&\n !forcePlainText &&\n !newContent &&\n isDefaultRenderRange(renderRange);\n if (highlightPending) {\n this.renderCache.highlightPending = true;\n }\n if (\n !highlightPending &&\n (forcePlainText ||\n this.renderCache.result == null ||\n (!this.renderCache.highlighted && (newContent || newRenderRange)))\n ) {\n this.renderCache.diff = diff;\n this.renderCache.options = options;\n this.renderCache.highlighted = false;\n if (\n this.renderCache.result == null ||\n newContent ||\n newRenderRange ||\n forceHighlight\n ) {\n this.renderCache.result = this.workerManager.getPlainDiffAST(\n diff,\n renderRange.startingLine,\n renderRange.totalLines,\n // If we aren't using a windowed render, then we need to render\n // everything\n isDefaultRenderRange(renderRange)\n ? true\n : expandUnchanged\n ? true\n : this.expandedHunks,\n collapsedContextThreshold\n );\n }\n this.renderCache.renderRange = renderRange;\n }\n\n // Should we kick off an async highlight process\n if (\n !forcePlainText &&\n hasContent &&\n (!this.renderCache.highlighted || forceHighlight)\n ) {\n this.workerManager.highlightDiffAST(this, diff);\n }\n } else {\n this.computedLang = diff.lang ?? getFiletypeFromFileName(diff.name);\n const hasThemes =\n this.highlighter != null && areThemesAttached(options.theme);\n const hasLangs =\n this.highlighter != null && areLanguagesAttached(this.computedLang);\n const canHighlight = !forcePlainText && hasLangs;\n\n // If we have any semblance of a highlighter with the correct theme(s)\n // attached, we can kick off some form of rendering. If we don't have\n // the correct language, then we can render plain text and after kick off\n // an async job to get the highlighted AST\n if (\n this.highlighter != null &&\n hasThemes &&\n (forceHighlight ||\n forcePlainText ||\n (!this.renderCache.highlighted && canHighlight) ||\n this.renderCache.result == null)\n ) {\n const { result, options } = this.renderDiffWithHighlighter(\n diff,\n this.highlighter,\n forcePlainText || !hasLangs\n );\n this.renderCache = {\n diff,\n options,\n highlighted: canHighlight,\n result,\n renderRange: undefined,\n };\n }\n\n // If we get in here it means we'll have to kick off an async highlight\n // process which will involve initializing the highlighter with new themes\n // and languages\n if (!hasThemes || (!forcePlainText && !hasLangs)) {\n void this.asyncHighlight(diff).then(({ result, options }) => {\n // In this case we need to force a re-render, so we can do that by\n // reaching into renderCache\n if (this.renderCache != null) {\n this.renderCache.highlighted = false;\n }\n this.applyHighlightResult(diff, result, options, !forcePlainText);\n });\n }\n }\n return this.renderCache.result != null\n ? this.processDiffResult(\n this.renderCache.diff,\n renderRange,\n this.renderCache.result\n )\n : undefined;\n }\n\n public async asyncRender(\n diff: FileDiffMetadata,\n renderRange: RenderRange = DEFAULT_RENDER_RANGE\n ): Promise<HunksRenderResult> {\n const { result } = await this.asyncHighlight(diff);\n return this.processDiffResult(diff, renderRange, result);\n }\n\n protected createPreElement(\n split: boolean,\n totalLines: number,\n customProperties?: CustomPreProperties\n ): HASTElement {\n const { diffIndicators, disableBackground, disableLineNumbers, overflow } =\n this.getOptionsWithDefaults();\n return createPreElement({\n type: 'diff',\n diffIndicators,\n disableBackground,\n disableLineNumbers,\n overflow,\n split,\n totalLines,\n customProperties,\n });\n }\n\n private async asyncHighlight(\n diff: FileDiffMetadata\n ): Promise<RenderDiffResult> {\n const forcePlainText = isDiffMassive(diff, this.getTokenizeMaxLength());\n this.computedLang = forcePlainText\n ? 'text'\n : (diff.lang ?? getFiletypeFromFileName(diff.name));\n const hasThemes =\n this.highlighter != null &&\n areThemesAttached(this.getLocalHighlightTheme());\n const hasLangs =\n forcePlainText ||\n (this.highlighter != null && areLanguagesAttached(this.computedLang));\n // If we don't have the required langs or themes, then we need to\n // initialize the highlighter to load the appropriate languages and themes\n if (this.highlighter == null || !hasThemes || !hasLangs) {\n this.highlighter = await this.initializeHighlighter();\n }\n return this.renderDiffWithHighlighter(\n diff,\n this.highlighter,\n forcePlainText\n );\n }\n\n private renderDiffWithHighlighter(\n diff: FileDiffMetadata,\n highlighter: DiffsHighlighter,\n forcePlainText = false\n ): RenderDiffResult {\n const { options } = this.getRenderOptions(diff);\n const { collapsedContextThreshold } = this.getOptionsWithDefaults();\n const result = renderDiffWithHighlighter(diff, highlighter, options, {\n forcePlainText,\n expandedHunks: forcePlainText ? true : undefined,\n collapsedContextThreshold,\n });\n if (\n this.editSessionActive &&\n diff.additionLines.length === 1 &&\n diff.additionLines[0] === '' &&\n result.code.additionLines[0] == null\n ) {\n let fallbackLine: DiffLineMetadata | undefined;\n iterateOverDiff({\n diff,\n diffStyle: 'both',\n expandedHunks: forcePlainText ? true : undefined,\n collapsedContextThreshold,\n callback: ({ additionLine }) => {\n if (additionLine?.lineIndex !== 0) return;\n fallbackLine = additionLine;\n return true;\n },\n });\n if (fallbackLine == null) {\n throw new Error('DiffHunksRenderer: missing empty addition line');\n }\n result.code.additionLines[0] = createPlainAdditionLineElement(\n 0,\n '',\n fallbackLine.unifiedLineIndex,\n fallbackLine.splitLineIndex\n );\n }\n return { result, options };\n }\n\n public onHighlightSuccess(\n diff: FileDiffMetadata,\n result: ThemedDiffResult,\n options: RenderDiffOptions,\n highlighted = true\n ): void {\n if (this.editSessionActive) {\n return;\n }\n this.applyHighlightResult(diff, result, options, highlighted);\n }\n\n private applyHighlightResult(\n diff: FileDiffMetadata,\n result: ThemedDiffResult,\n options: RenderDiffOptions,\n highlighted = true\n ): void {\n // NOTE(amadeus): This is a bad assumption, and I should figure out\n // something better... If renderCache was blown away, we can assume we've\n // run cleanUp()\n if (this.renderCache == null) {\n return;\n }\n\n const triggerRenderUpdate =\n this.renderCache.highlightPending === true ||\n !this.renderCache.highlighted ||\n !areDiffRenderOptionsEqual(this.renderCache.options, options) ||\n !areDiffTargetsEqual(this.renderCache.diff, diff);\n\n this.renderCache = {\n diff,\n options,\n highlighted,\n result,\n renderRange: undefined,\n };\n if (triggerRenderUpdate) {\n this.onRenderUpdate?.();\n }\n }\n\n private getMatchingWorkerResultCache(\n diff: FileDiffMetadata,\n options: RenderDiffOptions\n ): RenderDiffResult | undefined {\n if (this.editSessionActive) {\n return undefined;\n }\n const cache = this.workerManager?.getDiffResultCache(diff);\n if (cache == null || !areDiffRenderOptionsEqual(options, cache.options)) {\n return undefined;\n }\n return cache;\n }\n\n private hasHighlightedRenderCache(\n diff: FileDiffMetadata,\n options: RenderDiffOptions\n ): boolean {\n const { renderCache } = this;\n return (\n renderCache?.result != null &&\n renderCache.highlighted &&\n areDiffTargetsEqual(diff, renderCache.diff) &&\n areDiffRenderOptionsEqual(options, renderCache.options)\n );\n }\n\n public onHighlightError(error: unknown): void {\n console.error(error);\n }\n\n private getTokenizeMaxLength(): number {\n return this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH;\n }\n\n private processDiffResult(\n fileDiff: FileDiffMetadata,\n renderRange: RenderRange,\n { code, themeStyles, baseThemeType }: ThemedDiffResult\n ): HunksRenderResult {\n const {\n diffStyle,\n disableFileHeader,\n expandUnchanged,\n expansionLineCount,\n collapsedContextThreshold,\n hunkSeparators,\n } = this.getOptionsWithDefaults();\n const isRenderCacheDirty = this.renderCache?.isDirty ?? false;\n\n this.diff = fileDiff;\n const unified = diffStyle === 'unified';\n const canHydrateContext = canHydrateCollapsedContext(\n fileDiff,\n this.options.loadDiffFiles != null\n );\n const isExpandableDiff = !fileDiff.isPartial || canHydrateContext;\n\n let additionsContentAST: ElementContent[] | undefined = [];\n let deletionsContentAST: ElementContent[] | undefined = [];\n let unifiedContentAST: ElementContent[] | undefined = [];\n\n const hunkData: HunkData[] = [];\n const { additionLines, deletionLines } = code;\n const context: ProcessContext = {\n rowCount: 0,\n hunkSeparators,\n additionsContentAST,\n deletionsContentAST,\n unifiedContentAST,\n unifiedGutterAST: createGutterWrapper(),\n deletionsGutterAST: createGutterWrapper(),\n additionsGutterAST: createGutterWrapper(),\n expansionLineCount,\n hunkData,\n incrementRowCount(count = 1) {\n context.rowCount += count;\n },\n pushToGutter(type: CodeColumnType, element: HASTElement) {\n switch (type) {\n case 'unified': {\n context.unifiedGutterAST.children.push(element);\n break;\n }\n case 'deletions': {\n context.deletionsGutterAST.children.push(element);\n break;\n }\n case 'additions': {\n context.additionsGutterAST.children.push(element);\n break;\n }\n }\n },\n };\n const trailingRangeSize = getTrailingContextRangeSize({\n fileDiff,\n errorPrefix: 'DiffHunksRenderer.processDiffResult',\n });\n const pendingSplitContext: PendingSplitContext = {\n size: 0,\n side: undefined,\n increment() {\n this.size += 1;\n },\n flush() {\n if (diffStyle === 'unified') {\n return;\n }\n if (this.size <= 0 || this.side == null) {\n this.side = undefined;\n this.size = 0;\n return;\n }\n if (this.side === 'additions') {\n context.pushToGutter(\n 'additions',\n createGutterGap(undefined, 'buffer', this.size)\n );\n additionsContentAST?.push(createEmptyRowBuffer(this.size));\n } else {\n context.pushToGutter(\n 'deletions',\n createGutterGap(undefined, 'buffer', this.size)\n );\n deletionsContentAST?.push(createEmptyRowBuffer(this.size));\n }\n this.size = 0;\n this.side = undefined;\n },\n };\n\n const pushGutterLineNumber = (\n type: CodeColumnType,\n lineType: LineTypes | 'buffer' | 'separator' | 'annotation',\n lineNumber: number,\n lineIndex: string,\n gutterProperties: Properties | undefined\n ) => {\n context.pushToGutter(\n type,\n createGutterItem(lineType, lineNumber, lineIndex, gutterProperties)\n );\n };\n\n function pushSeparators(props: PushSeparatorProps) {\n pendingSplitContext.flush();\n if (diffStyle === 'unified') {\n pushSeparator('unified', props, context);\n } else {\n pushSeparator('deletions', props, context);\n pushSeparator('additions', props, context);\n }\n }\n\n this.pushFileLevelAnnotations(fileDiff, diffStyle, renderRange, context);\n\n iterateOverDiff({\n diff: fileDiff,\n diffStyle,\n startingLine: renderRange.startingLine,\n totalLines: renderRange.totalLines,\n expandedHunks: expandUnchanged ? true : this.expandedHunks,\n collapsedContextThreshold,\n callback: ({\n hunkIndex,\n hunk,\n collapsedBefore,\n collapsedAfter,\n additionLine,\n deletionLine,\n type,\n }) => {\n const splitLineIndex =\n deletionLine != null\n ? deletionLine.splitLineIndex\n : additionLine.splitLineIndex;\n const unifiedLineIndex =\n additionLine != null\n ? additionLine.unifiedLineIndex\n : deletionLine.unifiedLineIndex;\n\n if (diffStyle === 'split' && type !== 'change') {\n pendingSplitContext.flush();\n }\n\n if (collapsedBefore > 0) {\n pushSeparators({\n hunkIndex,\n collapsedLines: collapsedBefore,\n rangeSize: Math.max(hunk?.collapsedBefore ?? 0, 0),\n hunkSpecs: hunk?.hunkSpecs,\n isFirstHunk: hunkIndex === 0,\n isLastHunk: false,\n isExpandable: isExpandableDiff,\n });\n }\n\n const lineIndex =\n diffStyle === 'unified' ? unifiedLineIndex : splitLineIndex;\n const renderedLineContext: RenderedLineContext = {\n type,\n hunkIndex,\n lineIndex,\n unifiedLineIndex,\n splitLineIndex,\n deletionLine,\n additionLine,\n };\n\n if (diffStyle === 'unified') {\n const injectedRows =\n this.getUnifiedInjectedRowsForLine?.(renderedLineContext);\n if (injectedRows?.before != null) {\n pushUnifiedInjectedRows(injectedRows.before, context);\n }\n let deletionLineContent =\n deletionLine != null\n ? deletionLines[deletionLine.lineIndex]\n : undefined;\n let additionLineContent =\n additionLine != null\n ? additionLines[additionLine.lineIndex]\n : undefined;\n if (deletionLineContent == null && additionLineContent == null) {\n const errorMessage =\n 'DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong';\n console.error(errorMessage, { file: fileDiff.name });\n throw new Error(errorMessage);\n }\n const lineType =\n type === 'change'\n ? additionLine != null\n ? 'change-addition'\n : 'change-deletion'\n : type;\n const lineDecoration = this.getUnifiedLineDecoration({\n // NOTE: This function gets extended so don't remove\n // these extra props\n type,\n lineType,\n additionLineIndex: additionLine?.lineIndex,\n deletionLineIndex: deletionLine?.lineIndex,\n });\n pushGutterLineNumber(\n 'unified',\n lineDecoration.gutterLineType,\n additionLine != null\n ? additionLine.lineNumber\n : deletionLine.lineNumber,\n `${unifiedLineIndex},${splitLineIndex}`,\n lineDecoration.gutterProperties\n );\n if (additionLineContent != null) {\n additionLineContent = withContentProperties(\n additionLineContent,\n lineDecoration.contentProperties,\n isRenderCacheDirty && additionLine != null\n ? {\n 'data-line': additionLine.lineNumber,\n 'data-line-index': `${unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n } else if (deletionLineContent != null) {\n deletionLineContent = withContentProperties(\n deletionLineContent,\n lineDecoration.contentProperties,\n isRenderCacheDirty && deletionLine != null\n ? {\n 'data-line': deletionLine.lineNumber,\n 'data-line-index': `${unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n }\n pushLineWithAnnotation({\n diffStyle: 'unified',\n type: type,\n deletionLine: deletionLineContent,\n additionLine: additionLineContent,\n unifiedSpan: this.getAnnotations(\n 'unified',\n deletionLine?.lineNumber,\n additionLine?.lineNumber,\n hunkIndex,\n lineIndex\n ),\n createAnnotationElement: (span) =>\n this.createAnnotationElement(span),\n context,\n });\n if (injectedRows?.after != null) {\n pushUnifiedInjectedRows(injectedRows.after, context);\n }\n } else {\n const injectedRows =\n this.getSplitInjectedRowsForLine?.(renderedLineContext);\n if (injectedRows?.before != null) {\n pushSplitInjectedRows(\n injectedRows.before,\n context,\n pendingSplitContext\n );\n }\n\n let deletionLineContent =\n deletionLine != null\n ? deletionLines[deletionLine.lineIndex]\n : undefined;\n let additionLineContent =\n additionLine != null\n ? additionLines[additionLine.lineIndex]\n : undefined;\n const deletionLineDecoration = this.getSplitLineDecoration({\n side: 'deletions',\n type,\n lineIndex: deletionLine?.lineIndex,\n });\n const additionLineDecoration = this.getSplitLineDecoration({\n side: 'additions',\n type,\n lineIndex: additionLine?.lineIndex,\n });\n\n if (deletionLineContent == null && additionLineContent == null) {\n const errorMessage =\n 'DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong';\n console.error(errorMessage, { file: fileDiff.name });\n throw new Error(errorMessage);\n }\n\n const missingSide = (() => {\n if (type === 'change') {\n if (additionLineContent == null) {\n return 'additions';\n } else if (deletionLineContent == null) {\n return 'deletions';\n }\n }\n return undefined;\n })();\n if (missingSide != null) {\n if (\n pendingSplitContext.side != null &&\n pendingSplitContext.side !== missingSide\n ) {\n pendingSplitContext.flush();\n }\n pendingSplitContext.side = missingSide;\n pendingSplitContext.increment();\n } else if (type === 'change') {\n // A change row with both sides fills the column a pending\n // one-sided buffer was holding open (an insert/delete block\n // directly followed by a paired block, from similarity\n // realignment); flush first so the buffer lands above this row.\n pendingSplitContext.flush();\n }\n\n const annotationSpans = this.getAnnotations(\n 'split',\n deletionLine?.lineNumber,\n additionLine?.lineNumber,\n hunkIndex,\n lineIndex\n );\n if (annotationSpans != null && pendingSplitContext.size > 0) {\n pendingSplitContext.flush();\n }\n\n if (deletionLine != null) {\n const deletionLineDecorated = withContentProperties(\n deletionLineContent,\n deletionLineDecoration.contentProperties,\n isRenderCacheDirty\n ? {\n 'data-line': deletionLine.lineNumber,\n 'data-line-index': `${deletionLine.unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n pushGutterLineNumber(\n 'deletions',\n deletionLineDecoration.gutterLineType,\n deletionLine.lineNumber,\n `${deletionLine.unifiedLineIndex},${splitLineIndex}`,\n deletionLineDecoration.gutterProperties\n );\n if (deletionLineDecorated != null) {\n deletionLineContent = deletionLineDecorated;\n }\n }\n if (additionLine != null) {\n const additionLineDecorated = withContentProperties(\n additionLineContent,\n additionLineDecoration.contentProperties,\n isRenderCacheDirty\n ? {\n 'data-line': additionLine.lineNumber,\n 'data-line-index': `${additionLine.unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n pushGutterLineNumber(\n 'additions',\n additionLineDecoration.gutterLineType,\n additionLine.lineNumber,\n `${additionLine.unifiedLineIndex},${splitLineIndex}`,\n additionLineDecoration.gutterProperties\n );\n if (additionLineDecorated != null) {\n additionLineContent = additionLineDecorated;\n }\n }\n pushLineWithAnnotation({\n diffStyle: 'split',\n type: type,\n additionLine: additionLineContent,\n deletionLine: deletionLineContent,\n ...annotationSpans,\n createAnnotationElement: (span) =>\n this.createAnnotationElement(span),\n context,\n });\n if (injectedRows?.after != null) {\n pushSplitInjectedRows(\n injectedRows.after,\n context,\n pendingSplitContext\n );\n }\n }\n\n const isFinalSplitHunkRow =\n diffStyle === 'split' &&\n hunk != null &&\n splitLineIndex === hunk.splitLineStart + hunk.splitLineCount - 1;\n const isFinalHunkRow =\n hunkIndex === fileDiff.hunks.length - 1 &&\n hunk != null &&\n (diffStyle === 'split'\n ? splitLineIndex === hunk.splitLineStart + hunk.splitLineCount - 1\n : unifiedLineIndex ===\n hunk.unifiedLineStart + hunk.unifiedLineCount - 1);\n const splitNoEOFCRDeletion = isFinalSplitHunkRow\n ? hunk.noEOFCRDeletions\n : false;\n const splitNoEOFCRAddition = isFinalSplitHunkRow\n ? hunk.noEOFCRAdditions\n : false;\n const noEOFCRDeletion =\n (deletionLine?.noEOFCR ?? false) || splitNoEOFCRDeletion;\n const noEOFCRAddition =\n (additionLine?.noEOFCR ?? false) || splitNoEOFCRAddition;\n if (noEOFCRAddition || noEOFCRDeletion) {\n if (diffStyle === 'split') {\n pendingSplitContext.flush();\n }\n if (noEOFCRDeletion) {\n const noEOFType =\n type === 'context' || type === 'context-expanded'\n ? type\n : 'change-deletion';\n if (diffStyle === 'unified') {\n context.unifiedContentAST.push(createNoNewlineElement(noEOFType));\n context.pushToGutter(\n 'unified',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n } else {\n context.deletionsContentAST.push(\n createNoNewlineElement(noEOFType)\n );\n context.pushToGutter(\n 'deletions',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n if (!noEOFCRAddition) {\n context.pushToGutter(\n 'additions',\n createGutterGap(undefined, 'buffer', 1)\n );\n context.additionsContentAST.push(createEmptyRowBuffer(1));\n }\n }\n }\n if (noEOFCRAddition) {\n const noEOFType =\n type === 'context' || type === 'context-expanded'\n ? type\n : 'change-addition';\n if (diffStyle === 'unified') {\n context.unifiedContentAST.push(createNoNewlineElement(noEOFType));\n context.pushToGutter(\n 'unified',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n } else {\n context.additionsContentAST.push(\n createNoNewlineElement(noEOFType)\n );\n context.pushToGutter(\n 'additions',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n if (!noEOFCRDeletion) {\n context.pushToGutter(\n 'deletions',\n createGutterGap(undefined, 'buffer', 1)\n );\n context.deletionsContentAST.push(createEmptyRowBuffer(1));\n }\n }\n }\n context.incrementRowCount(1);\n }\n\n if (\n hunkSeparators !== 'simple' &&\n hunkSeparators !== 'metadata' &&\n (collapsedAfter > 0 || (isFinalHunkRow && canHydrateContext))\n ) {\n pushSeparators({\n hunkIndex: type === 'context-expanded' ? hunkIndex : hunkIndex + 1,\n collapsedLines:\n isFinalHunkRow && canHydrateContext ? 'unknown' : collapsedAfter,\n rangeSize: trailingRangeSize,\n hunkSpecs: undefined,\n isFirstHunk: false,\n isLastHunk: true,\n isExpandable: isExpandableDiff,\n });\n }\n context.incrementRowCount(1);\n },\n });\n\n if (diffStyle === 'split') {\n pendingSplitContext.flush();\n }\n\n const totalLines = Math.max(\n getTotalLineCountFromHunks(fileDiff.hunks),\n fileDiff.additionLines.length ?? 0,\n fileDiff.deletionLines.length ?? 0\n );\n\n const hasBuffer =\n renderRange.bufferBefore > 0 || renderRange.bufferAfter > 0;\n // Determine which ASTs to include based on diff style and file type\n const shouldIncludeAdditions = !unified && fileDiff.type !== 'deleted';\n const shouldIncludeDeletions = !unified && fileDiff.type !== 'new';\n const hasContent = context.rowCount > 0 || hasBuffer;\n\n additionsContentAST =\n shouldIncludeAdditions && hasContent ? additionsContentAST : undefined;\n deletionsContentAST =\n shouldIncludeDeletions && hasContent ? deletionsContentAST : undefined;\n unifiedContentAST = unified && hasContent ? unifiedContentAST : undefined;\n\n const preNode = this.createPreElement(\n deletionsContentAST != null && additionsContentAST != null,\n totalLines\n );\n\n return {\n unifiedGutterAST:\n unified && hasContent ? context.unifiedGutterAST.children : undefined,\n unifiedContentAST,\n deletionsGutterAST:\n shouldIncludeDeletions && hasContent\n ? context.deletionsGutterAST.children\n : undefined,\n deletionsContentAST,\n additionsGutterAST:\n shouldIncludeAdditions && hasContent\n ? context.additionsGutterAST.children\n : undefined,\n additionsContentAST,\n hunkData,\n preNode,\n themeStyles,\n baseThemeType,\n headerElement: !disableFileHeader\n ? this.renderHeader(this.diff)\n : undefined,\n totalLines,\n rowCount: context.rowCount,\n bufferBefore: renderRange.bufferBefore,\n bufferAfter: renderRange.bufferAfter,\n // FIXME\n css: '',\n };\n }\n\n public renderCodeAST(\n type: 'unified' | 'deletions' | 'additions',\n result: HunksRenderResult\n ): ElementContent[] | undefined {\n const gutterAST =\n type === 'unified'\n ? result.unifiedGutterAST\n : type === 'deletions'\n ? result.deletionsGutterAST\n : result.additionsGutterAST;\n\n const contentAST =\n type === 'unified'\n ? result.unifiedContentAST\n : type === 'deletions'\n ? result.deletionsContentAST\n : result.additionsContentAST;\n\n if (gutterAST == null || contentAST == null) {\n return undefined;\n }\n\n const gutter = createGutterWrapper(gutterAST);\n gutter.properties.style = `grid-row: span ${result.rowCount}`;\n const contentColumn = createContentColumn(contentAST, result.rowCount);\n return [gutter, contentColumn];\n }\n\n public renderFullAST(\n result: HunksRenderResult,\n children: ElementContent[] = []\n ): HASTElement {\n const containerSize =\n this.getOptionsWithDefaults().hunkSeparators === 'line-info';\n const unifiedAST = this.renderCodeAST('unified', result);\n if (unifiedAST != null) {\n children.push(\n createHastElement({\n tagName: 'code',\n children: unifiedAST,\n properties: {\n 'data-code': '',\n 'data-container-size': containerSize ? '' : undefined,\n 'data-unified': '',\n },\n })\n );\n return { ...result.preNode, children };\n }\n\n const deletionsAST = this.renderCodeAST('deletions', result);\n if (deletionsAST != null) {\n children.push(\n createHastElement({\n tagName: 'code',\n children: deletionsAST,\n properties: {\n 'data-code': '',\n 'data-container-size': containerSize ? '' : undefined,\n 'data-deletions': '',\n },\n })\n );\n }\n const additionsAST = this.renderCodeAST('additions', result);\n if (additionsAST != null) {\n children.push(\n createHastElement({\n tagName: 'code',\n children: additionsAST,\n properties: {\n 'data-code': '',\n 'data-container-size': containerSize ? '' : undefined,\n 'data-additions': '',\n },\n })\n );\n }\n return { ...result.preNode, children };\n }\n\n public renderFullHTML(\n result: HunksRenderResult,\n tempChildren: ElementContent[] = []\n ): string {\n return toHtml(this.renderFullAST(result, tempChildren));\n }\n\n public renderPartialHTML(\n children: ElementContent[],\n columnType?: 'unified' | 'deletions' | 'additions'\n ): string {\n if (columnType == null) {\n return toHtml(children);\n }\n return toHtml(\n createHastElement({\n tagName: 'code',\n children,\n properties: {\n 'data-code': '',\n 'data-container-size':\n this.getOptionsWithDefaults().hunkSeparators === 'line-info'\n ? ''\n : undefined,\n [`data-${columnType}`]: '',\n },\n })\n );\n }\n\n private pushFileLevelAnnotations(\n fileDiff: FileDiffMetadata,\n diffStyle: 'unified' | 'split',\n renderRange: RenderRange,\n context: ProcessContext\n ): void {\n if (!shouldRenderFileAnnotations(renderRange)) {\n return;\n }\n\n const deletionAnnotationNames =\n fileDiff.type !== 'new'\n ? getAnnotationNames(getFileAnnotations(this.deletionAnnotations))\n : [];\n const additionAnnotationNames =\n fileDiff.type !== 'deleted'\n ? getAnnotationNames(getFileAnnotations(this.additionAnnotations))\n : [];\n if (\n deletionAnnotationNames.length === 0 &&\n additionAnnotationNames.length === 0\n ) {\n return;\n }\n\n const hunkIndex = FILE_ANNOTATION_HUNK_INDEX;\n const lineIndex = FILE_ANNOTATION_LINE_INDEX;\n const { createAnnotationElement } = this;\n\n if (diffStyle === 'unified') {\n pushLineWithAnnotation({\n diffStyle,\n type: 'context',\n unifiedSpan: {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: deletionAnnotationNames.concat(additionAnnotationNames),\n },\n createAnnotationElement,\n context,\n });\n return;\n }\n\n pushLineWithAnnotation({\n diffStyle,\n type: 'context',\n deletionSpan: {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: deletionAnnotationNames,\n },\n additionSpan: {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: additionAnnotationNames,\n },\n createAnnotationElement,\n context,\n });\n }\n\n private getAnnotations(\n type: 'unified',\n deletionLineNumber: number | undefined,\n additionLineNumber: number | undefined,\n hunkIndex: number,\n lineIndex: number\n ): AnnotationSpan | undefined;\n private getAnnotations(\n type: 'split',\n deletionLineNumber: number | undefined,\n additionLineNumber: number | undefined,\n hunkIndex: number,\n lineIndex: number\n ): { deletionSpan: AnnotationSpan; additionSpan: AnnotationSpan } | undefined;\n private getAnnotations(\n type: 'unified' | 'split',\n deletionLineNumber: number | undefined,\n additionLineNumber: number | undefined,\n hunkIndex: number,\n lineIndex: number\n ):\n | AnnotationSpan\n | { deletionSpan: AnnotationSpan; additionSpan: AnnotationSpan }\n | undefined {\n const deletionSpan: AnnotationSpan = {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: [],\n };\n if (deletionLineNumber != null) {\n for (const anno of this.deletionAnnotations[deletionLineNumber] ?? []) {\n deletionSpan.annotations.push(getLineAnnotationName(anno));\n }\n }\n const additionSpan: AnnotationSpan = {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: [],\n };\n if (additionLineNumber != null) {\n for (const anno of this.additionAnnotations[additionLineNumber] ?? []) {\n (type === 'unified' ? deletionSpan : additionSpan).annotations.push(\n getLineAnnotationName(anno)\n );\n }\n }\n if (type === 'unified') {\n if (deletionSpan.annotations.length > 0) {\n return deletionSpan;\n }\n return undefined;\n }\n if (\n additionSpan.annotations.length === 0 &&\n deletionSpan.annotations.length === 0\n ) {\n return undefined;\n }\n return { deletionSpan, additionSpan };\n }\n\n private renderHeader(diff: FileDiffMetadata): HASTElement {\n const { headerRenderMode, stickyHeader } = this.getOptionsWithDefaults();\n return createFileHeaderElement({\n fileOrDiff: diff,\n mode: headerRenderMode,\n stickyHeader,\n });\n }\n}\n\nfunction getAnnotationNames<LAnnotation>(\n annotations: DiffLineAnnotation<LAnnotation>[] | undefined\n): string[] {\n return (\n annotations?.map((annotation) => getLineAnnotationName(annotation)) ?? []\n );\n}\n\n// Use the platform's English plural rules to pick \"line\" vs \"lines\" so a\n// count of 0 reads as \"0 unmodified lines\". en-US returns \"one\" only for 1.\nconst EN_PLURAL_RULES = new Intl.PluralRules('en-US');\n\nfunction getModifiedLinesString(lines: number) {\n const suffix = EN_PLURAL_RULES.select(lines) === 'one' ? '' : 's';\n return `${lines} unmodified line${suffix}`;\n}\n\nfunction pushUnifiedInjectedRows(\n rows: InjectedRow[],\n context: ProcessContext\n): void {\n for (const row of rows) {\n context.unifiedContentAST.push(row.content);\n context.pushToGutter('unified', row.gutter);\n context.incrementRowCount(1);\n }\n}\n\nfunction pushSplitInjectedRows(\n rows: SplitInjectedRow[],\n context: ProcessContext,\n pendingSplitContext: PendingSplitContext\n): void {\n for (const { deletion, addition } of rows) {\n if (deletion == null && addition == null) {\n continue;\n }\n const missingSide =\n deletion != null && addition != null\n ? undefined\n : deletion == null\n ? 'deletions'\n : 'additions';\n\n if (missingSide == null || pendingSplitContext.side !== missingSide) {\n pendingSplitContext.flush();\n }\n\n if (deletion != null) {\n context.deletionsContentAST.push(deletion.content);\n context.pushToGutter('deletions', deletion.gutter);\n }\n\n if (addition != null) {\n context.additionsContentAST.push(addition.content);\n context.pushToGutter('additions', addition.gutter);\n }\n\n if (missingSide != null) {\n pendingSplitContext.side = missingSide;\n pendingSplitContext.increment();\n }\n\n context.incrementRowCount(1);\n }\n}\n\nfunction pushLineWithAnnotation({\n diffStyle,\n type,\n deletionLine,\n additionLine,\n unifiedSpan,\n deletionSpan,\n additionSpan,\n createAnnotationElement,\n context,\n}: PushLineWithAnnotation) {\n let hasAnnotationRow = false;\n if (diffStyle === 'unified') {\n if (additionLine != null) {\n context.unifiedContentAST.push(additionLine);\n } else if (deletionLine != null) {\n context.unifiedContentAST.push(deletionLine);\n }\n if (unifiedSpan != null) {\n const lineType =\n type === 'change'\n ? deletionLine != null\n ? 'change-deletion'\n : 'change-addition'\n : type;\n context.unifiedContentAST.push(createAnnotationElement(unifiedSpan));\n context.pushToGutter(\n 'unified',\n createGutterGap(lineType, 'annotation', 1)\n );\n hasAnnotationRow = true;\n }\n } else if (diffStyle === 'split') {\n if (deletionLine != null) {\n context.deletionsContentAST.push(deletionLine);\n }\n if (additionLine != null) {\n context.additionsContentAST.push(additionLine);\n }\n if (deletionSpan != null) {\n const lineType =\n type === 'change'\n ? deletionLine != null\n ? 'change-deletion'\n : 'context'\n : type;\n context.deletionsContentAST.push(createAnnotationElement(deletionSpan));\n context.pushToGutter(\n 'deletions',\n createGutterGap(lineType, 'annotation', 1)\n );\n hasAnnotationRow = true;\n }\n if (additionSpan != null) {\n const lineType =\n type === 'change'\n ? additionLine != null\n ? 'change-addition'\n : 'context'\n : type;\n context.additionsContentAST.push(createAnnotationElement(additionSpan));\n context.pushToGutter(\n 'additions',\n createGutterGap(lineType, 'annotation', 1)\n );\n hasAnnotationRow = true;\n }\n }\n if (hasAnnotationRow) {\n context.incrementRowCount(1);\n }\n}\n\nfunction pushSeparator(\n type: 'additions' | 'deletions' | 'unified',\n {\n hunkIndex,\n collapsedLines,\n rangeSize,\n hunkSpecs,\n isFirstHunk,\n isLastHunk,\n isExpandable,\n }: PushSeparatorProps,\n context: ProcessContext\n) {\n if (typeof collapsedLines === 'number' && collapsedLines <= 0) {\n return;\n }\n const linesAST =\n type === 'unified'\n ? context.unifiedContentAST\n : type === 'deletions'\n ? context.deletionsContentAST\n : context.additionsContentAST;\n\n if (context.hunkSeparators === 'metadata') {\n if (hunkSpecs != null) {\n context.pushToGutter(\n type,\n createSeparator({\n type: 'metadata',\n content: hunkSpecs,\n isFirstHunk,\n isLastHunk,\n })\n );\n linesAST.push(\n createSeparator({\n type: 'metadata',\n content: hunkSpecs,\n isFirstHunk,\n isLastHunk,\n })\n );\n if (type !== 'additions') {\n context.incrementRowCount(1);\n }\n }\n return;\n }\n if (context.hunkSeparators === 'simple') {\n if (hunkIndex > 0) {\n context.pushToGutter(\n type,\n createSeparator({ type: 'simple', isFirstHunk, isLastHunk: false })\n );\n linesAST.push(\n createSeparator({ type: 'simple', isFirstHunk, isLastHunk: false })\n );\n if (type !== 'additions') {\n context.incrementRowCount(1);\n }\n }\n return;\n }\n const slotName = getHunkSeparatorSlotName(type, hunkIndex);\n const chunked = rangeSize > context.expansionLineCount;\n const expandIndex = isExpandable ? hunkIndex : undefined;\n const content =\n typeof collapsedLines === 'number'\n ? getModifiedLinesString(collapsedLines)\n : 'More unchanged context may be available';\n context.pushToGutter(\n type,\n createSeparator({\n type: context.hunkSeparators,\n content,\n expandIndex,\n chunked,\n slotName,\n isFirstHunk,\n isLastHunk,\n })\n );\n linesAST.push(\n createSeparator({\n type: context.hunkSeparators,\n content,\n expandIndex,\n chunked,\n slotName,\n isFirstHunk,\n isLastHunk,\n })\n );\n if (type !== 'additions') {\n context.incrementRowCount(1);\n }\n context.hunkData.push({\n slotName,\n hunkIndex,\n lines: typeof collapsedLines === 'number' ? collapsedLines : 0,\n lineCountKnown: typeof collapsedLines === 'number',\n type,\n expandable: isExpandable\n ? { up: !isFirstHunk, down: !isLastHunk, chunked }\n : undefined,\n });\n}\n\nfunction withContentProperties(\n lineNode: ElementContent | undefined,\n contentProperties?: Properties,\n extendProperties?: Properties\n): ElementContent | undefined {\n if (\n lineNode == null ||\n lineNode.type !== 'element' ||\n (contentProperties == null && extendProperties == null)\n ) {\n return lineNode;\n }\n return {\n ...lineNode,\n properties: {\n ...lineNode.properties,\n ...contentProperties,\n ...extendProperties,\n },\n };\n}\n\n// Number of entries in a split-line array that hold document content. A\n// document ending in a line break is represented two ways during a session:\n// the parsed-diff shape (`splitFileContents`) has no entry for the empty line\n// that final break implies, while the editor-document shape\n// (`getEditorDocumentLines`) exposes it as a trailing `''` entry. Only that\n// representational tail is ever `''` — every other entry keeps its line break\n// or is the raw final line — so trimming it yields comparable content lines.\nfunction contentLineCount(lines: string[]): number {\n return lines.length > 0 && lines[lines.length - 1] === ''\n ? lines.length - 1\n : lines.length;\n}\n\n// Realigns the cached per-line addition HAST array with an edited document.\n// Cached entries are looked up by line index, so a line inserted or removed\n// mid-document must shift the surviving entries to their new indexes —\n// otherwise rows hidden during the edit (collapsed context) render another\n// line's stale tokens once they become visible. Entries outside the changed\n// window keep their highlighted content; entries inside it become plain-text\n// elements that the editor re-tokenizes on its next background pass.\n//\n// The bottom-up scan runs over content lines only: a session's first\n// line-count edit still has `previousLines` in the parsed-diff shape while\n// `nextLines` is editor-shaped, and comparing the raw tails would mismatch on\n// the representational trailing `''`, zero out the suffix, and plain-fill\n// every line below the tokenizer's render window.\nfunction realignAdditionHastLines(\n previousLines: string[],\n nextLines: string[],\n hastLines: ElementContent[],\n textDocument: DiffsTextDocument\n): ElementContent[] {\n const previousContentLength = contentLineCount(previousLines);\n const nextContentLength = contentLineCount(nextLines);\n const maxShared = Math.min(previousContentLength, nextContentLength);\n let prefix = 0;\n while (prefix < maxShared && previousLines[prefix] === nextLines[prefix]) {\n prefix++;\n }\n let suffix = 0;\n while (\n suffix < maxShared - prefix &&\n previousLines[previousContentLength - 1 - suffix] ===\n nextLines[nextContentLength - 1 - suffix]\n ) {\n suffix++;\n }\n\n const realigned: ElementContent[] = new Array(nextLines.length);\n for (let index = 0; index < prefix; index++) {\n realigned[index] = hastLines[index];\n }\n for (let offset = 0; offset < suffix; offset++) {\n realigned[nextContentLength - 1 - offset] =\n hastLines[previousContentLength - 1 - offset];\n }\n // A trailing empty entry present on both sides keeps its cached row.\n if (\n previousContentLength < previousLines.length &&\n nextContentLength < nextLines.length\n ) {\n realigned[nextLines.length - 1] = hastLines[previousLines.length - 1];\n }\n // Deferred tokenization can write entries past the previous line count;\n // those were produced with post-edit indexes and are already in place.\n for (let index = previousLines.length; index < nextLines.length; index++) {\n realigned[index] ??= hastLines[index];\n }\n for (let index = prefix; index < nextLines.length; index++) {\n realigned[index] ??= createPlainAdditionLineElement(\n index,\n textDocument.getLineText(index)\n );\n }\n return realigned;\n}\n\nfunction createPlainAdditionLineElement(\n lineIndex: number,\n lineText: string,\n unifiedLineIndex = lineIndex,\n splitLineIndex = lineIndex\n): HASTElement {\n return {\n type: 'element',\n tagName: 'div',\n properties: {\n 'data-line': lineIndex + 1,\n 'data-line-index': `${unifiedLineIndex},${splitLineIndex}`,\n 'data-line-type': 'context',\n },\n children: [\n {\n type: 'element',\n tagName: 'span',\n properties: {\n 'data-char': 0,\n },\n children: [\n {\n type: 'text',\n value: lineText,\n },\n ],\n },\n ],\n };\n}\n\nfunction getEditorDocumentLines(\n textDocument: DiffsTextDocument,\n previousLines: string[]\n): string[] {\n const lines: string[] = [];\n const fallbackLineBreak = getFallbackLineBreak(previousLines);\n for (let line = 0; line < textDocument.lineCount; line++) {\n const lineText = textDocument.getLineText(line, true);\n lines.push(\n line < textDocument.lineCount - 1 && !hasLineBreakSuffix(lineText)\n ? lineText + fallbackLineBreak\n : lineText\n );\n }\n return lines;\n}\n\nfunction hasLineBreakSuffix(line: string): boolean {\n return line.endsWith('\\n') || line.endsWith('\\r');\n}\n\nfunction getFallbackLineBreak(lines: string[]): string {\n for (const line of lines) {\n if (line.endsWith('\\r\\n')) {\n return '\\r\\n';\n }\n if (line.endsWith('\\n')) {\n return '\\n';\n }\n if (line.endsWith('\\r')) {\n return '\\r';\n }\n }\n return '\\n';\n}\n\nfunction isDiffMassive(\n diff: FileDiffMetadata,\n tokenizeMaxLength: number\n): boolean {\n return (\n Math.max(diff.additionLines.length, diff.deletionLines.length) >\n tokenizeMaxLength\n );\n}\n\nfunction canHydrateCollapsedContext(\n fileDiff: FileDiffMetadata,\n hasFileLoader: boolean\n): boolean {\n return (\n fileDiff.isPartial &&\n hasFileLoader &&\n (fileDiff.type === 'change' || fileDiff.type === 'rename-changed')\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+NA,IAAI,aAAa;AAEjB,IAAa,oBAAb,MAAwD;CAuB7C;CACC;CACA;CAxBV,OAAwB,uBAAuB,EAAE;CAEjD;CACA;CAEA,gCAAwB,IAAI,IAAiC;CAE7D,sBAA8D,CAAC;CAC/D,sBAA8D,CAAC;CAE/D,eAA2C;CAC3C;CAQA,oBAA4B;CAE5B,YACE,UAA2C,EAAE,OAAO,eAAe,GACnE,gBACA,eACA;EAHO,KAAA,UAAA;EACC,KAAA,iBAAA;EACA,KAAA,gBAAA;EAER,IAAI,eAAe,cAAc,MAAM,MACrC,KAAK,cAAc,kBAAkB,QAAQ,SAAS,cAAc,IAChE,uBAAuB,IACvB,KA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BAAiB,GAAG;GAC1C,kBAAkB;EACpB;EACA,UAAU,CACR;GACE,MAAM;GACN,SAAS;GACT,YAAY,EACV,aAAa,EACf;GACA,UAAU,CACR;IACE,MAAM;IACN,OAAO;GACT,CACF;EACF,CACF;CACF;AACF;AAEA,SAAS,uBACP,cACA,eACU;CACV,MAAM,QAAkB,CAAC;CACzB,MAAM,oBAAoB,qBAAqB,aAAa;CAC5D,KAAK,IAAI,OAAO,GAAG,OAAO,aAAa,WAAW,QAAQ;EACxD,MAAM,WAAW,aAAa,YAAY,MAAM,IAAI;EACpD,MAAM,KACJ,OAAO,aAAa,YAAY,KAAK,CAAC,mBAAmB,QAAQ,IAC7D,WAAW,oBACX,QACN;CACF;CACA,OAAO;AACT;AAEA,SAAS,mBAAmB,MAAuB;CACjD,OAAO,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI;AAClD;AAEA,SAAS,qBAAqB,OAAyB;CACrD,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,KAAK,SAAS,MAAM,GACtB,OAAO;EAET,IAAI,KAAK,SAAS,IAAI,GACpB,OAAO;EAET,IAAI,KAAK,SAAS,IAAI,GACpB,OAAO;CAEX;CACA,OAAO;AACT;AAEA,SAAS,cACP,MACA,mBACS;CACT,OACE,KAAK,IAAI,KAAK,cAAc,QAAQ,KAAK,cAAc,MAAM,IAC7D;AAEJ;AAEA,SAAS,2BACP,UACA,eACS;CACT,OACE,SAAS,aACT,kBACC,SAAS,SAAS,YAAY,SAAS,SAAS;AAErD"}
1
+ {"version":3,"file":"DiffHunksRenderer.js","names":["createDefaultAnnotationElement"],"sources":["../../src/renderers/DiffHunksRenderer.ts"],"sourcesContent":["import type { ElementContent, Element as HASTElement, Properties } from 'hast';\nimport { toHtml } from 'hast-util-to-html';\n\nimport {\n DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,\n DEFAULT_EXPANDED_REGION,\n DEFAULT_RENDER_RANGE,\n DEFAULT_THEMES,\n DEFAULT_TOKENIZE_MAX_LENGTH,\n} from '../constants';\nimport type { TextDocument } from '../editor/textDocument';\nimport { areLanguagesAttached } from '../highlighter/languages/areLanguagesAttached';\nimport {\n getHighlighterIfLoaded,\n getSharedHighlighter,\n} from '../highlighter/shared_highlighter';\nimport { areThemesAttached } from '../highlighter/themes/areThemesAttached';\nimport type {\n AnnotationLineMap,\n AnnotationSpan,\n BaseCodeOptions,\n BaseDiffOptions,\n BaseDiffOptionsWithDefaults,\n CodeColumnType,\n CustomPreProperties,\n DiffLineAnnotation,\n DiffsHighlighter,\n ExpansionDirections,\n FileDiffMetadata,\n FileHeaderRenderMode,\n HighlightedToken,\n HunkData,\n HunkExpansionRegion,\n HunkSeparators,\n LineTypes,\n RenderDiffOptions,\n RenderDiffResult,\n RenderedDiffASTCache,\n RenderRange,\n SupportedLanguages,\n ThemedDiffResult,\n} from '../types';\nimport { applyLineTextWithNewline } from '../utils/applyLineTextWithNewline';\nimport { areDiffRenderOptionsEqual } from '../utils/areDiffRenderOptionsEqual';\nimport { areDiffTargetsEqual } from '../utils/areDiffTargetsEqual';\nimport { areRenderRangesEqual } from '../utils/areRenderRangesEqual';\nimport { cleanLastNewline } from '../utils/cleanLastNewline';\nimport { createAnnotationElement as createDefaultAnnotationElement } from '../utils/createAnnotationElement';\nimport { createContentColumn } from '../utils/createContentColumn';\nimport { createEmptyRowBuffer } from '../utils/createEmptyRowBuffer';\nimport { createFileHeaderElement } from '../utils/createFileHeaderElement';\nimport { createNoNewlineElement } from '../utils/createNoNewlineElement';\nimport { createPreElement } from '../utils/createPreElement';\nimport { createSeparator } from '../utils/createSeparator';\nimport {\n applySessionChangedLines,\n rebuildSessionHunks,\n remapExpandedHunksForRegionChange,\n type SessionRegionChange,\n} from '../utils/editSessionHunks';\nimport { getFiletypeFromFileName } from '../utils/getFiletypeFromFileName';\nimport { getHighlighterOptions } from '../utils/getHighlighterOptions';\nimport { getHunkSeparatorSlotName } from '../utils/getHunkSeparatorSlotName';\nimport { getLineAnnotationName } from '../utils/getLineAnnotationName';\nimport { getTotalLineCountFromHunks } from '../utils/getTotalLineCountFromHunks';\nimport {\n createGutterGap,\n createGutterItem,\n createGutterWrapper,\n createHastElement,\n} from '../utils/hast_utils';\nimport {\n FILE_ANNOTATION_HUNK_INDEX,\n FILE_ANNOTATION_LINE_INDEX,\n getFileAnnotations,\n shouldRenderFileAnnotations,\n} from '../utils/includesFileAnnotations';\nimport { isDefaultRenderRange } from '../utils/isDefaultRenderRange';\nimport { isDiffPlainText } from '../utils/isDiffPlainText';\nimport type { DiffLineMetadata } from '../utils/iterateOverDiff';\nimport { iterateOverDiff } from '../utils/iterateOverDiff';\nimport { renderDiffWithHighlighter } from '../utils/renderDiffWithHighlighter';\nimport {\n recomputeDiffHunksForEdit,\n recomputeEmptyDocumentDiff,\n recomputeTopAlignedAdditionDiff,\n shouldTopAlignAdditionRecompute,\n updateDiffHunks,\n} from '../utils/updateDiffHunks';\nimport { getTrailingContextRangeSize } from '../utils/virtualDiffLayout';\nimport type { WorkerPoolManager } from '../worker';\n\ninterface PushLineWithAnnotation {\n diffStyle: 'unified' | 'split';\n type: 'context' | 'context-expanded' | 'change';\n\n deletionLine?: ElementContent;\n additionLine?: ElementContent;\n\n unifiedSpan?: AnnotationSpan;\n deletionSpan?: AnnotationSpan;\n additionSpan?: AnnotationSpan;\n\n createAnnotationElement(span: AnnotationSpan): HASTElement;\n context: ProcessContext;\n}\n\ninterface GetRenderOptionsReturn {\n options: RenderDiffOptions;\n forceHighlight: boolean;\n}\n\ninterface PendingHighlightResult extends RenderDiffResult {\n diff: FileDiffMetadata;\n highlighted: boolean;\n}\n\ninterface DiffRenderCache extends RenderedDiffASTCache {\n // hydrate() describes DOM that already exists, even when no reusable AST\n // was available for that server-rendered content.\n hydrated?: boolean;\n}\n\ninterface PushSeparatorProps {\n hunkIndex: number;\n collapsedLines: number | 'unknown';\n rangeSize: number;\n hunkSpecs: string | undefined;\n isFirstHunk: boolean;\n isLastHunk: boolean;\n isExpandable: boolean;\n}\n\ninterface ProcessContext {\n rowCount: number;\n expansionLineCount: number;\n hunkSeparators: HunkSeparators;\n unifiedContentAST: ElementContent[];\n deletionsContentAST: ElementContent[];\n additionsContentAST: ElementContent[];\n unifiedGutterAST: HASTElement;\n deletionsGutterAST: HASTElement;\n additionsGutterAST: HASTElement;\n hunkData: HunkData[];\n pushToGutter(type: CodeColumnType, element: HASTElement): void;\n incrementRowCount(count?: number): void;\n}\n\nexport interface DiffHunksRendererOptions extends BaseDiffOptions {\n headerRenderMode?: FileHeaderRenderMode;\n}\n\nexport interface DiffHunksRendererOptionsWithDefaults extends Omit<\n BaseDiffOptionsWithDefaults,\n 'themeType'\n> {\n headerRenderMode: FileHeaderRenderMode;\n}\n\nexport interface UnifiedLineDecorationProps {\n type: 'context' | 'context-expanded' | 'change';\n lineType: LineTypes;\n additionLineIndex: number | undefined;\n deletionLineIndex: number | undefined;\n}\n\nexport interface SplitLineDecorationProps {\n side: 'deletions' | 'additions';\n type: 'context' | 'context-expanded' | 'change';\n lineIndex: number | undefined;\n}\n\nexport interface LineDecoration {\n gutterLineType: LineTypes;\n gutterProperties?: Properties;\n contentProperties?: Properties;\n}\n\ninterface PendingSplitContext {\n size: number;\n side: 'additions' | 'deletions' | undefined;\n increment(): void;\n flush(): void;\n}\n\nexport interface RenderedLineContext {\n type: 'context' | 'context-expanded' | 'change';\n hunkIndex: number;\n lineIndex: number;\n unifiedLineIndex: number;\n splitLineIndex: number;\n deletionLine?: DiffLineMetadata;\n additionLine?: DiffLineMetadata;\n}\n\nexport interface InjectedRow {\n content: HASTElement;\n gutter: HASTElement;\n}\n\nexport interface SplitInjectedRow {\n deletion: InjectedRow | undefined;\n addition: InjectedRow | undefined;\n}\n\nexport interface UnifiedInjectedRowPlacement {\n before?: InjectedRow[];\n after?: InjectedRow[];\n}\n\nexport interface SplitInjectedRowPlacement {\n before?: SplitInjectedRow[];\n after?: SplitInjectedRow[];\n}\n\nexport interface HunksRenderResult {\n fileDiff: FileDiffMetadata;\n unifiedGutterAST: ElementContent[] | undefined;\n unifiedContentAST: ElementContent[] | undefined;\n deletionsGutterAST: ElementContent[] | undefined;\n deletionsContentAST: ElementContent[] | undefined;\n additionsGutterAST: ElementContent[] | undefined;\n additionsContentAST: ElementContent[] | undefined;\n hunkData: HunkData[];\n css: string;\n preNode: HASTElement;\n headerElement: HASTElement | undefined;\n totalLines: number;\n themeStyles: string;\n baseThemeType: 'light' | 'dark' | undefined;\n rowCount: number;\n bufferBefore: number;\n bufferAfter: number;\n}\n\nlet instanceId = -1;\n\nexport class DiffHunksRenderer<LAnnotation = undefined> {\n readonly __id: string = `diff-hunks-renderer:${++instanceId}`;\n\n private highlighter: DiffsHighlighter | undefined;\n // The latest diff requested by the component. The render cache may\n // intentionally keep displaying an older highlighted diff while this one\n // is highlighted in the background.\n private diff: FileDiffMetadata | undefined;\n\n private expandedHunks = new Map<number, HunkExpansionRegion>();\n\n private deletionAnnotations: AnnotationLineMap<LAnnotation> = {};\n private additionAnnotations: AnnotationLineMap<LAnnotation> = {};\n\n private computedLangs: SupportedLanguages[] = ['text'];\n private renderCache: DiffRenderCache | undefined;\n // Completed background work waits here until the next render can update its\n // DOM and layout together.\n private pendingHighlightResult: PendingHighlightResult | undefined;\n // Newly highlighted rows from a line-count edit wait here until the old row\n // cache has been shifted to match the document's new line indexes.\n private pendingStructuralRows: Map<number, HASTElement> | undefined;\n\n // Edit-session state: while active, hunk updates go through the frozen\n // region skeleton (editSessionHunks) instead of the full recompute, and\n // rendering stays on the main thread with editor-compatible token markup —\n // the editor's caret/selection mapping needs the token transformer, and\n // the pool's global options are not guaranteed to produce it. The pool\n // keeps serving every surface without a session.\n private editSessionActive = false;\n\n constructor(\n public options: DiffHunksRendererOptions = { theme: DEFAULT_THEMES },\n private annotationSlotName: (\n annotation: DiffLineAnnotation<LAnnotation>\n ) => string = getLineAnnotationName,\n private onRenderUpdate?: () => unknown,\n private workerManager?: WorkerPoolManager | undefined\n ) {\n if (workerManager?.isWorkingPool() !== true) {\n this.highlighter = areThemesAttached(options.theme ?? DEFAULT_THEMES)\n ? getHighlighterIfLoaded()\n : undefined;\n }\n }\n\n public cleanUp(): void {\n this.recycle();\n this.expandedHunks.clear();\n this.workerManager = undefined;\n this.onRenderUpdate = undefined;\n }\n\n public recycle(): void {\n this.highlighter = undefined;\n this.diff = undefined;\n this.clearRenderCache();\n this.additionAnnotations = {};\n this.deletionAnnotations = {};\n this.workerManager?.cleanUpTasks(this);\n this.endEditSession();\n }\n\n /**\n * Enter edit-session mode: hunk updates preserve the current region\n * skeleton instead of recomputing hunks, and rendering happens locally\n * with the token transformer forced on (worker-pool requests/results are\n * suspended for this renderer). When the session was freshly cloned from\n * `externalDiff`, compatible highlighted markup is detached from its external\n * cache owner so the editor can reuse it without mutating shared data. An\n * empty additions document gets one row for the editor's caret.\n */\n public beginEditSession(\n diff: FileDiffMetadata,\n externalDiff?: FileDiffMetadata\n ): void {\n const { editSessionActive: wasAlreadyActive, renderCache } = this;\n this.editSessionActive = true;\n if (!wasAlreadyActive) {\n this.pendingHighlightResult = undefined;\n }\n this.diff = diff;\n\n if (!diff.isPartial && diff.additionLines.length === 0) {\n Object.assign(\n diff,\n recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions)\n );\n this.markEditSessionPass(diff);\n this.clearRenderCache();\n return;\n }\n\n if (renderCache == null) {\n return;\n }\n // Edit updates call this again before each write. That cache is already\n // private and must retain plain-text session results.\n if (wasAlreadyActive && renderCache.diff === diff) {\n return;\n }\n const { options } = this.getRenderOptions(diff);\n const cacheBelongsToSession = renderCache.diff === diff;\n const cacheBelongsToExternal =\n externalDiff != null &&\n areDiffTargetsEqual(renderCache.diff, externalDiff);\n const { result } = renderCache;\n if (\n !renderCache.highlighted ||\n result == null ||\n !areDiffRenderOptionsEqual(renderCache.options, options) ||\n (!cacheBelongsToSession && !cacheBelongsToExternal)\n ) {\n this.clearRenderCache();\n return;\n }\n if (cacheBelongsToSession) {\n return;\n }\n\n // Edit paths replace addition entries and their containing array,\n // but only read the existing HAST nodes and deletion entries.\n this.renderCache = {\n diff,\n options,\n highlighted: true,\n result: {\n ...result,\n code: {\n ...result.code,\n additionLines: [...result.code.additionLines],\n },\n },\n renderRange: renderCache.renderRange,\n };\n }\n\n /** Leave edit-session mode. The exit recompute is the host's concern. */\n public endEditSession(): void {\n this.editSessionActive = false;\n this.pendingHighlightResult = undefined;\n }\n\n /**\n * Ensures that the DOM is compatible with editor render updates\n */\n public editorRenderReady(): boolean {\n return (\n this.renderCache?.options.useTokenTransformer === true &&\n this.renderCache.highlighted &&\n this.renderCache.result != null\n );\n }\n\n /**\n * Re-highlights the current diff in the background and stages the fresh\n * result for the next render. Needed after an edit session's exit recompute:\n * session passes plain-fill shifted lines in the cached result, and the\n * recompute mutates the keyless session diff in place, so object identity\n * alone would otherwise treat the stale highlight as current forever. The\n * current result — content-correct, mostly highlighted — keeps rendering\n * until the fresh one is promoted, so no interim paint drops highlighting.\n */\n public refreshHighlightedResult(): Promise<void> {\n const { diff, renderCache, workerManager } = this;\n if (\n diff == null ||\n renderCache == null ||\n !areDiffTargetsEqual(renderCache.diff, diff) ||\n isDiffPlainText(diff) ||\n isDiffMassive(diff, this.getTokenizeMaxLength())\n ) {\n return Promise.resolve();\n }\n // The pool's diff cache is keyed by cacheKey, so a worker refresh needs\n // one; a keyless diff uses the local highlighter fallback below instead.\n if (\n !this.editSessionActive &&\n workerManager?.isWorkingPool() === true &&\n diff.cacheKey != null\n ) {\n workerManager.evictDiffFromCache(diff.cacheKey);\n return workerManager\n .primeDiffHighlightCache(diff)\n .then(() => {\n this.applyRefreshedResult(\n diff,\n workerManager.getDiffResultCache(diff)\n );\n })\n .catch((error: unknown) => this.onHighlightError(error));\n }\n return this.asyncHighlight(diff)\n .then((fresh) => this.applyRefreshedResult(diff, fresh))\n .catch((error: unknown) => this.onHighlightError(error));\n }\n\n // Holds a freshly highlighted result for the next render transaction, unless\n // the renderer moved on while the highlight ran (new diff, options change,\n // or a new edit session whose passes the fresh result wouldn't reflect).\n private applyRefreshedResult(\n diff: FileDiffMetadata,\n fresh: RenderDiffResult | undefined\n ): void {\n const { diff: currentDiff, renderCache } = this;\n if (\n fresh == null ||\n currentDiff == null ||\n renderCache == null ||\n !areDiffTargetsEqual(currentDiff, diff) ||\n !areDiffTargetsEqual(renderCache.diff, diff) ||\n this.editSessionActive\n ) {\n return;\n }\n const { options } = this.getRenderOptions(currentDiff);\n if (!areDiffRenderOptionsEqual(options, fresh.options)) {\n return;\n }\n this.pendingHighlightResult = {\n diff: currentDiff,\n options: fresh.options,\n highlighted: true,\n result: fresh.result,\n };\n this.onRenderUpdate?.();\n }\n\n public get diffCache(): FileDiffMetadata | undefined {\n return this.renderCache?.diff ?? this.diff;\n }\n\n public clearRenderCache(): void {\n this.renderCache = undefined;\n this.pendingHighlightResult = undefined;\n this.pendingStructuralRows = undefined;\n }\n\n public setOptions(options: DiffHunksRendererOptions): void {\n this.options = options;\n }\n\n public mergeOptions(options: Partial<DiffHunksRendererOptions>): void {\n this.options = { ...this.options, ...options };\n }\n\n public expandHunk(\n index: number,\n direction: ExpansionDirections,\n expansionLineCount: number = this.getOptionsWithDefaults()\n .expansionLineCount\n ): void {\n const region = {\n ...(this.expandedHunks.get(index) ?? {\n fromStart: 0,\n fromEnd: 0,\n }),\n };\n if (direction === 'up' || direction === 'both') {\n region.fromStart += expansionLineCount;\n }\n if (direction === 'down' || direction === 'both') {\n region.fromEnd += expansionLineCount;\n }\n // NOTE(amadeus): If our render cache is not highlighted, we need to clear\n // it, otherwise we won't have the correct AST lines. Clearing is safe\n // mid-edit-session even though the dirty cache carries live edits: both\n // session hunk-update paths keep diff.additionLines current every pass,\n // so the rebuilt AST reproduces the live document.\n if (this.renderCache?.highlighted !== true) {\n this.clearRenderCache();\n }\n this.expandedHunks.set(index, region);\n }\n\n public getExpandedHunk(hunkIndex: number): HunkExpansionRegion {\n return this.expandedHunks.get(hunkIndex) ?? DEFAULT_EXPANDED_REGION;\n }\n\n public getExpandedHunksMap(): Map<number, HunkExpansionRegion> {\n return this.expandedHunks;\n }\n\n /** Replace the whole expansion map (session-exit expansion remapping). */\n public setExpandedHunksMap(\n expandedHunks: Map<number, HunkExpansionRegion>\n ): void {\n this.expandedHunks = expandedHunks;\n }\n\n public setLineAnnotations(\n lineAnnotations: DiffLineAnnotation<LAnnotation>[]\n ): void {\n this.additionAnnotations = {};\n this.deletionAnnotations = {};\n for (const annotation of lineAnnotations) {\n const map = ((): AnnotationLineMap<LAnnotation> => {\n switch (annotation.side) {\n case 'deletions':\n return this.deletionAnnotations;\n case 'additions':\n return this.additionAnnotations;\n }\n })();\n const arr = map[annotation.lineNumber] ?? [];\n map[annotation.lineNumber] = arr;\n arr.push(annotation);\n }\n }\n\n /**\n * Returns true when a session-mode pass changed the region skeleton itself\n * (a gap edit synthesized or merged regions), which changes the rendered\n * row set without a line-count change — the host must escalate to a full\n * re-render instead of its cheap refresh path.\n */\n public updateRenderCache(\n dirtyLines: Map<number, Array<HighlightedToken>>,\n themeType: 'dark' | 'light',\n lineCountChangeInFlight = false\n ): boolean {\n this.pendingStructuralRows = undefined;\n const { renderCache } = this;\n if (renderCache == null) {\n return false;\n }\n const { result, diff } = renderCache;\n if (result == null) {\n return false;\n }\n if (diff.isPartial) {\n throw new Error('Could not update render cache for partial diff');\n }\n\n const hastLines = result.code.additionLines;\n const pendingStructuralRows = (this.pendingStructuralRows =\n lineCountChangeInFlight ? new Map<number, HASTElement>() : undefined);\n // Structural rows use post-edit indexes while the current diff and HAST\n // still use pre-edit indexes. Hold those rows until applyDocumentChange\n // has shifted the old data into its authoritative positions.\n const changedAdditionLines: number[] = [];\n const previousAdditionLines = new Map<number, string>();\n for (const [line, tokens] of dirtyLines) {\n const prev = hastLines[line] as HASTElement | undefined;\n const prevProps = prev?.properties ?? {};\n const lineText = tokens.map((a) => a[2]).join('');\n const canSyncDiffLine = line < diff.additionLines.length;\n const prevLine = canSyncDiffLine ? (diff.additionLines[line] ?? '') : '';\n const prevText = cleanLastNewline(prevLine);\n // The host text document can expose one extra trailing empty line when\n // the file ends with a newline. Deferred tokenization must not grow\n // additionLines from that mismatch or hunk trailing context desyncs.\n if (pendingStructuralRows == null && canSyncDiffLine) {\n diff.additionLines[line] = applyLineTextWithNewline(prevLine, lineText);\n if (prevText !== lineText) {\n changedAdditionLines.push(line);\n previousAdditionLines.set(line, prevLine);\n }\n }\n const row: HASTElement = {\n type: 'element',\n tagName: 'div',\n properties: {\n 'data-line': prevProps['data-line'] ?? line + 1,\n 'data-line-index': prevProps['data-line-index'] ?? line,\n 'data-line-type': prevProps['data-line-type'] ?? 'context',\n },\n children: tokens.map(([char, fg, text]) => {\n if (char === 0 && fg === '') {\n if (text === '') {\n return {\n type: 'element',\n tagName: 'br',\n properties: {},\n children: [],\n };\n }\n return { type: 'text', value: text };\n }\n return {\n type: 'element',\n tagName: 'span',\n properties: {\n 'data-char': char,\n style: `color:${fg};`,\n },\n children: [{ type: 'text', value: text }],\n };\n }),\n };\n if (pendingStructuralRows != null) {\n pendingStructuralRows.set(line, row);\n } else {\n hastLines[line] = row;\n }\n }\n\n let regionsChanged = false;\n if (changedAdditionLines.length > 0) {\n if (this.editSessionActive) {\n if (\n diff.additionLines.length <= 1 &&\n diff.additionLines.join('') === ''\n ) {\n this.applyRecomputePreservingSessionType(\n diff,\n recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions)\n );\n regionsChanged = true;\n } else if (shouldTopAlignAdditionRecompute(diff, diff.additionLines)) {\n this.applyRecomputePreservingSessionType(\n diff,\n recomputeTopAlignedAdditionDiff(\n diff,\n diff.additionLines,\n this.options.parseDiffOptions\n )\n );\n regionsChanged = true;\n } else {\n const change = applySessionChangedLines(\n diff,\n changedAdditionLines,\n this.options.parseDiffOptions,\n previousAdditionLines\n );\n this.applyExpansionRemap(change);\n regionsChanged = change != null;\n }\n } else {\n Object.assign(\n diff,\n updateDiffHunks(\n diff,\n changedAdditionLines,\n this.options.parseDiffOptions\n )\n );\n }\n }\n\n result.baseThemeType = themeType;\n renderCache.isDirty = true;\n return regionsChanged;\n }\n\n private applyExpansionRemap(change: SessionRegionChange | undefined): void {\n if (change != null) {\n this.expandedHunks = remapExpandedHunksForRegionChange(\n this.expandedHunks,\n change\n );\n }\n }\n\n // Normally triggered by the host when the document line count changes.\n public applyDocumentChange(\n textDocument: TextDocument<'file-diff', LAnnotation>\n ): void {\n const { pendingStructuralRows, renderCache } = this;\n this.pendingStructuralRows = undefined;\n if (renderCache == null) {\n return;\n }\n const { diff, result } = renderCache;\n if (result == null) {\n return;\n }\n if (diff.isPartial) {\n throw new Error('Could not apply document change for partial diff');\n }\n\n // The structural token pass leaves the diff in its pre-edit shape so this\n // document remains the single source of truth for shifting its lines.\n // Reading line-by-line also preserves blank documents and the final\n // editable empty row after a trailing line break.\n const { additionLines: previousAdditionLines } = diff;\n diff.additionLines = getEditorDocumentLines(textDocument);\n result.code.additionLines = realignAdditionHastLines(\n previousAdditionLines,\n diff.additionLines,\n result.code.additionLines,\n textDocument\n );\n // An empty document splits into zero addition lines, which would recompute\n // to a diff with no editable rows and leave the attached host with no\n // line element for its caret (the additions column vanishes in split;\n // unified shows only deletions). Keep one empty editable line instead.\n if (diff.additionLines.length <= 1 && diff.additionLines.join('') === '') {\n this.applyRecomputePreservingSessionType(\n diff,\n recomputeEmptyDocumentDiff(diff, this.options.parseDiffOptions)\n );\n result.code.additionLines[0] = createPlainAdditionLineElement(\n 0,\n textDocument.getLineText(0)\n );\n } else if (this.editSessionActive) {\n this.applySessionDocumentChange(diff);\n } else {\n Object.assign(\n diff,\n recomputeDiffHunksForEdit(diff, this.options.parseDiffOptions)\n );\n }\n\n if (pendingStructuralRows != null) {\n for (const [line, row] of pendingStructuralRows) {\n if (line < result.code.additionLines.length) {\n result.code.additionLines[line] = row;\n }\n }\n }\n\n renderCache.isDirty = true;\n }\n\n // Session-mode counterpart of the line-count recompute: derive canonical\n // old/current pairing and rebuild the old-side region skeleton from it.\n private applySessionDocumentChange(diff: FileDiffMetadata): void {\n const { parseDiffOptions } = this.options;\n const rawLines = diff.additionLines;\n if (shouldTopAlignAdditionRecompute(diff, rawLines)) {\n this.applyRecomputePreservingSessionType(\n diff,\n recomputeTopAlignedAdditionDiff(diff, rawLines, parseDiffOptions)\n );\n return;\n }\n this.applyExpansionRemap(rebuildSessionHunks(diff, parseDiffOptions));\n }\n\n // Empty-document and top-aligned recomputes rebuild the complete diff. While\n // editing, keep the session's original classification until finalization.\n private applyRecomputePreservingSessionType(\n diff: FileDiffMetadata,\n update: ReturnType<typeof recomputeEmptyDocumentDiff>\n ): void {\n const sessionType = this.editSessionActive ? diff.type : undefined;\n Object.assign(diff, update);\n if (sessionType != null) {\n diff.type = sessionType;\n }\n this.markEditSessionPass(diff);\n }\n\n // Records a session pass that replaced hunks wholesale.\n private markEditSessionPass(diff: FileDiffMetadata): void {\n if (!this.editSessionActive) {\n return;\n }\n diff.editSessionDirty = true;\n }\n\n protected getUnifiedLineDecoration({\n lineType,\n }: UnifiedLineDecorationProps): LineDecoration {\n return {\n gutterLineType: lineType,\n contentProperties: {\n 'data-line-type': lineType,\n },\n };\n }\n\n protected getSplitLineDecoration({\n side,\n type,\n }: SplitLineDecorationProps): LineDecoration {\n const lineType: LineTypes =\n type === 'change'\n ? side === 'deletions'\n ? 'change-deletion'\n : 'change-addition'\n : type;\n return {\n gutterLineType: lineType,\n contentProperties: {\n 'data-line-type': lineType,\n },\n };\n }\n\n private createAnnotationElement = (span: AnnotationSpan): HASTElement => {\n return createDefaultAnnotationElement(span);\n };\n\n // Unified hook returns extra rows that render before/after the current line.\n declare protected getUnifiedInjectedRowsForLine?: (\n ctx: RenderedLineContext\n ) => UnifiedInjectedRowPlacement | undefined;\n\n // Split hook returns extra rows per side before/after the current line.\n declare protected getSplitInjectedRowsForLine?: (\n ctx: RenderedLineContext\n ) => SplitInjectedRowPlacement | undefined;\n\n protected getOptionsWithDefaults(): DiffHunksRendererOptionsWithDefaults {\n const {\n diffIndicators = 'bars',\n diffStyle = 'split',\n disableBackground = false,\n disableFileHeader = false,\n disableLineNumbers = false,\n disableVirtualizationBuffers = false,\n collapsed = false,\n expandUnchanged = false,\n collapsedContextThreshold = DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,\n expansionLineCount = 100,\n hunkSeparators = 'line-info',\n lineDiffType = 'word-alt',\n maxLineDiffLength = 1000,\n overflow = 'scroll',\n stickyHeader = false,\n theme = DEFAULT_THEMES,\n headerRenderMode = 'default',\n tokenizeMaxLineLength = 1000,\n tokenizeMaxLength = DEFAULT_TOKENIZE_MAX_LENGTH,\n useTokenTransformer = false,\n useCSSClasses = false,\n } = this.options;\n return {\n diffIndicators,\n diffStyle,\n disableBackground,\n disableFileHeader,\n disableLineNumbers,\n disableVirtualizationBuffers,\n collapsed,\n expandUnchanged,\n collapsedContextThreshold,\n expansionLineCount,\n hunkSeparators,\n lineDiffType,\n maxLineDiffLength,\n overflow,\n stickyHeader,\n theme: this.workerManager?.getDiffRenderOptions().theme ?? theme,\n headerRenderMode,\n tokenizeMaxLineLength,\n tokenizeMaxLength,\n useTokenTransformer,\n useCSSClasses,\n };\n }\n\n public async initializeHighlighter(): Promise<DiffsHighlighter> {\n this.highlighter = await getSharedHighlighter(\n getHighlighterOptions(this.computedLangs, {\n theme: this.getLocalHighlightTheme(),\n preferredHighlighter:\n this.workerManager?.getPreferredHighlighter() ??\n this.options.preferredHighlighter,\n })\n );\n return this.highlighter;\n }\n\n public hydrate(diff: FileDiffMetadata | undefined): void {\n if (diff == null) {\n return;\n }\n this.diff = diff;\n const { options } = this.getRenderOptions(diff);\n const massiveDiff = isDiffMassive(diff, this.getTokenizeMaxLength());\n let cache = this.workerManager?.getDiffResultCache(diff);\n if (cache != null && !areDiffRenderOptionsEqual(options, cache.options)) {\n cache = undefined;\n }\n this.renderCache ??= {\n diff,\n hydrated: true,\n highlighted: !massiveDiff && !isDiffPlainText(diff),\n options,\n result: massiveDiff ? undefined : cache?.result,\n renderRange: undefined,\n };\n if (\n !this.editSessionActive &&\n this.workerManager?.isWorkingPool() === true\n ) {\n if (this.renderCache.result == null && !massiveDiff) {\n // We should only kick off a preload of the AST if we have a WorkerPool\n this.workerManager.highlightDiffAST(this, this.diff);\n }\n }\n // Lets attempt to get the highlighter/languages ready immediately\n else if (this.highlighter == null) {\n this.computedLangs = getDiffLanguages(diff);\n void this.initializeHighlighter();\n }\n }\n\n private getLocalHighlightTheme(): RenderDiffOptions['theme'] {\n return (\n this.workerManager?.getDiffRenderOptions().theme ??\n this.options.theme ??\n DEFAULT_THEMES\n );\n }\n\n public getEffectiveCodeOptions(): Pick<\n BaseCodeOptions,\n 'theme' | 'tokenizeMaxLineLength'\n > {\n const poolOptions =\n this.workerManager?.isWorkingPool() === true\n ? this.workerManager.getDiffRenderOptions()\n : undefined;\n return {\n theme: this.getLocalHighlightTheme(),\n tokenizeMaxLineLength:\n poolOptions?.tokenizeMaxLineLength ??\n this.options.tokenizeMaxLineLength,\n };\n }\n\n private getRenderOptions(diff: FileDiffMetadata): GetRenderOptionsReturn {\n const options: RenderDiffOptions = (() => {\n if (this.workerManager?.isWorkingPool() === true) {\n const poolOptions = this.workerManager.getDiffRenderOptions();\n // Active edit sessions require `useTokenTransformer: true`\n if (\n this.editSessionActive &&\n poolOptions.useTokenTransformer !== true\n ) {\n return { ...poolOptions, useTokenTransformer: true };\n }\n return poolOptions;\n }\n const { theme, tokenizeMaxLineLength, lineDiffType, maxLineDiffLength } =\n this.getOptionsWithDefaults();\n return {\n theme,\n useTokenTransformer:\n this.editSessionActive || this.options.useTokenTransformer === true,\n tokenizeMaxLineLength,\n lineDiffType,\n maxLineDiffLength,\n };\n })();\n this.getOptionsWithDefaults();\n const { renderCache } = this;\n if (renderCache?.result == null) {\n return { options, forceHighlight: true };\n }\n if (\n !areDiffTargetsEqual(diff, renderCache.diff) ||\n !areDiffRenderOptionsEqual(options, renderCache.options)\n ) {\n return { options, forceHighlight: true };\n }\n return { options, forceHighlight: false };\n }\n\n /**\n * Returns the diff that the next synchronous render can commit without\n * changing the renderer's current diff or render cache. Components use this\n * to prepare state that must match the following DOM render.\n */\n public getDiffForNextRender(diff: FileDiffMetadata): FileDiffMetadata {\n const { options } = this.getRenderOptions(diff);\n if (this.getReadyRenderResult(diff, options) != null) {\n return diff;\n }\n\n if (this.renderCache == null) {\n return diff;\n }\n if (areDiffTargetsEqual(this.renderCache.diff, diff)) {\n return this.renderCache.diff;\n }\n\n const hasContent =\n diff.additionLines.length > 0 || diff.deletionLines.length > 0;\n const forcePlainText =\n !hasContent ||\n isDiffPlainText(diff) ||\n isDiffMassive(diff, this.getTokenizeMaxLength());\n return this.canRenderDiff(diff, options, forcePlainText)\n ? diff\n : this.renderCache.diff;\n }\n\n private canRenderDiff(\n diff: FileDiffMetadata,\n options: RenderDiffOptions,\n forcePlainText: boolean\n ): boolean {\n const { renderCache } = this;\n if (renderCache == null || areDiffTargetsEqual(renderCache.diff, diff)) {\n return true;\n }\n if (forcePlainText) {\n return (\n (renderCache.result == null && renderCache.hydrated !== true) ||\n this.workerManager?.isWorkingPool() === true ||\n (this.highlighter != null && areThemesAttached(options.theme))\n );\n }\n // Hydration has highlighted DOM without a local AST. It is still active\n // rendered content and must remain visible while a non-plain replacement\n // is prepared.\n if (renderCache.result == null && renderCache.hydrated !== true) {\n return true;\n }\n\n if (\n !this.editSessionActive &&\n this.workerManager?.isWorkingPool() === true\n ) {\n return !renderCache.highlighted;\n }\n\n return this.highlighter != null && areThemesAttached(options.theme);\n }\n\n public renderDiff(\n diff: FileDiffMetadata | undefined = this.diff,\n renderRange: RenderRange = DEFAULT_RENDER_RANGE\n ): HunksRenderResult | undefined {\n this.diff = diff;\n if (diff == null) {\n this.pendingHighlightResult = undefined;\n return undefined;\n }\n const { expandUnchanged, collapsedContextThreshold } =\n this.getOptionsWithDefaults();\n let { options, forceHighlight } = this.getRenderOptions(diff);\n const readyResult = this.getReadyRenderResult(diff, options);\n this.pendingHighlightResult = undefined;\n if (readyResult != null) {\n this.renderCache = {\n ...readyResult,\n diff,\n renderRange: undefined,\n };\n forceHighlight = false;\n }\n this.renderCache ??= {\n diff,\n highlighted: false,\n options,\n result: undefined,\n renderRange: undefined,\n };\n const hasContent =\n diff.additionLines.length > 0 || diff.deletionLines.length > 0;\n const forcePlainText =\n !hasContent ||\n isDiffPlainText(diff) ||\n isDiffMassive(diff, this.getTokenizeMaxLength());\n const canRenderDiff = this.canRenderDiff(diff, options, forcePlainText);\n const newContent = !areDiffTargetsEqual(diff, this.renderCache.diff);\n const newRenderRange = !areRenderRangesEqual(\n this.renderCache.renderRange,\n renderRange\n );\n if (\n !this.editSessionActive &&\n this.workerManager?.isWorkingPool() === true\n ) {\n // Hydration has highlighted DOM but no local AST. Keep that DOM until\n // its corresponding worker result is ready.\n const preserveHydratedContent =\n this.renderCache.result == null &&\n this.renderCache.highlighted &&\n !forcePlainText &&\n !newContent &&\n isDefaultRenderRange(renderRange);\n if (\n canRenderDiff &&\n !preserveHydratedContent &&\n (forcePlainText ||\n this.renderCache.result == null ||\n (!this.renderCache.highlighted && (newContent || newRenderRange)))\n ) {\n this.renderCache.diff = diff;\n this.renderCache.options = options;\n this.renderCache.highlighted = false;\n if (\n this.renderCache.result == null ||\n newContent ||\n newRenderRange ||\n forceHighlight\n ) {\n this.renderCache.result = this.workerManager.getPlainDiffAST(\n diff,\n renderRange.startingLine,\n renderRange.totalLines,\n // If we aren't using a windowed render, then we need to render\n // everything\n isDefaultRenderRange(renderRange)\n ? true\n : expandUnchanged\n ? true\n : this.expandedHunks,\n collapsedContextThreshold\n );\n }\n this.renderCache.renderRange = renderRange;\n }\n\n // Should we kick off an async highlight process\n if (\n !forcePlainText &&\n hasContent &&\n (!this.renderCache.highlighted || forceHighlight)\n ) {\n this.workerManager.highlightDiffAST(this, diff);\n }\n } else {\n this.computedLangs = getDiffLanguages(diff);\n this.highlighter ??= getHighlighterIfLoaded();\n const hasThemes =\n this.highlighter != null && areThemesAttached(options.theme);\n const hasLangs =\n this.highlighter != null && areLanguagesAttached(this.computedLangs);\n const canHighlight = !forcePlainText && hasLangs;\n\n // If we have any semblance of a highlighter with the correct theme(s)\n // attached, we can kick off some form of rendering. If we don't have\n // the correct language, then we can render plain text and after kick off\n // an async job to get the highlighted AST\n if (\n canRenderDiff &&\n this.highlighter != null &&\n hasThemes &&\n (forceHighlight ||\n forcePlainText ||\n (!this.renderCache.highlighted && canHighlight) ||\n this.renderCache.result == null)\n ) {\n const { result, options } = this.renderDiffWithHighlighter(\n diff,\n this.highlighter,\n forcePlainText || !hasLangs\n );\n this.renderCache = {\n diff,\n options,\n highlighted: canHighlight,\n result,\n renderRange: undefined,\n };\n }\n\n // If we get in here it means we'll have to kick off an async highlight\n // process which will involve initializing the highlighter with new themes\n // and languages\n if (!hasThemes || (!forcePlainText && !hasLangs)) {\n void this.asyncHighlight(diff).then(({ result, options }) => {\n this.applyHighlightResult(diff, result, options, !forcePlainText);\n });\n }\n }\n return this.renderCache.result != null\n ? this.processDiffResult(\n this.renderCache.diff,\n renderRange,\n this.renderCache.result\n )\n : undefined;\n }\n\n public async asyncRender(\n diff: FileDiffMetadata,\n renderRange: RenderRange = DEFAULT_RENDER_RANGE\n ): Promise<HunksRenderResult> {\n this.diff = diff;\n const { result } = await this.asyncHighlight(diff);\n return this.processDiffResult(diff, renderRange, result);\n }\n\n protected createPreElement(\n split: boolean,\n totalLines: number,\n customProperties?: CustomPreProperties\n ): HASTElement {\n const { diffIndicators, disableBackground, disableLineNumbers, overflow } =\n this.getOptionsWithDefaults();\n return createPreElement({\n type: 'diff',\n diffIndicators,\n disableBackground,\n disableLineNumbers,\n overflow,\n split,\n totalLines,\n customProperties,\n });\n }\n\n private async asyncHighlight(\n diff: FileDiffMetadata\n ): Promise<RenderDiffResult> {\n const forcePlainText = isDiffMassive(diff, this.getTokenizeMaxLength());\n this.computedLangs = forcePlainText ? ['text'] : getDiffLanguages(diff);\n const hasThemes =\n this.highlighter != null &&\n areThemesAttached(this.getLocalHighlightTheme());\n const hasLangs =\n forcePlainText ||\n (this.highlighter != null && areLanguagesAttached(this.computedLangs));\n // If we don't have the required langs or themes, then we need to\n // initialize the highlighter to load the appropriate languages and themes\n if (this.highlighter == null || !hasThemes || !hasLangs) {\n this.highlighter = await this.initializeHighlighter();\n }\n return this.renderDiffWithHighlighter(\n diff,\n this.highlighter,\n forcePlainText\n );\n }\n\n private renderDiffWithHighlighter(\n diff: FileDiffMetadata,\n highlighter: DiffsHighlighter,\n forcePlainText = false\n ): RenderDiffResult {\n const { options } = this.getRenderOptions(diff);\n const { collapsedContextThreshold } = this.getOptionsWithDefaults();\n const result = renderDiffWithHighlighter(diff, highlighter, options, {\n forcePlainText,\n expandedHunks: forcePlainText ? true : undefined,\n collapsedContextThreshold,\n });\n if (\n this.editSessionActive &&\n diff.additionLines.length === 1 &&\n diff.additionLines[0] === '' &&\n result.code.additionLines[0] == null\n ) {\n let fallbackLine: DiffLineMetadata | undefined;\n iterateOverDiff({\n diff,\n diffStyle: 'both',\n expandedHunks: forcePlainText ? true : undefined,\n collapsedContextThreshold,\n callback: ({ additionLine }) => {\n if (additionLine?.lineIndex !== 0) return;\n fallbackLine = additionLine;\n return true;\n },\n });\n if (fallbackLine == null) {\n throw new Error('DiffHunksRenderer: missing empty addition line');\n }\n result.code.additionLines[0] = createPlainAdditionLineElement(\n 0,\n '',\n fallbackLine.unifiedLineIndex,\n fallbackLine.splitLineIndex\n );\n }\n return { result, options };\n }\n\n public onHighlightSuccess(\n diff: FileDiffMetadata,\n result: ThemedDiffResult,\n options: RenderDiffOptions,\n highlighted = true\n ): void {\n if (this.editSessionActive) {\n return;\n }\n this.applyHighlightResult(diff, result, options, highlighted);\n }\n\n private applyHighlightResult(\n diff: FileDiffMetadata,\n result: ThemedDiffResult,\n options: RenderDiffOptions,\n highlighted = true\n ): void {\n const { diff: currentDiff, renderCache } = this;\n if (\n currentDiff == null ||\n renderCache == null ||\n !areDiffTargetsEqual(currentDiff, diff) ||\n !areDiffRenderOptionsEqual(\n options,\n this.getRenderOptions(currentDiff).options\n )\n ) {\n return;\n }\n\n const triggerRender =\n renderCache.result == null ||\n !renderCache.highlighted ||\n !areDiffRenderOptionsEqual(renderCache.options, options) ||\n !areDiffTargetsEqual(renderCache.diff, currentDiff);\n if (!triggerRender) {\n return;\n }\n\n this.pendingHighlightResult = {\n diff: currentDiff,\n options,\n highlighted,\n result,\n };\n this.onRenderUpdate?.();\n }\n\n private getMatchingWorkerResultCache(\n diff: FileDiffMetadata,\n options: RenderDiffOptions\n ): RenderDiffResult | undefined {\n if (this.editSessionActive) {\n return undefined;\n }\n const cache = this.workerManager?.getDiffResultCache(diff);\n if (cache == null || !areDiffRenderOptionsEqual(options, cache.options)) {\n return undefined;\n }\n return cache;\n }\n\n // Returns completed background work that can replace the rendered AST on\n // the next render. Reading it does not promote or discard pending work.\n private getReadyRenderResult(\n diff: FileDiffMetadata,\n options: RenderDiffOptions\n ): PendingHighlightResult | undefined {\n const { pendingHighlightResult } = this;\n if (\n pendingHighlightResult != null &&\n areDiffTargetsEqual(pendingHighlightResult.diff, diff) &&\n areDiffRenderOptionsEqual(pendingHighlightResult.options, options)\n ) {\n return pendingHighlightResult;\n }\n\n const workerCache = this.getMatchingWorkerResultCache(diff, options);\n // Return nothing when the worker has not finished, or when this diff is\n // already rendered with matching highlighted markup. In both cases the\n // current render cache should remain unchanged.\n if (workerCache == null || this.hasHighlightedRenderCache(diff, options)) {\n return undefined;\n }\n return { diff, highlighted: true, ...workerCache };\n }\n\n private hasHighlightedRenderCache(\n diff: FileDiffMetadata,\n options: RenderDiffOptions\n ): boolean {\n const { renderCache } = this;\n return (\n renderCache?.result != null &&\n renderCache.highlighted &&\n areDiffTargetsEqual(diff, renderCache.diff) &&\n areDiffRenderOptionsEqual(options, renderCache.options)\n );\n }\n\n public onHighlightError(error: unknown): void {\n console.error(error);\n }\n\n private getTokenizeMaxLength(): number {\n return this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH;\n }\n\n private processDiffResult(\n fileDiff: FileDiffMetadata,\n renderRange: RenderRange,\n { code, themeStyles, baseThemeType }: ThemedDiffResult\n ): HunksRenderResult {\n const {\n diffStyle,\n disableFileHeader,\n expandUnchanged,\n expansionLineCount,\n collapsedContextThreshold,\n hunkSeparators,\n } = this.getOptionsWithDefaults();\n const isRenderCacheDirty = this.renderCache?.isDirty ?? false;\n\n const unified = diffStyle === 'unified';\n const canHydrateContext = canHydrateCollapsedContext(\n fileDiff,\n this.options.loadDiffFiles != null\n );\n const isExpandableDiff = !fileDiff.isPartial || canHydrateContext;\n\n let additionsContentAST: ElementContent[] | undefined = [];\n let deletionsContentAST: ElementContent[] | undefined = [];\n let unifiedContentAST: ElementContent[] | undefined = [];\n\n const hunkData: HunkData[] = [];\n const { additionLines, deletionLines } = code;\n const context: ProcessContext = {\n rowCount: 0,\n hunkSeparators,\n additionsContentAST,\n deletionsContentAST,\n unifiedContentAST,\n unifiedGutterAST: createGutterWrapper(),\n deletionsGutterAST: createGutterWrapper(),\n additionsGutterAST: createGutterWrapper(),\n expansionLineCount,\n hunkData,\n incrementRowCount(count = 1) {\n context.rowCount += count;\n },\n pushToGutter(type: CodeColumnType, element: HASTElement) {\n switch (type) {\n case 'unified': {\n context.unifiedGutterAST.children.push(element);\n break;\n }\n case 'deletions': {\n context.deletionsGutterAST.children.push(element);\n break;\n }\n case 'additions': {\n context.additionsGutterAST.children.push(element);\n break;\n }\n }\n },\n };\n const trailingRangeSize = getTrailingContextRangeSize({\n fileDiff,\n errorPrefix: 'DiffHunksRenderer.processDiffResult',\n });\n const pendingSplitContext: PendingSplitContext = {\n size: 0,\n side: undefined,\n increment() {\n this.size += 1;\n },\n flush() {\n if (diffStyle === 'unified') {\n return;\n }\n if (this.size <= 0 || this.side == null) {\n this.side = undefined;\n this.size = 0;\n return;\n }\n if (this.side === 'additions') {\n context.pushToGutter(\n 'additions',\n createGutterGap(undefined, 'buffer', this.size)\n );\n additionsContentAST?.push(createEmptyRowBuffer(this.size));\n } else {\n context.pushToGutter(\n 'deletions',\n createGutterGap(undefined, 'buffer', this.size)\n );\n deletionsContentAST?.push(createEmptyRowBuffer(this.size));\n }\n this.size = 0;\n this.side = undefined;\n },\n };\n\n const pushGutterLineNumber = (\n type: CodeColumnType,\n lineType: LineTypes | 'buffer' | 'separator' | 'annotation',\n lineNumber: number,\n lineIndex: string,\n gutterProperties: Properties | undefined\n ) => {\n context.pushToGutter(\n type,\n createGutterItem(lineType, lineNumber, lineIndex, gutterProperties)\n );\n };\n\n function pushSeparators(props: PushSeparatorProps) {\n pendingSplitContext.flush();\n if (diffStyle === 'unified') {\n pushSeparator('unified', props, context);\n } else {\n pushSeparator('deletions', props, context);\n pushSeparator('additions', props, context);\n }\n }\n\n this.pushFileLevelAnnotations(fileDiff, diffStyle, renderRange, context);\n\n iterateOverDiff({\n diff: fileDiff,\n diffStyle,\n startingLine: renderRange.startingLine,\n totalLines: renderRange.totalLines,\n expandedHunks: expandUnchanged ? true : this.expandedHunks,\n collapsedContextThreshold,\n callback: ({\n hunkIndex,\n hunk,\n collapsedBefore,\n collapsedAfter,\n additionLine,\n deletionLine,\n type,\n }) => {\n const splitLineIndex =\n deletionLine != null\n ? deletionLine.splitLineIndex\n : additionLine.splitLineIndex;\n const unifiedLineIndex =\n additionLine != null\n ? additionLine.unifiedLineIndex\n : deletionLine.unifiedLineIndex;\n\n if (diffStyle === 'split' && type !== 'change') {\n pendingSplitContext.flush();\n }\n\n if (collapsedBefore > 0) {\n pushSeparators({\n hunkIndex,\n collapsedLines: collapsedBefore,\n rangeSize: Math.max(hunk?.collapsedBefore ?? 0, 0),\n hunkSpecs: hunk?.hunkSpecs,\n isFirstHunk: hunkIndex === 0,\n isLastHunk: false,\n isExpandable: isExpandableDiff,\n });\n }\n\n const lineIndex =\n diffStyle === 'unified' ? unifiedLineIndex : splitLineIndex;\n const renderedLineContext: RenderedLineContext = {\n type,\n hunkIndex,\n lineIndex,\n unifiedLineIndex,\n splitLineIndex,\n deletionLine,\n additionLine,\n };\n\n if (diffStyle === 'unified') {\n const injectedRows =\n this.getUnifiedInjectedRowsForLine?.(renderedLineContext);\n if (injectedRows?.before != null) {\n pushUnifiedInjectedRows(injectedRows.before, context);\n }\n let deletionLineContent =\n deletionLine != null\n ? deletionLines[deletionLine.lineIndex]\n : undefined;\n let additionLineContent =\n additionLine != null\n ? additionLines[additionLine.lineIndex]\n : undefined;\n if (deletionLineContent == null && additionLineContent == null) {\n const errorMessage =\n 'DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong';\n console.error(errorMessage, { file: fileDiff.name });\n throw new Error(errorMessage);\n }\n const lineType =\n type === 'change'\n ? additionLine != null\n ? 'change-addition'\n : 'change-deletion'\n : type;\n const lineDecoration = this.getUnifiedLineDecoration({\n // NOTE: This function gets extended so don't remove\n // these extra props\n type,\n lineType,\n additionLineIndex: additionLine?.lineIndex,\n deletionLineIndex: deletionLine?.lineIndex,\n });\n pushGutterLineNumber(\n 'unified',\n lineDecoration.gutterLineType,\n additionLine != null\n ? additionLine.lineNumber\n : deletionLine.lineNumber,\n `${unifiedLineIndex},${splitLineIndex}`,\n lineDecoration.gutterProperties\n );\n if (additionLineContent != null) {\n additionLineContent = withContentProperties(\n additionLineContent,\n lineDecoration.contentProperties,\n isRenderCacheDirty && additionLine != null\n ? {\n 'data-line': additionLine.lineNumber,\n 'data-line-index': `${unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n } else if (deletionLineContent != null) {\n deletionLineContent = withContentProperties(\n deletionLineContent,\n lineDecoration.contentProperties,\n isRenderCacheDirty && deletionLine != null\n ? {\n 'data-line': deletionLine.lineNumber,\n 'data-line-index': `${unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n }\n pushLineWithAnnotation({\n diffStyle: 'unified',\n type: type,\n deletionLine: deletionLineContent,\n additionLine: additionLineContent,\n unifiedSpan: this.getAnnotations(\n 'unified',\n deletionLine?.lineNumber,\n additionLine?.lineNumber,\n hunkIndex,\n lineIndex\n ),\n createAnnotationElement: (span) =>\n this.createAnnotationElement(span),\n context,\n });\n if (injectedRows?.after != null) {\n pushUnifiedInjectedRows(injectedRows.after, context);\n }\n } else {\n const injectedRows =\n this.getSplitInjectedRowsForLine?.(renderedLineContext);\n if (injectedRows?.before != null) {\n pushSplitInjectedRows(\n injectedRows.before,\n context,\n pendingSplitContext\n );\n }\n\n let deletionLineContent =\n deletionLine != null\n ? deletionLines[deletionLine.lineIndex]\n : undefined;\n let additionLineContent =\n additionLine != null\n ? additionLines[additionLine.lineIndex]\n : undefined;\n const deletionLineDecoration = this.getSplitLineDecoration({\n side: 'deletions',\n type,\n lineIndex: deletionLine?.lineIndex,\n });\n const additionLineDecoration = this.getSplitLineDecoration({\n side: 'additions',\n type,\n lineIndex: additionLine?.lineIndex,\n });\n\n if (deletionLineContent == null && additionLineContent == null) {\n const errorMessage =\n 'DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong';\n console.error(errorMessage, { file: fileDiff.name });\n throw new Error(errorMessage);\n }\n\n const missingSide = (() => {\n if (type === 'change') {\n if (additionLineContent == null) {\n return 'additions';\n } else if (deletionLineContent == null) {\n return 'deletions';\n }\n }\n return undefined;\n })();\n if (missingSide != null) {\n if (\n pendingSplitContext.side != null &&\n pendingSplitContext.side !== missingSide\n ) {\n pendingSplitContext.flush();\n }\n pendingSplitContext.side = missingSide;\n pendingSplitContext.increment();\n } else if (type === 'change') {\n // A change row with both sides fills the column a pending\n // one-sided buffer was holding open (an insert/delete block\n // directly followed by a paired block, from similarity\n // realignment); flush first so the buffer lands above this row.\n pendingSplitContext.flush();\n }\n\n const annotationSpans = this.getAnnotations(\n 'split',\n deletionLine?.lineNumber,\n additionLine?.lineNumber,\n hunkIndex,\n lineIndex\n );\n if (annotationSpans != null && pendingSplitContext.size > 0) {\n pendingSplitContext.flush();\n }\n\n if (deletionLine != null) {\n const deletionLineDecorated = withContentProperties(\n deletionLineContent,\n deletionLineDecoration.contentProperties,\n isRenderCacheDirty\n ? {\n 'data-line': deletionLine.lineNumber,\n 'data-line-index': `${deletionLine.unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n pushGutterLineNumber(\n 'deletions',\n deletionLineDecoration.gutterLineType,\n deletionLine.lineNumber,\n `${deletionLine.unifiedLineIndex},${splitLineIndex}`,\n deletionLineDecoration.gutterProperties\n );\n if (deletionLineDecorated != null) {\n deletionLineContent = deletionLineDecorated;\n }\n }\n if (additionLine != null) {\n const additionLineDecorated = withContentProperties(\n additionLineContent,\n additionLineDecoration.contentProperties,\n isRenderCacheDirty\n ? {\n 'data-line': additionLine.lineNumber,\n 'data-line-index': `${additionLine.unifiedLineIndex},${splitLineIndex}`,\n }\n : undefined\n );\n pushGutterLineNumber(\n 'additions',\n additionLineDecoration.gutterLineType,\n additionLine.lineNumber,\n `${additionLine.unifiedLineIndex},${splitLineIndex}`,\n additionLineDecoration.gutterProperties\n );\n if (additionLineDecorated != null) {\n additionLineContent = additionLineDecorated;\n }\n }\n pushLineWithAnnotation({\n diffStyle: 'split',\n type: type,\n additionLine: additionLineContent,\n deletionLine: deletionLineContent,\n ...annotationSpans,\n createAnnotationElement: (span) =>\n this.createAnnotationElement(span),\n context,\n });\n if (injectedRows?.after != null) {\n pushSplitInjectedRows(\n injectedRows.after,\n context,\n pendingSplitContext\n );\n }\n }\n\n const isFinalSplitHunkRow =\n diffStyle === 'split' &&\n hunk != null &&\n splitLineIndex === hunk.splitLineStart + hunk.splitLineCount - 1;\n const isFinalHunkRow =\n hunkIndex === fileDiff.hunks.length - 1 &&\n hunk != null &&\n (diffStyle === 'split'\n ? splitLineIndex === hunk.splitLineStart + hunk.splitLineCount - 1\n : unifiedLineIndex ===\n hunk.unifiedLineStart + hunk.unifiedLineCount - 1);\n const splitNoEOFCRDeletion = isFinalSplitHunkRow\n ? hunk.noEOFCRDeletions\n : false;\n const splitNoEOFCRAddition = isFinalSplitHunkRow\n ? hunk.noEOFCRAdditions\n : false;\n const noEOFCRDeletion =\n (deletionLine?.noEOFCR ?? false) || splitNoEOFCRDeletion;\n const noEOFCRAddition =\n (additionLine?.noEOFCR ?? false) || splitNoEOFCRAddition;\n if (noEOFCRAddition || noEOFCRDeletion) {\n if (diffStyle === 'split') {\n pendingSplitContext.flush();\n }\n if (noEOFCRDeletion) {\n const noEOFType =\n type === 'context' || type === 'context-expanded'\n ? type\n : 'change-deletion';\n if (diffStyle === 'unified') {\n context.unifiedContentAST.push(createNoNewlineElement(noEOFType));\n context.pushToGutter(\n 'unified',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n } else {\n context.deletionsContentAST.push(\n createNoNewlineElement(noEOFType)\n );\n context.pushToGutter(\n 'deletions',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n if (!noEOFCRAddition) {\n context.pushToGutter(\n 'additions',\n createGutterGap(undefined, 'buffer', 1)\n );\n context.additionsContentAST.push(createEmptyRowBuffer(1));\n }\n }\n }\n if (noEOFCRAddition) {\n const noEOFType =\n type === 'context' || type === 'context-expanded'\n ? type\n : 'change-addition';\n if (diffStyle === 'unified') {\n context.unifiedContentAST.push(createNoNewlineElement(noEOFType));\n context.pushToGutter(\n 'unified',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n } else {\n context.additionsContentAST.push(\n createNoNewlineElement(noEOFType)\n );\n context.pushToGutter(\n 'additions',\n createGutterGap(noEOFType, 'metadata', 1)\n );\n if (!noEOFCRDeletion) {\n context.pushToGutter(\n 'deletions',\n createGutterGap(undefined, 'buffer', 1)\n );\n context.deletionsContentAST.push(createEmptyRowBuffer(1));\n }\n }\n }\n context.incrementRowCount(1);\n }\n\n if (\n hunkSeparators !== 'simple' &&\n hunkSeparators !== 'metadata' &&\n (collapsedAfter > 0 || (isFinalHunkRow && canHydrateContext))\n ) {\n pushSeparators({\n hunkIndex: type === 'context-expanded' ? hunkIndex : hunkIndex + 1,\n collapsedLines:\n isFinalHunkRow && canHydrateContext ? 'unknown' : collapsedAfter,\n rangeSize: trailingRangeSize,\n hunkSpecs: undefined,\n isFirstHunk: false,\n isLastHunk: true,\n isExpandable: isExpandableDiff,\n });\n }\n context.incrementRowCount(1);\n },\n });\n\n if (diffStyle === 'split') {\n pendingSplitContext.flush();\n }\n\n const totalLines = Math.max(\n getTotalLineCountFromHunks(fileDiff.hunks),\n fileDiff.additionLines.length ?? 0,\n fileDiff.deletionLines.length ?? 0\n );\n\n const hasBuffer =\n renderRange.bufferBefore > 0 || renderRange.bufferAfter > 0;\n // Determine which ASTs to include based on diff style and file type\n const shouldIncludeAdditions = !unified && fileDiff.type !== 'deleted';\n const shouldIncludeDeletions = !unified && fileDiff.type !== 'new';\n const hasContent = context.rowCount > 0 || hasBuffer;\n\n additionsContentAST =\n shouldIncludeAdditions && hasContent ? additionsContentAST : undefined;\n deletionsContentAST =\n shouldIncludeDeletions && hasContent ? deletionsContentAST : undefined;\n unifiedContentAST = unified && hasContent ? unifiedContentAST : undefined;\n\n const preNode = this.createPreElement(\n deletionsContentAST != null && additionsContentAST != null,\n totalLines\n );\n\n return {\n fileDiff,\n unifiedGutterAST:\n unified && hasContent ? context.unifiedGutterAST.children : undefined,\n unifiedContentAST,\n deletionsGutterAST:\n shouldIncludeDeletions && hasContent\n ? context.deletionsGutterAST.children\n : undefined,\n deletionsContentAST,\n additionsGutterAST:\n shouldIncludeAdditions && hasContent\n ? context.additionsGutterAST.children\n : undefined,\n additionsContentAST,\n hunkData,\n preNode,\n themeStyles,\n baseThemeType,\n headerElement: !disableFileHeader\n ? this.renderHeader(fileDiff)\n : undefined,\n totalLines,\n rowCount: context.rowCount,\n bufferBefore: renderRange.bufferBefore,\n bufferAfter: renderRange.bufferAfter,\n // FIXME\n css: '',\n };\n }\n\n public renderCodeAST(\n type: 'unified' | 'deletions' | 'additions',\n result: HunksRenderResult\n ): ElementContent[] | undefined {\n const gutterAST =\n type === 'unified'\n ? result.unifiedGutterAST\n : type === 'deletions'\n ? result.deletionsGutterAST\n : result.additionsGutterAST;\n\n const contentAST =\n type === 'unified'\n ? result.unifiedContentAST\n : type === 'deletions'\n ? result.deletionsContentAST\n : result.additionsContentAST;\n\n if (gutterAST == null || contentAST == null) {\n return undefined;\n }\n\n const gutter = createGutterWrapper(gutterAST);\n gutter.properties.style = `grid-row: span ${result.rowCount}`;\n const contentColumn = createContentColumn(contentAST, result.rowCount);\n return [gutter, contentColumn];\n }\n\n public renderFullAST(\n result: HunksRenderResult,\n children: ElementContent[] = []\n ): HASTElement {\n const containerSize =\n this.getOptionsWithDefaults().hunkSeparators === 'line-info';\n const unifiedAST = this.renderCodeAST('unified', result);\n if (unifiedAST != null) {\n children.push(\n createHastElement({\n tagName: 'code',\n children: unifiedAST,\n properties: {\n 'data-code': '',\n 'data-container-size': containerSize ? '' : undefined,\n 'data-unified': '',\n },\n })\n );\n return { ...result.preNode, children };\n }\n\n const deletionsAST = this.renderCodeAST('deletions', result);\n if (deletionsAST != null) {\n children.push(\n createHastElement({\n tagName: 'code',\n children: deletionsAST,\n properties: {\n 'data-code': '',\n 'data-container-size': containerSize ? '' : undefined,\n 'data-deletions': '',\n },\n })\n );\n }\n const additionsAST = this.renderCodeAST('additions', result);\n if (additionsAST != null) {\n children.push(\n createHastElement({\n tagName: 'code',\n children: additionsAST,\n properties: {\n 'data-code': '',\n 'data-container-size': containerSize ? '' : undefined,\n 'data-additions': '',\n },\n })\n );\n }\n return { ...result.preNode, children };\n }\n\n public renderFullHTML(\n result: HunksRenderResult,\n tempChildren: ElementContent[] = []\n ): string {\n return toHtml(this.renderFullAST(result, tempChildren));\n }\n\n public renderPartialHTML(\n children: ElementContent[],\n columnType?: 'unified' | 'deletions' | 'additions'\n ): string {\n if (columnType == null) {\n return toHtml(children);\n }\n return toHtml(\n createHastElement({\n tagName: 'code',\n children,\n properties: {\n 'data-code': '',\n 'data-container-size':\n this.getOptionsWithDefaults().hunkSeparators === 'line-info'\n ? ''\n : undefined,\n [`data-${columnType}`]: '',\n },\n })\n );\n }\n\n private pushFileLevelAnnotations(\n fileDiff: FileDiffMetadata,\n diffStyle: 'unified' | 'split',\n renderRange: RenderRange,\n context: ProcessContext\n ): void {\n if (!shouldRenderFileAnnotations(renderRange)) {\n return;\n }\n\n const deletionAnnotationNames =\n fileDiff.type !== 'new'\n ? this.getAnnotationNames(getFileAnnotations(this.deletionAnnotations))\n : [];\n const additionAnnotationNames =\n fileDiff.type !== 'deleted'\n ? this.getAnnotationNames(getFileAnnotations(this.additionAnnotations))\n : [];\n if (\n deletionAnnotationNames.length === 0 &&\n additionAnnotationNames.length === 0\n ) {\n return;\n }\n\n const hunkIndex = FILE_ANNOTATION_HUNK_INDEX;\n const lineIndex = FILE_ANNOTATION_LINE_INDEX;\n const { createAnnotationElement } = this;\n\n if (diffStyle === 'unified') {\n pushLineWithAnnotation({\n diffStyle,\n type: 'context',\n unifiedSpan: {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: deletionAnnotationNames.concat(additionAnnotationNames),\n },\n createAnnotationElement,\n context,\n });\n return;\n }\n\n pushLineWithAnnotation({\n diffStyle,\n type: 'context',\n deletionSpan: {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: deletionAnnotationNames,\n },\n additionSpan: {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: additionAnnotationNames,\n },\n createAnnotationElement,\n context,\n });\n }\n\n private getAnnotations(\n type: 'unified',\n deletionLineNumber: number | undefined,\n additionLineNumber: number | undefined,\n hunkIndex: number,\n lineIndex: number\n ): AnnotationSpan | undefined;\n private getAnnotations(\n type: 'split',\n deletionLineNumber: number | undefined,\n additionLineNumber: number | undefined,\n hunkIndex: number,\n lineIndex: number\n ): { deletionSpan: AnnotationSpan; additionSpan: AnnotationSpan } | undefined;\n private getAnnotations(\n type: 'unified' | 'split',\n deletionLineNumber: number | undefined,\n additionLineNumber: number | undefined,\n hunkIndex: number,\n lineIndex: number\n ):\n | AnnotationSpan\n | { deletionSpan: AnnotationSpan; additionSpan: AnnotationSpan }\n | undefined {\n const deletionSpan: AnnotationSpan = {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: [],\n };\n if (deletionLineNumber != null) {\n for (const anno of this.deletionAnnotations[deletionLineNumber] ?? []) {\n deletionSpan.annotations.push(this.annotationSlotName(anno));\n }\n }\n const additionSpan: AnnotationSpan = {\n type: 'annotation',\n hunkIndex,\n lineIndex,\n annotations: [],\n };\n if (additionLineNumber != null) {\n for (const anno of this.additionAnnotations[additionLineNumber] ?? []) {\n (type === 'unified' ? deletionSpan : additionSpan).annotations.push(\n this.annotationSlotName(anno)\n );\n }\n }\n if (type === 'unified') {\n if (deletionSpan.annotations.length > 0) {\n return deletionSpan;\n }\n return undefined;\n }\n if (\n additionSpan.annotations.length === 0 &&\n deletionSpan.annotations.length === 0\n ) {\n return undefined;\n }\n return { deletionSpan, additionSpan };\n }\n\n private getAnnotationNames(\n annotations: DiffLineAnnotation<LAnnotation>[] | undefined\n ): string[] {\n return (\n annotations?.map((annotation) => this.annotationSlotName(annotation)) ??\n []\n );\n }\n\n private renderHeader(diff: FileDiffMetadata): HASTElement {\n const { headerRenderMode, stickyHeader } = this.getOptionsWithDefaults();\n return createFileHeaderElement({\n fileOrDiff: diff,\n mode: headerRenderMode,\n stickyHeader,\n });\n }\n}\n\n// Use the platform's English plural rules to pick \"line\" vs \"lines\" so a\n// count of 0 reads as \"0 unmodified lines\". en-US returns \"one\" only for 1.\nconst EN_PLURAL_RULES = new Intl.PluralRules('en-US');\n\nfunction getModifiedLinesString(lines: number) {\n const suffix = EN_PLURAL_RULES.select(lines) === 'one' ? '' : 's';\n return `${lines} unmodified line${suffix}`;\n}\n\nfunction pushUnifiedInjectedRows(\n rows: InjectedRow[],\n context: ProcessContext\n): void {\n for (const row of rows) {\n context.unifiedContentAST.push(row.content);\n context.pushToGutter('unified', row.gutter);\n context.incrementRowCount(1);\n }\n}\n\nfunction pushSplitInjectedRows(\n rows: SplitInjectedRow[],\n context: ProcessContext,\n pendingSplitContext: PendingSplitContext\n): void {\n for (const { deletion, addition } of rows) {\n if (deletion == null && addition == null) {\n continue;\n }\n const missingSide =\n deletion != null && addition != null\n ? undefined\n : deletion == null\n ? 'deletions'\n : 'additions';\n\n if (missingSide == null || pendingSplitContext.side !== missingSide) {\n pendingSplitContext.flush();\n }\n\n if (deletion != null) {\n context.deletionsContentAST.push(deletion.content);\n context.pushToGutter('deletions', deletion.gutter);\n }\n\n if (addition != null) {\n context.additionsContentAST.push(addition.content);\n context.pushToGutter('additions', addition.gutter);\n }\n\n if (missingSide != null) {\n pendingSplitContext.side = missingSide;\n pendingSplitContext.increment();\n }\n\n context.incrementRowCount(1);\n }\n}\n\nfunction pushLineWithAnnotation({\n diffStyle,\n type,\n deletionLine,\n additionLine,\n unifiedSpan,\n deletionSpan,\n additionSpan,\n createAnnotationElement,\n context,\n}: PushLineWithAnnotation) {\n let hasAnnotationRow = false;\n if (diffStyle === 'unified') {\n if (additionLine != null) {\n context.unifiedContentAST.push(additionLine);\n } else if (deletionLine != null) {\n context.unifiedContentAST.push(deletionLine);\n }\n if (unifiedSpan != null) {\n const lineType =\n type === 'change'\n ? deletionLine != null\n ? 'change-deletion'\n : 'change-addition'\n : type;\n context.unifiedContentAST.push(createAnnotationElement(unifiedSpan));\n context.pushToGutter(\n 'unified',\n createGutterGap(lineType, 'annotation', 1)\n );\n hasAnnotationRow = true;\n }\n } else if (diffStyle === 'split') {\n if (deletionLine != null) {\n context.deletionsContentAST.push(deletionLine);\n }\n if (additionLine != null) {\n context.additionsContentAST.push(additionLine);\n }\n if (deletionSpan != null) {\n const lineType =\n type === 'change'\n ? deletionLine != null\n ? 'change-deletion'\n : 'context'\n : type;\n context.deletionsContentAST.push(createAnnotationElement(deletionSpan));\n context.pushToGutter(\n 'deletions',\n createGutterGap(lineType, 'annotation', 1)\n );\n hasAnnotationRow = true;\n }\n if (additionSpan != null) {\n const lineType =\n type === 'change'\n ? additionLine != null\n ? 'change-addition'\n : 'context'\n : type;\n context.additionsContentAST.push(createAnnotationElement(additionSpan));\n context.pushToGutter(\n 'additions',\n createGutterGap(lineType, 'annotation', 1)\n );\n hasAnnotationRow = true;\n }\n }\n if (hasAnnotationRow) {\n context.incrementRowCount(1);\n }\n}\n\nfunction pushSeparator(\n type: 'additions' | 'deletions' | 'unified',\n {\n hunkIndex,\n collapsedLines,\n rangeSize,\n hunkSpecs,\n isFirstHunk,\n isLastHunk,\n isExpandable,\n }: PushSeparatorProps,\n context: ProcessContext\n) {\n if (typeof collapsedLines === 'number' && collapsedLines <= 0) {\n return;\n }\n const linesAST =\n type === 'unified'\n ? context.unifiedContentAST\n : type === 'deletions'\n ? context.deletionsContentAST\n : context.additionsContentAST;\n\n if (context.hunkSeparators === 'metadata') {\n if (hunkSpecs != null) {\n context.pushToGutter(\n type,\n createSeparator({\n type: 'metadata',\n content: hunkSpecs,\n isFirstHunk,\n isLastHunk,\n })\n );\n linesAST.push(\n createSeparator({\n type: 'metadata',\n content: hunkSpecs,\n isFirstHunk,\n isLastHunk,\n })\n );\n if (type !== 'additions') {\n context.incrementRowCount(1);\n }\n }\n return;\n }\n if (context.hunkSeparators === 'simple') {\n if (hunkIndex > 0) {\n context.pushToGutter(\n type,\n createSeparator({ type: 'simple', isFirstHunk, isLastHunk: false })\n );\n linesAST.push(\n createSeparator({ type: 'simple', isFirstHunk, isLastHunk: false })\n );\n if (type !== 'additions') {\n context.incrementRowCount(1);\n }\n }\n return;\n }\n const slotName = getHunkSeparatorSlotName(type, hunkIndex);\n const chunked = rangeSize > context.expansionLineCount;\n const expandIndex = isExpandable ? hunkIndex : undefined;\n const content =\n typeof collapsedLines === 'number'\n ? getModifiedLinesString(collapsedLines)\n : 'More unchanged context may be available';\n context.pushToGutter(\n type,\n createSeparator({\n type: context.hunkSeparators,\n content,\n expandIndex,\n chunked,\n slotName,\n isFirstHunk,\n isLastHunk,\n })\n );\n linesAST.push(\n createSeparator({\n type: context.hunkSeparators,\n content,\n expandIndex,\n chunked,\n slotName,\n isFirstHunk,\n isLastHunk,\n })\n );\n if (type !== 'additions') {\n context.incrementRowCount(1);\n }\n context.hunkData.push({\n slotName,\n hunkIndex,\n lines: typeof collapsedLines === 'number' ? collapsedLines : 0,\n lineCountKnown: typeof collapsedLines === 'number',\n type,\n expandable: isExpandable\n ? { up: !isFirstHunk, down: !isLastHunk, chunked }\n : undefined,\n });\n}\n\nfunction withContentProperties(\n lineNode: ElementContent | undefined,\n contentProperties?: Properties,\n extendProperties?: Properties\n): ElementContent | undefined {\n if (\n lineNode == null ||\n lineNode.type !== 'element' ||\n (contentProperties == null && extendProperties == null)\n ) {\n return lineNode;\n }\n return {\n ...lineNode,\n properties: {\n ...lineNode.properties,\n ...contentProperties,\n ...extendProperties,\n },\n };\n}\n\n// Number of entries in a split-line array that hold document content. A\n// document ending in a line break is represented two ways during a session:\n// the parsed-diff shape (`splitFileContents`) has no entry for the empty line\n// that final break implies, while the editor-document shape\n// (`getEditorDocumentLines`) exposes it as a trailing `''` entry. Only that\n// representational tail is ever `''` — every other entry keeps its line break\n// or is the raw final line — so trimming it yields comparable content lines.\nfunction contentLineCount(lines: string[]): number {\n return lines.length > 0 && lines[lines.length - 1] === ''\n ? lines.length - 1\n : lines.length;\n}\n\n// Realigns the cached per-line addition HAST array with an edited document.\n// Cached entries are looked up by line index, so a line inserted or removed\n// mid-document must shift the surviving entries to their new indexes —\n// otherwise rows hidden during the edit (collapsed context) render another\n// line's stale tokens once they become visible. Entries outside the changed\n// window keep their highlighted content; changed rows without fresh tokens\n// become plain-text elements for the editor's next background pass.\n//\n// The bottom-up scan runs over content lines only: a session's first\n// line-count edit still has `previousLines` in the parsed-diff shape while\n// `nextLines` is editor-shaped, and comparing the raw tails would mismatch on\n// the representational trailing `''`, zero out the suffix, and plain-fill\n// every line below the tokenizer's render window.\nfunction realignAdditionHastLines<LAnnotation>(\n previousLines: string[],\n nextLines: string[],\n hastLines: ElementContent[],\n textDocument: TextDocument<'file-diff', LAnnotation>\n): ElementContent[] {\n const previousContentLength = contentLineCount(previousLines);\n const nextContentLength = contentLineCount(nextLines);\n const maxShared = Math.min(previousContentLength, nextContentLength);\n let prefix = 0;\n while (prefix < maxShared && previousLines[prefix] === nextLines[prefix]) {\n prefix++;\n }\n let suffix = 0;\n while (\n suffix < maxShared - prefix &&\n previousLines[previousContentLength - 1 - suffix] ===\n nextLines[nextContentLength - 1 - suffix]\n ) {\n suffix++;\n }\n\n const realigned: ElementContent[] = new Array(nextLines.length);\n for (let index = 0; index < prefix; index++) {\n realigned[index] = hastLines[index];\n }\n for (let offset = 0; offset < suffix; offset++) {\n realigned[nextContentLength - 1 - offset] =\n hastLines[previousContentLength - 1 - offset];\n }\n // A trailing empty entry present on both sides keeps its cached row.\n if (\n previousContentLength < previousLines.length &&\n nextContentLength < nextLines.length\n ) {\n realigned[nextLines.length - 1] = hastLines[previousLines.length - 1];\n }\n for (let index = prefix; index < nextLines.length; index++) {\n realigned[index] ??= createPlainAdditionLineElement(\n index,\n textDocument.getLineText(index)\n );\n }\n return realigned;\n}\n\nfunction createPlainAdditionLineElement(\n lineIndex: number,\n lineText: string,\n unifiedLineIndex = lineIndex,\n splitLineIndex = lineIndex\n): HASTElement {\n return {\n type: 'element',\n tagName: 'div',\n properties: {\n 'data-line': lineIndex + 1,\n 'data-line-index': `${unifiedLineIndex},${splitLineIndex}`,\n 'data-line-type': 'context',\n },\n children: [\n {\n type: 'element',\n tagName: 'span',\n properties: {\n 'data-char': 0,\n },\n children: [\n {\n type: 'text',\n value: lineText,\n },\n ],\n },\n ],\n };\n}\n\nfunction getEditorDocumentLines<LAnnotation>(\n textDocument: TextDocument<'file-diff', LAnnotation>\n): string[] {\n const lines: string[] = [];\n for (let line = 0; line < textDocument.lineCount; line++) {\n lines.push(textDocument.getLineText(line, true));\n }\n return lines;\n}\n\n// Renames can supply 2 different languages, so lets go ahead and figure out\n// the required languages\nfunction getDiffLanguages(diff: FileDiffMetadata): SupportedLanguages[] {\n if (diff.lang != null) {\n return [diff.lang];\n }\n const deletionLang = getFiletypeFromFileName(diff.prevName ?? diff.name);\n const additionLang = getFiletypeFromFileName(diff.name);\n return deletionLang === additionLang\n ? [additionLang]\n : [deletionLang, additionLang];\n}\n\nfunction isDiffMassive(\n diff: FileDiffMetadata,\n tokenizeMaxLength: number\n): boolean {\n return (\n Math.max(diff.additionLines.length, diff.deletionLines.length) >\n tokenizeMaxLength\n );\n}\n\nfunction canHydrateCollapsedContext(\n fileDiff: FileDiffMetadata,\n hasFileLoader: boolean\n): boolean {\n return (\n fileDiff.isPartial &&\n hasFileLoader &&\n (fileDiff.type === 'change' || fileDiff.type === 'rename-changed')\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2OA,IAAI,aAAa;AAEjB,IAAa,oBAAb,MAAwD;CAgC7C;CACC;CAGA;CACA;CApCV,OAAwB,uBAAuB,EAAE;CAEjD;CAIA;CAEA,gCAAwB,IAAI,IAAiC;CAE7D,sBAA8D,CAAC;CAC/D,sBAA8D,CAAC;CAE/D,gBAA8C,CAAC,MAAM;CACrD;CAGA;CAGA;CAQA,oBAA4B;CAE5B,YACE,UAA2C,EAAE,OAAO,eAAe,GACnE,qBAEc,uBACd,gBACA,eACA;EANO,KAAA,UAAA;EACC,KAAA,qBAAA;EAGA,KAAA,iBAAA;EACA,KAAA,gBAAA;EAER,IAAI,eAAe,cAAc,MAAM,MACrC,KAAK,cAAc,kBAAkB,QAAQ,SAAS,cAAc,IAChE,uBAAuB,IACvB,KAAA;CAER;CAEA,UAAuB;EACrB,KAAK,QAAQ;EACb,KAAK,cAAc,MAAM;EACzB,KAAK,gBAAgB,KAAA;EACrB,KAAK,iBAAiB,KAAA;CACxB;CAEA,UAAuB;EACrB,KAAK,cAAc,KAAA;EACnB,KAAK,OAAO,KAAA;EACZ,KAAK,iBAAiB;EACtB,KAAK,sBAAsB,CAAC;EAC5B,KAAK,sBAAsB,CAAC;EAC5B,KAAK,eAAe,aAAa,IAAI;EACrC,KAAK,eAAe;CACtB;;;;;;;;;;CAWA,iBACE,MACA,cACM;EACN,MAAM,EAAE,mBAAmB,kBAAkB,gBAAgB;EAC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