@instincthub/react-ui 0.1.3 → 0.1.4

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 (524) hide show
  1. package/README.md +28 -3
  2. package/dist/_virtual/_commonjsHelpers.js +1 -1
  3. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
  4. package/dist/_virtual/index.js +1 -1
  5. package/dist/_virtual/index2.js +1 -1
  6. package/dist/_virtual/lodash.js +1 -1
  7. package/dist/_virtual/react-is.development.js +1 -1
  8. package/dist/_virtual/react-is.production.min.js +1 -1
  9. package/dist/node_modules/@tiptap/core/dist/index.js +1 -1
  10. package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
  11. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +1 -1
  12. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +1 -1
  14. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  15. package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js +1 -1
  16. package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js.map +1 -1
  17. package/dist/node_modules/@tiptap/extension-character-count/dist/index.js +1 -1
  18. package/dist/node_modules/@tiptap/extension-character-count/dist/index.js.map +1 -1
  19. package/dist/node_modules/@tiptap/extension-code/dist/index.js +1 -1
  20. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  21. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -1
  22. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
  23. package/dist/node_modules/@tiptap/extension-document/dist/index.js +1 -1
  24. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  25. package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js +1 -1
  26. package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js.map +1 -1
  27. package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js +1 -1
  28. package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js.map +1 -1
  29. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +1 -1
  30. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  31. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +1 -1
  32. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
  33. package/dist/node_modules/@tiptap/extension-highlight/dist/index.js +1 -1
  34. package/dist/node_modules/@tiptap/extension-highlight/dist/index.js.map +1 -1
  35. package/dist/node_modules/@tiptap/extension-history/dist/index.js +1 -1
  36. package/dist/node_modules/@tiptap/extension-history/dist/index.js.map +1 -1
  37. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +1 -1
  38. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  39. package/dist/node_modules/@tiptap/extension-image/dist/index.js +1 -1
  40. package/dist/node_modules/@tiptap/extension-image/dist/index.js.map +1 -1
  41. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +1 -1
  42. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  43. package/dist/node_modules/@tiptap/extension-link/dist/index.js +1 -1
  44. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  45. package/dist/node_modules/@tiptap/extension-list-item/dist/index.js +1 -1
  46. package/dist/node_modules/@tiptap/extension-list-item/dist/index.js.map +1 -1
  47. package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js +1 -1
  48. package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js.map +1 -1
  49. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +1 -1
  50. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
  51. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +1 -1
  52. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  53. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +1 -1
  54. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  55. package/dist/node_modules/@tiptap/extension-table/dist/index.js +1 -1
  56. package/dist/node_modules/@tiptap/extension-table/dist/index.js.map +1 -1
  57. package/dist/node_modules/@tiptap/extension-table-cell/dist/index.js +1 -1
  58. package/dist/node_modules/@tiptap/extension-table-cell/dist/index.js.map +1 -1
  59. package/dist/node_modules/@tiptap/extension-table-header/dist/index.js +1 -1
  60. package/dist/node_modules/@tiptap/extension-table-header/dist/index.js.map +1 -1
  61. package/dist/node_modules/@tiptap/extension-table-row/dist/index.js +1 -1
  62. package/dist/node_modules/@tiptap/extension-table-row/dist/index.js.map +1 -1
  63. package/dist/node_modules/@tiptap/extension-task-item/dist/index.js +1 -1
  64. package/dist/node_modules/@tiptap/extension-task-item/dist/index.js.map +1 -1
  65. package/dist/node_modules/@tiptap/extension-task-list/dist/index.js +1 -1
  66. package/dist/node_modules/@tiptap/extension-task-list/dist/index.js.map +1 -1
  67. package/dist/node_modules/@tiptap/extension-text/dist/index.js +1 -1
  68. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  69. package/dist/node_modules/@tiptap/react/dist/index.js +3 -3
  70. package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
  71. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +1 -1
  72. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
  73. package/dist/node_modules/attr-accept/dist/es/index.js +1 -1
  74. package/dist/node_modules/attr-accept/dist/es/index.js.map +1 -1
  75. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +1 -1
  76. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js.map +1 -1
  77. package/dist/node_modules/date-fns/_lib/defaultOptions.js +1 -1
  78. package/dist/node_modules/date-fns/_lib/defaultOptions.js.map +1 -1
  79. package/dist/node_modules/date-fns/_lib/format/formatters.js +1 -1
  80. package/dist/node_modules/date-fns/_lib/format/formatters.js.map +1 -1
  81. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +1 -1
  82. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -1
  83. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +1 -1
  84. package/dist/node_modules/date-fns/_lib/format/longFormatters.js.map +1 -1
  85. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +1 -1
  86. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +1 -1
  87. package/dist/node_modules/date-fns/_lib/normalizeDates.js +1 -1
  88. package/dist/node_modules/date-fns/_lib/normalizeDates.js.map +1 -1
  89. package/dist/node_modules/date-fns/_lib/protectedTokens.js +1 -1
  90. package/dist/node_modules/date-fns/_lib/protectedTokens.js.map +1 -1
  91. package/dist/node_modules/date-fns/constants.js +1 -1
  92. package/dist/node_modules/date-fns/constants.js.map +1 -1
  93. package/dist/node_modules/date-fns/constructFrom.js +1 -1
  94. package/dist/node_modules/date-fns/constructFrom.js.map +1 -1
  95. package/dist/node_modules/date-fns/differenceInCalendarDays.js +1 -1
  96. package/dist/node_modules/date-fns/differenceInCalendarDays.js.map +1 -1
  97. package/dist/node_modules/date-fns/format.js +1 -1
  98. package/dist/node_modules/date-fns/format.js.map +1 -1
  99. package/dist/node_modules/date-fns/getDayOfYear.js +1 -1
  100. package/dist/node_modules/date-fns/getDayOfYear.js.map +1 -1
  101. package/dist/node_modules/date-fns/getISOWeek.js +1 -1
  102. package/dist/node_modules/date-fns/getISOWeek.js.map +1 -1
  103. package/dist/node_modules/date-fns/getISOWeekYear.js +1 -1
  104. package/dist/node_modules/date-fns/getISOWeekYear.js.map +1 -1
  105. package/dist/node_modules/date-fns/getWeek.js +1 -1
  106. package/dist/node_modules/date-fns/getWeek.js.map +1 -1
  107. package/dist/node_modules/date-fns/getWeekYear.js +1 -1
  108. package/dist/node_modules/date-fns/getWeekYear.js.map +1 -1
  109. package/dist/node_modules/date-fns/isDate.js +1 -1
  110. package/dist/node_modules/date-fns/isDate.js.map +1 -1
  111. package/dist/node_modules/date-fns/isValid.js +1 -1
  112. package/dist/node_modules/date-fns/isValid.js.map +1 -1
  113. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -1
  114. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -1
  115. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -1
  116. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -1
  117. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -1
  118. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -1
  119. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -1
  120. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -1
  121. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +1 -1
  122. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +1 -1
  123. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +1 -1
  124. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +1 -1
  125. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +1 -1
  126. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +1 -1
  127. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +1 -1
  128. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js.map +1 -1
  129. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +1 -1
  130. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js.map +1 -1
  131. package/dist/node_modules/date-fns/locale/en-US.js +1 -1
  132. package/dist/node_modules/date-fns/locale/en-US.js.map +1 -1
  133. package/dist/node_modules/date-fns/startOfDay.js +1 -1
  134. package/dist/node_modules/date-fns/startOfDay.js.map +1 -1
  135. package/dist/node_modules/date-fns/startOfISOWeek.js +1 -1
  136. package/dist/node_modules/date-fns/startOfISOWeek.js.map +1 -1
  137. package/dist/node_modules/date-fns/startOfISOWeekYear.js +1 -1
  138. package/dist/node_modules/date-fns/startOfISOWeekYear.js.map +1 -1
  139. package/dist/node_modules/date-fns/startOfWeek.js +1 -1
  140. package/dist/node_modules/date-fns/startOfWeek.js.map +1 -1
  141. package/dist/node_modules/date-fns/startOfWeekYear.js +1 -1
  142. package/dist/node_modules/date-fns/startOfWeekYear.js.map +1 -1
  143. package/dist/node_modules/date-fns/startOfYear.js +1 -1
  144. package/dist/node_modules/date-fns/startOfYear.js.map +1 -1
  145. package/dist/node_modules/date-fns/toDate.js +1 -1
  146. package/dist/node_modules/date-fns/toDate.js.map +1 -1
  147. package/dist/node_modules/dompurify/dist/purify.es.mjs.js +2 -1
  148. package/dist/node_modules/dompurify/dist/purify.es.mjs.js.map +1 -1
  149. package/dist/node_modules/file-selector/dist/es2015/file-selector.js +1 -1
  150. package/dist/node_modules/file-selector/dist/es2015/file-selector.js.map +1 -1
  151. package/dist/node_modules/file-selector/dist/es2015/file.js +1 -1
  152. package/dist/node_modules/file-selector/dist/es2015/file.js.map +1 -1
  153. package/dist/node_modules/html2canvas/dist/html2canvas.esm.js +2 -1
  154. package/dist/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -1
  155. package/dist/node_modules/linkifyjs/dist/linkify.es.js +1 -1
  156. package/dist/node_modules/linkifyjs/dist/linkify.es.js.map +1 -1
  157. package/dist/node_modules/lodash/lodash.js +3 -2
  158. package/dist/node_modules/lodash/lodash.js.map +1 -1
  159. package/dist/node_modules/marked/lib/marked.esm.js +1 -1
  160. package/dist/node_modules/marked/lib/marked.esm.js.map +1 -1
  161. package/dist/node_modules/object-assign/index.js +2 -1
  162. package/dist/node_modules/object-assign/index.js.map +1 -1
  163. package/dist/node_modules/orderedmap/dist/index.js +1 -1
  164. package/dist/node_modules/orderedmap/dist/index.js.map +1 -1
  165. package/dist/node_modules/prop-types/checkPropTypes.js +1 -1
  166. package/dist/node_modules/prop-types/checkPropTypes.js.map +1 -1
  167. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +1 -1
  168. package/dist/node_modules/prop-types/factoryWithThrowingShims.js.map +1 -1
  169. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
  170. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
  171. package/dist/node_modules/prop-types/index.js +1 -1
  172. package/dist/node_modules/prop-types/index.js.map +1 -1
  173. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -1
  174. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +1 -1
  175. package/dist/node_modules/prop-types/lib/has.js +1 -1
  176. package/dist/node_modules/prop-types/lib/has.js.map +1 -1
  177. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +2 -2
  178. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  179. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +2 -2
  180. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  181. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  182. package/dist/node_modules/prop-types/node_modules/react-is/index.js.map +1 -1
  183. package/dist/node_modules/prosemirror-commands/dist/index.js +1 -1
  184. package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -1
  185. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +1 -1
  186. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
  187. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +1 -1
  188. package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -1
  189. package/dist/node_modules/prosemirror-history/dist/index.js +1 -1
  190. package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
  191. package/dist/node_modules/prosemirror-keymap/dist/index.js +1 -1
  192. package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -1
  193. package/dist/node_modules/prosemirror-model/dist/index.js +1 -1
  194. package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
  195. package/dist/node_modules/prosemirror-schema-list/dist/index.js +1 -1
  196. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
  197. package/dist/node_modules/prosemirror-state/dist/index.js +1 -1
  198. package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -1
  199. package/dist/node_modules/prosemirror-tables/dist/index.js +1 -1
  200. package/dist/node_modules/prosemirror-tables/dist/index.js.map +1 -1
  201. package/dist/node_modules/prosemirror-transform/dist/index.js +1 -1
  202. package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
  203. package/dist/node_modules/prosemirror-view/dist/index.js +1 -1
  204. package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
  205. package/dist/node_modules/react-dropzone/dist/es/index.js +1 -1
  206. package/dist/node_modules/react-dropzone/dist/es/index.js.map +1 -1
  207. package/dist/node_modules/react-dropzone/dist/es/utils/index.js +1 -1
  208. package/dist/node_modules/react-dropzone/dist/es/utils/index.js.map +1 -1
  209. package/dist/node_modules/rope-sequence/dist/index.js +1 -1
  210. package/dist/node_modules/rope-sequence/dist/index.js.map +1 -1
  211. package/dist/node_modules/tslib/tslib.es6.js +1 -1
  212. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  213. package/dist/node_modules/w3c-keyname/index.js +1 -1
  214. package/dist/node_modules/w3c-keyname/index.js.map +1 -1
  215. package/dist/node_modules/xlsx/xlsx.mjs.js +2 -1
  216. package/dist/node_modules/xlsx/xlsx.mjs.js.map +1 -1
  217. package/dist/src/components/auth/ClientDetector.js +1 -1
  218. package/dist/src/components/auth/ClientOnly.js +1 -1
  219. package/dist/src/components/auth/FromInstinctHub.js +1 -1
  220. package/dist/src/components/auth/FromInstinctHub.js.map +1 -1
  221. package/dist/src/components/auth/IsUsernameEmailTaken.js +1 -1
  222. package/dist/src/components/auth/LoginForm.js +1 -1
  223. package/dist/src/components/auth/PasswordsMatch.js +1 -1
  224. package/dist/src/components/auth/ReactClientProviders.js +1 -1
  225. package/dist/src/components/cursors/Cursor.js +1 -1
  226. package/dist/src/components/cursors/CursorContext.js +1 -1
  227. package/dist/src/components/cursors/CursorControlDemo.js +1 -1
  228. package/dist/src/components/cursors/MagneticButton.js +1 -1
  229. package/dist/src/components/cursors/index.js +1 -1
  230. package/dist/src/components/cursors/index.js.map +1 -1
  231. package/dist/src/components/cursors/useCursorInteraction.js +1 -1
  232. package/dist/src/components/forms/ActionCallbackDropdown.js +1 -1
  233. package/dist/src/components/forms/ActionDropdown.js +1 -1
  234. package/dist/src/components/forms/AnimatedBox.js +1 -1
  235. package/dist/src/components/forms/CheckBoxes.js +1 -1
  236. package/dist/src/components/forms/CheckboxesField.js +1 -1
  237. package/dist/src/components/forms/ChipsInput.js +1 -1
  238. package/dist/src/components/forms/DateInput.js +1 -1
  239. package/dist/src/components/forms/DateInputPicker.js +1 -1
  240. package/dist/src/components/forms/DateTimeInput.js +1 -1
  241. package/dist/src/components/forms/DownloadAsExcel.js +1 -1
  242. package/dist/src/components/forms/DropFile.js +1 -1
  243. package/dist/src/components/forms/EmailList.js +1 -1
  244. package/dist/src/components/forms/FileField.js +1 -1
  245. package/dist/src/components/forms/FilterArray.js +1 -1
  246. package/dist/src/components/forms/FilterBy.js +1 -1
  247. package/dist/src/components/forms/FilterObjects.js +1 -1
  248. package/dist/src/components/forms/FormError.js +1 -1
  249. package/dist/src/components/forms/FormError.js.map +1 -1
  250. package/dist/src/components/forms/HandleError.js +1 -1
  251. package/dist/src/components/forms/InputAmount.js +1 -1
  252. package/dist/src/components/forms/InputNumber.js +1 -1
  253. package/dist/src/components/forms/InputText.js +1 -1
  254. package/dist/src/components/forms/InputTextarea.js +1 -1
  255. package/dist/src/components/forms/Logout.js +1 -1
  256. package/dist/src/components/forms/MessageDisplay.js +1 -1
  257. package/dist/src/components/forms/MessageDisplay.js.map +1 -1
  258. package/dist/src/components/forms/MultipleEmail.js +1 -1
  259. package/dist/src/components/forms/PageLoading.js +1 -1
  260. package/dist/src/components/forms/PageLoading.js.map +1 -1
  261. package/dist/src/components/forms/PasswordField.js +1 -1
  262. package/dist/src/components/forms/PhoneNumberInput.js +1 -1
  263. package/dist/src/components/forms/RadioField.js +1 -1
  264. package/dist/src/components/forms/RadioField.js.map +1 -1
  265. package/dist/src/components/forms/RadioSimple.js +1 -1
  266. package/dist/src/components/forms/RadioSimple.js.map +1 -1
  267. package/dist/src/components/forms/ReactTimeAgo.js +1 -1
  268. package/dist/src/components/forms/ReadTermsAndCondition.js +1 -1
  269. package/dist/src/components/forms/SearchField.js +1 -1
  270. package/dist/src/components/forms/SearchFieldDB.js +1 -1
  271. package/dist/src/components/forms/SearchObjectsFromDB.js +1 -1
  272. package/dist/src/components/forms/StepProgressBar.js +1 -1
  273. package/dist/src/components/forms/StepProgressBar.js.map +1 -1
  274. package/dist/src/components/forms/SubmitButton.js +1 -1
  275. package/dist/src/components/forms/TBodyNoData.js +1 -1
  276. package/dist/src/components/forms/TBodyNoData.js.map +1 -1
  277. package/dist/src/components/forms/THeadSortBtn.js +1 -1
  278. package/dist/src/components/forms/THeadSortBtn.js.map +1 -1
  279. package/dist/src/components/forms/THeadSortList.js +1 -1
  280. package/dist/src/components/forms/Tables.js +1 -1
  281. package/dist/src/components/forms/TextArea.js +1 -1
  282. package/dist/src/components/forms/TextArea.js.map +1 -1
  283. package/dist/src/components/forms/TextField.js +1 -1
  284. package/dist/src/components/forms/ToggleButton.js +1 -1
  285. package/dist/src/components/forms/Tooltip.js +1 -1
  286. package/dist/src/components/forms/UnsplashRandomImage.js +1 -1
  287. package/dist/src/components/forms/radio-btn/RadioButton.js +1 -1
  288. package/dist/src/components/forms/radio-btn/RadioButton.js.map +1 -1
  289. package/dist/src/components/forms/radio-btn/RadioGroup.js +1 -1
  290. package/dist/src/components/forms/radio-btn/RadioGroup.js.map +1 -1
  291. package/dist/src/components/forms/uploads/FileUploader.js +1 -1
  292. package/dist/src/components/forms/uploads/IhubFileUploader.js +1 -1
  293. package/dist/src/components/lib/auth/actions.js +1 -1
  294. package/dist/src/components/lib/auth/dbRequestst.js +1 -1
  295. package/dist/src/components/lib/auth/dbRequestst.js.map +1 -1
  296. package/dist/src/components/lib/charts.js +1 -1
  297. package/dist/src/components/lib/charts.js.map +1 -1
  298. package/dist/src/components/lib/convertArrayToObject.js +1 -1
  299. package/dist/src/components/lib/convertArrayToObject.js.map +1 -1
  300. package/dist/src/components/lib/createSubscription.js +1 -1
  301. package/dist/src/components/lib/createSubscription.js.map +1 -1
  302. package/dist/src/components/lib/elementIsVisibleInViewport.js +1 -1
  303. package/dist/src/components/lib/elementIsVisibleInViewport.js.map +1 -1
  304. package/dist/src/components/lib/fileToBase64.js +1 -1
  305. package/dist/src/components/lib/fileToBase64.js.map +1 -1
  306. package/dist/src/components/lib/formError.js +1 -1
  307. package/dist/src/components/lib/formError.js.map +1 -1
  308. package/dist/src/components/lib/format.js +1 -1
  309. package/dist/src/components/lib/format.js.map +1 -1
  310. package/dist/src/components/lib/getPriceObjects.js +1 -1
  311. package/dist/src/components/lib/getPriceObjects.js.map +1 -1
  312. package/dist/src/components/lib/helpFunction.js +1 -1
  313. package/dist/src/components/lib/helpFunction.js.map +1 -1
  314. package/dist/src/components/lib/index.js +1 -1
  315. package/dist/src/components/lib/index.js.map +1 -1
  316. package/dist/src/components/lib/json/accounts.js +1 -1
  317. package/dist/src/components/lib/json/accounts.js.map +1 -1
  318. package/dist/src/components/lib/json/countryObjects.js +1 -1
  319. package/dist/src/components/lib/json/countryObjects.js.map +1 -1
  320. package/dist/src/components/lib/json/unsplashDefaultObject.js +1 -1
  321. package/dist/src/components/lib/json/unsplashDefaultObject.js.map +1 -1
  322. package/dist/src/components/lib/loadScript.js +2 -0
  323. package/dist/src/components/lib/loadScript.js.map +1 -0
  324. package/dist/src/components/lib/modals/modals.js +1 -1
  325. package/dist/src/components/lib/modals/modals.js.map +1 -1
  326. package/dist/src/components/lib/modals/openConfirmDelete.js +1 -1
  327. package/dist/src/components/lib/modals/openConfirmDelete.js.map +1 -1
  328. package/dist/src/components/lib/oauth_json.js +1 -1
  329. package/dist/src/components/lib/oauth_json.js.map +1 -1
  330. package/dist/src/components/lib/paystack.js +1 -1
  331. package/dist/src/components/lib/paystack.js.map +1 -1
  332. package/dist/src/components/lib/permissions.js +1 -1
  333. package/dist/src/components/lib/permissions.js.map +1 -1
  334. package/dist/src/components/lib/queryParameters/index.js +1 -1
  335. package/dist/src/components/lib/queryParameters/index.js.map +1 -1
  336. package/dist/src/components/lib/redux/index.js +1 -1
  337. package/dist/src/components/lib/redux/middleware.js +1 -1
  338. package/dist/src/components/lib/redux/middleware.js.map +1 -1
  339. package/dist/src/components/lib/redux/rootReducer.js +1 -1
  340. package/dist/src/components/lib/redux/rootReducer.js.map +1 -1
  341. package/dist/src/components/lib/redux/slices/authSlice/channelCallbackUrl.js +1 -1
  342. package/dist/src/components/lib/redux/slices/authSlice/channelCallbackUrl.js.map +1 -1
  343. package/dist/src/components/lib/redux/slices/authSlice/selectors.js +1 -1
  344. package/dist/src/components/lib/redux/slices/authSlice/selectors.js.map +1 -1
  345. package/dist/src/components/lib/redux/slices/channelSlice/activeChannel.js +1 -1
  346. package/dist/src/components/lib/redux/slices/channelSlice/activeChannel.js.map +1 -1
  347. package/dist/src/components/lib/redux/slices/channelSlice/channelDetails.js +1 -1
  348. package/dist/src/components/lib/redux/slices/channelSlice/channelDetails.js.map +1 -1
  349. package/dist/src/components/lib/redux/slices/channelSlice/channelHandle.js +1 -1
  350. package/dist/src/components/lib/redux/slices/channelSlice/channelHandle.js.map +1 -1
  351. package/dist/src/components/lib/redux/slices/channelSlice/instructorChannelList.js +1 -1
  352. package/dist/src/components/lib/redux/slices/channelSlice/instructorChannelList.js.map +1 -1
  353. package/dist/src/components/lib/redux/slices/channelSlice/selectors.js +1 -1
  354. package/dist/src/components/lib/redux/slices/channelSlice/selectors.js.map +1 -1
  355. package/dist/src/components/lib/redux/slices/courseSlice/courseDetails.js +1 -1
  356. package/dist/src/components/lib/redux/slices/courseSlice/courseDetails.js.map +1 -1
  357. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterDuration.js +1 -1
  358. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterDuration.js.map +1 -1
  359. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterLevel.js +1 -1
  360. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterLevel.js.map +1 -1
  361. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterSubject.js +1 -1
  362. package/dist/src/components/lib/redux/slices/courseSlice/courseFilterSubject.js.map +1 -1
  363. package/dist/src/components/lib/redux/slices/courseSlice/courseModules.js +1 -1
  364. package/dist/src/components/lib/redux/slices/courseSlice/courseModules.js.map +1 -1
  365. package/dist/src/components/lib/redux/slices/courseSlice/courseOverview.js +1 -1
  366. package/dist/src/components/lib/redux/slices/courseSlice/courseOverview.js.map +1 -1
  367. package/dist/src/components/lib/redux/slices/courseSlice/courseSearch.js +1 -1
  368. package/dist/src/components/lib/redux/slices/courseSlice/courseSearch.js.map +1 -1
  369. package/dist/src/components/lib/redux/slices/courseSlice/selectedCourses.js +1 -1
  370. package/dist/src/components/lib/redux/slices/courseSlice/selectedCourses.js.map +1 -1
  371. package/dist/src/components/lib/redux/slices/courseSlice/selectors.js +1 -1
  372. package/dist/src/components/lib/redux/slices/courseSlice/selectors.js.map +1 -1
  373. package/dist/src/components/lib/redux/slices/courseSlice/stepContent.js +1 -1
  374. package/dist/src/components/lib/redux/slices/courseSlice/stepContent.js.map +1 -1
  375. package/dist/src/components/lib/redux/slices/courseSlice/stepQuestions.js +1 -1
  376. package/dist/src/components/lib/redux/slices/courseSlice/stepQuestions.js.map +1 -1
  377. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestamp.js +1 -1
  378. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestamp.js.map +1 -1
  379. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestampObject.js +1 -1
  380. package/dist/src/components/lib/redux/slices/courseSlice/videoTimestampObject.js.map +1 -1
  381. package/dist/src/components/lib/redux/slices/generics/arraySlice.js +1 -1
  382. package/dist/src/components/lib/redux/slices/generics/arraySlice.js.map +1 -1
  383. package/dist/src/components/lib/redux/slices/generics/objectSlice.js +1 -1
  384. package/dist/src/components/lib/redux/slices/generics/objectSlice.js.map +1 -1
  385. package/dist/src/components/lib/redux/slices/generics/selectors.js +1 -1
  386. package/dist/src/components/lib/redux/slices/generics/selectors.js.map +1 -1
  387. package/dist/src/components/lib/redux/slices/messageSlice/feedbackToggle.js +1 -1
  388. package/dist/src/components/lib/redux/slices/messageSlice/feedbackToggle.js.map +1 -1
  389. package/dist/src/components/lib/redux/slices/messageSlice/selectors.js +1 -1
  390. package/dist/src/components/lib/redux/slices/messageSlice/selectors.js.map +1 -1
  391. package/dist/src/components/lib/redux/slices/messageSlice/statusMessageState.js +1 -1
  392. package/dist/src/components/lib/redux/slices/messageSlice/statusMessageState.js.map +1 -1
  393. package/dist/src/components/lib/redux/slices/navigationSlice/IPAdress.js +1 -1
  394. package/dist/src/components/lib/redux/slices/navigationSlice/IPAdress.js.map +1 -1
  395. package/dist/src/components/lib/redux/slices/navigationSlice/appToggle.js +1 -1
  396. package/dist/src/components/lib/redux/slices/navigationSlice/appToggle.js.map +1 -1
  397. package/dist/src/components/lib/redux/slices/navigationSlice/confirmDelete.js +1 -1
  398. package/dist/src/components/lib/redux/slices/navigationSlice/confirmDelete.js.map +1 -1
  399. package/dist/src/components/lib/redux/slices/navigationSlice/courseNextStep.js +1 -1
  400. package/dist/src/components/lib/redux/slices/navigationSlice/courseNextStep.js.map +1 -1
  401. package/dist/src/components/lib/redux/slices/navigationSlice/currentPromo.js +1 -1
  402. package/dist/src/components/lib/redux/slices/navigationSlice/currentPromo.js.map +1 -1
  403. package/dist/src/components/lib/redux/slices/navigationSlice/searchValue.js +1 -1
  404. package/dist/src/components/lib/redux/slices/navigationSlice/searchValue.js.map +1 -1
  405. package/dist/src/components/lib/redux/slices/navigationSlice/selectors.js +1 -1
  406. package/dist/src/components/lib/redux/slices/navigationSlice/selectors.js.map +1 -1
  407. package/dist/src/components/lib/redux/slices/navigationSlice/settingsToggle.js +1 -1
  408. package/dist/src/components/lib/redux/slices/navigationSlice/settingsToggle.js.map +1 -1
  409. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCohort.js +1 -1
  410. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCohort.js.map +1 -1
  411. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCourse.js +1 -1
  412. package/dist/src/components/lib/redux/slices/navigationSlice/toggleCreateCourse.js.map +1 -1
  413. package/dist/src/components/lib/redux/slices/navigationSlice/userLocation.js +1 -1
  414. package/dist/src/components/lib/redux/slices/navigationSlice/userLocation.js.map +1 -1
  415. package/dist/src/components/lib/redux/slices/utilsSlice/screenSize.js +1 -1
  416. package/dist/src/components/lib/redux/slices/utilsSlice/screenSize.js.map +1 -1
  417. package/dist/src/components/lib/redux/slices/utilsSlice/selectors.js +1 -1
  418. package/dist/src/components/lib/redux/slices/utilsSlice/selectors.js.map +1 -1
  419. package/dist/src/components/lib/redux/store.js +1 -1
  420. package/dist/src/components/lib/redux/store.js.map +1 -1
  421. package/dist/src/components/lib/roles.js +1 -1
  422. package/dist/src/components/lib/roles.js.map +1 -1
  423. package/dist/src/components/lib/utils.js +1 -1
  424. package/dist/src/components/lib/utils.js.map +1 -1
  425. package/dist/src/components/navbar/Breadcrumb.js +1 -1
  426. package/dist/src/components/navbar/ChannelListAvatar.js +1 -1
  427. package/dist/src/components/navbar/MenuDropdown.js +1 -1
  428. package/dist/src/components/navbar/ResponsiveNavbar.js +1 -1
  429. package/dist/src/components/navbar/SideNavbar.js +1 -1
  430. package/dist/src/components/status/CopyToClipBoard.js +1 -1
  431. package/dist/src/components/status/DeleteConfirmationModal.js +1 -1
  432. package/dist/src/components/status/Error500.js +1 -1
  433. package/dist/src/components/status/Error500.js.map +1 -1
  434. package/dist/src/components/status/ErrorState.js +1 -1
  435. package/dist/src/components/status/ErrorState.js.map +1 -1
  436. package/dist/src/components/status/ModalExamples.js +1 -1
  437. package/dist/src/components/status/MultiPurposeModal.js +1 -1
  438. package/dist/src/components/status/NotFound.js +1 -1
  439. package/dist/src/components/status/ReactTimeTracker.js +1 -1
  440. package/dist/src/components/status/SessionHandleProvider.js +1 -1
  441. package/dist/src/components/status/Unauthorized.js +1 -1
  442. package/dist/src/components/status/Unauthorized.js.map +1 -1
  443. package/dist/src/components/tabs/TabContent.js +1 -1
  444. package/dist/src/components/tabs/TabContent.js.map +1 -1
  445. package/dist/src/components/tabs/Tabs.js +1 -1
  446. package/dist/src/components/tabs/VerticalTabs.js +1 -1
  447. package/dist/src/components/theme/ChangeStyleVariable.js +1 -1
  448. package/dist/src/components/theme/DarkModeProvider.js +1 -1
  449. package/dist/src/components/theme/LoadingAnimate.js +1 -1
  450. package/dist/src/components/theme/LoadingAnimate.js.map +1 -1
  451. package/dist/src/components/theme/SessionProviders.js +1 -1
  452. package/dist/src/components/theme/signout/SessionExpiresLogout.js +1 -1
  453. package/dist/src/components/theme/signout/SignOutSession.js +1 -1
  454. package/dist/src/components/ui/Action.js +1 -1
  455. package/dist/src/components/ui/Action.js.map +1 -1
  456. package/dist/src/components/ui/Badge.js +1 -1
  457. package/dist/src/components/ui/Badge.js.map +1 -1
  458. package/dist/src/components/ui/ColorPicker.js +1 -1
  459. package/dist/src/components/ui/ComponentLists.js +1 -1
  460. package/dist/src/components/ui/ComponentLists.js.map +1 -1
  461. package/dist/src/components/ui/Dropdown.js +1 -1
  462. package/dist/src/components/ui/OrDivider.js +1 -1
  463. package/dist/src/components/ui/cards/Card.js +1 -1
  464. package/dist/src/components/ui/cards/CardGrid.js +1 -1
  465. package/dist/src/components/ui/cards/CardGrid.js.map +1 -1
  466. package/dist/src/components/ui/cards/CardList.js +1 -1
  467. package/dist/src/components/ui/cards/CardList.js.map +1 -1
  468. package/dist/src/components/ui/cards/FeatureCard.js +1 -1
  469. package/dist/src/components/ui/cards/FeatureCard.js.map +1 -1
  470. package/dist/src/components/ui/cards/HorizontalCard.js +1 -1
  471. package/dist/src/components/ui/cards/HorizontalCard.js.map +1 -1
  472. package/dist/src/components/ui/cards/MediaCard.js +1 -1
  473. package/dist/src/components/ui/cards/MediaCard.js.map +1 -1
  474. package/dist/src/components/ui/cards/PricingCard.js +1 -1
  475. package/dist/src/components/ui/cards/PricingCard.js.map +1 -1
  476. package/dist/src/components/ui/cards/ProfileCard.js +1 -1
  477. package/dist/src/components/ui/cards/ProfileCard.js.map +1 -1
  478. package/dist/src/components/ui/charts/ChartConfigurator.js +1 -1
  479. package/dist/src/components/ui/charts/InstinctHubChart.js +1 -1
  480. package/dist/src/components/ui/charts/InstinctHubChartDashboard.js +1 -1
  481. package/dist/src/components/ui/create-button/CreateButton.js +1 -1
  482. package/dist/src/components/ui/create-button/CreateButtonExample.js +1 -1
  483. package/dist/src/components/ui/create-button/CreateButtonExample.js.map +1 -1
  484. package/dist/src/components/ui/dialogs/Dialog.js +1 -1
  485. package/dist/src/components/ui/editor/CustomTextEditor.js +1 -1
  486. package/dist/src/components/ui/editor/MenuBar.js +1 -1
  487. package/dist/src/components/ui/images/RandomGradientImage.js +1 -1
  488. package/dist/src/components/ui/images/RandomGradientImage.js.map +1 -1
  489. package/dist/src/components/ui/pagination/Pagination.js +1 -1
  490. package/dist/src/components/ui/pagination/PaginationDemo.js +1 -1
  491. package/dist/src/components/ui/tables/IHubTable.js +1 -1
  492. package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
  493. package/dist/src/components/ui/viewer/CodeDisplay.js +1 -1
  494. package/dist/src/components/ui/viewer/ContentViewOrEdit.js +1 -1
  495. package/dist/src/components/ui/viewer/ContentViewer.js +1 -1
  496. package/dist/src/index.js +1 -1
  497. package/dist/src/ssr.js +1 -1
  498. package/dist/src/types/components/auth/IsUsernameEmailTaken.d.ts +13 -0
  499. package/dist/src/types/components/forms/DateInput.d.ts +3 -4
  500. package/dist/src/types/components/forms/FilterObjects.d.ts +1 -1
  501. package/dist/src/types/components/forms/uploads/IhubFileUploader.d.ts +1 -1
  502. package/dist/src/types/components/lib/index.d.ts +1 -1
  503. package/dist/src/types/components/lib/redux/slices/channelSlice/channelDetails.d.ts +1 -1
  504. package/dist/src/types/components/lib/redux/slices/channelSlice/instructorChannelList.d.ts +3 -2
  505. package/dist/src/types/components/lib/redux/slices/courseSlice/courseDetails.d.ts +1 -1
  506. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterDuration.d.ts +1 -1
  507. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterLevel.d.ts +1 -1
  508. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterSubject.d.ts +1 -1
  509. package/dist/src/types/components/lib/redux/slices/courseSlice/courseModules.d.ts +1 -1
  510. package/dist/src/types/components/lib/redux/slices/courseSlice/courseOverview.d.ts +1 -1
  511. package/dist/src/types/components/lib/redux/slices/courseSlice/courseSearch.d.ts +1 -1
  512. package/dist/src/types/components/lib/redux/slices/courseSlice/stepContent.d.ts +1 -1
  513. package/dist/src/types/components/lib/redux/slices/courseSlice/stepQuestions.d.ts +1 -1
  514. package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestamp.d.ts +1 -1
  515. package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestampObject.d.ts +1 -1
  516. package/dist/src/types/components/lib/redux/slices/navigationSlice/IPAdress.d.ts +1 -1
  517. package/dist/src/types/components/status/ReactTimeTracker.d.ts +1 -1
  518. package/dist/src/types/components/tabs/Tabs.d.ts +1 -1
  519. package/dist/src/types/components/tabs/VerticalTabs.d.ts +1 -1
  520. package/dist/src/types/components/theme/signout/SessionExpiresLogout.d.ts +1 -1
  521. package/dist/src/types/components/ui/Action.d.ts +1 -1
  522. package/dist/src/types/types/index.d.ts +4 -0
  523. package/dist/tsconfig.tsbuildinfo +1 -1
  524. package/package.json +26 -9
