@pstdio/ui 0.0.3 → 0.0.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 (737) hide show
  1. package/dist/EquationComponent-DeDYHvqY.js +62 -0
  2. package/dist/EquationComponent-DeDYHvqY.js.map +1 -0
  3. package/dist/chat-ui.js +347 -0
  4. package/dist/chat-ui.js.map +1 -0
  5. package/dist/components/button.stories.d.ts +18 -0
  6. package/dist/components/chat-ui/components/ai-conversation.d.ts +1161 -0
  7. package/dist/components/chat-ui/index.d.ts +10 -0
  8. package/dist/components/chat-ui/utils/get-icon.d.ts +34 -0
  9. package/{storybook-static → dist}/components/column-file-browser.d.ts +1 -2
  10. package/dist/components/column-file-browser.stories.d.ts +15 -0
  11. package/dist/components/data-table/build-columns.d.ts +3 -0
  12. package/dist/components/data-table/data-table.d.ts +2 -0
  13. package/{storybook-static/components → dist/components/data-table}/data-table.stories.d.ts +1 -1
  14. package/dist/components/data-table/helpers.d.ts +10 -0
  15. package/dist/components/data-table/index.d.ts +3 -0
  16. package/dist/components/data-table/pagination-footer.d.ts +5 -0
  17. package/dist/components/data-table/selection-toolbar.d.ts +9 -0
  18. package/{storybook-static/components/data-table.d.ts → dist/components/data-table/types.d.ts} +6 -4
  19. package/{storybook-static → dist}/components/file-selector.d.ts +1 -2
  20. package/{storybook-static/components/style-guide.stories.d.ts → dist/components/file-selector.stories.d.ts} +6 -3
  21. package/{storybook-static → dist}/components/info-card.d.ts +1 -2
  22. package/dist/components/info-card.stories.d.ts +41 -0
  23. package/{storybook-static → dist}/components/menu-item.d.ts +1 -1
  24. package/dist/components/menu-item.stories.d.ts +72 -0
  25. package/dist/components/number-input.d.ts +8 -0
  26. package/{storybook-static → dist}/components/param-editor.stories.d.ts +1 -0
  27. package/{storybook-static → dist}/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.d.ts +1 -0
  28. package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -0
  29. package/dist/components/session-indicator.d.ts +14 -0
  30. package/dist/components/session-indicator.stories.d.ts +11 -0
  31. package/dist/components/slider.stories.d.ts +15 -0
  32. package/dist/components/style-guide.stories.d.ts +28 -0
  33. package/dist/components/ticket-board.d.ts +33 -0
  34. package/dist/components/ticket-board.stories.d.ts +5 -0
  35. package/dist/components/ticket-card.d.ts +24 -0
  36. package/dist/components/ticket-card.stories.d.ts +17 -0
  37. package/dist/components/toaster.d.ts +3 -0
  38. package/{storybook-static → dist}/index.d.ts +5 -3
  39. package/dist/index.js +435 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/rich-message-CiA3ripk.js +1401 -0
  42. package/dist/rich-message-CiA3ripk.js.map +1 -0
  43. package/dist/rich-text.js +485 -0
  44. package/dist/rich-text.js.map +1 -0
  45. package/dist/style.css +1 -0
  46. package/{storybook-static → dist}/theme/primitives/colors.d.ts +6 -0
  47. package/dist/theme-9E0MRtZk.js +1985 -0
  48. package/dist/theme-9E0MRtZk.js.map +1 -0
  49. package/{src/theme/index.ts → dist/theme.js} +5 -2
  50. package/dist/theme.js.map +1 -0
  51. package/dist/tooltip-Gm7PLwZG.js +51 -0
  52. package/dist/tooltip-Gm7PLwZG.js.map +1 -0
  53. package/{storybook-static/theme/applyThemePreference.d.ts → dist/utils/apply-theme-preference.d.ts} +1 -1
  54. package/{storybook-static/theme → dist/utils}/theme-preference.d.ts +3 -3
  55. package/package.json +4 -1
  56. package/.storybook/main.ts +0 -28
  57. package/.storybook/preview.tsx +0 -28
  58. package/.storybook/vitest.setup.ts +0 -6
  59. package/src/components/alert.tsx +0 -27
  60. package/src/components/breadcrumb.stories.tsx +0 -40
  61. package/src/components/breadcrumb.tsx +0 -67
  62. package/src/components/button.stories.tsx +0 -151
  63. package/src/components/chat-ui/agent-types.ts +0 -231
  64. package/src/components/chat-ui/components/ai-conversation.stories.tsx +0 -49
  65. package/src/components/chat-ui/components/ai-conversation.tsx +0 -68
  66. package/src/components/chat-ui/components/ai-message.stories.tsx +0 -60
  67. package/src/components/chat-ui/components/ai-message.tsx +0 -103
  68. package/src/components/chat-ui/components/ai-response.stories.tsx +0 -48
  69. package/src/components/chat-ui/components/ai-response.tsx +0 -19
  70. package/src/components/chat-ui/components/approval-prompt.tsx +0 -51
  71. package/src/components/chat-ui/components/attachment-list.stories.tsx +0 -24
  72. package/src/components/chat-ui/components/attachment-list.tsx +0 -76
  73. package/src/components/chat-ui/components/auto-scroll.tsx +0 -42
  74. package/src/components/chat-ui/components/chat-input.stories.tsx +0 -114
  75. package/src/components/chat-ui/components/chat-input.tsx +0 -142
  76. package/src/components/chat-ui/components/chat-panel.stories.tsx +0 -396
  77. package/src/components/chat-ui/components/chat-panel.tsx +0 -97
  78. package/src/components/chat-ui/components/message-parts-renderer.stories.tsx +0 -59
  79. package/src/components/chat-ui/components/message-parts-renderer.tsx +0 -133
  80. package/src/components/chat-ui/components/message-types.ts +0 -40
  81. package/src/components/chat-ui/components/model-swap-separator.stories.tsx +0 -27
  82. package/src/components/chat-ui/components/model-swap-separator.tsx +0 -20
  83. package/src/components/chat-ui/components/send-button.tsx +0 -56
  84. package/src/components/chat-ui/components/timeline.tsx +0 -414
  85. package/src/components/chat-ui/components/tool-invocation-timeline.stories.tsx +0 -32
  86. package/src/components/chat-ui/components/tool-invocation-timeline.tsx +0 -16
  87. package/src/components/chat-ui/index.ts +0 -15
  88. package/src/components/chat-ui/mocks/full-conversation-normalized.json +0 -3557
  89. package/src/components/chat-ui/tool-rendering/build-timeline.ts +0 -127
  90. package/src/components/chat-ui/tool-rendering/default-renderers.ts +0 -420
  91. package/src/components/chat-ui/tool-rendering/index.ts +0 -3
  92. package/src/components/chat-ui/tool-rendering/types.ts +0 -19
  93. package/src/components/chat-ui/utils/diff.ts +0 -228
  94. package/src/components/chat-ui/utils/editor-state.ts +0 -5
  95. package/src/components/chat-ui/utils/get-icon.ts +0 -81
  96. package/src/components/code-editor.tsx +0 -147
  97. package/src/components/column-file-browser.stories.tsx +0 -217
  98. package/src/components/column-file-browser.tsx +0 -380
  99. package/src/components/content-placeholder.tsx +0 -21
  100. package/src/components/data-table/build-columns.tsx +0 -78
  101. package/src/components/data-table/data-table.css +0 -51
  102. package/src/components/data-table/data-table.stories.tsx +0 -209
  103. package/src/components/data-table/data-table.tsx +0 -232
  104. package/src/components/data-table/helpers.tsx +0 -69
  105. package/src/components/data-table/index.ts +0 -3
  106. package/src/components/data-table/pagination-footer.tsx +0 -58
  107. package/src/components/data-table/selection-toolbar.tsx +0 -26
  108. package/src/components/data-table/types.ts +0 -21
  109. package/src/components/delete-confirmation-modal.stories.tsx +0 -46
  110. package/src/components/delete-confirmation-modal.tsx +0 -56
  111. package/src/components/diff-bubble.stories.tsx +0 -70
  112. package/src/components/diff-bubble.tsx +0 -70
  113. package/src/components/diff-card.tsx +0 -139
  114. package/src/components/diff-drawer.stories.tsx +0 -106
  115. package/src/components/diff-drawer.tsx +0 -59
  116. package/src/components/diff-editor.tsx +0 -55
  117. package/src/components/drawer-inline.stories.tsx +0 -124
  118. package/src/components/drawer-inline.tsx +0 -90
  119. package/src/components/empty-state.stories.tsx +0 -65
  120. package/src/components/empty-state.tsx +0 -28
  121. package/src/components/error-boundary.tsx +0 -80
  122. package/src/components/file-selector.stories.tsx +0 -166
  123. package/src/components/file-selector.tsx +0 -192
  124. package/src/components/file-tree-helpers.ts +0 -28
  125. package/src/components/horizontal-menu-stack.tsx +0 -15
  126. package/src/components/info-card.stories.tsx +0 -120
  127. package/src/components/info-card.tsx +0 -60
  128. package/src/components/item-section.stories.tsx +0 -57
  129. package/src/components/item-section.tsx +0 -57
  130. package/src/components/layout.stories.tsx +0 -341
  131. package/src/components/layout.tsx +0 -67
  132. package/src/components/menu-item.stories.tsx +0 -162
  133. package/src/components/menu-item.tsx +0 -207
  134. package/src/components/number-input.tsx +0 -21
  135. package/src/components/open-source-notices-screen.stories.tsx +0 -69
  136. package/src/components/open-source-notices-screen.tsx +0 -154
  137. package/src/components/panel-menu.stories.tsx +0 -44
  138. package/src/components/panel-menu.tsx +0 -27
  139. package/src/components/param-editor-color-input.tsx +0 -98
  140. package/src/components/param-editor-date-input.tsx +0 -106
  141. package/src/components/param-editor-horizontal-text-input.tsx +0 -130
  142. package/src/components/param-editor-horizontal.stories.tsx +0 -545
  143. package/src/components/param-editor-horizontal.tsx +0 -137
  144. package/src/components/param-editor-input-group.tsx +0 -145
  145. package/src/components/param-editor-number-input.tsx +0 -145
  146. package/src/components/param-editor-selection-input.tsx +0 -181
  147. package/src/components/param-editor-text-input.tsx +0 -113
  148. package/src/components/param-editor.stories.tsx +0 -986
  149. package/src/components/param-editor.tsx +0 -142
  150. package/src/components/param-editor.types.ts +0 -95
  151. package/src/components/properties.stories.tsx +0 -108
  152. package/src/components/properties.tsx +0 -73
  153. package/src/components/pstdio-logo.tsx +0 -26
  154. package/src/components/resource-badge.stories.tsx +0 -26
  155. package/src/components/resource-badge.tsx +0 -173
  156. package/src/components/rich-text/collaborative-markdown-editor/awareness-cursors.tsx +0 -45
  157. package/src/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.stories.tsx +0 -230
  158. package/src/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.tsx +0 -131
  159. package/src/components/rich-text/index.ts +0 -14
  160. package/src/components/rich-text/markdown-editor/markdown-editor.stories.tsx +0 -147
  161. package/src/components/rich-text/markdown-editor/markdown-editor.tsx +0 -112
  162. package/src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkNode.tsx +0 -100
  163. package/src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.ts +0 -32
  164. package/src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/index.ts +0 -2
  165. package/src/components/rich-text/prompt-input/commands.ts +0 -44
  166. package/src/components/rich-text/prompt-input/events.ts +0 -21
  167. package/src/components/rich-text/prompt-input/plugins/CommentPlugin/CommentPlugin.tsx +0 -8
  168. package/src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentCommands.ts +0 -49
  169. package/src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentSchema.ts +0 -30
  170. package/src/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.tsx +0 -127
  171. package/src/components/rich-text/prompt-input/plugins/ImperativeAPIPlugin.tsx +0 -32
  172. package/src/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.tsx +0 -30
  173. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuOption.ts +0 -15
  174. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.tsx +0 -88
  175. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenu.tsx +0 -90
  176. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenuItem.tsx +0 -50
  177. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/constants.ts +0 -3
  178. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.tsx +0 -50
  179. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/checkForTriggers.ts +0 -45
  180. package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/getSortedMenuOptions.ts +0 -20
  181. package/src/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.tsx +0 -50
  182. package/src/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.tsx +0 -107
  183. package/src/components/rich-text/prompt-input/plugins/keyboard-shortcuts.ts +0 -13
  184. package/src/components/rich-text/prompt-input/prompt-input.stories.tsx +0 -87
  185. package/src/components/rich-text/prompt-input/prompt-input.tsx +0 -106
  186. package/src/components/rich-text/prompt-input/theme/prompt-input-theme.css +0 -3
  187. package/src/components/rich-text/prompt-input/theme/prompt-input-theme.ts +0 -11
  188. package/src/components/rich-text/prompt-input/utils.ts +0 -158
  189. package/src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkNode.tsx +0 -100
  190. package/src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.ts +0 -32
  191. package/src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/index.ts +0 -2
  192. package/src/components/rich-text/rich-message/rich-message.stories.tsx +0 -146
  193. package/src/components/rich-text/rich-message/rich-message.tsx +0 -118
  194. package/src/components/rich-text/shared/components/content-editable.tsx +0 -28
  195. package/src/components/rich-text/shared/components/default-rich-text-components.tsx +0 -99
  196. package/src/components/rich-text/shared/editor-config.ts +0 -38
  197. package/src/components/rich-text/shared/nodes/DataTableNode.stories.tsx +0 -52
  198. package/src/components/rich-text/shared/nodes/DataTableNode.tsx +0 -73
  199. package/src/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.tsx +0 -22
  200. package/src/components/rich-text/shared/plugins/CodePlugin/CodeNode.tsx +0 -57
  201. package/src/components/rich-text/shared/plugins/EquationPlugin/EquationComponent.tsx +0 -46
  202. package/src/components/rich-text/shared/plugins/EquationPlugin/EquationNode.tsx +0 -161
  203. package/src/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.css +0 -16
  204. package/src/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.tsx +0 -45
  205. package/src/components/rich-text/shared/plugins/EquationPlugin/KatexRenderer.tsx +0 -40
  206. package/src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatToolbarPlugin.css +0 -26
  207. package/src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatToolbarPlugin.tsx +0 -414
  208. package/src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/index.ts +0 -1
  209. package/src/components/rich-text/shared/plugins/HorizontalRulePlugin/HorizontalRuleNode.ts +0 -52
  210. package/src/components/rich-text/shared/plugins/HorizontalRulePlugin/horizontalRule.ts +0 -16
  211. package/src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkEditorPlugin.css +0 -163
  212. package/src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkEditorPlugin.tsx +0 -355
  213. package/src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkPlugin.tsx +0 -6
  214. package/src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/getSelectedNode.ts +0 -17
  215. package/src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.ts +0 -39
  216. package/src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/url.ts +0 -23
  217. package/src/components/rich-text/shared/plugins/StateUpdatePlugin.tsx +0 -21
  218. package/src/components/rich-text/shared/plugins/TableActionMenuPlugin/TableActionMenuPlugin.tsx +0 -224
  219. package/src/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.css +0 -3
  220. package/src/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.tsx +0 -315
  221. package/src/components/rich-text/shared/plugins/ToggleEditablePlugin.tsx +0 -12
  222. package/src/components/rich-text/shared/plugins/TreeViewPlugin/TreeViewPlugin.tsx +0 -20
  223. package/src/components/rich-text/shared/transformers/markdown-transformers.ts +0 -123
  224. package/src/components/rich-text/shared/types/rich-text-components.ts +0 -17
  225. package/src/components/rich-text/theme/report-theme.tsx +0 -81
  226. package/src/components/rich-text/theme/rich-text-theme.css +0 -773
  227. package/src/components/rich-text/theme/rich-text-theme.tsx +0 -81
  228. package/src/components/rich-text/types.ts +0 -9
  229. package/src/components/rich-text/utils/inferResourceType.ts +0 -17
  230. package/src/components/rich-text/utils/markdown.ts +0 -12
  231. package/src/components/rich-text/utils/mediaType.ts +0 -31
  232. package/src/components/session-indicator.stories.tsx +0 -46
  233. package/src/components/session-indicator.tsx +0 -40
  234. package/src/components/slider.stories.tsx +0 -38
  235. package/src/components/slider.tsx +0 -20
  236. package/src/components/style-guide-data.ts +0 -374
  237. package/src/components/style-guide.stories.tsx +0 -212
  238. package/src/components/style-guide.tsx +0 -305
  239. package/src/components/ticket-board.stories.tsx +0 -109
  240. package/src/components/ticket-board.tsx +0 -167
  241. package/src/components/ticket-card.stories.tsx +0 -133
  242. package/src/components/ticket-card.tsx +0 -126
  243. package/src/components/toaster.stories.tsx +0 -79
  244. package/src/components/toaster.tsx +0 -26
  245. package/src/components/tooltip.tsx +0 -43
  246. package/src/index.ts +0 -16
  247. package/src/theme/global.ts +0 -49
  248. package/src/theme/primitives/colors.ts +0 -209
  249. package/src/theme/primitives/fonts.ts +0 -33
  250. package/src/theme/primitives/sizes.ts +0 -49
  251. package/src/theme/recipes/alert.ts +0 -12
  252. package/src/theme/recipes/button.ts +0 -124
  253. package/src/theme/recipes/dialog.ts +0 -11
  254. package/src/theme/recipes/divider.ts +0 -7
  255. package/src/theme/recipes/drawer.ts +0 -16
  256. package/src/theme/recipes/editable.ts +0 -42
  257. package/src/theme/recipes/form.ts +0 -11
  258. package/src/theme/recipes/input.ts +0 -25
  259. package/src/theme/recipes/menu.ts +0 -40
  260. package/src/theme/recipes/popover.ts +0 -46
  261. package/src/theme/recipes/progress-circle.ts +0 -22
  262. package/src/theme/recipes/skeleton.ts +0 -8
  263. package/src/theme/recipes/textarea.ts +0 -29
  264. package/src/theme/recipes/tooltip.ts +0 -15
  265. package/src/theme/theme.ts +0 -70
  266. package/src/theme/tokens/borders.ts +0 -38
  267. package/src/theme/tokens/colors.ts +0 -488
  268. package/src/theme/tokens/layer-styles.ts +0 -15
  269. package/src/theme/tokens/shadows.ts +0 -47
  270. package/src/theme/tokens/text.ts +0 -236
  271. package/src/utils/apply-theme-preference.ts +0 -17
  272. package/src/utils/formats.ts +0 -27
  273. package/src/utils/get-file-type-icon.ts +0 -52
  274. package/src/utils/theme-preference.tsx +0 -60
  275. package/src/vite-env.d.ts +0 -6
  276. package/storybook-static/assets/CodeBlockPlugin-C3OWpvP8.js +0 -281
  277. package/storybook-static/assets/CodeBlockPlugin-e2vWgtYm.css +0 -1
  278. package/storybook-static/assets/DataTableNode.stories-DLgTftOI.js +0 -33
  279. package/storybook-static/assets/EquationComponent-CUFxwyNf.js +0 -1
  280. package/storybook-static/assets/EquationComponent-DWZwfaVI.css +0 -1
  281. package/storybook-static/assets/FloatingTextFormatToolbarPlugin-B6jc8xvg.js +0 -1
  282. package/storybook-static/assets/FloatingTextFormatToolbarPlugin-D2l3--Te.css +0 -1
  283. package/storybook-static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  284. package/storybook-static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  285. package/storybook-static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  286. package/storybook-static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  287. package/storybook-static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  288. package/storybook-static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  289. package/storybook-static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  290. package/storybook-static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  291. package/storybook-static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  292. package/storybook-static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  293. package/storybook-static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  294. package/storybook-static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  295. package/storybook-static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  296. package/storybook-static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  297. package/storybook-static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  298. package/storybook-static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  299. package/storybook-static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  300. package/storybook-static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  301. package/storybook-static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  302. package/storybook-static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  303. package/storybook-static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  304. package/storybook-static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  305. package/storybook-static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  306. package/storybook-static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  307. package/storybook-static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  308. package/storybook-static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  309. package/storybook-static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  310. package/storybook-static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  311. package/storybook-static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  312. package/storybook-static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  313. package/storybook-static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  314. package/storybook-static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  315. package/storybook-static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  316. package/storybook-static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  317. package/storybook-static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  318. package/storybook-static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  319. package/storybook-static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  320. package/storybook-static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  321. package/storybook-static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  322. package/storybook-static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  323. package/storybook-static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  324. package/storybook-static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  325. package/storybook-static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  326. package/storybook-static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  327. package/storybook-static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  328. package/storybook-static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  329. package/storybook-static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  330. package/storybook-static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  331. package/storybook-static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  332. package/storybook-static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  333. package/storybook-static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  334. package/storybook-static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  335. package/storybook-static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  336. package/storybook-static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  337. package/storybook-static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  338. package/storybook-static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  339. package/storybook-static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  340. package/storybook-static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  341. package/storybook-static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  342. package/storybook-static/assets/LexicalHistoryPlugin.prod-BQAibkDj.js +0 -1
  343. package/storybook-static/assets/TreeViewPlugin-CyVKCrKJ.js +0 -24
  344. package/storybook-static/assets/ai-conversation-DcjS--ee.js +0 -1
  345. package/storybook-static/assets/ai-conversation.stories-COjWuS8V.js +0 -3
  346. package/storybook-static/assets/ai-message-DLdAGhWH.js +0 -1
  347. package/storybook-static/assets/ai-message.stories-CRTyreKL.js +0 -3
  348. package/storybook-static/assets/ai-response-ySM6s0iN.js +0 -1
  349. package/storybook-static/assets/ai-response.stories-DVBYlrGf.js +0 -11
  350. package/storybook-static/assets/attachment-list-1p1601I5.js +0 -1
  351. package/storybook-static/assets/attachment-list.stories-Cydlsnio.js +0 -7
  352. package/storybook-static/assets/badge-CtgJasjB.js +0 -1
  353. package/storybook-static/assets/breadcrumb.stories-SAjB-iqH.js +0 -5
  354. package/storybook-static/assets/button-C7it2n8t.js +0 -1
  355. package/storybook-static/assets/button.stories-BMVbbb4y.js +0 -72
  356. package/storybook-static/assets/chat-input-B-915nCM.js +0 -1
  357. package/storybook-static/assets/chat-input.stories-DrxvpT9p.js +0 -32
  358. package/storybook-static/assets/chat-panel.stories-D0L6eIte.js +0 -96
  359. package/storybook-static/assets/chevron-down-BYCAGyCV.js +0 -1
  360. package/storybook-static/assets/chevron-right-owK1wZnx.js +0 -1
  361. package/storybook-static/assets/collaborative-markdown-editor-Bj0GvTvv.js +0 -41
  362. package/storybook-static/assets/collaborative-markdown-editor.stories-B_MUIC5s.js +0 -11
  363. package/storybook-static/assets/collapsible-DBDG7h1r.js +0 -1
  364. package/storybook-static/assets/collapsible-content-B1Uq3jUM.js +0 -1
  365. package/storybook-static/assets/column-file-browser.stories-DPMQnHCw.js +0 -54
  366. package/storybook-static/assets/compiler-runtime-BXE7OOXE.js +0 -1
  367. package/storybook-static/assets/computed-style-C0hzrq9-.js +0 -1
  368. package/storybook-static/assets/create-recipe-context-BU56IzEo.js +0 -1
  369. package/storybook-static/assets/create-slot-recipe-context-DAhDE6G_.js +0 -1
  370. package/storybook-static/assets/create-split-props-u5h9OPvL.js +0 -1
  371. package/storybook-static/assets/createLucideIcon-CcBBUKX8.js +0 -1
  372. package/storybook-static/assets/data-table-vuIeWXui.css +0 -1
  373. package/storybook-static/assets/data-table.stories-Cs-q7dpj.js +0 -19
  374. package/storybook-static/assets/delete-confirmation-modal.stories-C8vDKFRD.js +0 -14
  375. package/storybook-static/assets/diff-bubble-_zZypMRt.js +0 -1
  376. package/storybook-static/assets/diff-bubble.stories-DfonanIk.js +0 -39
  377. package/storybook-static/assets/diff-drawer.stories-CGDWiKD8.js +0 -38
  378. package/storybook-static/assets/diff-editor-DV9BXqbn.js +0 -11
  379. package/storybook-static/assets/dismissable-layer-Cc5dFRd8.js +0 -1
  380. package/storybook-static/assets/drawer-inline.stories-B3Tp7vjL.js +0 -88
  381. package/storybook-static/assets/empty-state-BXkyq69k.js +0 -1
  382. package/storybook-static/assets/empty-state.stories-6eYYBOWR.js +0 -29
  383. package/storybook-static/assets/factory-BR3bc_RM.js +0 -1
  384. package/storybook-static/assets/factory-DAJZwK4o.js +0 -1
  385. package/storybook-static/assets/file-selector.stories-PKIGBUd5.js +0 -31
  386. package/storybook-static/assets/file-text-D5m8MJlG.js +0 -1
  387. package/storybook-static/assets/flex-DAJL4AFZ.js +0 -1
  388. package/storybook-static/assets/folder-C5dba_Co.js +0 -1
  389. package/storybook-static/assets/form-D_Xln9tK.js +0 -1
  390. package/storybook-static/assets/full-conversation-normalized-LUbl1coD.js +0 -1
  391. package/storybook-static/assets/grid-7OIKBlfh.js +0 -1
  392. package/storybook-static/assets/h-stack-DWHd8f97.js +0 -1
  393. package/storybook-static/assets/horizontal-menu-stack-Cph6x7ui.js +0 -1
  394. package/storybook-static/assets/icon-C8FN9JqD.js +0 -1
  395. package/storybook-static/assets/icon-button-DHiUe7rR.js +0 -1
  396. package/storybook-static/assets/icons-WRA1cA-W.js +0 -1
  397. package/storybook-static/assets/iframe-2XPD_vrQ.css +0 -1
  398. package/storybook-static/assets/iframe-B8FSoBNY.js +0 -1075
  399. package/storybook-static/assets/index-B0y2_lLF.js +0 -1
  400. package/storybook-static/assets/index-CXwl6T4k.js +0 -1
  401. package/storybook-static/assets/index-DaXC_qY_.js +0 -1
  402. package/storybook-static/assets/index-DpB4ozcR.js +0 -1
  403. package/storybook-static/assets/index-cFwdnc0b.js +0 -1
  404. package/storybook-static/assets/info-DlgY5-DW.js +0 -1
  405. package/storybook-static/assets/info-card.stories-Cry0Qfrn.js +0 -55
  406. package/storybook-static/assets/input-ZSs5cSFQ.js +0 -1
  407. package/storybook-static/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
  408. package/storybook-static/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
  409. package/storybook-static/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
  410. package/storybook-static/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
  411. package/storybook-static/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
  412. package/storybook-static/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
  413. package/storybook-static/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
  414. package/storybook-static/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
  415. package/storybook-static/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
  416. package/storybook-static/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
  417. package/storybook-static/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
  418. package/storybook-static/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
  419. package/storybook-static/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
  420. package/storybook-static/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
  421. package/storybook-static/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
  422. package/storybook-static/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
  423. package/storybook-static/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  424. package/storybook-static/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  425. package/storybook-static/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
  426. package/storybook-static/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  427. package/storybook-static/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
  428. package/storybook-static/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
  429. package/storybook-static/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
  430. package/storybook-static/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
  431. package/storybook-static/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
  432. package/storybook-static/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
  433. package/storybook-static/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
  434. package/storybook-static/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
  435. package/storybook-static/assets/item-section-AoQrVPNJ.js +0 -1
  436. package/storybook-static/assets/item-section.stories-kYTPHRsx.js +0 -24
  437. package/storybook-static/assets/layout.stories-DhSjwzU1.js +0 -3
  438. package/storybook-static/assets/link-DE5grRtm.js +0 -1
  439. package/storybook-static/assets/markdown-BLUemkxK.js +0 -1
  440. package/storybook-static/assets/markdown-editor-Y4eMsgVb.js +0 -1
  441. package/storybook-static/assets/markdown-editor.stories-DIWw-hRP.js +0 -115
  442. package/storybook-static/assets/menu-item-CrqDaj9K.js +0 -1
  443. package/storybook-static/assets/menu-item.stories-D9Isjjrf.js +0 -68
  444. package/storybook-static/assets/message-parts-renderer.stories-CewRvbm7.js +0 -5
  445. package/storybook-static/assets/message-types-CEyA7Qm7.js +0 -60
  446. package/storybook-static/assets/model-swap-separator.stories-DrQW2NWQ.js +0 -9
  447. package/storybook-static/assets/mutation-observer-CAfGweIM.js +0 -1
  448. package/storybook-static/assets/normalize-props-D7NI5JRu.js +0 -1
  449. package/storybook-static/assets/number-C92MPsRM.js +0 -1
  450. package/storybook-static/assets/number-input-D1aC-9ls.js +0 -7
  451. package/storybook-static/assets/onest-cyrillic-400-normal-BxvCLB5P.woff +0 -0
  452. package/storybook-static/assets/onest-cyrillic-400-normal-DH8vlB-A.woff2 +0 -0
  453. package/storybook-static/assets/onest-cyrillic-500-normal-CyY1vN0Q.woff +0 -0
  454. package/storybook-static/assets/onest-cyrillic-500-normal-DHyr8B2c.woff2 +0 -0
  455. package/storybook-static/assets/onest-cyrillic-700-normal-CwpXuTGk.woff2 +0 -0
  456. package/storybook-static/assets/onest-cyrillic-700-normal-DOtXtm0s.woff +0 -0
  457. package/storybook-static/assets/onest-latin-400-normal-BAzPRZHg.woff +0 -0
  458. package/storybook-static/assets/onest-latin-400-normal-bladozIj.woff2 +0 -0
  459. package/storybook-static/assets/onest-latin-500-normal-oFTiz6Nq.woff +0 -0
  460. package/storybook-static/assets/onest-latin-500-normal-qHiQtL66.woff2 +0 -0
  461. package/storybook-static/assets/onest-latin-700-normal-Bd6qVL4Q.woff2 +0 -0
  462. package/storybook-static/assets/onest-latin-700-normal-XTvQgpoh.woff +0 -0
  463. package/storybook-static/assets/onest-latin-ext-400-normal--mQR5RlC.woff2 +0 -0
  464. package/storybook-static/assets/onest-latin-ext-400-normal-BbXTNVXw.woff +0 -0
  465. package/storybook-static/assets/onest-latin-ext-500-normal-BlXa29q8.woff2 +0 -0
  466. package/storybook-static/assets/onest-latin-ext-500-normal-CoujUMv_.woff +0 -0
  467. package/storybook-static/assets/onest-latin-ext-700-normal-C-Tcltod.woff2 +0 -0
  468. package/storybook-static/assets/onest-latin-ext-700-normal-CSGWRWNE.woff +0 -0
  469. package/storybook-static/assets/open-source-notices-screen.stories-BpdJxDZC.js +0 -21
  470. package/storybook-static/assets/overflow-CkG1DOya.js +0 -1
  471. package/storybook-static/assets/panel-menu-CqLSrdTB.js +0 -1
  472. package/storybook-static/assets/panel-menu.stories-CxdWaWjq.js +0 -14
  473. package/storybook-static/assets/param-editor-horizontal.stories-C1o-VOjG.js +0 -561
  474. package/storybook-static/assets/param-editor-selection-input-2pJE1_W1.js +0 -1
  475. package/storybook-static/assets/param-editor.stories-0ae3y4Vu.js +0 -921
  476. package/storybook-static/assets/playfair-display-cyrillic-400-normal-CjW2EstV.woff2 +0 -0
  477. package/storybook-static/assets/playfair-display-cyrillic-400-normal-ZiRag6zj.woff +0 -0
  478. package/storybook-static/assets/playfair-display-cyrillic-600-normal-DbWAkkgN.woff +0 -0
  479. package/storybook-static/assets/playfair-display-cyrillic-600-normal-oLY6jnZ7.woff2 +0 -0
  480. package/storybook-static/assets/playfair-display-cyrillic-700-normal-Dk1mTcxf.woff +0 -0
  481. package/storybook-static/assets/playfair-display-cyrillic-700-normal-Dw3uKy19.woff2 +0 -0
  482. package/storybook-static/assets/playfair-display-latin-400-normal-CFtfchNt.woff2 +0 -0
  483. package/storybook-static/assets/playfair-display-latin-400-normal-DHYHbkg3.woff +0 -0
  484. package/storybook-static/assets/playfair-display-latin-600-normal-CZLGqjJe.woff2 +0 -0
  485. package/storybook-static/assets/playfair-display-latin-600-normal-CxxueQ0Z.woff +0 -0
  486. package/storybook-static/assets/playfair-display-latin-700-normal-Bc_1Q1cG.woff +0 -0
  487. package/storybook-static/assets/playfair-display-latin-700-normal-CuDiGg7c.woff2 +0 -0
  488. package/storybook-static/assets/playfair-display-latin-ext-400-normal-BxlSGspa.woff2 +0 -0
  489. package/storybook-static/assets/playfair-display-latin-ext-400-normal-qdZwdvNS.woff +0 -0
  490. package/storybook-static/assets/playfair-display-latin-ext-600-normal-BumBfC1v.woff +0 -0
  491. package/storybook-static/assets/playfair-display-latin-ext-600-normal-CEjQclLc.woff2 +0 -0
  492. package/storybook-static/assets/playfair-display-latin-ext-700-normal-C58ejOkc.woff2 +0 -0
  493. package/storybook-static/assets/playfair-display-latin-ext-700-normal-D5HUU8GT.woff +0 -0
  494. package/storybook-static/assets/playfair-display-vietnamese-400-normal-BV2APVTb.woff2 +0 -0
  495. package/storybook-static/assets/playfair-display-vietnamese-400-normal-BbvUAu4N.woff +0 -0
  496. package/storybook-static/assets/playfair-display-vietnamese-600-normal-BPJkAZPN.woff +0 -0
  497. package/storybook-static/assets/playfair-display-vietnamese-600-normal-ICsRR-qJ.woff2 +0 -0
  498. package/storybook-static/assets/playfair-display-vietnamese-700-normal-CaKJSIny.woff2 +0 -0
  499. package/storybook-static/assets/playfair-display-vietnamese-700-normal-Cr1rw0mr.woff +0 -0
  500. package/storybook-static/assets/portal-CZHfPTRw.js +0 -1
  501. package/storybook-static/assets/preload-helper-PPVm8Dsz.js +0 -1
  502. package/storybook-static/assets/prompt-input-BLCttowi.js +0 -14
  503. package/storybook-static/assets/prompt-input-BVbz9joI.css +0 -1
  504. package/storybook-static/assets/prompt-input.stories-J8-AMVXy.js +0 -9
  505. package/storybook-static/assets/properties.stories-Bs7ivKgb.js +0 -59
  506. package/storybook-static/assets/react-18-KY0R7ltw.js +0 -9
  507. package/storybook-static/assets/render-strategy-BebqUNCa.js +0 -1
  508. package/storybook-static/assets/resource-badge-Bw5UoU4J.js +0 -1
  509. package/storybook-static/assets/resource-badge.stories-DtSh-RX9.js +0 -9
  510. package/storybook-static/assets/rich-message-BIkzo1SM.js +0 -1
  511. package/storybook-static/assets/rich-message.stories-C9Wc4d3O.js +0 -115
  512. package/storybook-static/assets/rich-text-theme-Bkhh9rAZ.js +0 -14
  513. package/storybook-static/assets/rich-text-theme-K2MBoCbx.css +0 -1
  514. package/storybook-static/assets/separator-CQkMOHNm.js +0 -1
  515. package/storybook-static/assets/settings-DUgg22A7.js +0 -1
  516. package/storybook-static/assets/simple-grid-DIKjhnVI.js +0 -1
  517. package/storybook-static/assets/spinner-ZYH_gvW-.js +0 -1
  518. package/storybook-static/assets/stack-CN4X31TA.js +0 -1
  519. package/storybook-static/assets/star-CvcHIXRa.js +0 -1
  520. package/storybook-static/assets/style-guide.stories-BUvEhZov.js +0 -6
  521. package/storybook-static/assets/tabbable-DHAf8oAu.js +0 -1
  522. package/storybook-static/assets/table-BKNSzs2r.js +0 -1
  523. package/storybook-static/assets/textarea-rqmaWSc5.js +0 -1
  524. package/storybook-static/assets/toaster-d9nN0H7K.js +0 -1
  525. package/storybook-static/assets/toaster.stories-BRVCYyaM.js +0 -52
  526. package/storybook-static/assets/tool-invocation-timeline-B-cS0W6M.js +0 -59
  527. package/storybook-static/assets/tool-invocation-timeline.stories-DXO59O73.js +0 -5
  528. package/storybook-static/assets/tooltip-C_a-XGZ8.js +0 -1
  529. package/storybook-static/assets/tooltip-DZxUoouw.js +0 -1
  530. package/storybook-static/assets/trash-2-BO05slEk.js +0 -1
  531. package/storybook-static/assets/typeahead-CuY9WxfQ.js +0 -1
  532. package/storybook-static/assets/use-field-context-DoxKQlMm.js +0 -1
  533. package/storybook-static/assets/use-presence-context-DK2PGZth.js +0 -1
  534. package/storybook-static/assets/v-stack-Btoq6OB_.js +0 -1
  535. package/storybook-static/assets/x-D42ziktz.js +0 -1
  536. package/storybook-static/components/chat-ui/mocks/full-conversation-normalized.json.d.ts +0 -3560
  537. package/storybook-static/components/rich-text/utils/inferResourceType.d.ts +0 -1
  538. package/storybook-static/favicon-wrapper.svg +0 -46
  539. package/storybook-static/favicon.svg +0 -1
  540. package/storybook-static/iframe.html +0 -705
  541. package/storybook-static/index.html +0 -150
  542. package/storybook-static/index.json +0 -1
  543. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  544. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  545. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  546. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  547. package/storybook-static/project.json +0 -1
  548. package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -628
  549. package/storybook-static/sb-addons/themes-1/manager-bundle.js +0 -3
  550. package/storybook-static/sb-addons/vitest-2/manager-bundle.js +0 -3
  551. package/storybook-static/sb-common-assets/favicon-wrapper.svg +0 -46
  552. package/storybook-static/sb-common-assets/favicon.svg +0 -1
  553. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  554. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  555. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  556. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  557. package/storybook-static/sb-manager/globals-runtime.js +0 -77956
  558. package/storybook-static/sb-manager/globals.js +0 -24
  559. package/storybook-static/sb-manager/manager-stores.js +0 -23
  560. package/storybook-static/sb-manager/runtime.js +0 -20422
  561. package/storybook-static/theme/types.d.ts +0 -1
  562. package/storybook-static/vite-inject-mocker-entry.js +0 -2
  563. package/tsconfig.json +0 -29
  564. package/vite.config.ts +0 -85
  565. package/vitest.shims.d.ts +0 -1
  566. /package/{storybook-static → dist}/components/alert.d.ts +0 -0
  567. /package/{storybook-static → dist}/components/breadcrumb.d.ts +0 -0
  568. /package/{storybook-static → dist}/components/breadcrumb.stories.d.ts +0 -0
  569. /package/{storybook-static → dist}/components/chat-ui/agent-types.d.ts +0 -0
  570. /package/{storybook-static → dist}/components/chat-ui/components/ai-conversation.stories.d.ts +0 -0
  571. /package/{storybook-static → dist}/components/chat-ui/components/ai-message.d.ts +0 -0
  572. /package/{storybook-static → dist}/components/chat-ui/components/ai-message.stories.d.ts +0 -0
  573. /package/{storybook-static → dist}/components/chat-ui/components/ai-response.d.ts +0 -0
  574. /package/{storybook-static → dist}/components/chat-ui/components/ai-response.stories.d.ts +0 -0
  575. /package/{storybook-static → dist}/components/chat-ui/components/approval-prompt.d.ts +0 -0
  576. /package/{storybook-static → dist}/components/chat-ui/components/attachment-list.d.ts +0 -0
  577. /package/{storybook-static → dist}/components/chat-ui/components/attachment-list.stories.d.ts +0 -0
  578. /package/{storybook-static → dist}/components/chat-ui/components/auto-scroll.d.ts +0 -0
  579. /package/{storybook-static → dist}/components/chat-ui/components/chat-input.d.ts +0 -0
  580. /package/{storybook-static → dist}/components/chat-ui/components/chat-input.stories.d.ts +0 -0
  581. /package/{storybook-static → dist}/components/chat-ui/components/chat-panel.d.ts +0 -0
  582. /package/{storybook-static → dist}/components/chat-ui/components/chat-panel.stories.d.ts +0 -0
  583. /package/{storybook-static → dist}/components/chat-ui/components/message-parts-renderer.d.ts +0 -0
  584. /package/{storybook-static → dist}/components/chat-ui/components/message-parts-renderer.stories.d.ts +0 -0
  585. /package/{storybook-static → dist}/components/chat-ui/components/message-types.d.ts +0 -0
  586. /package/{storybook-static → dist}/components/chat-ui/components/model-swap-separator.d.ts +0 -0
  587. /package/{storybook-static → dist}/components/chat-ui/components/model-swap-separator.stories.d.ts +0 -0
  588. /package/{storybook-static → dist}/components/chat-ui/components/send-button.d.ts +0 -0
  589. /package/{storybook-static → dist}/components/chat-ui/components/timeline.d.ts +0 -0
  590. /package/{storybook-static → dist}/components/chat-ui/components/tool-invocation-timeline.d.ts +0 -0
  591. /package/{storybook-static → dist}/components/chat-ui/components/tool-invocation-timeline.stories.d.ts +0 -0
  592. /package/{storybook-static → dist}/components/chat-ui/tool-rendering/build-timeline.d.ts +0 -0
  593. /package/{storybook-static → dist}/components/chat-ui/tool-rendering/default-renderers.d.ts +0 -0
  594. /package/{storybook-static → dist}/components/chat-ui/tool-rendering/index.d.ts +0 -0
  595. /package/{storybook-static → dist}/components/chat-ui/tool-rendering/types.d.ts +0 -0
  596. /package/{storybook-static → dist}/components/chat-ui/utils/diff.d.ts +0 -0
  597. /package/{storybook-static → dist}/components/chat-ui/utils/editor-state.d.ts +0 -0
  598. /package/{storybook-static → dist}/components/code-editor.d.ts +0 -0
  599. /package/{storybook-static → dist}/components/content-placeholder.d.ts +0 -0
  600. /package/{storybook-static → dist}/components/delete-confirmation-modal.d.ts +0 -0
  601. /package/{storybook-static → dist}/components/delete-confirmation-modal.stories.d.ts +0 -0
  602. /package/{storybook-static → dist}/components/diff-bubble.d.ts +0 -0
  603. /package/{storybook-static → dist}/components/diff-bubble.stories.d.ts +0 -0
  604. /package/{storybook-static → dist}/components/diff-card.d.ts +0 -0
  605. /package/{storybook-static → dist}/components/diff-drawer.d.ts +0 -0
  606. /package/{storybook-static → dist}/components/diff-drawer.stories.d.ts +0 -0
  607. /package/{storybook-static → dist}/components/diff-editor.d.ts +0 -0
  608. /package/{storybook-static → dist}/components/drawer-inline.d.ts +0 -0
  609. /package/{storybook-static → dist}/components/drawer-inline.stories.d.ts +0 -0
  610. /package/{storybook-static → dist}/components/empty-state.d.ts +0 -0
  611. /package/{storybook-static → dist}/components/empty-state.stories.d.ts +0 -0
  612. /package/{storybook-static → dist}/components/error-boundary.d.ts +0 -0
  613. /package/{storybook-static → dist}/components/file-tree-helpers.d.ts +0 -0
  614. /package/{storybook-static → dist}/components/horizontal-menu-stack.d.ts +0 -0
  615. /package/{storybook-static → dist}/components/item-section.d.ts +0 -0
  616. /package/{storybook-static → dist}/components/item-section.stories.d.ts +0 -0
  617. /package/{storybook-static → dist}/components/layout.d.ts +0 -0
  618. /package/{storybook-static → dist}/components/layout.stories.d.ts +0 -0
  619. /package/{storybook-static → dist}/components/open-source-notices-screen.d.ts +0 -0
  620. /package/{storybook-static → dist}/components/open-source-notices-screen.stories.d.ts +0 -0
  621. /package/{storybook-static → dist}/components/panel-menu.d.ts +0 -0
  622. /package/{storybook-static → dist}/components/panel-menu.stories.d.ts +0 -0
  623. /package/{storybook-static → dist}/components/param-editor-color-input.d.ts +0 -0
  624. /package/{storybook-static → dist}/components/param-editor-date-input.d.ts +0 -0
  625. /package/{storybook-static → dist}/components/param-editor-horizontal-text-input.d.ts +0 -0
  626. /package/{storybook-static → dist}/components/param-editor-horizontal.d.ts +0 -0
  627. /package/{storybook-static → dist}/components/param-editor-horizontal.stories.d.ts +0 -0
  628. /package/{storybook-static → dist}/components/param-editor-input-group.d.ts +0 -0
  629. /package/{storybook-static → dist}/components/param-editor-number-input.d.ts +0 -0
  630. /package/{storybook-static → dist}/components/param-editor-selection-input.d.ts +0 -0
  631. /package/{storybook-static → dist}/components/param-editor-text-input.d.ts +0 -0
  632. /package/{storybook-static → dist}/components/param-editor.d.ts +0 -0
  633. /package/{storybook-static → dist}/components/param-editor.types.d.ts +0 -0
  634. /package/{storybook-static → dist}/components/properties.d.ts +0 -0
  635. /package/{storybook-static → dist}/components/properties.stories.d.ts +0 -0
  636. /package/{storybook-static/components/schub-logo.d.ts → dist/components/pstdio-logo.d.ts} +0 -0
  637. /package/{storybook-static → dist}/components/resource-badge.d.ts +0 -0
  638. /package/{storybook-static → dist}/components/resource-badge.stories.d.ts +0 -0
  639. /package/{storybook-static → dist}/components/rich-text/collaborative-markdown-editor/awareness-cursors.d.ts +0 -0
  640. /package/{storybook-static → dist}/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.stories.d.ts +0 -0
  641. /package/{storybook-static → dist}/components/rich-text/index.d.ts +0 -0
  642. /package/{storybook-static → dist}/components/rich-text/markdown-editor/markdown-editor.d.ts +0 -0
  643. /package/{storybook-static → dist}/components/rich-text/markdown-editor/markdown-editor.stories.d.ts +0 -0
  644. /package/{storybook-static → dist}/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkNode.d.ts +0 -0
  645. /package/{storybook-static → dist}/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.d.ts +0 -0
  646. /package/{storybook-static → dist}/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/index.d.ts +0 -0
  647. /package/{storybook-static → dist}/components/rich-text/prompt-input/commands.d.ts +0 -0
  648. /package/{storybook-static → dist}/components/rich-text/prompt-input/events.d.ts +0 -0
  649. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/CommentPlugin/CommentPlugin.d.ts +0 -0
  650. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentCommands.d.ts +0 -0
  651. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentSchema.d.ts +0 -0
  652. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.d.ts +0 -0
  653. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ImperativeAPIPlugin.d.ts +0 -0
  654. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.d.ts +0 -0
  655. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuOption.d.ts +0 -0
  656. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.d.ts +0 -0
  657. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenu.d.ts +0 -0
  658. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenuItem.d.ts +0 -0
  659. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/constants.d.ts +0 -0
  660. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.d.ts +0 -0
  661. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/checkForTriggers.d.ts +0 -0
  662. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/getSortedMenuOptions.d.ts +0 -0
  663. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.d.ts +0 -0
  664. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.d.ts +0 -0
  665. /package/{storybook-static → dist}/components/rich-text/prompt-input/plugins/keyboard-shortcuts.d.ts +0 -0
  666. /package/{storybook-static → dist}/components/rich-text/prompt-input/prompt-input.d.ts +0 -0
  667. /package/{storybook-static → dist}/components/rich-text/prompt-input/prompt-input.stories.d.ts +0 -0
  668. /package/{storybook-static → dist}/components/rich-text/prompt-input/theme/prompt-input-theme.d.ts +0 -0
  669. /package/{storybook-static → dist}/components/rich-text/prompt-input/utils.d.ts +0 -0
  670. /package/{storybook-static → dist}/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkNode.d.ts +0 -0
  671. /package/{storybook-static → dist}/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.d.ts +0 -0
  672. /package/{storybook-static → dist}/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/index.d.ts +0 -0
  673. /package/{storybook-static → dist}/components/rich-text/rich-message/rich-message.d.ts +0 -0
  674. /package/{storybook-static → dist}/components/rich-text/rich-message/rich-message.stories.d.ts +0 -0
  675. /package/{storybook-static → dist}/components/rich-text/shared/components/content-editable.d.ts +0 -0
  676. /package/{storybook-static → dist}/components/rich-text/shared/components/default-rich-text-components.d.ts +0 -0
  677. /package/{storybook-static → dist}/components/rich-text/shared/editor-config.d.ts +0 -0
  678. /package/{storybook-static → dist}/components/rich-text/shared/nodes/DataTableNode.d.ts +0 -0
  679. /package/{storybook-static → dist}/components/rich-text/shared/nodes/DataTableNode.stories.d.ts +0 -0
  680. /package/{storybook-static → dist}/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.d.ts +0 -0
  681. /package/{storybook-static → dist}/components/rich-text/shared/plugins/CodePlugin/CodeNode.d.ts +0 -0
  682. /package/{storybook-static → dist}/components/rich-text/shared/plugins/EquationPlugin/EquationComponent.d.ts +0 -0
  683. /package/{storybook-static → dist}/components/rich-text/shared/plugins/EquationPlugin/EquationNode.d.ts +0 -0
  684. /package/{storybook-static → dist}/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.d.ts +0 -0
  685. /package/{storybook-static → dist}/components/rich-text/shared/plugins/EquationPlugin/KatexRenderer.d.ts +0 -0
  686. /package/{storybook-static → dist}/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatToolbarPlugin.d.ts +0 -0
  687. /package/{storybook-static → dist}/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +0 -0
  688. /package/{storybook-static → dist}/components/rich-text/shared/plugins/HorizontalRulePlugin/HorizontalRuleNode.d.ts +0 -0
  689. /package/{storybook-static → dist}/components/rich-text/shared/plugins/HorizontalRulePlugin/horizontalRule.d.ts +0 -0
  690. /package/{storybook-static → dist}/components/rich-text/shared/plugins/LinkEditorPlugin/LinkEditorPlugin.d.ts +0 -0
  691. /package/{storybook-static → dist}/components/rich-text/shared/plugins/LinkEditorPlugin/LinkPlugin.d.ts +0 -0
  692. /package/{storybook-static → dist}/components/rich-text/shared/plugins/LinkEditorPlugin/utils/getSelectedNode.d.ts +0 -0
  693. /package/{storybook-static → dist}/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.d.ts +0 -0
  694. /package/{storybook-static → dist}/components/rich-text/shared/plugins/LinkEditorPlugin/utils/url.d.ts +0 -0
  695. /package/{storybook-static → dist}/components/rich-text/shared/plugins/StateUpdatePlugin.d.ts +0 -0
  696. /package/{storybook-static → dist}/components/rich-text/shared/plugins/TableActionMenuPlugin/TableActionMenuPlugin.d.ts +0 -0
  697. /package/{storybook-static → dist}/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.d.ts +0 -0
  698. /package/{storybook-static → dist}/components/rich-text/shared/plugins/ToggleEditablePlugin.d.ts +0 -0
  699. /package/{storybook-static → dist}/components/rich-text/shared/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +0 -0
  700. /package/{storybook-static → dist}/components/rich-text/shared/transformers/markdown-transformers.d.ts +0 -0
  701. /package/{storybook-static → dist}/components/rich-text/shared/types/rich-text-components.d.ts +0 -0
  702. /package/{storybook-static → dist}/components/rich-text/theme/report-theme.d.ts +0 -0
  703. /package/{storybook-static → dist}/components/rich-text/theme/rich-text-theme.d.ts +0 -0
  704. /package/{storybook-static → dist}/components/rich-text/types.d.ts +0 -0
  705. /package/{storybook-static → dist}/components/rich-text/utils/markdown.d.ts +0 -0
  706. /package/{storybook-static → dist}/components/rich-text/utils/mediaType.d.ts +0 -0
  707. /package/{storybook-static → dist}/components/slider.d.ts +0 -0
  708. /package/{storybook-static → dist}/components/style-guide-data.d.ts +0 -0
  709. /package/{storybook-static → dist}/components/style-guide.d.ts +0 -0
  710. /package/{storybook-static → dist}/components/toaster.stories.d.ts +0 -0
  711. /package/{storybook-static → dist}/components/tooltip.d.ts +0 -0
  712. /package/{storybook-static → dist}/theme/global.d.ts +0 -0
  713. /package/{storybook-static → dist}/theme/index.d.ts +0 -0
  714. /package/{storybook-static → dist}/theme/primitives/fonts.d.ts +0 -0
  715. /package/{storybook-static → dist}/theme/primitives/sizes.d.ts +0 -0
  716. /package/{storybook-static → dist}/theme/recipes/alert.d.ts +0 -0
  717. /package/{storybook-static → dist}/theme/recipes/button.d.ts +0 -0
  718. /package/{storybook-static → dist}/theme/recipes/dialog.d.ts +0 -0
  719. /package/{storybook-static → dist}/theme/recipes/divider.d.ts +0 -0
  720. /package/{storybook-static → dist}/theme/recipes/drawer.d.ts +0 -0
  721. /package/{storybook-static → dist}/theme/recipes/editable.d.ts +0 -0
  722. /package/{storybook-static → dist}/theme/recipes/form.d.ts +0 -0
  723. /package/{storybook-static → dist}/theme/recipes/input.d.ts +0 -0
  724. /package/{storybook-static → dist}/theme/recipes/menu.d.ts +0 -0
  725. /package/{storybook-static → dist}/theme/recipes/popover.d.ts +0 -0
  726. /package/{storybook-static → dist}/theme/recipes/progress-circle.d.ts +0 -0
  727. /package/{storybook-static → dist}/theme/recipes/skeleton.d.ts +0 -0
  728. /package/{storybook-static → dist}/theme/recipes/textarea.d.ts +0 -0
  729. /package/{storybook-static → dist}/theme/recipes/tooltip.d.ts +0 -0
  730. /package/{storybook-static → dist}/theme/theme.d.ts +0 -0
  731. /package/{storybook-static → dist}/theme/tokens/borders.d.ts +0 -0
  732. /package/{storybook-static → dist}/theme/tokens/colors.d.ts +0 -0
  733. /package/{storybook-static → dist}/theme/tokens/layer-styles.d.ts +0 -0
  734. /package/{storybook-static → dist}/theme/tokens/shadows.d.ts +0 -0
  735. /package/{storybook-static → dist}/theme/tokens/text.d.ts +0 -0
  736. /package/{storybook-static → dist}/utils/formats.d.ts +0 -0
  737. /package/{storybook-static → dist}/utils/get-file-type-icon.d.ts +0 -0
