@vc-shell/framework 1.1.46 → 1.1.47

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 (360) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/core/plugins/modularity/loader.ts +126 -97
  3. package/dist/assets/042c75b764bc78a7.svg +1 -0
  4. package/dist/assets/0ba156439a339f2a.svg +1 -0
  5. package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
  6. package/dist/assets/0f590f8a94577092.svg +1 -0
  7. package/dist/assets/0fc5820f8be53a1b.svg +1 -0
  8. package/dist/assets/10768e2cc79fc60b.svg +1 -0
  9. package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
  10. package/dist/assets/157b8721e0600ea8.svg +1 -0
  11. package/dist/assets/15e91cdd649cde9a.svg +1 -0
  12. package/dist/assets/1a3e84b2457f709a.woff +0 -0
  13. package/dist/assets/1de63eb118636cce.svg +1 -0
  14. package/dist/assets/1ea01de36eb5491b.svg +1 -0
  15. package/dist/assets/204eaf512fde2023.svg +1 -0
  16. package/dist/assets/2088983edf42e153.svg +1 -0
  17. package/dist/assets/208f810a9321a327.svg +1 -0
  18. package/dist/assets/21220a9d10e6c558.svg +1 -0
  19. package/dist/assets/220db345a102045d.woff2 +0 -0
  20. package/dist/assets/225da11d23968333.svg +1 -0
  21. package/dist/assets/226f862dd81bdc13.woff2 +0 -0
  22. package/dist/assets/23a2d53395ddb14f.woff +0 -0
  23. package/dist/assets/259e6ad461a52ad7.svg +1 -0
  24. package/dist/assets/261e6dec4d53b9ac.woff +0 -0
  25. package/dist/assets/262f46a0b6d94bb6.svg +1 -0
  26. package/dist/assets/2857c513073467da.svg +1 -0
  27. package/dist/assets/2b3be7889467d98f.woff +0 -0
  28. package/dist/assets/2d4e6190eec72737.svg +1 -0
  29. package/dist/assets/2eba973185078bc8.woff +0 -0
  30. package/dist/assets/327511cd4a7ba7f9.woff +0 -0
  31. package/dist/assets/334d3f6bc766c516.woff +0 -0
  32. package/dist/assets/34ff7dd0c2285956.svg +1 -0
  33. package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
  34. package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
  35. package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
  36. package/dist/assets/41275bcb979cb650.svg +1 -0
  37. package/dist/assets/42df4e2d6fa3fd2a.woff2 +0 -0
  38. package/dist/assets/434f7982590e462f.woff +0 -0
  39. package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
  40. package/dist/assets/4d7a77b0e5373992.svg +1 -0
  41. package/dist/assets/4e43c74354534fb3.svg +1 -0
  42. package/dist/assets/4fe75f5117100705.svg +1 -0
  43. package/dist/assets/52610491f372cb0c.woff2 +0 -0
  44. package/dist/assets/52e261a005074e1b.woff +0 -0
  45. package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
  46. package/dist/assets/572bb1bb4156a9c1.svg +1 -0
  47. package/dist/assets/5b3661be8be679d0.woff2 +0 -0
  48. package/dist/assets/5d96cfcc5bedd917.woff2 +0 -0
  49. package/dist/assets/6075995d7e74da46.woff2 +0 -0
  50. package/dist/assets/617c4736236e199e.woff +0 -0
  51. package/dist/assets/6619e9e10beea0e7.woff2 +0 -0
  52. package/dist/assets/67230f05dc94a265.svg +1 -0
  53. package/dist/assets/6798e4dd4add9b48.svg +1 -0
  54. package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
  55. package/dist/assets/6a3e73faf406cf33.svg +1 -0
  56. package/dist/assets/72de3a63bc0b70dd.svg +1 -0
  57. package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
  58. package/dist/assets/74ed5f8a78e71106.svg +1 -0
  59. package/dist/assets/7ce0c166fd6a1204.woff +0 -0
  60. package/dist/assets/7d55399c2a7bc985.svg +1 -0
  61. package/dist/assets/7d970675c69fca1d.woff +0 -0
  62. package/dist/assets/7eda727273fd98d3.svg +1 -0
  63. package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
  64. package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
  65. package/dist/assets/861e6b7192b3b6c7.woff +0 -0
  66. package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
  67. package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
  68. package/dist/assets/910b0d99b9e26568.svg +1 -0
  69. package/dist/assets/91eee1aa81f72683.woff +0 -0
  70. package/dist/assets/92508f8707159b51.svg +1 -0
  71. package/dist/assets/9392bf1d591e1abb.svg +1 -0
  72. package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
  73. package/dist/assets/9cb83236f6bb7ab1.svg +1 -0
  74. package/dist/assets/9d37314695c0b68d.woff +0 -0
  75. package/dist/assets/a18404194e3f9047.svg +1 -0
  76. package/dist/assets/a2017fe7f0a26510.svg +1 -0
  77. package/dist/assets/a47034e65dbcc3d7.woff +0 -0
  78. package/dist/assets/a617e11804bbacb7.woff +0 -0
  79. package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
  80. package/dist/assets/abf88f301a0730f4.svg +1 -0
  81. package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
  82. package/dist/assets/b1a596e31ad1185a.svg +1 -0
  83. package/dist/assets/b27767411c8427be.woff +0 -0
  84. package/dist/assets/b291dc35a17511f7.woff +0 -0
  85. package/dist/assets/b325adcae33bbe7a.svg +1 -0
  86. package/dist/assets/b372390551ca2fa1.svg +1 -0
  87. package/dist/assets/b5bb1e8fc975decd.svg +1 -0
  88. package/dist/assets/b645a4a2181b9dc1.svg +1 -0
  89. package/dist/assets/b6499ddce0a4ef7d.svg +1 -0
  90. package/dist/assets/b94421fadd23b0f2.svg +1 -0
  91. package/dist/assets/bb28fb0f27f1c11b.svg +1 -0
  92. package/dist/assets/bfbe205759295eca.woff2 +0 -0
  93. package/dist/assets/ca791c5ca5848a03.svg +1 -0
  94. package/dist/assets/cb32840ce330103f.woff +0 -0
  95. package/dist/assets/d084bda16abe8a56.svg +1 -0
  96. package/dist/assets/d32b129cae2fffd6.svg +1 -0
  97. package/dist/assets/d35a4c7113315758.woff2 +0 -0
  98. package/dist/assets/d3f792f54ae4c307.svg +1 -0
  99. package/dist/assets/d5a5b8630120073d.svg +1 -0
  100. package/dist/assets/d5f9664ebbfb104b.svg +1 -0
  101. package/dist/assets/d80b05788e407de7.woff2 +0 -0
  102. package/dist/assets/d84247b59449dd88.woff2 +0 -0
  103. package/dist/assets/dd05d43ff0df2fc7.svg +1 -0
  104. package/dist/assets/e38acaa1757232e0.svg +1 -0
  105. package/dist/assets/e4a8550f1c7ffe36.svg +1 -0
  106. package/dist/assets/e5adb5ae3a3698f6.svg +1 -0
  107. package/dist/assets/e61a1889bac955f4.woff2 +0 -0
  108. package/dist/assets/e72bb11356af94c7.svg +1 -0
  109. package/dist/assets/e98196a9f8dcb2f0.svg +1 -0
  110. package/dist/assets/ebec912a42ad49ff.woff +0 -0
  111. package/dist/assets/f09d89268e4c0317.svg +1 -0
  112. package/dist/assets/f276d55184e05a07.woff +0 -0
  113. package/dist/assets/f5722262b6e7214e.woff2 +0 -0
  114. package/dist/assets/f7fc8bf46089d8b2.svg +1 -0
  115. package/dist/assets/fcb1c1ffb5640194.woff +0 -0
  116. package/dist/assets/fe141d99763f5d2b.woff +0 -0
  117. package/dist/assets/fed13b0d59903483.svg +1 -0
  118. package/dist/assets/fed757d2c2344ead.woff2 +0 -0
  119. package/dist/assets/ffc438f20e79ce73.woff +0 -0
  120. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  121. package/dist/framework.js +16544 -25878
  122. package/dist/index.css +1 -1
  123. package/dist/index.d.ts +5 -8
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/tsconfig.tsbuildinfo +1 -1
  126. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  127. package/dist/vendor-boolbase-Bgn9I6iN.js +21 -0
  128. package/dist/vendor-cheerio-CleDsuQZ.js +1053 -0
  129. package/dist/vendor-cheerio-select-CVkYl3Z-.js +191 -0
  130. package/dist/vendor-css-select-CtIzVIiG.js +622 -0
  131. package/dist/vendor-css-what-CZZaquJM.js +267 -0
  132. package/dist/vendor-cypress-signalr-mock-CdKwIhWw.js +769 -0
  133. package/dist/vendor-date-fns-CdFbeoHV.js +2989 -0
  134. package/dist/vendor-dom-serializer-CugO0RdN.js +213 -0
  135. package/dist/vendor-dom7-wvIUV9pT.js +529 -0
  136. package/dist/vendor-domelementtype-B3sFIGaC.js +21 -0
  137. package/dist/vendor-domhandler-CL40eeX9.js +311 -0
  138. package/dist/vendor-dompurify-eYFoHPwR.js +528 -0
  139. package/dist/vendor-domutils-D3Y2YQFR.js +386 -0
  140. package/dist/vendor-entities-v26HW8wW.js +363 -0
  141. package/dist/vendor-floating-ui-core-C9uEvi1M.js +349 -0
  142. package/dist/vendor-floating-ui-dom-CZkYGmv4.js +393 -0
  143. package/dist/vendor-floating-ui-utils-Bx3BTd6_.js +259 -0
  144. package/dist/vendor-floating-ui-vue-CLOiVYP7.js +107 -0
  145. package/dist/vendor-headlessui-vue-Dg0Llidi.js +961 -0
  146. package/dist/vendor-htmlparser2-CXL_uhMI.js +735 -0
  147. package/dist/vendor-iconify-vue-D4fihzvl.js +1205 -0
  148. package/dist/vendor-intlify-core-base-Bvt2vJFV.js +1129 -0
  149. package/dist/vendor-intlify-message-compiler-1VxNzq21.js +945 -0
  150. package/dist/vendor-intlify-shared-D7kiPMOG.js +130 -0
  151. package/dist/vendor-iso-639-1-dVGfSUIM.js +781 -0
  152. package/dist/vendor-linkify-it-LzoUhj6C.js +199 -0
  153. package/dist/vendor-linkifyjs-DTu7SY_Y.js +705 -0
  154. package/dist/vendor-lodash-es-CrYlgAi8.js +4816 -0
  155. package/dist/vendor-markdown-it-4AJoRTAg.js +2263 -0
  156. package/dist/vendor-markdown-it-task-lists-Byg1-ms9.js +69 -0
  157. package/dist/vendor-mdurl-DZFDNdqC.js +192 -0
  158. package/dist/vendor-microsoft-applicationinsights-analytics-js-DA-ctcAL.js +1105 -0
  159. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-COfRj-2q.js +261 -0
  160. package/dist/vendor-microsoft-applicationinsights-channel-js-MTPYhH-I.js +1809 -0
  161. package/dist/vendor-microsoft-applicationinsights-common-CDVnJ6MR.js +1921 -0
  162. package/dist/vendor-microsoft-applicationinsights-core-js-D7Aicf8S.js +4127 -0
  163. package/dist/vendor-microsoft-applicationinsights-dependencies-js-CvQWWraU.js +1399 -0
  164. package/dist/vendor-microsoft-applicationinsights-properties-js-C0Iv1cZE.js +572 -0
  165. package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +43 -0
  166. package/dist/vendor-microsoft-applicationinsights-web-BRuQAzjU.js +487 -0
  167. package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +147 -0
  168. package/dist/vendor-microsoft-signalr-qIrag5xx.js +1761 -0
  169. package/dist/vendor-moment-CwOqp704.js +2589 -0
  170. package/dist/vendor-nevware21-ts-async-FAyg3c9V.js +260 -0
  171. package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +853 -0
  172. package/dist/vendor-nth-check-BE7AeBMg.js +45 -0
  173. package/dist/vendor-orderedmap-B3SOk52B.js +103 -0
  174. package/dist/vendor-parse5-DqztJOGh.js +5747 -0
  175. package/dist/vendor-parse5-htmlparser2-tree-adapter-CNubfdOP.js +143 -0
  176. package/dist/vendor-popperjs-core-LGjf7Wza.js +905 -0
  177. package/dist/vendor-prettier-D8C9GG-0.js +4858 -0
  178. package/dist/vendor-prosemirror-commands-BqYcdumy.js +344 -0
  179. package/dist/vendor-prosemirror-dropcursor-zknUsW5x.js +86 -0
  180. package/dist/vendor-prosemirror-gapcursor-DjOZhP78.js +200 -0
  181. package/dist/vendor-prosemirror-history-l8l3CFac.js +248 -0
  182. package/dist/vendor-prosemirror-keymap-C17r08p-.js +62 -0
  183. package/dist/vendor-prosemirror-markdown-WJEDhc-w.js +650 -0
  184. package/dist/vendor-prosemirror-model-BN5TnJD_.js +2736 -0
  185. package/dist/vendor-prosemirror-schema-list-CR0gi7aY.js +87 -0
  186. package/dist/vendor-prosemirror-state-B0bFP8WI.js +821 -0
  187. package/dist/vendor-prosemirror-tables-B1txTKlC.js +1711 -0
  188. package/dist/vendor-prosemirror-transform-Bo7kNPme.js +1507 -0
  189. package/dist/vendor-prosemirror-view--C7TZvmQ.js +3746 -0
  190. package/dist/vendor-punycode-js-CNI-zL6U.js +133 -0
  191. package/dist/vendor-rope-sequence-sEGCUMi8.js +100 -0
  192. package/dist/vendor-semver-BoKYtkQw.js +1021 -0
  193. package/dist/vendor-ssr-window-D4k3p53c.js +133 -0
  194. package/dist/vendor-swiper-CMVLTGu0.js +2825 -0
  195. package/dist/vendor-tippy-js-BGdgwGX-.js +812 -0
  196. package/dist/vendor-tiptap-core-BRY37Sb2.js +2806 -0
  197. package/dist/vendor-tiptap-extension-blockquote-CPd5qv-9.js +43 -0
  198. package/dist/vendor-tiptap-extension-bold-B0GwBNks.js +71 -0
  199. package/dist/vendor-tiptap-extension-bubble-menu-B0sZZld7.js +128 -0
  200. package/dist/vendor-tiptap-extension-bullet-list-CQm4ReOu.js +53 -0
  201. package/dist/vendor-tiptap-extension-code-C8cy6bRj.js +51 -0
  202. package/dist/vendor-tiptap-extension-code-block-BqTchNEf.js +133 -0
  203. package/dist/vendor-tiptap-extension-document-Dka1Uu0g.js +9 -0
  204. package/dist/vendor-tiptap-extension-dropcursor-CFSh-BuE.js +20 -0
  205. package/dist/vendor-tiptap-extension-floating-menu-H8PB4zeI.js +99 -0
  206. package/dist/vendor-tiptap-extension-gapcursor-CzwfD_IT.js +24 -0
  207. package/dist/vendor-tiptap-extension-hard-break-Rm6aVcrK.js +55 -0
  208. package/dist/vendor-tiptap-extension-heading-CavI6u1v.js +54 -0
  209. package/dist/vendor-tiptap-extension-history-WEN1_74D.js +35 -0
  210. package/dist/vendor-tiptap-extension-horizontal-rule-DZkUEL6s.js +58 -0
  211. package/dist/vendor-tiptap-extension-image-B67_mxGM.js +64 -0
  212. package/dist/vendor-tiptap-extension-italic-BshxBFou.js +70 -0
  213. package/dist/vendor-tiptap-extension-link-CJAQIgui.js +262 -0
  214. package/dist/vendor-tiptap-extension-list-item-DF-iMpqO.js +33 -0
  215. package/dist/vendor-tiptap-extension-ordered-list-CN8MF-kN.js +71 -0
  216. package/dist/vendor-tiptap-extension-paragraph-DI577lM5.js +33 -0
  217. package/dist/vendor-tiptap-extension-placeholder-DwAtlfAF.js +52 -0
  218. package/dist/vendor-tiptap-extension-strike-CIty09KN.js +61 -0
  219. package/dist/vendor-tiptap-extension-table-C5nv-GUb.js +213 -0
  220. package/dist/vendor-tiptap-extension-table-cell-DXbBhJW3.js +40 -0
  221. package/dist/vendor-tiptap-extension-table-header-rtggsYXA.js +40 -0
  222. package/dist/vendor-tiptap-extension-table-row-67khjMDt.js +22 -0
  223. package/dist/vendor-tiptap-extension-text-D1OHb_a1.js +8 -0
  224. package/dist/vendor-tiptap-extension-underline-IqWixw3m.js +40 -0
  225. package/dist/vendor-tiptap-markdown-DVxB1hbO.js +825 -0
  226. package/dist/vendor-tiptap-starter-kit-CPH9gu2X.js +29 -0
  227. package/dist/vendor-tiptap-vue-3-CkBe4_xM.js +225 -0
  228. package/dist/vendor-truncate-html-Bx1HJzRq.js +145 -0
  229. package/dist/vendor-uc-micro-4lbSaZOs.js +17 -0
  230. package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +93 -0
  231. package/dist/vendor-vee-validate-rules-DDeNM2Gc.js +314 -0
  232. package/dist/vendor-vue-currency-input-DxWnS-HB.js +315 -0
  233. package/dist/vendor-vue-devtools-api-aVYGocXp.js +93 -0
  234. package/dist/vendor-vue-i18n-DPtOLen3.js +1359 -0
  235. package/dist/vendor-vue3-application-insights-dAGGfA_M.js +69 -0
  236. package/dist/vendor-vue3-touch-events-8Pa3HHlV.js +169 -0
  237. package/dist/vendor-vuepic-vue-datepicker-DglsiNYa.js +4997 -0
  238. package/dist/vendor-vueuse-components-DtK_mxpP.js +219 -0
  239. package/dist/vendor-vueuse-core-cB-c7DzH.js +5129 -0
  240. package/dist/vendor-vueuse-shared-Dg7PMM0z.js +1169 -0
  241. package/dist/vendor-w3c-keyname-CLxH8j-f.js +92 -0
  242. package/dist/vendor-whatwg-fetch-l0sNRNKZ.js +1 -0
  243. package/package.json +5 -4
  244. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +2 -1
  245. package/dist/vendor-boolbase-Cp9L0GAZ.js +0 -25
  246. package/dist/vendor-cheerio-HN9zIPZn.js +0 -3135
  247. package/dist/vendor-cheerio-select-5Ry0HvBq.js +0 -306
  248. package/dist/vendor-css-select-DRIZ9kfZ.js +0 -966
  249. package/dist/vendor-css-what-DuPJ1HEF.js +0 -448
  250. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +0 -778
  251. package/dist/vendor-date-fns-515YWkk-.js +0 -6724
  252. package/dist/vendor-dom-serializer-nQMsqjYW.js +0 -286
  253. package/dist/vendor-dom7-CJLPMwy5.js +0 -941
  254. package/dist/vendor-domelementtype-CjSzQey5.js +0 -53
  255. package/dist/vendor-domhandler-9z8cS16a.js +0 -484
  256. package/dist/vendor-dompurify-CRFzu7ib.js +0 -1336
  257. package/dist/vendor-domutils-Bc-Opz-v.js +0 -981
  258. package/dist/vendor-entities-Bfsx4xOQ.js +0 -636
  259. package/dist/vendor-floating-ui-core-wV8u8QP4.js +0 -511
  260. package/dist/vendor-floating-ui-dom-DDnRPs17.js +0 -706
  261. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +0 -296
  262. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +0 -167
  263. package/dist/vendor-fontsource-plus-jakarta-sans.css +0 -1
  264. package/dist/vendor-headlessui-vue-CY9FRgTb.js +0 -83
  265. package/dist/vendor-htmlparser2-B1dhFPOs.js +0 -1426
  266. package/dist/vendor-iconify-vue-DfRGgyNu.js +0 -1840
  267. package/dist/vendor-intlify-core-base-BuknsFQe.js +0 -1876
  268. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +0 -1508
  269. package/dist/vendor-intlify-shared-Cz4YRMuC.js +0 -241
  270. package/dist/vendor-iso-639-1-BJCk9DvE.js +0 -819
  271. package/dist/vendor-linkify-it-CKUf4vsc.js +0 -830
  272. package/dist/vendor-linkifyjs-BfyGgbCh.js +0 -1756
  273. package/dist/vendor-lodash-es-BySUOlwf.js +0 -18333
  274. package/dist/vendor-markdown-it-D-apazHa.js +0 -6000
  275. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +0 -131
  276. package/dist/vendor-mdurl-BNh2CCgT.js +0 -537
  277. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +0 -1275
  278. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +0 -591
  279. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +0 -2153
  280. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +0 -2470
  281. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +0 -6589
  282. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +0 -1510
  283. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +0 -761
  284. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +0 -70
  285. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +0 -667
  286. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +0 -520
  287. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +0 -3339
  288. package/dist/vendor-moment-Mki5YqAR.js +0 -5679
  289. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +0 -395
  290. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +0 -1160
  291. package/dist/vendor-nth-check-Bx8TxtJt.js +0 -157
  292. package/dist/vendor-orderedmap-dGG6uMFJ.js +0 -137
  293. package/dist/vendor-parse5-Bt2NhSzR.js +0 -8432
  294. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +0 -216
  295. package/dist/vendor-popperjs-core-Cr2byIky.js +0 -1790
  296. package/dist/vendor-prettier-B4PaeWRQ.js +0 -98
  297. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +0 -561
  298. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +0 -146
  299. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +0 -236
  300. package/dist/vendor-prosemirror-history-BDaJkvNx.js +0 -414
  301. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +0 -128
  302. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +0 -866
  303. package/dist/vendor-prosemirror-model-BZu3WVcD.js +0 -3463
  304. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +0 -158
  305. package/dist/vendor-prosemirror-state-BvL9Pxph.js +0 -1003
  306. package/dist/vendor-prosemirror-tables-17qAnviK.js +0 -2159
  307. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +0 -2156
  308. package/dist/vendor-prosemirror-view-CU2WTHT7.js +0 -5811
  309. package/dist/vendor-punycode-js-iAs5RxMf.js +0 -441
  310. package/dist/vendor-rope-sequence-BdXDKoGt.js +0 -207
  311. package/dist/vendor-semver-CVLMK-S4.js +0 -2702
  312. package/dist/vendor-ssr-window-s6OpKa3O.js +0 -150
  313. package/dist/vendor-swiper-CdiyNHVt.js +0 -5679
  314. package/dist/vendor-tippy-js-DWFe2TfK.js +0 -1647
  315. package/dist/vendor-tiptap-core-NfwGfaQk.js +0 -4910
  316. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +0 -57
  317. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +0 -97
  318. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +0 -218
  319. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +0 -73
  320. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +0 -221
  321. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +0 -75
  322. package/dist/vendor-tiptap-extension-document-DssuotYs.js +0 -13
  323. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +0 -26
  324. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +0 -165
  325. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +0 -30
  326. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +0 -68
  327. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +0 -77
  328. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +0 -48
  329. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +0 -92
  330. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +0 -76
  331. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +0 -96
  332. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +0 -414
  333. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +0 -37
  334. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +0 -97
  335. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +0 -39
  336. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +0 -66
  337. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +0 -79
  338. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +0 -47
  339. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +0 -47
  340. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +0 -26
  341. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +0 -354
  342. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +0 -12
  343. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +0 -50
  344. package/dist/vendor-tiptap-markdown-7-PCADTU.js +0 -1017
  345. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +0 -88
  346. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +0 -268
  347. package/dist/vendor-truncate-html-3qQY0Djo.js +0 -196
  348. package/dist/vendor-uc-micro-jjt6LQ65.js +0 -23
  349. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +0 -154
  350. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +0 -536
  351. package/dist/vendor-vue-currency-input-DGAkEFBO.js +0 -545
  352. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +0 -169
  353. package/dist/vendor-vue-i18n-Co752uk3.js +0 -1897
  354. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +0 -119
  355. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +0 -416
  356. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +0 -5019
  357. package/dist/vendor-vueuse-components-l1bL12mE.js +0 -339
  358. package/dist/vendor-vueuse-core-DGcJOmwG.js +0 -7743
  359. package/dist/vendor-vueuse-shared-_mOXsFuM.js +0 -1568
  360. package/dist/vendor-w3c-keyname-BOm2dtJm.js +0 -121
