@notectl/core 2.2.1 → 2.2.3

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 (1280) hide show
  1. package/README.md +2 -0
  2. package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs.map +1 -0
  4. package/dist/chunks/AttrRegistry-DcDVyzLm.mjs +2 -0
  5. package/dist/chunks/AttrRegistry-DcDVyzLm.mjs.map +1 -0
  6. package/dist/chunks/AttributedMarkCommands-D4W2Jgpj.mjs +2 -0
  7. package/dist/chunks/AttributedMarkCommands-D4W2Jgpj.mjs.map +1 -0
  8. package/dist/chunks/BidiIsolationPlugin-Bm3h9J15.mjs +2 -0
  9. package/dist/chunks/BidiIsolationPlugin-Bm3h9J15.mjs.map +1 -0
  10. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs +2 -0
  11. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs.map +1 -0
  12. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs +2 -0
  13. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -0
  14. package/dist/chunks/BlockquotePlugin-CxrCA0vY.mjs +2 -0
  15. package/dist/chunks/BlockquotePlugin-CxrCA0vY.mjs.map +1 -0
  16. package/dist/chunks/CaretNavigationPlugin-Bb7W_FMg.mjs +2 -0
  17. package/dist/chunks/CaretNavigationPlugin-Bb7W_FMg.mjs.map +1 -0
  18. package/dist/chunks/CodeBlockPlugin-CcB0WaIz.mjs +2 -0
  19. package/dist/chunks/CodeBlockPlugin-CcB0WaIz.mjs.map +1 -0
  20. package/dist/chunks/ColorGrid-CXRdpP_n.mjs +2 -0
  21. package/dist/chunks/ColorGrid-CXRdpP_n.mjs.map +1 -0
  22. package/dist/chunks/ColorPickerPopup-C_74bqid.mjs +2 -0
  23. package/dist/chunks/ColorPickerPopup-C_74bqid.mjs.map +1 -0
  24. package/dist/chunks/ColorValidation-DAijTjG9.mjs +2 -0
  25. package/dist/chunks/ColorValidation-DAijTjG9.mjs.map +1 -0
  26. package/dist/chunks/Commands-BIIpx_Zd.mjs +2 -0
  27. package/dist/chunks/Commands-BIIpx_Zd.mjs.map +1 -0
  28. package/dist/chunks/Decoration-ZeyVfwJB.mjs +2 -0
  29. package/dist/chunks/Decoration-ZeyVfwJB.mjs.map +1 -0
  30. package/dist/chunks/DirectionDetection-C7XE0nxW.mjs +2 -0
  31. package/dist/chunks/DirectionDetection-C7XE0nxW.mjs.map +1 -0
  32. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs +2 -0
  33. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -0
  34. package/dist/chunks/Document-r7vLOAGA.mjs +2 -0
  35. package/dist/chunks/Document-r7vLOAGA.mjs.map +1 -0
  36. package/dist/chunks/DocumentParser-CcTSeT1B.mjs +2 -0
  37. package/dist/chunks/DocumentParser-CcTSeT1B.mjs.map +1 -0
  38. package/dist/chunks/DomUtils-Bf7JLFlx.mjs +2 -0
  39. package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -0
  40. package/dist/chunks/FontPlugin-1VYDwETg.mjs +2 -0
  41. package/dist/chunks/FontPlugin-1VYDwETg.mjs.map +1 -0
  42. package/dist/chunks/FontSizePlugin-L1uDVsKY.mjs +2 -0
  43. package/dist/chunks/FontSizePlugin-L1uDVsKY.mjs.map +1 -0
  44. package/dist/chunks/FormulaPlugin-66Cc9sH2.mjs +2 -0
  45. package/dist/chunks/FormulaPlugin-66Cc9sH2.mjs.map +1 -0
  46. package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs +2 -0
  47. package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs.map +1 -0
  48. package/dist/chunks/GapCursorPlugin-B29ieXel.mjs +2 -0
  49. package/dist/chunks/GapCursorPlugin-B29ieXel.mjs.map +1 -0
  50. package/dist/chunks/HTMLUtils-C6B4UT00.mjs +2 -0
  51. package/dist/chunks/HTMLUtils-C6B4UT00.mjs.map +1 -0
  52. package/dist/chunks/HardBreakPlugin-9DOyCyyM.mjs +2 -0
  53. package/dist/chunks/HardBreakPlugin-9DOyCyyM.mjs.map +1 -0
  54. package/dist/chunks/HeadingPlugin-SICF6Tm0.mjs +2 -0
  55. package/dist/chunks/HeadingPlugin-SICF6Tm0.mjs.map +1 -0
  56. package/dist/chunks/HighlightPlugin-B3b_qe68.mjs +2 -0
  57. package/dist/chunks/HighlightPlugin-B3b_qe68.mjs.map +1 -0
  58. package/dist/chunks/HorizontalRulePlugin-BrFlrpmb.mjs +2 -0
  59. package/dist/chunks/HorizontalRulePlugin-BrFlrpmb.mjs.map +1 -0
  60. package/dist/chunks/ImagePlugin-eRVtFFou.mjs +2 -0
  61. package/dist/chunks/ImagePlugin-eRVtFFou.mjs.map +1 -0
  62. package/dist/chunks/InlineCodePlugin-Cj1EZ3x2.mjs +2 -0
  63. package/dist/chunks/InlineCodePlugin-Cj1EZ3x2.mjs.map +1 -0
  64. package/dist/chunks/InlineStyleMarkSpec-4R6DC7ij.mjs +2 -0
  65. package/dist/chunks/InlineStyleMarkSpec-4R6DC7ij.mjs.map +1 -0
  66. package/dist/chunks/KeyboardNav-D0my3wuy.mjs +2 -0
  67. package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -0
  68. package/dist/chunks/LinkPlugin-B_ysjORS.mjs +2 -0
  69. package/dist/chunks/LinkPlugin-B_ysjORS.mjs.map +1 -0
  70. package/dist/chunks/ListPlugin-C0BV8CnQ.mjs +2 -0
  71. package/dist/chunks/ListPlugin-C0BV8CnQ.mjs.map +1 -0
  72. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs +2 -0
  73. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs.map +1 -0
  74. package/dist/chunks/NodeResolver-ChgLF_IP.mjs +2 -0
  75. package/dist/chunks/NodeResolver-ChgLF_IP.mjs.map +1 -0
  76. package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs +2 -0
  77. package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs.map +1 -0
  78. package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs +2 -0
  79. package/dist/chunks/NodeSpecPatching-B_yLknTl.mjs.map +1 -0
  80. package/dist/chunks/Platform-ByobkiCc.mjs +2 -0
  81. package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -0
  82. package/dist/chunks/PluginHelpers-D4quRJ5a.mjs +2 -0
  83. package/dist/chunks/PluginHelpers-D4quRJ5a.mjs.map +1 -0
  84. package/dist/chunks/PopupKeyboardPatterns-tUrT9TyV.mjs +2 -0
  85. package/dist/chunks/PopupKeyboardPatterns-tUrT9TyV.mjs.map +1 -0
  86. package/dist/chunks/PopupManager-CyOfZUab.mjs +2 -0
  87. package/dist/chunks/PopupManager-CyOfZUab.mjs.map +1 -0
  88. package/dist/chunks/PopupPositioning-DtUrY9bh.mjs +2 -0
  89. package/dist/chunks/PopupPositioning-DtUrY9bh.mjs.map +1 -0
  90. package/dist/chunks/PrintPlugin-CXDFFzWB.mjs +2 -0
  91. package/dist/chunks/PrintPlugin-CXDFFzWB.mjs.map +1 -0
  92. package/dist/chunks/PrintTypes-WdtgSj74.mjs +2 -0
  93. package/dist/chunks/PrintTypes-WdtgSj74.mjs.map +1 -0
  94. package/dist/chunks/RangeIterator-o8v3msQe.mjs +2 -0
  95. package/dist/chunks/RangeIterator-o8v3msQe.mjs.map +1 -0
  96. package/dist/chunks/Selection-HYoVFpAx.mjs +2 -0
  97. package/dist/chunks/Selection-HYoVFpAx.mjs.map +1 -0
  98. package/dist/chunks/SelectionSync-BSHIw1EE.mjs +2 -0
  99. package/dist/chunks/SelectionSync-BSHIw1EE.mjs.map +1 -0
  100. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs +2 -0
  101. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -0
  102. package/dist/chunks/SimpleMark-Bdqjcz0G.mjs +2 -0
  103. package/dist/chunks/SimpleMark-Bdqjcz0G.mjs.map +1 -0
  104. package/dist/chunks/SmartPastePlugin-BhkoH03E.mjs +2 -0
  105. package/dist/chunks/SmartPastePlugin-BhkoH03E.mjs.map +1 -0
  106. package/dist/chunks/StrikethroughPlugin-DRuwEZhu.mjs +2 -0
  107. package/dist/chunks/StrikethroughPlugin-DRuwEZhu.mjs.map +1 -0
  108. package/dist/chunks/StyleRuntime-BAutwDZT.mjs +2 -0
  109. package/dist/chunks/StyleRuntime-BAutwDZT.mjs.map +1 -0
  110. package/dist/chunks/SuperSubPlugin-IZ_x8GS-.mjs +2 -0
  111. package/dist/chunks/SuperSubPlugin-IZ_x8GS-.mjs.map +1 -0
  112. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs +2 -0
  113. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -0
  114. package/dist/chunks/TablePlugin-CRp4qSZE.mjs +2 -0
  115. package/dist/chunks/TablePlugin-CRp4qSZE.mjs.map +1 -0
  116. package/dist/chunks/TextColorPlugin-CViEiYZk.mjs +2 -0
  117. package/dist/chunks/TextColorPlugin-CViEiYZk.mjs.map +1 -0
  118. package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs +2 -0
  119. package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs.map +1 -0
  120. package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs +2 -0
  121. package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs.map +1 -0
  122. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +2 -0
  123. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs.map +1 -0
  124. package/dist/chunks/TextFormattingPlugin-CpyZgtLi.mjs +2 -0
  125. package/dist/chunks/TextFormattingPlugin-CpyZgtLi.mjs.map +1 -0
  126. package/dist/chunks/ToolbarPlugin-B5UUc6dY.mjs +2 -0
  127. package/dist/chunks/ToolbarPlugin-B5UUc6dY.mjs.map +1 -0
  128. package/dist/chunks/TypeBrands-Ch9856Gb.mjs +2 -0
  129. package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -0
  130. package/dist/chunks/TypedKeys-CA4bfw9O.mjs +2 -0
  131. package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -0
  132. package/dist/chunks/VideoPlugin-mXIDODzC.mjs +2 -0
  133. package/dist/chunks/VideoPlugin-mXIDODzC.mjs.map +1 -0
  134. package/dist/chunks/WordBoundary-DxeMBRyP.mjs +2 -0
  135. package/dist/chunks/WordBoundary-DxeMBRyP.mjs.map +1 -0
  136. package/dist/chunks/XmlDetector-D7TQpw-e.mjs +2 -0
  137. package/dist/chunks/XmlDetector-D7TQpw-e.mjs.map +1 -0
  138. package/dist/chunks/XmlPatterns-RN32-0ob.mjs +2 -0
  139. package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -0
  140. package/dist/chunks/XmlSupport-BYiRwlkK.mjs +2 -0
  141. package/dist/chunks/XmlSupport-BYiRwlkK.mjs.map +1 -0
  142. package/dist/chunks/ar--Isa9OHJ.mjs +2 -0
  143. package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -0
  144. package/dist/chunks/ar--O0A9OTR.mjs +2 -0
  145. package/dist/chunks/ar--O0A9OTR.mjs.map +1 -0
  146. package/dist/chunks/ar-0g2bmXTn.mjs +2 -0
  147. package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -0
  148. package/dist/chunks/ar-4b8e2YSc.mjs +2 -0
  149. package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -0
  150. package/dist/chunks/ar-B03uY4xr.mjs +2 -0
  151. package/dist/chunks/ar-B03uY4xr.mjs.map +1 -0
  152. package/dist/chunks/ar-BAfInw85.mjs +2 -0
  153. package/dist/chunks/ar-BAfInw85.mjs.map +1 -0
  154. package/dist/chunks/ar-BRX5E_Pw.mjs +2 -0
  155. package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -0
  156. package/dist/chunks/ar-BTShmP2E.mjs +2 -0
  157. package/dist/chunks/ar-BTShmP2E.mjs.map +1 -0
  158. package/dist/chunks/ar-BWOue6jG.mjs +2 -0
  159. package/dist/chunks/ar-BWOue6jG.mjs.map +1 -0
  160. package/dist/chunks/ar-Bdmunk5h.mjs +2 -0
  161. package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -0
  162. package/dist/chunks/ar-BwaoCUVN.mjs +2 -0
  163. package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -0
  164. package/dist/chunks/ar-BzqAYGER.mjs +2 -0
  165. package/dist/chunks/ar-BzqAYGER.mjs.map +1 -0
  166. package/dist/chunks/ar-C9lO1jsY.mjs +2 -0
  167. package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -0
  168. package/dist/chunks/ar-CMXjVzFx.mjs +2 -0
  169. package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -0
  170. package/dist/chunks/ar-CR6UdFL9.mjs +2 -0
  171. package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -0
  172. package/dist/chunks/ar-CrOb0jL2.mjs +2 -0
  173. package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -0
  174. package/dist/chunks/ar-Ctrv6cIi.mjs +2 -0
  175. package/dist/chunks/ar-Ctrv6cIi.mjs.map +1 -0
  176. package/dist/chunks/ar-Cy_77yRf.mjs +2 -0
  177. package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -0
  178. package/dist/chunks/ar-D1jFXqLJ.mjs +2 -0
  179. package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -0
  180. package/dist/chunks/ar-DahJwMI9.mjs +2 -0
  181. package/dist/chunks/ar-DahJwMI9.mjs.map +1 -0
  182. package/dist/chunks/ar-Dcl3kgtd.mjs +2 -0
  183. package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -0
  184. package/dist/chunks/ar-Dx2lO0Nm.mjs +2 -0
  185. package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -0
  186. package/dist/chunks/ar-NV_puwI2.mjs +2 -0
  187. package/dist/chunks/ar-NV_puwI2.mjs.map +1 -0
  188. package/dist/chunks/ar-Uzo1Azdw.mjs +2 -0
  189. package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -0
  190. package/dist/chunks/ar-XmSFrtmd.mjs +2 -0
  191. package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -0
  192. package/dist/chunks/ar-jbplYWkC.mjs +2 -0
  193. package/dist/chunks/ar-jbplYWkC.mjs.map +1 -0
  194. package/dist/chunks/ar-sGZ-oZqB.mjs +2 -0
  195. package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -0
  196. package/dist/chunks/color-picker-C9B2rYw-.mjs +2 -0
  197. package/dist/chunks/color-picker-C9B2rYw-.mjs.map +1 -0
  198. package/dist/chunks/de-B8-w9gPi.mjs +2 -0
  199. package/dist/chunks/de-B8-w9gPi.mjs.map +1 -0
  200. package/dist/chunks/de-B9zSHWqY.mjs +2 -0
  201. package/dist/chunks/de-B9zSHWqY.mjs.map +1 -0
  202. package/dist/chunks/de-BX4y4PlH.mjs +2 -0
  203. package/dist/chunks/de-BX4y4PlH.mjs.map +1 -0
  204. package/dist/chunks/de-BXQBXxFJ.mjs +2 -0
  205. package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -0
  206. package/dist/chunks/de-BcPntcnr.mjs +2 -0
  207. package/dist/chunks/de-BcPntcnr.mjs.map +1 -0
  208. package/dist/chunks/de-BdD3DpUB.mjs +2 -0
  209. package/dist/chunks/de-BdD3DpUB.mjs.map +1 -0
  210. package/dist/chunks/de-Bwxlcuee.mjs +2 -0
  211. package/dist/chunks/de-Bwxlcuee.mjs.map +1 -0
  212. package/dist/chunks/de-BxQIt_1Y.mjs +2 -0
  213. package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -0
  214. package/dist/chunks/de-C--bRmjW.mjs +2 -0
  215. package/dist/chunks/de-C--bRmjW.mjs.map +1 -0
  216. package/dist/chunks/de-C-Yf378-.mjs +2 -0
  217. package/dist/chunks/de-C-Yf378-.mjs.map +1 -0
  218. package/dist/chunks/de-C7uehgMu.mjs +2 -0
  219. package/dist/chunks/de-C7uehgMu.mjs.map +1 -0
  220. package/dist/chunks/de-C9ZhDqPi.mjs +2 -0
  221. package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -0
  222. package/dist/chunks/de-CHcv_Vmf.mjs +2 -0
  223. package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -0
  224. package/dist/chunks/de-CTzAMkXC.mjs +2 -0
  225. package/dist/chunks/de-CTzAMkXC.mjs.map +1 -0
  226. package/dist/chunks/de-CaeEIyzV.mjs +2 -0
  227. package/dist/chunks/de-CaeEIyzV.mjs.map +1 -0
  228. package/dist/chunks/de-DHs9i4af.mjs +2 -0
  229. package/dist/chunks/de-DHs9i4af.mjs.map +1 -0
  230. package/dist/chunks/de-DN-e6G5A.mjs +2 -0
  231. package/dist/chunks/de-DN-e6G5A.mjs.map +1 -0
  232. package/dist/chunks/de-DViI26lG.mjs +2 -0
  233. package/dist/chunks/de-DViI26lG.mjs.map +1 -0
  234. package/dist/chunks/de-DY3obIAF.mjs +2 -0
  235. package/dist/chunks/de-DY3obIAF.mjs.map +1 -0
  236. package/dist/chunks/de-DcMhfRBu.mjs +2 -0
  237. package/dist/chunks/de-DcMhfRBu.mjs.map +1 -0
  238. package/dist/chunks/de-DiPz7abS.mjs +2 -0
  239. package/dist/chunks/de-DiPz7abS.mjs.map +1 -0
  240. package/dist/chunks/de-Dl4QFHMa.mjs +2 -0
  241. package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -0
  242. package/dist/chunks/de-JhGflzS5.mjs +2 -0
  243. package/dist/chunks/de-JhGflzS5.mjs.map +1 -0
  244. package/dist/chunks/de-XCCpWyg0.mjs +2 -0
  245. package/dist/chunks/de-XCCpWyg0.mjs.map +1 -0
  246. package/dist/chunks/de-e6J6nvAD.mjs +2 -0
  247. package/dist/chunks/de-e6J6nvAD.mjs.map +1 -0
  248. package/dist/chunks/de-i95F9SDy.mjs +2 -0
  249. package/dist/chunks/de-i95F9SDy.mjs.map +1 -0
  250. package/dist/chunks/de-uKR7koQe.mjs +2 -0
  251. package/dist/chunks/de-uKR7koQe.mjs.map +1 -0
  252. package/dist/chunks/es-B0Za939C.mjs +2 -0
  253. package/dist/chunks/es-B0Za939C.mjs.map +1 -0
  254. package/dist/chunks/es-B8K3Yvf3.mjs +2 -0
  255. package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -0
  256. package/dist/chunks/es-BIXm2Coj.mjs +2 -0
  257. package/dist/chunks/es-BIXm2Coj.mjs.map +1 -0
  258. package/dist/chunks/es-BJHF95J_.mjs +2 -0
  259. package/dist/chunks/es-BJHF95J_.mjs.map +1 -0
  260. package/dist/chunks/es-BMm9kqjC.mjs +2 -0
  261. package/dist/chunks/es-BMm9kqjC.mjs.map +1 -0
  262. package/dist/chunks/es-BQweZX6P.mjs +2 -0
  263. package/dist/chunks/es-BQweZX6P.mjs.map +1 -0
  264. package/dist/chunks/es-BdpTTRuX.mjs +2 -0
  265. package/dist/chunks/es-BdpTTRuX.mjs.map +1 -0
  266. package/dist/chunks/es-Bv7bDbMp.mjs +2 -0
  267. package/dist/chunks/es-Bv7bDbMp.mjs.map +1 -0
  268. package/dist/chunks/es-C7uVqFYr.mjs +2 -0
  269. package/dist/chunks/es-C7uVqFYr.mjs.map +1 -0
  270. package/dist/chunks/es-CCQFu1t1.mjs +2 -0
  271. package/dist/chunks/es-CCQFu1t1.mjs.map +1 -0
  272. package/dist/chunks/es-CM55WeEN.mjs +2 -0
  273. package/dist/chunks/es-CM55WeEN.mjs.map +1 -0
  274. package/dist/chunks/es-CUKJujcb.mjs +2 -0
  275. package/dist/chunks/es-CUKJujcb.mjs.map +1 -0
  276. package/dist/chunks/es-CXuMz87y.mjs +2 -0
  277. package/dist/chunks/es-CXuMz87y.mjs.map +1 -0
  278. package/dist/chunks/es-CgMfhkJJ.mjs +2 -0
  279. package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -0
  280. package/dist/chunks/es-CtOtKQCP.mjs +2 -0
  281. package/dist/chunks/es-CtOtKQCP.mjs.map +1 -0
  282. package/dist/chunks/es-DD01rZ6N.mjs +2 -0
  283. package/dist/chunks/es-DD01rZ6N.mjs.map +1 -0
  284. package/dist/chunks/es-DDoqchUq.mjs +2 -0
  285. package/dist/chunks/es-DDoqchUq.mjs.map +1 -0
  286. package/dist/chunks/es-DFUVd7eO.mjs +2 -0
  287. package/dist/chunks/es-DFUVd7eO.mjs.map +1 -0
  288. package/dist/chunks/es-DFokqQst.mjs +2 -0
  289. package/dist/chunks/es-DFokqQst.mjs.map +1 -0
  290. package/dist/chunks/es-DHxdoEzR.mjs +2 -0
  291. package/dist/chunks/es-DHxdoEzR.mjs.map +1 -0
  292. package/dist/chunks/es-DehVGwQ8.mjs +2 -0
  293. package/dist/chunks/es-DehVGwQ8.mjs.map +1 -0
  294. package/dist/chunks/es-DrJyl38L.mjs +2 -0
  295. package/dist/chunks/es-DrJyl38L.mjs.map +1 -0
  296. package/dist/chunks/es-fTW0TkYV.mjs +2 -0
  297. package/dist/chunks/es-fTW0TkYV.mjs.map +1 -0
  298. package/dist/chunks/es-kfKiqpyD.mjs +2 -0
  299. package/dist/chunks/es-kfKiqpyD.mjs.map +1 -0
  300. package/dist/chunks/es-nRLq7bgP.mjs +2 -0
  301. package/dist/chunks/es-nRLq7bgP.mjs.map +1 -0
  302. package/dist/chunks/es-paXY7HFt.mjs +2 -0
  303. package/dist/chunks/es-paXY7HFt.mjs.map +1 -0
  304. package/dist/chunks/es-xuahrvJN.mjs +2 -0
  305. package/dist/chunks/es-xuahrvJN.mjs.map +1 -0
  306. package/dist/chunks/fonts-DQC6Uj4r.mjs +2 -0
  307. package/dist/chunks/fonts-DQC6Uj4r.mjs.map +1 -0
  308. package/dist/chunks/fr-0qEo3bRP.mjs +2 -0
  309. package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -0
  310. package/dist/chunks/fr-5HkMazAf.mjs +2 -0
  311. package/dist/chunks/fr-5HkMazAf.mjs.map +1 -0
  312. package/dist/chunks/fr-B9pBLaVx.mjs +2 -0
  313. package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -0
  314. package/dist/chunks/fr-BRXUnq3R.mjs +2 -0
  315. package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -0
  316. package/dist/chunks/fr-BSUKEtTk.mjs +2 -0
  317. package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -0
  318. package/dist/chunks/fr-BaXKyPmX.mjs +2 -0
  319. package/dist/chunks/fr-BaXKyPmX.mjs.map +1 -0
  320. package/dist/chunks/fr-BeRlON1t.mjs +2 -0
  321. package/dist/chunks/fr-BeRlON1t.mjs.map +1 -0
  322. package/dist/chunks/fr-Bg937iAy.mjs +2 -0
  323. package/dist/chunks/fr-Bg937iAy.mjs.map +1 -0
  324. package/dist/chunks/fr-BwWrFThE.mjs +2 -0
  325. package/dist/chunks/fr-BwWrFThE.mjs.map +1 -0
  326. package/dist/chunks/fr-C3EKRThN.mjs +2 -0
  327. package/dist/chunks/fr-C3EKRThN.mjs.map +1 -0
  328. package/dist/chunks/fr-CKjH6tJI.mjs +2 -0
  329. package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -0
  330. package/dist/chunks/fr-CQs0-pNX.mjs +2 -0
  331. package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -0
  332. package/dist/chunks/fr-C_2i5Ono.mjs +2 -0
  333. package/dist/chunks/fr-C_2i5Ono.mjs.map +1 -0
  334. package/dist/chunks/fr-CfhyYN-t.mjs +2 -0
  335. package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -0
  336. package/dist/chunks/fr-D0MDdoir.mjs +2 -0
  337. package/dist/chunks/fr-D0MDdoir.mjs.map +1 -0
  338. package/dist/chunks/fr-D5ulA3Z6.mjs +2 -0
  339. package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -0
  340. package/dist/chunks/fr-DEZ_oxzS.mjs +2 -0
  341. package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -0
  342. package/dist/chunks/fr-DciSEykY.mjs +2 -0
  343. package/dist/chunks/fr-DciSEykY.mjs.map +1 -0
  344. package/dist/chunks/fr-DiDhVhyV.mjs +2 -0
  345. package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -0
  346. package/dist/chunks/fr-DjMZ-3K5.mjs +2 -0
  347. package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -0
  348. package/dist/chunks/fr-DtzIu6tU.mjs +2 -0
  349. package/dist/chunks/fr-DtzIu6tU.mjs.map +1 -0
  350. package/dist/chunks/fr-F2ZrfVaF.mjs +2 -0
  351. package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -0
  352. package/dist/chunks/fr-KXmbys88.mjs +2 -0
  353. package/dist/chunks/fr-KXmbys88.mjs.map +1 -0
  354. package/dist/chunks/fr-SbpHNrQ-.mjs +2 -0
  355. package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -0
  356. package/dist/chunks/fr-ZsRdLuys.mjs +2 -0
  357. package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -0
  358. package/dist/chunks/fr-eC0UdAPu.mjs +2 -0
  359. package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -0
  360. package/dist/chunks/fr-fshsDD66.mjs +2 -0
  361. package/dist/chunks/fr-fshsDD66.mjs.map +1 -0
  362. package/dist/chunks/full-CHkwduuY.mjs +2 -0
  363. package/dist/chunks/full-CHkwduuY.mjs.map +1 -0
  364. package/dist/chunks/hi-4CiAKVjT.mjs +2 -0
  365. package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -0
  366. package/dist/chunks/hi-B-ZuX4aN.mjs +2 -0
  367. package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -0
  368. package/dist/chunks/hi-B2YB3Bo4.mjs +2 -0
  369. package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -0
  370. package/dist/chunks/hi-B2uhiPCN.mjs +2 -0
  371. package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -0
  372. package/dist/chunks/hi-B5cl8TWK.mjs +2 -0
  373. package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -0
  374. package/dist/chunks/hi-BNJIGWQQ.mjs +2 -0
  375. package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -0
  376. package/dist/chunks/hi-BOMkDPqC.mjs +2 -0
  377. package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -0
  378. package/dist/chunks/hi-Bl-yeeOI.mjs +2 -0
  379. package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -0
  380. package/dist/chunks/hi-Bu799xIO.mjs +2 -0
  381. package/dist/chunks/hi-Bu799xIO.mjs.map +1 -0
  382. package/dist/chunks/hi-By8YwVIX.mjs +2 -0
  383. package/dist/chunks/hi-By8YwVIX.mjs.map +1 -0
  384. package/dist/chunks/hi-BzbMD_cP.mjs +2 -0
  385. package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -0
  386. package/dist/chunks/hi-C2jEsf8v.mjs +2 -0
  387. package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -0
  388. package/dist/chunks/hi-C9fvG91d.mjs +2 -0
  389. package/dist/chunks/hi-C9fvG91d.mjs.map +1 -0
  390. package/dist/chunks/hi-CTWubxLY.mjs +2 -0
  391. package/dist/chunks/hi-CTWubxLY.mjs.map +1 -0
  392. package/dist/chunks/hi-CoclKAUM.mjs +2 -0
  393. package/dist/chunks/hi-CoclKAUM.mjs.map +1 -0
  394. package/dist/chunks/hi-CrmakMVj.mjs +2 -0
  395. package/dist/chunks/hi-CrmakMVj.mjs.map +1 -0
  396. package/dist/chunks/hi-DWX6k5ZD.mjs +2 -0
  397. package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -0
  398. package/dist/chunks/hi-DY55FuDK.mjs +2 -0
  399. package/dist/chunks/hi-DY55FuDK.mjs.map +1 -0
  400. package/dist/chunks/hi-DsdXcOB6.mjs +2 -0
  401. package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -0
  402. package/dist/chunks/hi-Dt89SxNy.mjs +2 -0
  403. package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -0
  404. package/dist/chunks/hi-J8ErB5nB.mjs +2 -0
  405. package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -0
  406. package/dist/chunks/hi-L6pJxZam.mjs +2 -0
  407. package/dist/chunks/hi-L6pJxZam.mjs.map +1 -0
  408. package/dist/chunks/hi-SECtQQzq.mjs +2 -0
  409. package/dist/chunks/hi-SECtQQzq.mjs.map +1 -0
  410. package/dist/chunks/hi-aH9HZG23.mjs +2 -0
  411. package/dist/chunks/hi-aH9HZG23.mjs.map +1 -0
  412. package/dist/chunks/hi-j3TDLMYd.mjs +2 -0
  413. package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -0
  414. package/dist/chunks/hi-l6DA-aOw.mjs +2 -0
  415. package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -0
  416. package/dist/chunks/hi-uACJUw53.mjs +2 -0
  417. package/dist/chunks/hi-uACJUw53.mjs.map +1 -0
  418. package/dist/chunks/minimal-D5v-raei.mjs +2 -0
  419. package/dist/chunks/minimal-D5v-raei.mjs.map +1 -0
  420. package/dist/chunks/pt-5VeuNDd2.mjs +2 -0
  421. package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -0
  422. package/dist/chunks/pt-BCXgUDiU.mjs +2 -0
  423. package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -0
  424. package/dist/chunks/pt-BDam9cDu.mjs +2 -0
  425. package/dist/chunks/pt-BDam9cDu.mjs.map +1 -0
  426. package/dist/chunks/pt-Bb908r0n.mjs +2 -0
  427. package/dist/chunks/pt-Bb908r0n.mjs.map +1 -0
  428. package/dist/chunks/pt-BkpVtod-.mjs +2 -0
  429. package/dist/chunks/pt-BkpVtod-.mjs.map +1 -0
  430. package/dist/chunks/pt-BlFAJZo7.mjs +2 -0
  431. package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -0
  432. package/dist/chunks/pt-Bu7Mbz67.mjs +2 -0
  433. package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -0
  434. package/dist/chunks/pt-C8sOyw0V.mjs +2 -0
  435. package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -0
  436. package/dist/chunks/pt-CEUgbrii.mjs +2 -0
  437. package/dist/chunks/pt-CEUgbrii.mjs.map +1 -0
  438. package/dist/chunks/pt-CMrFpUWS.mjs +2 -0
  439. package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -0
  440. package/dist/chunks/pt-CMx2wPPY.mjs +2 -0
  441. package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -0
  442. package/dist/chunks/pt-CR4j8gtE.mjs +2 -0
  443. package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -0
  444. package/dist/chunks/pt-Cc4zysaT.mjs +2 -0
  445. package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -0
  446. package/dist/chunks/pt-Cv6q7x5x.mjs +2 -0
  447. package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -0
  448. package/dist/chunks/pt-DFKJVh7k.mjs +2 -0
  449. package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -0
  450. package/dist/chunks/pt-DYMyMgKQ.mjs +2 -0
  451. package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -0
  452. package/dist/chunks/pt-D__tcM2T.mjs +2 -0
  453. package/dist/chunks/pt-D__tcM2T.mjs.map +1 -0
  454. package/dist/chunks/pt-Dg2ctkug.mjs +2 -0
  455. package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -0
  456. package/dist/chunks/pt-DgfMoLWR.mjs +2 -0
  457. package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -0
  458. package/dist/chunks/pt-DmN9u3NX.mjs +2 -0
  459. package/dist/chunks/pt-DmN9u3NX.mjs.map +1 -0
  460. package/dist/chunks/pt-GqLw5tN0.mjs +2 -0
  461. package/dist/chunks/pt-GqLw5tN0.mjs.map +1 -0
  462. package/dist/chunks/pt-Hy-0Xnnc.mjs +2 -0
  463. package/dist/chunks/pt-Hy-0Xnnc.mjs.map +1 -0
  464. package/dist/chunks/pt-OXa_IR4Q.mjs +2 -0
  465. package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -0
  466. package/dist/chunks/pt-UPF7DBlz.mjs +2 -0
  467. package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -0
  468. package/dist/chunks/pt-_qxIe7zX.mjs +2 -0
  469. package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -0
  470. package/dist/chunks/pt-paXY7HFt.mjs +2 -0
  471. package/dist/chunks/pt-paXY7HFt.mjs.map +1 -0
  472. package/dist/chunks/pt-zMHcNGPk.mjs +2 -0
  473. package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -0
  474. package/dist/chunks/ru-4g_qsaLr.mjs +2 -0
  475. package/dist/chunks/ru-4g_qsaLr.mjs.map +1 -0
  476. package/dist/chunks/ru-B1m8J9dl.mjs +2 -0
  477. package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -0
  478. package/dist/chunks/ru-BFpEOrVp.mjs +2 -0
  479. package/dist/chunks/ru-BFpEOrVp.mjs.map +1 -0
  480. package/dist/chunks/ru-BNPUT-3S.mjs +2 -0
  481. package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -0
  482. package/dist/chunks/ru-BotG0MFT.mjs +2 -0
  483. package/dist/chunks/ru-BotG0MFT.mjs.map +1 -0
  484. package/dist/chunks/ru-BxySx7an.mjs +2 -0
  485. package/dist/chunks/ru-BxySx7an.mjs.map +1 -0
  486. package/dist/chunks/ru-C-APN_dm.mjs +2 -0
  487. package/dist/chunks/ru-C-APN_dm.mjs.map +1 -0
  488. package/dist/chunks/ru-C9yFslEG.mjs +2 -0
  489. package/dist/chunks/ru-C9yFslEG.mjs.map +1 -0
  490. package/dist/chunks/ru-CkG_bpfo.mjs +2 -0
  491. package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -0
  492. package/dist/chunks/ru-Cs8KCNyq.mjs +2 -0
  493. package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -0
  494. package/dist/chunks/ru-CvDl-yEd.mjs +2 -0
  495. package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -0
  496. package/dist/chunks/ru-CwyPz2Va.mjs +2 -0
  497. package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -0
  498. package/dist/chunks/ru-D53d-_UB.mjs +2 -0
  499. package/dist/chunks/ru-D53d-_UB.mjs.map +1 -0
  500. package/dist/chunks/ru-DJMpeuey.mjs +2 -0
  501. package/dist/chunks/ru-DJMpeuey.mjs.map +1 -0
  502. package/dist/chunks/ru-DSRv3_Rg.mjs +2 -0
  503. package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -0
  504. package/dist/chunks/ru-DV-lgEtM.mjs +2 -0
  505. package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -0
  506. package/dist/chunks/ru-DiwQV30V.mjs +2 -0
  507. package/dist/chunks/ru-DiwQV30V.mjs.map +1 -0
  508. package/dist/chunks/ru-DkW9XZFy.mjs +2 -0
  509. package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -0
  510. package/dist/chunks/ru-DyCTlhjg.mjs +2 -0
  511. package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -0
  512. package/dist/chunks/ru-QGX8lOTs.mjs +2 -0
  513. package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -0
  514. package/dist/chunks/ru-QcTo2yoL.mjs +2 -0
  515. package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -0
  516. package/dist/chunks/ru-Y11wuxOB.mjs +2 -0
  517. package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -0
  518. package/dist/chunks/ru-Yngw7nFP.mjs +2 -0
  519. package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -0
  520. package/dist/chunks/ru-d68SZpEe.mjs +2 -0
  521. package/dist/chunks/ru-d68SZpEe.mjs.map +1 -0
  522. package/dist/chunks/ru-k7o3Qks3.mjs +2 -0
  523. package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -0
  524. package/dist/chunks/ru-l73diFXn.mjs +2 -0
  525. package/dist/chunks/ru-l73diFXn.mjs.map +1 -0
  526. package/dist/chunks/ru-q8kz-237.mjs +2 -0
  527. package/dist/chunks/ru-q8kz-237.mjs.map +1 -0
  528. package/dist/chunks/src-gVRDR_79.mjs +2 -0
  529. package/dist/chunks/src-gVRDR_79.mjs.map +1 -0
  530. package/dist/chunks/zh-BGYJXxVl.mjs +2 -0
  531. package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -0
  532. package/dist/chunks/zh-BP97XjlS.mjs +2 -0
  533. package/dist/chunks/zh-BP97XjlS.mjs.map +1 -0
  534. package/dist/chunks/zh-BQ73oqxc.mjs +2 -0
  535. package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -0
  536. package/dist/chunks/zh-BQqf3wJZ.mjs +2 -0
  537. package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -0
  538. package/dist/chunks/zh-Baxh6v0j.mjs +2 -0
  539. package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -0
  540. package/dist/chunks/zh-BjoyjClN.mjs +2 -0
  541. package/dist/chunks/zh-BjoyjClN.mjs.map +1 -0
  542. package/dist/chunks/zh-BvuAbM2S.mjs +2 -0
  543. package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -0
  544. package/dist/chunks/zh-C-wHnDo5.mjs +2 -0
  545. package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -0
  546. package/dist/chunks/zh-C7iCgCRP.mjs +2 -0
  547. package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -0
  548. package/dist/chunks/zh-CRsDvfPR.mjs +2 -0
  549. package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -0
  550. package/dist/chunks/zh-CWGAPVei.mjs +2 -0
  551. package/dist/chunks/zh-CWGAPVei.mjs.map +1 -0
  552. package/dist/chunks/zh-CWIzJcXi.mjs +2 -0
  553. package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -0
  554. package/dist/chunks/zh-CYV-db-K.mjs +2 -0
  555. package/dist/chunks/zh-CYV-db-K.mjs.map +1 -0
  556. package/dist/chunks/zh-CnW44JEw.mjs +2 -0
  557. package/dist/chunks/zh-CnW44JEw.mjs.map +1 -0
  558. package/dist/chunks/zh-D1HSmSOf.mjs +2 -0
  559. package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -0
  560. package/dist/chunks/zh-DWN1Jqn3.mjs +2 -0
  561. package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -0
  562. package/dist/chunks/zh-DYD476c5.mjs +2 -0
  563. package/dist/chunks/zh-DYD476c5.mjs.map +1 -0
  564. package/dist/chunks/zh-DdzgYD7k.mjs +2 -0
  565. package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -0
  566. package/dist/chunks/zh-DeZP08HI.mjs +2 -0
  567. package/dist/chunks/zh-DeZP08HI.mjs.map +1 -0
  568. package/dist/chunks/zh-DgSmvLyw.mjs +2 -0
  569. package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -0
  570. package/dist/chunks/zh-DlVfQn4z.mjs +2 -0
  571. package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -0
  572. package/dist/chunks/zh-DuucmOns.mjs +2 -0
  573. package/dist/chunks/zh-DuucmOns.mjs.map +1 -0
  574. package/dist/chunks/zh-Oj-qSUEp.mjs +2 -0
  575. package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -0
  576. package/dist/chunks/zh-YfuE_m2y.mjs +2 -0
  577. package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -0
  578. package/dist/chunks/zh-dGSDBBzb.mjs +2 -0
  579. package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -0
  580. package/dist/chunks/zh-ikm3rSTR.mjs +2 -0
  581. package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -0
  582. package/dist/chunks/zh-oZl1P_p0.mjs +2 -0
  583. package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -0
  584. package/dist/commands/BlockInsertion.d.ts +49 -2
  585. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  586. package/dist/commands/Commands.d.ts.map +1 -1
  587. package/dist/commands/NodeSelectionCommands.d.ts +10 -2
  588. package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
  589. package/dist/editor/styles/list.d.ts +1 -1
  590. package/dist/editor/styles/list.d.ts.map +1 -1
  591. package/dist/fonts.mjs +1 -1
  592. package/dist/full.mjs +1 -1
  593. package/dist/html.mjs +1 -1
  594. package/dist/index.d.ts +1 -1
  595. package/dist/index.d.ts.map +1 -1
  596. package/dist/input/KeyDescriptor.d.ts +40 -0
  597. package/dist/input/KeyDescriptor.d.ts.map +1 -0
  598. package/dist/input/KeyboardHandler.d.ts +17 -5
  599. package/dist/input/KeyboardHandler.d.ts.map +1 -1
  600. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  601. package/dist/input/PasteRichBlockHandler.d.ts +22 -3
  602. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  603. package/dist/model/Document.d.ts +2 -2
  604. package/dist/model/Document.d.ts.map +1 -1
  605. package/dist/notectl-core.mjs +1 -1
  606. package/dist/notectl-core.umd.js +1 -1
  607. package/dist/notectl-core.umd.js.map +1 -1
  608. package/dist/plugins/alignment.mjs +1 -1
  609. package/dist/plugins/bidi-isolation.mjs +1 -1
  610. package/dist/plugins/blockquote.mjs +1 -1
  611. package/dist/plugins/caret-navigation.mjs +1 -1
  612. package/dist/plugins/code-block.mjs +1 -1
  613. package/dist/plugins/font-size.mjs +1 -1
  614. package/dist/plugins/font.mjs +1 -1
  615. package/dist/plugins/formula/DisplayMathNodeSpec.d.ts.map +1 -1
  616. package/dist/plugins/formula/FormulaCommands.d.ts +14 -0
  617. package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
  618. package/dist/plugins/formula/FormulaEditorMount.d.ts.map +1 -1
  619. package/dist/plugins/formula/FormulaLocale.d.ts +7 -1
  620. package/dist/plugins/formula/FormulaLocale.d.ts.map +1 -1
  621. package/dist/plugins/formula/FormulaPasteInterceptor.d.ts +12 -3
  622. package/dist/plugins/formula/FormulaPasteInterceptor.d.ts.map +1 -1
  623. package/dist/plugins/formula/FormulaSerialization.d.ts +17 -0
  624. package/dist/plugins/formula/FormulaSerialization.d.ts.map +1 -0
  625. package/dist/plugins/formula/FormulaStyles.d.ts +1 -1
  626. package/dist/plugins/formula/FormulaStyles.d.ts.map +1 -1
  627. package/dist/plugins/formula/InlineMathNodeSpec.d.ts.map +1 -1
  628. package/dist/plugins/formula/locales/ar.d.ts.map +1 -1
  629. package/dist/plugins/formula/locales/de.d.ts.map +1 -1
  630. package/dist/plugins/formula/locales/es.d.ts.map +1 -1
  631. package/dist/plugins/formula/locales/fr.d.ts.map +1 -1
  632. package/dist/plugins/formula/locales/hi.d.ts.map +1 -1
  633. package/dist/plugins/formula/locales/pt.d.ts.map +1 -1
  634. package/dist/plugins/formula/locales/ru.d.ts.map +1 -1
  635. package/dist/plugins/formula/locales/zh.d.ts.map +1 -1
  636. package/dist/plugins/formula/math-field/MathPalette.d.ts.map +1 -1
  637. package/dist/plugins/formula/math-field/MathPaletteData.d.ts +7 -1
  638. package/dist/plugins/formula/math-field/MathPaletteData.d.ts.map +1 -1
  639. package/dist/plugins/formula/mathml/MathMLDocument.d.ts +13 -0
  640. package/dist/plugins/formula/mathml/MathMLDocument.d.ts.map +1 -1
  641. package/dist/plugins/formula.mjs +1 -1
  642. package/dist/plugins/gap-cursor.mjs +1 -1
  643. package/dist/plugins/hard-break.mjs +1 -1
  644. package/dist/plugins/heading.mjs +1 -1
  645. package/dist/plugins/highlight.mjs +1 -1
  646. package/dist/plugins/horizontal-rule.mjs +1 -1
  647. package/dist/plugins/image.mjs +1 -1
  648. package/dist/plugins/inline-code.mjs +1 -1
  649. package/dist/plugins/language.mjs +1 -1
  650. package/dist/plugins/link.mjs +1 -1
  651. package/dist/plugins/list/ListCommands.d.ts +16 -3
  652. package/dist/plugins/list/ListCommands.d.ts.map +1 -1
  653. package/dist/plugins/list/ListLocale.d.ts +6 -0
  654. package/dist/plugins/list/ListLocale.d.ts.map +1 -1
  655. package/dist/plugins/list/ListMarker.d.ts +14 -0
  656. package/dist/plugins/list/ListMarker.d.ts.map +1 -0
  657. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  658. package/dist/plugins/list/locales/ar.d.ts.map +1 -1
  659. package/dist/plugins/list/locales/de.d.ts.map +1 -1
  660. package/dist/plugins/list/locales/es.d.ts.map +1 -1
  661. package/dist/plugins/list/locales/fr.d.ts.map +1 -1
  662. package/dist/plugins/list/locales/hi.d.ts.map +1 -1
  663. package/dist/plugins/list/locales/pt.d.ts.map +1 -1
  664. package/dist/plugins/list/locales/ru.d.ts.map +1 -1
  665. package/dist/plugins/list/locales/zh.d.ts.map +1 -1
  666. package/dist/plugins/list.mjs +1 -1
  667. package/dist/plugins/print.mjs +1 -1
  668. package/dist/plugins/shared.mjs +1 -1
  669. package/dist/plugins/smart-paste.mjs +1 -1
  670. package/dist/plugins/strikethrough.mjs +1 -1
  671. package/dist/plugins/super-sub.mjs +1 -1
  672. package/dist/plugins/table/TableCommands.d.ts.map +1 -1
  673. package/dist/plugins/table.mjs +1 -1
  674. package/dist/plugins/text-color.mjs +1 -1
  675. package/dist/plugins/text-direction-auto.mjs +1 -1
  676. package/dist/plugins/text-direction.mjs +1 -1
  677. package/dist/plugins/text-formatting.mjs +1 -1
  678. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
  679. package/dist/plugins/toolbar.mjs +1 -1
  680. package/dist/plugins/video/VideoCommands.d.ts.map +1 -1
  681. package/dist/plugins/video.mjs +1 -1
  682. package/dist/presets/full.mjs +1 -1
  683. package/dist/presets/minimal.mjs +1 -1
  684. package/dist/presets.mjs +1 -1
  685. package/dist/state/InlineContentOps.d.ts +5 -3
  686. package/dist/state/InlineContentOps.d.ts.map +1 -1
  687. package/dist/state/StepInversion.d.ts.map +1 -1
  688. package/dist/state/StepMaps.d.ts.map +1 -1
  689. package/dist/state/Steps.d.ts +20 -3
  690. package/dist/state/Steps.d.ts.map +1 -1
  691. package/dist/state/TransactionBuilder.d.ts +3 -3
  692. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  693. package/dist/test/TestUtils.d.ts +2 -0
  694. package/dist/test/TestUtils.d.ts.map +1 -1
  695. package/dist/view/SelectionSync.d.ts.map +1 -1
  696. package/package.json +2 -2
  697. package/dist/chunks/AlignmentPlugin-BLzRjrUl.mjs +0 -2
  698. package/dist/chunks/AlignmentPlugin-BLzRjrUl.mjs.map +0 -1
  699. package/dist/chunks/AttrRegistry-CRnXTPha.mjs +0 -2
  700. package/dist/chunks/AttrRegistry-CRnXTPha.mjs.map +0 -1
  701. package/dist/chunks/AttributedMarkCommands-CxhdUsuE.mjs +0 -2
  702. package/dist/chunks/AttributedMarkCommands-CxhdUsuE.mjs.map +0 -1
  703. package/dist/chunks/BidiIsolationPlugin-DNPXe5ga.mjs +0 -2
  704. package/dist/chunks/BidiIsolationPlugin-DNPXe5ga.mjs.map +0 -1
  705. package/dist/chunks/BlockInsertion-C7jFEeYB.mjs +0 -2
  706. package/dist/chunks/BlockInsertion-C7jFEeYB.mjs.map +0 -1
  707. package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs +0 -2
  708. package/dist/chunks/BlockTypePickerRegistry-U4uY7-lN.mjs.map +0 -1
  709. package/dist/chunks/BlockquotePlugin-YgXcV4mT.mjs +0 -2
  710. package/dist/chunks/BlockquotePlugin-YgXcV4mT.mjs.map +0 -1
  711. package/dist/chunks/CaretNavigationPlugin-P6OYaTSq.mjs +0 -2
  712. package/dist/chunks/CaretNavigationPlugin-P6OYaTSq.mjs.map +0 -1
  713. package/dist/chunks/CodeBlockPlugin-ChPv3Edf.mjs +0 -2
  714. package/dist/chunks/CodeBlockPlugin-ChPv3Edf.mjs.map +0 -1
  715. package/dist/chunks/ColorGrid-D5-teEjD.mjs +0 -2
  716. package/dist/chunks/ColorGrid-D5-teEjD.mjs.map +0 -1
  717. package/dist/chunks/ColorPickerPopup-_Gp09pdx.mjs +0 -2
  718. package/dist/chunks/ColorPickerPopup-_Gp09pdx.mjs.map +0 -1
  719. package/dist/chunks/ColorValidation-okAvytHQ.mjs +0 -2
  720. package/dist/chunks/ColorValidation-okAvytHQ.mjs.map +0 -1
  721. package/dist/chunks/CommandHelpers-NV80Ff1G.mjs +0 -2
  722. package/dist/chunks/CommandHelpers-NV80Ff1G.mjs.map +0 -1
  723. package/dist/chunks/Commands-ixGhPiRG.mjs +0 -2
  724. package/dist/chunks/Commands-ixGhPiRG.mjs.map +0 -1
  725. package/dist/chunks/Decoration-DZK7hrL1.mjs +0 -2
  726. package/dist/chunks/Decoration-DZK7hrL1.mjs.map +0 -1
  727. package/dist/chunks/DirectionDetection-7HmMUZrx.mjs +0 -2
  728. package/dist/chunks/DirectionDetection-7HmMUZrx.mjs.map +0 -1
  729. package/dist/chunks/DirectionIcons-DhRvPVoz.mjs +0 -2
  730. package/dist/chunks/DirectionIcons-DhRvPVoz.mjs.map +0 -1
  731. package/dist/chunks/Document-znhIcvM9.mjs +0 -2
  732. package/dist/chunks/Document-znhIcvM9.mjs.map +0 -1
  733. package/dist/chunks/DocumentParser-DCjOW3us.mjs +0 -2
  734. package/dist/chunks/DocumentParser-DCjOW3us.mjs.map +0 -1
  735. package/dist/chunks/DomUtils-RKbAVBQz.mjs +0 -2
  736. package/dist/chunks/DomUtils-RKbAVBQz.mjs.map +0 -1
  737. package/dist/chunks/FontPlugin-COYtG1Uo.mjs +0 -2
  738. package/dist/chunks/FontPlugin-COYtG1Uo.mjs.map +0 -1
  739. package/dist/chunks/FontSizePlugin-CLcfdTm3.mjs +0 -2
  740. package/dist/chunks/FontSizePlugin-CLcfdTm3.mjs.map +0 -1
  741. package/dist/chunks/FormulaPlugin-DphHU4Rn.mjs +0 -2
  742. package/dist/chunks/FormulaPlugin-DphHU4Rn.mjs.map +0 -1
  743. package/dist/chunks/GapCursorNavigation-Bkuu_Ek8.mjs +0 -2
  744. package/dist/chunks/GapCursorNavigation-Bkuu_Ek8.mjs.map +0 -1
  745. package/dist/chunks/GapCursorPlugin-CRDmQEi1.mjs +0 -2
  746. package/dist/chunks/GapCursorPlugin-CRDmQEi1.mjs.map +0 -1
  747. package/dist/chunks/HTMLUtils-brwcaufP.mjs +0 -2
  748. package/dist/chunks/HTMLUtils-brwcaufP.mjs.map +0 -1
  749. package/dist/chunks/HardBreakPlugin-Cr6dMQ-H.mjs +0 -2
  750. package/dist/chunks/HardBreakPlugin-Cr6dMQ-H.mjs.map +0 -1
  751. package/dist/chunks/HeadingPlugin-3NL4ARPp.mjs +0 -2
  752. package/dist/chunks/HeadingPlugin-3NL4ARPp.mjs.map +0 -1
  753. package/dist/chunks/HighlightPlugin-dHxnAuoW.mjs +0 -2
  754. package/dist/chunks/HighlightPlugin-dHxnAuoW.mjs.map +0 -1
  755. package/dist/chunks/HorizontalRulePlugin-BYPaI4TR.mjs +0 -2
  756. package/dist/chunks/HorizontalRulePlugin-BYPaI4TR.mjs.map +0 -1
  757. package/dist/chunks/ImagePlugin-kgokm-a1.mjs +0 -2
  758. package/dist/chunks/ImagePlugin-kgokm-a1.mjs.map +0 -1
  759. package/dist/chunks/InlineCodePlugin-Bl1jyDwk.mjs +0 -2
  760. package/dist/chunks/InlineCodePlugin-Bl1jyDwk.mjs.map +0 -1
  761. package/dist/chunks/InlineStyleMarkSpec-Cc-b1tlm.mjs +0 -2
  762. package/dist/chunks/InlineStyleMarkSpec-Cc-b1tlm.mjs.map +0 -1
  763. package/dist/chunks/KeyboardNav-DZXdTg-_.mjs +0 -2
  764. package/dist/chunks/KeyboardNav-DZXdTg-_.mjs.map +0 -1
  765. package/dist/chunks/LinkPlugin-Dmcfo3On.mjs +0 -2
  766. package/dist/chunks/LinkPlugin-Dmcfo3On.mjs.map +0 -1
  767. package/dist/chunks/ListPlugin-Ch-5CsFc.mjs +0 -2
  768. package/dist/chunks/ListPlugin-Ch-5CsFc.mjs.map +0 -1
  769. package/dist/chunks/NavigationQueries-3zTaNBlp.mjs +0 -2
  770. package/dist/chunks/NavigationQueries-3zTaNBlp.mjs.map +0 -1
  771. package/dist/chunks/NodeResolver-BplmzA7c.mjs +0 -2
  772. package/dist/chunks/NodeResolver-BplmzA7c.mjs.map +0 -1
  773. package/dist/chunks/NodeSelectionCommands-dUmbRoZ2.mjs +0 -2
  774. package/dist/chunks/NodeSelectionCommands-dUmbRoZ2.mjs.map +0 -1
  775. package/dist/chunks/NodeSpecPatching-DToX09gc.mjs +0 -2
  776. package/dist/chunks/NodeSpecPatching-DToX09gc.mjs.map +0 -1
  777. package/dist/chunks/Platform-wPvKFB9m.mjs +0 -2
  778. package/dist/chunks/Platform-wPvKFB9m.mjs.map +0 -1
  779. package/dist/chunks/PluginHelpers-C3aCCGfX.mjs +0 -2
  780. package/dist/chunks/PluginHelpers-C3aCCGfX.mjs.map +0 -1
  781. package/dist/chunks/PopupKeyboardPatterns-ZdAQB78m.mjs +0 -2
  782. package/dist/chunks/PopupKeyboardPatterns-ZdAQB78m.mjs.map +0 -1
  783. package/dist/chunks/PopupManager-DsT1uRWi.mjs +0 -2
  784. package/dist/chunks/PopupManager-DsT1uRWi.mjs.map +0 -1
  785. package/dist/chunks/PopupPositioning-BEnz90Oh.mjs +0 -2
  786. package/dist/chunks/PopupPositioning-BEnz90Oh.mjs.map +0 -1
  787. package/dist/chunks/PrintPlugin-Bq-Z14K1.mjs +0 -2
  788. package/dist/chunks/PrintPlugin-Bq-Z14K1.mjs.map +0 -1
  789. package/dist/chunks/PrintTypes-DA0Cc--M.mjs +0 -2
  790. package/dist/chunks/PrintTypes-DA0Cc--M.mjs.map +0 -1
  791. package/dist/chunks/RangeIterator-Cl4_k8cx.mjs +0 -2
  792. package/dist/chunks/RangeIterator-Cl4_k8cx.mjs.map +0 -1
  793. package/dist/chunks/Selection-aeiSsvhe.mjs +0 -2
  794. package/dist/chunks/Selection-aeiSsvhe.mjs.map +0 -1
  795. package/dist/chunks/SelectionSync-DCJpNFat.mjs +0 -2
  796. package/dist/chunks/SelectionSync-DCJpNFat.mjs.map +0 -1
  797. package/dist/chunks/ShortcutFormatting-DZK70CN9.mjs +0 -2
  798. package/dist/chunks/ShortcutFormatting-DZK70CN9.mjs.map +0 -1
  799. package/dist/chunks/SimpleMark-CezTJnXh.mjs +0 -2
  800. package/dist/chunks/SimpleMark-CezTJnXh.mjs.map +0 -1
  801. package/dist/chunks/SmartPastePlugin-DlApY6Vw.mjs +0 -2
  802. package/dist/chunks/SmartPastePlugin-DlApY6Vw.mjs.map +0 -1
  803. package/dist/chunks/StrikethroughPlugin-BuFDABvz.mjs +0 -2
  804. package/dist/chunks/StrikethroughPlugin-BuFDABvz.mjs.map +0 -1
  805. package/dist/chunks/StyleRuntime-Bwde5icB.mjs +0 -2
  806. package/dist/chunks/StyleRuntime-Bwde5icB.mjs.map +0 -1
  807. package/dist/chunks/SuperSubPlugin-CiLJ7i4s.mjs +0 -2
  808. package/dist/chunks/SuperSubPlugin-CiLJ7i4s.mjs.map +0 -1
  809. package/dist/chunks/SyntaxTokenTypes-C9dGwufi.mjs +0 -2
  810. package/dist/chunks/SyntaxTokenTypes-C9dGwufi.mjs.map +0 -1
  811. package/dist/chunks/TablePlugin-5ru-y-YX.mjs +0 -2
  812. package/dist/chunks/TablePlugin-5ru-y-YX.mjs.map +0 -1
  813. package/dist/chunks/TextColorPlugin-Vz-Nz8aH.mjs +0 -2
  814. package/dist/chunks/TextColorPlugin-Vz-Nz8aH.mjs.map +0 -1
  815. package/dist/chunks/TextDirectionAutoPlugin-Behl6KMe.mjs +0 -2
  816. package/dist/chunks/TextDirectionAutoPlugin-Behl6KMe.mjs.map +0 -1
  817. package/dist/chunks/TextDirectionPlugin-C3h1n-aA.mjs +0 -2
  818. package/dist/chunks/TextDirectionPlugin-C3h1n-aA.mjs.map +0 -1
  819. package/dist/chunks/TextDirectionService-DRfeQnF6.mjs +0 -2
  820. package/dist/chunks/TextDirectionService-DRfeQnF6.mjs.map +0 -1
  821. package/dist/chunks/TextFormattingPlugin-D_nRMeBn.mjs +0 -2
  822. package/dist/chunks/TextFormattingPlugin-D_nRMeBn.mjs.map +0 -1
  823. package/dist/chunks/ToolbarPlugin-CSMSgjPM.mjs +0 -2
  824. package/dist/chunks/ToolbarPlugin-CSMSgjPM.mjs.map +0 -1
  825. package/dist/chunks/TypeBrands-BZDKMjR-.mjs +0 -2
  826. package/dist/chunks/TypeBrands-BZDKMjR-.mjs.map +0 -1
  827. package/dist/chunks/TypedKeys-E3jOGByL.mjs +0 -2
  828. package/dist/chunks/TypedKeys-E3jOGByL.mjs.map +0 -1
  829. package/dist/chunks/VideoPlugin-BUCGIYXr.mjs +0 -2
  830. package/dist/chunks/VideoPlugin-BUCGIYXr.mjs.map +0 -1
  831. package/dist/chunks/WordBoundary-CYDAtEks.mjs +0 -2
  832. package/dist/chunks/WordBoundary-CYDAtEks.mjs.map +0 -1
  833. package/dist/chunks/XmlDetector-DxBGXqua.mjs +0 -2
  834. package/dist/chunks/XmlDetector-DxBGXqua.mjs.map +0 -1
  835. package/dist/chunks/XmlPatterns-BiHS8w3k.mjs +0 -2
  836. package/dist/chunks/XmlPatterns-BiHS8w3k.mjs.map +0 -1
  837. package/dist/chunks/XmlSupport-B_F65M8G.mjs +0 -2
  838. package/dist/chunks/XmlSupport-B_F65M8G.mjs.map +0 -1
  839. package/dist/chunks/ar-B38MlRRN.mjs +0 -2
  840. package/dist/chunks/ar-B38MlRRN.mjs.map +0 -1
  841. package/dist/chunks/ar-BIeE0C5A.mjs +0 -2
  842. package/dist/chunks/ar-BIeE0C5A.mjs.map +0 -1
  843. package/dist/chunks/ar-BK0rFxF_.mjs +0 -2
  844. package/dist/chunks/ar-BK0rFxF_.mjs.map +0 -1
  845. package/dist/chunks/ar-BK4O36ep.mjs +0 -2
  846. package/dist/chunks/ar-BK4O36ep.mjs.map +0 -1
  847. package/dist/chunks/ar-BNUWuZe3.mjs +0 -2
  848. package/dist/chunks/ar-BNUWuZe3.mjs.map +0 -1
  849. package/dist/chunks/ar-BSXH8acw.mjs +0 -2
  850. package/dist/chunks/ar-BSXH8acw.mjs.map +0 -1
  851. package/dist/chunks/ar-BY8yNlGe.mjs +0 -2
  852. package/dist/chunks/ar-BY8yNlGe.mjs.map +0 -1
  853. package/dist/chunks/ar-BgHkduPE.mjs +0 -2
  854. package/dist/chunks/ar-BgHkduPE.mjs.map +0 -1
  855. package/dist/chunks/ar-BnfWtLhK.mjs +0 -2
  856. package/dist/chunks/ar-BnfWtLhK.mjs.map +0 -1
  857. package/dist/chunks/ar-BwCPhCf6.mjs +0 -2
  858. package/dist/chunks/ar-BwCPhCf6.mjs.map +0 -1
  859. package/dist/chunks/ar-Bymjd9Z_.mjs +0 -2
  860. package/dist/chunks/ar-Bymjd9Z_.mjs.map +0 -1
  861. package/dist/chunks/ar-CKPpdJ7F.mjs +0 -2
  862. package/dist/chunks/ar-CKPpdJ7F.mjs.map +0 -1
  863. package/dist/chunks/ar-C_ir5Uf4.mjs +0 -2
  864. package/dist/chunks/ar-C_ir5Uf4.mjs.map +0 -1
  865. package/dist/chunks/ar-CkE6GDVA.mjs +0 -2
  866. package/dist/chunks/ar-CkE6GDVA.mjs.map +0 -1
  867. package/dist/chunks/ar-ClgA1KQM.mjs +0 -2
  868. package/dist/chunks/ar-ClgA1KQM.mjs.map +0 -1
  869. package/dist/chunks/ar-Cm1DOK74.mjs +0 -2
  870. package/dist/chunks/ar-Cm1DOK74.mjs.map +0 -1
  871. package/dist/chunks/ar-CseGhQtS.mjs +0 -2
  872. package/dist/chunks/ar-CseGhQtS.mjs.map +0 -1
  873. package/dist/chunks/ar-D0bqkviV.mjs +0 -2
  874. package/dist/chunks/ar-D0bqkviV.mjs.map +0 -1
  875. package/dist/chunks/ar-D5d185g0.mjs +0 -2
  876. package/dist/chunks/ar-D5d185g0.mjs.map +0 -1
  877. package/dist/chunks/ar-DSwUyX47.mjs +0 -2
  878. package/dist/chunks/ar-DSwUyX47.mjs.map +0 -1
  879. package/dist/chunks/ar-DfSNWZX7.mjs +0 -2
  880. package/dist/chunks/ar-DfSNWZX7.mjs.map +0 -1
  881. package/dist/chunks/ar-Dghtfs46.mjs +0 -2
  882. package/dist/chunks/ar-Dghtfs46.mjs.map +0 -1
  883. package/dist/chunks/ar-DvNKBrJd.mjs +0 -2
  884. package/dist/chunks/ar-DvNKBrJd.mjs.map +0 -1
  885. package/dist/chunks/ar-KNULRI8r.mjs +0 -2
  886. package/dist/chunks/ar-KNULRI8r.mjs.map +0 -1
  887. package/dist/chunks/ar-NtGRavHz.mjs +0 -2
  888. package/dist/chunks/ar-NtGRavHz.mjs.map +0 -1
  889. package/dist/chunks/ar-Y9KjJLX8.mjs +0 -2
  890. package/dist/chunks/ar-Y9KjJLX8.mjs.map +0 -1
  891. package/dist/chunks/ar-odM5gkvw.mjs +0 -2
  892. package/dist/chunks/ar-odM5gkvw.mjs.map +0 -1
  893. package/dist/chunks/color-picker-C89H4SVX.mjs +0 -2
  894. package/dist/chunks/color-picker-C89H4SVX.mjs.map +0 -1
  895. package/dist/chunks/de-B1TXiyll.mjs +0 -2
  896. package/dist/chunks/de-B1TXiyll.mjs.map +0 -1
  897. package/dist/chunks/de-BDRaxLyi.mjs +0 -2
  898. package/dist/chunks/de-BDRaxLyi.mjs.map +0 -1
  899. package/dist/chunks/de-BGOpZ8Ls.mjs +0 -2
  900. package/dist/chunks/de-BGOpZ8Ls.mjs.map +0 -1
  901. package/dist/chunks/de-BfZ5qXWz.mjs +0 -2
  902. package/dist/chunks/de-BfZ5qXWz.mjs.map +0 -1
  903. package/dist/chunks/de-BibufNIa.mjs +0 -2
  904. package/dist/chunks/de-BibufNIa.mjs.map +0 -1
  905. package/dist/chunks/de-BkZqCmzL.mjs +0 -2
  906. package/dist/chunks/de-BkZqCmzL.mjs.map +0 -1
  907. package/dist/chunks/de-BzRd2oyR.mjs +0 -2
  908. package/dist/chunks/de-BzRd2oyR.mjs.map +0 -1
  909. package/dist/chunks/de-C4gnHDmk.mjs +0 -2
  910. package/dist/chunks/de-C4gnHDmk.mjs.map +0 -1
  911. package/dist/chunks/de-C4iw9SEp.mjs +0 -2
  912. package/dist/chunks/de-C4iw9SEp.mjs.map +0 -1
  913. package/dist/chunks/de-CLWzcDoW.mjs +0 -2
  914. package/dist/chunks/de-CLWzcDoW.mjs.map +0 -1
  915. package/dist/chunks/de-Cbv0otYM.mjs +0 -2
  916. package/dist/chunks/de-Cbv0otYM.mjs.map +0 -1
  917. package/dist/chunks/de-Cinp7zmo.mjs +0 -2
  918. package/dist/chunks/de-Cinp7zmo.mjs.map +0 -1
  919. package/dist/chunks/de-CvnyjI_X.mjs +0 -2
  920. package/dist/chunks/de-CvnyjI_X.mjs.map +0 -1
  921. package/dist/chunks/de-DCx3Shj3.mjs +0 -2
  922. package/dist/chunks/de-DCx3Shj3.mjs.map +0 -1
  923. package/dist/chunks/de-Dav2GzjV.mjs +0 -2
  924. package/dist/chunks/de-Dav2GzjV.mjs.map +0 -1
  925. package/dist/chunks/de-Dc7GRbWc.mjs +0 -2
  926. package/dist/chunks/de-Dc7GRbWc.mjs.map +0 -1
  927. package/dist/chunks/de-DdntlpT3.mjs +0 -2
  928. package/dist/chunks/de-DdntlpT3.mjs.map +0 -1
  929. package/dist/chunks/de-DefykdF-.mjs +0 -2
  930. package/dist/chunks/de-DefykdF-.mjs.map +0 -1
  931. package/dist/chunks/de-DfQQIP8Y.mjs +0 -2
  932. package/dist/chunks/de-DfQQIP8Y.mjs.map +0 -1
  933. package/dist/chunks/de-DkcKDkbA.mjs +0 -2
  934. package/dist/chunks/de-DkcKDkbA.mjs.map +0 -1
  935. package/dist/chunks/de-DqGfLfeV.mjs +0 -2
  936. package/dist/chunks/de-DqGfLfeV.mjs.map +0 -1
  937. package/dist/chunks/de-DudqIJho.mjs +0 -2
  938. package/dist/chunks/de-DudqIJho.mjs.map +0 -1
  939. package/dist/chunks/de-LCXA2xWj.mjs +0 -2
  940. package/dist/chunks/de-LCXA2xWj.mjs.map +0 -1
  941. package/dist/chunks/de-YygmrxGp.mjs +0 -2
  942. package/dist/chunks/de-YygmrxGp.mjs.map +0 -1
  943. package/dist/chunks/de-asI3UlFG.mjs +0 -2
  944. package/dist/chunks/de-asI3UlFG.mjs.map +0 -1
  945. package/dist/chunks/de-kvMvD3AJ.mjs +0 -2
  946. package/dist/chunks/de-kvMvD3AJ.mjs.map +0 -1
  947. package/dist/chunks/de-pnfTnS03.mjs +0 -2
  948. package/dist/chunks/de-pnfTnS03.mjs.map +0 -1
  949. package/dist/chunks/es-4tbAR0If.mjs +0 -2
  950. package/dist/chunks/es-4tbAR0If.mjs.map +0 -1
  951. package/dist/chunks/es-B9z2Xwj0.mjs +0 -2
  952. package/dist/chunks/es-B9z2Xwj0.mjs.map +0 -1
  953. package/dist/chunks/es-BJxjRQSg.mjs +0 -2
  954. package/dist/chunks/es-BJxjRQSg.mjs.map +0 -1
  955. package/dist/chunks/es-BSyxBRjn.mjs +0 -2
  956. package/dist/chunks/es-BSyxBRjn.mjs.map +0 -1
  957. package/dist/chunks/es-Bcpq2xfU.mjs +0 -2
  958. package/dist/chunks/es-Bcpq2xfU.mjs.map +0 -1
  959. package/dist/chunks/es-BhUjc8mO.mjs +0 -2
  960. package/dist/chunks/es-BhUjc8mO.mjs.map +0 -1
  961. package/dist/chunks/es-Bm7hoJSI.mjs +0 -2
  962. package/dist/chunks/es-Bm7hoJSI.mjs.map +0 -1
  963. package/dist/chunks/es-C0E-lFIC.mjs +0 -2
  964. package/dist/chunks/es-C0E-lFIC.mjs.map +0 -1
  965. package/dist/chunks/es-C2wBBQ7N.mjs +0 -2
  966. package/dist/chunks/es-C2wBBQ7N.mjs.map +0 -1
  967. package/dist/chunks/es-C9vhYpfP.mjs +0 -2
  968. package/dist/chunks/es-C9vhYpfP.mjs.map +0 -1
  969. package/dist/chunks/es-Cgslt0Hp.mjs +0 -2
  970. package/dist/chunks/es-Cgslt0Hp.mjs.map +0 -1
  971. package/dist/chunks/es-CksXDFxg.mjs +0 -2
  972. package/dist/chunks/es-CksXDFxg.mjs.map +0 -1
  973. package/dist/chunks/es-CnQUZlfY.mjs +0 -2
  974. package/dist/chunks/es-CnQUZlfY.mjs.map +0 -1
  975. package/dist/chunks/es-CrRNOn2Q.mjs +0 -2
  976. package/dist/chunks/es-CrRNOn2Q.mjs.map +0 -1
  977. package/dist/chunks/es-D0427MIH.mjs +0 -2
  978. package/dist/chunks/es-D0427MIH.mjs.map +0 -1
  979. package/dist/chunks/es-D19xfXus.mjs +0 -2
  980. package/dist/chunks/es-D19xfXus.mjs.map +0 -1
  981. package/dist/chunks/es-Dk6lCcOt.mjs +0 -2
  982. package/dist/chunks/es-Dk6lCcOt.mjs.map +0 -1
  983. package/dist/chunks/es-Dls_xPCW.mjs +0 -2
  984. package/dist/chunks/es-Dls_xPCW.mjs.map +0 -1
  985. package/dist/chunks/es-DrcsyDvI.mjs +0 -2
  986. package/dist/chunks/es-DrcsyDvI.mjs.map +0 -1
  987. package/dist/chunks/es-DwKejbO9.mjs +0 -2
  988. package/dist/chunks/es-DwKejbO9.mjs.map +0 -1
  989. package/dist/chunks/es-NcrWuNe1.mjs +0 -2
  990. package/dist/chunks/es-NcrWuNe1.mjs.map +0 -1
  991. package/dist/chunks/es-RaZerssd.mjs +0 -2
  992. package/dist/chunks/es-RaZerssd.mjs.map +0 -1
  993. package/dist/chunks/es-TIjHCFNF.mjs +0 -2
  994. package/dist/chunks/es-TIjHCFNF.mjs.map +0 -1
  995. package/dist/chunks/es-eZcDkBb-.mjs +0 -2
  996. package/dist/chunks/es-eZcDkBb-.mjs.map +0 -1
  997. package/dist/chunks/es-j_-KW9-4.mjs +0 -2
  998. package/dist/chunks/es-j_-KW9-4.mjs.map +0 -1
  999. package/dist/chunks/es-kGLwn8EB.mjs +0 -2
  1000. package/dist/chunks/es-kGLwn8EB.mjs.map +0 -1
  1001. package/dist/chunks/es-qQRDC0Ge.mjs +0 -2
  1002. package/dist/chunks/es-qQRDC0Ge.mjs.map +0 -1
  1003. package/dist/chunks/fonts-ZXAIMT3b.mjs +0 -2
  1004. package/dist/chunks/fonts-ZXAIMT3b.mjs.map +0 -1
  1005. package/dist/chunks/fr-B27zAq0X.mjs +0 -2
  1006. package/dist/chunks/fr-B27zAq0X.mjs.map +0 -1
  1007. package/dist/chunks/fr-BEd3ZHO4.mjs +0 -2
  1008. package/dist/chunks/fr-BEd3ZHO4.mjs.map +0 -1
  1009. package/dist/chunks/fr-BHXLpdaH.mjs +0 -2
  1010. package/dist/chunks/fr-BHXLpdaH.mjs.map +0 -1
  1011. package/dist/chunks/fr-BKu4eU3V.mjs +0 -2
  1012. package/dist/chunks/fr-BKu4eU3V.mjs.map +0 -1
  1013. package/dist/chunks/fr-BUrUZ5UQ.mjs +0 -2
  1014. package/dist/chunks/fr-BUrUZ5UQ.mjs.map +0 -1
  1015. package/dist/chunks/fr-BlqlUQ3b.mjs +0 -2
  1016. package/dist/chunks/fr-BlqlUQ3b.mjs.map +0 -1
  1017. package/dist/chunks/fr-BruEqDw1.mjs +0 -2
  1018. package/dist/chunks/fr-BruEqDw1.mjs.map +0 -1
  1019. package/dist/chunks/fr-BwuuFBkA.mjs +0 -2
  1020. package/dist/chunks/fr-BwuuFBkA.mjs.map +0 -1
  1021. package/dist/chunks/fr-C2lLh5Ti.mjs +0 -2
  1022. package/dist/chunks/fr-C2lLh5Ti.mjs.map +0 -1
  1023. package/dist/chunks/fr-C7N2_AlK.mjs +0 -2
  1024. package/dist/chunks/fr-C7N2_AlK.mjs.map +0 -1
  1025. package/dist/chunks/fr-COfd6sLW.mjs +0 -2
  1026. package/dist/chunks/fr-COfd6sLW.mjs.map +0 -1
  1027. package/dist/chunks/fr-COx4cSxc.mjs +0 -2
  1028. package/dist/chunks/fr-COx4cSxc.mjs.map +0 -1
  1029. package/dist/chunks/fr-CX37XjPO.mjs +0 -2
  1030. package/dist/chunks/fr-CX37XjPO.mjs.map +0 -1
  1031. package/dist/chunks/fr-CYn6fMiH.mjs +0 -2
  1032. package/dist/chunks/fr-CYn6fMiH.mjs.map +0 -1
  1033. package/dist/chunks/fr-CbsiyDEa.mjs +0 -2
  1034. package/dist/chunks/fr-CbsiyDEa.mjs.map +0 -1
  1035. package/dist/chunks/fr-CcZiELJY.mjs +0 -2
  1036. package/dist/chunks/fr-CcZiELJY.mjs.map +0 -1
  1037. package/dist/chunks/fr-CeHzUPVT.mjs +0 -2
  1038. package/dist/chunks/fr-CeHzUPVT.mjs.map +0 -1
  1039. package/dist/chunks/fr-Cv73J4QZ.mjs +0 -2
  1040. package/dist/chunks/fr-Cv73J4QZ.mjs.map +0 -1
  1041. package/dist/chunks/fr-DDLuorz7.mjs +0 -2
  1042. package/dist/chunks/fr-DDLuorz7.mjs.map +0 -1
  1043. package/dist/chunks/fr-DMA4CAyo.mjs +0 -2
  1044. package/dist/chunks/fr-DMA4CAyo.mjs.map +0 -1
  1045. package/dist/chunks/fr-DNJuGtO1.mjs +0 -2
  1046. package/dist/chunks/fr-DNJuGtO1.mjs.map +0 -1
  1047. package/dist/chunks/fr-DQOE8O6_.mjs +0 -2
  1048. package/dist/chunks/fr-DQOE8O6_.mjs.map +0 -1
  1049. package/dist/chunks/fr-DXjOwGew.mjs +0 -2
  1050. package/dist/chunks/fr-DXjOwGew.mjs.map +0 -1
  1051. package/dist/chunks/fr-DilrEvE_.mjs +0 -2
  1052. package/dist/chunks/fr-DilrEvE_.mjs.map +0 -1
  1053. package/dist/chunks/fr-P7iY3ntE.mjs +0 -2
  1054. package/dist/chunks/fr-P7iY3ntE.mjs.map +0 -1
  1055. package/dist/chunks/fr-ViUNGo_J.mjs +0 -2
  1056. package/dist/chunks/fr-ViUNGo_J.mjs.map +0 -1
  1057. package/dist/chunks/fr-gdIyLcGC.mjs +0 -2
  1058. package/dist/chunks/fr-gdIyLcGC.mjs.map +0 -1
  1059. package/dist/chunks/full-h88Sb2MR.mjs +0 -2
  1060. package/dist/chunks/full-h88Sb2MR.mjs.map +0 -1
  1061. package/dist/chunks/hi-BC82Jxjl.mjs +0 -2
  1062. package/dist/chunks/hi-BC82Jxjl.mjs.map +0 -1
  1063. package/dist/chunks/hi-BCTarnem.mjs +0 -2
  1064. package/dist/chunks/hi-BCTarnem.mjs.map +0 -1
  1065. package/dist/chunks/hi-BMStjhJF.mjs +0 -2
  1066. package/dist/chunks/hi-BMStjhJF.mjs.map +0 -1
  1067. package/dist/chunks/hi-BQ2Fyx7t.mjs +0 -2
  1068. package/dist/chunks/hi-BQ2Fyx7t.mjs.map +0 -1
  1069. package/dist/chunks/hi-Bg4-z2Os.mjs +0 -2
  1070. package/dist/chunks/hi-Bg4-z2Os.mjs.map +0 -1
  1071. package/dist/chunks/hi-BgqI_gOH.mjs +0 -2
  1072. package/dist/chunks/hi-BgqI_gOH.mjs.map +0 -1
  1073. package/dist/chunks/hi-CEPSeUBX.mjs +0 -2
  1074. package/dist/chunks/hi-CEPSeUBX.mjs.map +0 -1
  1075. package/dist/chunks/hi-CRaZj5Uo.mjs +0 -2
  1076. package/dist/chunks/hi-CRaZj5Uo.mjs.map +0 -1
  1077. package/dist/chunks/hi-CT0uK1Me.mjs +0 -2
  1078. package/dist/chunks/hi-CT0uK1Me.mjs.map +0 -1
  1079. package/dist/chunks/hi-CnIpMd8L.mjs +0 -2
  1080. package/dist/chunks/hi-CnIpMd8L.mjs.map +0 -1
  1081. package/dist/chunks/hi-CnSv0JhL.mjs +0 -2
  1082. package/dist/chunks/hi-CnSv0JhL.mjs.map +0 -1
  1083. package/dist/chunks/hi-DLLBZu67.mjs +0 -2
  1084. package/dist/chunks/hi-DLLBZu67.mjs.map +0 -1
  1085. package/dist/chunks/hi-DMg_aiSR.mjs +0 -2
  1086. package/dist/chunks/hi-DMg_aiSR.mjs.map +0 -1
  1087. package/dist/chunks/hi-DWwLzOX5.mjs +0 -2
  1088. package/dist/chunks/hi-DWwLzOX5.mjs.map +0 -1
  1089. package/dist/chunks/hi-D_4Xi4Nv.mjs +0 -2
  1090. package/dist/chunks/hi-D_4Xi4Nv.mjs.map +0 -1
  1091. package/dist/chunks/hi-D_Jtykmj.mjs +0 -2
  1092. package/dist/chunks/hi-D_Jtykmj.mjs.map +0 -1
  1093. package/dist/chunks/hi-Da5pRz8E.mjs +0 -2
  1094. package/dist/chunks/hi-Da5pRz8E.mjs.map +0 -1
  1095. package/dist/chunks/hi-DqL20WmM.mjs +0 -2
  1096. package/dist/chunks/hi-DqL20WmM.mjs.map +0 -1
  1097. package/dist/chunks/hi-DwQopxRg.mjs +0 -2
  1098. package/dist/chunks/hi-DwQopxRg.mjs.map +0 -1
  1099. package/dist/chunks/hi-IuMohSSw.mjs +0 -2
  1100. package/dist/chunks/hi-IuMohSSw.mjs.map +0 -1
  1101. package/dist/chunks/hi-PUX7dDPm.mjs +0 -2
  1102. package/dist/chunks/hi-PUX7dDPm.mjs.map +0 -1
  1103. package/dist/chunks/hi-RmfZAmwT.mjs +0 -2
  1104. package/dist/chunks/hi-RmfZAmwT.mjs.map +0 -1
  1105. package/dist/chunks/hi-UIBrTEVu.mjs +0 -2
  1106. package/dist/chunks/hi-UIBrTEVu.mjs.map +0 -1
  1107. package/dist/chunks/hi-_SjWnfeh.mjs +0 -2
  1108. package/dist/chunks/hi-_SjWnfeh.mjs.map +0 -1
  1109. package/dist/chunks/hi-dV2GZgH_.mjs +0 -2
  1110. package/dist/chunks/hi-dV2GZgH_.mjs.map +0 -1
  1111. package/dist/chunks/hi-ehh5oKz3.mjs +0 -2
  1112. package/dist/chunks/hi-ehh5oKz3.mjs.map +0 -1
  1113. package/dist/chunks/hi-yXnRBFJK.mjs +0 -2
  1114. package/dist/chunks/hi-yXnRBFJK.mjs.map +0 -1
  1115. package/dist/chunks/minimal-a40NeBQ_.mjs +0 -2
  1116. package/dist/chunks/minimal-a40NeBQ_.mjs.map +0 -1
  1117. package/dist/chunks/pt-2a8Oto6x.mjs +0 -2
  1118. package/dist/chunks/pt-2a8Oto6x.mjs.map +0 -1
  1119. package/dist/chunks/pt-ALzIyTiI.mjs +0 -2
  1120. package/dist/chunks/pt-ALzIyTiI.mjs.map +0 -1
  1121. package/dist/chunks/pt-B2hMlTc6.mjs +0 -2
  1122. package/dist/chunks/pt-B2hMlTc6.mjs.map +0 -1
  1123. package/dist/chunks/pt-BCIkSb0w.mjs +0 -2
  1124. package/dist/chunks/pt-BCIkSb0w.mjs.map +0 -1
  1125. package/dist/chunks/pt-BFotmq5x.mjs +0 -2
  1126. package/dist/chunks/pt-BFotmq5x.mjs.map +0 -1
  1127. package/dist/chunks/pt-BM7OScX6.mjs +0 -2
  1128. package/dist/chunks/pt-BM7OScX6.mjs.map +0 -1
  1129. package/dist/chunks/pt-BM7zXWxW.mjs +0 -2
  1130. package/dist/chunks/pt-BM7zXWxW.mjs.map +0 -1
  1131. package/dist/chunks/pt-BchCuzFq.mjs +0 -2
  1132. package/dist/chunks/pt-BchCuzFq.mjs.map +0 -1
  1133. package/dist/chunks/pt-BmcHFWoR.mjs +0 -2
  1134. package/dist/chunks/pt-BmcHFWoR.mjs.map +0 -1
  1135. package/dist/chunks/pt-C53W99RV.mjs +0 -2
  1136. package/dist/chunks/pt-C53W99RV.mjs.map +0 -1
  1137. package/dist/chunks/pt-CORQy8qv.mjs +0 -2
  1138. package/dist/chunks/pt-CORQy8qv.mjs.map +0 -1
  1139. package/dist/chunks/pt-CUPKr943.mjs +0 -2
  1140. package/dist/chunks/pt-CUPKr943.mjs.map +0 -1
  1141. package/dist/chunks/pt-CYkKDsLa.mjs +0 -2
  1142. package/dist/chunks/pt-CYkKDsLa.mjs.map +0 -1
  1143. package/dist/chunks/pt-Cd_SXHKt.mjs +0 -2
  1144. package/dist/chunks/pt-Cd_SXHKt.mjs.map +0 -1
  1145. package/dist/chunks/pt-CjN3Oq-6.mjs +0 -2
  1146. package/dist/chunks/pt-CjN3Oq-6.mjs.map +0 -1
  1147. package/dist/chunks/pt-CrKrgktr.mjs +0 -2
  1148. package/dist/chunks/pt-CrKrgktr.mjs.map +0 -1
  1149. package/dist/chunks/pt-Crmbkj0e.mjs +0 -2
  1150. package/dist/chunks/pt-Crmbkj0e.mjs.map +0 -1
  1151. package/dist/chunks/pt-D19IWOM_.mjs +0 -2
  1152. package/dist/chunks/pt-D19IWOM_.mjs.map +0 -1
  1153. package/dist/chunks/pt-D6zY7l2E.mjs +0 -2
  1154. package/dist/chunks/pt-D6zY7l2E.mjs.map +0 -1
  1155. package/dist/chunks/pt-DA5hufLZ.mjs +0 -2
  1156. package/dist/chunks/pt-DA5hufLZ.mjs.map +0 -1
  1157. package/dist/chunks/pt-DEfBqu-c.mjs +0 -2
  1158. package/dist/chunks/pt-DEfBqu-c.mjs.map +0 -1
  1159. package/dist/chunks/pt-DG3rw6nK.mjs +0 -2
  1160. package/dist/chunks/pt-DG3rw6nK.mjs.map +0 -1
  1161. package/dist/chunks/pt-DRoAHNZi.mjs +0 -2
  1162. package/dist/chunks/pt-DRoAHNZi.mjs.map +0 -1
  1163. package/dist/chunks/pt-Eml9QiUL.mjs +0 -2
  1164. package/dist/chunks/pt-Eml9QiUL.mjs.map +0 -1
  1165. package/dist/chunks/pt-Haa3wVmA.mjs +0 -2
  1166. package/dist/chunks/pt-Haa3wVmA.mjs.map +0 -1
  1167. package/dist/chunks/pt-aj7zOxTg.mjs +0 -2
  1168. package/dist/chunks/pt-aj7zOxTg.mjs.map +0 -1
  1169. package/dist/chunks/pt-l6dTmkQk.mjs +0 -2
  1170. package/dist/chunks/pt-l6dTmkQk.mjs.map +0 -1
  1171. package/dist/chunks/ru--JPEpdcJ.mjs +0 -2
  1172. package/dist/chunks/ru--JPEpdcJ.mjs.map +0 -1
  1173. package/dist/chunks/ru-B76ORyqe.mjs +0 -2
  1174. package/dist/chunks/ru-B76ORyqe.mjs.map +0 -1
  1175. package/dist/chunks/ru-BDQ62WuE.mjs +0 -2
  1176. package/dist/chunks/ru-BDQ62WuE.mjs.map +0 -1
  1177. package/dist/chunks/ru-BQ6W3lwr.mjs +0 -2
  1178. package/dist/chunks/ru-BQ6W3lwr.mjs.map +0 -1
  1179. package/dist/chunks/ru-BQpaitci.mjs +0 -2
  1180. package/dist/chunks/ru-BQpaitci.mjs.map +0 -1
  1181. package/dist/chunks/ru-Bm9VwJLu.mjs +0 -2
  1182. package/dist/chunks/ru-Bm9VwJLu.mjs.map +0 -1
  1183. package/dist/chunks/ru-BnNdik6i.mjs +0 -2
  1184. package/dist/chunks/ru-BnNdik6i.mjs.map +0 -1
  1185. package/dist/chunks/ru-Bo4am8cd.mjs +0 -2
  1186. package/dist/chunks/ru-Bo4am8cd.mjs.map +0 -1
  1187. package/dist/chunks/ru-C1k56xWQ.mjs +0 -2
  1188. package/dist/chunks/ru-C1k56xWQ.mjs.map +0 -1
  1189. package/dist/chunks/ru-C4rnSQlI.mjs +0 -2
  1190. package/dist/chunks/ru-C4rnSQlI.mjs.map +0 -1
  1191. package/dist/chunks/ru-CKM3t1sv.mjs +0 -2
  1192. package/dist/chunks/ru-CKM3t1sv.mjs.map +0 -1
  1193. package/dist/chunks/ru-CO6eCsxU.mjs +0 -2
  1194. package/dist/chunks/ru-CO6eCsxU.mjs.map +0 -1
  1195. package/dist/chunks/ru-CTaYpQ9_.mjs +0 -2
  1196. package/dist/chunks/ru-CTaYpQ9_.mjs.map +0 -1
  1197. package/dist/chunks/ru-CdY8d80t.mjs +0 -2
  1198. package/dist/chunks/ru-CdY8d80t.mjs.map +0 -1
  1199. package/dist/chunks/ru-CsDtaWRd.mjs +0 -2
  1200. package/dist/chunks/ru-CsDtaWRd.mjs.map +0 -1
  1201. package/dist/chunks/ru-Cy_4nn8h.mjs +0 -2
  1202. package/dist/chunks/ru-Cy_4nn8h.mjs.map +0 -1
  1203. package/dist/chunks/ru-DACtjNuJ.mjs +0 -2
  1204. package/dist/chunks/ru-DACtjNuJ.mjs.map +0 -1
  1205. package/dist/chunks/ru-DN6yN_w9.mjs +0 -2
  1206. package/dist/chunks/ru-DN6yN_w9.mjs.map +0 -1
  1207. package/dist/chunks/ru-DThFtd76.mjs +0 -2
  1208. package/dist/chunks/ru-DThFtd76.mjs.map +0 -1
  1209. package/dist/chunks/ru-Dd_P7hP7.mjs +0 -2
  1210. package/dist/chunks/ru-Dd_P7hP7.mjs.map +0 -1
  1211. package/dist/chunks/ru-Dhuxwzwy.mjs +0 -2
  1212. package/dist/chunks/ru-Dhuxwzwy.mjs.map +0 -1
  1213. package/dist/chunks/ru-Dn6UDGIG.mjs +0 -2
  1214. package/dist/chunks/ru-Dn6UDGIG.mjs.map +0 -1
  1215. package/dist/chunks/ru-DojHc5wu.mjs +0 -2
  1216. package/dist/chunks/ru-DojHc5wu.mjs.map +0 -1
  1217. package/dist/chunks/ru-DyWzWBjV.mjs +0 -2
  1218. package/dist/chunks/ru-DyWzWBjV.mjs.map +0 -1
  1219. package/dist/chunks/ru-NBxCkjlP.mjs +0 -2
  1220. package/dist/chunks/ru-NBxCkjlP.mjs.map +0 -1
  1221. package/dist/chunks/ru-_MQaVHam.mjs +0 -2
  1222. package/dist/chunks/ru-_MQaVHam.mjs.map +0 -1
  1223. package/dist/chunks/ru-wv17PPrd.mjs +0 -2
  1224. package/dist/chunks/ru-wv17PPrd.mjs.map +0 -1
  1225. package/dist/chunks/src-ooaZ_Egu.mjs +0 -2
  1226. package/dist/chunks/src-ooaZ_Egu.mjs.map +0 -1
  1227. package/dist/chunks/zh-2-Y3Limy.mjs +0 -2
  1228. package/dist/chunks/zh-2-Y3Limy.mjs.map +0 -1
  1229. package/dist/chunks/zh-B02VPMqX.mjs +0 -2
  1230. package/dist/chunks/zh-B02VPMqX.mjs.map +0 -1
  1231. package/dist/chunks/zh-BYjLBWWN.mjs +0 -2
  1232. package/dist/chunks/zh-BYjLBWWN.mjs.map +0 -1
  1233. package/dist/chunks/zh-Bt2ZdHcS.mjs +0 -2
  1234. package/dist/chunks/zh-Bt2ZdHcS.mjs.map +0 -1
  1235. package/dist/chunks/zh-BuN_C4o-.mjs +0 -2
  1236. package/dist/chunks/zh-BuN_C4o-.mjs.map +0 -1
  1237. package/dist/chunks/zh-CA3BDj0Y.mjs +0 -2
  1238. package/dist/chunks/zh-CA3BDj0Y.mjs.map +0 -1
  1239. package/dist/chunks/zh-CHuGP7RS.mjs +0 -2
  1240. package/dist/chunks/zh-CHuGP7RS.mjs.map +0 -1
  1241. package/dist/chunks/zh-CIPsF5P8.mjs +0 -2
  1242. package/dist/chunks/zh-CIPsF5P8.mjs.map +0 -1
  1243. package/dist/chunks/zh-C_YS18re.mjs +0 -2
  1244. package/dist/chunks/zh-C_YS18re.mjs.map +0 -1
  1245. package/dist/chunks/zh-CfMPFWUg.mjs +0 -2
  1246. package/dist/chunks/zh-CfMPFWUg.mjs.map +0 -1
  1247. package/dist/chunks/zh-CfjCcBIB.mjs +0 -2
  1248. package/dist/chunks/zh-CfjCcBIB.mjs.map +0 -1
  1249. package/dist/chunks/zh-CqQph809.mjs +0 -2
  1250. package/dist/chunks/zh-CqQph809.mjs.map +0 -1
  1251. package/dist/chunks/zh-Cxe42GC5.mjs +0 -2
  1252. package/dist/chunks/zh-Cxe42GC5.mjs.map +0 -1
  1253. package/dist/chunks/zh-CyMU2cTf.mjs +0 -2
  1254. package/dist/chunks/zh-CyMU2cTf.mjs.map +0 -1
  1255. package/dist/chunks/zh-Cynz1sBa.mjs +0 -2
  1256. package/dist/chunks/zh-Cynz1sBa.mjs.map +0 -1
  1257. package/dist/chunks/zh-DRKs6Q0a.mjs +0 -2
  1258. package/dist/chunks/zh-DRKs6Q0a.mjs.map +0 -1
  1259. package/dist/chunks/zh-DTuIJjx6.mjs +0 -2
  1260. package/dist/chunks/zh-DTuIJjx6.mjs.map +0 -1
  1261. package/dist/chunks/zh-DTz9l6mp.mjs +0 -2
  1262. package/dist/chunks/zh-DTz9l6mp.mjs.map +0 -1
  1263. package/dist/chunks/zh-DZwjiJmn.mjs +0 -2
  1264. package/dist/chunks/zh-DZwjiJmn.mjs.map +0 -1
  1265. package/dist/chunks/zh-D_VJDQl4.mjs +0 -2
  1266. package/dist/chunks/zh-D_VJDQl4.mjs.map +0 -1
  1267. package/dist/chunks/zh-Dt20Om7Z.mjs +0 -2
  1268. package/dist/chunks/zh-Dt20Om7Z.mjs.map +0 -1
  1269. package/dist/chunks/zh-SgsZ9f-W.mjs +0 -2
  1270. package/dist/chunks/zh-SgsZ9f-W.mjs.map +0 -1
  1271. package/dist/chunks/zh-XR7Ls7m-.mjs +0 -2
  1272. package/dist/chunks/zh-XR7Ls7m-.mjs.map +0 -1
  1273. package/dist/chunks/zh-aXPI9lKF.mjs +0 -2
  1274. package/dist/chunks/zh-aXPI9lKF.mjs.map +0 -1
  1275. package/dist/chunks/zh-cLXIKkZQ.mjs +0 -2
  1276. package/dist/chunks/zh-cLXIKkZQ.mjs.map +0 -1
  1277. package/dist/chunks/zh-cZUtN871.mjs +0 -2
  1278. package/dist/chunks/zh-cZUtN871.mjs.map +0 -1
  1279. package/dist/chunks/zh-hcdnCGUp.mjs +0 -2
  1280. package/dist/chunks/zh-hcdnCGUp.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorValidation-DAijTjG9.mjs","names":[],"sources":["../../src/plugins/shared/ColorValidation.ts"],"sourcesContent":["/**\n * Shared CSS validation and normalization utilities\n * for style-based mark plugins (TextColor, Highlight, Font, FontSize).\n */\n\nconst HEX_COLOR_PATTERN: RegExp = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/** Returns `true` when the value is a valid `#RGB` or `#RRGGBB` hex color. */\nexport function isValidHexColor(value: string): boolean {\n\treturn HEX_COLOR_PATTERN.test(value);\n}\n\n// --- CSS Color Validation (broad format support for paste / API input) ---\n\n/** Matches `rgb(r, g, b)` and `rgba(r, g, b, a)` with integer or percentage values. */\nconst RGB_PATTERN: RegExp =\n\t/^rgba?\\(\\s*(\\d{1,3}%?\\s*,\\s*){2}\\d{1,3}%?(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/** Matches `hsl(h, s%, l%)` and `hsla(h, s%, l%, a)`. */\nconst HSL_PATTERN: RegExp =\n\t/^hsla?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}%\\s*,\\s*\\d{1,3}%(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/**\n * Complete set of CSS Level 4 named colors (including `transparent`).\n * Used as an allowlist — unknown names are rejected.\n */\nconst CSS_NAMED_COLORS: ReadonlySet<string> = new Set([\n\t'aliceblue',\n\t'antiquewhite',\n\t'aqua',\n\t'aquamarine',\n\t'azure',\n\t'beige',\n\t'bisque',\n\t'black',\n\t'blanchedalmond',\n\t'blue',\n\t'blueviolet',\n\t'brown',\n\t'burlywood',\n\t'cadetblue',\n\t'chartreuse',\n\t'chocolate',\n\t'coral',\n\t'cornflowerblue',\n\t'cornsilk',\n\t'crimson',\n\t'cyan',\n\t'darkblue',\n\t'darkcyan',\n\t'darkgoldenrod',\n\t'darkgray',\n\t'darkgreen',\n\t'darkgrey',\n\t'darkkhaki',\n\t'darkmagenta',\n\t'darkolivegreen',\n\t'darkorange',\n\t'darkorchid',\n\t'darkred',\n\t'darksalmon',\n\t'darkseagreen',\n\t'darkslateblue',\n\t'darkslategray',\n\t'darkslategrey',\n\t'darkturquoise',\n\t'darkviolet',\n\t'deeppink',\n\t'deepskyblue',\n\t'dimgray',\n\t'dimgrey',\n\t'dodgerblue',\n\t'firebrick',\n\t'floralwhite',\n\t'forestgreen',\n\t'fuchsia',\n\t'gainsboro',\n\t'ghostwhite',\n\t'gold',\n\t'goldenrod',\n\t'gray',\n\t'green',\n\t'greenyellow',\n\t'grey',\n\t'honeydew',\n\t'hotpink',\n\t'indianred',\n\t'indigo',\n\t'ivory',\n\t'khaki',\n\t'lavender',\n\t'lavenderblush',\n\t'lawngreen',\n\t'lemonchiffon',\n\t'lightblue',\n\t'lightcoral',\n\t'lightcyan',\n\t'lightgoldenrodyellow',\n\t'lightgray',\n\t'lightgreen',\n\t'lightgrey',\n\t'lightpink',\n\t'lightsalmon',\n\t'lightseagreen',\n\t'lightskyblue',\n\t'lightslategray',\n\t'lightslategrey',\n\t'lightsteelblue',\n\t'lightyellow',\n\t'lime',\n\t'limegreen',\n\t'linen',\n\t'magenta',\n\t'maroon',\n\t'mediumaquamarine',\n\t'mediumblue',\n\t'mediumorchid',\n\t'mediumpurple',\n\t'mediumseagreen',\n\t'mediumslateblue',\n\t'mediumspringgreen',\n\t'mediumturquoise',\n\t'mediumvioletred',\n\t'midnightblue',\n\t'mintcream',\n\t'mistyrose',\n\t'moccasin',\n\t'navajowhite',\n\t'navy',\n\t'oldlace',\n\t'olive',\n\t'olivedrab',\n\t'orange',\n\t'orangered',\n\t'orchid',\n\t'palegoldenrod',\n\t'palegreen',\n\t'paleturquoise',\n\t'palevioletred',\n\t'papayawhip',\n\t'peachpuff',\n\t'peru',\n\t'pink',\n\t'plum',\n\t'powderblue',\n\t'purple',\n\t'rebeccapurple',\n\t'red',\n\t'rosybrown',\n\t'royalblue',\n\t'saddlebrown',\n\t'salmon',\n\t'sandybrown',\n\t'seagreen',\n\t'seashell',\n\t'sienna',\n\t'silver',\n\t'skyblue',\n\t'slateblue',\n\t'slategray',\n\t'slategrey',\n\t'snow',\n\t'springgreen',\n\t'steelblue',\n\t'tan',\n\t'teal',\n\t'thistle',\n\t'tomato',\n\t'transparent',\n\t'turquoise',\n\t'violet',\n\t'wheat',\n\t'white',\n\t'whitesmoke',\n\t'yellow',\n\t'yellowgreen',\n]);\n\n/**\n * Returns `true` when `value` is a safe CSS color value.\n * Accepts hex (`#RGB`, `#RRGGBB`), `rgb()`, `rgba()`, `hsl()`, `hsla()`,\n * and CSS named colors. Rejects anything else — defense against CSS injection\n * via manipulated color values in `style` attributes.\n */\nexport function isValidCSSColor(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim().toLowerCase();\n\tif (!trimmed) return false;\n\n\treturn (\n\t\tHEX_COLOR_PATTERN.test(trimmed) ||\n\t\tRGB_PATTERN.test(trimmed) ||\n\t\tHSL_PATTERN.test(trimmed) ||\n\t\tCSS_NAMED_COLORS.has(trimmed)\n\t);\n}\n\n/**\n * Validates, deduplicates, and normalizes a user-supplied color list.\n * Returns `fallbackPalette` when no custom colors are provided.\n *\n * @throws {Error} if any value is not a valid hex color code.\n */\nexport function resolveColors(\n\tcolors: readonly string[] | undefined,\n\tfallbackPalette: readonly string[],\n\tpluginName: string,\n): readonly string[] {\n\tif (!colors || colors.length === 0) return fallbackPalette;\n\n\tconst invalid: string[] = colors.filter((c) => !isValidHexColor(c));\n\tif (invalid.length > 0) {\n\t\tthrow new Error(\n\t\t\t`${pluginName}: invalid hex color(s): ${invalid.join(', ')}. Expected format: #RGB or #RRGGBB.`,\n\t\t);\n\t}\n\n\tconst seen: Set<string> = new Set();\n\tconst unique: string[] = [];\n\tfor (const color of colors) {\n\t\tconst normalized: string = color.toLowerCase();\n\t\tif (!seen.has(normalized)) {\n\t\t\tseen.add(normalized);\n\t\t\tunique.push(normalized);\n\t\t}\n\t}\n\treturn unique;\n}\n\n// --- Font Family Validation ---\n\n/** Characters that are never valid in a CSS font-family value. */\nconst FONT_FAMILY_FORBIDDEN: RegExp = /[{}<>;]|url\\(|expression\\(/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-family` value.\n * Rejects values containing `{`, `}`, `;`, `<`, `>`, `url(`, or `expression(`\n * to defend against CSS injection.\n */\nexport function isValidCSSFontFamily(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim();\n\tif (!trimmed) return false;\n\treturn !FONT_FAMILY_FORBIDDEN.test(trimmed);\n}\n\n// --- Font Size Validation ---\n\n/** Matches valid CSS font-size values: number with unit (px, pt, em, rem, %). */\nconst FONT_SIZE_PATTERN: RegExp = /^\\d+(\\.\\d+)?(px|pt|em|rem|%)$/i;\n\n/**\n * Returns `true` when `value` is a safe CSS `font-size` value.\n * Accepts values like `16px`, `1.5em`, `12pt`, `100%`, `0.875rem`.\n */\nexport function isValidCSSFontSize(value: string): boolean {\n\tif (!value) return false;\n\treturn FONT_SIZE_PATTERN.test(value.trim());\n}\n"],"mappings":"AAKA,IAAM,EAA4B,gCAGlC,SAAgB,EAAgB,GAC/B,OAAO,EAAkB,KAAK,EAC/B,CAKA,IAAM,EACL,yEAGK,EACL,gFAMK,EAAwC,IAAI,IAAI,CACrD,YACA,eACA,OACA,aACA,QACA,QACA,SACA,QACA,iBACA,OACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,OACA,QACA,cACA,OACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,SACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,gBACA,MACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,cACA,YACA,SACA,QACA,QACA,aACA,SACA,gBASD,SAAgB,EAAgB,GAC/B,IAAK,EAAO,OAAO,EACnB,MAAM,EAAkB,EAAM,OAAO,cACrC,QAAK,IAGJ,EAAkB,KAAK,IACvB,EAAY,KAAK,IACjB,EAAY,KAAK,IACjB,EAAiB,IAAI,GAEvB,CAQA,SAAgB,EACf,EACA,EACA,GAEA,IAAK,GAA4B,IAAlB,EAAO,OAAc,OAAO,EAE3C,MAAM,EAAoB,EAAO,OAAQ,IAAO,EAAgB,IAChE,GAAI,EAAQ,OAAS,EACpB,MAAM,IAAI,MACT,GAAG,4BAAqC,EAAQ,KAAK,4CAIvD,MAAM,iBAAoB,IAAI,IACxB,EAAmB,GACzB,IAAK,MAAM,KAAS,EAAQ,CAC3B,MAAM,EAAqB,EAAM,cAC5B,EAAK,IAAI,KACb,EAAK,IAAI,GACT,EAAO,KAAK,GAEd,CACA,OAAO,CACR,CAKA,IAAM,EAAgC,8BAOtC,SAAgB,EAAqB,GACpC,IAAK,EAAO,OAAO,EACnB,MAAM,EAAkB,EAAM,OAC9B,QAAK,IACG,EAAsB,KAAK,EACpC,CAKA,IAAM,EAA4B,iCAMlC,SAAgB,EAAmB,GAClC,QAAK,GACE,EAAkB,KAAK,EAAM,OACrC"}
@@ -0,0 +1,2 @@
1
+ import{T as t,_ as n,b as e,g as o,h as r,m as c,n as s,o as i,p as l,s as u,u as f,v as a,w as d}from"./Document-r7vLOAGA.mjs";import{i as m,n as k,r as b,t as g}from"./WordBoundary-DxeMBRyP.mjs";import{a as p,c as I,d as h,l as S,o as B,r as x,t as T,u as O}from"./Selection-HYoVFpAx.mjs";import{i as N,r as y}from"./TypeBrands-Ch9856Gb.mjs";import{r as A}from"./NodeResolver-ChgLF_IP.mjs";import{T as M,b as j,w as v,x as w}from"./BlockInsertion-6rR9tIGP.mjs";import{i as _,n as C,o as P,r as R}from"./NavigationQueries-Bt4zZ17v.mjs";import{a as D,o as Q}from"./AttributedMarkCommands-D4W2Jgpj.mjs";import{n as W,r as q,t as z}from"./NodeSelectionCommands-Dj4VxLdD.mjs";import{n as E}from"./RangeIterator-o8v3msQe.mjs";function F(){return{nodeTypes:["paragraph"],markTypes:["bold","italic","underline"],getNodeSpec:()=>{}}}function G(t){return{nodeTypes:t.getNodeTypes(),markTypes:t.getMarkTypes(),getNodeSpec:n=>t.getNodeSpec(n),getInlineNodeSpec:n=>t.getInlineNodeSpec(n),getMarkSpec:n=>t.getMarkSpec(n)}}function H(t,n){return t.markTypes.includes(n)}function J(t,n){return t.nodeTypes.includes(n)}function K(t,n){if("after"===n.side)return U(t,n);const e=t.getBlockOrder(),o=e.indexOf(n.blockId);if(o<=0)return null;const r=e[o-1];if(!r)return null;if(_(t,r)){const n=A(t.doc,r)??[];return t.transaction("input").setSelection(x(r,n)).build()}const c=t.getBlock(r);if(!c)return null;const s=l(c);return t.transaction("input").setSelection(T(r,s)).build()}function L(t,n){if("before"===n.side)return U(t,n);const e=t.getBlockOrder(),o=e.indexOf(n.blockId);if(o>=e.length-1)return null;const r=e[o+1];if(!r)return null;if(_(t,r)){const n=A(t.doc,r)??[];return t.transaction("input").setSelection(x(r,n)).build()}return t.transaction("input").setSelection(T(r,0)).build()}function U(t,n){const e=A(t.doc,n.blockId)??[];return z(t,x(n.blockId,e))}function V(t,n){const e=A(t.doc,n);if(!e||0===e.length)return-1;const o=e[0];return t.doc.children.findIndex(t=>t.id===o)}var X={bold:!0,italic:!0,underline:!0};function Y(t,n,o=X){if(function(t,n){const e=t;return"bold"===e?!n.bold:"italic"===e?!n.italic:"underline"===e&&!n.underline}(n,o))return null;if(!H(t.schema,n))return null;if(!O(t.selection))return null;const r={type:n},c=t.selection;if(B(c)){if(!t.getBlock(c.anchor.blockId))return null;const o=Q(t),s=e(o,n)?o.filter(t=>t.type!==n):[...o,r];return t.transaction("command").setStoredMarks(s,t.storedMarks).setSelection(c).build()}const s=h(c,t.getBlockOrder()),i=t.transaction("command"),l=et(t,n);return E(t,s,(t,n,e)=>{l?i.removeMark(t,n,e,r):i.addMark(t,n,e,r)}),i.setSelection(c),i.build()}function Z(t,n){return Y(t,N("bold"),n)}function $(t,n){return Y(t,N("italic"),n)}function tt(t,n){return Y(t,N("underline"),n)}function nt(t,n){const o=t.selection;return!!O(o)&&(B(o)?e(Q(t),n):et(t,n))}function et(t,n){const e=t.selection;if(!O(e))return!1;const o=t.getBlockOrder(),r=h(e,o),c=o.indexOf(r.from.blockId),s=o.indexOf(r.to.blockId);let i=!1;for(let u=c;u<=s;u++){const e=o[u];if(!e)continue;const f=t.getBlock(e);if(!f)continue;const a=l(f),d=ot(f,u===c?r.from.offset:0,u===s?r.to.offset:a,n);if("missing"===d)return!1;"present"===d&&(i=!0)}return i}function ot(n,o,r,c){let s=0,i=!1;for(const l of a(n))if(t(l)){const t=s+l.text.length;if(t>o&&s<r&&(i=!0,!e(l.marks,c)))return"missing";s=t}else s+=1;return i?"present":"empty"}function rt(t,n){const e=t.selection;if(S(e))return z(t,e);if(I(e))return null;if(!B(e))return dt(t);const o=t.getBlock(e.anchor.blockId);if(!o)return null;const r=n.range(o,e.anchor.offset);if(!r)return n.merge(t);const[c,s]=r;return t.transaction("input").deleteTextAt(o.id,c,s).setSelection(T(o.id,c)).build()}function ct(t){return rt(t,{merge:bt,range:(t,n)=>n<=0?null:"inline"===o(t,n-1)?.kind?[n-1,n]:[n-(m(r(t),s(t,n))||1),n]})}function st(t){return rt(t,{merge:gt,range:(t,n)=>n>=l(t)?null:"inline"===o(t,n)?.kind?[n,n+1]:[n,n+(b(r(t),s(t,n))||1)]})}function it(t){return rt(t,{merge:bt,range:(t,n)=>n>0?[g(t,n),n]:null})}function lt(t){return rt(t,{merge:gt,range:(t,n)=>n<l(t)?[n,k(t,n)]:null})}function ut(t){return rt(t,{merge:bt,range:(t,n)=>n>0?[0,n]:null})}function ft(t){return rt(t,{merge:gt,range:(t,n)=>{const e=l(t);return n<e?[n,e]:null}})}function at(t,e,o="input"){const r=t.selection;if(S(r))return q(t,r,e,o);if(I(r))return function(t,n,e,o){const{parentPath:r,siblings:c,index:s}=M(t,n.blockId),l="before"===n.side?Math.max(s,0):s>=0?s+1:c.length,u=f(),a=t.transaction(o);return a.insertNode(r,l,i(u)),a.insertText(u,0,e,[]),a.setSelection(T(u,e.length)),a.build()}(t,r,e,o);const s=t.transaction(o),l=function(t){if(t.storedMarks)return t.storedMarks;const e=t.selection;if(!O(e))return[];const o=t.getBlock(e.anchor.blockId);return o?B(e)?n(o,e.anchor.offset,n=>D(t.schema,n)):c(o,e.anchor.offset):[]}(t);let u;B(r)||(u=St(t,s));const a=v(r,t.getBlockOrder()),d=u??a.blockId,m=u?0:a.offset;return s.insertText(d,m,e,l),s.setSelection(T(d,m+e.length)),s.build()}function dt(t){if(S(t.selection))return z(t,t.selection);if(I(t.selection))return null;if(B(t.selection))return null;if(function(t){if(!O(t.selection))return!1;const n=ht(t);if(!n)return!1;const e=h(t.selection,t.getBlockOrder());return e.from.blockId===n.from.blockId&&e.from.offset===n.from.offset&&e.to.blockId===n.to.blockId&&e.to.offset===n.to.offset}(t))return function(t){const n=f(),e=t.transaction("input"),o=t.doc.children.length;e.insertNode([],0,i(n));for(let r=o;r>=1;r--)e.removeNode([],r);return e.setSelection(T(n,0)),e.build()}(t);const n=t.transaction("input"),e=St(t,n),o=h(t.selection,t.getBlockOrder()),r=e??o.from.blockId,c=e?0:o.from.offset;return n.setSelection(T(r,c)),n.build()}function mt(t){const n=t.selection;if(S(n))return W(t,n);if(I(n))return function(t,n){const{parentPath:e,index:o}=M(t,n.blockId);if(o<0)return null;const r="before"===n.side?o:o+1,c=f(),s=t.transaction("input");return s.insertNode(e,r,i(c)),s.setSelection(T(c,0)),s.build()}(t,n);const e=t.transaction("input");let o;B(n)||(o=St(t,e));const r=v(n,t.getBlockOrder()),c=o??r.blockId,s=o?0:r.offset,l=f();return e.splitBlock(c,s,l),e.setSelection(T(l,0)),e.build()}function kt(t){const n=t.selection;if(!O(n))return null;const e=t.transaction("input");let o;if(B(n)||(o=St(t,e)),o)e.insertInlineNode(o,0,u(y("hard_break"))),e.setSelection(T(o,1));else{const{blockId:o,offset:r}=v(n,t.getBlockOrder());e.insertInlineNode(o,r,u(y("hard_break"))),e.setSelection(T(o,r+1))}return e.build()}function bt(t){return pt(t,"backward")}function gt(t){return pt(t,"forward")}function pt(t,n){const e=t.selection;if(!O(e))return null;const o=t.getBlockOrder(),r=o.indexOf(e.anchor.blockId),c="backward"===n?r-1:r+1;if(c<0||c>=o.length)return null;const s=o[c];if(!s)return null;if(R(t,e.anchor.blockId)||R(t,s))return null;if(!P(t,e.anchor.blockId,s)&&C(t,e.anchor.blockId))return null;if(_(t,s)){const n=A(t.doc,s)??[];return t.transaction("input").setSelection(x(s,n)).build()}if("backward"===n){const n=t.getBlock(s);if(!n)return null;const o=l(n);return t.transaction("input").mergeBlocksAt(s,e.anchor.blockId).setSelection(T(s,o)).build()}return t.transaction("input").mergeBlocksAt(e.anchor.blockId,s).setSelection(T(e.anchor.blockId,e.anchor.offset)).build()}function It(t){const n=ht(t);return n?t.transaction("command").setSelection(p(n.from,n.to)).build():t.transaction("command").setSelection(t.selection).build()}function ht(t){const n=t.doc.children,e=n[0],o=n[n.length-1];if(!e||!o)return null;const r=j(e),c=w(o),s=t.getBlock(c);return{from:{blockId:r,offset:0},to:{blockId:c,offset:s?l(s):0}}}function St(t,n){if(!O(t.selection))return;const e=t.getBlockOrder(),o=h(t.selection,e),r=e.indexOf(o.from.blockId),c=e.indexOf(o.to.blockId);if(r===c)return void n.deleteTextAt(o.from.blockId,o.from.offset,o.to.offset);const s=V(t,o.from.blockId),u=V(t,o.to.blockId);if(!(s===u||s<0||u<0))return function(t,n,e,o,r){const c=t.doc.children[o],s=t.doc.children[r];if(!c||!s)return;const u=d(c),a=d(s);let m,k=0;if(u||(m=f(),n.insertNode([],o,i(m)),k=1),u){const o=t.getBlock(e.from.blockId);if(o){const t=l(o);e.from.offset<t&&n.deleteTextAt(e.from.blockId,e.from.offset,t)}}a&&e.to.offset>0&&n.deleteTextAt(e.to.blockId,0,e.to.offset);const b=u?o+1:o+k;for(let i=a?r-1+k:r+k;i>=b;i--)n.removeNode([],i);return u&&a&&n.mergeBlocksAt(e.from.blockId,e.to.blockId),m}(t,n,o,s,u);!function(t,n,e,o,r,c){const s=t.getBlock(o.from.blockId);if(!s)return;const i=l(s);o.from.offset<i&&n.deleteTextAt(o.from.blockId,o.from.offset,i),o.to.offset>0&&n.deleteTextAt(o.to.blockId,0,o.to.offset);for(let u=r+1;u<c;u++){const r=e[u];if(!r)continue;const c=t.getBlock(r);if(!c)continue;const s=l(c);s>0&&n.deleteTextAt(r,0,s),n.mergeBlocksAt(o.from.blockId,r)}n.mergeBlocksAt(o.from.blockId,o.to.blockId)}(t,n,e,o,r,c)}export{J as C,H as S,Y as _,bt as a,L as b,ct as c,ft as d,it as f,$ as g,Z as h,at as i,st as l,nt as m,dt as n,It as o,lt as p,kt as r,mt as s,St as t,ut as u,tt as v,G as w,F as x,K as y};
2
+ //# sourceMappingURL=Commands-BIIpx_Zd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Commands-BIIpx_Zd.mjs","names":[],"sources":["../../src/model/Schema.ts","../../src/commands/GapCursorCommands.ts","../../src/commands/SelectionDeletion.ts","../../src/commands/MarkCommands.ts","../../src/commands/DeleteCommands.ts","../../src/commands/Commands.ts"],"sourcesContent":["/**\n * Schema definition for the Notectl editor.\n * Defines which node types and marks are allowed.\n */\n\nimport type { InlineNodeSpec } from './InlineNodeSpec.js';\nimport type { MarkSpec } from './MarkSpec.js';\nimport type { NodeSpec } from './NodeSpec.js';\nimport type { SchemaRegistry } from './SchemaRegistry.js';\n\nexport interface Schema {\n\treadonly nodeTypes: readonly string[];\n\treadonly markTypes: readonly string[];\n\t/** Looks up the full NodeSpec for a given type. Available when created via schemaFromRegistry. */\n\treadonly getNodeSpec?: (type: string) => NodeSpec | undefined;\n\t/** Looks up the full InlineNodeSpec for a given type. Available via schemaFromRegistry. */\n\treadonly getInlineNodeSpec?: (type: string) => InlineNodeSpec | undefined;\n\t/** Looks up the full MarkSpec for a given type. Available via schemaFromRegistry. */\n\treadonly getMarkSpec?: (type: string) => MarkSpec | undefined;\n}\n\n/** Creates the default schema with paragraph nodes and bold/italic/underline marks. */\nexport function defaultSchema(): Schema {\n\treturn {\n\t\tnodeTypes: ['paragraph'],\n\t\tmarkTypes: ['bold', 'italic', 'underline'],\n\t\tgetNodeSpec: () => undefined,\n\t};\n}\n\n/** Derives a Schema from a SchemaRegistry's registered specs. */\nexport function schemaFromRegistry(registry: SchemaRegistry): Schema {\n\treturn {\n\t\tnodeTypes: registry.getNodeTypes(),\n\t\tmarkTypes: registry.getMarkTypes(),\n\t\tgetNodeSpec: (type: string) => registry.getNodeSpec(type),\n\t\tgetInlineNodeSpec: (type: string) => registry.getInlineNodeSpec(type),\n\t\tgetMarkSpec: (type: string) => registry.getMarkSpec(type),\n\t};\n}\n\n/** Checks whether the given mark type is allowed by the schema. */\nexport function isMarkAllowed(schema: Schema, markType: string): boolean {\n\treturn schema.markTypes.includes(markType);\n}\n\n/** Checks whether the given node type is allowed by the schema. */\nexport function isNodeTypeAllowed(schema: Schema, nodeType: string): boolean {\n\treturn schema.nodeTypes.includes(nodeType);\n}\n","/**\n * Commands for GapCursor: deleting void blocks adjacent to gap cursors\n * and inserting paragraphs at gap positions.\n */\n\nimport { createEmptyParagraph, generateBlockId, getBlockLength } from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { GapCursorSelection, NodeSelection } from '../model/Selection.js';\nimport { createCollapsedSelection, createNodeSelection } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport { isVoidBlock } from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { resolveSiblingContext } from './CommandHelpers.js';\nimport { deleteNodeSelection } from './NodeSelectionCommands.js';\n\n/**\n * Deletes the void block adjacent to a GapCursor when pressing Backspace.\n *\n * - `side === 'after'` → void block is behind the cursor → delete it.\n * - `side === 'before'` → void block is ahead → navigate backward (to previous block).\n * - At document start with `side === 'before'` → `null` (no-op).\n */\nexport function deleteBackwardAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tif (sel.side === 'after') {\n\t\treturn deleteVoidAtGap(state, sel);\n\t}\n\n\t// side === 'before': navigate to previous block\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.blockId);\n\n\tif (blockIdx <= 0) return null;\n\n\tconst prevId: BlockId | undefined = blockOrder[blockIdx - 1];\n\tif (!prevId) return null;\n\n\tif (isVoidBlock(state, prevId)) {\n\t\tconst path = findNodePath(state.doc, prevId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(prevId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\tconst prevBlock = state.getBlock(prevId);\n\tif (!prevBlock) return null;\n\tconst prevLen: number = getBlockLength(prevBlock);\n\treturn state.transaction('input').setSelection(createCollapsedSelection(prevId, prevLen)).build();\n}\n\n/**\n * Deletes the void block adjacent to a GapCursor when pressing Delete.\n *\n * - `side === 'before'` → void block is ahead of the cursor → delete it.\n * - `side === 'after'` → void block is behind → navigate forward (to next block).\n * - At document end with `side === 'after'` → `null` (no-op).\n */\nexport function deleteForwardAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tif (sel.side === 'before') {\n\t\treturn deleteVoidAtGap(state, sel);\n\t}\n\n\t// side === 'after': navigate to next block\n\tconst blockOrder: readonly BlockId[] = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.blockId);\n\n\tif (blockIdx >= blockOrder.length - 1) return null;\n\n\tconst nextId: BlockId | undefined = blockOrder[blockIdx + 1];\n\tif (!nextId) return null;\n\n\tif (isVoidBlock(state, nextId)) {\n\t\tconst path = findNodePath(state.doc, nextId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(nextId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\treturn state.transaction('input').setSelection(createCollapsedSelection(nextId, 0)).build();\n}\n\n/** Deletes the void block that the GapCursor is adjacent to, delegating to deleteNodeSelection. */\nfunction deleteVoidAtGap(state: EditorState, sel: GapCursorSelection): Transaction | null {\n\tconst path = (findNodePath(state.doc, sel.blockId) ?? []) as BlockId[];\n\tconst nodeSel: NodeSelection = createNodeSelection(sel.blockId, path);\n\treturn deleteNodeSelection(state, nodeSel);\n}\n\n/** Inserts a new paragraph at a GapCursor position (before or after the void block). */\nexport function insertParagraphAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n): Transaction | null {\n\tconst { parentPath, index } = resolveSiblingContext(state, sel.blockId);\n\tif (index < 0) return null;\n\n\tconst insertIdx: number = sel.side === 'before' ? index : index + 1;\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction('input');\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.setSelection(createCollapsedSelection(newId, 0));\n\treturn builder.build();\n}\n\n/** Inserts text in a new paragraph at a GapCursor position. */\nexport function insertTextAtGap(\n\tstate: EditorState,\n\tsel: GapCursorSelection,\n\ttext: string,\n\torigin: 'input' | 'paste',\n): Transaction {\n\tconst { parentPath, siblings, index } = resolveSiblingContext(state, sel.blockId);\n\tconst insertIdx: number =\n\t\tsel.side === 'before' ? Math.max(index, 0) : index >= 0 ? index + 1 : siblings.length;\n\n\tconst newId = generateBlockId();\n\tconst builder = state.transaction(origin);\n\tbuilder.insertNode(parentPath, insertIdx, createEmptyParagraph(newId));\n\tbuilder.insertText(newId, 0, text, []);\n\tbuilder.setSelection(createCollapsedSelection(newId, text.length));\n\treturn builder.build();\n}\n","/**\n * Range-deletion helpers for multi-block text selections, split out of\n * Commands.ts. Handles two cases: a selection whose blocks share one root\n * ancestor (leaf range) and a selection spanning different root ancestors\n * (cross-root range).\n */\n\nimport {\n\tcreateEmptyParagraph,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tisLeafBlock,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\n\n/** A normalized text-selection range (document-order from/to positions). */\nexport interface DeletionRange {\n\treadonly from: { readonly blockId: BlockId; readonly offset: number };\n\treadonly to: { readonly blockId: BlockId; readonly offset: number };\n}\n\n/** Returns the root-level ancestor index in `doc.children` for a given block. */\nexport function getRootBlockIndex(state: EditorState, blockId: BlockId): number {\n\tconst path = findNodePath(state.doc, blockId);\n\tif (!path || path.length === 0) return -1;\n\tconst rootId: string = path[0] as string;\n\treturn state.doc.children.findIndex((c) => c.id === rootId);\n}\n\n/** Deletes a multi-block selection where all blocks share the same root ancestor. */\nexport function deleteLeafRange(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\tblockOrder: readonly BlockId[],\n\trange: DeletionRange,\n\tfromIdx: number,\n\ttoIdx: number,\n): void {\n\tconst firstBlock = state.getBlock(range.from.blockId);\n\tif (!firstBlock) return;\n\tconst firstLen = getBlockLength(firstBlock);\n\n\tif (range.from.offset < firstLen) {\n\t\tbuilder.deleteTextAt(range.from.blockId, range.from.offset, firstLen);\n\t}\n\n\tif (range.to.offset > 0) {\n\t\tbuilder.deleteTextAt(range.to.blockId, 0, range.to.offset);\n\t}\n\n\tfor (let i = fromIdx + 1; i < toIdx; i++) {\n\t\tconst midBlockId = blockOrder[i];\n\t\tif (!midBlockId) continue;\n\t\tconst midBlock = state.getBlock(midBlockId);\n\t\tif (!midBlock) continue;\n\t\tconst midLen = getBlockLength(midBlock);\n\t\tif (midLen > 0) {\n\t\t\tbuilder.deleteTextAt(midBlockId, 0, midLen);\n\t\t}\n\t\tbuilder.mergeBlocksAt(range.from.blockId, midBlockId);\n\t}\n\n\tbuilder.mergeBlocksAt(range.from.blockId, range.to.blockId);\n}\n\n/**\n * Deletes a selection spanning different root-level ancestors.\n * Removes intermediate and composite root blocks, merges leaf roots.\n * Returns a replacement cursor block ID if from was inside a removed composite.\n */\nexport function deleteCrossRootRange(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n\trange: DeletionRange,\n\tfromRootIdx: number,\n\ttoRootIdx: number,\n): BlockId | undefined {\n\tconst fromRoot = state.doc.children[fromRootIdx];\n\tconst toRoot = state.doc.children[toRootIdx];\n\tif (!fromRoot || !toRoot) return undefined;\n\n\tconst fromIsLeaf: boolean = isLeafBlock(fromRoot);\n\tconst toIsLeaf: boolean = isLeafBlock(toRoot);\n\n\t// When from is inside a composite root, insert a landing paragraph\n\t// so callers can reference a surviving block for cursor/insert.\n\tlet landingId: BlockId | undefined;\n\tlet indexShift = 0;\n\n\tif (!fromIsLeaf) {\n\t\tlandingId = generateBlockId();\n\t\tbuilder.insertNode([], fromRootIdx, createEmptyParagraph(landingId));\n\t\tindexShift = 1;\n\t}\n\n\t// Delete text in from-leaf (only for leaf roots; composite roots are removed entirely)\n\tif (fromIsLeaf) {\n\t\tconst fromBlock = state.getBlock(range.from.blockId);\n\t\tif (fromBlock) {\n\t\t\tconst fromLen: number = getBlockLength(fromBlock);\n\t\t\tif (range.from.offset < fromLen) {\n\t\t\t\tbuilder.deleteTextAt(range.from.blockId, range.from.offset, fromLen);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Delete text in to-leaf (only for leaf roots)\n\tif (toIsLeaf && range.to.offset > 0) {\n\t\tbuilder.deleteTextAt(range.to.blockId, 0, range.to.offset);\n\t}\n\n\t// Remove root-level blocks in descending index order.\n\t// Keep from-root if it's a leaf; remove if composite (shifted by indexShift).\n\t// Keep to-root if it's a leaf (will merge into from); remove if composite.\n\tconst removeEnd: number = toIsLeaf ? toRootIdx - 1 + indexShift : toRootIdx + indexShift;\n\tconst removeStart: number = fromIsLeaf ? fromRootIdx + 1 : fromRootIdx + indexShift;\n\n\tfor (let i = removeEnd; i >= removeStart; i--) {\n\t\tbuilder.removeNode([], i);\n\t}\n\n\t// Merge to-root into from if both are leaf roots\n\tif (fromIsLeaf && toIsLeaf) {\n\t\tbuilder.mergeBlocksAt(range.from.blockId, range.to.blockId);\n\t}\n\n\treturn landingId;\n}\n","/**\n * Mark-related commands: toggling bold/italic/underline and checking\n * whether a mark is active.\n */\n\nimport {\n\ttype BlockNode,\n\ttype Mark,\n\tgetBlockLength,\n\tgetInlineChildren,\n\thasMark,\n\tisTextNode,\n} from '../model/Document.js';\nimport { isMarkAllowed } from '../model/Schema.js';\nimport { isCollapsed, isTextSelection, selectionRange } from '../model/Selection.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\nimport { markType as mkType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { resolveCursorMarks } from './CursorMarks.js';\nimport { forEachBlockInRange } from './RangeIterator.js';\n\n// --- Feature Configuration ---\n\nexport interface FeatureConfig {\n\treadonly bold: boolean;\n\treadonly italic: boolean;\n\treadonly underline: boolean;\n}\n\nconst defaultFeatures: FeatureConfig = { bold: true, italic: true, underline: true };\n\n/**\n * Toggles a mark on the current selection.\n * If collapsed, toggles stored marks. If range, applies/removes from text.\n */\nexport function toggleMark(\n\tstate: EditorState,\n\tmarkType: MarkTypeName,\n\tfeatures: FeatureConfig = defaultFeatures,\n): Transaction | null {\n\tif (isFeatureGated(markType, features)) return null;\n\tif (!isMarkAllowed(state.schema, markType)) return null;\n\tif (!isTextSelection(state.selection)) return null;\n\n\tconst mark: Mark = { type: markType };\n\tconst sel = state.selection;\n\n\tif (isCollapsed(sel)) {\n\t\t// Toggle stored marks\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return null;\n\t\tconst currentMarks = resolveCursorMarks(state);\n\t\tconst hasIt = hasMark(currentMarks, markType);\n\t\tconst newMarks = hasIt\n\t\t\t? currentMarks.filter((m) => m.type !== markType)\n\t\t\t: [...currentMarks, mark];\n\n\t\treturn state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t}\n\n\t// Range selection — apply/remove mark to all blocks in range\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\t// Determine if we should add or remove\n\tconst shouldRemove = isMarkActiveInRange(state, markType);\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tif (shouldRemove) {\n\t\t\tbuilder.removeMark(blockId, from, to, mark);\n\t\t} else {\n\t\t\tbuilder.addMark(blockId, from, to, mark);\n\t\t}\n\t});\n\n\tbuilder.setSelection(sel);\n\treturn builder.build();\n}\n\nexport function toggleBold(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('bold'), features);\n}\n\nexport function toggleItalic(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('italic'), features);\n}\n\nexport function toggleUnderline(state: EditorState, features?: FeatureConfig): Transaction | null {\n\treturn toggleMark(state, mkType('underline'), features);\n}\n\n/** Checks if a mark is active at the current selection. */\nexport function isMarkActive(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\n\tif (isCollapsed(sel)) {\n\t\treturn hasMark(resolveCursorMarks(state), markType);\n\t}\n\n\treturn isMarkActiveInRange(state, markType);\n}\n\n/** Per-slice result of scanning a block for a mark. */\ntype SliceMarkStatus = 'present' | 'missing' | 'empty';\n\n/** Checks if a mark is active across the entire selection range. */\nfunction isMarkActiveInRange(state: EditorState, markType: MarkTypeName): boolean {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return false;\n\tconst blockOrder = state.getBlockOrder();\n\tconst range = selectionRange(sel, blockOrder);\n\n\tconst fromIdx = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx = blockOrder.indexOf(range.to.blockId);\n\n\tlet sawMarkedText = false;\n\tfor (let i = fromIdx; i <= toIdx; i++) {\n\t\tconst blockId = blockOrder[i];\n\t\tif (!blockId) continue;\n\t\tconst block = state.getBlock(blockId);\n\t\tif (!block) continue;\n\t\tconst blockLen = getBlockLength(block);\n\t\tconst from = i === fromIdx ? range.from.offset : 0;\n\t\tconst to = i === toIdx ? range.to.offset : blockLen;\n\n\t\tconst status = markStatusInBlock(block, from, to, markType);\n\t\tif (status === 'missing') return false;\n\t\tif (status === 'present') sawMarkedText = true;\n\t}\n\n\t// Active only when the range actually contains text that carries the mark.\n\t// A range with no markable text (only empty blocks, or a void block such as a\n\t// lone display formula on Ctrl+A) is NOT active — returning true there would\n\t// light up every toolbar format button.\n\treturn sawMarkedText;\n}\n\n/**\n * Scans a block's `[from, to)` slice for `markType`. Returns:\n * - `missing` when some text character in the slice lacks the mark,\n * - `present` when the slice has text and all of it carries the mark,\n * - `empty` when the slice has no markable text (empty slice or only InlineNodes).\n *\n * An `empty` slice is neutral: it neither activates nor inverts the range check,\n * so an empty paragraph in the middle of a multi-block selection does not flip\n * the result (regression #130).\n */\nfunction markStatusInBlock(\n\tblock: BlockNode,\n\tfrom: number,\n\tto: number,\n\tmarkType: MarkTypeName,\n): SliceMarkStatus {\n\tlet pos = 0;\n\tlet sawText = false;\n\tfor (const child of getInlineChildren(block)) {\n\t\tif (isTextNode(child)) {\n\t\t\tconst childEnd = pos + child.text.length;\n\t\t\tif (childEnd > from && pos < to) {\n\t\t\t\tsawText = true;\n\t\t\t\tif (!hasMark(child.marks, markType)) return 'missing';\n\t\t\t}\n\t\t\tpos = childEnd;\n\t\t} else {\n\t\t\t// InlineNode: atomic, width 1, carries no marks.\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn sawText ? 'present' : 'empty';\n}\n\nfunction isFeatureGated(type: MarkTypeName, features: FeatureConfig): boolean {\n\tconst key = type as string;\n\tif (key === 'bold') return !features.bold;\n\tif (key === 'italic') return !features.italic;\n\tif (key === 'underline') return !features.underline;\n\treturn false;\n}\n","/**\n * Delete commands: character, word, and soft-line deletion in both directions.\n */\n\nimport {\n\ttype BlockNode,\n\tblockOffsetToTextOffset,\n\tgetBlockLength,\n\tgetBlockText,\n\tgetContentAtOffset,\n} from '../model/Document.js';\nimport { nextGraphemeSize, prevGraphemeSize } from '../model/GraphemeUtils.js';\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../model/Selection.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { deleteSelectionCommand, mergeBlockBackward, mergeBlockForward } from './Commands.js';\nimport { deleteNodeSelection } from './NodeSelectionCommands.js';\nimport { findWordBoundaryBackward, findWordBoundaryForward } from './WordBoundary.js';\n\ninterface DeleteConfig {\n\treadonly merge: (state: EditorState) => Transaction | null;\n\treadonly range: (block: BlockNode, offset: number) => readonly [number, number] | null;\n}\n\nfunction deleteInDirection(state: EditorState, config: DeleteConfig): Transaction | null {\n\tconst sel = state.selection;\n\n\tif (isNodeSelection(sel)) return deleteNodeSelection(state, sel);\n\tif (isGapCursor(sel)) return null;\n\tif (!isCollapsed(sel)) return deleteSelectionCommand(state);\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return null;\n\n\tconst range = config.range(block, sel.anchor.offset);\n\tif (!range) return config.merge(state);\n\n\tconst [from, to] = range;\n\treturn state\n\t\t.transaction('input')\n\t\t.deleteTextAt(block.id, from, to)\n\t\t.setSelection(createCollapsedSelection(block.id, from))\n\t\t.build();\n}\n\n/** Handles backspace key. */\nexport function deleteBackward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockBackward,\n\t\trange: (block, offset) => {\n\t\t\tif (offset <= 0) return null;\n\t\t\tconst content = getContentAtOffset(block, offset - 1);\n\t\t\tif (content?.kind === 'inline') return [offset - 1, offset];\n\t\t\tconst text: string = getBlockText(block);\n\t\t\tconst textOffset: number = blockOffsetToTextOffset(block, offset);\n\t\t\tconst step: number = prevGraphemeSize(text, textOffset) || 1;\n\t\t\treturn [offset - step, offset];\n\t\t},\n\t});\n}\n\n/** Handles delete key. */\nexport function deleteForward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockForward,\n\t\trange: (block, offset) => {\n\t\t\tconst len: number = getBlockLength(block);\n\t\t\tif (offset >= len) return null;\n\t\t\tconst content = getContentAtOffset(block, offset);\n\t\t\tif (content?.kind === 'inline') return [offset, offset + 1];\n\t\t\tconst text: string = getBlockText(block);\n\t\t\tconst textOffset: number = blockOffsetToTextOffset(block, offset);\n\t\t\tconst step: number = nextGraphemeSize(text, textOffset) || 1;\n\t\t\treturn [offset, offset + step];\n\t\t},\n\t});\n}\n\n/** Handles Ctrl+Backspace: delete word backward. */\nexport function deleteWordBackward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockBackward,\n\t\trange: (block, offset) =>\n\t\t\toffset > 0 ? [findWordBoundaryBackward(block, offset), offset] : null,\n\t});\n}\n\n/** Handles Ctrl+Delete: delete word forward. */\nexport function deleteWordForward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockForward,\n\t\trange: (block, offset) => {\n\t\t\tconst len = getBlockLength(block);\n\t\t\treturn offset < len ? [offset, findWordBoundaryForward(block, offset)] : null;\n\t\t},\n\t});\n}\n\n/** Handles Cmd+Backspace: delete to start of line/block. */\nexport function deleteSoftLineBackward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockBackward,\n\t\trange: (_block, offset) => (offset > 0 ? [0, offset] : null),\n\t});\n}\n\n/** Handles Cmd+Delete: delete to end of line/block. */\nexport function deleteSoftLineForward(state: EditorState): Transaction | null {\n\treturn deleteInDirection(state, {\n\t\tmerge: mergeBlockForward,\n\t\trange: (block, offset) => {\n\t\t\tconst len = getBlockLength(block);\n\t\t\treturn offset < len ? [offset, len] : null;\n\t\t},\n\t});\n}\n","/**\n * Core editor commands and barrel re-exports from submodules.\n *\n * This module contains text insertion, block splitting, block merging,\n * selection deletion, and select-all. Mark, delete, gap-cursor, node-selection,\n * and word-boundary commands are re-exported from their respective modules.\n */\n\nimport {\n\ttype Mark,\n\tcreateEmptyParagraph,\n\tcreateInlineNode,\n\tgenerateBlockId,\n\tgetBlockLength,\n\tgetBlockMarksAtOffset,\n\tgetCursorMarks,\n} from '../model/Document.js';\nimport { findNodePath } from '../model/NodeResolver.js';\nimport {\n\tcreateCollapsedSelection,\n\tcreateNodeSelection,\n\tcreateSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n\tisTextSelection,\n\tselectionRange,\n} from '../model/Selection.js';\nimport { type BlockId, inlineType } from '../model/TypeBrands.js';\nimport type { EditorState } from '../state/EditorState.js';\nimport {\n\tisInsideIsolating,\n\tisIsolatingBlock,\n\tisVoidBlock,\n\tsharesParent,\n} from '../state/NavigationQueries.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport type { TransactionBuilder } from '../state/Transaction.js';\nimport { resolveInsertPoint } from './CommandHelpers.js';\nimport { isMarkInclusive } from './CursorMarks.js';\nimport { insertParagraphAtGap, insertTextAtGap } from './GapCursorCommands.js';\nimport {\n\tdeleteNodeSelection,\n\tfindFirstLeafBlockId,\n\tfindLastLeafBlockId,\n\tinsertParagraphAfterNodeSelection,\n\tinsertTextAfterNodeSelection,\n} from './NodeSelectionCommands.js';\nimport { deleteCrossRootRange, deleteLeafRange, getRootBlockIndex } from './SelectionDeletion.js';\n\n// --- Re-exports from submodules ---\n\nexport {\n\tcanCrossBlockBoundary,\n\tisInsideIsolating,\n\tisIsolatingBlock,\n\tisVoidBlock,\n\tsharesParent,\n} from '../state/NavigationQueries.js';\n\nexport type { FeatureConfig } from './MarkCommands.js';\nexport {\n\tisMarkActive,\n\ttoggleBold,\n\ttoggleItalic,\n\ttoggleMark,\n\ttoggleUnderline,\n} from './MarkCommands.js';\n\nexport {\n\tdeleteBackward,\n\tdeleteForward,\n\tdeleteSoftLineBackward,\n\tdeleteSoftLineForward,\n\tdeleteWordBackward,\n\tdeleteWordForward,\n} from './DeleteCommands.js';\n\nexport {\n\tdeleteNodeSelection,\n\tfindFirstLeafBlockId,\n\tfindLastLeafBlockId,\n\tinsertParagraphAfterNodeSelection,\n\tinsertTextAfterNodeSelection,\n\tnavigateArrowIntoVoid,\n} from './NodeSelectionCommands.js';\n\nexport {\n\tdeleteBackwardAtGap,\n\tdeleteForwardAtGap,\n\tinsertParagraphAtGap,\n\tinsertTextAtGap,\n} from './GapCursorCommands.js';\n\nexport {\n\tfindWordBoundaryBackward,\n\tfindWordBoundaryForward,\n} from './WordBoundary.js';\n\nexport {\n\tapplyAttributedMark,\n\tgetMarkAttrAtSelection,\n\tisAttributedMarkActive,\n\tremoveAttributedMark,\n} from './AttributedMarkCommands.js';\n\nexport { forEachBlockIdInRange, forEachBlockInRange } from './RangeIterator.js';\n\n// --- Text Commands ---\n\n/** Inserts text at the current selection, replacing any selected range. */\nexport function insertTextCommand(\n\tstate: EditorState,\n\ttext: string,\n\torigin: 'input' | 'paste' = 'input',\n): Transaction {\n\tconst sel = state.selection;\n\n\t// NodeSelection: insert paragraph after void block with the text\n\tif (isNodeSelection(sel)) {\n\t\treturn insertTextAfterNodeSelection(state, sel, text, origin);\n\t}\n\n\t// GapCursor: insert paragraph at the gap position with the text\n\tif (isGapCursor(sel)) {\n\t\treturn insertTextAtGap(state, sel, text, origin);\n\t}\n\n\tconst builder = state.transaction(origin);\n\tconst marks = resolveActiveMarks(state);\n\n\tlet landingId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tlandingId = addDeleteSelectionSteps(state, builder);\n\t}\n\n\tconst resolved = resolveInsertPoint(sel, state.getBlockOrder());\n\tconst insertBlockId: BlockId = landingId ?? resolved.blockId;\n\tconst insertOffset: number = landingId ? 0 : resolved.offset;\n\n\tbuilder.insertText(insertBlockId, insertOffset, text, marks);\n\tbuilder.setSelection(createCollapsedSelection(insertBlockId, insertOffset + text.length));\n\n\treturn builder.build();\n}\n\n/** Deletes the current selection. */\nexport function deleteSelectionCommand(state: EditorState): Transaction | null {\n\tif (isNodeSelection(state.selection)) {\n\t\treturn deleteNodeSelection(state, state.selection);\n\t}\n\tif (isGapCursor(state.selection)) return null;\n\tif (isCollapsed(state.selection)) return null;\n\n\t// Deleting a selection that spans the whole document resets it to the\n\t// canonical empty state (a single empty paragraph). Without this, the range\n\t// merge keeps the first block's type and attributes, leaving e.g. an empty\n\t// centered title behind so the placeholder never returns.\n\tif (selectionCoversDocument(state)) {\n\t\treturn clearDocument(state);\n\t}\n\n\tconst builder = state.transaction('input');\n\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\n\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\tconst cursorBlockId: BlockId = landingId ?? range.from.blockId;\n\tconst cursorOffset: number = landingId ? 0 : range.from.offset;\n\tbuilder.setSelection(createCollapsedSelection(cursorBlockId, cursorOffset));\n\n\treturn builder.build();\n}\n\n/** Splits the current block at the cursor position (Enter key). */\nexport function splitBlockCommand(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\n\t// NodeSelection: insert empty paragraph after the void block\n\tif (isNodeSelection(sel)) {\n\t\treturn insertParagraphAfterNodeSelection(state, sel);\n\t}\n\n\t// GapCursor: insert empty paragraph at the gap position\n\tif (isGapCursor(sel)) {\n\t\treturn insertParagraphAtGap(state, sel);\n\t}\n\n\tconst builder = state.transaction('input');\n\n\tlet landingId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tlandingId = addDeleteSelectionSteps(state, builder);\n\t}\n\n\tconst resolved = resolveInsertPoint(sel, state.getBlockOrder());\n\tconst blockId: BlockId = landingId ?? resolved.blockId;\n\tconst offset: number = landingId ? 0 : resolved.offset;\n\tconst newBlockId = generateBlockId();\n\n\t// splitBlock operates at the same level in the tree — the StepApplication\n\t// handles this correctly because it looks up the block by ID recursively.\n\tbuilder.splitBlock(blockId, offset, newBlockId);\n\tbuilder.setSelection(createCollapsedSelection(newBlockId, 0));\n\n\treturn builder.build();\n}\n\n/** Inserts a hard line break (InlineNode) at the current cursor position. */\nexport function insertHardBreakCommand(state: EditorState): Transaction | null {\n\tconst sel = state.selection;\n\n\tif (!isTextSelection(sel)) return null;\n\n\tconst builder = state.transaction('input');\n\n\tlet cursorBlockId: BlockId | undefined;\n\tif (!isCollapsed(sel)) {\n\t\tconst landingId: BlockId | undefined = addDeleteSelectionSteps(state, builder);\n\t\tcursorBlockId = landingId;\n\t}\n\n\tif (cursorBlockId) {\n\t\t// Cross-root deletion replaced from-block; insert hard break in landing block\n\t\tbuilder.insertInlineNode(cursorBlockId, 0, createInlineNode(inlineType('hard_break')));\n\t\tbuilder.setSelection(createCollapsedSelection(cursorBlockId, 1));\n\t} else {\n\t\tconst { blockId: insertBlockId, offset: insertOffset } = resolveInsertPoint(\n\t\t\tsel,\n\t\t\tstate.getBlockOrder(),\n\t\t);\n\t\tbuilder.insertInlineNode(\n\t\t\tinsertBlockId,\n\t\t\tinsertOffset,\n\t\t\tcreateInlineNode(inlineType('hard_break')),\n\t\t);\n\t\tbuilder.setSelection(createCollapsedSelection(insertBlockId, insertOffset + 1));\n\t}\n\n\treturn builder.build();\n}\n\n/**\n * Merges the current block with the previous block, respecting\n * isolating boundaries and void blocks.\n */\nexport function mergeBlockBackward(state: EditorState): Transaction | null {\n\treturn mergeAdjacentBlock(state, 'backward');\n}\n\n/**\n * Merges the next block into the current block, respecting\n * isolating boundaries and void blocks.\n */\nexport function mergeBlockForward(state: EditorState): Transaction | null {\n\treturn mergeAdjacentBlock(state, 'forward');\n}\n\n/**\n * Shared implementation for merging adjacent blocks in either direction.\n * Validates selection, isolating boundaries, and void blocks before merging.\n */\nfunction mergeAdjacentBlock(\n\tstate: EditorState,\n\tdirection: 'backward' | 'forward',\n): Transaction | null {\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return null;\n\n\tconst blockOrder = state.getBlockOrder();\n\tconst blockIdx: number = blockOrder.indexOf(sel.anchor.blockId);\n\n\tconst adjacentIdx: number = direction === 'backward' ? blockIdx - 1 : blockIdx + 1;\n\tif (adjacentIdx < 0 || adjacentIdx >= blockOrder.length) return null;\n\n\tconst adjacentId: BlockId | undefined = blockOrder[adjacentIdx];\n\tif (!adjacentId) return null;\n\n\tif (isIsolatingBlock(state, sel.anchor.blockId) || isIsolatingBlock(state, adjacentId)) {\n\t\treturn null;\n\t}\n\tif (!sharesParent(state, sel.anchor.blockId, adjacentId)) {\n\t\tif (isInsideIsolating(state, sel.anchor.blockId)) return null;\n\t}\n\n\tif (isVoidBlock(state, adjacentId)) {\n\t\tconst path = findNodePath(state.doc, adjacentId) ?? [];\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.setSelection(createNodeSelection(adjacentId, path as BlockId[]))\n\t\t\t.build();\n\t}\n\n\tif (direction === 'backward') {\n\t\tconst prevBlock = state.getBlock(adjacentId);\n\t\tif (!prevBlock) return null;\n\t\tconst prevLen: number = getBlockLength(prevBlock);\n\t\treturn state\n\t\t\t.transaction('input')\n\t\t\t.mergeBlocksAt(adjacentId, sel.anchor.blockId)\n\t\t\t.setSelection(createCollapsedSelection(adjacentId, prevLen))\n\t\t\t.build();\n\t}\n\n\treturn state\n\t\t.transaction('input')\n\t\t.mergeBlocksAt(sel.anchor.blockId, adjacentId)\n\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, sel.anchor.offset))\n\t\t.build();\n}\n\n/** Selects all content in the editor, using leaf block endpoints. */\nexport function selectAll(state: EditorState): Transaction {\n\tconst docRange = documentRange(state);\n\tif (!docRange) return state.transaction('command').setSelection(state.selection).build();\n\n\treturn state\n\t\t.transaction('command')\n\t\t.setSelection(createSelection(docRange.from, docRange.to))\n\t\t.build();\n}\n\n// --- Internal Helpers ---\n\ninterface DocumentPosition {\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Endpoints of a full-document selection: the start of the first leaf block to\n * the end of the last leaf block. Returns `null` for an empty document.\n */\nfunction documentRange(\n\tstate: EditorState,\n): { from: DocumentPosition; to: DocumentPosition } | null {\n\tconst blocks = state.doc.children;\n\tconst firstBlock = blocks[0];\n\tconst lastBlock = blocks[blocks.length - 1];\n\tif (!firstBlock || !lastBlock) return null;\n\n\tconst firstLeafId: BlockId = findFirstLeafBlockId(firstBlock);\n\tconst lastLeafId: BlockId = findLastLeafBlockId(lastBlock);\n\tconst lastLeaf = state.getBlock(lastLeafId);\n\tconst lastLeafLen: number = lastLeaf ? getBlockLength(lastLeaf) : 0;\n\n\treturn {\n\t\tfrom: { blockId: firstLeafId, offset: 0 },\n\t\tto: { blockId: lastLeafId, offset: lastLeafLen },\n\t};\n}\n\n/** True when the current text selection spans the entire document. */\nfunction selectionCoversDocument(state: EditorState): boolean {\n\tif (!isTextSelection(state.selection)) return false;\n\tconst docRange = documentRange(state);\n\tif (!docRange) return false;\n\n\tconst range = selectionRange(state.selection, state.getBlockOrder());\n\treturn (\n\t\trange.from.blockId === docRange.from.blockId &&\n\t\trange.from.offset === docRange.from.offset &&\n\t\trange.to.blockId === docRange.to.blockId &&\n\t\trange.to.offset === docRange.to.offset\n\t);\n}\n\n/**\n * Replaces the whole document with a single empty paragraph and places the\n * cursor inside it. The fresh paragraph is inserted before the originals are\n * removed so the document never passes through a zero-children state.\n */\nfunction clearDocument(state: EditorState): Transaction {\n\tconst newBlockId: BlockId = generateBlockId();\n\tconst builder = state.transaction('input');\n\tconst originalCount: number = state.doc.children.length;\n\n\tbuilder.insertNode([], 0, createEmptyParagraph(newBlockId));\n\t// The originals shifted to indices 1..originalCount; remove them descending\n\t// so each index stays valid as the document shrinks.\n\tfor (let i = originalCount; i >= 1; i--) {\n\t\tbuilder.removeNode([], i);\n\t}\n\tbuilder.setSelection(createCollapsedSelection(newBlockId, 0));\n\n\treturn builder.build();\n}\n\nfunction resolveActiveMarks(state: EditorState): readonly Mark[] {\n\tif (state.storedMarks) return state.storedMarks;\n\n\tconst sel = state.selection;\n\tif (!isTextSelection(sel)) return [];\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return [];\n\n\t// A range replaced by typing inherits the marks at its anchor (raw content\n\t// marks); only a collapsed cursor honors right-boundary inclusivity.\n\tif (!isCollapsed(sel)) return getBlockMarksAtOffset(block, sel.anchor.offset);\n\n\treturn getCursorMarks(block, sel.anchor.offset, (type) => isMarkInclusive(state.schema, type));\n}\n\n/**\n * Adds steps to delete the current text selection.\n * Returns a replacement cursor block ID when the original from-block\n * was inside a composite root that got removed (undefined otherwise).\n */\nexport function addDeleteSelectionSteps(\n\tstate: EditorState,\n\tbuilder: TransactionBuilder,\n): BlockId | undefined {\n\tif (!isTextSelection(state.selection)) return undefined;\n\tconst blockOrder = state.getBlockOrder();\n\tconst range = selectionRange(state.selection, blockOrder);\n\tconst fromIdx = blockOrder.indexOf(range.from.blockId);\n\tconst toIdx = blockOrder.indexOf(range.to.blockId);\n\n\tif (fromIdx === toIdx) {\n\t\tbuilder.deleteTextAt(range.from.blockId, range.from.offset, range.to.offset);\n\t\treturn undefined;\n\t}\n\n\tconst fromRootIdx: number = getRootBlockIndex(state, range.from.blockId);\n\tconst toRootIdx: number = getRootBlockIndex(state, range.to.blockId);\n\n\tif (fromRootIdx === toRootIdx || fromRootIdx < 0 || toRootIdx < 0) {\n\t\tdeleteLeafRange(state, builder, blockOrder, range, fromIdx, toIdx);\n\t\treturn undefined;\n\t}\n\n\treturn deleteCrossRootRange(state, builder, range, fromRootIdx, toRootIdx);\n}\n"],"mappings":"ktBAsBA,SAAgB,IACf,MAAO,CACN,UAAW,CAAC,aACZ,UAAW,CAAC,OAAQ,SAAU,aAC9B,YAAA,OAEF,CAGA,SAAgB,EAAmB,GAClC,MAAO,CACN,UAAW,EAAS,eACpB,UAAW,EAAS,eACpB,YAAc,GAAiB,EAAS,YAAY,GACpD,kBAAoB,GAAiB,EAAS,kBAAkB,GAChE,YAAc,GAAiB,EAAS,YAAY,GAEtD,CAGA,SAAgB,EAAc,EAAgB,GAC7C,OAAO,EAAO,UAAU,SAAS,EAClC,CAGA,SAAgB,EAAkB,EAAgB,GACjD,OAAO,EAAO,UAAU,SAAS,EAClC,CC1BA,SAAgB,EACf,EACA,GAEA,GAAiB,UAAb,EAAI,KACP,OAAO,EAAgB,EAAO,GAI/B,MAAM,EAAiC,EAAM,gBACvC,EAAmB,EAAW,QAAQ,EAAI,SAEhD,GAAI,GAAY,EAAG,OAAO,KAE1B,MAAM,EAA8B,EAAW,EAAW,GAC1D,IAAK,EAAQ,OAAO,KAEpB,GAAI,EAAY,EAAO,GAAS,CAC/B,MAAM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AAK,QAAS,EAAM,GAAG,QACpD,CGyWE,CAAgB,EAAO,EAAS,EAAY,EAAO,EAAS,EAK9D"}
@@ -0,0 +1,2 @@
1
+ import{C as t,D as e,O as o,S as n,T as r,c as s,f as c,g as l,h as f,i,j as d,k as u,m as a,p,r as k,t as m,v as h}from"./Document-r7vLOAGA.mjs";import{i as I}from"./Selection-HYoVFpAx.mjs";import{a as b}from"./TypeBrands-Ch9856Gb.mjs";import{n as y,o as g,s as B}from"./NodeResolver-ChgLF_IP.mjs";var v={type:"identity"};function x(t){const e=/* @__PURE__ */new Set,o=t=>{e.add(t.id);for(const e of t.children)n(e)&&o(e)};return o(t),e}function w(t,e,o=-1){switch(e.type){case"identity":case"childIndexShift":return{pos:t,deleted:!1};case"shift":return function(t,e,o){if(t.blockId!==e.blockId)return{pos:t,deleted:!1};const n=e.newLen-(e.to-e.from),r=t.offset;if(r<e.from)return{pos:t,deleted:!1};if(r===e.from){if(e.from===e.to){const n=1===o?e.from+e.newLen:e.from;return n===r?{pos:t,deleted:!1}:{pos:M(t,n),deleted:!1}}return{pos:t,deleted:!1}}if(r<e.to)return{pos:M(t,1===o?e.from+e.newLen:e.from),deleted:!0};const s=r+n;return s===r?{pos:t,deleted:!1}:{pos:M(t,s),deleted:!1}}(t,e,o);case"split":return function(t,e,o){return t.blockId!==e.blockId||t.offset<e.offset?{pos:t,deleted:!1}:t.offset>e.offset?{pos:I(e.newBlockId,t.offset-e.offset),deleted:!1}:1===o?{pos:I(e.newBlockId,0),deleted:!1}:{pos:t,deleted:!1}}(t,e,o);case"merge":return function(t,e){return t.blockId!==e.sourceBlockId?{pos:t,deleted:!1}:{pos:I(e.targetBlockId,t.offset+e.targetLengthBefore),deleted:!1}}(t,e);case"blockRemoval":return function(t,e){return e.removedBlockIds.has(t.blockId)?{pos:t,deleted:!0}:{pos:t,deleted:!1}}(t,e)}}function M(t,e){return I(t.blockId,e,t.path)}var T=class t{static empty=new t([]);maps;constructor(t){this.maps=t}static from(e){const o=[];for(const t of e)"identity"!==t.type&&o.push(t);return 0===o.length?t.empty:new t(o)}appendMap(e){return"identity"===e.type?this:new t([...this.maps,e])}appendMapping(e){return 0===e.maps.length?this:0===this.maps.length?e:new t([...this.maps,...e.maps])}get isEmpty(){return 0===this.maps.length}map(t,e=-1){return this.mapResult(t,e).pos}mapResult(t,e=-1){let o=t,n=!1;for(const r of this.maps){const t=w(o,r,e);o=t.pos,t.deleted&&(n=!0)}return{pos:o,deleted:n}}mapRange(t,e=-1,o=1){const n=this.mapResult(t.from,e),r=this.mapResult(t.to,o);return n.deleted&&r.deleted&&n.pos.blockId===r.pos.blockId&&n.pos.offset>=r.pos.offset?null:{from:n.pos,to:r.pos}}};function N(t,e,o,n,r=1,s=-1){if(n.isEmpty)return{blockId:t,from:e,to:o};const c=I(t,e),l=I(t,o),f=n.mapResult(c,r),i=n.mapResult(l,s);return f.deleted&&i.deleted||f.pos.blockId!==i.pos.blockId||f.pos.offset>i.pos.offset?null:{blockId:f.pos.blockId,from:f.pos.offset,to:i.pos.offset}}function A(t,e,o,n=-1){if(o.isEmpty)return{blockId:t,from:e,to:e};const r=I(t,e),s=o.mapResult(r,n);return s.deleted?null:{blockId:s.pos.blockId,from:s.pos.offset,to:s.pos.offset}}function P(t,e,o){return R(t,e,o,"existing")}function L(t,e,o){return R(t,e,o,"insertion")}function R(t,e,o,n){if(o.isEmpty)return e;let r=e;for(const s of o.maps){const e=S(t,r,s,n);if(null===e)return null;r=e}return r}function S(t,e,o,n){switch(o.type){case"identity":case"shift":case"split":case"merge":return e;case"blockRemoval":return E(t,o.parentPath)?e===o.index?"existing"===n?null:e:e>o.index?e-1:e:e;case"childIndexShift":return E(t,o.parentPath)&&e>=o.fromIndex?e+o.delta:e}}function E(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}function j(t){switch(t.type){case"identity":case"blockRemoval":case"childIndexShift":return v;case"shift":return{type:"shift",blockId:t.blockId,from:t.from,to:t.from+t.newLen,newLen:t.to-t.from};case"split":return{type:"merge",targetBlockId:t.blockId,sourceBlockId:t.newBlockId,targetLengthBefore:t.offset};case"merge":return{type:"split",blockId:t.targetBlockId,offset:t.targetLengthBefore,newBlockId:t.sourceBlockId}}}function O(t,e){if(t.type!==e.type)return!1;switch(t.type){case"identity":return!0;case"shift":{const o=e;return t.blockId===o.blockId&&t.from===o.from&&t.to===o.to&&t.newLen===o.newLen}case"split":{const o=e;return t.blockId===o.blockId&&t.offset===o.offset&&t.newBlockId===o.newBlockId}case"merge":{const o=e;return t.targetBlockId===o.targetBlockId&&t.sourceBlockId===o.sourceBlockId&&t.targetLengthBefore===o.targetLengthBefore}case"blockRemoval":{const o=e;if(t.index!==o.index)return!1;if(!E(t.parentPath,o.parentPath))return!1;if(t.removedBlockIds.size!==o.removedBlockIds.size)return!1;for(const e of t.removedBlockIds)if(!o.removedBlockIds.has(e))return!1;return!0}case"childIndexShift":{const o=e;return t.fromIndex===o.fromIndex&&t.delta===o.delta&&E(t.parentPath,o.parentPath)}}}function z(t,e,o){return{children:D(t.children,e,o)}}function D(t,e,o){let r=!1;const s=t.map(t=>{if(!n(t))return t;if(t.id===e)return r=!0,o(t);const s=D(t.children,e,o);return s===t.children?t:(r=!0,{...t,children:s})});return r?s:t}function C(t,e,o){if(0===e.length)return t;const r=e[0];return r?{children:t.children.map(t=>n(t)&&t.id===r?1===e.length?o(t):q(t,e,1,o):t)}:t}function q(t,e,o,r){const s=e[o];if(!s)return t;const c=t.children.map(t=>n(t)&&t.id===s?o===e.length-1?r(t):q(t,e,o+1,r):t);return{...t,children:c}}function W(t,e,o){if(e(t))return o(t);let r=!1;const s=t.map(t=>{if(!n(t))return t;const s=W(t.children,e,o);return s?(r=!0,{...t,children:s}):t});return r?s:null}function _(e,o,n){const r=[];let c=0,l=!1;for(const f of e){if(t(f)){l||o!==c||(r.push(...n()),l=!0),r.push(f),c+=1;continue}const e=c+f.text.length;if(!l&&o>=c&&o<=e){const t=o-c,e=f.text.slice(0,t),i=f.text.slice(t);e&&r.push(s(e,f.marks)),r.push(...n()),i&&r.push(s(i,f.marks)),l=!0}else r.push(f);c=e}return l||r.push(...n()),r}function F(e,o,n){const r=[];let c=0;for(const l of e){if(t(l)){const t=c+1;t>o&&c<n&&r.push(l),c=t;continue}const e=c+l.text.length;if(e<=o||c>=n);else{const t=Math.max(0,o-c),e=Math.min(l.text.length,n-c),f=l.text.slice(t,e);f.length>0&&r.push(s(f,l.marks))}c=e}return 0===r.length&&r.push(s("")),r}function G(e,o,n,r,c){const l=[];let f=0;for(const i of e){if(t(i)){l.push(i),f+=1;continue}const e=f+i.text.length;if(e<=o||f>=n)l.push(i);else if(f>=o&&e<=n){const t=c?m(i.marks,r):u(i.marks,r.type);l.push(s(i.text,t))}else{const t=Math.max(0,o-f),e=Math.min(i.text.length,n-f),d=i.text.slice(0,t),a=i.text.slice(t,e),p=i.text.slice(e);if(d&&l.push(s(d,i.marks)),a){const t=c?m(i.marks,r):u(i.marks,r.type);l.push(s(a,t))}p&&l.push(s(p,i.marks))}f=e}return l}function H(e,o,n,r){const s=[];if(o>=n)return s;let c=null,l=0;const f=()=>{c&&(s.push(c),c=null)};for(const i of e){const e=l+(t(i)?1:i.text.length);if(e<=o||l>=n){l=e;continue}const s=Math.max(l,o),d=Math.min(e,n);t(i)?c&&(c.to=d):i.marks.some(t=>t.type===r)?f():c?c.to=d:c={from:s,to:d},l=e}return f(),s}function J(o,n,r,s){const c=[];if(n>=r)return c;let l=null,f=0;const i=()=>{l&&(c.push(l),l=null)};for(const d of o){const o=f+(t(d)?1:d.text.length);if(o<=n||f>=r){f=o;continue}const c=Math.max(f,n),u=Math.min(o,r);if(t(d))l&&(l.to=u);else{const t=d.marks.find(t=>t.type===s);t?l&&e(l.mark,t)?l.to=u:(i(),l={from:c,to:u,mark:t}):i()}f=o}return i(),c}function K(e,o){if(e.every(e=>r(e)||t(e)))return o;const n=e.filter(e=>!r(e)&&!t(e));return[...o,...n]}function Q(t,e,n,r=!0){return z(t,e,t=>{const e=n(h(t));return{...t,children:K(t.children,r?o(e):e)}})}function U(t){return t.reduce((t,e)=>t+("inline"===e.kind?1:e.text.length),0)}function V(t){return{blocks:t.split(/\r?\n/).map(t=>({type:b("paragraph"),segments:[d(t)]}))}}function X(t){return t.segments?U(t.segments):t.text.length}function Y(t){return t.path?{path:t.path}:{}}function Z(t){for(const e of t.steps)if("setStoredMarks"===e.type)return e.previousMarks;return t.storedMarksAfter}function $(t,e,o){return o?t!==e?{}:{path:o}:{}}function tt(t,e){if(e.isEmpty)return!0;for(const o of t){const t=e.mapResult({blockId:o,offset:0},-1);if(t.deleted)return!1;if(t.pos.blockId!==o)return!1}return!0}function et(t,e){return e.blockId===t.blockId&&e.from===t.from&&e.to===t.to}function ot(t,e){if(t===e)return!0;if(!t||!e)return!1;const o=Object.keys(t),n=Object.keys(e);if(o.length!==n.length)return!1;for(const r of o)if(t[r]!==e[r])return!1;return!0}var nt={insertText:{apply:function(t,e){return Q(t,e.blockId,t=>{return e.segments?(o=t,n=e.offset,r=e.segments,_(o,n,()=>r.map(k))):function(t,e,o,n){return _(t,e,()=>[s(o,n)])}(t,e.offset,e.text,e.marks);var o,n,r})},invert:function(t){return{type:"deleteText",blockId:t.blockId,from:t.offset,to:t.offset+X(t),deletedText:t.text,deletedMarks:t.marks,deletedSegments:t.segments??[d(t.text,[...t.marks])],...Y(t)}},getMap:function(t,e){return{type:"shift",blockId:e.blockId,from:e.offset,to:e.offset,newLen:X(e)}},map:function(t,e,o){const n=A(t.blockId,t.offset,e,-1);return n?n.blockId===t.blockId&&n.from===t.offset?t:{type:"insertText",blockId:n.blockId,offset:n.from,text:t.text,marks:t.marks,...t.segments?{segments:t.segments}:{},...$(t.blockId,n.blockId,t.path)}:null}},deleteText:{apply:function(e,o){return Q(e,o.blockId,e=>function(e,o,n){const r=[];let c=0;for(const l of e){if(t(l)){const t=c+1;(t<=o||c>=n)&&r.push(l),c=t;continue}const e=c+l.text.length;if(e<=o||c>=n)r.push(l);else{const t=Math.max(0,o-c),e=Math.min(l.text.length,n-c),f=l.text.slice(0,t)+l.text.slice(e);f.length>0&&r.push(s(f,l.marks))}c=e}return r}(e,o.from,o.to))},invert:function(t){return{type:"insertText",blockId:t.blockId,offset:t.from,text:t.deletedText,marks:t.deletedMarks,segments:t.deletedSegments,...Y(t)}},getMap:function(t,e){return{type:"shift",blockId:e.blockId,from:e.from,to:e.to,newLen:0}},map:function(t,e,o){const n=N(t.blockId,t.from,t.to,e);if(!n)return null;if(et({blockId:t.blockId,from:t.from,to:t.to},n))return t;const r=y(o,n.blockId);if(!r)return null;const s=f(r).slice(n.from,n.to),l=a(r,n.from),i=c(r,n.from,n.to);return{type:"deleteText",blockId:n.blockId,from:n.from,to:n.to,deletedText:s,deletedMarks:l,deletedSegments:i,...$(t.blockId,n.blockId,t.path)}}},splitBlock:{apply:function(t,e){const r=W(t.children,t=>t.some(t=>n(t)&&t.id===e.blockId),t=>{const r=t.findIndex(t=>n(t)&&t.id===e.blockId);if(-1===r)return t;const s=t[r],c=h(s),l=p(s),f=F(c,0,e.offset),d=F(c,e.offset,l),u={...s,children:o(f)},a=void 0!==e.newBlockType,k=e.newBlockType??s.type,m=a?e.newBlockAttrs:s.attrs,I=i(k,o(d),e.newBlockId,m),b=[...t];return b.splice(r,1,u,I),b});return r?{children:r}:t},invert:function(t){return{type:"mergeBlocks",targetBlockId:t.blockId,sourceBlockId:t.newBlockId,targetLengthBefore:t.offset,...void 0!==t.newBlockType?{sourceType:t.newBlockType}:{},...t.newBlockAttrs?{sourceAttrs:t.newBlockAttrs}:{},...Y(t)}},getMap:function(t,e){return{type:"split",blockId:e.blockId,offset:e.offset,newBlockId:e.newBlockId}},map:function(t,e,o){const n=A(t.blockId,t.offset,e,-1);return n?n.blockId===t.blockId&&n.from===t.offset?t:{type:"splitBlock",blockId:n.blockId,offset:n.from,newBlockId:t.newBlockId,...void 0!==t.newBlockType?{newBlockType:t.newBlockType}:{},...t.newBlockAttrs?{newBlockAttrs:t.newBlockAttrs}:{},...$(t.blockId,n.blockId,t.path)}:null}},mergeBlocks:{apply:function(t,e){const r=W(t.children,t=>t.some(t=>n(t)&&t.id===e.targetBlockId)&&t.some(t=>n(t)&&t.id===e.sourceBlockId),t=>{const r=t.findIndex(t=>n(t)&&t.id===e.targetBlockId),s=t.findIndex(t=>n(t)&&t.id===e.sourceBlockId);if(-1===r||-1===s)return t;const c=t[r],l=t[s],f=h(c),i=h(l),d=o([...f,...i]),u={...c,children:d};return t.filter(t=>!n(t)||t.id!==e.sourceBlockId).map(t=>n(t)&&t.id===e.targetBlockId?u:t)});return r?{children:r}:t},invert:function(t){return{type:"splitBlock",blockId:t.targetBlockId,offset:t.targetLengthBefore,newBlockId:t.sourceBlockId,...void 0!==t.sourceType?{newBlockType:t.sourceType}:{},...t.sourceAttrs?{newBlockAttrs:t.sourceAttrs}:{},...Y(t)}},getMap:function(t,e){return{type:"merge",targetBlockId:e.targetBlockId,sourceBlockId:e.sourceBlockId,targetLengthBefore:e.targetLengthBefore}},map:function(t,e,o){if(e.isEmpty)return t;const n=e.mapResult({blockId:t.targetBlockId,offset:0},-1),r=e.mapResult({blockId:t.sourceBlockId,offset:0},-1);if(n.deleted||r.deleted)return null;const s=n.pos.blockId,c=r.pos.blockId;if(s===c)return null;const l=y(o,s);if(!l)return null;const f=p(l);return s===t.targetBlockId&&c===t.sourceBlockId&&f===t.targetLengthBefore?t:{type:"mergeBlocks",targetBlockId:s,sourceBlockId:c,targetLengthBefore:f,...void 0!==t.sourceType?{sourceType:t.sourceType}:{},...t.sourceAttrs?{sourceAttrs:t.sourceAttrs}:{},...$(t.targetBlockId,s,t.path)}}},addMark:{apply:function(t,e){return Q(t,e.blockId,t=>G(t,e.from,e.to,e.mark,!0))},invert:function(t){return{type:"removeMark",blockId:t.blockId,from:t.from,to:t.to,mark:t.mark,...Y(t)}},getMap:function(t,e){return v},map:function(t,e,o){const n=N(t.blockId,t.from,t.to,e);return n?et({blockId:t.blockId,from:t.from,to:t.to},n)?t:{type:"addMark",blockId:n.blockId,from:n.from,to:n.to,mark:t.mark,...$(t.blockId,n.blockId,t.path)}:null}},removeMark:{apply:function(t,e){return Q(t,e.blockId,t=>G(t,e.from,e.to,e.mark,!1))},invert:function(t){return{type:"addMark",blockId:t.blockId,from:t.from,to:t.to,mark:t.mark,...Y(t)}},getMap:function(t,e){return v},map:function(t,e,o){const n=N(t.blockId,t.from,t.to,e);return n?et({blockId:t.blockId,from:t.from,to:t.to},n)?t:{type:"removeMark",blockId:n.blockId,from:n.from,to:n.to,mark:t.mark,...$(t.blockId,n.blockId,t.path)}:null}},setStoredMarks:{apply:function(t){return t},invert:function(t){return{type:"setStoredMarks",marks:t.previousMarks,previousMarks:t.marks}},getMap:function(t,e){return v},map:function(t,e,o){return t}},setBlockType:{apply:function(t,e){return z(t,e.blockId,t=>{const{attrs:o,...n}=t;return{...n,type:e.nodeType,...e.attrs?{attrs:e.attrs}:{}}})},invert:function(t){return{type:"setBlockType",blockId:t.blockId,nodeType:t.previousNodeType,attrs:t.previousAttrs,previousNodeType:t.nodeType,previousAttrs:t.attrs,...Y(t)}},getMap:function(t,e){return v},map:function(t,e,o){if(e.isEmpty)return t;const n=e.mapResult({blockId:t.blockId,offset:0},-1);if(n.deleted)return null;const r=n.pos.blockId,s=y(o,r);return s?r===t.blockId&&s.type===t.previousNodeType&&ot(s.attrs,t.previousAttrs)?t:{type:"setBlockType",blockId:r,nodeType:t.nodeType,...t.attrs?{attrs:t.attrs}:{},previousNodeType:s.type,...s.attrs?{previousAttrs:s.attrs}:{},...$(t.blockId,r,t.path)}:null}},insertNode:{apply:function(t,e){if(0===e.parentPath.length){const o=[...t.children];return o.splice(e.index,0,e.node),{children:o}}return C(t,e.parentPath,t=>{const o=[...t.children];return o.splice(e.index,0,e.node),{...t,children:o}})},invert:function(t){return{type:"removeNode",parentPath:t.parentPath,index:t.index,removedNode:t.node}},getMap:function(t,e){return{type:"childIndexShift",parentPath:e.parentPath,fromIndex:e.index,delta:1}},map:function(t,e,o){if(!tt(t.parentPath,e))return null;const n=L(t.parentPath,t.index,e);return n===t.index?t:{type:"insertNode",parentPath:t.parentPath,index:n,node:t.node}}},removeNode:{apply:function(t,e){if(0===e.parentPath.length){const o=[...t.children];return o.splice(e.index,1),{children:o}}return C(t,e.parentPath,t=>{const o=[...t.children];return o.splice(e.index,1),{...t,children:o}})},invert:function(t){return{type:"insertNode",parentPath:t.parentPath,index:t.index,node:t.removedNode}},getMap:function(t,e){return{type:"blockRemoval",removedBlockIds:x(e.removedNode),parentPath:e.parentPath,index:e.index}},map:function(t,e,o){if(!tt(t.parentPath,e))return null;const n=e.mapResult({blockId:t.removedNode.id,offset:0},-1);if(n.deleted)return null;if(n.pos.blockId!==t.removedNode.id)return null;const r=P(t.parentPath,t.index,e);if(null===r)return null;const s=g(o,t.parentPath,r);return s?s.id!==t.removedNode.id?null:r===t.index&&s===t.removedNode?t:{type:"removeNode",parentPath:t.parentPath,index:r,removedNode:s}:null}},setNodeAttr:{apply:function(t,e){const o=e.path[e.path.length-1];return o?z(t,o,t=>({...t,attrs:e.attrs})):t},invert:function(t){return{type:"setNodeAttr",path:t.path,attrs:t.previousAttrs,previousAttrs:t.attrs}},getMap:function(t,e){return v},map:function(t,e,o){if(e.isEmpty)return t;if(!tt(t.path,e))return null;const n=B(o,t.path);return n?{type:"setNodeAttr",path:t.path,attrs:t.attrs,...n.attrs?{previousAttrs:n.attrs}:{}}:null}},insertInlineNode:{apply:function(e,o){return Q(e,o.blockId,e=>function(e,o,n){const r=[];let c=0,l=!1;for(const f of e){if(t(f)){l||o!==c||(r.push(n),l=!0),r.push(f),c+=1;continue}const e=c+f.text.length;if(!l&&o>=c&&o<=e){const t=o-c,e=f.text.slice(0,t),i=f.text.slice(t);e&&r.push(s(e,f.marks)),r.push(n),i&&r.push(s(i,f.marks)),l=!0}else r.push(f);c=e}return l||r.push(n),r}(e,o.offset,o.node))},invert:function(t){return{type:"removeInlineNode",blockId:t.blockId,offset:t.offset,removedNode:t.node,...Y(t)}},getMap:function(t,e){return{type:"shift",blockId:e.blockId,from:e.offset,to:e.offset,newLen:1}},map:function(t,e,o){const n=A(t.blockId,t.offset,e,-1);return n?n.blockId===t.blockId&&n.from===t.offset?t:{type:"insertInlineNode",blockId:n.blockId,offset:n.from,node:t.node,...$(t.blockId,n.blockId,t.path)}:null}},removeInlineNode:{apply:function(e,o){return Q(e,o.blockId,e=>function(e,o){const n=[];let r=0;for(const s of e)t(s)?(r!==o&&n.push(s),r+=1):(n.push(s),r+=s.text.length);return n}(e,o.offset))},invert:function(t){return{type:"insertInlineNode",blockId:t.blockId,offset:t.offset,node:t.removedNode,...Y(t)}},getMap:function(t,e){return{type:"shift",blockId:e.blockId,from:e.offset,to:e.offset+1,newLen:0}},map:function(e,o,n){const r=N(e.blockId,e.offset,e.offset+1,o,1,1);if(!r)return null;if(r.to-r.from!==1)return null;const s=y(n,r.blockId);if(!s)return null;const c=l(s,r.from);return c&&"inline"===c.kind&&t(c.node)?(f=e.removedNode)===(i=c.node)||f.inlineType===i.inlineType&&ot(f.attrs,i.attrs)?r.blockId===e.blockId&&r.from===e.offset?e:{type:"removeInlineNode",blockId:r.blockId,offset:r.from,removedNode:c.node,...$(e.blockId,r.blockId,e.path)}:null:null;var f,i}},setInlineNodeAttr:{apply:function(e,o){return Q(e,o.blockId,e=>function(e,o,n){const r=[];let s=0;for(const c of e)t(c)?(s===o?r.push({...c,attrs:n}):r.push(c),s+=1):(r.push(c),s+=c.text.length);return r}(e,o.offset,o.attrs),!1)},invert:function(t){return{type:"setInlineNodeAttr",blockId:t.blockId,offset:t.offset,attrs:t.previousAttrs,previousAttrs:t.attrs,...Y(t)}},getMap:function(t,e){return v},map:function(e,o,n){const r=N(e.blockId,e.offset,e.offset+1,o,1,1);if(!r)return null;if(r.to-r.from!==1)return null;if(r.blockId===e.blockId&&r.from===e.offset)return e;const s=y(n,r.blockId);if(!s)return null;const c=l(s,r.from);return c&&"inline"===c.kind&&t(c.node)?{type:"setInlineNodeAttr",blockId:r.blockId,offset:r.from,attrs:e.attrs,previousAttrs:c.node.attrs,...$(e.blockId,r.blockId,e.path)}:null}}};function rt(t){return nt[t.type]}function st(t,e){return rt(e).apply(t,e)}function ct(t){return rt(t).invert(t)}function lt(t,e){return rt(e).getMap(t,e)}function ft(t,e,o){return e.isEmpty?t:rt(t).map(t,e,o)}function it(t){const e=t.steps.map(ct).reverse();return{steps:e,selectionBefore:t.selectionAfter,selectionAfter:t.selectionBefore,storedMarksAfter:Z(t),mapping:T.empty,forwardStepMaps:e.map(()=>v),metadata:{origin:"history",timestamp:Date.now()}}}function dt(t,e){switch(t.type){case"inline":return function(t,e){switch(e.type){case"identity":case"childIndexShift":return t;case"shift":return function(t,e){if(t.blockId!==e.blockId)return t;const o=w(I(t.blockId,t.from),e,-1).pos,n=w(I(t.blockId,t.to),e,1).pos;return o.offset>=n.offset?null:o.offset===t.from&&n.offset===t.to?t:{...t,from:o.offset,to:n.offset}}(t,e);case"split":return function(t,e){return t.blockId!==e.blockId||t.to<=e.offset?t:t.from>=e.offset?{...t,blockId:e.newBlockId,from:t.from-e.offset,to:t.to-e.offset}:[{...t,to:e.offset},{...t,blockId:e.newBlockId,from:0,to:t.to-e.offset}]}(t,e);case"merge":return function(t,e){return t.blockId!==e.sourceBlockId?t:{...t,blockId:e.targetBlockId,from:t.from+e.targetLengthBefore,to:t.to+e.targetLengthBefore}}(t,e);case"blockRemoval":return e.removedBlockIds.has(t.blockId)?null:t}}(t,e);case"widget":return function(t,e){switch(e.type){case"identity":case"childIndexShift":return t;case"shift":return function(t,e){if(t.blockId!==e.blockId)return t;const o=w(I(t.blockId,t.offset),e,t.side);return o.deleted?null:o.pos.offset===t.offset?t:{...t,offset:o.pos.offset}}(t,e);case"split":return function(t,e){if(t.blockId!==e.blockId)return t;const o=w(I(t.blockId,t.offset),e,t.side);return o.pos.blockId===t.blockId&&o.pos.offset===t.offset?t:{...t,blockId:o.pos.blockId,offset:o.pos.offset}}(t,e);case"merge":return function(t,e){return t.blockId!==e.sourceBlockId?t:{...t,blockId:e.targetBlockId,offset:t.offset+e.targetLengthBefore}}(t,e);case"blockRemoval":return e.removedBlockIds.has(t.blockId)?null:t}}(t,e);case"node":return function(t,e){switch(e.type){case"identity":case"shift":case"split":case"childIndexShift":return t;case"merge":return t.blockId===e.sourceBlockId?null:t;case"blockRemoval":return e.removedBlockIds.has(t.blockId)?null:t}}(t,e)}}function ut(t,e,o,n){return{type:"inline",blockId:t,from:e,to:o,attrs:n}}function at(t,e){return{type:"node",blockId:t,attrs:e}}function pt(t,e,o,n){return{type:"widget",blockId:t,offset:e,toDOM:o,side:n?.side??-1,key:n?.key}}var kt=class t{byBlock;static empty=new t(/* @__PURE__ */new Map);constructor(t){this.byBlock=t}static create(e){if(0===e.length)return t.empty;const o=/* @__PURE__ */new Map;for(const t of e){const e=o.get(t.blockId);e?e.push(t):o.set(t.blockId,[t])}return new t(o)}find(t){return this.byBlock.get(t)??[]}findInline(t){const e=this.byBlock.get(t);return e?e.filter(t=>"inline"===t.type):[]}findNode(t){const e=this.byBlock.get(t);return e?e.filter(t=>"node"===t.type):[]}findWidget(t){const e=this.byBlock.get(t);return e?e.filter(t=>"widget"===t.type):[]}add(e){if(0===e.length)return this;if(this.isEmpty)return t.create(e);const o=/* @__PURE__ */new Map;for(const[t,n]of this.byBlock)o.set(t,[...n]);for(const t of e){const e=o.get(t.blockId);e?e.push(t):o.set(t.blockId,[t])}return new t(o)}remove(e){const o=/* @__PURE__ */new Map;let n=!1;for(const[t,r]of this.byBlock){const s=r.filter(t=>!e(t));s.length!==r.length&&(n=!0),s.length>0&&o.set(t,s)}return n?0===o.size?t.empty:new t(o):this}merge(e){if(e.isEmpty)return this;if(this.isEmpty)return e;const o=/* @__PURE__ */new Map;for(const[t,n]of this.byBlock)o.set(t,[...n]);for(const[t,n]of e.byBlock){const e=o.get(t);e?e.push(...n):o.set(t,[...n])}return new t(o)}equals(t){if(this===t)return!0;if(this.byBlock.size!==t.byBlock.size)return!1;for(const[e,o]of this.byBlock){const n=t.byBlock.get(e);if(!n)return!1;if(!mt(o,n))return!1}return!0}get isEmpty(){return 0===this.byBlock.size}map(e){if(this.isEmpty||e.mapping.isEmpty)return this;let o=[];for(const t of this.byBlock.values())for(const e of t)o.push(e);for(const t of e.mapping.maps){const e=[];for(const n of o){const o=dt(n,t);if(null!==o)if(Array.isArray(o))for(const t of o)e.push(t);else e.push(o)}o=e}return 0===o.length?t.empty:t.create(o)}};function mt(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++){const n=t[o],r=e[o];if(!n||!r||!ht(n,r))return!1}return!0}function ht(t,e){if(t.type!==e.type)return!1;if(t.blockId!==e.blockId)return!1;switch(t.type){case"inline":{const o=e;return t.from===o.from&&t.to===o.to&&It(t.attrs,o.attrs)}case"node":{const o=e;return It(t.attrs,o.attrs)}case"widget":{const o=e;return t.offset===o.offset&&t.side===o.side&&t.key===o.key&&t.toDOM===o.toDOM}}}function It(t,e){if(t===e)return!0;const o=Object.keys(t),n=Object.keys(e);if(o.length!==n.length)return!1;for(const r of o)if(t[r]!==e[r])return!1;return!0}export{O as C,w as S,T as _,pt as a,P as b,ct as c,Z as d,V as f,v as g,J as h,at as i,it as l,H as m,mt as n,st as o,U as p,ut as r,lt as s,kt as t,ft as u,x as v,L as x,j as y};
2
+ //# sourceMappingURL=Decoration-ZeyVfwJB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Decoration-ZeyVfwJB.mjs","names":[],"sources":["../../src/state/Mapping.ts","../../src/state/BlockTreeOps.ts","../../src/state/InlineContentOps.ts","../../src/state/StepApplication.ts","../../src/model/ContentSlice.ts","../../src/state/Steps.ts","../../src/state/StepInversion.ts","../../src/state/StepMapping.ts","../../src/state/StepMaps.ts","../../src/state/StepHandlers.ts","../../src/decorations/PositionMapping.ts","../../src/decorations/Decoration.ts"],"sourcesContent":["/**\n * Generic position-mapping primitive.\n *\n * Each {@link Step} produces a {@link StepMap} that describes how positions\n * in `{blockId, offset}` space shift when the step is applied. A\n * {@link Mapping} composes a sequence of `StepMap`s — typically all the maps\n * of a transaction — into a single mapper, so any consumer (decorations,\n * comments, selections, remote cursors, history) can fold a position\n * through an entire change set without re-implementing per-step math.\n *\n * The model mirrors ProseMirror's `StepMap` / `Mapping`, adapted to\n * notectl's `{blockId, offset}` position space (positions are scoped to\n * blocks, not a flat document offset).\n *\n * ## Association (bias) semantics\n *\n * The optional `assoc` argument decides which side of a boundary a position\n * sticks to:\n *\n * - `assoc = -1` (\"sticky left\"): the position stays at the boundary when\n * content is inserted at, or split exactly at, the position. This is the\n * semantics expected by an inclusive-start range marker (a decoration's\n * `from`, the left edge of a selection).\n * - `assoc = +1` (\"sticky right\"): the position moves past inserted content\n * and migrates to the new block when its host block is split exactly at\n * the position. This is the semantics expected by an exclusive-end range\n * marker (a decoration's `to`, the right edge of a selection).\n *\n * The default is `-1`, matching the most common case (cursor and from-side\n * mappers).\n *\n * ## StepMap categories\n *\n * Every {@link Step} produces exactly one of six categories:\n *\n * 1. `identity` — no position shift (mark, attribute, schema, block-type).\n * 2. `shift` — within a single block, the range `[from, to)` is replaced\n * with content of length `newLen`. Covers `insertText`, `deleteText`,\n * `insertInlineNode`, `removeInlineNode` as a single primitive.\n * 3. `split` — a block is split at an offset; positions past the split\n * migrate to the new block with rebased offsets.\n * 4. `merge` — a source block is appended to a target block; positions in\n * the source block migrate to the target block with offsets shifted by\n * the target's previous length.\n * 5. `blockRemoval` — one block subtree vanishes; positions inside any\n * removed block are marked deleted, and sibling child-indices in the\n * same parent shift down by one past the removed index.\n * 6. `childIndexShift` — a new block was inserted at `fromIndex` in\n * `parentPath`'s children; sibling child-indices `≥ fromIndex` shift up.\n * Position space ({blockId, offset}) is unaffected.\n *\n * `blockRemoval` and `childIndexShift` are the two categories that carry\n * **structural** information about a parent's child list. They are\n * orthogonal to positions ({blockId, offset}) and are interpreted by\n * {@link mapChildIndex} when rebasing tree-structural steps\n * (`insertNode` / `removeNode`).\n */\n\nimport { isBlockNode } from '../model/Document.js';\nimport type { BlockNode } from '../model/Document.js';\nimport type { Position } from '../model/Selection.js';\nimport { createPosition } from '../model/Selection.js';\nimport type { BlockId } from '../model/TypeBrands.js';\n\n/**\n * Result of mapping an `(blockId, [from, to))` range through a {@link Mapping}.\n *\n * Both endpoints are guaranteed to live in the same block. Callers can rely\n * on `from <= to` (the helper returns `null` rather than producing an\n * inverted range).\n */\nexport interface MappedInBlockRange {\n\treadonly blockId: BlockId;\n\treadonly from: number;\n\treadonly to: number;\n}\n\n/** Position-mapping bias at a boundary. */\nexport type Assoc = -1 | 1;\n\n// --- StepMap variants ---\n\n/** No-op map: positions pass through unchanged. */\nexport interface IdentityMap {\n\treadonly type: 'identity';\n}\n\n/**\n * Within `blockId`, the offset range `[from, to)` is replaced with content\n * of length `newLen`. Covers all in-block content edits with a single\n * primitive:\n *\n * - `insertText(blockId, off, text)` → `{from: off, to: off, newLen: text.length}`.\n * - `deleteText(blockId, f, t)` → `{from: f, to: t, newLen: 0}`.\n * - `insertInlineNode(blockId, off)` → `{from: off, to: off, newLen: 1}`.\n * - `removeInlineNode(blockId, off)` → `{from: off, to: off + 1, newLen: 0}`.\n */\nexport interface ShiftMap {\n\treadonly type: 'shift';\n\treadonly blockId: BlockId;\n\treadonly from: number;\n\treadonly to: number;\n\treadonly newLen: number;\n}\n\n/**\n * A block is split at `offset`. Content `[0, offset)` stays in `blockId`;\n * content `[offset, length)` migrates to `newBlockId` rebased to start at 0.\n */\nexport interface SplitMap {\n\treadonly type: 'split';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly newBlockId: BlockId;\n}\n\n/**\n * `sourceBlockId` is appended to `targetBlockId`. Positions in the source\n * block migrate to the target block with offset shifted by\n * `targetLengthBefore` (the target's length before the merge).\n */\nexport interface MergeMap {\n\treadonly type: 'merge';\n\treadonly targetBlockId: BlockId;\n\treadonly sourceBlockId: BlockId;\n\treadonly targetLengthBefore: number;\n}\n\n/**\n * A block subtree is removed from the document. Positions whose `blockId`\n * is in `removedBlockIds` are marked deleted; `removedBlockIds` covers the\n * removed root **plus all descendant block IDs** (see\n * {@link collectRemovedBlockIds}).\n *\n * `parentPath` and `index` carry the removal's structural coordinates so\n * sibling child-indices in the same parent can be rebased: any\n * `(parentPath, i)` with `i === index` becomes invalid (the block is gone),\n * and `i > index` shifts down by one. See {@link mapChildIndex}.\n */\nexport interface BlockRemovalMap {\n\treadonly type: 'blockRemoval';\n\treadonly removedBlockIds: ReadonlySet<BlockId>;\n\treadonly parentPath: readonly BlockId[];\n\treadonly index: number;\n}\n\n/**\n * A new block was inserted at `fromIndex` in `parentPath`'s child list.\n * Sibling child-indices `≥ fromIndex` shift up by `delta` (always `+1`\n * since {@link InsertNodeStep} inserts a single block). Position space\n * (`{blockId, offset}`) is unaffected — the new block has no prior\n * positions, and positions inside other siblings keep their offsets.\n *\n * Only consumed by {@link mapChildIndex}.\n */\nexport interface ChildIndexShiftMap {\n\treadonly type: 'childIndexShift';\n\treadonly parentPath: readonly BlockId[];\n\treadonly fromIndex: number;\n\treadonly delta: number;\n}\n\n/** Discriminated union of all StepMap variants. */\nexport type StepMap =\n\t| IdentityMap\n\t| ShiftMap\n\t| SplitMap\n\t| MergeMap\n\t| BlockRemovalMap\n\t| ChildIndexShiftMap;\n\n// --- Map results ---\n\n/** Result of mapping a single position. */\nexport interface MapResult {\n\treadonly pos: Position;\n\t/** True if the input position fell inside content removed by the map. */\n\treadonly deleted: boolean;\n}\n\n/** A range expressed in `Position` space. */\nexport interface PositionRange {\n\treadonly from: Position;\n\treadonly to: Position;\n}\n\n// --- Singletons / factories ---\n\n/** The shared identity StepMap; reuse instead of allocating per step. */\nexport const IDENTITY_MAP: IdentityMap = { type: 'identity' };\n\n/**\n * Walks a block subtree and returns the set of its own ID plus every\n * descendant block ID. Used to build {@link BlockRemovalMap.removedBlockIds}.\n */\nexport function collectRemovedBlockIds(node: BlockNode): Set<BlockId> {\n\tconst ids = new Set<BlockId>();\n\tconst walk = (n: BlockNode): void => {\n\t\tids.add(n.id);\n\t\tfor (const child of n.children) {\n\t\t\tif (isBlockNode(child)) walk(child);\n\t\t}\n\t};\n\twalk(node);\n\treturn ids;\n}\n\n// --- Single-StepMap application ---\n\n/**\n * Maps a single position through one {@link StepMap}.\n *\n * @param pos input position\n * @param map the StepMap describing the change\n * @param assoc which side of a boundary to stick to (default `-1`)\n * @returns mapped position plus a `deleted` flag indicating whether `pos`\n * fell inside content that the step removed\n */\nexport function mapPositionThroughStep(pos: Position, map: StepMap, assoc: Assoc = -1): MapResult {\n\tswitch (map.type) {\n\t\tcase 'identity':\n\t\t\treturn { pos, deleted: false };\n\t\tcase 'shift':\n\t\t\treturn mapPositionThroughShift(pos, map, assoc);\n\t\tcase 'split':\n\t\t\treturn mapPositionThroughSplit(pos, map, assoc);\n\t\tcase 'merge':\n\t\t\treturn mapPositionThroughMerge(pos, map);\n\t\tcase 'blockRemoval':\n\t\t\treturn mapPositionThroughBlockRemoval(pos, map);\n\t\tcase 'childIndexShift':\n\t\t\t// Child-index shifts do not touch position space ({blockId, offset}):\n\t\t\t// a new sibling block has no prior positions to map, and existing\n\t\t\t// siblings keep their internal offsets even if their parent-relative\n\t\t\t// index changed. Consumed only by {@link mapChildIndex}.\n\t\t\treturn { pos, deleted: false };\n\t}\n}\n\nfunction mapPositionThroughShift(pos: Position, map: ShiftMap, assoc: Assoc): MapResult {\n\tif (pos.blockId !== map.blockId) return { pos, deleted: false };\n\n\tconst delta: number = map.newLen - (map.to - map.from);\n\tconst off: number = pos.offset;\n\n\t// Strictly before the affected range\n\tif (off < map.from) return { pos, deleted: false };\n\n\t// At the start boundary\n\tif (off === map.from) {\n\t\t// Pure insertion (from === to): assoc decides whether we stick before\n\t\t// or after the inserted run.\n\t\tif (map.from === map.to) {\n\t\t\tconst newOff: number = assoc === 1 ? map.from + map.newLen : map.from;\n\t\t\treturn newOff === off\n\t\t\t\t? { pos, deleted: false }\n\t\t\t\t: { pos: shiftedPos(pos, newOff), deleted: false };\n\t\t}\n\t\t// Deletion starts at this point — position stays at `from` regardless\n\t\t// of assoc; nothing was inserted to skip past.\n\t\treturn { pos, deleted: false };\n\t}\n\n\t// Strictly inside [from, to): position fell into removed content\n\tif (off < map.to) {\n\t\tconst newOff: number = assoc === 1 ? map.from + map.newLen : map.from;\n\t\treturn { pos: shiftedPos(pos, newOff), deleted: true };\n\t}\n\n\t// At or past the end boundary: shift by delta\n\tconst newOff: number = off + delta;\n\treturn newOff === off\n\t\t? { pos, deleted: false }\n\t\t: { pos: shiftedPos(pos, newOff), deleted: false };\n}\n\nfunction mapPositionThroughSplit(pos: Position, map: SplitMap, assoc: Assoc): MapResult {\n\tif (pos.blockId !== map.blockId) return { pos, deleted: false };\n\n\tif (pos.offset < map.offset) return { pos, deleted: false };\n\n\tif (pos.offset > map.offset) {\n\t\treturn {\n\t\t\tpos: createPosition(map.newBlockId, pos.offset - map.offset),\n\t\t\tdeleted: false,\n\t\t};\n\t}\n\n\t// At the split boundary: assoc decides which side keeps the cursor.\n\tif (assoc === 1) {\n\t\treturn { pos: createPosition(map.newBlockId, 0), deleted: false };\n\t}\n\treturn { pos, deleted: false };\n}\n\nfunction mapPositionThroughMerge(pos: Position, map: MergeMap): MapResult {\n\tif (pos.blockId !== map.sourceBlockId) return { pos, deleted: false };\n\treturn {\n\t\tpos: createPosition(map.targetBlockId, pos.offset + map.targetLengthBefore),\n\t\tdeleted: false,\n\t};\n}\n\nfunction mapPositionThroughBlockRemoval(pos: Position, map: BlockRemovalMap): MapResult {\n\tif (map.removedBlockIds.has(pos.blockId)) {\n\t\treturn { pos, deleted: true };\n\t}\n\treturn { pos, deleted: false };\n}\n\n/** Allocates a new Position with the given offset, preserving an optional `path`. */\nfunction shiftedPos(original: Position, newOffset: number): Position {\n\treturn createPosition(original.blockId, newOffset, original.path);\n}\n\n// --- Mapping ---\n\n/**\n * Composes a sequence of {@link StepMap}s into a single mapper. A `Mapping`\n * is immutable; `appendMap` returns a new instance.\n *\n * Construction always normalizes by dropping identity maps — they're a\n * common case and would otherwise inflate every transaction's mapping\n * pipeline with no-ops.\n */\nexport class Mapping {\n\t/** Shared empty Mapping. */\n\tstatic readonly empty: Mapping = new Mapping([]);\n\n\treadonly maps: readonly StepMap[];\n\n\tprivate constructor(maps: readonly StepMap[]) {\n\t\tthis.maps = maps;\n\t}\n\n\t/** Creates a Mapping from a list of StepMaps, dropping identity maps. */\n\tstatic from(maps: readonly StepMap[]): Mapping {\n\t\tconst filtered: StepMap[] = [];\n\t\tfor (const m of maps) {\n\t\t\tif (m.type !== 'identity') filtered.push(m);\n\t\t}\n\t\tif (filtered.length === 0) return Mapping.empty;\n\t\treturn new Mapping(filtered);\n\t}\n\n\t/** Returns a new Mapping with `map` appended. */\n\tappendMap(map: StepMap): Mapping {\n\t\tif (map.type === 'identity') return this;\n\t\treturn new Mapping([...this.maps, map]);\n\t}\n\n\t/** Concatenates two mappings into a new one. */\n\tappendMapping(other: Mapping): Mapping {\n\t\tif (other.maps.length === 0) return this;\n\t\tif (this.maps.length === 0) return other;\n\t\treturn new Mapping([...this.maps, ...other.maps]);\n\t}\n\n\t/** True if the mapping contains no position-changing maps. */\n\tget isEmpty(): boolean {\n\t\treturn this.maps.length === 0;\n\t}\n\n\t/**\n\t * Folds a position through every contained StepMap in order.\n\t * Returns the mapped position; the `deleted` flag is **not** preserved\n\t * (use {@link mapResult} when you need it).\n\t */\n\tmap(pos: Position, assoc: Assoc = -1): Position {\n\t\treturn this.mapResult(pos, assoc).pos;\n\t}\n\n\t/**\n\t * Like {@link map}, but returns whether the position landed in deleted\n\t * content at any step. Once a position is marked deleted, the flag is\n\t * sticky — subsequent steps do not \"un-delete\" it.\n\t */\n\tmapResult(pos: Position, assoc: Assoc = -1): MapResult {\n\t\tlet current: Position = pos;\n\t\tlet deleted = false;\n\t\tfor (const m of this.maps) {\n\t\t\tconst result: MapResult = mapPositionThroughStep(current, m, assoc);\n\t\t\tcurrent = result.pos;\n\t\t\tif (result.deleted) deleted = true;\n\t\t}\n\t\treturn { pos: current, deleted };\n\t}\n\n\t/**\n\t * Maps a range. By convention, `from` is mapped with `assoc = -1`\n\t * (inclusive-start) and `to` with `assoc = +1` (exclusive-end). The\n\t * caller may override either bias.\n\t *\n\t * Returns `null` when both endpoints land in deleted content **and** the\n\t * mapped range would collapse to length zero or negative — i.e. the\n\t * range no longer covers any live content.\n\t *\n\t * The returned `from`/`to` may live in different blocks (e.g. after a\n\t * `split` map). Callers that require an in-block range (decorations,\n\t * inline selections) must detect and split accordingly.\n\t */\n\tmapRange(range: PositionRange, assocFrom: Assoc = -1, assocTo: Assoc = 1): PositionRange | null {\n\t\tconst from: MapResult = this.mapResult(range.from, assocFrom);\n\t\tconst to: MapResult = this.mapResult(range.to, assocTo);\n\n\t\tif (from.deleted && to.deleted) {\n\t\t\tif (from.pos.blockId === to.pos.blockId && from.pos.offset >= to.pos.offset) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn { from: from.pos, to: to.pos };\n\t}\n}\n\n// --- In-block range helpers (used by per-step Step→Step mapping) ---\n\n/**\n * Maps an `(blockId, [from, to))` range through `mapping`, asserting the\n * result lives in a single block.\n *\n * Returns `null` when the range no longer addresses live content in a single\n * block:\n *\n * - the host block was removed;\n * - the range was fully deleted (both endpoints flagged deleted and collapse);\n * - the endpoints migrated to different blocks (range fragmented, e.g. a\n * `split` map placed `from` and `to` on opposite sides of the cut).\n *\n * Default biases are **conservative for step rebasing**: `assocFrom = +1`,\n * `assocTo = -1`. An intervening insertion at either boundary therefore\n * does NOT expand the rebased range to cover the new content — the user's\n * original edit only addressed the original content, and the agent's\n * intervening insertion should be preserved across an undo/redo. This is\n * the opposite of {@link Mapping.mapRange}'s default biases, which model\n * selections (inclusive-start, exclusive-end) where boundary insertions\n * naturally extend the selection.\n */\nexport function mapInBlockRange(\n\tblockId: BlockId,\n\tfrom: number,\n\tto: number,\n\tmapping: Mapping,\n\tassocFrom: Assoc = 1,\n\tassocTo: Assoc = -1,\n): MappedInBlockRange | null {\n\tif (mapping.isEmpty) return { blockId, from, to };\n\n\tconst fromPos: Position = createPosition(blockId, from);\n\tconst toPos: Position = createPosition(blockId, to);\n\tconst fromResult: MapResult = mapping.mapResult(fromPos, assocFrom);\n\tconst toResult: MapResult = mapping.mapResult(toPos, assocTo);\n\n\t// If both endpoints fell inside removed/replaced content, the range no\n\t// longer addresses live document territory — abandon. A partial overlap\n\t// (one endpoint deleted, the other shifted) still survives clamped.\n\tif (fromResult.deleted && toResult.deleted) return null;\n\n\t// Range must remain within a single block. A split could have moved one\n\t// endpoint to the new block; that's a fragmentation we cannot represent\n\t// as a single in-block step.\n\tif (fromResult.pos.blockId !== toResult.pos.blockId) return null;\n\n\t// Defensive: a range whose endpoints inverted (from > to) is invalid.\n\t// An empty range with from === to is still valid (e.g. a pure-insertion\n\t// `shift` whose offset survived).\n\tif (fromResult.pos.offset > toResult.pos.offset) return null;\n\n\treturn {\n\t\tblockId: fromResult.pos.blockId,\n\t\tfrom: fromResult.pos.offset,\n\t\tto: toResult.pos.offset,\n\t};\n}\n\n/**\n * Maps an `(blockId, offset)` point through `mapping`, returning the\n * equivalent in-block position or `null` when the host block was removed.\n *\n * Convenience wrapper around {@link mapInBlockRange} for steps that carry a\n * single offset (`insertText`, `insertInlineNode`, `splitBlock`).\n */\nexport function mapOffsetInBlock(\n\tblockId: BlockId,\n\toffset: number,\n\tmapping: Mapping,\n\tassoc: Assoc = -1,\n): MappedInBlockRange | null {\n\tif (mapping.isEmpty) return { blockId, from: offset, to: offset };\n\n\tconst pos: Position = createPosition(blockId, offset);\n\tconst result: MapResult = mapping.mapResult(pos, assoc);\n\tif (result.deleted) return null;\n\treturn { blockId: result.pos.blockId, from: result.pos.offset, to: result.pos.offset };\n}\n\n// --- Child-index mapping (used by structural step rebasing) ---\n\n/**\n * Rebases a child-index `(parentPath, index)` through `mapping`. The\n * `index` is interpreted as the position of an **existing** child block:\n * if an intervening edit removed exactly that child, the result is\n * `null`. For an **insertion slot** (the target index of a future\n * `insertNode`), use {@link mapInsertionIndex} — slots stay valid even\n * when the block previously at that index is removed.\n *\n * Child-indices live in a coordinate space orthogonal to positions\n * (`{blockId, offset}`): they describe a slot in a parent's child list,\n * not a place inside text. Only two {@link StepMap} categories carry\n * child-index-affecting information:\n *\n * - {@link ChildIndexShiftMap} (produced by `insertNode`): shifts\n * sibling indices `≥ fromIndex` by `delta` (always `+1` today).\n * - {@link BlockRemovalMap} (produced by `removeNode`): removes the child\n * at `index` (the input index becomes invalid → `null`), and shifts\n * sibling indices `> index` down by `1`.\n *\n * Maps whose `parentPath` differs from the input pass through; all\n * non-structural categories (`shift`, `split`, `merge`, `identity`) are\n * no-ops here.\n */\nexport function mapChildIndex(\n\tparentPath: readonly BlockId[],\n\tindex: number,\n\tmapping: Mapping,\n): number | null {\n\treturn foldChildIndex(parentPath, index, mapping, 'existing');\n}\n\n/**\n * Rebases an **insertion slot** `(parentPath, index)` through `mapping`.\n * An insertion slot lives in `[0, children.length]` (inclusive of the\n * end) and represents \"where to insert\", not an existing block. Slots\n * remain valid across intervening edits — even when the block previously\n * at that index is removed — so this function never returns `null`.\n *\n * Difference from {@link mapChildIndex}: for a `BlockRemovalMap` with\n * matching parent and `index === map.index`, this function keeps the\n * slot (returning `map.index`, which is the same numeric position in the\n * post-removal frame); {@link mapChildIndex} would return `null`.\n * {@link ChildIndexShiftMap} handling is identical.\n */\nexport function mapInsertionIndex(\n\tparentPath: readonly BlockId[],\n\tindex: number,\n\tmapping: Mapping,\n): number {\n\t// `foldChildIndex` with `'insertion'` provably never returns `null` —\n\t// the only path that would (BlockRemovalMap, matching parent, matching\n\t// index) is short-circuited inside `mapChildIndexThroughStep`. The\n\t// overload signature carries that invariant into the type system.\n\treturn foldChildIndex(parentPath, index, mapping, 'insertion');\n}\n\ntype ChildIndexKind = 'existing' | 'insertion';\n\nfunction foldChildIndex(\n\tparentPath: readonly BlockId[],\n\tindex: number,\n\tmapping: Mapping,\n\tkind: 'existing',\n): number | null;\nfunction foldChildIndex(\n\tparentPath: readonly BlockId[],\n\tindex: number,\n\tmapping: Mapping,\n\tkind: 'insertion',\n): number;\nfunction foldChildIndex(\n\tparentPath: readonly BlockId[],\n\tindex: number,\n\tmapping: Mapping,\n\tkind: ChildIndexKind,\n): number | null {\n\tif (mapping.isEmpty) return index;\n\n\tlet current: number = index;\n\tfor (const m of mapping.maps) {\n\t\tconst next: number | null = mapChildIndexThroughStep(parentPath, current, m, kind);\n\t\tif (next === null) return null;\n\t\tcurrent = next;\n\t}\n\treturn current;\n}\n\nfunction mapChildIndexThroughStep(\n\tparentPath: readonly BlockId[],\n\tindex: number,\n\tmap: StepMap,\n\tkind: ChildIndexKind,\n): number | null {\n\tswitch (map.type) {\n\t\tcase 'identity':\n\t\tcase 'shift':\n\t\tcase 'split':\n\t\tcase 'merge':\n\t\t\treturn index;\n\t\tcase 'blockRemoval':\n\t\t\tif (!sameParentPath(parentPath, map.parentPath)) return index;\n\t\t\tif (index === map.index) {\n\t\t\t\t// Existing-child semantics: that child is gone → invalid.\n\t\t\t\t// Insertion-slot semantics: the slot survives; nothing was\n\t\t\t\t// inserted/removed *to the left* of `index`, so the slot\n\t\t\t\t// number is unchanged in the post-removal frame.\n\t\t\t\treturn kind === 'existing' ? null : index;\n\t\t\t}\n\t\t\tif (index > map.index) return index - 1;\n\t\t\treturn index;\n\t\tcase 'childIndexShift':\n\t\t\tif (!sameParentPath(parentPath, map.parentPath)) return index;\n\t\t\tif (index >= map.fromIndex) return index + map.delta;\n\t\t\treturn index;\n\t}\n}\n\nfunction sameParentPath(a: readonly BlockId[], b: readonly BlockId[]): boolean {\n\tif (a === b) return true;\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) {\n\t\tif (a[i] !== b[i]) return false;\n\t}\n\treturn true;\n}\n\n// --- StepMap inversion (used by history's frame-walk cancellation) ---\n\n/**\n * Returns the {@link StepMap} that undoes `map` in position space — i.e.\n * composing `map` with `invertStepMap(map)` is content-preserving (though\n * the composed position-mapping is *not* a true identity in our framework:\n * positions interior to a delete-then-reinsert round-trip clamp to the\n * deletion start during the deletion half and don't return on the insert\n * half).\n *\n * Used by history to detect mutually-inverse stepmaps in the rebase chain\n * and cancel them, sidestepping the round-trip clamping for cases where\n * the rebase is a no-op in content terms.\n *\n * `BlockRemovalMap`'s inverse is {@link IDENTITY_MAP}: re-inserting a\n * removed block subtree does not shift positions in *other* blocks, so the\n * inverse direction is invisible to position-mapping. Callers that need to\n * re-validate \"did the block come back\" must check the document instead.\n */\nexport function invertStepMap(map: StepMap): StepMap {\n\tswitch (map.type) {\n\t\tcase 'identity':\n\t\t\treturn IDENTITY_MAP;\n\t\tcase 'shift':\n\t\t\treturn {\n\t\t\t\ttype: 'shift',\n\t\t\t\tblockId: map.blockId,\n\t\t\t\tfrom: map.from,\n\t\t\t\tto: map.from + map.newLen,\n\t\t\t\tnewLen: map.to - map.from,\n\t\t\t};\n\t\tcase 'split':\n\t\t\treturn {\n\t\t\t\ttype: 'merge',\n\t\t\t\ttargetBlockId: map.blockId,\n\t\t\t\tsourceBlockId: map.newBlockId,\n\t\t\t\ttargetLengthBefore: map.offset,\n\t\t\t};\n\t\tcase 'merge':\n\t\t\treturn {\n\t\t\t\ttype: 'split',\n\t\t\t\tblockId: map.targetBlockId,\n\t\t\t\toffset: map.targetLengthBefore,\n\t\t\t\tnewBlockId: map.sourceBlockId,\n\t\t\t};\n\t\tcase 'blockRemoval':\n\t\t\t// Re-inserting a removed subtree does not shift positions in other\n\t\t\t// blocks, so the inverse position-space direction is invisible. The\n\t\t\t// child-index shift direction *is* representable as a\n\t\t\t// `childIndexShift` map, but history's cancellation only looks for\n\t\t\t// content-trivial round-trips; we return IDENTITY_MAP and let the\n\t\t\t// caller fall back to the standard rebase path. See JSDoc above.\n\t\t\treturn IDENTITY_MAP;\n\t\tcase 'childIndexShift':\n\t\t\t// Inverting an insertNode (delta = +1 at fromIndex) is a removeNode\n\t\t\t// at the same index, which carries both position- and child-index\n\t\t\t// effects via `BlockRemovalMap`. Producing a faithful inverse here\n\t\t\t// would require knowing `removedBlockIds`, which a position-only\n\t\t\t// `StepMap` does not carry. Return IDENTITY_MAP for the same reason\n\t\t\t// as `blockRemoval`: cancellation won't fire for these pairs, but\n\t\t\t// the frame-walk's standard rebase path still produces correct\n\t\t\t// rebased steps.\n\t\t\treturn IDENTITY_MAP;\n\t}\n}\n\n/**\n * Structural equality for {@link StepMap}s. Used by history to recognize\n * cancelling pairs in the rebase chain ({@link invertStepMap}(a) ≡ b).\n */\nexport function stepMapsEqual(a: StepMap, b: StepMap): boolean {\n\tif (a.type !== b.type) return false;\n\tswitch (a.type) {\n\t\tcase 'identity':\n\t\t\treturn true;\n\t\tcase 'shift': {\n\t\t\tconst bs = b as ShiftMap;\n\t\t\treturn (\n\t\t\t\ta.blockId === bs.blockId && a.from === bs.from && a.to === bs.to && a.newLen === bs.newLen\n\t\t\t);\n\t\t}\n\t\tcase 'split': {\n\t\t\tconst bs = b as SplitMap;\n\t\t\treturn a.blockId === bs.blockId && a.offset === bs.offset && a.newBlockId === bs.newBlockId;\n\t\t}\n\t\tcase 'merge': {\n\t\t\tconst bm = b as MergeMap;\n\t\t\treturn (\n\t\t\t\ta.targetBlockId === bm.targetBlockId &&\n\t\t\t\ta.sourceBlockId === bm.sourceBlockId &&\n\t\t\t\ta.targetLengthBefore === bm.targetLengthBefore\n\t\t\t);\n\t\t}\n\t\tcase 'blockRemoval': {\n\t\t\tconst br = b as BlockRemovalMap;\n\t\t\tif (a.index !== br.index) return false;\n\t\t\tif (!sameParentPath(a.parentPath, br.parentPath)) return false;\n\t\t\tif (a.removedBlockIds.size !== br.removedBlockIds.size) return false;\n\t\t\tfor (const id of a.removedBlockIds) {\n\t\t\t\tif (!br.removedBlockIds.has(id)) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tcase 'childIndexShift': {\n\t\t\tconst cs = b as ChildIndexShiftMap;\n\t\t\treturn (\n\t\t\t\ta.fromIndex === cs.fromIndex &&\n\t\t\t\ta.delta === cs.delta &&\n\t\t\t\tsameParentPath(a.parentPath, cs.parentPath)\n\t\t\t);\n\t\t}\n\t}\n}\n","/**\n * Pure functions for recursive block-tree traversal and transformation.\n * Extracted from StepApplication.ts to keep files under ~500 lines.\n */\n\nimport { type BlockNode, type ChildNode, type Document, isBlockNode } from '../model/Document.js';\n\n/** Finds a block by ID anywhere in the tree and applies a transform. */\nexport function mapBlock(\n\tdoc: Document,\n\tblockId: string,\n\tfn: (block: BlockNode) => BlockNode,\n): Document {\n\treturn {\n\t\tchildren: mapBlockInChildren(doc.children, blockId, fn) as BlockNode[],\n\t};\n}\n\n/**\n * Recursively maps over children to find and transform a block by ID.\n *\n * Preserves reference identity: when the target block is not found in a given\n * subtree, the original `children` array (and the original child nodes along\n * the way) are returned unchanged, so unrelated subtrees are not reallocated on\n * every edit.\n */\nexport function mapBlockInChildren(\n\tchildren: readonly ChildNode[],\n\tblockId: string,\n\tfn: (block: BlockNode) => BlockNode,\n): ChildNode[] {\n\tlet changed = false;\n\tconst mapped: ChildNode[] = children.map((child) => {\n\t\tif (!isBlockNode(child)) return child;\n\t\tif (child.id === blockId) {\n\t\t\tchanged = true;\n\t\t\treturn fn(child);\n\t\t}\n\t\t// Recurse into block children; an unchanged subtree returns the same\n\t\t// `child.children` reference, so the identity check below holds.\n\t\tconst mappedChildren: ChildNode[] = mapBlockInChildren(child.children, blockId, fn);\n\t\tif (mappedChildren === child.children) return child;\n\t\tchanged = true;\n\t\treturn { ...child, children: mappedChildren };\n\t});\n\treturn changed ? mapped : (children as ChildNode[]);\n}\n\n/**\n * Maps a node at the given path, replacing it with the result of fn.\n * Navigates down the path immutably, creating new parent nodes as needed.\n */\nexport function mapNodeByPath(\n\tdoc: Document,\n\tpath: readonly string[],\n\tfn: (node: BlockNode) => BlockNode,\n): Document {\n\tif (path.length === 0) return doc;\n\n\tconst rootId: string | undefined = path[0];\n\tif (!rootId) return doc;\n\treturn {\n\t\tchildren: doc.children.map((child) => {\n\t\t\tif (!isBlockNode(child) || child.id !== rootId) return child;\n\t\t\tif (path.length === 1) return fn(child);\n\t\t\treturn mapNodeByPathRecursive(child, path, 1, fn);\n\t\t}),\n\t};\n}\n\n/** Recursive helper for mapNodeByPath — walks one level deeper. */\nexport function mapNodeByPathRecursive(\n\tnode: BlockNode,\n\tpath: readonly string[],\n\tdepth: number,\n\tfn: (node: BlockNode) => BlockNode,\n): BlockNode {\n\tconst targetId: string | undefined = path[depth];\n\tif (!targetId) return node;\n\tconst newChildren: ChildNode[] = node.children.map((child) => {\n\t\tif (!isBlockNode(child) || child.id !== targetId) return child;\n\t\tif (depth === path.length - 1) return fn(child);\n\t\treturn mapNodeByPathRecursive(child, path, depth + 1, fn);\n\t});\n\treturn { ...node, children: newChildren };\n}\n\n/**\n * Searches children for a level where `predicate` matches,\n * then applies `transform` at that level.\n * Recurses into nested BlockNodes if not found at the current level.\n *\n * Returns `null` if no matching level was found.\n */\nexport function findAndTransformChildren(\n\tchildren: readonly ChildNode[],\n\tpredicate: (children: readonly ChildNode[]) => boolean,\n\ttransform: (children: readonly ChildNode[]) => readonly ChildNode[],\n): readonly ChildNode[] | null {\n\tif (predicate(children)) {\n\t\treturn transform(children);\n\t}\n\n\tlet changed = false;\n\tconst newChildren: ChildNode[] = children.map((child) => {\n\t\tif (!isBlockNode(child)) return child;\n\t\tconst result: readonly ChildNode[] | null = findAndTransformChildren(\n\t\t\tchild.children,\n\t\t\tpredicate,\n\t\t\ttransform,\n\t\t);\n\t\tif (result) {\n\t\t\tchanged = true;\n\t\t\treturn { ...child, children: result };\n\t\t}\n\t\treturn child;\n\t});\n\n\treturn changed ? newChildren : null;\n}\n","/**\n * Pure functions for manipulating inline content (TextNode / InlineNode arrays).\n * Extracted from StepApplication.ts to keep files under ~500 lines.\n */\n\nimport {\n\ttype ChildNode,\n\ttype ContentSegment,\n\ttype InlineNode,\n\ttype Mark,\n\ttype TextNode,\n\taddMarkToSet,\n\tcontentSegmentToInlineNode,\n\tcreateTextNode,\n\tisInlineNode,\n\tisTextNode,\n\tmarksEqual,\n\tremoveMarkFromSet,\n} from '../model/Document.js';\nimport type { MarkTypeName } from '../model/TypeBrands.js';\n\n/**\n * Inserts text into mixed inline content at the given offset.\n * Handles both TextNode and InlineNode children.\n */\nexport function insertTextIntoInlineContent(\n\tnodes: readonly (TextNode | InlineNode)[],\n\toffset: number,\n\ttext: string,\n\tmarks: readonly Mark[],\n): (TextNode | InlineNode)[] {\n\treturn insertIntoInlineContent(nodes, offset, () => [createTextNode(text, marks)]);\n}\n\n/**\n * Inserts content segments (text and inline nodes) into mixed inline content\n * at the given offset. Inline segments are restored as atomic nodes, so this\n * round-trips the payload captured by `getBlockContentSegmentsInRange`.\n */\nexport function insertSegmentsIntoInlineContent(\n\tnodes: readonly (TextNode | InlineNode)[],\n\toffset: number,\n\tsegments: readonly ContentSegment[],\n): (TextNode | InlineNode)[] {\n\treturn insertIntoInlineContent(nodes, offset, () => segments.map(contentSegmentToInlineNode));\n}\n\n/** Shared insertion logic for text and segments into mixed inline content. */\nfunction insertIntoInlineContent(\n\tnodes: readonly (TextNode | InlineNode)[],\n\toffset: number,\n\tcreateInsertedNodes: () => readonly (TextNode | InlineNode)[],\n): (TextNode | InlineNode)[] {\n\tconst result: (TextNode | InlineNode)[] = [];\n\tlet pos = 0;\n\tlet inserted = false;\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tif (!inserted && offset === pos) {\n\t\t\t\tresult.push(...createInsertedNodes());\n\t\t\t\tinserted = true;\n\t\t\t}\n\t\t\tresult.push(node);\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst nodeEnd: number = pos + node.text.length;\n\n\t\tif (!inserted && offset >= pos && offset <= nodeEnd) {\n\t\t\tconst localOffset: number = offset - pos;\n\t\t\tconst before: string = node.text.slice(0, localOffset);\n\t\t\tconst after: string = node.text.slice(localOffset);\n\n\t\t\tif (before) result.push(createTextNode(before, node.marks));\n\t\t\tresult.push(...createInsertedNodes());\n\t\t\tif (after) result.push(createTextNode(after, node.marks));\n\t\t\tinserted = true;\n\t\t} else {\n\t\t\tresult.push(node);\n\t\t}\n\n\t\tpos = nodeEnd;\n\t}\n\n\tif (!inserted) {\n\t\tresult.push(...createInsertedNodes());\n\t}\n\n\treturn result;\n}\n\n/**\n * Deletes content from mixed inline content in the given range.\n * Removes InlineNodes that fall within the range.\n */\nexport function deleteFromInlineContent(\n\tnodes: readonly (TextNode | InlineNode)[],\n\tfrom: number,\n\tto: number,\n): (TextNode | InlineNode)[] {\n\tconst result: (TextNode | InlineNode)[] = [];\n\tlet pos = 0;\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tconst nodeEnd: number = pos + 1;\n\t\t\t// Keep if outside the delete range\n\t\t\tif (nodeEnd <= from || pos >= to) {\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t\tpos = nodeEnd;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst nodeEnd: number = pos + node.text.length;\n\n\t\tif (nodeEnd <= from || pos >= to) {\n\t\t\tresult.push(node);\n\t\t} else {\n\t\t\tconst deleteFrom: number = Math.max(0, from - pos);\n\t\t\tconst deleteTo: number = Math.min(node.text.length, to - pos);\n\t\t\tconst remaining: string = node.text.slice(0, deleteFrom) + node.text.slice(deleteTo);\n\t\t\tif (remaining.length > 0) {\n\t\t\t\tresult.push(createTextNode(remaining, node.marks));\n\t\t\t}\n\t\t}\n\n\t\tpos = nodeEnd;\n\t}\n\n\treturn result;\n}\n\n/**\n * Slices mixed inline content to the given range.\n * InlineNodes are preserved as atoms (included if within range).\n */\nexport function sliceInlineContent(\n\tnodes: readonly (TextNode | InlineNode)[],\n\tfrom: number,\n\tto: number,\n): (TextNode | InlineNode)[] {\n\tconst result: (TextNode | InlineNode)[] = [];\n\tlet pos = 0;\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tconst nodeEnd: number = pos + 1;\n\t\t\tif (nodeEnd > from && pos < to) {\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t\tpos = nodeEnd;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst nodeEnd: number = pos + node.text.length;\n\n\t\tif (nodeEnd <= from || pos >= to) {\n\t\t\t// Outside the slice range\n\t\t} else {\n\t\t\tconst sliceFrom: number = Math.max(0, from - pos);\n\t\t\tconst sliceTo: number = Math.min(node.text.length, to - pos);\n\t\t\tconst text: string = node.text.slice(sliceFrom, sliceTo);\n\t\t\tif (text.length > 0) {\n\t\t\t\tresult.push(createTextNode(text, node.marks));\n\t\t\t}\n\t\t}\n\n\t\tpos = nodeEnd;\n\t}\n\n\tif (result.length === 0) {\n\t\tresult.push(createTextNode(''));\n\t}\n\n\treturn result;\n}\n\n/**\n * Applies or removes a mark from mixed inline content in the given range.\n * InlineNodes are passed through unchanged (marks only apply to text).\n */\nexport function applyMarkToInlineContent(\n\tnodes: readonly (TextNode | InlineNode)[],\n\tfrom: number,\n\tto: number,\n\tmark: Mark,\n\tadd: boolean,\n): (TextNode | InlineNode)[] {\n\tconst result: (TextNode | InlineNode)[] = [];\n\tlet pos = 0;\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tresult.push(node);\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst nodeEnd: number = pos + node.text.length;\n\n\t\tif (nodeEnd <= from || pos >= to) {\n\t\t\tresult.push(node);\n\t\t} else if (pos >= from && nodeEnd <= to) {\n\t\t\tconst newMarks: readonly Mark[] = add\n\t\t\t\t? addMarkToSet(node.marks, mark)\n\t\t\t\t: removeMarkFromSet(node.marks, mark.type);\n\t\t\tresult.push(createTextNode(node.text, newMarks));\n\t\t} else {\n\t\t\tconst overlapStart: number = Math.max(0, from - pos);\n\t\t\tconst overlapEnd: number = Math.min(node.text.length, to - pos);\n\n\t\t\tconst beforeText: string = node.text.slice(0, overlapStart);\n\t\t\tconst insideText: string = node.text.slice(overlapStart, overlapEnd);\n\t\t\tconst afterText: string = node.text.slice(overlapEnd);\n\n\t\t\tif (beforeText) result.push(createTextNode(beforeText, node.marks));\n\t\t\tif (insideText) {\n\t\t\t\tconst newMarks: readonly Mark[] = add\n\t\t\t\t\t? addMarkToSet(node.marks, mark)\n\t\t\t\t\t: removeMarkFromSet(node.marks, mark.type);\n\t\t\t\tresult.push(createTextNode(insideText, newMarks));\n\t\t\t}\n\t\t\tif (afterText) result.push(createTextNode(afterText, node.marks));\n\t\t}\n\n\t\tpos = nodeEnd;\n\t}\n\n\treturn result;\n}\n\n/**\n * Maximal sub-ranges within [from, to) where no text node carries a mark\n * of type `markType`. InlineNodes are inert: they pass through and do not\n * break coalescing, but a range never starts on an InlineNode.\n *\n * Used by `TransactionBuilder.addMark` to emit `AddMarkStep`s only over\n * sub-ranges that actually lack the mark, so the symmetric inverse\n * preserves any marks that pre-existed.\n */\nexport function findRangesMissingMark(\n\tnodes: readonly (TextNode | InlineNode)[],\n\tfrom: number,\n\tto: number,\n\tmarkType: MarkTypeName,\n): readonly { readonly from: number; readonly to: number }[] {\n\tconst result: { from: number; to: number }[] = [];\n\tif (from >= to) return result;\n\tlet current: { from: number; to: number } | null = null;\n\tlet pos = 0;\n\n\tconst flush = (): void => {\n\t\tif (current) {\n\t\t\tresult.push(current);\n\t\t\tcurrent = null;\n\t\t}\n\t};\n\n\tfor (const node of nodes) {\n\t\tconst nodeLength: number = isInlineNode(node) ? 1 : node.text.length;\n\t\tconst nodeEnd: number = pos + nodeLength;\n\n\t\tif (nodeEnd <= from || pos >= to) {\n\t\t\tpos = nodeEnd;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst overlapStart: number = Math.max(pos, from);\n\t\tconst overlapEnd: number = Math.min(nodeEnd, to);\n\n\t\tif (isInlineNode(node)) {\n\t\t\tif (current) current.to = overlapEnd;\n\t\t} else if (node.marks.some((m) => m.type === markType)) {\n\t\t\tflush();\n\t\t} else if (current) {\n\t\t\tcurrent.to = overlapEnd;\n\t\t} else {\n\t\t\tcurrent = { from: overlapStart, to: overlapEnd };\n\t\t}\n\n\t\tpos = nodeEnd;\n\t}\n\n\tflush();\n\treturn result;\n}\n\n/**\n * Maximal sub-ranges within [from, to) where every text node carries a mark\n * of type `markType`. Each range is paired with the actual mark from the\n * document (including attrs). Adjacent sub-ranges coalesce only when their\n * marks are `marksEqual`. InlineNodes are inert: they pass through and do\n * not break coalescing, but a range never starts on an InlineNode.\n *\n * Used by `TransactionBuilder.removeMark` to emit `RemoveMarkStep`s whose\n * `mark` reflects the actual document content, so the symmetric inverse\n * restores attrs faithfully.\n */\nexport function findRangesWithMark(\n\tnodes: readonly (TextNode | InlineNode)[],\n\tfrom: number,\n\tto: number,\n\tmarkType: MarkTypeName,\n): readonly { readonly from: number; readonly to: number; readonly mark: Mark }[] {\n\tconst result: { from: number; to: number; mark: Mark }[] = [];\n\tif (from >= to) return result;\n\tlet current: { from: number; to: number; mark: Mark } | null = null;\n\tlet pos = 0;\n\n\tconst flush = (): void => {\n\t\tif (current) {\n\t\t\tresult.push(current);\n\t\t\tcurrent = null;\n\t\t}\n\t};\n\n\tfor (const node of nodes) {\n\t\tconst nodeLength: number = isInlineNode(node) ? 1 : node.text.length;\n\t\tconst nodeEnd: number = pos + nodeLength;\n\n\t\tif (nodeEnd <= from || pos >= to) {\n\t\t\tpos = nodeEnd;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst overlapStart: number = Math.max(pos, from);\n\t\tconst overlapEnd: number = Math.min(nodeEnd, to);\n\n\t\tif (isInlineNode(node)) {\n\t\t\tif (current) current.to = overlapEnd;\n\t\t} else {\n\t\t\tconst actual: Mark | undefined = node.marks.find((m) => m.type === markType);\n\t\t\tif (!actual) {\n\t\t\t\tflush();\n\t\t\t} else if (current && marksEqual(current.mark, actual)) {\n\t\t\t\tcurrent.to = overlapEnd;\n\t\t\t} else {\n\t\t\t\tflush();\n\t\t\t\tcurrent = { from: overlapStart, to: overlapEnd, mark: actual };\n\t\t\t}\n\t\t}\n\n\t\tpos = nodeEnd;\n\t}\n\n\tflush();\n\treturn result;\n}\n\n/** Inserts an InlineNode at the given offset in mixed inline content. */\nexport function insertInlineNodeAtOffset(\n\tnodes: readonly (TextNode | InlineNode)[],\n\toffset: number,\n\tinlineNode: InlineNode,\n): (TextNode | InlineNode)[] {\n\tconst result: (TextNode | InlineNode)[] = [];\n\tlet pos = 0;\n\tlet inserted = false;\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tif (!inserted && offset === pos) {\n\t\t\t\tresult.push(inlineNode);\n\t\t\t\tinserted = true;\n\t\t\t}\n\t\t\tresult.push(node);\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst nodeEnd: number = pos + node.text.length;\n\n\t\tif (!inserted && offset >= pos && offset <= nodeEnd) {\n\t\t\tconst localOffset: number = offset - pos;\n\t\t\tconst before: string = node.text.slice(0, localOffset);\n\t\t\tconst after: string = node.text.slice(localOffset);\n\n\t\t\tif (before) result.push(createTextNode(before, node.marks));\n\t\t\tresult.push(inlineNode);\n\t\t\tif (after) result.push(createTextNode(after, node.marks));\n\t\t\tinserted = true;\n\t\t} else {\n\t\t\tresult.push(node);\n\t\t}\n\n\t\tpos = nodeEnd;\n\t}\n\n\tif (!inserted) {\n\t\tresult.push(inlineNode);\n\t}\n\n\treturn result;\n}\n\n/** Removes the InlineNode at the given offset from mixed inline content. */\nexport function removeInlineNodeAtOffset(\n\tnodes: readonly (TextNode | InlineNode)[],\n\toffset: number,\n): (TextNode | InlineNode)[] {\n\tconst result: (TextNode | InlineNode)[] = [];\n\tlet pos = 0;\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tif (pos !== offset) {\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tresult.push(node);\n\t\tpos += node.text.length;\n\t}\n\n\treturn result;\n}\n\n/** Replaces the attrs of an InlineNode at the given offset. */\nexport function setInlineNodeAttrsAtOffset(\n\tnodes: readonly (TextNode | InlineNode)[],\n\toffset: number,\n\tattrs: Readonly<Record<string, string | number | boolean>>,\n): (TextNode | InlineNode)[] {\n\tconst result: (TextNode | InlineNode)[] = [];\n\tlet pos = 0;\n\n\tfor (const node of nodes) {\n\t\tif (isInlineNode(node)) {\n\t\t\tif (pos === offset) {\n\t\t\t\tresult.push({ ...node, attrs });\n\t\t\t} else {\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t\tpos += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tresult.push(node);\n\t\tpos += node.text.length;\n\t}\n\n\treturn result;\n}\n\n/**\n * Replaces the inline content children of a ChildNode array,\n * preserving any BlockNode children in their original positions.\n */\nexport function replaceInlineChildren(\n\toriginal: readonly ChildNode[],\n\tnewInlineChildren: readonly (TextNode | InlineNode)[],\n): readonly ChildNode[] {\n\t// Fast path: if no block children exist, just return new inline nodes\n\tif (original.every((c) => isTextNode(c) || isInlineNode(c))) {\n\t\treturn newInlineChildren;\n\t}\n\t// Mixed: put inline nodes first, then block nodes (preserves structure)\n\tconst blockChildren: ChildNode[] = original.filter((c) => !isTextNode(c) && !isInlineNode(c));\n\treturn [...newInlineChildren, ...blockChildren];\n}\n","/**\n * Per-step apply functions: each transforms a Document by applying a single\n * Step of the matching type. Dispatch lives in `StepHandlers.ts`, which pairs\n * each function with its inverse counterpart in `StepInversion.ts`.\n */\n\nimport {\n\ttype BlockAttrs,\n\ttype BlockNode,\n\ttype ChildNode,\n\ttype Document,\n\ttype InlineNode,\n\ttype TextNode,\n\tcreateBlockNode,\n\tgetBlockLength,\n\tgetInlineChildren,\n\tisBlockNode,\n\tnormalizeInlineContent,\n} from '../model/Document.js';\nimport type { NodeTypeName } from '../model/TypeBrands.js';\nimport { findAndTransformChildren, mapBlock, mapNodeByPath } from './BlockTreeOps.js';\nimport {\n\tapplyMarkToInlineContent,\n\tdeleteFromInlineContent,\n\tinsertInlineNodeAtOffset,\n\tinsertSegmentsIntoInlineContent,\n\tinsertTextIntoInlineContent,\n\tremoveInlineNodeAtOffset,\n\treplaceInlineChildren,\n\tsetInlineNodeAttrsAtOffset,\n\tsliceInlineContent,\n} from './InlineContentOps.js';\nimport type {\n\tAddMarkStep,\n\tDeleteTextStep,\n\tInsertInlineNodeStep,\n\tInsertNodeStep,\n\tInsertTextStep,\n\tMergeBlocksStep,\n\tRemoveInlineNodeStep,\n\tRemoveMarkStep,\n\tRemoveNodeStep,\n\tSetBlockTypeStep,\n\tSetInlineNodeAttrStep,\n\tSetNodeAttrStep,\n\tSplitBlockStep,\n} from './Transaction.js';\n\nexport function applyInsertText(doc: Document, step: InsertTextStep): Document {\n\treturn mapBlockInlineContent(doc, step.blockId, (inline) =>\n\t\tstep.segments\n\t\t\t? insertSegmentsIntoInlineContent(inline, step.offset, step.segments)\n\t\t\t: insertTextIntoInlineContent(inline, step.offset, step.text, step.marks),\n\t);\n}\n\nexport function applyDeleteText(doc: Document, step: DeleteTextStep): Document {\n\treturn mapBlockInlineContent(doc, step.blockId, (inline) =>\n\t\tdeleteFromInlineContent(inline, step.from, step.to),\n\t);\n}\n\nexport function applySplitBlock(doc: Document, step: SplitBlockStep): Document {\n\tconst splitAtLevel = (children: readonly ChildNode[]): readonly ChildNode[] => {\n\t\tconst blockIndex: number = children.findIndex((c) => isBlockNode(c) && c.id === step.blockId);\n\t\tif (blockIndex === -1) return children;\n\n\t\tconst block: BlockNode = children[blockIndex] as BlockNode;\n\t\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\t\tconst len: number = getBlockLength(block);\n\t\tconst nodesBeforeSplit: (TextNode | InlineNode)[] = sliceInlineContent(\n\t\t\tinlineChildren,\n\t\t\t0,\n\t\t\tstep.offset,\n\t\t);\n\t\tconst nodesAfterSplit: (TextNode | InlineNode)[] = sliceInlineContent(\n\t\t\tinlineChildren,\n\t\t\tstep.offset,\n\t\t\tlen,\n\t\t);\n\n\t\tconst updatedBlock: BlockNode = {\n\t\t\t...block,\n\t\t\tchildren: normalizeInlineContent(nodesBeforeSplit),\n\t\t};\n\n\t\t// When the step carries overrides (typically produced by inverting a\n\t\t// cross-type merge), use the captured source identity verbatim so\n\t\t// undo restores the original block. An absent override means the new\n\t\t// block inherits the target block's type/attrs, matching the natural\n\t\t// outcome of a user-initiated split.\n\t\tconst hasOverride: boolean = step.newBlockType !== undefined;\n\t\tconst newType: NodeTypeName = step.newBlockType ?? block.type;\n\t\tconst newAttrs: BlockAttrs | undefined = hasOverride ? step.newBlockAttrs : block.attrs;\n\n\t\tconst newBlock: BlockNode = createBlockNode(\n\t\t\tnewType,\n\t\t\tnormalizeInlineContent(nodesAfterSplit),\n\t\t\tstep.newBlockId,\n\t\t\tnewAttrs,\n\t\t);\n\n\t\tconst result: ChildNode[] = [...children];\n\t\tresult.splice(blockIndex, 1, updatedBlock, newBlock);\n\t\treturn result;\n\t};\n\n\tconst hasTarget = (children: readonly ChildNode[]): boolean =>\n\t\tchildren.some((c) => isBlockNode(c) && c.id === step.blockId);\n\n\tconst transformed: readonly ChildNode[] | null = findAndTransformChildren(\n\t\tdoc.children,\n\t\thasTarget,\n\t\tsplitAtLevel,\n\t);\n\treturn transformed ? { children: transformed as BlockNode[] } : doc;\n}\n\nexport function applyMergeBlocks(doc: Document, step: MergeBlocksStep): Document {\n\tconst mergeAtLevel = (children: readonly ChildNode[]): readonly ChildNode[] => {\n\t\tconst targetIdx: number = children.findIndex(\n\t\t\t(c) => isBlockNode(c) && c.id === step.targetBlockId,\n\t\t);\n\t\tconst sourceIdx: number = children.findIndex(\n\t\t\t(c) => isBlockNode(c) && c.id === step.sourceBlockId,\n\t\t);\n\t\tif (targetIdx === -1 || sourceIdx === -1) return children;\n\n\t\tconst target: BlockNode = children[targetIdx] as BlockNode;\n\t\tconst source: BlockNode = children[sourceIdx] as BlockNode;\n\t\tconst targetInline: readonly (TextNode | InlineNode)[] = getInlineChildren(target);\n\t\tconst sourceInline: readonly (TextNode | InlineNode)[] = getInlineChildren(source);\n\t\tconst mergedChildren: readonly (TextNode | InlineNode)[] = normalizeInlineContent([\n\t\t\t...targetInline,\n\t\t\t...sourceInline,\n\t\t]);\n\t\tconst mergedBlock: BlockNode = { ...target, children: mergedChildren };\n\n\t\tconst filtered: ChildNode[] = children.filter(\n\t\t\t(c) => !isBlockNode(c) || c.id !== step.sourceBlockId,\n\t\t);\n\t\treturn filtered.map((c) => (isBlockNode(c) && c.id === step.targetBlockId ? mergedBlock : c));\n\t};\n\n\tconst hasTargetAndSource = (children: readonly ChildNode[]): boolean =>\n\t\tchildren.some((c) => isBlockNode(c) && c.id === step.targetBlockId) &&\n\t\tchildren.some((c) => isBlockNode(c) && c.id === step.sourceBlockId);\n\n\tconst transformed: readonly ChildNode[] | null = findAndTransformChildren(\n\t\tdoc.children,\n\t\thasTargetAndSource,\n\t\tmergeAtLevel,\n\t);\n\treturn transformed ? { children: transformed as BlockNode[] } : doc;\n}\n\nexport function applyAddMark(doc: Document, step: AddMarkStep): Document {\n\treturn mapBlockInlineContent(doc, step.blockId, (inline) =>\n\t\tapplyMarkToInlineContent(inline, step.from, step.to, step.mark, true),\n\t);\n}\n\nexport function applyRemoveMark(doc: Document, step: RemoveMarkStep): Document {\n\treturn mapBlockInlineContent(doc, step.blockId, (inline) =>\n\t\tapplyMarkToInlineContent(inline, step.from, step.to, step.mark, false),\n\t);\n}\n\n/**\n * Stored marks live on EditorState, not on the Document, so applying this\n * step at the document level is a no-op. The state-level update happens in\n * `EditorState.apply()`.\n */\nexport function applySetStoredMarks(doc: Document): Document {\n\treturn doc;\n}\n\n// --- InlineNode Step Application ---\n\nexport function applyInsertInlineNode(doc: Document, step: InsertInlineNodeStep): Document {\n\treturn mapBlockInlineContent(doc, step.blockId, (inline) =>\n\t\tinsertInlineNodeAtOffset(inline, step.offset, step.node),\n\t);\n}\n\nexport function applyRemoveInlineNode(doc: Document, step: RemoveInlineNodeStep): Document {\n\treturn mapBlockInlineContent(doc, step.blockId, (inline) =>\n\t\tremoveInlineNodeAtOffset(inline, step.offset),\n\t);\n}\n\nexport function applySetInlineNodeAttr(doc: Document, step: SetInlineNodeAttrStep): Document {\n\treturn mapBlockInlineContent(\n\t\tdoc,\n\t\tstep.blockId,\n\t\t(inline) => setInlineNodeAttrsAtOffset(inline, step.offset, step.attrs),\n\t\tfalse,\n\t);\n}\n\n/** Maps inline content of a block, optionally normalizing the result. */\nfunction mapBlockInlineContent(\n\tdoc: Document,\n\tblockId: string,\n\tfn: (inline: readonly (TextNode | InlineNode)[]) => (TextNode | InlineNode)[],\n\tnormalize = true,\n): Document {\n\treturn mapBlock(doc, blockId, (block) => {\n\t\tconst inlineChildren: readonly (TextNode | InlineNode)[] = getInlineChildren(block);\n\t\tconst newChildren: (TextNode | InlineNode)[] = fn(inlineChildren);\n\t\treturn {\n\t\t\t...block,\n\t\t\tchildren: replaceInlineChildren(\n\t\t\t\tblock.children,\n\t\t\t\tnormalize ? normalizeInlineContent(newChildren) : newChildren,\n\t\t\t),\n\t\t};\n\t});\n}\n\nexport function applySetBlockType(doc: Document, step: SetBlockTypeStep): Document {\n\treturn mapBlock(doc, step.blockId, (block) => {\n\t\tconst { attrs: _previousAttrs, ...rest } = block;\n\t\treturn {\n\t\t\t...rest,\n\t\t\ttype: step.nodeType,\n\t\t\t...(step.attrs ? { attrs: step.attrs } : {}),\n\t\t};\n\t});\n}\n\n// --- Structural Step Application ---\n\nexport function applyInsertNode(doc: Document, step: InsertNodeStep): Document {\n\tif (step.parentPath.length === 0) {\n\t\t// Insert at document root\n\t\tconst newChildren: BlockNode[] = [...doc.children];\n\t\tnewChildren.splice(step.index, 0, step.node);\n\t\treturn { children: newChildren };\n\t}\n\n\treturn mapNodeByPath(doc, step.parentPath, (parent) => {\n\t\tconst newChildren: ChildNode[] = [...parent.children];\n\t\tnewChildren.splice(step.index, 0, step.node);\n\t\treturn { ...parent, children: newChildren };\n\t});\n}\n\nexport function applyRemoveNode(doc: Document, step: RemoveNodeStep): Document {\n\tif (step.parentPath.length === 0) {\n\t\t// Remove from document root\n\t\tconst newChildren: BlockNode[] = [...doc.children];\n\t\tnewChildren.splice(step.index, 1);\n\t\treturn { children: newChildren };\n\t}\n\n\treturn mapNodeByPath(doc, step.parentPath, (parent) => {\n\t\tconst newChildren: ChildNode[] = [...parent.children];\n\t\tnewChildren.splice(step.index, 1);\n\t\treturn { ...parent, children: newChildren };\n\t});\n}\n\nexport function applySetNodeAttr(doc: Document, step: SetNodeAttrStep): Document {\n\tconst nodeId: string | undefined = step.path[step.path.length - 1];\n\tif (!nodeId) return doc;\n\n\treturn mapBlock(doc, nodeId, (block) => ({\n\t\t...block,\n\t\tattrs: step.attrs,\n\t}));\n}\n","/**\n * ContentSlice: an immutable fragment of document content for paste operations.\n * Represents \"what to insert\" independent of where it will be inserted.\n */\n\nimport type { BlockAttrs, ContentSegment } from './Document.js';\nimport { textSegment } from './Document.js';\nimport type { NodeTypeName } from './TypeBrands.js';\nimport { nodeType } from './TypeBrands.js';\n\nexport interface SliceBlock {\n\treadonly type: NodeTypeName;\n\treadonly attrs?: BlockAttrs;\n\t/** Inline content: text segments (with marks) and atomic inline nodes. */\n\treadonly segments: readonly ContentSegment[];\n}\n\nexport interface ContentSlice {\n\treadonly blocks: readonly SliceBlock[];\n}\n\n/** Returns the offset-space length of a block's segments (inline nodes count as 1). */\nexport function segmentsLength(segments: readonly ContentSegment[]): number {\n\treturn segments.reduce(\n\t\t(acc: number, s: ContentSegment) => acc + (s.kind === 'inline' ? 1 : s.text.length),\n\t\t0,\n\t);\n}\n\n/** Creates a content slice from plain text, one paragraph block per line. */\nexport function plainTextSlice(text: string): ContentSlice {\n\tconst lines: readonly string[] = text.split(/\\r?\\n/);\n\treturn {\n\t\tblocks: lines.map(\n\t\t\t(line: string): SliceBlock => ({\n\t\t\t\ttype: nodeType('paragraph'),\n\t\t\t\tsegments: [textSegment(line)],\n\t\t\t}),\n\t\t),\n\t};\n}\n","/**\n * Step type definitions for the transaction system.\n * Each step represents an atomic, invertible change to the document.\n */\n\nimport { segmentsLength } from '../model/ContentSlice.js';\nimport type { BlockAttrs, BlockNode, ContentSegment, InlineNode, Mark } from '../model/Document.js';\nimport type { BlockId, NodeTypeName } from '../model/TypeBrands.js';\n\nexport interface InsertTextStep {\n\treadonly type: 'insertText';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly text: string;\n\treadonly marks: readonly Mark[];\n\t/**\n\t * Optional per-segment payload (text with marks, or atomic inline nodes).\n\t * When present it supersedes `text`/`marks` on apply, so it must carry the\n\t * full content, including any inline nodes, for paste and delete-undo to\n\t * round-trip faithfully.\n\t */\n\treadonly segments?: readonly ContentSegment[];\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface DeleteTextStep {\n\treadonly type: 'deleteText';\n\treadonly blockId: BlockId;\n\treadonly from: number;\n\treadonly to: number;\n\treadonly deletedText: string;\n\treadonly deletedMarks: readonly Mark[];\n\t/** Full deleted content (text and inline nodes) so undo restores both. */\n\treadonly deletedSegments: readonly ContentSegment[];\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface SplitBlockStep {\n\treadonly type: 'splitBlock';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly newBlockId: BlockId;\n\t/**\n\t * Override for the new block's node type. When present, the new block is\n\t * created with this type instead of inheriting from the target. Populated\n\t * by {@link invertMergeBlocks} so undo can restore the original source\n\t * block's identity across cross-type merges.\n\t */\n\treadonly newBlockType?: NodeTypeName;\n\t/**\n\t * Override for the new block's attrs. Only consulted when\n\t * {@link newBlockType} is also present; the override pair is taken\n\t * as-is (an absent value here means \"the source block had no attrs\").\n\t */\n\treadonly newBlockAttrs?: BlockAttrs;\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface MergeBlocksStep {\n\treadonly type: 'mergeBlocks';\n\treadonly targetBlockId: BlockId;\n\treadonly sourceBlockId: BlockId;\n\treadonly targetLengthBefore: number;\n\t/**\n\t * Source block's node type at merge time. Captured by the builder so the\n\t * inverse split can restore the source block with its original identity.\n\t */\n\treadonly sourceType?: NodeTypeName;\n\t/** Source block's attrs at merge time, if any. */\n\treadonly sourceAttrs?: BlockAttrs;\n\treadonly path?: readonly BlockId[];\n}\n\n/**\n * Adds `mark` to every text node in `[from, to)`.\n *\n * **Builder invariant** (enforced by `TransactionBuilder.addMark`): the range\n * carries no text node with a mark of `mark.type`. Steps emitted under this\n * invariant invert exactly to a `RemoveMarkStep` over the same range, so undo\n * cannot strip pre-existing marks. Direct step construction (rare; e.g.\n * middleware) must uphold the same precondition.\n */\nexport interface AddMarkStep {\n\treadonly type: 'addMark';\n\treadonly blockId: BlockId;\n\treadonly from: number;\n\treadonly to: number;\n\treadonly mark: Mark;\n\treadonly path?: readonly BlockId[];\n}\n\n/**\n * Removes the mark of `mark.type` from every text node in `[from, to)`.\n *\n * **Builder invariant** (enforced by `TransactionBuilder.removeMark`): every\n * text node in the range carries exactly `mark` (deep equality, including\n * attrs). The `mark` field therefore stores the actual document mark, which\n * the symmetric inverse (`AddMarkStep`) re-adds verbatim, preserving attrs\n * through undo. Direct step construction must uphold the same precondition.\n */\nexport interface RemoveMarkStep {\n\treadonly type: 'removeMark';\n\treadonly blockId: BlockId;\n\treadonly from: number;\n\treadonly to: number;\n\treadonly mark: Mark;\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface SetStoredMarksStep {\n\treadonly type: 'setStoredMarks';\n\treadonly marks: readonly Mark[] | null;\n\treadonly previousMarks: readonly Mark[] | null;\n}\n\nexport interface SetBlockTypeStep {\n\treadonly type: 'setBlockType';\n\treadonly blockId: BlockId;\n\treadonly nodeType: NodeTypeName;\n\treadonly attrs?: BlockAttrs;\n\treadonly previousNodeType: NodeTypeName;\n\treadonly previousAttrs?: BlockAttrs;\n\treadonly path?: readonly BlockId[];\n}\n\n// --- Structural Steps (for nested documents) ---\n\nexport interface InsertNodeStep {\n\treadonly type: 'insertNode';\n\treadonly parentPath: readonly BlockId[];\n\treadonly index: number;\n\treadonly node: BlockNode;\n}\n\nexport interface RemoveNodeStep {\n\treadonly type: 'removeNode';\n\treadonly parentPath: readonly BlockId[];\n\treadonly index: number;\n\treadonly removedNode: BlockNode;\n}\n\nexport interface SetNodeAttrStep {\n\treadonly type: 'setNodeAttr';\n\treadonly path: readonly BlockId[];\n\treadonly attrs: BlockAttrs | undefined;\n\treadonly previousAttrs?: BlockAttrs;\n}\n\n// --- InlineNode Steps ---\n\nexport interface InsertInlineNodeStep {\n\treadonly type: 'insertInlineNode';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly node: InlineNode;\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface RemoveInlineNodeStep {\n\treadonly type: 'removeInlineNode';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly removedNode: InlineNode;\n\treadonly path?: readonly BlockId[];\n}\n\nexport interface SetInlineNodeAttrStep {\n\treadonly type: 'setInlineNodeAttr';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly attrs: Readonly<Record<string, string | number | boolean>>;\n\treadonly previousAttrs: Readonly<Record<string, string | number | boolean>>;\n\treadonly path?: readonly BlockId[];\n}\n\nexport type Step =\n\t| InsertTextStep\n\t| DeleteTextStep\n\t| SplitBlockStep\n\t| MergeBlocksStep\n\t| AddMarkStep\n\t| RemoveMarkStep\n\t| SetStoredMarksStep\n\t| SetBlockTypeStep\n\t| InsertNodeStep\n\t| RemoveNodeStep\n\t| SetNodeAttrStep\n\t| InsertInlineNodeStep\n\t| RemoveInlineNodeStep\n\t| SetInlineNodeAttrStep;\n\nexport type TransactionOrigin = 'input' | 'paste' | 'command' | 'history' | 'api';\n\n/**\n * Block-space width an {@link InsertTextStep} occupies once applied. When the\n * step carries `segments` (which may include inline nodes, each width 1), the\n * width is the segment span, not the plain-text length, because `applyInsertText`\n * inserts the segments verbatim. The inverse delete range ({@link invertInsertText})\n * and the forward position map ({@link getMapInsertText}) must both use this so\n * undo/redo of a deletion that removed inline content round-trips without\n * corrupting positions.\n */\nexport function insertTextStepWidth(step: InsertTextStep): number {\n\treturn step.segments ? segmentsLength(step.segments) : step.text.length;\n}\n","/**\n * Per-step invert functions: each returns the inverse of a single step\n * for undo/redo support. Dispatch and transaction-level inversion live in\n * `StepHandlers.ts`, which pairs each function with its forward counterpart\n * in `StepApplication.ts`.\n */\n\nimport type { Mark } from '../model/Document.js';\nimport { textSegment } from '../model/Document.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport { insertTextStepWidth } from './Steps.js';\nimport type {\n\tAddMarkStep,\n\tDeleteTextStep,\n\tInsertInlineNodeStep,\n\tInsertNodeStep,\n\tInsertTextStep,\n\tMergeBlocksStep,\n\tRemoveInlineNodeStep,\n\tRemoveMarkStep,\n\tRemoveNodeStep,\n\tSetBlockTypeStep,\n\tSetInlineNodeAttrStep,\n\tSetNodeAttrStep,\n\tSetStoredMarksStep,\n\tSplitBlockStep,\n\tStep,\n} from './Steps.js';\nimport type { Transaction } from './Transaction.js';\n\n/** Returns a path spread object if the step has a path, or empty object otherwise. */\nfunction optionalPath(step: { readonly path?: readonly BlockId[] }):\n\t| { readonly path: readonly BlockId[] }\n\t| Record<string, never> {\n\treturn step.path ? { path: step.path } : {};\n}\n\nexport function invertInsertText(step: InsertTextStep): Step {\n\treturn {\n\t\ttype: 'deleteText',\n\t\tblockId: step.blockId,\n\t\tfrom: step.offset,\n\t\tto: step.offset + insertTextStepWidth(step),\n\t\tdeletedText: step.text,\n\t\tdeletedMarks: step.marks,\n\t\tdeletedSegments: step.segments ?? [textSegment(step.text, [...step.marks])],\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertDeleteText(step: DeleteTextStep): Step {\n\treturn {\n\t\ttype: 'insertText',\n\t\tblockId: step.blockId,\n\t\toffset: step.from,\n\t\ttext: step.deletedText,\n\t\tmarks: step.deletedMarks,\n\t\tsegments: step.deletedSegments,\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertSplitBlock(step: SplitBlockStep): Step {\n\treturn {\n\t\ttype: 'mergeBlocks',\n\t\ttargetBlockId: step.blockId,\n\t\tsourceBlockId: step.newBlockId,\n\t\ttargetLengthBefore: step.offset,\n\t\t...(step.newBlockType !== undefined ? { sourceType: step.newBlockType } : {}),\n\t\t...(step.newBlockAttrs ? { sourceAttrs: step.newBlockAttrs } : {}),\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertMergeBlocks(step: MergeBlocksStep): Step {\n\treturn {\n\t\ttype: 'splitBlock',\n\t\tblockId: step.targetBlockId,\n\t\toffset: step.targetLengthBefore,\n\t\tnewBlockId: step.sourceBlockId,\n\t\t...(step.sourceType !== undefined ? { newBlockType: step.sourceType } : {}),\n\t\t...(step.sourceAttrs ? { newBlockAttrs: step.sourceAttrs } : {}),\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertAddMark(step: AddMarkStep): Step {\n\treturn {\n\t\ttype: 'removeMark',\n\t\tblockId: step.blockId,\n\t\tfrom: step.from,\n\t\tto: step.to,\n\t\tmark: step.mark,\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertRemoveMark(step: RemoveMarkStep): Step {\n\treturn {\n\t\ttype: 'addMark',\n\t\tblockId: step.blockId,\n\t\tfrom: step.from,\n\t\tto: step.to,\n\t\tmark: step.mark,\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertSetStoredMarks(step: SetStoredMarksStep): Step {\n\treturn {\n\t\ttype: 'setStoredMarks',\n\t\tmarks: step.previousMarks,\n\t\tpreviousMarks: step.marks,\n\t};\n}\n\nexport function invertSetBlockType(step: SetBlockTypeStep): Step {\n\treturn {\n\t\ttype: 'setBlockType',\n\t\tblockId: step.blockId,\n\t\tnodeType: step.previousNodeType,\n\t\tattrs: step.previousAttrs,\n\t\tpreviousNodeType: step.nodeType,\n\t\tpreviousAttrs: step.attrs,\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertInsertNode(step: InsertNodeStep): Step {\n\treturn {\n\t\ttype: 'removeNode',\n\t\tparentPath: step.parentPath,\n\t\tindex: step.index,\n\t\tremovedNode: step.node,\n\t};\n}\n\nexport function invertRemoveNode(step: RemoveNodeStep): Step {\n\treturn {\n\t\ttype: 'insertNode',\n\t\tparentPath: step.parentPath,\n\t\tindex: step.index,\n\t\tnode: step.removedNode,\n\t};\n}\n\nexport function invertSetNodeAttr(step: SetNodeAttrStep): Step {\n\treturn {\n\t\ttype: 'setNodeAttr',\n\t\tpath: step.path,\n\t\tattrs: step.previousAttrs,\n\t\tpreviousAttrs: step.attrs,\n\t};\n}\n\nexport function invertInsertInlineNode(step: InsertInlineNodeStep): Step {\n\treturn {\n\t\ttype: 'removeInlineNode',\n\t\tblockId: step.blockId,\n\t\toffset: step.offset,\n\t\tremovedNode: step.node,\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertRemoveInlineNode(step: RemoveInlineNodeStep): Step {\n\treturn {\n\t\ttype: 'insertInlineNode',\n\t\tblockId: step.blockId,\n\t\toffset: step.offset,\n\t\tnode: step.removedNode,\n\t\t...optionalPath(step),\n\t};\n}\n\nexport function invertSetInlineNodeAttr(step: SetInlineNodeAttrStep): Step {\n\treturn {\n\t\ttype: 'setInlineNodeAttr',\n\t\tblockId: step.blockId,\n\t\toffset: step.offset,\n\t\tattrs: step.previousAttrs,\n\t\tpreviousAttrs: step.attrs,\n\t\t...optionalPath(step),\n\t};\n}\n\n/**\n * Walks the transaction's steps to find the storedMarks value that was\n * active before the transaction ran, falling back to the post-state if\n * no `setStoredMarks` step was recorded.\n */\nexport function deriveStoredMarksBefore(tr: Transaction): readonly Mark[] | null {\n\tfor (const step of tr.steps) {\n\t\tif (step.type === 'setStoredMarks') {\n\t\t\treturn step.previousMarks;\n\t\t}\n\t}\n\treturn tr.storedMarksAfter;\n}\n","/**\n * Per-step rebase functions: each takes a {@link Step}, a {@link Mapping}\n * that describes intervening changes in position space, and the current\n * document state, and returns either the rebased step or `null` when the\n * step can no longer be applied meaningfully.\n *\n * This is the symmetric counterpart to {@link getStepMap} / {@link applyStep}\n * / {@link invertStep}: where `getStepMap` answers \"how do positions shift\n * **through** this step\", these `mapXxx` functions answer \"how do this\n * step's *inputs* shift through *another* mapping\". The pair is what makes\n * undo/redo robust under out-of-band intervening edits, and the same\n * primitive is the foundation any future collaborative-editing layer needs.\n *\n * ## `null`-semantics\n *\n * A `null` return is not an error — it means the step's referenced\n * coordinates no longer address live content in the current frame. Callers\n * (e.g. {@link HistoryManager.undo}) treat this as \"abandon the whole\n * undo/redo group\", because applying a partial rebase would silently\n * corrupt the document.\n *\n * Conditions that produce `null`:\n *\n * - the host block was removed by an intervening edit;\n * - a single-offset step's offset fell inside removed/replaced content;\n * - a range step's range was fully eaten;\n * - a range step's endpoints landed in different blocks (fragmented);\n * - for structural steps, an ancestor in `parentPath` was removed or\n * migrated to a new block identity.\n *\n * Dispatch is via the {@link StepHandlerRegistry} so adding a new `Step`\n * variant fails to type-check until its `map` is registered.\n */\n\nimport type { BlockNode, Document, InlineNode } from '../model/Document.js';\nimport {\n\tgetBlockContentSegmentsInRange,\n\tgetBlockLength,\n\tgetBlockMarksAtOffset,\n\tgetBlockText,\n\tgetContentAtOffset,\n\tisInlineNode,\n} from '../model/Document.js';\nimport { findNode, resolveChildAt, resolveNodeByPath } from '../model/NodeResolver.js';\nimport type { BlockId } from '../model/TypeBrands.js';\nimport {\n\ttype MappedInBlockRange,\n\ttype Mapping,\n\tmapChildIndex,\n\tmapInBlockRange,\n\tmapInsertionIndex,\n\tmapOffsetInBlock,\n} from './Mapping.js';\nimport type {\n\tAddMarkStep,\n\tDeleteTextStep,\n\tInsertInlineNodeStep,\n\tInsertNodeStep,\n\tInsertTextStep,\n\tMergeBlocksStep,\n\tRemoveInlineNodeStep,\n\tRemoveMarkStep,\n\tRemoveNodeStep,\n\tSetBlockTypeStep,\n\tSetInlineNodeAttrStep,\n\tSetNodeAttrStep,\n\tSetStoredMarksStep,\n\tSplitBlockStep,\n\tStep,\n} from './Steps.js';\n\n// --- Helpers ---\n\n/**\n * Spreads `path` onto a rebased step only when the block identity did not\n * change. A migrated block likely sits at a different parent path, so\n * carrying the stale hint would mislead the applyStep fast-path lookup;\n * dropping it falls back to a global block-id search.\n */\nfunction preservedPath(\n\toriginalBlockId: BlockId,\n\tnewBlockId: BlockId,\n\tpath: readonly BlockId[] | undefined,\n): { readonly path: readonly BlockId[] } | Record<string, never> {\n\tif (!path) return {};\n\tif (originalBlockId !== newBlockId) return {};\n\treturn { path };\n}\n\n/**\n * Validates that every block id along `parentPath` still exists and has\n * not migrated. The `parentPath` itself is **never** rebased through\n * `childIndexShift` / `blockRemoval` (those describe shifts in *child\n * slots*, not in block identity), so when any ancestor block is gone the\n * structural anchor is lost and the step must be abandoned.\n */\nfunction parentPathStillValid(parentPath: readonly BlockId[], mapping: Mapping): boolean {\n\tif (mapping.isEmpty) return true;\n\tfor (const id of parentPath) {\n\t\tconst result = mapping.mapResult({ blockId: id, offset: 0 }, -1);\n\t\tif (result.deleted) return false;\n\t\tif (result.pos.blockId !== id) return false;\n\t}\n\treturn true;\n}\n\n/**\n * Returns whether a rebased range is identical to the original range —\n * letting callers return the input step unchanged to preserve reference\n * equality (cheap downstream change-detection short-circuit).\n */\nfunction isRangeUnchanged(\n\toriginal: { readonly blockId: BlockId; readonly from: number; readonly to: number },\n\tmapped: MappedInBlockRange,\n): boolean {\n\treturn (\n\t\tmapped.blockId === original.blockId &&\n\t\tmapped.from === original.from &&\n\t\tmapped.to === original.to\n\t);\n}\n\n// --- Content-shifting steps ---\n\nexport function mapInsertText(step: InsertTextStep, mapping: Mapping, _doc: Document): Step | null {\n\tconst mapped = mapOffsetInBlock(step.blockId, step.offset, mapping, -1);\n\tif (!mapped) return null;\n\tif (mapped.blockId === step.blockId && mapped.from === step.offset) return step;\n\treturn {\n\t\ttype: 'insertText',\n\t\tblockId: mapped.blockId,\n\t\toffset: mapped.from,\n\t\ttext: step.text,\n\t\tmarks: step.marks,\n\t\t...(step.segments ? { segments: step.segments } : {}),\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\nexport function mapDeleteText(step: DeleteTextStep, mapping: Mapping, doc: Document): Step | null {\n\tconst mapped = mapInBlockRange(step.blockId, step.from, step.to, mapping);\n\tif (!mapped) return null;\n\tif (isRangeUnchanged({ blockId: step.blockId, from: step.from, to: step.to }, mapped)) {\n\t\treturn step;\n\t}\n\n\t// Re-snapshot the content payload from the current doc — the original\n\t// `deletedText` / `deletedSegments` / `deletedMarks` describe content that\n\t// no longer sits at the rebased range. Without the refresh, redoing this\n\t// undo would produce a step whose inverse reinserts the wrong content.\n\tconst block = findNode(doc, mapped.blockId);\n\tif (!block) return null;\n\tconst deletedText = getBlockText(block).slice(mapped.from, mapped.to);\n\tconst deletedMarks = getBlockMarksAtOffset(block, mapped.from);\n\tconst deletedSegments = getBlockContentSegmentsInRange(block, mapped.from, mapped.to);\n\n\treturn {\n\t\ttype: 'deleteText',\n\t\tblockId: mapped.blockId,\n\t\tfrom: mapped.from,\n\t\tto: mapped.to,\n\t\tdeletedText,\n\t\tdeletedMarks,\n\t\tdeletedSegments,\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\nexport function mapInsertInlineNode(\n\tstep: InsertInlineNodeStep,\n\tmapping: Mapping,\n\t_doc: Document,\n): Step | null {\n\tconst mapped = mapOffsetInBlock(step.blockId, step.offset, mapping, -1);\n\tif (!mapped) return null;\n\tif (mapped.blockId === step.blockId && mapped.from === step.offset) return step;\n\treturn {\n\t\ttype: 'insertInlineNode',\n\t\tblockId: mapped.blockId,\n\t\toffset: mapped.from,\n\t\tnode: step.node,\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\nexport function mapRemoveInlineNode(\n\tstep: RemoveInlineNodeStep,\n\tmapping: Mapping,\n\tdoc: Document,\n): Step | null {\n\t// Inline nodes occupy [offset, offset+1) atomically. Treating the position\n\t// as a width-1 range with sticky-right `from` is what keeps the rebased\n\t// offset pointing at the SAME slot even when intervening edits inserted\n\t// content immediately before it.\n\tconst mapped = mapInBlockRange(step.blockId, step.offset, step.offset + 1, mapping, 1, 1);\n\tif (!mapped) return null;\n\tif (mapped.to - mapped.from !== 1) return null;\n\n\t// Verify the inline at the rebased slot is still the one the user wanted\n\t// to remove. The position mapping does not track inline identity, so an\n\t// intervening `removeInlineNode` + `insertInlineNode` pair at the same\n\t// offset would shift the position by zero net while replacing the\n\t// content. Removing the substitute would corrupt the agent's edit; abandon\n\t// the group instead.\n\tconst block = findNode(doc, mapped.blockId);\n\tif (!block) return null;\n\tconst content = getContentAtOffset(block, mapped.from);\n\tif (!content || content.kind !== 'inline' || !isInlineNode(content.node)) return null;\n\tif (!inlineNodesEqual(step.removedNode, content.node)) return null;\n\n\tif (mapped.blockId === step.blockId && mapped.from === step.offset) return step;\n\treturn {\n\t\ttype: 'removeInlineNode',\n\t\tblockId: mapped.blockId,\n\t\toffset: mapped.from,\n\t\tremovedNode: content.node,\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\n// --- Structural block steps ---\n\nexport function mapSplitBlock(step: SplitBlockStep, mapping: Mapping, _doc: Document): Step | null {\n\tconst mapped = mapOffsetInBlock(step.blockId, step.offset, mapping, -1);\n\tif (!mapped) return null;\n\tif (mapped.blockId === step.blockId && mapped.from === step.offset) return step;\n\treturn {\n\t\ttype: 'splitBlock',\n\t\tblockId: mapped.blockId,\n\t\toffset: mapped.from,\n\t\tnewBlockId: step.newBlockId,\n\t\t...(step.newBlockType !== undefined ? { newBlockType: step.newBlockType } : {}),\n\t\t...(step.newBlockAttrs ? { newBlockAttrs: step.newBlockAttrs } : {}),\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\nexport function mapMergeBlocks(\n\tstep: MergeBlocksStep,\n\tmapping: Mapping,\n\tdoc: Document,\n): Step | null {\n\tif (mapping.isEmpty) return step;\n\n\t// Both blocks must remain addressable as distinct entities.\n\tconst targetProbe = mapping.mapResult({ blockId: step.targetBlockId, offset: 0 }, -1);\n\tconst sourceProbe = mapping.mapResult({ blockId: step.sourceBlockId, offset: 0 }, -1);\n\tif (targetProbe.deleted || sourceProbe.deleted) return null;\n\tconst newTargetId = targetProbe.pos.blockId;\n\tconst newSourceId = sourceProbe.pos.blockId;\n\tif (newTargetId === newSourceId) return null;\n\n\t// Recompute targetLengthBefore from current doc — intervening edits inside\n\t// the target block changed its length, and applyMergeBlocks doesn't use\n\t// this field (it merges by ID), but the inverse split step does, and a\n\t// stale length would split at the wrong offset on redo.\n\tconst target = findNode(doc, newTargetId);\n\tif (!target) return null;\n\tconst targetLengthBefore = getBlockLength(target);\n\n\tif (\n\t\tnewTargetId === step.targetBlockId &&\n\t\tnewSourceId === step.sourceBlockId &&\n\t\ttargetLengthBefore === step.targetLengthBefore\n\t) {\n\t\treturn step;\n\t}\n\n\treturn {\n\t\ttype: 'mergeBlocks',\n\t\ttargetBlockId: newTargetId,\n\t\tsourceBlockId: newSourceId,\n\t\ttargetLengthBefore,\n\t\t...(step.sourceType !== undefined ? { sourceType: step.sourceType } : {}),\n\t\t...(step.sourceAttrs ? { sourceAttrs: step.sourceAttrs } : {}),\n\t\t...preservedPath(step.targetBlockId, newTargetId, step.path),\n\t};\n}\n\n// --- Mark steps ---\n\nexport function mapAddMark(step: AddMarkStep, mapping: Mapping, _doc: Document): Step | null {\n\tconst mapped = mapInBlockRange(step.blockId, step.from, step.to, mapping);\n\tif (!mapped) return null;\n\tif (isRangeUnchanged({ blockId: step.blockId, from: step.from, to: step.to }, mapped)) {\n\t\treturn step;\n\t}\n\treturn {\n\t\ttype: 'addMark',\n\t\tblockId: mapped.blockId,\n\t\tfrom: mapped.from,\n\t\tto: mapped.to,\n\t\tmark: step.mark,\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\nexport function mapRemoveMark(step: RemoveMarkStep, mapping: Mapping, _doc: Document): Step | null {\n\tconst mapped = mapInBlockRange(step.blockId, step.from, step.to, mapping);\n\tif (!mapped) return null;\n\tif (isRangeUnchanged({ blockId: step.blockId, from: step.from, to: step.to }, mapped)) {\n\t\treturn step;\n\t}\n\treturn {\n\t\ttype: 'removeMark',\n\t\tblockId: mapped.blockId,\n\t\tfrom: mapped.from,\n\t\tto: mapped.to,\n\t\tmark: step.mark,\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\n// --- Identity / attribute steps ---\n\nexport function mapSetStoredMarks(\n\tstep: SetStoredMarksStep,\n\t_mapping: Mapping,\n\t_doc: Document,\n): Step | null {\n\t// State-level only, no document coordinates to rebase.\n\treturn step;\n}\n\nexport function mapSetBlockType(\n\tstep: SetBlockTypeStep,\n\tmapping: Mapping,\n\tdoc: Document,\n): Step | null {\n\tif (mapping.isEmpty) return step;\n\tconst probe = mapping.mapResult({ blockId: step.blockId, offset: 0 }, -1);\n\tif (probe.deleted) return null;\n\tconst newBlockId = probe.pos.blockId;\n\n\t// Re-snapshot the previous type / attrs from the current doc so the inverse\n\t// step restores what was actually there post-intervening, not what was there\n\t// when the original step was emitted.\n\tconst block: BlockNode | undefined = findNode(doc, newBlockId);\n\tif (!block) return null;\n\n\tif (\n\t\tnewBlockId === step.blockId &&\n\t\tblock.type === step.previousNodeType &&\n\t\tblockAttrsEqual(block.attrs, step.previousAttrs)\n\t) {\n\t\treturn step;\n\t}\n\n\treturn {\n\t\ttype: 'setBlockType',\n\t\tblockId: newBlockId,\n\t\tnodeType: step.nodeType,\n\t\t...(step.attrs ? { attrs: step.attrs } : {}),\n\t\tpreviousNodeType: block.type,\n\t\t...(block.attrs ? { previousAttrs: block.attrs } : {}),\n\t\t...preservedPath(step.blockId, newBlockId, step.path),\n\t};\n}\n\nexport function mapSetNodeAttr(\n\tstep: SetNodeAttrStep,\n\tmapping: Mapping,\n\tdoc: Document,\n): Step | null {\n\tif (mapping.isEmpty) return step;\n\tif (!parentPathStillValid(step.path, mapping)) return null;\n\tconst node = resolveNodeByPath(doc, step.path);\n\tif (!node) return null;\n\treturn {\n\t\ttype: 'setNodeAttr',\n\t\tpath: step.path,\n\t\tattrs: step.attrs,\n\t\t...(node.attrs ? { previousAttrs: node.attrs } : {}),\n\t};\n}\n\nexport function mapSetInlineNodeAttr(\n\tstep: SetInlineNodeAttrStep,\n\tmapping: Mapping,\n\tdoc: Document,\n): Step | null {\n\tconst mapped = mapInBlockRange(step.blockId, step.offset, step.offset + 1, mapping, 1, 1);\n\tif (!mapped) return null;\n\tif (mapped.to - mapped.from !== 1) return null;\n\tif (mapped.blockId === step.blockId && mapped.from === step.offset) {\n\t\treturn step;\n\t}\n\n\tconst block = findNode(doc, mapped.blockId);\n\tif (!block) return null;\n\tconst content = getContentAtOffset(block, mapped.from);\n\tif (!content || content.kind !== 'inline' || !isInlineNode(content.node)) return null;\n\treturn {\n\t\ttype: 'setInlineNodeAttr',\n\t\tblockId: mapped.blockId,\n\t\toffset: mapped.from,\n\t\tattrs: step.attrs,\n\t\tpreviousAttrs: content.node.attrs,\n\t\t...preservedPath(step.blockId, mapped.blockId, step.path),\n\t};\n}\n\n// --- Tree-structural steps ---\n\nexport function mapInsertNode(step: InsertNodeStep, mapping: Mapping, _doc: Document): Step | null {\n\tif (!parentPathStillValid(step.parentPath, mapping)) return null;\n\t// Insertion-slot semantics: the slot survives even when the block\n\t// previously at this index was removed by an intervening edit. The slot\n\t// is *where to insert*, not a reference to an existing child.\n\tconst rebasedIndex: number = mapInsertionIndex(step.parentPath, step.index, mapping);\n\tif (rebasedIndex === step.index) return step;\n\treturn {\n\t\ttype: 'insertNode',\n\t\tparentPath: step.parentPath,\n\t\tindex: rebasedIndex,\n\t\tnode: step.node,\n\t};\n}\n\nexport function mapRemoveNode(step: RemoveNodeStep, mapping: Mapping, doc: Document): Step | null {\n\tif (!parentPathStillValid(step.parentPath, mapping)) return null;\n\t// The to-be-removed block itself must still exist as a distinct block.\n\tconst probe = mapping.mapResult({ blockId: step.removedNode.id, offset: 0 }, -1);\n\tif (probe.deleted) return null;\n\tif (probe.pos.blockId !== step.removedNode.id) return null;\n\n\tconst rebasedIndex: number | null = mapChildIndex(step.parentPath, step.index, mapping);\n\t// `null` means an intervening edit already removed the exact slot this\n\t// step targets; the inverse cannot meaningfully proceed.\n\tif (rebasedIndex === null) return null;\n\n\t// Re-snapshot the removed subtree from the current doc — intervening edits\n\t// may have modified the block's content (text inserted, marks toggled,\n\t// child blocks added) after the original step was recorded. Without the\n\t// refresh, the rebased step's inverse `insertNode` would restore the stale\n\t// payload and silently lose those edits on a subsequent undo. Same class\n\t// of bug as the inline identity check in {@link mapRemoveInlineNode}.\n\tconst block = resolveChildAt(doc, step.parentPath, rebasedIndex);\n\tif (!block) return null;\n\t// Defensive structural-integrity check: the rebased index must point at\n\t// the block we expect. A mismatch indicates either a mapping inconsistency\n\t// or that the slot is now occupied by a different block — either way we\n\t// must not remove an unrelated subtree.\n\tif (block.id !== step.removedNode.id) return null;\n\n\tif (rebasedIndex === step.index && block === step.removedNode) return step;\n\treturn {\n\t\ttype: 'removeNode',\n\t\tparentPath: step.parentPath,\n\t\tindex: rebasedIndex,\n\t\tremovedNode: block,\n\t};\n}\n\n// --- Local utilities ---\n\nfunction blockAttrsEqual(\n\ta: Readonly<Record<string, unknown>> | undefined,\n\tb: Readonly<Record<string, unknown>> | undefined,\n): boolean {\n\tif (a === b) return true;\n\tif (!a || !b) return false;\n\tconst aKeys = Object.keys(a);\n\tconst bKeys = Object.keys(b);\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (const k of aKeys) {\n\t\tif (a[k] !== b[k]) return false;\n\t}\n\treturn true;\n}\n\nfunction inlineNodesEqual(a: InlineNode, b: InlineNode): boolean {\n\tif (a === b) return true;\n\tif (a.inlineType !== b.inlineType) return false;\n\treturn blockAttrsEqual(a.attrs, b.attrs);\n}\n","/**\n * Per-step {@link StepMap} producers. Each function consumes the step plus\n * the document state **before** the step is applied (when needed) and\n * returns the StepMap that describes the position-space change.\n *\n * Dispatch is performed by `StepHandlers.ts` through the\n * `StepHandlerRegistry`, which co-locates `apply`, `invert`, and `getMap`\n * so adding a new step type is a single registry edit.\n */\n\nimport type { Document } from '../model/Document.js';\nimport {\n\ttype BlockRemovalMap,\n\ttype ChildIndexShiftMap,\n\tIDENTITY_MAP,\n\ttype MergeMap,\n\ttype ShiftMap,\n\ttype SplitMap,\n\ttype StepMap,\n\tcollectRemovedBlockIds,\n} from './Mapping.js';\nimport { insertTextStepWidth } from './Steps.js';\nimport type {\n\tAddMarkStep,\n\tDeleteTextStep,\n\tInsertInlineNodeStep,\n\tInsertNodeStep,\n\tInsertTextStep,\n\tMergeBlocksStep,\n\tRemoveInlineNodeStep,\n\tRemoveMarkStep,\n\tRemoveNodeStep,\n\tSetBlockTypeStep,\n\tSetInlineNodeAttrStep,\n\tSetNodeAttrStep,\n\tSetStoredMarksStep,\n\tSplitBlockStep,\n} from './Steps.js';\n\n// --- Content-shifting steps ---\n\nexport function getMapInsertText(_doc: Document, step: InsertTextStep): ShiftMap {\n\treturn {\n\t\ttype: 'shift',\n\t\tblockId: step.blockId,\n\t\tfrom: step.offset,\n\t\tto: step.offset,\n\t\tnewLen: insertTextStepWidth(step),\n\t};\n}\n\nexport function getMapDeleteText(_doc: Document, step: DeleteTextStep): ShiftMap {\n\treturn {\n\t\ttype: 'shift',\n\t\tblockId: step.blockId,\n\t\tfrom: step.from,\n\t\tto: step.to,\n\t\tnewLen: 0,\n\t};\n}\n\nexport function getMapInsertInlineNode(_doc: Document, step: InsertInlineNodeStep): ShiftMap {\n\treturn {\n\t\ttype: 'shift',\n\t\tblockId: step.blockId,\n\t\tfrom: step.offset,\n\t\tto: step.offset,\n\t\tnewLen: 1,\n\t};\n}\n\nexport function getMapRemoveInlineNode(_doc: Document, step: RemoveInlineNodeStep): ShiftMap {\n\treturn {\n\t\ttype: 'shift',\n\t\tblockId: step.blockId,\n\t\tfrom: step.offset,\n\t\tto: step.offset + 1,\n\t\tnewLen: 0,\n\t};\n}\n\n// --- Structural steps ---\n\nexport function getMapSplitBlock(_doc: Document, step: SplitBlockStep): SplitMap {\n\treturn {\n\t\ttype: 'split',\n\t\tblockId: step.blockId,\n\t\toffset: step.offset,\n\t\tnewBlockId: step.newBlockId,\n\t};\n}\n\nexport function getMapMergeBlocks(_doc: Document, step: MergeBlocksStep): MergeMap {\n\treturn {\n\t\ttype: 'merge',\n\t\ttargetBlockId: step.targetBlockId,\n\t\tsourceBlockId: step.sourceBlockId,\n\t\ttargetLengthBefore: step.targetLengthBefore,\n\t};\n}\n\nexport function getMapRemoveNode(_doc: Document, step: RemoveNodeStep): BlockRemovalMap {\n\treturn {\n\t\ttype: 'blockRemoval',\n\t\tremovedBlockIds: collectRemovedBlockIds(step.removedNode),\n\t\tparentPath: step.parentPath,\n\t\tindex: step.index,\n\t};\n}\n\n// --- Structural sibling shifts ---\n\n/**\n * Inserting a block at `step.index` in `step.parentPath`'s child list does\n * not move any position in `{blockId, offset}` space, but it shifts every\n * sibling index `≥ step.index` up by 1. {@link mapChildIndex} consumes this\n * to rebase later `insertNode` / `removeNode` steps that target the same\n * parent.\n */\nexport function getMapInsertNode(_doc: Document, step: InsertNodeStep): ChildIndexShiftMap {\n\treturn {\n\t\ttype: 'childIndexShift',\n\t\tparentPath: step.parentPath,\n\t\tfromIndex: step.index,\n\t\tdelta: 1,\n\t};\n}\n\n// --- Identity steps (positions unchanged) ---\n//\n// The following step types do not move offsets or child indices:\n// - addMark / removeMark: annotation only\n// - setStoredMarks: state-only\n// - setBlockType: type/attrs change, children unchanged\n// - setNodeAttr / setInlineNodeAttr: attribute-only\n\nexport function getMapAddMark(_doc: Document, _step: AddMarkStep): StepMap {\n\treturn IDENTITY_MAP;\n}\n\nexport function getMapRemoveMark(_doc: Document, _step: RemoveMarkStep): StepMap {\n\treturn IDENTITY_MAP;\n}\n\nexport function getMapSetStoredMarks(_doc: Document, _step: SetStoredMarksStep): StepMap {\n\treturn IDENTITY_MAP;\n}\n\nexport function getMapSetBlockType(_doc: Document, _step: SetBlockTypeStep): StepMap {\n\treturn IDENTITY_MAP;\n}\n\nexport function getMapSetNodeAttr(_doc: Document, _step: SetNodeAttrStep): StepMap {\n\treturn IDENTITY_MAP;\n}\n\nexport function getMapSetInlineNodeAttr(_doc: Document, _step: SetInlineNodeAttrStep): StepMap {\n\treturn IDENTITY_MAP;\n}\n","/**\n * Single source of truth that pairs each `Step` discriminator with the\n * functions that apply, invert, and map it. The registry's mapped type\n * makes exhaustiveness a compile-time guarantee: introducing a new member\n * of the `Step` union without registering a handler is a type error here.\n *\n * Public dispatch (`applyStep`, `invertStep`, `getStepMap`,\n * `invertTransaction`) lives in this module; per-step logic lives in\n * `StepApplication.ts`, `StepInversion.ts`, and `StepMaps.ts`.\n */\n\nimport type { Document } from '../model/Document.js';\nimport { IDENTITY_MAP, Mapping, type StepMap } from './Mapping.js';\nimport {\n\tapplyAddMark,\n\tapplyDeleteText,\n\tapplyInsertInlineNode,\n\tapplyInsertNode,\n\tapplyInsertText,\n\tapplyMergeBlocks,\n\tapplyRemoveInlineNode,\n\tapplyRemoveMark,\n\tapplyRemoveNode,\n\tapplySetBlockType,\n\tapplySetInlineNodeAttr,\n\tapplySetNodeAttr,\n\tapplySetStoredMarks,\n\tapplySplitBlock,\n} from './StepApplication.js';\nimport {\n\tderiveStoredMarksBefore,\n\tinvertAddMark,\n\tinvertDeleteText,\n\tinvertInsertInlineNode,\n\tinvertInsertNode,\n\tinvertInsertText,\n\tinvertMergeBlocks,\n\tinvertRemoveInlineNode,\n\tinvertRemoveMark,\n\tinvertRemoveNode,\n\tinvertSetBlockType,\n\tinvertSetInlineNodeAttr,\n\tinvertSetNodeAttr,\n\tinvertSetStoredMarks,\n\tinvertSplitBlock,\n} from './StepInversion.js';\nimport {\n\tmapAddMark,\n\tmapDeleteText,\n\tmapInsertInlineNode,\n\tmapInsertNode,\n\tmapInsertText,\n\tmapMergeBlocks,\n\tmapRemoveInlineNode,\n\tmapRemoveMark,\n\tmapRemoveNode,\n\tmapSetBlockType,\n\tmapSetInlineNodeAttr,\n\tmapSetNodeAttr,\n\tmapSetStoredMarks,\n\tmapSplitBlock,\n} from './StepMapping.js';\nimport {\n\tgetMapAddMark,\n\tgetMapDeleteText,\n\tgetMapInsertInlineNode,\n\tgetMapInsertNode,\n\tgetMapInsertText,\n\tgetMapMergeBlocks,\n\tgetMapRemoveInlineNode,\n\tgetMapRemoveMark,\n\tgetMapRemoveNode,\n\tgetMapSetBlockType,\n\tgetMapSetInlineNodeAttr,\n\tgetMapSetNodeAttr,\n\tgetMapSetStoredMarks,\n\tgetMapSplitBlock,\n} from './StepMaps.js';\nimport type { Step } from './Steps.js';\nimport type { Transaction } from './Transaction.js';\n\n/**\n * Forward, inverse, position-mapping, and step-rebase behavior of one step\n * subtype, co-located so a new step type is one registry entry.\n *\n * - `apply` / `invert` / `getMap` cover the existing step pipeline.\n * - `map` rebases the step itself through a {@link Mapping} describing\n * intervening changes; returns `null` when the step can no longer be\n * applied meaningfully (block removed, range fragmented, range fully\n * eaten). See {@link StepMapping.ts} for per-step semantics.\n *\n * `getMap` and `map` both receive the document at the step's \"current\"\n * frame: `getMap` against the pre-apply doc, `map` against the doc that\n * the rebased step will be applied to. The latter is needed to re-snapshot\n * inverse-payload fields (`deletedText`, `previousAttrs`, etc.) so the\n * rebased step inverts correctly on redo.\n */\nexport interface StepHandler<S extends Step> {\n\treadonly apply: (doc: Document, step: S) => Document;\n\treadonly invert: (step: S) => Step;\n\treadonly getMap: (doc: Document, step: S) => StepMap;\n\treadonly map: (step: S, mapping: Mapping, doc: Document) => Step | null;\n}\n\n/**\n * Registry shape: every member of the `Step` union must have a matching\n * handler. If a new step type is added to the union without a handler,\n * the literal below fails to type-check.\n */\ntype StepHandlerRegistry = {\n\treadonly [K in Step['type']]: StepHandler<Extract<Step, { readonly type: K }>>;\n};\n\nconst STEP_HANDLERS: StepHandlerRegistry = {\n\tinsertText: {\n\t\tapply: applyInsertText,\n\t\tinvert: invertInsertText,\n\t\tgetMap: getMapInsertText,\n\t\tmap: mapInsertText,\n\t},\n\tdeleteText: {\n\t\tapply: applyDeleteText,\n\t\tinvert: invertDeleteText,\n\t\tgetMap: getMapDeleteText,\n\t\tmap: mapDeleteText,\n\t},\n\tsplitBlock: {\n\t\tapply: applySplitBlock,\n\t\tinvert: invertSplitBlock,\n\t\tgetMap: getMapSplitBlock,\n\t\tmap: mapSplitBlock,\n\t},\n\tmergeBlocks: {\n\t\tapply: applyMergeBlocks,\n\t\tinvert: invertMergeBlocks,\n\t\tgetMap: getMapMergeBlocks,\n\t\tmap: mapMergeBlocks,\n\t},\n\taddMark: {\n\t\tapply: applyAddMark,\n\t\tinvert: invertAddMark,\n\t\tgetMap: getMapAddMark,\n\t\tmap: mapAddMark,\n\t},\n\tremoveMark: {\n\t\tapply: applyRemoveMark,\n\t\tinvert: invertRemoveMark,\n\t\tgetMap: getMapRemoveMark,\n\t\tmap: mapRemoveMark,\n\t},\n\tsetStoredMarks: {\n\t\tapply: applySetStoredMarks,\n\t\tinvert: invertSetStoredMarks,\n\t\tgetMap: getMapSetStoredMarks,\n\t\tmap: mapSetStoredMarks,\n\t},\n\tsetBlockType: {\n\t\tapply: applySetBlockType,\n\t\tinvert: invertSetBlockType,\n\t\tgetMap: getMapSetBlockType,\n\t\tmap: mapSetBlockType,\n\t},\n\tinsertNode: {\n\t\tapply: applyInsertNode,\n\t\tinvert: invertInsertNode,\n\t\tgetMap: getMapInsertNode,\n\t\tmap: mapInsertNode,\n\t},\n\tremoveNode: {\n\t\tapply: applyRemoveNode,\n\t\tinvert: invertRemoveNode,\n\t\tgetMap: getMapRemoveNode,\n\t\tmap: mapRemoveNode,\n\t},\n\tsetNodeAttr: {\n\t\tapply: applySetNodeAttr,\n\t\tinvert: invertSetNodeAttr,\n\t\tgetMap: getMapSetNodeAttr,\n\t\tmap: mapSetNodeAttr,\n\t},\n\tinsertInlineNode: {\n\t\tapply: applyInsertInlineNode,\n\t\tinvert: invertInsertInlineNode,\n\t\tgetMap: getMapInsertInlineNode,\n\t\tmap: mapInsertInlineNode,\n\t},\n\tremoveInlineNode: {\n\t\tapply: applyRemoveInlineNode,\n\t\tinvert: invertRemoveInlineNode,\n\t\tgetMap: getMapRemoveInlineNode,\n\t\tmap: mapRemoveInlineNode,\n\t},\n\tsetInlineNodeAttr: {\n\t\tapply: applySetInlineNodeAttr,\n\t\tinvert: invertSetInlineNodeAttr,\n\t\tgetMap: getMapSetInlineNodeAttr,\n\t\tmap: mapSetInlineNodeAttr,\n\t},\n};\n\n/**\n * Looks up the handler for a step. The cast is bounded — `STEP_HANDLERS`\n * is typed such that `step.type` always selects a handler whose parameter\n * type matches `S`. TypeScript cannot narrow indexed access through a\n * discriminator without help, so we assert the relationship once here.\n */\nfunction getHandler<S extends Step>(step: S): StepHandler<S> {\n\treturn STEP_HANDLERS[step.type] as unknown as StepHandler<S>;\n}\n\n/** Applies a single step to a document and returns the new document. */\nexport function applyStep(doc: Document, step: Step): Document {\n\treturn getHandler(step).apply(doc, step);\n}\n\n/** Returns the inverse of a step, used for undo/redo. */\nexport function invertStep(step: Step): Step {\n\treturn getHandler(step).invert(step);\n}\n\n/**\n * Returns the position-space {@link StepMap} for a step, computed against\n * the document state **before** the step was applied.\n */\nexport function getStepMap(doc: Document, step: Step): StepMap {\n\treturn getHandler(step).getMap(doc, step);\n}\n\n/**\n * Rebases a step through a {@link Mapping} describing intervening edits in\n * position space, returning either the rebased step or `null` when the\n * step can no longer be applied meaningfully (block removed, range fully\n * eaten, range fragmented across blocks, structural ancestor migrated).\n *\n * `doc` must be the document at the frame the rebased step will run\n * against — `map` re-snapshots inverse-payload fields (`deletedText`,\n * `previousAttrs`, …) from it so the rebased step inverts correctly on\n * redo.\n *\n * Callers (e.g. {@link HistoryManager.undo}) treat a `null` as a signal to\n * abandon the entire undo/redo group rather than apply a partial rebase\n * that would silently corrupt the document.\n */\nexport function mapStep(step: Step, mapping: Mapping, doc: Document): Step | null {\n\tif (mapping.isEmpty) return step;\n\treturn getHandler(step).map(step, mapping, doc);\n}\n\n/**\n * Inverts an entire transaction (reverses step order and swaps selections).\n *\n * The returned transaction's `mapping` is {@link Mapping.empty}: producing a\n * faithful mapping for inverted steps requires the pre-apply document at\n * each inverse step (e.g. `removeNode` needs to walk the subtree, which is\n * only present in the forward step's payload, not its inverse). Callers\n * that need a real mapping for the inverted transaction should accumulate\n * step maps via {@link getStepMap} as they apply each inverse step.\n *\n * `forwardStepMaps` is set to identity placeholders for the same reason —\n * the inverse-step forward effect is only computable against the document\n * state at each inverse, which the caller (e.g. `HistoryManager.undo`)\n * tracks while walking.\n */\nexport function invertTransaction(tr: Transaction): Transaction {\n\tconst invertedSteps: Step[] = tr.steps.map(invertStep).reverse();\n\treturn {\n\t\tsteps: invertedSteps,\n\t\tselectionBefore: tr.selectionAfter,\n\t\tselectionAfter: tr.selectionBefore,\n\t\tstoredMarksAfter: deriveStoredMarksBefore(tr),\n\t\tmapping: Mapping.empty,\n\t\tforwardStepMaps: invertedSteps.map(() => IDENTITY_MAP),\n\t\tmetadata: {\n\t\t\torigin: 'history',\n\t\t\ttimestamp: Date.now(),\n\t\t},\n\t};\n}\n","/**\n * Thin decoration-specific adapters over the generic {@link StepMap}\n * primitive. Position-shift arithmetic lives in `state/Mapping.ts`; this\n * module only contains the decoration-shape concerns:\n *\n * - splitting an {@link InlineDecoration} into two when a `splitBlock`\n * crosses its range,\n * - dropping a {@link NodeDecoration} when its block disappears\n * (`removeNode`) or is absorbed by a merge,\n * - applying widget `side` as the mapping `assoc`.\n *\n * The legacy entry point `mapDecorationThroughStep(deco, step)` is\n * preserved as a thin shim over `mapDecorationThroughStepMap` so existing\n * tests keep working; new consumers should reach for `Transaction.mapping`\n * directly via `DecorationSet.map(tr)`.\n */\n\nimport type { Document } from '../model/Document.js';\nimport { createPosition } from '../model/Selection.js';\nimport type { MergeMap, ShiftMap, SplitMap, StepMap } from '../state/Mapping.js';\nimport { mapPositionThroughStep } from '../state/Mapping.js';\nimport { getStepMap } from '../state/StepHandlers.js';\nimport type { Step } from '../state/Transaction.js';\nimport type {\n\tDecoration,\n\tInlineDecoration,\n\tNodeDecoration,\n\tWidgetDecoration,\n} from './Decoration.js';\n\nconst EMPTY_DOC: Document = { children: [] };\n\n/**\n * Maps a decoration through a single {@link StepMap}. Returns:\n * - the (possibly identical) decoration,\n * - an array of two decorations when a `splitBlock` cuts an inline range,\n * - or `null` when the decoration was deleted.\n */\nexport function mapDecorationThroughStepMap(\n\tdeco: Decoration,\n\tstepMap: StepMap,\n): Decoration | readonly Decoration[] | null {\n\tswitch (deco.type) {\n\t\tcase 'inline':\n\t\t\treturn mapInline(deco, stepMap);\n\t\tcase 'widget':\n\t\t\treturn mapWidget(deco, stepMap);\n\t\tcase 'node':\n\t\t\treturn mapNode(deco, stepMap);\n\t}\n}\n\n/**\n * Legacy entry point — kept for backward compatibility with callers and\n * tests that hold a {@link Step} rather than a {@link StepMap}. Internally\n * converts step → StepMap (cheap, no doc state needed for any of the\n * shape categories used here) and delegates to\n * {@link mapDecorationThroughStepMap}.\n */\nexport function mapDecorationThroughStep(\n\tdeco: Decoration,\n\tstep: Step,\n): Decoration | readonly Decoration[] | null {\n\treturn mapDecorationThroughStepMap(deco, getStepMap(EMPTY_DOC, step));\n}\n\n// --- Inline ---\n\nfunction mapInline(\n\tdeco: InlineDecoration,\n\tstepMap: StepMap,\n): InlineDecoration | readonly InlineDecoration[] | null {\n\tswitch (stepMap.type) {\n\t\tcase 'identity':\n\t\t\treturn deco;\n\t\tcase 'shift':\n\t\t\treturn mapInlineShift(deco, stepMap);\n\t\tcase 'split':\n\t\t\treturn mapInlineSplit(deco, stepMap);\n\t\tcase 'merge':\n\t\t\treturn mapInlineMerge(deco, stepMap);\n\t\tcase 'blockRemoval':\n\t\t\treturn stepMap.removedBlockIds.has(deco.blockId) ? null : deco;\n\t\tcase 'childIndexShift':\n\t\t\t// Sibling-index shifts don't move text positions.\n\t\t\treturn deco;\n\t}\n}\n\nfunction mapInlineShift(deco: InlineDecoration, map: ShiftMap): InlineDecoration | null {\n\tif (deco.blockId !== map.blockId) return deco;\n\n\tconst fromPos = mapPositionThroughStep(createPosition(deco.blockId, deco.from), map, -1).pos;\n\tconst toPos = mapPositionThroughStep(createPosition(deco.blockId, deco.to), map, 1).pos;\n\n\tif (fromPos.offset >= toPos.offset) return null;\n\tif (fromPos.offset === deco.from && toPos.offset === deco.to) return deco;\n\treturn { ...deco, from: fromPos.offset, to: toPos.offset };\n}\n\nfunction mapInlineSplit(\n\tdeco: InlineDecoration,\n\tmap: SplitMap,\n): InlineDecoration | readonly InlineDecoration[] {\n\tif (deco.blockId !== map.blockId) return deco;\n\n\tif (deco.to <= map.offset) return deco;\n\n\tif (deco.from >= map.offset) {\n\t\treturn {\n\t\t\t...deco,\n\t\t\tblockId: map.newBlockId,\n\t\t\tfrom: deco.from - map.offset,\n\t\t\tto: deco.to - map.offset,\n\t\t};\n\t}\n\n\t// Spans the split — return both halves\n\tconst left: InlineDecoration = { ...deco, to: map.offset };\n\tconst right: InlineDecoration = {\n\t\t...deco,\n\t\tblockId: map.newBlockId,\n\t\tfrom: 0,\n\t\tto: deco.to - map.offset,\n\t};\n\treturn [left, right];\n}\n\nfunction mapInlineMerge(deco: InlineDecoration, map: MergeMap): InlineDecoration {\n\tif (deco.blockId !== map.sourceBlockId) return deco;\n\treturn {\n\t\t...deco,\n\t\tblockId: map.targetBlockId,\n\t\tfrom: deco.from + map.targetLengthBefore,\n\t\tto: deco.to + map.targetLengthBefore,\n\t};\n}\n\n// --- Widget ---\n\nfunction mapWidget(deco: WidgetDecoration, stepMap: StepMap): WidgetDecoration | null {\n\tswitch (stepMap.type) {\n\t\tcase 'identity':\n\t\t\treturn deco;\n\t\tcase 'shift':\n\t\t\treturn mapWidgetShift(deco, stepMap);\n\t\tcase 'split':\n\t\t\treturn mapWidgetSplit(deco, stepMap);\n\t\tcase 'merge':\n\t\t\treturn mapWidgetMerge(deco, stepMap);\n\t\tcase 'blockRemoval':\n\t\t\treturn stepMap.removedBlockIds.has(deco.blockId) ? null : deco;\n\t\tcase 'childIndexShift':\n\t\t\treturn deco;\n\t}\n}\n\nfunction mapWidgetShift(deco: WidgetDecoration, map: ShiftMap): WidgetDecoration | null {\n\tif (deco.blockId !== map.blockId) return deco;\n\n\tconst result = mapPositionThroughStep(createPosition(deco.blockId, deco.offset), map, deco.side);\n\t// A widget that lands strictly inside removed content is deleted.\n\tif (result.deleted) return null;\n\tif (result.pos.offset === deco.offset) return deco;\n\treturn { ...deco, offset: result.pos.offset };\n}\n\nfunction mapWidgetSplit(deco: WidgetDecoration, map: SplitMap): WidgetDecoration {\n\tif (deco.blockId !== map.blockId) return deco;\n\tconst result = mapPositionThroughStep(createPosition(deco.blockId, deco.offset), map, deco.side);\n\tif (result.pos.blockId === deco.blockId && result.pos.offset === deco.offset) return deco;\n\treturn { ...deco, blockId: result.pos.blockId, offset: result.pos.offset };\n}\n\nfunction mapWidgetMerge(deco: WidgetDecoration, map: MergeMap): WidgetDecoration {\n\tif (deco.blockId !== map.sourceBlockId) return deco;\n\treturn {\n\t\t...deco,\n\t\tblockId: map.targetBlockId,\n\t\toffset: deco.offset + map.targetLengthBefore,\n\t};\n}\n\n// --- Node ---\n\nfunction mapNode(deco: NodeDecoration, stepMap: StepMap): NodeDecoration | null {\n\tswitch (stepMap.type) {\n\t\tcase 'identity':\n\t\tcase 'shift':\n\t\tcase 'split':\n\t\t\t// Node decorations are bound to a block; in-block content edits\n\t\t\t// and splits don't affect them. Splits keep the decoration on the\n\t\t\t// original block (the new block has no decoration of its own).\n\t\t\treturn deco;\n\t\tcase 'merge':\n\t\t\t// Source block disappears as a separate block → its decoration is dropped.\n\t\t\treturn deco.blockId === stepMap.sourceBlockId ? null : deco;\n\t\tcase 'blockRemoval':\n\t\t\treturn stepMap.removedBlockIds.has(deco.blockId) ? null : deco;\n\t\tcase 'childIndexShift':\n\t\t\treturn deco;\n\t}\n}\n","/**\n * Decoration types and DecorationSet for transient, view-only annotations.\n * Decorations are NOT part of the document model and do NOT affect undo/redo.\n */\n\nimport type { BlockId } from '../model/TypeBrands.js';\nimport type { Transaction } from '../state/Transaction.js';\nimport { mapDecorationThroughStepMap } from './PositionMapping.js';\n\n// --- Decoration Attrs ---\n\nexport interface DecorationAttrs {\n\treadonly class?: string;\n\treadonly style?: string;\n\treadonly nodeName?: string;\n\treadonly [key: string]: string | undefined;\n}\n\n// --- Decoration Types ---\n\nexport interface InlineDecoration {\n\treadonly type: 'inline';\n\treadonly blockId: BlockId;\n\treadonly from: number;\n\treadonly to: number;\n\treadonly attrs: DecorationAttrs;\n}\n\nexport interface NodeDecoration {\n\treadonly type: 'node';\n\treadonly blockId: BlockId;\n\treadonly attrs: DecorationAttrs;\n}\n\nexport interface WidgetDecoration {\n\treadonly type: 'widget';\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n\treadonly toDOM: () => HTMLElement;\n\treadonly side: -1 | 1;\n\treadonly key?: string;\n}\n\nexport type Decoration = InlineDecoration | NodeDecoration | WidgetDecoration;\n\n// --- Factory Functions ---\n\n/** Creates an inline decoration for a text range within a block. */\nexport function inline(\n\tblockId: BlockId,\n\tfrom: number,\n\tto: number,\n\tattrs: DecorationAttrs,\n): InlineDecoration {\n\treturn { type: 'inline', blockId, from, to, attrs };\n}\n\n/** Creates a node decoration that applies to a whole block element. */\nexport function node(blockId: BlockId, attrs: DecorationAttrs): NodeDecoration {\n\treturn { type: 'node', blockId, attrs };\n}\n\n/** Creates a widget decoration that inserts a DOM element at a position. */\nexport function widget(\n\tblockId: BlockId,\n\toffset: number,\n\ttoDOM: () => HTMLElement,\n\toptions?: { readonly side?: -1 | 1; readonly key?: string },\n): WidgetDecoration {\n\treturn {\n\t\ttype: 'widget',\n\t\tblockId,\n\t\toffset,\n\t\ttoDOM,\n\t\tside: options?.side ?? -1,\n\t\tkey: options?.key,\n\t};\n}\n\n// --- DecorationSet ---\n\n/**\n * Immutable set of decorations indexed by block ID.\n * Provides efficient lookup and merging of decoration collections.\n */\nexport class DecorationSet {\n\tstatic readonly empty: DecorationSet = new DecorationSet(new Map());\n\n\tprivate constructor(private readonly byBlock: ReadonlyMap<BlockId, readonly Decoration[]>) {}\n\n\t/** Creates a DecorationSet from a flat array of decorations. */\n\tstatic create(decorations: readonly Decoration[]): DecorationSet {\n\t\tif (decorations.length === 0) return DecorationSet.empty;\n\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tfor (const deco of decorations) {\n\t\t\tconst existing = map.get(deco.blockId);\n\t\t\tif (existing) {\n\t\t\t\texisting.push(deco);\n\t\t\t} else {\n\t\t\t\tmap.set(deco.blockId, [deco]);\n\t\t\t}\n\t\t}\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Returns all decorations for a given block. */\n\tfind(blockId: BlockId): readonly Decoration[] {\n\t\treturn this.byBlock.get(blockId) ?? [];\n\t}\n\n\t/** Returns only inline decorations for a given block. */\n\tfindInline(blockId: BlockId): readonly InlineDecoration[] {\n\t\tconst decos = this.byBlock.get(blockId);\n\t\tif (!decos) return [];\n\t\treturn decos.filter((d): d is InlineDecoration => d.type === 'inline');\n\t}\n\n\t/** Returns only node decorations for a given block. */\n\tfindNode(blockId: BlockId): readonly NodeDecoration[] {\n\t\tconst decos = this.byBlock.get(blockId);\n\t\tif (!decos) return [];\n\t\treturn decos.filter((d): d is NodeDecoration => d.type === 'node');\n\t}\n\n\t/** Returns only widget decorations for a given block. */\n\tfindWidget(blockId: BlockId): readonly WidgetDecoration[] {\n\t\tconst decos = this.byBlock.get(blockId);\n\t\tif (!decos) return [];\n\t\treturn decos.filter((d): d is WidgetDecoration => d.type === 'widget');\n\t}\n\n\t/** Returns a new DecorationSet with the given decorations added. */\n\tadd(decorations: readonly Decoration[]): DecorationSet {\n\t\tif (decorations.length === 0) return this;\n\t\tif (this.isEmpty) return DecorationSet.create(decorations);\n\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tmap.set(bid, [...decos]);\n\t\t}\n\t\tfor (const deco of decorations) {\n\t\t\tconst existing = map.get(deco.blockId);\n\t\t\tif (existing) {\n\t\t\t\texisting.push(deco);\n\t\t\t} else {\n\t\t\t\tmap.set(deco.blockId, [deco]);\n\t\t\t}\n\t\t}\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Returns a new DecorationSet with decorations matching the predicate removed. */\n\tremove(predicate: (d: Decoration) => boolean): DecorationSet {\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tlet changed = false;\n\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tconst filtered = decos.filter((d) => !predicate(d));\n\t\t\tif (filtered.length !== decos.length) changed = true;\n\t\t\tif (filtered.length > 0) {\n\t\t\t\tmap.set(bid, filtered);\n\t\t\t}\n\t\t}\n\n\t\tif (!changed) return this;\n\t\tif (map.size === 0) return DecorationSet.empty;\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Returns a new DecorationSet merging this set with another. */\n\tmerge(other: DecorationSet): DecorationSet {\n\t\tif (other.isEmpty) return this;\n\t\tif (this.isEmpty) return other;\n\n\t\tconst map = new Map<BlockId, Decoration[]>();\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tmap.set(bid, [...decos]);\n\t\t}\n\t\tfor (const [bid, decos] of other.byBlock) {\n\t\t\tconst existing = map.get(bid);\n\t\t\tif (existing) {\n\t\t\t\texisting.push(...decos);\n\t\t\t} else {\n\t\t\t\tmap.set(bid, [...decos]);\n\t\t\t}\n\t\t}\n\t\treturn new DecorationSet(map);\n\t}\n\n\t/** Checks equality — reference first, then structural comparison. */\n\tequals(other: DecorationSet): boolean {\n\t\tif (this === other) return true;\n\t\tif (this.byBlock.size !== other.byBlock.size) return false;\n\n\t\tfor (const [bid, decos] of this.byBlock) {\n\t\t\tconst otherDecos = other.byBlock.get(bid);\n\t\t\tif (!otherDecos) return false;\n\t\t\tif (!decorationArraysEqual(decos, otherDecos)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/** True if the set contains no decorations. */\n\tget isEmpty(): boolean {\n\t\treturn this.byBlock.size === 0;\n\t}\n\n\t/**\n\t * Maps decorations through document changes described by a transaction.\n\t * Decorations that become invalid (e.g. fully deleted range) are removed.\n\t * Decorations that span a split point are split into two.\n\t *\n\t * Iterates over `tr.mapping.maps` (the position-space {@link StepMap}s)\n\t * rather than `tr.steps`. This means selection-only or other identity\n\t * transactions short-circuit (`tr.mapping.isEmpty`) without rebuilding\n\t * the set, and the decoration-specific shape concerns (split-into-two,\n\t * drop-on-block-removal) are the only logic that lives here.\n\t */\n\tmap(tr: Transaction): DecorationSet {\n\t\tif (this.isEmpty || tr.mapping.isEmpty) return this;\n\n\t\tlet mapped: Decoration[] = [];\n\t\tfor (const decos of this.byBlock.values()) {\n\t\t\tfor (const d of decos) {\n\t\t\t\tmapped.push(d);\n\t\t\t}\n\t\t}\n\n\t\tfor (const stepMap of tr.mapping.maps) {\n\t\t\tconst next: Decoration[] = [];\n\t\t\tfor (const deco of mapped) {\n\t\t\t\tconst result = mapDecorationThroughStepMap(deco, stepMap);\n\t\t\t\tif (result === null) continue;\n\t\t\t\tif (Array.isArray(result)) {\n\t\t\t\t\tfor (const r of result) {\n\t\t\t\t\t\tnext.push(r);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnext.push(result as Decoration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmapped = next;\n\t\t}\n\n\t\tif (mapped.length === 0) return DecorationSet.empty;\n\t\treturn DecorationSet.create(mapped);\n\t}\n}\n\n// --- Helpers ---\n\n/** Compares two decoration arrays for structural equality. */\nexport function decorationArraysEqual(a: readonly Decoration[], b: readonly Decoration[]): boolean {\n\tif (a === b) return true;\n\tif (a.length !== b.length) return false;\n\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst ai = a[i];\n\t\tconst bi = b[i];\n\t\tif (!ai || !bi || !decorationsEqual(ai, bi)) return false;\n\t}\n\treturn true;\n}\n\n/** Compares two individual decorations for structural equality. */\nfunction decorationsEqual(a: Decoration, b: Decoration): boolean {\n\tif (a.type !== b.type) return false;\n\tif (a.blockId !== b.blockId) return false;\n\n\tswitch (a.type) {\n\t\tcase 'inline': {\n\t\t\tconst bi = b as InlineDecoration;\n\t\t\treturn a.from === bi.from && a.to === bi.to && attrsEqual(a.attrs, bi.attrs);\n\t\t}\n\t\tcase 'node': {\n\t\t\tconst bn = b as NodeDecoration;\n\t\t\treturn attrsEqual(a.attrs, bn.attrs);\n\t\t}\n\t\tcase 'widget': {\n\t\t\tconst bw = b as WidgetDecoration;\n\t\t\treturn (\n\t\t\t\ta.offset === bw.offset && a.side === bw.side && a.key === bw.key && a.toDOM === bw.toDOM\n\t\t\t);\n\t\t}\n\t}\n}\n\n/** Compares two DecorationAttrs objects. */\nfunction attrsEqual(a: DecorationAttrs, b: DecorationAttrs): boolean {\n\tif (a === b) return true;\n\tconst aKeys = Object.keys(a);\n\tconst bKeys = Object.keys(b);\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (const key of aKeys) {\n\t\tif (a[key] !== b[key]) return false;\n\t}\n\treturn true;\n}\n"],"mappings":"2SA6LA,IAAa,EAA4B,CAAE,KAAM,YAMjD,SAAgB,EAAuB,GACtC,MAAM,iBAAM,IAAI,IACV,EAAQ,IACb,EAAI,IAAI,EAAE,IACV,IAAK,MAAM,KAAS,EAAE,SACjB,EAAY,IAAQ,EAAK,IAI/B,OADA,EAAK,GACE,CACR,CAaA,SAAgB,EAAuB,EAAe,EAAc,GAAe,GAClF,OAAQ,EAAI,MACX,IAAK,WAUL,IAAK,kBAKJ,MAAO,CAAE,MAAK,SAAS,GAbxB,IAAK,QACJ,OAgBH,SAAiC,EAAe,EAAe,GAC9D,GAAI,EAAI,UAAY,EAAI,QAAS,MAAO,CAAE,MAAK,SAAS,GAExD,MAAM,EAAgB,EAAI,QAAU,EAAI,GAAK,EAAI,MAC3C,EAAc,EAAI,OAGxB,GAAI,EAAM,EAAI,KAAM,MAAO,CAAE,MAAK,SAAS,GAG3C,GAAI,IAAQ,EAAI,KAAM,CAGrB,GAAI,EAAI,OAAS,EAAI,GAAI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AI,EAAM,SAAW,EAAM,OAAQ,OAAO,EAC1C,IAAK,MAAM,KAAO,EACjB,GAAI,EAAE,KAAS,EAAE,GAAM,OAAO,EAE/B,OAAO,CACR"}
@@ -0,0 +1,2 @@
1
+ import{S as r}from"./Document-r7vLOAGA.mjs";var t=/[\p{Script=Hebrew}\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}\p{Script=Nko}\p{Script=Samaritan}\p{Script=Adlam}\p{Script=Hanifi_Rohingya}\p{Script=Mende_Kikakui}\p{Script=Yezidi}\p{Script=Old_South_Arabian}\p{Script=Old_North_Arabian}\p{Script=Avestan}\p{Script=Imperial_Aramaic}\p{Script=Phoenician}\p{Script=Lydian}\u200F\u061C]/u,i=/[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}\p{Script=Armenian}\p{Script=Devanagari}\p{Script=Bengali}\p{Script=Gurmukhi}\p{Script=Gujarati}\p{Script=Oriya}\p{Script=Tamil}\p{Script=Telugu}\p{Script=Kannada}\p{Script=Malayalam}\p{Script=Sinhala}\p{Script=Thai}\p{Script=Lao}\p{Script=Tibetan}\p{Script=Myanmar}\p{Script=Georgian}\p{Script=Hangul}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}\p{Script=Ethiopic}\p{Script=Cherokee}\p{Script=Khmer}\u200E]/u;function p(r){const p=r.search(t),a=r.search(i);return-1===p&&-1===a?null:-1===p?"ltr":-1===a||p<a?"rtl":"ltr"}function a(r){const t=r.attrs?.dir;return"ltr"===t||"rtl"===t?t:"auto"}function c(t,i,p){const a=function(t,i){if(0===i.length)return t.doc.children;const p=i[i.length-1];if(!p)return[];const a=t.getBlock(p);return a?a.children.filter(r):[]}(t,i);for(let r=p-1;r>=0;r--){const t=a[r]?.attrs?.dir;if("ltr"===t||"rtl"===t)return t}for(let r=p;r<a.length;r++){const t=a[r]?.attrs?.dir;if("ltr"===t||"rtl"===t)return t}}export{c as n,a as r,p as t};
2
+ //# sourceMappingURL=DirectionDetection-C7XE0nxW.mjs.map