@openclaw/diffs 2026.5.27-beta.1 → 2026.5.28-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (838) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/viewer-runtime.js +50 -50
  3. package/dist/index.js +419 -81
  4. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts +22 -7
  5. package/node_modules/@pierre/diffs/dist/components/CodeView.d.ts.map +1 -1
  6. package/node_modules/@pierre/diffs/dist/components/CodeView.js +202 -105
  7. package/node_modules/@pierre/diffs/dist/components/CodeView.js.map +1 -1
  8. package/node_modules/@pierre/diffs/dist/components/File.d.ts +2 -0
  9. package/node_modules/@pierre/diffs/dist/components/File.d.ts.map +1 -1
  10. package/node_modules/@pierre/diffs/dist/components/File.js +13 -9
  11. package/node_modules/@pierre/diffs/dist/components/File.js.map +1 -1
  12. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts +2 -0
  13. package/node_modules/@pierre/diffs/dist/components/FileDiff.d.ts.map +1 -1
  14. package/node_modules/@pierre/diffs/dist/components/FileDiff.js +12 -6
  15. package/node_modules/@pierre/diffs/dist/components/FileDiff.js.map +1 -1
  16. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts +4 -2
  17. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.d.ts.map +1 -1
  18. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js +23 -6
  19. package/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js.map +1 -1
  20. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts +9 -8
  21. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  22. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js +329 -142
  23. package/node_modules/@pierre/diffs/dist/components/VirtualizedFileDiff.js.map +1 -1
  24. package/node_modules/@pierre/diffs/dist/constants.d.ts.map +1 -1
  25. package/node_modules/@pierre/diffs/dist/index.d.ts +2 -2
  26. package/node_modules/@pierre/diffs/dist/index.js +3 -3
  27. package/node_modules/@pierre/diffs/dist/react/index.d.ts +2 -2
  28. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts +1 -0
  29. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
  30. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +12 -5
  31. package/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js.map +1 -1
  32. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts +1 -0
  33. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.d.ts.map +1 -1
  34. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +4 -1
  35. package/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js.map +1 -1
  36. package/node_modules/@pierre/diffs/dist/ssr/index.d.ts +2 -2
  37. package/node_modules/@pierre/diffs/dist/types.d.ts +7 -1
  38. package/node_modules/@pierre/diffs/dist/types.d.ts.map +1 -1
  39. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts +28 -0
  40. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.d.ts.map +1 -0
  41. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.js +111 -0
  42. package/node_modules/@pierre/diffs/dist/utils/computeEstimatedDiffHeights.js.map +1 -0
  43. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts +8 -0
  44. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.d.ts.map +1 -0
  45. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js +31 -0
  46. package/node_modules/@pierre/diffs/dist/utils/getDiffHunksRendererOptions.js.map +1 -0
  47. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts +8 -0
  48. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.d.ts.map +1 -0
  49. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js +24 -0
  50. package/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js.map +1 -0
  51. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js +29 -30
  52. package/node_modules/@pierre/diffs/dist/utils/iterateOverDiff.js.map +1 -1
  53. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +8 -1
  54. package/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js.map +1 -1
  55. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts +65 -0
  56. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.d.ts.map +1 -0
  57. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js +94 -0
  58. package/node_modules/@pierre/diffs/dist/utils/virtualDiffLayout.js.map +1 -0
  59. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts +4 -1
  60. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.d.ts.map +1 -1
  61. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js +49 -24
  62. package/node_modules/@pierre/diffs/dist/worker/WorkerPoolManager.js.map +1 -1
  63. package/node_modules/@pierre/diffs/dist/worker/types.d.ts +2 -0
  64. package/node_modules/@pierre/diffs/dist/worker/types.d.ts.map +1 -1
  65. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js +163 -40
  66. package/node_modules/@pierre/diffs/dist/worker/worker-portable.js.map +1 -1
  67. package/node_modules/@pierre/diffs/dist/worker/worker.js +60 -30
  68. package/node_modules/@pierre/diffs/dist/worker/worker.js.map +1 -1
  69. package/node_modules/@pierre/diffs/package.json +1 -1
  70. package/node_modules/@shikijs/core/node_modules/@shikijs/types/LICENSE +22 -0
  71. package/node_modules/@shikijs/core/node_modules/@shikijs/types/README.md +7 -0
  72. package/node_modules/@shikijs/core/node_modules/@shikijs/types/dist/index.d.mts +885 -0
  73. package/node_modules/@shikijs/core/node_modules/@shikijs/types/dist/index.mjs +8 -0
  74. package/node_modules/@shikijs/core/node_modules/@shikijs/types/package.json +36 -0
  75. package/node_modules/@shikijs/engine-javascript/node_modules/@shikijs/types/LICENSE +22 -0
  76. package/node_modules/@shikijs/engine-javascript/node_modules/@shikijs/types/README.md +7 -0
  77. package/node_modules/@shikijs/engine-javascript/node_modules/@shikijs/types/dist/index.d.mts +885 -0
  78. package/node_modules/@shikijs/engine-javascript/node_modules/@shikijs/types/dist/index.mjs +8 -0
  79. package/node_modules/@shikijs/engine-javascript/node_modules/@shikijs/types/package.json +36 -0
  80. package/node_modules/@shikijs/engine-oniguruma/node_modules/@shikijs/types/LICENSE +22 -0
  81. package/node_modules/@shikijs/engine-oniguruma/node_modules/@shikijs/types/README.md +7 -0
  82. package/node_modules/@shikijs/engine-oniguruma/node_modules/@shikijs/types/dist/index.d.mts +885 -0
  83. package/node_modules/@shikijs/engine-oniguruma/node_modules/@shikijs/types/dist/index.mjs +8 -0
  84. package/node_modules/@shikijs/engine-oniguruma/node_modules/@shikijs/types/package.json +36 -0
  85. package/node_modules/@shikijs/langs/dist/apex.mjs +1 -1
  86. package/node_modules/@shikijs/langs/dist/bird2.mjs +1 -1
  87. package/node_modules/@shikijs/langs/dist/c3.mjs +1 -1
  88. package/node_modules/@shikijs/langs/dist/cobol.mjs +1 -1
  89. package/node_modules/@shikijs/langs/dist/csharp.mjs +1 -1
  90. package/node_modules/@shikijs/langs/dist/css.mjs +1 -1
  91. package/node_modules/@shikijs/langs/dist/dart.mjs +1 -1
  92. package/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +1 -1
  93. package/node_modules/@shikijs/langs/dist/es-tag-sql.mjs +1 -1
  94. package/node_modules/@shikijs/langs/dist/go.mjs +1 -1
  95. package/node_modules/@shikijs/langs/dist/hack.mjs +1 -1
  96. package/node_modules/@shikijs/langs/dist/julia.mjs +1 -1
  97. package/node_modules/@shikijs/langs/dist/just.mjs +1 -1
  98. package/node_modules/@shikijs/langs/dist/kusto.mjs +1 -1
  99. package/node_modules/@shikijs/langs/dist/latex.mjs +1 -1
  100. package/node_modules/@shikijs/langs/dist/luau.mjs +1 -1
  101. package/node_modules/@shikijs/langs/dist/nextflow-groovy.mjs +1 -1
  102. package/node_modules/@shikijs/langs/dist/php.mjs +1 -1
  103. package/node_modules/@shikijs/langs/dist/ruby.mjs +1 -1
  104. package/node_modules/@shikijs/langs/dist/sql.mjs +1 -1
  105. package/node_modules/@shikijs/langs/dist/typespec.mjs +1 -1
  106. package/node_modules/@shikijs/langs/package.json +6 -3
  107. package/node_modules/@shikijs/themes/node_modules/@shikijs/types/LICENSE +22 -0
  108. package/node_modules/@shikijs/themes/node_modules/@shikijs/types/README.md +7 -0
  109. package/node_modules/@shikijs/themes/node_modules/@shikijs/types/dist/index.d.mts +885 -0
  110. package/node_modules/@shikijs/themes/node_modules/@shikijs/types/dist/index.mjs +8 -0
  111. package/node_modules/@shikijs/themes/node_modules/@shikijs/types/package.json +36 -0
  112. package/node_modules/@shikijs/transformers/node_modules/@shikijs/types/LICENSE +22 -0
  113. package/node_modules/@shikijs/transformers/node_modules/@shikijs/types/README.md +7 -0
  114. package/node_modules/@shikijs/transformers/node_modules/@shikijs/types/dist/index.d.mts +885 -0
  115. package/node_modules/@shikijs/transformers/node_modules/@shikijs/types/dist/index.mjs +8 -0
  116. package/node_modules/@shikijs/transformers/node_modules/@shikijs/types/package.json +36 -0
  117. package/node_modules/@shikijs/types/dist/index.d.mts +686 -684
  118. package/node_modules/@shikijs/types/dist/index.mjs +8 -7
  119. package/node_modules/@shikijs/types/package.json +6 -3
  120. package/node_modules/diff/CONTRIBUTING.md +1 -1
  121. package/node_modules/diff/dist/diff.js +32 -73
  122. package/node_modules/diff/dist/diff.min.js +1 -1
  123. package/node_modules/diff/libcjs/diff/word.d.ts.map +1 -1
  124. package/node_modules/diff/libcjs/diff/word.js +31 -15
  125. package/node_modules/diff/libcjs/util/string.d.ts +2 -14
  126. package/node_modules/diff/libcjs/util/string.d.ts.map +1 -1
  127. package/node_modules/diff/libcjs/util/string.js +2 -61
  128. package/node_modules/diff/libesm/diff/word.d.ts.map +1 -1
  129. package/node_modules/diff/libesm/diff/word.js +31 -16
  130. package/node_modules/diff/libesm/util/string.d.ts +2 -14
  131. package/node_modules/diff/libesm/util/string.d.ts.map +1 -1
  132. package/node_modules/diff/libesm/util/string.js +2 -58
  133. package/node_modules/diff/package.json +24 -22
  134. package/node_modules/diff/release-notes.md +0 -28
  135. package/node_modules/shiki/node_modules/@shikijs/langs/LICENSE +22 -0
  136. package/node_modules/shiki/node_modules/@shikijs/langs/README.md +7 -0
  137. package/node_modules/shiki/node_modules/@shikijs/langs/dist/1c-query.d.mts +3 -0
  138. package/node_modules/shiki/node_modules/@shikijs/langs/dist/1c-query.mjs +2 -0
  139. package/node_modules/shiki/node_modules/@shikijs/langs/dist/1c.d.mts +3 -0
  140. package/node_modules/shiki/node_modules/@shikijs/langs/dist/1c.mjs +2 -0
  141. package/node_modules/shiki/node_modules/@shikijs/langs/dist/abap.d.mts +3 -0
  142. package/node_modules/shiki/node_modules/@shikijs/langs/dist/abap.mjs +5 -0
  143. package/node_modules/shiki/node_modules/@shikijs/langs/dist/actionscript-3.d.mts +3 -0
  144. package/node_modules/shiki/node_modules/@shikijs/langs/dist/actionscript-3.mjs +5 -0
  145. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ada.d.mts +3 -0
  146. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ada.mjs +5 -0
  147. package/node_modules/shiki/node_modules/@shikijs/langs/dist/adoc.d.mts +3 -0
  148. package/node_modules/shiki/node_modules/@shikijs/langs/dist/adoc.mjs +2 -0
  149. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-expression.d.mts +3 -0
  150. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-expression.mjs +5 -0
  151. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-html.d.mts +3 -0
  152. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-html.mjs +16 -0
  153. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-inline-style.d.mts +3 -0
  154. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-inline-style.mjs +8 -0
  155. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-inline-template.d.mts +3 -0
  156. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-inline-template.mjs +10 -0
  157. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-let-declaration.d.mts +3 -0
  158. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-let-declaration.mjs +8 -0
  159. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-template-blocks.d.mts +3 -0
  160. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-template-blocks.mjs +10 -0
  161. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-template.d.mts +3 -0
  162. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-template.mjs +8 -0
  163. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-ts.d.mts +3 -0
  164. package/node_modules/shiki/node_modules/@shikijs/langs/dist/angular-ts.mjs +18 -0
  165. package/node_modules/shiki/node_modules/@shikijs/langs/dist/apache.d.mts +3 -0
  166. package/node_modules/shiki/node_modules/@shikijs/langs/dist/apache.mjs +5 -0
  167. package/node_modules/shiki/node_modules/@shikijs/langs/dist/apex.d.mts +3 -0
  168. package/node_modules/shiki/node_modules/@shikijs/langs/dist/apex.mjs +5 -0
  169. package/node_modules/shiki/node_modules/@shikijs/langs/dist/apl.d.mts +3 -0
  170. package/node_modules/shiki/node_modules/@shikijs/langs/dist/apl.mjs +16 -0
  171. package/node_modules/shiki/node_modules/@shikijs/langs/dist/applescript.d.mts +3 -0
  172. package/node_modules/shiki/node_modules/@shikijs/langs/dist/applescript.mjs +5 -0
  173. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ara.d.mts +3 -0
  174. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ara.mjs +5 -0
  175. package/node_modules/shiki/node_modules/@shikijs/langs/dist/asciidoc.d.mts +3 -0
  176. package/node_modules/shiki/node_modules/@shikijs/langs/dist/asciidoc.mjs +5 -0
  177. package/node_modules/shiki/node_modules/@shikijs/langs/dist/asm.d.mts +3 -0
  178. package/node_modules/shiki/node_modules/@shikijs/langs/dist/asm.mjs +5 -0
  179. package/node_modules/shiki/node_modules/@shikijs/langs/dist/astro.d.mts +3 -0
  180. package/node_modules/shiki/node_modules/@shikijs/langs/dist/astro.mjs +18 -0
  181. package/node_modules/shiki/node_modules/@shikijs/langs/dist/awk.d.mts +3 -0
  182. package/node_modules/shiki/node_modules/@shikijs/langs/dist/awk.mjs +5 -0
  183. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ballerina.d.mts +3 -0
  184. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ballerina.mjs +5 -0
  185. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bash.d.mts +3 -0
  186. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bash.mjs +2 -0
  187. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bat.d.mts +3 -0
  188. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bat.mjs +5 -0
  189. package/node_modules/shiki/node_modules/@shikijs/langs/dist/batch.d.mts +3 -0
  190. package/node_modules/shiki/node_modules/@shikijs/langs/dist/batch.mjs +2 -0
  191. package/node_modules/shiki/node_modules/@shikijs/langs/dist/be.d.mts +3 -0
  192. package/node_modules/shiki/node_modules/@shikijs/langs/dist/be.mjs +2 -0
  193. package/node_modules/shiki/node_modules/@shikijs/langs/dist/beancount.d.mts +3 -0
  194. package/node_modules/shiki/node_modules/@shikijs/langs/dist/beancount.mjs +5 -0
  195. package/node_modules/shiki/node_modules/@shikijs/langs/dist/berry.d.mts +3 -0
  196. package/node_modules/shiki/node_modules/@shikijs/langs/dist/berry.mjs +5 -0
  197. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bibtex.d.mts +3 -0
  198. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bibtex.mjs +5 -0
  199. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bicep.d.mts +3 -0
  200. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bicep.mjs +5 -0
  201. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bird.d.mts +3 -0
  202. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bird.mjs +2 -0
  203. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bird2.d.mts +3 -0
  204. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bird2.mjs +5 -0
  205. package/node_modules/shiki/node_modules/@shikijs/langs/dist/blade.d.mts +3 -0
  206. package/node_modules/shiki/node_modules/@shikijs/langs/dist/blade.mjs +20 -0
  207. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bsl.d.mts +3 -0
  208. package/node_modules/shiki/node_modules/@shikijs/langs/dist/bsl.mjs +8 -0
  209. package/node_modules/shiki/node_modules/@shikijs/langs/dist/c.d.mts +3 -0
  210. package/node_modules/shiki/node_modules/@shikijs/langs/dist/c.mjs +5 -0
  211. package/node_modules/shiki/node_modules/@shikijs/langs/dist/c3.d.mts +3 -0
  212. package/node_modules/shiki/node_modules/@shikijs/langs/dist/c3.mjs +5 -0
  213. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cadence.d.mts +3 -0
  214. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cadence.mjs +5 -0
  215. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cairo.d.mts +3 -0
  216. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cairo.mjs +8 -0
  217. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cdc.d.mts +3 -0
  218. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cdc.mjs +2 -0
  219. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cjs.d.mts +3 -0
  220. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cjs.mjs +2 -0
  221. package/node_modules/shiki/node_modules/@shikijs/langs/dist/clarity.d.mts +3 -0
  222. package/node_modules/shiki/node_modules/@shikijs/langs/dist/clarity.mjs +5 -0
  223. package/node_modules/shiki/node_modules/@shikijs/langs/dist/clj.d.mts +3 -0
  224. package/node_modules/shiki/node_modules/@shikijs/langs/dist/clj.mjs +2 -0
  225. package/node_modules/shiki/node_modules/@shikijs/langs/dist/clojure.d.mts +3 -0
  226. package/node_modules/shiki/node_modules/@shikijs/langs/dist/clojure.mjs +5 -0
  227. package/node_modules/shiki/node_modules/@shikijs/langs/dist/closure-templates.d.mts +3 -0
  228. package/node_modules/shiki/node_modules/@shikijs/langs/dist/closure-templates.mjs +2 -0
  229. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cmake.d.mts +3 -0
  230. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cmake.mjs +5 -0
  231. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cmd.d.mts +3 -0
  232. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cmd.mjs +2 -0
  233. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cobol.d.mts +3 -0
  234. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cobol.mjs +10 -0
  235. package/node_modules/shiki/node_modules/@shikijs/langs/dist/codeowners.d.mts +3 -0
  236. package/node_modules/shiki/node_modules/@shikijs/langs/dist/codeowners.mjs +5 -0
  237. package/node_modules/shiki/node_modules/@shikijs/langs/dist/codeql.d.mts +3 -0
  238. package/node_modules/shiki/node_modules/@shikijs/langs/dist/codeql.mjs +5 -0
  239. package/node_modules/shiki/node_modules/@shikijs/langs/dist/coffee.d.mts +3 -0
  240. package/node_modules/shiki/node_modules/@shikijs/langs/dist/coffee.mjs +8 -0
  241. package/node_modules/shiki/node_modules/@shikijs/langs/dist/coffeescript.d.mts +3 -0
  242. package/node_modules/shiki/node_modules/@shikijs/langs/dist/coffeescript.mjs +2 -0
  243. package/node_modules/shiki/node_modules/@shikijs/langs/dist/common-lisp.d.mts +3 -0
  244. package/node_modules/shiki/node_modules/@shikijs/langs/dist/common-lisp.mjs +5 -0
  245. package/node_modules/shiki/node_modules/@shikijs/langs/dist/console.d.mts +3 -0
  246. package/node_modules/shiki/node_modules/@shikijs/langs/dist/console.mjs +2 -0
  247. package/node_modules/shiki/node_modules/@shikijs/langs/dist/coq.d.mts +3 -0
  248. package/node_modules/shiki/node_modules/@shikijs/langs/dist/coq.mjs +5 -0
  249. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cpp-macro.d.mts +3 -0
  250. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cpp-macro.mjs +12 -0
  251. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cpp.d.mts +3 -0
  252. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cpp.mjs +14 -0
  253. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cql.d.mts +3 -0
  254. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cql.mjs +2 -0
  255. package/node_modules/shiki/node_modules/@shikijs/langs/dist/crystal.d.mts +3 -0
  256. package/node_modules/shiki/node_modules/@shikijs/langs/dist/crystal.mjs +18 -0
  257. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cs.d.mts +3 -0
  258. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cs.mjs +2 -0
  259. package/node_modules/shiki/node_modules/@shikijs/langs/dist/csharp.d.mts +3 -0
  260. package/node_modules/shiki/node_modules/@shikijs/langs/dist/csharp.mjs +5 -0
  261. package/node_modules/shiki/node_modules/@shikijs/langs/dist/css.d.mts +3 -0
  262. package/node_modules/shiki/node_modules/@shikijs/langs/dist/css.mjs +5 -0
  263. package/node_modules/shiki/node_modules/@shikijs/langs/dist/csv.d.mts +3 -0
  264. package/node_modules/shiki/node_modules/@shikijs/langs/dist/csv.mjs +5 -0
  265. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cts.d.mts +3 -0
  266. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cts.mjs +2 -0
  267. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cue.d.mts +3 -0
  268. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cue.mjs +5 -0
  269. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cypher.d.mts +3 -0
  270. package/node_modules/shiki/node_modules/@shikijs/langs/dist/cypher.mjs +5 -0
  271. package/node_modules/shiki/node_modules/@shikijs/langs/dist/d.d.mts +3 -0
  272. package/node_modules/shiki/node_modules/@shikijs/langs/dist/d.mjs +5 -0
  273. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dart.d.mts +3 -0
  274. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dart.mjs +5 -0
  275. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dax.d.mts +3 -0
  276. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dax.mjs +5 -0
  277. package/node_modules/shiki/node_modules/@shikijs/langs/dist/desktop.d.mts +3 -0
  278. package/node_modules/shiki/node_modules/@shikijs/langs/dist/desktop.mjs +5 -0
  279. package/node_modules/shiki/node_modules/@shikijs/langs/dist/diff.d.mts +3 -0
  280. package/node_modules/shiki/node_modules/@shikijs/langs/dist/diff.mjs +5 -0
  281. package/node_modules/shiki/node_modules/@shikijs/langs/dist/docker.d.mts +3 -0
  282. package/node_modules/shiki/node_modules/@shikijs/langs/dist/docker.mjs +5 -0
  283. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dockerfile.d.mts +3 -0
  284. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dockerfile.mjs +2 -0
  285. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dotenv.d.mts +3 -0
  286. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dotenv.mjs +5 -0
  287. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dream-maker.d.mts +3 -0
  288. package/node_modules/shiki/node_modules/@shikijs/langs/dist/dream-maker.mjs +5 -0
  289. package/node_modules/shiki/node_modules/@shikijs/langs/dist/edge.d.mts +3 -0
  290. package/node_modules/shiki/node_modules/@shikijs/langs/dist/edge.mjs +12 -0
  291. package/node_modules/shiki/node_modules/@shikijs/langs/dist/elisp.d.mts +3 -0
  292. package/node_modules/shiki/node_modules/@shikijs/langs/dist/elisp.mjs +2 -0
  293. package/node_modules/shiki/node_modules/@shikijs/langs/dist/elixir.d.mts +3 -0
  294. package/node_modules/shiki/node_modules/@shikijs/langs/dist/elixir.mjs +8 -0
  295. package/node_modules/shiki/node_modules/@shikijs/langs/dist/elm.d.mts +3 -0
  296. package/node_modules/shiki/node_modules/@shikijs/langs/dist/elm.mjs +8 -0
  297. package/node_modules/shiki/node_modules/@shikijs/langs/dist/emacs-lisp.d.mts +3 -0
  298. package/node_modules/shiki/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +5 -0
  299. package/node_modules/shiki/node_modules/@shikijs/langs/dist/erb.d.mts +3 -0
  300. package/node_modules/shiki/node_modules/@shikijs/langs/dist/erb.mjs +10 -0
  301. package/node_modules/shiki/node_modules/@shikijs/langs/dist/erl.d.mts +3 -0
  302. package/node_modules/shiki/node_modules/@shikijs/langs/dist/erl.mjs +2 -0
  303. package/node_modules/shiki/node_modules/@shikijs/langs/dist/erlang.d.mts +3 -0
  304. package/node_modules/shiki/node_modules/@shikijs/langs/dist/erlang.mjs +8 -0
  305. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-css.d.mts +3 -0
  306. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-css.mjs +12 -0
  307. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-glsl.d.mts +3 -0
  308. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-glsl.mjs +12 -0
  309. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-html.d.mts +3 -0
  310. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-html.mjs +12 -0
  311. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-sql.d.mts +3 -0
  312. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-sql.mjs +10 -0
  313. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-xml.d.mts +3 -0
  314. package/node_modules/shiki/node_modules/@shikijs/langs/dist/es-tag-xml.mjs +8 -0
  315. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f.d.mts +3 -0
  316. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f.mjs +2 -0
  317. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f03.d.mts +3 -0
  318. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f03.mjs +2 -0
  319. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f08.d.mts +3 -0
  320. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f08.mjs +2 -0
  321. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f18.d.mts +3 -0
  322. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f18.mjs +2 -0
  323. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f77.d.mts +3 -0
  324. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f77.mjs +2 -0
  325. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f90.d.mts +3 -0
  326. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f90.mjs +2 -0
  327. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f95.d.mts +3 -0
  328. package/node_modules/shiki/node_modules/@shikijs/langs/dist/f95.mjs +2 -0
  329. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fennel.d.mts +3 -0
  330. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fennel.mjs +5 -0
  331. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fish.d.mts +3 -0
  332. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fish.mjs +5 -0
  333. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fluent.d.mts +3 -0
  334. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fluent.mjs +5 -0
  335. package/node_modules/shiki/node_modules/@shikijs/langs/dist/for.d.mts +3 -0
  336. package/node_modules/shiki/node_modules/@shikijs/langs/dist/for.mjs +2 -0
  337. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fortran-fixed-form.d.mts +3 -0
  338. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fortran-fixed-form.mjs +8 -0
  339. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fortran-free-form.d.mts +3 -0
  340. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fortran-free-form.mjs +5 -0
  341. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fs.d.mts +3 -0
  342. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fs.mjs +2 -0
  343. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fsharp.d.mts +3 -0
  344. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fsharp.mjs +8 -0
  345. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fsl.d.mts +3 -0
  346. package/node_modules/shiki/node_modules/@shikijs/langs/dist/fsl.mjs +2 -0
  347. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ftl.d.mts +3 -0
  348. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ftl.mjs +2 -0
  349. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gd.d.mts +3 -0
  350. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gd.mjs +2 -0
  351. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gdresource.d.mts +3 -0
  352. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gdresource.mjs +10 -0
  353. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gdscript.d.mts +3 -0
  354. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gdscript.mjs +5 -0
  355. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gdshader.d.mts +3 -0
  356. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gdshader.mjs +5 -0
  357. package/node_modules/shiki/node_modules/@shikijs/langs/dist/genie.d.mts +3 -0
  358. package/node_modules/shiki/node_modules/@shikijs/langs/dist/genie.mjs +5 -0
  359. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gherkin.d.mts +3 -0
  360. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gherkin.mjs +5 -0
  361. package/node_modules/shiki/node_modules/@shikijs/langs/dist/git-commit.d.mts +3 -0
  362. package/node_modules/shiki/node_modules/@shikijs/langs/dist/git-commit.mjs +8 -0
  363. package/node_modules/shiki/node_modules/@shikijs/langs/dist/git-rebase.d.mts +3 -0
  364. package/node_modules/shiki/node_modules/@shikijs/langs/dist/git-rebase.mjs +8 -0
  365. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gjs.d.mts +3 -0
  366. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gjs.mjs +2 -0
  367. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gleam.d.mts +3 -0
  368. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gleam.mjs +5 -0
  369. package/node_modules/shiki/node_modules/@shikijs/langs/dist/glimmer-js.d.mts +3 -0
  370. package/node_modules/shiki/node_modules/@shikijs/langs/dist/glimmer-js.mjs +14 -0
  371. package/node_modules/shiki/node_modules/@shikijs/langs/dist/glimmer-ts.d.mts +3 -0
  372. package/node_modules/shiki/node_modules/@shikijs/langs/dist/glimmer-ts.mjs +14 -0
  373. package/node_modules/shiki/node_modules/@shikijs/langs/dist/glsl.d.mts +3 -0
  374. package/node_modules/shiki/node_modules/@shikijs/langs/dist/glsl.mjs +8 -0
  375. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gn.d.mts +3 -0
  376. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gn.mjs +5 -0
  377. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gnuplot.d.mts +3 -0
  378. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gnuplot.mjs +5 -0
  379. package/node_modules/shiki/node_modules/@shikijs/langs/dist/go.d.mts +3 -0
  380. package/node_modules/shiki/node_modules/@shikijs/langs/dist/go.mjs +5 -0
  381. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gql.d.mts +3 -0
  382. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gql.mjs +2 -0
  383. package/node_modules/shiki/node_modules/@shikijs/langs/dist/graphql.d.mts +3 -0
  384. package/node_modules/shiki/node_modules/@shikijs/langs/dist/graphql.mjs +14 -0
  385. package/node_modules/shiki/node_modules/@shikijs/langs/dist/groovy.d.mts +3 -0
  386. package/node_modules/shiki/node_modules/@shikijs/langs/dist/groovy.mjs +5 -0
  387. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gts.d.mts +3 -0
  388. package/node_modules/shiki/node_modules/@shikijs/langs/dist/gts.mjs +2 -0
  389. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hack.d.mts +3 -0
  390. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hack.mjs +10 -0
  391. package/node_modules/shiki/node_modules/@shikijs/langs/dist/haml.d.mts +3 -0
  392. package/node_modules/shiki/node_modules/@shikijs/langs/dist/haml.mjs +10 -0
  393. package/node_modules/shiki/node_modules/@shikijs/langs/dist/handlebars.d.mts +3 -0
  394. package/node_modules/shiki/node_modules/@shikijs/langs/dist/handlebars.mjs +14 -0
  395. package/node_modules/shiki/node_modules/@shikijs/langs/dist/haskell.d.mts +3 -0
  396. package/node_modules/shiki/node_modules/@shikijs/langs/dist/haskell.mjs +5 -0
  397. package/node_modules/shiki/node_modules/@shikijs/langs/dist/haxe.d.mts +3 -0
  398. package/node_modules/shiki/node_modules/@shikijs/langs/dist/haxe.mjs +5 -0
  399. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hbs.d.mts +3 -0
  400. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hbs.mjs +2 -0
  401. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hcl.d.mts +3 -0
  402. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hcl.mjs +5 -0
  403. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hjson.d.mts +3 -0
  404. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hjson.mjs +5 -0
  405. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hlsl.d.mts +3 -0
  406. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hlsl.mjs +5 -0
  407. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hs.d.mts +3 -0
  408. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hs.mjs +2 -0
  409. package/node_modules/shiki/node_modules/@shikijs/langs/dist/html-derivative.d.mts +3 -0
  410. package/node_modules/shiki/node_modules/@shikijs/langs/dist/html-derivative.mjs +8 -0
  411. package/node_modules/shiki/node_modules/@shikijs/langs/dist/html.d.mts +3 -0
  412. package/node_modules/shiki/node_modules/@shikijs/langs/dist/html.mjs +10 -0
  413. package/node_modules/shiki/node_modules/@shikijs/langs/dist/http.d.mts +3 -0
  414. package/node_modules/shiki/node_modules/@shikijs/langs/dist/http.mjs +14 -0
  415. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hurl.d.mts +3 -0
  416. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hurl.mjs +12 -0
  417. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hxml.d.mts +3 -0
  418. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hxml.mjs +8 -0
  419. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hy.d.mts +3 -0
  420. package/node_modules/shiki/node_modules/@shikijs/langs/dist/hy.mjs +5 -0
  421. package/node_modules/shiki/node_modules/@shikijs/langs/dist/imba.d.mts +3 -0
  422. package/node_modules/shiki/node_modules/@shikijs/langs/dist/imba.mjs +5 -0
  423. package/node_modules/shiki/node_modules/@shikijs/langs/dist/index.d.mts +3 -0
  424. package/node_modules/shiki/node_modules/@shikijs/langs/dist/index.mjs +353 -0
  425. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ini.d.mts +3 -0
  426. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ini.mjs +5 -0
  427. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jade.d.mts +3 -0
  428. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jade.mjs +2 -0
  429. package/node_modules/shiki/node_modules/@shikijs/langs/dist/java.d.mts +3 -0
  430. package/node_modules/shiki/node_modules/@shikijs/langs/dist/java.mjs +5 -0
  431. package/node_modules/shiki/node_modules/@shikijs/langs/dist/javascript.d.mts +3 -0
  432. package/node_modules/shiki/node_modules/@shikijs/langs/dist/javascript.mjs +5 -0
  433. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jinja-html.d.mts +3 -0
  434. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jinja-html.mjs +8 -0
  435. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jinja.d.mts +3 -0
  436. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jinja.mjs +8 -0
  437. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jison.d.mts +3 -0
  438. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jison.mjs +8 -0
  439. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jl.d.mts +3 -0
  440. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jl.mjs +2 -0
  441. package/node_modules/shiki/node_modules/@shikijs/langs/dist/js.d.mts +3 -0
  442. package/node_modules/shiki/node_modules/@shikijs/langs/dist/js.mjs +2 -0
  443. package/node_modules/shiki/node_modules/@shikijs/langs/dist/json.d.mts +3 -0
  444. package/node_modules/shiki/node_modules/@shikijs/langs/dist/json.mjs +5 -0
  445. package/node_modules/shiki/node_modules/@shikijs/langs/dist/json5.d.mts +3 -0
  446. package/node_modules/shiki/node_modules/@shikijs/langs/dist/json5.mjs +5 -0
  447. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsonc.d.mts +3 -0
  448. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsonc.mjs +5 -0
  449. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsonl.d.mts +3 -0
  450. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsonl.mjs +5 -0
  451. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsonnet.d.mts +3 -0
  452. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsonnet.mjs +5 -0
  453. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jssm.d.mts +3 -0
  454. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jssm.mjs +5 -0
  455. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsx.d.mts +3 -0
  456. package/node_modules/shiki/node_modules/@shikijs/langs/dist/jsx.mjs +5 -0
  457. package/node_modules/shiki/node_modules/@shikijs/langs/dist/julia.d.mts +3 -0
  458. package/node_modules/shiki/node_modules/@shikijs/langs/dist/julia.mjs +16 -0
  459. package/node_modules/shiki/node_modules/@shikijs/langs/dist/just.d.mts +3 -0
  460. package/node_modules/shiki/node_modules/@shikijs/langs/dist/just.mjs +18 -0
  461. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kdl.d.mts +3 -0
  462. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kdl.mjs +5 -0
  463. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kotlin.d.mts +3 -0
  464. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kotlin.mjs +5 -0
  465. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kql.d.mts +3 -0
  466. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kql.mjs +2 -0
  467. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kt.d.mts +3 -0
  468. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kt.mjs +2 -0
  469. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kts.d.mts +3 -0
  470. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kts.mjs +2 -0
  471. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kusto.d.mts +3 -0
  472. package/node_modules/shiki/node_modules/@shikijs/langs/dist/kusto.mjs +5 -0
  473. package/node_modules/shiki/node_modules/@shikijs/langs/dist/latex.d.mts +3 -0
  474. package/node_modules/shiki/node_modules/@shikijs/langs/dist/latex.mjs +8 -0
  475. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lean.d.mts +3 -0
  476. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lean.mjs +5 -0
  477. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lean4.d.mts +3 -0
  478. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lean4.mjs +2 -0
  479. package/node_modules/shiki/node_modules/@shikijs/langs/dist/less.d.mts +3 -0
  480. package/node_modules/shiki/node_modules/@shikijs/langs/dist/less.mjs +5 -0
  481. package/node_modules/shiki/node_modules/@shikijs/langs/dist/liquid.d.mts +3 -0
  482. package/node_modules/shiki/node_modules/@shikijs/langs/dist/liquid.mjs +14 -0
  483. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lisp.d.mts +3 -0
  484. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lisp.mjs +2 -0
  485. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lit.d.mts +3 -0
  486. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lit.mjs +2 -0
  487. package/node_modules/shiki/node_modules/@shikijs/langs/dist/llvm.d.mts +3 -0
  488. package/node_modules/shiki/node_modules/@shikijs/langs/dist/llvm.mjs +5 -0
  489. package/node_modules/shiki/node_modules/@shikijs/langs/dist/log.d.mts +3 -0
  490. package/node_modules/shiki/node_modules/@shikijs/langs/dist/log.mjs +5 -0
  491. package/node_modules/shiki/node_modules/@shikijs/langs/dist/logo.d.mts +3 -0
  492. package/node_modules/shiki/node_modules/@shikijs/langs/dist/logo.mjs +5 -0
  493. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lua.d.mts +3 -0
  494. package/node_modules/shiki/node_modules/@shikijs/langs/dist/lua.mjs +8 -0
  495. package/node_modules/shiki/node_modules/@shikijs/langs/dist/luau.d.mts +3 -0
  496. package/node_modules/shiki/node_modules/@shikijs/langs/dist/luau.mjs +5 -0
  497. package/node_modules/shiki/node_modules/@shikijs/langs/dist/make.d.mts +3 -0
  498. package/node_modules/shiki/node_modules/@shikijs/langs/dist/make.mjs +5 -0
  499. package/node_modules/shiki/node_modules/@shikijs/langs/dist/makefile.d.mts +3 -0
  500. package/node_modules/shiki/node_modules/@shikijs/langs/dist/makefile.mjs +2 -0
  501. package/node_modules/shiki/node_modules/@shikijs/langs/dist/markdown-nix.d.mts +3 -0
  502. package/node_modules/shiki/node_modules/@shikijs/langs/dist/markdown-nix.mjs +5 -0
  503. package/node_modules/shiki/node_modules/@shikijs/langs/dist/markdown-vue.d.mts +3 -0
  504. package/node_modules/shiki/node_modules/@shikijs/langs/dist/markdown-vue.mjs +5 -0
  505. package/node_modules/shiki/node_modules/@shikijs/langs/dist/markdown.d.mts +3 -0
  506. package/node_modules/shiki/node_modules/@shikijs/langs/dist/markdown.mjs +5 -0
  507. package/node_modules/shiki/node_modules/@shikijs/langs/dist/marko.d.mts +3 -0
  508. package/node_modules/shiki/node_modules/@shikijs/langs/dist/marko.mjs +14 -0
  509. package/node_modules/shiki/node_modules/@shikijs/langs/dist/matlab.d.mts +3 -0
  510. package/node_modules/shiki/node_modules/@shikijs/langs/dist/matlab.mjs +5 -0
  511. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mbt.d.mts +3 -0
  512. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mbt.mjs +2 -0
  513. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mbti.d.mts +3 -0
  514. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mbti.mjs +2 -0
  515. package/node_modules/shiki/node_modules/@shikijs/langs/dist/md.d.mts +3 -0
  516. package/node_modules/shiki/node_modules/@shikijs/langs/dist/md.mjs +2 -0
  517. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mdc.d.mts +3 -0
  518. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mdc.mjs +12 -0
  519. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mdx.d.mts +3 -0
  520. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mdx.mjs +5 -0
  521. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mediawiki.d.mts +3 -0
  522. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mediawiki.mjs +2 -0
  523. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mermaid.d.mts +3 -0
  524. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mermaid.mjs +5 -0
  525. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mips.d.mts +3 -0
  526. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mips.mjs +2 -0
  527. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mipsasm.d.mts +3 -0
  528. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mipsasm.mjs +5 -0
  529. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mjs.d.mts +3 -0
  530. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mjs.mjs +2 -0
  531. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mmd.d.mts +3 -0
  532. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mmd.mjs +2 -0
  533. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mojo.d.mts +3 -0
  534. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mojo.mjs +5 -0
  535. package/node_modules/shiki/node_modules/@shikijs/langs/dist/moonbit.d.mts +3 -0
  536. package/node_modules/shiki/node_modules/@shikijs/langs/dist/moonbit.mjs +5 -0
  537. package/node_modules/shiki/node_modules/@shikijs/langs/dist/move.d.mts +3 -0
  538. package/node_modules/shiki/node_modules/@shikijs/langs/dist/move.mjs +5 -0
  539. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mts.d.mts +3 -0
  540. package/node_modules/shiki/node_modules/@shikijs/langs/dist/mts.mjs +2 -0
  541. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nar.d.mts +3 -0
  542. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nar.mjs +2 -0
  543. package/node_modules/shiki/node_modules/@shikijs/langs/dist/narrat.d.mts +3 -0
  544. package/node_modules/shiki/node_modules/@shikijs/langs/dist/narrat.mjs +5 -0
  545. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nextflow-groovy.d.mts +3 -0
  546. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nextflow-groovy.mjs +5 -0
  547. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nextflow.d.mts +3 -0
  548. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nextflow.mjs +8 -0
  549. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nf.d.mts +3 -0
  550. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nf.mjs +2 -0
  551. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nginx.d.mts +3 -0
  552. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nginx.mjs +8 -0
  553. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nim.d.mts +3 -0
  554. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nim.mjs +20 -0
  555. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nix.d.mts +3 -0
  556. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nix.mjs +8 -0
  557. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nu.d.mts +3 -0
  558. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nu.mjs +2 -0
  559. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nushell.d.mts +3 -0
  560. package/node_modules/shiki/node_modules/@shikijs/langs/dist/nushell.mjs +5 -0
  561. package/node_modules/shiki/node_modules/@shikijs/langs/dist/objc.d.mts +3 -0
  562. package/node_modules/shiki/node_modules/@shikijs/langs/dist/objc.mjs +2 -0
  563. package/node_modules/shiki/node_modules/@shikijs/langs/dist/objective-c.d.mts +3 -0
  564. package/node_modules/shiki/node_modules/@shikijs/langs/dist/objective-c.mjs +5 -0
  565. package/node_modules/shiki/node_modules/@shikijs/langs/dist/objective-cpp.d.mts +3 -0
  566. package/node_modules/shiki/node_modules/@shikijs/langs/dist/objective-cpp.mjs +5 -0
  567. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ocaml.d.mts +3 -0
  568. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ocaml.mjs +5 -0
  569. package/node_modules/shiki/node_modules/@shikijs/langs/dist/odin.d.mts +3 -0
  570. package/node_modules/shiki/node_modules/@shikijs/langs/dist/odin.mjs +5 -0
  571. package/node_modules/shiki/node_modules/@shikijs/langs/dist/openscad.d.mts +3 -0
  572. package/node_modules/shiki/node_modules/@shikijs/langs/dist/openscad.mjs +5 -0
  573. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pascal.d.mts +3 -0
  574. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pascal.mjs +5 -0
  575. package/node_modules/shiki/node_modules/@shikijs/langs/dist/perl.d.mts +3 -0
  576. package/node_modules/shiki/node_modules/@shikijs/langs/dist/perl.mjs +16 -0
  577. package/node_modules/shiki/node_modules/@shikijs/langs/dist/perl6.d.mts +3 -0
  578. package/node_modules/shiki/node_modules/@shikijs/langs/dist/perl6.mjs +2 -0
  579. package/node_modules/shiki/node_modules/@shikijs/langs/dist/php.d.mts +3 -0
  580. package/node_modules/shiki/node_modules/@shikijs/langs/dist/php.mjs +18 -0
  581. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pkl.d.mts +3 -0
  582. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pkl.mjs +5 -0
  583. package/node_modules/shiki/node_modules/@shikijs/langs/dist/plsql.d.mts +3 -0
  584. package/node_modules/shiki/node_modules/@shikijs/langs/dist/plsql.mjs +5 -0
  585. package/node_modules/shiki/node_modules/@shikijs/langs/dist/po.d.mts +3 -0
  586. package/node_modules/shiki/node_modules/@shikijs/langs/dist/po.mjs +5 -0
  587. package/node_modules/shiki/node_modules/@shikijs/langs/dist/polar.d.mts +3 -0
  588. package/node_modules/shiki/node_modules/@shikijs/langs/dist/polar.mjs +5 -0
  589. package/node_modules/shiki/node_modules/@shikijs/langs/dist/postcss.d.mts +3 -0
  590. package/node_modules/shiki/node_modules/@shikijs/langs/dist/postcss.mjs +5 -0
  591. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pot.d.mts +3 -0
  592. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pot.mjs +2 -0
  593. package/node_modules/shiki/node_modules/@shikijs/langs/dist/potx.d.mts +3 -0
  594. package/node_modules/shiki/node_modules/@shikijs/langs/dist/potx.mjs +2 -0
  595. package/node_modules/shiki/node_modules/@shikijs/langs/dist/powerquery.d.mts +3 -0
  596. package/node_modules/shiki/node_modules/@shikijs/langs/dist/powerquery.mjs +5 -0
  597. package/node_modules/shiki/node_modules/@shikijs/langs/dist/powershell.d.mts +3 -0
  598. package/node_modules/shiki/node_modules/@shikijs/langs/dist/powershell.mjs +5 -0
  599. package/node_modules/shiki/node_modules/@shikijs/langs/dist/prisma.d.mts +3 -0
  600. package/node_modules/shiki/node_modules/@shikijs/langs/dist/prisma.mjs +5 -0
  601. package/node_modules/shiki/node_modules/@shikijs/langs/dist/prolog.d.mts +3 -0
  602. package/node_modules/shiki/node_modules/@shikijs/langs/dist/prolog.mjs +5 -0
  603. package/node_modules/shiki/node_modules/@shikijs/langs/dist/properties.d.mts +3 -0
  604. package/node_modules/shiki/node_modules/@shikijs/langs/dist/properties.mjs +2 -0
  605. package/node_modules/shiki/node_modules/@shikijs/langs/dist/proto.d.mts +3 -0
  606. package/node_modules/shiki/node_modules/@shikijs/langs/dist/proto.mjs +5 -0
  607. package/node_modules/shiki/node_modules/@shikijs/langs/dist/protobuf.d.mts +3 -0
  608. package/node_modules/shiki/node_modules/@shikijs/langs/dist/protobuf.mjs +2 -0
  609. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ps.d.mts +3 -0
  610. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ps.mjs +2 -0
  611. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ps1.d.mts +3 -0
  612. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ps1.mjs +2 -0
  613. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pug.d.mts +3 -0
  614. package/node_modules/shiki/node_modules/@shikijs/langs/dist/pug.mjs +12 -0
  615. package/node_modules/shiki/node_modules/@shikijs/langs/dist/puppet.d.mts +3 -0
  616. package/node_modules/shiki/node_modules/@shikijs/langs/dist/puppet.mjs +5 -0
  617. package/node_modules/shiki/node_modules/@shikijs/langs/dist/purescript.d.mts +3 -0
  618. package/node_modules/shiki/node_modules/@shikijs/langs/dist/purescript.mjs +5 -0
  619. package/node_modules/shiki/node_modules/@shikijs/langs/dist/py.d.mts +3 -0
  620. package/node_modules/shiki/node_modules/@shikijs/langs/dist/py.mjs +2 -0
  621. package/node_modules/shiki/node_modules/@shikijs/langs/dist/python.d.mts +3 -0
  622. package/node_modules/shiki/node_modules/@shikijs/langs/dist/python.mjs +5 -0
  623. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ql.d.mts +3 -0
  624. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ql.mjs +2 -0
  625. package/node_modules/shiki/node_modules/@shikijs/langs/dist/qml.d.mts +3 -0
  626. package/node_modules/shiki/node_modules/@shikijs/langs/dist/qml.mjs +8 -0
  627. package/node_modules/shiki/node_modules/@shikijs/langs/dist/qmldir.d.mts +3 -0
  628. package/node_modules/shiki/node_modules/@shikijs/langs/dist/qmldir.mjs +5 -0
  629. package/node_modules/shiki/node_modules/@shikijs/langs/dist/qss.d.mts +3 -0
  630. package/node_modules/shiki/node_modules/@shikijs/langs/dist/qss.mjs +5 -0
  631. package/node_modules/shiki/node_modules/@shikijs/langs/dist/r.d.mts +3 -0
  632. package/node_modules/shiki/node_modules/@shikijs/langs/dist/r.mjs +5 -0
  633. package/node_modules/shiki/node_modules/@shikijs/langs/dist/racket.d.mts +3 -0
  634. package/node_modules/shiki/node_modules/@shikijs/langs/dist/racket.mjs +5 -0
  635. package/node_modules/shiki/node_modules/@shikijs/langs/dist/raku.d.mts +3 -0
  636. package/node_modules/shiki/node_modules/@shikijs/langs/dist/raku.mjs +5 -0
  637. package/node_modules/shiki/node_modules/@shikijs/langs/dist/razor.d.mts +3 -0
  638. package/node_modules/shiki/node_modules/@shikijs/langs/dist/razor.mjs +10 -0
  639. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rb.d.mts +3 -0
  640. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rb.mjs +2 -0
  641. package/node_modules/shiki/node_modules/@shikijs/langs/dist/reg.d.mts +3 -0
  642. package/node_modules/shiki/node_modules/@shikijs/langs/dist/reg.mjs +5 -0
  643. package/node_modules/shiki/node_modules/@shikijs/langs/dist/regex.d.mts +3 -0
  644. package/node_modules/shiki/node_modules/@shikijs/langs/dist/regex.mjs +2 -0
  645. package/node_modules/shiki/node_modules/@shikijs/langs/dist/regexp.d.mts +3 -0
  646. package/node_modules/shiki/node_modules/@shikijs/langs/dist/regexp.mjs +5 -0
  647. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rel.d.mts +3 -0
  648. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rel.mjs +5 -0
  649. package/node_modules/shiki/node_modules/@shikijs/langs/dist/riscv.d.mts +3 -0
  650. package/node_modules/shiki/node_modules/@shikijs/langs/dist/riscv.mjs +5 -0
  651. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ron.d.mts +3 -0
  652. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ron.mjs +5 -0
  653. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rosmsg.d.mts +3 -0
  654. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rosmsg.mjs +5 -0
  655. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rs.d.mts +3 -0
  656. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rs.mjs +2 -0
  657. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rst.d.mts +3 -0
  658. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rst.mjs +22 -0
  659. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ruby.d.mts +3 -0
  660. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ruby.mjs +30 -0
  661. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rust.d.mts +3 -0
  662. package/node_modules/shiki/node_modules/@shikijs/langs/dist/rust.mjs +5 -0
  663. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sas.d.mts +3 -0
  664. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sas.mjs +8 -0
  665. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sass.d.mts +3 -0
  666. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sass.mjs +5 -0
  667. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scad.d.mts +3 -0
  668. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scad.mjs +2 -0
  669. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scala.d.mts +3 -0
  670. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scala.mjs +5 -0
  671. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scheme.d.mts +3 -0
  672. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scheme.mjs +5 -0
  673. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scss.d.mts +3 -0
  674. package/node_modules/shiki/node_modules/@shikijs/langs/dist/scss.mjs +8 -0
  675. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sdbl.d.mts +3 -0
  676. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sdbl.mjs +5 -0
  677. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sh.d.mts +3 -0
  678. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sh.mjs +2 -0
  679. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shader.d.mts +3 -0
  680. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shader.mjs +2 -0
  681. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shaderlab.d.mts +3 -0
  682. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shaderlab.mjs +8 -0
  683. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shell.d.mts +3 -0
  684. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shell.mjs +2 -0
  685. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shellscript.d.mts +3 -0
  686. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shellscript.mjs +5 -0
  687. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shellsession.d.mts +3 -0
  688. package/node_modules/shiki/node_modules/@shikijs/langs/dist/shellsession.mjs +8 -0
  689. package/node_modules/shiki/node_modules/@shikijs/langs/dist/smalltalk.d.mts +3 -0
  690. package/node_modules/shiki/node_modules/@shikijs/langs/dist/smalltalk.mjs +5 -0
  691. package/node_modules/shiki/node_modules/@shikijs/langs/dist/solidity.d.mts +3 -0
  692. package/node_modules/shiki/node_modules/@shikijs/langs/dist/solidity.mjs +5 -0
  693. package/node_modules/shiki/node_modules/@shikijs/langs/dist/soy.d.mts +3 -0
  694. package/node_modules/shiki/node_modules/@shikijs/langs/dist/soy.mjs +8 -0
  695. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sparql.d.mts +3 -0
  696. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sparql.mjs +8 -0
  697. package/node_modules/shiki/node_modules/@shikijs/langs/dist/spl.d.mts +3 -0
  698. package/node_modules/shiki/node_modules/@shikijs/langs/dist/spl.mjs +2 -0
  699. package/node_modules/shiki/node_modules/@shikijs/langs/dist/splunk.d.mts +3 -0
  700. package/node_modules/shiki/node_modules/@shikijs/langs/dist/splunk.mjs +5 -0
  701. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sql.d.mts +3 -0
  702. package/node_modules/shiki/node_modules/@shikijs/langs/dist/sql.mjs +5 -0
  703. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ssh-config.d.mts +3 -0
  704. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ssh-config.mjs +5 -0
  705. package/node_modules/shiki/node_modules/@shikijs/langs/dist/stata.d.mts +3 -0
  706. package/node_modules/shiki/node_modules/@shikijs/langs/dist/stata.mjs +8 -0
  707. package/node_modules/shiki/node_modules/@shikijs/langs/dist/styl.d.mts +3 -0
  708. package/node_modules/shiki/node_modules/@shikijs/langs/dist/styl.mjs +2 -0
  709. package/node_modules/shiki/node_modules/@shikijs/langs/dist/stylus.d.mts +3 -0
  710. package/node_modules/shiki/node_modules/@shikijs/langs/dist/stylus.mjs +5 -0
  711. package/node_modules/shiki/node_modules/@shikijs/langs/dist/surql.d.mts +3 -0
  712. package/node_modules/shiki/node_modules/@shikijs/langs/dist/surql.mjs +2 -0
  713. package/node_modules/shiki/node_modules/@shikijs/langs/dist/surrealql.d.mts +3 -0
  714. package/node_modules/shiki/node_modules/@shikijs/langs/dist/surrealql.mjs +8 -0
  715. package/node_modules/shiki/node_modules/@shikijs/langs/dist/svelte.d.mts +3 -0
  716. package/node_modules/shiki/node_modules/@shikijs/langs/dist/svelte.mjs +14 -0
  717. package/node_modules/shiki/node_modules/@shikijs/langs/dist/swift.d.mts +3 -0
  718. package/node_modules/shiki/node_modules/@shikijs/langs/dist/swift.mjs +5 -0
  719. package/node_modules/shiki/node_modules/@shikijs/langs/dist/system-verilog.d.mts +3 -0
  720. package/node_modules/shiki/node_modules/@shikijs/langs/dist/system-verilog.mjs +5 -0
  721. package/node_modules/shiki/node_modules/@shikijs/langs/dist/systemd.d.mts +3 -0
  722. package/node_modules/shiki/node_modules/@shikijs/langs/dist/systemd.mjs +5 -0
  723. package/node_modules/shiki/node_modules/@shikijs/langs/dist/talon.d.mts +3 -0
  724. package/node_modules/shiki/node_modules/@shikijs/langs/dist/talon.mjs +2 -0
  725. package/node_modules/shiki/node_modules/@shikijs/langs/dist/talonscript.d.mts +3 -0
  726. package/node_modules/shiki/node_modules/@shikijs/langs/dist/talonscript.mjs +5 -0
  727. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tasl.d.mts +3 -0
  728. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tasl.mjs +5 -0
  729. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tcl.d.mts +3 -0
  730. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tcl.mjs +5 -0
  731. package/node_modules/shiki/node_modules/@shikijs/langs/dist/templ.d.mts +3 -0
  732. package/node_modules/shiki/node_modules/@shikijs/langs/dist/templ.mjs +12 -0
  733. package/node_modules/shiki/node_modules/@shikijs/langs/dist/terraform.d.mts +3 -0
  734. package/node_modules/shiki/node_modules/@shikijs/langs/dist/terraform.mjs +5 -0
  735. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tex.d.mts +3 -0
  736. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tex.mjs +8 -0
  737. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tf.d.mts +3 -0
  738. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tf.mjs +2 -0
  739. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tfvars.d.mts +3 -0
  740. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tfvars.mjs +2 -0
  741. package/node_modules/shiki/node_modules/@shikijs/langs/dist/toml.d.mts +3 -0
  742. package/node_modules/shiki/node_modules/@shikijs/langs/dist/toml.mjs +5 -0
  743. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tres.d.mts +3 -0
  744. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tres.mjs +2 -0
  745. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ts-tags.d.mts +3 -0
  746. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ts-tags.mjs +18 -0
  747. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ts.d.mts +3 -0
  748. package/node_modules/shiki/node_modules/@shikijs/langs/dist/ts.mjs +2 -0
  749. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tscn.d.mts +3 -0
  750. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tscn.mjs +2 -0
  751. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tsp.d.mts +3 -0
  752. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tsp.mjs +2 -0
  753. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tsv.d.mts +3 -0
  754. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tsv.mjs +5 -0
  755. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tsx.d.mts +3 -0
  756. package/node_modules/shiki/node_modules/@shikijs/langs/dist/tsx.mjs +5 -0
  757. package/node_modules/shiki/node_modules/@shikijs/langs/dist/turtle.d.mts +3 -0
  758. package/node_modules/shiki/node_modules/@shikijs/langs/dist/turtle.mjs +5 -0
  759. package/node_modules/shiki/node_modules/@shikijs/langs/dist/twig.d.mts +3 -0
  760. package/node_modules/shiki/node_modules/@shikijs/langs/dist/twig.mjs +18 -0
  761. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typ.d.mts +3 -0
  762. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typ.mjs +2 -0
  763. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typescript.d.mts +3 -0
  764. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typescript.mjs +5 -0
  765. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typespec.d.mts +3 -0
  766. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typespec.mjs +5 -0
  767. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typst.d.mts +3 -0
  768. package/node_modules/shiki/node_modules/@shikijs/langs/dist/typst.mjs +5 -0
  769. package/node_modules/shiki/node_modules/@shikijs/langs/dist/v.d.mts +3 -0
  770. package/node_modules/shiki/node_modules/@shikijs/langs/dist/v.mjs +5 -0
  771. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vala.d.mts +3 -0
  772. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vala.mjs +5 -0
  773. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vb.d.mts +3 -0
  774. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vb.mjs +5 -0
  775. package/node_modules/shiki/node_modules/@shikijs/langs/dist/verilog.d.mts +3 -0
  776. package/node_modules/shiki/node_modules/@shikijs/langs/dist/verilog.mjs +5 -0
  777. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vhdl.d.mts +3 -0
  778. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vhdl.mjs +5 -0
  779. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vim.d.mts +3 -0
  780. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vim.mjs +2 -0
  781. package/node_modules/shiki/node_modules/@shikijs/langs/dist/viml.d.mts +3 -0
  782. package/node_modules/shiki/node_modules/@shikijs/langs/dist/viml.mjs +5 -0
  783. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vimscript.d.mts +3 -0
  784. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vimscript.mjs +2 -0
  785. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-directives.d.mts +3 -0
  786. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-directives.mjs +5 -0
  787. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-html.d.mts +3 -0
  788. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-html.mjs +8 -0
  789. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-interpolations.d.mts +3 -0
  790. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-interpolations.mjs +5 -0
  791. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.d.mts +3 -0
  792. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.mjs +8 -0
  793. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-vine.d.mts +3 -0
  794. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue-vine.mjs +18 -0
  795. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue.d.mts +3 -0
  796. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vue.mjs +26 -0
  797. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vy.d.mts +3 -0
  798. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vy.mjs +2 -0
  799. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vyper.d.mts +3 -0
  800. package/node_modules/shiki/node_modules/@shikijs/langs/dist/vyper.mjs +5 -0
  801. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wasm.d.mts +3 -0
  802. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wasm.mjs +5 -0
  803. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wenyan.d.mts +3 -0
  804. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wenyan.mjs +5 -0
  805. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wgsl.d.mts +3 -0
  806. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wgsl.mjs +5 -0
  807. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wiki.d.mts +3 -0
  808. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wiki.mjs +2 -0
  809. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wikitext.d.mts +3 -0
  810. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wikitext.mjs +5 -0
  811. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wit.d.mts +3 -0
  812. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wit.mjs +5 -0
  813. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wl.d.mts +3 -0
  814. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wl.mjs +2 -0
  815. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wolfram.d.mts +3 -0
  816. package/node_modules/shiki/node_modules/@shikijs/langs/dist/wolfram.mjs +5 -0
  817. package/node_modules/shiki/node_modules/@shikijs/langs/dist/xml.d.mts +3 -0
  818. package/node_modules/shiki/node_modules/@shikijs/langs/dist/xml.mjs +8 -0
  819. package/node_modules/shiki/node_modules/@shikijs/langs/dist/xsl.d.mts +3 -0
  820. package/node_modules/shiki/node_modules/@shikijs/langs/dist/xsl.mjs +8 -0
  821. package/node_modules/shiki/node_modules/@shikijs/langs/dist/yaml.d.mts +3 -0
  822. package/node_modules/shiki/node_modules/@shikijs/langs/dist/yaml.mjs +5 -0
  823. package/node_modules/shiki/node_modules/@shikijs/langs/dist/yml.d.mts +3 -0
  824. package/node_modules/shiki/node_modules/@shikijs/langs/dist/yml.mjs +2 -0
  825. package/node_modules/shiki/node_modules/@shikijs/langs/dist/zenscript.d.mts +3 -0
  826. package/node_modules/shiki/node_modules/@shikijs/langs/dist/zenscript.mjs +5 -0
  827. package/node_modules/shiki/node_modules/@shikijs/langs/dist/zig.d.mts +3 -0
  828. package/node_modules/shiki/node_modules/@shikijs/langs/dist/zig.mjs +5 -0
  829. package/node_modules/shiki/node_modules/@shikijs/langs/dist/zsh.d.mts +3 -0
  830. package/node_modules/shiki/node_modules/@shikijs/langs/dist/zsh.mjs +2 -0
  831. package/node_modules/shiki/node_modules/@shikijs/langs/package.json +384 -0
  832. package/node_modules/shiki/node_modules/@shikijs/types/LICENSE +22 -0
  833. package/node_modules/shiki/node_modules/@shikijs/types/README.md +7 -0
  834. package/node_modules/shiki/node_modules/@shikijs/types/dist/index.d.mts +885 -0
  835. package/node_modules/shiki/node_modules/@shikijs/types/dist/index.mjs +8 -0
  836. package/node_modules/shiki/node_modules/@shikijs/types/package.json +36 -0
  837. package/npm-shrinkwrap.json +90 -14
  838. package/package.json +10 -8