package/README.md CHANGED
@@ -1,12 +1,37 @@
1
- # Installation Guide for @instincthub/react-ui
1
+ # InstinctHub React UI
2
2
 
3
- ## Prerequisites
3
+ A comprehensive React component library with 125+ components for building modern web applications.
4
4
 
5
- Before installing `@instincthub/react-ui`, ensure you have the following installed on your system:
5
+ ## 🚀 Quick Start
6
+
7
+ ### Prerequisites
6
8
 
7
9
  - **Node.js** (Recommended version: >= 16.x)
8
10
  - **npm** (Comes with Node.js) or **yarn**
9
11
 
12
+ ## 🤖 AI-Powered Component Discovery
13
+
14
+ **NEW**: InstinctHub React UI now includes AI-powered component discovery through Model Context Protocol (MCP) integration!
15
+
16
+ ### 🌐 For Claude.ai Users (Web)
17
+ 1. Go to [Claude.ai](https://claude.ai) → Settings → Integrations
18
+ 2. Add integration: `InstinctHub React UI`
19
+ 3. URL: `https://ui.instincthub.com/api/mcp`
20
+ 4. Start asking: *"Find form components"*, *"Generate a login form"*, *"Help me integrate components"*
21
+
22
+ ### 💻 For Claude Code CLI Users
23
+ The project includes a local MCP server for full CLI integration:
24
+ ```bash
25
+ # MCP tools are automatically available:
26
+ # - mcp__search_components
27
+ # - mcp__get_component_docs
28
+ # - mcp__recommend_components
29
+ # - mcp__generate_code
30
+ # - mcp__integration_help
31
+ ```
32
+
33
+ **[→ Full MCP Integration Guide](./src/__examples__/src/app/api/README.md)**
34
+
10
35
  ## Installation
11
36
 
12
37
  To use the `@instincthub/react-ui` package, another project needs to install the packages listed in the `peerDependencies` section of its `package.json`.
@@ -1,2 +1,2 @@
1
- var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};export{e as commonjsGlobal};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};exports.commonjsGlobal=e;
2
2
  //# sourceMappingURL=_commonjsHelpers.js.map
