@mx-space/cli 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +101 -28
  2. package/ROADMAP.md +4 -3
  3. package/dist/{Lexical.dev-DpU35QTu.mjs → Lexical.dev-CMevU1DO.mjs} +1 -1
  4. package/dist/{Lexical.dev-DpU35QTu.mjs.map → Lexical.dev-CMevU1DO.mjs.map} +1 -1
  5. package/dist/{Lexical.node-gYNDt_p9.mjs → Lexical.node-BR9e7Cyk.mjs} +2 -2
  6. package/dist/{Lexical.node-gYNDt_p9.mjs.map → Lexical.node-BR9e7Cyk.mjs.map} +1 -1
  7. package/dist/{Lexical.prod-t4c3bHV3.mjs → Lexical.prod-PUD-z9fY.mjs} +1 -1
  8. package/dist/{Lexical.prod-t4c3bHV3.mjs.map → Lexical.prod-PUD-z9fY.mjs.map} +1 -1
  9. package/dist/{LexicalClipboard.dev-CdeeWCIq.mjs → LexicalClipboard.dev-DZC2zppG.mjs} +6 -6
  10. package/dist/{LexicalClipboard.dev-CdeeWCIq.mjs.map → LexicalClipboard.dev-DZC2zppG.mjs.map} +1 -1
  11. package/dist/{LexicalClipboard.node-0e9GBL1g.mjs → LexicalClipboard.node-e5G1wVGb.mjs} +2 -2
  12. package/dist/{LexicalClipboard.node-0e9GBL1g.mjs.map → LexicalClipboard.node-e5G1wVGb.mjs.map} +1 -1
  13. package/dist/{LexicalClipboard.prod-CsCWYmV7.mjs → LexicalClipboard.prod-DE2azzIb.mjs} +6 -6
  14. package/dist/{LexicalClipboard.prod-CsCWYmV7.mjs.map → LexicalClipboard.prod-DE2azzIb.mjs.map} +1 -1
  15. package/dist/{LexicalCodeCore.dev-haI2cqH8.mjs → LexicalCodeCore.dev-gs--x55I.mjs} +3 -3
  16. package/dist/{LexicalCodeCore.dev-haI2cqH8.mjs.map → LexicalCodeCore.dev-gs--x55I.mjs.map} +1 -1
  17. package/dist/{LexicalCodeCore.prod-D_k7zuE5.mjs → LexicalCodeCore.prod-DPHOnyEj.mjs} +3 -3
  18. package/dist/{LexicalCodeCore.prod-D_k7zuE5.mjs.map → LexicalCodeCore.prod-DPHOnyEj.mjs.map} +1 -1
  19. package/dist/{LexicalDragon.dev-CAggdFh_.mjs → LexicalDragon.dev-CVe8bzVN.mjs} +3 -3
  20. package/dist/{LexicalDragon.dev-CAggdFh_.mjs.map → LexicalDragon.dev-CVe8bzVN.mjs.map} +1 -1
  21. package/dist/{LexicalDragon.node-QMR_wqJg.mjs → LexicalDragon.node-c7EHvcnK.mjs} +2 -2
  22. package/dist/{LexicalDragon.node-QMR_wqJg.mjs.map → LexicalDragon.node-c7EHvcnK.mjs.map} +1 -1
  23. package/dist/{LexicalDragon.prod-OssQhwS-.mjs → LexicalDragon.prod-D6KvqyLD.mjs} +3 -3
  24. package/dist/{LexicalDragon.prod-OssQhwS-.mjs.map → LexicalDragon.prod-D6KvqyLD.mjs.map} +1 -1
  25. package/dist/{LexicalExtension.dev-CtDZiMCU.mjs → LexicalExtension.dev-PDo8HyEw.mjs} +3 -3
  26. package/dist/{LexicalExtension.dev-CtDZiMCU.mjs.map → LexicalExtension.dev-PDo8HyEw.mjs.map} +1 -1
  27. package/dist/{LexicalExtension.node-BM0gh8zu.mjs → LexicalExtension.node-BKzjRb-0.mjs} +2 -2
  28. package/dist/{LexicalExtension.node-BM0gh8zu.mjs.map → LexicalExtension.node-BKzjRb-0.mjs.map} +1 -1
  29. package/dist/{LexicalExtension.prod-Ug6emhEO.mjs → LexicalExtension.prod-D0x_lX7q.mjs} +3 -3
  30. package/dist/{LexicalExtension.prod-Ug6emhEO.mjs.map → LexicalExtension.prod-D0x_lX7q.mjs.map} +1 -1
  31. package/dist/{LexicalHeadless.dev-D4yQpl_s.mjs → LexicalHeadless.dev-DBKcW82j.mjs} +2 -2
  32. package/dist/{LexicalHeadless.dev-D4yQpl_s.mjs.map → LexicalHeadless.dev-DBKcW82j.mjs.map} +1 -1
  33. package/dist/{LexicalHeadless.prod-jeN65B3k.mjs → LexicalHeadless.prod-D4nEh7cR.mjs} +2 -2
  34. package/dist/{LexicalHeadless.prod-jeN65B3k.mjs.map → LexicalHeadless.prod-D4nEh7cR.mjs.map} +1 -1
  35. package/dist/{LexicalHtml.dev-BdU1_ITQ.mjs → LexicalHtml.dev-vsWW05es.mjs} +4 -4
  36. package/dist/{LexicalHtml.dev-BdU1_ITQ.mjs.map → LexicalHtml.dev-vsWW05es.mjs.map} +1 -1
  37. package/dist/{LexicalHtml.node-DLtAh00E.mjs → LexicalHtml.node-CpibAfba.mjs} +2 -2
  38. package/dist/{LexicalHtml.node-DLtAh00E.mjs.map → LexicalHtml.node-CpibAfba.mjs.map} +1 -1
  39. package/dist/{LexicalHtml.prod-DdLE1HHT.mjs → LexicalHtml.prod-Bqz-3WAp.mjs} +4 -4
  40. package/dist/{LexicalHtml.prod-DdLE1HHT.mjs.map → LexicalHtml.prod-Bqz-3WAp.mjs.map} +1 -1
  41. package/dist/{LexicalLink.dev-DK87Biuy.mjs → LexicalLink.dev-BO0J0B1E.mjs} +4 -4
  42. package/dist/{LexicalLink.dev-DK87Biuy.mjs.map → LexicalLink.dev-BO0J0B1E.mjs.map} +1 -1
  43. package/dist/{LexicalLink.prod-fssuv6Sf.mjs → LexicalLink.prod-D66AhUCZ.mjs} +4 -4
  44. package/dist/{LexicalLink.prod-fssuv6Sf.mjs.map → LexicalLink.prod-D66AhUCZ.mjs.map} +1 -1
  45. package/dist/{LexicalList.dev-BJ4dr_rk.mjs → LexicalList.dev-DVGTWRk0.mjs} +4 -4
  46. package/dist/{LexicalList.dev-BJ4dr_rk.mjs.map → LexicalList.dev-DVGTWRk0.mjs.map} +1 -1
  47. package/dist/{LexicalList.prod-jWBbaWfi.mjs → LexicalList.prod-Bao7NGl7.mjs} +4 -4
  48. package/dist/{LexicalList.prod-jWBbaWfi.mjs.map → LexicalList.prod-Bao7NGl7.mjs.map} +1 -1
  49. package/dist/{LexicalMarkdown.dev-C8e-eh6y.mjs → LexicalMarkdown.dev-CRWkZwlp.mjs} +4 -4
  50. package/dist/{LexicalMarkdown.dev-C8e-eh6y.mjs.map → LexicalMarkdown.dev-CRWkZwlp.mjs.map} +1 -1
  51. package/dist/{LexicalMarkdown.prod-k73tZVb2.mjs → LexicalMarkdown.prod-tGG6js4r.mjs} +4 -4
  52. package/dist/{LexicalMarkdown.prod-k73tZVb2.mjs.map → LexicalMarkdown.prod-tGG6js4r.mjs.map} +1 -1
  53. package/dist/{LexicalRichText.dev-CrSqq3K-.mjs → LexicalRichText.dev-DPXfQePC.mjs} +6 -6
  54. package/dist/{LexicalRichText.dev-CrSqq3K-.mjs.map → LexicalRichText.dev-DPXfQePC.mjs.map} +1 -1
  55. package/dist/{LexicalRichText.node-B7k7wlQz.mjs → LexicalRichText.node-BEkm_YwY.mjs} +5 -5
  56. package/dist/{LexicalRichText.node-B7k7wlQz.mjs.map → LexicalRichText.node-BEkm_YwY.mjs.map} +1 -1
  57. package/dist/{LexicalRichText.prod-CqvyxQ9m.mjs → LexicalRichText.prod-DlfudC5w.mjs} +6 -6
  58. package/dist/{LexicalRichText.prod-CqvyxQ9m.mjs.map → LexicalRichText.prod-DlfudC5w.mjs.map} +1 -1
  59. package/dist/{LexicalSelection.dev-sNOHKHe_.mjs → LexicalSelection.dev-BVTArZ-b.mjs} +2 -2
  60. package/dist/{LexicalSelection.dev-sNOHKHe_.mjs.map → LexicalSelection.dev-BVTArZ-b.mjs.map} +1 -1
  61. package/dist/{LexicalSelection.node-Di7GwBCZ.mjs → LexicalSelection.node-CQ8iTYsz.mjs} +2 -2
  62. package/dist/{LexicalSelection.node-Di7GwBCZ.mjs.map → LexicalSelection.node-CQ8iTYsz.mjs.map} +1 -1
  63. package/dist/{LexicalSelection.prod-SWllPJop.mjs → LexicalSelection.prod-BZKGGs-G.mjs} +2 -2
  64. package/dist/{LexicalSelection.prod-SWllPJop.mjs.map → LexicalSelection.prod-BZKGGs-G.mjs.map} +1 -1
  65. package/dist/{LexicalTable.dev-CQkLHXJx.mjs → LexicalTable.dev-C-AOEpJn.mjs} +5 -5
  66. package/dist/{LexicalTable.dev-CQkLHXJx.mjs.map → LexicalTable.dev-C-AOEpJn.mjs.map} +1 -1
  67. package/dist/{LexicalTable.prod-BtqCwKSi.mjs → LexicalTable.prod-Cyn0qWxZ.mjs} +5 -5
  68. package/dist/{LexicalTable.prod-BtqCwKSi.mjs.map → LexicalTable.prod-Cyn0qWxZ.mjs.map} +1 -1
  69. package/dist/{LexicalUtils.dev-DiUpsXE8.mjs → LexicalUtils.dev-DRRDyAlS.mjs} +3 -3
  70. package/dist/{LexicalUtils.dev-DiUpsXE8.mjs.map → LexicalUtils.dev-DRRDyAlS.mjs.map} +1 -1
  71. package/dist/{LexicalUtils.node-CmK462d1.mjs → LexicalUtils.node-Dz-HANi6.mjs} +2 -2
  72. package/dist/{LexicalUtils.node-CmK462d1.mjs.map → LexicalUtils.node-Dz-HANi6.mjs.map} +1 -1
  73. package/dist/{LexicalUtils.prod-bWwV4GAF.mjs → LexicalUtils.prod-CmeHwh8W.mjs} +3 -3
  74. package/dist/{LexicalUtils.prod-bWwV4GAF.mjs.map → LexicalUtils.prod-CmeHwh8W.mjs.map} +1 -1
  75. package/dist/{auth-OeKZZ_2x.mjs → auth-CAKmTDpF.mjs} +11 -11
  76. package/dist/auth-CAKmTDpF.mjs.map +1 -0
  77. package/dist/bin/mxs.d.mts +2 -1
  78. package/dist/bin/mxs.mjs +402 -55
  79. package/dist/bin/mxs.mjs.map +1 -1
  80. package/dist/{config-store-WL7dNMS6.mjs → config-store-B8_9iStL.mjs} +21 -81
  81. package/dist/config-store-B8_9iStL.mjs.map +1 -0
  82. package/dist/{create-Cxnqt_Wt.mjs → create-5wbU7IQh.mjs} +5 -5
  83. package/dist/{create-Cxnqt_Wt.mjs.map → create-5wbU7IQh.mjs.map} +1 -1
  84. package/dist/{create-DUOSAqBm.mjs → create-Bs6K7AyQ.mjs} +3 -3
  85. package/dist/{create-DUOSAqBm.mjs.map → create-Bs6K7AyQ.mjs.map} +1 -1
  86. package/dist/{create-C85MSrtt.mjs → create-DBReocgJ.mjs} +5 -5
  87. package/dist/{create-C85MSrtt.mjs.map → create-DBReocgJ.mjs.map} +1 -1
  88. package/dist/{create-BVHnXtIH.mjs → create-DGVaE0_S.mjs} +4 -4
  89. package/dist/{create-BVHnXtIH.mjs.map → create-DGVaE0_S.mjs.map} +1 -1
  90. package/dist/{create-BWA2WGrW.mjs → create-lLFZuMsz.mjs} +3 -3
  91. package/dist/{create-BWA2WGrW.mjs.map → create-lLFZuMsz.mjs.map} +1 -1
  92. package/dist/{delete-CGy-cV6k.mjs → delete-6tkhHQDp.mjs} +5 -5
  93. package/dist/delete-6tkhHQDp.mjs.map +1 -0
  94. package/dist/{delete-CcyrLNZv.mjs → delete-CRFxitDN.mjs} +6 -6
  95. package/dist/delete-CRFxitDN.mjs.map +1 -0
  96. package/dist/{delete-Cjxehwj7.mjs → delete-DU2Hvsy8.mjs} +5 -5
  97. package/dist/delete-DU2Hvsy8.mjs.map +1 -0
  98. package/dist/{delete-BEXOOFAJ.mjs → delete-nJmHtvfq.mjs} +6 -6
  99. package/dist/delete-nJmHtvfq.mjs.map +1 -0
  100. package/dist/{delete-CKqlAUT8.mjs → delete-tJhXI8s4.mjs} +5 -5
  101. package/dist/delete-tJhXI8s4.mjs.map +1 -0
  102. package/dist/{onboarding-C1t1yoay.mjs → dist-DJF1Ntdn.mjs} +95 -173
  103. package/dist/dist-DJF1Ntdn.mjs.map +1 -0
  104. package/dist/{document-output-C5PWbz2p.mjs → document-output-BFJdwPV0.mjs} +5 -5
  105. package/dist/document-output-BFJdwPV0.mjs.map +1 -0
  106. package/dist/{edit-BuKMUNVC.mjs → edit-BMjTbPQO.mjs} +5 -5
  107. package/dist/edit-BMjTbPQO.mjs.map +1 -0
  108. package/dist/{edit-DFnOnk4i.mjs → edit-BnEmMmv6.mjs} +9 -9
  109. package/dist/edit-BnEmMmv6.mjs.map +1 -0
  110. package/dist/{edit-BRaZ6GGg.mjs → edit-C4vRSmRy.mjs} +9 -9
  111. package/dist/{edit-BRaZ6GGg.mjs.map → edit-C4vRSmRy.mjs.map} +1 -1
  112. package/dist/{edit-t108N11Q.mjs → edit-CQsW5gnk.mjs} +8 -8
  113. package/dist/{edit-t108N11Q.mjs.map → edit-CQsW5gnk.mjs.map} +1 -1
  114. package/dist/{editor-xrF-j3UE.mjs → editor-BIw1ALTF.mjs} +4 -4
  115. package/dist/editor-BIw1ALTF.mjs.map +1 -0
  116. package/dist/{envelope-overlays-DPAlMNW1.mjs → envelope-overlays-DXXygxdF.mjs} +2 -2
  117. package/dist/{envelope-overlays-DPAlMNW1.mjs.map → envelope-overlays-DXXygxdF.mjs.map} +1 -1
  118. package/dist/{get-CwcNFb39.mjs → get-B3Y5hAAO.mjs} +3 -3
  119. package/dist/{get-CwcNFb39.mjs.map → get-B3Y5hAAO.mjs.map} +1 -1
  120. package/dist/{get-DnDvLa9S.mjs → get-C5fmd5Vf.mjs} +4 -4
  121. package/dist/{get-DnDvLa9S.mjs.map → get-C5fmd5Vf.mjs.map} +1 -1
  122. package/dist/{get-Doi-NKAh.mjs → get-Cdp2tmwz.mjs} +6 -6
  123. package/dist/get-Cdp2tmwz.mjs.map +1 -0
  124. package/dist/{get-DxTU7Nom.mjs → get-D18ChSKU.mjs} +3 -3
  125. package/dist/{get-DxTU7Nom.mjs.map → get-D18ChSKU.mjs.map} +1 -1
  126. package/dist/{get-BYoAlJwB.mjs → get-NSHTGu4Y.mjs} +4 -4
  127. package/dist/{get-BYoAlJwB.mjs.map → get-NSHTGu4Y.mjs.map} +1 -1
  128. package/dist/{get-GdRz82RW.mjs → get-XBPJr95m.mjs} +4 -4
  129. package/dist/{get-GdRz82RW.mjs.map → get-XBPJr95m.mjs.map} +1 -1
  130. package/dist/index.d.mts +57 -11
  131. package/dist/index.mjs +11 -10
  132. package/dist/{list-DVunNsXr.mjs → list-B6703n9X.mjs} +3 -3
  133. package/dist/{list-DVunNsXr.mjs.map → list-B6703n9X.mjs.map} +1 -1
  134. package/dist/{list-DN81zVDA.mjs → list-BtNocJhc.mjs} +3 -3
  135. package/dist/{list-DN81zVDA.mjs.map → list-BtNocJhc.mjs.map} +1 -1
  136. package/dist/{list-DHG-MzOM.mjs → list-C9dXrU9H.mjs} +3 -3
  137. package/dist/{list-DHG-MzOM.mjs.map → list-C9dXrU9H.mjs.map} +1 -1
  138. package/dist/{list-CtME3aDw.mjs → list-CcwcYZgN.mjs} +3 -3
  139. package/dist/{list-CtME3aDw.mjs.map → list-CcwcYZgN.mjs.map} +1 -1
  140. package/dist/{list-CLAcZYZ4.mjs → list-Ctc8b5gT.mjs} +3 -3
  141. package/dist/{list-CLAcZYZ4.mjs.map → list-Ctc8b5gT.mjs.map} +1 -1
  142. package/dist/{list-DbNCVZbz.mjs → list-b60JzCTw.mjs} +3 -3
  143. package/dist/{list-DbNCVZbz.mjs.map → list-b60JzCTw.mjs.map} +1 -1
  144. package/dist/{litexml-codec-CDoRloiR.mjs → litexml-codec-CfIxcPG0.mjs} +10 -10
  145. package/dist/{litexml-codec-CDoRloiR.mjs.map → litexml-codec-CfIxcPG0.mjs.map} +1 -1
  146. package/dist/{login-mjliJn8U.mjs → login-bZx4HaVs.mjs} +21 -9
  147. package/dist/{login-mjliJn8U.mjs.map → login-bZx4HaVs.mjs.map} +1 -1
  148. package/dist/logout-C0Dzitsu.mjs +18 -0
  149. package/dist/logout-C0Dzitsu.mjs.map +1 -0
  150. package/dist/ls-wMiTXZPQ.mjs +33 -0
  151. package/dist/ls-wMiTXZPQ.mjs.map +1 -0
  152. package/dist/mark-Dh9BErsf.mjs +29 -0
  153. package/dist/mark-Dh9BErsf.mjs.map +1 -0
  154. package/dist/onboarding-Bw_I8qpf.mjs +214 -0
  155. package/dist/onboarding-Bw_I8qpf.mjs.map +1 -0
  156. package/dist/{output-CTnO1lYt.d.mts → output-D2dDlyV2.d.mts} +1 -1
  157. package/dist/{output-BM7aBFwt.mjs → output-vzequvhd.mjs} +52 -9
  158. package/dist/output-vzequvhd.mjs.map +1 -0
  159. package/dist/{payload-CN11pUto.mjs → payload-CO4zbNr8.mjs} +17 -17
  160. package/dist/payload-CO4zbNr8.mjs.map +1 -0
  161. package/dist/profile-CNe2uWJi.mjs +172 -0
  162. package/dist/profile-CNe2uWJi.mjs.map +1 -0
  163. package/dist/{publish-akQWYsnL.mjs → publish-CzzucXQq.mjs} +4 -4
  164. package/dist/{publish-akQWYsnL.mjs.map → publish-CzzucXQq.mjs.map} +1 -1
  165. package/dist/{publish-CN3NTJ_r.mjs → publish-DRQkpxsz.mjs} +4 -4
  166. package/dist/{publish-CN3NTJ_r.mjs.map → publish-DRQkpxsz.mjs.map} +1 -1
  167. package/dist/{resolve-CyjMlaoJ.mjs → resolve-BYg5Gees.mjs} +5 -5
  168. package/dist/resolve-BYg5Gees.mjs.map +1 -0
  169. package/dist/{resolve-Bw5Po9yK.mjs → resolve-BlpMdnaM.mjs} +4 -4
  170. package/dist/resolve-BlpMdnaM.mjs.map +1 -0
  171. package/dist/{resolve-BogJOR7R.mjs → resolve-CUsHGcb-.mjs} +4 -4
  172. package/dist/resolve-CUsHGcb-.mjs.map +1 -0
  173. package/dist/{resolve-helpers-CahPoJ0Y.mjs → resolve-helpers-CoHYa2uk.mjs} +2 -2
  174. package/dist/{resolve-helpers-CahPoJ0Y.mjs.map → resolve-helpers-CoHYa2uk.mjs.map} +1 -1
  175. package/dist/{resolve-Bp1AfBmM.mjs → resolve-jdb1VqAG.mjs} +5 -5
  176. package/dist/resolve-jdb1VqAG.mjs.map +1 -0
  177. package/dist/rm-D-2iW1Cr.mjs +33 -0
  178. package/dist/rm-D-2iW1Cr.mjs.map +1 -0
  179. package/dist/run-Dnax6uhZ.mjs +130 -0
  180. package/dist/run-Dnax6uhZ.mjs.map +1 -0
  181. package/dist/self-update-CZywTwGd.mjs +1610 -0
  182. package/dist/self-update-CZywTwGd.mjs.map +1 -0
  183. package/dist/{set-ClbrGFGv.mjs → set-Dk28LAy5.mjs} +5 -5
  184. package/dist/set-Dk28LAy5.mjs.map +1 -0
  185. package/dist/{shared-C2EAn5h_.mjs → shared-d0_6ZPn_.mjs} +13 -9
  186. package/dist/shared-d0_6ZPn_.mjs.map +1 -0
  187. package/dist/show-DScu6mXz.mjs +39 -0
  188. package/dist/show-DScu6mXz.mjs.map +1 -0
  189. package/dist/status-8F6tgphP.mjs +23 -0
  190. package/dist/status-8F6tgphP.mjs.map +1 -0
  191. package/dist/{update-dc-72pUN.mjs → update-B1LGxV0n.mjs} +6 -6
  192. package/dist/{update-dc-72pUN.mjs.map → update-B1LGxV0n.mjs.map} +1 -1
  193. package/dist/{update-CHmckeo8.mjs → update-CXetpFT3.mjs} +4 -4
  194. package/dist/{update-CHmckeo8.mjs.map → update-CXetpFT3.mjs.map} +1 -1
  195. package/dist/{update-Duh-iVOZ.mjs → update-Dr4BW8U-.mjs} +6 -6
  196. package/dist/{update-Duh-iVOZ.mjs.map → update-Dr4BW8U-.mjs.map} +1 -1
  197. package/dist/{update-qfiC-9Og.mjs → update-bqcHRJPC.mjs} +6 -6
  198. package/dist/update-bqcHRJPC.mjs.map +1 -0
  199. package/dist/{update-CJjwg09n.mjs → update-dBtzzmkN.mjs} +5 -5
  200. package/dist/update-dBtzzmkN.mjs.map +1 -0
  201. package/dist/use-D7eKESSW.mjs +29 -0
  202. package/dist/use-D7eKESSW.mjs.map +1 -0
  203. package/dist/{whoami-UwcdRchK.mjs → whoami-CKSNd6zL.mjs} +6 -6
  204. package/dist/whoami-CKSNd6zL.mjs.map +1 -0
  205. package/package.json +15 -13
  206. package/LICENSE +0 -33
  207. package/dist/auth-OeKZZ_2x.mjs.map +0 -1
  208. package/dist/chunk-hT5z_Zn9.mjs +0 -35
  209. package/dist/config-store-WL7dNMS6.mjs.map +0 -1
  210. package/dist/delete-BEXOOFAJ.mjs.map +0 -1
  211. package/dist/delete-CGy-cV6k.mjs.map +0 -1
  212. package/dist/delete-CKqlAUT8.mjs.map +0 -1
  213. package/dist/delete-CcyrLNZv.mjs.map +0 -1
  214. package/dist/delete-Cjxehwj7.mjs.map +0 -1
  215. package/dist/document-output-C5PWbz2p.mjs.map +0 -1
  216. package/dist/edit-BuKMUNVC.mjs.map +0 -1
  217. package/dist/edit-DFnOnk4i.mjs.map +0 -1
  218. package/dist/editor-xrF-j3UE.mjs.map +0 -1
  219. package/dist/get-Doi-NKAh.mjs.map +0 -1
  220. package/dist/logout-Bslt_ZJ4.mjs +0 -11
  221. package/dist/logout-Bslt_ZJ4.mjs.map +0 -1
  222. package/dist/onboarding-C1t1yoay.mjs.map +0 -1
  223. package/dist/output-BM7aBFwt.mjs.map +0 -1
  224. package/dist/payload-CN11pUto.mjs.map +0 -1
  225. package/dist/resolve-BogJOR7R.mjs.map +0 -1
  226. package/dist/resolve-Bp1AfBmM.mjs.map +0 -1
  227. package/dist/resolve-Bw5Po9yK.mjs.map +0 -1
  228. package/dist/resolve-CyjMlaoJ.mjs.map +0 -1
  229. package/dist/set-ClbrGFGv.mjs.map +0 -1
  230. package/dist/shared-C2EAn5h_.mjs.map +0 -1
  231. package/dist/status-Cvyrrx-J.mjs +0 -22
  232. package/dist/status-Cvyrrx-J.mjs.map +0 -1
  233. package/dist/update-CJjwg09n.mjs.map +0 -1
  234. package/dist/update-qfiC-9Og.mjs.map +0 -1
  235. package/dist/whoami-UwcdRchK.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LexicalMarkdown.dev-C8e-eh6y.mjs","names":["$findMatchingParent","$findMatchingParent$1"],"sources":["../../../node_modules/.pnpm/@lexical+markdown@0.44.0/node_modules/@lexical/markdown/LexicalMarkdown.dev.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $isParagraphNode, $isTextNode, $getRoot, $isElementNode, $isDecoratorNode, $isLineBreakNode, $getSelection, $createTextNode, $createParagraphNode, $createLineBreakNode, $createTabNode, createState, $setState, $getState, $findMatchingParent as $findMatchingParent$1, mergeRegister, COLLABORATION_TAG, HISTORIC_TAG, $isRangeSelection, $addUpdateTag, HISTORY_PUSH_TAG, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $isRootOrShadowRoot, $createRangeSelection, $setSelection } from 'lexical';\nimport { $isListNode, $isListItemNode, ListNode, ListItemNode, $createListItemNode, $createListNode } from '@lexical/list';\nimport { $isQuoteNode, HeadingNode, QuoteNode, $isHeadingNode, $createQuoteNode, $createHeadingNode } from '@lexical/rich-text';\nimport { $findMatchingParent } from '@lexical/utils';\nimport { CodeNode, $createCodeNode, $isCodeNode } from '@lexical/code-core';\nimport { LinkNode, $isLinkNode, $createLinkNode, $isAutoLinkNode } from '@lexical/link';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction indexBy(list, callback) {\n const index = {};\n for (const item of list) {\n const key = callback(item);\n if (!key) {\n continue;\n }\n if (index[key]) {\n index[key].push(item);\n } else {\n index[key] = [item];\n }\n }\n return index;\n}\nfunction transformersByType(transformers) {\n const byType = indexBy(transformers, t => t.type);\n return {\n element: byType.element || [],\n multilineElement: byType['multiline-element'] || [],\n textFormat: byType['text-format'] || [],\n textMatch: byType['text-match'] || []\n };\n}\nconst PUNCTUATION_OR_SPACE = /[!-/:-@[-`{-~\\s]/;\nconst WHITESPACE = /[ \\t\\n\\r\\f]/;\nconst PUNCTUATION = /[!\"#$%&'()*+,\\-./:;<=>?@[\\]^_`{|}~]/;\nconst MARKDOWN_EMPTY_LINE_REG_EXP = /^\\s{0,3}$/;\nfunction isEmptyParagraph(node) {\n if (!$isParagraphNode(node)) {\n return false;\n }\n const firstChild = node.getFirstChild();\n return firstChild == null || node.getChildrenSize() === 1 && $isTextNode(firstChild) && MARKDOWN_EMPTY_LINE_REG_EXP.test(firstChild.getTextContent());\n}\nfunction unescapeText(value) {\n return value.replace(/\\\\([!-/:-@[-`{-~])/g, '$1').replace(/&#(\\d+);/g, (_, codePoint) => String.fromCodePoint(Number(codePoint)));\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Renders string from markdown. The selection is moved to the start after the operation.\n */\nfunction createMarkdownExport(transformers, shouldPreserveNewLines = false) {\n const byType = transformersByType(transformers);\n const elementTransformers = [...byType.multilineElement, ...byType.element];\n const isNewlineDelimited = !shouldPreserveNewLines;\n\n // Export only uses text formats that are responsible for single format\n // e.g. it will filter out *** (bold, italic) and instead use separate ** and *\n const textFormatTransformers = byType.textFormat.filter(transformer => transformer.format.length === 1)\n // Make sure all text transformers that contain 'code' in their format are at the end of the array. Otherwise, formatted code like\n // <strong><code>code</code></strong> will be exported as `**Bold Code**`, as the code format will be applied first, and the bold format\n // will be applied second and thus skipped entirely, as the code format will prevent any further formatting.\n .sort((a, b) => {\n return Number(a.format.includes('code')) - Number(b.format.includes('code'));\n });\n return node => {\n const output = [];\n const children = (node || $getRoot()).getChildren();\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const result = exportTopLevelElements(child, elementTransformers, textFormatTransformers, byType.textMatch, shouldPreserveNewLines);\n if (result != null) {\n output.push(\n // separate consecutive group of texts with a line break: eg. [\"hello\", \"world\"] -> [\"hello\", \"/nworld\"]\n isNewlineDelimited && i > 0 && !isEmptyParagraph(child) && !isEmptyParagraph(children[i - 1]) ? '\\n'.concat(result) : result);\n }\n }\n // Ensure consecutive groups of texts are at least \\n\\n apart while each empty paragraph render as a newline.\n // Eg. [\"hello\", \"\", \"\", \"hi\", \"\\nworld\"] -> \"hello\\n\\n\\nhi\\n\\nworld\"\n return output.join('\\n');\n };\n}\nfunction exportTopLevelElements(node, elementTransformers, textTransformersIndex, textMatchTransformers, shouldPreserveNewLines) {\n for (const transformer of elementTransformers) {\n if (!transformer.export) {\n continue;\n }\n const result = transformer.export(node, _node => exportChildren(_node, textTransformersIndex, textMatchTransformers, undefined, undefined, shouldPreserveNewLines));\n if (result != null) {\n return result;\n }\n }\n if ($isElementNode(node)) {\n return exportChildren(node, textTransformersIndex, textMatchTransformers, undefined, undefined, shouldPreserveNewLines);\n } else if ($isDecoratorNode(node)) {\n return node.getTextContent();\n } else {\n return null;\n }\n}\nfunction exportChildren(node, textTransformersIndex, textMatchTransformers, unclosedTags, unclosableTags, shouldPreserveNewLines = false) {\n const output = [];\n const children = node.getChildren();\n // keep track of unclosed tags from the very beginning\n if (!unclosedTags) {\n unclosedTags = [];\n }\n if (!unclosableTags) {\n unclosableTags = [];\n }\n mainLoop: for (const child of children) {\n for (const transformer of textMatchTransformers) {\n if (!transformer.export) {\n continue;\n }\n const result = transformer.export(child, parentNode => exportChildren(parentNode, textTransformersIndex, textMatchTransformers, unclosedTags,\n // Add current unclosed tags to the list of unclosable tags - we don't want nested tags from\n // textmatch transformers to close the outer ones, as that may result in invalid markdown.\n // E.g. **text [text**](https://lexical.io)\n // is invalid markdown, as the closing ** is inside the link.\n //\n [...unclosableTags, ...unclosedTags], shouldPreserveNewLines), (textNode, textContent) => exportTextFormat(textNode, textContent, textTransformersIndex, unclosedTags, unclosableTags, shouldPreserveNewLines));\n if (result != null) {\n output.push(result);\n continue mainLoop;\n }\n }\n if ($isLineBreakNode(child)) {\n output.push('\\n');\n } else if ($isTextNode(child)) {\n output.push(exportTextFormat(child, child.getTextContent(), textTransformersIndex, unclosedTags, unclosableTags, shouldPreserveNewLines));\n } else if ($isElementNode(child)) {\n // empty paragraph returns \"\"\n output.push(exportChildren(child, textTransformersIndex, textMatchTransformers, unclosedTags, unclosableTags, shouldPreserveNewLines));\n } else if ($isDecoratorNode(child)) {\n output.push(child.getTextContent());\n }\n }\n return output.join('');\n}\nfunction exportTextFormat(node, textContent, textTransformers,\n// unclosed tags include the markdown tags that haven't been closed yet, and their associated formats\nunclosedTags, unclosableTags, shouldPreserveNewLines = false) {\n // This function handles the case of a string looking like this: \" foo \"\n // Where it would be invalid markdown to generate: \"** foo **\"\n // If the node has no format, we use the original text.\n // Otherwise, we escape leading and trailing whitespaces to their corresponding code points,\n // ensuring the returned string maintains its original formatting, e.g., \"**&#32;&#32;&#32;foo&#32;&#32;&#32;**\".\n\n let output = textContent;\n if (!node.hasFormat('code')) {\n // Preserve literal backslashes when preserving source newlines.\n output = shouldPreserveNewLines ? output.replace(/([*_`~])/g, '\\\\$1') : output.replace(/([*_`~\\\\])/g, '\\\\$1');\n }\n\n // Extract leading and trailing whitespaces.\n // CommonMark flanking rules require formatting tags to be adjacent to non-whitespace characters.\n const match = output.match(/^(\\s*)(.*?)(\\s*)$/s) || ['', '', output, ''];\n const leadingSpace = match[1];\n const trimmedOutput = match[2];\n const trailingSpace = match[3];\n const isWhitespaceOnly = trimmedOutput === '';\n\n // the opening tags to be added to the result\n let openingTags = '';\n // the closing tags to be added to the result\n let closingTagsBefore = '';\n let closingTagsAfter = '';\n const prevNode = getTextSibling(node, true);\n const nextNode = getTextSibling(node, false);\n const applied = new Set();\n for (const transformer of textTransformers) {\n const format = transformer.format[0];\n const tag = transformer.tag;\n\n // dedup applied formats\n if (checkHasFormat(node, format) && !applied.has(format)) {\n applied.add(format);\n\n // append the tag to openingTags, if it's not applied to the previous nodes,\n // or the nodes before that (which would result in an unclosed tag)\n if (!checkHasFormat(prevNode, format) || !unclosedTags.find(element => element.tag === tag)) {\n unclosedTags.push({\n format,\n tag\n });\n openingTags += tag;\n }\n }\n }\n\n // close any tags in the same order they were applied, if necessary\n for (let i = 0; i < unclosedTags.length; i++) {\n const nodeHasFormat = hasFormat(node, unclosedTags[i].format);\n const nextNodeHasFormat = hasFormat(nextNode, unclosedTags[i].format);\n\n // prevent adding closing tag if next sibling will do it\n if (nodeHasFormat && nextNodeHasFormat) {\n continue;\n }\n const unhandledUnclosedTags = [...unclosedTags]; // Shallow copy to avoid modifying the original array\n\n while (unhandledUnclosedTags.length > i) {\n const unclosedTag = unhandledUnclosedTags.pop();\n\n // If tag is unclosable, don't close it and leave it in the original array,\n // So that it can be closed when it's no longer unclosable\n if (unclosableTags && unclosedTag && unclosableTags.find(element => element.tag === unclosedTag.tag)) {\n continue;\n }\n if (unclosedTag && typeof unclosedTag.tag === 'string') {\n if (!nodeHasFormat) {\n // Handles cases where the tag has not been closed before, e.g. if the previous node\n // was a text match transformer that did not account for closing tags of the next node (e.g. a link)\n closingTagsBefore += unclosedTag.tag;\n } else if (!nextNodeHasFormat) {\n closingTagsAfter += unclosedTag.tag;\n }\n }\n // Mutate the original array to remove the closed tag\n unclosedTags.pop();\n }\n break;\n }\n // If the node is entirely whitespace, we don't apply opening/closing tags around it.\n // However, it must still output closing tags from previous nodes.\n if (isWhitespaceOnly && !node.hasFormat('code')) {\n return closingTagsBefore + output;\n }\n\n // Flanking Compliance: Notice how openingTags and closingTagsAfter are placed INSIDE the whitespace boundaries!\n return closingTagsBefore + leadingSpace + openingTags + trimmedOutput + closingTagsAfter + trailingSpace;\n}\nfunction getTextSibling(node, backward) {\n const sibling = backward ? node.getPreviousSibling() : node.getNextSibling();\n if ($isTextNode(sibling)) {\n return sibling;\n }\n return null;\n}\nfunction hasFormat(node, format) {\n return $isTextNode(node) && node.hasFormat(format);\n}\nfunction checkHasFormat(n, f) {\n if (!hasFormat(n, f)) {\n return false;\n }\n if (f === 'code') {\n return true;\n }\n if (n && /^\\s*$/.test(n.getTextContent())) {\n return false;\n }\n return true;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction findOutermostTextFormatTransformer(textNode, textFormatTransformersIndex) {\n const textContent = textNode.getTextContent();\n\n // Find code span first. Emphasis delimiters inside inline elements (e.g., code spans)\n // should not be processed. Currently only code spans are handled; other inline elements\n // (e.g., links, raw HTML) may need similar treatment in the future.\n const codeRegex = textFormatTransformersIndex.fullMatchRegExpByTag['`'];\n const codeTransformer = textFormatTransformersIndex.transformersByTag['`'];\n const excludeRanges = [];\n let codeMatch = null;\n if (codeRegex && codeTransformer) {\n const globalRegex = new RegExp(codeRegex.source, 'g');\n const matches = Array.from(textContent.matchAll(globalRegex));\n for (const match of matches) {\n // Group 1 captures the character preceding the opening backtick (or an\n // empty string when the span starts at position 0). Offset past it so\n // startIndex points to the backtick itself.\n const startIndex = match.index + match[1].length;\n const endIndex = match.index + match[0].length;\n if (!codeMatch) {\n codeMatch = {\n content: match[3],\n endIndex,\n startIndex,\n tag: '`'\n };\n }\n excludeRanges.push({\n end: endIndex,\n start: startIndex\n });\n }\n }\n const delimiters = scanDelimiters(textContent, textFormatTransformersIndex, excludeRanges);\n const emphasisMatch = delimiters.length > 0 ? processEmphasis(textContent, delimiters, textFormatTransformersIndex) : null;\n let resultMatch = null;\n let resultTransformer = null;\n if (codeMatch && emphasisMatch) {\n if (emphasisMatch.startIndex <= codeMatch.startIndex && emphasisMatch.endIndex >= codeMatch.endIndex) {\n resultMatch = emphasisMatch;\n resultTransformer = textFormatTransformersIndex.transformersByTag[emphasisMatch.tag];\n } else {\n resultMatch = codeMatch;\n resultTransformer = codeTransformer;\n }\n } else if (codeMatch) {\n resultMatch = codeMatch;\n resultTransformer = codeTransformer;\n } else if (emphasisMatch) {\n resultMatch = emphasisMatch;\n resultTransformer = textFormatTransformersIndex.transformersByTag[emphasisMatch.tag];\n }\n if (!resultMatch || !resultTransformer) {\n return null;\n }\n const regexMatch = [textContent.slice(resultMatch.startIndex, resultMatch.endIndex), resultMatch.tag, resultMatch.content];\n regexMatch.index = resultMatch.startIndex;\n regexMatch.input = textContent;\n return {\n endIndex: resultMatch.endIndex,\n match: regexMatch,\n startIndex: resultMatch.startIndex,\n transformer: resultTransformer\n };\n}\nfunction scanDelimiters(text, transformersIndex, excludeRanges = []) {\n const delimiters = [];\n const delimiterChars = new Set(Object.keys(transformersIndex.transformersByTag).filter(tag => tag[0] !== '`').map(tag => tag[0]));\n const isEscaped = index => {\n let count = 0;\n for (let i = index - 1; i >= 0 && text[i] === '\\\\'; i--) {\n count++;\n }\n return count % 2 === 1;\n };\n const isInExcludedRange = index => {\n return excludeRanges.some(range => index >= range.start && index < range.end);\n };\n let i = 0;\n while (i < text.length) {\n const char = text[i];\n if (!delimiterChars.has(char) || isEscaped(i) || isInExcludedRange(i)) {\n i++;\n continue;\n }\n let len = 1;\n while (i + len < text.length && text[i + len] === char) {\n len++;\n }\n const canOpen = canEmphasis(char, text, i, len, true);\n const canClose = canEmphasis(char, text, i, len, false);\n if (canOpen || canClose) {\n delimiters.push({\n active: true,\n canClose,\n canOpen,\n char,\n index: i,\n length: len,\n originalLength: len\n });\n }\n i += len;\n }\n return delimiters;\n}\nfunction processEmphasis(text, delimiters, transformersIndex) {\n const openersBottom = {};\n let currentPos = 0;\n let result = null;\n while (currentPos < delimiters.length) {\n const closer = delimiters[currentPos];\n if (!closer.active || !closer.canClose || closer.length === 0) {\n currentPos++;\n continue;\n }\n const bottomKey = `${closer.char}${closer.canOpen}`;\n const bottom = openersBottom[bottomKey] ?? -1;\n let foundOpener = false;\n for (let openIdx = currentPos - 1; openIdx > bottom; openIdx--) {\n const opener = delimiters[openIdx];\n if (!opener.active || !opener.canOpen || opener.length === 0 || opener.char !== closer.char) {\n continue;\n }\n\n // Rule of 3\n if (opener.canClose || closer.canOpen) {\n const sum = opener.originalLength + closer.originalLength;\n if (sum % 3 === 0 && opener.originalLength % 3 !== 0 && closer.originalLength % 3 !== 0) {\n continue;\n }\n }\n const maxLen = Math.min(opener.length, closer.length);\n const matchedTag = Object.keys(transformersIndex.transformersByTag).filter(t => t[0] === opener.char && t.length <= maxLen).sort((a, b) => b.length - a.length)[0];\n if (!matchedTag) {\n continue;\n }\n foundOpener = true;\n const matchLen = matchedTag.length;\n const match = {\n content: text.slice(opener.index + opener.length, closer.index),\n endIndex: closer.index + matchLen,\n startIndex: opener.index + (opener.length - matchLen),\n tag: matchedTag\n };\n if (!result || match.startIndex < result.startIndex || match.startIndex === result.startIndex && match.endIndex > result.endIndex) {\n result = match;\n }\n for (let j = openIdx + 1; j < currentPos; j++) {\n delimiters[j].active = false;\n }\n opener.length -= matchLen;\n closer.length -= matchLen;\n opener.active = opener.length > 0;\n if (closer.length > 0) {\n closer.index += matchLen;\n } else {\n closer.active = false;\n currentPos++;\n }\n break;\n }\n if (!foundOpener) {\n openersBottom[bottomKey] = currentPos - 1;\n if (!closer.canOpen) {\n closer.active = false;\n }\n currentPos++;\n }\n }\n return result;\n}\nfunction canEmphasis(char, text, index, length, isOpen) {\n if (!isFlanking(text, index, length, isOpen)) {\n return false;\n }\n if (char === '*') {\n return true;\n }\n if (char === '_') {\n if (!isFlanking(text, index, length, !isOpen)) {\n return true;\n }\n const adjacentChar = isOpen ? text[index - 1] : text[index + length];\n return adjacentChar !== undefined && PUNCTUATION.test(adjacentChar);\n }\n return true;\n}\nfunction isFlanking(text, index, length, isLeft) {\n const charBefore = text[index - 1];\n const charAfter = text[index + length];\n const [primary, secondary] = isLeft ? [charAfter, charBefore] : [charBefore, charAfter];\n if (primary === undefined || WHITESPACE.test(primary)) {\n return false;\n }\n if (!PUNCTUATION.test(primary)) {\n return true;\n }\n return secondary === undefined || WHITESPACE.test(secondary) || PUNCTUATION.test(secondary);\n}\nfunction importTextFormatTransformer(textNode, startIndex, endIndex, transformer, match) {\n const textContent = textNode.getTextContent();\n\n // No text matches - we can safely process the text format match\n let transformedNode, nodeAfter, nodeBefore;\n\n // If matching full content there's no need to run splitText and can reuse existing textNode\n // to update its content and apply format. E.g. for **_Hello_** string after applying bold\n // format (**) it will reuse the same text node to apply italic (_)\n if (match[0] === textContent) {\n transformedNode = textNode;\n } else {\n if (startIndex === 0) {\n [transformedNode, nodeAfter] = textNode.splitText(endIndex);\n } else {\n [nodeBefore, transformedNode, nodeAfter] = textNode.splitText(startIndex, endIndex);\n }\n }\n transformedNode.setTextContent(match[2]);\n if (transformer) {\n for (const format of transformer.format) {\n if (!transformedNode.hasFormat(format)) {\n transformedNode.toggleFormat(format);\n }\n }\n }\n return {\n nodeAfter: nodeAfter,\n nodeBefore: nodeBefore,\n transformedNode: transformedNode\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction findOutermostTextMatchTransformer(textNode_, textMatchTransformers) {\n const textNode = textNode_;\n let foundMatchStartIndex = undefined;\n let foundMatchEndIndex = undefined;\n let foundMatchTransformer = undefined;\n let foundMatch = undefined;\n for (const transformer of textMatchTransformers) {\n if (!transformer.replace || !transformer.importRegExp) {\n continue;\n }\n const match = textNode.getTextContent().match(transformer.importRegExp);\n if (!match) {\n continue;\n }\n const startIndex = match.index || 0;\n const endIndex = transformer.getEndIndex ? transformer.getEndIndex(textNode, match) : startIndex + match[0].length;\n if (endIndex === false) {\n continue;\n }\n if (foundMatchStartIndex === undefined || foundMatchEndIndex === undefined ||\n // Wraps previous match or is strictly before it.\n startIndex < foundMatchStartIndex && (endIndex > foundMatchEndIndex || endIndex <= foundMatchStartIndex)) {\n foundMatchStartIndex = startIndex;\n foundMatchEndIndex = endIndex;\n foundMatchTransformer = transformer;\n foundMatch = match;\n }\n }\n if (foundMatchStartIndex === undefined || foundMatchEndIndex === undefined || foundMatchTransformer === undefined || foundMatch === undefined) {\n return null;\n }\n return {\n endIndex: foundMatchEndIndex,\n match: foundMatch,\n startIndex: foundMatchStartIndex,\n transformer: foundMatchTransformer\n };\n}\nfunction importFoundTextMatchTransformer(textNode, startIndex, endIndex, transformer, match) {\n let transformedNode, nodeAfter, nodeBefore;\n if (startIndex === 0) {\n [transformedNode, nodeAfter] = textNode.splitText(endIndex);\n } else {\n [nodeBefore, transformedNode, nodeAfter] = textNode.splitText(startIndex, endIndex);\n }\n if (!transformer.replace) {\n return null;\n }\n const potentialTransformedNode = transformer.replace(transformedNode, match);\n return {\n nodeAfter,\n nodeBefore,\n transformedNode: potentialTransformedNode || undefined\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Returns true if the node can contain transformable markdown.\n * Code nodes cannot contain transformable markdown.\n * For example, `code **bold**` should not be transformed to\n * <code>code <strong>bold</strong></code>.\n */\nfunction canContainTransformableMarkdown(node) {\n return $isTextNode(node) && !node.hasFormat('code');\n}\n\n/**\n * Handles applying both text format and text match transformers.\n * It finds the outermost text format or text match and applies it,\n * then recursively calls itself to apply the next outermost transformer,\n * until there are no more transformers to apply.\n */\nfunction importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers) {\n let foundTextFormat = findOutermostTextFormatTransformer(textNode, textFormatTransformersIndex);\n let foundTextMatch = findOutermostTextMatchTransformer(textNode, textMatchTransformers);\n if (foundTextFormat && foundTextMatch) {\n // Find the outermost transformer\n if (foundTextFormat.startIndex <= foundTextMatch.startIndex && foundTextFormat.endIndex >= foundTextMatch.endIndex ||\n // foundTextMatch is not contained within foundTextFormat\n foundTextMatch.startIndex > foundTextFormat.endIndex) {\n // foundTextFormat wraps foundTextMatch - apply foundTextFormat by setting foundTextMatch to null\n foundTextMatch = null;\n } else {\n // foundTextMatch wraps foundTextFormat - apply foundTextMatch by setting foundTextFormat to null\n foundTextFormat = null;\n }\n }\n if (foundTextFormat) {\n const result = importTextFormatTransformer(textNode, foundTextFormat.startIndex, foundTextFormat.endIndex, foundTextFormat.transformer, foundTextFormat.match);\n if (canContainTransformableMarkdown(result.nodeAfter)) {\n importTextTransformers(result.nodeAfter, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.nodeBefore)) {\n importTextTransformers(result.nodeBefore, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.transformedNode)) {\n importTextTransformers(result.transformedNode, textFormatTransformersIndex, textMatchTransformers);\n }\n } else if (foundTextMatch) {\n const result = importFoundTextMatchTransformer(textNode, foundTextMatch.startIndex, foundTextMatch.endIndex, foundTextMatch.transformer, foundTextMatch.match);\n if (!result) {\n return;\n }\n if (canContainTransformableMarkdown(result.nodeAfter)) {\n importTextTransformers(result.nodeAfter, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.nodeBefore)) {\n importTextTransformers(result.nodeBefore, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.transformedNode)) {\n importTextTransformers(result.transformedNode, textFormatTransformersIndex, textMatchTransformers);\n }\n }\n\n // Handle escape characters\n const textContent = textNode.getTextContent();\n const unescapedText = unescapeText(textContent);\n textNode.setTextContent(unescapedText);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n */\nfunction createMarkdownImport(transformers, shouldPreserveNewLines = false) {\n const byType = transformersByType(transformers);\n const textFormatTransformersIndex = createTextFormatTransformersIndex(byType.textFormat);\n return (markdownString, node) => {\n const lines = markdownString.split('\\n');\n const linesLength = lines.length;\n const root = node || $getRoot();\n root.clear();\n for (let i = 0; i < linesLength; i++) {\n const lineText = lines[i];\n const [imported, shiftedIndex] = $importMultiline(lines, i, byType.multilineElement, root);\n if (imported) {\n // If a multiline markdown element was imported, we don't want to process the lines that were part of it anymore.\n // There could be other sub-markdown elements (both multiline and normal ones) matching within this matched multiline element's children.\n // However, it would be the responsibility of the matched multiline transformer to decide how it wants to handle them.\n // We cannot handle those, as there is no way for us to know how to maintain the correct order of generated lexical nodes for possible children.\n i = shiftedIndex; // Next loop will start from the line after the last line of the multiline element\n continue;\n }\n $importBlocks(lineText, root, byType.element, textFormatTransformersIndex, byType.textMatch, shouldPreserveNewLines);\n }\n const children = root.getChildren();\n for (const child of children) {\n // By default, removing empty paragraphs as md does not really\n // allow empty lines and uses them as delimiter.\n // If you need empty lines set shouldPreserveNewLines = true.\n if (!shouldPreserveNewLines && isEmptyParagraph(child) && root.getChildrenSize() > 1) {\n child.remove();\n continue;\n }\n // Convert all '\\t' into TabNode.\n if ($isElementNode(child)) {\n for (const textNode of child.getAllTextNodes()) {\n $normalizeMarkdownTextNode(textNode);\n }\n }\n }\n if ($getSelection() !== null) {\n root.selectStart();\n }\n };\n}\n\n/**\n *\n * @returns first element of the returned tuple is a boolean indicating if a multiline element was imported. The second element is the index of the last line that was processed.\n */\nfunction $importMultiline(lines, startLineIndex, multilineElementTransformers, rootNode) {\n for (const transformer of multilineElementTransformers) {\n const {\n handleImportAfterStartMatch,\n regExpEnd,\n regExpStart,\n replace\n } = transformer;\n const startMatch = lines[startLineIndex].match(regExpStart);\n if (!startMatch) {\n continue; // Try next transformer\n }\n if (handleImportAfterStartMatch) {\n const result = handleImportAfterStartMatch({\n lines,\n rootNode,\n startLineIndex,\n startMatch,\n transformer\n });\n if (result === null) {\n continue;\n } else if (result) {\n return result;\n }\n }\n const regexpEndRegex = typeof regExpEnd === 'object' && 'regExp' in regExpEnd ? regExpEnd.regExp : regExpEnd;\n const isEndOptional = regExpEnd && typeof regExpEnd === 'object' && 'optional' in regExpEnd ? regExpEnd.optional : !regExpEnd;\n let endLineIndex = startLineIndex;\n const linesLength = lines.length;\n\n // check every single line for the closing match. It could also be on the same line as the opening match.\n while (endLineIndex < linesLength) {\n const endMatch = regexpEndRegex ? lines[endLineIndex].match(regexpEndRegex) : null;\n if (!endMatch) {\n if (!isEndOptional || isEndOptional && endLineIndex < linesLength - 1 // Optional end, but didn't reach the end of the document yet => continue searching for potential closing match\n ) {\n endLineIndex++;\n continue; // Search next line for closing match\n }\n }\n\n // Now, check if the closing match matched is the same as the opening match.\n // If it is, we need to continue searching for the actual closing match.\n if (endMatch && startLineIndex === endLineIndex && endMatch.index === startMatch.index) {\n endLineIndex++;\n continue; // Search next line for closing match\n }\n\n // At this point, we have found the closing match. Next: calculate the lines in between open and closing match\n // This should not include the matches themselves, and be split up by lines\n const linesInBetween = [];\n if (endMatch && startLineIndex === endLineIndex) {\n linesInBetween.push(lines[startLineIndex].slice(startMatch[0].length, -endMatch[0].length));\n } else {\n for (let i = startLineIndex; i <= endLineIndex; i++) {\n if (i === startLineIndex) {\n const text = lines[i].slice(startMatch[0].length);\n linesInBetween.push(text); // Also include empty text\n } else if (i === endLineIndex && endMatch) {\n const text = lines[i].slice(0, -endMatch[0].length);\n linesInBetween.push(text); // Also include empty text\n } else {\n linesInBetween.push(lines[i]);\n }\n }\n }\n if (replace(rootNode, null, startMatch, endMatch, linesInBetween, true) !== false) {\n // Return here. This $importMultiline function is run line by line and should only process a single multiline element at a time.\n return [true, endLineIndex];\n }\n\n // The replace function returned false, despite finding the matching open and close tags => this transformer does not want to handle it.\n // Thus, we continue letting the remaining transformers handle the passed lines of text from the beginning\n break;\n }\n }\n\n // No multiline transformer handled this line successfully\n return [false, startLineIndex];\n}\nfunction $importBlocks(lineText, rootNode, elementTransformers, textFormatTransformersIndex, textMatchTransformers, shouldPreserveNewLines) {\n const textNode = $createTextNode(lineText);\n const elementNode = $createParagraphNode();\n elementNode.append(textNode);\n rootNode.append(elementNode);\n for (const {\n regExp,\n replace\n } of elementTransformers) {\n const match = lineText.match(regExp);\n if (match) {\n textNode.setTextContent(lineText.slice(match[0].length));\n if (replace(elementNode, [textNode], match, true) !== false) {\n break;\n }\n }\n }\n importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers);\n\n // If no transformer found and we left with original paragraph node\n // can check if its content can be appended to the previous node\n // if it's a paragraph, quote or list\n if (elementNode.isAttached() && lineText.length > 0) {\n const previousNode = elementNode.getPreviousSibling();\n if (!shouldPreserveNewLines && (\n // Only append if we're not preserving newlines\n $isParagraphNode(previousNode) || $isQuoteNode(previousNode) || $isListNode(previousNode))) {\n let targetNode = previousNode;\n if ($isListNode(previousNode)) {\n const lastDescendant = previousNode.getLastDescendant();\n if (lastDescendant == null) {\n targetNode = null;\n } else {\n targetNode = $findMatchingParent(lastDescendant, $isListItemNode);\n }\n }\n if (targetNode != null && targetNode.getTextContentSize() > 0) {\n const lastChild = targetNode.getLastChild();\n if ($isTextNode(lastChild)) {\n const lastText = lastChild.getTextContent();\n if (lastText.endsWith('\\\\')) {\n lastChild.setTextContent(lastText.slice(0, -1));\n } else if (/ {2,}$/.test(lastText)) {\n lastChild.setTextContent(lastText.replace(/ {2,}$/, ''));\n }\n }\n targetNode.splice(targetNode.getChildrenSize(), 0, [$createLineBreakNode(), ...elementNode.getChildren()]);\n elementNode.remove();\n }\n }\n }\n}\n\n// Look in node for '\\t' and create a TabNode for each occurrence.\nfunction $normalizeMarkdownTextNode(textNode) {\n const tabOffsets = new Set();\n const text = textNode.getTextContent();\n let index = text.indexOf('\\t');\n\n // Find all tab occurrences\n while (index !== -1) {\n tabOffsets.add(index);\n tabOffsets.add(index + 1);\n index = text.indexOf('\\t', index + 1);\n }\n\n // Split node to isolate each tab then replace '\\t' into TabNode\n const splitNodes = textNode.splitText(...tabOffsets);\n splitNodes.forEach(node => {\n if (node.getTextContent() === '\\t') {\n node.replace($createTabNode());\n }\n });\n}\nfunction createTextFormatTransformersIndex(textTransformers) {\n const transformersByTag = {};\n const fullMatchRegExpByTag = {};\n const openTagsRegExp = [];\n for (const transformer of textTransformers) {\n const {\n tag\n } = transformer;\n transformersByTag[tag] = transformer;\n const tagRegExp = tag.replace(/(\\*|\\^|\\+)/g, '\\\\$1');\n openTagsRegExp.push(tagRegExp);\n\n // Single-char tag (e.g. \"*\")\n if (tag.length === 1) {\n if (tag === '`') {\n // Capture the preceding character in group 1 (empty string at start-of-string\n // via the ^ branch) rather than using a negative lookbehind, which is not\n // supported in Safari < 16.4. Consumers must add match[1].length to\n // match.index to find the real start of the span (see importTextFormatTransformer.ts).\n fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\\\`])(\\`)((?:\\\\\\\\\\`|[^\\`])+?)(\\`)(?!\\`)`);\n } else {\n fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\${tagRegExp}])(${tagRegExp})((\\\\\\\\${tagRegExp})?.*?[^${tagRegExp}\\\\s](\\\\\\\\${tagRegExp})?)(${tagRegExp})(?![\\\\\\\\${tagRegExp}])`);\n }\n } else {\n // Multi-char tags (e.g. \"**\")\n fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\])(${tagRegExp})((\\\\\\\\${tagRegExp})?.*?[^\\\\s](\\\\\\\\${tagRegExp})?)(${tagRegExp})(?!\\\\\\\\)`);\n }\n }\n return {\n // Reg exp to find open tag + content + close tag\n fullMatchRegExpByTag,\n // Regexp to locate *any* potential opening tag (longest first).\n // The former (?<!\\\\) escape guard has been removed — the delimiter\n // scanner's isEscaped() check handles escape filtering at match time.\n openTagsRegExp: new RegExp(`(${openTagsRegExp.join('|')})`, 'g'),\n transformersByTag\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst ORDERED_LIST_REGEX = /^(\\s*)(\\d{1,})\\.\\s/;\nconst UNORDERED_LIST_REGEX = /^(\\s*)[-*+]\\s/;\nconst CHECK_LIST_REGEX = /^(\\s*)(?:[-*+]\\s)?\\s?(\\[(\\s|x)?\\])\\s/i;\nconst HEADING_REGEX = /^(#{1,6})\\s/;\nconst QUOTE_REGEX = /^>\\s/;\nconst CODE_START_REGEX = /^([ \\t]*`{3,})([\\w-]+)?[ \\t]?/;\nconst CODE_END_REGEX = /^[ \\t]*`{3,}$/;\nconst CODE_SINGLE_LINE_REGEX = /^[ \\t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/;\nconst TABLE_ROW_REG_EXP = /^(?:\\|)(.+)(?:\\|)\\s?$/;\nconst TABLE_ROW_DIVIDER_REG_EXP = /^(\\| ?:?-*:? ?)+\\|\\s?$/;\nconst TAG_START_REGEX = /^<[a-z_][\\w-]*(?:\\s[^<>]*)?\\/?>/i;\nconst TAG_END_REGEX = /^<\\/[a-z_][\\w-]*\\s*>/i;\nconst ENDS_WITH = regex => new RegExp(`(?:${regex.source})$`, regex.flags);\nconst listMarkerState = createState('mdListMarker', {\n parse: v => typeof v === 'string' && /^[-*+]$/.test(v) ? v : '-',\n resetOnCopyNode: true\n});\nconst codeFenceState = createState('mdCodeFence', {\n parse: val => {\n if (typeof val === 'string' && /^`{3,}$/.test(val)) {\n return val;\n }\n return '```';\n },\n resetOnCopyNode: true\n});\nconst createBlockNode = createNode => {\n return (parentNode, children, match, isImport) => {\n const node = createNode(match);\n node.append(...children);\n parentNode.replace(node);\n if (!isImport) {\n node.select(0, 0);\n }\n };\n};\n\n// Amount of spaces that define indentation level\n// TODO: should be an option\nconst LIST_INDENT_SIZE = 4;\nfunction getIndent(whitespaces) {\n const tabs = whitespaces.match(/\\t/g);\n const spaces = whitespaces.match(/ /g);\n let indent = 0;\n if (tabs) {\n indent += tabs.length;\n }\n if (spaces) {\n indent += Math.floor(spaces.length / LIST_INDENT_SIZE);\n }\n return indent;\n}\nconst listReplace = listType => {\n return (parentNode, children, match, isImport) => {\n const previousNode = parentNode.getPreviousSibling();\n const nextNode = parentNode.getNextSibling();\n const listItem = $createListItemNode(listType === 'check' ? match[3] === 'x' : undefined);\n const firstMatchChar = match[0].trim()[0];\n const listMarker = (listType === 'bullet' || listType === 'check') && firstMatchChar === listMarkerState.parse(firstMatchChar) ? firstMatchChar : undefined;\n if ($isListNode(nextNode) && nextNode.getListType() === listType) {\n if (listMarker) {\n $setState(nextNode, listMarkerState, listMarker);\n }\n const firstChild = nextNode.getFirstChild();\n if (firstChild !== null) {\n firstChild.insertBefore(listItem);\n } else {\n // should never happen, but let's handle gracefully, just in case.\n nextNode.append(listItem);\n }\n parentNode.remove();\n } else if ($isListNode(previousNode) && previousNode.getListType() === listType) {\n if (listMarker) {\n $setState(previousNode, listMarkerState, listMarker);\n }\n previousNode.append(listItem);\n parentNode.remove();\n } else {\n const list = $createListNode(listType, listType === 'number' ? Number(match[2]) : undefined);\n if (listMarker) {\n $setState(list, listMarkerState, listMarker);\n }\n list.append(listItem);\n parentNode.replace(list);\n }\n listItem.append(...children);\n if (!isImport) {\n listItem.select(0, 0);\n }\n const indent = getIndent(match[1]);\n if (indent) {\n listItem.setIndent(indent);\n }\n };\n};\nconst $listExport = (listNode, exportChildren, depth) => {\n const output = [];\n const children = listNode.getChildren();\n let index = 0;\n for (const listItemNode of children) {\n if ($isListItemNode(listItemNode)) {\n if (listItemNode.getChildrenSize() === 1) {\n const firstChild = listItemNode.getFirstChild();\n if ($isListNode(firstChild)) {\n output.push($listExport(firstChild, exportChildren, depth + 1));\n continue;\n }\n }\n const indent = ' '.repeat(depth * LIST_INDENT_SIZE);\n const listType = listNode.getListType();\n const listMarker = $getState(listNode, listMarkerState);\n const prefix = listType === 'number' ? `${listNode.getStart() + index}. ` : listType === 'check' ? `${listMarker} [${listItemNode.getChecked() ? 'x' : ' '}] ` : listMarker + ' ';\n let childrenText = exportChildren(listItemNode);\n if (listType !== 'number') {\n childrenText = childrenText.replace(/^(\\s{0,3}\\d+)(\\.\\s)/, '$1\\\\$2');\n }\n output.push(indent + prefix + childrenText);\n index++;\n }\n }\n return output.join('\\n');\n};\nconst HEADING = {\n dependencies: [HeadingNode],\n export: (node, exportChildren) => {\n if (!$isHeadingNode(node)) {\n return null;\n }\n const level = Number(node.getTag().slice(1));\n return '#'.repeat(level) + ' ' + exportChildren(node);\n },\n regExp: HEADING_REGEX,\n replace: createBlockNode(match => {\n const tag = 'h' + match[1].length;\n return $createHeadingNode(tag);\n }),\n type: 'element'\n};\nconst QUOTE = {\n dependencies: [QuoteNode],\n export: (node, exportChildren) => {\n if (!$isQuoteNode(node)) {\n return null;\n }\n const lines = exportChildren(node).split('\\n');\n const output = [];\n for (const line of lines) {\n output.push('> ' + line);\n }\n return output.join('\\n');\n },\n regExp: QUOTE_REGEX,\n replace: (parentNode, children, _match, isImport) => {\n if (isImport) {\n const previousNode = parentNode.getPreviousSibling();\n if ($isQuoteNode(previousNode)) {\n previousNode.splice(previousNode.getChildrenSize(), 0, [$createLineBreakNode(), ...children]);\n parentNode.remove();\n return;\n }\n }\n const node = $createQuoteNode();\n node.append(...children);\n parentNode.replace(node);\n if (!isImport) {\n node.select(0, 0);\n }\n },\n type: 'element'\n};\nconst CODE = {\n dependencies: [CodeNode],\n export: node => {\n if (!$isCodeNode(node)) {\n return null;\n }\n const textContent = node.getTextContent();\n let fence = $getState(node, codeFenceState);\n if (textContent.indexOf(fence) > -1) {\n const backticks = textContent.match(/`{3,}/g);\n if (backticks) {\n const maxLength = Math.max(...backticks.map(b => b.length));\n fence = '`'.repeat(maxLength + 1);\n }\n }\n return fence + (node.getLanguage() || '') + (textContent ? '\\n' + textContent : '') + '\\n' + fence;\n },\n handleImportAfterStartMatch: ({\n lines,\n rootNode,\n startLineIndex,\n startMatch\n }) => {\n const fence = startMatch[1];\n const fenceLength = fence.trim().length;\n const currentLine = lines[startLineIndex];\n const afterFenceIndex = startMatch.index + fence.length;\n const afterFence = currentLine.slice(afterFenceIndex);\n const singleLineEndRegex = new RegExp(`\\`{${fenceLength},}$`);\n if (singleLineEndRegex.test(afterFence)) {\n const endMatch = afterFence.match(singleLineEndRegex);\n const content = afterFence.slice(0, afterFence.lastIndexOf(endMatch[0]));\n const fakeStartMatch = [...startMatch];\n fakeStartMatch[2] = '';\n CODE.replace(rootNode, null, fakeStartMatch, endMatch, [content], true);\n return [true, startLineIndex];\n }\n const multilineEndRegex = new RegExp(`^[ \\\\t]*\\`{${fenceLength},}$`);\n for (let i = startLineIndex + 1; i < lines.length; i++) {\n const line = lines[i];\n if (multilineEndRegex.test(line)) {\n const endMatch = line.match(multilineEndRegex);\n const linesInBetween = lines.slice(startLineIndex + 1, i);\n const afterFullMatch = currentLine.slice(startMatch[0].length);\n if (afterFullMatch.length > 0) {\n linesInBetween.unshift(afterFullMatch);\n }\n CODE.replace(rootNode, null, startMatch, endMatch, linesInBetween, true);\n return [true, i];\n }\n }\n const linesInBetween = lines.slice(startLineIndex + 1);\n const afterFullMatch = currentLine.slice(startMatch[0].length);\n if (afterFullMatch.length > 0) {\n linesInBetween.unshift(afterFullMatch);\n }\n CODE.replace(rootNode, null, startMatch, null, linesInBetween, true);\n return [true, lines.length - 1];\n },\n regExpEnd: {\n optional: true,\n regExp: CODE_END_REGEX\n },\n regExpStart: CODE_START_REGEX,\n replace: (rootNode, children, startMatch, endMatch, linesInBetween, isImport) => {\n let codeBlockNode;\n let code;\n const fence = startMatch[1] ? startMatch[1].trim() : '```';\n const language = startMatch[2] || undefined;\n if (!children && linesInBetween) {\n if (linesInBetween.length === 1) {\n if (endMatch) {\n codeBlockNode = $createCodeNode(language);\n code = linesInBetween[0];\n } else {\n codeBlockNode = $createCodeNode(language);\n code = linesInBetween[0].startsWith(' ') ? linesInBetween[0].slice(1) : linesInBetween[0];\n }\n } else {\n codeBlockNode = $createCodeNode(language);\n if (linesInBetween.length > 0) {\n if (linesInBetween[0].trim().length === 0) {\n linesInBetween.shift();\n } else if (linesInBetween[0].startsWith(' ')) {\n linesInBetween[0] = linesInBetween[0].slice(1);\n }\n }\n while (linesInBetween.length > 0 && !linesInBetween[linesInBetween.length - 1].length) {\n linesInBetween.pop();\n }\n code = linesInBetween.join('\\n');\n }\n $setState(codeBlockNode, codeFenceState, fence);\n const textNode = $createTextNode(code);\n codeBlockNode.append(textNode);\n rootNode.append(codeBlockNode);\n } else if (children) {\n createBlockNode(match => {\n return $createCodeNode(match ? match[2] : undefined);\n })(rootNode, children, startMatch, isImport);\n }\n },\n type: 'multiline-element'\n};\nconst UNORDERED_LIST = {\n dependencies: [ListNode, ListItemNode],\n export: (node, exportChildren) => {\n return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n },\n regExp: UNORDERED_LIST_REGEX,\n replace: listReplace('bullet'),\n type: 'element'\n};\nconst CHECK_LIST = {\n dependencies: [ListNode, ListItemNode],\n export: (node, exportChildren) => {\n return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n },\n regExp: CHECK_LIST_REGEX,\n replace: listReplace('check'),\n type: 'element'\n};\nconst ORDERED_LIST = {\n dependencies: [ListNode, ListItemNode],\n export: (node, exportChildren) => {\n return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n },\n regExp: ORDERED_LIST_REGEX,\n replace: listReplace('number'),\n type: 'element'\n};\nconst INLINE_CODE = {\n format: ['code'],\n tag: '`',\n type: 'text-format'\n};\nconst HIGHLIGHT = {\n format: ['highlight'],\n tag: '==',\n type: 'text-format'\n};\nconst BOLD_ITALIC_STAR = {\n format: ['bold', 'italic'],\n tag: '***',\n type: 'text-format'\n};\nconst BOLD_ITALIC_UNDERSCORE = {\n format: ['bold', 'italic'],\n intraword: false,\n tag: '___',\n type: 'text-format'\n};\nconst BOLD_STAR = {\n format: ['bold'],\n tag: '**',\n type: 'text-format'\n};\nconst BOLD_UNDERSCORE = {\n format: ['bold'],\n intraword: false,\n tag: '__',\n type: 'text-format'\n};\nconst STRIKETHROUGH = {\n format: ['strikethrough'],\n tag: '~~',\n type: 'text-format'\n};\nconst ITALIC_STAR = {\n format: ['italic'],\n tag: '*',\n type: 'text-format'\n};\nconst ITALIC_UNDERSCORE = {\n format: ['italic'],\n intraword: false,\n tag: '_',\n type: 'text-format'\n};\n\n// Order of text transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n// - then longer tags match (e.g. ** or __ should go before * or _)\nconst LINK = {\n dependencies: [LinkNode],\n export: (node, exportChildren, exportFormat) => {\n if (!$isLinkNode(node) || $isAutoLinkNode(node)) {\n return null;\n }\n const textContent = exportChildren(node);\n let title = node.getTitle();\n if (title != null) {\n title = title.replace(/([\\\\\"])/g, '\\\\$1');\n }\n const linkContent = title ? `[${textContent}](${node.getURL()} \"${title}\")` : `[${textContent}](${node.getURL()})`;\n return linkContent;\n },\n importRegExp: /(?:\\[(.+?)\\])(?:\\((?:([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?)\\))/,\n regExp: /(?:\\[([^[\\]]*(?:\\[[^[\\]]*\\][^[\\]]*)*)\\])(?:\\((?:([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?)\\))$/,\n replace: (textNode, match) => {\n // https://spec.commonmark.org/0.31.2/#inline-link\n if ($findMatchingParent$1(textNode, $isLinkNode)) {\n return;\n }\n const [, linkText, rawLinkUrl, rawLinkTitle] = match;\n const linkUrl = rawLinkUrl != null ? unescapeText(rawLinkUrl) : undefined;\n const linkTitle = rawLinkTitle != null ? unescapeText(rawLinkTitle) : undefined;\n const linkNode = $createLinkNode(linkUrl, {\n title: linkTitle\n });\n const openBracketAmount = linkText.split('[').length - 1;\n const closeBracketAmount = linkText.split(']').length - 1;\n let parsedLinkText = linkText;\n let outsideLinkText = '';\n if (openBracketAmount < closeBracketAmount) {\n return;\n } else if (openBracketAmount > closeBracketAmount) {\n const linkTextParts = linkText.split('[');\n outsideLinkText = '[' + linkTextParts[0];\n parsedLinkText = linkTextParts.slice(1).join('[');\n }\n const linkTextNode = $createTextNode(parsedLinkText);\n linkTextNode.setFormat(textNode.getFormat());\n linkNode.append(linkTextNode);\n textNode.replace(linkNode);\n if (outsideLinkText) {\n linkNode.insertBefore($createTextNode(outsideLinkText));\n }\n return linkTextNode;\n },\n trigger: ')',\n type: 'text-match'\n};\nconst ELEMENT_TRANSFORMERS = [HEADING, QUOTE, UNORDERED_LIST, ORDERED_LIST];\nconst MULTILINE_ELEMENT_TRANSFORMERS = [CODE];\n\n// Order of text format transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n// - then longer tags match (e.g. ** or __ should go before * or _)\nconst TEXT_FORMAT_TRANSFORMERS = [INLINE_CODE, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, HIGHLIGHT, ITALIC_STAR, ITALIC_UNDERSCORE, STRIKETHROUGH];\nconst TEXT_MATCH_TRANSFORMERS = [LINK];\nconst TRANSFORMERS = [...ELEMENT_TRANSFORMERS, ...MULTILINE_ELEMENT_TRANSFORMERS, ...TEXT_FORMAT_TRANSFORMERS, ...TEXT_MATCH_TRANSFORMERS];\nfunction normalizeMarkdown(input, shouldMergeAdjacentLines = false) {\n const lines = input.split('\\n');\n let inCodeBlock = false;\n const sanitizedLines = [];\n for (let i = 0; i < lines.length; i++) {\n const rawLine = lines[i];\n const line = rawLine.trimEnd();\n const lastLine = sanitizedLines[sanitizedLines.length - 1];\n\n // Code blocks of ```single line``` don't toggle the inCodeBlock flag\n if (CODE_SINGLE_LINE_REGEX.test(line)) {\n sanitizedLines.push(line);\n continue;\n }\n\n // Detect the start or end of a code block\n if (CODE_START_REGEX.test(line) || CODE_END_REGEX.test(line)) {\n inCodeBlock = !inCodeBlock;\n sanitizedLines.push(line);\n continue;\n }\n\n // If we are inside a code block, keep the line unchanged\n if (inCodeBlock) {\n sanitizedLines.push(rawLine);\n continue;\n }\n\n // In markdown the concept of \"empty paragraphs\" does not exist.\n // Blocks must be separated by an empty line. Non-empty adjacent lines must be merged.\n if (line === '' || lastLine === '' || !lastLine || HEADING_REGEX.test(lastLine) || HEADING_REGEX.test(line) || QUOTE_REGEX.test(line) || ORDERED_LIST_REGEX.test(line) || UNORDERED_LIST_REGEX.test(line) || CHECK_LIST_REGEX.test(line) || TABLE_ROW_REG_EXP.test(line) || TABLE_ROW_DIVIDER_REG_EXP.test(line) || !shouldMergeAdjacentLines || TAG_START_REGEX.test(line) || TAG_END_REGEX.test(line) || ENDS_WITH(TAG_END_REGEX).test(lastLine) || ENDS_WITH(TAG_START_REGEX).test(lastLine) || CODE_END_REGEX.test(lastLine)) {\n // When not merging, preserve trailing whitespace (e.g. hard line-break\n // markers \" \" or non-breaking spaces). Whitespace-only lines still\n // collapse to '' because trimEnd() already reduced them, so they\n // continue to act as paragraph separators.\n sanitizedLines.push(!shouldMergeAdjacentLines && line !== '' ? rawLine : line);\n } else {\n sanitizedLines[sanitizedLines.length - 1] = lastLine + ' ' + line.trimStart();\n }\n }\n return sanitizedLines.join('\\n');\n}\n\nfunction runElementTransformers(parentNode, anchorNode, anchorOffset, elementTransformers) {\n const grandParentNode = parentNode.getParent();\n if (!$isRootOrShadowRoot(grandParentNode) || parentNode.getFirstChild() !== anchorNode) {\n return false;\n }\n const textContent = anchorNode.getTextContent();\n\n // Checking for anchorOffset position to prevent any checks for cases when caret is too far\n // from a line start to be a part of block-level markdown trigger.\n //\n // TODO:\n // Can have a quick check if caret is close enough to the beginning of the string (e.g. offset less than 10-20)\n // since otherwise it won't be a markdown shortcut, but tables are exception\n if (textContent[anchorOffset - 1] !== ' ') {\n return false;\n }\n for (const {\n regExp,\n replace\n } of elementTransformers) {\n const match = textContent.match(regExp);\n if (match && match[0].length === (match[0].endsWith(' ') ? anchorOffset : anchorOffset - 1)) {\n const nextSiblings = anchorNode.getNextSiblings();\n const [leadingNode, remainderNode] = anchorNode.splitText(anchorOffset);\n const siblings = remainderNode ? [remainderNode, ...nextSiblings] : nextSiblings;\n if (replace(parentNode, siblings, match, false) !== false) {\n leadingNode.remove();\n return true;\n }\n }\n }\n return false;\n}\nfunction runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, elementTransformers, triggerOnEnter) {\n const grandParentNode = parentNode.getParent();\n if (!$isRootOrShadowRoot(grandParentNode) || parentNode.getFirstChild() !== anchorNode) {\n return false;\n }\n const textContent = anchorNode.getTextContent();\n if (!triggerOnEnter) {\n // Checking for anchorOffset position to prevent any checks for cases when caret is too far\n // from a line start to be a part of block-level markdown trigger.\n //\n // TODO:\n // Can have a quick check if caret is close enough to the beginning of the string (e.g. offset less than 10-20)\n // since otherwise it won't be a markdown shortcut, but tables are exception\n if (textContent[anchorOffset - 1] !== ' ') {\n return false;\n }\n }\n for (const {\n regExpStart,\n replace,\n regExpEnd\n } of elementTransformers) {\n if (regExpEnd && !('optional' in regExpEnd) || regExpEnd && 'optional' in regExpEnd && !regExpEnd.optional) {\n continue;\n }\n const match = textContent.match(regExpStart);\n if (match) {\n const matchLength = triggerOnEnter || match[0].endsWith(' ') ? anchorOffset : anchorOffset - 1;\n if (match[0].length !== matchLength) {\n continue;\n }\n const nextSiblings = anchorNode.getNextSiblings();\n const [leadingNode, remainderNode] = anchorNode.splitText(anchorOffset);\n const siblings = remainderNode ? [remainderNode, ...nextSiblings] : nextSiblings;\n if (replace(parentNode, siblings, match, null, null, false) !== false) {\n leadingNode.remove();\n return true;\n }\n }\n }\n return false;\n}\nfunction runTextMatchTransformers(anchorNode, anchorOffset, transformersByTrigger) {\n let textContent = anchorNode.getTextContent();\n const lastChar = textContent[anchorOffset - 1];\n const transformers = transformersByTrigger[lastChar];\n if (transformers == null) {\n return false;\n }\n\n // If typing in the middle of content, remove the tail to do\n // reg exp match up to a string end (caret position)\n if (anchorOffset < textContent.length) {\n textContent = textContent.slice(0, anchorOffset);\n }\n for (const transformer of transformers) {\n if (!transformer.replace || !transformer.regExp) {\n continue;\n }\n const match = textContent.match(transformer.regExp);\n if (match === null) {\n continue;\n }\n const startIndex = match.index || 0;\n const endIndex = startIndex + match[0].length;\n let replaceNode;\n if (startIndex === 0) {\n [replaceNode] = anchorNode.splitText(endIndex);\n } else {\n [, replaceNode] = anchorNode.splitText(startIndex, endIndex);\n }\n replaceNode.selectNext(0, 0);\n transformer.replace(replaceNode, match);\n return true;\n }\n return false;\n}\nfunction $runTextFormatTransformers(anchorNode, anchorOffset, textFormatTransformers) {\n const textContent = anchorNode.getTextContent();\n const closeTagEndIndex = anchorOffset - 1;\n const closeChar = textContent[closeTagEndIndex];\n // Quick check if we're possibly at the end of inline markdown style\n const matchers = textFormatTransformers[closeChar];\n if (!matchers) {\n return false;\n }\n for (const matcher of matchers) {\n const {\n tag\n } = matcher;\n const tagLength = tag.length;\n const closeTagStartIndex = closeTagEndIndex - tagLength + 1;\n\n // If tag is not single char check if rest of it matches with text content\n if (tagLength > 1) {\n if (!isEqualSubString(textContent, closeTagStartIndex, tag, 0, tagLength)) {\n continue;\n }\n }\n\n // Space before closing tag cancels inline markdown\n if (textContent[closeTagStartIndex - 1] === ' ') {\n continue;\n }\n\n // Some tags can not be used within words, hence should have newline/space/punctuation after it\n const afterCloseTagChar = textContent[closeTagEndIndex + 1];\n if (matcher.intraword === false && afterCloseTagChar && !PUNCTUATION_OR_SPACE.test(afterCloseTagChar)) {\n continue;\n }\n const closeNode = anchorNode;\n let openNode = closeNode;\n let openTagStartIndex = getOpenTagStartIndex(textContent, closeTagStartIndex, tag);\n\n // Go through text node siblings and search for opening tag\n // if haven't found it within the same text node as closing tag\n let sibling = openNode;\n while (openTagStartIndex < 0 && (sibling = sibling.getPreviousSibling())) {\n if ($isLineBreakNode(sibling)) {\n break;\n }\n if ($isTextNode(sibling)) {\n if (sibling.hasFormat('code')) {\n continue;\n }\n const siblingTextContent = sibling.getTextContent();\n openNode = sibling;\n openTagStartIndex = getOpenTagStartIndex(siblingTextContent, siblingTextContent.length, tag);\n }\n }\n\n // Opening tag is not found\n if (openTagStartIndex < 0) {\n continue;\n }\n\n // No content between opening and closing tag\n if (openNode === closeNode && openTagStartIndex + tagLength === closeTagStartIndex) {\n continue;\n }\n\n // Checking longer tags for repeating chars (e.g. *** vs **)\n const prevOpenNodeText = openNode.getTextContent();\n if (openTagStartIndex > 0 && prevOpenNodeText[openTagStartIndex - 1] === closeChar) {\n continue;\n }\n\n // Some tags can not be used within words, hence should have newline/space/punctuation before it\n const beforeOpenTagChar = prevOpenNodeText[openTagStartIndex - 1];\n if (matcher.intraword === false && beforeOpenTagChar && !PUNCTUATION_OR_SPACE.test(beforeOpenTagChar)) {\n continue;\n }\n\n // Per CommonMark, code spans take precedence over other inline formatting\n if (!matcher.format.includes('code') && $isInsideUnclosedCodeSpan(openNode, openTagStartIndex)) {\n continue;\n }\n\n // Clean text from opening and closing tags (starting from closing tag\n // to prevent any offset shifts if we start from opening one)\n const prevCloseNodeText = closeNode.getTextContent();\n const closeNodeText = prevCloseNodeText.slice(0, closeTagStartIndex) + prevCloseNodeText.slice(closeTagEndIndex + 1);\n closeNode.setTextContent(closeNodeText);\n const openNodeText = openNode === closeNode ? closeNodeText : prevOpenNodeText;\n openNode.setTextContent(openNodeText.slice(0, openTagStartIndex) + openNodeText.slice(openTagStartIndex + tagLength));\n const selection = $getSelection();\n const nextSelection = $createRangeSelection();\n $setSelection(nextSelection);\n // Adjust offset based on deleted chars\n const newOffset = closeTagEndIndex - tagLength * (openNode === closeNode ? 2 : 1) + 1;\n nextSelection.anchor.set(openNode.__key, openTagStartIndex, 'text');\n nextSelection.focus.set(closeNode.__key, newOffset, 'text');\n\n // Apply formatting to selected text\n for (const format of matcher.format) {\n if (!nextSelection.hasFormat(format)) {\n nextSelection.formatText(format);\n }\n }\n\n // Collapse selection up to the focus point\n nextSelection.anchor.set(nextSelection.focus.key, nextSelection.focus.offset, nextSelection.focus.type);\n\n // Remove formatting from collapsed selection\n for (const format of matcher.format) {\n if (nextSelection.hasFormat(format)) {\n nextSelection.toggleFormat(format);\n }\n }\n if ($isRangeSelection(selection)) {\n nextSelection.format = selection.format;\n }\n return true;\n }\n return false;\n}\n\n// Per CommonMark spec, code spans take precedence over other inline\n// formatting. Returns true if there is an unclosed backtick (code span\n// opener) in the text preceding the given offset, which means the offset\n// is inside a code span that hasn't been closed yet.\nfunction $isInsideUnclosedCodeSpan(node, offset) {\n let backtickCount = 0;\n const text = node.getTextContent();\n for (let i = 0; i < offset; i++) {\n if (text[i] === '`') {\n backtickCount++;\n }\n }\n return backtickCount % 2 !== 0;\n}\nfunction getOpenTagStartIndex(string, maxIndex, tag) {\n const tagLength = tag.length;\n for (let i = maxIndex; i >= tagLength; i--) {\n const startIndex = i - tagLength;\n if (isEqualSubString(string, startIndex, tag, 0, tagLength) &&\n // Space after opening tag cancels transformation\n string[startIndex + tagLength] !== ' ') {\n return startIndex;\n }\n }\n return -1;\n}\nfunction isEqualSubString(stringA, aStart, stringB, bStart, length) {\n for (let i = 0; i < length; i++) {\n if (stringA[aStart + i] !== stringB[bStart + i]) {\n return false;\n }\n }\n return true;\n}\nfunction registerMarkdownShortcuts(editor, transformers = TRANSFORMERS) {\n const byType = transformersByType(transformers);\n const textFormatTransformersByTrigger = indexBy(byType.textFormat, ({\n tag\n }) => tag[tag.length - 1]);\n const textMatchTransformersByTrigger = indexBy(byType.textMatch, ({\n trigger\n }) => trigger);\n for (const transformer of transformers) {\n const type = transformer.type;\n if (type === 'element' || type === 'text-match' || type === 'multiline-element') {\n const dependencies = transformer.dependencies;\n for (const node of dependencies) {\n if (!editor.hasNode(node)) {\n {\n formatDevErrorMessage(`MarkdownShortcuts: missing dependency ${node.getType()} for transformer. Ensure node dependency is included in editor initial config.`);\n }\n }\n }\n }\n }\n const $transform = (parentNode, anchorNode, anchorOffset) => {\n if (runElementTransformers(parentNode, anchorNode, anchorOffset, byType.element)) {\n return true;\n }\n if (runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, byType.multilineElement)) {\n return true;\n }\n if (runTextMatchTransformers(anchorNode, anchorOffset, textMatchTransformersByTrigger)) {\n return true;\n }\n if ($runTextFormatTransformers(anchorNode, anchorOffset, textFormatTransformersByTrigger)) {\n return true;\n }\n return false;\n };\n return mergeRegister(editor.registerUpdateListener(({\n tags,\n dirtyLeaves,\n editorState,\n prevEditorState\n }) => {\n // Ignore updates from collaboration and undo/redo (as changes already calculated)\n if (tags.has(COLLABORATION_TAG) || tags.has(HISTORIC_TAG)) {\n return;\n }\n\n // If editor is still composing (i.e. backticks) we must wait before the user confirms the key\n if (editor.isComposing()) {\n return;\n }\n const selection = editorState.read($getSelection);\n const prevSelection = prevEditorState.read($getSelection);\n\n // We expect selection to be a collapsed range and not match previous one (as we want\n // to trigger transforms only as user types)\n if (!$isRangeSelection(prevSelection) || !$isRangeSelection(selection) || !selection.isCollapsed() || selection.is(prevSelection)) {\n return;\n }\n const anchorKey = selection.anchor.key;\n const anchorOffset = selection.anchor.offset;\n const anchorNode = editorState._nodeMap.get(anchorKey);\n if (!$isTextNode(anchorNode) || !dirtyLeaves.has(anchorKey) || anchorOffset !== 1 && anchorOffset > prevSelection.anchor.offset + 1) {\n return;\n }\n editor.update(() => {\n if (!canContainTransformableMarkdown(anchorNode)) {\n return;\n }\n const parentNode = anchorNode.getParent();\n if (parentNode === null || $isCodeNode(parentNode)) {\n return;\n }\n if ($transform(parentNode, anchorNode, selection.anchor.offset)) {\n $addUpdateTag(HISTORY_PUSH_TAG);\n }\n });\n }), editor.registerCommand(KEY_ENTER_COMMAND, event => {\n if (event !== null && event.shiftKey) {\n return false;\n }\n const selection = $getSelection();\n if (!$isRangeSelection(selection) || !selection.isCollapsed()) {\n return false;\n }\n const anchorOffset = selection.anchor.offset;\n const anchorNode = selection.anchor.getNode();\n if (!$isTextNode(anchorNode) || !canContainTransformableMarkdown(anchorNode)) {\n return false;\n }\n const parentNode = anchorNode.getParent();\n if (parentNode === null || $isCodeNode(parentNode)) {\n return false;\n }\n const textContent = anchorNode.getTextContent();\n if (anchorOffset !== textContent.length) {\n return false;\n }\n if (runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, byType.multilineElement, true)) {\n if (event !== null) {\n event.preventDefault();\n }\n return true;\n }\n return false;\n }, COMMAND_PRIORITY_LOW));\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n *\n * @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions\n * @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.\n */\nfunction $convertFromMarkdownString(markdown, transformers = TRANSFORMERS, node, shouldPreserveNewLines = false, shouldMergeAdjacentLines = false) {\n const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);\n const importMarkdown = createMarkdownImport(transformers, shouldPreserveNewLines);\n return importMarkdown(sanitizedMarkdown, node);\n}\n\n/**\n * Renders string from markdown. The selection is moved to the start after the operation.\n */\nfunction $convertToMarkdownString(transformers = TRANSFORMERS, node, shouldPreserveNewLines = false) {\n const exportMarkdown = createMarkdownExport(transformers, shouldPreserveNewLines);\n return exportMarkdown(node);\n}\n\nexport { $convertFromMarkdownString, $convertToMarkdownString, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CHECK_LIST, CODE, ELEMENT_TRANSFORMERS, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, LINK, MULTILINE_ELEMENT_TRANSFORMERS, ORDERED_LIST, QUOTE, STRIKETHROUGH, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS, UNORDERED_LIST, registerMarkdownShortcuts };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,SAAS,QAAQ,MAAM,UAAU;CAC/B,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,QAAQ,MAAM;EACvB,MAAM,MAAM,SAAS,IAAI;EACzB,IAAI,CAAC,KACH;EAEF,IAAI,MAAM,MACR,MAAM,KAAK,KAAK,IAAI;OAEpB,MAAM,OAAO,CAAC,IAAI;CAEtB;CACA,OAAO;AACT;AACA,SAAS,mBAAmB,cAAc;CACxC,MAAM,SAAS,QAAQ,eAAc,MAAK,EAAE,IAAI;CAChD,OAAO;EACL,SAAS,OAAO,WAAW,CAAC;EAC5B,kBAAkB,OAAO,wBAAwB,CAAC;EAClD,YAAY,OAAO,kBAAkB,CAAC;EACtC,WAAW,OAAO,iBAAiB,CAAC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Aa,UAAU,OAAO,QAAQ;EAC5C,IAAI,CAAC,YAAY,UAAU,KAAK,CAAC,gCAAgC,UAAU,GACzE,OAAO;EAET,MAAM,aAAa,WAAW,UAAU;EACxC,IAAI,eAAe,QAAQ,YAAY,UAAU,GAC/C,OAAO;EAGT,IAAI,iBADgB,WAAW,eACA,EAAE,QAC/B,OAAO;EAET,IAAI,gCAAgC,YAAY,YAAY,cAAc,OAAO,kBAAkB,IAAI,GAAG;GACxG,IAAI,UAAU,MACZ,MAAM,eAAe;GAEvB,OAAO;EACT;EACA,OAAO;CACT,GAAG,oBAAoB,CAAC;AAC1B;;;;;;;;;;;;;;AAiBA,SAAS,2BAA2B,UAAU,eAAe,cAAc,MAAM,yBAAyB,OAAO,2BAA2B,OAAO;CACjJ,MAAM,oBAAoB,yBAAyB,WAAW,kBAAkB,UAAU,wBAAwB;CAElH,OADuB,qBAAqB,cAAc,sBACtC,EAAE,mBAAmB,IAAI;AAC/C;;;;AAKA,SAAS,yBAAyB,eAAe,cAAc,MAAM,yBAAyB,OAAO;CAEnG,OADuB,qBAAqB,cAAc,sBACtC,EAAE,IAAI;AAC5B"}
1
+ {"version":3,"file":"LexicalMarkdown.dev-CRWkZwlp.mjs","names":["$findMatchingParent","$findMatchingParent$1"],"sources":["../../../node_modules/.pnpm/@lexical+markdown@0.44.0/node_modules/@lexical/markdown/LexicalMarkdown.dev.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $isParagraphNode, $isTextNode, $getRoot, $isElementNode, $isDecoratorNode, $isLineBreakNode, $getSelection, $createTextNode, $createParagraphNode, $createLineBreakNode, $createTabNode, createState, $setState, $getState, $findMatchingParent as $findMatchingParent$1, mergeRegister, COLLABORATION_TAG, HISTORIC_TAG, $isRangeSelection, $addUpdateTag, HISTORY_PUSH_TAG, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $isRootOrShadowRoot, $createRangeSelection, $setSelection } from 'lexical';\nimport { $isListNode, $isListItemNode, ListNode, ListItemNode, $createListItemNode, $createListNode } from '@lexical/list';\nimport { $isQuoteNode, HeadingNode, QuoteNode, $isHeadingNode, $createQuoteNode, $createHeadingNode } from '@lexical/rich-text';\nimport { $findMatchingParent } from '@lexical/utils';\nimport { CodeNode, $createCodeNode, $isCodeNode } from '@lexical/code-core';\nimport { LinkNode, $isLinkNode, $createLinkNode, $isAutoLinkNode } from '@lexical/link';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction indexBy(list, callback) {\n const index = {};\n for (const item of list) {\n const key = callback(item);\n if (!key) {\n continue;\n }\n if (index[key]) {\n index[key].push(item);\n } else {\n index[key] = [item];\n }\n }\n return index;\n}\nfunction transformersByType(transformers) {\n const byType = indexBy(transformers, t => t.type);\n return {\n element: byType.element || [],\n multilineElement: byType['multiline-element'] || [],\n textFormat: byType['text-format'] || [],\n textMatch: byType['text-match'] || []\n };\n}\nconst PUNCTUATION_OR_SPACE = /[!-/:-@[-`{-~\\s]/;\nconst WHITESPACE = /[ \\t\\n\\r\\f]/;\nconst PUNCTUATION = /[!\"#$%&'()*+,\\-./:;<=>?@[\\]^_`{|}~]/;\nconst MARKDOWN_EMPTY_LINE_REG_EXP = /^\\s{0,3}$/;\nfunction isEmptyParagraph(node) {\n if (!$isParagraphNode(node)) {\n return false;\n }\n const firstChild = node.getFirstChild();\n return firstChild == null || node.getChildrenSize() === 1 && $isTextNode(firstChild) && MARKDOWN_EMPTY_LINE_REG_EXP.test(firstChild.getTextContent());\n}\nfunction unescapeText(value) {\n return value.replace(/\\\\([!-/:-@[-`{-~])/g, '$1').replace(/&#(\\d+);/g, (_, codePoint) => String.fromCodePoint(Number(codePoint)));\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Renders string from markdown. The selection is moved to the start after the operation.\n */\nfunction createMarkdownExport(transformers, shouldPreserveNewLines = false) {\n const byType = transformersByType(transformers);\n const elementTransformers = [...byType.multilineElement, ...byType.element];\n const isNewlineDelimited = !shouldPreserveNewLines;\n\n // Export only uses text formats that are responsible for single format\n // e.g. it will filter out *** (bold, italic) and instead use separate ** and *\n const textFormatTransformers = byType.textFormat.filter(transformer => transformer.format.length === 1)\n // Make sure all text transformers that contain 'code' in their format are at the end of the array. Otherwise, formatted code like\n // <strong><code>code</code></strong> will be exported as `**Bold Code**`, as the code format will be applied first, and the bold format\n // will be applied second and thus skipped entirely, as the code format will prevent any further formatting.\n .sort((a, b) => {\n return Number(a.format.includes('code')) - Number(b.format.includes('code'));\n });\n return node => {\n const output = [];\n const children = (node || $getRoot()).getChildren();\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n const result = exportTopLevelElements(child, elementTransformers, textFormatTransformers, byType.textMatch, shouldPreserveNewLines);\n if (result != null) {\n output.push(\n // separate consecutive group of texts with a line break: eg. [\"hello\", \"world\"] -> [\"hello\", \"/nworld\"]\n isNewlineDelimited && i > 0 && !isEmptyParagraph(child) && !isEmptyParagraph(children[i - 1]) ? '\\n'.concat(result) : result);\n }\n }\n // Ensure consecutive groups of texts are at least \\n\\n apart while each empty paragraph render as a newline.\n // Eg. [\"hello\", \"\", \"\", \"hi\", \"\\nworld\"] -> \"hello\\n\\n\\nhi\\n\\nworld\"\n return output.join('\\n');\n };\n}\nfunction exportTopLevelElements(node, elementTransformers, textTransformersIndex, textMatchTransformers, shouldPreserveNewLines) {\n for (const transformer of elementTransformers) {\n if (!transformer.export) {\n continue;\n }\n const result = transformer.export(node, _node => exportChildren(_node, textTransformersIndex, textMatchTransformers, undefined, undefined, shouldPreserveNewLines));\n if (result != null) {\n return result;\n }\n }\n if ($isElementNode(node)) {\n return exportChildren(node, textTransformersIndex, textMatchTransformers, undefined, undefined, shouldPreserveNewLines);\n } else if ($isDecoratorNode(node)) {\n return node.getTextContent();\n } else {\n return null;\n }\n}\nfunction exportChildren(node, textTransformersIndex, textMatchTransformers, unclosedTags, unclosableTags, shouldPreserveNewLines = false) {\n const output = [];\n const children = node.getChildren();\n // keep track of unclosed tags from the very beginning\n if (!unclosedTags) {\n unclosedTags = [];\n }\n if (!unclosableTags) {\n unclosableTags = [];\n }\n mainLoop: for (const child of children) {\n for (const transformer of textMatchTransformers) {\n if (!transformer.export) {\n continue;\n }\n const result = transformer.export(child, parentNode => exportChildren(parentNode, textTransformersIndex, textMatchTransformers, unclosedTags,\n // Add current unclosed tags to the list of unclosable tags - we don't want nested tags from\n // textmatch transformers to close the outer ones, as that may result in invalid markdown.\n // E.g. **text [text**](https://lexical.io)\n // is invalid markdown, as the closing ** is inside the link.\n //\n [...unclosableTags, ...unclosedTags], shouldPreserveNewLines), (textNode, textContent) => exportTextFormat(textNode, textContent, textTransformersIndex, unclosedTags, unclosableTags, shouldPreserveNewLines));\n if (result != null) {\n output.push(result);\n continue mainLoop;\n }\n }\n if ($isLineBreakNode(child)) {\n output.push('\\n');\n } else if ($isTextNode(child)) {\n output.push(exportTextFormat(child, child.getTextContent(), textTransformersIndex, unclosedTags, unclosableTags, shouldPreserveNewLines));\n } else if ($isElementNode(child)) {\n // empty paragraph returns \"\"\n output.push(exportChildren(child, textTransformersIndex, textMatchTransformers, unclosedTags, unclosableTags, shouldPreserveNewLines));\n } else if ($isDecoratorNode(child)) {\n output.push(child.getTextContent());\n }\n }\n return output.join('');\n}\nfunction exportTextFormat(node, textContent, textTransformers,\n// unclosed tags include the markdown tags that haven't been closed yet, and their associated formats\nunclosedTags, unclosableTags, shouldPreserveNewLines = false) {\n // This function handles the case of a string looking like this: \" foo \"\n // Where it would be invalid markdown to generate: \"** foo **\"\n // If the node has no format, we use the original text.\n // Otherwise, we escape leading and trailing whitespaces to their corresponding code points,\n // ensuring the returned string maintains its original formatting, e.g., \"**&#32;&#32;&#32;foo&#32;&#32;&#32;**\".\n\n let output = textContent;\n if (!node.hasFormat('code')) {\n // Preserve literal backslashes when preserving source newlines.\n output = shouldPreserveNewLines ? output.replace(/([*_`~])/g, '\\\\$1') : output.replace(/([*_`~\\\\])/g, '\\\\$1');\n }\n\n // Extract leading and trailing whitespaces.\n // CommonMark flanking rules require formatting tags to be adjacent to non-whitespace characters.\n const match = output.match(/^(\\s*)(.*?)(\\s*)$/s) || ['', '', output, ''];\n const leadingSpace = match[1];\n const trimmedOutput = match[2];\n const trailingSpace = match[3];\n const isWhitespaceOnly = trimmedOutput === '';\n\n // the opening tags to be added to the result\n let openingTags = '';\n // the closing tags to be added to the result\n let closingTagsBefore = '';\n let closingTagsAfter = '';\n const prevNode = getTextSibling(node, true);\n const nextNode = getTextSibling(node, false);\n const applied = new Set();\n for (const transformer of textTransformers) {\n const format = transformer.format[0];\n const tag = transformer.tag;\n\n // dedup applied formats\n if (checkHasFormat(node, format) && !applied.has(format)) {\n applied.add(format);\n\n // append the tag to openingTags, if it's not applied to the previous nodes,\n // or the nodes before that (which would result in an unclosed tag)\n if (!checkHasFormat(prevNode, format) || !unclosedTags.find(element => element.tag === tag)) {\n unclosedTags.push({\n format,\n tag\n });\n openingTags += tag;\n }\n }\n }\n\n // close any tags in the same order they were applied, if necessary\n for (let i = 0; i < unclosedTags.length; i++) {\n const nodeHasFormat = hasFormat(node, unclosedTags[i].format);\n const nextNodeHasFormat = hasFormat(nextNode, unclosedTags[i].format);\n\n // prevent adding closing tag if next sibling will do it\n if (nodeHasFormat && nextNodeHasFormat) {\n continue;\n }\n const unhandledUnclosedTags = [...unclosedTags]; // Shallow copy to avoid modifying the original array\n\n while (unhandledUnclosedTags.length > i) {\n const unclosedTag = unhandledUnclosedTags.pop();\n\n // If tag is unclosable, don't close it and leave it in the original array,\n // So that it can be closed when it's no longer unclosable\n if (unclosableTags && unclosedTag && unclosableTags.find(element => element.tag === unclosedTag.tag)) {\n continue;\n }\n if (unclosedTag && typeof unclosedTag.tag === 'string') {\n if (!nodeHasFormat) {\n // Handles cases where the tag has not been closed before, e.g. if the previous node\n // was a text match transformer that did not account for closing tags of the next node (e.g. a link)\n closingTagsBefore += unclosedTag.tag;\n } else if (!nextNodeHasFormat) {\n closingTagsAfter += unclosedTag.tag;\n }\n }\n // Mutate the original array to remove the closed tag\n unclosedTags.pop();\n }\n break;\n }\n // If the node is entirely whitespace, we don't apply opening/closing tags around it.\n // However, it must still output closing tags from previous nodes.\n if (isWhitespaceOnly && !node.hasFormat('code')) {\n return closingTagsBefore + output;\n }\n\n // Flanking Compliance: Notice how openingTags and closingTagsAfter are placed INSIDE the whitespace boundaries!\n return closingTagsBefore + leadingSpace + openingTags + trimmedOutput + closingTagsAfter + trailingSpace;\n}\nfunction getTextSibling(node, backward) {\n const sibling = backward ? node.getPreviousSibling() : node.getNextSibling();\n if ($isTextNode(sibling)) {\n return sibling;\n }\n return null;\n}\nfunction hasFormat(node, format) {\n return $isTextNode(node) && node.hasFormat(format);\n}\nfunction checkHasFormat(n, f) {\n if (!hasFormat(n, f)) {\n return false;\n }\n if (f === 'code') {\n return true;\n }\n if (n && /^\\s*$/.test(n.getTextContent())) {\n return false;\n }\n return true;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction findOutermostTextFormatTransformer(textNode, textFormatTransformersIndex) {\n const textContent = textNode.getTextContent();\n\n // Find code span first. Emphasis delimiters inside inline elements (e.g., code spans)\n // should not be processed. Currently only code spans are handled; other inline elements\n // (e.g., links, raw HTML) may need similar treatment in the future.\n const codeRegex = textFormatTransformersIndex.fullMatchRegExpByTag['`'];\n const codeTransformer = textFormatTransformersIndex.transformersByTag['`'];\n const excludeRanges = [];\n let codeMatch = null;\n if (codeRegex && codeTransformer) {\n const globalRegex = new RegExp(codeRegex.source, 'g');\n const matches = Array.from(textContent.matchAll(globalRegex));\n for (const match of matches) {\n // Group 1 captures the character preceding the opening backtick (or an\n // empty string when the span starts at position 0). Offset past it so\n // startIndex points to the backtick itself.\n const startIndex = match.index + match[1].length;\n const endIndex = match.index + match[0].length;\n if (!codeMatch) {\n codeMatch = {\n content: match[3],\n endIndex,\n startIndex,\n tag: '`'\n };\n }\n excludeRanges.push({\n end: endIndex,\n start: startIndex\n });\n }\n }\n const delimiters = scanDelimiters(textContent, textFormatTransformersIndex, excludeRanges);\n const emphasisMatch = delimiters.length > 0 ? processEmphasis(textContent, delimiters, textFormatTransformersIndex) : null;\n let resultMatch = null;\n let resultTransformer = null;\n if (codeMatch && emphasisMatch) {\n if (emphasisMatch.startIndex <= codeMatch.startIndex && emphasisMatch.endIndex >= codeMatch.endIndex) {\n resultMatch = emphasisMatch;\n resultTransformer = textFormatTransformersIndex.transformersByTag[emphasisMatch.tag];\n } else {\n resultMatch = codeMatch;\n resultTransformer = codeTransformer;\n }\n } else if (codeMatch) {\n resultMatch = codeMatch;\n resultTransformer = codeTransformer;\n } else if (emphasisMatch) {\n resultMatch = emphasisMatch;\n resultTransformer = textFormatTransformersIndex.transformersByTag[emphasisMatch.tag];\n }\n if (!resultMatch || !resultTransformer) {\n return null;\n }\n const regexMatch = [textContent.slice(resultMatch.startIndex, resultMatch.endIndex), resultMatch.tag, resultMatch.content];\n regexMatch.index = resultMatch.startIndex;\n regexMatch.input = textContent;\n return {\n endIndex: resultMatch.endIndex,\n match: regexMatch,\n startIndex: resultMatch.startIndex,\n transformer: resultTransformer\n };\n}\nfunction scanDelimiters(text, transformersIndex, excludeRanges = []) {\n const delimiters = [];\n const delimiterChars = new Set(Object.keys(transformersIndex.transformersByTag).filter(tag => tag[0] !== '`').map(tag => tag[0]));\n const isEscaped = index => {\n let count = 0;\n for (let i = index - 1; i >= 0 && text[i] === '\\\\'; i--) {\n count++;\n }\n return count % 2 === 1;\n };\n const isInExcludedRange = index => {\n return excludeRanges.some(range => index >= range.start && index < range.end);\n };\n let i = 0;\n while (i < text.length) {\n const char = text[i];\n if (!delimiterChars.has(char) || isEscaped(i) || isInExcludedRange(i)) {\n i++;\n continue;\n }\n let len = 1;\n while (i + len < text.length && text[i + len] === char) {\n len++;\n }\n const canOpen = canEmphasis(char, text, i, len, true);\n const canClose = canEmphasis(char, text, i, len, false);\n if (canOpen || canClose) {\n delimiters.push({\n active: true,\n canClose,\n canOpen,\n char,\n index: i,\n length: len,\n originalLength: len\n });\n }\n i += len;\n }\n return delimiters;\n}\nfunction processEmphasis(text, delimiters, transformersIndex) {\n const openersBottom = {};\n let currentPos = 0;\n let result = null;\n while (currentPos < delimiters.length) {\n const closer = delimiters[currentPos];\n if (!closer.active || !closer.canClose || closer.length === 0) {\n currentPos++;\n continue;\n }\n const bottomKey = `${closer.char}${closer.canOpen}`;\n const bottom = openersBottom[bottomKey] ?? -1;\n let foundOpener = false;\n for (let openIdx = currentPos - 1; openIdx > bottom; openIdx--) {\n const opener = delimiters[openIdx];\n if (!opener.active || !opener.canOpen || opener.length === 0 || opener.char !== closer.char) {\n continue;\n }\n\n // Rule of 3\n if (opener.canClose || closer.canOpen) {\n const sum = opener.originalLength + closer.originalLength;\n if (sum % 3 === 0 && opener.originalLength % 3 !== 0 && closer.originalLength % 3 !== 0) {\n continue;\n }\n }\n const maxLen = Math.min(opener.length, closer.length);\n const matchedTag = Object.keys(transformersIndex.transformersByTag).filter(t => t[0] === opener.char && t.length <= maxLen).sort((a, b) => b.length - a.length)[0];\n if (!matchedTag) {\n continue;\n }\n foundOpener = true;\n const matchLen = matchedTag.length;\n const match = {\n content: text.slice(opener.index + opener.length, closer.index),\n endIndex: closer.index + matchLen,\n startIndex: opener.index + (opener.length - matchLen),\n tag: matchedTag\n };\n if (!result || match.startIndex < result.startIndex || match.startIndex === result.startIndex && match.endIndex > result.endIndex) {\n result = match;\n }\n for (let j = openIdx + 1; j < currentPos; j++) {\n delimiters[j].active = false;\n }\n opener.length -= matchLen;\n closer.length -= matchLen;\n opener.active = opener.length > 0;\n if (closer.length > 0) {\n closer.index += matchLen;\n } else {\n closer.active = false;\n currentPos++;\n }\n break;\n }\n if (!foundOpener) {\n openersBottom[bottomKey] = currentPos - 1;\n if (!closer.canOpen) {\n closer.active = false;\n }\n currentPos++;\n }\n }\n return result;\n}\nfunction canEmphasis(char, text, index, length, isOpen) {\n if (!isFlanking(text, index, length, isOpen)) {\n return false;\n }\n if (char === '*') {\n return true;\n }\n if (char === '_') {\n if (!isFlanking(text, index, length, !isOpen)) {\n return true;\n }\n const adjacentChar = isOpen ? text[index - 1] : text[index + length];\n return adjacentChar !== undefined && PUNCTUATION.test(adjacentChar);\n }\n return true;\n}\nfunction isFlanking(text, index, length, isLeft) {\n const charBefore = text[index - 1];\n const charAfter = text[index + length];\n const [primary, secondary] = isLeft ? [charAfter, charBefore] : [charBefore, charAfter];\n if (primary === undefined || WHITESPACE.test(primary)) {\n return false;\n }\n if (!PUNCTUATION.test(primary)) {\n return true;\n }\n return secondary === undefined || WHITESPACE.test(secondary) || PUNCTUATION.test(secondary);\n}\nfunction importTextFormatTransformer(textNode, startIndex, endIndex, transformer, match) {\n const textContent = textNode.getTextContent();\n\n // No text matches - we can safely process the text format match\n let transformedNode, nodeAfter, nodeBefore;\n\n // If matching full content there's no need to run splitText and can reuse existing textNode\n // to update its content and apply format. E.g. for **_Hello_** string after applying bold\n // format (**) it will reuse the same text node to apply italic (_)\n if (match[0] === textContent) {\n transformedNode = textNode;\n } else {\n if (startIndex === 0) {\n [transformedNode, nodeAfter] = textNode.splitText(endIndex);\n } else {\n [nodeBefore, transformedNode, nodeAfter] = textNode.splitText(startIndex, endIndex);\n }\n }\n transformedNode.setTextContent(match[2]);\n if (transformer) {\n for (const format of transformer.format) {\n if (!transformedNode.hasFormat(format)) {\n transformedNode.toggleFormat(format);\n }\n }\n }\n return {\n nodeAfter: nodeAfter,\n nodeBefore: nodeBefore,\n transformedNode: transformedNode\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction findOutermostTextMatchTransformer(textNode_, textMatchTransformers) {\n const textNode = textNode_;\n let foundMatchStartIndex = undefined;\n let foundMatchEndIndex = undefined;\n let foundMatchTransformer = undefined;\n let foundMatch = undefined;\n for (const transformer of textMatchTransformers) {\n if (!transformer.replace || !transformer.importRegExp) {\n continue;\n }\n const match = textNode.getTextContent().match(transformer.importRegExp);\n if (!match) {\n continue;\n }\n const startIndex = match.index || 0;\n const endIndex = transformer.getEndIndex ? transformer.getEndIndex(textNode, match) : startIndex + match[0].length;\n if (endIndex === false) {\n continue;\n }\n if (foundMatchStartIndex === undefined || foundMatchEndIndex === undefined ||\n // Wraps previous match or is strictly before it.\n startIndex < foundMatchStartIndex && (endIndex > foundMatchEndIndex || endIndex <= foundMatchStartIndex)) {\n foundMatchStartIndex = startIndex;\n foundMatchEndIndex = endIndex;\n foundMatchTransformer = transformer;\n foundMatch = match;\n }\n }\n if (foundMatchStartIndex === undefined || foundMatchEndIndex === undefined || foundMatchTransformer === undefined || foundMatch === undefined) {\n return null;\n }\n return {\n endIndex: foundMatchEndIndex,\n match: foundMatch,\n startIndex: foundMatchStartIndex,\n transformer: foundMatchTransformer\n };\n}\nfunction importFoundTextMatchTransformer(textNode, startIndex, endIndex, transformer, match) {\n let transformedNode, nodeAfter, nodeBefore;\n if (startIndex === 0) {\n [transformedNode, nodeAfter] = textNode.splitText(endIndex);\n } else {\n [nodeBefore, transformedNode, nodeAfter] = textNode.splitText(startIndex, endIndex);\n }\n if (!transformer.replace) {\n return null;\n }\n const potentialTransformedNode = transformer.replace(transformedNode, match);\n return {\n nodeAfter,\n nodeBefore,\n transformedNode: potentialTransformedNode || undefined\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Returns true if the node can contain transformable markdown.\n * Code nodes cannot contain transformable markdown.\n * For example, `code **bold**` should not be transformed to\n * <code>code <strong>bold</strong></code>.\n */\nfunction canContainTransformableMarkdown(node) {\n return $isTextNode(node) && !node.hasFormat('code');\n}\n\n/**\n * Handles applying both text format and text match transformers.\n * It finds the outermost text format or text match and applies it,\n * then recursively calls itself to apply the next outermost transformer,\n * until there are no more transformers to apply.\n */\nfunction importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers) {\n let foundTextFormat = findOutermostTextFormatTransformer(textNode, textFormatTransformersIndex);\n let foundTextMatch = findOutermostTextMatchTransformer(textNode, textMatchTransformers);\n if (foundTextFormat && foundTextMatch) {\n // Find the outermost transformer\n if (foundTextFormat.startIndex <= foundTextMatch.startIndex && foundTextFormat.endIndex >= foundTextMatch.endIndex ||\n // foundTextMatch is not contained within foundTextFormat\n foundTextMatch.startIndex > foundTextFormat.endIndex) {\n // foundTextFormat wraps foundTextMatch - apply foundTextFormat by setting foundTextMatch to null\n foundTextMatch = null;\n } else {\n // foundTextMatch wraps foundTextFormat - apply foundTextMatch by setting foundTextFormat to null\n foundTextFormat = null;\n }\n }\n if (foundTextFormat) {\n const result = importTextFormatTransformer(textNode, foundTextFormat.startIndex, foundTextFormat.endIndex, foundTextFormat.transformer, foundTextFormat.match);\n if (canContainTransformableMarkdown(result.nodeAfter)) {\n importTextTransformers(result.nodeAfter, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.nodeBefore)) {\n importTextTransformers(result.nodeBefore, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.transformedNode)) {\n importTextTransformers(result.transformedNode, textFormatTransformersIndex, textMatchTransformers);\n }\n } else if (foundTextMatch) {\n const result = importFoundTextMatchTransformer(textNode, foundTextMatch.startIndex, foundTextMatch.endIndex, foundTextMatch.transformer, foundTextMatch.match);\n if (!result) {\n return;\n }\n if (canContainTransformableMarkdown(result.nodeAfter)) {\n importTextTransformers(result.nodeAfter, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.nodeBefore)) {\n importTextTransformers(result.nodeBefore, textFormatTransformersIndex, textMatchTransformers);\n }\n if (canContainTransformableMarkdown(result.transformedNode)) {\n importTextTransformers(result.transformedNode, textFormatTransformersIndex, textMatchTransformers);\n }\n }\n\n // Handle escape characters\n const textContent = textNode.getTextContent();\n const unescapedText = unescapeText(textContent);\n textNode.setTextContent(unescapedText);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n */\nfunction createMarkdownImport(transformers, shouldPreserveNewLines = false) {\n const byType = transformersByType(transformers);\n const textFormatTransformersIndex = createTextFormatTransformersIndex(byType.textFormat);\n return (markdownString, node) => {\n const lines = markdownString.split('\\n');\n const linesLength = lines.length;\n const root = node || $getRoot();\n root.clear();\n for (let i = 0; i < linesLength; i++) {\n const lineText = lines[i];\n const [imported, shiftedIndex] = $importMultiline(lines, i, byType.multilineElement, root);\n if (imported) {\n // If a multiline markdown element was imported, we don't want to process the lines that were part of it anymore.\n // There could be other sub-markdown elements (both multiline and normal ones) matching within this matched multiline element's children.\n // However, it would be the responsibility of the matched multiline transformer to decide how it wants to handle them.\n // We cannot handle those, as there is no way for us to know how to maintain the correct order of generated lexical nodes for possible children.\n i = shiftedIndex; // Next loop will start from the line after the last line of the multiline element\n continue;\n }\n $importBlocks(lineText, root, byType.element, textFormatTransformersIndex, byType.textMatch, shouldPreserveNewLines);\n }\n const children = root.getChildren();\n for (const child of children) {\n // By default, removing empty paragraphs as md does not really\n // allow empty lines and uses them as delimiter.\n // If you need empty lines set shouldPreserveNewLines = true.\n if (!shouldPreserveNewLines && isEmptyParagraph(child) && root.getChildrenSize() > 1) {\n child.remove();\n continue;\n }\n // Convert all '\\t' into TabNode.\n if ($isElementNode(child)) {\n for (const textNode of child.getAllTextNodes()) {\n $normalizeMarkdownTextNode(textNode);\n }\n }\n }\n if ($getSelection() !== null) {\n root.selectStart();\n }\n };\n}\n\n/**\n *\n * @returns first element of the returned tuple is a boolean indicating if a multiline element was imported. The second element is the index of the last line that was processed.\n */\nfunction $importMultiline(lines, startLineIndex, multilineElementTransformers, rootNode) {\n for (const transformer of multilineElementTransformers) {\n const {\n handleImportAfterStartMatch,\n regExpEnd,\n regExpStart,\n replace\n } = transformer;\n const startMatch = lines[startLineIndex].match(regExpStart);\n if (!startMatch) {\n continue; // Try next transformer\n }\n if (handleImportAfterStartMatch) {\n const result = handleImportAfterStartMatch({\n lines,\n rootNode,\n startLineIndex,\n startMatch,\n transformer\n });\n if (result === null) {\n continue;\n } else if (result) {\n return result;\n }\n }\n const regexpEndRegex = typeof regExpEnd === 'object' && 'regExp' in regExpEnd ? regExpEnd.regExp : regExpEnd;\n const isEndOptional = regExpEnd && typeof regExpEnd === 'object' && 'optional' in regExpEnd ? regExpEnd.optional : !regExpEnd;\n let endLineIndex = startLineIndex;\n const linesLength = lines.length;\n\n // check every single line for the closing match. It could also be on the same line as the opening match.\n while (endLineIndex < linesLength) {\n const endMatch = regexpEndRegex ? lines[endLineIndex].match(regexpEndRegex) : null;\n if (!endMatch) {\n if (!isEndOptional || isEndOptional && endLineIndex < linesLength - 1 // Optional end, but didn't reach the end of the document yet => continue searching for potential closing match\n ) {\n endLineIndex++;\n continue; // Search next line for closing match\n }\n }\n\n // Now, check if the closing match matched is the same as the opening match.\n // If it is, we need to continue searching for the actual closing match.\n if (endMatch && startLineIndex === endLineIndex && endMatch.index === startMatch.index) {\n endLineIndex++;\n continue; // Search next line for closing match\n }\n\n // At this point, we have found the closing match. Next: calculate the lines in between open and closing match\n // This should not include the matches themselves, and be split up by lines\n const linesInBetween = [];\n if (endMatch && startLineIndex === endLineIndex) {\n linesInBetween.push(lines[startLineIndex].slice(startMatch[0].length, -endMatch[0].length));\n } else {\n for (let i = startLineIndex; i <= endLineIndex; i++) {\n if (i === startLineIndex) {\n const text = lines[i].slice(startMatch[0].length);\n linesInBetween.push(text); // Also include empty text\n } else if (i === endLineIndex && endMatch) {\n const text = lines[i].slice(0, -endMatch[0].length);\n linesInBetween.push(text); // Also include empty text\n } else {\n linesInBetween.push(lines[i]);\n }\n }\n }\n if (replace(rootNode, null, startMatch, endMatch, linesInBetween, true) !== false) {\n // Return here. This $importMultiline function is run line by line and should only process a single multiline element at a time.\n return [true, endLineIndex];\n }\n\n // The replace function returned false, despite finding the matching open and close tags => this transformer does not want to handle it.\n // Thus, we continue letting the remaining transformers handle the passed lines of text from the beginning\n break;\n }\n }\n\n // No multiline transformer handled this line successfully\n return [false, startLineIndex];\n}\nfunction $importBlocks(lineText, rootNode, elementTransformers, textFormatTransformersIndex, textMatchTransformers, shouldPreserveNewLines) {\n const textNode = $createTextNode(lineText);\n const elementNode = $createParagraphNode();\n elementNode.append(textNode);\n rootNode.append(elementNode);\n for (const {\n regExp,\n replace\n } of elementTransformers) {\n const match = lineText.match(regExp);\n if (match) {\n textNode.setTextContent(lineText.slice(match[0].length));\n if (replace(elementNode, [textNode], match, true) !== false) {\n break;\n }\n }\n }\n importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers);\n\n // If no transformer found and we left with original paragraph node\n // can check if its content can be appended to the previous node\n // if it's a paragraph, quote or list\n if (elementNode.isAttached() && lineText.length > 0) {\n const previousNode = elementNode.getPreviousSibling();\n if (!shouldPreserveNewLines && (\n // Only append if we're not preserving newlines\n $isParagraphNode(previousNode) || $isQuoteNode(previousNode) || $isListNode(previousNode))) {\n let targetNode = previousNode;\n if ($isListNode(previousNode)) {\n const lastDescendant = previousNode.getLastDescendant();\n if (lastDescendant == null) {\n targetNode = null;\n } else {\n targetNode = $findMatchingParent(lastDescendant, $isListItemNode);\n }\n }\n if (targetNode != null && targetNode.getTextContentSize() > 0) {\n const lastChild = targetNode.getLastChild();\n if ($isTextNode(lastChild)) {\n const lastText = lastChild.getTextContent();\n if (lastText.endsWith('\\\\')) {\n lastChild.setTextContent(lastText.slice(0, -1));\n } else if (/ {2,}$/.test(lastText)) {\n lastChild.setTextContent(lastText.replace(/ {2,}$/, ''));\n }\n }\n targetNode.splice(targetNode.getChildrenSize(), 0, [$createLineBreakNode(), ...elementNode.getChildren()]);\n elementNode.remove();\n }\n }\n }\n}\n\n// Look in node for '\\t' and create a TabNode for each occurrence.\nfunction $normalizeMarkdownTextNode(textNode) {\n const tabOffsets = new Set();\n const text = textNode.getTextContent();\n let index = text.indexOf('\\t');\n\n // Find all tab occurrences\n while (index !== -1) {\n tabOffsets.add(index);\n tabOffsets.add(index + 1);\n index = text.indexOf('\\t', index + 1);\n }\n\n // Split node to isolate each tab then replace '\\t' into TabNode\n const splitNodes = textNode.splitText(...tabOffsets);\n splitNodes.forEach(node => {\n if (node.getTextContent() === '\\t') {\n node.replace($createTabNode());\n }\n });\n}\nfunction createTextFormatTransformersIndex(textTransformers) {\n const transformersByTag = {};\n const fullMatchRegExpByTag = {};\n const openTagsRegExp = [];\n for (const transformer of textTransformers) {\n const {\n tag\n } = transformer;\n transformersByTag[tag] = transformer;\n const tagRegExp = tag.replace(/(\\*|\\^|\\+)/g, '\\\\$1');\n openTagsRegExp.push(tagRegExp);\n\n // Single-char tag (e.g. \"*\")\n if (tag.length === 1) {\n if (tag === '`') {\n // Capture the preceding character in group 1 (empty string at start-of-string\n // via the ^ branch) rather than using a negative lookbehind, which is not\n // supported in Safari < 16.4. Consumers must add match[1].length to\n // match.index to find the real start of the span (see importTextFormatTransformer.ts).\n fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\\\`])(\\`)((?:\\\\\\\\\\`|[^\\`])+?)(\\`)(?!\\`)`);\n } else {\n fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\${tagRegExp}])(${tagRegExp})((\\\\\\\\${tagRegExp})?.*?[^${tagRegExp}\\\\s](\\\\\\\\${tagRegExp})?)(${tagRegExp})(?![\\\\\\\\${tagRegExp}])`);\n }\n } else {\n // Multi-char tags (e.g. \"**\")\n fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\])(${tagRegExp})((\\\\\\\\${tagRegExp})?.*?[^\\\\s](\\\\\\\\${tagRegExp})?)(${tagRegExp})(?!\\\\\\\\)`);\n }\n }\n return {\n // Reg exp to find open tag + content + close tag\n fullMatchRegExpByTag,\n // Regexp to locate *any* potential opening tag (longest first).\n // The former (?<!\\\\) escape guard has been removed — the delimiter\n // scanner's isEscaped() check handles escape filtering at match time.\n openTagsRegExp: new RegExp(`(${openTagsRegExp.join('|')})`, 'g'),\n transformersByTag\n };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst ORDERED_LIST_REGEX = /^(\\s*)(\\d{1,})\\.\\s/;\nconst UNORDERED_LIST_REGEX = /^(\\s*)[-*+]\\s/;\nconst CHECK_LIST_REGEX = /^(\\s*)(?:[-*+]\\s)?\\s?(\\[(\\s|x)?\\])\\s/i;\nconst HEADING_REGEX = /^(#{1,6})\\s/;\nconst QUOTE_REGEX = /^>\\s/;\nconst CODE_START_REGEX = /^([ \\t]*`{3,})([\\w-]+)?[ \\t]?/;\nconst CODE_END_REGEX = /^[ \\t]*`{3,}$/;\nconst CODE_SINGLE_LINE_REGEX = /^[ \\t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/;\nconst TABLE_ROW_REG_EXP = /^(?:\\|)(.+)(?:\\|)\\s?$/;\nconst TABLE_ROW_DIVIDER_REG_EXP = /^(\\| ?:?-*:? ?)+\\|\\s?$/;\nconst TAG_START_REGEX = /^<[a-z_][\\w-]*(?:\\s[^<>]*)?\\/?>/i;\nconst TAG_END_REGEX = /^<\\/[a-z_][\\w-]*\\s*>/i;\nconst ENDS_WITH = regex => new RegExp(`(?:${regex.source})$`, regex.flags);\nconst listMarkerState = createState('mdListMarker', {\n parse: v => typeof v === 'string' && /^[-*+]$/.test(v) ? v : '-',\n resetOnCopyNode: true\n});\nconst codeFenceState = createState('mdCodeFence', {\n parse: val => {\n if (typeof val === 'string' && /^`{3,}$/.test(val)) {\n return val;\n }\n return '```';\n },\n resetOnCopyNode: true\n});\nconst createBlockNode = createNode => {\n return (parentNode, children, match, isImport) => {\n const node = createNode(match);\n node.append(...children);\n parentNode.replace(node);\n if (!isImport) {\n node.select(0, 0);\n }\n };\n};\n\n// Amount of spaces that define indentation level\n// TODO: should be an option\nconst LIST_INDENT_SIZE = 4;\nfunction getIndent(whitespaces) {\n const tabs = whitespaces.match(/\\t/g);\n const spaces = whitespaces.match(/ /g);\n let indent = 0;\n if (tabs) {\n indent += tabs.length;\n }\n if (spaces) {\n indent += Math.floor(spaces.length / LIST_INDENT_SIZE);\n }\n return indent;\n}\nconst listReplace = listType => {\n return (parentNode, children, match, isImport) => {\n const previousNode = parentNode.getPreviousSibling();\n const nextNode = parentNode.getNextSibling();\n const listItem = $createListItemNode(listType === 'check' ? match[3] === 'x' : undefined);\n const firstMatchChar = match[0].trim()[0];\n const listMarker = (listType === 'bullet' || listType === 'check') && firstMatchChar === listMarkerState.parse(firstMatchChar) ? firstMatchChar : undefined;\n if ($isListNode(nextNode) && nextNode.getListType() === listType) {\n if (listMarker) {\n $setState(nextNode, listMarkerState, listMarker);\n }\n const firstChild = nextNode.getFirstChild();\n if (firstChild !== null) {\n firstChild.insertBefore(listItem);\n } else {\n // should never happen, but let's handle gracefully, just in case.\n nextNode.append(listItem);\n }\n parentNode.remove();\n } else if ($isListNode(previousNode) && previousNode.getListType() === listType) {\n if (listMarker) {\n $setState(previousNode, listMarkerState, listMarker);\n }\n previousNode.append(listItem);\n parentNode.remove();\n } else {\n const list = $createListNode(listType, listType === 'number' ? Number(match[2]) : undefined);\n if (listMarker) {\n $setState(list, listMarkerState, listMarker);\n }\n list.append(listItem);\n parentNode.replace(list);\n }\n listItem.append(...children);\n if (!isImport) {\n listItem.select(0, 0);\n }\n const indent = getIndent(match[1]);\n if (indent) {\n listItem.setIndent(indent);\n }\n };\n};\nconst $listExport = (listNode, exportChildren, depth) => {\n const output = [];\n const children = listNode.getChildren();\n let index = 0;\n for (const listItemNode of children) {\n if ($isListItemNode(listItemNode)) {\n if (listItemNode.getChildrenSize() === 1) {\n const firstChild = listItemNode.getFirstChild();\n if ($isListNode(firstChild)) {\n output.push($listExport(firstChild, exportChildren, depth + 1));\n continue;\n }\n }\n const indent = ' '.repeat(depth * LIST_INDENT_SIZE);\n const listType = listNode.getListType();\n const listMarker = $getState(listNode, listMarkerState);\n const prefix = listType === 'number' ? `${listNode.getStart() + index}. ` : listType === 'check' ? `${listMarker} [${listItemNode.getChecked() ? 'x' : ' '}] ` : listMarker + ' ';\n let childrenText = exportChildren(listItemNode);\n if (listType !== 'number') {\n childrenText = childrenText.replace(/^(\\s{0,3}\\d+)(\\.\\s)/, '$1\\\\$2');\n }\n output.push(indent + prefix + childrenText);\n index++;\n }\n }\n return output.join('\\n');\n};\nconst HEADING = {\n dependencies: [HeadingNode],\n export: (node, exportChildren) => {\n if (!$isHeadingNode(node)) {\n return null;\n }\n const level = Number(node.getTag().slice(1));\n return '#'.repeat(level) + ' ' + exportChildren(node);\n },\n regExp: HEADING_REGEX,\n replace: createBlockNode(match => {\n const tag = 'h' + match[1].length;\n return $createHeadingNode(tag);\n }),\n type: 'element'\n};\nconst QUOTE = {\n dependencies: [QuoteNode],\n export: (node, exportChildren) => {\n if (!$isQuoteNode(node)) {\n return null;\n }\n const lines = exportChildren(node).split('\\n');\n const output = [];\n for (const line of lines) {\n output.push('> ' + line);\n }\n return output.join('\\n');\n },\n regExp: QUOTE_REGEX,\n replace: (parentNode, children, _match, isImport) => {\n if (isImport) {\n const previousNode = parentNode.getPreviousSibling();\n if ($isQuoteNode(previousNode)) {\n previousNode.splice(previousNode.getChildrenSize(), 0, [$createLineBreakNode(), ...children]);\n parentNode.remove();\n return;\n }\n }\n const node = $createQuoteNode();\n node.append(...children);\n parentNode.replace(node);\n if (!isImport) {\n node.select(0, 0);\n }\n },\n type: 'element'\n};\nconst CODE = {\n dependencies: [CodeNode],\n export: node => {\n if (!$isCodeNode(node)) {\n return null;\n }\n const textContent = node.getTextContent();\n let fence = $getState(node, codeFenceState);\n if (textContent.indexOf(fence) > -1) {\n const backticks = textContent.match(/`{3,}/g);\n if (backticks) {\n const maxLength = Math.max(...backticks.map(b => b.length));\n fence = '`'.repeat(maxLength + 1);\n }\n }\n return fence + (node.getLanguage() || '') + (textContent ? '\\n' + textContent : '') + '\\n' + fence;\n },\n handleImportAfterStartMatch: ({\n lines,\n rootNode,\n startLineIndex,\n startMatch\n }) => {\n const fence = startMatch[1];\n const fenceLength = fence.trim().length;\n const currentLine = lines[startLineIndex];\n const afterFenceIndex = startMatch.index + fence.length;\n const afterFence = currentLine.slice(afterFenceIndex);\n const singleLineEndRegex = new RegExp(`\\`{${fenceLength},}$`);\n if (singleLineEndRegex.test(afterFence)) {\n const endMatch = afterFence.match(singleLineEndRegex);\n const content = afterFence.slice(0, afterFence.lastIndexOf(endMatch[0]));\n const fakeStartMatch = [...startMatch];\n fakeStartMatch[2] = '';\n CODE.replace(rootNode, null, fakeStartMatch, endMatch, [content], true);\n return [true, startLineIndex];\n }\n const multilineEndRegex = new RegExp(`^[ \\\\t]*\\`{${fenceLength},}$`);\n for (let i = startLineIndex + 1; i < lines.length; i++) {\n const line = lines[i];\n if (multilineEndRegex.test(line)) {\n const endMatch = line.match(multilineEndRegex);\n const linesInBetween = lines.slice(startLineIndex + 1, i);\n const afterFullMatch = currentLine.slice(startMatch[0].length);\n if (afterFullMatch.length > 0) {\n linesInBetween.unshift(afterFullMatch);\n }\n CODE.replace(rootNode, null, startMatch, endMatch, linesInBetween, true);\n return [true, i];\n }\n }\n const linesInBetween = lines.slice(startLineIndex + 1);\n const afterFullMatch = currentLine.slice(startMatch[0].length);\n if (afterFullMatch.length > 0) {\n linesInBetween.unshift(afterFullMatch);\n }\n CODE.replace(rootNode, null, startMatch, null, linesInBetween, true);\n return [true, lines.length - 1];\n },\n regExpEnd: {\n optional: true,\n regExp: CODE_END_REGEX\n },\n regExpStart: CODE_START_REGEX,\n replace: (rootNode, children, startMatch, endMatch, linesInBetween, isImport) => {\n let codeBlockNode;\n let code;\n const fence = startMatch[1] ? startMatch[1].trim() : '```';\n const language = startMatch[2] || undefined;\n if (!children && linesInBetween) {\n if (linesInBetween.length === 1) {\n if (endMatch) {\n codeBlockNode = $createCodeNode(language);\n code = linesInBetween[0];\n } else {\n codeBlockNode = $createCodeNode(language);\n code = linesInBetween[0].startsWith(' ') ? linesInBetween[0].slice(1) : linesInBetween[0];\n }\n } else {\n codeBlockNode = $createCodeNode(language);\n if (linesInBetween.length > 0) {\n if (linesInBetween[0].trim().length === 0) {\n linesInBetween.shift();\n } else if (linesInBetween[0].startsWith(' ')) {\n linesInBetween[0] = linesInBetween[0].slice(1);\n }\n }\n while (linesInBetween.length > 0 && !linesInBetween[linesInBetween.length - 1].length) {\n linesInBetween.pop();\n }\n code = linesInBetween.join('\\n');\n }\n $setState(codeBlockNode, codeFenceState, fence);\n const textNode = $createTextNode(code);\n codeBlockNode.append(textNode);\n rootNode.append(codeBlockNode);\n } else if (children) {\n createBlockNode(match => {\n return $createCodeNode(match ? match[2] : undefined);\n })(rootNode, children, startMatch, isImport);\n }\n },\n type: 'multiline-element'\n};\nconst UNORDERED_LIST = {\n dependencies: [ListNode, ListItemNode],\n export: (node, exportChildren) => {\n return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n },\n regExp: UNORDERED_LIST_REGEX,\n replace: listReplace('bullet'),\n type: 'element'\n};\nconst CHECK_LIST = {\n dependencies: [ListNode, ListItemNode],\n export: (node, exportChildren) => {\n return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n },\n regExp: CHECK_LIST_REGEX,\n replace: listReplace('check'),\n type: 'element'\n};\nconst ORDERED_LIST = {\n dependencies: [ListNode, ListItemNode],\n export: (node, exportChildren) => {\n return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n },\n regExp: ORDERED_LIST_REGEX,\n replace: listReplace('number'),\n type: 'element'\n};\nconst INLINE_CODE = {\n format: ['code'],\n tag: '`',\n type: 'text-format'\n};\nconst HIGHLIGHT = {\n format: ['highlight'],\n tag: '==',\n type: 'text-format'\n};\nconst BOLD_ITALIC_STAR = {\n format: ['bold', 'italic'],\n tag: '***',\n type: 'text-format'\n};\nconst BOLD_ITALIC_UNDERSCORE = {\n format: ['bold', 'italic'],\n intraword: false,\n tag: '___',\n type: 'text-format'\n};\nconst BOLD_STAR = {\n format: ['bold'],\n tag: '**',\n type: 'text-format'\n};\nconst BOLD_UNDERSCORE = {\n format: ['bold'],\n intraword: false,\n tag: '__',\n type: 'text-format'\n};\nconst STRIKETHROUGH = {\n format: ['strikethrough'],\n tag: '~~',\n type: 'text-format'\n};\nconst ITALIC_STAR = {\n format: ['italic'],\n tag: '*',\n type: 'text-format'\n};\nconst ITALIC_UNDERSCORE = {\n format: ['italic'],\n intraword: false,\n tag: '_',\n type: 'text-format'\n};\n\n// Order of text transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n// - then longer tags match (e.g. ** or __ should go before * or _)\nconst LINK = {\n dependencies: [LinkNode],\n export: (node, exportChildren, exportFormat) => {\n if (!$isLinkNode(node) || $isAutoLinkNode(node)) {\n return null;\n }\n const textContent = exportChildren(node);\n let title = node.getTitle();\n if (title != null) {\n title = title.replace(/([\\\\\"])/g, '\\\\$1');\n }\n const linkContent = title ? `[${textContent}](${node.getURL()} \"${title}\")` : `[${textContent}](${node.getURL()})`;\n return linkContent;\n },\n importRegExp: /(?:\\[(.+?)\\])(?:\\((?:([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?)\\))/,\n regExp: /(?:\\[([^[\\]]*(?:\\[[^[\\]]*\\][^[\\]]*)*)\\])(?:\\((?:([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?)\\))$/,\n replace: (textNode, match) => {\n // https://spec.commonmark.org/0.31.2/#inline-link\n if ($findMatchingParent$1(textNode, $isLinkNode)) {\n return;\n }\n const [, linkText, rawLinkUrl, rawLinkTitle] = match;\n const linkUrl = rawLinkUrl != null ? unescapeText(rawLinkUrl) : undefined;\n const linkTitle = rawLinkTitle != null ? unescapeText(rawLinkTitle) : undefined;\n const linkNode = $createLinkNode(linkUrl, {\n title: linkTitle\n });\n const openBracketAmount = linkText.split('[').length - 1;\n const closeBracketAmount = linkText.split(']').length - 1;\n let parsedLinkText = linkText;\n let outsideLinkText = '';\n if (openBracketAmount < closeBracketAmount) {\n return;\n } else if (openBracketAmount > closeBracketAmount) {\n const linkTextParts = linkText.split('[');\n outsideLinkText = '[' + linkTextParts[0];\n parsedLinkText = linkTextParts.slice(1).join('[');\n }\n const linkTextNode = $createTextNode(parsedLinkText);\n linkTextNode.setFormat(textNode.getFormat());\n linkNode.append(linkTextNode);\n textNode.replace(linkNode);\n if (outsideLinkText) {\n linkNode.insertBefore($createTextNode(outsideLinkText));\n }\n return linkTextNode;\n },\n trigger: ')',\n type: 'text-match'\n};\nconst ELEMENT_TRANSFORMERS = [HEADING, QUOTE, UNORDERED_LIST, ORDERED_LIST];\nconst MULTILINE_ELEMENT_TRANSFORMERS = [CODE];\n\n// Order of text format transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n// - then longer tags match (e.g. ** or __ should go before * or _)\nconst TEXT_FORMAT_TRANSFORMERS = [INLINE_CODE, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, HIGHLIGHT, ITALIC_STAR, ITALIC_UNDERSCORE, STRIKETHROUGH];\nconst TEXT_MATCH_TRANSFORMERS = [LINK];\nconst TRANSFORMERS = [...ELEMENT_TRANSFORMERS, ...MULTILINE_ELEMENT_TRANSFORMERS, ...TEXT_FORMAT_TRANSFORMERS, ...TEXT_MATCH_TRANSFORMERS];\nfunction normalizeMarkdown(input, shouldMergeAdjacentLines = false) {\n const lines = input.split('\\n');\n let inCodeBlock = false;\n const sanitizedLines = [];\n for (let i = 0; i < lines.length; i++) {\n const rawLine = lines[i];\n const line = rawLine.trimEnd();\n const lastLine = sanitizedLines[sanitizedLines.length - 1];\n\n // Code blocks of ```single line``` don't toggle the inCodeBlock flag\n if (CODE_SINGLE_LINE_REGEX.test(line)) {\n sanitizedLines.push(line);\n continue;\n }\n\n // Detect the start or end of a code block\n if (CODE_START_REGEX.test(line) || CODE_END_REGEX.test(line)) {\n inCodeBlock = !inCodeBlock;\n sanitizedLines.push(line);\n continue;\n }\n\n // If we are inside a code block, keep the line unchanged\n if (inCodeBlock) {\n sanitizedLines.push(rawLine);\n continue;\n }\n\n // In markdown the concept of \"empty paragraphs\" does not exist.\n // Blocks must be separated by an empty line. Non-empty adjacent lines must be merged.\n if (line === '' || lastLine === '' || !lastLine || HEADING_REGEX.test(lastLine) || HEADING_REGEX.test(line) || QUOTE_REGEX.test(line) || ORDERED_LIST_REGEX.test(line) || UNORDERED_LIST_REGEX.test(line) || CHECK_LIST_REGEX.test(line) || TABLE_ROW_REG_EXP.test(line) || TABLE_ROW_DIVIDER_REG_EXP.test(line) || !shouldMergeAdjacentLines || TAG_START_REGEX.test(line) || TAG_END_REGEX.test(line) || ENDS_WITH(TAG_END_REGEX).test(lastLine) || ENDS_WITH(TAG_START_REGEX).test(lastLine) || CODE_END_REGEX.test(lastLine)) {\n // When not merging, preserve trailing whitespace (e.g. hard line-break\n // markers \" \" or non-breaking spaces). Whitespace-only lines still\n // collapse to '' because trimEnd() already reduced them, so they\n // continue to act as paragraph separators.\n sanitizedLines.push(!shouldMergeAdjacentLines && line !== '' ? rawLine : line);\n } else {\n sanitizedLines[sanitizedLines.length - 1] = lastLine + ' ' + line.trimStart();\n }\n }\n return sanitizedLines.join('\\n');\n}\n\nfunction runElementTransformers(parentNode, anchorNode, anchorOffset, elementTransformers) {\n const grandParentNode = parentNode.getParent();\n if (!$isRootOrShadowRoot(grandParentNode) || parentNode.getFirstChild() !== anchorNode) {\n return false;\n }\n const textContent = anchorNode.getTextContent();\n\n // Checking for anchorOffset position to prevent any checks for cases when caret is too far\n // from a line start to be a part of block-level markdown trigger.\n //\n // TODO:\n // Can have a quick check if caret is close enough to the beginning of the string (e.g. offset less than 10-20)\n // since otherwise it won't be a markdown shortcut, but tables are exception\n if (textContent[anchorOffset - 1] !== ' ') {\n return false;\n }\n for (const {\n regExp,\n replace\n } of elementTransformers) {\n const match = textContent.match(regExp);\n if (match && match[0].length === (match[0].endsWith(' ') ? anchorOffset : anchorOffset - 1)) {\n const nextSiblings = anchorNode.getNextSiblings();\n const [leadingNode, remainderNode] = anchorNode.splitText(anchorOffset);\n const siblings = remainderNode ? [remainderNode, ...nextSiblings] : nextSiblings;\n if (replace(parentNode, siblings, match, false) !== false) {\n leadingNode.remove();\n return true;\n }\n }\n }\n return false;\n}\nfunction runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, elementTransformers, triggerOnEnter) {\n const grandParentNode = parentNode.getParent();\n if (!$isRootOrShadowRoot(grandParentNode) || parentNode.getFirstChild() !== anchorNode) {\n return false;\n }\n const textContent = anchorNode.getTextContent();\n if (!triggerOnEnter) {\n // Checking for anchorOffset position to prevent any checks for cases when caret is too far\n // from a line start to be a part of block-level markdown trigger.\n //\n // TODO:\n // Can have a quick check if caret is close enough to the beginning of the string (e.g. offset less than 10-20)\n // since otherwise it won't be a markdown shortcut, but tables are exception\n if (textContent[anchorOffset - 1] !== ' ') {\n return false;\n }\n }\n for (const {\n regExpStart,\n replace,\n regExpEnd\n } of elementTransformers) {\n if (regExpEnd && !('optional' in regExpEnd) || regExpEnd && 'optional' in regExpEnd && !regExpEnd.optional) {\n continue;\n }\n const match = textContent.match(regExpStart);\n if (match) {\n const matchLength = triggerOnEnter || match[0].endsWith(' ') ? anchorOffset : anchorOffset - 1;\n if (match[0].length !== matchLength) {\n continue;\n }\n const nextSiblings = anchorNode.getNextSiblings();\n const [leadingNode, remainderNode] = anchorNode.splitText(anchorOffset);\n const siblings = remainderNode ? [remainderNode, ...nextSiblings] : nextSiblings;\n if (replace(parentNode, siblings, match, null, null, false) !== false) {\n leadingNode.remove();\n return true;\n }\n }\n }\n return false;\n}\nfunction runTextMatchTransformers(anchorNode, anchorOffset, transformersByTrigger) {\n let textContent = anchorNode.getTextContent();\n const lastChar = textContent[anchorOffset - 1];\n const transformers = transformersByTrigger[lastChar];\n if (transformers == null) {\n return false;\n }\n\n // If typing in the middle of content, remove the tail to do\n // reg exp match up to a string end (caret position)\n if (anchorOffset < textContent.length) {\n textContent = textContent.slice(0, anchorOffset);\n }\n for (const transformer of transformers) {\n if (!transformer.replace || !transformer.regExp) {\n continue;\n }\n const match = textContent.match(transformer.regExp);\n if (match === null) {\n continue;\n }\n const startIndex = match.index || 0;\n const endIndex = startIndex + match[0].length;\n let replaceNode;\n if (startIndex === 0) {\n [replaceNode] = anchorNode.splitText(endIndex);\n } else {\n [, replaceNode] = anchorNode.splitText(startIndex, endIndex);\n }\n replaceNode.selectNext(0, 0);\n transformer.replace(replaceNode, match);\n return true;\n }\n return false;\n}\nfunction $runTextFormatTransformers(anchorNode, anchorOffset, textFormatTransformers) {\n const textContent = anchorNode.getTextContent();\n const closeTagEndIndex = anchorOffset - 1;\n const closeChar = textContent[closeTagEndIndex];\n // Quick check if we're possibly at the end of inline markdown style\n const matchers = textFormatTransformers[closeChar];\n if (!matchers) {\n return false;\n }\n for (const matcher of matchers) {\n const {\n tag\n } = matcher;\n const tagLength = tag.length;\n const closeTagStartIndex = closeTagEndIndex - tagLength + 1;\n\n // If tag is not single char check if rest of it matches with text content\n if (tagLength > 1) {\n if (!isEqualSubString(textContent, closeTagStartIndex, tag, 0, tagLength)) {\n continue;\n }\n }\n\n // Space before closing tag cancels inline markdown\n if (textContent[closeTagStartIndex - 1] === ' ') {\n continue;\n }\n\n // Some tags can not be used within words, hence should have newline/space/punctuation after it\n const afterCloseTagChar = textContent[closeTagEndIndex + 1];\n if (matcher.intraword === false && afterCloseTagChar && !PUNCTUATION_OR_SPACE.test(afterCloseTagChar)) {\n continue;\n }\n const closeNode = anchorNode;\n let openNode = closeNode;\n let openTagStartIndex = getOpenTagStartIndex(textContent, closeTagStartIndex, tag);\n\n // Go through text node siblings and search for opening tag\n // if haven't found it within the same text node as closing tag\n let sibling = openNode;\n while (openTagStartIndex < 0 && (sibling = sibling.getPreviousSibling())) {\n if ($isLineBreakNode(sibling)) {\n break;\n }\n if ($isTextNode(sibling)) {\n if (sibling.hasFormat('code')) {\n continue;\n }\n const siblingTextContent = sibling.getTextContent();\n openNode = sibling;\n openTagStartIndex = getOpenTagStartIndex(siblingTextContent, siblingTextContent.length, tag);\n }\n }\n\n // Opening tag is not found\n if (openTagStartIndex < 0) {\n continue;\n }\n\n // No content between opening and closing tag\n if (openNode === closeNode && openTagStartIndex + tagLength === closeTagStartIndex) {\n continue;\n }\n\n // Checking longer tags for repeating chars (e.g. *** vs **)\n const prevOpenNodeText = openNode.getTextContent();\n if (openTagStartIndex > 0 && prevOpenNodeText[openTagStartIndex - 1] === closeChar) {\n continue;\n }\n\n // Some tags can not be used within words, hence should have newline/space/punctuation before it\n const beforeOpenTagChar = prevOpenNodeText[openTagStartIndex - 1];\n if (matcher.intraword === false && beforeOpenTagChar && !PUNCTUATION_OR_SPACE.test(beforeOpenTagChar)) {\n continue;\n }\n\n // Per CommonMark, code spans take precedence over other inline formatting\n if (!matcher.format.includes('code') && $isInsideUnclosedCodeSpan(openNode, openTagStartIndex)) {\n continue;\n }\n\n // Clean text from opening and closing tags (starting from closing tag\n // to prevent any offset shifts if we start from opening one)\n const prevCloseNodeText = closeNode.getTextContent();\n const closeNodeText = prevCloseNodeText.slice(0, closeTagStartIndex) + prevCloseNodeText.slice(closeTagEndIndex + 1);\n closeNode.setTextContent(closeNodeText);\n const openNodeText = openNode === closeNode ? closeNodeText : prevOpenNodeText;\n openNode.setTextContent(openNodeText.slice(0, openTagStartIndex) + openNodeText.slice(openTagStartIndex + tagLength));\n const selection = $getSelection();\n const nextSelection = $createRangeSelection();\n $setSelection(nextSelection);\n // Adjust offset based on deleted chars\n const newOffset = closeTagEndIndex - tagLength * (openNode === closeNode ? 2 : 1) + 1;\n nextSelection.anchor.set(openNode.__key, openTagStartIndex, 'text');\n nextSelection.focus.set(closeNode.__key, newOffset, 'text');\n\n // Apply formatting to selected text\n for (const format of matcher.format) {\n if (!nextSelection.hasFormat(format)) {\n nextSelection.formatText(format);\n }\n }\n\n // Collapse selection up to the focus point\n nextSelection.anchor.set(nextSelection.focus.key, nextSelection.focus.offset, nextSelection.focus.type);\n\n // Remove formatting from collapsed selection\n for (const format of matcher.format) {\n if (nextSelection.hasFormat(format)) {\n nextSelection.toggleFormat(format);\n }\n }\n if ($isRangeSelection(selection)) {\n nextSelection.format = selection.format;\n }\n return true;\n }\n return false;\n}\n\n// Per CommonMark spec, code spans take precedence over other inline\n// formatting. Returns true if there is an unclosed backtick (code span\n// opener) in the text preceding the given offset, which means the offset\n// is inside a code span that hasn't been closed yet.\nfunction $isInsideUnclosedCodeSpan(node, offset) {\n let backtickCount = 0;\n const text = node.getTextContent();\n for (let i = 0; i < offset; i++) {\n if (text[i] === '`') {\n backtickCount++;\n }\n }\n return backtickCount % 2 !== 0;\n}\nfunction getOpenTagStartIndex(string, maxIndex, tag) {\n const tagLength = tag.length;\n for (let i = maxIndex; i >= tagLength; i--) {\n const startIndex = i - tagLength;\n if (isEqualSubString(string, startIndex, tag, 0, tagLength) &&\n // Space after opening tag cancels transformation\n string[startIndex + tagLength] !== ' ') {\n return startIndex;\n }\n }\n return -1;\n}\nfunction isEqualSubString(stringA, aStart, stringB, bStart, length) {\n for (let i = 0; i < length; i++) {\n if (stringA[aStart + i] !== stringB[bStart + i]) {\n return false;\n }\n }\n return true;\n}\nfunction registerMarkdownShortcuts(editor, transformers = TRANSFORMERS) {\n const byType = transformersByType(transformers);\n const textFormatTransformersByTrigger = indexBy(byType.textFormat, ({\n tag\n }) => tag[tag.length - 1]);\n const textMatchTransformersByTrigger = indexBy(byType.textMatch, ({\n trigger\n }) => trigger);\n for (const transformer of transformers) {\n const type = transformer.type;\n if (type === 'element' || type === 'text-match' || type === 'multiline-element') {\n const dependencies = transformer.dependencies;\n for (const node of dependencies) {\n if (!editor.hasNode(node)) {\n {\n formatDevErrorMessage(`MarkdownShortcuts: missing dependency ${node.getType()} for transformer. Ensure node dependency is included in editor initial config.`);\n }\n }\n }\n }\n }\n const $transform = (parentNode, anchorNode, anchorOffset) => {\n if (runElementTransformers(parentNode, anchorNode, anchorOffset, byType.element)) {\n return true;\n }\n if (runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, byType.multilineElement)) {\n return true;\n }\n if (runTextMatchTransformers(anchorNode, anchorOffset, textMatchTransformersByTrigger)) {\n return true;\n }\n if ($runTextFormatTransformers(anchorNode, anchorOffset, textFormatTransformersByTrigger)) {\n return true;\n }\n return false;\n };\n return mergeRegister(editor.registerUpdateListener(({\n tags,\n dirtyLeaves,\n editorState,\n prevEditorState\n }) => {\n // Ignore updates from collaboration and undo/redo (as changes already calculated)\n if (tags.has(COLLABORATION_TAG) || tags.has(HISTORIC_TAG)) {\n return;\n }\n\n // If editor is still composing (i.e. backticks) we must wait before the user confirms the key\n if (editor.isComposing()) {\n return;\n }\n const selection = editorState.read($getSelection);\n const prevSelection = prevEditorState.read($getSelection);\n\n // We expect selection to be a collapsed range and not match previous one (as we want\n // to trigger transforms only as user types)\n if (!$isRangeSelection(prevSelection) || !$isRangeSelection(selection) || !selection.isCollapsed() || selection.is(prevSelection)) {\n return;\n }\n const anchorKey = selection.anchor.key;\n const anchorOffset = selection.anchor.offset;\n const anchorNode = editorState._nodeMap.get(anchorKey);\n if (!$isTextNode(anchorNode) || !dirtyLeaves.has(anchorKey) || anchorOffset !== 1 && anchorOffset > prevSelection.anchor.offset + 1) {\n return;\n }\n editor.update(() => {\n if (!canContainTransformableMarkdown(anchorNode)) {\n return;\n }\n const parentNode = anchorNode.getParent();\n if (parentNode === null || $isCodeNode(parentNode)) {\n return;\n }\n if ($transform(parentNode, anchorNode, selection.anchor.offset)) {\n $addUpdateTag(HISTORY_PUSH_TAG);\n }\n });\n }), editor.registerCommand(KEY_ENTER_COMMAND, event => {\n if (event !== null && event.shiftKey) {\n return false;\n }\n const selection = $getSelection();\n if (!$isRangeSelection(selection) || !selection.isCollapsed()) {\n return false;\n }\n const anchorOffset = selection.anchor.offset;\n const anchorNode = selection.anchor.getNode();\n if (!$isTextNode(anchorNode) || !canContainTransformableMarkdown(anchorNode)) {\n return false;\n }\n const parentNode = anchorNode.getParent();\n if (parentNode === null || $isCodeNode(parentNode)) {\n return false;\n }\n const textContent = anchorNode.getTextContent();\n if (anchorOffset !== textContent.length) {\n return false;\n }\n if (runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, byType.multilineElement, true)) {\n if (event !== null) {\n event.preventDefault();\n }\n return true;\n }\n return false;\n }, COMMAND_PRIORITY_LOW));\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n *\n * @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions\n * @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.\n */\nfunction $convertFromMarkdownString(markdown, transformers = TRANSFORMERS, node, shouldPreserveNewLines = false, shouldMergeAdjacentLines = false) {\n const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);\n const importMarkdown = createMarkdownImport(transformers, shouldPreserveNewLines);\n return importMarkdown(sanitizedMarkdown, node);\n}\n\n/**\n * Renders string from markdown. The selection is moved to the start after the operation.\n */\nfunction $convertToMarkdownString(transformers = TRANSFORMERS, node, shouldPreserveNewLines = false) {\n const exportMarkdown = createMarkdownExport(transformers, shouldPreserveNewLines);\n return exportMarkdown(node);\n}\n\nexport { $convertFromMarkdownString, $convertToMarkdownString, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CHECK_LIST, CODE, ELEMENT_TRANSFORMERS, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, LINK, MULTILINE_ELEMENT_TRANSFORMERS, ORDERED_LIST, QUOTE, STRIKETHROUGH, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS, UNORDERED_LIST, registerMarkdownShortcuts };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,SAAS,QAAQ,MAAM,UAAU;CAC/B,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,QAAQ,MAAM;EACvB,MAAM,MAAM,SAAS,IAAI;EACzB,IAAI,CAAC,KACH;EAEF,IAAI,MAAM,MACR,MAAM,KAAK,KAAK,IAAI;OAEpB,MAAM,OAAO,CAAC,IAAI;CAEtB;CACA,OAAO;AACT;AACA,SAAS,mBAAmB,cAAc;CACxC,MAAM,SAAS,QAAQ,eAAc,MAAK,EAAE,IAAI;CAChD,OAAO;EACL,SAAS,OAAO,WAAW,CAAC;EAC5B,kBAAkB,OAAO,wBAAwB,CAAC;EAClD,YAAY,OAAO,kBAAkB,CAAC;EACtC,WAAW,OAAO,iBAAiB,CAAC;CACtC;AACF;AACA,MAAM,uBAAuB;AAC7B,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,8BAA8B;AACpC,SAAS,iBAAiB,MAAM;CAC9B,IAAI,CAAC,iBAAiB,IAAI,GACxB,OAAO;CAET,MAAM,aAAa,KAAK,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iBADgB,WAAW,eACA,EAAE,QAC/B,OAAO;EAET,IAAI,gCAAgC,YAAY,YAAY,cAAc,OAAO,kBAAkB,IAAI,GAAG;GACxG,IAAI,UAAU,MACZ,MAAM,eAAe;GAEvB,OAAO;EACT;EACA,OAAO;CACT,GAAG,oBAAoB,CAAC;AAC1B;;;;;;;;;;;;;;AAiBA,SAAS,2BAA2B,UAAU,eAAe,cAAc,MAAM,yBAAyB,OAAO,2BAA2B,OAAO;CACjJ,MAAM,oBAAoB,yBAAyB,WAAW,kBAAkB,UAAU,wBAAwB;CAElH,OADuB,qBAAqB,cAAc,sBACtC,EAAE,mBAAmB,IAAI;AAC/C;;;;AAKA,SAAS,yBAAyB,eAAe,cAAc,MAAM,yBAAyB,OAAO;CAEnG,OADuB,qBAAqB,cAAc,sBACtC,EAAE,IAAI;AAC5B"}
@@ -1,6 +1,6 @@
1
- import { _ as LinkNode, a as HeadingNode, c as $createListNode, d as ListItemNode, f as ListNode, h as $isLinkNode, i as $isQuoteNode, l as $isListItemNode, m as $isAutoLinkNode, n as $createQuoteNode, o as QuoteNode, p as $createLinkNode, r as $isHeadingNode, s as $createListItemNode, t as $createHeadingNode, u as $isListNode, v as $createCodeNode, x as CodeNode, y as $isCodeNode } from "./LexicalRichText.node-B7k7wlQz.mjs";
2
- import { An as createState, At as COMMAND_PRIORITY_LOW, Et as COLLABORATION_TAG, Jt as HISTORY_PUSH_TAG, Kt as HISTORIC_TAG, R as $getRoot, V as $getState, Xn as mergeRegister, Y as $isElementNode, _ as $createTextNode, at as $isRootOrShadowRoot, bt as $setState, ct as $isTextNode, et as $isLineBreakNode, f as $createParagraphNode, g as $createTabNode, m as $createRangeSelection, nt as $isParagraphNode, on as KEY_ENTER_COMMAND, q as $isDecoratorNode, rt as $isRangeSelection, t as $addUpdateTag, u as $createLineBreakNode, vt as $setSelection, y as $findMatchingParent, z as $getSelection } from "./Lexical.node-gYNDt_p9.mjs";
3
- import { r as $findMatchingParent$1 } from "./LexicalUtils.node-CmK462d1.mjs";
1
+ import { _ as LinkNode, a as HeadingNode, c as $createListNode, d as ListItemNode, f as ListNode, h as $isLinkNode, i as $isQuoteNode, l as $isListItemNode, m as $isAutoLinkNode, n as $createQuoteNode, o as QuoteNode, p as $createLinkNode, r as $isHeadingNode, s as $createListItemNode, t as $createHeadingNode, u as $isListNode, v as $createCodeNode, x as CodeNode, y as $isCodeNode } from "./LexicalRichText.node-BEkm_YwY.mjs";
2
+ import { An as createState, At as COMMAND_PRIORITY_LOW, Et as COLLABORATION_TAG, Jt as HISTORY_PUSH_TAG, Kt as HISTORIC_TAG, R as $getRoot, V as $getState, Xn as mergeRegister, Y as $isElementNode, _ as $createTextNode, at as $isRootOrShadowRoot, bt as $setState, ct as $isTextNode, et as $isLineBreakNode, f as $createParagraphNode, g as $createTabNode, m as $createRangeSelection, nt as $isParagraphNode, on as KEY_ENTER_COMMAND, q as $isDecoratorNode, rt as $isRangeSelection, t as $addUpdateTag, u as $createLineBreakNode, vt as $setSelection, y as $findMatchingParent, z as $getSelection } from "./Lexical.node-BR9e7Cyk.mjs";
3
+ import { r as $findMatchingParent$1 } from "./LexicalUtils.node-Dz-HANi6.mjs";
4
4
  //#region ../../node_modules/.pnpm/@lexical+markdown@0.44.0/node_modules/@lexical/markdown/LexicalMarkdown.prod.mjs
5
5
  /**
6
6
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -753,4 +753,4 @@ function le(t = te, e, o = !1) {
753
753
  //#endregion
754
754
  export { ie as $convertFromMarkdownString, le as $convertToMarkdownString, Wt as BOLD_ITALIC_STAR, Dt as BOLD_ITALIC_UNDERSCORE, Kt as BOLD_STAR, qt as BOLD_UNDERSCORE, At as CHECK_LIST, Ot as CODE, Vt as ELEMENT_TRANSFORMERS, _t as HEADING, Ut as HIGHLIGHT, zt as INLINE_CODE, Ht as ITALIC_STAR, Jt as ITALIC_UNDERSCORE, Qt as LINK, Xt as MULTILINE_ELEMENT_TRANSFORMERS, Pt as ORDERED_LIST, Bt as QUOTE, Gt as STRIKETHROUGH, Yt as TEXT_FORMAT_TRANSFORMERS, Zt as TEXT_MATCH_TRANSFORMERS, te as TRANSFORMERS, jt as UNORDERED_LIST, se as registerMarkdownShortcuts };
755
755
 
756
- //# sourceMappingURL=LexicalMarkdown.prod-k73tZVb2.mjs.map
756
+ //# sourceMappingURL=LexicalMarkdown.prod-tGG6js4r.mjs.map