@@ -1,8 +1,9 @@
1
- class ShikiError extends Error {
2
- constructor(message) {
3
- super(message);
4
- this.name = "ShikiError";
5
- }
6
- }
7
-
1
+ //#region src/error.ts
2
+ var ShikiError = class extends Error {
3
+ constructor(message) {
4
+ super(message);
5
+ this.name = "ShikiError";
6
+ }
7
+ };
8
+ //#endregion
8
9
  export { ShikiError };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/types",
3
3
  "type": "module",
4
- "version": "3.23.0",
4
+ "version": "4.1.0",
5
5
  "description": "Type definitions for Shiki",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -25,12 +25,15 @@
25
25
  "files": [
26
26
  "dist"
27
27
  ],
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
28
31
  "dependencies": {
29
32
  "@shikijs/vscode-textmate": "^10.0.2",
30
33
  "@types/hast": "^3.0.4"
31
34
  },
32
35
  "scripts": {
33
- "build": "unbuild",
34
- "dev": "unbuild --stub"
36
+ "build": "tsdown",
37
+ "dev": "tsdown --watch"
35
38
  }
36
39
  }
@@ -19,7 +19,7 @@ A full release may be completed by first updating the `"version"` property in pa
19
19
  ```
20
20
  yarn clean
21
21
  yarn build
22
- yarn npm publish
22
+ yarn publish
23
23
  ```
