@fewangsit/wangsvue-fats 1.0.0-alpha.41 → 1.0.0-alpha.43

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 (373) hide show
  1. package/ButtonCopy-C6DSmsOR.es.js +4 -0
  2. package/ButtonCopy-CeBlNyVx.system.js +1 -0
  3. package/ButtonSync-BLyCwwnU.system.js +1 -0
  4. package/ButtonSync-DtUhn-Q-.es.js +4 -0
  5. package/ButtonToggle-B9Fa75pf.es.js +4 -0
  6. package/ButtonToggle-CSxzlLR2.system.js +1 -0
  7. package/ButtonViewLog-B1oa4oFN.es.js +4 -0
  8. package/ButtonViewLog-_J6r7Oz8.system.js +1 -0
  9. package/Card-B19WgA6Y.es.js +4 -0
  10. package/Card-umUgd-nP.system.js +1 -0
  11. package/InputEmail-BZ5Y0wSk.system.js +1 -0
  12. package/InputEmail-DR_E1DsL.es.js +4 -0
  13. package/InputURL-DL6a94kM.system.js +1 -0
  14. package/InputURL-PVF5EUUY.es.js +4 -0
  15. package/Loading-Cq7rP88c.system.js +1 -0
  16. package/Loading-DUHTVct4.es.js +4 -0
  17. package/UserWithIcon-Ddn_GlNu.system.js +1 -0
  18. package/UserWithIcon-hWXf-A2U.es.js +4 -0
  19. package/assets/lottie/loading-page-B9ooQcfF.system.js +1 -0
  20. package/assets/lottie/loading-page-CQ0mKER2.es.js +15 -0
  21. package/assets/lottie/loading-table-B4T3FYiI.system.js +1 -0
  22. package/assets/lottie/loading-table-BnpbX8Ew.es.js +15 -0
  23. package/assets/lottie/no-data-CMWnya_k.system.js +1 -0
  24. package/{no-data-DLHO1L_u.js → assets/lottie/no-data-DOy8kIGF.es.js} +13 -2
  25. package/async-components/index-C8nb7p3T.es.js +70 -0
  26. package/async-components/index-DvjqHrYE.system.js +1 -0
  27. package/components/animation/Animation-CCEnvZ_Z.es.js +48 -0
  28. package/components/animation/Animation-CJb4YIwm.system.js +1 -0
  29. package/components/approverinfo/ApproverInfo-Bruotw1h.es.js +127 -0
  30. package/components/approverinfo/ApproverInfo-CoWywuLZ.system.js +1 -0
  31. package/components/assetinfo/AssetInfo-B8KAsqvC.system.js +1 -0
  32. package/components/assetinfo/AssetInfo-DNsWx4Xv.es.js +201 -0
  33. package/components/badge/Badge-DXAyz4Z8.es.js +99 -0
  34. package/components/badge/Badge-wSExdsOP.system.js +1 -0
  35. package/components/badgegroup/BadgeGroup-CAYL_5-g.system.js +1 -0
  36. package/components/badgegroup/BadgeGroup-Dl2cL80L.es.js +68 -0
  37. package/components/basetree/BaseTree-CmBp0uwr.system.js +1 -0
  38. package/components/basetree/BaseTree-RsvvntBp.es.js +167 -0
  39. package/components/basetree/TreeNode-CUL5_2Rj.es.js +499 -0
  40. package/components/basetree/TreeNode-D-YgXird.system.js +1 -0
  41. package/components/breadcrumb/Breadcrumb-BmuuCYJx.system.js +1 -0
  42. package/components/breadcrumb/Breadcrumb-oqdG9WGT.es.js +46 -0
  43. package/components/button/Button-CgkhMnxo.es.js +124 -0
  44. package/components/button/Button-D892iaxz.system.js +1 -0
  45. package/components/buttonbulkaction/ButtonBulkAction-CAamlaLP.system.js +1 -0
  46. package/components/buttonbulkaction/ButtonBulkAction-Tdf3aVtp.es.js +189 -0
  47. package/components/buttoncopy/ButtonCopy-CUFHlIO-.es.js +31 -0
  48. package/components/buttoncopy/ButtonCopy-CZPTLNHh.system.js +1 -0
  49. package/components/buttoncopy/ButtonCopy.vue.d.ts +6 -4
  50. package/components/buttondownload/ButtonDownload-BWGTiJnP.es.js +61 -0
  51. package/components/buttondownload/ButtonDownload-CUR6u0AT.system.js +1 -0
  52. package/components/buttonfilter/ButtonFilter-B1F4poKd.system.js +1 -0
  53. package/components/buttonfilter/ButtonFilter-B49leY-q.es.js +28 -0
  54. package/components/buttonradio/ButtonRadio-D6xKhPLg.es.js +83 -0
  55. package/components/buttonradio/ButtonRadio-NBcy0Epa.system.js +1 -0
  56. package/components/buttonscan/ButtonScan-BZzpqBe8.system.js +1 -0
  57. package/components/buttonscan/ButtonScan-mVHAdACL.es.js +387 -0
  58. package/components/buttonscan/workers/scanner.worker-8_0GG6W3.system.js +1 -0
  59. package/components/buttonscan/workers/scanner.worker-D3a72Zyk.es.js +25 -0
  60. package/components/buttonsearch/ButtonSearch-3hnarf3D.system.js +1 -0
  61. package/components/buttonsearch/ButtonSearch-BjcXUDQZ.es.js +70 -0
  62. package/components/buttonselecttree/ButtonSelectTree-D0lT3Exu.es.js +218 -0
  63. package/components/buttonselecttree/ButtonSelectTree-DKmPV8FD.system.js +1 -0
  64. package/components/buttonselectuser/ButtonSelectUser-B7GbLfS-.system.js +1 -0
  65. package/components/buttonselectuser/ButtonSelectUser-OAZRY9OR.es.js +101 -0
  66. package/components/buttonsync/ButtonSync-Brk16H8C.es.js +29 -0
  67. package/components/buttonsync/ButtonSync-D5lXmtHs.system.js +1 -0
  68. package/components/buttontoggle/ButtonToggle-1R5y5DCx.es.js +11 -0
  69. package/components/buttontoggle/ButtonToggle-DLsiXxjK.system.js +1 -0
  70. package/components/buttonviewlog/ButtonViewLog-CGsSkrzf.es.js +21 -0
  71. package/components/buttonviewlog/ButtonViewLog-leLO6F_N.system.js +1 -0
  72. package/components/calendar/BaseCalendar-5EI1UTbl.es.js +867 -0
  73. package/components/calendar/BaseCalendar-C02-gmOQ.system.js +1 -0
  74. package/components/calendar/Calendar-B2z-lfi9.es.js +112 -0
  75. package/components/calendar/Calendar-CWw4R5mN.system.js +1 -0
  76. package/components/card/Card-BccG14LV.es.js +47 -0
  77. package/components/card/Card-BjI-Xi0S.system.js +1 -0
  78. package/components/checkbox/Checkbox-DBU7Ji2C.es.js +135 -0
  79. package/components/checkbox/Checkbox-FZg_wq3C.system.js +1 -0
  80. package/components/codesnippet/CodeSnippet--pMQi4aO.es.js +127 -0
  81. package/components/codesnippet/CodeSnippet-BVwAQPSv.system.js +2 -0
  82. package/components/customcolumn/ColumnList-fdR5JfHj.es.js +159 -0
  83. package/components/customcolumn/ColumnList-yaNVEQFA.system.js +1 -0
  84. package/components/customcolumn/CustomColumn-CfvCLH4v.es.js +139 -0
  85. package/components/customcolumn/CustomColumn-D3u59-Rd.system.js +1 -0
  86. package/components/customcolumn/helpers/setVisibilityColumn.helper-B1vEZDtD.system.js +1 -0
  87. package/components/customcolumn/helpers/setVisibilityColumn.helper-CQ4P_C_9.es.js +16 -0
  88. package/components/datatable/DataTable-BH7Fk88O.es.js +992 -0
  89. package/components/datatable/DataTable-Cko2S6sM.system.js +1 -0
  90. package/components/datatable/MultiRow-B2vMSb7W.es.js +52 -0
  91. package/components/datatable/MultiRow-Sef5icam.system.js +1 -0
  92. package/components/datatable/store/dataTable.store-B4p-hj3w.es.js +37 -0
  93. package/components/datatable/store/dataTable.store-C9376aEJ.system.js +1 -0
  94. package/components/dialog/Dialog-BCcbXSya.es.js +121 -0
  95. package/components/dialog/Dialog-Dv7Jzg4E.system.js +1 -0
  96. package/components/dialogconfirm/DialogConfirm-BU-LRZCo.system.js +1 -0
  97. package/components/dialogconfirm/DialogConfirm-ByIWXisz.es.js +139 -0
  98. package/components/dialogform/DialogForm-DGl_NOEr.system.js +1 -0
  99. package/components/dialogform/DialogForm-tAbix3iC.es.js +222 -0
  100. package/components/dialogselecttree/DialogSelectTree-BrVtt3iG.es.js +268 -0
  101. package/components/dialogselecttree/DialogSelectTree-CT7dKC5N.system.js +1 -0
  102. package/components/dialogselectuser/DialogSelectUser-Bu7z7lUq.es.js +121 -0
  103. package/components/dialogselectuser/DialogSelectUser-DXL_NMJj.system.js +1 -0
  104. package/components/dialogselectuser/DialogSelectUserFilter-BNbIynoa.system.js +1 -0
  105. package/components/dialogselectuser/DialogSelectUserFilter-BgBrQCz1.es.js +44 -0
  106. package/components/dialogselectuser/options/columns-BKDHtwAp.es.js +71 -0
  107. package/components/dialogselectuser/options/columns-DLmJdDTR.system.js +1 -0
  108. package/components/dropdown/Dropdown-BNzT2uLU.system.js +1 -0
  109. package/components/dropdown/Dropdown-Dk4urj-W.es.js +258 -0
  110. package/components/editor/CodeSnippetAdapter-C0f7wytw.es.js +26 -0
  111. package/components/editor/CodeSnippetAdapter-f-VHwbwS.system.js +1 -0
  112. package/components/editor/Editor-RB5MqBs1.es.js +887 -0
  113. package/components/editor/Editor-upU4Z9FH.system.js +1 -0
  114. package/components/editor/EditorButton-CC6U1a_u.system.js +1 -0
  115. package/components/editor/EditorButton-Cfew79JD.es.js +28 -0
  116. package/components/editor/MentionList-BjWKefLh.system.js +1 -0
  117. package/components/editor/MentionList-CdX0_-TK.es.js +58 -0
  118. package/components/editor/MentionSection-5I-FSwew.es.js +52 -0
  119. package/components/editor/MentionSection-CiuaeX4J.system.js +3 -0
  120. package/components/editor/codeSnippetExtension-C-ADHg2S.es.js +40 -0
  121. package/components/editor/codeSnippetExtension-C3uj0fCk.system.js +1 -0
  122. package/components/editor/mentionSectionExtension-DJ6wkX1L.system.js +1 -0
  123. package/components/editor/mentionSectionExtension-rbWufuMT.es.js +46 -0
  124. package/components/editor/suggestion-BcYK0KeI.system.js +1 -0
  125. package/components/editor/suggestion-mkkpQFP-.es.js +41 -0
  126. package/components/fieldwrapper/FieldWrapper-Dc-stQRH.system.js +1 -0
  127. package/components/fieldwrapper/FieldWrapper-DmOogUM5.es.js +35 -0
  128. package/components/fileupload/FileUpload-0EHKlInu.es.js +175 -0
  129. package/components/fileupload/FileUpload-dXrsIAeC.system.js +1 -0
  130. package/components/filtercontainer/FilterContainer-Cd8TpncM.es.js +234 -0
  131. package/components/filtercontainer/FilterContainer-kkw3n3tu.system.js +1 -0
  132. package/components/filtercontainer/helpers/applyFilter.helper-Ci22FrPF.system.js +1 -0
  133. package/components/filtercontainer/helpers/applyFilter.helper-DpVdjYBr.es.js +56 -0
  134. package/components/form/Form-By85t_oI.system.js +1 -0
  135. package/components/form/Form-DhWBpdkq.es.js +181 -0
  136. package/components/hardwaresync/HardwareSync-BckCfIeF.es.js +238 -0
  137. package/components/hardwaresync/HardwareSync-DcgVc0cL.system.js +1 -0
  138. package/components/hardwaresync/store/device.store-DEKXH36R.system.js +1 -0
  139. package/components/hardwaresync/store/device.store-DpVE6Nhl.es.js +20 -0
  140. package/components/icon/Icon-C4kXVcEX.es.js +82 -0
  141. package/components/icon/Icon-D1a666FC.system.js +1 -0
  142. package/components/image/Image-Bf5EaBWP.es.js +170 -0
  143. package/components/image/Image-Cxi0E9gK.system.js +1 -0
  144. package/components/imagecompressor/BackgroundImageCropper-DhrTpgNX.system.js +1 -0
  145. package/components/imagecompressor/BackgroundImageCropper-hiHqCcIy.es.js +52 -0
  146. package/components/imagecompressor/ImageCompressor-C_vnTwmo.system.js +1 -0
  147. package/components/imagecompressor/ImageCompressor-DPo-1Yo8.es.js +509 -0
  148. package/components/imagecompressor/ImageInputInfo-4Ac8cBDM.es.js +46 -0
  149. package/components/imagecompressor/ImageInputInfo-U3hLlbwo.system.js +1 -0
  150. package/components/index-BMti6lK3.es.js +64 -0
  151. package/components/index-DBzSxIov.system.js +1 -0
  152. package/components/index.d.ts +162 -60
  153. package/components/inlinemessage/InlineMessage-BPJD82sq.es.js +94 -0
  154. package/components/inlinemessage/InlineMessage-DTyTe5_W.system.js +1 -0
  155. package/components/inputbadge/InputBadge-BUm6Kn-F.system.js +1 -0
  156. package/components/inputbadge/InputBadge-BngtjqHQ.es.js +186 -0
  157. package/components/inputcurrency/InputCurrency-CE4WrJ9k.es.js +1211 -0
  158. package/components/inputcurrency/InputCurrency-DaJuUujH.system.js +1 -0
  159. package/components/inputemail/InputEmail-8E04RVeq.system.js +1 -0
  160. package/components/inputemail/InputEmail-BFeY1l9Z.es.js +49 -0
  161. package/components/inputgroup/InputGroup-CTHxHL8n.system.js +1 -0
  162. package/components/inputgroup/InputGroup-CUxNAtDZ.es.js +56 -0
  163. package/components/inputnumber/InputNumber-BJ8Qm27k.system.js +1 -0
  164. package/components/inputnumber/InputNumber-CQd01PQ5.es.js +232 -0
  165. package/components/inputpassword/InputPassword-D3jaUFfR.system.js +1 -0
  166. package/components/inputpassword/InputPassword-DGWsHAB4.es.js +121 -0
  167. package/components/inputphonenumber/InputPhoneNumber-3To4Ktp9.system.js +1 -0
  168. package/components/inputphonenumber/InputPhoneNumber-DVAOWAj6.es.js +162 -0
  169. package/components/inputphonenumber/helpers/getUserLocation.helper-B0lZav7S.es.js +15 -0
  170. package/components/inputphonenumber/helpers/getUserLocation.helper-CSC5I9tB.system.js +1 -0
  171. package/components/inputphonenumber/helpers/timeZoneCityToCountry.json-CUP9NUYE.es.js +423 -0
  172. package/components/inputphonenumber/helpers/timeZoneCityToCountry.json-DgzOgH_M.system.js +1 -0
  173. package/components/inputrangenumber/InputRangeNumber-Cfea6oM_.es.js +134 -0
  174. package/components/inputrangenumber/InputRangeNumber-iLScQOa6.system.js +1 -0
  175. package/components/inputsearch/InputSearch-CHJP-N57.es.js +53 -0
  176. package/components/inputsearch/InputSearch-DkB4O0Dc.system.js +1 -0
  177. package/components/inputtext/InputText-BEDxrRqK.es.js +242 -0
  178. package/components/inputtext/InputText-BOgH8xpA.system.js +1 -0
  179. package/components/inputurl/InputURL-CNrOkrAC.es.js +61 -0
  180. package/components/inputurl/InputURL-D4QWV9G7.system.js +1 -0
  181. package/components/invisiblefield/InvisibleField-4XbiOrqw.es.js +27 -0
  182. package/components/invisiblefield/InvisibleField-BHudtX2g.system.js +1 -0
  183. package/components/litedropdown/LiteDropdown-BbDUnfnd.es.js +102 -0
  184. package/components/litedropdown/LiteDropdown-DTXwb5JR.system.js +1 -0
  185. package/components/loading/Loading-DIfTUHr7.es.js +24 -0
  186. package/components/loading/Loading-Vb4HctBJ.system.js +1 -0
  187. package/components/menu/Menu-BtzGGhbp.es.js +73 -0
  188. package/components/menu/Menu-CPm5vua_.system.js +1 -0
  189. package/components/menuitem/MenuItem-8yxkFTug.system.js +1 -0
  190. package/components/menuitem/MenuItem-uLVAqgBS.es.js +65 -0
  191. package/components/multiselect/MultiSelect-BoPpQ31j.es.js +189 -0
  192. package/components/multiselect/MultiSelect-D5NEDtGe.system.js +1 -0
  193. package/components/overlaypanel/OverlayPanel-BKCivqTs.system.js +1 -0
  194. package/components/overlaypanel/OverlayPanel-bQbjuUgG.es.js +49 -0
  195. package/components/tabmenu/TabMenu-BBk8EW-C.system.js +1 -0
  196. package/components/tabmenu/TabMenu-ByKBaVsd.es.js +108 -0
  197. package/components/tagtype/TagType-CAXomDiD.es.js +49 -0
  198. package/components/tagtype/TagType-i4RK2JbL.system.js +1 -0
  199. package/components/textarea/Textarea-CnAlgPq5.es.js +108 -0
  200. package/components/textarea/Textarea-qirKOw5z.system.js +1 -0
  201. package/components/timeline/Timeline-CF2qJo4E.es.js +120 -0
  202. package/components/timeline/Timeline-DKfKWZFI.system.js +1 -0
  203. package/components/timeline/TimelineContentByType-_cKGDWAW.es.js +108 -0
  204. package/components/timeline/TimelineContentByType-uxM3NSqd.system.js +1 -0
  205. package/components/toast/Toast-C3D50rGo.system.js +1 -0
  206. package/components/toast/Toast-DRUJCz4I.es.js +74 -0
  207. package/components/toggleswitch/ToggleSwitch-De-_8nQl.es.js +90 -0
  208. package/components/toggleswitch/ToggleSwitch-DuyahX09.system.js +1 -0
  209. package/components/transactionroles/TransactionRoles-WrcXMwBu.es.js +223 -0
  210. package/components/transactionroles/TransactionRoles-iVQyWseb.system.js +1 -0
  211. package/components/tree/Tree-93NvdElH.es.js +267 -0
  212. package/components/tree/Tree-BTTVTAEH.system.js +1 -0
  213. package/components/tree/helpers/filterNodeKeys.helper-CmamKUTa.system.js +1 -0
  214. package/components/tree/helpers/filterNodeKeys.helper-z7SxLuvZ.es.js +10 -0
  215. package/components/treesearchinput/TreeSearchInput-BG2TfunA.system.js +1 -0
  216. package/components/treesearchinput/TreeSearchInput-CNfoc3f6.es.js +56 -0
  217. package/components/username/UserName-A1N6Q7bS.system.js +1 -0
  218. package/components/username/UserName-D5C0qdbu.es.js +132 -0
  219. package/components/userwithicon/UserWithIcon-CHHDfQG0.es.js +18 -0
  220. package/components/userwithicon/UserWithIcon-DnY6loZc.system.js +1 -0
  221. package/components/validatormessage/ValidatorMessage-BtKfBXzO.es.js +19 -0
  222. package/components/validatormessage/ValidatorMessage-VVfyqlRF.system.js +1 -0
  223. package/config/config.esm-BZepf1kR.system.js +1 -0
  224. package/config/config.esm-Drl0fECZ.es.js +212 -0
  225. package/config/defaultProps-B3syHUKt.system.js +1 -0
  226. package/config/defaultProps-BC_lvAG9.es.js +136 -0
  227. package/config/locale-DK6d2rJ3.system.js +1 -0
  228. package/config/locale-pQnRpNZ6.es.js +85 -0
  229. package/event-bus/index-CykcrsqY.system.js +1 -0
  230. package/event-bus/index-PQwO5T6B.es.js +6 -0
  231. package/event-bus/mitt-BjeF6e5j.es.js +53 -0
  232. package/event-bus/mitt-X_X8W9w9.system.js +1 -0
  233. package/package.json +1 -1
  234. package/plugins/WangsVue-Dl5OiLXF.es.js +332 -0
  235. package/plugins/WangsVue-Dugc3GRS.system.js +1 -0
  236. package/plugins/i18n-BVujDShu.system.js +1 -0
  237. package/plugins/i18n-CIoi8go0.es.js +89 -0
  238. package/stats.html +1 -1
  239. package/style.css +1 -1
  240. package/utils/addAttachment.util-CPzZEHNG.system.js +1 -0
  241. package/utils/addAttachment.util-D9sYCBjS.es.js +10 -0
  242. package/utils/computeAutoPlacement-Ac2MkS5B.es.js +33 -0
  243. package/utils/computeAutoPlacement-DCaci6j-.system.js +1 -0
  244. package/utils/computeOffsets-Cx9i84Mn.system.js +1 -0
  245. package/utils/computeOffsets-DXWJPq7f.es.js +56 -0
  246. package/utils/date.util-DbjB32co.es.js +198 -0
  247. package/utils/date.util-rX9kq_yC.system.js +1 -0
  248. package/utils/detectOverflow-BrAC_sJF.system.js +1 -0
  249. package/utils/detectOverflow-CETbaen7.es.js +88 -0
  250. package/utils/exportToExcel.util-Bf-PpzHW.system.js +1 -0
  251. package/utils/exportToExcel.util-jz7aU08m.es.js +32 -0
  252. package/utils/genPlaceholder.util-0UuDQpbx.es.js +37 -0
  253. package/utils/genPlaceholder.util-CxMG7LbT.system.js +1 -0
  254. package/utils/mergePropsWithDefaults.util-BKcJzgvs.es.js +9 -0
  255. package/utils/mergePropsWithDefaults.util-CXowvEKY.system.js +1 -0
  256. package/utils/object.util-6veM2gu5.es.js +51 -0
  257. package/utils/object.util-uApor4uP.system.js +1 -0
  258. package/utils/orderModifiers-qXBm1wkD.system.js +1 -0
  259. package/utils/orderModifiers-rOag5Cyh.es.js +31 -0
  260. package/utils/role.util-BdUNoOqf.es.js +67 -0
  261. package/utils/role.util-Co8OMWnc.system.js +1 -0
  262. package/utils/textFormatter.util-BjenkyWf.system.js +1 -0
  263. package/utils/textFormatter.util-CYul3RpH.es.js +21 -0
  264. package/utils/toast.util-C7p3h9XQ.es.js +52 -0
  265. package/utils/toast.util-DPtauJUV.system.js +1 -0
  266. package/utils/utils.esm-iwnsFuDg.system.js +23 -0
  267. package/utils/utils.esm-s_-kLKXf.es.js +1080 -0
  268. package/utils/xlsx.util-FKEpiU2t.system.js +1 -0
  269. package/utils/xlsx.util-LU1upHR3.es.js +8 -0
  270. package/vendor/@popperjs/core-DFLwc7xU.system.js +1 -0
  271. package/vendor/@popperjs/core-DJHUrK4e.es.js +748 -0
  272. package/vendor/@tiptap/core-D4rHEGhs.system.js +80 -0
  273. package/vendor/@tiptap/core-DSbPv8xh.es.js +2868 -0
  274. package/vendor/@tiptap/extension-bold-CvAjR8FR.es.js +71 -0
  275. package/vendor/@tiptap/extension-bold-DI_Zfdzb.system.js +1 -0
  276. package/vendor/@tiptap/extension-bubble-menu-0_0wc2P7.system.js +1 -0
  277. package/vendor/@tiptap/extension-bubble-menu-DY29ulfu.es.js +128 -0
  278. package/vendor/@tiptap/extension-bullet-list-BrkIcd-z.es.js +53 -0
  279. package/vendor/@tiptap/extension-bullet-list-CgIgW9RG.system.js +1 -0
  280. package/vendor/@tiptap/extension-code-BtAtPCQQ.es.js +51 -0
  281. package/vendor/@tiptap/extension-code-SOANT0O3.system.js +1 -0
  282. package/vendor/@tiptap/extension-floating-menu-BTwcx1u8.es.js +99 -0
  283. package/vendor/@tiptap/extension-floating-menu-Dtu9tcTW.system.js +1 -0
  284. package/vendor/@tiptap/extension-heading-B6PMnqvS.es.js +54 -0
  285. package/vendor/@tiptap/extension-heading-BpK6SnFO.system.js +1 -0
  286. package/vendor/@tiptap/extension-history-CTFK6g3n.system.js +1 -0
  287. package/vendor/@tiptap/extension-history-DdPDTH0G.es.js +35 -0
  288. package/vendor/@tiptap/extension-image-BNa6azmK.system.js +1 -0
  289. package/vendor/@tiptap/extension-image-DCo2JDZp.es.js +64 -0
  290. package/vendor/@tiptap/extension-italic-D09oL4ps.es.js +70 -0
  291. package/vendor/@tiptap/extension-italic-w93Lmtg_.system.js +1 -0
  292. package/vendor/@tiptap/extension-link-CV6Fodq9.es.js +262 -0
  293. package/vendor/@tiptap/extension-link-FrdAKaJ2.system.js +1 -0
  294. package/vendor/@tiptap/extension-list-item-BRio_hHs.system.js +1 -0
  295. package/vendor/@tiptap/extension-list-item-D8wSpPxS.es.js +33 -0
  296. package/vendor/@tiptap/extension-mention-cFXQdAs7.es.js +130 -0
  297. package/vendor/@tiptap/extension-mention-y62_tYRn.system.js +1 -0
  298. package/vendor/@tiptap/extension-ordered-list-BZU-Ty3o.es.js +71 -0
  299. package/vendor/@tiptap/extension-ordered-list-CH9LyYR1.system.js +1 -0
  300. package/vendor/@tiptap/extension-placeholder-CsBxoitZ.es.js +52 -0
  301. package/vendor/@tiptap/extension-placeholder-Dqw7HNAJ.system.js +1 -0
  302. package/vendor/@tiptap/extension-underline-DklFOEoR.es.js +40 -0
  303. package/vendor/@tiptap/extension-underline-SGsaBlAL.system.js +1 -0
  304. package/vendor/@tiptap/suggestion-B3Grok9m.system.js +1 -0
  305. package/vendor/@tiptap/suggestion-Dg-vhPtN.es.js +131 -0
  306. package/vendor/@tiptap/vue-3-BOfcUn5G.es.js +436 -0
  307. package/vendor/@tiptap/vue-3-ZMNXXvBd.system.js +1 -0
  308. package/vendor/highlight.js-ClnJXT0q.system.js +2 -0
  309. package/vendor/highlight.js-Czlvg6fB.es.js +2493 -0
  310. package/vendor/linkifyjs-BxsOjwQz.es.js +705 -0
  311. package/vendor/linkifyjs-CMLfIa6I.system.js +5 -0
  312. package/vendor/lodash-B6nNLFd3.es.js +127 -0
  313. package/vendor/lodash-BuO1dYnQ.system.js +1 -0
  314. package/vendor/lodash-es-C3G1Cc1m.system.js +1 -0
  315. package/vendor/lodash-es-CJerBxJQ.es.js +766 -0
  316. package/vendor/orderedmap-B3SOk52B.es.js +103 -0
  317. package/vendor/orderedmap-Dwr31MF0.system.js +1 -0
  318. package/vendor/primevue-C5Z_k4WB.system.js +171 -0
  319. package/vendor/primevue-DkBtKf1Y.es.js +12649 -0
  320. package/vendor/prosemirror-commands-CUjo-x4s.es.js +383 -0
  321. package/vendor/prosemirror-commands-Dn6KNBP0.system.js +2 -0
  322. package/vendor/prosemirror-history-BPOe4I2H.es.js +248 -0
  323. package/vendor/prosemirror-history-BTrzvpc-.system.js +1 -0
  324. package/vendor/prosemirror-keymap-BvIUhswp.es.js +60 -0
  325. package/vendor/prosemirror-keymap-WRY9zVpK.system.js +1 -0
  326. package/vendor/prosemirror-model-D2n-Dx_L.es.js +2736 -0
  327. package/vendor/prosemirror-model-DTWK5xnv.system.js +4 -0
  328. package/vendor/prosemirror-schema-list-BvrICwYb.es.js +87 -0
  329. package/vendor/prosemirror-schema-list-Dv9KV10j.system.js +1 -0
  330. package/vendor/prosemirror-state-BW6XGB3U.es.js +820 -0
  331. package/vendor/prosemirror-state-COJ-aZZ4.system.js +1 -0
  332. package/vendor/prosemirror-transform-BXNgAhmF.system.js +2 -0
  333. package/vendor/prosemirror-transform-DvAmofec.es.js +1507 -0
  334. package/vendor/prosemirror-view-C9ZQp8VZ.es.js +3742 -0
  335. package/vendor/prosemirror-view-DOxSTbB-.system.js +5 -0
  336. package/vendor/rope-sequence-4t46C6az.system.js +1 -0
  337. package/vendor/rope-sequence-sEGCUMi8.es.js +100 -0
  338. package/vendor/simplebar-core-CtWK1-xd.system.js +1 -0
  339. package/vendor/simplebar-core-ofTx4QqK.es.js +333 -0
  340. package/vendor/simplebar-vue-BHVrvuf1.system.js +1 -0
  341. package/vendor/simplebar-vue-dpCx-K7E.es.js +176 -0
  342. package/vendor/tippy.js-6wuFov1j.system.js +1 -0
  343. package/vendor/tippy.js-i1ic-msv.es.js +721 -0
  344. package/vendor/uuid-93tp0umt.es.js +9 -0
  345. package/vendor/uuid-Cymn6orr.system.js +1 -0
  346. package/vendor/vee-validate-Cc_B-qII.system.js +5 -0
  347. package/vendor/vee-validate-RE5RuswC.es.js +1309 -0
  348. package/vendor/vue-advanced-cropper-CshlvNaD.es.js +1380 -0
  349. package/vendor/vue-advanced-cropper-NG93jHnU.system.js +20 -0
  350. package/vendor/w3c-keyname-BSD-PgAi.system.js +1 -0
  351. package/vendor/w3c-keyname-CLxH8j-f.es.js +92 -0
  352. package/wangsvue-fats.js +156 -0
  353. package/wangsvue-fats.system.js +1 -313
  354. package/loading-page-BrQattYE.js +0 -1
  355. package/loading-page-CoC9UhfC.js +0 -4
  356. package/loading-page-DbLuqCHa.js +0 -1
  357. package/loading-page-f8D03l3G.js +0 -4
  358. package/loading-plane-CgfbWppy.js +0 -1
  359. package/loading-plane-CoXtqoc9.js +0 -4
  360. package/loading-table-Bdr9ZhtP.js +0 -1
  361. package/loading-table-ByUoWqUo.js +0 -4
  362. package/loading-table-BygEMzFM.js +0 -4
  363. package/loading-table-BzrSQlA0.js +0 -1
  364. package/loading-table-D9bw9OcI.js +0 -4
  365. package/loading-table-chOgXi94.js +0 -1
  366. package/no-data-CTKux8RI.js +0 -4
  367. package/no-data-Cgze_Rvp.js +0 -1
  368. package/no-data-Dep79CBh.js +0 -1
  369. package/no-data-g0dJCy2p.js +0 -4
  370. package/no-data-y1X5WtcQ.js +0 -1
  371. package/wangsvue-fats.es.js +0 -51894
  372. /package/{loading-page-CgfbWppy.js → assets/lottie/loading-plane-CgfbWppy.system.js} +0 -0
  373. /package/{loading-page-CoXtqoc9.js → assets/lottie/loading-plane-CoXtqoc9.es.js} +0 -0