@@ -1,2 +1,2 @@
1
- function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t){if(Array.isArray(t))return t}function e(r){if(Array.isArray(r))return t(r)}function n(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise((function(o,i){var a=t.apply(r,e);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)}))}}function i(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=j(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}function a(t,r,e){return(r=w(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function c(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function y(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?s(Object(e),!0).forEach((function(r){a(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function h(t,r){if(null==t)return{};var e,n,o=p(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],-1===r.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function p(t,r){if(null==t)return{};var e={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==r.indexOf(n))continue;e[n]=t[n]}return e}function v(){v=function(){return r};var t,r={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,r,e){t[r]=e.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function f(t,r,e,n){var i=r&&r.prototype instanceof m?r:m,a=Object.create(i.prototype),u=new _(n||[]);return o(a,"_invoke",{value:P(t,e,u)}),a}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var y="suspendedStart",h="suspendedYield",p="executing",d="completed",b={};function m(){}function g(){}function w(){}var O={};l(O,a,(function(){return this}));var j=Object.getPrototypeOf,L=j&&j(j(k([])));L&&L!==e&&n.call(L,a)&&(O=L);var x=w.prototype=m.prototype=Object.create(O);function E(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function S(t,r){function e(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,a,u)}),(function(t){e("throw",t,a,u)})):r.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return e("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return i=i?i.then(o,o):o()}})}function P(r,e,n){var o=y;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=A(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=s(r,e,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function A(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,A(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=s(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,b;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,b):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function I(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(r){if(r||""===r){var e=r[a];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function e(){for(;++o<r.length;)if(n.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(typeof r+" is not iterable")}return g.prototype=w,o(x,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===g||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},r.awrap=function(t){return{__await:t}},E(S.prototype),l(S.prototype,u,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(f(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(x),l(x,c,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=k,_.prototype={constructor:_,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function o(n,o){return u.type="throw",u.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),b},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),I(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;I(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:k(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}function d(t,e){return r(t)||c(t,e)||j(t,e)||l()}function b(t,r){return r||(r=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(r)}}))}function m(t){return e(t)||u(t)||j(t)||f()}function g(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function w(t){var r=g(t,"string");return"symbol"==typeof r?r:r+""}function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function j(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}export{t as arrayLikeToArray,r as arrayWithHoles,e as arrayWithoutHoles,o as asyncToGenerator,i as createForOfIteratorHelper,a as defineProperty,u as iterableToArray,c as iterableToArrayLimit,l as nonIterableRest,f as nonIterableSpread,y as objectSpread2,h as objectWithoutProperties,p as objectWithoutPropertiesLoose,v as regeneratorRuntime,d as slicedToArray,b as taggedTemplateLiteral,m as toConsumableArray,g as toPrimitive,w as toPropertyKey,O as typeof,j as unsupportedIterableToArray};
1
+ "use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t){if(Array.isArray(t))return t}function e(r){if(Array.isArray(r))return t(r)}function n(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function o(t,r,e){return(r=y(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function i(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function f(t,r){if(null==t)return{};var e={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==r.indexOf(n))continue;e[n]=t[n]}return e}function s(){s=function(){return r};var t,r={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,r,e){t[r]=e.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function f(t,r,e,n){var i=r&&r.prototype instanceof m?r:m,a=Object.create(i.prototype),u=new I(n||[]);return o(a,"_invoke",{value:S(t,e,u)}),a}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var y="suspendedStart",h="suspendedYield",v="executing",d="completed",b={};function m(){}function g(){}function w(){}var x={};l(x,a,(function(){return this}));var O=Object.getPrototypeOf,j=O&&O(O(k([])));j&&j!==e&&n.call(j,a)&&(x=j);var L=w.prototype=m.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function P(t,r){function e(o,i,a,u){var c=p(t[o],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,a,u)}),(function(t){e("throw",t,a,u)})):r.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return e("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return i=i?i.then(o,o):o()}})}function S(r,e,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=A(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=p(r,e,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function A(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,A(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=p(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,b;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,b):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function _(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(r){if(r||""===r){var e=r[a];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function e(){for(;++o<r.length;)if(n.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(typeof r+" is not iterable")}return g.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===g||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,c,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},E(P.prototype),l(P.prototype,u,(function(){return this})),r.AsyncIterator=P,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new P(f(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(L),l(L,c,"Generator"),l(L,a,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=k,I.prototype={constructor:I,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function o(n,o){return u.type="throw",u.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),b},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),_(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;_(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:k(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}function p(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function y(t){var r=p(t,"string");return"symbol"==typeof r?r:r+""}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function v(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.arrayLikeToArray=t,exports.arrayWithHoles=r,exports.arrayWithoutHoles=e,exports.asyncToGenerator=function(t){return function(){var r=this,e=arguments;return new Promise((function(o,i){var a=t.apply(r,e);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)}))}},exports.createForOfIteratorHelper=function(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=v(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}},exports.defineProperty=o,exports.iterableToArray=i,exports.iterableToArrayLimit=a,exports.nonIterableRest=u,exports.nonIterableSpread=c,exports.objectSpread2=function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?l(Object(e),!0).forEach((function(r){o(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):l(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t},exports.objectWithoutProperties=function(t,r){if(null==t)return{};var e,n,o=f(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],-1===r.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o},exports.objectWithoutPropertiesLoose=f,exports.regeneratorRuntime=s,exports.slicedToArray=function(t,e){return r(t)||a(t,e)||v(t,e)||u()},exports.taggedTemplateLiteral=function(t,r){return r||(r=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(r)}}))},exports.toConsumableArray=function(t){return e(t)||i(t)||v(t)||c()},exports.toPrimitive=p,exports.toPropertyKey=y,exports.typeof=h,exports.unsupportedIterableToArray=v;
2
2
  //# sourceMappingURL=_rollupPluginBabelHelpers.js.map
@@ -1,2 +1,2 @@
1
- var p={exports:{}};export{p};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.propTypes={exports:{}};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- var r={exports:{}};export{r};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.reactIs={exports:{}};
2
2
  //# sourceMappingURL=index2.js.map
@@ -1,2 +1,2 @@
1
- var r={exports:{}};export{r as l};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.lodash={exports:{}};
2
2
  //# sourceMappingURL=lodash.js.map
@@ -1,2 +1,2 @@
1
- var r={};export{r as __exports};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.__exports={};
2
2
  //# sourceMappingURL=react-is.development.js.map
@@ -1,2 +1,2 @@
1
- var r={};export{r as __exports};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.__exports={};
2
2
  //# sourceMappingURL=react-is.production.min.js.map
@@ -1,2 +1,2 @@
1
- import{Plugin as t,PluginKey as e,NodeSelection as n,Selection as o,TextSelection as r,AllSelection as s,EditorState as i}from"../../../prosemirror-state/dist/index.js";import{EditorView as a}from"../../../prosemirror-view/dist/index.js";import{keymap as c}from"../../../prosemirror-keymap/dist/index.js";import{Fragment as d,Slice as l,DOMSerializer as p,Node as u,Schema as h,DOMParser as m}from"../../../prosemirror-model/dist/index.js";import{findWrapping as f,canJoin as g,Transform as v,liftTarget as y,joinPoint as b,canSplit as k,ReplaceStep as w,ReplaceAroundStep as x}from"../../../prosemirror-transform/dist/index.js";import{createParagraphNear as M,deleteSelection as E,exitCode as O,joinUp as S,joinDown as C,joinBackward as T,joinForward as P,joinTextblockBackward as $,joinTextblockForward as j,lift as A,liftEmptyBlock as I,newlineInCode as N,selectNodeBackward as B,selectNodeForward as R,selectParentNode as D,selectTextblockEnd as z,selectTextblockStart as L,setBlockType as F,wrapIn as H}from"../../../prosemirror-commands/dist/index.js";import{liftListItem as V,sinkListItem as W,wrapInList as _}from"../../../prosemirror-schema-list/dist/index.js";function q(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:r}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return r},get tr(){return o=n.selection,r=n.doc,s=n.storedMarks,n}}}class K{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:r}=n,s=this.buildProps(r);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(s);return r.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(r),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i=[],a=!!t,c=t||r.tr,d={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const o=this.buildProps(c,e),r=n(...t)(o);return i.push(r),d}]))),run:()=>(a||!e||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),i.every((t=>!0===t)))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,r=t||n.tr,s=this.buildProps(r,o),i=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...s,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i={tr:t,editor:o,view:s,state:q({state:r,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(i)])))}};return i}}class U{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}}function G(t,e,n){if(void 0===t.config[e]&&t.parent)return G(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?G(t.parent,e,n):null})}return t.config[e]}function J(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function Y(t){const e=[],{nodeExtensions:n,markExtensions:o}=J(t),r=[...n,...o],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=G(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:r});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,o])=>{e.push({type:n,name:t,attribute:{...s,...o}})}))}))}))})),r.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},o=G(t,"addAttributes",n);if(!o)return;const r=o();Object.entries(r).forEach((([n,o])=>{const r={...s,...o};"function"==typeof(null==r?void 0:r.default)&&(r.default=r.default()),(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete r.default,e.push({type:t.name,name:n,attribute:r})}))})),e}function Q(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function X(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{if(n[t])if("class"===t){const o=e?String(e).split(" "):[],r=n[t]?n[t].split(" "):[],s=o.filter((t=>!r.includes(t)));n[t]=[...r,...s].join(" ")}else if("style"===t){const o=e?e.split(";").map((t=>t.trim())).filter(Boolean):[],r=n[t]?n[t].split(";").map((t=>t.trim())).filter(Boolean):[],s=new Map;r.forEach((t=>{const[e,n]=t.split(":").map((t=>t.trim()));s.set(e,n)})),o.forEach((t=>{const[e,n]=t.split(":").map((t=>t.trim()));s.set(e,n)})),n[t]=Array.from(s.entries()).map((([t,e])=>`${t}: ${e}`)).join("; ")}else n[t]=e;else n[t]=e})),n}),{})}function Z(t,e){return e.filter((e=>e.type===t.type.name)).filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>X(t,e)),{})}function tt(t){return"function"==typeof t}function et(t,e=void 0,...n){return tt(t)?e?t.bind(e)(...n):t(...n):t}function nt(t={}){return 0===Object.keys(t).length&&t.constructor===Object}function ot(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}function rt(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===o)return!1;const r=e.reduce(((t,e)=>{const o=e.attribute.parseHTML?e.attribute.parseHTML(n):ot(n.getAttribute(e.name));return null==o?t:{...t,[e.name]:o}}),{});return{...o,...r}}}}function st(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!nt(e))&&null!=e)))}function it(t,e){var n;const o=Y(t),{nodeExtensions:r,markExtensions:s}=J(t),i=null===(n=r.find((t=>G(t,"topNode"))))||void 0===n?void 0:n.name,a=Object.fromEntries(r.map((n=>{const r=o.filter((t=>t.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=st({...t.reduce(((t,e)=>{const o=G(e,"extendNodeSchema",s);return{...t,...o?o(n):{}}}),{}),content:et(G(n,"content",s)),marks:et(G(n,"marks",s)),group:et(G(n,"group",s)),inline:et(G(n,"inline",s)),atom:et(G(n,"atom",s)),selectable:et(G(n,"selectable",s)),draggable:et(G(n,"draggable",s)),code:et(G(n,"code",s)),whitespace:et(G(n,"whitespace",s)),linebreakReplacement:et(G(n,"linebreakReplacement",s)),defining:et(G(n,"defining",s)),isolating:et(G(n,"isolating",s)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=et(G(n,"parseHTML",s));a&&(i.parseDOM=a.map((t=>rt(t,r))));const c=G(n,"renderHTML",s);c&&(i.toDOM=t=>c({node:t,HTMLAttributes:Z(t,r)}));const d=G(n,"renderText",s);return d&&(i.toText=d),[n.name,i]}))),c=Object.fromEntries(s.map((n=>{const r=o.filter((t=>t.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=st({...t.reduce(((t,e)=>{const o=G(e,"extendMarkSchema",s);return{...t,...o?o(n):{}}}),{}),inclusive:et(G(n,"inclusive",s)),excludes:et(G(n,"excludes",s)),group:et(G(n,"group",s)),spanning:et(G(n,"spanning",s)),code:et(G(n,"code",s)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=et(G(n,"parseHTML",s));a&&(i.parseDOM=a.map((t=>rt(t,r))));const c=G(n,"renderHTML",s);return c&&(i.toDOM=t=>c({mark:t,HTMLAttributes:Z(t,r)})),[n.name,i]})));return new h({topNode:i,nodes:a,marks:c})}function at(t,e){return e.nodes[t]||e.marks[t]||null}function ct(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function dt(t,e){const n=p.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const lt=(t,e=500)=>{let n="";const o=t.parentOffset;return t.parent.nodesBetween(Math.max(0,o-e),o,((t,e,r,s)=>{var i,a;const c=(null===(a=(i=t.type.spec).toText)||void 0===a?void 0:a.call(i,{node:t,pos:e,parent:r,index:s}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?c:c.slice(0,Math.max(0,o-e))})),n};function pt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class ut{constructor(t){this.find=t.find,this.handler=t.handler}}function ht(t){var e;const{editor:n,from:o,to:r,text:s,rules:i,plugin:a}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||(null===(e=d.nodeBefore||d.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let l=!1;const p=lt(d)+s;return i.forEach((t=>{if(l)return;const e=((t,e)=>{if(pt(e))return e.exec(t);const n=e(t);if(!n)return null;const o=[n.text];return o.index=n.index,o.input=t,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(n.replaceWith)),o})(p,t.find);if(!e)return;const i=c.state.tr,d=q({state:c.state,transaction:i}),u={from:o-(e[0].length-s.length),to:r},{commands:h,chain:m,can:f}=new K({editor:n,state:d});null!==t.handler({state:d,range:u,match:e,commands:h,chain:m,can:f})&&i.steps.length&&(i.setMeta(a,{transform:i,from:o,to:r,text:s}),c.dispatch(i),l=!0)})),l}function mt(e){const{editor:n,rules:o}=e,r=new t({state:{init:()=>null,apply(t,e,s){const i=t.getMeta(r);if(i)return i;const a=t.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:t}=a;"string"==typeof t||(t=dt(d.from(t),s.schema));const{from:e}=a,i=e+t.length;ht({editor:n,from:e,to:i,text:t,rules:o,plugin:r})})),t.selectionSet||t.docChanged?null:e}},props:{handleTextInput:(t,e,s,i)=>ht({editor:n,from:e,to:s,text:i,rules:o,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:e}=t.state.selection;e&&ht({editor:n,from:e.pos,to:e.pos,text:"",rules:o,plugin:r})})),!1)},handleKeyDown(t,e){if("Enter"!==e.key)return!1;const{$cursor:s}=t.state.selection;return!!s&&ht({editor:n,from:s.pos,to:s.pos,text:"\n",rules:o,plugin:r})}},isInputRules:!0});return r}function ft(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function gt(t,e){const n={...t};return ft(t)&&ft(e)&&Object.keys(e).forEach((o=>{ft(e[o])&&ft(t[o])?n[o]=gt(t[o],e[o]):n[o]=e[o]})),n}class vt{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new vt(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new vt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const r=o.marks();if(!!!r.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const s=r.find((t=>(null==t?void 0:t.type.name)===e.name));return s&&n.removeStoredMark(s),n.insertText(" ",o.pos),t.view.dispatch(n),!0}return!1}}function yt(t){return"number"==typeof t}class bt{constructor(t){this.find=t.find,this.handler=t.handler}}function kt(t){const{editor:e,state:n,from:o,to:r,rule:s,pasteEvent:i,dropEvent:a}=t,{commands:c,chain:d,can:l}=new K({editor:e,state:n}),p=[];n.doc.nodesBetween(o,r,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const u=Math.max(o,e),h=Math.min(r,e+t.content.size);((t,e,n)=>{if(pt(e))return[...t.matchAll(e)];const o=e(t,n);return o?o.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(u-e,h-e,void 0,""),s.find,i).forEach((t=>{if(void 0===t.index)return;const e=u+t.index+1,o=e+t[0].length,r={from:n.tr.mapping.map(e),to:n.tr.mapping.map(o)},h=s.handler({state:n,range:r,match:t,commands:c,chain:d,can:l,pasteEvent:i,dropEvent:a});p.push(h)}))}));return p.every((t=>null!==t))}let wt=null;function xt(e){const{editor:n,rules:o}=e;let r,s=null,i=!1,a=!1,c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:t,from:e,to:o,rule:s,pasteEvt:i})=>{const a=t.tr,d=q({state:t,transaction:a});if(kt({editor:n,state:d,from:Math.max(e-1,0),to:o.b-1,rule:s,pasteEvent:i,dropEvent:r})&&a.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return o.map((e=>new t({view(t){const e=e=>{var o;s=(null===(o=t.dom.parentElement)||void 0===o?void 0:o.contains(e.target))?t.dom.parentElement:null,s&&(wt=n)},o=()=>{wt&&(wt=null)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",o),{destroy(){window.removeEventListener("dragstart",e),window.removeEventListener("dragend",o)}}},props:{handleDOMEvents:{drop:(t,e)=>{if(a=s===t.dom.parentElement,r=e,!a){const t=wt;t&&setTimeout((()=>{const e=t.state.selection;e&&t.commands.deleteRange({from:e.from,to:e.to})}),10)}return!1},paste:(t,e)=>{var n;const o=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return c=e,i=!!(null==o?void 0:o.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,o)=>{const r=t[0],s="paste"===r.getMeta("uiEvent")&&!i,p="drop"===r.getMeta("uiEvent")&&!a,u=r.getMeta("applyPasteRules"),h=!!u;if(!s&&!p&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=dt(d.from(t),o.schema));const{from:n}=u,r=n+t.length,s=(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(e=n.clipboardData)||void 0===e||e.setData("text/html",t),n})(t);return l({rule:e,state:o,from:n,to:{b:r},pasteEvt:s})}const m=n.doc.content.findDiffStart(o.doc.content),f=n.doc.content.findDiffEnd(o.doc.content);return yt(m)&&f&&m!==f.b?l({rule:e,state:o,from:m,to:f,pasteEvt:c}):void 0}})))}function Mt(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return Array.from(new Set(e))}class Et{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Et.resolve(t),this.schema=it(this.extensions,e),this.setupExtensions()}static resolve(t){const e=Et.sort(Et.flatten(t)),n=Mt(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=G(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=G(t,"priority")||100,o=G(e,"priority")||100;return n>o?-1:n<o?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=G(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:at(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=Et.sort([...this.extensions].reverse()),n=[],o=[],r=e.map((e=>{const r={name:e.name,options:e.options,storage:e.storage,editor:t,type:at(e.name,this.schema)},s=[],i=G(e,"addKeyboardShortcuts",r);let a={};if("mark"===e.type&&G(e,"exitable",r)&&(a.ArrowRight=()=>vt.handleExit({editor:t,mark:e})),i){const e=Object.fromEntries(Object.entries(i()).map((([e,n])=>[e,()=>n({editor:t})])));a={...a,...e}}const d=c(a);s.push(d);const l=G(e,"addInputRules",r);ct(e,t.options.enableInputRules)&&l&&n.push(...l());const p=G(e,"addPasteRules",r);ct(e,t.options.enablePasteRules)&&p&&o.push(...p());const u=G(e,"addProseMirrorPlugins",r);if(u){const t=u();s.push(...t)}return s})).flat();return[mt({editor:t,rules:n}),...xt({editor:t,rules:o}),...r]}get attributes(){return Y(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=J(this.extensions);return Object.fromEntries(e.filter((t=>!!G(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Q(e.name,this.schema)},r=G(e,"addNodeView",o);if(!r)return[];return[e.name,(o,s,i,a,c)=>{const d=Z(o,n);return r()({node:o,view:s,getPos:i,decorations:a,innerDecorations:c,editor:t,extension:e,HTMLAttributes:d})}]})))}setupExtensions(){this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:at(t.name,this.schema)};if("mark"===t.type){(null===(e=et(G(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const o=G(t,"onBeforeCreate",n),r=G(t,"onCreate",n),s=G(t,"onUpdate",n),i=G(t,"onSelectionUpdate",n),a=G(t,"onTransaction",n),c=G(t,"onFocus",n),d=G(t,"onBlur",n),l=G(t,"onDestroy",n);o&&this.editor.on("beforeCreate",o),r&&this.editor.on("create",r),s&&this.editor.on("update",s),i&&this.editor.on("selectionUpdate",i),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),l&&this.editor.on("destroy",l)}))}}class Ot{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ot(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new Ot({...this.config,...t});return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}}function St(t,e,n){const{from:o,to:r}=e,{blockSeparator:s="\n\n",textSerializers:i={}}=n||{};let a="";return t.nodesBetween(o,r,((t,n,c,d)=>{var l;t.isBlock&&n>o&&(a+=s);const p=null==i?void 0:i[t.type.name];if(p)return c&&(a+=p({node:t,pos:n,parent:c,index:d,range:e})),!1;t.isText&&(a+=null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.slice(Math.max(o,n)-n,r-n))})),a}function Ct(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}const Tt=Ot.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new t({key:new e("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:r}=e,{ranges:s}=r,i=Math.min(...s.map((t=>t.$from.pos))),a=Math.max(...s.map((t=>t.$to.pos))),c=Ct(n);return St(o,{from:i,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});function Pt(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every((o=>n.strict?e[o]===t[o]:pt(e[o])?e[o].test(t[o]):e[o]===t[o]))}function $t(t,e,n={}){return t.find((t=>t.type===e&&Pt(Object.fromEntries(Object.keys(n).map((e=>[e,t.attrs[e]]))),n)))}function jt(t,e,n={}){return!!$t(t,e,n)}function At(t,e,n){var o;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(r.node&&r.node.marks.some((t=>t.type===e))||(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some((t=>t.type===e)))return;n=n||(null===(o=r.node.marks[0])||void 0===o?void 0:o.attrs);if(!$t([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,a=s+1,c=i+r.node.nodeSize;for(;s>0&&jt([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&jt([...t.parent.child(a).marks],e,n);)c+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:c}}function It(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Nt(t){return t instanceof r}function Bt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Rt(t,e=null){if(!e)return null;const n=o.atStart(t),s=o.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return s;const i=n.from,a=s.to;return"all"===e?r.create(t,Bt(0,i,a),Bt(t.content.size,i,a)):r.create(t,Bt(e,i,a),Bt(e,i,a))}function Dt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const zt=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];3===o.nodeType&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):1===o.nodeType&&zt(o)}return t};function Lt(t){const e=`<body>${t}</body>`,n=(new window.DOMParser).parseFromString(e,"text/html").body;return zt(n)}function Ft(t,e,n){if(t instanceof u||t instanceof d)return t;n={slice:!0,parseOptions:{},...n};const o="string"==typeof t;if("object"==typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return d.fromArray(t.map((t=>e.nodeFromJSON(t))));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ft("",e,n)}if(o){if(n.errorOnInvalidContent){let o=!1,r="";const s=new h({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:t=>(o=!0,r="string"==typeof t?t:t.outerHTML,null)}]}})});if(n.slice?m.fromSchema(s).parseSlice(Lt(t),n.parseOptions):m.fromSchema(s).parse(Lt(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${r}`)})}const o=m.fromSchema(e);return n.slice?o.parseSlice(Lt(t),n.parseOptions).content:o.parse(Lt(t),n.parseOptions)}return Ft("",e,n)}function Ht(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof w||s instanceof x))return;const i=t.mapping.maps[r];let a=0;i.forEach(((t,e,n,o)=>{0===a&&(a=o)})),t.setSelection(o.near(t.doc.resolve(a),n))}function Vt(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Wt(t,e,n={}){const{from:o,to:r,empty:s}=t.selection,i=e?Q(e,t.schema):null,a=[];t.doc.nodesBetween(o,r,((t,e)=>{if(t.isText)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);a.push({node:t,from:n,to:s})}));const c=r-o,d=a.filter((t=>!i||i.name===t.node.type.name)).filter((t=>Pt(t.node.attrs,n,{strict:!1})));if(s)return!!d.length;return d.reduce(((t,e)=>t+e.to-e.from),0)>=c}function _t(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function qt(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,o)=>(n.includes(o)||(e[o]=t[o]),e)),{})}function Kt(t,e,n={},o={}){return Ft(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}function Ut(t,e){const n=It(e,t.schema),{from:o,to:r,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,r,(t=>{i.push(...t.marks)}));const a=i.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function Gt(t,e){const n=new v(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}function Jt(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Yt(t,e,n){const o=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&o.push({node:t,pos:e})})),o}function Qt(t,e){for(let n=t.depth;n>0;n-=1){const o=t.node(n);if(e(o))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:o}}}function Xt(t){return e=>Qt(e.$from,t)}function Zt(t,e){return St(t,{from:0,to:t.content.size},e)}function te(t,e){const n=Q(e,t.schema),{from:o,to:r}=t.selection,s=[];t.doc.nodesBetween(o,r,(t=>{s.push(t)}));const i=s.reverse().find((t=>t.type.name===n.name));return i?{...i.attrs}:{}}function ee(t,e){const n=_t("string"==typeof e?e:e.name,t.schema);return"node"===n?te(t,e):"mark"===n?Ut(t,e):{}}function ne(t,e=JSON.stringify){const n={};return t.filter((t=>{const o=e(t);return!Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=!0)}))}function oe(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach(((t,r)=>{const s=[];if(t.ranges.length)t.forEach(((t,e)=>{s.push({from:t,to:e})}));else{const{from:t,to:e}=n[r];if(void 0===t||void 0===e)return;s.push({from:t,to:e})}s.forEach((({from:t,to:n})=>{const s=e.slice(r).map(t,-1),i=e.slice(r).map(n),a=e.invert().map(s,-1),c=e.invert().map(i);o.push({oldRange:{from:a,to:c},newRange:{from:s,to:i}})}))})),function(t){const e=ne(t);return 1===e.length?e:e.filter(((t,n)=>!e.filter(((t,e)=>e!==n)).some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))))}(o)}function re(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach((e=>{const r=At(n.resolve(t),e.type);r&&o.push({mark:e,...r})})):n.nodesBetween(t,e,((t,e)=>{t&&void 0!==(null==t?void 0:t.nodeSize)&&o.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),o}function se(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const o=t.find((t=>t.type===e&&t.name===n));return!!o&&o.attribute.keepOnSplit})))}function ie(t,e,n={}){const{empty:o,ranges:r}=t.selection,s=e?It(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!s||s.name===t.type.name)).find((t=>Pt(t.attrs,n,{strict:!1})));let i=0;const a=[];if(r.forEach((({$from:e,$to:n})=>{const o=e.pos,r=n.pos;t.doc.nodesBetween(o,r,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);i+=s-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:s}))))}))})),0===i)return!1;const c=a.filter((t=>!s||s.name===t.mark.type.name)).filter((t=>Pt(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),d=a.filter((t=>!s||t.mark.type!==s&&t.mark.type.excludes(s))).reduce(((t,e)=>t+e.to-e.from),0);return(c>0?c+d:c)>=i}function ae(t,e,n={}){if(!e)return Wt(t,null,n)||ie(t,null,n);const o=_t(e,t.schema);return"node"===o?Wt(t,e,n):"mark"===o&&ie(t,e,n)}function ce(t,e){const{nodeExtensions:n}=J(e),o=n.find((e=>e.name===t));if(!o)return!1;const r=et(G(o,"group",{name:o.name,options:o.options,storage:o.storage}));return"string"==typeof r&&r.split(" ").includes("list")}function de(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!==(o=t.text)&&void 0!==o?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(e){let o=!0;return t.content.forEach((t=>{!1!==o&&(de(t,{ignoreWhitespace:n,checkChildren:e})||(o=!1))})),o}return!1}function le(t){return t instanceof n}function pe(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(o)}}const ue=(t,e)=>{const n=Xt((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return n.node.type!==(null==r?void 0:r.type)||!g(t.doc,n.pos)||(t.join(n.pos),!0)},he=(t,e)=>{const n=Xt((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return n.node.type!==(null==r?void 0:r.type)||!g(t.doc,o)||(t.join(o),!0)};var me=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:r}=o;return!n||(r.forEach((({$from:n,$to:o})=>{t.doc.nodesBetween(n.pos,o.pos,((t,n)=>{if(t.type.isText)return;const{doc:o,mapping:r}=e,s=o.resolve(r.map(n)),i=o.resolve(r.map(n+t.nodeSize)),a=s.blockRange(i);if(!a)return;const c=y(a);if(t.type.isTextblock){const{defaultType:t}=s.parent.contentMatchAt(s.index());e.setNodeMarkup(a.start,t)}(c||0===c)&&e.lift(a,c)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>M(t,e),cut:(t,e)=>({editor:n,tr:o})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const a=o.mapping.map(e);return o.insert(a,i.content),o.setSelection(new r(o.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const r=t.selection.$anchor;for(let n=r.depth;n>0;n-=1){if(r.node(n).type===o.type){if(e){const e=r.before(n),o=r.after(n);t.delete(e,o).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:o})=>{const r=Q(t,n.schema),s=e.selection.$anchor;for(let t=s.depth;t>0;t-=1){if(s.node(t).type===r){if(o){const n=s.before(t),o=s.after(t);e.delete(n,o).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:o,to:r}=t;return n&&e.delete(o,r),!0},deleteSelection:()=>({state:t,dispatch:e})=>E(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>O(t,e),extendMarkRange:(t,e={})=>({tr:n,state:o,dispatch:s})=>{const i=It(t,o.schema),{doc:a,selection:c}=n,{$from:d,from:l,to:p}=c;if(s){const t=At(d,i,e);if(t&&t.from<=l&&t.to>=p){const e=r.create(a,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:o,tr:r,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(Dt()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(o.hasFocus()&&null===t||!1===t)return!0;if(s&&null===t&&!Nt(n.state.selection))return i(),!0;const a=Rt(r.doc,t)||n.state.selection,c=n.state.selection.eq(a);return s&&(c||r.setSelection(a),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},forEach:(t,e)=>n=>t.every(((t,o)=>e(t,{...n,index:o}))),insertContent:(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:o,dispatch:r,editor:s})=>{var i;if(r){let r;n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};try{r=Ft(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:null!==(i=n.errorOnInvalidContent)&&void 0!==i?i:s.options.enableContentCheck})}catch(t){return s.emit("contentError",{editor:s,error:t,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:a,to:c}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},l=!0,p=!0;if(("type"in r?[r]:r).forEach((t=>{t.check(),l=!!l&&(t.isText&&0===t.marks.length),p=!!p&&t.isBlock})),a===c&&p){const{parent:t}=o.doc.resolve(a);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(a-=1,c+=1)}let u;if(l){if(Array.isArray(e))u=e.map((t=>t.text||"")).join("");else if(e instanceof d){let t="";e.forEach((e=>{e.text&&(t+=e.text)})),u=t}else u="object"==typeof e&&e&&e.text?e.text:e;o.insertText(u,a,c)}else u=r,o.replaceWith(a,c,u);n.updateSelection&&Ht(o,o.steps.length-1,-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:a,text:u}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:a,text:u})}return!0},joinBackward:()=>({state:t,dispatch:e})=>T(t,e),joinDown:()=>({state:t,dispatch:e})=>C(t,e),joinForward:()=>({state:t,dispatch:e})=>P(t,e),joinItemBackward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=b(t.doc,t.selection.$from.pos,-1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=b(t.doc,t.selection.$from.pos,1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinTextblockBackward:()=>({state:t,dispatch:e})=>$(t,e),joinTextblockForward:()=>({state:t,dispatch:e})=>j(t,e),joinUp:()=>({state:t,dispatch:e})=>S(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:o,dispatch:r})=>{const s=function(t){const e=t.split(/-(?!$)/);let n,o,r,s,i=e[e.length-1];"Space"===i&&(i=" ");for(let t=0;t<e.length-1;t+=1){const i=e[t];if(/^(cmd|meta|m)$/i.test(i))s=!0;else if(/^a(lt)?$/i.test(i))n=!0;else if(/^(c|ctrl|control)$/i.test(i))o=!0;else if(/^s(hift)?$/i.test(i))r=!0;else{if(!/^mod$/i.test(i))throw new Error(`Unrecognized modifier name: ${i}`);Dt()||Vt()?s=!0:o=!0}}return n&&(i=`Alt-${i}`),o&&(i=`Ctrl-${i}`),s&&(i=`Meta-${i}`),r&&(i=`Shift-${i}`),i}(t).split(/-(?!$)/),i=s.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===i?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==c||c.steps.forEach((t=>{const e=t.map(o.mapping);e&&r&&o.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:o})=>!!Wt(n,Q(t,n.schema),e)&&A(n,o),liftEmptyBlock:()=>({state:t,dispatch:e})=>I(t,e),liftListItem:t=>({state:e,dispatch:n})=>{const o=Q(t,e.schema);return V(o)(e,n)},newlineInCode:()=>({state:t,dispatch:e})=>N(t,e),resetAttributes:(t,e)=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=_t("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=Q(t,o.schema)),"mark"===a&&(i=It(t,o.schema)),r&&n.selection.ranges.forEach((t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,o)=>{s&&s===t.type&&n.setNodeMarkup(o,void 0,qt(t.attrs,e)),i&&t.marks.length&&t.marks.forEach((r=>{i===r.type&&n.addMark(o,o+t.nodeSize,i.create(qt(r.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,dispatch:e})=>{if(e){const e=new s(t.doc);t.setSelection(e)}return!0},selectNodeBackward:()=>({state:t,dispatch:e})=>B(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>R(t,e),selectParentNode:()=>({state:t,dispatch:e})=>D(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>z(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>L(t,e),setContent:(t,e=!1,n={},o={})=>({editor:r,tr:s,dispatch:i,commands:a})=>{var c,d;const{doc:l}=s;if("full"!==n.preserveWhitespace){const a=Kt(t,r.schema,n,{errorOnInvalidContent:null!==(c=o.errorOnInvalidContent)&&void 0!==c?c:r.options.enableContentCheck});return i&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!e),!0}return i&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:null!==(d=o.errorOnInvalidContent)&&void 0!==d?d:r.options.enableContentCheck})},setMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{const{selection:s}=n,{empty:i,ranges:a}=s,c=It(t,o.schema);if(r)if(i){const t=Ut(o,c);n.addStoredMark(c.create({...t,...e}))}else a.forEach((t=>{const r=t.$from.pos,s=t.$to.pos;o.doc.nodesBetween(r,s,((t,o)=>{const i=Math.max(o,r),a=Math.min(o+t.nodeSize,s);t.marks.find((t=>t.type===c))?t.marks.forEach((t=>{c===t.type&&n.addMark(i,a,c.create({...t.attrs,...e}))})):n.addMark(i,a,c.create(e))}))}));return function(t,e,n){var o;const{selection:r}=e;let s=null;if(Nt(r)&&(s=r.$cursor),s){const e=null!==(o=t.storedMarks)&&void 0!==o?o:s.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:i}=r;return i.some((({$from:e,$to:o})=>{let r=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,o.pos,((t,e,o)=>{if(r)return!1;if(t.isInline){const e=!o||o.type.allowsMarkType(n),s=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));r=e&&s}return!r})),r}))}(o,n,c)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:o,chain:r})=>{const s=Q(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?r().command((({commands:t})=>!!F(s,{...i,...e})(n)||t.clearNodes())).command((({state:t})=>F(s,{...i,...e})(t,o))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:o})=>{if(o){const{doc:o}=e,r=Bt(t,0,o.content.size),s=n.create(o,r);e.setSelection(s)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:o,to:s}="number"==typeof t?{from:t,to:t}:t,i=r.atStart(n).from,a=r.atEnd(n).to,c=Bt(o,i,a),d=Bt(s,i,a),l=r.create(n,c,d);e.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const o=Q(t,e.schema);return W(o)(e,n)},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:o,dispatch:s,editor:i})=>{const{selection:a,doc:c}=e,{$from:d,$to:l}=a,p=se(i.extensionManager.attributes,d.node().type.name,d.node().attrs);if(a instanceof n&&a.node.isBlock)return!(!d.parentOffset||!k(c,d.pos))&&(s&&(t&&pe(o,i.extensionManager.splittableMarks),e.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;const u=l.parentOffset===l.parent.content.size,h=0===d.depth?void 0:Jt(d.node(-1).contentMatchAt(d.indexAfter(-1)));let m=u&&h?[{type:h,attrs:p}]:void 0,f=k(e.doc,e.mapping.map(d.pos),1,m);if(m||f||!k(e.doc,e.mapping.map(d.pos),1,h?[{type:h}]:void 0)||(f=!0,m=h?[{type:h,attrs:p}]:void 0),s){if(f&&(a instanceof r&&e.deleteSelection(),e.split(e.mapping.map(d.pos),1,m),h&&!u&&!d.parentOffset&&d.parent.type!==h)){const t=e.mapping.map(d.before()),n=e.doc.resolve(t);d.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&e.setNodeMarkup(e.mapping.map(d.before()),h)}t&&pe(o,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},splitListItem:(t,e={})=>({tr:n,state:o,dispatch:s,editor:i})=>{var a;const c=Q(t,o.schema),{$from:p,$to:u}=o.selection,h=o.selection.node;if(h&&h.isBlock||p.depth<2||!p.sameParent(u))return!1;const m=p.node(-1);if(m.type!==c)return!1;const f=i.extensionManager.attributes;if(0===p.parent.content.size&&p.node(-1).childCount===p.indexAfter(-1)){if(2===p.depth||p.node(-3).type!==c||p.index(-2)!==p.node(-2).childCount-1)return!1;if(s){let t=d.empty;const o=p.index(-1)?1:p.index(-2)?2:3;for(let e=p.depth-o;e>=p.depth-3;e-=1)t=d.from(p.node(e).copy(t));const s=p.indexAfter(-1)<p.node(-2).childCount?1:p.indexAfter(-2)<p.node(-3).childCount?2:3,i={...se(f,p.node().type.name,p.node().attrs),...e},u=(null===(a=c.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(i))||void 0;t=t.append(d.from(c.createAndFill(null,u)||void 0));const h=p.before(p.depth-(o-1));n.replace(h,p.after(-s),new l(t,4-o,0));let m=-1;n.doc.nodesBetween(h,n.doc.content.size,((t,e)=>{if(m>-1)return!1;t.isTextblock&&0===t.content.size&&(m=e+1)})),m>-1&&n.setSelection(r.near(n.doc.resolve(m))),n.scrollIntoView()}return!0}const g=u.pos===p.end()?m.contentMatchAt(0).defaultType:null,v={...se(f,m.type.name,m.attrs),...e},y={...se(f,p.node().type.name,p.node().attrs),...e};n.delete(p.pos,u.pos);const b=g?[{type:c,attrs:v},{type:g,attrs:y}]:[{type:c,attrs:v}];if(!k(n.doc,p.pos,2))return!1;if(s){const{selection:t,storedMarks:e}=o,{splittableMarks:r}=i.extensionManager,a=e||t.$to.parentOffset&&t.$from.marks();if(n.split(p.pos,2,b).scrollIntoView(),!a||!s)return!0;const c=a.filter((t=>r.includes(t.type.name)));n.ensureMarks(c)}return!0},toggleList:(t,e,n,o={})=>({editor:r,tr:s,state:i,dispatch:a,chain:c,commands:d,can:l})=>{const{extensions:p,splittableMarks:u}=r.extensionManager,h=Q(t,i.schema),m=Q(e,i.schema),{selection:f,storedMarks:g}=i,{$from:v,$to:y}=f,b=v.blockRange(y),k=g||f.$to.parentOffset&&f.$from.marks();if(!b)return!1;const w=Xt((t=>ce(t.type.name,p)))(f);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===h)return d.liftListItem(m);if(ce(w.node.type.name,p)&&h.validContent(w.node.content)&&a)return c().command((()=>(s.setNodeMarkup(w.pos,h),!0))).command((()=>ue(s,h))).command((()=>he(s,h))).run()}return n&&k&&a?c().command((()=>{const t=l().wrapInList(h,o),e=k.filter((t=>u.includes(t.type.name)));return s.ensureMarks(e),!!t||d.clearNodes()})).wrapInList(h,o).command((()=>ue(s,h))).command((()=>he(s,h))).run():c().command((()=>!!l().wrapInList(h,o)||d.clearNodes())).wrapInList(h,o).command((()=>ue(s,h))).command((()=>he(s,h))).run()},toggleMark:(t,e={},n={})=>({state:o,commands:r})=>{const{extendEmptyMarkRange:s=!1}=n,i=It(t,o.schema);return ie(o,i,e)?r.unsetMark(i,{extendEmptyMarkRange:s}):r.setMark(i,e)},toggleNode:(t,e,n={})=>({state:o,commands:r})=>{const s=Q(t,o.schema),i=Q(e,o.schema),a=Wt(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),a?r.setNode(i,c):r.setNode(s,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:o})=>{const r=Q(t,n.schema);return Wt(n,r,e)?o.lift(r):o.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const r=n[o];let s;if(r.spec.isInputRules&&(s=r.getState(t))){if(e){const e=t.tr,n=s.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(s.text){const n=e.doc.resolve(s.from).marks();e.replaceWith(s.from,s.to,t.schema.text(s.text,n))}else e.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:r}=n;return o||e&&r.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,c=It(t,o.schema),{$from:d,empty:l,ranges:p}=a;if(!r)return!0;if(l&&i){let{from:t,to:e}=a;const o=null===(s=d.marks().find((t=>t.type===c)))||void 0===s?void 0:s.attrs,r=At(d,c,o);r&&(t=r.from,e=r.to),n.removeMark(t,e,c)}else p.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,c)}));return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=_t("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=Q(t,o.schema)),"mark"===a&&(i=It(t,o.schema)),r&&n.selection.ranges.forEach((t=>{const r=t.$from.pos,a=t.$to.pos;let c,d,l,p;n.selection.empty?o.doc.nodesBetween(r,a,((t,e)=>{s&&s===t.type&&(l=Math.max(e,r),p=Math.min(e+t.nodeSize,a),c=e,d=t)})):o.doc.nodesBetween(r,a,((t,o)=>{o<r&&s&&s===t.type&&(l=Math.max(o,r),p=Math.min(o+t.nodeSize,a),c=o,d=t),o>=r&&o<=a&&(s&&s===t.type&&n.setNodeMarkup(o,void 0,{...t.attrs,...e}),i&&t.marks.length&&t.marks.forEach((s=>{if(i===s.type){const c=Math.max(o,r),d=Math.min(o+t.nodeSize,a);n.addMark(c,d,i.create({...s.attrs,...e}))}})))})),d&&(void 0!==c&&n.setNodeMarkup(c,void 0,{...d.attrs,...e}),i&&d.marks.length&&d.marks.forEach((t=>{i===t.type&&n.addMark(l,p,i.create({...t.attrs,...e}))})))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:o})=>{const r=Q(t,n.schema);return H(r,e)(n,o)},wrapInList:(t,e={})=>({state:n,dispatch:o})=>{const r=Q(t,n.schema);return _(r,e)(n,o)}});const fe=Ot.create({name:"commands",addCommands:()=>({...me})}),ge=Ot.create({name:"drop",addProseMirrorPlugins(){return[new t({key:new e("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),ve=Ot.create({name:"editable",addProseMirrorPlugins(){return[new t({key:new e("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ye=Ot.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new t({key:new e("focusEvents"),props:{handleDOMEvents:{focus:(t,e)=>{n.isFocused=!0;const o=n.state.tr.setMeta("focus",{event:e}).setMeta("addToHistory",!1);return t.dispatch(o),!1},blur:(t,e)=>{n.isFocused=!1;const o=n.state.tr.setMeta("blur",{event:e}).setMeta("addToHistory",!1);return t.dispatch(o),!1}}}})]}}),be=Ot.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:s,$anchor:i}=n,{pos:a,parent:c}=i,d=i.parent.isTextblock&&a>0?e.doc.resolve(a-1):i,l=d.parent.type.spec.isolating,p=i.pos-i.parentOffset,u=l&&1===d.parent.childCount?p===i.pos:o.atStart(r).from===a;return!(!s||!c.type.isTextblock||c.textContent.length||!u||u&&"paragraph"===i.parent.type.name)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},s={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Dt()||Vt()?s:r},addProseMirrorPlugins(){return[new t({key:new e("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some((t=>t.getMeta("composition"))))return;const r=t.some((t=>t.docChanged))&&!e.doc.eq(n.doc),s=t.some((t=>t.getMeta("preventClearDocument")));if(!r||s)return;const{empty:i,from:a,to:c}=e.selection,d=o.atStart(e.doc).from,l=o.atEnd(e.doc).to;if(i||!(a===d&&c===l))return;if(!de(n.doc))return;const p=n.tr,u=q({state:n,transaction:p}),{commands:h}=new K({editor:this.editor,state:u});return h.clearNodes(),p.steps.length?p:void 0}})]}}),ke=Ot.create({name:"paste",addProseMirrorPlugins(){return[new t({key:new e("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),we=Ot.create({name:"tabindex",addProseMirrorPlugins(){return[new t({key:new e("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class xe{get name(){return this.node.type.name}constructor(t,e,n=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=e,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return null!==(t=this.actualDepth)&&void 0!==t?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(t);return new xe(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new xe(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new xe(t,this.editor)}get children(){const t=[];return this.node.content.forEach(((e,n)=>{const o=e.isBlock&&!e.isTextblock,r=e.isAtom&&!e.isText,s=this.pos+n+(r?0:1),i=this.resolvedPos.doc.resolve(s);if(!o&&i.depth<=this.depth)return;const a=new xe(i,this.editor,o,o?e:null);o&&(a.actualDepth=this.depth+1),t.push(new xe(i,this.editor,o,o?e:null))})),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let n=null,o=this.parent;for(;o&&!n;){if(o.node.type.name===t)if(Object.keys(e).length>0){const t=o.node.attrs,n=Object.keys(e);for(let o=0;o<n.length;o+=1){const r=n[o];if(t[r]!==e[r])break}}else n=o;o=o.parent}return n}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},n=!1){let o=[];if(!this.children||0===this.children.length)return o;const r=Object.keys(e);return this.children.forEach((s=>{if(!(n&&o.length>0)){if(s.node.type.name===t){r.every((t=>e[t]===s.node.attrs[t]))&&o.push(s)}n&&o.length>0||(o=o.concat(s.querySelectorAll(t,e,n)))}})),o}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}}function Me(t,e,n){const o=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==o)return o;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}class Ee extends U{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",(({event:t,slice:e,moved:n})=>this.options.onDrop(t,e,n))),this.on("paste",(({event:t,slice:e})=>this.options.onPaste(t,e))),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Me('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=tt(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach((t=>{const o="string"==typeof t?`${t}$`:t.key;n=e.filter((t=>!t.key.startsWith(o)))})),e.length===n.length)return;const o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[ve,Tt.configure({blockSeparator:null===(e=null===(t=this.options.coreExtensionOptions)||void 0===t?void 0:t.clipboardTextSerializer)||void 0===e?void 0:e.blockSeparator}),fe,ye,be,we,ge,ke].filter((t=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name])):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new Et(n,this)}createCommandManager(){this.commandManager=new K({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let e;try{e=Kt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter((t=>"collaboration"!==t.name)),this.createExtensionManager()}}),e=Kt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=Rt(e,this.options.autofocus);this.view=new a(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null===(t=this.options.editorProps)||void 0===t?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:i.create({doc:e,selection:n||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),r=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),r&&this.emit("blur",{editor:this,event:r.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return ee(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,o="string"==typeof t?e:t;return ae(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return dt(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return Zt(this.state.doc,{blockSeparator:e,textSerializers:{...Ct(this.schema),...n}})}get isEmpty(){return de(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}$node(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new xe(e,this)}get $doc(){return this.$pos(0)}}function Oe(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=et(t.getAttributes,void 0,o);if(!1===r||null===r)return null;const{tr:s}=e,i=o[o.length-1],a=o[0];if(i){const o=a.search(/\S/),c=n.from+a.indexOf(i),d=c+i.length;if(re(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>c)).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+o,c);const l=n.from+o+i.length;s.addMark(n.from+o,l,t.type.create(r||{})),s.removeStoredMark(t.type)}}})}function Se(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=et(t.getAttributes,void 0,o)||{},{tr:s}=e,i=n.from;let a=n.to;const c=t.type.create(r);if(o[1]){let t=i+o[0].lastIndexOf(o[1]);t>a?t=a:a=t+o[1].length;const e=o[0][o[0].length-1];s.insertText(e,i+o[0].length-1),s.replaceWith(t,a,c)}else if(o[0]){const e=t.type.isInline?i:i-1;s.insert(e,t.type.create(r)).delete(s.mapping.map(i),s.mapping.map(a))}s.scrollIntoView()}})}function Ce(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=e.doc.resolve(n.from),s=et(t.getAttributes,void 0,o)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Te(t){return new ut({find:t.find,handler:({state:e,range:n,match:o,chain:r})=>{const s=et(t.getAttributes,void 0,o)||{},i=e.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),c=a&&f(a,t.type,s);if(!c)return null;if(i.wrap(a,c),t.keepMarks&&t.editor){const{selection:n,storedMarks:o}=e,{splittableMarks:r}=t.editor.extensionManager,s=o||n.$to.parentOffset&&n.$from.marks();if(s){const t=s.filter((t=>r.includes(t.type.name)));i.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";r().updateAttributes(e,s).run()}const d=i.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&g(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&i.join(n.from-1)}})}class Pe{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Pe(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new Pe(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}}function $e(t){return new bt({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:r})=>{const s=et(t.getAttributes,void 0,o,r);if(!1===s||null===s)return null;const{tr:i}=e,a=o[o.length-1],c=o[0];let d=n.to;if(a){const o=c.search(/\S/),r=n.from+c.indexOf(a),l=r+a.length;if(re(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>r)).length)return null;l<n.to&&i.delete(l,n.to),r>n.from&&i.delete(n.from+o,r),d=n.from+o+a.length,i.addMark(n.from+o,d,t.type.create(s||{})),i.removeStoredMark(t.type)}}})}export{K as CommandManager,Ee as Editor,Ot as Extension,ut as InputRule,vt as Mark,Pe as Node,xe as NodePos,bt as PasteRule,et as callOrReturn,Gt as combineTransactionSteps,q as createChainableState,Kt as createDocument,Ft as createNodeFromContent,Me as createStyleTag,Jt as defaultBlockAt,qt as deleteProps,Lt as elementFromString,Yt as findChildrenInRange,Mt as findDuplicates,Xt as findParentNode,Qt as findParentNodeClosestToPos,ot as fromString,ee as getAttributes,Y as getAttributesFromExtensions,oe as getChangedRanges,G as getExtensionField,dt as getHTMLFromFragment,Ut as getMarkAttributes,At as getMarkRange,It as getMarkType,re as getMarksBetween,te as getNodeAttributes,Q as getNodeType,Z as getRenderedAttributes,it as getSchemaByResolvedExtensions,at as getSchemaTypeByName,_t as getSchemaTypeNameByName,se as getSplittedAttributes,Zt as getText,St as getTextBetween,lt as getTextContentFromNodes,Ct as getTextSerializersFromSchema,rt as injectExtensionAttributesToParseRule,mt as inputRulesPlugin,ae as isActive,nt as isEmptyObject,ct as isExtensionRulesEnabled,tt as isFunction,ce as isList,Vt as isMacOS,ie as isMarkActive,Wt as isNodeActive,de as isNodeEmpty,le as isNodeSelection,yt as isNumber,ft as isPlainObject,pt as isRegExp,Nt as isTextSelection,Dt as isiOS,Oe as markInputRule,$e as markPasteRule,X as mergeAttributes,gt as mergeDeep,Bt as minMax,Se as nodeInputRule,Pt as objectIncludes,xt as pasteRulesPlugin,ne as removeDuplicates,Rt as resolveFocusPosition,Ht as selectionToInsertionEnd,J as splitExtensions,Ce as textblockTypeInputRule,Te as wrappingInputRule};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../prosemirror-state/dist/index.js"),e=require("../../../prosemirror-view/dist/index.js"),n=require("../../../prosemirror-keymap/dist/index.js"),o=require("../../../prosemirror-model/dist/index.js"),r=require("../../../prosemirror-transform/dist/index.js"),s=require("../../../prosemirror-commands/dist/index.js"),i=require("../../../prosemirror-schema-list/dist/index.js");function a(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:r}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return r},get tr(){return o=n.selection,r=n.doc,s=n.storedMarks,n}}}class c{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:r}=n,s=this.buildProps(r);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(s);return r.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(r),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i=[],a=!!t,c=t||r.tr,d={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const o=this.buildProps(c,e),r=n(...t)(o);return i.push(r),d}]))),run:()=>(a||!e||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),i.every((t=>!0===t)))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,r=t||n.tr,s=this.buildProps(r,o),i=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...s,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i={tr:t,editor:o,view:s,state:a({state:r,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(i)])))}};return i}}class d{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}}function l(t,e,n){if(void 0===t.config[e]&&t.parent)return l(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?l(t.parent,e,n):null})}return t.config[e]}function p(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function u(t){const e=[],{nodeExtensions:n,markExtensions:o}=p(t),r=[...n,...o],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=l(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:r});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,o])=>{e.push({type:n,name:t,attribute:{...s,...o}})}))}))}))})),r.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},o=l(t,"addAttributes",n);if(!o)return;const r=o();Object.entries(r).forEach((([n,o])=>{const r={...s,...o};"function"==typeof(null==r?void 0:r.default)&&(r.default=r.default()),(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete r.default,e.push({type:t.name,name:n,attribute:r})}))})),e}function h(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function m(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{if(n[t])if("class"===t){const o=e?String(e).split(" "):[],r=n[t]?n[t].split(" "):[],s=o.filter((t=>!r.includes(t)));n[t]=[...r,...s].join(" ")}else if("style"===t){const o=e?e.split(";").map((t=>t.trim())).filter(Boolean):[],r=n[t]?n[t].split(";").map((t=>t.trim())).filter(Boolean):[],s=new Map;r.forEach((t=>{const[e,n]=t.split(":").map((t=>t.trim()));s.set(e,n)})),o.forEach((t=>{const[e,n]=t.split(":").map((t=>t.trim()));s.set(e,n)})),n[t]=Array.from(s.entries()).map((([t,e])=>`${t}: ${e}`)).join("; ")}else n[t]=e;else n[t]=e})),n}),{})}function f(t,e){return e.filter((e=>e.type===t.type.name)).filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>m(t,e)),{})}function g(t){return"function"==typeof t}function y(t,e=void 0,...n){return g(t)?e?t.bind(e)(...n):t(...n):t}function x(t={}){return 0===Object.keys(t).length&&t.constructor===Object}function v(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}function b(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===o)return!1;const r=e.reduce(((t,e)=>{const o=e.attribute.parseHTML?e.attribute.parseHTML(n):v(n.getAttribute(e.name));return null==o?t:{...t,[e.name]:o}}),{});return{...o,...r}}}}function k(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!x(e))&&null!=e)))}function w(t,e){var n;const r=u(t),{nodeExtensions:s,markExtensions:i}=p(t),a=null===(n=s.find((t=>l(t,"topNode"))))||void 0===n?void 0:n.name,c=Object.fromEntries(s.map((n=>{const o=r.filter((t=>t.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=k({...t.reduce(((t,e)=>{const o=l(e,"extendNodeSchema",s);return{...t,...o?o(n):{}}}),{}),content:y(l(n,"content",s)),marks:y(l(n,"marks",s)),group:y(l(n,"group",s)),inline:y(l(n,"inline",s)),atom:y(l(n,"atom",s)),selectable:y(l(n,"selectable",s)),draggable:y(l(n,"draggable",s)),code:y(l(n,"code",s)),whitespace:y(l(n,"whitespace",s)),linebreakReplacement:y(l(n,"linebreakReplacement",s)),defining:y(l(n,"defining",s)),isolating:y(l(n,"isolating",s)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=y(l(n,"parseHTML",s));a&&(i.parseDOM=a.map((t=>b(t,o))));const c=l(n,"renderHTML",s);c&&(i.toDOM=t=>c({node:t,HTMLAttributes:f(t,o)}));const d=l(n,"renderText",s);return d&&(i.toText=d),[n.name,i]}))),d=Object.fromEntries(i.map((n=>{const o=r.filter((t=>t.type===n.name)),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=k({...t.reduce(((t,e)=>{const o=l(e,"extendMarkSchema",s);return{...t,...o?o(n):{}}}),{}),inclusive:y(l(n,"inclusive",s)),excludes:y(l(n,"excludes",s)),group:y(l(n,"group",s)),spanning:y(l(n,"spanning",s)),code:y(l(n,"code",s)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=y(l(n,"parseHTML",s));a&&(i.parseDOM=a.map((t=>b(t,o))));const c=l(n,"renderHTML",s);return c&&(i.toDOM=t=>c({mark:t,HTMLAttributes:f(t,o)})),[n.name,i]})));return new o.Schema({topNode:a,nodes:c,marks:d})}function M(t,e){return e.nodes[t]||e.marks[t]||null}function S(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function E(t,e){const n=o.DOMSerializer.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const O=(t,e=500)=>{let n="";const o=t.parentOffset;return t.parent.nodesBetween(Math.max(0,o-e),o,((t,e,r,s)=>{var i,a;const c=(null===(a=(i=t.type.spec).toText)||void 0===a?void 0:a.call(i,{node:t,pos:e,parent:r,index:s}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?c:c.slice(0,Math.max(0,o-e))})),n};function C(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class T{constructor(t){this.find=t.find,this.handler=t.handler}}function P(t){var e;const{editor:n,from:o,to:r,text:s,rules:i,plugin:d}=t,{view:l}=n;if(l.composing)return!1;const p=l.state.doc.resolve(o);if(p.parent.type.spec.code||(null===(e=p.nodeBefore||p.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let u=!1;const h=O(p)+s;return i.forEach((t=>{if(u)return;const e=((t,e)=>{if(C(e))return e.exec(t);const n=e(t);if(!n)return null;const o=[n.text];return o.index=n.index,o.input=t,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(n.replaceWith)),o})(h,t.find);if(!e)return;const i=l.state.tr,p=a({state:l.state,transaction:i}),m={from:o-(e[0].length-s.length),to:r},{commands:f,chain:g,can:y}=new c({editor:n,state:p});null!==t.handler({state:p,range:m,match:e,commands:f,chain:g,can:y})&&i.steps.length&&(i.setMeta(d,{transform:i,from:o,to:r,text:s}),l.dispatch(i),u=!0)})),u}function A(e){const{editor:n,rules:r}=e,s=new t.Plugin({state:{init:()=>null,apply(t,e,i){const a=t.getMeta(s);if(a)return a;const c=t.getMeta("applyInputRules");return!!c&&setTimeout((()=>{let{text:t}=c;"string"==typeof t||(t=E(o.Fragment.from(t),i.schema));const{from:e}=c,a=e+t.length;P({editor:n,from:e,to:a,text:t,rules:r,plugin:s})})),t.selectionSet||t.docChanged?null:e}},props:{handleTextInput:(t,e,o,i)=>P({editor:n,from:e,to:o,text:i,rules:r,plugin:s}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:e}=t.state.selection;e&&P({editor:n,from:e.pos,to:e.pos,text:"",rules:r,plugin:s})})),!1)},handleKeyDown(t,e){if("Enter"!==e.key)return!1;const{$cursor:o}=t.state.selection;return!!o&&P({editor:n,from:o.pos,to:o.pos,text:"\n",rules:r,plugin:s})}},isInputRules:!0});return s}function j(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function $(t,e){const n={...t};return j(t)&&j(e)&&Object.keys(e).forEach((o=>{j(e[o])&&j(t[o])?n[o]=$(t[o],e[o]):n[o]=e[o]})),n}class N{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=y(l(this,"addOptions",{name:this.name}))),this.storage=y(l(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new N(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>$(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new N(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=y(l(e,"addOptions",{name:e.name})),e.storage=y(l(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const r=o.marks();if(!!!r.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const s=r.find((t=>(null==t?void 0:t.type.name)===e.name));return s&&n.removeStoredMark(s),n.insertText(" ",o.pos),t.view.dispatch(n),!0}return!1}}function I(t){return"number"==typeof t}class R{constructor(t){this.find=t.find,this.handler=t.handler}}function B(t){const{editor:e,state:n,from:o,to:r,rule:s,pasteEvent:i,dropEvent:a}=t,{commands:d,chain:l,can:p}=new c({editor:e,state:n}),u=[];n.doc.nodesBetween(o,r,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const c=Math.max(o,e),h=Math.min(r,e+t.content.size);((t,e,n)=>{if(C(e))return[...t.matchAll(e)];const o=e(t,n);return o?o.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(c-e,h-e,void 0,""),s.find,i).forEach((t=>{if(void 0===t.index)return;const e=c+t.index+1,o=e+t[0].length,r={from:n.tr.mapping.map(e),to:n.tr.mapping.map(o)},h=s.handler({state:n,range:r,match:t,commands:d,chain:l,can:p,pasteEvent:i,dropEvent:a});u.push(h)}))}));return u.every((t=>null!==t))}let D=null;function F(e){const{editor:n,rules:r}=e;let s,i=null,c=!1,d=!1,l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{s="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{s=null}const p=({state:t,from:e,to:o,rule:r,pasteEvt:i})=>{const c=t.tr,d=a({state:t,transaction:c});if(B({editor:n,state:d,from:Math.max(e-1,0),to:o.b-1,rule:r,pasteEvent:i,dropEvent:s})&&c.steps.length){try{s="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{s=null}return l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,c}};return r.map((e=>new t.Plugin({view(t){const e=e=>{var o;i=(null===(o=t.dom.parentElement)||void 0===o?void 0:o.contains(e.target))?t.dom.parentElement:null,i&&(D=n)},o=()=>{D&&(D=null)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",o),{destroy(){window.removeEventListener("dragstart",e),window.removeEventListener("dragend",o)}}},props:{handleDOMEvents:{drop:(t,e)=>{if(d=i===t.dom.parentElement,s=e,!d){const t=D;t&&setTimeout((()=>{const e=t.state.selection;e&&t.commands.deleteRange({from:e.from,to:e.to})}),10)}return!1},paste:(t,e)=>{var n;const o=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return l=e,c=!!(null==o?void 0:o.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const s=t[0],i="paste"===s.getMeta("uiEvent")&&!c,a="drop"===s.getMeta("uiEvent")&&!d,u=s.getMeta("applyPasteRules"),h=!!u;if(!i&&!a&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=E(o.Fragment.from(t),r.schema));const{from:n}=u,s=n+t.length,i=(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(e=n.clipboardData)||void 0===e||e.setData("text/html",t),n})(t);return p({rule:e,state:r,from:n,to:{b:s},pasteEvt:i})}const m=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return I(m)&&f&&m!==f.b?p({rule:e,state:r,from:m,to:f,pasteEvt:l}):void 0}})))}function z(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return Array.from(new Set(e))}class L{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=L.resolve(t),this.schema=w(this.extensions,e),this.setupExtensions()}static resolve(t){const e=L.sort(L.flatten(t)),n=z(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=l(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=l(t,"priority")||100,o=l(e,"priority")||100;return n>o?-1:n<o?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=l(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:M(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=L.sort([...this.extensions].reverse()),o=[],r=[],s=e.map((e=>{const s={name:e.name,options:e.options,storage:e.storage,editor:t,type:M(e.name,this.schema)},i=[],a=l(e,"addKeyboardShortcuts",s);let c={};if("mark"===e.type&&l(e,"exitable",s)&&(c.ArrowRight=()=>N.handleExit({editor:t,mark:e})),a){const e=Object.fromEntries(Object.entries(a()).map((([e,n])=>[e,()=>n({editor:t})])));c={...c,...e}}const d=n.keymap(c);i.push(d);const p=l(e,"addInputRules",s);S(e,t.options.enableInputRules)&&p&&o.push(...p());const u=l(e,"addPasteRules",s);S(e,t.options.enablePasteRules)&&u&&r.push(...u());const h=l(e,"addProseMirrorPlugins",s);if(h){const t=h();i.push(...t)}return i})).flat();return[A({editor:t,rules:o}),...F({editor:t,rules:r}),...s]}get attributes(){return u(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=p(this.extensions);return Object.fromEntries(e.filter((t=>!!l(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage,editor:t,type:h(e.name,this.schema)},r=l(e,"addNodeView",o);if(!r)return[];return[e.name,(o,s,i,a,c)=>{const d=f(o,n);return r()({node:o,view:s,getPos:i,decorations:a,innerDecorations:c,editor:t,extension:e,HTMLAttributes:d})}]})))}setupExtensions(){this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:M(t.name,this.schema)};if("mark"===t.type){(null===(e=y(l(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const o=l(t,"onBeforeCreate",n),r=l(t,"onCreate",n),s=l(t,"onUpdate",n),i=l(t,"onSelectionUpdate",n),a=l(t,"onTransaction",n),c=l(t,"onFocus",n),d=l(t,"onBlur",n),p=l(t,"onDestroy",n);o&&this.editor.on("beforeCreate",o),r&&this.editor.on("create",r),s&&this.editor.on("update",s),i&&this.editor.on("selectionUpdate",i),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),p&&this.editor.on("destroy",p)}))}}class H{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=y(l(this,"addOptions",{name:this.name}))),this.storage=y(l(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new H(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>$(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new H({...this.config,...t});return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=y(l(e,"addOptions",{name:e.name})),e.storage=y(l(e,"addStorage",{name:e.name,options:e.options})),e}}function V(t,e,n){const{from:o,to:r}=e,{blockSeparator:s="\n\n",textSerializers:i={}}=n||{};let a="";return t.nodesBetween(o,r,((t,n,c,d)=>{var l;t.isBlock&&n>o&&(a+=s);const p=null==i?void 0:i[t.type.name];if(p)return c&&(a+=p({node:t,pos:n,parent:c,index:d,range:e})),!1;t.isText&&(a+=null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.slice(Math.max(o,n)-n,r-n))})),a}function q(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}const K=H.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new t.Plugin({key:new t.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:r}=e,{ranges:s}=r,i=Math.min(...s.map((t=>t.$from.pos))),a=Math.max(...s.map((t=>t.$to.pos))),c=q(n);return V(o,{from:i,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});function W(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every((o=>n.strict?e[o]===t[o]:C(e[o])?e[o].test(t[o]):e[o]===t[o]))}function _(t,e,n={}){return t.find((t=>t.type===e&&W(Object.fromEntries(Object.keys(n).map((e=>[e,t.attrs[e]]))),n)))}function U(t,e,n={}){return!!_(t,e,n)}function G(t,e,n){var o;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(r.node&&r.node.marks.some((t=>t.type===e))||(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some((t=>t.type===e)))return;n=n||(null===(o=r.node.marks[0])||void 0===o?void 0:o.attrs);if(!_([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,a=s+1,c=i+r.node.nodeSize;for(;s>0&&U([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&U([...t.parent.child(a).marks],e,n);)c+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:c}}function J(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Y(e){return e instanceof t.TextSelection}function Q(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function X(e,n=null){if(!n)return null;const o=t.Selection.atStart(e),r=t.Selection.atEnd(e);if("start"===n||!0===n)return o;if("end"===n)return r;const s=o.from,i=r.to;return"all"===n?t.TextSelection.create(e,Q(0,s,i),Q(e.content.size,s,i)):t.TextSelection.create(e,Q(n,s,i),Q(n,s,i))}function Z(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const tt=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];3===o.nodeType&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):1===o.nodeType&&tt(o)}return t};function et(t){const e=`<body>${t}</body>`,n=(new window.DOMParser).parseFromString(e,"text/html").body;return tt(n)}function nt(t,e,n){if(t instanceof o.Node||t instanceof o.Fragment)return t;n={slice:!0,parseOptions:{},...n};const r="string"==typeof t;if("object"==typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return o.Fragment.fromArray(t.map((t=>e.nodeFromJSON(t))));const r=e.nodeFromJSON(t);return n.errorOnInvalidContent&&r.check(),r}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),nt("",e,n)}if(r){if(n.errorOnInvalidContent){let r=!1,s="";const i=new o.Schema({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:t=>(r=!0,s="string"==typeof t?t:t.outerHTML,null)}]}})});if(n.slice?o.DOMParser.fromSchema(i).parseSlice(et(t),n.parseOptions):o.DOMParser.fromSchema(i).parse(et(t),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const r=o.DOMParser.fromSchema(e);return n.slice?r.parseSlice(et(t),n.parseOptions).content:r.parse(et(t),n.parseOptions)}return nt("",e,n)}function ot(e,n,o){const s=e.steps.length-1;if(s<n)return;const i=e.steps[s];if(!(i instanceof r.ReplaceStep||i instanceof r.ReplaceAroundStep))return;const a=e.mapping.maps[s];let c=0;a.forEach(((t,e,n,o)=>{0===c&&(c=o)})),e.setSelection(t.Selection.near(e.doc.resolve(c),o))}function rt(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function st(t,e,n={}){const{from:o,to:r,empty:s}=t.selection,i=e?h(e,t.schema):null,a=[];t.doc.nodesBetween(o,r,((t,e)=>{if(t.isText)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);a.push({node:t,from:n,to:s})}));const c=r-o,d=a.filter((t=>!i||i.name===t.node.type.name)).filter((t=>W(t.node.attrs,n,{strict:!1})));if(s)return!!d.length;return d.reduce(((t,e)=>t+e.to-e.from),0)>=c}function it(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function at(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,o)=>(n.includes(o)||(e[o]=t[o]),e)),{})}function ct(t,e,n={},o={}){return nt(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}function dt(t,e){const n=J(e,t.schema),{from:o,to:r,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,r,(t=>{i.push(...t.marks)}));const a=i.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function lt(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function pt(t,e){for(let n=t.depth;n>0;n-=1){const o=t.node(n);if(e(o))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:o}}}function ut(t){return e=>pt(e.$from,t)}function ht(t,e){return V(t,{from:0,to:t.content.size},e)}function mt(t,e){const n=h(e,t.schema),{from:o,to:r}=t.selection,s=[];t.doc.nodesBetween(o,r,(t=>{s.push(t)}));const i=s.reverse().find((t=>t.type.name===n.name));return i?{...i.attrs}:{}}function ft(t,e){const n=it("string"==typeof e?e:e.name,t.schema);return"node"===n?mt(t,e):"mark"===n?dt(t,e):{}}function gt(t,e=JSON.stringify){const n={};return t.filter((t=>{const o=e(t);return!Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=!0)}))}function yt(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach((e=>{const r=G(n.resolve(t),e.type);r&&o.push({mark:e,...r})})):n.nodesBetween(t,e,((t,e)=>{t&&void 0!==(null==t?void 0:t.nodeSize)&&o.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),o}function xt(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const o=t.find((t=>t.type===e&&t.name===n));return!!o&&o.attribute.keepOnSplit})))}function vt(t,e,n={}){const{empty:o,ranges:r}=t.selection,s=e?J(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!s||s.name===t.type.name)).find((t=>W(t.attrs,n,{strict:!1})));let i=0;const a=[];if(r.forEach((({$from:e,$to:n})=>{const o=e.pos,r=n.pos;t.doc.nodesBetween(o,r,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);i+=s-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:s}))))}))})),0===i)return!1;const c=a.filter((t=>!s||s.name===t.mark.type.name)).filter((t=>W(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),d=a.filter((t=>!s||t.mark.type!==s&&t.mark.type.excludes(s))).reduce(((t,e)=>t+e.to-e.from),0);return(c>0?c+d:c)>=i}function bt(t,e,n={}){if(!e)return st(t,null,n)||vt(t,null,n);const o=it(e,t.schema);return"node"===o?st(t,e,n):"mark"===o&&vt(t,e,n)}function kt(t,e){const{nodeExtensions:n}=p(e),o=n.find((e=>e.name===t));if(!o)return!1;const r=y(l(o,"group",{name:o.name,options:o.options,storage:o.storage}));return"string"==typeof r&&r.split(" ").includes("list")}function wt(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!==(o=t.text)&&void 0!==o?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(e){let o=!0;return t.content.forEach((t=>{!1!==o&&(wt(t,{ignoreWhitespace:n,checkChildren:e})||(o=!1))})),o}return!1}function Mt(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(o)}}const St=(t,e)=>{const n=ut((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;const s=t.doc.nodeAt(o);return n.node.type!==(null==s?void 0:s.type)||!r.canJoin(t.doc,n.pos)||(t.join(n.pos),!0)},Et=(t,e)=>{const n=ut((t=>t.type===e))(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;const s=t.doc.nodeAt(o);return n.node.type!==(null==s?void 0:s.type)||!r.canJoin(t.doc,o)||(t.join(o),!0)};var Ot=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:s}=o;return!n||(s.forEach((({$from:n,$to:o})=>{t.doc.nodesBetween(n.pos,o.pos,((t,n)=>{if(t.type.isText)return;const{doc:o,mapping:s}=e,i=o.resolve(s.map(n)),a=o.resolve(s.map(n+t.nodeSize)),c=i.blockRange(a);if(!c)return;const d=r.liftTarget(c);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(c.start,t)}(d||0===d)&&e.lift(c,d)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>s.createParagraphNear(t,e),cut:(e,n)=>({editor:o,tr:r})=>{const{state:s}=o,i=s.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(n);return r.insert(a,i.content),r.setSelection(new t.TextSelection(r.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const r=t.selection.$anchor;for(let n=r.depth;n>0;n-=1){if(r.node(n).type===o.type){if(e){const e=r.before(n),o=r.after(n);t.delete(e,o).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:o})=>{const r=h(t,n.schema),s=e.selection.$anchor;for(let t=s.depth;t>0;t-=1){if(s.node(t).type===r){if(o){const n=s.before(t),o=s.after(t);e.delete(n,o).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:o,to:r}=t;return n&&e.delete(o,r),!0},deleteSelection:()=>({state:t,dispatch:e})=>s.deleteSelection(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>s.exitCode(t,e),extendMarkRange:(e,n={})=>({tr:o,state:r,dispatch:s})=>{const i=J(e,r.schema),{doc:a,selection:c}=o,{$from:d,from:l,to:p}=c;if(s){const e=G(d,i,n);if(e&&e.from<=l&&e.to>=p){const n=t.TextSelection.create(a,e.from,e.to);o.setSelection(n)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:o,tr:r,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(Z()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(o.hasFocus()&&null===t||!1===t)return!0;if(s&&null===t&&!Y(n.state.selection))return i(),!0;const a=X(r.doc,t)||n.state.selection,c=n.state.selection.eq(a);return s&&(c||r.setSelection(a),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},forEach:(t,e)=>n=>t.every(((t,o)=>e(t,{...n,index:o}))),insertContent:(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{var a;if(s){let s;n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};try{s=nt(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:null!==(a=n.errorOnInvalidContent)&&void 0!==a?a:i.options.enableContentCheck})}catch(t){return i.emit("contentError",{editor:i,error:t,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},l=!0,p=!0;if(("type"in s?[s]:s).forEach((t=>{t.check(),l=!!l&&(t.isText&&0===t.marks.length),p=!!p&&t.isBlock})),c===d&&p){const{parent:t}=r.doc.resolve(c);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(c-=1,d+=1)}let u;if(l){if(Array.isArray(e))u=e.map((t=>t.text||"")).join("");else if(e instanceof o.Fragment){let t="";e.forEach((e=>{e.text&&(t+=e.text)})),u=t}else u="object"==typeof e&&e&&e.text?e.text:e;r.insertText(u,c,d)}else u=s,r.replaceWith(c,d,u);n.updateSelection&&ot(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:u}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:u})}return!0},joinBackward:()=>({state:t,dispatch:e})=>s.joinBackward(t,e),joinDown:()=>({state:t,dispatch:e})=>s.joinDown(t,e),joinForward:()=>({state:t,dispatch:e})=>s.joinForward(t,e),joinItemBackward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=r.joinPoint(t.doc,t.selection.$from.pos,-1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=r.joinPoint(t.doc,t.selection.$from.pos,1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinTextblockBackward:()=>({state:t,dispatch:e})=>s.joinTextblockBackward(t,e),joinTextblockForward:()=>({state:t,dispatch:e})=>s.joinTextblockForward(t,e),joinUp:()=>({state:t,dispatch:e})=>s.joinUp(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:o,dispatch:r})=>{const s=function(t){const e=t.split(/-(?!$)/);let n,o,r,s,i=e[e.length-1];"Space"===i&&(i=" ");for(let t=0;t<e.length-1;t+=1){const i=e[t];if(/^(cmd|meta|m)$/i.test(i))s=!0;else if(/^a(lt)?$/i.test(i))n=!0;else if(/^(c|ctrl|control)$/i.test(i))o=!0;else if(/^s(hift)?$/i.test(i))r=!0;else{if(!/^mod$/i.test(i))throw new Error(`Unrecognized modifier name: ${i}`);Z()||rt()?s=!0:o=!0}}return n&&(i=`Alt-${i}`),o&&(i=`Ctrl-${i}`),s&&(i=`Meta-${i}`),r&&(i=`Shift-${i}`),i}(t).split(/-(?!$)/),i=s.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===i?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==c||c.steps.forEach((t=>{const e=t.map(o.mapping);e&&r&&o.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:o})=>!!st(n,h(t,n.schema),e)&&s.lift(n,o),liftEmptyBlock:()=>({state:t,dispatch:e})=>s.liftEmptyBlock(t,e),liftListItem:t=>({state:e,dispatch:n})=>{const o=h(t,e.schema);return i.liftListItem(o)(e,n)},newlineInCode:()=>({state:t,dispatch:e})=>s.newlineInCode(t,e),resetAttributes:(t,e)=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=it("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=h(t,o.schema)),"mark"===a&&(i=J(t,o.schema)),r&&n.selection.ranges.forEach((t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,o)=>{s&&s===t.type&&n.setNodeMarkup(o,void 0,at(t.attrs,e)),i&&t.marks.length&&t.marks.forEach((r=>{i===r.type&&n.addMark(o,o+t.nodeSize,i.create(at(r.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:e,dispatch:n})=>{if(n){const n=new t.AllSelection(e.doc);e.setSelection(n)}return!0},selectNodeBackward:()=>({state:t,dispatch:e})=>s.selectNodeBackward(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>s.selectNodeForward(t,e),selectParentNode:()=>({state:t,dispatch:e})=>s.selectParentNode(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>s.selectTextblockEnd(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>s.selectTextblockStart(t,e),setContent:(t,e=!1,n={},o={})=>({editor:r,tr:s,dispatch:i,commands:a})=>{var c,d;const{doc:l}=s;if("full"!==n.preserveWhitespace){const a=ct(t,r.schema,n,{errorOnInvalidContent:null!==(c=o.errorOnInvalidContent)&&void 0!==c?c:r.options.enableContentCheck});return i&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!e),!0}return i&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:null!==(d=o.errorOnInvalidContent)&&void 0!==d?d:r.options.enableContentCheck})},setMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{const{selection:s}=n,{empty:i,ranges:a}=s,c=J(t,o.schema);if(r)if(i){const t=dt(o,c);n.addStoredMark(c.create({...t,...e}))}else a.forEach((t=>{const r=t.$from.pos,s=t.$to.pos;o.doc.nodesBetween(r,s,((t,o)=>{const i=Math.max(o,r),a=Math.min(o+t.nodeSize,s);t.marks.find((t=>t.type===c))?t.marks.forEach((t=>{c===t.type&&n.addMark(i,a,c.create({...t.attrs,...e}))})):n.addMark(i,a,c.create(e))}))}));return function(t,e,n){var o;const{selection:r}=e;let s=null;if(Y(r)&&(s=r.$cursor),s){const e=null!==(o=t.storedMarks)&&void 0!==o?o:s.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:i}=r;return i.some((({$from:e,$to:o})=>{let r=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,o.pos,((t,e,o)=>{if(r)return!1;if(t.isInline){const e=!o||o.type.allowsMarkType(n),s=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));r=e&&s}return!r})),r}))}(o,n,c)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:o,chain:r})=>{const i=h(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),i.isTextblock?r().command((({commands:t})=>!!s.setBlockType(i,{...a,...e})(n)||t.clearNodes())).command((({state:t})=>s.setBlockType(i,{...a,...e})(t,o))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:n,dispatch:o})=>{if(o){const{doc:o}=n,r=Q(e,0,o.content.size),s=t.NodeSelection.create(o,r);n.setSelection(s)}return!0},setTextSelection:e=>({tr:n,dispatch:o})=>{if(o){const{doc:o}=n,{from:r,to:s}="number"==typeof e?{from:e,to:e}:e,i=t.TextSelection.atStart(o).from,a=t.TextSelection.atEnd(o).to,c=Q(r,i,a),d=Q(s,i,a),l=t.TextSelection.create(o,c,d);n.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const o=h(t,e.schema);return i.sinkListItem(o)(e,n)},splitBlock:({keepMarks:e=!0}={})=>({tr:n,state:o,dispatch:s,editor:i})=>{const{selection:a,doc:c}=n,{$from:d,$to:l}=a,p=xt(i.extensionManager.attributes,d.node().type.name,d.node().attrs);if(a instanceof t.NodeSelection&&a.node.isBlock)return!(!d.parentOffset||!r.canSplit(c,d.pos))&&(s&&(e&&Mt(o,i.extensionManager.splittableMarks),n.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;const u=l.parentOffset===l.parent.content.size,h=0===d.depth?void 0:lt(d.node(-1).contentMatchAt(d.indexAfter(-1)));let m=u&&h?[{type:h,attrs:p}]:void 0,f=r.canSplit(n.doc,n.mapping.map(d.pos),1,m);if(m||f||!r.canSplit(n.doc,n.mapping.map(d.pos),1,h?[{type:h}]:void 0)||(f=!0,m=h?[{type:h,attrs:p}]:void 0),s){if(f&&(a instanceof t.TextSelection&&n.deleteSelection(),n.split(n.mapping.map(d.pos),1,m),h&&!u&&!d.parentOffset&&d.parent.type!==h)){const t=n.mapping.map(d.before()),e=n.doc.resolve(t);d.node(-1).canReplaceWith(e.index(),e.index()+1,h)&&n.setNodeMarkup(n.mapping.map(d.before()),h)}e&&Mt(o,i.extensionManager.splittableMarks),n.scrollIntoView()}return f},splitListItem:(e,n={})=>({tr:s,state:i,dispatch:a,editor:c})=>{var d;const l=h(e,i.schema),{$from:p,$to:u}=i.selection,m=i.selection.node;if(m&&m.isBlock||p.depth<2||!p.sameParent(u))return!1;const f=p.node(-1);if(f.type!==l)return!1;const g=c.extensionManager.attributes;if(0===p.parent.content.size&&p.node(-1).childCount===p.indexAfter(-1)){if(2===p.depth||p.node(-3).type!==l||p.index(-2)!==p.node(-2).childCount-1)return!1;if(a){let e=o.Fragment.empty;const r=p.index(-1)?1:p.index(-2)?2:3;for(let t=p.depth-r;t>=p.depth-3;t-=1)e=o.Fragment.from(p.node(t).copy(e));const i=p.indexAfter(-1)<p.node(-2).childCount?1:p.indexAfter(-2)<p.node(-3).childCount?2:3,a={...xt(g,p.node().type.name,p.node().attrs),...n},c=(null===(d=l.contentMatch.defaultType)||void 0===d?void 0:d.createAndFill(a))||void 0;e=e.append(o.Fragment.from(l.createAndFill(null,c)||void 0));const u=p.before(p.depth-(r-1));s.replace(u,p.after(-i),new o.Slice(e,4-r,0));let h=-1;s.doc.nodesBetween(u,s.doc.content.size,((t,e)=>{if(h>-1)return!1;t.isTextblock&&0===t.content.size&&(h=e+1)})),h>-1&&s.setSelection(t.TextSelection.near(s.doc.resolve(h))),s.scrollIntoView()}return!0}const y=u.pos===p.end()?f.contentMatchAt(0).defaultType:null,x={...xt(g,f.type.name,f.attrs),...n},v={...xt(g,p.node().type.name,p.node().attrs),...n};s.delete(p.pos,u.pos);const b=y?[{type:l,attrs:x},{type:y,attrs:v}]:[{type:l,attrs:x}];if(!r.canSplit(s.doc,p.pos,2))return!1;if(a){const{selection:t,storedMarks:e}=i,{splittableMarks:n}=c.extensionManager,o=e||t.$to.parentOffset&&t.$from.marks();if(s.split(p.pos,2,b).scrollIntoView(),!o||!a)return!0;const r=o.filter((t=>n.includes(t.type.name)));s.ensureMarks(r)}return!0},toggleList:(t,e,n,o={})=>({editor:r,tr:s,state:i,dispatch:a,chain:c,commands:d,can:l})=>{const{extensions:p,splittableMarks:u}=r.extensionManager,m=h(t,i.schema),f=h(e,i.schema),{selection:g,storedMarks:y}=i,{$from:x,$to:v}=g,b=x.blockRange(v),k=y||g.$to.parentOffset&&g.$from.marks();if(!b)return!1;const w=ut((t=>kt(t.type.name,p)))(g);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===m)return d.liftListItem(f);if(kt(w.node.type.name,p)&&m.validContent(w.node.content)&&a)return c().command((()=>(s.setNodeMarkup(w.pos,m),!0))).command((()=>St(s,m))).command((()=>Et(s,m))).run()}return n&&k&&a?c().command((()=>{const t=l().wrapInList(m,o),e=k.filter((t=>u.includes(t.type.name)));return s.ensureMarks(e),!!t||d.clearNodes()})).wrapInList(m,o).command((()=>St(s,m))).command((()=>Et(s,m))).run():c().command((()=>!!l().wrapInList(m,o)||d.clearNodes())).wrapInList(m,o).command((()=>St(s,m))).command((()=>Et(s,m))).run()},toggleMark:(t,e={},n={})=>({state:o,commands:r})=>{const{extendEmptyMarkRange:s=!1}=n,i=J(t,o.schema);return vt(o,i,e)?r.unsetMark(i,{extendEmptyMarkRange:s}):r.setMark(i,e)},toggleNode:(t,e,n={})=>({state:o,commands:r})=>{const s=h(t,o.schema),i=h(e,o.schema),a=st(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),a?r.setNode(i,c):r.setNode(s,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:o})=>{const r=h(t,n.schema);return st(n,r,e)?o.lift(r):o.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const r=n[o];let s;if(r.spec.isInputRules&&(s=r.getState(t))){if(e){const e=t.tr,n=s.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(s.text){const n=e.doc.resolve(s.from).marks();e.replaceWith(s.from,s.to,t.schema.text(s.text,n))}else e.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:r}=n;return o||e&&r.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,c=J(t,o.schema),{$from:d,empty:l,ranges:p}=a;if(!r)return!0;if(l&&i){let{from:t,to:e}=a;const o=null===(s=d.marks().find((t=>t.type===c)))||void 0===s?void 0:s.attrs,r=G(d,c,o);r&&(t=r.from,e=r.to),n.removeMark(t,e,c)}else p.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,c)}));return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=it("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=h(t,o.schema)),"mark"===a&&(i=J(t,o.schema)),r&&n.selection.ranges.forEach((t=>{const r=t.$from.pos,a=t.$to.pos;let c,d,l,p;n.selection.empty?o.doc.nodesBetween(r,a,((t,e)=>{s&&s===t.type&&(l=Math.max(e,r),p=Math.min(e+t.nodeSize,a),c=e,d=t)})):o.doc.nodesBetween(r,a,((t,o)=>{o<r&&s&&s===t.type&&(l=Math.max(o,r),p=Math.min(o+t.nodeSize,a),c=o,d=t),o>=r&&o<=a&&(s&&s===t.type&&n.setNodeMarkup(o,void 0,{...t.attrs,...e}),i&&t.marks.length&&t.marks.forEach((s=>{if(i===s.type){const c=Math.max(o,r),d=Math.min(o+t.nodeSize,a);n.addMark(c,d,i.create({...s.attrs,...e}))}})))})),d&&(void 0!==c&&n.setNodeMarkup(c,void 0,{...d.attrs,...e}),i&&d.marks.length&&d.marks.forEach((t=>{i===t.type&&n.addMark(l,p,i.create({...t.attrs,...e}))})))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:o})=>{const r=h(t,n.schema);return s.wrapIn(r,e)(n,o)},wrapInList:(t,e={})=>({state:n,dispatch:o})=>{const r=h(t,n.schema);return i.wrapInList(r,e)(n,o)}});const Ct=H.create({name:"commands",addCommands:()=>({...Ot})}),Tt=H.create({name:"drop",addProseMirrorPlugins(){return[new t.Plugin({key:new t.PluginKey("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),Pt=H.create({name:"editable",addProseMirrorPlugins(){return[new t.Plugin({key:new t.PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),At=H.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new t.Plugin({key:new t.PluginKey("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const o=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1},blur:(t,n)=>{e.isFocused=!1;const o=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1}}}})]}}),jt=H.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:n})=>{const{selection:o,doc:r}=n,{empty:s,$anchor:i}=o,{pos:a,parent:c}=i,d=i.parent.isTextblock&&a>0?n.doc.resolve(a-1):i,l=d.parent.type.spec.isolating,p=i.pos-i.parentOffset,u=l&&1===d.parent.childCount?p===i.pos:t.Selection.atStart(r).from===a;return!(!s||!c.type.isTextblock||c.textContent.length||!u||u&&"paragraph"===i.parent.type.name)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),n=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),o={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},r={...o},s={...o,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Z()||rt()?s:r},addProseMirrorPlugins(){return[new t.Plugin({key:new t.PluginKey("clearDocument"),appendTransaction:(e,n,o)=>{if(e.some((t=>t.getMeta("composition"))))return;const r=e.some((t=>t.docChanged))&&!n.doc.eq(o.doc),s=e.some((t=>t.getMeta("preventClearDocument")));if(!r||s)return;const{empty:i,from:d,to:l}=n.selection,p=t.Selection.atStart(n.doc).from,u=t.Selection.atEnd(n.doc).to;if(i||!(d===p&&l===u))return;if(!wt(o.doc))return;const h=o.tr,m=a({state:o,transaction:h}),{commands:f}=new c({editor:this.editor,state:m});return f.clearNodes(),h.steps.length?h:void 0}})]}}),$t=H.create({name:"paste",addProseMirrorPlugins(){return[new t.Plugin({key:new t.PluginKey("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Nt=H.create({name:"tabindex",addProseMirrorPlugins(){return[new t.Plugin({key:new t.PluginKey("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class It{get name(){return this.node.type.name}constructor(t,e,n=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=e,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return null!==(t=this.actualDepth)&&void 0!==t?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(t);return new It(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new It(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new It(t,this.editor)}get children(){const t=[];return this.node.content.forEach(((e,n)=>{const o=e.isBlock&&!e.isTextblock,r=e.isAtom&&!e.isText,s=this.pos+n+(r?0:1),i=this.resolvedPos.doc.resolve(s);if(!o&&i.depth<=this.depth)return;const a=new It(i,this.editor,o,o?e:null);o&&(a.actualDepth=this.depth+1),t.push(new It(i,this.editor,o,o?e:null))})),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let n=null,o=this.parent;for(;o&&!n;){if(o.node.type.name===t)if(Object.keys(e).length>0){const t=o.node.attrs,n=Object.keys(e);for(let o=0;o<n.length;o+=1){const r=n[o];if(t[r]!==e[r])break}}else n=o;o=o.parent}return n}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},n=!1){let o=[];if(!this.children||0===this.children.length)return o;const r=Object.keys(e);return this.children.forEach((s=>{if(!(n&&o.length>0)){if(s.node.type.name===t){r.every((t=>e[t]===s.node.attrs[t]))&&o.push(s)}n&&o.length>0||(o=o.concat(s.querySelectorAll(t,e,n)))}})),o}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}}function Rt(t,e,n){const o=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==o)return o;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}class Bt{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=y(l(this,"addOptions",{name:this.name}))),this.storage=y(l(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Bt(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>$(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new Bt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=y(l(e,"addOptions",{name:e.name})),e.storage=y(l(e,"addStorage",{name:e.name,options:e.options})),e}}exports.CommandManager=c,exports.Editor=class extends d{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",(({event:t,slice:e,moved:n})=>this.options.onDrop(t,e,n))),this.on("paste",(({event:t,slice:e})=>this.options.onPaste(t,e))),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Rt('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=g(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach((t=>{const o="string"==typeof t?`${t}$`:t.key;n=e.filter((t=>!t.key.startsWith(o)))})),e.length===n.length)return;const o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[Pt,K.configure({blockSeparator:null===(e=null===(t=this.options.coreExtensionOptions)||void 0===t?void 0:t.clipboardTextSerializer)||void 0===e?void 0:e.blockSeparator}),Ct,At,jt,Nt,Tt,$t].filter((t=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name])):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new L(n,this)}createCommandManager(){this.commandManager=new c({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var n;let o;try{o=ct(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter((t=>"collaboration"!==t.name)),this.createExtensionManager()}}),o=ct(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=X(o,this.options.autofocus);this.view=new e.EditorView(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null===(n=this.options.editorProps)||void 0===n?void 0:n.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:t.EditorState.create({doc:o,selection:r||void 0})});const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.createNodeViews(),this.prependClass();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),r=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),r&&this.emit("blur",{editor:this,event:r.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return ft(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,o="string"==typeof t?e:t;return bt(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return E(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return ht(this.state.doc,{blockSeparator:e,textSerializers:{...q(this.schema),...n}})}get isEmpty(){return wt(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}$node(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new It(e,this)}get $doc(){return this.$pos(0)}},exports.Extension=H,exports.InputRule=T,exports.Mark=N,exports.Node=Bt,exports.NodePos=It,exports.PasteRule=R,exports.callOrReturn=y,exports.combineTransactionSteps=function(t,e){const n=new r.Transform(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n},exports.createChainableState=a,exports.createDocument=ct,exports.createNodeFromContent=nt,exports.createStyleTag=Rt,exports.defaultBlockAt=lt,exports.deleteProps=at,exports.elementFromString=et,exports.findChildrenInRange=function(t,e,n){const o=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&o.push({node:t,pos:e})})),o},exports.findDuplicates=z,exports.findParentNode=ut,exports.findParentNodeClosestToPos=pt,exports.fromString=v,exports.getAttributes=ft,exports.getAttributesFromExtensions=u,exports.getChangedRanges=function(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach(((t,r)=>{const s=[];if(t.ranges.length)t.forEach(((t,e)=>{s.push({from:t,to:e})}));else{const{from:t,to:e}=n[r];if(void 0===t||void 0===e)return;s.push({from:t,to:e})}s.forEach((({from:t,to:n})=>{const s=e.slice(r).map(t,-1),i=e.slice(r).map(n),a=e.invert().map(s,-1),c=e.invert().map(i);o.push({oldRange:{from:a,to:c},newRange:{from:s,to:i}})}))})),function(t){const e=gt(t);return 1===e.length?e:e.filter(((t,n)=>!e.filter(((t,e)=>e!==n)).some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))))}(o)},exports.getExtensionField=l,exports.getHTMLFromFragment=E,exports.getMarkAttributes=dt,exports.getMarkRange=G,exports.getMarkType=J,exports.getMarksBetween=yt,exports.getNodeAttributes=mt,exports.getNodeType=h,exports.getRenderedAttributes=f,exports.getSchemaByResolvedExtensions=w,exports.getSchemaTypeByName=M,exports.getSchemaTypeNameByName=it,exports.getSplittedAttributes=xt,exports.getText=ht,exports.getTextBetween=V,exports.getTextContentFromNodes=O,exports.getTextSerializersFromSchema=q,exports.injectExtensionAttributesToParseRule=b,exports.inputRulesPlugin=A,exports.isActive=bt,exports.isEmptyObject=x,exports.isExtensionRulesEnabled=S,exports.isFunction=g,exports.isList=kt,exports.isMacOS=rt,exports.isMarkActive=vt,exports.isNodeActive=st,exports.isNodeEmpty=wt,exports.isNodeSelection=function(e){return e instanceof t.NodeSelection},exports.isNumber=I,exports.isPlainObject=j,exports.isRegExp=C,exports.isTextSelection=Y,exports.isiOS=Z,exports.markInputRule=function(t){return new T({find:t.find,handler:({state:e,range:n,match:o})=>{const r=y(t.getAttributes,void 0,o);if(!1===r||null===r)return null;const{tr:s}=e,i=o[o.length-1],a=o[0];if(i){const o=a.search(/\S/),c=n.from+a.indexOf(i),d=c+i.length;if(yt(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>c)).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+o,c);const l=n.from+o+i.length;s.addMark(n.from+o,l,t.type.create(r||{})),s.removeStoredMark(t.type)}}})},exports.markPasteRule=function(t){return new R({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:r})=>{const s=y(t.getAttributes,void 0,o,r);if(!1===s||null===s)return null;const{tr:i}=e,a=o[o.length-1],c=o[0];let d=n.to;if(a){const o=c.search(/\S/),r=n.from+c.indexOf(a),l=r+a.length;if(yt(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>r)).length)return null;l<n.to&&i.delete(l,n.to),r>n.from&&i.delete(n.from+o,r),d=n.from+o+a.length,i.addMark(n.from+o,d,t.type.create(s||{})),i.removeStoredMark(t.type)}}})},exports.mergeAttributes=m,exports.mergeDeep=$,exports.minMax=Q,exports.nodeInputRule=function(t){return new T({find:t.find,handler:({state:e,range:n,match:o})=>{const r=y(t.getAttributes,void 0,o)||{},{tr:s}=e,i=n.from;let a=n.to;const c=t.type.create(r);if(o[1]){let t=i+o[0].lastIndexOf(o[1]);t>a?t=a:a=t+o[1].length;const e=o[0][o[0].length-1];s.insertText(e,i+o[0].length-1),s.replaceWith(t,a,c)}else if(o[0]){const e=t.type.isInline?i:i-1;s.insert(e,t.type.create(r)).delete(s.mapping.map(i),s.mapping.map(a))}s.scrollIntoView()}})},exports.objectIncludes=W,exports.pasteRulesPlugin=F,exports.removeDuplicates=gt,exports.resolveFocusPosition=X,exports.selectionToInsertionEnd=ot,exports.splitExtensions=p,exports.textblockTypeInputRule=function(t){return new T({find:t.find,handler:({state:e,range:n,match:o})=>{const r=e.doc.resolve(n.from),s=y(t.getAttributes,void 0,o)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})},exports.wrappingInputRule=function(t){return new T({find:t.find,handler:({state:e,range:n,match:o,chain:s})=>{const i=y(t.getAttributes,void 0,o)||{},a=e.tr.delete(n.from,n.to),c=a.doc.resolve(n.from).blockRange(),d=c&&r.findWrapping(c,t.type,i);if(!d)return null;if(a.wrap(c,d),t.keepMarks&&t.editor){const{selection:n,storedMarks:o}=e,{splittableMarks:r}=t.editor.extensionManager,s=o||n.$to.parentOffset&&n.$from.marks();if(s){const t=s.filter((t=>r.includes(t.type.name)));a.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";s().updateAttributes(e,i).run()}const l=a.doc.resolve(n.from-1).nodeBefore;l&&l.type===t.type&&r.canJoin(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,l))&&a.join(n.from-1)}})};
2
2
  //# sourceMappingURL=index.js.map