24
24
 
25
25
  After releasing, remember to:
@@ -368,46 +368,7 @@
368
368
  function hasOnlyUnixLineEndings(string) {
369
369
  return !string.includes('\r\n') && string.includes('\n');
370
370
  }
371
- /**
372
- * Split a string into segments using a word segmenter, merging consecutive
373
- * segments if they are both whitespace segments. Whitespace segments can
374
- * appear adjacent to one another for two reasons:
375
- * - newlines always get their own segment
376
- * - where a diacritic is attached to a whitespace character in the text, the
377
- * segment ends after the diacritic, so e.g. " \u0300 " becomes two segments.
378
- * This function therefore runs the segmenter's .segment() method and then
379
- * merges consecutive segments of whitespace into a single part.
380
- */
381
- function segment(string, segmenter) {
382
- const parts = [];
383
- for (const segmentObj of Array.from(segmenter.segment(string))) {
384
- const segment = segmentObj.segment;
385
- if (parts.length && (/\s/).test(parts[parts.length - 1]) && (/\s/).test(segment)) {
386
- parts[parts.length - 1] += segment;
387
- }
388
- else {
389
- parts.push(segment);
390
- }
391
- }
392
- return parts;
393
- }
394
- // The functions below take a `segmenter` argument so that, when called from
395
- // diffWords when it is using a segmenter, they can use a notion of what
396
- // constitutes "whitespace" that is consistent with the segmenter.
397
- //
398
- // USUALLY this will be identical to the result of the non-segmenter-based
399
- // logic, but it differs in at least one case: when whitespace characters are
400
- // modified by diacritics. A word segmenter considers these diacritics to be
401
- // part of the whitespace, whereas our non-segmenter-based logic does not.
402
- //
403
- // Because the segmenter-based approach necessarily requires segmenting the
404
- // entire string, we offer a leadingAndTrailingWs function to allow getting the
405
- // whitespace prefix AND whitespace suffix with a single call to the segmenter,
406
- // for efficiency's sake.
407
- function trailingWs(string, segmenter) {
408
- if (segmenter) {
409
- return leadingAndTrailingWs(string, segmenter)[1];
410
- }
371
+ function trailingWs(string) {
411
372
  // Yes, this looks overcomplicated and dumb - why not replace the whole function with
412
373
  // return string.match(/\s*$/)[0]
413
374
  // you ask? Because:
@@ -427,28 +388,11 @@
427
388
  }
428
389
  return string.substring(i + 1);
429
390
  }