@@ -0,0 +1,2868 @@
1
+ import { E as Lt, N as F, P as I, a as j, S as R, T as P, A as zt } from "../prosemirror-state-BW6XGB3U.es.js";
2
+ import { E as _t } from "../prosemirror-view-C9ZQp8VZ.es.js";
3
+ import { k as Ht } from "../prosemirror-keymap-BvIUhswp.es.js";
4
+ import { D as Vt, S as St, F as $, N as Wt, a as nt, b as Kt } from "../prosemirror-model-D2n-Dx_L.es.js";
5
+ import { f as Ut, c as dt, T as qt, a as W, j as xt, l as Gt, R as Jt, b as Xt } from "../prosemirror-transform-DvAmofec.es.js";
6
+ import { w as Yt, s as gt, a as Qt, b as Zt, c as te, d as ee, e as ne, n as re, l as se, f as oe, j as ie, g as ae, h as ce, i as le, k as de, m as ue, o as fe, p as pe, q as he } from "../prosemirror-commands-CUjo-x4s.es.js";
7
+ import { w as me, s as ge, l as ye } from "../prosemirror-schema-list-BvrICwYb.es.js";
8
+ function J(n) {
9
+ const { state: t, transaction: e } = n;
10
+ let { selection: r } = e, { doc: s } = e, { storedMarks: o } = e;
11
+ return {
12
+ ...t,
13
+ apply: t.apply.bind(t),
14
+ applyTransaction: t.applyTransaction.bind(t),
15
+ plugins: t.plugins,
16
+ schema: t.schema,
17
+ reconfigure: t.reconfigure.bind(t),
18
+ toJSON: t.toJSON.bind(t),
19
+ get storedMarks() {
20
+ return o;
21
+ },
22
+ get selection() {
23
+ return r;
24
+ },
25
+ get doc() {
26
+ return s;
27
+ },
28
+ get tr() {
29
+ return r = e.selection, s = e.doc, o = e.storedMarks, e;
30
+ }
31
+ };
32
+ }
33
+ class X {
34
+ constructor(t) {
35
+ this.editor = t.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = t.state;
36
+ }
37
+ get hasCustomState() {
38
+ return !!this.customState;
39
+ }
40
+ get state() {
41
+ return this.customState || this.editor.state;
42
+ }
43
+ get commands() {
44
+ const { rawCommands: t, editor: e, state: r } = this, { view: s } = e, { tr: o } = r, i = this.buildProps(o);
45
+ return Object.fromEntries(Object.entries(t).map(([c, a]) => [c, (...u) => {
46
+ const d = a(...u)(i);
47
+ return !o.getMeta("preventDispatch") && !this.hasCustomState && s.dispatch(o), d;
48
+ }]));
49
+ }
50
+ get chain() {
51
+ return () => this.createChain();
52
+ }
53
+ get can() {
54
+ return () => this.createCan();
55
+ }
56
+ createChain(t, e = !0) {
57
+ const { rawCommands: r, editor: s, state: o } = this, { view: i } = s, c = [], a = !!t, l = t || o.tr, u = () => (!a && e && !l.getMeta("preventDispatch") && !this.hasCustomState && i.dispatch(l), c.every((f) => f === !0)), d = {
58
+ ...Object.fromEntries(Object.entries(r).map(([f, p]) => [f, (...m) => {
59
+ const g = this.buildProps(l, e), y = p(...m)(g);
60
+ return c.push(y), d;
61
+ }])),
62
+ run: u
63
+ };
64
+ return d;
65
+ }
66
+ createCan(t) {
67
+ const { rawCommands: e, state: r } = this, s = !1, o = t || r.tr, i = this.buildProps(o, s);
68
+ return {
69
+ ...Object.fromEntries(Object.entries(e).map(([a, l]) => [a, (...u) => l(...u)({ ...i, dispatch: void 0 })])),
70
+ chain: () => this.createChain(o, s)
71
+ };
72
+ }
73
+ buildProps(t, e = !0) {
74
+ const { rawCommands: r, editor: s, state: o } = this, { view: i } = s, c = {
75
+ tr: t,
76
+ editor: s,
77
+ view: i,
78
+ state: J({
79
+ state: o,
80
+ transaction: t
81
+ }),
82
+ dispatch: e ? () => {
83
+ } : void 0,
84
+ chain: () => this.createChain(t, e),
85
+ can: () => this.createCan(t),
86
+ get commands() {
87
+ return Object.fromEntries(Object.entries(r).map(([a, l]) => [a, (...u) => l(...u)(c)]));
88
+ }
89
+ };
90
+ return c;
91
+ }
92
+ }
93
+ class be {
94
+ constructor() {
95
+ this.callbacks = {};
96
+ }
97
+ on(t, e) {
98
+ return this.callbacks[t] || (this.callbacks[t] = []), this.callbacks[t].push(e), this;
99
+ }
100
+ emit(t, ...e) {
101
+ const r = this.callbacks[t];
102
+ return r && r.forEach((s) => s.apply(this, e)), this;
103
+ }
104
+ off(t, e) {
105
+ const r = this.callbacks[t];
106
+ return r && (e ? this.callbacks[t] = r.filter((s) => s !== e) : delete this.callbacks[t]), this;
107
+ }
108
+ once(t, e) {
109
+ const r = (...s) => {
110
+ this.off(t, r), e.apply(this, s);
111
+ };
112
+ return this.on(t, r);
113
+ }
114
+ removeAllListeners() {
115
+ this.callbacks = {};
116
+ }
117
+ }
118
+ function b(n, t, e) {
119
+ return n.config[t] === void 0 && n.parent ? b(n.parent, t, e) : typeof n.config[t] == "function" ? n.config[t].bind({
120
+ ...e,
121
+ parent: n.parent ? b(n.parent, t, e) : null
122
+ }) : n.config[t];
123
+ }
124
+ function Y(n) {
125
+ const t = n.filter((s) => s.type === "extension"), e = n.filter((s) => s.type === "node"), r = n.filter((s) => s.type === "mark");
126
+ return {
127
+ baseExtensions: t,
128
+ nodeExtensions: e,
129
+ markExtensions: r
130
+ };
131
+ }
132
+ function Tt(n) {
133
+ const t = [], { nodeExtensions: e, markExtensions: r } = Y(n), s = [...e, ...r], o = {
134
+ default: null,
135
+ rendered: !0,
136
+ renderHTML: null,
137
+ parseHTML: null,
138
+ keepOnSplit: !0,
139
+ isRequired: !1
140
+ };
141
+ return n.forEach((i) => {
142
+ const c = {
143
+ name: i.name,
144
+ options: i.options,
145
+ storage: i.storage,
146
+ extensions: s
147
+ }, a = b(i, "addGlobalAttributes", c);
148
+ if (!a)
149
+ return;
150
+ a().forEach((u) => {
151
+ u.types.forEach((d) => {
152
+ Object.entries(u.attributes).forEach(([f, p]) => {
153
+ t.push({
154
+ type: d,
155
+ name: f,
156
+ attribute: {
157
+ ...o,
158
+ ...p
159
+ }
160
+ });
161
+ });
162
+ });
163
+ });
164
+ }), s.forEach((i) => {
165
+ const c = {
166
+ name: i.name,
167
+ options: i.options,
168
+ storage: i.storage
169
+ }, a = b(i, "addAttributes", c);
170
+ if (!a)
171
+ return;
172
+ const l = a();
173
+ Object.entries(l).forEach(([u, d]) => {
174
+ const f = {
175
+ ...o,
176
+ ...d
177
+ };
178
+ typeof (f == null ? void 0 : f.default) == "function" && (f.default = f.default()), f != null && f.isRequired && (f == null ? void 0 : f.default) === void 0 && delete f.default, t.push({
179
+ type: i.name,
180
+ name: u,
181
+ attribute: f
182
+ });
183
+ });
184
+ }), t;
185
+ }
186
+ function S(n, t) {
187
+ if (typeof n == "string") {
188
+ if (!t.nodes[n])
189
+ throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);
190
+ return t.nodes[n];
191
+ }
192
+ return n;
193
+ }
194
+ function ke(...n) {
195
+ return n.filter((t) => !!t).reduce((t, e) => {
196
+ const r = { ...t };
197
+ return Object.entries(e).forEach(([s, o]) => {
198
+ if (!r[s]) {
199
+ r[s] = o;
200
+ return;
201
+ }
202
+ if (s === "class") {
203
+ const c = o ? String(o).split(" ") : [], a = r[s] ? r[s].split(" ") : [], l = c.filter((u) => !a.includes(u));
204
+ r[s] = [...a, ...l].join(" ");
205
+ } else if (s === "style") {
206
+ const c = o ? o.split(";").map((u) => u.trim()).filter(Boolean) : [], a = r[s] ? r[s].split(";").map((u) => u.trim()).filter(Boolean) : [], l = /* @__PURE__ */ new Map();
207
+ a.forEach((u) => {
208
+ const [d, f] = u.split(":").map((p) => p.trim());
209
+ l.set(d, f);
210
+ }), c.forEach((u) => {
211
+ const [d, f] = u.split(":").map((p) => p.trim());
212
+ l.set(d, f);
213
+ }), r[s] = Array.from(l.entries()).map(([u, d]) => `${u}: ${d}`).join("; ");
214
+ } else
215
+ r[s] = o;
216
+ }), r;
217
+ }, {});
218
+ }
219
+ function it(n, t) {
220
+ return t.filter((e) => e.type === n.type.name).filter((e) => e.attribute.rendered).map((e) => e.attribute.renderHTML ? e.attribute.renderHTML(n.attrs) || {} : {
221
+ [e.name]: n.attrs[e.name]
222
+ }).reduce((e, r) => ke(e, r), {});
223
+ }
224
+ function Ct(n) {
225
+ return typeof n == "function";
226
+ }
227
+ function k(n, t = void 0, ...e) {
228
+ return Ct(n) ? t ? n.bind(t)(...e) : n(...e) : n;
229
+ }
230
+ function ve(n = {}) {
231
+ return Object.keys(n).length === 0 && n.constructor === Object;
232
+ }
233
+ function we(n) {
234
+ return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
235
+ }
236
+ function yt(n, t) {
237
+ return "style" in n ? n : {
238
+ ...n,
239
+ getAttrs: (e) => {
240
+ const r = n.getAttrs ? n.getAttrs(e) : n.attrs;
241
+ if (r === !1)
242
+ return !1;
243
+ const s = t.reduce((o, i) => {
244
+ const c = i.attribute.parseHTML ? i.attribute.parseHTML(e) : we(e.getAttribute(i.name));
245
+ return c == null ? o : {
246
+ ...o,
247
+ [i.name]: c
248
+ };
249
+ }, {});
250
+ return { ...r, ...s };
251
+ }
252
+ };
253
+ }
254
+ function bt(n) {
255
+ return Object.fromEntries(
256
+ // @ts-ignore
257
+ Object.entries(n).filter(([t, e]) => t === "attrs" && ve(e) ? !1 : e != null)
258
+ );
259
+ }
260
+ function Me(n, t) {
261
+ var e;
262
+ const r = Tt(n), { nodeExtensions: s, markExtensions: o } = Y(n), i = (e = s.find((l) => b(l, "topNode"))) === null || e === void 0 ? void 0 : e.name, c = Object.fromEntries(s.map((l) => {
263
+ const u = r.filter((y) => y.type === l.name), d = {
264
+ name: l.name,
265
+ options: l.options,
266
+ storage: l.storage,
267
+ editor: t
268
+ }, f = n.reduce((y, v) => {
269
+ const w = b(v, "extendNodeSchema", d);
270
+ return {
271
+ ...y,
272
+ ...w ? w(l) : {}
273
+ };
274
+ }, {}), p = bt({
275
+ ...f,
276
+ content: k(b(l, "content", d)),
277
+ marks: k(b(l, "marks", d)),
278
+ group: k(b(l, "group", d)),
279
+ inline: k(b(l, "inline", d)),
280
+ atom: k(b(l, "atom", d)),
281
+ selectable: k(b(l, "selectable", d)),
282
+ draggable: k(b(l, "draggable", d)),
283
+ code: k(b(l, "code", d)),
284
+ whitespace: k(b(l, "whitespace", d)),
285
+ linebreakReplacement: k(b(l, "linebreakReplacement", d)),
286
+ defining: k(b(l, "defining", d)),
287
+ isolating: k(b(l, "isolating", d)),
288
+ attrs: Object.fromEntries(u.map((y) => {
289
+ var v;
290
+ return [y.name, { default: (v = y == null ? void 0 : y.attribute) === null || v === void 0 ? void 0 : v.default }];
291
+ }))
292
+ }), h = k(b(l, "parseHTML", d));
293
+ h && (p.parseDOM = h.map((y) => yt(y, u)));
294
+ const m = b(l, "renderHTML", d);
295
+ m && (p.toDOM = (y) => m({
296
+ node: y,
297
+ HTMLAttributes: it(y, u)
298
+ }));
299
+ const g = b(l, "renderText", d);
300
+ return g && (p.toText = g), [l.name, p];
301
+ })), a = Object.fromEntries(o.map((l) => {
302
+ const u = r.filter((g) => g.type === l.name), d = {
303
+ name: l.name,
304
+ options: l.options,
305
+ storage: l.storage,
306
+ editor: t
307
+ }, f = n.reduce((g, y) => {
308
+ const v = b(y, "extendMarkSchema", d);
309
+ return {
310
+ ...g,
311
+ ...v ? v(l) : {}
312
+ };
313
+ }, {}), p = bt({
314
+ ...f,
315
+ inclusive: k(b(l, "inclusive", d)),
316
+ excludes: k(b(l, "excludes", d)),
317
+ group: k(b(l, "group", d)),
318
+ spanning: k(b(l, "spanning", d)),
319
+ code: k(b(l, "code", d)),
320
+ attrs: Object.fromEntries(u.map((g) => {
321
+ var y;
322
+ return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
323
+ }))
324
+ }), h = k(b(l, "parseHTML", d));
325
+ h && (p.parseDOM = h.map((g) => yt(g, u)));
326
+ const m = b(l, "renderHTML", d);
327
+ return m && (p.toDOM = (g) => m({
328
+ mark: g,
329
+ HTMLAttributes: it(g, u)
330
+ })), [l.name, p];
331
+ }));
332
+ return new St({
333
+ topNode: i,
334
+ nodes: c,
335
+ marks: a
336
+ });
337
+ }
338
+ function rt(n, t) {
339
+ return t.nodes[n] || t.marks[n] || null;
340
+ }
341
+ function kt(n, t) {
342
+ return Array.isArray(t) ? t.some((e) => (typeof e == "string" ? e : e.name) === n.name) : t;
343
+ }
344
+ function ut(n, t) {
345
+ const e = Vt.fromSchema(t).serializeFragment(n), s = document.implementation.createHTMLDocument().createElement("div");
346
+ return s.appendChild(e), s.innerHTML;
347
+ }
348
+ const Ee = (n, t = 500) => {
349
+ let e = "";
350
+ const r = n.parentOffset;
351
+ return n.parent.nodesBetween(Math.max(0, r - t), r, (s, o, i, c) => {
352
+ var a, l;
353
+ const u = ((l = (a = s.type.spec).toText) === null || l === void 0 ? void 0 : l.call(a, {
354
+ node: s,
355
+ pos: o,
356
+ parent: i,
357
+ index: c
358
+ })) || s.textContent || "%leaf%";
359
+ e += s.isAtom && !s.isText ? u : u.slice(0, Math.max(0, r - o));
360
+ }), e;
361
+ };
362
+ function ft(n) {
363
+ return Object.prototype.toString.call(n) === "[object RegExp]";
364
+ }
365
+ class Q {
366
+ constructor(t) {
367
+ this.find = t.find, this.handler = t.handler;
368
+ }
369
+ }
370
+ const Se = (n, t) => {
371
+ if (ft(t))
372
+ return t.exec(n);
373
+ const e = t(n);
374
+ if (!e)
375
+ return null;
376
+ const r = [e.text];
377
+ return r.index = e.index, r.input = n, r.data = e.data, e.replaceWith && (e.text.includes(e.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(e.replaceWith)), r;
378
+ };
379
+ function z(n) {
380
+ var t;
381
+ const { editor: e, from: r, to: s, text: o, rules: i, plugin: c } = n, { view: a } = e;
382
+ if (a.composing)
383
+ return !1;
384
+ const l = a.state.doc.resolve(r);
385
+ if (
386
+ // check for code node
387
+ l.parent.type.spec.code || !((t = l.nodeBefore || l.nodeAfter) === null || t === void 0) && t.marks.find((f) => f.type.spec.code)
388
+ )
389
+ return !1;
390
+ let u = !1;
391
+ const d = Ee(l) + o;
392
+ return i.forEach((f) => {
393
+ if (u)
394
+ return;
395
+ const p = Se(d, f.find);
396
+ if (!p)
397
+ return;
398
+ const h = a.state.tr, m = J({
399
+ state: a.state,
400
+ transaction: h
401
+ }), g = {
402
+ from: r - (p[0].length - o.length),
403
+ to: s
404
+ }, { commands: y, chain: v, can: w } = new X({
405
+ editor: e,
406
+ state: m
407
+ });
408
+ f.handler({
409
+ state: m,
410
+ range: g,
411
+ match: p,
412
+ commands: y,
413
+ chain: v,
414
+ can: w
415
+ }) === null || !h.steps.length || (h.setMeta(c, {
416
+ transform: h,
417
+ from: r,
418
+ to: s,
419
+ text: o
420
+ }), a.dispatch(h), u = !0);
421
+ }), u;
422
+ }
423
+ function xe(n) {
424
+ const { editor: t, rules: e } = n, r = new I({
425
+ state: {
426
+ init() {
427
+ return null;
428
+ },
429
+ apply(s, o, i) {
430
+ const c = s.getMeta(r);
431
+ if (c)
432
+ return c;
433
+ const a = s.getMeta("applyInputRules");
434
+ return !!a && setTimeout(() => {
435
+ let { text: u } = a;
436
+ typeof u == "string" ? u = u : u = ut($.from(u), i.schema);
437
+ const { from: d } = a, f = d + u.length;
438
+ z({
439
+ editor: t,
440
+ from: d,
441
+ to: f,
442
+ text: u,
443
+ rules: e,
444
+ plugin: r
445
+ });
446
+ }), s.selectionSet || s.docChanged ? null : o;
447
+ }
448
+ },
449
+ props: {
450
+ handleTextInput(s, o, i, c) {
451
+ return z({
452
+ editor: t,
453
+ from: o,
454
+ to: i,
455
+ text: c,
456
+ rules: e,
457
+ plugin: r
458
+ });
459
+ },
460
+ handleDOMEvents: {
461
+ compositionend: (s) => (setTimeout(() => {
462
+ const { $cursor: o } = s.state.selection;
463
+ o && z({
464
+ editor: t,
465
+ from: o.pos,
466
+ to: o.pos,
467
+ text: "",
468
+ rules: e,
469
+ plugin: r
470
+ });
471
+ }), !1)
472
+ },
473
+ // add support for input rules to trigger on enter
474
+ // this is useful for example for code blocks
475
+ handleKeyDown(s, o) {
476
+ if (o.key !== "Enter")
477
+ return !1;
478
+ const { $cursor: i } = s.state.selection;
479
+ return i ? z({
480
+ editor: t,
481
+ from: i.pos,
482
+ to: i.pos,
483
+ text: `
484
+ `,
485
+ rules: e,
486
+ plugin: r
487
+ }) : !1;
488
+ }
489
+ },
490
+ // @ts-ignore
491
+ isInputRules: !0
492
+ });
493
+ return r;
494
+ }
495
+ function Te(n) {
496
+ return Object.prototype.toString.call(n).slice(8, -1);
497
+ }
498
+ function _(n) {
499
+ return Te(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
500
+ }
501
+ function Z(n, t) {
502
+ const e = { ...n };
503
+ return _(n) && _(t) && Object.keys(t).forEach((r) => {
504
+ _(t[r]) && _(n[r]) ? e[r] = Z(n[r], t[r]) : e[r] = t[r];
505
+ }), e;
506
+ }
507
+ class U {
508
+ constructor(t = {}) {
509
+ this.type = "mark", this.name = "mark", this.parent = null, this.child = null, this.config = {
510
+ name: this.name,
511
+ defaultOptions: {}
512
+ }, this.config = {
513
+ ...this.config,
514
+ ...t
515
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = k(b(this, "addOptions", {
516
+ name: this.name
517
+ }))), this.storage = k(b(this, "addStorage", {
518
+ name: this.name,
519
+ options: this.options
520
+ })) || {};
521
+ }
522
+ static create(t = {}) {
523
+ return new U(t);
524
+ }
525
+ configure(t = {}) {
526
+ const e = this.extend({
527
+ ...this.config,
528
+ addOptions: () => Z(this.options, t)
529
+ });
530
+ return e.name = this.name, e.parent = this.parent, e;
531
+ }
532
+ extend(t = {}) {
533
+ const e = new U(t);
534
+ return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = k(b(e, "addOptions", {
535
+ name: e.name
536
+ })), e.storage = k(b(e, "addStorage", {
537
+ name: e.name,
538
+ options: e.options
539
+ })), e;
540
+ }
541
+ static handleExit({ editor: t, mark: e }) {
542
+ const { tr: r } = t.state, s = t.state.selection.$from;
543
+ if (s.pos === s.end()) {
544
+ const i = s.marks();
545
+ if (!!!i.find((l) => (l == null ? void 0 : l.type.name) === e.name))
546
+ return !1;
547
+ const a = i.find((l) => (l == null ? void 0 : l.type.name) === e.name);
548
+ return a && r.removeStoredMark(a), r.insertText(" ", s.pos), t.view.dispatch(r), !0;
549
+ }
550
+ return !1;
551
+ }
552
+ }
553
+ function Ce(n) {
554
+ return typeof n == "number";
555
+ }
556
+ class Ae {
557
+ constructor(t) {
558
+ this.find = t.find, this.handler = t.handler;
559
+ }
560
+ }
561
+ const Pe = (n, t, e) => {
562
+ if (ft(t))
563
+ return [...n.matchAll(t)];
564
+ const r = t(n, e);
565
+ return r ? r.map((s) => {
566
+ const o = [s.text];
567
+ return o.index = s.index, o.input = n, o.data = s.data, s.replaceWith && (s.text.includes(s.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), o.push(s.replaceWith)), o;
568
+ }) : [];
569
+ };
570
+ function Oe(n) {
571
+ const { editor: t, state: e, from: r, to: s, rule: o, pasteEvent: i, dropEvent: c } = n, { commands: a, chain: l, can: u } = new X({
572
+ editor: t,
573
+ state: e
574
+ }), d = [];
575
+ return e.doc.nodesBetween(r, s, (p, h) => {
576
+ if (!p.isTextblock || p.type.spec.code)
577
+ return;
578
+ const m = Math.max(r, h), g = Math.min(s, h + p.content.size), y = p.textBetween(m - h, g - h, void 0, "");
579
+ Pe(y, o.find, i).forEach((w) => {
580
+ if (w.index === void 0)
581
+ return;
582
+ const E = m + w.index + 1, M = E + w[0].length, x = {
583
+ from: e.tr.mapping.map(E),
584
+ to: e.tr.mapping.map(M)
585
+ }, C = o.handler({
586
+ state: e,
587
+ range: x,
588
+ match: w,
589
+ commands: a,
590
+ chain: l,
591
+ can: u,
592
+ pasteEvent: i,
593
+ dropEvent: c
594
+ });
595
+ d.push(C);
596
+ });
597
+ }), d.every((p) => p !== null);
598
+ }
599
+ let H = null;
600
+ const Ie = (n) => {
601
+ var t;
602
+ const e = new ClipboardEvent("paste", {
603
+ clipboardData: new DataTransfer()
604
+ });
605
+ return (t = e.clipboardData) === null || t === void 0 || t.setData("text/html", n), e;
606
+ };
607
+ function $e(n) {
608
+ const { editor: t, rules: e } = n;
609
+ let r = null, s = !1, o = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, c;
610
+ try {
611
+ c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
612
+ } catch {
613
+ c = null;
614
+ }
615
+ const a = ({ state: u, from: d, to: f, rule: p, pasteEvt: h }) => {
616
+ const m = u.tr, g = J({
617
+ state: u,
618
+ transaction: m
619
+ });
620
+ if (!(!Oe({
621
+ editor: t,
622
+ state: g,
623
+ from: Math.max(d - 1, 0),
624
+ to: f.b - 1,
625
+ rule: p,
626
+ pasteEvent: h,
627
+ dropEvent: c
628
+ }) || !m.steps.length)) {
629
+ try {
630
+ c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
631
+ } catch {
632
+ c = null;
633
+ }
634
+ return i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, m;
635
+ }
636
+ };
637
+ return e.map((u) => new I({
638
+ // we register a global drag handler to track the current drag source element
639
+ view(d) {
640
+ const f = (h) => {
641
+ var m;
642
+ r = !((m = d.dom.parentElement) === null || m === void 0) && m.contains(h.target) ? d.dom.parentElement : null, r && (H = t);
643
+ }, p = () => {
644
+ H && (H = null);
645
+ };
646
+ return window.addEventListener("dragstart", f), window.addEventListener("dragend", p), {
647
+ destroy() {
648
+ window.removeEventListener("dragstart", f), window.removeEventListener("dragend", p);
649
+ }
650
+ };
651
+ },
652
+ props: {
653
+ handleDOMEvents: {
654
+ drop: (d, f) => {
655
+ if (o = r === d.dom.parentElement, c = f, !o) {
656
+ const p = H;
657
+ p && setTimeout(() => {
658
+ const h = p.state.selection;
659
+ h && p.commands.deleteRange({ from: h.from, to: h.to });
660
+ }, 10);
661
+ }
662
+ return !1;
663
+ },
664
+ paste: (d, f) => {
665
+ var p;
666
+ const h = (p = f.clipboardData) === null || p === void 0 ? void 0 : p.getData("text/html");
667
+ return i = f, s = !!(h != null && h.includes("data-pm-slice")), !1;
668
+ }
669
+ }
670
+ },
671
+ appendTransaction: (d, f, p) => {
672
+ const h = d[0], m = h.getMeta("uiEvent") === "paste" && !s, g = h.getMeta("uiEvent") === "drop" && !o, y = h.getMeta("applyPasteRules"), v = !!y;
673
+ if (!m && !g && !v)
674
+ return;
675
+ if (v) {
676
+ let { text: M } = y;
677
+ typeof M == "string" ? M = M : M = ut($.from(M), p.schema);
678
+ const { from: x } = y, C = x + M.length, A = Ie(M);
679
+ return a({
680
+ rule: u,
681
+ state: p,
682
+ from: x,
683
+ to: { b: C },
684
+ pasteEvt: A
685
+ });
686
+ }
687
+ const w = f.doc.content.findDiffStart(p.doc.content), E = f.doc.content.findDiffEnd(p.doc.content);
688
+ if (!(!Ce(w) || !E || w === E.b))
689
+ return a({
690
+ rule: u,
691
+ state: p,
692
+ from: w,
693
+ to: E,
694
+ pasteEvt: i
695
+ });
696
+ }
697
+ }));
698
+ }
699
+ function Ne(n) {
700
+ const t = n.filter((e, r) => n.indexOf(e) !== r);
701
+ return Array.from(new Set(t));
702
+ }
703
+ class D {
704
+ constructor(t, e) {
705
+ this.splittableMarks = [], this.editor = e, this.extensions = D.resolve(t), this.schema = Me(this.extensions, e), this.setupExtensions();
706
+ }
707
+ /**
708
+ * Returns a flattened and sorted extension list while
709
+ * also checking for duplicated extensions and warns the user.
710
+ * @param extensions An array of Tiptap extensions
711
+ * @returns An flattened and sorted array of Tiptap extensions
712
+ */
713
+ static resolve(t) {
714
+ const e = D.sort(D.flatten(t)), r = Ne(e.map((s) => s.name));
715
+ return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((s) => `'${s}'`).join(", ")}]. This can lead to issues.`), e;
716
+ }
717
+ /**
718
+ * Create a flattened array of extensions by traversing the `addExtensions` field.
719
+ * @param extensions An array of Tiptap extensions
720
+ * @returns A flattened array of Tiptap extensions
721
+ */
722
+ static flatten(t) {
723
+ return t.map((e) => {
724
+ const r = {
725
+ name: e.name,
726
+ options: e.options,
727
+ storage: e.storage
728
+ }, s = b(e, "addExtensions", r);
729
+ return s ? [e, ...this.flatten(s())] : e;
730
+ }).flat(10);
731
+ }
732
+ /**
733
+ * Sort extensions by priority.
734
+ * @param extensions An array of Tiptap extensions
735
+ * @returns A sorted array of Tiptap extensions by priority
736
+ */
737
+ static sort(t) {
738
+ return t.sort((r, s) => {
739
+ const o = b(r, "priority") || 100, i = b(s, "priority") || 100;
740
+ return o > i ? -1 : o < i ? 1 : 0;
741
+ });
742
+ }
743
+ /**
744
+ * Get all commands from the extensions.
745
+ * @returns An object with all commands where the key is the command name and the value is the command function
746
+ */
747
+ get commands() {
748
+ return this.extensions.reduce((t, e) => {
749
+ const r = {
750
+ name: e.name,
751
+ options: e.options,
752
+ storage: e.storage,
753
+ editor: this.editor,
754
+ type: rt(e.name, this.schema)
755
+ }, s = b(e, "addCommands", r);
756
+ return s ? {
757
+ ...t,
758
+ ...s()
759
+ } : t;
760
+ }, {});
761
+ }
762
+ /**
763
+ * Get all registered Prosemirror plugins from the extensions.
764
+ * @returns An array of Prosemirror plugins
765
+ */
766
+ get plugins() {
767
+ const { editor: t } = this, e = D.sort([...this.extensions].reverse()), r = [], s = [], o = e.map((i) => {
768
+ const c = {
769
+ name: i.name,
770
+ options: i.options,
771
+ storage: i.storage,
772
+ editor: t,
773
+ type: rt(i.name, this.schema)
774
+ }, a = [], l = b(i, "addKeyboardShortcuts", c);
775
+ let u = {};
776
+ if (i.type === "mark" && b(i, "exitable", c) && (u.ArrowRight = () => U.handleExit({ editor: t, mark: i })), l) {
777
+ const m = Object.fromEntries(Object.entries(l()).map(([g, y]) => [g, () => y({ editor: t })]));
778
+ u = { ...u, ...m };
779
+ }
780
+ const d = Ht(u);
781
+ a.push(d);
782
+ const f = b(i, "addInputRules", c);
783
+ kt(i, t.options.enableInputRules) && f && r.push(...f());
784
+ const p = b(i, "addPasteRules", c);
785
+ kt(i, t.options.enablePasteRules) && p && s.push(...p());
786
+ const h = b(i, "addProseMirrorPlugins", c);
787
+ if (h) {
788
+ const m = h();
789
+ a.push(...m);
790
+ }
791
+ return a;
792
+ }).flat();
793
+ return [
794
+ xe({
795
+ editor: t,
796
+ rules: r
797
+ }),
798
+ ...$e({
799
+ editor: t,
800
+ rules: s
801
+ }),
802
+ ...o
803
+ ];
804
+ }
805
+ /**
806
+ * Get all attributes from the extensions.
807
+ * @returns An array of attributes
808
+ */
809
+ get attributes() {
810
+ return Tt(this.extensions);
811
+ }
812
+ /**
813
+ * Get all node views from the extensions.
814
+ * @returns An object with all node views where the key is the node name and the value is the node view function
815
+ */
816
+ get nodeViews() {
817
+ const { editor: t } = this, { nodeExtensions: e } = Y(this.extensions);
818
+ return Object.fromEntries(e.filter((r) => !!b(r, "addNodeView")).map((r) => {
819
+ const s = this.attributes.filter((a) => a.type === r.name), o = {
820
+ name: r.name,
821
+ options: r.options,
822
+ storage: r.storage,
823
+ editor: t,
824
+ type: S(r.name, this.schema)
825
+ }, i = b(r, "addNodeView", o);
826
+ if (!i)
827
+ return [];
828
+ const c = (a, l, u, d, f) => {
829
+ const p = it(a, s);
830
+ return i()({
831
+ // pass-through
832
+ node: a,
833
+ view: l,
834
+ getPos: u,
835
+ decorations: d,
836
+ innerDecorations: f,
837
+ // tiptap-specific
838
+ editor: t,
839
+ extension: r,
840
+ HTMLAttributes: p
841
+ });
842
+ };
843
+ return [r.name, c];
844
+ }));
845
+ }
846
+ /**
847
+ * Go through all extensions, create extension storages & setup marks
848
+ * & bind editor event listener.
849
+ */
850
+ setupExtensions() {
851
+ this.extensions.forEach((t) => {
852
+ var e;
853
+ this.editor.extensionStorage[t.name] = t.storage;
854
+ const r = {
855
+ name: t.name,
856
+ options: t.options,
857
+ storage: t.storage,
858
+ editor: this.editor,
859
+ type: rt(t.name, this.schema)
860
+ };
861
+ t.type === "mark" && (!((e = k(b(t, "keepOnSplit", r))) !== null && e !== void 0) || e) && this.splittableMarks.push(t.name);
862
+ const s = b(t, "onBeforeCreate", r), o = b(t, "onCreate", r), i = b(t, "onUpdate", r), c = b(t, "onSelectionUpdate", r), a = b(t, "onTransaction", r), l = b(t, "onFocus", r), u = b(t, "onBlur", r), d = b(t, "onDestroy", r);
863
+ s && this.editor.on("beforeCreate", s), o && this.editor.on("create", o), i && this.editor.on("update", i), c && this.editor.on("selectionUpdate", c), a && this.editor.on("transaction", a), l && this.editor.on("focus", l), u && this.editor.on("blur", u), d && this.editor.on("destroy", d);
864
+ });
865
+ }
866
+ }
867
+ class T {
868
+ constructor(t = {}) {
869
+ this.type = "extension", this.name = "extension", this.parent = null, this.child = null, this.config = {
870
+ name: this.name,
871
+ defaultOptions: {}
872
+ }, this.config = {
873
+ ...this.config,
874
+ ...t
875
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = k(b(this, "addOptions", {
876
+ name: this.name
877
+ }))), this.storage = k(b(this, "addStorage", {
878
+ name: this.name,
879
+ options: this.options
880
+ })) || {};
881
+ }
882
+ static create(t = {}) {
883
+ return new T(t);
884
+ }
885
+ configure(t = {}) {
886
+ const e = this.extend({
887
+ ...this.config,
888
+ addOptions: () => Z(this.options, t)
889
+ });
890
+ return e.name = this.name, e.parent = this.parent, e;
891
+ }
892
+ extend(t = {}) {
893
+ const e = new T({ ...this.config, ...t });
894
+ return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = k(b(e, "addOptions", {
895
+ name: e.name
896
+ })), e.storage = k(b(e, "addStorage", {
897
+ name: e.name,
898
+ options: e.options
899
+ })), e;
900
+ }
901
+ }
902
+ function At(n, t, e) {
903
+ const { from: r, to: s } = t, { blockSeparator: o = `
904
+
905
+ `, textSerializers: i = {} } = e || {};
906
+ let c = "";
907
+ return n.nodesBetween(r, s, (a, l, u, d) => {
908
+ var f;
909
+ a.isBlock && l > r && (c += o);
910
+ const p = i == null ? void 0 : i[a.type.name];
911
+ if (p)
912
+ return u && (c += p({
913
+ node: a,
914
+ pos: l,
915
+ parent: u,
916
+ index: d,
917
+ range: t
918
+ })), !1;
919
+ a.isText && (c += (f = a == null ? void 0 : a.text) === null || f === void 0 ? void 0 : f.slice(Math.max(r, l) - l, s - l));
920
+ }), c;
921
+ }
922
+ function Pt(n) {
923
+ return Object.fromEntries(Object.entries(n.nodes).filter(([, t]) => t.spec.toText).map(([t, e]) => [t, e.spec.toText]));
924
+ }
925
+ const Be = T.create({
926
+ name: "clipboardTextSerializer",
927
+ addOptions() {
928
+ return {
929
+ blockSeparator: void 0
930
+ };
931
+ },
932
+ addProseMirrorPlugins() {
933
+ return [
934
+ new I({
935
+ key: new j("clipboardTextSerializer"),
936
+ props: {
937
+ clipboardTextSerializer: () => {
938
+ const { editor: n } = this, { state: t, schema: e } = n, { doc: r, selection: s } = t, { ranges: o } = s, i = Math.min(...o.map((u) => u.$from.pos)), c = Math.max(...o.map((u) => u.$to.pos)), a = Pt(e);
939
+ return At(r, { from: i, to: c }, {
940
+ ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
941
+ textSerializers: a
942
+ });
943
+ }
944
+ }
945
+ })
946
+ ];
947
+ }
948
+ }), je = () => ({ editor: n, view: t }) => (requestAnimationFrame(() => {
949
+ var e;
950
+ n.isDestroyed || (t.dom.blur(), (e = window == null ? void 0 : window.getSelection()) === null || e === void 0 || e.removeAllRanges());
951
+ }), !0), De = (n = !1) => ({ commands: t }) => t.setContent("", n), Re = () => ({ state: n, tr: t, dispatch: e }) => {
952
+ const { selection: r } = t, { ranges: s } = r;
953
+ return e && s.forEach(({ $from: o, $to: i }) => {
954
+ n.doc.nodesBetween(o.pos, i.pos, (c, a) => {
955
+ if (c.type.isText)
956
+ return;
957
+ const { doc: l, mapping: u } = t, d = l.resolve(u.map(a)), f = l.resolve(u.map(a + c.nodeSize)), p = d.blockRange(f);
958
+ if (!p)
959
+ return;
960
+ const h = Gt(p);
961
+ if (c.type.isTextblock) {
962
+ const { defaultType: m } = d.parent.contentMatchAt(d.index());
963
+ t.setNodeMarkup(p.start, m);
964
+ }
965
+ (h || h === 0) && t.lift(p, h);
966
+ });
967
+ }), !0;
968
+ }, Fe = (n) => (t) => n(t), Le = () => ({ state: n, dispatch: t }) => he(n, t), ze = (n, t) => ({ editor: e, tr: r }) => {
969
+ const { state: s } = e, o = s.doc.slice(n.from, n.to);
970
+ r.deleteRange(n.from, n.to);
971
+ const i = r.mapping.map(t);
972
+ return r.insert(i, o.content), r.setSelection(new P(r.doc.resolve(i - 1))), !0;
973
+ }, _e = () => ({ tr: n, dispatch: t }) => {
974
+ const { selection: e } = n, r = e.$anchor.node();
975
+ if (r.content.size > 0)
976
+ return !1;
977
+ const s = n.selection.$anchor;
978
+ for (let o = s.depth; o > 0; o -= 1)
979
+ if (s.node(o).type === r.type) {
980
+ if (t) {
981
+ const c = s.before(o), a = s.after(o);
982
+ n.delete(c, a).scrollIntoView();
983
+ }
984
+ return !0;
985
+ }
986
+ return !1;
987
+ }, He = (n) => ({ tr: t, state: e, dispatch: r }) => {
988
+ const s = S(n, e.schema), o = t.selection.$anchor;
989
+ for (let i = o.depth; i > 0; i -= 1)
990
+ if (o.node(i).type === s) {
991
+ if (r) {
992
+ const a = o.before(i), l = o.after(i);
993
+ t.delete(a, l).scrollIntoView();
994
+ }
995
+ return !0;
996
+ }
997
+ return !1;
998
+ }, Ve = (n) => ({ tr: t, dispatch: e }) => {
999
+ const { from: r, to: s } = n;
1000
+ return e && t.delete(r, s), !0;
1001
+ }, We = () => ({ state: n, dispatch: t }) => pe(n, t), Ke = () => ({ commands: n }) => n.keyboardShortcut("Enter"), Ue = () => ({ state: n, dispatch: t }) => fe(n, t);
1002
+ function q(n, t, e = { strict: !0 }) {
1003
+ const r = Object.keys(t);
1004
+ return r.length ? r.every((s) => e.strict ? t[s] === n[s] : ft(t[s]) ? t[s].test(n[s]) : t[s] === n[s]) : !0;
1005
+ }
1006
+ function Ot(n, t, e = {}) {
1007
+ return n.find((r) => r.type === t && q(
1008
+ // Only check equality for the attributes that are provided
1009
+ Object.fromEntries(Object.keys(e).map((s) => [s, r.attrs[s]])),
1010
+ e
1011
+ ));
1012
+ }
1013
+ function vt(n, t, e = {}) {
1014
+ return !!Ot(n, t, e);
1015
+ }
1016
+ function pt(n, t, e) {
1017
+ var r;
1018
+ if (!n || !t)
1019
+ return;
1020
+ let s = n.parent.childAfter(n.parentOffset);
1021
+ if ((!s.node || !s.node.marks.some((u) => u.type === t)) && (s = n.parent.childBefore(n.parentOffset)), !s.node || !s.node.marks.some((u) => u.type === t) || (e = e || ((r = s.node.marks[0]) === null || r === void 0 ? void 0 : r.attrs), !Ot([...s.node.marks], t, e)))
1022
+ return;
1023
+ let i = s.index, c = n.start() + s.offset, a = i + 1, l = c + s.node.nodeSize;
1024
+ for (; i > 0 && vt([...n.parent.child(i - 1).marks], t, e); )
1025
+ i -= 1, c -= n.parent.child(i).nodeSize;
1026
+ for (; a < n.parent.childCount && vt([...n.parent.child(a).marks], t, e); )
1027
+ l += n.parent.child(a).nodeSize, a += 1;
1028
+ return {
1029
+ from: c,
1030
+ to: l
1031
+ };
1032
+ }
1033
+ function N(n, t) {
1034
+ if (typeof n == "string") {
1035
+ if (!t.marks[n])
1036
+ throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);
1037
+ return t.marks[n];
1038
+ }
1039
+ return n;
1040
+ }
1041
+ const qe = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1042
+ const o = N(n, r.schema), { doc: i, selection: c } = e, { $from: a, from: l, to: u } = c;
1043
+ if (s) {
1044
+ const d = pt(a, o, t);
1045
+ if (d && d.from <= l && d.to >= u) {
1046
+ const f = P.create(i, d.from, d.to);
1047
+ e.setSelection(f);
1048
+ }
1049
+ }
1050
+ return !0;
1051
+ }, Ge = (n) => (t) => {
1052
+ const e = typeof n == "function" ? n(t) : n;
1053
+ for (let r = 0; r < e.length; r += 1)
1054
+ if (e[r](t))
1055
+ return !0;
1056
+ return !1;
1057
+ };
1058
+ function It(n) {
1059
+ return n instanceof P;
1060
+ }
1061
+ function O(n = 0, t = 0, e = 0) {
1062
+ return Math.min(Math.max(n, t), e);
1063
+ }
1064
+ function $t(n, t = null) {
1065
+ if (!t)
1066
+ return null;
1067
+ const e = R.atStart(n), r = R.atEnd(n);
1068
+ if (t === "start" || t === !0)
1069
+ return e;
1070
+ if (t === "end")
1071
+ return r;
1072
+ const s = e.from, o = r.to;
1073
+ return t === "all" ? P.create(n, O(0, s, o), O(n.content.size, s, o)) : P.create(n, O(t, s, o), O(t, s, o));
1074
+ }
1075
+ function Nt() {
1076
+ return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
1077
+ }
1078
+ function tt() {
1079
+ return [
1080
+ "iPad Simulator",
1081
+ "iPhone Simulator",
1082
+ "iPod Simulator",
1083
+ "iPad",
1084
+ "iPhone",
1085
+ "iPod"
1086
+ ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
1087
+ }
1088
+ const Je = (n = null, t = {}) => ({ editor: e, view: r, tr: s, dispatch: o }) => {
1089
+ t = {
1090
+ scrollIntoView: !0,
1091
+ ...t
1092
+ };
1093
+ const i = () => {
1094
+ (tt() || Nt()) && r.dom.focus(), requestAnimationFrame(() => {
1095
+ e.isDestroyed || (r.focus(), t != null && t.scrollIntoView && e.commands.scrollIntoView());
1096
+ });
1097
+ };
1098
+ if (r.hasFocus() && n === null || n === !1)
1099
+ return !0;
1100
+ if (o && n === null && !It(e.state.selection))
1101
+ return i(), !0;
1102
+ const c = $t(s.doc, n) || e.state.selection, a = e.state.selection.eq(c);
1103
+ return o && (a || s.setSelection(c), a && s.storedMarks && s.setStoredMarks(s.storedMarks), i()), !0;
1104
+ }, Xe = (n, t) => (e) => n.every((r, s) => t(r, { ...e, index: s })), Ye = (n, t) => ({ tr: e, commands: r }) => r.insertContentAt({ from: e.selection.from, to: e.selection.to }, n, t), Bt = (n) => {
1105
+ const t = n.childNodes;
1106
+ for (let e = t.length - 1; e >= 0; e -= 1) {
1107
+ const r = t[e];
1108
+ r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? n.removeChild(r) : r.nodeType === 1 && Bt(r);
1109
+ }
1110
+ return n;
1111
+ };
1112
+ function V(n) {
1113
+ const t = `<body>${n}</body>`, e = new window.DOMParser().parseFromString(t, "text/html").body;
1114
+ return Bt(e);
1115
+ }
1116
+ function G(n, t, e) {
1117
+ if (n instanceof Wt || n instanceof $)
1118
+ return n;
1119
+ e = {
1120
+ slice: !0,
1121
+ parseOptions: {},
1122
+ ...e
1123
+ };
1124
+ const r = typeof n == "object" && n !== null, s = typeof n == "string";
1125
+ if (r)
1126
+ try {
1127
+ if (Array.isArray(n) && n.length > 0)
1128
+ return $.fromArray(n.map((c) => t.nodeFromJSON(c)));
1129
+ const i = t.nodeFromJSON(n);
1130
+ return e.errorOnInvalidContent && i.check(), i;
1131
+ } catch (o) {
1132
+ if (e.errorOnInvalidContent)
1133
+ throw new Error("[tiptap error]: Invalid JSON content", { cause: o });
1134
+ return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", o), G("", t, e);
1135
+ }
1136
+ if (s) {
1137
+ if (e.errorOnInvalidContent) {
1138
+ let i = !1, c = "";
1139
+ const a = new St({
1140
+ topNode: t.spec.topNode,
1141
+ marks: t.spec.marks,
1142
+ // Prosemirror's schemas are executed such that: the last to execute, matches last
1143
+ // This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle
1144
+ nodes: t.spec.nodes.append({
1145
+ __tiptap__private__unknown__catch__all__node: {
1146
+ content: "inline*",
1147
+ group: "block",
1148
+ parseDOM: [
1149
+ {
1150
+ tag: "*",
1151
+ getAttrs: (l) => (i = !0, c = typeof l == "string" ? l : l.outerHTML, null)
1152
+ }
1153
+ ]
1154
+ }
1155
+ })
1156
+ });
1157
+ if (e.slice ? nt.fromSchema(a).parseSlice(V(n), e.parseOptions) : nt.fromSchema(a).parse(V(n), e.parseOptions), e.errorOnInvalidContent && i)
1158
+ throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${c}`) });
1159
+ }
1160
+ const o = nt.fromSchema(t);
1161
+ return e.slice ? o.parseSlice(V(n), e.parseOptions).content : o.parse(V(n), e.parseOptions);
1162
+ }
1163
+ return G("", t, e);
1164
+ }
1165
+ function Qe(n, t, e) {
1166
+ const r = n.steps.length - 1;
1167
+ if (r < t)
1168
+ return;
1169
+ const s = n.steps[r];
1170
+ if (!(s instanceof Jt || s instanceof Xt))
1171
+ return;
1172
+ const o = n.mapping.maps[r];
1173
+ let i = 0;
1174
+ o.forEach((c, a, l, u) => {
1175
+ i === 0 && (i = u);
1176
+ }), n.setSelection(R.near(n.doc.resolve(i), e));
1177
+ }
1178
+ const Ze = (n) => !("type" in n), tn = (n, t, e) => ({ tr: r, dispatch: s, editor: o }) => {
1179
+ var i;
1180
+ if (s) {
1181
+ e = {
1182
+ parseOptions: o.options.parseOptions,
1183
+ updateSelection: !0,
1184
+ applyInputRules: !1,
1185
+ applyPasteRules: !1,
1186
+ ...e
1187
+ };
1188
+ let c;
1189
+ try {
1190
+ c = G(t, o.schema, {
1191
+ parseOptions: {
1192
+ preserveWhitespace: "full",
1193
+ ...e.parseOptions
1194
+ },
1195
+ errorOnInvalidContent: (i = e.errorOnInvalidContent) !== null && i !== void 0 ? i : o.options.enableContentCheck
1196
+ });
1197
+ } catch (h) {
1198
+ return o.emit("contentError", {
1199
+ editor: o,
1200
+ error: h,
1201
+ disableCollaboration: () => {
1202
+ o.storage.collaboration && (o.storage.collaboration.isDisabled = !0);
1203
+ }
1204
+ }), !1;
1205
+ }
1206
+ let { from: a, to: l } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, u = !0, d = !0;
1207
+ if ((Ze(c) ? c : [c]).forEach((h) => {
1208
+ h.check(), u = u ? h.isText && h.marks.length === 0 : !1, d = d ? h.isBlock : !1;
1209
+ }), a === l && d) {
1210
+ const { parent: h } = r.doc.resolve(a);
1211
+ h.isTextblock && !h.type.spec.code && !h.childCount && (a -= 1, l += 1);
1212
+ }
1213
+ let p;
1214
+ if (u) {
1215
+ if (Array.isArray(t))
1216
+ p = t.map((h) => h.text || "").join("");
1217
+ else if (t instanceof $) {
1218
+ let h = "";
1219
+ t.forEach((m) => {
1220
+ m.text && (h += m.text);
1221
+ }), p = h;
1222
+ } else typeof t == "object" && t && t.text ? p = t.text : p = t;
1223
+ r.insertText(p, a, l);
1224
+ } else
1225
+ p = c, r.replaceWith(a, l, p);
1226
+ e.updateSelection && Qe(r, r.steps.length - 1, -1), e.applyInputRules && r.setMeta("applyInputRules", { from: a, text: p }), e.applyPasteRules && r.setMeta("applyPasteRules", { from: a, text: p });
1227
+ }
1228
+ return !0;
1229
+ }, en = () => ({ state: n, dispatch: t }) => ie(n, t), nn = () => ({ state: n, dispatch: t }) => de(n, t), rn = () => ({ state: n, dispatch: t }) => ue(n, t), sn = () => ({ state: n, dispatch: t }) => le(n, t), on = () => ({ state: n, dispatch: t, tr: e }) => {
1230
+ try {
1231
+ const r = xt(n.doc, n.selection.$from.pos, -1);
1232
+ return r == null ? !1 : (e.join(r, 2), t && t(e), !0);
1233
+ } catch {
1234
+ return !1;
1235
+ }
1236
+ }, an = () => ({ state: n, dispatch: t, tr: e }) => {
1237
+ try {
1238
+ const r = xt(n.doc, n.selection.$from.pos, 1);
1239
+ return r == null ? !1 : (e.join(r, 2), t && t(e), !0);
1240
+ } catch {
1241
+ return !1;
1242
+ }
1243
+ }, cn = () => ({ state: n, dispatch: t }) => ce(n, t), ln = () => ({ state: n, dispatch: t }) => ae(n, t);
1244
+ function jt() {
1245
+ return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
1246
+ }
1247
+ function dn(n) {
1248
+ const t = n.split(/-(?!$)/);
1249
+ let e = t[t.length - 1];
1250
+ e === "Space" && (e = " ");
1251
+ let r, s, o, i;
1252
+ for (let c = 0; c < t.length - 1; c += 1) {
1253
+ const a = t[c];
1254
+ if (/^(cmd|meta|m)$/i.test(a))
1255
+ i = !0;
1256
+ else if (/^a(lt)?$/i.test(a))
1257
+ r = !0;
1258
+ else if (/^(c|ctrl|control)$/i.test(a))
1259
+ s = !0;
1260
+ else if (/^s(hift)?$/i.test(a))
1261
+ o = !0;
1262
+ else if (/^mod$/i.test(a))
1263
+ tt() || jt() ? i = !0 : s = !0;
1264
+ else
1265
+ throw new Error(`Unrecognized modifier name: ${a}`);
1266
+ }
1267
+ return r && (e = `Alt-${e}`), s && (e = `Ctrl-${e}`), i && (e = `Meta-${e}`), o && (e = `Shift-${e}`), e;
1268
+ }
1269
+ const un = (n) => ({ editor: t, view: e, tr: r, dispatch: s }) => {
1270
+ const o = dn(n).split(/-(?!$)/), i = o.find((l) => !["Alt", "Ctrl", "Meta", "Shift"].includes(l)), c = new KeyboardEvent("keydown", {
1271
+ key: i === "Space" ? " " : i,
1272
+ altKey: o.includes("Alt"),
1273
+ ctrlKey: o.includes("Ctrl"),
1274
+ metaKey: o.includes("Meta"),
1275
+ shiftKey: o.includes("Shift"),
1276
+ bubbles: !0,
1277
+ cancelable: !0
1278
+ }), a = t.captureTransaction(() => {
1279
+ e.someProp("handleKeyDown", (l) => l(e, c));
1280
+ });
1281
+ return a == null || a.steps.forEach((l) => {
1282
+ const u = l.map(r.mapping);
1283
+ u && s && r.maybeStep(u);
1284
+ }), !0;
1285
+ };
1286
+ function L(n, t, e = {}) {
1287
+ const { from: r, to: s, empty: o } = n.selection, i = t ? S(t, n.schema) : null, c = [];
1288
+ n.doc.nodesBetween(r, s, (d, f) => {
1289
+ if (d.isText)
1290
+ return;
1291
+ const p = Math.max(r, f), h = Math.min(s, f + d.nodeSize);
1292
+ c.push({
1293
+ node: d,
1294
+ from: p,
1295
+ to: h
1296
+ });
1297
+ });
1298
+ const a = s - r, l = c.filter((d) => i ? i.name === d.node.type.name : !0).filter((d) => q(d.node.attrs, e, { strict: !1 }));
1299
+ return o ? !!l.length : l.reduce((d, f) => d + f.to - f.from, 0) >= a;
1300
+ }
1301
+ const fn = (n, t = {}) => ({ state: e, dispatch: r }) => {
1302
+ const s = S(n, e.schema);
1303
+ return L(e, s, t) ? oe(e, r) : !1;
1304
+ }, pn = () => ({ state: n, dispatch: t }) => se(n, t), hn = (n) => ({ state: t, dispatch: e }) => {
1305
+ const r = S(n, t.schema);
1306
+ return ye(r)(t, e);
1307
+ }, mn = () => ({ state: n, dispatch: t }) => re(n, t);
1308
+ function et(n, t) {
1309
+ return t.nodes[n] ? "node" : t.marks[n] ? "mark" : null;
1310
+ }
1311
+ function wt(n, t) {
1312
+ const e = typeof t == "string" ? [t] : t;
1313
+ return Object.keys(n).reduce((r, s) => (e.includes(s) || (r[s] = n[s]), r), {});
1314
+ }
1315
+ const gn = (n, t) => ({ tr: e, state: r, dispatch: s }) => {
1316
+ let o = null, i = null;
1317
+ const c = et(typeof n == "string" ? n : n.name, r.schema);
1318
+ return c ? (c === "node" && (o = S(n, r.schema)), c === "mark" && (i = N(n, r.schema)), s && e.selection.ranges.forEach((a) => {
1319
+ r.doc.nodesBetween(a.$from.pos, a.$to.pos, (l, u) => {
1320
+ o && o === l.type && e.setNodeMarkup(u, void 0, wt(l.attrs, t)), i && l.marks.length && l.marks.forEach((d) => {
1321
+ i === d.type && e.addMark(u, u + l.nodeSize, i.create(wt(d.attrs, t)));
1322
+ });
1323
+ });
1324
+ }), !0) : !1;
1325
+ }, yn = () => ({ tr: n, dispatch: t }) => (t && n.scrollIntoView(), !0), bn = () => ({ tr: n, dispatch: t }) => {
1326
+ if (t) {
1327
+ const e = new zt(n.doc);
1328
+ n.setSelection(e);
1329
+ }
1330
+ return !0;
1331
+ }, kn = () => ({ state: n, dispatch: t }) => ne(n, t), vn = () => ({ state: n, dispatch: t }) => ee(n, t), wn = () => ({ state: n, dispatch: t }) => te(n, t), Mn = () => ({ state: n, dispatch: t }) => Zt(n, t), En = () => ({ state: n, dispatch: t }) => Qt(n, t);
1332
+ function at(n, t, e = {}, r = {}) {
1333
+ return G(n, t, {
1334
+ slice: !1,
1335
+ parseOptions: e,
1336
+ errorOnInvalidContent: r.errorOnInvalidContent
1337
+ });
1338
+ }
1339
+ const Sn = (n, t = !1, e = {}, r = {}) => ({ editor: s, tr: o, dispatch: i, commands: c }) => {
1340
+ var a, l;
1341
+ const { doc: u } = o;
1342
+ if (e.preserveWhitespace !== "full") {
1343
+ const d = at(n, s.schema, e, {
1344
+ errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : s.options.enableContentCheck
1345
+ });
1346
+ return i && o.replaceWith(0, u.content.size, d).setMeta("preventUpdate", !t), !0;
1347
+ }
1348
+ return i && o.setMeta("preventUpdate", !t), c.insertContentAt({ from: 0, to: u.content.size }, n, {
1349
+ parseOptions: e,
1350
+ errorOnInvalidContent: (l = r.errorOnInvalidContent) !== null && l !== void 0 ? l : s.options.enableContentCheck
1351
+ });
1352
+ };
1353
+ function Dt(n, t) {
1354
+ const e = N(t, n.schema), { from: r, to: s, empty: o } = n.selection, i = [];
1355
+ o ? (n.storedMarks && i.push(...n.storedMarks), i.push(...n.selection.$head.marks())) : n.doc.nodesBetween(r, s, (a) => {
1356
+ i.push(...a.marks);
1357
+ });
1358
+ const c = i.find((a) => a.type.name === e.name);
1359
+ return c ? { ...c.attrs } : {};
1360
+ }
1361
+ function gr(n, t) {
1362
+ const e = new qt(n);
1363
+ return t.forEach((r) => {
1364
+ r.steps.forEach((s) => {
1365
+ e.step(s);
1366
+ });
1367
+ }), e;
1368
+ }
1369
+ function xn(n) {
1370
+ for (let t = 0; t < n.edgeCount; t += 1) {
1371
+ const { type: e } = n.edge(t);
1372
+ if (e.isTextblock && !e.hasRequiredAttrs())
1373
+ return e;
1374
+ }
1375
+ return null;
1376
+ }
1377
+ function yr(n, t, e) {
1378
+ const r = [];
1379
+ return n.nodesBetween(t.from, t.to, (s, o) => {
1380
+ e(s) && r.push({
1381
+ node: s,
1382
+ pos: o
1383
+ });
1384
+ }), r;
1385
+ }
1386
+ function Tn(n, t) {
1387
+ for (let e = n.depth; e > 0; e -= 1) {
1388
+ const r = n.node(e);
1389
+ if (t(r))
1390
+ return {
1391
+ pos: e > 0 ? n.before(e) : 0,
1392
+ start: n.start(e),
1393
+ depth: e,
1394
+ node: r
1395
+ };
1396
+ }
1397
+ }
1398
+ function ht(n) {
1399
+ return (t) => Tn(t.$from, n);
1400
+ }
1401
+ function Cn(n, t) {
1402
+ const e = {
1403
+ from: 0,
1404
+ to: n.content.size
1405
+ };
1406
+ return At(n, e, t);
1407
+ }
1408
+ function An(n, t) {
1409
+ const e = S(t, n.schema), { from: r, to: s } = n.selection, o = [];
1410
+ n.doc.nodesBetween(r, s, (c) => {
1411
+ o.push(c);
1412
+ });
1413
+ const i = o.reverse().find((c) => c.type.name === e.name);
1414
+ return i ? { ...i.attrs } : {};
1415
+ }
1416
+ function Pn(n, t) {
1417
+ const e = et(typeof t == "string" ? t : t.name, n.schema);
1418
+ return e === "node" ? An(n, t) : e === "mark" ? Dt(n, t) : {};
1419
+ }
1420
+ function On(n, t = JSON.stringify) {
1421
+ const e = {};
1422
+ return n.filter((r) => {
1423
+ const s = t(r);
1424
+ return Object.prototype.hasOwnProperty.call(e, s) ? !1 : e[s] = !0;
1425
+ });
1426
+ }
1427
+ function In(n) {
1428
+ const t = On(n);
1429
+ return t.length === 1 ? t : t.filter((e, r) => !t.filter((o, i) => i !== r).some((o) => e.oldRange.from >= o.oldRange.from && e.oldRange.to <= o.oldRange.to && e.newRange.from >= o.newRange.from && e.newRange.to <= o.newRange.to));
1430
+ }
1431
+ function br(n) {
1432
+ const { mapping: t, steps: e } = n, r = [];
1433
+ return t.maps.forEach((s, o) => {
1434
+ const i = [];
1435
+ if (s.ranges.length)
1436
+ s.forEach((c, a) => {
1437
+ i.push({ from: c, to: a });
1438
+ });
1439
+ else {
1440
+ const { from: c, to: a } = e[o];
1441
+ if (c === void 0 || a === void 0)
1442
+ return;
1443
+ i.push({ from: c, to: a });
1444
+ }
1445
+ i.forEach(({ from: c, to: a }) => {
1446
+ const l = t.slice(o).map(c, -1), u = t.slice(o).map(a), d = t.invert().map(l, -1), f = t.invert().map(u);
1447
+ r.push({
1448
+ oldRange: {
1449
+ from: d,
1450
+ to: f
1451
+ },
1452
+ newRange: {
1453
+ from: l,
1454
+ to: u
1455
+ }
1456
+ });
1457
+ });
1458
+ }), In(r);
1459
+ }
1460
+ function Rt(n, t, e) {
1461
+ const r = [];
1462
+ return n === t ? e.resolve(n).marks().forEach((s) => {
1463
+ const o = e.resolve(n), i = pt(o, s.type);
1464
+ i && r.push({
1465
+ mark: s,
1466
+ ...i
1467
+ });
1468
+ }) : e.nodesBetween(n, t, (s, o) => {
1469
+ !s || (s == null ? void 0 : s.nodeSize) === void 0 || r.push(...s.marks.map((i) => ({
1470
+ from: o,
1471
+ to: o + s.nodeSize,
1472
+ mark: i
1473
+ })));
1474
+ }), r;
1475
+ }
1476
+ function K(n, t, e) {
1477
+ return Object.fromEntries(Object.entries(e).filter(([r]) => {
1478
+ const s = n.find((o) => o.type === t && o.name === r);
1479
+ return s ? s.attribute.keepOnSplit : !1;
1480
+ }));
1481
+ }
1482
+ function ct(n, t, e = {}) {
1483
+ const { empty: r, ranges: s } = n.selection, o = t ? N(t, n.schema) : null;
1484
+ if (r)
1485
+ return !!(n.storedMarks || n.selection.$from.marks()).filter((d) => o ? o.name === d.type.name : !0).find((d) => q(d.attrs, e, { strict: !1 }));
1486
+ let i = 0;
1487
+ const c = [];
1488
+ if (s.forEach(({ $from: d, $to: f }) => {
1489
+ const p = d.pos, h = f.pos;
1490
+ n.doc.nodesBetween(p, h, (m, g) => {
1491
+ if (!m.isText && !m.marks.length)
1492
+ return;
1493
+ const y = Math.max(p, g), v = Math.min(h, g + m.nodeSize), w = v - y;
1494
+ i += w, c.push(...m.marks.map((E) => ({
1495
+ mark: E,
1496
+ from: y,
1497
+ to: v
1498
+ })));
1499
+ });
1500
+ }), i === 0)
1501
+ return !1;
1502
+ const a = c.filter((d) => o ? o.name === d.mark.type.name : !0).filter((d) => q(d.mark.attrs, e, { strict: !1 })).reduce((d, f) => d + f.to - f.from, 0), l = c.filter((d) => o ? d.mark.type !== o && d.mark.type.excludes(o) : !0).reduce((d, f) => d + f.to - f.from, 0);
1503
+ return (a > 0 ? a + l : a) >= i;
1504
+ }
1505
+ function $n(n, t, e = {}) {
1506
+ if (!t)
1507
+ return L(n, null, e) || ct(n, null, e);
1508
+ const r = et(t, n.schema);
1509
+ return r === "node" ? L(n, t, e) : r === "mark" ? ct(n, t, e) : !1;
1510
+ }
1511
+ function Mt(n, t) {
1512
+ const { nodeExtensions: e } = Y(t), r = e.find((i) => i.name === n);
1513
+ if (!r)
1514
+ return !1;
1515
+ const s = {
1516
+ name: r.name,
1517
+ options: r.options,
1518
+ storage: r.storage
1519
+ }, o = k(b(r, "group", s));
1520
+ return typeof o != "string" ? !1 : o.split(" ").includes("list");
1521
+ }
1522
+ function mt(n, { checkChildren: t = !0, ignoreWhitespace: e = !1 } = {}) {
1523
+ var r;
1524
+ if (e) {
1525
+ if (n.type.name === "hardBreak")
1526
+ return !0;
1527
+ if (n.isText)
1528
+ return /^\s*$/m.test((r = n.text) !== null && r !== void 0 ? r : "");
1529
+ }
1530
+ if (n.isText)
1531
+ return !n.text;
1532
+ if (n.isAtom || n.isLeaf)
1533
+ return !1;
1534
+ if (n.content.childCount === 0)
1535
+ return !0;
1536
+ if (t) {
1537
+ let s = !0;
1538
+ return n.content.forEach((o) => {
1539
+ s !== !1 && (mt(o, { ignoreWhitespace: e, checkChildren: t }) || (s = !1));
1540
+ }), s;
1541
+ }
1542
+ return !1;
1543
+ }
1544
+ function kr(n) {
1545
+ return n instanceof F;
1546
+ }
1547
+ function vr(n, t, e) {
1548
+ const s = n.state.doc.content.size, o = O(t, 0, s), i = O(e, 0, s), c = n.coordsAtPos(o), a = n.coordsAtPos(i, -1), l = Math.min(c.top, a.top), u = Math.max(c.bottom, a.bottom), d = Math.min(c.left, a.left), f = Math.max(c.right, a.right), p = f - d, h = u - l, y = {
1549
+ top: l,
1550
+ bottom: u,
1551
+ left: d,
1552
+ right: f,
1553
+ width: p,
1554
+ height: h,
1555
+ x: d,
1556
+ y: l
1557
+ };
1558
+ return {
1559
+ ...y,
1560
+ toJSON: () => y
1561
+ };
1562
+ }
1563
+ function Nn(n, t, e) {
1564
+ var r;
1565
+ const { selection: s } = t;
1566
+ let o = null;
1567
+ if (It(s) && (o = s.$cursor), o) {
1568
+ const c = (r = n.storedMarks) !== null && r !== void 0 ? r : o.marks();
1569
+ return !!e.isInSet(c) || !c.some((a) => a.type.excludes(e));
1570
+ }
1571
+ const { ranges: i } = s;
1572
+ return i.some(({ $from: c, $to: a }) => {
1573
+ let l = c.depth === 0 ? n.doc.inlineContent && n.doc.type.allowsMarkType(e) : !1;
1574
+ return n.doc.nodesBetween(c.pos, a.pos, (u, d, f) => {
1575
+ if (l)
1576
+ return !1;
1577
+ if (u.isInline) {
1578
+ const p = !f || f.type.allowsMarkType(e), h = !!e.isInSet(u.marks) || !u.marks.some((m) => m.type.excludes(e));
1579
+ l = p && h;
1580
+ }
1581
+ return !l;
1582
+ }), l;
1583
+ });
1584
+ }
1585
+ const Bn = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1586
+ const { selection: o } = e, { empty: i, ranges: c } = o, a = N(n, r.schema);
1587
+ if (s)
1588
+ if (i) {
1589
+ const l = Dt(r, a);
1590
+ e.addStoredMark(a.create({
1591
+ ...l,
1592
+ ...t
1593
+ }));
1594
+ } else
1595
+ c.forEach((l) => {
1596
+ const u = l.$from.pos, d = l.$to.pos;
1597
+ r.doc.nodesBetween(u, d, (f, p) => {
1598
+ const h = Math.max(p, u), m = Math.min(p + f.nodeSize, d);
1599
+ f.marks.find((y) => y.type === a) ? f.marks.forEach((y) => {
1600
+ a === y.type && e.addMark(h, m, a.create({
1601
+ ...y.attrs,
1602
+ ...t
1603
+ }));
1604
+ }) : e.addMark(h, m, a.create(t));
1605
+ });
1606
+ });
1607
+ return Nn(r, e, a);
1608
+ }, jn = (n, t) => ({ tr: e }) => (e.setMeta(n, t), !0), Dn = (n, t = {}) => ({ state: e, dispatch: r, chain: s }) => {
1609
+ const o = S(n, e.schema);
1610
+ let i;
1611
+ return e.selection.$anchor.sameParent(e.selection.$head) && (i = e.selection.$anchor.parent.attrs), o.isTextblock ? s().command(({ commands: c }) => gt(o, { ...i, ...t })(e) ? !0 : c.clearNodes()).command(({ state: c }) => gt(o, { ...i, ...t })(c, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
1612
+ }, Rn = (n) => ({ tr: t, dispatch: e }) => {
1613
+ if (e) {
1614
+ const { doc: r } = t, s = O(n, 0, r.content.size), o = F.create(r, s);
1615
+ t.setSelection(o);
1616
+ }
1617
+ return !0;
1618
+ }, Fn = (n) => ({ tr: t, dispatch: e }) => {
1619
+ if (e) {
1620
+ const { doc: r } = t, { from: s, to: o } = typeof n == "number" ? { from: n, to: n } : n, i = P.atStart(r).from, c = P.atEnd(r).to, a = O(s, i, c), l = O(o, i, c), u = P.create(r, a, l);
1621
+ t.setSelection(u);
1622
+ }
1623
+ return !0;
1624
+ }, Ln = (n) => ({ state: t, dispatch: e }) => {
1625
+ const r = S(n, t.schema);
1626
+ return ge(r)(t, e);
1627
+ };
1628
+ function Et(n, t) {
1629
+ const e = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
1630
+ if (e) {
1631
+ const r = e.filter((s) => t == null ? void 0 : t.includes(s.type.name));
1632
+ n.tr.ensureMarks(r);
1633
+ }
1634
+ }
1635
+ const zn = ({ keepMarks: n = !0 } = {}) => ({ tr: t, state: e, dispatch: r, editor: s }) => {
1636
+ const { selection: o, doc: i } = t, { $from: c, $to: a } = o, l = s.extensionManager.attributes, u = K(l, c.node().type.name, c.node().attrs);
1637
+ if (o instanceof F && o.node.isBlock)
1638
+ return !c.parentOffset || !W(i, c.pos) ? !1 : (r && (n && Et(e, s.extensionManager.splittableMarks), t.split(c.pos).scrollIntoView()), !0);
1639
+ if (!c.parent.isBlock)
1640
+ return !1;
1641
+ const d = a.parentOffset === a.parent.content.size, f = c.depth === 0 ? void 0 : xn(c.node(-1).contentMatchAt(c.indexAfter(-1)));
1642
+ let p = d && f ? [
1643
+ {
1644
+ type: f,
1645
+ attrs: u
1646
+ }
1647
+ ] : void 0, h = W(t.doc, t.mapping.map(c.pos), 1, p);
1648
+ if (!p && !h && W(t.doc, t.mapping.map(c.pos), 1, f ? [{ type: f }] : void 0) && (h = !0, p = f ? [
1649
+ {
1650
+ type: f,
1651
+ attrs: u
1652
+ }
1653
+ ] : void 0), r) {
1654
+ if (h && (o instanceof P && t.deleteSelection(), t.split(t.mapping.map(c.pos), 1, p), f && !d && !c.parentOffset && c.parent.type !== f)) {
1655
+ const m = t.mapping.map(c.before()), g = t.doc.resolve(m);
1656
+ c.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && t.setNodeMarkup(t.mapping.map(c.before()), f);
1657
+ }
1658
+ n && Et(e, s.extensionManager.splittableMarks), t.scrollIntoView();
1659
+ }
1660
+ return h;
1661
+ }, _n = (n, t = {}) => ({ tr: e, state: r, dispatch: s, editor: o }) => {
1662
+ var i;
1663
+ const c = S(n, r.schema), { $from: a, $to: l } = r.selection, u = r.selection.node;
1664
+ if (u && u.isBlock || a.depth < 2 || !a.sameParent(l))
1665
+ return !1;
1666
+ const d = a.node(-1);
1667
+ if (d.type !== c)
1668
+ return !1;
1669
+ const f = o.extensionManager.attributes;
1670
+ if (a.parent.content.size === 0 && a.node(-1).childCount === a.indexAfter(-1)) {
1671
+ if (a.depth === 2 || a.node(-3).type !== c || a.index(-2) !== a.node(-2).childCount - 1)
1672
+ return !1;
1673
+ if (s) {
1674
+ let y = $.empty;
1675
+ const v = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
1676
+ for (let A = a.depth - v; A >= a.depth - 3; A -= 1)
1677
+ y = $.from(a.node(A).copy(y));
1678
+ const w = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, E = {
1679
+ ...K(f, a.node().type.name, a.node().attrs),
1680
+ ...t
1681
+ }, M = ((i = c.contentMatch.defaultType) === null || i === void 0 ? void 0 : i.createAndFill(E)) || void 0;
1682
+ y = y.append($.from(c.createAndFill(null, M) || void 0));
1683
+ const x = a.before(a.depth - (v - 1));
1684
+ e.replace(x, a.after(-w), new Kt(y, 4 - v, 0));
1685
+ let C = -1;
1686
+ e.doc.nodesBetween(x, e.doc.content.size, (A, Ft) => {
1687
+ if (C > -1)
1688
+ return !1;
1689
+ A.isTextblock && A.content.size === 0 && (C = Ft + 1);
1690
+ }), C > -1 && e.setSelection(P.near(e.doc.resolve(C))), e.scrollIntoView();
1691
+ }
1692
+ return !0;
1693
+ }
1694
+ const p = l.pos === a.end() ? d.contentMatchAt(0).defaultType : null, h = {
1695
+ ...K(f, d.type.name, d.attrs),
1696
+ ...t
1697
+ }, m = {
1698
+ ...K(f, a.node().type.name, a.node().attrs),
1699
+ ...t
1700
+ };
1701
+ e.delete(a.pos, l.pos);
1702
+ const g = p ? [
1703
+ { type: c, attrs: h },
1704
+ { type: p, attrs: m }
1705
+ ] : [{ type: c, attrs: h }];
1706
+ if (!W(e.doc, a.pos, 2))
1707
+ return !1;
1708
+ if (s) {
1709
+ const { selection: y, storedMarks: v } = r, { splittableMarks: w } = o.extensionManager, E = v || y.$to.parentOffset && y.$from.marks();
1710
+ if (e.split(a.pos, 2, g).scrollIntoView(), !E || !s)
1711
+ return !0;
1712
+ const M = E.filter((x) => w.includes(x.type.name));
1713
+ e.ensureMarks(M);
1714
+ }
1715
+ return !0;
1716
+ }, st = (n, t) => {
1717
+ const e = ht((i) => i.type === t)(n.selection);
1718
+ if (!e)
1719
+ return !0;
1720
+ const r = n.doc.resolve(Math.max(0, e.pos - 1)).before(e.depth);
1721
+ if (r === void 0)
1722
+ return !0;
1723
+ const s = n.doc.nodeAt(r);
1724
+ return e.node.type === (s == null ? void 0 : s.type) && dt(n.doc, e.pos) && n.join(e.pos), !0;
1725
+ }, ot = (n, t) => {
1726
+ const e = ht((i) => i.type === t)(n.selection);
1727
+ if (!e)
1728
+ return !0;
1729
+ const r = n.doc.resolve(e.start).after(e.depth);
1730
+ if (r === void 0)
1731
+ return !0;
1732
+ const s = n.doc.nodeAt(r);
1733
+ return e.node.type === (s == null ? void 0 : s.type) && dt(n.doc, r) && n.join(r), !0;
1734
+ }, Hn = (n, t, e, r = {}) => ({ editor: s, tr: o, state: i, dispatch: c, chain: a, commands: l, can: u }) => {
1735
+ const { extensions: d, splittableMarks: f } = s.extensionManager, p = S(n, i.schema), h = S(t, i.schema), { selection: m, storedMarks: g } = i, { $from: y, $to: v } = m, w = y.blockRange(v), E = g || m.$to.parentOffset && m.$from.marks();
1736
+ if (!w)
1737
+ return !1;
1738
+ const M = ht((x) => Mt(x.type.name, d))(m);
1739
+ if (w.depth >= 1 && M && w.depth - M.depth <= 1) {
1740
+ if (M.node.type === p)
1741
+ return l.liftListItem(h);
1742
+ if (Mt(M.node.type.name, d) && p.validContent(M.node.content) && c)
1743
+ return a().command(() => (o.setNodeMarkup(M.pos, p), !0)).command(() => st(o, p)).command(() => ot(o, p)).run();
1744
+ }
1745
+ return !e || !E || !c ? a().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => st(o, p)).command(() => ot(o, p)).run() : a().command(() => {
1746
+ const x = u().wrapInList(p, r), C = E.filter((A) => f.includes(A.type.name));
1747
+ return o.ensureMarks(C), x ? !0 : l.clearNodes();
1748
+ }).wrapInList(p, r).command(() => st(o, p)).command(() => ot(o, p)).run();
1749
+ }, Vn = (n, t = {}, e = {}) => ({ state: r, commands: s }) => {
1750
+ const { extendEmptyMarkRange: o = !1 } = e, i = N(n, r.schema);
1751
+ return ct(r, i, t) ? s.unsetMark(i, { extendEmptyMarkRange: o }) : s.setMark(i, t);
1752
+ }, Wn = (n, t, e = {}) => ({ state: r, commands: s }) => {
1753
+ const o = S(n, r.schema), i = S(t, r.schema), c = L(r, o, e);
1754
+ let a;
1755
+ return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), c ? s.setNode(i, a) : s.setNode(o, { ...a, ...e });
1756
+ }, Kn = (n, t = {}) => ({ state: e, commands: r }) => {
1757
+ const s = S(n, e.schema);
1758
+ return L(e, s, t) ? r.lift(s) : r.wrapIn(s, t);
1759
+ }, Un = () => ({ state: n, dispatch: t }) => {
1760
+ const e = n.plugins;
1761
+ for (let r = 0; r < e.length; r += 1) {
1762
+ const s = e[r];
1763
+ let o;
1764
+ if (s.spec.isInputRules && (o = s.getState(n))) {
1765
+ if (t) {
1766
+ const i = n.tr, c = o.transform;
1767
+ for (let a = c.steps.length - 1; a >= 0; a -= 1)
1768
+ i.step(c.steps[a].invert(c.docs[a]));
1769
+ if (o.text) {
1770
+ const a = i.doc.resolve(o.from).marks();
1771
+ i.replaceWith(o.from, o.to, n.schema.text(o.text, a));
1772
+ } else
1773
+ i.delete(o.from, o.to);
1774
+ }
1775
+ return !0;
1776
+ }
1777
+ }
1778
+ return !1;
1779
+ }, qn = () => ({ tr: n, dispatch: t }) => {
1780
+ const { selection: e } = n, { empty: r, ranges: s } = e;
1781
+ return r || t && s.forEach((o) => {
1782
+ n.removeMark(o.$from.pos, o.$to.pos);
1783
+ }), !0;
1784
+ }, Gn = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1785
+ var o;
1786
+ const { extendEmptyMarkRange: i = !1 } = t, { selection: c } = e, a = N(n, r.schema), { $from: l, empty: u, ranges: d } = c;
1787
+ if (!s)
1788
+ return !0;
1789
+ if (u && i) {
1790
+ let { from: f, to: p } = c;
1791
+ const h = (o = l.marks().find((g) => g.type === a)) === null || o === void 0 ? void 0 : o.attrs, m = pt(l, a, h);
1792
+ m && (f = m.from, p = m.to), e.removeMark(f, p, a);
1793
+ } else
1794
+ d.forEach((f) => {
1795
+ e.removeMark(f.$from.pos, f.$to.pos, a);
1796
+ });
1797
+ return e.removeStoredMark(a), !0;
1798
+ }, Jn = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1799
+ let o = null, i = null;
1800
+ const c = et(typeof n == "string" ? n : n.name, r.schema);
1801
+ return c ? (c === "node" && (o = S(n, r.schema)), c === "mark" && (i = N(n, r.schema)), s && e.selection.ranges.forEach((a) => {
1802
+ const l = a.$from.pos, u = a.$to.pos;
1803
+ let d, f, p, h;
1804
+ e.selection.empty ? r.doc.nodesBetween(l, u, (m, g) => {
1805
+ o && o === m.type && (p = Math.max(g, l), h = Math.min(g + m.nodeSize, u), d = g, f = m);
1806
+ }) : r.doc.nodesBetween(l, u, (m, g) => {
1807
+ g < l && o && o === m.type && (p = Math.max(g, l), h = Math.min(g + m.nodeSize, u), d = g, f = m), g >= l && g <= u && (o && o === m.type && e.setNodeMarkup(g, void 0, {
1808
+ ...m.attrs,
1809
+ ...t
1810
+ }), i && m.marks.length && m.marks.forEach((y) => {
1811
+ if (i === y.type) {
1812
+ const v = Math.max(g, l), w = Math.min(g + m.nodeSize, u);
1813
+ e.addMark(v, w, i.create({
1814
+ ...y.attrs,
1815
+ ...t
1816
+ }));
1817
+ }
1818
+ }));
1819
+ }), f && (d !== void 0 && e.setNodeMarkup(d, void 0, {
1820
+ ...f.attrs,
1821
+ ...t
1822
+ }), i && f.marks.length && f.marks.forEach((m) => {
1823
+ i === m.type && e.addMark(p, h, i.create({
1824
+ ...m.attrs,
1825
+ ...t
1826
+ }));
1827
+ }));
1828
+ }), !0) : !1;
1829
+ }, Xn = (n, t = {}) => ({ state: e, dispatch: r }) => {
1830
+ const s = S(n, e.schema);
1831
+ return Yt(s, t)(e, r);
1832
+ }, Yn = (n, t = {}) => ({ state: e, dispatch: r }) => {
1833
+ const s = S(n, e.schema);
1834
+ return me(s, t)(e, r);
1835
+ };
1836
+ var Qn = /* @__PURE__ */ Object.freeze({
1837
+ __proto__: null,
1838
+ blur: je,
1839
+ clearContent: De,
1840
+ clearNodes: Re,
1841
+ command: Fe,
1842
+ createParagraphNear: Le,
1843
+ cut: ze,
1844
+ deleteCurrentNode: _e,
1845
+ deleteNode: He,
1846
+ deleteRange: Ve,
1847
+ deleteSelection: We,
1848
+ enter: Ke,
1849
+ exitCode: Ue,
1850
+ extendMarkRange: qe,
1851
+ first: Ge,
1852
+ focus: Je,
1853
+ forEach: Xe,
1854
+ insertContent: Ye,
1855
+ insertContentAt: tn,
1856
+ joinBackward: rn,
1857
+ joinDown: nn,
1858
+ joinForward: sn,
1859
+ joinItemBackward: on,
1860
+ joinItemForward: an,
1861
+ joinTextblockBackward: cn,
1862
+ joinTextblockForward: ln,
1863
+ joinUp: en,
1864
+ keyboardShortcut: un,
1865
+ lift: fn,
1866
+ liftEmptyBlock: pn,
1867
+ liftListItem: hn,
1868
+ newlineInCode: mn,
1869
+ resetAttributes: gn,
1870
+ scrollIntoView: yn,
1871
+ selectAll: bn,
1872
+ selectNodeBackward: kn,
1873
+ selectNodeForward: vn,
1874
+ selectParentNode: wn,
1875
+ selectTextblockEnd: Mn,
1876
+ selectTextblockStart: En,
1877
+ setContent: Sn,
1878
+ setMark: Bn,
1879
+ setMeta: jn,
1880
+ setNode: Dn,
1881
+ setNodeSelection: Rn,
1882
+ setTextSelection: Fn,
1883
+ sinkListItem: Ln,
1884
+ splitBlock: zn,
1885
+ splitListItem: _n,
1886
+ toggleList: Hn,
1887
+ toggleMark: Vn,
1888
+ toggleNode: Wn,
1889
+ toggleWrap: Kn,
1890
+ undoInputRule: Un,
1891
+ unsetAllMarks: qn,
1892
+ unsetMark: Gn,
1893
+ updateAttributes: Jn,
1894
+ wrapIn: Xn,
1895
+ wrapInList: Yn
1896
+ });
1897
+ const Zn = T.create({
1898
+ name: "commands",
1899
+ addCommands() {
1900
+ return {
1901
+ ...Qn
1902
+ };
1903
+ }
1904
+ }), tr = T.create({
1905
+ name: "drop",
1906
+ addProseMirrorPlugins() {
1907
+ return [
1908
+ new I({
1909
+ key: new j("tiptapDrop"),
1910
+ props: {
1911
+ handleDrop: (n, t, e, r) => {
1912
+ this.editor.emit("drop", {
1913
+ editor: this.editor,
1914
+ event: t,
1915
+ slice: e,
1916
+ moved: r
1917
+ });
1918
+ }
1919
+ }
1920
+ })
1921
+ ];
1922
+ }
1923
+ }), er = T.create({
1924
+ name: "editable",
1925
+ addProseMirrorPlugins() {
1926
+ return [
1927
+ new I({
1928
+ key: new j("editable"),
1929
+ props: {
1930
+ editable: () => this.editor.options.editable
1931
+ }
1932
+ })
1933
+ ];
1934
+ }
1935
+ }), nr = new j("focusEvents"), rr = T.create({
1936
+ name: "focusEvents",
1937
+ addProseMirrorPlugins() {
1938
+ const { editor: n } = this;
1939
+ return [
1940
+ new I({
1941
+ key: nr,
1942
+ props: {
1943
+ handleDOMEvents: {
1944
+ focus: (t, e) => {
1945
+ n.isFocused = !0;
1946
+ const r = n.state.tr.setMeta("focus", { event: e }).setMeta("addToHistory", !1);
1947
+ return t.dispatch(r), !1;
1948
+ },
1949
+ blur: (t, e) => {
1950
+ n.isFocused = !1;
1951
+ const r = n.state.tr.setMeta("blur", { event: e }).setMeta("addToHistory", !1);
1952
+ return t.dispatch(r), !1;
1953
+ }
1954
+ }
1955
+ }
1956
+ })
1957
+ ];
1958
+ }
1959
+ }), sr = T.create({
1960
+ name: "keymap",
1961
+ addKeyboardShortcuts() {
1962
+ const n = () => this.editor.commands.first(({ commands: i }) => [
1963
+ () => i.undoInputRule(),
1964
+ // maybe convert first text block node to default node
1965
+ () => i.command(({ tr: c }) => {
1966
+ const { selection: a, doc: l } = c, { empty: u, $anchor: d } = a, { pos: f, parent: p } = d, h = d.parent.isTextblock && f > 0 ? c.doc.resolve(f - 1) : d, m = h.parent.type.spec.isolating, g = d.pos - d.parentOffset, y = m && h.parent.childCount === 1 ? g === d.pos : R.atStart(l).from === f;
1967
+ return !u || !p.type.isTextblock || p.textContent.length || !y || y && d.parent.type.name === "paragraph" ? !1 : i.clearNodes();
1968
+ }),
1969
+ () => i.deleteSelection(),
1970
+ () => i.joinBackward(),
1971
+ () => i.selectNodeBackward()
1972
+ ]), t = () => this.editor.commands.first(({ commands: i }) => [
1973
+ () => i.deleteSelection(),
1974
+ () => i.deleteCurrentNode(),
1975
+ () => i.joinForward(),
1976
+ () => i.selectNodeForward()
1977
+ ]), r = {
1978
+ Enter: () => this.editor.commands.first(({ commands: i }) => [
1979
+ () => i.newlineInCode(),
1980
+ () => i.createParagraphNear(),
1981
+ () => i.liftEmptyBlock(),
1982
+ () => i.splitBlock()
1983
+ ]),
1984
+ "Mod-Enter": () => this.editor.commands.exitCode(),
1985
+ Backspace: n,
1986
+ "Mod-Backspace": n,
1987
+ "Shift-Backspace": n,
1988
+ Delete: t,
1989
+ "Mod-Delete": t,
1990
+ "Mod-a": () => this.editor.commands.selectAll()
1991
+ }, s = {
1992
+ ...r
1993
+ }, o = {
1994
+ ...r,
1995
+ "Ctrl-h": n,
1996
+ "Alt-Backspace": n,
1997
+ "Ctrl-d": t,
1998
+ "Ctrl-Alt-Backspace": t,
1999
+ "Alt-Delete": t,
2000
+ "Alt-d": t,
2001
+ "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
2002
+ "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
2003
+ };
2004
+ return tt() || jt() ? o : s;
2005
+ },
2006
+ addProseMirrorPlugins() {
2007
+ return [
2008
+ // With this plugin we check if the whole document was selected and deleted.
2009
+ // In this case we will additionally call `clearNodes()` to convert e.g. a heading
2010
+ // to a paragraph if necessary.
2011
+ // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
2012
+ // with many other commands.
2013
+ new I({
2014
+ key: new j("clearDocument"),
2015
+ appendTransaction: (n, t, e) => {
2016
+ if (n.some((m) => m.getMeta("composition")))
2017
+ return;
2018
+ const r = n.some((m) => m.docChanged) && !t.doc.eq(e.doc), s = n.some((m) => m.getMeta("preventClearDocument"));
2019
+ if (!r || s)
2020
+ return;
2021
+ const { empty: o, from: i, to: c } = t.selection, a = R.atStart(t.doc).from, l = R.atEnd(t.doc).to;
2022
+ if (o || !(i === a && c === l) || !mt(e.doc))
2023
+ return;
2024
+ const f = e.tr, p = J({
2025
+ state: e,
2026
+ transaction: f
2027
+ }), { commands: h } = new X({
2028
+ editor: this.editor,
2029
+ state: p
2030
+ });
2031
+ if (h.clearNodes(), !!f.steps.length)
2032
+ return f;
2033
+ }
2034
+ })
2035
+ ];
2036
+ }
2037
+ }), or = T.create({
2038
+ name: "paste",
2039
+ addProseMirrorPlugins() {
2040
+ return [
2041
+ new I({
2042
+ key: new j("tiptapPaste"),
2043
+ props: {
2044
+ handlePaste: (n, t, e) => {
2045
+ this.editor.emit("paste", {
2046
+ editor: this.editor,
2047
+ event: t,
2048
+ slice: e
2049
+ });
2050
+ }
2051
+ }
2052
+ })
2053
+ ];
2054
+ }
2055
+ }), ir = T.create({
2056
+ name: "tabindex",
2057
+ addProseMirrorPlugins() {
2058
+ return [
2059
+ new I({
2060
+ key: new j("tabindex"),
2061
+ props: {
2062
+ attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
2063
+ }
2064
+ })
2065
+ ];
2066
+ }
2067
+ });
2068
+ class B {
2069
+ get name() {
2070
+ return this.node.type.name;
2071
+ }
2072
+ constructor(t, e, r = !1, s = null) {
2073
+ this.currentNode = null, this.actualDepth = null, this.isBlock = r, this.resolvedPos = t, this.editor = e, this.currentNode = s;
2074
+ }
2075
+ get node() {
2076
+ return this.currentNode || this.resolvedPos.node();
2077
+ }
2078
+ get element() {
2079
+ return this.editor.view.domAtPos(this.pos).node;
2080
+ }
2081
+ get depth() {
2082
+ var t;
2083
+ return (t = this.actualDepth) !== null && t !== void 0 ? t : this.resolvedPos.depth;
2084
+ }
2085
+ get pos() {
2086
+ return this.resolvedPos.pos;
2087
+ }
2088
+ get content() {
2089
+ return this.node.content;
2090
+ }
2091
+ set content(t) {
2092
+ let e = this.from, r = this.to;
2093
+ if (this.isBlock) {
2094
+ if (this.content.size === 0) {
2095
+ console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
2096
+ return;
2097
+ }
2098
+ e = this.from + 1, r = this.to - 1;
2099
+ }
2100
+ this.editor.commands.insertContentAt({ from: e, to: r }, t);
2101
+ }
2102
+ get attributes() {
2103
+ return this.node.attrs;
2104
+ }
2105
+ get textContent() {
2106
+ return this.node.textContent;
2107
+ }
2108
+ get size() {
2109
+ return this.node.nodeSize;
2110
+ }
2111
+ get from() {
2112
+ return this.isBlock ? this.pos : this.resolvedPos.start(this.resolvedPos.depth);
2113
+ }
2114
+ get range() {
2115
+ return {
2116
+ from: this.from,
2117
+ to: this.to
2118
+ };
2119
+ }
2120
+ get to() {
2121
+ return this.isBlock ? this.pos + this.size : this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
2122
+ }
2123
+ get parent() {
2124
+ if (this.depth === 0)
2125
+ return null;
2126
+ const t = this.resolvedPos.start(this.resolvedPos.depth - 1), e = this.resolvedPos.doc.resolve(t);
2127
+ return new B(e, this.editor);
2128
+ }
2129
+ get before() {
2130
+ let t = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
2131
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.from - 3)), new B(t, this.editor);
2132
+ }
2133
+ get after() {
2134
+ let t = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
2135
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.to + 3)), new B(t, this.editor);
2136
+ }
2137
+ get children() {
2138
+ const t = [];
2139
+ return this.node.content.forEach((e, r) => {
2140
+ const s = e.isBlock && !e.isTextblock, o = e.isAtom && !e.isText, i = this.pos + r + (o ? 0 : 1), c = this.resolvedPos.doc.resolve(i);
2141
+ if (!s && c.depth <= this.depth)
2142
+ return;
2143
+ const a = new B(c, this.editor, s, s ? e : null);
2144
+ s && (a.actualDepth = this.depth + 1), t.push(new B(c, this.editor, s, s ? e : null));
2145
+ }), t;
2146
+ }
2147
+ get firstChild() {
2148
+ return this.children[0] || null;
2149
+ }
2150
+ get lastChild() {
2151
+ const t = this.children;
2152
+ return t[t.length - 1] || null;
2153
+ }
2154
+ closest(t, e = {}) {
2155
+ let r = null, s = this.parent;
2156
+ for (; s && !r; ) {
2157
+ if (s.node.type.name === t)
2158
+ if (Object.keys(e).length > 0) {
2159
+ const o = s.node.attrs, i = Object.keys(e);
2160
+ for (let c = 0; c < i.length; c += 1) {
2161
+ const a = i[c];
2162
+ if (o[a] !== e[a])
2163
+ break;
2164
+ }
2165
+ } else
2166
+ r = s;
2167
+ s = s.parent;
2168
+ }
2169
+ return r;
2170
+ }
2171
+ querySelector(t, e = {}) {
2172
+ return this.querySelectorAll(t, e, !0)[0] || null;
2173
+ }
2174
+ querySelectorAll(t, e = {}, r = !1) {
2175
+ let s = [];
2176
+ if (!this.children || this.children.length === 0)
2177
+ return s;
2178
+ const o = Object.keys(e);
2179
+ return this.children.forEach((i) => {
2180
+ r && s.length > 0 || (i.node.type.name === t && o.every((a) => e[a] === i.node.attrs[a]) && s.push(i), !(r && s.length > 0) && (s = s.concat(i.querySelectorAll(t, e, r))));
2181
+ }), s;
2182
+ }
2183
+ setAttribute(t) {
2184
+ const { tr: e } = this.editor.state;
2185
+ e.setNodeMarkup(this.from, void 0, {
2186
+ ...this.node.attrs,
2187
+ ...t
2188
+ }), this.editor.view.dispatch(e);
2189
+ }
2190
+ }
2191
+ const ar = `.ProseMirror {
2192
+ position: relative;
2193
+ }
2194
+
2195
+ .ProseMirror {
2196
+ word-wrap: break-word;
2197
+ white-space: pre-wrap;
2198
+ white-space: break-spaces;
2199
+ -webkit-font-variant-ligatures: none;
2200
+ font-variant-ligatures: none;
2201
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
2202
+ }
2203
+
2204
+ .ProseMirror [contenteditable="false"] {
2205
+ white-space: normal;
2206
+ }
2207
+
2208
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
2209
+ white-space: pre-wrap;
2210
+ }
2211
+
2212
+ .ProseMirror pre {
2213
+ white-space: pre-wrap;
2214
+ }
2215
+
2216
+ img.ProseMirror-separator {
2217
+ display: inline !important;
2218
+ border: none !important;
2219
+ margin: 0 !important;
2220
+ width: 0 !important;
2221
+ height: 0 !important;
2222
+ }
2223
+
2224
+ .ProseMirror-gapcursor {
2225
+ display: none;
2226
+ pointer-events: none;
2227
+ position: absolute;
2228
+ margin: 0;
2229
+ }
2230
+
2231
+ .ProseMirror-gapcursor:after {
2232
+ content: "";
2233
+ display: block;
2234
+ position: absolute;
2235
+ top: -2px;
2236
+ width: 20px;
2237
+ border-top: 1px solid black;
2238
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
2239
+ }
2240
+
2241
+ @keyframes ProseMirror-cursor-blink {
2242
+ to {
2243
+ visibility: hidden;
2244
+ }
2245
+ }
2246
+
2247
+ .ProseMirror-hideselection *::selection {
2248
+ background: transparent;
2249
+ }
2250
+
2251
+ .ProseMirror-hideselection *::-moz-selection {
2252
+ background: transparent;
2253
+ }
2254
+
2255
+ .ProseMirror-hideselection * {
2256
+ caret-color: transparent;
2257
+ }
2258
+
2259
+ .ProseMirror-focused .ProseMirror-gapcursor {
2260
+ display: block;
2261
+ }
2262
+
2263
+ .tippy-box[data-animation=fade][data-state=hidden] {
2264
+ opacity: 0
2265
+ }`;
2266
+ function cr(n, t, e) {
2267
+ const r = document.querySelector("style[data-tiptap-style]");
2268
+ if (r !== null)
2269
+ return r;
2270
+ const s = document.createElement("style");
2271
+ return t && s.setAttribute("nonce", t), s.setAttribute("data-tiptap-style", ""), s.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(s), s;
2272
+ }
2273
+ let wr = class extends be {
2274
+ constructor(t = {}) {
2275
+ super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
2276
+ element: document.createElement("div"),
2277
+ content: "",
2278
+ injectCSS: !0,
2279
+ injectNonce: void 0,
2280
+ extensions: [],
2281
+ autofocus: !1,
2282
+ editable: !0,
2283
+ editorProps: {},
2284
+ parseOptions: {},
2285
+ coreExtensionOptions: {},
2286
+ enableInputRules: !0,
2287
+ enablePasteRules: !0,
2288
+ enableCoreExtensions: !0,
2289
+ enableContentCheck: !1,
2290
+ onBeforeCreate: () => null,
2291
+ onCreate: () => null,
2292
+ onUpdate: () => null,
2293
+ onSelectionUpdate: () => null,
2294
+ onTransaction: () => null,
2295
+ onFocus: () => null,
2296
+ onBlur: () => null,
2297
+ onDestroy: () => null,
2298
+ onContentError: ({ error: e }) => {
2299
+ throw e;
2300
+ },
2301
+ onPaste: () => null,
2302
+ onDrop: () => null
2303
+ }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(t), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("contentError", this.options.onContentError), this.createView(), this.injectCSS(), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: e, slice: r, moved: s }) => this.options.onDrop(e, r, s)), this.on("paste", ({ event: e, slice: r }) => this.options.onPaste(e, r)), window.setTimeout(() => {
2304
+ this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
2305
+ }, 0);
2306
+ }
2307
+ /**
2308
+ * Returns the editor storage.
2309
+ */
2310
+ get storage() {
2311
+ return this.extensionStorage;
2312
+ }
2313
+ /**
2314
+ * An object of all registered commands.
2315
+ */
2316
+ get commands() {
2317
+ return this.commandManager.commands;
2318
+ }
2319
+ /**
2320
+ * Create a command chain to call multiple commands at once.
2321
+ */
2322
+ chain() {
2323
+ return this.commandManager.chain();
2324
+ }
2325
+ /**
2326
+ * Check if a command or a command chain can be executed. Without executing it.
2327
+ */
2328
+ can() {
2329
+ return this.commandManager.can();
2330
+ }
2331
+ /**
2332
+ * Inject CSS styles.
2333
+ */
2334
+ injectCSS() {
2335
+ this.options.injectCSS && document && (this.css = cr(ar, this.options.injectNonce));
2336
+ }
2337
+ /**
2338
+ * Update editor options.
2339
+ *
2340
+ * @param options A list of options
2341
+ */
2342
+ setOptions(t = {}) {
2343
+ this.options = {
2344
+ ...this.options,
2345
+ ...t
2346
+ }, !(!this.view || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
2347
+ }
2348
+ /**
2349
+ * Update editable state of the editor.
2350
+ */
2351
+ setEditable(t, e = !0) {
2352
+ this.setOptions({ editable: t }), e && this.emit("update", { editor: this, transaction: this.state.tr });
2353
+ }
2354
+ /**
2355
+ * Returns whether the editor is editable.
2356
+ */
2357
+ get isEditable() {
2358
+ return this.options.editable && this.view && this.view.editable;
2359
+ }
2360
+ /**
2361
+ * Returns the editor state.
2362
+ */
2363
+ get state() {
2364
+ return this.view.state;
2365
+ }
2366
+ /**
2367
+ * Register a ProseMirror plugin.
2368
+ *
2369
+ * @param plugin A ProseMirror plugin
2370
+ * @param handlePlugins Control how to merge the plugin into the existing plugins.
2371
+ * @returns The new editor state
2372
+ */
2373
+ registerPlugin(t, e) {
2374
+ const r = Ct(e) ? e(t, [...this.state.plugins]) : [...this.state.plugins, t], s = this.state.reconfigure({ plugins: r });
2375
+ return this.view.updateState(s), s;
2376
+ }
2377
+ /**
2378
+ * Unregister a ProseMirror plugin.
2379
+ *
2380
+ * @param nameOrPluginKeyToRemove The plugins name
2381
+ * @returns The new editor state or undefined if the editor is destroyed
2382
+ */
2383
+ unregisterPlugin(t) {
2384
+ if (this.isDestroyed)
2385
+ return;
2386
+ const e = this.state.plugins;
2387
+ let r = e;
2388
+ if ([].concat(t).forEach((o) => {
2389
+ const i = typeof o == "string" ? `${o}$` : o.key;
2390
+ r = r.filter((c) => !c.key.startsWith(i));
2391
+ }), e.length === r.length)
2392
+ return;
2393
+ const s = this.state.reconfigure({
2394
+ plugins: r
2395
+ });
2396
+ return this.view.updateState(s), s;
2397
+ }
2398
+ /**
2399
+ * Creates an extension manager.
2400
+ */
2401
+ createExtensionManager() {
2402
+ var t, e;
2403
+ const s = [...this.options.enableCoreExtensions ? [
2404
+ er,
2405
+ Be.configure({
2406
+ blockSeparator: (e = (t = this.options.coreExtensionOptions) === null || t === void 0 ? void 0 : t.clipboardTextSerializer) === null || e === void 0 ? void 0 : e.blockSeparator
2407
+ }),
2408
+ Zn,
2409
+ rr,
2410
+ sr,
2411
+ ir,
2412
+ tr,
2413
+ or
2414
+ ].filter((o) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[o.name] !== !1 : !0) : [], ...this.options.extensions].filter((o) => ["extension", "node", "mark"].includes(o == null ? void 0 : o.type));
2415
+ this.extensionManager = new D(s, this);
2416
+ }
2417
+ /**
2418
+ * Creates an command manager.
2419
+ */
2420
+ createCommandManager() {
2421
+ this.commandManager = new X({
2422
+ editor: this
2423
+ });
2424
+ }
2425
+ /**
2426
+ * Creates a ProseMirror schema.
2427
+ */
2428
+ createSchema() {
2429
+ this.schema = this.extensionManager.schema;
2430
+ }
2431
+ /**
2432
+ * Creates a ProseMirror view.
2433
+ */
2434
+ createView() {
2435
+ var t;
2436
+ let e;
2437
+ try {
2438
+ e = at(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
2439
+ } catch (i) {
2440
+ if (!(i instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(i.message))
2441
+ throw i;
2442
+ this.emit("contentError", {
2443
+ editor: this,
2444
+ error: i,
2445
+ disableCollaboration: () => {
2446
+ this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((c) => c.name !== "collaboration"), this.createExtensionManager();
2447
+ }
2448
+ }), e = at(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
2449
+ }
2450
+ const r = $t(e, this.options.autofocus);
2451
+ this.view = new _t(this.options.element, {
2452
+ ...this.options.editorProps,
2453
+ attributes: {
2454
+ // add `role="textbox"` to the editor element
2455
+ role: "textbox",
2456
+ ...(t = this.options.editorProps) === null || t === void 0 ? void 0 : t.attributes
2457
+ },
2458
+ dispatchTransaction: this.dispatchTransaction.bind(this),
2459
+ state: Lt.create({
2460
+ doc: e,
2461
+ selection: r || void 0
2462
+ })
2463
+ });
2464
+ const s = this.state.reconfigure({
2465
+ plugins: this.extensionManager.plugins
2466
+ });
2467
+ this.view.updateState(s), this.createNodeViews(), this.prependClass();
2468
+ const o = this.view.dom;
2469
+ o.editor = this;
2470
+ }
2471
+ /**
2472
+ * Creates all node views.
2473
+ */
2474
+ createNodeViews() {
2475
+ this.view.isDestroyed || this.view.setProps({
2476
+ nodeViews: this.extensionManager.nodeViews
2477
+ });
2478
+ }
2479
+ /**
2480
+ * Prepend class name to element.
2481
+ */
2482
+ prependClass() {
2483
+ this.view.dom.className = `tiptap ${this.view.dom.className}`;
2484
+ }
2485
+ captureTransaction(t) {
2486
+ this.isCapturingTransaction = !0, t(), this.isCapturingTransaction = !1;
2487
+ const e = this.capturedTransaction;
2488
+ return this.capturedTransaction = null, e;
2489
+ }
2490
+ /**
2491
+ * The callback over which to send transactions (state updates) produced by the view.
2492
+ *
2493
+ * @param transaction An editor state transaction
2494
+ */
2495
+ dispatchTransaction(t) {
2496
+ if (this.view.isDestroyed)
2497
+ return;
2498
+ if (this.isCapturingTransaction) {
2499
+ if (!this.capturedTransaction) {
2500
+ this.capturedTransaction = t;
2501
+ return;
2502
+ }
2503
+ t.steps.forEach((i) => {
2504
+ var c;
2505
+ return (c = this.capturedTransaction) === null || c === void 0 ? void 0 : c.step(i);
2506
+ });
2507
+ return;
2508
+ }
2509
+ const e = this.state.apply(t), r = !this.state.selection.eq(e.selection);
2510
+ this.emit("beforeTransaction", {
2511
+ editor: this,
2512
+ transaction: t,
2513
+ nextState: e
2514
+ }), this.view.updateState(e), this.emit("transaction", {
2515
+ editor: this,
2516
+ transaction: t
2517
+ }), r && this.emit("selectionUpdate", {
2518
+ editor: this,
2519
+ transaction: t
2520
+ });
2521
+ const s = t.getMeta("focus"), o = t.getMeta("blur");
2522
+ s && this.emit("focus", {
2523
+ editor: this,
2524
+ event: s.event,
2525
+ transaction: t
2526
+ }), o && this.emit("blur", {
2527
+ editor: this,
2528
+ event: o.event,
2529
+ transaction: t
2530
+ }), !(!t.docChanged || t.getMeta("preventUpdate")) && this.emit("update", {
2531
+ editor: this,
2532
+ transaction: t
2533
+ });
2534
+ }
2535
+ /**
2536
+ * Get attributes of the currently selected node or mark.
2537
+ */
2538
+ getAttributes(t) {
2539
+ return Pn(this.state, t);
2540
+ }
2541
+ isActive(t, e) {
2542
+ const r = typeof t == "string" ? t : null, s = typeof t == "string" ? e : t;
2543
+ return $n(this.state, r, s);
2544
+ }
2545
+ /**
2546
+ * Get the document as JSON.
2547
+ */
2548
+ getJSON() {
2549
+ return this.state.doc.toJSON();
2550
+ }
2551
+ /**
2552
+ * Get the document as HTML.
2553
+ */
2554
+ getHTML() {
2555
+ return ut(this.state.doc.content, this.schema);
2556
+ }
2557
+ /**
2558
+ * Get the document as text.
2559
+ */
2560
+ getText(t) {
2561
+ const { blockSeparator: e = `
2562
+
2563
+ `, textSerializers: r = {} } = t || {};
2564
+ return Cn(this.state.doc, {
2565
+ blockSeparator: e,
2566
+ textSerializers: {
2567
+ ...Pt(this.schema),
2568
+ ...r
2569
+ }
2570
+ });
2571
+ }
2572
+ /**
2573
+ * Check if there is no content.
2574
+ */
2575
+ get isEmpty() {
2576
+ return mt(this.state.doc);
2577
+ }
2578
+ /**
2579
+ * Get the number of characters for the current document.
2580
+ *
2581
+ * @deprecated
2582
+ */
2583
+ getCharacterCount() {
2584
+ return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'), this.state.doc.content.size - 2;
2585
+ }
2586
+ /**
2587
+ * Destroy the editor.
2588
+ */
2589
+ destroy() {
2590
+ if (this.emit("destroy"), this.view) {
2591
+ const t = this.view.dom;
2592
+ t && t.editor && delete t.editor, this.view.destroy();
2593
+ }
2594
+ this.removeAllListeners();
2595
+ }
2596
+ /**
2597
+ * Check if the editor is already destroyed.
2598
+ */
2599
+ get isDestroyed() {
2600
+ var t;
2601
+ return !(!((t = this.view) === null || t === void 0) && t.docView);
2602
+ }
2603
+ $node(t, e) {
2604
+ var r;
2605
+ return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelector(t, e)) || null;
2606
+ }
2607
+ $nodes(t, e) {
2608
+ var r;
2609
+ return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelectorAll(t, e)) || null;
2610
+ }
2611
+ $pos(t) {
2612
+ const e = this.state.doc.resolve(t);
2613
+ return new B(e, this);
2614
+ }
2615
+ get $doc() {
2616
+ return this.$pos(0);
2617
+ }
2618
+ };
2619
+ function Er(n) {
2620
+ return new Q({
2621
+ find: n.find,
2622
+ handler: ({ state: t, range: e, match: r }) => {
2623
+ const s = k(n.getAttributes, void 0, r);
2624
+ if (s === !1 || s === null)
2625
+ return null;
2626
+ const { tr: o } = t, i = r[r.length - 1], c = r[0];
2627
+ if (i) {
2628
+ const a = c.search(/\S/), l = e.from + c.indexOf(i), u = l + i.length;
2629
+ if (Rt(e.from, e.to, t.doc).filter((p) => p.mark.type.excluded.find((m) => m === n.type && m !== p.mark.type)).filter((p) => p.to > l).length)
2630
+ return null;
2631
+ u < e.to && o.delete(u, e.to), l > e.from && o.delete(e.from + a, l);
2632
+ const f = e.from + a + i.length;
2633
+ o.addMark(e.from + a, f, n.type.create(s || {})), o.removeStoredMark(n.type);
2634
+ }
2635
+ }
2636
+ });
2637
+ }
2638
+ function Sr(n) {
2639
+ return new Q({
2640
+ find: n.find,
2641
+ handler: ({ state: t, range: e, match: r }) => {
2642
+ const s = k(n.getAttributes, void 0, r) || {}, { tr: o } = t, i = e.from;
2643
+ let c = e.to;
2644
+ const a = n.type.create(s);
2645
+ if (r[1]) {
2646
+ const l = r[0].lastIndexOf(r[1]);
2647
+ let u = i + l;
2648
+ u > c ? u = c : c = u + r[1].length;
2649
+ const d = r[0][r[0].length - 1];
2650
+ o.insertText(d, i + r[0].length - 1), o.replaceWith(u, c, a);
2651
+ } else if (r[0]) {
2652
+ const l = n.type.isInline ? i : i - 1;
2653
+ o.insert(l, n.type.create(s)).delete(o.mapping.map(i), o.mapping.map(c));
2654
+ }
2655
+ o.scrollIntoView();
2656
+ }
2657
+ });
2658
+ }
2659
+ function xr(n) {
2660
+ return new Q({
2661
+ find: n.find,
2662
+ handler: ({ state: t, range: e, match: r }) => {
2663
+ const s = t.doc.resolve(e.from), o = k(n.getAttributes, void 0, r) || {};
2664
+ if (!s.node(-1).canReplaceWith(s.index(-1), s.indexAfter(-1), n.type))
2665
+ return null;
2666
+ t.tr.delete(e.from, e.to).setBlockType(e.from, e.from, n.type, o);
2667
+ }
2668
+ });
2669
+ }
2670
+ function Tr(n) {
2671
+ return new Q({
2672
+ find: n.find,
2673
+ handler: ({ state: t, range: e, match: r, chain: s }) => {
2674
+ const o = k(n.getAttributes, void 0, r) || {}, i = t.tr.delete(e.from, e.to), a = i.doc.resolve(e.from).blockRange(), l = a && Ut(a, n.type, o);
2675
+ if (!l)
2676
+ return null;
2677
+ if (i.wrap(a, l), n.keepMarks && n.editor) {
2678
+ const { selection: d, storedMarks: f } = t, { splittableMarks: p } = n.editor.extensionManager, h = f || d.$to.parentOffset && d.$from.marks();
2679
+ if (h) {
2680
+ const m = h.filter((g) => p.includes(g.type.name));
2681
+ i.ensureMarks(m);
2682
+ }
2683
+ }
2684
+ if (n.keepAttributes) {
2685
+ const d = n.type.name === "bulletList" || n.type.name === "orderedList" ? "listItem" : "taskList";
2686
+ s().updateAttributes(d, o).run();
2687
+ }
2688
+ const u = i.doc.resolve(e.from - 1).nodeBefore;
2689
+ u && u.type === n.type && dt(i.doc, e.from - 1) && (!n.joinPredicate || n.joinPredicate(r, u)) && i.join(e.from - 1);
2690
+ }
2691
+ });
2692
+ }
2693
+ class lt {
2694
+ constructor(t = {}) {
2695
+ this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
2696
+ name: this.name,
2697
+ defaultOptions: {}
2698
+ }, this.config = {
2699
+ ...this.config,
2700
+ ...t
2701
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = k(b(this, "addOptions", {
2702
+ name: this.name
2703
+ }))), this.storage = k(b(this, "addStorage", {
2704
+ name: this.name,
2705
+ options: this.options
2706
+ })) || {};
2707
+ }
2708
+ static create(t = {}) {
2709
+ return new lt(t);
2710
+ }
2711
+ configure(t = {}) {
2712
+ const e = this.extend({
2713
+ ...this.config,
2714
+ addOptions: () => Z(this.options, t)
2715
+ });
2716
+ return e.name = this.name, e.parent = this.parent, e;
2717
+ }
2718
+ extend(t = {}) {
2719
+ const e = new lt(t);
2720
+ return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = k(b(e, "addOptions", {
2721
+ name: e.name
2722
+ })), e.storage = k(b(e, "addStorage", {
2723
+ name: e.name,
2724
+ options: e.options
2725
+ })), e;
2726
+ }
2727
+ }
2728
+ class Cr {
2729
+ constructor(t, e, r) {
2730
+ this.isDragging = !1, this.component = t, this.editor = e.editor, this.options = {
2731
+ stopEvent: null,
2732
+ ignoreMutation: null,
2733
+ ...r
2734
+ }, this.extension = e.extension, this.node = e.node, this.decorations = e.decorations, this.innerDecorations = e.innerDecorations, this.view = e.view, this.HTMLAttributes = e.HTMLAttributes, this.getPos = e.getPos, this.mount();
2735
+ }
2736
+ mount() {
2737
+ }
2738
+ get dom() {
2739
+ return this.editor.view.dom;
2740
+ }
2741
+ get contentDOM() {
2742
+ return null;
2743
+ }
2744
+ onDragStart(t) {
2745
+ var e, r, s, o, i, c, a;
2746
+ const { view: l } = this.editor, u = t.target, d = u.nodeType === 3 ? (e = u.parentElement) === null || e === void 0 ? void 0 : e.closest("[data-drag-handle]") : u.closest("[data-drag-handle]");
2747
+ if (!this.dom || !((r = this.contentDOM) === null || r === void 0) && r.contains(u) || !d)
2748
+ return;
2749
+ let f = 0, p = 0;
2750
+ if (this.dom !== d) {
2751
+ const v = this.dom.getBoundingClientRect(), w = d.getBoundingClientRect(), E = (s = t.offsetX) !== null && s !== void 0 ? s : (o = t.nativeEvent) === null || o === void 0 ? void 0 : o.offsetX, M = (i = t.offsetY) !== null && i !== void 0 ? i : (c = t.nativeEvent) === null || c === void 0 ? void 0 : c.offsetY;
2752
+ f = w.x - v.x + E, p = w.y - v.y + M;
2753
+ }
2754
+ const h = this.dom.cloneNode(!0);
2755
+ (a = t.dataTransfer) === null || a === void 0 || a.setDragImage(h, f, p);
2756
+ const m = this.getPos();
2757
+ if (typeof m != "number")
2758
+ return;
2759
+ const g = F.create(l.state.doc, m), y = l.state.tr.setSelection(g);
2760
+ l.dispatch(y);
2761
+ }
2762
+ stopEvent(t) {
2763
+ var e;
2764
+ if (!this.dom)
2765
+ return !1;
2766
+ if (typeof this.options.stopEvent == "function")
2767
+ return this.options.stopEvent({ event: t });
2768
+ const r = t.target;
2769
+ if (!(this.dom.contains(r) && !(!((e = this.contentDOM) === null || e === void 0) && e.contains(r))))
2770
+ return !1;
2771
+ const o = t.type.startsWith("drag"), i = t.type === "drop";
2772
+ if ((["INPUT", "BUTTON", "SELECT", "TEXTAREA"].includes(r.tagName) || r.isContentEditable) && !i && !o)
2773
+ return !0;
2774
+ const { isEditable: a } = this.editor, { isDragging: l } = this, u = !!this.node.type.spec.draggable, d = F.isSelectable(this.node), f = t.type === "copy", p = t.type === "paste", h = t.type === "cut", m = t.type === "mousedown";
2775
+ if (!u && d && o && t.target === this.dom && t.preventDefault(), u && o && !l && t.target === this.dom)
2776
+ return t.preventDefault(), !1;
2777
+ if (u && a && !l && m) {
2778
+ const g = r.closest("[data-drag-handle]");
2779
+ g && (this.dom === g || this.dom.contains(g)) && (this.isDragging = !0, document.addEventListener("dragend", () => {
2780
+ this.isDragging = !1;
2781
+ }, { once: !0 }), document.addEventListener("drop", () => {
2782
+ this.isDragging = !1;
2783
+ }, { once: !0 }), document.addEventListener("mouseup", () => {
2784
+ this.isDragging = !1;
2785
+ }, { once: !0 }));
2786
+ }
2787
+ return !(l || i || f || p || h || m && d);
2788
+ }
2789
+ /**
2790
+ * Called when a DOM [mutation](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) or a selection change happens within the view.
2791
+ * @return `false` if the editor should re-read the selection or re-parse the range around the mutation
2792
+ * @return `true` if it can safely be ignored.
2793
+ */
2794
+ ignoreMutation(t) {
2795
+ return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: t }) : this.node.isLeaf || this.node.isAtom ? !0 : t.type === "selection" || this.dom.contains(t.target) && t.type === "childList" && (tt() || Nt()) && this.editor.isFocused && [
2796
+ ...Array.from(t.addedNodes),
2797
+ ...Array.from(t.removedNodes)
2798
+ ].every((r) => r.isContentEditable) ? !1 : this.contentDOM === t.target && t.type === "attributes" ? !0 : !this.contentDOM.contains(t.target);
2799
+ }
2800
+ /**
2801
+ * Update the attributes of the prosemirror node.
2802
+ */
2803
+ updateAttributes(t) {
2804
+ this.editor.commands.command(({ tr: e }) => {
2805
+ const r = this.getPos();
2806
+ return typeof r != "number" ? !1 : (e.setNodeMarkup(r, void 0, {
2807
+ ...this.node.attrs,
2808
+ ...t
2809
+ }), !0);
2810
+ });
2811
+ }
2812
+ /**
2813
+ * Delete the node.
2814
+ */
2815
+ deleteNode() {
2816
+ const t = this.getPos();
2817
+ if (typeof t != "number")
2818
+ return;
2819
+ const e = t + this.node.nodeSize;
2820
+ this.editor.commands.deleteRange({ from: t, to: e });
2821
+ }
2822
+ }
2823
+ function Ar(n) {
2824
+ return new Ae({
2825
+ find: n.find,
2826
+ handler: ({ state: t, range: e, match: r, pasteEvent: s }) => {
2827
+ const o = k(n.getAttributes, void 0, r, s);
2828
+ if (o === !1 || o === null)
2829
+ return null;
2830
+ const { tr: i } = t, c = r[r.length - 1], a = r[0];
2831
+ let l = e.to;
2832
+ if (c) {
2833
+ const u = a.search(/\S/), d = e.from + a.indexOf(c), f = d + c.length;
2834
+ if (Rt(e.from, e.to, t.doc).filter((h) => h.mark.type.excluded.find((g) => g === n.type && g !== h.mark.type)).filter((h) => h.to > d).length)
2835
+ return null;
2836
+ f < e.to && i.delete(f, e.to), d > e.from && i.delete(e.from + u, d), l = e.from + u + c.length, i.addMark(e.from + u, l, n.type.create(o || {})), i.removeStoredMark(n.type);
2837
+ }
2838
+ }
2839
+ });
2840
+ }
2841
+ function Pr(n) {
2842
+ return n.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
2843
+ }
2844
+ export {
2845
+ T as E,
2846
+ U as M,
2847
+ lt as N,
2848
+ Ar as a,
2849
+ Er as b,
2850
+ kr as c,
2851
+ Pt as d,
2852
+ gr as e,
2853
+ br as f,
2854
+ Cn as g,
2855
+ yr as h,
2856
+ It as i,
2857
+ Rt as j,
2858
+ Pn as k,
2859
+ mt as l,
2860
+ ke as m,
2861
+ Sr as n,
2862
+ Pr as o,
2863
+ vr as p,
2864
+ wr as q,
2865
+ Cr as r,
2866
+ xr as t,
2867
+ Tr as w
2868
+ };