@gsc-basic/components 1.1.7 → 1.1.9

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 (1055) hide show
  1. package/dist/es/Button/index.js +9 -4
  2. package/dist/es/Button/src/Button.css +3 -3
  3. package/dist/es/Button/src/Button.vue.js +44 -4
  4. package/dist/es/Button/src/Button2.css +3 -3
  5. package/dist/es/CodeEditor/index.js +9 -4
  6. package/dist/es/CodeEditor/src/index.css +3 -3
  7. package/dist/es/CodeEditor/src/index.vue.js +148 -4
  8. package/dist/es/CodeEditor/src/index2.css +3 -3
  9. package/dist/es/CodeEditor/src/index3.css +3 -3
  10. package/dist/es/ConfigProvider/index.js +9 -4
  11. package/dist/es/ConfigProvider/src/configProvider.js +17 -4
  12. package/dist/es/ConfigProvider/src/configProviderProps.js +25 -4
  13. package/dist/es/ConfigProvider/src/constants.js +12 -4
  14. package/dist/es/ConfigProvider/src/useGlobalConfig.js +48 -4
  15. package/dist/es/CountTo/index.js +9 -4
  16. package/dist/es/CountTo/src/index.css +4 -4
  17. package/dist/es/CountTo/src/index.vue.js +126 -4
  18. package/dist/es/Ellipsis/index.js +9 -4
  19. package/dist/es/Ellipsis/src/components/JsEllipsis.css +3 -3
  20. package/dist/es/Ellipsis/src/components/JsEllipsis.vue.js +181 -4
  21. package/dist/es/Ellipsis/src/components/NativeEllipsis.css +3 -3
  22. package/dist/es/Ellipsis/src/components/NativeEllipsis.vue.js +44 -4
  23. package/dist/es/Ellipsis/src/components/NativeEllipsis2.css +3 -3
  24. package/dist/es/Ellipsis/src/index.css +3 -3
  25. package/dist/es/Ellipsis/src/index.vue.js +96 -4
  26. package/dist/es/Ellipsis/src/utils/utils.js +59 -4
  27. package/dist/es/Form/index.js +9 -4
  28. package/dist/es/Form/src/Form.css +3 -3
  29. package/dist/es/Form/src/Form.vue.js +377 -4
  30. package/dist/es/Form/src/Form2.css +3 -3
  31. package/dist/es/Form/src/styles/form.css +3 -3
  32. package/dist/es/Marquee/index.js +9 -4
  33. package/dist/es/Marquee/src/index.css +3 -3
  34. package/dist/es/Marquee/src/index.vue.js +191 -4
  35. package/dist/es/Marquee/src/index2.css +3 -3
  36. package/dist/es/Overlay/index.js +64 -4
  37. package/dist/es/Overlay/src/Message.css +3 -3
  38. package/dist/es/Overlay/src/Message.vue.js +39 -4
  39. package/dist/es/Overlay/src/Message2.css +3 -3
  40. package/dist/es/Overlay/src/Modal.css +3 -3
  41. package/dist/es/Overlay/src/Modal.vue.js +70 -4
  42. package/dist/es/Overlay/src/Modal2.css +3 -3
  43. package/dist/es/Overlay/src/Notice.css +3 -3
  44. package/dist/es/Overlay/src/Notice.vue.js +40 -4
  45. package/dist/es/Overlay/src/Notice2.css +3 -3
  46. package/dist/es/Overlay/src/Tooltip.css +3 -3
  47. package/dist/es/Overlay/src/Tooltip.vue.js +87 -4
  48. package/dist/es/Overlay/src/Tooltip2.css +3 -3
  49. package/dist/es/RichTextEditor/index.js +9 -4
  50. package/dist/es/RichTextEditor/src/ToolbarPanel.css +3 -3
  51. package/dist/es/RichTextEditor/src/ToolbarPanel.vue.js +162 -4
  52. package/dist/es/RichTextEditor/src/ToolbarPanel2.css +3 -3
  53. package/dist/es/RichTextEditor/src/components/BlockquoteButton.css +4 -4
  54. package/dist/es/RichTextEditor/src/components/BlockquoteButton.vue.js +40 -4
  55. package/dist/es/RichTextEditor/src/components/CodeBlockButton.css +4 -4
  56. package/dist/es/RichTextEditor/src/components/CodeBlockButton.vue.js +40 -4
  57. package/dist/es/RichTextEditor/src/components/ColorHighlightPopover.css +3 -3
  58. package/dist/es/RichTextEditor/src/components/ColorHighlightPopover.vue.js +40 -4
  59. package/dist/es/RichTextEditor/src/components/FontSizeDropdownMenu.css +3 -3
  60. package/dist/es/RichTextEditor/src/components/FontSizeDropdownMenu.vue.js +58 -4
  61. package/dist/es/RichTextEditor/src/components/HeadingDropdownMenu.css +3 -3
  62. package/dist/es/RichTextEditor/src/components/HeadingDropdownMenu.vue.js +69 -4
  63. package/dist/es/RichTextEditor/src/components/ImageUploadButton.css +4 -4
  64. package/dist/es/RichTextEditor/src/components/ImageUploadButton.vue.js +74 -4
  65. package/dist/es/RichTextEditor/src/components/LinkPopover.css +4 -4
  66. package/dist/es/RichTextEditor/src/components/LinkPopover.vue.js +92 -4
  67. package/dist/es/RichTextEditor/src/components/LinkPopover2.css +4 -4
  68. package/dist/es/RichTextEditor/src/components/ListDropdownMenu.css +3 -3
  69. package/dist/es/RichTextEditor/src/components/ListDropdownMenu.vue.js +76 -4
  70. package/dist/es/RichTextEditor/src/components/MarkButton.css +4 -4
  71. package/dist/es/RichTextEditor/src/components/MarkButton.vue.js +89 -4
  72. package/dist/es/RichTextEditor/src/components/TableButton.css +3 -3
  73. package/dist/es/RichTextEditor/src/components/TableButton.vue.js +165 -4
  74. package/dist/es/RichTextEditor/src/components/TextAlignDropdownMenu.css +3 -3
  75. package/dist/es/RichTextEditor/src/components/TextAlignDropdownMenu.vue.js +85 -4
  76. package/dist/es/RichTextEditor/src/components/TextColorPopover.css +3 -3
  77. package/dist/es/RichTextEditor/src/components/TextColorPopover.vue.js +40 -4
  78. package/dist/es/RichTextEditor/src/components/ToolbarGroup.css +3 -3
  79. package/dist/es/RichTextEditor/src/components/ToolbarGroup.vue.js +19 -4
  80. package/dist/es/RichTextEditor/src/components/ToolbarSeparator.css +3 -3
  81. package/dist/es/RichTextEditor/src/components/ToolbarSeparator.vue.js +17 -4
  82. package/dist/es/RichTextEditor/src/components/UndoRedoButton.css +4 -4
  83. package/dist/es/RichTextEditor/src/components/UndoRedoButton.vue.js +54 -4
  84. package/dist/es/RichTextEditor/src/components/VideoUploadButton.css +4 -4
  85. package/dist/es/RichTextEditor/src/components/VideoUploadButton.vue.js +74 -4
  86. package/dist/es/RichTextEditor/src/components/basic/ColorPicker.css +4 -4
  87. package/dist/es/RichTextEditor/src/components/basic/ColorPicker.vue.js +101 -4
  88. package/dist/es/RichTextEditor/src/components/basic/MediaUploadModal.css +3 -3
  89. package/dist/es/RichTextEditor/src/components/basic/MediaUploadModal.vue.js +364 -4
  90. package/dist/es/RichTextEditor/src/components/basic/MediaUploadModal2.css +3 -3
  91. package/dist/es/RichTextEditor/src/components/basic/SelectMenu.css +4 -4
  92. package/dist/es/RichTextEditor/src/components/basic/SelectMenu.vue.js +137 -4
  93. package/dist/es/RichTextEditor/src/components/basic/SelectMenu2.css +4 -4
  94. package/dist/es/RichTextEditor/src/constant/index.js +53 -4
  95. package/dist/es/RichTextEditor/src/extensions/styledTable.js +112 -0
  96. package/dist/es/RichTextEditor/src/extensions/video.js +68 -4
  97. package/dist/es/RichTextEditor/src/index.css +4 -4
  98. package/dist/es/RichTextEditor/src/index.vue.js +165 -4
  99. package/dist/es/RichTextEditor/src/index2.css +4 -4
  100. package/dist/es/RichTextEditor/src/props.js +28 -4
  101. package/dist/es/ScaleScreen/index.js +9 -4
  102. package/dist/es/ScaleScreen/src/index.css +3 -3
  103. package/dist/es/ScaleScreen/src/index.vue.js +118 -4
  104. package/dist/es/ScaleScreen/src/index2.css +3 -3
  105. package/dist/es/Transition/index.js +30 -4
  106. package/dist/es/Transition/src/CollapseTransition.css +3 -3
  107. package/dist/es/Transition/src/CollapseTransition.vue.js +44 -4
  108. package/dist/es/Transition/src/CollapseTransition2.css +3 -3
  109. package/dist/es/Transition/src/CreateTransition.js +75 -6
  110. package/dist/es/Transition/src/ExpandTransition.js +42 -4
  111. package/dist/es/Transition/src/style/index.css +3 -3
  112. package/dist/es/Transition/style.js +4 -4
  113. package/dist/es/VideoBackground/index.js +9 -4
  114. package/dist/es/VideoBackground/src/helper.js +32 -4
  115. package/dist/es/VideoBackground/src/index.css +3 -3
  116. package/dist/es/VideoBackground/src/index.vue.js +111 -4
  117. package/dist/es/VideoBackground/src/index2.css +3 -3
  118. package/dist/es/VideoBackground/src/index3.css +3 -3
  119. package/dist/es/VideoBackground/src/videoBackground.js +34 -4
  120. package/dist/es/VideoPlayer/index.js +9 -4
  121. package/dist/es/VideoPlayer/src/index.css +3 -3
  122. package/dist/es/VideoPlayer/src/index.vue.js +63 -4
  123. package/dist/es/VirtualScroll/index.js +9 -4
  124. package/dist/es/VirtualScroll/src/index.css +3 -3
  125. package/dist/es/VirtualScroll/src/index.vue.js +11 -4
  126. package/dist/es/VirtualScroll/src/index.vue2.js +107 -4
  127. package/dist/es/VirtualScroll/src/index2.css +3 -3
  128. package/dist/es/_virtual/_commonjsHelpers.js +9 -4
  129. package/dist/es/_virtual/_plugin-vue_export-helper.js +12 -4
  130. package/dist/es/_virtual/delegate.js +10 -4
  131. package/dist/es/_virtual/download.js +10 -4
  132. package/dist/es/_virtual/download2.js +7 -4
  133. package/dist/es/_virtual/index.js +5 -4
  134. package/dist/es/_virtual/index2.js +7 -4
  135. package/dist/es/_virtual/index3.js +21 -0
  136. package/dist/es/{node_modules/@tanstack/store/dist/esm/types.js → _virtual/index4.js} +7 -4
  137. package/dist/es/hooks/useLocale.js +28 -4
  138. package/dist/es/hooks/useNamespace.js +11 -4
  139. package/dist/es/index.js +79 -4
  140. package/dist/es/locale/lang/en-US.js +167 -4
  141. package/dist/es/locale/lang/ja-JP.js +167 -4
  142. package/dist/es/locale/lang/zh-CN.js +167 -4
  143. package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +1379 -4
  144. package/dist/es/node_modules/@codemirror/commands/dist/index.js +847 -4
  145. package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +41 -6
  146. package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +315 -20
  147. package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +51 -6
  148. package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +402 -15
  149. package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +500 -7
  150. package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +219 -7
  151. package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +54 -6
  152. package/dist/es/node_modules/@codemirror/language/dist/index.js +1304 -4
  153. package/dist/es/node_modules/@codemirror/lint/dist/index.js +660 -6
  154. package/dist/es/node_modules/@codemirror/search/dist/index.js +842 -5
  155. package/dist/es/node_modules/@codemirror/state/dist/index.js +2646 -4
  156. package/dist/es/node_modules/@codemirror/theme-one-dark/dist/index.js +135 -4
  157. package/dist/es/node_modules/@codemirror/view/dist/index.js +7492 -4
  158. package/dist/es/node_modules/@lezer/common/dist/index.js +1433 -5
  159. package/dist/es/node_modules/@lezer/highlight/dist/index.js +640 -4
  160. package/dist/es/node_modules/@lezer/java/dist/index.js +65 -4
  161. package/dist/es/node_modules/@lezer/javascript/dist/index.js +164 -4
  162. package/dist/es/node_modules/@lezer/json/dist/index.js +37 -4
  163. package/dist/es/node_modules/@lezer/lr/dist/index.js +1312 -4
  164. package/dist/es/node_modules/@lezer/python/dist/index.js +224 -4
  165. package/dist/es/node_modules/@lezer/xml/dist/index.js +103 -4
  166. package/dist/es/node_modules/@lezer/yaml/dist/index.js +277 -4
  167. package/dist/es/node_modules/@marijn/find-cluster-break/src/index.js +72 -4
  168. package/dist/es/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +181 -4
  169. package/dist/es/node_modules/@tanstack/form-core/dist/esm/EventClient.js +16 -4
  170. package/dist/es/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +409 -4
  171. package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +792 -4
  172. package/dist/es/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +58 -4
  173. package/dist/es/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +112 -5
  174. package/dist/es/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +48 -4
  175. package/dist/es/node_modules/@tanstack/form-core/dist/esm/utils.js +216 -4
  176. package/dist/es/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +32 -4
  177. package/dist/es/node_modules/@tanstack/store/dist/esm/alien.js +221 -0
  178. package/dist/es/node_modules/@tanstack/store/dist/esm/atom.js +136 -0
  179. package/dist/es/node_modules/@tanstack/store/dist/esm/batch.js +25 -0
  180. package/dist/es/node_modules/@tanstack/store/dist/esm/store.js +47 -4
  181. package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useField.js +41 -4
  182. package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useForm.js +36 -4
  183. package/dist/es/node_modules/@tanstack/vue-store/dist/esm/index.js +51 -4
  184. package/dist/es/node_modules/@tiptap/core/dist/index.js +3984 -4
  185. package/dist/es/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +20 -4
  186. package/dist/es/node_modules/@tiptap/extension-blockquote/dist/index.js +60 -5
  187. package/dist/es/node_modules/@tiptap/extension-bold/dist/index.js +82 -5
  188. package/dist/es/node_modules/@tiptap/extension-character-count/dist/index.js +9 -4
  189. package/dist/es/node_modules/@tiptap/extension-code/dist/index.js +57 -4
  190. package/dist/es/node_modules/@tiptap/extension-code-block/dist/index.js +220 -4
  191. package/dist/es/node_modules/@tiptap/extension-document/dist/index.js +15 -4
  192. package/dist/es/node_modules/@tiptap/extension-hard-break/dist/index.js +62 -4
  193. package/dist/es/node_modules/@tiptap/extension-heading/dist/index.js +66 -4
  194. package/dist/es/node_modules/@tiptap/extension-highlight/dist/index.js +88 -4
  195. package/dist/es/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +59 -4
  196. package/dist/es/node_modules/@tiptap/extension-image/dist/index.js +133 -4
  197. package/dist/es/node_modules/@tiptap/extension-italic/dist/index.js +80 -4
  198. package/dist/es/node_modules/@tiptap/extension-link/dist/index.js +316 -4
  199. package/dist/es/node_modules/@tiptap/extension-list/dist/index.js +731 -4
  200. package/dist/es/node_modules/@tiptap/extension-paragraph/dist/index.js +47 -4
  201. package/dist/es/node_modules/@tiptap/extension-strike/dist/index.js +69 -4
  202. package/dist/es/node_modules/@tiptap/extension-subscript/dist/index.js +44 -4
  203. package/dist/es/node_modules/@tiptap/extension-superscript/dist/index.js +44 -4
  204. package/dist/es/node_modules/@tiptap/extension-table/dist/index.js +383 -4
  205. package/dist/es/node_modules/@tiptap/extension-task-item/dist/index.js +9 -4
  206. package/dist/es/node_modules/@tiptap/extension-task-list/dist/index.js +9 -4
  207. package/dist/es/node_modules/@tiptap/extension-text/dist/index.js +16 -4
  208. package/dist/es/node_modules/@tiptap/extension-text-align/dist/index.js +50 -4
  209. package/dist/es/node_modules/@tiptap/extension-text-style/dist/index.js +243 -4
  210. package/dist/es/node_modules/@tiptap/extension-underline/dist/index.js +68 -4
  211. package/dist/es/node_modules/@tiptap/extensions/dist/index.js +299 -4
  212. package/dist/es/node_modules/@tiptap/html/dist/index.js +28 -0
  213. package/dist/es/node_modules/@tiptap/starter-kit/dist/index.js +32 -4
  214. package/dist/es/node_modules/@tiptap/vue-3/dist/index.js +260 -4
  215. package/dist/es/node_modules/@vueuse/core/dist/index.js +354 -4
  216. package/dist/es/node_modules/@vueuse/shared/dist/index.js +139 -4
  217. package/dist/es/node_modules/codemirror/dist/index.js +43 -4
  218. package/dist/es/node_modules/crelt/index.js +30 -4
  219. package/dist/es/node_modules/delegate/src/closest.js +24 -4
  220. package/dist/es/node_modules/delegate/src/delegate.js +32 -4
  221. package/dist/es/node_modules/downloadjs/download.js +80 -4
  222. package/dist/es/node_modules/eventemitter3/index.js +114 -4
  223. package/dist/es/node_modules/linkifyjs/dist/linkify.js +710 -4
  224. package/dist/es/node_modules/lodash-es/_DataView.js +9 -4
  225. package/dist/es/node_modules/lodash-es/_Hash.js +23 -4
  226. package/dist/es/node_modules/lodash-es/_ListCache.js +23 -4
  227. package/dist/es/node_modules/lodash-es/_Map.js +9 -4
  228. package/dist/es/node_modules/lodash-es/_MapCache.js +23 -4
  229. package/dist/es/node_modules/lodash-es/_Promise.js +9 -4
  230. package/dist/es/node_modules/lodash-es/_Set.js +9 -4
  231. package/dist/es/node_modules/lodash-es/_SetCache.js +26 -0
  232. package/dist/es/node_modules/lodash-es/_Stack.js +21 -4
  233. package/dist/es/node_modules/lodash-es/_Symbol.js +8 -4
  234. package/dist/es/node_modules/lodash-es/_Uint8Array.js +8 -4
  235. package/dist/es/node_modules/lodash-es/_WeakMap.js +9 -4
  236. package/dist/es/node_modules/lodash-es/_apply.js +19 -4
  237. package/dist/es/node_modules/lodash-es/_arrayEach.js +11 -4
  238. package/dist/es/node_modules/lodash-es/_arrayFilter.js +13 -4
  239. package/dist/es/node_modules/lodash-es/_arrayIncludes.js +21 -0
  240. package/dist/es/node_modules/lodash-es/_arrayIncludesWith.js +22 -0
  241. package/dist/es/node_modules/lodash-es/_arrayLikeKeys.js +23 -4
  242. package/dist/es/node_modules/lodash-es/_arrayMap.js +11 -4
  243. package/dist/es/node_modules/lodash-es/_arrayPush.js +11 -4
  244. package/dist/es/node_modules/lodash-es/_arraySome.js +22 -0
  245. package/dist/es/node_modules/lodash-es/_asciiToArray.js +9 -4
  246. package/dist/es/node_modules/lodash-es/_assignMergeValue.js +21 -0
  247. package/dist/es/node_modules/lodash-es/_assignValue.js +13 -4
  248. package/dist/es/node_modules/lodash-es/_assocIndexOf.js +13 -4
  249. package/dist/es/node_modules/lodash-es/_baseAssignValue.js +15 -4
  250. package/dist/es/node_modules/lodash-es/_baseClone.js +57 -4
  251. package/dist/es/node_modules/lodash-es/_baseCreate.js +30 -0
  252. package/dist/es/node_modules/lodash-es/_baseFindIndex.js +22 -0
  253. package/dist/es/node_modules/lodash-es/_baseFlatten.js +16 -4
  254. package/dist/es/node_modules/lodash-es/_baseFor.js +18 -0
  255. package/dist/es/node_modules/lodash-es/_baseGet.js +14 -4
  256. package/dist/es/node_modules/lodash-es/_baseGetAllKeys.js +12 -4
  257. package/dist/es/node_modules/lodash-es/_baseGetTag.js +13 -4
  258. package/dist/es/node_modules/lodash-es/_baseIndexOf.js +22 -0
  259. package/dist/es/node_modules/lodash-es/_baseIntersection.js +42 -0
  260. package/dist/es/node_modules/lodash-es/_baseIsArguments.js +12 -4
  261. package/dist/es/node_modules/lodash-es/_baseIsEqual.js +21 -0
  262. package/dist/es/node_modules/lodash-es/_baseIsEqualDeep.js +45 -0
  263. package/dist/es/node_modules/lodash-es/_baseIsMap.js +12 -4
  264. package/dist/es/node_modules/lodash-es/_baseIsNaN.js +19 -0
  265. package/dist/es/node_modules/lodash-es/_baseIsNative.js +19 -4
  266. package/dist/es/node_modules/lodash-es/_baseIsRegExp.js +12 -4
  267. package/dist/es/node_modules/lodash-es/_baseIsSet.js +12 -4
  268. package/dist/es/node_modules/lodash-es/_baseIsTypedArray.js +15 -4
  269. package/dist/es/node_modules/lodash-es/_baseKeys.js +27 -0
  270. package/dist/es/node_modules/lodash-es/_baseKeysIn.js +18 -4
  271. package/dist/es/node_modules/lodash-es/_baseMerge.js +33 -0
  272. package/dist/es/node_modules/lodash-es/_baseMergeDeep.js +44 -0
  273. package/dist/es/node_modules/lodash-es/_baseRest.js +22 -0
  274. package/dist/es/node_modules/lodash-es/_baseSetToString.js +17 -4
  275. package/dist/es/node_modules/lodash-es/_baseSlice.js +13 -4
  276. package/dist/es/node_modules/lodash-es/_baseTimes.js +11 -4
  277. package/dist/es/node_modules/lodash-es/_baseToString.js +21 -4
  278. package/dist/es/node_modules/lodash-es/_baseUnary.js +11 -4
  279. package/dist/es/node_modules/lodash-es/_baseUniq.js +46 -0
  280. package/dist/es/node_modules/lodash-es/_baseUnset.js +31 -4
  281. package/dist/es/node_modules/lodash-es/_cacheHas.js +19 -0
  282. package/dist/es/node_modules/lodash-es/_castArrayLikeObject.js +20 -0
  283. package/dist/es/node_modules/lodash-es/_castPath.js +13 -4
  284. package/dist/es/node_modules/lodash-es/_castSlice.js +11 -4
  285. package/dist/es/node_modules/lodash-es/_cloneArrayBuffer.js +11 -4
  286. package/dist/es/node_modules/lodash-es/_cloneBuffer.js +14 -4
  287. package/dist/es/node_modules/lodash-es/_cloneDataView.js +11 -4
  288. package/dist/es/node_modules/lodash-es/_cloneRegExp.js +11 -4
  289. package/dist/es/node_modules/lodash-es/_cloneSymbol.js +11 -4
  290. package/dist/es/node_modules/lodash-es/_cloneTypedArray.js +11 -4
  291. package/dist/es/node_modules/lodash-es/_copyArray.js +22 -0
  292. package/dist/es/node_modules/lodash-es/_copyObject.js +17 -4
  293. package/dist/es/node_modules/lodash-es/_coreJsData.js +8 -4
  294. package/dist/es/node_modules/lodash-es/_createAssigner.js +28 -0
  295. package/dist/es/node_modules/lodash-es/_createBaseFor.js +26 -0
  296. package/dist/es/node_modules/lodash-es/_createCaseFirst.js +17 -4
  297. package/dist/es/node_modules/lodash-es/_createSet.js +22 -0
  298. package/dist/es/node_modules/lodash-es/_customOmitClone.js +10 -4
  299. package/dist/es/node_modules/lodash-es/_defineProperty.js +14 -4
  300. package/dist/es/node_modules/lodash-es/_equalArrays.js +53 -0
  301. package/dist/es/node_modules/lodash-es/_equalByTag.js +58 -0
  302. package/dist/es/node_modules/lodash-es/_equalObjects.js +49 -0
  303. package/dist/es/node_modules/lodash-es/_flatRest.js +12 -4
  304. package/dist/es/node_modules/lodash-es/_freeGlobal.js +7 -4
  305. package/dist/es/node_modules/lodash-es/_getAllKeys.js +22 -0
  306. package/dist/es/node_modules/lodash-es/_getAllKeysIn.js +12 -4
  307. package/dist/es/node_modules/lodash-es/_getMapData.js +11 -4
  308. package/dist/es/node_modules/lodash-es/_getNative.js +12 -4
  309. package/dist/es/node_modules/lodash-es/_getPrototype.js +8 -4
  310. package/dist/es/node_modules/lodash-es/_getRawTag.js +18 -4
  311. package/dist/es/node_modules/lodash-es/_getSymbols.js +13 -4
  312. package/dist/es/node_modules/lodash-es/_getSymbolsIn.js +15 -4
  313. package/dist/es/node_modules/lodash-es/_getTag.js +31 -4
  314. package/dist/es/node_modules/lodash-es/_getValue.js +9 -4
  315. package/dist/es/node_modules/lodash-es/_hasUnicode.js +10 -4
  316. package/dist/es/node_modules/lodash-es/_hashClear.js +10 -4
  317. package/dist/es/node_modules/lodash-es/_hashDelete.js +10 -4
  318. package/dist/es/node_modules/lodash-es/_hashGet.js +16 -4
  319. package/dist/es/node_modules/lodash-es/_hashHas.js +12 -4
  320. package/dist/es/node_modules/lodash-es/_hashSet.js +12 -4
  321. package/dist/es/node_modules/lodash-es/_initCloneArray.js +11 -4
  322. package/dist/es/node_modules/lodash-es/_initCloneByTag.js +45 -4
  323. package/dist/es/node_modules/lodash-es/_initCloneObject.js +22 -0
  324. package/dist/es/node_modules/lodash-es/_isFlattenable.js +13 -4
  325. package/dist/es/node_modules/lodash-es/_isIndex.js +11 -4
  326. package/dist/es/node_modules/lodash-es/_isIterateeCall.js +26 -0
  327. package/dist/es/node_modules/lodash-es/_isKey.js +15 -4
  328. package/dist/es/node_modules/lodash-es/_isKeyable.js +10 -4
  329. package/dist/es/node_modules/lodash-es/_isMasked.js +14 -4
  330. package/dist/es/node_modules/lodash-es/_isPrototype.js +11 -4
  331. package/dist/es/node_modules/lodash-es/_listCacheClear.js +9 -4
  332. package/dist/es/node_modules/lodash-es/_listCacheDelete.js +15 -4
  333. package/dist/es/node_modules/lodash-es/_listCacheGet.js +11 -4
  334. package/dist/es/node_modules/lodash-es/_listCacheHas.js +10 -4
  335. package/dist/es/node_modules/lodash-es/_listCacheSet.js +11 -4
  336. package/dist/es/node_modules/lodash-es/_mapCacheClear.js +16 -4
  337. package/dist/es/node_modules/lodash-es/_mapCacheDelete.js +11 -4
  338. package/dist/es/node_modules/lodash-es/_mapCacheGet.js +10 -4
  339. package/dist/es/node_modules/lodash-es/_mapCacheHas.js +10 -4
  340. package/dist/es/node_modules/lodash-es/_mapCacheSet.js +11 -4
  341. package/dist/es/node_modules/lodash-es/_mapToArray.js +22 -0
  342. package/dist/es/node_modules/lodash-es/_memoizeCapped.js +14 -4
  343. package/dist/es/node_modules/lodash-es/_nativeCreate.js +8 -4
  344. package/dist/es/node_modules/lodash-es/_nativeKeys.js +18 -0
  345. package/dist/es/node_modules/lodash-es/_nativeKeysIn.js +13 -4
  346. package/dist/es/node_modules/lodash-es/_nodeUtil.js +14 -4
  347. package/dist/es/node_modules/lodash-es/_objectToString.js +10 -4
  348. package/dist/es/node_modules/lodash-es/_overArg.js +11 -4
  349. package/dist/es/node_modules/lodash-es/_overRest.js +18 -4
  350. package/dist/es/node_modules/lodash-es/_parent.js +11 -4
  351. package/dist/es/node_modules/lodash-es/_root.js +8 -4
  352. package/dist/es/node_modules/lodash-es/_safeGet.js +20 -0
  353. package/dist/es/node_modules/lodash-es/_setCacheAdd.js +20 -0
  354. package/dist/es/node_modules/lodash-es/_setCacheHas.js +19 -0
  355. package/dist/es/node_modules/lodash-es/_setToArray.js +22 -0
  356. package/dist/es/node_modules/lodash-es/_setToString.js +9 -4
  357. package/dist/es/node_modules/lodash-es/_shortOut.js +19 -4
  358. package/dist/es/node_modules/lodash-es/_stackClear.js +10 -4
  359. package/dist/es/node_modules/lodash-es/_stackDelete.js +10 -4
  360. package/dist/es/node_modules/lodash-es/_stackGet.js +9 -4
  361. package/dist/es/node_modules/lodash-es/_stackHas.js +9 -4
  362. package/dist/es/node_modules/lodash-es/_stackSet.js +20 -4
  363. package/dist/es/node_modules/lodash-es/_strictIndexOf.js +22 -0
  364. package/dist/es/node_modules/lodash-es/_stringToArray.js +12 -4
  365. package/dist/es/node_modules/lodash-es/_stringToPath.js +13 -4
  366. package/dist/es/node_modules/lodash-es/_toKey.js +13 -4
  367. package/dist/es/node_modules/lodash-es/_toSource.js +20 -4
  368. package/dist/es/node_modules/lodash-es/_unicodeToArray.js +10 -4
  369. package/dist/es/node_modules/lodash-es/constant.js +11 -4
  370. package/dist/es/node_modules/lodash-es/eq.js +9 -4
  371. package/dist/es/node_modules/lodash-es/flatten.js +11 -4
  372. package/dist/es/node_modules/lodash-es/get.js +11 -4
  373. package/dist/es/node_modules/lodash-es/identity.js +9 -4
  374. package/dist/es/node_modules/lodash-es/intersectionWith.js +25 -0
  375. package/dist/es/node_modules/lodash-es/isArguments.js +13 -4
  376. package/dist/es/node_modules/lodash-es/isArray.js +7 -4
  377. package/dist/es/node_modules/lodash-es/isArrayLike.js +11 -4
  378. package/dist/es/node_modules/lodash-es/isArrayLikeObject.js +21 -0
  379. package/dist/es/node_modules/lodash-es/isBuffer.js +9 -4
  380. package/dist/es/node_modules/lodash-es/isEqual.js +20 -0
  381. package/dist/es/node_modules/lodash-es/isFinite.js +11 -4
  382. package/dist/es/node_modules/lodash-es/isFunction.js +15 -4
  383. package/dist/es/node_modules/lodash-es/isLength.js +10 -4
  384. package/dist/es/node_modules/lodash-es/isMap.js +10 -4
  385. package/dist/es/node_modules/lodash-es/isNaN.js +10 -4
  386. package/dist/es/node_modules/lodash-es/isNil.js +9 -4
  387. package/dist/es/node_modules/lodash-es/isNumber.js +12 -4
  388. package/dist/es/node_modules/lodash-es/isObject.js +10 -4
  389. package/dist/es/node_modules/lodash-es/isObjectLike.js +9 -4
  390. package/dist/es/node_modules/lodash-es/isPlainObject.js +19 -4
  391. package/dist/es/node_modules/lodash-es/isRegExp.js +10 -4
  392. package/dist/es/node_modules/lodash-es/isSet.js +10 -4
  393. package/dist/es/node_modules/lodash-es/isString.js +13 -4
  394. package/dist/es/node_modules/lodash-es/isSymbol.js +12 -4
  395. package/dist/es/node_modules/lodash-es/isTypedArray.js +10 -4
  396. package/dist/es/node_modules/lodash-es/keys.js +22 -0
  397. package/dist/es/node_modules/lodash-es/keysIn.js +12 -4
  398. package/dist/es/node_modules/lodash-es/last.js +10 -4
  399. package/dist/es/node_modules/lodash-es/memoize.js +21 -4
  400. package/dist/es/node_modules/lodash-es/mergeWith.js +21 -0
  401. package/dist/es/node_modules/lodash-es/noop.js +18 -0
  402. package/dist/es/node_modules/lodash-es/omit.js +26 -4
  403. package/dist/es/node_modules/lodash-es/stubArray.js +9 -4
  404. package/dist/es/node_modules/lodash-es/stubFalse.js +9 -4
  405. package/dist/es/node_modules/lodash-es/toPlainObject.js +21 -0
  406. package/dist/es/node_modules/lodash-es/toString.js +10 -4
  407. package/dist/es/node_modules/lodash-es/unionWith.js +25 -0
  408. package/dist/es/node_modules/lodash-es/upperFirst.js +8 -4
  409. package/dist/es/node_modules/orderedmap/dist/index.js +106 -4
  410. package/dist/es/node_modules/path-to-regexp/dist/index.js +275 -0
  411. package/dist/es/node_modules/prosemirror-commands/dist/index.js +391 -4
  412. package/dist/es/node_modules/prosemirror-dropcursor/dist/index.js +89 -4
  413. package/dist/es/node_modules/prosemirror-gapcursor/dist/index.js +207 -4
  414. package/dist/es/node_modules/prosemirror-history/dist/index.js +251 -4
  415. package/dist/es/node_modules/prosemirror-keymap/dist/index.js +65 -4
  416. package/dist/es/node_modules/prosemirror-model/dist/index.js +2736 -4
  417. package/dist/es/node_modules/prosemirror-schema-list/dist/index.js +91 -4
  418. package/dist/es/node_modules/prosemirror-state/dist/index.js +825 -4
  419. package/dist/es/node_modules/prosemirror-tables/dist/index.js +1449 -4
  420. package/dist/es/node_modules/prosemirror-transform/dist/index.js +1539 -4
  421. package/dist/es/node_modules/prosemirror-view/dist/index.js +3797 -4
  422. package/dist/es/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +300 -0
  423. package/dist/es/node_modules/rope-sequence/dist/index.js +103 -4
  424. package/dist/es/node_modules/sortablejs/modular/sortable.esm.js +1283 -0
  425. package/dist/es/node_modules/style-mod/src/style-mod.js +112 -4
  426. package/dist/es/node_modules/title-case/dist/index.js +20 -0
  427. package/dist/es/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +135 -4
  428. package/dist/es/node_modules/w3c-keyname/index.js +96 -4
  429. package/dist/es/node_modules/xgplayer/dist/index.min.css +3 -3
  430. package/dist/es/node_modules/xgplayer/es/_virtual/_rollupPluginBabelHelpers.js +200 -4
  431. package/dist/es/node_modules/xgplayer/es/constant.js +10 -4
  432. package/dist/es/node_modules/xgplayer/es/defaultConfig.js +90 -4
  433. package/dist/es/node_modules/xgplayer/es/error.js +67 -4
  434. package/dist/es/node_modules/xgplayer/es/events.js +70 -4
  435. package/dist/es/node_modules/xgplayer/es/index.umd.js +48 -4
  436. package/dist/es/node_modules/xgplayer/es/instManager.js +104 -4
  437. package/dist/es/node_modules/xgplayer/es/lang/en.js +82 -4
  438. package/dist/es/node_modules/xgplayer/es/lang/i18n.js +78 -4
  439. package/dist/es/node_modules/xgplayer/es/lang/jp.js +82 -4
  440. package/dist/es/node_modules/xgplayer/es/lang/zh-cn.js +82 -4
  441. package/dist/es/node_modules/xgplayer/es/mediaProxy.js +469 -4
  442. package/dist/es/node_modules/xgplayer/es/player.js +1243 -4
  443. package/dist/es/node_modules/xgplayer/es/plugin/basePlugin.js +210 -4
  444. package/dist/es/node_modules/xgplayer/es/plugin/hooksDescriptor.js +133 -4
  445. package/dist/es/node_modules/xgplayer/es/plugin/plugin.js +369 -4
  446. package/dist/es/node_modules/xgplayer/es/plugin/pluginsManager.js +207 -4
  447. package/dist/es/node_modules/xgplayer/es/plugin/preset.js +17 -4
  448. package/dist/es/node_modules/xgplayer/es/plugin/resizeObserver.js +84 -4
  449. package/dist/es/node_modules/xgplayer/es/plugins/assets/back.js +13 -4
  450. package/dist/es/node_modules/xgplayer/es/plugins/assets/download.js +23 -4
  451. package/dist/es/node_modules/xgplayer/es/plugins/assets/exitCssFull.js +12 -4
  452. package/dist/es/node_modules/xgplayer/es/plugins/assets/exitFull.js +12 -4
  453. package/dist/es/node_modules/xgplayer/es/plugins/assets/loading.js +12 -4
  454. package/dist/es/node_modules/xgplayer/es/plugins/assets/pause.js +12 -4
  455. package/dist/es/node_modules/xgplayer/es/plugins/assets/pipIcon.js +13 -4
  456. package/dist/es/node_modules/xgplayer/es/plugins/assets/pipIconExit.js +16 -4
  457. package/dist/es/node_modules/xgplayer/es/plugins/assets/play.js +12 -4
  458. package/dist/es/node_modules/xgplayer/es/plugins/assets/playNext.js +12 -4
  459. package/dist/es/node_modules/xgplayer/es/plugins/assets/replay.js +12 -4
  460. package/dist/es/node_modules/xgplayer/es/plugins/assets/requestCssFull.js +12 -4
  461. package/dist/es/node_modules/xgplayer/es/plugins/assets/requestFull.js +12 -4
  462. package/dist/es/node_modules/xgplayer/es/plugins/assets/rotate.js +20 -4
  463. package/dist/es/node_modules/xgplayer/es/plugins/assets/seekicon.js +15 -4
  464. package/dist/es/node_modules/xgplayer/es/plugins/assets/volumeLarge.js +13 -4
  465. package/dist/es/node_modules/xgplayer/es/plugins/assets/volumeMuted.js +13 -4
  466. package/dist/es/node_modules/xgplayer/es/plugins/assets/volumeSmall.js +13 -4
  467. package/dist/es/node_modules/xgplayer/es/plugins/common/iconPlugin.js +38 -4
  468. package/dist/es/node_modules/xgplayer/es/plugins/common/iconTools.js +15 -4
  469. package/dist/es/node_modules/xgplayer/es/plugins/common/optionList.js +82 -4
  470. package/dist/es/node_modules/xgplayer/es/plugins/common/optionsIcon.js +196 -4
  471. package/dist/es/node_modules/xgplayer/es/plugins/common/thumbnail.js +144 -4
  472. package/dist/es/node_modules/xgplayer/es/plugins/controls/index.js +174 -4
  473. package/dist/es/node_modules/xgplayer/es/plugins/cssFullScreen/index.js +108 -4
  474. package/dist/es/node_modules/xgplayer/es/plugins/definition/index.js +113 -4
  475. package/dist/es/node_modules/xgplayer/es/plugins/download/index.js +86 -4
  476. package/dist/es/node_modules/xgplayer/es/plugins/dynamicBg/index.js +235 -5
  477. package/dist/es/node_modules/xgplayer/es/plugins/enter/index.js +45 -4
  478. package/dist/es/node_modules/xgplayer/es/plugins/error/index.js +71 -4
  479. package/dist/es/node_modules/xgplayer/es/plugins/fpsDetect/index.js +119 -4
  480. package/dist/es/node_modules/xgplayer/es/plugins/fullscreen/backicon.js +71 -4
  481. package/dist/es/node_modules/xgplayer/es/plugins/fullscreen/index.js +153 -4
  482. package/dist/es/node_modules/xgplayer/es/plugins/gapJump/index.js +99 -4
  483. package/dist/es/node_modules/xgplayer/es/plugins/keyboard/index.js +302 -4
  484. package/dist/es/node_modules/xgplayer/es/plugins/loading/index.js +49 -4
  485. package/dist/es/node_modules/xgplayer/es/plugins/logger/index.js +174 -5
  486. package/dist/es/node_modules/xgplayer/es/plugins/miniScreen/index.js +172 -4
  487. package/dist/es/node_modules/xgplayer/es/plugins/miniScreen/miniScreenIcon.js +58 -4
  488. package/dist/es/node_modules/xgplayer/es/plugins/mobile/index.js +446 -4
  489. package/dist/es/node_modules/xgplayer/es/plugins/mobile/touch.js +141 -4
  490. package/dist/es/node_modules/xgplayer/es/plugins/pc/index.js +125 -4
  491. package/dist/es/node_modules/xgplayer/es/plugins/pip/index.js +219 -4
  492. package/dist/es/node_modules/xgplayer/es/plugins/play/index.js +105 -4
  493. package/dist/es/node_modules/xgplayer/es/plugins/playNext/index.js +81 -4
  494. package/dist/es/node_modules/xgplayer/es/plugins/playbackRate/index.js +103 -4
  495. package/dist/es/node_modules/xgplayer/es/plugins/poster/index.js +122 -4
  496. package/dist/es/node_modules/xgplayer/es/plugins/progress/index.js +434 -4
  497. package/dist/es/node_modules/xgplayer/es/plugins/progress/innerList.js +218 -4
  498. package/dist/es/node_modules/xgplayer/es/plugins/progress/miniProgress.js +96 -4
  499. package/dist/es/node_modules/xgplayer/es/plugins/progressPreview/dotsApi.js +178 -4
  500. package/dist/es/node_modules/xgplayer/es/plugins/progressPreview/index.js +295 -4
  501. package/dist/es/node_modules/xgplayer/es/plugins/prompt/index.js +89 -4
  502. package/dist/es/node_modules/xgplayer/es/plugins/replay/index.js +95 -4
  503. package/dist/es/node_modules/xgplayer/es/plugins/rotate/index.js +109 -4
  504. package/dist/es/node_modules/xgplayer/es/plugins/screenShot/index.js +137 -4
  505. package/dist/es/node_modules/xgplayer/es/plugins/start/index.js +225 -4
  506. package/dist/es/node_modules/xgplayer/es/plugins/stats/index.js +155 -4
  507. package/dist/es/node_modules/xgplayer/es/plugins/testspeed/index.js +137 -4
  508. package/dist/es/node_modules/xgplayer/es/plugins/time/index.js +167 -4
  509. package/dist/es/node_modules/xgplayer/es/plugins/time/timesegments.js +149 -4
  510. package/dist/es/node_modules/xgplayer/es/plugins/volume/index.js +209 -4
  511. package/dist/es/node_modules/xgplayer/es/plugins/waitingTimeoutJump/index.js +56 -4
  512. package/dist/es/node_modules/xgplayer/es/presets/default.js +64 -4
  513. package/dist/es/node_modules/xgplayer/es/state.js +16 -4
  514. package/dist/es/node_modules/xgplayer/es/stateClassMap.js +37 -4
  515. package/dist/es/node_modules/xgplayer/es/utils/database.js +86 -4
  516. package/dist/es/node_modules/xgplayer/es/utils/debug.js +37 -4
  517. package/dist/es/node_modules/xgplayer/es/utils/draggabilly.js +274 -4
  518. package/dist/es/node_modules/xgplayer/es/utils/sniffer.js +114 -4
  519. package/dist/es/node_modules/xgplayer/es/utils/util.js +520 -4
  520. package/dist/es/node_modules/xgplayer/es/utils/xgplayerTimeRange.js +28 -4
  521. package/dist/es/node_modules/xgplayer/es/version.js +7 -4
  522. package/dist/es/packages/components/index.js +88 -4
  523. package/dist/es/packages/hooks/dist/index.js +81 -0
  524. package/dist/es/packages/utils/dist/index.js +599 -0
  525. package/dist/es/styles/tokens.css +3 -3
  526. package/dist/lib/Button/index.js +4 -4
  527. package/dist/lib/Button/src/Button.css +3 -3
  528. package/dist/lib/Button/src/Button.vue.js +4 -4
  529. package/dist/lib/Button/src/Button2.css +3 -3
  530. package/dist/lib/CodeEditor/index.js +4 -4
  531. package/dist/lib/CodeEditor/src/index.css +3 -3
  532. package/dist/lib/CodeEditor/src/index.vue.js +4 -4
  533. package/dist/lib/CodeEditor/src/index2.css +3 -3
  534. package/dist/lib/CodeEditor/src/index3.css +3 -3
  535. package/dist/lib/ConfigProvider/index.js +4 -4
  536. package/dist/lib/ConfigProvider/src/configProvider.js +4 -4
  537. package/dist/lib/ConfigProvider/src/configProviderProps.js +4 -4
  538. package/dist/lib/ConfigProvider/src/constants.js +4 -4
  539. package/dist/lib/ConfigProvider/src/useGlobalConfig.js +4 -4
  540. package/dist/lib/CountTo/index.js +4 -4
  541. package/dist/lib/CountTo/src/index.css +4 -4
  542. package/dist/lib/CountTo/src/index.vue.js +4 -4
  543. package/dist/lib/Ellipsis/index.js +4 -4
  544. package/dist/lib/Ellipsis/src/components/JsEllipsis.css +3 -3
  545. package/dist/lib/Ellipsis/src/components/JsEllipsis.vue.js +4 -4
  546. package/dist/lib/Ellipsis/src/components/NativeEllipsis.css +3 -3
  547. package/dist/lib/Ellipsis/src/components/NativeEllipsis.vue.js +4 -4
  548. package/dist/lib/Ellipsis/src/components/NativeEllipsis2.css +3 -3
  549. package/dist/lib/Ellipsis/src/index.css +3 -3
  550. package/dist/lib/Ellipsis/src/index.vue.js +4 -4
  551. package/dist/lib/Ellipsis/src/utils/utils.js +4 -4
  552. package/dist/lib/Form/index.js +4 -4
  553. package/dist/lib/Form/src/Form.css +3 -3
  554. package/dist/lib/Form/src/Form.vue.js +4 -4
  555. package/dist/lib/Form/src/Form2.css +3 -3
  556. package/dist/lib/Form/src/styles/form.css +3 -3
  557. package/dist/lib/Marquee/index.js +4 -4
  558. package/dist/lib/Marquee/src/index.css +3 -3
  559. package/dist/lib/Marquee/src/index.vue.js +4 -4
  560. package/dist/lib/Marquee/src/index2.css +3 -3
  561. package/dist/lib/Overlay/index.js +4 -4
  562. package/dist/lib/Overlay/src/Message.css +3 -3
  563. package/dist/lib/Overlay/src/Message.vue.js +4 -4
  564. package/dist/lib/Overlay/src/Message2.css +3 -3
  565. package/dist/lib/Overlay/src/Modal.css +3 -3
  566. package/dist/lib/Overlay/src/Modal.vue.js +4 -4
  567. package/dist/lib/Overlay/src/Modal2.css +3 -3
  568. package/dist/lib/Overlay/src/Notice.css +3 -3
  569. package/dist/lib/Overlay/src/Notice.vue.js +4 -4
  570. package/dist/lib/Overlay/src/Notice2.css +3 -3
  571. package/dist/lib/Overlay/src/Tooltip.css +3 -3
  572. package/dist/lib/Overlay/src/Tooltip.vue.js +4 -4
  573. package/dist/lib/Overlay/src/Tooltip2.css +3 -3
  574. package/dist/lib/RichTextEditor/index.js +4 -4
  575. package/dist/lib/RichTextEditor/src/ToolbarPanel.css +3 -3
  576. package/dist/lib/RichTextEditor/src/ToolbarPanel.vue.js +4 -4
  577. package/dist/lib/RichTextEditor/src/ToolbarPanel2.css +3 -3
  578. package/dist/lib/RichTextEditor/src/components/BlockquoteButton.css +4 -4
  579. package/dist/lib/RichTextEditor/src/components/BlockquoteButton.vue.js +4 -4
  580. package/dist/lib/RichTextEditor/src/components/CodeBlockButton.css +4 -4
  581. package/dist/lib/RichTextEditor/src/components/CodeBlockButton.vue.js +4 -4
  582. package/dist/lib/RichTextEditor/src/components/ColorHighlightPopover.css +3 -3
  583. package/dist/lib/RichTextEditor/src/components/ColorHighlightPopover.vue.js +4 -4
  584. package/dist/lib/RichTextEditor/src/components/FontSizeDropdownMenu.css +3 -3
  585. package/dist/lib/RichTextEditor/src/components/FontSizeDropdownMenu.vue.js +4 -4
  586. package/dist/lib/RichTextEditor/src/components/HeadingDropdownMenu.css +3 -3
  587. package/dist/lib/RichTextEditor/src/components/HeadingDropdownMenu.vue.js +4 -4
  588. package/dist/lib/RichTextEditor/src/components/ImageUploadButton.css +4 -4
  589. package/dist/lib/RichTextEditor/src/components/ImageUploadButton.vue.js +4 -4
  590. package/dist/lib/RichTextEditor/src/components/LinkPopover.css +4 -4
  591. package/dist/lib/RichTextEditor/src/components/LinkPopover.vue.js +4 -4
  592. package/dist/lib/RichTextEditor/src/components/LinkPopover2.css +4 -4
  593. package/dist/lib/RichTextEditor/src/components/ListDropdownMenu.css +3 -3
  594. package/dist/lib/RichTextEditor/src/components/ListDropdownMenu.vue.js +4 -4
  595. package/dist/lib/RichTextEditor/src/components/MarkButton.css +4 -4
  596. package/dist/lib/RichTextEditor/src/components/MarkButton.vue.js +4 -4
  597. package/dist/lib/RichTextEditor/src/components/TableButton.css +3 -3
  598. package/dist/lib/RichTextEditor/src/components/TableButton.vue.js +4 -4
  599. package/dist/lib/RichTextEditor/src/components/TextAlignDropdownMenu.css +3 -3
  600. package/dist/lib/RichTextEditor/src/components/TextAlignDropdownMenu.vue.js +4 -4
  601. package/dist/lib/RichTextEditor/src/components/TextColorPopover.css +3 -3
  602. package/dist/lib/RichTextEditor/src/components/TextColorPopover.vue.js +4 -4
  603. package/dist/lib/RichTextEditor/src/components/ToolbarGroup.css +3 -3
  604. package/dist/lib/RichTextEditor/src/components/ToolbarGroup.vue.js +4 -4
  605. package/dist/lib/RichTextEditor/src/components/ToolbarSeparator.css +3 -3
  606. package/dist/lib/RichTextEditor/src/components/ToolbarSeparator.vue.js +4 -4
  607. package/dist/lib/RichTextEditor/src/components/UndoRedoButton.css +4 -4
  608. package/dist/lib/RichTextEditor/src/components/UndoRedoButton.vue.js +4 -4
  609. package/dist/lib/RichTextEditor/src/components/VideoUploadButton.css +4 -4
  610. package/dist/lib/RichTextEditor/src/components/VideoUploadButton.vue.js +4 -4
  611. package/dist/lib/RichTextEditor/src/components/basic/ColorPicker.css +4 -4
  612. package/dist/lib/RichTextEditor/src/components/basic/ColorPicker.vue.js +4 -4
  613. package/dist/lib/RichTextEditor/src/components/basic/MediaUploadModal.css +3 -3
  614. package/dist/lib/RichTextEditor/src/components/basic/MediaUploadModal.vue.js +4 -4
  615. package/dist/lib/RichTextEditor/src/components/basic/MediaUploadModal2.css +3 -3
  616. package/dist/lib/RichTextEditor/src/components/basic/SelectMenu.css +4 -4
  617. package/dist/lib/RichTextEditor/src/components/basic/SelectMenu.vue.js +4 -4
  618. package/dist/lib/RichTextEditor/src/components/basic/SelectMenu2.css +4 -4
  619. package/dist/lib/RichTextEditor/src/constant/index.js +4 -4
  620. package/dist/lib/RichTextEditor/src/extensions/styledTable.js +14 -0
  621. package/dist/lib/RichTextEditor/src/extensions/video.js +4 -4
  622. package/dist/lib/RichTextEditor/src/index.css +4 -4
  623. package/dist/lib/RichTextEditor/src/index.vue.js +4 -4
  624. package/dist/lib/RichTextEditor/src/index2.css +4 -4
  625. package/dist/lib/RichTextEditor/src/props.js +4 -4
  626. package/dist/lib/ScaleScreen/index.js +4 -4
  627. package/dist/lib/ScaleScreen/src/index.css +3 -3
  628. package/dist/lib/ScaleScreen/src/index.vue.js +4 -4
  629. package/dist/lib/ScaleScreen/src/index2.css +3 -3
  630. package/dist/lib/Transition/index.js +4 -4
  631. package/dist/lib/Transition/src/CollapseTransition.css +3 -3
  632. package/dist/lib/Transition/src/CollapseTransition.vue.js +4 -4
  633. package/dist/lib/Transition/src/CollapseTransition2.css +3 -3
  634. package/dist/lib/Transition/src/CreateTransition.js +4 -4
  635. package/dist/lib/Transition/src/ExpandTransition.js +4 -4
  636. package/dist/lib/Transition/src/style/index.css +3 -3
  637. package/dist/lib/Transition/style.js +4 -4
  638. package/dist/lib/VideoBackground/index.js +4 -4
  639. package/dist/lib/VideoBackground/src/helper.js +4 -4
  640. package/dist/lib/VideoBackground/src/index.css +3 -3
  641. package/dist/lib/VideoBackground/src/index.vue.js +4 -4
  642. package/dist/lib/VideoBackground/src/index2.css +3 -3
  643. package/dist/lib/VideoBackground/src/index3.css +3 -3
  644. package/dist/lib/VideoBackground/src/videoBackground.js +4 -4
  645. package/dist/lib/VideoPlayer/index.js +4 -4
  646. package/dist/lib/VideoPlayer/src/index.css +3 -3
  647. package/dist/lib/VideoPlayer/src/index.vue.js +4 -4
  648. package/dist/lib/VirtualScroll/index.js +4 -4
  649. package/dist/lib/VirtualScroll/src/index.css +3 -3
  650. package/dist/lib/VirtualScroll/src/index.vue.js +4 -4
  651. package/dist/lib/VirtualScroll/src/index.vue2.js +4 -4
  652. package/dist/lib/VirtualScroll/src/index2.css +3 -3
  653. package/dist/lib/_virtual/_commonjsHelpers.js +4 -4
  654. package/dist/lib/_virtual/_plugin-vue_export-helper.js +4 -4
  655. package/dist/lib/_virtual/delegate.js +4 -4
  656. package/dist/lib/_virtual/download.js +4 -4
  657. package/dist/lib/_virtual/download2.js +4 -4
  658. package/dist/lib/_virtual/index.js +4 -4
  659. package/dist/lib/_virtual/index2.js +4 -4
  660. package/dist/lib/_virtual/index3.js +14 -0
  661. package/dist/lib/{node_modules/@tanstack/store/dist/esm/types.js → _virtual/index4.js} +4 -4
  662. package/dist/lib/hooks/useLocale.js +4 -4
  663. package/dist/lib/hooks/useNamespace.js +4 -4
  664. package/dist/lib/index.js +4 -4
  665. package/dist/lib/locale/lang/en-US.js +4 -4
  666. package/dist/lib/locale/lang/ja-JP.js +4 -4
  667. package/dist/lib/locale/lang/zh-CN.js +4 -4
  668. package/dist/lib/node_modules/@codemirror/autocomplete/dist/index.js +4 -4
  669. package/dist/lib/node_modules/@codemirror/commands/dist/index.js +4 -4
  670. package/dist/lib/node_modules/@codemirror/lang-java/dist/index.js +4 -4
  671. package/dist/lib/node_modules/@codemirror/lang-javascript/dist/index.js +16 -4
  672. package/dist/lib/node_modules/@codemirror/lang-json/dist/index.js +4 -4
  673. package/dist/lib/node_modules/@codemirror/lang-python/dist/index.js +6 -4
  674. package/dist/lib/node_modules/@codemirror/lang-sql/dist/index.js +5 -4
  675. package/dist/lib/node_modules/@codemirror/lang-xml/dist/index.js +4 -4
  676. package/dist/lib/node_modules/@codemirror/lang-yaml/dist/index.js +4 -4
  677. package/dist/lib/node_modules/@codemirror/language/dist/index.js +4 -4
  678. package/dist/lib/node_modules/@codemirror/lint/dist/index.js +4 -4
  679. package/dist/lib/node_modules/@codemirror/search/dist/index.js +5 -4
  680. package/dist/lib/node_modules/@codemirror/state/dist/index.js +8 -4
  681. package/dist/lib/node_modules/@codemirror/theme-one-dark/dist/index.js +4 -4
  682. package/dist/lib/node_modules/@codemirror/view/dist/index.js +8 -4
  683. package/dist/lib/node_modules/@lezer/common/dist/index.js +4 -4
  684. package/dist/lib/node_modules/@lezer/highlight/dist/index.js +4 -4
  685. package/dist/lib/node_modules/@lezer/java/dist/index.js +4 -4
  686. package/dist/lib/node_modules/@lezer/javascript/dist/index.js +4 -4
  687. package/dist/lib/node_modules/@lezer/json/dist/index.js +4 -4
  688. package/dist/lib/node_modules/@lezer/lr/dist/index.js +4 -4
  689. package/dist/lib/node_modules/@lezer/python/dist/index.js +4 -4
  690. package/dist/lib/node_modules/@lezer/xml/dist/index.js +4 -4
  691. package/dist/lib/node_modules/@lezer/yaml/dist/index.js +4 -4
  692. package/dist/lib/node_modules/@marijn/find-cluster-break/src/index.js +4 -4
  693. package/dist/lib/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +4 -4
  694. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/EventClient.js +4 -4
  695. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +4 -4
  696. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +4 -4
  697. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +4 -4
  698. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +4 -4
  699. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +4 -4
  700. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/utils.js +4 -4
  701. package/dist/lib/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +4 -4
  702. package/dist/lib/node_modules/@tanstack/store/dist/esm/alien.js +14 -0
  703. package/dist/lib/node_modules/@tanstack/store/dist/esm/atom.js +14 -0
  704. package/dist/lib/node_modules/@tanstack/store/dist/esm/batch.js +14 -0
  705. package/dist/lib/node_modules/@tanstack/store/dist/esm/store.js +4 -4
  706. package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useField.js +4 -4
  707. package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useForm.js +4 -4
  708. package/dist/lib/node_modules/@tanstack/vue-store/dist/esm/index.js +4 -4
  709. package/dist/lib/node_modules/@tiptap/core/dist/index.js +94 -4
  710. package/dist/lib/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +4 -4
  711. package/dist/lib/node_modules/@tiptap/extension-blockquote/dist/index.js +8 -4
  712. package/dist/lib/node_modules/@tiptap/extension-bold/dist/index.js +4 -4
  713. package/dist/lib/node_modules/@tiptap/extension-character-count/dist/index.js +4 -4
  714. package/dist/lib/node_modules/@tiptap/extension-code/dist/index.js +4 -4
  715. package/dist/lib/node_modules/@tiptap/extension-code-block/dist/index.js +21 -4
  716. package/dist/lib/node_modules/@tiptap/extension-document/dist/index.js +6 -4
  717. package/dist/lib/node_modules/@tiptap/extension-hard-break/dist/index.js +6 -4
  718. package/dist/lib/node_modules/@tiptap/extension-heading/dist/index.js +4 -4
  719. package/dist/lib/node_modules/@tiptap/extension-highlight/dist/index.js +4 -4
  720. package/dist/lib/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +4 -4
  721. package/dist/lib/node_modules/@tiptap/extension-image/dist/index.js +4 -4
  722. package/dist/lib/node_modules/@tiptap/extension-italic/dist/index.js +4 -4
  723. package/dist/lib/node_modules/@tiptap/extension-link/dist/index.js +4 -4
  724. package/dist/lib/node_modules/@tiptap/extension-list/dist/index.js +15 -4
  725. package/dist/lib/node_modules/@tiptap/extension-paragraph/dist/index.js +4 -4
  726. package/dist/lib/node_modules/@tiptap/extension-strike/dist/index.js +4 -4
  727. package/dist/lib/node_modules/@tiptap/extension-subscript/dist/index.js +4 -4
  728. package/dist/lib/node_modules/@tiptap/extension-superscript/dist/index.js +4 -4
  729. package/dist/lib/node_modules/@tiptap/extension-table/dist/index.js +8 -4
  730. package/dist/lib/node_modules/@tiptap/extension-task-item/dist/index.js +4 -4
  731. package/dist/lib/node_modules/@tiptap/extension-task-list/dist/index.js +4 -4
  732. package/dist/lib/node_modules/@tiptap/extension-text/dist/index.js +4 -4
  733. package/dist/lib/node_modules/@tiptap/extension-text-align/dist/index.js +4 -4
  734. package/dist/lib/node_modules/@tiptap/extension-text-style/dist/index.js +4 -4
  735. package/dist/lib/node_modules/@tiptap/extension-underline/dist/index.js +4 -4
  736. package/dist/lib/node_modules/@tiptap/extensions/dist/index.js +4 -4
  737. package/dist/lib/node_modules/@tiptap/html/dist/index.js +14 -0
  738. package/dist/lib/node_modules/@tiptap/starter-kit/dist/index.js +4 -4
  739. package/dist/lib/node_modules/@tiptap/vue-3/dist/index.js +4 -4
  740. package/dist/lib/node_modules/@vueuse/core/dist/index.js +4 -4
  741. package/dist/lib/node_modules/@vueuse/shared/dist/index.js +4 -4
  742. package/dist/lib/node_modules/codemirror/dist/index.js +4 -4
  743. package/dist/lib/node_modules/crelt/index.js +4 -4
  744. package/dist/lib/node_modules/delegate/src/closest.js +4 -4
  745. package/dist/lib/node_modules/delegate/src/delegate.js +4 -4
  746. package/dist/lib/node_modules/downloadjs/download.js +6 -4
  747. package/dist/lib/node_modules/eventemitter3/index.js +4 -4
  748. package/dist/lib/node_modules/linkifyjs/dist/linkify.js +8 -4
  749. package/dist/lib/node_modules/lodash-es/_DataView.js +4 -4
  750. package/dist/lib/node_modules/lodash-es/_Hash.js +4 -4
  751. package/dist/lib/node_modules/lodash-es/_ListCache.js +4 -4
  752. package/dist/lib/node_modules/lodash-es/_Map.js +4 -4
  753. package/dist/lib/node_modules/lodash-es/_MapCache.js +4 -4
  754. package/dist/lib/node_modules/lodash-es/_Promise.js +4 -4
  755. package/dist/lib/node_modules/lodash-es/_Set.js +4 -4
  756. package/dist/lib/node_modules/lodash-es/_SetCache.js +14 -0
  757. package/dist/lib/node_modules/lodash-es/_Stack.js +4 -4
  758. package/dist/lib/node_modules/lodash-es/_Symbol.js +4 -4
  759. package/dist/lib/node_modules/lodash-es/_Uint8Array.js +4 -4
  760. package/dist/lib/node_modules/lodash-es/_WeakMap.js +4 -4
  761. package/dist/lib/node_modules/lodash-es/_apply.js +4 -4
  762. package/dist/lib/node_modules/lodash-es/_arrayEach.js +4 -4
  763. package/dist/lib/node_modules/lodash-es/_arrayFilter.js +4 -4
  764. package/dist/lib/node_modules/lodash-es/_arrayIncludes.js +14 -0
  765. package/dist/lib/node_modules/lodash-es/_arrayIncludesWith.js +14 -0
  766. package/dist/lib/node_modules/lodash-es/_arrayLikeKeys.js +4 -4
  767. package/dist/lib/node_modules/lodash-es/_arrayMap.js +4 -4
  768. package/dist/lib/node_modules/lodash-es/_arrayPush.js +4 -4
  769. package/dist/lib/node_modules/lodash-es/_arraySome.js +14 -0
  770. package/dist/lib/node_modules/lodash-es/_asciiToArray.js +4 -4
  771. package/dist/lib/node_modules/lodash-es/_assignMergeValue.js +14 -0
  772. package/dist/lib/node_modules/lodash-es/_assignValue.js +4 -4
  773. package/dist/lib/node_modules/lodash-es/_assocIndexOf.js +4 -4
  774. package/dist/lib/node_modules/lodash-es/_baseAssignValue.js +4 -4
  775. package/dist/lib/node_modules/lodash-es/_baseClone.js +4 -4
  776. package/dist/lib/node_modules/lodash-es/_baseCreate.js +14 -0
  777. package/dist/lib/node_modules/lodash-es/_baseFindIndex.js +14 -0
  778. package/dist/lib/node_modules/lodash-es/_baseFlatten.js +4 -4
  779. package/dist/lib/node_modules/lodash-es/_baseFor.js +14 -0
  780. package/dist/lib/node_modules/lodash-es/_baseGet.js +4 -4
  781. package/dist/lib/node_modules/lodash-es/_baseGetAllKeys.js +4 -4
  782. package/dist/lib/node_modules/lodash-es/_baseGetTag.js +4 -4
  783. package/dist/lib/node_modules/lodash-es/_baseIndexOf.js +14 -0
  784. package/dist/lib/node_modules/lodash-es/_baseIntersection.js +14 -0
  785. package/dist/lib/node_modules/lodash-es/_baseIsArguments.js +4 -4
  786. package/dist/lib/node_modules/lodash-es/_baseIsEqual.js +14 -0
  787. package/dist/lib/node_modules/lodash-es/_baseIsEqualDeep.js +14 -0
  788. package/dist/lib/node_modules/lodash-es/_baseIsMap.js +4 -4
  789. package/dist/lib/node_modules/lodash-es/_baseIsNaN.js +14 -0
  790. package/dist/lib/node_modules/lodash-es/_baseIsNative.js +4 -4
  791. package/dist/lib/node_modules/lodash-es/_baseIsRegExp.js +4 -4
  792. package/dist/lib/node_modules/lodash-es/_baseIsSet.js +4 -4
  793. package/dist/lib/node_modules/lodash-es/_baseIsTypedArray.js +4 -4
  794. package/dist/lib/node_modules/lodash-es/_baseKeys.js +14 -0
  795. package/dist/lib/node_modules/lodash-es/_baseKeysIn.js +4 -4
  796. package/dist/lib/node_modules/lodash-es/_baseMerge.js +14 -0
  797. package/dist/lib/node_modules/lodash-es/_baseMergeDeep.js +14 -0
  798. package/dist/lib/node_modules/lodash-es/_baseRest.js +14 -0
  799. package/dist/lib/node_modules/lodash-es/_baseSetToString.js +4 -4
  800. package/dist/lib/node_modules/lodash-es/_baseSlice.js +4 -4
  801. package/dist/lib/node_modules/lodash-es/_baseTimes.js +4 -4
  802. package/dist/lib/node_modules/lodash-es/_baseToString.js +4 -4
  803. package/dist/lib/node_modules/lodash-es/_baseUnary.js +4 -4
  804. package/dist/lib/node_modules/lodash-es/_baseUniq.js +14 -0
  805. package/dist/lib/node_modules/lodash-es/_baseUnset.js +4 -4
  806. package/dist/lib/node_modules/lodash-es/_cacheHas.js +14 -0
  807. package/dist/lib/node_modules/lodash-es/_castArrayLikeObject.js +14 -0
  808. package/dist/lib/node_modules/lodash-es/_castPath.js +4 -4
  809. package/dist/lib/node_modules/lodash-es/_castSlice.js +4 -4
  810. package/dist/lib/node_modules/lodash-es/_cloneArrayBuffer.js +4 -4
  811. package/dist/lib/node_modules/lodash-es/_cloneBuffer.js +4 -4
  812. package/dist/lib/node_modules/lodash-es/_cloneDataView.js +4 -4
  813. package/dist/lib/node_modules/lodash-es/_cloneRegExp.js +4 -4
  814. package/dist/lib/node_modules/lodash-es/_cloneSymbol.js +4 -4
  815. package/dist/lib/node_modules/lodash-es/_cloneTypedArray.js +4 -4
  816. package/dist/lib/node_modules/lodash-es/_copyArray.js +14 -0
  817. package/dist/lib/node_modules/lodash-es/_copyObject.js +4 -4
  818. package/dist/lib/node_modules/lodash-es/_coreJsData.js +4 -4
  819. package/dist/lib/node_modules/lodash-es/_createAssigner.js +14 -0
  820. package/dist/lib/node_modules/lodash-es/_createBaseFor.js +14 -0
  821. package/dist/lib/node_modules/lodash-es/_createCaseFirst.js +4 -4
  822. package/dist/lib/node_modules/lodash-es/_createSet.js +14 -0
  823. package/dist/lib/node_modules/lodash-es/_customOmitClone.js +4 -4
  824. package/dist/lib/node_modules/lodash-es/_defineProperty.js +4 -4
  825. package/dist/lib/node_modules/lodash-es/_equalArrays.js +14 -0
  826. package/dist/lib/node_modules/lodash-es/_equalByTag.js +14 -0
  827. package/dist/lib/node_modules/lodash-es/_equalObjects.js +14 -0
  828. package/dist/lib/node_modules/lodash-es/_flatRest.js +4 -4
  829. package/dist/lib/node_modules/lodash-es/_freeGlobal.js +4 -4
  830. package/dist/lib/node_modules/lodash-es/_getAllKeys.js +14 -0
  831. package/dist/lib/node_modules/lodash-es/_getAllKeysIn.js +4 -4
  832. package/dist/lib/node_modules/lodash-es/_getMapData.js +4 -4
  833. package/dist/lib/node_modules/lodash-es/_getNative.js +4 -4
  834. package/dist/lib/node_modules/lodash-es/_getPrototype.js +4 -4
  835. package/dist/lib/node_modules/lodash-es/_getRawTag.js +4 -4
  836. package/dist/lib/node_modules/lodash-es/_getSymbols.js +4 -4
  837. package/dist/lib/node_modules/lodash-es/_getSymbolsIn.js +4 -4
  838. package/dist/lib/node_modules/lodash-es/_getTag.js +4 -4
  839. package/dist/lib/node_modules/lodash-es/_getValue.js +4 -4
  840. package/dist/lib/node_modules/lodash-es/_hasUnicode.js +4 -4
  841. package/dist/lib/node_modules/lodash-es/_hashClear.js +4 -4
  842. package/dist/lib/node_modules/lodash-es/_hashDelete.js +4 -4
  843. package/dist/lib/node_modules/lodash-es/_hashGet.js +4 -4
  844. package/dist/lib/node_modules/lodash-es/_hashHas.js +4 -4
  845. package/dist/lib/node_modules/lodash-es/_hashSet.js +4 -4
  846. package/dist/lib/node_modules/lodash-es/_initCloneArray.js +4 -4
  847. package/dist/lib/node_modules/lodash-es/_initCloneByTag.js +4 -4
  848. package/dist/lib/node_modules/lodash-es/_initCloneObject.js +14 -0
  849. package/dist/lib/node_modules/lodash-es/_isFlattenable.js +4 -4
  850. package/dist/lib/node_modules/lodash-es/_isIndex.js +4 -4
  851. package/dist/lib/node_modules/lodash-es/_isIterateeCall.js +14 -0
  852. package/dist/lib/node_modules/lodash-es/_isKey.js +4 -4
  853. package/dist/lib/node_modules/lodash-es/_isKeyable.js +4 -4
  854. package/dist/lib/node_modules/lodash-es/_isMasked.js +4 -4
  855. package/dist/lib/node_modules/lodash-es/_isPrototype.js +4 -4
  856. package/dist/lib/node_modules/lodash-es/_listCacheClear.js +4 -4
  857. package/dist/lib/node_modules/lodash-es/_listCacheDelete.js +4 -4
  858. package/dist/lib/node_modules/lodash-es/_listCacheGet.js +4 -4
  859. package/dist/lib/node_modules/lodash-es/_listCacheHas.js +4 -4
  860. package/dist/lib/node_modules/lodash-es/_listCacheSet.js +4 -4
  861. package/dist/lib/node_modules/lodash-es/_mapCacheClear.js +4 -4
  862. package/dist/lib/node_modules/lodash-es/_mapCacheDelete.js +4 -4
  863. package/dist/lib/node_modules/lodash-es/_mapCacheGet.js +4 -4
  864. package/dist/lib/node_modules/lodash-es/_mapCacheHas.js +4 -4
  865. package/dist/lib/node_modules/lodash-es/_mapCacheSet.js +4 -4
  866. package/dist/lib/node_modules/lodash-es/_mapToArray.js +14 -0
  867. package/dist/lib/node_modules/lodash-es/_memoizeCapped.js +4 -4
  868. package/dist/lib/node_modules/lodash-es/_nativeCreate.js +4 -4
  869. package/dist/lib/node_modules/lodash-es/_nativeKeys.js +14 -0
  870. package/dist/lib/node_modules/lodash-es/_nativeKeysIn.js +4 -4
  871. package/dist/lib/node_modules/lodash-es/_nodeUtil.js +4 -4
  872. package/dist/lib/node_modules/lodash-es/_objectToString.js +4 -4
  873. package/dist/lib/node_modules/lodash-es/_overArg.js +4 -4
  874. package/dist/lib/node_modules/lodash-es/_overRest.js +4 -4
  875. package/dist/lib/node_modules/lodash-es/_parent.js +4 -4
  876. package/dist/lib/node_modules/lodash-es/_root.js +4 -4
  877. package/dist/lib/node_modules/lodash-es/_safeGet.js +14 -0
  878. package/dist/lib/node_modules/lodash-es/_setCacheAdd.js +14 -0
  879. package/dist/lib/node_modules/lodash-es/_setCacheHas.js +14 -0
  880. package/dist/lib/node_modules/lodash-es/_setToArray.js +14 -0
  881. package/dist/lib/node_modules/lodash-es/_setToString.js +4 -4
  882. package/dist/lib/node_modules/lodash-es/_shortOut.js +4 -4
  883. package/dist/lib/node_modules/lodash-es/_stackClear.js +4 -4
  884. package/dist/lib/node_modules/lodash-es/_stackDelete.js +4 -4
  885. package/dist/lib/node_modules/lodash-es/_stackGet.js +4 -4
  886. package/dist/lib/node_modules/lodash-es/_stackHas.js +4 -4
  887. package/dist/lib/node_modules/lodash-es/_stackSet.js +4 -4
  888. package/dist/lib/node_modules/lodash-es/_strictIndexOf.js +14 -0
  889. package/dist/lib/node_modules/lodash-es/_stringToArray.js +4 -4
  890. package/dist/lib/node_modules/lodash-es/_stringToPath.js +4 -4
  891. package/dist/lib/node_modules/lodash-es/_toKey.js +4 -4
  892. package/dist/lib/node_modules/lodash-es/_toSource.js +4 -4
  893. package/dist/lib/node_modules/lodash-es/_unicodeToArray.js +4 -4
  894. package/dist/lib/node_modules/lodash-es/constant.js +4 -4
  895. package/dist/lib/node_modules/lodash-es/eq.js +4 -4
  896. package/dist/lib/node_modules/lodash-es/flatten.js +4 -4
  897. package/dist/lib/node_modules/lodash-es/get.js +4 -4
  898. package/dist/lib/node_modules/lodash-es/identity.js +4 -4
  899. package/dist/lib/node_modules/lodash-es/intersectionWith.js +14 -0
  900. package/dist/lib/node_modules/lodash-es/isArguments.js +4 -4
  901. package/dist/lib/node_modules/lodash-es/isArray.js +4 -4
  902. package/dist/lib/node_modules/lodash-es/isArrayLike.js +4 -4
  903. package/dist/lib/node_modules/lodash-es/isArrayLikeObject.js +14 -0
  904. package/dist/lib/node_modules/lodash-es/isBuffer.js +4 -4
  905. package/dist/lib/node_modules/lodash-es/isEqual.js +14 -0
  906. package/dist/lib/node_modules/lodash-es/isFinite.js +4 -4
  907. package/dist/lib/node_modules/lodash-es/isFunction.js +4 -4
  908. package/dist/lib/node_modules/lodash-es/isLength.js +4 -4
  909. package/dist/lib/node_modules/lodash-es/isMap.js +4 -4
  910. package/dist/lib/node_modules/lodash-es/isNaN.js +4 -4
  911. package/dist/lib/node_modules/lodash-es/isNil.js +4 -4
  912. package/dist/lib/node_modules/lodash-es/isNumber.js +4 -4
  913. package/dist/lib/node_modules/lodash-es/isObject.js +4 -4
  914. package/dist/lib/node_modules/lodash-es/isObjectLike.js +4 -4
  915. package/dist/lib/node_modules/lodash-es/isPlainObject.js +4 -4
  916. package/dist/lib/node_modules/lodash-es/isRegExp.js +4 -4
  917. package/dist/lib/node_modules/lodash-es/isSet.js +4 -4
  918. package/dist/lib/node_modules/lodash-es/isString.js +4 -4
  919. package/dist/lib/node_modules/lodash-es/isSymbol.js +4 -4
  920. package/dist/lib/node_modules/lodash-es/isTypedArray.js +4 -4
  921. package/dist/lib/node_modules/lodash-es/keys.js +14 -0
  922. package/dist/lib/node_modules/lodash-es/keysIn.js +4 -4
  923. package/dist/lib/node_modules/lodash-es/last.js +4 -4
  924. package/dist/lib/node_modules/lodash-es/memoize.js +4 -4
  925. package/dist/lib/node_modules/lodash-es/mergeWith.js +14 -0
  926. package/dist/lib/node_modules/lodash-es/noop.js +14 -0
  927. package/dist/lib/node_modules/lodash-es/omit.js +4 -4
  928. package/dist/lib/node_modules/lodash-es/stubArray.js +4 -4
  929. package/dist/lib/node_modules/lodash-es/stubFalse.js +4 -4
  930. package/dist/lib/node_modules/lodash-es/toPlainObject.js +14 -0
  931. package/dist/lib/node_modules/lodash-es/toString.js +4 -4
  932. package/dist/lib/node_modules/lodash-es/unionWith.js +14 -0
  933. package/dist/lib/node_modules/lodash-es/upperFirst.js +4 -4
  934. package/dist/lib/node_modules/orderedmap/dist/index.js +4 -4
  935. package/dist/lib/node_modules/path-to-regexp/dist/index.js +14 -0
  936. package/dist/lib/node_modules/prosemirror-commands/dist/index.js +5 -4
  937. package/dist/lib/node_modules/prosemirror-dropcursor/dist/index.js +4 -4
  938. package/dist/lib/node_modules/prosemirror-gapcursor/dist/index.js +4 -4
  939. package/dist/lib/node_modules/prosemirror-history/dist/index.js +4 -4
  940. package/dist/lib/node_modules/prosemirror-keymap/dist/index.js +4 -4
  941. package/dist/lib/node_modules/prosemirror-model/dist/index.js +7 -4
  942. package/dist/lib/node_modules/prosemirror-schema-list/dist/index.js +4 -4
  943. package/dist/lib/node_modules/prosemirror-state/dist/index.js +4 -4
  944. package/dist/lib/node_modules/prosemirror-tables/dist/index.js +4 -4
  945. package/dist/lib/node_modules/prosemirror-transform/dist/index.js +5 -4
  946. package/dist/lib/node_modules/prosemirror-view/dist/index.js +8 -4
  947. package/dist/lib/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +14 -0
  948. package/dist/lib/node_modules/rope-sequence/dist/index.js +4 -4
  949. package/dist/lib/node_modules/sortablejs/modular/sortable.esm.js +14 -0
  950. package/dist/lib/node_modules/style-mod/src/style-mod.js +6 -4
  951. package/dist/lib/node_modules/title-case/dist/index.js +14 -0
  952. package/dist/lib/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +4 -4
  953. package/dist/lib/node_modules/w3c-keyname/index.js +4 -4
  954. package/dist/lib/node_modules/xgplayer/dist/index.min.css +3 -3
  955. package/dist/lib/node_modules/xgplayer/es/_virtual/_rollupPluginBabelHelpers.js +5 -4
  956. package/dist/lib/node_modules/xgplayer/es/constant.js +4 -4
  957. package/dist/lib/node_modules/xgplayer/es/defaultConfig.js +4 -4
  958. package/dist/lib/node_modules/xgplayer/es/error.js +4 -4
  959. package/dist/lib/node_modules/xgplayer/es/events.js +4 -4
  960. package/dist/lib/node_modules/xgplayer/es/index.umd.js +4 -4
  961. package/dist/lib/node_modules/xgplayer/es/instManager.js +4 -4
  962. package/dist/lib/node_modules/xgplayer/es/lang/en.js +4 -4
  963. package/dist/lib/node_modules/xgplayer/es/lang/i18n.js +4 -4
  964. package/dist/lib/node_modules/xgplayer/es/lang/jp.js +4 -4
  965. package/dist/lib/node_modules/xgplayer/es/lang/zh-cn.js +4 -4
  966. package/dist/lib/node_modules/xgplayer/es/mediaProxy.js +4 -4
  967. package/dist/lib/node_modules/xgplayer/es/player.js +4 -4
  968. package/dist/lib/node_modules/xgplayer/es/plugin/basePlugin.js +4 -4
  969. package/dist/lib/node_modules/xgplayer/es/plugin/hooksDescriptor.js +4 -4
  970. package/dist/lib/node_modules/xgplayer/es/plugin/plugin.js +4 -4
  971. package/dist/lib/node_modules/xgplayer/es/plugin/pluginsManager.js +4 -4
  972. package/dist/lib/node_modules/xgplayer/es/plugin/preset.js +4 -4
  973. package/dist/lib/node_modules/xgplayer/es/plugin/resizeObserver.js +4 -4
  974. package/dist/lib/node_modules/xgplayer/es/plugins/assets/back.js +8 -4
  975. package/dist/lib/node_modules/xgplayer/es/plugins/assets/download.js +18 -4
  976. package/dist/lib/node_modules/xgplayer/es/plugins/assets/exitCssFull.js +7 -4
  977. package/dist/lib/node_modules/xgplayer/es/plugins/assets/exitFull.js +7 -4
  978. package/dist/lib/node_modules/xgplayer/es/plugins/assets/loading.js +7 -4
  979. package/dist/lib/node_modules/xgplayer/es/plugins/assets/pause.js +7 -4
  980. package/dist/lib/node_modules/xgplayer/es/plugins/assets/pipIcon.js +8 -4
  981. package/dist/lib/node_modules/xgplayer/es/plugins/assets/pipIconExit.js +11 -4
  982. package/dist/lib/node_modules/xgplayer/es/plugins/assets/play.js +7 -4
  983. package/dist/lib/node_modules/xgplayer/es/plugins/assets/playNext.js +7 -4
  984. package/dist/lib/node_modules/xgplayer/es/plugins/assets/replay.js +7 -4
  985. package/dist/lib/node_modules/xgplayer/es/plugins/assets/requestCssFull.js +7 -4
  986. package/dist/lib/node_modules/xgplayer/es/plugins/assets/requestFull.js +7 -4
  987. package/dist/lib/node_modules/xgplayer/es/plugins/assets/rotate.js +15 -4
  988. package/dist/lib/node_modules/xgplayer/es/plugins/assets/seekicon.js +10 -4
  989. package/dist/lib/node_modules/xgplayer/es/plugins/assets/volumeLarge.js +8 -4
  990. package/dist/lib/node_modules/xgplayer/es/plugins/assets/volumeMuted.js +8 -4
  991. package/dist/lib/node_modules/xgplayer/es/plugins/assets/volumeSmall.js +8 -4
  992. package/dist/lib/node_modules/xgplayer/es/plugins/common/iconPlugin.js +4 -4
  993. package/dist/lib/node_modules/xgplayer/es/plugins/common/iconTools.js +6 -4
  994. package/dist/lib/node_modules/xgplayer/es/plugins/common/optionList.js +4 -4
  995. package/dist/lib/node_modules/xgplayer/es/plugins/common/optionsIcon.js +7 -4
  996. package/dist/lib/node_modules/xgplayer/es/plugins/common/thumbnail.js +4 -4
  997. package/dist/lib/node_modules/xgplayer/es/plugins/controls/index.js +12 -4
  998. package/dist/lib/node_modules/xgplayer/es/plugins/cssFullScreen/index.js +8 -4
  999. package/dist/lib/node_modules/xgplayer/es/plugins/definition/index.js +4 -4
  1000. package/dist/lib/node_modules/xgplayer/es/plugins/download/index.js +8 -4
  1001. package/dist/lib/node_modules/xgplayer/es/plugins/dynamicBg/index.js +5 -4
  1002. package/dist/lib/node_modules/xgplayer/es/plugins/enter/index.js +4 -4
  1003. package/dist/lib/node_modules/xgplayer/es/plugins/error/index.js +9 -4
  1004. package/dist/lib/node_modules/xgplayer/es/plugins/fpsDetect/index.js +4 -4
  1005. package/dist/lib/node_modules/xgplayer/es/plugins/fullscreen/backicon.js +5 -4
  1006. package/dist/lib/node_modules/xgplayer/es/plugins/fullscreen/index.js +8 -4
  1007. package/dist/lib/node_modules/xgplayer/es/plugins/gapJump/index.js +4 -4
  1008. package/dist/lib/node_modules/xgplayer/es/plugins/keyboard/index.js +4 -4
  1009. package/dist/lib/node_modules/xgplayer/es/plugins/loading/index.js +7 -4
  1010. package/dist/lib/node_modules/xgplayer/es/plugins/logger/index.js +4 -4
  1011. package/dist/lib/node_modules/xgplayer/es/plugins/miniScreen/index.js +16 -4
  1012. package/dist/lib/node_modules/xgplayer/es/plugins/miniScreen/miniScreenIcon.js +7 -4
  1013. package/dist/lib/node_modules/xgplayer/es/plugins/mobile/index.js +22 -4
  1014. package/dist/lib/node_modules/xgplayer/es/plugins/mobile/touch.js +4 -4
  1015. package/dist/lib/node_modules/xgplayer/es/plugins/pc/index.js +4 -4
  1016. package/dist/lib/node_modules/xgplayer/es/plugins/pip/index.js +11 -4
  1017. package/dist/lib/node_modules/xgplayer/es/plugins/play/index.js +8 -4
  1018. package/dist/lib/node_modules/xgplayer/es/plugins/playNext/index.js +10 -4
  1019. package/dist/lib/node_modules/xgplayer/es/plugins/playbackRate/index.js +4 -4
  1020. package/dist/lib/node_modules/xgplayer/es/plugins/poster/index.js +5 -4
  1021. package/dist/lib/node_modules/xgplayer/es/plugins/progress/index.js +10 -4
  1022. package/dist/lib/node_modules/xgplayer/es/plugins/progress/innerList.js +4 -4
  1023. package/dist/lib/node_modules/xgplayer/es/plugins/progress/miniProgress.js +7 -4
  1024. package/dist/lib/node_modules/xgplayer/es/plugins/progressPreview/dotsApi.js +4 -4
  1025. package/dist/lib/node_modules/xgplayer/es/plugins/progressPreview/index.js +14 -4
  1026. package/dist/lib/node_modules/xgplayer/es/plugins/prompt/index.js +6 -4
  1027. package/dist/lib/node_modules/xgplayer/es/plugins/replay/index.js +6 -4
  1028. package/dist/lib/node_modules/xgplayer/es/plugins/rotate/index.js +9 -4
  1029. package/dist/lib/node_modules/xgplayer/es/plugins/screenShot/index.js +9 -4
  1030. package/dist/lib/node_modules/xgplayer/es/plugins/start/index.js +7 -4
  1031. package/dist/lib/node_modules/xgplayer/es/plugins/stats/index.js +4 -4
  1032. package/dist/lib/node_modules/xgplayer/es/plugins/testspeed/index.js +4 -4
  1033. package/dist/lib/node_modules/xgplayer/es/plugins/time/index.js +9 -4
  1034. package/dist/lib/node_modules/xgplayer/es/plugins/time/timesegments.js +4 -4
  1035. package/dist/lib/node_modules/xgplayer/es/plugins/volume/index.js +14 -4
  1036. package/dist/lib/node_modules/xgplayer/es/plugins/waitingTimeoutJump/index.js +4 -4
  1037. package/dist/lib/node_modules/xgplayer/es/presets/default.js +4 -4
  1038. package/dist/lib/node_modules/xgplayer/es/state.js +4 -4
  1039. package/dist/lib/node_modules/xgplayer/es/stateClassMap.js +4 -4
  1040. package/dist/lib/node_modules/xgplayer/es/utils/database.js +4 -4
  1041. package/dist/lib/node_modules/xgplayer/es/utils/debug.js +4 -4
  1042. package/dist/lib/node_modules/xgplayer/es/utils/draggabilly.js +4 -4
  1043. package/dist/lib/node_modules/xgplayer/es/utils/sniffer.js +4 -4
  1044. package/dist/lib/node_modules/xgplayer/es/utils/util.js +4 -4
  1045. package/dist/lib/node_modules/xgplayer/es/utils/xgplayerTimeRange.js +4 -4
  1046. package/dist/lib/node_modules/xgplayer/es/version.js +4 -4
  1047. package/dist/lib/packages/components/index.js +4 -4
  1048. package/dist/lib/packages/hooks/dist/index.js +14 -0
  1049. package/dist/lib/packages/utils/dist/index.js +14 -0
  1050. package/dist/lib/styles/tokens.css +3 -3
  1051. package/package.json +27 -28
  1052. package/dist/es/node_modules/@tanstack/store/dist/esm/derived.js +0 -14
  1053. package/dist/es/node_modules/@tanstack/store/dist/esm/scheduler.js +0 -14
  1054. package/dist/lib/node_modules/@tanstack/store/dist/esm/derived.js +0 -14
  1055. package/dist/lib/node_modules/@tanstack/store/dist/esm/scheduler.js +0 -14
@@ -7,8 +7,3988 @@ You shall not disclose such Confidential Information and shall use it only in
7
7
  accordance with the terms of the license agreement.
8
8
 
9
9
  --- Build Info ---
10
- Version: 1.1.6
11
- Build Time: 2026/3/4 16:49:40
12
- Build Commit: 63f88fe7a59965e471017742b570179ac37f5591
10
+ Version: 1.1.8
11
+ Build Time: 2026/3/18 18:22:17
12
+ Build Commit: 44c48456c04c14c7d83e532658836e594a224593
13
13
  */
14
- import{findWrapping as t,canJoin as e,Transform as n,RemoveMarkStep as s,liftTarget as o,joinPoint as r,canSplit as i,ReplaceStep as a,ReplaceAroundStep as c}from"../../../prosemirror-transform/dist/index.js";import{createParagraphNear as l,deleteSelection as d,exitCode as p,joinUp as h,joinDown as u,joinBackward as m,joinForward as f,joinTextblockBackward as g,joinTextblockForward as v,lift as y,liftEmptyBlock as b,newlineInCode as w,selectNodeBackward as k,selectNodeForward as x,selectParentNode as M,selectTextblockEnd as E,selectTextblockStart as S,setBlockType as C,wrapIn as T}from"../../../prosemirror-commands/dist/index.js";import{NodeSelection as $,EditorState as O,Selection as A,TextSelection as z,Plugin as P,PluginKey as R,AllSelection as N}from"../../../prosemirror-state/dist/index.js";import{DOMSerializer as j,Schema as I,Fragment as D,Node as H,DOMParser as L,Slice as B}from"../../../prosemirror-model/dist/index.js";import{liftListItem as V,sinkListItem as W,wrapInList as U}from"../../../prosemirror-schema-list/dist/index.js";import{EditorView as _}from"../../../prosemirror-view/dist/index.js";import{keymap as F}from"../../../prosemirror-keymap/dist/index.js";var K=Object.defineProperty,q=(t,e)=>{for(var n in e)K(t,n,{get:e[n],enumerable:!0})};function J(t){const{state:e,transaction:n}=t;let{selection:s}=n,{doc:o}=n,{storedMarks:r}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return r},get selection(){return s},get doc(){return o},get tr(){return s=n.selection,o=n.doc,r=n.storedMarks,n}}}var Y=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:s}=e,{tr:o}=n,r=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,(...t)=>{const n=e(...t)(r);return o.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:s,state:o}=this,{view:r}=s,i=[],a=!!t,c=t||o.tr,l={...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>{const s=this.buildProps(c,e),o=n(...t)(s);return i.push(o),l}])),run:()=>(a||!e||c.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(c),i.every(t=>!0===t))};return l}createCan(t){const{rawCommands:e,state:n}=this,s=!1,o=t||n.tr,r=this.buildProps(o,s);return{...Object.fromEntries(Object.entries(e).map(([t,e])=>[t,(...t)=>e(...t)({...r,dispatch:void 0})])),chain:()=>this.createChain(o,s)}}buildProps(t,e=!0){const{rawCommands:n,editor:s,state:o}=this,{view:r}=s,i={tr:t,editor:s,view:r,state:J({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([t,e])=>[t,(...t)=>e(...t)(i)]))}};return i}},X={};q(X,{blur:()=>Z,clearContent:()=>Q,clearNodes:()=>G,command:()=>tt,createParagraphNear:()=>et,cut:()=>nt,deleteCurrentNode:()=>st,deleteNode:()=>rt,deleteRange:()=>it,deleteSelection:()=>at,enter:()=>ct,exitCode:()=>lt,extendMarkRange:()=>gt,first:()=>vt,focus:()=>Et,forEach:()=>St,insertContent:()=>Ct,insertContentAt:()=>zt,joinBackward:()=>Nt,joinDown:()=>Rt,joinForward:()=>jt,joinItemBackward:()=>It,joinItemForward:()=>Dt,joinTextblockBackward:()=>Ht,joinTextblockForward:()=>Lt,joinUp:()=>Pt,keyboardShortcut:()=>Vt,lift:()=>Ut,liftEmptyBlock:()=>_t,liftListItem:()=>Ft,newlineInCode:()=>Kt,resetAttributes:()=>Yt,scrollIntoView:()=>Xt,selectAll:()=>Zt,selectNodeBackward:()=>Qt,selectNodeForward:()=>Gt,selectParentNode:()=>te,selectTextblockEnd:()=>ee,selectTextblockStart:()=>ne,setContent:()=>oe,setMark:()=>Qe,setMeta:()=>Ge,setNode:()=>tn,setNodeSelection:()=>en,setTextDirection:()=>nn,setTextSelection:()=>sn,sinkListItem:()=>on,splitBlock:()=>an,splitListItem:()=>cn,toggleList:()=>pn,toggleMark:()=>hn,toggleNode:()=>un,toggleWrap:()=>mn,undoInputRule:()=>fn,unsetAllMarks:()=>gn,unsetMark:()=>vn,unsetTextDirection:()=>yn,updateAttributes:()=>bn,wrapIn:()=>wn,wrapInList:()=>kn});var Z=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),Q=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),G=()=>({state:t,tr:e,dispatch:n})=>{const{selection:s}=e,{ranges:r}=s;return!n||(r.forEach(({$from:n,$to:s})=>{t.doc.nodesBetween(n.pos,s.pos,(t,n)=>{if(t.type.isText)return;const{doc:s,mapping:r}=e,i=s.resolve(r.map(n)),a=s.resolve(r.map(n+t.nodeSize)),c=i.blockRange(a);if(!c)return;const l=o(c);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(c.start,t)}(l||0===l)&&e.lift(c,l)})}),!0)},tt=t=>e=>t(e),et=()=>({state:t,dispatch:e})=>l(t,e),nt=(t,e)=>({editor:n,tr:s})=>{const{state:o}=n,r=o.doc.slice(t.from,t.to);s.deleteRange(t.from,t.to);const i=s.mapping.map(e);return s.insert(i,r.content),s.setSelection(new z(s.doc.resolve(Math.max(i-1,0)))),!0},st=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,s=n.$anchor.node();if(s.content.size>0)return!1;const o=t.selection.$anchor;for(let r=o.depth;r>0;r-=1){if(o.node(r).type===s.type){if(e){const e=o.before(r),n=o.after(r);t.delete(e,n).scrollIntoView()}return!0}}return!1};function ot(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var rt=t=>({tr:e,state:n,dispatch:s})=>{const o=ot(t,n.schema),r=e.selection.$anchor;for(let t=r.depth;t>0;t-=1){if(r.node(t).type===o){if(s){const n=r.before(t),s=r.after(t);e.delete(n,s).scrollIntoView()}return!0}}return!1},it=t=>({tr:e,dispatch:n})=>{const{from:s,to:o}=t;return n&&e.delete(s,o),!0},at=()=>({state:t,dispatch:e})=>d(t,e),ct=()=>({commands:t})=>t.keyboardShortcut("Enter"),lt=()=>({state:t,dispatch:e})=>p(t,e);function dt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function pt(t,e,n={strict:!0}){const s=Object.keys(e);return!s.length||s.every(s=>n.strict?e[s]===t[s]:dt(e[s])?e[s].test(t[s]):e[s]===t[s])}function ht(t,e,n={}){return t.find(t=>t.type===e&&pt(Object.fromEntries(Object.keys(n).map(e=>[e,t.attrs[e]])),n))}function ut(t,e,n={}){return!!ht(t,e,n)}function mt(t,e,n){var s;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if(o.node&&o.node.marks.some(t=>t.type===e)||(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(t=>t.type===e))return;n=n||(null==(s=o.node.marks[0])?void 0:s.attrs);if(!ht([...o.node.marks],e,n))return;let r=o.index,i=t.start()+o.offset,a=r+1,c=i+o.node.nodeSize;for(;r>0&&ut([...t.parent.child(r-1).marks],e,n);)r-=1,i-=t.parent.child(r).nodeSize;for(;a<t.parent.childCount&&ut([...t.parent.child(a).marks],e,n);)c+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:c}}function ft(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var gt=(t,e={})=>({tr:n,state:s,dispatch:o})=>{const r=ft(t,s.schema),{doc:i,selection:a}=n,{$from:c,from:l,to:d}=a;if(o){const t=mt(c,r,e);if(t&&t.from<=l&&t.to>=d){const e=z.create(i,t.from,t.to);n.setSelection(e)}}return!0},vt=t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1};function yt(t){return t instanceof z}function bt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function wt(t,e=null){if(!e)return null;const n=A.atStart(t),s=A.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return s;const o=n.from,r=s.to;return"all"===e?z.create(t,bt(0,o,r),bt(t.content.size,o,r)):z.create(t,bt(e,o,r),bt(e,o,r))}function kt(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function xt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Mt(){return"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var Et=(t=null,e={})=>({editor:n,view:s,tr:o,dispatch:r})=>{e={scrollIntoView:!0,...e};const i=()=>{(xt()||kt())&&s.dom.focus(),!Mt()||xt()||kt()||s.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(s.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(s.hasFocus()&&null===t||!1===t)return!0}catch{return!1}if(r&&null===t&&!yt(n.state.selection))return i(),!0;const a=wt(o.doc,t)||n.state.selection,c=n.state.selection.eq(a);return r&&(c||o.setSelection(a),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},St=(t,e)=>n=>t.every((t,s)=>e(t,{...n,index:s})),Ct=(t,e)=>({tr:n,commands:s})=>s.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Tt=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const s=e[n];3===s.nodeType&&s.nodeValue&&/^(\n\s\s|\n)$/.test(s.nodeValue)?t.removeChild(s):1===s.nodeType&&Tt(s)}return t};function $t(t){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=(new window.DOMParser).parseFromString(e,"text/html").body;return Tt(n)}function Ot(t,e,n){if(t instanceof H||t instanceof D)return t;n={slice:!0,parseOptions:{},...n};const s="string"==typeof t;if("object"==typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return D.fromArray(t.map(t=>e.nodeFromJSON(t)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ot("",e,n)}if(s){if(n.errorOnInvalidContent){let s=!1,o="";const r=new I({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:t=>(s=!0,o="string"==typeof t?t:t.outerHTML,null)}]}})});if(n.slice?L.fromSchema(r).parseSlice($t(t),n.parseOptions):L.fromSchema(r).parse($t(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const s=L.fromSchema(e);return n.slice?s.parseSlice($t(t),n.parseOptions).content:s.parse($t(t),n.parseOptions)}return Ot("",e,n)}function At(t,e,n){const s=t.steps.length-1;if(s<e)return;const o=t.steps[s];if(!(o instanceof a||o instanceof c))return;const r=t.mapping.maps[s];let i=0;r.forEach((t,e,n,s)=>{0===i&&(i=s)}),t.setSelection(A.near(t.doc.resolve(i),n))}var zt=(t,e,n)=>({tr:s,dispatch:o,editor:r})=>{var i;if(o){let o;const c=t=>{r.emit("contentError",{editor:r,error:t,disableCollaboration:()=>{"collaboration"in r.storage&&"object"==typeof r.storage.collaboration&&r.storage.collaboration&&(r.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:r.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!r.options.enableContentCheck&&r.options.emitContentError)try{Ot(e,r.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(a){c(a)}try{o=Ot(e,r.schema,{parseOptions:l,errorOnInvalidContent:null!=(i=n.errorOnInvalidContent)?i:r.options.enableContentCheck})}catch(a){return c(a),!1}let{from:d,to:p}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},h=!0,u=!0;if(("type"in o?[o]:o).forEach(t=>{t.check(),h=!!h&&(t.isText&&0===t.marks.length),u=!!u&&t.isBlock}),d===p&&u){const{parent:t}=s.doc.resolve(d);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(d-=1,p+=1)}let m;if(h){if(Array.isArray(e))m=e.map(t=>t.text||"").join("");else if(e instanceof D){let t="";e.forEach(e=>{e.text&&(t+=e.text)}),m=t}else m="object"==typeof e&&e&&e.text?e.text:e;s.insertText(m,d,p)}else{m=o;const t=s.doc.resolve(d),e=t.node(),n=0===t.parentOffset,r=e.isText||e.isTextblock,i=e.content.size>0;n&&r&&i&&(d=Math.max(0,d-1)),s.replaceWith(d,p,m)}n.updateSelection&&At(s,s.steps.length-1,-1),n.applyInputRules&&s.setMeta("applyInputRules",{from:d,text:m}),n.applyPasteRules&&s.setMeta("applyPasteRules",{from:d,text:m})}return!0},Pt=()=>({state:t,dispatch:e})=>h(t,e),Rt=()=>({state:t,dispatch:e})=>u(t,e),Nt=()=>({state:t,dispatch:e})=>m(t,e),jt=()=>({state:t,dispatch:e})=>f(t,e),It=()=>({state:t,dispatch:e,tr:n})=>{try{const s=r(t.doc,t.selection.$from.pos,-1);return null!=s&&(n.join(s,2),e&&e(n),!0)}catch{return!1}},Dt=()=>({state:t,dispatch:e,tr:n})=>{try{const s=r(t.doc,t.selection.$from.pos,1);return null!=s&&(n.join(s,2),e&&e(n),!0)}catch{return!1}},Ht=()=>({state:t,dispatch:e})=>g(t,e),Lt=()=>({state:t,dispatch:e})=>v(t,e);function Bt(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Vt=t=>({editor:e,view:n,tr:s,dispatch:o})=>{const r=function(t){const e=t.split(/-(?!$)/);let n,s,o,r,i=e[e.length-1];"Space"===i&&(i=" ");for(let a=0;a<e.length-1;a+=1){const t=e[a];if(/^(cmd|meta|m)$/i.test(t))r=!0;else if(/^a(lt)?$/i.test(t))n=!0;else if(/^(c|ctrl|control)$/i.test(t))s=!0;else if(/^s(hift)?$/i.test(t))o=!0;else{if(!/^mod$/i.test(t))throw new Error(`Unrecognized modifier name: ${t}`);xt()||Bt()?r=!0:s=!0}}return n&&(i=`Alt-${i}`),s&&(i=`Ctrl-${i}`),r&&(i=`Meta-${i}`),o&&(i=`Shift-${i}`),i}(t).split(/-(?!$)/),i=r.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),a=new KeyboardEvent("keydown",{key:"Space"===i?" ":i,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",t=>t(n,a))});return null==c||c.steps.forEach(t=>{const e=t.map(s.mapping);e&&o&&s.maybeStep(e)}),!0};function Wt(t,e,n={}){const{from:s,to:o,empty:r}=t.selection,i=e?ot(e,t.schema):null,a=[];t.doc.nodesBetween(s,o,(t,e)=>{if(t.isText)return;const n=Math.max(s,e),r=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:r})});const c=o-s,l=a.filter(t=>!i||i.name===t.node.type.name).filter(t=>pt(t.node.attrs,n,{strict:!1}));if(r)return!!l.length;return l.reduce((t,e)=>t+e.to-e.from,0)>=c}var Ut=(t,e={})=>({state:n,dispatch:s})=>!!Wt(n,ot(t,n.schema),e)&&y(n,s),_t=()=>({state:t,dispatch:e})=>b(t,e),Ft=t=>({state:e,dispatch:n})=>{const s=ot(t,e.schema);return V(s)(e,n)},Kt=()=>({state:t,dispatch:e})=>w(t,e);function qt(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Jt(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce((e,s)=>(n.includes(s)||(e[s]=t[s]),e),{})}var Yt=(t,e)=>({tr:n,state:s,dispatch:o})=>{let r=null,i=null;const a=qt("string"==typeof t?t:t.name,s.schema);if(!a)return!1;"node"===a&&(r=ot(t,s.schema)),"mark"===a&&(i=ft(t,s.schema));let c=!1;return n.selection.ranges.forEach(t=>{s.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,s)=>{r&&r===t.type&&(c=!0,o&&n.setNodeMarkup(s,void 0,Jt(t.attrs,e))),i&&t.marks.length&&t.marks.forEach(r=>{i===r.type&&(c=!0,o&&n.addMark(s,s+t.nodeSize,i.create(Jt(r.attrs,e))))})})}),c},Xt=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Zt=()=>({tr:t,dispatch:e})=>{if(e){const e=new N(t.doc);t.setSelection(e)}return!0},Qt=()=>({state:t,dispatch:e})=>k(t,e),Gt=()=>({state:t,dispatch:e})=>x(t,e),te=()=>({state:t,dispatch:e})=>M(t,e),ee=()=>({state:t,dispatch:e})=>E(t,e),ne=()=>({state:t,dispatch:e})=>S(t,e);function se(t,e,n={},s={}){return Ot(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:s.errorOnInvalidContent})}var oe=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:s={}}={})=>({editor:o,tr:r,dispatch:i,commands:a})=>{const{doc:c}=r;if("full"!==s.preserveWhitespace){const a=se(t,o.schema,s,{errorOnInvalidContent:null!=e?e:o.options.enableContentCheck});return i&&r.replaceWith(0,c.content.size,a).setMeta("preventUpdate",!n),!0}return i&&r.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:s,errorOnInvalidContent:null!=e?e:o.options.enableContentCheck})};function re(t,e){const n=ft(e,t.schema),{from:s,to:o,empty:r}=t.selection,i=[];r?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(s,o,t=>{i.push(...t.marks)});const a=i.find(t=>t.type.name===n.name);return a?{...a.attrs}:{}}function ie(t,e){const s=new n(t);return e.forEach(t=>{t.steps.forEach(t=>{s.step(t)})}),s}function ae(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ce(t,e,n){const s=[];return t.nodesBetween(e.from,e.to,(t,e)=>{n(t)&&s.push({node:t,pos:e})}),s}function le(t,e){for(let n=t.depth;n>0;n-=1){const s=t.node(n);if(e(s))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:s}}}function de(t){return e=>le(e.$from,t)}function pe(t,e,n){if(void 0===t.config[e]&&t.parent)return pe(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?pe(t.parent,e,n):null})}return t.config[e]}function he(t){return t.map(t=>{const e=pe(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...he(e())]:t}).flat(10)}function ue(t,e){const n=j.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function me(t){return"function"==typeof t}function fe(t,e=void 0,...n){return me(t)?e?t.bind(e)(...n):t(...n):t}function ge(t={}){return 0===Object.keys(t).length&&t.constructor===Object}function ve(t){return{baseExtensions:t.filter(t=>"extension"===t.type),nodeExtensions:t.filter(t=>"node"===t.type),markExtensions:t.filter(t=>"mark"===t.type)}}function ye(t){const e=[],{nodeExtensions:n,markExtensions:s}=ve(t),o=[...n,...s],r={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},i=n.filter(t=>"text"!==t.name).map(t=>t.name),a=s.map(t=>t.name),c=[...i,...a];return t.forEach(t=>{const n=pe(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:o});if(!n)return;n().forEach(t=>{let n;n=Array.isArray(t.types)?t.types:"*"===t.types?c:"nodes"===t.types?i:"marks"===t.types?a:[],n.forEach(n=>{Object.entries(t.attributes).forEach(([t,s])=>{e.push({type:n,name:t,attribute:{...r,...s}})})})})}),o.forEach(t=>{const n={name:t.name,options:t.options,storage:t.storage},s=pe(t,"addAttributes",n);if(!s)return;const o=s();Object.entries(o).forEach(([n,s])=>{const o={...r,...s};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,e.push({type:t.name,name:n,attribute:o})})}),e}function be(...t){return t.filter(t=>!!t).reduce((t,e)=>{const n={...t};return Object.entries(e).forEach(([t,e])=>{if(n[t])if("class"===t){const s=e?String(e).split(" "):[],o=n[t]?n[t].split(" "):[],r=s.filter(t=>!o.includes(t));n[t]=[...o,...r].join(" ")}else if("style"===t){const s=e?e.split(";").map(t=>t.trim()).filter(Boolean):[],o=n[t]?n[t].split(";").map(t=>t.trim()).filter(Boolean):[],r=/* @__PURE__ */new Map;o.forEach(t=>{const[e,n]=t.split(":").map(t=>t.trim());r.set(e,n)}),s.forEach(t=>{const[e,n]=t.split(":").map(t=>t.trim());r.set(e,n)}),n[t]=Array.from(r.entries()).map(([t,e])=>`${t}: ${e}`).join("; ")}else n[t]=e;else n[t]=e}),n},{})}function we(t,e){return e.filter(e=>e.type===t.type.name).filter(t=>t.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]}).reduce((t,e)=>be(t,e),{})}function ke(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}function xe(t,e){return"style"in t?t:{...t,getAttrs:n=>{const s=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===s)return!1;const o=e.reduce((t,e)=>{const s=e.attribute.parseHTML?e.attribute.parseHTML(n):ke(n.getAttribute(e.name));return null==s?t:{...t,[e.name]:s}},{});return{...s,...o}}}}function Me(t){return Object.fromEntries(Object.entries(t).filter(([t,e])=>("attrs"!==t||!ge(e))&&null!=e))}function Ee(t){var e,n;const s={};return!(null==(e=null==t?void 0:t.attribute)?void 0:e.isRequired)&&"default"in((null==t?void 0:t.attribute)||{})&&(s.default=t.attribute.default),void 0!==(null==(n=null==t?void 0:t.attribute)?void 0:n.validate)&&(s.validate=t.attribute.validate),[t.name,s]}function Se(t,e){var n;const s=ye(t),{nodeExtensions:o,markExtensions:r}=ve(t),i=null==(n=o.find(t=>pe(t,"topNode")))?void 0:n.name,a=Object.fromEntries(o.map(n=>{const o=s.filter(t=>t.type===n.name),r={name:n.name,options:n.options,storage:n.storage,editor:e},i=Me({...t.reduce((t,e)=>{const s=pe(e,"extendNodeSchema",r);return{...t,...s?s(n):{}}},{}),content:fe(pe(n,"content",r)),marks:fe(pe(n,"marks",r)),group:fe(pe(n,"group",r)),inline:fe(pe(n,"inline",r)),atom:fe(pe(n,"atom",r)),selectable:fe(pe(n,"selectable",r)),draggable:fe(pe(n,"draggable",r)),code:fe(pe(n,"code",r)),whitespace:fe(pe(n,"whitespace",r)),linebreakReplacement:fe(pe(n,"linebreakReplacement",r)),defining:fe(pe(n,"defining",r)),isolating:fe(pe(n,"isolating",r)),attrs:Object.fromEntries(o.map(Ee))}),a=fe(pe(n,"parseHTML",r));a&&(i.parseDOM=a.map(t=>xe(t,o)));const c=pe(n,"renderHTML",r);c&&(i.toDOM=t=>c({node:t,HTMLAttributes:we(t,o)}));const l=pe(n,"renderText",r);return l&&(i.toText=l),[n.name,i]})),c=Object.fromEntries(r.map(n=>{const o=s.filter(t=>t.type===n.name),r={name:n.name,options:n.options,storage:n.storage,editor:e},i=Me({...t.reduce((t,e)=>{const s=pe(e,"extendMarkSchema",r);return{...t,...s?s(n):{}}},{}),inclusive:fe(pe(n,"inclusive",r)),excludes:fe(pe(n,"excludes",r)),group:fe(pe(n,"group",r)),spanning:fe(pe(n,"spanning",r)),code:fe(pe(n,"code",r)),attrs:Object.fromEntries(o.map(Ee))}),a=fe(pe(n,"parseHTML",r));a&&(i.parseDOM=a.map(t=>xe(t,o)));const c=pe(n,"renderHTML",r);return c&&(i.toDOM=t=>c({mark:t,HTMLAttributes:we(t,o)})),[n.name,i]}));return new I({topNode:i,nodes:a,marks:c})}function Ce(t){const e=t.filter((e,n)=>t.indexOf(e)!==n);return Array.from(new Set(e))}function Te(t){return t.sort((t,e)=>{const n=pe(t,"priority")||100,s=pe(e,"priority")||100;return n>s?-1:n<s?1:0})}function $e(t){const e=Te(he(t)),n=Ce(e.map(t=>t.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),e}function Oe(t,e,n){const{from:s,to:o}=e,{blockSeparator:r="\n\n",textSerializers:i={}}=n||{};let a="";return t.nodesBetween(s,o,(t,n,c,l)=>{var d;t.isBlock&&n>s&&(a+=r);const p=null==i?void 0:i[t.type.name];if(p)return c&&(a+=p({node:t,pos:n,parent:c,index:l,range:e})),!1;t.isText&&(a+=null==(d=null==t?void 0:t.text)?void 0:d.slice(Math.max(s,n)-n,o-n))}),a}function Ae(t,e){return Oe(t,{from:0,to:t.content.size},e)}function ze(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}function Pe(t,e){const n=ot(e,t.schema),{from:s,to:o}=t.selection,r=[];t.doc.nodesBetween(s,o,t=>{r.push(t)});const i=r.reverse().find(t=>t.type.name===n.name);return i?{...i.attrs}:{}}function Re(t,e){const n=qt("string"==typeof e?e:e.name,t.schema);return"node"===n?Pe(t,e):"mark"===n?re(t,e):{}}function Ne(t,e=JSON.stringify){const n={};return t.filter(t=>{const s=e(t);return!Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=!0)})}function je(t){const{mapping:e,steps:n}=t,s=[];return e.maps.forEach((t,o)=>{const r=[];if(t.ranges.length)t.forEach((t,e)=>{r.push({from:t,to:e})});else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;r.push({from:t,to:e})}r.forEach(({from:t,to:n})=>{const r=e.slice(o).map(t,-1),i=e.slice(o).map(n),a=e.invert().map(r,-1),c=e.invert().map(i);s.push({oldRange:{from:a,to:c},newRange:{from:r,to:i}})})}),function(t){const e=Ne(t);return 1===e.length?e:e.filter((t,n)=>!e.filter((t,e)=>e!==n).some(e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}(s)}function Ie(t,e,n){const s=[];return t===e?n.resolve(t).marks().forEach(e=>{const o=mt(n.resolve(t),e.type);o&&s.push({mark:e,...o})}):n.nodesBetween(t,e,(t,e)=>{t&&void 0!==(null==t?void 0:t.nodeSize)&&s.push(...t.marks.map(n=>({from:e,to:e+t.nodeSize,mark:n})))}),s}var De=(t,e,n,s=20)=>{const o=t.doc.resolve(n);let r=s,i=null;for(;r>0&&null===i;){const t=o.node(r);(null==t?void 0:t.type.name)===e?i=t:r-=1}return[i,r]};function He(t,e){return e.nodes[t]||e.marks[t]||null}function Le(t,e,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const s=t.find(t=>t.type===e&&t.name===n);return!!s&&s.attribute.keepOnSplit}))}var Be=(t,e=500)=>{let n="";const s=t.parentOffset;return t.parent.nodesBetween(Math.max(0,s-e),s,(t,e,o,r)=>{var i,a;const c=(null==(a=(i=t.type.spec).toText)?void 0:a.call(i,{node:t,pos:e,parent:o,index:r}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?c:c.slice(0,Math.max(0,s-e))}),n};function Ve(t,e,n={}){const{empty:s,ranges:o}=t.selection,r=e?ft(e,t.schema):null;if(s)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!r||r.name===t.type.name).find(t=>pt(t.attrs,n,{strict:!1}));let i=0;const a=[];if(o.forEach(({$from:e,$to:n})=>{const s=e.pos,o=n.pos;t.doc.nodesBetween(s,o,(t,e)=>{if(r&&t.inlineContent&&!t.type.allowsMarkType(r))return!1;if(!t.isText&&!t.marks.length)return;const n=Math.max(s,e),c=Math.min(o,e+t.nodeSize);i+=c-n,a.push(...t.marks.map(t=>({mark:t,from:n,to:c})))})}),0===i)return!1;const c=a.filter(t=>!r||r.name===t.mark.type.name).filter(t=>pt(t.mark.attrs,n,{strict:!1})).reduce((t,e)=>t+e.to-e.from,0),l=a.filter(t=>!r||t.mark.type!==r&&t.mark.type.excludes(r)).reduce((t,e)=>t+e.to-e.from,0);return(c>0?c+l:c)>=i}function We(t,e,n={}){if(!e)return Wt(t,null,n)||Ve(t,null,n);const s=qt(e,t.schema);return"node"===s?Wt(t,e,n):"mark"===s&&Ve(t,e,n)}var Ue=(t,e)=>{const{$from:n,$to:s,$anchor:o}=t.selection;if(e){const n=de(t=>t.type.name===e)(t.selection);if(!n)return!1;const s=t.doc.resolve(n.pos+1);return o.pos+1===s.end()}return!(s.parentOffset<s.parent.nodeSize-2||n.pos!==s.pos)},_e=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Fe(t,e){return Array.isArray(e)?e.some(e=>("string"==typeof e?e:e.name)===t.name):e}function Ke(t,e){const{nodeExtensions:n}=ve(e),s=n.find(e=>e.name===t);if(!s)return!1;const o=fe(pe(s,"group",{name:s.name,options:s.options,storage:s.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function qe(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var s;if(n){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!=(s=t.text)?s:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(e){let s=!0;return t.content.forEach(t=>{!1!==s&&(qe(t,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function Je(t){return t instanceof $}var Ye=class t{constructor(t){this.position=t}static fromJSON(e){return new t(e.position)}toJSON(){return{position:this.position}}};function Xe(t,e){const n=e.mapping.mapResult(t.position);return{position:new Ye(n.pos),mapResult:n}}function Ze(t){return new Ye(t)}var Qe=(t,e={})=>({tr:n,state:s,dispatch:o})=>{const{selection:r}=n,{empty:i,ranges:a}=r,c=ft(t,s.schema);if(o)if(i){const t=re(s,c);n.addStoredMark(c.create({...t,...e}))}else a.forEach(t=>{const o=t.$from.pos,r=t.$to.pos;s.doc.nodesBetween(o,r,(t,s)=>{const i=Math.max(s,o),a=Math.min(s+t.nodeSize,r);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&n.addMark(i,a,c.create({...t.attrs,...e}))}):n.addMark(i,a,c.create(e))})});return function(t,e,n){var s;const{selection:o}=e;let r=null;if(yt(o)&&(r=o.$cursor),r){const e=null!=(s=t.storedMarks)?s:r.marks();return r.parent.type.allowsMarkType(n)&&(!!n.isInSet(e)||!e.some(t=>t.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:e,$to:s})=>{let o=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,s.pos,(t,e,s)=>{if(o)return!1;if(t.isInline){const e=!s||s.type.allowsMarkType(n),r=!!n.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(n));o=e&&r}return!o}),o})}(s,n,c)},Ge=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),tn=(t,e={})=>({state:n,dispatch:s,chain:o})=>{const r=ot(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),r.isTextblock?o().command(({commands:t})=>!!C(r,{...i,...e})(n)||t.clearNodes()).command(({state:t})=>C(r,{...i,...e})(t,s)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},en=t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,s=bt(t,0,n.content.size),o=$.create(n,s);e.setSelection(o)}return!0},nn=(t,e)=>({tr:n,state:s,dispatch:o})=>{const{selection:r}=s;let i,a;return"number"==typeof e?(i=e,a=e):e&&"from"in e&&"to"in e?(i=e.from,a=e.to):(i=r.from,a=r.to),o&&n.doc.nodesBetween(i,a,(e,s)=>{e.isText||n.setNodeMarkup(s,void 0,{...e.attrs,dir:t})}),!0},sn=t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:s,to:o}="number"==typeof t?{from:t,to:t}:t,r=z.atStart(n).from,i=z.atEnd(n).to,a=bt(s,r,i),c=bt(o,r,i),l=z.create(n,a,c);e.setSelection(l)}return!0},on=t=>({state:e,dispatch:n})=>{const s=ot(t,e.schema);return W(s)(e,n)};function rn(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const s=n.filter(t=>null==e?void 0:e.includes(t.type.name));t.tr.ensureMarks(s)}}var an=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:s,editor:o})=>{const{selection:r,doc:a}=e,{$from:c,$to:l}=r,d=Le(o.extensionManager.attributes,c.node().type.name,c.node().attrs);if(r instanceof $&&r.node.isBlock)return!(!c.parentOffset||!i(a,c.pos))&&(s&&(t&&rn(n,o.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const p=l.parentOffset===l.parent.content.size,h=0===c.depth?void 0:ae(c.node(-1).contentMatchAt(c.indexAfter(-1)));let u=p&&h?[{type:h,attrs:d}]:void 0,m=i(e.doc,e.mapping.map(c.pos),1,u);if(u||m||!i(e.doc,e.mapping.map(c.pos),1,h?[{type:h}]:void 0)||(m=!0,u=h?[{type:h,attrs:d}]:void 0),s){if(m&&(r instanceof z&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,u),h&&!p&&!c.parentOffset&&c.parent.type!==h)){const t=e.mapping.map(c.before()),n=e.doc.resolve(t);c.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&e.setNodeMarkup(e.mapping.map(c.before()),h)}t&&rn(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},cn=(t,e={})=>({tr:n,state:s,dispatch:o,editor:r})=>{var a;const c=ot(t,s.schema),{$from:l,$to:d}=s.selection,p=s.selection.node;if(p&&p.isBlock||l.depth<2||!l.sameParent(d))return!1;const h=l.node(-1);if(h.type!==c)return!1;const u=r.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==c||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let t=D.empty;const s=l.index(-1)?1:l.index(-2)?2:3;for(let e=l.depth-s;e>=l.depth-3;e-=1)t=D.from(l.node(e).copy(t));const o=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,r={...Le(u,l.node().type.name,l.node().attrs),...e},i=(null==(a=c.contentMatch.defaultType)?void 0:a.createAndFill(r))||void 0;t=t.append(D.from(c.createAndFill(null,i)||void 0));const d=l.before(l.depth-(s-1));n.replace(d,l.after(-o),new B(t,4-s,0));let p=-1;n.doc.nodesBetween(d,n.doc.content.size,(t,e)=>{if(p>-1)return!1;t.isTextblock&&0===t.content.size&&(p=e+1)}),p>-1&&n.setSelection(z.near(n.doc.resolve(p))),n.scrollIntoView()}return!0}const m=d.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...Le(u,h.type.name,h.attrs),...e},g={...Le(u,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,d.pos);const v=m?[{type:c,attrs:f},{type:m,attrs:g}]:[{type:c,attrs:f}];if(!i(n.doc,l.pos,2))return!1;if(o){const{selection:t,storedMarks:e}=s,{splittableMarks:i}=r.extensionManager,a=e||t.$to.parentOffset&&t.$from.marks();if(n.split(l.pos,2,v).scrollIntoView(),!a||!o)return!0;const c=a.filter(t=>i.includes(t.type.name));n.ensureMarks(c)}return!0},ln=(t,n)=>{const s=de(t=>t.type===n)(t.selection);if(!s)return!0;const o=t.doc.resolve(Math.max(0,s.pos-1)).before(s.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return s.node.type!==(null==r?void 0:r.type)||!e(t.doc,s.pos)||(t.join(s.pos),!0)},dn=(t,n)=>{const s=de(t=>t.type===n)(t.selection);if(!s)return!0;const o=t.doc.resolve(s.start).after(s.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return s.node.type!==(null==r?void 0:r.type)||!e(t.doc,o)||(t.join(o),!0)},pn=(t,e,n,s={})=>({editor:o,tr:r,state:i,dispatch:a,chain:c,commands:l,can:d})=>{const{extensions:p,splittableMarks:h}=o.extensionManager,u=ot(t,i.schema),m=ot(e,i.schema),{selection:f,storedMarks:g}=i,{$from:v,$to:y}=f,b=v.blockRange(y),w=g||f.$to.parentOffset&&f.$from.marks();if(!b)return!1;const k=de(t=>Ke(t.type.name,p))(f);if(b.depth>=1&&k&&b.depth-k.depth<=1){if(k.node.type===u)return l.liftListItem(m);if(Ke(k.node.type.name,p)&&u.validContent(k.node.content)&&a)return c().command(()=>(r.setNodeMarkup(k.pos,u),!0)).command(()=>ln(r,u)).command(()=>dn(r,u)).run()}return n&&w&&a?c().command(()=>{const t=d().wrapInList(u,s),e=w.filter(t=>h.includes(t.type.name));return r.ensureMarks(e),!!t||l.clearNodes()}).wrapInList(u,s).command(()=>ln(r,u)).command(()=>dn(r,u)).run():c().command(()=>!!d().wrapInList(u,s)||l.clearNodes()).wrapInList(u,s).command(()=>ln(r,u)).command(()=>dn(r,u)).run()},hn=(t,e={},n={})=>({state:s,commands:o})=>{const{extendEmptyMarkRange:r=!1}=n,i=ft(t,s.schema);return Ve(s,i,e)?o.unsetMark(i,{extendEmptyMarkRange:r}):o.setMark(i,e)},un=(t,e,n={})=>({state:s,commands:o})=>{const r=ot(t,s.schema),i=ot(e,s.schema),a=Wt(s,r,n);let c;return s.selection.$anchor.sameParent(s.selection.$head)&&(c=s.selection.$anchor.parent.attrs),a?o.setNode(i,c):o.setNode(r,{...c,...n})},mn=(t,e={})=>({state:n,commands:s})=>{const o=ot(t,n.schema);return Wt(n,o,e)?s.lift(o):s.wrapIn(o,e)},fn=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let s=0;s<n.length;s+=1){const o=n[s];let r;if(o.spec.isInputRules&&(r=o.getState(t))){if(e){const e=t.tr,n=r.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(r.text){const n=e.doc.resolve(r.from).marks();e.replaceWith(r.from,r.to,t.schema.text(r.text,n))}else e.delete(r.from,r.to)}return!0}}return!1},gn=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:s,ranges:o}=n;return s||e&&o.forEach(e=>{t.removeMark(e.$from.pos,e.$to.pos)}),!0},vn=(t,e={})=>({tr:n,state:s,dispatch:o})=>{var r;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,c=ft(t,s.schema),{$from:l,empty:d,ranges:p}=a;if(!o)return!0;if(d&&i){let{from:t,to:e}=a;const s=null==(r=l.marks().find(t=>t.type===c))?void 0:r.attrs,o=mt(l,c,s);o&&(t=o.from,e=o.to),n.removeMark(t,e,c)}else p.forEach(t=>{n.removeMark(t.$from.pos,t.$to.pos,c)});return n.removeStoredMark(c),!0},yn=t=>({tr:e,state:n,dispatch:s})=>{const{selection:o}=n;let r,i;return"number"==typeof t?(r=t,i=t):t&&"from"in t&&"to"in t?(r=t.from,i=t.to):(r=o.from,i=o.to),s&&e.doc.nodesBetween(r,i,(t,n)=>{if(t.isText)return;const s={...t.attrs};delete s.dir,e.setNodeMarkup(n,void 0,s)}),!0},bn=(t,e={})=>({tr:n,state:s,dispatch:o})=>{let r=null,i=null;const a=qt("string"==typeof t?t:t.name,s.schema);if(!a)return!1;"node"===a&&(r=ot(t,s.schema)),"mark"===a&&(i=ft(t,s.schema));let c=!1;return n.selection.ranges.forEach(t=>{const a=t.$from.pos,l=t.$to.pos;let d,p,h,u;n.selection.empty?s.doc.nodesBetween(a,l,(t,e)=>{r&&r===t.type&&(c=!0,h=Math.max(e,a),u=Math.min(e+t.nodeSize,l),d=e,p=t)}):s.doc.nodesBetween(a,l,(t,s)=>{s<a&&r&&r===t.type&&(c=!0,h=Math.max(s,a),u=Math.min(s+t.nodeSize,l),d=s,p=t),s>=a&&s<=l&&(r&&r===t.type&&(c=!0,o&&n.setNodeMarkup(s,void 0,{...t.attrs,...e})),i&&t.marks.length&&t.marks.forEach(r=>{if(i===r.type&&(c=!0,o)){const o=Math.max(s,a),c=Math.min(s+t.nodeSize,l);n.addMark(o,c,i.create({...r.attrs,...e}))}}))}),p&&(void 0!==d&&o&&n.setNodeMarkup(d,void 0,{...p.attrs,...e}),i&&p.marks.length&&p.marks.forEach(t=>{i===t.type&&o&&n.addMark(h,u,i.create({...t.attrs,...e}))}))}),c},wn=(t,e={})=>({state:n,dispatch:s})=>{const o=ot(t,n.schema);return T(o,e)(n,s)},kn=(t,e={})=>({state:n,dispatch:s})=>{const o=ot(t,n.schema);return U(o,e)(n,s)},xn=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(t=>t.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(t=>t!==e):delete this.callbacks[t]),this}once(t,e){const n=(...s)=>{this.off(t,n),e.apply(this,s)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Mn=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=null==(e=t.undoable)||e}};function En(t){var e;const{editor:n,from:s,to:o,text:r,rules:i,plugin:a}=t,{view:c}=n;if(c.composing)return!1;const l=c.state.doc.resolve(s);if(l.parent.type.spec.code||(null==(e=l.nodeBefore||l.nodeAfter)?void 0:e.marks.find(t=>t.type.spec.code)))return!1;let d=!1;const p=Be(l)+r;return i.forEach(t=>{if(d)return;const e=((t,e)=>{if(dt(e))return e.exec(t);const n=e(t);if(!n)return null;const s=[n.text];return s.index=n.index,s.input=t,s.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),s.push(n.replaceWith)),s})(p,t.find);if(!e)return;const i=c.state.tr,l=J({state:c.state,transaction:i}),h={from:s-(e[0].length-r.length),to:o},{commands:u,chain:m,can:f}=new Y({editor:n,state:l});null!==t.handler({state:l,range:h,match:e,commands:u,chain:m,can:f})&&i.steps.length&&(t.undoable&&i.setMeta(a,{transform:i,from:s,to:o,text:r}),c.dispatch(i),d=!0)}),d}function Sn(t){const{editor:e,rules:n}=t,s=new P({state:{init:()=>null,apply(t,o,r){const i=t.getMeta(s);if(i)return i;const a=t.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:t}=a;"string"==typeof t||(t=ue(D.from(t),r.schema));const{from:o}=a,i=o+t.length;En({editor:e,from:o,to:i,text:t,rules:n,plugin:s})}),t.selectionSet||t.docChanged?null:o}},props:{handleTextInput:(t,o,r,i)=>En({editor:e,from:o,to:r,text:i,rules:n,plugin:s}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{const{$cursor:o}=t.state.selection;o&&En({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:s})}),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:r}=t.state.selection;return!!r&&En({editor:e,from:r.pos,to:r.pos,text:"\n",rules:n,plugin:s})}},isInputRules:!0});return s}function Cn(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function Tn(t,e){const n={...t};return Cn(t)&&Cn(e)&&Object.keys(e).forEach(s=>{Cn(e[s])&&Cn(t[s])?n[s]=Tn(t[s],e[s]):n[s]=e[s]}),n}var $n=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...fe(pe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...fe(pe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Tn(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},On=class t extends $n{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n="function"==typeof e?e():e;return new t(n)}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,s=t.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(t=>(null==t?void 0:t.type.name)===e.name))return!1;const r=o.find(t=>(null==t?void 0:t.type.name)===e.name);return r&&n.removeStoredMark(r),n.insertText(" ",s.pos),t.view.dispatch(n),!0}return!1}configure(t){return super.configure(t)}extend(t){const e="function"==typeof t?t():t;return super.extend(e)}};function An(t){return"number"==typeof t}var zn=class{constructor(t){this.find=t.find,this.handler=t.handler}};function Pn(t){const{editor:e,state:n,from:s,to:o,rule:r,pasteEvent:i,dropEvent:a}=t,{commands:c,chain:l,can:d}=new Y({editor:e,state:n}),p=[];n.doc.nodesBetween(s,o,(t,e)=>{var h,u,m,f,g;if((null==(u=null==(h=t.type)?void 0:h.spec)?void 0:u.code)||!(t.isText||t.isTextblock||t.isInline))return;const v=null!=(g=null!=(f=null==(m=t.content)?void 0:m.size)?f:t.nodeSize)?g:0,y=Math.max(s,e),b=Math.min(o,e+v);if(y>=b)return;((t,e,n)=>{if(dt(e))return[...t.matchAll(e)];const s=e(t,n);return s?s.map(e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n}):[]})(t.isText?t.text||"":t.textBetween(y-e,b-e,void 0,""),r.find,i).forEach(t=>{if(void 0===t.index)return;const e=y+t.index+1,s=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(s)},h=r.handler({state:n,range:o,match:t,commands:c,chain:l,can:d,pasteEvent:i,dropEvent:a});p.push(h)})});return p.every(t=>null!==t)}var Rn=null;function Nn(t){const{editor:e,rules:n}=t;let s,o=null,r=!1,i=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{s="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{s=null}const c=({state:t,from:n,to:o,rule:r,pasteEvt:i})=>{const c=t.tr,l=J({state:t,transaction:c});if(Pn({editor:e,state:l,from:Math.max(n-1,0),to:o.b-1,rule:r,pasteEvent:i,dropEvent:s})&&c.steps.length){try{s="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{s=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,c}};return n.map(t=>new P({view(t){const n=n=>{var s;o=(null==(s=t.dom.parentElement)?void 0:s.contains(n.target))?t.dom.parentElement:null,o&&(Rn=e)},s=()=>{Rn&&(Rn=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",s),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",s)}}},props:{handleDOMEvents:{drop:(t,e)=>{if(i=o===t.dom.parentElement,s=e,!i){const t=Rn;(null==t?void 0:t.isEditable)&&setTimeout(()=>{const e=t.state.selection;e&&t.commands.deleteRange({from:e.from,to:e.to})},10)}return!1},paste:(t,e)=>{var n;const s=null==(n=e.clipboardData)?void 0:n.getData("text/html");return a=e,r=!!(null==s?void 0:s.includes("data-pm-slice")),!1}}},appendTransaction:(e,n,s)=>{const o=e[0],l="paste"===o.getMeta("uiEvent")&&!r,d="drop"===o.getMeta("uiEvent")&&!i,p=o.getMeta("applyPasteRules"),h=!!p;if(!l&&!d&&!h)return;if(h){let{text:e}=p;"string"==typeof e||(e=ue(D.from(e),s.schema));const{from:n}=p,o=n+e.length,r=(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(e=n.clipboardData)||e.setData("text/html",t),n})(e);return c({rule:t,state:s,from:n,to:{b:o},pasteEvt:r})}const u=n.doc.content.findDiffStart(s.doc.content),m=n.doc.content.findDiffEnd(s.doc.content);return An(u)&&m&&u!==m.b?c({rule:t,state:s,from:u,to:m,pasteEvt:a}):void 0}}))}var jn=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=$e(t),this.schema=Se(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=pe(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:He(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return Te([...this.extensions].reverse()).flatMap(e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:He(e.name,this.schema)},s=[],o=pe(e,"addKeyboardShortcuts",n);let r={};if("mark"===e.type&&pe(e,"exitable",n)&&(r.ArrowRight=()=>On.handleExit({editor:t,mark:e})),o){const e=Object.fromEntries(Object.entries(o()).map(([e,n])=>[e,()=>n({editor:t})]));r={...r,...e}}const i=F(r);s.push(i);const a=pe(e,"addInputRules",n);if(Fe(e,t.options.enableInputRules)&&a){const e=a();if(e&&e.length){const n=Sn({editor:t,rules:e}),o=Array.isArray(n)?n:[n];s.push(...o)}}const c=pe(e,"addPasteRules",n);if(Fe(e,t.options.enablePasteRules)&&c){const e=c();if(e&&e.length){const n=Nn({editor:t,rules:e});s.push(...n)}}const l=pe(e,"addProseMirrorPlugins",n);if(l){const t=l();s.push(...t)}return s})}get attributes(){return ye(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ve(this.extensions);return Object.fromEntries(e.filter(t=>!!pe(t,"addNodeView")).map(e=>{const n=this.attributes.filter(t=>t.type===e.name),s={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:ot(e.name,this.schema)},o=pe(e,"addNodeView",s);if(!o)return[];const r=o();if(!r)return[];return[e.name,(s,o,i,a,c)=>{const l=we(s,n);return r({node:s,view:o,getPos:i,decorations:a,innerDecorations:c,editor:t,extension:e,HTMLAttributes:l})}]}))}dispatchTransaction(t){const{editor:e}=this;return Te([...this.extensions].reverse()).reduceRight((t,n)=>{const s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:He(n.name,this.schema)},o=pe(n,"dispatchTransaction",s);return o?e=>{o.call(s,{transaction:e,next:t})}:t},t)}transformPastedHTML(t){const{editor:e}=this;return Te([...this.extensions]).reduce((t,n)=>{const s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:He(n.name,this.schema)},o=pe(n,"transformPastedHTML",s);return o?(e,n)=>{const r=t(e,n);return o.call(s,r)}:t},t||(t=>t))}get markViews(){const{editor:t}=this,{markExtensions:e}=ve(this.extensions);return Object.fromEntries(e.filter(t=>!!pe(t,"addMarkView")).map(e=>{const n=this.attributes.filter(t=>t.type===e.name),s={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:ft(e.name,this.schema)},o=pe(e,"addMarkView",s);if(!o)return[];return[e.name,(s,r,i)=>{const a=we(s,n);return o()({mark:s,view:r,inline:i,editor:t,extension:e,HTMLAttributes:a,updateAttributes:e=>{ms(s,t,e)}})}]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(t=>[t.name,t.storage])),t.forEach(t=>{var e;const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:He(t.name,this.schema)};if("mark"===t.type){(null==(e=fe(pe(t,"keepOnSplit",n)))||e)&&this.splittableMarks.push(t.name)}const s=pe(t,"onBeforeCreate",n),o=pe(t,"onCreate",n),r=pe(t,"onUpdate",n),i=pe(t,"onSelectionUpdate",n),a=pe(t,"onTransaction",n),c=pe(t,"onFocus",n),l=pe(t,"onBlur",n),d=pe(t,"onDestroy",n);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),r&&this.editor.on("update",r),i&&this.editor.on("selectionUpdate",i),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),l&&this.editor.on("blur",l),d&&this.editor.on("destroy",d)})}};jn.resolve=$e,jn.sort=Te,jn.flatten=he;var In={};q(In,{ClipboardTextSerializer:()=>Hn,Commands:()=>Ln,Delete:()=>Bn,Drop:()=>Vn,Editable:()=>Wn,FocusEvents:()=>_n,Keymap:()=>Fn,Paste:()=>Kn,Tabindex:()=>qn,TextDirection:()=>Jn,focusEventsPluginKey:()=>Un});var Dn=class t extends $n{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n="function"==typeof e?e():e;return new t(n)}configure(t){return super.configure(t)}extend(t){const e="function"==typeof t?t():t;return super.extend(e)}},Hn=Dn.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new P({key:new R("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:s,selection:o}=e,{ranges:r}=o,i=Math.min(...r.map(t=>t.$from.pos)),a=Math.max(...r.map(t=>t.$to.pos)),c=ze(n);return Oe(s,{from:i,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Ln=Dn.create({name:"commands",addCommands:()=>({...X})}),Bn=Dn.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,o,r;const i=()=>{var n,o,r,i;if(null!=(i=null==(r=null==(o=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:o.filterTransaction)?void 0:r.call(o,t))?i:t.getMeta("y-sync$"))return;const a=ie(t.before,[t,...e]);je(a).forEach(e=>{a.mapping.mapResult(e.oldRange.from).deletedAfter&&a.mapping.mapResult(e.oldRange.to).deletedBefore&&a.before.nodesBetween(e.oldRange.from,e.oldRange.to,(n,s)=>{const o=s+n.nodeSize-2,r=e.oldRange.from<=s&&o<=e.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:s,to:o,newFrom:a.mapping.map(s),newTo:a.mapping.map(o),deletedRange:e.oldRange,newRange:e.newRange,partial:!r,editor:this.editor,transaction:t,combinedTransform:a})})});const c=a.mapping;a.steps.forEach((e,n)=>{var o,r;if(e instanceof s){const s=c.slice(n).map(e.from,-1),i=c.slice(n).map(e.to),l=c.invert().map(s,-1),d=c.invert().map(i),p=null==(o=a.doc.nodeAt(s-1))?void 0:o.marks.some(t=>t.eq(e.mark)),h=null==(r=a.doc.nodeAt(i))?void 0:r.marks.some(t=>t.eq(e.mark));this.editor.emit("delete",{type:"mark",mark:e.mark,from:e.from,to:e.to,deletedRange:{from:l,to:d},newRange:{from:s,to:i},partial:Boolean(h||p),editor:this.editor,transaction:t,combinedTransform:a})}})};null==(r=null==(o=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:o.async)||r?setTimeout(i,0):i()}}),Vn=Dn.create({name:"drop",addProseMirrorPlugins(){return[new P({key:new R("tiptapDrop"),props:{handleDrop:(t,e,n,s)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:s})}}})]}}),Wn=Dn.create({name:"editable",addProseMirrorPlugins(){return[new P({key:new R("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Un=new R("focusEvents"),_n=Dn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new P({key:Un,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const s=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(s),!1},blur:(e,n)=>{t.isFocused=!1;const s=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(s),!1}}}})]}}),Fn=Dn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:e})=>{const{selection:n,doc:s}=e,{empty:o,$anchor:r}=n,{pos:i,parent:a}=r,c=r.parent.isTextblock&&i>0?e.doc.resolve(i-1):r,l=c.parent.type.spec.isolating,d=r.pos-r.parentOffset,p=l&&1===c.parent.childCount?d===r.pos:A.atStart(s).from===i;return!(!o||!a.type.isTextblock||a.textContent.length||!p||p&&"paragraph"===r.parent.type.name)&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return xt()||Bt()?o:s},addProseMirrorPlugins(){return[new P({key:new R("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(t=>t.getMeta("composition")))return;const s=t.some(t=>t.docChanged)&&!e.doc.eq(n.doc),o=t.some(t=>t.getMeta("preventClearDocument"));if(!s||o)return;const{empty:r,from:i,to:a}=e.selection,c=A.atStart(e.doc).from,l=A.atEnd(e.doc).to;if(r||!(i===c&&a===l))return;if(!qe(n.doc))return;const d=n.tr,p=J({state:n,transaction:d}),{commands:h}=new Y({editor:this.editor,state:p});return h.clearNodes(),d.steps.length?d:void 0}})]}}),Kn=Dn.create({name:"paste",addProseMirrorPlugins(){return[new P({key:new R("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),qn=Dn.create({name:"tabindex",addProseMirrorPlugins(){return[new P({key:new R("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Jn=Dn.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=ve(this.extensions);return[{types:t.filter(t=>"text"!==t.name).map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const e=t.getAttribute("dir");return!e||"ltr"!==e&&"rtl"!==e&&"auto"!==e?this.options.direction:e},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new P({key:new R("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),Yn=class t{constructor(t,e,n=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=e,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return null!=(t=this.actualDepth)?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,s)=>{const o=n.isBlock&&!n.isTextblock,r=n.isAtom&&!n.isText,i=n.isInline,a=this.pos+s+(r?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(a);if(!o&&!i&&c.depth<=this.depth)return;const l=new t(c,this.editor,o,o||i?n:null);o&&(l.actualDepth=this.depth+1),e.push(l)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let n=null,s=this.parent;for(;s&&!n;){if(s.node.type.name===t)if(Object.keys(e).length>0){const t=s.node.attrs,n=Object.keys(e);for(let s=0;s<n.length;s+=1){const o=n[s];if(t[o]!==e[o])break}}else n=s;s=s.parent}return n}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},n=!1){let s=[];if(!this.children||0===this.children.length)return s;const o=Object.keys(e);return this.children.forEach(r=>{if(!(n&&s.length>0)){if(r.node.type.name===t){o.every(t=>e[t]===r.node.attrs[t])&&s.push(r)}n&&s.length>0||(s=s.concat(r.querySelectorAll(t,e,n)))}}),s}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}};function Xn(t,e,n){const s=document.querySelector("style[data-tiptap-style]");if(null!==s)return s;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}var Zn=class extends xn{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Xe,createMappablePosition:Ze},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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:t,slice:e,moved:n})=>this.options.onDrop(t,e,n)),this.on("paste",({event:t,slice:e})=>this.options.onPaste(t,e)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=wt(e,this.options.autofocus);this.editorState=O.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;(null==t?void 0:t.editor)&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=Xn('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if("state"===e)return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=me(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],s=this.state.reconfigure({plugins:n});return this.view.updateState(s),s}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(t=>{const e="string"==typeof t?`${t}$`:t.key;n=n.filter(t=>!t.key.startsWith(e))}),e.length===n.length)return;const s=this.state.reconfigure({plugins:n});return this.view.updateState(s),s}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[Wn,Hn.configure({blockSeparator:null==(e=null==(t=this.options.coreExtensionOptions)?void 0:t.clipboardTextSerializer)?void 0:e.blockSeparator}),Ln,_n,Fn,qn,Vn,Kn,Bn,Jn.configure({direction:this.options.textDirection})].filter(t=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name]):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new jn(n,this)}createCommandManager(){this.commandManager=new Y({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=se(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message)))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>"collaboration"!==t.name),this.createExtensionManager()}}),t=se(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,s=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(s):s,r=e.transformPastedHTML,i=this.extensionManager.transformPastedHTML(r);this.editorView=new _(t,{...e,attributes:{role:"textbox",...null==e?void 0:e.attributes},dispatchTransaction:o,transformPastedHTML:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach(t=>{var e;return null==(e=this.capturedTransaction)?void 0:e.step(t)}):void(this.capturedTransaction=t);const{state:e,transactions:n}=this.state.applyTransaction(t),s=!this.state.selection.eq(e.selection),o=n.includes(t),r=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),s&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=n.findLast(t=>t.getMeta("focus")||t.getMeta("blur")),a=null==i?void 0:i.getMeta("focus"),c=null==i?void 0:i.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:i}),c&&this.emit("blur",{editor:this,event:c.event,transaction:i}),t.getMeta("preventUpdate")||!n.some(t=>t.docChanged)||r.doc.eq(e.doc)||this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Re(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,s="string"==typeof t?e:t;return We(this.state,n,s)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ue(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return Ae(this.state.doc,{blockSeparator:e,textSerializers:{...ze(this.schema),...n}})}get isEmpty(){return qe(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return null==(e=null==(t=this.editorView)?void 0:t.isDestroyed)||e}$node(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new Yn(e,this)}get $doc(){return this.$pos(0)}};function Qn(t){return new Mn({find:t.find,handler:({state:e,range:n,match:s})=>{const o=fe(t.getAttributes,void 0,s);if(!1===o||null===o)return null;const{tr:r}=e,i=s[s.length-1],a=s[0];if(i){const s=a.search(/\S/),c=n.from+a.indexOf(i),l=c+i.length;if(Ie(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>c).length)return null;l<n.to&&r.delete(l,n.to),c>n.from&&r.delete(n.from+s,c);const d=n.from+s+i.length;r.addMark(n.from+s,d,t.type.create(o||{})),r.removeStoredMark(t.type)}},undoable:t.undoable})}function Gn(t){return new Mn({find:t.find,handler:({state:e,range:n,match:s})=>{const o=fe(t.getAttributes,void 0,s)||{},{tr:r}=e,i=n.from;let a=n.to;const c=t.type.create(o);if(s[1]){let t=i+s[0].lastIndexOf(s[1]);t>a?t=a:a=t+s[1].length;const e=s[0][s[0].length-1];r.insertText(e,i+s[0].length-1),r.replaceWith(t,a,c)}else if(s[0]){const e=t.type.isInline?i:i-1;r.insert(e,t.type.create(o)).delete(r.mapping.map(i),r.mapping.map(a))}r.scrollIntoView()},undoable:t.undoable})}function ts(t){return new Mn({find:t.find,handler:({state:e,range:n,match:s})=>{const o=e.doc.resolve(n.from),r=fe(t.getAttributes,void 0,s)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,r)},undoable:t.undoable})}function es(n){return new Mn({find:n.find,handler:({state:s,range:o,match:r,chain:i})=>{const a=fe(n.getAttributes,void 0,r)||{},c=s.tr.delete(o.from,o.to),l=c.doc.resolve(o.from).blockRange(),d=l&&t(l,n.type,a);if(!d)return null;if(c.wrap(l,d),n.keepMarks&&n.editor){const{selection:t,storedMarks:e}=s,{splittableMarks:o}=n.editor.extensionManager,r=e||t.$to.parentOffset&&t.$from.marks();if(r){const t=r.filter(t=>o.includes(t.type.name));c.ensureMarks(t)}}if(n.keepAttributes){const t="bulletList"===n.type.name||"orderedList"===n.type.name?"listItem":"taskList";i().updateAttributes(t,a).run()}const p=c.doc.resolve(o.from-1).nodeBefore;p&&p.type===n.type&&e(c.doc,o.from-1)&&(!n.joinPredicate||n.joinPredicate(r,p))&&c.join(o.from-1)},undoable:n.undoable})}var ns=class{constructor(t){var e,n,s,o,r,i;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=/* @__PURE__ */new Map,this.handleMouseMove=t=>{if(!this.isResizing||!this.activeHandle)return;const e=t.clientX-this.startX,n=t.clientY-this.startY;this.handleResize(e,n)},this.handleTouchMove=t=>{if(!this.isResizing||!this.activeHandle)return;const e=t.touches[0];if(!e)return;const n=e.clientX-this.startX,s=e.clientY-this.startY;this.handleResize(n,s)},this.handleMouseUp=()=>{if(!this.isResizing)return;const t=this.element.offsetWidth,e=this.element.offsetHeight;this.onCommit(t,e),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=t=>{"Shift"===t.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=t=>{"Shift"===t.key&&(this.isShiftKeyPressed=!1)},this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(null==(e=t.options)?void 0:e.min)&&(this.minSize={...this.minSize,...t.options.min}),(null==(n=t.options)?void 0:n.max)&&(this.maxSize=t.options.max),(null==(s=null==t?void 0:t.options)?void 0:s.directions)&&(this.directions=t.options.directions),(null==(o=t.options)?void 0:o.preserveAspectRatio)&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(null==(r=t.options)?void 0:r.className)&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(null==(i=t.options)?void 0:i.createCustomHandle)&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return null!=(t=this.contentElement)?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type===this.node.type&&(this.node=t,!this.onUpdate||this.onUpdate(t,e,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),s=e.includes("bottom"),o=e.includes("left"),r=e.includes("right");n&&(t.style.top="0"),s&&(t.style.bottom="0"),o&&(t.style.left="0"),r&&(t.style.right="0"),"top"!==e&&"bottom"!==e||(t.style.left="0",t.style.right="0"),"left"!==e&&"right"!==e||(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;e=this.createCustomHandle?this.createCustomHandle(t):this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",e=>this.handleResizeStart(e,t)),e.addEventListener("touchstart",e=>this.handleResizeStart(e,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,"touches"in t?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:s,height:o}=this.calculateNewDimensions(this.activeHandle,t,e),r=this.applyConstraints(s,o,n);this.element.style.width=`${r.width}px`,this.element.style.height=`${r.height}px`,this.onResize&&this.onResize(r.width,r.height)}calculateNewDimensions(t,e,n){let s=this.startWidth,o=this.startHeight;const r=t.includes("right"),i=t.includes("left"),a=t.includes("bottom"),c=t.includes("top");r?s=this.startWidth+e:i&&(s=this.startWidth-e),a?o=this.startHeight+n:c&&(o=this.startHeight-n),"right"!==t&&"left"!==t||(s=this.startWidth+(r?e:-e)),"top"!==t&&"bottom"!==t||(o=this.startHeight+(a?n:-n));return this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(s,o,t):{width:s,height:o}}applyConstraints(t,e,n){var s,o,r,i;if(!n){let n=Math.max(this.minSize.width,t),r=Math.max(this.minSize.height,e);return(null==(s=this.maxSize)?void 0:s.width)&&(n=Math.min(this.maxSize.width,n)),(null==(o=this.maxSize)?void 0:o.height)&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let a=t,c=e;return a<this.minSize.width&&(a=this.minSize.width,c=a/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,a=c*this.aspectRatio),(null==(r=this.maxSize)?void 0:r.width)&&a>this.maxSize.width&&(a=this.maxSize.width,c=a/this.aspectRatio),(null==(i=this.maxSize)?void 0:i.height)&&c>this.maxSize.height&&(c=this.maxSize.height,a=c*this.aspectRatio),{width:a,height:c}}applyAspectRatio(t,e,n){const s="top"===n||"bottom"===n;return"left"===n||"right"===n?{width:t,height:t/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function ss(t,e){const{selection:n}=t,{$from:s}=n;if(n instanceof $){const t=s.index();return s.parent.canReplaceWith(t,t+1,e)}let o=s.depth;for(;o>=0;){const t=s.index(o);if(s.node(o).contentMatchAt(t).matchType(e))return!0;o-=1}return!1}var os={};function rs(t){if(!(null==t?void 0:t.trim()))return{};const e={},n=[],s=t.replace(/["']([^"']*)["']/g,t=>(n.push(t),`__QUOTED_${n.length-1}__`)),o=s.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const t=o.map(t=>t.trim().slice(1));e.class=t.join(" ")}const r=s.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);r&&(e.id=r[1]);Array.from(s.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,t,s])=>{var o;const r=parseInt((null==(o=s.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10),i=n[r];i&&(e[t]=i.slice(1,-1))});const i=s.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();if(i){i.split(/\s+/).filter(Boolean).forEach(t=>{t.match(/^[a-zA-Z][\w-]*$/)&&(e[t]=!0)})}return e}function is(t){if(!t||0===Object.keys(t).length)return"";const e=[];if(t.class){String(t.class).split(/\s+/).filter(Boolean).forEach(t=>e.push(`.${t}`))}return t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([t,n])=>{"class"!==t&&"id"!==t&&(!0===n?e.push(t):!1!==n&&null!=n&&e.push(`${t}="${String(n)}"`))}),e.join(" ")}function as(t){const{nodeName:e,name:n,parseAttributes:s=rs,serializeAttributes:o=is,defaultAttributes:r={},requiredAttributes:i=[],allowedAttributes:a}=t,c=n||e;return{parseMarkdown:(t,n)=>{const s={...r,...t.attributes};return n.createNode(e,s,[])},markdownTokenizer:{name:e,level:"block",start(t){var e;const n=new RegExp(`^:::${c}(?:\\s|$)`,"m"),s=null==(e=t.match(n))?void 0:e.index;return void 0!==s?s:-1},tokenize(t,n,o){const r=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=t.match(r);if(!a)return;const l=a[1]||"",d=s(l);return i.find(t=>!(t in d))?void 0:{type:e,raw:a[0],attributes:d}}},renderMarkdown:t=>{const e=(t=>{if(!a)return t;const e={};return a.forEach(n=>{n in t&&(e[n]=t[n])}),e})(t.attrs||{}),n=o(e);return`:::${c}${n?` {${n}}`:""} :::`}}}function cs(t){const{nodeName:e,name:n,getContent:s,parseAttributes:o=rs,serializeAttributes:r=is,defaultAttributes:i={},content:a="block",allowedAttributes:c}=t,l=n||e;return{parseMarkdown:(t,n)=>{let o;if(s){const e=s(t);o="string"==typeof e?[{type:"text",text:e}]:e}else o="block"===a?n.parseChildren(t.tokens||[]):n.parseInline(t.tokens||[]);const r={...i,...t.attributes};return n.createNode(e,r,o)},markdownTokenizer:{name:e,level:"block",start(t){var e;const n=new RegExp(`^:::${l}`,"m"),s=null==(e=t.match(n))?void 0:e.index;return void 0!==s?s:-1},tokenize(t,n,s){var r;const i=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),c=t.match(i);if(!c)return;const[d,p=""]=c,h=o(p);let u=1;const m=d.length;let f="";const g=/^:::([\w-]*)(\s.*)?/gm,v=t.slice(m);for(g.lastIndex=0;;){const n=g.exec(v);if(null===n)break;const o=n.index,i=n[1];if(!(null==(r=n[2])?void 0:r.endsWith(":::")))if(i)u+=1;else if(u-=1,0===u){const r=v.slice(0,o);f=r.trim();const i=t.slice(0,m+o+n[0].length);let c=[];if(f)if("block"===a)for(c=s.blockTokens(r),c.forEach(t=>{!t.text||t.tokens&&0!==t.tokens.length||(t.tokens=s.inlineTokens(t.text))});c.length>0;){const t=c[c.length-1];if("paragraph"!==t.type||t.text&&""!==t.text.trim())break;c.pop()}else c=s.inlineTokens(f);return{type:e,raw:i,attributes:h,content:f,tokens:c}}}}},renderMarkdown:(t,e)=>{const n=(t=>{if(!c)return t;const e={};return c.forEach(n=>{n in t&&(e[n]=t[n])}),e})(t.attrs||{}),s=r(n),o=s?` {${s}}`:"",i=e.renderChildren(t.content||[],"\n\n");return`:::${l}${o}\n\n${i}\n\n:::`}}}function ls(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let s=n.exec(t);for(;null!==s;){const[,o,r,i]=s;e[o]=r||i,s=n.exec(t)}return e}function ds(t){return Object.entries(t).filter(([,t])=>null!=t).map(([t,e])=>`${t}="${e}"`).join(" ")}function ps(t){const{nodeName:e,name:n,getContent:s,parseAttributes:o=ls,serializeAttributes:r=ds,defaultAttributes:i={},selfClosing:a=!1,allowedAttributes:c}=t,l=n||e,d=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(t,n)=>{const o={...i,...t.attributes};if(a)return n.createNode(e,o);const r=s?s(t):t.content||"";return r?n.createNode(e,o,[n.createTextNode(r)]):n.createNode(e,o,[])},markdownTokenizer:{name:e,level:"inline",start(t){const e=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=t.match(e),s=null==n?void 0:n.index;return void 0!==s?s:-1},tokenize(t,n,s){const r=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),i=t.match(r);if(!i)return;let c="",l="";if(a){const[,t]=i;l=t}else{const[,t,e]=i;l=t,c=e||""}const p=o(l.trim());return{type:e,raw:i[0],content:c.trim(),attributes:p}}},renderMarkdown:t=>{let e="";s?e=s(t):t.content&&t.content.length>0&&(e=t.content.filter(t=>"text"===t.type).map(t=>t.text).join(""));const n=(t=>{if(!c)return t;const e={};return c.forEach(n=>{const s="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(s in t){const n=t[s];if(void 0!==o&&n===o)return;e[s]=n}}),e})(t.attrs||{}),o=r(n),i=o?` ${o}`:"";return a?`[${l}${i}]`:`[${l}${i}]${e}[/${l}]`}}}function hs(t,e,n){var s,o,r,i;const a=t.split("\n"),c=[];let l="",d=0;const p=e.baseIndentSize||2;for(;d<a.length;){const t=a[d],h=t.match(e.itemPattern);if(!h){if(c.length>0)break;if(""===t.trim()){d+=1,l=`${l}${t}\n`;continue}return}const u=e.extractItemData(h),{indentLevel:m,mainContent:f}=u;l=`${l}${t}\n`;const g=[f];for(d+=1;d<a.length;){const t=a[d];if(""===t.trim()){const e=a.slice(d+1).findIndex(t=>""!==t.trim());if(-1===e)break;if(((null==(o=null==(s=a[d+1+e].match(/^(\s*)/))?void 0:s[1])?void 0:o.length)||0)>m){g.push(t),l=`${l}${t}\n`,d+=1;continue}break}if(!(((null==(i=null==(r=t.match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>m))break;g.push(t),l=`${l}${t}\n`,d+=1}let v;const y=g.slice(1);if(y.length>0){const t=y.map(t=>t.slice(m+p)).join("\n");t.trim()&&(v=e.customNestedParser?e.customNestedParser(t):n.blockTokens(t))}const b=e.createToken(u,v);c.push(b)}if(0!==c.length)return{items:c,raw:l}}function us(t,e,n,s){if(!t||!Array.isArray(t.content))return"";const o="function"==typeof n?n(s):n,[r,...i]=t.content,a=[`${o}${e.renderChildren([r])}`];return i&&i.length>0&&i.forEach(t=>{const n=e.renderChildren([t]);if(n){const t=n.split("\n").map(t=>t?e.indent(t):"").join("\n");a.push(t)}}),a.join("\n")}function ms(t,e,n={}){const{state:s}=e,{doc:o,tr:r}=s,i=t;o.descendants((e,s)=>{const o=r.mapping.map(s),a=r.mapping.map(s)+e.nodeSize;let c=null;if(e.marks.forEach(t=>{if(t!==i)return!1;c=t}),!c)return;let l=!1;if(Object.keys(n).forEach(t=>{n[t]!==c.attrs[t]&&(l=!0)}),l){const e=t.type.create({...t.attrs,...n});r.removeMark(o,a,t.type),r.addMark(o,a,e)}}),r.docChanged&&e.view.dispatch(r)}q(os,{createAtomBlockMarkdownSpec:()=>as,createBlockMarkdownSpec:()=>cs,createInlineMarkdownSpec:()=>ps,parseAttributes:()=>rs,parseIndentedBlocks:()=>hs,renderNestedMarkdownContent:()=>us,serializeAttributes:()=>is});var fs=class t extends $n{constructor(){super(...arguments),this.type="node"}static create(e={}){const n="function"==typeof e?e():e;return new t(n)}configure(t){return super.configure(t)}extend(t){const e="function"==typeof t?t():t;return super.extend(e)}};function gs(t){return new zn({find:t.find,handler:({state:e,range:n,match:s,pasteEvent:o})=>{const r=fe(t.getAttributes,void 0,s,o);if(!1===r||null===r)return null;const{tr:i}=e,a=s[s.length-1],c=s[0];let l=n.to;if(a){const s=c.search(/\S/),o=n.from+c.indexOf(a),d=o+a.length;if(Ie(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>o).length)return null;d<n.to&&i.delete(d,n.to),o>n.from&&i.delete(n.from+s,o),l=n.from+s+a.length,i.addMark(n.from+s,l,t.type.create(r||{})),i.removeStoredMark(t.type)}}})}export{Y as CommandManager,Zn as Editor,$n as Extendable,Dn as Extension,Mn as InputRule,Ye as MappablePosition,On as Mark,fs as Node,Yn as NodePos,zn as PasteRule,ns as ResizableNodeView,fe as callOrReturn,ss as canInsertNode,ie as combineTransactionSteps,X as commands,as as createAtomBlockMarkdownSpec,cs as createBlockMarkdownSpec,J as createChainableState,se as createDocument,ps as createInlineMarkdownSpec,Ze as createMappablePosition,Ot as createNodeFromContent,Xn as createStyleTag,ae as defaultBlockAt,Jt as deleteProps,$t as elementFromString,In as extensions,ce as findChildrenInRange,Ce as findDuplicates,de as findParentNode,le as findParentNodeClosestToPos,he as flattenExtensions,ke as fromString,Re as getAttributes,ye as getAttributesFromExtensions,je as getChangedRanges,pe as getExtensionField,ue as getHTMLFromFragment,re as getMarkAttributes,mt as getMarkRange,ft as getMarkType,Ie as getMarksBetween,De as getNodeAtPosition,Pe as getNodeAttributes,ot as getNodeType,we as getRenderedAttributes,Se as getSchemaByResolvedExtensions,He as getSchemaTypeByName,qt as getSchemaTypeNameByName,Le as getSplittedAttributes,Ae as getText,Oe as getTextBetween,Be as getTextContentFromNodes,ze as getTextSerializersFromSchema,Xe as getUpdatedPosition,xe as injectExtensionAttributesToParseRule,Sn as inputRulesPlugin,We as isActive,kt as isAndroid,Ue as isAtEndOfNode,_e as isAtStartOfNode,ge as isEmptyObject,Fe as isExtensionRulesEnabled,me as isFunction,Ke as isList,Bt as isMacOS,Ve as isMarkActive,Wt as isNodeActive,qe as isNodeEmpty,Je as isNodeSelection,An as isNumber,Cn as isPlainObject,dt as isRegExp,Mt as isSafari,yt as isTextSelection,xt as isiOS,Qn as markInputRule,gs as markPasteRule,os as markdown,be as mergeAttributes,Tn as mergeDeep,bt as minMax,Gn as nodeInputRule,pt as objectIncludes,rs as parseAttributes,hs as parseIndentedBlocks,Nn as pasteRulesPlugin,Ne as removeDuplicates,us as renderNestedMarkdownContent,$e as resolveExtensions,wt as resolveFocusPosition,At as selectionToInsertionEnd,is as serializeAttributes,Te as sortExtensions,ve as splitExtensions,ts as textblockTypeInputRule,ms as updateMarkViewAttributes,es as wrappingInputRule};
14
+ import { findWrapping as ge, canJoin as gt, Transform as ve, RemoveMarkStep as ye, liftTarget as be, joinPoint as _t, canSplit as X, ReplaceStep as we, ReplaceAroundStep as ke } from "../../../prosemirror-transform/dist/index.js";
15
+ import { createParagraphNear as Me, deleteSelection as xe, exitCode as Se, joinUp as Ee, joinDown as Te, joinBackward as Ce, joinForward as Ae, joinTextblockBackward as Pe, joinTextblockForward as $e, lift as Ne, liftEmptyBlock as Re, newlineInCode as ze, selectNodeBackward as Ie, selectNodeForward as De, selectParentNode as Be, selectTextblockEnd as Oe, selectTextblockStart as _e, setBlockType as Ct, wrapIn as je } from "../../../prosemirror-commands/dist/index.js";
16
+ import { NodeSelection as nt, EditorState as Le, Selection as j, TextSelection as P, Plugin as $, PluginKey as B, AllSelection as He } from "../../../prosemirror-state/dist/index.js";
17
+ import { Schema as jt, DOMSerializer as Fe, Fragment as D, Node as Ve, DOMParser as ut, Slice as We } from "../../../prosemirror-model/dist/index.js";
18
+ import { liftListItem as Ue, sinkListItem as Ke, wrapInList as qe } from "../../../prosemirror-schema-list/dist/index.js";
19
+ import { EditorView as Je } from "../../../prosemirror-view/dist/index.js";
20
+ import { keymap as Ye } from "../../../prosemirror-keymap/dist/index.js";
21
+ var Qe = Object.defineProperty, vt = (e, t) => {
22
+ for (var n in t)
23
+ Qe(e, n, { get: t[n], enumerable: !0 });
24
+ };
25
+ function rt(e) {
26
+ const { state: t, transaction: n } = e;
27
+ let { selection: r } = n, { doc: s } = n, { storedMarks: o } = n;
28
+ return {
29
+ ...t,
30
+ apply: t.apply.bind(t),
31
+ applyTransaction: t.applyTransaction.bind(t),
32
+ plugins: t.plugins,
33
+ schema: t.schema,
34
+ reconfigure: t.reconfigure.bind(t),
35
+ toJSON: t.toJSON.bind(t),
36
+ get storedMarks() {
37
+ return o;
38
+ },
39
+ get selection() {
40
+ return r;
41
+ },
42
+ get doc() {
43
+ return s;
44
+ },
45
+ get tr() {
46
+ return r = n.selection, s = n.doc, o = n.storedMarks, n;
47
+ }
48
+ };
49
+ }
50
+ var st = class {
51
+ constructor(e) {
52
+ this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
53
+ }
54
+ get hasCustomState() {
55
+ return !!this.customState;
56
+ }
57
+ get state() {
58
+ return this.customState || this.editor.state;
59
+ }
60
+ get commands() {
61
+ const { rawCommands: e, editor: t, state: n } = this, { view: r } = t, { tr: s } = n, o = this.buildProps(s);
62
+ return Object.fromEntries(
63
+ Object.entries(e).map(([i, a]) => [i, (...l) => {
64
+ const u = a(...l)(o);
65
+ return !s.getMeta("preventDispatch") && !this.hasCustomState && r.dispatch(s), u;
66
+ }])
67
+ );
68
+ }
69
+ get chain() {
70
+ return () => this.createChain();
71
+ }
72
+ get can() {
73
+ return () => this.createCan();
74
+ }
75
+ createChain(e, t = !0) {
76
+ const { rawCommands: n, editor: r, state: s } = this, { view: o } = r, i = [], a = !!e, c = e || s.tr, l = () => (!a && t && !c.getMeta("preventDispatch") && !this.hasCustomState && o.dispatch(c), i.every((d) => d === !0)), u = {
77
+ ...Object.fromEntries(
78
+ Object.entries(n).map(([d, p]) => [d, (...h) => {
79
+ const m = this.buildProps(c, t), g = p(...h)(m);
80
+ return i.push(g), u;
81
+ }])
82
+ ),
83
+ run: l
84
+ };
85
+ return u;
86
+ }
87
+ createCan(e) {
88
+ const { rawCommands: t, state: n } = this, r = !1, s = e || n.tr, o = this.buildProps(s, r);
89
+ return {
90
+ ...Object.fromEntries(
91
+ Object.entries(t).map(([a, c]) => [a, (...l) => c(...l)({ ...o, dispatch: void 0 })])
92
+ ),
93
+ chain: () => this.createChain(s, r)
94
+ };
95
+ }
96
+ buildProps(e, t = !0) {
97
+ const { rawCommands: n, editor: r, state: s } = this, { view: o } = r, i = {
98
+ tr: e,
99
+ editor: r,
100
+ view: o,
101
+ state: rt({
102
+ state: s,
103
+ transaction: e
104
+ }),
105
+ dispatch: t ? () => {
106
+ } : void 0,
107
+ chain: () => this.createChain(e, t),
108
+ can: () => this.createCan(e),
109
+ get commands() {
110
+ return Object.fromEntries(
111
+ Object.entries(n).map(([a, c]) => [a, (...l) => c(...l)(i)])
112
+ );
113
+ }
114
+ };
115
+ return i;
116
+ }
117
+ }, Lt = {};
118
+ vt(Lt, {
119
+ blur: () => Xe,
120
+ clearContent: () => Ze,
121
+ clearNodes: () => Ge,
122
+ command: () => tn,
123
+ createParagraphNear: () => en,
124
+ cut: () => nn,
125
+ deleteCurrentNode: () => rn,
126
+ deleteNode: () => sn,
127
+ deleteRange: () => on,
128
+ deleteSelection: () => an,
129
+ enter: () => cn,
130
+ exitCode: () => ln,
131
+ extendMarkRange: () => dn,
132
+ first: () => un,
133
+ focus: () => pn,
134
+ forEach: () => hn,
135
+ insertContent: () => mn,
136
+ insertContentAt: () => yn,
137
+ joinBackward: () => kn,
138
+ joinDown: () => wn,
139
+ joinForward: () => Mn,
140
+ joinItemBackward: () => xn,
141
+ joinItemForward: () => Sn,
142
+ joinTextblockBackward: () => En,
143
+ joinTextblockForward: () => Tn,
144
+ joinUp: () => bn,
145
+ keyboardShortcut: () => An,
146
+ lift: () => Pn,
147
+ liftEmptyBlock: () => $n,
148
+ liftListItem: () => Nn,
149
+ newlineInCode: () => Rn,
150
+ resetAttributes: () => zn,
151
+ scrollIntoView: () => In,
152
+ selectAll: () => Dn,
153
+ selectNodeBackward: () => Bn,
154
+ selectNodeForward: () => On,
155
+ selectParentNode: () => _n,
156
+ selectTextblockEnd: () => jn,
157
+ selectTextblockStart: () => Ln,
158
+ setContent: () => Hn,
159
+ setMark: () => ar,
160
+ setMeta: () => cr,
161
+ setNode: () => lr,
162
+ setNodeSelection: () => dr,
163
+ setTextDirection: () => ur,
164
+ setTextSelection: () => fr,
165
+ sinkListItem: () => pr,
166
+ splitBlock: () => hr,
167
+ splitListItem: () => mr,
168
+ toggleList: () => gr,
169
+ toggleMark: () => vr,
170
+ toggleNode: () => yr,
171
+ toggleWrap: () => br,
172
+ undoInputRule: () => wr,
173
+ unsetAllMarks: () => kr,
174
+ unsetMark: () => Mr,
175
+ unsetTextDirection: () => xr,
176
+ updateAttributes: () => Sr,
177
+ wrapIn: () => Er,
178
+ wrapInList: () => Tr
179
+ });
180
+ var Xe = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
181
+ var n;
182
+ e.isDestroyed || (t.dom.blur(), (n = window?.getSelection()) == null || n.removeAllRanges());
183
+ }), !0), Ze = (e = !0) => ({ commands: t }) => t.setContent("", { emitUpdate: e }), Ge = () => ({ state: e, tr: t, dispatch: n }) => {
184
+ const { selection: r } = t, { ranges: s } = r;
185
+ return n && s.forEach(({ $from: o, $to: i }) => {
186
+ e.doc.nodesBetween(o.pos, i.pos, (a, c) => {
187
+ if (a.type.isText)
188
+ return;
189
+ const { doc: l, mapping: u } = t, d = l.resolve(u.map(c)), p = l.resolve(u.map(c + a.nodeSize)), f = d.blockRange(p);
190
+ if (!f)
191
+ return;
192
+ const h = be(f);
193
+ if (a.type.isTextblock) {
194
+ const { defaultType: m } = d.parent.contentMatchAt(d.index());
195
+ t.setNodeMarkup(f.start, m);
196
+ }
197
+ (h || h === 0) && t.lift(f, h);
198
+ });
199
+ }), !0;
200
+ }, tn = (e) => (t) => e(t), en = () => ({ state: e, dispatch: t }) => Me(e, t), nn = (e, t) => ({ editor: n, tr: r }) => {
201
+ const { state: s } = n, o = s.doc.slice(e.from, e.to);
202
+ r.deleteRange(e.from, e.to);
203
+ const i = r.mapping.map(t);
204
+ return r.insert(i, o.content), r.setSelection(new P(r.doc.resolve(Math.max(i - 1, 0)))), !0;
205
+ }, rn = () => ({ tr: e, dispatch: t }) => {
206
+ const { selection: n } = e, r = n.$anchor.node();
207
+ if (r.content.size > 0)
208
+ return !1;
209
+ const s = e.selection.$anchor;
210
+ for (let o = s.depth; o > 0; o -= 1)
211
+ if (s.node(o).type === r.type) {
212
+ if (t) {
213
+ const a = s.before(o), c = s.after(o);
214
+ e.delete(a, c).scrollIntoView();
215
+ }
216
+ return !0;
217
+ }
218
+ return !1;
219
+ };
220
+ function T(e, t) {
221
+ if (typeof e == "string") {
222
+ if (!t.nodes[e])
223
+ throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);
224
+ return t.nodes[e];
225
+ }
226
+ return e;
227
+ }
228
+ var sn = (e) => ({ tr: t, state: n, dispatch: r }) => {
229
+ const s = T(e, n.schema), o = t.selection.$anchor;
230
+ for (let i = o.depth; i > 0; i -= 1)
231
+ if (o.node(i).type === s) {
232
+ if (r) {
233
+ const c = o.before(i), l = o.after(i);
234
+ t.delete(c, l).scrollIntoView();
235
+ }
236
+ return !0;
237
+ }
238
+ return !1;
239
+ }, on = (e) => ({ tr: t, dispatch: n }) => {
240
+ const { from: r, to: s } = e;
241
+ return n && t.delete(r, s), !0;
242
+ }, an = () => ({ state: e, dispatch: t }) => xe(e, t), cn = () => ({ commands: e }) => e.keyboardShortcut("Enter"), ln = () => ({ state: e, dispatch: t }) => Se(e, t);
243
+ function yt(e) {
244
+ return Object.prototype.toString.call(e) === "[object RegExp]";
245
+ }
246
+ function G(e, t, n = { strict: !0 }) {
247
+ const r = Object.keys(t);
248
+ return r.length ? r.every((s) => n.strict ? t[s] === e[s] : yt(t[s]) ? t[s].test(e[s]) : t[s] === e[s]) : !0;
249
+ }
250
+ function Ht(e, t, n = {}) {
251
+ return e.find((r) => r.type === t && G(
252
+ // Only check equality for the attributes that are provided
253
+ Object.fromEntries(Object.keys(n).map((s) => [s, r.attrs[s]])),
254
+ n
255
+ ));
256
+ }
257
+ function At(e, t, n = {}) {
258
+ return !!Ht(e, t, n);
259
+ }
260
+ function bt(e, t, n) {
261
+ var r;
262
+ if (!e || !t)
263
+ return;
264
+ let s = e.parent.childAfter(e.parentOffset);
265
+ if ((!s.node || !s.node.marks.some((u) => u.type === t)) && (s = e.parent.childBefore(e.parentOffset)), !s.node || !s.node.marks.some((u) => u.type === t) || (n = n || ((r = s.node.marks[0]) == null ? void 0 : r.attrs), !Ht([...s.node.marks], t, n)))
266
+ return;
267
+ let i = s.index, a = e.start() + s.offset, c = i + 1, l = a + s.node.nodeSize;
268
+ for (; i > 0 && At([...e.parent.child(i - 1).marks], t, n); )
269
+ i -= 1, a -= e.parent.child(i).nodeSize;
270
+ for (; c < e.parent.childCount && At([...e.parent.child(c).marks], t, n); )
271
+ l += e.parent.child(c).nodeSize, c += 1;
272
+ return {
273
+ from: a,
274
+ to: l
275
+ };
276
+ }
277
+ function z(e, t) {
278
+ if (typeof e == "string") {
279
+ if (!t.marks[e])
280
+ throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);
281
+ return t.marks[e];
282
+ }
283
+ return e;
284
+ }
285
+ var dn = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
286
+ const o = z(e, r.schema), { doc: i, selection: a } = n, { $from: c, from: l, to: u } = a;
287
+ if (s) {
288
+ const d = bt(c, o, t);
289
+ if (d && d.from <= l && d.to >= u) {
290
+ const p = P.create(i, d.from, d.to);
291
+ n.setSelection(p);
292
+ }
293
+ }
294
+ return !0;
295
+ }, un = (e) => (t) => {
296
+ const n = typeof e == "function" ? e(t) : e;
297
+ for (let r = 0; r < n.length; r += 1)
298
+ if (n[r](t))
299
+ return !0;
300
+ return !1;
301
+ };
302
+ function Ft(e) {
303
+ return e instanceof P;
304
+ }
305
+ function _(e = 0, t = 0, n = 0) {
306
+ return Math.min(Math.max(e, t), n);
307
+ }
308
+ function Vt(e, t = null) {
309
+ if (!t)
310
+ return null;
311
+ const n = j.atStart(e), r = j.atEnd(e);
312
+ if (t === "start" || t === !0)
313
+ return n;
314
+ if (t === "end")
315
+ return r;
316
+ const s = n.from, o = r.to;
317
+ return t === "all" ? P.create(e, _(0, s, o), _(e.content.size, s, o)) : P.create(e, _(t, s, o), _(t, s, o));
318
+ }
319
+ function Pt() {
320
+ return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
321
+ }
322
+ function tt() {
323
+ return ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(navigator.platform) || // iPad on iOS 13 detection
324
+ navigator.userAgent.includes("Mac") && "ontouchend" in document;
325
+ }
326
+ function fn() {
327
+ return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
328
+ }
329
+ var pn = (e = null, t = {}) => ({ editor: n, view: r, tr: s, dispatch: o }) => {
330
+ t = {
331
+ scrollIntoView: !0,
332
+ ...t
333
+ };
334
+ const i = () => {
335
+ (tt() || Pt()) && r.dom.focus(), fn() && !tt() && !Pt() && r.dom.focus({ preventScroll: !0 }), requestAnimationFrame(() => {
336
+ n.isDestroyed || (r.focus(), t?.scrollIntoView && n.commands.scrollIntoView());
337
+ });
338
+ };
339
+ try {
340
+ if (r.hasFocus() && e === null || e === !1)
341
+ return !0;
342
+ } catch {
343
+ return !1;
344
+ }
345
+ if (o && e === null && !Ft(n.state.selection))
346
+ return i(), !0;
347
+ const a = Vt(s.doc, e) || n.state.selection, c = n.state.selection.eq(a);
348
+ return o && (c || s.setSelection(a), c && s.storedMarks && s.setStoredMarks(s.storedMarks), i()), !0;
349
+ }, hn = (e, t) => (n) => e.every((r, s) => t(r, { ...n, index: s })), mn = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, e, t), Wt = (e) => {
350
+ const t = e.childNodes;
351
+ for (let n = t.length - 1; n >= 0; n -= 1) {
352
+ const r = t[n];
353
+ r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && Wt(r);
354
+ }
355
+ return e;
356
+ };
357
+ function q(e) {
358
+ if (typeof window > "u")
359
+ throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");
360
+ const t = `<body>${e}</body>`, n = new window.DOMParser().parseFromString(t, "text/html").body;
361
+ return Wt(n);
362
+ }
363
+ function W(e, t, n) {
364
+ if (e instanceof Ve || e instanceof D)
365
+ return e;
366
+ n = {
367
+ slice: !0,
368
+ parseOptions: {},
369
+ ...n
370
+ };
371
+ const r = typeof e == "object" && e !== null, s = typeof e == "string";
372
+ if (r)
373
+ try {
374
+ if (Array.isArray(e) && e.length > 0)
375
+ return D.fromArray(e.map((a) => t.nodeFromJSON(a)));
376
+ const i = t.nodeFromJSON(e);
377
+ return n.errorOnInvalidContent && i.check(), i;
378
+ } catch (o) {
379
+ if (n.errorOnInvalidContent)
380
+ throw new Error("[tiptap error]: Invalid JSON content", { cause: o });
381
+ return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", o), W("", t, n);
382
+ }
383
+ if (s) {
384
+ if (n.errorOnInvalidContent) {
385
+ let i = !1, a = "";
386
+ const c = new jt({
387
+ topNode: t.spec.topNode,
388
+ marks: t.spec.marks,
389
+ // Prosemirror's schemas are executed such that: the last to execute, matches last
390
+ // 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
391
+ nodes: t.spec.nodes.append({
392
+ __tiptap__private__unknown__catch__all__node: {
393
+ content: "inline*",
394
+ group: "block",
395
+ parseDOM: [
396
+ {
397
+ tag: "*",
398
+ getAttrs: (l) => (i = !0, a = typeof l == "string" ? l : l.outerHTML, null)
399
+ }
400
+ ]
401
+ }
402
+ })
403
+ });
404
+ if (n.slice ? ut.fromSchema(c).parseSlice(q(e), n.parseOptions) : ut.fromSchema(c).parse(q(e), n.parseOptions), n.errorOnInvalidContent && i)
405
+ throw new Error("[tiptap error]: Invalid HTML content", {
406
+ cause: new Error(`Invalid element found: ${a}`)
407
+ });
408
+ }
409
+ const o = ut.fromSchema(t);
410
+ return n.slice ? o.parseSlice(q(e), n.parseOptions).content : o.parse(q(e), n.parseOptions);
411
+ }
412
+ return W("", t, n);
413
+ }
414
+ function gn(e, t, n) {
415
+ const r = e.steps.length - 1;
416
+ if (r < t)
417
+ return;
418
+ const s = e.steps[r];
419
+ if (!(s instanceof we || s instanceof ke))
420
+ return;
421
+ const o = e.mapping.maps[r];
422
+ let i = 0;
423
+ o.forEach((a, c, l, u) => {
424
+ i === 0 && (i = u);
425
+ }), e.setSelection(j.near(e.doc.resolve(i), n));
426
+ }
427
+ var vn = (e) => !("type" in e), yn = (e, t, n) => ({ tr: r, dispatch: s, editor: o }) => {
428
+ var i;
429
+ if (s) {
430
+ n = {
431
+ parseOptions: o.options.parseOptions,
432
+ updateSelection: !0,
433
+ applyInputRules: !1,
434
+ applyPasteRules: !1,
435
+ ...n
436
+ };
437
+ let a;
438
+ const c = (g) => {
439
+ o.emit("contentError", {
440
+ editor: o,
441
+ error: g,
442
+ disableCollaboration: () => {
443
+ "collaboration" in o.storage && typeof o.storage.collaboration == "object" && o.storage.collaboration && (o.storage.collaboration.isDisabled = !0);
444
+ }
445
+ });
446
+ }, l = {
447
+ preserveWhitespace: "full",
448
+ ...n.parseOptions
449
+ };
450
+ if (!n.errorOnInvalidContent && !o.options.enableContentCheck && o.options.emitContentError)
451
+ try {
452
+ W(t, o.schema, {
453
+ parseOptions: l,
454
+ errorOnInvalidContent: !0
455
+ });
456
+ } catch (g) {
457
+ c(g);
458
+ }
459
+ try {
460
+ a = W(t, o.schema, {
461
+ parseOptions: l,
462
+ errorOnInvalidContent: (i = n.errorOnInvalidContent) != null ? i : o.options.enableContentCheck
463
+ });
464
+ } catch (g) {
465
+ return c(g), !1;
466
+ }
467
+ let { from: u, to: d } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, p = !0, f = !0;
468
+ if ((vn(a) ? a : [a]).forEach((g) => {
469
+ g.check(), p = p ? g.isText && g.marks.length === 0 : !1, f = f ? g.isBlock : !1;
470
+ }), u === d && f) {
471
+ const { parent: g } = r.doc.resolve(u);
472
+ g.isTextblock && !g.type.spec.code && !g.childCount && (u -= 1, d += 1);
473
+ }
474
+ let m;
475
+ if (p) {
476
+ if (Array.isArray(t))
477
+ m = t.map((g) => g.text || "").join("");
478
+ else if (t instanceof D) {
479
+ let g = "";
480
+ t.forEach((v) => {
481
+ v.text && (g += v.text);
482
+ }), m = g;
483
+ } else typeof t == "object" && t && t.text ? m = t.text : m = t;
484
+ r.insertText(m, u, d);
485
+ } else {
486
+ m = a;
487
+ const g = r.doc.resolve(u), v = g.node(), b = g.parentOffset === 0, k = v.isText || v.isTextblock, M = v.content.size > 0;
488
+ b && k && M && (u = Math.max(0, u - 1)), r.replaceWith(u, d, m);
489
+ }
490
+ n.updateSelection && gn(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: u, text: m }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: u, text: m });
491
+ }
492
+ return !0;
493
+ }, bn = () => ({ state: e, dispatch: t }) => Ee(e, t), wn = () => ({ state: e, dispatch: t }) => Te(e, t), kn = () => ({ state: e, dispatch: t }) => Ce(e, t), Mn = () => ({ state: e, dispatch: t }) => Ae(e, t), xn = () => ({ state: e, dispatch: t, tr: n }) => {
494
+ try {
495
+ const r = _t(e.doc, e.selection.$from.pos, -1);
496
+ return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
497
+ } catch {
498
+ return !1;
499
+ }
500
+ }, Sn = () => ({ state: e, dispatch: t, tr: n }) => {
501
+ try {
502
+ const r = _t(e.doc, e.selection.$from.pos, 1);
503
+ return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
504
+ } catch {
505
+ return !1;
506
+ }
507
+ }, En = () => ({ state: e, dispatch: t }) => Pe(e, t), Tn = () => ({ state: e, dispatch: t }) => $e(e, t);
508
+ function Ut() {
509
+ return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
510
+ }
511
+ function Cn(e) {
512
+ const t = e.split(/-(?!$)/);
513
+ let n = t[t.length - 1];
514
+ n === "Space" && (n = " ");
515
+ let r, s, o, i;
516
+ for (let a = 0; a < t.length - 1; a += 1) {
517
+ const c = t[a];
518
+ if (/^(cmd|meta|m)$/i.test(c))
519
+ i = !0;
520
+ else if (/^a(lt)?$/i.test(c))
521
+ r = !0;
522
+ else if (/^(c|ctrl|control)$/i.test(c))
523
+ s = !0;
524
+ else if (/^s(hift)?$/i.test(c))
525
+ o = !0;
526
+ else if (/^mod$/i.test(c))
527
+ tt() || Ut() ? i = !0 : s = !0;
528
+ else
529
+ throw new Error(`Unrecognized modifier name: ${c}`);
530
+ }
531
+ return r && (n = `Alt-${n}`), s && (n = `Ctrl-${n}`), i && (n = `Meta-${n}`), o && (n = `Shift-${n}`), n;
532
+ }
533
+ var An = (e) => ({ editor: t, view: n, tr: r, dispatch: s }) => {
534
+ const o = Cn(e).split(/-(?!$)/), i = o.find((l) => !["Alt", "Ctrl", "Meta", "Shift"].includes(l)), a = new KeyboardEvent("keydown", {
535
+ key: i === "Space" ? " " : i,
536
+ altKey: o.includes("Alt"),
537
+ ctrlKey: o.includes("Ctrl"),
538
+ metaKey: o.includes("Meta"),
539
+ shiftKey: o.includes("Shift"),
540
+ bubbles: !0,
541
+ cancelable: !0
542
+ }), c = t.captureTransaction(() => {
543
+ n.someProp("handleKeyDown", (l) => l(n, a));
544
+ });
545
+ return c?.steps.forEach((l) => {
546
+ const u = l.map(r.mapping);
547
+ u && s && r.maybeStep(u);
548
+ }), !0;
549
+ };
550
+ function U(e, t, n = {}) {
551
+ const { from: r, to: s, empty: o } = e.selection, i = t ? T(t, e.schema) : null, a = [];
552
+ e.doc.nodesBetween(r, s, (d, p) => {
553
+ if (d.isText)
554
+ return;
555
+ const f = Math.max(r, p), h = Math.min(s, p + d.nodeSize);
556
+ a.push({
557
+ node: d,
558
+ from: f,
559
+ to: h
560
+ });
561
+ });
562
+ const c = s - r, l = a.filter((d) => i ? i.name === d.node.type.name : !0).filter((d) => G(d.node.attrs, n, { strict: !1 }));
563
+ return o ? !!l.length : l.reduce((d, p) => d + p.to - p.from, 0) >= c;
564
+ }
565
+ var Pn = (e, t = {}) => ({ state: n, dispatch: r }) => {
566
+ const s = T(e, n.schema);
567
+ return U(n, s, t) ? Ne(n, r) : !1;
568
+ }, $n = () => ({ state: e, dispatch: t }) => Re(e, t), Nn = (e) => ({ state: t, dispatch: n }) => {
569
+ const r = T(e, t.schema);
570
+ return Ue(r)(t, n);
571
+ }, Rn = () => ({ state: e, dispatch: t }) => ze(e, t);
572
+ function ot(e, t) {
573
+ return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
574
+ }
575
+ function $t(e, t) {
576
+ const n = typeof t == "string" ? [t] : t;
577
+ return Object.keys(e).reduce((r, s) => (n.includes(s) || (r[s] = e[s]), r), {});
578
+ }
579
+ var zn = (e, t) => ({ tr: n, state: r, dispatch: s }) => {
580
+ let o = null, i = null;
581
+ const a = ot(
582
+ typeof e == "string" ? e : e.name,
583
+ r.schema
584
+ );
585
+ if (!a)
586
+ return !1;
587
+ a === "node" && (o = T(e, r.schema)), a === "mark" && (i = z(e, r.schema));
588
+ let c = !1;
589
+ return n.selection.ranges.forEach((l) => {
590
+ r.doc.nodesBetween(l.$from.pos, l.$to.pos, (u, d) => {
591
+ o && o === u.type && (c = !0, s && n.setNodeMarkup(d, void 0, $t(u.attrs, t))), i && u.marks.length && u.marks.forEach((p) => {
592
+ i === p.type && (c = !0, s && n.addMark(d, d + u.nodeSize, i.create($t(p.attrs, t))));
593
+ });
594
+ });
595
+ }), c;
596
+ }, In = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), Dn = () => ({ tr: e, dispatch: t }) => {
597
+ if (t) {
598
+ const n = new He(e.doc);
599
+ e.setSelection(n);
600
+ }
601
+ return !0;
602
+ }, Bn = () => ({ state: e, dispatch: t }) => Ie(e, t), On = () => ({ state: e, dispatch: t }) => De(e, t), _n = () => ({ state: e, dispatch: t }) => Be(e, t), jn = () => ({ state: e, dispatch: t }) => Oe(e, t), Ln = () => ({ state: e, dispatch: t }) => _e(e, t);
603
+ function ht(e, t, n = {}, r = {}) {
604
+ return W(e, t, {
605
+ slice: !1,
606
+ parseOptions: n,
607
+ errorOnInvalidContent: r.errorOnInvalidContent
608
+ });
609
+ }
610
+ var Hn = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {} } = {}) => ({ editor: s, tr: o, dispatch: i, commands: a }) => {
611
+ const { doc: c } = o;
612
+ if (r.preserveWhitespace !== "full") {
613
+ const l = ht(e, s.schema, r, {
614
+ errorOnInvalidContent: t ?? s.options.enableContentCheck
615
+ });
616
+ return i && o.replaceWith(0, c.content.size, l).setMeta("preventUpdate", !n), !0;
617
+ }
618
+ return i && o.setMeta("preventUpdate", !n), a.insertContentAt({ from: 0, to: c.content.size }, e, {
619
+ parseOptions: r,
620
+ errorOnInvalidContent: t ?? s.options.enableContentCheck
621
+ });
622
+ };
623
+ function Kt(e, t) {
624
+ const n = z(t, e.schema), { from: r, to: s, empty: o } = e.selection, i = [];
625
+ o ? (e.storedMarks && i.push(...e.storedMarks), i.push(...e.selection.$head.marks())) : e.doc.nodesBetween(r, s, (c) => {
626
+ i.push(...c.marks);
627
+ });
628
+ const a = i.find((c) => c.type.name === n.name);
629
+ return a ? { ...a.attrs } : {};
630
+ }
631
+ function Fn(e, t) {
632
+ const n = new ve(e);
633
+ return t.forEach((r) => {
634
+ r.steps.forEach((s) => {
635
+ n.step(s);
636
+ });
637
+ }), n;
638
+ }
639
+ function Vn(e) {
640
+ for (let t = 0; t < e.edgeCount; t += 1) {
641
+ const { type: n } = e.edge(t);
642
+ if (n.isTextblock && !n.hasRequiredAttrs())
643
+ return n;
644
+ }
645
+ return null;
646
+ }
647
+ function os(e, t, n) {
648
+ const r = [];
649
+ return e.nodesBetween(t.from, t.to, (s, o) => {
650
+ n(s) && r.push({
651
+ node: s,
652
+ pos: o
653
+ });
654
+ }), r;
655
+ }
656
+ function Wn(e, t) {
657
+ for (let n = e.depth; n > 0; n -= 1) {
658
+ const r = e.node(n);
659
+ if (t(r))
660
+ return {
661
+ pos: n > 0 ? e.before(n) : 0,
662
+ start: e.start(n),
663
+ depth: n,
664
+ node: r
665
+ };
666
+ }
667
+ }
668
+ function it(e) {
669
+ return (t) => Wn(t.$from, e);
670
+ }
671
+ function y(e, t, n) {
672
+ return e.config[t] === void 0 && e.parent ? y(e.parent, t, n) : typeof e.config[t] == "function" ? e.config[t].bind({
673
+ ...n,
674
+ parent: e.parent ? y(e.parent, t, n) : null
675
+ }) : e.config[t];
676
+ }
677
+ function wt(e) {
678
+ return e.map((t) => {
679
+ const n = {
680
+ name: t.name,
681
+ options: t.options,
682
+ storage: t.storage
683
+ }, r = y(t, "addExtensions", n);
684
+ return r ? [t, ...wt(r())] : t;
685
+ }).flat(10);
686
+ }
687
+ function kt(e, t) {
688
+ const n = Fe.fromSchema(t).serializeFragment(e), s = document.implementation.createHTMLDocument().createElement("div");
689
+ return s.appendChild(n), s.innerHTML;
690
+ }
691
+ function qt(e) {
692
+ return typeof e == "function";
693
+ }
694
+ function x(e, t = void 0, ...n) {
695
+ return qt(e) ? t ? e.bind(t)(...n) : e(...n) : e;
696
+ }
697
+ function Un(e = {}) {
698
+ return Object.keys(e).length === 0 && e.constructor === Object;
699
+ }
700
+ function L(e) {
701
+ const t = e.filter((s) => s.type === "extension"), n = e.filter((s) => s.type === "node"), r = e.filter((s) => s.type === "mark");
702
+ return {
703
+ baseExtensions: t,
704
+ nodeExtensions: n,
705
+ markExtensions: r
706
+ };
707
+ }
708
+ function Jt(e) {
709
+ const t = [], { nodeExtensions: n, markExtensions: r } = L(e), s = [...n, ...r], o = {
710
+ default: null,
711
+ validate: void 0,
712
+ rendered: !0,
713
+ renderHTML: null,
714
+ parseHTML: null,
715
+ keepOnSplit: !0,
716
+ isRequired: !1
717
+ }, i = n.filter((l) => l.name !== "text").map((l) => l.name), a = r.map((l) => l.name), c = [...i, ...a];
718
+ return e.forEach((l) => {
719
+ const u = {
720
+ name: l.name,
721
+ options: l.options,
722
+ storage: l.storage,
723
+ extensions: s
724
+ }, d = y(
725
+ l,
726
+ "addGlobalAttributes",
727
+ u
728
+ );
729
+ if (!d)
730
+ return;
731
+ d().forEach((f) => {
732
+ let h;
733
+ Array.isArray(f.types) ? h = f.types : f.types === "*" ? h = c : f.types === "nodes" ? h = i : f.types === "marks" ? h = a : h = [], h.forEach((m) => {
734
+ Object.entries(f.attributes).forEach(([g, v]) => {
735
+ t.push({
736
+ type: m,
737
+ name: g,
738
+ attribute: {
739
+ ...o,
740
+ ...v
741
+ }
742
+ });
743
+ });
744
+ });
745
+ });
746
+ }), s.forEach((l) => {
747
+ const u = {
748
+ name: l.name,
749
+ options: l.options,
750
+ storage: l.storage
751
+ }, d = y(
752
+ l,
753
+ "addAttributes",
754
+ u
755
+ );
756
+ if (!d)
757
+ return;
758
+ const p = d();
759
+ Object.entries(p).forEach(([f, h]) => {
760
+ const m = {
761
+ ...o,
762
+ ...h
763
+ };
764
+ typeof m?.default == "function" && (m.default = m.default()), m?.isRequired && m?.default === void 0 && delete m.default, t.push({
765
+ type: l.name,
766
+ name: f,
767
+ attribute: m
768
+ });
769
+ });
770
+ }), t;
771
+ }
772
+ function Kn(e) {
773
+ const t = [];
774
+ let n = "", r = !1, s = !1, o = 0;
775
+ const i = e.length;
776
+ for (let a = 0; a < i; a += 1) {
777
+ const c = e[a];
778
+ if (c === "'" && !s) {
779
+ r = !r, n += c;
780
+ continue;
781
+ }
782
+ if (c === '"' && !r) {
783
+ s = !s, n += c;
784
+ continue;
785
+ }
786
+ if (!r && !s) {
787
+ if (c === "(") {
788
+ o += 1, n += c;
789
+ continue;
790
+ }
791
+ if (c === ")" && o > 0) {
792
+ o -= 1, n += c;
793
+ continue;
794
+ }
795
+ if (c === ";" && o === 0) {
796
+ t.push(n), n = "";
797
+ continue;
798
+ }
799
+ }
800
+ n += c;
801
+ }
802
+ return n && t.push(n), t;
803
+ }
804
+ function Nt(e) {
805
+ const t = [], n = Kn(e || ""), r = n.length;
806
+ for (let s = 0; s < r; s += 1) {
807
+ const o = n[s], i = o.indexOf(":");
808
+ if (i === -1)
809
+ continue;
810
+ const a = o.slice(0, i).trim(), c = o.slice(i + 1).trim();
811
+ a && c && t.push([a, c]);
812
+ }
813
+ return t;
814
+ }
815
+ function qn(...e) {
816
+ return e.filter((t) => !!t).reduce((t, n) => {
817
+ const r = { ...t };
818
+ return Object.entries(n).forEach(([s, o]) => {
819
+ if (!r[s]) {
820
+ r[s] = o;
821
+ return;
822
+ }
823
+ if (s === "class") {
824
+ const a = o ? String(o).split(" ") : [], c = r[s] ? r[s].split(" ") : [], l = a.filter((u) => !c.includes(u));
825
+ r[s] = [...c, ...l].join(" ");
826
+ } else if (s === "style") {
827
+ const a = new Map([...Nt(r[s]), ...Nt(o)]);
828
+ r[s] = Array.from(a.entries()).map(([c, l]) => `${c}: ${l}`).join("; ");
829
+ } else
830
+ r[s] = o;
831
+ }), r;
832
+ }, {});
833
+ }
834
+ function et(e, t) {
835
+ return t.filter((n) => n.type === e.type.name).filter((n) => n.attribute.rendered).map((n) => n.attribute.renderHTML ? n.attribute.renderHTML(e.attrs) || {} : {
836
+ [n.name]: e.attrs[n.name]
837
+ }).reduce((n, r) => qn(n, r), {});
838
+ }
839
+ function Jn(e) {
840
+ return typeof e != "string" ? e : e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" ? !0 : e === "false" ? !1 : e;
841
+ }
842
+ function Rt(e, t) {
843
+ return "style" in e ? e : {
844
+ ...e,
845
+ getAttrs: (n) => {
846
+ const r = e.getAttrs ? e.getAttrs(n) : e.attrs;
847
+ if (r === !1)
848
+ return !1;
849
+ const s = t.reduce((o, i) => {
850
+ const a = i.attribute.parseHTML ? i.attribute.parseHTML(n) : Jn(n.getAttribute(i.name));
851
+ return a == null ? o : {
852
+ ...o,
853
+ [i.name]: a
854
+ };
855
+ }, {});
856
+ return { ...r, ...s };
857
+ }
858
+ };
859
+ }
860
+ function zt(e) {
861
+ return Object.fromEntries(
862
+ // @ts-ignore
863
+ Object.entries(e).filter(([t, n]) => t === "attrs" && Un(n) ? !1 : n != null)
864
+ );
865
+ }
866
+ function It(e) {
867
+ var t, n;
868
+ const r = {};
869
+ return !((t = e?.attribute) != null && t.isRequired) && "default" in (e?.attribute || {}) && (r.default = e.attribute.default), ((n = e?.attribute) == null ? void 0 : n.validate) !== void 0 && (r.validate = e.attribute.validate), [e.name, r];
870
+ }
871
+ function Yt(e, t) {
872
+ var n;
873
+ const r = Jt(e), { nodeExtensions: s, markExtensions: o } = L(e), i = (n = s.find((l) => y(l, "topNode"))) == null ? void 0 : n.name, a = Object.fromEntries(
874
+ s.map((l) => {
875
+ const u = r.filter((v) => v.type === l.name), d = {
876
+ name: l.name,
877
+ options: l.options,
878
+ storage: l.storage,
879
+ editor: t
880
+ }, p = e.reduce((v, b) => {
881
+ const k = y(b, "extendNodeSchema", d);
882
+ return {
883
+ ...v,
884
+ ...k ? k(l) : {}
885
+ };
886
+ }, {}), f = zt({
887
+ ...p,
888
+ content: x(y(l, "content", d)),
889
+ marks: x(y(l, "marks", d)),
890
+ group: x(y(l, "group", d)),
891
+ inline: x(y(l, "inline", d)),
892
+ atom: x(y(l, "atom", d)),
893
+ selectable: x(y(l, "selectable", d)),
894
+ draggable: x(y(l, "draggable", d)),
895
+ code: x(y(l, "code", d)),
896
+ whitespace: x(y(l, "whitespace", d)),
897
+ linebreakReplacement: x(
898
+ y(l, "linebreakReplacement", d)
899
+ ),
900
+ defining: x(y(l, "defining", d)),
901
+ isolating: x(y(l, "isolating", d)),
902
+ attrs: Object.fromEntries(u.map(It))
903
+ }), h = x(y(l, "parseHTML", d));
904
+ h && (f.parseDOM = h.map(
905
+ (v) => Rt(v, u)
906
+ ));
907
+ const m = y(l, "renderHTML", d);
908
+ m && (f.toDOM = (v) => m({
909
+ node: v,
910
+ HTMLAttributes: et(v, u)
911
+ }));
912
+ const g = y(l, "renderText", d);
913
+ return g && (f.toText = g), [l.name, f];
914
+ })
915
+ ), c = Object.fromEntries(
916
+ o.map((l) => {
917
+ const u = r.filter((g) => g.type === l.name), d = {
918
+ name: l.name,
919
+ options: l.options,
920
+ storage: l.storage,
921
+ editor: t
922
+ }, p = e.reduce((g, v) => {
923
+ const b = y(v, "extendMarkSchema", d);
924
+ return {
925
+ ...g,
926
+ ...b ? b(l) : {}
927
+ };
928
+ }, {}), f = zt({
929
+ ...p,
930
+ inclusive: x(y(l, "inclusive", d)),
931
+ excludes: x(y(l, "excludes", d)),
932
+ group: x(y(l, "group", d)),
933
+ spanning: x(y(l, "spanning", d)),
934
+ code: x(y(l, "code", d)),
935
+ attrs: Object.fromEntries(u.map(It))
936
+ }), h = x(y(l, "parseHTML", d));
937
+ h && (f.parseDOM = h.map(
938
+ (g) => Rt(g, u)
939
+ ));
940
+ const m = y(l, "renderHTML", d);
941
+ return m && (f.toDOM = (g) => m({
942
+ mark: g,
943
+ HTMLAttributes: et(g, u)
944
+ })), [l.name, f];
945
+ })
946
+ );
947
+ return new jt({
948
+ topNode: i,
949
+ nodes: a,
950
+ marks: c
951
+ });
952
+ }
953
+ function Yn(e) {
954
+ const t = e.filter((n, r) => e.indexOf(n) !== r);
955
+ return Array.from(new Set(t));
956
+ }
957
+ function V(e) {
958
+ return e.sort((n, r) => {
959
+ const s = y(n, "priority") || 100, o = y(r, "priority") || 100;
960
+ return s > o ? -1 : s < o ? 1 : 0;
961
+ });
962
+ }
963
+ function Mt(e) {
964
+ const t = V(wt(e)), n = Yn(t.map((r) => r.name));
965
+ return n.length && console.warn(
966
+ `[tiptap warn]: Duplicate extension names found: [${n.map((r) => `'${r}'`).join(", ")}]. This can lead to issues.`
967
+ ), t;
968
+ }
969
+ function is(e, t) {
970
+ const n = Mt(e);
971
+ return Yt(n, t);
972
+ }
973
+ function Qt(e, t, n) {
974
+ const { from: r, to: s } = t, { blockSeparator: o = `
975
+
976
+ `, textSerializers: i = {} } = n || {};
977
+ let a = "";
978
+ return e.nodesBetween(r, s, (c, l, u, d) => {
979
+ var p;
980
+ c.isBlock && l > r && (a += o);
981
+ const f = i?.[c.type.name];
982
+ if (f)
983
+ return u && (a += f({
984
+ node: c,
985
+ pos: l,
986
+ parent: u,
987
+ index: d,
988
+ range: t
989
+ })), !1;
990
+ c.isText && (a += (p = c?.text) == null ? void 0 : p.slice(Math.max(r, l) - l, s - l));
991
+ }), a;
992
+ }
993
+ function Qn(e, t) {
994
+ const n = {
995
+ from: 0,
996
+ to: e.content.size
997
+ };
998
+ return Qt(e, n, t);
999
+ }
1000
+ function Xt(e) {
1001
+ return Object.fromEntries(
1002
+ Object.entries(e.nodes).filter(([, t]) => t.spec.toText).map(([t, n]) => [t, n.spec.toText])
1003
+ );
1004
+ }
1005
+ function Xn(e, t) {
1006
+ const n = T(t, e.schema), { from: r, to: s } = e.selection, o = [];
1007
+ e.doc.nodesBetween(r, s, (a) => {
1008
+ o.push(a);
1009
+ });
1010
+ const i = o.reverse().find((a) => a.type.name === n.name);
1011
+ return i ? { ...i.attrs } : {};
1012
+ }
1013
+ function Zn(e, t) {
1014
+ const n = ot(
1015
+ typeof t == "string" ? t : t.name,
1016
+ e.schema
1017
+ );
1018
+ return n === "node" ? Xn(e, t) : n === "mark" ? Kt(e, t) : {};
1019
+ }
1020
+ function Gn(e, t = JSON.stringify) {
1021
+ const n = {};
1022
+ return e.filter((r) => {
1023
+ const s = t(r);
1024
+ return Object.prototype.hasOwnProperty.call(n, s) ? !1 : n[s] = !0;
1025
+ });
1026
+ }
1027
+ function tr(e) {
1028
+ const t = Gn(e);
1029
+ return t.length === 1 ? t : t.filter((n, r) => !t.filter((o, i) => i !== r).some((o) => n.oldRange.from >= o.oldRange.from && n.oldRange.to <= o.oldRange.to && n.newRange.from >= o.newRange.from && n.newRange.to <= o.newRange.to));
1030
+ }
1031
+ function er(e) {
1032
+ const { mapping: t, steps: n } = e, r = [];
1033
+ return t.maps.forEach((s, o) => {
1034
+ const i = [];
1035
+ if (s.ranges.length)
1036
+ s.forEach((a, c) => {
1037
+ i.push({ from: a, to: c });
1038
+ });
1039
+ else {
1040
+ const { from: a, to: c } = n[o];
1041
+ if (a === void 0 || c === void 0)
1042
+ return;
1043
+ i.push({ from: a, to: c });
1044
+ }
1045
+ i.forEach(({ from: a, to: c }) => {
1046
+ const l = t.slice(o).map(a, -1), u = t.slice(o).map(c), d = t.invert().map(l, -1), p = t.invert().map(u);
1047
+ r.push({
1048
+ oldRange: {
1049
+ from: d,
1050
+ to: p
1051
+ },
1052
+ newRange: {
1053
+ from: l,
1054
+ to: u
1055
+ }
1056
+ });
1057
+ });
1058
+ }), tr(r);
1059
+ }
1060
+ function Zt(e, t, n) {
1061
+ const r = [];
1062
+ return e === t ? n.resolve(e).marks().forEach((s) => {
1063
+ const o = n.resolve(e), i = bt(o, s.type);
1064
+ i && r.push({
1065
+ mark: s,
1066
+ ...i
1067
+ });
1068
+ }) : n.nodesBetween(e, t, (s, o) => {
1069
+ !s || s?.nodeSize === void 0 || r.push(
1070
+ ...s.marks.map((i) => ({
1071
+ from: o,
1072
+ to: o + s.nodeSize,
1073
+ mark: i
1074
+ }))
1075
+ );
1076
+ }), r;
1077
+ }
1078
+ var as = (e, t, n, r = 20) => {
1079
+ const s = e.doc.resolve(n);
1080
+ let o = r, i = null;
1081
+ for (; o > 0 && i === null; ) {
1082
+ const a = s.node(o);
1083
+ a?.type.name === t ? i = a : o -= 1;
1084
+ }
1085
+ return [i, o];
1086
+ };
1087
+ function H(e, t) {
1088
+ return t.nodes[e] || t.marks[e] || null;
1089
+ }
1090
+ function Z(e, t, n) {
1091
+ return Object.fromEntries(
1092
+ Object.entries(n).filter(([r]) => {
1093
+ const s = e.find((o) => o.type === t && o.name === r);
1094
+ return s ? s.attribute.keepOnSplit : !1;
1095
+ })
1096
+ );
1097
+ }
1098
+ var nr = (e, t = 500) => {
1099
+ let n = "";
1100
+ const r = e.parentOffset;
1101
+ return e.parent.nodesBetween(Math.max(0, r - t), r, (s, o, i, a) => {
1102
+ var c, l;
1103
+ const u = ((l = (c = s.type.spec).toText) == null ? void 0 : l.call(c, {
1104
+ node: s,
1105
+ pos: o,
1106
+ parent: i,
1107
+ index: a
1108
+ })) || s.textContent || "%leaf%";
1109
+ n += s.isAtom && !s.isText ? u : u.slice(0, Math.max(0, r - o));
1110
+ }), n;
1111
+ };
1112
+ function mt(e, t, n = {}) {
1113
+ const { empty: r, ranges: s } = e.selection, o = t ? z(t, e.schema) : null;
1114
+ if (r)
1115
+ return !!(e.storedMarks || e.selection.$from.marks()).filter((d) => o ? o.name === d.type.name : !0).find((d) => G(d.attrs, n, { strict: !1 }));
1116
+ let i = 0;
1117
+ const a = [];
1118
+ if (s.forEach(({ $from: d, $to: p }) => {
1119
+ const f = d.pos, h = p.pos;
1120
+ e.doc.nodesBetween(f, h, (m, g) => {
1121
+ if (o && m.inlineContent && !m.type.allowsMarkType(o))
1122
+ return !1;
1123
+ if (!m.isText && !m.marks.length)
1124
+ return;
1125
+ const v = Math.max(f, g), b = Math.min(h, g + m.nodeSize), k = b - v;
1126
+ i += k, a.push(
1127
+ ...m.marks.map((M) => ({
1128
+ mark: M,
1129
+ from: v,
1130
+ to: b
1131
+ }))
1132
+ );
1133
+ });
1134
+ }), i === 0)
1135
+ return !1;
1136
+ const c = a.filter((d) => o ? o.name === d.mark.type.name : !0).filter((d) => G(d.mark.attrs, n, { strict: !1 })).reduce((d, p) => d + p.to - p.from, 0), l = a.filter((d) => o ? d.mark.type !== o && d.mark.type.excludes(o) : !0).reduce((d, p) => d + p.to - p.from, 0);
1137
+ return (c > 0 ? c + l : c) >= i;
1138
+ }
1139
+ function rr(e, t, n = {}) {
1140
+ if (!t)
1141
+ return U(e, null, n) || mt(e, null, n);
1142
+ const r = ot(t, e.schema);
1143
+ return r === "node" ? U(e, t, n) : r === "mark" ? mt(e, t, n) : !1;
1144
+ }
1145
+ var cs = (e, t) => {
1146
+ const { $from: n, $to: r, $anchor: s } = e.selection;
1147
+ if (t) {
1148
+ const o = it((a) => a.type.name === t)(e.selection);
1149
+ if (!o)
1150
+ return !1;
1151
+ const i = e.doc.resolve(o.pos + 1);
1152
+ return s.pos + 1 === i.end();
1153
+ }
1154
+ return !(r.parentOffset < r.parent.nodeSize - 2 || n.pos !== r.pos);
1155
+ }, ls = (e) => {
1156
+ const { $from: t, $to: n } = e.selection;
1157
+ return !(t.parentOffset > 0 || t.pos !== n.pos);
1158
+ };
1159
+ function Dt(e, t) {
1160
+ return Array.isArray(t) ? t.some((n) => (typeof n == "string" ? n : n.name) === e.name) : t;
1161
+ }
1162
+ function Bt(e, t) {
1163
+ const { nodeExtensions: n } = L(t), r = n.find((i) => i.name === e);
1164
+ if (!r)
1165
+ return !1;
1166
+ const s = {
1167
+ name: r.name,
1168
+ options: r.options,
1169
+ storage: r.storage
1170
+ }, o = x(y(r, "group", s));
1171
+ return typeof o != "string" ? !1 : o.split(" ").includes("list");
1172
+ }
1173
+ function xt(e, {
1174
+ checkChildren: t = !0,
1175
+ ignoreWhitespace: n = !1
1176
+ } = {}) {
1177
+ var r;
1178
+ if (n) {
1179
+ if (e.type.name === "hardBreak")
1180
+ return !0;
1181
+ if (e.isText)
1182
+ return /^\s*$/m.test((r = e.text) != null ? r : "");
1183
+ }
1184
+ if (e.isText)
1185
+ return !e.text;
1186
+ if (e.isAtom || e.isLeaf)
1187
+ return !1;
1188
+ if (e.content.childCount === 0)
1189
+ return !0;
1190
+ if (t) {
1191
+ let s = !0;
1192
+ return e.content.forEach((o) => {
1193
+ s !== !1 && (xt(o, { ignoreWhitespace: n, checkChildren: t }) || (s = !1));
1194
+ }), s;
1195
+ }
1196
+ return !1;
1197
+ }
1198
+ function ds(e) {
1199
+ return e instanceof nt;
1200
+ }
1201
+ var Gt = class te {
1202
+ constructor(t) {
1203
+ this.position = t;
1204
+ }
1205
+ /**
1206
+ * Creates a MappablePosition from a JSON object.
1207
+ */
1208
+ static fromJSON(t) {
1209
+ return new te(t.position);
1210
+ }
1211
+ /**
1212
+ * Converts the MappablePosition to a JSON object.
1213
+ */
1214
+ toJSON() {
1215
+ return {
1216
+ position: this.position
1217
+ };
1218
+ }
1219
+ };
1220
+ function sr(e, t) {
1221
+ const n = t.mapping.mapResult(e.position);
1222
+ return {
1223
+ position: new Gt(n.pos),
1224
+ mapResult: n
1225
+ };
1226
+ }
1227
+ function or(e) {
1228
+ return new Gt(e);
1229
+ }
1230
+ function ir(e, t, n) {
1231
+ var r;
1232
+ const { selection: s } = t;
1233
+ let o = null;
1234
+ if (Ft(s) && (o = s.$cursor), o) {
1235
+ const a = (r = e.storedMarks) != null ? r : o.marks();
1236
+ return o.parent.type.allowsMarkType(n) && (!!n.isInSet(a) || !a.some((l) => l.type.excludes(n)));
1237
+ }
1238
+ const { ranges: i } = s;
1239
+ return i.some(({ $from: a, $to: c }) => {
1240
+ let l = a.depth === 0 ? e.doc.inlineContent && e.doc.type.allowsMarkType(n) : !1;
1241
+ return e.doc.nodesBetween(a.pos, c.pos, (u, d, p) => {
1242
+ if (l)
1243
+ return !1;
1244
+ if (u.isInline) {
1245
+ const f = !p || p.type.allowsMarkType(n), h = !!n.isInSet(u.marks) || !u.marks.some((m) => m.type.excludes(n));
1246
+ l = f && h;
1247
+ }
1248
+ return !l;
1249
+ }), l;
1250
+ });
1251
+ }
1252
+ var ar = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
1253
+ const { selection: o } = n, { empty: i, ranges: a } = o, c = z(e, r.schema);
1254
+ if (s)
1255
+ if (i) {
1256
+ const l = Kt(r, c);
1257
+ n.addStoredMark(
1258
+ c.create({
1259
+ ...l,
1260
+ ...t
1261
+ })
1262
+ );
1263
+ } else
1264
+ a.forEach((l) => {
1265
+ const u = l.$from.pos, d = l.$to.pos;
1266
+ r.doc.nodesBetween(u, d, (p, f) => {
1267
+ const h = Math.max(f, u), m = Math.min(f + p.nodeSize, d);
1268
+ p.marks.find((v) => v.type === c) ? p.marks.forEach((v) => {
1269
+ c === v.type && n.addMark(
1270
+ h,
1271
+ m,
1272
+ c.create({
1273
+ ...v.attrs,
1274
+ ...t
1275
+ })
1276
+ );
1277
+ }) : n.addMark(h, m, c.create(t));
1278
+ });
1279
+ });
1280
+ return ir(r, n, c);
1281
+ }, cr = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), lr = (e, t = {}) => ({ state: n, dispatch: r, chain: s }) => {
1282
+ const o = T(e, n.schema);
1283
+ let i;
1284
+ return n.selection.$anchor.sameParent(n.selection.$head) && (i = n.selection.$anchor.parent.attrs), o.isTextblock ? s().command(({ commands: a }) => Ct(o, { ...i, ...t })(n) ? !0 : a.clearNodes()).command(({ state: a }) => Ct(o, { ...i, ...t })(a, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
1285
+ }, dr = (e) => ({ tr: t, dispatch: n }) => {
1286
+ if (n) {
1287
+ const { doc: r } = t, s = _(e, 0, r.content.size), o = nt.create(r, s);
1288
+ t.setSelection(o);
1289
+ }
1290
+ return !0;
1291
+ }, ur = (e, t) => ({ tr: n, state: r, dispatch: s }) => {
1292
+ const { selection: o } = r;
1293
+ let i, a;
1294
+ return typeof t == "number" ? (i = t, a = t) : t && "from" in t && "to" in t ? (i = t.from, a = t.to) : (i = o.from, a = o.to), s && n.doc.nodesBetween(i, a, (c, l) => {
1295
+ c.isText || n.setNodeMarkup(l, void 0, {
1296
+ ...c.attrs,
1297
+ dir: e
1298
+ });
1299
+ }), !0;
1300
+ }, fr = (e) => ({ tr: t, dispatch: n }) => {
1301
+ if (n) {
1302
+ const { doc: r } = t, { from: s, to: o } = typeof e == "number" ? { from: e, to: e } : e, i = P.atStart(r).from, a = P.atEnd(r).to, c = _(s, i, a), l = _(o, i, a), u = P.create(r, c, l);
1303
+ t.setSelection(u);
1304
+ }
1305
+ return !0;
1306
+ }, pr = (e) => ({ state: t, dispatch: n }) => {
1307
+ const r = T(e, t.schema);
1308
+ return Ke(r)(t, n);
1309
+ };
1310
+ function Ot(e, t) {
1311
+ const n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
1312
+ if (n) {
1313
+ const r = n.filter((s) => t?.includes(s.type.name));
1314
+ e.tr.ensureMarks(r);
1315
+ }
1316
+ }
1317
+ var hr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: s }) => {
1318
+ const { selection: o, doc: i } = t, { $from: a, $to: c } = o, l = s.extensionManager.attributes, u = Z(l, a.node().type.name, a.node().attrs);
1319
+ if (o instanceof nt && o.node.isBlock)
1320
+ return !a.parentOffset || !X(i, a.pos) ? !1 : (r && (e && Ot(n, s.extensionManager.splittableMarks), t.split(a.pos).scrollIntoView()), !0);
1321
+ if (!a.parent.isBlock)
1322
+ return !1;
1323
+ const d = c.parentOffset === c.parent.content.size, p = a.depth === 0 ? void 0 : Vn(a.node(-1).contentMatchAt(a.indexAfter(-1)));
1324
+ let f = d && p ? [
1325
+ {
1326
+ type: p,
1327
+ attrs: u
1328
+ }
1329
+ ] : void 0, h = X(t.doc, t.mapping.map(a.pos), 1, f);
1330
+ if (!f && !h && X(t.doc, t.mapping.map(a.pos), 1, p ? [{ type: p }] : void 0) && (h = !0, f = p ? [
1331
+ {
1332
+ type: p,
1333
+ attrs: u
1334
+ }
1335
+ ] : void 0), r) {
1336
+ if (h && (o instanceof P && t.deleteSelection(), t.split(t.mapping.map(a.pos), 1, f), p && !d && !a.parentOffset && a.parent.type !== p)) {
1337
+ const m = t.mapping.map(a.before()), g = t.doc.resolve(m);
1338
+ a.node(-1).canReplaceWith(g.index(), g.index() + 1, p) && t.setNodeMarkup(t.mapping.map(a.before()), p);
1339
+ }
1340
+ e && Ot(n, s.extensionManager.splittableMarks), t.scrollIntoView();
1341
+ }
1342
+ return h;
1343
+ }, mr = (e, t = {}) => ({ tr: n, state: r, dispatch: s, editor: o }) => {
1344
+ var i;
1345
+ const a = T(e, r.schema), { $from: c, $to: l } = r.selection, u = r.selection.node;
1346
+ if (u && u.isBlock || c.depth < 2 || !c.sameParent(l))
1347
+ return !1;
1348
+ const d = c.node(-1);
1349
+ if (d.type !== a)
1350
+ return !1;
1351
+ const p = o.extensionManager.attributes;
1352
+ if (c.parent.content.size === 0 && c.node(-1).childCount === c.indexAfter(-1)) {
1353
+ if (c.depth === 2 || c.node(-3).type !== a || c.index(-2) !== c.node(-2).childCount - 1)
1354
+ return !1;
1355
+ if (s) {
1356
+ let v = D.empty;
1357
+ const b = c.index(-1) ? 1 : c.index(-2) ? 2 : 3;
1358
+ for (let C = c.depth - b; C >= c.depth - 3; C -= 1)
1359
+ v = D.from(c.node(C).copy(v));
1360
+ const k = (
1361
+ // eslint-disable-next-line no-nested-ternary
1362
+ c.indexAfter(-1) < c.node(-2).childCount ? 1 : c.indexAfter(-2) < c.node(-3).childCount ? 2 : 3
1363
+ ), M = {
1364
+ ...Z(p, c.node().type.name, c.node().attrs),
1365
+ ...t
1366
+ }, w = ((i = a.contentMatch.defaultType) == null ? void 0 : i.createAndFill(M)) || void 0;
1367
+ v = v.append(D.from(a.createAndFill(null, w) || void 0));
1368
+ const S = c.before(c.depth - (b - 1));
1369
+ n.replace(S, c.after(-k), new We(v, 4 - b, 0));
1370
+ let E = -1;
1371
+ n.doc.nodesBetween(S, n.doc.content.size, (C, A) => {
1372
+ if (E > -1)
1373
+ return !1;
1374
+ C.isTextblock && C.content.size === 0 && (E = A + 1);
1375
+ }), E > -1 && n.setSelection(P.near(n.doc.resolve(E))), n.scrollIntoView();
1376
+ }
1377
+ return !0;
1378
+ }
1379
+ const f = l.pos === c.end() ? d.contentMatchAt(0).defaultType : null, h = {
1380
+ ...Z(p, d.type.name, d.attrs),
1381
+ ...t
1382
+ }, m = {
1383
+ ...Z(p, c.node().type.name, c.node().attrs),
1384
+ ...t
1385
+ };
1386
+ n.delete(c.pos, l.pos);
1387
+ const g = f ? [
1388
+ { type: a, attrs: h },
1389
+ { type: f, attrs: m }
1390
+ ] : [{ type: a, attrs: h }];
1391
+ if (!X(n.doc, c.pos, 2))
1392
+ return !1;
1393
+ if (s) {
1394
+ const { selection: v, storedMarks: b } = r, { splittableMarks: k } = o.extensionManager, M = b || v.$to.parentOffset && v.$from.marks();
1395
+ if (n.split(c.pos, 2, g).scrollIntoView(), !M || !s)
1396
+ return !0;
1397
+ const w = M.filter((S) => k.includes(S.type.name));
1398
+ n.ensureMarks(w);
1399
+ }
1400
+ return !0;
1401
+ }, ft = (e, t) => {
1402
+ const n = it((i) => i.type === t)(e.selection);
1403
+ if (!n)
1404
+ return !0;
1405
+ const r = e.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
1406
+ if (r === void 0)
1407
+ return !0;
1408
+ const s = e.doc.nodeAt(r);
1409
+ return n.node.type === s?.type && gt(e.doc, n.pos) && e.join(n.pos), !0;
1410
+ }, pt = (e, t) => {
1411
+ const n = it((i) => i.type === t)(e.selection);
1412
+ if (!n)
1413
+ return !0;
1414
+ const r = e.doc.resolve(n.start).after(n.depth);
1415
+ if (r === void 0)
1416
+ return !0;
1417
+ const s = e.doc.nodeAt(r);
1418
+ return n.node.type === s?.type && gt(e.doc, r) && e.join(r), !0;
1419
+ }, gr = (e, t, n, r = {}) => ({ editor: s, tr: o, state: i, dispatch: a, chain: c, commands: l, can: u }) => {
1420
+ const { extensions: d, splittableMarks: p } = s.extensionManager, f = T(e, i.schema), h = T(t, i.schema), { selection: m, storedMarks: g } = i, { $from: v, $to: b } = m, k = v.blockRange(b), M = g || m.$to.parentOffset && m.$from.marks();
1421
+ if (!k)
1422
+ return !1;
1423
+ const w = it((S) => Bt(S.type.name, d))(m);
1424
+ if (k.depth >= 1 && w && k.depth - w.depth <= 1) {
1425
+ if (w.node.type === f)
1426
+ return l.liftListItem(h);
1427
+ if (Bt(w.node.type.name, d) && f.validContent(w.node.content) && a)
1428
+ return c().command(() => (o.setNodeMarkup(w.pos, f), !0)).command(() => ft(o, f)).command(() => pt(o, f)).run();
1429
+ }
1430
+ return !n || !M || !a ? c().command(() => u().wrapInList(f, r) ? !0 : l.clearNodes()).wrapInList(f, r).command(() => ft(o, f)).command(() => pt(o, f)).run() : c().command(() => {
1431
+ const S = u().wrapInList(f, r), E = M.filter((C) => p.includes(C.type.name));
1432
+ return o.ensureMarks(E), S ? !0 : l.clearNodes();
1433
+ }).wrapInList(f, r).command(() => ft(o, f)).command(() => pt(o, f)).run();
1434
+ }, vr = (e, t = {}, n = {}) => ({ state: r, commands: s }) => {
1435
+ const { extendEmptyMarkRange: o = !1 } = n, i = z(e, r.schema);
1436
+ return mt(r, i, t) ? s.unsetMark(i, { extendEmptyMarkRange: o }) : s.setMark(i, t);
1437
+ }, yr = (e, t, n = {}) => ({ state: r, commands: s }) => {
1438
+ const o = T(e, r.schema), i = T(t, r.schema), a = U(r, o, n);
1439
+ let c;
1440
+ return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), a ? s.setNode(i, c) : s.setNode(o, { ...c, ...n });
1441
+ }, br = (e, t = {}) => ({ state: n, commands: r }) => {
1442
+ const s = T(e, n.schema);
1443
+ return U(n, s, t) ? r.lift(s) : r.wrapIn(s, t);
1444
+ }, wr = () => ({ state: e, dispatch: t }) => {
1445
+ const n = e.plugins;
1446
+ for (let r = 0; r < n.length; r += 1) {
1447
+ const s = n[r];
1448
+ let o;
1449
+ if (s.spec.isInputRules && (o = s.getState(e))) {
1450
+ if (t) {
1451
+ const i = e.tr, a = o.transform;
1452
+ for (let c = a.steps.length - 1; c >= 0; c -= 1)
1453
+ i.step(a.steps[c].invert(a.docs[c]));
1454
+ if (o.text) {
1455
+ const c = i.doc.resolve(o.from).marks();
1456
+ i.replaceWith(o.from, o.to, e.schema.text(o.text, c));
1457
+ } else
1458
+ i.delete(o.from, o.to);
1459
+ }
1460
+ return !0;
1461
+ }
1462
+ }
1463
+ return !1;
1464
+ }, kr = () => ({ tr: e, dispatch: t }) => {
1465
+ const { selection: n } = e, { empty: r, ranges: s } = n;
1466
+ return r || t && s.forEach((o) => {
1467
+ e.removeMark(o.$from.pos, o.$to.pos);
1468
+ }), !0;
1469
+ }, Mr = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
1470
+ var o;
1471
+ const { extendEmptyMarkRange: i = !1 } = t, { selection: a } = n, c = z(e, r.schema), { $from: l, empty: u, ranges: d } = a;
1472
+ if (!s)
1473
+ return !0;
1474
+ if (u && i) {
1475
+ let { from: p, to: f } = a;
1476
+ const h = (o = l.marks().find((g) => g.type === c)) == null ? void 0 : o.attrs, m = bt(l, c, h);
1477
+ m && (p = m.from, f = m.to), n.removeMark(p, f, c);
1478
+ } else
1479
+ d.forEach((p) => {
1480
+ n.removeMark(p.$from.pos, p.$to.pos, c);
1481
+ });
1482
+ return n.removeStoredMark(c), !0;
1483
+ }, xr = (e) => ({ tr: t, state: n, dispatch: r }) => {
1484
+ const { selection: s } = n;
1485
+ let o, i;
1486
+ return typeof e == "number" ? (o = e, i = e) : e && "from" in e && "to" in e ? (o = e.from, i = e.to) : (o = s.from, i = s.to), r && t.doc.nodesBetween(o, i, (a, c) => {
1487
+ if (a.isText)
1488
+ return;
1489
+ const l = { ...a.attrs };
1490
+ delete l.dir, t.setNodeMarkup(c, void 0, l);
1491
+ }), !0;
1492
+ }, Sr = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
1493
+ let o = null, i = null;
1494
+ const a = ot(
1495
+ typeof e == "string" ? e : e.name,
1496
+ r.schema
1497
+ );
1498
+ if (!a)
1499
+ return !1;
1500
+ a === "node" && (o = T(e, r.schema)), a === "mark" && (i = z(e, r.schema));
1501
+ let c = !1;
1502
+ return n.selection.ranges.forEach((l) => {
1503
+ const u = l.$from.pos, d = l.$to.pos;
1504
+ let p, f, h, m;
1505
+ n.selection.empty ? r.doc.nodesBetween(u, d, (g, v) => {
1506
+ o && o === g.type && (c = !0, h = Math.max(v, u), m = Math.min(v + g.nodeSize, d), p = v, f = g);
1507
+ }) : r.doc.nodesBetween(u, d, (g, v) => {
1508
+ v < u && o && o === g.type && (c = !0, h = Math.max(v, u), m = Math.min(v + g.nodeSize, d), p = v, f = g), v >= u && v <= d && (o && o === g.type && (c = !0, s && n.setNodeMarkup(v, void 0, {
1509
+ ...g.attrs,
1510
+ ...t
1511
+ })), i && g.marks.length && g.marks.forEach((b) => {
1512
+ if (i === b.type && (c = !0, s)) {
1513
+ const k = Math.max(v, u), M = Math.min(v + g.nodeSize, d);
1514
+ n.addMark(
1515
+ k,
1516
+ M,
1517
+ i.create({
1518
+ ...b.attrs,
1519
+ ...t
1520
+ })
1521
+ );
1522
+ }
1523
+ }));
1524
+ }), f && (p !== void 0 && s && n.setNodeMarkup(p, void 0, {
1525
+ ...f.attrs,
1526
+ ...t
1527
+ }), i && f.marks.length && f.marks.forEach((g) => {
1528
+ i === g.type && s && n.addMark(
1529
+ h,
1530
+ m,
1531
+ i.create({
1532
+ ...g.attrs,
1533
+ ...t
1534
+ })
1535
+ );
1536
+ }));
1537
+ }), c;
1538
+ }, Er = (e, t = {}) => ({ state: n, dispatch: r }) => {
1539
+ const s = T(e, n.schema);
1540
+ return je(s, t)(n, r);
1541
+ }, Tr = (e, t = {}) => ({ state: n, dispatch: r }) => {
1542
+ const s = T(e, n.schema);
1543
+ return qe(s, t)(n, r);
1544
+ }, Cr = class {
1545
+ constructor() {
1546
+ this.callbacks = {};
1547
+ }
1548
+ on(e, t) {
1549
+ return this.callbacks[e] || (this.callbacks[e] = []), this.callbacks[e].push(t), this;
1550
+ }
1551
+ emit(e, ...t) {
1552
+ const n = this.callbacks[e];
1553
+ return n && n.forEach((r) => r.apply(this, t)), this;
1554
+ }
1555
+ off(e, t) {
1556
+ const n = this.callbacks[e];
1557
+ return n && (t ? this.callbacks[e] = n.filter((r) => r !== t) : delete this.callbacks[e]), this;
1558
+ }
1559
+ once(e, t) {
1560
+ const n = (...r) => {
1561
+ this.off(e, n), t.apply(this, r);
1562
+ };
1563
+ return this.on(e, n);
1564
+ }
1565
+ removeAllListeners() {
1566
+ this.callbacks = {};
1567
+ }
1568
+ }, at = class {
1569
+ constructor(e) {
1570
+ var t;
1571
+ this.find = e.find, this.handler = e.handler, this.undoable = (t = e.undoable) != null ? t : !0;
1572
+ }
1573
+ }, Ar = (e, t) => {
1574
+ if (yt(t))
1575
+ return t.exec(e);
1576
+ const n = t(e);
1577
+ if (!n)
1578
+ return null;
1579
+ const r = [n.text];
1580
+ return r.index = n.index, r.input = e, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(n.replaceWith)), r;
1581
+ };
1582
+ function J(e) {
1583
+ var t;
1584
+ const { editor: n, from: r, to: s, text: o, rules: i, plugin: a } = e, { view: c } = n;
1585
+ if (c.composing)
1586
+ return !1;
1587
+ const l = c.state.doc.resolve(r);
1588
+ if (
1589
+ // check for code node
1590
+ l.parent.type.spec.code || (t = l.nodeBefore || l.nodeAfter) != null && t.marks.find((p) => p.type.spec.code)
1591
+ )
1592
+ return !1;
1593
+ let u = !1;
1594
+ const d = nr(l) + o;
1595
+ return i.forEach((p) => {
1596
+ if (u)
1597
+ return;
1598
+ const f = Ar(d, p.find);
1599
+ if (!f)
1600
+ return;
1601
+ const h = c.state.tr, m = rt({
1602
+ state: c.state,
1603
+ transaction: h
1604
+ }), g = {
1605
+ from: r - (f[0].length - o.length),
1606
+ to: s
1607
+ }, { commands: v, chain: b, can: k } = new st({
1608
+ editor: n,
1609
+ state: m
1610
+ });
1611
+ p.handler({
1612
+ state: m,
1613
+ range: g,
1614
+ match: f,
1615
+ commands: v,
1616
+ chain: b,
1617
+ can: k
1618
+ }) === null || !h.steps.length || (p.undoable && h.setMeta(a, {
1619
+ transform: h,
1620
+ from: r,
1621
+ to: s,
1622
+ text: o
1623
+ }), c.dispatch(h), u = !0);
1624
+ }), u;
1625
+ }
1626
+ function Pr(e) {
1627
+ const { editor: t, rules: n } = e, r = new $({
1628
+ state: {
1629
+ init() {
1630
+ return null;
1631
+ },
1632
+ apply(s, o, i) {
1633
+ const a = s.getMeta(r);
1634
+ if (a)
1635
+ return a;
1636
+ const c = s.getMeta("applyInputRules");
1637
+ return c && setTimeout(() => {
1638
+ let { text: u } = c;
1639
+ typeof u == "string" ? u = u : u = kt(D.from(u), i.schema);
1640
+ const { from: d } = c, p = d + u.length;
1641
+ J({
1642
+ editor: t,
1643
+ from: d,
1644
+ to: p,
1645
+ text: u,
1646
+ rules: n,
1647
+ plugin: r
1648
+ });
1649
+ }), s.selectionSet || s.docChanged ? null : o;
1650
+ }
1651
+ },
1652
+ props: {
1653
+ handleTextInput(s, o, i, a) {
1654
+ return J({
1655
+ editor: t,
1656
+ from: o,
1657
+ to: i,
1658
+ text: a,
1659
+ rules: n,
1660
+ plugin: r
1661
+ });
1662
+ },
1663
+ handleDOMEvents: {
1664
+ compositionend: (s) => (setTimeout(() => {
1665
+ const { $cursor: o } = s.state.selection;
1666
+ o && J({
1667
+ editor: t,
1668
+ from: o.pos,
1669
+ to: o.pos,
1670
+ text: "",
1671
+ rules: n,
1672
+ plugin: r
1673
+ });
1674
+ }), !1)
1675
+ },
1676
+ // add support for input rules to trigger on enter
1677
+ // this is useful for example for code blocks
1678
+ handleKeyDown(s, o) {
1679
+ if (o.key !== "Enter")
1680
+ return !1;
1681
+ const { $cursor: i } = s.state.selection;
1682
+ return i ? J({
1683
+ editor: t,
1684
+ from: i.pos,
1685
+ to: i.pos,
1686
+ text: `
1687
+ `,
1688
+ rules: n,
1689
+ plugin: r
1690
+ }) : !1;
1691
+ }
1692
+ },
1693
+ // @ts-ignore
1694
+ isInputRules: !0
1695
+ });
1696
+ return r;
1697
+ }
1698
+ function $r(e) {
1699
+ return Object.prototype.toString.call(e).slice(8, -1);
1700
+ }
1701
+ function Y(e) {
1702
+ return $r(e) !== "Object" ? !1 : e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype;
1703
+ }
1704
+ function ee(e, t) {
1705
+ const n = { ...e };
1706
+ return Y(e) && Y(t) && Object.keys(t).forEach((r) => {
1707
+ Y(t[r]) && Y(e[r]) ? n[r] = ee(e[r], t[r]) : n[r] = t[r];
1708
+ }), n;
1709
+ }
1710
+ var St = class {
1711
+ constructor(e = {}) {
1712
+ this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = {
1713
+ name: this.name
1714
+ }, this.config = {
1715
+ ...this.config,
1716
+ ...e
1717
+ }, this.name = this.config.name;
1718
+ }
1719
+ get options() {
1720
+ return {
1721
+ ...x(
1722
+ y(this, "addOptions", {
1723
+ name: this.name
1724
+ })
1725
+ ) || {}
1726
+ };
1727
+ }
1728
+ get storage() {
1729
+ return {
1730
+ ...x(
1731
+ y(this, "addStorage", {
1732
+ name: this.name,
1733
+ options: this.options
1734
+ })
1735
+ ) || {}
1736
+ };
1737
+ }
1738
+ configure(e = {}) {
1739
+ const t = this.extend({
1740
+ ...this.config,
1741
+ addOptions: () => ee(this.options, e)
1742
+ });
1743
+ return t.name = this.name, t.parent = this.parent, t;
1744
+ }
1745
+ extend(e = {}) {
1746
+ const t = new this.constructor({ ...this.config, ...e });
1747
+ return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
1748
+ }
1749
+ }, Nr = class ne extends St {
1750
+ constructor() {
1751
+ super(...arguments), this.type = "mark";
1752
+ }
1753
+ /**
1754
+ * Create a new Mark instance
1755
+ * @param config - Mark configuration object or a function that returns a configuration object
1756
+ */
1757
+ static create(t = {}) {
1758
+ const n = typeof t == "function" ? t() : t;
1759
+ return new ne(n);
1760
+ }
1761
+ static handleExit({ editor: t, mark: n }) {
1762
+ const { tr: r } = t.state, s = t.state.selection.$from;
1763
+ if (s.pos === s.end()) {
1764
+ const i = s.marks();
1765
+ if (!!!i.find((l) => l?.type.name === n.name))
1766
+ return !1;
1767
+ const c = i.find((l) => l?.type.name === n.name);
1768
+ return c && r.removeStoredMark(c), r.insertText(" ", s.pos), t.view.dispatch(r), !0;
1769
+ }
1770
+ return !1;
1771
+ }
1772
+ configure(t) {
1773
+ return super.configure(t);
1774
+ }
1775
+ extend(t) {
1776
+ const n = typeof t == "function" ? t() : t;
1777
+ return super.extend(n);
1778
+ }
1779
+ };
1780
+ function Rr(e) {
1781
+ return typeof e == "number";
1782
+ }
1783
+ var zr = class {
1784
+ constructor(e) {
1785
+ this.find = e.find, this.handler = e.handler;
1786
+ }
1787
+ }, Ir = (e, t, n) => {
1788
+ if (yt(t))
1789
+ return [...e.matchAll(t)];
1790
+ const r = t(e, n);
1791
+ return r ? r.map((s) => {
1792
+ const o = [s.text];
1793
+ return o.index = s.index, o.input = e, 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;
1794
+ }) : [];
1795
+ };
1796
+ function Dr(e) {
1797
+ const { editor: t, state: n, from: r, to: s, rule: o, pasteEvent: i, dropEvent: a } = e, { commands: c, chain: l, can: u } = new st({
1798
+ editor: t,
1799
+ state: n
1800
+ }), d = [];
1801
+ return n.doc.nodesBetween(r, s, (f, h) => {
1802
+ var m, g, v, b, k;
1803
+ if ((g = (m = f.type) == null ? void 0 : m.spec) != null && g.code || !(f.isText || f.isTextblock || f.isInline))
1804
+ return;
1805
+ const M = (k = (b = (v = f.content) == null ? void 0 : v.size) != null ? b : f.nodeSize) != null ? k : 0, w = Math.max(r, h), S = Math.min(s, h + M);
1806
+ if (w >= S)
1807
+ return;
1808
+ const E = f.isText ? f.text || "" : f.textBetween(w - h, S - h, void 0, "");
1809
+ Ir(E, o.find, i).forEach((A) => {
1810
+ if (A.index === void 0)
1811
+ return;
1812
+ const O = w + A.index + 1, lt = O + A[0].length, K = {
1813
+ from: n.tr.mapping.map(O),
1814
+ to: n.tr.mapping.map(lt)
1815
+ }, dt = o.handler({
1816
+ state: n,
1817
+ range: K,
1818
+ match: A,
1819
+ commands: c,
1820
+ chain: l,
1821
+ can: u,
1822
+ pasteEvent: i,
1823
+ dropEvent: a
1824
+ });
1825
+ d.push(dt);
1826
+ });
1827
+ }), d.every((f) => f !== null);
1828
+ }
1829
+ var Q = null, Br = (e) => {
1830
+ var t;
1831
+ const n = new ClipboardEvent("paste", {
1832
+ clipboardData: new DataTransfer()
1833
+ });
1834
+ return (t = n.clipboardData) == null || t.setData("text/html", e), n;
1835
+ };
1836
+ function Or(e) {
1837
+ const { editor: t, rules: n } = e;
1838
+ let r = null, s = !1, o = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, a;
1839
+ try {
1840
+ a = typeof DragEvent < "u" ? new DragEvent("drop") : null;
1841
+ } catch {
1842
+ a = null;
1843
+ }
1844
+ const c = ({
1845
+ state: u,
1846
+ from: d,
1847
+ to: p,
1848
+ rule: f,
1849
+ pasteEvt: h
1850
+ }) => {
1851
+ const m = u.tr, g = rt({
1852
+ state: u,
1853
+ transaction: m
1854
+ });
1855
+ if (!(!Dr({
1856
+ editor: t,
1857
+ state: g,
1858
+ from: Math.max(d - 1, 0),
1859
+ to: p.b - 1,
1860
+ rule: f,
1861
+ pasteEvent: h,
1862
+ dropEvent: a
1863
+ }) || !m.steps.length)) {
1864
+ try {
1865
+ a = typeof DragEvent < "u" ? new DragEvent("drop") : null;
1866
+ } catch {
1867
+ a = null;
1868
+ }
1869
+ return i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, m;
1870
+ }
1871
+ };
1872
+ return n.map((u) => new $({
1873
+ // we register a global drag handler to track the current drag source element
1874
+ view(d) {
1875
+ const p = (h) => {
1876
+ var m;
1877
+ r = (m = d.dom.parentElement) != null && m.contains(h.target) ? d.dom.parentElement : null, r && (Q = t);
1878
+ }, f = () => {
1879
+ Q && (Q = null);
1880
+ };
1881
+ return window.addEventListener("dragstart", p), window.addEventListener("dragend", f), {
1882
+ destroy() {
1883
+ window.removeEventListener("dragstart", p), window.removeEventListener("dragend", f);
1884
+ }
1885
+ };
1886
+ },
1887
+ props: {
1888
+ handleDOMEvents: {
1889
+ drop: (d, p) => {
1890
+ if (o = r === d.dom.parentElement, a = p, !o) {
1891
+ const f = Q;
1892
+ f?.isEditable && setTimeout(() => {
1893
+ const h = f.state.selection;
1894
+ h && f.commands.deleteRange({ from: h.from, to: h.to });
1895
+ }, 10);
1896
+ }
1897
+ return !1;
1898
+ },
1899
+ paste: (d, p) => {
1900
+ var f;
1901
+ const h = (f = p.clipboardData) == null ? void 0 : f.getData("text/html");
1902
+ return i = p, s = !!h?.includes("data-pm-slice"), !1;
1903
+ }
1904
+ }
1905
+ },
1906
+ appendTransaction: (d, p, f) => {
1907
+ const h = d[0], m = h.getMeta("uiEvent") === "paste" && !s, g = h.getMeta("uiEvent") === "drop" && !o, v = h.getMeta("applyPasteRules"), b = !!v;
1908
+ if (!m && !g && !b)
1909
+ return;
1910
+ if (b) {
1911
+ let { text: w } = v;
1912
+ typeof w == "string" ? w = w : w = kt(D.from(w), f.schema);
1913
+ const { from: S } = v, E = S + w.length, C = Br(w);
1914
+ return c({
1915
+ rule: u,
1916
+ state: f,
1917
+ from: S,
1918
+ to: { b: E },
1919
+ pasteEvt: C
1920
+ });
1921
+ }
1922
+ const k = p.doc.content.findDiffStart(f.doc.content), M = p.doc.content.findDiffEnd(f.doc.content);
1923
+ if (!(!Rr(k) || !M || k === M.b))
1924
+ return c({
1925
+ rule: u,
1926
+ state: f,
1927
+ from: k,
1928
+ to: M,
1929
+ pasteEvt: i
1930
+ });
1931
+ }
1932
+ }));
1933
+ }
1934
+ var ct = class {
1935
+ constructor(e, t) {
1936
+ this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions = Mt(e), this.schema = Yt(this.extensions, t), this.setupExtensions();
1937
+ }
1938
+ /**
1939
+ * Get all commands from the extensions.
1940
+ * @returns An object with all commands where the key is the command name and the value is the command function
1941
+ */
1942
+ get commands() {
1943
+ return this.extensions.reduce((e, t) => {
1944
+ const n = {
1945
+ name: t.name,
1946
+ options: t.options,
1947
+ storage: this.editor.extensionStorage[t.name],
1948
+ editor: this.editor,
1949
+ type: H(t.name, this.schema)
1950
+ }, r = y(t, "addCommands", n);
1951
+ return r ? {
1952
+ ...e,
1953
+ ...r()
1954
+ } : e;
1955
+ }, {});
1956
+ }
1957
+ /**
1958
+ * Get all registered Prosemirror plugins from the extensions.
1959
+ * @returns An array of Prosemirror plugins
1960
+ */
1961
+ get plugins() {
1962
+ const { editor: e } = this;
1963
+ return V([...this.extensions].reverse()).flatMap((r) => {
1964
+ const s = {
1965
+ name: r.name,
1966
+ options: r.options,
1967
+ storage: this.editor.extensionStorage[r.name],
1968
+ editor: e,
1969
+ type: H(r.name, this.schema)
1970
+ }, o = [], i = y(
1971
+ r,
1972
+ "addKeyboardShortcuts",
1973
+ s
1974
+ );
1975
+ let a = {};
1976
+ if (r.type === "mark" && y(r, "exitable", s) && (a.ArrowRight = () => Nr.handleExit({ editor: e, mark: r })), i) {
1977
+ const p = Object.fromEntries(
1978
+ Object.entries(i()).map(([f, h]) => [f, () => h({ editor: e })])
1979
+ );
1980
+ a = { ...a, ...p };
1981
+ }
1982
+ const c = Ye(a);
1983
+ o.push(c);
1984
+ const l = y(r, "addInputRules", s);
1985
+ if (Dt(r, e.options.enableInputRules) && l) {
1986
+ const p = l();
1987
+ if (p && p.length) {
1988
+ const f = Pr({
1989
+ editor: e,
1990
+ rules: p
1991
+ }), h = Array.isArray(f) ? f : [f];
1992
+ o.push(...h);
1993
+ }
1994
+ }
1995
+ const u = y(r, "addPasteRules", s);
1996
+ if (Dt(r, e.options.enablePasteRules) && u) {
1997
+ const p = u();
1998
+ if (p && p.length) {
1999
+ const f = Or({ editor: e, rules: p });
2000
+ o.push(...f);
2001
+ }
2002
+ }
2003
+ const d = y(
2004
+ r,
2005
+ "addProseMirrorPlugins",
2006
+ s
2007
+ );
2008
+ if (d) {
2009
+ const p = d();
2010
+ o.push(...p);
2011
+ }
2012
+ return o;
2013
+ });
2014
+ }
2015
+ /**
2016
+ * Get all attributes from the extensions.
2017
+ * @returns An array of attributes
2018
+ */
2019
+ get attributes() {
2020
+ return Jt(this.extensions);
2021
+ }
2022
+ /**
2023
+ * Get all node views from the extensions.
2024
+ * @returns An object with all node views where the key is the node name and the value is the node view function
2025
+ */
2026
+ get nodeViews() {
2027
+ const { editor: e } = this, { nodeExtensions: t } = L(this.extensions);
2028
+ return Object.fromEntries(
2029
+ t.filter((n) => !!y(n, "addNodeView")).map((n) => {
2030
+ const r = this.attributes.filter((c) => c.type === n.name), s = {
2031
+ name: n.name,
2032
+ options: n.options,
2033
+ storage: this.editor.extensionStorage[n.name],
2034
+ editor: e,
2035
+ type: T(n.name, this.schema)
2036
+ }, o = y(n, "addNodeView", s);
2037
+ if (!o)
2038
+ return [];
2039
+ const i = o();
2040
+ if (!i)
2041
+ return [];
2042
+ const a = (c, l, u, d, p) => {
2043
+ const f = et(c, r);
2044
+ return i({
2045
+ // pass-through
2046
+ node: c,
2047
+ view: l,
2048
+ getPos: u,
2049
+ decorations: d,
2050
+ innerDecorations: p,
2051
+ // tiptap-specific
2052
+ editor: e,
2053
+ extension: n,
2054
+ HTMLAttributes: f
2055
+ });
2056
+ };
2057
+ return [n.name, a];
2058
+ })
2059
+ );
2060
+ }
2061
+ /**
2062
+ * Get the composed dispatchTransaction function from all extensions.
2063
+ * @param baseDispatch The base dispatch function (e.g. from the editor or user props)
2064
+ * @returns A composed dispatch function
2065
+ */
2066
+ dispatchTransaction(e) {
2067
+ const { editor: t } = this;
2068
+ return V([...this.extensions].reverse()).reduceRight((r, s) => {
2069
+ const o = {
2070
+ name: s.name,
2071
+ options: s.options,
2072
+ storage: this.editor.extensionStorage[s.name],
2073
+ editor: t,
2074
+ type: H(s.name, this.schema)
2075
+ }, i = y(
2076
+ s,
2077
+ "dispatchTransaction",
2078
+ o
2079
+ );
2080
+ return i ? (a) => {
2081
+ i.call(o, { transaction: a, next: r });
2082
+ } : r;
2083
+ }, e);
2084
+ }
2085
+ /**
2086
+ * Get the composed transformPastedHTML function from all extensions.
2087
+ * @param baseTransform The base transform function (e.g. from the editor props)
2088
+ * @returns A composed transform function that chains all extension transforms
2089
+ */
2090
+ transformPastedHTML(e) {
2091
+ const { editor: t } = this;
2092
+ return V([...this.extensions]).reduce(
2093
+ (r, s) => {
2094
+ const o = {
2095
+ name: s.name,
2096
+ options: s.options,
2097
+ storage: this.editor.extensionStorage[s.name],
2098
+ editor: t,
2099
+ type: H(s.name, this.schema)
2100
+ }, i = y(
2101
+ s,
2102
+ "transformPastedHTML",
2103
+ o
2104
+ );
2105
+ return i ? (a, c) => {
2106
+ const l = r(a, c);
2107
+ return i.call(o, l);
2108
+ } : r;
2109
+ },
2110
+ e || ((r) => r)
2111
+ );
2112
+ }
2113
+ get markViews() {
2114
+ const { editor: e } = this, { markExtensions: t } = L(this.extensions);
2115
+ return Object.fromEntries(
2116
+ t.filter((n) => !!y(n, "addMarkView")).map((n) => {
2117
+ const r = this.attributes.filter((a) => a.type === n.name), s = {
2118
+ name: n.name,
2119
+ options: n.options,
2120
+ storage: this.editor.extensionStorage[n.name],
2121
+ editor: e,
2122
+ type: z(n.name, this.schema)
2123
+ }, o = y(n, "addMarkView", s);
2124
+ if (!o)
2125
+ return [];
2126
+ const i = (a, c, l) => {
2127
+ const u = et(a, r);
2128
+ return o()({
2129
+ // pass-through
2130
+ mark: a,
2131
+ view: c,
2132
+ inline: l,
2133
+ // tiptap-specific
2134
+ editor: e,
2135
+ extension: n,
2136
+ HTMLAttributes: u,
2137
+ updateAttributes: (d) => {
2138
+ Xr(a, e, d);
2139
+ }
2140
+ });
2141
+ };
2142
+ return [n.name, i];
2143
+ })
2144
+ );
2145
+ }
2146
+ /**
2147
+ * Go through all extensions, create extension storages & setup marks
2148
+ * & bind editor event listener.
2149
+ */
2150
+ setupExtensions() {
2151
+ const e = this.extensions;
2152
+ this.editor.extensionStorage = Object.fromEntries(
2153
+ e.map((t) => [t.name, t.storage])
2154
+ ), e.forEach((t) => {
2155
+ var n;
2156
+ const r = {
2157
+ name: t.name,
2158
+ options: t.options,
2159
+ storage: this.editor.extensionStorage[t.name],
2160
+ editor: this.editor,
2161
+ type: H(t.name, this.schema)
2162
+ };
2163
+ t.type === "mark" && ((n = x(y(t, "keepOnSplit", r))) == null || n) && this.splittableMarks.push(t.name);
2164
+ const s = y(t, "onBeforeCreate", r), o = y(t, "onCreate", r), i = y(t, "onUpdate", r), a = y(
2165
+ t,
2166
+ "onSelectionUpdate",
2167
+ r
2168
+ ), c = y(t, "onTransaction", r), l = y(t, "onFocus", r), u = y(t, "onBlur", r), d = y(t, "onDestroy", r);
2169
+ s && this.editor.on("beforeCreate", s), o && this.editor.on("create", o), i && this.editor.on("update", i), a && this.editor.on("selectionUpdate", a), c && this.editor.on("transaction", c), l && this.editor.on("focus", l), u && this.editor.on("blur", u), d && this.editor.on("destroy", d);
2170
+ });
2171
+ }
2172
+ };
2173
+ ct.resolve = Mt;
2174
+ ct.sort = V;
2175
+ ct.flatten = wt;
2176
+ var _r = {};
2177
+ vt(_r, {
2178
+ ClipboardTextSerializer: () => se,
2179
+ Commands: () => oe,
2180
+ Delete: () => ie,
2181
+ Drop: () => ae,
2182
+ Editable: () => ce,
2183
+ FocusEvents: () => de,
2184
+ Keymap: () => ue,
2185
+ Paste: () => fe,
2186
+ Tabindex: () => pe,
2187
+ TextDirection: () => he,
2188
+ focusEventsPluginKey: () => le
2189
+ });
2190
+ var N = class re extends St {
2191
+ constructor() {
2192
+ super(...arguments), this.type = "extension";
2193
+ }
2194
+ /**
2195
+ * Create a new Extension instance
2196
+ * @param config - Extension configuration object or a function that returns a configuration object
2197
+ */
2198
+ static create(t = {}) {
2199
+ const n = typeof t == "function" ? t() : t;
2200
+ return new re(n);
2201
+ }
2202
+ configure(t) {
2203
+ return super.configure(t);
2204
+ }
2205
+ extend(t) {
2206
+ const n = typeof t == "function" ? t() : t;
2207
+ return super.extend(n);
2208
+ }
2209
+ }, se = N.create({
2210
+ name: "clipboardTextSerializer",
2211
+ addOptions() {
2212
+ return {
2213
+ blockSeparator: void 0
2214
+ };
2215
+ },
2216
+ addProseMirrorPlugins() {
2217
+ return [
2218
+ new $({
2219
+ key: new B("clipboardTextSerializer"),
2220
+ props: {
2221
+ clipboardTextSerializer: () => {
2222
+ const { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: s } = t, { ranges: o } = s, i = Math.min(...o.map((u) => u.$from.pos)), a = Math.max(...o.map((u) => u.$to.pos)), c = Xt(n);
2223
+ return Qt(r, { from: i, to: a }, {
2224
+ ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
2225
+ textSerializers: c
2226
+ });
2227
+ }
2228
+ }
2229
+ })
2230
+ ];
2231
+ }
2232
+ }), oe = N.create({
2233
+ name: "commands",
2234
+ addCommands() {
2235
+ return {
2236
+ ...Lt
2237
+ };
2238
+ }
2239
+ }), ie = N.create({
2240
+ name: "delete",
2241
+ onUpdate({ transaction: e, appendedTransactions: t }) {
2242
+ var n, r, s;
2243
+ const o = () => {
2244
+ var i, a, c, l;
2245
+ if ((l = (c = (a = (i = this.editor.options.coreExtensionOptions) == null ? void 0 : i.delete) == null ? void 0 : a.filterTransaction) == null ? void 0 : c.call(a, e)) != null ? l : e.getMeta("y-sync$"))
2246
+ return;
2247
+ const u = Fn(e.before, [e, ...t]);
2248
+ er(u).forEach((f) => {
2249
+ u.mapping.mapResult(f.oldRange.from).deletedAfter && u.mapping.mapResult(f.oldRange.to).deletedBefore && u.before.nodesBetween(f.oldRange.from, f.oldRange.to, (h, m) => {
2250
+ const g = m + h.nodeSize - 2, v = f.oldRange.from <= m && g <= f.oldRange.to;
2251
+ this.editor.emit("delete", {
2252
+ type: "node",
2253
+ node: h,
2254
+ from: m,
2255
+ to: g,
2256
+ newFrom: u.mapping.map(m),
2257
+ newTo: u.mapping.map(g),
2258
+ deletedRange: f.oldRange,
2259
+ newRange: f.newRange,
2260
+ partial: !v,
2261
+ editor: this.editor,
2262
+ transaction: e,
2263
+ combinedTransform: u
2264
+ });
2265
+ });
2266
+ });
2267
+ const p = u.mapping;
2268
+ u.steps.forEach((f, h) => {
2269
+ var m, g;
2270
+ if (f instanceof ye) {
2271
+ const v = p.slice(h).map(f.from, -1), b = p.slice(h).map(f.to), k = p.invert().map(v, -1), M = p.invert().map(b), w = (m = u.doc.nodeAt(v - 1)) == null ? void 0 : m.marks.some((E) => E.eq(f.mark)), S = (g = u.doc.nodeAt(b)) == null ? void 0 : g.marks.some((E) => E.eq(f.mark));
2272
+ this.editor.emit("delete", {
2273
+ type: "mark",
2274
+ mark: f.mark,
2275
+ from: f.from,
2276
+ to: f.to,
2277
+ deletedRange: {
2278
+ from: k,
2279
+ to: M
2280
+ },
2281
+ newRange: {
2282
+ from: v,
2283
+ to: b
2284
+ },
2285
+ partial: !!(S || w),
2286
+ editor: this.editor,
2287
+ transaction: e,
2288
+ combinedTransform: u
2289
+ });
2290
+ }
2291
+ });
2292
+ };
2293
+ (s = (r = (n = this.editor.options.coreExtensionOptions) == null ? void 0 : n.delete) == null ? void 0 : r.async) == null || s ? setTimeout(o, 0) : o();
2294
+ }
2295
+ }), ae = N.create({
2296
+ name: "drop",
2297
+ addProseMirrorPlugins() {
2298
+ return [
2299
+ new $({
2300
+ key: new B("tiptapDrop"),
2301
+ props: {
2302
+ handleDrop: (e, t, n, r) => {
2303
+ this.editor.emit("drop", {
2304
+ editor: this.editor,
2305
+ event: t,
2306
+ slice: n,
2307
+ moved: r
2308
+ });
2309
+ }
2310
+ }
2311
+ })
2312
+ ];
2313
+ }
2314
+ }), ce = N.create({
2315
+ name: "editable",
2316
+ addProseMirrorPlugins() {
2317
+ return [
2318
+ new $({
2319
+ key: new B("editable"),
2320
+ props: {
2321
+ editable: () => this.editor.options.editable
2322
+ }
2323
+ })
2324
+ ];
2325
+ }
2326
+ }), le = new B("focusEvents"), de = N.create({
2327
+ name: "focusEvents",
2328
+ addProseMirrorPlugins() {
2329
+ const { editor: e } = this;
2330
+ return [
2331
+ new $({
2332
+ key: le,
2333
+ props: {
2334
+ handleDOMEvents: {
2335
+ focus: (t, n) => {
2336
+ e.isFocused = !0;
2337
+ const r = e.state.tr.setMeta("focus", { event: n }).setMeta("addToHistory", !1);
2338
+ return t.dispatch(r), !1;
2339
+ },
2340
+ blur: (t, n) => {
2341
+ e.isFocused = !1;
2342
+ const r = e.state.tr.setMeta("blur", { event: n }).setMeta("addToHistory", !1);
2343
+ return t.dispatch(r), !1;
2344
+ }
2345
+ }
2346
+ }
2347
+ })
2348
+ ];
2349
+ }
2350
+ }), ue = N.create({
2351
+ name: "keymap",
2352
+ addKeyboardShortcuts() {
2353
+ const e = () => this.editor.commands.first(({ commands: i }) => [
2354
+ () => i.undoInputRule(),
2355
+ // maybe convert first text block node to default node
2356
+ () => i.command(({ tr: a }) => {
2357
+ const { selection: c, doc: l } = a, { empty: u, $anchor: d } = c, { pos: p, parent: f } = d, h = d.parent.isTextblock && p > 0 ? a.doc.resolve(p - 1) : d, m = h.parent.type.spec.isolating, g = d.pos - d.parentOffset, v = m && h.parent.childCount === 1 ? g === d.pos : j.atStart(l).from === p;
2358
+ return !u || !f.type.isTextblock || f.textContent.length || !v || v && d.parent.type.name === "paragraph" ? !1 : i.clearNodes();
2359
+ }),
2360
+ () => i.deleteSelection(),
2361
+ () => i.joinBackward(),
2362
+ () => i.selectNodeBackward()
2363
+ ]), t = () => this.editor.commands.first(({ commands: i }) => [
2364
+ () => i.deleteSelection(),
2365
+ () => i.deleteCurrentNode(),
2366
+ () => i.joinForward(),
2367
+ () => i.selectNodeForward()
2368
+ ]), r = {
2369
+ Enter: () => this.editor.commands.first(({ commands: i }) => [
2370
+ () => i.newlineInCode(),
2371
+ () => i.createParagraphNear(),
2372
+ () => i.liftEmptyBlock(),
2373
+ () => i.splitBlock()
2374
+ ]),
2375
+ "Mod-Enter": () => this.editor.commands.exitCode(),
2376
+ Backspace: e,
2377
+ "Mod-Backspace": e,
2378
+ "Shift-Backspace": e,
2379
+ Delete: t,
2380
+ "Mod-Delete": t,
2381
+ "Mod-a": () => this.editor.commands.selectAll()
2382
+ }, s = {
2383
+ ...r
2384
+ }, o = {
2385
+ ...r,
2386
+ "Ctrl-h": e,
2387
+ "Alt-Backspace": e,
2388
+ "Ctrl-d": t,
2389
+ "Ctrl-Alt-Backspace": t,
2390
+ "Alt-Delete": t,
2391
+ "Alt-d": t,
2392
+ "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
2393
+ "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
2394
+ };
2395
+ return tt() || Ut() ? o : s;
2396
+ },
2397
+ addProseMirrorPlugins() {
2398
+ return [
2399
+ // With this plugin we check if the whole document was selected and deleted.
2400
+ // In this case we will additionally call `clearNodes()` to convert e.g. a heading
2401
+ // to a paragraph if necessary.
2402
+ // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
2403
+ // with many other commands.
2404
+ new $({
2405
+ key: new B("clearDocument"),
2406
+ appendTransaction: (e, t, n) => {
2407
+ if (e.some((m) => m.getMeta("composition")))
2408
+ return;
2409
+ const r = e.some((m) => m.docChanged) && !t.doc.eq(n.doc), s = e.some((m) => m.getMeta("preventClearDocument"));
2410
+ if (!r || s)
2411
+ return;
2412
+ const { empty: o, from: i, to: a } = t.selection, c = j.atStart(t.doc).from, l = j.atEnd(t.doc).to;
2413
+ if (o || !(i === c && a === l) || !xt(n.doc))
2414
+ return;
2415
+ const p = n.tr, f = rt({
2416
+ state: n,
2417
+ transaction: p
2418
+ }), { commands: h } = new st({
2419
+ editor: this.editor,
2420
+ state: f
2421
+ });
2422
+ if (h.clearNodes(), !!p.steps.length)
2423
+ return p;
2424
+ }
2425
+ })
2426
+ ];
2427
+ }
2428
+ }), fe = N.create({
2429
+ name: "paste",
2430
+ addProseMirrorPlugins() {
2431
+ return [
2432
+ new $({
2433
+ key: new B("tiptapPaste"),
2434
+ props: {
2435
+ handlePaste: (e, t, n) => {
2436
+ this.editor.emit("paste", {
2437
+ editor: this.editor,
2438
+ event: t,
2439
+ slice: n
2440
+ });
2441
+ }
2442
+ }
2443
+ })
2444
+ ];
2445
+ }
2446
+ }), pe = N.create({
2447
+ name: "tabindex",
2448
+ addProseMirrorPlugins() {
2449
+ return [
2450
+ new $({
2451
+ key: new B("tabindex"),
2452
+ props: {
2453
+ attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
2454
+ }
2455
+ })
2456
+ ];
2457
+ }
2458
+ }), he = N.create({
2459
+ name: "textDirection",
2460
+ addOptions() {
2461
+ return {
2462
+ direction: void 0
2463
+ };
2464
+ },
2465
+ addGlobalAttributes() {
2466
+ if (!this.options.direction)
2467
+ return [];
2468
+ const { nodeExtensions: e } = L(this.extensions);
2469
+ return [
2470
+ {
2471
+ types: e.filter((t) => t.name !== "text").map((t) => t.name),
2472
+ attributes: {
2473
+ dir: {
2474
+ default: this.options.direction,
2475
+ parseHTML: (t) => {
2476
+ const n = t.getAttribute("dir");
2477
+ return n && (n === "ltr" || n === "rtl" || n === "auto") ? n : this.options.direction;
2478
+ },
2479
+ renderHTML: (t) => t.dir ? {
2480
+ dir: t.dir
2481
+ } : {}
2482
+ }
2483
+ }
2484
+ }
2485
+ ];
2486
+ },
2487
+ addProseMirrorPlugins() {
2488
+ return [
2489
+ new $({
2490
+ key: new B("textDirection"),
2491
+ props: {
2492
+ attributes: () => {
2493
+ const e = this.options.direction;
2494
+ return e ? {
2495
+ dir: e
2496
+ } : {};
2497
+ }
2498
+ }
2499
+ })
2500
+ ];
2501
+ }
2502
+ }), jr = class F {
2503
+ constructor(t, n, r = !1, s = null) {
2504
+ this.currentNode = null, this.actualDepth = null, this.isBlock = r, this.resolvedPos = t, this.editor = n, this.currentNode = s;
2505
+ }
2506
+ get name() {
2507
+ return this.node.type.name;
2508
+ }
2509
+ get node() {
2510
+ return this.currentNode || this.resolvedPos.node();
2511
+ }
2512
+ get element() {
2513
+ return this.editor.view.domAtPos(this.pos).node;
2514
+ }
2515
+ get depth() {
2516
+ var t;
2517
+ return (t = this.actualDepth) != null ? t : this.resolvedPos.depth;
2518
+ }
2519
+ get pos() {
2520
+ return this.resolvedPos.pos;
2521
+ }
2522
+ get content() {
2523
+ return this.node.content;
2524
+ }
2525
+ set content(t) {
2526
+ let n = this.from, r = this.to;
2527
+ if (this.isBlock) {
2528
+ if (this.content.size === 0) {
2529
+ console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
2530
+ return;
2531
+ }
2532
+ n = this.from + 1, r = this.to - 1;
2533
+ }
2534
+ this.editor.commands.insertContentAt({ from: n, to: r }, t);
2535
+ }
2536
+ get attributes() {
2537
+ return this.node.attrs;
2538
+ }
2539
+ get textContent() {
2540
+ return this.node.textContent;
2541
+ }
2542
+ get size() {
2543
+ return this.node.nodeSize;
2544
+ }
2545
+ get from() {
2546
+ return this.isBlock ? this.pos : this.resolvedPos.start(this.resolvedPos.depth);
2547
+ }
2548
+ get range() {
2549
+ return {
2550
+ from: this.from,
2551
+ to: this.to
2552
+ };
2553
+ }
2554
+ get to() {
2555
+ return this.isBlock ? this.pos + this.size : this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
2556
+ }
2557
+ get parent() {
2558
+ if (this.depth === 0)
2559
+ return null;
2560
+ const t = this.resolvedPos.start(this.resolvedPos.depth - 1), n = this.resolvedPos.doc.resolve(t);
2561
+ return new F(n, this.editor);
2562
+ }
2563
+ get before() {
2564
+ let t = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
2565
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.from - 3)), new F(t, this.editor);
2566
+ }
2567
+ get after() {
2568
+ let t = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
2569
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.to + 3)), new F(t, this.editor);
2570
+ }
2571
+ get children() {
2572
+ const t = [];
2573
+ return this.node.content.forEach((n, r) => {
2574
+ const s = n.isBlock && !n.isTextblock, o = n.isAtom && !n.isText, i = n.isInline, a = this.pos + r + (o ? 0 : 1);
2575
+ if (a < 0 || a > this.resolvedPos.doc.nodeSize - 2)
2576
+ return;
2577
+ const c = this.resolvedPos.doc.resolve(a);
2578
+ if (!s && !i && c.depth <= this.depth)
2579
+ return;
2580
+ const l = new F(c, this.editor, s, s || i ? n : null);
2581
+ s && (l.actualDepth = this.depth + 1), t.push(l);
2582
+ }), t;
2583
+ }
2584
+ get firstChild() {
2585
+ return this.children[0] || null;
2586
+ }
2587
+ get lastChild() {
2588
+ const t = this.children;
2589
+ return t[t.length - 1] || null;
2590
+ }
2591
+ closest(t, n = {}) {
2592
+ let r = null, s = this.parent;
2593
+ for (; s && !r; ) {
2594
+ if (s.node.type.name === t)
2595
+ if (Object.keys(n).length > 0) {
2596
+ const o = s.node.attrs, i = Object.keys(n);
2597
+ for (let a = 0; a < i.length; a += 1) {
2598
+ const c = i[a];
2599
+ if (o[c] !== n[c])
2600
+ break;
2601
+ }
2602
+ } else
2603
+ r = s;
2604
+ s = s.parent;
2605
+ }
2606
+ return r;
2607
+ }
2608
+ querySelector(t, n = {}) {
2609
+ return this.querySelectorAll(t, n, !0)[0] || null;
2610
+ }
2611
+ querySelectorAll(t, n = {}, r = !1) {
2612
+ let s = [];
2613
+ if (!this.children || this.children.length === 0)
2614
+ return s;
2615
+ const o = Object.keys(n);
2616
+ return this.children.forEach((i) => {
2617
+ r && s.length > 0 || (i.node.type.name === t && o.every((c) => n[c] === i.node.attrs[c]) && s.push(i), !(r && s.length > 0) && (s = s.concat(i.querySelectorAll(t, n, r))));
2618
+ }), s;
2619
+ }
2620
+ setAttribute(t) {
2621
+ const { tr: n } = this.editor.state;
2622
+ n.setNodeMarkup(this.from, void 0, {
2623
+ ...this.node.attrs,
2624
+ ...t
2625
+ }), this.editor.view.dispatch(n);
2626
+ }
2627
+ }, Lr = `.ProseMirror {
2628
+ position: relative;
2629
+ }
2630
+
2631
+ .ProseMirror {
2632
+ word-wrap: break-word;
2633
+ white-space: pre-wrap;
2634
+ white-space: break-spaces;
2635
+ -webkit-font-variant-ligatures: none;
2636
+ font-variant-ligatures: none;
2637
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
2638
+ }
2639
+
2640
+ .ProseMirror [contenteditable="false"] {
2641
+ white-space: normal;
2642
+ }
2643
+
2644
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
2645
+ white-space: pre-wrap;
2646
+ }
2647
+
2648
+ .ProseMirror pre {
2649
+ white-space: pre-wrap;
2650
+ }
2651
+
2652
+ img.ProseMirror-separator {
2653
+ display: inline !important;
2654
+ border: none !important;
2655
+ margin: 0 !important;
2656
+ width: 0 !important;
2657
+ height: 0 !important;
2658
+ }
2659
+
2660
+ .ProseMirror-gapcursor {
2661
+ display: none;
2662
+ pointer-events: none;
2663
+ position: absolute;
2664
+ margin: 0;
2665
+ }
2666
+
2667
+ .ProseMirror-gapcursor:after {
2668
+ content: "";
2669
+ display: block;
2670
+ position: absolute;
2671
+ top: -2px;
2672
+ width: 20px;
2673
+ border-top: 1px solid black;
2674
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
2675
+ }
2676
+
2677
+ @keyframes ProseMirror-cursor-blink {
2678
+ to {
2679
+ visibility: hidden;
2680
+ }
2681
+ }
2682
+
2683
+ .ProseMirror-hideselection *::selection {
2684
+ background: transparent;
2685
+ }
2686
+
2687
+ .ProseMirror-hideselection *::-moz-selection {
2688
+ background: transparent;
2689
+ }
2690
+
2691
+ .ProseMirror-hideselection * {
2692
+ caret-color: transparent;
2693
+ }
2694
+
2695
+ .ProseMirror-focused .ProseMirror-gapcursor {
2696
+ display: block;
2697
+ }`;
2698
+ function Hr(e, t, n) {
2699
+ const r = document.querySelector("style[data-tiptap-style]");
2700
+ if (r !== null)
2701
+ return r;
2702
+ const s = document.createElement("style");
2703
+ return t && s.setAttribute("nonce", t), s.setAttribute("data-tiptap-style", ""), s.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(s), s;
2704
+ }
2705
+ var us = class extends Cr {
2706
+ constructor(t = {}) {
2707
+ super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {
2708
+ element: typeof document < "u" ? document.createElement("div") : null,
2709
+ content: "",
2710
+ injectCSS: !0,
2711
+ injectNonce: void 0,
2712
+ extensions: [],
2713
+ autofocus: !1,
2714
+ editable: !0,
2715
+ textDirection: void 0,
2716
+ editorProps: {},
2717
+ parseOptions: {},
2718
+ coreExtensionOptions: {},
2719
+ enableInputRules: !0,
2720
+ enablePasteRules: !0,
2721
+ enableCoreExtensions: !0,
2722
+ enableContentCheck: !1,
2723
+ emitContentError: !1,
2724
+ onBeforeCreate: () => null,
2725
+ onCreate: () => null,
2726
+ onMount: () => null,
2727
+ onUnmount: () => null,
2728
+ onUpdate: () => null,
2729
+ onSelectionUpdate: () => null,
2730
+ onTransaction: () => null,
2731
+ onFocus: () => null,
2732
+ onBlur: () => null,
2733
+ onDestroy: () => null,
2734
+ onContentError: ({ error: s }) => {
2735
+ throw s;
2736
+ },
2737
+ onPaste: () => null,
2738
+ onDrop: () => null,
2739
+ onDelete: () => null,
2740
+ enableExtensionDispatchTransaction: !0
2741
+ }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.utils = {
2742
+ getUpdatedPosition: sr,
2743
+ createMappablePosition: or
2744
+ }, this.setOptions(t), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), 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: s, slice: o, moved: i }) => this.options.onDrop(s, o, i)), this.on("paste", ({ event: s, slice: o }) => this.options.onPaste(s, o)), this.on("delete", this.options.onDelete);
2745
+ const n = this.createDoc(), r = Vt(n, this.options.autofocus);
2746
+ this.editorState = Le.create({
2747
+ doc: n,
2748
+ schema: this.schema,
2749
+ selection: r || void 0
2750
+ }), this.options.element && this.mount(this.options.element);
2751
+ }
2752
+ /**
2753
+ * Attach the editor to the DOM, creating a new editor view.
2754
+ */
2755
+ mount(t) {
2756
+ if (typeof document > "u")
2757
+ throw new Error(
2758
+ "[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment."
2759
+ );
2760
+ this.createView(t), this.emit("mount", { editor: this }), this.css && !document.head.contains(this.css) && document.head.appendChild(this.css), window.setTimeout(() => {
2761
+ this.isDestroyed || (this.options.autofocus !== !1 && this.options.autofocus !== null && this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
2762
+ }, 0);
2763
+ }
2764
+ /**
2765
+ * Remove the editor from the DOM, but still allow remounting at a different point in time
2766
+ */
2767
+ unmount() {
2768
+ if (this.editorView) {
2769
+ const t = this.editorView.dom;
2770
+ t?.editor && delete t.editor, this.editorView.destroy();
2771
+ }
2772
+ if (this.editorView = null, this.isInitialized = !1, this.css && !document.querySelectorAll(`.${this.className}`).length)
2773
+ try {
2774
+ typeof this.css.remove == "function" ? this.css.remove() : this.css.parentNode && this.css.parentNode.removeChild(this.css);
2775
+ } catch (t) {
2776
+ console.warn("Failed to remove CSS element:", t);
2777
+ }
2778
+ this.css = null, this.emit("unmount", { editor: this });
2779
+ }
2780
+ /**
2781
+ * Returns the editor storage.
2782
+ */
2783
+ get storage() {
2784
+ return this.extensionStorage;
2785
+ }
2786
+ /**
2787
+ * An object of all registered commands.
2788
+ */
2789
+ get commands() {
2790
+ return this.commandManager.commands;
2791
+ }
2792
+ /**
2793
+ * Create a command chain to call multiple commands at once.
2794
+ */
2795
+ chain() {
2796
+ return this.commandManager.chain();
2797
+ }
2798
+ /**
2799
+ * Check if a command or a command chain can be executed. Without executing it.
2800
+ */
2801
+ can() {
2802
+ return this.commandManager.can();
2803
+ }
2804
+ /**
2805
+ * Inject CSS styles.
2806
+ */
2807
+ injectCSS() {
2808
+ this.options.injectCSS && typeof document < "u" && (this.css = Hr(Lr, this.options.injectNonce));
2809
+ }
2810
+ /**
2811
+ * Update editor options.
2812
+ *
2813
+ * @param options A list of options
2814
+ */
2815
+ setOptions(t = {}) {
2816
+ this.options = {
2817
+ ...this.options,
2818
+ ...t
2819
+ }, !(!this.editorView || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
2820
+ }
2821
+ /**
2822
+ * Update editable state of the editor.
2823
+ */
2824
+ setEditable(t, n = !0) {
2825
+ this.setOptions({ editable: t }), n && this.emit("update", { editor: this, transaction: this.state.tr, appendedTransactions: [] });
2826
+ }
2827
+ /**
2828
+ * Returns whether the editor is editable.
2829
+ */
2830
+ get isEditable() {
2831
+ return this.options.editable && this.view && this.view.editable;
2832
+ }
2833
+ /**
2834
+ * Returns the editor view.
2835
+ */
2836
+ get view() {
2837
+ return this.editorView ? this.editorView : new Proxy(
2838
+ {
2839
+ state: this.editorState,
2840
+ updateState: (t) => {
2841
+ this.editorState = t;
2842
+ },
2843
+ dispatch: (t) => {
2844
+ this.dispatchTransaction(t);
2845
+ },
2846
+ // Stub some commonly accessed properties to prevent errors
2847
+ composing: !1,
2848
+ dragging: null,
2849
+ editable: !0,
2850
+ isDestroyed: !1
2851
+ },
2852
+ {
2853
+ get: (t, n) => {
2854
+ if (this.editorView)
2855
+ return this.editorView[n];
2856
+ if (n === "state")
2857
+ return this.editorState;
2858
+ if (n in t)
2859
+ return Reflect.get(t, n);
2860
+ throw new Error(
2861
+ `[tiptap error]: The editor view is not available. Cannot access view['${n}']. The editor may not be mounted yet.`
2862
+ );
2863
+ }
2864
+ }
2865
+ );
2866
+ }
2867
+ /**
2868
+ * Returns the editor state.
2869
+ */
2870
+ get state() {
2871
+ return this.editorView && (this.editorState = this.view.state), this.editorState;
2872
+ }
2873
+ /**
2874
+ * Register a ProseMirror plugin.
2875
+ *
2876
+ * @param plugin A ProseMirror plugin
2877
+ * @param handlePlugins Control how to merge the plugin into the existing plugins.
2878
+ * @returns The new editor state
2879
+ */
2880
+ registerPlugin(t, n) {
2881
+ const r = qt(n) ? n(t, [...this.state.plugins]) : [...this.state.plugins, t], s = this.state.reconfigure({ plugins: r });
2882
+ return this.view.updateState(s), s;
2883
+ }
2884
+ /**
2885
+ * Unregister a ProseMirror plugin.
2886
+ *
2887
+ * @param nameOrPluginKeyToRemove The plugins name
2888
+ * @returns The new editor state or undefined if the editor is destroyed
2889
+ */
2890
+ unregisterPlugin(t) {
2891
+ if (this.isDestroyed)
2892
+ return;
2893
+ const n = this.state.plugins;
2894
+ let r = n;
2895
+ if ([].concat(t).forEach((o) => {
2896
+ const i = typeof o == "string" ? `${o}$` : o.key;
2897
+ r = r.filter((a) => !a.key.startsWith(i));
2898
+ }), n.length === r.length)
2899
+ return;
2900
+ const s = this.state.reconfigure({
2901
+ plugins: r
2902
+ });
2903
+ return this.view.updateState(s), s;
2904
+ }
2905
+ /**
2906
+ * Creates an extension manager.
2907
+ */
2908
+ createExtensionManager() {
2909
+ var t, n;
2910
+ const s = [...this.options.enableCoreExtensions ? [
2911
+ ce,
2912
+ se.configure({
2913
+ blockSeparator: (n = (t = this.options.coreExtensionOptions) == null ? void 0 : t.clipboardTextSerializer) == null ? void 0 : n.blockSeparator
2914
+ }),
2915
+ oe,
2916
+ de,
2917
+ ue,
2918
+ pe,
2919
+ ae,
2920
+ fe,
2921
+ ie,
2922
+ he.configure({
2923
+ direction: this.options.textDirection
2924
+ })
2925
+ ].filter((o) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[o.name] !== !1 : !0) : [], ...this.options.extensions].filter((o) => ["extension", "node", "mark"].includes(o?.type));
2926
+ this.extensionManager = new ct(s, this);
2927
+ }
2928
+ /**
2929
+ * Creates an command manager.
2930
+ */
2931
+ createCommandManager() {
2932
+ this.commandManager = new st({
2933
+ editor: this
2934
+ });
2935
+ }
2936
+ /**
2937
+ * Creates a ProseMirror schema.
2938
+ */
2939
+ createSchema() {
2940
+ this.schema = this.extensionManager.schema;
2941
+ }
2942
+ /**
2943
+ * Creates the initial document.
2944
+ */
2945
+ createDoc() {
2946
+ let t;
2947
+ try {
2948
+ t = ht(this.options.content, this.schema, this.options.parseOptions, {
2949
+ errorOnInvalidContent: this.options.enableContentCheck
2950
+ });
2951
+ } catch (n) {
2952
+ if (!(n instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(n.message))
2953
+ throw n;
2954
+ this.emit("contentError", {
2955
+ editor: this,
2956
+ error: n,
2957
+ disableCollaboration: () => {
2958
+ "collaboration" in this.storage && typeof this.storage.collaboration == "object" && this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((r) => r.name !== "collaboration"), this.createExtensionManager();
2959
+ }
2960
+ }), t = ht(this.options.content, this.schema, this.options.parseOptions, {
2961
+ errorOnInvalidContent: !1
2962
+ });
2963
+ }
2964
+ return t;
2965
+ }
2966
+ /**
2967
+ * Creates a ProseMirror view.
2968
+ */
2969
+ createView(t) {
2970
+ const { editorProps: n, enableExtensionDispatchTransaction: r } = this.options, s = n.dispatchTransaction || this.dispatchTransaction.bind(this), o = r ? this.extensionManager.dispatchTransaction(s) : s, i = n.transformPastedHTML, a = this.extensionManager.transformPastedHTML(i);
2971
+ this.editorView = new Je(t, {
2972
+ ...n,
2973
+ attributes: {
2974
+ // add `role="textbox"` to the editor element
2975
+ role: "textbox",
2976
+ ...n?.attributes
2977
+ },
2978
+ dispatchTransaction: o,
2979
+ transformPastedHTML: a,
2980
+ state: this.editorState,
2981
+ markViews: this.extensionManager.markViews,
2982
+ nodeViews: this.extensionManager.nodeViews
2983
+ });
2984
+ const c = this.state.reconfigure({
2985
+ plugins: this.extensionManager.plugins
2986
+ });
2987
+ this.view.updateState(c), this.prependClass(), this.injectCSS();
2988
+ const l = this.view.dom;
2989
+ l.editor = this;
2990
+ }
2991
+ /**
2992
+ * Creates all node and mark views.
2993
+ */
2994
+ createNodeViews() {
2995
+ this.view.isDestroyed || this.view.setProps({
2996
+ markViews: this.extensionManager.markViews,
2997
+ nodeViews: this.extensionManager.nodeViews
2998
+ });
2999
+ }
3000
+ /**
3001
+ * Prepend class name to element.
3002
+ */
3003
+ prependClass() {
3004
+ this.view.dom.className = `${this.className} ${this.view.dom.className}`;
3005
+ }
3006
+ captureTransaction(t) {
3007
+ this.isCapturingTransaction = !0, t(), this.isCapturingTransaction = !1;
3008
+ const n = this.capturedTransaction;
3009
+ return this.capturedTransaction = null, n;
3010
+ }
3011
+ /**
3012
+ * The callback over which to send transactions (state updates) produced by the view.
3013
+ *
3014
+ * @param transaction An editor state transaction
3015
+ */
3016
+ dispatchTransaction(t) {
3017
+ if (this.view.isDestroyed)
3018
+ return;
3019
+ if (this.isCapturingTransaction) {
3020
+ if (!this.capturedTransaction) {
3021
+ this.capturedTransaction = t;
3022
+ return;
3023
+ }
3024
+ t.steps.forEach((u) => {
3025
+ var d;
3026
+ return (d = this.capturedTransaction) == null ? void 0 : d.step(u);
3027
+ });
3028
+ return;
3029
+ }
3030
+ const { state: n, transactions: r } = this.state.applyTransaction(t), s = !this.state.selection.eq(n.selection), o = r.includes(t), i = this.state;
3031
+ if (this.emit("beforeTransaction", {
3032
+ editor: this,
3033
+ transaction: t,
3034
+ nextState: n
3035
+ }), !o)
3036
+ return;
3037
+ this.view.updateState(n), this.emit("transaction", {
3038
+ editor: this,
3039
+ transaction: t,
3040
+ appendedTransactions: r.slice(1)
3041
+ }), s && this.emit("selectionUpdate", {
3042
+ editor: this,
3043
+ transaction: t
3044
+ });
3045
+ const a = r.findLast((u) => u.getMeta("focus") || u.getMeta("blur")), c = a?.getMeta("focus"), l = a?.getMeta("blur");
3046
+ c && this.emit("focus", {
3047
+ editor: this,
3048
+ event: c.event,
3049
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3050
+ transaction: a
3051
+ }), l && this.emit("blur", {
3052
+ editor: this,
3053
+ event: l.event,
3054
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3055
+ transaction: a
3056
+ }), !(t.getMeta("preventUpdate") || !r.some((u) => u.docChanged) || i.doc.eq(n.doc)) && this.emit("update", {
3057
+ editor: this,
3058
+ transaction: t,
3059
+ appendedTransactions: r.slice(1)
3060
+ });
3061
+ }
3062
+ /**
3063
+ * Get attributes of the currently selected node or mark.
3064
+ */
3065
+ getAttributes(t) {
3066
+ return Zn(this.state, t);
3067
+ }
3068
+ isActive(t, n) {
3069
+ const r = typeof t == "string" ? t : null, s = typeof t == "string" ? n : t;
3070
+ return rr(this.state, r, s);
3071
+ }
3072
+ /**
3073
+ * Get the document as JSON.
3074
+ */
3075
+ getJSON() {
3076
+ return this.state.doc.toJSON();
3077
+ }
3078
+ /**
3079
+ * Get the document as HTML.
3080
+ */
3081
+ getHTML() {
3082
+ return kt(this.state.doc.content, this.schema);
3083
+ }
3084
+ /**
3085
+ * Get the document as text.
3086
+ */
3087
+ getText(t) {
3088
+ const { blockSeparator: n = `
3089
+
3090
+ `, textSerializers: r = {} } = t || {};
3091
+ return Qn(this.state.doc, {
3092
+ blockSeparator: n,
3093
+ textSerializers: {
3094
+ ...Xt(this.schema),
3095
+ ...r
3096
+ }
3097
+ });
3098
+ }
3099
+ /**
3100
+ * Check if there is no content.
3101
+ */
3102
+ get isEmpty() {
3103
+ return xt(this.state.doc);
3104
+ }
3105
+ /**
3106
+ * Destroy the editor.
3107
+ */
3108
+ destroy() {
3109
+ this.emit("destroy"), this.unmount(), this.removeAllListeners();
3110
+ }
3111
+ /**
3112
+ * Check if the editor is already destroyed.
3113
+ */
3114
+ get isDestroyed() {
3115
+ var t, n;
3116
+ return (n = (t = this.editorView) == null ? void 0 : t.isDestroyed) != null ? n : !0;
3117
+ }
3118
+ $node(t, n) {
3119
+ var r;
3120
+ return ((r = this.$doc) == null ? void 0 : r.querySelector(t, n)) || null;
3121
+ }
3122
+ $nodes(t, n) {
3123
+ var r;
3124
+ return ((r = this.$doc) == null ? void 0 : r.querySelectorAll(t, n)) || null;
3125
+ }
3126
+ $pos(t) {
3127
+ const n = this.state.doc.resolve(t);
3128
+ return new jr(n, this);
3129
+ }
3130
+ get $doc() {
3131
+ return this.$pos(0);
3132
+ }
3133
+ };
3134
+ function ps(e) {
3135
+ return new at({
3136
+ find: e.find,
3137
+ handler: ({ state: t, range: n, match: r }) => {
3138
+ const s = x(e.getAttributes, void 0, r);
3139
+ if (s === !1 || s === null)
3140
+ return null;
3141
+ const { tr: o } = t, i = r[r.length - 1], a = r[0];
3142
+ if (i) {
3143
+ const c = a.search(/\S/), l = n.from + a.indexOf(i), u = l + i.length;
3144
+ if (Zt(n.from, n.to, t.doc).filter((f) => f.mark.type.excluded.find((m) => m === e.type && m !== f.mark.type)).filter((f) => f.to > l).length)
3145
+ return null;
3146
+ u < n.to && o.delete(u, n.to), l > n.from && o.delete(n.from + c, l);
3147
+ const p = n.from + c + i.length;
3148
+ o.addMark(n.from + c, p, e.type.create(s || {})), o.removeStoredMark(e.type);
3149
+ }
3150
+ },
3151
+ undoable: e.undoable
3152
+ });
3153
+ }
3154
+ function hs(e) {
3155
+ return new at({
3156
+ find: e.find,
3157
+ handler: ({ state: t, range: n, match: r }) => {
3158
+ const s = x(e.getAttributes, void 0, r) || {}, { tr: o } = t, i = n.from;
3159
+ let a = n.to;
3160
+ const c = e.type.create(s);
3161
+ if (r[1]) {
3162
+ const l = r[0].lastIndexOf(r[1]);
3163
+ let u = i + l;
3164
+ u > a ? u = a : a = u + r[1].length;
3165
+ const d = r[0][r[0].length - 1];
3166
+ o.insertText(d, i + r[0].length - 1), o.replaceWith(u, a, c);
3167
+ } else if (r[0]) {
3168
+ const l = e.type.isInline ? i : i - 1;
3169
+ o.insert(l, e.type.create(s)).delete(o.mapping.map(i), o.mapping.map(a));
3170
+ }
3171
+ o.scrollIntoView();
3172
+ },
3173
+ undoable: e.undoable
3174
+ });
3175
+ }
3176
+ function ms(e) {
3177
+ return new at({
3178
+ find: e.find,
3179
+ handler: ({ state: t, range: n, match: r }) => {
3180
+ const s = t.doc.resolve(n.from), o = x(e.getAttributes, void 0, r) || {};
3181
+ if (!s.node(-1).canReplaceWith(s.index(-1), s.indexAfter(-1), e.type))
3182
+ return null;
3183
+ t.tr.delete(n.from, n.to).setBlockType(n.from, n.from, e.type, o);
3184
+ },
3185
+ undoable: e.undoable
3186
+ });
3187
+ }
3188
+ function gs(e) {
3189
+ return new at({
3190
+ find: e.find,
3191
+ handler: ({ state: t, range: n, match: r, chain: s }) => {
3192
+ const o = x(e.getAttributes, void 0, r) || {}, i = t.tr.delete(n.from, n.to), c = i.doc.resolve(n.from).blockRange(), l = c && ge(c, e.type, o);
3193
+ if (!l)
3194
+ return null;
3195
+ if (i.wrap(c, l), e.keepMarks && e.editor) {
3196
+ const { selection: d, storedMarks: p } = t, { splittableMarks: f } = e.editor.extensionManager, h = p || d.$to.parentOffset && d.$from.marks();
3197
+ if (h) {
3198
+ const m = h.filter((g) => f.includes(g.type.name));
3199
+ i.ensureMarks(m);
3200
+ }
3201
+ }
3202
+ if (e.keepAttributes) {
3203
+ const d = e.type.name === "bulletList" || e.type.name === "orderedList" ? "listItem" : "taskList";
3204
+ s().updateAttributes(d, o).run();
3205
+ }
3206
+ const u = i.doc.resolve(n.from - 1).nodeBefore;
3207
+ u && u.type === e.type && gt(i.doc, n.from - 1) && (!e.joinPredicate || e.joinPredicate(r, u)) && i.join(n.from - 1);
3208
+ },
3209
+ undoable: e.undoable
3210
+ });
3211
+ }
3212
+ var Fr = (e) => "touches" in e, vs = class {
3213
+ /**
3214
+ * Creates a new ResizableNodeView instance.
3215
+ *
3216
+ * The constructor sets up the resize handles, applies initial sizing from
3217
+ * node attributes, and configures all resize behavior options.
3218
+ *
3219
+ * @param options - Configuration options for the resizable node view
3220
+ */
3221
+ constructor(e) {
3222
+ this.directions = ["bottom-left", "bottom-right", "top-left", "top-right"], this.minSize = {
3223
+ height: 8,
3224
+ width: 8
3225
+ }, this.preserveAspectRatio = !1, this.classNames = {
3226
+ container: "",
3227
+ wrapper: "",
3228
+ handle: "",
3229
+ resizing: ""
3230
+ }, this.initialWidth = 0, this.initialHeight = 0, this.aspectRatio = 1, this.isResizing = !1, this.activeHandle = null, this.startX = 0, this.startY = 0, this.startWidth = 0, this.startHeight = 0, this.isShiftKeyPressed = !1, this.lastEditableState = void 0, this.handleMap = /* @__PURE__ */ new Map(), this.handleMouseMove = (a) => {
3231
+ if (!this.isResizing || !this.activeHandle)
3232
+ return;
3233
+ const c = a.clientX - this.startX, l = a.clientY - this.startY;
3234
+ this.handleResize(c, l);
3235
+ }, this.handleTouchMove = (a) => {
3236
+ if (!this.isResizing || !this.activeHandle)
3237
+ return;
3238
+ const c = a.touches[0];
3239
+ if (!c)
3240
+ return;
3241
+ const l = c.clientX - this.startX, u = c.clientY - this.startY;
3242
+ this.handleResize(l, u);
3243
+ }, this.handleMouseUp = () => {
3244
+ if (!this.isResizing)
3245
+ return;
3246
+ const a = this.element.offsetWidth, c = this.element.offsetHeight;
3247
+ this.onCommit(a, c), this.isResizing = !1, this.activeHandle = null, this.container.dataset.resizeState = "false", this.classNames.resizing && this.container.classList.remove(this.classNames.resizing), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mouseup", this.handleMouseUp), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("keyup", this.handleKeyUp);
3248
+ }, this.handleKeyDown = (a) => {
3249
+ a.key === "Shift" && (this.isShiftKeyPressed = !0);
3250
+ }, this.handleKeyUp = (a) => {
3251
+ a.key === "Shift" && (this.isShiftKeyPressed = !1);
3252
+ };
3253
+ var t, n, r, s, o, i;
3254
+ this.node = e.node, this.editor = e.editor, this.element = e.element, this.contentElement = e.contentElement, this.getPos = e.getPos, this.onResize = e.onResize, this.onCommit = e.onCommit, this.onUpdate = e.onUpdate, (t = e.options) != null && t.min && (this.minSize = {
3255
+ ...this.minSize,
3256
+ ...e.options.min
3257
+ }), (n = e.options) != null && n.max && (this.maxSize = e.options.max), (r = e?.options) != null && r.directions && (this.directions = e.options.directions), (s = e.options) != null && s.preserveAspectRatio && (this.preserveAspectRatio = e.options.preserveAspectRatio), (o = e.options) != null && o.className && (this.classNames = {
3258
+ container: e.options.className.container || "",
3259
+ wrapper: e.options.className.wrapper || "",
3260
+ handle: e.options.className.handle || "",
3261
+ resizing: e.options.className.resizing || ""
3262
+ }), (i = e.options) != null && i.createCustomHandle && (this.createCustomHandle = e.options.createCustomHandle), this.wrapper = this.createWrapper(), this.container = this.createContainer(), this.applyInitialSize(), this.attachHandles(), this.editor.on("update", this.handleEditorUpdate.bind(this));
3263
+ }
3264
+ /**
3265
+ * Returns the top-level DOM node that should be placed in the editor.
3266
+ *
3267
+ * This is required by the ProseMirror NodeView interface. The container
3268
+ * includes the wrapper, handles, and the actual content element.
3269
+ *
3270
+ * @returns The container element to be inserted into the editor
3271
+ */
3272
+ get dom() {
3273
+ return this.container;
3274
+ }
3275
+ get contentDOM() {
3276
+ var e;
3277
+ return (e = this.contentElement) != null ? e : null;
3278
+ }
3279
+ handleEditorUpdate() {
3280
+ const e = this.editor.isEditable;
3281
+ e !== this.lastEditableState && (this.lastEditableState = e, e ? e && this.handleMap.size === 0 && this.attachHandles() : this.removeHandles());
3282
+ }
3283
+ /**
3284
+ * Called when the node's content or attributes change.
3285
+ *
3286
+ * Updates the internal node reference. If a custom `onUpdate` callback
3287
+ * was provided, it will be called to handle additional update logic.
3288
+ *
3289
+ * @param node - The new/updated node
3290
+ * @param decorations - Node decorations
3291
+ * @param innerDecorations - Inner decorations
3292
+ * @returns `false` if the node type has changed (requires full rebuild), otherwise the result of `onUpdate` or `true`
3293
+ */
3294
+ update(e, t, n) {
3295
+ return e.type !== this.node.type ? !1 : (this.node = e, this.onUpdate ? this.onUpdate(e, t, n) : !0);
3296
+ }
3297
+ /**
3298
+ * Cleanup method called when the node view is being removed.
3299
+ *
3300
+ * Removes all event listeners to prevent memory leaks. This is required
3301
+ * by the ProseMirror NodeView interface. If a resize is active when
3302
+ * destroy is called, it will be properly cancelled.
3303
+ */
3304
+ destroy() {
3305
+ this.isResizing && (this.container.dataset.resizeState = "false", this.classNames.resizing && this.container.classList.remove(this.classNames.resizing), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mouseup", this.handleMouseUp), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("keyup", this.handleKeyUp), this.isResizing = !1, this.activeHandle = null), this.editor.off("update", this.handleEditorUpdate.bind(this)), this.container.remove();
3306
+ }
3307
+ /**
3308
+ * Creates the outer container element.
3309
+ *
3310
+ * The container is the top-level element returned by the NodeView and
3311
+ * wraps the entire resizable node. It's set up with flexbox to handle
3312
+ * alignment and includes data attributes for styling and identification.
3313
+ *
3314
+ * @returns The container element
3315
+ */
3316
+ createContainer() {
3317
+ const e = document.createElement("div");
3318
+ return e.dataset.resizeContainer = "", e.dataset.node = this.node.type.name, e.style.display = "flex", this.classNames.container && (e.className = this.classNames.container), e.appendChild(this.wrapper), e;
3319
+ }
3320
+ /**
3321
+ * Creates the wrapper element that contains the content and handles.
3322
+ *
3323
+ * The wrapper uses relative positioning so that resize handles can be
3324
+ * positioned absolutely within it. This is the direct parent of the
3325
+ * content element being made resizable.
3326
+ *
3327
+ * @returns The wrapper element
3328
+ */
3329
+ createWrapper() {
3330
+ const e = document.createElement("div");
3331
+ return e.style.position = "relative", e.style.display = "block", e.dataset.resizeWrapper = "", this.classNames.wrapper && (e.className = this.classNames.wrapper), e.appendChild(this.element), e;
3332
+ }
3333
+ /**
3334
+ * Creates a resize handle element for a specific direction.
3335
+ *
3336
+ * Each handle is absolutely positioned and includes a data attribute
3337
+ * identifying its direction for styling purposes.
3338
+ *
3339
+ * @param direction - The resize direction for this handle
3340
+ * @returns The handle element
3341
+ */
3342
+ createHandle(e) {
3343
+ const t = document.createElement("div");
3344
+ return t.dataset.resizeHandle = e, t.style.position = "absolute", this.classNames.handle && (t.className = this.classNames.handle), t;
3345
+ }
3346
+ /**
3347
+ * Positions a handle element according to its direction.
3348
+ *
3349
+ * Corner handles (e.g., 'top-left') are positioned at the intersection
3350
+ * of two edges. Edge handles (e.g., 'top') span the full width or height.
3351
+ *
3352
+ * @param handle - The handle element to position
3353
+ * @param direction - The direction determining the position
3354
+ */
3355
+ positionHandle(e, t) {
3356
+ const n = t.includes("top"), r = t.includes("bottom"), s = t.includes("left"), o = t.includes("right");
3357
+ n && (e.style.top = "0"), r && (e.style.bottom = "0"), s && (e.style.left = "0"), o && (e.style.right = "0"), (t === "top" || t === "bottom") && (e.style.left = "0", e.style.right = "0"), (t === "left" || t === "right") && (e.style.top = "0", e.style.bottom = "0");
3358
+ }
3359
+ /**
3360
+ * Creates and attaches all resize handles to the wrapper.
3361
+ *
3362
+ * Iterates through the configured directions, creates a handle for each,
3363
+ * positions it, attaches the mousedown listener, and appends it to the DOM.
3364
+ */
3365
+ attachHandles() {
3366
+ this.directions.forEach((e) => {
3367
+ let t;
3368
+ this.createCustomHandle ? t = this.createCustomHandle(e) : t = this.createHandle(e), t instanceof HTMLElement || (console.warn(
3369
+ `[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`
3370
+ ), t = this.createHandle(e)), this.createCustomHandle || this.positionHandle(t, e), t.addEventListener("mousedown", (n) => this.handleResizeStart(n, e)), t.addEventListener("touchstart", (n) => this.handleResizeStart(n, e)), this.handleMap.set(e, t), this.wrapper.appendChild(t);
3371
+ });
3372
+ }
3373
+ /**
3374
+ * Removes all resize handles from the wrapper.
3375
+ *
3376
+ * Cleans up the handle map and removes each handle element from the DOM.
3377
+ */
3378
+ removeHandles() {
3379
+ this.handleMap.forEach((e) => e.remove()), this.handleMap.clear();
3380
+ }
3381
+ /**
3382
+ * Applies initial sizing from node attributes to the element.
3383
+ *
3384
+ * If width/height attributes exist on the node, they're applied to the element.
3385
+ * Otherwise, the element's natural/current dimensions are measured. The aspect
3386
+ * ratio is calculated for later use in aspect-ratio-preserving resizes.
3387
+ */
3388
+ applyInitialSize() {
3389
+ const e = this.node.attrs.width, t = this.node.attrs.height;
3390
+ e ? (this.element.style.width = `${e}px`, this.initialWidth = e) : this.initialWidth = this.element.offsetWidth, t ? (this.element.style.height = `${t}px`, this.initialHeight = t) : this.initialHeight = this.element.offsetHeight, this.initialWidth > 0 && this.initialHeight > 0 && (this.aspectRatio = this.initialWidth / this.initialHeight);
3391
+ }
3392
+ /**
3393
+ * Initiates a resize operation when a handle is clicked.
3394
+ *
3395
+ * Captures the starting mouse position and element dimensions, sets up
3396
+ * the resize state, adds the resizing class and state attribute, and
3397
+ * attaches document-level listeners for mouse movement and keyboard input.
3398
+ *
3399
+ * @param event - The mouse down event
3400
+ * @param direction - The direction of the handle being dragged
3401
+ */
3402
+ handleResizeStart(e, t) {
3403
+ e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t, Fr(e) ? (this.startX = e.touches[0].clientX, this.startY = e.touches[0].clientY) : (this.startX = e.clientX, this.startY = e.clientY), this.startWidth = this.element.offsetWidth, this.startHeight = this.element.offsetHeight, this.startWidth > 0 && this.startHeight > 0 && (this.aspectRatio = this.startWidth / this.startHeight), this.getPos(), this.container.dataset.resizeState = "true", this.classNames.resizing && this.container.classList.add(this.classNames.resizing), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("touchmove", this.handleTouchMove), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keyup", this.handleKeyUp);
3404
+ }
3405
+ handleResize(e, t) {
3406
+ if (!this.activeHandle)
3407
+ return;
3408
+ const n = this.preserveAspectRatio || this.isShiftKeyPressed, { width: r, height: s } = this.calculateNewDimensions(this.activeHandle, e, t), o = this.applyConstraints(r, s, n);
3409
+ this.element.style.width = `${o.width}px`, this.element.style.height = `${o.height}px`, this.onResize && this.onResize(o.width, o.height);
3410
+ }
3411
+ /**
3412
+ * Calculates new dimensions based on mouse delta and resize direction.
3413
+ *
3414
+ * Takes the starting dimensions and applies the mouse movement delta
3415
+ * according to the handle direction. For corner handles, both dimensions
3416
+ * are affected. For edge handles, only one dimension changes. If aspect
3417
+ * ratio should be preserved, delegates to applyAspectRatio.
3418
+ *
3419
+ * @param direction - The active resize handle direction
3420
+ * @param deltaX - Horizontal mouse movement since resize start
3421
+ * @param deltaY - Vertical mouse movement since resize start
3422
+ * @returns The calculated width and height
3423
+ */
3424
+ calculateNewDimensions(e, t, n) {
3425
+ let r = this.startWidth, s = this.startHeight;
3426
+ const o = e.includes("right"), i = e.includes("left"), a = e.includes("bottom"), c = e.includes("top");
3427
+ return o ? r = this.startWidth + t : i && (r = this.startWidth - t), a ? s = this.startHeight + n : c && (s = this.startHeight - n), (e === "right" || e === "left") && (r = this.startWidth + (o ? t : -t)), (e === "top" || e === "bottom") && (s = this.startHeight + (a ? n : -n)), this.preserveAspectRatio || this.isShiftKeyPressed ? this.applyAspectRatio(r, s, e) : { width: r, height: s };
3428
+ }
3429
+ /**
3430
+ * Applies min/max constraints to dimensions.
3431
+ *
3432
+ * When aspect ratio is NOT preserved, constraints are applied independently
3433
+ * to width and height. When aspect ratio IS preserved, constraints are
3434
+ * applied while maintaining the aspect ratio—if one dimension hits a limit,
3435
+ * the other is recalculated proportionally.
3436
+ *
3437
+ * This ensures that aspect ratio is never broken when constrained.
3438
+ *
3439
+ * @param width - The unconstrained width
3440
+ * @param height - The unconstrained height
3441
+ * @param preserveAspectRatio - Whether to maintain aspect ratio while constraining
3442
+ * @returns The constrained dimensions
3443
+ */
3444
+ applyConstraints(e, t, n) {
3445
+ var r, s, o, i;
3446
+ if (!n) {
3447
+ let l = Math.max(this.minSize.width, e), u = Math.max(this.minSize.height, t);
3448
+ return (r = this.maxSize) != null && r.width && (l = Math.min(this.maxSize.width, l)), (s = this.maxSize) != null && s.height && (u = Math.min(this.maxSize.height, u)), { width: l, height: u };
3449
+ }
3450
+ let a = e, c = t;
3451
+ return a < this.minSize.width && (a = this.minSize.width, c = a / this.aspectRatio), c < this.minSize.height && (c = this.minSize.height, a = c * this.aspectRatio), (o = this.maxSize) != null && o.width && a > this.maxSize.width && (a = this.maxSize.width, c = a / this.aspectRatio), (i = this.maxSize) != null && i.height && c > this.maxSize.height && (c = this.maxSize.height, a = c * this.aspectRatio), { width: a, height: c };
3452
+ }
3453
+ /**
3454
+ * Adjusts dimensions to maintain the original aspect ratio.
3455
+ *
3456
+ * For horizontal handles (left/right), uses width as the primary dimension
3457
+ * and calculates height from it. For vertical handles (top/bottom), uses
3458
+ * height as primary and calculates width. For corner handles, uses width
3459
+ * as the primary dimension.
3460
+ *
3461
+ * @param width - The new width
3462
+ * @param height - The new height
3463
+ * @param direction - The active resize direction
3464
+ * @returns Dimensions adjusted to preserve aspect ratio
3465
+ */
3466
+ applyAspectRatio(e, t, n) {
3467
+ const r = n === "left" || n === "right", s = n === "top" || n === "bottom";
3468
+ return r ? {
3469
+ width: e,
3470
+ height: e / this.aspectRatio
3471
+ } : s ? {
3472
+ width: t * this.aspectRatio,
3473
+ height: t
3474
+ } : {
3475
+ width: e,
3476
+ height: e / this.aspectRatio
3477
+ };
3478
+ }
3479
+ };
3480
+ function ys(e, t) {
3481
+ const { selection: n } = e, { $from: r } = n;
3482
+ if (n instanceof nt) {
3483
+ const o = r.index();
3484
+ return r.parent.canReplaceWith(o, o + 1, t);
3485
+ }
3486
+ let s = r.depth;
3487
+ for (; s >= 0; ) {
3488
+ const o = r.index(s);
3489
+ if (r.node(s).contentMatchAt(o).matchType(t))
3490
+ return !0;
3491
+ s -= 1;
3492
+ }
3493
+ return !1;
3494
+ }
3495
+ var Vr = {};
3496
+ vt(Vr, {
3497
+ createAtomBlockMarkdownSpec: () => Wr,
3498
+ createBlockMarkdownSpec: () => Ur,
3499
+ createInlineMarkdownSpec: () => Jr,
3500
+ parseAttributes: () => Et,
3501
+ parseIndentedBlocks: () => Yr,
3502
+ renderNestedMarkdownContent: () => Qr,
3503
+ serializeAttributes: () => Tt
3504
+ });
3505
+ function Et(e) {
3506
+ if (!e?.trim())
3507
+ return {};
3508
+ const t = {}, n = [], r = e.replace(/["']([^"']*)["']/g, (l) => (n.push(l), `__QUOTED_${n.length - 1}__`)), s = r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);
3509
+ if (s) {
3510
+ const l = s.map((u) => u.trim().slice(1));
3511
+ t.class = l.join(" ");
3512
+ }
3513
+ const o = r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);
3514
+ o && (t.id = o[1]);
3515
+ const i = /([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;
3516
+ Array.from(r.matchAll(i)).forEach(([, l, u]) => {
3517
+ var d;
3518
+ const p = parseInt(((d = u.match(/__QUOTED_(\d+)__/)) == null ? void 0 : d[1]) || "0", 10), f = n[p];
3519
+ f && (t[l] = f.slice(1, -1));
3520
+ });
3521
+ const c = r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g, "").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g, "").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g, "").trim();
3522
+ return c && c.split(/\s+/).filter(Boolean).forEach((u) => {
3523
+ u.match(/^[a-zA-Z][\w-]*$/) && (t[u] = !0);
3524
+ }), t;
3525
+ }
3526
+ function Tt(e) {
3527
+ if (!e || Object.keys(e).length === 0)
3528
+ return "";
3529
+ const t = [];
3530
+ return e.class && String(e.class).split(/\s+/).filter(Boolean).forEach((r) => t.push(`.${r}`)), e.id && t.push(`#${e.id}`), Object.entries(e).forEach(([n, r]) => {
3531
+ n === "class" || n === "id" || (r === !0 ? t.push(n) : r !== !1 && r != null && t.push(`${n}="${String(r)}"`));
3532
+ }), t.join(" ");
3533
+ }
3534
+ function Wr(e) {
3535
+ const {
3536
+ nodeName: t,
3537
+ name: n,
3538
+ parseAttributes: r = Et,
3539
+ serializeAttributes: s = Tt,
3540
+ defaultAttributes: o = {},
3541
+ requiredAttributes: i = [],
3542
+ allowedAttributes: a
3543
+ } = e, c = n || t, l = (u) => {
3544
+ if (!a)
3545
+ return u;
3546
+ const d = {};
3547
+ return a.forEach((p) => {
3548
+ p in u && (d[p] = u[p]);
3549
+ }), d;
3550
+ };
3551
+ return {
3552
+ parseMarkdown: (u, d) => {
3553
+ const p = { ...o, ...u.attributes };
3554
+ return d.createNode(t, p, []);
3555
+ },
3556
+ markdownTokenizer: {
3557
+ name: t,
3558
+ level: "block",
3559
+ start(u) {
3560
+ var d;
3561
+ const p = new RegExp(`^:::${c}(?:\\s|$)`, "m"), f = (d = u.match(p)) == null ? void 0 : d.index;
3562
+ return f !== void 0 ? f : -1;
3563
+ },
3564
+ tokenize(u, d, p) {
3565
+ const f = new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`), h = u.match(f);
3566
+ if (!h)
3567
+ return;
3568
+ const m = h[1] || "", g = r(m);
3569
+ if (!i.find((b) => !(b in g)))
3570
+ return {
3571
+ type: t,
3572
+ raw: h[0],
3573
+ attributes: g
3574
+ };
3575
+ }
3576
+ },
3577
+ renderMarkdown: (u) => {
3578
+ const d = l(u.attrs || {}), p = s(d), f = p ? ` {${p}}` : "";
3579
+ return `:::${c}${f} :::`;
3580
+ }
3581
+ };
3582
+ }
3583
+ function Ur(e) {
3584
+ const {
3585
+ nodeName: t,
3586
+ name: n,
3587
+ getContent: r,
3588
+ parseAttributes: s = Et,
3589
+ serializeAttributes: o = Tt,
3590
+ defaultAttributes: i = {},
3591
+ content: a = "block",
3592
+ allowedAttributes: c
3593
+ } = e, l = n || t, u = (d) => {
3594
+ if (!c)
3595
+ return d;
3596
+ const p = {};
3597
+ return c.forEach((f) => {
3598
+ f in d && (p[f] = d[f]);
3599
+ }), p;
3600
+ };
3601
+ return {
3602
+ parseMarkdown: (d, p) => {
3603
+ let f;
3604
+ if (r) {
3605
+ const m = r(d);
3606
+ f = typeof m == "string" ? [{ type: "text", text: m }] : m;
3607
+ } else a === "block" ? f = p.parseChildren(d.tokens || []) : f = p.parseInline(d.tokens || []);
3608
+ const h = { ...i, ...d.attributes };
3609
+ return p.createNode(t, h, f);
3610
+ },
3611
+ markdownTokenizer: {
3612
+ name: t,
3613
+ level: "block",
3614
+ start(d) {
3615
+ var p;
3616
+ const f = new RegExp(`^:::${l}`, "m"), h = (p = d.match(f)) == null ? void 0 : p.index;
3617
+ return h !== void 0 ? h : -1;
3618
+ },
3619
+ tokenize(d, p, f) {
3620
+ var h;
3621
+ const m = new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`), g = d.match(m);
3622
+ if (!g)
3623
+ return;
3624
+ const [v, b = ""] = g, k = s(b);
3625
+ let M = 1;
3626
+ const w = v.length;
3627
+ let S = "";
3628
+ const E = /^:::([\w-]*)(\s.*)?/gm, C = d.slice(w);
3629
+ for (E.lastIndex = 0; ; ) {
3630
+ const A = E.exec(C);
3631
+ if (A === null)
3632
+ break;
3633
+ const O = A.index, lt = A[1];
3634
+ if (!((h = A[2]) != null && h.endsWith(":::"))) {
3635
+ if (lt)
3636
+ M += 1;
3637
+ else if (M -= 1, M === 0) {
3638
+ const K = C.slice(0, O);
3639
+ S = K.trim();
3640
+ const dt = d.slice(0, w + O + A[0].length);
3641
+ let I = [];
3642
+ if (S)
3643
+ if (a === "block")
3644
+ for (I = f.blockTokens(K), I.forEach((R) => {
3645
+ R.text && (!R.tokens || R.tokens.length === 0) && (R.tokens = f.inlineTokens(R.text));
3646
+ }); I.length > 0; ) {
3647
+ const R = I[I.length - 1];
3648
+ if (R.type === "paragraph" && (!R.text || R.text.trim() === ""))
3649
+ I.pop();
3650
+ else
3651
+ break;
3652
+ }
3653
+ else
3654
+ I = f.inlineTokens(S);
3655
+ return {
3656
+ type: t,
3657
+ raw: dt,
3658
+ attributes: k,
3659
+ content: S,
3660
+ tokens: I
3661
+ };
3662
+ }
3663
+ }
3664
+ }
3665
+ }
3666
+ },
3667
+ renderMarkdown: (d, p) => {
3668
+ const f = u(d.attrs || {}), h = o(f), m = h ? ` {${h}}` : "", g = p.renderChildren(d.content || [], `
3669
+
3670
+ `);
3671
+ return `:::${l}${m}
3672
+
3673
+ ${g}
3674
+
3675
+ :::`;
3676
+ }
3677
+ };
3678
+ }
3679
+ function Kr(e) {
3680
+ if (!e.trim())
3681
+ return {};
3682
+ const t = {}, n = /(\w+)=(?:"([^"]*)"|'([^']*)')/g;
3683
+ let r = n.exec(e);
3684
+ for (; r !== null; ) {
3685
+ const [, s, o, i] = r;
3686
+ t[s] = o || i, r = n.exec(e);
3687
+ }
3688
+ return t;
3689
+ }
3690
+ function qr(e) {
3691
+ return Object.entries(e).filter(([, t]) => t != null).map(([t, n]) => `${t}="${n}"`).join(" ");
3692
+ }
3693
+ function Jr(e) {
3694
+ const {
3695
+ nodeName: t,
3696
+ name: n,
3697
+ getContent: r,
3698
+ parseAttributes: s = Kr,
3699
+ serializeAttributes: o = qr,
3700
+ defaultAttributes: i = {},
3701
+ selfClosing: a = !1,
3702
+ allowedAttributes: c
3703
+ } = e, l = n || t, u = (p) => {
3704
+ if (!c)
3705
+ return p;
3706
+ const f = {};
3707
+ return c.forEach((h) => {
3708
+ const m = typeof h == "string" ? h : h.name, g = typeof h == "string" ? void 0 : h.skipIfDefault;
3709
+ if (m in p) {
3710
+ const v = p[m];
3711
+ if (g !== void 0 && v === g)
3712
+ return;
3713
+ f[m] = v;
3714
+ }
3715
+ }), f;
3716
+ }, d = l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3717
+ return {
3718
+ parseMarkdown: (p, f) => {
3719
+ const h = { ...i, ...p.attributes };
3720
+ if (a)
3721
+ return f.createNode(t, h);
3722
+ const m = r ? r(p) : p.content || "";
3723
+ return m ? f.createNode(t, h, [f.createTextNode(m)]) : f.createNode(t, h, []);
3724
+ },
3725
+ markdownTokenizer: {
3726
+ name: t,
3727
+ level: "inline",
3728
+ start(p) {
3729
+ const f = a ? new RegExp(`\\[${d}\\s*[^\\]]*\\]`) : new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`), h = p.match(f), m = h?.index;
3730
+ return m !== void 0 ? m : -1;
3731
+ },
3732
+ tokenize(p, f, h) {
3733
+ const m = a ? new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`) : new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`), g = p.match(m);
3734
+ if (!g)
3735
+ return;
3736
+ let v = "", b = "";
3737
+ if (a) {
3738
+ const [, M] = g;
3739
+ b = M;
3740
+ } else {
3741
+ const [, M, w] = g;
3742
+ b = M, v = w || "";
3743
+ }
3744
+ const k = s(b.trim());
3745
+ return {
3746
+ type: t,
3747
+ raw: g[0],
3748
+ content: v.trim(),
3749
+ attributes: k
3750
+ };
3751
+ }
3752
+ },
3753
+ renderMarkdown: (p) => {
3754
+ let f = "";
3755
+ r ? f = r(p) : p.content && p.content.length > 0 && (f = p.content.filter((v) => v.type === "text").map((v) => v.text).join(""));
3756
+ const h = u(p.attrs || {}), m = o(h), g = m ? ` ${m}` : "";
3757
+ return a ? `[${l}${g}]` : `[${l}${g}]${f}[/${l}]`;
3758
+ }
3759
+ };
3760
+ }
3761
+ function Yr(e, t, n) {
3762
+ var r, s, o, i;
3763
+ const a = e.split(`
3764
+ `), c = [];
3765
+ let l = "", u = 0;
3766
+ const d = t.baseIndentSize || 2;
3767
+ for (; u < a.length; ) {
3768
+ const p = a[u], f = p.match(t.itemPattern);
3769
+ if (!f) {
3770
+ if (c.length > 0)
3771
+ break;
3772
+ if (p.trim() === "") {
3773
+ u += 1, l = `${l}${p}
3774
+ `;
3775
+ continue;
3776
+ } else
3777
+ return;
3778
+ }
3779
+ const h = t.extractItemData(f), { indentLevel: m, mainContent: g } = h;
3780
+ l = `${l}${p}
3781
+ `;
3782
+ const v = [g];
3783
+ for (u += 1; u < a.length; ) {
3784
+ const w = a[u];
3785
+ if (w.trim() === "") {
3786
+ const E = a.slice(u + 1).findIndex((O) => O.trim() !== "");
3787
+ if (E === -1)
3788
+ break;
3789
+ if ((((s = (r = a[u + 1 + E].match(/^(\s*)/)) == null ? void 0 : r[1]) == null ? void 0 : s.length) || 0) > m) {
3790
+ v.push(w), l = `${l}${w}
3791
+ `, u += 1;
3792
+ continue;
3793
+ } else
3794
+ break;
3795
+ }
3796
+ if ((((i = (o = w.match(/^(\s*)/)) == null ? void 0 : o[1]) == null ? void 0 : i.length) || 0) > m)
3797
+ v.push(w), l = `${l}${w}
3798
+ `, u += 1;
3799
+ else
3800
+ break;
3801
+ }
3802
+ let b;
3803
+ const k = v.slice(1);
3804
+ if (k.length > 0) {
3805
+ const w = k.map((S) => S.slice(m + d)).join(`
3806
+ `);
3807
+ w.trim() && (t.customNestedParser ? b = t.customNestedParser(w) : b = n.blockTokens(w));
3808
+ }
3809
+ const M = t.createToken(h, b);
3810
+ c.push(M);
3811
+ }
3812
+ if (c.length !== 0)
3813
+ return {
3814
+ items: c,
3815
+ raw: l
3816
+ };
3817
+ }
3818
+ function Qr(e, t, n, r) {
3819
+ if (!e || !Array.isArray(e.content))
3820
+ return "";
3821
+ const s = typeof n == "function" ? n(r) : n, [o, ...i] = e.content, a = t.renderChildren([o]), c = [`${s}${a}`];
3822
+ return i && i.length > 0 && i.forEach((l) => {
3823
+ const u = t.renderChildren([l]);
3824
+ if (u) {
3825
+ const d = u.split(`
3826
+ `).map((p) => p ? t.indent(p) : "").join(`
3827
+ `);
3828
+ c.push(d);
3829
+ }
3830
+ }), c.join(`
3831
+ `);
3832
+ }
3833
+ function Xr(e, t, n = {}) {
3834
+ const { state: r } = t, { doc: s, tr: o } = r, i = e;
3835
+ s.descendants((a, c) => {
3836
+ const l = o.mapping.map(c), u = o.mapping.map(c) + a.nodeSize;
3837
+ let d = null;
3838
+ if (a.marks.forEach((f) => {
3839
+ if (f !== i)
3840
+ return !1;
3841
+ d = f;
3842
+ }), !d)
3843
+ return;
3844
+ let p = !1;
3845
+ if (Object.keys(n).forEach((f) => {
3846
+ n[f] !== d.attrs[f] && (p = !0);
3847
+ }), p) {
3848
+ const f = e.type.create({
3849
+ ...e.attrs,
3850
+ ...n
3851
+ });
3852
+ o.removeMark(l, u, e.type), o.addMark(l, u, f);
3853
+ }
3854
+ }), o.docChanged && t.view.dispatch(o);
3855
+ }
3856
+ var bs = class me extends St {
3857
+ constructor() {
3858
+ super(...arguments), this.type = "node";
3859
+ }
3860
+ /**
3861
+ * Create a new Node instance
3862
+ * @param config - Node configuration object or a function that returns a configuration object
3863
+ */
3864
+ static create(t = {}) {
3865
+ const n = typeof t == "function" ? t() : t;
3866
+ return new me(n);
3867
+ }
3868
+ configure(t) {
3869
+ return super.configure(t);
3870
+ }
3871
+ extend(t) {
3872
+ const n = typeof t == "function" ? t() : t;
3873
+ return super.extend(n);
3874
+ }
3875
+ };
3876
+ function ws(e) {
3877
+ return new zr({
3878
+ find: e.find,
3879
+ handler: ({ state: t, range: n, match: r, pasteEvent: s }) => {
3880
+ const o = x(e.getAttributes, void 0, r, s);
3881
+ if (o === !1 || o === null)
3882
+ return null;
3883
+ const { tr: i } = t, a = r[r.length - 1], c = r[0];
3884
+ let l = n.to;
3885
+ if (a) {
3886
+ const u = c.search(/\S/), d = n.from + c.indexOf(a), p = d + a.length;
3887
+ if (Zt(n.from, n.to, t.doc).filter((h) => h.mark.type.excluded.find((g) => g === e.type && g !== h.mark.type)).filter((h) => h.to > d).length)
3888
+ return null;
3889
+ p < n.to && i.delete(p, n.to), d > n.from && i.delete(n.from + u, d), l = n.from + u + a.length, i.addMark(n.from + u, l, e.type.create(o || {})), i.removeStoredMark(e.type);
3890
+ }
3891
+ }
3892
+ });
3893
+ }
3894
+ export {
3895
+ st as CommandManager,
3896
+ us as Editor,
3897
+ St as Extendable,
3898
+ N as Extension,
3899
+ at as InputRule,
3900
+ Gt as MappablePosition,
3901
+ Nr as Mark,
3902
+ bs as Node,
3903
+ jr as NodePos,
3904
+ zr as PasteRule,
3905
+ vs as ResizableNodeView,
3906
+ x as callOrReturn,
3907
+ ys as canInsertNode,
3908
+ Fn as combineTransactionSteps,
3909
+ Lt as commands,
3910
+ Wr as createAtomBlockMarkdownSpec,
3911
+ Ur as createBlockMarkdownSpec,
3912
+ rt as createChainableState,
3913
+ ht as createDocument,
3914
+ Jr as createInlineMarkdownSpec,
3915
+ or as createMappablePosition,
3916
+ W as createNodeFromContent,
3917
+ Hr as createStyleTag,
3918
+ Vn as defaultBlockAt,
3919
+ $t as deleteProps,
3920
+ q as elementFromString,
3921
+ _r as extensions,
3922
+ os as findChildrenInRange,
3923
+ Yn as findDuplicates,
3924
+ it as findParentNode,
3925
+ Wn as findParentNodeClosestToPos,
3926
+ wt as flattenExtensions,
3927
+ Jn as fromString,
3928
+ Zn as getAttributes,
3929
+ Jt as getAttributesFromExtensions,
3930
+ er as getChangedRanges,
3931
+ y as getExtensionField,
3932
+ kt as getHTMLFromFragment,
3933
+ Kt as getMarkAttributes,
3934
+ bt as getMarkRange,
3935
+ z as getMarkType,
3936
+ Zt as getMarksBetween,
3937
+ as as getNodeAtPosition,
3938
+ Xn as getNodeAttributes,
3939
+ T as getNodeType,
3940
+ et as getRenderedAttributes,
3941
+ is as getSchema,
3942
+ Yt as getSchemaByResolvedExtensions,
3943
+ H as getSchemaTypeByName,
3944
+ ot as getSchemaTypeNameByName,
3945
+ Z as getSplittedAttributes,
3946
+ Qn as getText,
3947
+ Qt as getTextBetween,
3948
+ nr as getTextContentFromNodes,
3949
+ Xt as getTextSerializersFromSchema,
3950
+ sr as getUpdatedPosition,
3951
+ Rt as injectExtensionAttributesToParseRule,
3952
+ Pr as inputRulesPlugin,
3953
+ rr as isActive,
3954
+ Pt as isAndroid,
3955
+ cs as isAtEndOfNode,
3956
+ ls as isAtStartOfNode,
3957
+ Un as isEmptyObject,
3958
+ Dt as isExtensionRulesEnabled,
3959
+ qt as isFunction,
3960
+ Bt as isList,
3961
+ Ut as isMacOS,
3962
+ mt as isMarkActive,
3963
+ U as isNodeActive,
3964
+ xt as isNodeEmpty,
3965
+ ds as isNodeSelection,
3966
+ Rr as isNumber,
3967
+ Y as isPlainObject,
3968
+ yt as isRegExp,
3969
+ fn as isSafari,
3970
+ Ft as isTextSelection,
3971
+ tt as isiOS,
3972
+ ps as markInputRule,
3973
+ ws as markPasteRule,
3974
+ Vr as markdown,
3975
+ qn as mergeAttributes,
3976
+ ee as mergeDeep,
3977
+ _ as minMax,
3978
+ hs as nodeInputRule,
3979
+ G as objectIncludes,
3980
+ Et as parseAttributes,
3981
+ Yr as parseIndentedBlocks,
3982
+ Or as pasteRulesPlugin,
3983
+ Gn as removeDuplicates,
3984
+ Qr as renderNestedMarkdownContent,
3985
+ Mt as resolveExtensions,
3986
+ Vt as resolveFocusPosition,
3987
+ gn as selectionToInsertionEnd,
3988
+ Tt as serializeAttributes,
3989
+ V as sortExtensions,
3990
+ L as splitExtensions,
3991
+ ms as textblockTypeInputRule,
3992
+ Xr as updateMarkViewAttributes,
3993
+ gs as wrappingInputRule
3994
+ };