430
- function leadingWs(string, segmenter) {
431
- if (segmenter) {
432
- return leadingAndTrailingWs(string, segmenter)[0];
433
- }
391
+ function leadingWs(string) {
434
392
  // Thankfully the annoying considerations described in trailingWs don't apply here:
435
393
  const match = string.match(/^\s*/);
436
394
  return match ? match[0] : '';
437
395
  }
438
- function leadingAndTrailingWs(string, segmenter) {
439
- if (!segmenter) {
440
- return [leadingWs(string), trailingWs(string)];
441
- }
442
- if (segmenter.resolvedOptions().granularity != 'word') {
443
- throw new Error('The segmenter passed must have a granularity of "word"');
444
- }
445
- const segments = segment(string, segmenter);
446
- const firstSeg = segments[0];
447
- const lastSeg = segments[segments.length - 1];
448
- const head = (/\s/).test(firstSeg) ? firstSeg : '';
449
- const tail = (/\s/).test(lastSeg) ? lastSeg : '';
450
- return [head, tail];
451
- }
452
396
 
453
397
  // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
454
398
  //
@@ -514,9 +458,22 @@
514
458
  // We want `parts` to be an array whose elements alternate between being
515
459
  // pure whitespace and being pure non-whitespace. This is ALMOST what the
516
460
  // segments returned by a word-based Intl.Segmenter already look like,
517
- // but not quite - see explanation in the docs of our custom segment()
518
- // function.
519
- parts = segment(value, segmenter);
461
+ // and therefore we can ALMOST get what we want by simply doing...
462
+ // parts = Array.from(segmenter.segment(value), segment => segment.segment);
463
+ // ... but not QUITE, because there's of one annoying special case: every
464
+ // newline character gets its own segment, instead of sharing a segment
465
+ // with other surrounding whitespace. We therefore need to manually merge
466
+ // consecutive segments of whitespace into a single part:
467
+ parts = [];
468
+ for (const segmentObj of Array.from(segmenter.segment(value))) {
469
+ const segment = segmentObj.segment;
470
+ if (parts.length && (/\s/).test(parts[parts.length - 1]) && (/\s/).test(segment)) {
471
+ parts[parts.length - 1] += segment;
472
+ }
473
+ else {
474
+ parts.push(segment);
475
+ }
476
+ }
520
477
  }
521
478
  else {
522
479
  parts = value.match(tokenizeIncludingWhitespace) || [];
@@ -580,7 +537,7 @@
580
537
  }
581
538
  else {
582
539
  if (insertion || deletion) { // May be false at start of text
583
- dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options.intlSegmenter);
540
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
584
541
  }
585
542
  lastKeep = change;
586
543
  insertion = null;
@@ -588,7 +545,7 @@
588
545
  }
589
546
  });
590
547
  if (insertion || deletion) {
591
- dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options.intlSegmenter);
548
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
592
549
  }
593
550
  return changes;
594
551
  }
@@ -604,7 +561,7 @@
604
561
  }
605
562
  return wordDiff.diff(oldStr, newStr, options);
606
563
  }