@@ -0,0 +1,3746 @@
1
+ import { N as D, S as he, T as x, A as Sn } from "./vendor-prosemirror-state-B0bFP8WI.js";
2
+ import { S as J, D as Re, F as _, d as qt, M as Cn } from "./vendor-prosemirror-model-BN5TnJD_.js";
3
+ import { d as On } from "./vendor-prosemirror-transform-Bo7kNPme.js";
4
+ const C = function(t) {
5
+ for (var e = 0; ; e++)
6
+ if (t = t.previousSibling, !t)
7
+ return e;
8
+ }, ue = function(t) {
9
+ let e = t.assignedSlot || t.parentNode;
10
+ return e && e.nodeType == 11 ? e.host : e;
11
+ };
12
+ let He = null;
13
+ const K = function(t, e, n) {
14
+ let o = He || (He = document.createRange());
15
+ return o.setEnd(t, n ?? t.nodeValue.length), o.setStart(t, e || 0), o;
16
+ }, Mn = function() {
17
+ He = null;
18
+ }, se = function(t, e, n, o) {
19
+ return n && (rt(t, e, n, o, -1) || rt(t, e, n, o, 1));
20
+ }, xn = /^(img|br|input|textarea|hr)$/i;
21
+ function rt(t, e, n, o, i) {
22
+ for (var s; ; ) {
23
+ if (t == n && e == o)
24
+ return !0;
25
+ if (e == (i < 0 ? 0 : B(t))) {
26
+ let r = t.parentNode;
27
+ if (!r || r.nodeType != 1 || Ce(t) || xn.test(t.nodeName) || t.contentEditable == "false")
28
+ return !1;
29
+ e = C(t) + (i < 0 ? 0 : 1), t = r;
30
+ } else if (t.nodeType == 1) {
31
+ let r = t.childNodes[e + (i < 0 ? -1 : 0)];
32
+ if (r.nodeType == 1 && r.contentEditable == "false")
33
+ if (!((s = r.pmViewDesc) === null || s === void 0) && s.ignoreForSelection)
34
+ e += i;
35
+ else
36
+ return !1;
37
+ else
38
+ t = r, e = i < 0 ? B(t) : 0;
39
+ } else
40
+ return !1;
41
+ }
42
+ }
43
+ function B(t) {
44
+ return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
45
+ }
46
+ function kn(t, e) {
47
+ for (; ; ) {
48
+ if (t.nodeType == 3 && e)
49
+ return t;
50
+ if (t.nodeType == 1 && e > 0) {
51
+ if (t.contentEditable == "false")
52
+ return null;
53
+ t = t.childNodes[e - 1], e = B(t);
54
+ } else if (t.parentNode && !Ce(t))
55
+ e = C(t), t = t.parentNode;
56
+ else
57
+ return null;
58
+ }
59
+ }
60
+ function Tn(t, e) {
61
+ for (; ; ) {
62
+ if (t.nodeType == 3 && e < t.nodeValue.length)
63
+ return t;
64
+ if (t.nodeType == 1 && e < t.childNodes.length) {
65
+ if (t.contentEditable == "false")
66
+ return null;
67
+ t = t.childNodes[e], e = 0;
68
+ } else if (t.parentNode && !Ce(t))
69
+ e = C(t) + 1, t = t.parentNode;
70
+ else
71
+ return null;
72
+ }
73
+ }
74
+ function An(t, e, n) {
75
+ for (let o = e == 0, i = e == B(t); o || i; ) {
76
+ if (t == n)
77
+ return !0;
78
+ let s = C(t);
79
+ if (t = t.parentNode, !t)
80
+ return !1;
81
+ o = o && s == 0, i = i && s == B(t);
82
+ }
83
+ }
84
+ function Ce(t) {
85
+ let e;
86
+ for (let n = t; n && !(e = n.pmViewDesc); n = n.parentNode)
87
+ ;
88
+ return e && e.node && e.node.isBlock && (e.dom == t || e.contentDOM == t);
89
+ }
90
+ const Be = function(t) {
91
+ return t.focusNode && se(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset);
92
+ };
93
+ function ee(t, e) {
94
+ let n = document.createEvent("Event");
95
+ return n.initEvent("keydown", !0, !0), n.keyCode = t, n.key = n.code = e, n;
96
+ }
97
+ function En(t) {
98
+ let e = t.activeElement;
99
+ for (; e && e.shadowRoot; )
100
+ e = e.shadowRoot.activeElement;
101
+ return e;
102
+ }
103
+ function Pn(t, e, n) {
104
+ if (t.caretPositionFromPoint)
105
+ try {
106
+ let o = t.caretPositionFromPoint(e, n);
107
+ if (o)
108
+ return { node: o.offsetNode, offset: Math.min(B(o.offsetNode), o.offset) };
109
+ } catch {
110
+ }
111
+ if (t.caretRangeFromPoint) {
112
+ let o = t.caretRangeFromPoint(e, n);
113
+ if (o)
114
+ return { node: o.startContainer, offset: Math.min(B(o.startContainer), o.startOffset) };
115
+ }
116
+ }
117
+ const z = typeof navigator < "u" ? navigator : null, lt = typeof document < "u" ? document : null, le = z && z.userAgent || "", We = /Edge\/(\d+)/.exec(le), Kt = /MSIE \d/.exec(le), _e = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(le), P = !!(Kt || _e || We), Z = Kt ? document.documentMode : _e ? +_e[1] : We ? +We[1] : 0, L = !P && /gecko\/(\d+)/i.test(le), je = !P && /Chrome\/(\d+)/.exec(le), M = !!je, Ht = je ? +je[1] : 0, k = !P && !!z && /Apple Computer/.test(z.vendor), pe = k && (/Mobile\/\w+/.test(le) || !!z && z.maxTouchPoints > 2), R = pe || (z ? /Mac/.test(z.platform) : !1), Vn = z ? /Win/.test(z.platform) : !1, H = /Android \d/.test(le), Oe = !!lt && "webkitFontSmoothing" in lt.documentElement.style, Rn = Oe ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
118
+ function Bn(t) {
119
+ let e = t.defaultView && t.defaultView.visualViewport;
120
+ return e ? {
121
+ left: 0,
122
+ right: e.width,
123
+ top: 0,
124
+ bottom: e.height
125
+ } : {
126
+ left: 0,
127
+ right: t.documentElement.clientWidth,
128
+ top: 0,
129
+ bottom: t.documentElement.clientHeight
130
+ };
131
+ }
132
+ function q(t, e) {
133
+ return typeof t == "number" ? t : t[e];
134
+ }
135
+ function In(t) {
136
+ let e = t.getBoundingClientRect(), n = e.width / t.offsetWidth || 1, o = e.height / t.offsetHeight || 1;
137
+ return {
138
+ left: e.left,
139
+ right: e.left + t.clientWidth * n,
140
+ top: e.top,
141
+ bottom: e.top + t.clientHeight * o
142
+ };
143
+ }
144
+ function at(t, e, n) {
145
+ let o = t.someProp("scrollThreshold") || 0, i = t.someProp("scrollMargin") || 5, s = t.dom.ownerDocument;
146
+ for (let r = n || t.dom; r; ) {
147
+ if (r.nodeType != 1) {
148
+ r = ue(r);
149
+ continue;
150
+ }
151
+ let l = r, a = l == s.body, c = a ? Bn(s) : In(l), d = 0, f = 0;
152
+ if (e.top < c.top + q(o, "top") ? f = -(c.top - e.top + q(i, "top")) : e.bottom > c.bottom - q(o, "bottom") && (f = e.bottom - e.top > c.bottom - c.top ? e.top + q(i, "top") - c.top : e.bottom - c.bottom + q(i, "bottom")), e.left < c.left + q(o, "left") ? d = -(c.left - e.left + q(i, "left")) : e.right > c.right - q(o, "right") && (d = e.right - c.right + q(i, "right")), d || f)
153
+ if (a)
154
+ s.defaultView.scrollBy(d, f);
155
+ else {
156
+ let p = l.scrollLeft, h = l.scrollTop;
157
+ f && (l.scrollTop += f), d && (l.scrollLeft += d);
158
+ let g = l.scrollLeft - p, m = l.scrollTop - h;
159
+ e = { left: e.left - g, top: e.top - m, right: e.right - g, bottom: e.bottom - m };
160
+ }
161
+ let u = a ? "fixed" : getComputedStyle(r).position;
162
+ if (/^(fixed|sticky)$/.test(u))
163
+ break;
164
+ r = u == "absolute" ? r.offsetParent : ue(r);
165
+ }
166
+ }
167
+ function Fn(t) {
168
+ let e = t.dom.getBoundingClientRect(), n = Math.max(0, e.top), o, i;
169
+ for (let s = (e.left + e.right) / 2, r = n + 1; r < Math.min(innerHeight, e.bottom); r += 5) {
170
+ let l = t.root.elementFromPoint(s, r);
171
+ if (!l || l == t.dom || !t.dom.contains(l))
172
+ continue;
173
+ let a = l.getBoundingClientRect();
174
+ if (a.top >= n - 20) {
175
+ o = l, i = a.top;
176
+ break;
177
+ }
178
+ }
179
+ return { refDOM: o, refTop: i, stack: Wt(t.dom) };
180
+ }
181
+ function Wt(t) {
182
+ let e = [], n = t.ownerDocument;
183
+ for (let o = t; o && (e.push({ dom: o, top: o.scrollTop, left: o.scrollLeft }), t != n); o = ue(o))
184
+ ;
185
+ return e;
186
+ }
187
+ function zn({ refDOM: t, refTop: e, stack: n }) {
188
+ let o = t ? t.getBoundingClientRect().top : 0;
189
+ _t(n, o == 0 ? 0 : o - e);
190
+ }
191
+ function _t(t, e) {
192
+ for (let n = 0; n < t.length; n++) {
193
+ let { dom: o, top: i, left: s } = t[n];
194
+ o.scrollTop != i + e && (o.scrollTop = i + e), o.scrollLeft != s && (o.scrollLeft = s);
195
+ }
196
+ }
197
+ let ae = null;
198
+ function Ln(t) {
199
+ if (t.setActive)
200
+ return t.setActive();
201
+ if (ae)
202
+ return t.focus(ae);
203
+ let e = Wt(t);
204
+ t.focus(ae == null ? {
205
+ get preventScroll() {
206
+ return ae = { preventScroll: !0 }, !0;
207
+ }
208
+ } : void 0), ae || (ae = !1, _t(e, 0));
209
+ }
210
+ function jt(t, e) {
211
+ let n, o = 2e8, i, s = 0, r = e.top, l = e.top, a, c;
212
+ for (let d = t.firstChild, f = 0; d; d = d.nextSibling, f++) {
213
+ let u;
214
+ if (d.nodeType == 1)
215
+ u = d.getClientRects();
216
+ else if (d.nodeType == 3)
217
+ u = K(d).getClientRects();
218
+ else
219
+ continue;
220
+ for (let p = 0; p < u.length; p++) {
221
+ let h = u[p];
222
+ if (h.top <= r && h.bottom >= l) {
223
+ r = Math.max(h.bottom, r), l = Math.min(h.top, l);
224
+ let g = h.left > e.left ? h.left - e.left : h.right < e.left ? e.left - h.right : 0;
225
+ if (g < o) {
226
+ n = d, o = g, i = g && n.nodeType == 3 ? {
227
+ left: h.right < e.left ? h.right : h.left,
228
+ top: e.top
229
+ } : e, d.nodeType == 1 && g && (s = f + (e.left >= (h.left + h.right) / 2 ? 1 : 0));
230
+ continue;
231
+ }
232
+ } else h.top > e.top && !a && h.left <= e.left && h.right >= e.left && (a = d, c = { left: Math.max(h.left, Math.min(h.right, e.left)), top: h.top });
233
+ !n && (e.left >= h.right && e.top >= h.top || e.left >= h.left && e.top >= h.bottom) && (s = f + 1);
234
+ }
235
+ }
236
+ return !n && a && (n = a, i = c, o = 0), n && n.nodeType == 3 ? $n(n, i) : !n || o && n.nodeType == 1 ? { node: t, offset: s } : jt(n, i);
237
+ }
238
+ function $n(t, e) {
239
+ let n = t.nodeValue.length, o = document.createRange();
240
+ for (let i = 0; i < n; i++) {
241
+ o.setEnd(t, i + 1), o.setStart(t, i);
242
+ let s = U(o, 1);
243
+ if (s.top != s.bottom && Qe(e, s))
244
+ return { node: t, offset: i + (e.left >= (s.left + s.right) / 2 ? 1 : 0) };
245
+ }
246
+ return { node: t, offset: 0 };
247
+ }
248
+ function Qe(t, e) {
249
+ return t.left >= e.left - 1 && t.left <= e.right + 1 && t.top >= e.top - 1 && t.top <= e.bottom + 1;
250
+ }
251
+ function qn(t, e) {
252
+ let n = t.parentNode;
253
+ return n && /^li$/i.test(n.nodeName) && e.left < t.getBoundingClientRect().left ? n : t;
254
+ }
255
+ function Kn(t, e, n) {
256
+ let { node: o, offset: i } = jt(e, n), s = -1;
257
+ if (o.nodeType == 1 && !o.firstChild) {
258
+ let r = o.getBoundingClientRect();
259
+ s = r.left != r.right && n.left > (r.left + r.right) / 2 ? 1 : -1;
260
+ }
261
+ return t.docView.posFromDOM(o, i, s);
262
+ }
263
+ function Hn(t, e, n, o) {
264
+ let i = -1;
265
+ for (let s = e, r = !1; s != t.dom; ) {
266
+ let l = t.docView.nearestDesc(s, !0), a;
267
+ if (!l)
268
+ return null;
269
+ if (l.dom.nodeType == 1 && (l.node.isBlock && l.parent || !l.contentDOM) && // Ignore elements with zero-size bounding rectangles
270
+ ((a = l.dom.getBoundingClientRect()).width || a.height) && (l.node.isBlock && l.parent && (!r && a.left > o.left || a.top > o.top ? i = l.posBefore : (!r && a.right < o.left || a.bottom < o.top) && (i = l.posAfter), r = !0), !l.contentDOM && i < 0 && !l.node.isText))
271
+ return (l.node.isBlock ? o.top < (a.top + a.bottom) / 2 : o.left < (a.left + a.right) / 2) ? l.posBefore : l.posAfter;
272
+ s = l.dom.parentNode;
273
+ }
274
+ return i > -1 ? i : t.docView.posFromDOM(e, n, -1);
275
+ }
276
+ function Ut(t, e, n) {
277
+ let o = t.childNodes.length;
278
+ if (o && n.top < n.bottom)
279
+ for (let i = Math.max(0, Math.min(o - 1, Math.floor(o * (e.top - n.top) / (n.bottom - n.top)) - 2)), s = i; ; ) {
280
+ let r = t.childNodes[s];
281
+ if (r.nodeType == 1) {
282
+ let l = r.getClientRects();
283
+ for (let a = 0; a < l.length; a++) {
284
+ let c = l[a];
285
+ if (Qe(e, c))
286
+ return Ut(r, e, c);
287
+ }
288
+ }
289
+ if ((s = (s + 1) % o) == i)
290
+ break;
291
+ }
292
+ return t;
293
+ }
294
+ function Wn(t, e) {
295
+ let n = t.dom.ownerDocument, o, i = 0, s = Pn(n, e.left, e.top);
296
+ s && ({ node: o, offset: i } = s);
297
+ let r = (t.root.elementFromPoint ? t.root : n).elementFromPoint(e.left, e.top), l;
298
+ if (!r || !t.dom.contains(r.nodeType != 1 ? r.parentNode : r)) {
299
+ let c = t.dom.getBoundingClientRect();
300
+ if (!Qe(e, c) || (r = Ut(t.dom, e, c), !r))
301
+ return null;
302
+ }
303
+ if (k)
304
+ for (let c = r; o && c; c = ue(c))
305
+ c.draggable && (o = void 0);
306
+ if (r = qn(r, e), o) {
307
+ if (L && o.nodeType == 1 && (i = Math.min(i, o.childNodes.length), i < o.childNodes.length)) {
308
+ let d = o.childNodes[i], f;
309
+ d.nodeName == "IMG" && (f = d.getBoundingClientRect()).right <= e.left && f.bottom > e.top && i++;
310
+ }
311
+ let c;
312
+ Oe && i && o.nodeType == 1 && (c = o.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, o == t.dom && i == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = t.state.doc.content.size : (i == 0 || o.nodeType != 1 || o.childNodes[i - 1].nodeName != "BR") && (l = Hn(t, o, i, e));
313
+ }
314
+ l == null && (l = Kn(t, r, e));
315
+ let a = t.docView.nearestDesc(r, !0);
316
+ return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
317
+ }
318
+ function ct(t) {
319
+ return t.top < t.bottom || t.left < t.right;
320
+ }
321
+ function U(t, e) {
322
+ let n = t.getClientRects();
323
+ if (n.length) {
324
+ let o = n[e < 0 ? 0 : n.length - 1];
325
+ if (ct(o))
326
+ return o;
327
+ }
328
+ return Array.prototype.find.call(n, ct) || t.getBoundingClientRect();
329
+ }
330
+ const _n = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
331
+ function Yt(t, e, n) {
332
+ let { node: o, offset: i, atom: s } = t.docView.domFromPos(e, n < 0 ? -1 : 1), r = Oe || L;
333
+ if (o.nodeType == 3)
334
+ if (r && (_n.test(o.nodeValue) || (n < 0 ? !i : i == o.nodeValue.length))) {
335
+ let a = U(K(o, i, i), n);
336
+ if (L && i && /\s/.test(o.nodeValue[i - 1]) && i < o.nodeValue.length) {
337
+ let c = U(K(o, i - 1, i - 1), -1);
338
+ if (c.top == a.top) {
339
+ let d = U(K(o, i, i + 1), -1);
340
+ if (d.top != a.top)
341
+ return ge(d, d.left < c.left);
342
+ }
343
+ }
344
+ return a;
345
+ } else {
346
+ let a = i, c = i, d = n < 0 ? 1 : -1;
347
+ return n < 0 && !i ? (c++, d = -1) : n >= 0 && i == o.nodeValue.length ? (a--, d = 1) : n < 0 ? a-- : c++, ge(U(K(o, a, c), d), d < 0);
348
+ }
349
+ if (!t.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
350
+ if (s == null && i && (n < 0 || i == B(o))) {
351
+ let a = o.childNodes[i - 1];
352
+ if (a.nodeType == 1)
353
+ return ze(a.getBoundingClientRect(), !1);
354
+ }
355
+ if (s == null && i < B(o)) {
356
+ let a = o.childNodes[i];
357
+ if (a.nodeType == 1)
358
+ return ze(a.getBoundingClientRect(), !0);
359
+ }
360
+ return ze(o.getBoundingClientRect(), n >= 0);
361
+ }
362
+ if (s == null && i && (n < 0 || i == B(o))) {
363
+ let a = o.childNodes[i - 1], c = a.nodeType == 3 ? K(a, B(a) - (r ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
364
+ if (c)
365
+ return ge(U(c, 1), !1);
366
+ }
367
+ if (s == null && i < B(o)) {
368
+ let a = o.childNodes[i];
369
+ for (; a.pmViewDesc && a.pmViewDesc.ignoreForCoords; )
370
+ a = a.nextSibling;
371
+ let c = a ? a.nodeType == 3 ? K(a, 0, r ? 0 : 1) : a.nodeType == 1 ? a : null : null;
372
+ if (c)
373
+ return ge(U(c, -1), !0);
374
+ }
375
+ return ge(U(o.nodeType == 3 ? K(o) : o, -n), n >= 0);
376
+ }
377
+ function ge(t, e) {
378
+ if (t.width == 0)
379
+ return t;
380
+ let n = e ? t.left : t.right;
381
+ return { top: t.top, bottom: t.bottom, left: n, right: n };
382
+ }
383
+ function ze(t, e) {
384
+ if (t.height == 0)
385
+ return t;
386
+ let n = e ? t.top : t.bottom;
387
+ return { top: n, bottom: n, left: t.left, right: t.right };
388
+ }
389
+ function Gt(t, e, n) {
390
+ let o = t.state, i = t.root.activeElement;
391
+ o != e && t.updateState(e), i != t.dom && t.focus();
392
+ try {
393
+ return n();
394
+ } finally {
395
+ o != e && t.updateState(o), i != t.dom && i && i.focus();
396
+ }
397
+ }
398
+ function jn(t, e, n) {
399
+ let o = e.selection, i = n == "up" ? o.$from : o.$to;
400
+ return Gt(t, e, () => {
401
+ let { node: s } = t.docView.domFromPos(i.pos, n == "up" ? -1 : 1);
402
+ for (; ; ) {
403
+ let l = t.docView.nearestDesc(s, !0);
404
+ if (!l)
405
+ break;
406
+ if (l.node.isBlock) {
407
+ s = l.contentDOM || l.dom;
408
+ break;
409
+ }
410
+ s = l.dom.parentNode;
411
+ }
412
+ let r = Yt(t, i.pos, 1);
413
+ for (let l = s.firstChild; l; l = l.nextSibling) {
414
+ let a;
415
+ if (l.nodeType == 1)
416
+ a = l.getClientRects();
417
+ else if (l.nodeType == 3)
418
+ a = K(l, 0, l.nodeValue.length).getClientRects();
419
+ else
420
+ continue;
421
+ for (let c = 0; c < a.length; c++) {
422
+ let d = a[c];
423
+ if (d.bottom > d.top + 1 && (n == "up" ? r.top - d.top > (d.bottom - r.top) * 2 : d.bottom - r.bottom > (r.bottom - d.top) * 2))
424
+ return !1;
425
+ }
426
+ }
427
+ return !0;
428
+ });
429
+ }
430
+ const Un = /[\u0590-\u08ac]/;
431
+ function Yn(t, e, n) {
432
+ let { $head: o } = e.selection;
433
+ if (!o.parent.isTextblock)
434
+ return !1;
435
+ let i = o.parentOffset, s = !i, r = i == o.parent.content.size, l = t.domSelection();
436
+ return l ? !Un.test(o.parent.textContent) || !l.modify ? n == "left" || n == "backward" ? s : r : Gt(t, e, () => {
437
+ let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: f } = t.domSelectionRange(), u = l.caretBidiLevel;
438
+ l.modify("move", n, "character");
439
+ let p = o.depth ? t.docView.domAfterPos(o.before()) : t.dom, { focusNode: h, focusOffset: g } = t.domSelectionRange(), m = h && !p.contains(h.nodeType == 1 ? h : h.parentNode) || a == h && c == g;
440
+ try {
441
+ l.collapse(d, f), a && (a != d || c != f) && l.extend && l.extend(a, c);
442
+ } catch {
443
+ }
444
+ return u != null && (l.caretBidiLevel = u), m;
445
+ }) : o.pos == o.start() || o.pos == o.end();
446
+ }
447
+ let dt = null, ft = null, ht = !1;
448
+ function Gn(t, e, n) {
449
+ return dt == e && ft == n ? ht : (dt = e, ft = n, ht = n == "up" || n == "down" ? jn(t, e, n) : Yn(t, e, n));
450
+ }
451
+ const I = 0, ut = 1, te = 2, $ = 3;
452
+ class Me {
453
+ constructor(e, n, o, i) {
454
+ this.parent = e, this.children = n, this.dom = o, this.contentDOM = i, this.dirty = I, o.pmViewDesc = this;
455
+ }
456
+ // Used to check whether a given description corresponds to a
457
+ // widget/mark/node.
458
+ matchesWidget(e) {
459
+ return !1;
460
+ }
461
+ matchesMark(e) {
462
+ return !1;
463
+ }
464
+ matchesNode(e, n, o) {
465
+ return !1;
466
+ }
467
+ matchesHack(e) {
468
+ return !1;
469
+ }
470
+ // When parsing in-editor content (in domchange.js), we allow
471
+ // descriptions to determine the parse rules that should be used to
472
+ // parse them.
473
+ parseRule() {
474
+ return null;
475
+ }
476
+ // Used by the editor's event handler to ignore events that come
477
+ // from certain descs.
478
+ stopEvent(e) {
479
+ return !1;
480
+ }
481
+ // The size of the content represented by this desc.
482
+ get size() {
483
+ let e = 0;
484
+ for (let n = 0; n < this.children.length; n++)
485
+ e += this.children[n].size;
486
+ return e;
487
+ }
488
+ // For block nodes, this represents the space taken up by their
489
+ // start/end tokens.
490
+ get border() {
491
+ return 0;
492
+ }
493
+ destroy() {
494
+ this.parent = void 0, this.dom.pmViewDesc == this && (this.dom.pmViewDesc = void 0);
495
+ for (let e = 0; e < this.children.length; e++)
496
+ this.children[e].destroy();
497
+ }
498
+ posBeforeChild(e) {
499
+ for (let n = 0, o = this.posAtStart; ; n++) {
500
+ let i = this.children[n];
501
+ if (i == e)
502
+ return o;
503
+ o += i.size;
504
+ }
505
+ }
506
+ get posBefore() {
507
+ return this.parent.posBeforeChild(this);
508
+ }
509
+ get posAtStart() {
510
+ return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;
511
+ }
512
+ get posAfter() {
513
+ return this.posBefore + this.size;
514
+ }
515
+ get posAtEnd() {
516
+ return this.posAtStart + this.size - 2 * this.border;
517
+ }
518
+ localPosFromDOM(e, n, o) {
519
+ if (this.contentDOM && this.contentDOM.contains(e.nodeType == 1 ? e : e.parentNode))
520
+ if (o < 0) {
521
+ let s, r;
522
+ if (e == this.contentDOM)
523
+ s = e.childNodes[n - 1];
524
+ else {
525
+ for (; e.parentNode != this.contentDOM; )
526
+ e = e.parentNode;
527
+ s = e.previousSibling;
528
+ }
529
+ for (; s && !((r = s.pmViewDesc) && r.parent == this); )
530
+ s = s.previousSibling;
531
+ return s ? this.posBeforeChild(r) + r.size : this.posAtStart;
532
+ } else {
533
+ let s, r;
534
+ if (e == this.contentDOM)
535
+ s = e.childNodes[n];
536
+ else {
537
+ for (; e.parentNode != this.contentDOM; )
538
+ e = e.parentNode;
539
+ s = e.nextSibling;
540
+ }
541
+ for (; s && !((r = s.pmViewDesc) && r.parent == this); )
542
+ s = s.nextSibling;
543
+ return s ? this.posBeforeChild(r) : this.posAtEnd;
544
+ }
545
+ let i;
546
+ if (e == this.dom && this.contentDOM)
547
+ i = n > C(this.contentDOM);
548
+ else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
549
+ i = e.compareDocumentPosition(this.contentDOM) & 2;
550
+ else if (this.dom.firstChild) {
551
+ if (n == 0)
552
+ for (let s = e; ; s = s.parentNode) {
553
+ if (s == this.dom) {
554
+ i = !1;
555
+ break;
556
+ }
557
+ if (s.previousSibling)
558
+ break;
559
+ }
560
+ if (i == null && n == e.childNodes.length)
561
+ for (let s = e; ; s = s.parentNode) {
562
+ if (s == this.dom) {
563
+ i = !0;
564
+ break;
565
+ }
566
+ if (s.nextSibling)
567
+ break;
568
+ }
569
+ }
570
+ return i ?? o > 0 ? this.posAtEnd : this.posAtStart;
571
+ }
572
+ nearestDesc(e, n = !1) {
573
+ for (let o = !0, i = e; i; i = i.parentNode) {
574
+ let s = this.getDesc(i), r;
575
+ if (s && (!n || s.node))
576
+ if (o && (r = s.nodeDOM) && !(r.nodeType == 1 ? r.contains(e.nodeType == 1 ? e : e.parentNode) : r == e))
577
+ o = !1;
578
+ else
579
+ return s;
580
+ }
581
+ }
582
+ getDesc(e) {
583
+ let n = e.pmViewDesc;
584
+ for (let o = n; o; o = o.parent)
585
+ if (o == this)
586
+ return n;
587
+ }
588
+ posFromDOM(e, n, o) {
589
+ for (let i = e; i; i = i.parentNode) {
590
+ let s = this.getDesc(i);
591
+ if (s)
592
+ return s.localPosFromDOM(e, n, o);
593
+ }
594
+ return -1;
595
+ }
596
+ // Find the desc for the node after the given pos, if any. (When a
597
+ // parent node overrode rendering, there might not be one.)
598
+ descAt(e) {
599
+ for (let n = 0, o = 0; n < this.children.length; n++) {
600
+ let i = this.children[n], s = o + i.size;
601
+ if (o == e && s != o) {
602
+ for (; !i.border && i.children.length; )
603
+ for (let r = 0; r < i.children.length; r++) {
604
+ let l = i.children[r];
605
+ if (l.size) {
606
+ i = l;
607
+ break;
608
+ }
609
+ }
610
+ return i;
611
+ }
612
+ if (e < s)
613
+ return i.descAt(e - o - i.border);
614
+ o = s;
615
+ }
616
+ }
617
+ domFromPos(e, n) {
618
+ if (!this.contentDOM)
619
+ return { node: this.dom, offset: 0, atom: e + 1 };
620
+ let o = 0, i = 0;
621
+ for (let s = 0; o < this.children.length; o++) {
622
+ let r = this.children[o], l = s + r.size;
623
+ if (l > e || r instanceof Jt) {
624
+ i = e - s;
625
+ break;
626
+ }
627
+ s = l;
628
+ }
629
+ if (i)
630
+ return this.children[o].domFromPos(i - this.children[o].border, n);
631
+ for (let s; o && !(s = this.children[o - 1]).size && s instanceof Xt && s.side >= 0; o--)
632
+ ;
633
+ if (n <= 0) {
634
+ let s, r = !0;
635
+ for (; s = o ? this.children[o - 1] : null, !(!s || s.dom.parentNode == this.contentDOM); o--, r = !1)
636
+ ;
637
+ return s && n && r && !s.border && !s.domAtom ? s.domFromPos(s.size, n) : { node: this.contentDOM, offset: s ? C(s.dom) + 1 : 0 };
638
+ } else {
639
+ let s, r = !0;
640
+ for (; s = o < this.children.length ? this.children[o] : null, !(!s || s.dom.parentNode == this.contentDOM); o++, r = !1)
641
+ ;
642
+ return s && r && !s.border && !s.domAtom ? s.domFromPos(0, n) : { node: this.contentDOM, offset: s ? C(s.dom) : this.contentDOM.childNodes.length };
643
+ }
644
+ }
645
+ // Used to find a DOM range in a single parent for a given changed
646
+ // range.
647
+ parseRange(e, n, o = 0) {
648
+ if (this.children.length == 0)
649
+ return { node: this.contentDOM, from: e, to: n, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };
650
+ let i = -1, s = -1;
651
+ for (let r = o, l = 0; ; l++) {
652
+ let a = this.children[l], c = r + a.size;
653
+ if (i == -1 && e <= c) {
654
+ let d = r + a.border;
655
+ if (e >= d && n <= c - a.border && a.node && a.contentDOM && this.contentDOM.contains(a.contentDOM))
656
+ return a.parseRange(e, n, d);
657
+ e = r;
658
+ for (let f = l; f > 0; f--) {
659
+ let u = this.children[f - 1];
660
+ if (u.size && u.dom.parentNode == this.contentDOM && !u.emptyChildAt(1)) {
661
+ i = C(u.dom) + 1;
662
+ break;
663
+ }
664
+ e -= u.size;
665
+ }
666
+ i == -1 && (i = 0);
667
+ }
668
+ if (i > -1 && (c > n || l == this.children.length - 1)) {
669
+ n = c;
670
+ for (let d = l + 1; d < this.children.length; d++) {
671
+ let f = this.children[d];
672
+ if (f.size && f.dom.parentNode == this.contentDOM && !f.emptyChildAt(-1)) {
673
+ s = C(f.dom);
674
+ break;
675
+ }
676
+ n += f.size;
677
+ }
678
+ s == -1 && (s = this.contentDOM.childNodes.length);
679
+ break;
680
+ }
681
+ r = c;
682
+ }
683
+ return { node: this.contentDOM, from: e, to: n, fromOffset: i, toOffset: s };
684
+ }
685
+ emptyChildAt(e) {
686
+ if (this.border || !this.contentDOM || !this.children.length)
687
+ return !1;
688
+ let n = this.children[e < 0 ? 0 : this.children.length - 1];
689
+ return n.size == 0 || n.emptyChildAt(e);
690
+ }
691
+ domAfterPos(e) {
692
+ let { node: n, offset: o } = this.domFromPos(e, 0);
693
+ if (n.nodeType != 1 || o == n.childNodes.length)
694
+ throw new RangeError("No node after pos " + e);
695
+ return n.childNodes[o];
696
+ }
697
+ // View descs are responsible for setting any selection that falls
698
+ // entirely inside of them, so that custom implementations can do
699
+ // custom things with the selection. Note that this falls apart when
700
+ // a selection starts in such a node and ends in another, in which
701
+ // case we just use whatever domFromPos produces as a best effort.
702
+ setSelection(e, n, o, i = !1) {
703
+ let s = Math.min(e, n), r = Math.max(e, n);
704
+ for (let p = 0, h = 0; p < this.children.length; p++) {
705
+ let g = this.children[p], m = h + g.size;
706
+ if (s > h && r < m)
707
+ return g.setSelection(e - h - g.border, n - h - g.border, o, i);
708
+ h = m;
709
+ }
710
+ let l = this.domFromPos(e, e ? -1 : 1), a = n == e ? l : this.domFromPos(n, n ? -1 : 1), c = o.root.getSelection(), d = o.domSelectionRange(), f = !1;
711
+ if ((L || k) && e == n) {
712
+ let { node: p, offset: h } = l;
713
+ if (p.nodeType == 3) {
714
+ if (f = !!(h && p.nodeValue[h - 1] == `
715
+ `), f && h == p.nodeValue.length)
716
+ for (let g = p, m; g; g = g.parentNode) {
717
+ if (m = g.nextSibling) {
718
+ m.nodeName == "BR" && (l = a = { node: m.parentNode, offset: C(m) + 1 });
719
+ break;
720
+ }
721
+ let y = g.pmViewDesc;
722
+ if (y && y.node && y.node.isBlock)
723
+ break;
724
+ }
725
+ } else {
726
+ let g = p.childNodes[h - 1];
727
+ f = g && (g.nodeName == "BR" || g.contentEditable == "false");
728
+ }
729
+ }
730
+ if (L && d.focusNode && d.focusNode != a.node && d.focusNode.nodeType == 1) {
731
+ let p = d.focusNode.childNodes[d.focusOffset];
732
+ p && p.contentEditable == "false" && (i = !0);
733
+ }
734
+ if (!(i || f && k) && se(l.node, l.offset, d.anchorNode, d.anchorOffset) && se(a.node, a.offset, d.focusNode, d.focusOffset))
735
+ return;
736
+ let u = !1;
737
+ if ((c.extend || e == n) && !f) {
738
+ c.collapse(l.node, l.offset);
739
+ try {
740
+ e != n && c.extend(a.node, a.offset), u = !0;
741
+ } catch {
742
+ }
743
+ }
744
+ if (!u) {
745
+ if (e > n) {
746
+ let h = l;
747
+ l = a, a = h;
748
+ }
749
+ let p = document.createRange();
750
+ p.setEnd(a.node, a.offset), p.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(p);
751
+ }
752
+ }
753
+ ignoreMutation(e) {
754
+ return !this.contentDOM && e.type != "selection";
755
+ }
756
+ get contentLost() {
757
+ return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);
758
+ }
759
+ // Remove a subtree of the element tree that has been touched
760
+ // by a DOM change, so that the next update will redraw it.
761
+ markDirty(e, n) {
762
+ for (let o = 0, i = 0; i < this.children.length; i++) {
763
+ let s = this.children[i], r = o + s.size;
764
+ if (o == r ? e <= r && n >= o : e < r && n > o) {
765
+ let l = o + s.border, a = r - s.border;
766
+ if (e >= l && n <= a) {
767
+ this.dirty = e == o || n == r ? te : ut, e == l && n == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = $ : s.markDirty(e - l, n - l);
768
+ return;
769
+ } else
770
+ s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? te : $;
771
+ }
772
+ o = r;
773
+ }
774
+ this.dirty = te;
775
+ }
776
+ markParentsDirty() {
777
+ let e = 1;
778
+ for (let n = this.parent; n; n = n.parent, e++) {
779
+ let o = e == 1 ? te : ut;
780
+ n.dirty < o && (n.dirty = o);
781
+ }
782
+ }
783
+ get domAtom() {
784
+ return !1;
785
+ }
786
+ get ignoreForCoords() {
787
+ return !1;
788
+ }
789
+ get ignoreForSelection() {
790
+ return !1;
791
+ }
792
+ isText(e) {
793
+ return !1;
794
+ }
795
+ }
796
+ class Xt extends Me {
797
+ constructor(e, n, o, i) {
798
+ let s, r = n.type.toDOM;
799
+ if (typeof r == "function" && (r = r(o, () => {
800
+ if (!s)
801
+ return i;
802
+ if (s.parent)
803
+ return s.parent.posBeforeChild(s);
804
+ })), !n.type.spec.raw) {
805
+ if (r.nodeType != 1) {
806
+ let l = document.createElement("span");
807
+ l.appendChild(r), r = l;
808
+ }
809
+ r.contentEditable = "false", r.classList.add("ProseMirror-widget");
810
+ }
811
+ super(e, [], r, null), this.widget = n, this.widget = n, s = this;
812
+ }
813
+ matchesWidget(e) {
814
+ return this.dirty == I && e.type.eq(this.widget.type);
815
+ }
816
+ parseRule() {
817
+ return { ignore: !0 };
818
+ }
819
+ stopEvent(e) {
820
+ let n = this.widget.spec.stopEvent;
821
+ return n ? n(e) : !1;
822
+ }
823
+ ignoreMutation(e) {
824
+ return e.type != "selection" || this.widget.spec.ignoreSelection;
825
+ }
826
+ destroy() {
827
+ this.widget.type.destroy(this.dom), super.destroy();
828
+ }
829
+ get domAtom() {
830
+ return !0;
831
+ }
832
+ get ignoreForSelection() {
833
+ return !!this.widget.type.spec.relaxedSide;
834
+ }
835
+ get side() {
836
+ return this.widget.type.side;
837
+ }
838
+ }
839
+ class Xn extends Me {
840
+ constructor(e, n, o, i) {
841
+ super(e, [], n, null), this.textDOM = o, this.text = i;
842
+ }
843
+ get size() {
844
+ return this.text.length;
845
+ }
846
+ localPosFromDOM(e, n) {
847
+ return e != this.textDOM ? this.posAtStart + (n ? this.size : 0) : this.posAtStart + n;
848
+ }
849
+ domFromPos(e) {
850
+ return { node: this.textDOM, offset: e };
851
+ }
852
+ ignoreMutation(e) {
853
+ return e.type === "characterData" && e.target.nodeValue == e.oldValue;
854
+ }
855
+ }
856
+ class re extends Me {
857
+ constructor(e, n, o, i, s) {
858
+ super(e, [], o, i), this.mark = n, this.spec = s;
859
+ }
860
+ static create(e, n, o, i) {
861
+ let s = i.nodeViews[n.type.name], r = s && s(n, i, o);
862
+ return (!r || !r.dom) && (r = Re.renderSpec(document, n.type.spec.toDOM(n, o), null, n.attrs)), new re(e, n, r.dom, r.contentDOM || r.dom, r);
863
+ }
864
+ parseRule() {
865
+ return this.dirty & $ || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
866
+ }
867
+ matchesMark(e) {
868
+ return this.dirty != $ && this.mark.eq(e);
869
+ }
870
+ markDirty(e, n) {
871
+ if (super.markDirty(e, n), this.dirty != I) {
872
+ let o = this.parent;
873
+ for (; !o.node; )
874
+ o = o.parent;
875
+ o.dirty < this.dirty && (o.dirty = this.dirty), this.dirty = I;
876
+ }
877
+ }
878
+ slice(e, n, o) {
879
+ let i = re.create(this.parent, this.mark, !0, o), s = this.children, r = this.size;
880
+ n < r && (s = Ye(s, n, r, o)), e > 0 && (s = Ye(s, 0, e, o));
881
+ for (let l = 0; l < s.length; l++)
882
+ s[l].parent = i;
883
+ return i.children = s, i;
884
+ }
885
+ ignoreMutation(e) {
886
+ return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
887
+ }
888
+ destroy() {
889
+ this.spec.destroy && this.spec.destroy(), super.destroy();
890
+ }
891
+ }
892
+ class Q extends Me {
893
+ constructor(e, n, o, i, s, r, l, a, c) {
894
+ super(e, [], s, r), this.node = n, this.outerDeco = o, this.innerDeco = i, this.nodeDOM = l;
895
+ }
896
+ // By default, a node is rendered using the `toDOM` method from the
897
+ // node type spec. But client code can use the `nodeViews` spec to
898
+ // supply a custom node view, which can influence various aspects of
899
+ // the way the node works.
900
+ //
901
+ // (Using subclassing for this was intentionally decided against,
902
+ // since it'd require exposing a whole slew of finicky
903
+ // implementation details to the user code that they probably will
904
+ // never need.)
905
+ static create(e, n, o, i, s, r) {
906
+ let l = s.nodeViews[n.type.name], a, c = l && l(n, s, () => {
907
+ if (!a)
908
+ return r;
909
+ if (a.parent)
910
+ return a.parent.posBeforeChild(a);
911
+ }, o, i), d = c && c.dom, f = c && c.contentDOM;
912
+ if (n.isText) {
913
+ if (!d)
914
+ d = document.createTextNode(n.text);
915
+ else if (d.nodeType != 3)
916
+ throw new RangeError("Text must be rendered as a DOM text node");
917
+ } else d || ({ dom: d, contentDOM: f } = Re.renderSpec(document, n.type.spec.toDOM(n), null, n.attrs));
918
+ !f && !n.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), n.type.spec.draggable && (d.draggable = !0));
919
+ let u = d;
920
+ return d = wt(d, o, n), c ? a = new Jn(e, n, o, i, d, f || null, u, c, s, r + 1) : n.isText ? new Ie(e, n, o, i, d, u, s) : new Q(e, n, o, i, d, f || null, u, s, r + 1);
921
+ }
922
+ parseRule() {
923
+ if (this.node.type.spec.reparseInView)
924
+ return null;
925
+ let e = { node: this.node.type.name, attrs: this.node.attrs };
926
+ if (this.node.type.whitespace == "pre" && (e.preserveWhitespace = "full"), !this.contentDOM)
927
+ e.getContent = () => this.node.content;
928
+ else if (!this.contentLost)
929
+ e.contentElement = this.contentDOM;
930
+ else {
931
+ for (let n = this.children.length - 1; n >= 0; n--) {
932
+ let o = this.children[n];
933
+ if (this.dom.contains(o.dom.parentNode)) {
934
+ e.contentElement = o.dom.parentNode;
935
+ break;
936
+ }
937
+ }
938
+ e.contentElement || (e.getContent = () => _.empty);
939
+ }
940
+ return e;
941
+ }
942
+ matchesNode(e, n, o) {
943
+ return this.dirty == I && e.eq(this.node) && Te(n, this.outerDeco) && o.eq(this.innerDeco);
944
+ }
945
+ get size() {
946
+ return this.node.nodeSize;
947
+ }
948
+ get border() {
949
+ return this.node.isLeaf ? 0 : 1;
950
+ }
951
+ // Syncs `this.children` to match `this.node.content` and the local
952
+ // decorations, possibly introducing nesting for marks. Then, in a
953
+ // separate step, syncs the DOM inside `this.contentDOM` to
954
+ // `this.children`.
955
+ updateChildren(e, n) {
956
+ let o = this.node.inlineContent, i = n, s = e.composing ? this.localCompositionInfo(e, n) : null, r = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Qn(this, r && r.node, e);
957
+ eo(this.node, this.innerDeco, (c, d, f) => {
958
+ c.spec.marks ? a.syncToMarks(c.spec.marks, o, e) : c.type.side >= 0 && !f && a.syncToMarks(d == this.node.childCount ? Cn.none : this.node.child(d).marks, o, e), a.placeWidget(c, e, i);
959
+ }, (c, d, f, u) => {
960
+ a.syncToMarks(c.marks, o, e);
961
+ let p;
962
+ a.findNodeMatch(c, d, f, u) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (p = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, f, p, e) || a.updateNextNode(c, d, f, e, u, i) || a.addNode(c, d, f, e, i), i += c.nodeSize;
963
+ }), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == te) && (r && this.protectLocalComposition(e, r), Zt(this.contentDOM, this.children, e), pe && to(this.dom));
964
+ }
965
+ localCompositionInfo(e, n) {
966
+ let { from: o, to: i } = e.state.selection;
967
+ if (!(e.state.selection instanceof x) || o < n || i > n + this.node.content.size)
968
+ return null;
969
+ let s = e.input.compositionNode;
970
+ if (!s || !this.dom.contains(s.parentNode))
971
+ return null;
972
+ if (this.node.inlineContent) {
973
+ let r = s.nodeValue, l = no(this.node.content, r, o - n, i - n);
974
+ return l < 0 ? null : { node: s, pos: l, text: r };
975
+ } else
976
+ return { node: s, pos: -1, text: "" };
977
+ }
978
+ protectLocalComposition(e, { node: n, pos: o, text: i }) {
979
+ if (this.getDesc(n))
980
+ return;
981
+ let s = n;
982
+ for (; s.parentNode != this.contentDOM; s = s.parentNode) {
983
+ for (; s.previousSibling; )
984
+ s.parentNode.removeChild(s.previousSibling);
985
+ for (; s.nextSibling; )
986
+ s.parentNode.removeChild(s.nextSibling);
987
+ s.pmViewDesc && (s.pmViewDesc = void 0);
988
+ }
989
+ let r = new Xn(this, s, n, i);
990
+ e.input.compositionNodes.push(r), this.children = Ye(this.children, o, o + i.length, e, r);
991
+ }
992
+ // If this desc must be updated to match the given node decoration,
993
+ // do so and return true.
994
+ update(e, n, o, i) {
995
+ return this.dirty == $ || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, n, o, i), !0);
996
+ }
997
+ updateInner(e, n, o, i) {
998
+ this.updateOuterDeco(n), this.node = e, this.innerDeco = o, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = I;
999
+ }
1000
+ updateOuterDeco(e) {
1001
+ if (Te(e, this.outerDeco))
1002
+ return;
1003
+ let n = this.nodeDOM.nodeType != 1, o = this.dom;
1004
+ this.dom = Qt(this.dom, this.nodeDOM, Ue(this.outerDeco, this.node, n), Ue(e, this.node, n)), this.dom != o && (o.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
1005
+ }
1006
+ // Mark this node as being the selected node.
1007
+ selectNode() {
1008
+ this.nodeDOM.nodeType == 1 && this.nodeDOM.classList.add("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && (this.dom.draggable = !0);
1009
+ }
1010
+ // Remove selected node marking from this node.
1011
+ deselectNode() {
1012
+ this.nodeDOM.nodeType == 1 && (this.nodeDOM.classList.remove("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && this.dom.removeAttribute("draggable"));
1013
+ }
1014
+ get domAtom() {
1015
+ return this.node.isAtom;
1016
+ }
1017
+ }
1018
+ function pt(t, e, n, o, i) {
1019
+ wt(o, e, t);
1020
+ let s = new Q(void 0, t, e, n, o, o, o, i, 0);
1021
+ return s.contentDOM && s.updateChildren(i, 0), s;
1022
+ }
1023
+ class Ie extends Q {
1024
+ constructor(e, n, o, i, s, r, l) {
1025
+ super(e, n, o, i, s, null, r, l, 0);
1026
+ }
1027
+ parseRule() {
1028
+ let e = this.nodeDOM.parentNode;
1029
+ for (; e && e != this.dom && !e.pmIsDeco; )
1030
+ e = e.parentNode;
1031
+ return { skip: e || !0 };
1032
+ }
1033
+ update(e, n, o, i) {
1034
+ return this.dirty == $ || this.dirty != I && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(n), (this.dirty != I || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, i.trackWrites == this.nodeDOM && (i.trackWrites = null)), this.node = e, this.dirty = I, !0);
1035
+ }
1036
+ inParent() {
1037
+ let e = this.parent.contentDOM;
1038
+ for (let n = this.nodeDOM; n; n = n.parentNode)
1039
+ if (n == e)
1040
+ return !0;
1041
+ return !1;
1042
+ }
1043
+ domFromPos(e) {
1044
+ return { node: this.nodeDOM, offset: e };
1045
+ }
1046
+ localPosFromDOM(e, n, o) {
1047
+ return e == this.nodeDOM ? this.posAtStart + Math.min(n, this.node.text.length) : super.localPosFromDOM(e, n, o);
1048
+ }
1049
+ ignoreMutation(e) {
1050
+ return e.type != "characterData" && e.type != "selection";
1051
+ }
1052
+ slice(e, n, o) {
1053
+ let i = this.node.cut(e, n), s = document.createTextNode(i.text);
1054
+ return new Ie(this.parent, i, this.outerDeco, this.innerDeco, s, s, o);
1055
+ }
1056
+ markDirty(e, n) {
1057
+ super.markDirty(e, n), this.dom != this.nodeDOM && (e == 0 || n == this.nodeDOM.nodeValue.length) && (this.dirty = $);
1058
+ }
1059
+ get domAtom() {
1060
+ return !1;
1061
+ }
1062
+ isText(e) {
1063
+ return this.node.text == e;
1064
+ }
1065
+ }
1066
+ class Jt extends Me {
1067
+ parseRule() {
1068
+ return { ignore: !0 };
1069
+ }
1070
+ matchesHack(e) {
1071
+ return this.dirty == I && this.dom.nodeName == e;
1072
+ }
1073
+ get domAtom() {
1074
+ return !0;
1075
+ }
1076
+ get ignoreForCoords() {
1077
+ return this.dom.nodeName == "IMG";
1078
+ }
1079
+ }
1080
+ class Jn extends Q {
1081
+ constructor(e, n, o, i, s, r, l, a, c, d) {
1082
+ super(e, n, o, i, s, r, l, c, d), this.spec = a;
1083
+ }
1084
+ // A custom `update` method gets to decide whether the update goes
1085
+ // through. If it does, and there's a `contentDOM` node, our logic
1086
+ // updates the children.
1087
+ update(e, n, o, i) {
1088
+ if (this.dirty == $)
1089
+ return !1;
1090
+ if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
1091
+ let s = this.spec.update(e, n, o);
1092
+ return s && this.updateInner(e, n, o, i), s;
1093
+ } else return !this.contentDOM && !e.isLeaf ? !1 : super.update(e, n, o, i);
1094
+ }
1095
+ selectNode() {
1096
+ this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
1097
+ }
1098
+ deselectNode() {
1099
+ this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
1100
+ }
1101
+ setSelection(e, n, o, i) {
1102
+ this.spec.setSelection ? this.spec.setSelection(e, n, o.root) : super.setSelection(e, n, o, i);
1103
+ }
1104
+ destroy() {
1105
+ this.spec.destroy && this.spec.destroy(), super.destroy();
1106
+ }
1107
+ stopEvent(e) {
1108
+ return this.spec.stopEvent ? this.spec.stopEvent(e) : !1;
1109
+ }
1110
+ ignoreMutation(e) {
1111
+ return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
1112
+ }
1113
+ }
1114
+ function Zt(t, e, n) {
1115
+ let o = t.firstChild, i = !1;
1116
+ for (let s = 0; s < e.length; s++) {
1117
+ let r = e[s], l = r.dom;
1118
+ if (l.parentNode == t) {
1119
+ for (; l != o; )
1120
+ o = mt(o), i = !0;
1121
+ o = o.nextSibling;
1122
+ } else
1123
+ i = !0, t.insertBefore(l, o);
1124
+ if (r instanceof re) {
1125
+ let a = o ? o.previousSibling : t.lastChild;
1126
+ Zt(r.contentDOM, r.children, n), o = a ? a.nextSibling : t.firstChild;
1127
+ }
1128
+ }
1129
+ for (; o; )
1130
+ o = mt(o), i = !0;
1131
+ i && n.trackWrites == t && (n.trackWrites = null);
1132
+ }
1133
+ const ye = function(t) {
1134
+ t && (this.nodeName = t);
1135
+ };
1136
+ ye.prototype = /* @__PURE__ */ Object.create(null);
1137
+ const ne = [new ye()];
1138
+ function Ue(t, e, n) {
1139
+ if (t.length == 0)
1140
+ return ne;
1141
+ let o = n ? ne[0] : new ye(), i = [o];
1142
+ for (let s = 0; s < t.length; s++) {
1143
+ let r = t[s].type.attrs;
1144
+ if (r) {
1145
+ r.nodeName && i.push(o = new ye(r.nodeName));
1146
+ for (let l in r) {
1147
+ let a = r[l];
1148
+ a != null && (n && i.length == 1 && i.push(o = new ye(e.isInline ? "span" : "div")), l == "class" ? o.class = (o.class ? o.class + " " : "") + a : l == "style" ? o.style = (o.style ? o.style + ";" : "") + a : l != "nodeName" && (o[l] = a));
1149
+ }
1150
+ }
1151
+ }
1152
+ return i;
1153
+ }
1154
+ function Qt(t, e, n, o) {
1155
+ if (n == ne && o == ne)
1156
+ return e;
1157
+ let i = e;
1158
+ for (let s = 0; s < o.length; s++) {
1159
+ let r = o[s], l = n[s];
1160
+ if (s) {
1161
+ let a;
1162
+ l && l.nodeName == r.nodeName && i != t && (a = i.parentNode) && a.nodeName.toLowerCase() == r.nodeName || (a = document.createElement(r.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = ne[0]), i = a;
1163
+ }
1164
+ Zn(i, l || ne[0], r);
1165
+ }
1166
+ return i;
1167
+ }
1168
+ function Zn(t, e, n) {
1169
+ for (let o in e)
1170
+ o != "class" && o != "style" && o != "nodeName" && !(o in n) && t.removeAttribute(o);
1171
+ for (let o in n)
1172
+ o != "class" && o != "style" && o != "nodeName" && n[o] != e[o] && t.setAttribute(o, n[o]);
1173
+ if (e.class != n.class) {
1174
+ let o = e.class ? e.class.split(" ").filter(Boolean) : [], i = n.class ? n.class.split(" ").filter(Boolean) : [];
1175
+ for (let s = 0; s < o.length; s++)
1176
+ i.indexOf(o[s]) == -1 && t.classList.remove(o[s]);
1177
+ for (let s = 0; s < i.length; s++)
1178
+ o.indexOf(i[s]) == -1 && t.classList.add(i[s]);
1179
+ t.classList.length == 0 && t.removeAttribute("class");
1180
+ }
1181
+ if (e.style != n.style) {
1182
+ if (e.style) {
1183
+ let o = /\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g, i;
1184
+ for (; i = o.exec(e.style); )
1185
+ t.style.removeProperty(i[1]);
1186
+ }
1187
+ n.style && (t.style.cssText += n.style);
1188
+ }
1189
+ }
1190
+ function wt(t, e, n) {
1191
+ return Qt(t, t, ne, Ue(e, n, t.nodeType != 1));
1192
+ }
1193
+ function Te(t, e) {
1194
+ if (t.length != e.length)
1195
+ return !1;
1196
+ for (let n = 0; n < t.length; n++)
1197
+ if (!t[n].type.eq(e[n].type))
1198
+ return !1;
1199
+ return !0;
1200
+ }
1201
+ function mt(t) {
1202
+ let e = t.nextSibling;
1203
+ return t.parentNode.removeChild(t), e;
1204
+ }
1205
+ class Qn {
1206
+ constructor(e, n, o) {
1207
+ this.lock = n, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = wn(e.node.content, e);
1208
+ }
1209
+ // Destroy and remove the children between the given indices in
1210
+ // `this.top`.
1211
+ destroyBetween(e, n) {
1212
+ if (e != n) {
1213
+ for (let o = e; o < n; o++)
1214
+ this.top.children[o].destroy();
1215
+ this.top.children.splice(e, n - e), this.changed = !0;
1216
+ }
1217
+ }
1218
+ // Destroy all remaining children in `this.top`.
1219
+ destroyRest() {
1220
+ this.destroyBetween(this.index, this.top.children.length);
1221
+ }
1222
+ // Sync the current stack of mark descs with the given array of
1223
+ // marks, reusing existing mark descs when possible.
1224
+ syncToMarks(e, n, o) {
1225
+ let i = 0, s = this.stack.length >> 1, r = Math.min(s, e.length);
1226
+ for (; i < r && (i == s - 1 ? this.top : this.stack[i + 1 << 1]).matchesMark(e[i]) && e[i].type.spec.spanning !== !1; )
1227
+ i++;
1228
+ for (; i < s; )
1229
+ this.destroyRest(), this.top.dirty = I, this.index = this.stack.pop(), this.top = this.stack.pop(), s--;
1230
+ for (; s < e.length; ) {
1231
+ this.stack.push(this.top, this.index + 1);
1232
+ let l = -1;
1233
+ for (let a = this.index; a < Math.min(this.index + 3, this.top.children.length); a++) {
1234
+ let c = this.top.children[a];
1235
+ if (c.matchesMark(e[s]) && !this.isLocked(c.dom)) {
1236
+ l = a;
1237
+ break;
1238
+ }
1239
+ }
1240
+ if (l > -1)
1241
+ l > this.index && (this.changed = !0, this.destroyBetween(this.index, l)), this.top = this.top.children[this.index];
1242
+ else {
1243
+ let a = re.create(this.top, e[s], n, o);
1244
+ this.top.children.splice(this.index, 0, a), this.top = a, this.changed = !0;
1245
+ }
1246
+ this.index = 0, s++;
1247
+ }
1248
+ }
1249
+ // Try to find a node desc matching the given data. Skip over it and
1250
+ // return true when successful.
1251
+ findNodeMatch(e, n, o, i) {
1252
+ let s = -1, r;
1253
+ if (i >= this.preMatch.index && (r = this.preMatch.matches[i - this.preMatch.index]).parent == this.top && r.matchesNode(e, n, o))
1254
+ s = this.top.children.indexOf(r, this.index);
1255
+ else
1256
+ for (let l = this.index, a = Math.min(this.top.children.length, l + 5); l < a; l++) {
1257
+ let c = this.top.children[l];
1258
+ if (c.matchesNode(e, n, o) && !this.preMatch.matched.has(c)) {
1259
+ s = l;
1260
+ break;
1261
+ }
1262
+ }
1263
+ return s < 0 ? !1 : (this.destroyBetween(this.index, s), this.index++, !0);
1264
+ }
1265
+ updateNodeAt(e, n, o, i, s) {
1266
+ let r = this.top.children[i];
1267
+ return r.dirty == $ && r.dom == r.contentDOM && (r.dirty = te), r.update(e, n, o, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
1268
+ }
1269
+ findIndexWithChild(e) {
1270
+ for (; ; ) {
1271
+ let n = e.parentNode;
1272
+ if (!n)
1273
+ return -1;
1274
+ if (n == this.top.contentDOM) {
1275
+ let o = e.pmViewDesc;
1276
+ if (o) {
1277
+ for (let i = this.index; i < this.top.children.length; i++)
1278
+ if (this.top.children[i] == o)
1279
+ return i;
1280
+ }
1281
+ return -1;
1282
+ }
1283
+ e = n;
1284
+ }
1285
+ }
1286
+ // Try to update the next node, if any, to the given data. Checks
1287
+ // pre-matches to avoid overwriting nodes that could still be used.
1288
+ updateNextNode(e, n, o, i, s, r) {
1289
+ for (let l = this.index; l < this.top.children.length; l++) {
1290
+ let a = this.top.children[l];
1291
+ if (a instanceof Q) {
1292
+ let c = this.preMatch.matched.get(a);
1293
+ if (c != null && c != s)
1294
+ return !1;
1295
+ let d = a.dom, f, u = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != $ && Te(n, a.outerDeco));
1296
+ if (!u && a.update(e, n, o, i))
1297
+ return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
1298
+ if (!u && (f = this.recreateWrapper(a, e, n, o, i, r)))
1299
+ return this.destroyBetween(this.index, l), this.top.children[this.index] = f, f.contentDOM && (f.dirty = te, f.updateChildren(i, r + 1), f.dirty = I), this.changed = !0, this.index++, !0;
1300
+ break;
1301
+ }
1302
+ }
1303
+ return !1;
1304
+ }
1305
+ // When a node with content is replaced by a different node with
1306
+ // identical content, move over its children.
1307
+ recreateWrapper(e, n, o, i, s, r) {
1308
+ if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !Te(o, e.outerDeco) || !i.eq(e.innerDeco))
1309
+ return null;
1310
+ let l = Q.create(this.top, n, o, i, s, r);
1311
+ if (l.contentDOM) {
1312
+ l.children = e.children, e.children = [];
1313
+ for (let a of l.children)
1314
+ a.parent = l;
1315
+ }
1316
+ return e.destroy(), l;
1317
+ }
1318
+ // Insert the node as a newly created node desc.
1319
+ addNode(e, n, o, i, s) {
1320
+ let r = Q.create(this.top, e, n, o, i, s);
1321
+ r.contentDOM && r.updateChildren(i, s + 1), this.top.children.splice(this.index++, 0, r), this.changed = !0;
1322
+ }
1323
+ placeWidget(e, n, o) {
1324
+ let i = this.index < this.top.children.length ? this.top.children[this.index] : null;
1325
+ if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
1326
+ this.index++;
1327
+ else {
1328
+ let s = new Xt(this.top, e, n, o);
1329
+ this.top.children.splice(this.index++, 0, s), this.changed = !0;
1330
+ }
1331
+ }
1332
+ // Make sure a textblock looks and behaves correctly in
1333
+ // contentEditable.
1334
+ addTextblockHacks() {
1335
+ let e = this.top.children[this.index - 1], n = this.top;
1336
+ for (; e instanceof re; )
1337
+ n = e, e = n.children[n.children.length - 1];
1338
+ (!e || // Empty textblock
1339
+ !(e instanceof Ie) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((k || M) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", n), this.addHackNode("BR", this.top));
1340
+ }
1341
+ addHackNode(e, n) {
1342
+ if (n == this.top && this.index < n.children.length && n.children[this.index].matchesHack(e))
1343
+ this.index++;
1344
+ else {
1345
+ let o = document.createElement(e);
1346
+ e == "IMG" && (o.className = "ProseMirror-separator", o.alt = ""), e == "BR" && (o.className = "ProseMirror-trailingBreak");
1347
+ let i = new Jt(this.top, [], o, null);
1348
+ n != this.top ? n.children.push(i) : n.children.splice(this.index++, 0, i), this.changed = !0;
1349
+ }
1350
+ }
1351
+ isLocked(e) {
1352
+ return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
1353
+ }
1354
+ }
1355
+ function wn(t, e) {
1356
+ let n = e, o = n.children.length, i = t.childCount, s = /* @__PURE__ */ new Map(), r = [];
1357
+ e: for (; i > 0; ) {
1358
+ let l;
1359
+ for (; ; )
1360
+ if (o) {
1361
+ let c = n.children[o - 1];
1362
+ if (c instanceof re)
1363
+ n = c, o = c.children.length;
1364
+ else {
1365
+ l = c, o--;
1366
+ break;
1367
+ }
1368
+ } else {
1369
+ if (n == e)
1370
+ break e;
1371
+ o = n.parent.children.indexOf(n), n = n.parent;
1372
+ }
1373
+ let a = l.node;
1374
+ if (a) {
1375
+ if (a != t.child(i - 1))
1376
+ break;
1377
+ --i, s.set(l, i), r.push(l);
1378
+ }
1379
+ }
1380
+ return { index: i, matched: s, matches: r.reverse() };
1381
+ }
1382
+ function vn(t, e) {
1383
+ return t.type.side - e.type.side;
1384
+ }
1385
+ function eo(t, e, n, o) {
1386
+ let i = e.locals(t), s = 0;
1387
+ if (i.length == 0) {
1388
+ for (let c = 0; c < t.childCount; c++) {
1389
+ let d = t.child(c);
1390
+ o(d, i, e.forChild(s, d), c), s += d.nodeSize;
1391
+ }
1392
+ return;
1393
+ }
1394
+ let r = 0, l = [], a = null;
1395
+ for (let c = 0; ; ) {
1396
+ let d, f;
1397
+ for (; r < i.length && i[r].to == s; ) {
1398
+ let m = i[r++];
1399
+ m.widget && (d ? (f || (f = [d])).push(m) : d = m);
1400
+ }
1401
+ if (d)
1402
+ if (f) {
1403
+ f.sort(vn);
1404
+ for (let m = 0; m < f.length; m++)
1405
+ n(f[m], c, !!a);
1406
+ } else
1407
+ n(d, c, !!a);
1408
+ let u, p;
1409
+ if (a)
1410
+ p = -1, u = a, a = null;
1411
+ else if (c < t.childCount)
1412
+ p = c, u = t.child(c++);
1413
+ else
1414
+ break;
1415
+ for (let m = 0; m < l.length; m++)
1416
+ l[m].to <= s && l.splice(m--, 1);
1417
+ for (; r < i.length && i[r].from <= s && i[r].to > s; )
1418
+ l.push(i[r++]);
1419
+ let h = s + u.nodeSize;
1420
+ if (u.isText) {
1421
+ let m = h;
1422
+ r < i.length && i[r].from < m && (m = i[r].from);
1423
+ for (let y = 0; y < l.length; y++)
1424
+ l[y].to < m && (m = l[y].to);
1425
+ m < h && (a = u.cut(m - s), u = u.cut(0, m - s), h = m, p = -1);
1426
+ } else
1427
+ for (; r < i.length && i[r].to < h; )
1428
+ r++;
1429
+ let g = u.isInline && !u.isLeaf ? l.filter((m) => !m.inline) : l.slice();
1430
+ o(u, g, e.forChild(s, u), p), s = h;
1431
+ }
1432
+ }
1433
+ function to(t) {
1434
+ if (t.nodeName == "UL" || t.nodeName == "OL") {
1435
+ let e = t.style.cssText;
1436
+ t.style.cssText = e + "; list-style: square !important", window.getComputedStyle(t).listStyle, t.style.cssText = e;
1437
+ }
1438
+ }
1439
+ function no(t, e, n, o) {
1440
+ for (let i = 0, s = 0; i < t.childCount && s <= o; ) {
1441
+ let r = t.child(i++), l = s;
1442
+ if (s += r.nodeSize, !r.isText)
1443
+ continue;
1444
+ let a = r.text;
1445
+ for (; i < t.childCount; ) {
1446
+ let c = t.child(i++);
1447
+ if (s += c.nodeSize, !c.isText)
1448
+ break;
1449
+ a += c.text;
1450
+ }
1451
+ if (s >= n) {
1452
+ if (s >= o && a.slice(o - e.length - l, o - l) == e)
1453
+ return o - e.length;
1454
+ let c = l < o ? a.lastIndexOf(e, o - l - 1) : -1;
1455
+ if (c >= 0 && c + e.length + l >= n)
1456
+ return l + c;
1457
+ if (n == o && a.length >= o + e.length - l && a.slice(o - l, o - l + e.length) == e)
1458
+ return o;
1459
+ }
1460
+ }
1461
+ return -1;
1462
+ }
1463
+ function Ye(t, e, n, o, i) {
1464
+ let s = [];
1465
+ for (let r = 0, l = 0; r < t.length; r++) {
1466
+ let a = t[r], c = l, d = l += a.size;
1467
+ c >= n || d <= e ? s.push(a) : (c < e && s.push(a.slice(0, e - c, o)), i && (s.push(i), i = void 0), d > n && s.push(a.slice(n - c, a.size, o)));
1468
+ }
1469
+ return s;
1470
+ }
1471
+ function we(t, e = null) {
1472
+ let n = t.domSelectionRange(), o = t.state.doc;
1473
+ if (!n.focusNode)
1474
+ return null;
1475
+ let i = t.docView.nearestDesc(n.focusNode), s = i && i.size == 0, r = t.docView.posFromDOM(n.focusNode, n.focusOffset, 1);
1476
+ if (r < 0)
1477
+ return null;
1478
+ let l = o.resolve(r), a, c;
1479
+ if (Be(n)) {
1480
+ for (a = r; i && !i.node; )
1481
+ i = i.parent;
1482
+ let f = i.node;
1483
+ if (i && f.isAtom && D.isSelectable(f) && i.parent && !(f.isInline && An(n.focusNode, n.focusOffset, i.dom))) {
1484
+ let u = i.posBefore;
1485
+ c = new D(r == u ? l : o.resolve(u));
1486
+ }
1487
+ } else {
1488
+ if (n instanceof t.dom.ownerDocument.defaultView.Selection && n.rangeCount > 1) {
1489
+ let f = r, u = r;
1490
+ for (let p = 0; p < n.rangeCount; p++) {
1491
+ let h = n.getRangeAt(p);
1492
+ f = Math.min(f, t.docView.posFromDOM(h.startContainer, h.startOffset, 1)), u = Math.max(u, t.docView.posFromDOM(h.endContainer, h.endOffset, -1));
1493
+ }
1494
+ if (f < 0)
1495
+ return null;
1496
+ [a, r] = u == t.state.selection.anchor ? [u, f] : [f, u], l = o.resolve(r);
1497
+ } else
1498
+ a = t.docView.posFromDOM(n.anchorNode, n.anchorOffset, 1);
1499
+ if (a < 0)
1500
+ return null;
1501
+ }
1502
+ let d = o.resolve(a);
1503
+ if (!c) {
1504
+ let f = e == "pointer" || t.state.selection.head < l.pos && !s ? 1 : -1;
1505
+ c = ve(t, d, l, f);
1506
+ }
1507
+ return c;
1508
+ }
1509
+ function vt(t) {
1510
+ return t.editable ? t.hasFocus() : tn(t) && document.activeElement && document.activeElement.contains(t.dom);
1511
+ }
1512
+ function W(t, e = !1) {
1513
+ let n = t.state.selection;
1514
+ if (en(t, n), !!vt(t)) {
1515
+ if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && M) {
1516
+ let o = t.domSelectionRange(), i = t.domObserver.currentSelection;
1517
+ if (o.anchorNode && i.anchorNode && se(o.anchorNode, o.anchorOffset, i.anchorNode, i.anchorOffset)) {
1518
+ t.input.mouseDown.delayedSelectionSync = !0, t.domObserver.setCurSelection();
1519
+ return;
1520
+ }
1521
+ }
1522
+ if (t.domObserver.disconnectSelection(), t.cursorWrapper)
1523
+ io(t);
1524
+ else {
1525
+ let { anchor: o, head: i } = n, s, r;
1526
+ gt && !(n instanceof x) && (n.$from.parent.inlineContent || (s = yt(t, n.from)), !n.empty && !n.$from.parent.inlineContent && (r = yt(t, n.to))), t.docView.setSelection(o, i, t, e), gt && (s && bt(s), r && bt(r)), n.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && oo(t));
1527
+ }
1528
+ t.domObserver.setCurSelection(), t.domObserver.connectSelection();
1529
+ }
1530
+ }
1531
+ const gt = k || M && Ht < 63;
1532
+ function yt(t, e) {
1533
+ let { node: n, offset: o } = t.docView.domFromPos(e, 0), i = o < n.childNodes.length ? n.childNodes[o] : null, s = o ? n.childNodes[o - 1] : null;
1534
+ if (k && i && i.contentEditable == "false")
1535
+ return Le(i);
1536
+ if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
1537
+ if (i)
1538
+ return Le(i);
1539
+ if (s)
1540
+ return Le(s);
1541
+ }
1542
+ }
1543
+ function Le(t) {
1544
+ return t.contentEditable = "true", k && t.draggable && (t.draggable = !1, t.wasDraggable = !0), t;
1545
+ }
1546
+ function bt(t) {
1547
+ t.contentEditable = "false", t.wasDraggable && (t.draggable = !0, t.wasDraggable = null);
1548
+ }
1549
+ function oo(t) {
1550
+ let e = t.dom.ownerDocument;
1551
+ e.removeEventListener("selectionchange", t.input.hideSelectionGuard);
1552
+ let n = t.domSelectionRange(), o = n.anchorNode, i = n.anchorOffset;
1553
+ e.addEventListener("selectionchange", t.input.hideSelectionGuard = () => {
1554
+ (n.anchorNode != o || n.anchorOffset != i) && (e.removeEventListener("selectionchange", t.input.hideSelectionGuard), setTimeout(() => {
1555
+ (!vt(t) || t.state.selection.visible) && t.dom.classList.remove("ProseMirror-hideselection");
1556
+ }, 20));
1557
+ });
1558
+ }
1559
+ function io(t) {
1560
+ let e = t.domSelection(), n = document.createRange();
1561
+ if (!e)
1562
+ return;
1563
+ let o = t.cursorWrapper.dom, i = o.nodeName == "IMG";
1564
+ i ? n.setStart(o.parentNode, C(o) + 1) : n.setStart(o, 0), n.collapse(!0), e.removeAllRanges(), e.addRange(n), !i && !t.state.selection.visible && P && Z <= 11 && (o.disabled = !0, o.disabled = !1);
1565
+ }
1566
+ function en(t, e) {
1567
+ if (e instanceof D) {
1568
+ let n = t.docView.descAt(e.from);
1569
+ n != t.lastSelectedViewDesc && (Dt(t), n && n.selectNode(), t.lastSelectedViewDesc = n);
1570
+ } else
1571
+ Dt(t);
1572
+ }
1573
+ function Dt(t) {
1574
+ t.lastSelectedViewDesc && (t.lastSelectedViewDesc.parent && t.lastSelectedViewDesc.deselectNode(), t.lastSelectedViewDesc = void 0);
1575
+ }
1576
+ function ve(t, e, n, o) {
1577
+ return t.someProp("createSelectionBetween", (i) => i(t, e, n)) || x.between(e, n, o);
1578
+ }
1579
+ function Nt(t) {
1580
+ return t.editable && !t.hasFocus() ? !1 : tn(t);
1581
+ }
1582
+ function tn(t) {
1583
+ let e = t.domSelectionRange();
1584
+ if (!e.anchorNode)
1585
+ return !1;
1586
+ try {
1587
+ return t.dom.contains(e.anchorNode.nodeType == 3 ? e.anchorNode.parentNode : e.anchorNode) && (t.editable || t.dom.contains(e.focusNode.nodeType == 3 ? e.focusNode.parentNode : e.focusNode));
1588
+ } catch {
1589
+ return !1;
1590
+ }
1591
+ }
1592
+ function so(t) {
1593
+ let e = t.docView.domFromPos(t.state.selection.anchor, 0), n = t.domSelectionRange();
1594
+ return se(e.node, e.offset, n.anchorNode, n.anchorOffset);
1595
+ }
1596
+ function Ge(t, e) {
1597
+ let { $anchor: n, $head: o } = t.selection, i = e > 0 ? n.max(o) : n.min(o), s = i.parent.inlineContent ? i.depth ? t.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
1598
+ return s && he.findFrom(s, e);
1599
+ }
1600
+ function Y(t, e) {
1601
+ return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()), !0;
1602
+ }
1603
+ function St(t, e, n) {
1604
+ let o = t.state.selection;
1605
+ if (o instanceof x)
1606
+ if (n.indexOf("s") > -1) {
1607
+ let { $head: i } = o, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter;
1608
+ if (!s || s.isText || !s.isLeaf)
1609
+ return !1;
1610
+ let r = t.state.doc.resolve(i.pos + s.nodeSize * (e < 0 ? -1 : 1));
1611
+ return Y(t, new x(o.$anchor, r));
1612
+ } else if (o.empty) {
1613
+ if (t.endOfTextblock(e > 0 ? "forward" : "backward")) {
1614
+ let i = Ge(t.state, e);
1615
+ return i && i instanceof D ? Y(t, i) : !1;
1616
+ } else if (!(R && n.indexOf("m") > -1)) {
1617
+ let i = o.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, r;
1618
+ if (!s || s.isText)
1619
+ return !1;
1620
+ let l = e < 0 ? i.pos - s.nodeSize : i.pos;
1621
+ return s.isAtom || (r = t.docView.descAt(l)) && !r.contentDOM ? D.isSelectable(s) ? Y(t, new D(e < 0 ? t.state.doc.resolve(i.pos - s.nodeSize) : i)) : Oe ? Y(t, new x(t.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
1622
+ }
1623
+ } else return !1;
1624
+ else {
1625
+ if (o instanceof D && o.node.isInline)
1626
+ return Y(t, new x(e > 0 ? o.$to : o.$from));
1627
+ {
1628
+ let i = Ge(t.state, e);
1629
+ return i ? Y(t, i) : !1;
1630
+ }
1631
+ }
1632
+ }
1633
+ function Ae(t) {
1634
+ return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
1635
+ }
1636
+ function be(t, e) {
1637
+ let n = t.pmViewDesc;
1638
+ return n && n.size == 0 && (e < 0 || t.nextSibling || t.nodeName != "BR");
1639
+ }
1640
+ function ce(t, e) {
1641
+ return e < 0 ? ro(t) : lo(t);
1642
+ }
1643
+ function ro(t) {
1644
+ let e = t.domSelectionRange(), n = e.focusNode, o = e.focusOffset;
1645
+ if (!n)
1646
+ return;
1647
+ let i, s, r = !1;
1648
+ for (L && n.nodeType == 1 && o < Ae(n) && be(n.childNodes[o], -1) && (r = !0); ; )
1649
+ if (o > 0) {
1650
+ if (n.nodeType != 1)
1651
+ break;
1652
+ {
1653
+ let l = n.childNodes[o - 1];
1654
+ if (be(l, -1))
1655
+ i = n, s = --o;
1656
+ else if (l.nodeType == 3)
1657
+ n = l, o = n.nodeValue.length;
1658
+ else
1659
+ break;
1660
+ }
1661
+ } else {
1662
+ if (nn(n))
1663
+ break;
1664
+ {
1665
+ let l = n.previousSibling;
1666
+ for (; l && be(l, -1); )
1667
+ i = n.parentNode, s = C(l), l = l.previousSibling;
1668
+ if (l)
1669
+ n = l, o = Ae(n);
1670
+ else {
1671
+ if (n = n.parentNode, n == t.dom)
1672
+ break;
1673
+ o = 0;
1674
+ }
1675
+ }
1676
+ }
1677
+ r ? Xe(t, n, o) : i && Xe(t, i, s);
1678
+ }
1679
+ function lo(t) {
1680
+ let e = t.domSelectionRange(), n = e.focusNode, o = e.focusOffset;
1681
+ if (!n)
1682
+ return;
1683
+ let i = Ae(n), s, r;
1684
+ for (; ; )
1685
+ if (o < i) {
1686
+ if (n.nodeType != 1)
1687
+ break;
1688
+ let l = n.childNodes[o];
1689
+ if (be(l, 1))
1690
+ s = n, r = ++o;
1691
+ else
1692
+ break;
1693
+ } else {
1694
+ if (nn(n))
1695
+ break;
1696
+ {
1697
+ let l = n.nextSibling;
1698
+ for (; l && be(l, 1); )
1699
+ s = l.parentNode, r = C(l) + 1, l = l.nextSibling;
1700
+ if (l)
1701
+ n = l, o = 0, i = Ae(n);
1702
+ else {
1703
+ if (n = n.parentNode, n == t.dom)
1704
+ break;
1705
+ o = i = 0;
1706
+ }
1707
+ }
1708
+ }
1709
+ s && Xe(t, s, r);
1710
+ }
1711
+ function nn(t) {
1712
+ let e = t.pmViewDesc;
1713
+ return e && e.node && e.node.isBlock;
1714
+ }
1715
+ function ao(t, e) {
1716
+ for (; t && e == t.childNodes.length && !Ce(t); )
1717
+ e = C(t) + 1, t = t.parentNode;
1718
+ for (; t && e < t.childNodes.length; ) {
1719
+ let n = t.childNodes[e];
1720
+ if (n.nodeType == 3)
1721
+ return n;
1722
+ if (n.nodeType == 1 && n.contentEditable == "false")
1723
+ break;
1724
+ t = n, e = 0;
1725
+ }
1726
+ }
1727
+ function co(t, e) {
1728
+ for (; t && !e && !Ce(t); )
1729
+ e = C(t), t = t.parentNode;
1730
+ for (; t && e; ) {
1731
+ let n = t.childNodes[e - 1];
1732
+ if (n.nodeType == 3)
1733
+ return n;
1734
+ if (n.nodeType == 1 && n.contentEditable == "false")
1735
+ break;
1736
+ t = n, e = t.childNodes.length;
1737
+ }
1738
+ }
1739
+ function Xe(t, e, n) {
1740
+ if (e.nodeType != 3) {
1741
+ let s, r;
1742
+ (r = ao(e, n)) ? (e = r, n = 0) : (s = co(e, n)) && (e = s, n = s.nodeValue.length);
1743
+ }
1744
+ let o = t.domSelection();
1745
+ if (!o)
1746
+ return;
1747
+ if (Be(o)) {
1748
+ let s = document.createRange();
1749
+ s.setEnd(e, n), s.setStart(e, n), o.removeAllRanges(), o.addRange(s);
1750
+ } else o.extend && o.extend(e, n);
1751
+ t.domObserver.setCurSelection();
1752
+ let { state: i } = t;
1753
+ setTimeout(() => {
1754
+ t.state == i && W(t);
1755
+ }, 50);
1756
+ }
1757
+ function Ct(t, e) {
1758
+ let n = t.state.doc.resolve(e);
1759
+ if (!(M || Vn) && n.parent.inlineContent) {
1760
+ let i = t.coordsAtPos(e);
1761
+ if (e > n.start()) {
1762
+ let s = t.coordsAtPos(e - 1), r = (s.top + s.bottom) / 2;
1763
+ if (r > i.top && r < i.bottom && Math.abs(s.left - i.left) > 1)
1764
+ return s.left < i.left ? "ltr" : "rtl";
1765
+ }
1766
+ if (e < n.end()) {
1767
+ let s = t.coordsAtPos(e + 1), r = (s.top + s.bottom) / 2;
1768
+ if (r > i.top && r < i.bottom && Math.abs(s.left - i.left) > 1)
1769
+ return s.left > i.left ? "ltr" : "rtl";
1770
+ }
1771
+ }
1772
+ return getComputedStyle(t.dom).direction == "rtl" ? "rtl" : "ltr";
1773
+ }
1774
+ function Ot(t, e, n) {
1775
+ let o = t.state.selection;
1776
+ if (o instanceof x && !o.empty || n.indexOf("s") > -1 || R && n.indexOf("m") > -1)
1777
+ return !1;
1778
+ let { $from: i, $to: s } = o;
1779
+ if (!i.parent.inlineContent || t.endOfTextblock(e < 0 ? "up" : "down")) {
1780
+ let r = Ge(t.state, e);
1781
+ if (r && r instanceof D)
1782
+ return Y(t, r);
1783
+ }
1784
+ if (!i.parent.inlineContent) {
1785
+ let r = e < 0 ? i : s, l = o instanceof Sn ? he.near(r, e) : he.findFrom(r, e);
1786
+ return l ? Y(t, l) : !1;
1787
+ }
1788
+ return !1;
1789
+ }
1790
+ function Mt(t, e) {
1791
+ if (!(t.state.selection instanceof x))
1792
+ return !0;
1793
+ let { $head: n, $anchor: o, empty: i } = t.state.selection;
1794
+ if (!n.sameParent(o))
1795
+ return !0;
1796
+ if (!i)
1797
+ return !1;
1798
+ if (t.endOfTextblock(e > 0 ? "forward" : "backward"))
1799
+ return !0;
1800
+ let s = !n.textOffset && (e < 0 ? n.nodeBefore : n.nodeAfter);
1801
+ if (s && !s.isText) {
1802
+ let r = t.state.tr;
1803
+ return e < 0 ? r.delete(n.pos - s.nodeSize, n.pos) : r.delete(n.pos, n.pos + s.nodeSize), t.dispatch(r), !0;
1804
+ }
1805
+ return !1;
1806
+ }
1807
+ function xt(t, e, n) {
1808
+ t.domObserver.stop(), e.contentEditable = n, t.domObserver.start();
1809
+ }
1810
+ function fo(t) {
1811
+ if (!k || t.state.selection.$head.parentOffset > 0)
1812
+ return !1;
1813
+ let { focusNode: e, focusOffset: n } = t.domSelectionRange();
1814
+ if (e && e.nodeType == 1 && n == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
1815
+ let o = e.firstChild;
1816
+ xt(t, o, "true"), setTimeout(() => xt(t, o, "false"), 20);
1817
+ }
1818
+ return !1;
1819
+ }
1820
+ function ho(t) {
1821
+ let e = "";
1822
+ return t.ctrlKey && (e += "c"), t.metaKey && (e += "m"), t.altKey && (e += "a"), t.shiftKey && (e += "s"), e;
1823
+ }
1824
+ function uo(t, e) {
1825
+ let n = e.keyCode, o = ho(e);
1826
+ if (n == 8 || R && n == 72 && o == "c")
1827
+ return Mt(t, -1) || ce(t, -1);
1828
+ if (n == 46 && !e.shiftKey || R && n == 68 && o == "c")
1829
+ return Mt(t, 1) || ce(t, 1);
1830
+ if (n == 13 || n == 27)
1831
+ return !0;
1832
+ if (n == 37 || R && n == 66 && o == "c") {
1833
+ let i = n == 37 ? Ct(t, t.state.selection.from) == "ltr" ? -1 : 1 : -1;
1834
+ return St(t, i, o) || ce(t, i);
1835
+ } else if (n == 39 || R && n == 70 && o == "c") {
1836
+ let i = n == 39 ? Ct(t, t.state.selection.from) == "ltr" ? 1 : -1 : 1;
1837
+ return St(t, i, o) || ce(t, i);
1838
+ } else {
1839
+ if (n == 38 || R && n == 80 && o == "c")
1840
+ return Ot(t, -1, o) || ce(t, -1);
1841
+ if (n == 40 || R && n == 78 && o == "c")
1842
+ return fo(t) || Ot(t, 1, o) || ce(t, 1);
1843
+ if (o == (R ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90))
1844
+ return !0;
1845
+ }
1846
+ return !1;
1847
+ }
1848
+ function et(t, e) {
1849
+ t.someProp("transformCopied", (p) => {
1850
+ e = p(e, t);
1851
+ });
1852
+ let n = [], { content: o, openStart: i, openEnd: s } = e;
1853
+ for (; i > 1 && s > 1 && o.childCount == 1 && o.firstChild.childCount == 1; ) {
1854
+ i--, s--;
1855
+ let p = o.firstChild;
1856
+ n.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), o = p.content;
1857
+ }
1858
+ let r = t.someProp("clipboardSerializer") || Re.fromSchema(t.state.schema), l = cn(), a = l.createElement("div");
1859
+ a.appendChild(r.serializeFragment(o, { document: l }));
1860
+ let c = a.firstChild, d, f = 0;
1861
+ for (; c && c.nodeType == 1 && (d = an[c.nodeName.toLowerCase()]); ) {
1862
+ for (let p = d.length - 1; p >= 0; p--) {
1863
+ let h = l.createElement(d[p]);
1864
+ for (; a.firstChild; )
1865
+ h.appendChild(a.firstChild);
1866
+ a.appendChild(h), f++;
1867
+ }
1868
+ c = a.firstChild;
1869
+ }
1870
+ c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${i} ${s}${f ? ` -${f}` : ""} ${JSON.stringify(n)}`);
1871
+ let u = t.someProp("clipboardTextSerializer", (p) => p(e, t)) || e.content.textBetween(0, e.content.size, `
1872
+
1873
+ `);
1874
+ return { dom: a, text: u, slice: e };
1875
+ }
1876
+ function on(t, e, n, o, i) {
1877
+ let s = i.parent.type.spec.code, r, l;
1878
+ if (!n && !e)
1879
+ return null;
1880
+ let a = e && (o || s || !n);
1881
+ if (a) {
1882
+ if (t.someProp("transformPastedText", (u) => {
1883
+ e = u(e, s || o, t);
1884
+ }), s)
1885
+ return e ? new J(_.from(t.state.schema.text(e.replace(/\r\n?/g, `
1886
+ `))), 0, 0) : J.empty;
1887
+ let f = t.someProp("clipboardTextParser", (u) => u(e, i, o, t));
1888
+ if (f)
1889
+ l = f;
1890
+ else {
1891
+ let u = i.marks(), { schema: p } = t.state, h = Re.fromSchema(p);
1892
+ r = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((g) => {
1893
+ let m = r.appendChild(document.createElement("p"));
1894
+ g && m.appendChild(h.serializeNode(p.text(g, u)));
1895
+ });
1896
+ }
1897
+ } else
1898
+ t.someProp("transformPastedHTML", (f) => {
1899
+ n = f(n, t);
1900
+ }), r = yo(n), Oe && bo(r);
1901
+ let c = r && r.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
1902
+ if (d && d[3])
1903
+ for (let f = +d[3]; f > 0; f--) {
1904
+ let u = r.firstChild;
1905
+ for (; u && u.nodeType != 1; )
1906
+ u = u.nextSibling;
1907
+ if (!u)
1908
+ break;
1909
+ r = u;
1910
+ }
1911
+ if (l || (l = (t.someProp("clipboardParser") || t.someProp("domParser") || qt.fromSchema(t.state.schema)).parseSlice(r, {
1912
+ preserveWhitespace: !!(a || d),
1913
+ context: i,
1914
+ ruleFromNode(u) {
1915
+ return u.nodeName == "BR" && !u.nextSibling && u.parentNode && !po.test(u.parentNode.nodeName) ? { ignore: !0 } : null;
1916
+ }
1917
+ })), d)
1918
+ l = Do(kt(l, +d[1], +d[2]), d[4]);
1919
+ else if (l = J.maxOpen(mo(l.content, i), !0), l.openStart || l.openEnd) {
1920
+ let f = 0, u = 0;
1921
+ for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
1922
+ ;
1923
+ for (let p = l.content.lastChild; u < l.openEnd && !p.type.spec.isolating; u++, p = p.lastChild)
1924
+ ;
1925
+ l = kt(l, f, u);
1926
+ }
1927
+ return t.someProp("transformPasted", (f) => {
1928
+ l = f(l, t);
1929
+ }), l;
1930
+ }
1931
+ const po = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
1932
+ function mo(t, e) {
1933
+ if (t.childCount < 2)
1934
+ return t;
1935
+ for (let n = e.depth; n >= 0; n--) {
1936
+ let i = e.node(n).contentMatchAt(e.index(n)), s, r = [];
1937
+ if (t.forEach((l) => {
1938
+ if (!r)
1939
+ return;
1940
+ let a = i.findWrapping(l.type), c;
1941
+ if (!a)
1942
+ return r = null;
1943
+ if (c = r.length && s.length && rn(a, s, l, r[r.length - 1], 0))
1944
+ r[r.length - 1] = c;
1945
+ else {
1946
+ r.length && (r[r.length - 1] = ln(r[r.length - 1], s.length));
1947
+ let d = sn(l, a);
1948
+ r.push(d), i = i.matchType(d.type), s = a;
1949
+ }
1950
+ }), r)
1951
+ return _.from(r);
1952
+ }
1953
+ return t;
1954
+ }
1955
+ function sn(t, e, n = 0) {
1956
+ for (let o = e.length - 1; o >= n; o--)
1957
+ t = e[o].create(null, _.from(t));
1958
+ return t;
1959
+ }
1960
+ function rn(t, e, n, o, i) {
1961
+ if (i < t.length && i < e.length && t[i] == e[i]) {
1962
+ let s = rn(t, e, n, o.lastChild, i + 1);
1963
+ if (s)
1964
+ return o.copy(o.content.replaceChild(o.childCount - 1, s));
1965
+ if (o.contentMatchAt(o.childCount).matchType(i == t.length - 1 ? n.type : t[i + 1]))
1966
+ return o.copy(o.content.append(_.from(sn(n, t, i + 1))));
1967
+ }
1968
+ }
1969
+ function ln(t, e) {
1970
+ if (e == 0)
1971
+ return t;
1972
+ let n = t.content.replaceChild(t.childCount - 1, ln(t.lastChild, e - 1)), o = t.contentMatchAt(t.childCount).fillBefore(_.empty, !0);
1973
+ return t.copy(n.append(o));
1974
+ }
1975
+ function Je(t, e, n, o, i, s) {
1976
+ let r = e < 0 ? t.firstChild : t.lastChild, l = r.content;
1977
+ return t.childCount > 1 && (s = 0), i < o - 1 && (l = Je(l, e, n, o, i + 1, s)), i >= n && (l = e < 0 ? r.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(r.contentMatchAt(r.childCount).fillBefore(_.empty, !0))), t.replaceChild(e < 0 ? 0 : t.childCount - 1, r.copy(l));
1978
+ }
1979
+ function kt(t, e, n) {
1980
+ return e < t.openStart && (t = new J(Je(t.content, -1, e, t.openStart, 0, t.openEnd), e, t.openEnd)), n < t.openEnd && (t = new J(Je(t.content, 1, n, t.openEnd, 0, 0), t.openStart, n)), t;
1981
+ }
1982
+ const an = {
1983
+ thead: ["table"],
1984
+ tbody: ["table"],
1985
+ tfoot: ["table"],
1986
+ caption: ["table"],
1987
+ colgroup: ["table"],
1988
+ col: ["table", "colgroup"],
1989
+ tr: ["table", "tbody"],
1990
+ td: ["table", "tbody", "tr"],
1991
+ th: ["table", "tbody", "tr"]
1992
+ };
1993
+ let Tt = null;
1994
+ function cn() {
1995
+ return Tt || (Tt = document.implementation.createHTMLDocument("title"));
1996
+ }
1997
+ let $e = null;
1998
+ function go(t) {
1999
+ let e = window.trustedTypes;
2000
+ return e ? ($e || ($e = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (n) => n })), $e.createHTML(t)) : t;
2001
+ }
2002
+ function yo(t) {
2003
+ let e = /^(\s*<meta [^>]*>)*/.exec(t);
2004
+ e && (t = t.slice(e[0].length));
2005
+ let n = cn().createElement("div"), o = /<([a-z][^>\s]+)/i.exec(t), i;
2006
+ if ((i = o && an[o[1].toLowerCase()]) && (t = i.map((s) => "<" + s + ">").join("") + t + i.map((s) => "</" + s + ">").reverse().join("")), n.innerHTML = go(t), i)
2007
+ for (let s = 0; s < i.length; s++)
2008
+ n = n.querySelector(i[s]) || n;
2009
+ return n;
2010
+ }
2011
+ function bo(t) {
2012
+ let e = t.querySelectorAll(M ? "span:not([class]):not([style])" : "span.Apple-converted-space");
2013
+ for (let n = 0; n < e.length; n++) {
2014
+ let o = e[n];
2015
+ o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(t.ownerDocument.createTextNode(" "), o);
2016
+ }
2017
+ }
2018
+ function Do(t, e) {
2019
+ if (!t.size)
2020
+ return t;
2021
+ let n = t.content.firstChild.type.schema, o;
2022
+ try {
2023
+ o = JSON.parse(e);
2024
+ } catch {
2025
+ return t;
2026
+ }
2027
+ let { content: i, openStart: s, openEnd: r } = t;
2028
+ for (let l = o.length - 2; l >= 0; l -= 2) {
2029
+ let a = n.nodes[o[l]];
2030
+ if (!a || a.hasRequiredAttrs())
2031
+ break;
2032
+ i = _.from(a.create(o[l + 1], i)), s++, r++;
2033
+ }
2034
+ return new J(i, s, r);
2035
+ }
2036
+ const T = {}, A = {}, No = { touchstart: !0, touchmove: !0 };
2037
+ class So {
2038
+ constructor() {
2039
+ this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
2040
+ }
2041
+ }
2042
+ function Co(t) {
2043
+ for (let e in T) {
2044
+ let n = T[e];
2045
+ t.dom.addEventListener(e, t.input.eventHandlers[e] = (o) => {
2046
+ Mo(t, o) && !tt(t, o) && (t.editable || !(o.type in A)) && n(t, o);
2047
+ }, No[e] ? { passive: !0 } : void 0);
2048
+ }
2049
+ k && t.dom.addEventListener("input", () => null), Ze(t);
2050
+ }
2051
+ function X(t, e) {
2052
+ t.input.lastSelectionOrigin = e, t.input.lastSelectionTime = Date.now();
2053
+ }
2054
+ function Oo(t) {
2055
+ t.domObserver.stop();
2056
+ for (let e in t.input.eventHandlers)
2057
+ t.dom.removeEventListener(e, t.input.eventHandlers[e]);
2058
+ clearTimeout(t.input.composingTimeout), clearTimeout(t.input.lastIOSEnterFallbackTimeout);
2059
+ }
2060
+ function Ze(t) {
2061
+ t.someProp("handleDOMEvents", (e) => {
2062
+ for (let n in e)
2063
+ t.input.eventHandlers[n] || t.dom.addEventListener(n, t.input.eventHandlers[n] = (o) => tt(t, o));
2064
+ });
2065
+ }
2066
+ function tt(t, e) {
2067
+ return t.someProp("handleDOMEvents", (n) => {
2068
+ let o = n[e.type];
2069
+ return o ? o(t, e) || e.defaultPrevented : !1;
2070
+ });
2071
+ }
2072
+ function Mo(t, e) {
2073
+ if (!e.bubbles)
2074
+ return !0;
2075
+ if (e.defaultPrevented)
2076
+ return !1;
2077
+ for (let n = e.target; n != t.dom; n = n.parentNode)
2078
+ if (!n || n.nodeType == 11 || n.pmViewDesc && n.pmViewDesc.stopEvent(e))
2079
+ return !1;
2080
+ return !0;
2081
+ }
2082
+ function xo(t, e) {
2083
+ !tt(t, e) && T[e.type] && (t.editable || !(e.type in A)) && T[e.type](t, e);
2084
+ }
2085
+ A.keydown = (t, e) => {
2086
+ let n = e;
2087
+ if (t.input.shiftKey = n.keyCode == 16 || n.shiftKey, !fn(t, n) && (t.input.lastKeyCode = n.keyCode, t.input.lastKeyCodeTime = Date.now(), !(H && M && n.keyCode == 13)))
2088
+ if (n.keyCode != 229 && t.domObserver.forceFlush(), pe && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey) {
2089
+ let o = Date.now();
2090
+ t.input.lastIOSEnter = o, t.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
2091
+ t.input.lastIOSEnter == o && (t.someProp("handleKeyDown", (i) => i(t, ee(13, "Enter"))), t.input.lastIOSEnter = 0);
2092
+ }, 200);
2093
+ } else t.someProp("handleKeyDown", (o) => o(t, n)) || uo(t, n) ? n.preventDefault() : X(t, "key");
2094
+ };
2095
+ A.keyup = (t, e) => {
2096
+ e.keyCode == 16 && (t.input.shiftKey = !1);
2097
+ };
2098
+ A.keypress = (t, e) => {
2099
+ let n = e;
2100
+ if (fn(t, n) || !n.charCode || n.ctrlKey && !n.altKey || R && n.metaKey)
2101
+ return;
2102
+ if (t.someProp("handleKeyPress", (i) => i(t, n))) {
2103
+ n.preventDefault();
2104
+ return;
2105
+ }
2106
+ let o = t.state.selection;
2107
+ if (!(o instanceof x) || !o.$from.sameParent(o.$to)) {
2108
+ let i = String.fromCharCode(n.charCode), s = () => t.state.tr.insertText(i).scrollIntoView();
2109
+ !/[\r\n]/.test(i) && !t.someProp("handleTextInput", (r) => r(t, o.$from.pos, o.$to.pos, i, s)) && t.dispatch(s()), n.preventDefault();
2110
+ }
2111
+ };
2112
+ function Fe(t) {
2113
+ return { left: t.clientX, top: t.clientY };
2114
+ }
2115
+ function ko(t, e) {
2116
+ let n = e.x - t.clientX, o = e.y - t.clientY;
2117
+ return n * n + o * o < 100;
2118
+ }
2119
+ function nt(t, e, n, o, i) {
2120
+ if (o == -1)
2121
+ return !1;
2122
+ let s = t.state.doc.resolve(o);
2123
+ for (let r = s.depth + 1; r > 0; r--)
2124
+ if (t.someProp(e, (l) => r > s.depth ? l(t, n, s.nodeAfter, s.before(r), i, !0) : l(t, n, s.node(r), s.before(r), i, !1)))
2125
+ return !0;
2126
+ return !1;
2127
+ }
2128
+ function fe(t, e, n) {
2129
+ if (t.focused || t.focus(), t.state.selection.eq(e))
2130
+ return;
2131
+ let o = t.state.tr.setSelection(e);
2132
+ o.setMeta("pointer", !0), t.dispatch(o);
2133
+ }
2134
+ function To(t, e) {
2135
+ if (e == -1)
2136
+ return !1;
2137
+ let n = t.state.doc.resolve(e), o = n.nodeAfter;
2138
+ return o && o.isAtom && D.isSelectable(o) ? (fe(t, new D(n)), !0) : !1;
2139
+ }
2140
+ function Ao(t, e) {
2141
+ if (e == -1)
2142
+ return !1;
2143
+ let n = t.state.selection, o, i;
2144
+ n instanceof D && (o = n.node);
2145
+ let s = t.state.doc.resolve(e);
2146
+ for (let r = s.depth + 1; r > 0; r--) {
2147
+ let l = r > s.depth ? s.nodeAfter : s.node(r);
2148
+ if (D.isSelectable(l)) {
2149
+ o && n.$from.depth > 0 && r >= n.$from.depth && s.before(n.$from.depth + 1) == n.$from.pos ? i = s.before(n.$from.depth) : i = s.before(r);
2150
+ break;
2151
+ }
2152
+ }
2153
+ return i != null ? (fe(t, D.create(t.state.doc, i)), !0) : !1;
2154
+ }
2155
+ function Eo(t, e, n, o, i) {
2156
+ return nt(t, "handleClickOn", e, n, o) || t.someProp("handleClick", (s) => s(t, e, o)) || (i ? Ao(t, n) : To(t, n));
2157
+ }
2158
+ function Po(t, e, n, o) {
2159
+ return nt(t, "handleDoubleClickOn", e, n, o) || t.someProp("handleDoubleClick", (i) => i(t, e, o));
2160
+ }
2161
+ function Vo(t, e, n, o) {
2162
+ return nt(t, "handleTripleClickOn", e, n, o) || t.someProp("handleTripleClick", (i) => i(t, e, o)) || Ro(t, n, o);
2163
+ }
2164
+ function Ro(t, e, n) {
2165
+ if (n.button != 0)
2166
+ return !1;
2167
+ let o = t.state.doc;
2168
+ if (e == -1)
2169
+ return o.inlineContent ? (fe(t, x.create(o, 0, o.content.size)), !0) : !1;
2170
+ let i = o.resolve(e);
2171
+ for (let s = i.depth + 1; s > 0; s--) {
2172
+ let r = s > i.depth ? i.nodeAfter : i.node(s), l = i.before(s);
2173
+ if (r.inlineContent)
2174
+ fe(t, x.create(o, l + 1, l + 1 + r.content.size));
2175
+ else if (D.isSelectable(r))
2176
+ fe(t, D.create(o, l));
2177
+ else
2178
+ continue;
2179
+ return !0;
2180
+ }
2181
+ }
2182
+ function ot(t) {
2183
+ return Ee(t);
2184
+ }
2185
+ const dn = R ? "metaKey" : "ctrlKey";
2186
+ T.mousedown = (t, e) => {
2187
+ let n = e;
2188
+ t.input.shiftKey = n.shiftKey;
2189
+ let o = ot(t), i = Date.now(), s = "singleClick";
2190
+ i - t.input.lastClick.time < 500 && ko(n, t.input.lastClick) && !n[dn] && t.input.lastClick.button == n.button && (t.input.lastClick.type == "singleClick" ? s = "doubleClick" : t.input.lastClick.type == "doubleClick" && (s = "tripleClick")), t.input.lastClick = { time: i, x: n.clientX, y: n.clientY, type: s, button: n.button };
2191
+ let r = t.posAtCoords(Fe(n));
2192
+ r && (s == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new Bo(t, r, n, !!o)) : (s == "doubleClick" ? Po : Vo)(t, r.pos, r.inside, n) ? n.preventDefault() : X(t, "pointer"));
2193
+ };
2194
+ class Bo {
2195
+ constructor(e, n, o, i) {
2196
+ this.view = e, this.pos = n, this.event = o, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!o[dn], this.allowDefault = o.shiftKey;
2197
+ let s, r;
2198
+ if (n.inside > -1)
2199
+ s = e.state.doc.nodeAt(n.inside), r = n.inside;
2200
+ else {
2201
+ let d = e.state.doc.resolve(n.pos);
2202
+ s = d.parent, r = d.depth ? d.before() : 0;
2203
+ }
2204
+ const l = i ? null : o.target, a = l ? e.docView.nearestDesc(l, !0) : null;
2205
+ this.target = a && a.dom.nodeType == 1 ? a.dom : null;
2206
+ let { selection: c } = e.state;
2207
+ (o.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof D && c.from <= r && c.to > r) && (this.mightDrag = {
2208
+ node: s,
2209
+ pos: r,
2210
+ addAttr: !!(this.target && !this.target.draggable),
2211
+ setUneditable: !!(this.target && L && !this.target.hasAttribute("contentEditable"))
2212
+ }), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
2213
+ this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
2214
+ }, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), X(e, "pointer");
2215
+ }
2216
+ done() {
2217
+ this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => W(this.view)), this.view.input.mouseDown = null;
2218
+ }
2219
+ up(e) {
2220
+ if (this.done(), !this.view.dom.contains(e.target))
2221
+ return;
2222
+ let n = this.pos;
2223
+ this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(Fe(e))), this.updateAllowDefault(e), this.allowDefault || !n ? X(this.view, "pointer") : Eo(this.view, n.pos, n.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
2224
+ k && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
2225
+ // cursor, but still report that the node is selected
2226
+ // when asked through getSelection. You'll then get a
2227
+ // situation where clicking at the point where that
2228
+ // (hidden) cursor is doesn't change the selection, and
2229
+ // thus doesn't get a reaction from ProseMirror. This
2230
+ // works around that.
2231
+ M && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (fe(this.view, he.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) : X(this.view, "pointer");
2232
+ }
2233
+ move(e) {
2234
+ this.updateAllowDefault(e), X(this.view, "pointer"), e.buttons == 0 && this.done();
2235
+ }
2236
+ updateAllowDefault(e) {
2237
+ !this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
2238
+ }
2239
+ }
2240
+ T.touchstart = (t) => {
2241
+ t.input.lastTouch = Date.now(), ot(t), X(t, "pointer");
2242
+ };
2243
+ T.touchmove = (t) => {
2244
+ t.input.lastTouch = Date.now(), X(t, "pointer");
2245
+ };
2246
+ T.contextmenu = (t) => ot(t);
2247
+ function fn(t, e) {
2248
+ return t.composing ? !0 : k && Math.abs(e.timeStamp - t.input.compositionEndedAt) < 500 ? (t.input.compositionEndedAt = -2e8, !0) : !1;
2249
+ }
2250
+ const Io = H ? 5e3 : -1;
2251
+ A.compositionstart = A.compositionupdate = (t) => {
2252
+ if (!t.composing) {
2253
+ t.domObserver.flush();
2254
+ let { state: e } = t, n = e.selection.$to;
2255
+ if (e.selection instanceof x && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((o) => o.type.spec.inclusive === !1)))
2256
+ t.markCursor = t.state.storedMarks || n.marks(), Ee(t, !0), t.markCursor = null;
2257
+ else if (Ee(t, !e.selection.empty), L && e.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
2258
+ let o = t.domSelectionRange();
2259
+ for (let i = o.focusNode, s = o.focusOffset; i && i.nodeType == 1 && s != 0; ) {
2260
+ let r = s < 0 ? i.lastChild : i.childNodes[s - 1];
2261
+ if (!r)
2262
+ break;
2263
+ if (r.nodeType == 3) {
2264
+ let l = t.domSelection();
2265
+ l && l.collapse(r, r.nodeValue.length);
2266
+ break;
2267
+ } else
2268
+ i = r, s = -1;
2269
+ }
2270
+ }
2271
+ t.input.composing = !0;
2272
+ }
2273
+ hn(t, Io);
2274
+ };
2275
+ A.compositionend = (t, e) => {
2276
+ t.composing && (t.input.composing = !1, t.input.compositionEndedAt = e.timeStamp, t.input.compositionPendingChanges = t.domObserver.pendingRecords().length ? t.input.compositionID : 0, t.input.compositionNode = null, t.input.compositionPendingChanges && Promise.resolve().then(() => t.domObserver.flush()), t.input.compositionID++, hn(t, 20));
2277
+ };
2278
+ function hn(t, e) {
2279
+ clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() => Ee(t), e));
2280
+ }
2281
+ function un(t) {
2282
+ for (t.composing && (t.input.composing = !1, t.input.compositionEndedAt = zo()); t.input.compositionNodes.length > 0; )
2283
+ t.input.compositionNodes.pop().markParentsDirty();
2284
+ }
2285
+ function Fo(t) {
2286
+ let e = t.domSelectionRange();
2287
+ if (!e.focusNode)
2288
+ return null;
2289
+ let n = kn(e.focusNode, e.focusOffset), o = Tn(e.focusNode, e.focusOffset);
2290
+ if (n && o && n != o) {
2291
+ let i = o.pmViewDesc, s = t.domObserver.lastChangedTextNode;
2292
+ if (n == s || o == s)
2293
+ return s;
2294
+ if (!i || !i.isText(o.nodeValue))
2295
+ return o;
2296
+ if (t.input.compositionNode == o) {
2297
+ let r = n.pmViewDesc;
2298
+ if (!(!r || !r.isText(n.nodeValue)))
2299
+ return o;
2300
+ }
2301
+ }
2302
+ return n || o;
2303
+ }
2304
+ function zo() {
2305
+ let t = document.createEvent("Event");
2306
+ return t.initEvent("event", !0, !0), t.timeStamp;
2307
+ }
2308
+ function Ee(t, e = !1) {
2309
+ if (!(H && t.domObserver.flushingSoon >= 0)) {
2310
+ if (t.domObserver.forceFlush(), un(t), e || t.docView && t.docView.dirty) {
2311
+ let n = we(t), o = t.state.selection;
2312
+ return n && !n.eq(o) ? t.dispatch(t.state.tr.setSelection(n)) : (t.markCursor || e) && !o.$from.node(o.$from.sharedDepth(o.to)).inlineContent ? t.dispatch(t.state.tr.deleteSelection()) : t.updateState(t.state), !0;
2313
+ }
2314
+ return !1;
2315
+ }
2316
+ }
2317
+ function Lo(t, e) {
2318
+ if (!t.dom.parentNode)
2319
+ return;
2320
+ let n = t.dom.parentNode.appendChild(document.createElement("div"));
2321
+ n.appendChild(e), n.style.cssText = "position: fixed; left: -10000px; top: 10px";
2322
+ let o = getSelection(), i = document.createRange();
2323
+ i.selectNodeContents(e), t.dom.blur(), o.removeAllRanges(), o.addRange(i), setTimeout(() => {
2324
+ n.parentNode && n.parentNode.removeChild(n), t.focus();
2325
+ }, 50);
2326
+ }
2327
+ const De = P && Z < 15 || pe && Rn < 604;
2328
+ T.copy = A.cut = (t, e) => {
2329
+ let n = e, o = t.state.selection, i = n.type == "cut";
2330
+ if (o.empty)
2331
+ return;
2332
+ let s = De ? null : n.clipboardData, r = o.content(), { dom: l, text: a } = et(t, r);
2333
+ s ? (n.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Lo(t, l), i && t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
2334
+ };
2335
+ function $o(t) {
2336
+ return t.openStart == 0 && t.openEnd == 0 && t.content.childCount == 1 ? t.content.firstChild : null;
2337
+ }
2338
+ function qo(t, e) {
2339
+ if (!t.dom.parentNode)
2340
+ return;
2341
+ let n = t.input.shiftKey || t.state.selection.$from.parent.type.spec.code, o = t.dom.parentNode.appendChild(document.createElement(n ? "textarea" : "div"));
2342
+ n || (o.contentEditable = "true"), o.style.cssText = "position: fixed; left: -10000px; top: 10px", o.focus();
2343
+ let i = t.input.shiftKey && t.input.lastKeyCode != 45;
2344
+ setTimeout(() => {
2345
+ t.focus(), o.parentNode && o.parentNode.removeChild(o), n ? Ne(t, o.value, null, i, e) : Ne(t, o.textContent, o.innerHTML, i, e);
2346
+ }, 50);
2347
+ }
2348
+ function Ne(t, e, n, o, i) {
2349
+ let s = on(t, e, n, o, t.state.selection.$from);
2350
+ if (t.someProp("handlePaste", (a) => a(t, i, s || J.empty)))
2351
+ return !0;
2352
+ if (!s)
2353
+ return !1;
2354
+ let r = $o(s), l = r ? t.state.tr.replaceSelectionWith(r, o) : t.state.tr.replaceSelection(s);
2355
+ return t.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
2356
+ }
2357
+ function pn(t) {
2358
+ let e = t.getData("text/plain") || t.getData("Text");
2359
+ if (e)
2360
+ return e;
2361
+ let n = t.getData("text/uri-list");
2362
+ return n ? n.replace(/\r?\n/g, " ") : "";
2363
+ }
2364
+ A.paste = (t, e) => {
2365
+ let n = e;
2366
+ if (t.composing && !H)
2367
+ return;
2368
+ let o = De ? null : n.clipboardData, i = t.input.shiftKey && t.input.lastKeyCode != 45;
2369
+ o && Ne(t, pn(o), o.getData("text/html"), i, n) ? n.preventDefault() : qo(t, n);
2370
+ };
2371
+ class mn {
2372
+ constructor(e, n, o) {
2373
+ this.slice = e, this.move = n, this.node = o;
2374
+ }
2375
+ }
2376
+ const Ko = R ? "altKey" : "ctrlKey";
2377
+ function gn(t, e) {
2378
+ let n = t.someProp("dragCopies", (o) => !o(e));
2379
+ return n ?? !e[Ko];
2380
+ }
2381
+ T.dragstart = (t, e) => {
2382
+ let n = e, o = t.input.mouseDown;
2383
+ if (o && o.done(), !n.dataTransfer)
2384
+ return;
2385
+ let i = t.state.selection, s = i.empty ? null : t.posAtCoords(Fe(n)), r;
2386
+ if (!(s && s.pos >= i.from && s.pos <= (i instanceof D ? i.to - 1 : i.to))) {
2387
+ if (o && o.mightDrag)
2388
+ r = D.create(t.state.doc, o.mightDrag.pos);
2389
+ else if (n.target && n.target.nodeType == 1) {
2390
+ let f = t.docView.nearestDesc(n.target, !0);
2391
+ f && f.node.type.spec.draggable && f != t.docView && (r = D.create(t.state.doc, f.posBefore));
2392
+ }
2393
+ }
2394
+ let l = (r || t.state.selection).content(), { dom: a, text: c, slice: d } = et(t, l);
2395
+ (!n.dataTransfer.files.length || !M || Ht > 120) && n.dataTransfer.clearData(), n.dataTransfer.setData(De ? "Text" : "text/html", a.innerHTML), n.dataTransfer.effectAllowed = "copyMove", De || n.dataTransfer.setData("text/plain", c), t.dragging = new mn(d, gn(t, n), r);
2396
+ };
2397
+ T.dragend = (t) => {
2398
+ let e = t.dragging;
2399
+ window.setTimeout(() => {
2400
+ t.dragging == e && (t.dragging = null);
2401
+ }, 50);
2402
+ };
2403
+ A.dragover = A.dragenter = (t, e) => e.preventDefault();
2404
+ A.drop = (t, e) => {
2405
+ let n = e, o = t.dragging;
2406
+ if (t.dragging = null, !n.dataTransfer)
2407
+ return;
2408
+ let i = t.posAtCoords(Fe(n));
2409
+ if (!i)
2410
+ return;
2411
+ let s = t.state.doc.resolve(i.pos), r = o && o.slice;
2412
+ r ? t.someProp("transformPasted", (h) => {
2413
+ r = h(r, t);
2414
+ }) : r = on(t, pn(n.dataTransfer), De ? null : n.dataTransfer.getData("text/html"), !1, s);
2415
+ let l = !!(o && gn(t, n));
2416
+ if (t.someProp("handleDrop", (h) => h(t, n, r || J.empty, l))) {
2417
+ n.preventDefault();
2418
+ return;
2419
+ }
2420
+ if (!r)
2421
+ return;
2422
+ n.preventDefault();
2423
+ let a = r ? On(t.state.doc, s.pos, r) : s.pos;
2424
+ a == null && (a = s.pos);
2425
+ let c = t.state.tr;
2426
+ if (l) {
2427
+ let { node: h } = o;
2428
+ h ? h.replace(c) : c.deleteSelection();
2429
+ }
2430
+ let d = c.mapping.map(a), f = r.openStart == 0 && r.openEnd == 0 && r.content.childCount == 1, u = c.doc;
2431
+ if (f ? c.replaceRangeWith(d, d, r.content.firstChild) : c.replaceRange(d, d, r), c.doc.eq(u))
2432
+ return;
2433
+ let p = c.doc.resolve(d);
2434
+ if (f && D.isSelectable(r.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(r.content.firstChild))
2435
+ c.setSelection(new D(p));
2436
+ else {
2437
+ let h = c.mapping.map(a);
2438
+ c.mapping.maps[c.mapping.maps.length - 1].forEach((g, m, y, V) => h = V), c.setSelection(ve(t, p, c.doc.resolve(h)));
2439
+ }
2440
+ t.focus(), t.dispatch(c.setMeta("uiEvent", "drop"));
2441
+ };
2442
+ T.focus = (t) => {
2443
+ t.input.lastFocus = Date.now(), t.focused || (t.domObserver.stop(), t.dom.classList.add("ProseMirror-focused"), t.domObserver.start(), t.focused = !0, setTimeout(() => {
2444
+ t.docView && t.hasFocus() && !t.domObserver.currentSelection.eq(t.domSelectionRange()) && W(t);
2445
+ }, 20));
2446
+ };
2447
+ T.blur = (t, e) => {
2448
+ let n = e;
2449
+ t.focused && (t.domObserver.stop(), t.dom.classList.remove("ProseMirror-focused"), t.domObserver.start(), n.relatedTarget && t.dom.contains(n.relatedTarget) && t.domObserver.currentSelection.clear(), t.focused = !1);
2450
+ };
2451
+ T.beforeinput = (t, e) => {
2452
+ if (M && H && e.inputType == "deleteContentBackward") {
2453
+ t.domObserver.flushSoon();
2454
+ let { domChangeCount: o } = t.input;
2455
+ setTimeout(() => {
2456
+ if (t.input.domChangeCount != o || (t.dom.blur(), t.focus(), t.someProp("handleKeyDown", (s) => s(t, ee(8, "Backspace")))))
2457
+ return;
2458
+ let { $cursor: i } = t.state.selection;
2459
+ i && i.pos > 0 && t.dispatch(t.state.tr.delete(i.pos - 1, i.pos).scrollIntoView());
2460
+ }, 50);
2461
+ }
2462
+ };
2463
+ for (let t in A)
2464
+ T[t] = A[t];
2465
+ function Se(t, e) {
2466
+ if (t == e)
2467
+ return !0;
2468
+ for (let n in t)
2469
+ if (t[n] !== e[n])
2470
+ return !1;
2471
+ for (let n in e)
2472
+ if (!(n in t))
2473
+ return !1;
2474
+ return !0;
2475
+ }
2476
+ class Pe {
2477
+ constructor(e, n) {
2478
+ this.toDOM = e, this.spec = n || oe, this.side = this.spec.side || 0;
2479
+ }
2480
+ map(e, n, o, i) {
2481
+ let { pos: s, deleted: r } = e.mapResult(n.from + i, this.side < 0 ? -1 : 1);
2482
+ return r ? null : new F(s - o, s - o, this);
2483
+ }
2484
+ valid() {
2485
+ return !0;
2486
+ }
2487
+ eq(e) {
2488
+ return this == e || e instanceof Pe && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Se(this.spec, e.spec));
2489
+ }
2490
+ destroy(e) {
2491
+ this.spec.destroy && this.spec.destroy(e);
2492
+ }
2493
+ }
2494
+ class w {
2495
+ constructor(e, n) {
2496
+ this.attrs = e, this.spec = n || oe;
2497
+ }
2498
+ map(e, n, o, i) {
2499
+ let s = e.map(n.from + i, this.spec.inclusiveStart ? -1 : 1) - o, r = e.map(n.to + i, this.spec.inclusiveEnd ? 1 : -1) - o;
2500
+ return s >= r ? null : new F(s, r, this);
2501
+ }
2502
+ valid(e, n) {
2503
+ return n.from < n.to;
2504
+ }
2505
+ eq(e) {
2506
+ return this == e || e instanceof w && Se(this.attrs, e.attrs) && Se(this.spec, e.spec);
2507
+ }
2508
+ static is(e) {
2509
+ return e.type instanceof w;
2510
+ }
2511
+ destroy() {
2512
+ }
2513
+ }
2514
+ class it {
2515
+ constructor(e, n) {
2516
+ this.attrs = e, this.spec = n || oe;
2517
+ }
2518
+ map(e, n, o, i) {
2519
+ let s = e.mapResult(n.from + i, 1);
2520
+ if (s.deleted)
2521
+ return null;
2522
+ let r = e.mapResult(n.to + i, -1);
2523
+ return r.deleted || r.pos <= s.pos ? null : new F(s.pos - o, r.pos - o, this);
2524
+ }
2525
+ valid(e, n) {
2526
+ let { index: o, offset: i } = e.content.findIndex(n.from), s;
2527
+ return i == n.from && !(s = e.child(o)).isText && i + s.nodeSize == n.to;
2528
+ }
2529
+ eq(e) {
2530
+ return this == e || e instanceof it && Se(this.attrs, e.attrs) && Se(this.spec, e.spec);
2531
+ }
2532
+ destroy() {
2533
+ }
2534
+ }
2535
+ class F {
2536
+ /**
2537
+ @internal
2538
+ */
2539
+ constructor(e, n, o) {
2540
+ this.from = e, this.to = n, this.type = o;
2541
+ }
2542
+ /**
2543
+ @internal
2544
+ */
2545
+ copy(e, n) {
2546
+ return new F(e, n, this.type);
2547
+ }
2548
+ /**
2549
+ @internal
2550
+ */
2551
+ eq(e, n = 0) {
2552
+ return this.type.eq(e.type) && this.from + n == e.from && this.to + n == e.to;
2553
+ }
2554
+ /**
2555
+ @internal
2556
+ */
2557
+ map(e, n, o) {
2558
+ return this.type.map(e, this, n, o);
2559
+ }
2560
+ /**
2561
+ Creates a widget decoration, which is a DOM node that's shown in
2562
+ the document at the given position. It is recommended that you
2563
+ delay rendering the widget by passing a function that will be
2564
+ called when the widget is actually drawn in a view, but you can
2565
+ also directly pass a DOM node. `getPos` can be used to find the
2566
+ widget's current document position.
2567
+ */
2568
+ static widget(e, n, o) {
2569
+ return new F(e, e, new Pe(n, o));
2570
+ }
2571
+ /**
2572
+ Creates an inline decoration, which adds the given attributes to
2573
+ each inline node between `from` and `to`.
2574
+ */
2575
+ static inline(e, n, o, i) {
2576
+ return new F(e, n, new w(o, i));
2577
+ }
2578
+ /**
2579
+ Creates a node decoration. `from` and `to` should point precisely
2580
+ before and after a node in the document. That node, and only that
2581
+ node, will receive the given attributes.
2582
+ */
2583
+ static node(e, n, o, i) {
2584
+ return new F(e, n, new it(o, i));
2585
+ }
2586
+ /**
2587
+ The spec provided when creating this decoration. Can be useful
2588
+ if you've stored extra information in that object.
2589
+ */
2590
+ get spec() {
2591
+ return this.type.spec;
2592
+ }
2593
+ /**
2594
+ @internal
2595
+ */
2596
+ get inline() {
2597
+ return this.type instanceof w;
2598
+ }
2599
+ /**
2600
+ @internal
2601
+ */
2602
+ get widget() {
2603
+ return this.type instanceof Pe;
2604
+ }
2605
+ }
2606
+ const de = [], oe = {};
2607
+ class S {
2608
+ /**
2609
+ @internal
2610
+ */
2611
+ constructor(e, n) {
2612
+ this.local = e.length ? e : de, this.children = n.length ? n : de;
2613
+ }
2614
+ /**
2615
+ Create a set of decorations, using the structure of the given
2616
+ document. This will consume (modify) the `decorations` array, so
2617
+ you must make a copy if you want need to preserve that.
2618
+ */
2619
+ static create(e, n) {
2620
+ return n.length ? Ve(n, e, 0, oe) : O;
2621
+ }
2622
+ /**
2623
+ Find all decorations in this set which touch the given range
2624
+ (including decorations that start or end directly at the
2625
+ boundaries) and match the given predicate on their spec. When
2626
+ `start` and `end` are omitted, all decorations in the set are
2627
+ considered. When `predicate` isn't given, all decorations are
2628
+ assumed to match.
2629
+ */
2630
+ find(e, n, o) {
2631
+ let i = [];
2632
+ return this.findInner(e ?? 0, n ?? 1e9, i, 0, o), i;
2633
+ }
2634
+ findInner(e, n, o, i, s) {
2635
+ for (let r = 0; r < this.local.length; r++) {
2636
+ let l = this.local[r];
2637
+ l.from <= n && l.to >= e && (!s || s(l.spec)) && o.push(l.copy(l.from + i, l.to + i));
2638
+ }
2639
+ for (let r = 0; r < this.children.length; r += 3)
2640
+ if (this.children[r] < n && this.children[r + 1] > e) {
2641
+ let l = this.children[r] + 1;
2642
+ this.children[r + 2].findInner(e - l, n - l, o, i + l, s);
2643
+ }
2644
+ }
2645
+ /**
2646
+ Map the set of decorations in response to a change in the
2647
+ document.
2648
+ */
2649
+ map(e, n, o) {
2650
+ return this == O || e.maps.length == 0 ? this : this.mapInner(e, n, 0, 0, o || oe);
2651
+ }
2652
+ /**
2653
+ @internal
2654
+ */
2655
+ mapInner(e, n, o, i, s) {
2656
+ let r;
2657
+ for (let l = 0; l < this.local.length; l++) {
2658
+ let a = this.local[l].map(e, o, i);
2659
+ a && a.type.valid(n, a) ? (r || (r = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
2660
+ }
2661
+ return this.children.length ? Ho(this.children, r || [], e, n, o, i, s) : r ? new S(r.sort(ie), de) : O;
2662
+ }
2663
+ /**
2664
+ Add the given array of decorations to the ones in the set,
2665
+ producing a new set. Consumes the `decorations` array. Needs
2666
+ access to the current document to create the appropriate tree
2667
+ structure.
2668
+ */
2669
+ add(e, n) {
2670
+ return n.length ? this == O ? S.create(e, n) : this.addInner(e, n, 0) : this;
2671
+ }
2672
+ addInner(e, n, o) {
2673
+ let i, s = 0;
2674
+ e.forEach((l, a) => {
2675
+ let c = a + o, d;
2676
+ if (d = bn(n, l, c)) {
2677
+ for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
2678
+ s += 3;
2679
+ i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Ve(d, l, c + 1, oe)), s += 3;
2680
+ }
2681
+ });
2682
+ let r = yn(s ? Dn(n) : n, -o);
2683
+ for (let l = 0; l < r.length; l++)
2684
+ r[l].type.valid(e, r[l]) || r.splice(l--, 1);
2685
+ return new S(r.length ? this.local.concat(r).sort(ie) : this.local, i || this.children);
2686
+ }
2687
+ /**
2688
+ Create a new set that contains the decorations in this set, minus
2689
+ the ones in the given array.
2690
+ */
2691
+ remove(e) {
2692
+ return e.length == 0 || this == O ? this : this.removeInner(e, 0);
2693
+ }
2694
+ removeInner(e, n) {
2695
+ let o = this.children, i = this.local;
2696
+ for (let s = 0; s < o.length; s += 3) {
2697
+ let r, l = o[s] + n, a = o[s + 1] + n;
2698
+ for (let d = 0, f; d < e.length; d++)
2699
+ (f = e[d]) && f.from > l && f.to < a && (e[d] = null, (r || (r = [])).push(f));
2700
+ if (!r)
2701
+ continue;
2702
+ o == this.children && (o = this.children.slice());
2703
+ let c = o[s + 2].removeInner(r, l + 1);
2704
+ c != O ? o[s + 2] = c : (o.splice(s, 3), s -= 3);
2705
+ }
2706
+ if (i.length) {
2707
+ for (let s = 0, r; s < e.length; s++)
2708
+ if (r = e[s])
2709
+ for (let l = 0; l < i.length; l++)
2710
+ i[l].eq(r, n) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
2711
+ }
2712
+ return o == this.children && i == this.local ? this : i.length || o.length ? new S(i, o) : O;
2713
+ }
2714
+ forChild(e, n) {
2715
+ if (this == O)
2716
+ return this;
2717
+ if (n.isLeaf)
2718
+ return S.empty;
2719
+ let o, i;
2720
+ for (let l = 0; l < this.children.length; l += 3)
2721
+ if (this.children[l] >= e) {
2722
+ this.children[l] == e && (o = this.children[l + 2]);
2723
+ break;
2724
+ }
2725
+ let s = e + 1, r = s + n.content.size;
2726
+ for (let l = 0; l < this.local.length; l++) {
2727
+ let a = this.local[l];
2728
+ if (a.from < r && a.to > s && a.type instanceof w) {
2729
+ let c = Math.max(s, a.from) - s, d = Math.min(r, a.to) - s;
2730
+ c < d && (i || (i = [])).push(a.copy(c, d));
2731
+ }
2732
+ }
2733
+ if (i) {
2734
+ let l = new S(i.sort(ie), de);
2735
+ return o ? new G([l, o]) : l;
2736
+ }
2737
+ return o || O;
2738
+ }
2739
+ /**
2740
+ @internal
2741
+ */
2742
+ eq(e) {
2743
+ if (this == e)
2744
+ return !0;
2745
+ if (!(e instanceof S) || this.local.length != e.local.length || this.children.length != e.children.length)
2746
+ return !1;
2747
+ for (let n = 0; n < this.local.length; n++)
2748
+ if (!this.local[n].eq(e.local[n]))
2749
+ return !1;
2750
+ for (let n = 0; n < this.children.length; n += 3)
2751
+ if (this.children[n] != e.children[n] || this.children[n + 1] != e.children[n + 1] || !this.children[n + 2].eq(e.children[n + 2]))
2752
+ return !1;
2753
+ return !0;
2754
+ }
2755
+ /**
2756
+ @internal
2757
+ */
2758
+ locals(e) {
2759
+ return st(this.localsInner(e));
2760
+ }
2761
+ /**
2762
+ @internal
2763
+ */
2764
+ localsInner(e) {
2765
+ if (this == O)
2766
+ return de;
2767
+ if (e.inlineContent || !this.local.some(w.is))
2768
+ return this.local;
2769
+ let n = [];
2770
+ for (let o = 0; o < this.local.length; o++)
2771
+ this.local[o].type instanceof w || n.push(this.local[o]);
2772
+ return n;
2773
+ }
2774
+ forEachSet(e) {
2775
+ e(this);
2776
+ }
2777
+ }
2778
+ S.empty = new S([], []);
2779
+ S.removeOverlap = st;
2780
+ const O = S.empty;
2781
+ class G {
2782
+ constructor(e) {
2783
+ this.members = e;
2784
+ }
2785
+ map(e, n) {
2786
+ const o = this.members.map((i) => i.map(e, n, oe));
2787
+ return G.from(o);
2788
+ }
2789
+ forChild(e, n) {
2790
+ if (n.isLeaf)
2791
+ return S.empty;
2792
+ let o = [];
2793
+ for (let i = 0; i < this.members.length; i++) {
2794
+ let s = this.members[i].forChild(e, n);
2795
+ s != O && (s instanceof G ? o = o.concat(s.members) : o.push(s));
2796
+ }
2797
+ return G.from(o);
2798
+ }
2799
+ eq(e) {
2800
+ if (!(e instanceof G) || e.members.length != this.members.length)
2801
+ return !1;
2802
+ for (let n = 0; n < this.members.length; n++)
2803
+ if (!this.members[n].eq(e.members[n]))
2804
+ return !1;
2805
+ return !0;
2806
+ }
2807
+ locals(e) {
2808
+ let n, o = !0;
2809
+ for (let i = 0; i < this.members.length; i++) {
2810
+ let s = this.members[i].localsInner(e);
2811
+ if (s.length)
2812
+ if (!n)
2813
+ n = s;
2814
+ else {
2815
+ o && (n = n.slice(), o = !1);
2816
+ for (let r = 0; r < s.length; r++)
2817
+ n.push(s[r]);
2818
+ }
2819
+ }
2820
+ return n ? st(o ? n : n.sort(ie)) : de;
2821
+ }
2822
+ // Create a group for the given array of decoration sets, or return
2823
+ // a single set when possible.
2824
+ static from(e) {
2825
+ switch (e.length) {
2826
+ case 0:
2827
+ return O;
2828
+ case 1:
2829
+ return e[0];
2830
+ default:
2831
+ return new G(e.every((n) => n instanceof S) ? e : e.reduce((n, o) => n.concat(o instanceof S ? o : o.members), []));
2832
+ }
2833
+ }
2834
+ forEachSet(e) {
2835
+ for (let n = 0; n < this.members.length; n++)
2836
+ this.members[n].forEachSet(e);
2837
+ }
2838
+ }
2839
+ function Ho(t, e, n, o, i, s, r) {
2840
+ let l = t.slice();
2841
+ for (let c = 0, d = s; c < n.maps.length; c++) {
2842
+ let f = 0;
2843
+ n.maps[c].forEach((u, p, h, g) => {
2844
+ let m = g - h - (p - u);
2845
+ for (let y = 0; y < l.length; y += 3) {
2846
+ let V = l[y + 1];
2847
+ if (V < 0 || u > V + d - f)
2848
+ continue;
2849
+ let me = l[y] + d - f;
2850
+ p >= me ? l[y + 1] = u <= me ? -2 : -1 : u >= d && m && (l[y] += m, l[y + 1] += m);
2851
+ }
2852
+ f += m;
2853
+ }), d = n.maps[c].map(d, -1);
2854
+ }
2855
+ let a = !1;
2856
+ for (let c = 0; c < l.length; c += 3)
2857
+ if (l[c + 1] < 0) {
2858
+ if (l[c + 1] == -2) {
2859
+ a = !0, l[c + 1] = -1;
2860
+ continue;
2861
+ }
2862
+ let d = n.map(t[c] + s), f = d - i;
2863
+ if (f < 0 || f >= o.content.size) {
2864
+ a = !0;
2865
+ continue;
2866
+ }
2867
+ let u = n.map(t[c + 1] + s, -1), p = u - i, { index: h, offset: g } = o.content.findIndex(f), m = o.maybeChild(h);
2868
+ if (m && g == f && g + m.nodeSize == p) {
2869
+ let y = l[c + 2].mapInner(n, m, d + 1, t[c] + s + 1, r);
2870
+ y != O ? (l[c] = f, l[c + 1] = p, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
2871
+ } else
2872
+ a = !0;
2873
+ }
2874
+ if (a) {
2875
+ let c = Wo(l, t, e, n, i, s, r), d = Ve(c, o, 0, r);
2876
+ e = d.local;
2877
+ for (let f = 0; f < l.length; f += 3)
2878
+ l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
2879
+ for (let f = 0, u = 0; f < d.children.length; f += 3) {
2880
+ let p = d.children[f];
2881
+ for (; u < l.length && l[u] < p; )
2882
+ u += 3;
2883
+ l.splice(u, 0, d.children[f], d.children[f + 1], d.children[f + 2]);
2884
+ }
2885
+ }
2886
+ return new S(e.sort(ie), l);
2887
+ }
2888
+ function yn(t, e) {
2889
+ if (!e || !t.length)
2890
+ return t;
2891
+ let n = [];
2892
+ for (let o = 0; o < t.length; o++) {
2893
+ let i = t[o];
2894
+ n.push(new F(i.from + e, i.to + e, i.type));
2895
+ }
2896
+ return n;
2897
+ }
2898
+ function Wo(t, e, n, o, i, s, r) {
2899
+ function l(a, c) {
2900
+ for (let d = 0; d < a.local.length; d++) {
2901
+ let f = a.local[d].map(o, i, c);
2902
+ f ? n.push(f) : r.onRemove && r.onRemove(a.local[d].spec);
2903
+ }
2904
+ for (let d = 0; d < a.children.length; d += 3)
2905
+ l(a.children[d + 2], a.children[d] + c + 1);
2906
+ }
2907
+ for (let a = 0; a < t.length; a += 3)
2908
+ t[a + 1] == -1 && l(t[a + 2], e[a] + s + 1);
2909
+ return n;
2910
+ }
2911
+ function bn(t, e, n) {
2912
+ if (e.isLeaf)
2913
+ return null;
2914
+ let o = n + e.nodeSize, i = null;
2915
+ for (let s = 0, r; s < t.length; s++)
2916
+ (r = t[s]) && r.from > n && r.to < o && ((i || (i = [])).push(r), t[s] = null);
2917
+ return i;
2918
+ }
2919
+ function Dn(t) {
2920
+ let e = [];
2921
+ for (let n = 0; n < t.length; n++)
2922
+ t[n] != null && e.push(t[n]);
2923
+ return e;
2924
+ }
2925
+ function Ve(t, e, n, o) {
2926
+ let i = [], s = !1;
2927
+ e.forEach((l, a) => {
2928
+ let c = bn(t, l, a + n);
2929
+ if (c) {
2930
+ s = !0;
2931
+ let d = Ve(c, l, n + a + 1, o);
2932
+ d != O && i.push(a, a + l.nodeSize, d);
2933
+ }
2934
+ });
2935
+ let r = yn(s ? Dn(t) : t, -n).sort(ie);
2936
+ for (let l = 0; l < r.length; l++)
2937
+ r[l].type.valid(e, r[l]) || (o.onRemove && o.onRemove(r[l].spec), r.splice(l--, 1));
2938
+ return r.length || i.length ? new S(r, i) : O;
2939
+ }
2940
+ function ie(t, e) {
2941
+ return t.from - e.from || t.to - e.to;
2942
+ }
2943
+ function st(t) {
2944
+ let e = t;
2945
+ for (let n = 0; n < e.length - 1; n++) {
2946
+ let o = e[n];
2947
+ if (o.from != o.to)
2948
+ for (let i = n + 1; i < e.length; i++) {
2949
+ let s = e[i];
2950
+ if (s.from == o.from) {
2951
+ s.to != o.to && (e == t && (e = t.slice()), e[i] = s.copy(s.from, o.to), At(e, i + 1, s.copy(o.to, s.to)));
2952
+ continue;
2953
+ } else {
2954
+ s.from < o.to && (e == t && (e = t.slice()), e[n] = o.copy(o.from, s.from), At(e, i, o.copy(s.from, o.to)));
2955
+ break;
2956
+ }
2957
+ }
2958
+ }
2959
+ return e;
2960
+ }
2961
+ function At(t, e, n) {
2962
+ for (; e < t.length && ie(n, t[e]) > 0; )
2963
+ e++;
2964
+ t.splice(e, 0, n);
2965
+ }
2966
+ function qe(t) {
2967
+ let e = [];
2968
+ return t.someProp("decorations", (n) => {
2969
+ let o = n(t.state);
2970
+ o && o != O && e.push(o);
2971
+ }), t.cursorWrapper && e.push(S.create(t.state.doc, [t.cursorWrapper.deco])), G.from(e);
2972
+ }
2973
+ const _o = {
2974
+ childList: !0,
2975
+ characterData: !0,
2976
+ characterDataOldValue: !0,
2977
+ attributes: !0,
2978
+ attributeOldValue: !0,
2979
+ subtree: !0
2980
+ }, jo = P && Z <= 11;
2981
+ class Uo {
2982
+ constructor() {
2983
+ this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
2984
+ }
2985
+ set(e) {
2986
+ this.anchorNode = e.anchorNode, this.anchorOffset = e.anchorOffset, this.focusNode = e.focusNode, this.focusOffset = e.focusOffset;
2987
+ }
2988
+ clear() {
2989
+ this.anchorNode = this.focusNode = null;
2990
+ }
2991
+ eq(e) {
2992
+ return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
2993
+ }
2994
+ }
2995
+ class Yo {
2996
+ constructor(e, n) {
2997
+ this.view = e, this.handleDOMChange = n, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Uo(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
2998
+ for (let i = 0; i < o.length; i++)
2999
+ this.queue.push(o[i]);
3000
+ P && Z <= 11 && o.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
3001
+ }), jo && (this.onCharData = (o) => {
3002
+ this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
3003
+ }), this.onSelectionChange = this.onSelectionChange.bind(this);
3004
+ }
3005
+ flushSoon() {
3006
+ this.flushingSoon < 0 && (this.flushingSoon = window.setTimeout(() => {
3007
+ this.flushingSoon = -1, this.flush();
3008
+ }, 20));
3009
+ }
3010
+ forceFlush() {
3011
+ this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
3012
+ }
3013
+ start() {
3014
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, _o)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
3015
+ }
3016
+ stop() {
3017
+ if (this.observer) {
3018
+ let e = this.observer.takeRecords();
3019
+ if (e.length) {
3020
+ for (let n = 0; n < e.length; n++)
3021
+ this.queue.push(e[n]);
3022
+ window.setTimeout(() => this.flush(), 20);
3023
+ }
3024
+ this.observer.disconnect();
3025
+ }
3026
+ this.onCharData && this.view.dom.removeEventListener("DOMCharacterDataModified", this.onCharData), this.disconnectSelection();
3027
+ }
3028
+ connectSelection() {
3029
+ this.view.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange);
3030
+ }
3031
+ disconnectSelection() {
3032
+ this.view.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange);
3033
+ }
3034
+ suppressSelectionUpdates() {
3035
+ this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
3036
+ }
3037
+ onSelectionChange() {
3038
+ if (Nt(this.view)) {
3039
+ if (this.suppressingSelectionUpdates)
3040
+ return W(this.view);
3041
+ if (P && Z <= 11 && !this.view.state.selection.empty) {
3042
+ let e = this.view.domSelectionRange();
3043
+ if (e.focusNode && se(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
3044
+ return this.flushSoon();
3045
+ }
3046
+ this.flush();
3047
+ }
3048
+ }
3049
+ setCurSelection() {
3050
+ this.currentSelection.set(this.view.domSelectionRange());
3051
+ }
3052
+ ignoreSelectionChange(e) {
3053
+ if (!e.focusNode)
3054
+ return !0;
3055
+ let n = /* @__PURE__ */ new Set(), o;
3056
+ for (let s = e.focusNode; s; s = ue(s))
3057
+ n.add(s);
3058
+ for (let s = e.anchorNode; s; s = ue(s))
3059
+ if (n.has(s)) {
3060
+ o = s;
3061
+ break;
3062
+ }
3063
+ let i = o && this.view.docView.nearestDesc(o);
3064
+ if (i && i.ignoreMutation({
3065
+ type: "selection",
3066
+ target: o.nodeType == 3 ? o.parentNode : o
3067
+ }))
3068
+ return this.setCurSelection(), !0;
3069
+ }
3070
+ pendingRecords() {
3071
+ if (this.observer)
3072
+ for (let e of this.observer.takeRecords())
3073
+ this.queue.push(e);
3074
+ return this.queue;
3075
+ }
3076
+ flush() {
3077
+ let { view: e } = this;
3078
+ if (!e.docView || this.flushingSoon > -1)
3079
+ return;
3080
+ let n = this.pendingRecords();
3081
+ n.length && (this.queue = []);
3082
+ let o = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(o) && Nt(e) && !this.ignoreSelectionChange(o), s = -1, r = -1, l = !1, a = [];
3083
+ if (e.editable)
3084
+ for (let d = 0; d < n.length; d++) {
3085
+ let f = this.registerMutation(n[d], a);
3086
+ f && (s = s < 0 ? f.from : Math.min(f.from, s), r = r < 0 ? f.to : Math.max(f.to, r), f.typeOver && (l = !0));
3087
+ }
3088
+ if (L && a.length) {
3089
+ let d = a.filter((f) => f.nodeName == "BR");
3090
+ if (d.length == 2) {
3091
+ let [f, u] = d;
3092
+ f.parentNode && f.parentNode.parentNode == u.parentNode ? u.remove() : f.remove();
3093
+ } else {
3094
+ let { focusNode: f } = this.currentSelection;
3095
+ for (let u of d) {
3096
+ let p = u.parentNode;
3097
+ p && p.nodeName == "LI" && (!f || Jo(e, f) != p) && u.remove();
3098
+ }
3099
+ }
3100
+ }
3101
+ let c = null;
3102
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Be(o) && (c = we(e)) && c.eq(he.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, W(e), this.currentSelection.set(o), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, r), Go(e)), this.handleDOMChange(s, r, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || W(e), this.currentSelection.set(o));
3103
+ }
3104
+ registerMutation(e, n) {
3105
+ if (n.indexOf(e.target) > -1)
3106
+ return null;
3107
+ let o = this.view.docView.nearestDesc(e.target);
3108
+ if (e.type == "attributes" && (o == this.view.docView || e.attributeName == "contenteditable" || // Firefox sometimes fires spurious events for null/empty styles
3109
+ e.attributeName == "style" && !e.oldValue && !e.target.getAttribute("style")) || !o || o.ignoreMutation(e))
3110
+ return null;
3111
+ if (e.type == "childList") {
3112
+ for (let d = 0; d < e.addedNodes.length; d++) {
3113
+ let f = e.addedNodes[d];
3114
+ n.push(f), f.nodeType == 3 && (this.lastChangedTextNode = f);
3115
+ }
3116
+ if (o.contentDOM && o.contentDOM != o.dom && !o.contentDOM.contains(e.target))
3117
+ return { from: o.posBefore, to: o.posAfter };
3118
+ let i = e.previousSibling, s = e.nextSibling;
3119
+ if (P && Z <= 11 && e.addedNodes.length)
3120
+ for (let d = 0; d < e.addedNodes.length; d++) {
3121
+ let { previousSibling: f, nextSibling: u } = e.addedNodes[d];
3122
+ (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (i = f), (!u || Array.prototype.indexOf.call(e.addedNodes, u) < 0) && (s = u);
3123
+ }
3124
+ let r = i && i.parentNode == e.target ? C(i) + 1 : 0, l = o.localPosFromDOM(e.target, r, -1), a = s && s.parentNode == e.target ? C(s) : e.target.childNodes.length, c = o.localPosFromDOM(e.target, a, 1);
3125
+ return { from: l, to: c };
3126
+ } else return e.type == "attributes" ? { from: o.posAtStart - o.border, to: o.posAtEnd + o.border } : (this.lastChangedTextNode = e.target, {
3127
+ from: o.posAtStart,
3128
+ to: o.posAtEnd,
3129
+ // An event was generated for a text change that didn't change
3130
+ // any text. Mark the dom change to fall back to assuming the
3131
+ // selection was typed over with an identical value if it can't
3132
+ // find another change.
3133
+ typeOver: e.target.nodeValue == e.oldValue
3134
+ });
3135
+ }
3136
+ }
3137
+ let Et = /* @__PURE__ */ new WeakMap(), Pt = !1;
3138
+ function Go(t) {
3139
+ if (!Et.has(t) && (Et.set(t, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace) !== -1)) {
3140
+ if (t.requiresGeckoHackNode = L, Pt)
3141
+ return;
3142
+ console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Pt = !0;
3143
+ }
3144
+ }
3145
+ function Vt(t, e) {
3146
+ let n = e.startContainer, o = e.startOffset, i = e.endContainer, s = e.endOffset, r = t.domAtPos(t.state.selection.anchor);
3147
+ return se(r.node, r.offset, i, s) && ([n, o, i, s] = [i, s, n, o]), { anchorNode: n, anchorOffset: o, focusNode: i, focusOffset: s };
3148
+ }
3149
+ function Xo(t, e) {
3150
+ if (e.getComposedRanges) {
3151
+ let i = e.getComposedRanges(t.root)[0];
3152
+ if (i)
3153
+ return Vt(t, i);
3154
+ }
3155
+ let n;
3156
+ function o(i) {
3157
+ i.preventDefault(), i.stopImmediatePropagation(), n = i.getTargetRanges()[0];
3158
+ }
3159
+ return t.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), t.dom.removeEventListener("beforeinput", o, !0), n ? Vt(t, n) : null;
3160
+ }
3161
+ function Jo(t, e) {
3162
+ for (let n = e.parentNode; n && n != t.dom; n = n.parentNode) {
3163
+ let o = t.docView.nearestDesc(n, !0);
3164
+ if (o && o.node.isBlock)
3165
+ return n;
3166
+ }
3167
+ return null;
3168
+ }
3169
+ function Zo(t, e, n) {
3170
+ let { node: o, fromOffset: i, toOffset: s, from: r, to: l } = t.docView.parseRange(e, n), a = t.domSelectionRange(), c, d = a.anchorNode;
3171
+ if (d && t.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Be(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), M && t.input.lastKeyCode === 8)
3172
+ for (let m = s; m > i; m--) {
3173
+ let y = o.childNodes[m - 1], V = y.pmViewDesc;
3174
+ if (y.nodeName == "BR" && !V) {
3175
+ s = m;
3176
+ break;
3177
+ }
3178
+ if (!V || V.size)
3179
+ break;
3180
+ }
3181
+ let f = t.state.doc, u = t.someProp("domParser") || qt.fromSchema(t.state.schema), p = f.resolve(r), h = null, g = u.parse(o, {
3182
+ topNode: p.parent,
3183
+ topMatch: p.parent.contentMatchAt(p.index()),
3184
+ topOpen: !0,
3185
+ from: i,
3186
+ to: s,
3187
+ preserveWhitespace: p.parent.type.whitespace == "pre" ? "full" : !0,
3188
+ findPositions: c,
3189
+ ruleFromNode: Qo,
3190
+ context: p
3191
+ });
3192
+ if (c && c[0].pos != null) {
3193
+ let m = c[0].pos, y = c[1] && c[1].pos;
3194
+ y == null && (y = m), h = { anchor: m + r, head: y + r };
3195
+ }
3196
+ return { doc: g, sel: h, from: r, to: l };
3197
+ }
3198
+ function Qo(t) {
3199
+ let e = t.pmViewDesc;
3200
+ if (e)
3201
+ return e.parseRule();
3202
+ if (t.nodeName == "BR" && t.parentNode) {
3203
+ if (k && /^(ul|ol)$/i.test(t.parentNode.nodeName)) {
3204
+ let n = document.createElement("div");
3205
+ return n.appendChild(document.createElement("li")), { skip: n };
3206
+ } else if (t.parentNode.lastChild == t || k && /^(tr|table)$/i.test(t.parentNode.nodeName))
3207
+ return { ignore: !0 };
3208
+ } else if (t.nodeName == "IMG" && t.getAttribute("mark-placeholder"))
3209
+ return { ignore: !0 };
3210
+ return null;
3211
+ }
3212
+ const wo = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
3213
+ function vo(t, e, n, o, i) {
3214
+ let s = t.input.compositionPendingChanges || (t.composing ? t.input.compositionID : 0);
3215
+ if (t.input.compositionPendingChanges = 0, e < 0) {
3216
+ let b = t.input.lastSelectionTime > Date.now() - 50 ? t.input.lastSelectionOrigin : null, N = we(t, b);
3217
+ if (N && !t.state.selection.eq(N)) {
3218
+ if (M && H && t.input.lastKeyCode === 13 && Date.now() - 100 < t.input.lastKeyCodeTime && t.someProp("handleKeyDown", (Nn) => Nn(t, ee(13, "Enter"))))
3219
+ return;
3220
+ let E = t.state.tr.setSelection(N);
3221
+ b == "pointer" ? E.setMeta("pointer", !0) : b == "key" && E.scrollIntoView(), s && E.setMeta("composition", s), t.dispatch(E);
3222
+ }
3223
+ return;
3224
+ }
3225
+ let r = t.state.doc.resolve(e), l = r.sharedDepth(n);
3226
+ e = r.before(l + 1), n = t.state.doc.resolve(n).after(l + 1);
3227
+ let a = t.state.selection, c = Zo(t, e, n), d = t.state.doc, f = d.slice(c.from, c.to), u, p;
3228
+ t.input.lastKeyCode === 8 && Date.now() - 100 < t.input.lastKeyCodeTime ? (u = t.state.selection.to, p = "end") : (u = t.state.selection.from, p = "start"), t.input.lastKeyCode = null;
3229
+ let h = ni(f.content, c.doc.content, c.from, u, p);
3230
+ if (h && t.input.domChangeCount++, (pe && t.input.lastIOSEnter > Date.now() - 225 || H) && i.some((b) => b.nodeType == 1 && !wo.test(b.nodeName)) && (!h || h.endA >= h.endB) && t.someProp("handleKeyDown", (b) => b(t, ee(13, "Enter")))) {
3231
+ t.input.lastIOSEnter = 0;
3232
+ return;
3233
+ }
3234
+ if (!h)
3235
+ if (o && a instanceof x && !a.empty && a.$head.sameParent(a.$anchor) && !t.composing && !(c.sel && c.sel.anchor != c.sel.head))
3236
+ h = { start: a.from, endA: a.to, endB: a.to };
3237
+ else {
3238
+ if (c.sel) {
3239
+ let b = Rt(t, t.state.doc, c.sel);
3240
+ if (b && !b.eq(t.state.selection)) {
3241
+ let N = t.state.tr.setSelection(b);
3242
+ s && N.setMeta("composition", s), t.dispatch(N);
3243
+ }
3244
+ }
3245
+ return;
3246
+ }
3247
+ t.state.selection.from < t.state.selection.to && h.start == h.endB && t.state.selection instanceof x && (h.start > t.state.selection.from && h.start <= t.state.selection.from + 2 && t.state.selection.from >= c.from ? h.start = t.state.selection.from : h.endA < t.state.selection.to && h.endA >= t.state.selection.to - 2 && t.state.selection.to <= c.to && (h.endB += t.state.selection.to - h.endA, h.endA = t.state.selection.to)), P && Z <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > c.from && c.doc.textBetween(h.start - c.from - 1, h.start - c.from + 1) == "  " && (h.start--, h.endA--, h.endB--);
3248
+ let g = c.doc.resolveNoCache(h.start - c.from), m = c.doc.resolveNoCache(h.endB - c.from), y = d.resolve(h.start), V = g.sameParent(m) && g.parent.inlineContent && y.end() >= h.endA, me;
3249
+ if ((pe && t.input.lastIOSEnter > Date.now() - 225 && (!V || i.some((b) => b.nodeName == "DIV" || b.nodeName == "P")) || !V && g.pos < c.doc.content.size && (!g.sameParent(m) || !g.parent.inlineContent) && !/\S/.test(c.doc.textBetween(g.pos, m.pos, "", "")) && (me = he.findFrom(c.doc.resolve(g.pos + 1), 1, !0)) && me.head > g.pos) && t.someProp("handleKeyDown", (b) => b(t, ee(13, "Enter")))) {
3250
+ t.input.lastIOSEnter = 0;
3251
+ return;
3252
+ }
3253
+ if (t.state.selection.anchor > h.start && ti(d, h.start, h.endA, g, m) && t.someProp("handleKeyDown", (b) => b(t, ee(8, "Backspace")))) {
3254
+ H && M && t.domObserver.suppressSelectionUpdates();
3255
+ return;
3256
+ }
3257
+ M && h.endB == h.start && (t.input.lastChromeDelete = Date.now()), H && !V && g.start() != m.start() && m.parentOffset == 0 && g.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == h.endA && (h.endB -= 2, m = c.doc.resolveNoCache(h.endB - c.from), setTimeout(() => {
3258
+ t.someProp("handleKeyDown", function(b) {
3259
+ return b(t, ee(13, "Enter"));
3260
+ });
3261
+ }, 20));
3262
+ let j = h.start, v = h.endA, xe = (b) => {
3263
+ let N = b || t.state.tr.replace(j, v, c.doc.slice(h.start - c.from, h.endB - c.from));
3264
+ if (c.sel) {
3265
+ let E = Rt(t, N.doc, c.sel);
3266
+ E && !(M && t.composing && E.empty && (h.start != h.endB || t.input.lastChromeDelete < Date.now() - 100) && (E.head == j || E.head == N.mapping.map(v) - 1) || P && E.empty && E.head == j) && N.setSelection(E);
3267
+ }
3268
+ return s && N.setMeta("composition", s), N.scrollIntoView();
3269
+ }, ke;
3270
+ if (V) {
3271
+ if (g.pos == m.pos) {
3272
+ P && Z <= 11 && g.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => W(t), 20));
3273
+ let b = xe(t.state.tr.delete(j, v)), N = d.resolve(h.start).marksAcross(d.resolve(h.endA));
3274
+ N && b.ensureMarks(N), t.dispatch(b);
3275
+ } else if (
3276
+ // Adding or removing a mark
3277
+ h.endA == h.endB && (ke = ei(g.parent.content.cut(g.parentOffset, m.parentOffset), y.parent.content.cut(y.parentOffset, h.endA - y.start())))
3278
+ ) {
3279
+ let b = xe(t.state.tr);
3280
+ ke.type == "add" ? b.addMark(j, v, ke.mark) : b.removeMark(j, v, ke.mark), t.dispatch(b);
3281
+ } else if (g.parent.child(g.index()).isText && g.index() == m.index() - (m.textOffset ? 0 : 1)) {
3282
+ let b = g.parent.textBetween(g.parentOffset, m.parentOffset), N = () => xe(t.state.tr.insertText(b, j, v));
3283
+ t.someProp("handleTextInput", (E) => E(t, j, v, b, N)) || t.dispatch(N());
3284
+ }
3285
+ } else
3286
+ t.dispatch(xe());
3287
+ }
3288
+ function Rt(t, e, n) {
3289
+ return Math.max(n.anchor, n.head) > e.content.size ? null : ve(t, e.resolve(n.anchor), e.resolve(n.head));
3290
+ }
3291
+ function ei(t, e) {
3292
+ let n = t.firstChild.marks, o = e.firstChild.marks, i = n, s = o, r, l, a;
3293
+ for (let d = 0; d < o.length; d++)
3294
+ i = o[d].removeFromSet(i);
3295
+ for (let d = 0; d < n.length; d++)
3296
+ s = n[d].removeFromSet(s);
3297
+ if (i.length == 1 && s.length == 0)
3298
+ l = i[0], r = "add", a = (d) => d.mark(l.addToSet(d.marks));
3299
+ else if (i.length == 0 && s.length == 1)
3300
+ l = s[0], r = "remove", a = (d) => d.mark(l.removeFromSet(d.marks));
3301
+ else
3302
+ return null;
3303
+ let c = [];
3304
+ for (let d = 0; d < e.childCount; d++)
3305
+ c.push(a(e.child(d)));
3306
+ if (_.from(c).eq(t))
3307
+ return { mark: l, type: r };
3308
+ }
3309
+ function ti(t, e, n, o, i) {
3310
+ if (
3311
+ // The content must have shrunk
3312
+ n - e <= i.pos - o.pos || // newEnd must point directly at or after the end of the block that newStart points into
3313
+ Ke(o, !0, !1) < i.pos
3314
+ )
3315
+ return !1;
3316
+ let s = t.resolve(e);
3317
+ if (!o.parent.isTextblock) {
3318
+ let l = s.nodeAfter;
3319
+ return l != null && n == e + l.nodeSize;
3320
+ }
3321
+ if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
3322
+ return !1;
3323
+ let r = t.resolve(Ke(s, !0, !0));
3324
+ return !r.parent.isTextblock || r.pos > n || Ke(r, !0, !1) < n ? !1 : o.parent.content.cut(o.parentOffset).eq(r.parent.content);
3325
+ }
3326
+ function Ke(t, e, n) {
3327
+ let o = t.depth, i = e ? t.end() : t.pos;
3328
+ for (; o > 0 && (e || t.indexAfter(o) == t.node(o).childCount); )
3329
+ o--, i++, e = !1;
3330
+ if (n) {
3331
+ let s = t.node(o).maybeChild(t.indexAfter(o));
3332
+ for (; s && !s.isLeaf; )
3333
+ s = s.firstChild, i++;
3334
+ }
3335
+ return i;
3336
+ }
3337
+ function ni(t, e, n, o, i) {
3338
+ let s = t.findDiffStart(e, n);
3339
+ if (s == null)
3340
+ return null;
3341
+ let { a: r, b: l } = t.findDiffEnd(e, n + t.size, n + e.size);
3342
+ if (i == "end") {
3343
+ let a = Math.max(0, s - Math.min(r, l));
3344
+ o -= r + a - s;
3345
+ }
3346
+ if (r < s && t.size < e.size) {
3347
+ let a = o <= s && o >= r ? s - o : 0;
3348
+ s -= a, s && s < e.size && Bt(e.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), l = s + (l - r), r = s;
3349
+ } else if (l < s) {
3350
+ let a = o <= s && o >= l ? s - o : 0;
3351
+ s -= a, s && s < t.size && Bt(t.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), r = s + (r - l), l = s;
3352
+ }
3353
+ return { start: s, endA: r, endB: l };
3354
+ }
3355
+ function Bt(t) {
3356
+ if (t.length != 2)
3357
+ return !1;
3358
+ let e = t.charCodeAt(0), n = t.charCodeAt(1);
3359
+ return e >= 56320 && e <= 57343 && n >= 55296 && n <= 56319;
3360
+ }
3361
+ class oi {
3362
+ /**
3363
+ Create a view. `place` may be a DOM node that the editor should
3364
+ be appended to, a function that will place it into the document,
3365
+ or an object whose `mount` property holds the node to use as the
3366
+ document container. If it is `null`, the editor will not be
3367
+ added to the document.
3368
+ */
3369
+ constructor(e, n) {
3370
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new So(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = n, this.state = n.state, this.directPlugins = n.plugins || [], this.directPlugins.forEach($t), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = zt(this), Ft(this), this.nodeViews = Lt(this), this.docView = pt(this.state.doc, It(this), qe(this), this.dom, this), this.domObserver = new Yo(this, (o, i, s, r) => vo(this, o, i, s, r)), this.domObserver.start(), Co(this), this.updatePluginViews();
3371
+ }
3372
+ /**
3373
+ Holds `true` when a
3374
+ [composition](https://w3c.github.io/uievents/#events-compositionevents)
3375
+ is active.
3376
+ */
3377
+ get composing() {
3378
+ return this.input.composing;
3379
+ }
3380
+ /**
3381
+ The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).
3382
+ */
3383
+ get props() {
3384
+ if (this._props.state != this.state) {
3385
+ let e = this._props;
3386
+ this._props = {};
3387
+ for (let n in e)
3388
+ this._props[n] = e[n];
3389
+ this._props.state = this.state;
3390
+ }
3391
+ return this._props;
3392
+ }
3393
+ /**
3394
+ Update the view's props. Will immediately cause an update to
3395
+ the DOM.
3396
+ */
3397
+ update(e) {
3398
+ e.handleDOMEvents != this._props.handleDOMEvents && Ze(this);
3399
+ let n = this._props;
3400
+ this._props = e, e.plugins && (e.plugins.forEach($t), this.directPlugins = e.plugins), this.updateStateInner(e.state, n);
3401
+ }
3402
+ /**
3403
+ Update the view by updating existing props object with the object
3404
+ given as argument. Equivalent to `view.update(Object.assign({},
3405
+ view.props, props))`.
3406
+ */
3407
+ setProps(e) {
3408
+ let n = {};
3409
+ for (let o in this._props)
3410
+ n[o] = this._props[o];
3411
+ n.state = this.state;
3412
+ for (let o in e)
3413
+ n[o] = e[o];
3414
+ this.update(n);
3415
+ }
3416
+ /**
3417
+ Update the editor's `state` prop, without touching any of the
3418
+ other props.
3419
+ */
3420
+ updateState(e) {
3421
+ this.updateStateInner(e, this._props);
3422
+ }
3423
+ updateStateInner(e, n) {
3424
+ var o;
3425
+ let i = this.state, s = !1, r = !1;
3426
+ e.storedMarks && this.composing && (un(this), r = !0), this.state = e;
3427
+ let l = i.plugins != e.plugins || this._props.plugins != n.plugins;
3428
+ if (l || this._props.plugins != n.plugins || this._props.nodeViews != n.nodeViews) {
3429
+ let p = Lt(this);
3430
+ si(p, this.nodeViews) && (this.nodeViews = p, s = !0);
3431
+ }
3432
+ (l || n.handleDOMEvents != this._props.handleDOMEvents) && Ze(this), this.editable = zt(this), Ft(this);
3433
+ let a = qe(this), c = It(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", f = s || !this.docView.matchesNode(e.doc, c, a);
3434
+ (f || !e.selection.eq(i.selection)) && (r = !0);
3435
+ let u = d == "preserve" && r && this.dom.style.overflowAnchor == null && Fn(this);
3436
+ if (r) {
3437
+ this.domObserver.stop();
3438
+ let p = f && (P || M) && !this.composing && !i.selection.empty && !e.selection.empty && ii(i.selection, e.selection);
3439
+ if (f) {
3440
+ let h = M ? this.trackWrites = this.domSelectionRange().focusNode : null;
3441
+ this.composing && (this.input.compositionNode = Fo(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = pt(e.doc, c, a, this.dom, this)), h && !this.trackWrites && (p = !0);
3442
+ }
3443
+ p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && so(this)) ? W(this, p) : (en(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
3444
+ }
3445
+ this.updatePluginViews(i), !((o = this.dragging) === null || o === void 0) && o.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : u && zn(u);
3446
+ }
3447
+ /**
3448
+ @internal
3449
+ */
3450
+ scrollToSelection() {
3451
+ let e = this.domSelectionRange().focusNode;
3452
+ if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
3453
+ if (!this.someProp("handleScrollToSelection", (n) => n(this))) if (this.state.selection instanceof D) {
3454
+ let n = this.docView.domAfterPos(this.state.selection.from);
3455
+ n.nodeType == 1 && at(this, n.getBoundingClientRect(), e);
3456
+ } else
3457
+ at(this, this.coordsAtPos(this.state.selection.head, 1), e);
3458
+ }
3459
+ }
3460
+ destroyPluginViews() {
3461
+ let e;
3462
+ for (; e = this.pluginViews.pop(); )
3463
+ e.destroy && e.destroy();
3464
+ }
3465
+ updatePluginViews(e) {
3466
+ if (!e || e.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {
3467
+ this.prevDirectPlugins = this.directPlugins, this.destroyPluginViews();
3468
+ for (let n = 0; n < this.directPlugins.length; n++) {
3469
+ let o = this.directPlugins[n];
3470
+ o.spec.view && this.pluginViews.push(o.spec.view(this));
3471
+ }
3472
+ for (let n = 0; n < this.state.plugins.length; n++) {
3473
+ let o = this.state.plugins[n];
3474
+ o.spec.view && this.pluginViews.push(o.spec.view(this));
3475
+ }
3476
+ } else
3477
+ for (let n = 0; n < this.pluginViews.length; n++) {
3478
+ let o = this.pluginViews[n];
3479
+ o.update && o.update(this, e);
3480
+ }
3481
+ }
3482
+ updateDraggedNode(e, n) {
3483
+ let o = e.node, i = -1;
3484
+ if (this.state.doc.nodeAt(o.from) == o.node)
3485
+ i = o.from;
3486
+ else {
3487
+ let s = o.from + (this.state.doc.content.size - n.doc.content.size);
3488
+ (s > 0 && this.state.doc.nodeAt(s)) == o.node && (i = s);
3489
+ }
3490
+ this.dragging = new mn(e.slice, e.move, i < 0 ? void 0 : D.create(this.state.doc, i));
3491
+ }
3492
+ someProp(e, n) {
3493
+ let o = this._props && this._props[e], i;
3494
+ if (o != null && (i = n ? n(o) : o))
3495
+ return i;
3496
+ for (let r = 0; r < this.directPlugins.length; r++) {
3497
+ let l = this.directPlugins[r].props[e];
3498
+ if (l != null && (i = n ? n(l) : l))
3499
+ return i;
3500
+ }
3501
+ let s = this.state.plugins;
3502
+ if (s)
3503
+ for (let r = 0; r < s.length; r++) {
3504
+ let l = s[r].props[e];
3505
+ if (l != null && (i = n ? n(l) : l))
3506
+ return i;
3507
+ }
3508
+ }
3509
+ /**
3510
+ Query whether the view has focus.
3511
+ */
3512
+ hasFocus() {
3513
+ if (P) {
3514
+ let e = this.root.activeElement;
3515
+ if (e == this.dom)
3516
+ return !0;
3517
+ if (!e || !this.dom.contains(e))
3518
+ return !1;
3519
+ for (; e && this.dom != e && this.dom.contains(e); ) {
3520
+ if (e.contentEditable == "false")
3521
+ return !1;
3522
+ e = e.parentElement;
3523
+ }
3524
+ return !0;
3525
+ }
3526
+ return this.root.activeElement == this.dom;
3527
+ }
3528
+ /**
3529
+ Focus the editor.
3530
+ */
3531
+ focus() {
3532
+ this.domObserver.stop(), this.editable && Ln(this.dom), W(this), this.domObserver.start();
3533
+ }
3534
+ /**
3535
+ Get the document root in which the editor exists. This will
3536
+ usually be the top-level `document`, but might be a [shadow
3537
+ DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)
3538
+ root if the editor is inside one.
3539
+ */
3540
+ get root() {
3541
+ let e = this._root;
3542
+ if (e == null) {
3543
+ for (let n = this.dom.parentNode; n; n = n.parentNode)
3544
+ if (n.nodeType == 9 || n.nodeType == 11 && n.host)
3545
+ return n.getSelection || (Object.getPrototypeOf(n).getSelection = () => n.ownerDocument.getSelection()), this._root = n;
3546
+ }
3547
+ return e || document;
3548
+ }
3549
+ /**
3550
+ When an existing editor view is moved to a new document or
3551
+ shadow tree, call this to make it recompute its root.
3552
+ */
3553
+ updateRoot() {
3554
+ this._root = null;
3555
+ }
3556
+ /**
3557
+ Given a pair of viewport coordinates, return the document
3558
+ position that corresponds to them. May return null if the given
3559
+ coordinates aren't inside of the editor. When an object is
3560
+ returned, its `pos` property is the position nearest to the
3561
+ coordinates, and its `inside` property holds the position of the
3562
+ inner node that the position falls inside of, or -1 if it is at
3563
+ the top level, not in any node.
3564
+ */
3565
+ posAtCoords(e) {
3566
+ return Wn(this, e);
3567
+ }
3568
+ /**
3569
+ Returns the viewport rectangle at a given document position.
3570
+ `left` and `right` will be the same number, as this returns a
3571
+ flat cursor-ish rectangle. If the position is between two things
3572
+ that aren't directly adjacent, `side` determines which element
3573
+ is used. When < 0, the element before the position is used,
3574
+ otherwise the element after.
3575
+ */
3576
+ coordsAtPos(e, n = 1) {
3577
+ return Yt(this, e, n);
3578
+ }
3579
+ /**
3580
+ Find the DOM position that corresponds to the given document
3581
+ position. When `side` is negative, find the position as close as
3582
+ possible to the content before the position. When positive,
3583
+ prefer positions close to the content after the position. When
3584
+ zero, prefer as shallow a position as possible.
3585
+
3586
+ Note that you should **not** mutate the editor's internal DOM,
3587
+ only inspect it (and even that is usually not necessary).
3588
+ */
3589
+ domAtPos(e, n = 0) {
3590
+ return this.docView.domFromPos(e, n);
3591
+ }
3592
+ /**
3593
+ Find the DOM node that represents the document node after the
3594
+ given position. May return `null` when the position doesn't point
3595
+ in front of a node or if the node is inside an opaque node view.
3596
+
3597
+ This is intended to be able to call things like
3598
+ `getBoundingClientRect` on that DOM node. Do **not** mutate the
3599
+ editor DOM directly, or add styling this way, since that will be
3600
+ immediately overriden by the editor as it redraws the node.
3601
+ */
3602
+ nodeDOM(e) {
3603
+ let n = this.docView.descAt(e);
3604
+ return n ? n.nodeDOM : null;
3605
+ }
3606
+ /**
3607
+ Find the document position that corresponds to a given DOM
3608
+ position. (Whenever possible, it is preferable to inspect the
3609
+ document structure directly, rather than poking around in the
3610
+ DOM, but sometimes—for example when interpreting an event
3611
+ target—you don't have a choice.)
3612
+
3613
+ The `bias` parameter can be used to influence which side of a DOM
3614
+ node to use when the position is inside a leaf node.
3615
+ */
3616
+ posAtDOM(e, n, o = -1) {
3617
+ let i = this.docView.posFromDOM(e, n, o);
3618
+ if (i == null)
3619
+ throw new RangeError("DOM position not inside the editor");
3620
+ return i;
3621
+ }
3622
+ /**
3623
+ Find out whether the selection is at the end of a textblock when
3624
+ moving in a given direction. When, for example, given `"left"`,
3625
+ it will return true if moving left from the current cursor
3626
+ position would leave that position's parent textblock. Will apply
3627
+ to the view's current state by default, but it is possible to
3628
+ pass a different state.
3629
+ */
3630
+ endOfTextblock(e, n) {
3631
+ return Gn(this, n || this.state, e);
3632
+ }
3633
+ /**
3634
+ Run the editor's paste logic with the given HTML string. The
3635
+ `event`, if given, will be passed to the
3636
+ [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
3637
+ */
3638
+ pasteHTML(e, n) {
3639
+ return Ne(this, "", e, !1, n || new ClipboardEvent("paste"));
3640
+ }
3641
+ /**
3642
+ Run the editor's paste logic with the given plain-text input.
3643
+ */
3644
+ pasteText(e, n) {
3645
+ return Ne(this, e, null, !0, n || new ClipboardEvent("paste"));
3646
+ }
3647
+ /**
3648
+ Serialize the given slice as it would be if it was copied from
3649
+ this editor. Returns a DOM element that contains a
3650
+ representation of the slice as its children, a textual
3651
+ representation, and the transformed slice (which can be
3652
+ different from the given input due to hooks like
3653
+ [`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).
3654
+ */
3655
+ serializeForClipboard(e) {
3656
+ return et(this, e);
3657
+ }
3658
+ /**
3659
+ Removes the editor from the DOM and destroys all [node
3660
+ views](https://prosemirror.net/docs/ref/#view.NodeView).
3661
+ */
3662
+ destroy() {
3663
+ this.docView && (Oo(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], qe(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Mn());
3664
+ }
3665
+ /**
3666
+ This is true when the view has been
3667
+ [destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be
3668
+ used anymore).
3669
+ */
3670
+ get isDestroyed() {
3671
+ return this.docView == null;
3672
+ }
3673
+ /**
3674
+ Used for testing.
3675
+ */
3676
+ dispatchEvent(e) {
3677
+ return xo(this, e);
3678
+ }
3679
+ /**
3680
+ @internal
3681
+ */
3682
+ domSelectionRange() {
3683
+ let e = this.domSelection();
3684
+ return e ? k && this.root.nodeType === 11 && En(this.dom.ownerDocument) == this.dom && Xo(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
3685
+ }
3686
+ /**
3687
+ @internal
3688
+ */
3689
+ domSelection() {
3690
+ return this.root.getSelection();
3691
+ }
3692
+ }
3693
+ oi.prototype.dispatch = function(t) {
3694
+ let e = this._props.dispatchTransaction;
3695
+ e ? e.call(this, t) : this.updateState(this.state.apply(t));
3696
+ };
3697
+ function It(t) {
3698
+ let e = /* @__PURE__ */ Object.create(null);
3699
+ return e.class = "ProseMirror", e.contenteditable = String(t.editable), t.someProp("attributes", (n) => {
3700
+ if (typeof n == "function" && (n = n(t.state)), n)
3701
+ for (let o in n)
3702
+ o == "class" ? e.class += " " + n[o] : o == "style" ? e.style = (e.style ? e.style + ";" : "") + n[o] : !e[o] && o != "contenteditable" && o != "nodeName" && (e[o] = String(n[o]));
3703
+ }), e.translate || (e.translate = "no"), [F.node(0, t.state.doc.content.size, e)];
3704
+ }
3705
+ function Ft(t) {
3706
+ if (t.markCursor) {
3707
+ let e = document.createElement("img");
3708
+ e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco: F.widget(t.state.selection.from, e, { raw: !0, marks: t.markCursor }) };
3709
+ } else
3710
+ t.cursorWrapper = null;
3711
+ }
3712
+ function zt(t) {
3713
+ return !t.someProp("editable", (e) => e(t.state) === !1);
3714
+ }
3715
+ function ii(t, e) {
3716
+ let n = Math.min(t.$anchor.sharedDepth(t.head), e.$anchor.sharedDepth(e.head));
3717
+ return t.$anchor.start(n) != e.$anchor.start(n);
3718
+ }
3719
+ function Lt(t) {
3720
+ let e = /* @__PURE__ */ Object.create(null);
3721
+ function n(o) {
3722
+ for (let i in o)
3723
+ Object.prototype.hasOwnProperty.call(e, i) || (e[i] = o[i]);
3724
+ }
3725
+ return t.someProp("nodeViews", n), t.someProp("markViews", n), e;
3726
+ }
3727
+ function si(t, e) {
3728
+ let n = 0, o = 0;
3729
+ for (let i in t) {
3730
+ if (t[i] != e[i])
3731
+ return !0;
3732
+ n++;
3733
+ }
3734
+ for (let i in e)
3735
+ o++;
3736
+ return n != o;
3737
+ }
3738
+ function $t(t) {
3739
+ if (t.spec.state || t.spec.filterTransaction || t.spec.appendTransaction)
3740
+ throw new RangeError("Plugins passed directly to the view must not have a state component");
3741
+ }
3742
+ export {
3743
+ S as D,
3744
+ oi as E,
3745
+ F as a
3746
+ };