@@ -1,41 +0,0 @@
1
- import{r as A,j as U}from"./iframe-B8FSoBNY.js";import{c as kr}from"./compiler-runtime-BXE7OOXE.js";import{w as wt,O as ct,a as oe,k as Os,_ as $,P as Be,F as po,X as zn,I as mo,B as wo,Q as yo,j as Jt,N as ue,b as _o,R as br,c as Sr,d as Cr,u as xr,D as xt,e as Er,i as ko,U as bo,o as So,$ as Ls,g as Dr,h as Co,l as fe,x as xo,G as Eo,H as Do,W as Le,q as Ao,Y as Io,C as To,L as Oo,n as Lo,f as vo}from"./rich-text-theme-Bkhh9rAZ.js";import{r as No}from"./index-DaXC_qY_.js";import{l as Mo,s as Uo,n as Ro,I as $o,E as Fo}from"./CodeBlockPlugin-C3OWpvP8.js";import{e as jo,a as Bo,F as Vo}from"./FloatingTextFormatToolbarPlugin-B6jc8xvg.js";import{B as Po}from"./index-B0y2_lLF.js";import{F as zo}from"./flex-DAJL4AFZ.js";const vs=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],Ns=vs[Math.floor(Math.random()*vs.length)],Ar=A.createContext(null);function Ir(){return{color:Ns[1],isCollabActive:!1,name:Ns[0],yjsDocMap:new Map}}const Yo=Ir();function Ho({children:e}){const t=A.useMemo(()=>Ir(),[]);return U.jsx(Ar.Provider,{value:t,children:e})}function Ko(e,t){let n=A.useContext(Ar);return n==null&&(function(s,...r){const i=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",s);for(const c of r)o.append("v",c);i.search=o.toString(),console.warn(`Minified Lexical warning #${s}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(319),n=n??Yo,e!=null&&(n.name=e),t!=null&&(n.color=t),n}const J=()=>new Map,In=e=>{const t=J();return e.forEach((n,s)=>{t.set(s,n)}),t},dt=(e,t,n)=>{let s=e.get(t);return s===void 0&&e.set(t,s=n()),s},Wo=(e,t)=>{const n=[];for(const[s,r]of e)n.push(t(r,s));return n},Go=(e,t)=>{for(const[n,s]of e)if(t(s,n))return!0;return!1},Et=()=>new Set,pn=e=>e[e.length-1],Jo=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},yt=Array.from,Yn=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},Hn=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},qo=(e,t)=>{const n=new Array(e);for(let s=0;s<e;s++)n[s]=t(s,n);return n},qt=Array.isArray;class Kn{constructor(){this._observers=J()}on(t,n){return dt(this._observers,t,Et).add(n),n}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};this.on(t,s)}off(t,n){const s=this._observers.get(t);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(t))}emit(t,n){return yt((this._observers.get(t)||J()).values()).forEach(s=>s(...n))}destroy(){this._observers=J()}}class Xo{constructor(){this._observers=J()}on(t,n){dt(this._observers,t,Et).add(n)}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};this.on(t,s)}off(t,n){const s=this._observers.get(t);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(t))}emit(t,n){return yt((this._observers.get(t)||J()).values()).forEach(s=>s(...n))}destroy(){this._observers=J()}}const it=Math.floor,Ue=Math.abs,Wn=(e,t)=>e<t?e:t,Ut=(e,t)=>e>t?e:t,Qo=Math.pow,Tr=e=>e!==0?e<0:1/e<0,Ms=1,Us=2,mn=4,wn=8,de=32,mt=64,X=128,tn=31,Tn=63,Ot=127,Zo=2147483647,Ve=Number.MAX_SAFE_INTEGER,Rs=Number.MIN_SAFE_INTEGER,tc=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&it(e)===e),Or=String.fromCharCode,ec=e=>e.toLowerCase(),nc=/^\s*/g,sc=e=>e.replace(nc,""),rc=/([A-Z])/g,$s=(e,t)=>sc(e.replace(rc,n=>`${t}${ec(n)}`)),ic=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=t.codePointAt(r);return s},ge=typeof TextEncoder<"u"?new TextEncoder:null,oc=e=>ge.encode(e),cc=ge?oc:ic;let ae=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});ae&&ae.decode(new Uint8Array).length===1&&(ae=null);const lc=(e,t)=>qo(t,()=>e).join("");class Ce{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const z=()=>new Ce,Gn=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},O=e=>{const t=new Uint8Array(Gn(e));let n=0;for(let s=0;s<e.bufs.length;s++){const r=e.bufs[s];t.set(r,n),n+=r.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},ac=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Ut(n,t)*2),e.cpos=0)},j=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},On=j,k=(e,t)=>{for(;t>Ot;)j(e,X|Ot&t),t=it(t/128);j(e,Ot&t)},Jn=(e,t)=>{const n=Tr(t);for(n&&(t=-t),j(e,(t>Tn?X:0)|(n?mt:0)|Tn&t),t=it(t/64);t>0;)j(e,(t>Ot?X:0)|Ot&t),t=it(t/128)},Ln=new Uint8Array(3e4),hc=Ln.length/3,uc=(e,t)=>{if(t.length<hc){const n=ge.encodeInto(t,Ln).written||0;k(e,n);for(let s=0;s<n;s++)j(e,Ln[s])}else v(e,cc(t))},fc=(e,t)=>{const n=unescape(encodeURIComponent(t)),s=n.length;k(e,s);for(let r=0;r<s;r++)j(e,n.codePointAt(r))},Lt=ge&&ge.encodeInto?uc:fc,en=(e,t)=>{const n=e.cbuf.length,s=e.cpos,r=Wn(n-s,t.length),i=t.length-r;e.cbuf.set(t.subarray(0,r),s),e.cpos+=r,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Ut(n*2,i)),e.cbuf.set(t.subarray(r)),e.cpos=i)},v=(e,t)=>{k(e,t.byteLength),en(e,t)},qn=(e,t)=>{ac(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},dc=(e,t)=>qn(e,4).setFloat32(0,t,!1),gc=(e,t)=>qn(e,8).setFloat64(0,t,!1),pc=(e,t)=>qn(e,8).setBigInt64(0,t,!1),Fs=new DataView(new ArrayBuffer(4)),mc=e=>(Fs.setFloat32(0,e),Fs.getFloat32(0)===e),pe=(e,t)=>{switch(typeof t){case"string":j(e,119),Lt(e,t);break;case"number":tc(t)&&Ue(t)<=Zo?(j(e,125),Jn(e,t)):mc(t)?(j(e,124),dc(e,t)):(j(e,123),gc(e,t));break;case"bigint":j(e,122),pc(e,t);break;case"object":if(t===null)j(e,126);else if(qt(t)){j(e,117),k(e,t.length);for(let n=0;n<t.length;n++)pe(e,t[n])}else if(t instanceof Uint8Array)j(e,116),v(e,t);else{j(e,118);const n=Object.keys(t);k(e,n.length);for(let s=0;s<n.length;s++){const r=n[s];Lt(e,r),pe(e,t[r])}}break;case"boolean":j(e,t?120:121);break;default:j(e,127)}};class js extends Ce{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&k(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const Bs=e=>{e.count>0&&(Jn(e.encoder,e.count===1?e.s:-e.s),e.count>1&&k(e.encoder,e.count-2))};class Re{constructor(){this.encoder=new Ce,this.s=0,this.count=0}write(t){this.s===t?this.count++:(Bs(this),this.count=1,this.s=t)}toUint8Array(){return Bs(this),O(this.encoder)}}const Vs=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);Jn(e.encoder,t),e.count>1&&k(e.encoder,e.count-2)}};class yn{constructor(){this.encoder=new Ce,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Vs(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Vs(this),O(this.encoder)}}class wc{constructor(){this.sarr=[],this.s="",this.lensE=new Re}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new Ce;return this.sarr.push(this.s),this.s="",Lt(t,this.sarr.join("")),en(t,this.lensE.toUint8Array()),O(t)}}const lt=e=>new Error(e),rt=()=>{throw lt("Method unimplemented")},Q=()=>{throw lt("Unexpected case")},Lr=lt("Unexpected end of array"),vr=lt("Integer out of Range");class nn{constructor(t){this.arr=t,this.pos=0}}const It=e=>new nn(e),yc=e=>e.pos!==e.arr.length,_c=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},P=e=>_c(e,b(e)),Xt=e=>e.arr[e.pos++],b=e=>{let t=0,n=1;const s=e.arr.length;for(;e.pos<s;){const r=e.arr[e.pos++];if(t=t+(r&Ot)*n,n*=128,r<X)return t;if(t>Ve)throw vr}throw Lr},Xn=e=>{let t=e.arr[e.pos++],n=t&Tn,s=64;const r=(t&mt)>0?-1:1;if((t&X)===0)return r*n;const i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&Ot)*s,s*=128,t<X)return r*n;if(n>Ve)throw vr}throw Lr},kc=e=>{let t=b(e);if(t===0)return"";{let n=String.fromCodePoint(Xt(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Xt(e));else for(;t>0;){const s=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+s);e.pos+=s,n+=String.fromCodePoint.apply(null,r),t-=s}return decodeURIComponent(escape(n))}},bc=e=>ae.decode(P(e)),Ct=ae?bc:kc,Qn=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Sc=e=>Qn(e,4).getFloat32(0,!1),Cc=e=>Qn(e,8).getFloat64(0,!1),xc=e=>Qn(e,8).getBigInt64(0,!1),Ec=[e=>{},e=>null,Xn,Sc,Cc,xc,e=>!1,e=>!0,Ct,e=>{const t=b(e),n={};for(let s=0;s<t;s++){const r=Ct(e);n[r]=me(e)}return n},e=>{const t=b(e),n=[];for(let s=0;s<t;s++)n.push(me(e));return n},P],me=e=>Ec[127-Xt(e)](e);class Ps extends nn{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),yc(this)?this.count=b(this)+1:this.count=-1),this.count--,this.s}}class $e extends nn{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=Xn(this);const t=Tr(this.s);this.count=1,t&&(this.s=-this.s,this.count=b(this)+2)}return this.count--,this.s}}class _n extends nn{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=Xn(this),n=t&1;this.diff=it(t/2),this.count=1,n&&(this.count=b(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Dc{constructor(t){this.decoder=new $e(t),this.str=Ct(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}}const Ac=crypto.getRandomValues.bind(crypto),Nr=()=>Ac(new Uint32Array(1))[0],Ic="10000000-1000-4000-8000"+-1e11,Tc=()=>Ic.replace(/[018]/g,e=>(e^Nr()&15>>e/4).toString(16)),Dt=Date.now,zs=e=>new Promise(e);Promise.all.bind(Promise);const Ys=e=>e===void 0?null:e;class Oc{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let Mr=new Oc,Zn=!0;try{typeof localStorage<"u"&&localStorage&&(Mr=localStorage,Zn=!1)}catch{}const Ur=Mr,Lc=e=>Zn||addEventListener("storage",e),vc=e=>Zn||removeEventListener("storage",e),we=Symbol("Equality"),Rr=(e,t)=>e===t||!!e?.[we]?.(t)||!1,Nc=e=>typeof e=="object",Mc=Object.assign,Uc=Object.keys,Rc=(e,t)=>{for(const n in e)t(e[n],n)},$c=(e,t)=>{const n=[];for(const s in e)n.push(t(e[s],s));return n},Pe=e=>Uc(e).length,Fc=e=>{for(const t in e)return!1;return!0},xe=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},ts=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),jc=(e,t)=>e===t||Pe(e)===Pe(t)&&xe(e,(n,s)=>(n!==void 0||ts(t,s))&&Rr(t[s],n)),Bc=Object.freeze,$r=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&$r(e[t])}return Bc(e)},es=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&es(e,t,n+1)}},Vc=e=>e,zt=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[we]!=null)return e[we](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break}case Set:{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;break}case Map:{if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!zt(e.get(n),t.get(n)))return!1;break}case void 0:case Object:if(Pe(e)!==Pe(t))return!1;for(const n in e)if(!ts(e,n)||!zt(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!zt(e[n],t[n]))return!1;break;default:return!1}return!0},Pc=(e,t)=>t.includes(e);var Fr={};const At=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",jr=typeof window<"u"&&typeof document<"u"&&!At;let ot;const zc=()=>{if(ot===void 0)if(At){ot=J();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const s=e[n];s[0]==="-"?(t!==null&&ot.set(t,""),t=s):t!==null&&(ot.set(t,s),t=null)}t!==null&&ot.set(t,"")}else typeof location=="object"?(ot=J(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){const[t,n]=e.split("=");ot.set(`--${$s(t,"-")}`,n),ot.set(`-${$s(t,"-")}`,n)}})):ot=J();return ot},vn=e=>zc().has(e),ze=e=>Ys(At?Fr[e.toUpperCase().replaceAll("-","_")]:Ur.getItem(e)),Br=e=>vn("--"+e)||ze(e)!==null,Yc=Br("production"),Hc=At&&Pc(Fr.FORCE_COLOR,["true","1","2"]),Kc=Hc||!vn("--no-colors")&&!Br("no-color")&&(!At||process.stdout.isTTY)&&(!At||vn("--color")||ze("COLORTERM")!==null||(ze("TERM")||"").includes("color")),Vr=e=>new Uint8Array(e),Wc=(e,t,n)=>new Uint8Array(e,t,n),Gc=e=>new Uint8Array(e),Jc=e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=Or(e[n]);return btoa(t)},qc=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Xc=e=>{const t=atob(e),n=Vr(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n},Qc=e=>{const t=Buffer.from(e,"base64");return Wc(t.buffer,t.byteOffset,t.byteLength)},Zc=jr?Jc:qc,tl=jr?Xc:Qc,el=e=>{const t=Vr(e.byteLength);return t.set(e),t};class nl{constructor(t,n){this.left=t,this.right=n}}const pt=(e,t)=>new nl(e,t),Hs=e=>e.next()>=.5,kn=(e,t,n)=>it(e.next()*(n+1-t)+t),Pr=(e,t,n)=>it(e.next()*(n+1-t)+t),ns=(e,t,n)=>Pr(e,t,n),sl=e=>Or(ns(e,97,122)),rl=(e,t=0,n=20)=>{const s=ns(e,t,n);let r="";for(let i=0;i<s;i++)r+=sl(e);return r},bn=(e,t)=>t[ns(e,0,t.length-1)],il=Symbol("0schema");class ol{constructor(){this._rerrs=[]}extend(t,n,s,r=null){this._rerrs.push({path:t,expected:n,has:s,message:r})}toString(){const t=[];for(let n=this._rerrs.length-1;n>0;n--){const s=this._rerrs[n];t.push(lc(" ",(this._rerrs.length-n)*2)+`${s.path!=null?`[${s.path}] `:""}${s.has} doesn't match ${s.expected}. ${s.message}`)}return t.join(`
2
- `)}}const Nn=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[we]?Rr(e,t):qt(e)?Yn(e,n=>Hn(t,s=>Nn(n,s))):Nc(e)?xe(e,(n,s)=>Nn(n,t[s])):!1;class W{static _dilutes=!1;extends(t){let[n,s]=[this.shape,t.shape];return this.constructor._dilutes&&([s,n]=[n,s]),Nn(n,s)}equals(t){return this.constructor===t.constructor&&zt(this.shape,t.shape)}[il](){return!0}[we](t){return this.equals(t)}validate(t){return this.check(t)}check(t,n){rt()}get nullable(){return ne(this,ln)}get optional(){return new Hr(this)}cast(t){return Ks(t,this),t}expect(t){return Ks(t,this),t}}class ss extends W{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n=void 0){const s=t?.constructor===this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),s}}const R=(e,t=null)=>new ss(e,t);R(ss);class rs extends W{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape(t);return!s&&n?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),s}}const V=e=>new rs(e);R(rs);class sn extends W{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape.some(r=>r===t);return!s&&n?.extend(null,this.shape.join(" | "),t.toString()),s}}const rn=(...e)=>new sn(e),zr=R(sn),cl=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),Yr=e=>{if(Qt.check(e))return[cl(e)];if(zr.check(e))return e.shape.map(t=>t+"");if(ti.check(e))return["[+-]?\\d+.?\\d*"];if(ei.check(e))return[".*"];if(Ye.check(e))return e.shape.map(Yr).flat(1);Q()};class ll extends W{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(Yr).map(n=>`(${n.join("|")})`).join("")+"$")}check(t,n){const s=this._r.exec(t)!=null;return!s&&n?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),s}}R(ll);const al=Symbol("optional");class Hr extends W{constructor(t){super(),this.shape=t}check(t,n){const s=t===void 0||this.shape.check(t);return!s&&n?.extend(null,"undefined (optional)","()"),s}get[al](){return!0}}const hl=R(Hr);class ul extends W{check(t,n){return n?.extend(null,"never",typeof t),!1}}R(ul);class on extends W{constructor(t,n=!1){super(),this.shape=t,this._isPartial=n}static _dilutes=!0;get partial(){return new on(this.shape,!0)}check(t,n){return t==null?(n?.extend(null,"object","null"),!1):xe(this.shape,(s,r)=>{const i=this._isPartial&&!ts(t,r)||s.check(t[r],n);return!i&&n?.extend(r.toString(),s.toString(),typeof t[r],"Object property does not match"),i})}}const fl=e=>new on(e),dl=R(on),gl=V(e=>e!=null&&(e.constructor===Object||e.constructor==null));class Kr extends W{constructor(t,n){super(),this.shape={keys:t,values:n}}check(t,n){return t!=null&&xe(t,(s,r)=>{const i=this.shape.keys.check(r,n);return!i&&n?.extend(r+"","Record",typeof t,i?"Key doesn't match schema":"Value doesn't match value"),i&&this.shape.values.check(s,n)})}}const Wr=(e,t)=>new Kr(e,t),pl=R(Kr);class Gr extends W{constructor(t){super(),this.shape=t}check(t,n){return t!=null&&xe(this.shape,(s,r)=>{const i=s.check(t[r],n);return!i&&n?.extend(r.toString(),"Tuple",typeof s),i})}}const ml=(...e)=>new Gr(e);R(Gr);class Jr extends W{constructor(t){super(),this.shape=t.length===1?t[0]:new is(t)}check(t,n){const s=qt(t)&&Yn(t,r=>this.shape.check(r));return!s&&n?.extend(null,"Array",""),s}}const qr=(...e)=>new Jr(e),wl=R(Jr),yl=V(e=>qt(e));class Xr extends W{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n){const s=t instanceof this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name),s}}const _l=(e,t=null)=>new Xr(e,t);R(Xr);const kl=_l(W);class bl extends W{constructor(t){super(),this.len=t.length-1,this.args=ml(...t.slice(-1)),this.res=t[this.len]}check(t,n){const s=t.constructor===Function&&t.length<=this.len;return!s&&n?.extend(null,"function",typeof t),s}}const Sl=R(bl),Cl=V(e=>typeof e=="function");class xl extends W{constructor(t){super(),this.shape=t}check(t,n){const s=Yn(this.shape,r=>r.check(t,n));return!s&&n?.extend(null,"Intersectinon",typeof t),s}}R(xl,e=>e.shape.length>0);class is extends W{static _dilutes=!0;constructor(t){super(),this.shape=t}check(t,n){const s=Hn(this.shape,r=>r.check(t,n));return n?.extend(null,"Union",typeof t),s}}const ne=(...e)=>e.findIndex(t=>Ye.check(t))>=0?ne(...e.map(t=>ye(t)).map(t=>Ye.check(t)?t.shape:[t]).flat(1)):e.length===1?e[0]:new is(e),Ye=R(is),Qr=()=>!0,He=V(Qr),El=R(rs,e=>e.shape===Qr),os=V(e=>typeof e=="bigint"),Dl=V(e=>e===os),Zr=V(e=>typeof e=="symbol");V(e=>e===Zr);const Yt=V(e=>typeof e=="number"),ti=V(e=>e===Yt),Qt=V(e=>typeof e=="string"),ei=V(e=>e===Qt),cn=V(e=>typeof e=="boolean"),Al=V(e=>e===cn),ni=rn(void 0);R(sn,e=>e.shape.length===1&&e.shape[0]===void 0);rn(void 0);const ln=rn(null),Il=R(sn,e=>e.shape.length===1&&e.shape[0]===null);R(Uint8Array);R(ss,e=>e.shape===Uint8Array);const Tl=ne(Yt,Qt,ln,ni,os,cn,Zr);(()=>{const e=qr(He),t=Wr(Qt,He),n=ne(Yt,Qt,ln,cn,e,t);return e.shape=n,t.shape.values=n,n})();const ye=e=>{if(kl.check(e))return e;if(gl.check(e)){const t={};for(const n in e)t[n]=ye(e[n]);return fl(t)}else{if(yl.check(e))return ne(...e.map(ye));if(Tl.check(e))return rn(e);if(Cl.check(e))return R(e)}Q()},Ks=Yc?()=>{}:(e,t)=>{const n=new ol;if(!t.check(e,n))throw lt(`Expected value to be of type ${t.constructor.name}.
3
- ${n.toString()}`)};class Ol{constructor(t){this.patterns=[],this.$state=t}if(t,n){return this.patterns.push({if:ye(t),h:n}),this}else(t){return this.if(He,t)}done(){return(t,n)=>{for(let s=0;s<this.patterns.length;s++){const r=this.patterns[s];if(r.if.check(t))return r.h(t,n)}throw lt("Unhandled pattern")}}}const Ll=e=>new Ol(e),si=Ll(He).if(ti,(e,t)=>kn(t,Rs,Ve)).if(ei,(e,t)=>rl(t)).if(Al,(e,t)=>Hs(t)).if(Dl,(e,t)=>BigInt(kn(t,Rs,Ve))).if(Ye,(e,t)=>jt(t,bn(t,e.shape))).if(dl,(e,t)=>{const n={};for(const s in e.shape){let r=e.shape[s];if(hl.check(r)){if(Hs(t))continue;r=r.shape}n[s]=si(r,t)}return n}).if(wl,(e,t)=>{const n=[],s=Pr(t,0,42);for(let r=0;r<s;r++)n.push(jt(t,e.shape));return n}).if(zr,(e,t)=>bn(t,e.shape)).if(Il,(e,t)=>null).if(Sl,(e,t)=>{const n=jt(t,e.res);return()=>n}).if(El,(e,t)=>jt(t,bn(t,[Yt,Qt,ln,ni,os,cn,qr(Yt),Wr(ne("a","b","c"),Yt)]))).if(pl,(e,t)=>{const n={},s=kn(t,0,3);for(let r=0;r<s;r++){const i=jt(t,e.shape.keys),o=jt(t,e.shape.values);n[i]=o}return n}).done(),jt=(e,t)=>si(ye(t),e),an=typeof document<"u"?document:{};V(e=>e.nodeType===Rl);typeof DOMParser<"u"&&new DOMParser;V(e=>e.nodeType===Nl);V(e=>e.nodeType===Ml);const vl=e=>Wo(e,(t,n)=>`${n}:${t};`).join(""),Nl=an.ELEMENT_NODE,Ml=an.TEXT_NODE,Ul=an.DOCUMENT_NODE,Rl=an.DOCUMENT_FRAGMENT_NODE;V(e=>e.nodeType===Ul);const _t=Symbol,ri=_t(),ii=_t(),$l=_t(),Fl=_t(),jl=_t(),oi=_t(),Bl=_t(),cs=_t(),Vl=_t(),Pl=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let s=0;for(;s<e.length;s++){const r=e[s];if(r===void 0)break;if(r.constructor===String||r.constructor===Number)t.push(r);else if(r.constructor===Object)break}for(s>0&&n.push(t.join(""));s<e.length;s++){const r=e[s];r instanceof Symbol||n.push(r)}return n},zl={[ri]:pt("font-weight","bold"),[ii]:pt("font-weight","normal"),[$l]:pt("color","blue"),[jl]:pt("color","green"),[Fl]:pt("color","grey"),[oi]:pt("color","red"),[Bl]:pt("color","purple"),[cs]:pt("color","orange"),[Vl]:pt("color","black")},Yl=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],s=J();let r=[],i=0;for(;i<e.length;i++){const o=e[i],c=zl[o];if(c!==void 0)s.set(c.left,c.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const l=vl(s);i>0||l.length>0?(t.push("%c"+o),n.push(l)):t.push(o)}else break}}for(i>0&&(r=n,r.unshift(t.join("")));i<e.length;i++){const o=e[i];o instanceof Symbol||r.push(o)}return r},ci=Kc?Yl:Pl,Hl=(...e)=>{console.log(...ci(e)),ai.forEach(t=>t.print(e))},li=(...e)=>{console.warn(...ci(e)),e.unshift(cs),ai.forEach(t=>t.print(e))},ai=Et(),hi=e=>({[Symbol.iterator](){return this},next:e}),Kl=(e,t)=>hi(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Sn=(e,t)=>hi(()=>{const{done:n,value:s}=e.next();return{done:n,value:n?void 0:t(s)}});class ls{constructor(t,n){this.clock=t,this.len=n}}class se{constructor(){this.clients=new Map}}const Zt=(e,t,n)=>t.clients.forEach((s,r)=>{const i=e.doc.store.clients.get(r);if(i!=null){const o=i[i.length-1],c=o.id.clock+o.length;for(let l=0,h=s[l];l<s.length&&h.clock<c;h=s[++l])Ci(e,i,h.clock,h.len,n)}}),Wl=(e,t)=>{let n=0,s=e.length-1;for(;n<=s;){const r=it((n+s)/2),i=e[r],o=i.clock;if(o<=t){if(t<o+i.len)return r;n=r+1}else s=r-1}return null},Ee=(e,t)=>{const n=e.clients.get(t.client);return n!==void 0&&Wl(n,t.clock)!==null},as=e=>{e.clients.forEach(t=>{t.sort((r,i)=>r.clock-i.clock);let n,s;for(n=1,s=1;n<t.length;n++){const r=t[s-1],i=t[n];r.clock+r.len>=i.clock?r.len=Ut(r.len,i.clock+i.len-r.clock):(s<n&&(t[s]=i),s++)}t.length=s})},Mn=e=>{const t=new se;for(let n=0;n<e.length;n++)e[n].clients.forEach((s,r)=>{if(!t.clients.has(r)){const i=s.slice();for(let o=n+1;o<e.length;o++)Jo(i,e[o].clients.get(r)||[]);t.clients.set(r,i)}});return as(t),t},_e=(e,t,n,s)=>{dt(e.clients,t,()=>[]).push(new ls(n,s))},Gl=()=>new se,Jl=e=>{const t=Gl();return e.clients.forEach((n,s)=>{const r=[];for(let i=0;i<n.length;i++){const o=n[i];if(o.deleted){const c=o.id.clock;let l=o.length;if(i+1<n.length)for(let h=n[i+1];i+1<n.length&&h.deleted;h=n[++i+1])l+=h.length;r.push(new ls(c,l))}}r.length>0&&t.clients.set(s,r)}),t},re=(e,t)=>{k(e.restEncoder,t.clients.size),yt(t.clients.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{e.resetDsCurVal(),k(e.restEncoder,n);const r=s.length;k(e.restEncoder,r);for(let i=0;i<r;i++){const o=s[i];e.writeDsClock(o.clock),e.writeDsLen(o.len)}})},hs=e=>{const t=new se,n=b(e.restDecoder);for(let s=0;s<n;s++){e.resetDsCurVal();const r=b(e.restDecoder),i=b(e.restDecoder);if(i>0){const o=dt(t.clients,r,()=>[]);for(let c=0;c<i;c++)o.push(new ls(e.readDsClock(),e.readDsLen()))}}return t},Ws=(e,t,n)=>{const s=new se,r=b(e.restDecoder);for(let i=0;i<r;i++){e.resetDsCurVal();const o=b(e.restDecoder),c=b(e.restDecoder),l=n.clients.get(o)||[],h=M(n,o);for(let a=0;a<c;a++){const u=e.readDsClock(),f=u+e.readDsLen();if(u<h){h<f&&_e(s,o,h,f-h);let d=ht(l,u),g=l[d];for(!g.deleted&&g.id.clock<u&&(l.splice(d+1,0,Qe(t,g,u-g.id.clock)),d++);d<l.length&&(g=l[d++],g.id.clock<f);)g.deleted||(f<g.id.clock+g.length&&l.splice(d,0,Qe(t,g,f-g.id.clock)),g.delete(t))}else _e(s,o,u,f-u)}}if(s.clients.size>0){const i=new vt;return k(i.restEncoder,0),re(i,s),i.toUint8Array()}return null},ui=Nr;class at extends Kn{constructor({guid:t=Tc(),collectionid:n=null,gc:s=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:c=!0}={}){super(),this.gc=s,this.gcFilter=r,this.clientID=ui(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new bi,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=zs(h=>{this.on("load",()=>{this.isLoaded=!0,h(this)})});const l=()=>zs(h=>{const a=u=>{(u===void 0||u===!0)&&(this.off("sync",a),h())};this.on("sync",a)});this.on("sync",h=>{h===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=h===void 0||h===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const t=this._item;t!==null&&!this.shouldLoad&&I(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(yt(this.subdocs).map(t=>t.guid))}transact(t,n=null){return I(this,t,n)}get(t,n=B){const s=dt(this.share,t,()=>{const i=new n;return i._integrate(this,null),i}),r=s.constructor;if(n!==B&&r!==n)if(r===B){const i=new n;i._map=s._map,s._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=i}),i._start=s._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=s._length,this.share.set(t,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return s}getArray(t=""){return this.get(t,Wt)}getText(t=""){return this.get(t,ee)}getMap(t=""){return this.get(t,H)}getXmlElement(t=""){return this.get(t,nt)}getXmlFragment(t=""){return this.get(t,Nt)}toJSON(){const t={};return this.share.forEach((n,s)=>{t[s]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,yt(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new at({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,I(t.parent.doc,s=>{const r=n.doc;t.deleted||s.subdocsAdded.add(r),s.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class fi{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return b(this.restDecoder)}readDsLen(){return b(this.restDecoder)}}class di extends fi{readLeftID(){return C(b(this.restDecoder),b(this.restDecoder))}readRightID(){return C(b(this.restDecoder),b(this.restDecoder))}readClient(){return b(this.restDecoder)}readInfo(){return Xt(this.restDecoder)}readString(){return Ct(this.restDecoder)}readParentInfo(){return b(this.restDecoder)===1}readTypeRef(){return b(this.restDecoder)}readLen(){return b(this.restDecoder)}readAny(){return me(this.restDecoder)}readBuf(){return el(P(this.restDecoder))}readJSON(){return JSON.parse(Ct(this.restDecoder))}readKey(){return Ct(this.restDecoder)}}class ql{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=b(this.restDecoder),this.dsCurrVal}readDsLen(){const t=b(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class te extends ql{constructor(t){super(t),this.keys=[],b(t),this.keyClockDecoder=new _n(P(t)),this.clientDecoder=new $e(P(t)),this.leftClockDecoder=new _n(P(t)),this.rightClockDecoder=new _n(P(t)),this.infoDecoder=new Ps(P(t),Xt),this.stringDecoder=new Dc(P(t)),this.parentInfoDecoder=new Ps(P(t),Xt),this.typeRefDecoder=new $e(P(t)),this.lenDecoder=new $e(P(t))}readLeftID(){return new Ht(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Ht(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return me(this.restDecoder)}readBuf(){return P(this.restDecoder)}readJSON(){return me(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class gi{constructor(){this.restEncoder=z()}toUint8Array(){return O(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){k(this.restEncoder,t)}writeDsLen(t){k(this.restEncoder,t)}}class De extends gi{writeLeftID(t){k(this.restEncoder,t.client),k(this.restEncoder,t.clock)}writeRightID(t){k(this.restEncoder,t.client),k(this.restEncoder,t.clock)}writeClient(t){k(this.restEncoder,t)}writeInfo(t){On(this.restEncoder,t)}writeString(t){Lt(this.restEncoder,t)}writeParentInfo(t){k(this.restEncoder,t?1:0)}writeTypeRef(t){k(this.restEncoder,t)}writeLen(t){k(this.restEncoder,t)}writeAny(t){pe(this.restEncoder,t)}writeBuf(t){v(this.restEncoder,t)}writeJSON(t){Lt(this.restEncoder,JSON.stringify(t))}writeKey(t){Lt(this.restEncoder,t)}}class pi{constructor(){this.restEncoder=z(),this.dsCurrVal=0}toUint8Array(){return O(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const n=t-this.dsCurrVal;this.dsCurrVal=t,k(this.restEncoder,n)}writeDsLen(t){t===0&&Q(),k(this.restEncoder,t-1),this.dsCurrVal+=t}}class vt extends pi{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new yn,this.clientEncoder=new Re,this.leftClockEncoder=new yn,this.rightClockEncoder=new yn,this.infoEncoder=new js(On),this.stringEncoder=new wc,this.parentInfoEncoder=new js(On),this.typeRefEncoder=new Re,this.lenEncoder=new Re}toUint8Array(){const t=z();return k(t,0),v(t,this.keyClockEncoder.toUint8Array()),v(t,this.clientEncoder.toUint8Array()),v(t,this.leftClockEncoder.toUint8Array()),v(t,this.rightClockEncoder.toUint8Array()),v(t,O(this.infoEncoder)),v(t,this.stringEncoder.toUint8Array()),v(t,O(this.parentInfoEncoder)),v(t,this.typeRefEncoder.toUint8Array()),v(t,this.lenEncoder.toUint8Array()),en(t,O(this.restEncoder)),O(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){pe(this.restEncoder,t)}writeBuf(t){v(this.restEncoder,t)}writeJSON(t){pe(this.restEncoder,t)}writeKey(t){const n=this.keyMap.get(t);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(n)}}const Xl=(e,t,n,s)=>{s=Ut(s,t[0].id.clock);const r=ht(t,s);k(e.restEncoder,t.length-r),e.writeClient(n),k(e.restEncoder,s);const i=t[r];i.write(e,s-i.id.clock);for(let o=r+1;o<t.length;o++)t[o].write(e,0)},us=(e,t,n)=>{const s=new Map;n.forEach((r,i)=>{M(t,i)>r&&s.set(i,r)}),hn(t).forEach((r,i)=>{n.has(i)||s.set(i,0)}),k(e.restEncoder,s.size),yt(s.entries()).sort((r,i)=>i[0]-r[0]).forEach(([r,i])=>{Xl(e,t.clients.get(r),r,i)})},Ql=(e,t)=>{const n=J(),s=b(e.restDecoder);for(let r=0;r<s;r++){const i=b(e.restDecoder),o=new Array(i),c=e.readClient();let l=b(e.restDecoder);n.set(c,{i:0,refs:o});for(let h=0;h<i;h++){const a=e.readInfo();switch(tn&a){case 0:{const u=e.readLen();o[h]=new Z(C(c,l),u),l+=u;break}case 10:{const u=b(e.restDecoder);o[h]=new tt(C(c,l),u),l+=u;break}default:{const u=(a&(mt|X))===0,f=new T(C(c,l),null,(a&X)===X?e.readLeftID():null,null,(a&mt)===mt?e.readRightID():null,u?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,u&&(a&de)===de?e.readString():null,Ki(e,a));o[h]=f,l+=f.length}}}}return n},Zl=(e,t,n)=>{const s=[];let r=yt(n.keys()).sort((d,g)=>d-g);if(r.length===0)return null;const i=()=>{if(r.length===0)return null;let d=n.get(r[r.length-1]);for(;d.refs.length===d.i;)if(r.pop(),r.length>0)d=n.get(r[r.length-1]);else return null;return d};let o=i();if(o===null)return null;const c=new bi,l=new Map,h=(d,g)=>{const p=l.get(d);(p==null||p>g)&&l.set(d,g)};let a=o.refs[o.i++];const u=new Map,f=()=>{for(const d of s){const g=d.id.client,p=n.get(g);p?(p.i--,c.clients.set(g,p.refs.slice(p.i)),n.delete(g),p.i=0,p.refs=[]):c.clients.set(g,[d]),r=r.filter(m=>m!==g)}s.length=0};for(;;){if(a.constructor!==tt){const g=dt(u,a.id.client,()=>M(t,a.id.client))-a.id.clock;if(g<0)s.push(a),h(a.id.client,a.id.clock-1),f();else{const p=a.getMissing(e,t);if(p!==null){s.push(a);const m=n.get(p)||{refs:[],i:0};if(m.refs.length===m.i)h(p,M(t,p)),f();else{a=m.refs[m.i++];continue}}else(g===0||g<a.length)&&(a.integrate(e,g),u.set(a.id.client,a.id.clock+a.length))}}if(s.length>0)a=s.pop();else if(o!==null&&o.i<o.refs.length)a=o.refs[o.i++];else{if(o=i(),o===null)break;a=o.refs[o.i++]}}if(c.clients.size>0){const d=new vt;return us(d,c,new Map),k(d.restEncoder,0),{missing:l,update:d.toUint8Array()}}return null},ta=(e,t)=>us(e,t.doc.store,t.beforeState),ea=(e,t,n,s=new te(e))=>I(t,r=>{r.local=!1;let i=!1;const o=r.doc,c=o.store,l=Ql(s,o),h=Zl(r,c,l),a=c.pendingStructs;if(a){for(const[f,d]of a.missing)if(d<M(c,f)){i=!0;break}if(h){for(const[f,d]of h.missing){const g=a.missing.get(f);(g==null||g>d)&&a.missing.set(f,d)}a.update=We([a.update,h.update])}}else c.pendingStructs=h;const u=Ws(s,r,c);if(c.pendingDs){const f=new te(It(c.pendingDs));b(f.restDecoder);const d=Ws(f,r,c);u&&d?c.pendingDs=We([u,d]):c.pendingDs=u||d}else c.pendingDs=u;if(i){const f=c.pendingStructs.update;c.pendingStructs=null,mi(r.doc,f)}},n,!1),mi=(e,t,n,s=te)=>{const r=It(t);ea(r,e,n,new s(r))},na=(e,t,n)=>mi(e,t,n,di),sa=(e,t,n=new Map)=>{us(e,t.store,n),re(e,Jl(t.store))},ra=(e,t=new Uint8Array([0]),n=new vt)=>{const s=wi(t);sa(n,e,s);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Da(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===De)return xa(r.map((i,o)=>o===0?i:Ia(i)));if(n.constructor===vt)return We(r)}return r[0]},ia=(e,t)=>ra(e,t,new De),oa=e=>{const t=new Map,n=b(e.restDecoder);for(let s=0;s<n;s++){const r=b(e.restDecoder),i=b(e.restDecoder);t.set(r,i)}return t},wi=e=>oa(new fi(It(e))),yi=(e,t)=>(k(e.restEncoder,t.size),yt(t.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{k(e.restEncoder,n),k(e.restEncoder,s)}),e),ca=(e,t)=>yi(e,hn(t.store)),la=(e,t=new pi)=>(e instanceof Map?yi(t,e):ca(t,e),t.toUint8Array()),aa=e=>la(e,new gi);class ha{constructor(){this.l=[]}}const Gs=()=>new ha,Js=(e,t)=>e.l.push(t),qs=(e,t)=>{const n=e.l,s=n.length;e.l=n.filter(r=>t!==r),s===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},_i=(e,t,n)=>es(e.l,[t,n]);class Ht{constructor(t,n){this.client=t,this.clock=n}}const Pt=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,C=(e,t)=>new Ht(e,t),ki=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw Q()},Ke=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1};class ua{constructor(t,n,s,r=0){this.type=t,this.tname=n,this.item=s,this.assoc=r}}class fa{constructor(t,n,s=0){this.type=t,this.index=n,this.assoc=s}}const da=(e,t,n=0)=>new fa(e,t,n),ve=(e,t,n)=>{let s=null,r=null;return e._item===null?r=ki(e):s=C(e._item.id.client,e._item.id.clock),new ua(s,r,t,n)},Un=(e,t,n=0)=>{let s=e._start;if(n<0){if(t===0)return ve(e,null,n);t--}for(;s!==null;){if(!s.deleted&&s.countable){if(s.length>t)return ve(e,C(s.id.client,s.id.clock+t),n);t-=s.length}if(s.right===null&&n<0)return ve(e,s.lastId,n);s=s.right}return ve(e,null,n)},ga=(e,t)=>{const n=Kt(e,t),s=t.clock-n.id.clock;return{item:n,diff:s}},pa=(e,t,n=!0)=>{const s=t.store,r=e.item,i=e.type,o=e.tname,c=e.assoc;let l=null,h=0;if(r!==null){if(M(s,r.client)<=r.clock)return null;const a=n?Bn(s,r):ga(s,r),u=a.item;if(!(u instanceof T))return null;if(l=u.parent,l._item===null||!l._item.deleted){h=u.deleted||!u.countable?0:a.diff+(c>=0?0:1);let f=u.left;for(;f!==null;)!f.deleted&&f.countable&&(h+=f.length),f=f.left}}else{if(o!==null)l=t.get(o);else if(i!==null){if(M(s,i.client)<=i.clock)return null;const{item:a}=n?Bn(s,i):{item:Kt(s,i)};if(a instanceof T&&a.content instanceof gt)l=a.content.type;else return null}else throw Q();c>=0?h=l._length:h=0}return da(l,h,e.assoc)},ma=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&Pt(e.item,t.item)&&Pt(e.type,t.type)&&e.assoc===t.assoc,Bt=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Ee(t.ds,e.id),Rn=(e,t)=>{const n=dt(e.meta,Rn,Et),s=e.doc.store;n.has(t)||(t.sv.forEach((r,i)=>{r<M(s,i)&&G(e,C(i,r))}),Zt(e,t.ds,r=>{}),n.add(t))};class bi{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const hn=e=>{const t=new Map;return e.clients.forEach((n,s)=>{const r=n[n.length-1];t.set(s,r.id.clock+r.length)}),t},M=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const s=n[n.length-1];return s.id.clock+s.length},Si=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const s=n[n.length-1];if(s.id.clock+s.length!==t.id.clock)throw Q()}n.push(t)},ht=(e,t)=>{let n=0,s=e.length-1,r=e[s],i=r.id.clock;if(i===t)return s;let o=it(t/(i+r.length-1)*s);for(;n<=s;){if(r=e[o],i=r.id.clock,i<=t){if(t<i+r.length)return o;n=o+1}else s=o-1;o=it((n+s)/2)}throw Q()},wa=(e,t)=>{const n=e.clients.get(t.client);return n[ht(n,t.clock)]},Kt=wa,$n=(e,t,n)=>{const s=ht(t,n),r=t[s];return r.id.clock<n&&r instanceof T?(t.splice(s+1,0,Qe(e,r,n-r.id.clock)),s+1):s},G=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[$n(e,n,t.clock)]},Xs=(e,t,n)=>{const s=t.clients.get(n.client),r=ht(s,n.clock),i=s[r];return n.clock!==i.id.clock+i.length-1&&i.constructor!==Z&&s.splice(r+1,0,Qe(e,i,n.clock-i.id.clock+1)),i},ya=(e,t,n)=>{const s=e.clients.get(t.id.client);s[ht(s,t.id.clock)]=n},Ci=(e,t,n,s,r)=>{if(s===0)return;const i=n+s;let o=$n(e,t,n),c;do c=t[o++],i<c.id.clock+c.length&&$n(e,t,i),r(c);while(o<t.length&&t[o].id.clock<i)};class _a{constructor(t,n,s){this.doc=t,this.deleteSet=new se,this.beforeState=hn(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=s,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const Qs=(e,t)=>t.deleteSet.clients.size===0&&!Go(t.afterState,(n,s)=>t.beforeState.get(s)!==n)?!1:(as(t.deleteSet),ta(e,t),re(e,t.deleteSet),!0),Zs=(e,t,n)=>{const s=t._item;(s===null||s.id.clock<(e.beforeState.get(s.id.client)||0)&&!s.deleted)&&dt(e.changed,t,Et).add(n)},Fe=(e,t)=>{let n=e[t],s=e[t-1],r=t;for(;r>0;n=s,s=e[--r-1]){if(s.deleted===n.deleted&&s.constructor===n.constructor&&s.mergeWith(n)){n instanceof T&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,s);continue}break}const i=t-r;return i&&e.splice(t+1-i,i),i},ka=(e,t,n)=>{for(const[s,r]of e.clients.entries()){const i=t.clients.get(s);for(let o=r.length-1;o>=0;o--){const c=r[o],l=c.clock+c.len;for(let h=ht(i,c.clock),a=i[h];h<i.length&&a.id.clock<l;a=i[++h]){const u=i[h];if(c.clock+c.len<=u.id.clock)break;u instanceof T&&u.deleted&&!u.keep&&n(u)&&u.gc(t,!1)}}}},ba=(e,t)=>{e.clients.forEach((n,s)=>{const r=t.clients.get(s);for(let i=n.length-1;i>=0;i--){const o=n[i],c=Wn(r.length-1,1+ht(r,o.clock+o.len-1));for(let l=c,h=r[l];l>0&&h.id.clock>=o.clock;h=r[l])l-=1+Fe(r,l)}})},xi=(e,t)=>{if(t<e.length){const n=e[t],s=n.doc,r=s.store,i=n.deleteSet,o=n._mergeStructs;try{as(i),n.afterState=hn(n.doc.store),s.emit("beforeObserverCalls",[n,s]);const c=[];n.changed.forEach((l,h)=>c.push(()=>{(h._item===null||!h._item.deleted)&&h._callObserver(n,l)})),c.push(()=>{n.changedParentTypes.forEach((l,h)=>{h._dEH.l.length>0&&(h._item===null||!h._item.deleted)&&(l=l.filter(a=>a.target._item===null||!a.target._item.deleted),l.forEach(a=>{a.currentTarget=h,a._path=null}),l.sort((a,u)=>a.path.length-u.path.length),c.push(()=>{_i(h._dEH,l,n)}))}),c.push(()=>s.emit("afterTransaction",[n,s])),c.push(()=>{n._needFormattingCleanup&&Va(n)})}),es(c,[])}finally{s.gc&&ka(i,r,s.gcFilter),ba(i,r),n.afterState.forEach((a,u)=>{const f=n.beforeState.get(u)||0;if(f!==a){const d=r.clients.get(u),g=Ut(ht(d,f),1);for(let p=d.length-1;p>=g;)p-=1+Fe(d,p)}});for(let a=o.length-1;a>=0;a--){const{client:u,clock:f}=o[a].id,d=r.clients.get(u),g=ht(d,f);g+1<d.length&&Fe(d,g+1)>1||g>0&&Fe(d,g)}if(!n.local&&n.afterState.get(s.clientID)!==n.beforeState.get(s.clientID)&&(Hl(cs,ri,"[yjs] ",ii,oi,"Changed the client-id because another client seems to be using it."),s.clientID=ui()),s.emit("afterTransactionCleanup",[n,s]),s._observers.has("update")){const a=new De;Qs(a,n)&&s.emit("update",[a.toUint8Array(),n.origin,s,n])}if(s._observers.has("updateV2")){const a=new vt;Qs(a,n)&&s.emit("updateV2",[a.toUint8Array(),n.origin,s,n])}const{subdocsAdded:c,subdocsLoaded:l,subdocsRemoved:h}=n;(c.size>0||h.size>0||l.size>0)&&(c.forEach(a=>{a.clientID=s.clientID,a.collectionid==null&&(a.collectionid=s.collectionid),s.subdocs.add(a)}),h.forEach(a=>s.subdocs.delete(a)),s.emit("subdocs",[{loaded:l,added:c,removed:h},s,n]),h.forEach(a=>a.destroy())),e.length<=t+1?(s._transactionCleanups=[],s.emit("afterAllTransactions",[s,e])):xi(e,t+1)}}},I=(e,t,n=null,s=!0)=>{const r=e._transactionCleanups;let i=!1,o=null;e._transaction===null&&(i=!0,e._transaction=new _a(e,n,s),r.push(e._transaction),r.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{o=t(e._transaction)}finally{if(i){const c=e._transaction===r[0];e._transaction=null,c&&xi(r,0)}}return o};class Sa{constructor(t,n){this.insertions=n,this.deletions=t,this.meta=new Map}}const tr=(e,t,n)=>{Zt(e,n.deletions,s=>{s instanceof T&&t.scope.some(r=>r===e.doc||Ke(r,s))&&_s(s,!1)})},er=(e,t,n)=>{let s=null;const r=e.doc,i=e.scope;I(r,c=>{for(;t.length>0&&e.currStackItem===null;){const l=r.store,h=t.pop(),a=new Set,u=[];let f=!1;Zt(c,h.insertions,d=>{if(d instanceof T){if(d.redone!==null){let{item:g,diff:p}=Bn(l,d.id);p>0&&(g=G(c,C(g.id.client,g.id.clock+p))),d=g}!d.deleted&&i.some(g=>g===c.doc||Ke(g,d))&&u.push(d)}}),Zt(c,h.deletions,d=>{d instanceof T&&i.some(g=>g===c.doc||Ke(g,d))&&!Ee(h.insertions,d.id)&&a.add(d)}),a.forEach(d=>{f=Hi(c,d,a,h.insertions,e.ignoreRemoteMapChanges,e)!==null||f});for(let d=u.length-1;d>=0;d--){const g=u[d];e.deleteFilter(g)&&(g.delete(c),f=!0)}e.currStackItem=f?h:null}c.changed.forEach((l,h)=>{l.has(null)&&h._searchMarker&&(h._searchMarker.length=0)}),s=c},e);const o=e.currStackItem;if(o!=null){const c=s.changedParentTypes;e.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:c,origin:e},e]),e.currStackItem=null}return o};class Ei extends Kn{constructor(t,{captureTimeout:n=500,captureTransaction:s=l=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:c=qt(t)?t[0].doc:t instanceof at?t:t.doc}={}){super(),this.scope=[],this.doc=c,this.addToScope(t),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=s,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(m=>l.changedParentTypes.has(m)||m===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const h=this.undoing,a=this.redoing,u=h?this.redoStack:this.undoStack;h?this.stopCapturing():a||this.clear(!1,!0);const f=new se;l.afterState.forEach((m,w)=>{const _=l.beforeState.get(w)||0,y=m-_;y>0&&_e(f,w,_,y)});const d=Dt();let g=!1;if(this.lastChange>0&&d-this.lastChange<this.captureTimeout&&u.length>0&&!h&&!a){const m=u[u.length-1];m.deletions=Mn([m.deletions,l.deleteSet]),m.insertions=Mn([m.insertions,f])}else u.push(new Sa(l.deleteSet,f)),g=!0;!h&&!a&&(this.lastChange=d),Zt(l,l.deleteSet,m=>{m instanceof T&&this.scope.some(w=>w===l.doc||Ke(w,m))&&_s(m,!0)});const p=[{stackItem:u[u.length-1],origin:l.origin,type:h?"redo":"undo",changedParentTypes:l.changedParentTypes},this];g?this.emit("stack-item-added",p):this.emit("stack-item-updated",p)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(t){const n=new Set(this.scope);t=qt(t)?t:[t],t.forEach(s=>{n.has(s)||(n.add(s),(s instanceof B?s.doc!==this.doc:s!==this.doc)&&li("[yjs#509] Not same Y.Doc"),this.scope.push(s))})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,n=!0){(t&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(s=>{t&&(this.undoStack.forEach(r=>tr(s,this,r)),this.undoStack=[]),n&&(this.redoStack.forEach(r=>tr(s,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=er(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=er(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*Ca(e){const t=b(e.restDecoder);for(let n=0;n<t;n++){const s=b(e.restDecoder),r=e.readClient();let i=b(e.restDecoder);for(let o=0;o<s;o++){const c=e.readInfo();if(c===10){const l=b(e.restDecoder);yield new tt(C(r,i),l),i+=l}else if((tn&c)!==0){const l=(c&(mt|X))===0,h=new T(C(r,i),null,(c&X)===X?e.readLeftID():null,null,(c&mt)===mt?e.readRightID():null,l?e.readParentInfo()?e.readString():e.readLeftID():null,l&&(c&de)===de?e.readString():null,Ki(e,c));yield h,i+=h.length}else{const l=e.readLen();yield new Z(C(r,i),l),i+=l}}}}class fs{constructor(t,n){this.gen=Ca(t),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===tt);return this.curr}}class ds{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}const xa=e=>We(e,di,De),Ea=(e,t)=>{if(e.constructor===Z){const{client:n,clock:s}=e.id;return new Z(C(n,s+t),e.length-t)}else if(e.constructor===tt){const{client:n,clock:s}=e.id;return new tt(C(n,s+t),e.length-t)}else{const n=e,{client:s,clock:r}=n.id;return new T(C(s,r+t),null,C(s,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},We=(e,t=te,n=vt)=>{if(e.length===1)return e[0];const s=e.map(a=>new t(It(a)));let r=s.map(a=>new fs(a,!0)),i=null;const o=new n,c=new ds(o);for(;r=r.filter(f=>f.curr!==null),r.sort((f,d)=>{if(f.curr.id.client===d.curr.id.client){const g=f.curr.id.clock-d.curr.id.clock;return g===0?f.curr.constructor===d.curr.constructor?0:f.curr.constructor===tt?1:-1:g}else return d.curr.id.client-f.curr.id.client}),r.length!==0;){const a=r[0],u=a.curr.id.client;if(i!==null){let f=a.curr,d=!1;for(;f!==null&&f.id.clock+f.length<=i.struct.id.clock+i.struct.length&&f.id.client>=i.struct.id.client;)f=a.next(),d=!0;if(f===null||f.id.client!==u||d&&f.id.clock>i.struct.id.clock+i.struct.length)continue;if(u!==i.struct.id.client)kt(c,i.struct,i.offset),i={struct:f,offset:0},a.next();else if(i.struct.id.clock+i.struct.length<f.id.clock)if(i.struct.constructor===tt)i.struct.length=f.id.clock+f.length-i.struct.id.clock;else{kt(c,i.struct,i.offset);const g=f.id.clock-i.struct.id.clock-i.struct.length;i={struct:new tt(C(u,i.struct.id.clock+i.struct.length),g),offset:0}}else{const g=i.struct.id.clock+i.struct.length-f.id.clock;g>0&&(i.struct.constructor===tt?i.struct.length-=g:f=Ea(f,g)),i.struct.mergeWith(f)||(kt(c,i.struct,i.offset),i={struct:f,offset:0},a.next())}}else i={struct:a.curr,offset:0},a.next();for(let f=a.curr;f!==null&&f.id.client===u&&f.id.clock===i.struct.id.clock+i.struct.length&&f.constructor!==tt;f=a.next())kt(c,i.struct,i.offset),i={struct:f,offset:0}}i!==null&&(kt(c,i.struct,i.offset),i=null),gs(c);const l=s.map(a=>hs(a)),h=Mn(l);return re(o,h),o.toUint8Array()},Da=(e,t,n=te,s=vt)=>{const r=wi(t),i=new s,o=new ds(i),c=new n(It(e)),l=new fs(c,!1);for(;l.curr;){const a=l.curr,u=a.id.client,f=r.get(u)||0;if(l.curr.constructor===tt){l.next();continue}if(a.id.clock+a.length>f)for(kt(o,a,Ut(f-a.id.clock,0)),l.next();l.curr&&l.curr.id.client===u;)kt(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===u&&l.curr.id.clock+l.curr.length<=f;)l.next()}gs(o);const h=hs(c);return re(i,h),i.toUint8Array()},Di=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:O(e.encoder.restEncoder)}),e.encoder.restEncoder=z(),e.written=0)},kt=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Di(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),k(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},gs=e=>{Di(e);const t=e.encoder.restEncoder;k(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const s=e.clientStructs[n];k(t,s.written),en(t,s.restEncoder)}},Aa=(e,t,n,s)=>{const r=new n(It(e)),i=new fs(r,!1),o=new s,c=new ds(o);for(let h=i.curr;h!==null;h=i.next())kt(c,t(h),0);gs(c);const l=hs(r);return re(o,l),o.toUint8Array()},Ia=e=>Aa(e,Vc,te,De),nr="You must not compute changes after the event-handler fired.";class un{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Ta(this.currentTarget,this.target))}deletes(t){return Ee(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw lt(nr);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const i=n._map.get(r);let o,c;if(this.adds(i)){let l=i.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(i))if(l!==null&&this.deletes(l))o="delete",c=pn(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",c=pn(l.content.getContent())):(o="add",c=void 0)}else if(this.deletes(i))o="delete",c=pn(i.content.getContent());else return;t.set(r,{action:o,oldValue:c})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw lt(nr);const n=this.target,s=Et(),r=Et(),i=[];if(t={added:s,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const l=()=>{c&&i.push(c)};for(let h=n._start;h!==null;h=h.right)h.deleted?this.deletes(h)&&!this.adds(h)&&((c===null||c.delete===void 0)&&(l(),c={delete:0}),c.delete+=h.length,r.add(h)):this.adds(h)?((c===null||c.insert===void 0)&&(l(),c={insert:[]}),c.insert=c.insert.concat(h.content.getContent()),s.add(h)):((c===null||c.retain===void 0)&&(l(),c={retain:0}),c.retain+=h.length);c!==null&&c.retain===void 0&&l()}this._changes=t}return t}}const Ta=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let s=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(s+=r.length),r=r.right;n.unshift(s)}t=t._item.parent}return n},Y=()=>{li("Invalid access: Add Yjs type to a document before reading data.")},Ai=80;let ps=0;class Oa{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=ps++}}const La=e=>{e.timestamp=ps++},Ii=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=ps++},va=(e,t,n)=>{if(e.length>=Ai){const s=e.reduce((r,i)=>r.timestamp<i.timestamp?r:i);return Ii(s,t,n),s}else{const s=new Oa(t,n);return e.push(s),s}},fn=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((i,o)=>Ue(t-i.index)<Ue(t-o.index)?i:o);let s=e._start,r=0;for(n!==null&&(s=n.p,r=n.index,La(n));s.right!==null&&r<t;){if(!s.deleted&&s.countable){if(t<r+s.length)break;r+=s.length}s=s.right}for(;s.left!==null&&r>t;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);for(;s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);return n!==null&&Ue(n.index-r)<s.parent.length/Ai?(Ii(n,s,r),n):va(e._searchMarker,s,r)},ke=(e,t,n)=>{for(let s=e.length-1;s>=0;s--){const r=e[s];if(n>0){let i=r.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(r.index-=i.length);if(i===null||i.marker===!0){e.splice(s,1);continue}r.p=i,i.marker=!0}(t<r.index||n>0&&t===r.index)&&(r.index=Ut(t,r.index+n))}},dn=(e,t,n)=>{const s=e,r=t.changedParentTypes;for(;dt(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;_i(s._eH,n,t)};class B{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Gs(),this._dEH=Gs(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw rt()}clone(){throw rt()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){Js(this._eH,t)}observeDeep(t){Js(this._dEH,t)}unobserve(t){qs(this._eH,t)}unobserveDeep(t){qs(this._dEH,t)}toJSON(){}}const Ti=(e,t,n)=>{e.doc??Y(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let s=n-t;const r=[];let i=e._start;for(;i!==null&&s>0;){if(i.countable&&!i.deleted){const o=i.content.getContent();if(o.length<=t)t-=o.length;else{for(let c=t;c<o.length&&s>0;c++)r.push(o[c]),s--;t=0}}i=i.right}return r},Oi=e=>{e.doc??Y();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const s=n.content.getContent();for(let r=0;r<s.length;r++)t.push(s[r])}n=n.right}return t},be=(e,t)=>{let n=0,s=e._start;for(e.doc??Y();s!==null;){if(s.countable&&!s.deleted){const r=s.content.getContent();for(let i=0;i<r.length;i++)t(r[i],n++,e)}s=s.right}},Li=(e,t)=>{const n=[];return be(e,(s,r)=>{n.push(t(s,r,e))}),n},Na=e=>{let t=e._start,n=null,s=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),s=0,t=t.right}const r=n[s++];return n.length<=s&&(n=null),{done:!1,value:r}}}},vi=(e,t)=>{e.doc??Y();const n=fn(e,t);let s=e._start;for(n!==null&&(s=n.p,t-=n.index);s!==null;s=s.right)if(!s.deleted&&s.countable){if(t<s.length)return s.content.getContent()[t];t-=s.length}},Ge=(e,t,n,s)=>{let r=n;const i=e.doc,o=i.clientID,c=i.store,l=n===null?t._start:n.right;let h=[];const a=()=>{h.length>0&&(r=new T(C(o,M(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Mt(h)),r.integrate(e,0),h=[])};s.forEach(u=>{if(u===null)h.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:h.push(u);break;default:switch(a(),u.constructor){case Uint8Array:case ArrayBuffer:r=new T(C(o,M(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Ae(new Uint8Array(u))),r.integrate(e,0);break;case at:r=new T(C(o,M(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Ie(u)),r.integrate(e,0);break;default:if(u instanceof B)r=new T(C(o,M(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new gt(u)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),a()},Ni=()=>lt("Length exceeded!"),Mi=(e,t,n,s)=>{if(n>t._length)throw Ni();if(n===0)return t._searchMarker&&ke(t._searchMarker,n,s.length),Ge(e,t,null,s);const r=n,i=fn(t,n);let o=t._start;for(i!==null&&(o=i.p,n-=i.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&G(e,C(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&ke(t._searchMarker,r,s.length),Ge(e,t,o,s)},Ma=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((i,o)=>o.index>i.index?o:i,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return Ge(e,t,r,n)},Ui=(e,t,n,s)=>{if(s===0)return;const r=n,i=s,o=fn(t,n);let c=t._start;for(o!==null&&(c=o.p,n-=o.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n<c.length&&G(e,C(c.id.client,c.id.clock+n)),n-=c.length);for(;s>0&&c!==null;)c.deleted||(s<c.length&&G(e,C(c.id.client,c.id.clock+s)),c.delete(e),s-=c.length),c=c.right;if(s>0)throw Ni();t._searchMarker&&ke(t._searchMarker,r,-i+s)},Je=(e,t,n)=>{const s=t._map.get(n);s!==void 0&&s.delete(e)},ms=(e,t,n,s)=>{const r=t._map.get(n)||null,i=e.doc,o=i.clientID;let c;if(s==null)c=new Mt([s]);else switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new Mt([s]);break;case Uint8Array:c=new Ae(s);break;case at:c=new Ie(s);break;default:if(s instanceof B)c=new gt(s);else throw new Error("Unexpected content type")}new T(C(o,M(i.store,o)),r,r&&r.lastId,null,null,t,n,c).integrate(e,0)},ws=(e,t)=>{e.doc??Y();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},Ri=e=>{const t={};return e.doc??Y(),e._map.forEach((n,s)=>{n.deleted||(t[s]=n.content.getContent()[n.length-1])}),t},$i=(e,t)=>{e.doc??Y();const n=e._map.get(t);return n!==void 0&&!n.deleted},Ua=(e,t)=>{const n={};return e._map.forEach((s,r)=>{let i=s;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&Bt(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},Ne=e=>(e.doc??Y(),Kl(e._map.entries(),t=>!t[1].deleted));class Ra extends un{}class Wt extends B{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new Wt;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Wt}clone(){const t=new Wt;return t.insert(0,this.toArray().map(n=>n instanceof B?n.clone():n)),t}get length(){return this.doc??Y(),this._length}_callObserver(t,n){super._callObserver(t,n),dn(this,t,new Ra(this,t))}insert(t,n){this.doc!==null?I(this.doc,s=>{Mi(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?I(this.doc,n=>{Ma(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?I(this.doc,s=>{Ui(s,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return vi(this,t)}toArray(){return Oi(this)}slice(t=0,n=this.length){return Ti(this,t,n)}toJSON(){return this.map(t=>t instanceof B?t.toJSON():t)}map(t){return Li(this,t)}forEach(t){be(this,t)}[Symbol.iterator](){return Na(this)}_write(t){t.writeTypeRef(rh)}}const $a=e=>new Wt;class Fn extends un{constructor(t,n,s){super(t,n),this.keysChanged=s}}class H extends B{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((s,r)=>{this.set(r,s)}),this._prelimContent=null}_copy(){return new H}clone(){const t=new H;return this.forEach((n,s)=>{t.set(s,n instanceof B?n.clone():n)}),t}_callObserver(t,n){dn(this,t,new Fn(this,t,n))}toJSON(){this.doc??Y();const t={};return this._map.forEach((n,s)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[s]=r instanceof B?r.toJSON():r}}),t}get size(){return[...Ne(this)].length}keys(){return Sn(Ne(this),t=>t[0])}values(){return Sn(Ne(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return Sn(Ne(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??Y(),this._map.forEach((n,s)=>{n.deleted||t(n.content.getContent()[n.length-1],s,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?I(this.doc,n=>{Je(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?I(this.doc,s=>{ms(s,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return ws(this,t)}has(t){return $i(this,t)}clear(){this.doc!==null?I(this.doc,t=>{this.forEach(function(n,s,r){Je(t,r,s)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(ih)}}const Fa=e=>new H,St=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&jc(e,t);class jn{constructor(t,n,s,r){this.left=t,this.right=n,this.index=s,this.currentAttributes=r}forward(){this.right===null&&Q(),this.right.content.constructor===F?this.right.deleted||ie(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const sr=(e,t,n)=>{for(;t.right!==null&&n>0;)t.right.content.constructor===F?t.right.deleted||ie(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&G(e,C(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length),t.left=t.right,t.right=t.right.right;return t},Me=(e,t,n,s)=>{const r=new Map,i=s?fn(t,n):null;if(i){const o=new jn(i.p.left,i.p,i.index,r);return sr(e,o,n-i.index)}else{const o=new jn(null,t._start,0,r);return sr(e,o,n)}},Fi=(e,t,n,s)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===F&&St(s.get(n.right.content.key),n.right.content.value));)n.right.deleted||s.delete(n.right.content.key),n.forward();const r=e.doc,i=r.clientID;s.forEach((o,c)=>{const l=n.left,h=n.right,a=new T(C(i,M(r.store,i)),l,l&&l.lastId,h,h&&h.id,t,null,new F(c,o));a.integrate(e,0),n.right=a,n.forward()})},ie=(e,t)=>{const{key:n,value:s}=t;s===null?e.delete(n):e.set(n,s)},ji=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===F&&St(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},Bi=(e,t,n,s)=>{const r=e.doc,i=r.clientID,o=new Map;for(const c in s){const l=s[c],h=n.currentAttributes.get(c)??null;if(!St(h,l)){o.set(c,h);const{left:a,right:u}=n;n.right=new T(C(i,M(r.store,i)),a,a&&a.lastId,u,u&&u.id,t,null,new F(c,l)),n.right.integrate(e,0),n.forward()}}return o},Cn=(e,t,n,s,r)=>{n.currentAttributes.forEach((f,d)=>{r[d]===void 0&&(r[d]=null)});const i=e.doc,o=i.clientID;ji(n,r);const c=Bi(e,t,n,r),l=s.constructor===String?new ft(s):s instanceof B?new gt(s):new Rt(s);let{left:h,right:a,index:u}=n;t._searchMarker&&ke(t._searchMarker,n.index,l.getLength()),a=new T(C(o,M(i.store,o)),h,h&&h.lastId,a,a&&a.id,t,null,l),a.integrate(e,0),n.right=a,n.index=u,n.forward(),Fi(e,t,n,c)},rr=(e,t,n,s,r)=>{const i=e.doc,o=i.clientID;ji(n,r);const c=Bi(e,t,n,r);t:for(;n.right!==null&&(s>0||c.size>0&&(n.right.deleted||n.right.content.constructor===F));){if(!n.right.deleted)switch(n.right.content.constructor){case F:{const{key:l,value:h}=n.right.content,a=r[l];if(a!==void 0){if(St(a,h))c.delete(l);else{if(s===0)break t;c.set(l,h)}n.right.delete(e)}else n.currentAttributes.set(l,h);break}default:s<n.right.length&&G(e,C(n.right.id.client,n.right.id.clock+s)),s-=n.right.length;break}n.forward()}if(s>0){let l="";for(;s>0;s--)l+=`
4
- `;n.right=new T(C(o,M(i.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new ft(l)),n.right.integrate(e,0),n.forward()}Fi(e,t,n,c)},Vi=(e,t,n,s,r)=>{let i=t;const o=J();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===F){const h=i.content;o.set(h.key,h)}i=i.right}let c=0,l=!1;for(;t!==i;){if(n===t&&(l=!0),!t.deleted){const h=t.content;if(h.constructor===F){const{key:a,value:u}=h,f=s.get(a)??null;(o.get(a)!==h||f===u)&&(t.delete(e),c++,!l&&(r.get(a)??null)===u&&f!==u&&(f===null?r.delete(a):r.set(a,f))),!l&&!t.deleted&&ie(r,h)}}t=t.right}return c},ja=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===F){const s=t.content.key;n.has(s)?t.delete(e):n.add(s)}t=t.left}},Ba=e=>{let t=0;return I(e.doc,n=>{let s=e._start,r=e._start,i=J();const o=In(i);for(;r;)r.deleted===!1&&(r.content.constructor===F?ie(o,r.content):(t+=Vi(n,s,r,i,o),i=In(o),s=r)),r=r.right}),t},Va=e=>{const t=new Set,n=e.doc;for(const[s,r]of e.afterState.entries()){const i=e.beforeState.get(s)||0;r!==i&&Ci(e,n.store.clients.get(s),i,r,o=>{!o.deleted&&o.content.constructor===F&&o.constructor!==Z&&t.add(o.parent)})}I(n,s=>{Zt(e,e.deleteSet,r=>{if(r instanceof Z||!r.parent._hasFormatting||t.has(r.parent))return;const i=r.parent;r.content.constructor===F?t.add(i):ja(s,r)});for(const r of t)Ba(r)})},ir=(e,t,n)=>{const s=n,r=In(t.currentAttributes),i=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case gt:case Rt:case ft:n<t.right.length&&G(e,C(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&Vi(e,i,t.right,r,t.currentAttributes);const o=(t.left||t.right).parent;return o._searchMarker&&ke(o._searchMarker,t.index,-s+n),t};class Pi extends un{constructor(t,n,s){super(t,n),this.childListChanged=!1,this.keysChanged=new Set,s.forEach(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];I(t,s=>{const r=new Map,i=new Map;let o=this.target._start,c=null;const l={};let h="",a=0,u=0;const f=()=>{if(c!==null){let d=null;switch(c){case"delete":u>0&&(d={delete:u}),u=0;break;case"insert":(typeof h=="object"||h.length>0)&&(d={insert:h},r.size>0&&(d.attributes={},r.forEach((g,p)=>{g!==null&&(d.attributes[p]=g)}))),h="";break;case"retain":a>0&&(d={retain:a},Fc(l)||(d.attributes=Mc({},l))),a=0;break}d&&n.push(d),c=null}};for(;o!==null;){switch(o.content.constructor){case gt:case Rt:this.adds(o)?this.deletes(o)||(f(),c="insert",h=o.content.getContent()[0],f()):this.deletes(o)?(c!=="delete"&&(f(),c="delete"),u+=1):o.deleted||(c!=="retain"&&(f(),c="retain"),a+=1);break;case ft:this.adds(o)?this.deletes(o)||(c!=="insert"&&(f(),c="insert"),h+=o.content.str):this.deletes(o)?(c!=="delete"&&(f(),c="delete"),u+=o.length):o.deleted||(c!=="retain"&&(f(),c="retain"),a+=o.length);break;case F:{const{key:d,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const p=r.get(d)??null;St(p,g)?g!==null&&o.delete(s):(c==="retain"&&f(),St(g,i.get(d)??null)?delete l[d]:l[d]=g)}}else if(this.deletes(o)){i.set(d,g);const p=r.get(d)??null;St(p,g)||(c==="retain"&&f(),l[d]=p)}else if(!o.deleted){i.set(d,g);const p=l[d];p!==void 0&&(St(p,g)?p!==null&&o.delete(s):(c==="retain"&&f(),g===null?delete l[d]:l[d]=g))}o.deleted||(c==="insert"&&f(),ie(r,o.content));break}}o=o.right}for(f();n.length>0;){const d=n[n.length-1];if(d.retain!==void 0&&d.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class ee extends B{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Y(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(s=>s())}catch(s){console.error(s)}this._pending=null}_copy(){return new ee}clone(){const t=new ee;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const s=new Pi(this,t,n);dn(this,t,s),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??Y();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===ft&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?I(this.doc,s=>{const r=new jn(null,this._start,0,new Map);for(let i=0;i<t.length;i++){const o=t[i];if(o.insert!==void 0){const c=!n&&typeof o.insert=="string"&&i===t.length-1&&r.right===null&&o.insert.slice(-1)===`
5
- `?o.insert.slice(0,-1):o.insert;(typeof c!="string"||c.length>0)&&Cn(s,this,r,c,o.attributes||{})}else o.retain!==void 0?rr(s,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&ir(s,r,o.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,s){this.doc??Y();const r=[],i=new Map,o=this.doc;let c="",l=this._start;function h(){if(c.length>0){const u={};let f=!1;i.forEach((g,p)=>{f=!0,u[p]=g});const d={insert:c};f&&(d.attributes=u),r.push(d),c=""}}const a=()=>{for(;l!==null;){if(Bt(l,t)||n!==void 0&&Bt(l,n))switch(l.content.constructor){case ft:{const u=i.get("ychange");t!==void 0&&!Bt(l,t)?(u===void 0||u.user!==l.id.client||u.type!=="removed")&&(h(),i.set("ychange",s?s("removed",l.id):{type:"removed"})):n!==void 0&&!Bt(l,n)?(u===void 0||u.user!==l.id.client||u.type!=="added")&&(h(),i.set("ychange",s?s("added",l.id):{type:"added"})):u!==void 0&&(h(),i.delete("ychange")),c+=l.content.str;break}case gt:case Rt:{h();const u={insert:l.content.getContent()[0]};if(i.size>0){const f={};u.attributes=f,i.forEach((d,g)=>{f[g]=d})}r.push(u);break}case F:Bt(l,t)&&(h(),ie(i,l.content));break}l=l.right}h()};return t||n?I(o,u=>{t&&Rn(u,t),n&&Rn(u,n),a()},"cleanup"):a(),r}insert(t,n,s){if(n.length<=0)return;const r=this.doc;r!==null?I(r,i=>{const o=Me(i,this,t,!s);s||(s={},o.currentAttributes.forEach((c,l)=>{s[l]=c})),Cn(i,this,o,n,s)}):this._pending.push(()=>this.insert(t,n,s))}insertEmbed(t,n,s){const r=this.doc;r!==null?I(r,i=>{const o=Me(i,this,t,!s);Cn(i,this,o,n,s||{})}):this._pending.push(()=>this.insertEmbed(t,n,s||{}))}delete(t,n){if(n===0)return;const s=this.doc;s!==null?I(s,r=>{ir(r,Me(r,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,s){if(n===0)return;const r=this.doc;r!==null?I(r,i=>{const o=Me(i,this,t,!1);o.right!==null&&rr(i,this,o,n,s)}):this._pending.push(()=>this.format(t,n,s))}removeAttribute(t){this.doc!==null?I(this.doc,n=>{Je(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?I(this.doc,s=>{ms(s,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return ws(this,t)}getAttributes(){return Ri(this)}_write(t){t.writeTypeRef(oh)}}const Pa=e=>new ee;class xn{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??Y()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===nt||n.constructor===Nt)&&n._start!==null)t=n._start;else for(;t!==null;){const s=t.next;if(s!==null){t=s;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class Nt extends B{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Nt}clone(){const t=new Nt;return t.insert(0,this.toArray().map(n=>n instanceof B?n.clone():n)),t}get length(){return this.doc??Y(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new xn(this,t)}querySelector(t){t=t.toUpperCase();const s=new xn(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return s.done?null:s.value}querySelectorAll(t){return t=t.toUpperCase(),yt(new xn(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){dn(this,t,new zi(this,n,t))}toString(){return Li(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},s){const r=t.createDocumentFragment();return s!==void 0&&s._createAssociation(r,this),be(this,i=>{r.insertBefore(i.toDOM(t,n,s),null)}),r}insert(t,n){this.doc!==null?I(this.doc,s=>{Mi(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)I(this.doc,s=>{const r=t&&t instanceof B?t._item:t;Ge(s,this,r,n)});else{const s=this._prelimContent,r=t===null?0:s.findIndex(i=>i===t)+1;if(r===0&&t!==null)throw lt("Reference item not found");s.splice(r,0,...n)}}delete(t,n=1){this.doc!==null?I(this.doc,s=>{Ui(s,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return Oi(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return vi(this,t)}slice(t=0,n=this.length){return Ti(this,t,n)}forEach(t){be(this,t)}_write(t){t.writeTypeRef(lh)}}const za=e=>new Nt;class nt extends Nt{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((s,r)=>{this.setAttribute(r,s)}),this._prelimAttrs=null}_copy(){return new nt(this.nodeName)}clone(){const t=new nt(this.nodeName),n=this.getAttributes();return Rc(n,(s,r)=>{t.setAttribute(r,s)}),t.insert(0,this.toArray().map(s=>s instanceof B?s.clone():s)),t}toString(){const t=this.getAttributes(),n=[],s=[];for(const c in t)s.push(c);s.sort();const r=s.length;for(let c=0;c<r;c++){const l=s[c];n.push(l+'="'+t[l]+'"')}const i=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${i}${o}>${super.toString()}</${i}>`}removeAttribute(t){this.doc!==null?I(this.doc,n=>{Je(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?I(this.doc,s=>{ms(s,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return ws(this,t)}hasAttribute(t){return $i(this,t)}getAttributes(t){return t?Ua(this,t):Ri(this)}toDOM(t=document,n={},s){const r=t.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const c=i[o];typeof c=="string"&&r.setAttribute(o,c)}return be(this,o=>{r.appendChild(o.toDOM(t,n,s))}),s!==void 0&&s._createAssociation(r,this),r}_write(t){t.writeTypeRef(ch),t.writeKey(this.nodeName)}}const Ya=e=>new nt(e.readKey());class zi extends un{constructor(t,n,s){super(t,s),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class qe extends H{constructor(t){super(),this.hookName=t}_copy(){return new qe(this.hookName)}clone(){const t=new qe(this.hookName);return this.forEach((n,s)=>{t.set(s,n)}),t}toDOM(t=document,n={},s){const r=n[this.hookName];let i;return r!==void 0?i=r.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),s!==void 0&&s._createAssociation(i,this),i}_write(t){t.writeTypeRef(ah),t.writeKey(this.hookName)}}const Ha=e=>new qe(e.readKey());class ut extends ee{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new ut}clone(){const t=new ut;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,s){const r=t.createTextNode(this.toString());return s!==void 0&&s._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const n=[];for(const r in t.attributes){const i=[];for(const o in t.attributes[r])i.push({key:o,value:t.attributes[r][o]});i.sort((o,c)=>o.key<c.key?-1:1),n.push({nodeName:r,attrs:i})}n.sort((r,i)=>r.nodeName<i.nodeName?-1:1);let s="";for(let r=0;r<n.length;r++){const i=n[r];s+=`<${i.nodeName}`;for(let o=0;o<i.attrs.length;o++){const c=i.attrs[o];s+=` ${c.key}="${c.value}"`}s+=">"}s+=t.insert;for(let r=n.length-1;r>=0;r--)s+=`</${n[r].nodeName}>`;return s}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(hh)}}const Ka=e=>new ut;class ys{constructor(t,n){this.id=t,this.length=n}get deleted(){throw rt()}mergeWith(t){return!1}write(t,n,s){throw rt()}integrate(t,n){throw rt()}}const Wa=0;class Z extends ys{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),Si(t.doc.store,this)}write(t,n){t.writeInfo(Wa),t.writeLen(this.length-n)}getMissing(t,n){return null}}class Ae{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Ae(this.content)}splice(t){throw rt()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const Ga=e=>new Ae(e.readBuf());class Se{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Se(this.len)}splice(t){const n=new Se(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){_e(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const Ja=e=>new Se(e.readLen()),Yi=(e,t)=>new at({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Ie{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ie(Yi(this.doc.guid,this.opts))}splice(t){throw rt()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const qa=e=>new Ie(Yi(e.readString(),e.readAny()));class Rt{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Rt(this.embed)}splice(t){throw rt()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const Xa=e=>new Rt(e.readJSON());class F{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new F(this.key,this.value)}splice(t){throw rt()}mergeWith(t){return!1}integrate(t,n){const s=n.parent;s._searchMarker=null,s._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const Qa=e=>new F(e.readKey(),e.readJSON());class Xe{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Xe(this.arr)}splice(t){const n=new Xe(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeString(i===void 0?"undefined":JSON.stringify(i))}}getRef(){return 2}}const Za=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++){const r=e.readString();r==="undefined"?n.push(void 0):n.push(JSON.parse(r))}return new Xe(n)},th=ze("node_env")==="development";class Mt{constructor(t){this.arr=t,th&&$r(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Mt(this.arr)}splice(t){const n=new Mt(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeAny(i)}}getRef(){return 8}}const eh=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++)n.push(e.readAny());return new Mt(n)};class ft{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new ft(this.str)}splice(t){const n=new ft(this.str.slice(t));this.str=this.str.slice(0,t);const s=this.str.charCodeAt(t-1);return s>=55296&&s<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const nh=e=>new ft(e.readString()),sh=[$a,Fa,Pa,Ya,za,Ha,Ka],rh=0,ih=1,oh=2,ch=3,lh=4,ah=5,hh=6;class gt{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new gt(this.type._copy())}splice(t){throw rt()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(s=>{s.deleted?s.id.clock<(t.beforeState.get(s.id.client)||0)&&t._mergeStructs.push(s):s.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(s=>{for(;s!==null;)s.gc(t,!0),s=s.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const uh=e=>new gt(sh[e.readTypeRef()](e)),Bn=(e,t)=>{let n=t,s=0,r;do s>0&&(n=C(n.client,n.clock+s)),r=Kt(e,n),s=n.clock-r.id.clock,n=r.redone;while(n!==null&&r instanceof T);return{item:r,diff:s}},_s=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},Qe=(e,t,n)=>{const{client:s,clock:r}=t.id,i=new T(C(s,r+n),t,C(s,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),t.redone!==null&&(i.redone=C(t.redone.client,t.redone.clock+n)),t.right=i,i.right!==null&&(i.right.left=i),e._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),t.length=n,i},or=(e,t)=>Hn(e,n=>Ee(n.deletions,t)),Hi=(e,t,n,s,r,i)=>{const o=e.doc,c=o.store,l=o.clientID,h=t.redone;if(h!==null)return G(e,h);let a=t.parent._item,u=null,f;if(a!==null&&a.deleted===!0){if(a.redone===null&&(!n.has(a)||Hi(e,a,n,s,r,i)===null))return null;for(;a.redone!==null;)a=G(e,a.redone)}const d=a===null?t.parent:a.content.type;if(t.parentSub===null){for(u=t.left,f=t;u!==null;){let w=u;for(;w!==null&&w.parent._item!==a;)w=w.redone===null?null:G(e,w.redone);if(w!==null&&w.parent._item===a){u=w;break}u=u.left}for(;f!==null;){let w=f;for(;w!==null&&w.parent._item!==a;)w=w.redone===null?null:G(e,w.redone);if(w!==null&&w.parent._item===a){f=w;break}f=f.right}}else if(f=null,t.right&&!r){for(u=t;u!==null&&u.right!==null&&(u.right.redone||Ee(s,u.right.id)||or(i.undoStack,u.right.id)||or(i.redoStack,u.right.id));)for(u=u.right;u.redone;)u=G(e,u.redone);if(u&&u.right!==null)return null}else u=d._map.get(t.parentSub)||null;const g=M(c,l),p=C(l,g),m=new T(p,u,u&&u.lastId,f,f&&f.id,d,t.parentSub,t.content.copy());return t.redone=p,_s(m,!0),m.integrate(e,0),m};class T extends ys{constructor(t,n,s,r,i,o,c,l){super(t,l.getLength()),this.origin=s,this.left=n,this.right=r,this.rightOrigin=i,this.parent=o,this.parentSub=c,this.redone=null,this.content=l,this.info=this.content.isCountable()?Us:0}set marker(t){(this.info&wn)>0!==t&&(this.info^=wn)}get marker(){return(this.info&wn)>0}get keep(){return(this.info&Ms)>0}set keep(t){this.keep!==t&&(this.info^=Ms)}get countable(){return(this.info&Us)>0}get deleted(){return(this.info&mn)>0}set deleted(t){this.deleted!==t&&(this.info^=mn)}markDeleted(){this.info|=mn}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=M(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=M(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Ht&&this.id.client!==this.parent.client&&this.parent.clock>=M(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Xs(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=G(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Z||this.right&&this.right.constructor===Z)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===T?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===T&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Ht){const s=Kt(n,this.parent);s.constructor===Z?this.parent=null:this.parent=s.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=Xs(t,t.doc.store,C(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let s=this.left,r;if(s!==null)r=s.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const i=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),i.add(r),Pt(this.origin,r.origin)){if(r.id.client<this.id.client)s=r,i.clear();else if(Pt(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(Kt(t.doc.store,r.origin)))i.has(Kt(t.doc.store,r.origin))||(s=r,i.clear());else break;r=r.right}this.left=s}if(this.left!==null){const s=this.left.right;this.right=s,this.left.right=this}else{let s;if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start,this.parent._start=this;this.right=s}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Si(t.doc.store,this),this.content.integrate(t,this),Zs(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new Z(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:C(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&Pt(t.origin,this.lastId)&&this.right===t&&Pt(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const n=this.parent._searchMarker;return n&&n.forEach(s=>{s.p===t&&(s.p=this,!this.deleted&&this.countable&&(s.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),_e(t.deleteSet,this.id.client,this.id.clock,this.length),Zs(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw Q();this.content.gc(t),n?ya(t,this,new Z(this.id,this.length)):this.content=new Se(this.length)}write(t,n){const s=n>0?C(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&tn|(s===null?0:X)|(r===null?0:mt)|(i===null?0:de);if(t.writeInfo(o),s!==null&&t.writeLeftID(s),r!==null&&t.writeRightID(r),s===null&&r===null){const c=this.parent;if(c._item!==void 0){const l=c._item;if(l===null){const h=ki(c);t.writeParentInfo(!0),t.writeString(h)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else c.constructor===String?(t.writeParentInfo(!0),t.writeString(c)):c.constructor===Ht?(t.writeParentInfo(!1),t.writeLeftID(c)):Q();i!==null&&t.writeString(i)}this.content.write(t,n)}}const Ki=(e,t)=>fh[t&tn](e),fh=[()=>{Q()},Ja,Za,Ga,nh,Xa,Qa,uh,eh,qa,()=>{Q()}],dh=10;class tt extends ys{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){Q()}write(t,n){t.writeInfo(dh),k(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const Wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},Gi="__ $YJS$ __";Wi[Gi]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Wi[Gi]=!0;function gh(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function En(e,t){const n=[];let s=e.__first;for(;s!==null;){const r=t===null?wt(s):t.get(s);r==null&&gh(174),n.push(s),s=r.__next}return n}function N(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ph(e,t,n){const s=e.length,r=t.length;let i=0,o=0;for(;i<s&&i<r&&e[i]===t[i]&&i<n;)i++;for(;o+i<s&&o+i<r&&e[s-o-1]===t[r-o-1];)o++;for(;o+i<s&&o+i<r&&e[i]===t[i];)i++;return{index:i,insert:t.slice(i,r-o),remove:s-i-o}}let bt=class{_xmlElem;_key;_parent;_type;constructor(t,n,s){this._key="",this._xmlElem=t,this._parent=n,this._type=s}getPrevNode(t){if(t===null)return null;const n=t.get(this._key);return Be(n)?n:null}getNode(){const t=wt(this._key);return Be(t)?t:null}getSharedType(){return this._xmlElem}getType(){return this._type}getKey(){return this._key}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}syncPropertiesFromLexical(t,n,s){const r=this.getPrevNode(s);Cs(t,this._xmlElem,r,n)}syncPropertiesFromYjs(t,n){const s=this.getNode();s===null&&N(83),Ss(t,this._xmlElem,s,n)}destroy(t){const n=t.collabNodeMap;n.get(this._key)===this&&n.delete(this._key)}};function Ji(e,t,n){const s=new bt(e,t,n);return e._collabNode=s,s}class le{_map;_key;_parent;_type;constructor(t,n){this._key="",this._map=t,this._parent=n,this._type="linebreak"}getNode(){const t=wt(this._key);return zn(t)?t:null}getKey(){return this._key}getSharedType(){return this._map}getType(){return this._type}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}destroy(t){const n=t.collabNodeMap;n.get(this._key)===this&&n.delete(this._key)}}function qi(e,t){const n=new le(e,t);return e._collabNode=n,n}class K{_map;_key;_parent;_text;_type;_normalized;constructor(t,n,s,r){this._key="",this._map=t,this._parent=s,this._text=n,this._type=r,this._normalized=!1}getPrevNode(t){if(t===null)return null;const n=t.get(this._key);return $(n)?n:null}getNode(){const t=wt(this._key);return $(t)?t:null}getSharedType(){return this._map}getType(){return this._type}getKey(){return this._key}getSize(){return this._text.length+(this._normalized?0:1)}getOffset(){return this._parent.getChildOffset(this)}spliceText(t,n,s){const r=this._parent._xmlText,i=this.getOffset()+1+t;n!==0&&r.delete(i,n),s!==""&&r.insert(i,s)}syncPropertiesAndTextFromLexical(t,n,s){const r=this.getPrevNode(s),i=n.__text;if(Cs(t,this._map,r,n),r!==null){const o=r.__text;o!==i&&((function(c,l,h,a){const u=Jt();let f=a.length;if(ue(u)&&u.isCollapsed()){const g=u.anchor;g.key===l&&(f=g.offset)}const d=ph(h,a,f);c.spliceText(d.index,d.remove,d.insert)})(this,n.__key,o,i),this._text=i)}}syncPropertiesAndTextFromYjs(t,n){const s=this.getNode();s===null&&N(84),Ss(t,this._map,s,n);const r=this._text;s.__text!==r&&s.setTextContent(r)}destroy(t){const n=t.collabNodeMap;n.get(this._key)===this&&n.delete(this._key)}}function Xi(e,t,n,s){const r=new K(e,t,n,s);return e._collabNode=r,r}class et{_key;_children;_xmlText;_type;_parent;constructor(t,n,s){this._key="",this._children=[],this._xmlText=t,this._type=s,this._parent=n}getPrevNode(t){if(t===null)return null;const n=t.get(this._key);return ct(n)?n:null}getNode(){const t=wt(this._key);return ct(t)?t:null}getSharedType(){return this._xmlText}getType(){return this._type}getKey(){return this._key}isEmpty(){return this._children.length===0}getSize(){return 1}getOffset(){const t=this._parent;return t===null&&N(90),t.getChildOffset(this)}syncPropertiesFromYjs(t,n){const s=this.getNode();s===null&&N(91),Ss(t,this._xmlText,s,n)}applyChildrenYjsDelta(t,n){const s=this._children;let r=0,i=null;for(let o=0;o<n.length;o++){const c=n[o],l=c.insert,h=c.delete;if(c.retain!=null)r+=c.retain;else if(typeof h=="number"){let a=h;for(;a>0;){const{node:u,nodeIndex:f,offset:d,length:g}=je(this,r,!1);if(u instanceof et||u instanceof le||u instanceof bt)s.splice(f,1),a-=1;else{if(!(u instanceof K))break;{const p=Math.min(a,g),m=f!==0?s[f-1]:null,w=u.getSize();if(d===0&&g===w){s.splice(f,1);const _=ce(u._text,d,p-1,"");_.length>0&&(m instanceof K?m._text+=_:this._xmlText.delete(d,_.length))}else u._text=ce(u._text,d,p,"");a-=p}}}}else{if(l==null)throw new Error("Unexpected delta format");if(typeof l=="string"){const{node:a,offset:u}=je(this,r,!0);a instanceof K?a._text=ce(a._text,u,0,l):this._xmlText.delete(u,l.length),r+=l.length}else{const a=l,{node:u,nodeIndex:f,length:d}=je(this,r,!1),g=Ze(t,a,this);if(u instanceof K&&d>0&&d<u._text.length){const p=u._text,m=p.length-d;u._text=ce(p,m,d,""),s.splice(f+1,0,g),i=ce(p,0,m,"")}else s.splice(f,0,g);i!==null&&g instanceof K&&(g._text=i+g._text,i=null),r+=1}}}}syncChildrenFromYjs(t){const n=this.getNode();n===null&&N(92);const s=n.__key,r=En(n,null),i=r.length,o=this._children,c=o.length,l=t.collabNodeMap,h=new Set;let a,u,f=0,d=null;c!==i&&(u=n.getWritable());for(let g=0;g<c;g++){const p=r[f],m=o[g],w=m.getNode(),_=m._key;if(w!==null&&p===_){const y=$(w);if(h.add(p),y)if(m._key=p,m instanceof et){const x=m._xmlText;m.syncPropertiesFromYjs(t,null),m.applyChildrenYjsDelta(t,x.toDelta()),m.syncChildrenFromYjs(t)}else m instanceof K?m.syncPropertiesAndTextFromYjs(t,null):m instanceof bt?m.syncPropertiesFromYjs(t,null):m instanceof le||N(93);d=w,f++}else{if(a===void 0){a=new Set;for(let D=0;D<c;D++){const S=o[D]._key;S!==""&&a.add(S)}}if(w!==null&&p!==void 0&&!a.has(p)){const D=oe(p);Os(D),g--,f++;continue}u=n.getWritable();const y=Ch(t,m,s),x=y.__key;if(l.set(x,m),d===null){const D=u.getFirstChild();if(u.__first=x,D!==null){const S=D.getWritable();S.__prev=x,y.__next=S.__key}}else{const D=d.getWritable(),S=d.getNextSibling();if(D.__next=x,y.__prev=d.__key,S!==null){const E=S.getWritable();E.__prev=x,y.__next=E.__key}}g===c-1&&(u.__last=x),u.__size++,d=y}}for(let g=0;g<i;g++){const p=r[g];if(!h.has(p)){const m=oe(p),w=t.collabNodeMap.get(p);w!==void 0&&w.destroy(t),Os(m)}}}syncPropertiesFromLexical(t,n,s){Cs(t,this._xmlText,this.getPrevNode(s),n)}_syncChildFromLexical(t,n,s,r,i,o){const c=this._children[n],l=oe(s);c instanceof et&&ct(l)?(c.syncPropertiesFromLexical(t,l,r),c.syncChildrenFromLexical(t,l,r,i,o)):c instanceof K&&$(l)?c.syncPropertiesAndTextFromLexical(t,l,r):c instanceof bt&&Be(l)&&c.syncPropertiesFromLexical(t,l,r)}syncChildrenFromLexical(t,n,s,r,i){const o=this.getPrevNode(s),c=o===null?[]:En(o,s),l=En(n,null),h=c.length-1,a=l.length-1,u=t.collabNodeMap;let f,d,g=0,p=0;for(;g<=h&&p<=a;){const _=c[g],y=l[p];if(_===y)this._syncChildFromLexical(t,p,y,s,r,i),g++,p++;else{f===void 0&&(f=new Set(c)),d===void 0&&(d=new Set(l));const x=d.has(_),D=f.has(y);if(x){const S=cr(t,oe(y),this);u.set(y,S),D?(this.splice(t,p,1,S),g++,p++):(this.splice(t,p,0,S),p++)}else this.splice(t,p,1),g++}}const m=g>h,w=p>a;if(m&&!w)for(;p<=a;++p){const _=l[p],y=cr(t,oe(_),this);this.append(y),u.set(_,y)}else if(w&&!m)for(let _=this._children.length-1;_>=p;_--)this.splice(t,_,1)}append(t){const n=this._xmlText,s=this._children,r=s[s.length-1],i=r!==void 0?r.getOffset()+r.getSize():0;if(t instanceof et)n.insertEmbed(i,t._xmlText);else if(t instanceof K){const o=t._map;o.parent===null&&n.insertEmbed(i,o),n.insert(i+1,t._text)}else t instanceof le?n.insertEmbed(i,t._map):t instanceof bt&&n.insertEmbed(i,t._xmlElem);this._children.push(t)}splice(t,n,s,r){const i=this._children,o=i[n];if(o===void 0)return r===void 0&&N(94),void this.append(r);const c=o.getOffset();c===-1&&N(95);const l=this._xmlText;if(s!==0&&l.delete(c,o.getSize()),r instanceof et)l.insertEmbed(c,r._xmlText);else if(r instanceof K){const h=r._map;h.parent===null&&l.insertEmbed(c,h),l.insert(c+1,r._text)}else r instanceof le?l.insertEmbed(c,r._map):r instanceof bt&&l.insertEmbed(c,r._xmlElem);if(s!==0){const h=i.slice(n,n+s);for(let a=0;a<h.length;a++)h[a].destroy(t)}r!==void 0?i.splice(n,s,r):i.splice(n,s)}getChildOffset(t){let n=0;const s=this._children;for(let r=0;r<s.length;r++){const i=s[r];if(i===t)return n;n+=i.getSize()}return-1}destroy(t){const n=t.collabNodeMap,s=this._children;for(let r=0;r<s.length;r++)s[r].destroy(t);n.get(this._key)===this&&n.delete(this._key)}}function ks(e,t,n){const s=new et(e,t,n);return e._collabNode=s,s}function mh(e,t,n,s,r){n==null&&N(81);const i={clientID:n.clientID,cursors:new Map,cursorsContainer:null,doc:n,docMap:s,editor:e,excludedProperties:r||new Map,id:t,nodeProperties:new Map};return(function(o){const{editor:c,nodeProperties:l}=o;c.update(()=>{c._nodes.forEach(h=>{const a=new h.klass,u={};for(const[f,d]of Object.entries(a))Qi(f,a,o)||(u[f]=d);l.set(a.__type,Object.freeze(u))})})})(i),i}function wh(e,t,n,s,r,i){s==null&&N(81);const o=ks(s.get("root",ut),null,"root");return o._key="root",{...mh(e,n,s,r,i),collabNodeMap:new Map,root:o}}function bs(e){return Object.hasOwn(e,"collabNodeMap")}const yh=new Set(["__key","__parent","__next","__prev","__state"]),_h=new Set(["__first","__last","__size"]),kh=new Set(["__cachedText"]),bh=new Set(["__text"]);function Qi(e,t,n){if(yh.has(e)||typeof t[e]=="function")return!0;if($(t)){if(bh.has(e))return!0}else if(ct(t)&&(_h.has(e)||po(t)&&kh.has(e)))return!0;const s=t.constructor,r=n.excludedProperties.get(s);return r!=null&&r.has(e)}function Sh(e,t){const n=e.__type,{nodeProperties:s}=t,r=s.get(n);return r===void 0&&N(330,n),r}function cr(e,t,n){const s=t.__type;let r;if(ct(t))r=ks(new ut,n,s),r.syncPropertiesFromLexical(e,t,null),r.syncChildrenFromLexical(e,t,null,null,null);else if($(t))r=Xi(new H,t.__text,n,s),r.syncPropertiesAndTextFromLexical(e,t,null);else if(zn(t)){const i=new H;i.set("__type","linebreak"),r=qi(i,n)}else Be(t)?(r=Ji(new nt,n,s),r.syncPropertiesFromLexical(e,t,null)):N(86);return r._key=t.__key,r}function Zi(e){const t=gn(e,"__type");return typeof t!="string"&&t!==void 0&&N(87),t}function Ze(e,t,n){const s=t._collabNode;if(s===void 0){const r=e.editor._nodes,i=Zi(t);typeof i!="string"&&N(87),r.get(i)===void 0&&N(88,i);const o=t.parent,c=n===void 0&&o!==null?Ze(e,o):n||null;if(c instanceof et||N(89),t instanceof ut)return ks(t,c,i);if(t instanceof H)return i==="linebreak"?qi(t,c):Xi(t,"",c,i);if(t instanceof nt)return Ji(t,c,i)}return s}function Ch(e,t,n){const s=t.getType(),r=e.editor._nodes.get(s);r===void 0&&N(88,s);const i=new r.klass;if(i.__parent=n,t._key=i.__key,t instanceof et){const o=t._xmlText;t.syncPropertiesFromYjs(e,null),t.applyChildrenYjsDelta(e,o.toDelta()),t.syncChildrenFromYjs(e)}else t instanceof K?t.syncPropertiesAndTextFromYjs(e,null):t instanceof bt&&t.syncPropertiesFromYjs(e,null);return e.collabNodeMap.set(i.__key,t),i}function Ss(e,t,n,s){const r=s===null?t instanceof H?Array.from(t.keys()):t instanceof ut||t instanceof nt?Object.keys(t.getAttributes()):Object.keys(t):Array.from(s);let i;for(let o=0;o<r.length;o++){const c=r[o];if(Qi(c,n,e)){c==="__state"&&bs(e)&&(i||(i=n.getWritable()),xh(t,i));continue}const l=n[c];let h=gn(t,c);if(l!==h){if(h instanceof at){const a=e.docMap;l instanceof at&&a.delete(l.guid);const u=yo(),f=h.guid;u._key=f,a.set(f,h),h=u}i===void 0&&(i=n.getWritable()),i[c]=h}}}function gn(e,t){return e instanceof H?e.get(t):e instanceof ut||e instanceof nt?e.getAttribute(t):e[t]}function lr(e,t,n){e instanceof H?e.set(t,n):e.setAttribute(t,n)}function xh(e,t){const n=gn(e,"__state");n instanceof H&&xr(t).updateFromJSON(n.toJSON())}function Cs(e,t,n,s){const r=Object.keys(Sh(s,e)),i=e.editor.constructor;(function(o,c,l,h){const a=h.__state,u=gn(c,"__state");if(!a)return;const[f,d]=a.getInternalState(),g=l&&l.__state,p=u instanceof H?u:new H;if(g===a)return;const[m,w]=g&&p.doc?g.getInternalState():[void 0,new Map];if(f)for(const[_,y]of Object.entries(f))m&&y!==m[_]&&p.set(_,y);for(const[_,y]of d)w.get(_)!==y&&p.set(_.key,_.unparse(y));u||lr(c,"__state",p)})(0,t,n,s);for(let o=0;o<r.length;o++){const c=r[o],l=n===null?void 0:n[c];let h=s[c];if(l!==h){if(h instanceof i){const a=e.docMap;let u;if(l instanceof i){const g=l._key;u=a.get(g),a.delete(g)}const f=u||new at,d=f.guid;h._key=d,a.set(d,f),h=f,e.editor.update(()=>{s.markDirty()})}lr(t,c,h)}}}function ce(e,t,n,s){return e.slice(0,t)+s+e.slice(t+n)}function je(e,t,n){let s=0,r=0;const i=e._children,o=i.length;for(;r<o;r++){const c=i[r],l=s;if(s+=c.getSize(),(n?s>=t:s>t)&&c instanceof K){let h=t-l-1;return h<0&&(h=0),{length:s-t,node:c,nodeIndex:r,offset:h}}if(s>t)return{length:0,node:c,nodeIndex:r,offset:l};if(r===o-1)return{length:0,node:null,nodeIndex:r+1,offset:l+1}}return{length:0,node:null,nodeIndex:0,offset:0}}function ar(e){const t=e.anchor,n=e.focus;let s=!1;try{const r=t.getNode(),i=n.getNode();(!r.isAttached()||!i.isAttached()||$(r)&&t.offset>r.getTextContentSize()||$(i)&&n.offset>i.getTextContentSize())&&(s=!0)}catch{s=!0}return s}function Eh(e,t){e.doc.transact(t,e)}function to(e,t){const n=t._nodeMap.get(e);if(!n)return void xt().selectStart();const s=n.__prev;let r=null;s&&(r=wt(s)),r===null&&n.__parent!==null&&(r=wt(n.__parent)),r!==null?r!==null&&r.isAttached()?r.selectEnd():to(r.__key,t):xt().selectStart()}ko("ychange",{isEqual:(e,t)=>e===t,parse:e=>e??null});function hr(e,t){const n=t.collabNodeMap.get(e.key);if(n===void 0)return null;let s=e.offset,r=n.getSharedType();if(n instanceof K){r=n._parent._xmlText;const i=n.getOffset();if(i===-1)return null;s=i+1+s}else if(n instanceof et&&e.type==="element"){const i=e.getNode();ct(i)||N(184);let o=0,c=0,l=i.getFirstChild();for(;l!==null&&c++<s;)$(l)?o+=l.getTextContentSize()+1:o++,l=l.getNextSibling();s=o}return Un(r,s)}function ur(e,t){const{mapping:n}=t,{offset:s}=e,r=e.getNode(),i=n.getSharedType(r);if(i===void 0)return null;if(e.type==="text"){$(r)||N(326);let o=r.getPreviousSibling(),c=s;for(;$(o);)c+=o.getTextContentSize(),o=o.getPreviousSibling();return Un(i,c)}if(e.type==="element"){ct(r)||N(184);let o=0,c=r.getFirstChild();for(;c!==null&&o<s;){if($(c)){let l=c.getNextSibling();for(;$(l);)l=l.getNextSibling()}o++,c=c.getNextSibling()}return Un(i,o)}return null}function fr(e,t){return pa(e,t.doc)}function dr(e,t){if(e==null){if(t!=null)return!0}else if(t==null||!ma(e,t))return!0;return!1}function Dh(e,t){return{color:t,name:e,selection:null}}function eo(e,t){const n=e.cursorsContainer;if(n!==null){const s=t.selections,r=s.length;for(let i=0;i<r;i++)n.removeChild(s[i])}}function Ah(e,t){const n=t.selection;n!==null&&eo(e,n)}function Ih(e,t,n,s,r){const i=e.color,o=document.createElement("span");o.style.cssText=`position:absolute;top:0;bottom:0;right:-1px;width:1px;background-color:${i};z-index:10;`;const c=document.createElement("span");return c.textContent=e.name,c.style.cssText=`position:absolute;left:-2px;top:-16px;background-color:${i};color:#fff;line-height:12px;font-size:12px;padding:2px;font-family:Arial;font-weight:bold;white-space:nowrap;`,o.appendChild(c),{anchor:{key:t,offset:n},caret:o,color:i,focus:{key:s,offset:r},name:c,selections:[]}}function Th(e,t,n,s){const r=e.editor,i=r.getRootElement(),o=e.cursorsContainer;if(o===null||i===null)return;const c=o.offsetParent;if(c===null)return;const l=c.getBoundingClientRect(),h=t.selection;if(n===null)return h===null?void 0:(t.selection=null,void eo(e,h));t.selection=n;const a=n.caret,u=n.color,f=n.selections,d=n.anchor,g=n.focus,p=d.key,m=g.key,w=s.get(p),_=s.get(m);if(w==null||_==null)return;let y;if(w===_&&zn(w))y=[r.getElementByKey(p).getBoundingClientRect()];else{const S=mo(r,w,d.offset,_,g.offset);if(S===null)return;y=wo(r,S)}const x=f.length,D=y.length;for(let S=0;S<D;S++){const E=y[S];let L=f[S];if(L===void 0){L=document.createElement("span"),f[S]=L;const st=document.createElement("span");L.appendChild(st),o.appendChild(L)}const q=`position:absolute;top:${E.top-l.top}px;left:${E.left-l.left}px;height:${E.height}px;width:${E.width}px;pointer-events:none;z-index:5;`;L.style.cssText=q,L.firstChild.style.cssText=`${q}left:0;top:0;background-color:${u};opacity:0.3;`,S===D-1&&a.parentNode!==L&&L.appendChild(a)}for(let S=x-1;S>=D;S--){const E=f[S];o.removeChild(E),f.pop()}}function no(e,t){const{anchorPos:n,focusPos:s}=t,r=n?fr(n,e):null,i=s?fr(s,e):null;if(r===null||i===null)return{anchorKey:null,anchorOffset:0,focusKey:null,focusOffset:0};if(bs(e)){const[a,u]=mr(r.type,r.index),[f,d]=mr(i.type,i.index);return{anchorKey:a!==null?a.getKey():null,anchorOffset:u,focusKey:f!==null?f.getKey():null,focusOffset:d}}let[o,c]=wr(e.mapping,r),[l,h]=wr(e.mapping,i);if(l&&o&&(l!==o||h!==c)){const a=l.isBefore(o),u=a?l:o,f=a?h:c;$(u)&&$(u.getNextSibling())&&f===u.getTextContentSize()&&(a?(l=u.getNextSibling(),h=0):(o=u.getNextSibling(),c=0))}return{anchorKey:o!==null?o.getKey():null,anchorOffset:c,focusKey:l!==null?l.getKey():null,focusOffset:h}}function gr(e,t){const n=t.awareness.getLocalState();if(n===null)return;const{anchorKey:s,anchorOffset:r,focusKey:i,focusOffset:o}=no(e,n);if(s!==null&&i!==null){const c=Jt();if(!ue(c))return;pr(c.anchor,s,r),pr(c.focus,i,o)}}function pr(e,t,n){if(e.key!==t||e.offset!==n){let s=wt(t);if(s!==null&&!ct(s)&&!$(s)){const r=s.getParentOrThrow();t=r.getKey(),n=s.getIndexWithinParent(),s=r}e.set(t,n,ct(s)?"element":"text")}}function mr(e,t){const n=e._collabNode;if(n===void 0)return[null,0];if(n instanceof et){const{node:s,offset:r}=je(n,t,!0);return s===null?[n,0]:[s,r]}return[null,0]}function wr(e,t){const n=t.type,s=t.index;if(n instanceof nt){const r=e.get(n);if(r===void 0)return[null,0];if(!ct(r))return[r,s];let i=s,o=0;const c=r.getChildren();for(;i>0&&o<c.length;){const l=c[o];if(i-=1,o+=1,$(l))for(;o<c.length&&$(c[o]);)o+=1}return[r,o]}{const r=e.get(n);if(r===void 0)return[null,0];let i=0,o=s;for(;o>r[i].getTextContentSize()&&i+1<r.length;)o-=r[i].getTextContentSize(),i++;const c=r[i];return[c,Math.min(o,c.getTextContentSize())]}}function Oh(e,t){return t.awareness.getStates()}function xs(e,t,n){const{getAwarenessStates:s=Oh}=n??{},r=Array.from(s(e,t)),i=e.clientID,o=e.cursors,c=e.editor,l=c._editorState._nodeMap,h=new Set;for(let u=0;u<r.length;u++){const f=r[u],[d,g]=f;if(d!==0&&d!==i){h.add(d);const{name:p,color:m,focusing:w}=g;let _=null,y=o.get(d);if(y===void 0&&(y=Dh(p,m),o.set(d,y)),w){const{anchorKey:x,anchorOffset:D,focusKey:S,focusOffset:E}=c.read(()=>no(e,g));if(x!==null&&S!==null)if(_=y.selection,_===null)_=Ih(y,x,D,S,E);else{const L=_.anchor,q=_.focus;L.key=x,L.offset=D,q.key=S,q.offset=E}}Th(e,y,_,l)}}const a=Array.from(o.keys());for(let u=0;u<a.length;u++){const f=a[u];if(!h.has(f)){const d=o.get(f);d!==void 0&&(Ah(e,d),o.delete(f))}}}function so(e,t,n,s){const r=t.awareness,i=r.getLocalState();if(i===null)return;const{anchorPos:o,focusPos:c,name:l,color:h,focusing:a,awarenessData:u}=i;let f=null,d=null;(s!==null&&(o===null||s.is(n))||n!==null)&&(ue(s)&&(bs(e)?(f=hr(s.anchor,e),d=hr(s.focus,e)):(f=ur(s.anchor,e),d=ur(s.focus,e))),(dr(o,f)||dr(c,d))&&r.setLocalState({...i,anchorPos:f,awarenessData:u,color:h,focusPos:d,focusing:a,name:l}))}function Lh(e,t){if(t instanceof Fn&&(function(r,i){const{target:o}=i;if(!o._item||o._item.parentSub!=="__state"||Zi(o)!==void 0||!(o.parent instanceof ut||o.parent instanceof nt||o.parent instanceof H))return!1;const c=Ze(r,o.parent).getNode();if(c){const l=xr(c.getWritable());for(const h of i.keysChanged)l.updateFromUnknown(h,o.get(h))}return!0})(e,t))return;const{target:n}=t,s=Ze(e,n);if(s instanceof et&&t instanceof Pi){const{keysChanged:r,childListChanged:i,delta:o}=t;r.size>0&&s.syncPropertiesFromYjs(e,r),i&&(s.applyChildrenYjsDelta(e,o),s.syncChildrenFromYjs(e))}else if(s instanceof K&&t instanceof Fn){const{keysChanged:r}=t;r.size>0&&s.syncPropertiesAndTextFromYjs(e,r)}else if(s instanceof bt&&t instanceof zi){const{attributesChanged:r}=t;r.size>0&&s.syncPropertiesFromYjs(e,r)}else N(82)}function vh(e,t,n,s,r=xs){const i=e.editor,o=i._editorState;n.forEach(c=>c.delta),i.update(()=>{for(let c=0;c<n.length;c++){const l=n[c];Lh(e,l)}Nh(o,e,t),s||_o(bo)},{onUpdate:()=>{r(e,t),i.update(()=>Mh())},skipTransforms:!0,tag:s?br:Sr})}function Nh(e,t,n){const s=Jt();if(ue(s))if(ar(s)){const r=e._selection;ue(r)&&(gr(t,n),ar(s))&&to(s.anchor.key,e),so(t,n,r,Jt())}else gr(t,n)}function Mh(){xt().getChildrenSize()===0&&xt().append(Er())}function Uh(e,t,n,s,r,i,o,c){Eh(e,()=>{s.read(()=>{if(c.has(Sr)||c.has(br))return void(o.size>0&&(function(a,u){const f=Array.from(u),d=a.collabNodeMap,g=[],p=[];for(let m=0;m<f.length;m++){const w=f[m],_=wt(w),y=d.get(w);if(y instanceof K)if($(_))g.push([y,_.__text]);else{const x=y.getOffset();if(x===-1)continue;const D=y._parent;y._normalized=!0,D._xmlText.delete(x,1),p.push(y)}}for(let m=0;m<p.length;m++){const w=p[m],_=w.getKey();d.delete(_);const y=w._parent._children,x=y.indexOf(w);y.splice(x,1)}for(let m=0;m<g.length;m++){const[w,_]=g[m];w._text=_}})(e,o));if(r.has("root")){const a=n._nodeMap,u=xt(),f=e.root;f.syncPropertiesFromLexical(e,u,a),f.syncChildrenFromLexical(e,u,a,r,i)}const l=Jt(),h=n._selection;so(e,t,h,l)})})}const Rh=Cr("CONNECTED_COMMAND"),$h=Cr("TOGGLE_CONNECT_COMMAND");function Fh(e,t){return new Ei(t,{trackedOrigins:new Set([e,null])})}function jh(e,t,n,s,r){e.awareness.setLocalState({anchorPos:null,awarenessData:r,color:n,focusPos:null,focusing:s,name:t})}function yr(e,t,n,s,r){const{awareness:i}=e;let o=i.getLocalState();o===null&&(o={anchorPos:null,awarenessData:r,color:n,focusPos:null,focusing:s,name:t}),o.focusing=s,i.setLocalState(o)}function Bh(e,t,n,s,r,i,o,c,l,h,a,u,f=xs){const d=A.useRef(!1),g=A.useCallback(()=>{const{root:p}=c;o&&p.isEmpty()&&p._xmlText._length===0&&Kh(e,a)},[c,e,a,o]);return A.useEffect(()=>{const{root:p}=c,m=(_,y)=>{const x=y.origin;x!==c&&vh(c,n,_,x instanceof Ei,f)};p.getSharedType().observeDeep(m);const w=e.registerUpdateListener(({prevEditorState:_,editorState:y,dirtyLeaves:x,dirtyElements:D,normalizedNodes:S,tags:E})=>{E.has(Ls)||Uh(c,n,_,y,D,x,S,E)});return()=>{p.getSharedType().unobserveDeep(m),w()}},[c,n,e,l,s,t,f]),A.useEffect(()=>{const p=w=>{(function(_,y){if(_.update(()=>{const E=xt();E.clear(),E.select()},{tag:Ls}),y.cursors==null)return;const x=y.cursors;if(x==null)return;const D=y.cursorsContainer;if(D==null)return;const S=Array.from(x.values());for(let E=0;E<S.length;E++){const L=S[E].selection;if(L&&L.selections!=null){const q=L.selections;for(let st=0;st<q.length;st++)D.removeChild(q[E])}}})(e,c),l(w),s.set(t,w),d.current=!0},m=()=>{d.current=!1};return n.on("reload",p),n.on("sync",m),()=>{n.off("reload",p),n.off("sync",m)}},[c,n,e,l,s,t]),Vh(e,n,r,i,d,u,g),Ph(c,n),zh(c,h)}function Vh(e,t,n,s,r,i,o){const c=A.useCallback(()=>t.connect(),[t]),l=A.useCallback(()=>{try{t.disconnect()}catch{}},[t]);A.useEffect(()=>{const h=({status:f})=>{e.dispatchCommand(Rh,f==="connected")},a=f=>{f&&r.current===!1&&o&&o()};jh(t,n,s,document.activeElement===e.getRootElement(),i||{}),t.on("status",h),t.on("sync",a);const u=c();return()=>{r.current===!1&&(u?u.then(l):l()),t.off("sync",a),t.off("status",h)}},[e,t,n,s,r,i,o,c,l]),A.useEffect(()=>e.registerCommand($h,h=>(h?(console.log("Collaboration connected!"),c()):(console.log("Collaboration disconnected!"),l()),!0),fe),[c,l,e]),A.useEffect(()=>{const h=()=>{try{t.awareness.setLocalState(null)}catch{}};return window.addEventListener("beforeunload",h),window.addEventListener("pagehide",h),()=>{window.removeEventListener("beforeunload",h),window.removeEventListener("pagehide",h)}},[t])}function Ph(e,t){A.useEffect(()=>{const{awareness:n}=t,s=()=>{xs(e,t)};return n.on("update",s),()=>{n.off("update",s)}},[e,t])}function zh(e,t){return A.useMemo(()=>No.createPortal(U.jsx("div",{ref:n=>{e.cursorsContainer=n}}),t&&t.current||document.body),[e,t])}function Yh(e,t,n,s,r){A.useEffect(()=>Dr(e.registerCommand(Do,()=>(yr(t,n,s,!0,r||{}),!1),fe),e.registerCommand(Eo,()=>(yr(t,n,s,!1,r||{}),!1),fe)),[s,e,n,t,r])}function Hh(e,t){A.useEffect(()=>Dr(e.registerCommand(xo,()=>(t.undo(),!0),fe),e.registerCommand(Co,()=>(t.redo(),!0),fe)));const n=A.useCallback(()=>{t.clear()},[t]);return A.useEffect(()=>{const s=()=>{e.dispatchCommand(Ao,t.undoStack.length>0),e.dispatchCommand(Io,t.redoStack.length>0)};return t.on("stack-item-added",s),t.on("stack-item-popped",s),t.on("stack-cleared",s),()=>{t.off("stack-item-added",s),t.off("stack-item-popped",s),t.off("stack-cleared",s)}},[e,t]),n}function Kh(e,t){e.update(()=>{const n=xt();if(n.isEmpty())if(t)switch(typeof t){case"string":{const s=e.parseEditorState(t);e.setEditorState(s,{tag:Le});break}case"object":e.setEditorState(t,{tag:Le});break;case"function":e.update(()=>{xt().isEmpty()&&t(e)},{tag:Le})}else{const s=Er();n.append(s);const{activeElement:r}=document;(Jt()!==null||r!==null&&r===e.getRootElement())&&s.select()}},{tag:Le})}function Wh({id:e,providerFactory:t,shouldBootstrap:n,username:s,cursorColor:r,cursorsContainerRef:i,initialEditorState:o,excludedProperties:c,awarenessData:l,syncCursorPositionsFn:h}){const a=A.useRef(!1),u=A.useRef(!1),f=Ko(s,r),{yjsDocMap:d,name:g,color:p}=f,[m]=So();Jh(f,m);const[w,_]=A.useState(),[y,x]=A.useState();A.useEffect(()=>{if(u.current)return;u.current=!0;const E=t(e,d);return _(E),x(d.get(e)),()=>{E.disconnect()}},[e,t,d]);const[D,S]=A.useState();return A.useEffect(()=>{if(!w||a.current)return;a.current=!0;const E=wh(m,w,e,y||d.get(e),d,c);return S(E),()=>{E.root.destroy(E)}},[m,w,e,d,y,c]),w&&D?U.jsx(Gh,{awarenessData:l,binding:D,collabContext:f,color:p,cursorsContainerRef:i,editor:m,id:e,initialEditorState:o,name:g,provider:w,setDoc:x,shouldBootstrap:n,yjsDocMap:d,syncCursorPositionsFn:h}):U.jsx(U.Fragment,{})}function Gh({editor:e,id:t,provider:n,yjsDocMap:s,name:r,color:i,shouldBootstrap:o,cursorsContainerRef:c,initialEditorState:l,awarenessData:h,collabContext:a,binding:u,setDoc:f,syncCursorPositionsFn:d}){const g=Bh(e,t,n,s,r,i,o,u,f,c,l,h,d);return(function(p,m){Hh(p,A.useMemo(()=>Fh(m,m.root.getSharedType()),[m]))})(e,u),Yh(e,n,r,i,h),g}const Jh=(e,t)=>{A.useEffect(()=>(e.isCollabActive=!0,()=>{t._parentEditor==null&&(e.isCollabActive=!1)}),[e,t])},ro=new Map;class qh{constructor(t){this.room=t,this.onmessage=null,this._onChange=n=>n.key===t&&this.onmessage!==null&&this.onmessage({data:tl(n.newValue||"")}),Lc(this._onChange)}postMessage(t){Ur.setItem(this.room,Zc(Gc(t)))}close(){vc(this._onChange)}}const Xh=typeof BroadcastChannel>"u"?qh:BroadcastChannel,Es=e=>dt(ro,e,()=>{const t=Et(),n=new Xh(e);return n.onmessage=s=>t.forEach(r=>r(s.data,"broadcastchannel")),{bc:n,subs:t}}),Qh=(e,t)=>(Es(e).subs.add(t),t),Zh=(e,t)=>{const n=Es(e),s=n.subs.delete(t);return s&&n.subs.size===0&&(n.bc.close(),ro.delete(e)),s},Vt=(e,t,n=null)=>{const s=Es(e);s.bc.postMessage(t),s.subs.forEach(r=>r(t,n))},io=0,Ds=1,oo=2,Vn=(e,t)=>{k(e,io);const n=aa(t);v(e,n)},co=(e,t,n)=>{k(e,Ds),v(e,ia(t,n))},tu=(e,t,n)=>co(t,n,P(e)),lo=(e,t,n,s)=>{try{na(t,P(e),n)}catch(r){s?.(r),console.error("Caught error while handling a Yjs update",r)}},eu=(e,t)=>{k(e,oo),v(e,t)},nu=lo,su=(e,t,n,s,r)=>{const i=b(e);switch(i){case io:tu(e,t,n);break;case Ds:lo(e,n,s,r);break;case oo:nu(e,n,s,r);break;default:throw new Error("Unknown message type")}return i},ru=0,iu=(e,t,n)=>{b(e)===ru&&n(t,Ct(e))},Dn=3e4;class ou extends Xo{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=Dt();this.getLocalState()!==null&&Dn/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((r,i)=>{i!==this.clientID&&Dn<=n-r.lastUpdated&&this.states.has(i)&&s.push(i)}),s.length>0&&As(this,s,"timeout")},it(Dn/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){const n=this.clientID,s=this.meta.get(n),r=s===void 0?0:s.clock+1,i=this.states.get(n);t===null?this.states.delete(n):this.states.set(n,t),this.meta.set(n,{clock:r,lastUpdated:Dt()});const o=[],c=[],l=[],h=[];t===null?h.push(n):i==null?t!=null&&o.push(n):(c.push(n),zt(i,t)||l.push(n)),(o.length>0||l.length>0||h.length>0)&&this.emit("change",[{added:o,updated:l,removed:h},"local"]),this.emit("update",[{added:o,updated:c,removed:h},"local"])}setLocalStateField(t,n){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[t]:n})}getStates(){return this.states}}const As=(e,t,n)=>{const s=[];for(let r=0;r<t.length;r++){const i=t[r];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){const o=e.meta.get(i);e.meta.set(i,{clock:o.clock+1,lastUpdated:Dt()})}s.push(i)}}s.length>0&&(e.emit("change",[{added:[],updated:[],removed:s},n]),e.emit("update",[{added:[],updated:[],removed:s},n]))},he=(e,t,n=e.states)=>{const s=t.length,r=z();k(r,s);for(let i=0;i<s;i++){const o=t[i],c=n.get(o)||null,l=e.meta.get(o).clock;k(r,o),k(r,l),Lt(r,JSON.stringify(c))}return O(r)},cu=(e,t,n)=>{const s=It(t),r=Dt(),i=[],o=[],c=[],l=[],h=b(s);for(let a=0;a<h;a++){const u=b(s);let f=b(s);const d=JSON.parse(Ct(s)),g=e.meta.get(u),p=e.states.get(u),m=g===void 0?0:g.clock;(m<f||m===f&&d===null&&e.states.has(u))&&(d===null?u===e.clientID&&e.getLocalState()!=null?f++:e.states.delete(u):e.states.set(u,d),e.meta.set(u,{clock:f,lastUpdated:r}),g===void 0&&d!==null?i.push(u):g!==void 0&&d===null?l.push(u):d!==null&&(zt(d,p)||c.push(u),o.push(u)))}(i.length>0||c.length>0||l.length>0)&&e.emit("change",[{added:i,updated:c,removed:l},n]),(i.length>0||o.length>0||l.length>0)&&e.emit("update",[{added:i,updated:o,removed:l},n])},lu=e=>$c(e,(t,n)=>`${encodeURIComponent(n)}=${encodeURIComponent(t)}`).join("&"),Tt=0,ao=3,Gt=1,au=2,Te=[];Te[Tt]=(e,t,n,s,r)=>{k(e,Tt);const i=su(t,e,n.doc,n);s&&i===Ds&&!n.synced&&(n.synced=!0)};Te[ao]=(e,t,n,s,r)=>{k(e,Gt),v(e,he(n.awareness,Array.from(n.awareness.getStates().keys())))};Te[Gt]=(e,t,n,s,r)=>{cu(n.awareness,P(t),n)};Te[au]=(e,t,n,s,r)=>{iu(t,n.doc,(i,o)=>hu(n,o))};const _r=3e4,hu=(e,t)=>console.warn(`Permission denied to access ${e.url}.
6
- ${t}`),ho=(e,t,n)=>{const s=It(t),r=z(),i=b(s),o=e.messageHandlers[i];return o?o(r,s,e,n,i):console.error("Unable to compute message"),r},Pn=(e,t,n)=>{t===e.ws&&(e.emit("connection-close",[n,e]),e.ws=null,t.close(),e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,As(e.awareness,Array.from(e.awareness.getStates().keys()).filter(s=>s!==e.doc.clientID),e),e.emit("status",[{status:"disconnected"}])):e.wsUnsuccessfulReconnects++,setTimeout(uo,Wn(Qo(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e))},uo=e=>{if(e.shouldConnect&&e.ws===null){const t=new e._WS(e.url,e.protocols);t.binaryType="arraybuffer",e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{e.wsLastMessageReceived=Dt();const s=ho(e,new Uint8Array(n.data),!0);Gn(s)>1&&t.send(O(s))},t.onerror=n=>{e.emit("connection-error",[n,e])},t.onclose=n=>{Pn(e,t,n)},t.onopen=()=>{e.wsLastMessageReceived=Dt(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit("status",[{status:"connected"}]);const n=z();if(k(n,Tt),Vn(n,e.doc),t.send(O(n)),e.awareness.getLocalState()!==null){const s=z();k(s,Gt),v(s,he(e.awareness,[e.doc.clientID])),t.send(O(s))}},e.emit("status",[{status:"connecting"}])}},An=(e,t)=>{const n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&Vt(e.bcChannel,t,e)};class uu extends Kn{constructor(t,n,s,{connect:r=!0,awareness:i=new ou(s),params:o={},protocols:c=[],WebSocketPolyfill:l=WebSocket,resyncInterval:h=-1,maxBackoffTime:a=2500,disableBc:u=!1}={}){for(super();t[t.length-1]==="/";)t=t.slice(0,t.length-1);this.serverUrl=t,this.bcChannel=t+"/"+n,this.maxBackoffTime=a,this.params=o,this.protocols=c,this.roomname=n,this.doc=s,this._WS=l,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=Te.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=r,this._resyncInterval=0,h>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const f=z();k(f,Tt),Vn(f,s),this.ws.send(O(f))}},h)),this._bcSubscriber=(f,d)=>{if(d!==this){const g=ho(this,new Uint8Array(f),!1);Gn(g)>1&&Vt(this.bcChannel,O(g),this)}},this._updateHandler=(f,d)=>{if(d!==this){const g=z();k(g,Tt),eu(g,f),An(this,O(g))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:f,updated:d,removed:g},p)=>{const m=f.concat(d).concat(g),w=z();k(w,Gt),v(w,he(i,m)),An(this,O(w))},this._exitHandler=()=>{As(this.awareness,[s.clientID],"app closed")},At&&typeof process<"u"&&process.on("exit",this._exitHandler),i.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&_r<Dt()-this.wsLastMessageReceived&&Pn(this,this.ws,null)},_r/10),r&&this.connect()}get url(){const t=lu(this.params);return this.serverUrl+"/"+this.roomname+(t.length===0?"":"?"+t)}get synced(){return this._synced}set synced(t){this._synced!==t&&(this._synced=t,this.emit("synced",[t]),this.emit("sync",[t]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),At&&typeof process<"u"&&process.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||(Qh(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);const t=z();k(t,Tt),Vn(t,this.doc),Vt(this.bcChannel,O(t),this);const n=z();k(n,Tt),co(n,this.doc),Vt(this.bcChannel,O(n),this);const s=z();k(s,ao),Vt(this.bcChannel,O(s),this);const r=z();k(r,Gt),v(r,he(this.awareness,[this.doc.clientID])),Vt(this.bcChannel,O(r),this)}disconnectBc(){const t=z();k(t,Gt),v(t,he(this.awareness,[this.doc.clientID],new Map)),An(this,O(t)),this.bcconnected&&(Zh(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&Pn(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(uo(this),this.connectBc())}}function fo(){const e=kr.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=U.jsx("style",{children:`
7
- .collaboration-cursor-container {
8
- position: relative;
9
- display: inline;
10
- }
11
-
12
- .collaboration-cursor-caret {
13
- position: absolute;
14
- top: 0;
15
- bottom: 0;
16
- width: 2px;
17
- pointer-events: none;
18
- }
19
-
20
- .collaboration-cursor-label {
21
- position: absolute;
22
- top: -18px;
23
- left: -2px;
24
- padding: 1px 6px;
25
- font-size: 11px;
26
- font-weight: 600;
27
- line-height: 16px;
28
- white-space: nowrap;
29
- border-radius: 4px 4px 4px 0;
30
- color: #fff;
31
- pointer-events: none;
32
- user-select: none;
33
- }
34
-
35
- .collaboration-cursor-selection {
36
- position: absolute;
37
- pointer-events: none;
38
- opacity: 0.25;
39
- }
40
- `}),e[0]=t):t=e[0],t}fo.__docgenInfo={description:`Injects CSS for Yjs awareness cursor rendering in the collaborative editor.
41
- @lexical/yjs injects cursor elements with data-* attributes; this styles them.`,methods:[],displayName:"AwarenessCursorsCSS"};function fu(e){const t=kr.c(27),{roomId:n,wsUrl:s,userName:r,userColor:i,placeholder:o}=e,c=r===void 0?"Anonymous":r,l=i===void 0?"#30bced":i,h=A.useRef(null),[a,u]=A.useState(null);let f,d;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{u(h.current)},d=[],t[0]=f,t[1]=d):(f=t[0],d=t[1]),A.useEffect(f,d);let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g={namespace:"COLLABORATIVE_EDITOR",nodes:Bo,editorState:null,onError:du,editable:!0,theme:jo},t[2]=g):g=t[2];const p=g;let m;t[3]!==s?(m=(Is,go)=>{const Ts=new at;return go.set(Is,Ts),new uu(s,Is,Ts)},t[3]=s,t[4]=m):m=t[4];const w=m;let _;t[5]===Symbol.for("react.memo_cache_sentinel")?(_=U.jsx(fo,{}),t[5]=_):_=t[5];let y;t[6]!==w||t[7]!==n||t[8]!==l||t[9]!==c?(y=U.jsx(Wh,{id:n,providerFactory:w,shouldBootstrap:!1,username:c,cursorColor:l}),t[6]=w,t[7]=n,t[8]=l,t[9]=c,t[10]=y):y=t[10];let x,D,S,E,L;t[11]===Symbol.for("react.memo_cache_sentinel")?(E=U.jsx(Mo,{}),L=U.jsx(Uo,{}),x=U.jsx(Ro,{}),D=U.jsx($o,{}),S=U.jsx(Fo,{}),t[11]=x,t[12]=D,t[13]=S,t[14]=E,t[15]=L):(x=t[11],D=t[12],S=t[13],E=t[14],L=t[15]);let q;t[16]===Symbol.for("react.memo_cache_sentinel")?(q=U.jsx(To,{fullWidth:!1}),t[16]=q):q=t[16];let st;t[17]!==o?(st=o?U.jsx(Po,{position:"absolute",top:"0",color:"fg.muted",pointerEvents:"none",userSelect:"none",textStyle:"paragraph/M/regular",children:o}):null,t[17]=o,t[18]=st):st=t[18];let $t;t[19]!==st?($t=U.jsx(Oo,{contentEditable:q,placeholder:st,ErrorBoundary:Lo}),t[19]=st,t[20]=$t):$t=t[20];let Ft;t[21]!==a?(Ft=a?U.jsx(Vo,{anchorElem:a}):null,t[21]=a,t[22]=Ft):Ft=t[22];let Oe;return t[23]!==$t||t[24]!==Ft||t[25]!==y?(Oe=U.jsxs(zo,{ref:h,className:"rich-text",justifyContent:"space-between",width:"100%",maxWidth:"100%",height:"100%",position:"relative",direction:"column",overflow:"hidden",children:[_,U.jsx(vo,{initialConfig:p,children:U.jsxs(Ho,{children:[y,E,L,x,D,S,$t,Ft]})})]}),t[23]=$t,t[24]=Ft,t[25]=y,t[26]=Oe):Oe=t[26],Oe}function du(e){return console.error(e)}fu.__docgenInfo={description:"",methods:[],displayName:"CollaborativeMarkdownEditor",props:{roomId:{required:!0,tsType:{name:"string"},description:""},wsUrl:{required:!0,tsType:{name:"string"},description:""},userName:{required:!1,tsType:{name:"string"},description:""},userColor:{required:!1,tsType:{name:"string"},description:""},placeholder:{required:!1,tsType:{name:"string"},description:""}}};export{ou as A,fu as C,at as D,Wh as V,na as a,cu as b,fo as c,Ho as d,he as e};
@@ -1,11 +0,0 @@
1
- import{j as r,r as U}from"./iframe-B8FSoBNY.js";import{c as q}from"./compiler-runtime-BXE7OOXE.js";import{L as Y,n as G,C as J,f as K}from"./rich-text-theme-Bkhh9rAZ.js";import{C as Q,D as V,a as F,A as X,e as P,b as D,c as Z,V as ee,d as oe}from"./collaborative-markdown-editor-Bj0GvTvv.js";import{l as re,s as te,n as se,I as ie,E as ne}from"./CodeBlockPlugin-C3OWpvP8.js";import{e as ae,a as le,F as ce}from"./FloatingTextFormatToolbarPlugin-B6jc8xvg.js";import{F as H}from"./flex-DAJL4AFZ.js";import{B as M}from"./index-B0y2_lLF.js";import{c as me}from"./create-recipe-context-BU56IzEo.js";import{V as de}from"./v-stack-Btoq6OB_.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DaXC_qY_.js";import"./index-DpB4ozcR.js";import"./factory-DAJZwK4o.js";import"./index-cFwdnc0b.js";import"./textarea-rqmaWSc5.js";import"./factory-BR3bc_RM.js";import"./use-field-context-DoxKQlMm.js";import"./computed-style-C0hzrq9-.js";import"./table-BKNSzs2r.js";import"./create-slot-recipe-context-DAhDE6G_.js";import"./resource-badge-Bw5UoU4J.js";import"./createLucideIcon-CcBBUKX8.js";import"./file-text-D5m8MJlG.js";import"./tooltip-DZxUoouw.js";import"./portal-CZHfPTRw.js";import"./normalize-props-D7NI5JRu.js";import"./tooltip-C_a-XGZ8.js";import"./use-presence-context-DK2PGZth.js";import"./create-split-props-u5h9OPvL.js";import"./overflow-CkG1DOya.js";import"./icon-button-DHiUe7rR.js";import"./button-C7it2n8t.js";import"./spinner-ZYH_gvW-.js";import"./index-CXwl6T4k.js";import"./x-D42ziktz.js";import"./stack-CN4X31TA.js";const{withContext:pe}=me({key:"heading"}),L=pe("h2");L.displayName="Heading";class W{awareness;cbs={};constructor(e){this.awareness=new X(e)}connect(){queueMicrotask(()=>{this.emit("sync",!0),this.emit("status",{status:"connected"})})}disconnect(){}on(e,o){this.cbs[e]||(this.cbs[e]=new Set),this.cbs[e].add(o)}off(e,o){this.cbs[e]?.delete(o)}emit(e,...o){for(const s of this.cbs[e]??[])s(...o)}}function ue(t,e){let o=!1;t.on("update",s=>{o||(o=!0,F(e,s),o=!1)}),e.on("update",s=>{o||(o=!0,F(t,s),o=!1)})}function fe(t,e){t.on("update",({added:o,updated:s,removed:n})=>{const i=P(t,[...o,...s,...n]);D(e,i,t)}),e.on("update",({added:o,updated:s,removed:n})=>{const i=P(e,[...o,...s,...n]);D(t,i,e)})}function $(t){const e=q.c(34),{label:o,roomId:s,userName:n,userColor:i,provider:a,doc:l}=t,m=U.useRef(null),[c,y]=U.useState(null);let g,S;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{y(m.current)},S=[],e[0]=g,e[1]=S):(g=e[0],S=e[1]),U.useEffect(g,S);const N=`COLLAB_${o}`;let j;e[2]!==N?(j={namespace:N,nodes:le,editorState:null,onError:he,editable:!0,theme:ae},e[2]=N,e[3]=j):j=e[3];const R=j;let v;e[4]!==l||e[5]!==a?(v=(O,z)=>(z.set(O,l),a),e[4]=l,e[5]=a,e[6]=v):v=e[6];const T=v;let d;e[7]!==i?(d=r.jsx(M,{as:"span",display:"inline-block",w:"10px",h:"10px",borderRadius:"full",bg:i,mr:"2"}),e[7]=i,e[8]=d):d=e[8];let p;e[9]!==o||e[10]!==d?(p=r.jsxs(L,{size:"sm",px:"2",py:"1",borderBottom:"1px solid",borderColor:"border",children:[d,o]}),e[9]=o,e[10]=d,e[11]=p):p=e[11];let u;e[12]!==T||e[13]!==s||e[14]!==i||e[15]!==n?(u=r.jsx(ee,{id:s,providerFactory:T,shouldBootstrap:!1,username:n,cursorColor:i}),e[12]=T,e[13]=s,e[14]=i,e[15]=n,e[16]=u):u=e[16];let C,E,_,A,B;e[17]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(re,{}),C=r.jsx(te,{}),E=r.jsx(se,{}),_=r.jsx(ie,{}),A=r.jsx(ne,{}),e[17]=C,e[18]=E,e[19]=_,e[20]=A,e[21]=B):(C=e[17],E=e[18],_=e[19],A=e[20],B=e[21]);let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Y,{contentEditable:r.jsx(J,{fullWidth:!0}),placeholder:r.jsx(M,{position:"absolute",top:"0",color:"fg.muted",pointerEvents:"none",userSelect:"none",children:"Type here..."}),ErrorBoundary:G}),e[22]=k):k=e[22];let f;e[23]!==c?(f=c?r.jsx(ce,{anchorElem:c}):null,e[23]=c,e[24]=f):f=e[24];let h;e[25]!==f||e[26]!==u?(h=r.jsxs(oe,{children:[u,B,C,E,_,A,k,f]}),e[25]=f,e[26]=u,e[27]=h):h=e[27];let x;e[28]!==R||e[29]!==h?(x=r.jsx(H,{ref:m,className:"rich-text",flex:"1",direction:"column",overflow:"hidden",position:"relative",minH:"300px",children:r.jsx(K,{initialConfig:R,children:h})}),e[28]=R,e[29]=h,e[30]=x):x=e[30];let I;return e[31]!==x||e[32]!==p?(I=r.jsxs(de,{align:"stretch",flex:"1",minW:"0",children:[p,x]}),e[31]=x,e[32]=p,e[33]=I):I=e[33],I}function he(t){return console.error(t)}function xe(){const t=q.c(2);let e;if(t[0]===Symbol.for("react.memo_cache_sentinel")){const l=new V,m=new V;ue(l,m);const c=new W(l),y=new W(m);fe(c.awareness,y.awareness),e={docA:l,docB:m,providerA:c,providerB:y},t[0]=e}else e=t[0];const{docA:o,docB:s,providerA:n,providerB:i}=e;let a;return t[1]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs(H,{gap:"4",h:"500px",children:[r.jsx(Z,{}),r.jsx($,{label:"Alice",roomId:"demo-room",userName:"Alice",userColor:"#30bced",provider:n,doc:o}),r.jsx($,{label:"Bob",roomId:"demo-room",userName:"Bob",userColor:"#e06c75",provider:i,doc:s})]}),t[1]=a):a=t[1],a}const eo={title:"Editors/Collaborative Markdown Editor",component:Q,parameters:{layout:"padded"}},b={render:()=>r.jsx(xe,{})},w={args:{roomId:"todo:story-demo",wsUrl:"ws://localhost:3000/v1/docs",userName:"Storybook User",userColor:"#30bced",placeholder:"Start typing collaboratively..."}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
2
- render: () => <SplitViewDemo />
3
- }`,...b.parameters?.docs?.source},description:{story:"Two editors syncing in real-time via in-memory Yjs. Type in one pane to see changes in the other.",...b.parameters?.docs?.description}}};w.parameters={...w.parameters,docs:{...w.parameters?.docs,source:{originalSource:`{
4
- args: {
5
- roomId: "todo:story-demo",
6
- wsUrl: "ws://localhost:3000/v1/docs",
7
- userName: "Storybook User",
8
- userColor: "#30bced",
9
- placeholder: "Start typing collaboratively..."
10
- }
11
- }`,...w.parameters?.docs?.source},description:{story:"Single editor connecting to a WebSocket server. Requires a running API with WS support.",...w.parameters?.docs?.description}}};const oo=["SplitView","SingleEditor"];export{w as SingleEditor,b as SplitView,oo as __namedExportsOrder,eo as default};
@@ -1 +0,0 @@
1
- import{c as g}from"./create-slot-recipe-context-DAhDE6G_.js";import{r as t,j as l}from"./iframe-B8FSoBNY.js";import{m as a,a as i}from"./factory-BR3bc_RM.js";import{u as n,b as f,a as u,C as P}from"./collapsible-content-B1Uq3jUM.js";import{c as x}from"./create-split-props-u5h9OPvL.js";const c=t.forwardRef((r,e)=>{const o=n(),s=a(o.getIndicatorProps(),r);return l.jsx(i.div,{...s,ref:e})});c.displayName="CollapsibleIndicator";const R=x(),d=t.forwardRef((r,e)=>{const[{value:o},s]=R(r,["value"]),m=a(o.getRootProps(),s);return l.jsx(f,{value:o,children:l.jsx(i.div,{...m,ref:e})})});d.displayName="CollapsibleRootProvider";const C=t.forwardRef((r,e)=>{const o=n(),s=a(o.getTriggerProps(),r);return l.jsx(i.button,{...s,ref:e})});C.displayName="CollapsibleTrigger";const{withProvider:b,withContext:p}=g({key:"collapsible"});b(d,"root",{forwardAsChild:!0});const y=b(P,"root",{forwardAsChild:!0}),I=p(C,"trigger",{forwardAsChild:!0}),T=p(u,"content",{forwardAsChild:!0}),$=p(c,"indicator",{forwardAsChild:!0});export{$ as C,I as a,T as b,y as c};
@@ -1 +0,0 @@
1
- import{m as b,r as v,j as y}from"./iframe-B8FSoBNY.js";import{j as C,c as A,m as w,a as R}from"./factory-BR3bc_RM.js";import{c as T}from"./create-split-props-u5h9OPvL.js";import{c as H,r as O,e as W,g as N,O as j,A as L,a as M,u as V,b as B,n as $}from"./normalize-props-D7NI5JRu.js";import{a as D}from"./mutation-observer-CAfGweIM.js";import{g as U}from"./tabbable-DHAf8oAu.js";import{g as z}from"./computed-style-C0hzrq9-.js";import{d as c}from"./number-C92MPsRM.js";const F=e=>T()(e,["collapsedHeight","collapsedWidth","defaultOpen","disabled","id","ids","lazyMount","onExitComplete","onOpenChange","open","unmountOnExit"]);var q=e=>e.ids?.root??`collapsible:${e.id}`,x=e=>e.ids?.content??`collapsible:${e.id}:content`,G=e=>e.ids?.trigger??`collapsible:${e.id}:trigger`,u=e=>e.getById(x(e));function J(e,o){const{state:n,send:i,context:t,scope:a,prop:l}=e,r=n.matches("open")||n.matches("closing"),s=n.matches("open"),d=n.matches("closed"),{width:p,height:E}=t.get("size"),m=!!l("disabled"),g=l("collapsedHeight"),h=l("collapsedWidth"),k=g!=null,P=h!=null,I=k||P,S=!t.get("initial")&&s;return{disabled:m,visible:r,open:s,measureSize(){i({type:"size.measure"})},setOpen(f){n.matches("open")!==f&&i({type:f?"open":"close"})},getRootProps(){return o.element({...b.root.attrs,"data-state":s?"open":"closed",dir:l("dir"),id:q(a)})},getContentProps(){return o.element({...b.content.attrs,id:x(a),"data-collapsible":"","data-state":S?void 0:s?"open":"closed","data-disabled":C(m),"data-has-collapsed-size":C(I),hidden:!r&&!I,dir:l("dir"),style:{"--height":c(E),"--width":c(p),"--collapsed-height":c(g),"--collapsed-width":c(h),...d&&k&&{overflow:"hidden",minHeight:c(g),maxHeight:c(g)},...d&&P&&{overflow:"hidden",minWidth:c(h),maxWidth:c(h)}}})},getTriggerProps(){return o.element({...b.trigger.attrs,id:G(a),dir:l("dir"),type:"button","data-state":s?"open":"closed","data-disabled":C(m),"aria-controls":x(a),"aria-expanded":r||!1,onClick(f){f.defaultPrevented||m||i({type:s?"close":"open"})}})},getIndicatorProps(){return o.element({...b.indicator.attrs,dir:l("dir"),"data-state":s?"open":"closed","data-disabled":C(m)})}}}var K=H({initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{size:e(()=>({defaultValue:{height:0,width:0},sync:!0})),initial:e(()=>({defaultValue:!1}))}},refs(){return{cleanup:void 0,stylesRef:void 0}},watch({track:e,prop:o,action:n}){e([()=>o("open")],()=>{n(["setInitial","computeSize","toggleVisibility"])})},exit:["cleanupNode"],states:{closed:{effects:["trackTabbableElements"],on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","computeSize","invokeOnOpen"]}]}},closing:{effects:["trackExitAnimation"],on:{"controlled.close":{target:"closed"},"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","invokeOnOpen"]}],close:[{guard:"isOpenControlled",actions:["invokeOnExitComplete"]},{target:"closed",actions:["setInitial","computeSize","invokeOnExitComplete"]}],"animation.end":{target:"closed",actions:["invokeOnExitComplete","clearInitial"]}}},open:{effects:["trackEnterAnimation"],on:{"controlled.close":{target:"closing"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closing",actions:["setInitial","computeSize","invokeOnClose"]}],"size.measure":{actions:["measureSize"]},"animation.end":{actions:["clearInitial"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackEnterAnimation:({send:e,scope:o})=>{let n;const i=O(()=>{const t=u(o);if(!t)return;const a=z(t).animationName;if(!a||a==="none"){e({type:"animation.end"});return}const r=s=>{N(s)===t&&e({type:"animation.end"})};t.addEventListener("animationend",r),n=()=>{t.removeEventListener("animationend",r)}});return()=>{i(),n?.()}},trackExitAnimation:({send:e,scope:o})=>{let n;const i=O(()=>{const t=u(o);if(!t)return;const a=z(t).animationName;if(!a||a==="none"){e({type:"animation.end"});return}const r=d=>{N(d)===t&&e({type:"animation.end"})};t.addEventListener("animationend",r);const s=W(t,{animationFillMode:"forwards"});n=()=>{t.removeEventListener("animationend",r),L(()=>s())}});return()=>{i(),n?.()}},trackTabbableElements:({scope:e,prop:o})=>{if(!o("collapsedHeight")&&!o("collapsedWidth"))return;const n=u(e);if(!n)return;const i=()=>{const r=U(n).map(s=>j(s,"inert",""));return()=>{r.forEach(s=>s())}};let t=i();const a=D(n,{callback(){t(),t=i()}});return()=>{t(),a()}}},actions:{setInitial:({context:e,flush:o})=>{o(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("stylesRef",null)},measureSize:({context:e,scope:o})=>{const n=u(o);if(!n)return;const{height:i,width:t}=n.getBoundingClientRect();e.set("size",{height:i,width:t})},computeSize:({refs:e,scope:o,context:n})=>{e.get("cleanup")?.();const i=O(()=>{const t=u(o);if(!t)return;const a=t.hidden;t.style.animationName="none",t.style.animationDuration="0s",t.hidden=!1;const l=t.getBoundingClientRect();n.set("size",{height:l.height,width:l.width}),n.get("initial")&&(t.style.animationName="",t.style.animationDuration=""),t.hidden=a});e.set("cleanup",i)},invokeOnOpen:({prop:e})=>{e("onOpenChange")?.({open:!0})},invokeOnClose:({prop:e})=>{e("onOpenChange")?.({open:!1})},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.()},toggleVisibility:({prop:e,send:o})=>{o({type:e("open")?"controlled.open":"controlled.close"})}}}});const Q=(e={})=>{const{lazyMount:o,unmountOnExit:n,...i}=e,t=v.useId(),a=v.useRef(!1),{dir:l}=M(),{getRootNode:r}=V(),s={id:t,dir:l,getRootNode:r,...i},d=B(K,s),p=J(d,$);p.visible&&(a.current=!0);const E=!p.visible&&!a.current&&o||n&&!p.visible&&a.current;return{...p,isUnmounted:E}},[X,Y]=A({name:"CollapsibleContext",hookName:"useCollapsibleContext",providerName:"<CollapsibleProvider />"}),Z=v.forwardRef((e,o)=>{const[n,i]=F(e),t=Q(n),a=w(t.getRootProps(),i);return y.jsx(X,{value:t,children:y.jsx(R.div,{...a,ref:o})})});Z.displayName="CollapsibleRoot";const _=v.forwardRef((e,o)=>{const n=Y();if(n.isUnmounted)return null;const i=w(n.getContentProps(),e);return y.jsx(R.div,{...i,ref:o})});_.displayName="CollapsibleContent";export{Z as C,_ as a,X as b,Y as u};
@@ -1,54 +0,0 @@
1
- import{r as T,j as r}from"./iframe-B8FSoBNY.js";import{c as ye}from"./compiler-runtime-BXE7OOXE.js";import{E as ge}from"./empty-state-BXkyq69k.js";import{M as Fe,a as ne,b as xe,c as be,d as ve,e as re}from"./menu-item-CrqDaj9K.js";import{S as I}from"./stack-CN4X31TA.js";import{H as De}from"./h-stack-DWHd8f97.js";import{T as Z}from"./index-cFwdnc0b.js";import{C as Te}from"./chevron-right-owK1wZnx.js";import{F as Ce}from"./folder-C5dba_Co.js";import{F as we}from"./file-text-D5m8MJlG.js";import{B as C}from"./index-B0y2_lLF.js";import{P as Ie}from"./portal-CZHfPTRw.js";import{B as je}from"./button-C7it2n8t.js";import"./preload-helper-PPVm8Dsz.js";import"./v-stack-Btoq6OB_.js";import"./create-slot-recipe-context-DAhDE6G_.js";import"./factory-DAJZwK4o.js";import"./create-recipe-context-BU56IzEo.js";import"./tooltip-DZxUoouw.js";import"./tooltip-C_a-XGZ8.js";import"./factory-BR3bc_RM.js";import"./use-presence-context-DK2PGZth.js";import"./create-split-props-u5h9OPvL.js";import"./normalize-props-D7NI5JRu.js";import"./index-DaXC_qY_.js";import"./index-DpB4ozcR.js";import"./computed-style-C0hzrq9-.js";import"./overflow-CkG1DOya.js";import"./icons-WRA1cA-W.js";import"./tabbable-DHAf8oAu.js";import"./typeahead-CuY9WxfQ.js";import"./mutation-observer-CAfGweIM.js";import"./dismissable-layer-Cc5dFRd8.js";import"./icon-C8FN9JqD.js";import"./flex-DAJL4AFZ.js";import"./badge-CtgJasjB.js";import"./createLucideIcon-CcBBUKX8.js";import"./spinner-ZYH_gvW-.js";import"./index-CXwl6T4k.js";const ke=(t,e)=>{const o=[];let l=t,m=[];o.push({items:l,selectedFolderId:e[0],breadcrumb:m});for(let a=0;a<e.length;a++){const h=e[a],i=l.find(s=>s.id===h&&s.type==="folder");if(!i)break;m=[...m,i],l=i.children??[],o.push({items:l,selectedFolderId:e[a+1],breadcrumb:m})}return o},Se=t=>{const e=[];for(let o=t.length-1;o>=0;o-=1)e.push({item:t[o],path:[]});for(;e.length>0;){const o=e.pop();if(!o)break;const{item:l,path:m}=o;if(l.type==="file"){if(m.length===0)continue;return{path:m,file:l}}const a=l.children;if(!a||a.length===0)continue;const h=[...m,l];for(let i=a.length-1;i>=0;i-=1)e.push({item:a[i],path:h})}return null},Ae=t=>t.filter(e=>e.type==="folder").map(e=>e.id),Oe=t=>{const e=t[t.length-1]??null;return e?.type!=="file"?null:e.id},Pe=(t,e)=>t.length!==e.length?!1:t.every((o,l)=>o===e[l]),X=t=>{const e=ye.c(37),{items:o,activePath:l,emptyLabel:m,onFolderOpen:a,onFileOpen:h,onDeleteItem:i,onDownloadFile:s,onDropFiles:u,canDeleteItem:v,onUploadClick:D}=t,z=m===void 0?"This folder is empty.":m;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[0]=j):j=e[0];const[p,w]=T.useState(j),[f,N]=T.useState(null),le=ke(o,p);let k;e[1]!==o?(k=o.find(Be)??null,e[1]=o,e[2]=k):k=e[2];const x=k,S=!!(l&&l.length>0),_=$e;let A;e[3]!==u?(A=(n,c,y)=>{n.preventDefault(),n.stopPropagation();const g=Array.from(n.dataTransfer?.files??[]);g.length!==0&&u?.(g,c,y)},e[3]=u,e[4]=A):A=e[4];const O=A;let P;e[5]!==a||e[6]!==p?(P=(n,c,y)=>{const g=p.slice(0,c);g.push(n.id),w(g),N(null),a?.(n,[...y,n])},e[5]=a,e[6]=p,e[7]=P):P=e[7];const H=P;let B;e[8]!==h||e[9]!==p?(B=(n,c,y)=>{const g=p.slice(0,c);w(g),N(n.id),h?.(n,[...y,n])},e[8]=h,e[9]=p,e[10]=B):B=e[10];const J=B;let $,U;e[11]!==f||e[12]!==l||e[13]!==p?($=()=>{if(!l)return;const n=Ae(l),c=Oe(l);Pe(n,p)&&c===f||(w(n),N(c))},U=[f,l,p],e[11]=f,e[12]=l,e[13]=p,e[14]=$,e[15]=U):($=e[14],U=e[15]),T.useEffect($,U);let L,M;e[16]!==f||e[17]!==x||e[18]!==S||e[19]!==o||e[20]!==a||e[21]!==p?(L=()=>{if(S||p.length>0||f)return;const n=Se(o);if(n){const c=n.path.map(Ue),y=n.path[n.path.length-1]??null;c.length>0&&y&&(w(c),a?.(y,n.path));return}x&&(w([x.id]),a?.(x,[x]))},M=[f,x,S,o,a,p],e[16]=f,e[17]=x,e[18]=S,e[19]=o,e[20]=a,e[21]=p,e[22]=L,e[23]=M):(L=e[22],M=e[23]),T.useEffect(L,M);const G=I,ae="100%",ie="row",se="0";let E;e[24]!==f||e[25]!==v||e[26]!==z||e[27]!==O||e[28]!==J||e[29]!==H||e[30]!==i||e[31]!==s||e[32]!==D?(E=(n,c)=>{const y=n.breadcrumb.length>0&&(!!i||!!s),g=n.breadcrumb[n.breadcrumb.length-1]??null;return r.jsxs(I,{gap:"xs",p:"xs",height:"100%",minW:"240px",maxW:"320px",borderRightWidth:"1px",children:[r.jsx(De,{justify:"flex-end",gap:"0",children:r.jsxs(Z,{textStyle:"paragraph/S/regular",color:"fg.muted",children:[n.items.length," item",n.items.length===1?"":"s"]})}),r.jsxs(I,{gap:"xs",onDragOver:_,onDrop:d=>O(d,g,n.breadcrumb),children:[n.items.map(d=>{const F=d.type==="folder",de=n.selectedFolderId===d.id,me=!F&&f===d.id,R=[...n.breadcrumb,d],V=!!s&&!F,Y=!!i&&(v?v(d,R):!0),pe=y&&(V||Y),ce=()=>F?H(d,c,n.breadcrumb):J(d,c,n.breadcrumb),he=()=>{Y&&i?.(d,R)},ue=()=>{V&&s?.(d,R)},ee=fe=>O(fe,d,R),te=r.jsx(Fe,{id:d.id,primaryLabel:d.name,secondaryLabel:d.meta,leftIcon:F?Ce:we,rightIcon:F?Te:null,isSelected:de||me,onClick:ce});return pe?r.jsxs(ne,{children:[r.jsx(xe,{asChild:!0,children:r.jsx(C,{width:"100%",onDragOver:F?_:void 0,onDrop:F?ee:void 0,children:te})}),r.jsx(Ie,{children:r.jsx(be,{children:r.jsxs(ve,{minW:"180px",bg:"bg",zIndex:"popover",children:[V?r.jsx(re,{value:"download",onClick:ue,children:"Download"}):null,Y?r.jsx(re,{value:"delete",color:"fg.error",onClick:he,children:"Delete"}):null]})})})]},d.id):r.jsx(ne,{children:r.jsx(C,{width:"100%",onDragOver:F?_:void 0,onDrop:F?ee:void 0,children:te})},d.id)}),n.items.length===0?r.jsx(C,{borderWidth:"1px",borderColor:"border.muted",p:"md",height:"100%",children:r.jsx(ge,{title:z,size:"sm",textAlign:"left",alignItems:"flex-start",height:"100%",children:D?r.jsx(je,{size:"sm",variant:"outline",onClick:D,children:"Upload files"}):null})}):null]})]},n.breadcrumb.map(Le).join("/")||"root")},e[24]=f,e[25]=v,e[26]=z,e[27]=O,e[28]=J,e[29]=H,e[30]=i,e[31]=s,e[32]=D,e[33]=E):E=e[33];const Q=le.map(E);let q;return e[34]!==G||e[35]!==Q?(q=r.jsx(G,{height:ae,direction:ie,gap:se,children:Q}),e[34]=G,e[35]=Q,e[36]=q):q=e[36],q};X.__docgenInfo={description:"",methods:[],displayName:"ColumnFileBrowser",props:{items:{required:!0,tsType:{name:"Array",elements:[{name:"T"}],raw:"T[]"},description:""},activePath:{required:!1,tsType:{name:"Array",elements:[{name:"T"}],raw:"T[]"},description:""},onFolderOpen:{required:!1,tsType:{name:"signature",type:"function",raw:"(folder: T, path: T[]) => void",signature:{arguments:[{type:{name:"T"},name:"folder"},{type:{name:"Array",elements:[{name:"T"}],raw:"T[]"},name:"path"}],return:{name:"void"}}},description:""},onFileOpen:{required:!1,tsType:{name:"signature",type:"function",raw:"(file: T, path: T[]) => void",signature:{arguments:[{type:{name:"T"},name:"file"},{type:{name:"Array",elements:[{name:"T"}],raw:"T[]"},name:"path"}],return:{name:"void"}}},description:""},onDeleteItem:{required:!1,tsType:{name:"signature",type:"function",raw:"(item: T, path: T[]) => void",signature:{arguments:[{type:{name:"T"},name:"item"},{type:{name:"Array",elements:[{name:"T"}],raw:"T[]"},name:"path"}],return:{name:"void"}}},description:""},onDownloadFile:{required:!1,tsType:{name:"signature",type:"function",raw:"(file: T, path: T[]) => void",signature:{arguments:[{type:{name:"T"},name:"file"},{type:{name:"Array",elements:[{name:"T"}],raw:"T[]"},name:"path"}],return:{name:"void"}}},description:""},onDropFiles:{required:!1,tsType:{name:"signature",type:"function",raw:"(files: File[], folder: T | null, path: T[]) => void",signature:{arguments:[{type:{name:"Array",elements:[{name:"File"}],raw:"File[]"},name:"files"},{type:{name:"union",raw:"T | null",elements:[{name:"T"},{name:"null"}]},name:"folder"},{type:{name:"Array",elements:[{name:"T"}],raw:"T[]"},name:"path"}],return:{name:"void"}}},description:""},emptyLabel:{required:!1,tsType:{name:"string"},description:""},canDeleteItem:{required:!1,tsType:{name:"signature",type:"function",raw:"(item: T, path: T[]) => boolean",signature:{arguments:[{type:{name:"T"},name:"item"},{type:{name:"Array",elements:[{name:"T"}],raw:"T[]"},name:"path"}],return:{name:"boolean"}}},description:""},onUploadClick:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}};function Be(t){return t.type==="folder"}function $e(t){t.preventDefault(),t.stopPropagation()}function Ue(t){return t.id}function Le(t){return t.id}const Me=[{id:"sample-raw",name:"sample-raw",type:"folder",meta:"3 items",children:[{id:"sample-raw/invoices",name:"invoices",type:"folder",meta:"2 items",children:[{id:"sample-raw/invoices/2024-02.pdf",name:"2024-02.pdf",type:"file",meta:"1.2 MB · Feb 2, 2024"},{id:"sample-raw/invoices/2024-03.pdf",name:"2024-03.pdf",type:"file",meta:"980 KB · Mar 8, 2024"}]},{id:"sample-raw/contracts",name:"contracts",type:"folder",meta:"1 item",children:[{id:"sample-raw/contracts/vendor-agreement.pdf",name:"vendor-agreement.pdf",type:"file",meta:"2.1 MB · Jan 18, 2024"}]},{id:"sample-raw/notes.md",name:"notes.md",type:"file",meta:"6 KB · Apr 8, 2024"}]},{id:"sample-artifacts",name:"sample-artifacts",type:"folder",meta:"2 items",children:[{id:"sample-artifacts/run-042",name:"run-042",type:"folder",meta:"1 item",children:[{id:"sample-artifacts/run-042/output.json",name:"output.json",type:"file",meta:"48 KB · May 8, 2024"}]},{id:"sample-artifacts/logs",name:"logs",type:"folder",meta:"0 items",children:[]}]},{id:"sample-validation/summary.csv",name:"summary.csv",type:"file",meta:"18 KB · Jul 20, 2024"}],Ee=[{id:"sample-raw",name:"sample-raw",type:"folder",meta:"0 items",children:[]}],b=t=>t.length===0?"root":t.map(e=>e.name).join(" / "),oe=t=>`${t} file${t===1?"":"s"}`,qe=t=>t.type==="file",wt={title:"Components/ColumnFileBrowser",component:X,decorators:[t=>r.jsx(C,{padding:"sm",background:"bg",children:r.jsx(t,{})})]},W={render:()=>{const[t,e]=T.useState("Select a file or folder."),o=(s,u)=>{e(`Opened folder: ${b(u)}`)},l=(s,u)=>{e(`Opened file: ${b(u)}`)},m=(s,u)=>{e(`Deleted ${s.type}: ${b(u)}`)},a=(s,u)=>{e(`Downloaded: ${b(u)}`)},h=(s,u,v)=>{const D=oe(s.length);e(`Dropped ${D} into ${b(v)}`)},i=()=>{e("Upload clicked.")};return r.jsxs(I,{gap:"sm",children:[r.jsx(C,{borderWidth:"1px",borderColor:"border.muted",borderRadius:"md",overflow:"hidden",height:"420px",children:r.jsx(X,{items:Me,emptyLabel:"This folder is empty.",onFolderOpen:o,onFileOpen:l,onDeleteItem:m,onDownloadFile:a,onDropFiles:h,onUploadClick:i,canDeleteItem:qe})}),r.jsx(Z,{textStyle:"paragraph/XS/regular",color:"fg.muted",children:t})]})}},K={render:()=>{const[t,e]=T.useState("Drop files here to upload."),o=(a,h)=>{e(`Opened folder: ${b(h)}`)},l=(a,h,i)=>{const s=oe(a.length);e(`Dropped ${s} into ${b(i)}`)},m=()=>{e("Upload clicked.")};return r.jsxs(I,{gap:"sm",children:[r.jsx(C,{borderWidth:"1px",borderColor:"border.muted",borderRadius:"md",overflow:"hidden",height:"280px",children:r.jsx(X,{items:Ee,emptyLabel:"Nothing here yet.",onFolderOpen:o,onDropFiles:l,onUploadClick:m})}),r.jsx(Z,{textStyle:"paragraph/XS/regular",color:"fg.muted",children:t})]})}};W.parameters={...W.parameters,docs:{...W.parameters?.docs,source:{originalSource:`{
2
- render: () => {
3
- const [activity, setActivity] = useState("Select a file or folder.");
4
- const handleFolderOpen = (_folder: ColumnFileItem, path: ColumnFileItem[]) => {
5
- setActivity(\`Opened folder: \${formatPath(path)}\`);
6
- };
7
- const handleFileOpen = (_file: ColumnFileItem, path: ColumnFileItem[]) => {
8
- setActivity(\`Opened file: \${formatPath(path)}\`);
9
- };
10
- const handleDeleteItem = (item: ColumnFileItem, path: ColumnFileItem[]) => {
11
- setActivity(\`Deleted \${item.type}: \${formatPath(path)}\`);
12
- };
13
- const handleDownloadFile = (_file: ColumnFileItem, path: ColumnFileItem[]) => {
14
- setActivity(\`Downloaded: \${formatPath(path)}\`);
15
- };
16
- const handleDropFiles = (files: File[], _folder: ColumnFileItem | null, path: ColumnFileItem[]) => {
17
- const fileLabel = formatFileCount(files.length);
18
- setActivity(\`Dropped \${fileLabel} into \${formatPath(path)}\`);
19
- };
20
- const handleUploadClick = () => {
21
- setActivity("Upload clicked.");
22
- };
23
- return <Stack gap="sm">
24
- <Box borderWidth="1px" borderColor="border.muted" borderRadius="md" overflow="hidden" height="420px">
25
- <ColumnFileBrowser items={demoItems} emptyLabel="This folder is empty." onFolderOpen={handleFolderOpen} onFileOpen={handleFileOpen} onDeleteItem={handleDeleteItem} onDownloadFile={handleDownloadFile} onDropFiles={handleDropFiles} onUploadClick={handleUploadClick} canDeleteItem={canDeleteItem} />
26
- </Box>
27
- <Text textStyle="paragraph/XS/regular" color="fg.muted">
28
- {activity}
29
- </Text>
30
- </Stack>;
31
- }
32
- }`,...W.parameters?.docs?.source}}};K.parameters={...K.parameters,docs:{...K.parameters?.docs,source:{originalSource:`{
33
- render: () => {
34
- const [activity, setActivity] = useState("Drop files here to upload.");
35
- const handleFolderOpen = (_folder: ColumnFileItem, path: ColumnFileItem[]) => {
36
- setActivity(\`Opened folder: \${formatPath(path)}\`);
37
- };
38
- const handleDropFiles = (files: File[], _folder: ColumnFileItem | null, path: ColumnFileItem[]) => {
39
- const fileLabel = formatFileCount(files.length);
40
- setActivity(\`Dropped \${fileLabel} into \${formatPath(path)}\`);
41
- };
42
- const handleUploadClick = () => {
43
- setActivity("Upload clicked.");
44
- };
45
- return <Stack gap="sm">
46
- <Box borderWidth="1px" borderColor="border.muted" borderRadius="md" overflow="hidden" height="280px">
47
- <ColumnFileBrowser items={emptyItems} emptyLabel="Nothing here yet." onFolderOpen={handleFolderOpen} onDropFiles={handleDropFiles} onUploadClick={handleUploadClick} />
48
- </Box>
49
- <Text textStyle="paragraph/XS/regular" color="fg.muted">
50
- {activity}
51
- </Text>
52
- </Stack>;
53
- }
54
- }`,...K.parameters?.docs?.source}}};const It=["Default","EmptyFolder"];export{W as Default,K as EmptyFolder,It as __namedExportsOrder,wt as default};
@@ -1 +0,0 @@
1
- import{f as n}from"./iframe-B8FSoBNY.js";var r={exports:{}},e={};var t;function a(){if(t)return e;t=1;var o=n().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return e.c=function(u){return o.H.useMemoCache(u)},e}var i;function R(){return i||(i=1,r.exports=a()),r.exports}var p=R();export{p as c};
@@ -1 +0,0 @@
1
- import{q as a}from"./factory-BR3bc_RM.js";var e=new WeakMap;function r(t){return e.has(t)||e.set(t,a(t).getComputedStyle(t)),e.get(t)}export{r as g};
@@ -1 +0,0 @@
1
- import{u as R,r as i,e as S,j as h,c as j}from"./iframe-B8FSoBNY.js";import{c as k,m as v}from"./factory-DAJZwK4o.js";const M=Object.freeze({}),L=Object.freeze({});function T(s){const{key:t,recipe:o}=s,r=R();return i.useMemo(()=>{const a=o||(t!=null?r.getRecipe(t):{});return r.cva(structuredClone(a))},[t,o,r])}const Y=s=>s.charAt(0).toUpperCase()+s.slice(1);function O(s){const{key:t,recipe:o}=s,r=Y(t||o.className||"Component"),[a,P]=S({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`});function C(c){const{unstyled:u,...n}=c,e=T({key:t,recipe:n.recipe||o}),[p,m]=i.useMemo(()=>e.splitVariantProps(n),[e,n]);return{styles:u?M:e(p),className:e.className,props:m}}const f=(c,u)=>{const n=k(c,{},u),e=i.forwardRef((p,m)=>{const l=P(),x=i.useMemo(()=>v(l,p),[p,l]),{styles:N,className:d,props:E}=C(x);return h.jsx(n,{...E,ref:m,css:[N,x.css],className:j(d,x.className)})});return e.displayName=c.displayName||c.name,e};function y(){return a}return{withContext:f,PropsProvider:a,withPropsProvider:y,usePropsContext:P,useRecipeResult:C}}export{M as E,L as a,O as c,T as u};
@@ -1 +0,0 @@
1
- import{u as V,r as l,e as v,j as p,c as $}from"./iframe-B8FSoBNY.js";import{c as g,m as k}from"./factory-DAJZwK4o.js";import{a as Y}from"./create-recipe-context-BU56IzEo.js";function _(i){const{key:u,recipe:y}=i,s=V();return l.useMemo(()=>{const x=y||(u!=null?s.getSlotRecipe(u):{});return s.sva(structuredClone(x))},[u,y,s])}const A=i=>i.charAt(0).toUpperCase()+i.slice(1),z=i=>{const{key:u,recipe:y}=i,s=A(u||y.className||"Component"),[x,R]=v({name:`${s}StylesContext`,errorMessage:`use${s}Styles returned is 'undefined'. Seems you forgot to wrap the components in "<${s}.Root />" `}),[P,w]=v({name:`${s}ClassNameContext`,errorMessage:`use${s}ClassNames returned is 'undefined'. Seems you forgot to wrap the components in "<${s}.Root />" `,strict:!1}),[E,S]=v({strict:!1,name:`${s}PropsContext`,providerName:`${s}PropsContext`,defaultValue:{}});function h(e){const{unstyled:o,...r}=e,t=_({key:u,recipe:r.recipe||y}),[a,n]=l.useMemo(()=>t.splitVariantProps(r),[r,t]);return{styles:l.useMemo(()=>o?Y:t(a),[o,a,t]),classNames:t.classNameMap,props:n}}function T(e,o={}){const{defaultProps:r}=o,t=a=>{const n=S(),c=l.useMemo(()=>k(r,n,a),[n,a]),{styles:m,classNames:N,props:d}=h(c);return p.jsx(x,{value:m,children:p.jsx(P,{value:N,children:p.jsx(e,{...d})})})};return t.displayName=e.displayName||e.name,t}return{StylesProvider:x,ClassNamesProvider:P,PropsProvider:E,usePropsContext:S,useRecipeResult:h,withProvider:(e,o,r)=>{const{defaultProps:t,...a}=r??{},n=g(e,{},a),c=l.forwardRef((m,N)=>{const d=S(),f=l.useMemo(()=>k(t??{},d,m),[d,m]),{styles:C,props:L,classNames:j}=h(f),O=j[o],M=p.jsx(x,{value:C,children:p.jsx(P,{value:j,children:p.jsx(n,{ref:N,...L,css:[C[o],f.css],className:$(f.className,O)})})});return r?.wrapElement?.(M,f)??M});return c.displayName=e.displayName||e.name,c},withContext:(e,o,r)=>{const t=g(e,{},r),a=l.forwardRef((n,c)=>{const{unstyled:m,...N}=n,d=R(),C=w()?.[o];return p.jsx(t,{...N,css:[!m&&o?d[o]:void 0,n.css],ref:c,className:$(n.className,C)})});return a.displayName=e.displayName||e.name,a},withRootProvider:T,useStyles:R,useClassNames:w}};export{z as c,_ as u};
@@ -1 +0,0 @@
1
- const a=()=>(c,o)=>o.reduce((s,n)=>{const[r,e]=s,t=n;return e[t]!==void 0&&(r[t]=e[t]),delete e[t],[r,e]},[{},{...c}]);export{a as c};
@@ -1 +0,0 @@
1
- import{r as s}from"./iframe-B8FSoBNY.js";const C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=w(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const g=s.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:u,...c},p)=>s.createElement("svg",{ref:p,...h,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",n),...!a&&!f(c)&&{"aria-hidden":"true"},...c},[...u.map(([m,d])=>s.createElement(m,d)),...Array.isArray(a)?a:[a]]));const b=(t,e)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:e,className:l(`lucide-${C(i(t))}`,`lucide-${t}`,o),...n}));return r.displayName=i(t),r};export{b as c};
@@ -1 +0,0 @@
1
- .data-table{table-layout:fixed}.data-table.full-width{width:100%;table-layout:auto}.data-table tr{width:fit-content}.data-table.full-width tr{width:100%}.data-table .resizer{position:absolute;top:0;height:100%;right:0;width:5px;background-color:var(--chakra-colors-border-primary);opacity:.5;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none}.data-table .resizer.isResizing{opacity:1}@media(hover:hover){.data-table .resizer{opacity:0}.data-table *:hover>.resizer{opacity:1}}.data-table .resizer.ltr{right:0}.data-table .resizer.rtl{left:0}