607
- function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep, segmenter) {
564
+ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
608
565
  // Before returning, we tidy up the leading and trailing whitespace of the
609
566
  // change objects to eliminate cases where trailing whitespace in one object
610
567
  // is repeated as leading whitespace in the next.
@@ -647,8 +604,10 @@
647
604
  // * Just a "delete"
648
605
  // We handle the three cases separately.
649
606
  if (deletion && insertion) {
650
- const [oldWsPrefix, oldWsSuffix] = leadingAndTrailingWs(deletion.value, segmenter);
651
- const [newWsPrefix, newWsSuffix] = leadingAndTrailingWs(insertion.value, segmenter);
607
+ const oldWsPrefix = leadingWs(deletion.value);
608
+ const oldWsSuffix = trailingWs(deletion.value);
609
+ const newWsPrefix = leadingWs(insertion.value);
610
+ const newWsSuffix = trailingWs(insertion.value);
652
611
  if (startKeep) {
653
612
  const commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
654
613
  startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
@@ -670,17 +629,17 @@
670
629
  // whitespace and deleting duplicate leading whitespace where
671
630
  // present.
672
631
  if (startKeep) {
673
- const ws = leadingWs(insertion.value, segmenter);
632
+ const ws = leadingWs(insertion.value);
674
633
  insertion.value = insertion.value.substring(ws.length);
675
634
  }
676
635
  if (endKeep) {
677
- const ws = leadingWs(endKeep.value, segmenter);
636
+ const ws = leadingWs(endKeep.value);
678
637
  endKeep.value = endKeep.value.substring(ws.length);
679
638
  }
680
639
  // otherwise we've got a deletion and no insertion
681
640
  }
682
641
  else if (startKeep && endKeep) {
683
- const newWsFull = leadingWs(endKeep.value, segmenter), [delWsStart, delWsEnd] = leadingAndTrailingWs(deletion.value, segmenter);
642
+ const newWsFull = leadingWs(endKeep.value), delWsStart = leadingWs(deletion.value), delWsEnd = trailingWs(deletion.value);
684
643
  // Any whitespace that comes straight after startKeep in both the old and
685
644
  // new texts, assign to startKeep and remove from the deletion.
686
645
  const newWsStart = longestCommonPrefix(newWsFull, delWsStart);
@@ -699,8 +658,8 @@
699
658
  // We are at the start of the text. Preserve all the whitespace on
700
659
  // endKeep, and just remove whitespace from the end of deletion to the
701
660
  // extent that it overlaps with the start of endKeep.
702
- const endKeepWsPrefix = leadingWs(endKeep.value, segmenter);
703
- const deletionWsSuffix = trailingWs(deletion.value, segmenter);
661
+ const endKeepWsPrefix = leadingWs(endKeep.value);
662
+ const deletionWsSuffix = trailingWs(deletion.value);
704
663
  const overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
705
664
  deletion.value = removeSuffix(deletion.value, overlap);
706
665
  }
@@ -708,8 +667,8 @@
708
667
  // We are at the END of the text. Preserve all the whitespace on
709
668
  // startKeep, and just remove whitespace from the start of deletion to
710
669
  // the extent that it overlaps with the end of startKeep.
711
- const startKeepWsSuffix = trailingWs(startKeep.value, segmenter);
712
- const deletionWsPrefix = leadingWs(deletion.value, segmenter);
670
+ const startKeepWsSuffix = trailingWs(startKeep.value);
671
+ const deletionWsPrefix = leadingWs(deletion.value);
713
672
  const overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
714
673
  deletion.value = removePrefix(deletion.value, overlap);
715
674
  }
@@ -1 +1 @@
1
- ((global,factory)=>{"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self).Diff={})})(this,function(exports){class Diff{diff(oldStr,newStr,options={}){let callback;"function"==typeof options?(callback=options,options={}):"callback"in options&&(callback=options.callback);oldStr=this.castInput(oldStr,options),newStr=this.castInput(newStr,options),oldStr=this.removeEmpty(this.tokenize(oldStr,options)),newStr=this.removeEmpty(this.tokenize(newStr,options));return this.diffWithOptionsObj(oldStr,newStr,options,callback)}diffWithOptionsObj(oldTokens,newTokens,options,callback){let _a,done=value=>{if(value=this.postProcess(value,options),!callback)return value;setTimeout(function(){callback(value)},0)},newLen=newTokens.length,oldLen=oldTokens.length,editLength=1,maxEditLength=newLen+oldLen;null!=options.maxEditLength&&(maxEditLength=Math.min(maxEditLength,options.maxEditLength));var maxExecutionTime=null!=(_a=options.timeout)?_a:1/0;let abortAfterTimestamp=Date.now()+maxExecutionTime,bestPath=[{oldPos:-1,lastComponent:void 0}],newPos=this.extractCommon(bestPath[0],newTokens,oldTokens,0,options);if(bestPath[0].oldPos+1>=oldLen&&newPos+1>=newLen)return done(this.buildValues(bestPath[0].lastComponent,newTokens,oldTokens));let minDiagonalToConsider=-1/0,maxDiagonalToConsider=1/0,execEditLength=()=>{for(let diagonalPath=Math.max(minDiagonalToConsider,-editLength);diagonalPath<=Math.min(maxDiagonalToConsider,editLength);diagonalPath+=2){let basePath;var removePath=bestPath[diagonalPath-1],addPath=bestPath[diagonalPath+1];removePath&&(bestPath[diagonalPath-1]=void 0);let canAdd=!1;addPath&&(addPathNewPos=addPath.oldPos-diagonalPath,canAdd=addPath&&0<=addPathNewPos&&addPathNewPos<newLen);var addPathNewPos=removePath&&removePath.oldPos+1<oldLen;if(canAdd||addPathNewPos){if(basePath=!addPathNewPos||canAdd&&removePath.oldPos<addPath.oldPos?this.addToPath(addPath,!0,!1,0,options):this.addToPath(removePath,!1,!0,1,options),newPos=this.extractCommon(basePath,newTokens,oldTokens,diagonalPath,options),basePath.oldPos+1>=oldLen&&newPos+1>=newLen)return done(this.buildValues(basePath.lastComponent,newTokens,oldTokens))||!0;(bestPath[diagonalPath]=basePath).oldPos+1>=oldLen&&(maxDiagonalToConsider=Math.min(maxDiagonalToConsider,diagonalPath-1)),newPos+1>=newLen&&(minDiagonalToConsider=Math.max(minDiagonalToConsider,diagonalPath+1))}else bestPath[diagonalPath]=void 0}editLength++};if(callback)!function exec(){setTimeout(function(){if(editLength>maxEditLength||Date.now()>abortAfterTimestamp)return callback(void 0);execEditLength()||exec()},0)}();else for(;editLength<=maxEditLength&&Date.now()<=abortAfterTimestamp;){var ret=execEditLength();if(ret)return ret}}addToPath(path,added,removed,oldPosInc,options){var last=path.lastComponent;return last&&!options.oneChangePerToken&&last.added===added&&last.removed===removed?{oldPos:path.oldPos+oldPosInc,lastComponent:{count:last.count+1,added:added,removed:removed,previousComponent:last.previousComponent}}:{oldPos:path.oldPos+oldPosInc,lastComponent:{count:1,added:added,removed:removed,previousComponent:last}}}extractCommon(basePath,newTokens,oldTokens,diagonalPath,options){var newLen=newTokens.length,oldLen=oldTokens.length;let oldPos=basePath.oldPos,newPos=oldPos-diagonalPath,commonCount=0;for(;newPos+1<newLen&&oldPos+1<oldLen&&this.equals(oldTokens[oldPos+1],newTokens[newPos+1],options);)newPos++,oldPos++,commonCount++,options.oneChangePerToken&&(basePath.lastComponent={count:1,previousComponent:basePath.lastComponent,added:!1,removed:!1});return commonCount&&!options.oneChangePerToken&&(basePath.lastComponent={count:commonCount,previousComponent:basePath.lastComponent,added:!1,removed:!1}),basePath.oldPos=oldPos,newPos}equals(left,right,options){return options.comparator?options.comparator(left,right):left===right||!!options.ignoreCase&&left.toLowerCase()===right.toLowerCase()}removeEmpty(array){var ret=[];for(let i=0;i<array.length;i++)array[i]&&ret.push(array[i]);return ret}castInput(value,options){return value}tokenize(value,options){return Array.from(value)}join(chars){return chars.join("")}postProcess(changeObjects,options){return changeObjects}get useLongestToken(){return!1}buildValues(lastComponent,newTokens,oldTokens){for(var nextComponent,components=[];lastComponent;)components.push(lastComponent),nextComponent=lastComponent.previousComponent,delete lastComponent.previousComponent,lastComponent=nextComponent;components.reverse();var componentLen=components.length;let componentPos=0,newPos=0,oldPos=0;for(;componentPos<componentLen;componentPos++){var component=components[componentPos];if(component.removed)component.value=this.join(oldTokens.slice(oldPos,oldPos+component.count)),oldPos+=component.count;else{if(!component.added&&this.useLongestToken){let value=newTokens.slice(newPos,newPos+component.count);value=value.map(function(value,i){i=oldTokens[oldPos+i];return i.length>value.length?i:value}),component.value=this.join(value)}else component.value=this.join(newTokens.slice(newPos,newPos+component.count));newPos+=component.count,component.added||(oldPos+=component.count)}}return components}}class CharacterDiff extends Diff{}let characterDiff=new CharacterDiff;function longestCommonPrefix(str1,str2){let i;for(i=0;i<str1.length&&i<str2.length;i++)if(str1[i]!=str2[i])return str1.slice(0,i);return str1.slice(0,i)}function longestCommonSuffix(str1,str2){let i;if(!str1||!str2||str1[str1.length-1]!=str2[str2.length-1])return"";for(i=0;i<str1.length&&i<str2.length;i++)if(str1[str1.length-(i+1)]!=str2[str2.length-(i+1)])return str1.slice(-i);return str1.slice(-i)}function replacePrefix(string,oldPrefix,newPrefix){if(string.slice(0,oldPrefix.length)!=oldPrefix)throw Error(`string ${JSON.stringify(string)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`);return newPrefix+string.slice(oldPrefix.length)}function replaceSuffix(string,oldSuffix,newSuffix){if(!oldSuffix)return string+newSuffix;if(string.slice(-oldSuffix.length)!=oldSuffix)throw Error(`string ${JSON.stringify(string)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`);return string.slice(0,-oldSuffix.length)+newSuffix}function removePrefix(string,oldPrefix){return replacePrefix(string,oldPrefix,"")}function removeSuffix(string,oldSuffix){return replaceSuffix(string,oldSuffix,"")}function maximumOverlap(string1,string2){return string2.slice(0,((a,b)=>{let startA=0,endB=(a.length>b.length&&(startA=a.length-b.length),b.length),map=(a.length<b.length&&(endB=a.length),Array(endB)),k=0;map[0]=0;for(let j=1;j<endB;j++){for(b[j]==b[k]?map[j]=map[k]:map[j]=k;0<k&&b[j]!=b[k];)k=map[k];b[j]==b[k]&&k++}k=0;for(let i=startA;i<a.length;i++){for(;0<k&&a[i]!=b[k];)k=map[k];a[i]==b[k]&&k++}return k})(string1,string2))}function segment(string,segmenter){var segmentObj,parts=[];for(segmentObj of Array.from(segmenter.segment(string))){var segment=segmentObj.segment;parts.length&&/\s/.test(parts[parts.length-1])&&/\s/.test(segment)?parts[parts.length-1]+=segment:parts.push(segment)}return parts}function trailingWs(string,segmenter){if(segmenter)return leadingAndTrailingWs(string,segmenter)[1];let i;for(i=string.length-1;0<=i&&string[i].match(/\s/);i--);return string.substring(i+1)}function leadingWs(string,segmenter){return segmenter?leadingAndTrailingWs(string,segmenter)[0]:(segmenter=string.match(/^\s*/))?segmenter[0]:""}function leadingAndTrailingWs(string,segmenter){if(!segmenter)return[leadingWs(string),trailingWs(string)];if("word"!=segmenter.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');string=segment(string,segmenter),segmenter=string[0],string=string[string.length-1];return[/\s/.test(segmenter)?segmenter:"",/\s/.test(string)?string:""]}let extendedWordChars="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",tokenizeIncludingWhitespace=new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`,"ug");class WordDiff extends Diff{equals(left,right,options){return options.ignoreCase&&(left=left.toLowerCase(),right=right.toLowerCase()),left.trim()===right.trim()}tokenize(value,options={}){let parts;if(options.intlSegmenter){options=options.intlSegmenter;if("word"!=options.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');parts=segment(value,options)}else parts=value.match(tokenizeIncludingWhitespace)||[];let tokens=[],prevPart=null;return parts.forEach(part=>{/\s/.test(part)?null==prevPart?tokens.push(part):tokens.push(tokens.pop()+part):null!=prevPart&&/\s/.test(prevPart)?tokens[tokens.length-1]==prevPart?tokens.push(tokens.pop()+part):tokens.push(prevPart+part):tokens.push(part),prevPart=part}),tokens}join(tokens){return tokens.map((token,i)=>0==i?token:token.replace(/^\s+/,"")).join("")}postProcess(changes,options){if(changes&&!options.oneChangePerToken){let lastKeep=null,insertion=null,deletion=null;changes.forEach(change=>{change.added?insertion=change:deletion=change.removed?change:((insertion||deletion)&&dedupeWhitespaceInChangeObjects(lastKeep,deletion,insertion,change,options.intlSegmenter),lastKeep=change,insertion=null)}),(insertion||deletion)&&dedupeWhitespaceInChangeObjects(lastKeep,deletion,insertion,null,options.intlSegmenter)}return changes}}let wordDiff=new WordDiff;function dedupeWhitespaceInChangeObjects(startKeep,deletion,insertion,endKeep,segmenter){if(deletion&&insertion){var[oldWsPrefix,oldWsSuffix]=leadingAndTrailingWs(deletion.value,segmenter),[newWsPrefix,newWsSuffix]=leadingAndTrailingWs(insertion.value,segmenter);startKeep&&(oldWsPrefix=longestCommonPrefix(oldWsPrefix,newWsPrefix),startKeep.value=replaceSuffix(startKeep.value,newWsPrefix,oldWsPrefix),deletion.value=removePrefix(deletion.value,oldWsPrefix),insertion.value=removePrefix(insertion.value,oldWsPrefix)),endKeep&&(newWsPrefix=longestCommonSuffix(oldWsSuffix,newWsSuffix),endKeep.value=replacePrefix(endKeep.value,newWsSuffix,newWsPrefix),deletion.value=removeSuffix(deletion.value,newWsPrefix),insertion.value=removeSuffix(insertion.value,newWsPrefix))}else if(insertion){if(startKeep&&(oldWsPrefix=leadingWs(insertion.value,segmenter),insertion.value=insertion.value.substring(oldWsPrefix.length)),endKeep){let ws=leadingWs(endKeep.value,segmenter);endKeep.value=endKeep.value.substring(ws.length)}}else if(startKeep&&endKeep){var oldWsSuffix=leadingWs(endKeep.value,segmenter),[newWsSuffix,newWsPrefix]=leadingAndTrailingWs(deletion.value,segmenter),insertion=longestCommonPrefix(oldWsSuffix,newWsSuffix),oldWsPrefix=(deletion.value=removePrefix(deletion.value,insertion),longestCommonSuffix(removePrefix(oldWsSuffix,insertion),newWsPrefix));deletion.value=removeSuffix(deletion.value,oldWsPrefix),endKeep.value=replacePrefix(endKeep.value,oldWsSuffix,oldWsPrefix),startKeep.value=replaceSuffix(startKeep.value,oldWsSuffix,oldWsSuffix.slice(0,oldWsSuffix.length-oldWsPrefix.length))}else if(endKeep){newWsSuffix=leadingWs(endKeep.value,segmenter),insertion=maximumOverlap(trailingWs(deletion.value,segmenter),newWsSuffix);deletion.value=removeSuffix(deletion.value,insertion)}else if(startKeep){let overlap=maximumOverlap(trailingWs(startKeep.value,segmenter),leadingWs(deletion.value,segmenter));deletion.value=removePrefix(deletion.value,overlap)}}class WordsWithSpaceDiff extends Diff{tokenize(value){var regex=new RegExp(`(\\r?\\n)|[${extendedWordChars}]+|[^\\S\\n\\r]+|[^${extendedWordChars}]`,"ug");return value.match(regex)||[]}}let wordsWithSpaceDiff=new WordsWithSpaceDiff;function diffWordsWithSpace(oldStr,newStr,options){return wordsWithSpaceDiff.diff(oldStr,newStr,options)}class LineDiff extends Diff{constructor(){super(...arguments),this.tokenize=tokenize}equals(left,right,options){return options.ignoreWhitespace?(options.newlineIsToken&&left.includes("\n")||(left=left.trim()),options.newlineIsToken&&right.includes("\n")||(right=right.trim())):options.ignoreNewlineAtEof&&!options.newlineIsToken&&(left.endsWith("\n")&&(left=left.slice(0,-1)),right.endsWith("\n"))&&(right=right.slice(0,-1)),super.equals(left,right,options)}}let lineDiff=new LineDiff;function diffLines(oldStr,newStr,options){return lineDiff.diff(oldStr,newStr,options)}function tokenize(value,options){var retLines=[],linesAndNewlines=(value=options.stripTrailingCr?value.replace(/\r\n/g,"\n"):value).split(/(\n|\r\n)/);linesAndNewlines[linesAndNewlines.length-1]||linesAndNewlines.pop();for(let i=0;i<linesAndNewlines.length;i++){var line=linesAndNewlines[i];i%2&&!options.newlineIsToken?retLines[retLines.length-1]+=line:retLines.push(line)}return retLines}class SentenceDiff extends Diff{tokenize(value){var _a,char,result=[];let tokenStartI=0;for(let i=0;i<value.length;i++){if(i==value.length-1){result.push(value.slice(tokenStartI));break}if(("."==(char=value[i])||"!"==char||"?"==char)&&value[i+1].match(/\s/)){for(result.push(value.slice(tokenStartI,i+1)),i=tokenStartI=i+1;null!=(_a=value[i+1])&&_a.match(/\s/);)i++;result.push(value.slice(tokenStartI,i+1)),tokenStartI=i+1}}return result}}let sentenceDiff=new SentenceDiff;class CssDiff extends Diff{tokenize(value){return value.split(/([{}:;,]|\s+)/)}}let cssDiff=new CssDiff;class JsonDiff extends Diff{constructor(){super(...arguments),this.tokenize=tokenize}get useLongestToken(){return!0}castInput(value,options){let{undefinedReplacement,stringifyReplacer=(k,v)=>void 0===v?undefinedReplacement:v}=options;return"string"==typeof value?value:JSON.stringify(canonicalize(value,null,null,stringifyReplacer),null," ")}equals(left,right,options){return super.equals(left.replace(/,([\r\n])/g,"$1"),right.replace(/,([\r\n])/g,"$1"),options)}}let jsonDiff=new JsonDiff;function canonicalize(obj,stack,replacementStack,replacer,key){stack=stack||[],replacementStack=replacementStack||[],replacer&&(obj=replacer(void 0===key?"":key,obj));let i;for(i=0;i<stack.length;i+=1)if(stack[i]===obj)return replacementStack[i];let canonicalizedObj;if("[object Array]"===Object.prototype.toString.call(obj)){for(stack.push(obj),canonicalizedObj=new Array(obj.length),replacementStack.push(canonicalizedObj),i=0;i<obj.length;i+=1)canonicalizedObj[i]=canonicalize(obj[i],stack,replacementStack,replacer,String(i));stack.pop(),replacementStack.pop()}else if("object"==typeof(obj=obj&&obj.toJSON?obj.toJSON():obj)&&null!==obj){stack.push(obj),canonicalizedObj={},replacementStack.push(canonicalizedObj);var sortedKeys=[];let key;for(key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&sortedKeys.push(key);for(sortedKeys.sort(),i=0;i<sortedKeys.length;i+=1)key=sortedKeys[i],canonicalizedObj[key]=canonicalize(obj[key],stack,replacementStack,replacer,key);stack.pop(),replacementStack.pop()}else canonicalizedObj=obj;return canonicalizedObj}class ArrayDiff extends Diff{tokenize(value){return value.slice()}join(value){return value}removeEmpty(value){return value}}let arrayDiff=new ArrayDiff;function parsePatch(uniDiff){let diffstr=uniDiff.split(/\n/),list=[],i=0;function parseIndex(){var index={};for(list.push(index);i<diffstr.length;){var line=diffstr[i];if(/^(---|\+\+\+|@@)\s/.test(line))break;var headerMatch=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);headerMatch&&(index.index=line.substring(headerMatch[0].length).trim()),i++}for(parseFileHeader(index),parseFileHeader(index),index.hunks=[];i<diffstr.length;){let line=diffstr[i];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(line))break;if(/^@@/.test(line))index.hunks.push((()=>{var chunkHeaderIndex=i,chunkHeaderLine=diffstr[i++],hunk={oldStart:+(chunkHeaderLine=chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/))[1],oldLines:void 0===chunkHeaderLine[2]?1:+chunkHeaderLine[2],newStart:+chunkHeaderLine[3],newLines:void 0===chunkHeaderLine[4]?1:+chunkHeaderLine[4],lines:[]};0===hunk.oldLines&&(hunk.oldStart+=1),0===hunk.newLines&&(hunk.newStart+=1);let addCount=0,removeCount=0;for(;i<diffstr.length&&(removeCount<hunk.oldLines||addCount<hunk.newLines||null!=(_a=diffstr[i])&&_a.startsWith("\\"));i++){var _a=0==diffstr[i].length&&i!=diffstr.length-1?" ":diffstr[i][0];if("+"!==_a&&"-"!==_a&&" "!==_a&&"\\"!==_a)throw new Error(`Hunk at line ${chunkHeaderIndex+1} contained invalid line `+diffstr[i]);hunk.lines.push(diffstr[i]),"+"===_a?addCount++:"-"===_a?removeCount++:" "===_a&&(addCount++,removeCount++)}if(addCount||1!==hunk.newLines||(hunk.newLines=0),removeCount||1!==hunk.oldLines||(hunk.oldLines=0),addCount!==hunk.newLines)throw new Error("Added line count did not match for hunk at line "+(chunkHeaderIndex+1));if(removeCount===hunk.oldLines)return hunk;throw new Error("Removed line count did not match for hunk at line "+(chunkHeaderIndex+1))})());else{if(line)throw new Error("Unknown line "+(i+1)+" "+JSON.stringify(line));i++}}}function parseFileHeader(index){var fileHeaderMatch=/^(---|\+\+\+)\s+/.exec(diffstr[i]);if(fileHeaderMatch){var fileHeaderMatch=fileHeaderMatch[1],data=diffstr[i].substring(3).trim().split("\t",2),header=(data[1]||"").trim();let fileName=data[0].replace(/\\\\/g,"\\");fileName.startsWith('"')&&fileName.endsWith('"')&&(fileName=fileName.substr(1,fileName.length-2)),"---"===fileHeaderMatch?(index.oldFileName=fileName,index.oldHeader=header):(index.newFileName=fileName,index.newHeader=header),i++}}for(;i<diffstr.length;)parseIndex();return list}function applyPatch(source,patch,options={}){let patches;if(1<(patches="string"==typeof patch?parsePatch(patch):Array.isArray(patch)?patch:[patch]).length)throw new Error("applyPatch only works with a single input.");return((source,patch,options={})=>{!options.autoConvertLineEndings&&null!=options.autoConvertLineEndings||((string=>string.includes("\r\n")&&!string.startsWith("\n")&&!string.match(/[^\r]\n/))(source)&&(patch=>!(patch=Array.isArray(patch)?patch:[patch]).some(index=>index.hunks.some(hunk=>hunk.lines.some(line=>!line.startsWith("\\")&&line.endsWith("\r")))))(patch)?patch=function unixToWin(patch){return Array.isArray(patch)?patch.map(p=>unixToWin(p)):Object.assign(Object.assign({},patch),{hunks:patch.hunks.map(hunk=>Object.assign(Object.assign({},hunk),{lines:hunk.lines.map((line,i)=>line.startsWith("\\")||line.endsWith("\r")||null!=(i=hunk.lines[i+1])&&i.startsWith("\\")?line:line+"\r")}))})}(patch):(string=>!string.includes("\r\n")&&string.includes("\n"))(source)&&(patch=>(patch=Array.isArray(patch)?patch:[patch]).some(index=>index.hunks.some(hunk=>hunk.lines.some(line=>line.endsWith("\r"))))&&patch.every(index=>index.hunks.every(hunk=>hunk.lines.every((line,i)=>line.startsWith("\\")||line.endsWith("\r")||(null==(line=hunk.lines[i+1])?void 0:line.startsWith("\\"))))))(patch)&&(patch=function winToUnix(patch){return Array.isArray(patch)?patch.map(p=>winToUnix(p)):Object.assign(Object.assign({},patch),{hunks:patch.hunks.map(hunk=>Object.assign(Object.assign({},hunk),{lines:hunk.lines.map(line=>line.endsWith("\r")?line.substring(0,line.length-1):line)}))})}(patch)));let lines=source.split("\n"),hunks=patch.hunks,compareLine=options.compareLine||((lineNumber,line,operation,patchContent)=>line===patchContent),fuzzFactor=options.fuzzFactor||0,minLine=0;if(fuzzFactor<0||!Number.isInteger(fuzzFactor))throw new Error("fuzzFactor must be a non-negative integer");if(!hunks.length)return source;let prevLine="",removeEOFNL=!1,addEOFNL=!1;for(let i=0;i<hunks[hunks.length-1].lines.length;i++){var line=hunks[hunks.length-1].lines[i];"\\"==line[0]&&("+"==prevLine[0]?removeEOFNL=!0:"-"==prevLine[0]&&(addEOFNL=!0)),prevLine=line}if(removeEOFNL){if(addEOFNL){if(!fuzzFactor&&""==lines[lines.length-1])return!1}else if(""==lines[lines.length-1])lines.pop();else if(!fuzzFactor)return!1}else if(addEOFNL)if(""!=lines[lines.length-1])lines.push("");else if(!fuzzFactor)return!1;let resultLines=[],prevHunkOffset=0;for(let i=0;i<hunks.length;i++){var hunk=hunks[i];let hunkResult;var maxLine=lines.length-hunk.oldLines+fuzzFactor;let toPos;for(let maxErrors=0;maxErrors<=fuzzFactor;maxErrors++){for(var iterator=((start,minLine,maxLine)=>{let wantForward=!0,backwardExhausted=!1,forwardExhausted=!1,localOffset=1;return function iterator(){if(wantForward&&!forwardExhausted){if(backwardExhausted?localOffset++:wantForward=!1,start+localOffset<=maxLine)return start+localOffset;forwardExhausted=!0}if(!backwardExhausted)return forwardExhausted||(wantForward=!0),minLine<=start-localOffset?start-localOffset++:(backwardExhausted=!0,iterator())}})(toPos=hunk.oldStart+prevHunkOffset-1,minLine,maxLine);void 0!==toPos&&!(hunkResult=function applyHunk(hunkLines,toPos,maxErrors,hunkLinesI=0,lastContextLineMatched=!0,patchedLines=[],patchedLinesLength=0){let nConsecutiveOldContextLines=0,nextContextLineMustMatch=!1;for(;hunkLinesI<hunkLines.length;hunkLinesI++){var operation=0<(hunkLine=hunkLines[hunkLinesI]).length?hunkLine[0]:" ",hunkLine=0<hunkLine.length?hunkLine.substr(1):hunkLine;if("-"===operation){if(!compareLine(toPos+1,lines[toPos],operation,hunkLine))return maxErrors&&null!=lines[toPos]?(patchedLines[patchedLinesLength]=lines[toPos],applyHunk(hunkLines,toPos+1,maxErrors-1,hunkLinesI,!1,patchedLines,patchedLinesLength+1)):null;toPos++,nConsecutiveOldContextLines=0}if("+"===operation){if(!lastContextLineMatched)return null;patchedLines[patchedLinesLength]=hunkLine,patchedLinesLength++,nConsecutiveOldContextLines=0,nextContextLineMustMatch=!0}if(" "===operation){if(nConsecutiveOldContextLines++,patchedLines[patchedLinesLength]=lines[toPos],!compareLine(toPos+1,lines[toPos],operation,hunkLine))return nextContextLineMustMatch||!maxErrors?null:lines[toPos]&&(applyHunk(hunkLines,toPos+1,maxErrors-1,hunkLinesI+1,!1,patchedLines,patchedLinesLength+1)||applyHunk(hunkLines,toPos+1,maxErrors-1,hunkLinesI,!1,patchedLines,patchedLinesLength+1))||applyHunk(hunkLines,toPos,maxErrors-1,hunkLinesI+1,!1,patchedLines,patchedLinesLength);patchedLinesLength++,lastContextLineMatched=!0,nextContextLineMustMatch=!1,toPos++}}return patchedLinesLength-=nConsecutiveOldContextLines,toPos-=nConsecutiveOldContextLines,patchedLines.length=patchedLinesLength,{patchedLines:patchedLines,oldLineLastI:toPos-1}}(hunk.lines,toPos,maxErrors));toPos=iterator());if(hunkResult)break}if(!hunkResult)return!1;for(let i=minLine;i<toPos;i++)resultLines.push(lines[i]);for(let i=0;i<hunkResult.patchedLines.length;i++){var line=hunkResult.patchedLines[i];resultLines.push(line)}minLine=hunkResult.oldLineLastI+1,prevHunkOffset=toPos+1-hunk.oldStart}for(let i=minLine;i<lines.length;i++)resultLines.push(lines[i]);return resultLines.join("\n")})(source,patches[0],options)}let INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options){let optionsObj,context=(void 0===(optionsObj=options?"function"==typeof options?{callback:options}:options:{}).context&&(optionsObj.context=4),optionsObj.context);if(optionsObj.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!optionsObj.callback)return diffLinesResultToPatch(diffLines(oldStr,newStr,optionsObj));{let callback=optionsObj.callback;diffLines(oldStr,newStr,Object.assign(Object.assign({},optionsObj),{callback:diff=>{diff=diffLinesResultToPatch(diff);callback(diff)}}))}function diffLinesResultToPatch(diff){if(diff){diff.push({value:"",lines:[]});var hunks=[];let oldRangeStart=0,newRangeStart=0,curRange=[],oldLine=1,newLine=1;for(let i=0;i<diff.length;i++){var line,current=diff[i],lines=current.lines||(text=>{var hasTrailingNl=text.endsWith("\n"),text=text.split("\n").map(line=>line+"\n");return hasTrailingNl?text.pop():text.push(text.pop().slice(0,-1)),text})(current.value);if(current.lines=lines,current.added||current.removed){oldRangeStart||(prev=diff[i-1],oldRangeStart=oldLine,newRangeStart=newLine,prev&&(curRange=0<context?contextLines(prev.lines.slice(-context)):[],oldRangeStart-=curRange.length,newRangeStart-=curRange.length));for(line of lines)curRange.push((current.added?"+":"-")+line);current.added?newLine+=lines.length:oldLine+=lines.length}else{if(oldRangeStart)if(lines.length<=2*context&&i<diff.length-2)for(let line of contextLines(lines))curRange.push(line);else{var prev=Math.min(lines.length,context);for(let line of contextLines(lines.slice(0,prev)))curRange.push(line);var hunk={oldStart:oldRangeStart,oldLines:oldLine-oldRangeStart+prev,newStart:newRangeStart,newLines:newLine-newRangeStart+prev,lines:curRange};hunks.push(hunk),oldRangeStart=0,newRangeStart=0,curRange=[]}oldLine+=lines.length,newLine+=lines.length}}for(let hunk of hunks)for(let i=0;i<hunk.lines.length;i++)hunk.lines[i].endsWith("\n")?hunk.lines[i]=hunk.lines[i].slice(0,-1):(hunk.lines.splice(i+1,0,"\"),i++);return{oldFileName:oldFileName,newFileName:newFileName,oldHeader:oldHeader,newHeader:newHeader,hunks:hunks};function contextLines(lines){return lines.map(function(entry){return" "+entry})}}}}function formatPatch(patch,headerOptions){if(headerOptions=headerOptions||INCLUDE_HEADERS,Array.isArray(patch)){if(1<patch.length&&!headerOptions.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return patch.map(p=>formatPatch(p,headerOptions)).join("\n")}var ret=[];headerOptions.includeIndex&&patch.oldFileName==patch.newFileName&&ret.push("Index: "+patch.oldFileName),headerOptions.includeUnderline&&ret.push("==================================================================="),headerOptions.includeFileHeaders&&(ret.push("--- "+patch.oldFileName+(void 0===patch.oldHeader?"":"\t"+patch.oldHeader)),ret.push("+++ "+patch.newFileName+(void 0===patch.newHeader?"":"\t"+patch.newHeader)));for(let i=0;i<patch.hunks.length;i++){var line,hunk=patch.hunks[i];0===hunk.oldLines&&--hunk.oldStart,0===hunk.newLines&&--hunk.newStart,ret.push("@@ -"+hunk.oldStart+","+hunk.oldLines+" +"+hunk.newStart+","+hunk.newLines+" @@");for(line of hunk.lines)ret.push(line)}return ret.join("\n")+"\n"}function createTwoFilesPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options){if(null!=(options="function"==typeof options?{callback:options}:options)&&options.callback){let callback=options.callback;structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,Object.assign(Object.assign({},options),{callback:patchObj=>{patchObj?callback(formatPatch(patchObj,options.headerOptions)):callback(void 0)}}))}else{oldFileName=structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options);if(oldFileName)return formatPatch(oldFileName,null==options?void 0:options.headerOptions)}}exports.Diff=Diff,exports.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0},exports.INCLUDE_HEADERS=INCLUDE_HEADERS,exports.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1},exports.applyPatch=applyPatch,exports.applyPatches=function(uniDiff,options){let spDiff="string"==typeof uniDiff?parsePatch(uniDiff):uniDiff,currentIndex=0;!function processIndex(){let index=spDiff[currentIndex++];if(!index)return options.complete();options.loadFile(index,function(err,data){if(err)return options.complete(err);err=applyPatch(data,index,options),options.patched(index,err,function(err){if(err)return options.complete(err);processIndex()})})}()},exports.arrayDiff=arrayDiff,exports.canonicalize=canonicalize,exports.characterDiff=characterDiff,exports.convertChangesToDMP=function(changes){var ret=[];let change,operation;for(let i=0;i<changes.length;i++)change=changes[i],operation=change.added?1:change.removed?-1:0,ret.push([operation,change.value]);return ret},exports.convertChangesToXML=function(changes){var ret=[];for(let i=0;i<changes.length;i++){var change=changes[i];change.added?ret.push("<ins>"):change.removed&&ret.push("<del>"),ret.push((s=>{let n=s;return n=(n=(n=(n=n.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/"/g,"&quot;")})(change.value)),change.added?ret.push("</ins>"):change.removed&&ret.push("</del>")}return ret.join("")},exports.createPatch=function(fileName,oldStr,newStr,oldHeader,newHeader,options){return createTwoFilesPatch(fileName,fileName,oldStr,newStr,oldHeader,newHeader,options)},exports.createTwoFilesPatch=createTwoFilesPatch,exports.cssDiff=cssDiff,exports.diffArrays=function(oldArr,newArr,options){return arrayDiff.diff(oldArr,newArr,options)},exports.diffChars=function(oldStr,newStr,options){return characterDiff.diff(oldStr,newStr,options)},exports.diffCss=function(oldStr,newStr,options){return cssDiff.diff(oldStr,newStr,options)},exports.diffJson=function(oldStr,newStr,options){return jsonDiff.diff(oldStr,newStr,options)},exports.diffLines=diffLines,exports.diffSentences=function(oldStr,newStr,options){return sentenceDiff.diff(oldStr,newStr,options)},exports.diffTrimmedLines=function(oldStr,newStr,options){return options=((options,defaults)=>{if("function"==typeof options)defaults.callback=options;else if(options)for(var name in options)Object.prototype.hasOwnProperty.call(options,name)&&(defaults[name]=options[name]);return defaults})(options,{ignoreWhitespace:!0}),lineDiff.diff(oldStr,newStr,options)},exports.diffWords=function(oldStr,newStr,options){return null==(null==options?void 0:options.ignoreWhitespace)||options.ignoreWhitespace?wordDiff.diff(oldStr,newStr,options):diffWordsWithSpace(oldStr,newStr,options)},exports.diffWordsWithSpace=diffWordsWithSpace,exports.formatPatch=formatPatch,exports.jsonDiff=jsonDiff,exports.lineDiff=lineDiff,exports.parsePatch=parsePatch,exports.reversePatch=function reversePatch(structuredPatch){return Array.isArray(structuredPatch)?structuredPatch.map(patch=>reversePatch(patch)).reverse():Object.assign(Object.assign({},structuredPatch),{oldFileName:structuredPatch.newFileName,oldHeader:structuredPatch.newHeader,newFileName:structuredPatch.oldFileName,newHeader:structuredPatch.oldHeader,hunks:structuredPatch.hunks.map(hunk=>({oldLines:hunk.newLines,oldStart:hunk.newStart,newLines:hunk.oldLines,newStart:hunk.oldStart,lines:hunk.lines.map(l=>l.startsWith("-")?"+"+l.slice(1):l.startsWith("+")?"-"+l.slice(1):l)}))})},exports.sentenceDiff=sentenceDiff,exports.structuredPatch=structuredPatch,exports.wordDiff=wordDiff,exports.wordsWithSpaceDiff=wordsWithSpaceDiff});
1
+ ((global,factory)=>{"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self).Diff={})})(this,function(exports){class Diff{diff(oldStr,newStr,options={}){let callback;"function"==typeof options?(callback=options,options={}):"callback"in options&&(callback=options.callback);oldStr=this.castInput(oldStr,options),newStr=this.castInput(newStr,options),oldStr=this.removeEmpty(this.tokenize(oldStr,options)),newStr=this.removeEmpty(this.tokenize(newStr,options));return this.diffWithOptionsObj(oldStr,newStr,options,callback)}diffWithOptionsObj(oldTokens,newTokens,options,callback){let _a,done=value=>{if(value=this.postProcess(value,options),!callback)return value;setTimeout(function(){callback(value)},0)},newLen=newTokens.length,oldLen=oldTokens.length,editLength=1,maxEditLength=newLen+oldLen;null!=options.maxEditLength&&(maxEditLength=Math.min(maxEditLength,options.maxEditLength));var maxExecutionTime=null!=(_a=options.timeout)?_a:1/0;let abortAfterTimestamp=Date.now()+maxExecutionTime,bestPath=[{oldPos:-1,lastComponent:void 0}],newPos=this.extractCommon(bestPath[0],newTokens,oldTokens,0,options);if(bestPath[0].oldPos+1>=oldLen&&newPos+1>=newLen)return done(this.buildValues(bestPath[0].lastComponent,newTokens,oldTokens));let minDiagonalToConsider=-1/0,maxDiagonalToConsider=1/0,execEditLength=()=>{for(let diagonalPath=Math.max(minDiagonalToConsider,-editLength);diagonalPath<=Math.min(maxDiagonalToConsider,editLength);diagonalPath+=2){let basePath;var removePath=bestPath[diagonalPath-1],addPath=bestPath[diagonalPath+1];removePath&&(bestPath[diagonalPath-1]=void 0);let canAdd=!1;addPath&&(addPathNewPos=addPath.oldPos-diagonalPath,canAdd=addPath&&0<=addPathNewPos&&addPathNewPos<newLen);var addPathNewPos=removePath&&removePath.oldPos+1<oldLen;if(canAdd||addPathNewPos){if(basePath=!addPathNewPos||canAdd&&removePath.oldPos<addPath.oldPos?this.addToPath(addPath,!0,!1,0,options):this.addToPath(removePath,!1,!0,1,options),newPos=this.extractCommon(basePath,newTokens,oldTokens,diagonalPath,options),basePath.oldPos+1>=oldLen&&newPos+1>=newLen)return done(this.buildValues(basePath.lastComponent,newTokens,oldTokens))||!0;(bestPath[diagonalPath]=basePath).oldPos+1>=oldLen&&(maxDiagonalToConsider=Math.min(maxDiagonalToConsider,diagonalPath-1)),newPos+1>=newLen&&(minDiagonalToConsider=Math.max(minDiagonalToConsider,diagonalPath+1))}else bestPath[diagonalPath]=void 0}editLength++};if(callback)!function exec(){setTimeout(function(){if(editLength>maxEditLength||Date.now()>abortAfterTimestamp)return callback(void 0);execEditLength()||exec()},0)}();else for(;editLength<=maxEditLength&&Date.now()<=abortAfterTimestamp;){var ret=execEditLength();if(ret)return ret}}addToPath(path,added,removed,oldPosInc,options){var last=path.lastComponent;return last&&!options.oneChangePerToken&&last.added===added&&last.removed===removed?{oldPos:path.oldPos+oldPosInc,lastComponent:{count:last.count+1,added:added,removed:removed,previousComponent:last.previousComponent}}:{oldPos:path.oldPos+oldPosInc,lastComponent:{count:1,added:added,removed:removed,previousComponent:last}}}extractCommon(basePath,newTokens,oldTokens,diagonalPath,options){var newLen=newTokens.length,oldLen=oldTokens.length;let oldPos=basePath.oldPos,newPos=oldPos-diagonalPath,commonCount=0;for(;newPos+1<newLen&&oldPos+1<oldLen&&this.equals(oldTokens[oldPos+1],newTokens[newPos+1],options);)newPos++,oldPos++,commonCount++,options.oneChangePerToken&&(basePath.lastComponent={count:1,previousComponent:basePath.lastComponent,added:!1,removed:!1});return commonCount&&!options.oneChangePerToken&&(basePath.lastComponent={count:commonCount,previousComponent:basePath.lastComponent,added:!1,removed:!1}),basePath.oldPos=oldPos,newPos}equals(left,right,options){return options.comparator?options.comparator(left,right):left===right||!!options.ignoreCase&&left.toLowerCase()===right.toLowerCase()}removeEmpty(array){var ret=[];for(let i=0;i<array.length;i++)array[i]&&ret.push(array[i]);return ret}castInput(value,options){return value}tokenize(value,options){return Array.from(value)}join(chars){return chars.join("")}postProcess(changeObjects,options){return changeObjects}get useLongestToken(){return!1}buildValues(lastComponent,newTokens,oldTokens){for(var nextComponent,components=[];lastComponent;)components.push(lastComponent),nextComponent=lastComponent.previousComponent,delete lastComponent.previousComponent,lastComponent=nextComponent;components.reverse();var componentLen=components.length;let componentPos=0,newPos=0,oldPos=0;for(;componentPos<componentLen;componentPos++){var component=components[componentPos];if(component.removed)component.value=this.join(oldTokens.slice(oldPos,oldPos+component.count)),oldPos+=component.count;else{if(!component.added&&this.useLongestToken){let value=newTokens.slice(newPos,newPos+component.count);value=value.map(function(value,i){i=oldTokens[oldPos+i];return i.length>value.length?i:value}),component.value=this.join(value)}else component.value=this.join(newTokens.slice(newPos,newPos+component.count));newPos+=component.count,component.added||(oldPos+=component.count)}}return components}}class CharacterDiff extends Diff{}let characterDiff=new CharacterDiff;function longestCommonPrefix(str1,str2){let i;for(i=0;i<str1.length&&i<str2.length;i++)if(str1[i]!=str2[i])return str1.slice(0,i);return str1.slice(0,i)}function longestCommonSuffix(str1,str2){let i;if(!str1||!str2||str1[str1.length-1]!=str2[str2.length-1])return"";for(i=0;i<str1.length&&i<str2.length;i++)if(str1[str1.length-(i+1)]!=str2[str2.length-(i+1)])return str1.slice(-i);return str1.slice(-i)}function replacePrefix(string,oldPrefix,newPrefix){if(string.slice(0,oldPrefix.length)!=oldPrefix)throw Error(`string ${JSON.stringify(string)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`);return newPrefix+string.slice(oldPrefix.length)}function replaceSuffix(string,oldSuffix,newSuffix){if(!oldSuffix)return string+newSuffix;if(string.slice(-oldSuffix.length)!=oldSuffix)throw Error(`string ${JSON.stringify(string)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`);return string.slice(0,-oldSuffix.length)+newSuffix}function removePrefix(string,oldPrefix){return replacePrefix(string,oldPrefix,"")}function removeSuffix(string,oldSuffix){return replaceSuffix(string,oldSuffix,"")}function maximumOverlap(string1,string2){return string2.slice(0,((a,b)=>{let startA=0,endB=(a.length>b.length&&(startA=a.length-b.length),b.length),map=(a.length<b.length&&(endB=a.length),Array(endB)),k=0;map[0]=0;for(let j=1;j<endB;j++){for(b[j]==b[k]?map[j]=map[k]:map[j]=k;0<k&&b[j]!=b[k];)k=map[k];b[j]==b[k]&&k++}k=0;for(let i=startA;i<a.length;i++){for(;0<k&&a[i]!=b[k];)k=map[k];a[i]==b[k]&&k++}return k})(string1,string2))}function trailingWs(string){let i;for(i=string.length-1;0<=i&&string[i].match(/\s/);i--);return string.substring(i+1)}function leadingWs(string){string=string.match(/^\s*/);return string?string[0]:""}let extendedWordChars="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",tokenizeIncludingWhitespace=new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`,"ug");class WordDiff extends Diff{equals(left,right,options){return options.ignoreCase&&(left=left.toLowerCase(),right=right.toLowerCase()),left.trim()===right.trim()}tokenize(value,options={}){let parts;if(options.intlSegmenter){var segmentObj,options=options.intlSegmenter;if("word"!=options.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');parts=[];for(segmentObj of Array.from(options.segment(value))){var segment=segmentObj.segment;parts.length&&/\s/.test(parts[parts.length-1])&&/\s/.test(segment)?parts[parts.length-1]+=segment:parts.push(segment)}}else parts=value.match(tokenizeIncludingWhitespace)||[];let tokens=[],prevPart=null;return parts.forEach(part=>{/\s/.test(part)?null==prevPart?tokens.push(part):tokens.push(tokens.pop()+part):null!=prevPart&&/\s/.test(prevPart)?tokens[tokens.length-1]==prevPart?tokens.push(tokens.pop()+part):tokens.push(prevPart+part):tokens.push(part),prevPart=part}),tokens}join(tokens){return tokens.map((token,i)=>0==i?token:token.replace(/^\s+/,"")).join("")}postProcess(changes,options){if(changes&&!options.oneChangePerToken){let lastKeep=null,insertion=null,deletion=null;changes.forEach(change=>{change.added?insertion=change:deletion=change.removed?change:((insertion||deletion)&&dedupeWhitespaceInChangeObjects(lastKeep,deletion,insertion,change),lastKeep=change,insertion=null)}),(insertion||deletion)&&dedupeWhitespaceInChangeObjects(lastKeep,deletion,insertion,null)}return changes}}let wordDiff=new WordDiff;function dedupeWhitespaceInChangeObjects(startKeep,deletion,insertion,endKeep){if(deletion&&insertion){var oldWsPrefix=leadingWs(deletion.value),oldWsSuffix=trailingWs(deletion.value),newWsPrefix=leadingWs(insertion.value),newWsSuffix=trailingWs(insertion.value);startKeep&&(oldWsPrefix=longestCommonPrefix(oldWsPrefix,newWsPrefix),startKeep.value=replaceSuffix(startKeep.value,newWsPrefix,oldWsPrefix),deletion.value=removePrefix(deletion.value,oldWsPrefix),insertion.value=removePrefix(insertion.value,oldWsPrefix)),endKeep&&(newWsPrefix=longestCommonSuffix(oldWsSuffix,newWsSuffix),endKeep.value=replacePrefix(endKeep.value,newWsSuffix,newWsPrefix),deletion.value=removeSuffix(deletion.value,newWsPrefix),insertion.value=removeSuffix(insertion.value,newWsPrefix))}else if(insertion){if(startKeep&&(oldWsPrefix=leadingWs(insertion.value),insertion.value=insertion.value.substring(oldWsPrefix.length)),endKeep){let ws=leadingWs(endKeep.value);endKeep.value=endKeep.value.substring(ws.length)}}else if(startKeep&&endKeep){oldWsSuffix=leadingWs(endKeep.value),newWsSuffix=leadingWs(deletion.value),newWsPrefix=trailingWs(deletion.value),insertion=longestCommonPrefix(oldWsSuffix,newWsSuffix),oldWsPrefix=(deletion.value=removePrefix(deletion.value,insertion),longestCommonSuffix(removePrefix(oldWsSuffix,insertion),newWsPrefix));deletion.value=removeSuffix(deletion.value,oldWsPrefix),endKeep.value=replacePrefix(endKeep.value,oldWsSuffix,oldWsPrefix),startKeep.value=replaceSuffix(startKeep.value,oldWsSuffix,oldWsSuffix.slice(0,oldWsSuffix.length-oldWsPrefix.length))}else if(endKeep){newWsSuffix=leadingWs(endKeep.value),insertion=maximumOverlap(trailingWs(deletion.value),newWsSuffix);deletion.value=removeSuffix(deletion.value,insertion)}else if(startKeep){let overlap=maximumOverlap(trailingWs(startKeep.value),leadingWs(deletion.value));deletion.value=removePrefix(deletion.value,overlap)}}class WordsWithSpaceDiff extends Diff{tokenize(value){var regex=new RegExp(`(\\r?\\n)|[${extendedWordChars}]+|[^\\S\\n\\r]+|[^${extendedWordChars}]`,"ug");return value.match(regex)||[]}}let wordsWithSpaceDiff=new WordsWithSpaceDiff;function diffWordsWithSpace(oldStr,newStr,options){return wordsWithSpaceDiff.diff(oldStr,newStr,options)}class LineDiff extends Diff{constructor(){super(...arguments),this.tokenize=tokenize}equals(left,right,options){return options.ignoreWhitespace?(options.newlineIsToken&&left.includes("\n")||(left=left.trim()),options.newlineIsToken&&right.includes("\n")||(right=right.trim())):options.ignoreNewlineAtEof&&!options.newlineIsToken&&(left.endsWith("\n")&&(left=left.slice(0,-1)),right.endsWith("\n"))&&(right=right.slice(0,-1)),super.equals(left,right,options)}}let lineDiff=new LineDiff;function diffLines(oldStr,newStr,options){return lineDiff.diff(oldStr,newStr,options)}function tokenize(value,options){var retLines=[],linesAndNewlines=(value=options.stripTrailingCr?value.replace(/\r\n/g,"\n"):value).split(/(\n|\r\n)/);linesAndNewlines[linesAndNewlines.length-1]||linesAndNewlines.pop();for(let i=0;i<linesAndNewlines.length;i++){var line=linesAndNewlines[i];i%2&&!options.newlineIsToken?retLines[retLines.length-1]+=line:retLines.push(line)}return retLines}class SentenceDiff extends Diff{tokenize(value){var _a,char,result=[];let tokenStartI=0;for(let i=0;i<value.length;i++){if(i==value.length-1){result.push(value.slice(tokenStartI));break}if(("."==(char=value[i])||"!"==char||"?"==char)&&value[i+1].match(/\s/)){for(result.push(value.slice(tokenStartI,i+1)),i=tokenStartI=i+1;null!=(_a=value[i+1])&&_a.match(/\s/);)i++;result.push(value.slice(tokenStartI,i+1)),tokenStartI=i+1}}return result}}let sentenceDiff=new SentenceDiff;class CssDiff extends Diff{tokenize(value){return value.split(/([{}:;,]|\s+)/)}}let cssDiff=new CssDiff;class JsonDiff extends Diff{constructor(){super(...arguments),this.tokenize=tokenize}get useLongestToken(){return!0}castInput(value,options){let{undefinedReplacement,stringifyReplacer=(k,v)=>void 0===v?undefinedReplacement:v}=options;return"string"==typeof value?value:JSON.stringify(canonicalize(value,null,null,stringifyReplacer),null," ")}equals(left,right,options){return super.equals(left.replace(/,([\r\n])/g,"$1"),right.replace(/,([\r\n])/g,"$1"),options)}}let jsonDiff=new JsonDiff;function canonicalize(obj,stack,replacementStack,replacer,key){stack=stack||[],replacementStack=replacementStack||[],replacer&&(obj=replacer(void 0===key?"":key,obj));let i;for(i=0;i<stack.length;i+=1)if(stack[i]===obj)return replacementStack[i];let canonicalizedObj;if("[object Array]"===Object.prototype.toString.call(obj)){for(stack.push(obj),canonicalizedObj=new Array(obj.length),replacementStack.push(canonicalizedObj),i=0;i<obj.length;i+=1)canonicalizedObj[i]=canonicalize(obj[i],stack,replacementStack,replacer,String(i));stack.pop(),replacementStack.pop()}else if("object"==typeof(obj=obj&&obj.toJSON?obj.toJSON():obj)&&null!==obj){stack.push(obj),canonicalizedObj={},replacementStack.push(canonicalizedObj);var sortedKeys=[];let key;for(key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&sortedKeys.push(key);for(sortedKeys.sort(),i=0;i<sortedKeys.length;i+=1)key=sortedKeys[i],canonicalizedObj[key]=canonicalize(obj[key],stack,replacementStack,replacer,key);stack.pop(),replacementStack.pop()}else canonicalizedObj=obj;return canonicalizedObj}class ArrayDiff extends Diff{tokenize(value){return value.slice()}join(value){return value}removeEmpty(value){return value}}let arrayDiff=new ArrayDiff;function parsePatch(uniDiff){let diffstr=uniDiff.split(/\n/),list=[],i=0;function parseIndex(){var index={};for(list.push(index);i<diffstr.length;){var line=diffstr[i];if(/^(---|\+\+\+|@@)\s/.test(line))break;var headerMatch=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);headerMatch&&(index.index=line.substring(headerMatch[0].length).trim()),i++}for(parseFileHeader(index),parseFileHeader(index),index.hunks=[];i<diffstr.length;){let line=diffstr[i];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(line))break;if(/^@@/.test(line))index.hunks.push((()=>{var chunkHeaderIndex=i,chunkHeaderLine=diffstr[i++],hunk={oldStart:+(chunkHeaderLine=chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/))[1],oldLines:void 0===chunkHeaderLine[2]?1:+chunkHeaderLine[2],newStart:+chunkHeaderLine[3],newLines:void 0===chunkHeaderLine[4]?1:+chunkHeaderLine[4],lines:[]};0===hunk.oldLines&&(hunk.oldStart+=1),0===hunk.newLines&&(hunk.newStart+=1);let addCount=0,removeCount=0;for(;i<diffstr.length&&(removeCount<hunk.oldLines||addCount<hunk.newLines||null!=(_a=diffstr[i])&&_a.startsWith("\\"));i++){var _a=0==diffstr[i].length&&i!=diffstr.length-1?" ":diffstr[i][0];if("+"!==_a&&"-"!==_a&&" "!==_a&&"\\"!==_a)throw new Error(`Hunk at line ${chunkHeaderIndex+1} contained invalid line `+diffstr[i]);hunk.lines.push(diffstr[i]),"+"===_a?addCount++:"-"===_a?removeCount++:" "===_a&&(addCount++,removeCount++)}if(addCount||1!==hunk.newLines||(hunk.newLines=0),removeCount||1!==hunk.oldLines||(hunk.oldLines=0),addCount!==hunk.newLines)throw new Error("Added line count did not match for hunk at line "+(chunkHeaderIndex+1));if(removeCount===hunk.oldLines)return hunk;throw new Error("Removed line count did not match for hunk at line "+(chunkHeaderIndex+1))})());else{if(line)throw new Error("Unknown line "+(i+1)+" "+JSON.stringify(line));i++}}}function parseFileHeader(index){var fileHeaderMatch=/^(---|\+\+\+)\s+/.exec(diffstr[i]);if(fileHeaderMatch){var fileHeaderMatch=fileHeaderMatch[1],data=diffstr[i].substring(3).trim().split("\t",2),header=(data[1]||"").trim();let fileName=data[0].replace(/\\\\/g,"\\");fileName.startsWith('"')&&fileName.endsWith('"')&&(fileName=fileName.substr(1,fileName.length-2)),"---"===fileHeaderMatch?(index.oldFileName=fileName,index.oldHeader=header):(index.newFileName=fileName,index.newHeader=header),i++}}for(;i<diffstr.length;)parseIndex();return list}function applyPatch(source,patch,options={}){let patches;if(1<(patches="string"==typeof patch?parsePatch(patch):Array.isArray(patch)?patch:[patch]).length)throw new Error("applyPatch only works with a single input.");return((source,patch,options={})=>{!options.autoConvertLineEndings&&null!=options.autoConvertLineEndings||((string=>string.includes("\r\n")&&!string.startsWith("\n")&&!string.match(/[^\r]\n/))(source)&&(patch=>!(patch=Array.isArray(patch)?patch:[patch]).some(index=>index.hunks.some(hunk=>hunk.lines.some(line=>!line.startsWith("\\")&&line.endsWith("\r")))))(patch)?patch=function unixToWin(patch){return Array.isArray(patch)?patch.map(p=>unixToWin(p)):Object.assign(Object.assign({},patch),{hunks:patch.hunks.map(hunk=>Object.assign(Object.assign({},hunk),{lines:hunk.lines.map((line,i)=>line.startsWith("\\")||line.endsWith("\r")||null!=(i=hunk.lines[i+1])&&i.startsWith("\\")?line:line+"\r")}))})}(patch):(string=>!string.includes("\r\n")&&string.includes("\n"))(source)&&(patch=>(patch=Array.isArray(patch)?patch:[patch]).some(index=>index.hunks.some(hunk=>hunk.lines.some(line=>line.endsWith("\r"))))&&patch.every(index=>index.hunks.every(hunk=>hunk.lines.every((line,i)=>line.startsWith("\\")||line.endsWith("\r")||(null==(line=hunk.lines[i+1])?void 0:line.startsWith("\\"))))))(patch)&&(patch=function winToUnix(patch){return Array.isArray(patch)?patch.map(p=>winToUnix(p)):Object.assign(Object.assign({},patch),{hunks:patch.hunks.map(hunk=>Object.assign(Object.assign({},hunk),{lines:hunk.lines.map(line=>line.endsWith("\r")?line.substring(0,line.length-1):line)}))})}(patch)));let lines=source.split("\n"),hunks=patch.hunks,compareLine=options.compareLine||((lineNumber,line,operation,patchContent)=>line===patchContent),fuzzFactor=options.fuzzFactor||0,minLine=0;if(fuzzFactor<0||!Number.isInteger(fuzzFactor))throw new Error("fuzzFactor must be a non-negative integer");if(!hunks.length)return source;let prevLine="",removeEOFNL=!1,addEOFNL=!1;for(let i=0;i<hunks[hunks.length-1].lines.length;i++){var line=hunks[hunks.length-1].lines[i];"\\"==line[0]&&("+"==prevLine[0]?removeEOFNL=!0:"-"==prevLine[0]&&(addEOFNL=!0)),prevLine=line}if(removeEOFNL){if(addEOFNL){if(!fuzzFactor&&""==lines[lines.length-1])return!1}else if(""==lines[lines.length-1])lines.pop();else if(!fuzzFactor)return!1}else if(addEOFNL)if(""!=lines[lines.length-1])lines.push("");else if(!fuzzFactor)return!1;let resultLines=[],prevHunkOffset=0;for(let i=0;i<hunks.length;i++){var hunk=hunks[i];let hunkResult;var maxLine=lines.length-hunk.oldLines+fuzzFactor;let toPos;for(let maxErrors=0;maxErrors<=fuzzFactor;maxErrors++){for(var iterator=((start,minLine,maxLine)=>{let wantForward=!0,backwardExhausted=!1,forwardExhausted=!1,localOffset=1;return function iterator(){if(wantForward&&!forwardExhausted){if(backwardExhausted?localOffset++:wantForward=!1,start+localOffset<=maxLine)return start+localOffset;forwardExhausted=!0}if(!backwardExhausted)return forwardExhausted||(wantForward=!0),minLine<=start-localOffset?start-localOffset++:(backwardExhausted=!0,iterator())}})(toPos=hunk.oldStart+prevHunkOffset-1,minLine,maxLine);void 0!==toPos&&!(hunkResult=function applyHunk(hunkLines,toPos,maxErrors,hunkLinesI=0,lastContextLineMatched=!0,patchedLines=[],patchedLinesLength=0){let nConsecutiveOldContextLines=0,nextContextLineMustMatch=!1;for(;hunkLinesI<hunkLines.length;hunkLinesI++){var operation=0<(hunkLine=hunkLines[hunkLinesI]).length?hunkLine[0]:" ",hunkLine=0<hunkLine.length?hunkLine.substr(1):hunkLine;if("-"===operation){if(!compareLine(toPos+1,lines[toPos],operation,hunkLine))return maxErrors&&null!=lines[toPos]?(patchedLines[patchedLinesLength]=lines[toPos],applyHunk(hunkLines,toPos+1,maxErrors-1,hunkLinesI,!1,patchedLines,patchedLinesLength+1)):null;toPos++,nConsecutiveOldContextLines=0}if("+"===operation){if(!lastContextLineMatched)return null;patchedLines[patchedLinesLength]=hunkLine,patchedLinesLength++,nConsecutiveOldContextLines=0,nextContextLineMustMatch=!0}if(" "===operation){if(nConsecutiveOldContextLines++,patchedLines[patchedLinesLength]=lines[toPos],!compareLine(toPos+1,lines[toPos],operation,hunkLine))return nextContextLineMustMatch||!maxErrors?null:lines[toPos]&&(applyHunk(hunkLines,toPos+1,maxErrors-1,hunkLinesI+1,!1,patchedLines,patchedLinesLength+1)||applyHunk(hunkLines,toPos+1,maxErrors-1,hunkLinesI,!1,patchedLines,patchedLinesLength+1))||applyHunk(hunkLines,toPos,maxErrors-1,hunkLinesI+1,!1,patchedLines,patchedLinesLength);patchedLinesLength++,lastContextLineMatched=!0,nextContextLineMustMatch=!1,toPos++}}return patchedLinesLength-=nConsecutiveOldContextLines,toPos-=nConsecutiveOldContextLines,patchedLines.length=patchedLinesLength,{patchedLines:patchedLines,oldLineLastI:toPos-1}}(hunk.lines,toPos,maxErrors));toPos=iterator());if(hunkResult)break}if(!hunkResult)return!1;for(let i=minLine;i<toPos;i++)resultLines.push(lines[i]);for(let i=0;i<hunkResult.patchedLines.length;i++){var line=hunkResult.patchedLines[i];resultLines.push(line)}minLine=hunkResult.oldLineLastI+1,prevHunkOffset=toPos+1-hunk.oldStart}for(let i=minLine;i<lines.length;i++)resultLines.push(lines[i]);return resultLines.join("\n")})(source,patches[0],options)}let INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options){let optionsObj,context=(void 0===(optionsObj=options?"function"==typeof options?{callback:options}:options:{}).context&&(optionsObj.context=4),optionsObj.context);if(optionsObj.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!optionsObj.callback)return diffLinesResultToPatch(diffLines(oldStr,newStr,optionsObj));{let callback=optionsObj.callback;diffLines(oldStr,newStr,Object.assign(Object.assign({},optionsObj),{callback:diff=>{diff=diffLinesResultToPatch(diff);callback(diff)}}))}function diffLinesResultToPatch(diff){if(diff){diff.push({value:"",lines:[]});var hunks=[];let oldRangeStart=0,newRangeStart=0,curRange=[],oldLine=1,newLine=1;for(let i=0;i<diff.length;i++){var line,current=diff[i],lines=current.lines||(text=>{var hasTrailingNl=text.endsWith("\n"),text=text.split("\n").map(line=>line+"\n");return hasTrailingNl?text.pop():text.push(text.pop().slice(0,-1)),text})(current.value);if(current.lines=lines,current.added||current.removed){oldRangeStart||(prev=diff[i-1],oldRangeStart=oldLine,newRangeStart=newLine,prev&&(curRange=0<context?contextLines(prev.lines.slice(-context)):[],oldRangeStart-=curRange.length,newRangeStart-=curRange.length));for(line of lines)curRange.push((current.added?"+":"-")+line);current.added?newLine+=lines.length:oldLine+=lines.length}else{if(oldRangeStart)if(lines.length<=2*context&&i<diff.length-2)for(let line of contextLines(lines))curRange.push(line);else{var prev=Math.min(lines.length,context);for(let line of contextLines(lines.slice(0,prev)))curRange.push(line);var hunk={oldStart:oldRangeStart,oldLines:oldLine-oldRangeStart+prev,newStart:newRangeStart,newLines:newLine-newRangeStart+prev,lines:curRange};hunks.push(hunk),oldRangeStart=0,newRangeStart=0,curRange=[]}oldLine+=lines.length,newLine+=lines.length}}for(let hunk of hunks)for(let i=0;i<hunk.lines.length;i++)hunk.lines[i].endsWith("\n")?hunk.lines[i]=hunk.lines[i].slice(0,-1):(hunk.lines.splice(i+1,0,"\"),i++);return{oldFileName:oldFileName,newFileName:newFileName,oldHeader:oldHeader,newHeader:newHeader,hunks:hunks};function contextLines(lines){return lines.map(function(entry){return" "+entry})}}}}function formatPatch(patch,headerOptions){if(headerOptions=headerOptions||INCLUDE_HEADERS,Array.isArray(patch)){if(1<patch.length&&!headerOptions.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return patch.map(p=>formatPatch(p,headerOptions)).join("\n")}var ret=[];headerOptions.includeIndex&&patch.oldFileName==patch.newFileName&&ret.push("Index: "+patch.oldFileName),headerOptions.includeUnderline&&ret.push("==================================================================="),headerOptions.includeFileHeaders&&(ret.push("--- "+patch.oldFileName+(void 0===patch.oldHeader?"":"\t"+patch.oldHeader)),ret.push("+++ "+patch.newFileName+(void 0===patch.newHeader?"":"\t"+patch.newHeader)));for(let i=0;i<patch.hunks.length;i++){var line,hunk=patch.hunks[i];0===hunk.oldLines&&--hunk.oldStart,0===hunk.newLines&&--hunk.newStart,ret.push("@@ -"+hunk.oldStart+","+hunk.oldLines+" +"+hunk.newStart+","+hunk.newLines+" @@");for(line of hunk.lines)ret.push(line)}return ret.join("\n")+"\n"}function createTwoFilesPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options){if(null!=(options="function"==typeof options?{callback:options}:options)&&options.callback){let callback=options.callback;structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,Object.assign(Object.assign({},options),{callback:patchObj=>{patchObj?callback(formatPatch(patchObj,options.headerOptions)):callback(void 0)}}))}else{oldFileName=structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options);if(oldFileName)return formatPatch(oldFileName,null==options?void 0:options.headerOptions)}}exports.Diff=Diff,exports.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0},exports.INCLUDE_HEADERS=INCLUDE_HEADERS,exports.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1},exports.applyPatch=applyPatch,exports.applyPatches=function(uniDiff,options){let spDiff="string"==typeof uniDiff?parsePatch(uniDiff):uniDiff,currentIndex=0;!function processIndex(){let index=spDiff[currentIndex++];if(!index)return options.complete();options.loadFile(index,function(err,data){if(err)return options.complete(err);err=applyPatch(data,index,options),options.patched(index,err,function(err){if(err)return options.complete(err);processIndex()})})}()},exports.arrayDiff=arrayDiff,exports.canonicalize=canonicalize,exports.characterDiff=characterDiff,exports.convertChangesToDMP=function(changes){var ret=[];let change,operation;for(let i=0;i<changes.length;i++)change=changes[i],operation=change.added?1:change.removed?-1:0,ret.push([operation,change.value]);return ret},exports.convertChangesToXML=function(changes){var ret=[];for(let i=0;i<changes.length;i++){var change=changes[i];change.added?ret.push("<ins>"):change.removed&&ret.push("<del>"),ret.push((s=>{let n=s;return n=(n=(n=(n=n.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/"/g,"&quot;")})(change.value)),change.added?ret.push("</ins>"):change.removed&&ret.push("</del>")}return ret.join("")},exports.createPatch=function(fileName,oldStr,newStr,oldHeader,newHeader,options){return createTwoFilesPatch(fileName,fileName,oldStr,newStr,oldHeader,newHeader,options)},exports.createTwoFilesPatch=createTwoFilesPatch,exports.cssDiff=cssDiff,exports.diffArrays=function(oldArr,newArr,options){return arrayDiff.diff(oldArr,newArr,options)},exports.diffChars=function(oldStr,newStr,options){return characterDiff.diff(oldStr,newStr,options)},exports.diffCss=function(oldStr,newStr,options){return cssDiff.diff(oldStr,newStr,options)},exports.diffJson=function(oldStr,newStr,options){return jsonDiff.diff(oldStr,newStr,options)},exports.diffLines=diffLines,exports.diffSentences=function(oldStr,newStr,options){return sentenceDiff.diff(oldStr,newStr,options)},exports.diffTrimmedLines=function(oldStr,newStr,options){return options=((options,defaults)=>{if("function"==typeof options)defaults.callback=options;else if(options)for(var name in options)Object.prototype.hasOwnProperty.call(options,name)&&(defaults[name]=options[name]);return defaults})(options,{ignoreWhitespace:!0}),lineDiff.diff(oldStr,newStr,options)},exports.diffWords=function(oldStr,newStr,options){return null==(null==options?void 0:options.ignoreWhitespace)||options.ignoreWhitespace?wordDiff.diff(oldStr,newStr,options):diffWordsWithSpace(oldStr,newStr,options)},exports.diffWordsWithSpace=diffWordsWithSpace,exports.formatPatch=formatPatch,exports.jsonDiff=jsonDiff,exports.lineDiff=lineDiff,exports.parsePatch=parsePatch,exports.reversePatch=function reversePatch(structuredPatch){return Array.isArray(structuredPatch)?structuredPatch.map(patch=>reversePatch(patch)).reverse():Object.assign(Object.assign({},structuredPatch),{oldFileName:structuredPatch.newFileName,oldHeader:structuredPatch.newHeader,newFileName:structuredPatch.oldFileName,newHeader:structuredPatch.oldHeader,hunks:structuredPatch.hunks.map(hunk=>({oldLines:hunk.newLines,oldStart:hunk.newStart,newLines:hunk.oldLines,newStart:hunk.oldStart,lines:hunk.lines.map(l=>l.startsWith("-")?"+"+l.slice(1):l.startsWith("+")?"-"+l.slice(1):l)}))})},exports.sentenceDiff=sentenceDiff,exports.structuredPatch=structuredPatch,exports.wordDiff=wordDiff,exports.wordsWithSpaceDiff=wordsWithSpaceDiff});
@@ -1 +1 @@
1
- {"version":3,"file":"word.d.ts","sourceRoot":"","sources":["../../src/diff/word.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,4BAA4B,EAAC,MAAM,aAAa,CAAC;AAqDvL,cAAM,QAAS,SAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IACzC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,GAAG,4BAA4B;IASrG,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,yBAAyB,GAAG,4BAAiC;IAwC9F,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE;IAerB,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG;CA6B1D;AAED,eAAO,MAAM,QAAQ,UAAiB,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,CAAC,MAAM,CAAC,GACxC,SAAS,CAAC;AACb,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GAAG,uBAAuB,CAAC,MAAM,CAAC,GACnE,SAAS,CAAA;AACZ,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,4BAA4B,GAAG,0BAA0B,CAAC,MAAM,CAAC,GACzE,SAAS,CAAA;AACZ,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GACjC,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAA;AACrC,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAA;AA4IzB,cAAM,kBAAmB,SAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM;CASvB;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,CAAC,MAAM,CAAC,GACxC,SAAS,CAAC;AACb,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GAAG,uBAAuB,CAAC,MAAM,CAAC,GACnE,SAAS,CAAA;AACZ,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,4BAA4B,GAAG,0BAA0B,CAAC,MAAM,CAAC,GACzE,SAAS,CAAA;AACZ,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GACjC,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAA;AACrC,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAA"}
1
+ {"version":3,"file":"word.d.ts","sourceRoot":"","sources":["../../src/diff/word.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,4BAA4B,EAAC,MAAM,aAAa,CAAC;AAqDvL,cAAM,QAAS,SAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IACzC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,GAAG,4BAA4B;IASrG,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,yBAAyB,GAAG,4BAAiC;IAoD9F,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE;IAerB,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG;CA6B1D;AAED,eAAO,MAAM,QAAQ,UAAiB,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,CAAC,MAAM,CAAC,GACxC,SAAS,CAAC;AACb,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GAAG,uBAAuB,CAAC,MAAM,CAAC,GACnE,SAAS,CAAA;AACZ,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,4BAA4B,GAAG,0BAA0B,CAAC,MAAM,CAAC,GACzE,SAAS,CAAA;AACZ,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GACjC,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAA;AACrC,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAA;AA8IzB,cAAM,kBAAmB,SAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM;CASvB;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,CAAC,MAAM,CAAC,GACxC,SAAS,CAAC;AACb,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GAAG,uBAAuB,CAAC,MAAM,CAAC,GACnE,SAAS,CAAA;AACZ,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,4BAA4B,GAAG,0BAA0B,CAAC,MAAM,CAAC,GACzE,SAAS,CAAA;AACZ,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,yBAAyB,GACjC,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAA;AACrC,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAA"}
@@ -89,9 +89,23 @@ var WordDiff = /** @class */ (function (_super) {
89
89
  // We want `parts` to be an array whose elements alternate between being
90
90
  // pure whitespace and being pure non-whitespace. This is ALMOST what the
91
91
  // segments returned by a word-based Intl.Segmenter already look like,
92
- // but not quite - see explanation in the docs of our custom segment()
93
- // function.
94
- parts = (0, string_js_1.segment)(value, segmenter);
92
+ // and therefore we can ALMOST get what we want by simply doing...
93
+ // parts = Array.from(segmenter.segment(value), segment => segment.segment);
94
+ // ... but not QUITE, because there's of one annoying special case: every
95
+ // newline character gets its own segment, instead of sharing a segment
96
+ // with other surrounding whitespace. We therefore need to manually merge
97
+ // consecutive segments of whitespace into a single part:
98
+ parts = [];
99
+ for (var _i = 0, _a = Array.from(segmenter.segment(value)); _i < _a.length; _i++) {
100
+ var segmentObj = _a[_i];
101
+ var segment = segmentObj.segment;
102
+ if (parts.length && (/\s/).test(parts[parts.length - 1]) && (/\s/).test(segment)) {
103
+ parts[parts.length - 1] += segment;
104
+ }
105
+ else {
106
+ parts.push(segment);
107
+ }
108
+ }
95
109
  }
96
110
  else {
97
111
  parts = value.match(tokenizeIncludingWhitespace) || [];
@@ -155,7 +169,7 @@ var WordDiff = /** @class */ (function (_super) {
155
169
  }
156
170
  else {
157
171
  if (insertion || deletion) { // May be false at start of text
158
- dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options.intlSegmenter);
172
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
159
173
  }
160
174
  lastKeep = change;
161
175
  insertion = null;
@@ -163,7 +177,7 @@ var WordDiff = /** @class */ (function (_super) {
163
177
  }
164
178
  });
165
179
  if (insertion || deletion) {
166
- dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options.intlSegmenter);
180
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
167
181
  }
168
182
  return changes;
169
183
  };
@@ -180,7 +194,7 @@ function diffWords(oldStr, newStr, options) {
180
194
  }
181
195
  return exports.wordDiff.diff(oldStr, newStr, options);
182
196
  }
183
- function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep, segmenter) {
197
+ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
184
198
  // Before returning, we tidy up the leading and trailing whitespace of the
185
199
  // change objects to eliminate cases where trailing whitespace in one object
186
200
  // is repeated as leading whitespace in the next.
@@ -223,8 +237,10 @@ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep
223
237
  // * Just a "delete"
224
238
  // We handle the three cases separately.
225
239
  if (deletion && insertion) {
226
- var _a = (0, string_js_1.leadingAndTrailingWs)(deletion.value, segmenter), oldWsPrefix = _a[0], oldWsSuffix = _a[1];
227
- var _b = (0, string_js_1.leadingAndTrailingWs)(insertion.value, segmenter), newWsPrefix = _b[0], newWsSuffix = _b[1];
240
+ var oldWsPrefix = (0, string_js_1.leadingWs)(deletion.value);
241
+ var oldWsSuffix = (0, string_js_1.trailingWs)(deletion.value);
242
+ var newWsPrefix = (0, string_js_1.leadingWs)(insertion.value);
243
+ var newWsSuffix = (0, string_js_1.trailingWs)(insertion.value);
228
244
  if (startKeep) {
229
245
  var commonWsPrefix = (0, string_js_1.longestCommonPrefix)(oldWsPrefix, newWsPrefix);
230
246
  startKeep.value = (0, string_js_1.replaceSuffix)(startKeep.value, newWsPrefix, commonWsPrefix);
@@ -246,17 +262,17 @@ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep
246
262
  // whitespace and deleting duplicate leading whitespace where
247
263
  // present.
248
264
  if (startKeep) {
249
- var ws = (0, string_js_1.leadingWs)(insertion.value, segmenter);
265
+ var ws = (0, string_js_1.leadingWs)(insertion.value);
250
266
  insertion.value = insertion.value.substring(ws.length);
251
267
  }
252
268
  if (endKeep) {
253
- var ws = (0, string_js_1.leadingWs)(endKeep.value, segmenter);
269
+ var ws = (0, string_js_1.leadingWs)(endKeep.value);
254
270
  endKeep.value = endKeep.value.substring(ws.length);
255
271
  }
256
272
  // otherwise we've got a deletion and no insertion
257
273
  }
258
274
  else if (startKeep && endKeep) {
259
- var newWsFull = (0, string_js_1.leadingWs)(endKeep.value, segmenter), _c = (0, string_js_1.leadingAndTrailingWs)(deletion.value, segmenter), delWsStart = _c[0], delWsEnd = _c[1];
275
+ var newWsFull = (0, string_js_1.leadingWs)(endKeep.value), delWsStart = (0, string_js_1.leadingWs)(deletion.value), delWsEnd = (0, string_js_1.trailingWs)(deletion.value);
260
276
  // Any whitespace that comes straight after startKeep in both the old and
261
277
  // new texts, assign to startKeep and remove from the deletion.
262
278
  var newWsStart = (0, string_js_1.longestCommonPrefix)(newWsFull, delWsStart);
@@ -275,8 +291,8 @@ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep
275
291
  // We are at the start of the text. Preserve all the whitespace on
276
292
  // endKeep, and just remove whitespace from the end of deletion to the
277
293
  // extent that it overlaps with the start of endKeep.
278
- var endKeepWsPrefix = (0, string_js_1.leadingWs)(endKeep.value, segmenter);
279
- var deletionWsSuffix = (0, string_js_1.trailingWs)(deletion.value, segmenter);
294
+ var endKeepWsPrefix = (0, string_js_1.leadingWs)(endKeep.value);
295
+ var deletionWsSuffix = (0, string_js_1.trailingWs)(deletion.value);
280
296
  var overlap = (0, string_js_1.maximumOverlap)(deletionWsSuffix, endKeepWsPrefix);
281
297
  deletion.value = (0, string_js_1.removeSuffix)(deletion.value, overlap);
282
298
  }
@@ -284,8 +300,8 @@ function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep
284
300
  // We are at the END of the text. Preserve all the whitespace on
285
301
  // startKeep, and just remove whitespace from the start of deletion to
286
302
  // the extent that it overlaps with the end of startKeep.
287
- var startKeepWsSuffix = (0, string_js_1.trailingWs)(startKeep.value, segmenter);
288
- var deletionWsPrefix = (0, string_js_1.leadingWs)(deletion.value, segmenter);
303
+ var startKeepWsSuffix = (0, string_js_1.trailingWs)(startKeep.value);
304
+ var deletionWsPrefix = (0, string_js_1.leadingWs)(deletion.value);
289
305
  var overlap = (0, string_js_1.maximumOverlap)(startKeepWsSuffix, deletionWsPrefix);
290
306
  deletion.value = (0, string_js_1.removePrefix)(deletion.value, overlap);
291
307
  }
@@ -13,18 +13,6 @@ export declare function hasOnlyWinLineEndings(string: string): boolean;
13
13
  * Returns true if the string consistently uses Unix line endings.
14
14
  */
15
15
  export declare function hasOnlyUnixLineEndings(string: string): boolean;
16
- /**
17
- * Split a string into segments using a word segmenter, merging consecutive
18
- * segments if they are both whitespace segments. Whitespace segments can
19
- * appear adjacent to one another for two reasons:
20
- * - newlines always get their own segment
21
- * - where a diacritic is attached to a whitespace character in the text, the
22
- * segment ends after the diacritic, so e.g. " \u0300 " becomes two segments.
23
- * This function therefore runs the segmenter's .segment() method and then
24
- * merges consecutive segments of whitespace into a single part.
25
- */
26
- export declare function segment(string: string, segmenter: Intl.Segmenter): string[];
27
- export declare function trailingWs(string: string, segmenter?: Intl.Segmenter): string;
28
- export declare function leadingWs(string: string, segmenter?: Intl.Segmenter): string;
29
- export declare function leadingAndTrailingWs(string: string, segmenter?: Intl.Segmenter): [string, string];
16
+ export declare function trailingWs(string: string): string;
17
+ export declare function leadingWs(string: string): string;
30
18
  //# sourceMappingURL=string.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/util/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQtE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBtE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAK1F;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS1F;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE;AAkCD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,CAW3E;AAgBD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,CAuB7E;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,CAQ5E;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,GACzB,CAAC,MAAM,EAAE,MAAM,CAAC,CAelB"}
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/util/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQtE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBtE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAK1F;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS1F;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE;AAkCD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmBjD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIhD"}
@@ -9,10 +9,8 @@ exports.removeSuffix = removeSuffix;
9
9
  exports.maximumOverlap = maximumOverlap;
10
10
  exports.hasOnlyWinLineEndings = hasOnlyWinLineEndings;
11
11
  exports.hasOnlyUnixLineEndings = hasOnlyUnixLineEndings;
12
- exports.segment = segment;
13
12
  exports.trailingWs = trailingWs;
14
13
  exports.leadingWs = leadingWs;
15
- exports.leadingAndTrailingWs = leadingAndTrailingWs;
16
14
  function longestCommonPrefix(str1, str2) {
17
15
  var i;
18
16
  for (i = 0; i < str1.length && i < str2.length; i++) {
@@ -116,47 +114,7 @@ function hasOnlyWinLineEndings(string) {
116
114
  function hasOnlyUnixLineEndings(string) {
117
115
  return !string.includes('\r\n') && string.includes('\n');
118
116
  }
119
- /**
120
- * Split a string into segments using a word segmenter, merging consecutive
121
- * segments if they are both whitespace segments. Whitespace segments can
122
- * appear adjacent to one another for two reasons:
123
- * - newlines always get their own segment
124
- * - where a diacritic is attached to a whitespace character in the text, the
125
- * segment ends after the diacritic, so e.g. " \u0300 " becomes two segments.
126
- * This function therefore runs the segmenter's .segment() method and then
127
- * merges consecutive segments of whitespace into a single part.
128
- */
129
- function segment(string, segmenter) {
130
- var parts = [];
131
- for (var _i = 0, _a = Array.from(segmenter.segment(string)); _i < _a.length; _i++) {
132
- var segmentObj = _a[_i];
133
- var segment_1 = segmentObj.segment;
134
- if (parts.length && (/\s/).test(parts[parts.length - 1]) && (/\s/).test(segment_1)) {
135
- parts[parts.length - 1] += segment_1;
136
- }
137
- else {
138
- parts.push(segment_1);
139
- }
140
- }
141
- return parts;
142
- }
143
- // The functions below take a `segmenter` argument so that, when called from
144
- // diffWords when it is using a segmenter, they can use a notion of what
145
- // constitutes "whitespace" that is consistent with the segmenter.
146
- //
147
- // USUALLY this will be identical to the result of the non-segmenter-based
148
- // logic, but it differs in at least one case: when whitespace characters are
149
- // modified by diacritics. A word segmenter considers these diacritics to be
150
- // part of the whitespace, whereas our non-segmenter-based logic does not.
151
- //
152
- // Because the segmenter-based approach necessarily requires segmenting the
153
- // entire string, we offer a leadingAndTrailingWs function to allow getting the
154
- // whitespace prefix AND whitespace suffix with a single call to the segmenter,
155
- // for efficiency's sake.
156
- function trailingWs(string, segmenter) {
157
- if (segmenter) {
158
- return leadingAndTrailingWs(string, segmenter)[1];
159
- }
117
+ function trailingWs(string) {
160
118
  // Yes, this looks overcomplicated and dumb - why not replace the whole function with
161
119
  // return string.match(/\s*$/)[0]
162
120
  // you ask? Because:
@@ -176,25 +134,8 @@ function trailingWs(string, segmenter) {
176
134
  }
177
135
  return string.substring(i + 1);
178
136
  }
179
- function leadingWs(string, segmenter) {
180
- if (segmenter) {
181
- return leadingAndTrailingWs(string, segmenter)[0];
182
- }
137
+ function leadingWs(string) {
183
138
  // Thankfully the annoying considerations described in trailingWs don't apply here:
184
139
  var match = string.match(/^\s*/);
185
140
  return match ? match[0] : '';
186
141
  }
187
- function leadingAndTrailingWs(string, segmenter) {
188
- if (!segmenter) {
189
- return [leadingWs(string), trailingWs(string)];
190
- }
191
- if (segmenter.resolvedOptions().granularity != 'word') {
192
- throw new Error('The segmenter passed must have a granularity of "word"');
193
- }
194
- var segments = segment(string, segmenter);
195
- var firstSeg = segments[0];
196
- var lastSeg = segments[segments.length - 1];
197
- var head = (/\s/).test(firstSeg) ? firstSeg : '';
198
- var tail = (/\s/).test(lastSeg) ? lastSeg : '';
199
- return [head, tail];
200
- }