ngwr 14.7.0 → 14.9.0

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 (482) hide show
  1. package/README.md +66 -332
  2. package/alert/styles/_index.scss +10 -0
  3. package/avatar/styles/_index.scss +18 -7
  4. package/badge/styles/_index.scss +7 -0
  5. package/badge/styles/_tag.scss +7 -1
  6. package/bar-chart/styles/_index.scss +1 -0
  7. package/button/styles/_index.scss +6 -0
  8. package/calendar-heatmap/styles/_index.scss +1 -0
  9. package/cascader/styles/_rules.scss +87 -15
  10. package/checkbox/styles/_index.scss +4 -0
  11. package/command-palette/styles/_index.scss +1 -1
  12. package/date-picker/styles/_index.scss +30 -0
  13. package/density/styles/_index.scss +4 -2
  14. package/divider/styles/_index.scss +2 -0
  15. package/donut-chart/styles/_index.scss +10 -0
  16. package/dropdown/styles/_index.scss +67 -5
  17. package/editor/styles/_index.scss +441 -0
  18. package/event-calendar/styles/_index.scss +209 -35
  19. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
  20. package/fesm2022/ngwr-action-sheet.mjs +3 -3
  21. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  22. package/fesm2022/ngwr-affix.mjs +3 -3
  23. package/fesm2022/ngwr-affix.mjs.map +1 -1
  24. package/fesm2022/ngwr-alert.mjs +3 -3
  25. package/fesm2022/ngwr-alert.mjs.map +1 -1
  26. package/fesm2022/ngwr-anchor.mjs +3 -3
  27. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  28. package/fesm2022/ngwr-aurora.mjs +3 -3
  29. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  30. package/fesm2022/ngwr-avatar.mjs +3 -3
  31. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  32. package/fesm2022/ngwr-back-top.mjs +3 -3
  33. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  34. package/fesm2022/ngwr-badge.mjs +28 -13
  35. package/fesm2022/ngwr-badge.mjs.map +1 -1
  36. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
  37. package/fesm2022/ngwr-bar-chart.mjs +31 -6
  38. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  39. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-blur-text.mjs +3 -3
  41. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  42. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
  43. package/fesm2022/ngwr-border-glow.mjs +3 -3
  44. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  45. package/fesm2022/ngwr-breadcrumbs.mjs +6 -6
  46. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  47. package/fesm2022/ngwr-burger.mjs +3 -3
  48. package/fesm2022/ngwr-burger.mjs.map +1 -1
  49. package/fesm2022/ngwr-button-testing.mjs.map +1 -1
  50. package/fesm2022/ngwr-button.mjs +6 -6
  51. package/fesm2022/ngwr-button.mjs.map +1 -1
  52. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
  53. package/fesm2022/ngwr-calendar-heatmap.mjs +61 -6
  54. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  55. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  56. package/fesm2022/ngwr-calendar.mjs +3 -3
  57. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  58. package/fesm2022/ngwr-card.mjs +9 -9
  59. package/fesm2022/ngwr-card.mjs.map +1 -1
  60. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-carousel.mjs +6 -6
  62. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  63. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  64. package/fesm2022/ngwr-cascader.mjs +4 -4
  65. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  66. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
  67. package/fesm2022/ngwr-checkbox.mjs +18 -8
  68. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
  70. package/fesm2022/ngwr-circular-text.mjs +3 -3
  71. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  72. package/fesm2022/ngwr-click-spark.mjs +3 -3
  73. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  74. package/fesm2022/ngwr-clipboard.mjs +3 -3
  75. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  76. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
  77. package/fesm2022/ngwr-collapse.mjs +9 -9
  78. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  79. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-color-picker.mjs +6 -6
  81. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  82. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
  83. package/fesm2022/ngwr-command-palette.mjs +3 -3
  84. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  85. package/fesm2022/ngwr-compare.mjs +3 -3
  86. package/fesm2022/ngwr-compare.mjs.map +1 -1
  87. package/fesm2022/ngwr-confetti.mjs +3 -3
  88. package/fesm2022/ngwr-confetti.mjs.map +1 -1
  89. package/fesm2022/ngwr-config.mjs.map +1 -1
  90. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  91. package/fesm2022/ngwr-context-menu.mjs +12 -12
  92. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  93. package/fesm2022/ngwr-cookie.mjs +3 -3
  94. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  95. package/fesm2022/ngwr-counter.mjs +6 -6
  96. package/fesm2022/ngwr-counter.mjs.map +1 -1
  97. package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
  98. package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
  100. package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
  101. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-date-picker.mjs +721 -62
  103. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-date.mjs +3 -3
  105. package/fesm2022/ngwr-date.mjs.map +1 -1
  106. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
  107. package/fesm2022/ngwr-decrypt-text.mjs +3 -3
  108. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  109. package/fesm2022/ngwr-density.mjs +6 -6
  110. package/fesm2022/ngwr-density.mjs.map +1 -1
  111. package/fesm2022/ngwr-descriptions.mjs +6 -6
  112. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  113. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-dialog.mjs +15 -15
  115. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  116. package/fesm2022/ngwr-directives.mjs +12 -12
  117. package/fesm2022/ngwr-directives.mjs.map +1 -1
  118. package/fesm2022/ngwr-divider.mjs +3 -3
  119. package/fesm2022/ngwr-divider.mjs.map +1 -1
  120. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
  121. package/fesm2022/ngwr-donut-chart.mjs +48 -6
  122. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  123. package/fesm2022/ngwr-drag-drop.mjs +6 -6
  124. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  125. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
  126. package/fesm2022/ngwr-drawer.mjs +18 -18
  127. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  128. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  129. package/fesm2022/ngwr-dropdown.mjs +174 -25
  130. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  131. package/fesm2022/ngwr-editor-testing.mjs +568 -0
  132. package/fesm2022/ngwr-editor-testing.mjs.map +1 -0
  133. package/fesm2022/ngwr-editor.mjs +2601 -0
  134. package/fesm2022/ngwr-editor.mjs.map +1 -0
  135. package/fesm2022/ngwr-empty.mjs +3 -3
  136. package/fesm2022/ngwr-empty.mjs.map +1 -1
  137. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
  138. package/fesm2022/ngwr-event-calendar.mjs +14 -7
  139. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  140. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-falling-text.mjs +3 -3
  142. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  143. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  144. package/fesm2022/ngwr-file-upload.mjs +3 -3
  145. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  146. package/fesm2022/ngwr-form-testing.mjs.map +1 -1
  147. package/fesm2022/ngwr-form.mjs +61 -10
  148. package/fesm2022/ngwr-form.mjs.map +1 -1
  149. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
  150. package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
  151. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  152. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
  153. package/fesm2022/ngwr-gauge.mjs +35 -6
  154. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  155. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
  156. package/fesm2022/ngwr-glitch-text.mjs +3 -3
  157. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  158. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
  159. package/fesm2022/ngwr-gradient-text.mjs +3 -3
  160. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  161. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  162. package/fesm2022/ngwr-graph.mjs +6 -6
  163. package/fesm2022/ngwr-graph.mjs.map +1 -1
  164. package/fesm2022/ngwr-hotkey.mjs +6 -6
  165. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  166. package/fesm2022/ngwr-i18n-ar.mjs +31 -0
  167. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  168. package/fesm2022/ngwr-i18n-cs.mjs +31 -0
  169. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  170. package/fesm2022/ngwr-i18n-de.mjs +31 -0
  171. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  172. package/fesm2022/ngwr-i18n-en.mjs +39 -0
  173. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  174. package/fesm2022/ngwr-i18n-es.mjs +31 -0
  175. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  176. package/fesm2022/ngwr-i18n-fr.mjs +31 -0
  177. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  178. package/fesm2022/ngwr-i18n-he.mjs +31 -0
  179. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  180. package/fesm2022/ngwr-i18n-hi.mjs +31 -0
  181. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  182. package/fesm2022/ngwr-i18n-id.mjs +31 -0
  183. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  184. package/fesm2022/ngwr-i18n-it.mjs +31 -0
  185. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  186. package/fesm2022/ngwr-i18n-ja.mjs +31 -0
  187. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  188. package/fesm2022/ngwr-i18n-ko.mjs +31 -0
  189. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  190. package/fesm2022/ngwr-i18n-nl.mjs +31 -0
  191. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  192. package/fesm2022/ngwr-i18n-pl.mjs +31 -0
  193. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  194. package/fesm2022/ngwr-i18n-pt.mjs +31 -0
  195. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  196. package/fesm2022/ngwr-i18n-ru.mjs +31 -0
  197. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  198. package/fesm2022/ngwr-i18n-sv.mjs +31 -0
  199. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  200. package/fesm2022/ngwr-i18n-tr.mjs +31 -0
  201. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  202. package/fesm2022/ngwr-i18n-uk.mjs +31 -0
  203. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  204. package/fesm2022/ngwr-i18n-vi.mjs +31 -0
  205. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  206. package/fesm2022/ngwr-i18n-zh-TW.mjs +31 -0
  207. package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
  208. package/fesm2022/ngwr-i18n-zh.mjs +31 -0
  209. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  210. package/fesm2022/ngwr-i18n.mjs +9 -9
  211. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  212. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
  213. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
  214. package/fesm2022/ngwr-icon.mjs +6 -6
  215. package/fesm2022/ngwr-icon.mjs.map +1 -1
  216. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
  217. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  218. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  219. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  220. package/fesm2022/ngwr-input-number.mjs +15 -3
  221. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  222. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
  223. package/fesm2022/ngwr-input-otp.mjs +3 -3
  224. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  225. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  226. package/fesm2022/ngwr-input.mjs +15 -15
  227. package/fesm2022/ngwr-input.mjs.map +1 -1
  228. package/fesm2022/ngwr-keyboard.mjs +3 -3
  229. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  230. package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
  231. package/fesm2022/ngwr-knob.mjs +3 -3
  232. package/fesm2022/ngwr-knob.mjs.map +1 -1
  233. package/fesm2022/ngwr-layout.mjs +15 -15
  234. package/fesm2022/ngwr-layout.mjs.map +1 -1
  235. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  236. package/fesm2022/ngwr-lightbox.mjs +3 -3
  237. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  238. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
  239. package/fesm2022/ngwr-line-chart.mjs +18 -7
  240. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  241. package/fesm2022/ngwr-list.mjs +6 -6
  242. package/fesm2022/ngwr-list.mjs.map +1 -1
  243. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  244. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  245. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  246. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
  247. package/fesm2022/ngwr-markdown.mjs +798 -17
  248. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  249. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
  250. package/fesm2022/ngwr-marquee.mjs +3 -3
  251. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  252. package/fesm2022/ngwr-media.mjs +3 -3
  253. package/fesm2022/ngwr-media.mjs.map +1 -1
  254. package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
  255. package/fesm2022/ngwr-mention.mjs +6 -6
  256. package/fesm2022/ngwr-mention.mjs.map +1 -1
  257. package/fesm2022/ngwr-meta.mjs +6 -6
  258. package/fesm2022/ngwr-meta.mjs.map +1 -1
  259. package/fesm2022/ngwr-meter-group-testing.mjs +7 -3
  260. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
  261. package/fesm2022/ngwr-meter-group.mjs +26 -6
  262. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  263. package/fesm2022/ngwr-overlay.mjs +6 -6
  264. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  265. package/fesm2022/ngwr-page-header.mjs +13 -5
  266. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  267. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  268. package/fesm2022/ngwr-pagination.mjs +3 -3
  269. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  270. package/fesm2022/ngwr-pipes.mjs +21 -21
  271. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  272. package/fesm2022/ngwr-platform.mjs +9 -9
  273. package/fesm2022/ngwr-platform.mjs.map +1 -1
  274. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  275. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  276. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  277. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  278. package/fesm2022/ngwr-popover.mjs +578 -16
  279. package/fesm2022/ngwr-popover.mjs.map +1 -1
  280. package/fesm2022/ngwr-progress.mjs +3 -3
  281. package/fesm2022/ngwr-progress.mjs.map +1 -1
  282. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  283. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  284. package/fesm2022/ngwr-qr.mjs +3 -3
  285. package/fesm2022/ngwr-qr.mjs.map +1 -1
  286. package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
  287. package/fesm2022/ngwr-radio.mjs +6 -6
  288. package/fesm2022/ngwr-radio.mjs.map +1 -1
  289. package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
  290. package/fesm2022/ngwr-rating.mjs +3 -3
  291. package/fesm2022/ngwr-rating.mjs.map +1 -1
  292. package/fesm2022/ngwr-result.mjs +12 -12
  293. package/fesm2022/ngwr-result.mjs.map +1 -1
  294. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
  295. package/fesm2022/ngwr-rotating-text.mjs +3 -3
  296. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  297. package/fesm2022/ngwr-schema-form.mjs +3 -3
  298. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  299. package/fesm2022/ngwr-scroll.mjs +3 -3
  300. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  301. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
  302. package/fesm2022/ngwr-segmented.mjs +3 -3
  303. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  304. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  305. package/fesm2022/ngwr-select.mjs +12 -12
  306. package/fesm2022/ngwr-select.mjs.map +1 -1
  307. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
  308. package/fesm2022/ngwr-shiny-text.mjs +6 -6
  309. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  310. package/fesm2022/ngwr-sidebar.mjs +10 -3
  311. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  312. package/fesm2022/ngwr-skeleton.mjs +3 -3
  313. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  314. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  315. package/fesm2022/ngwr-slider.mjs +3 -3
  316. package/fesm2022/ngwr-slider.mjs.map +1 -1
  317. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
  318. package/fesm2022/ngwr-sparkline.mjs +84 -10
  319. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  320. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
  321. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  322. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  323. package/fesm2022/ngwr-spinner.mjs +3 -3
  324. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  325. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
  326. package/fesm2022/ngwr-splash-cursor.mjs +3 -3
  327. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  328. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
  329. package/fesm2022/ngwr-split-text.mjs +3 -3
  330. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  331. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
  332. package/fesm2022/ngwr-splitter.mjs +3 -3
  333. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  334. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
  335. package/fesm2022/ngwr-spotlight-card.mjs +6 -6
  336. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  337. package/fesm2022/ngwr-squircle.mjs +6 -6
  338. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  339. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
  340. package/fesm2022/ngwr-star-border.mjs +3 -3
  341. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  342. package/fesm2022/ngwr-statistic.mjs +9 -9
  343. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  344. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
  345. package/fesm2022/ngwr-stepper.mjs +6 -6
  346. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  347. package/fesm2022/ngwr-storage.mjs +3 -3
  348. package/fesm2022/ngwr-storage.mjs.map +1 -1
  349. package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
  350. package/fesm2022/ngwr-switch.mjs +3 -3
  351. package/fesm2022/ngwr-switch.mjs.map +1 -1
  352. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  353. package/fesm2022/ngwr-table.mjs +18 -18
  354. package/fesm2022/ngwr-table.mjs.map +1 -1
  355. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  356. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  357. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  358. package/fesm2022/ngwr-tabs.mjs +6 -6
  359. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  360. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  361. package/fesm2022/ngwr-textarea.mjs +3 -3
  362. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  363. package/fesm2022/ngwr-theme.mjs +3 -3
  364. package/fesm2022/ngwr-theme.mjs.map +1 -1
  365. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
  366. package/fesm2022/ngwr-tilt-card.mjs +6 -6
  367. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  368. package/fesm2022/ngwr-timeline.mjs +6 -6
  369. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  370. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  371. package/fesm2022/ngwr-toast.mjs +9 -9
  372. package/fesm2022/ngwr-toast.mjs.map +1 -1
  373. package/fesm2022/ngwr-toolbar.mjs +10 -3
  374. package/fesm2022/ngwr-toolbar.mjs.map +1 -1
  375. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  376. package/fesm2022/ngwr-tour.mjs +6 -6
  377. package/fesm2022/ngwr-tour.mjs.map +1 -1
  378. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  379. package/fesm2022/ngwr-transfer.mjs +3 -3
  380. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  381. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  382. package/fesm2022/ngwr-tree.mjs +3 -3
  383. package/fesm2022/ngwr-tree.mjs.map +1 -1
  384. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
  385. package/fesm2022/ngwr-typewriter.mjs +3 -3
  386. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  387. package/fesm2022/ngwr-typography.mjs +7 -3
  388. package/fesm2022/ngwr-typography.mjs.map +1 -1
  389. package/fesm2022/ngwr-utils.mjs.map +1 -1
  390. package/fesm2022/ngwr-validators.mjs.map +1 -1
  391. package/fesm2022/ngwr-version.mjs +1 -1
  392. package/fesm2022/ngwr-version.mjs.map +1 -1
  393. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  394. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  395. package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
  396. package/fesm2022/ngwr-waves.mjs +3 -3
  397. package/fesm2022/ngwr-waves.mjs.map +1 -1
  398. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  399. package/fesm2022/ngwr-window.mjs +12 -12
  400. package/fesm2022/ngwr-window.mjs.map +1 -1
  401. package/form/styles/_index.scss +16 -1
  402. package/gauge/styles/_index.scss +1 -0
  403. package/i18n/ar.json +32 -1
  404. package/i18n/cs.json +32 -1
  405. package/i18n/de.json +32 -1
  406. package/i18n/en.json +32 -1
  407. package/i18n/es.json +32 -1
  408. package/i18n/fr.json +32 -1
  409. package/i18n/he.json +32 -1
  410. package/i18n/hi.json +32 -1
  411. package/i18n/id.json +32 -1
  412. package/i18n/it.json +32 -1
  413. package/i18n/ja.json +32 -1
  414. package/i18n/ko.json +32 -1
  415. package/i18n/nl.json +32 -1
  416. package/i18n/pl.json +32 -1
  417. package/i18n/pt.json +32 -1
  418. package/i18n/ru.json +32 -1
  419. package/i18n/sv.json +32 -1
  420. package/i18n/tr.json +32 -1
  421. package/i18n/uk.json +32 -1
  422. package/i18n/vi.json +32 -1
  423. package/i18n/zh-TW.json +32 -1
  424. package/i18n/zh.json +32 -1
  425. package/input/styles/_index.scss +24 -1
  426. package/input-number/styles/_index.scss +69 -0
  427. package/input-otp/styles/_index.scss +5 -5
  428. package/line-chart/styles/_index.scss +30 -2
  429. package/llms-full.txt +14 -4
  430. package/llms.txt +188 -132
  431. package/mcp/providers.js +2 -2
  432. package/mcp/server.js +1 -1
  433. package/meter-group/styles/_index.scss +1 -0
  434. package/overlay/styles/_arrow.scss +30 -2
  435. package/package.json +43 -2
  436. package/page-header/styles/_index.scss +37 -1
  437. package/pagination/styles/_index.scss +9 -5
  438. package/popover/styles/_index.scss +73 -5
  439. package/progress/styles/_index.scss +4 -0
  440. package/radio/styles/_index.scss +4 -1
  441. package/schematics/use/symbol-map.json +1 -0
  442. package/select/styles/_index.scss +51 -12
  443. package/sidebar/styles/_index.scss +44 -2
  444. package/skeleton/styles/_index.scss +3 -0
  445. package/skills/ngwr/SKILL.md +5 -5
  446. package/skills/ngwr/references/catalog.md +2 -0
  447. package/skills/ngwr/references/setup.md +3 -3
  448. package/sparkline/styles/_index.scss +19 -0
  449. package/styles.scss +1 -0
  450. package/table/styles/_index.scss +7 -0
  451. package/textarea/styles/_index.scss +12 -3
  452. package/theme/styles/_colors.scss +39 -13
  453. package/theme/styles/_contrast.scss +9 -7
  454. package/toast/styles/_index.scss +4 -0
  455. package/toolbar/styles/_index.scss +35 -1
  456. package/tree/styles/_index.scss +46 -7
  457. package/types/ngwr-badge.d.ts +22 -7
  458. package/types/ngwr-bar-chart.d.ts +19 -1
  459. package/types/ngwr-calendar-heatmap.d.ts +29 -1
  460. package/types/ngwr-checkbox.d.ts +2 -0
  461. package/types/ngwr-config.d.ts +12 -0
  462. package/types/ngwr-date-picker.d.ts +308 -43
  463. package/types/ngwr-donut-chart.d.ts +24 -1
  464. package/types/ngwr-dropdown.d.ts +22 -2
  465. package/types/ngwr-editor-testing.d.ts +378 -0
  466. package/types/ngwr-editor.d.ts +449 -0
  467. package/types/ngwr-event-calendar.d.ts +8 -0
  468. package/types/ngwr-form.d.ts +35 -5
  469. package/types/ngwr-gauge.d.ts +20 -1
  470. package/types/ngwr-input-number.d.ts +7 -0
  471. package/types/ngwr-line-chart.d.ts +9 -1
  472. package/types/ngwr-markdown.d.ts +61 -2
  473. package/types/ngwr-meter-group-testing.d.ts +3 -2
  474. package/types/ngwr-meter-group.d.ts +14 -1
  475. package/types/ngwr-page-header.d.ts +10 -2
  476. package/types/ngwr-popover.d.ts +154 -3
  477. package/types/ngwr-sidebar.d.ts +7 -0
  478. package/types/ngwr-sparkline.d.ts +43 -1
  479. package/types/ngwr-toolbar.d.ts +7 -0
  480. package/types/ngwr-typography.d.ts +4 -0
  481. package/types/ngwr-version.d.ts +1 -1
  482. package/typography/styles/_index.scss +16 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-markdown.mjs","sources":["../../../projects/lib/markdown/parse-markdown.ts","../../../projects/lib/markdown/tokens.ts","../../../projects/lib/markdown/wr-markdown-highlight.ts","../../../projects/lib/markdown/wr-markdown.ts","../../../projects/lib/markdown/wr-markdown.html","../../../projects/lib/markdown/provide-wr-markdown.ts","../../../projects/lib/markdown/ngwr-markdown.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type {\n WrMarkdownAlign,\n WrMarkdownBlock,\n WrMarkdownCell,\n WrMarkdownInline,\n WrMarkdownListItem,\n WrMarkdownParseOptions,\n} from './interfaces';\n\n/**\n * Markdown to a node tree. No HTML anywhere in the pipeline.\n *\n * **Why a parser in a component library that has one runtime dependency.** The\n * alternative was `marked` or `markdown-it`, and both produce an HTML string —\n * which then has to reach the DOM through `[innerHTML]`, which means Angular's\n * sanitizer on the hot path of the one component whose input is untrusted by\n * definition, and `bypassSecurityTrustHtml` the moment syntax highlighting is\n * wanted. A node tree renders through ordinary Angular bindings instead: every\n * text node is a text node, every `href` goes through `SecurityContext.URL`, and\n * nothing is ever parsed as HTML. That is worth a parser.\n *\n * The second reason is streaming, which no general-purpose parser is built for.\n * See {@link WrMarkdownParseOptions.streaming}: an open fence has to render as a\n * code block, and a half-typed `**` must not flash on screen as literal\n * asterisks.\n *\n * **The subset, stated rather than discovered.** ATX headings, paragraphs,\n * fenced code, blockquotes, bullet / ordered / task lists (nested), GFM tables,\n * thematic breaks; inline code, strong, emphasis, strikethrough, links, images,\n * autolinks (bracketed and bare), hard breaks, backslash escapes.\n *\n * Deliberately absent, each for a reason:\n *\n * - **Raw HTML is escaped, never rendered.** A markdown renderer whose input is\n * model output or user comments cannot pass `<img onerror>` through and call\n * it a feature. `<div>` in equals `<div>` on screen, as text.\n * - **Indented (four-space) code blocks.** In a document that also has nested\n * lists, indentation is structural, and the ambiguity resolves against the\n * author roughly every time: a wrapped list continuation becomes a code block.\n * Fences are unambiguous, and fences are what generators emit.\n * - **Setext headings** (`===` / `---` under a line). `---` is a thematic break\n * here, always. The dual meaning is a well-known trap and the underline form\n * is essentially unused in generated markdown.\n * - **Reference links, footnotes, definition lists.** They need a second pass\n * over a document that, mid-stream, is not all there yet.\n *\n * Two known deviations, kept rather than fixed, because the cure looked worse than\n * the disease:\n *\n * - **A blank line inside a NESTED list marks the outer list loose too**, so\n * `- a` / ` - b` / blank / ` - c` / `- d` double-spaces the outer items.\n * CommonMark scopes looseness per list; telling the two apart needs to know\n * which level a blank line belongs to, and the indentation alone does not say —\n * content at the item's own indent can belong either to the item or to a\n * sublist's sibling. The visible cost is spacing.\n * - **An unmatched `[` is not linear.** The scan is bounded per opener\n * ({@link MAX_LABEL_LENGTH}) and short-circuits once the source is known to hold\n * no `]` at all, which took `'['.repeat(100000)` from 8s to 0.2s — but a\n * document that is mostly open brackets with a `]` somewhere still pays per\n * opener. Real prose does not have that shape.\n *\n * @param source markdown text\n * @returns block nodes, ready to render\n */\nfunction parseMarkdown(source: string, options: WrMarkdownParseOptions = {}): readonly WrMarkdownBlock[] {\n if (!source) return [];\n\n const ctx = newContext(options.streaming ?? false);\n const blocks = parseBlocks(normalize(source).split('\\n'), 0, ctx);\n\n return ctx.streaming ? applyStreamingTail(blocks) : blocks;\n}\n\n/**\n * How deep a quote / list nest may go before the parser stops recursing.\n *\n * Not a taste limit: each level is a recursive call over its own slice of the\n * lines, so a pathological input (`> > > > …` a thousand deep, which is four\n * kilobytes of text) is a stack overflow inside a change-detection pass. Past\n * the cap the content renders as paragraphs — visible, harmless, and nothing a\n * real document reaches.\n */\nconst MAX_DEPTH = 12;\n\n/**\n * How many columns of a table are rendered.\n *\n * The same class of protection as {@link MAX_DEPTH}, for the same reason, and it\n * was measured rather than guessed: every row is padded to the header's width, so\n * cells scale as columns × rows while the input scales as columns + rows. A 38 KB\n * document — a 10,001-pipe header and 2,000 short rows, which is what a truncated\n * table from a model looks like — produced **20 million cells** in 4.5 seconds,\n * inside a `computed` that re-runs on every streamed chunk. No real table is wider\n * than this; a wider one renders its first 128 columns.\n */\nconst MAX_TABLE_COLUMNS = 128;\n\n/**\n * Threaded down the whole parse rather than applied afterwards.\n *\n * Streaming changes what an UNMATCHED marker means, and only the parser knows it\n * found one. A post-pass over the tree cannot tell `**bold**` from `**bold` —\n * both end up as text and marker characters — so the decision has to be made\n * where the closer was looked for and not found.\n */\ninterface ParseContext {\n readonly streaming: boolean;\n /**\n * Heading slugs already handed out, so a document with two `## Fixes` produces\n * two DIFFERENT ids. Duplicate ids are invalid, and `#fixes` would resolve to\n * whichever came first.\n */\n readonly slugs: Map<string, number>;\n /**\n * Per marker character, the earliest index from which a closer search has\n * already come up empty.\n *\n * This is what keeps the inline scanner linear. The closer search is monotone —\n * if no valid closer exists after index `i`, none exists after any index past\n * `i` either, since that window is a subset — so one failure answers every\n * later opener of the same character. Without it, `'*a '.repeat(34000)` is 10.8\n * SECONDS inside a `computed`, on the main thread.\n *\n * Scoped to ONE scan, not to the document: `inlines()` replaces this and\n * {@link ParseContext.noBracket} on entry, because the numbers index into the\n * string that call is walking and mean nothing in any other.\n */\n readonly noCloser: Map<string, number>;\n /** Same idea for `]`: the index from which the source contains none at all. */\n readonly noBracket: { from: number };\n /**\n * True while parsing a link's label. CommonMark forbids links inside links, and\n * a tree built with DOM APIs happily nests the `<a>` an HTML parser would have\n * rejected — which is invalid markup and an axe `nested-interactive` violation.\n */\n readonly inLink: boolean;\n}\n\nfunction newContext(streaming: boolean): ParseContext {\n return {\n streaming,\n slugs: new Map(),\n noCloser: new Map(),\n noBracket: { from: Number.POSITIVE_INFINITY },\n inLink: false,\n };\n}\n\nconst FENCE_RE = /^( {0,3})(`{3,}|~{3,})[ \\t]*(.*)$/;\n// The closing `#` run must be PRECEDED by whitespace, or `# C#` loses its sharp\n// and `#######` (seven, not a heading in any dialect) matches as an empty h6.\nconst HEADING_RE = /^ {0,3}(#{1,6})(?:[ \\t]+(.*?))?(?:[ \\t]+#+)?[ \\t]*$/;\nconst RULE_RE = /^ {0,3}(?:(?:\\*[ \\t]*){3,}|(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,})$/;\nconst QUOTE_RE = /^ {0,3}>[ \\t]?(.*)$/;\nconst LIST_RE = /^( *)([-*+]|\\d{1,9}[.)])(?:([ \\t]+)(.*)|[ \\t]*)$/;\nconst TASK_RE = /^\\[([ xX])\\](?:[ \\t]+(.*)|[ \\t]*)$/;\nconst TABLE_DELIM_RE = /^ {0,3}\\|?[ \\t]*:?-+:?[ \\t]*(?:\\|[ \\t]*:?-+:?[ \\t]*)*\\|?[ \\t]*$/;\n\n/**\n * `\\r\\n` and lone `\\r` out; tabs in the INDENT to four spaces, so indent maths is\n * in one unit.\n *\n * The whole leading whitespace run, not just a line-initial tab: `' \\t- b'` is\n * two spaces and a tab, and `parseList` measures indentation in characters, so a\n * tab counted as one column made mixed indentation parse as literal text.\n */\nfunction normalize(source: string): string {\n return source.replace(/\\r\\n?/g, '\\n').replace(/^[ \\t]+/gm, indent => indent.replace(/\\t/g, ' '));\n}\n\n/** Does this line begin a block that interrupts a paragraph or a list item? */\nfunction startsBlock(line: string): boolean {\n return (\n FENCE_RE.test(line) || HEADING_RE.test(line) || RULE_RE.test(line) || QUOTE_RE.test(line) || LIST_RE.test(line)\n );\n}\n\n/**\n * Does this line end the paragraph it follows?\n *\n * Every block start does, except the two lists CommonMark says cannot interrupt\n * one: an ordered item whose number is not 1, and an item with no content. The\n * first rule exists for a single shape, and it is a shape prose actually has —\n * \"The year was\" / \"1986. It was a good year.\" must not become a list numbered\n * from 1986.\n */\nfunction interruptsParagraph(line: string): boolean {\n const list = matchListStart(line);\n if (list && !RULE_RE.test(line)) {\n return list.content.trim() !== '' && (!list.ordered || list.number === 1);\n }\n\n return startsBlock(line);\n}\n\ninterface ListStart {\n readonly indent: number;\n readonly ordered: boolean;\n readonly number: number;\n readonly content: string;\n /** Column the item's own content starts at — the dedent for everything inside it. */\n readonly contentIndent: number;\n}\n\nfunction matchListStart(line: string): ListStart | null {\n const match = LIST_RE.exec(line);\n if (!match) return null;\n\n const [, indent, marker, spaces, content] = match;\n const ordered = !/^[-*+]$/.test(marker);\n\n return {\n indent: indent.length,\n ordered,\n number: ordered ? Number.parseInt(marker, 10) : 1,\n content: content ?? '',\n // An empty item (`-` alone) has no run of spaces to measure, so assume one.\n contentIndent: indent.length + marker.length + (spaces?.length ?? 1),\n };\n}\n\nfunction parseBlocks(lines: readonly string[], depth: number, ctx: ParseContext): readonly WrMarkdownBlock[] {\n if (depth >= MAX_DEPTH) {\n const text = lines.join('\\n').trim();\n return text ? [{ kind: 'paragraph', inlines: inlines(text, 0, ctx) }] : [];\n }\n\n const out: WrMarkdownBlock[] = [];\n let i = 0;\n\n while (i < lines.length) {\n const line = lines[i];\n\n if (!line.trim()) {\n i++;\n continue;\n }\n\n const fence = FENCE_RE.exec(line);\n if (fence) {\n const [, indent, marker, info] = fence;\n const body: string[] = [];\n const closer = new RegExp(`^ {0,3}\\\\${marker[0]}{${marker.length},}[ \\\\t]*$`);\n let closed = false;\n i++;\n\n while (i < lines.length) {\n if (closer.test(lines[i])) {\n closed = true;\n i++;\n break;\n }\n // The opening fence's own indentation is not part of the code.\n body.push(stripIndent(lines[i], indent.length));\n i++;\n }\n\n out.push({\n kind: 'code',\n language: info.trim().split(/\\s+/)[0].toLowerCase() || null,\n code: body.join('\\n'),\n closed,\n });\n continue;\n }\n\n const heading = HEADING_RE.exec(line);\n if (heading) {\n const text = (heading[2] ?? '').trim();\n const content = inlines(text, 0, ctx);\n out.push({\n kind: 'heading',\n level: heading[1].length as 1 | 2 | 3 | 4 | 5 | 6,\n inlines: content,\n // Slugged from the rendered TEXT, not from the markdown: `## See [docs](url)`\n // was producing `see-docshttpsxdeva`, an anchor nobody can link to.\n id: uniqueSlug(plainText(content), ctx),\n });\n i++;\n continue;\n }\n\n if (RULE_RE.test(line)) {\n out.push({ kind: 'rule' });\n i++;\n continue;\n }\n\n if (QUOTE_RE.test(line)) {\n const body: string[] = [];\n while (i < lines.length) {\n const quoted = QUOTE_RE.exec(lines[i]);\n if (quoted) {\n body.push(quoted[1]);\n i++;\n continue;\n }\n // Lazy continuation: an unmarked, non-blank line still belongs to the\n // quote unless it starts a block of its own.\n if (!lines[i].trim() || startsBlock(lines[i])) break;\n body.push(lines[i].trimStart());\n i++;\n }\n out.push({ kind: 'quote', children: parseBlocks(body, depth + 1, ctx) });\n continue;\n }\n\n if (matchListStart(line)) {\n const [list, next] = parseList(lines, i, depth, ctx);\n out.push(list);\n i = next;\n continue;\n }\n\n if (isTableStart(lines, i)) {\n const [table, next] = parseTable(lines, i, ctx);\n out.push(table);\n i = next;\n continue;\n }\n\n const paragraph: string[] = [line];\n i++;\n while (i < lines.length && lines[i].trim() && !interruptsParagraph(lines[i])) {\n // A delimiter row two lines in turns the paragraph into a table header.\n if (isTableStart(lines, i)) break;\n paragraph.push(lines[i]);\n i++;\n }\n out.push({ kind: 'paragraph', inlines: inlines(paragraph.join('\\n').trim(), 0, ctx) });\n }\n\n return out;\n}\n\n/**\n * A table header, or a sentence that happens to contain a pipe.\n *\n * GFM's own rule, and the one this used to be missing: \"the header row must match\n * the delimiter row in the number of cells. If not, a table will not be\n * recognized.\" Without the count check, `Use the | character` followed by `---`\n * became a two-column table with an empty body — swallowing both the sentence and\n * the thematic break, and contradicting this file's own decision that `---` is\n * always a rule.\n */\nfunction isTableStart(lines: readonly string[], at: number): boolean {\n const header = lines[at];\n const delimiter = lines[at + 1];\n\n if (!header?.includes('|') || delimiter === undefined || !TABLE_DELIM_RE.test(delimiter)) return false;\n\n return splitRow(header).length === splitRow(delimiter).length;\n}\n\n/** Remove up to `width` leading spaces — never more, so relative indent survives. */\nfunction stripIndent(line: string, width: number): string {\n let cut = 0;\n while (cut < width && line[cut] === ' ') cut++;\n return line.slice(cut);\n}\n\nfunction parseList(\n lines: readonly string[],\n from: number,\n depth: number,\n ctx: ParseContext\n): [WrMarkdownBlock, number] {\n const first = matchListStart(lines[from])!;\n const items: WrMarkdownListItem[] = [];\n let loose = false;\n let i = from;\n\n while (i < lines.length) {\n // A thematic break wins over a list item, which is CommonMark's rule and not\n // a nicety: `* * *` matches the bullet pattern, so without this `* a`,\n // `* * *`, `* b` is one list with a phantom nesting level where the divider\n // was, and the `<hr>` is gone.\n if (RULE_RE.test(lines[i])) break;\n\n const start = matchListStart(lines[i]);\n // A different marker family starts a NEW list rather than continuing this\n // one — `- a` then `1. b` is two lists, and rendering it as one silently\n // renumbers the author's content.\n if (start?.ordered !== first.ordered || start.indent > first.indent + 3) break;\n\n const body: string[] = [start.content];\n let blanks = 0;\n i++;\n\n while (i < lines.length) {\n const line = lines[i];\n\n if (!line.trim()) {\n blanks++;\n i++;\n continue;\n }\n\n const indent = line.length - line.trimStart().length;\n if (indent >= start.contentIndent) {\n // A blank line followed by more of the same item makes the list loose,\n // which is what decides whether items get `<p>` wrappers.\n if (blanks > 0) {\n body.push(...Array<string>(blanks).fill(''));\n loose = true;\n blanks = 0;\n }\n body.push(stripIndent(line, start.contentIndent));\n i++;\n continue;\n }\n\n // Out-dented: a sibling item, another block, or lazy continuation of this\n // item's paragraph. After a blank line only a sibling can follow.\n if (blanks > 0 || matchListStart(line) || startsBlock(line)) break;\n body.push(line.trimStart());\n i++;\n }\n\n const nextIsSibling = i < lines.length && matchListStart(lines[i]) !== null;\n if (blanks > 0 && nextIsSibling) loose = true;\n\n items.push(makeItem(body, depth, ctx));\n\n if (blanks > 0 && !nextIsSibling) break;\n }\n\n return [{ kind: 'list', ordered: first.ordered, start: first.number, tight: !loose, items }, i];\n}\n\nfunction makeItem(body: readonly string[], depth: number, ctx: ParseContext): WrMarkdownListItem {\n const task = TASK_RE.exec(body[0] ?? '');\n const lines = task ? [task[2] ?? '', ...body.slice(1)] : body;\n\n return {\n children: parseBlocks(lines, depth + 1, ctx),\n checked: task ? task[1].toLowerCase() === 'x' : null,\n };\n}\n\nfunction parseTable(lines: readonly string[], from: number, ctx: ParseContext): [WrMarkdownBlock, number] {\n const head = splitRow(lines[from]).slice(0, MAX_TABLE_COLUMNS);\n const align = splitRow(lines[from + 1]).map((spec): WrMarkdownAlign => {\n const left = spec.startsWith(':');\n const right = spec.endsWith(':');\n if (left && right) return 'center';\n if (right) return 'end';\n if (left) return 'start';\n return null;\n });\n\n const rows: WrMarkdownCell[][] = [];\n let i = from + 2;\n\n while (i < lines.length) {\n const line = lines[i];\n // GFM ends a table at a blank line, a line that starts another block, or\n // anything without a cell divider.\n if (!line.trim() || !line.includes('|') || startsBlock(line)) break;\n rows.push(normalizeCells(splitRow(line), head.length, ctx));\n i++;\n }\n\n return [\n {\n kind: 'table',\n head: head.map(cell => ({ inlines: inlines(cell, 0, ctx) })),\n rows,\n align: normalizeAlign(align, head.length),\n },\n i,\n ];\n}\n\n/** Split on unescaped pipes, dropping the optional leading and trailing one. */\nfunction splitRow(line: string): string[] {\n const cells: string[] = [];\n let current = '';\n\n for (let i = 0; i < line.length; i++) {\n if (line[i] === '\\\\' && line[i + 1] === '|') {\n current += '|';\n i++;\n continue;\n }\n if (line[i] === '|') {\n cells.push(current);\n current = '';\n continue;\n }\n current += line[i];\n }\n cells.push(current);\n\n if (cells.length > 1 && !cells[0].trim()) cells.shift();\n if (cells.length > 1 && !cells[cells.length - 1].trim()) cells.pop();\n\n return cells.map(cell => cell.trim());\n}\n\n/** A row shorter than the header gets empty cells; a longer one is truncated. */\nfunction normalizeCells(cells: readonly string[], width: number, ctx: ParseContext): WrMarkdownCell[] {\n return Array.from({ length: width }, (_, index) => ({ inlines: inlines(cells[index] ?? '', 0, ctx) }));\n}\n\nfunction normalizeAlign(align: readonly WrMarkdownAlign[], width: number): WrMarkdownAlign[] {\n return Array.from({ length: width }, (_, index) => align[index] ?? null);\n}\n\n/**\n * GitHub-compatible heading slug: lowercase, punctuation dropped, spaces to dashes.\n *\n * `_` and `-` are KEPT, which is what GitHub does — stripping the underscore broke\n * every published `#snake_case` anchor.\n */\nfunction slug(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\p{L}\\p{N}\\s_-]/gu, '')\n .trim()\n .replace(/\\s+/g, '-');\n}\n\n/**\n * The slug, with a counter when the document repeats a title.\n *\n * Two `## Fixes` in one changelog produced two `id=\"fixes\"`, which is invalid and\n * makes `#fixes` resolve to whichever came first. GitHub appends `-1`, `-2`; so\n * does this. An empty slug (a heading of pure emoji, or no text at all) stays\n * empty and the renderer binds no `id`.\n */\nfunction uniqueSlug(text: string, ctx: ParseContext): string {\n const base = slug(text);\n if (!base) return '';\n\n const used = ctx.slugs.get(base) ?? 0;\n ctx.slugs.set(base, used + 1);\n\n return used === 0 ? base : `${base}-${used}`;\n}\n\n// ---------------------------------------------------------------------------\n// Inline\n// ---------------------------------------------------------------------------\n\n// Every ASCII punctuation character, which is what CommonMark allows. The\n// hand-written subset left `\\$`, `\\&`, `\\%` and eight others rendering with their\n// backslash — and `\\$` is what generators emit to keep a dollar out of math mode.\nconst ESCAPABLE = /[!-/:-@[-`{-~]/;\nconst SCHEME_RE = /^([a-z][a-z0-9+.-]*):/i;\nconst ALLOWED_SCHEMES = new Set(['http', 'https', 'mailto', 'tel', 'ftp']);\nconst DATA_IMAGE_RE = /^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[a-z0-9+/=]+$/i;\n// `[^<>\\s]` and not `[^>\\s]`: CommonMark defines autolink content as\n// `[^<>\\x00-\\x20]*`, so `<` ends it by spec — and admitting it is what made this\n// quadratic. On `<http://a<http://a<…` the scheme matches, the class swallows the\n// rest of the document looking for `>`, then backtracks a character at a time, once\n// per `<`. 160 KB took 1.7 s. `ANGLE_DEST_RE` and `EMAIL_AUTOLINK_RE` beside it\n// already exclude `<`; this one was the outlier. The only input that now parses\n// differently is `<http://a<b>`, which no other parser reads as a link either.\nconst AUTOLINK_RE = /^<((?:https?|mailto|tel):[^<>\\s]+)>/i;\n/** `<destination>` — markdown's way of putting a space in a URL. */\nconst ANGLE_DEST_RE = /^<([^<>]*)>(?:\\s+[\"'(](.*)[\"')])?$/;\n/** CommonMark's own cap on a link label, which is also what bounds the scan. */\nconst MAX_LABEL_LENGTH = 999;\n/**\n * How deep parentheses may nest inside `[a](…)` before the destination is refused\n * outright — counted from the `(` that opens it, so 31 nested pairs inside.\n *\n * This is a bound on WORK, not on taste, and it is the only thing standing\n * between a paragraph and a frozen tab. The destination scan walks forward for a\n * balancing `)`, and an unclosed destination sends it to the end of the line; one\n * `[a](x` costs nothing, but `'[a](x'.repeat(16384)` — 80 KB on a single line —\n * makes every one of the 16384 openers walk the whole remainder, which measured\n * 936 ms at 80 KB and 3.9 s at 160 KB, synchronously inside a `computed` during\n * change detection. A `~4x` cost per doubling of the input: quadratic, on a\n * component whose documented input is a comment or a model's output.\n *\n * The cap fixes it because a scan can only keep going by NOT finding its closer,\n * and every later `[…](` it walks past contributes an unmatched `(` of its own —\n * so after 32 of them the scan stops, no opener's walk can cover more than the\n * next 32 openers, and the total is linear in the document. (A `)` that would\n * bring the count back down is the closer, and ends the scan anyway.) The number\n * is cmark's: `manual_scan_link_url` refuses at the same depth, for the same\n * reason.\n *\n * What it costs: a destination with 32 or more nested `(` is no longer a link and\n * renders as text. No URL looks like that — the deep end of the real world is a\n * Wikipedia `..._(disambiguation)`, which is one pair.\n */\nconst MAX_DESTINATION_NESTING = 32;\nconst BARE_URL_RE = /^https?:\\/\\/[^\\s<>[\\]()]*(?:\\([^\\s<>()]*\\)[^\\s<>[\\]()]*)*/i;\nconst EMAIL_AUTOLINK_RE = /^<([^\\s@<>]+@[^\\s@<>.]+\\.[^\\s@<>]+)>/;\n\n/**\n * A URL safe to put in `href` / `src`, or `null` to render the link as plain text.\n *\n * Two layers, and both are wanted. Angular sanitizes `[href]` bindings itself,\n * but its answer to a hostile URL is the string `unsafe:javascript:…` in a live\n * anchor — a link that looks real, is announced as a link, and does nothing.\n * Refusing it here means the label renders as text instead, which is honest.\n *\n * Whitespace and control characters are stripped before the scheme is read,\n * because `java\\nscript:` and `java script:` are the same URL to a browser and\n * different strings to a naive check.\n */\nfunction safeMarkdownUrl(raw: string, kind: 'link' | 'image'): string | null {\n const url = raw.trim();\n // Whitespace and control characters only: a hyphen has no business being\n // stripped out of a host name. Written as escapes rather than literal bytes —\n // a raw NUL inside a regex literal makes the file binary to every text tool.\n // Stripping control characters is the entire point here: a browser ignores them\n // before resolving the scheme, so a check that reads the raw string sees a\n // relative path and waves `java\\u0000script:` straight through.\n // eslint-disable-next-line no-control-regex\n const bare = url.replace(/[\\s\\u0000-\\u001f\\u007f]/g, '');\n const scheme = SCHEME_RE.exec(bare);\n\n // No scheme at all: relative path, `#anchor`, `//host` — nothing executable.\n if (!scheme) return url;\n\n const name = scheme[1].toLowerCase();\n\n // `data:` is an image-only allowance, and only for raster types: an SVG can\n // carry script, and `data:text/html` is a same-origin document.\n if (name === 'data') return kind === 'image' && DATA_IMAGE_RE.test(bare) ? bare : null;\n\n return ALLOWED_SCHEMES.has(name) ? url : null;\n}\n\n/** Inline markdown to nodes. */\nfunction parseInlines(source: string, options: WrMarkdownParseOptions = {}): readonly WrMarkdownInline[] {\n return inlines(source, 0, newContext(options.streaming ?? false));\n}\n\nfunction inlines(source: string, depth: number, outer: ParseContext): readonly WrMarkdownInline[] {\n if (depth >= MAX_DEPTH) return source ? [{ kind: 'text', value: source }] : [];\n\n // The two failure memos hold INDEXES into `source`, so they are only ever true\n // of the one string this call is scanning — and the context they live on spans\n // the whole document. Shared, an index recorded in one paragraph is compared\n // against a position in the next, and refuses emphasis and links that are\n // perfectly well formed; `matchEmphasis` recursing on a slice (below) does the\n // same thing INSIDE a single paragraph, so restoring on return would not be\n // enough either. A memo per scan is the only keying that means anything, and it\n // costs nothing: the linearity argument in {@link ParseContext.noCloser} is a\n // statement about one string in the first place.\n const ctx: ParseContext = { ...outer, noCloser: new Map(), noBracket: { from: Number.POSITIVE_INFINITY } };\n\n const out: WrMarkdownInline[] = [];\n let text = '';\n let i = 0;\n\n const flush = (): void => {\n if (text) {\n out.push({ kind: 'text', value: text });\n text = '';\n }\n };\n\n while (i < source.length) {\n const char = source[i];\n\n if (char === '\\\\') {\n // A backslash before a newline is a hard break; before punctuation, an escape.\n if (source[i + 1] === '\\n') {\n flush();\n out.push({ kind: 'break' });\n i += 2;\n continue;\n }\n if (i + 1 < source.length && ESCAPABLE.test(source[i + 1])) {\n text += source[i + 1];\n i += 2;\n continue;\n }\n }\n\n if (char === '\\n') {\n // Two trailing spaces are markdown's hard break, and the question is asked\n // of the SOURCE rather than of `text` — twice now, this one line has been\n // where paragraph parsing went quadratic.\n //\n // `/[ ]{2,}$/.test(text)` was the first version: no start anchor, so it\n // retries from every position of the accumulated paragraph. A CPU profile\n // of a 161 KB document put 3306 ms of 3378 ms of total self-time in it.\n // `text.endsWith(' ')` replaced it and is quadratic for a different\n // reason: `text` is built by `+=`, so it is a rope, and every read of its\n // tail flattens the whole thing — 160,000 short lines cost 1980 ms of\n // copying against 7 ms for the same loop without the test. Ordinary prose\n // reaches that shape; nothing has to be malformed.\n //\n // Reading `source` instead answers the same question in constant time, and\n // it IS the same question: while `text` is non-empty its last character is\n // always `source[i - 1]` (every branch that appends appends exactly the\n // character it consumed), and when it is empty the preceding characters\n // belong to a construct that just closed — none of which can end in a\n // space, since a closing fence, `)`, `>` or emphasis marker is never one.\n const hard = source[i - 1] === ' ' && source[i - 2] === ' ';\n if (hard) {\n text = text.replace(/[ ]+$/, '');\n flush();\n out.push({ kind: 'break' });\n } else {\n // A soft break is whitespace; CSS collapses it like any other.\n text += '\\n';\n }\n i++;\n continue;\n }\n\n if (char === '`') {\n const run = /^`+/.exec(source.slice(i))![0];\n const close = findCodeClose(source, i + run.length, run);\n if (close !== -1) {\n flush();\n out.push({ kind: 'code', value: codeSpanValue(source.slice(i + run.length, close)) });\n i = close + run.length;\n continue;\n }\n }\n\n if (char === '<') {\n const auto = AUTOLINK_RE.exec(source.slice(i));\n if (auto) {\n // `ctx.inLink`: CommonMark forbids a link inside a link, and nothing else\n // stops it here — a tree built with DOM APIs nests the `<a>` an HTML\n // parser would have thrown away, which is invalid markup and an axe\n // `nested-interactive` violation at serious level.\n const href = ctx.inLink ? null : safeMarkdownUrl(auto[1], 'link');\n flush();\n out.push(\n href\n ? { kind: 'link', href, title: null, children: [{ kind: 'text', value: auto[1] }] }\n : { kind: 'text', value: auto[1] }\n );\n i += auto[0].length;\n continue;\n }\n const email = EMAIL_AUTOLINK_RE.exec(source.slice(i));\n if (email) {\n // Through `safeMarkdownUrl` like every other href: built by hand, this was\n // the one destination that skipped the control-character strip, which the\n // component's own JSDoc promises for all of them.\n const href = ctx.inLink ? null : safeMarkdownUrl(`mailto:${email[1]}`, 'link');\n flush();\n out.push(\n href\n ? { kind: 'link', href, title: null, children: [{ kind: 'text', value: email[1] }] }\n : { kind: 'text', value: email[1] }\n );\n i += email[0].length;\n continue;\n }\n }\n\n if (char === '!' && source[i + 1] === '[') {\n const link = matchLink(source, i + 1, ctx);\n if (link) {\n const src = safeMarkdownUrl(link.href, 'image');\n const alt = plainText(inlines(link.label, depth + 1, { ...ctx, inLink: true }));\n flush();\n // A refused source leaves the alt text, which is the information the\n // author actually wrote.\n out.push(src ? { kind: 'image', src, alt, title: link.title } : { kind: 'text', value: alt });\n i = link.end;\n continue;\n }\n }\n\n if (char === '[') {\n const link = matchLink(source, i, ctx);\n if (link) {\n const href = ctx.inLink ? null : safeMarkdownUrl(link.href, 'link');\n // The label is parsed with links SUPPRESSED, so an inner one renders as\n // its own text — CommonMark's answer to `[a [b](c)](d)`.\n const children = inlines(link.label, depth + 1, { ...ctx, inLink: true });\n flush();\n if (href) out.push({ kind: 'link', href, title: link.title, children });\n else out.push(...children);\n i = link.end;\n continue;\n }\n }\n\n if ((char === 'h' || char === 'H') && (i === 0 || !/[\\w/]/.test(source[i - 1]))) {\n const bare = ctx.inLink ? null : BARE_URL_RE.exec(source.slice(i));\n if (bare) {\n const url = trimUrlPunctuation(bare[0]);\n const href = safeMarkdownUrl(url, 'link');\n if (href) {\n flush();\n out.push({ kind: 'link', href, title: null, children: [{ kind: 'text', value: url }] });\n i += url.length;\n continue;\n }\n }\n }\n\n if (char === '*' || char === '_' || char === '~') {\n const emphasis = matchEmphasis(source, i, depth, ctx);\n if (emphasis) {\n flush();\n out.push(emphasis.node);\n i = emphasis.end;\n continue;\n }\n }\n\n text += char;\n i++;\n }\n\n flush();\n\n return out;\n}\n\n/** The closing backtick run of exactly the opener's length — a longer run is not it. */\nfunction findCodeClose(source: string, from: number, run: string): number {\n for (let i = from; i < source.length; i++) {\n if (source[i] !== '`') continue;\n\n let end = i;\n while (source[end] === '`') end++;\n if (end - i === run.length) return i;\n i = end - 1;\n }\n\n return -1;\n}\n\n/** CommonMark strips one space from each end when both are present. */\nfunction codeSpanValue(raw: string): string {\n const value = raw.replace(/\\n/g, ' ');\n return value.length > 2 && value.startsWith(' ') && value.endsWith(' ') && value.trim() ? value.slice(1, -1) : value;\n}\n\ninterface LinkMatch {\n readonly label: string;\n readonly href: string;\n readonly title: string | null;\n /** Index just past the closing paren. */\n readonly end: number;\n}\n\n/**\n * `[label](href \"title\")` starting at `source[at] === '['`.\n *\n * Three bounds, all load-bearing. The label scan stops at\n * {@link MAX_LABEL_LENGTH}, which is CommonMark's own limit, and a scan that\n * reaches the end of the source without meeting a single `]` records the fact in\n * the context — from then on every later `[` answers in constant time. Without\n * that, `'['.repeat(100000)` spent 8 seconds on the main thread, inside a\n * `computed`. The third is {@link MAX_DESTINATION_NESTING}, on the destination\n * scan, and it is the one that makes the whole function linear.\n */\nfunction matchLink(source: string, at: number, ctx: ParseContext): LinkMatch | null {\n if (at >= ctx.noBracket.from) return null;\n\n let depth = 0;\n let close = -1;\n let sawClose = false;\n let scannedToEnd = true;\n\n for (let i = at; i < source.length; i++) {\n if (i - at > MAX_LABEL_LENGTH) {\n scannedToEnd = false;\n break;\n }\n const char = source[i];\n if (char === '\\\\') {\n i++;\n continue;\n }\n // A code span can hold an unbalanced bracket; stepping over it keeps\n // `` [`a]b`](x) `` from ending the label early.\n if (char === '`') {\n const run = /^`+/.exec(source.slice(i))![0];\n const end = findCodeClose(source, i + run.length, run);\n if (end !== -1) {\n i = end + run.length - 1;\n continue;\n }\n }\n if (char === '[') depth++;\n if (char === ']') {\n sawClose = true;\n depth--;\n if (depth === 0) {\n close = i;\n break;\n }\n }\n }\n\n if (close === -1) {\n // Only when the source truly holds no `]` past here: an unbalanced nest\n // (`[[a](b)`) fails for a different reason, and memoising that would hide the\n // valid link one character to the right.\n if (!sawClose && scannedToEnd) ctx.noBracket.from = Math.min(ctx.noBracket.from, at);\n return null;\n }\n\n if (source[close + 1] !== '(') return null;\n\n let parens = 1;\n let end = -1;\n for (let i = close + 2; i < source.length; i++) {\n const char = source[i];\n if (char === '\\\\') {\n i++;\n continue;\n }\n if (char === '(') {\n parens++;\n // Giving up HERE is what makes the scan linear rather than quadratic — see\n // {@link MAX_DESTINATION_NESTING}.\n if (parens > MAX_DESTINATION_NESTING) return null;\n }\n if (char === ')') {\n parens--;\n if (parens === 0) {\n end = i;\n break;\n }\n }\n // A newline inside the destination means this was never a link.\n if (char === '\\n') return null;\n }\n\n if (end === -1) return null;\n\n const target = source.slice(close + 2, end).trim();\n const label = source.slice(at + 1, close);\n\n // `<…>` around the destination is markdown's way of allowing a space in it, and\n // it has to be unwrapped BEFORE the scheme is read: `[a](<javascript:alert(1)>)`\n // has no scheme while the bracket is still attached, so `safeMarkdownUrl` read\n // it as a relative path and waved it through — leaving Angular's sanitizer, the\n // layer this file calls insufficient, as the only thing standing in the way.\n const angled = ANGLE_DEST_RE.exec(target);\n if (angled) return { label, href: angled[1], title: angled[2] ?? null, end: end + 1 };\n\n const titled = /^(\\S*)\\s+[\"'(](.*)[\"')]$/.exec(target);\n\n return {\n label,\n href: titled ? titled[1] : target,\n title: titled ? titled[2] : null,\n end: end + 1,\n };\n}\n\n/** Trailing sentence punctuation belongs to the prose, not to the bare URL. */\nfunction trimUrlPunctuation(url: string): string {\n return url.replace(/[.,;:!?'\"]+$/, '');\n}\n\ninterface EmphasisMatch {\n readonly node: WrMarkdownInline;\n readonly end: number;\n}\n\n/**\n * Emphasis, strong and strikethrough.\n *\n * A pragmatic reading of CommonMark's flanking rules rather than the full\n * algorithm: an opener may not be followed by whitespace, a closer may not be\n * preceded by it, and `_` additionally may not sit against a word character on\n * the outside. That last clause is the one that matters in practice — without it\n * `snake_case_name` renders as `snake<em>case</em>name`, which is how most\n * lightweight parsers embarrass themselves on code-adjacent prose.\n */\nfunction matchEmphasis(source: string, at: number, depth: number, ctx: ParseContext): EmphasisMatch | null {\n const char = source[at];\n const run = /^(\\*+|_+|~+)/.exec(source.slice(at))![0].length;\n\n // `~` is strikethrough only as a pair: a single one is arithmetic, a path, or\n // LaTeX far more often than it is emphasis.\n if (char === '~' && run < 2) return null;\n\n const use = char === '~' ? 2 : Math.min(run, 2);\n const after = source[at + run];\n if (after === undefined || /\\s/.test(after)) return null;\n if (char === '_' && at > 0 && /[\\p{L}\\p{N}]/u.test(source[at - 1])) return null;\n\n // Already known to have no closer from here on. The search is monotone — the\n // window for a later opener is a subset of this one — so one failure answers\n // every subsequent opener of the same character, which is what turns a\n // quadratic scan into a linear one.\n const failedFrom = ctx.noCloser.get(char);\n if (failedFrom !== undefined && at >= failedFrom) return null;\n\n for (let i = at + run; i < source.length; i++) {\n const current = source[i];\n\n if (current === '\\\\') {\n i++;\n continue;\n }\n\n if (current === '`') {\n const backticks = /^`+/.exec(source.slice(i))![0];\n const end = findCodeClose(source, i + backticks.length, backticks);\n if (end !== -1) {\n i = end + backticks.length - 1;\n continue;\n }\n }\n\n if (current !== char) continue;\n\n let end = i;\n while (source[end] === char) end++;\n const length = end - i;\n\n if (length < use || /\\s/.test(source[i - 1])) {\n i = end - 1;\n continue;\n }\n if (char === '_' && end < source.length && /[\\p{L}\\p{N}]/u.test(source[end])) {\n i = end - 1;\n continue;\n }\n\n // Take `use` markers from the START of the opener and the END of the closer,\n // so `***x***` leaves `*x*` inside the strong node and nests correctly.\n const children = inlines(source.slice(at + use, end - use), depth + 1, ctx);\n const kind = char === '~' ? 'del' : use === 2 ? 'strong' : 'em';\n\n return { node: { kind, children }, end };\n }\n\n // No closer anywhere in this source. Recorded so the next opener of the same\n // character does not repeat the walk.\n //\n // Note what does NOT happen here any more: an optimistic close. Guessing at the\n // scanner level meant a marker 40 characters back swallowed the rest of the\n // block — including markup that had already parsed, so an unclosed backtick ate\n // a finished `[docs](url)` and rendered it as monospaced source. Mid-stream\n // guessing now happens once, on the document's tail, where it can be bounded.\n // See {@link applyStreamingTail}.\n ctx.noCloser.set(char, Math.min(failedFrom ?? Number.POSITIVE_INFINITY, at));\n\n return null;\n}\n\n/** Text content of an inline tree — for `alt` and for heading slugs. */\nfunction plainText(inlines: readonly WrMarkdownInline[]): string {\n return inlines\n .map(node => {\n switch (node.kind) {\n case 'text':\n case 'code':\n return node.value;\n case 'image':\n return node.alt;\n case 'break':\n return ' ';\n default:\n return plainText(node.children);\n }\n })\n .join('');\n}\n\n// ---------------------------------------------------------------------------\n// Streaming\n// ---------------------------------------------------------------------------\n\n/**\n * How far back from the end of the document a marker may sit and still be treated\n * as mid-flight.\n *\n * The optimistic close is a GUESS, and a guess needs a blast radius. Unbounded, a\n * `*` forty characters back turned the rest of a finished sentence into emphasis\n * for the whole stream and then unwrapped it at the end — the exact restyle the\n * feature exists to avoid. Within a chunk's distance of the end, an unmatched\n * marker is nearly always a construct still arriving.\n */\nconst TAIL_WINDOW = 80;\n\n/**\n * A run that is worth closing optimistically, and its node kind.\n *\n * Deliberately no single `*` or `_`. Those are multiplication signs, file names\n * and `snake_case` far more often than they are emphasis mid-word, and getting it\n * wrong there restyles ordinary prose. `**`, `__`, `~~` and a backtick are\n * unambiguous enough to bet on.\n */\nconst OPTIMISTIC_RE = /(\\*\\*|__|~~|`)([^\\s*_~`][^*_~`]*)$/;\n\n/**\n * A construct the stream has only begun to type: a trailing marker run, or a link\n * whose destination has not arrived.\n *\n * Anchored, and every alternative bounded. The version this replaced allowed\n * `\\][^)]*` to run to the end of the text, so a CLOSED `[docs]` in the middle of a\n * sentence matched from the bracket onwards and deleted the rest of the paragraph\n * — and kept deleting it for the whole stream, because the paragraph stayed the\n * last block. `See the [docs] for details.` rendered as `See the `.\n */\nconst FRAGMENT_RE = /(?:[*_~`]+|!?\\[[^\\]\\n]*(?:\\]\\([^)\\s]*)?)$/;\n\n/**\n * The mid-stream adjustments, applied once to the document's TAIL.\n *\n * Everything the streaming mode does beyond parsing an open fence lives here, and\n * the reason is scope. The tail is the only part of a streamed document that is\n * still changing, so it is the only part where guessing is defensible; a guess\n * made inside the inline scanner cannot tell whether it is at the end of the\n * document or in the middle of a paragraph that finished two chunks ago.\n *\n * It descends: the last block may be a quote, or the last item of a list, which is\n * where most streamed prose actually lives. The version that only looked at a\n * top-level paragraph left the `**` flicker in place everywhere else while the\n * documentation claimed otherwise.\n */\nfunction applyStreamingTail(blocks: readonly WrMarkdownBlock[]): readonly WrMarkdownBlock[] {\n const last = blocks[blocks.length - 1];\n if (!last) return blocks;\n\n const patched = patchBlock(last);\n if (patched === last) return blocks;\n\n const head = blocks.slice(0, -1);\n\n return patched === null ? head : [...head, patched];\n}\n\n/** `null` to drop the block entirely, the same reference to leave it alone. */\nfunction patchBlock(block: WrMarkdownBlock): WrMarkdownBlock | null {\n switch (block.kind) {\n case 'paragraph':\n case 'heading': {\n // `## ` with nothing after it yet: a node that would render as an empty box.\n if (block.inlines.length === 0) return null;\n\n const inlines = patchInlines(block.inlines);\n if (inlines === block.inlines) return block;\n\n return inlines.length === 0 ? null : { ...block, inlines };\n }\n\n case 'quote': {\n const children = applyStreamingTail(block.children);\n if (children === block.children) return block;\n\n return children.length === 0 ? null : { ...block, children };\n }\n\n case 'list': {\n const item = block.items[block.items.length - 1];\n if (!item) return block;\n\n const children = applyStreamingTail(item.children);\n if (children === item.children) return block;\n\n // The item stays even when its content goes: the bullet is already on\n // screen, and removing it would be a flicker of its own.\n return { ...block, items: [...block.items.slice(0, -1), { ...item, children }] };\n }\n\n default:\n return block;\n }\n}\n\nfunction patchInlines(nodes: readonly WrMarkdownInline[]): readonly WrMarkdownInline[] {\n const last = nodes[nodes.length - 1];\n if (!last) return nodes;\n\n // The tail may be inside a wrapper — `**bold and [lin` puts it inside the strong.\n if (last.kind === 'strong' || last.kind === 'em' || last.kind === 'del' || last.kind === 'link') {\n const children = patchInlines(last.children);\n if (children === last.children) return nodes;\n\n const head = nodes.slice(0, -1);\n\n return children.length === 0 ? head : [...head, { ...last, children }];\n }\n\n // A backtick that has only just arrived, already painted as an empty chip.\n if (last.kind === 'code' && last.value === '') return nodes.slice(0, -1);\n\n if (last.kind !== 'text') return nodes;\n\n const patched = patchText(last.value);\n\n return patched === null ? nodes : [...nodes.slice(0, -1), ...patched];\n}\n\n/** `null` when the text is not a tail that needs adjusting. */\nfunction patchText(value: string): readonly WrMarkdownInline[] | null {\n let text = value;\n\n // Repeatedly, because dropping `[lin` from `**bold and [lin` exposes the `**`\n // behind it, which is then a candidate for the optimistic close below.\n for (let pass = 0; pass < 3; pass++) {\n const shorter = text.replace(FRAGMENT_RE, '');\n if (shorter === text) break;\n text = shorter;\n }\n\n const opening = OPTIMISTIC_RE.exec(text);\n if (opening) {\n const [matched, marker, content] = opening;\n const at = text.length - matched.length;\n const before = text.slice(0, at);\n // `_` may not close against a word character, so mid-word it is not a marker\n // at all — `snake_case` must not italicise as it arrives.\n const wordBefore = marker === '__' && at > 0 && /[\\p{L}\\p{N}]/u.test(text[at - 1]);\n\n if (!wordBefore && content.length <= TAIL_WINDOW) {\n const node: WrMarkdownInline =\n marker === '`'\n ? { kind: 'code', value: content }\n : { kind: marker === '~~' ? 'del' : 'strong', children: [{ kind: 'text', value: content }] };\n\n return before ? [{ kind: 'text', value: before }, node] : [node];\n }\n }\n\n if (text === value) return null;\n\n return text ? [{ kind: 'text', value: text }] : [];\n}\n\nexport { parseInlines, parseMarkdown, plainText, safeMarkdownUrl };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrMarkdownHighlighter } from './interfaces';\n\n/**\n * The app's syntax highlighter, or `null` for none.\n *\n * Defaults to `null` on purpose: highlighting means a grammar engine, and one of\n * those in the library's dependency tree would be paid for by every consumer who\n * renders a paragraph of text. Provide it with `provideWrMarkdownHighlighter()`.\n */\nexport const WR_MARKDOWN_HIGHLIGHTER = new InjectionToken<WrMarkdownHighlighter | null>('WR_MARKDOWN_HIGHLIGHTER', {\n factory: () => null,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injectable, inject, signal } from '@angular/core';\n\nimport type { WrHighlightLine } from './interfaces';\nimport { WR_MARKDOWN_HIGHLIGHTER } from './tokens';\n\n/**\n * How many highlighted code blocks to remember, per language.\n *\n * A requirement of streaming rather than an optimisation: a code block that grows\n * by a token per chunk asks to be highlighted with a DIFFERENT string every time,\n * so an unbounded store would hold every intermediate state of every block for the\n * life of the app — and this service is `providedIn: 'root'`.\n *\n * Comfortably larger than any one document, deliberately. A window too small to\n * hold what is on screen means every pass evicts entries that same pass still\n * needs and asks for them again — a grammar engine running for ever on a page that\n * has stopped changing.\n */\nconst CACHE_LIMIT = 256;\n\n/**\n * How many languages to remember at all.\n *\n * {@link CACHE_LIMIT} bounds the store in the dimension a STREAM controls and\n * left it unbounded in the dimension the DOCUMENT controls: `language` is the\n * first word of the code fence's info string, arbitrary text from an input\n * `<wr-markdown>` treats as untrusted — so a document of ```` ```a1 ```` …\n * ```` ```aN ```` fences created N buckets that only `invalidate()` ever\n * removed. Same `providedIn: 'root'` lifetime as the rest of this store.\n *\n * Comfortably larger than any one document for the same reason `CACHE_LIMIT` is:\n * a window too small to hold what is on screen evicts what the same pass still\n * renders. A document with more than a few dozen distinct languages is exotic.\n *\n * Evicting here cannot re-dirty the effect that requests, which is the loop this\n * class is built around avoiding: that effect depends on `generation`, and\n * nothing on this path writes it.\n *\n * Exported for the spec, not through `public-api.ts` — the number is the whole\n * assertion, and a copy of it in the test would stop tracking this one.\n */\nconst LANGUAGE_LIMIT = 64;\n\n/** One block's answer. `lines` stays `null` until an async highlighter resolves. */\ninterface Entry {\n lines: readonly WrHighlightLine[] | null;\n}\n\n/**\n * Turns fenced code into coloured spans, once per distinct block.\n *\n * **Two rules hold this together, and both were learned by breaking them.**\n *\n * `request` never READS a signal that it writes. An earlier version kept the\n * answers in a signal and rebuilt it on every store, so the component's `effect` —\n * which calls `request` — depended on the signal `request` wrote, and a document\n * with more code blocks than the cache could hold looped for ever: evict,\n * re-request, write, re-dirty. It did not merely spin, it starved the timers that\n * were supposed to fail the test. The plain `Map` is the source of truth now, and a\n * single `revision` counter is the only reactive part; nothing that writes reads it\n * back.\n *\n * And `linesFor` is a pure read, safe to call while Angular renders. Asking a\n * highlighter for a block means writing when the answer lands, and Angular refuses\n * a signal write during rendering (NG0600) — so the component requests from an\n * `effect`, which runs after the render, and the template only reads.\n *\n * Blocks appear as plain text first and gain colour when the answer arrives. For an\n * async highlighter that is right rather than a compromise: a grammar engine loads\n * WASM, and blocking on it would leave the reader with an empty box instead of\n * their code.\n */\n@Injectable({ providedIn: 'root' })\nexport class WrMarkdownHighlight {\n private readonly highlighter = inject(WR_MARKDOWN_HIGHLIGHTER);\n\n /** Language to code to answer. Insertion order is least-recently-rendered first. */\n private readonly cache = new Map<string, Map<string, Entry>>();\n\n /** Bumped whenever an answer lands. Read by the template, never by a writer. */\n private readonly revision = signal(0);\n\n private readonly generationSignal = signal(0);\n\n /**\n * Bumped ONLY by {@link invalidate}. Read it in the effect that requests, so a\n * consumer can force a re-ask.\n *\n * Separate from `revision` on purpose, and the separation is the whole safety\n * argument. An effect that requests and also depends on the signal that storing\n * an answer writes is the shape that looped for ever here once: past the cache\n * limit, requesting stops being idempotent, so each pass writes, re-dirties the\n * effect, evicts and requests again. Nothing inside `request` touches this one.\n */\n readonly generation = this.generationSignal.asReadonly();\n\n /** Spans for one block, or `null` for plain text. Safe to call from a template. */\n linesFor(code: string, language: string | null): readonly WrHighlightLine[] | null {\n if (!language) return null;\n\n // Establishes the dependency, so a late answer re-renders the block waiting.\n this.revision();\n\n const perLanguage = this.cache.get(language);\n const entry = perLanguage?.get(code);\n if (!entry || !perLanguage) return null;\n\n // Touched on read, so eviction drops what nobody is rendering rather than what\n // arrived first. Insertion order had it exactly backwards: mid-stream it\n // discarded the finished block the reader was looking at and kept the\n // half-typed intermediates, and the finished block flashed back to plain text.\n perLanguage.delete(code);\n perLanguage.set(code, entry);\n\n return entry.lines;\n }\n\n /**\n * Forget every answer and ask again on the next render.\n *\n * The cache is keyed on `(language, code)` and nothing else, which is right for\n * the streaming case it exists for and wrong for one real situation: a\n * highlighter that returns per-theme colours serves whichever palette was\n * current when a block was first rendered, for ever. There is no theme\n * dimension to key on — the library cannot know what a highlighter's answer\n * depends on — so the honest fix is to let the consumer say when it changed.\n *\n * A highlighter that returns theme-agnostic colours (CSS `light-dark()`, a\n * custom property) needs none of this.\n *\n * @example\n * ```ts\n * const highlight = inject(WrMarkdownHighlight);\n * effect(() => {\n * theme.current();\n * highlight.invalidate();\n * });\n * ```\n */\n invalidate(): void {\n this.cache.clear();\n this.generationSignal.update(generation => generation + 1);\n this.revision.update(revision => revision + 1);\n }\n\n /**\n * Ask for a block to be highlighted. Idempotent, and safe to call for every\n * block on every change — call it from an `effect`, never from a template.\n */\n request(code: string, language: string | null): void {\n // A bare fence has no grammar to pick, so there is nothing to ask for.\n if (!this.highlighter || !language || !code) return;\n\n const existing = this.cache.get(language);\n // Deleted before it is re-set, because `Map.set` on a key it already holds\n // keeps the ORIGINAL position: a plain `set` would leave the outer map in\n // first-sighting order, and `evictLanguage` would then drop a language still\n // being asked for in favour of one seen earlier and no longer rendered.\n if (existing) this.cache.delete(language);\n const perLanguage = existing ?? new Map<string, Entry>();\n this.cache.set(language, perLanguage);\n this.evictLanguage();\n // Presence IS the record of having asked — a separate `asked` set was a second\n // structure to keep in step with this one, and eviction only pruned one of them.\n if (perLanguage.has(code)) return;\n\n const entry: Entry = { lines: null };\n perLanguage.set(code, entry);\n this.evict(perLanguage);\n\n let result: ReturnType<typeof this.highlighter>;\n try {\n result = this.highlighter(code, language);\n } catch {\n // A highlighter that throws on an unknown grammar costs the reader colour,\n // not their code.\n return;\n }\n\n if (result instanceof Promise) {\n result.then(lines => this.fill(entry, lines)).catch(() => undefined);\n } else {\n this.fill(entry, result);\n }\n }\n\n /**\n * Fill in an answer and let the view know.\n *\n * Writes through the entry OBJECT rather than looking its key up again. The entry\n * may have been evicted while the promise was in flight, in which case this\n * writes to something nothing holds — which is the intended outcome. The version\n * that re-inserted by key put entries back behind eviction's back, and the cache\n * grew without a ceiling for exactly the async highlighter its limit exists for.\n */\n private fill(entry: Entry, lines: readonly WrHighlightLine[] | null): void {\n if (!lines) return;\n\n entry.lines = lines;\n this.revision.update(revision => revision + 1);\n }\n\n /** `Map` iterates in insertion order, and `linesFor` re-inserts on read. */\n private evict(perLanguage: Map<string, Entry>): void {\n while (perLanguage.size > CACHE_LIMIT) {\n const oldest = perLanguage.keys().next();\n if (oldest.done) return;\n perLanguage.delete(oldest.value);\n }\n }\n\n /**\n * The same bound, one dimension out. `request` re-inserts a bucket it already\n * holds, so the outer map iterates least-recently-REQUESTED first — and the\n * component's effect asks for every code block in the document it is showing,\n * so a language that stops being requested is one nothing renders any more.\n *\n * Read is deliberately NOT a touch here, unlike {@link linesFor} for the inner\n * map: with the effect re-asking for every block, request order already tracks\n * what is rendered, and nothing has needed the finer signal.\n */\n private evictLanguage(): void {\n while (this.cache.size > LANGUAGE_LIMIT) {\n const oldest = this.cache.keys().next();\n if (oldest.done) return;\n this.cache.delete(oldest.value);\n }\n }\n}\n\nexport { LANGUAGE_LIMIT };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, signal } from '@angular/core';\n\nimport { useConfigValue } from 'ngwr/config';\nimport { WrCopyToClipboard } from 'ngwr/directives';\nimport { useI18nText } from 'ngwr/i18n';\n\nimport type {\n WrHighlightLine,\n WrMarkdownBlock,\n WrMarkdownCell,\n WrMarkdownInline,\n WrMarkdownListItem,\n} from './interfaces';\nimport { parseMarkdown } from './parse-markdown';\nimport { WrMarkdownHighlight } from './wr-markdown-highlight';\n\n/** How long the copy button stays in its \"copied\" state. */\nconst COPIED_FEEDBACK_MS = 2000;\n\n/** Code blocks anywhere in the tree — a quote or a list item holds blocks too. */\nfunction collectCode(blocks: readonly WrMarkdownBlock[]): readonly { code: string; language: string | null }[] {\n const found: { code: string; language: string | null }[] = [];\n\n for (const block of blocks) {\n if (block.kind === 'code') found.push({ code: block.code, language: block.language });\n if (block.kind === 'quote') found.push(...collectCode(block.children));\n if (block.kind === 'list') for (const item of block.items) found.push(...collectCode(item.children));\n }\n\n return found;\n}\n\n/**\n * Renders markdown — as DOM, not as HTML.\n *\n * Built for streamed model output, and useful for any markdown an app does not\n * write itself: comments, release notes, a README. `[streaming]` makes a partial\n * document render like a whole one (see {@link parseMarkdown}); without it the\n * component is an ordinary renderer.\n *\n * **Raw HTML in the source is escaped, never rendered.** That is a deliberate\n * limit rather than an unfinished feature: the input is untrusted by\n * construction, `[innerHTML]` is how every comparable renderer takes it, and one\n * `<img onerror>` is the whole cost of being wrong. Nothing here is parsed as\n * HTML at any point — every text node is a text node and every `href` goes\n * through Angular's URL sanitizer on top of this component's own scheme check.\n *\n * @example\n * ```html\n * <wr-markdown [value]=\"answer()\" [streaming]=\"pending()\" copyable />\n * ```\n *\n * @see https://ngwr.dev/reference/components/markdown\n */\n@Component({\n selector: 'wr-markdown',\n templateUrl: './wr-markdown.html',\n imports: [NgTemplateOutlet, WrCopyToClipboard],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-markdown',\n '[class.wr-markdown--streaming]': 'streaming()',\n },\n})\nexport class WrMarkdown {\n private readonly highlight = inject(WrMarkdownHighlight);\n private readonly destroyRef = inject(DestroyRef);\n\n /** The markdown source. */\n readonly value = input<string>('');\n\n /**\n * The source is a prefix of a longer document.\n *\n * Turns on partial-safe parsing — an open fence renders as code, a half-typed\n * `**bold` renders as bold rather than as asterisks — and marks the host with\n * `.wr-markdown--streaming`, which paints a caret after the last block.\n *\n * @default false\n */\n readonly streaming = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show a copy button on finished code blocks.\n *\n * Falls back to `markdown.copyable` from `provideWrConfig()`, then `false`.\n * Only CLOSED blocks get one: mid-stream the code is not all there, and a\n * button that copies half a snippet is worse than no button.\n */\n readonly copyable = input<boolean | null, BooleanInput>(null, {\n // `null` survives, because it is what \"the template said nothing\" means to\n // `useConfigValue` — but a bare `copyable` attribute has to reach `true`, and\n // without a transform it arrives as `''` and does not compile under\n // `strictTemplates`. The component's own JSDoc example was the proof.\n transform: value => (value == null ? null : coerceBooleanProperty(value)),\n });\n\n /**\n * Where links open. `_blank` also sets `rel=\"noopener noreferrer\"`, which is\n * not optional — a target without it hands the opener to a page whose URL came\n * from the document being rendered.\n *\n * Falls back to `markdown.linkTarget` from `provideWrConfig()`, then no target.\n */\n readonly linkTarget = input<'_blank' | '_self' | null>(null);\n\n /**\n * Put a slugged `id` on every heading, so the document can be linked into.\n *\n * @default true\n */\n readonly headingIds = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Namespace for the generated heading ids, and for the in-document `#fragment`\n * links that point at them.\n *\n * Defaults to `'user-content-'`, which is what GitHub emits for untrusted\n * markdown, and for the same reason: without a namespace a document that\n * happens to contain `# Search` renders `id=\"search\"` and steals it from the\n * page around it. That is not cosmetic — a `<label for=\"search\">` silently\n * stops labelling its input, and `getElementById` starts answering with a\n * heading. Anchors written INSIDE the document keep working, because a bare\n * `#fragment` href gets the same prefix.\n *\n * Set it to `''` for a document you author yourself and want clean anchors for.\n */\n readonly headingIdPrefix = input<string>('user-content-');\n\n /** Accessible name of the copy button. Falls back to `markdown.copy`, then `'Copy code'`. */\n readonly copyLabel = input<string | null>(null);\n\n /** Announced after a successful copy. Falls back to `markdown.copied`, then `'Copied'`. */\n readonly copiedLabel = input<string | null>(null);\n\n /** Read out for a checked task item. Falls back to `markdown.taskDone`, then `'Done:'`. */\n readonly taskDoneLabel = input<string | null>(null);\n\n /** Read out for an unchecked task item. Falls back to `markdown.taskTodo`, then `'To do:'`. */\n readonly taskTodoLabel = input<string | null>(null);\n\n protected readonly resolvedCopyable = useConfigValue(this.copyable, config => config.markdown?.copyable, false);\n protected readonly resolvedLinkTarget = useConfigValue<'_blank' | '_self' | null>(\n this.linkTarget,\n config => config.markdown?.linkTarget,\n null\n );\n protected readonly resolvedCopyLabel = useI18nText(this.copyLabel, 'markdown.copy', 'Copy code');\n protected readonly resolvedCopiedLabel = useI18nText(this.copiedLabel, 'markdown.copied', 'Copied');\n protected readonly resolvedTaskDoneLabel = useI18nText(this.taskDoneLabel, 'markdown.taskDone', 'Done:');\n protected readonly resolvedTaskTodoLabel = useI18nText(this.taskTodoLabel, 'markdown.taskTodo', 'To do:');\n\n /**\n * The parsed document, re-derived whenever the source changes.\n *\n * The WHOLE buffer, on every chunk — so a streamed answer costs O(n²) over the\n * stream. That is a deliberate trade rather than an oversight: freezing the\n * blocks before the last blank line would halve it, but a blank line is not a\n * safe boundary in markdown (a list continues across one), and a wrong boundary\n * corrupts the document rather than slowing it down. The constant is small —\n * 300 KB of prose parses in ~120 ms — and `@for`'s `track $index` keeps the\n * DOM cost proportional to what actually changed.\n */\n protected readonly blocks = computed(() => parseMarkdown(this.value(), { streaming: this.streaming() }));\n\n /** `rel` is bound, not hard-coded, so a same-tab link does not carry a pointless one. */\n protected readonly linkRel = computed(() => (this.resolvedLinkTarget() === '_blank' ? 'noopener noreferrer' : null));\n\n /**\n * Which code block last got copied, held by IDENTITY.\n *\n * Keyed on the code string, two blocks containing the same snippet both lit up\n * — and a document that shows the same one-liner twice is ordinary. Block nodes\n * are recreated whenever the source changes, so the confirmation also clears\n * itself on the next chunk, which is the right lifetime for it.\n */\n private readonly copiedBlock = signal<WrMarkdownBlock | null>(null);\n\n private copiedTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // Requested here rather than from the template: asking the highlighter means\n // writing a signal when the answer lands, and Angular refuses a signal write\n // during rendering (NG0600). An effect runs after it.\n effect(() => {\n // `generation` is what makes `WrMarkdownHighlight.invalidate()` reach the\n // blocks already on screen. It is deliberately NOT the signal that storing\n // an answer bumps — depending on that one from here is the loop.\n this.highlight.generation();\n for (const block of this.codeBlocks()) this.highlight.request(block.code, block.language);\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.copiedTimer !== null) clearTimeout(this.copiedTimer);\n });\n }\n\n /**\n * A newline as data rather than as template text.\n *\n * The lines of a highlighted block are separate elements, and what separates\n * them on screen — and in a copy — is a real `\\n` inside the `<pre>`. Angular\n * strips whitespace-only text nodes from templates, so the character cannot be\n * typed there; an interpolation of it survives.\n */\n protected readonly newline = String.fromCharCode(10);\n\n /** Every code block in the document, nested ones included. */\n private readonly codeBlocks = computed(() => collectCode(this.blocks()));\n\n /** Spans for a code block, or `null` to render it as plain text. */\n protected linesOf(code: string, language: string | null): readonly WrHighlightLine[] | null {\n return this.highlight.linesFor(code, language);\n }\n\n protected isCopied(block: WrMarkdownBlock): boolean {\n return this.copiedBlock() === block;\n }\n\n protected onCopied(block: WrMarkdownBlock): void {\n this.copiedBlock.set(block);\n if (this.copiedTimer !== null) clearTimeout(this.copiedTimer);\n this.copiedTimer = setTimeout(() => {\n this.copiedBlock.set(null);\n this.copiedTimer = null;\n }, COPIED_FEEDBACK_MS);\n }\n\n /** A heading's id, namespaced, or `null` when there is nothing to link to. */\n protected idOf(id: string): string | null {\n if (!this.headingIds() || !id) return null;\n\n return `${this.headingIdPrefix()}${id}`;\n }\n\n /**\n * A link's destination, with a bare fragment pointed at the namespaced id.\n *\n * Otherwise prefixing the headings would quietly break every `[see](#section)`\n * the document writes about itself.\n */\n protected hrefOf(href: string): string {\n const prefix = this.headingIdPrefix();\n if (!prefix || !this.headingIds() || !href.startsWith('#') || href.length < 2) return href;\n\n return `#${prefix}${href.slice(1)}`;\n }\n\n /**\n * Casts for the recursive templates, and the reason they exist.\n *\n * Block content nests — a quote holds blocks, a list item holds blocks — so the\n * template recurses through `ngTemplateOutlet` into itself. That is the one\n * recursion shape which adds NO elements to the DOM; a recursive component\n * would put a host element between `<ul>` and its `<li>`, which is invalid\n * markup and breaks the list's accessibility tree. The cost is that\n * `ngTemplateOutlet` context arrives as `any`, and `@switch` cannot narrow\n * `any`. Casting it back at the top of each template restores full\n * `strictTemplates` checking inside the loop, where the work happens.\n */\n protected asBlocks(value: unknown): readonly WrMarkdownBlock[] {\n return value as readonly WrMarkdownBlock[];\n }\n\n protected asInlines(value: unknown): readonly WrMarkdownInline[] {\n return value as readonly WrMarkdownInline[];\n }\n\n protected asItems(value: unknown): readonly WrMarkdownListItem[] {\n return value as readonly WrMarkdownListItem[];\n }\n\n protected asCells(value: unknown): readonly WrMarkdownCell[] {\n return value as readonly WrMarkdownCell[];\n }\n}\n","<!--\n Recursion runs through `ngTemplateOutlet` into these templates rather than\n through a child component, so the rendered DOM is exactly the document — no\n wrapper element between a `<ul>` and its `<li>`. See `asBlocks` for the whole\n reasoning.\n-->\n<ng-template #inlineList let-raw>\n @let nodes = asInlines(raw);\n\n @for (node of nodes; track $index) {\n @switch (node.kind) {\n @case ('text') {\n <!-- Wrapped, and not for tidiness: a bare interpolation on its own line is\n ONE text node that includes the indentation around it, so `a **b** c`\n rendered with a space inside every `<strong>`. Inside an element the\n whitespace becomes separate whitespace-only nodes, which Angular\n removes, and `<ng-container>` itself renders nothing. Prettier\n reformats the bare form back, so this also has to survive `--fix`. -->\n <ng-container>{{ node.value }}</ng-container>\n }\n @case ('code') {\n <!-- `dir=\"ltr\"` because code is not prose: under RTL the browser\n reorders `foo();` to `;foo()`. -->\n <code class=\"wr-markdown__code-inline\" dir=\"ltr\">{{ node.value }}</code>\n }\n @case ('strong') {\n <strong class=\"wr-markdown__strong\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></strong>\n }\n @case ('em') {\n <em class=\"wr-markdown__em\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></em>\n }\n @case ('del') {\n <del class=\"wr-markdown__del\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></del>\n }\n @case ('link') {\n <a\n class=\"wr-markdown__link\"\n [href]=\"hrefOf(node.href)\"\n [attr.title]=\"node.title\"\n [attr.target]=\"resolvedLinkTarget()\"\n [attr.rel]=\"linkRel()\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></a>\n }\n @case ('image') {\n <img\n class=\"wr-markdown__image\"\n [src]=\"node.src\"\n [alt]=\"node.alt\"\n [attr.title]=\"node.title\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n }\n @case ('break') {\n <br />\n }\n }\n }\n</ng-template>\n\n<ng-template #itemList let-raw let-tight=\"tight\">\n @let items = asItems(raw);\n\n @for (item of items; track $index) {\n <li class=\"wr-markdown__item\" [class.wr-markdown__item--task]=\"item.checked !== null\">\n @if (item.checked !== null) {\n <!-- Presentational, with the state as text beside it: a real\n `<input type=\"checkbox\">` here would be an unlabelled form control,\n which is a serious axe violation, and making it operable would\n promise an interaction a renderer cannot honour. -->\n <span class=\"wr-markdown__task\" [class.wr-markdown__task--checked]=\"item.checked\" aria-hidden=\"true\"></span>\n <span class=\"wr-markdown__sr-only\">{{ item.checked ? resolvedTaskDoneLabel() : resolvedTaskTodoLabel() }}</span>\n }\n <ng-container\n [ngTemplateOutlet]=\"blockList\"\n [ngTemplateOutletContext]=\"{ $implicit: item.children, tight: tight }\"\n />\n </li>\n }\n</ng-template>\n\n<ng-template #blockList let-raw let-tight=\"tight\">\n @let list = asBlocks(raw);\n\n @for (block of list; track $index) {\n @switch (block.kind) {\n @case ('paragraph') {\n <!-- A tight list drops the `<p>`, which is what CommonMark specifies and\n what keeps a one-line list from being double-spaced. -->\n @if (tight) {\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n } @else {\n <p class=\"wr-markdown__paragraph\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </p>\n }\n }\n @case ('heading') {\n @switch (block.level) {\n @case (1) {\n <h1 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h1>\n }\n @case (2) {\n <h2 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h2>\n }\n @case (3) {\n <h3 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h3>\n }\n @case (4) {\n <h4 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h4>\n }\n @case (5) {\n <h5 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h5>\n }\n @default {\n <h6 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h6>\n }\n }\n }\n @case ('code') {\n @let highlighted = linesOf(block.code, block.language);\n\n <div class=\"wr-markdown__code-block\">\n <pre\n class=\"wr-markdown__pre\"\n dir=\"ltr\"\n tabindex=\"0\"\n ><code class=\"wr-markdown__code\" [attr.data-language]=\"block.language\">@if (highlighted) {@for (row of highlighted; track $index) {<span class=\"wr-markdown__line\">@for (span of row; track $index) {<span\n [style.color]=\"span.color\"\n [style.font-style]=\"span.fontStyle === 'italic' ? 'italic' : null\"\n [style.font-weight]=\"span.fontStyle === 'bold' ? 'bold' : null\"\n [style.text-decoration]=\"span.fontStyle === 'underline' ? 'underline' : null\"\n >{{ span.text }}</span>}</span>@if (!$last) {{{ newline }}}}} @else {{{ block.code }}}</code></pre>\n\n @if (resolvedCopyable() && block.closed) {\n <button\n type=\"button\"\n class=\"wr-markdown__copy\"\n [wrCopyToClipboard]=\"block.code\"\n [attr.aria-label]=\"isCopied(block) ? resolvedCopiedLabel() : resolvedCopyLabel()\"\n (copied)=\"onCopied(block)\"\n >\n <svg\n class=\"wr-markdown__copy-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @if (isCopied(block)) {\n <path d=\"M20 6 9 17l-5-5\" />\n } @else {\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n }\n </svg>\n </button>\n }\n </div>\n }\n @case ('quote') {\n <blockquote class=\"wr-markdown__quote\">\n <ng-container\n [ngTemplateOutlet]=\"blockList\"\n [ngTemplateOutletContext]=\"{ $implicit: block.children, tight: false }\"\n />\n </blockquote>\n }\n @case ('list') {\n @if (block.ordered) {\n <ol\n class=\"wr-markdown__list wr-markdown__list--ordered\"\n [attr.start]=\"block.start === 1 ? null : block.start\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemList\"\n [ngTemplateOutletContext]=\"{ $implicit: block.items, tight: block.tight }\"\n />\n </ol>\n } @else {\n <ul class=\"wr-markdown__list\">\n <ng-container\n [ngTemplateOutlet]=\"itemList\"\n [ngTemplateOutletContext]=\"{ $implicit: block.items, tight: block.tight }\"\n />\n </ul>\n }\n }\n @case ('table') {\n <!-- Its own scroller: a wide table must not push the page sideways, which\n is also what keeps the RTL layout gate quiet about it. -->\n <div class=\"wr-markdown__table-scroll\" tabindex=\"0\">\n <table class=\"wr-markdown__table\">\n <thead>\n <tr>\n @for (cell of block.head; track column; let column = $index) {\n <th class=\"wr-markdown__th\" scope=\"col\" [style.text-align]=\"block.align[column]\">\n <ng-container\n [ngTemplateOutlet]=\"inlineList\"\n [ngTemplateOutletContext]=\"{ $implicit: cell.inlines }\"\n />\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of block.rows; track $index) {\n <tr>\n @for (cell of asCells(row); track column; let column = $index) {\n <td class=\"wr-markdown__td\" [style.text-align]=\"block.align[column]\">\n <ng-container\n [ngTemplateOutlet]=\"inlineList\"\n [ngTemplateOutletContext]=\"{ $implicit: cell.inlines }\"\n />\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n @case ('rule') {\n <hr class=\"wr-markdown__rule\" />\n }\n }\n }\n</ng-template>\n\n<ng-container [ngTemplateOutlet]=\"blockList\" [ngTemplateOutletContext]=\"{ $implicit: blocks(), tight: false }\" />\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport type { WrMarkdownHighlighter } from './interfaces';\nimport { WR_MARKDOWN_HIGHLIGHTER } from './tokens';\n\n/**\n * Give every `<wr-markdown>` in the app a syntax highlighter.\n *\n * The highlighter returns coloured SPANS, not HTML — see\n * {@link WrMarkdownHighlighter} for why that signature is the one worth having.\n * It may be async, and it may return `null` for languages it does not know; both\n * render the block as plain text, which is also what server-side rendering\n * produces, since a highlighter that resolves after prerender has already\n * finished cannot contribute to the HTML.\n *\n * Pass `{ useFactory }` when the adapter needs to inject something. A highlighter\n * is itself a function, so the factory cannot be detected by shape — hence the\n * wrapper object rather than an overload that would guess.\n *\n * @example\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideWrMarkdownHighlighter(shikiSpans),\n *\n * // Or, when the adapter has dependencies of its own:\n * provideWrMarkdownHighlighter({\n * useFactory: () => {\n * const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n * return (code, language) => (isBrowser ? shikiSpans(code, language) : null);\n * },\n * }),\n * ],\n * });\n * ```\n */\nexport function provideWrMarkdownHighlighter(\n highlighter: WrMarkdownHighlighter | { readonly useFactory: () => WrMarkdownHighlighter }\n): EnvironmentProviders {\n if (typeof highlighter === 'function') {\n return makeEnvironmentProviders([{ provide: WR_MARKDOWN_HIGHLIGHTER, useValue: highlighter }]);\n }\n\n return makeEnvironmentProviders([{ provide: WR_MARKDOWN_HIGHLIGHTER, useFactory: highlighter.useFactory }]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDG;AACH,SAAS,aAAa,CAAC,MAAc,EAAE,UAAkC,EAAE,EAAA;AACzE,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE;IAEtB,MAAM,GAAG,GAAG,UAAU,CAAC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,EAAE,iBAAiB,CAAC,EAAA,aAAA,EAC/B,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,aAAa;AACpB,wBAAA,gCAAgC,EAAE,aAAa;AAChD,qBAAA,EAAA,QAAA,EAAA,k4UAAA,EAAA;;;AEvEH;;;;;AAKG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACG,SAAU,4BAA4B,CAC1C,WAAyF,EAAA;AAEzF,IAAA,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;AACrC,QAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IAChG;AAEA,IAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;AAC7G;;ACnDA;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-markdown.mjs","sources":["../../../projects/lib/markdown/parse-markdown.ts","../../../projects/lib/markdown/tokens.ts","../../../projects/lib/markdown/wr-markdown-highlight.ts","../../../projects/lib/markdown/wr-markdown.ts","../../../projects/lib/markdown/wr-markdown.html","../../../projects/lib/markdown/serialize-markdown.ts","../../../projects/lib/markdown/provide-wr-markdown.ts","../../../projects/lib/markdown/ngwr-markdown.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type {\n WrMarkdownAlign,\n WrMarkdownBlock,\n WrMarkdownCell,\n WrMarkdownInline,\n WrMarkdownListItem,\n WrMarkdownParseOptions,\n} from './interfaces';\n\n/**\n * Markdown to a node tree. No HTML anywhere in the pipeline.\n *\n * **Why a parser in a component library that has one runtime dependency.** The\n * alternative was `marked` or `markdown-it`, and both produce an HTML string —\n * which then has to reach the DOM through `[innerHTML]`, which means Angular's\n * sanitizer on the hot path of the one component whose input is untrusted by\n * definition, and `bypassSecurityTrustHtml` the moment syntax highlighting is\n * wanted. A node tree renders through ordinary Angular bindings instead: every\n * text node is a text node, every `href` goes through `SecurityContext.URL`, and\n * nothing is ever parsed as HTML. That is worth a parser.\n *\n * The second reason is streaming, which no general-purpose parser is built for.\n * See {@link WrMarkdownParseOptions.streaming}: an open fence has to render as a\n * code block, and a half-typed `**` must not flash on screen as literal\n * asterisks.\n *\n * **The subset, stated rather than discovered.** ATX headings, paragraphs,\n * fenced code, blockquotes, bullet / ordered / task lists (nested), GFM tables,\n * thematic breaks; inline code, strong, emphasis, strikethrough, links, images,\n * autolinks (bracketed and bare), hard breaks, backslash escapes.\n *\n * Deliberately absent, each for a reason:\n *\n * - **Raw HTML is escaped, never rendered.** A markdown renderer whose input is\n * model output or user comments cannot pass `<img onerror>` through and call\n * it a feature. `<div>` in equals `<div>` on screen, as text.\n * - **Indented (four-space) code blocks.** In a document that also has nested\n * lists, indentation is structural, and the ambiguity resolves against the\n * author roughly every time: a wrapped list continuation becomes a code block.\n * Fences are unambiguous, and fences are what generators emit.\n * - **Setext headings** (`===` / `---` under a line). `---` is a thematic break\n * here, always. The dual meaning is a well-known trap and the underline form\n * is essentially unused in generated markdown.\n * - **Reference links, footnotes, definition lists.** They need a second pass\n * over a document that, mid-stream, is not all there yet.\n *\n * Two known deviations, kept rather than fixed, because the cure looked worse than\n * the disease:\n *\n * - **A blank line inside a NESTED list marks the outer list loose too**, so\n * `- a` / ` - b` / blank / ` - c` / `- d` double-spaces the outer items.\n * CommonMark scopes looseness per list; telling the two apart needs to know\n * which level a blank line belongs to, and the indentation alone does not say —\n * content at the item's own indent can belong either to the item or to a\n * sublist's sibling. The visible cost is spacing.\n * - **An unmatched `[` is not linear.** The scan is bounded per opener\n * ({@link MAX_LABEL_LENGTH}) and short-circuits once the source is known to hold\n * no `]` at all, which took `'['.repeat(100000)` from 8s to 0.2s — but a\n * document that is mostly open brackets with a `]` somewhere still pays per\n * opener. Real prose does not have that shape.\n *\n * @param source markdown text\n * @returns block nodes, ready to render\n */\nfunction parseMarkdown(source: string, options: WrMarkdownParseOptions = {}): readonly WrMarkdownBlock[] {\n if (!source) return [];\n\n const ctx = newContext(options.streaming ?? false);\n const blocks = parseBlocks(normalize(source).split('\\n'), 0, ctx);\n\n return ctx.streaming ? applyStreamingTail(blocks) : blocks;\n}\n\n/**\n * How deep a quote / list nest may go before the parser stops recursing.\n *\n * Not a taste limit: each level is a recursive call over its own slice of the\n * lines, so a pathological input (`> > > > …` a thousand deep, which is four\n * kilobytes of text) is a stack overflow inside a change-detection pass. Past\n * the cap the content renders as paragraphs — visible, harmless, and nothing a\n * real document reaches.\n */\nconst MAX_DEPTH = 12;\n\n/**\n * How many columns of a table are rendered.\n *\n * The same class of protection as {@link MAX_DEPTH}, for the same reason, and it\n * was measured rather than guessed: every row is padded to the header's width, so\n * cells scale as columns × rows while the input scales as columns + rows. A 38 KB\n * document — a 10,001-pipe header and 2,000 short rows, which is what a truncated\n * table from a model looks like — produced **20 million cells** in 4.5 seconds,\n * inside a `computed` that re-runs on every streamed chunk. No real table is wider\n * than this; a wider one renders its first 128 columns.\n */\nconst MAX_TABLE_COLUMNS = 128;\n\n/**\n * Threaded down the whole parse rather than applied afterwards.\n *\n * Streaming changes what an UNMATCHED marker means, and only the parser knows it\n * found one. A post-pass over the tree cannot tell `**bold**` from `**bold` —\n * both end up as text and marker characters — so the decision has to be made\n * where the closer was looked for and not found.\n */\ninterface ParseContext {\n readonly streaming: boolean;\n /**\n * Heading slugs already handed out, so a document with two `## Fixes` produces\n * two DIFFERENT ids. Duplicate ids are invalid, and `#fixes` would resolve to\n * whichever came first.\n */\n readonly slugs: Map<string, number>;\n /**\n * Per marker character, the earliest index from which a closer search has\n * already come up empty.\n *\n * This is what keeps the inline scanner linear. The closer search is monotone —\n * if no valid closer exists after index `i`, none exists after any index past\n * `i` either, since that window is a subset — so one failure answers every\n * later opener of the same character. Without it, `'*a '.repeat(34000)` is 10.8\n * SECONDS inside a `computed`, on the main thread.\n *\n * Scoped to ONE scan, not to the document: `inlines()` replaces this and\n * {@link ParseContext.noBracket} on entry, because the numbers index into the\n * string that call is walking and mean nothing in any other.\n */\n readonly noCloser: Map<string, number>;\n /** Same idea for `]`: the index from which the source contains none at all. */\n readonly noBracket: { from: number };\n /**\n * True while parsing a link's label. CommonMark forbids links inside links, and\n * a tree built with DOM APIs happily nests the `<a>` an HTML parser would have\n * rejected — which is invalid markup and an axe `nested-interactive` violation.\n */\n readonly inLink: boolean;\n}\n\nfunction newContext(streaming: boolean): ParseContext {\n return {\n streaming,\n slugs: new Map(),\n noCloser: new Map(),\n noBracket: { from: Number.POSITIVE_INFINITY },\n inLink: false,\n };\n}\n\nconst FENCE_RE = /^( {0,3})(`{3,}|~{3,})[ \\t]*(.*)$/;\n// The closing `#` run must be PRECEDED by whitespace, or `# C#` loses its sharp\n// and `#######` (seven, not a heading in any dialect) matches as an empty h6.\nconst HEADING_RE = /^ {0,3}(#{1,6})(?:[ \\t]+(.*?))?(?:[ \\t]+#+)?[ \\t]*$/;\nconst RULE_RE = /^ {0,3}(?:(?:\\*[ \\t]*){3,}|(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,})$/;\nconst QUOTE_RE = /^ {0,3}>[ \\t]?(.*)$/;\nconst LIST_RE = /^( *)([-*+]|\\d{1,9}[.)])(?:([ \\t]+)(.*)|[ \\t]*)$/;\nconst TASK_RE = /^\\[([ xX])\\](?:[ \\t]+(.*)|[ \\t]*)$/;\nconst TABLE_DELIM_RE = /^ {0,3}\\|?[ \\t]*:?-+:?[ \\t]*(?:\\|[ \\t]*:?-+:?[ \\t]*)*\\|?[ \\t]*$/;\n\n/**\n * `\\r\\n` and lone `\\r` out; tabs in the INDENT to four spaces, so indent maths is\n * in one unit.\n *\n * The whole leading whitespace run, not just a line-initial tab: `' \\t- b'` is\n * two spaces and a tab, and `parseList` measures indentation in characters, so a\n * tab counted as one column made mixed indentation parse as literal text.\n */\nfunction normalize(source: string): string {\n return source.replace(/\\r\\n?/g, '\\n').replace(/^[ \\t]+/gm, indent => indent.replace(/\\t/g, ' '));\n}\n\n/** Does this line begin a block that interrupts a paragraph or a list item? */\nfunction startsBlock(line: string): boolean {\n return (\n FENCE_RE.test(line) || HEADING_RE.test(line) || RULE_RE.test(line) || QUOTE_RE.test(line) || LIST_RE.test(line)\n );\n}\n\n/**\n * Does this line end the paragraph it follows?\n *\n * Every block start does, except the two lists CommonMark says cannot interrupt\n * one: an ordered item whose number is not 1, and an item with no content. The\n * first rule exists for a single shape, and it is a shape prose actually has —\n * \"The year was\" / \"1986. It was a good year.\" must not become a list numbered\n * from 1986.\n */\nfunction interruptsParagraph(line: string): boolean {\n const list = matchListStart(line);\n if (list && !RULE_RE.test(line)) {\n return list.content.trim() !== '' && (!list.ordered || list.number === 1);\n }\n\n return startsBlock(line);\n}\n\ninterface ListStart {\n readonly indent: number;\n readonly ordered: boolean;\n readonly number: number;\n readonly content: string;\n /** Column the item's own content starts at — the dedent for everything inside it. */\n readonly contentIndent: number;\n}\n\nfunction matchListStart(line: string): ListStart | null {\n const match = LIST_RE.exec(line);\n if (!match) return null;\n\n const [, indent, marker, spaces, content] = match;\n const ordered = !/^[-*+]$/.test(marker);\n\n return {\n indent: indent.length,\n ordered,\n number: ordered ? Number.parseInt(marker, 10) : 1,\n content: content ?? '',\n // An empty item (`-` alone) has no run of spaces to measure, so assume one.\n contentIndent: indent.length + marker.length + (spaces?.length ?? 1),\n };\n}\n\nfunction parseBlocks(lines: readonly string[], depth: number, ctx: ParseContext): readonly WrMarkdownBlock[] {\n if (depth >= MAX_DEPTH) {\n const text = lines.join('\\n').trim();\n return text ? [{ kind: 'paragraph', inlines: inlines(text, 0, ctx) }] : [];\n }\n\n const out: WrMarkdownBlock[] = [];\n let i = 0;\n\n while (i < lines.length) {\n const line = lines[i];\n\n if (!line.trim()) {\n i++;\n continue;\n }\n\n const fence = FENCE_RE.exec(line);\n if (fence) {\n const [, indent, marker, info] = fence;\n const body: string[] = [];\n const closer = new RegExp(`^ {0,3}\\\\${marker[0]}{${marker.length},}[ \\\\t]*$`);\n let closed = false;\n i++;\n\n while (i < lines.length) {\n if (closer.test(lines[i])) {\n closed = true;\n i++;\n break;\n }\n // The opening fence's own indentation is not part of the code.\n body.push(stripIndent(lines[i], indent.length));\n i++;\n }\n\n out.push({\n kind: 'code',\n language: info.trim().split(/\\s+/)[0].toLowerCase() || null,\n code: body.join('\\n'),\n closed,\n });\n continue;\n }\n\n const heading = HEADING_RE.exec(line);\n if (heading) {\n const text = (heading[2] ?? '').trim();\n const content = inlines(text, 0, ctx);\n out.push({\n kind: 'heading',\n level: heading[1].length as 1 | 2 | 3 | 4 | 5 | 6,\n inlines: content,\n // Slugged from the rendered TEXT, not from the markdown: `## See [docs](url)`\n // was producing `see-docshttpsxdeva`, an anchor nobody can link to.\n id: uniqueSlug(plainText(content), ctx),\n });\n i++;\n continue;\n }\n\n if (RULE_RE.test(line)) {\n out.push({ kind: 'rule' });\n i++;\n continue;\n }\n\n if (QUOTE_RE.test(line)) {\n const body: string[] = [];\n while (i < lines.length) {\n const quoted = QUOTE_RE.exec(lines[i]);\n if (quoted) {\n body.push(quoted[1]);\n i++;\n continue;\n }\n // Lazy continuation: an unmarked, non-blank line still belongs to the\n // quote unless it starts a block of its own.\n if (!lines[i].trim() || startsBlock(lines[i])) break;\n body.push(lines[i].trimStart());\n i++;\n }\n out.push({ kind: 'quote', children: parseBlocks(body, depth + 1, ctx) });\n continue;\n }\n\n if (matchListStart(line)) {\n const [list, next] = parseList(lines, i, depth, ctx);\n out.push(list);\n i = next;\n continue;\n }\n\n if (isTableStart(lines, i)) {\n const [table, next] = parseTable(lines, i, ctx);\n out.push(table);\n i = next;\n continue;\n }\n\n const paragraph: string[] = [line];\n i++;\n while (i < lines.length && lines[i].trim() && !interruptsParagraph(lines[i])) {\n // A delimiter row two lines in turns the paragraph into a table header.\n if (isTableStart(lines, i)) break;\n paragraph.push(lines[i]);\n i++;\n }\n out.push({ kind: 'paragraph', inlines: inlines(paragraph.join('\\n').trim(), 0, ctx) });\n }\n\n return out;\n}\n\n/**\n * A table header, or a sentence that happens to contain a pipe.\n *\n * GFM's own rule, and the one this used to be missing: \"the header row must match\n * the delimiter row in the number of cells. If not, a table will not be\n * recognized.\" Without the count check, `Use the | character` followed by `---`\n * became a two-column table with an empty body — swallowing both the sentence and\n * the thematic break, and contradicting this file's own decision that `---` is\n * always a rule.\n */\nfunction isTableStart(lines: readonly string[], at: number): boolean {\n const header = lines[at];\n const delimiter = lines[at + 1];\n\n if (!header?.includes('|') || delimiter === undefined || !TABLE_DELIM_RE.test(delimiter)) return false;\n\n return splitRow(header).length === splitRow(delimiter).length;\n}\n\n/** Remove up to `width` leading spaces — never more, so relative indent survives. */\nfunction stripIndent(line: string, width: number): string {\n let cut = 0;\n while (cut < width && line[cut] === ' ') cut++;\n return line.slice(cut);\n}\n\nfunction parseList(\n lines: readonly string[],\n from: number,\n depth: number,\n ctx: ParseContext\n): [WrMarkdownBlock, number] {\n const first = matchListStart(lines[from])!;\n const items: WrMarkdownListItem[] = [];\n let loose = false;\n let i = from;\n\n while (i < lines.length) {\n // A thematic break wins over a list item, which is CommonMark's rule and not\n // a nicety: `* * *` matches the bullet pattern, so without this `* a`,\n // `* * *`, `* b` is one list with a phantom nesting level where the divider\n // was, and the `<hr>` is gone.\n if (RULE_RE.test(lines[i])) break;\n\n const start = matchListStart(lines[i]);\n // A different marker family starts a NEW list rather than continuing this\n // one — `- a` then `1. b` is two lists, and rendering it as one silently\n // renumbers the author's content.\n if (start?.ordered !== first.ordered || start.indent > first.indent + 3) break;\n\n const body: string[] = [start.content];\n let blanks = 0;\n i++;\n\n while (i < lines.length) {\n const line = lines[i];\n\n if (!line.trim()) {\n blanks++;\n i++;\n continue;\n }\n\n const indent = line.length - line.trimStart().length;\n if (indent >= start.contentIndent) {\n // A blank line followed by more of the same item makes the list loose,\n // which is what decides whether items get `<p>` wrappers.\n if (blanks > 0) {\n body.push(...Array<string>(blanks).fill(''));\n loose = true;\n blanks = 0;\n }\n body.push(stripIndent(line, start.contentIndent));\n i++;\n continue;\n }\n\n // Out-dented: a sibling item, another block, or lazy continuation of this\n // item's paragraph. After a blank line only a sibling can follow.\n if (blanks > 0 || matchListStart(line) || startsBlock(line)) break;\n body.push(line.trimStart());\n i++;\n }\n\n const nextIsSibling = i < lines.length && matchListStart(lines[i]) !== null;\n if (blanks > 0 && nextIsSibling) loose = true;\n\n items.push(makeItem(body, depth, ctx));\n\n if (blanks > 0 && !nextIsSibling) break;\n }\n\n return [{ kind: 'list', ordered: first.ordered, start: first.number, tight: !loose, items }, i];\n}\n\nfunction makeItem(body: readonly string[], depth: number, ctx: ParseContext): WrMarkdownListItem {\n const task = TASK_RE.exec(body[0] ?? '');\n const lines = task ? [task[2] ?? '', ...body.slice(1)] : body;\n\n return {\n children: parseBlocks(lines, depth + 1, ctx),\n checked: task ? task[1].toLowerCase() === 'x' : null,\n };\n}\n\nfunction parseTable(lines: readonly string[], from: number, ctx: ParseContext): [WrMarkdownBlock, number] {\n const head = splitRow(lines[from]).slice(0, MAX_TABLE_COLUMNS);\n const align = splitRow(lines[from + 1]).map((spec): WrMarkdownAlign => {\n const left = spec.startsWith(':');\n const right = spec.endsWith(':');\n if (left && right) return 'center';\n if (right) return 'end';\n if (left) return 'start';\n return null;\n });\n\n const rows: WrMarkdownCell[][] = [];\n let i = from + 2;\n\n while (i < lines.length) {\n const line = lines[i];\n // GFM ends a table at a blank line, a line that starts another block, or\n // anything without a cell divider.\n if (!line.trim() || !line.includes('|') || startsBlock(line)) break;\n rows.push(normalizeCells(splitRow(line), head.length, ctx));\n i++;\n }\n\n return [\n {\n kind: 'table',\n head: head.map(cell => ({ inlines: inlines(cell, 0, ctx) })),\n rows,\n align: normalizeAlign(align, head.length),\n },\n i,\n ];\n}\n\n/** Split on unescaped pipes, dropping the optional leading and trailing one. */\nfunction splitRow(line: string): string[] {\n const cells: string[] = [];\n let current = '';\n\n for (let i = 0; i < line.length; i++) {\n if (line[i] === '\\\\' && line[i + 1] === '|') {\n current += '|';\n i++;\n continue;\n }\n if (line[i] === '|') {\n cells.push(current);\n current = '';\n continue;\n }\n current += line[i];\n }\n cells.push(current);\n\n if (cells.length > 1 && !cells[0].trim()) cells.shift();\n if (cells.length > 1 && !cells[cells.length - 1].trim()) cells.pop();\n\n return cells.map(cell => cell.trim());\n}\n\n/** A row shorter than the header gets empty cells; a longer one is truncated. */\nfunction normalizeCells(cells: readonly string[], width: number, ctx: ParseContext): WrMarkdownCell[] {\n return Array.from({ length: width }, (_, index) => ({ inlines: inlines(cells[index] ?? '', 0, ctx) }));\n}\n\nfunction normalizeAlign(align: readonly WrMarkdownAlign[], width: number): WrMarkdownAlign[] {\n return Array.from({ length: width }, (_, index) => align[index] ?? null);\n}\n\n/**\n * GitHub-compatible heading slug: lowercase, punctuation dropped, spaces to dashes.\n *\n * `_` and `-` are KEPT, which is what GitHub does — stripping the underscore broke\n * every published `#snake_case` anchor.\n */\nfunction slug(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^\\p{L}\\p{N}\\s_-]/gu, '')\n .trim()\n .replace(/\\s+/g, '-');\n}\n\n/**\n * The slug, with a counter when the document repeats a title.\n *\n * Two `## Fixes` in one changelog produced two `id=\"fixes\"`, which is invalid and\n * makes `#fixes` resolve to whichever came first. GitHub appends `-1`, `-2`; so\n * does this. An empty slug (a heading of pure emoji, or no text at all) stays\n * empty and the renderer binds no `id`.\n */\nfunction uniqueSlug(text: string, ctx: ParseContext): string {\n const base = slug(text);\n if (!base) return '';\n\n const used = ctx.slugs.get(base) ?? 0;\n ctx.slugs.set(base, used + 1);\n\n return used === 0 ? base : `${base}-${used}`;\n}\n\n// ---------------------------------------------------------------------------\n// Inline\n// ---------------------------------------------------------------------------\n\n// Every ASCII punctuation character, which is what CommonMark allows. The\n// hand-written subset left `\\$`, `\\&`, `\\%` and eight others rendering with their\n// backslash — and `\\$` is what generators emit to keep a dollar out of math mode.\nconst ESCAPABLE = /[!-/:-@[-`{-~]/;\nconst SCHEME_RE = /^([a-z][a-z0-9+.-]*):/i;\nconst ALLOWED_SCHEMES = new Set(['http', 'https', 'mailto', 'tel', 'ftp']);\nconst DATA_IMAGE_RE = /^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[a-z0-9+/=]+$/i;\n// `[^<>\\s]` and not `[^>\\s]`: CommonMark defines autolink content as\n// `[^<>\\x00-\\x20]*`, so `<` ends it by spec — and admitting it is what made this\n// quadratic. On `<http://a<http://a<…` the scheme matches, the class swallows the\n// rest of the document looking for `>`, then backtracks a character at a time, once\n// per `<`. 160 KB took 1.7 s. `ANGLE_DEST_RE` and `EMAIL_AUTOLINK_RE` beside it\n// already exclude `<`; this one was the outlier. The only input that now parses\n// differently is `<http://a<b>`, which no other parser reads as a link either.\nconst AUTOLINK_RE = /^<((?:https?|mailto|tel):[^<>\\s]+)>/i;\n/** `<destination>` — markdown's way of putting a space in a URL. */\nconst ANGLE_DEST_RE = /^<([^<>]*)>(?:\\s+[\"'(](.*)[\"')])?$/;\n/** CommonMark's own cap on a link label, which is also what bounds the scan. */\nconst MAX_LABEL_LENGTH = 999;\n/**\n * How deep parentheses may nest inside `[a](…)` before the destination is refused\n * outright — counted from the `(` that opens it, so 31 nested pairs inside.\n *\n * This is a bound on WORK, not on taste, and it is the only thing standing\n * between a paragraph and a frozen tab. The destination scan walks forward for a\n * balancing `)`, and an unclosed destination sends it to the end of the line; one\n * `[a](x` costs nothing, but `'[a](x'.repeat(16384)` — 80 KB on a single line —\n * makes every one of the 16384 openers walk the whole remainder, which measured\n * 936 ms at 80 KB and 3.9 s at 160 KB, synchronously inside a `computed` during\n * change detection. A `~4x` cost per doubling of the input: quadratic, on a\n * component whose documented input is a comment or a model's output.\n *\n * The cap fixes it because a scan can only keep going by NOT finding its closer,\n * and every later `[…](` it walks past contributes an unmatched `(` of its own —\n * so after 32 of them the scan stops, no opener's walk can cover more than the\n * next 32 openers, and the total is linear in the document. (A `)` that would\n * bring the count back down is the closer, and ends the scan anyway.) The number\n * is cmark's: `manual_scan_link_url` refuses at the same depth, for the same\n * reason.\n *\n * What it costs: a destination with 32 or more nested `(` is no longer a link and\n * renders as text. No URL looks like that — the deep end of the real world is a\n * Wikipedia `..._(disambiguation)`, which is one pair.\n */\nconst MAX_DESTINATION_NESTING = 32;\nconst BARE_URL_RE = /^https?:\\/\\/[^\\s<>[\\]()]*(?:\\([^\\s<>()]*\\)[^\\s<>[\\]()]*)*/i;\nconst EMAIL_AUTOLINK_RE = /^<([^\\s@<>]+@[^\\s@<>.]+\\.[^\\s@<>]+)>/;\n\n/**\n * Whitespace and control characters only: a hyphen has no business being\n * stripped out of a host name. Written as escapes rather than literal bytes — a\n * raw NUL inside a regex literal makes the file binary to every text tool.\n * Stripping control characters is the entire point: a browser ignores them before\n * resolving the scheme, so a check that reads the raw string sees a relative path\n * and waves `java\\u0000script:` straight through.\n */\n// eslint-disable-next-line no-control-regex\nconst URL_IGNORED_RE = /[\\s\\u0000-\\u001f\\u007f]/g;\n\n/**\n * The character references a CommonMark renderer decodes in a link destination\n * that can spell a scheme: every numeric one, and the named ones for the colon\n * and for the whitespace a browser strips (`&colon;`, `&Tab;`, `&NewLine;`).\n * Matched without regard to case and with the semicolon optional, which is wider\n * than any renderer decodes — the net only ever catches a URL nobody writes.\n */\nconst SCHEME_REFERENCE_RE = /&(?:#x([0-9a-f]+)|#(\\d+)|(colon|tab|newline));?/gi;\n\nfunction decodeSchemeReferences(url: string): string {\n return url.replace(SCHEME_REFERENCE_RE, (_reference, hex?: string, decimal?: string, name?: string) => {\n if (name) return name.toLowerCase() === 'colon' ? ':' : '\\n';\n const code = hex ? Number.parseInt(hex, 16) : Number(decimal);\n return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : '\\ufffd';\n });\n}\n\n/**\n * A URL safe to put in `href` / `src`, or `null` to render the link as plain text.\n *\n * Two layers, and both are wanted. Angular sanitizes `[href]` bindings itself,\n * but its answer to a hostile URL is the string `unsafe:javascript:…` in a live\n * anchor — a link that looks real, is announced as a link, and does nothing.\n * Refusing it here means the label renders as text instead, which is honest.\n *\n * Whitespace and control characters are stripped before the scheme is read,\n * because `java\\nscript:` and `java script:` are the same URL to a browser and\n * different strings to a naive check. So are character references:\n * `javascript&colon;` has no scheme to this check, but a CommonMark renderer\n * decodes it in a destination, so any markdown the URL is written into — an\n * editor's output, say — hands a browser `javascript:`. The scheme is read from\n * the decoded form; what comes back is still the URL as written.\n */\nfunction safeMarkdownUrl(raw: string, kind: 'link' | 'image'): string | null {\n const url = raw.trim();\n const bare = url.replace(URL_IGNORED_RE, '');\n const scheme = SCHEME_RE.exec(decodeSchemeReferences(bare).replace(URL_IGNORED_RE, ''));\n\n // No scheme at all: relative path, `#anchor`, `//host` — nothing executable.\n if (!scheme) return url;\n\n const name = scheme[1].toLowerCase();\n\n // `data:` is an image-only allowance, and only for raster types: an SVG can\n // carry script, and `data:text/html` is a same-origin document.\n if (name === 'data') return kind === 'image' && DATA_IMAGE_RE.test(bare) ? bare : null;\n\n return ALLOWED_SCHEMES.has(name) ? url : null;\n}\n\n/** Inline markdown to nodes. */\nfunction parseInlines(source: string, options: WrMarkdownParseOptions = {}): readonly WrMarkdownInline[] {\n return inlines(source, 0, newContext(options.streaming ?? false));\n}\n\nfunction inlines(source: string, depth: number, outer: ParseContext): readonly WrMarkdownInline[] {\n if (depth >= MAX_DEPTH) return source ? [{ kind: 'text', value: source }] : [];\n\n // The two failure memos hold INDEXES into `source`, so they are only ever true\n // of the one string this call is scanning — and the context they live on spans\n // the whole document. Shared, an index recorded in one paragraph is compared\n // against a position in the next, and refuses emphasis and links that are\n // perfectly well formed; `matchEmphasis` recursing on a slice (below) does the\n // same thing INSIDE a single paragraph, so restoring on return would not be\n // enough either. A memo per scan is the only keying that means anything, and it\n // costs nothing: the linearity argument in {@link ParseContext.noCloser} is a\n // statement about one string in the first place.\n const ctx: ParseContext = { ...outer, noCloser: new Map(), noBracket: { from: Number.POSITIVE_INFINITY } };\n\n const out: WrMarkdownInline[] = [];\n let text = '';\n let i = 0;\n\n const flush = (): void => {\n if (text) {\n out.push({ kind: 'text', value: text });\n text = '';\n }\n };\n\n while (i < source.length) {\n const char = source[i];\n\n if (char === '\\\\') {\n // A backslash before a newline is a hard break; before punctuation, an escape.\n if (source[i + 1] === '\\n') {\n flush();\n out.push({ kind: 'break' });\n i += 2;\n continue;\n }\n if (i + 1 < source.length && ESCAPABLE.test(source[i + 1])) {\n text += source[i + 1];\n i += 2;\n continue;\n }\n }\n\n if (char === '\\n') {\n // Two trailing spaces are markdown's hard break, and the question is asked\n // of the SOURCE rather than of `text` — twice now, this one line has been\n // where paragraph parsing went quadratic.\n //\n // `/[ ]{2,}$/.test(text)` was the first version: no start anchor, so it\n // retries from every position of the accumulated paragraph. A CPU profile\n // of a 161 KB document put 3306 ms of 3378 ms of total self-time in it.\n // `text.endsWith(' ')` replaced it and is quadratic for a different\n // reason: `text` is built by `+=`, so it is a rope, and every read of its\n // tail flattens the whole thing — 160,000 short lines cost 1980 ms of\n // copying against 7 ms for the same loop without the test. Ordinary prose\n // reaches that shape; nothing has to be malformed.\n //\n // Reading `source` instead answers the same question in constant time, and\n // it IS the same question: while `text` is non-empty its last character is\n // always `source[i - 1]` (every branch that appends appends exactly the\n // character it consumed), and when it is empty the preceding characters\n // belong to a construct that just closed — none of which can end in a\n // space, since a closing fence, `)`, `>` or emphasis marker is never one.\n const hard = source[i - 1] === ' ' && source[i - 2] === ' ';\n if (hard) {\n text = text.replace(/[ ]+$/, '');\n flush();\n out.push({ kind: 'break' });\n } else {\n // A soft break is whitespace; CSS collapses it like any other.\n text += '\\n';\n }\n i++;\n continue;\n }\n\n if (char === '`') {\n const run = /^`+/.exec(source.slice(i))![0];\n const close = findCodeClose(source, i + run.length, run);\n if (close !== -1) {\n flush();\n out.push({ kind: 'code', value: codeSpanValue(source.slice(i + run.length, close)) });\n i = close + run.length;\n continue;\n }\n }\n\n if (char === '<') {\n const auto = AUTOLINK_RE.exec(source.slice(i));\n if (auto) {\n // `ctx.inLink`: CommonMark forbids a link inside a link, and nothing else\n // stops it here — a tree built with DOM APIs nests the `<a>` an HTML\n // parser would have thrown away, which is invalid markup and an axe\n // `nested-interactive` violation at serious level.\n const href = ctx.inLink ? null : safeMarkdownUrl(auto[1], 'link');\n flush();\n out.push(\n href\n ? { kind: 'link', href, title: null, children: [{ kind: 'text', value: auto[1] }] }\n : { kind: 'text', value: auto[1] }\n );\n i += auto[0].length;\n continue;\n }\n const email = EMAIL_AUTOLINK_RE.exec(source.slice(i));\n if (email) {\n // Through `safeMarkdownUrl` like every other href: built by hand, this was\n // the one destination that skipped the control-character strip, which the\n // component's own JSDoc promises for all of them.\n const href = ctx.inLink ? null : safeMarkdownUrl(`mailto:${email[1]}`, 'link');\n flush();\n out.push(\n href\n ? { kind: 'link', href, title: null, children: [{ kind: 'text', value: email[1] }] }\n : { kind: 'text', value: email[1] }\n );\n i += email[0].length;\n continue;\n }\n }\n\n if (char === '!' && source[i + 1] === '[') {\n const link = matchLink(source, i + 1, ctx);\n if (link) {\n const src = safeMarkdownUrl(link.href, 'image');\n const alt = plainText(inlines(link.label, depth + 1, { ...ctx, inLink: true }));\n flush();\n // A refused source leaves the alt text, which is the information the\n // author actually wrote.\n out.push(src ? { kind: 'image', src, alt, title: link.title } : { kind: 'text', value: alt });\n i = link.end;\n continue;\n }\n }\n\n if (char === '[') {\n const link = matchLink(source, i, ctx);\n if (link) {\n const href = ctx.inLink ? null : safeMarkdownUrl(link.href, 'link');\n // The label is parsed with links SUPPRESSED, so an inner one renders as\n // its own text — CommonMark's answer to `[a [b](c)](d)`.\n const children = inlines(link.label, depth + 1, { ...ctx, inLink: true });\n flush();\n if (href) out.push({ kind: 'link', href, title: link.title, children });\n else out.push(...children);\n i = link.end;\n continue;\n }\n }\n\n if ((char === 'h' || char === 'H') && (i === 0 || !/[\\w/]/.test(source[i - 1]))) {\n const bare = ctx.inLink ? null : BARE_URL_RE.exec(source.slice(i));\n if (bare) {\n const url = trimUrlPunctuation(bare[0]);\n const href = safeMarkdownUrl(url, 'link');\n if (href) {\n flush();\n out.push({ kind: 'link', href, title: null, children: [{ kind: 'text', value: url }] });\n i += url.length;\n continue;\n }\n }\n }\n\n if (char === '*' || char === '_' || char === '~') {\n const emphasis = matchEmphasis(source, i, depth, ctx);\n if (emphasis) {\n flush();\n out.push(emphasis.node);\n i = emphasis.end;\n continue;\n }\n }\n\n text += char;\n i++;\n }\n\n flush();\n\n return out;\n}\n\n/** The closing backtick run of exactly the opener's length — a longer run is not it. */\nfunction findCodeClose(source: string, from: number, run: string): number {\n for (let i = from; i < source.length; i++) {\n if (source[i] !== '`') continue;\n\n let end = i;\n while (source[end] === '`') end++;\n if (end - i === run.length) return i;\n i = end - 1;\n }\n\n return -1;\n}\n\n/** CommonMark strips one space from each end when both are present. */\nfunction codeSpanValue(raw: string): string {\n const value = raw.replace(/\\n/g, ' ');\n return value.length > 2 && value.startsWith(' ') && value.endsWith(' ') && value.trim() ? value.slice(1, -1) : value;\n}\n\ninterface LinkMatch {\n readonly label: string;\n readonly href: string;\n readonly title: string | null;\n /** Index just past the closing paren. */\n readonly end: number;\n}\n\n/**\n * `[label](href \"title\")` starting at `source[at] === '['`.\n *\n * Three bounds, all load-bearing. The label scan stops at\n * {@link MAX_LABEL_LENGTH}, which is CommonMark's own limit, and a scan that\n * reaches the end of the source without meeting a single `]` records the fact in\n * the context — from then on every later `[` answers in constant time. Without\n * that, `'['.repeat(100000)` spent 8 seconds on the main thread, inside a\n * `computed`. The third is {@link MAX_DESTINATION_NESTING}, on the destination\n * scan, and it is the one that makes the whole function linear.\n */\nfunction matchLink(source: string, at: number, ctx: ParseContext): LinkMatch | null {\n if (at >= ctx.noBracket.from) return null;\n\n let depth = 0;\n let close = -1;\n let sawClose = false;\n let scannedToEnd = true;\n\n for (let i = at; i < source.length; i++) {\n if (i - at > MAX_LABEL_LENGTH) {\n scannedToEnd = false;\n break;\n }\n const char = source[i];\n if (char === '\\\\') {\n i++;\n continue;\n }\n // A code span can hold an unbalanced bracket; stepping over it keeps\n // `` [`a]b`](x) `` from ending the label early.\n if (char === '`') {\n const run = /^`+/.exec(source.slice(i))![0];\n const end = findCodeClose(source, i + run.length, run);\n if (end !== -1) {\n i = end + run.length - 1;\n continue;\n }\n }\n if (char === '[') depth++;\n if (char === ']') {\n sawClose = true;\n depth--;\n if (depth === 0) {\n close = i;\n break;\n }\n }\n }\n\n if (close === -1) {\n // Only when the source truly holds no `]` past here: an unbalanced nest\n // (`[[a](b)`) fails for a different reason, and memoising that would hide the\n // valid link one character to the right.\n if (!sawClose && scannedToEnd) ctx.noBracket.from = Math.min(ctx.noBracket.from, at);\n return null;\n }\n\n if (source[close + 1] !== '(') return null;\n\n let parens = 1;\n let end = -1;\n for (let i = close + 2; i < source.length; i++) {\n const char = source[i];\n if (char === '\\\\') {\n i++;\n continue;\n }\n if (char === '(') {\n parens++;\n // Giving up HERE is what makes the scan linear rather than quadratic — see\n // {@link MAX_DESTINATION_NESTING}.\n if (parens > MAX_DESTINATION_NESTING) return null;\n }\n if (char === ')') {\n parens--;\n if (parens === 0) {\n end = i;\n break;\n }\n }\n // A newline inside the destination means this was never a link.\n if (char === '\\n') return null;\n }\n\n if (end === -1) return null;\n\n const target = source.slice(close + 2, end).trim();\n const label = source.slice(at + 1, close);\n\n // `<…>` around the destination is markdown's way of allowing a space in it, and\n // it has to be unwrapped BEFORE the scheme is read: `[a](<javascript:alert(1)>)`\n // has no scheme while the bracket is still attached, so `safeMarkdownUrl` read\n // it as a relative path and waved it through — leaving Angular's sanitizer, the\n // layer this file calls insufficient, as the only thing standing in the way.\n const angled = ANGLE_DEST_RE.exec(target);\n if (angled) return { label, href: angled[1], title: angled[2] ?? null, end: end + 1 };\n\n const titled = /^(\\S*)\\s+[\"'(](.*)[\"')]$/.exec(target);\n\n return {\n label,\n href: titled ? titled[1] : target,\n title: titled ? titled[2] : null,\n end: end + 1,\n };\n}\n\n/** Trailing sentence punctuation belongs to the prose, not to the bare URL. */\nfunction trimUrlPunctuation(url: string): string {\n return url.replace(/[.,;:!?'\"]+$/, '');\n}\n\ninterface EmphasisMatch {\n readonly node: WrMarkdownInline;\n readonly end: number;\n}\n\n/**\n * Emphasis, strong and strikethrough.\n *\n * A pragmatic reading of CommonMark's flanking rules rather than the full\n * algorithm: an opener may not be followed by whitespace, a closer may not be\n * preceded by it, and `_` additionally may not sit against a word character on\n * the outside. That last clause is the one that matters in practice — without it\n * `snake_case_name` renders as `snake<em>case</em>name`, which is how most\n * lightweight parsers embarrass themselves on code-adjacent prose.\n */\nfunction matchEmphasis(source: string, at: number, depth: number, ctx: ParseContext): EmphasisMatch | null {\n const char = source[at];\n const run = /^(\\*+|_+|~+)/.exec(source.slice(at))![0].length;\n\n // `~` is strikethrough only as a pair: a single one is arithmetic, a path, or\n // LaTeX far more often than it is emphasis.\n if (char === '~' && run < 2) return null;\n\n const use = char === '~' ? 2 : Math.min(run, 2);\n const after = source[at + run];\n if (after === undefined || /\\s/.test(after)) return null;\n if (char === '_' && at > 0 && /[\\p{L}\\p{N}]/u.test(source[at - 1])) return null;\n\n // Already known to have no closer from here on. The search is monotone — the\n // window for a later opener is a subset of this one — so one failure answers\n // every subsequent opener of the same character, which is what turns a\n // quadratic scan into a linear one.\n const failedFrom = ctx.noCloser.get(char);\n if (failedFrom !== undefined && at >= failedFrom) return null;\n\n for (let i = at + run; i < source.length; i++) {\n const current = source[i];\n\n if (current === '\\\\') {\n i++;\n continue;\n }\n\n if (current === '`') {\n const backticks = /^`+/.exec(source.slice(i))![0];\n const end = findCodeClose(source, i + backticks.length, backticks);\n if (end !== -1) {\n i = end + backticks.length - 1;\n continue;\n }\n }\n\n if (current !== char) continue;\n\n let end = i;\n while (source[end] === char) end++;\n const length = end - i;\n\n if (length < use || /\\s/.test(source[i - 1])) {\n i = end - 1;\n continue;\n }\n if (char === '_' && end < source.length && /[\\p{L}\\p{N}]/u.test(source[end])) {\n i = end - 1;\n continue;\n }\n\n // Take `use` markers from the START of the opener and the END of the closer,\n // so `***x***` leaves `*x*` inside the strong node and nests correctly.\n const children = inlines(source.slice(at + use, end - use), depth + 1, ctx);\n const kind = char === '~' ? 'del' : use === 2 ? 'strong' : 'em';\n\n return { node: { kind, children }, end };\n }\n\n // No closer anywhere in this source. Recorded so the next opener of the same\n // character does not repeat the walk.\n //\n // Note what does NOT happen here any more: an optimistic close. Guessing at the\n // scanner level meant a marker 40 characters back swallowed the rest of the\n // block — including markup that had already parsed, so an unclosed backtick ate\n // a finished `[docs](url)` and rendered it as monospaced source. Mid-stream\n // guessing now happens once, on the document's tail, where it can be bounded.\n // See {@link applyStreamingTail}.\n ctx.noCloser.set(char, Math.min(failedFrom ?? Number.POSITIVE_INFINITY, at));\n\n return null;\n}\n\n/** Text content of an inline tree — for `alt` and for heading slugs. */\nfunction plainText(inlines: readonly WrMarkdownInline[]): string {\n return inlines\n .map(node => {\n switch (node.kind) {\n case 'text':\n case 'code':\n return node.value;\n case 'image':\n return node.alt;\n case 'break':\n return ' ';\n default:\n return plainText(node.children);\n }\n })\n .join('');\n}\n\n// ---------------------------------------------------------------------------\n// Streaming\n// ---------------------------------------------------------------------------\n\n/**\n * How far back from the end of the document a marker may sit and still be treated\n * as mid-flight.\n *\n * The optimistic close is a GUESS, and a guess needs a blast radius. Unbounded, a\n * `*` forty characters back turned the rest of a finished sentence into emphasis\n * for the whole stream and then unwrapped it at the end — the exact restyle the\n * feature exists to avoid. Within a chunk's distance of the end, an unmatched\n * marker is nearly always a construct still arriving.\n */\nconst TAIL_WINDOW = 80;\n\n/**\n * A run that is worth closing optimistically, and its node kind.\n *\n * Deliberately no single `*` or `_`. Those are multiplication signs, file names\n * and `snake_case` far more often than they are emphasis mid-word, and getting it\n * wrong there restyles ordinary prose. `**`, `__`, `~~` and a backtick are\n * unambiguous enough to bet on.\n */\nconst OPTIMISTIC_RE = /(\\*\\*|__|~~|`)([^\\s*_~`][^*_~`]*)$/;\n\n/**\n * A construct the stream has only begun to type: a trailing marker run, or a link\n * whose destination has not arrived.\n *\n * Anchored, and every alternative bounded. The version this replaced allowed\n * `\\][^)]*` to run to the end of the text, so a CLOSED `[docs]` in the middle of a\n * sentence matched from the bracket onwards and deleted the rest of the paragraph\n * — and kept deleting it for the whole stream, because the paragraph stayed the\n * last block. `See the [docs] for details.` rendered as `See the `.\n */\nconst FRAGMENT_RE = /(?:[*_~`]+|!?\\[[^\\]\\n]*(?:\\]\\([^)\\s]*)?)$/;\n\n/**\n * The mid-stream adjustments, applied once to the document's TAIL.\n *\n * Everything the streaming mode does beyond parsing an open fence lives here, and\n * the reason is scope. The tail is the only part of a streamed document that is\n * still changing, so it is the only part where guessing is defensible; a guess\n * made inside the inline scanner cannot tell whether it is at the end of the\n * document or in the middle of a paragraph that finished two chunks ago.\n *\n * It descends: the last block may be a quote, or the last item of a list, which is\n * where most streamed prose actually lives. The version that only looked at a\n * top-level paragraph left the `**` flicker in place everywhere else while the\n * documentation claimed otherwise.\n */\nfunction applyStreamingTail(blocks: readonly WrMarkdownBlock[]): readonly WrMarkdownBlock[] {\n const last = blocks[blocks.length - 1];\n if (!last) return blocks;\n\n const patched = patchBlock(last);\n if (patched === last) return blocks;\n\n const head = blocks.slice(0, -1);\n\n return patched === null ? head : [...head, patched];\n}\n\n/** `null` to drop the block entirely, the same reference to leave it alone. */\nfunction patchBlock(block: WrMarkdownBlock): WrMarkdownBlock | null {\n switch (block.kind) {\n case 'paragraph':\n case 'heading': {\n // `## ` with nothing after it yet: a node that would render as an empty box.\n if (block.inlines.length === 0) return null;\n\n const inlines = patchInlines(block.inlines);\n if (inlines === block.inlines) return block;\n\n return inlines.length === 0 ? null : { ...block, inlines };\n }\n\n case 'quote': {\n const children = applyStreamingTail(block.children);\n if (children === block.children) return block;\n\n return children.length === 0 ? null : { ...block, children };\n }\n\n case 'list': {\n const item = block.items[block.items.length - 1];\n if (!item) return block;\n\n const children = applyStreamingTail(item.children);\n if (children === item.children) return block;\n\n // The item stays even when its content goes: the bullet is already on\n // screen, and removing it would be a flicker of its own.\n return { ...block, items: [...block.items.slice(0, -1), { ...item, children }] };\n }\n\n default:\n return block;\n }\n}\n\nfunction patchInlines(nodes: readonly WrMarkdownInline[]): readonly WrMarkdownInline[] {\n const last = nodes[nodes.length - 1];\n if (!last) return nodes;\n\n // The tail may be inside a wrapper — `**bold and [lin` puts it inside the strong.\n if (last.kind === 'strong' || last.kind === 'em' || last.kind === 'del' || last.kind === 'link') {\n const children = patchInlines(last.children);\n if (children === last.children) return nodes;\n\n const head = nodes.slice(0, -1);\n\n return children.length === 0 ? head : [...head, { ...last, children }];\n }\n\n // A backtick that has only just arrived, already painted as an empty chip.\n if (last.kind === 'code' && last.value === '') return nodes.slice(0, -1);\n\n if (last.kind !== 'text') return nodes;\n\n const patched = patchText(last.value);\n\n return patched === null ? nodes : [...nodes.slice(0, -1), ...patched];\n}\n\n/** `null` when the text is not a tail that needs adjusting. */\nfunction patchText(value: string): readonly WrMarkdownInline[] | null {\n let text = value;\n\n // Repeatedly, because dropping `[lin` from `**bold and [lin` exposes the `**`\n // behind it, which is then a candidate for the optimistic close below.\n for (let pass = 0; pass < 3; pass++) {\n const shorter = text.replace(FRAGMENT_RE, '');\n if (shorter === text) break;\n text = shorter;\n }\n\n const opening = OPTIMISTIC_RE.exec(text);\n if (opening) {\n const [matched, marker, content] = opening;\n const at = text.length - matched.length;\n const before = text.slice(0, at);\n // `_` may not close against a word character, so mid-word it is not a marker\n // at all — `snake_case` must not italicise as it arrives.\n const wordBefore = marker === '__' && at > 0 && /[\\p{L}\\p{N}]/u.test(text[at - 1]);\n\n if (!wordBefore && content.length <= TAIL_WINDOW) {\n const node: WrMarkdownInline =\n marker === '`'\n ? { kind: 'code', value: content }\n : { kind: marker === '~~' ? 'del' : 'strong', children: [{ kind: 'text', value: content }] };\n\n return before ? [{ kind: 'text', value: before }, node] : [node];\n }\n }\n\n if (text === value) return null;\n\n return text ? [{ kind: 'text', value: text }] : [];\n}\n\nexport { parseInlines, parseMarkdown, plainText, safeMarkdownUrl };\n\n// Internal to the entry point: `serialize-markdown.ts` writes markdown against\n// THIS parser's rules rather than CommonMark's, so it asks these the same\n// questions the parser asks. `public-api.ts` decides what is public, and none of\n// these are — a regex is not an API anyone should be able to depend on.\nexport {\n AUTOLINK_RE,\n EMAIL_AUTOLINK_RE,\n MAX_DESTINATION_NESTING,\n MAX_LABEL_LENGTH,\n MAX_TABLE_COLUMNS,\n QUOTE_RE,\n RULE_RE,\n TABLE_DELIM_RE,\n codeSpanValue,\n interruptsParagraph,\n isTableStart,\n matchListStart,\n startsBlock,\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrMarkdownHighlighter } from './interfaces';\n\n/**\n * The app's syntax highlighter, or `null` for none.\n *\n * Defaults to `null` on purpose: highlighting means a grammar engine, and one of\n * those in the library's dependency tree would be paid for by every consumer who\n * renders a paragraph of text. Provide it with `provideWrMarkdownHighlighter()`.\n */\nexport const WR_MARKDOWN_HIGHLIGHTER = new InjectionToken<WrMarkdownHighlighter | null>('WR_MARKDOWN_HIGHLIGHTER', {\n factory: () => null,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injectable, inject, signal } from '@angular/core';\n\nimport type { WrHighlightLine } from './interfaces';\nimport { WR_MARKDOWN_HIGHLIGHTER } from './tokens';\n\n/**\n * How many highlighted code blocks to remember, per language.\n *\n * A requirement of streaming rather than an optimisation: a code block that grows\n * by a token per chunk asks to be highlighted with a DIFFERENT string every time,\n * so an unbounded store would hold every intermediate state of every block for the\n * life of the app — and this service is `providedIn: 'root'`.\n *\n * Comfortably larger than any one document, deliberately. A window too small to\n * hold what is on screen means every pass evicts entries that same pass still\n * needs and asks for them again — a grammar engine running for ever on a page that\n * has stopped changing.\n */\nconst CACHE_LIMIT = 256;\n\n/**\n * How many languages to remember at all.\n *\n * {@link CACHE_LIMIT} bounds the store in the dimension a STREAM controls and\n * left it unbounded in the dimension the DOCUMENT controls: `language` is the\n * first word of the code fence's info string, arbitrary text from an input\n * `<wr-markdown>` treats as untrusted — so a document of ```` ```a1 ```` …\n * ```` ```aN ```` fences created N buckets that only `invalidate()` ever\n * removed. Same `providedIn: 'root'` lifetime as the rest of this store.\n *\n * Comfortably larger than any one document for the same reason `CACHE_LIMIT` is:\n * a window too small to hold what is on screen evicts what the same pass still\n * renders. A document with more than a few dozen distinct languages is exotic.\n *\n * Evicting here cannot re-dirty the effect that requests, which is the loop this\n * class is built around avoiding: that effect depends on `generation`, and\n * nothing on this path writes it.\n *\n * Exported for the spec, not through `public-api.ts` — the number is the whole\n * assertion, and a copy of it in the test would stop tracking this one.\n */\nconst LANGUAGE_LIMIT = 64;\n\n/** One block's answer. `lines` stays `null` until an async highlighter resolves. */\ninterface Entry {\n lines: readonly WrHighlightLine[] | null;\n}\n\n/**\n * Turns fenced code into coloured spans, once per distinct block.\n *\n * **Two rules hold this together, and both were learned by breaking them.**\n *\n * `request` never READS a signal that it writes. An earlier version kept the\n * answers in a signal and rebuilt it on every store, so the component's `effect` —\n * which calls `request` — depended on the signal `request` wrote, and a document\n * with more code blocks than the cache could hold looped for ever: evict,\n * re-request, write, re-dirty. It did not merely spin, it starved the timers that\n * were supposed to fail the test. The plain `Map` is the source of truth now, and a\n * single `revision` counter is the only reactive part; nothing that writes reads it\n * back.\n *\n * And `linesFor` is a pure read, safe to call while Angular renders. Asking a\n * highlighter for a block means writing when the answer lands, and Angular refuses\n * a signal write during rendering (NG0600) — so the component requests from an\n * `effect`, which runs after the render, and the template only reads.\n *\n * Blocks appear as plain text first and gain colour when the answer arrives. For an\n * async highlighter that is right rather than a compromise: a grammar engine loads\n * WASM, and blocking on it would leave the reader with an empty box instead of\n * their code.\n */\n@Injectable({ providedIn: 'root' })\nexport class WrMarkdownHighlight {\n private readonly highlighter = inject(WR_MARKDOWN_HIGHLIGHTER);\n\n /** Language to code to answer. Insertion order is least-recently-rendered first. */\n private readonly cache = new Map<string, Map<string, Entry>>();\n\n /** Bumped whenever an answer lands. Read by the template, never by a writer. */\n private readonly revision = signal(0);\n\n private readonly generationSignal = signal(0);\n\n /**\n * Bumped ONLY by {@link invalidate}. Read it in the effect that requests, so a\n * consumer can force a re-ask.\n *\n * Separate from `revision` on purpose, and the separation is the whole safety\n * argument. An effect that requests and also depends on the signal that storing\n * an answer writes is the shape that looped for ever here once: past the cache\n * limit, requesting stops being idempotent, so each pass writes, re-dirties the\n * effect, evicts and requests again. Nothing inside `request` touches this one.\n */\n readonly generation = this.generationSignal.asReadonly();\n\n /** Spans for one block, or `null` for plain text. Safe to call from a template. */\n linesFor(code: string, language: string | null): readonly WrHighlightLine[] | null {\n if (!language) return null;\n\n // Establishes the dependency, so a late answer re-renders the block waiting.\n this.revision();\n\n const perLanguage = this.cache.get(language);\n const entry = perLanguage?.get(code);\n if (!entry || !perLanguage) return null;\n\n // Touched on read, so eviction drops what nobody is rendering rather than what\n // arrived first. Insertion order had it exactly backwards: mid-stream it\n // discarded the finished block the reader was looking at and kept the\n // half-typed intermediates, and the finished block flashed back to plain text.\n perLanguage.delete(code);\n perLanguage.set(code, entry);\n\n return entry.lines;\n }\n\n /**\n * Forget every answer and ask again on the next render.\n *\n * The cache is keyed on `(language, code)` and nothing else, which is right for\n * the streaming case it exists for and wrong for one real situation: a\n * highlighter that returns per-theme colours serves whichever palette was\n * current when a block was first rendered, for ever. There is no theme\n * dimension to key on — the library cannot know what a highlighter's answer\n * depends on — so the honest fix is to let the consumer say when it changed.\n *\n * A highlighter that returns theme-agnostic colours (CSS `light-dark()`, a\n * custom property) needs none of this.\n *\n * @example\n * ```ts\n * const highlight = inject(WrMarkdownHighlight);\n * effect(() => {\n * theme.current();\n * highlight.invalidate();\n * });\n * ```\n */\n invalidate(): void {\n this.cache.clear();\n this.generationSignal.update(generation => generation + 1);\n this.revision.update(revision => revision + 1);\n }\n\n /**\n * Ask for a block to be highlighted. Idempotent, and safe to call for every\n * block on every change — call it from an `effect`, never from a template.\n */\n request(code: string, language: string | null): void {\n // A bare fence has no grammar to pick, so there is nothing to ask for.\n if (!this.highlighter || !language || !code) return;\n\n const existing = this.cache.get(language);\n // Deleted before it is re-set, because `Map.set` on a key it already holds\n // keeps the ORIGINAL position: a plain `set` would leave the outer map in\n // first-sighting order, and `evictLanguage` would then drop a language still\n // being asked for in favour of one seen earlier and no longer rendered.\n if (existing) this.cache.delete(language);\n const perLanguage = existing ?? new Map<string, Entry>();\n this.cache.set(language, perLanguage);\n this.evictLanguage();\n // Presence IS the record of having asked — a separate `asked` set was a second\n // structure to keep in step with this one, and eviction only pruned one of them.\n if (perLanguage.has(code)) return;\n\n const entry: Entry = { lines: null };\n perLanguage.set(code, entry);\n this.evict(perLanguage);\n\n let result: ReturnType<typeof this.highlighter>;\n try {\n result = this.highlighter(code, language);\n } catch {\n // A highlighter that throws on an unknown grammar costs the reader colour,\n // not their code.\n return;\n }\n\n if (result instanceof Promise) {\n result.then(lines => this.fill(entry, lines)).catch(() => undefined);\n } else {\n this.fill(entry, result);\n }\n }\n\n /**\n * Fill in an answer and let the view know.\n *\n * Writes through the entry OBJECT rather than looking its key up again. The entry\n * may have been evicted while the promise was in flight, in which case this\n * writes to something nothing holds — which is the intended outcome. The version\n * that re-inserted by key put entries back behind eviction's back, and the cache\n * grew without a ceiling for exactly the async highlighter its limit exists for.\n */\n private fill(entry: Entry, lines: readonly WrHighlightLine[] | null): void {\n if (!lines) return;\n\n entry.lines = lines;\n this.revision.update(revision => revision + 1);\n }\n\n /** `Map` iterates in insertion order, and `linesFor` re-inserts on read. */\n private evict(perLanguage: Map<string, Entry>): void {\n while (perLanguage.size > CACHE_LIMIT) {\n const oldest = perLanguage.keys().next();\n if (oldest.done) return;\n perLanguage.delete(oldest.value);\n }\n }\n\n /**\n * The same bound, one dimension out. `request` re-inserts a bucket it already\n * holds, so the outer map iterates least-recently-REQUESTED first — and the\n * component's effect asks for every code block in the document it is showing,\n * so a language that stops being requested is one nothing renders any more.\n *\n * Read is deliberately NOT a touch here, unlike {@link linesFor} for the inner\n * map: with the effect re-asking for every block, request order already tracks\n * what is rendered, and nothing has needed the finer signal.\n */\n private evictLanguage(): void {\n while (this.cache.size > LANGUAGE_LIMIT) {\n const oldest = this.cache.keys().next();\n if (oldest.done) return;\n this.cache.delete(oldest.value);\n }\n }\n}\n\nexport { LANGUAGE_LIMIT };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { Component, DestroyRef, ViewEncapsulation, computed, effect, inject, input, signal } from '@angular/core';\n\nimport { useConfigValue } from 'ngwr/config';\nimport { WrCopyToClipboard } from 'ngwr/directives';\nimport { useI18nText } from 'ngwr/i18n';\n\nimport type {\n WrHighlightLine,\n WrMarkdownBlock,\n WrMarkdownCell,\n WrMarkdownInline,\n WrMarkdownListItem,\n} from './interfaces';\nimport { parseMarkdown } from './parse-markdown';\nimport { WrMarkdownHighlight } from './wr-markdown-highlight';\n\n/** How long the copy button stays in its \"copied\" state. */\nconst COPIED_FEEDBACK_MS = 2000;\n\n/** Code blocks anywhere in the tree — a quote or a list item holds blocks too. */\nfunction collectCode(blocks: readonly WrMarkdownBlock[]): readonly { code: string; language: string | null }[] {\n const found: { code: string; language: string | null }[] = [];\n\n for (const block of blocks) {\n if (block.kind === 'code') found.push({ code: block.code, language: block.language });\n if (block.kind === 'quote') found.push(...collectCode(block.children));\n if (block.kind === 'list') for (const item of block.items) found.push(...collectCode(item.children));\n }\n\n return found;\n}\n\n/**\n * Renders markdown — as DOM, not as HTML.\n *\n * Built for streamed model output, and useful for any markdown an app does not\n * write itself: comments, release notes, a README. `[streaming]` makes a partial\n * document render like a whole one (see {@link parseMarkdown}); without it the\n * component is an ordinary renderer.\n *\n * **Raw HTML in the source is escaped, never rendered.** That is a deliberate\n * limit rather than an unfinished feature: the input is untrusted by\n * construction, `[innerHTML]` is how every comparable renderer takes it, and one\n * `<img onerror>` is the whole cost of being wrong. Nothing here is parsed as\n * HTML at any point — every text node is a text node and every `href` goes\n * through Angular's URL sanitizer on top of this component's own scheme check.\n *\n * @example\n * ```html\n * <wr-markdown [value]=\"answer()\" [streaming]=\"pending()\" copyable />\n * ```\n *\n * @see https://ngwr.dev/reference/components/markdown\n */\n@Component({\n selector: 'wr-markdown',\n templateUrl: './wr-markdown.html',\n imports: [NgTemplateOutlet, WrCopyToClipboard],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-markdown',\n '[class.wr-markdown--streaming]': 'streaming()',\n },\n})\nexport class WrMarkdown {\n private readonly highlight = inject(WrMarkdownHighlight);\n private readonly destroyRef = inject(DestroyRef);\n\n /** The markdown source. */\n readonly value = input<string>('');\n\n /**\n * The source is a prefix of a longer document.\n *\n * Turns on partial-safe parsing — an open fence renders as code, a half-typed\n * `**bold` renders as bold rather than as asterisks — and marks the host with\n * `.wr-markdown--streaming`, which paints a caret after the last block.\n *\n * @default false\n */\n readonly streaming = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show a copy button on finished code blocks.\n *\n * Falls back to `markdown.copyable` from `provideWrConfig()`, then `false`.\n * Only CLOSED blocks get one: mid-stream the code is not all there, and a\n * button that copies half a snippet is worse than no button.\n */\n readonly copyable = input<boolean | null, BooleanInput>(null, {\n // `null` survives, because it is what \"the template said nothing\" means to\n // `useConfigValue` — but a bare `copyable` attribute has to reach `true`, and\n // without a transform it arrives as `''` and does not compile under\n // `strictTemplates`. The component's own JSDoc example was the proof.\n transform: value => (value == null ? null : coerceBooleanProperty(value)),\n });\n\n /**\n * Where links open. `_blank` also sets `rel=\"noopener noreferrer\"`, which is\n * not optional — a target without it hands the opener to a page whose URL came\n * from the document being rendered.\n *\n * Falls back to `markdown.linkTarget` from `provideWrConfig()`, then no target.\n */\n readonly linkTarget = input<'_blank' | '_self' | null>(null);\n\n /**\n * Put a slugged `id` on every heading, so the document can be linked into.\n *\n * @default true\n */\n readonly headingIds = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Namespace for the generated heading ids, and for the in-document `#fragment`\n * links that point at them.\n *\n * Defaults to `'user-content-'`, which is what GitHub emits for untrusted\n * markdown, and for the same reason: without a namespace a document that\n * happens to contain `# Search` renders `id=\"search\"` and steals it from the\n * page around it. That is not cosmetic — a `<label for=\"search\">` silently\n * stops labelling its input, and `getElementById` starts answering with a\n * heading. Anchors written INSIDE the document keep working, because a bare\n * `#fragment` href gets the same prefix.\n *\n * Set it to `''` for a document you author yourself and want clean anchors for.\n */\n readonly headingIdPrefix = input<string>('user-content-');\n\n /** Accessible name of the copy button. Falls back to `markdown.copy`, then `'Copy code'`. */\n readonly copyLabel = input<string | null>(null);\n\n /** Announced after a successful copy. Falls back to `markdown.copied`, then `'Copied'`. */\n readonly copiedLabel = input<string | null>(null);\n\n /** Read out for a checked task item. Falls back to `markdown.taskDone`, then `'Done:'`. */\n readonly taskDoneLabel = input<string | null>(null);\n\n /** Read out for an unchecked task item. Falls back to `markdown.taskTodo`, then `'To do:'`. */\n readonly taskTodoLabel = input<string | null>(null);\n\n protected readonly resolvedCopyable = useConfigValue(this.copyable, config => config.markdown?.copyable, false);\n protected readonly resolvedLinkTarget = useConfigValue<'_blank' | '_self' | null>(\n this.linkTarget,\n config => config.markdown?.linkTarget,\n null\n );\n protected readonly resolvedCopyLabel = useI18nText(this.copyLabel, 'markdown.copy', 'Copy code');\n protected readonly resolvedCopiedLabel = useI18nText(this.copiedLabel, 'markdown.copied', 'Copied');\n protected readonly resolvedTaskDoneLabel = useI18nText(this.taskDoneLabel, 'markdown.taskDone', 'Done:');\n protected readonly resolvedTaskTodoLabel = useI18nText(this.taskTodoLabel, 'markdown.taskTodo', 'To do:');\n\n /**\n * The parsed document, re-derived whenever the source changes.\n *\n * The WHOLE buffer, on every chunk — so a streamed answer costs O(n²) over the\n * stream. That is a deliberate trade rather than an oversight: freezing the\n * blocks before the last blank line would halve it, but a blank line is not a\n * safe boundary in markdown (a list continues across one), and a wrong boundary\n * corrupts the document rather than slowing it down. The constant is small —\n * 300 KB of prose parses in ~120 ms — and `@for`'s `track $index` keeps the\n * DOM cost proportional to what actually changed.\n */\n protected readonly blocks = computed(() => parseMarkdown(this.value(), { streaming: this.streaming() }));\n\n /** `rel` is bound, not hard-coded, so a same-tab link does not carry a pointless one. */\n protected readonly linkRel = computed(() => (this.resolvedLinkTarget() === '_blank' ? 'noopener noreferrer' : null));\n\n /**\n * Which code block last got copied, held by IDENTITY.\n *\n * Keyed on the code string, two blocks containing the same snippet both lit up\n * — and a document that shows the same one-liner twice is ordinary. Block nodes\n * are recreated whenever the source changes, so the confirmation also clears\n * itself on the next chunk, which is the right lifetime for it.\n */\n private readonly copiedBlock = signal<WrMarkdownBlock | null>(null);\n\n private copiedTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // Requested here rather than from the template: asking the highlighter means\n // writing a signal when the answer lands, and Angular refuses a signal write\n // during rendering (NG0600). An effect runs after it.\n effect(() => {\n // `generation` is what makes `WrMarkdownHighlight.invalidate()` reach the\n // blocks already on screen. It is deliberately NOT the signal that storing\n // an answer bumps — depending on that one from here is the loop.\n this.highlight.generation();\n for (const block of this.codeBlocks()) this.highlight.request(block.code, block.language);\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.copiedTimer !== null) clearTimeout(this.copiedTimer);\n });\n }\n\n /**\n * A newline as data rather than as template text.\n *\n * The lines of a highlighted block are separate elements, and what separates\n * them on screen — and in a copy — is a real `\\n` inside the `<pre>`. Angular\n * strips whitespace-only text nodes from templates, so the character cannot be\n * typed there; an interpolation of it survives.\n */\n protected readonly newline = String.fromCharCode(10);\n\n /** Every code block in the document, nested ones included. */\n private readonly codeBlocks = computed(() => collectCode(this.blocks()));\n\n /** Spans for a code block, or `null` to render it as plain text. */\n protected linesOf(code: string, language: string | null): readonly WrHighlightLine[] | null {\n return this.highlight.linesFor(code, language);\n }\n\n protected isCopied(block: WrMarkdownBlock): boolean {\n return this.copiedBlock() === block;\n }\n\n protected onCopied(block: WrMarkdownBlock): void {\n this.copiedBlock.set(block);\n if (this.copiedTimer !== null) clearTimeout(this.copiedTimer);\n this.copiedTimer = setTimeout(() => {\n this.copiedBlock.set(null);\n this.copiedTimer = null;\n }, COPIED_FEEDBACK_MS);\n }\n\n /** A heading's id, namespaced, or `null` when there is nothing to link to. */\n protected idOf(id: string): string | null {\n if (!this.headingIds() || !id) return null;\n\n return `${this.headingIdPrefix()}${id}`;\n }\n\n /**\n * A link's destination, with a bare fragment pointed at the namespaced id.\n *\n * Otherwise prefixing the headings would quietly break every `[see](#section)`\n * the document writes about itself.\n */\n protected hrefOf(href: string): string {\n const prefix = this.headingIdPrefix();\n if (!prefix || !this.headingIds() || !href.startsWith('#') || href.length < 2) return href;\n\n return `#${prefix}${href.slice(1)}`;\n }\n\n /**\n * Casts for the recursive templates, and the reason they exist.\n *\n * Block content nests — a quote holds blocks, a list item holds blocks — so the\n * template recurses through `ngTemplateOutlet` into itself. That is the one\n * recursion shape which adds NO elements to the DOM; a recursive component\n * would put a host element between `<ul>` and its `<li>`, which is invalid\n * markup and breaks the list's accessibility tree. The cost is that\n * `ngTemplateOutlet` context arrives as `any`, and `@switch` cannot narrow\n * `any`. Casting it back at the top of each template restores full\n * `strictTemplates` checking inside the loop, where the work happens.\n */\n protected asBlocks(value: unknown): readonly WrMarkdownBlock[] {\n return value as readonly WrMarkdownBlock[];\n }\n\n protected asInlines(value: unknown): readonly WrMarkdownInline[] {\n return value as readonly WrMarkdownInline[];\n }\n\n protected asItems(value: unknown): readonly WrMarkdownListItem[] {\n return value as readonly WrMarkdownListItem[];\n }\n\n protected asCells(value: unknown): readonly WrMarkdownCell[] {\n return value as readonly WrMarkdownCell[];\n }\n}\n","<!--\n Recursion runs through `ngTemplateOutlet` into these templates rather than\n through a child component, so the rendered DOM is exactly the document — no\n wrapper element between a `<ul>` and its `<li>`. See `asBlocks` for the whole\n reasoning.\n-->\n<ng-template #inlineList let-raw>\n @let nodes = asInlines(raw);\n\n @for (node of nodes; track $index) {\n @switch (node.kind) {\n @case ('text') {\n <!-- Wrapped, and not for tidiness: a bare interpolation on its own line is\n ONE text node that includes the indentation around it, so `a **b** c`\n rendered with a space inside every `<strong>`. Inside an element the\n whitespace becomes separate whitespace-only nodes, which Angular\n removes, and `<ng-container>` itself renders nothing. Prettier\n reformats the bare form back, so this also has to survive `--fix`. -->\n <ng-container>{{ node.value }}</ng-container>\n }\n @case ('code') {\n <!-- `dir=\"ltr\"` because code is not prose: under RTL the browser\n reorders `foo();` to `;foo()`. -->\n <code class=\"wr-markdown__code-inline\" dir=\"ltr\">{{ node.value }}</code>\n }\n @case ('strong') {\n <strong class=\"wr-markdown__strong\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></strong>\n }\n @case ('em') {\n <em class=\"wr-markdown__em\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></em>\n }\n @case ('del') {\n <del class=\"wr-markdown__del\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></del>\n }\n @case ('link') {\n <a\n class=\"wr-markdown__link\"\n [href]=\"hrefOf(node.href)\"\n [attr.title]=\"node.title\"\n [attr.target]=\"resolvedLinkTarget()\"\n [attr.rel]=\"linkRel()\"\n ><ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: node.children }\"\n /></a>\n }\n @case ('image') {\n <img\n class=\"wr-markdown__image\"\n [src]=\"node.src\"\n [alt]=\"node.alt\"\n [attr.title]=\"node.title\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n }\n @case ('break') {\n <br />\n }\n }\n }\n</ng-template>\n\n<ng-template #itemList let-raw let-tight=\"tight\">\n @let items = asItems(raw);\n\n @for (item of items; track $index) {\n <li class=\"wr-markdown__item\" [class.wr-markdown__item--task]=\"item.checked !== null\">\n @if (item.checked !== null) {\n <!-- Presentational, with the state as text beside it: a real\n `<input type=\"checkbox\">` here would be an unlabelled form control,\n which is a serious axe violation, and making it operable would\n promise an interaction a renderer cannot honour. -->\n <span class=\"wr-markdown__task\" [class.wr-markdown__task--checked]=\"item.checked\" aria-hidden=\"true\"></span>\n <span class=\"wr-markdown__sr-only\">{{ item.checked ? resolvedTaskDoneLabel() : resolvedTaskTodoLabel() }}</span>\n }\n <ng-container\n [ngTemplateOutlet]=\"blockList\"\n [ngTemplateOutletContext]=\"{ $implicit: item.children, tight: tight }\"\n />\n </li>\n }\n</ng-template>\n\n<ng-template #blockList let-raw let-tight=\"tight\">\n @let list = asBlocks(raw);\n\n @for (block of list; track $index) {\n @switch (block.kind) {\n @case ('paragraph') {\n <!-- A tight list drops the `<p>`, which is what CommonMark specifies and\n what keeps a one-line list from being double-spaced. -->\n @if (tight) {\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n } @else {\n <p class=\"wr-markdown__paragraph\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </p>\n }\n }\n @case ('heading') {\n @switch (block.level) {\n @case (1) {\n <h1 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h1>\n }\n @case (2) {\n <h2 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h2>\n }\n @case (3) {\n <h3 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h3>\n }\n @case (4) {\n <h4 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h4>\n }\n @case (5) {\n <h5 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h5>\n }\n @default {\n <h6 class=\"wr-markdown__heading\" [attr.id]=\"idOf(block.id)\">\n <ng-container [ngTemplateOutlet]=\"inlineList\" [ngTemplateOutletContext]=\"{ $implicit: block.inlines }\" />\n </h6>\n }\n }\n }\n @case ('code') {\n @let highlighted = linesOf(block.code, block.language);\n\n <div class=\"wr-markdown__code-block\">\n <pre\n class=\"wr-markdown__pre\"\n dir=\"ltr\"\n tabindex=\"0\"\n ><code class=\"wr-markdown__code\" [attr.data-language]=\"block.language\">@if (highlighted) {@for (row of highlighted; track $index) {<span class=\"wr-markdown__line\">@for (span of row; track $index) {<span\n [style.color]=\"span.color\"\n [style.font-style]=\"span.fontStyle === 'italic' ? 'italic' : null\"\n [style.font-weight]=\"span.fontStyle === 'bold' ? 'bold' : null\"\n [style.text-decoration]=\"span.fontStyle === 'underline' ? 'underline' : null\"\n >{{ span.text }}</span>}</span>@if (!$last) {{{ newline }}}}} @else {{{ block.code }}}</code></pre>\n\n @if (resolvedCopyable() && block.closed) {\n <button\n type=\"button\"\n class=\"wr-markdown__copy\"\n [wrCopyToClipboard]=\"block.code\"\n [attr.aria-label]=\"isCopied(block) ? resolvedCopiedLabel() : resolvedCopyLabel()\"\n (copied)=\"onCopied(block)\"\n >\n <svg\n class=\"wr-markdown__copy-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @if (isCopied(block)) {\n <path d=\"M20 6 9 17l-5-5\" />\n } @else {\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n }\n </svg>\n </button>\n }\n </div>\n }\n @case ('quote') {\n <blockquote class=\"wr-markdown__quote\">\n <ng-container\n [ngTemplateOutlet]=\"blockList\"\n [ngTemplateOutletContext]=\"{ $implicit: block.children, tight: false }\"\n />\n </blockquote>\n }\n @case ('list') {\n @if (block.ordered) {\n <ol\n class=\"wr-markdown__list wr-markdown__list--ordered\"\n [attr.start]=\"block.start === 1 ? null : block.start\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemList\"\n [ngTemplateOutletContext]=\"{ $implicit: block.items, tight: block.tight }\"\n />\n </ol>\n } @else {\n <ul class=\"wr-markdown__list\">\n <ng-container\n [ngTemplateOutlet]=\"itemList\"\n [ngTemplateOutletContext]=\"{ $implicit: block.items, tight: block.tight }\"\n />\n </ul>\n }\n }\n @case ('table') {\n <!-- Its own scroller: a wide table must not push the page sideways, which\n is also what keeps the RTL layout gate quiet about it. -->\n <div class=\"wr-markdown__table-scroll\" tabindex=\"0\">\n <table class=\"wr-markdown__table\">\n <thead>\n <tr>\n @for (cell of block.head; track column; let column = $index) {\n <th class=\"wr-markdown__th\" scope=\"col\" [style.text-align]=\"block.align[column]\">\n <ng-container\n [ngTemplateOutlet]=\"inlineList\"\n [ngTemplateOutletContext]=\"{ $implicit: cell.inlines }\"\n />\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of block.rows; track $index) {\n <tr>\n @for (cell of asCells(row); track column; let column = $index) {\n <td class=\"wr-markdown__td\" [style.text-align]=\"block.align[column]\">\n <ng-container\n [ngTemplateOutlet]=\"inlineList\"\n [ngTemplateOutletContext]=\"{ $implicit: cell.inlines }\"\n />\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n }\n @case ('rule') {\n <hr class=\"wr-markdown__rule\" />\n }\n }\n }\n</ng-template>\n\n<ng-container [ngTemplateOutlet]=\"blockList\" [ngTemplateOutletContext]=\"{ $implicit: blocks(), tight: false }\" />\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type {\n WrMarkdownAlign,\n WrMarkdownBlock,\n WrMarkdownCell,\n WrMarkdownInline,\n WrMarkdownListItem,\n} from './interfaces';\nimport {\n AUTOLINK_RE,\n EMAIL_AUTOLINK_RE,\n MAX_DESTINATION_NESTING,\n MAX_LABEL_LENGTH,\n MAX_TABLE_COLUMNS,\n QUOTE_RE,\n RULE_RE,\n TABLE_DELIM_RE,\n codeSpanValue,\n interruptsParagraph,\n isTableStart,\n matchListStart,\n safeMarkdownUrl,\n startsBlock,\n} from './parse-markdown';\n\n/**\n * A block tree back to markdown — the inverse of {@link parseMarkdown}.\n *\n * **Written against this library's parser, not against CommonMark.** The two\n * disagree in places (no setext headings, no indented code, no entities, a\n * simplified reading of emphasis), and a serializer that escapes for the wrong\n * dialect writes text that comes back as something else. So every escape here is\n * derived from a question `parseMarkdown` actually asks — several of them by\n * calling the parser's own predicates — and the spec holds the pair to one\n * property: `parseMarkdown(serializeMarkdown(tree))` returns `tree`.\n *\n * **What markdown cannot say is normalised, never guessed at.** The output is the\n * nearest document this dialect can express, and reading it back gives a tree\n * that serializes to the same string. The losses, all of them structural:\n *\n * - Whitespace at the edges of a paragraph, heading or cell is dropped, and so is\n * whitespace just inside `**` / `*` / `~~` — a delimiter next to a space is not\n * a delimiter. A soft line break inside a text node becomes a space, and a hard\n * break at the very end of a block (a trailing `\\` stays literal) is dropped;\n * inside a heading or a table cell every hard break becomes a space.\n * - An empty paragraph, an empty list and a table with no header cell vanish.\n * - Two adjacent lists of the same kind merge on the way back — there is no\n * raw-HTML comment to put between them. A single-item list with one block\n * cannot be loose, and a loose list nested in a tight one loosens it. Nesting\n * deeper than the parser's twelve levels reads back as text.\n * - Inline marks are rewritten in one canonical nesting — link outside strong\n * outside strikethrough outside emphasis — which is also how a mark SET, the\n * shape an editor holds, becomes a tree. An image carries no emphasis (none of\n * it paints on an image); where an emphasis run touches a strong one and\n * neither can switch to `_`, the emphasis is dropped rather than written as\n * markup that reads back as literal asterisks.\n * - A link or image whose URL `safeMarkdownUrl` refuses is written as its text,\n * exactly as the renderer would show it. A destination is percent-encoded\n * where this parser cannot carry a character (`<`, `>`, an unbalanced\n * parenthesis, a `\\` it would read as an escape — and `[`, `]`, a backtick for\n * an image inside a link label), loses a tab or line break the way a browser's\n * URL parser does, a title that cannot be delimited is dropped, and a link\n * whose label is too long for the parser's label cap is written as plain text.\n * - A fence's info string keeps its first word, lowercased, and `closed` is not\n * written: a serialized fence is always closed. A tab that indents a line reads\n * back as four spaces, as the parser expands it. Heading ids are the parser's,\n * recomputed on the way back.\n *\n * @param blocks a block tree, typically from {@link parseMarkdown} or an editor\n * @returns markdown, with no trailing newline; `''` for an empty tree\n */\nfunction serializeMarkdown(blocks: readonly WrMarkdownBlock[]): string {\n return joinBlocks(blocks.map(renderBlock), false);\n}\n\n/** A block and the markdown it rendered to — the join between two needs both. */\ninterface Rendered {\n readonly block: WrMarkdownBlock;\n readonly text: string;\n}\n\n/** The largest number `LIST_RE` reads as an ordinal: `\\d{1,9}`. */\nconst MAX_ORDINAL = 999999999;\n\nconst DELIMITER_ROW: Readonly<Record<NonNullable<WrMarkdownAlign> | 'none', string>> = {\n start: ':--',\n center: ':-:',\n end: '--:',\n none: '---',\n};\n\nfunction renderBlock(block: WrMarkdownBlock): Rendered | null {\n const text = blockText(block);\n\n return text ? { block, text } : null;\n}\n\nfunction blockText(block: WrMarkdownBlock): string {\n switch (block.kind) {\n case 'paragraph':\n return inlineMarkdown(block.inlines, 'paragraph').split('\\n').map(escapeLineStart).join('\\n');\n case 'heading':\n return headingText(block.level, block.inlines);\n case 'code':\n return codeBlock(block.language, block.code);\n case 'quote': {\n const body = joinBlocks(block.children.map(renderBlock), false);\n // A lone `>` is how an empty quote is written, and it reads back as one.\n return body\n .split('\\n')\n .map(line => (line ? `> ${line}` : '>'))\n .join('\\n');\n }\n case 'list':\n return listText(block.ordered, block.start, block.tight, block.items);\n case 'table':\n return tableText(block.head, block.rows, block.align);\n case 'rule':\n return '---';\n }\n}\n\n/**\n * Blocks joined the way the parser will split them again.\n *\n * A blank line is the safe separator, and between two siblings at one level it is\n * always correct but for one case: a blank line followed by ANY list marker marks\n * the list before it loose, even when the marker starts a list of the other kind.\n * So a tight list that is followed by a list is joined by a single newline. Inside\n * a tight list item a single newline is wanted everywhere, and is used wherever\n * the parser would still end the first block there.\n */\nfunction joinBlocks(parts: readonly (Rendered | null)[], tight: boolean): string {\n let out = '';\n let previous: Rendered | null = null;\n\n for (const part of parts) {\n if (!part) continue;\n if (previous) out += separator(previous, part, tight);\n out += part.text;\n previous = part;\n }\n\n return out;\n}\n\nfunction separator(previous: Rendered, next: Rendered, tight: boolean): string {\n const tightList = previous.block.kind === 'list' && !previous.text.includes('\\n\\n');\n if (tightList && next.block.kind === 'list') return '\\n';\n\n return tight && endsBefore(previous, next) ? '\\n' : '\\n\\n';\n}\n\n/**\n * Does `previous` end where `next` begins, with no blank line between them?\n *\n * Each case is the parser's own stopping rule, asked through its own predicates: a\n * paragraph runs until a line interrupts it, a quote swallows any line that does\n * not start a block (lazy continuation), a list swallows the same and continues on\n * a marker of its own kind, and a table runs while a line has a pipe. A heading, a\n * rule and a closed fence end themselves.\n */\nfunction endsBefore(previous: Rendered, next: Rendered): boolean {\n const lines = next.text.split('\\n');\n const first = lines[0];\n\n switch (previous.block.kind) {\n case 'paragraph': {\n // A last line holding a pipe, over a `---`, is a table header and its\n // delimiter row — which is the parser's answer before it asks anything else.\n const last = previous.text.slice(previous.text.lastIndexOf('\\n') + 1);\n return (interruptsParagraph(first) || isTableStart(lines, 0)) && !isTableStart([last, first], 0);\n }\n case 'quote':\n return startsBlock(first) && !QUOTE_RE.test(first);\n case 'list': {\n const start = matchListStart(first);\n return startsBlock(first) && (!start || RULE_RE.test(first) || start.ordered !== previous.block.ordered);\n }\n case 'table':\n return !first.includes('|') || startsBlock(first);\n default:\n return true;\n }\n}\n\nfunction headingText(level: number, inlines: readonly WrMarkdownInline[]): string {\n const hashes = '#'.repeat(Math.min(Math.max(Math.trunc(level) || 1, 1), 6));\n // A `#` run at the end, after whitespace, is a closing sequence and the parser\n // strips it — `# Issue #` would come back as \"Issue\". `# C#` keeps its sharp.\n const text = inlineMarkdown(inlines, 'heading').replace(/(^|[ \\t])(#*)#$/, '$1$2\\\\#');\n\n return text ? `${hashes} ${text}` : hashes;\n}\n\nfunction codeBlock(language: string | null, raw: string): string {\n const info = (language ?? '').trim().split(/\\s+/)[0].toLowerCase();\n // A backtick fence absorbs an info string that starts with a backtick into its\n // own run, so that one info string takes a tilde fence instead.\n const char = info.startsWith('`') ? '~' : '`';\n const code = raw.replace(/\\r\\n?/g, '\\n');\n // Longer than any run of the fence character anywhere in the code, so no line\n // of it can close the fence early.\n const longest = (code.match(char === '`' ? /`+/g : /~+/g) ?? []).reduce((max, run) => Math.max(max, run.length), 0);\n const fence = char.repeat(Math.max(3, longest + 1));\n\n return code ? `${fence}${info}\\n${code}\\n${fence}` : `${fence}${info}\\n${fence}`;\n}\n\nfunction listText(ordered: boolean, start: number, tight: boolean, items: readonly WrMarkdownListItem[]): string {\n const first = Math.min(Math.max(Math.trunc(start) || 0, 0), MAX_ORDINAL);\n\n return items\n .map((item, index) => listItem(item, ordered ? `${Math.min(first + index, MAX_ORDINAL)}. ` : '- ', tight))\n .join(tight ? '\\n' : '\\n\\n');\n}\n\nfunction listItem(item: WrMarkdownListItem, marker: string, tight: boolean): string {\n const task = item.checked === null ? '' : item.checked ? '[x] ' : '[ ] ';\n const bare = (marker + task).trimEnd();\n const body = joinBlocks(item.children.map(renderBlock), tight);\n\n if (!body) return bare;\n\n // Continuation lines sit at the item's content column, which for `- ` is 2 and\n // for `10. ` is 4 — the parser dedents by exactly the marker's width.\n const pad = ' '.repeat(marker.length);\n const lines = body.split('\\n');\n const head = marker + task + lines[0];\n const indented = (rest: readonly string[]): string[] => rest.map(line => (line ? pad + line : line));\n\n // `- ---` is a thematic break, not an item holding one, so a first line that\n // would read that way moves under a bare marker.\n return RULE_RE.test(head) ? [bare, ...indented(lines)].join('\\n') : [head, ...indented(lines.slice(1))].join('\\n');\n}\n\nfunction tableText(\n head: readonly WrMarkdownCell[],\n rows: readonly (readonly WrMarkdownCell[])[],\n align: readonly WrMarkdownAlign[]\n): string {\n const width = Math.min(head.length, MAX_TABLE_COLUMNS);\n if (!width) return '';\n\n const columns = Array.from({ length: width }, (_, index) => index);\n const row = (cells: readonly WrMarkdownCell[]): string =>\n `| ${columns.map(index => cellText(cells[index]?.inlines ?? [])).join(' | ')} |`;\n const delimiter = `| ${columns.map(index => DELIMITER_ROW[align[index] ?? 'none']).join(' | ')} |`;\n\n return [row(head), delimiter, ...rows.map(row)].join('\\n');\n}\n\n/**\n * A cell's inline markdown with every pipe escaped — inside code spans, URLs and\n * titles too. The row is split on pipes BEFORE any inline parsing, and the split\n * turns `\\|` into `|` and touches nothing else, so escaping every pipe is its\n * exact inverse.\n */\nfunction cellText(inlines: readonly WrMarkdownInline[]): string {\n return inlineMarkdown(inlines, 'cell').replace(/\\|/g, '\\\\|');\n}\n\n/**\n * A backslash before the first character of a line that would otherwise start a\n * block, or turn the line above it into a table header.\n *\n * Every such character is ASCII punctuation, which the parser unescapes, except\n * the digits of an ordered marker — there the delimiter is escaped instead,\n * `1986\\.`. The test runs on the line as the parser will see it, with indent tabs\n * expanded, because the parser expands them before it looks.\n */\nfunction escapeLineStart(line: string): string {\n const indent = /^[ \\t]*/.exec(line)![0];\n const probe = indent.replace(/\\t/g, ' ') + line.slice(indent.length);\n\n if (!startsBlock(probe) && !TABLE_DELIM_RE.test(probe)) return line;\n\n const ordinal = /^\\d{1,9}(?=[.)])/.exec(line.slice(indent.length));\n const at = indent.length + (ordinal ? ordinal[0].length : 0);\n\n return `${line.slice(0, at)}\\\\${line.slice(at)}`;\n}\n\n// ---------------------------------------------------------------------------\n// Inline\n// ---------------------------------------------------------------------------\n\n/** Where a run of inline content is written; only a paragraph can hold a line break. */\ntype InlineContext = 'paragraph' | 'heading' | 'cell';\n\ninterface LinkMark {\n readonly href: string;\n readonly title: string | null;\n}\n\n/**\n * The marks on one leaf — the shape an editor holds. Nesting is decided later, in\n * one canonical order, which is what makes two trees that paint the same text\n * serialize to the same string.\n */\ninterface Marks {\n readonly link: LinkMark | null;\n readonly strong: boolean;\n readonly del: boolean;\n readonly em: boolean;\n}\n\ntype Leaf =\n | { readonly kind: 'text' | 'code'; readonly value: string; readonly marks: Marks }\n | {\n readonly kind: 'image';\n readonly src: string;\n readonly alt: string;\n readonly title: string | null;\n readonly marks: Marks;\n }\n | { readonly kind: 'break'; readonly marks: Marks };\n\ntype Emphasis = 'strong' | 'del' | 'em';\n\ntype Tree =\n | Leaf\n | {\n readonly kind: 'link';\n readonly link: LinkMark;\n /** The leaves it wraps, by index — what to unwrap if the label is too long. */\n readonly from: number;\n readonly to: number;\n readonly children: readonly Tree[];\n }\n | { readonly kind: Emphasis; readonly children: readonly Tree[] };\n\n/** Outermost first. Emphasis never contains strong, which is the nesting `*x **y** z*` breaks on. */\nconst LEVELS = ['link', 'strong', 'del', 'em'] as const;\nconst EMPHASIS: readonly Emphasis[] = ['strong', 'del', 'em'];\nconst NO_MARKS: Marks = { link: null, strong: false, del: false, em: false };\n/** The parser's own \"word character\" for `_` flanking. */\nconst WORD_CHAR = /[\\p{L}\\p{N}]/u;\n/** A soft break and the indentation around it: whitespace once rendered. */\nconst SOFT_BREAK_RE = /\\s*[\\r\\n]\\s*/g;\n/** What another renderer would decode as an entity; this one does not, so `\\&` keeps it literal everywhere. */\nconst ENTITY_RE = /^&(?:#\\d+|#x[\\da-f]+|[a-z][a-z\\d]*);/i;\n\nfunction inlineMarkdown(nodes: readonly WrMarkdownInline[], context: InlineContext): string {\n let leaves = settle(flatten(nodes, NO_MARKS, context, []), context);\n\n // A link whose label is past the parser's cap is not a link on the way back.\n // Its leaves lose the mark and the run is laid out again, since unwrapping it\n // can put two emphasis runs next to each other.\n for (;;) {\n const state: RenderState = { tooLong: null };\n const out = renderNodes(group(leaves, 0, 0), state);\n if (!state.tooLong) return out;\n\n const [from, to] = state.tooLong;\n leaves = settle(\n leaves.map((leaf, index) =>\n index >= from && index < to ? { ...leaf, marks: { ...leaf.marks, link: null } } : leaf\n ),\n context\n );\n }\n}\n\nfunction flatten(nodes: readonly WrMarkdownInline[], marks: Marks, context: InlineContext, out: Leaf[]): Leaf[] {\n for (const node of nodes) {\n switch (node.kind) {\n case 'text':\n out.push({ kind: 'text', value: node.value.replace(SOFT_BREAK_RE, ' '), marks });\n break;\n case 'code':\n // The parser reads a newline inside a code span as a space.\n out.push({ kind: 'code', value: node.value.replace(/\\r\\n?|\\n/g, ' '), marks });\n break;\n case 'break':\n out.push(context === 'paragraph' ? { kind: 'break', marks } : { kind: 'text', value: ' ', marks });\n break;\n case 'image': {\n const src = safeMarkdownUrl(node.src, 'image');\n const alt = node.alt.replace(SOFT_BREAK_RE, ' ');\n const inLabel = marks.link !== null;\n // A refused source renders its alt as text, so that is what is written.\n out.push(\n src\n ? {\n kind: 'image',\n src: encodeUrl(src, inLabel),\n alt,\n title: writableTitle(node.title, inLabel),\n marks: { ...NO_MARKS, link: marks.link },\n }\n : { kind: 'text', value: alt, marks }\n );\n break;\n }\n case 'link': {\n // No link inside a link, and no link the reader would refuse anyway. The\n // attributes are stored as they will be WRITTEN, so two links that differ\n // only in what cannot be written are one link here, as they will be on the\n // way back.\n const href = marks.link ? null : safeMarkdownUrl(node.href, 'link');\n const next = href\n ? { ...marks, link: { href: encodeUrl(href, false), title: writableTitle(node.title, false) } }\n : marks;\n flatten(node.children, next, context, out);\n break;\n }\n default:\n flatten(node.children, { ...marks, [node.kind]: true }, context, out);\n }\n }\n\n return out;\n}\n\n/**\n * The leaves in canonical form: merged, with whitespace outside emphasis, trimmed\n * at the block's edges, and no code span that would open a line as a fence.\n */\nfunction settle(leaves: readonly Leaf[], context: InlineContext): Leaf[] {\n let current = leaves;\n\n // A code span turned into text can bring a space to the edge of a node, so the\n // pass runs again until nothing more is unfenced.\n for (;;) {\n const out = trimBlock(merge(moveEdgesOut(merge(current))));\n if (context !== 'paragraph') return out;\n\n const unfenced = unfence(out);\n if (unfenced.every((leaf, index) => leaf === out[index])) return out;\n current = unfenced;\n }\n}\n\nfunction sameLink(a: LinkMark | null, b: LinkMark | null): boolean {\n return a === b || (!!a && !!b && a.href === b.href && a.title === b.title);\n}\n\nfunction sameMarks(a: Marks, b: Marks): boolean {\n return a.strong === b.strong && a.del === b.del && a.em === b.em && sameLink(a.link, b.link);\n}\n\n/** Adjacent text (or code) with the same marks is one node; an empty one is none. */\nfunction merge(leaves: readonly Leaf[]): Leaf[] {\n const out: Leaf[] = [];\n\n for (const leaf of leaves) {\n if ((leaf.kind === 'text' || leaf.kind === 'code') && !leaf.value) continue;\n\n const last = out[out.length - 1];\n if (\n last &&\n (last.kind === 'text' || last.kind === 'code') &&\n last.kind === leaf.kind &&\n sameMarks(last.marks, leaf.marks)\n ) {\n out[out.length - 1] = { ...last, value: last.value + leaf.value };\n } else {\n out.push(leaf);\n }\n }\n\n return out;\n}\n\n/**\n * Whitespace and hard breaks at the edge of an emphasis run lose that mark.\n *\n * The parser refuses an opener followed by whitespace and a closer preceded by it,\n * so `** bold **` is literal asterisks; the same text written `**bold**` with the\n * spaces outside is what was meant. A link keeps its edges — `[` and `]` have no\n * flanking rule.\n *\n * The unit is the NODE the mark will become, not the run of leaves carrying it:\n * the canonical nesting cuts a strong run wherever a link begins or ends, and an\n * emphasis run wherever strong or strikethrough changes, and each piece gets\n * delimiters of its own. Outer marks go first, so an inner node is measured\n * against leaves that are already final.\n */\nfunction moveEdgesOut(leaves: readonly Leaf[]): Leaf[] {\n let out = [...leaves];\n\n for (const mark of EMPHASIS) {\n const outer = EMPHASIS.slice(0, EMPHASIS.indexOf(mark));\n const sameNode = (a: Leaf, b: Leaf): boolean =>\n b.marks[mark] && sameLink(a.marks.link, b.marks.link) && outer.every(name => a.marks[name] === b.marks[name]);\n const next: Leaf[] = [];\n let i = 0;\n\n while (i < out.length) {\n if (!out[i].marks[mark]) {\n next.push(out[i]);\n i++;\n continue;\n }\n\n let j = i;\n while (j < out.length && sameNode(out[i], out[j])) j++;\n next.push(...trimRun(out.slice(i, j), mark));\n i = j;\n }\n\n out = next;\n }\n\n return out;\n}\n\nfunction trimRun(run: readonly Leaf[], mark: Emphasis): Leaf[] {\n const body = [...run];\n const head: Leaf[] = [];\n const tail: Leaf[] = [];\n const unmark = <T extends Leaf>(leaf: T): T => ({ ...leaf, marks: { ...leaf.marks, [mark]: false } });\n\n while (body.length) {\n const leaf = body[0];\n if (leaf.kind === 'break') {\n head.push(unmark(leaf));\n body.shift();\n continue;\n }\n if (leaf.kind !== 'text') break;\n\n const space = /^\\s*/.exec(leaf.value)![0];\n if (!space) break;\n head.push(unmark({ ...leaf, value: space }));\n if (space.length < leaf.value.length) {\n body[0] = { ...leaf, value: leaf.value.slice(space.length) };\n break;\n }\n body.shift();\n }\n\n while (body.length) {\n const leaf = body[body.length - 1];\n if (leaf.kind === 'break') {\n tail.unshift(unmark(leaf));\n body.pop();\n continue;\n }\n if (leaf.kind !== 'text') break;\n\n const space = /\\s*$/.exec(leaf.value)![0];\n if (!space) break;\n tail.unshift(unmark({ ...leaf, value: space }));\n if (space.length < leaf.value.length) {\n body[body.length - 1] = { ...leaf, value: leaf.value.slice(0, -space.length) };\n break;\n }\n body.pop();\n }\n\n return [...head, ...body, ...tail];\n}\n\n/**\n * What the parser's trim would take anyway: leading whitespace, and trailing\n * whitespace and hard breaks (a `\\` at the end of a block stays a literal\n * backslash). Content inside a link label is past its reach and stays.\n */\nfunction trimBlock(leaves: readonly Leaf[]): Leaf[] {\n const out = [...leaves];\n let start = 0;\n let end = out.length;\n\n while (start < end) {\n const leaf = out[start];\n if (leaf.kind !== 'text' || leaf.marks.link) break;\n\n const value = leaf.value.replace(/^\\s+/, '');\n if (value) {\n out[start] = { ...leaf, value };\n break;\n }\n start++;\n }\n\n while (end > start) {\n const leaf = out[end - 1];\n if (leaf.marks.link || (leaf.kind !== 'text' && leaf.kind !== 'break')) break;\n if (leaf.kind === 'break') {\n end--;\n continue;\n }\n\n const value = leaf.value.replace(/\\s+$/, '');\n if (value) {\n out[end - 1] = { ...leaf, value };\n break;\n }\n end--;\n }\n\n return out.slice(start, end);\n}\n\n/**\n * A code span that opens a paragraph line and needs three or more backticks would\n * read back as a fence. Nothing can be put in front of it, so it keeps its text\n * and loses the code mark. It takes a value holding both a single and a double\n * backtick run to get here.\n */\nfunction unfence(leaves: readonly Leaf[]): Leaf[] {\n const blank = (leaf: Leaf): boolean => leaf.kind === 'text' && !leaf.value.trim();\n\n return leaves.map((leaf, index) => {\n if (leaf.kind !== 'code' || ticks(leaf.value) < 3) return leaf;\n\n let k = index - 1;\n while (k >= 0 && blank(leaves[k])) {\n if (!sameMarks(leaves[k].marks, leaf.marks)) return leaf;\n k--;\n }\n\n const opensLine =\n k < 0 ? sameMarks(leaf.marks, NO_MARKS) : leaves[k].kind === 'break' && sameMarks(leaves[k].marks, leaf.marks);\n\n return opensLine ? { kind: 'text', value: leaf.value, marks: leaf.marks } : leaf;\n });\n}\n\n/**\n * Leaves to a tree, one mark level at a time in {@link LEVELS} order: a maximal\n * run sharing the mark becomes one node, and what is inside it is grouped by the\n * next level. Two leaves painted the same way always land in the same shape.\n */\nfunction group(leaves: readonly Leaf[], level: number, offset: number): Tree[] {\n if (level === LEVELS.length) return [...leaves];\n\n const mark = LEVELS[level];\n const key = (leaf: Leaf): LinkMark | boolean | null => (mark === 'link' ? leaf.marks.link : leaf.marks[mark]);\n const same = (a: Leaf, b: Leaf): boolean =>\n mark === 'link' ? sameLink(a.marks.link, b.marks.link) : a.marks[mark] === b.marks[mark];\n const out: Tree[] = [];\n let i = 0;\n\n while (i < leaves.length) {\n let j = i + 1;\n while (j < leaves.length && same(leaves[i], leaves[j])) j++;\n\n const children = group(leaves.slice(i, j), level + 1, offset + i);\n const on = key(leaves[i]);\n if (!on) {\n out.push(...children);\n } else if (mark === 'link') {\n out.push({ kind: 'link', link: on as LinkMark, from: offset + i, to: offset + j, children });\n } else {\n out.push({ kind: mark, children });\n }\n i = j;\n }\n\n return out;\n}\n\ninterface RenderState {\n /** Leaf range of the first link found with a label past the parser's cap. */\n tooLong: readonly [number, number] | null;\n}\n\nfunction renderNodes(nodes: readonly Tree[], state: RenderState): string {\n const [list, chars] = delimiters(nodes);\n let out = '';\n\n list.forEach((node, index) => {\n out += renderNode(node, chars[index], list[index + 1], state);\n });\n\n return out;\n}\n\nfunction renderNode(node: Tree, char: string | null, next: Tree | undefined, state: RenderState): string {\n switch (node.kind) {\n case 'text':\n return escapeText(node.value, next?.kind === 'link');\n case 'code':\n return codeSpan(node.value);\n case 'break':\n return '\\\\\\n';\n case 'image':\n return `![${escapeText(node.alt, false)}](${destination(node.src, node.title)})`;\n case 'link': {\n const auto = autolink(node.link, node.children);\n if (auto) return auto;\n\n const label = renderNodes(node.children, state);\n if (label.length >= MAX_LABEL_LENGTH) {\n state.tooLong ??= [node.from, node.to];\n return label;\n }\n return `[${label}](${destination(node.link.href, node.link.title)})`;\n }\n case 'del':\n return `~~${renderNodes(node.children, state)}~~`;\n default: {\n const delimiter = node.kind === 'strong' ? char!.repeat(2) : char!;\n return delimiter + renderNodes(node.children, state) + delimiter;\n }\n }\n}\n\n/**\n * The delimiter character of every strong and emphasis node in a sibling list.\n *\n * `*` unless it would touch another `*` run: `*a***b**` reads as one run of three\n * and parses wrong. The canonical nesting means the only neighbours that can clash\n * are an emphasis and a strong, so one of them switches to `_` — the emphasis\n * first — where `_` flanking allows it: no letter or digit against it from\n * outside, and no `_` neighbour to clash with in turn. Where neither can switch,\n * the emphasis is dropped and the list is laid out again; its children are\n * leaves, so the drop cannot create a clash of its own.\n */\nfunction delimiters(nodes: readonly Tree[]): [readonly Tree[], readonly (string | null)[]] {\n let list = nodes;\n\n for (;;) {\n const chars = list.map(node => (node.kind === 'strong' || node.kind === 'em' ? '*' : null));\n const drop = settleClashes(list, chars);\n if (drop < 0) return [list, chars];\n\n const dropped = list[drop] as { readonly children: readonly Tree[] };\n list = [...list.slice(0, drop), ...dropped.children, ...list.slice(drop + 1)];\n }\n}\n\n/** Index of an emphasis node to drop, or -1 once every clash is settled. */\nfunction settleClashes(list: readonly Tree[], chars: (string | null)[]): number {\n for (let i = 0; i + 1 < list.length; i++) {\n if (!chars[i] || chars[i] !== chars[i + 1]) continue;\n\n const emFirst = list[i].kind === 'em';\n const switched = (emFirst ? [i, i + 1] : [i + 1, i]).find(k => canUnderscore(list, chars, k));\n if (switched === undefined) return emFirst ? i : i + 1;\n chars[switched] = '_';\n }\n\n return -1;\n}\n\nfunction canUnderscore(list: readonly Tree[], chars: readonly (string | null)[], k: number): boolean {\n const before = k > 0 ? edgeChar(list[k - 1], chars[k - 1], 'end') : '';\n const after = k + 1 < list.length ? edgeChar(list[k + 1], chars[k + 1], 'start') : '';\n\n return chars[k - 1] !== '_' && chars[k + 1] !== '_' && !WORD_CHAR.test(before) && !WORD_CHAR.test(after);\n}\n\n/**\n * The character a node puts next to its neighbour — only ever asked whether it is\n * a letter or a digit. Escaping inserts a backslash before punctuation and never\n * before a word character, so the raw text answers that question for text.\n */\nfunction edgeChar(node: Tree, char: string | null, side: 'start' | 'end'): string {\n switch (node.kind) {\n case 'text':\n return side === 'start' ? node.value[0] : node.value[node.value.length - 1];\n case 'strong':\n case 'em':\n return char ?? '';\n default:\n return '';\n }\n}\n\n/**\n * Text with every character the parser would read as syntax escaped — and no\n * more, so prose stays prose. `snake_case` keeps its underscores, `2 * 3` its\n * star, `a < b` its bracket: in those positions the parser can never read them as\n * markup. The ends of the string are treated as the worst case, since whatever is\n * written next to it is not known here.\n */\nfunction escapeText(value: string, beforeLink: boolean): string {\n let out = '';\n\n for (let i = 0; i < value.length; i++) {\n const char = value[i];\n if (mustEscape(value, i, beforeLink)) out += '\\\\';\n out += char;\n }\n\n // A bare URL in plain text would come back as a link. The escaped colon is\n // invisible once parsed, and it stops `BARE_URL_RE` from matching.\n return out.replace(/(https?):(?=\\/\\/)/gi, '$1\\\\:');\n}\n\nfunction mustEscape(value: string, i: number, beforeLink: boolean): boolean {\n const prev = value[i - 1] as string | undefined;\n const next = value[i + 1] as string | undefined;\n const space = (c: string | undefined): boolean => c !== undefined && /\\s/.test(c);\n const word = (c: string | undefined): boolean => c !== undefined && WORD_CHAR.test(c);\n\n switch (value[i]) {\n case '\\\\':\n case '`':\n case '[':\n case ']':\n return true;\n // Between two spaces a star can neither open (followed by whitespace) nor\n // close (preceded by it).\n case '*':\n return !(space(prev) && space(next));\n // Between two word characters an underscore is never a delimiter.\n case '_':\n return !(word(prev) && word(next));\n // Strikethrough needs a pair; a single tilde between other characters is text.\n case '~':\n return prev === undefined || prev === '~' || next === undefined || next === '~';\n // An autolink needs a scheme or an address right after the bracket.\n case '<':\n return !space(next);\n // `!` followed by a link's `[` would turn the link into an image.\n case '!':\n return beforeLink && next === undefined;\n case '&':\n return ENTITY_RE.test(value.slice(i));\n default:\n return false;\n }\n}\n\n/** The shortest backtick run that does not occur inside the value. */\nfunction ticks(value: string): number {\n const runs = new Set((value.match(/`+/g) ?? []).map(run => run.length));\n let length = 1;\n while (runs.has(length)) length++;\n\n return length;\n}\n\n/**\n * A code span, padded where the parser would otherwise eat a character: it strips\n * one space from each end when both are present, and a backtick at either end\n * would merge into the fence.\n */\nfunction codeSpan(value: string): string {\n const fence = '`'.repeat(ticks(value));\n const pad = codeSpanValue(value) !== value || value.startsWith('`') || value.endsWith('`');\n\n return pad ? `${fence} ${value} ${fence}` : `${fence}${value}${fence}`;\n}\n\n/** `<https://…>` or `<name@host>` when the label IS the address — the form the parser reads back identically. */\nfunction autolink(link: LinkMark, children: readonly Tree[]): string | null {\n const only = children.length === 1 ? children[0] : null;\n if (link.title !== null || only?.kind !== 'text') return null;\n\n const whole = (re: RegExp, value: string): boolean => re.exec(`<${value}>`)?.[0].length === value.length + 2;\n\n if (only.value === link.href && whole(AUTOLINK_RE, link.href)) return `<${link.href}>`;\n if (`mailto:${only.value}` === link.href && whole(EMAIL_AUTOLINK_RE, only.value)) return `<${only.value}>`;\n\n return null;\n}\n\n/**\n * A URL as this parser will read it back, and as a browser resolves it.\n *\n * The destination scan counts parentheses and ends at a line break, so an angle\n * bracket and an unbalanced parenthesis are percent-encoded — to a browser the\n * same address. A tab or a line break is removed rather than encoded: the URL\n * parser strips them, so the address never had them, and `%0A` would be a\n * different one. A backslash is kept as it is — the parser keeps it, and in an\n * http(s) URL a browser reads it as `/`, which `%5C` is not — except where the\n * scan would take it for an escape and skip what follows: before a parenthesis,\n * and at the very end, where it would swallow the closing one. Inside a link label\n * the label scan also runs over an image's destination, so its brackets and\n * backticks are encoded too. Spaces are not encoded: {@link destination} carries\n * them in the `<…>` form.\n */\nfunction encodeUrl(url: string, inLabel: boolean): string {\n const out = url\n .replace(/[\\t\\r\\n]/g, '')\n .replace(/\\\\(?=[()]|$)/g, percent)\n .replace(inLabel ? /[<>[\\]`]/g : /[<>]/g, percent);\n\n return balanced(out) ? out : out.replace(/[()]/g, percent);\n}\n\nfunction percent(char: string): string {\n return `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(2, '0')}`;\n}\n\n/** Parentheses the destination scan accepts: balanced, never closing early, and under its nesting cap. */\nfunction balanced(url: string): boolean {\n let depth = 0;\n\n for (const char of url) {\n if (char === '(' && ++depth >= MAX_DESTINATION_NESTING) return false;\n if (char === ')' && --depth < 0) return false;\n }\n\n return depth === 0;\n}\n\n/**\n * The title as it can be written, or `null` when it cannot: a line break becomes a\n * space, and the destination scan runs through the title counting parentheses (a\n * backslash skipping the next character), so one that would close the scan early\n * or leave it open is dropped. Inside a link label the label scan runs through it\n * as well, so a bracket, a backtick or a backslash drops it there.\n */\nfunction writableTitle(raw: string | null, inLabel: boolean): string | null {\n if (raw === null) return null;\n\n const title = raw.replace(SOFT_BREAK_RE, ' ');\n if (inLabel && /[[\\]`\\\\]/.test(title)) return null;\n\n let depth = 1;\n for (let i = 0; i < title.length; i++) {\n const char = title[i];\n if (char === '\\\\') {\n i++;\n continue;\n }\n if (char === '(' && ++depth > MAX_DESTINATION_NESTING) return null;\n if (char === ')' && --depth === 0) return null;\n }\n\n return depth === 1 ? title : null;\n}\n\n/** An encoded URL and a writable title, inside the parentheses. */\nfunction destination(url: string, title: string | null): string {\n const target = /\\s/.test(url) ? `<${url}>` : url;\n\n return title === null ? target : `${target} \"${title}\"`;\n}\n\nexport { serializeMarkdown };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport type { WrMarkdownHighlighter } from './interfaces';\nimport { WR_MARKDOWN_HIGHLIGHTER } from './tokens';\n\n/**\n * Give every `<wr-markdown>` in the app a syntax highlighter.\n *\n * The highlighter returns coloured SPANS, not HTML — see\n * {@link WrMarkdownHighlighter} for why that signature is the one worth having.\n * It may be async, and it may return `null` for languages it does not know; both\n * render the block as plain text, which is also what server-side rendering\n * produces, since a highlighter that resolves after prerender has already\n * finished cannot contribute to the HTML.\n *\n * Pass `{ useFactory }` when the adapter needs to inject something. A highlighter\n * is itself a function, so the factory cannot be detected by shape — hence the\n * wrapper object rather than an overload that would guess.\n *\n * @example\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideWrMarkdownHighlighter(shikiSpans),\n *\n * // Or, when the adapter has dependencies of its own:\n * provideWrMarkdownHighlighter({\n * useFactory: () => {\n * const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n * return (code, language) => (isBrowser ? shikiSpans(code, language) : null);\n * },\n * }),\n * ],\n * });\n * ```\n */\nexport function provideWrMarkdownHighlighter(\n highlighter: WrMarkdownHighlighter | { readonly useFactory: () => WrMarkdownHighlighter }\n): EnvironmentProviders {\n if (typeof highlighter === 'function') {\n return makeEnvironmentProviders([{ provide: WR_MARKDOWN_HIGHLIGHTER, useValue: highlighter }]);\n }\n\n return makeEnvironmentProviders([{ provide: WR_MARKDOWN_HIGHLIGHTER, useFactory: highlighter.useFactory }]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDG;AACH,SAAS,aAAa,CAAC,MAAc,EAAE,UAAkC,EAAE,EAAA;AACzE,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE;IAEtB,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;AAClD,IAAA,MAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC;AAEjE,IAAA,OAAO,GAAG,CAAC,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM;AAC5D;AAEA;;;;;;;;AAQG;AACH,MAAM,SAAS,GAAG,EAAE;AAEpB;;;;;;;;;;AAUG;AACH,MAAM,iBAAiB,GAAG,GAAG;AA2C7B,SAAS,UAAU,CAAC,SAAkB,EAAA;IACpC,OAAO;QACL,SAAS;QACT,KAAK,EAAE,IAAI,GAAG,EAAE;QAChB,QAAQ,EAAE,IAAI,GAAG,EAAE;AACnB,QAAA,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,i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